1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HelpDrawer-utPzgvVI.js","assets/GuideMarkdown--o8w0w-k.js","assets/docs-content-CXZ7Ugx6.js","assets/index-DYhOx1Zu.js","assets/DocsRoutes-B56pVzgg.js","assets/send-C5CPYUHs.js","assets/ChatPage-CTjqkeWn.js","assets/useAiTerms-Dxs4w_Kf.js","assets/useChat-CgEIp4ph.js","assets/ChatWidget-CEHoUjps.js","assets/WorkbenchTab-D9I7lzjE.js"])))=>i.map(i=>d[i]); 2function Fne(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var b_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ka(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zne(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var a=!1;try{a=this instanceof r}catch{}return a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var y_={exports:{}},Op={};/** 3 * @license React 4 * react-jsx-runtime.production.js 5 * 6 * Copyright (c) Meta Platforms, Inc. and affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var eD;function Bne(){if(eD)return Op;eD=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var o=null;if(s!==void 0&&(o=""+s),a.key!==void 0&&(o=""+a.key),"key"in a){s={};for(var l in a)l!=="key"&&(s[l]=a[l])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:o,ref:a!==void 0?a:null,props:s}}return Op.Fragment=t,Op.jsx=n,Op.jsxs=n,Op}var tD;function Une(){return tD||(tD=1,y_.exports=Bne()),y_.exports}var i=Une(),v_={exports:{}},at={};/** 11 * @license React 12 * react.production.js 13 * 14 * Copyright (c) Meta Platforms, Inc. and affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var nD;
vendor: 5,878 bytes, line 18
18function qne(){if(nD)return at;nD=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g(I){return I===null||typeof I!="object"?null:(I=p&&I[p]||I["@@iterator"],typeof I=="function"?I:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,w={};function j(I,H,V){this.props=I,this.context=H,this.refs=w,this.updater=V||x}j.prototype.isReactComponent={},j.prototype.setState=function(I,H){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,H,"setState")},j.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function N(){}N.prototype=j.prototype;function k(I,H,V){this.props=I,this.context=H,this.refs=w,this.updater=V||x}var S=k.prototype=new N;S.constructor=k,y(S,j.prototype),S.isPureReactComponent=!0;var E=Array.isArray,O={H:null,A:null,T:null,S:null,V:null},T=Object.prototype.hasOwnProperty;function P(I,H,V,X,te,fe){return V=fe.ref,{$$typeof:e,type:I,key:H,ref:V!==void 0?V:null,props:fe}}function M(I,H){return P(I.type,H,void 0,void 0,void 0,I.props)}function D(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function A(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(V){return H[V]})}var L=/\/+/g;function F(I,H){return typeof I=="object"&&I!==null&&I.key!=null?A(""+I.key):H.toString(36)}function B(){}function U(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(B,B):(I.status="pending",I.then(function(H){I.status==="pending"&&(I.status="fulfilled",I.value=H)},function(H){I.status==="pending"&&(I.status="rejected",I.reason=H)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function z(I,H,V,X,te){var fe=typeof I;(fe==="undefined"||fe==="boolean")&&(I=null);var ae=!1;if(I===null)ae=!0;else switch(fe){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(I.$$typeof){case e:case t:ae=!0;break;case h:return ae=I._init,z(ae(I._payload),H,V,X,te)}}if(ae)return te=te(I),ae=X===""?"."+F(I,0):X,E(te)?(V="",ae!=null&&(V=ae.replace(L,"$&/")+"/"),z(te,H,V,"",function(ue){return ue})):te!=null&&(D(te)&&(te=M(te,V+(te.key==null||I&&I.key===te.key?"":(""+te.key).replace(L,"$&/")+"/")+ae)),H.push(te)),1;ae=0;var ke=X===""?".":X+":";if(E(I))for(var xe=0;xe<I.length;xe++)X=I[xe],fe=ke+F(X,xe),ae+=z(X,H,V,fe,te);else if(xe=g(I),typeof xe=="function")for(I=xe.call(I),xe=0;!(X=I.next()).done;)X=X.value,fe=ke+F(X,xe++),ae+=z(X,H,V,fe,te);else if(fe==="object"){if(typeof I.then=="function")return z(U(I),H,V,X,te);throw H=String(I),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ae}function $(I,H,V){if(I==null)return I;var X=[],te=0;return z(I,X,"","",function(fe){return H.call(V,fe,te++)}),X}function K(I){if(I._status===-1){var H=I._result;H=H(),H.then(function(V){(I._status===0||I._status===-1)&&(I._status=1,I._result=V)},function(V){(I._status===0||I._status===-1)&&(I._status=2,I._result=V)}),I._status===-1&&(I._status=0,I._result=H)}if(I._status===1)return I._result.default;throw I._result}var G=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function W(){}return at.Children={map:$,forEach:function(I,H,V){$(I,function(){H.apply(this,arguments)},V)},count:function(I){var H=0;return $(I,function(){H++}),H},toArray:function(I){return $(I,function(H){return H})||[]},only:function(I){if(!D(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},at.Component=j,at.Fragment=n,at.Profiler=a,at.PureComponent=k,at.StrictMode=r,at.Suspense=u,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,at.__COMPILER_RUNTIME={__proto__:null,c:function(I){return O.H.useMemoCache(I)}},at.cache=function(I){return function(){return I.apply(null,arguments)}},at.cloneElement=function(I,H,V){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var X=y({},I.props),te=I.key,fe=void 0;if(H!=null)for(ae in H.ref!==void 0&&(fe=void 0),H.key!==void 0&&(te=""+H.key),H)!T.call(H,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&H.ref===void 0||(X[ae]=H[ae]);var ae=arguments.length-2;if(ae===1)X.children=V;else if(1<ae){for(var ke=Array(ae),xe=0;xe<ae;xe++)ke[xe]=arguments[xe+2];X.children=ke}return P(I.type,te,void 0,void 0,fe,X)},at.createContext=function(I){return I={$$typeof:o,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:s,_context:I},I},at.createElement=function(I,H,V){var X,te={},fe=null;if(H!=null)for(X in H.key!==void 0&&(fe=""+H.key),H)T.call(H,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(te[X]=H[X]);var ae=arguments.length-2;if(ae===1)te.children=V;else if(1<ae){for(var ke=Array(ae),xe=0;xe<ae;xe++)ke[xe]=arguments[xe+2];te.children=ke}
vendor: 5,774 bytes, lines 18-26
18if(I&&I.defaultProps)for(X in ae=I.defaultProps,ae)te[X]===void 0&&(te[X]=ae[X]);return P(I,fe,void 0,void 0,null,te)},at.createRef=function(){return{current:null}},at.forwardRef=function(I){return{$$typeof:l,render:I}},at.isValidElement=D,at.lazy=function(I){return{$$typeof:h,_payload:{_status:-1,_result:I},_init:K}},at.memo=function(I,H){return{$$typeof:d,type:I,compare:H===void 0?null:H}},at.startTransition=function(I){var H=O.T,V={};O.T=V;try{var X=I(),te=O.S;te!==null&&te(V,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(W,G)}catch(fe){G(fe)}finally{O.T=H}},at.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},at.use=function(I){return O.H.use(I)},at.useActionState=function(I,H,V){return O.H.useActionState(I,H,V)},at.useCallback=function(I,H){return O.H.useCallback(I,H)},at.useContext=function(I){return O.H.useContext(I)},at.useDebugValue=function(){},at.useDeferredValue=function(I,H){return O.H.useDeferredValue(I,H)},at.useEffect=function(I,H,V){var X=O.H;if(typeof V=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return X.useEffect(I,H)},at.useId=function(){return O.H.useId()},at.useImperativeHandle=function(I,H,V){return O.H.useImperativeHandle(I,H,V)},at.useInsertionEffect=function(I,H){return O.H.useInsertionEffect(I,H)},at.useLayoutEffect=function(I,H){return O.H.useLayoutEffect(I,H)},at.useMemo=function(I,H){return O.H.useMemo(I,H)},at.useOptimistic=function(I,H){return O.H.useOptimistic(I,H)},at.useReducer=function(I,H,V){return O.H.useReducer(I,H,V)},at.useRef=function(I){return O.H.useRef(I)},at.useState=function(I){return O.H.useState(I)},at.useSyncExternalStore=function(I,H,V){return O.H.useSyncExternalStore(I,H,V)},at.useTransition=function(){return O.H.useTransition()},at.version="19.1.0",at}var rD;function ti(){return rD||(rD=1,v_.exports=qne()),v_.exports}var v=ti();const ve=ka(v),Pm=Fne({__proto__:null,default:ve},[v]);var w_={exports:{}},Ap={},j_={exports:{}},N_={};/** 19 * @license React 20 * scheduler.production.js 21 * 22 * Copyright (c) Meta Platforms, Inc. and affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */var aD;function Hne(){return aD||(aD=1,function(e){function t($,K){var G=$.length;$.push(K);e:for(;0<G;){var W=G-1>>>1,I=$[W];if(0<a(I,K))$[W]=K,$[G]=I,G=W;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var K=$[0],G=$.pop();if(G!==K){$[0]=G;e:for(var W=0,I=$.length,H=I>>>1;W<H;){var V=2*(W+1)-1,X=$[V],te=V+1,fe=$[te];if(0>a(X,G))te<I&&0>a(fe,X)?($[W]=fe,$[te]=G,W=te):($[W]=X,$[V]=G,W=V);else if(te<I&&0>a(fe,G))$[W]=fe,$[te]=G,W=te;else break e}}return K}function a($,K){var G=$.sortIndex-K.sortIndex;return G!==0?G:$.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],d=[],h=1,p=null,g=3,x=!1,y=!1,w=!1,j=!1,N=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function E($){for(var K=n(d);K!==null;){if(K.callback===null)r(d);else if(K.startTime<=$)r(d),K.sortIndex=K.expirationTime,t(u,K);else break;K=n(d)}}function O($){if(w=!1,E($),!y)if(n(u)!==null)y=!0,T||(T=!0,F());else{var K=n(d);K!==null&&z(O,K.startTime-$)}}var T=!1,P=-1,M=5,D=-1;function A(){return j?!0:!(e.unstable_now()-D<M)}function L(){if(j=!1,T){var $=e.unstable_now();D=$;var K=!0;try{e:{y=!1,w&&(w=!1,k(P),P=-1),x=!0;var G=g;try{t:{for(E($),p=n(u);p!==null&&!(p.expirationTime>$&&A());){var W=p.callback;if(typeof W=="function"){p.callback=null,g=p.priorityLevel;var I=W(p.expirationTime<=$);if($=e.unstable_now(),typeof I=="function"){p.callback=I,E($),K=!0;break t}p===n(u)&&r(u),E($)}else r(u);p=n(u)}if(p!==null)K=!0;else{var H=n(d);H!==null&&z(O,H.startTime-$),K=!1}}break e}finally{p=null,g=G,x=!1}K=void 0}}finally{K?F():T=!1}}}var F;if(typeof S=="function")F=function(){S(L)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,U=B.port2;B.port1.onmessage=L,F=function(){U.postMessage(null)}}else F=function(){N(L,0)};function z($,K){P=N(function(){$(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function($){switch(g){case 1:case 2:case 3:var K=3;break;default:K=g}var G=g;g=K;try{return $()}finally{g=G}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function($,K){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var G=g;g=$;try{return K()}finally{g=G}},e.unstable_scheduleCallback=function($,K,G){var W=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?W+G:W):G=W,$){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=G+I,$={id:h++,callback:K,priorityLevel:$,startTime:G,expirationTime:I,sortIndex:-1},G>W?($.sortIndex=G,t(d,$),n(u)===null&&$===n(d)&&(w?(k(P),P=-1):w=!0,z(O,G-W))):($.sortIndex=I,t(u,$),y||x||(y=!0,T||(T=!0,F()))),$},e.unstable_shouldYield=A,e.unstable_wrapCallback=function($){var K=g;return function(){var G=g;g=K;try{return $.apply(this,arguments)}finally{g=G}}}}(N_)),N_}var sD;
vendor: 22,163 bytes, lines 26-49
26function Kne(){return sD||(sD=1,j_.exports=Hne()),j_.exports}var __={exports:{}},Ir={};/** 27 * @license React 28 * react-dom.production.js 29 * 30 * Copyright (c) Meta Platforms, Inc. and affiliates. 31 * 32 * This source code is licensed under the MIT license found in the 33 * LICENSE file in the root directory of this source tree. 34 */var iD;function Vne(){if(iD)return Ir;iD=1;var e=ti();function t(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)d+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(u,d,h){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:u,containerInfo:d,implementation:h}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ir.createPortal=function(u,d){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return s(u,d,null,h)},Ir.flushSync=function(u){var d=o.T,h=r.p;try{if(o.T=null,r.p=2,u)return u()}finally{o.T=d,r.p=h,r.d.f()}},Ir.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(u,d))},Ir.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Ir.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var h=d.as,p=l(h,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;h==="style"?r.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:x}):h==="script"&&r.d.X(u,{crossOrigin:p,integrity:g,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ir.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var h=l(d.as,d.crossOrigin);r.d.M(u,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(u)},Ir.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var h=d.as,p=l(h,d.crossOrigin);r.d.L(u,h,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ir.preloadModule=function(u,d){if(typeof u=="string")if(d){var h=l(d.as,d.crossOrigin);r.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(u)},Ir.requestFormReset=function(u){r.d.r(u)},Ir.unstable_batchedUpdates=function(u,d){return u(d)},Ir.useFormState=function(u,d,h){return o.H.useFormState(u,d,h)},Ir.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ir.version="19.1.0",Ir}var oD;function Lz(){if(oD)return __.exports;oD=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),__.exports=Vne(),__.exports}/** 35 * @license React 36 * react-dom-client.production.js 37 * 38 * Copyright (c) Meta Platforms, Inc. and affiliates. 39 * 40 * This source code is licensed under the MIT license found in the 41 * LICENSE file in the root directory of this source tree. 42 */var lD;function Gne(){if(lD)return Ap;lD=1;var e=Kne(),t=ti(),n=Lz();function r(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function s(c){var f=c,m=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,(f.flags&4098)!==0&&(m=f.return),c=f.return;while(c)}return f.tag===3?m:null}function o(c){if(c.tag===13){var f=c.memoizedState;if(f===null&&(c=c.alternate,c!==null&&(f=c.memoizedState)),f!==null)return f.dehydrated}return null}function l(c){if(s(c)!==c)throw Error(r(188))}function u(c){var f=c.alternate;if(!f){if(f=s(c),f===null)throw Error(r(188));return f!==c?null:c}for(var m=c,b=f;;){var _=m.return;if(_===null)break;var C=_.alternate;if(C===null){if(b=_.return,b!==null){m=b;continue}break}if(_.child===C.child){for(C=_.child;C;){if(C===m)return l(_),c;if(C===b)return l(_),f;C=C.sibling}throw Error(r(188))}if(m.return!==b.return)m=_,b=C;else{for(var R=!1,q=_.child;q;){if(q===m){R=!0,m=_,b=C;break}if(q===b){R=!0,b=_,m=C;break}q=q.sibling}if(!R){for(q=C.child;q;){if(q===m){R=!0,m=C,b=_;break}if(q===b){R=!0,b=C,m=_;break}q=q.sibling}if(!R)throw Error(r(189))}}if(m.alternate!==b)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?c:f}function d(c){var f=c.tag;if(f===5||f===26||f===27||f===6)return c;for(c=c.child;c!==null;){if(f=d(c),f!==null)return f;c=c.sibling}return null}var h=Object.assign,p=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),k=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),A=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function F(c){return c===null||typeof c!="object"?null:(c=L&&c[L]||c["@@iterator"],typeof c=="function"?c:null)}var B=Symbol.for("react.client.reference");function U(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===B?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case y:return"Fragment";case j:return"Profiler";case w:return"StrictMode";case O:return"Suspense";case T:return"SuspenseList";case D:return"Activity"}if(typeof c=="object")switch(c.$$typeof){case x:return"Portal";case S:return(c.displayName||"Context")+".Provider";case k:return(c._context.displayName||"Context")+".Consumer";case E:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case P:return f=c.displayName||null,f!==null?f:U(c.type)||"Memo";case M:f=c._payload,c=c._init;try{return U(c(f))}catch{}}return null}var z=Array.isArray,$=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},W=[],I=-1;function H(c){return{current:c}}function V(c){0>I||(c.current=W[I],W[I]=null,I--)}function X(c,f){I++,W[I]=c.current,c.current=f}var te=H(null),fe=H(null),ae=H(null),ke=H(null);function xe(c,f){switch(X(ae,f),X(fe,c),X(te,null),f.nodeType){case 9:case 11:c=(c=f.documentElement)&&(c=c.namespaceURI)?EM(c):0;break;default:if(c=f.tagName,f=f.namespaceURI)f=EM(f),c=OM(f,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}V(te),X(te,c)}function ue(){V(te),V(fe),V(ae)}function we(c){c.memoizedState!==null&&X(ke,c);var f=te.current,m=OM(f,c.type);f!==m&&(X(fe,c),X(te,m))}function Oe(c){fe.current===c&&(V(te),V(fe)),ke.current===c&&(V(ke),_p._currentValue=G)}var ne=Object.prototype.hasOwnProperty,_e=e.unstable_scheduleCallback,ye=e.unstable_cancelCallback,Me=e.unstable_shouldYield,qe=e.unstable_requestPaint,be=e.unstable_now,Ce=e.unstable_getCurrentPriorityLevel,$t=e.unstable_ImmediatePriority,en=e.unstable_UserBlockingPriority,Ot=e.unstable_NormalPriority,Le=e.unstable_LowPriority,gn=e.unstable_IdlePriority,Aa=e.log,tt=e.unstable_setDisableYieldValue,Kt=null,ze=null;function et(c){if(typeof Aa=="function"&&tt(c),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(Kt,c)}catch{}}var jn=Math.clz32?Math.clz32:kee,ij=Math.log,ux=Math.LN2;function kee(c){return c>>>=0,c===0?32:31-(ij(c)/ux|0)|0}var dx=256,fx=4194304;function mc(c){var f=c&42;if(f!==0)return f;switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function hx(c,f,m){var b=c.pendingLanes;if(b===0)return 0;var _=0,C=c.suspendedLanes,R=c.pingedLanes;c=c.warmLanes;var q=b&134217727;return q!==0?(b=q&~C,b!==0?_=mc(b):(R&=q,R!==0?_=mc(R):m||(m=q&~c,m!==0&&(_=mc(m))))):(q=b&~C,q!==0?_=mc(q):R!==0?_=mc(R):m||(m=b&~c,m!==0&&(_=mc(m)))),_===0?0:f!==0&&f!==_&&(f&C)===0&&(C=_&-_,m=f&-f,C>=m||C===32&&(m&4194048)!==0)?f:_}function Rh(c,f){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&f)===0}function See(c,f){switch(c){case 1:case 2:case 4:case 8:case 64:return f+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function d3(){var c=dx;return dx<<=1,(dx&4194048)===0&&(dx=256),c}function f3(){var c=fx;return fx<<=1,(fx&62914560)===0&&(fx=4194304),c}function oj(c){for(var f=[],m=0;31>m;m++)f.push(c);return f}function Mh(c,f){c.pendingLanes|=f,f!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function Cee(c,f,m,b,_,C){var R=c.pendingLanes;c.pendingLanes=m,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=m,c.entangledLanes&=m,c.errorRecoveryDisabledLanes&=m,c.shellSuspendCounter=0;var q=c.entanglements,Y=c.expirationTimes,ee=c.hiddenUpdates;for(m=R&~m;0<m;){var he=31-jn(m),me=1<<he;q[he]=0,Y[he]=-1;var re=ee[he];if(re!==null)for(ee[he]=null,he=0;he<re.length;he++){var se=re[he];se!==null&&(se.lane&=-536870913)}m&=~me}b!==0&&h3(c,b,0),C!==0&&_===0&&c.tag!==0&&(c.suspendedLanes|=C&~(R&~f))}function h3(c,f,m){c.pendingLanes|=f,c.suspendedLanes&=~f;var b=31-jn(f);c.entangledLanes|=f,c.entanglements[b]=c.entanglements[b]|1073741824|m&4194090}function p3(c,f){var m=c.entangledLanes|=f;for(c=c.entanglements;m;){var b=31-jn(m),_=1<<b;_&f|c[b]&f&&(c[b]|=f),m&=~_}}function lj(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function cj(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function m3(){var c=K.p;return c!==0?c:(c=window.event,c===void 0?32:WM(c.type))}function Eee(c,f){var m=K.p;try{return K.p=c,f()}finally{K.p=m}}var Qo=Math.random().toString(36).slice(2),Dr="__reactFiber$"+Qo,aa="__reactProps$"+Qo,ed="__reactContainer$"+Qo,uj="__reactEvents$"+Qo,Oee="__reactListeners$"+Qo,Aee="__reactHandles$"+Qo,g3="__reactResources$"+Qo,Dh="__reactMarker$"+Qo;function dj(c){delete c[Dr],delete c[aa],delete c[uj],delete c[Oee],delete c[Aee]}function td(c){var f=c[Dr];if(f)return f;for(var m=c.parentNode;m;){if(f=m[ed]||m[Dr]){if(m=f.alternate,f.child!==null||m!==null&&m.child!==null)for(c=RM(c);c!==null;){if(m=c[Dr])return m;c=RM(c)}return f}c=m,m=c.parentNode}return null}function nd(c){if(c=c[Dr]||c[ed]){var f=c.tag;if(f===5||f===6||f===13||f===26||f===27||f===3)return c}return null}function $h(c){var f=c.tag;if(f===5||f===26||f===27||f===6)return c.stateNode;throw Error(r(33))}function rd(c){var f=c[g3];return f||(f=c[g3]={hoistableStyles:new Map,hoistableScripts:new Map}),f}function lr(c){c[Dh]=!0}var x3=new Set,b3={};function gc(c,f){ad(c,f),ad(c+"Capture",f)}function ad(c,f){for(b3[c]=f,c=0;c<f.length;c++)x3.add(f[c])}var Tee=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),y3={},v3={};function Pee(c){return ne.call(v3,c)?!0:ne.call(y3,c)?!1:Tee.test(c)?v3[c]=!0:(y3[c]=!0,!1)}function px(c,f,m){if(Pee(f))if(m===null)c.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":c.removeAttribute(f);return;case"boolean":var b=f.toLowerCase().slice(0,5);if(b!=="data-"&&b!=="aria-"){c.removeAttribute(f);return}}c.setAttribute(f,""+m)}}function mx(c,f,m){if(m===null)c.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(f);return}c.setAttribute(f,""+m)}}function Hi(c,f,m,b){if(b===null)c.removeAttribute(m);else{switch(typeof b){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(m);return}c.setAttributeNS(f,m,""+b)}}var fj,w3;function sd(c){if(fj===void 0)try{throw Error()}catch(m){var f=m.stack.trim().match(/\n( *(at )?)/);fj=f&&f[1]||"",w3=-1<m.stack.indexOf(` 43 at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return` 44`+fj+c+w3}var hj=!1;function pj(c,f){if(!c||hj)return"";hj=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var b={DetermineComponentFrameRoot:function(){try{if(f){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(se){var re=se}Reflect.construct(c,[],me)}else{try{me.call()}catch(se){re=se}c.call(me.prototype)}}else{try{throw Error()}catch(se){re=se}(me=c())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(se){if(se&&re&&typeof se.stack=="string")return[se.stack,re.stack]}return[null,null]}};b.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(b.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(b.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=b.DetermineComponentFrameRoot(),R=C[0],q=C[1];if(R&&q){var Y=R.split(` 45`),ee=q.split(` 46`);for(_=b=0;b<Y.length&&!Y[b].includes("DetermineComponentFrameRoot");)b++;for(;_<ee.length&&!ee[_].includes("DetermineComponentFrameRoot");)_++;if(b===Y.length||_===ee.length)for(b=Y.length-1,_=ee.length-1;1<=b&&0<=_&&Y[b]!==ee[_];)_--;for(;1<=b&&0<=_;b--,_--)if(Y[b]!==ee[_]){if(b!==1||_!==1)do if(b--,_--,0>_||Y[b]!==ee[_]){var he=` 47`+Y[b].replace(" at new "," at ");return c.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",c.displayName)),he}while(1<=b&&0<=_);break}}}finally{hj=!1,Error.prepareStackTrace=m}return(m=c?c.displayName||c.name:"")?sd(m):""}function Ree(c){switch(c.tag){case 26:case 27:case 5:return sd(c.type);case 16:return sd("Lazy");case 13:return sd("Suspense");case 19:return sd("SuspenseList");case 0:case 15:return pj(c.type,!1);case 11:return pj(c.type.render,!1);case 1:return pj(c.type,!0);case 31:return sd("Activity");default:return""}}function j3(c){try{var f="";do f+=Ree(c),c=c.return;while(c);return f}catch(m){return` 48Error generating stack: `+m.message+` 49`+m.stack}}function ss(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function N3(c){var f=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function Mee(c){var f=N3(c)?"checked":"value",m=Object.getOwnPropertyDescriptor(c.constructor.prototype,f),b=""+c[f];if(!c.hasOwnProperty(f)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var _=m.get,C=m.set;return Object.defineProperty(c,f,{configurable:!0,get:function(){return _.call(this)},set:function(R){b=""+R,C.call(this,R)}}),Object.defineProperty(c,f,{enumerable:m.enumerable}),{getValue:function(){return b},setValue:function(R){b=""+R},stopTracking:function(){c._valueTracker=null,delete c[f]}}}}function gx(c){c._valueTracker||(c._valueTracker=Mee(c))}function _3(c){if(!c)return!1;var f=c._valueTracker;if(!f)return!0;var m=f.getValue(),b="";return c&&(b=N3(c)?c.checked?"true":"false":c.value),c=b,c!==m?(f.setValue(c),!0):!1}function xx(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Dee=/[\n"\\]/g;function is(c){return c.replace(Dee,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function mj(c,f,m,b,_,C,R,q){c.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?c.type=R:c.removeAttribute("type"),f!=null?R==="number"?(f===0&&c.value===""||c.value!=f)&&(c.value=""+ss(f)):c.value!==""+ss(f)&&(c.value=""+ss(f)):R!=="submit"&&R!=="reset"||c.removeAttribute("value"),f!=null?gj(c,R,ss(f)):m!=null?gj(c,R,ss(m)):b!=null&&c.removeAttribute("value"),_==null&&C!=null&&(c.defaultChecked=!!C),_!=null&&(c.checked=_&&typeof _!="function"&&typeof _!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?c.name=""+ss(q):c.removeAttribute("name")}function k3(c,f,m,b,_,C,R,q){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(c.type=C),f!=null||m!=null){if(!(C!=="submit"&&C!=="reset"||f!=null))return;m=m!=null?""+ss(m):"",f=f!=null?""+ss(f):m,q||f===c.value||(c.value=f),c.defaultValue=f}b=b??_,b=typeof b!="function"&&typeof b!="symbol"&&!!b,c.checked=q?c.checked:!!b,c.defaultChecked=!!b,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(c.name=R)}function gj(c,f,m){f==="number"&&xx(c.ownerDocument)===c||c.defaultValue===""+m||(c.defaultValue=""+m)}function id(c,f,m,b){if(c=c.options,f){f={};for(var _=0;_<m.length;_++)f["$"+m[_]]=!0;for(m=0;m<c.length;m++)_=f.hasOwnProperty("$"+c[m].value),c[m].selected!==_&&(c[m].selected=_),_&&b&&(c[m].defaultSelected=!0)}else{for(m=""+ss(m),f=null,_=0;_<c.length;_++){if(c[_].value===m){c[_].selected=!0,b&&(c[_].defaultSelected=!0);return}f!==null||c[_].disabled||(f=c[_])}f!==null&&(f.selected=!0)}}function S3(c,f,m){if(f!=null&&(f=""+ss(f),f!==c.value&&(c.value=f),m==null)){c.defaultValue!==f&&(c.defaultValue=f);return}c.defaultValue=m!=null?""+ss(m):""}function C3(c,f,m,b){if(f==null){if(b!=null){if(m!=null)throw Error(r(92));if(z(b)){if(1<b.length)throw Error(r(93));b=b[0]}m=b}m==null&&(m=""),f=m}m=ss(f),c.defaultValue=m,b=c.textContent,b===m&&b!==""&&b!==null&&(c.value=b)}function od(c,f){if(f){var m=c.firstChild;if(m&&m===c.lastChild&&m.nodeType===3){m.nodeValue=f;return}}c.textContent=f}var $ee=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function E3(c,f,m){var b=f.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?b?c.setProperty(f,""):f==="float"?c.cssFloat="":c[f]="":b?c.setProperty(f,m):typeof m!="number"||m===0||$ee.has(f)?f==="float"?c.cssFloat=m:c[f]=(""+m).trim():c[f]=m+"px"}function O3(c,f,m){if(f!=null&&typeof f!="object")throw Error(r(62));if(c=c.style,m!=null){for(var b in m)!m.hasOwnProperty(b)||f!=null&&f.hasOwnProperty(b)||(b.indexOf("--")===0?c.setProperty(b,""):b==="float"?c.cssFloat="":c[b]="");for(var _ in f)b=f[_],f.hasOwnProperty(_)&&m[_]!==b&&E3(c,_,b)}else for(var C in f)f.hasOwnProperty(C)&&E3(c,C,f[C])}function xj(c){if(c.indexOf("-")===-1)return!1;switch(c){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Iee=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
49dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Lee=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bx(c){return Lee.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}var bj=null;function yj(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var ld=null,cd=null;function A3(c){var f=nd(c);if(f&&(c=f.stateNode)){var m=c[aa]||null;e:switch(c=f.stateNode,f.type){case"input":if(mj(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),f=m.name,m.type==="radio"&&f!=null){for(m=c;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+is(""+f)+'"][type="radio"]'),f=0;f<m.length;f++){var b=m[f];if(b!==c&&b.form===c.form){var _=b[aa]||null;if(!_)throw Error(r(90));mj(b,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(f=0;f<m.length;f++)b=m[f],b.form===c.form&&_3(b)}break e;case"textarea":S3(c,m.value,m.defaultValue);break e;case"select":f=m.value,f!=null&&id(c,!!m.multiple,f,!1)}}}var vj=!1;function T3(c,f,m){if(vj)return c(f,m);vj=!0;try{var b=c(f);return b}finally{if(vj=!1,(ld!==null||cd!==null)&&(rb(),ld&&(f=ld,c=cd,cd=ld=null,A3(f),c)))for(f=0;f<c.length;f++)A3(c[f])}}function Ih(c,f){var m=c.stateNode;if(m===null)return null;var b=m[aa]||null;if(b===null)return null;m=b[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(c=c.type,b=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!b;break e;default:c=!1}if(c)return null;if(m&&typeof m!="function")throw Error(r(231,f,typeof m));return m}var Ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wj=!1;if(Ki)try{var Lh={};Object.defineProperty(Lh,"passive",{get:function(){wj=!0}}),window.addEventListener("test",Lh,Lh),window.removeEventListener("test",Lh,Lh)}catch{wj=!1}var Zo=null,jj=null,yx=null;function P3(){if(yx)return yx;var c,f=jj,m=f.length,b,_="value"in Zo?Zo.value:Zo.textContent,C=_.length;for(c=0;c<m&&f[c]===_[c];c++);var R=m-c;for(b=1;b<=R&&f[m-b]===_[C-b];b++);return yx=_.slice(c,1<b?1-b:void 0)}function vx(c){var f=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&f===13&&(c=13)):c=f,c===10&&(c=13),32<=c||c===13?c:0}function wx(){return!0}function R3(){return!1}function sa(c){function f(m,b,_,C,R){this._reactName=m,this._targetInst=_,this.type=b,this.nativeEvent=C,this.target=R,this.currentTarget=null;for(var q in c)c.hasOwnProperty(q)&&(m=c[q],this[q]=m?m(C):C[q]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?wx:R3,this.isPropagationStopped=R3,this}return h(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=wx)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=wx)},persist:function(){},isPersistent:wx}),f}var xc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jx=sa(xc),Fh=h({},xc,{view:0,detail:0}),Fee=sa(Fh),Nj,_j,zh,Nx=h({},Fh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sj,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==zh&&(zh&&c.type==="mousemove"?(Nj=c.screenX-zh.screenX,_j=c.screenY-zh.screenY):_j=Nj=0,zh=c),Nj)},movementY:function(c){return"movementY"in c?c.movementY:_j}}),M3=sa(Nx),zee=h({},Nx,{dataTransfer:0}),Bee=sa(zee),Uee=h({},Fh,{relatedTarget:0}),kj=sa(Uee),qee=h({},xc,{animationName:0,elapsedTime:0,pseudoElement:0}),Hee=sa(qee),Kee=h({},xc,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Vee=sa(Kee),Gee=h({},xc,{data:0}),D3=sa(Gee),Wee={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yee={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xee={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qee(c){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(c):(c=Xee[c])?!!f[c]:!1}function Sj(){return Qee}var Zee=h({},Fh,{key:function(c){if(c.key){var f=Wee[c.key]||c.key;if(f!=="Unidentified")return f}
vendor: 141,854 bytes, lines 49-50
49return c.type==="keypress"?(c=vx(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?Yee[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sj,charCode:function(c){return c.type==="keypress"?vx(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?vx(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),Jee=sa(Zee),ete=h({},Nx,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$3=sa(ete),tte=h({},Fh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sj}),nte=sa(tte),rte=h({},xc,{propertyName:0,elapsedTime:0,pseudoElement:0}),ate=sa(rte),ste=h({},Nx,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),ite=sa(ste),ote=h({},xc,{newState:0,oldState:0}),lte=sa(ote),cte=[9,13,27,32],Cj=Ki&&"CompositionEvent"in window,Bh=null;Ki&&"documentMode"in document&&(Bh=document.documentMode);var ute=Ki&&"TextEvent"in window&&!Bh,I3=Ki&&(!Cj||Bh&&8<Bh&&11>=Bh),L3=" ",F3=!1;function z3(c,f){switch(c){case"keyup":return cte.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B3(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var ud=!1;function dte(c,f){switch(c){case"compositionend":return B3(f);case"keypress":return f.which!==32?null:(F3=!0,L3);case"textInput":return c=f.data,c===L3&&F3?null:c;default:return null}}function fte(c,f){if(ud)return c==="compositionend"||!Cj&&z3(c,f)?(c=P3(),yx=jj=Zo=null,ud=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return I3&&f.locale!=="ko"?null:f.data;default:return null}}var hte={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function U3(c){var f=c&&c.nodeName&&c.nodeName.toLowerCase();return f==="input"?!!hte[c.type]:f==="textarea"}function q3(c,f,m,b){ld?cd?cd.push(b):cd=[b]:ld=b,f=cb(f,"onChange"),0<f.length&&(m=new jx("onChange","change",null,m,b),c.push({event:m,listeners:f}))}var Uh=null,qh=null;function pte(c){NM(c,0)}function _x(c){var f=$h(c);if(_3(f))return c}function H3(c,f){if(c==="change")return f}var K3=!1;if(Ki){var Ej;if(Ki){var Oj="oninput"in document;if(!Oj){var V3=document.createElement("div");V3.setAttribute("oninput","return;"),Oj=typeof V3.oninput=="function"}Ej=Oj}else Ej=!1;K3=Ej&&(!document.documentMode||9<document.documentMode)}function G3(){Uh&&(Uh.detachEvent("onpropertychange",W3),qh=Uh=null)}function W3(c){if(c.propertyName==="value"&&_x(qh)){var f=[];q3(f,qh,c,yj(c)),T3(pte,f)}}function mte(c,f,m){c==="focusin"?(G3(),Uh=f,qh=m,Uh.attachEvent("onpropertychange",W3)):c==="focusout"&&G3()}function gte(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return _x(qh)}function xte(c,f){if(c==="click")return _x(f)}function bte(c,f){if(c==="input"||c==="change")return _x(f)}function yte(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var Ta=typeof Object.is=="function"?Object.is:yte;function Hh(c,f){if(Ta(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var m=Object.keys(c),b=Object.keys(f);if(m.length!==b.length)return!1;for(b=0;b<m.length;b++){var _=m[b];if(!ne.call(f,_)||!Ta(c[_],f[_]))return!1}return!0}function Y3(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function X3(c,f){var m=Y3(c);c=0;for(var b;m;){if(m.nodeType===3){if(b=c+m.textContent.length,c<=f&&b>=f)return{node:m,offset:f-c};c=b}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=Y3(m)}}function Q3(c,f){return c&&f?c===f?!0:c&&c.nodeType===3?!1:f&&f.nodeType===3?Q3(c,f.parentNode):"contains"in c?c.contains(f):c.compareDocumentPosition?!!(c.compareDocumentPosition(f)&16):!1:!1}function Z3(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var f=xx(c.document);f instanceof c.HTMLIFrameElement;){try{var m=typeof f.contentWindow.location.href=="string"}catch{m=!1}if(m)c=f.contentWindow;else break;f=xx(c.document)}return f}function Aj(c){var f=c&&c.nodeName&&c.nodeName.toLowerCase();return f&&(f==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||f==="textarea"||c.contentEditable==="true")}var vte=Ki&&"documentMode"in document&&11>=document.documentMode,dd=null,Tj=null,Kh=null,Pj=!1;function J3(c,f,m){var b=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Pj||dd==null||dd!==xx(b)||(b=dd,"selectionStart"in b&&Aj(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),Kh&&Hh(Kh,b)||(Kh=b,b=cb(Tj,"onSelect"),0<b.length&&(f=new jx("onSelect","select",null,f,m),c.push({event:f,listeners:b}),f.target=dd)))}function bc(c,f){var m={};return m[c.toLowerCase()]=f.toLowerCase(),m["Webkit"+c]="webkit"+f,m["Moz"+c]="moz"+f,m}var fd={animationend:bc("Animation","AnimationEnd"),animationiteration:bc("Animation","AnimationIteration"),animationstart:bc("Animation","AnimationStart"),transitionrun:bc("Transition","TransitionRun"),transitionstart:bc("Transition","TransitionStart"),transitioncancel:bc("Transition","TransitionCancel"),transitionend:bc("Transition","TransitionEnd")},Rj={},eR={};Ki&&(eR=document.createElement("div").style,"AnimationEvent"in window||(delete fd.animationend.animation,delete fd.animationiteration.animation,delete fd.animationstart.animation),"TransitionEvent"in window||delete fd.transitionend.transition);function yc(c){if(Rj[c])return Rj[c];if(!fd[c])return c;var f=fd[c],m;for(m in f)if(f.hasOwnProperty(m)&&m in eR)return Rj[c]=f[m];return c}var tR=yc("animationend"),nR=yc("animationiteration"),rR=yc("animationstart"),wte=yc("transitionrun"),jte=yc("transitionstart"),Nte=yc("transitioncancel"),aR=yc("transitionend"),sR=new Map,Mj="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Mj.push("scrollEnd");function Fs(c,f){sR.set(c,f),gc(f,[c])}var iR=new WeakMap;function os(c,f){if(typeof c=="object"&&c!==null){var m=iR.get(c);return m!==void 0?m:(f={value:c,source:f,stack:j3(f)},iR.set(c,f),f)}return{value:c,source:f,stack:j3(f)}}var ls=[],hd=0,Dj=0;function kx(){for(var c=hd,f=Dj=hd=0;f<c;){var m=ls[f];ls[f++]=null;var b=ls[f];ls[f++]=null;var _=ls[f];ls[f++]=null;var C=ls[f];if(ls[f++]=null,b!==null&&_!==null){var R=b.pending;R===null?_.next=_:(_.next=R.next,R.next=_),b.pending=_}C!==0&&oR(m,_,C)}}function Sx(c,f,m,b){ls[hd++]=c,ls[hd++]=f,ls[hd++]=m,ls[hd++]=b,Dj|=b,c.lanes|=b,c=c.alternate,c!==null&&(c.lanes|=b)}function $j(c,f,m,b){return Sx(c,f,m,b),Cx(c)}function pd(c,f){return Sx(c,null,null,f),Cx(c)}function oR(c,f,m){c.lanes|=m;var b=c.alternate;b!==null&&(b.lanes|=m);for(var _=!1,C=c.return;C!==null;)C.childLanes|=m,b=C.alternate,b!==null&&(b.childLanes|=m),C.tag===22&&(c=C.stateNode,c===null||c._visibility&1||(_=!0)),c=C,C=C.return;return c.tag===3?(C=c.stateNode,_&&f!==null&&(_=31-jn(m),c=C.hiddenUpdates,b=c[_],b===null?c[_]=[f]:b.push(f),f.lane=m|536870912),C):null}function Cx(c){if(50<gp)throw gp=0,UN=null,Error(r(185));for(var f=c.return;f!==null;)c=f,f=c.return;return c.tag===3?c.stateNode:null}var md={};function _te(c,f,m,b){this.tag=c,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pa(c,f,m,b){return new _te(c,f,m,b)}function Ij(c){return c=c.prototype,!(!c||!c.isReactComponent)}function Vi(c,f){var m=c.alternate;return m===null?(m=Pa(c.tag,f,c.key,c.mode),m.elementType=c.elementType,m.type=c.type,m.stateNode=c.stateNode,m.alternate=c,c.alternate=m):(m.pendingProps=f,m.type=c.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=c.flags&65011712,m.childLanes=c.childLanes,m.lanes=c.lanes,m.child=c.child,m.memoizedProps=c.memoizedProps,m.memoizedState=c.memoizedState,m.updateQueue=c.updateQueue,f=c.dependencies,m.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},m.sibling=c.sibling,m.index=c.index,m.ref=c.ref,m.refCleanup=c.refCleanup,m}function lR(c,f){c.flags&=65011714;var m=c.alternate;return m===null?(c.childLanes=0,c.lanes=f,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=m.childLanes,c.lanes=m.lanes,c.child=m.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=m.memoizedProps,c.memoizedState=m.memoizedState,c.updateQueue=m.updateQueue,c.type=m.type,f=m.dependencies,c.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),c}function Ex(c,f,m,b,_,C){var R=0;if(b=c,typeof c=="function")Ij(c)&&(R=1);else if(typeof c=="string")R=Sne(c,m,te.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case D:return c=Pa(31,m,f,_),c.elementType=D,c.lanes=C,c;case y:return vc(m.children,_,C,f);case w:R=8,_|=24;break;case j:return c=Pa(12,m,f,_|2),c.elementType=j,c.lanes=C,c;case O:return c=Pa(13,m,f,_),c.elementType=O,c.lanes=C,c;case T:return c=Pa(19,m,f,_),c.elementType=T,c.lanes=C,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case N:case S:R=10;break e;case k:R=9;break e;case E:R=11;break e;case P:R=14;break e;case M:R=16,b=null;break e}R=29,m=Error(r(130,c===null?"null":typeof c,"")),b=null}return f=Pa(R,m,f,_),f.elementType=c,f.type=b,f.lanes=C,f}function vc(c,f,m,b){return c=Pa(7,c,b,f),c.lanes=m,c}function Lj(c,f,m){return c=Pa(6,c,null,f),c.lanes=m,c}function Fj(c,f,m){return f=Pa(4,c.children!==null?c.children:[],c.key,f),f.lanes=m,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}var gd=[],xd=0,Ox=null,Ax=0,cs=[],us=0,wc=null,Gi=1,Wi="";function jc(c,f){gd[xd++]=Ax,gd[xd++]=Ox,Ox=c,Ax=f}function cR(c,f,m){cs[us++]=Gi,cs[us++]=Wi,cs[us++]=wc,wc=c;var b=Gi;c=Wi;var _=32-jn(b)-1;b&=~(1<<_),m+=1;var C=32-jn(f)+_;if(30<C){var R=_-_%5;C=(b&(1<<R)-1).toString(32),b>>=R,_-=R,Gi=1<<32-jn(f)+_|m<<_|b,Wi=C+c}else Gi=1<<C|m<<_|b,Wi=c}function zj(c){c.return!==null&&(jc(c,1),cR(c,1,0))}function Bj(c){for(;c===Ox;)Ox=gd[--xd],gd[xd]=null,Ax=gd[--xd],gd[xd]=null;for(;c===wc;)wc=cs[--us],cs[us]=null,Wi=cs[--us],cs[us]=null,Gi=cs[--us],cs[us]=null}var Wr=null,Nn=null,bt=!1,Nc=null,ii=!1,Uj=Error(r(519));function _c(c){var f=Error(r(418,""));throw Wh(os(f,c)),Uj}function uR(c){var f=c.stateNode,m=c.type,b=c.memoizedProps;switch(f[Dr]=c,f[aa]=b,m){case"dialog":ct("cancel",f),ct("close",f);break;case"iframe":case"object":case"embed":ct("load",f);break;case"video":case"audio":for(m=0;m<bp.length;m++)ct(bp[m],f);break;case"source":ct("error",f);break;case"img":case"image":case"link":ct("error",f),ct("load",f);break;case"details":ct("toggle",f);break;case"input":ct("invalid",f),k3(f,b.value,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name,!0),gx(f);break;case"select":ct("invalid",f);break;case"textarea":ct("invalid",f),C3(f,b.value,b.defaultValue,b.children),gx(f)}m=b.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||f.textContent===""+m||b.suppressHydrationWarning===!0||CM(f.textContent,m)?(b.popover!=null&&(ct("beforetoggle",f),ct("toggle",f)),b.onScroll!=null&&ct("scroll",f),b.onScrollEnd!=null&&ct("scrollend",f),b.onClick!=null&&(f.onclick=ub),f=!0):f=!1,f||_c(c)}function dR(c){for(Wr=c.return;Wr;)switch(Wr.tag){case 5:case 13:ii=!1;return;case 27:case 3:ii=!0;return;default:Wr=Wr.return}}function Vh(c){if(c!==Wr)return!1;if(!bt)return dR(c),bt=!0,!1;var f=c.tag,m;if((m=f!==3&&f!==27)&&((m=f===5)&&(m=c.type,m=!(m!=="form"&&m!=="button")||a_(c.type,c.memoizedProps)),m=!m),m&&Nn&&_c(c),dR(c),f===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));e:{for(c=c.nextSibling,f=0;c;){if(c.nodeType===8)if(m=c.data,m==="/$"){if(f===0){Nn=Bs(c.nextSibling);break e}f--}else m!=="$"&&m!=="$!"&&m!=="$?"||f++;c=c.nextSibling}Nn=null}}else f===27?(f=Nn,pl(c.type)?(c=l_,l_=null,Nn=c):Nn=f):Nn=Wr?Bs(c.stateNode.nextSibling):null;return!0}function Gh(){Nn=Wr=null,bt=!1}function fR(){var c=Nc;return c!==null&&(la===null?la=c:la.push.apply(la,c),Nc=null),c}function Wh(c){Nc===null?Nc=[c]:Nc.push(c)}var qj=H(null),kc=null,Yi=null;function Jo(c,f,m){X(qj,f._currentValue),f._currentValue=m}function Xi(c){c._currentValue=qj.current,V(qj)}function Hj(c,f,m){for(;c!==null;){var b=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,b!==null&&(b.childLanes|=f)):b!==null&&(b.childLanes&f)!==f&&(b.childLanes|=f),c===m)break;c=c.return}}function Kj(c,f,m,b){var _=c.child;for(_!==null&&(_.return=c);_!==null;){var C=_.dependencies;if(C!==null){var R=_.child;C=C.firstContext;e:for(;C!==null;){var q=C;C=_;for(var Y=0;Y<f.length;Y++)if(q.context===f[Y]){C.lanes|=m,q=C.alternate,q!==null&&(q.lanes|=m),Hj(C.return,m,c),b||(R=null);break e}C=q.next}}else if(_.tag===18){if(R=_.return,R===null)throw Error(r(341));R.lanes|=m,C=R.alternate,C!==null&&(C.lanes|=m),Hj(R,m,c),R=null}else R=_.child;if(R!==null)R.return=_;else for(R=_;R!==null;){if(R===c){R=null;break}if(_=R.sibling,_!==null){_.return=R.return,R=_;break}R=R.return}_=R}}function Yh(c,f,m,b){c=null;for(var _=f,C=!1;_!==null;){if(!C){if((_.flags&524288)!==0)C=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var R=_.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var q=_.type;Ta(_.pendingProps.value,R.value)||(c!==null?c.push(q):c=[q])}}else if(_===ke.current){if(R=_.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(c!==null?c.push(_p):c=[_p])}_=_.return}c!==null&&Kj(f,c,m,b),f.flags|=262144}function Tx(c){for(c=c.firstContext;c!==null;){if(!Ta(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function Sc(c){kc=c,Yi=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function $r(c){return hR(kc,c)}function Px(c,f){return kc===null&&Sc(c),hR(c,f)}function hR(c,f){var m=f._currentValue;if(f={context:f,memoizedValue:m,next:null},Yi===null){if(c===null)throw Error(r(308));Yi=f,c.dependencies={lanes:0,firstContext:f},c.flags|=524288}else Yi=Yi.next=f;return m}var kte=typeof AbortController<"u"?AbortController:function(){var c=[],f=this.signal={aborted:!1,addEventListener:function(m,b){c.push(b)}};this.abort=function(){f.aborted=!0,c.forEach(function(m){return m()})}},Ste=e.unstable_scheduleCallback,Cte=e.unstable_NormalPriority,Jn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vj(){return{controller:new kte,data:new Map,refCount:0}}function Xh(c){c.refCount--,c.refCount===0&&Ste(Cte,function(){c.controller.abort()})}var Qh=null,Gj=0,bd=0,yd=null;function Ete(c,f){if(Qh===null){var m=Qh=[];Gj=0,bd=YN(),yd={status:"pending",value:void 0,then:function(b){m.push(b)}}}return Gj++,f.then(pR,pR),f}function pR(){if(--Gj===0&&Qh!==null){yd!==null&&(yd.status="fulfilled");var c=Qh;Qh=null,bd=0,yd=null;for(var f=0;f<c.length;f++)(0,c[f])()}}function Ote(c,f){var m=[],b={status:"pending",value:null,reason:null,then:function(_){m.push(_)}};return c.then(function(){b.status="fulfilled",b.value=f;for(var _=0;_<m.length;_++)(0,m[_])(f)},function(_){for(b.status="rejected",b.reason=_,_=0;_<m.length;_++)(0,m[_])(void 0)}),b}var mR=$.S;$.S=function(c,f){typeof f=="object"&&f!==null&&typeof f.then=="function"&&Ete(c,f),mR!==null&&mR(c,f)};var Cc=H(null);function Wj(){var c=Cc.current;return c!==null?c:Vt.pooledCache}function Rx(c,f){f===null?X(Cc,Cc.current):X(Cc,f.pool)}function gR(){var c=Wj();return c===null?null:{parent:Jn._currentValue,pool:c}}var Zh=Error(r(460)),xR=Error(r(474)),Mx=Error(r(542)),Yj={then:function(){}};function bR(c){return c=c.status,c==="fulfilled"||c==="rejected"}function Dx(){}function yR(c,f,m){switch(m=c[m],m===void 0?c.push(f):m!==f&&(f.then(Dx,Dx),f=m),f.status){case"fulfilled":return f.value;case"rejected":throw c=f.reason,wR(c),c;default:if(typeof f.status=="string")f.then(Dx,Dx);else{if(c=Vt,c!==null&&100<c.shellSuspendCounter)throw Error(r(482));c=f,c.status="pending",c.then(function(b){if(f.status==="pending"){var _=f;_.status="fulfilled",_.value=b}},function(b){if(f.status==="pending"){var _=f;_.status="rejected",_.reason=b}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw c=f.reason,wR(c),c}throw Jh=f,Zh}}var Jh=null;function vR(){if(Jh===null)throw Error(r(459));var c=Jh;return Jh=null,c}function wR(c){if(c===Zh||c===Mx)throw Error(r(483))}var el=!1;function Xj(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qj(c,f){c=c.updateQueue,f.updateQueue===c&&(f.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function tl(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function nl(c,f,m){var b=c.updateQueue;if(b===null)return null;if(b=b.shared,(_t&2)!==0){var _=b.pending;return _===null?f.next=f:(f.next=_.next,_.next=f),b.pending=f,f=Cx(c),oR(c,null,m),f}return Sx(c,b,f,m),Cx(c)}function ep(c,f,m){if(f=f.updateQueue,f!==null&&(f=f.shared,(m&4194048)!==0)){var b=f.lanes;b&=c.pendingLanes,m|=b,f.lanes=m,p3(c,m)}}function Zj(c,f){var m=c.updateQueue,b=c.alternate;if(b!==null&&(b=b.updateQueue,m===b)){var _=null,C=null;if(m=m.firstBaseUpdate,m!==null){do{var R={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};C===null?_=C=R:C=C.next=R,m=m.next}while(m!==null);C===null?_=C=f:C=C.next=f}else _=C=f;m={baseState:b.baseState,firstBaseUpdate:_,lastBaseUpdate:C,shared:b.shared,callbacks:b.callbacks},c.updateQueue=m;return}c=m.lastBaseUpdate,c===null?m.firstBaseUpdate=f:c.next=f,m.lastBaseUpdate=f}var Jj=!1;function tp(){if(Jj){var c=yd;if(c!==null)throw c}}function np(c,f,m,b){Jj=!1;var _=c.updateQueue;el=!1;var C=_.firstBaseUpdate,R=_.lastBaseUpdate,q=_.shared.pending;if(q!==null){_.shared.pending=null;var Y=q,ee=Y.next;Y.next=null,R===null?C=ee:R.next=ee,R=Y;var he=c.alternate;he!==null&&(he=he.updateQueue,q=he.lastBaseUpdate,q!==R&&(q===null?he.firstBaseUpdate=ee:q.next=ee,he.lastBaseUpdate=Y))}if(C!==null){var me=_.baseState;R=0,he=ee=Y=null,q=C;do{var re=q.lane&-536870913,se=re!==q.lane;if(se?(ft&re)===re:(b&re)===re){re!==0&&re===bd&&(Jj=!0),he!==null&&(he=he.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Qe=c,We=q;re=f;var Pt=m;switch(We.tag){case 1:if(Qe=We.payload,typeof Qe=="function"){me=Qe.call(Pt,me,re);break e}me=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=We.payload,re=typeof Qe=="function"?Qe.call(Pt,me,re):Qe,re==null)break e;me=h({},me,re);break e;case 2:el=!0}}re=q.callback,re!==null&&(c.flags|=64,se&&(c.flags|=8192),se=_.callbacks,se===null?_.callbacks=[re]:se.push(re))}else se={lane:re,tag:q.tag,payload:q.payload,callback:q.callback,next:null},he===null?(ee=he=se,Y=me):he=he.next=se,R|=re;if(q=q.next,q===null){if(q=_.shared.pending,q===null)break;se=q,q=se.next,se.next=null,_.lastBaseUpdate=se,_.shared.pending=null}}while(!0);he===null&&(Y=me),_.baseState=Y,_.firstBaseUpdate=ee,_.lastBaseUpdate=he,C===null&&(_.shared.lanes=0),ul|=R,c.lanes=R,c.memoizedState=me}}function jR(c,f){if(typeof c!="function")throw Error(r(191,c));c.call(f)}function NR(c,f){var m=c.callbacks;if(m!==null)for(c.callbacks=null,c=0;c<m.length;c++)jR(m[c],f)}var vd=H(null),$x=H(0);function _R(c,f){c=ro,X($x,c),X(vd,f),ro=c|f.baseLanes}function eN(){X($x,ro),X(vd,vd.current)}function tN(){ro=$x.current,V(vd),V($x)}var rl=0,it=null,At=null,Un=null,Ix=!1,wd=!1,Ec=!1,Lx=0,rp=0,jd=null,Ate=0;function Tn(){throw Error(r(321))}function nN(c,f){if(f===null)return!1;for(var m=0;m<f.length&&m<c.length;m++)if(!Ta(c[m],f[m]))return!1;return!0}function rN(c,f,m,b,_,C){return rl=C,it=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,$.H=c===null||c.memoizedState===null?o4:l4,Ec=!1,C=m(b,_),Ec=!1,wd&&(C=SR(f,m,b,_)),kR(c),C}function kR(c){$.H=Hx;var f=At!==null&&At.next!==null;if(rl=0,Un=At=it=null,Ix=!1,rp=0,jd=null,f)throw Error(r(300));c===null||cr||(c=c.dependencies,c!==null&&Tx(c)&&(cr=!0))}function SR(c,f,m,b){it=c;var _=0;do{if(wd&&(jd=null),rp=0,wd=!1,25<=_)throw Error(r(301));if(_+=1,Un=At=null,c.updateQueue!=null){var C=c.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}$.H=Ite,C=f(m,b)}while(wd);return C}function Tte(){var c=$.H,f=c.useState()[0];return f=typeof f.then=="function"?ap(f):f,c=c.useState()[0],(At!==null?At.memoizedState:null)!==c&&(it.flags|=1024),f}function aN(){var c=Lx!==0;return Lx=0,c}function sN(c,f,m){f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~m}function iN(c){if(Ix){for(c=c.memoizedState;c!==null;){var f=c.queue;f!==null&&(f.pending=null),c=c.next}Ix=!1}rl=0,Un=At=it=null,wd=!1,rp=Lx=0,jd=null}function ia(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Un===null?it.memoizedState=Un=c:Un=Un.next=c,Un}function qn(){if(At===null){var c=it.alternate;c=c!==null?c.memoizedState:null}else c=At.next;var f=Un===null?it.memoizedState:Un.next;if(f!==null)Un=f,At=c;else{if(c===null)throw it.alternate===null?Error(r(467)):Error(r(310));At=c,c={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Un===null?it.memoizedState=Un=c:Un=Un.next=c}return Un}function oN(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ap(c){var f=rp;return rp+=1,jd===null&&(jd=[]),c=yR(jd,c,f),f=it,(Un===null?f.memoizedState:Un.next)===null&&(f=f.alternate,$.H=f===null||f.memoizedState===null?o4:l4),c}function Fx(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return ap(c);if(c.$$typeof===S)return $r(c)}throw Error(r(438,String(c)))}function lN(c){var f=null,m=it.updateQueue;if(m!==null&&(f=m.memoCache),f==null){var b=it.alternate;b!==null&&(b=b.updateQueue,b!==null&&(b=b.memoCache,b!=null&&(f={data:b.data.map(function(_){return _.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),m===null&&(m=oN(),it.updateQueue=m),m.memoCache=f,m=f.data[f.index],m===void 0)for(m=f.data[f.index]=Array(c),b=0;b<c;b++)m[b]=A;return f.index++,m}function Qi(c,f){return typeof f=="function"?f(c):f}function zx(c){var f=qn();return cN(f,At,c)}function cN(c,f,m){var b=c.queue;if(b===null)throw Error(r(311));b.lastRenderedReducer=m;var _=c.baseQueue,C=b.pending;if(C!==null){if(_!==null){var R=_.next;_.next=C.next,C.next=R}f.baseQueue=_=C,b.pending=null}if(C=c.baseState,_===null)c.memoizedState=C;else{f=_.next;var q=R=null,Y=null,ee=f,he=!1;do{var me=ee.lane&-536870913;if(me!==ee.lane?(ft&me)===me:(rl&me)===me){var re=ee.revertLane;if(re===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),me===bd&&(he=!0);else if((rl&re)===re){ee=ee.next,re===bd&&(he=!0);continue}else me={lane:0,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},Y===null?(q=Y=me,R=C):Y=Y.next=me,it.lanes|=re,ul|=re;me=ee.action,Ec&&m(C,me),C=ee.hasEagerState?ee.eagerState:m(C,me)}else re={lane:me,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},Y===null?(q=Y=re,R=C):Y=Y.next=re,it.lanes|=me,ul|=me;ee=ee.next}while(ee!==null&&ee!==f);if(Y===null?R=C:Y.next=q,!Ta(C,c.memoizedState)&&(cr=!0,he&&(m=yd,m!==null)))throw m;c.memoizedState=C,c.baseState=R,c.baseQueue=Y,b.lastRenderedState=C}return _===null&&(b.lanes=0),[c.memoizedState,b.dispatch]}function uN(c){var f=qn(),m=f.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var b=m.dispatch,_=m.pending,C=f.memoizedState;if(_!==null){m.pending=null;var R=_=_.next;do C=c(C,R.action),R=R.next;while(R!==_);Ta(C,f.memoizedState)||(cr=!0),f.memoizedState=C,f.baseQueue===null&&(f.baseState=C),m.lastRenderedState=C}return[C,b]}function CR(c,f,m){var b=it,_=qn(),C=bt;if(C){if(m===void 0)throw Error(r(407));m=m()}else m=f();var R=!Ta((At||_).memoizedState,m);R&&(_.memoizedState=m,cr=!0),_=_.queue;var q=AR.bind(null,b,_,c);if(sp(2048,8,q,[c]),_.getSnapshot!==f||R||Un!==null&&Un.memoizedState.tag&1){if(b.flags|=2048,Nd(9,Bx(),OR.bind(null,b,_,m,f),null),Vt===null)throw Error(r(349));C||(rl&124)!==0||ER(b,f,m)}return m}function ER(c,f,m){c.flags|=16384,c={getSnapshot:f,value:m},f=it.updateQueue,f===null?(f=oN(),it.updateQueue=f,f.stores=[c]):(m=f.stores,m===null?f.stores=[c]:m.push(c))}function OR(c,f,m,b){f.value=m,f.getSnapshot=b,TR(f)&&PR(c)}function AR(c,f,m){return m(function(){TR(f)&&PR(c)})}function TR(c){var f=c.getSnapshot;c=c.value;try{var m=f();return!Ta(c,m)}catch{return!0}}function PR(c){var f=pd(c,2);f!==null&&Ia(f,c,2)}function dN(c){var f=ia();if(typeof c=="function"){var m=c;if(c=m(),Ec){et(!0);try{m()}finally{et(!1)}}}return f.memoizedState=f.baseState=c,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:c},f}function RR(c,f,m,b){return c.baseState=m,cN(c,At,typeof b=="function"?b:Qi)}function Pte(c,f,m,b,_){if(qx(c))throw Error(r(485));if(c=f.action,c!==null){var C={payload:_,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){C.listeners.push(R)}};$.T!==null?m(!0):C.isTransition=!1,b(C),m=f.pending,m===null?(C.next=f.pending=C,MR(f,C)):(C.next=m.next,f.pending=m.next=C)}}function MR(c,f){var m=f.action,b=f.payload,_=c.state;if(f.isTransition){var C=$.T,R={};$.T=R;try{var q=m(_,b),Y=$.S;Y!==null&&Y(R,q),DR(c,f,q)}catch(ee){fN(c,f,ee)}finally{$.T=C}}else try{C=m(_,b),DR(c,f,C)}catch(ee){fN(c,f,ee)}}function DR(c,f,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(b){$R(c,f,b)},function(b){return fN(c,f,b)}):$R(c,f,m)}function $R(c,f,m){f.status="fulfilled",f.value=m,IR(f),c.state=m,f=c.pending,f!==null&&(m=f.next,m===f?c.pending=null:(m=m.next,f.next=m,MR(c,m)))}function fN(c,f,m){var b=c.pending;if(c.pending=null,b!==null){b=b.next;do f.status="rejected",f.reason=m,IR(f),f=f.next;while(f!==b)}c.action=null}function IR(c){c=c.listeners;for(var f=0;f<c.length;f++)(0,c[f])()}function LR(c,f){return f}function FR(c,f){if(bt){var m=Vt.formState;if(m!==null){e:{var b=it;if(bt){if(Nn){t:{for(var _=Nn,C=ii;_.nodeType!==8;){if(!C){_=null;break t}if(_=Bs(_.nextSibling),_===null){_=null;break t}}C=_.data,_=C==="F!"||C==="F"?_:null}if(_){Nn=Bs(_.nextSibling),b=_.data==="F!";break e}}_c(b)}b=!1}b&&(f=m[0])}}return m=ia(),m.memoizedState=m.baseState=f,b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:LR,lastRenderedState:f},m.queue=b,m=a4.bind(null,it,b),b.dispatch=m,b=dN(!1),C=xN.bind(null,it,!1,b.queue),b=ia(),_={state:f,dispatch:null,action:c,pending:null},b.queue=_,m=Pte.bind(null,it,_,C,m),_.dispatch=m,b.memoizedState=c,[f,m,!1]}function zR(c){var f=qn();return BR(f,At,c)}function BR(c,f,m){if(f=cN(c,f,LR)[0],c=zx(Qi)[0],typeof f=="object"&&f!==null&&typeof f.then=="function")try{var b=ap(f)}catch(R){throw R===Zh?Mx:R}else b=f;f=qn();var _=f.queue,C=_.dispatch;return m!==f.memoizedState&&(it.flags|=2048,Nd(9,Bx(),Rte.bind(null,_,m),null)),[b,C,c]}function Rte(c,f){c.action=f}function UR(c){var f=qn(),m=At;if(m!==null)return BR(f,m,c);qn(),f=f.memoizedState,m=qn();var b=m.queue.dispatch;return m.memoizedState=c,[f,b,!1]}function Nd(c,f,m,b){return c={tag:c,create:m,deps:b,inst:f,next:null},f=it.updateQueue,f===null&&(f=oN(),it.updateQueue=f),m=f.lastEffect,m===null?f.lastEffect=c.next=c:(b=m.next,m.next=c,c.next=b,f.lastEffect=c),c}function Bx(){return{destroy:void 0,resource:void 0}}function qR(){return qn().memoizedState}function Ux(c,f,m,b){var _=ia();b=b===void 0?null:b,it.flags|=c,_.memoizedState=Nd(1|f,Bx(),m,b)}function sp(c,f,m,b){var _=qn();b=b===void 0?null:b;var C=_.memoizedState.inst;At!==null&&b!==null&&nN(b,At.memoizedState.deps)?_.memoizedState=Nd(f,C,m,b):(it.flags|=c,_.memoizedState=Nd(1|f,C,m,b))}function HR(c,f){Ux(8390656,8,c,f)}function KR(c,f){sp(2048,8,c,f)}function VR(c,f){return sp(4,2,c,f)}function GR(c,f){return sp(4,4,c,f)}function WR(c,f){if(typeof f=="function"){c=c();var m=f(c);return function(){typeof m=="function"?m():f(null)}}if(f!=null)return c=c(),f.current=c,function(){f.current=null}}function YR(c,f,m){m=m!=null?m.concat([c]):null,sp(4,4,WR.bind(null,f,c),m)}function hN(){}function XR(c,f){var m=qn();f=f===void 0?null:f;var b=m.memoizedState;return f!==null&&nN(f,b[1])?b[0]:(m.memoizedState=[c,f],c)}function QR(c,f){var m=qn();f=f===void 0?null:f;var b=m.memoizedState;if(f!==null&&nN(f,b[1]))return b[0];if(b=c(),Ec){et(!0);try{c()}finally{et(!1)}}return m.memoizedState=[b,f],b}function pN(c,f,m){return m===void 0||(rl&1073741824)!==0?c.memoizedState=f:(c.memoizedState=m,c=eM(),it.lanes|=c,ul|=c,m)}function ZR(c,f,m,b){return Ta(m,f)?m:vd.current!==null?(c=pN(c,m,b),Ta(c,f)||(cr=!0),c):(rl&42)===0?(cr=!0,c.memoizedState=m):(c=eM(),it.lanes|=c,ul|=c,f)}function JR(c,f,m,b,_){var C=K.p;K.p=C!==0&&8>C?C:8;var R=$.T,q={};$.T=q,xN(c,!1,f,m);try{var Y=_(),ee=$.S;if(ee!==null&&ee(q,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var he=Ote(Y,b);ip(c,f,he,$a(c))}else ip(c,f,b,$a(c))}catch(me){ip(c,f,{then:function(){},status:"rejected",reason:me},$a())}finally{K.p=C,$.T=R}}function Mte(){}function mN(c,f,m,b){if(c.tag!==5)throw Error(r(476));var _=e4(c).queue;JR(c,_,f,G,m===null?Mte:function(){return t4(c),m(b)})}function e4(c){var f=c.memoizedState;if(f!==null)return f;f={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:G},next:null};var m={};return f.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:m},next:null},c.memoizedState=f,c=c.alternate,c!==null&&(c.memoizedState=f),f}function t4(c){var f=e4(c).next.queue;ip(c,f,{},$a())}function gN(){return $r(_p)}function n4(){return qn().memoizedState}function r4(){return qn().memoizedState}function Dte(c){for(var f=c.return;f!==null;){switch(f.tag){case 24:case 3:var m=$a();c=tl(m);var b=nl(f,c,m);b!==null&&(Ia(b,f,m),ep(b,f,m)),f={cache:Vj()},c.payload=f;return}f=f.return}}function $te(c,f,m){var b=$a();m={lane:b,revertLane:0,action:m,hasEagerState:!1,eagerState:null,next:null},qx(c)?s4(f,m):(m=$j(c,f,m,b),m!==null&&(Ia(m,c,b),i4(m,f,b)))}function a4(c,f,m){var b=$a();ip(c,f,m,b)}function ip(c,f,m,b){var _={lane:b,revertLane:0,action:m,hasEagerState:!1,eagerState:null,next:null};if(qx(c))s4(f,_);else{var C=c.alternate;if(c.lanes===0&&(C===null||C.lanes===0)&&(C=f.lastRenderedReducer,C!==null))try{var R=f.lastRenderedState,q=C(R,m);if(_.hasEagerState=!0,_.eagerState=q,Ta(q,R))return Sx(c,f,_,0),Vt===null&&kx(),!1}catch{}finally{}if(m=$j(c,f,_,b),m!==null)return Ia(m,c,b),i4(m,f,b),!0}return!1}function xN(c,f,m,b){if(b={lane:2,revertLane:YN(),action:b,hasEagerState:!1,eagerState:null,next:null},qx(c)){if(f)throw Error(r(479))}else f=$j(c,m,b,2),f!==null&&Ia(f,c,2)}function qx(c){var f=c.alternate;return c===it||f!==null&&f===it}function s4(c,f){wd=Ix=!0;var m=c.pending;m===null?f.next=f:(f.next=m.next,m.next=f),c.pending=f}function i4(c,f,m){if((m&4194048)!==0){var b=f.lanes;b&=c.pendingLanes,m|=b,f.lanes=m,p3(c,m)}}var Hx={readContext:$r,use:Fx,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useLayoutEffect:Tn,useInsertionEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useSyncExternalStore:Tn,useId:Tn,useHostTransitionStatus:Tn,useFormState:Tn,useActionState:Tn,useOptimistic:Tn,useMemoCache:Tn,useCacheRefresh:Tn},o4={readContext:$r,use:Fx,useCallback:function(c,f){return ia().memoizedState=[c,f===void 0?null:f],c},useContext:$r,useEffect:HR,useImperativeHandle:function(c,f,m){m=m!=null?m.concat([c]):null,Ux(4194308,4,WR.bind(null,f,c),m)},useLayoutEffect:function(c,f){return Ux(4194308,4,c,f)},useInsertionEffect:function(c,f){Ux(4,2,c,f)},useMemo:function(c,f){var m=ia();f=f===void 0?null:f;var b=c();if(Ec){et(!0);try{c()}finally{et(!1)}}return m.memoizedState=[b,f],b},useReducer:function(c,f,m){var b=ia();if(m!==void 0){var _=m(f);if(Ec){et(!0);try{m(f)}finally{et(!1)}}}else _=f;return b.memoizedState=b.baseState=_,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:_},b.queue=c,c=c.dispatch=$te.bind(null,it,c),[b.memoizedState,c]},useRef:function(c){var f=ia();return c={current:c},f.memoizedState=c},useState:function(c){c=dN(c);var f=c.queue,m=a4.bind(null,it,f);return f.dispatch=m,[c.memoizedState,m]},useDebugValue:hN,useDeferredValue:function(c,f){var m=ia();return pN(m,c,f)},useTransition:function(){var c=dN(!1);return c=JR.bind(null,it,c.queue,!0,!1),ia().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,f,m){var b=it,_=ia();if(bt){if(m===void 0)throw Error(r(407));m=m()}else{if(m=f(),Vt===null)throw Error(r(349));(ft&124)!==0||ER(b,f,m)}_.memoizedState=m;var C={value:m,getSnapshot:f};return _.queue=C,HR(AR.bind(null,b,C,c),[c]),b.flags|=2048,Nd(9,Bx(),OR.bind(null,b,C,m,f),null),m},useId:function(){var c=ia(),f=Vt.identifierPrefix;if(bt){var m=Wi,b=Gi;m=(b&~(1<<32-jn(b)-1)).toString(32)+m,f="«"+f+"R"+m,m=Lx++,0<m&&(f+="H"+m.toString(32)),f+="»"}else m=Ate++,f="«"+f+"r"+m.toString(32)+"»";return c.memoizedState=f},useHostTransitionStatus:gN,useFormState:FR,useActionState:FR,useOptimistic:function(c){var f=ia();f.memoizedState=f.baseState=c;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=m,f=xN.bind(null,it,!0,m),m.dispatch=f,[c,f]},useMemoCache:lN,useCacheRefresh:function(){return ia().memoizedState=Dte.bind(null,it)}},l4={readContext:$r,use:Fx,useCallback:XR,useContext:$r,useEffect:KR,useImperativeHandle:YR,useInsertionEffect:VR,useLayoutEffect:GR,useMemo:QR,useReducer:zx,useRef:qR,useState:function(){return zx(Qi)},useDebugValue:hN,useDeferredValue:function(c,f){var m=qn();return ZR(m,At.memoizedState,c,f)},useTransition:function(){var c=zx(Qi)[0],f=qn().memoizedState;return[typeof c=="boolean"?c:ap(c),f]},useSyncExternalStore:CR,useId:n4,useHostTransitionStatus:gN,useFormState:zR,useActionState:zR,useOptimistic:function(c,f){var m=qn();return RR(m,At,c,f)},useMemoCache:lN,useCacheRefresh:r4},Ite={readContext:$r,use:Fx,useCallback:XR,useContext:$r,useEffect:KR,useImperativeHandle:YR,useInsertionEffect:VR,useLayoutEffect:GR,useMemo:QR,useReducer:uN,useRef:qR,useState:function(){return uN(Qi)},useDebugValue:hN,useDeferredValue:function(c,f){var m=qn();return At===null?pN(m,c,f):ZR(m,At.memoizedState,c,f)},useTransition:function(){var c=uN(Qi)[0],f=qn().memoizedState;return[typeof c=="boolean"?c:ap(c),f]},useSyncExternalStore:CR,useId:n4,useHostTransitionStatus:gN,useFormState:UR,useActionState:UR,useOptimistic:function(c,f){var m=qn();return At!==null?RR(m,At,c,f):(m.baseState=c,[c,m.queue.dispatch])},useMemoCache:lN,useCacheRefresh:r4},_d=null,op=0;function Kx(c){var f=op;return op+=1,_d===null&&(_d=[]),yR(_d,c,f)}function lp(c,f){f=f.props.ref,c.ref=f!==void 0?f:null}function Vx(c,f){throw f.$$typeof===p?Error(r(525)):(c=Object.prototype.toString.call(f),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c)))}function c4(c){var f=c._init;return f(c._payload)}function u4(c){function f(Z,Q){if(c){var J=Z.deletions;J===null?(Z.deletions=[Q],Z.flags|=16):J.push(Q)}}function m(Z,Q){if(!c)return null;for(;Q!==null;)f(Z,Q),Q=Q.sibling;return null}function b(Z){for(var Q=new Map;Z!==null;)Z.key!==null?Q.set(Z.key,Z):Q.set(Z.index,Z),Z=Z.sibling;return Q}function _(Z,Q){return Z=Vi(Z,Q),Z.index=0,Z.sibling=null,Z}function C(Z,Q,J){return Z.index=J,c?(J=Z.alternate,J!==null?(J=J.index,J<Q?(Z.flags|=67108866,Q):J):(Z.flags|=67108866,Q)):(Z.flags|=1048576,Q)}function R(Z){return c&&Z.alternate===null&&(Z.flags|=67108866),Z}function q(Z,Q,J,pe){return Q===null||Q.tag!==6?(Q=Lj(J,Z.mode,pe),Q.return=Z,Q):(Q=_(Q,J),Q.return=Z,Q)}function Y(Z,Q,J,pe){var Fe=J.type;return Fe===y?he(Z,Q,J.props.children,pe,J.key):Q!==null&&(Q.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===M&&c4(Fe)===Q.type)?(Q=_(Q,J.props),lp(Q,J),Q.return=Z,Q):(Q=Ex(J.type,J.key,J.props,null,Z.mode,pe),lp(Q,J),Q.return=Z,Q)}function ee(Z,Q,J,pe){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==J.containerInfo||Q.stateNode.implementation!==J.implementation?(Q=Fj(J,Z.mode,pe),Q.return=Z,Q):(Q=_(Q,J.children||[]),Q.return=Z,Q)}function he(Z,Q,J,pe,Fe){return Q===null||Q.tag!==7?(Q=vc(J,Z.mode,pe,Fe),Q.return=Z,Q):(Q=_(Q,J),Q.return=Z,Q)}function me(Z,Q,J){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Lj(""+Q,Z.mode,J),Q.return=Z,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case g:return J=Ex(Q.type,Q.key,Q.props,null,Z.mode,J),lp(J,Q),J.return=Z,J;case x:return Q=Fj(Q,Z.mode,J),Q.return=Z,Q;case M:var pe=Q._init;return Q=pe(Q._payload),me(Z,Q,J)}if(z(Q)||F(Q))return Q=vc(Q,Z.mode,J,null),Q.return=Z,Q;if(typeof Q.then=="function")return me(Z,Kx(Q),J);if(Q.$$typeof===S)return me(Z,Px(Z,Q),J);Vx(Z,Q)}return null}function re(Z,Q,J,pe){var Fe=Q!==null?Q.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Fe!==null?null:q(Z,Q,""+J,pe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case g:return J.key===Fe?Y(Z,Q,J,pe):null;case x:return J.key===Fe?ee(Z,Q,J,pe):null;case M:return Fe=J._init,J=Fe(J._payload),re(Z,Q,J,pe)}if(z(J)||F(J))return Fe!==null?null:he(Z,Q,J,pe,null);if(typeof J.then=="function")return re(Z,Q,Kx(J),pe);if(J.$$typeof===S)return re(Z,Q,Px(Z,J),pe);Vx(Z,J)}return null}function se(Z,Q,J,pe,Fe){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return Z=Z.get(J)||null,q(Q,Z,""+pe,Fe);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case g:return Z=Z.get(pe.key===null?J:pe.key)||null,Y(Q,Z,pe,Fe);case x:return Z=Z.get(pe.key===null?J:pe.key)||null,ee(Q,Z,pe,Fe);case M:var ot=pe._init;return pe=ot(pe._payload),se(Z,Q,J,pe,Fe)}if(z(pe)||F(pe))return Z=Z.get(J)||null,he(Q,Z,pe,Fe,null);if(typeof pe.then=="function")return se(Z,Q,J,Kx(pe),Fe);if(pe.$$typeof===S)return se(Z,Q,J,Px(Q,pe),Fe);Vx(Q,pe)}return null}function Qe(Z,Q,J,pe){for(var Fe=null,ot=null,He=Q,Ye=Q=0,dr=null;He!==null&&Ye<J.length;Ye++){He.index>Ye?(dr=He,He=null):dr=He.sibling;var pt=re(Z,He,J[Ye],pe);if(pt===null){He===null&&(He=dr);break}c&&He&&pt.alternate===null&&f(Z,He),Q=C(pt,Q,Ye),ot===null?Fe=pt:ot.sibling=pt,ot=pt,He=dr}if(Ye===J.length)return m(Z,He),bt&&jc(Z,Ye),Fe;if(He===null){for(;Ye<J.length;Ye++)He=me(Z,J[Ye],pe),He!==null&&(Q=C(He,Q,Ye),ot===null?Fe=He:ot.sibling=He,ot=He);return bt&&jc(Z,Ye),Fe}for(He=b(He);Ye<J.length;Ye++)dr=se(He,Z,Ye,J[Ye],pe),dr!==null&&(c&&dr.alternate!==null&&He.delete(dr.key===null?Ye:dr.key),Q=C(dr,Q,Ye),ot===null?Fe=dr:ot.sibling=dr,ot=dr);return c&&He.forEach(function(yl){return f(Z,yl)}),bt&&jc(Z,Ye),Fe}function We(Z,Q,J,pe){if(J==null)throw Error(r(151));for(var Fe=null,ot=null,He=Q,Ye=Q=0,dr=null,pt=J.next();He!==null&&!pt.done;Ye++,pt=J.next()){He.index>Ye?(dr=He,He=null):dr=He.sibling;var yl=re(Z,He,pt.value,pe);if(yl===null){He===null&&(He=dr);break}c&&He&&yl.alternate===null&&f(Z,He),Q=C(yl,Q,Ye),ot===null?Fe=yl:ot.sibling=yl,ot=yl,He=dr}if(pt.done)return m(Z,He),bt&&jc(Z,Ye),Fe;if(He===null){for(;!pt.done;Ye++,pt=J.next())pt=me(Z,pt.value,pe),pt!==null&&(Q=C(pt,Q,Ye),ot===null?Fe=pt:ot.sibling=pt,ot=pt);return bt&&jc(Z,Ye),Fe}for(He=b(He);!pt.done;Ye++,pt=J.next())pt=se(He,Z,Ye,pt.value,pe),pt!==null&&(c&&pt.alternate!==null&&He.delete(pt.key===null?Ye:pt.key),Q=C(pt,Q,Ye),ot===null?Fe=pt:ot.sibling=pt,ot=pt);return c&&He.forEach(function(Lne){return f(Z,Lne)}),bt&&jc(Z,Ye),Fe}function Pt(Z,Q,J,pe){if(typeof J=="object"&&J!==null&&J.type===y&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case g:e:{for(var Fe=J.key;Q!==null;){if(Q.key===Fe){if(Fe=J.type,Fe===y){if(Q.tag===7){m(Z,Q.sibling),pe=_(Q,J.props.children),pe.return=Z,Z=pe;break e}}else if(Q.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===M&&c4(Fe)===Q.type){m(Z,Q.sibling),pe=_(Q,J.props),lp(pe,J),pe.return=Z,Z=pe;break e}m(Z,Q);break}else f(Z,Q);Q=Q.sibling}J.type===y?(pe=vc(J.props.children,Z.mode,pe,J.key),pe.return=Z,Z=pe):(pe=Ex(J.type,J.key,J.props,null,Z.mode,pe),lp(pe,J),pe.return=Z,Z=pe)}return R(Z);case x:e:{for(Fe=J.key;Q!==null;){if(Q.key===Fe)if(Q.tag===4&&Q.stateNode.containerInfo===J.containerInfo&&Q.stateNode.implementation===J.implementation){m(Z,Q.sibling),pe=_(Q,J.children||[]),pe.return=Z,Z=pe;break e}else{m(Z,Q);break}else f(Z,Q);Q=Q.sibling}pe=Fj(J,Z.mode,pe),pe.return=Z,Z=pe}return R(Z);case M:return Fe=J._init,J=Fe(J._payload),Pt(Z,Q,J,pe)}if(z(J))return Qe(Z,Q,J,pe);if(F(J)){if(Fe=F(J),typeof Fe!="function")throw Error(r(150));return J=Fe.call(J),We(Z,Q,J,pe)}if(typeof J.then=="function")return Pt(Z,Q,Kx(J),pe);if(J.$$typeof===S)return Pt(Z,Q,Px(Z,J),pe);Vx(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,Q!==null&&Q.tag===6?(m(Z,Q.sibling),pe=_(Q,J),pe.return=Z,Z=pe):(m(Z,Q),pe=Lj(J,Z.mode,pe),pe.return=Z,Z=pe),R(Z)):m(Z,Q)}return function(Z,Q,J,pe){try{op=0;var Fe=Pt(Z,Q,J,pe);return _d=null,Fe}catch(He){if(He===Zh||He===Mx)throw He;var ot=Pa(29,He,null,Z.mode);return ot.lanes=pe,ot.return=Z,ot}finally{}}}var kd=u4(!0),d4=u4(!1),ds=H(null),oi=null;function al(c){var f=c.alternate;X(er,er.current&1),X(ds,c),oi===null&&(f===null||vd.current!==null||f.memoizedState!==null)&&(oi=c)}function f4(c){if(c.tag===22){if(X(er,er.current),X(ds,c),oi===null){var f=c.alternate;f!==null&&f.memoizedState!==null&&(oi=c)}}else sl()}function sl(){X(er,er.current),X(ds,ds.current)}function Zi(c){V(ds),oi===c&&(oi=null),V(er)}var er=H(0);function Gx(c){for(var f=c;f!==null;){if(f.tag===13){var m=f.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||o_(m)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}function bN(c,f,m,b){f=c.memoizedState,m=m(b,f),m=m==null?f:h({},f,m),c.memoizedState=m,c.lanes===0&&(c.updateQueue.baseState=m)}var yN={enqueueSetState:function(c,f,m){c=c._reactInternals;var b=$a(),_=tl(b);_.payload=f,m!=null&&(_.callback=m),f=nl(c,_,b),f!==null&&(Ia(f,c,b),ep(f,c,b))},enqueueReplaceState:function(c,f,m){c=c._reactInternals;var b=$a(),_=tl(b);_.tag=1,_.payload=f,m!=null&&(_.callback=m),f=nl(c,_,b),f!==null&&(Ia(f,c,b),ep(f,c,b))},enqueueForceUpdate:function(c,f){c=c._reactInternals;var m=$a(),b=tl(m);b.tag=2,f!=null&&(b.callback=f),f=nl(c,b,m),f!==null&&(Ia(f,c,m),ep(f,c,m))}};function h4(c,f,m,b,_,C,R){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(b,C,R):f.prototype&&f.prototype.isPureReactComponent?!Hh(m,b)||!Hh(_,C):!0}function p4(c,f,m,b){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(m,b),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(m,b),f.state!==c&&yN.enqueueReplaceState(f,f.state,null)}function Oc(c,f){var m=f;if("ref"in f){m={};for(var b in f)b!=="ref"&&(m[b]=f[b])}if(c=c.defaultProps){m===f&&(m=h({},m));for(var _ in c)m[_]===void 0&&(m[_]=c[_])}return m}var Wx=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)};function m4(c){Wx(c)}function g4(c){console.error(c)}function x4(c){Wx(c)}function Yx(c,f){try{var m=c.onUncaughtError;m(f.value,{componentStack:f.stack})}catch(b){setTimeout(function(){throw b})}}function b4(c,f,m){try{var b=c.onCaughtError;b(m.value,{componentStack:m.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function vN(c,f,m){return m=tl(m),m.tag=3,m.payload={element:null},m.callback=function(){Yx(c,f)},m}function y4(c){return c=tl(c),c.tag=3,c}function v4(c,f,m,b){var _=m.type.getDerivedStateFromError;if(typeof _=="function"){var C=b.value;c.payload=function(){return _(C)},c.callback=function(){b4(f,m,b)}}var R=m.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(c.callback=function(){b4(f,m,b),typeof _!="function"&&(dl===null?dl=new Set([this]):dl.add(this));var q=b.stack;this.componentDidCatch(b.value,{componentStack:q!==null?q:""})})}function Lte(c,f,m,b,_){if(m.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){if(f=m.alternate,f!==null&&Yh(f,m,_,!0),m=ds.current,m!==null){switch(m.tag){case 13:return oi===null?HN():m.alternate===null&&_n===0&&(_n=3),m.flags&=-257,m.flags|=65536,m.lanes=_,b===Yj?m.flags|=16384:(f=m.updateQueue,f===null?m.updateQueue=new Set([b]):f.add(b),VN(c,b,_)),!1;case 22:return m.flags|=65536,b===Yj?m.flags|=16384:(f=m.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([b])},m.updateQueue=f):(m=f.retryQueue,m===null?f.retryQueue=new Set([b]):m.add(b)),VN(c,b,_)),!1}throw Error(r(435,m.tag))}return VN(c,b,_),HN(),!1}if(bt)return f=ds.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=_,b!==Uj&&(c=Error(r(422),{cause:b}),Wh(os(c,m)))):(b!==Uj&&(f=Error(r(423),{cause:b}),Wh(os(f,m))),c=c.current.alternate,c.flags|=65536,_&=-_,c.lanes|=_,b=os(b,m),_=vN(c.stateNode,b,_),Zj(c,_),_n!==4&&(_n=2)),!1;var C=Error(r(520),{cause:b});if(C=os(C,m),mp===null?mp=[C]:mp.push(C),_n!==4&&(_n=2),f===null)return!0;b=os(b,m),m=f;do{switch(m.tag){case 3:return m.flags|=65536,c=_&-_,m.lanes|=c,c=vN(m.stateNode,b,c),Zj(m,c),!1;case 1:if(f=m.type,C=m.stateNode,(m.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(dl===null||!dl.has(C))))return m.flags|=65536,_&=-_,m.lanes|=_,_=y4(_),v4(_,c,m,b),Zj(m,_),!1}m=m.return}while(m!==null);return!1}var w4=Error(r(461)),cr=!1;function jr(c,f,m,b){f.child=c===null?d4(f,null,m,b):kd(f,c.child,m,b)}function j4(c,f,m,b,_){m=m.render;var C=f.ref;if("ref"in b){var R={};for(var q in b)q!=="ref"&&(R[q]=b[q])}else R=b;return Sc(f),b=rN(c,f,m,R,C,_),q=aN(),c!==null&&!cr?(sN(c,f,_),Ji(c,f,_)):(bt&&q&&zj(f),f.flags|=1,jr(c,f,b,_),f.child)}function N4(c,f,m,b,_){if(c===null){var C=m.type;return typeof C=="function"&&!Ij(C)&&C.defaultProps===void 0&&m.compare===null?(f.tag=15,f.type=C,_4(c,f,C,b,_)):(c=Ex(m.type,null,b,f,f.mode,_),c.ref=f.ref,c.return=f,f.child=c)}if(C=c.child,!EN(c,_)){var R=C.memoizedProps;if(m=m.compare,m=m!==null?m:Hh,m(R,b)&&c.ref===f.ref)return Ji(c,f,_)}return f.flags|=1,c=Vi(C,b),c.ref=f.ref,c.return=f,f.child=c}function _4(c,f,m,b,_){if(c!==null){var C=c.memoizedProps;if(Hh(C,b)&&c.ref===f.ref)if(cr=!1,f.pendingProps=b=C,EN(c,_))(c.flags&131072)!==0&&(cr=!0);else return f.lanes=c.lanes,Ji(c,f,_)}return wN(c,f,m,b,_)}function k4(c,f,m){var b=f.pendingProps,_=b.children,C=c!==null?c.memoizedState:null;if(b.mode==="hidden"){if((f.flags&128)!==0){if(b=C!==null?C.baseLanes|m:m,c!==null){for(_=f.child=c.child,C=0;_!==null;)C=C|_.lanes|_.childLanes,_=_.sibling;f.childLanes=C&~b}else f.childLanes=0,f.child=null;return S4(c,f,b,m)}if((m&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},c!==null&&Rx(f,C!==null?C.cachePool:null),C!==null?_R(f,C):eN(),f4(f);else return f.lanes=f.childLanes=536870912,S4(c,f,C!==null?C.baseLanes|m:m,m)}else C!==null?(Rx(f,C.cachePool),_R(f,C),sl(),f.memoizedState=null):(c!==null&&Rx(f,null),eN(),sl());return jr(c,f,_,m),f.child}function S4(c,f,m,b){var _=Wj();return _=_===null?null:{parent:Jn._currentValue,pool:_},f.memoizedState={baseLanes:m,cachePool:_},c!==null&&Rx(f,null),eN(),f4(f),c!==null&&Yh(c,f,b,!0),null}function Xx(c,f){var m=f.ref;if(m===null)c!==null&&c.ref!==null&&(f.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(r(284));(c===null||c.ref!==m)&&(f.flags|=4194816)}}function wN(c,f,m,b,_){return Sc(f),m=rN(c,f,m,b,void 0,_),b=aN(),c!==null&&!cr?(sN(c,f,_),Ji(c,f,_)):(bt&&b&&zj(f),f.flags|=1,jr(c,f,m,_),f.child)}function C4(c,f,m,b,_,C){return Sc(f),f.updateQueue=null,m=SR(f,b,m,_),kR(c),b=aN(),c!==null&&!cr?(sN(c,f,C),Ji(c,f,C)):(bt&&b&&zj(f),f.flags|=1,jr(c,f,m,C),f.child)}function E4(c,f,m,b,_){if(Sc(f),f.stateNode===null){var C=md,R=m.contextType;typeof R=="object"&&R!==null&&(C=$r(R)),C=new m(b,C),f.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=yN,f.stateNode=C,C._reactInternals=f,C=f.stateNode,C.props=b,C.state=f.memoizedState,C.refs={},Xj(f),R=m.contextType,C.context=typeof R=="object"&&R!==null?$r(R):md,C.state=f.memoizedState,R=m.getDerivedStateFromProps,typeof R=="function"&&(bN(f,m,R,b),C.state=f.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(R=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),R!==C.state&&yN.enqueueReplaceState(C,C.state,null),np(f,b,C,_),tp(),C.state=f.memoizedState),typeof C.componentDidMount=="function"&&(f.flags|=4194308),b=!0}else if(c===null){C=f.stateNode;var q=f.memoizedProps,Y=Oc(m,q);C.props=Y;var ee=C.context,he=m.contextType;R=md,typeof he=="object"&&he!==null&&(R=$r(he));var me=m.getDerivedStateFromProps;he=typeof me=="function"||typeof C.getSnapshotBeforeUpdate=="function",q=f.pendingProps!==q,he||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(q||ee!==R)&&p4(f,C,b,R),el=!1;var re=f.memoizedState;C.state=re,np(f,b,C,_),tp(),ee=f.memoizedState,q||re!==ee||el?(typeof me=="function"&&(bN(f,m,me,b),ee=f.memoizedState),(Y=el||h4(f,m,Y,b,re,ee,R))?(he||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(f.flags|=4194308)):(typeof C.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=b,f.memoizedState=ee),C.props=b,C.state=ee,C.context=R,b=Y):(typeof C.componentDidMount=="function"&&(f.flags|=4194308),b=!1)}else{C=f.stateNode,Qj(c,f),R=f.memoizedProps,he=Oc(m,R),C.props=he,me=f.pendingProps,re=C.context,ee=m.contextType,Y=md,typeof ee=="object"&&ee!==null&&(Y=$r(ee)),q=m.getDerivedStateFromProps,(ee=typeof q=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(R!==me||re!==Y)&&p4(f,C,b,Y),el=!1,re=f.memoizedState,C.state=re,np(f,b,C,_),tp();var se=f.memoizedState;R!==me||re!==se||el||c!==null&&c.dependencies!==null&&Tx(c.dependencies)?(typeof q=="function"&&(bN(f,m,q,b),se=f.memoizedState),(he=el||h4(f,m,he,b,re,se,Y)||c!==null&&c.dependencies!==null&&Tx(c.dependencies))?(ee||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(b,se,Y),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(b,se,Y)),typeof C.componentDidUpdate=="function"&&(f.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof C.componentDidUpdate!="function"||R===c.memoizedProps&&re===c.memoizedState||(f.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||R===c.memoizedProps&&re===c.memoizedState||(f.flags|=1024),f.memoizedProps=b,f.memoizedState=se),C.props=b,C.state=se,C.context=Y,b=he):(typeof C.componentDidUpdate!="function"||R===c.memoizedProps&&re===c.memoizedState||(f.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||R===c.memoizedProps&&re===c.memoizedState||(f.flags|=1024),b=!1)}return C=b,Xx(c,f),b=(f.flags&128)!==0,C||b?(C=f.stateNode,m=b&&typeof m.getDerivedStateFromError!="function"?null:C.render(),f.flags|=1,c!==null&&b?(f.child=kd(f,c.child,null,_),f.child=kd(f,null,m,_)):jr(c,f,m,_),f.memoizedState=C.state,c=f.child):c=Ji(c,f,_),c}function O4(c,f,m,b){return Gh(),f.flags|=256,jr(c,f,m,b),f.child}var jN={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function NN(c){return{baseLanes:c,cachePool:gR()}}function _N(c,f,m){return c=c!==null?c.childLanes&~m:0,f&&(c|=fs),c}function A4(c,f,m){var b=f.pendingProps,_=!1,C=(f.flags&128)!==0,R;if((R=C)||(R=c!==null&&c.memoizedState===null?!1:(er.current&2)!==0),R&&(_=!0,f.flags&=-129),R=(f.flags&32)!==0,f.flags&=-33,c===null){if(bt){if(_?al(f):sl(),bt){var q=Nn,Y;if(Y=q){e:{for(Y=q,q=ii;Y.nodeType!==8;){if(!q){q=null;break e}if(Y=Bs(Y.nextSibling),Y===null){q=null;break e}}q=Y}q!==null?(f.memoizedState={dehydrated:q,treeContext:wc!==null?{id:Gi,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},Y=Pa(18,null,null,0),Y.stateNode=q,Y.return=f,f.child=Y,Wr=f,Nn=null,Y=!0):Y=!1}Y||_c(f)}if(q=f.memoizedState,q!==null&&(q=q.dehydrated,q!==null))return o_(q)?f.lanes=32:f.lanes=536870912,null;Zi(f)}return q=b.children,b=b.fallback,_?(sl(),_=f.mode,q=Qx({mode:"hidden",children:q},_),b=vc(b,_,m,null),q.return=f,b.return=f,q.sibling=b,f.child=q,_=f.child,_.memoizedState=NN(m),_.childLanes=_N(c,R,m),f.memoizedState=jN,b):(al(f),kN(f,q))}if(Y=c.memoizedState,Y!==null&&(q=Y.dehydrated,q!==null)){if(C)f.flags&256?(al(f),f.flags&=-257,f=SN(c,f,m)):f.memoizedState!==null?(sl(),f.child=c.child,f.flags|=128,f=null):(sl(),_=b.fallback,q=f.mode,b=Qx({mode:"visible",children:b.children},q),_=vc(_,q,m,null),_.flags|=2,b.return=f,_.return=f,b.sibling=_,f.child=b,kd(f,c.child,null,m),b=f.child,b.memoizedState=NN(m),b.childLanes=_N(c,R,m),f.memoizedState=jN,f=_);else if(al(f),o_(q)){if(R=q.nextSibling&&q.nextSibling.dataset,R)var ee=R.dgst;R=ee,b=Error(r(419)),b.stack="",b.digest=R,Wh({value:b,source:null,stack:null}),f=SN(c,f,m)}else if(cr||Yh(c,f,m,!1),R=(m&c.childLanes)!==0,cr||R){if(R=Vt,R!==null&&(b=m&-m,b=(b&42)!==0?1:lj(b),b=(b&(R.suspendedLanes|m))!==0?0:b,b!==0&&b!==Y.retryLane))throw Y.retryLane=b,pd(c,b),Ia(R,c,b),w4;q.data==="$?"||HN(),f=SN(c,f,m)}else q.data==="$?"?(f.flags|=192,f.child=c.child,f=null):(c=Y.treeContext,Nn=Bs(q.nextSibling),Wr=f,bt=!0,Nc=null,ii=!1,c!==null&&(cs[us++]=Gi,cs[us++]=Wi,cs[us++]=wc,Gi=c.id,Wi=c.overflow,wc=f),f=kN(f,b.children),f.flags|=4096);return f}return _?(sl(),_=b.fallback,q=f.mode,Y=c.child,ee=Y.sibling,b=Vi(Y,{mode:"hidden",children:b.children}),b.subtreeFlags=Y.subtreeFlags&65011712,ee!==null?_=Vi(ee,_):(_=vc(_,q,m,null),_.flags|=2),_.return=f,b.return=f,b.sibling=_,f.child=b,b=_,_=f.child,q=c.child.memoizedState,q===null?q=NN(m):(Y=q.cachePool,Y!==null?(ee=Jn._currentValue,Y=Y.parent!==ee?{parent:ee,pool:ee}:Y):Y=gR(),q={baseLanes:q.baseLanes|m,cachePool:Y}),_.memoizedState=q,_.childLanes=_N(c,R,m),f.memoizedState=jN,b):(al(f),m=c.child,c=m.sibling,m=Vi(m,{mode:"visible",children:b.children}),m.return=f,m.sibling=null,c!==null&&(R=f.deletions,R===null?(f.deletions=[c],f.flags|=16):R.push(c)),f.child=m,f.memoizedState=null,m)}function kN(c,f){return f=Qx({mode:"visible",children:f},c.mode),f.return=c,c.child=f}function Qx(c,f){return c=Pa(22,c,null,f),c.lanes=0,c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},c}function SN(c,f,m){return kd(f,c.child,null,m),c=kN(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function T4(c,f,m){c.lanes|=f;var b=c.alternate;b!==null&&(b.lanes|=f),Hj(c.return,f,m)}function CN(c,f,m,b,_){var C=c.memoizedState;C===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:b,tail:m,tailMode:_}:(C.isBackwards=f,C.rendering=null,C.renderingStartTime=0,C.last=b,C.tail=m,C.tailMode=_)}function P4(c,f,m){var b=f.pendingProps,_=b.revealOrder,C=b.tail;if(jr(c,f,b.children,m),b=er.current,(b&2)!==0)b=b&1|2,f.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&T4(c,m,f);else if(c.tag===19)T4(c,m,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}b&=1}switch(X(er,b),_){case"forwards":for(m=f.child,_=null;m!==null;)c=m.alternate,c!==null&&Gx(c)===null&&(_=m),m=m.sibling;m=_,m===null?(_=f.child,f.child=null):(_=m.sibling,m.sibling=null),CN(f,!1,_,m,C);break;case"backwards":for(m=null,_=f.child,f.child=null;_!==null;){if(c=_.alternate,c!==null&&Gx(c)===null){f.child=_;break}c=_.sibling,_.sibling=m,m=_,_=c}CN(f,!0,m,null,C);break;case"together":CN(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Ji(c,f,m){if(c!==null&&(f.dependencies=c.dependencies),ul|=f.lanes,(m&f.childLanes)===0)if(c!==null){if(Yh(c,f,m,!1),(m&f.childLanes)===0)return null}else return null;if(c!==null&&f.child!==c.child)throw Error(r(153));if(f.child!==null){for(c=f.child,m=Vi(c,c.pendingProps),f.child=m,m.return=f;c.sibling!==null;)c=c.sibling,m=m.sibling=Vi(c,c.pendingProps),m.return=f;m.sibling=null}return f.child}function EN(c,f){return(c.lanes&f)!==0?!0:(c=c.dependencies,!!(c!==null&&Tx(c)))}function Fte(c,f,m){switch(f.tag){case 3:xe(f,f.stateNode.containerInfo),Jo(f,Jn,c.memoizedState.cache),Gh();break;case 27:case 5:we(f);break;case 4:xe(f,f.stateNode.containerInfo);break;case 10:Jo(f,f.type,f.memoizedProps.value);break;case 13:var b=f.memoizedState;if(b!==null)return b.dehydrated!==null?(al(f),f.flags|=128,null):(m&f.child.childLanes)!==0?A4(c,f,m):(al(f),c=Ji(c,f,m),c!==null?c.sibling:null);al(f);break;case 19:var _=(c.flags&128)!==0;if(b=(m&f.childLanes)!==0,b||(Yh(c,f,m,!1),b=(m&f.childLanes)!==0),_){if(b)return P4(c,f,m);f.flags|=128}if(_=f.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),X(er,er.current),b)break;return null;case 22:case 23:return f.lanes=0,k4(c,f,m);case 24:Jo(f,Jn,c.memoizedState.cache)}return Ji(c,f,m)}function R4(c,f,m){if(c!==null)if(c.memoizedProps!==f.pendingProps)cr=!0;else{if(!EN(c,m)&&(f.flags&128)===0)return cr=!1,Fte(c,f,m);cr=(c.flags&131072)!==0}else cr=!1,bt&&(f.flags&1048576)!==0&&cR(f,Ax,f.index);switch(f.lanes=0,f.tag){case 16:e:{c=f.pendingProps;var b=f.elementType,_=b._init;if(b=_(b._payload),f.type=b,typeof b=="function")Ij(b)?(c=Oc(b,c),f.tag=1,f=E4(null,f,b,c,m)):(f.tag=0,f=wN(null,f,b,c,m));else{if(b!=null){if(_=b.$$typeof,_===E){f.tag=11,f=j4(null,f,b,c,m);break e}else if(_===P){f.tag=14,f=N4(null,f,b,c,m);break e}}throw f=U(b)||b,Error(r(306,f,""))}}return f;case 0:return wN(c,f,f.type,f.pendingProps,m);case 1:return b=f.type,_=Oc(b,f.pendingProps),E4(c,f,b,_,m);case 3:e:{if(xe(f,f.stateNode.containerInfo),c===null)throw Error(r(387));b=f.pendingProps;var C=f.memoizedState;_=C.element,Qj(c,f),np(f,b,null,m);var R=f.memoizedState;if(b=R.cache,Jo(f,Jn,b),b!==C.cache&&Kj(f,[Jn],m,!0),tp(),b=R.element,C.isDehydrated)if(C={element:b,isDehydrated:!1,cache:R.cache},f.updateQueue.baseState=C,f.memoizedState=C,f.flags&256){f=O4(c,f,b,m);break e}else if(b!==_){_=os(Error(r(424)),f),Wh(_),f=O4(c,f,b,m);break e}else{switch(c=f.stateNode.containerInfo,c.nodeType){case 9:c=c.body;break;default:c=c.nodeName==="HTML"?c.ownerDocument.body:c}for(Nn=Bs(c.firstChild),Wr=f,bt=!0,Nc=null,ii=!0,m=d4(f,null,b,m),f.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling}else{if(Gh(),b===_){f=Ji(c,f,m);break e}jr(c,f,b,m)}f=f.child}return f;case 26:return Xx(c,f),c===null?(m=IM(f.type,null,f.pendingProps,null))?f.memoizedState=m:bt||(m=f.type,c=f.pendingProps,b=db(ae.current).createElement(m),b[Dr]=f,b[aa]=c,_r(b,m,c),lr(b),f.stateNode=b):f.memoizedState=IM(f.type,c.memoizedProps,f.pendingProps,c.memoizedState),null;case 27:return we(f),c===null&&bt&&(b=f.stateNode=MM(f.type,f.pendingProps,ae.current),Wr=f,ii=!0,_=Nn,pl(f.type)?(l_=_,Nn=Bs(b.firstChild)):Nn=_),jr(c,f,f.pendingProps.children,m),Xx(c,f),c===null&&(f.flags|=4194304),f.child;case 5:return c===null&&bt&&((_=b=Nn)&&(b=hne(b,f.type,f.pendingProps,ii),b!==null?(f.stateNode=b,Wr=f,Nn=Bs(b.firstChild),ii=!1,_=!0):_=!1),_||_c(f)),we(f),_=f.type,C=f.pendingProps,R=c!==null?c.memoizedProps:null,b=C.children,a_(_,C)?b=null:R!==null&&a_(_,R)&&(f.flags|=32),f.memoizedState!==null&&(_=rN(c,f,Tte,null,null,m),_p._currentValue=_),Xx(c,f),jr(c,f,b,m),f.child;case 6:return c===null&&bt&&((c=m=Nn)&&(m=pne(m,f.pendingProps,ii),m!==null?(f.stateNode=m,Wr=f,Nn=null,c=!0):c=!1),c||_c(f)),null;case 13:return A4(c,f,m);case 4:return xe(f,f.stateNode.containerInfo),b=f.pendingProps,c===null?f.child=kd(f,null,b,m):jr(c,f,b,m),f.child;case 11:return j4(c,f,f.type,f.pendingProps,m);case 7:return jr(c,f,f.pendingProps,m),f.child;case 8:return jr(c,f,f.pendingProps.children,m),f.child;case 12:return jr(c,f,f.pendingProps.children,m),f.child;case 10:return b=f.pendingProps,Jo(f,f.type,b.value),jr(c,f,b.children,m),f.child;case 9:return _=f.type._context,b=f.pendingProps.children,Sc(f),_=$r(_),b=b(_),f.flags|=1,jr(c,f,b,m),f.child;case 14:return N4(c,f,f.type,f.pendingProps,m);case 15:return _4(c,f,f.type,f.pendingProps,m);case 19:return P4(c,f,m);case 31:return b=f.pendingProps,m=f.mode,b={mode:b.mode,children:b.children},c===null?(m=Qx(b,m),m.ref=f.ref,f.child=m,m.return=f,f=m):(m=Vi(c.child,b),m.ref=f.ref,f.child=m,m.return=f,f=m),f;case 22:return k4(c,f,m);case 24:return Sc(f),b=$r(Jn),c===null?(_=Wj(),_===null&&(_=Vt,C=Vj(),_.pooledCache=C,C.refCount++,C!==null&&(_.pooledCacheLanes|=m),_=C),f.memoizedState={parent:b,cache:_},Xj(f),Jo(f,Jn,_)):((c.lanes&m)!==0&&(Qj(c,f),np(f,null,null,m),tp()),_=c.memoizedState,C=f.memoizedState,_.parent!==b?(_={parent:b,cache:b},f.memoizedState=_,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=_),Jo(f,Jn,b)):(b=C.cache,Jo(f,Jn,b),b!==_.cache&&Kj(f,[Jn],m,!0))),jr(c,f,f.pendingProps.children,m),f.child;case 29:throw f.pendingProps}throw Error(r(156,f.tag))}function eo(c){c.flags|=4}function M4(c,f){if(f.type!=="stylesheet"||(f.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!UM(f)){if(f=ds.current,f!==null&&((ft&4194048)===ft?oi!==null:(ft&62914560)!==ft&&(ft&536870912)===0||f!==oi))throw Jh=Yj,xR;c.flags|=8192}}function Zx(c,f){f!==null&&(c.flags|=4),c.flags&16384&&(f=c.tag!==22?f3():536870912,c.lanes|=f,Od|=f)}function cp(c,f){if(!bt)switch(c.tailMode){case"hidden":f=c.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?c.tail=null:m.sibling=null;break;case"collapsed":m=c.tail;for(var b=null;m!==null;)m.alternate!==null&&(b=m),m=m.sibling;b===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:b.sibling=null}}function xn(c){var f=c.alternate!==null&&c.alternate.child===c.child,m=0,b=0;if(f)for(var _=c.child;_!==null;)m|=_.lanes|_.childLanes,b|=_.subtreeFlags&65011712,b|=_.flags&65011712,_.return=c,_=_.sibling;else for(_=c.child;_!==null;)m|=_.lanes|_.childLanes,b|=_.subtreeFlags,b|=_.flags,_.return=c,_=_.sibling;return c.subtreeFlags|=b,c.childLanes=m,f}function zte(c,f,m){var b=f.pendingProps;switch(Bj(f),f.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(f),null;case 1:return xn(f),null;case 3:return m=f.stateNode,b=null,c!==null&&(b=c.memoizedState.cache),f.memoizedState.cache!==b&&(f.flags|=2048),Xi(Jn),ue(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(c===null||c.child===null)&&(Vh(f)?eo(f):c===null||c.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,fR())),xn(f),null;case 26:return m=f.memoizedState,c===null?(eo(f),m!==null?(xn(f),M4(f,m)):(xn(f),f.flags&=-16777217)):m?m!==c.memoizedState?(eo(f),xn(f),M4(f,m)):(xn(f),f.flags&=-16777217):(c.memoizedProps!==b&&eo(f),xn(f),f.flags&=-16777217),null;case 27:Oe(f),m=ae.current;var _=f.type;if(c!==null&&f.stateNode!=null)c.memoizedProps!==b&&eo(f);else{if(!b){if(f.stateNode===null)throw Error(r(166));return xn(f),null}c=te.current,Vh(f)?uR(f):(c=MM(_,b,m),f.stateNode=c,eo(f))}return xn(f),null;case 5:if(Oe(f),m=f.type,c!==null&&f.stateNode!=null)c.memoizedProps!==b&&eo(f);else{if(!b){if(f.stateNode===null)throw Error(r(166));return xn(f),null}if(c=te.current,Vh(f))uR(f);else{switch(_=db(ae.current),c){case 1:c=_.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:c=_.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":c=_.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":c=_.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":c=_.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof b.is=="string"?_.createElement("select",{is:b.is}):_.createElement("select"),b.multiple?c.multiple=!0:b.size&&(c.size=b.size);break;default:c=typeof b.is=="string"?_.createElement(m,{is:b.is}):_.createElement(m)}}c[Dr]=f,c[aa]=b;e:for(_=f.child;_!==null;){if(_.tag===5||_.tag===6)c.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===f)break e;for(;_.sibling===null;){if(_.return===null||_.return===f)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}f.stateNode=c;e:switch(_r(c,m,b),m){case"button":case"input":case"select":case"textarea":c=!!b.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&eo(f)}}return xn(f),f.flags&=-16777217,null;case 6:if(c&&f.stateNode!=null)c.memoizedProps!==b&&eo(f);else{if(typeof b!="string"&&f.stateNode===null)throw Error(r(166));if(c=ae.current,Vh(f)){if(c=f.stateNode,m=f.memoizedProps,b=null,_=Wr,_!==null)switch(_.tag){case 27:case 5:b=_.memoizedProps}c[Dr]=f,c=!!(c.nodeValue===m||b!==null&&b.suppressHydrationWarning===!0||CM(c.nodeValue,m)),c||_c(f)}else c=db(c).createTextNode(b),c[Dr]=f,f.stateNode=c}return xn(f),null;case 13:if(b=f.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(_=Vh(f),b!==null&&b.dehydrated!==null){if(c===null){if(!_)throw Error(r(318));if(_=f.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[Dr]=f}else Gh(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;xn(f),_=!1}else _=fR(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=_),_=!0;if(!_)return f.flags&256?(Zi(f),f):(Zi(f),null)}if(Zi(f),(f.flags&128)!==0)return f.lanes=m,f;if(m=b!==null,c=c!==null&&c.memoizedState!==null,m){b=f.child,_=null,b.alternate!==null&&b.alternate.memoizedState!==null&&b.alternate.memoizedState.cachePool!==null&&(_=b.alternate.memoizedState.cachePool.pool);var C=null;b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(C=b.memoizedState.cachePool.pool),C!==_&&(b.flags|=2048)}return m!==c&&m&&(f.child.flags|=8192),Zx(f,f.updateQueue),xn(f),null;case 4:return ue(),c===null&&JN(f.stateNode.containerInfo),xn(f),null;case 10:return Xi(f.type),xn(f),null;case 19:if(V(er),_=f.memoizedState,_===null)return xn(f),null;if(b=(f.flags&128)!==0,C=_.rendering,C===null)if(b)cp(_,!1);else{if(_n!==0||c!==null&&(c.flags&128)!==0)for(c=f.child;c!==null;){if(C=Gx(c),C!==null){for(f.flags|=128,cp(_,!1),c=C.updateQueue,f.updateQueue=c,Zx(f,c),f.subtreeFlags=0,c=m,m=f.child;m!==null;)lR(m,c),m=m.sibling;return X(er,er.current&1|2),f.child}c=c.sibling}_.tail!==null&&be()>tb&&(f.flags|=128,b=!0,cp(_,!1),f.lanes=4194304)}else{if(!b)if(c=Gx(C),c!==null){if(f.flags|=128,b=!0,c=c.updateQueue,f.updateQueue=c,Zx(f,c),cp(_,!0),_.tail===null&&_.tailMode==="hidden"&&!C.alternate&&!bt)return xn(f),null}else 2*be()-_.renderingStartTime>tb&&m!==536870912&&(f.flags|=128,b=!0,cp(_,!1),f.lanes=4194304);_.isBackwards?(C.sibling=f.child,f.child=C):(c=_.last,c!==null?c.sibling=C:f.child=C,_.last=C)}return _.tail!==null?(f=_.tail,_.rendering=f,_.tail=f.sibling,_.renderingStartTime=be(),f.sibling=null,c=er.current,X(er,b?c&1|2:c&1),f):(xn(f),null);case 22:case 23:return Zi(f),tN(),b=f.memoizedState!==null,c!==null?c.memoizedState!==null!==b&&(f.flags|=8192):b&&(f.flags|=8192),b?(m&536870912)!==0&&(f.flags&128)===0&&(xn(f),f.subtreeFlags&6&&(f.flags|=8192)):xn(f),m=f.updateQueue,m!==null&&Zx(f,m.retryQueue),m=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),b=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(b=f.memoizedState.cachePool.pool),b!==m&&(f.flags|=2048),c!==null&&V(Cc),null;case 24:return m=null,c!==null&&(m=c.memoizedState.cache),f.memoizedState.cache!==m&&(f.flags|=2048),Xi(Jn),xn(f),null;case 25:return null;case 30:return null}throw Error(r(156,f.tag))}function Bte(c,f){switch(Bj(f),f.tag){case 1:return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return Xi(Jn),ue(),c=f.flags,(c&65536)!==0&&(c&128)===0?(f.flags=c&-65537|128,f):null;case 26:case 27:case 5:return Oe(f),null;case 13:if(Zi(f),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(r(340));Gh()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return V(er),null;case 4:return ue(),null;case 10:return Xi(f.type),null;case 22:case 23:return Zi(f),tN(),c!==null&&V(Cc),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 24:return Xi(Jn),null;case 25:return null;default:return null}}function D4(c,f){switch(Bj(f),f.tag){case 3:Xi(Jn),ue();break;case 26:case 27:case 5:Oe(f);break;case 4:ue();break;case 13:Zi(f);break;case 19:V(er);break;case 10:Xi(f.type);break;case 22:case 23:Zi(f),tN(),c!==null&&V(Cc);break;case 24:Xi(Jn)}}function up(c,f){try{var m=f.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var _=b.next;m=_;do{if((m.tag&c)===c){b=void 0;var C=m.create,R=m.inst;b=C(),R.destroy=b}m=m.next}while(m!==_)}}catch(q){It(f,f.return,q)}}function il(c,f,m){try{var b=f.updateQueue,_=b!==null?b.lastEffect:null;if(_!==null){var C=_.next;b=C;do{if((b.tag&c)===c){var R=b.inst,q=R.destroy;if(q!==void 0){R.destroy=void 0,_=f;var Y=m,ee=q;try{ee()}catch(he){It(_,Y,he)}}}b=b.next}while(b!==C)}}catch(he){It(f,f.return,he)}}function $4(c){var f=c.updateQueue;if(f!==null){var m=c.stateNode;try{NR(f,m)}catch(b){It(c,c.return,b)}}}function I4(c,f,m){m.props=Oc(c.type,c.memoizedProps),m.state=c.memoizedState;try{m.componentWillUnmount()}catch(b){It(c,f,b)}}function dp(c,f){try{var m=c.ref;if(m!==null){switch(c.tag){case 26:case 27:case 5:var b=c.stateNode;break;case 30:b=c.stateNode;break;default:b=c.stateNode}typeof m=="function"?c.refCleanup=m(b):m.current=b}}catch(_){It(c,f,_)}}function li(c,f){var m=c.ref,b=c.refCleanup;if(m!==null)if(typeof b=="function")try{b()}catch(_){It(c,f,_)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(_){It(c,f,_)}else m.current=null}function L4(c){var f=c.type,m=c.memoizedProps,b=c.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":m.autoFocus&&b.focus();break e;case"img":m.src?b.src=m.src:m.srcSet&&(b.srcset=m.srcSet)}}catch(_){It(c,c.return,_)}}function ON(c,f,m){try{var b=c.stateNode;lne(b,c.type,m,f),b[aa]=f}catch(_){It(c,c.return,_)}}function F4(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&pl(c.type)||c.tag===4}function AN(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||F4(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&pl(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function TN(c,f,m){var b=c.tag;if(b===5||b===6)c=c.stateNode,f?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(c,f):(f=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,f.appendChild(c),m=m._reactRootContainer,m!=null||f.onclick!==null||(f.onclick=ub));else if(b!==4&&(b===27&&pl(c.type)&&(m=c.stateNode,f=null),c=c.child,c!==null))for(TN(c,f,m),c=c.sibling;c!==null;)TN(c,f,m),c=c.sibling}function Jx(c,f,m){var b=c.tag;if(b===5||b===6)c=c.stateNode,f?m.insertBefore(c,f):m.appendChild(c);else if(b!==4&&(b===27&&pl(c.type)&&(m=c.stateNode),c=c.child,c!==null))for(Jx(c,f,m),c=c.sibling;c!==null;)Jx(c,f,m),c=c.sibling}function z4(c){var f=c.stateNode,m=c.memoizedProps;try{for(var b=c.type,_=f.attributes;_.length;)f.removeAttributeNode(_[0]);_r(f,b,m),f[Dr]=c,f[aa]=m}catch(C){It(c,c.return,C)}}var to=!1,Pn=!1,PN=!1,B4=typeof WeakSet=="function"?WeakSet:Set,ur=null;function Ute(c,f){if(c=c.containerInfo,n_=xb,c=Z3(c),Aj(c)){if("selectionStart"in c)var m={start:c.selectionStart,end:c.selectionEnd};else e:{m=(m=c.ownerDocument)&&m.defaultView||window;var b=m.getSelection&&m.getSelection();if(b&&b.rangeCount!==0){m=b.anchorNode;var _=b.anchorOffset,C=b.focusNode;b=b.focusOffset;try{m.nodeType,C.nodeType}catch{m=null;break e}var R=0,q=-1,Y=-1,ee=0,he=0,me=c,re=null;t:for(;;){for(var se;me!==m||_!==0&&me.nodeType!==3||(q=R+_),me!==C||b!==0&&me.nodeType!==3||(Y=R+b),me.nodeType===3&&(R+=me.nodeValue.length),(se=me.firstChild)!==null;)re=me,me=se;for(;;){if(me===c)break t;if(re===m&&++ee===_&&(q=R),re===C&&++he===b&&(Y=R),(se=me.nextSibling)!==null)break;me=re,re=me.parentNode}me=se}m=q===-1||Y===-1?null:{start:q,end:Y}}else m=null}m=m||{start:0,end:0}}else m=null;for(r_={focusedElem:c,selectionRange:m},xb=!1,ur=f;ur!==null;)if(f=ur,c=f.child,(f.subtreeFlags&1024)!==0&&c!==null)c.return=f,ur=c;else for(;ur!==null;){switch(f=ur,C=f.alternate,c=f.flags,f.tag){case 0:break;case 11:case 15:break;case 1:if((c&1024)!==0&&C!==null){c=void 0,m=f,_=C.memoizedProps,C=C.memoizedState,b=m.stateNode;try{var Qe=Oc(m.type,_,m.elementType===m.type);c=b.getSnapshotBeforeUpdate(Qe,C),b.__reactInternalSnapshotBeforeUpdate=c}catch(We){It(m,m.return,We)}}break;case 3:if((c&1024)!==0){if(c=f.stateNode.containerInfo,m=c.nodeType,m===9)i_(c);else if(m===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":i_(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(r(163))}if(c=f.sibling,c!==null){c.return=f.return,ur=c;break}ur=f.return}}function U4(c,f,m){var b=m.flags;switch(m.tag){case 0:case 11:case 15:ol(c,m),b&4&&up(5,m);break;case 1:if(ol(c,m),b&4)if(c=m.stateNode,f===null)try{c.componentDidMount()}catch(R){It(m,m.return,R)}else{var _=Oc(m.type,f.memoizedProps);f=f.memoizedState;try{c.componentDidUpdate(_,f,c.__reactInternalSnapshotBeforeUpdate)}catch(R){It(m,m.return,R)}}b&64&&$4(m),b&512&&dp(m,m.return);break;case 3:if(ol(c,m),b&64&&(c=m.updateQueue,c!==null)){if(f=null,m.child!==null)switch(m.child.tag){case 27:case 5:f=m.child.stateNode;break;case 1:f=m.child.stateNode}try{NR(c,f)}catch(R){It(m,m.return,R)}}break;case 27:f===null&&b&4&&z4(m);case 26:case 5:ol(c,m),f===null&&b&4&&L4(m),b&512&&dp(m,m.return);break;case 12:ol(c,m);break;case 13:ol(c,m),b&4&&K4(c,m),b&64&&(c=m.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(m=Qte.bind(null,m),mne(c,m))));break;case 22:if(b=m.memoizedState!==null||to,!b){f=f!==null&&f.memoizedState!==null||Pn,_=to;var C=Pn;to=b,(Pn=f)&&!C?ll(c,m,(m.subtreeFlags&8772)!==0):ol(c,m),to=_,Pn=C}break;case 30:break;default:ol(c,m)}}function q4(c){var f=c.alternate;f!==null&&(c.alternate=null,q4(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&dj(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var ln=null,oa=!1;function no(c,f,m){for(m=m.child;m!==null;)H4(c,f,m),m=m.sibling}function H4(c,f,m){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(Kt,m)}catch{}switch(m.tag){case 26:Pn||li(m,f),no(c,f,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:Pn||li(m,f);var b=ln,_=oa;pl(m.type)&&(ln=m.stateNode,oa=!1),no(c,f,m),vp(m.stateNode),ln=b,oa=_;break;case 5:Pn||li(m,f);case 6:if(b=ln,_=oa,ln=null,no(c,f,m),ln=b,oa=_,ln!==null)if(oa)try{(ln.nodeType===9?ln.body:ln.nodeName==="HTML"?ln.ownerDocument.body:ln).removeChild(m.stateNode)}catch(C){It(m,f,C)}else try{ln.removeChild(m.stateNode)}catch(C){It(m,f,C)}break;case 18:ln!==null&&(oa?(c=ln,PM(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,m.stateNode),Ep(c)):PM(ln,m.stateNode));break;case 4:b=ln,_=oa,ln=m.stateNode.containerInfo,oa=!0,no(c,f,m),ln=b,oa=_;break;case 0:case 11:case 14:case 15:Pn||il(2,m,f),Pn||il(4,m,f),no(c,f,m);break;case 1:Pn||(li(m,f),b=m.stateNode,typeof b.componentWillUnmount=="function"&&I4(m,f,b)),no(c,f,m);break;case 21:no(c,f,m);break;case 22:Pn=(b=Pn)||m.memoizedState!==null,no(c,f,m),Pn=b;break;default:no(c,f,m)}}function K4(c,f){if(f.memoizedState===null&&(c=f.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Ep(c)}catch(m){It(f,f.return,m)}}function qte(c){switch(c.tag){case 13:case 19:var f=c.stateNode;return f===null&&(f=c.stateNode=new B4),f;case 22:return c=c.stateNode,f=c._retryCache,f===null&&(f=c._retryCache=new B4),f;default:throw Error(r(435,c.tag))}}function RN(c,f){var m=qte(c);f.forEach(function(b){var _=Zte.bind(null,c,b);m.has(b)||(m.add(b),b.then(_,_))})}function Ra(c,f){var m=f.deletions;if(m!==null)for(var b=0;b<m.length;b++){var _=m[b],C=c,R=f,q=R;e:for(;q!==null;){switch(q.tag){case 27:if(pl(q.type)){ln=q.stateNode,oa=!1;break e}break;case 5:ln=q.stateNode,oa=!1;break e;case 3:case 4:ln=q.stateNode.containerInfo,oa=!0;break e}q=q.return}if(ln===null)throw Error(r(160));H4(C,R,_),ln=null,oa=!1,C=_.alternate,C!==null&&(C.return=null),_.return=null}if(f.subtreeFlags&13878)for(f=f.child;f!==null;)V4(f,c),f=f.sibling}var zs=null;function V4(c,f){var m=c.alternate,b=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:Ra(f,c),Ma(c),b&4&&(il(3,c,c.return),up(3,c),il(5,c,c.return));break;case 1:Ra(f,c),Ma(c),b&512&&(Pn||m===null||li(m,m.return)),b&64&&to&&(c=c.updateQueue,c!==null&&(b=c.callbacks,b!==null&&(m=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=m===null?b:m.concat(b))));break;case 26:var _=zs;if(Ra(f,c),Ma(c),b&512&&(Pn||m===null||li(m,m.return)),b&4){var C=m!==null?m.memoizedState:null;if(b=c.memoizedState,m===null)if(b===null)if(c.stateNode===null){e:{b=c.type,m=c.memoizedProps,_=_.ownerDocument||_;t:switch(b){case"title":C=_.getElementsByTagName("title")[0],(!C||C[Dh]||C[Dr]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=_.createElement(b),_.head.insertBefore(C,_.querySelector("head > title"))),_r(C,b,m),C[Dr]=c,lr(C),b=C;break e;case"link":var R=zM("link","href",_).get(b+(m.href||""));if(R){for(var q=0;q<R.length;q++)if(C=R[q],C.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&C.getAttribute("rel")===(m.rel==null?null:m.rel)&&C.getAttribute("title")===(m.title==null?null:m.title)&&C.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){R.splice(q,1);break t}}C=_.createElement(b),_r(C,b,m),_.head.appendChild(C);break;case"meta":if(R=zM("meta","content",_).get(b+(m.content||""))){for(q=0;q<R.length;q++)if(C=R[q],C.getAttribute("content")===(m.content==null?null:""+m.content)&&C.getAttribute("name")===(m.name==null?null:m.name)&&C.getAttribute("property")===(m.property==null?null:m.property)&&C.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&C.getAttribute("charset")===(m.charSet==null?null:m.charSet)){R.splice(q,1);break t}}C=_.createElement(b),_r(C,b,m),_.head.appendChild(C);break;default:throw Error(r(468,b))}C[Dr]=c,lr(C),b=C}c.stateNode=b}else BM(_,c.type,c.stateNode);else c.stateNode=FM(_,b,c.memoizedProps);else C!==b?(C===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):C.count--,b===null?BM(_,c.type,c.stateNode):FM(_,b,c.memoizedProps)):b===null&&c.stateNode!==null&&ON(c,c.memoizedProps,m.memoizedProps)}break;case 27:Ra(f,c),Ma(c),b&512&&(Pn||m===null||li(m,m.return)),m!==null&&b&4&&ON(c,c.memoizedProps,m.memoizedProps);break;case 5:if(Ra(f,c),Ma(c),b&512&&(Pn||m===null||li(m,m.return)),c.flags&32){_=c.stateNode;try{od(_,"")}catch(se){It(c,c.return,se)}}b&4&&c.stateNode!=null&&(_=c.memoizedProps,ON(c,_,m!==null?m.memoizedProps:_)),b&1024&&(PN=!0);break;case 6:if(Ra(f,c),Ma(c),b&4){if(c.stateNode===null)throw Error(r(162));b=c.memoizedProps,m=c.stateNode;try{m.nodeValue=b}catch(se){It(c,c.return,se)}}break;case 3:if(pb=null,_=zs,zs=fb(f.containerInfo),Ra(f,c),zs=_,Ma(c),b&4&&m!==null&&m.memoizedState.isDehydrated)try{Ep(f.containerInfo)}catch(se){It(c,c.return,se)}PN&&(PN=!1,G4(c));break;case 4:b=zs,zs=fb(c.stateNode.containerInfo),Ra(f,c),Ma(c),zs=b;break;case 12:Ra(f,c),Ma(c);break;case 13:Ra(f,c),Ma(c),c.child.flags&8192&&c.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(FN=be()),b&4&&(b=c.updateQueue,b!==null&&(c.updateQueue=null,RN(c,b)));break;case 22:_=c.memoizedState!==null;var Y=m!==null&&m.memoizedState!==null,ee=to,he=Pn;if(to=ee||_,Pn=he||Y,Ra(f,c),Pn=he,to=ee,Ma(c),b&8192)e:for(f=c.stateNode,f._visibility=_?f._visibility&-2:f._visibility|1,_&&(m===null||Y||to||Pn||Ac(c)),m=null,f=c;;){if(f.tag===5||f.tag===26){if(m===null){Y=m=f;try{if(C=Y.stateNode,_)R=C.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{q=Y.stateNode;var me=Y.memoizedProps.style,re=me!=null&&me.hasOwnProperty("display")?me.display:null;q.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(se){It(Y,Y.return,se)}}}else if(f.tag===6){if(m===null){Y=f;try{Y.stateNode.nodeValue=_?"":Y.memoizedProps}catch(se){It(Y,Y.return,se)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===c)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break e;for(;f.sibling===null;){if(f.return===null||f.return===c)break e;m===f&&(m=null),f=f.return}m===f&&(m=null),f.sibling.return=f.return,f=f.sibling}b&4&&(b=c.updateQueue,b!==null&&(m=b.retryQueue,m!==null&&(b.retryQueue=null,RN(c,m))));break;case 19:Ra(f,c),Ma(c),b&4&&(b=c.updateQueue,b!==null&&(c.updateQueue=null,RN(c,b)));break;case 30:break;case 21:break;default:Ra(f,c),Ma(c)}}function Ma(c){var f=c.flags;if(f&2){try{for(var m,b=c.return;b!==null;){if(F4(b)){m=b;break}b=b.return}if(m==null)throw Error(r(160));switch(m.tag){case 27:var _=m.stateNode,C=AN(c);Jx(c,C,_);break;case 5:var R=m.stateNode;m.flags&32&&(od(R,""),m.flags&=-33);var q=AN(c);Jx(c,q,R);break;case 3:case 4:var Y=m.stateNode.containerInfo,ee=AN(c);TN(c,ee,Y);break;default:throw Error(r(161))}}catch(he){It(c,c.return,he)}c.flags&=-3}f&4096&&(c.flags&=-4097)}function G4(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var f=c;G4(f),f.tag===5&&f.flags&1024&&f.stateNode.reset(),c=c.sibling}}function ol(c,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)U4(c,f.alternate,f),f=f.sibling}function Ac(c){for(c=c.child;c!==null;){var f=c;switch(f.tag){case 0:case 11:case 14:case 15:il(4,f,f.return),Ac(f);break;case 1:li(f,f.return);var m=f.stateNode;typeof m.componentWillUnmount=="function"&&I4(f,f.return,m),Ac(f);break;case 27:vp(f.stateNode);case 26:case 5:li(f,f.return),Ac(f);break;case 22:f.memoizedState===null&&Ac(f);break;case 30:Ac(f);break;default:Ac(f)}c=c.sibling}}function ll(c,f,m){for(m=m&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var b=f.alternate,_=c,C=f,R=C.flags;switch(C.tag){case 0:case 11:case 15:ll(_,C,m),up(4,C);break;case 1:if(ll(_,C,m),b=C,_=b.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(ee){It(b,b.return,ee)}if(b=C,_=b.updateQueue,_!==null){var q=b.stateNode;try{var Y=_.shared.hiddenCallbacks;if(Y!==null)for(_.shared.hiddenCallbacks=null,_=0;_<Y.length;_++)jR(Y[_],q)}catch(ee){It(b,b.return,ee)}}m&&R&64&&$4(C),dp(C,C.return);break;case 27:z4(C);case 26:case 5:ll(_,C,m),m&&b===null&&R&4&&L4(C),dp(C,C.return);break;case 12:ll(_,C,m);break;case 13:ll(_,C,m),m&&R&4&&K4(_,C);break;case 22:C.memoizedState===null&&ll(_,C,m),dp(C,C.return);break;case 30:break;default:ll(_,C,m)}f=f.sibling}}function MN(c,f){var m=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),c=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(c=f.memoizedState.cachePool.pool),c!==m&&(c!=null&&c.refCount++,m!=null&&Xh(m))}function DN(c,f){c=null,f.alternate!==null&&(c=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==c&&(f.refCount++,c!=null&&Xh(c))}function ci(c,f,m,b){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)W4(c,f,m,b),f=f.sibling}function W4(c,f,m,b){var _=f.flags;switch(f.tag){case 0:case 11:case 15:ci(c,f,m,b),_&2048&&up(9,f);break;case 1:ci(c,f,m,b);break;case 3:ci(c,f,m,b),_&2048&&(c=null,f.alternate!==null&&(c=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==c&&(f.refCount++,c!=null&&Xh(c)));break;case 12:if(_&2048){ci(c,f,m,b),c=f.stateNode;try{var C=f.memoizedProps,R=C.id,q=C.onPostCommit;typeof q=="function"&&q(R,f.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(Y){It(f,f.return,Y)}}else ci(c,f,m,b);break;case 13:ci(c,f,m,b);break;case 23:break;case 22:C=f.stateNode,R=f.alternate,f.memoizedState!==null?C._visibility&2?ci(c,f,m,b):fp(c,f):C._visibility&2?ci(c,f,m,b):(C._visibility|=2,Sd(c,f,m,b,(f.subtreeFlags&10256)!==0)),_&2048&&MN(R,f);break;case 24:ci(c,f,m,b),_&2048&&DN(f.alternate,f);break;default:ci(c,f,m,b)}}function Sd(c,f,m,b,_){for(_=_&&(f.subtreeFlags&10256)!==0,f=f.child;f!==null;){var C=c,R=f,q=m,Y=b,ee=R.flags;switch(R.tag){case 0:case 11:case 15:Sd(C,R,q,Y,_),up(8,R);break;case 23:break;case 22:var he=R.stateNode;R.memoizedState!==null?he._visibility&2?Sd(C,R,q,Y,_):fp(C,R):(he._visibility|=2,Sd(C,R,q,Y,_)),_&&ee&2048&&MN(R.alternate,R);break;case 24:Sd(C,R,q,Y,_),_&&ee&2048&&DN(R.alternate,R);break;default:Sd(C,R,q,Y,_)}f=f.sibling}}function fp(c,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var m=c,b=f,_=b.flags;switch(b.tag){case 22:fp(m,b),_&2048&&MN(b.alternate,b);break;case 24:fp(m,b),_&2048&&DN(b.alternate,b);break;default:fp(m,b)}f=f.sibling}}var hp=8192;function Cd(c){if(c.subtreeFlags&hp)for(c=c.child;c!==null;)Y4(c),c=c.sibling}function Y4(c){switch(c.tag){case 26:Cd(c),c.flags&hp&&c.memoizedState!==null&&Ene(zs,c.memoizedState,c.memoizedProps);break;case 5:Cd(c);break;case 3:case 4:var f=zs;zs=fb(c.stateNode.containerInfo),Cd(c),zs=f;break;case 22:c.memoizedState===null&&(f=c.alternate,f!==null&&f.memoizedState!==null?(f=hp,hp=16777216,Cd(c),hp=f):Cd(c));break;default:Cd(c)}}function X4(c){var f=c.alternate;if(f!==null&&(c=f.child,c!==null)){f.child=null;do f=c.sibling,c.sibling=null,c=f;while(c!==null)}}function pp(c){var f=c.deletions;if((c.flags&16)!==0){if(f!==null)for(var m=0;m<f.length;m++){var b=f[m];ur=b,Z4(b,c)}X4(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)Q4(c),c=c.sibling}function Q4(c){switch(c.tag){case 0:case 11:case 15:pp(c),c.flags&2048&&il(9,c,c.return);break;case 3:pp(c);break;case 12:pp(c);break;case 22:var f=c.stateNode;c.memoizedState!==null&&f._visibility&2&&(c.return===null||c.return.tag!==13)?(f._visibility&=-3,eb(c)):pp(c);break;default:pp(c)}}function eb(c){var f=c.deletions;if((c.flags&16)!==0){if(f!==null)for(var m=0;m<f.length;m++){var b=f[m];ur=b,Z4(b,c)}X4(c)}for(c=c.child;c!==null;){switch(f=c,f.tag){case 0:case 11:case 15:il(8,f,f.return),eb(f);break;case 22:m=f.stateNode,m._visibility&2&&(m._visibility&=-3,eb(f));break;default:eb(f)}c=c.sibling}}function Z4(c,f){for(;ur!==null;){var m=ur;switch(m.tag){case 0:case 11:case 15:il(8,m,f);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var b=m.memoizedState.cachePool.pool;b!=null&&b.refCount++}break;case 24:Xh(m.memoizedState.cache)}if(b=m.child,b!==null)b.return=m,ur=b;else e:for(m=c;ur!==null;){b=ur;var _=b.sibling,C=b.return;if(q4(b),b===m){ur=null;break e}if(_!==null){_.return=C,ur=_;break e}ur=C}}}var Hte={getCacheForType:function(c){var f=$r(Jn),m=f.data.get(c);return m===void 0&&(m=c(),f.data.set(c,m)),m}},Kte=typeof WeakMap=="function"?WeakMap:Map,_t=0,Vt=null,lt=null,ft=0,kt=0,Da=null,cl=!1,Ed=!1,$N=!1,ro=0,_n=0,ul=0,Tc=0,IN=0,fs=0,Od=0,mp=null,la=null,LN=!1,FN=0,tb=1/0,nb=null,dl=null,Nr=0,fl=null,Ad=null,Td=0,zN=0,BN=null,J4=null,gp=0,UN=null;function $a(){if((_t&2)!==0&&ft!==0)return ft&-ft;if($.T!==null){var c=bd;return c!==0?c:YN()}return m3()}function eM(){fs===0&&(fs=(ft&536870912)===0||bt?d3():536870912);var c=ds.current;return c!==null&&(c.flags|=32),fs}function Ia(c,f,m){(c===Vt&&(kt===2||kt===9)||c.cancelPendingCommit!==null)&&(Pd(c,0),hl(c,ft,fs,!1)),Mh(c,m),((_t&2)===0||c!==Vt)&&(c===Vt&&((_t&2)===0&&(Tc|=m),_n===4&&hl(c,ft,fs,!1)),ui(c))}function tM(c,f,m){if((_t&6)!==0)throw Error(r(327));var b=!m&&(f&124)===0&&(f&c.expiredLanes)===0||Rh(c,f),_=b?Wte(c,f):KN(c,f,!0),C=b;do{if(_===0){Ed&&!b&&hl(c,f,0,!1);break}else{if(m=c.current.alternate,C&&!Vte(m)){_=KN(c,f,!1),C=!1;continue}if(_===2){if(C=f,c.errorRecoveryDisabledLanes&C)var R=0;else R=c.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){f=R;e:{var q=c;_=mp;var Y=q.current.memoizedState.isDehydrated;if(Y&&(Pd(q,R).flags|=256),R=KN(q,R,!1),R!==2){if($N&&!Y){q.errorRecoveryDisabledLanes|=C,Tc|=C,_=4;break e}C=la,la=_,C!==null&&(la===null?la=C:la.push.apply(la,C))}_=R}if(C=!1,_!==2)continue}}if(_===1){Pd(c,0),hl(c,f,0,!0);break}e:{switch(b=c,C=_,C){case 0:case 1:throw Error(r(345));case 4:if((f&4194048)!==f)break;case 6:hl(b,f,fs,!cl);break e;case 2:la=null;break;case 3:case 5:break;default:throw Error(r(329))}if((f&62914560)===f&&(_=FN+300-be(),10<_)){if(hl(b,f,fs,!cl),hx(b,0,!0)!==0)break e;b.timeoutHandle=AM(nM.bind(null,b,m,la,nb,LN,f,fs,Tc,Od,cl,C,2,-0,0),_);break e}nM(b,m,la,nb,LN,f,fs,Tc,Od,cl,C,0,-0,0)}}break}while(!0);ui(c)}function nM(c,f,m,b,_,C,R,q,Y,ee,he,me,re,se){if(c.timeoutHandle=-1,me=f.subtreeFlags,(me&8192||(me&16785408)===16785408)&&(Np={stylesheets:null,count:0,unsuspend:Cne},Y4(f),me=One(),me!==null)){c.cancelPendingCommit=me(cM.bind(null,c,f,C,m,b,_,R,q,Y,he,1,re,se)),hl(c,C,R,!ee);return}cM(c,f,C,m,b,_,R,q,Y)}function Vte(c){for(var f=c;;){var m=f.tag;if((m===0||m===11||m===15)&&f.flags&16384&&(m=f.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var b=0;b<m.length;b++){var _=m[b],C=_.getSnapshot;_=_.value;try{if(!Ta(C(),_))return!1}catch{return!1}}if(m=f.child,f.subtreeFlags&16384&&m!==null)m.return=f,f=m;else{if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function hl(c,f,m,b){f&=~IN,f&=~Tc,c.suspendedLanes|=f,c.pingedLanes&=~f,b&&(c.warmLanes|=f),b=c.expirationTimes;for(var _=f;0<_;){var C=31-jn(_),R=1<<C;b[C]=-1,_&=~R}m!==0&&h3(c,m,f)}function rb(){return(_t&6)===0?(xp(0),!1):!0}function qN(){if(lt!==null){if(kt===0)var c=lt.return;else c=lt,Yi=kc=null,iN(c),_d=null,op=0,c=lt;for(;c!==null;)D4(c.alternate,c),c=c.return;lt=null}}function Pd(c,f){var m=c.timeoutHandle;m!==-1&&(c.timeoutHandle=-1,une(m)),m=c.cancelPendingCommit,m!==null&&(c.cancelPendingCommit=null,m()),qN(),Vt=c,lt=m=Vi(c.current,null),ft=f,kt=0,Da=null,cl=!1,Ed=Rh(c,f),$N=!1,Od=fs=IN=Tc=ul=_n=0,la=mp=null,LN=!1,(f&8)!==0&&(f|=f&32);var b=c.entangledLanes;if(b!==0)for(c=c.entanglements,b&=f;0<b;){var _=31-jn(b),C=1<<_;f|=c[_],b&=~C}return ro=f,kx(),m}function rM(c,f){it=null,$.H=Hx,f===Zh||f===Mx?(f=vR(),kt=3):f===xR?(f=vR(),kt=4):kt=f===w4?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,Da=f,lt===null&&(_n=1,Yx(c,os(f,c.current)))}function aM(){var c=$.H;return $.H=Hx,c===null?Hx:c}function sM(){var c=$.A;return $.A=Hte,c}function HN(){_n=4,cl||(ft&4194048)!==ft&&ds.current!==null||(Ed=!0),(ul&134217727)===0&&(Tc&134217727)===0||Vt===null||hl(Vt,ft,fs,!1)}function KN(c,f,m){var b=_t;_t|=2;var _=aM(),C=sM();(Vt!==c||ft!==f)&&(nb=null,Pd(c,f)),f=!1;var R=_n;e:do try{if(kt!==0&<!==null){var q=lt,Y=Da;switch(kt){case 8:qN(),R=6;break e;case 3:case 2:case 9:case 6:ds.current===null&&(f=!0);var ee=kt;if(kt=0,Da=null,Rd(c,q,Y,ee),m&&Ed){R=0;break e}break;default:ee=kt,kt=0,Da=null,Rd(c,q,Y,ee)}}Gte(),R=_n;break}catch(he){rM(c,he)}while(!0);return f&&c.shellSuspendCounter++,Yi=kc=null,_t=b,$.H=_,$.A=C,lt===null&&(Vt=null,ft=0,kx()),R}function Gte(){for(;lt!==null;)iM(lt)}function Wte(c,f){var m=_t;_t|=2;var b=aM(),_=sM();Vt!==c||ft!==f?(nb=null,tb=be()+500,Pd(c,f)):Ed=Rh(c,f);e:do try{if(kt!==0&<!==null){f=lt;var C=Da;t:switch(kt){case 1:kt=0,Da=null,Rd(c,f,C,1);break;case 2:case 9:if(bR(C)){kt=0,Da=null,oM(f);break}f=function(){kt!==2&&kt!==9||Vt!==c||(kt=7),ui(c)},C.then(f,f);break e;case 3:kt=7;break e;case 4:kt=5;break e;case 7:bR(C)?(kt=0,Da=null,oM(f)):(kt=0,Da=null,Rd(c,f,C,7));break;case 5:var R=null;switch(lt.tag){case 26:R=lt.memoizedState;case 5:case 27:var q=lt;if(!R||UM(R)){kt=0,Da=null;var Y=q.sibling;if(Y!==null)lt=Y;else{var ee=q.return;ee!==null?(lt=ee,ab(ee)):lt=null}break t}}kt=0,Da=null,Rd(c,f,C,5);break;case 6:kt=0,Da=null,Rd(c,f,C,6);break;case 8:qN(),_n=6;break e;default:throw Error(r(462))}}Yte();break}catch(he){rM(c,he)}while(!0);return Yi=kc=null,$.H=b,$.A=_,_t=m,lt!==null?0:(Vt=null,ft=0,kx(),_n)}function Yte(){for(;lt!==null&&!Me();)iM(lt)}function iM(c){var f=R4(c.alternate,c,ro);c.memoizedProps=c.pendingProps,f===null?ab(c):lt=f}function oM(c){var f=c,m=f.alternate;switch(f.tag){case 15:case 0:f=C4(m,f,f.pendingProps,f.type,void 0,ft);break;case 11:f=C4(m,f,f.pendingProps,f.type.render,f.ref,ft);break;case 5:iN(f);default:D4(m,f),f=lt=lR(f,ro),f=R4(m,f,ro)}c.memoizedProps=c.pendingProps,f===null?ab(c):lt=f}function Rd(c,f,m,b){Yi=kc=null,iN(f),_d=null,op=0;var _=f.return;try{if(Lte(c,_,f,m,ft)){_n=1,Yx(c,os(m,c.current)),lt=null;return}}catch(C){if(_!==null)throw lt=_,C;_n=1,Yx(c,os(m,c.current)),lt=null;return}f.flags&32768?(bt||b===1?c=!0:Ed||(ft&536870912)!==0?c=!1:(cl=c=!0,(b===2||b===9||b===3||b===6)&&(b=ds.current,b!==null&&b.tag===13&&(b.flags|=16384))),lM(f,c)):ab(f)}function ab(c){var f=c;do{if((f.flags&32768)!==0){lM(f,cl);return}c=f.return;var m=zte(f.alternate,f,ro);if(m!==null){lt=m;return}if(f=f.sibling,f!==null){lt=f;return}lt=f=c}while(f!==null);_n===0&&(_n=5)}function lM(c,f){do{var m=Bte(c.alternate,c);if(m!==null){m.flags&=32767,lt=m;return}if(m=c.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!f&&(c=c.sibling,c!==null)){lt=c;return}lt=c=m}while(c!==null);_n=6,lt=null}function cM(c,f,m,b,_,C,R,q,Y){c.cancelPendingCommit=null;do sb();while(Nr!==0);if((_t&6)!==0)throw Error(r(327));if(f!==null){if(f===c.current)throw Error(r(177));if(C=f.lanes|f.childLanes,C|=Dj,Cee(c,m,C,R,q,Y),c===Vt&&(lt=Vt=null,ft=0),Ad=f,fl=c,Td=m,zN=C,BN=_,J4=b,(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,Jte(Ot,function(){return pM(),null})):(c.callbackNode=null,c.callbackPriority=0),b=(f.flags&13878)!==0,(f.subtreeFlags&13878)!==0||b){b=$.T,$.T=null,_=K.p,K.p=2,R=_t,_t|=4;try{Ute(c,f,m)}finally{_t=R,K.p=_,$.T=b}}Nr=1,uM(),dM(),fM()}}function uM(){if(Nr===1){Nr=0;var c=fl,f=Ad,m=(f.flags&13878)!==0;if((f.subtreeFlags&13878)!==0||m){m=$.T,$.T=null;var b=K.p;K.p=2;var _=_t;_t|=4;try{V4(f,c);var C=r_,R=Z3(c.containerInfo),q=C.focusedElem,Y=C.selectionRange;if(R!==q&&q&&q.ownerDocument&&Q3(q.ownerDocument.documentElement,q)){if(Y!==null&&Aj(q)){var ee=Y.start,he=Y.end;if(he===void 0&&(he=ee),"selectionStart"in q)q.selectionStart=ee,q.selectionEnd=Math.min(he,q.value.length);else{var me=q.ownerDocument||document,re=me&&me.defaultView||window;if(re.getSelection){var se=re.getSelection(),Qe=q.textContent.length,We=Math.min(Y.start,Qe),Pt=Y.end===void 0?We:Math.min(Y.end,Qe);!se.extend&&We>Pt&&(R=Pt,Pt=We,We=R);var Z=X3(q,We),Q=X3(q,Pt);if(Z&&Q&&(se.rangeCount!==1||se.anchorNode!==Z.node||se.anchorOffset!==Z.offset||se.focusNode!==Q.node||se.focusOffset!==Q.offset)){var J=me.createRange();J.setStart(Z.node,Z.offset),se.removeAllRanges(),We>Pt?(se.addRange(J),se.extend(Q.node,Q.offset)):(J.setEnd(Q.node,Q.offset),se.addRange(J))}}}}for(me=[],se=q;se=se.parentNode;)se.nodeType===1&&me.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<me.length;q++){var pe=me[q];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}xb=!!n_,r_=n_=null}finally{_t=_,K.p=b,$.T=m}}c.current=f,Nr=2}}function dM(){if(Nr===2){Nr=0;var c=fl,f=Ad,m=(f.flags&8772)!==0;if((f.subtreeFlags&8772)!==0||m){m=$.T,$.T=null;var b=K.p;K.p=2;var _=_t;_t|=4;try{U4(c,f.alternate,f)}finally{_t=_,K.p=b,$.T=m}}Nr=3}}function fM(){if(Nr===4||Nr===3){Nr=0,qe();var c=fl,f=Ad,m=Td,b=J4;(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?Nr=5:(Nr=0,Ad=fl=null,hM(c,c.pendingLanes));var _=c.pendingLanes;if(_===0&&(dl=null),cj(m),f=f.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(Kt,f,void 0,(f.current.flags&128)===128)}catch{}if(b!==null){f=$.T,_=K.p,K.p=2,$.T=null;try{for(var C=c.onRecoverableError,R=0;R<b.length;R++){var q=b[R];C(q.value,{componentStack:q.stack})}}finally{$.T=f,K.p=_}}(Td&3)!==0&&sb(),ui(c),_=c.pendingLanes,(m&4194090)!==0&&(_&42)!==0?c===UN?gp++:(gp=0,UN=c):gp=0,xp(0)}}function hM(c,f){(c.pooledCacheLanes&=f)===0&&(f=c.pooledCache,f!=null&&(c.pooledCache=null,Xh(f)))}function sb(c){return uM(),dM(),fM(),pM()}function pM(){if(Nr!==5)return!1;var c=fl,f=zN;zN=0;var m=cj(Td),b=$.T,_=K.p;try{K.p=32>m?32:m,$.T=null,m=BN,BN=null;var C=fl,R=Td;if(Nr=0,Ad=fl=null,Td=0,(_t&6)!==0)throw Error(r(331));var q=_t;if(_t|=4,Q4(C.current),W4(C,C.current,R,m),_t=q,xp(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(Kt,C)}catch{}return!0}finally{K.p=_,$.T=b,hM(c,f)}}function mM(c,f,m){f=os(m,f),f=vN(c.stateNode,f,2),c=nl(c,f,2),c!==null&&(Mh(c,2),ui(c))}function It(c,f,m){if(c.tag===3)mM(c,c,m);else for(;f!==null;){if(f.tag===3){mM(f,c,m);break}else if(f.tag===1){var b=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(dl===null||!dl.has(b))){c=os(m,c),m=y4(2),b=nl(f,m,2),b!==null&&(v4(m,b,f,c),Mh(b,2),ui(b));break}}f=f.return}}function VN(c,f,m){var b=c.pingCache;if(b===null){b=c.pingCache=new Kte;var _=new Set;b.set(f,_)}else _=b.get(f),_===void 0&&(_=new Set,b.set(f,_));_.has(m)||($N=!0,_.add(m),c=Xte.bind(null,c,f,m),f.then(c,c))}function Xte(c,f,m){var b=c.pingCache;b!==null&&b.delete(f),c.pingedLanes|=c.suspendedLanes&m,c.warmLanes&=~m,Vt===c&&(ft&m)===m&&(_n===4||_n===3&&(ft&62914560)===ft&&300>be()-FN?(_t&2)===0&&Pd(c,0):IN|=m,Od===ft&&(Od=0)),ui(c)}function gM(c,f){f===0&&(f=f3()),c=pd(c,f),c!==null&&(Mh(c,f),ui(c))}function Qte(c){var f=c.memoizedState,m=0;f!==null&&(m=f.retryLane),gM(c,m)}function Zte(c,f){var m=0;switch(c.tag){case 13:var b=c.stateNode,_=c.memoizedState;_!==null&&(m=_.retryLane);break;case 19:b=c.stateNode;break;case 22:b=c.stateNode._retryCache;break;default:throw Error(r(314))}b!==null&&b.delete(f),gM(c,m)}function Jte(c,f){return _e(c,f)}var ib=null,Md=null,GN=!1,ob=!1,WN=!1,Pc=0;function ui(c){c!==Md&&c.next===null&&(Md===null?ib=Md=c:Md=Md.next=c),ob=!0,GN||(GN=!0,tne())}function xp(c,f){if(!WN&&ob){WN=!0;do for(var m=!1,b=ib;b!==null;){if(c!==0){var _=b.pendingLanes;if(_===0)var C=0;else{var R=b.suspendedLanes,q=b.pingedLanes;C=(1<<31-jn(42|c)+1)-1,C&=_&~(R&~q),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(m=!0,vM(b,C))}else C=ft,C=hx(b,b===Vt?C:0,b.cancelPendingCommit!==null||b.timeoutHandle!==-1),(C&3)===0||Rh(b,C)||(m=!0,vM(b,C));b=b.next}while(m);WN=!1}}function ene(){xM()}function xM(){ob=GN=!1;var c=0;Pc!==0&&(cne()&&(c=Pc),Pc=0);for(var f=be(),m=null,b=ib;b!==null;){var _=b.next,C=bM(b,f);C===0?(b.next=null,m===null?ib=_:m.next=_,_===null&&(Md=m)):(m=b,(c!==0||(C&3)!==0)&&(ob=!0)),b=_}xp(c)}function bM(c,f){for(var m=c.suspendedLanes,b=c.pingedLanes,_=c.expirationTimes,C=c.pendingLanes&-62914561;0<C;){var R=31-jn(C),q=1<<R,Y=_[R];Y===-1?((q&m)===0||(q&b)!==0)&&(_[R]=See(q,f)):Y<=f&&(c.expiredLanes|=q),C&=~q}if(f=Vt,m=ft,m=hx(c,c===f?m:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),b=c.callbackNode,m===0||c===f&&(kt===2||kt===9)||c.cancelPendingCommit!==null)return b!==null&&b!==null&&ye(b),c.callbackNode=null,c.callbackPriority=0;if((m&3)===0||Rh(c,m)){if(f=m&-m,f===c.callbackPriority)return f;switch(b!==null&&ye(b),cj(m)){case 2:case 8:m=en;break;case 32:m=Ot;break;case 268435456:m=gn;break;default:m=Ot}return b=yM.bind(null,c),m=_e(m,b),c.callbackPriority=f,c.callbackNode=m,f}return b!==null&&b!==null&&ye(b),c.callbackPriority=2,c.callbackNode=null,2}function yM(c,f){if(Nr!==0&&Nr!==5)return c.callbackNode=null,c.callbackPriority=0,null;var m=c.callbackNode;if(sb()&&c.callbackNode!==m)return null;var b=ft;return b=hx(c,c===Vt?b:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),b===0?null:(tM(c,b,f),bM(c,be()),c.callbackNode!=null&&c.callbackNode===m?yM.bind(null,c):null)}function vM(c,f){if(sb())return null;tM(c,f,!0)}function tne(){dne(function(){(_t&6)!==0?_e($t,ene):xM()})}function YN(){return Pc===0&&(Pc=d3()),Pc}function wM(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:bx(""+c)}function jM(c,f){var m=f.ownerDocument.createElement("input");return m.name=f.name,m.value=f.value,c.id&&m.setAttribute("form",c.id),f.parentNode.insertBefore(m,f),c=new FormData(c),m.parentNode.removeChild(m),c}function nne(c,f,m,b,_){if(f==="submit"&&m&&m.stateNode===_){var C=wM((_[aa]||null).action),R=b.submitter;R&&(f=(f=R[aa]||null)?wM(f.formAction):R.getAttribute("formAction"),f!==null&&(C=f,R=null));var q=new jx("action","action",null,b,_);c.push({event:q,listeners:[{instance:null,listener:function(){if(b.defaultPrevented){if(Pc!==0){var Y=R?jM(_,R):new FormData(_);mN(m,{pending:!0,data:Y,method:_.method,action:C},null,Y)}}else typeof C=="function"&&(q.preventDefault(),Y=R?jM(_,R):new FormData(_),mN(m,{pending:!0,data:Y,method:_.method,action:C},C,Y))},currentTarget:_}]})}}for(var XN=0;XN<Mj.length;XN++){var QN=Mj[XN],rne=QN.toLowerCase(),ane=QN[0].toUpperCase()+QN.slice(1);Fs(rne,"on"+ane)}Fs(tR,"onAnimationEnd"),Fs(nR,"onAnimationIteration"),Fs(rR,"onAnimationStart"),Fs("dblclick","onDoubleClick"),Fs("focusin","onFocus"),Fs("focusout","onBlur"),Fs(wte,"onTransitionRun"),Fs(jte,"onTransitionStart"),Fs(Nte,"onTransitionCancel"),Fs(aR,"onTransitionEnd"),ad("onMouseEnter",["mouseout","mouseover"]),ad("onMouseLeave",["mouseout","mouseover"]),ad("onPointerEnter",["pointerout","pointerover"]),ad("onPointerLeave",["pointerout","pointerover"]),gc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gc("onBeforeInput",["compositionend","keypress","textInput","paste"]),gc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bp="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sne=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bp));function NM(c,f){f=(f&4)!==0;for(var m=0;m<c.length;m++){var b=c[m],_=b.event;b=b.listeners;e:{var C=void 0;if(f)for(var R=b.length-1;0<=R;R--){var q=b[R],Y=q.instance,ee=q.currentTarget;if(q=q.listener,Y!==C&&_.isPropagationStopped())break e;C=q,_.currentTarget=ee;try{C(_)}catch(he){Wx(he)}_.currentTarget=null,C=Y}else for(R=0;R<b.length;R++){if(q=b[R],Y=q.instance,ee=q.currentTarget,q=q.listener,Y!==C&&_.isPropagationStopped())break e;C=q,_.currentTarget=ee;try{C(_)}catch(he){Wx(he)}_.currentTarget=null,C=Y}}}}function ct(c,f){var m=f[uj];m===void 0&&(m=f[uj]=new Set);var b=c+"__bubble";m.has(b)||(_M(f,c,2,!1),m.add(b))}function ZN(c,f,m){var b=0;f&&(b|=4),_M(m,c,b,f)}var lb="_reactListening"+Math.random().toString(36).slice(2);function JN(c){if(!c[lb]){c[lb]=!0,x3.forEach(function(m){m!=="selectionchange"&&(sne.has(m)||ZN(m,!1,c),ZN(m,!0,c))});var f=c.nodeType===9?c:c.ownerDocument;f===null||f[lb]||(f[lb]=!0,ZN("selectionchange",!1,f))}}function _M(c,f,m,b){switch(WM(f)){case 2:var _=Pne;break;case 8:_=Rne;break;default:_=h_}m=_.bind(null,f,m,c),_=void 0,!wj||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(_=!0),b?_!==void 0?c.addEventListener(f,m,{capture:!0,passive:_}):c.addEventListener(f,m,!0):_!==void 0?c.addEventListener(f,m,{passive:_}):c.addEventListener(f,m,!1)}function e_(c,f,m,b,_){var C=b;if((f&1)===0&&(f&2)===0&&b!==null)e:for(;;){if(b===null)return;var R=b.tag;if(R===3||R===4){var q=b.stateNode.containerInfo;if(q===_)break;if(R===4)for(R=b.return;R!==null;){var Y=R.tag;if((Y===3||Y===4)&&R.stateNode.containerInfo===_)return;R=R.return}for(;q!==null;){if(R=td(q),R===null)return;if(Y=R.tag,Y===5||Y===6||Y===26||Y===27){b=C=R;continue e}q=q.parentNode}}b=b.return}T3(function(){var ee=C,he=yj(m),me=[];e:{var re=sR.get(c);if(re!==void 0){var se=jx,Qe=c;switch(c){case"keypress":if(vx(m)===0)break e;case"keydown":case"keyup":se=Jee;break;case"focusin":Qe="focus",se=kj;break;case"focusout":Qe="blur",se=kj;break;case"beforeblur":case"afterblur":se=kj;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=M3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=Bee;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=nte;break;case tR:case nR:case rR:se=Hee;break;case aR:se=ate;break;case"scroll":case"scrollend":se=Fee;break;case"wheel":se=ite;break;case"copy":case"cut":case"paste":se=Vee;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=$3;break;case"toggle":case"beforetoggle":se=lte}var We=(f&4)!==0,Pt=!We&&(c==="scroll"||c==="scrollend"),Z=We?re!==null?re+"Capture":null:re;We=[];for(var Q=ee,J;Q!==null;){var pe=Q;if(J=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||J===null||Z===null||(pe=Ih(Q,Z),pe!=null&&We.push(yp(Q,pe,J))),Pt)break;Q=Q.return}0<We.length&&(re=new se(re,Qe,null,m,he),me.push({event:re,listeners:We}))}}if((f&7)===0){e:{if(re=c==="mouseover"||c==="pointerover",se=c==="mouseout"||c==="pointerout",re&&m!==bj&&(Qe=m.relatedTarget||m.fromElement)&&(td(Qe)||Qe[ed]))break e;if((se||re)&&(re=he.window===he?he:(re=he.ownerDocument)?re.defaultView||re.parentWindow:window,se?(Qe=m.relatedTarget||m.toElement,se=ee,Qe=Qe?td(Qe):null,Qe!==null&&(Pt=s(Qe),We=Qe.tag,Qe!==Pt||We!==5&&We!==27&&We!==6)&&(Qe=null)):(se=null,Qe=ee),se!==Qe)){if(We=M3,pe="onMouseLeave",Z="onMouseEnter",Q="mouse",(c==="pointerout"||c==="pointerover")&&(We=$3,pe="onPointerLeave",Z="onPointerEnter",Q="pointer"),Pt=se==null?re:$h(se),J=Qe==null?re:$h(Qe),re=new We(pe,Q+"leave",se,m,he),re.target=Pt,re.relatedTarget=J,pe=null,td(he)===ee&&(We=new We(Z,Q+"enter",Qe,m,he),We.target=J,We.relatedTarget=Pt,pe=We),Pt=pe,se&&Qe)t:{for(We=se,Z=Qe,Q=0,J=We;J;J=Dd(J))Q++;for(J=0,pe=Z;pe;pe=Dd(pe))J++;for(;0<Q-J;)We=Dd(We),Q--;for(;0<J-Q;)Z=Dd(Z),J--;for(;Q--;){if(We===Z||Z!==null&&We===Z.alternate)break t;We=Dd(We),Z=Dd(Z)}We=null}else We=null;se!==null&&kM(me,re,se,We,!1),Qe!==null&&Pt!==null&&kM(me,Pt,Qe,We,!0)}}e:{if(re=ee?$h(ee):window,se=re.nodeName&&re.nodeName.toLowerCase(),se==="select"||se==="input"&&re.type==="file")var Fe=H3;else if(U3(re))if(K3)Fe=bte;else{Fe=gte;var ot=mte}else se=re.nodeName,!se||se.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ee&&xj(ee.elementType)&&(Fe=H3):Fe=xte;if(Fe&&(Fe=Fe(c,ee))){q3(me,Fe,m,he);break e}ot&&ot(c,re,ee),c==="focusout"&&ee&&re.type==="number"&&ee.memoizedProps.value!=null&&gj(re,"number",re.value)}switch(ot=ee?$h(ee):window,c){case"focusin":(U3(ot)||ot.contentEditable==="true")&&(dd=ot,Tj=ee,Kh=null);break;case"focusout":Kh=Tj=dd=null;break;case"mousedown":Pj=!0;break;case"contextmenu":case"mouseup":case"dragend":Pj=!1,J3(me,m,he);break;case"selectionchange":if(vte)break;case"keydown":case"keyup":J3(me,m,he)}var He;if(Cj)e:{switch(c){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else ud?z3(c,m)&&(Ye="onCompositionEnd"):c==="keydown"&&m.keyCode===229&&(Ye="onCompositionStart");Ye&&(I3&&m.locale!=="ko"&&(ud||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&ud&&(He=P3()):(Zo=he,jj="value"in Zo?Zo.value:Zo.textContent,ud=!0)),ot=cb(ee,Ye),0<ot.length&&(Ye=new D3(Ye,c,null,m,he),me.push({event:Ye,listeners:ot}),He?Ye.data=He:(He=B3(m),He!==null&&(Ye.data=He)))),(He=ute?dte(c,m):fte(c,m))&&(Ye=cb(ee,"onBeforeInput"),0<Ye.length&&(ot=new D3("onBeforeInput","beforeinput",null,m,he),me.push({event:ot,listeners:Ye}),ot.data=He)),nne(me,c,ee,m,he)}NM(me,f)})}function yp(c,f,m){return{instance:c,listener:f,currentTarget:m}}function cb(c,f){for(var m=f+"Capture",b=[];c!==null;){var _=c,C=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||C===null||(_=Ih(c,m),_!=null&&b.unshift(yp(c,_,C)),_=Ih(c,f),_!=null&&b.push(yp(c,_,C))),c.tag===3)return b;c=c.return}return[]}function Dd(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function kM(c,f,m,b,_){for(var C=f._reactName,R=[];m!==null&&m!==b;){var q=m,Y=q.alternate,ee=q.stateNode;if(q=q.tag,Y!==null&&Y===b)break;q!==5&&q!==26&&q!==27||ee===null||(Y=ee,_?(ee=Ih(m,C),ee!=null&&R.unshift(yp(m,ee,Y))):_||(ee=Ih(m,C),ee!=null&&R.push(yp(m,ee,Y)))),m=m.return}R.length!==0&&c.push({event:f,listeners:R})}var ine=/\r\n?/g,one=/\u0000|\uFFFD/g;function SM(c){return(typeof c=="string"?c:""+c).replace(ine,` 50`).replace(one,"")}function CM(c,f){return f=SM(f),SM(c)===f}function ub(){}function Tt(c,f,m,b,_,C){switch(m){case"children":typeof b=="string"?f==="body"||f==="textarea"&&b===""||od(c,b):(typeof b=="number"||typeof b=="bigint")&&f!=="body"&&od(c,""+b);break;case"className":mx(c,"class",b);break;case"tabIndex":mx(c,"tabindex",b);break;case"dir":case"role":case"viewBox":case"width":case"height":mx(c,m,b);break;case"style":O3(c,b,C);break;case"data":if(f!=="object"){mx(c,"data",b);break}case"src":case"href":if(b===""&&(f!=="a"||m!=="href")){c.removeAttribute(m);break}if(b==null||typeof b=="function"||typeof b=="symbol"||typeof b=="boolean"){c.removeAttribute(m);break}b=bx(""+b),c.setAttribute(m,b);break;case"action":case"formAction":if(typeof b=="function"){c.setAttribute(m,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof C=="function"&&(m==="formAction"?(f!=="input"&&Tt(c,f,"name",_.name,_,null),Tt(c,f,"formEncType",_.formEncType,_,null),Tt(c,f,"formMethod",_.formMethod,_,null),Tt(c,f,"formTarget",_.formTarget,_,null)):(Tt(c,f,"encType",_.encType,_,null),Tt(c,f,"method",_.method,_,null),Tt(c,f,"target",_.target,_,null)));if(b==null||typeof b=="symbol"||typeof b=="boolean"){c.removeAttribute(m);break}b=bx(""+b),c.setAttribute(m,b);break;case"onClick":b!=null&&(c.onclick=ub);break;case"onScroll":b!=null&&ct("scroll",c);break;case"onScrollEnd":b!=null&&ct("scrollend",c);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(r(61));if(m=b.__html,m!=null){if(_.children!=null)throw Error(r(60));c.innerHTML=m}}break;case"multiple":c.multiple=b&&typeof b!="function"&&typeof b!="symbol";break;case"muted":c.muted=b&&typeof b!="function"&&typeof b!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(b==null||typeof b=="function"||typeof b=="boolean"||typeof b=="symbol"){c.removeAttribute("xlink:href");break}m=bx(""+b),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":b!=null&&typeof b!="function"&&typeof b!="symbol"?c.setAttribute(m,""+b):c.removeAttribute(m);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":b&&typeof b!="function"&&typeof b!="symbol"?c.setAttribute(m,""):c.removeAttribute(m);break;case"capture":case"download":b===!0?c.setAttribute(m,""):b!==!1&&b!=null&&typeof b!="function"&&typeof b!="symbol"?c.setAttribute(m,b):c.removeAttribute(m);break;case"cols":case"rows":case"size":case"span":b!=null&&typeof b!="function"&&typeof b!="symbol"&&!isNaN(b)&&1<=b?c.setAttribute(m,b):c.removeAttribute(m);break;case"rowSpan":case"start":b==null||typeof b=="function"||typeof b=="symbol"||isNaN(b)?c.removeAttribute(m):c.setAttribute(m,b);break;case"popover":ct("beforetoggle",c),ct("toggle",c),px(c,"popover",b);break;case"xlinkActuate":Hi(c,"http://www.w3.org/1999/xlink","xlink:actuate",b);break;case"xlinkArcrole":Hi(c,"http://www.w3.org/1999/xlink","xlink:arcrole",b);break;case"xlinkRole":Hi(c,"http://www.w3.org/1999/xlink","xlink:role",b);break;case"xlinkShow":Hi(c,"http://www.w3.org/1999/xlink","xlink:show",b);break;case"xlinkTitle":Hi(c,"http://www.w3.org/1999/xlink","xlink:title",b);break;case"xlinkType":Hi(c,"http://www.w3.org/1999/xlink","xlink:type",b);break;case"xmlBase":Hi(c,"http://www.w3.org/XML/1998/namespace","xml:base",b);break;case"xmlLang":Hi(c,"http://www.w3.org/XML/1998/namespace","xml:lang",b);break;case"xmlSpace":Hi(c,"http://www.w3.org/XML/1998/namespace","xml:space",b);break;case"is":px(c,"is",b);break;case"innerText":case"textContent":break;default:(!(2<m.length)||m[0]!=="o"&&m[0]!=="O"||m[1]!=="n"&&m[1]!=="N")&&(m=Iee.get(m)||m,px(c,m,b))}}function t_(c,f,m,b,_,C){switch(m){case"style":O3(c,b,C);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(r(61));if(m=b.__html,m!=null){if(_.children!=null)throw Error(r(60));c.innerHTML=m}}break;case"children":typeof b=="string"?od(c,b):(typeof b=="number"||typeof b=="bigint")&&od(c,""+b);break;case"onScroll":b!=null&&ct("scroll",c);break;case"onScrollEnd":b!=null&&ct("scrollend",c);break;case"onClick":b!=null&&(c.onclick=ub);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!b3.hasOwnProperty(m))e:{if(m[0]==="o"&&m[1]==="n"&&(_=m.endsWith("Capture"),f=m.slice(2,_?m.length-7:void 0),C=c[aa]||null,C=C!=null?C[m]:null,typeof C=="function"&&c.removeEventListener(f,C,_),typeof b=="function")){typeof C!="function"&&C!==null&&(m in c?c[m]=null:c.hasAttribute(m)&&c.removeAttribute(m)),c.addEventListener(f,b,_);break e}m in c?c[m]=b:b===!0?c.setAttribute(m,""):px(c,m,b)}}}function _r(c,f,m){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ct("error",c),ct("load",c);var b=!1,_=!1,C;for(C in m)if(m.hasOwnProperty(C)){var R=m[C];if(R!=null)switch(C){case"src":b=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,f));default:Tt(c,f,C,R,m,null)}}_&&Tt(c,f,"srcSet",m.srcSet,m,null),b&&Tt(c,f,"src",m.src,m,null);return;case"input":ct("invalid",c);var q=C=R=_=null,Y=null,ee=null;for(b in m)if(m.hasOwnProperty(b)){var he=m[b];if(he!=null)switch(b){case"name":_=he;break;case"type":R=he;break;case"checked":Y=he;break;case"defaultChecked":ee=he;break;case"value":C=he;break;case"defaultValue":q=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,f));break;default:Tt(c,f,b,he,m,null)}}k3(c,C,q,Y,ee,R,_,!1),gx(c);return;case"select":ct("invalid",c),b=R=C=null;for(_ in m)if(m.hasOwnProperty(_)&&(q=m[_],q!=null))switch(_){case"value":C=q;break;case"defaultValue":R=q;break;case"multiple":b=q;default:Tt(c,f,_,q,m,null)}f=C,m=R,c.multiple=!!b,f!=null?id(c,!!b,f,!1):m!=null&&id(c,!!b,m,!0);return;case"textarea":ct("invalid",c),C=_=b=null;for(R in m)if(m.hasOwnProperty(R)&&(q=m[R],q!=null))switch(R){case"value":b=q;break;case"defaultValue":_=q;break;case"children":C=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(91));break;default:Tt(c,f,R,q,m,null)}C3(c,b,_,C),gx(c);return;case"option":for(Y in m)if(m.hasOwnProperty(Y)&&(b=m[Y],b!=null))switch(Y){case"selected":c.selected=b&&typeof b!="function"&&typeof b!="symbol";break;default:Tt(c,f,Y,b,m,null)}return;case"dialog":ct("beforetoggle",c),ct("toggle",c),ct("cancel",c),ct("close",c);break;case"iframe":case"object":ct("load",c);break;case"video":case"audio":for(b=0;b<bp.length;b++)ct(bp[b],c);break;case"image":ct("error",c),ct("load",c);break;case"details":ct("toggle",c);break;case"embed":case"source":case"link":ct("error",c),ct("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in m)if(m.hasOwnProperty(ee)&&(b=m[ee],b!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,f));default:Tt(c,f,ee,b,m,null)}return;default:if(xj(f)){for(he in m)m.hasOwnProperty(he)&&(b=m[he],b!==void 0&&t_(c,f,he,b,m,void 0));return}}for(q in m)m.hasOwnProperty(q)&&(b=m[q],b!=null&&Tt(c,f,q,b,m,null))}function lne(c,f,m,b){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,C=null,R=null,q=null,Y=null,ee=null,he=null;for(se in m){var me=m[se];if(m.hasOwnProperty(se)&&me!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":Y=me;default:b.hasOwnProperty(se)||Tt(c,f,se,null,b,me)}}for(var re in b){var se=b[re];if(me=m[re],b.hasOwnProperty(re)&&(se!=null||me!=null))switch(re){case"type":C=se;break;case"name":_=se;break;case"checked":ee=se;break;case"defaultChecked":he=se;break;case"value":R=se;break;case"defaultValue":q=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,f));break;default:se!==me&&Tt(c,f,re,se,b,me)}}mj(c,R,q,Y,ee,he,C,_);return;case"select":se=R=q=re=null;for(C in m)if(Y=m[C],m.hasOwnProperty(C)&&Y!=null)switch(C){case"value":break;case"multiple":se=Y;default:b.hasOwnProperty(C)||Tt(c,f,C,null,b,Y)}for(_ in b)if(C=b[_],Y=m[_],b.hasOwnProperty(_)&&(C!=null||Y!=null))switch(_){case"value":re=C;break;case"defaultValue":q=C;break;case"multiple":R=C;default:C!==Y&&Tt(c,f,_,C,b,Y)}f=q,m=R,b=se,re!=null?id(c,!!m,re,!1):!!b!=!!m&&(f!=null?id(c,!!m,f,!0):id(c,!!m,m?[]:"",!1));return;case"textarea":se=re=null;for(q in m)if(_=m[q],m.hasOwnProperty(q)&&_!=null&&!b.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:Tt(c,f,q,null,b,_)}for(R in b)if(_=b[R],C=m[R],b.hasOwnProperty(R)&&(_!=null||C!=null))switch(R){case"value":re=_;break;case"defaultValue":se=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==C&&Tt(c,f,R,_,b,C)}S3(c,re,se);return;case"option":for(var Qe in m)if(re=m[Qe],m.hasOwnProperty(Qe)&&re!=null&&!b.hasOwnProperty(Qe))switch(Qe){case"selected":c.selected=!1;break;default:Tt(c,f,Qe,null,b,re)}for(Y in b)if(re=b[Y],se=m[Y],b.hasOwnProperty(Y)&&re!==se&&(re!=null||se!=null))switch(Y){case"selected":c.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Tt(c,f,Y,re,b,se)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in m)re=m[We],m.hasOwnProperty(We)&&re!=null&&!b.hasOwnProperty(We)&&Tt(c,f,We,null,b,re);for(ee in b)if(re=b[ee],se=m[ee],b.hasOwnProperty(ee)&&re!==se&&(re!=null||se!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,f));break;default:Tt(c,f,ee,re,b,se)}return;default:if(xj(f)){for(var Pt in m)re=m[Pt],m.hasOwnProperty(Pt)&&re!==void 0&&!b.hasOwnProperty(Pt)&&t_(c,f,Pt,void 0,b,re);for(he in b)re=b[he],se=m[he],!b.hasOwnProperty(he)||re===se||re===void 0&&se===void 0||t_(c,f,he,re,b,se);return}}for(var Z in m)re=m[Z],m.hasOwnProperty(Z)&&re!=null&&!b.hasOwnProperty(Z)&&Tt(c,f,Z,null,b,re);for(me in b)re=b[me],se=m[me],!b.hasOwnProperty(me)||re===se||re==null&&se==null||Tt(c,f,me,re,b,se)}var n_=null,r_=null;function db(c){return c.nodeType===9?c:c.ownerDocument}function EM(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function OM(c,f){if(c===0)switch(f){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&f==="foreignObject"?0:c}function a_(c,f){return c==="textarea"||c==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.children=="bigint"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var s_=null;function cne(){var c=window.event;return c&&c.type==="popstate"?c===s_?!1:(s_=c,!0):(s_=null,!1)}var AM=typeof setTimeout=="function"?setTimeout:void 0,une=typeof clearTimeout=="function"?clearTimeout:void 0,TM=typeof Promise=="function"?Promise:void 0,dne=typeof queueMicrotask=="function"?queueMicrotask:typeof TM<"u"?function(c){return TM.resolve(null).then(c).catch(fne)}:AM;function fne(c){setTimeout(function(){throw c})}function pl(c){return c==="head"}function PM(c,f){var m=f,b=0,_=0;do{var C=m.nextSibling;if(c.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(0<b&&8>b){m=b;var R=c.ownerDocument;if(m&1&&vp(R.documentElement),m&2&&vp(R.body),m&4)for(m=R.head,vp(m),R=m.firstChild;R;){var q=R.nextSibling,Y=R.nodeName;R[Dh]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&R.rel.toLowerCase()==="stylesheet"||m.removeChild(R),R=q}}if(_===0){c.removeChild(C),Ep(f);return}_--}else m==="$"||m==="$?"||m==="$!"?_++:b=m.charCodeAt(0)-48;else b=0;m=C}while(m);Ep(f)}function i_(c){var f=c.firstChild;for(f&&f.nodeType===10&&(f=f.nextSibling);f;){var m=f;switch(f=f.nextSibling,m.nodeName){case"HTML":case"HEAD":case"BODY":i_(m),dj(m);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(m.rel.toLowerCase()==="stylesheet")continue}c.removeChild(m)}}function hne(c,f,m,b){for(;c.nodeType===1;){var _=m;if(c.nodeName.toLowerCase()!==f.toLowerCase()){if(!b&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(b){if(!c[Dh])switch(f){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(C=c.getAttribute("rel"),C==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(C!==_.rel||c.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||c.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||c.getAttribute("title")!==(_.title==null?null:_.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(C=c.getAttribute("src"),(C!==(_.src==null?null:_.src)||c.getAttribute("type")!==(_.type==null?null:_.type)||c.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&C&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(f==="input"&&c.type==="hidden"){var C=_.name==null?null:""+_.name;if(_.type==="hidden"&&c.getAttribute("name")===C)return c}else return c;if(c=Bs(c.nextSibling),c===null)break}return null}function pne(c,f,m){if(f==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!m||(c=Bs(c.nextSibling),c===null))return null;return c}function o_(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState==="complete"}function mne(c,f){var m=c.ownerDocument;if(c.data!=="$?"||m.readyState==="complete")f();else{var b=function(){f(),m.removeEventListener("DOMContentLoaded",b)};m.addEventListener("DOMContentLoaded",b),c._reactRetry=b}}function Bs(c){for(;c!=null;c=c.nextSibling){var f=c.nodeType;if(f===1||f===3)break;if(f===8){if(f=c.data,f==="$"||f==="$!"||f==="$?"||f==="F!"||f==="F")break;if(f==="/$")return null}}return c}var l_=null;function RM(c){c=c.previousSibling;for(var f=0;c;){if(c.nodeType===8){var m=c.data;if(m==="$"||m==="$!"||m==="$?"){if(f===0)return c;f--}else m==="/$"&&f++}c=c.previousSibling}return null}function MM(c,f,m){switch(f=db(m),c){case"html":if(c=f.documentElement,!c)throw Error(r(452));return c;case"head":if(c=f.head,!c)throw Error(r(453));return c;case"body":if(c=f.body,!c)throw Error(r(454));return c;default:throw Error(r(451))}}function vp(c){for(var f=c.attributes;f.length;)c.removeAttributeNode(f[0]);dj(c)}var hs=new Map,DM=new Set;function fb(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var ao=K.d;K.d={f:gne,r:xne,D:bne,C:yne,L:vne,m:wne,X:Nne,S:jne,M:_ne};function gne(){var c=ao.f(),f=rb();return c||f}function xne(c){var f=nd(c);f!==null&&f.tag===5&&f.type==="form"?t4(f):ao.r(c)}var $d=typeof document>"u"?null:document;function $M(c,f,m){var b=$d;if(b&&typeof f=="string"&&f){var _=is(f);_='link[rel="'+c+'"][href="'+_+'"]',typeof m=="string"&&(_+='[crossorigin="'+m+'"]'),DM.has(_)||(DM.add(_),c={rel:c,crossOrigin:m,href:f},b.querySelector(_)===null&&(f=b.createElement("link"),_r(f,"link",c),lr(f),b.head.appendChild(f)))}}function bne(c){ao.D(c),$M("dns-prefetch",c,null)}function yne(c,f){ao.C(c,f),$M("preconnect",c,f)}function vne(c,f,m){ao.L(c,f,m);var b=$d;if(b&&c&&f){var _='link[rel="preload"][as="'+is(f)+'"]';f==="image"&&m&&m.imageSrcSet?(_+='[imagesrcset="'+is(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(_+='[imagesizes="'+is(m.imageSizes)+'"]')):_+='[href="'+is(c)+'"]';var C=_;switch(f){case"style":C=Id(c);break;case"script":C=Ld(c)}hs.has(C)||(c=h({rel:"preload",href:f==="image"&&m&&m.imageSrcSet?void 0:c,as:f},m),hs.set(C,c),b.querySelector(_)!==null||f==="style"&&b.querySelector(wp(C))||f==="script"&&b.querySelector(jp(C))||(f=b.createElement("link"),_r(f,"link",c),lr(f),b.head.appendChild(f)))}}function wne(c,f){ao.m(c,f);var m=$d;if(m&&c){var b=f&&typeof f.as=="string"?f.as:"script",_='link[rel="modulepreload"][as="'+is(b)+'"][href="'+is(c)+'"]',C=_;switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=Ld(c)}if(!hs.has(C)&&(c=h({rel:"modulepreload",href:c},f),hs.set(C,c),m.querySelector(_)===null)){switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(jp(C)))return}b=m.createElement("link"),_r(b,"link",c),lr(b),m.head.appendChild(b)}}}function jne(c,f,m){ao.S(c,f,m);var b=$d;if(b&&c){var _=rd(b).hoistableStyles,C=Id(c);f=f||"default";var R=_.get(C);if(!R){var q={loading:0,preload:null};if(R=b.querySelector(wp(C)))q.loading=5;else{c=h({rel:"stylesheet",href:c,"data-precedence":f},m),(m=hs.get(C))&&c_(c,m);var Y=R=b.createElement("link");lr(Y),_r(Y,"link",c),Y._p=new Promise(function(ee,he){Y.onload=ee,Y.onerror=he}),Y.addEventListener("load",function(){q.loading|=1}),Y.addEventListener("error",function(){q.loading|=2}),q.loading|=4,hb(R,f,b)}R={type:"stylesheet",instance:R,count:1,state:q},_.set(C,R)}}}function Nne(c,f){ao.X(c,f);var m=$d;if(m&&c){var b=rd(m).hoistableScripts,_=Ld(c),C=b.get(_);C||(C=m.querySelector(jp(_)),C||(c=h({src:c,async:!0},f),(f=hs.get(_))&&u_(c,f),C=m.createElement("script"),lr(C),_r(C,"link",c),m.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},b.set(_,C))}}function _ne(c,f){ao.M(c,f);var m=$d;if(m&&c){var b=rd(m).hoistableScripts,_=Ld(c),C=b.get(_);C||(C=m.querySelector(jp(_)),C||(c=h({src:c,async:!0,type:"module"},f),(f=hs.get(_))&&u_(c,f),C=m.createElement("script"),lr(C),_r(C,"link",c),m.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},b.set(_,C))}}function IM(c,f,m,b){var _=(_=ae.current)?fb(_):null;if(!_)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(f=Id(m.href),m=rd(_).hoistableStyles,b=m.get(f),b||(b={type:"style",instance:null,count:0,state:null},m.set(f,b)),b):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){c=Id(m.href);var C=rd(_).hoistableStyles,R=C.get(c);if(R||(_=_.ownerDocument||_,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(c,R),(C=_.querySelector(wp(c)))&&!C._p&&(R.instance=C,R.state.loading=5),hs.has(c)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},hs.set(c,m),C||kne(_,c,m,R.state))),f&&b===null)throw Error(r(528,""));return R}if(f&&b!==null)throw Error(r(529,""));return null;case"script":return f=m.async,m=m.src,typeof m=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=Ld(m),m=rd(_).hoistableScripts,b=m.get(f),b||(b={type:"script",instance:null,count:0,state:null},m.set(f,b)),b):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function Id(c){return'href="'+is(c)+'"'}function wp(c){return'link[rel="stylesheet"]['+c+"]"}function LM(c){return h({},c,{"data-precedence":c.precedence,precedence:null})}function kne(c,f,m,b){c.querySelector('link[rel="preload"][as="style"]['+f+"]")?b.loading=1:(f=c.createElement("link"),b.preload=f,f.addEventListener("load",function(){return b.loading|=1}),f.addEventListener("error",function(){return b.loading|=2}),_r(f,"link",m),lr(f),c.head.appendChild(f))}function Ld(c){return'[src="'+is(c)+'"]'}function jp(c){return"script[async]"+c}function FM(c,f,m){if(f.count++,f.instance===null)switch(f.type){case"style":var b=c.querySelector('style[data-href~="'+is(m.href)+'"]');if(b)return f.instance=b,lr(b),b;var _=h({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return b=(c.ownerDocument||c).createElement("style"),lr(b),_r(b,"style",_),hb(b,m.precedence,c),f.instance=b;case"stylesheet":_=Id(m.href);var C=c.querySelector(wp(_));if(C)return f.state.loading|=4,f.instance=C,lr(C),C;b=LM(m),(_=hs.get(_))&&c_(b,_),C=(c.ownerDocument||c).createElement("link"),lr(C);var R=C;return R._p=new Promise(function(q,Y){R.onload=q,R.onerror=Y}),_r(C,"link",b),f.state.loading|=4,hb(C,m.precedence,c),f.instance=C;case"script":return C=Ld(m.src),(_=c.querySelector(jp(C)))?(f.instance=_,lr(_),_):(b=m,(_=hs.get(C))&&(b=h({},m),u_(b,_)),c=c.ownerDocument||c,_=c.createElement("script"),lr(_),_r(_,"link",b),c.head.appendChild(_),f.instance=_);case"void":return null;default:throw Error(r(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(b=f.instance,f.state.loading|=4,hb(b,m.precedence,c));return f.instance}function hb(c,f,m){for(var b=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=b.length?b[b.length-1]:null,C=_,R=0;R<b.length;R++){var q=b[R];if(q.dataset.precedence===f)C=q;else if(C!==_)break}C?C.parentNode.insertBefore(c,C.nextSibling):(f=m.nodeType===9?m.head:m,f.insertBefore(c,f.firstChild))}function c_(c,f){c.crossOrigin==null&&(c.crossOrigin=f.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=f.referrerPolicy),c.title==null&&(c.title=f.title)}function u_(c,f){c.crossOrigin==null&&(c.crossOrigin=f.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=f.referrerPolicy),c.integrity==null&&(c.integrity=f.integrity)}var pb=null;function zM(c,f,m){if(pb===null){var b=new Map,_=pb=new Map;_.set(m,b)}else _=pb,b=_.get(m),b||(b=new Map,_.set(m,b));if(b.has(c))return b;for(b.set(c,null),m=m.getElementsByTagName(c),_=0;_<m.length;_++){var C=m[_];if(!(C[Dh]||C[Dr]||c==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var R=C.getAttribute(f)||"";R=c+R;var q=b.get(R);q?q.push(C):b.set(R,[C])}}return b}function BM(c,f,m){c=c.ownerDocument||c,c.head.insertBefore(m,f==="title"?c.querySelector("head > title"):null)}function Sne(c,f,m){if(m===1||f.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;switch(f.rel){case"stylesheet":return c=f.disabled,typeof f.precedence=="string"&&c==null;default:return!0}case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function UM(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}var Np=null;function Cne(){}function Ene(c,f,m){if(Np===null)throw Error(r(475));var b=Np;if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var _=Id(m.href),C=c.querySelector(wp(_));if(C){c=C._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(b.count++,b=mb.bind(b),c.then(b,b)),f.state.loading|=4,f.instance=C,lr(C);return}C=c.ownerDocument||c,m=LM(m),(_=hs.get(_))&&c_(m,_),C=C.createElement("link"),lr(C);var R=C;R._p=new Promise(function(q,Y){R.onload=q,R.onerror=Y}),_r(C,"link",m),f.instance=C}b.stylesheets===null&&(b.stylesheets=new Map),b.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(b.count++,f=mb.bind(b),c.addEventListener("load",f),c.addEventListener("error",f))}}function One(){if(Np===null)throw Error(r(475));var c=Np;return c.stylesheets&&c.count===0&&d_(c,c.stylesheets),0<c.count?function(f){var m=setTimeout(function(){if(c.stylesheets&&d_(c,c.stylesheets),c.unsuspend){var b=c.unsuspend;c.unsuspend=null,b()}},6e4);return c.unsuspend=f,function(){c.unsuspend=null,clearTimeout(m)}}:null}function mb(){if(this.count--,this.count===0){if(this.stylesheets)d_(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var gb=null;function d_(c,f){c.stylesheets=null,c.unsuspend!==null&&(c.count++,gb=new Map,f.forEach(Ane,c),gb=null,mb.call(c))}function Ane(c,f){if(!(f.state.loading&4)){var m=gb.get(c);if(m)var b=m.get(null);else{m=new Map,gb.set(c,m);for(var _=c.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<_.length;C++){var R=_[C];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(m.set(R.dataset.precedence,R),b=R)}b&&m.set(null,b)}_=f.instance,R=_.getAttribute("data-precedence"),C=m.get(R)||b,C===b&&m.set(null,_),m.set(R,_),this.count++,b=mb.bind(this),_.addEventListener("load",b),_.addEventListener("error",b),C?C.parentNode.insertBefore(_,C.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(_,c.firstChild)),f.state.loading|=4}}var _p={$$typeof:S,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function Tne(c,f,m,b,_,C,R,q){this.tag=1,this.containerInfo=c,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=oj(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oj(0),this.hiddenUpdates=oj(null),this.identifierPrefix=b,this.onUncaughtError=_,this.onCaughtError=C,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function qM(c,f,m,b,_,C,R,q,Y,ee,he,me){return c=new Tne(c,f,m,R,q,Y,ee,me),f=1,C===!0&&(f|=24),C=Pa(3,null,null,f),c.current=C,C.stateNode=c,f=Vj(),f.refCount++,c.pooledCache=f,f.refCount++,C.memoizedState={element:b,isDehydrated:m,cache:f},Xj(C),c}function HM(c){return c?(c=md,c):md}function KM(c,f,m,b,_,C){_=HM(_),b.context===null?b.context=_:b.pendingContext=_,b=tl(f),b.payload={element:m},C=C===void 0?null:C,C!==null&&(b.callback=C),m=nl(c,b,f),m!==null&&(Ia(m,c,f),ep(m,c,f))}function VM(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var m=c.retryLane;c.retryLane=m!==0&&m<f?m:f}}function f_(c,f){VM(c,f),(c=c.alternate)&&VM(c,f)}function GM(c){if(c.tag===13){var f=pd(c,67108864);f!==null&&Ia(f,c,67108864),f_(c,67108864)}}var xb=!0;function Pne(c,f,m,b){var _=$.T;$.T=null;var C=K.p;try{K.p=2,h_(c,f,m,b)}finally{K.p=C,$.T=_}}function Rne(c,f,m,b){var _=$.T;$.T=null;var C=K.p;try{K.p=8,h_(c,f,m,b)}finally{K.p=C,$.T=_}}function h_(c,f,m,b){if(xb){var _=p_(b);if(_===null)e_(c,f,b,bb,m),YM(c,b);else if(Dne(_,c,f,m,b))b.stopPropagation();else if(YM(c,b),f&4&&-1<Mne.indexOf(c)){for(;_!==null;){var C=nd(_);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var R=mc(C.pendingLanes);if(R!==0){var q=C;for(q.pendingLanes|=2,q.entangledLanes|=2;R;){var Y=1<<31-jn(R);q.entanglements[1]|=Y,R&=~Y}ui(C),(_t&6)===0&&(tb=be()+500,xp(0))}}break;case 13:q=pd(C,2),q!==null&&Ia(q,C,2),rb(),f_(C,2)}if(C=p_(b),C===null&&e_(c,f,b,bb,m),C===_)break;_=C}_!==null&&b.stopPropagation()}else e_(c,f,b,null,m)}}function p_(c){return c=yj(c),m_(c)}var bb=null;function m_(c){if(bb=null,c=td(c),c!==null){var f=s(c);if(f===null)c=null;else{var m=f.tag;if(m===13){if(c=o(f),c!==null)return c;c=null}else if(m===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;c=null}else f!==c&&(c=null)}}return bb=c,null}function WM(c){switch(c){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ce()){case $t:return 2;case en:return 8;case Ot:case Le:return 32;case gn:return 268435456;default:return 32}default:return 32}}var g_=!1,ml=null,gl=null,xl=null,kp=new Map,Sp=new Map,bl=[],Mne="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function YM(c,f){switch(c){case"focusin":case"focusout":ml=null;break;case"dragenter":case"dragleave":gl=null;break;case"mouseover":case"mouseout":xl=null;break;case"pointerover":case"pointerout":kp.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sp.delete(f.pointerId)}}function Cp(c,f,m,b,_,C){return c===null||c.nativeEvent!==C?(c={blockedOn:f,domEventName:m,eventSystemFlags:b,nativeEvent:C,targetContainers:[_]},f!==null&&(f=nd(f),f!==null&&GM(f)),c):(c.eventSystemFlags|=b,f=c.targetContainers,_!==null&&f.indexOf(_)===-1&&f.push(_),c)}function Dne(c,f,m,b,_){switch(f){case"focusin":return ml=Cp(ml,c,f,m,b,_),!0;case"dragenter":return gl=Cp(gl,c,f,m,b,_),!0;case"mouseover":return xl=Cp(xl,c,f,m,b,_),!0;case"pointerover":var C=_.pointerId;return kp.set(C,Cp(kp.get(C)||null,c,f,m,b,_)),!0;case"gotpointercapture":return C=_.pointerId,Sp.set(C,Cp(Sp.get(C)||null,c,f,m,b,_)),!0}return!1}function XM(c){var f=td(c.target);if(f!==null){var m=s(f);if(m!==null){if(f=m.tag,f===13){if(f=o(m),f!==null){c.blockedOn=f,Eee(c.priority,function(){if(m.tag===13){var b=$a();b=lj(b);var _=pd(m,b);_!==null&&Ia(_,m,b),f_(m,b)}});return}}else if(f===3&&m.stateNode.current.memoizedState.isDehydrated){c.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}c.blockedOn=null}function yb(c){if(c.blockedOn!==null)return!1;for(var f=c.targetContainers;0<f.length;){var m=p_(c.nativeEvent);if(m===null){m=c.nativeEvent;var b=new m.constructor(m.type,m);bj=b,m.target.dispatchEvent(b),bj=null}else return f=nd(m),f!==null&&GM(f),c.blockedOn=m,!1;f.shift()}return!0}
vendor: 1,032 bytes, line 50
50function QM(c,f,m){yb(c)&&m.delete(f)}function $ne(){g_=!1,ml!==null&&yb(ml)&&(ml=null),gl!==null&&yb(gl)&&(gl=null),xl!==null&&yb(xl)&&(xl=null),kp.forEach(QM),Sp.forEach(QM)}function vb(c,f){c.blockedOn===f&&(c.blockedOn=null,g_||(g_=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$ne)))}var wb=null;function ZM(c){wb!==c&&(wb=c,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wb===c&&(wb=null);for(var f=0;f<c.length;f+=3){var m=c[f],b=c[f+1],_=c[f+2];if(typeof b!="function"){if(m_(b||m)===null)continue;break}var C=nd(m);C!==null&&(c.splice(f,3),f-=3,mN(C,{pending:!0,data:_,method:m.method,action:b},b,_))}}))}function Ep(c){function f(Y){return vb(Y,c)}ml!==null&&vb(ml,c),gl!==null&&vb(gl,c),xl!==null&&vb(xl,c),kp.forEach(f),Sp.forEach(f);for(var m=0;m<bl.length;m++){var b=bl[m];b.blockedOn===c&&(b.blockedOn=null)}for(;0<bl.length&&(m=bl[0],m.blockedOn===null);)XM(m),m.blockedOn===null&&bl.shift();if(m=(c.ownerDocument||c).$$reactFormReplay,m!=null)for(b=0;b<m.length;b+=3){var _=m[b],C=m[b+1
50],R=_[aa]||null;if(typeof C=="function")R||ZM(m);else if(R){var q=null;if(C&&C.hasAttribute("formAction")){if(_=C,R=C[aa]||null)q=R.formAction;else if(m_(_)!==null)continue}else q=R.action;typeof q=="function"?m[b+1]=q:(m.splice(b,3),b-=3),ZM(m)}}}function x_(c){this._internalRoot=c}jb.prototype.render=x_.prototype.render=function(c){var f=this._internalRoot;if(f===null)throw Error(r(409));var m=f.current,b=$a();KM(m,b,c,f,null,null)},jb.prototype.unmount=x_.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var f=c.containerInfo;KM(c.current,2,null,c,null,null),rb(),f[ed]=null}};function jb(c){this._internalRoot=c}jb.prototype.unstable_scheduleHydration=function(c){if(c){var f=m3();c={blockedOn:null,target:c,priority:f};for(var m=0;m<bl.length&&f!==0&&f<bl[m].priority;m++);bl.splice(m,0,c),m===0&&XM(c)}};var JM=t.version;if(JM!=="19.1.0")throw Error(r(527,JM,"19.1.0"));K.findDOMNode=function(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=u(f),c=c!==null?d(c):null,c=c===null?null:c.stateNode,c};var Ine={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nb=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nb.isDisabled&&Nb.supportsFiber)try{Kt=Nb.inject(Ine),ze=Nb}catch{}}return Ap.createRoot=function(c,f){if(!a(c))throw Error(r(299));var m=!1,b="",_=m4,C=g4,R=x4,q=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(b=f.identifierPrefix),f.onUncaughtError!==void 0&&(_=f.onUncaughtError),f.onCaughtError!==void 0&&(C=f.onCaughtError),f.onRecoverableError!==void 0&&(R=f.onRecoverableError),f.unstable_transitionCallbacks!==void 0&&(q=f.unstable_transitionCallbacks)),f=qM(c,1,!1,null,null,m,b,_,C,R,q,null),c[ed]=f.current,JN(c),new x_(f)},Ap.hydrateRoot=function(c,f,m){if(!a(c))throw Error(r(299));var b=!1,_="",C=m4,R=g4,q=x4,Y=null,ee=null;return m!=null&&(m.unstable_strictMode===!0&&(b=!0),m.identifierPrefix!==void 0&&(_=m.identifierPrefix),m.onUncaughtError!==void 0&&(C=m.onUncaughtError),m.onCaughtError!==void 0&&(R=m.onCaughtError),m.onRecoverableError!==void 0&&(q=m.onRecoverableError),m.unstable_transitionCallbacks!==void 0&&(Y=m.unstable_transitionCallbacks),m.formState!==void 0&&(ee=m.formState)),f=qM(c,1,!0,f,m??null,b,_,C,R,q,Y,ee),f.context=HM(null),m=f.current,b=$a(),b=lj(b),_=tl(b),_.callback=null,nl(m,_,b),m=b,f.current.lanes=m,Mh(f,m),ui(f),c[ed]=f.current,JN(c),new jb(f)},Ap.version="19.1.0",Ap}var cD;function Wne(){if(cD)return w_.exports;cD=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),w_.exports=Gne(),w_.exports}var Yne=Wne();const Xne="modulepreload",Qne=function(e){return"/"+e},uD={}
50,nr=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let u=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");a=u(n.map(d=>{if(d=Qne(d),d in uD)return;uD[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":Xne,h||(g.as="script"),g.crossOrigin="",g.href=d,l&&g.setAttribute("nonce",l),document.head.appendChild(g),h)return new Promise((x,y)=>{g.addEventListener("load",x),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${d}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var Tp={},dD;function Zne(){if(dD)return Tp;dD=1,Object.defineProperty(Tp,"__esModule",{value:!0}),Tp.parse=o,Tp.serialize=d;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,s=(()=>{const g=function(){};return g.prototype=Object.create(null),g})();function o(g,x){const y=new s,w=g.length;if(w<2)return y;const j=x?.decode||h;let N=0;do{const k=g.indexOf("=",N);if(k===-1)break;const S=g.indexOf(";",N),E=S===-1?w:S;if(k>E){N=g.lastIndexOf(";",k-1)+1;continue}const O=l(g,N,k),T=u(g,k,O),P=g.slice(O,T);if(y[P]===void 0){let M=l(g,k+1,E),D=u(g,E,M);const A=j(g.slice(M,D));y[P]=A}N=E+1}while(N<w);return y}function l(g,x,y){do{const w=g.charCodeAt(x);if(w!==32&&w!==9)return x}while(++x<y);return y}function u(g,x,y){for(;x>y;){const w=g.charCodeAt(--x);if(w!==32&&w!==9)return x+1}return y}function d(g,x,y){const w=y?.encode||encodeURIComponent;if(!e.test(g))throw new TypeError(`argument name is invalid: ${g}`);const j=w(x);if(!t.test(j))throw new TypeError(`argument val is invalid: ${x}`);let N=g+"="+j;if(!y)return N;if(y.maxAge!==void 0){if(!Number.isInteger(y.maxAge))throw new TypeError(`option maxAge is invalid: ${y.maxAge}`);N+="; Max-Age="+y.maxAge}if(y.domain){if(!n.test(y.domain))throw new TypeError(`option domain is invalid: ${y.domain}`);N+="; Domain="+y.domain}if(y.path){if(!r.test(y.path))throw new TypeError(`option path is invalid: ${y.path}`);N+="; Path="+y.path}if(y.expires){if(!p(y.expires)||!Number.isFinite(y.expires.valueOf()))throw new TypeError(`option expires is invali
50d: ${y.expires}`);N+="; Expires="+y.expires.toUTCString()}if(y.httpOnly&&(N+="; HttpOnly"),y.secure&&(N+="; Secure"),y.partitioned&&(N+="; Partitioned"),y.priority)switch(typeof y.priority=="string"?y.priority.toLowerCase():void 0){case"low":N+="; Priority=Low";break;case"medium":N+="; Priority=Medium";break;case"high":N+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${y.priority}`)}if(y.sameSite)switch(typeof y.sameSite=="string"?y.sameSite.toLowerCase():y.sameSite){case!0:case"strict":N+="; SameSite=Strict";break;case"lax":N+="; SameSite=Lax";break;case"none":N+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${y.sameSite}`)}return N}function h(g){if(g.indexOf("%")===-1)return g;try{return decodeURIComponent(g)}catch{return g}}function p(g){return a.call(g)==="[object Date]"}return Tp}Zne();var fD="popstate";function Jne(e={}){function t(r,a){let{pathname:s,search:o,hash:l}=r.location;return Z5("",{pathname:s,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Rm(a)}return tre(t,n,null,e)}function hn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ks(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ere(){return Math.random().toString(36).substring(2,10)}function hD(e,t){return{usr:e.state,key:e.key,idx:t}}function Z5(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ah(t):t,state:n,key:t&&t.key||r||ere()}}function Rm({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ah(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function tre(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:s=!1}=r,o=a.history,l="POP",u=null,d=h();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function h(){return(o.state||{idx:null}).idx}function p(){l="POP";let j=h(),N=j==null?null:j-d;d=j,u&&u({action:l,location:w.location,delta:N})}function g(j,N){l="PUSH";let k=Z5(w.location,j,N);d=h()+1;let S=hD(k,d),E=w.createHref(k);try{o.pushState(S,"",E)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;a.location.assign(E)}s&&u&&u({action:l,location:w.location,delta:1})}function x(j,N){l="REPLACE";let k=Z5(w.location,j,N);d=h();let S=hD(k,d),E=w.createHref(k);o.replaceState(S,"",E),s&&u&&u({action:l,location:w.location,delta:0})}function y(j){return nre(j)}let w={get action(){return l},get location(){return e(a,o)},listen(j){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(fD,p),u=j,()=>{a.removeEventListener(fD,p),u=null}},createHref(j){return t(a,j)},createURL:y,encodeLocation(j){let N=y(j);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:g,replace:x,go(j){return o.go(j)}};return w}function nre(e,t=!1){let n="http://localhost";
50typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),hn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Rm(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Fz(e,t,n="/"){return rre(e,t,n,!1)}function rre(e,t,n,r){let a=typeof t=="string"?ah(t):t,s=Eo(a.pathname||"/",n);if(s==null)return null;let o=zz(e);are(o);let l=null;for(let u=0;l==null&&u<o.length;++u){let d=mre(s);l=hre(o[u],d,r)}return l}function zz(e,t=[],n=[],r=""){let a=(s,o,l)=>{let u={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};u.relativePath.startsWith("/")&&(hn(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length));let d=No([r,u.relativePath]),h=n.concat(u);s.children&&s.children.length>0&&(hn(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),zz(s.children,t,h,d)),!(s.path==null&&!s.index)&&t.push({path:d,score:dre(d,s.index),routesMeta:h})};return e.forEach((s,o)=>{if(s.path===""||!s.path?.includes("?"))a(s,o);else for(let l of Bz(s.path))a(s,o,l)}),t}function Bz(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let o=Bz(r.join("/")),l=[];return l.push(...o.map(u=>u===""?s:[s,u].join("/"))),a&&l.push(...o),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function are(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:fre(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var sre=/^:[\w-]+$/,ire=3,ore=2,lre=1,cre=10,ure=-2,pD=e=>e==="*";function dre(e,t){let n=e.split("/"),r=n.length;return n.some(pD)&&(r+=ure),t&&(r+=ore),n.filter(a=>!pD(a)).reduce((a,s)=>a+(sre.test(s)?ire:s===""?lre:cre),r)}function fre(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function hre(e,t,n=!1){let{routesMeta:r}=e,a={},s="/",o=[];for(let l=0;l<r.length;++l){let u=r[l],d=l===r.length-1,h=s==="/"?t:t.slice(s.length)||"/",p=oy({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},h),g=u.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=oy({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!p)return null;
50Object.assign(a,p.params),o.push({params:a,pathname:No([s,p.pathname]),pathnameBase:yre(No([s,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(s=No([s,p.pathnameBase]))}return o}function oy(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pre(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let s=a[0],o=s.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((d,{paramName:h,isOptional:p},g)=>{if(h==="*"){let y=l[g]||"";o=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const x=l[g];return p&&!x?d[h]=void 0:d[h]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:o,pattern:e}}function pre(e,t=!1,n=!0){ks(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function mre(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ks(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Eo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function gre(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?ah(e):e;return{pathname:n?n.startsWith("/")?n:xre(n,t):t,search:vre(r),hash:wre(a)}}function xre(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function k_(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function bre(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function DE(e){let t=bre(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function $E(e,t,n,r=!1){let a;typeof e=="string"?a=ah(e):(a={...e},hn(!a.pathname||!a.pathname.includes("?"),k_("?","pathname","search",a)),hn(!a.pathname||!a.pathname.includes("#"),k_("#","pathname","hash",a)),hn(!a.search||!a.search.includes("#"),k_("#","search","hash",a)));let s=e===""||a.pathname==="",o=s?"/":a.pathname,l;if(o==null)l=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),p-=1;a.pathname=g.join("/")}l=p>=0?t[p]:"/"}let u=gre(a,l),d=o&&o!=="/"&&o.endsWith("/"),h=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||h)&&(u.pathname+="/"),u}var No=e=>e.join("/").replace(/\/\/+/g,"/"),yre=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),vre=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wre=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function jre(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Uz=["POST","PUT","PATCH","DELETE"];new Set(Uz);var Nre=["GET",...Uz];new Set(Nre);var sh=v.createContext(null);sh.displayName="DataRouter";var Vv=v.createContext(null);Vv.displayName="DataRouterState";var qz=v.createContext({isTransitioning:!1});qz.displayName="ViewTransition";var _re=v.createContext(new Map);_re.displayName="Fetchers";var kre=v.createContext(null);kre.displayName="Await";var ni=v.createContext(null);ni.displayName="Navigation";var xg=v.createContext(null);xg.displayName="Location";var Rs=v.createContext({outlet:null,matches:[],isDataRoute:!1});Rs.displayName="Route";var IE=v.createContext(null);IE.displayName="RouteError";function Sre(e,{relative:t}={}){hn(ih(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(ni),{hash:a,pathname:s,search:o}=bg(e,{relative:t}),l=s;return n!=="/"&&(l=s==="/"?n:No([n,s])),r.createHref({pathname:l,search:o,hash:a})}function ih(){return v.useContext(xg)!=null}function Gr(){return hn(ih(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(xg).location}var Hz="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Kz(e){v.useContext(ni).static||v.useLayoutEffect(e)}function Sa(){let{isDataRoute:e}=v.useContext(Rs);return e?Bre():Cre()}function Cre(){hn(ih(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(sh),{basename:t,navigator:n}=v.useContext(ni),{matches:r}=v.useContext(Rs),{pathname:a}=Gr(),s=JSON.stringify(DE(r)),o=v.useRef(!1);return Kz(()=>{o.current=!0}),v.useCallback((u,d={})=>
50{if(ks(o.current,Hz),!o.current)return;if(typeof u=="number"){n.go(u);return}let h=$E(u,JSON.parse(s),a,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:No([t,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[t,n,s,a,e])}var Vz=v.createContext(null);function Gv(){return v.useContext(Vz)}function Ere(e){let t=v.useContext(Rs).outlet;return t&&v.createElement(Vz.Provider,{value:e},t)}function Ore(){let{matches:e}=v.useContext(Rs),t=e[e.length-1];return t?t.params:{}}function bg(e,{relative:t}={}){let{matches:n}=v.useContext(Rs),{pathname:r}=Gr(),a=JSON.stringify(DE(n));return v.useMemo(()=>$E(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function Are(e,t){return Gz(e,t)}function Gz(e,t,n,r){hn(ih(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=v.useContext(ni),{matches:s}=v.useContext(Rs),o=s[s.length-1],l=o?o.params:{},u=o?o.pathname:"/",d=o?o.pathnameBase:"/",h=o&&o.route;{let N=h&&h.path||"";Wz(u,!h||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 51 52Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let p=Gr(),g;if(t){let N=typeof t=="string"?ah(t):t;hn(d==="/"||N.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${N.pathname}" was given in the \`location\` prop.`),g=N}else g=p;let x=g.pathname||"/",y=x;if(d!=="/"){let N=d.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(N.length).join("/")}let w=Fz(e,{pathname:y});ks(h||w!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),ks(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=Dre(w&&w.map(N=>Object.assign({},N,{params:Object.assign({},l,N.params),pathname:No([d,a.encodeLocation?a.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?d:No([d,a.encodeLocation?a.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),s,n,r);return t&&j?v.createElement(xg.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},j):j}function Tre(){let e=zre(),t=jre(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=v.createElement(v.Fragment,null,v.createElement("p",null,"ð¿ Hey developer ð"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:s},"ErrorBoundary")," or"," ",v.createElement("code",{style:s},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,o)}var Pre=v.createElement(Tre,null),Rre=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?v.createElement(Rs.Provider,{value:this.props.routeContext},v.createElement(IE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Mre({routeContext:e,match:t,children:n}){let r=v.useContext(sh);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Rs.Provider,{value:e},n)}function Dre(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,s=n?.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&s?.[d.route.id]!==void 0);hn(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),a=a.slice(0,Math.min(a.length,u+1))}let o=!1,l=-1;if(n)for(let u=0;u<a.length;u++){let d=a[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=u),d.route.id){let{loaderData:h,errors:p}
52=n,g=d.route.loader&&!h.hasOwnProperty(d.route.id)&&(!p||p[d.route.id]===void 0);if(d.route.lazy||g){o=!0,l>=0?a=a.slice(0,l+1):a=[a[0]];break}}}return a.reduceRight((u,d,h)=>{let p,g=!1,x=null,y=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,x=d.route.errorElement||Pre,o&&(l<0&&h===0?(Wz("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,y=null):l===h&&(g=!0,y=d.route.hydrateFallbackElement||null)));let w=t.concat(a.slice(0,h+1)),j=()=>{let N;return p?N=x:g?N=y:d.route.Component?N=v.createElement(d.route.Component,null):d.route.element?N=d.route.element:N=u,v.createElement(Mre,{match:d,routeContext:{outlet:u,matches:w,isDataRoute:n!=null},children:N})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?v.createElement(Rre,{location:n.location,revalidation:n.revalidation,component:x,error:p,children:j(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):j()},null)}function LE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $re(e){let t=v.useContext(sh);return hn(t,LE(e)),t}function Ire(e){let t=v.useContext(Vv);return hn(t,LE(e)),t}function Lre(e){let t=v.useContext(Rs);return hn(t,LE(e)),t}function FE(e){let t=Lre(e),n=t.matches[t.matches.length-1];return hn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Fre(){return FE("useRouteId")}function zre(){let e=v.useContext(IE),t=Ire("useRouteError"),n=FE("useRouteError");return e!==void 0?e:t.errors?.[n]}function Bre(){let{router:e}=$re("useNavigate"),t=FE("useNavigate"),n=v.useRef(!1);return Kz(()=>{n.current=!0}),v.useCallback(async(a,s={})=>{ks(n.current,Hz),n.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...s}))},[e,t])}var mD={};function Wz(e,t,n){!t&&!mD[e]&&(mD[e]=!0,ks(!1,n))}v.memo(Ure);function Ure({routes:e,future:t,state:n}){return Gz(e,void 0,n,t)}function fr({to:e,replace:t,state:n,relative:r}){hn(ih(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=v.useContext(ni);ks(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=v.useContext(Rs),{pathname:o}=Gr(),l=Sa(),u=$E(e,DE(s),o,r==="path"),d=JSON.stringify(u);return v.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function yg(e){return Ere(e.context)}function Ke(e){hn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function qre({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:s=!1}){hn(!ih(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),l=v.useMemo(()=>({basename:o,navigator:a,static:s,future:{}}),[o,a,s]);typeof n=="string"&&(n=ah(n));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:g="default"}=n,x=v.useMemo(()=>{let y=Eo(u,o);return y==null?null:{location:{pathname:y,search:d,hash:h,state:p,key:g},navigationType:r}},[o,u,d,h,p,g,r]);return ks(x!=null,`<Router basename="${o}"> is not able to match the URL "${u}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:v.createElement(ni.Provider,{value:l},v.createElement(xg.Provider,{children:t,value:x}))}function zE({children:e,location:t}){return Are(J5(e),t)}function J5(e,t=[]){let n=[];return v.Children.forEach(e,(r,a)=>{if(!v.isValidElement(r))return;let s=[...t,a];if(r.type===v.Fragment){n.push.apply(n,J5(r.props.children,s));return}hn(r.type===Ke,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),hn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,
52shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=J5(r.props.children,s)),n.push(o)}),n}var D0="get",$0="application/x-www-form-urlencoded";function Wv(e){return e!=null&&typeof e.tagName=="string"}function Hre(e){return Wv(e)&&e.tagName.toLowerCase()==="button"}function Kre(e){return Wv(e)&&e.tagName.toLowerCase()==="form"}function Vre(e){return Wv(e)&&e.tagName.toLowerCase()==="input"}function Gre(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wre(e,t){return e.button===0&&(!t||t==="_self")&&!Gre(e)}function eS(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function Yre(e,t){let n=eS(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(s=>{n.append(a,s)})}),n}var _b=null;function Xre(){if(_b===null)try{new FormData(document.createElement("form"),0),_b=!1}catch{_b=!0}return _b}var Qre=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function S_(e){return e!=null&&!Qre.has(e)?(ks(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$0}"`),null):e}function Zre(e,t){let n,r,a,s,o;if(Kre(e)){let l=e.getAttribute("action");r=l?Eo(l,t):null,n=e.getAttribute("method")||D0,a=S_(e.getAttribute("enctype"))||$0,s=new FormData(e)}else if(Hre(e)||Vre(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?Eo(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||D0,a=S_(e.getAttribute("formenctype"))||S_(l.getAttribute("enctype"))||$0,s=new FormData(l,e),!Xre()){let{name:d,type:h,value:p}=e;if(h==="image"){let g=d?`${d}.`:"";s.append(`${g}x`,"0"),s.append(`${g}y`,"0")}else d&&s.append(d,p)}}else{if(Wv(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=D0,r=null,a=$0,o=e}return s&&a==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:s,body:o}}function BE(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function Jre(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function eae(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function tae(e,t,n){let r=await Promise.all(e.map(async a=>{let s=t.routes[a.route.id];if(s){let o=await Jre(s,n);return o.links?o.links():[]}return[]}));return sae(r.flat(1).filter(eae).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function gD(e,t,n,r,a,s){let o=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,l=(u,d)=>n[d].pathname!==u.pathname||n[d].route.path?.endsWith("*")&&n[d].params["*"]!==u.params["*"];return s==="assets"?t.filter((u,d)=>o(u,d)||l(u,d)):s==="data"?t.filter((u,d)=>{let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(o(u,d)||l(u,d))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function nae(e,t,{includeHydrateFallback:n}={}){return rae(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let s=[a.module];return a.clientActionModule&&(s=s.concat(a.clientActionModule)),a.clientLoaderModule&&(s=s.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(s=s.concat(a.hydrateFallbackModule)),a.imports&&(s=s.concat(a.imports)),s}).flat(1))}function rae(e){return[...new Set(e)]}function aae(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function sae(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let s=JSON.stringify(aae(a));return n.has(s)||(n.add(s),r.push({key:s,link:a})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var iae=new Set([100,101,204,205]);function oae(e,t){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&Eo(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function Yz(){let e=v.useContext(sh);return BE(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function lae(){let e=v.useContext(Vv);return BE(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var UE=v.createContext(void 0);UE.displayName="FrameworkContext";function Xz(){let e=v.useContext(UE);return BE(e,"You must render this element inside a <HydratedRouter> element"),e}function cae(e,t){let n=v.useContext(UE),[r,a]=v.useState(!1),[s,o]=v.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:d,onMouseLeave:h,onTouchStart:p}=t,g=v.useRef(null);v.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=N=>
52{N.forEach(k=>{o(k.isIntersecting)})},j=new IntersectionObserver(w,{threshold:.5});return g.current&&j.observe(g.current),()=>{j.disconnect()}}},[e]),v.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let x=()=>{a(!0)},y=()=>{a(!1),o(!1)};return n?e!=="intent"?[s,g,{}]:[s,g,{onFocus:Pp(l,x),onBlur:Pp(u,y),onMouseEnter:Pp(d,x),onMouseLeave:Pp(h,y),onTouchStart:Pp(p,x)}]:[!1,g,{}]}function Pp(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function uae({page:e,...t}){let{router:n}=Yz(),r=v.useMemo(()=>Fz(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(fae,{page:e,matches:r,...t}):null}function dae(e){let{manifest:t,routeModules:n}=Xz(),[r,a]=v.useState([]);return v.useEffect(()=>{let s=!1;return tae(e,t,n).then(o=>{s||a(o)}),()=>{s=!0}},[e,t,n]),r}function fae({page:e,matches:t,...n}){let r=Gr(),{manifest:a,routeModules:s}=Xz(),{basename:o}=Yz(),{loaderData:l,matches:u}=lae(),d=v.useMemo(()=>gD(e,t,u,a,r,"data"),[e,t,u,a,r]),h=v.useMemo(()=>gD(e,t,u,a,r,"assets"),[e,t,u,a,r]),p=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let y=new Set,w=!1;if(t.forEach(N=>{let k=a.routes[N.route.id];!k||!k.hasLoader||(!d.some(S=>S.route.id===N.route.id)&&N.route.id in l&&s[N.route.id]?.shouldRevalidate||k.hasClientLoader?w=!0:y.add(N.route.id))}),y.size===0)return[];let j=oae(e,o);return w&&y.size>0&&j.searchParams.set("_routes",t.filter(N=>y.has(N.route.id)).map(N=>N.route.id).join(",")),[j.pathname+j.search]},[o,l,r,a,d,t,e,s]),g=v.useMemo(()=>nae(h,a),[h,a]),x=dae(h);return v.createElement(v.Fragment,null,p.map(y=>v.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),g.map(y=>v.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),x.map(({key:y,link:w})=>v.createElement("link",{key:y,...w})))}function hae(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Qz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Qz&&(window.__reactRouterVersion="7.6.3")}catch{}function pae({basename:e,children:t,window:n}){let r=v.useRef();r.current==null&&(r.current=Jne({window:n,v5Compat:!0}));let a=r.current,[s,o]=v.useState({action:a.action,location:a.location}),l=v.useCallback(u=>{v.startTransition(()=>o(u))},[o]);return v.useLayoutEffect(()=>a.listen(l),[a,l]),v.createElement(qre,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:a})}var Zz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gt=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:s,replace:o,state:l,target:u,to:d,preventScrollReset:h,viewTransition:p,...g},x){let{basename:y}=v.useContext(ni),w=typeof d=="string"&&Zz.test(d),j,N=!1;if(typeof d=="string"&&w&&(j=d,Qz))try{let D=new URL(window.location.href),A=d.startsWith("//")?new URL(D.protocol+d):new URL(d),L=Eo(A.pathname,y);A.origin===D.origin&&L!=null?d=L+A.search+A.hash:N=!0}catch{ks(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let k=Sre(d,{relative:a}),[S,E,O]=cae(r,g),T=xae(d,{replace:o,state:l,target:u,preventScrollReset:h,relative:a,viewTransition:p});function P(D){t&&t(D),D.defaultPrevented||T(D)}let M=v.createElement("a",{...g,...O,href:j||k,onClick:N||s?t:P,ref:hae(x,E),target:u,"data-discover":!w&&n==="render"?"true":void 0});return S&&!w?v.createElement(v.Fragment,null,M,v.createElement(uae,{page:k})):M});gt.displayName="Link";var ly=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:s,to:o,viewTransition:l,children:u,...d},h){let p=bg(o,{relative:d.relative}),g=Gr(),x=v.useContext(Vv),{navigator:y,basename:w}=v.useContext(ni),j=x!=null&&jae(p)&&l===!0,N=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,k=g.pathname,S=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(k=k.toLowerCase(),S=S?S.toLowerCase():null,N=N.toLowerCase()),S&&w&&(S=Eo(S,w)||S);const E=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let O=k===N||!a&&k.startsWith(N)&&k.charAt(E)==="/",T=S!=null&&(S===N||!a&&S.startsWith(N)&&S.charAt(N.length)==="/"),P={isActive:O,isPending:T,isTransitioning:j},M=O?t:void 0,D;typeof r=="function"?D=r(P):D=[r,O?"active":null,T?"pending":null,j?"transitioning":null].filter(
52Boolean).join(" ");let A=typeof s=="function"?s(P):s;return v.createElement(gt,{...d,"aria-current":M,className:D,ref:h,style:A,to:o,viewTransition:l},typeof u=="function"?u(P):u)});ly.displayName="NavLink";var mae=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:s,method:o=D0,action:l,onSubmit:u,relative:d,preventScrollReset:h,viewTransition:p,...g},x)=>{let y=vae(),w=wae(l,{relative:d}),j=o.toLowerCase()==="get"?"get":"post",N=typeof l=="string"&&Zz.test(l),k=S=>{if(u&&u(S),S.defaultPrevented)return;S.preventDefault();let E=S.nativeEvent.submitter,O=E?.getAttribute("formmethod")||o;y(E||S.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:a,state:s,relative:d,preventScrollReset:h,viewTransition:p})};return v.createElement("form",{ref:x,method:j,action:w,onSubmit:r?u:k,...g,"data-discover":!N&&e==="render"?"true":void 0})});mae.displayName="Form";function gae(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Jz(e){let t=v.useContext(sh);return hn(t,gae(e)),t}function xae(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:s,viewTransition:o}={}){let l=Sa(),u=Gr(),d=bg(e,{relative:s});return v.useCallback(h=>{if(Wre(h,t)){h.preventDefault();let p=n!==void 0?n:Rm(u)===Rm(d);l(e,{replace:p,state:r,preventScrollReset:a,relative:s,viewTransition:o})}},[u,l,d,n,r,t,e,a,s,o])}function Li(e){ks(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(eS(e)),n=v.useRef(!1),r=Gr(),a=v.useMemo(()=>Yre(r.search,n.current?null:t.current),[r.search]),s=Sa(),o=v.useCallback((l,u)=>{const d=eS(typeof l=="function"?l(a):l);n.current=!0,s("?"+d,u)},[s,a]);return[a,o]}var bae=0,yae=()=>`__${String(++bae)}__`;function vae(){let{router:e}=Jz("useSubmit"),{basename:t}=v.useContext(ni),n=Fre();return v.useCallback(async(r,a={})=>{let{action:s,method:o,encType:l,formData:u,body:d}=Zre(r,t);if(a.navigate===!1){let h=a.fetcherKey||yae();await e.fetch(h,n,a.action||s,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||o,formEncType:a.encType||l,flushSync:a.flushSync})}else await e.navigate(a.action||s,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||o,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function wae(e,{relative:t}={}){let{basename:n}=v.useContext(ni),r=v.useContext(Rs);hn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),s={...bg(e||".",{relative:t})},o=Gr();if(e==null){s.search=o.search;let l=new URLSearchParams(s.search),u=l.getAll("index");if(u.some(h=>h==="")){l.delete("index"),u.filter(p=>p).forEach(p=>l.append("index",p));let h=l.toString();s.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:No([n,s.pathname])),Rm(s)}function jae(e,t={}){let n=v.useContext(qz);hn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Jz("useViewTransitionState"),a=bg(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Eo(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Eo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return oy(a.pathname,o)!=null||oy(a.pathname,s)!=null}[...iae];
vendor: 10,414 bytes, line 52
52var qE=Lz(),tS=function(e,t){return tS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},tS(e,t)};function Nae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");tS(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var hr=function(){return hr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},hr.apply(this,arguments)};function _ae(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function Fd(e,t,n,r){function a(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function l(h){try{d(r.next(h))}catch(p){o(p)}}function u(h){try{d(r.throw(h))}catch(p){o(p)}}function d(h){h.done?s(h.value):a(h.value).then(l,u)}d((r=r.apply(e,[])).next())})}function zd(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,a,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(d){return function(h){return u([d,h])}}function u(d){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,d[0]&&(n=0)),n;)try{if(r=1,a&&(s=d[0]&2?a.return:d[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,d[1])).done)return s;switch(a=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,a=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){n.label=d[1];break}if(d[0]===6&&n.label<s[1]){n.label=s[1],s=d;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(d);break}s[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(e,n)}catch(h){d=[6,h],a=0}finally{r=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function mi(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}var Wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function HE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function KE(e,t){return e(t={exports:{}},t.exports),t.exports}var Bc=KE(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function r(){var a=this;this.locked=new Map,this.addToLocked=function(s,o){var l=a.locked.get(s);l===void 0?o===void 0?a.locked.set(s,[]):a.locked.set(s,[o]):o!==void 0&&(l.unshift(o),a.locked.set(s,l))},this.isLocked=function(s){return a.locked.has(s)},this.lock=function(s){return new Promise(function(o,l){a.isLocked(s)?a.addToLocked(s,o):(a.addToLocked(s),o())})},this.unlock=function(s){var o=a.locked.get(s);if(o!==void 0&&o.length!==0){var l=o.pop();a.locked.set(s,o),l!==void 0&&setTimeout(l,0)}else a.locked.delete(s)}}return r.getInstance=function(){return r.instance===void 0&&(r.instance=new r),r.instance},r}();t.default=function(){return n.getInstance()}});HE(Bc);var kae=HE(KE(function(e,t){var n=Wc&&Wc.__awaiter||function(h,p,g,x){return new(g||(g=Promise))(function(y,w){function j(S){try{k(x.next(S))}catch(E){w(E)}}function N(S){try{k(x.throw(S))}catch(E){w(E)}}function k(S){S.done?y(S.value):new g(function(E){E(S.value)}).then(j,N)}k((x=x.apply(h,p||[])).next())})},r=Wc&&Wc.__generator||function(h,p){var g,x,y,w,j={label:0,sent:function(){if(1&y[0])throw y[1];return y[1]},trys:[],ops:[]};return w={next:N(0),throw:N(1),return:N(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function N(k){return function(S){return function(E){if(g)throw new TypeError("Generator is already executing.");for(;j;)try{if(g=1,x&&(y=2&E[0]?x.return:E[0]?x.throw||((y=x.return)&&y.call(x),0):x.next)&&!(y=y.call(x,E[1])).done)return y;switch(x=0,y&&(E=[2&E[0],y.value]),E[0]){case 0:case 1:y=E;break;case 4:return j.label++,{value:E[1],done:!1};case 5:j.label++,x=E[1],E=[0];continue;case 7:E=j.ops.pop(),j.trys.pop();continue;default:if(y=j.trys,!((y=y.length>0&&y[y.length-1])||E[0]!==6&&E[0]!==2)){j=0;continue}if(E[0]===3&&(!y||E[1]>y[0]&&E[1]<y[3])){j.label=E[1];break}if(E[0]===6&&j.label<y[1]){j.label=y[1],y=E;break}if(y&&j.label<y[2]){j.label=y[2],j.ops.push(E);break}y[2]&&j.ops.pop(),j.trys.pop();continue}E=p.call(h,j)}catch(O){E=[6,O],x=0}finally{g=y=0}if(5&E[0])throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}([k,S])}}},a=Wc;Object.defineProperty(t,"__esModule",{value:!0});var s="browser-tabs-lock-key",o={key:function(h){return n(a,void 0,void 0,function(){return r(this,function(p){throw new Error("Unsupported")})})},getItem:function(h){return n(a,void 0,void 0,function(){return r(this,function(p){throw new Error("Unsupported")})})},clear:function(){return n(a,void 0,void 0,function(){return r(this,function(h){return[2,window.localStorage.clear()]})})},removeItem:function(h){return n(a,void 0,void 0,function(){return r(this,function(p){throw new Error("Unsupported")})})},setItem:function(h,p){return n(a,void 0,void 0,function(){return r(this,function(g){throw new Error("Unsupported")})})},keySync:function(h){return window.localStorage.key(h)},getItemSync:function(h){return window.localStorage.getItem(h)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(h){return window.localStorage.removeItem(h)},setItemSync:function(h,p){return window.localStorage.setItem(h,p)}};function l(h){return new Promise(function(p){return setTimeout(p,h)})}function u(h){for(var p="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",g="",x=0;x<h;x++)g+=p[Math.floor(Math.random()*p.length)];return g}var d=function(){function h(p){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=p,h.waiters===void 0&&(h.waiters=[])}return h.prototype.acquireLock=function(p,g){return g===void 0&&(g=5e3),n(this,void 0,void 0,function(){var x,y,w,j,N,k,S;return r(this,function(E){switch(E.label){case 0:x=Date.now()+u(4),y=Date.now()+g,w=s+"-"+p,j=this.storageHandler===void 0?o:this.storageHandler,E.label=1;case 1:return Date.now()<y?[4,l(30)]:[3,8];case 2:return E.sent(),j.getItemSync(w)!==null?[3,5]:(N=this.id+"-"+p+"-"+x,[4,l(Math.floor(25*Math.random()))]);case 3:return E.sent(),j.setItemSync(w,JSON.stringify({id:this.id,iat:x,timeoutKey:N,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,l(30)];case 4:return E.sent(),(k=j.getItemSync(w))!==null&&(S=JSON.parse(k)).id===this.id&&S.iat===x?(this.acquiredIatSet.add(x),this.refreshLockWhileAcquired(w,x),[2,!0]):[3,7];case 5:return h.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(y)];case 6:E.sent(),E.label=7;case 7:return x=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},h.prototype.refreshLockWhileAcquired=function(p,g){return n(this,void 0,void 0,function(){var x=this;return r(this,function(y){return setTimeout(function(){return n(x,void 0,void 0,function(){var w,j,N;return r(this,function(k){switch(k.label){case 0:return[4,Bc.default().lock(g)];case 1:return k.sent(),this.acquiredIatSet.has(g)?(w=this.storageHandler===void 0?o:this.storageHandler,(j=w.getItemSync(p))===null?(Bc.default().unlock(g),[2]):((N=JSON.parse(j)).timeRefreshed=Date.now(),w.setItemSync(p,JSON.stringify(N)),Bc.default().unlock(g),this.refreshLockWhileAcquired(p,g),[2])):(Bc.default().unlock(g),[2])}})})},1e3),[2]})})},h.prototype.waitForSomethingToChange=function(p){return n(this,void 0,void 0,function(){return r(this,function(g){switch(g.label){case 0:return[4,new Promise(function(x){var y=!1,w=Date.now(),j=!1;function N(){if(j||(window.removeEventListener("storage",N),h.removeFromWaiting(N),clearTimeout(k),j=!0),!y){y=!0;var S=50-(Date.now()-w);S>0?setTimeout(x,S):x(null)}}window.addEventListener("storage",N),h.addToWaiting(N);var k=setTimeout(N,Math.max(0,p-Date.now()))})];case 1:return g.sent(),[2]}})})},h.addToWaiting=function(p){this.removeFromWaiting(p),h.waiters!==void 0&&h.waiters.push(p)},h.removeFromWaiting=function(p){h.waiters!==void 0&&(h.waiters=h.waiters.filter(function(g){return g!==p}))},h.notifyWaiters=function(){h.waiters!==void 0&&h.waiters.slice().forEach(function(p){return p()})},h.prototype.releaseLock=function(p){return n(this,void 0,void 0,function(){return r(this,function(g){switch(g.label){case 0:return[4,this.releaseLock__private__(p)];case 1:return[2,g.sent()]}})})},h.prototype.releaseLock__private__=function(p){return n(this,void 0,void 0,function(){var g,x,y,w;return r(this,function(j){switch(j.label){case 0:return g=this.storageHandler===void 0?o:this.storageHandler,x=s+"-"+p,(y=g.getItemSync(x))===null?[2]:(w=JSON.parse(y)).id!==this.id?[3,2]:[4,Bc.default().lock(w.iat)];case 1:j.sent(),this.acquiredIatSet.delete(w.iat),g.removeItemSync(x),Bc.default().unlock(w.iat),h.notifyWaiters(),j.label=2;case 2:return[2]}})})},h.lockCorrector=function(p){for(var g=Date.now()-5e3,x=p,y=[],w=0;;){var j=x.keySync(w);if(j===null)break;y.push(j),w++}for(var N=!1,k=0;k<y.length;k++){var S=y[k];if(S.includes(s)){var E=x.getItemSync(S);if(E!==null){var O=JSON.parse(E);(O.timeRefreshed===void 0&&O.timeAcquired<g||O.timeRefreshed!==void 0&&O.timeRefreshed<g)&&(x.removeItemSync(S),N=!0)}}}N&&h.notifyWaiters()},h.waiters=void 0,h}();t.default=d}
52));const Sae={timeoutInSeconds:60},eB={name:"auth0-spa-js",version:"2.1.3"},tB=()=>Date.now();let Ua=class nS extends Error{constructor(t,n){super(n),this.error=t,this.error_description=n,Object.setPrototypeOf(this,nS.prototype)}static fromPayload({error:t,error_description:n}){return new nS(t,n)}},Cae=class nB extends Ua{constructor(t,n,r,a=null){super(t,n),this.state=r,this.appState=a,Object.setPrototypeOf(this,nB.prototype)}},rS=class rB extends Ua{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,rB.prototype)}},Eae=class aB extends rS{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,aB.prototype)}},Oae=class sB extends Ua{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,sB.prototype)}},Aae=class iB extends Ua{constructor(t,n,r){super(t,n),this.mfa_token=r,Object.setPrototypeOf(this,iB.prototype)}},oB=class lB extends Ua{constructor(t,n){super("missing_refresh_token",`Missing Refresh Token (audience: '${xD(t,["default"])}', scope: '${xD(n)}')`),this.audience=t,this.scope=n,Object.setPrototypeOf(this,lB.prototype)}};function xD(e,t=[]){return e&&!t.includes(e)?e:""}const I0=()=>window.crypto,C_=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(I0().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%e.length]),t},bD=e=>btoa(e),aS=e=>{var{clientId:t}=e,n=mi(e,["clientId"]);return new URLSearchParams((r=>Object.keys(r).filter(a=>r[a]!==void 0).reduce((a,s)=>Object.assign(Object.assign({},a),{[s]:r[s]}),{}))(Object.assign({client_id:t},n))).toString()},yD=e=>(t=>decodeURIComponent(atob(t).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),Tae=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json()}},Pae=async(e,t,n)=>{const r=new AbortController;let a;return t.signal=r.signal,Promise.race([Tae(e,t),new Promise((s,o)=>{a=setTimeout(()=>{r.abort(),o(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(a)})},Rae=async(e,t,n,r,a,s,o)=>{return l={auth:{audience:t,scope:n},timeout:a,fetchUrl:e,fetchOptions:r,useFormData:o},u=s,new Promise(function(d,h){const p=new MessageChannel;p.port1.onmessage=function(g){g.data.error?h(new Error(g.data.error)):d(g.data),p.port1.close()},u.postMessage(l,[p.port2])});var l,u},Mae=async(e,t,n,r,a,s,o=1e4)=>a?Rae(e,t,n,r,o,a,s):Pae(e,r,o);async function Dae(e,t){var{baseUrl:n,timeout:r,audience:a,scope:s,auth0Client:o,useFormData:l}=e,u=mi(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const d=l?aS(u):JSON.stringify(u);return await async function(h,p,g,x,y,w,j){let N,k=null;for(let M=0;M<3;M++)try{N=await Mae(h,g,x,y,w,j,p),k=null;break}catch(D){k=D}if(k)throw k;const S=N.json,{error:E,error_description:O}=S,T=mi(S,["error","error_description"]),{ok:P}=N;if(!P){const M=O||`HTTP error. Unable to fetch ${h}`;throw E==="mfa_required"?new Aae(E,M,T.mfa_token):E==="missing_refresh_token"?new oB(g,x):new Ua(E||"request_error",M)}return T}(`${n}/oauth/token`,r,a||"default",s,{method:"POST",body:d,headers:{"Content-Type":l?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||eB))}},t,l)}const kb=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let Xc=class sS{constructor(t,n="@@auth0spajs@@",r){this.prefix=n,this.suffix=r,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[n,r,a,s]=t.split("::");return new sS({clientId:r,scope:s,audience:a},n)}static fromCacheEntry(t){const{scope:n,audience:r,client_id:a}=t;return new sS({scope:n,audience:r,clientId:a})}},$ae=class{set(t,n){localStorage.setItem(t,JSON.stringify(n))}get(t){const n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}},cB=class{constructor(){this.enclosedCache=function(){let t={};return{set(n,r){t[n]=r},get(n){const r=t[n];if(r)return r},remove(n){delete t[n]},allKeys:()=>Object.keys(t)}}()}},Iae=class{constructor(t,n,r){this.cache=t,this.keyManifest=n,this.nowProvider=r||tB}async setIdToken(t,n,r){var a;const s=this.getIdTokenCacheKey(t);await this.cache.set(s,{id_token:n,decodedToken:r}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(s))}async getIdToken(t){const n=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!n&&t.scope&&t.audience){const r=await this.get(t);return!r||!r.id_token||!r.decodedToken?void 0:{id_token:r.id_token,decodedToken:r.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(t,n=0){var r;let a=await this.cache.get(t.toKey());if(!a){const l=await this.getCacheKeys();if(!l)return;const u=this.matchExistingCacheKey(t,l);u&&(a=await this.cache.get(u))}if(!a)return;const s=await this.nowProvider(),o=Math.floor(s/1e3);return a.expiresAt-n<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((r=this.keyManifest)===null||r===void 0?void 0:r.remove(t.toKey()))):a.body}async set(t){var n;const r=new Xc({clientId:t.client_id,scope:t.scope,audience:t.audie
vendor: 10,831 bytes, lines 52-53
52nce}),a=await this.wrapCacheEntry(t);await this.cache.set(r.toKey(),a),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(r.toKey()))}async clear(t){var n;const r=await this.getCacheKeys();r&&(await r.filter(a=>!t||a.includes(t)).reduce(async(a,s)=>{await a,await this.cache.remove(s)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(t){const n=await this.nowProvider();return{body:t,expiresAt:Math.floor(n/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new Xc({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,n){return n.filter(r=>{var a;const s=Xc.fromKey(r),o=new Set(s.scope&&s.scope.split(" ")),l=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=s.scope&&l.reduce((d,h)=>d&&o.has(h),!0);return s.prefix==="@@auth0spajs@@"&&s.clientId===t.clientId&&s.audience===t.audience&&u})[0]}},Lae=class{constructor(t,n,r){this.storage=t,this.clientId=n,this.cookieDomain=r,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const Rp=e=>typeof e=="number",Fae=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],zae=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(s=>{const o=s.split("."),[l,u,d]=o;if(o.length!==3||!l||!u||!d)throw new Error("ID token could not be decoded");const h=JSON.parse(yD(u)),p={__raw:s},g={};return Object.keys(h).forEach(x=>{p[x]=h[x],Fae.includes(x)||(g[x]=h[x])}),{encoded:{header:l,payload:u,signature:d},header:JSON.parse(yD(l)),claims:p,user:g}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!Rp(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!Rp(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Rp(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,r=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(t.claims.exp+n),r>a)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${a})`);if(t.claims.nbf!=null&&Rp(t.claims.nbf)){const s=new Date(0);if(s.setUTCSeconds(t.claims.nbf-n),r<s)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${r}) is before ${s}`)}if(t.claims.auth_time!=null&&Rp(t.claims.auth_time)){const s=new Date(0);if(s.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),r>s)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${s}`)}if(e.organization){const s=e.organization.trim();if(s.startsWith("org_")){const o=s;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=s.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var Qc=KE(function(e,t){var n=Wc&&Wc.__assign||function(){return n=Object.assign||function(u){for(var d,h=1,p=arguments.length;h<p;h++)for(var g in d=arguments[h])Object.prototype.hasOwnProperty.call(d,g)&&(u[g]=d[g]);return u},n.apply(this,arguments)};function r(u,d){if(!d)return"";var h="; "+u;return d===!0?h:h+"="+d}function a(u,d,h){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(d).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(p){if(typeof p.expires=="number"){var g=new Date;g.setMilliseconds(g.getMilliseconds()+864e5*p.expires),p.expires=g}return r("Expires",p.expires?p.expires.toUTCString():"")+r("Domain",p.domain)+r("Path",p.path)+r("Secure",p.secure)+r("SameSite",p.sameSite)}(h)}function s(u){for(var d={},h=u?u.split("; "):[],p=/(%[\dA-F]{2})+/gi,g=0;g<h.length;g++){var x=h[g].split("="),y=x.slice(1).join("=");y.charAt(0)==='"'&&(y=y.slice(1,-1));try{d[x[0].replace(p,decodeURIComponent)]=y.replace(p,decodeURIComponent)}catch{}}return d}function o(){return s(document.cookie)}function l(u,d,h){document.cookie=a(u,d,n({path:"/"},h))}t.__esModule=!0,t.encode=a,t.parse=s,t.getAll=o,t.get=function(u){return o()[u]},t.set=l,t.remove=function(u,d){l(u,"",n(n({},d),{expires:-1}))}});HE(Qc),Qc.encode,Qc.parse,Qc.getAll;var Bae=Qc.get,uB=Qc.set,dB=Qc.remove;const of={get(e){const t=Bae(e);if(t!==void 0)return JSON.parse(t)},save(e,t,n){let r={};window.location.protocol==="https:"&&(r={secure:!0,sameSite:"none"}),n?.daysUntilExpire&&(r.expires=n.daysUntilExpire),n?.cookieDomain&&(r.domain=n.cookieDomain),uB(e,JSON.stringify(t),r)},remove(e,t){let n={};t?.cookieDomain&&(n.domain=t.cookieDomain),dB(e,n)}},Uae={get(e){return of.get(e)||of.get(`_legacy_${e}`)},save(e,t,n){let r={};window.location.protocol==="https:"&&(r={secure:!0}),n?.daysUntilExpire&&(r.expires=n.daysUntilExpire),n?.cookieDomain&&(r.domain=n.cookieDomain),uB(`_legacy_${e}`,JSON.stringify(t),r),of.save(e,t,n)},remove(e,t){let n={};t?.cookieDomain&&(n.domain=t.cookieDomain),dB(e,n),of.remove(e,t),of.remove(`_legacy_${e}`,t)}},qae={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};function Hae(e,t,n){var r=t===void 0?null:t,a=function(u,d){var h=atob(u);if(d){for(var p=new Uint8Array(h.length),g=0,x=h.length;g<x;++g)p[g]=h.charCodeAt(g);return String.fromCharCode.apply(null,new Uint16Array(p.buffer))}return h}(e,n!==void 0&&n),s=a.indexOf(` 53`,10)+1,o=a.substring(s)+(r?"//# sourceMappingURL="+r:""),l=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(l)}var vD,wD,jD,E_,Kae=(vD="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fS
53xjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",wD=null,jD=!1,function(e){return E_=E_||Hae(vD,wD,jD),new Worker(E_,e)});const O_={};let Vae=class{constructor(t,n){this.cache=t,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var n;const r=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);r.add(t),await this.cache.set(this.manifestKey,{keys:[...r]})}async remove(t){const n=await this.cache.get(this.manifestKey);if(n){const r=new Set(n.keys);return r.delete(t),r.size>0?await this.cache.set(this.manifestKey,{keys:[...r]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return`@@auth0spajs@@::${t}`}};const Gae={memory:()=>new cB().enclosedCache,localstorage:()=>new $ae},ND=e=>Gae[e],_D=e=>{const{openUrl:t,onRedirect:n}=e,r=mi(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:t===!1||t?t:n})},A_=new kae;let Wae=class{constructor(t){let n,r;if(this.userCache=new cB().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await A_.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!I0())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(I0().subtle===void 0)throw new Error(` 54 auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information. 55 `)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)r=t.cache;else{if(n=t.cacheLocation||"memory",!ND(n))throw new Error(`Invalid cache location "${n}"`);r=ND(n)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?of:Uae,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:qae;var s;this.scope=kb("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Lae(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||tB,this.cacheManager=new Iae(r,r.allKeys?void 0:new Vae(r,this.options.clientId),this.nowProvider),this.domainUrl=(s=this.options.domain,/^https?:\/\//.test(s)?s:`https://${s}`),this.tokenIssuer=((o,l)=>o?o.startsWith("https://")?o:`https://${o}/`:`${l}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Kae)}_url(t){const n=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||eB)));return`${this.domainUrl}${t}&auth0Client=${n}`}_authorizeUrl(t){return this._url(`/authorize?${aS(t)}`)}async _verifyIdToken(t,n,r){const a=await this.nowProvider();return zae({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,organization:r,leeway:this.options.leeway,max_age:(s=this.options.authorizationParams.max_age,typeof s!="str
55ing"?s:parseInt(s,10)||void 0),now:a});var s}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,n,r){const a=bD(C_()),s=bD(C_()),o=C_(),l=(h=>{const p=new Uint8Array(h);return(g=>{const x={"+":"-","/":"_","=":""};return g.replace(/[+/=]/g,y=>x[y])})(window.btoa(String.fromCharCode(...Array.from(p))))})(await(async h=>await I0().subtle.digest({name:"SHA-256"},new TextEncoder().encode(h)))(o)),u=((h,p,g,x,y,w,j,N)=>Object.assign(Object.assign(Object.assign({client_id:h.clientId},h.authorizationParams),g),{scope:kb(p,g.scope),response_type:"code",response_mode:N||"query",state:x,nonce:y,redirect_uri:j||h.authorizationParams.redirect_uri,code_challenge:w,code_challenge_method:"S256"}))(this.options,this.scope,t,a,s,l,t.redirect_uri||this.options.authorizationParams.redirect_uri||r,n?.response_mode),d=this._authorizeUrl(u);return{nonce:s,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:d}}async loginWithPopup(t,n){var r;if(t=t||{},!(n=n||{}).popup&&(n.popup=(l=>{const u=window.screenX+(window.innerWidth-400)/2,d=window.screenY+(window.innerHeight-600)/2;return window.open(l,"auth0:authorize:popup",`left=${u},top=${d},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!n.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);n.popup.location.href=a.url;const s=await(l=>new Promise((u,d)=>{let h;const p=setInterval(()=>{l.popup&&l.popup.closed&&(clearInterval(p),clearTimeout(g),window.removeEventListener("message",h,!1),d(new Oae(l.popup)))},1e3),g=setTimeout(()=>{clearInterval(p),d(new Eae(l.popup)),window.removeEventListener("message",h,!1)},1e3*(l.timeoutInSeconds||60));h=function(x){if(x.data&&x.data.type==="authorization_response"){if(clearTimeout(g),clearInterval(p),window.removeEventListener("message",h,!1),l.popup.close(),x.data.response.error)return d(Ua.fromPayload(x.data.response));u(x.data.response)}},window.addEventListener("message",h)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==s.state)throw new Ua("state_mismatch","Invalid state");const o=((r=t.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:s.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n?.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var n;const r=_D(t),{openUrl:a,fragment:s,appState:o}=r,l=mi(r,["openUrl","fragment","appState"]),u=((n=l.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization,d=await this._prepareAuthorizeUrl(l.authorizationParams||{}),{url:h}=d,p=mi(d,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},p),{appState:o}),u&&{organization:u}));const g=s?`${h}#${s}`:h;a?await a(g):window.location.assign(g)}async handleRedirectCallback(t=window.location.href){const n=t.split("?").slice(1);if(n.length===0)throw new Error("There are no query params available for parsing.");const{state:r,code:a,error:s,error_description:o}=(p=>{p.indexOf("#")>-1&&(p=p.substring(0,p.indexOf("#")));const g=new URLSearchParams(p);return{state:g.get("state"),code:g.get("code")||void 0,error:g.get("error")||void 0,error_description:g.get("error_description")||void 0}})(n.join("")),l=this.transactionManager.get();if(!l)throw new Ua("missing_transaction","Invalid state");if(this.transactionManager.remove(),s)throw new Cae(s,o||s,r,l.appState);if(!l.code_verifier||l.state&&l.state!==r)throw new Ua("state_mismatch","Invalid state");
55const u=l.organization,d=l.nonce,h=l.redirect_uri;return await this._requestToken(Object.assign({audience:l.audience,scope:l.scope,code_verifier:l.code_verifier,grant_type:"authorization_code",code:a},h?{redirect_uri:h}:{}),{nonceIn:d,organization:u}),{appState:l.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var n;const r=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:kb(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})}),a=await((s,o)=>{let l=O_[o];return l||(l=s().finally(()=>{delete O_[o],l=null}),O_[o]=l),l})(()=>this._getTokenSilently(r),`${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);return t.detailedResponse?a:a?.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,r=mi(t,["cacheMode"]);if(n!=="off"){const a=await this._getEntryFromCache({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(n!=="cache-only"){if(!await(async(a,s=3)=>{for(let o=0;o<s;o++)if(await a())return!0;return!1})(()=>A_.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new rS;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),n!=="off"){const d=await this._getEntryFromCache({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId});if(d)return d}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(r):await this._getTokenFromIFrame(r),{id_token:s,access_token:o,oauthTokenScope:l,expires_in:u}=a;return Object.assign(Object.assign({id_token:s,access_token:o},l?{scope:l}:null),{expires_in:u})}finally{await A_.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},n={}){var r;const a=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:kb(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})});return n=Object.assign(Object.assign({},Sae),n),await this.loginWithPopup(a,n),(await this.cacheManager.get(new Xc({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:r}=n,a=mi(n,["federated"]),s=r?"&federated":"";return this._url(`/v2/logout?${aS(Object.assign({clientId:t.clientId},a))}`)+s}async logout(t={}){const n=_D(t),{openUrl:r}=n,a=mi(n,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const s=this._buildLogoutUrl(a);r?await r(s):r!==!1&&window.location.assign(s)}async _getTokenFromIFrame(t){const n=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),r=this.cookieStorage.get(this.orgHintCookieName);r&&!n.organization&&(n.organization=r);const{url:a,state:s,nonce:o,code_verifier:l,redirect_uri:u,scope:d,audience:h}=await this._prepareAuthorizeUrl(n,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ua("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const p=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,g=await((y,w,j=60)=>new Promise((N,k)=>{const S=window.document.createElement("iframe");S.setAttribute("width","0"),S.setAttribute("height","0"),S.style.display="none";const E=()=>{window.document.body.contains(S)&&(window.document.body.removeChild(S),window.removeEventListener("message",O,!1))};let O;const T=setTimeout(()=>{k(new rS),E()},1e3*j);O=function(P){if(P.origin!=w||!P.data||P.data.type!=="authorization_response")return;const M=P.source;M&&M.close(),P.data.response.error?k(Ua.fromPayload(P.data.response)):N(P.data.response),clearTimeout(T),window.removeEventListener("message",O,!1),setTimeout(E,2e3)},window.addEventListener("message",O,!1),window.document.body.appendChild(S),S.setAttribute("src",y)}))(a,this.domainUrl,p);if(s!==g.state)throw new Ua("state_mismatch","Invalid state");const x=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:l,code:g.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:n.organization});return Object.assign(Object.assign({},x),{scope:d,oauthTokenScope:x.scope,audience:h})}catch(p){throw p.error==="login_required"&&this.logout({openUrl:!1}),p}}async _getTokenUsingRefreshToken(t){const n=await this.cacheManager.get(new Xc({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(n&&n.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new oB(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const r=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const s=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:r}),a&&{timeout:a}));return Object.assign(Object.assign({},s),{scope:t.authorizationParams.scope,oauthTokenScope:s.scope,audience:t.authorizationParams.audience||"default"})}catch(s){if((s.message.indexOf("Missing Refresh Token")>-1||s.message&&s.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw s}}async _saveEntryInCache(t){const{id_token:n,decodedToken:r}=t,a=mi(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:r}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",n=await this.cacheManager.getIdToken(new Xc({clientId:this.options.clientId,audience:t,scope:this.scope}
55)),r=this.userCache.get("@@user@@");return n&&n.id_token===r?.id_token?r:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:t,audience:n,clientId:r}){const a=await this.cacheManager.get(new Xc({scope:t,audience:n,clientId:r}),60);if(a&&a.access_token){const{access_token:s,oauthTokenScope:o,expires_in:l}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:s},o?{scope:o}:null),{expires_in:l})}}async _requestToken(t,n){const{nonceIn:r,organization:a}=n||{},s=await Dae(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),o=await this._verifyIdToken(s.id_token,r,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},s),{decodedToken:o,scope:t.scope,audience:t.audience||"default"}),s.scope?{oauthTokenScope:s.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},s),{decodedToken:o})}};var fB={isAuthenticated:!1,isLoading:!0},so=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},Yae=hr(hr({},fB),{buildAuthorizeUrl:so,buildLogoutUrl:so,getAccessTokenSilently:so,getAccessTokenWithPopup:so,getIdTokenClaims:so,loginWithRedirect:so,loginWithPopup:so,logout:so,handleRedirectCallback:so}),hB=v.createContext(Yae),kD=function(e){Nae(t,e);function t(n,r){var a=e.call(this,r||n)||this;return a.error=n,a.error_description=r,Object.setPrototypeOf(a,t.prototype),a}return t}(Error),Xae=/[?&]code=[^&]+/,Qae=/[?&]state=[^&]+/,Zae=/[?&]error=[^&]+/,Jae=function(e){return e===void 0&&(e=window.location.search),(Xae.test(e)||Zae.test(e))&&Qae.test(e)},pB=function(e){return function(t){return t instanceof Error?t:t!==null&&typeof t=="object"&&"error"in t&&typeof t.error=="string"?"error_description"in t&&typeof t.error_description=="string"?new kD(t.error,t.error_description):new kD(t.error):new Error(e)}},SD=pB("Login failed"),T_=pB("Get access token failed"),mB=function(e){var t;e?.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),e.authorizationParams=e.authorizationParams||{},e.authorizationParams.redirect_uri=e.redirectUri,delete e.redirectUri),!((t=e?.authorizationParams)===null||t===void 0)&&t.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),e.authorizationParams.redirect_uri=e.authorizationParams.redirectUri,delete e.authorizationParams.redirectUri)},ese=function(e,t){switch(t.type){case"LOGIN_POPUP_STARTED":return hr(hr({},e),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return hr(hr({},e),{isAuthenticated:!!t.user,user:t.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return e.user===t.user?e:hr(hr({},e),{isAuthenticated:!!t.user,user:t.user});case"LOGOUT":return hr(hr({},e),{isAuthenticated:!1,user:void 0});case"ERROR":return hr(hr({},e),{isLoading:!1,error:t.error})}},tse=function(e){return mB(e),hr(hr({},e),{auth0Client:{name:"auth0-react",version:"2.3.0"}})},nse=function(e){window.history.replaceState({},document.title,e?.returnTo||window.location.pathname)},rse=function(e){var t=e.children,n=e.skipRedirectCallback,r=e.onRedirectCallback,a=r===void 0?nse:r,s=e.context,o=s===void 0?hB:s,l=_ae(e,["children","skipRedirectCallback","onRedirectCallback","context"]),u=v.useState(function(){return new Wae(tse(l))})[0],d=v.useReducer(ese,fB),h=d[0],p=d[1],g=v.useRef(!1),x=v.useCallback(function(T){return p({type:"ERROR",error:T}),T},[]);v.useEffect(function(){g.current||(g.current=!0,function(){return Fd(void 0,void 0,void 0,function(){var T,P,M;return zd(this,function(D){switch(D.label){case 0:return D.trys.push([0,7,,8]),T=void 0,Jae()&&!n?[4,u.handleRedirectCallback()]:[3,3];case 1:return P=D.sent().appState,[4,u.getUser()];case 2:return T=D.sent(),a(P,T),[3,6];case 3:return[4,u.checkSession()];case 4:return D.sent(),[4,u.getUser()];case 5:T=D.sent(),D.label=6;case 6:return p({type:"INITIALISED",user:T}),[3,8];case 7:return M=D.sent(),x(SD(M)),[3,8];case 8:return[2]}})})}())},[u,a,n,x]);var y=v.useCallback(function(T){return mB(T),u.loginWithRedirect(T)},[u]),w=v.useCallback(function(T,P){return Fd(void 0,void 0,void 0,function(){var M,D;return zd(this,function(A){switch(A.label){case 0:p({type:"LOGIN_POPUP_STARTED"}),A.label=1;case 1:return A.trys.push([1,3,,4]),[4,u.loginWithPopup(T,P)];
55case 2:return A.sent(),[3,4];case 3:return M=A.sent(),x(SD(M)),[2];case 4:return[4,u.getUser()];case 5:return D=A.sent(),p({type:"LOGIN_POPUP_COMPLETE",user:D}),[2]}})})},[u]),j=v.useCallback(function(T){return T===void 0&&(T={}),Fd(void 0,void 0,void 0,function(){return zd(this,function(P){switch(P.label){case 0:return[4,u.logout(T)];case 1:return P.sent(),(T.openUrl||T.openUrl===!1)&&p({type:"LOGOUT"}),[2]}})})},[u]),N=v.useCallback(function(T){return Fd(void 0,void 0,void 0,function(){var P,M,D,A;return zd(this,function(L){switch(L.label){case 0:return L.trys.push([0,2,3,5]),[4,u.getTokenSilently(T)];case 1:return P=L.sent(),[3,5];case 2:throw M=L.sent(),T_(M);case 3:return D=p,A={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,u.getUser()];case 4:return D.apply(void 0,[(A.user=L.sent(),A)]),[7];case 5:return[2,P]}})})},[u]),k=v.useCallback(function(T,P){return Fd(void 0,void 0,void 0,function(){var M,D,A,L;return zd(this,function(F){switch(F.label){case 0:return F.trys.push([0,2,3,5]),[4,u.getTokenWithPopup(T,P)];case 1:return M=F.sent(),[3,5];case 2:throw D=F.sent(),T_(D);case 3:return A=p,L={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,u.getUser()];case 4:return A.apply(void 0,[(L.user=F.sent(),L)]),[7];case 5:return[2,M]}})})},[u]),S=v.useCallback(function(){return u.getIdTokenClaims()},[u]),E=v.useCallback(function(T){return Fd(void 0,void 0,void 0,function(){var P,M,D;return zd(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,3,5]),[4,u.handleRedirectCallback(T)];case 1:return[2,A.sent()];case 2:throw P=A.sent(),T_(P);case 3:return M=p,D={type:"HANDLE_REDIRECT_COMPLETE"},[4,u.getUser()];case 4:return M.apply(void 0,[(D.user=A.sent(),D)]),[7];case 5:return[2]}})})},[u]),O=v.useMemo(function(){return hr(hr({},h),{getAccessTokenSilently:N,getAccessTokenWithPopup:k,getIdTokenClaims:S,loginWithRedirect:y,loginWithPopup:w,logout:j,handleRedirectCallback:E})},[h,N,k,S,y,w,j,E]);return ve.createElement(o.Provider,{value:O},t)},ns=function(e){return e===void 0&&(e=hB),v.useContext(e)};function ase(e={}){const{nonce:t,onScriptLoadSuccess:n,onScriptLoadError:r}=e,[a,s]=v.useState(!1),o=v.useRef(n);o.current=n;const l=v.useRef(r);return l.current=r,v.useEffect(()=>{const u=document.createElement("script");return u.src="https://accounts.google.com/gsi/client",u.async=!0,u.defer=!0,u.nonce=t,u.onload=()=>{var d;s(!0),(d=o.current)===null||d===void 0||d.call(o)},u.onerror=()=>{var d;s(!1),(d=l.current)===null||d===void 0||d.call(l)},document.body.appendChild(u),()=>{document.body.removeChild(u)}},[t]),a}const gB=v.createContext(null);function sse({clientId:e,nonce:t,onScriptLoadSuccess:n,onScriptLoadError:r,children:a}){const s=ase({nonce:t,onScriptLoadSuccess:n,onScriptLoadError:r}),o=v.useMemo(()=>({clientId:e,scriptLoadedSuccessfully:s}),[e,s]);return ve.createElement(gB.Provider,{value:o},a)}function ise(){const e=v.useContext(gB);if(!e)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return e}function ose({flow:e="implicit",scope:t="",onSuccess:n,onError:r,onNonOAuthError:a,overrideScope:s,state:o,...l}){const{clientId:u,scriptLoadedSuccessfully:d}=ise(),h=v.useRef(),p=v.useRef(n);p.current=n;const g=v.useRef(r);g.current=r;const x=v.useRef(a);x.current=a,v.useEffect(()=>{var j,N;if(!d)return;const k=e==="implicit"?"initTokenClient":"initCodeClient",S=(N=(j=window?.google)===null||j===void 0?void 0:j.accounts)===null||N===void 0?void 0:N.oauth2[k]({client_id:u,scope:s?t:`openid profile email ${t}`,callback:E=>{var O,T;if(E.error)return(O=g.current)===null||O===void 0?void 0:O.call(g,E);(T=p.current)===null||T===void 0||T.call(p,E)},error_callback:E=>{var O;(O=x.current)===null||O===void 0||O.call(x,E)},state:o,...l});h.current=S},[u,d,e,t,o]);const y=v.useCallback(j=>{var N;return(N=h.current)===null||N===void 0?void 0:N.requestAccessToken(j)},[]),w=v.useCallback(()=>{var j;return(j=h.current)===null||j===void 0?void 0:j.requestCode()},[]);return e==="implicit"?y:w}var oh=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},wu=typeof window>"u"||"Deno"in globalThis;function Xr(){}function lse(e,t){return typeof e=="function"?e(t):e}function iS(e){return typeof e=="number"&&e>=0&&e!==1/0}function xB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ll(e,t){return typeof e=="function"?e(t):e}function Ks(e,t){return typeof e=="function"?e(t):e}function CD(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:s,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==VE(o,t.options))return!1}else if(!Mm(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||s&&!s(t))}function ED(e,t){const{exact:n,status:r,predicate:a,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(ju(t.options.mutationKey)!==ju(s))return!1}else if(!Mm(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function VE(e,t){return(t?.queryKeyHashFn||ju)(e)}function ju(e){return JSON.stringify(e,(t,n)=>oS(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Mm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Mm(e[n],t[n])):!1}function bB(e,t){if(e===t)return e;const n=OD(e)&&OD(t);if(n||oS(e)&&oS(t)){const r=n?e:Object.keys(e),a=r.length,s=n?t:Object.keys(t),o=s.length,l=n?[]:{},u=new Set(r);let d=0;for(let h=0;h<o;h++){const p=n?h:s[h];(!n&&u.has(p)||n)&&e[p]===void 0&&t[p]===void 0?(l[p]=void 0,d++):(l[p]=bB(e[p],t[p]),l[p]===e[p]&&e[p]!==void 0&&d++)}return a===o&&d===a?e:l}return t}function cy(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function OD(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function oS(e){if(!AD(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;
55return!(!AD(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function AD(e){return Object.prototype.toString.call(e)==="[object Object]"}function cse(e){return new Promise(t=>{setTimeout(t,e)})}function lS(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bB(e,t):t}function TD(e){return e}function use(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dse(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var GE=Symbol();function yB(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===GE?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function vB(e,t){return typeof e=="function"?e(...t):!!e}var fse=class extends oh{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!wu&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},WE=new fse,hse=class extends oh{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!wu&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},uy=new hse;function cS(){let e,t;const n=new Promise((a,s)=>{e=a,t=s});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}function pse(e){return Math.min(1e3*2**e,3e4)}function wB(e){return(e??"online")==="online"?uy.isOnline():!0}var jB=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function P_(e){return e instanceof jB}function NB(e){let t=!1,n=0,r=!1,a;const s=cS(),o=w=>{r||(g(new jB(w)),e.abort?.())},l=()=>{t=!0},u=()=>{t=!1},d=()=>WE.isFocused()&&(e.networkMode==="always"||uy.isOnline())&&e.canRun(),h=()=>wB(e.networkMode)&&e.canRun(),p=w=>{r||(r=!0,e.onSuccess?.(w),a?.(),s.resolve(w))},g=w=>{r||(r=!0,e.onError?.(w),a?.(),s.reject(w))},x=()=>new Promise(w=>{a=j=>{(r||d())&&w(j)},e.onPause?.()}).then(()=>{a=void 0,r||e.onContinue?.()}),y=()=>{if(r)return;let w;const j=n===0?e.initialPromise:void 0;try{w=j??e.fn()}catch(N){w=Promise.reject(N)}Promise.resolve(w).then(p).catch(N=>{if(r)return;const k=e.retry??(wu?0:3),S=e.retryDelay??pse,E=typeof S=="function"?S(n,N):S,O=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,N);if(t||!O){g(N);return}n++,e.onFail?.(n,N),cse(E).then(()=>d()?void 0:x()).then(()=>{t?g(N):y()})})};return{promise:s,cancel:o,continue:()=>(a?.(),s),cancelRetry:l,continueRetry:u,canStart:h,start:()=>(h()?y():x().then(y),s)}}var mse=e=>setTimeout(e,0);function gse(){let e=[],t=0,n=l=>{l()},r=l=>{l()},a=mse;const s=l=>{t?e.push(l):a(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||o()}return u},batchCalls:l=>(...u)=>{s(()=>{l(...u)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{a=l}}}var rr=gse(),_B=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iS(this.gcTime)&&(this.#t=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wu?1/0:5*60*1e3))}clearGcTimeout(){this.#t&&(clearTimeout(this.#t),this.#t=void 0)}},xse=class extends _B{#t;#e;#n;#r;#a;#i;#o;constructor(e){super(),this.#o=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=bse(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=lS(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#a?.promise;
55return this.#a?.cancel(e),t?t.then(Xr).catch(Xr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Ks(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===GE||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ll(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!xB(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#o?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(d=>d.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,r=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},a=()=>{const u=yB(this.options,t),h=(()=>{const p={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(u,h,this):u(h)},o=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:a};return r(u),u})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta});const l=u=>{P_(u)&&u.silent||this.#s({type:"error",error:u}),P_(u)||(this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this)),this.scheduleGc()};return this.#a=NB({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:u=>{if(u===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(d){l(d);return}this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),this.scheduleGc()},onError:l,onFail:(u,d)=>{this.#s({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#a.start()}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...kB(n.data,this.options),fetchMeta:e.meta??null};case"success":return this.#e=void 0,{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return P_(r)&&r.revert&&this.#e?{...this.#e,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),rr.batch(()=>
55{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function kB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function bse(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var yse=class extends oh{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,a=t.queryHash??VE(r,t);let s=this.get(a);return s||(s=new xse({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){rr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>CD(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>CD(e,n)):t}notify(e){rr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){rr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){rr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},vse=class extends _B{#t;#e;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#e=e.mutationCache,this.#t=[],this.state=e.state||SB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})};this.#n=NB({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(a,s)=>{this.#r({type:"failed",failureCount:a,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#e.config.onMutate?.(e,this);const s=await this.options.onMutate?.(e);s!==this.state.context&&this.#r({type:"pending",context:s,variables:e,isPaused:r})}const a=await this.#n.start();return await this.#e.config.onSuccess?.(a,e,this.state.context,this),await this.options.onSuccess?.(a,e,this.state.context),await this.#e.config.onSettled?.(a,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(a,null,e,this.state.context),this.#r({type:"success",data:a}),a}catch(a){try{throw await this.#e.config.onError?.(a,e,this.state.context,this),await this.options.onError?.(a,e,this.state.context),await this.#e.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,a,e,this.state.context),a}finally{this.#r({type:"error",error:a})}}finally{this.#e.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPau
55sed:!1,status:"error"}}};this.state=t(this.state),rr.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#e.notify({mutation:this,type:"updated",action:e})})}};function SB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wse=class extends oh{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const r=new vse({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#t.add(e);const t=Sb(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Sb(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Sb(e);if(typeof t=="string"){const r=this.#e.get(t)?.find(a=>a.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Sb(e);return typeof t=="string"?this.#e.get(t)?.find(r=>
55r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){rr.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ED(t,n))}findAll(e={}){return this.getAll().filter(t=>ED(e,t))}notify(e){rr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return rr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Xr))))}};function Sb(e){return e.options.scope?.id}function PD(e){return{onFetch:(t,n)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let h=!1;const p=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?h=!0:t.signal.addEventListener("abort",()=>{h=!0}),t.signal)})},g=yB(t.options,t.fetchOptions),x=async(y,w,j)=>{if(h)return Promise.reject();if(w==null&&y.pages.length)return Promise.resolve(y);const k=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:w,direction:j?"backward":"forward",meta:t.options.meta};return p(T),T})(),S=await g(k),{maxPages:E}=t.options,O=j?dse:use;return{pages:O(y.pages,S,E),pageParams:O(y.pageParams,w,E)}};if(a&&s.length){const y=a==="backward",w=y?jse:RD,j={pages:s,pageParams:o},N=w(r,j);l=await x(j,N,y)}else{const y=e??s.length;do{const w=u===0?o[0]??r.initialPageParam:RD(r,l);if(u>0&&w==null)break;l=await x(l,w),u++}while(u<y)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function RD(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function jse(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Nse=class{#t;#e;#n;#r;#a;#i;#o;#s;constructor(e={}){this.#t=e.queryCache||new yse,this.#e=e.mutationCache||new wse,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=WE.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=uy.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ll(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#t.get(r.queryHash)?.state.data,o=lse(t,s);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return rr.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;rr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return rr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=rr.batch(()=>this.#t.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Xr).catch(Xr)}invalidateQueries(e,t={}){return rr.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=rr.batch(()=>this.#t.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let s=a.fetch(void 0,n);return n.throwOnError||(s=s.catch(Xr)),a.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Xr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Ll(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Xr).catch(Xr)}fetchInfiniteQuery(e){return e.behavior=PD(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Xr).catch(Xr)}ensureInfiniteQueryData(e){return e.behavior=PD(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return uy.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ju(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Mm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(ju(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{Mm(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=VE(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===GE&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},_se=class extends oh{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=cS(),this.options.experimental_prefetchInRender||this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#r=void 0;#a;#i;#o;#s;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),MD(this.#e,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return uS(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return uS(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#w(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ks(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!cy(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&DD(this.#e,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#e!==n||Ks(this.options.enabled,this.#e)!==Ks(t.enabled,this.#e)||Ll(this.options.staleTime,this.#e)!==Ll(t.staleTime,this.#e))&&this.#g();const a=this.#x();r&&(this.#e!==n||Ks(this.options.enabled,this.#e)!==Ks(t.enabled,this.#e)||a!==this.#l)&&this.#b(a)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return Sse(this,n)&&(this.#r=n,this.#i=this.options,this.#a=this.#e.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Xr)),t}#g(){this.#v();const e=Ll(this.options.staleTime,this.#e);if(wu||this.#r.isStale||!iS(e))return;const n=xB(this.#r.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#x(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#b(e){this.#w(),this.#l=e,!(wu||Ks(this.options.enabled,this.#e)===!1||!iS(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>
55{(this.options.refetchIntervalInBackground||WE.isFocused())&&this.#d()},this.#l))}#y(){this.#g(),this.#b(this.#x())}#v(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,a=this.#r,s=this.#a,o=this.#i,u=e!==n?e.state:this.#n,{state:d}=e;let h={...d},p=!1,g;if(t._optimisticResults){const M=this.hasListeners(),D=!M&&MD(e,t),A=M&&DD(e,n,t,r);(D||A)&&(h={...h,...kB(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:y,status:w}=h;g=h.data;let j=!1;if(t.placeholderData!==void 0&&g===void 0&&w==="pending"){let M;a?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(M=a.data,j=!0):M=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,M!==void 0&&(w="success",g=lS(a?.data,M,t),p=!0)}if(t.select&&g!==void 0&&!j)if(a&&g===s?.data&&t.select===this.#m)g=this.#f;else try{this.#m=t.select,g=t.select(g),g=lS(a?.data,g,t),this.#f=g,this.#s=null}catch(M){this.#s=M}this.#s&&(x=this.#s,g=this.#f,y=Date.now(),w="error");const N=h.fetchStatus==="fetching",k=w==="pending",S=w==="error",E=k&&N,O=g!==void 0,P={status:w,fetchStatus:h.fetchStatus,isPending:k,isSuccess:w==="success",isError:S,isInitialLoading:E,isLoading:E,data:g,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:N,isRefetching:N&&!k,isLoadingError:S&&!O,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:S&&O,isStale:YE(e,t),refetch:this.refetch,promise:this.#o};if(this.options.experimental_prefetchInRender){const M=L=>{P.status==="error"?L.reject(P.error):P.data!==void 0&&L.resolve(P.data)},D=()=>{const L=this.#o=P.promise=cS();M(L)},A=this.#o;switch(A.status){case"pending":e.queryHash===n.queryHash&&M(A);break;case"fulfilled":(P.status==="error"||P.data!==A.value)&&D();break;case"rejected":(P.status!=="error"||P.error!==A.reason)&&D();break}}return P}updateResult(){const e=this.#r,t=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#i=this.options,this.#a.data!==void 0&&(this.#h=this.#e),cy(t,e))return;this.#r=t;const n=()=>
55{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,a=typeof r=="function"?r():r;if(a==="all"||!a&&!this.#p.size)return!0;const s=new Set(a??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#r).some(o=>{const l=o;return this.#r[l]!==e[l]&&s.has(l)})};this.#N({listeners:n()})}#j(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#N(e){rr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function kse(e,t){return Ks(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function MD(e,t){return kse(e,t)||e.state.data!==void 0&&uS(e,t,t.refetchOnMount)}function uS(e,t,n){if(Ks(t.enabled,e)!==!1&&Ll(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&YE(e,t)}return!1}function DD(e,t,n,r){return(e!==t||Ks(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&YE(e,n)}function YE(e,t){return Ks(t.enabled,e)!==!1&&e.isStaleByTime(Ll(t.staleTime,e))}function Sse(e,t){return!cy(e.getCurrentResult(),t)}var Cse=class extends oh{#t;#e=void 0;#n;#r;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),cy(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ju(n.mutationKey)!==ju(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#i(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#a(){const t=this.#n?.state??SB();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){rr.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context;t?.type==="success"?(this.#r.onSuccess?.(t.data,n,r),this.#r.onSettled?.(t.data,null,
55n,r)):t?.type==="error"&&(this.#r.onError?.(t.error,n,r),this.#r.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#e)})})}},CB=v.createContext(void 0),mn=e=>{const t=v.useContext(CB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ese=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(CB.Provider,{value:e,children:t})),EB=v.createContext(!1),Ose=()=>v.useContext(EB);EB.Provider;function Ase(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Tse=v.createContext(Ase()),Pse=()=>v.useContext(Tse),Rse=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Mse=e=>{v.useEffect(()=>{e.clearReset()},[e])},Dse=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||vB(n,[e.error,r])),$se=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ise=(e,t)=>e.isLoading&&e.isFetching&&!t,Lse=(e,t)=>e?.suspense&&t.isPending,$D=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Fse(e,t,n){const r=Ose(),a=Pse(),s=mn(),o=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?"isRestoring":"optimistic",$se(o),Rse(o,a),Mse(a);const l=!s.getQueryCache().get(o.queryHash),[u]=v.useState(()=>new t(s,o)),d=u.getOptimisticResult(o),h=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(p=>{const g=h?u.subscribe(rr.batchCalls(p)):Xr;return u.updateResult(),g},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),v.useEffect(()=>{u.setOptions(o)},[o,u]),Lse(o,d))throw $D(o,u,a);if(Dse({result:d,errorResetBoundary:a,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw d.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!wu&&Ise(d,r)&&(l?$D(o,u,a):s.getQueryCache().get(o.queryHash)?.promise)?.catch(Xr).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function Nt(e,t){return Fse(e,_se)}function Pf(e,t){const n=mn(),[r]=v.useState(()=>new Cse(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const a=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(rr.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,l)=>{r.mutate(o,l).catch(Xr)},[r]);if(a.error&&vB(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:s,mutateAsync:a.mutate}}var le=typeof window<"u"?window:void 0,ha=typeof globalThis<"u"?globalThis:le,OB=Array.prototype,ID=OB.forEach,LD=OB.indexOf,Wa=ha?.navigator,Te=ha?.document,da=ha?.location,dS=ha?.fetch,fS=ha!=null&&ha.XMLHttpRequest&&"withCredentials"in new ha.XMLHttpRequest?ha.XMLHttpRequest:void 0,FD=ha?.AbortController,ca=Wa?.userAgent,Ze=le??{},ho={DEBUG:!1,LIB_VERSION:"1.282.0"};function zD(e,t,n,r,a,s,o){try{var l=e[s](o),u=l.value}catch(d){return void n(d)}l.done?t(u):Promise.resolve(u).then(r,a)}function BD(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var s=e.apply(t,n);function o(u){zD(s,r,a,o,l,"next",u)}function l(u){zD(s,r,a,o,l,"throw",u)}o(void 0)})}}function Ie(){return Ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ie.apply(null,arguments)}function AB(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 zse=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function ut(e,t){return e.indexOf(t)!==-1}var Yv=function(e){return e.trim()},hS=function(e){return e.replace(/^\$/,"")},Bse=Array.isArray,TB=Object.prototype,PB=TB.hasOwnProperty,Xv=TB.toString,sn=Bse||function(e){return Xv.call(e)==="[object Array]"},Fl=e=>typeof e=="function",Ur=e=>e===Object(e)&&!sn(e),uf=e=>{if(Ur(e)){for(var t in e)if(PB.call(e,t))return!1;return!0}return!1},Ae=e=>e===void 0,ar=e=>Xv.call(e)=="[object String]",pS=e=>ar(e)&&e.trim().length===0,zo=e=>e===null,an=e=>Ae(e)||zo(e),Ri=e=>Xv.call(e)=="[object Number]",zl=e=>Xv.call(e)==="[object Boolean]",Use=e=>e instanceof FormData,qse=e=>ut(zse,e);function mS(e){return e===null||typeof e!="object"}function dy(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function RB(e){return!Ae(Event)&&function(t,n){try{return t instanceof n}catch{return!1}}(e,Event)}var Hse=[!0,"true",1,"1","yes"],R_=e=>ut(Hse,e),Kse=[!1,"false",0,"0","no"];function ji(e,t,n,r,a){return t>n&&(r.warn("min cannot be greater than max."),t=n),Ri(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+a),ji(a||n,t,n,r))}class Vse{constructor(t){this.t={},this.i=t.i,this.o=ji(t.bucketSize,0,100,t.h),this.m=ji(t.refillRate,0,this.o,t.h),this.S=ji(t.refillInterval,0,864e5,t.h)}$(t,n){var r=n-t.lastAccess,a=Math.floor(r/this.S);if(a>0){var s=a*this.m;t.tokens=Math.min(t.tokens+s,this.o),t.lastAccess=t.lastAccess+a*this.S}}consumeRateLimit(t){var n,r=Date.now(),a=String(t),s=this.t[a];return s?this.$(s,r):(s={tokens:this.o,lastAccess:r},this.t[a]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.i)==null||n.call(this,t)),s.tokens===0)}stop(){this.t={}}}var Cb,UD,M_,Gse=e=>e instanceof Error;function Wse(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return M_&&n.length===UD||(UD=n.length,M_=n.reduce((r,a)=>{Cb||(Cb={});var s=Cb[a];if(s)r[s[0]]=s[1];else for(var o=e(a),l=o.length-1;l>=0;l--){var u=o[l],d=u?.filename,h=t[a];if(d&&h){r[d]=h,Cb[a]=[d,h];break}}return r},{})),M_}}var Rf="?";function gS(e,t,n,r){var a={platform:"web:javascript",filename:e,function:t==="<anonymous>"?Rf:t,in_app:!0};return Ae(n)||(a.lineno=n),Ae(r)||(a.colno=r),a}var MB=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Rf,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Yse=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Xse=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Qse=/\((\S*)(?::(\d+))(?::(\d+))\)/,Zse=e=>{var t=Yse.exec(e);if(t){var[,n,r,a]=t;return gS(n,Rf,+r,+a)}var s=Xse.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){var o=Qse.exec(s[2]);o&&(s[2]=o[1],s[3]=o[2],s[4]=o[3])}var[l,u]=MB(s[1]||Rf,s[2]);return gS(u,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Jse=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,eie=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tie=e=>{var t=Jse.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>
55-1){var n=eie.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],a=t[1]||Rf;return[a,r]=MB(a,r),gS(r,a,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},qD=/\(error: (.*)\)/,HD=50;function nie(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r,a){a===void 0&&(a=0);for(var s=[],o=r.split(` 56`),l=a;l<o.length;l++){var u=o[l];if(!(u.length>1024)){var d=qD.test(u)?u.replace(qD,"$1"):u;if(!d.match(/\S*Error: /)){for(var h of t){var p=h(d);if(p){s.push(p);break}}if(s.length>=HD)break}}}return function(g){if(!g.length)return[];var x=Array.from(g);return x.reverse(),x.slice(0,HD).map(y=>{return Ie({},y,{filename:y.filename||(w=x,w[w.length-1]||{}).filename,function:y.function||Rf});var w})}(s)}}class rie{constructor(t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=[]),this.coercers=t,this.modifiers=r,this.stackParser=nie(...n)}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},a=this.buildCoercingContext(r,n,0).apply(t),s=this.buildParsingContext(),o=this.parseStacktrace(a,s);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var n=this;return BD(function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&sn(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t})()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,a;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(a=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),n.chunkIdMap)),Ie({},t,{cause:r,stack:a})}applyChunkIds(t,n){return t.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return BD(function*(){var r=t;for(var a of n.modifiers)r=yield a(r);return r})()}convertToExceptionList(t,n){var r,a,s,o={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(a=n.handled)===null||a===void 0||a,synthetic:(s=t.synthetic)!==null&&s!==void 0&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var l=[o];return t.cause!=null&&l.push(...this.convertToExceptionList(t.cause,Ie({},n,{handled:!0}))),l}buildParsingContext(){return{chunkIdMap:Wse(this.stackParser)}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var a=(s,o)=>{if(o<=4){var l=this.buildCoercingContext(t,n,o);return this.applyCoercers(s,l)}};return Ie({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:s=>a(s,r),next:s=>a(s,r+1)})}}class aie{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=ar(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return dy(t,"DOMException")}isDOMError(t){return dy(t,"DOMError")}}class sie{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class iie{constructor(){}match(t){return dy(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r,a=n.apply(t.error);return a||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var oie=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class lie{match(t){return typeof t=="string"}coerce(t,n){var r,[a,s]=this.getInfos(t);return{type:a??"Error",value:s??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,a=t.match(oie);return a&&(n=a[1],r=a[2]),[n,r]}}var cie=["fatal","error","warning","log","info","debug"];
56function DB(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var a=n.slice(0,r).join(", ");if(!(a.length>t))return r===n.length||a.length<=t?a:a.slice(0,t)+"..."}return""}class uie{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,a=this.getErrorPropertyFromObject(t);return a?n.apply(a):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return RB(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+DB(t)}isSeverityLevel(t){return ar(t)&&!pS(t)&&cie.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(Gse(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class die{match(t){return RB(t)}coerce(t,n){var r,a=t.constructor.name;return{type:a,value:a+" captured as exception with keys: "+DB(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class fie{match(t){return mS(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class hie{match(t){return dy(t,"PromiseRejectionEvent")}coerce(t,n){var r,a=this.getUnhandledRejectionReason(t);return mS(a)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(a),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(a)}
56getUnhandledRejectionReason(t){if(mS(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var $B=e=>{var t={k:function(n){if(le&&(ho.DEBUG||Ze.POSTHOG_DEBUG)&&!Ae(le.console)&&le.console){for(var r=("__rrweb_original__"in le.console[n])?le.console[n].__rrweb_original__:le.console[n],a=arguments.length,s=new Array(a>1?a-1:0),o=1;o<a;o++)s[o-1]=arguments[o];r(e,...s)}},info:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];t.k("log",...r)},warn:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];t.k("warn",...r)},error:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];t.k("error",...r)},critical:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];console.error(e,...r)},uninitializedWarning:n=>{t.error("You must initialize PostHog before calling "+n)},createLogger:n=>$B(e+" "+n)};return t},De=$B("[PostHog.js]"),yr=De.createLogger,pie=yr("[ExternalScriptsLoader]"),KD=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return pie.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Te?.querySelectorAll("script");if(r){for(var a,s=function(){if(r[o].src===t){var u=r[o];return u.__posthog_loading_callback_fired?{v:n()}:(u.addEventListener("load",d=>{u.__posthog_loading_callback_fired=!0,n(void 0,d)}),u.onerror=d=>n(d),{v:void 0})}},o=0;o<r.length;o++)if(a=s())return a.v}var l=()=>{if(!Te)return n("document not found");var u=Te.createElement("script");if(u.type="text/javascript",u.crossOrigin="anonymous",u.src=t,u.onload=p=>{u.__posthog_loading_callback_fired=!0,n(void 0,p)},u.onerror=p=>n(p),e.config.prepare_external_dependency_script&&(u=e.config.prepare_external_dependency_script(u)),!u)return n("prepare_external_dependency_script returned null");var d,h=Te.querySelectorAll("body > script");h.length>0?(d=h[0].parentNode)==null||d.insertBefore(u,h[0]):Te.body.appendChild(u)};Te!=null&&Te.body?l():Te?.addEventListener("DOMContentLoaded",l)};Ze.__PosthogExtensions__=Ze.__PosthogExtensions__||{},Ze.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/"+t+".js?v="+e.version;if(t==="remote-config"&&(r="/array/"+e.config.token+"/config.js"),t==="toolbar"){var a=3e5;r=r+"&t="+Math.floor(Date.now()/a)*a}var s=e.requestRouter.endpointFor("assets",r);KD(e,s,n)},Ze.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);KD(e,r,n)};var fy={};function Bl(e,t,n){if(sn(e)){if(ID&&e.forEach===ID)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,a=e.length;r<a;r++)if(r in e&&t.call(n,e[r],r)===fy)return}}}function Yt(e,t,n){if(!an(e)){if(sn(e))return Bl(e,t,n);if(Use(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===fy)return}else for(var a in e)if(PB.call(e,a)&&t.call(n,e[a],a)===fy)return}}var Mn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Bl(n,function(a){for(var s in a)a[s]!==void 0&&(e[s]=a[s])}),e},lh=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Bl(n,function(a){Bl(a,function(s){e.push(s)})}),e};function L0(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var VD=function(e){try{return e()}catch{return}},mie=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(a){De.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),De.critical(a)}}},XE=function(e){var t={};return Yt(e,function(n,r){(ar(n)&&n.length>0||Ri(n))&&(t[r]=n)}),t};function gie(e,t){return n=e,r=s=>ar(s)&&!zo(t)?s.slice(0,t):s,a=new Set,function s(o,l){return o!==Object(o)?r?r(o,l):o:a.has(o)?void 0:(a.add(o),sn(o)?(u=[],Bl(o,d=>{u.push(s(d))})):(u={},Yt(o,(d,h)=>{a.has(d)||(u[h]=s(d,h))})),u);var u}(n);var n,r,a}var xie=["herokuapp.com","vercel.app","netlify.app"];function bie(e){var t=e?.hostname;if(!ar(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of xie)if(n===r)return!1;return!0}function IB(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Wn(e,t,n,r){var{capture:a=!1,passive:s=!0}=r??{};e?.addEventListener(t,n,{capture:a,passive:s})}var LB="$people_distinct_id",om="__alias",lm="__timers",GD="$autocapture_disabled_server_side",xS="$heatmaps_enabled_server_side",WD="$exception_capture_enabled_server_side",bS="$error_tracking_suppression_rules",YD="$error_tracking_capture_extension_exceptions",XD="$web_vitals_enabled_server_side",FB="$dead_clicks_enabled_server_side",QD="$web_vitals_allowed_metrics",D_="$session_recording_remote_config",hy="$sesid",zB="$session_is_sampled",df="$enabled_feature_flags",cm="$early_access_features",yS="$feature_flag_details",um="$stored_person_properties",Uc="$stored_group_properties",vS="$surveys",Eb="$surveys_activated",py="$flag_call_reported",po="$user_state",wS="$client_session_props",jS="$capture_rate_limit",NS="$initial_campaign_params",_S="$initial_referrer_info",my="$initial_person_info",gy="$epp",BB="__POSTHOG_TOOLBAR__",Mp="$posthog_cookieless",yie=[LB,om,"__cmpns",lm,"$session_recording_enabled_server_side",xS,hy,df,bS,po,cm,yS,Uc,um,vS,py,wS,jS,NS,_S,gy,my];function ZD(e){return e instanceof Element&&(e.id===BB||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function Qv(e){return!!e&&e.nodeType===1}function Ul(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function UB(e){return!!e&&e.nodeType===3}function qB(e){return!!e&&e.nodeType===11}function QE(e){return e?Yv(e).split(/\s+/):[]}function JD(e){var t=le?.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function xy(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return QE(t)}function HB(e){return an(e)?null:Yv(e).split(/(\s+)/).filter(t=>Dm(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Zv(e){var t="";return kS(e)&&!YB(e)&&e.childNodes&&e.childNodes.length&&Yt(e.childNodes,function(n){var r;UB(n)&&n.textContent&&(t+=(r=HB(n.textContent))!==null&&r!==void 0?r:"")}),Yv(t)}function KB(e){return Ae(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var ZE=["a","button","form","input","select","textarea","label"];function VB(e,t){if(Ae(t))return!0;var n,r=function(s){if(t.some(o=>s.matches(o)))return{v:!0}};for(var a of e)if(n=r(a))return n.v;return!1}function GB(e){var t=e.parentNode;return!(!t||!Qv(t))&&t}var e$=[".ph-no-rageclick",".ph-no-capture"],JE=e=>!e||Ul(e,"html")||!Qv(e),WB=(e,t)=>{if(!le||JE(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],a=e;a.parentNode&&!Ul(a,"body");)if(qB(a.parentNode))r.push(a.parentNode.host),a=a.parentNode.host;else{var s=GB(a);if(!s)break;if(t||ZE.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var o=le.getComputedStyle(s);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),a=s}return{parentIsUsefulElement:n,targetElementList:r}};function vie(e,t,n,r,a){var s,o,l,u;if(n===void 0&&(n=void 0),!le||JE(e)||(s=n)!=null&&s.url_allowlist&&!JD(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&JD(n.url_ignorelist))return!1;if((l=n)!=null&&l.dom_event_allowlist){var d=n.dom_event_allowlist;if(d&&!d.some(y=>t.type===y))return!1}var{parentIsUsefulElement:h,targetElementList:p}=WB(e,r);if(!function(y,w){var j=w?.element_allowlist;if(Ae(j))return!0;var N,k=function(E){if(j.some(O=>E.tagName.toLowerCase()===O))return{v:!0}};for(var S of y)if(N=k(S))return N.v;return!1}(p,n)||!VB(p,(u=n)==null?void 0:u.css_selector_allowlist))return!1;var g=le.getComputedStyle(e);
56if(g&&g.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var x=e.tagName.toLowerCase();switch(x){case"html":return!1;case"form":return(a||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(a||["change","click"]).indexOf(t.type)>=0;default:return h?(a||["click"]).indexOf(t.type)>=0:(a||["click"]).indexOf(t.type)>=0&&(ZE.indexOf(x)>-1||e.getAttribute("contenteditable")==="true")}}function kS(e){for(var t=e;t.parentNode&&!Ul(t,"body");t=t.parentNode){var n=xy(t);if(ut(n,"ph-sensitive")||ut(n,"ph-no-capture"))return!1}if(ut(xy(e),"ph-include"))return!0;var r=e.type||"";if(ar(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var a=e.name||e.id||"";return!(ar(a)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,"")))}function YB(e){return!!(Ul(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ul(e,"select")||Ul(e,"textarea")||e.getAttribute("contenteditable")==="true")}var XB="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",wie=new RegExp("^(?:"+XB+")$"),jie=new RegExp(XB),QB="\\d{3}-?\\d{2}-?\\d{4}",Nie=new RegExp("^("+QB+")$"),_ie=new RegExp("("+QB+")");function Dm(e,t){return t===void 0&&(t=!0),!(an(e)||ar(e)&&(e=Yv(e),(t?wie:jie).test((e||"").replace(/[- ]/g,""))||(t?Nie:_ie).test(e)))}function ZB(e){var t=Zv(e);return Dm(t=(t+" "+JB(e)).trim())?t:""}function JB(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Yt(e.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var a=Zv(n);t=(t+" "+a).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+JB(n)).trim())}catch(s){De.error("[AutoCapture]",s)}}),t}function kie(e){return function(t){var n=t.map(r=>{var a,s,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var l of(r.attr_class.sort(),r.attr_class))o+="."+l.replace(/"/g,"");var u=Ie({},r.text?{text:r.text}:{},{"nth-child":(a=r.nth_child)!==null&&a!==void 0?a:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),d={};return L0(u).sort((h,p)=>{var[g]=h,[x]=p;return g.localeCompare(x)}).forEach(h=>{var[p,g]=h;return d[t$(p.toString())]=t$(g.toString())}),o+=":",o+=L0(d).map(h=>{var[p,g]=h;return p+'="'+g+'"'}).join("")});return n.join(";")}(function(t){return t.map(n=>{var r,a,s={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(a=n.attr__href)==null?void 0:a.slice(0,2048),attr_class:Sie(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return L0(n).filter(o=>{var[l]=o;return l.indexOf("attr__")===0}).forEach(o=>{var[l,u]=o;return s.attributes[l]=u}),s})}(e))}function t$(e){return e.replace(/"|\\"/g,'\\"')}function Sie(e){var t=e.attr__class;return t?sn(t)?t:QE(t):void 0}class eU{constructor(){this.clicks=[]}isRageClick(t,n,r){var a=this.clicks[this.clicks.length-1];if(a&&Math.abs(t-a.x)+Math.abs(n-a.y)<30&&r-a.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var $_="$copy_autocapture",xo=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),by=e=>{var t=Te?.createElement("a");return Ae(t)?null:(t.href=e,t)},Cie=function(e,t){var n,r;t===void 0&&(t="&");var a=[];return Yt(e,function(s,o){Ae(s)||Ae(o)||o==="undefined"||(n=encodeURIComponent((l=>l instanceof File)(s)?s.name:s.toString()),r=encodeURIComponent(o),a[a.length]=r+"="+n)}),a.join(t)},yy=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),a=0;a<r.length;a++){var s=r[a].split("=");if(s[0]===t){n=s;break}}if(!sn(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{De.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},vg=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),a=r[0]||"",s=r[1],o=a.split("?"),l=o[1],u=o[0],d=(l||"").split("&"),h=[],p=0;p<d.length;p++){var g=d[p].split("=");sn(g)&&(t.includes(g[0])?h.push(g[0]+"="+n):h.push(d[p]))}var x=u;return l!=null&&(x+="?"+h.join("&")),s!=null&&(x+="#"+s),x},vy=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));
56return n?n[1]:null},n$=yr("[AutoCapture]");function I_(e,t){return t.length>e?t.slice(0,e)+"...":t}function Eie(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Qv(t));return t}function Oie(e,t,n,r){var a=e.tagName.toLowerCase(),s={tag_name:a};ZE.indexOf(a)>-1&&!n&&(a.toLowerCase()==="a"||a.toLowerCase()==="button"?s.$el_text=I_(1024,ZB(e)):s.$el_text=I_(1024,Zv(e)));var o=xy(e);o.length>0&&(s.classes=o.filter(function(h){return h!==""})),Yt(e.attributes,function(h){var p;if((!YB(e)||["name","id","class","aria-label"].indexOf(h.name)!==-1)&&(r==null||!r.includes(h.name))&&!t&&Dm(h.value)&&(p=h.name,!ar(p)||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")){var g=h.value;h.name==="class"&&(g=QE(g).join(" ")),s["attr__"+h.name]=I_(1024,g)}});for(var l=1,u=1,d=e;d=Eie(d);)l++,d.tagName===e.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}function Aie(e,t){for(var n,r,{e:a,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:u}=t,d=[e],h=e;h.parentNode&&!Ul(h,"body");)qB(h.parentNode)?(d.push(h.parentNode.host),h=h.parentNode.host):(d.push(h.parentNode),h=h.parentNode);var p,g=[],x={},y=!1,w=!1;if(Yt(d,E=>{var O=kS(E);E.tagName.toLowerCase()==="a"&&(y=E.getAttribute("href"),y=O&&y&&Dm(y)&&y),ut(xy(E),"ph-no-capture")&&(w=!0),g.push(Oie(E,s,o,l));var T=function(P){if(!kS(P))return{};var M={};return Yt(P.attributes,function(D){if(D.name&&D.name.indexOf("data-ph-capture-attribute")===0){var A=D.name.replace("data-ph-capture-attribute-",""),L=D.value;A&&L&&Dm(L)&&(M[A]=L)}}),M}(E);Mn(x,T)}),w)return{props:{},explicitNoCapture:w};if(o||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?g[0].$el_text=ZB(e):g[0].$el_text=Zv(e)),y){var j,N;g[0].attr__href=y;var k=(j=by(y))==null?void 0:j.host,S=le==null||(N=le.location)==null?void 0:N.host;k&&S&&k!==S&&(p=y)}return{props:Mn({$event_type:a.type,$ce_version:1},u?{}:{$elements:g},{$elements_chain:kie(g)},(n=g[0])!=null&&n.$el_text?{$el_text:(r=g[0])==null?void 0:r.$el_text}:{},p&&a.type==="click"?{$external_click_url:p}:{},x)}}class Tie{constructor(t){this.P=!1,this.T=null,this.rageclicks=new eU,this.R=!1,this.instance=t,this.I=null}get C(){var t,n,r=Ur(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(t=r.url_allowlist)==null?void 0:t.map(a=>new RegExp(a)),r.url_ignorelist=(n=r.url_ignorelist)==null?void 0:n.map(a=>new RegExp(a)),r}O(){if(this.isBrowserSupported()){if(le&&Te){var t=r=>{r=r||le?.event;try{this.F(r)}catch(a){n$.error("Failed to capture event",a)}};if(Wn(Te,"submit",t,{capture:!0}),Wn(Te,"change",t,{capture:!0}),Wn(Te,"click",t,{capture:!0}),this.C.capture_copied_text){var n=r=>{r=r||le?.event,this.F(r,$_)};Wn(Te,"copy",n,{capture:!0}),Wn(Te,"cut",n,{capture:!0})}}}else n$.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.O(),this.P=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.R=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[GD]:!!t.autocapture_opt_out}),this.T=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.I=t}getElementSelectors(t){var n,r=[];return(n=this.I)==null||n.forEach(a=>{var s=Te?.querySelectorAll(a);s?.forEach(o=>{t===o&&r.push(a)})}),r}get isEnabled(){var t,n,r=(t=this.instance.persistence)==null?void 0:t.props[GD],a=this.T;if(zo(a)&&!zl(r)&&!this.instance.M())return!1;var s=(n=this.T)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!s}F(t,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,a=KB(t);UB(a)&&(a=a.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&function(g,x){if(!le||JE(g))return!1;var y,w;if((y=zl(x)?!!x&&e$:(w=x?.css_selector_ignorelist)!==null&&w!==void 0?w:e$)===!1)return!1;var{targetElementList:j}=WB(g,!1);return!VB(j,y)}(a,this.instance.config.rageclick)&&this.F(t,"$rageclick");var s=n===$_;if(a&&vie(a,t,this.C,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:l}=Aie(a,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.C.element_attribute_ignorelist,elementsC
56hainAsString:this.R});if(l)return!1;var u=this.getElementSelectors(a);if(u&&u.length>0&&(o.$element_selectors=u),n===$_){var d,h=HB(le==null||(d=le.getSelection())==null?void 0:d.toString()),p=t.type||"clipboard";if(!h)return!1;o.$selected_content=h,o.$copy_type=p}return this.instance.capture(n,o),!0}}}isBrowserSupported(){return Fl(Te?.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ri(e)&&isFinite(e)&&Math.floor(e)===e});var r$="0123456789abcdef";class wy{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,a){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(a)||t<0||n<0||r<0||a<0||t>0xffffffffffff||n>4095||r>1073741823||a>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=a>>>24,s[13]=a>>>16,s[14]=a>>>8,s[15]=a,new wy(s)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+r$.charAt(this.bytes[n]>>>4)+r$.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new wy(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class Pie{constructor(){this.A=0,this.D=0,this.j=new Rie}generate(){var t=this.generateOrAbort();if(Ae(t)){this.A=0;var n=this.generateOrAbort();if(Ae(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.A)this.A=t,this.L();else{if(!(t+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return wy.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var a$,tU=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};le&&!Ae(le.crypto)&&crypto.getRandomValues&&(tU=e=>crypto.getRandomValues(e));class Rie{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(tU(this.N),this.U=0),this.N[this.U++]}}var Ml=()=>Mie().toString(),Mie=()=>(a$||(a$=new Pie)).generate(),Dp="",Die=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function $ie(e,t){if(t){var n=function(a,s){if(s===void 0&&(s=Te),Dp)return Dp;if(!s||["localhost","127.0.0.1"].includes(a))return"";for(var o=a.split("."),l=Math.min(o.length,8),u="dmn_chk_"+Ml();!Dp&&l--;){var d=o.slice(l).join("."),h=u+"=1;domain=."+d+";path=/";s.cookie=h+";max-age=3",s.cookie.includes(u)&&(s.cookie=h+";max-age=0",Dp=d)}return Dp}(e);if(!n){var r=(a=>{var s=a.match(Die);return s?s[0]:""})(e);r!==n&&De.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var ki={H:()=>!!Te,B:function(e){De.error("cookieStore error: "+e)},q:function(e){if(Te){try{for(var t=e+"=",n=Te.cookie.split(";").filter(s=>s.length),r=0;r<n.length;r++){for(var a=n[r];a.charAt(0)==" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return decodeURIComponent(a.substring(t.length,a.length))}}catch{}return null}},W:function(e){var t;try{t=JSON.parse(ki.q(e))||{}}catch{}return t},G:function(e,t,n,r,a){if(Te)try{var s="",o="",l=$ie(Te.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),s="; expires="+u.toUTCString()}a&&(o="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+l+o;return d.length>3686.4&&De.warn("cookieStore warning: large cookie, len="+d.length),Te.cookie=d,d}catch{return}},V:function(e,t){if(Te!=null&&Te.cookie)try{ki.G(e,"",-1,t)}catch{return}}},L_=null,yn={H:function(){if(!zo(L_))return L_;var e=!0;if(Ae(le))e=!1;
56else try{var t="__mplssupport__";yn.G(t,"xyz"),yn.q(t)!=='"xyz"'&&(e=!1),yn.V(t)}catch{e=!1}return e||De.error("localStorage unsupported; falling back to cookie store"),L_=e,e},B:function(e){De.error("localStorage error: "+e)},q:function(e){try{return le?.localStorage.getItem(e)}catch(t){yn.B(t)}return null},W:function(e){try{return JSON.parse(yn.q(e))||{}}catch{}return null},G:function(e,t){try{le?.localStorage.setItem(e,JSON.stringify(t))}catch(n){yn.B(n)}},V:function(e){try{le?.localStorage.removeItem(e)}catch(t){yn.B(t)}}},Iie=["distinct_id",hy,zB,gy,my],Ob=Ie({},yn,{W:function(e){try{var t={};try{t=ki.W(e)||{}}catch{}var n=Mn(t,JSON.parse(yn.q(e)||"{}"));return yn.G(e,n),n}catch{}return null},G:function(e,t,n,r,a,s){try{yn.G(e,t,void 0,void 0,s);var o={};Iie.forEach(l=>{t[l]&&(o[l]=t[l])}),Object.keys(o).length&&ki.G(e,o,n,r,a,s)}catch(l){yn.B(l)}},V:function(e,t){try{le?.localStorage.removeItem(e),ki.V(e,t)}catch(n){yn.B(n)}}}),Ab={},Lie={H:function(){return!0},B:function(e){De.error("memoryStorage error: "+e)},q:function(e){return Ab[e]||null},W:function(e){return Ab[e]||null},G:function(e,t){Ab[e]=t},V:function(e){delete Ab[e]}},Rc=null,Sr={H:function(){if(!zo(Rc))return Rc;if(Rc=!0,Ae(le))Rc=!1;else try{var e="__support__";Sr.G(e,"xyz"),Sr.q(e)!=='"xyz"'&&(Rc=!1),Sr.V(e)}catch{Rc=!1}return Rc},B:function(e){De.error("sessionStorage error: ",e)},q:function(e){try{return le?.sessionStorage.getItem(e)}catch(t){Sr.B(t)}return null},W:function(e){try{return JSON.parse(Sr.q(e))||null}catch{}return null},G:function(e,t){try{le?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){Sr.B(n)}},V:function(e){try{le?.sessionStorage.removeItem(e)}catch(t){Sr.B(t)}}},mo=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class Fie{constructor(t){this._instance=t}get C(){return this._instance.config}get consent(){return this.J()?mo.DENIED:this.K}isOptedOut(){return this.C.cookieless_mode==="always"||this.consent===mo.DENIED||this.consent===mo.PENDING&&(this.C.opt_out_capturing_by_default||this.C.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===mo.DENIED}optInOut(t){this.Y.G(this.X,t?1:0,this.C.cookie_expiration,this.C.cross_subdomain_cookie,this.C.secure_cookie)}reset(){this.Y.V(this.X,this.C.cross_subdomain_cookie)}get X(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get K(){var t=this.Y.q(this.X);return R_(t)?mo.GRANTED:ut(Kse,t)?mo.DENIED:mo.PENDING}get Y(){if(!this.Z){var t=this.C.opt_out_capturing_persistence_type;this.Z=t==="localStorage"?yn:ki;var n=t==="localStorage"?ki:yn;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(R_(n.q(this.X))),n.V(this.X,this.C.cross_subdomain_cookie))}return this.Z}J(){return!!this.C.respect_dnt&&!!IB([Wa?.doNotTrack,Wa?.msDoNotTrack,Ze.doNotTrack],t=>R_(t))}}var Tb=yr("[Dead Clicks]"),zie=()=>!0,Bie=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(FB)),r=e.instance.config.capture_dead_clicks;return zl(r)?r:n};class nU{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[FB]:t?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it(()=>{this.et()})}it(t){var n,r;(n=Ze.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=Ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",a=>{a?Tb.error("failed to load script",a):t()})}et(){var t;if(Te){if(!this.tt&&(t=Ze.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=Ur(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=Ze.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(Te),Tb.info("starting...")}}else Tb.error("`document` not found. Cannot start.")}
56stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Tb.info("stopping..."))}}var $p=yr("[ExceptionAutocapture]");class Uie{constructor(t){var n,r,a;this.rt=()=>{var s;if(le&&this.isEnabled&&(s=Ze.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var o=Ze.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,l=Ze.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,u=Ze.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.C.capture_unhandled_errors&&(this.st=o(this.captureException.bind(this))),!this.nt&&this.C.capture_unhandled_rejections&&(this.nt=l(this.captureException.bind(this))),!this.ot&&this.C.capture_console_errors&&(this.ot=u(this.captureException.bind(this)))}catch(d){$p.error("failed to start",d),this.lt()}}},this._instance=t,this.ut=!((n=this._instance.persistence)==null||!n.props[WD]),this.C=this.ht(),this.dt=new Vse({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(a=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:10,refillInterval:1e4,h:$p}),this.startIfEnabled()}ht(){var t=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ur(t)?n=Ie({},n,t):(Ae(t)?this.ut:t)&&(n=Ie({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.C.capture_console_errors||this.C.capture_unhandled_errors||this.C.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&($p.info("enabled"),this.it(this.rt))}it(t){var n,r;(n=Ze.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&t(),(r=Ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",a=>{if(a)return $p.error("failed to load script",a);t()})}lt(){var t,n,r;(t=this.st)==null||t.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(t){var n=t.autocaptureExceptions;this.ut=!!n||!1,this.C=this.ht(),this._instance.persistence&&this._instance.persistence.register({[WD]:this.ut}),this.startIfEnabled()}captureException(t){var n,r,a=(n=t==null||(r=t.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&n!==void 0?n:"Exception";this.dt.consumeRateLimit(a)?$p.info("Skipping exception capture because of client rate limiting.",{exception:a}):this._instance.exceptions.sendExceptionEvent(t)}}function s$(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],a=n(r);return Fl(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch{return()=>{}}}class qie{constructor(t){var n;this._instance=t,this.vt=(le==null||(n=le.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(De.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,De.info("History API monitoring stopped")}monitorHistoryChanges(){var t,n;if(le&&le.history){var r=this;(t=le.history.pushState)!=null&&t.__posthog_wrapped__||s$(le.history,"pushState",a=>function(s,o,l){a.call(this,s,o,l),r.ft("pushState")}),(n=le.history.replaceState)!=null&&n.__posthog_wrapped__||s$(le.history,"replaceState",a=>function(s,o,l){a.call(this,s,o,l),r.ft("replaceState")}),this.gt()}}ft(t){try{var n,r=le==null||(n=le.location)==null?void 0:n.pathname;if(!r)return;r!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.vt=r}catch(a){De.error("Error capturing "+t+" pageview",a)}}gt(){if(!this.ct){var t=()=>{this.ft("popstate")};Wn(le,"popstate",t),this.ct=()=>{le&&le.removeEventListener("popstate",t)}}}}var F_=yr("[SegmentIntegration]");function Hie(e,t){var n=e.config.segment;if(!n)return t();(function(r,a){var s=r.config.segment;if(!s)return a();var o=u=>{var d=()=>u.anonymousId()||Ml();r.config.get_device_id=d,u.id()&&(r.register({distinct_id:u.id(),$device_id:d()}),r.persistence.set_property(po,"identified")),a()},l=s.user();"then"in l&&Fl(l.then)?l.then(u=>o(u)):o(l)})(e,()=>{n.register((r=>{Promise&&Promise.resolve||F_.warn("This browser does not have Promise support, and can not use the segment integration");var a=(s,o)=>
56{if(!o)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(F_.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(F_.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var l=r.calculateEventProperties(o,s.event.properties);return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>a(s,s.event.event),page:s=>a(s,"$pageview"),identify:s=>a(s,"$identify"),screen:s=>a(s,"$screen")}})(e)).then(()=>{t()})})}var rU="posthog-js";function aU(e,t){var{organization:n,projectId:r,prefix:a,severityAllowList:s=["error"],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return l=>{var u,d,h,p,g;if(!(s==="*"||s.includes(l.level))||!e.__loaded)return l;l.tags||(l.tags={});var x=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());l.tags["PostHog Person URL"]=x,e.sessionRecordingStarted()&&(l.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var y=((u=l.exception)==null?void 0:u.values)||[],w=y.map(N=>Ie({},N,{stacktrace:N.stacktrace?Ie({},N.stacktrace,{type:"raw",frames:(N.stacktrace.frames||[]).map(k=>Ie({},k,{platform:"web:javascript"}))}):void 0})),j={$exception_message:((d=y[0])==null?void 0:d.value)||l.message,$exception_type:(h=y[0])==null?void 0:h.type,$exception_level:l.level,$exception_list:w,$sentry_event_id:l.event_id,$sentry_exception:l.exception,$sentry_exception_message:((p=y[0])==null?void 0:p.value)||l.message,$sentry_exception_type:(g=y[0])==null?void 0:g.type,$sentry_tags:l.tags};return n&&r&&(j.$sentry_url=(a||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+l.event_id),o&&e.exceptions.sendExceptionEvent(j),l}}class Kie{constructor(t,n,r,a,s,o){this.name=rU,this.setupOnce=function(l){l(aU(t,{organization:n,projectId:r,prefix:a,severityAllowList:s,sendExceptionsToPostHog:o==null||o}))}}}var Vie=le!=null&&le.location?vy(le.location.hash,"__posthog")||vy(location.hash,"state"):null,i$="_postHogToolbarParams",o$=yr("[Toolbar]"),Al=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Al||{});class Gie{constructor(t){this.instance=t}_t(t){Ze.ph_toolbar_state=t}yt(){var t;return(t=Ze.ph_toolbar_state)!==null&&t!==void 0?t:Al.UNINITIALIZED}maybeLoadToolbar(t,n,r){if(t===void 0&&(t=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),!le||!Te)return!1;t=t??le.location,r=r??le.history;try{if(!n){try{le.localStorage.setItem("test","test"),le.localStorage.removeItem("test")}catch{return!1}n=le?.localStorage}var a,s=Vie||vy(t.hash,"__posthog")||vy(t.hash,"state"),o=s?VD(()=>JSON.parse(atob(decodeURIComponent(s))))||VD(()=>JSON.parse(decodeURIComponent(s))):null;return o&&o.action==="ph_authorize"?((a=o).source="url",a&&Object.keys(a).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((a=JSON.parse(n.getItem(i$)||"{}")).source="localstorage",delete a.userIntent),!(!a.token||this.instance.config.token!==a.token)&&(this.loadToolbar(a),!0)}catch{return!1}}bt(t){var n=Ze.ph_load_toolbar||Ze.ph_load_editor;!an(n)&&Fl(n)?n(t,this.instance):o$.warn("No toolbar load function found")}loadToolbar(t){var n=!(Te==null||!Te.getElementById(BB));if(!le||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,a=Ie({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(le.localStorage.setItem(i$,JSON.stringify(Ie({},a,{source:void 0}))),this.yt()===Al.LOADED)this.bt(a);else if(this.yt()===Al.UNINITIALIZED){var s;this._t(Al.LOADING),(s=Ze.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",o=>{if(o)return o$.error("[Toolbar] Failed to load",o),void this._t(Al.UNINITIALIZED);this._t(Al.LOADED),this.bt(a)}),Wn(le,"turbolinks:load",()=>{this._t(Al.UNINITIALIZED),this.loadToolbar(a)})}return!0}wt(t){return this.loadToolbar(t)}maybeLoadEditor(t,n,r){return t===void 0&&(t=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(t,n,r)}}var Wie=yr("[TracingHeaders]");class Yie{constructor(t){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,r;Ae(this.xt)&&((n=Ze.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),Ae(this.St)&&((r=Ze.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}it(t){var n,r;(n=Ze.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&t(),(r=Ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",a=>{if(a)return Wie.error("failed to load script",a);t()})}startIfEnabledOrStop(){var t,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((t=this.xt)==null||t.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}}var js="Mobile",jy="iOS",Ni="Android",$m="Tablet",sU=Ni+" "+$m,iU="iPad",oU="Apple",lU=oU+" Watch",Im="Safari",Mf="BlackBerry",cU="Samsung",uU=cU+"Browser",dU=cU+" Internet",Nu="Chrome",Xie=Nu+" OS",fU=Nu+" "+jy,eO="Internet Explorer",hU=eO+" "+js,tO="Opera",Qie=tO+" Mini",nO="Edge",pU="Microsoft "+nO,vf="Firefox",mU=vf+" "+jy,Lm="Nintendo",Fm="PlayStation",wf="Xbox",gU=Ni+" "+js,xU=js+" "+Im,dm="Windows",SS=dm+" Phone",l$="Nokia",CS="Ouya",bU="Generic",Zie=bU+" "+js.toLowerCase(),yU=bU+" "+$m.toLowerCase(),ES="Konqueror",Yr="(\\d+(\\.\\d+)?)",z_=new RegExp("Version/"+Yr),Jie=new RegExp(wf,"i"),eoe=new RegExp(Fm+" \\w+","i"),toe=new RegExp(Lm+" \\w+","i"),rO=new RegExp(Mf+"|PlayBook|BB10","i"),noe={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"}
56,roe=(e,t)=>t&&ut(t,oU)||function(n){return ut(n,Im)&&!ut(n,Nu)&&!ut(n,Ni)}(e),vU=function(e,t){return t=t||"",ut(e," OPR/")&&ut(e,"Mini")?Qie:ut(e," OPR/")?tO:rO.test(e)?Mf:ut(e,"IE"+js)||ut(e,"WPDesktop")?hU:ut(e,uU)?dU:ut(e,nO)||ut(e,"Edg/")?pU:ut(e,"FBIOS")?"Facebook "+js:ut(e,"UCWEB")||ut(e,"UCBrowser")?"UC Browser":ut(e,"CriOS")?fU:ut(e,"CrMo")||ut(e,Nu)?Nu:ut(e,Ni)&&ut(e,Im)?gU:ut(e,"FxiOS")?mU:ut(e.toLowerCase(),ES.toLowerCase())?ES:roe(e,t)?ut(e,js)?xU:Im:ut(e,vf)?vf:ut(e,"MSIE")||ut(e,"Trident/")?eO:ut(e,"Gecko")?vf:""},aoe={[hU]:[new RegExp("rv:"+Yr)],[pU]:[new RegExp(nO+"?\\/"+Yr)],[Nu]:[new RegExp("("+Nu+"|CrMo)\\/"+Yr)],[fU]:[new RegExp("CriOS\\/"+Yr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Yr)],[Im]:[z_],[xU]:[z_],[tO]:[new RegExp("(Opera|OPR)\\/"+Yr)],[vf]:[new RegExp(vf+"\\/"+Yr)],[mU]:[new RegExp("FxiOS\\/"+Yr)],[ES]:[new RegExp("Konqueror[:/]?"+Yr,"i")],[Mf]:[new RegExp(Mf+" "+Yr),z_],[gU]:[new RegExp("android\\s"+Yr,"i")],[dU]:[new RegExp(uU+"\\/"+Yr)],[eO]:[new RegExp("(rv:|MSIE )"+Yr)],Mozilla:[new RegExp("rv:"+Yr)]},soe=function(e,t){var n=vU(e,t),r=aoe[n];if(Ae(r))return null;for(var a=0;a<r.length;a++){var s=r[a],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},c$=[[new RegExp(wf+"; "+wf+" (.*?)[);]","i"),e=>[wf,e&&e[1]||""]],[new RegExp(Lm,"i"),[Lm,""]],[new RegExp(Fm,"i"),[Fm,""]],[rO,[Mf,""]],[new RegExp(dm,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[SS,""];if(new RegExp(js).test(t)&&!/IEMobile\b/.test(t))return[dm+" "+js,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],a=noe[r]||"";return/arm/i.test(t)&&(a="RT"),[dm,a]}return[dm,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[jy,t.join(".")]}return[jy,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Ae(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Ni+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ni+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Ni,t.join(".")]}return[Ni,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Xie,""]],[/Linux|debian/i,["Linux",""]]],u$=function(e){return toe.test(e)?Lm:eoe.test(e)?Fm:Jie.test(e)?wf:new RegExp(CS,"i").test(e)?CS:new RegExp("("+SS+"|WPDesktop)","i").test(e)?SS:/iPad/.test(e)?iU:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?lU:rO.test(e)?Mf:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(l$,"i").test(e)?l$:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(js).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Ni:sU:Ni:new RegExp("(pda|"+js+")","i").test(e)?Zie:new RegExp($m,"i").test(e)&&!new RegExp($m+" pc","i").test(e)?yU:""},Pb="https?://(.*)",ch=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ioe=lh(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ch),wg="<masked>",ooe=["li_fat_id"];function wU(e,t,n){if(!Te)return{};var r,a=t?lh([],ch,n||[]):[],s=jU(vg(Te.URL,a,wg),e),o=(r={},Yt(ooe,function(l){var u=ki.q(l);r[l]=u||null}),r);return Mn(o,s)}function jU(e,t){var n=ioe.concat(t||[]),r={};return Yt(n,function(a){var s=yy(e,a);r[a]=s||null}),r}function NU(e){var t=function(s){return s?s.search(Pb+"google.([^/?]*)")===0?"google":s.search(Pb+"bing.com")===0?"bing":s.search(Pb+"yahoo.com")===0?"yahoo":s.search(Pb+"duckduckgo.com")===0?"duckduckgo":null:null}(e),n=t!="yahoo"?"q":"p",r={};if(!zo(t)){r.$search_engine=t;var a=Te?yy(Te.referrer,n):"";a.length&&(r.ph_keyword=a)}return r}function d$(){return navigator.language||navigator.userLanguage}function _U(){return Te?.referrer||"$direct"}function kU(e,t){var n=e?lh([],ch,t||[]):[],r=da?.href.substring(0,1e3);return{r:_U().substring(0,1e3),u:r?vg(r,n,wg):void 0}}function SU(e){var t,{r:n,u:r}=e,a={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=by(n))==null?void 0:t.host};
56if(r){a.$current_url=r;var s=by(r);a.$host=s?.host,a.$pathname=s?.pathname;var o=jU(r);Mn(a,o)}if(n){var l=NU(n);Mn(a,l)}return a}function CU(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function loe(){try{return new Date().getTimezoneOffset()}catch{return}}function coe(e,t){if(!ca)return{};var n,r,a,s=e?lh([],ch,t||[]):[],[o,l]=function(u){for(var d=0;d<c$.length;d++){var[h,p]=c$[d],g=h.exec(u),x=g&&(Fl(p)?p(g,u):p);if(x)return x}return["",""]}(ca);return Mn(XE({$os:o,$os_version:l,$browser:vU(ca,navigator.vendor),$device:u$(ca),$device_type:(r=ca,a=u$(r),a===iU||a===sU||a==="Kobo"||a==="Kindle Fire"||a===yU?$m:a===Lm||a===wf||a===Fm||a===CS?"Console":a===lU?"Wearable":a?js:"Desktop"),$timezone:CU(),$timezone_offset:loe()}),{$current_url:vg(da?.href,s,wg),$host:da?.host,$pathname:da?.pathname,$raw_user_agent:ca.length>1e3?ca.substring(0,997)+"...":ca,$browser_version:soe(ca,navigator.vendor),$browser_language:d$(),$browser_language_prefix:(n=d$(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:le?.screen.height,$screen_width:le?.screen.width,$viewport_height:le?.innerHe
56ight,$viewport_width:le?.innerWidth,$lib:"web",$lib_version:ho.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var vl=yr("[Web Vitals]"),f$=9e5;class uoe{constructor(t){var n;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((r,a)=>Ie({},r,{["$web_vitals_"+a.name+"_event"]:Ie({},a),["$web_vitals_"+a.name+"_value"]:a.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var a,s=(a=this._instance.sessionManager)==null?void 0:a.checkAndGetSessionAndWindowId(!0);if(Ae(s))vl.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this.Tt();Ae(o)||(an(r?.name)||an(r?.value)?vl.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?vl.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==o&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),Ae(this.N.url)&&(this.N.url=o),this.N.firstMetricTimestamp=Ae(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(Ie({},r,{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,a,s,o,l=Ze.__PosthogExtensions__;Ae(l)||Ae(l.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:a,onFCP:s,onINP:o}=l.postHogWebVitalsCallbacks),r&&a&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&a(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this.Pt.bind(this)),this.P=!0):vl.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.Et=!((n=this._instance.persistence)==null||!n.props[XD]),this.startIfEnabled()}get allowedMetrics(){var t,n,r=Ur(this._instance.config.capture_performance)?(t=this._instance.config.capture_performance)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Ae(r)?((n=this._instance.persistence)==null?void 0:n.props[QD])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Ur(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var t=Ur(this._instance.config.capture_performance)&&Ri(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:f$;return 0<t&&t<=6e4?f$:t}get isEnabled(){var t=da?.protocol;if(t!=="http:"&&t!=="https:")return vl.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=Ur(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:zl(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return zl(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(vl.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(t){var n=Ur(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Ur(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[XD]:n}),this._instance.persistence.register({[QD]:r})),this.Et=n,this.startIfEnabled()}it(t){var n,r;(n=Ze.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&t(),(r=Ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",a=>{a?vl.error("failed to load script",a):t()})}Tt(){var t=le?le.location.href:void 0;if(t){var n=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,a=n?lh([],ch,r||[]):[];return vg(t,a,wg)}vl.error("Could not determine current URL")}}var doe=yr("[Heatmaps]");function h$(e){return Ur(e)&&"clientX"in e&&"clientY"in e&&Ri(e.clientX)&&Ri(e.clientY)}class foe{constructor(t){var n;this.rageclicks=new eU,this.Et=!1,this.P=!1,this.It=null,this.instance=t,this.Et=!((n=this.instance.persistence)==null||!n.props[xS])}get flushIntervalMilliseconds(){var t=5e3;return Ur(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Ae(this.instance.config.capture_heatmaps)?Ae(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;doe.info("starting..."),this.Ct(),this.Ot()}else{var t;clearInterval((t=this.It)!==null&&t!==void 0?t:void 0),this.Ft(),this.getAndClearBuffer()}}onRemoteConfig(t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[xS]:n}),this.Et=n,this.startIfEnabled()}getAndClearBuffer(){var t=this.N;return this.N=void 0,t}Mt(t){this.At(t.originalEvent,"deadclick")}Ot(){this.It&&clearInterval(this.It),this.It=function(t){return t?.visibilityState==="visible"}(Te)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ct(){le&&Te&&(this.jt=this.Dt.bind(this),Wn(le,"beforeunload",this.jt),this.Lt=t=>this.At(t||le?.event),Wn(Te,"click",this.Lt,{capture:!0}),this.Nt=t=>this.Ut(t||le?.event),Wn(Te,"mousemove",this.Nt,{capture:!0}),this.zt=new nU(this.instance,zie,this.Mt.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ot.bind(this),Wn(Te,"visibilitychange",this.Ht),this.P=!0)}Ft(){var t;le&&Te&&(this.jt&&le.removeEventListener("beforeunload",this.jt),this.Lt&&Te.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&Te.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&Te.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(t=this.zt)==null||t.stop(),this.P=!1)}qt(t,n){var r=this.instance.scrollManager.scrollY(),a=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(l,u,d){for(var h=l;h&&Qv(h)&&!Ul(h,"body");){if(h===d)return!1;if(ut(u,le?.getComputedStyle(h).position))return!0;h=GB(h)}return!1}(KB(t),["fixed","sticky"],s);return{x:t.clientX+(o?0:a),y:t.clientY+(o?0:r),target_fixed:o,type:n}}At(t,n){var r;if(n===void 0&&(n="click"),!ZD(t.target)&&h$(t)){var a=this.qt(t,n);(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this.Wt(Ie({},a,{type:"rageclick"})),this.Wt(a)}}Ut(t){!ZD(t.target)&&h$(t)&&(clearTimeout(this.Bt),this.Bt=setTimeout(()=>{this.Wt(this.qt(t,"mousemove"))},500))}Wt(t){if(le){var n=le.location.href,r=this.instance.config.mask_personal_data_properties,a=this.instance.config.custom_personal_data_properties,s=r?lh([],ch,a||[]):[],o=vg(n,s,wg);this.N=this.N||{},this.N[o]||(this.N[o]=[]),this.N[o].push(t)}}Dt(){this.N&&!uf(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class hoe{constructor(t){this._instance=t}doPageView(t,n){var r,a=this.Gt(t,n);return this.Vt={pathname:(r=le?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),a}doPageLeave(t){var n;return this.Gt(t,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Vt)==null?void 0:t.pageViewId}}Gt(t,n){var r=this.Vt;if(!r)return{$pageview_id:n};var a={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:l,maxScrollY:u,maxContentHeight:d,lastContentY:h,maxContentY:p}=s;if(!(Ae(o)||Ae(l)||Ae(u)||Ae(d)||Ae(h)||Ae(p))){o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),h=Math.ceil(h),p=Math.ceil(p);var g=o<=1?1:ji(l/o,0,1,De),x=o<=1?1:ji(u/o,0,1,De),y=d<=1?1:ji(h/d,0,1,De),w=d<=1?1:ji(p/d,0,1,De);a=Mn(a,{$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:g,$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:x,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:y,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:w})}}return r.pathname&&(a.$prev_pageview_pathname=r.pathname),r.timestamp&&(a.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),a}}var Ns=Uint8Array,pa=Uint16Array,Df=Uint32Array,aO=new Ns([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sO=new Ns([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),p$=new Ns([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),EU=function(e,t){for(var n=new pa(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var a=new Df(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)a[s]=s-n[r]<<5|r;return[n,a]},OU=EU(aO,2),poe=OU[0],OS=OU[1];poe[28]=258,OS[258]=28;for(var m$=EU(sO,0)[1],AU=new pa(32768),on=0;on<32768;++on){var Mc=(43690&on)>>>1|(21845&on)<<1;Mc=(61680&(Mc=(52428&Mc)>>>2|(13107&Mc)<<2))>>>4|(3855&Mc)<<4,AU[on]=((65280&Mc)>>>8|(255&Mc)<<8)>>>1}var wm=function(e,t,n){for(var r=e.length,a=0,s=new pa(t);a<r;++a)++s[e[a]-1];var o,l=new pa(t);for(a=0;a<t;++a)l[a]=l[a-1]+s[a-1]<<1;for(o=new pa(r),a=0;a<r;++a)o[a]=AU[l[e[a]-1]++]>>>15-e[a];return o},_u=new Ns(288);for(on=0;on<144;++on)_u[on]=8;for(on=144;on<256;++on)_u[on]=9;for(on=256;on<280;++on)_u[on]=7;for(on=280;on<288;++on)_u[on]=8;var Ny=new Ns(32);for(on=0;on<32;++on)Ny[on]=5;var moe=wm(_u,9),goe=wm(Ny,5),TU=function(e){return(e/8>>0)+(7&e&&1)},PU=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof pa?pa:e instanceof Df?Df:Ns)(n-t);return r.set(e.subarray(t,n)),r},io=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Ip=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},B_=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,s=n.slice();if(!a)return[new Ns(0),0];if(a==1){var o=new Ns(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(O,T){return O.f-T.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,h=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};h!=a-1;)l=n[n[d].f<n[p].f?d++:p++],u=n[d!=h&&n[d].f<n[p].f?d++:p++],n[h++]={s:-1,f:l.f+u.f,l,r:u};var g=s[0].s;for(r=1;r<a;++r)s[r].s>g&&(g=s[r].s);var x=new pa(g+1),y=AS(n[h-1],x,0);if(y>t){r=0;var w=0,j=y-t,N=1<<j;for(s.sort(function(O,T){return x[T.s]-x[O.s]||O.f-T.f});r<a;++r){var k=s[r].s;if(!(x[k]>t))break;w+=N-(1<<y-x[k]),x[k]=t}for(w>>>=j;w>0;){var S=s[r].s;x[S]<t?w-=1<<t-x[S]++-1:++r}for(;r>=0&&w;--r){var E=s[r].s;x[E]==t&&(--x[E],++w)}y=t}return[new Ns(x),y]},AS=function(e,t,n){return e.s==-1?Math.max(AS(e.l,t,n+1),AS(e.r,t,n+1)):t[e.s]=n},g$=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new pa(++t),r=0,a=e[0],s=1,o=function(u){n[r++]=u},l=1;l<=t;++l)if(e[l]==a&&l!=t)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=e[l]}return[n.subarray(0,r),t]},Lp=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},TS=function(e,t,n){var r=n.length,a=TU(t+2);e[a]=255&r,e[a+1]=r>>>8,e[a+2]=255^e[a],e[a+3]=255^e[a+1];for(var s=0;s<r;++s)e[a+s+4]=n[s];return 8*(a+4+r)},x$=function(e,t,n,r,a,s,o,l,u,d,h){io(t,h++,n),++a[256];for(var p=B_(a,15),g=p[0],x=p[1],y=B_(s,15),w=y[0],j=y[1],N=g$(g),k=N[0],S=N[1],E=g$(w),O=E[0],T=E[1],P=new pa(19),M=0;M<k.length;++M)P[31&k[M]]++;for(M=0;M<O.length;++M)P[31&O[M]]++;for(var D=B_(P,7),A=D[0],L=D[1],F=19;F>4&&!A[p$[F-1]];--F);var B,U,z,$,K=d+5<<3,G=Lp(a,_u)+Lp(s,Ny)+o,W=Lp(a,g)+Lp(s,w)+o+14+3*F+Lp(P,A)+(2*P[16]+3*P[17]+7*P[18]);if(K<=G&&K<=W)return TS(t,h,e.subarray(u,u+d));if(io(t,h,1+(W<G)),h+=2,W<G){B=wm(g,x),U=g,z=wm(w,j),$=w;var I=wm(A,L);for(io(t,h,S-257),io(t,h+5,T-1),io(t,h+10,F-4),h+=14,M=0;M<F;++M)io(t,h+3*M,A[p$[M]]);h+=3*F;for(var H=[k,O],V=0;V<2;++V){var X=H[V];for(M=0;M<X.length;++M){var te=31&X[M];io(t,h,I[te]),h+=A[te],te>15&&(io(t,h,X[M]>>>5&127),h+=X[M]>>>12)}}}else B=moe,U=_u,z=goe,$=Ny;for(M=0;M<l;++M)if(r[M]>255){te=r[M]>>>18&31,Ip(t,h,B[te+257]),h+=U[te+257],te>
567&&(io(t,h,r[M]>>>23&31),h+=aO[te]);var fe=31&r[M];Ip(t,h,z[fe]),h+=$[fe],fe>3&&(Ip(t,h,r[M]>>>5&8191),h+=sO[fe])}else Ip(t,h,B[r[M]]),h+=U[r[M]];return Ip(t,h,B[256]),h+U[256]},xoe=new Df([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),boe=function(){for(var e=new Df(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),yoe=function(e,t,n,r,a){return function(s,o,l,u,d,h){var p=s.length,g=new Ns(u+p+5*(1+Math.floor(p/7e3))+d),x=g.subarray(u,g.length-d),y=0;if(!o||p<8)for(var w=0;w<=p;w+=65535){var j=w+65535;j<p?y=TS(x,y,s.subarray(w,j)):(x[w]=h,y=TS(x,y,s.subarray(w,p)))}else{for(var N=xoe[o-1],k=N>>>13,S=8191&N,E=(1<<l)-1,O=new pa(32768),T=new pa(E+1),P=Math.ceil(l/3),M=2*P,D=function(be){return(s[be]^s[be+1]<<P^s[be+2]<<M)&E},A=new Df(25e3),L=new pa(288),F=new pa(32),B=0,U=0,z=(w=0,0),$=0,K=0;w<p;++w){var G=D(w),W=32767&w,I=T[G];if(O[W]=I,T[G]=W,$<=w){var H=p-w;if((B>7e3||z>24576)&&H>423){y=x$(s,x,0,A,L,F,U,z,K,w-K,y),z=B=U=0,K=w;for(var V=0;V<286;++V)L[V]=0;for(V=0;V<30;++V)F[V]=0}var X=2,te=0,fe=S,ae=W-I&32767;if(H>2&&G==D(w-ae))for(var ke=Math.min(k,H)-1,xe=Math.min(32767,w),ue=Math.min(258,H);ae<=xe&&--fe&&W!=I;){if(s[w+X]==s[w+X-ae]){for(var we=0;we<ue&&s[w+we]==s[w+we-ae];++we);if(we>X){if(X=we,te=ae,we>ke)break;var Oe=Math.min(ae,we-2),ne=0;for(V=0;V<Oe;++V){var _e=w-ae+V+32768&32767,ye=_e-O[_e]+32768&32767;ye>ne&&(ne=ye,I=_e)}}}ae+=(W=I)-(I=O[W])+32768&32767}if(te){A[z++]=268435456|OS[X]<<18|m$[te];var Me=31&OS[X],qe=31&m$[te];U+=aO[Me]+sO[qe],++L[257+Me],++F[qe],$=w+X,++B}else A[z++]=s[w],++L[s[w]]}}y=x$(s,x,h,A,L,F,U,z,K,w-K,y)}return PU(g,0,u+TU(y)+d)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},U_=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function voe(e,t){t===void 0&&(t={});var n=function(){var l=4294967295;return{p:function(u){for(var d=l,h=0;h<u.length;++h)d=boe[255&d^u[h]]^d>>>8;l=d},d:function(){return 4294967295^l}}}(),r=e.length;n.p(e);var a,s=yoe(e,t,10+((a=t).filename&&a.filename.length+1||0),8),o=s.length;return function(l,u){var d=u.filename;if(l[0]=31,l[1]=139,l[2]=8,l[8]=u.level<2?4:u.level==9?2:0,l[9]=3,u.mtime!=0&&U_(l,4,Math.floor(new Date(u.mtime||Date.now())/1e3)),d){l[3]=8;for(var h=0;h<=d.length;++h)l[h+10]=d.charCodeAt(h)}}(s,t),U_(s,o-8,n.d()),U_(s,o-4,r),s}var woe=function(e){var t,n,r,a,s="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,` 57`).replace(/\r/g,` 58`)).length,a=0;a<r;a++){var o=e.charCodeAt(a),l=null;o<128?n++:l=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),zo(l)||(n>t&&(s+=e.substring(t,n)),s+=l,t=n=a+1)}return n>t&&(s+=e.substring(t,e.length)),s},joe=!!fS||!!dS,b$="text/plain",_y=function(e,t,n){var r;n===void 0&&(n=!0);var[a,s]=e.split("?"),o=Ie({},t),l=(r=s?.split("&").map(d=>{var h,[p,g]=d.split("="),x=n&&(h=o[p])!==null&&h!==void 0?h:g;return delete o[p],p+"="+x}))!==null&&r!==void 0?r:[],u=Cie(o);return u&&l.push(u),a+"?"+l.join("&")},fm=(e,t)=>JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t),q_=e=>{var{data:t,compression:n}=e;if(t){if(n===xo.GZipJS){var r=voe(function(u,d){var h=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var p=new Ns(u.length+(u.length>>>1)),g=0,x=function(N){p[g++]=N},y=0;y<h;++y){if(g+5>p.length){var w=new Ns(g+8+(h-y<<1));w.set(p),p=w}var j=u.charCodeAt(y);j<128||d?x(j):j<2048?(x(192|j>>>6),x(128|63&j)):j>55295&&j<57344?(x(240|(j=65536+(1047552&j)|1023&u.charCodeAt(++y))>>>18),x(128|j>>>12&63),x(128|j>>>6&63),x(128|63&j)):(x(224|j>>>12),x(128|j>>>6&63),x(128|63&j))}return PU(p,0,g)}(fm(t)),{mtime:0}),a=new Blob([r],{type:b$});return{contentType:b$,body:a,estimatedSize:a.size}}if(n===xo.Base64){var s=function(u){var d,h,p,g,x,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",w=0,j=0,N="",k=[];if(!u)return u;u=woe(u);do d=(x=u.charCodeAt(w++)<<16|u.charCodeAt(w++)<<8|u.charCodeAt(w++))>>18&63,h=x>>12&63,p=x>>6&63,g=63&x,k[j++]=y.charAt(d)+y.charAt(h)+y.charAt(p)+y.charAt(g);while(w<u.length);switch(N=k.join(""),u.length%3){case 1:N=N.slice(0,-2)+"==";break;case 2:N=N.slice(0,-1)+"="}return N}(fm(t)),o=(u=>"data="+encodeURIComponent(typeof u=="string"?u:fm(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=fm(t);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},F0=[];dS&&F0.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:a,estimatedSize:s}=(t=q_(e))!==null&&t!==void 0?t:{},o=new Headers;Yt(e.headers,function(h,p){o.append(p,h)}),r&&o.append("Content-Type",r);var l=e.url,u=null;if(FD){var d=new FD;u={signal:d.signal,timeout:setTimeout(()=>d.abort(),e.timeout)}}dS(l,Ie({method:e?.method||"GET",headers:o,keepalive:e.method==="POST"&&(s||0)<52428.8,body:a,signal:(n=u)==null?void 0:n.signal},e.fetchOptions)).then(h=>h.text().then(p=>{var g={statusCode:h.status,text:p};if(h.status===200)try{g.json=JSON.parse(p)}catch(x){De.error(x)}e.callback==null||e.callback(g)})).catch(h=>{De.error(h),e.callback==null||e.callback({statusCode:0,text:h})}).finally(()=>u?clearTimeout(u.timeout):null)}}),fS&&F0.push({transport:"XHR",method:e=>{var t,n=new fS;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:a}=(t=q_(e))!==null&&t!==void 0?t:{};Yt(e.headers,function(s,o){n.setRequestHeader(o,s)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(s)}},n.send(a)}}),Wa!=null&&Wa.sendBeacon&&F0.push({transport:"sendBeacon",method:e=>{var t=_y(e.url,{beacon:"1"});try{var n,{contentType:r,body:a}=(n=q_(e))!==null&&n!==void 0?n:{}
58,s=typeof a=="string"?new Blob([a],{type:r}):a;Wa.sendBeacon(t,s)}catch{}}});var $f=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function y$(e,t,n){return fm({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var RU={exact:(e,t)=>t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>$f(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!$f(n,r))),icontains:(e,t)=>t.map(Rb).some(n=>e.map(Rb).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(Rb).every(n=>e.map(Rb).every(r=>!n.includes(r)))},Rb=e=>e.toLowerCase(),H_=yr("[Error tracking]");class Noe{constructor(t){var n,r;this.Jt=[],this.Kt=new rie([new aie,new hie,new iie,new sie,new die,new uie,new lie,new fie],[Zse,tie]),this._instance=t,this.Jt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(bS))!==null&&n!==void 0?n:[]}onRemoteConfig(t){var n,r,a,s=(n=(r=t.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],o=(a=t.errorTracking)==null?void 0:a.captureExtensionExceptions;this.Jt=s,this._instance.persistence&&this._instance.persistence.register({[bS]:this.Jt,[YD]:o})}get Yt(){var t,n=!!this._instance.get_property(YD),r=this._instance.config.error_tracking.captureExtensionExceptions;return(t=r??n)!==null&&t!==void 0&&t}buildProperties(t,n){return this.Kt.buildFromUnknown(t,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(t){var n=t.$exception_list;
58if(this.Xt(n)){if(this.Qt(n))return void H_.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void H_.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void H_.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(t){if(t.length===0)return!1;var n=t.reduce((r,a)=>{var{type:s,value:o}=a;return ar(s)&&s.length>0&&r.$exception_types.push(s),ar(o)&&o.length>0&&r.$exception_values.push(o),r},{$exception_types:[],$exception_values:[]});return this.Jt.some(r=>{var a=r.values.map(s=>{var o,l=RU[s.operator],u=sn(s.value)?s.value:[s.value],d=(o=n[s.key])!==null&&o!==void 0?o:[];return u.length>0&&l(u,d)});return r.type==="OR"?a.some(Boolean):a.every(Boolean)})}Zt(t){return t.flatMap(n=>{var r,a;return(r=(a=n.stacktrace)==null?void 0:a.frames)!==null&&r!==void 0?r:[]}).some(n=>n.filename&&n.filename.startsWith("chrome-extension://"))}ti(t){if(t.length>0){var n,r,a,s,o=(n=(r=t[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],l=o[o.length-1];return(a=l==null||(s=l.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&a!==void 0&&a}return!1}Xt(t){return!an(t)&&sn(t)}}var qs=yr("[FeatureFlags]"),K_="$active_feature_flags",Bd="$override_feature_flags",v$="$feature_flag_payloads",Fp="$override_feature_flag_payloads",w$="$feature_flag_request_id",j$=e=>{var t={};for(var[n,r]of L0(e||{}))r&&(t[n]=r);return t},_oe=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(n=>t[n].enabled).filter(n=>{var r;return(r=t[n].metadata)==null?void 0:r.payload}).map(n=>{var r;return[n,(r=t[n].metadata)==null?void 0:r.payload]}))):qs.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},koe=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class Soe{constructor(t){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=t,this.featureFlagEventHandlers=[]}li(){var t=this._instance.config.evaluation_environments;return t!=null&&t.length?t.filter(n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||qs.error("Invalid evaluation environment found:",n,"Expected non-empty string"),r}):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var t=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:t})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(yS),n=this._instance.get_property(Bd),r=this._instance.get_property(Fp);if(!r&&!n)return t||{};var a=Mn({},t||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var o of s){var l,u,d=a[o],h=n?.[o],p=Ae(h)?(l=d?.enabled)!==null&&l!==void 0&&l:!!h,g=Ae(h)?d.variant:typeof h=="string"?h:void 0,x=r?.[o],y=Ie({},d,{enabled:p,variant:p?g??d?.variant:void 0});p!==d?.enabled&&(y.original_enabled=d?.enabled),g!==d?.variant&&(y.original_variant=d?.variant),x&&(y.metadata=Ie({},d?.metadata,{payload:x,original_payload:d==null||(u=d.metadata)==null?void 0:u.payload})),a[o]=y}return this.ii||(qs.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:a}),this.ii=!0),a}getFlagVariants(){var t=this._instance.get_property(df),n=this._instance.get_property(Bd);if(!n)return t||{};for(var r=Mn({},t),a=Object.keys(n),s=0;s<a.length;s++)r[a[s]]=n[a[s]];return this.ii||(qs.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var t=this._instance.get_property(v$),n=this._instance.get_property(Fp);if(!n)return t||{};for(var r=Mn({},t||{}),a=Object.keys(n),s=0;s<a.length;s++)r[a[s]]=n[a[s]];return this.ii||(qs.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:r}),this.ii=!0),r}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout(()=>{this.di()},5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.si=t}di(t){var n;if(this.vi(),!this._instance.M())if(this.ri)this.ni=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Ie({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(um)||{}),group_properties:this._instance.get_property(Uc)};(t!=null&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var a=this._instance.config.__preview_remote_config,s=a?"/flags/?v=2":"/flags/?v=2&config=true",o=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("api",s+o);a&&(r.timezone=CU()),this.ri=!0,this._instance.ci({method:"POST",url:l,data:r,compression:this._instance.config.disable_compression?void 0:xo.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:u=>{var d,h,p=!0;if(u.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),p=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((h=u.json)!==null&&h!==void 0?h:{})),!r.disable_flags||this.ni)if(this.ai=!p,u.json&&(d=u.json.quotaLimited)!=null&&d.includes(koe.FeatureFlags))qs.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var g;r.disable_flags||this.receivedFeatureFlags((g=u.json)!==null&&g!==void 0?g:{},p),this.ni&&(this.ni=!1,this.di())}}})}}getFeatureFlag(t,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],a=""+r,s=this._instance.get_property(w$)||void 0,o=this._instance.get_property(py)||{};if((n.send_event||!("send_event"in n))&&(!(t in o)||!o[t].includes(a))){var l,u,d,h,p,g,x,y,w;sn(o[t])?o[t].push(a):o[t]=[a],(l=this._instance.persistence)==null||l.register({[py]:o});var j=this.getFeatureFlagDetails(t),N={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:s,$feature_flag_bootstrapped_response:((u=this._instance.config.bootstrap)==null||(u=u.featureFlags)==null?void 0:u[t])||null,$feature_flag_bootstrapped_payload:((d=this._instance.config.bootstrap)==null||(d=d.featureFlagPayloads)==null?void 0:d[t])||null,$used_bootstrap_value:!this.ai};Ae(j==null||(h=j.metadata)==null?void 0:h.version)||(N.$feature_flag_version=j.metadata.version);var k,S=(p=j==null||(g=j.reason)==null?void 0:g.description)!==null&&p!==void 0?p:j==null||(x=j.reason)==null?void 0:x.code;S&&(N.$feature_flag_reason=S),j!=null&&(y=j.metadata)!=null&&y.id&&(N.$feature_flag_id=j.metadata.id),Ae(j?.original_variant)&&Ae(j?.original_enabled)||(N.$feature_flag_original_response=Ae(j.original_variant)?j.original_enabled:j.original_variant),j!=null&&(w=j.metadata)!=null&&w.original_payload&&(N.$feature_flag_original_payload=j==null||(k=j.metadata)==null?void 0:k.original_payload),this._instance.capture("$feature_flag_called",N)}return r}qs.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,n){var r=this._instance.config.token,a={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(a.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:a,compression:this._instance.config.disable_compression?void 0:xo.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:s=>{var o,l=(o=s.json)==null?void 0:o.featureFlagPayloads;n(l?.[t]||void 0)}})}isFeatureEnabled(t,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,n);return Ae(r)?void 0:!!r}qs.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==t)}receivedFeatureFlags(t,n){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),a=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(o,l,u,d,h){u===void 0&&(u={}),d===void 0&&(d={}),h===void 0&&(h={});var p=_oe(o),g=p.flags,x=p.featureFlags,y=p.featureFlagPayloads;if(x){var w=o.requestId;if(sn(x)){qs.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var j={};if(x)for(var N=0;N<x.length;N++)j[x[N]]=!0;l&&l.register({[K_]:x,[df]:j})}else{var k=x,S=y,E=g;o.errorsWhileComputingFlags&&(k=Ie({},u,k),S=Ie({},d,S),E=Ie({},h,E)),l&&l.register(Ie({[K_]:Object.keys(j$(k)),[df]:k||{},[v$]:S||{},[yS]:E||{}},w?{[w$]:w}:{}))}}})(t,this._instance.persistence,r,a,s),this.pi(n)}}override(t,n){n===void 0&&(n=!1),qs.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return qs.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this._instance.persistence.unregister(Bd),this._instance.persistence.unregister(Fp),void this.pi();if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.ii=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Bd);else if(r.flags)if(sn(r.flags)){for(var a={},s=0;s<r.flags.length;s++)a[r.flags[s]]=!0;this._instance.persistence.register({[Bd]:a})}else this._instance.persistence.register({[Bd]:r.flags})}return"payloads"in r&&(r.payloads===!1?this._instance.persistence.unregister(Fp):r.payloads&&this._instance.persistence.register({[Fp]:r.payloads})),void this.pi()}this.pi()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ei){var{flags:n,flagVariants:r}=this.gi();t(n,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n,r){var a,s=(this._instance.get_property(cm)||[]).find(d=>d.flagKey===t),o={["$feature_enrollment/"+t]:n},l={$feature_flag:t,$feature_enrollment:n,$set:o};s&&(l.$early_access_feature_name=s.name),r&&(l.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(o,!1);var u=Ie({},this.getFlagVariants(),{[t]:n});(a=this._instance.persistence)==null||a.register({[K_]:Object.keys(j$(u)),[df]:u}),this.pi()}getEarlyAccessFeatures(t,n,r){n===void 0&&(n=!1);var a=this._instance.get_property(cm),s=r?"&"+r.map(o=>"stage="+o).join("&"):"";if(a&&!n)return t(a);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:o=>{var l,u;if(o.json){var d=o.json.earlyAccessFeatures;return(l=this._instance.persistence)==null||l.unregister(cm),(u=this._instance.persistence)==null||u.register({[cm]:d}),t(d)}}})}gi(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(r=>n[r]),flagVariants:Object.keys(n).filter(r=>n[r]).reduce((r,a)=>(r[a]=n[a],r),{})}}pi(t){var{flags:n,flagVariants:r}=this.gi();
58this.featureFlagEventHandlers.forEach(a=>a(n,r,{errorsLoading:t}))}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(um)||{};this._instance.register({[um]:Ie({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(um)}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(Uc)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(a=>{r[a]=Ie({},r[a],t[a]),delete t[a]}),this._instance.register({[Uc]:Ie({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this._instance.get_property(Uc)||{};this._instance.register({[Uc]:Ie({},n,{[t]:{}})})}else this._instance.unregister(Uc)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var Coe=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class V_{constructor(t,n){this.C=t,this.props={},this.mi=!1,this.yi=(r=>{var a="";return r.token&&(a=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+a+"_posthog"})(t),this.Y=this.bi(t),this.load(),t.debug&&De.info("Persistence loaded",t.persistence,Ie({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.wi}bi(t){Coe.indexOf(t.persistence.toLowerCase())===-1&&(De.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=t.persistence.toLowerCase();return n==="localstorage"&&yn.H()?yn:n==="localstorage+cookie"&&Ob.H()?Ob:n==="sessionstorage"&&Sr.H()?Sr:n==="memory"?Lie:n==="cookie"?ki:Ob.H()?Ob:ki}properties(){var t={};return Yt(this.props,function(n,r){if(r===df&&Ur(n))for(var a=Object.keys(n),s=0;s<a.length;s++)t["$feature/"+a[s]]=n[a[s]];else l=r,u=!1,(zo(o=yie)?u:LD&&o.indexOf===LD?o.indexOf(l)!=-1:(Yt(o,function(d){if(u||(u=d===l))return fy}),u))||(t[r]=n);var o,l,u}),t}load(){if(!this.wi){var t=this.Y.W(this.yi);t&&(this.props=Mn({},t))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.C.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Ur(t)){Ae(n)&&(n="None"),this.xi=Ae(r)?this.$i:r;var a=!1;if(Yt(t,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=s,a=!0)}),a)return this.save(),!0}return!1}register(t,n){if(Ur(t)){this.xi=Ae(n)?this.$i:n;var r=!1;if(Yt(t,(a,s)=>{t.hasOwnProperty(s)&&this.props[s]!==a&&(this.props[s]=a,r=!0)}),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.mi){var t=wU(this.C.custom_campaign_params,this.C.mask_personal_data_properties,this.C.custom_personal_data_properties);uf(XE(t))||this.register(t),this.mi=!0}}update_search_keyword(){var t;this.register((t=Te?.referrer)?NU(t):{})}update_referrer_info(){var t;this.register_once({$referrer:_U(),$referring_domain:Te!=null&&Te.referrer&&((t=by(Te.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[NS]||this.props[_S]||this.register_once({[my]:kU(this.C.mask_personal_data_properties,this.C.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Yt([_S,NS],o=>{var l=this.props[o];l&&Yt(l,function(u,d){t["$initial_"+hS(d)]=u})});var n,r,a=this.props[my];if(a){var s=(n=SU(a),r={},Yt(n,function(o,l){r["$initial_"+hS(l)]=o}),r);Mn(t,s)}return t}safe_merge(t){return Yt(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n,r){if(this.$i=this.xi=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence){var a=this.bi(t),s=this.props;this.clear(),this.Y=a,this.props=s,this.save()}}set_disabled(t){this.wi=t,this.wi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Si&&(this.Si=t,this.remove(),this.save())}set_secure(t){t!==this.Ei&&(this.Ei=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[lm]||{};r[t]=n,this.props[lm]=r,this.save()}remove_event_timer(t){var n=(this.props[lm]||{})[t];return Ae(n)||(delete this.props[lm][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}(function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e})({});(function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e})({});var G_=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({});(function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e})({});(function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e})({});(function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e})({});var z0=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({}),N$=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_
58START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),MU=function(e){return e.Popover="popover",e.Inline="inline",e}({});class iO{constructor(){this.ki={},this.ki={}}on(t,n){return this.ki[t]||(this.ki[t]=[]),this.ki[t].push(n),()=>{this.ki[t]=this.ki[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.ki[t]||[])r(n);for(var a of this.ki["*"]||[])a(t,n)}}class Yc{constructor(t){this.Pi=new iO,this.Ti=(n,r)=>this.Ri(n,r)&&this.Ii(n,r)&&this.Ci(n,r),this.Ri=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=t,this.Oi=new Set,this.Fi=new Set}init(){var t;if(!Ae((t=this._instance)==null?void 0:t.Mi)){var n;(n=this._instance)==null||n.Mi((r,a)=>{this.on(r,a)})}}register(t){var n,r;if(!Ae((n=this._instance)==null?void 0:n.Mi)&&(t.forEach(o=>{var l,u;(l=this.Fi)==null||l.add(o),(u=o.steps)==null||u.forEach(d=>{var h;(h=this.Oi)==null||h.add(d?.event||"")})}),(r=this._instance)!=null&&r.autocapture)){var a,s=new Set;t.forEach(o=>{var l;(l=o.steps)==null||l.forEach(u=>{u!=null&&u.selector&&s.add(u?.selector)})}),(a=this._instance)==null||a.autocapture.setElementSelectors(s)}}on(t,n){var r;n!=null&&t.length!=0&&(this.Oi.has(t)||this.Oi.has(n?.event))&&this.Fi&&((r=this.Fi)==null?void 0:r.size)>0&&this.Fi.forEach(a=>{this.Ai(n,a)&&this.Pi.emit("actionCaptured",a.name)})}Di(t){this.onAction("actionCaptured",n=>t(n))}Ai(t,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.Ti(t,r))return!0;return!1}onAction(t,n){return this.Pi.on(t,n)}Ii(t,n){if(n!=null&&n.url){var r,a=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!a||typeof a!="string"||!Yc.ji(a,n?.url,n?.url_matching||"contains"))return!1}return!0}static ji(t,n,r){switch(r){case"regex":return!!le&&$f(t,n);case"exact":return n===t;case"contains":var a=Yc.Li(n).replace(/_/g,".").replace(/%/g,".*");return $f(t,a);default:return!1}}static Li(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Ci(t,n){if((n!=null&&n.href||n!=null&&n.tag_name||n!=null&&n.text)&&!this.Ni(t).some(s=>!(n!=null&&n.href&&!Yc.ji(s.href||"",n?.href,n?.href_matching||"exact"))&&(n==null||!n.tag_name||s.tag_name===n?.tag_name)&&!(n!=null&&n.text&&!Yc.ji(s.text||"",n?.text,n?.text_matching||"exact")&&!Yc.ji(s.$el_text||"",n?.text,n?.text_matching||"exact"))))return!1;if(n!=null&&n.selector){var r,a=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(!a||!a.includes(n?.selector))return!1}return!0}Ni(t){return t?.properties.$elements==null?[]:t?.properties.$elements}}var Mt=yr("[Surveys]"),PS="seenSurvey_",Eoe=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},_$=e=>{var t=""+PS+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+PS+e.id+"_"+e.current_iteration),t},Ooe=[G_.Popover,G_.Widget,G_.API],Aoe={ignoreConditions:!1,ignoreDelay:!1,displayType:MU.Popover};class Toe{constructor(t){this._instance=t,this.Ui=new Map,this.zi=new Map}register(t){var n;Ae((n=this._instance)==null?void 0:n.Mi)||(this.Hi(t),this.Bi(t))}Bi(t){var n=t.filter(r=>{var a,s;return((a=r.conditions)==null?void 0:a.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0});n.length!==0&&(this.qi==null&&(this.qi=new Yc(this._instance),this.qi.init(),this.qi.Di(r=>{this.onAction(r)})),n.forEach(r=>{var a,s,o,l,u;r.conditions&&(a=r.conditions)!=null&&a.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((l=this.qi)==null||l.register(r.conditions.actions.values),(u=r.conditions)==null||(u=u.actions)==null||(u=u.values)==null||u.forEach(d=>{if(d&&d.name){var h=this.zi.get(d.name);h&&h.push(r.id),this.zi.set(d.name,h||[r.id])}}))}))}Hi(t){var n;t.filter(r=>{var a,s;return((a=r.conditions)==null?void 0:a.events)&&((s=r.conditions)==null||(s=s.events)==null||(s=s.values)==null?void 0:s.length)>0}).length!==0&&((n=this._instance)==null||n.Mi((r,a)=>{this.onEvent(r,a)}),t.forEach(r=>{var a;(a=r.conditions)==null||(a=a.events)==null||(a=a.values)==null||a.forEach(s=>{if(s&&s.name){var o=this.Ui.get(s.name);
58o&&o.push(r.id),this.Ui.set(s.name,o||[r.id])}})}))}onEvent(t,n){var r,a,s=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[Eb])||[];if(z0.SHOWN===t&&n&&s.length>0){var o;Mt.info("survey event matched, removing survey from activated surveys",{event:t,eventPayload:n,existingActivatedSurveys:s});var l=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(l){var u=s.indexOf(l);u>=0&&(s.splice(u,1),this.Wi(s))}}else if(this.Ui.has(t)){Mt.info("survey event name matched",{event:t,eventPayload:n,surveys:this.Ui.get(t)});var d=[];(a=this._instance)==null||a.getSurveys(p=>{d=p.filter(g=>{var x;return(x=this.Ui.get(t))==null?void 0:x.includes(g.id)})});var h=d.filter(p=>{var g,x=(g=p.conditions)==null||(g=g.events)==null||(g=g.values)==null?void 0:g.find(y=>y.name===t);return!!x&&(!x.propertyFilters||Object.entries(x.propertyFilters).every(y=>{var w,[j,N]=y,k=n==null||(w=n.properties)==null?void 0:w[j];if(Ae(k)||zo(k))return!1;var S=[String(k)],E=RU[N.operator];return E?E(N.values,S):(Mt.warn("Unknown property comparison operator: "+N.operator),!1)}))});this.Wi(s.concat(h.map(p=>p.id)||[]))}}onAction(t){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[Eb])||[];this.zi.has(t)&&this.Wi(r.concat(this.zi.get(t)||[]))}Wi(t){var n;Mt.info("updating activated surveys",{activatedSurveys:t}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[Eb]:[...new Set(t)]})}getSurveys(){var t,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[Eb];return n||[]}getEventToSurveys(){return this.Ui}Gi(){return this.qi}}class Poe{constructor(t){this.Vi=void 0,this._surveyManager=null,this.Ji=!1,this.Ki=!1,this.Yi=[],this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var n=t.surveys;if(an(n))return Mt.warn("Flags not loaded yet. Not loading surveys.");var r=sn(n);this.Vi=r?n.length>0:n,Mt.info("flags response received, isSurveysEnabled: "+this.Vi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(PS)||r!=null&&r.startsWith("inProgressSurvey_"))&&t.push(r)}t.forEach(a=>localStorage.removeItem(a))}loadIfEnabled(){if(!this._surveyManager)if(this.Ki)Mt.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Mt.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Mt.info("Not loading surveys in cookieless mode without consent.");else{var t=Ze?.__PosthogExtensions__;if(t){if(!Ae(this.Vi)||this._instance.config.advanced_enable_surveys){var n=this.Vi||this._instance.config.advanced_enable_surveys;this.Ki=!0;try{var r=t.generateSurveys;if(r)return void this.Xi(r,n);var a=t.loadExternalDependency;if(!a)return void this.Qi("PostHog loadExternalDependency extension not found.");a(this._instance,"surveys",s=>{s||!t.generateSurveys?this.Qi("Could not load surveys script",s):this.Xi(t.generateSurveys,n)})}catch(s){throw this.Qi("Error initializing surveys",s),s}finally{this.Ki=!1}}}else Mt.error("PostHog Extensions not found.")}}Xi(t,n){this._surveyManager=t(this._instance,n),this._surveyEventReceiver=new Toe(this._instance),Mt.info("Surveys loaded successfully"),this.Zi({isLoaded:!0})}Qi(t,n){Mt.error(t,n),this.Zi({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Yi.push(t),this._surveyManager&&this.Zi({isLoaded:!0}),()=>{this.Yi=this.Yi.filter(n=>n!==t)}}getSurveys(t,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return Mt.info("Disabled. Not loading surveys."),t([]);var r=this._instance.get_property(vS);if(r&&!n)return t(r,{isLoaded:!0});if(this.Ji)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Ji=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:a=>{var s;this.Ji=!1;var o=a.statusCode;if(o!==200||!a.json){var l="Surveys API could not be loaded, status: "+o;return Mt.error(l),t([],{isLoaded:!1,error:l})}var u,d=a.json.surveys||[],h=d.filter(p=>function(g){return!(!g.start_date||g.end_date)}
58(p)&&(function(g){var x;return!((x=g.conditions)==null||(x=x.events)==null||(x=x.values)==null||!x.length)}(p)||function(g){var x;return!((x=g.conditions)==null||(x=x.actions)==null||(x=x.values)==null||!x.length)}(p)));return h.length>0&&((u=this._surveyEventReceiver)==null||u.register(h)),(s=this._instance.persistence)==null||s.register({[vS]:d}),t(d,{isLoaded:!0})}})}catch(a){throw this.Ji=!1,a}}Zi(t){for(var n of this.Yi)try{if(!t.isLoaded)return n([],t);this.getSurveys(n)}catch(r){Mt.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,n){if(n===void 0&&(n=!1),!an(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,n);Mt.warn("init was not called")}te(t){var n=null;return this.getSurveys(r=>{var a;n=(a=r.find(s=>s.id===t))!==null&&a!==void 0?a:null}),n}ie(t){if(an(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof t=="string"?this.te(t):t;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(an(this._surveyManager))return Mt.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ie(t);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(t,n){return an(this._surveyManager)?(Mt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(r=>{this.getSurveys(a=>{var s,o=(s=a.find(u=>u.id===t))!==null&&s!==void 0?s:null;if(o){var l=this.ie(o);r({visible:l.eligible,disabledReason:l.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(t,n){var r;if(an(this._surveyManager))Mt.warn("init was not called");else{var a=typeof t=="string"?this.te(t):t;if(a!=null&&a.id)if(Ooe.includes(a.type)){var s=Te?.querySelector(n);if(s)return(r=a.appearance)!=null&&r.surveyPopupDelaySeconds?(Mt.info("Rendering survey "+a.id+" with delay of "+a.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var o,l;Mt.info("Rendering survey "+a.id+" with delay of "+((o=a.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(l=this._surveyManager)==null||l.renderSurvey(a,s),Mt.info("Survey "+a.id+" rendered")},1e3*a.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(a,s);Mt.warn("Survey element not found")}else Mt.warn("Surveys of type "+a.type+" cannot be rendered in the app");else Mt.warn("Survey not found")}}displaySurvey(t,n){var r;if(an(this._surveyManager))Mt.warn("init was not called");else{var a=this.te(t);if(a){var s=a;if((r=a.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(s=Ie({},a,{appearance:Ie({},a.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var o=this.canRenderSurvey(a);if(!o.visible)return void Mt.warn("Survey is not eligible to be displayed: ",o.disabledReason)}n.displayType!==MU.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,n.selector)}else Mt.warn("Survey not found")}}}var k$=yr("[RateLimiter]");class Roe{constructor(t){var n,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=a=>{var s=a.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(o=>{k$.info((o||"events")+" is quota limited."),this.serverLimits[o]=new Date().getTime()+6e4})}catch(o){return void k$.warn('could not rate limit - continuing. Error: "'+o?.message+'"',{text:s})}},this.instance=t,this.captureEventsPerSecond=((n=t.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=t.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var n,r,a;t===void 0&&(t=!1);var s=new Date().getTime(),o=(n=(r=this.instance.persistence)==null?void 0:r.get_property(jS))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var l=o.tokens<1;return l||t||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,(a=this.instance.persistence)==null||a.set_property(jS,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Dc=yr("[RemoteConfig]");class Moe{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=Ze._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}ee(t){var n,r;(n=Ze.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=Ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):(Dc.error("PostHog Extensions not found. Cannot load remote config."),t())}re(t){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return Dc.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.M())return void Dc.warn("Remote config is disabled. Falling back to local config.");this.ee(t=>{if(!t)return Dc.info("No config found after loading remote JS config. Falling back to JSON."),void this.re(n=>{this.fi(n)});this.fi(t)})}catch(t){Dc.error("Error loading remote config",t)}}fi(t){t?this._instance.config.__preview_remote_config?(this._instance.fi(t),t.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):Dc.info("__preview_remote_config is disabled. Logging config instead",t):Dc.error("Failed to fetch remote config from PostHog.")}}var RS=3e3;class Doe{constructor(t,n){this.se=!0,this.ne=[],this.oe=ji(n?.flush_interval_ms||RS,250,5e3,De.createLogger("flush interval"),RS),this.ae=t}enqueue(t){this.ne.push(t),this.le||this.ue()}unload(){this.he();var t=this.ne.length>0?this.de():{},n=Object.values(t);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.ae(Ie({},r,{transport:"sendBeacon"}))})}enable(){this.se=!1,this.ue()}ue(){var t=this;this.se||(this.le=setTimeout(()=>{if(this.he(),this.ne.length>0){var n=this.de(),r=function(){var s=n[a],o=new Date().getTime();s.data&&sn(s.data)&&Yt(s.data,l=>{l.offset=Math.abs(l.timestamp-o),delete l.timestamp}),t.ae(s)};for(var a in n)r()}},this.oe))}he(){clearTimeout(this.le),this.le=void 0}de(){var t={};return Yt(this.ne,n=>{var r,a=n,s=(a?a.batchKey:null)||a.url;Ae(t[s])&&(t[s]=Ie({},a,{data:[]})),(r=t[s].data)==null||r.push(a.data)}),this.ne=[],t}}var $oe=["retriesPerformedSoFar"];class Ioe{constructor(t){this.ve=!1,this.ce=3e3,this.ne=[],this._instance=t,this.ne=[],this.fe=!0,!Ae(le)&&"onLine"in le.navigator&&(this.fe=le.navigator.onLine,this.pe=()=>{this.fe=!0,this.Dt()},this.ge=()=>{this.fe=!1},Wn(le,"online",this.pe),Wn(le,"offline",this.ge))}get length(){return this.ne.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=AB(t,$oe);Ri(n)&&n>0&&(r.url=_y(r.url,{retry_count:n})),this._instance.ci(Ie({},r,{callback:a=>{a.statusCode!==200&&(a.statusCode<400||a.statusCode>=500)&&(n??0)<10?this._e(Ie({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(a)}}))}_e(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(o){var l=3e3*Math.pow(2,o),u=l/2,d=Math.min(18e5,l),h=(Math.random()-.5)*(d-u);return Math.ceil(d+h)}(n),a=Date.now()+r;this.ne.push({retryAt:a,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),De.warn(s),this.ve||(this.ve=!0,this.me())}me(){if(this.ye&&clearTimeout(this.ye),this.ne.length===0)return this.ve=!1,void(this.ye=void 0);this.ye=setTimeout(()=>{this.fe&&this.ne.length>0&&this.Dt(),this.me()},this.ce)}Dt(){var t=Date.now(),n=[],r=this.ne.filter(s=>s.retryAt<t||(n.push(s),!1));if(this.ne=n,r.length>0)for(var{requestOptions:a}of r)this.retriableRequest(a)}unload(){for(var{requestOptions:t}of(this.ye&&(clearTimeout(this.ye),this.ye=void 0),this.ve=!1,Ae(le)||(this.pe&&(le.removeEventListener("online",this.pe),this.pe=void 0),this.ge&&(le.removeEventListener("offline",this.ge),this.ge=void 0)),this.ne))try{this._instance.ci(Ie({},t,{transport:"sendBeacon"}))}catch(n){De.error(n)}this.ne=[]}}class Loe{constructor(t){this.be=()=>{var n,r,a,s;this.we||(this.we={});var o=this.scrollElement(),l=this.scrollY(),u=o?Math.max(0,o.scrollHeight-o.clientHeight):0,d=l+(o?.clientHeight||0),h=o?.scrollHeight||0;this.we.lastScrollY=Math.ceil(l),this.we.maxScrollY=Math.max(l,(n=this.we.maxScrollY)!==null&&n!==void 0?n:0),this.we.maxScrollHeight=Math.max(u,(r=this.we.maxScrollHeight)!==null&&r!==void 0?r:0),this.we.lastContentY=d,this.we.maxContentY=Math.max(d,(a=this.we.maxContentY)!==null&&a!==void 0?a:0),this.we.maxContentHeight=Math.max(h,(s=this.we.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}getContext(){return this.we}resetContext(){var t=this.we;return setTimeout(this.be,0),t}startMeasuringScrollPosition(){Wn(le,"scroll",this.be,{capture:!0}),Wn(le,"scrollend",this.be,{capture:!0}),Wn(le,"resize",this.be)}scrollElement(){if(!this._instance.config.scroll_root_selector)return le?.document.documentElement;var t=sn(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of t){var r=le?.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return le&&(le.scrollY||le.pageYOffset||le.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return le&&(le.scrollX||le.pageXOffset||le.document.documentElement.scrollLeft)||0}}var Foe=e=>kU(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class S${constructor(t,n,r,a){this.xe=s=>{var o=this.Se();if(!o||o.sessionId!==s){var l={sessionId:s,props:this.Ee(this._instance)};this.$e.register({[wS]:l})}},this._instance=t,this.ke=n,this.$e=r,this.Ee=a||Foe,this.ke.onSessionId(this.xe)}Se(){return this.$e.props[wS]}getSetOnceProps(){var t,n=(t=this.Se())==null?void 0:t.props;return n?"r"in n?SU(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return Yt(XE(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+hS(r)]=n}),t}}
58var W_=yr("[SessionId]");class C${on(t,n){return this.Pe.on(t,n)}constructor(t,n,r){var a;if(this.Te=[],this.Re=void 0,this.Pe=new iO,this.Ie=(h,p)=>Math.abs(h-p)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.C=t.config,this.$e=t.persistence,this.Ce=void 0,this.Oe=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Fe=n||Ml,this.Me=r||Ml;var s=this.C.persistence_name||this.C.token,o=this.C.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ji(o,60,36e3,W_.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ae(),this.De="ph_"+s+"_window_id",this.je="ph_"+s+"_primary_window_exists",this.Le()){var l=Sr.W(this.De),u=Sr.W(this.je);l&&!u?this.Ce=l:Sr.V(this.De),Sr.G(this.je,!0)}if((a=this.C.bootstrap)!=null&&a.sessionID)try{var d=(h=>{var p=h.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})(this.C.bootstrap.sessionID);this.Ne(this.C.bootstrap.sessionID,new Date().getTime(),d)}catch(h){W_.error("Invalid sessionID in bootstrap",h)}this.Ue()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ae(this.Te)&&(this.Te=[]),this.Te.push(t),this.Oe&&t(this.Oe,this.Ce),()=>{this.Te=this.Te.filter(n=>n!==t)}}Le(){return this.C.persistence!=="memory"&&!this.$e.wi&&Sr.H()}ze(t){t!==this.Ce&&(this.Ce=t,this.Le()&&Sr.G(this.De,t))}He(){return this.Ce?this.Ce:this.Le()?Sr.W(this.De):null}Ne(t,n,r){t===this.Oe&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Oe=t,this.$e.register({[hy]:[n,t,r]}))}Be(){if(this.Oe&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Oe,this._sessionStartTimestamp];var t=this.$e.props[hy];return sn(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Ne(null,null,null)}destroy(){clearTimeout(this.qe),this.qe=void 0,this.Re&&le&&(le.removeEventListener("beforeunload",this.Re,{capture:!1}),this.Re=void 0),this.Te=[]}Ue(){this.Re=()=>{this.Le()&&Sr.V(this.je)},Wn(le,"beforeunload",this.Re,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.C.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[a,s,o]=this.Be(),l=this.He(),u=Ri(o)&&o>0&&Math.abs(r-o)>864e5,d=!1,h=!s,p=!t&&this.Ie(r,a);h||p||u?(s=this.Fe(),l=this.Me(),W_.info("new session ID generated",{sessionId:s,windowId:l,changeReason:{noSessionId:h,activityTimeout:p,sessionPastMaximumLength:u}}),o=r,d=!0):l||(l=this.Me(),d=!0);var g=a===0||!t||u?r:a,x=o===0?new Date().getTime():o;return this.ze(l),this.Ne(s,g,x),t||this.Ae(),d&&this.Te.forEach(y=>y(s,l,d?{noSessionId:h,activityTimeout:p,sessionPastMaximumLength:u}:void 0)),{sessionId:s,windowId:l,sessionStartTimestamp:x,changeReason:d?{noSessionId:h,activityTimeout:p,sessionPastMaximumLength:u}:void 0,lastActivityTimestamp:a}}Ae(){clearTimeout(this.qe),this.qe=setTimeout(()=>{var[t]=this.Be();if(this.Ie(new Date().getTime(),t)){var n=this.Oe;this.resetSessionId(),this.Pe.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}}var zoe=["$set_once","$set"],wl=yr("[SiteApps]");class Boe{constructor(t){this._instance=t,this.We=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ge(t,n){if(n){var r=this.globalsForEvent(n);this.We.push(r),this.We.length>1e3&&(this.We=this.We.slice(10))}}get siteAppLoaders(){var t;return(t=Ze._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.Mi(this.Ge.bind(this));this.Ve=()=>{t(),this.We=[],this.Ve=void 0}}}globalsForEvent(t){var n,r,a,s,o,l,u;if(!t)throw new Error("Event payload is required");var d={},h=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[g,x]of Object.entries(p))d[g]={id:h[g],type:g,properties:x};var{$set_once:y,$set:w}=t;return{event:Ie({},AB(t,zoe),{properties:Ie({},t.properties,w?{$set:Ie({},(n=(r=t.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},w)}:{},y?{$set_once:Ie({},(a=(s=t.properties)==null?void 0:s.$set_once)!==null&&a!==void 0?a:{},y)}:{}),elements_chain:(o=(l=t.properties)==null?void 0:l.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(u=t.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(t){var n=this.apps[t.id],r=()=>{var l;!n.errored&&this.We.length&&(wl.info("Processing "+this.We.length+" events for site app with id "+t.id),this.We.forEach(u=>n.processEvent==null?void 0:n.processEvent(u)),n.processedBuffer=!0),Object.values(this.apps).every(u=>u.processedBuffer||u.errored)&&((l=this.Ve)==null||l.call(this))},a=!1,s=l=>{n.errored=!l,n.loaded=!0,wl.info("Site app with id "+t.id+" "+(l?"loaded":"errored")),a&&r()};try{var{processEvent:o}=t.init({posthog:this._instance,callback:l=>{s(l)}});o&&(n.processEvent=o),a=!0}catch(l){wl.error("Error while initializing PostHog app with config id "+t.id,l),s(!1)}if(a&&n.loaded)try{r()}catch(l){wl.error("Error while processing buffered events PostHog app with config id "+t.id,l),n.errored=!0}}Je(){var t=this.siteAppLoaders||[];for(var n of t)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}Ke(t){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(n)}catch(a){wl.error("Error while processing event "+t.event+" for site app "+r.id,a)}}}onRemoteConfig(t){var n,r,a,s=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.Je(),void this._instance.on("eventCaptured",d=>this.Ke(d))):void wl.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ve)==null||r.call(this),(a=t.siteApps)!=null&&a.length)if(this.isEnabled){var o=function(d){var h;Ze["__$$ph_site_app_"+d]=s._instance,(h=Ze.__PosthogExtensions__)==null||h.loadSiteApp==null||h.loadSiteApp(s._instance,u,p=>{if(p)return wl.error("Error while initializing PostHog app with config id "+d,p)})};for(var{id:l,url:u}of t.siteApps)o(l)}else wl.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Uoe=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hub
58spot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],E$=function(e,t){if(!e)return!1;var n=e.toLowerCase();return Uoe.concat(t||[]).some(r=>{var a=r.toLowerCase();return n.indexOf(a)!==-1})},DU=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&E$(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some(a=>E$(a?.brand,t)))return!0}catch{}return!!e.webdriver},hm=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),O$="i.posthog.com";class qoe{constructor(t){this.Ye={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+O$,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Ye[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=hm.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=hm.EU:this.Ye[this.apiHost]=hm.CUSTOM),this.Ye[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(this.region===hm.CUSTOM)return this.apiHost+n;var r=O$+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Hoe={icontains:(e,t)=>!!le&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!le&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!le&&$f(t.href,e),not_regex:(e,t)=>!!le&&!$f(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Fr{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(a=>{Fr.Xe("retrieved web experiments from the server"),n.Qe=new Map,a.forEach(s=>{if(s.feature_flag_key){var o;n.Qe&&(Fr.Xe("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=n.Qe)==null||o.set(s.feature_flag_key,s));var l=n._instance.getFeatureFlag(s.feature_flag_key);ar(l)&&s.variants[l]&&n.Ze(s.name,l,s.variants[l].transforms)}else if(s.variants)for(var u in s.variants){var d=s.variants[u];Fr.tr(d)&&n.Ze(s.name,u,d.transforms)}})},r)},this._instance=t,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(t){if(this._is_bot())Fr.Xe("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(an(this.Qe))return this.Qe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Fr.Xe("applying feature flags",t),t.forEach(n=>{var r;if(this.Qe&&(r=this.Qe)!=null&&r.has(n)){var a,s=this._instance.getFeatureFlag(n),o=(a=this.Qe)==null?void 0:a.get(n);s&&o!=null&&o.variants[s]&&this.Ze(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){var t=Fr.getWindowLocation();if(t!=null&&t.search){var n=yy(t?.search,"__experiment_id"),r=yy(t?.search,"__experiment_variant");n&&r&&(Fr.Xe("previewing web experiments "+n+" && "+r),this.getWebExperiments(a=>{this.ir(parseInt(n),r,a)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var a=this._instance.get_property("$web_experiments");if(a&&!n)return t(a);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:s=>{if(s.statusCode!==200||!s.json)return t([]);var o=s.json.experiments||[];return t(o)}})}ir(t,n,r){var a=r.filter(s=>s.id===t);a&&a.length>0&&(Fr.Xe("Previewing web experiment ["+a[0].name+"] with variant ["+n+"]"),this.Ze(a[0].name,n,a[0].variants[n].transforms))}static tr(t){return!an(t.conditions)&&Fr.er(t)&&Fr.rr(t)}static er(t){var n;if(an(t.conditions)||an((n=t.conditions)==null?void 0:n.url))return!0;var r,a,s,o=Fr.getWindowLocation();return!!o&&((r=t.conditions)==null||!r.url||Hoe[(a=(s=t.conditions)==null?void 0:s.urlMatchType)!==null&&a!==void 0?a:"icontains"](t.conditions.url,o))}
58static getWindowLocation(){return le?.location}static rr(t){var n;if(an(t.conditions)||an((n=t.conditions)==null?void 0:n.utm))return!0;var r=wU();if(r.utm_source){var a,s,o,l,u,d,h,p,g=(a=t.conditions)==null||(a=a.utm)==null||!a.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,x=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((l=t.conditions)==null||(l=l.utm)==null?void 0:l.utm_source)==r.utm_source,y=(u=t.conditions)==null||(u=u.utm)==null||!u.utm_medium||((d=t.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,w=(h=t.conditions)==null||(h=h.utm)==null||!h.utm_term||((p=t.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return g&&y&&w&&x}return!1}static Xe(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];De.info("[WebExperiments] "+t,r)}Ze(t,n,r){this._is_bot()?Fr.Xe("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(a=>{if(a.selector){var s;Fr.Xe("applying transform of variant "+n+" for experiment "+t+" ",a);var o=(s=document)==null?void 0:s.querySelectorAll(a.selector);o?.forEach(l=>{var u=l;a.html&&(u.innerHTML=a.html),a.css&&u.setAttribute("style",a.css)})}}):Fr.Xe("Control variants leave the page unmodified.")}_is_bot(){return Wa&&this._instance?DU(Wa,this._instance.config.custom_blocked_useragents):void 0}}var Koe=yr("[PostHog ExternalIntegrations]"),Voe={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Goe{constructor(t){this._instance=t}it(t,n){var r;(r=Ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,a=>{if(a)return Koe.error("failed to load script",a);n()})}startIfEnabledOrStop(){var t=this,n=function(o){var l,u,d;!a||(l=Ze.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]||t.it(Voe[o],()=>{var h;(h=Ze.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[o])==null||h.start(t._instance)}),!a&&(u=Ze.__PosthogExtensions__)!=null&&(u=u.integrations)!=null&&u[o]&&((d=Ze.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[o])==null||d.stop())};for(var[r,a]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var MS="[SessionRecording]",zp=yr(MS);class A${get started(){var t;return!((t=this.sr)==null||!t.isStarted)}get status(){return this.sr?this.sr.status:this.nr&&!this.ar?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.nr=!1,this.lr=void 0,this._instance=t,!this._instance.sessionManager)throw zp.error("started without valid sessionManager"),new Error(MS+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(MS+' cannot be used with cookieless_mode="always"')}get ar(){var t,n=!((t=this._instance.get_property(D_))==null||!t.enabled),r=!this._instance.config.disable_session_recording,a=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return le&&n&&r&&!a}startIfEnabledOrStop(t){var n;if(!this.ar||(n=this.sr)==null||!n.isStarted){var r=!Ae(Object.assign)&&!Ae(Array.from);this.ar&&r?(this.ur(t),zp.info("starting")):this.stopRecording()}}ur(t){var n,r,a;this.ar&&(Ze!=null&&(n=Ze.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(r=Ze.__PosthogExtensions__)!=null&&r.initSessionRecording?this.hr(t):(a=Ze.__PosthogExtensions__)==null||a.loadExternalDependency==null||a.loadExternalDependency(this._instance,this.dr,s=>{if(s)return zp.error("could not load recorder",s);this.hr(t)}))}stopRecording(){var t,n;(t=this.lr)==null||t.call(this),this.lr=void 0,(n=this.sr)==null||n.stop()}vr(){var t;(t=this._instance.persistence)==null||t.unregister(zB)}cr(t){if(this._instance.persistence){var n,r,a=this._instance.persistence,s=()=>{var o=t.sessionRecording===!1?void 0:t.sessionRecording,l=o?.sampleRate,u=an(l)?null:parseFloat(l);an(u)&&this.vr();var d=o?.minimumDurationMilliseconds;a.register({[D_]:Ie({enabled:!!o},o,{networkPayloadCapture:Ie({capturePerformance:t.capturePerformance},o?.networkPayloadCapture),canvasRecording:{enabled:o?.recordCanvas,fps:o?.canvasFps,quality:o?.canvasQuality},sampleRate:u,minimumDurationMilliseconds:Ae(d)?null:d,endpoint:o?.endpoint,triggerMatchType:o?.triggerMatchType,masking:o?.masking,urlTriggers:o?.urlTriggers})})};s(),(n=this.lr)==null||n.call(this),this.lr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?t.sessionRecording!==!1?(this.cr(t),this.nr=!0,this.startIfEnabledOrStop()):this.nr=!0:zp.info("skipping remote config with no sessionRecording",t)}log(t,n){var r;n===void 0&&(n="log"),(r=this.sr)!=null&&r.log?this.sr.log(t,n):zp.warn("log called before recorder was ready")}get dr(){var t,n,r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(D_);return(r==null||(n=r.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}hr(t){var n,r;if((n=Ze.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.sr||(this.sr=(r=Ze.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.sr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.sr.start(t)}onRRwebEmit(t){var n;(n=this.sr)==null||n.onRRwebEmit==null||n.onRRwebEmit(t)}overrideLinkedFlag(){var t;(t=this.sr)==null||t.overrideLinkedFlag()}overrideSampling(){var t;(t=this.sr)==null||t.overrideSampling()}overrideTrigger(t){var n;(n=this.sr)==null||n.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.sr)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,n){var r;return!((r=this.sr)==null||!r.tryAddCustomEvent(t,n))}}var jm={},DS=()=>{},lf="posthog",$U=!joe&&ca?.indexOf("MSIE")===-1&&ca?.indexOf("Mozilla")===-1,T$=e=>{var t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:bie(Te?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:DS,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:e!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:e??"unset",debug:da&&ar(da?.search)&&da.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(le==null||(t=le.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;De.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:RS},error_tracking:{},_onCapture:DS,__preview_eager_load_replay:!1}},P$=e=>{var t={};Ae(e.process_person)||(t.person_profiles=e.process_person),Ae(e.xhr_headers)||(t.request_headers=e.x
58hr_headers),Ae(e.cookie_name)||(t.persistence_name=e.cookie_name),Ae(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),Ae(e.store_google)||(t.save_campaign_params=e.store_google),Ae(e.verbose)||(t.debug=e.verbose);var n=Mn({},t,e);return sn(e.property_blacklist)&&(Ae(e.property_denylist)?n.property_denylist=e.property_blacklist:sn(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:De.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class Woe{constructor(){this.__forceAllowLocalhost=!1}get pr(){return this.__forceAllowLocalhost}set pr(t){De.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Jv{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){this.webPerformance=new Woe,this.gr=!1,this.version=ho.LIB_VERSION,this._r=new iO,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=T$(),this.SentryIntegration=Kie,this.sentryIntegration=t=>function(n,r){var a=aU(n,r);return{name:rU,processEvent:s=>a(s)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.mr=!1,this.yr=null,this.br=null,this.wr=null,this.featureFlags=new Soe(this),this.toolbar=new Gie(this),this.scrollManager=new Loe(this),this.pageViewManager=new hoe(this),this.surveys=new Poe(this),this.experiments=new Fr(this),this.exceptions=new Noe(this),this.rateLimiter=new Roe(this),this.requestRouter=new qoe(this),this.consent=new Fie(this),this.externalIntegrations=new Goe(this),this.people={set:(t,n,r)=>{var a=ar(t)?{[t]:n}:t;this.setPersonProperties(a),r?.({})},set_once:(t,n,r)=>{var a=ar(t)?{[t]:n}:t;this.setPersonProperties(void 0,a),r?.({})}},this.on("eventCaptured",t=>De.info('send "'+t?.event+'"',t))}init(t,n,r){if(r&&r!==lf){var a,s=(a=jm[r])!==null&&a!==void 0?a:new Jv;return s._init(t,n,r),jm[r]=s,jm[lf][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var a,s;if(n===void 0&&(n={}),Ae(t)||pS(t))return De.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Sr(n.debug),this.Er=n,this.$r=[],n.person_profiles&&(this.br=n.person_profiles),this.set_config(Mn({},T$(n.defaults),P$(n),{name:r,token:t})),this.config.on_xhr_error&&De.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:xo.GZipJS;var o=this.kr();this.persistence=new V_(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new V_(Ie({},this.config,{persistence:"sessionStorage"}),o);var l=Ie({},this.persistence.props),u=Ie({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Pr=new Doe(S=>this.Tr(S),this.config.request_queue_config),this.Rr=new Ioe(this),this.__request_queue=[];var d=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(d||(this.sessionManager=new C$(this),this.sessionPropsManager=new S$(this,this.sessionManager,this.persistence)),new Yie(this).startIfEnabledOrStop(),this.siteApps=new Boe(this),(a=this.siteApps)==null||a.init(),d||(this.sessionRecording=new A$(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Tie(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new foe(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new uoe(this),this.exceptionObserver=new
58Uie(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new nU(this,Bie),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new qie(this),this.historyAutocapture.startIfEnabled(),ho.DEBUG=ho.DEBUG||this.config.debug,ho.DEBUG&&De.info("Starting in debug mode",{this:this,config:n,thisC:Ie({},this.config),p:l,s:u}),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var h,p,g=this.config.get_device_id(Ml()),x=(h=n.bootstrap)!=null&&h.isIdentifiedID?g:n.bootstrap.distinctID;this.persistence.set_property(po,(p=n.bootstrap)!=null&&p.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:x})}if(this.Ir()){var y,w,j=Object.keys(((y=n.bootstrap)==null?void 0:y.featureFlags)||{}).filter(S=>{var E;return!((E=n.bootstrap)==null||(E=E.featureFlags)==null||!E[S])}).reduce((S,E)=>{var O;return S[E]=((O=n.bootstrap)==null||(O=O.featureFlags)==null?void 0:O[E])||!1,S},{}),N=Object.keys(((w=n.bootstrap)==null?void 0:w.featureFlagPayloads)||{}).filter(S=>j[S]).reduce((S,E)=>{var O,T;return(O=n.bootstrap)!=null&&(O=O.featureFlagPayloads)!=null&&O[E]&&(S[E]=(T=n.bootstrap)==null||(T=T.featureFlagPayloads)==null?void 0:T[E]),S},{});this.featureFlags.receivedFeatureFlags({featureFlags:j,featureFlagPayloads:N})}if(d)this.register_once({distinct_id:Mp,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(Ml());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(po,"anonymous")}return Wn(le,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?Hie(this,()=>this.Cr()):this.Cr(),Fl(this.config._onCapture)&&this.config._onCapture!==DS&&(De.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",S=>this.config._onCapture(S.event,S))),this.config.ip&&De.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}fi(t){var n,r,a,s,o,l,u,d;if(!Te||!Te.body)return De.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.fi(t)},500);this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=ut(t.supportedCompression,xo.GZipJS)?xo.GZipJS:ut(t.supportedCompression,xo.Base64)?xo.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.br?this.br:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(t),(a=this.sessionRecording)==null||a.onRemoteConfig(t),(s=this.autocapture)==null||s.onRemoteConfig(t),(o=this.heatmaps)==null||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),(l=this.webVitalsAutocapture)==null||l.onRemoteConfig(t),(u=this.exceptionObserver)==null||u.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),(d=this.deadClicksAutocapture)==null||d.onRemoteConfig(t)}Cr(){try{this.config.loaded(this)}catch(t){De.critical("`loaded` function failed",t)}this.Or(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Fr()},1),new Moe(this).load(),this.featureFlags.flags()}Or(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Pr)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Bl(this.__request_queue,t=>this.Tr(t)),this.__request_queue=[],this.Or()}_handle_unload(){var t,n;this.config.request_batching?(this.Mr()&&this.capture("$pageleave"),(t=this.Pr)==null||t.unload(),(n=this.Rr)==null||n.unload()):this.Mr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(t){this.__loaded&&($U?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=_y(t.url,{ip:this.config.ip?1:0}),t.headers=Ie({},this.config.request_headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,
58(n=>{var r,a,s,o=Ie({},n);o.timeout=o.timeout||6e4,o.url=_y(o.url,{_:new Date().getTime().toString(),ver:ho.LIB_VERSION,compression:o.compression});var l=(r=o.transport)!==null&&r!==void 0?r:"fetch",u=F0.filter(h=>!o.disableTransport||!h.transport||!o.disableTransport.includes(h.transport)),d=(a=(s=IB(u,h=>h.transport===l))==null?void 0:s.method)!==null&&a!==void 0?a:u[0].method;if(!d)throw new Error("No available transport method");d(o)})(Ie({},t,{callback:n=>{var r,a;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(a=this.config).on_request_error)==null||r.call(a,n)),t.callback==null||t.callback(n)}}))))}Tr(t){this.Rr?this.Rr.retriableRequest(t):this.ci(t)}_execute_array(t){var n,r=[],a=[],s=[];Bl(t,l=>{l&&(n=l[0],sn(n)?s.push(l):Fl(l)?l.call(this):sn(l)&&n==="alias"?r.push(l):sn(l)&&n.indexOf("capture")!==-1&&Fl(this[n])?s.push(l):a.push(l))});var o=function(l,u){Bl(l,function(d){if(sn(d[0])){var h=u;Yt(d,function(p){h=h[p[0]].apply(h,p.slice(1))})}else this[d[0]].apply(this,d.slice(1))},u)};o(r,this),o(a,this),o(s,this)}Ir(){var t,n;return((t=this.config.bootstrap)==null?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,n,r){var a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Pr){if(this.is_capturing())if(!Ae(t)&&ar(t)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){n!=null&&n.$current_url&&!ar(n?.$current_url)&&(De.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,l=r?.timestamp||o,u=Ml(),d={uuid:u,event:t,properties:this.calculateEventProperties(t,n||{},l,u)};s&&(d.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(d.$set=r?.$set);var h,p=this.Ar(r?.$set_once);if(p&&(d.$set_once=p),(d=gie(d,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,Ae(r?.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=o),t===z0.DISMISSED||t===z0.SENT){var g=n?.[N$.SURVEY_ID],x=n?.[N$.SURVEY_ITERATION];h={id:g,current_iteration:x},localStorage.getItem(_$(h))||localStorage.setItem(_$(h),"true"),d.$set=Ie({},d.$set,{[Eoe({id:g,current_iteration:x},t===z0.SENT?"responded":"dismissed")]:!0})}var y=Ie({},d.properties.$set,d.$set);if(uf(y)||this.setPersonPropertiesForFlags(y),!an(this.config.before_send)){var w=this.Dr(d);if(!w)return;d=w}this._r.emit("eventCaptured",d);var j={method:"POST",url:(a=r?._url)!==null&&a!==void 0?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Tr(j):this.Pr.enqueue(j),d}De.critical("This capture call is ignored due to client rate limiting.")}}else De.error("No event name provided to posthog.capture")}else De.uninitializedWarning("posthog.capture")}Mi(t){return this.on("eventCaptured",n=>t(n.event,n))}calculateEventProperties(t,n,r,a,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=s?void 0:this.persistence.remove_event_timer(t),l=Ie({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(l.$cookieless_mode=!0),t==="$snapshot"){var u=Ie({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=u.distinct_id,(!ar(l.distinct_id)&&!Ri(l.distinct_id)||pS(l.distinct_id))&&De.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var d,h=coe(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:p,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());l.$session_id=p,l.$window_id=g}this.sessionPropsManager&&Mn(l,this.sessionPropsManager.getSessionProps());try{var x;this.sessionRecording&&Mn(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(x=this.Rr)==null?void 0:x.length}catch(N){l.$sdk_debug_error_capturing_properties=String(N)}if(this.requestRouter.region===hm.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),d=t!=="$pageview"||s?t!=="$pageleave"||s?this.pageViewM
58anager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,a),l=Mn(l,d),t==="$pageview"&&Te&&(l.title=Te.title),!Ae(o)){var y=r.getTime()-o;l.$duration=parseFloat((y/1e3).toFixed(3))}ca&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=Mn({},h,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),sn(this.config.property_denylist)?Yt(this.config.property_denylist,function(N){delete l[N]}):De.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var w=this.config.sanitize_properties;w&&(De.error("sanitize_properties is deprecated. Use before_send instead"),l=w(l,t));var j=this.jr();return l.$process_person_profile=j,j&&!s&&this.Lr("_calculate_event_properties"),l}Ar(t){var n;if(!this.persistence||!this.jr()||this.gr)return t;var r=this.persistence.get_initial_props(),a=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),s=Mn({},r,a||{},t||{}),o=this.config.sanitize_properties;return o&&(De.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),this.gr=!0,uf(s)?void 0:s}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var a;(a=this.persistence)==null||a.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}Nr(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(t,n,r)}on(t,n){return this._r.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}displaySurvey(t,n){n===void 0&&(n=Aoe),this.surveys.displaySurvey(t,n)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(t,n)}identify(t,n,r){if(!this.__loaded||!this.persistence)return De.uninitializedWarning("posthog.identify");if(Ri(t)&&(t=t.toString(),De.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))De.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==Mp){if(this.Lr("posthog.identify")){var a=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==a&&t!==this.get_property(om)&&(this.unregister(om),this.register({distinct_id:t}));var o=(this.persistence.get_property(po)||"anonymous")==="anonymous";t!==a&&o?(this.persistence.set_property(po,"identified"),this.setPersonPropertiesForFlags(Ie({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:a},{$set:n||{},$set_once:r||{}}),this.wr=y$(t,n,r),this.featureFlags.setAnonymousDistinctId(a)):(n||r)&&this.setPersonProperties(n,r),t!==a&&(this.reloadFeatureFlags(),this.unregister(py))}}else De.critical('The string "'+Mp+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else De.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.Lr("posthog.setPersonProperties")){var r=y$(this.get_distinct_id(),t,n);this.wr!==r?(this.setPersonPropertiesForFlags(Ie({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.wr=r):De.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){if(this.Lr("posthog.group")){var a=this.getGroups();a[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Ie({},a,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),a[t]===n||r||this.reloadFeatureFlags()}}else De.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0),this.Lr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,r,a,s;if(De.info("reset"),!this.__loaded)return De.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(a=this.persistence)==null||a.set_property(po,"anonymous"),(s=this.sessionManager)==null||s.resetSessionId(),this.wr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Mp,$device_id:null},"");else{var l=this.config.get_device_id(Ml());this.register_once({distinct_id:l,$device_id:t?l:o},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),a=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var s,o=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return a;a+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return a}
58alias(t,n){return t===this.get_property(LB)?(De.critical("Attempting to create alias for existing People user - aborting."),-2):this.Lr("posthog.alias")?(Ae(n)&&(n=this.get_distinct_id()),t!==n?(this.Nr(om,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(De.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=Ie({},this.config);if(Ur(t)){var r,a,s,o,l;Mn(this.config,P$(t));var u=this.kr();(r=this.persistence)==null||r.update_config(this.config,n,u),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new V_(Ie({},this.config,{persistence:"sessionStorage"}),u);var d=this.Sr(this.config.debug);zl(d)&&(this.config.debug=d),zl(this.config.debug)&&(this.config.debug?(ho.DEBUG=!0,yn.H()&&yn.G("ph_debug","true"),De.info("set_config",{config:t,oldConfig:n,newConfig:Ie({},this.config)})):(ho.DEBUG=!1,yn.H()&&yn.V("ph_debug"))),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(o=this.heatmaps)==null||o.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ur(),(l=this.externalIntegrations)==null||l.startIfEnabledOrStop()}}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var a,s,o,l,u;(a=this.sessionManager)==null||a.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)==null||u.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){var r=new Error("PostHog syntheticException"),a=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Ie({},a,n))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:lf;return n!==lf&&(n=lf+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(po))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(po))==="identified"}jr(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&uf(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[om])&&((n=this.persistence)==null||(n=n.props)==null||!n[gy]))}Mr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.jr()||this.Lr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Lr(t){return this.config.person_profiles==="never"?(De.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Nr(gy,!0),!0)}kr(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||t&&!!n}Ur(){var t,n,r,a,s=this.kr();return((t=this.persistence)==null?void 0:t.wi)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.wi)!==s&&((a=this.sessionPersistence)==null||a.set_disabled(s)),s}opt_in_capturing(t){if(this.config.cookieless_mode!=="always"){var n,r;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(n=this.sessionManager)==null||n.destroy(),this.sessionManager=new C$(this),this.persistence&&(this.sessionPropsManager=new S$(this,this.sessionManager,this.persistence)),this.sessionRecording=new A$(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Ur(),this.Or(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(Ae(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((r=t?.captureEventName)!==null&&r!==void 0?r:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Fr()}
58else De.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Ur(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Mp,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Fr())):De.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===mo.GRANTED?"granted":t===mo.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Ur()}_is_bot(){return Wa?DU(Wa,this.config.custom_blocked_useragents):void 0}Fr(){Te&&(Te.visibilityState==="visible"?this.mr||(this.mr=!0,this.capture("$pageview",{title:Te.title},{send_instantly:!0}),this.yr&&(Te.removeEventListener("visibilitychange",this.yr),this.yr=null)):this.yr||(this.yr=this.Fr.bind(this),Wn(Te,"visibilitychange",this.yr)))}debug(t){t===!1?(le?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(le?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}M(){var t,n,r,a,s,o,l,u=this.Er||{};return"advanced_disable_flags"in u?!!u.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(De.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",a=!1,s=De,o=(n="advanced_disable_flags")in(t=u)&&!Ae(t[n]),l=r in t&&!Ae(t[r]),o?t[n]:l?(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):a)}Dr(t){if(an(this.config.before_send))return t;var n=sn(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var a of n){if(r=a(r),an(r)){var s="Event '"+t.event+"' was rejected in beforeSend function";return qse(t.event)?De.warn(s+". This can cause unexpected behavior."):De.info(s),null}r.properties&&!uf(r.properties)||De.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.Vt)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Sr(t){var n=zl(t)&&!t,r=yn.H()&&yn.q("ph_debug")==="true";return!n&&(!!r||t)}}(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=mie(e.prototype[t[n]])})(Jv,["identify"]);var R$,bi=(R$=jm[lf]=new Jv,function(){function e(){e.done||(e.done=!0,$U=!1,Yt(jm,function(t){t._dom_loaded()}))}Te!=null&&Te.addEventListener?Te.readyState==="complete"?e():Wn(Te,"DOMContentLoaded",e,{capture:!1}):le&&De.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),R$),IU=v.createContext({client:bi});function LU(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var s=0,o=r;s<o.length;s++){var l=o[s];if(!a.includes(l)||!LU(e[l],t[l],n))return!1}return!0}function Yoe(e){var t=e.children,n=e.client,r=e.apiKey,a=e.options,s=v.useRef(null),o=v.useMemo(function(){return n?(r&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n):(r||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),bi)},[n,r,JSON.stringify(a)]);return v.useEffect(function(){if(!n){var l=s.current;l?(r!==l.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!LU(a,l.options)&&bi.set_config(a),s.current={apiKey:r,options:a??{}}):(bi.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),bi.init(r,a),s.current={apiKey:r,options:a??{}})}},[n,r,JSON.stringify(a)]),ve.createElement(IU.Provider,{value:{client:o}},t)}
58var $S=function(e,t){return $S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},$S(e,t)};function Xoe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");$S(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Y_=function(e){return typeof e=="function"},Qoe={componentStack:null,exceptionEvent:null,error:null},Zoe={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){Xoe(t,e);function t(n){var r=e.call(this,n)||this;return r.state=Qoe,r}return t.prototype.componentDidCatch=function(n,r){var a=this.props.additionalProperties,s;Y_(a)?s=a(n):typeof a=="object"&&(s=a);var o=this.context.client,l=o.captureException(n,s),u=r.componentStack;this.setState({error:n,componentStack:u,exceptionEvent:l})},t.prototype.render=function(){var n=this.props,r=n.children,a=n.fallback,s=this.state;if(s.componentStack==null)return Y_(r)?r():r;var o=Y_(a)?ve.createElement(a,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):a;return ve.isValidElement(o)?o:(console.warn(Zoe.INVALID_FALLBACK),ve.createElement(ve.Fragment,null))},t.contextType=IU,t})(ve.Component);const Joe={maskAllInputs:!0,maskTextSelector:"*",blockSelector:".recharts-wrapper, .recharts-surface, .ph-no-capture"},ele={api_host:"https://us.i.posthog.com",defaults:"2025-05-24",person_profiles:"always",session_recording:Joe},ql=(e,t)=>{try{t&&typeof t=="object"&&typeof t.data=="object"&&t.data!==null?bi.capture(e,{...t.data}):t?bi.capture(e,{...t}):bi.capture(e,{})}catch{}};/** 59 * @license lucide-react v0.525.0 - ISC 60 * 61 * This source code is licensed under the ISC license. 62 * See the LICENSE file in the root directory of this source tree. 63 */const tle=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nle=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),M$=e=>{const t=nle(e);return t.charAt(0).toUpperCase()+t.slice(1)},FU=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),rle=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** 64 * @license lucide-react v0.525.0 - ISC 65 * 66 * This source code is licensed under the ISC license. 67 * See the LICENSE file in the root directory of this source tree. 68 */var ale={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 69 * @license lucide-react v0.525.0 - ISC 70 * 71 * This source code is licensed under the ISC license. 72 * See the LICENSE file in the root directory of this source tree. 73 */const sle=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:o,...l},u)=>v.createElement("svg",{ref:u,...ale,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:FU("lucide",a),...!s&&!rle(l)&&{"aria-hidden":"true"},...l},[...o.map(([d,h])=>v.createElement(d,h)),...Array.isArray(s)?s:[s]]));/** 74 * @license lucide-react v0.525.0 - ISC 75 * 76 * This source code is licensed under the ISC license. 77 * See the LICENSE file in the root directory of this source tree. 78 */const Se=(e,t)=>{const n=v.forwardRef(({className:r,...a},s)=>v.createElement(sle,{ref:s,iconNode:t,className:FU(`lucide-${tle(M$(e))}`,`lucide-${e}`,r),...a}));return n.displayName=M$(e),n};/** 79 * @license lucide-react v0.525.0 - ISC 80 * 81 * This source code is licensed under the ISC license. 82 * See the LICENSE file in the root directory of this source tree. 83 */const ile=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],ole=Se("arrow-down-right",ile);/** 84 * @license lucide-react v0.525.0 - ISC 85 * 86 * This source code is licensed under the ISC license. 87 * See the LICENSE file in the root directory of this source tree. 88 */const lle=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],cle=Se("arrow-down-to-line",lle);
88/** 89 * @license lucide-react v0.525.0 - ISC 90 * 91 * This source code is licensed under the ISC license. 92 * See the LICENSE file in the root directory of this source tree. 93 */const ule=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],dle=Se("arrow-left-right",ule);/** 94 * @license lucide-react v0.525.0 - ISC 95 * 96 * This source code is licensed under the ISC license. 97 * See the LICENSE file in the root directory of this source tree. 98 */const fle=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ky=Se("arrow-left",fle);/** 99 * @license lucide-react v0.525.0 - ISC 100 * 101 * This source code is licensed under the ISC license. 102 * See the LICENSE file in the root directory of this source tree. 103 */const hle=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],zu=Se("arrow-right",hle);/** 104 * @license lucide-react v0.525.0 - ISC 105 * 106 * This source code is licensed under the ISC license. 107 * See the LICENSE file in the root directory of this source tree. 108 */const ple=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],mle=Se("arrow-up-down",ple);/** 109 * @license lucide-react v0.525.0 - ISC 110 * 111 * This source code is licensed under the ISC license. 112 * See the LICENSE file in the root directory of this source tree. 113 */const gle=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],xle=Se("arrow-up-right",gle);/** 114 * @license lucide-react v0.525.0 - ISC 115 * 116 * This source code is licensed under the ISC license. 117 * See the LICENSE file in the root directory of this source tree. 118 */const ble=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],yle=Se("book-open",ble);/** 119 * @license lucide-react v0.525.0 - ISC 120 * 121 * This source code is licensed under the ISC license. 122 * See the LICENSE file in the root directory of this source tree. 123 */const vle=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],zU=Se("calendar-days",vle);/** 124 * @license lucide-react v0.525.0 - ISC 125 * 126 * This source code is licensed under the ISC license. 127 * See the LICENSE file in the root directory of this source tree. 128 */const wle=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],jle=Se("calendar",wle);/** 129 * @license lucide-react v0.525.0 - ISC 130 * 131 * This source code is licensed under the ISC license. 132 * See the LICENSE file in the root directory of this source tree. 133 */const Nle=[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]],Bo=Se("chart-no-axes-column",Nle);/** 134 * @license lucide-react v0.525.0 - ISC 135 * 136 * This source code is licensed under the ISC license. 137 * See the LICENSE file in the root directory of this source tree. 138 */const _le=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],oO=Se("chart-pie",_le);/** 139 * @license lucide-react v0.525.0 - ISC 140 * 141 * This source code is licensed under the ISC license. 142 * See the LICENSE file in the root directory of this source tree. 143 */const kle=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zt=Se("check",kle);/** 144 * @license lucide-react v0.525.0 - ISC 145 * 146 * This source code is licensed under the ISC license. 147 * See the LICENSE file in the root directory of this source tree. 148 */const Sle=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ca=Se("chevron-down",Sle);/** 149 * @license lucide-react v0.525.0 - ISC 150 * 151 * This source code is licensed under the ISC license. 152 * See the LICENSE file in the root directory of this source tree. 153 */const Cle=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],va=Se("chevron-right",Cle);/** 154 * @license lucide-react v0.525.0 - ISC 155 * 156 * This source code is licensed under the ISC license. 157 * See the LICENSE file in the root directory of this source tree. 158 */const Ele=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],BU=Se("chevron-up",Ele);/** 159 * @license lucide-react v0.525.0 - ISC 160 * 161 * This source code is licensed under the ISC license. 162 * See the LICENSE file in the root directory of this source tree. 163 */const Ole=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Qt=Se("circle-alert",Ole);/** 164 * @license lucide-react v0.525.0 - ISC 165 * 166 * This source code is licensed under the ISC license. 167 * See the LICENSE file in the root directory of this source tree. 168 */const Ale=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],vs=Se("circle-check-big",Ale);
168/** 169 * @license lucide-react v0.525.0 - ISC 170 * 171 * This source code is licensed under the ISC license. 172 * See the LICENSE file in the root directory of this source tree. 173 */const Tle=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],e1=Se("circle-question-mark",Tle);/** 174 * @license lucide-react v0.525.0 - ISC 175 * 176 * This source code is licensed under the ISC license. 177 * See the LICENSE file in the root directory of this source tree. 178 */const Ple=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],xr=Se("clock",Ple);/** 179 * @license lucide-react v0.525.0 - ISC 180 * 181 * This source code is licensed under the ISC license. 182 * See the LICENSE file in the root directory of this source tree. 183 */const Rle=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]],t1=Se("cloud-off",Rle);/** 184 * @license lucide-react v0.525.0 - ISC 185 * 186 * This source code is licensed under the ISC license. 187 * See the LICENSE file in the root directory of this source tree. 188 */const Mle=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Yn=Se("cloud",Mle);/** 189 * @license lucide-react v0.525.0 - ISC 190 * 191 * This source code is licensed under the ISC license. 192 * See the LICENSE file in the root directory of this source tree. 193 */const Dle=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],$le=Se("copy",Dle);/** 194 * @license lucide-react v0.525.0 - ISC 195 * 196 * This source code is licensed under the ISC license. 197 * See the LICENSE file in the root directory of this source tree. 198 */const Ile=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],ea=Se("credit-card",Ile);/** 199 * @license lucide-react v0.525.0 - ISC 200 * 201 * This source code is licensed under the ISC license. 202 * See the LICENSE file in the root directory of this source tree. 203 */const Lle=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],rc=Se("database",Lle);/** 204 * @license lucide-react v0.525.0 - ISC 205 * 206 * This source code is licensed under the ISC license. 207 * See the LICENSE file in the root directory of this source tree. 208 */const Fle=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],Uo=Se("dollar-sign",Fle);/** 209 * @license lucide-react v0.525.0 - ISC 210 * 211 * This source code is licensed under the ISC license. 212 * See the LICENSE file in the root directory of this source tree. 213 */const zle=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ble=Se("download",zle);/** 214 * @license lucide-react v0.525.0 - ISC 215 * 216 * This source code is licensed under the ISC license. 217 * See the LICENSE file in the root directory of this source tree. 218 */const Ule=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],qle=Se("ellipsis",Ule);/** 219 * @license lucide-react v0.525.0 - ISC 220 * 221 * This source code is licensed under the ISC license. 222 * See the LICENSE file in the root directory of this source tree. 223 */const Hle=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Kle=Se("expand",Hle);/** 224 * @license lucide-react v0.525.0 - ISC 225 * 226 * This source code is licensed under the ISC license. 227 * See the LICENSE file in the root directory of this source tree. 228 */const Vle=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],n1=Se("external-link",Vle);/** 229 * @license lucide-react v0.525.0 - ISC 230 * 231 * This source code is licensed under the ISC license. 232 * See the LICENSE file in the root directory of this source tree. 233 */const Gle=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],UU=Se("eye",Gle);/** 234 * @license lucide-react v0.525.0 - ISC 235 * 236 * This source code is licensed under the ISC license. 237 * See the LICENSE file in the root directory of this source tree. 238 */const Wle=[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",ke
238y:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],Yle=Se("file-question-mark",Wle);/** 239 * @license lucide-react v0.525.0 - ISC 240 * 241 * This source code is licensed under the ISC license. 242 * See the LICENSE file in the root directory of this source tree. 243 */const Xle=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ri=Se("file-text",Xle);/** 244 * @license lucide-react v0.525.0 - ISC 245 * 246 * This source code is licensed under the ISC license. 247 * See the LICENSE file in the root directory of this source tree. 248 */const Qle=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Zle=Se("file-warning",Qle);/** 249 * @license lucide-react v0.525.0 - ISC 250 * 251 * This source code is licensed under the ISC license. 252 * See the LICENSE file in the root directory of this source tree. 253 */const Jle=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],qU=Se("globe",Jle);/** 254 * @license lucide-react v0.525.0 - ISC 255 * 256 * This source code is licensed under the ISC license. 257 * See the LICENSE file in the root directory of this source tree. 258 */const ece=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],HU=Se("house",ece);/** 259 * @license lucide-react v0.525.0 - ISC 260 * 261 * This source code is licensed under the ISC license. 262 * See the LICENSE file in the root directory of this source tree. 263 */const tce=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],r1=Se("inbox",tce);/** 264 * @license lucide-react v0.525.0 - ISC 265 * 266 * This source code is licensed under the ISC license. 267 * See the LICENSE file in the root directory of this source tree. 268 */const nce=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],na=Se("info",nce);/** 269 * @license lucide-react v0.525.0 - ISC 270 * 271 * This source code is licensed under the ISC license. 272 * See the LICENSE file in the root directory of this source tree. 273 */const rce=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],lO=Se("landmark",rce);/** 274 * @license lucide-react v0.525.0 - ISC 275 * 276 * This source code is licensed under the ISC license. 277 * See the LICENSE file in the root directory of this source tree. 278 */const ace=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],sce=Se("layout-grid",ace);/** 279 * @license lucide-react v0.525.0 - ISC 280 * 281 * This source code is licensed under the ISC license. 282 * See the LICENSE file in the root directory of this source tree. 283 */const ice=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Fi=Se("link-2",ice);/** 284 * @license lucide-react v0.525.0 - ISC 285 * 286 * This source code is licensed under the ISC license. 287 * See the LICENSE file in the root directory of this source tree. 288 */const oce=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Zs=Se("link",oce);/** 289 * @license lucide-react v0.525.0 - ISC 290 * 291 * This source code is licensed under the ISC license. 292 * See the LICENSE file in the root directory of this source tree. 293 */const lce=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}
293]],cce=Se("list",lce);/** 294 * @license lucide-react v0.525.0 - ISC 295 * 296 * This source code is licensed under the ISC license. 297 * See the LICENSE file in the root directory of this source tree. 298 */const uce=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cO=Se("loader-circle",uce);/** 299 * @license lucide-react v0.525.0 - ISC 300 * 301 * This source code is licensed under the ISC license. 302 * See the LICENSE file in the root directory of this source tree. 303 */const dce=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],jg=Se("lock",dce);/** 304 * @license lucide-react v0.525.0 - ISC 305 * 306 * This source code is licensed under the ISC license. 307 * See the LICENSE file in the root directory of this source tree. 308 */const fce=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],uO=Se("log-out",fce);/** 309 * @license lucide-react v0.525.0 - ISC 310 * 311 * This source code is licensed under the ISC license. 312 * See the LICENSE file in the root directory of this source tree. 313 */const hce=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],If=Se("mail",hce);/** 314 * @license lucide-react v0.525.0 - ISC 315 * 316 * This source code is licensed under the ISC license. 317 * See the LICENSE file in the root directory of this source tree. 318 */const pce=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],mce=Se("maximize-2",pce);/** 319 * @license lucide-react v0.525.0 - ISC 320 * 321 * This source code is licensed under the ISC license. 322 * See the LICENSE file in the root directory of this source tree. 323 */const gce=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],xce=Se("menu",gce);/** 324 * @license lucide-react v0.525.0 - ISC 325 * 326 * This source code is licensed under the ISC license. 327 * See the LICENSE file in the root directory of this source tree. 328 */const bce=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],KU=Se("message-square",bce);/** 329 * @license lucide-react v0.525.0 - ISC 330 * 331 * This source code is licensed under the ISC license. 332 * See the LICENSE file in the root directory of this source tree. 333 */const yce=[["path",{d:"M5 12h14",key:"1ays0h"}]],vce=Se("minus",yce);/** 334 * @license lucide-react v0.525.0 - ISC 335 * 336 * This source code is licensed under the ISC license. 337 * See the LICENSE file in the root directory of this source tree. 338 */const wce=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],jce=Se("paperclip",wce);/** 339 * @license lucide-react v0.525.0 - ISC 340 * 341 * This source code is licensed under the ISC license. 342 * See the LICENSE file in the root directory of this source tree. 343 */const Nce=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Si=Se("pencil",Nce);/** 344 * @license lucide-react v0.525.0 - ISC 345 * 346 * This source code is licensed under the ISC license. 347 * See the LICENSE file in the root directory of this source tree. 348 */const _ce=[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]],kce=Se("plane",_ce);/** 349 * @license lucide-react v0.525.0 - ISC 350 * 351 * This source code is licensed under the ISC license. 352 * See the LICENSE file in the root directory of this source tree. 353 */const Sce=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qs=Se("plus",Sce);/** 354 * @license lucide-react v0.525.0 - ISC 355 * 356 * This source code is licensed under the ISC license. 357 * See the LICENSE file in the root directory of this source tree. 358 */const Cce=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],dt=Se("refresh-cw",Cce);/** 359 * @license lucide-react v0.525.0 - ISC 360 * 361 * This source code is licensed under the ISC license. 362 * See the LICENSE file in the root directory of this source tree. 363 */const Ece=[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]],dO=Se("repeat",Ece);/** 364 * @license lucide-react v0.525.0 - ISC 365 * 366 * This source code is licensed under the ISC license. 367 * See the LICENSE file in the root directory of this source tree. 368 */const Oce=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ace=Se("rotate-ccw",Oce);/** 369 * @license lucide-react v0.525.0 - ISC 370 * 371 * This source code is licensed under the ISC license. 372 * See the LICENSE file in the root directory of this source tree. 373 */const Tce=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Pce=Se("rotate-cw",Tce);/** 374 * @license lucide-react v0.525.0 - ISC 375 * 376 * This source code is licensed under the ISC license. 377 * See the LICENSE file in the root directory of this source tree. 378 */const Rce=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Mce=Se("search-x",Rce);/** 379 * @license lucide-react v0.525.0 - ISC 380 * 381 * This source code is licensed under the ISC license. 382 * See the LICENSE file in the root directory of this source tree. 383 */const Dce=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],uh=Se("search",Dce);/** 384 * @license lucide-react v0.525.0 - ISC 385 * 386 * This source code is licensed under the ISC license. 387 * See the LICENSE file in the root directory of this source tree. 388 */const $ce=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],VU=Se("settings",$ce);/** 389 * @license lucide-react v0.525.0 - ISC 390 * 391 * This source code is licensed under the ISC license. 392 * See the LICENSE file in the root directory of this source tree. 393 */const Ice=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]],a1=Se("sheet",Ice);/** 394 * @license lucide-react v0.525.0 - ISC 395 * 396 * This source code is licensed under the ISC license. 397 * See the LICENSE file in the root directory of this source tree. 398 */const Lce=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
398y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],fO=Se("shield-check",Lce);/** 399 * @license lucide-react v0.525.0 - ISC 400 * 401 * This source code is licensed under the ISC license. 402 * See the LICENSE file in the root directory of this source tree. 403 */const Fce=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],zce=Se("shopping-cart",Fce);/** 404 * @license lucide-react v0.525.0 - ISC 405 * 406 * This source code is licensed under the ISC license. 407 * See the LICENSE file in the root directory of this source tree. 408 */const Bce=[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]],IS=Se("sliders-horizontal",Bce);/** 409 * @license lucide-react v0.525.0 - ISC 410 * 411 * This source code is licensed under the ISC license. 412 * See the LICENSE file in the root directory of this source tree. 413 */const Uce=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],Sy=Se("store",Uce);/** 414 * @license lucide-react v0.525.0 - ISC 415 * 416 * This source code is licensed under the ISC license. 417 * See the LICENSE file in the root directory of this source tree. 418 */const qce=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],GU=Se("table-2",qce);/** 419 * @license lucide-react v0.525.0 - ISC 420 * 421 * This source code is licensed under the ISC license. 422 * See the LICENSE file in the root directory of this source tree. 423 */const Hce=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],Kce=Se("table",Hce);/** 424 * @license lucide-react v0.525.0 - ISC 425 * 426 * This source code is licensed under the ISC license. 427 * See the LICENSE file in the root directory of this source tree. 428 */const Vce=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Cy=Se("tag",Vce);/** 429 * @license lucide-react v0.525.0 - ISC 430 * 431 * This source code is licensed under the ISC license. 432 * See the LICENSE file in the root directory of this source tree. 433 */const Gce=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Ya=Se("trash-2",Gce);/** 434 * @license lucide-react v0.525.0 - ISC 435 * 436 * This source code is licensed under the ISC license. 437 * See the LICENSE file in the root directory of this source tree. 438 */const Wce=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],zi=Se("trending-up",Wce);/** 439 * @license lucide-react v0.525.0 - ISC 440 * 441 * This source code is licensed under the ISC license. 442 * See the LICENSE file in the root directory of this source tree. 443 */const Yce=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Jt=Se("triangle-alert",Yce);/** 444 * @license lucide-react v0.525.0 - ISC 445 * 446 * This source code is licensed under the ISC license. 447 * See the LICENSE file in the root directory of this source tree.
448 */const Xce=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],Qce=Se("unlink",Xce);/** 449 * @license lucide-react v0.525.0 - ISC 450 * 451 * This source code is licensed under the ISC license. 452 * See the LICENSE file in the root directory of this source tree. 453 */const Zce=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Oo=Se("upload",Zce);/** 454 * @license lucide-react v0.525.0 - ISC 455 * 456 * This source code is licensed under the ISC license. 457 * See the LICENSE file in the root directory of this source tree. 458 */const Jce=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],eue=Se("user",Jce);/** 459 * @license lucide-react v0.525.0 - ISC 460 * 461 * This source code is licensed under the ISC license. 462 * See the LICENSE file in the root directory of this source tree. 463 */const tue=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],nue=Se("users",tue);/** 464 * @license lucide-react v0.525.0 - ISC 465 * 466 * This source code is licensed under the ISC license. 467 * See the LICENSE file in the root directory of this source tree. 468 */const rue=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],ac=Se("wallet",rue);/** 469 * @license lucide-react v0.525.0 - ISC 470 * 471 * This source code is licensed under the ISC license. 472 * See the LICENSE file in the root directory of this source tree. 473 */const aue=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ut=Se("x",aue);/** 474 * @license lucide-react v0.525.0 - ISC 475 * 476 * This source code is licensed under the ISC license. 477 * See the LICENSE file in the root directory of this source tree. 478 */const sue=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],LS=Se("zap",sue),hO="/48x48.png",D$="Moneylogz",iue="AI Assistance",pO="[email protected]",oue=[{to:"/dashboard",label:"Dashboard",icon:HU},{to:"/accounts",label:"Accounts",icon:ac},{to:"/investments",label:"Investments",icon:zi},{to:"/transactions",label:"Transactions",icon:Uo},{to:"/documents",label:"Documents",icon:rc},{to:"/spreadsheets",label:"Google Spreadsheets",icon:a1,hidden:!0},{to:"/analytics",label:"Analytics",icon:Bo},{to:"/connections",label:"Connections",icon:VU},{to:"/billing",label:"Billing",icon:ea},{to:"/chat",label:iue,icon:KU}];function lue(e,t=!0){return t?oue.filter(n=>n.adminOnly&&e!==pO?!1:!n.hidden):[]}function cue(e){return["flex items-center gap-3 px-3 py-2.5 rounded-lg text-[15px] font-medium transition-colors",e?"bg-brand-soft text-brand font-semibold":"text-slate-600 hover:bg-slate-100 hover:text-slate-900"].join(" ")}function uue(e){return e&&e.split(" ").filter(Boolean).slice(0,2).map(t=>t[0]?.toUpperCase()??"").join("")||"ML"}function WU({onNavigate:e,onClose:t,linkProfile:n=!1}){const{logout:r,user:a}=ns(),s=lue(a?.email,!!a),o=i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-sm font-semibold text-slate-900 truncate",children:a?.name}),i.jsx("p",{className:"text-xs text-slate-500 truncate",children:a?.email})]}),l=()=>{r()};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2.5 mb-6 px-2",children:[i.jsx("img",{src:hO,alt:"Moneylogz",className:"w-[34px] h-[34px] rounded-[9px]"}),i.jsx("span",{className:"text-lg font-extrabold tracking-tight text-slate-900",children:"Moneylogz"}),t&&i.jsx("button",{type:"button",onClick:t,"aria-label":"Close menu",className:"ml-auto w-[42px] h-[42px] rounded-lg flex items-center justify-center text-slate-500 hover:bg-slate-100",children:i.jsx(Ut,{className:"w-[18px] h-[18px]"})})]}),i.jsx("nav",{className:"flex-1 flex flex-col gap-1 overflow-y-auto",children:s.map(({to:u,label:d,icon:h,adminOnly:p})=>i.jsxs(ly,{to:u,onClick:e,className:({isActive:g})=>cue(g),children:[i.jsx(h,{className:"w-[18px] h-[18px]"}),i.jsx("span",{children:d}),p&&i.jsx("span",{className:"ml-auto text-[10px] font-bold tracking-wide text-slate-400 border border-slate-200 rounded px-1.5 py-px",children:"ADMIN"})]},u))}),i.jsxs("div",{className:"border-t border-slate-200 pt-3.5 mt-2.5 flex items-center gap-2.5",children:[a?.picture?i.jsx("img",{src:a.picture,alt:a?.name,className:"w-9 h-9 rounded-full"}):i.jsx("span",{className:"w-9 h-9 rounded-full bg-gradient-to-br from-blue-400 to-blue-600 text-white flex items-center justify-center text-sm font-bold",children:uue(a?.name)}
478),n?i.jsx(ly,{to:"/profile",onClick:e,className:"flex-1 min-w-0 leading-tight",children:o}):i.jsx("div",{className:"flex-1 min-w-0 leading-tight",children:o}),i.jsx("button",{onClick:l,title:"Log out","aria-label":"Log out",className:"p-2 rounded-md text-slate-500 hover:bg-slate-100 hover:text-slate-900 transition-colors",children:i.jsx(uO,{className:"w-[18px] h-[18px]"})})]})]})}function YU(){return i.jsx("div",{className:"hidden lg:flex w-[264px] flex-none bg-surface border-r border-slate-200 px-3.5 py-5 flex-col h-full shadow-[1px_0_0_rgba(15,23,42,.02)]",children:i.jsx(WU,{})})}const $$=e=>{let t;const n=new Set,r=(d,h)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const g=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(x=>x(t,g))}},a=()=>t,l={setState:r,getState:a,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,a,l);return l},due=e=>e?$$(e):$$,fue=e=>e;function hue(e,t=fue){const n=ve.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ve.useDebugValue(n),n}const pue=e=>{const t=due(e),n=r=>hue(t,r);return Object.assign(n,t),n},XU=e=>pue,mue=e=>(t,n,r)=>{const a=r.subscribe;return r.subscribe=(o,l,u)=>{let d=o;if(l){const h=u?.equalityFn||Object.is;let p=o(r.getState());d=g=>{const x=o(g);if(!h(p,x)){const y=p;l(p=x,y)}},u?.fireImmediately&&l(p,p)}return a(d)},e(t,n,r)},gue=mue,xue=[{id:"1",title:"Grocery Shopping",date:"2024-03-15",total:156.78,category:"Groceries",imageUrl:"https://images.unsplash.com/photo-1554118811-1e0d58224f24",driveUrl:"https://drive.google.com/file/d/1",parsed_data:{merchant:"Whole Foods Market",items:[{name:"Organic Bananas",quantity:1,price:3.99},{name:"Almond Milk",quantity:2,price:4.99}],tax:12.34,subtotal:144.44}},{id:"2",title:"Office Supplies",date:"2024-03-14",total:89.99,category:"Office",imageUrl:"https://images.unsplash.com/photo-1497032628192-86f99bcd76bc",driveUrl:"https://drive.google.com/file/d/2",parsed_data:{merchant:"Staples",items:[{name:"Printer Paper",quantity:2,price:19.99},{name:"Ink Cartridge",quantity:1,price:45.99}],tax:4.02,subtotal:85.97}},{id:"3",title:"Restaurant Dinner",date:"2024-03-13",total:125.45,category:"Dining",imageUrl:"https://images.unsplash.com/photo-1555396273-367ea4eb4db5",driveUrl:"https://drive.google.com/file/d/3",parsed_data:{merchant:"The Italian Restaurant",items:[{name:"Pasta Carbonara",quantity:2,price:24.99},{name:"House Wine",quantity:1,price:35}],tax:10.48,subtotal:114.97}}],QU="analyticsVisibleCharts",ZU="analyticsKnownCharts",Ng=[{key:"spendingOverTime",label:"Spending over time",icon:zi},{key:"categories",label:"Where the money went",icon:oO},{key:"incomeVsExpense",label:"Income vs expenses",icon:dle},{key:"topMerchants",label:"Top merchants",icon:Sy},{key:"changes",label:"What changed",icon:mle},{key:"recurring",label:"Recurring charges",icon:dO},{key:"incomeSources",label:"Where the money came from",icon:lO},{key:"weekday",label:"Spend by weekday",icon:zU},{key:"sizes",label:"Transaction sizes",icon:Bo},{key:"channels",label:"Payment channels",icon:ea}],I$=Object.freeze(["spendingOverTime","categories","incomeVsExpense","topMerchants","weekday","sizes","channels"]);function ff(){return Ng.map(e=>e.key)}function bue(e){return`Visible charts (${e.length}/${Ng.length})`}function yue(e,t){if(!Array.isArray(e))return ff();const n=new Set(ff()),r=e.filter(u=>typeof u!="string"||!n.has(u));if(r.length>0)return console.warn(`[chartSelection] stored selection of ${e.length} names ${r.length} unknown chart(s) (${r.join(", ")}) â falling back to all ${n.size}`),ff();const a=[...new Set(e)],s=Array.isArray(t)?t.filter(u=>typeof u=="string"):null,o=new Set(s??I$),l=ff().filter(u=>!o.has(u)&&!a.includes(u));return l.length>0&&console.warn(`[chartSelection] switching on ${l.length} chart(s) added since the selection was saved (${l.join(", ")})${s?"":` â no stored known-chart list, reading the selection as older than ${I$.length} charts`}`),[...a,...l]}function JU(e){try{localStorage.setItem(QU,JSON.stringify(e)),localStorage.setItem(ZU,JSON.stringify(ff()))}catch(t){console.warn(`[chartSelection] could not store the selection of ${e.length} chart(s) against the ${Ng.length} known now`,t)}}const mO=(e,t)=>{try{const n=localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}},B0=mO(QU,null),U0=yue(B0,mO(ZU,null)),$n=XU()(gue(e=>({user:null,receipts:xue,visibleColumns:mO("transactionsVisibleColumns",["date","amount","primary_account","account_name","name","merchant_name","mask","category","sub_category"]),visibleCharts:U0,connections:null,helpDrawerOpen:!1,setHelpDrawerOpen:t=>e({helpDrawerOpen:t}),mobileNavOpen:!1,setMobileNavOpen:t=>e({mobileNavOpen:t}),bottomBarHeight:0,setBottomBarHeight:t=>e({bottomBarHeight:t}),setUser:t=>e({user:t}),setReceipts:t=>e({receipts:t}),setVisibleColumns:t=>e(n=>({visibleColumns:typeof t=="function"?t(n.visibleColumns):t})),setVisibleCharts:t=>e(n=>({visibleCharts:typeof t=="function"?t(n.visibleCharts):t})),setConnections:t=>e({connections:t}),addReceipt:t=>e(n=>({receipts:[...n.receipts,t]})),removeReceipt:t=>e(n=>({receipts:n.receipts.filter(r=>r.id!==t)})),updateReceipt:(t,n)=>e(r=>({receipts:r.receipts.map(a=>a.id===t?{...a,...n}:a)}))})));$n.subscribe(e=>e.visibleColumns,e=>{localStorage.setItem("transactionsVisibleColumns",JSON.stringify(e))});$n.subscribe(e=>e.visibleCharts,e=>{JU(e)});Array.isArray(B0)&&JSON.stringify(B0)!==JSON.stringify(U0)&&(console.log(`[chartSelection] storing the reconciled selection of ${U0.length} chart(s) over the ${B0.length} that were saved`),JU(U0));const oBe="hidden lg:block w-[264px] flex-none bg-surface border-r border-border min-h-[calc(100vh-64px)]",lBe="sticky top-16 max-h-[calc(100vh-64px)] overflow-auto px-3.5 py-5",cBe="px-3 mb-2 text-[11px] font-bold uppercase tracking-[0.12em] text-slate-400";function uBe(e){return["flex items-center gap-3 px-3 py-2.5 rounded-lg text-[14.5px] font-medium transition-colors",e?"bg-brand-soft text-brand font-semibold":"text-slate-600 hover:bg-slate-100 hover:text-slate-900"].join(" ")}function dBe(e){return["block -ml-2.5 px-2.5 py-1.5 rounded-md text-[13.5px] transition-colors",e?"bg-brand-soft text-brand font-semibold":"text-slate-500 hover:text-slate-900"].join(" ")}const fBe="rounded-xl border border-border bg-surface shadow-card overflow-hidden",hBe="flex items-center gap-3 px-4 py-2.5 border-b border-border last:border-b-0 transition-colors hover:bg-surface-2",pBe="inline-flex items-center justify-center gap-2 h-[38px] px-3.5 rounded-lg bg-brand text-white text-sm font-semibold whitespace-nowrap shadow-nav-active transition-colors hover:bg-brand-hover",mBe="inline-flex items-center justify-center gap-2 h-[38px] px-3.5 rounded-lg border border-border bg-surface text-[13.5px] font-semibold whitespace-nowrap text-slate-700 transition-colors hover:border-slate-300",gBe="w-full h-[42px] pl-9 pr-16 rounded-lg border border-border bg-surface text-slate-900 text-sm outline-none transition-colors hover:border-slate-300 focus:border-brand focus:ring-1 focus:ring-brand placeholder:text-slate-500",xBe="hidden sm:flex items-center gap-2 h-[38px] px-3 rounded-lg border border-border bg-surface text-slate-500 text-[13.5px] flex-1 max-w-[520px] transition-colors hover:border-slate-300",bBe="w-full min-h-[96px] resize-y px-3 py-2.5 rounded-lg border border-border bg-surface text-slate-900 text-sm leading-relaxed outline-none transition-colors hover:border-slate-300 focus:border-brand focus:ring-1 focus:ring-brand placeholder:text-slate-500 disabled:opacity-60",yBe="text-[11px] font-semibold text-slate-500 bg-surface-muted border border-border rounded px-1.5 py-0.5";function vBe(e){return["inline-flex items-center gap-1.5 h-[34px] px-3 rounded-full border text-[13px] transition-colors",e?"bg-brand-soft border-blue-100 text-brand font-semibold":"bg-surface border-border text-slate-600 font-medium hover:border-slate-300"].join(" ")}const wBe="text-[10.5px] font-bold rounded-full px-2 py-[3px] whitespace-nowrap",jBe={popular:"bg-badge-blue text-badge-blue-text",new:"bg-badge-green text-badge-green-text","start-here":"bg-badge-green text-badge-green-text",troubleshooting:"bg-badge-yellow text-badge-yellow-text","coming-soon":"bg-badge-yellow text-badge-yellow-text"},NBe={popular:"Popular",new:"New","start-here":"Start here",troubleshooting:"Troubleshooting","coming-soon":"Coming soon"},_Be={info:"bg-brand-soft border-blue-100 text-blue-900",tip:"bg-badge-green border-green-200 text-green-900",warn:"bg-badge-yellow border-amber-200 text-amber-900"},kBe="bg-badge-yellow text-badge-yellow-text font-bold rounded-[3px] px-0.5";function SBe(e,t){return["block py-1.5 border-l-2 leading-snug transition-colors",t?"pl-[26px] text-[13px]":"pl-3.5 text-[13.5px]",e?"border-brand text-brand font-semibold":"border-border text-slate-500 hover:text-slate-900"].join(" ")}const CBe="fixed top-0 right-0 bottom-0 w-full lg:w-[420px] max-w-full bg-surface border-l border-border shadow-[-24px_0_60px_-2
4780px_rgba(15,23,42,0.35)] flex flex-col z-50",vue="w-[42px] h-[42px] rounded-lg border border-blue-100 bg-brand-soft text-brand flex items-center justify-center transition-colors hover:bg-blue-100",EBe="inline-flex items-center gap-1.5 text-[11px] font-bold tracking-[0.04em] bg-surface-muted border border-border rounded-full px-2.5 py-[3px] text-slate-600";function eq({className:e=""}){const t=$n(r=>r.helpDrawerOpen),n=$n(r=>r.setHelpDrawerOpen);return v.useEffect(()=>{const r=a=>{if(a.key!=="?"||a.metaKey||a.ctrlKey)return;const s=a.target;s?.tagName==="INPUT"||s?.tagName==="TEXTAREA"||s?.isContentEditable===!0||(a.preventDefault(),n(!0))};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n]),i.jsx("button",{type:"button","aria-label":"Help",title:"Help","aria-expanded":t,onClick:()=>n(!t),className:`${vue} ${e}`,children:i.jsx(e1,{className:"w-5 h-5"})})}function wue(){const e=$n(n=>n.mobileNavOpen),t=$n(n=>n.setMobileNavOpen);return i.jsxs("header",{className:"lg:hidden sticky top-0 z-30 h-14 flex-none bg-surface border-b border-border flex items-center gap-2 pl-2 pr-2.5",children:[i.jsx("button",{type:"button","aria-label":"Open menu","aria-expanded":e,onClick:()=>t(!0),className:"w-[42px] h-[42px] rounded-lg flex items-center justify-center text-slate-600 hover:bg-slate-100",children:i.jsx(xce,{className:"w-[18px] h-[18px]"})}),i.jsx("img",{src:hO,alt:"",className:"w-[30px] h-[30px] rounded-lg"}),i.jsx("span",{className:"text-base font-extrabold tracking-tight text-slate-900",children:"Moneylogz"}),i.jsx(eq,{className:"ml-auto"})]})}const jue=1024,tq=`(min-width: ${jue}px)`,L$="bg-blur";let Mb=0;const qo=e=>{v.useEffect(()=>{if(e)return Mb+=1,document.body.classList.add(L$),()=>{Mb-=1,!(Mb>0)&&(Mb=0,document.body.classList.remove(L$))}},[e])},Nue=e=>console.info(`[MobileNavDrawer] ${e}`);function _ue(){const{pathname:e}=Gr(),t=$n(s=>s.mobileNavOpen),n=$n(s=>s.setMobileNavOpen),r=v.useRef(e),a=v.useCallback(s=>{Nue(`closed: ${s}`),n(!1)},[n]);return qo(t),v.useEffect(()=>{if(e===r.current)return;const s=r.current;r.current=e,t&&a(`navigated from ${s} to ${e}`)},[t,e,a]),v.useEffect(()=>{if(!t||typeof window.matchMedia!="function")return;const s=window.matchMedia(tq),o=()=>{s.matches&&a("viewport crossed the lg breakpoint")};return o(),s.addEventListener("change",o),()=>s.removeEventListener("change",o)},[t,a]),v.useEffect(()=>{if(!t)return;const s=o=>{o.key==="Escape"&&a("escape")};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[t,a]),t?i.jsxs("div",{className:"lg:hidden",children:[i.jsx("div",{"data-testid":"mobile-nav-scrim",className:"fixed inset-0 z-50 bg-slate-900/45",onClick:()=>a("scrim"),"aria-hidden":"true"}),i.jsx("aside",{role:"dialog","aria-modal":"true","aria-label":"Navigation",className:"fixed inset-y-0 left-0 z-50 w-[284px] max-w-[85vw] bg-surface border-r border-border shadow-[12px_0_40px_rgba(15,23,42,.25)] px-3.5 pt-3.5 pb-[max(20px,env(safe-area-inset-bottom))] flex flex-col",children:i.jsx(WU,{onNavigate:()=>a("link chosen"),onClose:()=>a("close button"),linkProfile:!0})})]}):null}var nq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},F$=ve.createContext&&ve.createContext(nq),kue=["attr","size","title"];function Sue(e,t){if(e==null)return{};var n=Cue(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cue(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,s;for(s=0;s<r.length;s++)a=r[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Ey(){return Ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ey.apply(this,arguments)}function z$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Oy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
478t%2?z$(Object(n),!0).forEach(function(r){Eue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eue(e,t,n){return t=Oue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oue(e){var t=Aue(e,"string");return typeof t=="symbol"?t:String(t)}function Aue(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rq(e){return e&&e.map((t,n)=>ve.createElement(t.tag,Oy({key:n},t.attr),rq(t.child)))}function Ea(e){return t=>ve.createElement(Tue,Ey({attr:Oy({},e.attr)},t),rq(e.child))}function Tue(e){var t=n=>{var{attr:r,size:a,title:s}=e,o=Sue(e,kue),l=a||n.size||"1em",u;return n.className&&(u=n.className),e.className&&(u=(u?u+" ":"")+e.className),ve.createElement("svg",Ey({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:u,style:Oy(Oy({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&ve.createElement("title",null,s),e.children)};return F$!==void 0?ve.createElement(F$.Consumer,null,n=>t(n)):t(nq)}function Pue(e){return Ea({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"},child:[]}]})(e)}function Rue(e){return Ea({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(e)}function Mue(e){return Ea({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"},child:[]}]})(e)}function aq(e){return Ea({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(e)}function Due(e){return Ea({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"},child:[]}]})(e)}function $ue(e){return Ea({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"},child:[]}]})(e)}function Iue(e){return Ea({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"},child:[]}]})(e)}function sq(e){return Ea({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(e)}function iq(e){return Ea({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"},child:[]}]})(e)}function Lue(e){return Ea({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"},child:[]}]})(e)}function oq(e){return Ea({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"},child:[]}]})(e)}function Fue(e){return Ea({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"},child:[]}]})(e)}function zue(e){return Ea({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"},child:[]}]})(e)}const gO="-";function Bue(e){const t=que(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function a(o){const l=o.split(gO);return l[0]===""&&l.length!==1&&l.shift(),lq(l,t)||Uue(o)}function s(o,l){const u=n[o]||[];return l&&r[o]?[...u,...r[o]]:u}return{getClassGroupId:a,getConflictingClassGroupIds:s}}function lq(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?lq(e.slice(1),r):void 0;if(a)return a;
478if(t.validators.length===0)return;const s=e.join(gO);return t.validators.find(({validator:o})=>o(s))?.classGroupId}const B$=/^\[(.+)\]$/;function Uue(e){if(B$.test(e)){const t=B$.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function que(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Kue(Object.entries(e.classGroups),n).forEach(([s,o])=>{FS(o,r,s,t)}),r}function FS(e,t,n,r){e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:U$(t,a);s.classGroupId=n;return}if(typeof a=="function"){if(Hue(a)){FS(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([s,o])=>{FS(o,U$(t,s),n,r)})})}function U$(e,t){let n=e;return t.split(gO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Hue(e){return e.isThemeGetter}function Kue(e,t){return t?e.map(([n,r])=>{const a=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,l])=>[t+o,l])):s);return[n,a]}):e}function Vue(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function a(s,o){n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)}return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return a(s,o),o},set(s,o){n.has(s)?n.set(s,o):a(s,o)}}}const cq="!";function Gue(e){const t=e.separator,n=t.length===1,r=t[0],a=t.length;return function(o){const l=[];let u=0,d=0,h;for(let w=0;w<o.length;w++){let j=o[w];if(u===0){if(j===r&&(n||o.slice(w,w+a)===t)){l.push(o.slice(d,w)),d=w+a;continue}if(j==="/"){h=w;continue}}j==="["?u++:j==="]"&&u--}const p=l.length===0?o:o.substring(d),g=p.startsWith(cq),x=g?p.substring(1):p,y=h&&h>d?h-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:y}}}function Wue(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function Yue(e){return{cache:Vue(e.cacheSize),splitModifiers:Gue(e),...Bue(e)}}const Xue=/\s+/;function Que(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,s=new Set;return e.trim().split(Xue).map(o=>{const{modifiers:l,hasImportantModifier:u,baseClassName:d,maybePostfixModifierPosition:h}=n(o);let p=r(h?d.substring(0,h):d),g=!!h;if(!p){if(!h)return{isTailwindClass:!1,originalClassName:o};if(p=r(d),!p)return{isTailwindClass:!1,originalClassName:o};g=!1}const x=Wue(l).join(":");return{isTailwindClass:!0,modifierId:u?x+cq:x,classGroupId:p,originalClassName:o,hasPostfixModifier:g}}).reverse().filter(o=>{if(!o.isTailwindClass)return!0;const{modifierId:l,classGroupId:u,hasPostfixModifier:d}=o,h=l+u;return s.has(h)?!1:(s.add(h),a(u,d).forEach(p=>s.add(l+p)),!0)}).reverse().map(o=>o.originalClassName).join(" ")}function Zue(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=uq(t))&&(r&&(r+=" "),r+=n);return r}function uq(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=uq(e[r]))&&(n&&(n+=" "),n+=t);return n}function Jue(e,...t){let n,r,a,s=o;function o(u){const d=t.reduce((h,p)=>p(h),e());return n=Yue(d),r=n.cache.get,a=n.cache.set,s=l,l(u)}function l(u){const d=r(u);if(d)return d;const h=Que(u,n);return a(u,h),h}return function(){return s(Zue.apply(null,arguments))}}function tn(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const dq=/^\[(?:([a-z-]+):)?(.+)\]$/i,ede=/^\d+\/\d+$/,tde=new Set(["px","full","screen"]),nde=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rde=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ade=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sde=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ide=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function oo(e){return Zc(e)||tde.has(e)||ede.test(e)}function jl(e){return dh(e,"length",pde)}function Zc(e){return!!e&&!Number.isNaN(Number(e))}function Db(e){return dh(e,"number",Zc)}function Bp(e){return!!e&&Number.isInteger(Number(e))}function ode(e){return e.endsWith("%")&&Zc(e.slice(0,-1))}function st(e){return dq.test(e)}function Nl(e){return nde.test(e)}const lde=new Set(["length","size","percentage"]);function cde(e){return dh(e,lde,fq)}function ude(e){return dh(e,"position",fq)}const dde=new Set(["image","url"]);function fde(e){return dh(e,dde,gde)}function hde(e){return dh(e,"",mde)}function Up(){return!0}function dh(e,t,n){const r=dq.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function pde(e){return rde.test(e)&&!ade.test(e)}function fq(){return!1}function mde(e){return sde.test(e)}function gde(e){return ide.test(e)}function xde(){const e=tn("colors"),t=tn("spacing"),n=tn("blur"),r=tn("brightness"),a=tn("borderColor"),s=tn("borderRadius"),o=tn("borderSpacing"),l=tn("borderWidth"),u=tn("contrast"),d=tn("grayscale"),h=tn("hueRotate"),p=tn("invert"),g=tn("gap"),x=tn("gradientColorStops"),y=tn("gradientColorStopPositions"),w=tn("inset"),j=tn("margin"),N=tn("opacity"),k=tn("padding"),S=tn("saturate"),E=tn("scale"),O=tn("sepia"),T=tn("skew"),P=tn("space"),M=tn("translate"),D=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",st,t],F=()=>[st,t],B=()=>["",oo,jl],U=()=>["auto",Zc,st],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],G=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",st],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Zc,Db],V=()=>[Zc,st];return{cacheSize:500,separator:":",theme:{colors:[Up],spacing:[oo,jl],blur:["none","",
vendor: 6,400 bytes, line 478
478Nl,st],brightness:H(),borderColor:[e],borderRadius:["none","","full",Nl,st],borderSpacing:F(),borderWidth:B(),contrast:H(),grayscale:W(),hueRotate:V(),invert:W(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[ode,jl],inset:L(),margin:L(),opacity:H(),padding:F(),saturate:H(),scale:H(),sepia:W(),skew:V(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",st]}],container:["container"],columns:[{columns:[Nl]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...z(),st]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Bp,st]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",st]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Bp,st]}],"grid-cols":[{"grid-cols":[Up]}],"col-start-end":[{col:["auto",{span:["full",Bp,st]},st]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[Up]}],"row-start-end":[{row:["auto",{span:[Bp,st]},st]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",st]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",st]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",st,t]}],"min-w":[{"min-w":[st,t,"min","max","fit"]}],"max-w":[{"max-w":[st,t,"none","full","min","max","fit","prose",{screen:[Nl]},Nl]}],h:[{h:[st,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[st,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Nl,jl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Db]}],"font-family":[{font:[Up]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",st]}],"line-clamp":[{"line-clamp":["none",Zc,Db]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",oo,st]}],"list-image":[{"list-image":["none",st]}],"list-style-type":[{list:["none","disc","decimal",st]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",oo,jl]}],"underline-offset":[{"underline-offset":["auto",oo,st]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",st]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",st]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),ude]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cde]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fde]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}
478],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}
vendor: 4,362 bytes, line 478
478],"divide-style":[{divide:$()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[oo,st]}],"outline-w":[{outline:[oo,jl]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[oo,jl]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Nl,hde]}],"shadow-color":[{shadow:[Up]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":K()}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Nl,st]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[S]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",st]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",st]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",st]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Bp,st]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",st]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",st]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",st]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[oo,jl,Db]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
478none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const ce=Jue(xde);function qc(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function zm(e){if(!qc(e))return e;const t={};for(const n in e)t[n]=zm(e[n]);return t}function Ne(e,t){if(qc(t)&&Object.keys(t).length===0)return zm({...e,...t});const n={...e,...t};if(qc(t)&&qc(e))for(const r in t)qc(t[r])&&r in e&&qc(e[r])?n[r]=Ne(e[r],t[r]):n[r]=qc(t[r])?zm(t[r]):t[r];return n}const bde={root:{base:"divide-y divide-gray-200 border-gray-200 dark:divide-gray-700 dark:border-gray-700",flush:{off:"rounded-lg border",on:"border-b"}},content:{base:"p-5 first:rounded-t-lg last:rounded-b-lg dark:bg-gray-900"},title:{arrow:{base:"h-6 w-6 shrink-0",open:{off:"",on:"rotate-180"}},base:"flex w-full items-center justify-between p-5 text-left font-medium text-gray-500 first:rounded-t-lg last:rounded-b-lg dark:text-gray-400",flush:{off:"hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:hover:bg-gray-800 dark:focus:ring-gray-800",on:"bg-transparent dark:bg-transparent"},heading:"",open:{off:"",on:"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-white"}}},yde={base:"flex flex-col gap-2 p-4 text-sm",borderAccent:"border-t-4",closeButton:{base:"-m-1.5 ml-auto inline-flex h-8 w-8 rounded-lg p-1.5 focus:ring-2",icon:"h-5 w-5",color:{info:"bg-cyan-100 text-cyan-500 hover:bg-cyan-200 focus:ring-cyan-400 dark:bg-cyan-200 dark:text-cyan-600 dark:hover:bg-cyan-300",gray:"bg-gray-100 text-gray-500 hover:bg-gray-200 focus:ring-gray-400 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-white",failure:"bg-red-100 text-red-500 hover:bg-red-200 focus:ring-red-400 dark:bg-red-200 dark:text-red-600 dark:hover:bg-red-300",success:"bg-green-100 text-green-500 hover:bg-green-200 focus:ring-green-400 dark:bg-green-200 dark:text-green-600 dark:hover:bg-green-300",warning:"bg-yellow-100 text-yellow-500 hover:bg-yellow-200 focus:ring-yellow-400 dark:bg-yellow-200 dark:text-yellow-600 dark:hover:bg-yellow-300",red:"bg-red-100 text-red-500 hover:bg-red-200 focus:ring-red-400 dark:bg-red-200 dark:text-red-600 dark:hover:bg-red-300",green:"bg-green-100 text-green-500 hover:bg-green-200 focus:ring-green-400 dark:bg-green-200 dark:text-green-600 dark:hover:bg-green-300",yellow:"bg-yellow-100 text-yellow-500 hover:bg-yellow-200 focus:ring-yellow-400 dark:bg-yellow-200 dark:text-yellow-600 dark:hover:bg-yellow-300",blue:"bg-blue-100 text-blue-500 hover:bg-blue-200 focus:ring-blue-400 dark:bg-blue-200 dark:text-blue-600 dar
478k:hover:bg-blue-300",cyan:"bg-cyan-100 text-cyan-500 hover:bg-cyan-200 focus:ring-cyan-400 dark:bg-cyan-200 dark:text-cyan-600 dark:hover:bg-cyan-300",pink:"bg-pink-100 text-pink-500 hover:bg-pink-200 focus:ring-pink-400 dark:bg-pink-200 dark:text-pink-600 dark:hover:bg-pink-300",lime:"bg-lime-100 text-lime-500 hover:bg-lime-200 focus:ring-lime-400 dark:bg-lime-200 dark:text-lime-600 dark:hover:bg-lime-300",dark:"bg-gray-100 text-gray-500 hover:bg-gray-200 focus:ring-gray-400 dark:bg-gray-200 dark:text-gray-600 dark:hover:bg-gray-300",indigo:"bg-indigo-100 text-indigo-500 hover:bg-indigo-200 focus:ring-indigo-400 dark:bg-indigo-200 dark:text-indigo-600 dark:hover:bg-indigo-300",purple:"bg-purple-100 text-purple-500 hover:bg-purple-200 focus:ring-purple-400 dark:bg-purple-200 dark:text-purple-600 dark:hover:bg-purple-300",teal:"bg-teal-100 text-teal-500 hover:bg-teal-200 focus:ring-teal-400 dark:bg-teal-200 dark:text-teal-600 dark:hover:bg-teal-300",light:"bg-gray-50 text-gray-500 hover:bg-gray-100 focus:ring-gray-200 dark:bg-gray-600 dark:text-gray-200 dark:hover:bg-gray-700 dark:hover:text-white"}},color:{info:"border-cyan-500 bg-cyan-100 text-cyan-700 dark:bg-cyan-200 dark:text-cyan-800",gray:"border-gray-500 bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",failure:"border-red-500 bg-red-100 text-red-700 dark:bg-red-200 dark:text-red-800",success:"border-green-500 bg-green-100 text-green-700 dark:bg-green-200 dark:text-green-800",warning:"border-yellow-500 bg-yellow-100 text-yellow-700 dark:bg-yellow-200 dark:text-yellow-800",red:"border-red-500 bg-red-100 text-red-700 dark:bg-red-200 dark:text-red-800",green:"border-green-500 bg-green-100 text-green-700 dark:bg-green-200 dark:text-green-800",yellow:"border-yellow-500 bg-yellow-100 text-yellow-700 dark:bg-yellow-200 dark:text-yellow-800",blue:"border-blue-500 bg-blue-100 text-blue-700 dark:bg-blue-200 dark:text-blue-800",cyan:"border-cyan-500 bg-cyan-100 text-cyan-700 dark:bg-cyan-200 dark:text-cyan-800",pink:"border-pink-500 bg-pink-100 text-pink-700 dark:bg-pink-200 dark:text-pink-800",lime:"border-lime-500 bg-lime-100 text-lime-700 dark:bg-lime-200 dark:text-lime-800",dark:"border-gray-600 bg-gray-800 text-gray-200 dark:bg-gray-900 dark:text-gray-300",indigo:"border-indigo-500 bg-indigo-100 text-indigo-700 dark:bg-indigo-200 dark:text-indigo-800",purple:"border-purple-500 bg-purple-100 text-purple-700 dark:bg-purple-200 dark:text-purple-800",teal:"border-teal-500 bg-teal-100 text-teal-700 dark:bg-teal-200 dark:text-teal-800",light:"border-gray-400 bg-gray-50 text-gray-600 dark:bg-gray-500 dark:text-gray-200"},icon:"mr-3 inline h-5 w-5 flex-shrink-0",rounded:"rounded-lg",wrapper:"flex items-center"},vde={root:{base:"flex items-center justify-center space-x-4 rounded",bordered:"p-1 ring-2",rounded:"rounded-full",color:{dar
478k:"ring-gray-800 dark:ring-gray-800",failure:"ring-red-500 dark:ring-red-700",gray:"ring-gray-500 dark:ring-gray-400",info:"ring-cyan-400 dark:ring-cyan-800",light:"ring-gray-300 dark:ring-gray-500",purple:"ring-purple-500 dark:ring-purple-600",success:"ring-green-500 dark:ring-green-500",warning:"ring-yellow-300 dark:ring-yellow-500",pink:"ring-pink-500 dark:ring-pink-500"},img:{base:"rounded",off:"relative overflow-hidden bg-gray-100 dark:bg-gray-600",on:"",placeholder:"absolute -bottom-1 h-auto w-auto text-gray-400"},size:{xs:"h-6 w-6",sm:"h-8 w-8",md:"h-10 w-10",lg:"h-20 w-20",xl:"h-36 w-36"},stacked:"ring-2 ring-gray-300 dark:ring-gray-500",statusPosition:{"bottom-left":"-bottom-1 -left-1","bottom-center":"-bottom-1","bottom-right":"-bottom-1 -right-1","top-left":"-left-1 -top-1","top-center":"-top-1","top-right":"-right-1 -top-1","center-right":"-right-1",center:"","center-left":"-left-1"},status:{away:"bg-yellow-400",base:"absolute h-3.5 w-3.5 rounded-full border-2 border-white dark:border-gray-800",busy:"bg-red-400",offline:"bg-gray-400",online:"bg-green-400"},initials:{text:"font-medium text-gray-600 dark:text-gray-300",base:"relative inline-flex items-center justify-center overflow-hidden bg-gray-100 dark:bg-gray-600"}},group:{base:"flex -space-x-4"},groupCounter:{base:"relative flex h-10 w-10 items-center justify-center rounded-full bg-gray-700 text-xs font-medium text-white ring-2 ring-gray-300 hover:bg-gray-600 dark:ring-gray-500"}},wde={root:{base:"flex h-fit items-center gap-1 font-semibold",color:{info:"bg-cyan-100 text-cyan-800 group-hover:bg-cyan-200 dark:bg-cyan-200 dark:text-cyan-800 dark:group-hover:bg-cyan-300",gray:"bg-gray-100 text-gray-800 group-hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:group-hover:bg-gray-600",failure:"bg-red-100 text-red-800 group-hover:bg-red-200 dark:bg-red-200 dark:text-red-900 dark:group-hover:bg-red-300",success:"bg-green-100 text-green-800 group-hover:bg-green-200 dark:bg-green-200 dark:text-green-900 dark:group-hover:bg-green-300",warning:"bg-yellow-100 text-yellow-800 group-hover:bg-yellow-200 dark:bg-yellow-200 dark:text-yellow-900 dark:group-hover:bg-yellow-300",indigo:"bg-indigo-100 text-indigo-800 group-hover:bg-indigo-200 dark:bg-indigo-200 dark:text-indigo-900 dark:group-hover:bg-indigo-300",purple:"bg-purple-100 text-purple-800 group-hover:bg-purple-200 dark:bg-purple-200 dark:text-purple-900 dark:group-hover:bg-purple-300",pink:"bg-pink-100 text-pink-800 group-hover:bg-pink-200 dark:bg-pink-200 dark:text-pink-900 dark:group-hover:bg-pink-300",blue:"bg-blue-100 text-blue-800 group-hover:bg-blue-200 dark:bg-blue-200 dark:text-blue-900 dark:group-hover:bg-blue-300",cyan:"bg-cyan-100 text-cyan-800 group-hover:bg-cyan-200 dark:bg-cyan-200 dark:text-cyan-900 dark:group-hover:bg-cyan-300",dark:"bg-gray-600 text-gray-100 group-hover:bg-gray-500 dark:bg-gray-900 dark:text-gray-200 dark:group-hover:bg-gray-700",light:"bg-gray-200 text-gray-800 group-hover:bg-gray-300 dark:bg-gray-400 dark:text-gray-900 dark:group-hover:bg-gray-500",green:"bg-green-100 text-green-800 group-hover:bg-green-200 dark:bg-green-200 dark:text-green-900 dark:group-hover:bg-green-300",lime:"bg-lime-100 text-lime-800 group-hover:bg-lime-200 dark:bg-lime-200 dark:text-lime-900 dark:group-hover:bg-lime-300",red:"bg-red-100 text-red-800 group-hover:bg-red-200 dark:bg-red-200 dark:text-red-900 dark:group-hover:bg-red-300",teal:"bg-teal-100 text-teal-800 group-hover:bg-teal-200 dark:bg-teal-200 dark:text-teal-900 dark:group-hover:bg-teal-300",yellow:"bg-yellow-100 text-yellow-800 group-hover:bg-yellow-200 dark:bg-yellow-200 dark:text-yellow-900 dark:group-hover:bg-yellow-300"},href:"group",size:{xs:"p-1 text-xs",sm:"p-1.5 text-sm"}},icon:{off:"rounded px-2 py-0.5",on:"rounded-full p-1.5",size:{xs:"h-3 w-3",sm:"h-3.5 w-3.5"}}},jde={root:{base:"text-xl font-semibold italic text-gray-900 dark:text-white"}},Nde={root:{base:"",list:"flex items-center"},item:{base:"group flex items-center",chevron:"mx-1 h-4 w-4 text-gray-400 group-first:hidden md:mx-2",href:{off:"flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",on:"flex items-center text-sm font-medium text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"},icon:"mr-2 h-4 w-4"}},_de={base:"group relative flex items-stretch justify-center p-0.5 text-center font-medium transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow] focu
478s:z-10 focus:outline-none",fullSized:"w-full",color:{dark:"border border-transparent bg-gray-800 text-white focus:ring-4 focus:ring-gray-300 enabled:hover:bg-gray-900 dark:border-gray-700 dark:bg-gray-800 dark:focus:ring-gray-800 dark:enabled:hover:bg-gray-700",failure:"border border-transparent bg-red-700 text-white focus:ring-4 focus:ring-red-300 enabled:hover:bg-red-800 dark:bg-red-600 dark:focus:ring-red-900 dark:enabled:hover:bg-red-700",gray:":ring-cyan-700 border border-gray-200 bg-white text-gray-900 focus:text-cyan-700 focus:ring-4 enabled:hover:bg-gray-100 enabled:hover:text-cyan-700 dark:border-gray-600 dark:bg-transparent dark:text-gray-400 dark:enabled:hover:bg-gray-700 dark:enabled:hover:text-white",info:"border border-transparent bg-cyan-700 text-white focus:ring-4 focus:ring-cyan-300 enabled:hover:bg-cyan-800 dark:bg-cyan-600 dark:focus:ring-cyan-800 dark:enabled:hover:bg-cyan-700",light:"border border-gray-300 bg-white text-gray-900 focus:ring-4 focus:ring-cyan-300 enabled:hover:bg-gray-100 dark:border-gray-600 dark:bg-gray-600 dark:text-white dark:focus:ring-gray-700 dark:enabled:hover:border-gray-700 dark:enabled:hover:bg-gray-700",purple:"border border-transparent bg-purple-700 text-white focus:ring-4 focus:ring-purple-300 enabled:hover:bg-purple-800 dark:bg-purple-600 dark:focus:ring-purple-900 dark:enabled:hover:bg-purple-700",success:"border border-transparent bg-green-700 text-white focus:ring-4 focus:ring-green-300 enabled:hover:bg-green-800 dark:bg-green-600 dark:focus:ring-green-800 dark:enabled:hover:bg-green-700",warning:"border border-transparent bg-yellow-400 text-white focus:ring-4 focus:ring-yellow-300 enabled:hover:bg-yellow-500 dark:focus:ring-yellow-900",blue:"border border-transparent bg-blue-700 text-white focus:ring-4 focus:ring-blue-300 enabled:hover:bg-blue-800 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",cyan:"border border-cyan-300 bg-white text-cyan-900 focus:ring-4 focus:ring-cyan-300 enabled:hover:bg-cyan-100 dark:border-cyan-600 dark:bg-cyan-600 dark:text-white dark:focus:ring-cyan-700 dark:enabled:hover:border-cyan-700 dark:enabled:hover:bg-cyan-700",green:"border border-green-300 bg-white text-green-900 focus:ring-4 focus:ring-green-300 enabled:hover:bg-green-100 dark:border-green-600 dark:bg-green-600 dark:text-white dark:focus:ring-green-700 dark:enabled:hover:border-green-700 dark:enabled:hover:bg-green-700",indigo:"border border-indigo-300 bg-white text-indigo-900 focus:ring-4 focus:ring-indigo-300 enabled:hover:bg-indigo-100 dark:border-indigo-600 dark:bg-indigo-600 dark:text-white dark:focus:ring-indigo-700 dark:enabled:hover:border-indigo-700 dark:enabled:hover:bg-indigo-700",lime:"border border-lime-300 bg-white text-lime-900 focus:ring-4 focus:ring-lime-300 enabled:hover:bg-lime-100 dark:border-lime-600 dark:bg-lime-600 dark:text-white dark:focus:ring-lime-700 dark:enabled:hover:border-lime-700 dark:enabled:hover:bg-lime-700",pink:"border border-pink-300 bg-white text-pink-900 focus:ring-4 focus:ring-pink-300 enabled:hover:bg-pink-100 dark:border-pink-600 dark:bg-pink-600 dark:text-white dark:focus:ring-pink-700 dark:enabled:hover:border-pink-700 dark:enabled:hover:bg-pink-700",red:"border border-red-300 bg-white text-red-900 focus:ring-4 focus:ring-red-300 enabled:hover:bg-red-100 dark:border-red-600 dark:bg-red-600 dark:text-white dark:focus:ring-red-700 dark:enabled:hover:border-red-700 dark:enabled:hover:bg-red-700",teal:"border border-teal-300 bg-white text-teal-900 focus:ring-4 focus:ring-teal-300 enabled:hover:bg-teal-100 dark:border-teal-600 dark:bg-teal-600 dark:text-white dark:focus:ring-teal-700 dark:enabled:hover:border-teal-700 dark:enabled:hover:bg-teal-700",yellow:"border border-yellow-300 bg-white text-yellow-900 focus:ring-4 focus:ring-yellow-300 enabled:hover:bg-yellow-100 dark:border-yellow-600 dark:bg-yellow-600 dark:text-white dark:focus:ring-yellow-700 dark:enabled:hover:border-yellow-700 dark:enabled:hover:bg-yellow-700"},disabled:"cursor-not-allowed opacity-50",isProcessing:"cursor-wait",spinnerSlot:"absolute top-0 flex h-full items-center",spinnerLeftPosition:{xs:"left-2",sm:"left-3",md:"left-4",lg:"left-5",xl:"left-6"},gradient:{cyan:"bg-gradient-to-r from-cyan-400 via-cyan-500 to-cyan-600 text-white focus:ring-4 focus:ring-cyan-300 enabled:hover:bg-gradient-to-br dark:focus:ring-cyan-800",failure:"bg-gradient-to-r from-red-400 via-red-500 to-red-600 text-white focus:ring-4 focus:ring-red-300 enabled:hover:bg-gradient-to-br dark:focus:ring-red-800",info:"bg-gradient-to-r from-cyan-500 via-cyan-600 to-cyan-700 text-white focus:ring-4 focus:ring-cyan-300 enabled:hover:bg-gradient-to-br dark:focus:ring-cyan-800 ",lime:"bg-gradient-to-r from-lime-200 via-lime-400 to-lime-500 text-gray-900 focus:ring-4 focus:ring-lime-300 enabled:hover:bg-gradient-to-br dark:focus:ring-lime-800",pink:"bg-gradient-to-r from-pink-400 via-pink-500 to-pink-600 text-white focus:ring-4 focus:ring-pink-300 enabled:hover:bg-gradient-to-br dark:focus:ring-pink-800",purple:"bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 text-white focus:ring-4 focus:ring-purple-300 enabled:hover:bg-gradient-to-br dark:focus:ring-purple-800",success:"bg-gradient-to-r from-green-400 via-green-500 to-green-600 text-white focus:ring-4 focus:ring-green-300 enabled:hover:bg-gradient-to-br dark:focus:ring-green-800",teal:"bg-gradient-to-r from-teal-400 via-teal-500 to-teal-600 text-white focus:ring-4 focus:ring-teal-300 enabled:hover:bg-gradient-to-br dark:focus:ring-teal-800"},gradientDuoTone:{cyanToBlue:"bg-gradient-to-r from-cyan-500 to-cyan-500 text-white focus:ring-4 focus:ring-cyan-300 enabled:hover:bg-gradient-to-bl dark:focus:ring-cyan-800",greenToBlue:"bg-gradient-to-br from-green-400 to-cyan-600 text-white focus:ring-4 focus:ring-green-200 enabled:hover:bg-gradient-to-bl dark:focus:ring-green-800",pinkToOrange:"bg-gradient-to-br from-pink-500 to-orange-400 text-white focus:ring-4 focus:ring-pink-200 enabled:hover:bg-gradient-to-bl dark:focus:ring-pink-800",purpleToBlue:"bg-gradient-to-br from-purple-600 to-cyan-500 text-white focus:ring-4 focus:ring-cyan-300 enabled:hover:bg-gradient-to-bl dark:focus:ring-cyan-800",purpleToPink:"bg-gradient-to-r from-purple-500 to-pink-500 text-white focus:ring-4 focus:ring-purple-200 enabled:hover:bg-gradient-to-l dark:focus:ring-purple-800",redToYellow:"bg-gradient-to-r from-red-200 via-red-300 to-yellow-200 text-gray-900 focus:ring-4 focus:ring-red-100 enabled:hover:bg-gradient-to-bl dark:focus:ring-red-400",tealToLime:"bg-gradient-to-r from-teal-200 to-lime-200 text-gray-900 focus:ring-4 focus:ring-lime-200 enabled:hover:bg-gradient-to-l enabled:hover:from-teal-200 enabled:hover:to-lime-200 enabled:hover:text-gray-900 dark:focus:ring-teal-700"},inner:{base:"flex items-stretch transition-all duration-200",position:{none:"",start:"rounded-r-none",middle:"rounded-none",end:"roun
478ded-l-none"},outline:"border border-transparent",isProcessingPadding:{xs:"pl-8",sm:"pl-10",md:"pl-12",lg:"pl-16",xl:"pl-20"}},label:"ml-2 inline-flex h-4 w-4 items-center justify-center rounded-full bg-cyan-200 text-xs font-semibold text-cyan-800",outline:{color:{gray:"border border-gray-900 dark:border-white",default:"border-0",light:""},off:"",on:"flex w-full justify-center bg-white text-gray-900 transition-all duration-75 ease-in group-enabled:group-hover:bg-opacity-0 group-enabled:group-hover:text-inherit dark:bg-gray-900 dark:text-white",pill:{off:"rounded-md",on:"rounded-full"}},pill:{off:"rounded-lg",on:"rounded-full"},size:{xs:"px-2 py-1 text-xs",sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-sm",lg:"px-5 py-2.5 text-base",xl:"px-6 py-3 text-base"}},kde={base:"inline-flex",position:{none:"",start:"rounded-r-none focus:ring-2",middle:"rounded-none border-l-0 pl-0 focus:ring-2",end:"rounded-l-none border-l-0 pl-0 focus:ring-2"}},Sde={root:{base:"flex rounded-lg border border-gray-200 bg-white shadow-md dark:border-gray-700 dark:bg-gray-800",children:"flex h-full flex-col justify-center gap-4 p-6",horizontal:{off:"flex-col",on:"flex-col md:max-w-xl md:flex-row"},href:"hover:bg-gray-100 dark:hover:bg-gray-700"},img:{base:"",horizontal:{off:"rounded-t-lg",on:"h-96 w-full rounded-t-lg object-cover md:h-auto md:w-48 md:rounded-none md:rounded-l-lg"}}},Cde={root:{base:"relative h-full w-full",leftControl:"absolute left-0 top-0 flex h-full items-center justify-center px-4 focus:outline-none",rightControl:"absolute right-0 top-0 flex h-full items-center justify-center px-4 focus:outline-none"},indicators:{active:{off:"bg-white/50 hover:bg-white dark:bg-gray-800/50 dark:hover:bg-gray-800",on:"bg-white dark:bg-gray-800"},base:"h-3 w-3 rounded-full",wrapper:"absolute bottom-5 left-1/2 flex -translate-x-1/2 space-x-3"},item:{base:"absolute left-1/2 top-1/2 block w-full -translate-x-1/2 -translate-y-1/2",wrapper:{off:"w-full flex-shrink-0 transform cursor-default snap-center",on:"w-full flex-shrink-0 transform cursor-grab snap-center"}},control:{base:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-white/30 group-hover:bg-white/50 group-focus:outline-none group-focus:ring-4 group-focus:ring-white dark:bg-gray-800/30 dark:group-hover:bg-gray-800/60 dark:group-focus:ring-gray-800/70 sm:h-10 sm:w-10",icon:"h-5 w-5 text-white dark:text-gray-800 sm:h-6 sm:w-6"},scrollContainer:{base:"flex h-full snap-mandatory overflow-y-hidden overflow-x-scroll scroll-smooth rounded-lg",snap:"snap-x"}},Ede={root:{base:"h-4 w-4 rounded border border-gray-300 bg-gray-100 focus:ring-2 dark:border-gray-600 dark:bg-gray-700",color:{default:"text-cyan-600 focus:ring-cyan-600 dark:ring-offset-gray-800 dark:focus:ring-cyan-600",dark:"text-gray-800 focus:ring-gray-800 dark:ring-offset-gray-800 dark:focus:ring-gray-800",failure:"text-red-900 focus:ring-red-900 dark:ring-offset-red-900 dark:focus:ring-red-900",gray:"text-gray-900 focus:ring-gray-900 dark:ring-offset-gray-900 dark:focus:ring-gray-900",info:"text-cyan-800 focus:ring-cyan-800 dark:ring-offset-gray-800 dark:focus:ring-cyan-800",light:"text-gray-900 focus:ring-gray-900 dark:ring-offset-gray-900 dark:focus:ring-gray-900",purple:"text-purple-600 focus:ring-purple-600 dark:ring-offset-purple-600 dark:focus:ring-purple-600",success:"text-green-800 focus:ring-green-800 dark:ring-offset-green-800 dark:focus:ring-green-800",warning:"text-yellow-400 focus:ring-yellow-400 dark:ring-offset-yellow-400 dark:focus:ring-yellow-400",blue:"text-blue-700 focus:ring-blue-600 dark:ring-offset-blue-700 dark:focus:ring-blue-700",cyan:"text-cyan-600 focus:ring-cyan-600 dark:ring-offset-cyan-600 dark:focus:ring-cyan-600",green:"text-green-600 focus:ring-green-600 dark:ring-offset-green-600 dark:focus:ring-green-600",indigo:"text-indigo-700 focus:ring-indigo-700 dark:ring-offset-indigo-700 dark:focus:ring-indigo-700",lime:"text-lime-700 focus:ring-lime-700 dark:ring-offset-lime-700 dark:focus:ring-lime-700",pink:"text-pink-600 focus:ring-pink-600 dark:ring-offset-pink-600 dark:focus:ring-pink-600",red:"text-red-600 focus:ring-red-600 dark:ring-offset-red-600 dark:focus:ring-red-600",teal:"text-teal-600 focus:ring-teal-600 dar
478k:ring-offset-teal-600 dark:focus:ring-teal-600",yellow:"text-yellow-400 focus:ring-yellow-400 dark:ring-offset-yellow-400 dark:focus:ring-yellow-400"}}},Ode={root:{base:"rounded-lg p-2.5 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-700",icon:"h-5 w-5"}},Ade={root:{base:"relative"},popup:{root:{base:"absolute top-10 z-50 block pt-2",inline:"relative top-0 z-auto",inner:"inline-block rounded-lg bg-white p-4 shadow-lg dark:bg-gray-700"},header:{base:"",title:"px-2 py-3 text-center font-semibold text-gray-900 dark:text-white",selectors:{base:"mb-2 flex justify-between",button:{base:"rounded-lg bg-white px-5 py-2.5 text-sm font-semibold text-gray-900 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600",prev:"",next:"",view:""}}},view:{base:"p-1"},footer:{base:"mt-2 flex space-x-2",button:{base:"w-full rounded-lg px-5 py-2 text-center text-sm font-medium focus:ring-4 focus:ring-cyan-300",today:"bg-cyan-700 text-white hover:bg-cyan-800 dark:bg-cyan-600 dark:hover:bg-cyan-700",clear:"border border-gray-300 bg-white text-gray-900 hover:bg-gray-100 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600"}}},views:{days:{header:{base:"mb-1 grid grid-cols-7",title:"h-6 text-center text-sm font-medium leading-6 text-gray-500 dark:text-gray-400"},items:{base:"grid w-64 grid-cols-7",item:{base:"block flex-1 cursor-pointer rounded-lg border-0 text-center text-sm font-semibold leading-9 text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-600 ",selected:"bg-cyan-700 text-white hover:bg-cyan-600",disabled:"text-gray-500"}}},months:{items:{base:"grid w-64 grid-cols-4",item:{base:"block flex-1 cursor-pointer rounded-lg border-0 text-center text-sm font-semibold leading-9 text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-600",selected:"bg-cyan-700 text-white hover:bg-cyan-600",disabled:"text-gray-500"}}},years:{items:{base:"grid w-64 grid-cols-4",item:{base:"block flex-1 cursor-pointer rounded-lg border-0 text-center text-sm font-semibold leading-9 text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-600",selected:"bg-cyan-700 text-white hover:bg-cyan-600",disabled:"text-gray-500"}}},decades:{items:{base:"grid w-64 grid-cols-4",item:{base:"block flex-1 cursor-pointer rounded-lg border-0 text-center text-sm font-semibold leading-9 text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-600",selected:"bg-cyan-700 text-white hover:bg-cyan-600",disabled:"text-gray-500"}}}}},Tde={arrowIcon:"ml-2 h-4 w-4",content:"py-1 focus:outline-none",floating:{animation:"transition-opacity",arrow:{base:"absolute z-10 h-2 w-2 rotate-45",style:{dark:"bg-gray-900 dark:bg-gray-700",light:"bg-white",auto:"bg-white dark:bg-gray-700"},placement:"-4px"},base:"z-10 w-fit divide-y divide-gray-100 rounded shadow focus:outline-none",content:"py-1 text-sm text-gray-700 dark:text-gray-200",divider:"my-1 h-px bg-gray-100 dark:bg-gray-600",header:"block px-4 py-2 text-sm text-gray-700 dark:text-gray-200",hidden:"invisible opacity-0",item:{container:"",base:"flex w-full cursor-pointer items-center justify-start px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 focus:bg-gray-100 focus:outline-none dark:text-gray-200 dark:hover:bg-gray-600 dark:hover:text-white dark:focus:bg-gray-600 dark:focus:text-white",icon:"mr-2 h-4 w-4"},style:{dark:"bg-gray-900 text-white dark:bg-gray-700",light:"border border-gray-200 bg-white text-gray-900",auto:"border border-gray-200 bg-white text-gray-900 dark:border-none dark:bg-gray-700 dark:text-white"},target:"w-fit"},inlineWrapper:"flex items-center"},Pde={root:{base:"flex"},field:{base:"relative w-full",input:{base:"block w-full overflow-hidden rounded-lg border disabled:cursor-not-allowed disabled:opacity-50",sizes:{sm:"sm:text-xs",md:"text-sm",lg:"sm:text-base"},colors:{gray:"border-gray-300 bg-gray-50 text-gray-900 focus:border-cyan-500 focus:ring-cyan-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",info:"border-cyan-500 bg-cyan-50 text-cyan-900 placeholder-cyan-700 focus:border-cyan-500 focus:ring-cyan-500 dark:border-cyan-400 dark:bg-cyan-100 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",failure:"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500",warning:"border-yellow-500 bg-yellow-50 text-yellow-900 placeholder-yellow-700 focus:border-yellow-500 focus:ring-yellow-500 dark:border-yellow-400 dark:bg-yellow-100 dark:focus:border-yellow-500 dark:focus:ring-yellow-500",success:"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500"}}}},Rde={input:{default:{filled:{sm:"peer block w-full appearance-none rounded-t-lg border-0 border-b-2 border-gray-300 bg-gray-50 px-2.5 pb-2.5 pt-5 text-xs text-gray-900 focus:border-blue-600 focus:outline-none focus:ring-0 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:focus:border-blue-500",md:"peer block w-full appearance-none rounded-t-lg border-0 border-b-2 border-gray-300 bg-gray-50 px-2.5 pb-2.5 pt-5 text-sm text-gray-900 focus:border-blue-600 focus:outline-none focus:ring-0 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:focus:border-blue-500"},outlined:{sm:"peer block w-full appearance-none rounded-lg border border-gray-300 bg-transparent px-2.5 pb-2.5 pt-4 text-xs text-gray-900 focus:border-blue-600 focus:outline-none focus:ring-0 dark:border-gray-600 dark:text-white dark:focus:border-blue-500",md:"peer block w-full appearance-none rounded-lg border border-gray-300 bg-transparent px-2.5 pb-2.5 pt-4 text-sm text-gray-900 focus:border-blue-600 focus:outline-none focus:ring-0 dark:border-gray-600 dark:text-white dark:focus:border-blue-500"},standard:{sm:"peer block w-full appearance-none border-0 border-b-2 border-gray-300 bg-transparent px-0 py-2.5 text-xs text-gray-900 focus:border-blue-600 focus:outline-none focus:ring-0 dark:border-gray-600 dark:text-white dark:focus:border-blue-500",md:"peer block w-full appearance-none border-0 border-b-2 border-gray-300 bg-transparent px-0 py-2.5 text-sm text-gray-900 focus:border-blue-600 focus:outline-none focus:ring-0 dark:border-gray-600 dark:text-white dark:focus:border-blue-500"}},success:{filled:{sm:"peer block w-full appearance-none rounded-t-lg border-0 border-b-2 border-green-600 bg-gray-50 px-2.5 pb-2.5 pt-5 text-xs text-gray-900 focus:border-green-600 focus:outline-none focus:ring-0 dark:border-green-500 dark:bg-gray-700 dark:text-white dark:focus:border-green-500",md:"peer block w-full appearance-none rounded-t-lg border-0 border-b-2 border-green-600 bg-gray-50 px-2.5 pb-2.5 pt-5 text-sm text-gray-900 focus:border-green-600 focus:outline-none focus:ring-0 dark:border-green-500 dark:bg-gray-700 dark:text-white dark:focus:border-green-500"},outlined:{sm:"peer block w-full appearance-none rounded-lg border border-green-600 bg-transparent px-2.5 pb-2.5 pt-4 text-xs text-gray-900 focus:border-green-600 focus:outline-none focus:ring-0 dark:border-green-500 dark:text-white dark:focus:border-green-500",md:"peer block w-full appearance-none rounded-lg border border-green-600 bg-transparent px-2.5 pb-2.5 pt-4 text-sm text-gray-900 focus:border-green-600 focus:outline-none focus:ring-0 dark:border-green-500 dark:text-white dark:focus:border-green-500"},standard:{sm:"peer block w-full appearance-none border-0 border-b-2 border-green-600 bg-transparent px-0 py-2.5 text-xs text-gray-900 focus:border-green-600 focus:outline-none focus:ring-0 dark:border-green-500 dark:text-white dark:focus:border-green-500",md:"peer block w-full appearance-none border-0 border-b-2 border-green-600 bg-transparent px-0 py-2.5 text-sm text-gray-900 focus:border-green-600 focus:outline-none focus:ring-0 dark:border-green-500 dark:text-white dark:focus:border-green-500"}},error:{filled:{sm:"peer block w-full appearance-none rounded-t-lg border-0 border-b-2 border-red-600 bg-gray-50 px-2.5 pb-2.5 pt-5 text-xs text-gray-900 focus:border-red-600 focus:outline-none focus:ring-0 dark:border-red-500 dark:bg-gray-700 dark:text-white dark:focus:border-red-500",md:"peer block w-full appearance-none rounded-t-lg border-0 border-b-2 border-red-600 bg-gray-50 px-2.5 pb-2.5 pt-5 text-sm text-gray-900 focus:border-red-600 focus:outline-none focus:ring-0 dark:border-red-500 dark:bg-gray-700 dark:text-white dark:focus:border-red-500"},outlined:{sm:"peer block w-full appearance-none rounded-lg border border-red-600 bg-transparent px-2.5 pb-2.5 pt-4 text-xs text-gray-900 focus:border-red-600 focus:outline-none focus:ring-0 dark:border-red-500 dark:text-white dark:focus:border-red-500",md:"peer block w-full appearance-none rounded-lg border border-red-600 bg-transparent px-2.5 pb-2.5 pt-4 text-sm text-gray-900 focus:border-red-600 focus:outline-none focus:ring-0 dark:border-red-500 dark:text-white dark:focus:border-red-500"},standard:{sm:"peer block w-full appearance-none border-0 border-b-2 border-red-600 bg-transparent px-0 py-2.5 text-xs text-gray-900 focus:border-red-600 focus:outline-none focus:ring-0 dark:border-red-500 dark:text-white dark:focus:border-red-500",md:"peer block w-full appearance-none border-0 border-b-2 border-red-600 bg-transparent px-0 py-2.5 text-sm text-gray-900 focus:border-red-600 focus:outline-none focus:ring-0 dark:border-red-500 dark:text-white dark:focus:border-red-500"}}},label:{default:{filled:{sm:"absolute left-2.5 top-4 z-10 origin-[0] -translate-y-4 scale-75 text-xs text-gray-500 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:text-blue-600 dar
478k:text-gray-400 peer-focus:dark:text-blue-500",md:"absolute left-2.5 top-4 z-10 origin-[0] -translate-y-4 scale-75 text-sm text-gray-500 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:text-blue-600 dark:text-gray-400 peer-focus:dark:text-blue-500"},outlined:{sm:"absolute left-1 top-2 z-10 origin-[0] -translate-y-4 scale-75 bg-white px-2 text-xs text-gray-500 transition-transform duration-300 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-2 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 peer-focus:text-blue-600 dark:bg-gray-900 dark:text-gray-400 peer-focus:dark:text-blue-500",md:"absolute left-1 top-2 z-10 origin-[0] -translate-y-4 scale-75 bg-white px-2 text-sm text-gray-500 transition-transform duration-300 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-2 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 peer-focus:text-blue-600 dark:bg-gray-900 dark:text-gray-400 peer-focus:dark:text-blue-500"},standard:{sm:"absolute top-3 -z-10 origin-[0] -translate-y-6 scale-75 text-xs text-gray-500 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:left-0 peer-focus:-translate-y-6 peer-focus:scale-75 peer-focus:text-blue-600 dark:text-gray-400 peer-focus:dark:text-blue-500",md:"absolute top-3 -z-10 origin-[0] -translate-y-6 scale-75 text-sm text-gray-500 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:left-0 peer-focus:-translate-y-6 peer-focus:scale-75 peer-focus:text-blue-600 dark:text-gray-400 peer-focus:dark:text-blue-500"}},success:{filled:{sm:"absolute left-2.5 top-4 z-10 origin-[0] -translate-y-4 scale-75 text-sm text-green-600 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:-translate-y-4 peer-focus:scale-75 dark:text-green-500",md:"absolute left-2.5 top-4 z-10 origin-[0] -translate-y-4 scale-75 text-sm text-green-600 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:-translate-y-4 peer-focus:scale-75 dark:text-green-500"},outlined:{sm:"absolute left-1 top-2 z-10 origin-[0] -translate-y-4 scale-75 bg-white px-2 text-sm text-green-600 transition-transform duration-300 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-2 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 dark:bg-gray-900 dark:text-green-500",md:"absolute left-1 top-2 z-10 origin-[0] -translate-y-4 scale-75 bg-white px-2 text-sm text-green-600 transition-transform duration-300 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-2 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 dark:bg-gray-900 dark:text-green-500"},standard:{sm:"absolute top-3 -z-10 origin-[0] -translate-y-6 scale-75 text-xs text-green-600 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:left-0 peer-focus:-translate-y-6 peer-focus:scale-75 dark:text-green-500",md:"absolute top-3 -z-10 origin-[0] -translate-y-6 scale-75 text-sm text-green-600 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:left-0 peer-focus:-translate-y-6 peer-focus:scale-75 dark:text-green-500"}},error:{filled:{sm:"absolute left-2.5 top-4 z-10 origin-[0] -translate-y-4 scale-75 text-xs text-red-600 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:-translate-y-4 peer-focus:scale-75 dark:text-red-500",md:"absolute left-2.5 top-4 z-10 origin-[0] -translate-y-4 scale-75 text-xs text-red-600 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:-translate-y-4 peer-focus:scale-75 dark:text-red-500"},outlined:{sm:"absolute left-1 top-2 z-10 origin-[0] -translate-y-4 scale-75 bg-white px-2 text-xs text-red-600 transition-transform duration-300 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-2 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 dark:bg-gray-900 dark:text-red-500",md:"absolute left-1 top-2 z-10 origin-[0] -translate-y-4 scale-75 bg-white px-2 text-xs text-red-600 transition-transform duration-300 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-2 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 dark:bg-gray-900 dark:text-red-500"},standard:{sm:"absolute top-3 -z-10 origin-[0] -translate-y-6 scale-75 text-xs text-red-600 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:left-0 peer-focus:-translate-y-6 peer-focus:scale-75 dark:text-red-500",md:"absolute top-3 -z-10 origin-[0] -translate-y-6 scale-75 text-sm text-red-600 transition-transform duration-300 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:left-0 peer-focus:-translate-y-6 peer-focus:scale-75 dark:text-red-500"}}},helperText:{default:"mt-2 text-xs text-gray-600 dark:text-gray-400",success:"mt-2 text-xs text-green-600 dark:text-green-400",error:"mt-2 text-xs text-red-600 dark:text-red-400"}}
478,Mde={root:{base:"w-full rounded-lg bg-white shadow dark:bg-gray-800 md:flex md:items-center md:justify-between",container:"w-full p-6",bgDark:"bg-gray-800"},groupLink:{base:"flex flex-wrap text-sm text-gray-500 dark:text-white",link:{base:"me-4 last:mr-0 md:mr-6",href:"hover:underline"},col:"flex-col space-y-4"},icon:{base:"text-gray-500 dark:hover:text-white",size:"h-5 w-5"},title:{base:"mb-6 text-sm font-semibold uppercase text-gray-500 dark:text-white"},divider:{base:"my-6 w-full border-gray-200 dark:border-gray-700 sm:mx-auto lg:my-8"},copyright:{base:"text-sm text-gray-500 dark:text-gray-400 sm:text-center",href:"ml-1 hover:underline",span:"ml-1"},brand:{base:"mb-4 flex items-center sm:mb-0",img:"mr-3 h-8",span:"self-center whitespace-nowrap text-2xl font-semibold text-gray-800 dark:text-white"}},Dde={root:{base:"mt-2 text-sm",colors:{gray:"text-gray-500 dark:text-gray-400",info:"text-cyan-700 dark:text-cyan-800",success:"text-green-600 dark:text-green-500",failure:"text-red-600 dark:text-red-500",warning:"text-yellow-500 dark:text-yellow-600"}}},$de={root:{base:"rounded-lg border border-gray-200 bg-gray-100 px-2 py-1.5 text-xs font-semibold text-gray-800 dark:border-gray-500 dark:bg-gray-600 dark:text-gray-100",icon:"inline-block"}},Ide={root:{base:"text-sm font-medium",disabled:"opacity-50",colors:{default:"text-gray-900 dark:text-white",info:"text-cyan-500 dark:text-cyan-600",failure:"text-red-700 dark:text-red-500",warning:"text-yellow-500 dark:text-yellow-600",success:"text-green-700 dark:text-green-500"}}},Lde={root:{base:"list-inside space-y-1 text-gray-500 dark:text-gray-400",ordered:{off:"list-disc",on:"list-decimal"},horizontal:"flex list-none flex-wrap items-center justify-center space-x-4 space-y-0",unstyled:"list-none",nested:"mt-2 ps-5"},item:{withIcon:{off:"",on:"flex items-center"},icon:"me-2 h-3.5 w-3.5 flex-shrink-0"}},Fde={root:{base:"list-none rounded-lg border border-gray-200 bg-white text-left text-sm font-medium text-gray-900 dark:border-gray-600 dark:bg-gray-700 dark:text-white"},item:{base:"[&>*]:first:rounded-t-lg [&>*]:last:rounded-b-lg [&>*]:last:border-b-0",link:{base:"flex w-full items-center border-b border-gray-200 px-4 py-2 dark:border-gray-600",active:{off:"hover:bg-gray-100 hover:text-cyan-700 focus:text-cyan-700 focus:outline-none focus:ring-2 focus:ring-cyan-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:text-white dark:focus:text-white dark:focus:ring-gray-500",on:"bg-cyan-700 text-white dark:bg-gray-800"},disabled:{off:"",on:"cursor-not-allowed bg-gray-100 text-gray-900 hover:bg-gray-100 hover:text-gray-900 focus:text-gray-900"},href:{off:"",on:""},icon:"mr-2 h-4 w-4 fill-current"}}},zde={root:{base:"fixed inset-x-0 top-0 z-50 h-screen overflow-y-auto overflow-x-hidden md:inset-0 md:h-full",show:{on:"flex bg-gray-900 bg-opacity-50 dark:bg-opacity-80",off:"hidden"},sizes:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","3xl":"max-w-3xl","4xl":"max-w-4xl","5xl":"max-w-5xl","6xl":"max-w-6xl","7xl":"max-w-7xl"},positions:{"top-left":"items-start justify-start","top-center":"items-start justify-center","top-right":"items-start justify-end","center-left":"items-center justify-start",center:"items-center justify-center","center-right":"items-center justify-end","bottom-right":"items-end justify-end","bottom-center":"items-end justify-center","bottom-left":"items-end justify-start"}},content:{base:"relative h-full w-full p-4 md:h-auto",inner:"relative flex max-h-[90dvh] flex-col rounded-lg bg-white shadow dark:bg-gray-700"},body:{base:"flex-1 overflow-auto p-6",popup:"pt-0"},header:{base:"flex items-start justify-between rounded-t border-b p-5 dark:border-gray-600",popup:"border-b-0 p-2",title:"text-xl font-medium text-gray-900 dark:text-white",close:{base:"ml-auto inline-flex items-center rounded-lg bg-transparent p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white",icon:"h-5 w-5"}},footer:{base:"flex items-center space-x-2 rounded-b border-gray-200 p-6 dark:border-gray-600",popup:"border-t"}}
478,Bde={root:{base:"bg-white px-2 py-2.5 dark:border-gray-700 dark:bg-gray-800 sm:px-4",rounded:{on:"rounded",off:""},bordered:{on:"border",off:""},inner:{base:"mx-auto flex flex-wrap items-center justify-between",fluid:{on:"",off:"container"}}},brand:{base:"flex items-center"},collapse:{base:"w-full md:block md:w-auto",list:"mt-4 flex flex-col md:mt-0 md:flex-row md:space-x-8 md:text-sm md:font-medium",hidden:{on:"hidden",off:""}},link:{base:"block py-2 pl-3 pr-4 md:p-0",active:{on:"bg-cyan-700 text-white dark:text-white md:bg-transparent md:text-cyan-700",off:"border-b border-gray-100 text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:border-0 md:hover:bg-transparent md:hover:text-cyan-700 md:dark:hover:bg-transparent md:dark:hover:text-white"},disabled:{on:"text-gray-400 hover:cursor-not-allowed dark:text-gray-600",off:""}},toggle:{base:"inline-flex items-center rounded-lg p-2 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600 md:hidden",icon:"h-6 w-6 shrink-0"}},Ude={base:"",layout:{table:{base:"text-sm text-gray-700 dark:text-gray-400",span:"font-semibold text-gray-900 dark:text-white"}},pages:{base:"xs:mt-0 mt-2 inline-flex items-center -space-x-px",showIcon:"inline-flex",previous:{base:"ml-0 rounded-l-lg border border-gray-300 bg-white px-3 py-2 leading-tight text-gray-500 enabled:hover:bg-gray-100 enabled:hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 enabled:dark:hover:bg-gray-700 enabled:dark:hover:text-white",icon:"h-5 w-5"},next:{base:"rounded-r-lg border border-gray-300 bg-white px-3 py-2 leading-tight text-gray-500 enabled:hover:bg-gray-100 enabled:hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 enabled:dark:hover:bg-gray-700 enabled:dark:hover:text-white",icon:"h-5 w-5"},selector:{base:"w-12 border border-gray-300 bg-white py-2 leading-tight text-gray-500 enabled:hover:bg-gray-100 enabled:hover:text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 enabled:dark:hover:bg-gray-700 enabled:dark:hover:text-white",active:"bg-cyan-50 text-cyan-600 hover:bg-cyan-100 hover:text-cyan-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white",disabled:"cursor-not-allowed opacity-50"}}},qde={base:"absolute z-20 inline-block w-max max-w-[100vw] bg-white outline-none border border-gray-200 rounded-lg shadow-sm dark:border-gray-600 dark:bg-gray-800",content:"z-10 overflow-hidden rounded-[7px]",arrow:{base:"absolute h-2 w-2 z-0 rotate-45 mix-blend-lighten bg-white border border-gray-200 dark:border-gray-600 dark:bg-gray-800 dark:mix-blend-color",placement:"-4px"}},Hde={base:"w-full overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700",label:"mb-1 flex justify-between font-medium dark:text-white",bar:"space-x-2 rounded-full text-center font-medium leading-none text-cyan-300 dark:text-cyan-100",color:{dark:"bg-gray-600 dark:bg-gray-300",blue:"bg-blue-600",red:"bg-red-600 dark:bg-red-500",green:"bg-green-600 dark:bg-green-500",yellow:"bg-yellow-400",indigo:"bg-indigo-600 dark:bg-indigo-500",purple:"bg-purple-600 dark:bg-purple-500",cyan:"bg-cyan-600",gray:"bg-gray-500",lime:"bg-lime-600",pink:"bg-pink-500",teal:"bg-teal-600"},size:{sm:"h-1.5",md:"h-2.5",lg:"h-4",xl:"h-6"}},Kde={root:{base:"h-4 w-4 border border-gray-300 text-cyan-600 focus:ring-2 focus:ring-cyan-500 dark:border-gray-600 dark:bg-gray-700 dark:focus:bg-cyan-600 dark:focus:ring-cyan-600"}},Vde={root:{base:"flex"},field:{base:"relative w-full",input:{base:"w-full cursor-pointer appearance-none rounded-lg bg-gray-200 dark:bg-gray-700",sizes:{sm:"h-1",md:"h-2",lg:"h-3"}}}},Gde={root:{base:"flex items-center"},star:{empty:"text-gray-300 dark:text-gray-500",filled:"text-yellow-400",sizes:{sm:"h-5 w-5",md:"h-7 w-7",lg:"h-10 w-10"}}},Wde={base:"flex items-center",label:"text-sm font-medium text-cyan-600 dark:text-cyan-500",progress:{base:"mx-4 h-5 w-2/4 rounded bg-gray-200 dark:bg-gray-700",fill:"h-5 rounded bg-yellow-400",label:"text-sm font-medium text-cyan-600 dark:text-cyan-500"}},Yde={base:"flex",addon:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400",field:{base:"relative w-full",icon:{base:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",svg:"h-5 w-5 text-gray-500 dark:text-gray-400"}
478,select:{base:"block w-full border disabled:cursor-not-allowed disabled:opacity-50",withIcon:{on:"pl-10",off:""},withAddon:{on:"rounded-r-lg",off:"rounded-lg"},withShadow:{on:"shadow-sm dark:shadow-sm-light",off:""},sizes:{sm:"p-2 sm:text-xs",md:"p-2.5 text-sm",lg:"p-4 sm:text-base"},colors:{gray:"border-gray-300 bg-gray-50 text-gray-900 focus:border-cyan-500 focus:ring-cyan-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",info:"border-cyan-500 bg-cyan-50 text-cyan-900 placeholder-cyan-700 focus:border-cyan-500 focus:ring-cyan-500 dark:border-cyan-400 dark:bg-cyan-100 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",failure:"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500",warning:"border-yellow-500 bg-yellow-50 text-yellow-900 placeholder-yellow-700 focus:border-yellow-500 focus:ring-yellow-500 dark:border-yellow-400 dark:bg-yellow-100 dark:focus:border-yellow-500 dark:focus:ring-yellow-500",success:"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500"}}}},Xde={root:{base:"h-full",collapsed:{on:"w-16",off:"w-64"},inner:"h-full overflow-y-auto overflow-x-hidden rounded bg-gray-50 px-3 py-4 dark:bg-gray-800"},collapse:{button:"group flex w-full items-center rounded-lg p-2 text-base font-normal text-gray-900 transition duration-75 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700",icon:{base:"h-6 w-6 text-gray-500 transition duration-75 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white",open:{off:"",on:"text-gray-900"}},label:{base:"ml-3 flex-1 whitespace-nowrap text-left",icon:{base:"h-6 w-6 transition delay-0 ease-in-out",open:{on:"rotate-180",off:""}}},list:"space-y-2 py-2"},cta:{base:"mt-6 rounded-lg bg-gray-100 p-4 dark:bg-gray-700",color:{blue:"bg-cyan-50 dark:bg-cyan-900",dark:"bg-dark-50 dark:bg-dark-900",failure:"bg-red-50 dark:bg-red-900",gray:"bg-alternative-50 dark:bg-alternative-900",green:"bg-green-50 dark:bg-green-900",light:"bg-light-50 dark:bg-light-900",red:"bg-red-50 dark:bg-red-900",purple:"bg-purple-50 dark:bg-purple-900",success:"bg-green-50 dark:bg-green-900",yellow:"bg-yellow-50 dark:bg-yellow-900",warning:"bg-yellow-50 dark:bg-yellow-900"}},item:{base:"flex items-center justify-center rounded-lg p-2 text-base font-normal text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700",active:"bg-gray-100 dark:bg-gray-700",collapsed:{insideCollapse:"group w-full pl-8 transition duration-75",noIcon:"font-bold"},content:{base:"flex-1 whitespace-nowrap px-3"},icon:{base:"h-6 w-6 flex-shrink-0 text-gray-500 transition duration-75 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-white",active:"text-gray-700 dark:text-gray-100"},label:"",listItem:""},items:{base:""},itemGroup:{base:"mt-4 space-y-2 border-t border-gray-200 pt-4 first:mt-0 first:border-t-0 first:pt-0 dark:border-gray-700"},logo:{base:"mb-5 flex items-center pl-2.5",collapsed:{on:"hidden",off:"self-center whitespace-nowrap text-xl font-semibold dark:text-white"},img:"mr-3 h-6 sm:h-7"}},Qde={base:"inline animate-spin text-gray-200",color:{failure:"fill-red-600",gray:"fill-gray-600",info:"fill-cyan-600",pink:"fill-pink-600",purple:"fill-purple-600",success:"fill-green-500",warning:"fill-yellow-400"},light:{off:{base:"dark:text-gray-600",color:{failure:"",gray:"dark:fill-gray-300",info:"",pink:"",purple:"",success:"",warning:""}},on:{base:"",color:{failure:"",gray:"",info:"",pink:"",purple:"",success:"",warning:""}}},size:{xs:"h-3 w-3",sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8",xl:"h-10 w-10"}},Zde={root:{base:"w-full text-left text-sm text-gray-500 dark:text-gray-400",shadow:"absolute left-0 top-0 -z-10 h-full w-full rounded-lg bg-white drop-shadow-md dark:bg-black",wrapper:"relative"},body:{base:"group/body",cell:{base:"px-6 py-4 group-first/body:group-first/row:first:rounded-tl-lg group-first/body:group-first/row:last:rounded-tr-lg group-last/body:group-last/row:first:rounded-bl-lg group-last/body:group-last/row:last:rounded-br-lg"}},head:{base:"group/head text-xs uppercase text-gray-700 dark:text-gray-400",cell:{base:"bg-gray-50 px-6 py-3 group-first/head:first:rounded-tl-lg group-first/head:last:rounded-tr-lg dark:bg-gray-700"}},row:{base:"group/row",hovered:"hover:bg-gray-50 dark:hover:bg-gray-600",striped:"odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700"}},Jde={base:"flex flex-col gap-2",tablist:{base:"flex text-center",styles:{default:"flex-wrap border-b border-gray-200 dark:border-gray-700",underline:"-mb-px flex-wrap border-b border-gray-200 dark:border-gray-700",pills:"flex-wrap space-x-2 text-sm font-medium text-gray-500 dark:text-gray-400",fullWidth:"grid w-full grid-flow-col divide-x divide-gray-200 rounded-none text-sm font-medium shadow dark:divide-gray-700 dark:text-gray-400"},tabitem:{base:"flex items-center justify-center rounded-t-lg p-4 text-sm font-medium first:ml-0 focus:outline-none focus:ring-4 focus:ring-cyan-300 disabled:cursor-not-allowed disabled:text-gray-400 disabled:dark:text-gray-500",styles:{default:{base:"rounded-t-lg",active:{on:"bg-gray-100 text-cyan-600 dark:bg-gray-800 dark:text-cyan-500",off:"text-gray-500 hover:bg-gray-50 hover:text-gray-600 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-300"}},underline:{base:"rounded-t-lg",active:{on:"active rounded-t-lg border-b-2 border-cyan-600 text-cyan-600 dark:border-cyan-500 dark:text-cyan-500",off:"border-b-2 border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300"}},pills:{base:"",active:{on:"rounded-lg bg-cyan-600 text-white",off:"rounded-lg hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-white"}},fullWidth:{base:"ml-0 flex w-full rounded-none first:ml-0",active:{on:"active rounded-none bg-gray-100 p-4 text-gray-900 dark:bg-gray-700 dark:text-white",off:"rounded-none bg-white hover:bg-gray-50 hover:text-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700 dark:hover:text-white"}}},icon:"mr-2 h-5 w-5"}},tabitemcontainer:{base:"",styles:{default:"",underline:"",pills:"",fullWidth:""}},tabpanel:"py-3"}
478,efe={base:"block w-full rounded-lg border text-sm disabled:cursor-not-allowed disabled:opacity-50",colors:{gray:"border-gray-300 bg-gray-50 text-gray-900 focus:border-cyan-500 focus:ring-cyan-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",info:"border-cyan-500 bg-cyan-50 text-cyan-900 placeholder-cyan-700 focus:border-cyan-500 focus:ring-cyan-500 dark:border-cyan-400 dark:bg-cyan-100 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",failure:"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500",warning:"border-yellow-500 bg-yellow-50 text-yellow-900 placeholder-yellow-700 focus:border-yellow-500 focus:ring-yellow-500 dark:border-yellow-400 dark:bg-yellow-100 dark:focus:border-yellow-500 dark:focus:ring-yellow-500",success:"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500"},withShadow:{on:"shadow-sm dark:shadow-sm-light",off:""}},tfe={base:"flex",addon:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400",field:{base:"relative w-full",icon:{base:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",svg:"h-5 w-5 text-gray-500 dark:text-gray-400"},rightIcon:{base:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",svg:"h-5 w-5 text-gray-500 dark:text-gray-400"},input:{base:"block w-full border disabled:cursor-not-allowed disabled:opacity-50",sizes:{sm:"p-2 sm:text-xs",md:"p-2.5 text-sm",lg:"p-4 sm:text-base"},colors:{gray:"border-gray-300 bg-gray-50 text-gray-900 focus:border-cyan-500 focus:ring-cyan-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",info:"border-cyan-500 bg-cyan-50 text-cyan-900 placeholder-cyan-700 focus:border-cyan-500 focus:ring-cyan-500 dark:border-cyan-400 dark:bg-cyan-100 dark:focus:border-cyan-500 dark:focus:ring-cyan-500",failure:"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:bg-red-100 dark:focus:border-red-500 dark:focus:ring-red-500",warning:"border-yellow-500 bg-yellow-50 text-yellow-900 placeholder-yellow-700 focus:border-yellow-500 focus:ring-yellow-500 dark:border-yellow-400 dark:bg-yellow-100 dark:focus:border-yellow-500 dark:focus:ring-yellow-500",success:"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:bg-green-100 dark:focus:border-green-500 dark:focus:ring-green-500"},withRightIcon:{on:"pr-10",off:""},withIcon:{on:"pl-10",off:""},withAddon:{on:"rounded-r-lg",off:"rounded-lg"},withShadow:{on:"shadow-sm dark:shadow-sm-light",off:""}}}},nfe={root:{direction:{horizontal:"sm:flex",vertical:"relative border-l border-gray-200 dark:border-gray-700"}},item:{root:{horizontal:"relative mb-6 sm:mb-0",vertical:"mb-10 ml-6"},content:{root:{base:"mt-3 sm:pr-8"},body:{base:"mb-4 text-base font-normal text-gray-500 dark:text-gray-400"},time:{base:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500"},title:{base:"text-lg font-semibold text-gray-900 dark:text-white"}},point:{horizontal:"flex items-center",line:"hidden h-0.5 w-full bg-gray-200 dark:bg-gray-700 sm:flex",marker:{base:{horizontal:"absolute -left-1.5 h-3 w-3 rounded-full border border-white bg-gray-200 dark:border-gray-900 dark:bg-gray-700",vertical:"absolute -left-1.5 mt-1.5 h-3 w-3 rounded-full border border-white bg-gray-200 dark:border-gray-900 dark:bg-gray-700"},icon:{base:"h-3 w-3 text-cyan-600 dark:text-cyan-300",wrapper:"absolute -left-3 flex h-6 w-6 items-center justify-center rounded-full bg-cyan-200 ring-8 ring-white dark:bg-cyan-900 dark:ring-gray-900"}},vertical:""}}}
478,rfe={root:{base:"flex w-full max-w-xs items-center rounded-lg bg-white p-4 text-gray-500 shadow dark:bg-gray-800 dark:text-gray-400",closed:"opacity-0 ease-out"},toggle:{base:"-m-1.5 ml-auto inline-flex h-8 w-8 rounded-lg bg-white p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white",icon:"h-5 w-5 shrink-0"}},afe={root:{base:"group relative flex items-center rounded-lg focus:outline-none",active:{on:"cursor-pointer",off:"cursor-not-allowed opacity-50"},label:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300"},toggle:{base:"rounded-full border group-focus:ring-4 group-focus:ring-cyan-500/25",checked:{on:"after:translate-x-full after:border-white",off:"border-gray-200 bg-gray-200 dark:border-gray-600 dark:bg-gray-700",color:{blue:"border-cyan-700 bg-cyan-700",dark:"bg-dark-700 border-dark-900",failure:"border-red-900 bg-red-700",gray:"border-gray-600 bg-gray-500",green:"border-green-700 bg-green-600",light:"bg-light-700 border-light-900",red:"border-red-900 bg-red-700",purple:"border-purple-900 bg-purple-700",success:"border-green-500 bg-green-500",yellow:"border-yellow-400 bg-yellow-400",warning:"border-yellow-600 bg-yellow-600",cyan:"border-cyan-500 bg-cyan-500",lime:"border-lime-400 bg-lime-400",indigo:"border-indigo-400 bg-indigo-400",teal:"bg-gradient-to-r from-teal-400 via-teal-500 to-teal-600 hover:bg-gradient-to-br focus:ring-4",info:"border-cyan-600 bg-cyan-600",pink:"border-pink-600 bg-pink-600"}},sizes:{sm:"h-5 w-9 after:absolute after:left-[2px] after:top-[2px] after:h-4 after:w-4",md:"h-6 w-11 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5",lg:"h-7 w-14 after:absolute after:left-[4px] after:top-0.5 after:h-6 after:w-6"}}},sfe={target:"w-fit",animation:"transition-opacity",arrow:{base:"absolute z-10 h-2 w-2 rotate-45",style:{dark:"bg-gray-900 dark:bg-gray-700",light:"bg-white",auto:"bg-white dark:bg-gray-700"},placement:"-4px"},base:"absolute z-10 inline-block rounded-lg px-3 py-2 text-sm font-medium shadow-sm",hidden:"invisible opacity-0",style:{dark:"bg-gray-900 text-white dark:bg-gray-700",light:"border border-gray-200 bg-white text-gray-900",auto:"border border-gray-200 bg-white text-gray-900 dark:border-none dark:bg-gray-700 dark:text-white"},content:"relative z-20"},ife={accordion:bde,alert:yde,avatar:vde,badge:wde,blockquote:jde,breadcrumb:Nde,button:_de,buttonGroup:kde,card:Sde,carousel:Cde,checkbox:Ede,datepicker:Ade,darkThemeToggle:Ode,dropdown:Tde,fileInput:Pde,floatingLabel:Rde,footer:Mde,helperText:Dde,kbd:$de,label:Ide,listGroup:Fde,list:Lde,modal:zde,navbar:Bde,pagination:Ude,popover:qde,progress:Hde,radio:Kde,rangeSlider:Vde,rating:Gde,ratingAdvanced:Wde,select:Yde,textInput:tfe,textarea:efe,toggleSwitch:afe,sidebar:Xde,spinner:Qde,table:Zde,tabs:Jde,timeline:nfe,toast:rfe,tooltip:sfe},ofe={theme:zm(ife)};function Ge(){return zm(ofe.theme)}const hq=v.createContext(void 0);function pq(){const e=v.useContext(hq);if(!e)throw new Error("useAccordionContext should be used within the AccordionPanelContext provider!");return e}const mq=({children:e,className:t,theme:n={},...r})=>{const{isOpen:a}=pq(),s=Ne(Ge().accordion.content,n);return i.jsx("div",{className:ce(s.base,t),"data-testid":"flowbite-accordion-content",hidden:!a,...r,children:e})},gq=({children:e,...t})=>{const{alwaysOpen:n}=t,[r,a]=v.useState(t.isOpen),s=n?{...t,isOpen:r,setOpen:()=>a(!r)}:t;return i.jsx(hq.Provider,{value:s,children:e})},xq=({as:e="h2",children:t,className:n,theme:r={},...a})=>{const{arrowIcon:s,flush:o,isOpen:l,setOpen:u}=pq(),d=()=>typeof u<"u"&&u(),h=Ne(Ge().accordion.title,r);return i.jsxs("button",{className:ce(h.base,h.flush[o?"on":"off"],h.open[l?"on":"off"],n),onClick:d,type:"button",...a,children:[i.jsx(e,{className:h.heading,"data-testid":"flowbite-accordion-heading",children:t}),s&&i.jsx(s,{"aria-hidden":!0,className:ce(h.arrow.base,h.arrow.open[l?"on":"off"]),"data-testid":"flowbite-accordion-arrow"})]})},bq=({alwaysOpen:e=!1,arrowIcon:t=aq,children:n,flush:r=!1,collapseAll:a=!1,className:s,theme:o={},...l})=>{const[u,d]=v.useState(a?-1:0),h=v.useMemo(()=>v.Children.map(n,(g,x)=>v.cloneElement(g,{alwaysOpen:e,arrowIcon:t,flush:r,isOpen:u===x,setOpen:()=>d(u===x?-1:x)})),[e,t,n,r,u]),p=Ne(Ge().accordion.root,o);return i.jsx("div",{className:ce(p.base,p.flush[r?"on":"off"],s),"data-testid":"flowbite-accordion",...l,children:h})};bq.displayName="Accordion";gq.displayName="Accordion.Panel";
478xq.displayName="Accordion.Title";mq.displayName="Accordion.Content";Object.assign(bq,{Panel:gq,Title:xq,Content:mq});const Ay=({additionalContent:e,children:t,className:n,color:r="info",icon:a,onDismiss:s,rounded:o=!0,theme:l={},withBorderAccent:u,...d})=>{const h=Ne(Ge().alert,l);return i.jsxs("div",{className:ce(h.base,h.color[r],o&&h.rounded,u&&h.borderAccent,n),role:"alert",...d,children:[i.jsxs("div",{className:h.wrapper,"data-testid":"flowbite-alert-wrapper",children:[a&&i.jsx(a,{className:h.icon,"data-testid":"flowbite-alert-icon"}),i.jsx("div",{children:t}),typeof s=="function"&&i.jsx("button",{"aria-label":"Dismiss",className:ce(h.closeButton.base,h.closeButton.color[r]),onClick:s,type:"button",children:i.jsx(sq,{"aria-hidden":!0,className:h.closeButton.icon})})]}),e&&i.jsx("div",{children:e})]})};Ay.displayName="Alert";const yq=({children:e,className:t,theme:n={},...r})=>{const a=Ne(Ge().avatar.group,n);return i.jsx("div",{"data-testid":"avatar-group-element",className:ce(a.base,t),...r,children:e})};yq.displayName="Avatar.Group";const vq=({className:e,href:t,theme:n={},total:r,...a})=>{const s=Ne(Ge().avatar.groupCounter,n);return i.jsxs("a",{href:t,className:ce(s.base,e),...a,children:["+",r]})};vq.displayName="Avatar.GroupCounter";const wq=({alt:e="",bordered:t=!1,children:n,className:r,color:a="light",img:s,placeholderInitials:o="",rounded:l=!1,size:u="md",stacked:d=!1,status:h,statusPosition:p="top-left",theme:g={},...x})=>{const y=Ne(Ge().avatar,g),w=ce(y.root.img.base,t&&y.root.bordered,t&&y.root.color[a],l&&y.root.rounded,d&&y.root.stacked,y.root.img.on,y.root.size[u]),j={className:ce(w,y.root.img.on),"data-testid":"flowbite-avatar-img"};return i.jsxs("div",{className:ce(y.root.base,r),"data-testid":"flowbite-avatar",...x,children:[i.jsxs("div",{className:"relative",children:[s?typeof s=="string"?i.jsx("img",{alt:e,src:s,...j}):s({alt:e,...j}):o?i.jsx("div",{className:ce(y.root.img.off,y.root.initials.base,d&&y.root.stacked,t&&y.root.bordered,t&&y.root.color[a],y.root.size[u],l&&y.root.rounded),"data-testid":"flowbite-avatar-initials-placeholder",children:i.jsx("span",{className:ce(y.root.initials.text),"data-testid":"flowbite-avatar-initials-placeholder-text",children:o})}):i.jsx("div",{className:ce(w,y.root.img.off),"data-testid":"flowbite-avatar-img",children:i.jsx("svg",{className:y.root.img.placeholder,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})})}),h&&i.jsx("span",{"data-testid":"flowbite-avatar-status",className:ce(y.root.status.base,y.root.status[h],y.root.statusPosition[p])})]}),n&&i.jsx("div",{children:n})]})};wq.displayName="Avatar";Object.assign(wq,{Group:yq,Counter:vq});const jq=({children:e,color:t="info",href:n,icon:r,size:a="xs",className:s,theme:o={},...l})=>{const u=Ne(Ge().badge,o),d=()=>i.jsxs("span",{className:ce(u.root.base,u.root.color[t],u.root.size[a],u.icon[r?"on":"off"],s),"data-testid":"flowbite-badge",...l,children:[r&&i.jsx(r,{"aria-hidden":!0,className:u.icon.size[a],"data-testid":"flowbite-badge-icon"}),e&&i.jsx("span",{children:e})]});return n?i.jsx("a",{className:u.root.href,href:n,children:i.jsx(d,{})}):i.jsx(d,{})};jq.displayName="Badge";const Dt=({className:e,color:t="info",light:n,size:r="md",theme:a={},...s})=>{const o=Ne(Ge().spinner,a);return i.jsx("span",{role:"status",...s,children:i.jsxs("svg",{fill:"none",viewBox:"0 0 100 101",className:ce(o.base,o.color[t],o.light[n?"on":"off"].base,o.light[n?"on":"off"].color[t],o.size[r],e),children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.
4781071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})})};Dt.displayName="Spinner";const xO=v.forwardRef(({children:e,as:t,href:n,type:r="button",...a},s)=>{const o=t||(n?"a":"button");return v.createElement(o,{ref:s,href:n,type:r,...a},e)});xO.displayName="ButtonBaseComponent";const Nq=(e,t,n)=>v.Children.map(e,(r,a)=>v.isValidElement(r)?r.props.children?v.cloneElement(r,{...r.props,children:Nq(r.props.children,t,n),positionInGroup:q$(a,v.Children.count(e))}):v.cloneElement(r,{outline:t,pill:n,positionInGroup:q$(a,v.Children.count(e))}):r),q$=(e,t)=>e===0?"start":e===t-1?"end":"middle",_q=({children:e,className:t,outline:n,pill:r,theme:a={},...s})=>{const o=v.useMemo(()=>Nq(e,n,r),[e,n,r]),l=Ne(Ge().buttonGroup,a);return i.jsx("div",{className:ce(l.base,t),role:"group",...s,children:o})};_q.displayName="Button.Group";const kq=v.forwardRef(({children:e,className:t,color:n="info",disabled:r,fullSized:a,isProcessing:s=!1,processingLabel:o="Loading...",processingSpinner:l,gradientDuoTone:u,gradientMonochrome:d,label:h,outline:p=!1,pill:g=!1,positionInGroup:x="none",size:y="md",theme:w={},...j},N)=>{const{buttonGroup:k,button:S}=Ge(),E=Ne(S,w),O=j;return i.jsx(xO,{ref:N,disabled:r,className:ce(E.base,r&&E.disabled,!u&&!d&&E.color[n],u&&!d&&E.gradientDuoTone[u],!u&&d&&E.gradient[d],p&&(E.outline.color[n]??E.outline.color.default),E.pill[g?"on":"off"],a&&E.fullSized,k.position[x],t),...O,children:i.jsx("span",{className:ce(E.inner.base,E.outline[p?"on":"off"],E.outline.pill[p&&g?"on":"off"],E.size[y],p&&!E.outline.color[n]&&E.inner.outline,s&&E.isProcessing,s&&E.inner.isProcessingPadding[y],E.inner.position[x]),children:i.jsxs(i.Fragment,{children:[s&&i.jsx("span",{className:ce(E.spinnerSlot,E.spinnerLeftPosition[y]),children:l||i.jsx(Dt,{size:y})}),typeof e<"u"?e:i.jsx("span",{"data-testid":"flowbite-button-label",className:ce(E.label),children:s?o:h})]})})})});kq.displayName="Button";const mt=Object.assign(kq,{Group:_q}),Sq=({children:e,...t})=>{const n=r=>{r.target.closest('[role="banner"]')?.remove()};return i.jsx(mt,{onClick:n,...t,children:e})};Sq.displayName="Banner.CollapseButton";const Cq=({children:e,...t})=>i.jsx("div",{"data-testid":"flowbite-banner",role:"banner",tabIndex:-1,...t,children:e});Cq.displayName="Banner";Object.assign(Cq,{CollapseButton:Sq});const Eq=v.forwardRef(({children:e,className:t,href:n,icon:r,theme:a={},...s},o)=>{const l=typeof n<"u",u=l?"a":"span",d=Ne(Ge().breadcrumb.item,a);return i.jsxs("li",{className:ce(d.base,t),...s,children:[i.jsx(oq,{"aria-hidden":!0,className:d.chevron,"data-testid":"flowbite-breadcrumb-separator"}),i.jsxs(u,{ref:o,className:d.href[l?"on":"off"],"data-testid":"flowbite-breadcrumb-item",href:n,children:[r&&i.jsx(r,{"aria-hidden":!0,className:d.icon}),e]})]})});Eq.displayName="Breadcrumb.Item";const Oq=({children:e,className:t,theme:n={},...r})=>{const a=Ne(Ge().breadcrumb.root,n);return i.jsx("nav",{"aria-label":"Breadcrumb",className:ce(a.base,t),...r,children:i.jsx("ol",{className:a.list,children:e})})};Oq.displayName="Breadcrumb";Object.assign(Oq,{Item:Eq});const lfe=e=>t=>{const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n},$b=e=>{const{children:t,className:n,horizontal:r,href:a,theme:s={}}=e,o=typeof a>"u"?"div":"a",l=ufe(e),u=Ne(Ge().card,s);return i.jsxs(o,{"data-testid":"flowbite-card",href:a,className:ce(u.root.base,u.root.horizontal[r?"on":"off"],a&&u.root.href,n),...l,children:[i.jsx(cfe,{...e}),i.jsx("div",{className:u.root.children,children:t})]})},cfe=({theme:e={},...t})=>{const n=Ne(Ge().card,e);return t.renderImage?t.renderImage(n,t.horizontal??!1):t.imgSrc?i.jsx("img",{"data-testid":"flowbite-card-image",alt:t.imgAlt??"",src:t.imgSrc,className:ce(n.img.base,n.img.horizontal[t.horizontal?"on":"off"])}):null},ufe=lfe(["renderImage","imgSrc","imgAlt","children","className","horizontal","href","theme"]);var X_={exports:{}};/*! 479 Copyright (c) 2018 Jed Watson. 480 Licensed under the MIT License (MIT), see 481 http://jedwatson.github.io/classnames 482*/var H$;function dfe(){return H$||(H$=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var l=arguments[o];l&&(s=a(s,r(l)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var l in s)t.call(s,l)&&s[l]&&(o=a(o,l));return o}function a(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n}
482)()}(X_)),X_.exports}var ffe=dfe();const K$=ka(ffe),Nm=v.forwardRef(({className:e,color:t="default",theme:n={},...r},a)=>{const s=Ne(Ge().checkbox,n);return i.jsx("input",{ref:a,type:"checkbox",className:ce(s.root.base,s.root.color[t],e),...r})});Nm.displayName="Checkbox";const _g=({children:e,className:t,color:n="default",theme:r={},value:a,...s})=>{const o=Ne(Ge().helperText,r);return i.jsx("p",{className:ce(o.root.base,o.root.colors[n],t),...s,children:a??e??""})};_g.displayName="HelperText";const bO=v.forwardRef(({addon:e,className:t,color:n="gray",helperText:r,icon:a,rightIcon:s,shadow:o,sizing:l="md",theme:u={},type:d="text",...h},p)=>{const g=Ne(Ge().textInput,u);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:ce(g.base,t),children:[e&&i.jsx("span",{className:g.addon,children:e}),i.jsxs("div",{className:g.field.base,children:[a&&i.jsx("div",{className:g.field.icon.base,children:i.jsx(a,{className:g.field.icon.svg})}),s&&i.jsx("div",{"data-testid":"right-icon",className:g.field.rightIcon.base,children:i.jsx(s,{className:g.field.rightIcon.svg})}),i.jsx("input",{className:ce(g.field.input.base,g.field.input.colors[n],g.field.input.sizes[l],g.field.input.withIcon[a?"on":"off"],g.field.input.withRightIcon[s?"on":"off"],g.field.input.withAddon[e?"on":"off"],g.field.input.withShadow[o?"on":"off"]),type:d,...h,ref:p})]})]}),r&&i.jsx(_g,{color:n,children:r})]})});bO.displayName="TextInput";const Aq=v.createContext(void 0);function s1(){const e=v.useContext(Aq);if(!e)throw new Error("useDatePickerContext should be used within the DatePickerContext provider!");return e}var nn;(function(e){e[e.Days=0]="Days",e[e.Months=1]="Months",e[e.Years=2]="Years",e[e.Decades=3]="Decades"})(nn||(nn={}));var zS;(function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"})(zS||(zS={}));const kg=(e,t,n)=>{const r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();if(t&&n){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),s=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime();return r>=a&&r<=s}if(t){const a=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r>=a}if(n){const a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime();return r<=a}return!0},i1=(e,t)=>(e=new Date(e.getFullYear(),e.getMonth(),e.getDate()),t=new Date(t.getFullYear(),t.getMonth(),t.getDate()),e.getTime()===t.getTime()),hfe=(e,t,n)=>(kg(e,t,n)||(t&&e<t?e=t:n&&e>n&&(e=n)),e),pfe=(e,t)=>{const n=new Date(e.getFullYear(),e.getMonth(),1);let a=n.getDay()-t;return a<0&&(a+=7),yO(n,-a)},mfe=(e,t)=>{const n=[],r=new Date(0);r.setDate(r.getDate()-r.getDay()+t);const a=new Intl.DateTimeFormat(e,{weekday:"short"});for(let s=0;s<7;s++)n.push(a.format(yO(r,s)));return n},yO=(e,t)=>
482{const n=new Date(e);return n.setDate(n.getDate()+t),n},gfe=(e,t)=>{const n=new Date(e);return n.setMonth(n.getMonth()+t),n},hf=(e,t)=>{const n=new Date(e);return n.setFullYear(n.getFullYear()+t),n},_m=(e,t,n)=>{let r={day:"numeric",month:"long",year:"numeric"};return n&&(r=n),new Intl.DateTimeFormat(e,r).format(t)},pf=(e,t)=>{const n=e.getFullYear();return Math.floor(n/t)*t},xfe=(e,t)=>{const n=e.getFullYear(),r=t+9;return n>=t&&n<=r},bfe=({theme:e={}})=>{const{theme:t,weekStart:n,minDate:r,maxDate:a,viewDate:s,selectedDate:o,changeSelectedDate:l,language:u}=s1(),d=Ne(t.views.days,e),h=mfe(u,n),p=pfe(s,n);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:d.header.base,children:h.map((g,x)=>i.jsx("span",{className:d.header.title,children:g},x))}),i.jsx("div",{className:d.items.base,children:[...Array(42)].map((g,x)=>{const y=yO(p,x),w=_m(u,y,{day:"numeric"}),j=i1(o,y),N=!kg(y,r,a);return i.jsx("button",{disabled:N,type:"button",className:ce(d.items.item.base,j&&d.items.item.selected,N&&d.items.item.disabled),onClick:()=>{N||l(y,!0)},children:w},x)})})]})},yfe=({theme:e={}})=>{const{theme:t,selectedDate:n,viewDate:r,setViewDate:a,setView:s}=s1(),o=Ne(t.views.decades,e);return i.jsx("div",{className:o.items.base,children:[...Array(12)].map((l,u)=>{const h=pf(r,100)-10+u*10,p=new Date(h,0,1),g=hf(p,9),x=xfe(r,h),y=!kg(r,p,g);return i.jsx("button",{disabled:y,type:"button",className:ce(o.items.item.base,x&&o.items.item.selected,y&&o.items.item.disabled),onClick:()=>{y||(a(hf(r,h-n.getFullYear())),s(nn.Years))},children:h},u)})})},vfe=({theme:e={}})=>{const{theme:t,minDate:n,maxDate:r,selectedDate:a,viewDate:s,language:o,setViewDate:l,setView:u}=s1(),d=Ne(t.views.months,e);return i.jsx("div",{className:d.items.base,children:[...Array(12)].map((h,p)=>{const g=new Date(s.getTime());g.setMonth(p);const x=_m(o,g,{month:"short"}),y=i1(a,g),w=!kg(g,n,r);return i.jsx("button",{disabled:w,type:"button",className:ce(d.items.item.base,y&&d.items.item.selected,w&&d.items.item.disabled),onClick:()=>{w||(l(g),u(nn.Days))},children:x},p)})})},wfe=({theme:e={}})=>{const{theme:t,selectedDate:n,minDate:r,maxDate:a,viewDate:s,setViewDate:o,setView:l}=s1(),u=Ne(t.views.years,e);return i.jsx("div",{className:u.items.base,children:[...Array(12)].map((d,h)=>{const g=pf(s,10)-1+h*1,x=new Date(s.getTime());x.setFullYear(g);const y=i1(n,x),w=!kg(x,r,a);return i.jsx("button",{disabled:w,type:"button",className:ce(u.items.item.base,y&&u.items.item.selected,w&&u.items.item.disabled),onClick:()=>{w||(o(x),l(nn.Months))},children:g},h)})})},jfe=({title:e,open:t,inline:n=!1,autoHide:r=!0,showClearButton:a=!0,labelClearButton:s="Clear",showTodayButton:o=!0,labelTodayButton:l="Today",defaultDate:u=new Date,minDate:d,maxDate:h,language:p="en",weekStart:g=zS.Sunday,className:x,theme:y={},onSelectedDateChanged:w,...j},N)=>{const k=Ne(Ge().datepicker,y);u=hfe(u,d,h);const[S,E]=v.useState(t),[O,T]=v.useState(nn.Days),[P,M]=v.useState(u),[D,A]=v.useState(u),L=v.useRef(null),F=v.useRef(null),B=(W,I)=>{M(W),w&&w(W),r&&O===nn.Days&&I==!0&&!n&&E(!1)},U=()=>{B(u,!0),u&&A(u)};v.useImperativeHandle(N,()=>({focus(){L.current?.focus()},clear(){U()}}));const z=W=>{switch(W){case nn.Decades:return i.jsx(yfe,{theme:k.views.decades});case nn.Years:return i.jsx(wfe,{theme:k.views.years});case nn.Months:return i.jsx(vfe,{theme:k.views.months});case nn.Days:default:return i.jsx(bfe,{theme:k.views.days})}},$=()=>{switch(O){case nn.Days:return nn.Months;case nn.Months:return nn.Years;case nn.Years:return nn.Decades}return O},K=()=>{switch(O){case nn.Decades:return`${pf(D,100)} - ${pf(D,100)+90}`;case nn.Years:return`${pf(D,10)} - ${pf(D,10)+9}`;case nn.Months:return _m(p,D,{year:"numeric"});case nn.Days:default:return _m(p,D,{month:"long",year:"numeric"})}},G=(W,I,H)=>{switch(W){case nn.Days:return new Date(gfe(I,H));case nn.Months:return new Date(hf(I,H));case nn.Years:return new Date(hf(I,H*10));case nn.Decades:return new Date(hf(I,H*100));default:return new Date(hf(I,H*10))}};return v.useEffect(()=>{const W=I=>{const H=F?.current?.contains(I.target),V=L?.current?.contains(I.target);!H&&!V&&E(!1)};return document.addEventListener("mousedown",W),()=>{document.removeEventListener("mousedown",W)}},[L,F,E]),i.jsx(Aq.Provider,{value:{theme:k,language:p,minDate:d,maxDate:h,weekStart:g,isOpen:S,setIsOpen:E,view:O,setView:T,viewDate:D,setVie
482wDate:A,selectedDate:P,setSelectedDate:M,changeSelectedDate:B},children:i.jsxs("div",{className:ce(k.root.base,x),children:[!n&&i.jsx(bO,{theme:k.root.input,icon:Mue,ref:L,onFocus:()=>{i1(D,P)||A(P),E(!0)},value:P&&_m(p,P),readOnly:!0,...j}),(S||n)&&i.jsx("div",{ref:F,className:ce(k.popup.root.base,n&&k.popup.root.inline),children:i.jsxs("div",{className:k.popup.root.inner,children:[i.jsxs("div",{className:k.popup.header.base,children:[e&&i.jsx("div",{className:k.popup.header.title,children:e}),i.jsxs("div",{className:k.popup.header.selectors.base,children:[i.jsx("button",{type:"button",className:ce(k.popup.header.selectors.button.base,k.popup.header.selectors.button.prev),onClick:()=>A(G(O,D,-1)),children:i.jsx(Pue,{})}),i.jsx("button",{type:"button",className:ce(k.popup.header.selectors.button.base,k.popup.header.selectors.button.view),onClick:()=>T($()),children:K()}),i.jsx("button",{type:"button",className:ce(k.popup.header.selectors.button.base,k.popup.header.selectors.button.next),onClick:()=>A(G(O,D,1)),children:i.jsx(Rue,{})})]})]}),i.jsx("div",{className:k.popup.view.base,children:z(O)}),(a||o)&&i.jsxs("div",{className:k.popup.footer.base,children:[o&&i.jsx("button",{type:"button",className:ce(k.popup.footer.button.base,k.popup.footer.button.today),onClick:()=>{const W=new Date;B(W,!0),A(W)},children:l}),a&&i.jsx("button",{type:"button",className:ce(k.popup.footer.button.base,k.popup.footer.button.clear),onClick:()=>{B(u,!0),u&&A(u)},children:s})]})]})})]})})},Nfe=v.forwardRef(jfe);Nfe.displayName="Datepicker";function o1(){return typeof window<"u"}function Bu(e){return Tq(e)?(e.nodeName||"").toLowerCase():"#document"}function xa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bi(e){var t;return(t=(Tq(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tq(e){return o1()?e instanceof Node||e instanceof xa(e).Node:!1}function zt(e){return o1()?e instanceof Element||e instanceof xa(e).Element:!1}function Tr(e){return o1()?e instanceof HTMLElement||e instanceof xa(e).HTMLElement:!1}function BS(e){return!o1()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xa(e).ShadowRoot}const _fe=new Set(["inline","contents"]);function Sg(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ss(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!_fe.has(a)}const kfe=new Set(["table","td","th"]);function Sfe(e){return kfe.has(Bu(e))}const Cfe=[":popover-open",":modal"];function l1(e){return Cfe.some(t=>{try{return e.matches(t)}catch{return!1}})}const Efe=["transform","translate","scale","rotate","perspective"],Ofe=["transform","translate","scale","rotate","perspective","filter"],Afe=["paint","layout","strict","content"];function vO(e){const t=wO(),n=zt(e)?Ss(e):e;return Efe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Ofe.some(r=>(n.willChange||"").includes(r))||Afe.some(r=>(n.contain||"").includes(r))}function Tfe(e){let t=Ao(e);for(;Tr(t)&&!Wl(t);){if(vO(t))return t;if(l1(t))return null;t=Ao(t)}return null}function wO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Pfe=new Set(["html","body","#document"]);function Wl(e){return Pfe.has(Bu(e))}function Ss(e){return xa(e).getComputedStyle(e)}function c1(e){return zt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ao(e){if(Bu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||BS(e)&&e.host||Bi(e);return BS(t)?t.host:t}function Pq(e){const t=Ao(e);return Wl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tr(t)&&Sg(t)?t:Pq(t)}function Hl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=Pq(e),s=a===((r=e.ownerDocument)==null?void 0:r.body),o=xa(a);if(s){const l=US(o);return t.concat(o,o.visualViewport||[],Sg(a)?a:[],l&&n?Hl(l):[])}return t.concat(a,Hl(a,[],n))}function US(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yi(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Kn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;
482if(n&&BS(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function jO(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Rq(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Mq(e){return e.mozInputSource===0&&e.isTrusted?!0:qS()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function NO(e){return Rfe()?!1:!qS()&&e.width===0&&e.height===0||qS()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function _O(){return/apple/i.test(navigator.vendor)}function qS(){const e=/android/i;return e.test(jO())||e.test(Rq())}function Dq(){return jO().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Rfe(){return Rq().includes("jsdom/")}function Ty(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Mfe(e){return"nativeEvent"in e}function Dfe(e){return e.matches("html,body")}function Zr(e){return e?.ownerDocument||document}function Q_(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Pl(e){return"composedPath"in e?e.composedPath()[0]:e.target}const $fe="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function kO(e){return Tr(e)&&e.matches($fe)}function Cr(e){e.preventDefault(),e.stopPropagation()}function $q(e){return e?e.getAttribute("role")==="combobox"&&kO(e):!1}const Ife=["top","right","bottom","left"],V$=["start","end"],G$=Ife.reduce((e,t)=>e.concat(t,t+"-"+V$[0],t+"-"+V$[1]),[]),Lf=Math.min,lu=Math.max,Py=Math.round,mf=Math.floor,Ci=e=>({x:e,y:e}),Lfe={left:"right",right:"left",bottom:"top",top:"bottom"},Ffe={start:"end",end:"start"};function HS(e,t,n){return lu(e,Lf(t,n))}function fh(e,t){return typeof e=="function"?e(t):e}function To(e){return e.split("-")[0]}function Ei(e){return e.split("-")[1]}function Iq(e){return e==="x"?"y":"x"}function SO(e){return e==="y"?"height":"width"}const zfe=new Set(["top","bottom"]);function Dl(e){return zfe.has(To(e))?"y":"x"}function CO(e){return Iq(Dl(e))}function Lq(e,t,n){n===void 0&&(n=!1);const r=Ei(e),a=CO(e),s=SO(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=My(o)),[o,My(o)]}function Bfe(e){const t=My(e);return[Ry(e),t,Ry(t)]}function Ry(e){return e.replace(/start|end/g,t=>Ffe[t])}const W$=["left","right"],Y$=["right","left"],Ufe=["top","bottom"],qfe=["bottom","top"];function Hfe(e,t,n){switch(e){case"top":case"bottom":return n?t?Y$:W$:t?W$:Y$;case"left":case"right":return t?Ufe:qfe;default:return[]}}function Kfe(e,t,n,r){const a=Ei(e);let s=Hfe(To(e),n==="start",r);return a&&(s=s.map(o=>o+"-"+a),t&&(s=s.concat(s.map(Ry)))),s}function My(e){return e.replace(/left|right|bottom|top/g,t=>Lfe[t])}function Vfe(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fq(e){return typeof e!="number"?Vfe(e):{top:e,right:e,bottom:e,left:e}}function Dy(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function X$(e,t,n){let{reference:r,floating:a}=e;const s=Dl(t),o=CO(t),l=SO(o),u=To(t),d=s==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,g=r[l]/2-a[l]/2;let x;switch(u){case"top":x={x:h,y:r.y-a.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-a.width,y:p};break;default:x={x:r.x,y:r.y}}switch(Ei(t)){case"start":x[o]-=g*(n&&d?-1:1);break;case"end":x[o]+=g*(n&&d?-1:1);break}return x}const Gfe=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:o}=n,l=s.filter(Boolean),u=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=X$(d,r,u),g=r,x={},y=0;for(let w=0;w<l.length;w++){const{name:j,fn:N}=l[w],{x:k,y:S,data:E,reset:O}=await N({x:h,y:p,initialPlacement:r,placement:g,strategy:a,middlewareData:x,rects:d,platform:o,elements:{reference:e,floating:t}});h=k??h,p=S??p,x={...x,[j]:{...x[j],...E}},O&&y<=50&&(y++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(d=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):O.rects),{x:h,y:p}=X$(d,g,u)),w=-1)}return{x:h,y:p,placement:g,strategy:a,middlewareData:x}};async function EO(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:s,rects:o,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:x=0}=fh(t,e),y=Fq(x),j=l[g?p==="floating"?"reference":"floating":p],N=Dy(await s.getClippingRect
vendor: 4,502 bytes, line 482
482({element:(n=await(s.isElement==null?void 0:s.isElement(j)))==null||n?j:j.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:u})),k=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),E=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},O=Dy(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:S,strategy:u}):k);return{top:(N.top-O.top+y.top)/E.y,bottom:(O.bottom-N.bottom+y.bottom)/E.y,left:(N.left-O.left+y.left)/E.x,right:(O.right-N.right+y.right)/E.x}}const Wfe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:s,platform:o,elements:l,middlewareData:u}=t,{element:d,padding:h=0}=fh(e,t)||{};if(d==null)return{};const p=Fq(h),g={x:n,y:r},x=CO(a),y=SO(x),w=await o.getDimensions(d),j=x==="y",N=j?"top":"left",k=j?"bottom":"right",S=j?"clientHeight":"clientWidth",E=s.reference[y]+s.reference[x]-g[x]-s.floating[y],O=g[x]-s.reference[x],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let P=T?T[S]:0;(!P||!await(o.isElement==null?void 0:o.isElement(T)))&&(P=l.floating[S]||s.floating[y]);const M=E/2-O/2,D=P/2-w[y]/2-1,A=Lf(p[N],D),L=Lf(p[k],D),F=A,B=P-w[y]-L,U=P/2-w[y]/2+M,z=HS(F,U,B),$=!u.arrow&&Ei(a)!=null&&U!==z&&s.reference[y]/2-(U<F?A:L)-w[y]/2<0,K=$?U<F?U-F:U-B:0;return{[x]:g[x]+K,data:{[x]:z,centerOffset:U-z-K,...$&&{alignmentOffset:K}},reset:$}}});function Yfe(e,t,n){return(e?[...n.filter(a=>Ei(a)===e),...n.filter(a=>Ei(a)!==e)]:n.filter(a=>To(a)===a)).filter(a=>e?Ei(a)===e||(t?Ry(a)!==a:!1):!0)}const Xfe=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,a;const{rects:s,middlewareData:o,placement:l,platform:u,elements:d}=t,{crossAxis:h=!1,alignment:p,allowedPlacements:g=G$,autoAlignment:x=!0,...y}=fh(e,t),w=p!==void 0||g===G$?Yfe(p||null,x,g):g,j=await EO(t,y),N=((n=o.autoPlacement)==null?void 0:n.index)||0,k=w[N];if(k==null)return{};const S=Lq(k,s,await(u.isRTL==null?void 0:u.isRTL(d.floating)));if(l!==k)return{reset:{placement:w[0]}};const E=[j[To(k)],j[S[0]],j[S[1]]],O=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:k,overflows:E}],T=w[N+1];if(T)return{data:{index:N+1,overflows:O},reset:{placement:T}};const P=O.map(A=>{const L=Ei(A.placement);return[A.placement,L&&h?A.overflows.slice(0,2).reduce((F,B)=>F+B,0):A.overflows[0],A.overflows]}).sort((A,L)=>A[1]-L[1]),D=((a=P.filter(A=>A[2].slice(0,Ei(A[0])?2:3).every(L=>L<=0))[0])==null?void 0:a[0])||P[0][0];return D!==l?{data:{index:N+1,overflows:O},reset:{placement:D}}:{}}}},Qfe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:s,rects:o,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:w=!0,...j}=fh(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const N=To(a),k=Dl(l),S=To(l)===l,E=await(u.isRTL==null?void 0:u.isRTL(d.floating)),O=g||(S||!w?[My(l)]:Bfe(l)),T=y!=="none";!g&&T&&O.push(...Kfe(l,w,y,E));const P=[l,...O],M=await EO(t,j),D=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&D.push(M[N]),p){const U=Lq(a,o,E);D.push(M[U[0]],M[U[1]])}if(A=[...A,{placement:a,overflows:D}],!D.every(U=>U<=0)){var L,F;const U=(((L=s.flip)==null?void 0:L.index)||0)+1,z=P[U];if(z&&(!(p==="alignment"?k!==Dl(z):!1)||A.every(G=>G.overflows[0]>0&&Dl(G.placement)===k)))return{data:{index:U,overflows:A},reset:{placement:z}};let $=(F=A.filter(K=>K.overflows[0]<=0).sort((K,G)=>K.overflows[1]-G.overflows[1])[0])==null?void 0:F.placement;if(!$)switch(x){case"bestFit":{var B;const K=(B=A.filter(G=>{if(T){const W=Dl(G.placement);return W===k||W==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(W=>W>0).reduce((W,I)=>W+I,0)]).sort((G,W)=>G[1]-W[1])[0])==null?void 0:B[0];K&&($=K);break}case"initialPlacement":$=l;break}if(a!==$)return{reset:{placement:$}}}return{}}}},Zfe=new Set(["left","top"]);async function Jfe(e,t){const{placement:n,platform:r,elements:a}=e,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=To(n),l=Ei(n),u=Dl(n)==="y",d=Zfe.has(o)?-1:1,h=s&&u?-1:1,p=fh(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}
482:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof y=="number"&&(x=l==="end"?y*-1:y),u?{x:x*h,y:g*d}:{x:g*d,y:x*h}}const ehe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:s,placement:o,middlewareData:l}=t,u=await Jfe(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+u.x,y:s+u.y,data:{...u,placement:o}}}}},the=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:l={fn:j=>{let{x:N,y:k}=j;return{x:N,y:k}}},...u}=fh(e,t),d={x:n,y:r},h=await EO(t,u),p=Dl(To(a)),g=Iq(p);let x=d[g],y=d[p];if(s){const j=g==="y"?"top":"left",N=g==="y"?"bottom":"right",k=x+h[j],S=x-h[N];x=HS(k,x,S)}if(o){const j=p==="y"?"top":"left",N=p==="y"?"bottom":"right",k=y+h[j],S=y-h[N];y=HS(k,y,S)}const w=l.fn({...t,[g]:x,[p]:y});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[g]:s,[p]:o}}}}}};function zq(e){const t=Ss(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Tr(e),s=a?e.offsetWidth:n,o=a?e.offsetHeight:r,l=Py(n)!==s||Py(r)!==o;return l&&(n=s,r=o),{width:n,height:r,$:l}}function OO(e){return zt(e)?e:e.contextElement}function jf(e){const t=OO(e);if(!Tr(t))return Ci(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:s}=zq(t);let o=(s?Py(n.width):n.width)/r,l=(s?Py(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const nhe=Ci(0);function Bq(e){const t=xa(e);return!wO()||!t.visualViewport?nhe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rhe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xa(e)?!1:t}function ku(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=OO(e);let o=Ci(1);t&&(r?zt(r)&&(o=jf(r)):o=jf(e));const l=rhe(s,n,r)?Bq(s):Ci(0);let u=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,h=a.width/o.x,p=a.height/o.y;if(s){const g=xa(s),x=r&&zt(r)?xa(r):r;let y=g,w=US(y);for(;w&&r&&x!==y;){const j=jf(w),N=w.getBoundingClientRect(),k=Ss(w),S=N.left+(w.clientLeft+parseFloat(k.paddingLeft))*j.x,E=N.top+(w.clientTop+parseFloat(k.paddingTop))*j.y;u*=j.x,d*=j.y,h*=j.x,p*=j.y,u+=S,d+=E,y=xa(w),w=US(y)}}return Dy({width:h,height:p,x:u,y:d})}function AO(e,t){const n=c1(e).scrollLeft;return t?t.left+n:ku(Bi(e)).left+n}function Uq(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:AO(e,r)),s=r.top+t.scrollTop;return{x:a,y:s}}function ahe(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const s=a==="fixed",o=Bi(r),l=t?l1(t.floating):!1;if(r===o||l&&s)return n;let u={scrollLeft:0,scrollTop:0},d=Ci(1);const h=Ci(0),p=Tr(r);if((p||!p&&!s)&&((Bu(r)!=="body"||Sg(o))&&(u=c1(r)),Tr(r))){const x=ku(r);d=jf(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const g=o&&!p&&!s?Uq(o,u,!0):Ci(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function she(e){return Array.from(e.getClientRects())}function ihe(e){const t=Bi(e),n=c1(e),r=e.ownerDocument.body,a=lu(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=lu(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+AO(e);const l=-n.scrollTop;return Ss(r).direction==="rtl"&&(o+=lu(t.clientWidth,r.clientWidth)-a),{width:a,height:s,x:o,y:l}}function ohe(e,t){const n=xa(e),r=Bi(e),a=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,l=0,u=0;if(a){s=a.width,o=a.height;const d=wO();(!d||d&&t==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}return{width:s,height:o,x:l,y:u}}const lhe=new Set(["absolute","fixed"]);function che(e,t){const n=ku(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,s=Tr(e)?jf(e):Ci(1),o=e.clientWidth*s.x,l=e.clientHeight*s.y,u=a*s.x,d=r*s.y;return{width:o,height:l,x:u,y:d}}function Q$(e,t,n){let r;if(t==="viewport")r=ohe(e,n);else if(t==="document")r=ihe(Bi(e));else if(zt(t))r=che(t,n);else{const a=Bq(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Dy(r)}function qq(e,t){const n=Ao(e);return n===t||!zt(n)||Wl(n)?!1:Ss(n).position==="fixed"||qq(n,t)}function uhe(e,t){const n=t.get(e);if(n)return n;let r=Hl(e,[],!1).filter(l=>zt(l)&&Bu(l)!=="body"),a=null;const s=Ss(e).position==="fixed";let o=s?Ao(e):e;for(;
482zt(o)&&!Wl(o);){const l=Ss(o),u=vO(o);!u&&l.position==="fixed"&&(a=null),(s?!u&&!a:!u&&l.position==="static"&&!!a&&lhe.has(a.position)||Sg(o)&&!u&&qq(e,o))?r=r.filter(h=>h!==o):a=l,o=Ao(o)}return t.set(e,r),r}function dhe(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?l1(t)?[]:uhe(t,this._c):[].concat(n),r],l=o[0],u=o.reduce((d,h)=>{const p=Q$(t,h,a);return d.top=lu(p.top,d.top),d.right=Lf(p.right,d.right),d.bottom=Lf(p.bottom,d.bottom),d.left=lu(p.left,d.left),d},Q$(t,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function fhe(e){const{width:t,height:n}=zq(e);return{width:t,height:n}}function hhe(e,t,n){const r=Tr(t),a=Bi(t),s=n==="fixed",o=ku(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=Ci(0);function d(){u.x=AO(a)}if(r||!r&&!s)if((Bu(t)!=="body"||Sg(a))&&(l=c1(t)),r){const x=ku(t,!0,s,t);u.x=x.x+t.clientLeft,u.y=x.y+t.clientTop}else a&&d();s&&!r&&a&&d();const h=a&&!r&&!s?Uq(a,l):Ci(0),p=o.left+l.scrollLeft-u.x-h.x,g=o.top+l.scrollTop-u.y-h.y;return{x:p,y:g,width:o.width,height:o.height}}function Z_(e){return Ss(e).position==="static"}function Z$(e,t){if(!Tr(e)||Ss(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bi(e)===n&&(n=n.ownerDocument.body),n}function Hq(e,t){const n=xa(e);if(l1(e))return n;if(!Tr(e)){let a=Ao(e);for(;a&&!Wl(a);){if(zt(a)&&!Z_(a))return a;a=Ao(a)}return n}let r=Z$(e,t);for(;r&&Sfe(r)&&Z_(r);)r=Z$(r,t);return r&&Wl(r)&&Z_(r)&&!vO(r)?n:r||Tfe(e)||n}const phe=async function(e){const t=this.getOffsetParent||Hq,n=this.getDimensions,r=await n(e.floating);return{reference:hhe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mhe(e){return Ss(e).direction==="rtl"}const ghe={convertOffsetParentRelativeRectToViewportRelativeRect:ahe,getDocumentElement:Bi,getClippingRect:dhe,getOffsetParent:Hq,getElementRects:phe,getClientRects:she,getDimensions:fhe,getScale:jf,isElement:zt,isRTL:mhe};function Kq(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xhe(e,t){let n=null,r;const a=Bi(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:h,top:p,width:g,height:x}=d;if(l||t(),!g||!x)return;const y=mf(p),w=mf(a.clientWidth-(h+g)),j=mf(a.clientHeight-(p+x)),N=mf(h),S={rootMargin:-y+"px "+-w+"px "+-j+"px "+-N+"px",threshold:lu(0,Lf(1,u))||1};let E=!0;function O(T){const P=T[0].intersectionRatio;if(P!==u){if(!E)return o();P?o(!1,P):r=setTimeout(()=>{o(!1,1e-7)},1e3)}P===1&&!Kq(d,e.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(O,{...S,root:a.ownerDocument})}catch{n=new IntersectionObserver(O,S)}n.observe(e)}return o(!0),s}function Vq(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=OO(e),h=a||s?[...d?Hl(d):[],...Hl(t)]:[];h.forEach(N=>{a&&N.addEventListener("scroll",n,{passive:!0}),s&&N.addEventListener("resize",n)});const p=d&&l?xhe(d,n):null;let g=-1,x=null;o&&(x=new ResizeObserver(N=>{let[k]=N;k&&k.target===d&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var S;(S=x)==null||S.observe(t)})),n()}),d&&!u&&x.observe(d),x.observe(t));let y,w=u?ku(e):null;u&&j();function j(){const N=ku(e);w&&!Kq(w,N)&&n(),w=N,y=requestAnimationFrame(j)}return n(),()=>{var N;h.forEach(k=>{a&&k.removeEventListener("scroll",n),s&&k.removeEventListener("resize",n)}),p?.(),(N=x)==null||N.disconnect(),x=null,u&&cancelAnimationFrame(y)}}const bhe=ehe,yhe=Xfe,vhe=the,whe=Qfe,J$=Wfe,jhe=(e,t,n)=>{const r=new Map,a={platform:ghe,...n},s={...a.platform,_c:r};return Gfe(e,t,{...a,platform:s})};var Nhe=typeof document<"u",_he=function(){},q0=Nhe?v.useLayoutEffect:_he;function $y(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$y(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const s=a[r];if(!(s==="_owner"&&e.$$typeof)&&!$y(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Gq(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eI(e,t){const n=Gq(e);return Math.round(t*n)/n}function J_(e){const t=v.useRef(e);return q0(()=>{t.current=e}),t}function khe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[h,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=v.useState(r);$y(g,r)||x(r);const[y,w]=v.useState(null),[j,N]=v.useState(null),k=v.useCallback(G=>
vendor: 5,386 bytes, lines 482-485
482{G!==T.current&&(T.current=G,w(G))},[]),S=v.useCallback(G=>{G!==P.current&&(P.current=G,N(G))},[]),E=s||y,O=o||j,T=v.useRef(null),P=v.useRef(null),M=v.useRef(h),D=u!=null,A=J_(u),L=J_(a),F=J_(d),B=v.useCallback(()=>{if(!T.current||!P.current)return;const G={placement:t,strategy:n,middleware:g};L.current&&(G.platform=L.current),jhe(T.current,P.current,G).then(W=>{const I={...W,isPositioned:F.current!==!1};U.current&&!$y(M.current,I)&&(M.current=I,qE.flushSync(()=>{p(I)}))})},[g,t,n,L,F]);q0(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(G=>({...G,isPositioned:!1})))},[d]);const U=v.useRef(!1);q0(()=>(U.current=!0,()=>{U.current=!1}),[]),q0(()=>{if(E&&(T.current=E),O&&(P.current=O),E&&O){if(A.current)return A.current(E,O,B);B()}},[E,O,B,A,D]);const z=v.useMemo(()=>({reference:T,floating:P,setReference:k,setFloating:S}),[k,S]),$=v.useMemo(()=>({reference:E,floating:O}),[E,O]),K=v.useMemo(()=>{const G={position:n,left:0,top:0};if(!$.floating)return G;const W=eI($.floating,h.x),I=eI($.floating,h.y);return l?{...G,transform:"translate("+W+"px, "+I+"px)",...Gq($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:I}},[n,l,$.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:B,refs:z,elements:$,floatingStyles:K}),[h,B,z,$,K])}const She=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?J$({element:r.current,padding:a}).fn(n):{}:r?J$({element:r,padding:a}).fn(n):{}}}},Che=(e,t)=>({...bhe(e),options:[e,t]}),Ehe=(e,t)=>({...vhe(e),options:[e,t]}),Ohe=(e,t)=>({...whe(e),options:[e,t]}),Ahe=(e,t)=>({...yhe(e),options:[e,t]}),The=(e,t)=>({...She(e),options:[e,t]});/*! 483* tabbable 6.2.0 484* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE 485*/var Phe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Iy=Phe.join(","),Wq=typeof Element>"u",Ff=Wq?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ly=!Wq&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Fy=function e(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=a===""||a==="true",o=s||n&&t&&e(t.parentNode);return o},Rhe=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Mhe=function(t,n,r){if(Fy(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Iy));return n&&Ff.call(t,Iy)&&a.unshift(t),a=a.filter(r),a},Dhe=function e(t,n,r){for(var a=[],s=Array.from(t);s.length;){var o=s.shift();if(!Fy(o,!1))if(o.tagName==="SLOT"){var l=o.assignedElements(),u=l.length?l:o.children,d=e(u,!0,r);r.flatten?a.push.apply(a,d):a.push({scopeParent:o,candidates:d})}else{var h=Ff.call(o,Iy);h&&r.filter(o)&&(n||!t.includes(o))&&a.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),g=!Fy(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(p&&g){var x=e(p===!0?o.children:p.children,!0,r);r.flatten?a.push.apply(a,x):a.push({scopeParent:o,candidates:x})}else s.unshift.apply(s,o.children)}}return a},Yq=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Xq=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Rhe(t))&&!Yq(t)?0:t.tabIndex},$he=function(t,n){var r=Xq(t);return r<0&&n&&!Yq(t)?0:r},Ihe=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Qq=function(t){return t.tagName==="INPUT"},Lhe=function(t){return Qq(t)&&t.type==="hidden"},Fhe=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},zhe=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Bhe=function(t){if(!t.name)return!0;var n=t.form||Ly(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=zhe(a,t.form);return!s||s===t},Uhe=function(t){return Qq(t)&&t.type==="radio"},qhe=function(t){return Uhe(t)&&!Bhe(t)},Hhe=function(t){var n,r=t&&Ly(t),a=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,l,u;for(s=!!((o=a)!==null&&o!==void 0&&(l=o.ownerDocument)!==null&&l!==void 0&&l.contains(a)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&a;){var d,h,p;r=Ly(a),a=(d=r)===null||d===void 0?void 0:d.host,s=!!((h=a)!==null&&h!==void 0&&(p=h.ownerDocument)!==null&&p!==void 0&&p.contains(a))}}return s},tI=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0}
485,Khe=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Ff.call(t,"details>summary:first-of-type"),o=s?t.parentElement:t;if(Ff.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var l=t;t;){var u=t.parentElement,d=Ly(t);if(u&&!u.shadowRoot&&a(u)===!0)return tI(t);t.assignedSlot?t=t.assignedSlot:!u&&d!==t.ownerDocument?t=d.host:t=u}t=l}if(Hhe(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return tI(t);return!1},Vhe=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return Ff.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Ghe=function(t,n){return!(n.disabled||Fy(n)||Lhe(n)||Khe(n,t)||Fhe(n)||Vhe(n))},KS=function(t,n){return!(qhe(n)||Xq(n)<0||!Ghe(t,n))},Whe=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Yhe=function e(t){var n=[],r=[];return t.forEach(function(a,s){var o=!!a.scopeParent,l=o?a.scopeParent:a,u=$he(l,o),d=o?e(a.candidates):l;u===0?o?n.push.apply(n,d):n.push(l):r.push({documentOrder:s,tabIndex:u,item:a,isScope:o,content:d})}),r.sort(Ihe).reduce(function(a,s){return s.isScope?a.push.apply(a,s.content):a.push(s.content),a},[]).concat(n)},u1=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Dhe([t],n.includeContainer,{filter:KS.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Whe}):r=Mhe(t,n.includeContainer,KS.bind(null,n)),Yhe(r)},Xhe=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ff.call(t,Iy)===!1?!1:KS(n,t)};function Zq(e){return v.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Qhe=Pm.useInsertionEffect,Zhe=Qhe||(e=>e());function vi(e){const t=v.useRef(()=>{});return Zhe(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}const TO="ArrowUp",Cg="ArrowDown",zf="ArrowLeft",hh="ArrowRight";function Ib(e,t,n){return Math.floor(e/t)!==n}function km(e,t){return t<0||t>=e.current.length}function ek(e,t){return zr(e,{disabledIndices:t})}function nI(e,t){return zr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function zr(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:a,amount:s=1}=t===void 0?{}:t;const o=e.current,l=a?d=>a.includes(d):d=>{const h=o[d];return h==null||h.hasAttribute("disabled")||h.getAttribute("aria-disabled")==="true"};let u=n;do u+=r?-s:s;while(u>=0&&u<=o.length-1&&l(u));return u}function Jhe(e,t){let{event:n,orientation:r,loop:a,cols:s,disabledIndices:o,minIndex:l,maxIndex:u,prevIndex:d,stopEvent:h=!1}=t,p=d;if(n.key===TO){if(h&&Cr(n),d===-1)p=u;else if(p=zr(e,{startingIndex:p,amount:s,decrement:!0,disabledIndices:o}),a&&(d-s<l||p<0)){const g=d%s,x=u%s,y=u-(x-g);x===g?p=u:p=x>g?y:y-s}km(e,p)&&(p=d)}if(n.key===Cg&&(h&&Cr(n),d===-1?p=l:(p=zr(e,{startingIndex:d,amount:s,disabledIndices:o}),a&&d+s>u&&(p=zr(e,{startingIndex:d%s-s,amount:s,disabledIndices:o}))),km(e,p)&&(p=d)),r==="both"){const g=mf(d/s);n.key===hh&&(h&&Cr(n),d%s!==s-1?(p=zr(e,{startingIndex:d,disabledIndices:o}),a&&Ib(p,s,g)&&(p=zr(e,{startingIndex:d-d%s-1,disabledIndices:o}))):a&&(p=zr(e,{startingIndex:d-d%s-1,disabledIndices:o})),Ib(p,s,g)&&(p=d)),n.key===zf&&(h&&Cr(n),d%s!==0?(p=zr(e,{startingIndex:d,disabledIndices:o,decrement:!0}),a&&Ib(p,s,g)&&(p=zr(e,{startingIndex:d+(s-d%s),decrement:!0,disabledIndices:o}))):a&&(p=zr(e,{startingIndex:d+(s-d%s),decrement:!0,disabledIndices:o})),Ib(p,s,g)&&(p=d));const x=mf(u/s)===g;km(e,p)&&(a&&x?p=n.key===zf?u:zr(e,{startingIndex:d-d%s-1,disabledIndices:o}):p=d)}return p}function epe(e,t,n){const r=[];let a=0;return e.forEach((s,o)=>{let{width:l,height:u}=s,d=!1;for(n&&(a=0);!d;){const h=[];for(let p=0;p<l;p++)for(let g=0;g<u;
485g++)h.push(a+p+g*t);a%t+l<=t&&h.every(p=>r[p]==null)?(h.forEach(p=>{r[p]=o}),d=!0):a++}}),[...r]}function tpe(e,t,n,r,a){if(e===-1)return-1;const s=n.indexOf(e);switch(a){case"tl":return s;case"tr":return s+t[e].width-1;case"bl":return s+(t[e].height-1)*r;case"br":return n.lastIndexOf(e)}}function npe(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}let rI=0;function go(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(rI);const s=()=>e?.focus({preventScroll:n});a?s():rI=requestAnimationFrame(s)}var Xt=typeof document<"u"?v.useLayoutEffect:v.useEffect;function rpe(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function ape(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}const Jq=v.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function spe(e){let{children:t,elementsRef:n,labelsRef:r}=e;const[a,s]=v.useState(()=>new Map),o=v.useCallback(u=>{s(d=>new Map(d).set(u,null))},[]),l=v.useCallback(u=>{s(d=>{const h=new Map(d);return h.delete(u),h})},[]);return Xt(()=>{const u=new Map(a);Array.from(u.keys()).sort(rpe).forEach((h,p)=>{u.set(h,p)}),ape(a,u)||s(u)},[a]),v.createElement(Jq.Provider,{value:v.useMemo(()=>({register:o,unregister:l,map:a,elementsRef:n,labelsRef:r}),[o,l,a,n,r])},t)}function ipe(e){let{label:t}=e===void 0?{}:e;const[n,r]=v.useState(null),a=v.useRef(null),{register:s,unregister:o,map:l,elementsRef:u,labelsRef:d}=v.useContext(Jq),h=v.useCallback(p=>{if(a.current=p,n!==null&&(u.current[n]=p,d)){var g;const x=t!==void 0;d.current[n]=x?t:(g=p?.textContent)!=null?g:null}},[n,u,d,t]);return Xt(()=>{const p=a.current;if(p)return s(p),()=>{o(p)}},[s,o]),Xt(()=>{const p=a.current?l.get(a.current):null;p!=null&&r(p)},[l]),v.useMemo(()=>({ref:h,index:n??-1}),[n,h])}function Bm(){return Bm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bm.apply(this,arguments)}let tk=!1,ope=0;const aI=()=>"floating-ui-"+ope++;function lpe(){const[e,t]=v.useState(()=>tk?aI():void 0);return Xt(()=>{e==null&&t(aI())},[]),v.useEffect(()=>{tk||(tk=!0)},[]),e}const cpe=Pm.useId,d1=cpe||lpe;function upe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(a=>a!==n))||[])}}}const dpe=v.createContext(null),fpe=v.createContext(null),f1=()=>{var e;return((e=v.useContext(dpe))==null?void 0:e.id)||null},Eg=()=>v.useContext(fpe);function Su(e){return"data-floating-ui-"+e}function Oi(e){const t=v.useRef(e);return Xt(()=>{t.current=e}),t}const sI=Su("safe-polygon");function nk(e,t,n){return n&&!Ty(n)?0:typeof e=="number"?e:e?.[t]}function hpe(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,events:s,elements:{domReference:o,floating:l},refs:u}=e,{enabled:d=!0,delay:h=0,handleClose:p=null,mouseOnly:g=!1,restMs:x=0,move:y=!0}=t,w=Eg(),j=f1(),N=Oi(p),k=Oi(h),S=v.useRef(),E=v.useRef(),O=v.useRef(),T=v.useRef(),P=v.useRef(!0),M=v.useRef(!1),D=v.useRef(()=>{}),A=v.useCallback(()=>{var U;const z=(U=a.current.openEvent)==null?void 0:U.type;return z?.includes("mouse")&&z!=="mousedown"},[a]);v.useEffect(()=>{if(!d)return;function U(z){let{open:$}=z;$||(clearTimeout(E.current),clearTimeout(T.current),P.current=!0)}return s.on("openchange",U),()=>{s.off("openchange",U)}},[d,s]),v.useEffect(()=>{if(!d||!N.current||!n)return;function U($){A()&&r(!1,$,"hover")}const z=Zr(l).documentElement;return z.addEventListener("mouseleave",U),()=>{z.removeEventListener("mouseleave",U)}},[l,n,r,d,N,A]);const L=v.useCallback(function(U,z,$){z===void 0&&(z=!0),$===void 0&&($="hover");const K=nk(k.current,"close",S.current);K&&!O.current?(clearTimeout(E.current),E.current=setTimeout(()=>r(!1,U,$),K)):z&&(clearTimeout(E.current),r(!1,U,$))},[k,r]),F=v.useCallback(()=>{D.current(),O.current=void 0},[]),B=v.useCallback(()=>
485{if(M.current){const U=Zr(u.floating.current).body;U.style.pointerEvents="",U.removeAttribute(sI),M.current=!1}},[u]);return v.useEffect(()=>{if(!d)return;function U(){return a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1}function z(G){if(clearTimeout(E.current),P.current=!1,g&&!Ty(S.current)||x>0&&nk(k.current,"open")===0)return;const W=nk(k.current,"open",S.current);W?E.current=setTimeout(()=>{r(!0,G,"hover")},W):r(!0,G,"hover")}function $(G){if(U())return;D.current();const W=Zr(l);if(clearTimeout(T.current),N.current){n||clearTimeout(E.current),O.current=N.current({...e,tree:w,x:G.clientX,y:G.clientY,onClose(){B(),F(),L(G,!0,"safe-polygon")}});const H=O.current;W.addEventListener("mousemove",H),D.current=()=>{W.removeEventListener("mousemove",H)};return}(S.current==="touch"?!Kn(l,G.relatedTarget):!0)&&L(G)}function K(G){U()||N.current==null||N.current({...e,tree:w,x:G.clientX,y:G.clientY,onClose(){B(),F(),L(G)}})(G)}if(zt(o)){const G=o;return n&&G.addEventListener("mouseleave",K),l?.addEventListener("mouseleave",K),y&&G.addEventListener("mousemove",z,{once:!0}),G.addEventListener("mouseenter",z),G.addEventListener("mouseleave",$),()=>{n&&G.removeEventListener("mouseleave",K),l?.removeEventListener("mouseleave",K),y&&G.removeEventListener("mousemove",z),G.removeEventListener("mouseenter",z),G.removeEventListener("mouseleave",$)}}},[o,l,d,e,g,x,y,L,F,B,r,n,w,k,N,a]),Xt(()=>{var U;if(d&&n&&(U=N.current)!=null&&U.__options.blockPointerEvents&&A()){const $=Zr(l).body;if($.setAttribute(sI,""),$.style.pointerEvents="none",M.current=!0,zt(o)&&l){var z;const K=o,G=w==null||(z=w.nodesRef.current.find(W=>W.id===j))==null||(z=z.context)==null?void 0:z.elements.floating;return G&&(G.style.pointerEvents=""),K.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{K.style.pointerEvents="",l.style.pointerEvents=""}}}},[d,n,j,l,o,w,N,A]),Xt(()=>{n||(S.current=void 0,F(),B())},[n,F,B]),v.useEffect(()=>()=>{F(),clearTimeout(E.current),clearTimeout(T.current),B()},[d,o,F,B]),v.useMemo(()=>{if(!d)return{};function U(z){S.current=z.pointerType}return{reference:{onPointerDown:U,onPointerEnter:U,onMouseMove(z){n||x===0||(clearTimeout(T.current),T.current=setTimeout(()=>{P.current||r(!0,z.nativeEvent,"hover")},x))}},floating:{onMouseEnter(){clearTimeout(E.current)},onMouseLeave(z){L(z.nativeEvent,!1)}}}},[d,x,n,r,L])}function ppe(e,t){var n;let r=[],a=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;a;){const s=e.find(o=>o.id===a);a=s?.parentId,s&&(r=r.concat(s))}return r}function cu(e,t){let n=e.filter(a=>{var s;return a.parentId===t&&((s=a.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(a=>{var s;return(s=r)==null?void 0:s.some(o=>{var l;return a.parentId===o.id&&((l=a.context)==null?void 0:l.open)})}),n=n.concat(r);return n}function mpe(e,t){let n,r=-1;function a(s,o){o>r&&(n=s,r=o),cu(e,s).forEach(u=>{a(u.id,o+1)})}return a(t,0),e.find(s=>s.id===n)}let Ud=new WeakMap,Lb=new WeakSet,Fb={},rk=0;const gpe=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,eH=e=>e&&(e.host||eH(e.parentNode)),xpe=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=eH(n);return e.contains(r)?r:null}).filter(n=>n!=null);function bpe(e,t,n,r){const a="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,o=xpe(t,e),l=new Set,u=new Set(o),d=[];Fb[a]||(Fb[a]=new WeakMap);const h=Fb[a];o.forEach(p),g(t),l.clear();function p(x){!x||l.has(x)||(l.add(x),x.parentNode&&p(x.parentNode))}function g(x){!x||u.has(x)||Array.prototype.forEach.call(x.children,y=>{if(l.has(y))g(y);else{const w=s?y.getAttribute(s):null,j=w!==null&&w!=="false",N=(Ud.get(y)||0)+1,k=(h.get(y)||0)+1;Ud.set(y,N),h.set(y,k),d.push(y),N===1&&j&&Lb.add(y),k===1&&y.setAttribute(a,""),!j&&s&&y.setAttribute(s,"true")}})}return rk++,()=>{d.forEach(x=>{const y=(Ud.get(x)||0)-1,w=(h.get(x)||0)-1;Ud.set(x,y),h.set(x,w),y||(!Lb.has(x)&&s&&x.removeAttribute(s),Lb.delete(x)),w||x.removeAttribute(a)}),rk--,rk||(Ud=new WeakMap,Ud=new WeakMap,Lb=new WeakSet,Fb={})}}function iI(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Zr(e[0]).body;return bpe(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Um=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tH(e,t){const n=u1(e,Um());t==="prev"&&n.reverse();const r=n.indexOf(yi(Zr(e)));return n.slice(r+1)[0]}function nH(){return tH(document.body,"next")}function rH(){return tH(document.body,"prev")}function Sm(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Kn(n,r)}
485function ype(e){u1(e,Um()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function vpe(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const PO={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let wpe;function oI(e){e.key==="Tab"&&(e.target,clearTimeout(wpe))}const zy=v.forwardRef(function(t,n){const[r,a]=v.useState();Xt(()=>(_O()&&a("button"),document.addEventListener("keydown",oI),()=>{document.removeEventListener("keydown",oI)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Su("focus-guard")]:"",style:PO};return v.createElement("span",Bm({},t,s))}),aH=v.createContext(null),lI=Su("portal");function jpe(e){let{id:t,root:n}=e===void 0?{}:e;const[r,a]=v.useState(null),s=d1(),o=sH(),l=v.useRef(null);return Xt(()=>()=>{r?.remove(),queueMicrotask(()=>{l.current=null})},[r]),Xt(()=>{if(l.current)return;const u=t?document.getElementById(t):null;if(!u)return;const d=document.createElement("div");d.id=s,d.setAttribute(lI,""),u.appendChild(d),l.current=d,a(d)},[t,s]),Xt(()=>{if(l.current)return;let u=n||o?.portalNode;u&&!zt(u)&&(u=u.current),u=u||document.body;let d=null;t&&(d=document.createElement("div"),d.id=t,u.appendChild(d));const h=document.createElement("div");h.id=s,h.setAttribute(lI,""),u=d||u,u.appendChild(h),l.current=h,a(h)},[t,n,s,o]),r}function Npe(e){let{children:t,id:n,root:r=null,preserveTabOrder:a=!0}=e;const s=jpe({id:n,root:r}),[o,l]=v.useState(null),u=v.useRef(null),d=v.useRef(null),h=v.useRef(null),p=v.useRef(null),g=!!o&&!o.modal&&o.open&&a&&!!(r||s);return v.useEffect(()=>{if(!s||!a||o!=null&&o.modal)return;function x(y){s&&Sm(y)&&(y.type==="focusin"?vpe:ype)(s)}return s.addEventListener("focusin",x,!0),s.addEventListener("focusout",x,!0),()=>{s.removeEventListener("focusin",x,!0),s.removeEventListener("focusout",x,!0)}},[s,a,o?.modal]),v.createElement(aH.Provider,{value:v.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:h,afterInsideRef:p,portalNode:s,setFocusManagerState:l}),[a,s])},g&&s&&v.createElement(zy,{"data-type":"outside",ref:u,onFocus:x=>{if(Sm(x,s)){var y;(y=h.current)==null||y.focus()}else{const w=rH()||o?.refs.domReference.current;w?.focus()}}}),g&&s&&v.createElement("span",{"aria-owns":s.id,style:PO}),s&&qE.createPortal(t,s),g&&s&&v.createElement(zy,{"data-type":"outside",ref:d,onFocus:x=>{if(Sm(x,s)){var y;(y=p.current)==null||y.focus()}else{const w=nH()||o?.refs.domReference.current;w?.focus(),o?.closeOnFocusOut&&o?.onOpenChange(!1,x.nativeEvent)}}}))}const sH=()=>v.useContext(aH),cI=20;let Hc=[];function ak(e){Hc=Hc.filter(n=>n.isConnected);let t=e;if(!(!t||Bu(t)==="body")){if(!Xhe(t,Um())){const n=u1(t,Um())[0];if(!n)return;t=n}Hc.push(t),Hc.length>cI&&(Hc=Hc.slice(-cI))}}function uI(){return Hc.slice().reverse().find(e=>e.isConnected)}const _pe=v.forwardRef(function(t,n){return v.createElement("button",Bm({},t,{type:"button",ref:n,tabIndex:-1,style:PO}))});function iH(e){const{context:t,children:n,disabled:r=!1,order:a=["content"],guards:s=!0,initialFocus:o=0,returnFocus:l=!0,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:h=!0}=e,{open:p,refs:g,nodeId:x,onOpenChange:y,events:w,dataRef:j,elements:{domReference:N,floating:k}}=t,S=typeof o=="number"&&o<0,E=$q(N)&&S,O=gpe()?s:!0,T=Oi(a),P=Oi(o),M=Oi(l),D=Eg(),A=sH(),L=v.useRef(null),F=v.useRef(null),B=v.useRef(!1),U=v.useRef(!1),z=A!=null,$=v.useCallback(function(I){return I===void 0&&(I=k),I?u1(I,Um()):[]},[k]),K=v.useCallback(I=>{const H=$(I);return T.current.map(V=>N&&V==="reference"?N:k&&V==="floating"?k:H).filter(Boolean).flat()},[N,k,T,$]);v.useEffect(()=>{if(r||!u)return;function I(V){if(V.key==="Tab"){Kn(k,yi(Zr(k)))&&$().length===0&&!E&&Cr(V);const X=K(),te=Pl(V);T.current[0]==="reference"&&te===N&&(Cr(V),V.shiftKey?go(X[X.length-1]):go(X[1])),T.current[1]==="floating"&&te===k&&V.shiftKey&&(Cr(V),go(X[0]))}}const H=Zr(k);return H.addEventListener("keydown",I),()=>{H.removeEventListener("keydown",I)}},[r,N,k,u,T,E,$,K]),v.useEffect(()=>{if(r||!h)return;function I(){U.current=!0,setTimeout(()=>{U.current=!1})}function H(V){const X=V.relatedTarget;queueMicrotask(()=>{const te=!(Kn(N,X)||Kn(k,X)||Kn(X,k)||Kn(A?.portalNode,X)||X!=null&&X.hasAttribute(Su("focus-guard"))||D&&(cu(D.nodesRef.current,x).find(fe=>{var ae,ke;return Kn((ae=fe.context)==null?void 0:ae.elements.floating,X)||Kn((ke=fe.context)==null?void 0:ke.elements.domReference,X)})||ppe(D.nodesRef.current,x).find(fe=>{var ae,ke;return((ae=fe.context)==null?void 0:ae.elements.floating)===X||((ke=fe.context)==null?void 0:ke.elements.domReference)===X})));X&&te&&!U.current&&X!==uI()&&(B.current=!0,y(!1,V))})}if(k&&Tr(N))return N.addEventListener("focusout",H),N.addEventListener("pointerdown",I),!u&&k.addEventListener("focusout",H),()=>{N.removeEventListener("focusout",H),N.removeEventListener("pointerdown",I),!u&&k.removeEventListener("focusout",H)}},[r,N,k,u,x,D,A,y,h]),v.useEffect(()=>{var I;if(r)return;const H=Array.from((A==null||(I=A.portalNode)==null?void 0:I.querySelectorAll("["+Su("portal")+"]"))||[]);if(k){const V=[k,...H,L.current,F.current,T.current.includes("reference")||E?N:null].filter(te=>te!=null),X=u||E?iI(V,O,!O):iI(V);return()=>{X()}}},[r,N,k,u,T,A,E,O]),Xt(()=>{if(r||!k)return;const I=Zr(k),H=yi(I);queueMicrotask(()=>{const V=K(k),X=P.current,te=(typeof X=="number"?V[X]:X.current)||k,fe=Kn(k,H);!S&&!fe&&p&&go(te,{preventScroll:te===k})})},[r,p,k,S,K,P]),Xt(()=>{if(r||!k)return;let I=!1;
485const H=Zr(k),V=yi(H),X=j.current;ak(V);function te(fe){let{reason:ae,event:ke,nested:xe}=fe;ae==="escape-key"&&g.domReference.current&&ak(g.domReference.current),ae==="hover"&&ke.type==="mouseleave"&&(B.current=!0),ae==="outside-press"&&(xe?(B.current=!1,I=!0):B.current=!(Mq(ke)||NO(ke)))}return w.on("openchange",te),()=>{w.off("openchange",te);const fe=yi(H),ae=Kn(k,fe)||D&&cu(D.nodesRef.current,x).some(ue=>{var we;return Kn((we=ue.context)==null?void 0:we.elements.floating,fe)});(ae||X.openEvent&&["click","mousedown"].includes(X.openEvent.type))&&g.domReference.current&&ak(g.domReference.current);const xe=uI();M.current&&!B.current&&Tr(xe)&&(!(xe!==fe&&fe!==H.body)||ae)&&go(xe,{cancelPrevious:!1,preventScroll:I})}},[r,k,M,j,g,w,D,x]),Xt(()=>{if(!(r||!A))return A.setFocusManagerState({modal:u,closeOnFocusOut:h,open:p,onOpenChange:y,refs:g}),()=>{A.setFocusManagerState(null)}},[r,A,u,p,y,g,h]),Xt(()=>{if(r||!k||typeof MutationObserver!="function"||S)return;const I=()=>{const V=k.getAttribute("tabindex");T.current.includes("floating")||yi(Zr(k))!==g.domReference.current&&$().length===0?V!=="0"&&k.setAttribute("tabindex","0"):V!=="-1"&&k.setAttribute("tabindex","-1")};I();const H=new MutationObserver(I);return H.observe(k,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}},[r,k,g,T,$,S]);function G(I){return r||!d||!u?null:v.createElement(_pe,{ref:I==="start"?L:F,onClick:H=>y(!1,H.nativeEvent)},typeof d=="string"?d:"Dismiss")}const W=!r&&O&&(z||u);return v.createElement(v.Fragment,null,W&&v.createElement(zy,{"data-type":"inside",ref:A?.beforeInsideRef,onFocus:I=>{if(u){const V=K();go(a[0]==="reference"?V[0]:V[V.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(B.current=!1,Sm(I,A.portalNode)){const V=nH()||N;V?.focus()}else{var H;(H=A.beforeOutsideRef.current)==null||H.focus()}}}),!E&&G("start"),n,G("end"),W&&v.createElement(zy,{"data-type":"inside",ref:A?.afterInsideRef,onFocus:I=>{if(u)go(K()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(h&&(B.current=!0),Sm(I,A.portalNode)){const V=rH()||N;V?.focus()}else{var H;(H=A.afterOutsideRef.current)==null||H.focus()}}}))}const sk=new Set,kpe=v.forwardRef(function(t,n){let{lockScroll:r=!1,...a}=t;const s=d1();return Xt(()=>{if(!r)return;sk.add(s);const o=/iP(hone|ad|od)|iOS/.test(jO()),l=document.body.style,d=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",h=window.innerWidth-document.documentElement.clientWidth,p=l.left?parseFloat(l.left):window.pageXOffset,g=l.top?parseFloat(l.top):window.pageYOffset;if(l.overflow="hidden",h&&(l[d]=h+"px"),o){var x,y;const w=((x=window.visualViewport)==null?void 0:x.offsetLeft)||0,j=((y=window.visualViewport)==null?void 0:y.offsetTop)||0;Object.assign(l,{position:"fixed",top:-(g-Math.floor(j))+"px",left:-(p-Math.floor(w))+"px",right:"0"})}return()=>{sk.delete(s),sk.size===0&&(Object.assign(l,{overflow:"",[d]:""}),o&&(Object.assign(l,{position:"",top:"",left:"",right:""}),window.scrollTo(p,g)))}},[s,r]),v.createElement("div",Bm({ref:n},a,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...a.style}}))});function dI(e){return Tr(e.target)&&e.target.tagName==="BUTTON"}function fI(e){return kO(e)}function oH(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:s}}=e,{enabled:o=!0,event:l="click",toggle:u=!0,ignoreMouse:d=!1,keyboardHandlers:h=!0}=t,p=v.useRef(),g=v.useRef(!1);return v.useMemo(()=>o?{reference:{onPointerDown(x){p.current=x.pointerType},onMouseDown(x){x.button===0&&(Ty(p.current,!0)&&d||l!=="click"&&(n&&u&&(!a.current.openEvent||a.current.openEvent.type==="mousedown")?r(!1,x.nativeEvent,"click"):(x.preventDefault(),r(!0,x.nativeEvent,"click"))))},onClick(x){if(l==="mousedown"&&p.current){p.current=void 0;return}Ty(p.current,!0)&&d||(n&&u&&(!a.current.openEvent||a.current.openEvent.type==="click")?r(!1,x.nativeEvent,"click"):r(!0,x.nativeEvent,"click"))},onKeyDown(x){p.current=void 0,!(x.defaultPrevented||!h||dI(x))&&(x.key===" "&&!fI(s)&&(x.preventDefault(),g.current=!0),x.key==="Enter"&&r(!(n&&u),x.nativeEvent,"click"))},onKeyUp(x){x.defaultPrevented||!h||dI(x)||fI(s)||x.key===" "&&g.current&&(g.current=!1,r(!(n&&u),x.nativeEvent,"click"))}}}:{},[o,a,l,d,h,s,u,n,r])}const Spe={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Cpe={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hI=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function lH(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:a,elements:{reference:s,domReference:o,floating:l},dataRef:u}=e,{enabled:d=!0,escapeKey:h=!0,outsidePress:p=!0,outsidePressEvent:g="pointerdown",referencePress:x=!1,referencePressEvent:y="pointerdown",ancestorScroll:w=!1,bubbles:j,capture:N}=t,k=Eg(),S=vi(typeof p=="function"?p:()=>!1),E=typeof p=="function"?S:p,O=v.useRef(!1),T=v.useRef(!1),{escapeKey:P,outsidePress:M}=hI(j),{escapeKey:D,outsidePress:A}=hI(N),L=vi(z=>{if(!n||!d||!h||z.key!=="Escape")return;const $=k?cu(k.nodesRef.current,a):[];if(!P&&(z.stopPropagation(),$.length>0)){let K=!0;if($.forEach(G=>{var W;if((W=G.context)!=null&&W.open&&!G.context.dataRef.current.__escapeKeyBubbles){K=!1;return}}),!K)return}r(!1,Mfe(z)?z.nativeEvent:z,"escape-key")}),F=vi(z=>{var $;const K=()=>{var G;L(z),(G=Pl(z))==null||G.removeEventListener("keydown",K)};($=Pl(z))==null||$.addEventListener("keydown",K)}),B=vi(z=>{const $=O.current;O.current=!1;const K=T.current;if(T.current=!1,g==="click"&&K||$||typeof E=="function"&&!E(z))return;const G=Pl(z),W="["+Su("inert")+"]",I=Zr(l).querySelectorAll(W);let H=zt(G)?G:null;for(;H&&!Wl(H);){const te=Ao(H);if(Wl(te)||!zt(te))break;H=te}if(I.length&&zt(G)&&!Dfe(G)&&!Kn(G,l)&&Array.from(I).every(te=>!Kn(H,te)))return;if(Tr(G)&&l){const te=G.clientWidth>0&&G.scrollWidth>G.clientWidth,fe=G.clientHeight>0&&G.scrollHeight>G.clientHeight;let ae=fe&&z.offsetX>G.clientWidth;if(fe&&Ss(G).direction==="rtl"&&(ae=z.offsetX<=G.offsetWidth-G.clientWidth),ae||te&&z.offsetY>G.clientHeight)return}const V=k&&cu(k.nodesRef.current,a).some(te=>{var fe;return Q_(z,(fe=te.context)==null?void 0:fe.elements.floating)});if(Q_(z,l)||Q_(z,o)||V)return;const X=k?cu(k.nodesRef.current,a):[];if(X.length>0){let te=!0;if(X.forEach(fe=>{var ae;if((ae=fe.context)!=null&&ae.open&&!fe.context.dataRef.current.__outsidePressBubbles){te=!1;return}}),!te)return}r(!1,z,"outside-press")}),U=vi(z=>{var $;const K=()=>{var G;B(z),(G=Pl(z))==null||G.removeEventListener(g,K)};($=Pl(z))==null||$.addEventListener(g,K)});return v.useEffect(()=>{if(!n||!d)return;u.current.__escapeKeyBubbles=P,u.current.__outsidePressBubbles=M;function z(G){r(!1,G,"ancestor-scroll")}const $=Zr(l);h&&$.addEventListener("keydown",D?F:L,D),E&&$.addEventListener(g,A?U:B,A);let K=[];
485return w&&(zt(o)&&(K=Hl(o)),zt(l)&&(K=K.concat(Hl(l))),!zt(s)&&s&&s.contextElement&&(K=K.concat(Hl(s.contextElement)))),K=K.filter(G=>{var W;return G!==((W=$.defaultView)==null?void 0:W.visualViewport)}),K.forEach(G=>{G.addEventListener("scroll",z,{passive:!0})}),()=>{h&&$.removeEventListener("keydown",D?F:L,D),E&&$.removeEventListener(g,A?U:B,A),K.forEach(G=>{G.removeEventListener("scroll",z)})}},[u,l,o,s,h,E,g,n,r,w,d,P,M,L,D,F,B,A,U]),v.useEffect(()=>{O.current=!1},[E,g]),v.useMemo(()=>d?{reference:{onKeyDown:L,[Spe[y]]:z=>{x&&r(!1,z.nativeEvent,"reference-press")}},floating:{onKeyDown:L,onMouseDown(){T.current=!0},onMouseUp(){T.current=!0},[Cpe[g]]:()=>{O.current=!0}}}:{},[d,x,g,y,r,L])}function cH(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:a}=e,[s,o]=v.useState(null),l=((t=e.elements)==null?void 0:t.reference)||s,u=khe(e),d=Eg(),h=f1()!=null,p=vi((O,T,P)=>{O&&(x.current.openEvent=T),y.emit("openchange",{open:O,event:T,reason:P,nested:h}),r?.(O,T,P)}),g=v.useRef(null),x=v.useRef({}),y=v.useState(()=>upe())[0],w=d1(),j=v.useCallback(O=>{const T=zt(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),contextElement:O}:O;u.refs.setReference(T)},[u.refs]),N=v.useCallback(O=>{(zt(O)||O===null)&&(g.current=O,o(O)),(zt(u.refs.reference.current)||u.refs.reference.current===null||O!==null&&!zt(O))&&u.refs.setReference(O)},[u.refs]),k=v.useMemo(()=>({...u.refs,setReference:N,setPositionReference:j,domReference:g}),[u.refs,N,j]),S=v.useMemo(()=>({...u.elements,domReference:l}),[u.elements,l]),E=v.useMemo(()=>({...u,refs:k,elements:S,dataRef:x,nodeId:a,floatingId:w,events:y,open:n,onOpenChange:p}),[u,a,w,y,n,p,k,S]);return Xt(()=>{const O=d?.nodesRef.current.find(T=>T.id===a);O&&(O.context=E)}),v.useMemo(()=>({...u,context:E,refs:k,elements:S}),[u,k,S,E])}function Epe(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:a,refs:s,elements:{domReference:o}}=e,{enabled:l=!0,visibleOnly:u=!0}=t,d=v.useRef(!1),h=v.useRef(),p=v.useRef(!0);return v.useEffect(()=>{if(!l)return;const g=xa(o);function x(){!n&&Tr(o)&&o===yi(Zr(o))&&(d.current=!0)}function y(){p.current=!0}return g.addEventListener("blur",x),g.addEventListener("keydown",y,!0),()=>{g.removeEventListener("blur",x),g.removeEventListener("keydown",y,!0)}},[o,n,l]),v.useEffect(()=>{if(!l)return;function g(x){let{reason:y}=x;(y==="reference-press"||y==="escape-key")&&(d.current=!0)}return a.on("openchange",g),()=>{a.off("openchange",g)}},[a,l]),v.useEffect(()=>()=>{clearTimeout(h.current)},[]),v.useMemo(()=>l?{reference:{onPointerDown(g){NO(g.nativeEvent)||(p.current=!1)},onMouseLeave(){d.current=!1},onFocus(g){if(d.current)return;const x=Pl(g.nativeEvent);if(u&&zt(x))try{if(_O()&&Dq())throw Error();if(!x.matches(":focus-visible"))return}catch{if(!p.current&&!kO(x))return}r(!0,g.nativeEvent,"focus")},onBlur(g){d.current=!1;const x=g.relatedTarget,y=zt(x)&&x.hasAttribute(Su("focus-guard"))&&x.getAttribute("data-type")==="outside";h.current=window.setTimeout(()=>{const w=yi(o?o.ownerDocument:document);!x&&w===o||Kn(s.floating.current,w)||Kn(o,w)||y||r(!1,g.nativeEvent,"focus")})}}}:{},[l,u,o,s,r])}const pI="active",mI="selected";function ik(e,t,n){const r=new Map,a=n==="item";let s=e;if(a&&e){const{[pI]:o,[mI]:l,...u}=e;s=u}return{...n==="floating"&&{tabIndex:-1},...s,...t.map(o=>{const l=o?o[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((o,l)=>(l&&Object.entries(l).forEach(u=>{let[d,h]=u;if(!(a&&[pI,mI].includes(d)))if(d.indexOf("on")===0){if(r.has(d)||r.set(d,[]),typeof h=="function"){var p;(p=r.get(d))==null||p.push(h),o[d]=function(){for(var g,x=arguments.length,y=new Array(x),w=0;w<x;w++)y[w]=arguments[w];return(g=r.get(d))==null?void 0:g.map(j=>j(...y)).find(j=>j!==void 0)}}}else o[d]=h}),o),{})}}function uH(e){e===void 0&&(e=[]);const t=e,n=v.useCallback(s=>ik(s,e,"reference"),t),r=v.useCallback(s=>ik(s,e,"floating"),t),a=v.useCallback(s=>ik(s,e,"item"),e.map(s=>s?.item));return v.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:a}),[n,r,a])}let gI=!1;function h1(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function xI(e,t){return h1(t,e===TO||e===Cg,e===zf||e===hh)}function ok(e,t,n){return h1(t,e===Cg,n?e===zf:e===hh)||e==="Enter"||e===" "||e===""}function Ope(e,t,n){return h1(t,n?e===zf:e===hh,e===Cg)}function bI(e,t,n){return h1(t,n?e===hh:e===zf,e===TO)}function Ape(e,t){const{open:n,onOpenChange:r,refs:a,elements:{domReference:s,floating:o}}=e,{listRef:l,activeIndex:u,onNavigate:d=()=>{},enabled:h=!0,selectedIndex:p=null,allowEscape:g=!1,loop:x=!1,nested:y=!1,rtl:w=!1,virtual:j=!1,focusItemOnOpen:N="auto",focusItemOnHover:k=!0,openOnArrowKeyDown:S=!0,disabledIndices:E=void 0,orientation:O="vertical",cols:T=1,scrollItemIntoView:P=!0,virtualItemRef:M,itemSizes:D,dense:A=!1}=t,L=f1(),F=Eg(),B=vi(d),U=v.useRef(N),z=v.useRef(p??-1),$=v.useRef(null),K=v.useRef(!0),G=v.useRef(B),W=v.useRef(!!o),I=v.useRef(!1),H=v.useRef(!1),V=Oi(E),X=Oi(n),te=Oi(P),[fe,ae]=v.useState(),[ke,xe]=v.useState(),ue=vi(function(ne,_e,ye){ye===void 0&&(ye=!1);const Me=ne.current[_e.current];Me&&(j?(ae(Me.id),F?.events.emit("virtualfocus",Me),M&&(M.current=Me)):go(Me,{preventScroll:!0,sync:Dq()&&_O()?gI||I.current:!1}),requestAnimationFrame(()=>{const qe=te.current;qe&&Me&&(ye||!K.current)&&(Me.scrollIntoView==null||Me.scrollIntoView(typeof qe=="boolean"?{block:"nearest",inline:"nearest"}:qe))}))});Xt(()=>{document.createElement("div").focus({get preventScroll(){return gI=!0,!1}})},[]),Xt(()=>{h&&(n&&o?U.current&&p!=null&&(H.current=!0,z.current=p,B(p)):W.current&&(z.current=-1,G.current(null)))},[h,n,o,p,B]),Xt(()=>{if(h&&n&&o)if(u==null){if(I.current=!1,p!=null)return;if(W.current&&(z.current=-1,ue(l,z)),!W.current&&U.current&&($.current!=null||U.current===!0&&$.current==null)){let ne=0;const _e=()=>{l.current[0]==null?(ne<2&&(ne?requestAnimationFrame:queueMicrotask)(_e),ne++):(z.current=$.current==null||ok($.current,O,w)||y?ek(l,V.current):nI(l,V.current),$.current=null,B(z.current))};
485_e()}}else km(l,u)||(z.current=u,ue(l,z,H.current),H.current=!1)},[h,n,o,u,p,y,l,O,w,B,ue,V]),Xt(()=>{var ne;if(!h||o||!F||j||!W.current)return;const _e=F.nodesRef.current,ye=(ne=_e.find(be=>be.id===L))==null||(ne=ne.context)==null?void 0:ne.elements.floating,Me=yi(Zr(o)),qe=_e.some(be=>be.context&&Kn(be.context.elements.floating,Me));ye&&!qe&&K.current&&ye.focus({preventScroll:!0})},[h,o,F,L,j]),Xt(()=>{if(!h||!F||!j||L)return;function ne(_e){xe(_e.id),M&&(M.current=_e)}return F.events.on("virtualfocus",ne),()=>{F.events.off("virtualfocus",ne)}},[h,F,j,L,M]),Xt(()=>{G.current=B,W.current=!!o}),Xt(()=>{n||($.current=null)},[n]);const we=u!=null,Oe=v.useMemo(()=>{function ne(ye){if(!n)return;const Me=l.current.indexOf(ye);Me!==-1&&B(Me)}return{onFocus(ye){let{currentTarget:Me}=ye;ne(Me)},onClick:ye=>{let{currentTarget:Me}=ye;return Me.focus({preventScroll:!0})},...k&&{onMouseMove(ye){let{currentTarget:Me}=ye;ne(Me)},onPointerLeave(ye){let{pointerType:Me}=ye;!K.current||Me==="touch"||(z.current=-1,ue(l,z),B(null),j||go(a.floating.current,{preventScroll:!0}))}}}},[n,a,ue,k,l,B,j]);return v.useMemo(()=>{if(!h)return{};const ne=V.current;function _e(Ce){if(K.current=!1,I.current=!0,!X.current&&Ce.currentTarget===a.floating.current)return;if(y&&bI(Ce.key,O,w)){Cr(Ce),r(!1,Ce.nativeEvent,"list-navigation"),Tr(s)&&!j&&s.focus();return}const $t=z.current,en=ek(l,ne),Ot=nI(l,ne);if(Ce.key==="Home"&&(Cr(Ce),z.current=en,B(z.current)),Ce.key==="End"&&(Cr(Ce),z.current=Ot,B(z.current)),T>1){const Le=D||Array.from({length:l.current.length},()=>({width:1,height:1})),gn=epe(Le,T,A),Aa=gn.findIndex(Kt=>Kt!=null&&!(ne!=null&&ne.includes(Kt))),tt=gn.reduce((Kt,ze,et)=>ze!=null&&!(ne!=null&&ne.includes(ze))?et:Kt,-1);if(z.current=gn[Jhe({current:gn.map(Kt=>Kt!=null?l.current[Kt]:null)},{event:Ce,orientation:O,loop:x,cols:T,disabledIndices:npe([...ne||[],void 0],gn),minIndex:Aa,maxIndex:tt,prevIndex:tpe(z.current,Le,gn,T,Ce.key===Cg?"bl":Ce.key===hh?"tr":"tl"),stopEvent:!0})],B(z.current),O==="both")return}if(xI(Ce.key,O)){if(Cr(Ce),n&&!j&&yi(Ce.currentTarget.ownerDocument)===Ce.currentTarget){z.current=ok(Ce.key,O,w)?en:Ot,B(z.current);return}ok(Ce.key,O,w)?x?z.current=$t>=Ot?g&&$t!==l.current.length?-1:en:zr(l,{startingIndex:$t,disabledIndices:ne}):z.current=Math.min(Ot,zr(l,{startingIndex:$t,disabledIndices:ne})):x?z.current=$t<=en?g&&$t!==-1?l.current.length:Ot:zr(l,{startingIndex:$t,decrement:!0,disabledIndices:ne}):z.current=Math.max(en,zr(l,{startingIndex:$t,decrement:!0,disabledIndices:ne})),km(l,z.current)?B(null):B(z.current)}}function ye(Ce){N==="auto"&&Mq(Ce.nativeEvent)&&(U.current=!0)}function Me(Ce){U.current=N,N==="auto"&&NO(Ce.nativeEvent)&&(U.current=!0)}const qe=j&&n&&we&&{"aria-activedescendant":ke||fe},be=l.current.find(Ce=>Ce?.id===fe);return{reference:{...qe,onKeyDown(Ce){K.current=!1;const $t=Ce.key.indexOf("Arrow")===0,en=Ope(Ce.key,O,w),Ot=bI(Ce.key,O,w),Le=xI(Ce.key,O),gn=(y?en:Le)||Ce.key==="Enter"||Ce.key.trim()==="";if(j&&n){const ze=F?.nodesRef.current.find(jn=>jn.parentId==null),et=F&&ze?mpe(F.nodesRef.current,ze.id):null;if($t&&et&&M){const jn=new KeyboardEvent("keydown",{key:Ce.key,bubbles:!0});if(en||Ot){var Aa,tt;const ij=((Aa=et.context)==null?void 0:Aa.elements.domReference)===Ce.currentTarget,ux=Ot&&!ij?(tt=et.context)==null?void 0:tt.elements.domReference:en?be:null;ux&&(Cr(Ce),ux.dispatchEvent(jn),xe(void 0))}if(Le&&et.context&&et.context.open&&et.parentId&&Ce.currentTarget!==et.context.elements.domReference){var Kt;Cr(Ce),(Kt=et.context.elements.domReference)==null||Kt.dispatchEvent(jn);return}}return _e(Ce)}if(!(!n&&!S&&$t)){if(gn&&($.current=y&&Le?null:Ce.key),y){en&&(Cr(Ce),n?(z.current=ek(l,ne),B(z.current)):r(!0,Ce.nativeEvent,"list-navigation"));return}Le&&(p!=null&&(z.current=p),Cr(Ce),!n&&S?r(!0,Ce.nativeEvent,"list-navigation"):_e(Ce),n&&B(z.current))}},onFocus(){n&&B(null)},onPointerDown:Me,onMouseDown:ye,onClick:ye},floating:{"aria-orientation":O==="both"?void 0:O,...!$q(s)&&qe,onKeyDown:_e,onPointerMove(){K.current=!0}},item:Oe}},[s,a,fe,ke,V,X,l,h,O,w,j,n,we,y,p,S,g,T,x,N,B,r,Oe,F,M,D,A])}const Tpe=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function dH(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:a}=e,{enabled:s=!0,role:o="dialog"}=t,l=(n=Tpe.get(o))!=null?n:o,u=d1(),h=f1()!=null;return v.useMemo(()=>
485{if(!s)return{};const p={id:a,...l&&{role:l}};return l==="tooltip"||o==="label"?{reference:{["aria-"+(o==="label"?"labelledby":"describedby")]:r?a:void 0},floating:p}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":l==="alertdialog"?"dialog":l,"aria-controls":r?a:void 0,...l==="listbox"&&{role:"combobox"},...l==="menu"&&{id:u},...l==="menu"&&h&&{role:"menuitem"},...o==="select"&&{"aria-autocomplete":"none"},...o==="combobox"&&{"aria-autocomplete":"list"}},floating:{...p,...l==="menu"&&{"aria-labelledby":u}},item(g){let{active:x,selected:y}=g;const w={role:"option",...x&&{id:a+"-option"}};switch(o){case"select":return{...w,"aria-selected":x&&y};case"combobox":return{...w,...x&&{"aria-selected":!0}}}return{}}}},[s,o,l,r,a,u,h])}function Ppe(e,t){var n;const{open:r,dataRef:a}=e,{listRef:s,activeIndex:o,onMatch:l,onTypingChange:u,enabled:d=!0,findMatch:h=null,resetMs:p=750,ignoreKeys:g=[],selectedIndex:x=null}=t,y=v.useRef(),w=v.useRef(""),j=v.useRef((n=x??o)!=null?n:-1),N=v.useRef(null),k=vi(l),S=vi(u),E=Oi(h),O=Oi(g);return Xt(()=>{r&&(clearTimeout(y.current),N.current=null,w.current="")},[r]),Xt(()=>{if(r&&w.current===""){var T;j.current=(T=x??o)!=null?T:-1}},[r,x,o]),v.useMemo(()=>{if(!d)return{};function T(D){D?a.current.typing||(a.current.typing=D,S(D)):a.current.typing&&(a.current.typing=D,S(D))}function P(D,A,L){const F=E.current?E.current(A,L):A.find(B=>B?.toLocaleLowerCase().indexOf(L.toLocaleLowerCase())===0);return F?D.indexOf(F):-1}function M(D){const A=s.current;if(w.current.length>0&&w.current[0]!==" "&&(P(A,A,w.current)===-1?T(!1):D.key===" "&&Cr(D)),A==null||O.current.includes(D.key)||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;r&&D.key!==" "&&(Cr(D),T(!0)),A.every(U=>{var z,$;return U?((z=U[0])==null?void 0:z.toLocaleLowerCase())!==(($=U[1])==null?void 0:$.toLocaleLowerCase()):!0})&&w.current===D.key&&(w.current="",j.current=N.current),w.current+=D.key,clearTimeout(y.current),y.current=setTimeout(()=>{w.current="",j.current=N.current,T(!1)},p);const F=j.current,B=P(A,[...A.slice((F||0)+1),...A.slice(0,(F||0)+1)],w.current);B!==-1?(k(B),N.current=B):D.key!==" "&&(w.current="",T(!1))}return{reference:{onKeyDown:M},floating:{onKeyDown:M,onKeyUp(D){D.key===" "&&T(!1)}}}},[d,r,a,s,p,O,E,k,S])}function yI(e,t){const[n,r]=e;let a=!1;const s=t.length;for(let o=0,l=s-1;o<s;l=o++){const[u,d]=t[o]||[0,0],[h,p]=t[l]||[0,0];d>=r!=p>=r&&n<=(h-u)*(r-d)/(p-d)+u&&(a=!a)}return a}function Rpe(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Mpe(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let a,s=!1,o=null,l=null,u=performance.now();function d(p,g){const x=performance.now(),y=x-u;if(o===null||l===null||y===0)return o=p,l=g,u=x,null;const w=p-o,j=g-l,k=Math.sqrt(w*w+j*j)/y;return o=p,l=g,u=x,k}const h=p=>{let{x:g,y:x,placement:y,elements:w,onClose:j,nodeId:N,tree:k}=p;return function(E){function O(){clearTimeout(a),j()}if(clearTimeout(a),!w.domReference||!w.floating||y==null||g==null||x==null)return;const{clientX:T,clientY:P}=E,M=[T,P],D=Pl(E),A=E.type==="mouseleave",L=Kn(w.floating,D),F=Kn(w.domReference,D),B=w.domReference.getBoundingClientRect(),U=w.floating.getBoundingClientRect(),z=y.split("-")[0],$=g>U.right-U.width/2,K=x>U.bottom-U.height/2,G=Rpe(M,B),W=U.width>B.width,I=U.height>B.height,H=(W?B:U).left,V=(W?B:U).right,X=(I?B:U).top,te=(I?B:U).bottom;if(L&&(s=!0,!A))return;if(F&&(s=!1),F&&!A){s=!0;return}if(A&&zt(E.relatedTarget)&&Kn(w.floating,E.relatedTarget)||k&&cu(k.nodesRef.current,N).some(ke=>{let{context:xe}=ke;return xe?.open}))return;if(z==="top"&&x>=B.bottom-1||z==="bottom"&&x<=B.top+1||z==="left"&&g>=B.right-1||z==="right"&&g<=B.left+1)return O();let fe=[];switch(z){case"top":fe=[[H,B.top+1],[H,U.bottom-1],[V,U.bottom-1],[V,B.top+1]];break;case"bottom":fe=[[H,U.top+1],[H,B.bottom-1],[V,B.bottom-1],[V,U.top+1]];break;case"left":fe=[[U.right-1,te],[U.right-1,X],[B.left+1,X],[B.left+1,te]];break;case"right":fe=[[B.right-1,te],[B.right-1,X],[U.left+1,X],[U.left+1,te]];break}function ae(ke){let[xe,ue]=ke;switch(z){case"top":{const we=[W?xe+t/2:$?xe+t*4:xe-t*4,ue+t+1],Oe=[W?xe-t/2:$?xe+t*4:xe-t*4,ue+t+1],ne=[[U.left,$||W?U.bottom-t:U.top],[U.right,$?W?U.bottom-t:U.top:U.bottom-t]];return[we,Oe,...ne]}case"bottom":{const we=[W?xe+t/2:$?xe+t*4:xe-t*4,ue-t],Oe=[W?xe-t/2:$?xe+t*4:xe-t*4,ue-t],ne=[[U.left,$||W?U.top+t:U.bottom],[U.right,$?W?U.top+t:U.bottom:U.top+t]];return[we,Oe,...ne]}case"left":{const we=[xe+t+1,I?ue+t/2:K?ue+t*4:ue-t*4],Oe=[xe+t+1,I?ue-t/2:K?ue+t*4:ue-t*4];return[...[[K||I?U.right-t:U.left,U.top],[K?I?U.right-t:U.left:U.right-t,U.bottom]],we,Oe]}case"right":{const we=[xe-t,I?ue+t/2:K?ue+t*4:ue-t*4],Oe=[xe-t,I?ue-t/2:K?ue+t*4:ue-t*4],ne=[[K||I?U.left+t:U.right,U.top],[K?I?U.left+t:U.right:U.left+t,U.bottom]];return[we,Oe,...ne]}}}if(!yI([T,P],fe)){if(s&&!G)return O();if(!A&&r){const ke=d(E.clientX,E.clientY);if(ke!==null&&ke<.1)return O()}yI([T,P],ae([g,x]))?!s&&r&&(a=window.setTimeout(O,40)):O()}}};return h.__options={blockPointerEvents:n},h}const Dpe=({arrowRef:e,placement:t})=>{const n=[];
485return n.push(Che(8)),n.push(t==="auto"?Ahe():Ohe()),n.push(Ehe({padding:8})),e?.current&&n.push(The({element:e.current})),n},$pe=({placement:e})=>e==="auto"?void 0:e,Ipe=({placement:e})=>({top:"bottom",right:"left",bottom:"top",left:"right"})[e.split("-")[0]],fH=({open:e,arrowRef:t,placement:n="top",setOpen:r})=>cH({placement:$pe({placement:n}),open:e,onOpenChange:r,whileElementsMounted:Vq,middleware:Dpe({placement:n,arrowRef:t})}),hH=({context:e,trigger:t,role:n="tooltip",interactions:r=[]})=>uH([oH(e,{enabled:t==="click"}),hpe(e,{enabled:t==="hover",handleClose:Mpe()}),lH(e),dH(e,{role:n}),...r]),pH=v.createContext(void 0);function RO(){const e=v.useContext(pH);if(!e)throw new Error("useDropdownContext should be used within the DropdownContext provider!");return e}const MO=({className:e,theme:t={},...n})=>{const{theme:r}=RO(),a=t.divider??r.floating.divider;return i.jsx("div",{className:ce(a,e),...n})},mH=({children:e,className:t,theme:n={},...r})=>{const{theme:a}=RO(),s=n.header??a.floating.header;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:ce(s,t),...r,children:e}),i.jsx(MO,{})]})},gH=v.forwardRef(({children:e,className:t,icon:n,onClick:r,theme:a={},...s},o)=>{const{ref:l,index:u}=ipe({label:typeof e=="string"?e:void 0}),d=Zq([o,l]),{theme:h,activeIndex:p,dismissOnClick:g,getItemProps:x,handleSelect:y}=RO(),w=p===u,j=Ne(h.floating.item,a),N=s;return i.jsx("li",{role:"menuitem",className:j.container,children:i.jsxs(xO,{ref:d,className:ce(j.base,t),...N,...x({onClick:()=>{r?.(),g&&y(null)}}),tabIndex:w?0:-1,children:[n&&i.jsx(n,{className:j.icon}),e]})})});gH.displayName="DropdownItem";const Lpe={top:Fue,right:oq,bottom:iq,left:Lue},Fpe=({refs:e,children:t,inline:n,theme:r,disabled:a,setButtonWidth:s,getReferenceProps:o,renderTrigger:l,...u})=>{const d=e.reference,h=o();if(v.useEffect(()=>{d.current&&s?.(d.current.clientWidth)},[d,s]),l){const p=l(r);return v.cloneElement(p,{ref:e.setReference,disabled:a,...h,...p.props})}return n?i.jsx("button",{type:"button",ref:e.setReference,className:r?.inlineWrapper,disabled:a,...h,children:t}):i.jsx(mt,{...u,disabled:a,type:"button",ref:e.setReference,...h,children:t})},xH=({children:e,className:t,dismissOnClick:n=!0,theme:r={},renderTrigger:a,...s})=>{const[o,l]=v.useState(!1),[u,d]=v.useState(null),[h,p]=v.useState(null),[g,x]=v.useState(void 0),y=v.useRef([]),w=v.useRef([]),j=Ne(Ge().dropdown,r),N=s,k=s["data-testid"]||"flowbite-dropdown-target",{placement:S=s.inline?"bottom-start":"bottom",trigger:E="click",label:O,inline:T,arrowIcon:P=!0,...M}=N,D=v.useCallback(I=>{p(I),l(!1)},[]),A=v.useCallback(I=>{o?d(I):D(I)},[o,D]),{context:L,floatingStyles:F,refs:B}=fH({open:o,setOpen:l,placement:S}),U=Ape(L,{listRef:y,activeIndex:u,selectedIndex:h,onNavigate:d}),z=Ppe(L,{listRef:w,activeIndex:u,selectedIndex:h,onMatch:A}),{getReferenceProps:$,getFloatingProps:K,getItemProps:G}=hH({context:L,role:"menu",trigger:E,interactions:[U,z]}),W=v.useMemo(()=>{const[I]=S.split("-");return Lpe[I]??iq},[S]);return i.jsxs(pH.Provider,{value:{theme:j,activeIndex:u,dismissOnClick:n,getItemProps:G,handleSelect:D},children:[i.jsxs(Fpe,{...M,refs:B,inline:T,theme:j,"data-testid":k,className:ce(j.floating.target,M.className),setButtonWidth:x,getReferenceProps:$,renderTrigger:a,children:[O,P&&i.jsx(W,{className:j.arrowIcon})]}),o&&i.jsx(iH,{context:L,modal:!1,children:i.jsx("div",{ref:B.setFloating,style:{...F,minWidth:g},"data-testid":"flowbite-dropdown","aria-expanded":o,...K({className:ce(j.floating.base,j.floating.animation,"duration-100",!o&&j.floating.hidden,j.floating.style.auto,t)}),children:i.jsx(spe,{elementsRef:y,labelsRef:w,children:i.jsx("ul",{className:j.content,tabIndex:-1,children:e})})})})]})};xH.displayName="Dropdown";mH.displayName="Dropdown.Header";MO.displayName="Dropdown.Divider";const bH=Object.assign(xH,{Item:gH,Header:mH,Divider:MO}),DO=v.forwardRef(({className:e,color:t="gray",helperText:n,sizing:r="md",theme:a={},...s},o)=>{const l=Ne(Ge().fileInput,a);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:ce(l.root.base,e),children:i.jsx("div",{className:l.field.base,children:i.jsx("input",{className:ce(l.field.input.base,l.field.input.colors[t],l.field.input.sizes[r]),...s,type:"file",ref:o})})}),n&&i.jsx(_g,{color:t,children:n})]})});DO.displayName="FileInput";const zpe=v.forwardRef(({label:e,helperText:t,color:n="default",sizing:r="md",variant:a,disabled:s=!1,theme:o={},className:l,...u},d)=>{const h=v.useId(),p=Ne(Ge().floatingLabel,o);return i.jsxs("div",{children:[i.jsxs("div",{className:ce("relative",a==="standard"?"z-0":""),children:[i.jsx("input",{type:"text",id:u.id?u.id:"floatingLabel"+h,"aria-describedby":"outlined_success_help",className:ce(p.input[n][a][r],l),placeholder:" ","data-testid":"floating-label",disabled:s,...u,ref:d}),i.jsx("label",{htmlFor:u.id?u.id:"floatingLabel"+h,className:ce(p.label[n][a][r],l),children:e})]}),i.jsx("p",{id:"outlined_helper_text"+h,className:ce(p.helperText[n],l),children:t})]})});zpe.displayName="FloatingLabel";const yH=({alt:e,className:t,children:n,href:r,name:a,src:s,theme:o={},...l})=>{const u=Ne(Ge().footer.brand,o);return i.jsx("div",{children:r?i.jsxs("a",{"data-testid":"flowbite-footer-brand",href:r,className:ce(u.base,t),...l,children:[i.jsx("img",{alt:e,src:s,className:u.img}),i.jsx("span",{"data-testid":"flowbite-footer-brand-span",className:u.span,children:a}),n]}):i.jsx("img",{alt:e,"data-testid":"flowbite-footer-brand",src:s,className:ce(u.img,t),...l})})},vH=({by:e,className:t,href:n,theme:r={},year:a,...s})=>{const o=Ne(Ge().footer.copyright,r);return i.jsxs("div",{"data-testid":"flowbite-footer-copyright",className:ce(o.base,t),...s,children:["© ",a,n?i.jsx("a",{href:n,className:o.href,children:e}):i.jsx("span",{"data-testid":"flowbite-footer-copyright-span",className:o.span,children:e})]})},wH=({className:e,theme:t={},...n})=>
485{const r=Ne(Ge().footer.divider,t);return i.jsx("hr",{"data-testid":"footer-divider",className:ce(r.base,e),...n})},jH=({ariaLabel:e,className:t,href:n,icon:r,theme:a={},...s})=>{const o=Ne(Ge().footer.icon,a);return i.jsx("div",{children:n?i.jsx("a",{"aria-label":e,"data-testid":"flowbite-footer-icon",href:n,className:ce(o.base,t),...s,children:i.jsx(r,{className:o.size})}):i.jsx(r,{"data-testid":"flowbite-footer-icon",className:o.size,...s})})},NH=({as:e="a",children:t,className:n,href:r,theme:a={},...s})=>{const o=Ne(Ge().footer.groupLink.link,a);return i.jsx("li",{className:ce(o.base,n),children:i.jsx(e,{href:r,className:o.href,...s,children:t})})},_H=({children:e,className:t,col:n=!1,theme:r={},...a})=>{const s=Ne(Ge().footer.groupLink,r);return i.jsx("ul",{"data-testid":"footer-groupLink",className:ce(s.base,n&&s.col,t),...a,children:e})},kH=({as:e="h2",className:t,theme:n={},title:r,...a})=>{const s=Ne(Ge().footer.title,n);return i.jsx(e,{"data-testid":"flowbite-footer-title",className:ce(s.base,t),...a,children:r})},SH=({bgDark:e=!1,children:t,className:n,container:r=!1,theme:a={},...s})=>{const o=Ne(Ge().footer,a);return i.jsx("footer",{"data-testid":"flowbite-footer",className:ce(o.root.base,e&&o.root.bgDark,r&&o.root.container,n),...s,children:t})};SH.displayName="Footer";vH.displayName="Footer.Copyright";NH.displayName="Footer.Link";yH.displayName="Footer.Brand";_H.displayName="Footer.LinkGroup";jH.displayName="Footer.Icon";kH.displayName="Footer.Title";wH.displayName="Footer.Divider";Object.assign(SH,{Copyright:vH,Link:NH,LinkGroup:_H,Brand:yH,Icon:jH,Title:kH,Divider:wH});const CH=({children:e,className:t,icon:n,theme:r={},...a})=>{const s=Ne(Ge().list.item,r);return i.jsxs("li",{className:ce(s.withIcon[n?"on":"off"],t),...a,children:[n&&i.jsx(n,{className:ce(s.icon)}),e]})},EH=({children:e,className:t,unstyled:n,nested:r,ordered:a,horizontal:s,theme:o={},...l})=>{const u=Ne(Ge().list,o),d=a?"ol":"ul";return i.jsx(d,{className:ce(u.root.base,u.root.ordered[a?"on":"off"],n&&u.root.unstyled,r&&u.root.nested,s&&u.root.horizontal,t),...l,children:e})};EH.displayName="List";CH.displayName="List.Item";Object.assign(EH,{Item:CH});const OH=({active:e,children:t,className:n,href:r,icon:a,onClick:s,theme:o={},disabled:l,...u})=>{const d=Ne(Ge().listGroup.item,o),h=typeof r<"u",p=h?"a":"button";return i.jsx("li",{className:ce(d.base,n),children:i.jsxs(p,{href:r,onClick:s,type:h?void 0:"button",disabled:l,className:ce(d.link.active[e?"on":"off"],d.link.disabled[l?"on":"off"],d.link.base,d.link.href[h?"on":"off"]),...u,children:[a&&i.jsx(a,{"aria-hidden":!0,"data-testid":"flowbite-list-group-item-icon",className:d.link.icon}),t]})})},AH=({children:e,className:t,theme:n={},...r})=>{const a=Ne(Ge().listGroup,n);return i.jsx("ul",{className:ce(a.root.base,t),...r,children:e})};AH.displayName="ListGroup";OH.displayName="ListGroup.Item";Object.assign(AH,{Item:OH});const TH=v.createContext(void 0);function $O(){const e=v.useContext(TH);if(!e)throw new Error("useModalContext should be used within the ModalContext provider!");return e}const PH=({children:e,className:t,theme:n={},...r})=>{const{theme:a,popup:s}=$O(),o=Ne(a.body,n);return i.jsx("div",{className:ce(o.base,s&&[o.popup],t),...r,children:e})},RH=({children:e,className:t,theme:n={},...r})=>{const{theme:a,popup:s}=$O(),o=Ne(a.footer,n);return i.jsx("div",{className:ce(o.base,!s&&o.popup,t),...r,children:e})},MH=({as:e="h3",children:t,className:n,theme:r={},id:a,...s})=>{const o=v.useId(),l=a||o,{theme:u,popup:d,onClose:h,setHeaderId:p}=$O(),g=Ne(u.header,r);return v.useLayoutEffect(()=>(p(l),()=>p(void 0)),[l,p]),i.jsxs("div",{className:ce(g.base,d&&g.popup,n),...s,children:[i.jsx(e,{id:l,className:g.title,children:t}),i.jsx("button",{"aria-label":"Close",className:g.close.base,type:"button",onClick:h,children:i.jsx(zue,{"aria-hidden":!0,className:g.close.icon})})]})},DH=v.forwardRef(({children:e,className:t,dismissible:n=!1,onClose:r,popup:a,position:s="center",root:o,show:l,size:u="2xl",theme:d={},initialFocus:h,...p},g)=>{const[x,y]=v.useState(void 0),w=Ne(Ge().modal,d),{context:j}=cH({open:l,onOpenChange:()=>r&&r()}),N=Zq([j.refs.setFloating,g]),k=oH(j),S=lH(j,{outsidePressEvent:"mou
485sedown",enabled:n}),E=dH(j),{getFloatingProps:O}=uH([k,S,E]);return l?i.jsx(TH.Provider,{value:{theme:w,popup:a,onClose:r,setHeaderId:y},children:i.jsx(Npe,{root:o,children:i.jsx(kpe,{lockScroll:!0,"data-testid":"modal-overlay",className:ce(w.root.base,w.root.positions[s],l?w.root.show.on:w.root.show.off,t),...p,children:i.jsx(iH,{context:j,initialFocus:h,children:i.jsx("div",{ref:N,...O(p),"aria-labelledby":x,className:ce(w.content.base,w.root.sizes[u]),children:i.jsx("div",{className:w.content.inner,children:e})})})})})}):null});DH.displayName="Modal";MH.displayName="Modal.Header";PH.displayName="Modal.Body";RH.displayName="Modal.Footer";const qt=Object.assign(DH,{Header:MH,Body:PH,Footer:RH}),$H=v.createContext(void 0);function p1(){const e=v.useContext($H);if(!e)throw new Error("useNavBarContext should be used within the NavbarContext provider!");return e}const IH=({as:e="a",children:t,className:n,theme:r={},...a})=>{const{theme:s}=p1(),o=Ne(s.brand,r);return i.jsx(e,{className:ce(o.base,n),...a,children:t})},LH=({children:e,className:t,theme:n={},...r})=>{const{theme:a,isOpen:s}=p1(),o=Ne(a.collapse,n);return i.jsx("div",{"data-testid":"flowbite-navbar-collapse",className:ce(o.base,o.hidden[s?"off":"on"],t),...r,children:i.jsx("ul",{className:o.list,children:e})})},FH=({active:e,as:t="a",disabled:n,children:r,className:a,theme:s={},onClick:o,...l})=>{const{theme:u,setIsOpen:d}=p1(),h=Ne(u.link,s),p=g=>{d(!1),o?.(g)};return i.jsx("li",{children:i.jsx(t,{className:ce(h.base,e&&h.active.on,!e&&!n&&h.active.off,h.disabled[n?"on":"off"],a),onClick:p,...l,children:r})})};function Bpe(e){return Ea({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"},child:[]}]})(e)}const zH=({barIcon:e=Bpe,className:t,theme:n={},...r})=>{const{theme:a,isOpen:s,setIsOpen:o}=p1(),l=Ne(a.toggle,n),u=()=>{o(!s)};return i.jsxs("button",{"data-testid":"flowbite-navbar-toggle",onClick:u,className:ce(l.base,t),...r,children:[i.jsx("span",{className:"sr-only",children:"Open main menu"}),i.jsx(e,{"aria-hidden":!0,className:l.icon})]})},BH=({border:e,children:t,className:n,fluid:r=!1,menuOpen:a,rounded:s,theme:o={},...l})=>{const[u,d]=v.useState(a),h=Ne(Ge().navbar,o);return i.jsx($H.Provider,{value:{theme:h,isOpen:u,setIsOpen:d},children:i.jsx("nav",{className:ce(h.root.base,h.root.bordered[e?"on":"off"],h.root.rounded[s?"on":"off"],n),...l,children:i.jsx("div",{className:ce(h.root.inner.base,h.root.inner.fluid[r?"on":"off"]),children:t})})})};BH.displayName="Navbar";IH.displayName="Navbar.Brand";LH.displayName="Navbar.Collapse";FH.displayName="Navbar.Link";zH.displayName="Navbar.Toggle";Object.assign(BH,{Brand:IH,Collapse:LH,Link:FH,Toggle:zH});const Upe=(e,t)=>e>=t?[]:[...Array(t-e+1).keys()].map(n=>n+e),IO=({active:e,children:t,className:n,onClick:r,theme:a={},...s})=>{const o=Ne(Ge().pagination,a);return i.jsx("button",{type:"button",className:ce(e&&o.pages.selector.active,n),onClick:r,...s,children:t})};IO.displayName="Pagination.Button";const VS=({children:e,className:t,onClick:n,theme:r={},disabled:a=!1,...s})=>{const o=Ne(Ge().pagination,r);return i.jsx("button",{type:"button",className:ce(a&&o.pages.selector.disabled,t),disabled:a,onClick:n,...s,children:e})};VS.displayName="Pagination.Navigation";const UH=({className:e,currentPage:t,layout:n="pagination",nextLabel:r="Next",onPageChange:a,previousLabel:s="Previous",renderPaginationButton:o=p=>i.jsx(IO,{...p}),showIcons:l=!1,theme:u={},totalPages:d,...h})=>{const p=Ne(Ge().pagination,u),g=Math.min(Math.max(n==="pagination"?t+2:t+4,5),d),x=Math.max(1,g-4),y=()=>{a(Math.min(t+1,d))},w=()=>{a(Math.max(t-1,1))};return i.jsxs("nav",{className:ce(p.base,e),...h,children:[n==="table"&&i.jsxs("div",{className:p.layout.table.base,children:["Showing ",i.jsx("span",{className:p.layout.table.span,children:x})," to ",i.jsx("span",{className:p.layout.table.span,children:g})," of ",i.jsx("span",{className:p.layout.table.span,children:d})," Entries"]}),i.jsxs("ul",{className:p.pages.base,children:[i.jsx("li",{children:i.jsxs(VS,{className:ce(p.pages.previous.base,l&&p.pages.showIcon),onClick:w,disabled:t===1,children:[l&&i.jsx(Due,{"aria-hidden":!0,
485className:p.pages.previous.icon}),s]})}),n==="pagination"&&Upe(x,g).map(j=>i.jsx("li",{"aria-current":j===t?"page":void 0,children:o({className:ce(p.pages.selector.base,t===j&&p.pages.selector.active),active:j===t,onClick:()=>a(j),children:j})},j)),i.jsx("li",{children:i.jsxs(VS,{className:ce(p.pages.next.base,l&&p.pages.showIcon),onClick:y,disabled:t===d,children:[r,l&&i.jsx($ue,{"aria-hidden":!0,className:p.pages.next.icon})]})})]})]})};UH.displayName="Pagination";Object.assign(UH,{Button:IO});const LO=({className:e,color:t="cyan",labelProgress:n=!1,labelText:r=!1,progress:a,progressLabelPosition:s="inside",size:o="md",textLabel:l="progressbar",textLabelPosition:u="inside",theme:d={},...h})=>{const p=v.useId(),g=Ne(Ge().progress,d);return i.jsx(i.Fragment,{children:i.jsxs("div",{id:p,"aria-label":l,"aria-valuenow":a,role:"progressbar",...h,children:[(l&&r&&u==="outside"||a>0&&n&&s==="outside")&&i.jsxs("div",{className:g.label,"data-testid":"flowbite-progress-outer-label-container",children:[l&&r&&u==="outside"&&i.jsx("span",{"data-testid":"flowbite-progress-outer-text-label",children:l}),n&&s==="outside"&&i.jsxs("span",{"data-testid":"flowbite-progress-outer-progress-label",children:[a,"%"]})]}),i.jsx("div",{className:ce(g.base,g.size[o],e),children:i.jsxs("div",{style:{width:`${a}%`},className:ce(g.bar,g.color[t],g.size[o]),children:[l&&r&&u==="inside"&&i.jsx("span",{"data-testid":"flowbite-progress-inner-text-label",children:l}),a>0&&n&&s==="inside"&&i.jsxs("span",{"data-testid":"flowbite-progress-inner-progress-label",children:[a,"%"]})]})})]})})};LO.displayName="Progress";const qpe=v.forwardRef(({className:e,theme:t={},...n},r)=>{const a=Ne(Ge().radio,t);return i.jsx("input",{ref:r,type:"radio",className:ce(a.root.base,e),...n})});qpe.displayName="Radio";const Hpe=v.forwardRef(({className:e,sizing:t="md",theme:n={},...r},a)=>{const s=Ne(Ge().rangeSlider,n);return i.jsx(i.Fragment,{children:i.jsx("div",{"data-testid":"flowbite-range-slider",className:ce(s.root.base,e),children:i.jsx("div",{className:s.field.base,children:i.jsx("input",{ref:a,type:"range",className:ce(s.field.input.base,s.field.input.sizes[t]),...r})})})})});Hpe.displayName="RangeSlider";const qH=({children:e,className:t,percentFilled:n=0,theme:r={},...a})=>{const s=Ne(Ge().ratingAdvanced,r);return i.jsxs("div",{className:ce(s.base,t),...a,children:[i.jsx("span",{className:s.label,children:e}),i.jsx("div",{className:s.progress.base,children:i.jsx("div",{className:s.progress.fill,"data-testid":"flowbite-rating-fill",style:{width:`${n}%`}})}),i.jsx("span",{className:s.progress.label,children:`${n}%`})]})},HH=v.createContext(void 0);function Kpe(){const e=v.useContext(HH);if(!e)throw new Error("useRatingContext should be used within the RatingContext provider!");return e}const KH=({className:e,filled:t=!0,starIcon:n=Iue,theme:r={},...a})=>{const{theme:s,size:o="sm"}=Kpe(),l=Ne(s.star,r);return i.jsx(n,{"data-testid":"flowbite-rating-star",className:ce(l.sizes[o],l[t?"filled":"empty"],e),...a})},VH=({children:e,className:t,size:n="sm",theme:r={},...a})=>{const s=Ne(Ge().rating,r);return i.jsx(HH.Provider,{value:{theme:s,size:n},children:i.jsx("div",{className:ce(s.root.base,t),...a,children:e})})};VH.displayName="Rating";KH.displayName="Rating.Star";qH.displayName="Rating.Advanced";Object.assign(VH,{Star:KH,Advanced:qH});const Vpe=v.forwardRef(({addon:e,children:t,className:n,color:r="gray",helperText:a,icon:s,shadow:o,sizing:l="md",theme:u={},...d},h)=>{const p=Ne(Ge().select,u);return i.jsxs("div",{className:ce(p.base,n),children:[e&&i.jsx("span",{className:p.addon,children:e}),i.jsxs("div",{className:p.field.base,children:[s&&i.jsx("div",{className:p.field.icon.base,children:i.jsx(s,{className:p.field.icon.svg})}),i.jsx("select",{className:ce(p.field.select.base,p.field.select.colors[r],p.field.select.sizes[l],p.field.select.withIcon[s?"on":"off"],p.field.select.withAddon[e?"on":"off"],p.field.select.withShadow[o?"on":"off"]),...d,ref:h,children:t}),a&&i.jsx(_g,{color:r,children:a})]})]})});Vpe.displayName="Select";const Gpe=({animation:e="duration-300",arrow:t=!0,children:n,className:r,content:a,placement:s="top",style:o="dark",theme:l,trigger:u="hover",minWidth:d,...h})=>{const p=v.useRef(null),[g,x]=v.useState(!1),y=fH({open:g,placement:s,arrowRef:p,setOpen:x}),{context:w,middlewareData:{arrow:{x:j,y:N}={}},refs:k,strategy:S,update:E,x:O,y:T}=y,P=Epe(w),{getFloatingProps:M,getReferenceProps:D}=hH({context:w,role:"tooltip",trigger:u,interactions:[P]});return v.useEffect(()=>{if(k.reference.current&&k.floating.current&&g)return Vq(k.reference.current,k.floating.current,E)},[g,k.floating,k.reference,E]),i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:k.setReference,className:l.target,"data-testid":"flowbite-tooltip-target",...D(),children:n}),i.jsxs("div",{ref:k.setFloating,"data-testid":"flowbite-tooltip",...M({className:ce(l.base,e&&`${l.animation} ${e}`,!g&&l.hidden,l.style[o],r),style:{position:S,top:T??" ",left:O??" ",minWidth:d},...h}),children:[i.jsx("div",{className:l.content,children:a}),t&&i.jsx("div",{className:ce(l.arrow.base,o==="dark"&&l.arrow.style.dark,o==="light"&&l.arrow.style.light,o==="auto"&&l.arrow.style.auto),"data-testid":"flowbite-tooltip-arrow",ref:p,style:{to
485p:N??" ",left:j??" ",right:" ",bottom:" ",[Ipe({placement:y.placement})]:l.arrow.placement},children:"Â "})]})]})},FO=({animation:e="duration-300",arrow:t=!0,children:n,className:r,content:a,placement:s="top",style:o="dark",theme:l={},trigger:u="hover",...d})=>{const h=Ne(Ge().tooltip,l);return i.jsx(Gpe,{animation:e,arrow:t,content:a,placement:s,style:o,theme:h,trigger:u,className:r,...d,children:n})};FO.displayName="Tooltip";const GH=v.createContext(void 0);function ph(){const e=v.useContext(GH);if(!e)throw new Error("useSidebarContext should be used within the SidebarContext provider!");return e}const zO=v.createContext(void 0);function Wpe(){const e=v.useContext(zO);if(!e)throw new Error("useSidebarItemContext should be used within the SidebarItemContext provider!");return e}const WH=({children:e,className:t,icon:n,label:r,chevronIcon:a=aq,renderChevronIcon:s,open:o=!1,theme:l={},...u})=>{const d=v.useId(),[h,p]=v.useState(o),{theme:g,isCollapsed:x}=ph(),y=Ne(g.collapse,l);v.useEffect(()=>p(o),[o]);const w=({children:j})=>i.jsx("li",{children:x&&!h?i.jsx(FO,{content:r,placement:"right",children:j}):j});return i.jsxs(w,{children:[i.jsxs("button",{id:`flowbite-sidebar-collapse-${d}`,onClick:()=>p(!h),title:r,type:"button",className:ce(y.button,t),...u,children:[n&&i.jsx(n,{"aria-hidden":!0,"data-testid":"flowbite-sidebar-collapse-icon",className:ce(y.icon.base,y.icon.open[h?"on":"off"])}),x?i.jsx("span",{className:"sr-only",children:r}):i.jsxs(i.Fragment,{children:[i.jsx("span",{"data-testid":"flowbite-sidebar-collapse-label",className:y.label.base,children:r}),s?s(y,h):i.jsx(a,{"aria-hidden":!0,className:ce(y.label.icon.base,y.label.icon.open[h?"on":"off"])})]})]}),i.jsx("ul",{"aria-labelledby":`flowbite-sidebar-collapse-${d}`,hidden:!h,className:y.list,children:i.jsx(zO.Provider,{value:{isInsideCollapse:!0},children:e})})]})};WH.displayName="Sidebar.Collapse";const YH=({children:e,color:t="info",className:n,theme:r={},...a})=>{const{theme:s,isCollapsed:o}=ph(),l=Ne(s.cta,r);return i.jsx("div",{"data-testid":"sidebar-cta",hidden:o,className:ce(l.base,l.color[t],n),...a,children:e})};YH.displayName="Sidebar.CTA";const Ype=({id:e,theme:t,isCollapsed:n,tooltipChildren:r,children:a,...s})=>i.jsx("li",{...s,children:n?i.jsx(FO,{content:i.jsx(XH,{id:e,theme:t,children:r}),placement:"right",children:a}):a}),XH=({id:e,theme:t,children:n})=>i.jsx("span",{"data-testid":"flowbite-sidebar-item-content",id:`flowbite-sidebar-item-${e}`,className:ce(t.content.base),children:n}),QH=v.forwardRef(({active:e,as:t="a",children:n,className:r,icon:a,label:s,labelColor:o="info",theme:l={},...u},d)=>{const h=v.useId(),{theme:p,isCollapsed:g}=ph(),{isInsideCollapse:x}=Wpe(),y=Ne(p.item,l);return i.jsx(Ype,{theme:y,className:y.listItem,id:h,isCollapsed:g,tooltipChildren:n,children:i.jsxs(t,{"aria-labelledby":`flowbite-sidebar-item-${h}`,ref:d,className:ce(y.base,e&&y.active,!g&&x&&y.collapsed?.insideCollapse,r),...u,children:[a&&i.jsx(a,{"aria-hidden":!0,"data-testid":"flowbite-sidebar-item-icon",className:ce(y.icon?.base,e&&y.icon?.active)}),g&&!a&&i.jsx("span",{className:y.collapsed?.noIcon,children:n.charAt(0).toLocaleUpperCase()??"?"}),!g&&i.jsx(XH,{id:h,theme:y,children:n}),!g&&s&&i.jsx(jq,{color:o,"data-testid":"flowbite-sidebar-label",hidden:g,className:y.label,children:s})]})})});QH.displayName="Sidebar.Item";const ZH=({children:e,className:t,theme:n={},...r})=>{const{theme:a}=ph(),s=Ne(a.itemGroup,n);return i.jsx("ul",{"data-testid":"flowbite-sidebar-item-group",className:ce(s.base,t),...r,children:i.jsx(zO.Provider,{value:{isInsideCollapse:!1},children:e})})};ZH.displayName="Sidebar.ItemGroup";const JH=({children:e,className:t,theme:n={},...r})=>{const{theme:a}=ph(),s=Ne(a.items,n);return i.jsx("div",{className:ce(s.base,t),"data-testid":"flowbite-sidebar-items",...r,children:e})};JH.displayName="Sidebar.Items";const eK=({children:e,className:t,href:n,img:r,imgAlt:a="",theme:s={},...o})=>{const l=v.useId(),{theme:u,isCollapsed:d}=ph(),h=Ne(u.logo,s);return i.jsxs("a",{"aria-labelledby":`flowbite-sidebar-logo-${l}`,href:n,className:ce(h.base,t),...o,children:[i.jsx("img",{alt:a,src:r,className:h.img}),i.jsx("span",{className:h.collapsed[d?"on":"off"],id:`flowbite-sidebar-logo-${l}`,children:e})]})};
485eK.displayName="Sidebar.Logo";const tK=({children:e,as:t="nav",collapseBehavior:n="collapse",collapsed:r=!1,theme:a={},className:s,...o})=>{const l=Ne(Ge().sidebar,a);return i.jsx(GH.Provider,{value:{theme:l,isCollapsed:r},children:i.jsx(t,{"aria-label":"Sidebar",hidden:r&&n==="hide",className:ce(l.root.base,l.root.collapsed[r?"on":"off"],s),...o,children:i.jsx("div",{className:l.root.inner,children:e})})})};tK.displayName="Sidebar";Object.assign(tK,{Collapse:WH,CTA:YH,Item:QH,Items:JH,ItemGroup:ZH,Logo:eK});const nK=v.createContext(void 0);function Xpe(){const e=v.useContext(nK);if(!e)throw new Error("useTableBodyContext should be used within the TableBodyContext provider!");return e}const rK=v.createContext(void 0);function BO(){const e=v.useContext(rK);if(!e)throw new Error("useTableContext should be used within the TableContext provider!");return e}const aK=v.forwardRef(({children:e,className:t,theme:n={},...r},a)=>{const{theme:s}=BO(),o=Ne(s.body,n);return i.jsx(nK.Provider,{value:{theme:o},children:i.jsx("tbody",{className:ce(o.base,t),ref:a,...r,children:e})})});aK.displayName="Table.Body";const sK=v.forwardRef(({children:e,className:t,theme:n={},...r},a)=>{const{theme:s}=Xpe(),o=Ne(s.cell,n);return i.jsx("td",{className:ce(o.base,t),ref:a,...r,children:e})});sK.displayName="Table.Cell";const iK=v.createContext(void 0);function Qpe(){const e=v.useContext(iK);if(!e)throw new Error("useTableHeadContext should be used within the TableHeadContext provider!");return e}const oK=v.forwardRef(({children:e,className:t,theme:n={},...r},a)=>{const{theme:s}=BO(),o=Ne(s.head,n);return i.jsx(iK.Provider,{value:{theme:o},children:i.jsx("thead",{className:ce(o.base,t),ref:a,...r,children:i.jsx("tr",{children:e})})})});oK.displayName="Table.Head";const lK=v.forwardRef(({children:e,className:t,theme:n={},...r},a)=>{const{theme:s}=Qpe(),o=Ne(s.cell,n);return i.jsx("th",{className:ce(o.base,t),ref:a,...r,children:e})});lK.displayName="Table.HeadCell";const cK=v.forwardRef(({children:e,className:t,theme:n={},...r},a)=>{const{theme:s,hoverable:o,striped:l}=BO(),u=Ne(s.row,n);return i.jsx("tr",{ref:a,"data-testid":"table-row-element",className:ce(u.base,l&&u.striped,o&&u.hovered,t),...r,children:e})});cK.displayName="Table.Row";const uK=v.forwardRef(({children:e,className:t,striped:n,hoverable:r,theme:a={},...s},o)=>{const l=Ne(Ge().table,a);return i.jsx("div",{"data-testid":"table-element",className:ce(l.root.wrapper),children:i.jsxs(rK.Provider,{value:{theme:l,striped:n,hoverable:r},children:[i.jsx("div",{className:ce(l.root.shadow,t)}),i.jsx("table",{className:ce(l.root.base,t),...s,ref:o,children:e})]})})});uK.displayName="Table";Object.assign(uK,{Head:oK,Body:aK,Row:cK,Cell:sK,HeadCell:lK});const dK=({children:e,className:t})=>i.jsx("div",{className:t,children:e});dK.displayName="Tabs.Item";const fK=v.forwardRef(({children:e,className:t,onActiveTabChange:n,style:r="default",theme:a={},...s},o)=>{const l=Ne(Ge().tabs,a),u=v.useId(),d=v.useMemo(()=>v.Children.map(v.Children.toArray(e),({props:E})=>E),[e]),h=v.useRef([]),[p,g]=v.useState(Math.max(0,d.findIndex(E=>E.active))),[x,y]=v.useState(-1),w=E=>{g(E),n&&n(E)},j=({target:E})=>{w(E),y(E)},N=({event:E,target:O})=>{E.key==="ArrowLeft"&&y(Math.max(0,x-1)),E.key==="ArrowRight"&&y(Math.min(d.length-1,x+1)),E.key==="Enter"&&(w(O),y(O))},k=l.tablist.tabitem.styles[r],S=l.tabitemcontainer.styles[r];return v.useEffect(()=>{h.current[x]?.focus()},[x]),v.useImperativeHandle(o,()=>({setActiveTab:w})),i.jsxs("div",{className:ce(l.base,t),children:[i.jsx("div",{"aria-label":"Tabs",role:"tablist",className:ce(l.tablist.base,l.tablist.styles[r],t),...s,children:d.map((E,O)=>i.jsxs("button",{type:"button","aria-controls":`${u}-tabpanel-${O}`,"aria-selected":O===p,className:ce(l.tablist.tabitem.base,k.base,O===p&&k.active.on,O!==p&&!E.disabled&&k.active.off),disabled:E.disabled,id:`${u}-tab-${O}`,onClick:()=>j({target:O}),onKeyDown:T=>N({event:T,target:O}),ref:T=>h.current[O]=T,role:"tab",tabIndex:O===x?0:-1,style:{zIndex:O===x?2:1},children:[E.icon&&i.jsx(E.icon,{className:l.tablist.tabitem.icon}),E.title]},O))}),i.jsx("div",{className:ce(l.tabitemcontainer.base,S),children:d.map((E,O)=>i.jsx("div",{"aria-labelledby":`${u}-tab-${O}`,className:l.tabpanel,hidden:O!==p,id:`${u}-tabpanel-${O}`,role:"tabpanel",tabIndex:0,children:E.children},O))})]})});fK.displayName="Tabs";Object.assign(fK,{Item:dK});const Zpe=v.forwardRef(({className:e,color:t="gray",helperText:n,shadow:r,theme:a={},...s},o)=>{const l=Ne(Ge().textarea,a);return i.jsxs(i.Fragment,{children:[i.jsx("textarea",{ref:o,className:ce(l.base,l.colors[t],l.withShadow[r?"on":"off"],e),...s}),n&&i.jsx(_g,{color:t,children:n})]})});
485Zpe.displayName="Textarea";const hK=v.createContext(void 0);function UO(){const e=v.useContext(hK);if(!e)throw new Error("useTimelineContentContext should be used within the TimelineContentContext provider!");return e}const pK=({children:e,className:t,theme:n={},...r})=>{const{theme:a}=UO(),s=Ne(a.body,n);return i.jsx("div",{className:ce(s.base,t),...r,children:e})},mK=v.createContext(void 0);function qO(){const e=v.useContext(mK);if(!e)throw new Error("useTimelineContext should be used within the TimelineContext provider!");return e}const gK=v.createContext(void 0);function xK(){const e=v.useContext(gK);if(!e)throw new Error("useTimelineItemContext should be used within the TimelineItemContext provider!");return e}const bK=({children:e,className:t,theme:n={},...r})=>{const{horizontal:a}=qO(),{theme:s}=xK(),o=Ne(s.content,n);return i.jsx(hK.Provider,{value:{theme:o},children:i.jsx("div",{"data-testid":"timeline-content",className:ce(a&&o.root.base,t),...r,children:e})})},yK=({children:e,className:t,theme:n={},...r})=>{const{theme:a,horizontal:s}=qO(),o=Ne(a.item,n);return i.jsx(gK.Provider,{value:{theme:o},children:i.jsx("li",{"data-testid":"timeline-item",className:ce(s&&o.root.horizontal,!s&&o.root.vertical,t),...r,children:e})})},vK=({children:e,className:t,icon:n,theme:r={},...a})=>{const{horizontal:s}=qO(),{theme:o}=xK(),l=Ne(o.point,r);return i.jsxs("div",{"data-testid":"timeline-point",className:ce(s&&l.horizontal,!s&&l.vertical,t),...a,children:[e,n?i.jsx("span",{className:ce(l.marker.icon.wrapper),children:i.jsx(n,{"aria-hidden":!0,className:ce(l.marker.icon.base)})}):i.jsx("div",{className:ce(s&&l.marker.base.horizontal,!s&&l.marker.base.vertical)}),s&&i.jsx("div",{className:ce(l.line)})]})},wK=({children:e,className:t,theme:n={},...r})=>{const{theme:a}=UO(),s=Ne(a.time,n);return i.jsx("time",{className:ce(s.base,t),...r,children:e})},jK=({as:e="h3",children:t,className:n,theme:r={},...a})=>{const{theme:s}=UO(),o=Ne(s.title,r);return i.jsx(e,{className:ce(o.base,n),...a,children:t})},NK=({children:e,className:t,horizontal:n,theme:r={},...a})=>{const s=Ne(Ge().timeline,r);return i.jsx(mK.Provider,{value:{theme:s,horizontal:n},children:i.jsx("ol",{"data-testid":"timeline-component",className:ce(n&&s.root.direction.horizontal,!n&&s.root.direction.vertical,t),...a,children:e})})};NK.displayName="Timeline";yK.displayName="Timeline.Item";vK.displayName="Timeline.Point";bK.displayName="Timeline.Content";wK.displayName="Timeline.Time";jK.displayName="Timeline.Title";pK.displayName="Timeline.Body";Object.assign(NK,{Item:yK,Point:vK,Content:bK,Time:wK,Title:jK,Body:pK});const _K=v.createContext(void 0);function Jpe(){const e=v.useContext(_K);if(!e)throw new Error("useToastContext should be used within the ToastContext provider!");return e}const kK=({className:e,onClick:t,theme:n={},xIcon:r=sq,onDismiss:a,...s})=>{const{theme:o,duration:l,isClosed:u,isRemoved:d,setIsClosed:h,setIsRemoved:p}=Jpe(),g=Ne(o.toggle,n),x=y=>{if(t&&t(y),a){a();return}h(!u),setTimeout(()=>p(!d),l)};return i.jsx("button",{"aria-label":"Close",onClick:x,type:"button",className:ce(g.base,e),...s,children:i.jsx(r,{"aria-hidden":!0,className:g.icon})})},eme={75:"duration-75",100:"duration-100",150:"duration-150",200:"duration-200",300:"duration-300",500:"duration-500",700:"duration-700",1e3:"duration-1000"},SK=({children:e,className:t,duration:n=300,theme:r={},...a})=>{const[s,o]=v.useState(!1),[l,u]=v.useState(!1),d=Ne(Ge().toast,r);return l?null:i.jsx(_K.Provider,{value:{theme:d,duration:n,isClosed:s,isRemoved:l,setIsClosed:o,setIsRemoved:u},children:i.jsx("div",{"data-testid":"flowbite-toast",role:"alert",className:ce(d.root.base,eme[n],s&&d.root.closed,t),...a,children:e})})};SK.displayName="Toast";kK.displayName="Toast.Toggle";Object.assign(SK,{Toggle:kK});const tme=v.forwardRef(({checked:e,className:t,color:n="blue",sizing:r="md",disabled:a,label:s,name:o,onChange:l,theme:u={},...d},h)=>{const p=v.useId(),g=Ne(Ge().toggleSwitch,u),x=()=>l(!e),y=()=>{x()},w=j=>{j.code=="Enter"&&j.preventDefault()};return i.jsxs(i.Fragment,{children:[o&&e?i.jsx("input",{ref:h,checked:e,hidden:!0,name:o,readOnly:!0,t
485ype:"checkbox",className:"sr-only"}):null,i.jsxs("button",{"aria-checked":e,"aria-labelledby":`${p}-flowbite-toggleswitch-label`,disabled:a,id:`${p}-flowbite-toggleswitch`,onClick:y,onKeyDown:w,role:"switch",tabIndex:0,type:"button",className:ce(g.root.base,g.root.active[a?"off":"on"],t),...d,children:[i.jsx("div",{"data-testid":"flowbite-toggleswitch-toggle",className:ce(g.toggle.base,g.toggle.checked[e?"on":"off"],e&&g.toggle.checked.color[n],g.toggle.sizes[r])}),s?.length?i.jsx("span",{"data-testid":"flowbite-toggleswitch-label",id:`${p}-flowbite-toggleswitch-label`,className:g.root.label,children:s}):null]})]})});tme.displayName="ToggleSwitch";const CK="flex-1 overflow-auto relative",nme=`${CK} p-4 lg:p-8`,rme=`${CK} lg:p-8`,EK="flex flex-col lg:flex-row h-[100dvh] lg:h-screen",ame=`${EK} bg-canvas`,sme="hidden lg:flex absolute top-8 right-8 z-30",OBe="lg:pr-[84px]",ime=`${EK} bg-canvas lg:bg-white`,ome=v.lazy(()=>nr(()=>import("./HelpDrawer-utPzgvVI.js"),__vite__mapDeps([0,1,2,3])));function lme(){const{isLoading:e}=ns(),t=$n(n=>n.helpDrawerOpen);return e?i.jsx("div",{className:"h-screen w-screen flex items-center justify-center",children:i.jsx(Dt,{size:"xl"})}):i.jsxs("div",{className:ame,children:[i.jsx(YU,{}),i.jsx(wue,{}),i.jsx(_ue,{}),i.jsxs("main",{className:nme,children:[i.jsx(eq,{className:sme}),i.jsx(yg,{})]}),t&&i.jsx(v.Suspense,{fallback:null,children:i.jsx(ome,{})})]})}const Wt={heading:"Verify your email address",lede:"We sent a verification link to",checkIdle:"I've verified â continue",checkWorking:"Checkingâ¦",checkRetry:"Check again",resendIdle:"Resend verification email",resendRetry:"Try again",resendCoolingDown:e=>`You can resend in ${e}`,signOut:"Sign out",footerHelp:"Can't find it? Check your spam folder, or email us at",supportEmail:"[email protected]",footerWrongAddress:"Wrong address? Sign out and start again with the right one.",resendSent:"New link sent. Any earlier links have stopped working.",resendThrottled:"You just asked for one. Give it a minute â the link we already sent still works.",resendFailed:"We couldn't send that email just now. Try again in a moment, or email [email protected].",stillUnverified:"That address still isn't verified. Open the link in the email first, then check again.",checkFailed:"We couldn't check just now. Try again in a moment.",unavailableHeading:"We couldn't check your account",unavailableLede:"This usually clears on its own, and we keep trying in the background for a while. If it does not, try now or sign in again.",unavailableRetry:"Try now",unavailableFooter:"If this keeps happening, email us at"},vI={declined:"The sign-in request was declined.",generic:"Something went wrong on the way back from the sign-in page. Try again â if it keeps happening, email [email protected]."};function OK({error:e,errorDescription:t}){return e?e==="access_denied"&&!!t?.includes("verify your email")?"email-verification":"error":"ok"}function AK({error:e}){return e==="access_denied"?vI.declined:vI.generic}function cme({isAuthenticated:e,isLoading:t,hasError:n}){return!e&&!t&&!n}const ume="/dashboard";function TK(e){if(typeof e!="string")return null;const t=e.trim().replace(/[\t\n\r]/g,"");return!t||!t.startsWith("/")||t.startsWith("//")||t.startsWith("/\\")?
485null:t}function dme(e){return`${e.pathname}${e.search??""}${e.hash??""}`}function fme(){const{isAuthenticated:e,isLoading:t,error:n,loginWithRedirect:r}=ns(),a=Gr(),s=TK(a.state?.returnTo),o=()=>r({...s?{appState:{returnTo:s}}:{},authorizationParams:{prompt:"select_account"}});if(v.useEffect(()=>{cme({isAuthenticated:e,isLoading:t,hasError:!!n})&&o()},[e,t,n,r]),v.useEffect(()=>{n&&console.warn("[LoginPage] auth error present; not restarting login automatically",{message:n.message})},[n]),e)return i.jsx(fr,{to:s??"/spreadsheets",replace:!0});if(n){const l={error:"access_denied",errorDescription:n.message};if(OK(l)==="email-verification"){const d=new URLSearchParams({error:"access_denied",error_description:n.message});return i.jsx(fr,{to:`/verify?${d.toString()}`,replace:!0})}const u=AK(l);return i.jsx("div",{className:"min-h-[100dvh] flex items-center justify-center bg-canvas px-5 py-6",children:i.jsxs("div",{"data-testid":"login-error-card",className:"max-w-md w-full text-center",children:[i.jsx("div",{className:"mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-badge-red text-amount-neg mb-[18px]",children:i.jsx(Qt,{className:"h-8 w-8"})}),i.jsx("h1",{className:"text-[21px] font-extrabold tracking-tight text-slate-900 mb-2",children:"Couldn't sign you in"}),i.jsx("p",{className:"text-slate-600 leading-relaxed mb-[22px]",children:u}),i.jsxs(mt,{onClick:o,color:"gray",className:"w-full h-[46px]",outline:!0,children:[i.jsx(dt,{className:"w-4 h-4 mr-2"}),"Try again"]}),i.jsx("p",{className:"mt-5 text-[12.5px] text-slate-500 leading-relaxed",children:"Still stuck? Contact support at [email protected]."})]})})}return null}function PK(e,t){return function(){return e.apply(t,arguments)}}const{toString:hme}=Object.prototype,{getPrototypeOf:HO}=Object,{iterator:m1,toStringTag:RK}=Symbol,g1=(e=>t=>{const n=hme.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ai=e=>(e=e.toLowerCase(),t=>g1(t)===e),x1=e=>t=>typeof t===e,{isArray:mh}=Array,qm=x1("undefined");function pme(e){return e!==null&&!qm(e)&&e.constructor!==null&&!qm(e.constructor)&&ba(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const MK=ai("ArrayBuffer");function mme(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&MK(e.buffer),t}const gme=x1("string"),ba=x1("function"),DK=x1("number"),b1=e=>e!==null&&typeof e=="object",xme=e=>e===!0||e===!1,H0=e=>{if(g1(e)!=="object")return!1;const t=HO(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(RK in e)&&!(m1 in e)},bme=ai("Date"),yme=ai("File"),vme=ai("Blob"),wme=ai("FileList"),jme=e=>b1(e)&&ba(e.pipe),Nme=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ba(e.append)&&((t=g1(e))==="formdata"||t==="object"&&ba(e.toString)&&e.toString()==="[object FormData]"))},_me=ai("URLSearchParams"),[kme,Sme,Cme,Eme]=["ReadableStream","Request","Response","Headers"].map(ai),Ome=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Og(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),mh(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let l;for(r=0;r<o;r++)l=s[r],t.call(null,e[l],l,e)}}function $K(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,a;for(;r-- >0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Jc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,IK=e=>!qm(e)&&e!==Jc;function GS(){const{caseless:e}=IK(this)&&this||{},t={},n=(r,a)=>{const s=e&&$K(t,a)||a;H0(t[s])&&H0(r)?t[s]=GS(t[s],r):H0(r)?t[s]=GS({},r):mh(r)?t[s]=r.slice():t[s]=r};for(let r=0,a=arguments.length;r<a;r++)arguments[r]&&Og(arguments[r],n);return t}const Ame=(e,t,n,{allOwnKeys:r}={})=>(Og(t,(a,s)=>{n&&ba(a)?e[s]=PK(a,n):e[s]=a},{allOwnKeys:r}),e),Tme=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Pme=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Rme=(e,t,n,r)=>{let a,s,o;const l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),s=a.length;s-- >0;
485)o=a[s],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&HO(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Mme=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Dme=e=>{if(!e)return null;if(mh(e))return e;let t=e.length;if(!DK(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},$me=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&HO(Uint8Array)),Ime=(e,t)=>{const r=(e&&e[m1]).call(e);let a;for(;(a=r.next())&&!a.done;){const s=a.value;t.call(e,s[0],s[1])}},Lme=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Fme=ai("HTMLFormElement"),zme=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),wI=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Bme=ai("RegExp"),LK=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Og(n,(a,s)=>{let o;(o=t(a,s,e))!==!1&&(r[s]=o||a)}),Object.defineProperties(e,r)},Ume=e=>{LK(e,(t,n)=>{if(ba(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ba(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},qme=(e,t)=>{const n={},r=a=>{a.forEach(s=>{n[s]=!0})};return mh(e)?r(e):r(String(e).split(t)),n},Hme=()=>{},Kme=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Vme(e){return!!(e&&ba(e.append)&&e[RK]==="FormData"&&e[m1])}const Gme=e=>{const t=new Array(10),n=(r,a)=>{if(b1(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[a]=r;const s=mh(r)?[]:{};return Og(r,(o,l)=>{const u=n(o,a+1);!qm(u)&&(s[l]=u)}),t[a]=void 0,s}}return r};return n(e,0)},Wme=ai("AsyncFunction"),Yme=e=>e&&(b1(e)||ba(e))&&ba(e.then)&&ba(e.catch),FK=((e,t)=>e?setImmediate:t?((n,r)=>(Jc.addEventListener("message",({source:a,data:s})=>{a===Jc&&s===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Jc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ba(Jc.postMessage)),Xme=typeof queueMicrotask<"u"?queueMicrotask.bind(Jc):typeof process<"u"&&process.nextTick||FK,Qme=e=>e!=null&&ba(e[m1]),oe={isArray:mh,isArrayBuffer:MK,isBuffer:pme,isFormData:Nme,isArrayBufferView:mme,isString:gme,isNumber:DK,isBoolean:xme,isObject:b1,isPlainObject:H0,isReadableStream:kme,isRequest:Sme,isResponse:Cme,isHeaders:Eme,isUndefined:qm,isDate:bme,isFile:yme,isBlob:vme,isRegExp:Bme,isFunction:ba,isStream:jme,isURLSearchParams:_me,isTypedArray:$me,isFileList:wme,forEach:Og,merge:GS,extend:Ame,trim:Ome,stripBOM:Tme,inherits:Pme,toFlatObject:Rme,kindOf:g1,kindOfTest:ai,endsWith:Mme,toArray:Dme,forEachEntry:Ime,matchAll:Lme,isHTMLForm:Fme,hasOwnProperty:wI,hasOwnProp:wI,reduceDescriptors:LK,freezeMethods:Ume,toObjectSet:qme,toCamelCase:zme,noop:Hme,toFiniteNumber:Kme,findKey:$K,global:Jc,isContextDefined:IK,isSpecCompliantForm:Vme,toJSONObject:Gme,isAsyncFn:Wme,isThenable:Yme,setImmediate:FK,asap:Xme,isIterable:Qme};function nt(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}oe.inherits(nt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.status}}});const zK=nt.prototype,BK={};
vendor: 13,507 bytes, lines 485-487
485["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{BK[e]={value:e}});Object.defineProperties(nt,BK);Object.defineProperty(zK,"isAxiosError",{value:!0});nt.from=(e,t,n,r,a,s)=>{const o=Object.create(zK);return oe.toFlatObject(e,o,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),nt.call(o,e.message,t,n,r,a),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const Zme=null;function WS(e){return oe.isPlainObject(e)||oe.isArray(e)}function UK(e){return oe.endsWith(e,"[]")?e.slice(0,-2):e}function jI(e,t,n){return e?e.concat(t).map(function(a,s){return a=UK(a),!n&&s?"["+a+"]":a}).join(n?".":""):t}function Jme(e){return oe.isArray(e)&&!e.some(WS)}const ege=oe.toFlatObject(oe,{},null,function(t){return/^is[A-Z]/.test(t)});function y1(e,t,n){if(!oe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,j){return!oe.isUndefined(j[w])});const r=n.metaTokens,a=n.visitor||h,s=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(t);if(!oe.isFunction(a))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(oe.isDate(y))return y.toISOString();if(oe.isBoolean(y))return y.toString();if(!u&&oe.isBlob(y))throw new nt("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(y)||oe.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,j){let N=y;if(y&&!j&&typeof y=="object"){if(oe.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(oe.isArray(y)&&Jme(y)||(oe.isFileList(y)||oe.endsWith(w,"[]"))&&(N=oe.toArray(y)))return w=UK(w),N.forEach(function(S,E){!(oe.isUndefined(S)||S===null)&&t.append(o===!0?jI([w],E,s):o===null?w:w+"[]",d(S))}),!1}return WS(y)?!0:(t.append(jI(j,w,s),d(y)),!1)}const p=[],g=Object.assign(ege,{defaultVisitor:h,convertValue:d,isVisitable:WS});function x(y,w){if(!oe.isUndefined(y)){if(p.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));p.push(y),oe.forEach(y,function(N,k){(!(oe.isUndefined(N)||N===null)&&a.call(t,N,oe.isString(k)?k.trim():k,w,g))===!0&&x(N,w?w.concat(k):[k])}),p.pop()}}if(!oe.isObject(e))throw new TypeError("data must be an object");return x(e),t}function NI(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function KO(e,t){this._pairs=[],e&&y1(e,this,t)}const qK=KO.prototype;qK.append=function(t,n){this._pairs.push([t,n])};qK.toString=function(t){const n=t?function(r){return t.call(this,r,NI)}:NI;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function tge(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function HK(e,t,n){if(!t)return e;const r=n&&n.encode||tge;oe.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let s;if(a?s=a(t,n):s=oe.isURLSearchParams(t)?t.toString():new KO(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class _I{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){oe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const KK={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},nge=typeof URLSearchParams<"u"?URLSearchParams:KO,rge=typeof FormData<"u"?FormData:null,age=typeof Blob<"u"?Blob:null,sge={isBrowser:!0,classes:{URLSearchParams:nge,FormData:rge,Blob:age},protocols:["http","https","file","blob","url","data"]},VO=typeof window<"u"&&typeof document<"u",YS=typeof navigator=="object"&&navigator||void 0,ige=VO&&(!YS||["ReactNative","NativeScript","NS"].indexOf(YS.product)<0),oge=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",lge=VO&&window.location.href||"http://localhost",cge=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:VO,hasStandardBrowserEnv:ige,hasStandardBrowserWebWorkerEnv:oge,navigator:YS,origin:lge},Symbol.toStringTag,{value:"Module"})),Kr={...cge,...sge};function uge(e,t){return y1(e,new Kr.classes.URLSearchParams,Object.assign({visitor:function(n,r,a,s){return Kr.isNode&&oe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function dge(e){return oe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fge(e){const t={},n=Object.keys(e);let r;const a=n.length;let s;for(r=0;r<a;r++)s=n[r],t[s]=e[s];return t}function VK(e){function t(n,r,a,s){let o=n[s++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),u=s>=n.length;return o=!o&&oe.isArray(a)?a.length:o,u?(oe.hasOwnProp(a,o)?a[o]=[a[o],r]:a[o]=r,!l):((!a[o]||!oe.isObject(a[o]))&&(a[o]=[]),t(n,r,a[o],s)&&oe.isArray(a[o])&&(a[o]=fge(a[o])),!l)}if(oe.isFormData(e)&&oe.isFunction(e.entries)){const n={};return oe.forEachEntry(e,(r,a)=>{t(dge(r),a,n,0)}),n}return null}function hge(e,t,n){if(oe.isString(e))try{return(t||JSON.parse)(e),oe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Ag={transitional:KK,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,s=oe.isObject(t);if(s&&oe.isHTMLForm(t)&&(t=new FormData(t)),oe.isFormData(t))return a?JSON.stringify(VK(t)):t;if(oe.isArrayBuffer(t)||oe.isBuffer(t)||oe.isStream(t)||oe.isFile(t)||oe.isBlob(t)||oe.isReadableStream(t))return t;if(oe.isArrayBufferView(t))return t.buffer;if(oe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return uge(t,this.formSerializer).toString();if((l=oe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return y1(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||a?(n.setContentType("application/json",!1),hge(t)):t}],transformResponse:[function(t){const n=this.transitional||Ag.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(oe.isResponse(t)||oe.isReadableStream(t))return t;if(t&&oe.isString(t)&&(r&&!this.responseType||a)){const o=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?nt.from(l,nt.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kr.classes.FormData,Blob:Kr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],e=>{Ag.headers[e]={}});const pge=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),mge=e=>{const t={};let n,r,a;return e&&e.split(` 486`).forEach(function(o){a=o.indexOf(":"),n=o.substring(0,a).trim().toLowerCase(),r=o.substring(a+1).trim(),!(!n||t[n]&&pge[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},kI=Symbol("internals");function qp(e){return e&&String(e).trim().toLowerCase()}function K0(e){return e===!1||e==null?e:oe.isArray(e)?e.map(K0):String(e)}function gge(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const xge=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lk(e,t,n,r,a){if(oe.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!oe.isString(t)){if(oe.isString(r))return t.indexOf(r)!==-1;if(oe.isRegExp(r))return r.test(t)}}function bge(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function yge(e,t){const n=oe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,s,o){return this[r].call(this,t,a,s,o)},configurable:!0})})}let ya=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function s(l,u,d){const h=qp(u);if(!h)throw new Error("header name must be a non-empty string");const p=oe.findKey(a,h);(!p||a[p]===void 0||d===!0||d===void 0&&a[p]!==!1)&&(a[p||u]=K0(l))}const o=(l,u)=>oe.forEach(l,(d,h)=>s(d,h,u));if(oe.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(oe.isString(t)&&(t=t.trim())&&!xge(t))o(mge(t),n);else if(oe.isObject(t)&&oe.isIterable(t)){let l={},u,d;for(const h of t){if(!oe.isArray(h))throw TypeError("Object iterator must return a key-value pair");l[d=h[0]]=(u=l[d])?oe.isArray(u)?[...u,h[1]]:[u,h[1]]:h[1]}o(l,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=qp(t),t){const r=oe.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return gge(a);if(oe.isFunction(n))return n.call(this,a,r);if(oe.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=qp(t),t){const r=oe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||lk(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function s(o){if(o=qp(o),o){const l=oe.findKey(r,o);l&&(!n||lk(r,r[l],l,n))&&(delete r[l],a=!0)}}return oe.isArray(t)?t.forEach(s):s(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const s=n[r];(!t||lk(this,this[s],s,t,!0))&&(delete this[s],a=!0)}return a}normalize(t){const n=this,r={};return oe.forEach(this,(a,s)=>{const o=oe.findKey(r,s);if(o){n[o]=K0(a),delete n[s];return}const l=t?bge(s):String(s).trim();l!==s&&delete n[s],n[l]=K0(a),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return oe.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` 487`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[kI]=this[kI]={accessors:{}}).accessors,a=this.prototype;function s(o){const l=qp(o);r[l]||(yge(a,o),r[l]=!0)}return oe.isArray(t)?t.forEach(s):s(t),this}};ya.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);oe.reduceDescriptors(ya.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});oe.freezeMethods(ya);function ck(e,t){const n=this||Ag,r=t||n,a=ya.from(r.headers);let s=r.data;return oe.forEach(e,function(l){s=l.call(n,s,a.normalize(),t?t.status:void 0)}),a.normalize(),s}function GK(e){return!!(e&&e.__CANCEL__)}function gh(e,t,n){nt.call(this,e??"canceled",nt.ERR_CANCELED,t,n),this.name="CanceledError"}oe.inherits(gh,nt,{__CANCEL__:!0});function WK(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vge(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function wge(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,s=0,o;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),h=r[s];o||(o=d),n[a]=u,r[a]=d;let p=s,g=0;for(;p!==a;)g+=n[p++],p=p%e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),d-o<t)return;const x=h&&d-h;return x?Math.round(g*1e3/x):void 0}}function jge(e,t){let n=0,r=1e3/t,a,s;const o=(d,h=Date.now())=>{n=h,a=null,s&&(clearTimeout(s),s=null),e.apply(null,d)};return[(...d)=>{const h=Date.now(),p=h-n;p>=r?o(d,h):(a=d,s||(s=setTimeout(()=>{s=null,o(a)},r-p)))},()=>a&&o(a)]}const By=(e,t,n=3)=>{let r=0;const a=wge(50,250);return jge(s=>{const o=s.loaded,l=s.lengthComputable?s.total:void 0,u=o-r,d=a(u),h=o<=l;r=o;const p={loaded:o,total:l,progress:l?o/l:void 0,bytes:u,rate:d||void 0,estimated:d&&l&&h?(l-o)/d:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},n)},SI=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},CI=e=>(...t)=>oe.asap(()=>e(...t)),Nge=Kr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Kr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Kr.origin),Kr.navigator&&/(msie|trident)/i.test(Kr.navigator.userAgent)):()=>!0,_ge=Kr.hasStandardBrowserEnv?{write(e,t,n,r,a,s){const o=[e+"="+encodeURIComponent(t)];oe.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&o.push("path="+r),oe.isString(a)&&o.push("domain="+a),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function kge(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Sge(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}
487function YK(e,t,n){let r=!kge(t);return e&&(r||n==!1)?Sge(e,t):t}const EI=e=>e instanceof ya?{...e}:e;function Cu(e,t){t=t||{};const n={};function r(d,h,p,g){return oe.isPlainObject(d)&&oe.isPlainObject(h)?oe.merge.call({caseless:g},d,h):oe.isPlainObject(h)?oe.merge({},h):oe.isArray(h)?h.slice():h}function a(d,h,p,g){if(oe.isUndefined(h)){if(!oe.isUndefined(d))return r(void 0,d,p,g)}else return r(d,h,p,g)}function s(d,h){if(!oe.isUndefined(h))return r(void 0,h)}function o(d,h){if(oe.isUndefined(h)){if(!oe.isUndefined(d))return r(void 0,d)}else return r(void 0,h)}function l(d,h,p){if(p in t)return r(d,h);if(p in e)return r(void 0,d)}const u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(d,h,p)=>a(EI(d),EI(h),p,!0)};return oe.forEach(Object.keys(Object.assign({},e,t)),function(h){const p=u[h]||a,g=p(e[h],t[h],h);oe.isUndefined(g)&&p!==l||(n[h]=g)}),n}const XK=e=>{const t=Cu({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:s,headers:o,auth:l}=t;t.headers=o=ya.from(o),t.url=HK(YK(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(oe.isFormData(n)){if(Kr.hasStandardBrowserEnv||Kr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[d,...h]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];o.setContentType([d||"multipart/form-data",...h].join("; "))}}if(Kr.hasStandardBrowserEnv&&(r&&oe.isFunction(r)&&(r=r(t)),r||r!==!1&&Nge(t.url))){const d=a&&s&&_ge.read(s);d&&o.set(a,d)}return t},Cge=typeof XMLHttpRequest<"u",Ege=Cge&&function(e){return new Promise(function(n,r){const a=XK(e);let s=a.data;const o=ya.from(a.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:d}=a,h,p,g,x,y;function w(){x&&x(),y&&y(),a.cancelToken&&a.cancelToken.unsubscribe(h),a.signal&&a.signal.removeEventListener("abort",h)}let j=new XMLHttpRequest;j.open(a.method.toUpperCase(),a.url,!0),j.timeout=a.timeout;function N(){if(!j)return;const S=ya.from("getAllResponseHeaders"in j&&j.getAllResponseHeaders()),O={data:!l||l==="text"||l==="json"?j.responseText:j.response,status:j.status,statusText:j.statusText,headers:S,config:e,request:j};WK(function(P){n(P),w()},function(P){r(P),w()},O),j=null}"onloadend"in j?j.onloadend=N:j.onreadystatechange=function(){!j||j.readyState!==4||j.status===0&&!(j.responseURL&&j.responseURL.indexOf("file:")===0)||setTimeout(N)},j.onabort=function(){j&&(r(new nt("Request aborted",nt.ECONNABORTED,e,j)),j=null)}
487,j.onerror=function(){r(new nt("Network Error",nt.ERR_NETWORK,e,j)),j=null},j.ontimeout=function(){let E=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const O=a.transitional||KK;a.timeoutErrorMessage&&(E=a.timeoutErrorMessage),r(new nt(E,O.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,e,j)),j=null},s===void 0&&o.setContentType(null),"setRequestHeader"in j&&oe.forEach(o.toJSON(),function(E,O){j.setRequestHeader(O,E)}),oe.isUndefined(a.withCredentials)||(j.withCredentials=!!a.withCredentials),l&&l!=="json"&&(j.responseType=a.responseType),d&&([g,y]=By(d,!0),j.addEventListener("progress",g)),u&&j.upload&&([p,x]=By(u),j.upload.addEventListener("progress",p),j.upload.addEventListener("loadend",x)),(a.cancelToken||a.signal)&&(h=S=>{j&&(r(!S||S.type?new gh(null,e,j):S),j.abort(),j=null)},a.cancelToken&&a.cancelToken.subscribe(h),a.signal&&(a.signal.aborted?h():a.signal.addEventListener("abort",h)));const k=vge(a.url);if(k&&Kr.protocols.indexOf(k)===-1){r(new nt("Unsupported protocol "+k+":",nt.ERR_BAD_REQUEST,e));return}j.send(s||null)})},Oge=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const s=function(d){if(!a){a=!0,l();const h=d instanceof Error?d:this.reason;r.abort(h instanceof nt?h:new gh(h instanceof Error?h.message:h))}};let o=t&&setTimeout(()=>{o=null,s(new nt(`timeout ${t} of ms exceeded`,nt.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>
487oe.asap(l),u}},Age=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,a;for(;r<n;)a=r+t,yield e.slice(r,a),r=a},Tge=async function*(e,t){for await(const n of Pge(e))yield*Age(n,t)},Pge=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},OI=(e,t,n,r)=>{const a=Tge(e,t);let s=0,o,l=u=>{o||(o=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:d,value:h}=await a.next();if(d){l(),u.close();return}let p=h.byteLength;if(n){let g=s+=p;n(g)}u.enqueue(new Uint8Array(h))}catch(d){throw l(d),d}},cancel(u){return l(u),a.return()}},{highWaterMark:2})},v1=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",QK=v1&&typeof ReadableStream=="function",Rge=v1&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ZK=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Mge=QK&&ZK(()=>{let e=!1;const t=new Request(Kr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),AI=64*1024,XS=QK&&ZK(()=>oe.isReadableStream(new Response("").body)),Uy={stream:XS&&(e=>e.body)};v1&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Uy[t]&&(Uy[t]=oe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new nt(`Response type '${t}' is not supported`,nt.ERR_NOT_SUPPORT,r)})})})(new Response);const Dge=async e=>{if(e==null)return 0;if(oe.isBlob(e))return e.size;if(oe.isSpecCompliantForm(e))return(await new Request(Kr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(oe.isArrayBufferView(e)||oe.isArrayBuffer(e))return e.byteLength;if(oe.isURLSearchParams(e)&&(e=e+""),oe.isString(e))return(await Rge(e)).byteLength},$ge=async(e,t)=>{const n=oe.toFiniteNumber(e.getContentLength());return n??Dge(t)},Ige=v1&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:s,timeout:o,onDownloadProgress:l,onUploadProgress:u,responseType:d,headers:h,withCredentials:p="same-origin",fetchOptions:g}=XK(e);d=d?(d+"").toLowerCase():"text";let x=Oge([a,s&&s.toAbortSignal()],o),y;const w=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let j;try{if(u&&Mge&&n!=="get"&&n!=="head"&&(j=await $ge(h,r))!==0){let O=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(oe.isFormData(r)&&(T=O.headers.get("content-type"))&&h.setContentType(T),O.body){const[P,M]=SI(j,By(CI(u)));r=OI(O.body,AI,P,M)}}oe.isString(p)||(p=p?"include":"omit");const N="credentials"in Request.prototype;y=new Request(t,{...g,signal:x,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:N?p:void 0});let k=await fetch(y,g);const S=XS&&(d==="stream"||d==="response");if(XS&&(l||S&&w)){const O={};["status","statusText","headers"].forEach(D=>{O[D]=k[D]});const T=oe.toFiniteNumber(k.headers.get("content-length")),[P,M]=l&&SI(T,By(CI(l),!0))||[];k=new Response(OI(k.body,AI,P,()=>{M&&M(),w&&w()}),O)}d=d||"text";let E=await Uy[oe.findKey(Uy,d)||"text"](k,e);return!S&&w&&w(),await new Promise((O,T)=>{WK(O,T,{data:E,headers:ya.from(k.headers),status:k.status,statusText:k.statusText,config:e,request:y})})}catch(N){throw w&&w(),N&&N.name==="TypeError"&&/Load failed|fetch/i.test(N.message)?Object.assign(new nt("Network Error",nt.E
487RR_NETWORK,e,y),{cause:N.cause||N}):nt.from(N,N&&N.code,e,y)}}),QS={http:Zme,xhr:Ege,fetch:Ige};oe.forEach(QS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const TI=e=>`- ${e}`,Lge=e=>oe.isFunction(e)||e===null||e===!1,JK={getAdapter:e=>{e=oe.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let s=0;s<t;s++){n=e[s];let o;if(r=n,!Lge(n)&&(r=QS[(o=String(n)).toLowerCase()],r===void 0))throw new nt(`Unknown adapter '${o}'`);if(r)break;a[o||"#"+s]=r}if(!r){const s=Object.entries(a).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since : 488`+s.map(TI).join(` 489`):" "+TI(s[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:QS};function uk(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gh(null,e)}function PI(e){return uk(e),e.headers=ya.from(e.headers),e.data=ck.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),JK.getAdapter(e.adapter||Ag.adapter)(e).then(function(r){return uk(e),r.data=ck.call(e,e.transformResponse,r),r.headers=ya.from(r.headers),r},function(r){return GK(r)||(uk(e),r&&r.response&&(r.response.data=ck.call(e,e.transformResponse,r.response),r.response.headers=ya.from(r.response.headers))),Promise.reject(r)})}const eV="1.10.0",w1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{w1[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const RI={};w1.transitional=function(t,n,r){function a(s,o){return"[Axios v"+eV+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,l)=>{if(t===!1)throw new nt(a(o," has been removed"+(n?" in "+n:"")),nt.ERR_DEPRECATED);return n&&!RI[o]&&(RI[o]=!0,console.warn(a(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,l):!0}};w1.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Fge(e,t,n){if(typeof e!="object")throw new nt("options must be an object",nt.E
vendor: 4,090 bytes, lines 489-490
489RR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const s=r[a],o=t[s];if(o){const l=e[s],u=l===void 0||o(l,s,e);if(u!==!0)throw new nt("option "+s+" must be "+u,nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new nt("Unknown option "+s,nt.ERR_BAD_OPTION)}}const V0={assertOptions:Fge,validators:w1},di=V0.validators;let uu=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _I,response:new _I}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const s=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` 490`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cu(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:s}=n;r!==void 0&&V0.assertOptions(r,{silentJSONParsing:di.transitional(di.boolean),forcedJSONParsing:di.transitional(di.boolean),clarifyTimeoutError:di.transitional(di.boolean)},!1),a!=null&&(oe.isFunction(a)?n.paramsSerializer={serialize:a}:V0.assertOptions(a,{encode:di.function,serialize:di.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),V0.assertOptions(n,{baseUrl:di.spelling("baseURL"),withXsrfToken:di.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&oe.merge(s.common,s[n.method]);s&&oe.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),n.headers=ya.concat(o,s);const l=[];let u=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(u=u&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let h,p=0,g;if(!u){const y=[PI.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,d),g=y.length,h=Promise.resolve(n);p<g;)h=h.then(y[p++],y[p++]);return h}g=l.length;let x=n;for(p=0;p<g;){const y=l[p++],w=l[p++];try{x=y(x)}catch(j){w.call(this,j);break}}try{h=PI.call(this,x)}catch(y){return Promise.reject(y)}for(p=0,g=d.length;p<g;)h=h.then(d[p++],d[p++]);return h}getUri(t){t=Cu(this.defaults,t);const n=YK(t.baseURL,t.url,t.allowAbsoluteUrls);return HK(n,t.params,t.paramsSerializer)}};oe.forEach(["delete","get","head","options"],function(t){uu.prototype[t]=function(n,r){return this.request(Cu(r||{},{method:t,url:n,data:(r||{}).data}))}});oe.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,l){return this.request(Cu(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}uu.prototype[t]=n(),uu.prototype[t+"Form"]=n(!0)});let zge=class tV{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(a=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](a);r._listeners=null}),this.promise.then=a=>{let s;const o=new Promise(l=>{r.subscribe(l),s=l}).then(a);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,l){r.reason||(r.reason=new gh(s,o,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new tV(function(a){t=a}),cancel:t}}};function Bge(e){return function(n){return e.apply(null,n)}}function Uge(e){return oe.isObject(e)&&e.isAxiosError===!0}const ZS={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
490alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ZS).forEach(([e,t])=>{ZS[t]=e});function nV(e){const t=new uu(e),n=PK(uu.prototype.request,t);return oe.extend(n,uu.prototype,t,{allOwnKeys:!0}),oe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return nV(Cu(e,a))},n}const In=nV(Ag);In.Axios=uu;In.CanceledError=gh;In.CancelToken=zge;In.isCancel=GK;In.VERSION=eV;In.toFormData=y1;In.AxiosError=nt;In.Cancel=In.CanceledError;In.all=function(t){return Promise.all(t)};In.spread=Bge;In.isAxiosError=Uge;In.mergeConfig=Cu;In.AxiosHeaders=ya;In.formToJSON=e=>VK(oe.isHTMLForm(e)?new FormData(e):e);In.getAdapter=JK.getAdapter;In.HttpStatusCode=ZS;In.default=In;const{Axios:PBe,AxiosError:RBe,CanceledError:MBe,isCancel:DBe,CancelToken:$Be,VERSION:IBe,all:LBe,Cancel:FBe,isAxiosError:zBe,spread:BBe,toFormData:UBe,AxiosHeaders:qBe,HttpStatusCode:HBe,formToJSON:KBe,getAdapter:VBe,mergeConfig:GBe}=In,qge=e=>e?.email_verified===!0,rV="EmailNotVerified",GO="ml.emailVerified.",Hge=e=>{try{localStorage.setItem(`${GO}${e}`,"1")}catch{}},MI=e=>{if(!e)return!1;try{return localStorage.getItem(`${GO}${e}`)==="1"}catch{return!1}},Kge=e=>{if(e)try{localStorage.removeItem(`${GO}${e}`)}catch{}},Vge=1e3,Gge=6e4,Wge=5*60*1e3,Yge=5e3,DI=5,Xge=e=>{const t=e?.statusCode;return typeof t!="number"?!0:t!==400&&t!==401&&t!==403&&t!==404},aV=e=>{const t=e,n=typeof t?.retryAfterMs=="number"?t.retryAfterMs:t?.data?.retryAfterMs;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:null},Qge=(e,t=1)=>{const n=aV(e);if(n!==null)return Math.min(Math.max(n,Vge),Wge);const r=Yge*2**Math.max(0,t-1);return Math.min(r,Gge)},Zge=e=>{const t=Math.max(0,Math.ceil(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,"0")}`},Jge="auth_token";let WO=null;const exe=e=>{const t=e;if(t?.code===rV)return!1;const n=t?.statusCode;return n===401||n===403},txe=1e3,nxe=15e3,rxe=(e,t)=>{const n=aV(e);return n!==null?n>nxe?null:n:txe*2**(Math.max(1,t)-1)},axe=e=>{WO=e},sxe=()=>{WO=null,localStorage.removeItem(Jge)},Et=()=>WO;
490class ma extends Error{constructor(t,n,r,a){super(t),this.statusCode=n,this.code=r,this.data=a,this.name="ApiError"}}const ixe="https://receipts-be-prod.moneylogz.com/api",Je=In.create({baseURL:ixe,withCredentials:!0,headers:{"Content-Type":"application/json","requested-by-client":"web"}});Je.interceptors.request.use(e=>{const t=Et();return t&&(e.headers.Authorization=`Bearer ${t}`),e});Je.interceptors.response.use(e=>e,e=>{if(e.response){const t=e.response.data;throw new ma(t?.message||"An error occurred",e.response.status,t?.code,t)}else throw e.request?e.code==="ERR_NETWORK"?new ma("Network error. Please check your connection."):new ma("No response received from server"):new ma(e.message||"An unexpected error occurred")});const Oa=async()=>{const{data:e}=await Je.get("/me",{headers:{"Content-Type":"application/json","requested-by-client":"web"}});if(!e.success||!e.data)throw new Error("Failed to fetch user data");return e.data},oxe=async e=>{const{data:t}=await Je.delete(`/accounts/${e}`);if(!t.success)throw new Error(t.message||"Failed to delete account")},lxe=async(e,t)=>{const{data:n}=await Je.post(`/accounts/${e}`,{newTitle:t});if(!n.success)throw new Error(n.message||"Failed to update account title");return n.data},cxe=async e=>{const{data:t}=await Je.get("/plaid/balances",{params:void 0});if(!t.success||!t.data)throw new Error("Failed to fetch balances");return t.data},uxe=200,dxe=(e,t)=>{const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},sV=async e=>{if(!e.length)return{};const t=dxe(e,uxe),n=await Promise.all(t.map(async r=>{const{data:a}=await Je.get("/matches/by-transactions",{params:{transactionIds:r}});if(!a.success||!a.data)throw new Error("Failed to fetch receipt matches");return a.data}));return Object.assign({},...n)},xh="balances",iV=e=>Nt({queryKey:[xh,"balances",null],queryFn:()=>cxe(),enabled:!!Et(),staleTime:5*60*1e3}),Eu=10,$I=10*1024*1024,fxe=async(e={})=>{const{data:t}=await Je.get("/receipts",{params:e});if(!t.success||!t.data)throw new Error(t.message||"Failed to fetch receipts");return t.data},hxe=async(e,t,n)=>{if(e.length>Eu)throw new Error(`Maximum ${Eu} files allowed per upload`);for(const s of e)if(s.size>$I)throw new Error(`File ${s.name} exceeds maximum size of ${$I/(1024*1024)}MB`);const r=new FormData;e.forEach((s,o)=>{r.append("receipts",s)}),t&&r.append("transaction_id",t);const{data:a}=await Je.post("/receipts/upload",r,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:s=>{if(s.total){const o=s.loaded/s.total*100;n?.(o)}}});if(!a.success)throw new Error(a.message||"Upload failed");return a.data},pxe=async e=>{if(!e||e.length===0)return[];const t=e.filter(r=>r!=null);if(t.length===0)return[];const{data:n}=await Je.post("/receipts/status",{ids:t});if(!n.success)throw new Error(n.message||"Failed to get receipt statuses");return n.data?.statuses||[]},mxe=async e=>{const{data:t}=await Je.post("/receipts/delete",{ids:e});if(!t.success)throw new Error(t.message||"Failed to delete receipts")},gxe=async e=>{const{data:t}=await Je.post(`/receipts/${e}/parse`);if(!t.success)throw new Error(t.message||"Failed to reparse receipt")},xxe=async(e,t)=>{if(Object.keys(t).length===0)throw new Error("Nothing to update");const{data:n}=await Je.patch(`/receipts/${e}/parsed-data`,t);if(!n.success||!n.data)throw new Error(n.error||"Failed to update the document");return n.data},bxe=async(e,t)=>{const{data:n}=await Je.post(`/receipts/${e}/review`,{reviewed:t});if(!n.success||!n.data)throw new Error(n.error||"Failed to update the document");return n.data},Cm="receipts",YO=(e={})=>{const t=mn();return{...Nt({queryKey:[Cm,e],queryFn:()=>fxe(e),enabled:!!Et(),retry:(s,o)=>o instanceof ma?!1:s<3,staleTime:3e4}),addOptimisticReceipts:s=>{const o=s.map((l,u)=>({id:-(Date.now()+u),user_id:0,filename:l.name,s3_key:"",mime_type:l.type,size_bytes:l.size,uploaded_at:new Date().toISOString(),status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),parsed_data:{},processing_status:"pending"}));return t.setQueriesData({queryKey:[Cm]},l=>l?{...l,receipts:[...o,...l.receipts],total:l.total+o.length}:{receipts:o,total:o.length,page:1,totalPages:1}),o},updateOptimisticReceipts:s=>{t.setQueriesData({queryKey:[Cm]},o=>{if(!o)return o;const l=o.receipts.map(u=>{const d=s.find(h=>h.tempId===u.id);return d?{...u,id:d.actualId,filename:d.filename,processing_status:"pending"}:u});return{...o,receipts:l}})}}};function yxe(e,t,n){const r={className:"bg-badge-blue text-badge-blue-text",dotClassName:"bg-badge-blue-text",animateClass:"animate-pulse"},a={className:"bg-badge-yellow text-badge-yellow-text",dotClassName:"bg-badge-yellow-text",animateClass:""},s={className:"bg-badge-green text-badge-green-text",dotClassName:"bg-badge-green-text",animateClass:""},o={className:"bg-badge-red text-badge-red-text",dotClassName:"bg-badge-red-text",animateClass:""};if(e==="awaiting_matching"||t==="matching")return{text:"Matching Transaction...",...r};if(n)return{text:"Processing",...r};
490switch(t){case"pending":return{text:"Pending",...a};case"processing":return{text:"Processing",...r};case"completed":return{text:"Completed",...s};case"failed":return{text:"Failed",...o};default:return{text:"Pending",...a}}}function Re(e,t){if(e==null)return"N/A";const n=Number(e);if(Number.isNaN(n))return"N/A";const r=n.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),a=t||"$";return/^[A-Za-z]{2,}$/.test(String(a))?`${a} ${r}`:`${a}${r}`}const JS=e=>e&&e!=="USD"?e:"$";function Ee(e,t){return e==null||Number.isNaN(Number(e))?"N/A":`${e<0?"-":"+"}${Re(Math.abs(e),JS(t))}`}function ge(e,t){const n=Number(e);if(e==null||Number.isNaN(n))return Re(e,JS(t));const r=Re(Math.abs(n),JS(t));return n<0?`-${r}`:r}const oV=["upload","email","gmail","drive"],XO="Vendor not recognised",lV={upload:"Upload",email:"Email",gmail:"Gmail",drive:"Drive"},vxe=!1,wxe=!1,Hm=e=>e==="gmail"?vxe:e==="drive"?wxe:!0,eC={search:"",merchant:[],source:[],status:[]},jxe=e=>e.search.trim()!==""||e.merchant.length>0||e.source.length>0||e.status.length>0,Nxe=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Ho(e){const t=e?.parsed_data?.merchant;if(Nxe(t)){const n=t.name;return typeof n=="string"&&n.trim()!==""?n.trim():null}return typeof t=="string"&&t.trim()!==""?t.trim():null}const Vn=e=>Ho(e)??XO;function wa(e){const t=e?.parsed_data?.total;if(t==null||t==="")return null;const n=Number(t);return Number.isFinite(n)?n:null}function Cs(e){const t=e?.parsed_data?.total_currency;return typeof t=="string"&&t.trim()!==""?t.trim():null}const Tg=e=>{const t=wa(e);return t===null?null:Re(t,Cs(e))};function bh(e){const t=e?.parsed_data?.date;if(typeof t=="string"&&t.trim()!=="")return t;const n=e?.parsed_data?.invoice_information?.date;return typeof n=="string"&&n.trim()!==""?n:null}const cV=e=>{const t=typeof e=="string"?e.trim().toLowerCase():"";return oV.includes(t)?t:null};function j1(e){return cV(e?.source)??"upload"}const Js=e=>lV[j1(e)],Yl=e=>typeof e?.transaction_id=="string"&&e.transaction_id.trim()!=="",G0=e=>!!e?.reviewed_at,Nf=e=>e?.processing_status==="completed",uV=e=>e?.processing_status==="failed",Pg=e=>e?.drive_backup?.drive_backup_status==="error",Rg=e=>e?.drive_backup?.drive_backup_status==="uploaded";function _xe(e){const t=e?.match_confidence;if(t==null||t==="")return null;const n=Number(t);return Number.isFinite(n)?n:null}const kxe=(e,t=!1)=>yxe(e?.status??null,e?.processing_status??null,t);function N1(e){if(uV(e))return"failed";if(Pg(e))return"drive-backup-error";if(Nf(e)){if(wa(e)===null)return"missing-total";if(Ho(e)===null)return"missing-vendor"}return"none"}const tC={failed:"Failed to parse","missing-total":"No total found","missing-vendor":"No vendor found","drive-backup-error":"Drive backup failed"};function II(e,t){const n=t.search.trim().toLowerCase();return(e??[]).filter(r=>{const a=Ho(r),s=wa(r),o=n===""||[a,r.filename,s===null?"":String(s),r.uploaded_at,r.source,r.processing_status].some(h=>String(h??"").toLowerCase().includes(n)),l=t.merchant.length===0||t.merchant.includes(a??""),u=t.source.length===0||t.source.includes(r.source??""),d=t.status.length===0||t.status.includes(r.processing_status??"");return o&&l&&u&&d})}function Sxe(e){const t=new Set,n=new Set,r=new Set;(e??[]).forEach(s=>{const o=Ho(s);o&&t.add(o),s.source&&n.add(s.source),s.processing_status&&r.add(s.processing_status)});const a=[...n].filter(s=>{const o=cV(s);return o===null||Hm(o)});return{merchant:[...t].sort((s,o)=>s.localeCompare(o)),source:a.sort(),status:[...r].sort()}}const dV="USD";function _1(e){const t=e.map(s=>({total:wa(s),currency:Cs(s)})).filter(s=>s.total!==null);if(t.length===0)return{amount:null,currency:null,documents:0,mixedCurrency:!1};const n=new Map;t.forEach(({total:s,currency:o})=>{const l=o??dV,u=n.get(l)??{amount:0,documents:0};u.amount+=s,u.documents+=1,n.set(l,u)});const[r,a]=[...n.entries()].sort((s,o)=>o[1].documents-s[1].documents)[0];return{amount:a.amount,currency:r,documents:a.documents,mixedCurrency:n.size>1}}function Cxe(e,t,n){const r=new Map;return e.forEach(a=>{const s=Ho(a),o=wa(a);if(!s||o===null||t&&(Cs(a)??dV)!==t)return;const l=r.get(s)??{name:s,total:0,documents:0};l.total+=o,l.documents+=1,r.set(s,l)}),[...r.values()].sort((a,s)=>s.total-a.total).slice(0,n)}function Exe(e){const t=e??[],n=_1(t),r={pending:0,processing:0,completed:0,failed:0},a={upload:0,email:0,gmail:0,drive:0},s={backedUp:0,failed:0,notBackedUp:0};let o=0,l=0,u=0,d=0,h=0,p=0,g=0;return t.forEach(x=>{const y=x.processing_status;y==="completed"?r.completed+=1:y==="failed"?r.failed+=1:y==="processing"?r.processing+=1:r.pending+=1,a[j1(x)]+=1,Rg(x)?s.backedUp+=1:Pg(x)?s.failed+=1:s.notBackedUp+=1,Yl(x)&&(o+=1),Nf(x)&&!Yl(x)&&(l+=1),G0(x)&&(u+=1),G0(x)&&Nf(x)&&(d+=1),Nf(x)&&!G0(x)&&(h+=1),N1(x)!=="none"&&(p+=1);const w=Number(x.size_bytes);Number.isFinite(w)&&w>0&&(g+=w)}),{total:t.length,byStatus:r,matched:o,unmatched:l,reviewed:u,reviewedParsed:d,inbox:h,needsReview:p,valueCaptured:n,topVendors:Cxe(t,n.currency,6),sources:a,drive:s,storage:{bytes:g,documents:t.length}}}function Oxe(e){const t=[],n=[],r=[];
490return(e??[]).forEach(a=>{switch(N1(a)){case"failed":t.push(a);break;case"missing-total":case"missing-vendor":n.push(a);break;case"drive-backup-error":r.push(a);break}}),{failed:t,missingFields:n,driveErrors:r,total:t.length+n.length+r.length}}const Axe=(e,t)=>{const n=wa(e),r=wa(t);return n===null&&r===null?0:n===null?1:r===null?-1:r-n},nC=e=>{const t=Date.parse(e?.uploaded_at??"");return Number.isNaN(t)?0:t},Txe=e=>(e??[]).filter(t=>Nf(t)&&!Yl(t)).sort(Axe),fV=(e,t=[])=>(e??[]).filter(n=>!G0(n)&&(Nf(n)||t.includes(n.id))).sort((n,r)=>nC(r)-nC(n));function Pxe(e){const t=e??[];return oV.map(n=>{const r=t.filter(s=>j1(s)===n),a=r.reduce((s,o)=>o.uploaded_at?s?nC(o)>Date.parse(s)?o.uploaded_at:s:o.uploaded_at:s,null);return{source:n,label:lV[n],documents:r.length,share:t.length===0?0:Math.round(r.length/t.length*100),lastAt:a}})}function Rxe(e){const t=(e??[]).reduce((n,r)=>{const a=Number(r.size_bytes);return Number.isFinite(a)&&a>0?n+a:n},0);return{bytes:t,documents:(e??[]).length,label:QO(t)}}function QO(e){const t=Number(e);if(!Number.isFinite(t)||t<=0)return"0 MB";const n=["B","KB","MB","GB","TB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),n.length-1),a=t/1024**r;return`${a.toFixed(a>=100||r===0?0:1)} ${n[r]}`}const mr=(e,t)=>t<=0?0:Math.round(e/t*100);function hV(e){const t=new Set;return(e??[]).filter(n=>t.has(n.id)?!1:(t.add(n.id),!0))}const Mxe=(e,t)=>{if(t==null||`${t}`.trim()==="")return null;const n=Number(t);return Number.isFinite(n)?(e??[]).find(r=>r.id===n)??null:null},pV=()=>{const e=YO({sortBy:"date",sortOrder:"desc"}),t=v.useMemo(()=>{const r=e.data?.receipts??[];return hV(r)},[e.data?.receipts]),n=v.useMemo(()=>({documents:t,summary:Exe(t),review:Oxe(t),unmatched:Txe(t),inbox:fV(t),sources:Pxe(t),storage:Rxe(t)}),[t]);return{...e,...n}},Dxe=e=>{const t=[...new Set(e.map(r=>r.error_message).filter(Boolean))];return`Moneylogz could not read ${e.length?`${e.length} of the selected account${e.length===1?"":"s"}`:"the selected accounts"}${t.length?`: ${t.join("; ")}`:""}`},k1=async(e={})=>{const{data:t}=await Je.get("/plaid/transactions",{params:e});if(!t.success)throw new Error("Failed to fetch transactions");const n=t.errors??[];if(Array.isArray(t.data)||!Array.isArray(t.data?.transactions))throw new Error(Dxe(n));return{transactions:t.data.transactions,total:t.data.total??t.data.transactions.length,page:t.data.page??1,totalPages:t.data.totalPages??1,errors:n}},ZO="transactions",S1="transactionMatchMap",$xe=500,LI=e=>new Date(`${e}T00:00:00`).toISOString(),FI=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate&&e.accountIds.length===t.accountIds.length&&e.accountIds.every((n,r)=>n===t.accountIds[r]),mV=(e,t=!0,{withMatches:n=!0}={})=>{const r=Nt({queryKey:[ZO,e],enabled:t&&!!Et()&&!!e&&e.accountIds.length>0,staleTime:3e4,placeholderData:TD,queryFn:async()=>{if(!e)throw new Error("No transaction query parameters set");const u=await k1({accountIds:e.accountIds,startDate:LI(e.startDate),endDate:LI(e.endDate),limit:$xe}),d=u.transactions??[],h=u.errors??[],p=typeof u.totalPages=="number"&&u.totalPages>1;return{rows:d,total:u.total??d.length,truncated:p,accountErrors:h}}}),a=r.data?.rows,s=v.useMemo(()=>n?a?.map(u=>u.transaction_id)??[]:[],[n,a]),o=Nt({queryKey:[S1,s],enabled:n&&t&&!!Et()&&!!a,staleTime:3e4,placeholderData:TD,retry:!1,queryFn:async()=>await sV(s)});return{data:v.useMemo(()=>{if(!r.data||n&&o.isPending)return;const u=n?o.data??{}:void 0;return{rows:u?r.data.rows.map(d=>({...d,match:u[d.transaction_id]})):r.data.rows,matchesResolved:n&&o.isSuccess&&!o.isPlaceholderData,total:r.data.total,truncated:r.data.truncated,accountErrors:r.data.accountErrors}},[r.data,n,o.data,o.isPending,o.isSuccess,o.isPlaceholderData]),isError:r.isError,error:r.error,isFetching:r.isFetching||o.isFetching,refetch:r.refetch}},Ixe=async e=>{const{data:t}=await Je.get("/plaid/investments/holdings",{params:void 0});if(!t.success||!t.data)throw new Error("Failed to fetch investment holdings");return t.data},Lxe=async e=>{const{startDate:t,endDate:n,accountIds:r,type:a,ticker:s}=e,{data:o}=await Je.get("/plaid/investments/transactions",{params:{startDate:t,endDate:n,...r?.length?{accountIds:r}:{},...a?{type:a}:{},...s?{ticker:s}:{}}});if(!o.success||!o.data)throw new Error("Failed to fetch investment transactions");return o.data},Fxe=async e=>{const{data:t}=await Je.put("/plaid/investments/holdings/cost-basis",e);if(!t.success)throw new Error(t.error||"Failed to save cost basis")},zxe=async e=>{const{data:t}=await Je.delete("/plaid/investments/holdings/cost-basis",{params:e});if(!t.success)throw new Error(t.error||"Failed to remove cost basis")},Uu="investments",JO=(e,t={})=>Nt({queryKey:[Uu,"holdings",null],queryFn:()=>Ixe(),enabled:(t.enabled??!0)&&!!Et(),staleTime:5*60*1e3}),C1=(e,t={})=>Nt({queryKey:[Uu,"transactions",e],queryFn:()=>Lxe(e),enabled:(t.enabled??!0)&&!!Et()&&!!e.startDate&&!!e.endDate,staleTime:5*60*1e3}),gf=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#84CC16"],Bxe=["#2563eb","#f97316","#8b5cf6","#0ea5e9","#ec4899","#f59e0b"],rC="#94a3b8",dk=["#2563eb","#93c5fd","#cbd5e1"],eA="#cbd5e1",du="#2563eb",qy="#16a34a",Hy="#dc2626",Bf="#e2e8f0",Uf="#64748b",
490Uxe="#ffffff",zI=(e,t=!1)=>t?rC:Bxe[e]??rC,fk=e=>dk[e]??dk[dk.length-1],tA=e=>String(e||"").split(",").map(t=>t.trim().toLowerCase()).filter(Boolean),gV=(e,t)=>tA(e).includes(String(t||"").trim().toLowerCase()),aC=e=>`${e.moneylogz_account_id}:${e.plaid_account_id}`,An=e=>e?`····${e}`:null,E1=(e,t)=>{const n=An(t);return n?`${e} ${n}`:e},qu=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),Ue=e=>{const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?e:t.toLocaleDateString("en-US",{day:"2-digit",month:"short",year:"numeric"})},nA=(e,t=new Date)=>{if(!e)return null;const n=new Date(e);if(Number.isNaN(n.getTime()))return null;const r=Math.floor((t.getTime()-n.getTime())/1e3);if(r<60)return"just now";const a=Math.floor(r/60);if(a<60)return`${a} min ago`;const s=Math.floor(a/60);if(s<24)return`${s} hour${s===1?"":"s"} ago`;const o=Math.floor(s/24);return o<=6?`${o} day${o===1?"":"s"} ago`:n.toLocaleDateString("en-US",{day:"2-digit",month:"short",year:"numeric"})},Km=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"numeric",day:"numeric"}),vo=e=>Math.round(e*100)/100,Ky=e=>gV(e,"investments"),vn=e=>`${e.plaid_account_id}:${e.security_id}`;function xV(e){const{cost_basis:t,quantity:n}=e;return t==null||n==null||n===0?null:vo(t/n)}function fu(e,t){return e==null||t==null||t===0?null:vo(e/t*100)}function Hu(e,t){return e==null||t==null||t===0?null:vo(e/t*100)}function O1(e){const t=new Map;for(const n of e){const r=n.currency||"unknown";t.has(r)||t.set(r,{currency:r,value:0,cost_basis:0,covered_value:0,covered_holdings:0,unrealized_gain_loss:0,holdings:0,partial:!1});const a=t.get(r);a.holdings+=1;const s=n.value!==null&&n.value!==void 0,o=n.cost_basis!==null&&n.cost_basis!==void 0;s?a.value+=n.value:a.partial=!0,o?a.cost_basis+=n.cost_basis:a.partial=!0,s&&o&&(a.covered_value+=n.value,a.covered_holdings+=1)}return[...t.values()].map(n=>({...n,value:vo(n.value),cost_basis:vo(n.cost_basis),covered_value:vo(n.covered_value),unrealized_gain_loss:vo(n.covered_value-n.cost_basis)}))}function rA(e){const t=new Map;let n=0;for(const r of e){if(r.value===null||r.value===void 0)continue;const a=r.security_type||"unknown";t.set(a,(t.get(a)||0)+r.value),n+=r.value}return[...t.entries()].map(([r,a])=>({security_type:r,value:vo(a),percent:n>0?vo(a/n*100):null})).sort((r,a)=>a.value-r.value)}const Ou=e=>[...e??[]].sort((t,n)=>n.value-t.value),bV=(e,t)=>(t.value??0)-(e.value??0);function Po(e,t=bV){const n=new Map;for(const r of e){const a=aC(r);n.has(a)||n.set(a,[]),n.get(a).push(r)}return[...n.entries()].map(([r,a])=>({key:r,moneylogz_account_id:a[0].moneylogz_account_id,plaid_account_id:a[0].plaid_account_id,institution:a[0].institution,institution_id:a[0].institution_id,account_name:a[0].account_name,account_subtype:a[0].account_subtype,mask:a[0].mask,holdings:[...a].sort(t),byCurrency:O1(a),allocation:rA(a)})).sort((r,a)=>(a.byCurrency[0]?.value??0)-(r.byCurrency[0]?.value??0))}function qxe(e){const t=new Map;for(const n of e){const r=String(n.moneylogz_account_id);t.has(r)||t.set(r,{institution:n.institution,accounts:new Map}),t.get(r).accounts.set(n.plaid_account_id,E1(n.account_name,n.mask))}return[...t.entries()].map(([n,r])=>{const a=[...r.accounts.values()];return{id:n,title:a.length===1?`${r.institution} â ${a[0]}`:`${r.institution} â all ${a.length} investment accounts`}})}function Hxe(e,t=bV){const n=new Map;for(const r of e){const a=r.institution_id||r.institution||"unknown";n.has(a)||n.set(a,[]),n.get(a).push(r)}return[...n.values()].map(r=>({institution:r[0].institution,institution_id:r[0].institution_id,accounts:Po(r,t),byCurrency:O1(r),holdingCount:r.length})).sort((r,a)=>(a.byCurrency[0]?.value??0)-(r.byCurrency[0]?.value??0))}const Kxe=["etf","equity","mutual fund","fixed income","cash","derivative","loan","other"],sC=e=>String(e||"unknown").trim().toLowerCase();function Ja(e){const t=Kxe.indexOf(sC(e));if(t>=0)return gf[t%gf.length];const n=sC(e);let r=0;for(let a=0;a<n.length;a+=1)r=(r*31+n.charCodeAt(a))%gf.length;return gf[r]}function ei(e){const t=sC(e);return t==="etf"?"ETF":t.replace(/\b\w/g,n=>n.toUpperCase())}const aA=e=>String(e||"").trim().toLowerCase()==="cancel";function yV(e){return aA(e.type)?"text-slate-500":(e.amount??0)<0?"text-amount-neg":"text-amount-pos"}function hu(e){return e==null||Number.isNaN(Number(e))?"â":Number(e).toLocaleStr
490ing("en-US",{minimumFractionDigits:4,maximumFractionDigits:4})}const Vxe=e=>[...e].sort((t,n)=>String(n.date).localeCompare(String(t.date))),vV=(e,t)=>[...e].sort((n,r)=>(r.value??0)-(n.value??0)).slice(0,t),sA=(e,t)=>!t||!e?null:e.find(n=>vn(n)===t)??null,Gxe=(e,t)=>e.filter(n=>n.security_id===t),iA=e=>e.filter(t=>t.cost_basis===null||t.cost_basis===void 0),oA=e=>iA(e).length,Wxe=e=>e.cost_basis_source==="user",pm=e=>{if(!e)return"Not yet fetched";const t=new Date(e);return Number.isNaN(t.getTime())?"Not yet fetched":t.toLocaleString("en-US",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})},wV=e=>{if(!e)return null;const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?null:t};function Yxe(e){const t=wV(e);return t?t.toLocaleDateString("en-US",{day:"2-digit",month:"short",year:"numeric"}):null}const Xxe=24*60*60*1e3,BI=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();function jV(e,t=Date.now()){const n=wV(e);return n?Math.max(0,Math.round((BI(new Date(t))-BI(n))/Xxe)):null}const Qxe=2;function Zxe(e,t=Date.now()){const n=jV(e,t);return n!==null&&n>Qxe}function Jxe(e,t=Date.now()){const n=jV(e,t);return n===null?null:n===0?"today":n===1?"yesterday":`${n} days ago`}function NV({withoutInvestments:e,errorCode:t,status:n}){if(e)return"no_investments";const r=String(n||"").trim().toUpperCase();return t==="ITEM_LOGIN_REQUIRED"||r==="ITEM_LOGIN_REQUIRED"||t==="ADDITIONAL_CONSENT_REQUIRED"?"login_required":t==="PRODUCT_NOT_READY"?"preparing":t?"unavailable":"active"}const ebe=e=>e==="login_required"||e==="preparing"||e==="unavailable",_V={active:{label:"Active",className:"bg-badge-green text-badge-green-text",dotClassName:"bg-badge-green-text"},login_required:{label:"Login Broken",className:"bg-badge-red text-badge-red-text",dotClassName:"bg-badge-red-text"},preparing:{label:"Preparing",className:"bg-badge-yellow text-badge-yellow-text",dotClassName:"bg-badge-yellow-text"},unavailable:{label:"Unavailable",className:"bg-surface-muted text-slate-600",dotClassName:"bg-slate-400"},no_investments:{label:"No investments",className:"bg-surface-muted text-slate-600",dotClassName:"bg-slate-400"}};function kV(e,t){return e.filter(n=>Ky(n.products)).map(n=>({account:n,state:NV({errorCode:t.get(n.id)?.code??null,status:n.status})})).filter(({state:n})=>ebe(n))}const SV=(e,t)=>kV(e,t).length,CV=e=>new Map((e??[]).map(t=>[t.moneylogz_account_id,t]));function Vr(e){const t=`${e.getMonth()+1}`.padStart(2,"0"),n=`${e.getDate()}`.padStart(2,"0");return`${e.getFullYear()}-${t}-${n}`}function Mi(e,t=new Date){const n=new Date(t);return n.setDate(n.getDate()-e),Vr(n)}const EV="cashRunway",iC=90,tbe=30,nbe=500,W0={status:"unavailable",months:null,monthlySpend:null,daysCovered:0,transactions:0},rbe={...W0,status:"no_cash_accounts"},OV=e=>{const t=e.transactions?.length??0;return typeof e.total!="number"?(e.totalPages??1)>1:e.total>t||(e.totalPages??1)>1},abe=e=>Math.round(e*10)/10,sbe=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()};function ibe(e,t,n=iC){const r={months:null,monthlySpend:null,transactions:e.length};if(typeof t!="number"||!Number.isFinite(t)||t<=0)return{status:"unavailable",daysCovered:0,...r};const a=e.map(u=>new Date(`${String(u.date).slice(0,10)}T00:00:00`).getTime()).filter(u=>!Number.isNaN(u));if(a.length===0)return{status:"insufficient_history",daysCovered:0,...r};const s=Math.min(n,Math.round((sbe(Date.now())-Math.min(...a))/864e5));if(s<tbe)return{status:"insufficient_history",daysCovered:s,...r};const o=e.reduce((u,d)=>typeof d.amount=="number"&&d.amount<0?u+Math.abs(d.amount):u,0);if(o<=0)return{status:"insufficient_history",daysCovered:s,...r};const l=o/s*30;return{status:"ok",months:abe(t/l),monthlySpend:Math.round(l*100)/100,daysCovered:s,transactions:e.length}}const AV=({accountIds:e,plaidAccountIds:t,cash:n,enabled:r=!0})=>{const a=[...e].sort((d,h)=>d-h),s=[...t].sort(),o=a.length>0&&s.length>0&&typeof n=="number",l=r&&!!Et()&&o,u=Nt({queryKey:[EV,a,s,iC],queryFn:async()=>{const d=await k1({accountIds:a.map(String),startDate:Mi(iC),endDate:Vr(new Date),limit:nbe}),h=new Set(s),g=(d.transactions??[]).filter(y=>h.has(y.plaid_account_id)),x=OV(d);return{transactions:g,truncated:x}},enabled:l,staleTime:30*60*1e3});return u.isError?{...u,runway:W0}:o?l?u.data?u.data.truncated?{...u,runway:W0}:{...u,runway:ibe(u.data.transactions,n)}:{...u,runway:null}:{...u,runway:W0}:{...u,runway:rbe}},Vm=[{id:"7d",label:"7d",days:7},{id:"30d",label:"30d",days:30},{id:"90d",label:"90d",days:90},{id:"ytd",label:"YTD",days:null}],lA="30d";function yh(e,t=new Date){const n=Vm.find(a=>a.id===e),r=Vr(t);return n?n.days===null?{startDate:Vr(new Date(t.getFullYear(),0,1)),endDate:r}:{startDate:Mi(n.days,t),endDate:r}:yh(lA,t)}function TV(e,t=new Date,n=null){const r=s=>{const o=yh(s,t);return o.startDate===e.startDate&&o.endDate===e.endDate};if(n&&r(n))return n;if(r("ytd"))return"ytd";const a=Vm.find(s=>
490r(s.id));return a?a.id:null}function obe(e){const t=Vm.find(n=>n.id===e);return t?t.days===null?"year to date":`last ${t.days} days`:`last ${Vm.find(n=>n.id===lA).days} days`}const oC=["cash","investments","credit","loans","other"],PV=e=>Math.round(e*10)/10,je="â",Vy={cash:"Cash",investments:"Investments",credit:"Credit cards",loans:"Loans",other:"Other accounts"},lbe="These account types are not classified as assets or debts, so they are left out of the totals above.";function cbe(e,t){return e==null||t==null||t===0?null:PV(Math.abs(e)/Math.abs(t)*100)}function Mg(e,t){return typeof e!="number"||!Number.isFinite(e)||typeof t!="number"||!Number.isFinite(t)||t<=0?null:PV(e/t*100)}function RV(e){return typeof e!="number"||!Number.isFinite(e)?null:e<30?"healthy":e<75?"watch":"high"}const lC={healthy:"Healthy",watch:"Watch",high:"High"};function sc(e){return typeof e.current!="number"||!Number.isFinite(e.current)?null:e.side==="liability"?-e.current:e.current}function Dg(e){return typeof e.available!="number"||!Number.isFinite(e.available)?null:`${ge(e.available,e.currency)} available`}function A1(e){const t=[];return e.next_payment_due_date&&t.push(`due ${Ue(e.next_payment_due_date)}`),typeof e.minimum_payment_amount=="number"&&Number.isFinite(e.minimum_payment_amount)&&t.push(`min ${ge(e.minimum_payment_amount,e.currency)}`),t.length?t.join(" · "):null}function MV(e){return typeof e.apr_percentage!="number"||!Number.isFinite(e.apr_percentage)?null:`${e.apr_percentage}% ${e.group==="cash"?"APY":"APR"}`}function ube(e,t){const n=new Map((t??[]).map(a=>[a.group,a])),r=new Map;for(const a of e){const s=oC.includes(a.group)?a.group:"other";r.has(s)||r.set(s,[]),r.get(s).push(a)}return oC.filter(a=>r.has(a)).map(a=>{const s=r.get(a),o=n.get(a);return{group:a,label:Vy[a],rows:s,accounts:s.length,institutions:new Set(s.map(l=>l.institution)).size,totals:o?.totals??[],partial:o?o.partial:!0}})}function DV(e){return!e||e.length===0?null:[...e].sort((t,n)=>n.accounts-t.accounts||t.currency.localeCompare(n.currency))[0].currency}const T1=(e,t)=>t&&e?.find(n=>n.currency===t)||null,Gy=(e,t)=>t&&e?.find(n=>n.currency===t)||null,$V=(e,t)=>t&&e.find(n=>n.currency===t)||e[0]||null,IV=e=>new Map((e??[]).map(t=>[t.moneylogz_account_id,t]));function P1(e,t){const n=String(e||"").toUpperCase();return n==="ITEM_LOGIN_REQUIRED"||t?.code==="ITEM_LOGIN_REQUIRED"?"login_required":t?.code==="PRODUCT_NOT_READY"?"preparing":t?"error":n==="ACTIVE"?"active":"not_reporting"}const ic={active:{label:"Active",className:"bg-badge-green text-badge-green-text",dotClassName:"bg-badge-green-text"},login_required:{label:"Login Broken",className:"bg-badge-red text-badge-red-text",dotClassName:"bg-badge-red-text"},preparing:{label:"Preparing",className:"bg-badge-yellow text-badge-yellow-text",dotClassName:"bg-badge-yellow-text"},error:{label:"Not Reporting",className:"bg-badge-red text-badge-red-text",dotClassName:"bg-badge-red-text"},not_reporting:{label:"Not Reporting",className:"bg-surface-muted text-slate-600",dotClassName:"bg-slate-400"}},dbe={label:"Stale",className:"bg-badge-yellow text-badge-yellow-text",dotClassName:"bg-badge-yellow-text"},R1={login_required:"bg-badge-red text-badge-red-text",preparing:"bg-badge-yellow text-badge-yellow-text",error:"bg-badge-red text-badge-red-text",not_reporting:"bg-surface-muted text-slate-600",active:"bg-brand-soft text-blue-900"},M1={login_required:"The bank has ended this connection, so its balances have stopped updating. Reconnecting restores them and backfills what was missed.",preparing:"This connection is still preparing its data. Balances usually appear within a few minutes and are not counted in the totals until they do.",error:"This connection could not be reached on the last refresh, so its balances are missing from the totals.",not_reporting:"This connection is not active, so it was not queried and contributes nothing to the totals above.",active:""},qf=e=>e!=="active";function LV(e,t){return e.map(n=>({account:n,state:P1(n.status,t.get(n.id)),error:t.get(n.id)})).filter(n=>qf(n.state))}const cA=e=>(e??[]).some(t=>t.partial);function FV(e){const t=new Map;let n=!1;for(const a of e){const s=sc(a);if(s===null){n=!0;continue}const o=t.get(a.currency)??{currency:a.currency,assets:0,liabilities:0,net:0};s<0?o.liabilities+=Math.abs(s):o.assets+=s,o.net+=s,t.set(a.currency,o)}const r=a=>Math.round(a*100)/100;return{totals:[...t.values()].map(a=>({currency:a.currency,assets:r(a.assets),liabilities:r(a.liabilities),net:r(a.net)})).sort((a,s)=>a.currency.localeCompare(s.currency)),partial:n}}function fbe(e,t,n){const r=new Map;for(const a of t)r.has(a.moneylogz_account_id)||r.set(a.moneylogz_account_id,[]),r.get(a.moneylogz_account_id).push(a);return e.map(a=>{const s=r.get(a.id)??[],{totals:o,partial:l}=FV(s);return{account:a,state:P1(a.status,n.get(a.id)),error:n.get(a.id),rows:s,subAccounts:s.length,products:tA(a.products),totals:o,partial:l}})}function zV(e,t){if(t===e.rows)return e;const{totals:n,partial:r}=FV(t);return{...e,rows:t,subAccounts:t.length,totals:n,partial:r}}function hbe(e,t){const n=(t.search??"").trim().toLowerCase();return e.filter(r=>t.group&&r.group!==t.group||t.currency&&r.currency!==t.currency?!1:n?[r.account_name,r.institution,r.connection_title,r.mask,r.subtype,r.type].some(a=>String(a??"").toLowerCase().includes(n)):!0)}const UI={login_required:0,preparing:1,error:2,not_reporting:3,active:4};function pbe(e){const t=new Map;for(const n of e)for(const r of n.totals){const a=t.get(r.currency)??{currency:r.currency,net:0,connections:0};a.net+=r.net,a.connections+=1,t.set(r.currency,a)}return[...t.values()].map(n=>({...n,net:Math.round(n.net*100)/100})).sort((n,r)=>n.currency.localeCompare(r.currency))}function mbe(e,t){let n=null,r=t;for(const a of e)if(qf(a.state))for(const s of a.rows){if(t&&s.currency!==t)continue;const o=sc(s);if(o!==null){if(r??=s.currency,s.currency!==r)return null;n=(n??0)+o}}return n===null||r===null?null:{net:Math.round(n*100)/100,currency:r}}function gbe(e){return[...e].sort((t,n)=>UI[t.state]-UI[n.state]||(t.account.title||t.account.name).localeCompare(n.account.title||n.account.name))}const xbe="/transactions",bbe="overview",Gm="needs-document",ybe="needs-receipt",vbe=[{path:"overview",label:"Overview",icon:Bo},{path:"all",label:"All transactions",icon:Uo},{path:Gm,label:"Needs document",icon:ri}],Ko=e=>`${xbe}/${e}`,xf="id",qI=e=>`${Ko("all")}?${xf}=${encodeURIComponent(e)}`,HI=Ko(bbe),wbe=new Set(["transfer","payment","income","interest","bank fees","tax refund"]),jbe=e=>typeof e=="number"&&!Number.isNaN(e)&&e>=0,Nbe=e=>[e.category,e.sub_category].some(t=>!!t&&wbe.has(t.trim().toLowerCase()));function $g(e,t){return t?e.match?"matched":e.pending?"pending":jbe(e.amount)||Nbe(e)?"not-required":"needs-receipt":"unknown"}const _be=e=>e==="matched"||e==="needs-receipt",Kl={matched:"Document matched",unknown:"Document status unavailable",pending:"Pending","not-required":"No document needed","needs-receipt":"Needs document"},cC={matched:"bg-badge-green text-badge-green-text",unknown:"bg-surface-muted text-slate-500",pending:"bg-badge-blue text-badge-blue-text","not-required":"bg-surface-muted text-slate-600","needs-receipt":"bg-badge-yellow text-badge-yellow-text"},kbe=30,BV="transactionsFilters",Sbe="analyticsFilters",Cbe=["all","matched","needs-receipt","pending","not-required","unknown"],D1=e=>!!e&&Cbe.includes(e),UV=[{value:"all",label:"Document status"},{value:"matched",label:"Matched"},{value:"needs-receipt",label:Kl["needs-receipt"]},{value:"pending",label:Kl.pending},{value:"not-required",label:Kl["not-required"]}],Hf=(e=new Date)=>({search:"",accountIds:[],startDate:Mi(kbe,e),endDate:Vr(e),categories:[],merchants:[],minAmount:"",maxAmount:"",channels:[],status:"all"}),uC=e=>/^\d{4}-\d{2}-\d{2}$/.test(e),Kf=e=>{const t=e.trim();if(t==="")return null;const n=Number(t);return Number.isFinite(n)?Math.abs(n):null},Ebe=e=>e.replace(/\\/g,"\\\\").replace(/,/g,"\\,"),Obe=e=>{const t=[];let n="",r=!1;for(const a of e)r?(n+=a,r=!1):a==="\\"?r=!0:a===","?(t.push(n),n=""):n+=a;return t.push(n),t},zb=(e,t)=>{const n=e.get(t);return n===null?[]:Obe(n).map(r=>
490r.trim()).filter(Boolean)},qd=(e,t)=>{const n=e.get(t);if(n===null)return null;const r=n.trim();return r===""?null:r};function Abe(e,t){const n=qd(e,"start"),r=qd(e,"end"),a=qd(e,"status");return{search:qd(e,"q")??t.search,accountIds:e.has("accounts")?zb(e,"accounts"):t.accountIds,startDate:n&&uC(n)?n:t.startDate,endDate:r&&uC(r)?r:t.endDate,categories:e.has("categories")?zb(e,"categories"):t.categories,merchants:e.has("merchants")?zb(e,"merchants"):t.merchants,minAmount:qd(e,"min")??t.minAmount,maxAmount:qd(e,"max")??t.maxAmount,channels:e.has("channels")?zb(e,"channels"):t.channels,status:D1(a)?a:t.status}}function uA(e){const t=new URLSearchParams,n=(a,s)=>{s.length&&t.set(a,s.map(Ebe).join(","))},r=(a,s)=>{s.trim()&&t.set(a,s.trim())};return r("q",e.search),n("accounts",e.accountIds),r("start",e.startDate),r("end",e.endDate),n("categories",e.categories),n("merchants",e.merchants),r("min",e.minAmount),r("max",e.maxAmount),n("channels",e.channels),e.status!=="all"&&t.set("status",e.status),t}const dA=e=>`${Ko("all")}?${uA(e).toString()}`,KI=15,Tbe=(e,t)=>Mi(-15,t);function WBe(e,{date:t,accountId:n}={},r=new Date){if(!t||!uC(t))return qI(e);const a=new Date(`${t}T00:00:00`);if(Number.isNaN(a.getTime()))return qI(e);const s=Vr(r),o=Tbe(KI,a),l=o<s?o:s,u=Mi(KI,a),d=u<l?u:l,h=n==null?"":String(n).trim(),p=uA({...Hf(r),startDate:d,endDate:l,accountIds:h?[h]:[]});return p.set(xf,String(e)),`${Ko("all")}?${p.toString()}`}function Pbe(e,t=new Date,n=BV){const r=Hf(t);if(!e)return r;try{const a=e.getItem(n);if(!a)return r;const s=JSON.parse(a);return!s||typeof s!="object"?r:{...r,...s,accountIds:Array.isArray(s.accountIds)?s.accountIds.map(String):r.accountIds,categories:Array.isArray(s.categories)?s.categories.map(String):r.categories,merchants:Array.isArray(s.merchants)?s.merchants.map(String):r.merchants,channels:Array.isArray(s.channels)?s.channels.map(String):r.channels,status:D1(s.status??null)?s.status:r.status}}catch{return r}}function Rbe(e,t,n=BV){if(e)try{e.setItem(n,JSON.stringify(t))}catch{}}const Mbe=e=>[e.name,e.merchant_name,e.category,e.sub_category,e.account_name,e.primary_account].filter(t=>!!t),Wy=e=>e.filter(t=>tA(t.products).length===0||gV(t.products,"transactions")),qV=e=>Wy(e).filter(t=>P1(t.status,void 0)==="active"),br=e=>e.merchant_name||e.name||e.account_name||"Unknown merchant",fA="Uncategorised",vh=e=>e.category?.trim()||fA,Wm=e=>[...new Set(e.map(t=>t?.trim()).filter(t=>!!t))].sort((t,n)=>t.localeCompare(n)).map(t=>({id:t,title:t})),HV=e=>Wm(e.map(vh)),Dbe=e=>String(e??"").slice(0,10);function pu(e,t,n){const r=t.search.trim().toLowerCase(),a=Kf(t.minAmount),s=Kf(t.maxAmount),o=new Set(t.accountIds),l=new Set(t.categories),u=new Set(t.merchants),d=new Set(t.channels);return e.filter(h=>{if(r&&!Mbe(h).some(x=>x.toLowerCase().includes(r))||o.size&&!o.has(String(h.ml_account_id)))return!1;const p=Dbe(h.date);if(t.startDate&&p&&p<t.startDate||t.endDate&&p&&p>t.endDate||l.size&&!l.has(vh(h))||u.size&&!u.has(br(h))||d.size&&!d.has(h.payment_channel))return!1;const g=Math.abs(Number(h.amount));return!(a!==null&&!(g>=a)||s!==null&&!(g<=s)||t.status!=="all"&&$g(h,n)!==t.status)})}function hA(e){const t=new Map;for(const n of e){const r=n.iso_currency_code?.trim();r&&t.set(r,(t.get(r)??0)+1)}return t.size===0?null:[...t.entries()].sort((n,r)=>r[1]-n[1]||n[0].localeCompare(r[0]))[0][0]}function Xl(e,t=hA(e)){const n=t?e.filter(h=>h.iso_currency_code?.trim()===t):e;let r=0,a=0,s=0,o=null,l=0,u=0;for(const h of n){const p=Number(h.amount);if(Number.isFinite(p)){if(h.pending){l+=1,u+=p;continue}if(p>=0)r+=p;else{const g=Math.abs(p);a+=g,s+=1,o=o===null?g:Math.max(o,g)}}}const d=h=>Math.round(h*100)/100;return{count:e.length,currency:t,moneyIn:d(r),moneyOut:d(a),net:d(r-a),averageSpend:s>0?d(a/s):null,largestSpend:o===null?null:d(o),pendingCount:l,pendingValue:d(u),otherCurrencyCount:e.length-n.length}}function pA(e,t=new Map){const n=[];e.search.trim()&&n.push({key:"search",label:`Search: ${e.search.trim()}`});for(const s of e.accountIds)n.push({key:"accountIds",value:s,label:t.get(s)??`Account ${s}`});for(const s of e.categories)n.push({key:"categories",value:s,label:`Category: ${s}`});for(const s of e.merchants)n.push({key:"merchants",value:s,label:`Merchant: ${s}`});for(const s of e.channels)n.push({key:"channels",value:s,label:`Channel: ${s}`});const r=Kf(e.minAmount),a=Kf(e.maxAmount);return r!==null&&n.push({key:"minAmount",label:`Amount ⥠${r}`}),a!==null&&n.push({key:"maxAmount",label:`Amount ⤠${a}`}),e.status!=="all"&&n.push({key:"status",label:`Status: ${e.status}`}),n}const Bb=e=>e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`,Ub=e=>Re(e).replace(/\.00$/,"");
490function $be(e,t=new Map){if(pA(e,t).length===0)return null;const n=Kf(e.minAmount),r=Kf(e.maxAmount),a=[];return n!==null&&r!==null?a.push(`between ${Ub(n)} and ${Ub(r)}`):n!==null?a.push(`of ${Ub(n)} or more`):r!==null&&a.push(`of ${Ub(r)} or less`),e.merchants.length>0&&a.push(`from ${Bb(e.merchants)}`),e.accountIds.length>0&&a.push(`on ${Bb(e.accountIds.map(o=>t.get(o)??`account ${o}`))}`),e.channels.length>0&&a.push(`via ${Bb(e.channels)}`),e.status!=="all"&&a.push(`flagged â${Kl[e.status]}â`),e.search.trim()&&a.push(`matching â${e.search.trim()}â`),[e.categories.length>0?`a ${Bb(e.categories)} charge`:"a charge",...a].join(" ")}function Ibe(e,t){switch(t.key){case"search":return{...e,search:""};case"accountIds":return{...e,accountIds:e.accountIds.filter(n=>n!==t.value)};case"categories":return{...e,categories:e.categories.filter(n=>n!==t.value)};case"merchants":return{...e,merchants:e.merchants.filter(n=>n!==t.value)};case"channels":return{...e,channels:e.channels.filter(n=>n!==t.value)};case"minAmount":return{...e,minAmount:""};case"maxAmount":return{...e,maxAmount:""};case"status":return{...e,status:"all"};default:return e}}const KV=["accounts","documents","transactions","investments"],Lbe={accounts:"Accounts",documents:"Documents",transactions:"Transactions",investments:"Investments"},Fbe=20,Hp=(e,t)=>e instanceof Error&&e.message?e.message:t,zbe=e=>{const t=mn(),n=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),r=v.useMemo(()=>n.data?.accounts??[],[n.data?.accounts]),a=v.useMemo(()=>n.data?.logos??{},[n.data?.logos]),s=n.isSuccess,o=iV(),l=pV(),u=v.useMemo(()=>r.some(tt=>Ky(tt.products)),[r]),d=JO(void 0,{enabled:!s||u}),{data:h,isError:p,error:g,refetch:x}=o,{data:y,isError:w,error:j,refetch:N,documents:k,summary:S,review:E,unmatched:O,inbox:T,sources:P,storage:M}=l,{data:D,isError:A,error:L,refetch:F}=d,B=v.useMemo(()=>yh(e),[e]),U=v.useMemo(()=>qV(r).map(tt=>String(tt.id)),[r]),z=r.length>0,$=v.useMemo(()=>Wy(r).length>0,[r]),K=v.useMemo(()=>U.length>0?{accountIds:U,startDate:B.startDate,endDate:B.endDate}:null,[U,B.startDate,B.endDate]),G=mV(K),{data:W,isError:I,error:H,refetch:V}=G,X=C1({startDate:B.startDate,endDate:B.endDate}),{data:te,isError:fe,error:ae,refetch:ke}=X,xe=v.useMemo(()=>IV(h?.errors),[h?.errors]),ue=v.useMemo(()=>LV(r,xe),[r,xe]),we=DV(h?.totals_by_currency),Oe=v.useMemo(()=>(h?.balances??[]).filter(tt=>tt.group==="cash"&&tt.currency===we),[h?.balances,we]),ne=v.useMemo(()=>[...new Set(Oe.map(tt=>tt.moneylogz_account_id))],[Oe]),_e=v.useMemo(()=>[...new Set(Oe.map(tt=>tt.plaid_account_id))],[Oe]),ye=v.useMemo(()=>(h?.totals_by_type??[]).find(Kt=>Kt.group==="cash")?.totals.find(Kt=>Kt.currency===we)?.total??null,[h?.totals_by_type,we]),{runway:Me}=AV({accountIds:ne,plaidAccountIds:_e,cash:ye}),qe=v.useMemo(()=>{if(p&&!h)return{status:"error",message:Hp(g,"Failed to fetch balances"),retry:()=>void x()};if(!h)return{status:"loading"};const tt=[];return(h.excluded_accounts??[]).length>0&&tt.push("excluded-accounts"),(h.errors??[]).length>0&&tt.push("account-errors"),cA(h.totals_by_currency)&&tt.push("partial-currency"),{status:"ready",data:{balances:h,accounts:r,logos:a,currency:we,attention:ue,runway:Me,cashTotal:ye},partial:tt}},[h,p,g,x,r,a,we,ue,Me,ye]),be=v.useMemo(()=>{if(w&&!y)return{status:"error",message:Hp(j,"Failed to fetch documents"),retry:()=>void N()};if(!y)return{status:"loading"};const tt=[];return S.byStatus.failed>0&&tt.push("failed-parses"),S.drive.failed>0&&tt.push("drive-backup-error"),{status:"ready",data:{documents:k,summary:S,review:E,unmatched:O,inbox:T,sources:P,storage:M},partial:tt}},[y,w,j,N,k,S,E,O,T,P,M]),Ce=v.useMemo(()=>{if(!K)return s?{status:"ready",data:{rows:[],matchesResolved:!0,total:0,truncated:!1,accountErrors:[]},partial:[z?$?"no-readable-accounts":"no-transaction-accounts":"no-connections"]}:{status:"loading"};if(I&&!W)return{status:"error",message:Hp(H,"Failed to fetch transactions"),retry:()=>void V()};if(!W)return{status:"loading"};const tt=[];return W.accountErrors.length>0&&tt.push("account-errors"),W.truncated&&tt.push("truncated-window"),W.matchesResolved||tt.push("matches-unresolved"),{status:"ready",data:W,partial:tt}},[K,s,z,$,W,I,H,V]),$t=v.useMemo(()=>
490{if(A&&!D)return{status:"error",message:Hp(L,"Failed to fetch investment holdings"),retry:()=>void F()};if(!D)return{status:"loading"};const tt=[];return(D.errors??[]).length>0&&tt.push("account-errors"),oA(D.holdings??[])>0&&tt.push("missing-cost-basis"),{status:"ready",data:{holdings:D},partial:tt}},[D,A,L,F]),en=v.useMemo(()=>fe?{status:"error",message:Hp(ae,"Failed to fetch recent activity"),retry:()=>void ke()}:A&&!D?{status:"error",message:"Recent activity needs your investment holdings, which could not be loaded",retry:()=>void F()}:te?{status:"ready",data:te.investment_transactions.slice(0,Fbe),partial:[]}:{status:"loading"},[te,fe,ae,ke,D,A,F]),Ot=te?.investment_transactions.length??0,Le=v.useMemo(()=>({accounts:qe.status,documents:be.status,transactions:Ce.status,investments:$t.status}),[qe.status,be.status,Ce.status,$t.status]),gn=v.useMemo(()=>KV.filter(tt=>Le[tt]!=="loading"),[Le]),Aa=v.useCallback(async()=>{const tt=[[xh],[Cm],[ZO],[S1],[Uu],[EV],["user"]];await Promise.allSettled(tt.map(Kt=>t.invalidateQueries({queryKey:Kt})))},[t]);return{accounts:qe,documents:be,transactions:Ce,investments:$t,activity:en,activityTotal:Ot,accountList:r,accountListResolved:s,sourceStatuses:Le,resolvedSources:gn,isFetching:o.isFetching||l.isFetching||G.isFetching||d.isFetching||X.isFetching||n.isFetching,refresh:Aa,reconnected:Aa}},Bbe=e=>Po(e?.holdings??[]).length;function VI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(r){VV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ube(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,s;for(s=0;s<r.length;s++)a=r[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function qbe(e,t){if(e==null)return{};var n=Ube(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _f(e,t){return Hbe(e)||Kbe(e,t)||Vbe(e,t)||Gbe()}function Hbe(e){if(Array.isArray(e))return e}function Kbe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],a=!0,s=!1,o,l;try{for(n=n.call(e);!(a=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));a=!0);}catch(u){s=!0,l=u}finally{try{!a&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function Vbe(e,t){if(e){if(typeof e=="string")return GI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GI(e,t)}}function GI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 491In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Wbe=["src","checkForExisting"],mm={},WI=function(t){var n=document.querySelector('script[src="'.concat(t,'"]'));if(n)return mm[t]={loading:!1,error:null,scriptEl:n}},YI=typeof window<"u"&&typeof window.document<"u";function Ybe(e){var t=e.src,n=e.checkForExisting,r=n===void 0?!1:n,a=qbe(e,Wbe),s=t?mm[t]:void 0;!s&&r&&t&&YI&&(s=WI(t));var o=v.useState(s?s.loading:!!t),l=_f(o,2),u=l[0],d=l[1],h=v.useState(s?s.error:null),p=_f(h,2),g=p[0],x=p[1],y=v.useState(!1),w=_f(y,2),j=w[0],N=w[1];return v.useEffect(function(){if(!(!YI||!t||j||g)){s=mm[t],!s&&r&&(s=WI(t));var k;s?k=s.scriptEl:(k=document.createElement("script"),k.src=t,Object.keys(a).forEac
491h(function(O){k[O]===void 0?k.setAttribute(O,a[O]):k[O]=a[O]}),s=mm[t]={loading:!0,error:null,scriptEl:k});var S=function(){s&&(s.loading=!1),d(!1),N(!0)},E=function(T){s&&(s.error=T),x(T)};return k.addEventListener("load",S),k.addEventListener("error",E),document.body.appendChild(k),function(){k.removeEventListener("load",S),k.removeEventListener("error",E),s&&s.loading&&(k.remove(),delete mm[t])}}},[t]),[u,g]}var Xbe=function(t,n,r){var a={};return delete Object.assign(a,t,VV({},r,t[n]))[n],a},Qbe=function(t,n){var r={plaid:null,open:!1,onExitCallback:null};if(typeof window>"u"||!window.Plaid)throw new Error("Plaid not loaded");r.plaid=n(Yy(Yy({},t),{},{onExit:function(d,h){r.open=!1,t.onExit&&t.onExit(d,h),r.onExitCallback&&r.onExitCallback()}}));var a=function(){r.plaid&&(r.open=!0,r.onExitCallback=null,r.plaid.open())},s=function(d){r.plaid&&r.plaid.submit(d)},o=function(d,h){if(!r.open||!r.plaid){h&&h();return}r.onExitCallback=h,r.plaid.exit(d),d&&d.force&&(r.open=!1)},l=function(){r.plaid&&(r.plaid.destroy(),r.plaid=null)};return{open:a,submit:s,exit:o,destroy:l}},Zbe=function(t,n){var r=Xbe(t,"publicKey","key");return Qbe(r,n)},Jbe="https://cdn.plaid.com/link/v2/stable/link-initialize.js",XI=function(){},GV=function(t){var n=Ybe({src:Jbe,checkForExisting:!0}),r=_f(n,2),a=r[0],s=r[1],o=v.useState(null),l=_f(o,2),u=l[0],d=l[1],h=v.useState(!1),p=_f(h,2),g=p[0],x=p[1],y=(t.product||[]).slice().sort().join(",");v.useEffect(function(){if(!a&&!(!t.token&&!t.publicKey&&!t.receivedRedirectUri)){if(s||!window.Plaid){console.error("Error loading Plaid",s);return}u?.exit({force:!0},function(){return u.destroy()});var N=Zbe(Yy(Yy({},t),{},{onLoad:function(){x(!0),t.onLoad&&t.onLoad()}}),window.Plaid.create);return d(N),function(){return N.exit({force:!0},function(){return N.destroy()})}}},[a,s,t.publicKey,t.token,y]);var w=u!=null&&(!a||g),j=function(){t.token||console.warn("react-plaid-link: You cannot call open() without a valid token supplied to usePlaidLink. This is a no-op.")};return{error:s,ready:w,submit:u?u.submit:XI,exit:u?u.exit:XI,open:u?u.open:j}},QI;(function(e){e.OPEN="OPEN",e.EXIT="EXIT",e.HANDOFF="HANDOFF",e.SELECT_INSTITUTION="SELECT_INSTITUTION",e.ERROR="ERROR",e.BANK_INCOME_INSIGHTS_COMPLETED="BANK_INCOME_INSIGHTS_COMPLETED",e.IDENTITY_VERIFICATION_PASS_SESSION="IDENTITY_VERIFICATION_PASS_SESSION",e.IDENTITY_VERIFICATION_FAIL_SESSION="IDENTITY_VERIFICATION_FAIL_SESSION"})(QI||(QI={}));const dC=async(e,t)=>{const{data:n}=await Je.post("/plaid/create_link_token",{accountId:e,products:t?.products});if(!n.success||!n.data?.link_token)throw new Error("Failed to create link token");return n.data.link_token},WV=async e=>{const{data:t}=await Je.post("/plaid/exchange_public_token",{public_token:e});if(!t.success||!t.data)throw new Error("Failed to exchange public token");return t.data},e0e=async()=>{const{data:e}=await Je.get("/plaid/connections");if(!e.success||!e.data)throw new Error("Failed to fetch connection health");return e.data},Ku="accountConnections",t0e=(e=!0)=>Nt({queryKey:[Ku],queryFn:e0e,enabled:e&&!!Et(),staleTime:5*60*1e3}),n0e=()=>{const[e,t]=v.useState(null),n=mn(),r=v.useCallback(async(o,l)=>{try{return t(o),l?.length?await dC(o,{products:l}):await dC(o)}catch(u){throw t(null),u}},[]),a=v.useCallback(async o=>{try{await WV(o),await n.invalidateQueries({queryKey:["user"]}),await n.invalidateQueries({queryKey:[Uu]}),await n.invalidateQueries({queryKey:[xh]}),await n.invalidateQueries({queryKey:[Ku]})}finally{t(null)}},[n]),s=v.useCallback(()=>{t(null)},[]);return{reconnect:r,onReconnectSuccess:a,onReconnectExit:s,isReconnecting:e}},mA=({onReconnected:e})=>{const[t,n]=v.useState(null),{reconnect:r,onReconnectSuccess:a,onReconnectExit:s,isReconnecting:o}=n0e(),{open:l,ready:u}=GV({token:t??"",onSuccess:async p=>{try{await a(p),await e()}catch{}finally{n(null)}},onExit:()=>{s(),n(null)}}),d=!!t&&u;return qo(d),v.useEffect(()=>{d&&l()},[d,l]),{startReconnect:v.useCallback(async(p,g)=>{try{n(await r(p,g))}catch{}},[r]),isReconnecting:o,isLinkOpen:d}},YV="flex flex-col gap-3 mb-5 lg:flex-row lg:justify-between lg:items-start lg:gap-4 lg:mb-6 lg:pr-14",XV="grid grid-cols-2 gap-2.5 [&>*]:justify-center lg:flex lg:items-center lg:[&>*]:justify-start";
491function Vu({title:e,subtitle:t,children:n}){return i.jsxs("div",{className:YV,children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-[22px] lg:text-2xl leading-tight font-extrabold tracking-tight text-slate-900",children:e}),i.jsx("p",{className:"text-[13px] lg:text-base text-slate-500 mt-1",children:t})]}),n&&i.jsx("div",{className:XV,children:n})]})}function gA({value:e,onChange:t,label:n="Date range",disabled:r=!1,className:a=""}){return i.jsx("div",{role:"group","aria-label":n,className:`flex gap-0.5 border border-border rounded-lg p-[3px] bg-surface ${a}`,children:Vm.map(s=>i.jsx("button",{type:"button","aria-pressed":s.id===e,disabled:r,onClick:()=>t(s.id),className:`flex-1 lg:flex-none px-2.5 py-2 lg:py-1.5 rounded-md text-xs font-semibold transition-colors disabled:opacity-50 ${s.id===e?"bg-surface-muted text-slate-900":"text-slate-500 hover:text-slate-900"}`,children:s.label},s.id))})}const $1=[{id:"transactions",label:"Transactions",description:"Balances and spending history for checking, savings and cards."},{id:"liabilities",label:"Liabilities",description:"Credit cards, student loans and mortgages, with rates and due dates."},{id:"investments",label:"Investments",description:"Holdings and trades in brokerage, IRA, 401k and HSA accounts."}],r0e=["transactions"],I1=["transactions","investments"],ZI=e=>$1.filter(({id:t})=>e.includes(t)).map(({id:t})=>t),a0e=e=>$1.filter(({id:t})=>!e.includes(t)).map(({id:t})=>t),Ro={single:1,standard:3,pro:7},s0e=Ro.pro;function i0e(e){return`${e} financial account${e===1?"":"s"}`}const Xy=Ro.single;function QV(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function o0e(e,t){if(!QV(t))return!1;const n=e?Ro[e]??Xy:Xy;return t!==n}function l0e(e,t){return QV(t)?t:e?Ro[e]??Xy:Xy}function c0e(e){return e<s0e?"pro":null}function u0e(e){if(!e)return;const t=e.toLowerCase();return Object.keys(Ro).includes(t)?t:void 0}function d0e(){const{data:e,isLoading:t}=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),n=u0e(e?.gas?.subscription?.plan),r=e?.gas?.subscription?.period==="year"?"year":"month",a=e?.gas?.user?.credits?.accounts,s=e?.accounts?.length??0,o=l0e(n,a),l=o0e(n,a);return{isLoading:t,plan:n,period:r,used:s,limit:o,atLimit:s>=o,isCustomLimit:l,recommendedPlan:l?null:c0e(o)}}const Vf={single:{title:"SINGLE PLAN",subtitle:"Sync data from a single financial account, and its credit cards",month:{price:5,interval:"month",price_id:"am"},year:{price:50,originalPrice:60,interval:"year",price_id:"ay"}},standard:{title:"STANDARD PLAN",subtitle:`Sync data from ${Ro.standard} different financial accounts, and their credit cards`,month:{price:14,interval:"month",price_id:"bm"},year:{price:140,originalPrice:168,interval:"year",price_id:"by"}},pro:{title:"PRO PLAN",subtitle:`Sync data from ${Ro.pro} different financial accounts, and their credit cards`,month:{price:22,interval:"month",price_id:"cm"},year:{price:220,originalPrice:264,interval:"year",price_id:"cy"}}},_s=["single","standard","pro"];function Au(e){return e==="standard"}const JI={am:"price_1LsflzBJWl1jKWtm5KUJkGu0",ay:"price_1LsflzBJWl1jKWtmqWPLk8Bo",bm:"price_1Kc5CMBJWl1jKWtm8iTD37yX",by:"price_1LsfraBJWl1jKWtm2vuTwZml",cm:"price_1KkPDsBJWl1jKWtmmjGhXIFj",cy:"price_1KkPDsBJWl1jKWtmWh2yBVVK"};function _o(e){return e.charAt(0).toUpperCase()+e.slice(1)}function f0e(e,t){const n=Vf[e];return t==="year"?n.year.price_id:n.month.price_id}function ZV(e){const t=e||"am",n=JI[t]??JI.am;if(!n)throw new Error(`No Stripe price id configured for "${t}"`);return n}function h0e(e,t){return ZV(f0e(e,t))}const JV={single:"50MB",standard:"Unlimited",pro:"Unlimited"},eG={single:50,standard:130,pro:300};function p0e(e){return`${e} documents parsed a month`}const $c={dailyUpdates:"Daily account updates",autoCategorization:"Automatic transaction categorization",documentAnalysis:"Document analysis (receipts & invoices)",documentsMatching:"Documents â Transaction matching",investments:"Investments & portfolio tracking",googleSheets:"Google Sheets⢠add-on",driveBackup:"Google Drive document backup"},m0e=_s.reduce((e,t)=>(e[t]=String(Ro[t]),e),{}),g0e=_s.reduce((e,t)=>
491(e[t]=String(eG[t]),e),{}),Qy=[{section:"Accounts & storage",rows:[{label:"Financial accounts + their credit cards",kind:"value",values:m0e},{label:"Document storage",kind:"value",values:JV},{label:"Documents parsed per month",kind:"value",values:g0e},{label:$c.dailyUpdates,kind:"check"}]},{section:"Automation & insights",rows:[{label:$c.autoCategorization,kind:"check"},{label:$c.documentAnalysis,kind:"check",isNew:!0,description:"Reads uploaded documents into structured data"},{label:$c.documentsMatching,kind:"check",isNew:!0},{label:$c.investments,kind:"check",isNew:!0,description:"Holdings and positions from your linked accounts"}]},{section:"AI & integrations",rows:[{label:$c.googleSheets,kind:"check"},{label:$c.driveBackup,kind:"check",isNew:!0}]}];function tG(e,t){return e.kind==="value"?{kind:"value",text:e.values?.[t]??""}:{kind:"check"}}const x0e=Qy.flatMap(e=>e.rows).filter(e=>e.kind==="check").map(e=>e.label);function xA(e){return[i0e(Ro[e]),`${JV[e]} document storage`,p0e(eG[e]),...x0e]}const fC="[email protected]",hk=e=>`${e} financial account${e===1?"":"s"}`;function b0e({used:e,limit:t,plan:n,period:r,isCustomLimit:a,recommendedPlan:s,onClose:o}){const l=Sa();v.useEffect(()=>{const h=p=>{p.key==="Escape"&&o()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[o]);const u=h=>{ql("account_limit_upgrade_click",{source:h,plan:n,used:e,limit:t}),o(),l("/billing")},d=a?`Your account is set to a limit of ${hk(t)}.`:n?`Your ${_o(n)} plan connects up to ${hk(t)}.`:`Your plan connects up to ${hk(t)}.`;return i.jsx("div",{className:"fixed inset-0 bg-gray-900/50 backdrop-blur-sm flex items-end justify-center z-50 p-0 lg:items-center lg:p-5",children:i.jsxs("div",{className:"w-full max-w-lg bg-white rounded-t-2xl lg:rounded-2xl shadow-2xl overflow-y-auto max-h-[92dvh] lg:overflow-hidden lg:max-h-none pb-[env(safe-area-inset-bottom)] lg:pb-0",children:[i.jsxs("div",{className:"pt-6 px-6 flex items-start gap-3.5",children:[i.jsx("div",{className:"w-11 h-11 rounded-xl bg-brand-soft flex items-center justify-center flex-shrink-0",children:i.jsx(jg,{className:"w-5 h-5 text-brand"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-extrabold text-gray-900",children:"You've reached your account limit"}),i.jsxs("p",{className:"text-[13.5px] text-slate-500 mt-1 leading-snug",children:[d,s?" Upgrade to connect more.":""]})]}),i.jsx("button",{onClick:o,className:"ml-auto flex-none w-[42px] h-[42px] -mt-2 -mr-2 lg:w-auto lg:h-auto lg:m-0 flex items-center justify-center text-slate-400 hover:text-slate-600 p-1","aria-label":"Close",children:i.jsx(Ut,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"px-6 pt-5 pb-1",children:[i.jsxs("div",{className:"border border-border rounded-xl p-4 bg-surface-2 mb-4",children:[i.jsxs("div",{className:"flex justify-between items-baseline",children:[i.jsx("span",{className:"text-[13px] font-bold text-slate-700",children:"Connected accounts"}),i.jsxs("span",{className:"text-[13px] font-extrabold text-amount-neg",children:[e," of ",t," used"]})]}),i.jsx("div",{className:"h-[9px] rounded-full bg-surface-muted mt-2.5 overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full bg-amount-neg",style:{width:`${Math.min(100,t>0?e/t*100:100)}%`}})})]}),s?i.jsx(y0e,{plan:s,period:r}):i.jsxs("div",{className:"flex gap-3 border border-yellow-200 bg-badge-yellow rounded-xl p-3.5",children:[i.jsx(na,{className:"w-5 h-5 text-badge-yellow-text flex-shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[13.5px] font-extrabold text-badge-yellow-text",children:"There's no higher plan to move to"}),i.jsxs("div",{className:"text-[12.5px] text-badge-yellow-text mt-1 leading-relaxed",children:["To connect a new account, remove one you no longer use to free up a slot â or contact support if you need to track more than ",t," accounts."]})]})]})]}),s?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col-reverse gap-2.5 px-6 pt-5 pb-2 lg:flex-row lg:gap-3",children:[i.jsx("button",{onClick:o,className:"lg:flex-1 rounded-lg py-3 text-[14.5px] font-bold border border-border bg-white text-slate-700 hover:bg-surface-2",children:"Maybe later"}),i.jsxs("button",{onClick:()=>u("upgrade_button"),className:"lg:flex-1 rounded-lg py-3 text-[14.5px] font-bold bg-brand hover:bg-brand-hover text-white flex items-center justify-center gap-2",children:["Upgrade to ",_o(s),i.jsx(zu,{className:"w-4 h-4"})]})]}),i.jsxs("div",{className:"text-center text-[11.5px] text-slate-400 pb-5",children:["Prorated instantly ·"," ",i.jsx("button",{onClick:()=>u("see_all_plans"),className:"font-bold text-slate-600 underline underline-offset-2",children:"See all plans"})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col-reverse gap-2.5 px-6 pt-5 pb-2 lg:flex-row lg:gap-3",children:[i.jsx("a",{href:`mailto:${fC}`,onClick:()=>ql("account_limit_contact_support",{plan:n,used:e,limit:t}),className:"lg:flex-1 rounded-lg py-3 text-[14.5px] font-bold border border-border bg-white text-slate-700 hover:bg-surface-2 flex items-center justify-center",children:"Contact support"}),i.jsx("button",{onClick:()=>{ql("account_limit_manage_accounts",{plan:n,used:e,limit:t}),o(),l("/accounts")},className:"lg:flex-1 rounded-lg py-3 text-[14.5px] font-bold bg-brand hover:bg-brand-hover text-white",children:"Manage accounts"})]}),i.jsx("div",{className:"text-center text-[11.5px] text-slate-400 pb-5 px-6 leading-relaxed",children:"Your limit is set by your plan. A custom limit may apply if your account has dedicated credits."})]})]})})}function y0e({plan:e,period:t}){const n=Vf[e],r=t==="year"?n.year:n.month;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"text-[11px] font-extrabold tracking-wider up
491percase text-slate-400 mb-2",children:"Recommended upgrade"}),i.jsxs("div",{className:"relative border-[1.5px] border-brand rounded-2xl p-4 bg-gradient-to-b from-brand-soft to-white",children:[i.jsx("div",{className:"absolute -top-2.5 left-4 bg-brand text-white text-[10.5px] font-extrabold tracking-wide px-2.5 py-0.5 rounded-full",children:"MOST CAPACITY"}),i.jsxs("div",{className:"flex justify-between items-start gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-[13px] font-extrabold tracking-widest text-slate-600",children:n.title}),i.jsx("div",{className:"text-[12.5px] text-slate-500 mt-1 leading-snug max-w-[270px]",children:n.subtitle})]}),i.jsxs("div",{className:"text-right whitespace-nowrap",children:[i.jsxs("div",{className:"text-2xl font-extrabold tracking-tight text-gray-900",children:["$",r.price]}),i.jsxs("div",{className:"text-[12.5px] text-slate-500 font-bold",children:["/ ",r.interval]})]})]}),i.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2 mt-3.5",children:xA(e).map((a,s)=>i.jsxs("div",{className:`flex items-center gap-2 text-[13px] ${s===0?"font-extrabold text-slate-900":"font-semibold text-slate-700"}`,children:[i.jsx("span",{className:"w-[18px] h-[18px] rounded-md bg-badge-green text-badge-green-text flex items-center justify-center flex-shrink-0",children:i.jsx(Zt,{className:"w-3 h-3",strokeWidth:3})}),a]},a))})]})]})}function Ql({label:e="Add Bank Account",defaultProducts:t=r0e,skipProductPicker:n=!1,fullWidthOnMobile:r=!1,mobileLabel:a}={}){const s=mn(),{atLimit:o,used:l,limit:u,plan:d,period:h,isCustomLimit:p,recommendedPlan:g}=d0e(),[x,y]=v.useState(!1),[w,j]=v.useState(null),[N,k]=v.useState(!1),[S,E]=v.useState(!1),[O,T]=v.useState(()=>ZI(t)),P=v.useRef(null),M=v.useCallback(async $=>{try{y(!0),await WV($),await s.invalidateQueries({queryKey:["user"]}),await s.invalidateQueries({queryKey:[Uu]}),await s.invalidateQueries({queryKey:[xh]}),await s.invalidateQueries({queryKey:[Ku]})}catch{alert("Failed to connect bank account. Please try again.")}finally{y(!1),j(null)}},[s]),D={token:w??"",onSuccess:M,onExit:()=>{j(null),y(!1)}},{open:A,ready:L}=GV(D),F=!!w&&L;qo(F),v.useEffect(()=>{F&&A()},[F,A]),v.useEffect(()=>{if(!N)return;const $=G=>{P.current?.contains(G.target)||k(!1)},K=G=>{G.key==="Escape"&&k(!1)};return document.addEventListener("mousedown",$),document.addEventListener("keydown",K),()=>{document.removeEventListener("mousedown",$),document.removeEventListener("keydown",K)}},[N]);const B=$=>{T(K=>ZI(K.includes($)?K.filter(G=>G!==$):[...K,$]))},U=()=>{if(o){ql("account_limit_reached",{plan:d,used:l,limit:u,variant:g?"upgrade":"max_tier"}),E(!0);return}n?z():k($=>!$)},z=async()=>{if(o){E(!0);return}if(!(x||O.length===0)){k(!1);try{y(!0);const $=await dC(void 0,{products:O});j($)}catch{alert("Failed to initialize bank connection. Please try again."),j(null),y(!1)}}};return i.jsxs("div",{className:`relative ${r?"w-full lg:w-auto":""}`,ref:P,children:[i.jsx("button",{type:"button",className:`inline-flex items-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50 whitespace-nowrap ${r?"w-full justify-center h-[42px] text-sm lg:text-base lg:h-auto lg:w-auto":""}`,onClick:U,disabled:x,"aria-haspopup":n?void 0:"dialog","aria-expanded":n?void 0:N,children:x?i.jsxs(i.Fragment,{children:[i.jsx(Dt,{size:"sm"}),"Connecting..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Qs,{className:"h-[15px] w-[15px]"}),a?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"lg:hidden",children:a}),i.jsx("span",{className:"hidden lg:inline",children:e})]}):e,!n&&i.jsx(Ca,{className:"h-[15px] w-[15px]"})]})}),N&&i.jsxs("div",{role:"dialog","aria-label":"Choose what to connect",className:"absolute right-0 z-20 mt-2 w-80 max-w-[calc(100vw-32px)] rounded-xl border border-border bg-surface shadow-card p-4 text-left",children:[i.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Choose what to connect"}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Only banks that support everything you tick will be listed."}),i.jsx("div",{className:"mt-3 space-y-2",children:$1.map($=>i.jsxs("label",{htmlFor:`add-account-${$.id}`,className:"flex gap-2.5 items-start rounded-lg border border-border p-3 cursor-pointer hover:bg-surface-muted",children:[i.jsx("input",{id:`add-account-${$.id}
491`,type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-border text-brand",checked:O.includes($.id),onChange:()=>B($.id)}),i.jsxs("span",{children:[i.jsx("span",{className:"block text-sm font-medium text-slate-900",children:$.label}),i.jsx("span",{className:"block mt-1 text-xs leading-relaxed text-slate-500",children:$.description})]})]},$.id))}),i.jsx("button",{type:"button",className:"mt-3 w-full inline-flex items-center justify-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50",onClick:z,disabled:O.length===0,children:"Continue"}),O.length===0&&i.jsx("p",{className:"mt-2 text-xs text-amount-neg",children:"Pick at least one to continue."})]}),S&&i.jsx(b0e,{used:l,limit:u,plan:d,period:h,isCustomLimit:p,recommendedPlan:g,onClose:()=>E(!1)})]})}function e6({range:e,onRangeChange:t,onRefresh:n,isRefreshing:r,showRange:a=!0}){return i.jsxs(Vu,{title:"Dashboard",subtitle:"Everything across your accounts, documents, transactions and investments.",children:[a&&i.jsx(gA,{value:e,onChange:t,label:"Transactions date range",className:"col-span-2 w-full lg:w-auto"}),i.jsxs("button",{type:"button",onClick:n,disabled:r,className:"inline-flex items-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 disabled:opacity-50",children:[i.jsx(dt,{className:`h-[15px] w-[15px] ${r?"animate-spin":""}`}),r?"Refreshing...":"Refresh"]}),i.jsx(Ql,{label:"Add Account",fullWidthOnMobile:!0})]})}const v0e={loading:"border-blue-200 bg-surface text-blue-800",ready:"border-green-200 bg-badge-green text-badge-green-text",error:"border-red-200 bg-badge-red text-badge-red-text"},w0e={loading:dt,ready:Zt,error:Jt};function j0e({statuses:e,sources:t=KV}){const n=t.filter(r=>e[r]!=="loading");return n.length===t.length?null:i.jsxs("div",{role:"status","aria-live":"polite",className:"flex items-center gap-2.5 flex-wrap rounded-xl border border-blue-200 bg-brand-soft px-4 py-2.5 mb-[18px] text-[12.5px] font-semibold text-blue-800",children:[i.jsx(dt,{className:"w-[15px] h-[15px] text-brand animate-spin flex-none"}),i.jsxs("span",{children:["Loading Dashboard â ",n.length," of ",t.length," sources have landed. Panels fill in as they arrive."]}),i.jsx("span",{className:"w-full lg:w-auto lg:ml-auto flex items-center gap-2 flex-wrap",children:t.map(r=>{const a=e[r],s=w0e[a];return i.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-[11px] font-bold ${v0e[a]}`,children:[i.jsx(s,{className:`w-3 h-3 ${a==="loading"?"animate-spin":""}`}),Lbe[r]]},r)})})]})}const N0e=e=>(e||"?").split(" ").filter(Boolean).slice(0,2).map(t=>t[0]?.toUpperCase()??"").join("")||"?";function ra({name:e,logo:t,className:n="w-[26px] h-[26px]"}){return t?i.jsx("img",{src:`data:image/png;base64,${t}`,alt:e,className:`${n} rounded-[7px] object-contain bg-surface-muted flex-none`}):i.jsx("span",{className:`${n} rounded-[7px] flex-none flex items-center justify-center bg-slate-700 text-white text-[10px] font-extrabold tracking-tight`,children:N0e(e)})}const nG="px-4 py-3 min-w-[184px]",ja="inline-flex items-center gap-1.5 px-2.5 py-[3px] rounded-full text-[11px] font-bold whitespace-nowrap",bA={login_required:Jt,preparing:xr,error:Jt,not_reporting:na,active:na},_0e="/documents",t6="overview",k0e=[{path:"overview",label:"Overview",icon:Bo},{path:"all",label:"All documents",icon:ri},{path:"review",label:"Needs review",icon:Jt},{path:"sources",label:"Sources",icon:Yn}],rs=e=>`${_0e}/${e}`,Gf=e=>`${rs("all")}/${encodeURIComponent(e)}`,yA=`${rs("review")}/inbox`,Tu=`${rs("review")}/match`,S0e={inbox:{icon:r1,tone:"bg-brand-soft text-brand",title:e=>`${e} document${e===1?"":"s"} waiting in the inbox`,body:"Check the vendor, date and total the parser read, one document at a time.",to:yA,action:"Open inbox"},unmatched:{icon:Fi,tone:"bg-purple-50 text-purple-700",title:e=>`${e} document${e===1?"":"s"}
491 with no transaction against them`,body:"Put each document against the card charge it belongs to.",to:Tu,action:"Open workbench"},"failed-parse":{icon:Zle,tone:"bg-badge-red text-badge-red-text",title:e=>`${e} document${e===1?"":"s"} could not be read`,body:"Re-upload a clearer scan, or enter the vendor and total by hand.",to:rs("review"),action:"Open review"}};function C0e({items:e,logos:t,isReconnecting:n,onReconnect:r,onRetry:a,isRefreshing:s}){if(e.length===0)return null;const o=e.some(l=>l.kind==="connection");return i.jsxs("section",{className:`rounded-xl bg-surface shadow-card overflow-hidden ${o?"border border-red-200":"border border-border"}`,children:[i.jsxs("header",{className:"flex items-center gap-x-2.5 gap-y-1 flex-wrap lg:flex-nowrap px-4 lg:px-[18px] py-3 bg-surface-2 border-b border-border",children:[i.jsx(Jt,{className:"w-4 h-4 text-badge-red-text"}),i.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-slate-900",children:"Needs your attention"}),i.jsx("span",{className:"text-[11px] font-extrabold rounded-full px-2 py-0.5 bg-badge-red text-badge-red-text",children:e.length}),o&&i.jsx("span",{className:"w-full lg:w-auto lg:ml-auto text-xs text-slate-500",children:"Balances above are not counted until these are fixed"})]}),e.map(l=>{if(l.kind==="connection"&&l.entry){const{account:h,state:p,error:g}=l.entry,x=bA[p],y=ic[p];return i.jsxs("article",{className:"px-4 lg:px-[18px] py-4 border-b border-border last:border-b-0",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ra,{name:h.name,logo:t[h.institution_id],className:"w-[34px] h-[34px]"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("p",{className:"flex items-center gap-2.5 flex-wrap",children:[i.jsx("span",{className:"text-[14.5px] font-extrabold tracking-tight text-slate-900",children:h.title||h.name}),i.jsxs("span",{className:`${ja} ${y.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${y.dotClassName}`}),y.label]})]}),i.jsx("p",{className:"text-[12.5px] text-slate-500 mt-0.5",children:h.name})]})]}),i.jsxs("p",{className:`flex gap-2.5 items-start rounded-lg px-3 py-2.5 mt-3 text-[12.5px] leading-relaxed ${R1[p]}`,children:[i.jsx(x,{className:"w-[15px] h-[15px] flex-none mt-px"}),i.jsx("span",{children:g?.error??M1[p]})]}),i.jsx("div",{className:"flex gap-2 mt-3 flex-wrap",children:p==="preparing"?i.jsxs("button",{type:"button",onClick:a,disabled:s,className:"inline-flex items-center gap-1.5 min-h-[42px] lg:min-h-0 rounded-lg border border-border bg-surface px-3 py-1.5 text-xs font-bold text-slate-600 hover:bg-slate-100 disabled:opacity-50",children:[i.jsx(dt,{className:`w-3 h-3 ${s?"animate-spin":""}`}),s?"Checking...":"Try again"]}):i.jsx("button",{type:"button",onClick:()=>r(h.id),disabled:n===h.id,className:"inline-flex items-center gap-1.5 min-h-[42px] lg:min-h-0 rounded-lg border border-brand bg-brand px-3 py-1.5 text-xs font-bold text-white hover:bg-brand-hover disabled:opacity-50",children:n===h.id?"Reconnecting...":"Reconnect"})})]},l.key)}if(l.kind==="connection")return null;const u=S0e[l.kind],d=u.icon;return i.jsxs("article",{className:"flex flex-wrap lg:flex-nowrap items-start gap-x-3 gap-y-2.5 lg:gap-3 px-4 lg:px-[18px] py-4 border-b border-border last:border-b-0",children:[i.jsx("span",{className:`w-8 h-8 rounded-lg flex items-center justify-center flex-none ${u.tone}`,children:i.jsx(d,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"min-w-0 flex-1 basis-[calc(100%-44px)] lg:basis-0",children:[i.jsx("p",{className:"text-[13.5px] font-bold text-slate-900",children:u.title(l.count)}),i.jsx("p",{className:"text-xs text-slate-500 mt-1 leading-relaxed",children:u.body})]}),i.jsx(gt,{to:u.to,className:"ml-11 lg:ml-0 inline-flex items-center min-h-[42px] lg:min-h-0 lg:block text-xs font-bold text-brand whitespace-nowrap border border-border rounded-lg px-3 lg:px-2.5 py-1.5 hover:bg-slate-100",children:u.action})]},l.key)})]})}function L1({title:e,subtitle:t,icon:n,to:r,linkLabel:a,state:s,skeleton:o,footer:l,children:u}){const d=s.status==="loading";return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card flex flex-col","aria-busy":d,"aria-label":d?`Loading ${e.toLowerCase()}`:void 0,children:[i.jsxs("div",{className:"flex items-center gap-2.5 px-[18px] py-3.5 border-b border-border",children:[i.jsx("span",{className:"w-[26px] h-[26px] rounded-[7px] bg-brand-soft text-brand flex items-center justify-center flex-none",children:i.jsx(n,{className:"w-[15px] h-[15px]"})}),i.jsx("h2",{className:"text-[14.5px] font-extrabold tracking-tight text-slate-900",children:e}),t&&i.jsx("span",{className:"text-[12px] text-slate-500 font-medium",children:t}
491),d?i.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 text-[11.5px] font-bold text-brand",children:[i.jsx(dt,{className:"w-3.5 h-3.5 animate-spin"}),"Loading..."]}):r&&i.jsxs(gt,{to:r,className:"ml-auto text-[12px] font-bold text-brand inline-flex items-center gap-1",children:[a??e,i.jsx(va,{className:"w-3.5 h-3.5"})]})]}),i.jsxs("div",{className:"px-[18px] py-4 flex-1",children:[s.status==="loading"&&o,s.status==="error"&&i.jsxs("div",{className:"py-6 text-center",children:[i.jsx("span",{className:"w-[42px] h-[42px] rounded-[12px] bg-badge-red text-badge-red-text flex items-center justify-center mx-auto mb-3",children:i.jsx(Jt,{className:"w-5 h-5"})}),i.jsxs("p",{className:"text-[13.5px] font-extrabold tracking-tight text-slate-900",children:[e," could not be loaded"]}),i.jsx("p",{className:"mt-1.5 max-w-[320px] mx-auto text-[12px] text-slate-500 leading-relaxed",children:"Every other panel came from a different call and is unaffected by this one."}),i.jsx("p",{className:"mt-2 mb-4",children:i.jsx("code",{className:"inline-block rounded-[5px] bg-surface-muted px-2 py-0.5 text-[11px] text-slate-600",children:s.message})}),i.jsxs("button",{type:"button",onClick:s.retry,className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[12px] font-bold text-slate-600 hover:bg-slate-100",children:[i.jsx(dt,{className:"w-3.5 h-3.5"}),"Try again"]})]}),s.status==="ready"&&u(s.data,s.partial)]}),l&&i.jsx("div",{className:"px-[18px] py-3 border-t border-border bg-surface-2 text-[12px] text-slate-500 rounded-b-xl",children:l})]})}const Qr=({className:e})=>i.jsx("span",{className:`block rounded-full bg-surface-muted animate-pulse ${e}`});function E0e(){return i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1.7fr_1fr] mb-4","aria-busy":"true","aria-label":"Loading balances",children:[i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card p-5",children:[i.jsx(Qr,{className:"h-2.5 w-24"}),i.jsx("span",{className:"block h-8 w-56 rounded bg-surface-muted animate-pulse mt-3"}),i.jsx(Qr,{className:"h-2.5 w-40 mt-3 opacity-70"}),i.jsx("div",{className:"mt-5 pt-4 border-t border-border",children:[0,1,2].map(e=>i.jsxs("span",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsx(Qr,{className:"w-[88px] h-2.5 flex-none"}),i.jsx("span",{className:"flex-1 h-5 rounded-md bg-surface-muted animate-pulse"}),i.jsx(Qr,{className:"w-[104px] h-2.5 flex-none"})]},e))})]}),i.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2].map(e=>i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card p-4",children:[i.jsx(Qr,{className:"h-2.5 w-20"}),i.jsx("span",{className:"block h-6 w-32 rounded bg-surface-muted animate-pulse mt-2.5"}),i.jsx(Qr,{className:"h-2 w-40 mt-3 opacity-70"})]},e))})]})}function vA({rows:e=3}){return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex gap-4",children:[0,1].map(t=>i.jsxs("span",{className:"flex-1",children:[i.jsx(Qr,{className:"h-2.5 w-16"}),i.jsx("span",{className:"block h-6 w-24 rounded bg-surface-muted animate-pulse mt-2"}),i.jsx(Qr,{className:"h-2 w-20 mt-2 opacity-70"})]},t))}),i.jsx("span",{className:"block h-px bg-border my-4"}),Array.from({length:e}).map((t,n)=>i.jsxs("span",{className:"flex items-center gap-2.5 py-2",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-lg bg-surface-muted animate-pulse flex-none"}),i.jsxs("span",{className:"flex-1",children:[i.jsx(Qr,{className:"h-2.5 w-[56%]"}),i.jsx(Qr,{className:"h-2 w-[36%] mt-1.5 opacity-70"})]}),i.jsx(Qr,{className:"h-2.5 w-[62px] flex-none"})]},n))]})}function O0e({rows:e=6}){return i.jsx(i.Fragment,{children:Array.from({length:e}).map((t,n)=>i.jsxs("span",{className:"flex items-center gap-2.5 py-2.5",children:[i.jsx(Qr,{className:"h-2.5 w-11 flex-none"}),i.jsx("span",{className:"w-[30px] h-[30px] rounded-lg bg-surface-muted animate-pulse flex-none"}),i.jsxs("span",{className:"flex-1",children:[i.jsx(Qr,{className:"h-2.5 w-[52%]"}),i.jsx(Qr,{className:"h-2 w-[34%] mt-1.5 opacity-70"})]}),i.jsx(Qr,{className:"h-2.5 w-[72px] flex-none"})]},n))})}const A0e=e=>e.length<=4?"text-[10.5px]":e.length<=5?"text-[9px]":e.length<=7?"text-[8px]":"text-[7px]";function oc({ticker:e,fallback:t="â",className:n="w-[34px] h-[34px] rounded-lg bg-surface-muted text-slate-600"}){const r=e||t;return i.jsx("span",{title:e??void 0,className:`${n} ${A0e(r)} flex-none flex items-center justify-center overflow-hidden px-1 font-extrabold tracking-tight`,children:i.jsx("span",{className:"truncate",children:r})})}function rG({missingCostBasis:e,totalPositions:t,coveredValue:n,totalValue:r,reviewTo:a}
491){if(e<=0)return null;const s=t-e,o=typeof n=="number"&&typeof r=="number"&&r>0?Math.round(n/r*1e3)/10:null;return i.jsxs("div",{className:"flex gap-2.5 items-start rounded-lg bg-badge-yellow text-badge-yellow-text px-3 py-2.5 text-xs leading-relaxed",children:[i.jsx(Qt,{className:"w-3.5 h-3.5 flex-none mt-px"}),i.jsxs("span",{children:[i.jsx("strong",{children:"Partial totals."})," ",e," position",e===1?"":"s"," report",e===1?"s":""," no cost basis, so gain/loss covers ",s," of ",t," ","position",t===1?"":"s",o===null?"":` â ${o}% of portfolio value`,".",a&&i.jsxs(gt,{to:a,className:"inline-flex items-center gap-1 font-bold underline underline-offset-2 ml-1 whitespace-nowrap",children:["Add cost basis",i.jsx(zu,{className:"w-3 h-3"})]})]})]})}const T0e="/investments",n6="overview",P0e=[{path:"overview",label:"Overview",icon:zi},{path:"holdings",label:"Holdings",icon:GU},{path:"allocation",label:"Allocation",icon:oO},{path:"accounts",label:"Accounts",icon:ac},{path:"activity",label:"Activity",icon:Uo},{path:"workbench",label:"Workbench",icon:KU,adminOnly:!0}],Ym=e=>`${T0e}/${e}`,Y0="position",X0="ticker",YBe=e=>`${Ym("holdings")}?${Y0}=${encodeURIComponent(e)}`,R0e=e=>`${Ym("activity")}?${X0}=${encodeURIComponent(e)}`,M0e=e=>P0e.filter(t=>!t.adminOnly||e),D0e=3,$0e=4;function I0e({state:e}){return i.jsx(L1,{title:"Investments",icon:zi,to:Ym("overview"),linkLabel:"Investments",state:e,skeleton:i.jsx(vA,{}),children:({holdings:t})=>{const n=t.holdings??[],r=Ou(t.totals_by_currency)[0]??null,a=oA(n),s=rA(n).slice(0,$0e),o=vV(n,D0e),l=Po(n).length,u=r?Hu(r.unrealized_gain_loss,r.cost_basis):null;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex gap-4 flex-wrap",children:[i.jsxs("div",{className:"flex-1 min-w-[120px]",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Portfolio value"}),i.jsx("p",{className:"text-[22px] font-extrabold tracking-tight tabular-nums text-slate-900 mt-1.5",children:r?Re(r.value,r.currency):je}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-1",children:[n.length," position",n.length===1?"":"s"," · ",l," account",l===1?"":"s"]})]}),i.jsxs("div",{className:"flex-1 min-w-[120px]",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Unrealised"}),i.jsx("p",{className:`text-[22px] font-extrabold tracking-tight tabular-nums mt-1.5 ${r?r.unrealized_gain_loss<0?"text-amount-neg":"text-amount-pos":"text-slate-400"}`,children:r?Ee(r.unrealized_gain_loss,r.currency):je}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-1",children:u===null?"no cost basis reported":`${u>0?"+":""}${u}% on ${Re(r.cost_basis,r.currency)} cost`})]})]}),r&&i.jsx("div",{className:"mt-3",children:i.jsx(rG,{missingCostBasis:a,totalPositions:n.length,coveredValue:r.covered_value,totalValue:r.value,reviewTo:Ym("allocation")})}),s.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-px bg-border my-4"}),i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"Allocation by security type"}),i.jsx("div",{className:"h-2.5 rounded-full bg-surface-muted overflow-hidden flex gap-0.5",children:s.filter(d=>d.percent!==null&&d.percent>0).map(d=>i.jsx("span",{title:ei(d.security_type),className:"block h-full",style:{width:`${d.percent}%`,backgroundColor:Ja(d.security_type)}},d.security_type))}),i.jsx("p",{className:"flex flex-wrap gap-x-3 gap-y-1.5 mt-2.5",children:s.map(d=>i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11.5px] font-semibold text-slate-500",children:[i.jsx("span",{className:"w-2 h-2 rounded-sm",style:{backgroundColor:Ja(d.security_type)}}),ei(d.security_type)," ",d.percent===null?je:`${d.percent}%`]},d.security_type))})]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-px bg-border my-4"}),i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-1",children:"Largest positions"}),o.map(d=>i.jsxs("div",{className:"flex items-center gap-2.5 py-2",children:[i.jsx(oc,{ticker:d.ticker}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[13px] font-semibold text-slate-900 truncate",children:d.security_name??d.ticker??"Unknown security"}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500",children:[d.quantity??je," units ·"," ",Re(d.price,d.
491currency)]})]}),i.jsxs("span",{className:"text-right tabular-nums",children:[i.jsx("span",{className:"block text-[13px] font-bold text-slate-900",children:Re(d.value,d.currency)}),i.jsx("span",{className:`block text-[11.5px] font-bold ${d.unrealized_gain_loss===null||d.unrealized_gain_loss===void 0?"text-slate-400":d.unrealized_gain_loss<0?"text-amount-neg":"text-amount-pos"}`,children:d.unrealized_gain_loss===null||d.unrealized_gain_loss===void 0?"not reported":Ee(d.unrealized_gain_loss,d.currency)})]})]},vn(d)))]})]})}})}function F1(e){const t=new Map;for(const n of e){if(typeof n.amount!="number"||n.amount>=0)continue;const r=vh(n);t.set(r,(t.get(r)||0)+Math.abs(n.amount))}return[...t.entries()].map(([n,r])=>({category:n,amount:Math.round(r*100)/100})).sort((n,r)=>r.amount-n.amount)}function z1(e,t=5){const n=new Map;for(const r of e){const a=Number(r.amount);if(!Number.isFinite(a)||a>=0)continue;const s=br(r),o=n.get(s)??{amount:0,count:0};o.amount+=Math.abs(a),o.count+=1,n.set(s,o)}return[...n.entries()].map(([r,a])=>({merchant:r,amount:Math.round(a.amount*100)/100,count:a.count})).sort((r,a)=>a.amount-r.amount||r.merchant.localeCompare(a.merchant)).slice(0,t)}function wA(e,t){let n=0,r=0,a=0;for(const o of e){const l=$g(o,t);l==="unknown"&&(a+=1),_be(l)&&(l==="matched"?n+=1:r+=1)}const s=n+r;return{matched:n,needsReceipt:r,eligible:s,percent:s>0?Math.round(n/s*100):null,unknown:a}}function L0e(e){const t=new Map;for(const n of e){const r=String(n.date??"").slice(0,10);if(!r)continue;const a=t.get(r);a?a.push(n):t.set(r,[n])}return[...t.entries()].sort((n,r)=>r[0].localeCompare(n[0])).map(([n,r])=>({date:n,rows:r,net:Math.round(r.reduce((a,s)=>Number.isFinite(Number(s.amount))?a+Number(s.amount):a,0)*100)/100,accounts:new Set(r.map(a=>a.plaid_account_id)).size}))}const F0e=5;function z0e({state:e,range:t}){return i.jsx(L1,{title:"Spending",subtitle:obe(t),icon:Uo,to:Ko("overview"),linkLabel:"Transactions",state:e,skeleton:i.jsx(vA,{}),children:(n,r)=>{const a=r.includes("no-connections")?"No account is connected yet, so no transactions could be read. Connect one to see your spending here.":r.includes("no-transaction-accounts")?"Your connections are reporting, but none of them carry transactions. Connect a bank or card to see your spending here.":r.includes("no-readable-accounts")?"No connection is reporting, so no transactions could be read. Reconnect one to see your spending here.":null;if(a)return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex gap-4 flex-wrap",children:["Money out","Money in"].map(h=>i.jsxs("div",{className:"flex-1 min-w-[120px]",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:h}),i.jsx("p",{className:"text-[22px] font-extrabold tracking-tight tabular-nums text-slate-400 mt-1.5",children:je})]},h))}),i.jsxs("p",{className:"flex gap-2 items-start rounded-lg bg-badge-yellow text-badge-yellow-text px-3 py-2.5 mt-3 text-[11.5px] leading-relaxed",children:[i.jsx(Qt,{className:"w-3.5 h-3.5 flex-none mt-px"}),i.jsx("span",{children:a})]})]});const s=Xl(n.rows),o=F1(n.rows).slice(0,F0e),l=o[0]?.amount??0,u=z1(n.rows,1),d=wA(n.rows,n.matchesResolved);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex gap-4 flex-wrap",children:[i.jsxs("div",{className:"flex-1 min-w-[120px]",children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:["Money out",s.currency?` · ${s.currency}`:""]}),i.jsx("p",{className:"text-[22px] font-extrabold tracking-tight tabular-nums text-amount-neg mt-1.5",children:Ee(-s.moneyOut,s.currency)}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-1",children:[s.count," transaction",s.count===1?"":"s"]})]}),i.jsxs("div",{className:"flex-1 min-w-[120px]",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Money in"}),i.jsx("p",{className:"text-[22px] font-extrabold tracking-tight tabular-nums text-amount-pos mt-1.5",children:ge(s.moneyIn,s.currency)}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-1",children:["net ",Ee(s.net,s.currency)]})]})]}),n.accountErrors.length>0&&i.jsxs("p",{className:"flex gap-2 items-start rounded-lg bg-badge-yellow text-badge-yellow-text px-3 py-2.5 mt-3 text-[11.5px] leading-relaxed",children:[i.jsx(Qt,{className:"w-3.5 h-3.5 flex-none mt-px"}),i.jsxs("span",{children:[i.jsxs("strong",{children:[n.accountErrors.length," account",n.accountErrors.length===1?"":"s"," could not be read."]})," ","These figures cover the rest, so they are lower than your real spend."]})]}),n.truncated&&i.jsxs("p",{className:"flex gap-2 items-start rounded-lg bg-badge-blue text-badge-blue-text px-3 py-2.5 mt-2.5 text-[11.5px] leading-relaxed",children:[i.jsx(na,{className:"w-3.5 h-3.5 flex-none mt-px"}),i.jsx("span",{children:"The window was truncated â narrow the range for the full picture."})]}),i.jsx("div",{className:"h-px bg-border my-4"}),i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"Top categories"}),o.length===0?i.jsx("p",{className:"text-[12px] text-slate-500",children:"No spend in this window."}):o.map(h=>i.jsxs("div",{className:"flex items-center gap-2.5 mb-2 last:mb-0",children:[i.jsx("span",{className:"w-[76px] flex-none text-[12px] font-semibold text-slate-600 truncate",children:h.category}),i.jsx("span",{className:"flex-1 h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full rounded-full bg-brand",style:{width:l>0?`${h.amount/l*100}%`:"0%"}})}),i.jsx("span",{className:"min-w-[70px] lg:w-[70px] flex-none whitespace-nowrap text-right text-[12px] font-bold tabular-nums text-slate-900",children:ge(h.amount,s.currency)})]},h.category)),i.jsx("div",{className:"h-px bg-border my-4"}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:flex lg:flex-wrap",children:[i.jsxs("div",{className:"flex-1 min-w-[120px]",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Receipt coverage"}),i.jsx("p",{className:"text-[18px] font-extrabold tracking-tight tabular-nums text-slate-900 mt-1.5",children:d.percent===null?je:`${d.percent}%`}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-1",children:n.matchesResolved?d.percent===null?"no transactions need a document":`${d.matched} of ${d.eligible} have a document`:"coverage unavailable â the document lookup has not answered"})]}),i.jsxs("div",{className:"flex-1 min-w-[120px]",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Pending"}),i.jsx("p",{className:"text-[18px] font-extrabold tracking-tight tabular-nums text-slate-900 mt-1.5",children:ge(s.pendingValue,s.currency)}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-1",children:[s.pendingCount," transaction",s.pendingCount===1?"":"s"," not settled"]})]}),i.jsxs("div",{className:"flex-1 min-w-[120px]",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Top merchant"}),i.jsx("p",{className:"text-[18px] font-extrabold tracking-tight text-slate-900 mt-1.5 truncate",children:u[0]?.merchant??je}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-1",children:u[0]?`${ge(u[0].amount,s.currency)} over ${u[0].count} charge${u[0].count===1?"":"s"}`:"no spend to rank"})]})]})]})}})}function kf({label:e,badge:t,value:n,segments:r,hint:a}){return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-[18px] py-4",children:[i.jsxs("div",{className:"flex justify-between items-baseline gap-2",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:e}),t]}),i.jsx("p",{className:"text-[18px] font-extrabold tabular-nums mt-1.5 text-slate-900",children:n}),i.jsx("div",{className:"h-2 rounded-full bg-surface-muted overflow-hidden mt-2.5 flex",children:r.filter(s=>s.width>0).map(s=>i.jsx("span",{title:s.label,className:`block h-full ${s.className}`,style:{width:`${s.width}%`}},s.label))}),i.jsx("p",{className:"text-xs text-slate-500 mt-2",children:a})]})}function B0e({state:e}){return i.jsx(L1,{title:"Documents",icon:rc,to:rs("overview"),linkLabel:"Documents",state:e,skeleton:i.jsx(vA,{}),children:({summary:t,unmatched:n,storage:r})=>{const{total:a,byStatus:s}=t,o=s.processing+s.pending,l=t.matched+n.length,u=_1(n);return i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx(kf,{label:"Parse qual
491ity",badge:a>0&&i.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold ${s.failed===0?"bg-badge-green text-badge-green-text":"bg-badge-yellow text-badge-yellow-text"}`,children:s.failed===0?"Healthy":`${s.failed} failed`}),value:a===0?"No documents yet":i.jsxs(i.Fragment,{children:[s.completed," ",i.jsxs("span",{className:"text-xs font-semibold text-slate-500",children:["of ",a," parsed"]})]}),segments:[{width:mr(s.completed,a),className:"bg-amount-pos",label:`${s.completed} parsed`},{width:mr(o,a),className:"bg-badge-blue-text",label:`${o} in flight`},{width:mr(s.failed,a),className:"bg-amount-neg",label:`${s.failed} failed`}],hint:a===0?"Nothing parsed yet.":`${s.failed} failed · ${s.processing} processing · ${s.pending} pending`}),s.failed>0&&i.jsxs("p",{className:"flex gap-2 items-start rounded-lg bg-badge-yellow text-badge-yellow-text px-3 py-2.5 text-[11.5px] leading-relaxed",children:[i.jsx(Qt,{className:"w-3.5 h-3.5 flex-none mt-px"}),i.jsxs("span",{children:[i.jsxs("strong",{children:[s.failed," document",s.failed===1?"":"s"," could not be read."]})," ","Re-upload a clearer scan, or enter the vendor and total by hand."]})]}),i.jsx(kf,{label:"Match coverage",badge:n.length>0&&i.jsxs("span",{className:"inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-badge-blue text-badge-blue-text",children:[n.length," open"]}),value:l===0?"Nothing to link yet":i.jsxs(i.Fragment,{children:[t.matched," ",i.jsxs("span",{className:"text-xs font-semibold text-slate-500",children:["of ",l," linked"]})]}),segments:[{width:mr(t.matched,l),className:"bg-brand",label:`${t.matched} linked`}],hint:u.amount===null?`${n.length} document${n.length===1?"":"s"}
491 with no transaction against them`:`${Re(u.amount,u.currency)} with no transaction against it`}),i.jsx(kf,{label:"Storage",badge:t.drive.failed>0&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-badge-red text-badge-red-text",children:[i.jsx(t1,{className:"w-3 h-3"}),"Backup error"]}),value:r.label,segments:[{width:mr(t.drive.backedUp,a),className:"bg-purple-500",label:`${t.drive.backedUp} backed up`}],hint:t.drive.failed>0?`${t.drive.failed} upload${t.drive.failed===1?"":"s"} rejected by Drive · ${t.drive.backedUp} of ${a} backed up`:`${t.drive.backedUp} of ${a} backed up to Drive`})]})}})}const U0e={documents:{label:"Documents",icon:rc,tone:"bg-brand-soft text-brand"},transactions:{label:"Transactions",icon:Uo,tone:"bg-surface-muted text-slate-600"},investments:{label:"Investments",icon:zi,tone:"bg-badge-green text-badge-green-text"}};function q0e({state:e,isJoining:t,total:n}){return i.jsx(L1,{title:"Recent activity",subtitle:"across all four screens",icon:xr,to:Ko("all"),linkLabel:"All transactions",state:t&&e.status==="ready"?{status:"loading"}:e,skeleton:i.jsx(O0e,{}),footer:e.status==="ready"&&!t?i.jsxs("span",{children:["Showing ",e.data.length," of ",n," event",n===1?"":"s"," in this window"]}):i.jsx("span",{children:"The feed merges documents, transactions and trades, so it settles last."}),children:r=>r.length===0?i.jsx("p",{className:"py-6 text-center text-[13px] text-slate-500",children:"Nothing has happened yet."}):r.map(a=>{const s=U0e[a.source],o=s.icon;return i.jsxs("div",{className:"flex items-center gap-2.5 py-2.5 border-b border-slate-100 last:border-b-0",children:[i.jsx("span",{className:"w-[52px] flex-none text-[11.5px] text-slate-500 tabular-nums",children:a.date===null?je:Ue(a.date)}),i.jsx("span",{className:`w-[30px] h-[30px] rounded-lg flex items-center justify-center flex-none ${s.tone}`,children:i.jsx(o,{className:"w-3.5 h-3.5"})}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[13px] font-semibold text-slate-900 truncate",children:a.title}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500 truncate",children:[i.jsx("span",{className:"inline-block rounded-[5px] bg-surface-muted px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide text-slate-600 mr-1.5",children:s.label}),a.detail]})]}),i.jsx("span",{className:`w-24 flex-none text-right text-[13px] font-bold tabular-nums ${a.amount===null?"text-slate-400":a.amount<0?"text-amount-neg":"text-amount-pos"}`,children:a.amount===null?je:Ee(a.amount,a.currency)})]},a.key)})})}const aG=[{icon:Uo,title:"Balances",body:"Current and available across every sub-account"},{icon:ri,title:"Receipt matching",body:"Transactions paired with the documents you upload"},{icon:fO,title:"Read-only",body:"Held by Plaid â we never see your credentials"}],r6={no_accounts:{title:"Connect your first account",body:"Link a bank, card or brokerage and Moneylogz pulls in balances, sub-accounts and transactions â then matches your receipts to them automatically."},no_active_accounts:{title:"None of your connections are reporting",body:"Every connection on your account has stopped sharing data. Reconnecting one restores its balances and backfills the transactions it missed."},no_requested_accounts:{title:"Nothing to show for this selection",body:"The accounts you asked for are not connected. Clear the filter to see the rest of your accounts."}};function H0e({reason:e,connectionCount:t}){const n=r6[e]??r6.no_accounts,r=e==="no_accounts";return i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card px-4 py-8 lg:px-6 lg:py-12 text-center",children:[i.jsx("span",{className:"w-[76px] h-[76px] rounded-[20px] bg-brand-soft text-brand flex items-center justify-center mx-auto mb-[18px]",children:r?i.jsx(ac,{className:"w-8 h-8"}):i.jsx(Zs,{className:"w-8 h-8"})}),i.jsx("h3",{className:"text-[19px] font-extrabold tracking-tight text-slate-900 mb-1.5",children:n.title}),i.jsx("p",{className:"max-w-[440px] mx-auto text-slate-500 leading-relaxed mb-5",children:n.body}),i.jsx("div",{className:"flex justify-center mb-6",children:i.jsx(Ql,{label:r?"Add Account":"Add another account"})}),!r&&t>0&&i.jsxs("p",{className:"text-xs text-slate-500 mb-6",children:[t," connection",t===1?"":"s"," on your account, none reporting."]}),i.jsx("div",{className:"flex flex-col gap-4 lg:flex-row lg:flex-wrap lg:gap-6 lg:justify-center border-t border-border pt-5 max-w-[660px] mx-auto",children:aG.map(({icon:a,title:s,body:o})=>i.jsxs("div",{className:"flex gap-2.5 text-left lg:max-w-[180px]",children:[i.jsx("span",{className:"w-7 h-7 rounded-lg bg-surface-muted text-slate-600 flex items-center justify-center flex-none",children:i.jsx(a,{className:"w-[15px] h-[15px]"})}),i.jsxs("span",{children:[i.jsx("span",{className:"block text-[13px] font-bold text-slate-900",children:s}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 mt-0.5 leading-snug",children:o})]})]},s))})]})}function K0e({index:e,icon:t,title:n,body:r,unlocks:a,done:s,isNext:o,action:l}){return i.jsxs("section",{className:`rounded-xl border bg-surface shadow-card p-[18px] flex flex-col h-full ${o?"border-blue-200 ring-[3px] ring-brand-soft":"border-border"}`,children:[i.jsx("span",{className:`w-[26px] h-[26px] rounded-full border-2 flex items-center justify-center text-xs font-extrabold mb-3 ${s?"border-amount-pos bg-amount-pos text-white":o?"border-brand bg-brand text-white":"border-border text-slate-400"}`,children:s?i.jsx(Zt,{className:"w-3.5 h-3.5"}):e}),i.jsx("span",{className:`w-9 h-9 rounded-[10px] flex items-center justify-center mb-3 ${o||s?"bg-brand-soft text-brand":"bg-surface-muted text-slate-600"}`,children:i.jsx(t,{className:"w-[18px] h-[18px]"})}),i.jsx("h3",{className:"text-[14.5px] font-extrabold tracking-tight text-slate-900 mb-1.5",children:n}),i.jsx("p",{className:"text-[12.5px] text-slate-500 leading-relaxed mb-4 flex-1",children:r}),i.jsx("div",{children:l}),i.jsxs("p",{className:"mt-3 pt-2.5 border-t border-dashed border-border text-[11px] text-slate-500",children:["Fills ",i.jsx("span",{className:"font-bold text-slate-600",children:a})]})]})}function Hd({title:e,source:t,waitingOn:n,shape:r="figure"}){return i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-3 border-b border-border",children:[i.jsx("h3",{className:"text-[13px] font-extrabold text-slate-400",children:e}),i.jsx("span",{className:"ml-auto rounded-[5px] bg-surface-muted px-1.5 py-0.5 text-[9.5px] font-extrabold uppercase tracking-wide text-slate-400",children:t})]}),i.jsxs("div",{className:"px-[15px] py-4",children:[r==="figure"?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"block h-7 w-[58%] rounded-md bg-surface-muted"}),i.jsx("span",{className:"block h-2.5 w-[82%] rounded-md bg-surface-muted mt-2.5"}),i.jsx("span",{className:"block h-2 w-[64%] rounded-md bg-surface-muted mt-2"})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"block h-3.5 w-full rounded-md bg-surface-muted"}),i.jsx("span",{className:"block h-3.5 w-full rounded-md bg-surface-muted mt-2.5"}),i.jsx("span",{className:"block h-3.5 w-[70%] rounded-md bg-surface-muted mt-2.5"})]}),i.jsxs("span",{className:"flex items-center gap-1.5 mt-3.5 text-[11.5px] font-semibold text-slate-400",children:[i.jsx(jg,{className:"w-3 h-3"}),"Waiting on ",n]})]})]})}const V0e={"connect-account":{icon:ac,title:"Connect a bank or card",body:"Link a bank, card or brokerage and Moneylogz pulls in balances, sub-accounts and transactions.",unlocks:"Net worth, Cash runway, Spending"},"upload-document":{icon:Oo,title:"Upload your first document",body:"Drop in a receipt or invoice. The parser reads the vendor, date and total, then matches it to the right charge.",unlocks:"Parse qual
491ity, Your queues"},"connect-investments":{icon:zi,title:"Connect an investment account",body:"Link a brokerage or retirement account for holdings, allocation and unrealised gain across every position.",unlocks:"Portfolio value, Allocation"}},G0e="inline-flex w-full items-center justify-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 text-[13px]";function W0e({setup:e}){const t=n=>n==="connect-account"?i.jsx(Ql,{label:"Add Account"}):n==="upload-document"?i.jsx(gt,{to:rs("all"),className:G0e,children:"Upload a document"}):i.jsx(Ql,{label:"Connect investments",defaultProducts:I1,skipProductPicker:!0});return i.jsxs("div",{className:"pb-2",children:[i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-5 lg:px-7 pt-6 lg:pt-8 pb-6 text-center mb-4",children:[i.jsx("span",{className:"w-[76px] h-[76px] rounded-[20px] bg-brand-soft text-brand flex items-center justify-center mx-auto mb-[18px]",children:i.jsx(ac,{className:"w-8 h-8"})}),i.jsx("h2",{className:"text-[22px] font-extrabold tracking-tight text-slate-900 mb-1.5",children:"Welcome to Moneylogz"}),i.jsx("p",{className:"max-w-[520px] mx-auto text-slate-500 leading-relaxed mb-5",children:"The Dashboard pulls together your balances, spending, documents and investments in one place. It has nothing to show yet â connect one account and the numbers start appearing here."}),i.jsxs("div",{className:"max-w-[420px] mx-auto",children:[i.jsx("div",{className:"h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full rounded-full bg-brand",style:{width:`${e.completed/e.total*100}%`}})}),i.jsxs("p",{className:"mt-2.5 text-xs font-bold text-slate-500",children:[e.completed," of ",e.total," steps done"]})]})]}),i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"Get set up"}),i.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-4 mb-[18px]",children:e.steps.map((n,r)=>{const a=V0e[n.id];return i.jsx(K0e,{index:r+1,icon:a.icon,title:a.title,body:a.body,unlocks:a.unlocks,done:n.done,isNext:e.nextStep===n.id,action:t(n.id)},n.id)})}),i.jsxs("div",{className:"flex items-center gap-2.5 mb-2.5 flex-wrap",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"What your Dashboard will look like"}),i.jsx("span",{className:"ml-auto text-xs text-slate-500",children:"Placeholders only â no data has been read from any account yet."})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3 mb-[18px]",children:[i.jsx(Hd,{title:"Net worth",source:"Accounts",waitingOn:"step 1"}),i.jsx(Hd,{title:"Spending",source:"Transactions",waitingOn:"step 1"}),i.jsx(Hd,{title:"Portfolio value",source:"Investments",waitingOn:"step 3"}),i.jsx(Hd,{title:"Your queues",source:"Documents",waitingOn:"step 2",shape:"rows"}),i.jsx(Hd,{title:"Parse quality",source:"Documents",waitingOn:"step 2"}),i.jsx(Hd,{title:"Recent activity",source:"All screens",waitingOn:"step 1",shape:"rows"})]}),i.jsx("section",{className:"rounded-xl border border-border bg-surface shadow-card px-4 lg:px-[22px] py-[18px] flex flex-wrap gap-4 lg:gap-6",children:aG.map(({icon:n,title:r,body:a})=>i.jsxs("div",{className:"flex gap-2.5 flex-1 min-w-[200px]",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-brand-soft text-brand flex items-center justify-center flex-none",children:i.jsx(n,{className:"w-[15px] h-[15px]"})}),i.jsxs("span",{children:[i.jsx("span",{className:"block text-[13.5px] font-extrabold tracking-tight text-slate-900",children:r}),i.jsx("span",{className:"block text-xs text-slate-500 mt-0.5 leading-relaxed",children:a})]})]},r))}),i.jsxs("p",{className:"text-center mt-[18px] text-[12.5px] text-slate-500",children:["Not sure where to start?"," ",i.jsx(gt,{to:"/docs/getting-started/a-tour-of-the-app",className:"text-brand font-bold",children:"Read the getting-started guide â"})]})]})}function jA({title:e,hint:t,children:n}){return i.jsxs("div",{"data-meter-variant":"row","aria-label":e,role:"group",className:"flex items-center gap-3 px-4 py-[11px] border-b border-border last:border-b-0",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-[13px] font-bold text-slate-900 truncate",children:e}),i.jsx("p",{className:"text-[11.5px] text-slate-500 truncate",children:t})]}),i.jsx("div",{className:"flex-none",children:n})]})}function NA({totals:e,variant:t="card"}){const n=e?e.assets+e.liabilities:0,r=n>0?e.assets/n*100:0;return t==="row"?i.jsx(jA,{title:"Assets vs liabilities",hint:n>0?`${Math.round(r)}% assets`:"No balances reported yet.",children:i.jsx("div",{className:"flex gap-0.5 w-[90px] h-2 rounded-full bg-surface-muted overflow-hidden",children:n>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"bg-brand",style:{width:`${r}%`}}),i.jsx("span",{className:"bg-amount-neg",style:{width:`${Math.max(100-r,0)}%`}})]})})}):i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card p-4",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Assets vs liabilities"}),i.jsxs("p",{className:"text-[24px] font-extrabold tracking-tight tabular-nums text-slate-900 mt-1.5",children:[e?ge(e.assets,e.currency):je,i.jsx("span",{className:"text-sm font-semibold text-slate-500 ml-1.5",children:"assets"})]}),i.jsx("div",{className:"flex gap-0.5 h-2.5 rounded-full bg-surface-muted overflow-hidden mt-3",children:n>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"bg-brand",style:{width:`${r}%`}}),i.jsx("span",{className:"bg-amount-neg",style:{width:`${Math.max(100-r,0)}%`}})]})}),i.jsx("p",{className:"text-xs text-slate-500 mt-2.5",children:e?`${ge(e.liabilities,e.currency)} owed across ${e.accounts} account${e.accounts===1?"":"s"}`:"No balances reported yet."})]})}const a6={healthy:"bg-badge-green text-badge-green-text",watch:"bg-badge-yellow text-badge-yellow-text",high:"bg-badge-red text-badge-red-text"},Y0e={healthy:"bg-brand",watch:"bg-badge-yellow-text",high:"bg-amount-neg"};function _A({utilisation:e,variant:t="card"}){const n=RV(e?.percent);if(t==="row"){const r=e!==null&&e.percent!==null;return i.jsx(jA,{title:"Credit utilisation",hint:e?e.percent===null?"No card reported a credit limit.":`${ge(e.used,e.currency)} of ${ge(e.limit,e.currency)}`:"No credit cards connected.",children:i.jsxs("span",{className:"flex items-center gap-2",children:[n&&i.jsx("span",{className:`${ja} ${a6[n]}`,children:lC[n]}),i.jsx("span",{className:"text-base font-extrabold tabular-nums text-slate-900",children:r?`${e.percent}%`:je})]})})}return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card p-4",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Credit utilisation"}),i.jsxs("p",{className:"text-[24px] font-extrabold tracking-tight tabular-nums text-slate-900 mt-1.5 flex items-center gap-2",children:[e?.percent===null||e===null?je:`${e.percent}%`,n&&i.jsxs("span",{className:`${ja} ${a6[n]}`,children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current"}),lC[n]]})]}),i.jsx("div",{className:"h-2.5 rounded-full bg-surface-muted overflow-hidden mt-3",children:n&&e?.percent!==null&&e&&i.jsx("span",{className:`block h-full ${Y0e[n]}`,style:{width:`${Math.min(e.percent,100)}%`}})}),i.jsx("p",{className:"text-xs text-slate-500 mt-2.5",children:e?e.percent===null?`No card reported a credit limit, so a percentage c
491annot be shown for ${e.excluded} card${e.excluded===1?"":"s"}.`:`${ge(e.used,e.currency)} used of ${ge(e.limit,e.currency)} across ${e.accounts} card${e.accounts===1?"":"s"}${e.excluded>0?` · ${e.excluded} card${e.excluded===1?"":"s"} reported no limit`:""}`:"No credit cards connected."})]})}function kA({runway:e,cash:t,currency:n,variant:r="card"}){const a=e?.status==="ok"?`${e.months} months`:je;let s;return e?e.status==="ok"?s=`${ge(t,n)} cash · ${ge(e.monthlySpend,n)}/mo average over ${e.daysCovered} days`:e.status==="insufficient_history"?s="Not enough transaction history yet â this needs about a month of activity.":e.status==="no_cash_accounts"?s="No cash accounts connected â a runway is measured against a cash balance.":s="Recent spend could not be loaded, so a runway cannot be shown.":s="Working out your recent spend...",r==="row"?i.jsx(jA,{title:"Cash runway",hint:e?.status==="ok"?`at ${ge(e.monthlySpend,n)} / month burn`:s,children:e?i.jsx("span",{className:"text-base font-extrabold tabular-nums text-slate-900",children:e.status==="ok"?`${e.months} mo`:je}):i.jsx("span",{className:"inline-block h-5 w-16 rounded bg-surface-muted animate-pulse"})}):i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card p-4",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Cash runway"}),i.jsx("p",{className:"text-[24px] font-extrabold tracking-tight tabular-nums text-slate-900 mt-1.5",children:e?a:i.jsx("span",{className:"inline-block h-6 w-28 rounded bg-surface-muted animate-pulse align-middle"})}),i.jsx("p",{className:"text-xs text-slate-500 mt-2.5 leading-relaxed",children:s})]})}function X0e({totals:e,utilisation:t,runway:n,cash:r,currency:a}){return v.useEffect(()=>{console.info("[DashboardMeterList] balance meters rendered as one compact card for the phone layout")},[]),i.jsxs("section",{"aria-label":"Balance meters",className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx(NA,{totals:e,variant:"row"}),i.jsx(_A,{utilisation:t,variant:"row"}),i.jsx(kA,{runway:n,cash:r,currency:a,variant:"row"})]})}const sG=()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(tq):null;function Q0e(){return sG()?.matches??!0}function Ms(){const[e,t]=v.useState(Q0e);return v.useEffect(()=>{const n=sG();if(!n)return;const r=a=>t(a.matches);return t(n.matches),n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const s6={investments:"bg-brand",cash:"bg-sky-500",credit:"bg-orange-500",loans:"bg-amount-neg",other:"bg-slate-400"};function iG({totals:e,currency:t,otherCurrencies:n,totalsByType:r}){const a=r??[],s=a.flatMap(u=>{const d=$V(u.totals,t);return d&&d.currency===t&&d.total!==0?[{group:u.group,total:d.total,currency:d.currency}]:[]}),o=a.flatMap(u=>u.totals.filter(d=>d.currency!==t&&d.total!==0).map(d=>({group:u.group,total:d.total,currency:d.currency}))),l=s.reduce((u,d)=>Math.max(u,Math.abs(d.total)),0);return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card p-4 lg:p-5",children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:["Net worth",t?` · ${t}`:""]}),i.jsx("p",{className:"text-[34px] leading-none font-extrabold tracking-tight tabular-nums text-slate-900 mt-2",children:e?ge(e.net,e.currency):je}),e&&i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-2",children:[i.jsx("span",{className:"font-bold text-amount-pos tabular-nums",children:ge(e.assets,e.currency)})," ","assets ·"," ",i.jsx("span",{className:"font-bold text-amount-neg tabular-nums",children:ge(e.liabilities,e.currency)})," ","owed · ",e.accounts," account",e.accounts===1?"":"s"]}),n.length>0&&i.jsx("p",{className:"flex flex-wrap gap-2 mt-3",children:n.map(u=>i.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-surface-muted px-2.5 py-1 text-[11.5px] font-semibold text-slate-600 tabular-nums",children:ge(u.net,u.currency)},u.currency))}),(s.length>0||o.length>0)&&i.jsxs("div",{className:"mt-5 pt-4 border-t border-border",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-3",children:"Where the money sits"}),s.map(u=>i.jsxs("div",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsx("span",{className:"w-[82px] lg:w-[88px] flex-none text-xs font-semibold text-slate-600",children:Vy[u.group]}),i.jsx("span",{className:"flex-1 h-5 rounded-md bg-surface-muted overflow-hidden",children:i.jsx("span",{className:`block h-full ${s6[u.group]??s6.other}`,style:{width:l>0?`${Math.abs(u.total)/l*100}%`:"0%"}})}),i.jsx("span",{className:`min-w-[92px] lg:w-[104px] flex-none whitespace-nowrap text-right text-[12.5px] font-bold tabular-nums ${u.total<0?"text-amount-neg":"text-slate-900"}`,children:ge(u.total,u.currency)})]},u.group)),o.length>0&&i.jsx("p",{className:"flex flex-wrap gap-2 mt-3",children:o.map(u=>i.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-surface-muted px-2.5 py-1 text-[11.5px] font-semibold text-slate-600 tabular-nums",children:[Vy[u.group]," ",ge(u.total,u.currency)]},`${u.group}-${u.currency}`))})]})]})}const i6=1;function oG({excluded:e,errors:t,hasPartialCurrency:n}){const[r,a]=v.useState(!1),s=[...(e??[]).map(d=>({id:`excluded-${d.moneylogz_account_id}
491`,name:d.account_name,detail:d.institution,reason:"not reporting"})),...(t??[]).map(d=>({id:`error-${d.moneylogz_account_id}`,name:d.account_name,detail:d.error,reason:d.code==="PRODUCT_NOT_READY"?"still preparing":"could not be reached"}))];if(s.length===0&&!n)return null;const o=Math.max(s.length-i6,0),l=r?s:s.slice(0,i6),u=()=>a(!r);return i.jsxs("div",{className:"rounded-xl border border-yellow-200 bg-badge-yellow text-badge-yellow-text px-4 py-3 mb-4",children:[i.jsxs("p",{className:"flex gap-2.5 items-start text-[13px] leading-relaxed",children:[i.jsx(Qt,{className:"w-4 h-4 flex-none mt-px"}),i.jsx("span",{children:s.length>0?i.jsxs(i.Fragment,{children:[i.jsxs("strong",{children:[s.length," connection",s.length===1?" is":"s are"," missing from these totals."]})," ","Their balances are shown where known, but not counted."]}):i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:"Partial totals."})," An account reported no usable balance, so it is excluded rather than counted as zero."]})})]}),s.length>0&&i.jsx("ul",{className:"mt-2.5 pl-[26px] space-y-1",children:l.map(d=>i.jsxs("li",{className:"text-xs",children:[i.jsx("span",{className:"font-bold",children:d.name})," â ",d.reason,d.detail?i.jsxs("span",{className:"opacity-80",children:[" · ",d.detail]}):null]},d.id))}),o>0&&i.jsx("button",{type:"button",onClick:u,"aria-expanded":r,className:"ml-[26px] mt-2 inline-flex items-center gap-1.5 text-xs font-bold underline underline-offset-2 hover:opacity-80",children:r?i.jsxs(i.Fragment,{children:[i.jsx(BU,{className:"w-3.5 h-3.5"}),"Show less"]}):i.jsxs(i.Fragment,{children:[i.jsx(Ca,{className:"w-3.5 h-3.5"}),"Show ",o," more"]})})]})}function B1({title:e,body:t,message:n,isRetrying:r,onRetry:a}){return i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-9 text-center",children:[i.jsx("span",{className:"w-[54px] h-[54px] rounded-[14px] bg-badge-red text-badge-red-text flex items-center justify-center mx-auto mb-4",children:i.jsx(Jt,{className:"w-6 h-6"})}),i.jsx("h3",{className:"text-[17px] font-extrabold tracking-tight text-slate-900 mb-1.5",children:e}),i.jsx("p",{className:"max-w-[460px] mx-auto text-slate-500 leading-relaxed",children:t}),i.jsx("p",{className:"mt-2 mb-5",children:i.jsx("code",{className:"inline-block rounded-[5px] bg-surface-muted px-2 py-0.5 text-xs text-slate-600",children:n})}),i.jsxs("button",{type:"button",onClick:a,disabled:r,className:"inline-flex items-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50",children:[i.jsx(dt,{className:`h-[15px] w-[15px] ${r?"animate-spin":""}`}),r?"Retrying...":"Try again"]})]})}const SA=e=>{const t=String(e??"").slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(t)?t:null},lG=e=>SA(bh(e)??e.uploaded_at??e.created_at),Z0e=e=>({key:`document-${e.id}`,source:"documents",date:lG(e),title:Vn(e),detail:e.transaction_id?"Linked to a transaction":"Waiting to be linked",amount:wa(e),currency:Cs(e)}),J0e=e=>({key:`transaction-${e.transaction_id}`,source:"transactions",date:SA(e.date),title:br(e),detail:[e.account_name,e.category].filter(Boolean).join(" · "),amount:Number.isFinite(Number(e.amount))?Number(e.amount):null,currency:e.iso_currency_code??null}),eye=e=>({key:`investment-${e.investment_transaction_id}`,source:"investments",date:SA(e.date),title:e.name,detail:[e.institution,e.account_name].filter(Boolean).join(" · "),amount:e.amount,currency:e.currency});function tye(e,t){return(e??[]).map(s=>({receipt:s,date:lG(s)})).filter(({date:s})=>s!==null&&s>=t.startDate&&s<=t.endDate).map(({receipt:s})=>s)}function nye({documents:e,transactions:t,investmentTransactions:n},r){return[...e.map(Z0e),...t.map(J0e),...n.map(eye)].sort((s,o)=>s.date===o.date?s.key.localeCompare(o.key):s.date===null?1:o.date===null?-1:o.date.localeCompare(s.date)).slice(0,r)}const o6=["connection","inbox","unmatched","failed-parse"];function rye(e,t){return[...e.map(r=>({key:`connection-${r.account.id}`,kind:"connection",count:1,entry:r})),{key:"inbox",kind:"inbox",count:t.inbox},{key:"unmatched",kind:"unmatched",count:t.unmatched},{key:"failed-parse",kind:"failed-parse",count:t.failedParses}].filter(r=>r.count>0).sort((r,a)=>o6.indexOf(r.kind)-o6.indexOf(a.kind))}function aye({connectionCount:e,documentCount:t,investmentAccountCount:n}){const r=[{id:"connect-account",done:e>0},{id:"upload-document",done:t>0},{id:"connect-investments",done:n>0}];return{steps:r,completed:r.filter(a=>a.done).length,total:r.length,nextStep:r.find(a=>!a.done)?.id??null}}function sye({sourcesResolved:e,accounts:t}){return e.length===0||!e.every(Boolean)?!1:t.length===0}const iye=8;function oye(){const[e,t]=v.useState(lA),n=Ms(),r=zbe(e),{accounts:a,documents:s,transactions:o,investments:l,activity:u,accountList:d}=r,{startReconnect:h,isReconnecting:p}=mA({onReconnected:r.reconnected}),g=sye({sourcesResolved:[r.accountListResolved,...[a,s,o].map(L=>L.status==="ready"),l.status!=="loading"],accounts:d}),x=v.useMemo(()=>aye({connectionCount:d.length,documentCount:s.status==="ready"?s.data.summary.total:0,investmentAccountCount:l.status==="ready"?Bbe(l.data.holdings):0}),[d.length,s,l]),y=v.useCallback(L=>{L!==e&&t(L)},[e]),w=v.useMemo(()=>rye(a.status==="ready"?a.data.attention:[],{inbox:s.status==="ready"?s.data.inbox.length:0,unmatched:s.status==="ready"?s.data.unmatched.length:0,failedParses:s.status==="ready"?s.data.summary.byStatus.failed:0}),[a,s]),j=v.useMemo(()=>[["Accounts",a],["Documents",s]].filter(([,L])=>L.status!=="ready").map(([L,F])=>({source:L,status:F.status})),[a,s]),N=s.status==="ready"&&o.status==="ready"&&u.status==="ready",k=v.useMemo(()=>yh(e),[e]),S=v.useMemo(()=>s.status==="ready"?tye(s.data.documents,k):[],[s,k]),E=v.useMemo(()=>N?nye({documents:S,transactions:o.status==="ready"?o.data.rows:[],investmentTransactions:u.status==="ready"?u.data:[]},iye):[],[N,S,o,u]),O=S.length+(o.status==="ready"?o.data.rows.length:0)+(u.status==="ready"?r.activityTotal:0),T=v.useMemo(()=>{const L=[["activity",u],["documents",s],["transactions",o]];for(const[F,B]of L)if(B.status==="error")return{source:F,message:B.message,retry:B.retry};return null},[u,s,o]),P=T?{status:"error",message:T.message,retry:T.retry}:{status:"ready",data:E,partial:[]};if(g)return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx(e6,{range:e,onRangeChange:y,onRefresh:()=>void r.refresh(),isRefreshing:r.isFetching,showRange:!1}),i.jsx(W0e,{setup:x})]});const M=a.status==="ready"?a.data.balances:null,D=a.status==="ready"?a.data.currency:null,A=T1(M?.totals_by_currency,D);return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx(e6,{range:e,onRangeChange:y,onRefresh:()=>void r.refresh(),isRefreshing:r.isFetching}),i.jsx(j0e,{statuses:r.sourceStatuses}),a.status==="ready"&&i.jsxs(i.Fragment,{children:[i.jsx(oG,{excluded:a.data.balances.excluded_accounts,errors:a.data.balances.errors,hasPartialCurrency:cA(a.data.balances.totals_by_currency)}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1.7fr_1fr] mb-4",children:[i.jsx(iG,{totals:A,currency:D,otherCurrencies:(M?.totals_by_currency??[]).filter(L=>L.currency!==D),totalsByType:M?.totals_by_type}),n?i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsx(NA,{totals:A}),i.jsx(_A,{utilisation:Gy(M?.credit_utilisation,D)}),i.jsx(kA,{runway:a.data.runway,cash:a.data.cashTotal,currency:D})]}):i.jsx(X0e,{totals:A,utilisation:Gy(M?.credit_utilisation,D),runway:a.data.runway,cash:a.data.cashTotal,currency:D})]})]}),a.status==="loading"&&i.jsx(E0e,{}),a.status==="error"&&i.jsx("div",{className:"mb-4",children:i.jsx(B1,{title:"Your balances could not be loaded",body:"The panels below came from different calls and are unaffected by this one.",message:a.message,isRetrying:r.isFetching,onRetry:a.retry})}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 mb-4 xl:grid-cols-3",children:[i.jsx(I0e,{state:l}),i.jsx(z0e,{state:o,range:e}),i.jsx(B0e,{state:s})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-[1fr_1.35fr] mb-2",children:[w.length>0?i.jsx(C0e,{items:w,logos:a.status==="ready"?a.data.logos:{},isReconnecting:p,onReconnect:h,onRetry:()=>void r.refresh(),isRefreshing:r.isFetching}):j.length===0?i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-[18px] py-6 text-center",children:[i.jsx("p",{className:"text-[13.5px] font-extrabold tracking-tight text-slate-900",children:"Nothing needs your attention"}),i.jsx("p",{className:"text-xs text-slate-500 mt-1.5 leading-relaxed",children:"Every connection is reporting and both document queues are clear."})]}):i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-[18px] py-6 text-center",children:[i.jsx("p",{className:"text-[13.5px] font-extrabold tracking-tight text-slate-400",children:"Attention checks are incomplete"}),i.jsxs("p",{className:"text-xs text-slate-500 mt-1.5 leading-relaxed",children:[j.map(({source:L,status:F})=>`${L} ${F==="error"?"could not be loaded":"has not answered yet"}`).join(" and "),", so this panel cannot tell you whether anything needs you."]})]}),i.jsx(q0e,{state:P,isJoining:!N,total:O})]})]})}const Em="processing_receipt_ids",Zy=5*60*1e3,lye=()=>{try{const e=localStorage.getItem(Em);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null&&typeof n.id=="number"&&typeof n.startTime=="number").map(n=>({id:n.id,startTime:n.startTime,lastStatus:n.lastStatus||"pending"})):(localStorage.removeItem(Em),[])}catch{try{localStorage.removeItem(Em)}catch{}return[]}},cye=e=>{try{e.length>0?localStorage.setItem(Em,JSON.stringify(e)):localStorage.removeItem(Em)}catch{}},$l=XU()((e,t)=>({receipts:lye(),setReceipts:n=>e(r=>({receipts:typeof n=="function"?n(r.receipts):n})),add:n=>CA(t().receipts,n)?!1:(e(r=>({receipts:[...r.receipts.filter(a=>a.id!==n),{id:n,startTime:Date.now(),lastStatus:"pending"}]})),!0)}));$l.subscribe((e,t)=>{e.receipts!==t.receipts&&cye(e.receipts)});const cG=(e,t)=>
491t-e.startTime>=Zy,Xm=(e,t=Date.now())=>e.filter(n=>!cG(n,t)),CA=(e,t,n=Date.now())=>Xm(e,n).some(r=>r.id===t),uG=e=>{const[t,n]=v.useState(0);return v.useEffect(()=>{const r=Date.now(),a=Xm(e,r);if(a.length===0)return;const s=Math.min(...a.map(l=>l.startTime+Zy)),o=setTimeout(()=>n(l=>l+1),Math.max(0,s-r));return()=>clearTimeout(o)},[e,t]),t},uye=()=>{const e=$l(n=>n.receipts),t=uG(e);return v.useMemo(()=>Xm(e).map(n=>n.id),[e,t])},pk=2e3,dye=30*1e3,qb=e=>console.info(`[processingQueue] ${e}`),l6=e=>console.warn(`[processingQueue] ${e}`);let Kp=null,c6=0,hC=0,mk=null;$l.subscribe(e=>{e.receipts.length===0&&(hC=0)});const gk=e=>e.lastStatus==="pending"||e.lastStatus==="processing",EA=()=>{const e=mn(),t=$l(o=>o.receipts),n=$l(o=>o.setReceipts);uG(t);const r=v.useCallback(async()=>{const o=$l.getState().receipts;if(o.length===0)return;const l=Date.now(),u=o.filter(g=>cG(g,l)).map(g=>g.id);u.length>0&&(qb(`stopped waiting on ${u.length} document(s) after ${Zy/1e3}s: ${u.join(", ")}; re-parse is available again`),n(g=>g.filter(x=>!u.includes(x.id))),e.invalidateQueries({queryKey:["receipts"]}));const d=Xm(o,l);if(d.length===0)return;if(Kp!==null){if(l-Kp<dye)return;l6(`status check started ${Math.round((l-Kp)/1e3)}s ago never finished; polling again`)}if(l-hC<pk/2)return;const h=d.map(g=>g.id),p=++c6;Kp=l,hC=l;try{const g=await pxe(h);if(mk=null,g.length===0){qb(`status check returned none of ${h.join(", ")}; clearing them from the queue`),n(k=>k.filter(S=>!h.includes(S.id)));return}let x=!1,y=!1;const w=d.map(k=>{const S=g.find(P=>P.id===k.id),E=S?.status,O=S?.processing_status;if(!S)return x=!0,y=!0,{...k,lastStatus:"completed"};let T=k.lastStatus;return O==="processing"&&k.lastStatus==="pending"?(T="processing",x=!0):E==="active"&&O==="completed"&&gk(k)?(T="completed",x=!0,y=!0):O==="failed"&&E!=="processing"?(T="failed",x=!0,y=!0):E==="error"&&gk(k)&&(T=O==="failed"?"failed":"completed",x=!0,y=!0),{...k,lastStatus:T}});if(!x)return;const j=w.filter(k=>!gk(k)),N=j.map(k=>k.id);j.forEach(k=>qb(`document ${k.id} left the queue as ${k.lastStatus}`)),n(k=>k.filter(S=>!N.includes(S.id)).map(S=>w.find(E=>E.id===S.id)??S)),e.setQueriesData({queryKey:["receipts"]},k=>{if(!k)return k;const S=k.receipts.map(E=>{const O=w.find(T=>T.id===E.id);return O?{...E,processing_status:O.lastStatus}:E});return{...k,receipts:S}}),y&&await e.invalidateQueries({queryKey:["receipts"]})}catch(g){const x=g instanceof Error?g.message:String(g);x!==mk&&(l6(`status check for ${h.join(", ")} failed: ${x}; retrying every ${pk/1e3}s`),mk=x)}
491finally{c6===p&&(Kp=null)}},[e,n]);return v.useEffect(()=>{if(t.length===0)return;r();const o=setInterval(r,pk);return()=>{clearInterval(o)}},[t,r]),{addProcessingReceipt:o=>{$l.getState().add(o)&&(qb(`document ${o} queued; re-parse is disabled until it settles or ${Zy/1e3}s pass`),e.setQueriesData({queryKey:["receipts"]},l=>{if(!l)return l;const u=l.receipts.map(d=>d.id===o?{...d,processing_status:"pending"}:d);return{...l,receipts:u}}))},isProcessing:o=>{const l=typeof o=="string"?parseInt(o,10):o;return CA(t,l)},processingCount:Xm(t).length}},dG=(e={})=>{const[t,n]=v.useState(!1),[r,a]=v.useState(0),{addProcessingReceipt:s}=EA(),{addOptimisticReceipts:o,updateOptimisticReceipts:l}=YO(),u=mn();return{uploadFiles:async h=>{n(!0),a(0);const p=Array.from(h);if(p.length>Eu)throw new Error(`Maximum ${Eu} files allowed per upload`);try{const g=o(p),x=await hxe(p,e.transactionId,w=>{a(w);const j=Math.floor(w/100*p.length);e.onProgress?.(w,j,p.length)}),y=x.successful.map((w,j)=>({tempId:g[j].id,actualId:w.id,filename:w.filename}));l(y),x.successful.forEach(w=>{s(w.id)}),e.onUploadSuccess?.(x.successful),u.setQueriesData({queryKey:["receipts"]},w=>{if(!w)return w;const j=w.receipts.map(N=>{const k=y.find(S=>S.tempId===N.id);return k?{...N,id:k.actualId,filename:k.filename,processing_status:"pending"}:N});return{...w,receipts:j}}),e.onComplete?.()}catch(g){const x=g instanceof ma||g instanceof Error?g.message:"Failed to upload receipts";e.onError?.(new Error(x)),await u.invalidateQueries({queryKey:["receipts"],refetchType:"all"})}finally{n(!1),a(0)}},isUploading:t,uploadProgress:r}},fye=()=>{const[e,t]=v.useState(!1),n=mn();return{deleteDocuments:async a=>{if(a.length!==0)try{t(!0),n.setQueriesData({queryKey:["receipts"]},s=>{if(!s)return s;const o=s.receipts.filter(l=>!a.includes(l.id));return{...s,receipts:o,total:s.total-(s.receipts.length-o.length)}}),await mxe(a),await n.invalidateQueries({queryKey:["receipts"]})}catch(s){throw await n.invalidateQueries({queryKey:["receipts"]}),s}finally{t(!1)}},isDeleting:e}},hye="inline-flex items-center justify-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 disabled:opacity-50",pye="inline-flex items-center justify-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50";function mye({isUploading:e,uploadProgress:t,hasDocuments:n,driveBusy:r,showSelectionError:a,onDriveUpload:s,onImportClick:o}){return i.jsx(Vu,{title:"Documents",subtitle:"Upload, parse and match your receipts and invoices.",children:i.jsxs("div",{className:"col-span-2 flex flex-col gap-2 flex-none lg:items-end",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2.5 lg:flex lg:items-center",children:[i.jsx("button",{type:"button",onClick:()=>s(),disabled:r||!n,className:hye,children:r?i.jsxs(i.Fragment,{children:[i.jsx(Yn,{className:"h-[15px] w-[15px] animate-spin"}),"Uploading..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Yn,{className:"h-[15px] w-[15px]"}),"Upload to Drive"]})}),i.jsx("button",{type:"button",onClick:o,disabled:e,className:pye,children:e?i.jsxs(i.Fragment,{children:[i.jsx(Oo,{className:"h-[15px] w-[15px] animate-bounce"}),i.jsx("span",{children:"Uploading..."}),i.jsxs("span",{children:[Math.round(t),"%"]})]}):i.jsxs(i.Fragment,{children:[i.jsx(Qs,{className:"h-[15px] w-[15px]"}),"Add Documents"]})})]}),a&&i.jsx("p",{className:"text-sm text-red-600",children:"Please select documents"})]})})}const gye="flex gap-[22px] lg:gap-[26px] flex-nowrap overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden -mx-4 px-4 lg:mx-0 lg:px-0 lg:flex-wrap lg:overflow-visible border-b border-border mb-[14px] lg:mb-[22px]",xye=e=>["inline-flex items-center gap-2 pb-3 -mb-px border-b-2 text-[14.5px] font-semibold whitespace-nowrap transition-colors",e?"border-brand text-brand":"border-transparent text-slate-500 hover:text-slate-900"].join(" ");function U1({tabs:e,tabPath:t,counts:n={},attention:r}){return i.jsx("nav",{className:gye,children:e.map(({path:a,label:s,icon:o})=>{const l=n[a],u=!!r&&r.path===a&&r.count>0;return i.jsx(ly,{to:t(a),className:({isActive:d})=>xye(d),children:({isActive:d})=>i.jsxs(i.Fragment,{children:[i.jsx(o,{className:"w-4 h-4"}),i.jsx("span",{children:s}),l!==void 0&&i.jsx("span",{className:`text-[11px] font-bold rounded-full px-[7px] py-px ${d?"bg-brand-soft text-brand":"bg-surface-muted text-slate-500"}`,children:l}),u&&i.jsx("span",{role:"status","aria-label":r.label,title:r.label,className:"w-1.5 h-1.5 rounded-full bg-badge-red-text"})]})},a)})})}function bye({counts:e,attentionCount:t}){return i.jsx(U1,{tabs:k0e,tabPath:rs,counts:e,attention:{path:"review",count:t,label:`${t} document${t===1?"":"s"} need attention`}})}const yye="flex items-start gap-0 lg:gap-6 flex-nowrap overflow-x-auto snap-x [scrollbar-width:none] [&::-webkit-scrollbar]:hidden lg:flex-wrap lg:overflow-visible bg-surface border border-border rounded-xl shadow-card px-0 py-3 lg:px-[22px] lg:py-[18px]",On=({label:e,children:t})=>i.jsxs("div",{className:"flex-none snap-start min-w-[150px] px-4 lg:min-w-0 lg:flex-initial lg:pl-0 lg:pr-6 border-r border-border last:border-r-0",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:e}),t]});function wh({children:e,className:t=""}){return i.jsx("section",{className:`${yye} ${t}`,children:e})}const xk="â",Hb="text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",Kb="text-xs text-slate-500 mt-0.5";function vye({summary:e}){const{total:t,byStatus:n,matched:r,valueCaptured:a}=e,s=n.processing+n.pending,o=mr(n.completed,t);return i.jsxs(wh,{className:"mb-4",children:[i.jsxs(On,{label:"Documents",children:[i.jsx("p",{className:Hb,children:t}),i.jsx("p",{className:Kb,children:t===0?"nothing uploaded yet":`${n.completed} parsed`})]}),i.jsxs(On,{label:`Value captured${a.currency?` · ${a.currency}`:""}`,children:[i.jsx("p",{className:Hb,children:a.amount===null?xk:Re(a.amount,a.currency)}),i.jsx("p",{className:Kb,children:a.amount===null?"no document has a total yet":a.mixedCurrency?`${a.documents} documents in ${a.currency} · other currencies not counted`:`across ${a.documents} document${a.documents===1?"":"s"}`})]}),i.jsxs(On,{label:"Parsed successfully",children:[i.jsx("p",{className:`${Hb} ${t>0&&o>=90?"text-amount-pos":""}`,children:t===0?xk:`${o}%`}),i.jsx("p",{className:Kb,children:t===0?"nothing parsed yet":`${n.completed} of ${t} · ${n.failed} failed`})]}),i.jsxs(On,{label:"Matched to a transaction",children:[i.jsx("p",{className:Hb,children:t===0?xk:`${mr(r,t)}%`}),i.jsx("p",{className:Kb,children:t===0?"nothing to match yet":`${r} matched · ${e.unmatched} waiting`})]}),s>0&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-bold rounded-full px-2.5 py-1 bg-surface-muted text-slate-600 self-center flex-none whitespace-nowrap mx-4 lg:mx-0",children:[i.jsx(xr,{className:"w-3 h-3"}),s," processing"]})]})}const wye=["ID","Date","Merchant","Total","Status","Source","Uploaded on"];
491function jye({rows:e=5}){return i.jsxs("div",{"aria-busy":"true","aria-label":"Loading your documents",children:[i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1.7fr_1fr] mb-4",children:[i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card p-5",children:[i.jsx("span",{className:"block h-2.5 w-24 rounded-full bg-surface-muted animate-pulse"}),i.jsx("span",{className:"block h-8 w-56 rounded bg-surface-muted animate-pulse mt-3"}),i.jsx("div",{className:"mt-5 pt-4 border-t border-border",children:[0,1,2].map(t=>i.jsxs("span",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsx("span",{className:"w-[88px] h-2.5 rounded-full bg-surface-muted animate-pulse flex-none"}),i.jsx("span",{className:"flex-1 h-5 rounded-md bg-surface-muted animate-pulse"}),i.jsx("span",{className:"w-[104px] h-2.5 rounded-full bg-surface-muted animate-pulse flex-none"})]},t))})]}),i.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2].map(t=>i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card p-4",children:[i.jsx("span",{className:"block h-2.5 w-20 rounded-full bg-surface-muted animate-pulse"}),i.jsx("span",{className:"block h-6 w-32 rounded bg-surface-muted animate-pulse mt-2.5"}),i.jsx("span",{className:"block h-2 w-40 rounded-full bg-surface-muted animate-pulse mt-3 opacity-70"})]},t))})]}),i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx("div",{className:"hidden lg:flex items-center gap-4 px-3.5 py-2.5 bg-surface-2 border-b border-border",children:wye.map(t=>i.jsx("span",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 flex-1",children:t},t))}),Array.from({length:e}).map((t,n)=>i.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3 border-b border-border last:border-b-0",children:[i.jsx("span",{className:"w-[26px] h-8 rounded-md bg-surface-muted animate-pulse flex-none"}),i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block h-2.5 rounded-full bg-surface-muted animate-pulse w-[34%]"}),i.jsx("span",{className:"block h-2 rounded-full bg-surface-muted animate-pulse w-[58%] mt-[7px] opacity-70"})]}),i.jsx("span",{className:"w-16 lg:w-[104px] h-5 rounded-full bg-surface-muted animate-pulse flex-none"}),i.jsx("span",{className:"hidden lg:block w-24 h-2.5 rounded-full bg-surface-muted animate-pulse flex-none"})]},n)),i.jsxs("p",{className:"flex items-center justify-center gap-3 py-5 text-[13px] text-slate-500",children:[i.jsx("span",{className:"w-[18px] h-[18px] rounded-full border-2 border-surface-muted border-t-brand animate-spin"}),"Loading your documentsâ¦"]})]})]})}function Nye({message:e,isRetrying:t,onRetry:n}){return i.jsxs("div",{className:"flex gap-3.5 items-start border border-badge-red bg-red-50 rounded-xl px-[18px] py-4 max-w-[560px] mx-auto mt-11",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-badge-red text-badge-red-text flex items-center justify-center flex-none",children:i.jsx(Jt,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("b",{className:"text-[14.5px] font-bold text-red-900",children:"We could not load your documents"}),i.jsx("p",{className:"text-[13px] text-red-800 mt-1 leading-relaxed",children:"Nothing has been deleted â this is only the list request failing. Your documents and their matches are untouched."}),i.jsx("span",{className:"inline-block max-w-full break-words font-mono text-[11.5px] text-badge-red-text mt-2 bg-surface border border-badge-red rounded-[7px] px-2.5 py-1.5",children:e}),i.jsx("div",{className:"flex gap-2.5 mt-3.5",children:i.jsxs("button",{type:"button",onClick:n,disabled:t,className:"inline-flex items-center gap-2 min-h-[42px] lg:min-h-0 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50",children:[i.jsx(dt,{className:`w-[13px] h-[13px] ${t?"animate-spin":""}`}),t?"Trying againâ¦":"Try again"]})})]})]})}const fG="PDF, JPEG, PNG or HEIC",u6=`${fG} · up to ${Eu} per batch`,hG=[{source:"upload",title:"Upload a file",hint:u6,arrival:"you upload them",cardTitle:"Direct upload",cardSubtitle:u6,Icon:Oo,iconClass:"bg-brand-soft text-brand"},{source:"email",title:"Forward by email",hint:"Send a receipt to your own forwarding address",arrival:"you forward them by email",cardTitle:"Email forwarding",cardSubtitle:"forward a receipt to your address and it becomes a document",Icon:If,iconClass:"bg-badge-green text-badge-green-text"},{source:"gmail",title:"Connect Gmail",hint:"We look for receipts and invoices in your inbox",arrival:"Gmail forwards them",cardTitle:"Gmail",cardSubtitle:"receipts and invoices straight from your inbox",pendingNotice:"Scanning your inbox for receipts and invoices is not ready yet. We will turn it on here when it is.",Icon:If,iconClass:"bg-badge-red text-badge-red-text"},{source:"drive",title:"Sync a Drive folder",hint:"Anything you drop in the folder is picked up",arrival:"Drive syncs them",cardTitle:"Google Drive",cardSubtitle:"documents picked up from a Drive folder",pendingNotice:"Picking documents up from a Drive folder is not ready yet. Backing your documents up to Drive still works â connect it under Connections.",Icon:Yn,iconClass:"bg-badge-blue text-badge-blue-text"}],OA=hG.filter(e=>Hm(e.source)),_ye=Object.fromEntries(hG.map(e=>[e.source,e])),pG=e=>_ye[e],mG={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},kye=mG[3],Sye=e=>mG[e]??kye,Cye={2:"two ways",3:"three ways"};function Eye(e){const t=e.map(r=>r.arrival);if(t.length===0)return"No document source is available right now. Once one is, every file goes through the same parser.";if(t.length===1)return`Documents reach Moneylogz one way today â ${t[0]}. Every file goes through the same parser.`;const n=`${t.slice(0,-1).join(", ")}, or ${t[t.length-1]}`;return`Documents reach Moneylogz ${Cye[t.length]??`${t.length} ways`} today â ${n}. However they arrive, they go through the same parser.`}const Oye="border border-border rounded-[11px] p-[14px] bg-surface-2 text-left",Aye=Eye(OA),Tye=Sye(OA.length);
491function Pye({isUploading:e,uploadProgress:t,onImportClick:n}){return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-4 lg:px-6 py-14 flex flex-col items-center text-center",children:[i.jsx("span",{className:"w-16 h-16 rounded-full border-4 border-brand text-brand flex items-center justify-center mb-5",children:i.jsx(ri,{className:"w-6 h-6"})}),i.jsx("h3",{className:"text-[19px] font-extrabold tracking-tight text-slate-900",children:"No documents yet"}),i.jsx("p",{className:"text-[13.5px] text-slate-500 mt-2 max-w-[420px] leading-relaxed",children:Aye}),i.jsx("div",{className:`grid grid-cols-1 gap-3 mt-6 w-full max-w-[640px] ${Tye}`,children:OA.map(({source:r,title:a,hint:s,Icon:o,iconClass:l})=>i.jsxs("div",{className:Oye,children:[i.jsx("span",{className:`w-[30px] h-[30px] rounded-lg flex items-center justify-center mb-2.5 ${l}`,children:i.jsx(o,{className:"w-[15px] h-[15px]"})}),i.jsx("b",{className:"text-[13px] font-bold block text-slate-900",children:a}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-1",children:s})]},r))}),i.jsxs("div",{className:"border-2 border-dashed border-brand bg-brand-soft rounded-xl p-6 mt-6 w-full max-w-[640px] text-brand",children:[i.jsx(Oo,{className:"w-6 h-6 mx-auto"}),i.jsx("b",{className:"text-sm font-bold block mt-2",children:"Drop your first documents here"}),i.jsx("p",{className:"text-xs text-blue-700 mt-1",children:"A flat, well-lit photo of the whole document parses best"}),i.jsx("button",{type:"button",onClick:n,disabled:e,className:"inline-flex items-center gap-2 mt-3.5 min-h-[42px] lg:min-h-0 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50",children:e?i.jsxs(i.Fragment,{children:[i.jsx(Oo,{className:"w-[13px] h-[13px] animate-bounce"}),"Uploading... ",Math.round(t),"%"]}):i.jsxs(i.Fragment,{children:[i.jsx(Qs,{className:"w-[13px] h-[13px]"}),"Choose files"]})})]})]})}const Rye="fixed inset-0 z-50 h-[100dvh] overflow-y-auto overflow-x-hidden lg:h-full",gG="flex bg-slate-900/50 backdrop-blur-sm items-end justify-center lg:items-center",xG="relative w-full p-0 lg:p-4 lg:h-auto",bG="max-h-[92dvh] rounded-t-2xl",Mye=`relative flex ${bG} flex-col bg-white shadow lg:rounded-lg lg:max-h-[90dvh] pb-[env(safe-area-inset-bottom)] lg:pb-0`,lc="flex flex-col-reverse gap-2.5 w-full lg:flex-row lg:justify-end lg:gap-3 [&>*]:w-full lg:[&>*]:w-auto",Gu={root:{base:Rye,show:{on:gG,off:"hidden"}},content:{base:xG,inner:Mye}},Dye=e=>{const t=e.filter(s=>wa(s)!==null);if(t.length===0)return null;const n=Cs(t[0]);if(t.some(s=>Cs(s)!==n))return null;const a=t.reduce((s,o)=>s+(wa(o)??0),0);return Re(a,n)};function $ye({isOpen:e,documents:t,isDeleting:n,error:r,onConfirm:a,onCancel:s}){const o=t.length,l=`document${o===1?"":"s"}`,u=Dye(t),d=t.filter(Rg).length;return i.jsxs(qt,{show:e,onClose:s,size:"md",position:"center",dismissible:!0,theme:Gu,children:[i.jsx(qt.Header,{className:"dialog-header",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"dialog-header-icon",children:i.jsx(Jt,{})}),i.jsxs("div",{children:[i.jsxs("h3",{className:"dialog-header-title",children:["Delete ",o," ",l,"?"]}),i.jsx("p",{className:"dialog-header-subtitle",children:"This cannot be undone"})]})]})}),i.jsx(qt.Body,{className:"dialog-body",children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"dialog-warning-box",children:i.jsxs("p",{className:"text-sm text-gray-600",children:["Deleted documents are removed along with any match they had. The transaction stays â it simply returns to ",i.jsx("b",{children:"Unmatched"}),"."]})}),i.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[i.jsxs("ul",{className:"text-sm text-gray-900 space-y-1",children:[t.slice(0,3).map(h=>i.jsx("li",{className:"font-mono text-[12px] break-all",children:h.filename},h.id)),o>3&&i.jsxs("li",{className:"text-[12px] text-gray-600",children:["and ",o-3," more"]})]}),u&&i.jsxs("p",{className:"text-[12px] text-gray-600 mt-2",children:[u," in total"]})]}),r&&i.jsx("p",{role:"alert",className:"text-[12.5px] text-amount-neg",children:r}),d>0&&i.jsxs("p",{className:"text-xs text-gray-600",children:[d," of these ",d===1?"is":"are"," backed up to Drive. The copies in your Drive folder are ",i.jsx("b",{children:"not"})," deleted."]})]})}),i.jsx(qt.Footer,{className:"dialog-footer",children:i.jsxs("div",{className:lc,children:[i.jsx(mt,{color:"gray",onClick:s,disabled:n,className:"dialog-cancel-button",children:"Cancel"}),i.jsx(mt,{color:"failure",onClick:a,disabled:n,className:"dialog-confirm-button",children:n?"Deleting...":`Delete ${o} ${l}`})]})})]})}var fi={},Vp={},d6;function Iye(){return d6||(d6=1,Object.defineProperty(Vp,"__esModule",{value:!0}),Vp.defaultConfiguration=void 0,Vp.defaultConfiguration={clientId:"",developerKey:"",viewId:"DOCS",callbackFunction:function(){return null}}),Vp}var Vb={},f6;function Lye(){if(f6)return Vb;
491f6=1,Object.defineProperty(Vb,"__esModule",{value:!0});var e=ti(),t={queue:{},injectorMap:{},scriptMap:{}};function n(r){var a=(0,e.useState)({loaded:!1,error:!1}),s=a[0],o=a[1];return(0,e.useEffect)(function(){var l,u,d,h,p;if(!((l=t.injectorMap)===null||l===void 0)&&l[r]||(t.injectorMap[r]="init"),t.injectorMap[r]==="loaded"){o({loaded:!0,error:!1});return}if(t.injectorMap[r]==="error"){o({loaded:!0,error:!0});return}var g=function(y){var w,j,N,k;y&&console.log("error loading the script"),(j=(w=t.queue)===null||w===void 0?void 0:w[r])===null||j===void 0||j.forEach(function(S){return S(y)}),y&&t.scriptMap[r]?((k=(N=t.scriptMap)===null||N===void 0?void 0:N[r])===null||k===void 0||k.remove(),t.injectorMap[r]="error"):t.injectorMap[r]="loaded",delete t.scriptMap[r]},x=function(y){o({loaded:!0,error:y})};return!((u=t.scriptMap)===null||u===void 0)&&u[r]||(t.scriptMap[r]=document.createElement("script"),t.scriptMap[r]&&(t.scriptMap[r].src=r,t.scriptMap[r].async=!0,document.body.append(t.scriptMap[r]),t.scriptMap[r].addEventListener("load",function(){return g(!1)}),t.scriptMap[r].addEventListener("error",function(){return g(!0)}),t.injectorMap[r]="loading")),!((d=t.queue)===null||d===void 0)&&d[r]?(p=(h=t.queue)===null||h===void 0?void 0:h[r])===null||p===void 0||p.push(x):t.queue[r]=[x],function(){var y,w;t.scriptMap[r]&&((y=t.scriptMap[r])===null||y===void 0||y.removeEventListener("load",function(){return g(!0)}),(w=t.scriptMap[r])===null||w===void 0||w.removeEventListener("error",function(){return g(!0)}))}},[r]),[s.loaded,s.error]}return Vb.default=n,Vb}var h6;function Fye(){if(h6)return fi;h6=1;var e=fi&&fi.__assign||function(){return e=Object.assign||function(l){for(var u,d=1,h=arguments.length;d<h;d++){u=arguments[d];for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(l[p]=u[p])}return l},e.apply(this,arguments)},t=fi&&fi.__spreadArray||function(l,u,d){if(d||arguments.length===2)for(var h=0,p=u.length,g;h<p;h++)(g||!(h in u))&&(g||(g=Array.prototype.slice.call(u,0,h)),g[h]=u[h]);return l.concat(g||Array.prototype.slice.call(u))},n=fi&&fi.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(fi,"__esModule",{value:!0});var r=ti(),a=Iye(),s=n(Lye());function o(){var l=["https://www.googleapis.com/auth/drive.readonly"],u=(0,s.default)("https://apis.google.com/js/api.js"),d=u[0],h=u[1],p=(0,s.default)("https://accounts.google.com/gsi/client"),g=p[0],x=p[1],y=(0,r.useState)(!1),w=y[0],j=y[1],N=(0,r.useState)(!1),k=N[0],S=N[1],E=(0,r.useState)(!1);E[0],E[1];var O=(0,r.useState)(a.defaultConfiguration),T=O[0],P=O[1],M=(0,r.useState)(),D=M[0],A=M[1],L;(0,r.useEffect)(function(){d&&!h&&g&&!x&&!w&&B()},[d,h,g,x,w]),(0,r.useEffect)(function(){k&&T.token&&d&&!h&&g&&!x&&w&&(z(T),S(!1))},[k,T.token,d,h,g,x,w]);var F=function($){if(P($),!$.token){var K=google.accounts.oauth2.initTokenClient({client_id:$.clientId,scope:($.customScopes?t(t([],l,!0),$.customScopes,!0):l).join(" "),callback:function(G){A(G),z(e(e({},$),{token:G.access_token}))}});K.requestAccessToken()}if($.token&&d&&!h&&w)return z($)},B=function(){window.gapi.load("auth"),window.gapi.load("picker",{callback:U})},U=function(){j(!0)},z=function($){var K=$.token,G=$.appId,W=G===void 0?"":G,I=$.supportDrives,H=I===void 0?!1:I,V=$.developerKey,X=$.viewId,te=X===void 0?"DOCS":X,fe=$.disabled,ae=$.multiselect,ke=$.setOrigin,xe=$.showUploadView,ue=xe===void 0?!1:xe,we=$.showUploadFolders,Oe=$.setParentFolder,ne=Oe===void 0?"":Oe,_e=$.viewMimeTypes,ye=$.customViews,Me=$.locale,qe=Me===void 0?"en":Me,be=$.setIncludeFolders,Ce=$.setSelectFolderEnabled,$t=$.disableDefaultView,en=$t===void 0?!1:$t,Ot=$.callbackFunction;if(fe)return!1;var Le=new google.picker.DocsView(google.picker.ViewId[te]);_e&&Le.setMimeTypes(_e),be&&Le.setIncludeFolders(!0),Ce&&Le.setSelectFolderEnabled(!0);var gn=new google.picker.DocsUploadView;return _e&&gn.setMimeTypes(_e),we&&gn.setIncludeFolders(!0),ne&&gn.setParent(ne),ne&&Le.setParent(ne),L=new google.picker.PickerBuilder().setAppId(W).setOAuthToken(K).setDeveloperKey(V).setLocale(qe).setCallback(Ot),ke&&L.setOrigin(ke),en||L.addView(Le),ye&&ye.map(function(Aa){return L.addView(Aa)}
491),ae&&L.enableFeature(google.picker.Feature.MULTISELECT_ENABLED),ue&&L.addView(gn),H&&L.enableFeature(google.picker.Feature.SUPPORT_DRIVES),L.build().setVisible(!0),!0};return[F,D]}return fi.default=o,fi}var zye=Fye();const Bye=ka(zye);function Ig(){return"https://app.moneylogz.com/"}async function Uye(e){try{const{data:t}=await Je.post("/drive/auth/callback",{code:e,redirect_uri:Ig()});return t}catch(t){return t.name==="CanceledError"?{success:!1}:{success:!1,error:t.response?.data?.error||"Failed to exchange code for tokens"}}}async function qye(){try{const{data:e}=await Je.post("/drive/disconnect");return e.success}catch{return!1}}async function Hye(e,t){const{data:n}=await Je.post("/drive/upload",{receiptIds:e,folderId:t});return n}async function Qm(){const{data:e}=await Je.get("/connections");if(!e.success)throw new Error("Failed to fetch connections");return e.data}function Kye(e){return`Upload ${e} Document${e===1?"":"s"}`}function Vye(e){return`Uploading ${e} document${e===1?"":"s"} to Drive...`}const Gye=2e3;function Wye({isOpen:e,onClose:t,selectedReceipts:n,onUploadComplete:r}){const a=mn(),{connections:s,setConnections:o}=$n(),[l,u]=v.useState(!1),[d,h]=v.useState(null),[p,g]=v.useState(null),[x,y]=Bye();v.useEffect(()=>{if(!e){g(null),h(null);return}},[e]),v.useEffect(()=>{if(!l||!s?.drive.status||s.drive.status==="idle")return;const k=setInterval(async()=>{try{const S=await Qm();o(S),S.drive.status==="idle"&&(u(!1),await a.invalidateQueries({queryKey:["receipts"]}),r(),t())}catch{}},Gye);return()=>clearInterval(k)},[s?.drive.status,l,o,r,t]);const w=()=>{x({clientId:"430666016442-tr0odpd46h72dd2r158hqb3trfuvtg6t.apps.googleusercontent.com",developerKey:"AIzaSyCPOQXjyv3P-vF-GQnH_9gLL-2wPtpoPxk",viewId:"FOLDERS",token:s?.drive.token||"",showUploadView:!0,showUploadFolders:!0,setSelectFolderEnabled:!0,supportDrives:!0,multiselect:!1,callbackFunction:N=>{if(N.action==="picked"){const k=N.docs[0];h({id:k.id,name:k.name,path:k.name})}}})},j=async()=>{if(d){g(null),u(!0);try{await Hye(n,d.id);const N=await Qm();o(N)}catch(N){g(N instanceof Error?N.message:"Failed to upload documents"),u(!1)}}};return i.jsx(qt,{show:e,onClose:t,position:"center",dismissible:!0,theme:{...Gu,content:{base:`${xG} flex items-end justify-center lg:items-center`,inner:"relative flex max-h-[92dvh] flex-col w-full lg:w-auto bg-surface shadow-card rounded-t-2xl lg:rounded-xl lg:max-h-[90dvh] pb-[env(safe-area-inset-bottom)] lg:pb-0"}},style:{maxWidth:"none",width:"100%"},children:i.jsxs("div",{className:"w-full lg:max-w-lg mx-auto",children:[i.jsx(qt.Header,{className:"border-b border-border !p-6 !m-0",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"p-2 bg-brand-soft rounded-lg",children:i.jsx(Yn,{className:"h-6 w-6 text-brand"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-bold tracking-tight text-slate-900",children:"Upload Documents to Drive"}),i.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Select a destination folder for your documents"})]})]})}),i.jsx(qt.Body,{className:"!p-6",children:s?.drive.connected?i.jsxs(i.Fragment,{children:[p&&i.jsxs("div",{className:"mb-4 p-4 bg-badge-red text-badge-red-text rounded-lg flex items-center gap-2",children:[i.jsx(Qt,{className:"w-5 h-5"}),i.jsx("span",{children:p})]}),i.jsx("div",{className:"space-y-4",children:i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-4",children:"Destination Folder"}),i.jsxs("div",{className:"bg-surface-2 border border-border rounded-lg p-4",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"flex-1 min-w-0",children:d?i.jsx("div",{className:"bg-surface border border-brand rounded-lg p-3",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 bg-brand-soft rounded-lg flex items-center justify-center",children:i.jsx(Yn,{className:"w-4 h-4 text-brand"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"font-medium text-slate-900 break-words",children:d.name}),i.jsx("p",{className:"text-xs text-slate-500 break-words",children:d.path})]})]})}):i.jsxs("div",{className:"text-center py-6",children:[i.jsx(Yn,{className:"w-8 h-8 text-slate-400 mx-auto mb-2"}),i.jsx("p",{className:"text-sm text-slate-500",children:"No folder selected"}),i.jsx("p",{className:"text-xs text-slate-400",children:"Choose a destination folder for your documents"})]})})}),i.jsx("div",{className:"mt-4 flex justify-center",children:i.jsxs(mt,{size:"sm",onClick:w,disabled:!s?.drive.token,className:"bg-brand hover:bg-brand-hover text-white border border-brand",children:[i.jsx(Yn,{className:"w-4 h-4 mr-2"}),"Browse Drive"]})})]})]})}),s?.drive.status==="processing"&&i.jsxs("div",{className:"mt-4 bg-brand-soft p-4 rounded-lg flex items-center gap-3",children:[i.jsx(dt,{className:"w-5 h-5 text-brand animate-spin"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-slate-900",children:"Upload in Progress"}),i.jsx("p",{className:"text-xs text-slate-500",children:Vye(n.length)})]})]})]}):i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"bg-brand-soft rounded-full w-16 h-16 mx-auto mb-4 flex items-center justify-center",children:i.jsx(Yn,{className:"w-8 h-8 text-brand"})}),i.jsx("h3",{className:"text-lg font-semibold text-slate-900 mb-2",children:"Connect Google Drive"}),i.jsxs(gt,{to:"/connections",className:"inline-flex items-center gap-2 text-brand hover:text-brand-hover",children:["Go to Connections",i.jsx(n1,{className:"w-4 h-4"})]})]})}),i.jsx(qt.Footer,{className:"border-t border-border !p-6",children:i.jsxs("div",{className:`${lc} lg:w-auto [&>*]:min-h-[42px] lg:[&>*]:min-h-0`,children:[i.jsx(mt,{color:"light",onClick:t,disabled:l,className:"bg-surface hover:bg-slate-100 border border-border text-slate-900",children:"Cancel"}),i.jsx(mt,{className:"bg-brand hover:bg-brand-hover text-white border border-brand font-medium",onClick:j,disabled:!s?.drive.connected||!d||l||s?.drive.status==="processing",children:l||s?.drive.status==="processing"?i.jsxs(i.Fragment,{children:[i.jsx(Dt,{size:"sm",className:"mr-2"}),"Uploading to Drive..."]}):Kye(n.length)})]})})]})})}function Yye({isOpen:e,onClose:t,progress:n,isUploading:r,files:a,currentFileIndex:s}){const o=a.filter(y=>y.status==="completed"),l=a[s],u=a.length,d=!r&&o.length===u&&u>0,h=u>0?Math.round(o.length/u*100):0,p=()=>d?i.jsx(vs,{className:"w-8 h-8 text-green-600"}):r?i.jsx(Oo,{className:"w-8 h-8 text-blue-600 animate-bounce"}):i.jsx(xr,{className:"w-8 h-8 text-gray-400"}),g=()=>d?"Upload Complete!":r?"Uploading Documents...":"Preparing Upload...",x=()=>d?"text-green-600":r?"text-blue-600":"text-gray-600";return i.jsxs(qt,{show:e,onClose:t,size:"md",position:"center",dismissible:!r,theme:Gu,children:[i.jsx(qt.Header,{className:"border-b border-gray-200 !p-6 !m-0",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:p()}),i.jsxs("div",{children:[i.jsx("h3",{className:`text-xl font-semibold ${x()}`,children:g()}),i.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:[o.length," of ",u," files processed"]})]})]})}),i.jsx(qt.Body,{className:"!p-6",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Overall Progress"}),i.jsxs("span",{className:"text-sm text-gray-600",children:[h,"%"]})]}),i.jsx(LO,{progress:h,size:"lg",color:o.length===u&&u>0?"green":"blue",className:"mb-2"})]}),l&&l.status==="uploading"&&i.jsx("div",{className:"bg-blue-50 p-4 rounded-lg border border-blue-200",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(ri,{className:"w-5 h-5 text-blue-600"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Currently uploading:"}),i.jsx("p",{className:"text-sm text-gray-600 truncate",children:l.name})]})]})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:"Files"}),i.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:a.map((y,w)=>{const j=()=>{switch(y.status){case"completed":return i.jsx(vs,{className:"w-4 h-4 text-green-600 flex-shrink-0"});case"uploading":return i.jsx(Oo,{className:"w-4 h-4 text-blue-600 flex-shrink-0 animate-bounce"});default:return i.jsx(xr,{className:"w-4 h-4 text-gray-400 flex-shrink-0"})}},N=()=>{switch(y.status){case"completed":return"Uploaded";case"uploading":return"Uploading...";default:return"Waiting"}},k=()=>{switch(y.status){case"completed":return"text-green-600";case"uploading":return"text-gray-700";default:return"text-gray-700"}};return i.jsxs("div",{className:"flex items-center gap-3 p-2 bg-gray-50 rounded-lg",children:[j(),i.jsx("span",{className:"text-sm text-gray-700 truncate flex-1",children:y.name}),i.jsx("span",{className:`text-xs font-medium ${k()}`,children:N()})]},w)})})]}),d&&i.jsx("div",{className:"bg-green-50 p-4 rounded-lg border border-green-200",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(vs,{className:"w-5 h-5 text-green-600"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-green-800",children:"Upload Successful!"}),i.jsxs("p",{className:"text-sm text-green-600",children:["All ",u," documents have been uploaded and are being processed."]})]})]})})]})}),i.jsx(qt.Footer,{className:"border-t border-gray-200 !p-6",children:i.jsx("div",{className:"flex justify-end w-full lg:w-auto",children:i.jsx(mt,{color:"gray",onClick:t,disabled:r,className:"bg-white hover:bg-gray-50 border border-gray-300 w-full min-h-[42px] lg:w-auto lg:min-h-0",children:r?"Uploading...":"Close"})})})]})}function Xye(){const{connections:e}=$n(),{pathname:t}=Gr(),n=v.useRef(null),[r,a]=v.useState(!1),[s,o]=v.useState([]),[l,u]=v.useState(!1),[d,h]=v.useState(!1),[p,g]=v.useState([]),[x,y]=v.useState(!1),[w,j]=v.useState(null),[N,k]=v.useState({files:[],currentFileIndex:0}),{data:S,isError:E,error:O,isFetching:T,refetch:P,documents:M,summary:D,review:A,unmatched:L,inbox:F,sources:B,storage:U}=pV(),{deleteDocuments:z}=fye(),{uploadFiles:$,isUploading:K,uploadProgress:G}=dG({onError:()=>{u(!1),k({files:[],currentFileIndex:0})},onProgress:(ye,Me)=>{k(qe=>{const be=[...qe.files];return be[Me]&&(be[Me].status=ye>=100?"completed":"uploading"),{files:be,currentFileIndex:Me}})},onComplete:()=>{k(ye=>({files:ye.files.map(Me=>({...Me,status:"completed"})),currentFileIndex:ye.files.length}))}}),W=v.useCallback(async ye=>{const Me=ye.target.files;if(!(!Me||Me.length===0)){if(Me.length>Eu){alert(`Maximum ${Eu} files allowed per upload`);return}try{u(!0),k({files:Array.from(Me).map(qe=>({name:qe.name,status:"pending"})),currentFileIndex:0}),await $(Me)}finally{n.current&&(n.current.value="")}}},[$]),I=v.useCallback(()=>{h(!1),n.current?.click()},[]),H=v.useCallback(ye=>{if(!Array.isArray(ye)||ye.length===0){h(!0);return}h(!1),o(ye),a(!0)},[]),V=v.useCallback(()=>{d&&h(!1)},[d]),X=v.useCallback(ye=>{if(ye.length===0){h(!0);return}h(!1),g(ye)},[]),te=v.useCallback(async()=>{const ye=p.length;y(!0),j(null);try{await z(p),g([])}catch{j(`We could not delete ${ye===1?"that document":`those ${ye} documents`}. Please try again.`)}finally{y(!1)}},[z,p]),fe=v.useCallback(()=>{g([]),j(null)},[]),ae=v.useCallback(()=>{P()},[P]),ke=v.useMemo(()=>M.filter(ye=>p.includes(ye.id)),[M,p]),xe=!S&&!E,ue=E&&!S,we=E&&!!S,Oe=!!S&&M.length===0,ne={documents:M,summary:D,review:A,unmatched:L,inbox:F,sources:B,storage:U,onImportClick:I,onDriveUpload:H,onDelete:X,pendingDeleteIds:p,clearSelectionError:V,isUploading:K,uploadProgress:G,isRefreshing:T,onRetry:ae},_e=O instanceof ma?O.message:"An unexpected error occurred. Please try again later.";return i.jsxs("div",{className:"flex flex-col",children:[i.jsx(mye,{isUploading:K,uploadProgress:G,hasDocuments:M.length>0,driveBusy:e?.drive?.status==="processing",showSelectionError:d,onDriveUpload:H,onImportClick:I}),i.jsx(DO,{id:"upload-receipt",className:"hidden",onChange:W,disabled:K,accept:"image/*,.pdf",multiple:!0,ref:n}),i.jsx(bye,{counts:{all:D.total,review:A.total,sources:B.filter(ye=>ye.documents>0&&Hm(ye.source)).length},attentionCount:A.total}),we&&i.jsx("p",{className:"text-[12.5px] text-badge-yellow-text bg-badge-yellow border border-amber-200 rounded-lg px-3 py-2 mb-4",children:"We could not refresh just now, so this is the last list we loaded."}),xe?i.jsx(jye,{}):ue?i.jsx(Nye,{message:_e,isRetrying:T,onRetry:ae}):Oe&&!t.startsWith(rs("sources"))?i.jsx(Pye,{isUploading:K,uploadProgress:G,onImportClick:I}):i.jsxs(i.Fragment,{children:[i.jsx(vye,{summary:D}),i.jsx(yg,{context:ne})]}),i.jsx($ye,{isOpen:p.length>0,documents:ke,isDeleting:x,error:w,onConfirm:te,onCancel:fe}),i.jsx(Wye,{isOpen:r,onClose:()=>a(!1),selectedReceipts:s,onUploadComplete:()=>{a(!1),o([])}}),i.jsx(Yye,{isOpen:l,onClose:()=>{K||(u(!1),k({files:[],currentFileIndex:0}))},progress:G,isUploading:K,files:N.files,currentFileIndex:N.currentFileIndex})]})}const jh=()=>Gv(),Qye={brand:{rail:"bg-brand",icon:"bg-brand-soft text-brand",count:"text-badge-yellow-text",done:"bg-brand",button:"border-brand bg-brand text-white hover:bg-brand-hover"},violet:{rail:"bg-violet-600",icon:"bg-violet-100 text-violet-700",count:"text-violet-700",done:"bg-violet-600",button:"border-violet-600 bg-violet-600 text-white hover:bg-violet-700"}};function p6({tone:e,icon:t,title:n,lede:r,waiting:a,donePercent:s,meta:o,clearedMeta:l,actionLabel:u,to:d,onOpen:h}){const p=a===0,g=Qye[e];return i.jsxs("section",{className:`relative overflow-hidden rounded-xl border bg-surface shadow-card px-4 lg:px-[22px] py-5 flex flex-col gap-3.5 ${p?"border-dashed border-border":"border-border"}`,children:[i.jsx("span",{className:`absolute inset-y-0 left-0 w-1 ${p?"bg-amount-pos":g.rail}`}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("span",{className:`w-[42px] h-[42px] rounded-[11px] flex-none flex items-center justify-center ${p?"bg-badge-green text-badge-green-text":g.icon}`,children:p?i.jsx(Zt,{className:"w-[18px] h-[18px]"}):t}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h2",{className:"text-base font-extrabold tracking-tight text-slate-900",children:n}),i.jsx("p",{className:"text-[12.5px] text-slate-500 mt-0.5 leading-relaxed",children:r})]}),p?i.jsx("span",{className:"inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-badge-green text-badge-green-text flex-none",children:"All clear"}):i.jsxs("span",{className:"text-right flex-none",children:[i.jsx("b",{className:`block text-[32px] leading-none font-extrabold tracking-tight tabular-nums ${g.count}`,children:a}),i.jsx("span",{className:"text-[11px] text-slate-500",children:"waiting"})]})]}),i.jsx("span",{className:"h-2 rounded-full bg-surface-muted overflow-hidden flex",children:i.jsx("span",{className:`block h-full ${p?"bg-amount-pos":g.done}`,style:{width:`${p?100:s}%`}})}),i.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[i.jsx("span",{className:"flex-1 min-w-[150px] text-xs text-slate-500",children:p?l:o}),!p&&i.jsxs(gt,{to:d,onClick:h,className:`inline-flex items-center justify-center gap-2 w-full lg:w-auto min-h-[42px] font-semibold text-sm px-3.5 py-2.5 rounded-lg border ${g.button}`,children:[u,i.jsx(zu,{className:"w-[15px] h-[15px]"})]})]})]})}function Zye({summary:e,inbox:t,unmatched:n}){const r=e.byStatus.completed,a=e.reviewedParsed,s=e.matched,o=s+n.length,l=_1(n),u=l.amount===null?null:Re(l.amount,l.currency);return i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"Your queues"}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 mb-[18px]",children:[i.jsx(p6,{tone:"brand",icon:i.jsx(r1,{className:"w-[18px] h-[18px]"}),title:"Review what arrived",lede:"Check the vendor, date and total the parser read, one document at a time.",waiting:t.length,donePercent:mr(a,r),meta:`${a} of ${r} reviewed`,clearedMeta:"Every parsed document has been reviewed.",actionLabel:"Open the inbox",to:yA}),i.jsx(p6,{tone:"violet",icon:i.jsx(Fi,{className:"w-[18px] h-[18px]"}),title:"Link to transactions
491",lede:"Put each document against the card charge it belongs to.",waiting:n.length,donePercent:mr(s,o),meta:u?`${u} with no transaction against it`:`${s} of ${o} matched`,clearedMeta:"Every parsed document is linked to a transaction.",actionLabel:"Open the workbench",to:Tu})]})]})}const m6=["bg-brand","bg-sky-500","bg-orange-500","bg-violet-500","bg-slate-400","bg-slate-300"];function Jye({summary:e}){const{valueCaptured:t,topVendors:n,total:r}=e,a=n[0]?.total??0;return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card p-5",children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:["Value captured",t.currency?` · ${t.currency}`:""]}),i.jsx("p",{className:"text-[34px] leading-none font-extrabold tracking-tight mt-2 tabular-nums text-slate-900",children:t.amount===null?"â":Re(t.amount,t.currency)}),i.jsx("p",{className:"text-[12.5px] text-slate-500 mt-2",children:t.amount===null?i.jsxs(i.Fragment,{children:["None of your ",r," document",r===1?"":"s"," has a total we could read yet."]}):i.jsxs(i.Fragment,{children:[i.jsx("b",{className:"tabular-nums",children:t.documents})," documents ·"," ",i.jsx("b",{className:"tabular-nums",children:n.length})," of your vendors shown below",t.mixedCurrency&&i.jsx(i.Fragment,{children:" · totals in other currencies are not counted here"})]})}),i.jsxs("div",{className:"mt-5 pt-4 border-t border-border",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-3",children:"Top vendors"}),n.length===0?i.jsx("p",{className:"text-[13px] text-slate-500",children:"No vendor has a readable total yet. Once a document parses, it shows up here."}):n.map((s,o)=>i.jsxs("div",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsx("span",{className:"w-[88px] lg:w-[112px] flex-none text-xs font-semibold text-slate-600 truncate",children:s.name}),i.jsx("span",{className:"flex-1 h-5 rounded-md bg-surface-muted overflow-hidden",children:i.jsx("span",{className:`block h-full ${m6[o%m6.length]}`,style:{width:`${a>0?Math.max(4,s.total/a*100):0}%`}})}),i.jsx("span",{className:"w-[84px] lg:w-[104px] flex-none text-right text-[12.5px] font-bold tabular-nums text-slate-900",children:Re(s.total,t.currency)})]},s.name))]})]})}function eve({summary:e}){const{total:t,byStatus:n}=e,r=t>0&&n.failed===0;return i.jsx(kf,{label:"Parse quality",badge:t>0&&i.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold ${r?"bg-badge-green text-badge-green-text":"bg-badge-yellow text-badge-yellow-text"}`,children:r?"Healthy":`${n.failed} failed`}),value:t===0?"â":i.jsxs(i.Fragment,{children:[n.completed," ",i.jsxs("span",{className:"text-xs font-semibold text-slate-500",children:["of ",t," parsed"]})]}),segments:[{width:mr(n.completed,t),className:"bg-amount-pos",label:`${n.completed} parsed`},{width:mr(n.processing+n.pending,t),className:"bg-badge-blue-text",label:`${n.processing+n.pending} in flight`},{width:mr(n.failed,t),className:"bg-amount-neg",label:`${n.failed} failed`}],hint:t===0?"nothing parsed yet":`${n.failed} failed · ${n.processing} processing · ${n.pending} pending`})}function tve({summary:e,unmatched:t}){const n=_1(t),r=n.amount===null?null:Re(n.amount,n.currency);return i.jsx(kf,{label:"Waiting to be matched",badge:t.length>0&&i.jsx("span",{className:"inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-badge-yellow text-badge-yellow-text",children:t.length}),value:t.length===0?"All matched":r??`${t.length} documents`,segments:[{width:mr(e.matched,e.total),className:"bg-brand",label:`${e.matched} matched`}],hint:t.length===0?"every parsed document is linked to a transaction":i.jsxs(i.Fragment,{children:[e.matched," of ",e.total," matched â"," ",i.jsx(gt,{to:Tu,className:"text-brand font-semibold hover:underline",children:"match them â"})]})})}function nve({summary:e,storage:t}){const{drive:n}=e;return i.jsx(kf,{label:"Storage & Drive backup",badge:n.failed>0&&i.jsxs("span",{className:"inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-badge-red text-badge-red-text",children:[n.failed," backup ",n.failed===1?"error":"errors"]}),value:i.jsxs(i.Fragment,{children:[t.label,i.jsxs("span",{className:"text-xs font-semibold text-slate-500",children:[" ","across ",t.documents," document",t.documents===1?"":"s"]})]}),segments:[{width:mr(n.backedUp,e.total),className:"bg-badge-blue-text",label:`${n.backedUp} backed up`}],hint:`${n.backedUp} backed up to Drive · ${n.notBackedUp} not backed up`})}const bk=["from-blue-400 to-brand","from-amber-400 to-orange-500","from-sky-4
49100 to-sky-600","from-violet-400 to-violet-600","from-emerald-400 to-emerald-600","from-rose-400 to-rose-600","from-teal-400 to-teal-600","from-fuchsia-400 to-purple-600"];function rve(e){const t=e?.trim().toLowerCase();if(!t)return bk[0];let n=5381;for(let r=0;r<t.length;r+=1)n=n*33^t.charCodeAt(r);return bk[Math.abs(n)%bk.length]}function yG(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function Es({name:e,className:t=""}){return i.jsx("span",{className:`inline-flex items-center justify-center w-[26px] h-[26px] shrink-0 rounded-[7px] bg-gradient-to-br ${rve(e)} text-white text-[11px] font-bold ${t}`,children:yG(e)})}function q1({document:e,className:t=""}){const n=uV(e),r=n?"border-red-200 bg-red-50":"border-border bg-surface-2",a=n?"bg-red-300":"bg-slate-300",s=n?"bg-red-400":"bg-slate-400";return i.jsxs("span",{"aria-hidden":"true",className:`relative block w-[32px] h-[40px] flex-none rounded-md border overflow-hidden ${r} ${t}`,children:[i.jsx("span",{className:`absolute left-[5px] right-[5px] top-[6px] h-[2px] rounded-sm ${a}`}),i.jsx("span",{className:`absolute left-[5px] right-[13px] top-[12px] h-[2px] rounded-sm ${a}`}),i.jsx("span",{className:`absolute left-[5px] right-[5px] top-[18px] h-[2px] rounded-sm ${a}`}),i.jsx("span",{className:`absolute left-[5px] right-[10px] top-[24px] h-[2px] rounded-sm ${a}`}),i.jsx("span",{className:`absolute left-[5px] right-[5px] bottom-[5px] h-[6px] rounded-sm ${s}`})]})}function Pu({document:e,isProcessing:t=!1}){const n=kxe(e,t);return i.jsxs("span",{className:`${ja} ${n.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${n.dotClassName} ${n.animateClass}`}),n.text]})}function ave({documents:e,total:t,limit:n=5}){const r=Sa(),a=e.slice(0,n);return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden mb-4",children:[i.jsxs("header",{className:"flex items-center gap-3 px-[18px] py-3 bg-surface-2 border-b border-border",children:[i.jsx("span",{className:"w-[30px] h-[30px] rounded-lg flex-none flex items-center justify-center bg-brand-soft text-brand",children:i.jsx(ri,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-sm font-extrabold text-slate-900",children:"Latest arrivals"}),i.jsx("p",{className:"text-xs text-slate-500 mt-px",children:"newest documents, whatever their source"})]})]}),a.length===0?i.jsx("p",{className:"px-[18px] py-6 text-[13px] text-slate-500 text-center",children:"Nothing has arrived yet."}):a.map(s=>{const o=Tg(s);return i.jsxs("div",{role:"button",tabIndex:0,onClick:()=>r(Gf(s.id)),onKeyDown:l=>{l.key==="Enter"&&r(Gf(s.id))},className:"flex flex-wrap lg:flex-nowrap items-center gap-x-3 gap-y-2 lg:gap-3 px-[18px] py-3 border-b border-border last:border-b-0 cursor-pointer hover:bg-surface-2 text-left w-full",children:[i.jsx(q1,{document:s}),i.jsx(Es,{name:Vn(s),className:"hidden lg:inline-flex"}),i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:Vn(s)}),i.jsxs("span",{className:"flex items-center gap-[7px] flex-wrap text-[11.5px] text-slate-500 mt-0.5",children:[i.jsx("span",{className:"font-mono text-[11px] truncate max-w-[220px]",children:s.filename}),i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:Js(s)})]})]}),i.jsxs("span",{className:"flex flex-wrap items-center gap-2 basis-full pl-11 order-last lg:contents",children:[i.jsx(Pu,{document:s}),Yl(s)&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-badge-blue text-badge-blue-text",children:[i.jsx(Fi,{className:"w-3 h-3"}),"Matched"]})]}),i.jsxs("span",{className:"w-auto lg:w-[132px] flex-none text-right",children:[i.jsx("b",{className:"block text-sm font-bold tabular-nums text-slate-900",children:o??"â"}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 mt-0.5",children:s.uploaded_at?qu(s.uploaded_at):""})]})]},s.id)}),i.jsxs("div",{className:"flex items-center justify-between px-[18px] py-3 bg-surface-2 border-t border-border text-[12.5px] text-slate-500 flex-wrap gap-2",children:[i.jsxs("span",{children:["Showing ",a.length," of ",t," document",t===1?"":"s"]}),i.jsx(gt,{to:rs("all"),className:"text-brand font-semibold hover:underline",children:"View all documents â"})]})]})}function sve(){const{documents:e,summary:t,unmatched:n,inbox:r,storage:a}=jh();return i.jsxs(i.Fragment,{children:[i.jsx(Zye,{summary:t,inbox:r,unmatched:n}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1.7fr_1fr] mb-4",children:[i.jsx(Jye,{summary:t}),i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsx(eve,{summary:t}),i.jsx(tve,{summary:t,unmatched:n}),i.jsx(nve,{summary:t,storage:a})]})]}),i.jsx(ave,{documents:e,total:t.total})]})}const ive="relative flex-1 min-w-0 lg:min-w-[220px]",vG="absolute left-3 top-1/2 -translate-y-1/2 w-[18px] h-[18px] text-slate-500 pointer-events-none",wG="w-full h-[42px] pl-9 pr-3 rounded-lg border border-border bg-surface text-slate-900 text-sm outline-none transition-colors hover:border-slate-300 focus:border-brand focus:ring-1 focus:ring-brand placeholder:text-slate-500",Sf="inline-flex items-center gap-2 h-[42px] px-3 rounded-lg border border-border bg-surface text-sm font-medium text-slate-700 whitespace-nowrap transition-colors hover:border-slate-300",ove="flex items-start gap-2.5 flex-wrap mb-4",yk="text-[11px] font-semibold text-slate-500",mu="h-[42px] px-3 rounded-lg border border-border bg-surface text-sm text-slate-900 outline-none transition-colors hover:border-slate-300 focus:border-brand focus:ring-1 focus:ring-brand placeholder:text-slate-500";function Lg(e,t){return e.includes(t)?e.filter(n=>n!==t):[...e,t]}function ko({label:e,options:t,selectedValues:n,onChange:r,placeholder:a="Select options",minWidth:s=180}){const[o,l]=v.useState(!1),u=v.useRef(null);v.useEffect(()=>{if(!o)return;const h=p=>{u.current&&!u.current.contains(p.target)&&l(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o]);const d=n.length;return i.jsxs("div",{className:"relative",ref:u,children:[i.jsxs("button",{type:"button",onClick:()=>l(h=>!h),className:Sf,style:{minWidth:s},children:[i.jsx("span",{children:e}),d>0&&i.jsx("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1.5 rounded-full bg-brand text-white text-[11px] font-bold leading-none",children:d}),i.jsx(Ca,{className:`w-4 h-4 text-slate-400 ml-auto transition-transform ${o?"rotate-180":""}`})]}),o&&i.jsx("div",{className:"absolute z-20 mt-2 w-full min-w-[220px] max-h-64 overflow-auto rounded-lg border border-border bg-surface shadow-card py-1",children:t.length===0?i.jsx("div",{className:"px-3 py-2 text-sm text-slate-500",children:a}):t.map(h=>{const p=h.id.toString(),g=n.includes(p);return i.jsxs("button",{type:"button",onClick:()=>r(Lg(n,p)),className:`w-full flex items-center gap-2.5 px-3 py-2 text-sm text-left transition-colors ${g?"bg-brand-soft text-brand font-medium":"text-slate-700 hover:bg-slate-100"}`,children:[i.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border ${g?"bg-brand border-brand text-white":"border-slate-300"}`,children:g&&i.jsx(Zt,{className:"w-3 h-3"})}),i.jsx("span",{className:"truncate",children:h.title})]},p)})})]})}
491function Jy({value:e,onChange:t,placeholder:n="Searchâ¦"}){return i.jsxs("div",{className:ive,children:[i.jsx(uh,{className:vG}),i.jsx("input",{type:"text",value:e,onChange:r=>t(r.target.value),placeholder:n,className:wG})]})}const jG={auto:"max-h-[88dvh] rounded-t-[20px]",tall:"h-[88dvh] rounded-t-[20px]",full:"h-[100dvh] rounded-none"},NG="shadow-[0_-12px_40px_rgba(15,23,42,.25)]",_G="bg-slate-900/45",kG="block w-10 h-[5px] rounded-full bg-slate-300 mx-auto mt-2 mb-0.5 flex-none";function Wu({isOpen:e,onClose:t,label:n,size:r="tall",header:a,footer:s,title:o,children:l,bodyClassName:u="px-[18px] py-4"}){const d=v.useRef(null),h=v.useRef(t);return h.current=t,qo(e),v.useEffect(()=>{if(!e)return;d.current=document.activeElement;const p=document.body.style.overflow;document.body.style.overflow="hidden";const g=x=>{x.key==="Escape"&&h.current()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),document.body.style.overflow=p;const x=d.current;x instanceof HTMLElement&&x.isConnected&&x.focus()}},[e]),e?i.jsxs(i.Fragment,{children:[i.jsx("div",{"data-testid":"bottom-sheet-scrim",className:`fixed inset-0 z-50 ${_G}`,onClick:t,"aria-hidden":"true"}),i.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":n,className:`fixed inset-x-0 bottom-0 z-50 bg-surface flex flex-col ${NG} ${jG[r]}`,children:[r!=="full"&&i.jsx("span",{"aria-hidden":"true",className:kG}),a??(o&&i.jsxs("div",{className:"flex items-center gap-2.5 px-[18px] pt-1.5 pb-3 border-b border-border flex-none",children:[i.jsx("h2",{className:"text-[17px] font-extrabold tracking-tight text-slate-900",children:o}),i.jsx("button",{type:"button",onClick:t,"aria-label":`Close ${n}`,className:"ml-auto w-9 h-9 rounded-lg flex items-center justify-center text-slate-500 hover:bg-slate-100",children:i.jsx(Ut,{className:"w-[18px] h-[18px]"})})]})),i.jsx("div",{className:`flex-1 min-h-0 overflow-y-auto overscroll-contain ${u}`,children:l}),s&&i.jsx("div",{className:"flex-none border-t border-border bg-surface px-4 pt-3 pb-[max(12px,env(safe-area-inset-bottom))]",children:s})]})]}):null}const pC=6,SG=(e,t)=>{switch(e.kind){case"checkbox":case"chips":return e.get(t).length;case"range":{const[n,r]=e.get(t);return e.presets?0:+(n!==""||r!=="")}case"select":return 0}},lve=(e,t)=>e.reduce((n,r)=>n+SG(r,t),0),cve=({count:e})=>e>0?i.jsx("span",{className:"ml-auto text-[11px] font-bold rounded-full px-[7px] py-px bg-brand text-white tabular-nums",children:e}):null;function uve({section:e,state:t,onChange:n}){const[r,a]=v.useState(""),[s,o]=v.useState(!1),l=e.get(t),u=e.options.length>pC,d=v.useMemo(()=>{const h=r.trim().toLowerCase(),p=h?e.options.filter(g=>g.title.toLowerCase().includes(h)):e.options;return u&&!s&&!h?p.slice(0,pC):p},[u,r,e.options,s]);return i.jsxs(i.Fragment,{children:[u&&i.jsxs("label",{className:"relative flex items-center mb-1.5",children:[i.jsx(uh,{className:"w-[15px] h-[15px] text-slate-400 absolute left-3 pointer-events-none"}),i.jsxs("span",{className:"sr-only",children:["Search ",e.title.toLowerCase()]}),i.jsx("input",{type:"search",value:r,onChange:h=>a(h.target.value),placeholder:`Search ${e.options.length} ${e.title.toLowerCase()}`,className:`${mu} w-full pl-9 h-10`})]}),d.map(h=>{const p=l.includes(h.id);return i.jsxs("button",{type:"button",role:"checkbox","aria-checked":p,onClick:()=>n(e.set(t,Lg(l,h.id))),className:`w-full flex items-center gap-2.5 h-10 text-[13.5px] text-left ${p?"text-brand font-semibold":"text-slate-700"}`,children:[i.jsx("span",{className:`w-[18px] h-[18px] rounded-[5px] border flex items-center justify-center flex-none ${p?"bg-brand border-brand text-white":"border-slate-300"}`,children:p&&i.jsx(Zt,{className:"w-3 h-3"})}),i.jsx("span",{className:"truncate",children:h.title})]},h.id)}),u&&!r.trim()&&i.jsx("button",{type:"button",onClick:()=>o(h=>!h),className:"pt-2 text-[12px] font-semibold text-brand",children:s?"Show fewer":`Show all ${e.options.length}`})]})}function dve({section:e,state:t,onChange:n}){switch(e.kind){case"checkbox":return i.jsx(uve,{section:e,state:t,onChange:n});case"chips":{const r=e.get(t);return i.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.options.map(a=>{const s=r.includes(a.id);return i.jsx("button",{type:"button","aria-pressed":s,onClick:()=>n(e.set(t,Lg(r,a.id))),className:`inline-flex items-center h-[34px] px-3 rounded-full border text-[12.5px] font-semibold ${s?"bg-brand-soft border-brand text-brand":"bg-surface border-border text-slate-600"}`,children:a.title},a.id)})})}case"range":{const[r,a]=e.get(t),s={startDate:r,endDate:a};return i.jsxs(i.Fragment,{children:[e.presets&&i.jsx(gA,{value:TV(s),onChange:o=>{const l=yh(o);
491n(e.set(t,[l.startDate,l.endDate]))},label:`${e.title} presets`}),i.jsxs("div",{className:`grid grid-cols-[1fr_auto_1fr] gap-2 items-center text-slate-400 ${e.presets?"mt-2":""}`,children:[i.jsx("input",{type:e.inputType,inputMode:e.inputType==="number"?"decimal":void 0,"aria-label":`${e.title} ${e.placeholders[0]}`,placeholder:e.placeholders[0],value:r,onChange:o=>n(e.set(t,[o.target.value,a])),className:`${mu} w-full min-w-0`}),"â",i.jsx("input",{type:e.inputType,inputMode:e.inputType==="number"?"decimal":void 0,"aria-label":`${e.title} ${e.placeholders[1]}`,placeholder:e.placeholders[1],value:a,onChange:o=>n(e.set(t,[r,o.target.value])),className:`${mu} w-full min-w-0`})]})]})}case"select":return i.jsxs("span",{className:"relative flex items-center",children:[i.jsx("select",{"aria-label":e.title,value:e.get(t),onChange:r=>n(e.set(t,r.target.value)),className:`${mu} w-full appearance-none pr-9`,children:e.options.map(r=>i.jsx("option",{value:r.value,children:r.label},r.value))}),i.jsx(Ca,{className:"w-4 h-4 text-slate-500 absolute right-3 pointer-events-none"})]})}}function fve({section:e,state:t,onChange:n}){return i.jsxs("section",{className:"py-3.5 border-b border-border last:border-b-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[i.jsx("h3",{className:"text-[13.5px] font-bold text-slate-900",children:e.title}),i.jsx(cve,{count:SG(e,t)})]}),i.jsx(dve,{section:e,state:t,onChange:n})]})}function hve(e,{showStatus:t}){const n=[{kind:"checkbox",key:"accounts",title:"Accounts",options:e.accounts,get:r=>r.accountIds,set:(r,a)=>({...r,accountIds:a})},{kind:"range",key:"dates",title:"Date range",inputType:"date",placeholders:["start","end"],presets:!0,get:r=>[r.startDate,r.endDate],set:(r,[a,s])=>({...r,startDate:a||r.startDate,endDate:s||r.endDate})}];return e.categories.length>0&&n.push({kind:e.categories.length>pC*2?"checkbox":"chips",key:"categories",title:"Category",options:e.categories,get:r=>r.categories,set:(r,a)=>({...r,categories:a})}),e.merchants.length>0&&n.push({kind:"checkbox",key:"merchants",title:"Merchant",options:e.merchants,get:r=>r.merchants,set:(r,a)=>({...r,merchants:a})}),e.channels.length>0&&n.push({kind:"chips",key:"channels",title:"Channel",options:e.channels,get:r=>r.channels,set:(r,a)=>({...r,channels:a})}),n.push({kind:"range",key:"amount",title:"Amount",inputType:"number",placeholders:["min","max"],get:r=>[r.minAmount,r.maxAmount],set:(r,[a,s])=>({...r,minAmount:a,maxAmount:s})}),t&&n.push({kind:"select",key:"status",title:"Document status",options:UV,get:r=>r.status,set:(r,a)=>D1(a)?{...r,status:a}:r}),n}const g6=e=>e.charAt(0).toUpperCase()+e.slice(1);function pve(e){return[{kind:"checkbox",key:"merchant",title:"Merchant",options:e.merchant.map(t=>({id:t,title:t})),get:t=>t.merchant,set:(t,n)=>({...t,merchant:n})},{kind:"chips",key:"source",title:"Source",options:e.source.map(t=>({id:t,title:g6(t)})),get:t=>t.source,set:(t,n)=>({...t,source:n})},{kind:"chips",key:"status",title:"Status",options:e.status.map(t=>({id:t,title:g6(t)})),get:t=>t.status,set:(t,n)=>({...t,status:n})}]}const mve=e=>console.info(`[FilterSheet] ${e}`);function CG({isOpen:e,onClose:t,value:n,sections:r,onApply:a,cleared:s,countFor:o,noun:l}){const[u,d]=v.useState(n),h=v.useRef(!1);v.useEffect(()=>{e&&!h.current&&d(n),h.current=e},[e,n]);const p=lve(r,u),g=v.useMemo(()=>e?o(u):0,[e,o,u]),x=()=>{mve(`applied ${p} active filter value(s); ${g} ${l} match`),a(u),t()};return i.jsx(Wu,{isOpen:e,onClose:t,label:"Filters",size:"tall",bodyClassName:"px-[18px] pb-2",header:i.jsxs("div",{className:"flex items-center gap-2.5 px-[18px] pt-1.5 pb-3 border-b border-border flex-none",children:[i.jsx("h2",{className:"text-[17px] font-extrabold tracking-tight text-slate-900",children:"Filters"}),i.jsxs("span",{className:"text-xs text-slate-500",children:[p," active"]}),i.jsx("button",{type:"button",onClick:()=>d(s(u)),className:"ml-auto text-[12.5px] font-semibold text-slate-500 underline",children:"Clear all"}),i.jsx("button",{type:"button",onClick:t,"aria-label":"Close filters",className:"w-9 h-9 rounded-lg flex items-center justify-center text-slate-500 hover:bg-slate-100",children:i.jsx(Ut,{className:"w-[18px] h-[18px]"})})]}),footer:i.jsxs("div",{className:"flex gap-2.5",children:[i.jsx("button",{type:"button",onClick:()=>d(s(n)),className:"h-11 px-3.5 rounded-lg border border-border bg-surface text-sm font-semibold text-slate-700",children:"Reset"}),i.jsxs("button",{type:"button",onClick:x,className:"flex-1 h-11 rounded-lg bg-brand border border-brand text-white text-sm font-semibold",children:["Show ",g," ",l]})]}),children:r.map(y=>i.jsx(fve,{section:y,state:u,onChange:d},y.key))})}function EG({activeCount:e,onClick:t}){return i.jsxs("button",{type:"button",onClick:t,"aria-label":e>0?`Filters, ${e} active`:"Filters",className:`${Sf} relative flex-none font-semibold text-slate-900`,children:[i.jsx(IS,{className:"w-[18px] h-[18px]"}),"Filters",e>0&&i.jsx("span",{className:"absolute -top-1.5 -right-1.5 min-w-[18px] h-[18px] px-1.5 rounded-full bg-brand text-white text-[11px] font-bold leading-none flex items-center justify-center",children:e})]})}const x6=e=>e.charAt(0).toUpperCase()+e.slice(1),vk=(e,t=n=>n)=>e.map(n=>({id:n,title:t(n)})),gve=e=>({...eC,search:e.search});function xve({filters:e,options:t,onSearchChange:n,onFacetChange:r,onFiltersChange:a,c
491ountFor:s,resultCount:o,totalCount:l}){const u=Ms(),[d,h]=v.useState(!1),p=v.useMemo(()=>pve(t),[t]),g=i.jsxs(i.Fragment,{children:[o," of ",l," document",l===1?"":"s"," match"]});if(!u){const x=e.merchant.length+e.source.length+e.status.length;return i.jsxs("div",{className:"mb-3",children:[i.jsxs("div",{className:"flex items-start gap-2.5",children:[i.jsx(Jy,{value:e.search,onChange:n,placeholder:"Search documentsâ¦"}),i.jsx(EG,{activeCount:x,onClick:()=>h(!0)})]}),i.jsx("p",{className:"text-xs text-slate-500 mt-2",children:g}),i.jsx(CG,{isOpen:d,onClose:()=>h(!1),value:e,sections:p,onApply:a,cleared:gve,countFor:s,noun:"documents"})]})}return i.jsxs("div",{className:ove,children:[i.jsx(Jy,{value:e.search,onChange:n,placeholder:"Search documentsâ¦"}),i.jsx(ko,{label:"Merchant",options:vk(t.merchant),selectedValues:e.merchant,minWidth:180,onChange:x=>r("merchant",x),placeholder:"Select merchants"}),i.jsx(ko,{label:"Source",options:vk(t.source,x6),selectedValues:e.source,minWidth:150,onChange:x=>r("source",x),placeholder:"Select sources"}),i.jsx(ko,{label:"Status",options:vk(t.status,x6),selectedValues:e.status,minWidth:160,onChange:x=>r("status",x),placeholder:"Select statuses"}),i.jsx("p",{className:"text-xs text-slate-500 self-center ml-auto",children:g})]})}const wk="inline-flex items-center gap-2 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-white/20 bg-white/10 text-white hover:bg-white/20 disabled:opacity-50",Gb="inline-flex items-center justify-center gap-1.5 h-[42px] min-w-[42px] px-2 rounded-lg bg-white/10 font-semibold text-xs disabled:opacity-50";function b6({selectedCount:e,totalCount:t,isBusy:n,canReparse:r,onReparse:a,onDriveUpload:s,onDelete:o,onClear:l,variant:u="inline"}){return u==="dock"?i.jsxs("div",{className:"flex items-center gap-1 px-3 py-2 bg-slate-900 text-white rounded-xl shadow-[0_12px_30px_rgba(15,23,42,.35)] text-[12.5px]",children:[i.jsxs("b",{className:"mr-auto",children:[e," selected"]}),i.jsxs("button",{type:"button",onClick:a,disabled:n||!r,className:Gb,children:[i.jsx(dt,{className:"w-[13px] h-[13px]"}),"Re-parse"]}),i.jsxs("button",{type:"button",onClick:s,disabled:n,className:Gb,children:[i.jsx(Yn,{className:"w-[13px] h-[13px]"}),"Drive"]}),i.jsxs("button",{type:"button",onClick:o,disabled:n,className:`${Gb} text-red-300`,children:[i.jsx(Ya,{className:"w-[13px] h-[13px]"}),"Delete"]}),i.jsx("button",{type:"button",onClick:l,"aria-label":"Clear selection",className:Gb,children:i.jsx(Ut,{className:"w-[15px] h-[15px]"})})]}):i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 bg-slate-900 text-white rounded-[10px] mb-3.5 flex-wrap",children:[i.jsxs("span",{className:"text-[13px] font-bold",children:[e," of ",t," selected"]}),i.jsx("button",{type:"button",onClick:l,className:"text-xs text-slate-400 underline",children:"Clear selection"}),i.jsx("span",{className:"text-xs text-slate-400",children:"Shift-click a row to take a range · selection survives a filter change"}),i.jsxs("span",{className:"ml-auto flex items-center gap-2 flex-wrap",children:[i.jsxs("button",{type:"button",onClick:a,disabled:n||!r,className:wk,children:[i.jsx(dt,{className:"w-[13px] h-[13px]"}),"Re-parse"]}),i.jsxs("button",{type:"button",onClick:s,disabled:n,className:wk,children:[i.jsx(Yn,{className:"w-[13px] h-[13px]"}),"Upload to Drive"]}),i.jsxs("button",{type:"button",onClick:o,disabled:n,className:`${wk} text-red-300 hover:text-red-200`,children:[i.jsx(Ya,{className:"w-[13px] h-[13px]"}),"Delete"]})]})]})}const jk="inline-flex items-center justify-center w-[30px] h-[30px] rounded-[7px] border border-transparent bg-transparent text-slate-500 transition-colors hover:bg-slate-100";function bve({document:e,isSelected:t,isActive:n,isReparsing:r,onSelect:a,onOpen:s,onReparse:o,onDelete:l}){const u=Ho(e),d=Tg(e),h=bh(e);return i.jsxs("tr",{className:`cursor-pointer transition-colors ${n?"bg-brand-soft":t?"bg-brand-soft/60":"hover:bg-slate-100"}`,onClick:p=>{p.target.closest('button, input[type="checkbox"]')||s(e.id)},children:[i.jsx("td",{className:"px-4 py-3 w-12",children:i.jsx("input",{type:"checkbox","aria-label":`Select ${u??e.filename}`,checked:t,onChange:p=>a(e.id,p.nativeEvent.shiftKey===!0),className:"w-4 h-4 rounded border-slate-300 text-brand focus:ring-brand"})}),i.jsxs("td",{className:"px-4 py-3 font-mono text-[12px] text-slate-500",children:["#",e.id]}),i.jsx("td",{className:"px-4 py-3",children:Yl(e)?i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-bold rounded-full px-2.5 py-[3px] bg-badge-blue text-badge-blue-text",children:[i.jsx(Fi,{className:"w-3 h-3"}),"Matched"]}):i.jsx("span",{className:"text-slate-500 text-[12.5px]",children:"Not matched"})}),i.jsx("td",{className:"px-4 py-3 font-mono text-[12px] text-slate-500",children:h?Ue(h):"â"}),i.jsx("td",{className:"px-4 py-3",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Es,{name:u,className:"w-[22px] h-[22px] text-[9px]"}),i.jsx("span",{className:u?"text-slate-900":"text-slate-400",children:u??XO}),e.edited_by_user&&i.jsx("span",{title:"A field on this document was corrected by hand",className:"inline-flex rounded-[5px] px-1.5 text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:"Edited"})]})}),i.jsx("td",{className:"px-4 py-3 font-bold tabular-nums text-slate-900",children:d??i.jsx("span",{className:"text-slate-400 font-normal",children:"â"})}),i.jsx("td",{className:nG,children:i.jsx(Pu,{document:e,isProcessing:r})}),i.jsx("td",{className:"px-4 py-3",children:i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:Js(e)})}),i.jsx("td",{className:"px-4 py-3 font-mono text-[12px] text-slate-500",children:e.uploaded_at?qu(e.uploaded_at):"â"}),i.jsxs("td",{className:"px-4 py-3",children:[Rg(e)&&i.jsx(Yn,{className:"w-[15px] h-[15px] text-amount-pos"}),Pg(e)&&i.jsx(t1,{className:"w-[15px] h-[15px] text-amount-neg","aria-label":"Drive backup failed"})]}),i.jsx("td",{className:"px-4 py-3",children:i.jsxs("span",{className:"flex gap-0.5",children:[i.jsx("button",{type:"button","aria-label":"Open document",className:jk,onClick:()=>s(e.id),children:i.jsx(UU,{className:"w-[15px] h-[15px]"})}),i.jsx("button",{type:"button","aria-label":"Re-parse document",className:jk,disabled:r,onClick:()=>o(e.id),children:i.jsx(dt,{className:`w-[15px] h-[15px] ${r?"animate-spin":""}`})}),i.jsx("button",{type:"button","aria-label":"Delete document",className:jk,onClick:()=>l(e.id),children:i.jsx(Ya,{className:"w-[15px] h-[15px]"})})]})})]})}const mC=50,hi="px-4 py-3";function yve({documents:e,selectedIds:t,activeId:n,parsingIds:r,visibleCount:a,onToggleAll:s,onSelect:o,onOpen:l,onReparse:u,onDelete:d,onShowMore:h}){const p=e.slice(0,a),g=p.length>0&&p.every(x=>t.includes(x.id));return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-left text-[13px]",children:[i.jsx("thead",{className:"text-[10.5px] font-bold tracking-[0.1em] text-slate-400 uppercase bg-surface-2 border-b border-border",children:i.jsxs("tr",{children:[i.jsx("th",{className:`${hi} w-12`,children:i.jsx("input",{type:"checkbox","aria-label":"Select every visible document",checked:g,disabled:p.length===0,onChange:s,className:"w-4 h-4 rounded border-slate-300 text-brand focus:ring-brand"})}),i.jsx("th",{className:hi,children:"ID"}),i.jsx("th",{className:hi,children:"Transaction"}),i.jsx("th",{className:hi,children:"Date"}),i.jsx("th",{className:hi,children:"Merchant"}),i.jsx("th",{className:hi,children:"Total"}),i.jsx("th",{className:nG,children:"Status"}),i.jsx("th",{className:hi,children:"Source"}),i.jsx("th",{className:hi,children:"Uploaded on"}),i.jsx("th",{className:hi,children:"Drive"}),i.jsx("th",{className:hi,children:"Actions"})]})}),i.jsx("tbody",{className:"divide-y divide-border",children:p.map(x=>i.jsx(bve,{document:x,isSelected:t.includes(x.id),isActive:n===x.id,isReparsing:r.includes(x.id),onSelect:o,onOpen:l,onReparse:u,onDelete:d},x.id))})]})}),i.jsx(OG,{shown:p.length,total:e.length,onShowMore:h})]})}function OG({shown:e,total:t,onShowMore:n}){return i.jsxs("div",{className:"flex items-center justify-between px-[18px] py-3 bg-surface-2 border-t border-border text-[12.5px] text-slate-500",children:[i.jsxs("span",{children:["Showing ",e," of ",t," document",t===1?"":"s"]}),e<t&&i.jsxs("button",{type:"button",onClick:n,className:"min-h-[42px] lg:min-h-0 text-brand font-semibold hover:underline",children:["Show ",Math.min(mC,t-e)," more"]})]})}function vve({isOpen:e,onClose:t,label:n,items:r}){return i.jsx(Wu,{isOpen:e,onClose:t,label:n,title:n,size:"auto",bodyClassName:"py-2 pb-[max(12px,env(safe-area-inset-bottom))]",children:r.map(({label:a,icon:s,tone:o="default",disabled:l,onSelect:u})=>i.jsxs("button",{type:"button",disabled:l,onClick:()=>
491{t(),u()},className:`w-full flex items-center gap-3 px-[18px] h-[52px] text-[15px] font-semibold text-left hover:bg-surface-2 disabled:opacity-50 ${o==="danger"?"text-amount-neg":"text-slate-900"}`,children:[i.jsx(s,{className:"w-[18px] h-[18px]"}),a]},a))})}function wve({document:e,isSelected:t,isActive:n,isReparsing:r,onSelect:a,onOpen:s,onShowActions:o}){const l=Ho(e),u=Tg(e),d=bh(e);return i.jsxs("li",{className:`flex items-start gap-2.5 px-3.5 py-3 cursor-pointer transition-colors ${n?"bg-brand-soft":t?"bg-brand-soft/60":""}`,onClick:h=>{h.target.closest("button, input, label")||s(e.id)},children:[i.jsx("label",{className:"-m-3 p-3 flex flex-none",children:i.jsx("input",{type:"checkbox","aria-label":`Select ${l??e.filename}`,checked:t,onChange:()=>a(e.id,!1),className:"w-[18px] h-[18px] mt-0.5 rounded-[5px] border-slate-300 text-brand focus:ring-brand"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("p",{className:"flex items-center gap-1.5 text-[13.5px] font-semibold min-w-0",children:[i.jsx(Es,{name:l,className:"w-[22px] h-[22px] rounded-md text-[9px]"}),i.jsx("span",{className:`truncate ${l?"text-slate-900":"text-slate-400"}`,children:l??XO}),e.edited_by_user&&i.jsx("span",{title:"A field on this document was corrected by hand",className:"inline-flex flex-none rounded-[5px] px-1.5 text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:"Edited"})]}),i.jsxs("p",{className:"font-mono text-[11.5px] text-slate-500 mt-[3px]",children:["#",e.id," · ",d?Ue(d):"â"]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-[7px]",children:[i.jsx(Pu,{document:e,isProcessing:r}),Yl(e)?i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-bold rounded-full px-2 py-[3px] bg-badge-blue text-badge-blue-text",children:[i.jsx(Fi,{className:"w-[11px] h-[11px]"}),"Matched"]}):i.jsx("span",{className:"text-slate-500 text-xs",children:"Not matched"}),i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:Js(e)}),Rg(e)&&i.jsx(Yn,{className:"w-[15px] h-[15px] text-amount-pos","aria-label":"Backed up to Drive"}),Pg(e)&&i.jsx(t1,{className:"w-[15px] h-[15px] text-amount-neg","aria-label":"Drive backup failed"})]})]}),i.jsxs("div",{className:"flex flex-none flex-col items-end",children:[i.jsx("span",{className:"text-sm font-bold tabular-nums text-slate-900",children:u??i.jsx("span",{className:"text-slate-400 font-normal",children:"â"})}),i.jsx("button",{type:"button","aria-label":"Document actions",onClick:()=>o(e),className:"-mr-2.5 inline-flex items-center justify-center w-[42px] h-[42px] rounded-lg text-slate-400 hover:bg-slate-100",children:i.jsx(qle,{className:"w-[18px] h-[18px]"})})]})]})}function jve({documents:e,selectedIds:t,activeId:n,parsingIds:r,visibleCount:a,onSelect:s,onOpen:o,onReparse:l,onDelete:u,onShowMore:d}){const[h,p]=v.useState(null),g=e.slice(0,a);return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx("ul",{className:"divide-y divide-border",children:g.map(x=>i.jsx(wve,{document:x,isSelected:t.includes(x.id),isActive:n===x.id,isReparsing:r.includes(x.id),onSelect:s,onOpen:o,onShowActions:p},x.id))}),i.jsx(OG,{shown:g.length,total:e.length,onShowMore:d}),h&&i.jsx(vve,{isOpen:!0,onClose:()=>p(null),label:`${Vn(h)} · #${h.id}`,items:[{label:"Open",icon:UU,onSelect:()=>o(h.id)},{label:"Re-parse",icon:dt,disabled:r.includes(h.id),onSelect:()=>l(h.id)},{label:"Delete",icon:Ya,tone:"danger",onSelect:()=>u(h.id)}]})]})}const y6=e=>(e.filename||"").toLowerCase().endsWith(".pdf")||e.mime_type==="application/pdf";function ev({document:e,fill:t=!1}){const n=e.signedUrl,r=t?{pane:"h-full min-h-0",frame:"flex-1 overflow-auto",pdf:"h-full",img:"h-full"}:{pane:"",frame:"overflow-hidden max-h-[460px]",pdf:"h-[460px]",img:"max-h-[460px]"};return i.jsxs("div",{className:`bg-slate-900 p-4 flex flex-col gap-2.5 overflow-auto ${r.pane}`,children:[i.jsx("div",{className:`rounded-md bg-white flex items-start justify-center min-h-[200px] ${r.frame}`,children:n?y6(e)?i.jsx("object",{data:n,type:"application/pdf",className:`w-full ${r.pdf}`,children:i.jsx("p",{className:"text-[12.5px] text-slate-500 p-6 text-center",children:"This browser will not display the PDF inline."})}):i.jsx("img",{src:n,alt:`Scan of ${e.filename}`,className:`${r.img} max-w-full object-contain object-top`}):i.jsxs("div",{className:"text-center px-6 py-10",children:[i.jsx(ri,{className:"w-7 h-7 text-slate-300 mx-auto"}),i.jsx("p",{className:"text-[12.5px] text-slate-500 mt-2",children:"The file could not be fetched. Its parsed fields are still on the right."})]})}),i.jsxs("div",{className:"flex items-center justify-center gap-2 text-[11px] text-slate-300",children:[i.jsx("span",{className:"border border-white/20 rounded-md px-2 py-1 font-semibold",children:y6(e)?"PDF":"Image"}),n&&i.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 border border-white/20 rounded-md px-2 py-1 font-semibold hover:bg-white/10",children:[i.jsx(n1,{className:"w-3 h-3"}),"Open original"]})]})]})}function Wb({label:e,display:t,initialValue:n,inputType:r="text",isMissing:a=!1,isSaving:s,onSave:o}){const[l,u]=v.useState(!1),[d,h]=v.useState(n),p=v.useRef(null);v.useEffect(()=>{l||h(n)},[n,l]),v.useEffect(()=>{l&&p.current?.focus()},[l]);const g=async()=>
491{if(d.trim()===n.trim()){u(!1);return}await o(d),u(!1)};return l?i.jsxs("div",{className:"col-span-2 lg:col-span-1 min-w-0 border border-brand rounded-[9px] px-2.5 py-2 bg-surface ring-4 ring-brand-soft",children:[i.jsx("label",{className:"text-[10.5px] font-bold uppercase tracking-[0.08em] text-slate-400",children:e}),i.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[i.jsx("input",{ref:p,type:r,step:r==="number"?"0.01":void 0,inputMode:r==="number"?"decimal":void 0,value:d,onChange:x=>h(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),g()),x.key==="Escape"&&u(!1)},"aria-label":e,className:"flex-1 min-w-0 h-[42px] lg:h-8 px-2 rounded-md border border-border text-sm tabular-nums text-slate-900 outline-none focus:border-brand"}),i.jsx("button",{type:"button","aria-label":`Save ${e}`,disabled:s,onClick:()=>void g(),className:"inline-flex flex-none items-center justify-center w-[42px] h-[42px] lg:w-7 lg:h-7 rounded-md bg-brand text-white disabled:opacity-50",children:i.jsx(Zt,{className:"w-3.5 h-3.5"})}),i.jsx("button",{type:"button","aria-label":`Cancel editing ${e}`,onClick:()=>u(!1),className:"inline-flex flex-none items-center justify-center w-[42px] h-[42px] lg:w-7 lg:h-7 rounded-md border border-border text-slate-500",children:i.jsx(Ut,{className:"w-3.5 h-3.5"})})]})]}):i.jsxs("button",{type:"button",onClick:()=>u(!0),className:`relative min-w-0 text-left border rounded-[9px] px-2.5 py-2 w-full ${a?"border-amber-200 bg-amber-50":"border-border bg-surface-2"} hover:border-brand`,children:[i.jsx("span",{className:"text-[10.5px] font-bold uppercase tracking-[0.08em] text-slate-400",children:e}),i.jsx("b",{className:`block text-sm font-bold mt-0.5 tabular-nums break-words ${a?"text-badge-yellow-text":"text-slate-900"}`,children:t}),i.jsx(Si,{className:"absolute right-2.5 top-2.5 w-3 h-3 text-slate-400"})]})}const Nve=e=>{if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toISOString().slice(0,10)};function _ve({document:e,isSaving:t,onSave:n}){const r=Ho(e),a=wa(e),s=Cs(e),o=bh(e),l=e.parsed_data?.VAT,u=l==null||l===""?null:Number(l),d=e.parsed_data?.payment_details?.method;return i.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[i.jsx(Wb,{label:"Vendor",display:r??"not found",initialValue:r??"",isMissing:r===null,isSaving:t,onSave:h=>n({merchant:h})}),i.jsx(Wb,{label:"Document date",display:o??"not found",initialValue:Nve(o),inputType:"date",isMissing:o===null,isSaving:t,onSave:h=>n({date:h})}),i.jsx(Wb,{label:"Total",display:a===null?"not found":Re(a,s),initialValue:a===null?"":String(a),inputType:"number",isMissing:a===null,isSaving:t,onSave:h=>{h.trim()!==""&&n({total:Number(h)})}}),i.jsx(Wb,{label:"Tax / VAT",display:u===null||!Number.isFinite(u)?"not found":Re(u,s),initialValue:u===null||!Number.isFinite(u)?"":String(u),inputType:"number",isMissing:u===null||!Number.isFinite(u),isSaving:t,onSave:h=>{h.trim()!==""&&n({VAT:Number(h)})}}),i.jsxs("div",{className:"border border-border rounded-[9px] px-2.5 py-2 bg-surface-2",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.08em] text-slate-400",children:"Payment method"}),i.jsx("b",{className:"block text-[13px] font-bold mt-0.5 text-slate-900 break-words",children:d||"not stated"})]}),i.jsxs("div",{className:"border border-border rounded-[9px] px-2.5 py-2 bg-surface-2",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.08em] text-slate-400",children:"Source"}),i.jsx("b",{className:"block text-[13px] font-bold mt-0.5 text-slate-900 break-words",children:Js(e)})]})]})}function kve({document:e,limit:t=6}){const n=Array.isArray(e.parsed_data?.items)?e.parsed_data.items:[];if(n.length===0)return null;const r=Cs(e),a=n.slice(0,t),s=n.slice(t),o=s.reduce((l,u)=>{const d=Number(u?.price);return Number.isFinite(d)?l+d:l},0);return i.jsxs("div",{className:"mt-4",children:[i.jsxs("h4",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2",children:["Line items · ",n.length]}),i.jsxs("div",{className:"border border-border rounded-[10px] overflow-hidden",children:[a.map((l,u)=>{const d=Number(l?.price);return i.jsxs("div",{className:"flex justify-between gap-3 px-3 py-2 text-[12.5px] border-b border-border last:border-b-0 odd:bg-surface-2",children:[i.jsx("span",{className:"text-slate-700 truncate min-w-0",children:l?.desc||"Item"}),i.jsx("b",{className:"flex-none tabular-nums font-bold text-slate-900",children:Number.isFinite(d)?Re(d,l?.currency||r):"â"})]},`${l?.desc??"item"}-${u}`)}),s.length>0&&i.jsxs("div",{className:"flex justify-between gap-3 px-3 py-2 text-[12.5px] text-slate-500 odd:bg-surface-2",children:[i.jsxs("span",{children:[s.length," more items"]}),i.jsx("b",{className:"tabular-nums font-bold",children:Re(o,r)})]})]})]})}const tv=async e=>{const{data:t}=await Je.get("/matches/potential/",{params:e});if(!t.success||!t.data)throw new Error("Failed to get potential matches");return{matches:t.data,search:t.search??null,engine:t.engine}},AA=async(e,t,n,r,a,s,o)=>{const{data:l}=await Je.post("/matches",{receipt_id:e,account_id:t,transaction_id:n,transaction_date:r,confidence_score:a,user_notes:s,from_candidate:o});if(!l.success)throw new Error("Failed to create match");return l.data},Sve=async e=>{const{data:t}=await Je.get("/matches/data",{params:{receipt_id:e}});if(!t.success)throw new Error("Failed to get transaction data");return t.data.transaction},Cve=async e=>{const{data:t}=await Je.get(`/matches/receipt/${e}`);if(!t.success)throw new Error("Failed to get the matches for this document");return t.data??[]},AG=async e=>{const{data:t}=await Je.delete(`/matches/${e}`);if(!t.success)throw new Error(t.message||"Failed to unlink the transaction")},Eve=async({transactionId:e,date:t,amount:n,merchantName:r,name:a,authorizedDate:s,paymentChannel:o,accountName:l,pending:u,currency:d,daysRange:h})=>{const{data:p}=await Je.get("/matches/candidates",{params:{transaction_id:e,date:t,amount:n,merchant_name:r,name:a||void 0,authorized_date:s||void 0,payment_channel:o||void 0,account_name:l||void 0,pending:typeof u=="boolean"?String(u):void 0,currency:d||void 0,days_range:h}});if(!p.success||!p.data)throw new Error("Failed to get candidate documents");return p.data},Ove=async e=>{const{data:t}=await Je.get(`/matches/transaction/${e}`);if(!t.success)throw new Error("Failed to get matched receipts for transaction");return t.data},TG="potential-matches",Kd=e=>`${e.transactionId}-${e.accountId}`,Ic=(e,t)=>{console.info(`[DayMatchSearch] ${e}`,t)},PG=(e,t)=>{const n=Nt({queryKey:[TG,e,t],queryFn:async()=>{const M=await tv({receipt_id:e,days_range:t});return{matches:M.matches,search:M.search}},enabled:e!==null}),[r,a]=v.useState([]),[s,o]=v.useState(null),[l,u]=v.useState([]),[d,h]=v.useState(!1),[p,g]=v.useState(null),x=v.useRef(0),y=v.useRef(e);y.current!==e&&(y.current=e,x.current+=1,a([]),o(null),u([]),h(!1),g(null)),v.useEffect(()=>{x.current+=1,a([]),o(null),u([]),h(!1),g(null)},[n.dataUpdatedAt]);
491const w=s??n.data?.search??null,j=v.useMemo(()=>{const M=new Set;return[...n.data?.matches??[],...r].filter(D=>{const A=Kd(D);return M.has(A)?!1:(M.add(A),!0)})},[n.data,r]),N=v.useMemo(()=>j.filter(M=>!l.includes(Kd(M))).sort((M,D)=>D.confidence_score-M.confidence_score),[j,l]),k=v.useMemo(()=>l.map(M=>j.find(D=>Kd(D)===M)).filter(M=>M!==void 0),[j,l]),S=w!==null&&!w.exhausted,E=v.useCallback(async()=>{if(e===null||!w||w.exhausted||d)return;const M=++x.current;h(!0),g(null),Ic("resuming",{documentId:e,resumeFrom:w.nextIndex});try{const D=await tv({receipt_id:e,days_range:t,resume_from:w.nextIndex});if(M!==x.current)return;if(!D.search){Ic("resume answered without a day search â treating the window as covered",{documentId:e,returned:D.matches.length,engine:D.engine}),a(A=>[...A,...D.matches]),o({...w,remainingOffsets:[],exhausted:!0,stoppedAtOffset:null});return}a(A=>[...A,...D.matches]),o(D.search),Ic("resumed",{documentId:e,found:D.matches.length,nextIndex:D.search.nextIndex,exhausted:D.search.exhausted})}catch(D){if(M!==x.current)return;Ic("resume failed",{documentId:e,error:D instanceof Error?D.message:String(D)}),g("We could not search further right now. The matches found so far are still listed.")}finally{M===x.current&&h(!1)}},[t,e,d,w]),O=v.useCallback(M=>{const D=Kd(M);u(L=>L.includes(D)?L:[...L,D]);const A=N.filter(L=>Kd(L)!==D).length;if(Ic("rejected a candidate",{documentId:e,key:D,confidence:M.confidence_score,remaining:A}),A>0){Ic("kept the local candidates instead of resuming the day search",{documentId:e,remaining:A});return}E()},[N,e,E]),T=v.useCallback(M=>{const D=Kd(M);u(A=>A.filter(L=>L!==D))},[]),P=v.useCallback(()=>{x.current+=1,h(!1),Ic("stopped searching",{documentId:e})},[e]);return{candidates:N,rejected:k,search:w,isLoading:n.isLoading,isError:n.isError,refetch:n.refetch,isSearchingFurther:d,searchError:p,canSearchFurther:S,keepSearching:E,reject:O,restore:T,stopSearching:P}},H1=()=>{const e=mn();return v.useCallback(async t=>{const n=[[Cm],[ZO],[S1],["user"],[TG]];t!==void 0&&n.push(["transaction",t]),await Promise.allSettled(n.map(r=>e.invalidateQueries({queryKey:r})))},[e])},Ave="This document has no transaction linked to it any more. Refresh to see where it stands.",Tve=()=>{const[e,t]=v.useState(null),n=H1();return{unlink:v.useCallback(async a=>{t(a);try{const s=await Cve(a);if(s.length===0)throw new Error(Ave);for(const o of s)await AG(o.id);return await n(a),{removed:s.length}}finally{t(null)}},[n]),isUnlinking:e}},RG=80,MG=50,Pve=70;function K1(e){return e>=RG?"bg-badge-green text-badge-green-text":e>=MG?"bg-badge-yellow text-badge-yellow-text":"bg-surface-muted text-slate-600"}function TA(e){return`${e}% Match`}const DG=e=>typeof e=="number"&&Number.isFinite(e)&&e>=RG;function Rve({document:e}){const t=Yl(e),{unlink:n,isUnlinking:r}=Tve(),[a,s]=v.useState(null),o=Nt({queryKey:["transaction",e.id],queryFn:()=>Sve(e.id),enabled:t});if(!t)return i.jsxs("div",{className:"flex items-center gap-3 border border-amber-200 bg-amber-50 rounded-[10px] px-3.5 py-3",children:[i.jsx("span",{className:"flex-1 text-[12.5px] text-amber-900",children:"No transaction is linked to this document yet."}),i.jsxs(gt,{to:Tu,className:"inline-flex items-center gap-2 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100",children:[i.jsx(Fi,{className:"w-[13px] h-[13px]"}),"Find a transaction"]})]});const l=o.data,u=_xe(e);return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-3 border border-blue-200 bg-blue-50/60 rounded-[10px] px-3.5 py-3",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:o.isLoading?"Loading the linked transactionâ¦":l?`${l.merchant_name||l.account_name} â ${Ee(-Math.abs(Number(l.amount)),l.iso_currency_code??Cs(e))}`:"Linked to a transaction"}),i.jsxs("span",{className:"flex items-center gap-[7px] flex-wrap text-[11.5px] text-slate-500 mt-0.5",children:[l?.date&&i.jsx("span",{children:Ue(l.date)}),l?.account_name&&i.jsxs("span",{children:[l.account_name,l.mask?` â¢â¢${l.mask}`:""]}),o.isError&&i.jsx("span",{className:"text-amount-neg",children:"the transaction details could not be loaded"})]})]}),u!==null&&i.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold ${K1(u)}`,children:TA(Math.round(u))}),i.jsxs("button",{type:"button",disabled:r===e.id,onClick:async()=>{s(null);try{await n(e.id)}catch(d){s(d instanceof Error?d.message:"The transaction could not be unlinked.")}},className:"inline-flex items-center gap-2 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 disabled:opacity-50",children:[i.jsx(Qce,{className:"w-[13px] h-[13px]"}),r===e.id?"Unlinkingâ¦":"Unlink"]})]}),a&&i.jsx("p",{role:"alert",className:"text-[12.5px] text-amount-neg mt-2",children:a})]})}const $G=()=>{const[e,t]=v.useState(null),n=H1();return{updateFields:v.useCallback(async(a,s)=>{if(Object.keys(s).length===0)return null;t(a);try{const l=await xxe(a,s);return await n(a),l}finally{t(null)}},[n]),isSaving:e}},Nk="inline-flex items-center justify-center w-[30px] h-[30px] rounded-[7px] text-slate-500 hover:bg-slate-100 disabled:opacity-50",_k="inline-flex items-center justify-center w-[42px] h-[42px] flex-none rounded-lg text-slate-600 hover:bg-slate-100 disabled:opacity-50",v6="flex-1 inline-flex items-center justify-center gap-2 h-[42px] rounded-lg border border-border bg-surface text-[13.5px] font-semibold disabled:opacity-50";function w6({document:e,isLoading:t,isReparsing:n,onClose:r,onReparse:a,onDelete:s,variant:o="panel"}){const{updateFields:l,isSaving:u}=$G(),[d,h]=v.useState(null),[p,g]=v.useState("details");if(!e)return i.jsxs("section",{className:`${o==="sheet"?"m-4 ":""}rounded-xl border border-border bg-surface shadow-card flex flex-col items-center justify-center text-center px-6 py-12`,children:[i.jsx("span",{className:"w-[52px] h-[52px] rounded-[14px] bg-surface-muted text-slate-400 flex items-center justify-center mb-4",children:i.jsx(Yle,{className:"w-[22px] h-[22px]"})}),i.jsx("h3",{className:"text-[17px] font-extrabold text-slate-900",children:t?"Loading this documentâ¦":"That document is gone"}),i.jsx("p",{className:"text-[13px] text-slate-500 mt-1.5 max-w-[360px] leading-relaxed",children:t?"One moment while the list arrives.":"It was deleted, or the link points at a document that is not yours."}),!t&&i.jsx(gt,{to:rs("all"),className:"inline-flex items-center gap-2 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover mt-4",children:"Back to all documents"})]});const x=async j=>{h(null);try{await l(e.id,j)}catch(N){h(N instanceof Error?N.message:"That change could not be saved.")}},y=i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[i.jsx(Es,{name:Vn(e),className:"w-10 h-10 rounded-[10px] text-[13px]"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"text-[19px] font-extrabold tracking-tight text-slate-900 truncate",children:Vn(e)}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-0.5",children:[e.type?`${e.type} · `:"","from ",Js(e),e.edited_by_user?" · a field was corrected by hand":""]})]})]}),i.jsx(_ve,{document:e,isSaving:u===e.id,onSave:x}),d&&i.jsx("p",{role:"alert",className:"text-[12.5px] text-amount-neg mt-2.5",children:d}),i.jsx(kve,{document:e}),i.jsxs("div",{className:"mt-4",children:[i.jsx("h4",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2",children:"Transaction"}),i.jsx(Rve,{document:e})]}),i.jsxs("div",{className:"mt-4",children:[i.jsx("h4",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2",children:"Storage"}),i.jsx("div",{className:"flex items-center gap-2 text-[12.5px] text-slate-600 border border-border rounded-[9px] bg-surface-2 px-2.5 py-2",children:Rg(e)?i.jsxs(i.Fragment,{children:[i.jsx(Yn,{className:"w-[15px] h-[15px] text-amount-pos"}),"Backed up to Drive"]}):Pg(e)?i.jsxs(i.Fragment,{children:[i.jsx(t1,{className:"w-[15px] h-[15px] text-amount-neg"}),e.drive_backup?.drive_error||"The Drive backup failed"]}):i.jsxs(i.Fragment,{children:[i.jsx(Yn,{className:"w-[15px] h-[15px] text-slate-400"}),"Not backed up to Drive"]})})]})]}),w=i.jsxs(i.Fragment,{children:[e.filename," · ",QO(e.size_bytes),e.uploaded_at?` · uploaded ${qu(e.uploaded_at)}`:""]});return o==="sheet"?i.jsxs("section",{className:"h-full flex flex-col bg-surface",children:[i.jsxs("header",{className:"flex-none bg-surface-2 border-b border-border pt-1.5 pr-2.5 pb-2.5 pl-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{type:"button","aria-label":"Back to all documents",onClick:r,className:_k,children:i.jsx(ky,{className:"w-[18px] h-[18px]"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("h2",{className:"text-sm font-extrabold text-slate-900 truncate",children:[Vn(e)," · #",e.id]}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-px truncate",children:w})]}),i.jsx(Pu,{document:e,isProcessing:n}),i.jsx("button",{type:"button","aria-label":"Re-parse document",disabled:n,onClick:()=>a(e.id),className:_k,children:i.jsx(dt,{className:`w-[15px] h-[15px] ${n?"animate-spin":""}`})}),i.jsx("button",{type:"button","aria-label":"Delete document",onClick:()=>s(e.id),className:_k,children:i.jsx(Ya,{className:"w-[15px] h-[15px]"})})]}),i.jsx("div",{role:"group","aria-label":"Document view",className:"flex gap-0.5 border border-border rounded-lg p-[3px] bg-surface mt-2.5 ml-1.5",children:["preview","details"].map(j=>i.jsx("button",{type:"button","aria-pressed":p===j,onClick:()=>g(j),className:`flex-1 h-[38px] rounded-md text-[12.5px] font-semibold ${p===j?"bg-surface-muted text-slate-900":"text-slate-500"}`,children:j==="preview"?"Preview":"Details"},j))})]}),p==="preview"?i.jsx("div",{className:"flex-1 min-h-0 p-4",children:i.jsx(ev,{document:e,fill:!0})}):i.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:y}),i.jsxs("footer",{className:"flex-none flex gap-2.5 px-4 pt-3 pb-[max(12px,env(safe-area-inset-bottom))] border-t border-border bg-surface",children:[i.jsxs("button",{type:"button",disabled:n,onClick:()=>a(e.id),className:`${v6} text-slate-700`,children:[i.jsx(dt,{className:`w-[15px] h-[15px] ${n?"animate-spin":""}`}),"Re-parse"]}),i.jsxs("button",{type:"button",onClick:()=>s(e.id),className:`${v6} text-amount-neg`,children:[i.jsx(Ya,{className:"w-[15px] h-[15px]"}),"Delete"]})]})]}):i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden flex flex-col",children:[i.jsxs("header",{className:"flex items-center gap-2.5 px-4 py-3 bg-surface-2 border-b border-border",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("h2",{className:"text-[13.5px] font-extrabold text-slate-900 truncate",children:[Vn(e)," · #",e.id]}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-px truncate",children:w})]}),i.jsx(Pu,{document:e,isProcessing:n}),i.jsx("button",{type:"button","aria-label":"Re-parse document",disabled:n,onClick:()=>a(e.id),className:Nk,children:i.jsx(dt,{className:`w-[15px] h-[15px] ${n?"animate-spin":""}`})}),i.jsx("button",{type:"button","aria-label":"Delete document",onClick:()=>s(e.id),className:Nk,children:i.jsx(Ya,{className:"w-[15px] h-[15px]"})}),i.jsx("button",{type:"button","aria-label":"Close inspector",onClick:r,className:Nk,children:i.jsx(Ut,{className:"w-[15px] h-[15px]"})})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[300px_1fr] flex-1 min-h-0",children:[i.jsx(ev,{document:e}),i.jsx("div",{className:"overflow-auto p-5",children:y})]})]})}const Mve=e=>{const t=[];return e.search.trim()!==""&&t.push({type:"search",label:`Search: ${e.search.trim()}`}),e.merchant.forEach(n=>t.push({type:"merchant",value:n,label:`Merchant: ${n}`})),e.source.forEach(n=>t.push({type:"source",value:n,label:`Source: ${n}`}
491)),e.status.forEach(n=>t.push({type:"status",value:n,label:`Status: ${n}`})),t};function Dve({filters:e,totalDocuments:t,selectedCount:n,onRemoveFilter:r,onClearAll:a}){const s=Mve(e);return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-12 flex flex-col items-center text-center",children:[i.jsx("span",{className:"w-[52px] h-[52px] rounded-[14px] bg-surface-muted text-slate-400 flex items-center justify-center mb-4",children:i.jsx(uh,{className:"w-[22px] h-[22px]"})}),i.jsx("h3",{className:"text-[17px] font-extrabold text-slate-900",children:"No documents match these filters"}),i.jsxs("p",{className:"text-[13px] text-slate-500 mt-1.5 max-w-[430px] leading-relaxed",children:["You have ",t," document",t===1?"":"s"," in total. Filters combine, so a vendor plus a status shows only the documents that satisfy both."]}),i.jsx("div",{className:"flex gap-2 mt-4 flex-wrap justify-center",children:s.map(o=>i.jsxs("button",{type:"button",onClick:()=>r(o.type,o.value),className:"inline-flex items-center gap-1.5 max-w-full min-h-[42px] lg:min-h-0 rounded-full px-2.5 py-1 text-xs font-semibold bg-brand-soft text-brand hover:bg-blue-100",children:[i.jsx("span",{className:"min-w-0 break-words",children:o.label}),i.jsx(Ut,{className:"w-3 h-3 flex-none"})]},`${o.type}-${o.value??"search"}`))}),i.jsx("div",{className:"flex gap-2.5 mt-5",children:i.jsx("button",{type:"button",onClick:a,className:"inline-flex items-center gap-2 min-h-[42px] lg:min-h-0 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover",children:"Clear all filters"})}),n>0&&i.jsxs("p",{className:"mt-4 text-xs text-slate-500",children:["Your selection of ",n," document",n===1?"":"s"," is kept â changing a filter does not clear it."]})]})}const $ve="lg:hidden fixed inset-x-0 bottom-0 z-40 px-4 pt-2.5 pb-[max(12px,env(safe-area-inset-bottom))]";function IG({children:e,className:t="",tone:n="plain"}){const r=$n(l=>l.setBottomBarHeight),a=v.useRef(null),[s,o]=v.useState(0);return v.useEffect(()=>{const l=a.current;if(!l)return;const u=()=>{const h=Math.ceil(l.getBoundingClientRect().height);o(h),r(h)};if(u(),typeof ResizeObserver>"u")return()=>r(0);const d=new ResizeObserver(u);return d.observe(l),()=>{d.disconnect(),r(0)}},[r]),i.jsxs(i.Fragment,{children:[i.jsx("div",{"data-testid":"bottom-action-bar-spacer","aria-hidden":"true",className:"lg:hidden mt-4",style:{height:s}}),i.jsx("div",{ref:a,"data-testid":"bottom-action-bar",className:`${$ve} ${n==="dark"?"":"bg-surface border-t border-border"} ${t}`,children:e})]})}const Ive=e=>console.info(`[useReparseReceipt] ${e}`),PA=()=>{const[e,t]=v.useState([]),n=v.useRef(new Set),r=mn(),{addProcessingReceipt:a}=EA(),s=uye(),o=e.length>0?e[e.length-1]:null,l=v.useMemo(()=>[...s,...e.filter(h=>!s.includes(h))],[s,e]),u=v.useCallback(h=>l.includes(h),[l]);return{reparse:async h=>{if(n.current.has(h)||CA($l.getState().receipts,h))return Ive(`document ${h} is still parsing; not sending another re-parse`),"already-parsing";n.current.add(h);try{return t(p=>[...p,h]),r.setQueriesData({queryKey:["receipts"]},p=>p&&{...p,receipts:p.receipts.map(g=>g.id===h?{...g,processing_status:"pending"}:g)}),await gxe(h),a(h),"queued"}catch(p){throw await r.invalidateQueries({queryKey:["receipts"]}),p}finally{n.current.delete(h),t(p=>p.filter(g=>g!==h))}},isReparsing:o,parsingIds:l,isParsing:u}};function j6(){const{documents:e,pendingDeleteIds:t,onDriveUpload:n,onDelete:r,clearSelectionError:a}=jh(),{documentId:s}=Ore(),o=Sa(),l=Ms(),[u,d]=v.useState(eC),[h,p]=v.useState([]),[g,x]=v.useState(null),[y,w]=v.useState(mC),[j,N]=v.useState(!1),[k,S]=v.useState(null),E=v.useRef(new Set),{reparse:O,isReparsing:T,parsingIds:P,isParsing:M}=PA(),D=v.useMemo(()=>Sxe(e),[e]),A=v.useMemo(()=>II(e,u),[e,u]),L=v.useMemo(()=>Mxe(e,s),[e,s]),F=v.useCallback(ae=>II(e,ae).length,[e]),B=v.useCallback((ae,ke)=>{const xe=A.findIndex(ue=>ue.id===ae);if(ke&&g!==null&&xe!==-1){const ue=Math.min(g,xe),we=Math.max(g,xe),Oe=A.slice(ue,we+1).map(_e=>_e.id),ne=Oe.every(_e=>h.includes(_e));p(ne?h.filter(_e=>!Oe.includes(_e)):[...new Set([...h,...Oe])]),x(xe);return}h.includes(ae)?(p(h.filter(ue=>ue!==ae)),x(null)):(p([...h,ae]),x(xe))},[A,g,h]),U=v.useCallback(()=>{const ae=A.slice(0,y).map(xe=>xe.id),ke=ae.every(xe=>h.includes(xe));p(ke?h.filter(xe=>!ae.includes(xe)):[...new Set([...h,...ae])]),x(null)},[A,h,y]),z=v.useCallback(()=>
491o(rs("all")),[o]);v.useEffect(()=>{!s||L||!E.current.has(s)||z()},[L,z,s]),v.useEffect(()=>{s&&L&&E.current.add(s)},[L,s]),v.useEffect(()=>{h.length>0&&a()},[a,h.length]),v.useEffect(()=>{const ae=h.filter(ke=>e.some(xe=>xe.id===ke));ae.length!==h.length&&(p(ae),x(null))},[e,h]);const $=v.useMemo(()=>h.filter(ae=>!M(ae)),[M,h]),K=v.useCallback(async()=>{N(!0),S(null);let ae=$.length,ke=0,xe=0;$.length<h.length&&console.info(`[AllDocumentsTab] bulk re-parse of ${$.length} of ${h.length} selected documents; skipped ${h.length-$.length} still parsing`);try{for(const ue of $)try{await O(ue)==="queued"?ke+=1:ae-=1}catch{xe+=1}}finally{N(!1),S(xe===0?null:`${xe} of ${ae} ${ae===1?"document":"documents"} could not be re-parsed. ${ke===0?"Nothing was changed.":`${ke} went through.`}`)}},[$,O,h.length]),G=v.useCallback((ae,ke)=>{d(xe=>ae==="search"?{...xe,search:""}:{...xe,[ae]:ke===void 0?[]:xe[ae].filter(ue=>ue!==ke)})},[]),W=A.length===0&&jxe(u),I=A.slice(0,y).map(ae=>ae.id),H=I.length>0&&I.every(ae=>h.includes(ae)),V=i.jsx(Dve,{filters:u,totalDocuments:e.length,selectedCount:h.length,onRemoveFilter:G,onClearAll:()=>d(eC)}),X={documents:A,selectedIds:h,activeId:L?.id??null,parsingIds:P,visibleCount:y,onSelect:B,onOpen:ae=>o(Gf(ae)),onReparse:ae=>void O(ae),onDelete:ae=>r([ae]),onShowMore:()=>w(ae=>ae+mC)},te={document:L,isLoading:e.length===0,isReparsing:L?M(L.id):!1,onClose:z,onReparse:ae=>void O(ae),onDelete:ae=>r([ae])},fe={selectedCount:h.length,totalCount:e.length,isBusy:j||T!==null,canReparse:$.length>0,onReparse:()=>void K(),onDriveUpload:()=>n(h),onDelete:()=>r(h),onClear:()=>{p([]),x(null)}};return i.jsxs(i.Fragment,{children:[i.jsx(xve,{filters:u,options:D,onSearchChange:ae=>d(ke=>({...ke,search:ae})),onFacetChange:(ae,ke)=>d(xe=>({...xe,[ae]:ke})),onFiltersChange:d,countFor:F,resultCount:A.length,totalCount:e.length}),h.length>0&&l&&i.jsx(b6,{...fe}),k&&i.jsx("p",{role:"alert",className:"text-[12.5px] text-amount-neg mb-3",children:k}),l?i.jsxs("div",{className:s?"grid grid-cols-1 gap-4 xl:grid-cols-[minmax(360px,1fr)_1.45fr] items-start":"",children:[i.jsx("div",{className:s?"min-w-0":"",children:W?V:i.jsx(yve,{...X,onToggleAll:U})}),s&&i.jsx("div",{className:"min-w-0 xl:sticky xl:top-4",children:i.jsx(w6,{...te})})]}):i.jsxs(i.Fragment,{children:[W?V:i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"flex items-center gap-2 min-h-[42px] -mt-1 mb-1 text-[11.5px] text-slate-500",children:[i.jsx("input",{type:"checkbox",checked:H,disabled:I.length===0,onChange:U,className:"w-[18px] h-[18px] rounded-[5px] border-slate-300 text-brand focus:ring-brand"}),"Select all visible"]}),i.jsx(jve,{...X})]}),s&&i.jsx(Wu,{isOpen:t.length===0,size:"full",label:"Document details",onClose:z,bodyClassName:"",children:i.jsx(w6,{...te,variant:"sheet"},s)}),h.length>0&&i.jsx(IG,{tone:"dark",children:i.jsx(b6,{...fe,variant:"dock"})})]})]})}const Lve="inline-flex items-center justify-center gap-2 flex-1 lg:flex-initial min-h-[42px] lg:min-h-0 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100";function Fve({review:e,inboxCount:t,unmatchedCount:n}){const r=e.total===0;return i.jsxs("div",{className:`flex items-center gap-3.5 border rounded-xl px-[18px] py-3.5 mb-4 flex-wrap ${r?"border-border bg-surface":"border-amber-200 bg-amber-50"}`,children:[i.jsx("span",{className:`w-[34px] h-[34px] rounded-[9px] flex items-center justify-center flex-none ${r?"bg-badge-green text-badge-green-text":"bg-badge-yellow text-badge-yellow-text"}`,children:i.jsx(Jt,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"flex-1 min-w-0 lg:min-w-[260px]",children:[i.jsx("b",{className:"text-sm font-bold text-slate-900",children:r?"Nothing needs fixing right now":`${e.total} document${e.total===1?"":"s"} need you â ${e.failed.length} failed to parse, ${e.missingFields.length} ${e.missingFields.length===1?"is":"are"} missing a field, ${e.driveErrors.length} could not back up to Drive`}),i.jsx("p",{className:`text-[12.5px] mt-0.5 ${r?"text-slate-500":"text-amber-900"}`,children:r?"Every document parsed cleanly and backed up.":"Failures are usually a cropped or folded photo. Re-parsing is free and does not create a duplicate."})]}),i.jsxs("div",{className:"flex items-center gap-2 flex-wrap w-full lg:w-auto",children:[i.jsxs(gt,{to:yA,className:Lve,children:[i.jsx(r1,{className:"w-[13px] h-[13px]"}),"Triage inbox",t>0&&i.jsx("span",{className:"text-[11px] font-bold rounded-full px-[7px] bg-surface-muted text-slate-500",children:t})]}),i.jsxs(gt,{to:Tu,className:"inline-flex items-center justify-center gap-2 flex-1 lg:flex-initial min-h-[42px] lg:min-h-0 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover",children:[i.jsx(Fi,{className:"w-[13px] h-[13px]"}),"Match ",n," document",n===1?"":"s"]})]})]})}const N6={red:"bg-badge-red text-badge-red-text",yellow:"bg-badge-yellow text-badge-yellow-text",blue:"bg-badge-blue text-badge-blue-text"};function kk({title:e,description:t,tone:n,icon:r,documents:a,parsingIds:s,onReparse:o,limit:l=8}){const u=Sa();if(a.length===0)return null;const d=a.slice(0,l);return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden mb-4",children:[i.jsxs("header",{className:"flex items-center gap-3 px-[18px] py-3 bg-surface-2 border-b border-border",children:[i.jsx("span",{className:`w-[30px] h-[30px] rounded-lg flex-none flex items-center justify-center ${N6[n]}`,children:r}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h2",{className:"text-sm font-extrabold text-slate-900",children:e}),i.jsx("p",{className:"text-xs text-slate-500 mt-px",children:t})]}),i.jsxs("div",{className:"text-right",children:[i.jsx("b",{className:"text-[15px] font-extrabold tabular-nums text-slate-900",children:a.length}),i.jsxs("p",{className:"text-[11px] text-slate-500",children:["document",a.length===1?"":"s"]})]})]}),d.map(h=>{const p=N1(h);return i.jsxs("div",{role:"button",tabIndex:0,onClick:()=>u(Gf(h.id)),onKeyDown:g=>{g.key==="Enter"&&u(Gf(h.id))},className:"flex flex-wrap lg:flex-nowrap items-center gap-x-3 gap-y-2 lg:gap-3 px-[18px] py-3 border-b border-border last:border-b-0 cursor-pointer hover:bg-surface-2",children:[i.jsx(q1,{document:h}),i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:Vn(h)}),i.jsxs("span",{className:"flex items-center gap-[7px] flex-wrap text-[11.5px] text-slate-500 mt-0.5",children:[i.jsx("span",{className:"font-mono text-[11px] truncate max-w-[240px]",children:h.filename}),i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:Js(h)}),i.jsx("span",{children:QO(h.size_bytes)}),h.uploaded_at&&i.jsx("span",{children:qu(h.uploaded_at)})]})]}),(p!=="none"||o)&&i.jsxs("span",{className:"flex flex-wrap items-center gap-2 basis-full pl-11 lg:contents",children:[p!=="none"&&i.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold ${N6[n]}`,children:p==="drive-backup-error"&&h.drive_backup?.drive_error||tC[p]}),o&&i.jsxs("button",{type:"button",disabled:s.includes(h.id),onClick:g=>{g.stopPropagation(),o(h.id)},className:"inline-flex items-center gap-2 min-h-[42px] lg:min-h-0 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 disabled:opacity-50",children:[i.jsx(dt,{className:`w-[13px] h-[13px] ${s.includes(h.id)?"animate-spin":""}`}),"Re-parse"]})]})]}
491,h.id)}),a.length>d.length&&i.jsxs("p",{className:"px-[18px] py-3 bg-surface-2 border-t border-border text-[12.5px] text-slate-500",children:["Showing ",d.length," of ",a.length]})]})}function zve(){const{review:e,inbox:t,unmatched:n}=jh(),{reparse:r,parsingIds:a}=PA();return i.jsxs(i.Fragment,{children:[i.jsx(Fve,{review:e,inboxCount:t.length,unmatchedCount:n.length}),i.jsx(kk,{title:"Failed to parse",description:"the parser could not read these â re-parse, or enter the fields by hand",tone:"red",icon:i.jsx(Jt,{className:"w-[15px] h-[15px]"}),documents:e.failed,parsingIds:a,onReparse:s=>void r(s)}),i.jsx(kk,{title:"Parsed, but a field is missing",description:"we read the document but could not find one of the fields we need",tone:"yellow",icon:i.jsx(ri,{className:"w-[15px] h-[15px]"}),documents:e.missingFields,parsingIds:a,onReparse:s=>void r(s)}),i.jsx(kk,{title:"Drive backup failed",description:"the document is safe in Moneylogz â only the copy in Drive is missing",tone:"blue",icon:i.jsx(Yn,{className:"w-[15px] h-[15px]"}),documents:e.driveErrors,parsingIds:a}),e.total===0&&i.jsx("section",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-12 text-center",children:i.jsx("p",{className:"text-[13px] text-slate-500",children:"Every document parsed cleanly and backed up. Anything that still needs a transaction is in the match workbench."})})]})}const Bve=()=>{const[e,t]=v.useState(null),n=H1();return{setReviewed:v.useCallback(async(a,s)=>{t(a);try{const o=await bxe(a,s);return await n(a),o}finally{t(null)}},[n]),isReviewing:e}},LG="subAccountTransactions",Uve=30,qve=500,Hve=6,Kve=({moneylogzAccountId:e,plaidAccountId:t,enabled:n})=>{const r=n&&!!Et()&&e!==null&&!!t;return Nt({queryKey:[LG,e,t],enabled:r,staleTime:5*60*1e3,queryFn:async()=>{const a=await k1({accountIds:[String(e)],startDate:Mi(Uve),endDate:Vr(new Date),limit:qve}),o=(a.transactions??[]).filter(p=>p.plaid_account_id===t),l=Vxe(o).slice(0,Hve),u=OV(a);let d={},h=!1;try{d=await sV(l.map(p=>p.transaction_id)),h=!0}catch{}return{recent:l.map(p=>({...p,match:d[p.transaction_id]})),categories:F1(o),total:o.length,truncated:u,matchesResolved:h}}})},FG="transactionCandidates",RA=(e,t)=>Nt({queryKey:[FG,e?.transaction_id??null],enabled:t&&!!Et()&&!!e&&!e.match,staleTime:6e4,queryFn:async()=>{if(!e)throw new Error("No transaction selected");return await Eve({transactionId:e.transaction_id,date:String(e.date??"").slice(0,10),amount:Math.abs(Number(e.amount)),merchantName:br(e),name:e.name,authorizedDate:String(e.authorized_date??"").slice(0,10)||null,paymentChannel:e.payment_channel,accountName:e.account_name,pending:e.pending,currency:e.iso_currency_code})}}),zG="transaction-matches",Vve=(e,t)=>Nt({queryKey:[zG,e],enabled:!!Et()&&!!e,staleTime:3e4,queryFn:()=>Ove(e)}),Gve=()=>{const[e,t]=v.useState(null),[n,r]=v.useState(null),a=MA();return{unlink:v.useCallback(async o=>{t(o),r(null);try{return await AG(o),await a(),!0}catch(l){const u=l instanceof Error?l.message:"Failed to unlink the document";return r(u),!1}finally{t(null)}},[a]),unlinkingId:e,error:n}},Wve=[S1,"receipts",zG,LG,FG,Ku],MA=()=>{const e=mn();return v.useCallback(async()=>{await Promise.allSettled(Wve.map(t=>e.invalidateQueries({queryKey:[t]})))},[e])},BG=()=>{const[e,t]=v.useState(!1),n=MA(),r=H1(),a=v.useCallback(async(o,l)=>{try{return t(!0),await tv({receipt_id:o,days_range:l||10})}finally{t(!1)}},[]),s=v.useCallback(async(o,l,u,d,h,p,g)=>{try{t(!0),await AA(o,l,u,d,h,p,g),await n(),await r(o)}finally{t(!1)}},[n,r]);return{findPotentialMatches:a,matchTransaction:s,isLoading:e}},Zm=(e,t)=>{const n=new Date(`${e}T00:00:00Z`);return n.setUTCDate(n.getUTCDate()+t),n.toISOString().slice(0,10)},Ha=e=>new Date(`${e}T00:00:00Z`).toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"}),gC=e=>e>0?`+${e}`:String(e),Yve=(e,t)=>{if(!t)return null;const n=Date.parse(`${e}T00:00:00Z`),r=Date.parse(`${t.slice(0,10)}T00:00:00Z`);return Number.isNaN(n)||Number.isNaN(r)?null:Math.round((r-n)/864e5)},_6=(e,t)=>typeof t.dayOffset=="number"&&Number.isFinite(t.dayOffset)?t.dayOffset:Yve(e,t.transaction.date),k6=e=>e.remainingOffsets.length,Xve=e=>{const t=e.remainingOffsets.map(Math.abs);return t.length===0?null:{from:Math.min(...t),to:Math.max(...t)}},Qve=e=>e.remainingOffsets[0]??null,UG=e=>{const t=e.searchedOffsets.length>0?e.searchedOffsets:[0];return{start:Zm(e.documentDate,Math.min(...t)),end:Zm(e.documentDate,Math.max(...t))}},Zve=["INPUT","TEXTAREA","SELECT"],Jve=e=>{const t=e;return!t||!t.tagName?!1:Zve.includes(t.tagName)||t.isContentEditable===!0},e1e=(e,t)=>{const n=v.useRef(e);n.current=e,v.useEffect(()=>{if(!t)return;const r=a=>{if(!(Jve(a.target)||a.metaKey||a.ctrlKey||a.altKey))switch(a.key){case"Enter":a.preventDefault(),n.current.onApprove();break;case"s":case"S":a.preventDefault(),n.current.onSkip();break;case"r":case"R":a.preventDefault(),n.current.onReparse();break;case"n":case"N":a.preventDefault(),n.current.onReject();break;case"Backspace":a.preventDefault(),n.current.onDelete();break;case"ArrowUp":a.preventDefault(),n.current.onPrevious();break;case"ArrowDown":a.preventDefault(),n.current.onNext();break}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t])};function t1e({position:e,remaining:t,approved:n,deleted:r,skipped:a}){const o=n+r+t;return i.jsxs("section",{className:"flex items-center gap-2.5 lg:gap-3.5 rounded-xl border border-border bg-surface shadow-card px-3.5 py-2.5 lg:px-[18px] lg:py-3.5 mb-3 lg:mb-4 lg:flex-wrap",children:[i.jsx("b",{className:"text-[13px] lg:text-sm font-extrabold whitespace-nowrap text-slate-900",children:t===0?"Inbox cleared":i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"lg:hidden",children:`${e} / ${o}`}),i.jsx("span",{className:"hidden lg:inline",children:`Reviewing ${e} of ${o}`})]})}),i.jsxs("span",{className:"flex-1 min-w-[48px] lg:min-w-[160px] h-2 rounded-full bg-surface-muted overflow-hidden flex",children:[i.jsx("span",{className:"block h-full bg-amount-pos",style:{width:`${mr(n,o)}%`}}),i.jsx("span",{className:"block h-full bg-amount-neg",style:{width:`${mr(r,o)}%`}})]}),i.jsxs("span",{className:"text-[11.5px] lg:text-xs text-slate-500
491whitespace-nowrap lg:whitespace-normal",children:[n," approved · ",r," deleted · ",a," skipped",i.jsxs("span",{className:"hidden lg:inline",children:[" · ",t," left"]})]}),i.jsx(gt,{to:rs("all"),className:"hidden lg:inline-flex items-center gap-2 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100",children:"Pause & see the list"})]})}function Yb({label:e,display:t,hint:n,initialValue:r,inputType:a="text",isMissing:s=!1,isSaving:o,onSave:l}){const[u,d]=v.useState(!1),[h,p]=v.useState(r),g=async()=>{h.trim()!==r.trim()&&await l(h),d(!1)};return i.jsxs("div",{className:`flex items-center gap-2.5 lg:gap-3 px-3 py-2.5 lg:px-3.5 lg:py-3 border-b border-border last:border-b-0 ${s?"bg-amber-50":""}`,children:[i.jsx("span",{className:"w-[96px] lg:w-[120px] flex-none text-[11px] font-bold uppercase tracking-[0.08em] text-slate-400",children:e}),u?i.jsxs("span",{className:"flex-1 flex items-center gap-2",children:[i.jsx("input",{autoFocus:!0,type:a,step:a==="number"?"0.01":void 0,value:h,"aria-label":e,onChange:x=>p(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),g()),x.key==="Escape"&&d(!1)},className:"flex-1 min-w-0 h-9 px-2.5 rounded-md border border-brand text-sm tabular-nums text-slate-900 outline-none"}),i.jsx("button",{type:"button",disabled:o,onClick:()=>void g(),className:"font-semibold text-xs px-2.5 py-1.5 min-h-[42px] lg:min-h-0 rounded-lg border border-brand bg-brand text-white disabled:opacity-50",children:"Save"}),i.jsx("button",{type:"button",onClick:()=>d(!1),className:"font-semibold text-xs px-2.5 py-1.5 min-h-[42px] lg:min-h-0 rounded-lg border border-border bg-surface text-slate-600",children:"Cancel"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("b",{className:`block text-[14px] lg:text-[15px] font-bold tabular-nums ${s?"text-badge-yellow-text":"text-slate-900"}`,children:t}),n&&i.jsx("small",{className:"block text-[11.5px] text-slate-500 mt-0.5",children:n})]}),i.jsx("button",{type:"button",onClick:()=>{p(r),d(!0)},className:"flex-none min-h-[42px] min-w-[42px] -my-2.5 lg:min-h-0 lg:min-w-0 lg:my-0 text-xs font-semibold text-brand hover:underline",children:"Fix"})]})]})}function n1e({queue:e,currentId:t,approvedIds:n,onSelect:r,window:a=5}){if(e.length===0)return null;const s=Math.max(0,e.findIndex(d=>d.id===t)),o=Math.max(0,s-1),l=e.slice(o,o+a),u=e.length-(o+l.length);return i.jsxs("section",{className:"flex items-center gap-2 lg:gap-2.5 rounded-xl border border-border bg-surface shadow-card px-3 py-2.5 lg:px-4 lg:py-3 mt-3 lg:mt-4 overflow-x-auto overscroll-x-contain snap-x lg:snap-none",children:[i.jsx("span",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 flex-none mr-1 hidden lg:inline",children:"Next up"}),l.map(d=>{const h=d.id===t,p=n.includes(d.id),g=N1(d),x=Tg(d);return i.jsxs("button",{type:"button",onClick:()=>r(d.id),className:`flex items-center gap-2.5 px-2.5 py-1.5 border rounded-[9px] flex-none min-w-[150px] max-w-[180px] min-h-[46px] lg:min-h-0 lg:min-w-[200px] lg:max-w-none text-left snap-start ${h?"border-brand bg-brand-soft":`border-border bg-surface-2 ${p?"opacity-60":""}`}`,children:[i.jsx(q1,{document:d,className:"w-[26px] h-[32px]"}),i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:"block text-xs font-semibold truncate text-slate-900",children:Vn(d)}),i.jsx("span",{className:`block text-[10.5px] truncate ${g==="failed"?"text-badge-red-text":"text-slate-500"}`,children:h?"reviewing now":g!=="none"?tC[g]:`${x??"â"} · ${Js(d)}`})]}),p&&i.jsx(Zt,{className:"w-3 h-3 text-amount-pos ml-auto flex-none"})]},d.id)}),u>0&&i.jsxs("span",{className:"text-xs text-slate-500 flex-none ml-auto",children:["+ ",u," more"]})]})}const Vd="inline-flex items-center gap-2 font-semibold text-sm px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 disabled:opacity-50",r1e="inline-flex items-center gap-2 font-semibold text-sm px-3.5 py-2.5 rounded-lg border border-amount-pos bg-amount-pos text-white hover:bg-green-700 disabled:opacity-50",Xb="inline-flex items-center justify-center gap-1.5 font-semibold text-[13.5px] h-[42px] px-2.5 rounded-lg border whitespace-nowrap disabled:opacity-50",S6="inline-flex items-center justify-center min-w-[18px] h-[18px] px-[5px] rounded border border-slate-300 border-b-2 bg-surface text-[10px] font-bold text-slate-600 font-mono",a1e=e=>{if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toISOString().slice(0,10)};function s1e(){const{documents:e,onDelete:t,pendingDeleteIds:n}=jh(),{setReviewed:r}=Bve(),{updateFields:a,isSaving:s}=$G(),{reparse:o,isReparsing:l,isParsing:u}=PA(),{matchTransaction:d}=BG(),h=Ms(),[p,g]=v.useState(0),[x,y]=v.useState([]),[w,j]=v.useState([]),[N,k]=v.useState([]),[S,E]=v.useState([]),[O,T]=v.useState(null),[P,M]=v.useState(null),[D,A]=v.useState(null),[L,F]=v.useState(!1),B=v.useMemo(()=>fV(e,S).filter(ze=>!x.includes(ze.id)&&!w.includes(ze.id)),[w,e,S,x]),U=v.useMemo(()=>N.filter(ze=>!e.some(et=>et.id===ze)).length,[N,e]);v.useEffect(()=>{p>0&&p>=B.length&&g(Math.max(0,B.length-1))},[p,B.length]);const z=B[p]??null,$=z!==null&&O===z.id,K=z!==null&&l===z.id,G=z!==null&&u(z.id),W=$||K,I=n.length>0,H=PG(z?.id??null,10),V=H.isSearchingFurther?null:H.candidates[0]??null,X=H.rejected[H.rejected.length-1]??null,te=v.useMemo(()=>H.search?UG(H.search):null,[H.search]),fe=V!==null&&H.search!==null,ae=W||!H.canSearchFurther&&H.candidates.length<=1,ke=v.useCallback(()=>{!V||!H.search||ae||H.reject(V)},[H,ae,V]),xe=v.useCallback(()=>{g(ze=>ze+1>=B.length?Math.max(0,B.length-1):ze+1)},[B.length]),ue=v.useCallback(async()=>
491{if(!z||O!==null||H.isSearchingFurther)return;A(null);const ze=z.id;let et=!1;T(ze);try{V&&(await d(ze,V.accountId,V.transactionId,V.transaction.date,V.confidence_score,void 0,!0),et=!0),await r(ze,!0),j(jn=>[...jn,ze]),M(et?`Approved and matched ${Vn(z)}.`:`Approved ${Vn(z)} â no candidate transaction, so it still needs a match.`)}catch{A(et?"The transaction was linked, but the document could not be cleared from the inbox.":"This document could not be approved. Nothing was changed.")}finally{T(null)}},[O,H.isSearchingFurther,z,d,r,V]),we=v.useCallback(()=>{z&&(y(ze=>[...ze,z.id]),M(`Skipped ${Vn(z)} â it stays in the inbox.`))},[z]),Oe=v.useCallback(()=>{z&&(k(ze=>[...ze,z.id]),t([z.id]))},[z,t]),ne=v.useCallback(()=>{if(!z||u(z.id))return;const ze=z.id;E(et=>et.includes(ze)?et:[...et,ze]),o(ze),M(`Re-parsing ${Vn(z)} â it stays here while the parser reads it again.`)},[z,u,o]);e1e({onApprove:()=>void ue(),onSkip:we,onPrevious:()=>g(ze=>Math.max(0,ze-1)),onNext:xe,onReparse:ne,onDelete:Oe,onReject:ke},!!z&&!W&&!H.isSearchingFurther&&!I);const _e=v.useCallback(()=>F(!1),[]),ye=z?.id??null;v.useEffect(()=>{F(!1)},[ye,h]);const Me=i.jsxs(i.Fragment,{children:[P&&i.jsx("p",{role:"status",className:"text-[12.5px] text-slate-600 mb-3",children:P}),D&&i.jsx("p",{role:"alert",className:"text-[12.5px] text-amount-neg mb-3",children:D})]});if(!z){const ze=w.length>0?"Inbox cleared":x.length>0?"Nothing left in this pass":"Nothing to review",et=w.length>0?`You approved ${w.length} document${w.length===1?"":"s"}${x.length>0?` and skipped ${x.length}, which stay in the inbox`:""}.`:x.length>0?`You skipped ${x.length} document${x.length===1?"":"s"} â they stay in the inbox until you come back to them.`:"Every parsed document has already been reviewed. New arrivals land here.";return i.jsxs(i.Fragment,{children:[Me,i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-14 flex flex-col items-center text-center",children:[i.jsx("span",{className:"w-16 h-16 rounded-full border-4 border-amount-pos text-amount-pos flex items-center justify-center mb-5",children:i.jsx(r1,{className:"w-6 h-6"})}),i.jsx("h3",{className:"text-[19px] font-extrabold tracking-tight text-slate-900",children:ze}),i.jsx("p",{className:"text-[13.5px] text-slate-500 mt-2 max-w-[420px] leading-relaxed",children:et}),i.jsxs("div",{className:"flex gap-2.5 mt-5 flex-wrap justify-center",children:[x.length>0&&i.jsx("button",{type:"button",onClick:()=>y([]),className:Vd,children:"Bring the skipped ones back"}),i.jsx(gt,{to:rs("all"),className:Vd,children:"See all documents"}),i.jsx(gt,{to:Tu,className:"inline-flex items-center gap-2 font-semibold text-sm px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover",children:"Open the match workbench"})]})]})]})}const qe=Ho(z),be=wa(z),Ce=Cs(z),$t=bh(z),en=z.parsed_data?.VAT,Ot=en==null||en===""?null:Number(en),Le=Array.isArray(z.parsed_data?.items)?z.parsed_data.items:[],gn=async ze=>{A(null);try{await a(z.id,ze)}catch(et){A(et instanceof Error?et.message:"That change could not be saved.")}},Aa=()=>{console.info(`[InboxTriage] opened the full-screen preview for document ${z.id}`),F(!0)},tt=[{id:"approve",onClick:()=>void ue(),disabled:H.isSearchingFurther,content:$?i.jsxs(i.Fragment,{children:[i.jsx(cO,{className:"w-[15px] h-[15px] animate-spin"}),V?"Approving & matchingâ¦":"Approvingâ¦"]}):i.jsxs(i.Fragment,{children:[i.jsx(Zt,{className:"w-[15px] h-[15px]"}),V?"Approve & match":"Approve"]}),kbd:$?null:"âµ",desktopClassName:r1e,mobileClassName:`${Xb} col-span-2 h-[46px] border-amount-pos bg-amount-pos text-white`},{id:"skip",onClick:we,content:i.jsxs(i.Fragment,{children:[i.jsx(Si,{className:"w-[15px] h-[15px]"}),"Skip for now"]}),kbd:"S",desktopClassName:Vd,mobileClassName:`${Xb} border-border bg-surface text-slate-900`},{id:"reparse",onClick:ne,content:i.jsxs(i.Fragment,{children:[i.jsx(dt,{className:`w-[15px] h-[15px] ${G?"animate-spin":""}`}),G?"Re-parsingâ¦":"Re-parse"]}),kbd:G?null:"R",disabled:G,desktopClassName:Vd,mobileClassName:`${Xb} border-border bg-surface text-slate-900`},{id:"delete",onClick:Oe,content:i.jsxs(i.Fragment,{children:[i.jsx(Ya,{className:"w-[15px] h-[15px]"}),"Delete"]}),kbd:"â«",desktopClassName:`${Vd} text-amount-neg`,mobileClassName:`${Xb} col-span-2 border-transparent bg-transparent text-amount-neg`}],Kt=ze=>tt.map(et=>i.jsxs("button",{type:"button",className:ze==="desktop"?et.desktopClassName:et.mobileClassName,disabled:W||et.disabled===!0,onClick:et.onClick,children:[et.content,ze==="desktop"&&et.kbd&&i.jsx("span",{className:S6,children:et.kbd})]},et.id));return i.jsxs(i.Fragment,{children:[i.jsx(t1e,{position:w.length+U+p+1,remaining:B.length,approved:w.length,deleted:U,skipped:x.length}),Me,i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden grid grid-cols-1 lg:grid-cols-[340px_1fr]",children:[i.jsxs("div",{className:"relative max-h-[132px] overflow-hidden border-b border-border lg:contents",children:[i.jsx(ev,{document:z}),i.jsxs("button",{type:"button","aria-label":"Expand preview",onClick:Aa,className:"lg:hidden absolute right-2.5 bottom-2 h-[42px] px-3 rounded-lg border border-border bg-surface inline-flex items-center gap-1.5 text-xs font-semibold text-slate-600 shadow-card",children:[i.jsx(mce,{className:"w-[13px] h-[13px]"}),"Expand"]})]}),i.jsxs("div",{className:"p-4 lg:p-5 flex flex-col",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(Es,{name:Vn(z),className:"w-10 h-10 rounded-[10px] text-[13px] lg:w-11 lg:h-11 lg:rounded-[11px] lg:text-sm"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h2",{className:"text-lg lg:text-[21px] font-extrabold tracking-tight text-slate-900 truncate",children:Vn(z)}),i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-0.5",children:["arr
491ived from ",i.jsx("b",{children:Js(z)}),z.type?` · ${z.type}`:"",z.edited_by_user?" · corrected by hand":""]})]}),i.jsx(Pu,{document:z,isProcessing:G})]}),i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mt-4",children:"Check what we read"}),i.jsxs("div",{className:"mt-2 border border-border rounded-[11px] overflow-hidden",children:[i.jsx(Yb,{label:"Vendor",display:qe??"not found",initialValue:qe??"",isMissing:qe===null,isSaving:s===z.id,onSave:ze=>gn({merchant:ze})}),i.jsx(Yb,{label:"Document date",display:$t??"not found",hint:"not the date it was uploaded",initialValue:a1e($t),inputType:"date",isMissing:$t===null,isSaving:s===z.id,onSave:ze=>gn({date:ze})}),i.jsx(Yb,{label:"Total",display:be===null?"not found":Re(be,Ce),initialValue:be===null?"":String(be),inputType:"number",isMissing:be===null,isSaving:s===z.id,onSave:ze=>{ze.trim()!==""&&gn({total:Number(ze)})}}),i.jsx(Yb,{label:"Tax / VAT",display:Ot===null||!Number.isFinite(Ot)?"not found":Re(Ot,Ce),initialValue:Ot===null||!Number.isFinite(Ot)?"":String(Ot),inputType:"number",isMissing:Ot===null||!Number.isFinite(Ot),isSaving:s===z.id,onSave:ze=>{ze.trim()!==""&&gn({VAT:Number(ze)})}}),Le.length>0&&i.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3 border-t border-border",children:[i.jsx("span",{className:"w-[96px] lg:w-[120px] flex-none text-[11px] font-bold uppercase tracking-[0.08em] text-slate-400",children:"Line items"}),i.jsxs("span",{className:"flex-1 text-[15px] font-bold text-slate-900",children:[Le.length," item",Le.length===1?"":"s",i.jsx("small",{className:"block text-[11.5px] font-medium text-slate-500 mt-0.5 truncate",children:Le.slice(0,3).map(ze=>ze?.desc).filter(Boolean).join(" · ")})]})]})]}),i.jsxs("div",{className:"mt-4",children:[H.isSearchingFurther?i.jsxs("div",{className:"flex items-center gap-2.5 border border-dashed border-slate-300 rounded-[11px] px-3.5 py-3 text-[12.5px] text-slate-500",children:[i.jsx("span",{className:"w-3.5 h-3.5 rounded-full border-2 border-badge-blue border-t-brand animate-spin"}),i.jsxs("span",{className:"flex-1",children:["Looking beyond"," ",te?`${Ha(te.start)} â ${Ha(te.end)}`:"the days already searched"," ","for another transactionâ¦"]}),X&&i.jsx("button",{type:"button",onClick:()=>{H.stopSearching(),H.restore(X)},className:"font-semibold text-brand hover:underline",children:"Undo"})]}):H.isLoading?i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"Looking for a matching transactionâ¦"}):V?i.jsxs("div",{className:"flex items-center gap-3 border border-blue-200 bg-blue-50/60 rounded-[11px] px-3.5 py-3",children:[i.jsx(Es,{name:V.transaction.name,className:"w-[34px] h-[34px] rounded-[9px]"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:["Suggested â ",V.transaction.name," ·"," ",Ee(-Math.abs(Number(V.transaction.amount)),V.transaction.currency||Ce)]}),i.jsxs("span",{className:"flex items-center gap-[7px] flex-wrap text-[11.5px] text-slate-500 mt-0.5",children:[i.jsx("span",{children:Ue(V.transaction.date)}),i.jsx("span",{children:V.transaction.account_name})]})]}),i.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold ${K1(V.confidence_score)}`,children:TA(Math.round(V.confidence_score))})]}):null,fe&&te&&i.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap mt-2 text-[12.5px] text-slate-500",children:[i.jsxs("span",{children:["Searched ",Ha(te.start)," â ",Ha(te.end),H.rejected.length>0?` · ${H.rejected.length} rejected`:"","."]}),i.jsx("span",{className:"flex-1"}),i.jsxs("button",{type:"button",onClick:ke,disabled:ae,className:`${Vd} disabled:opacity-50`,children:["Not this one â find another",i.jsx("kbd",{className:S6,children:"N"})]})]}),H.isSearchingFurther||H.isLoading||V?null:H.rejected.length>0?i.jsxs("div",{className:"flex items-center gap-3 border border-dashed border-slate-300 rounded-[11px] px-3.5 py-3",children:[i.jsx("span",{role:H.searchError?"alert":void 0,className:"flex-1 text-[12.5px] text-slate-600",children:H.searchError?`${H.searchError} The last suggestion is still set aside â approving files the document without a match.`:te?`No other likely transaction between ${Ha(te.start)} and ${Ha(te.end)}. Approving files the document without a match.`:"No other likely transaction turned up. Approving files the document without a match."}),X&&i.jsx("button",{type:"button",onClick:()=>H.restore(X),className:"font-semibold text-brand text-[12.5px] hover:underline",children:"Restore last suggestion"})]}):i.jsxs("div",{className:"flex items-center gap-3 border border-border bg-surface-2 rounded-[11px] px-3.5 py-3",children:[i.jsx("span",{role:H.searchError?"alert":void 0,className:"flex-1 text-[12.5px] text-slate-600",children:H.searchError??(H.isError?"We could not look for a matching transaction just now. Approving still clears this document from the inbox.":"No candidate transaction â approving clears it from the inbox, and it stays in the match queue.")}),i.jsx(gt,{to:Tu,className:"text-brand font-semibold text-[12.5px] hover:underline",children:"Open the workbench"})]})]}),i.jsx("div",{className:"hidden lg:flex items-center gap-2.5 mt-auto pt-4 border-t border-border flex-wrap",children:Kt("desktop")})]})]}),i.jsx(n1e,{queue:B,currentId:z.id,approvedIds:w,onSelect:ze=>{const et=B.findIndex(jn=>jn.id===ze);et!==-1&&g(et)}}),!h&&i.jsxs(i.Fragment,{children:[i.jsx(IG,{className:"grid grid-cols-2 gap-2",children:Kt("mobile")}),i.jsx(Wu,{isOpen:L,onClose:_e,label:"Document preview",title:"Document preview",size:"full",bodyClassName:"p-0",children:i.jsx(ev,{document:z,fill:!0})})]})]})}function C6({documents:e,selectedId:t,matchedIds:n,onSelect:r}){return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden flex flex-col",children:[i.jsxs("header",{className:"flex items-center gap-2.5 px-4 py-3 bg-surface-2 border-b border-border",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("h2",{className:"text-sm font-extrabold text-slate-900",children:"Unmatched documents"}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-px",children:"Sorted by total · highest first"})]}),i.jsxs("span",{className:"inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-surface-muted text-slate-600",children:[e.length," left"]}),n.length>0&&i.jsxs("span",{className:"inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-badge-green text-badge-green-text",children:[n.length," matched"]})]}),i.jsx("div",{className:"flex-1 lg:overflow-auto lg:max-h-[560px]",children:e.length===0?i.jsx("p",{className:"px-4 py-8 text-center text-[13px] text-slate-500",children:"Every parsed document is linked to a transaction."}):e.map(a=>i.jsxs("button",{type:"button",onClick:()=>r(a.id),className:`flex items-center gap-3 px-4 py-3 border-b border-border last:border-b-0 w-full text-left border-l-[3px] ${t===a.id?"bg-brand-soft border-l-brand":"border-l-transparent hover:bg-surface-2"}`,children:[i.jsx(q1,{document:a}),i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:Vn(a)}),i.jsxs("span",{className:"flex items-center gap-[7px] text-[11.5px] text-slate-500 mt-0.5",children:[i.jsx("span",{className:"font-mono text-[11px] truncate max-w-[180px]",children:a.filename}),i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:Js(a)})]})]}),i.jsx("span",{className:"text-[13.5px] font-bold tabular-nums text-slate-900 w-[82px] text-right flex-none",children:Tg(a)??"â"}),i.jsx(va,{"aria-hidden":"true",className:"w-[15px] h-[15px] flex-none text-slate-400 lg:hidden"})]},a.id))})]})}const xC={date:40,amount:40,merchant:20},DA=.8,qG=.4,HG=1,i1e={date:"dateConsistent",amount:"amountConsistent",merchant:"sameMerchant"},KG=(e,t)=>
491Ee(-Math.abs(Number(e.transaction.amount)),e.transaction.currency||t),V1=(e,t)=>{if(e.engine!=="jev"||!e.jev)return null;const n=Number(e.jev[i1e[t]]);return Number.isFinite(n)?Math.min(Math.max(n,0),1):null},$A=(e,t)=>{const n=Number(e.scores?.[t]);return Number.isFinite(n)?Math.min(Math.max(n/xC[t],0),1):0},o1e=(e,t)=>V1(e,t)??$A(e,t),l1e=(e,t)=>{const n=V1(e,t);return n!==null?n>=DA:$A(e,t)>=HG},c1e=(e,t)=>{const n=V1(e,t);if(n!==null)return n>=DA?"agrees":n>=qG?"unsure":"no match";const r=Number(e.scores?.[t]);return r===xC[t]?"exact":r===0?"no match":`${r}/${xC[t]}`},u1e=(e,t)=>{const n=V1(e,t),r=n!==null?DA:HG,a=n??$A(e,t);return a>=r?"bg-amount-pos":a>=qG?"bg-badge-yellow-text":"bg-slate-300"},d1e=[{key:"amount",label:"amount"},{key:"date",label:"date"},{key:"merchant",label:"vendor"}];function f1e({candidate:e,isBest:t,isMatching:n,isDisabled:r,currency:a,onMatch:s,onReject:o}){const l=Math.round(e.confidence_score);return i.jsxs("div",{className:`grid grid-cols-[30px_minmax(0,1fr)_auto] items-center gap-x-3 gap-y-2.5 lg:flex lg:gap-3 px-[18px] py-3.5 border-b border-border last:border-b-0 ${t?"bg-blue-50/40 shadow-[inset_3px_0_0_theme(colors.brand.DEFAULT)]":""}`,children:[i.jsx(Es,{name:e.transaction.name,className:"w-[30px] h-[30px] rounded-lg"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:e.transaction.name}),i.jsxs("span",{className:"flex items-center gap-[7px] flex-wrap text-[11.5px] text-slate-500 mt-0.5",children:[i.jsx("span",{children:Ue(e.transaction.date)}),i.jsx("span",{children:e.transaction.account_name})]})]}),i.jsxs("div",{className:"col-span-2 order-1 min-w-0 lg:order-none lg:w-[172px] lg:flex-none",children:[i.jsx("div",{className:"text-[11px] font-bold",children:TA(l)}),i.jsx("div",{className:"h-1.5 rounded-full bg-surface-muted overflow-hidden mt-1.5",children:i.jsx("span",{className:`block h-full ${DG(l)?"bg-amount-pos":l>=MG?"bg-badge-yellow-text":"bg-slate-400"}`,style:{width:`${Math.min(100,Math.max(2,l))}%`}})}),i.jsx("div",{className:"flex flex-nowrap gap-1.5 mt-1.5","data-testid":"match-signals",children:d1e.map(({key:u,label:d})=>{const h=l1e(e,u);return i.jsx("span",{className:`whitespace-nowrap text-[10px] font-bold rounded px-1.5 ${h?"bg-badge-green text-badge-green-text":"bg-surface-muted text-slate-400 line-through"}`,children:d},u)})})]}),i.jsx("span",{className:"lg:w-[96px] flex-none text-right text-[13.5px] font-bold tabular-nums text-slate-900",children:KG(e,a)}),i.jsxs("button",{type:"button",disabled:n||r,onClick:()=>s(e),className:`order-2 justify-self-end lg:order-none min-h-[42px] lg:min-h-0 inline-flex items-center gap-2 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border disabled:opacity-50 ${t?"border-brand bg-brand text-white hover:bg-brand-hover":"border-border bg-surface text-slate-900 hover:bg-slate-100"}`,children:[i.jsx(Fi,{className:"w-[13px] h-[13px]"}),n?"Matchingâ¦":"Match"]}),o&&i.jsx("button",{type:"button",disabled:n||r,onClick:()=>o(e),title:"Reject and keep searching",className:"order-3 justify-self-end lg:order-none min-h-[42px] lg:min-h-0 inline-flex items-center font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-transparent text-slate-500 hover:bg-slate-100 disabled:opacity-50",children:"Not this one"})]})}const h1e={unsearched:"bg-surface-muted text-slate-400",searched:"bg-badge-blue text-badge-blue-text",hit:"bg-badge-green text-badge-green-text ring-2 ring-amount-pos",searching:"bg-surface text-brand ring-2 ring-brand animate-pulse",rejected:"bg-badge-red text-badge-red-text"};function p1e({search:e,searchingOffset:t,rejectedOffsets:n}){const r=Array.from({length:e.maxDays*2+1},(s,o)=>o-e.maxDays),a=s=>s===t?"searching":n.includes(s)?"rejected":s===e.stoppedAtOffset?"hit":e.searchedOffsets.includes(s)?"searched":"unsearched";return i.jsx("div",{className:"flex gap-[3px] flex-wrap",role:"list","aria-label":"Days searched",children:r.map(s=>{const o=a(s),l=Zm(e.documentDate,s);return i.jsx("span",{role:"listitem","data-offset":s,"data-state":o,title:`${Ha(l)} (${s===0?"document date":gC(s)}) · ${o}`,className:`h-[22px] rounded-[5px] text-[9.5px] font-bold flex items-center justify-center ${s===0?"px-1.5":"w-[22px]"} ${h1e[o]}`,children:s===0?Ha(l):gC(s)},s)})})}const Sk="inline-flex items-center gap-2 font-semibold text-[12.5px] px-2.5 py-1.5 min-h-[42px] lg:min-h-0 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100";function m1e({document:e,candidates:t,isLoading:n,isError:r,matchingTransactionId:a,onMatch:s,onRetry:o,onSkip:l,daySearch:u}){const d=Cs(e),h=ve.useMemo(()=>[...t].sort((O,T)=>T.confidence_score-O.confidence_score),[t]),p=u?.search??null,g=u?.rejected??[],x=p&&u?.isSearchingFurther?Qve(p):null,y=p?g.map(O=>_6(p.documentDate,O)).filter(O=>O!==null):[],w=h.filter(O=>O.confidence_score>Pve),j=p&&p.stoppedAtOffset!==null?w.find(O=>_6(p.documentDate,O)===p.stoppedAtOffset)??w[0]??null:null,N=p?Xve(p):null,k=p?UG(p):null,S=p!==null&&p.exh
491austed&&p.stoppedAtOffset===null&&(h.length>0||g.length>0);let E=null;if(p&&x!==null)E=`Searching ${Ha(Zm(p.documentDate,x))} (${gC(x)})â¦`;else if(p&&p.stoppedAtOffset!==null){const O=k6(p);E=`Stopped on ${Ha(Zm(p.documentDate,p.stoppedAtOffset))}${j?` â a ${Math.round(j.confidence_score)}% match was found`:""}. ${O} day${O===1?"":"s"} not searched yet.`}else p&&k&&(E=`All ${p.searchedOffsets.length} days searched (${Ha(k.start)} â ${Ha(k.end)})`);return i.jsxs("div",{className:"border-t border-border",children:[i.jsxs("div",{className:"flex items-center flex-wrap gap-x-2.5 gap-y-0.5 lg:flex-nowrap px-[18px] py-3 bg-surface-2 border-b border-border",children:[i.jsx("b",{className:"text-[12.5px] font-extrabold text-slate-900",children:"Candidate transactions"}),i.jsx("span",{className:"text-[11.5px] text-slate-500",children:p?"judged day by day from the document date":"ranked by amount, date and merchant"})]}),p&&!n&&!r&&i.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-[18px] py-3 border-b border-border",children:[i.jsx("span",{className:"text-[10.5px] font-bold uppercase tracking-[0.08em] text-slate-400",children:"Days searched"}),i.jsx(p1e,{search:p,searchingOffset:x,rejectedOffsets:y}),E&&i.jsx("span",{className:"text-[11.5px] text-slate-500",role:"status",children:E})]}),n&&i.jsx("p",{className:"px-[18px] py-6 text-[13px] text-slate-500",children:"Looking for candidatesâ¦"}),!n&&r&&i.jsxs("div",{className:"px-[18px] py-6 text-center",children:[i.jsx("p",{className:"text-[13px] text-amount-neg",children:"We could not fetch candidate transactions for this document."}),i.jsx("button",{type:"button",onClick:o,className:`${Sk} mt-2.5`,children:"Try again"})]}),!n&&!r&&g.map(O=>i.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap px-[18px] py-2.5 border-b border-border bg-surface-2 text-[12.5px] text-slate-500",children:[i.jsxs("s",{className:"text-slate-400",children:[O.transaction.name," · ",KG(O,d)," ·"," ",Ue(O.transaction.date)," · ",Math.round(O.confidence_score),"%"]}),i.jsx("span",{children:p?.exhausted?"not this one":'marked "not this one"'}),i.jsx("span",{className:"flex-1"}),i.jsx("button",{type:"button",onClick:()=>u?.onRestore(O),className:"font-semibold text-brand hover:underline",children:p?.exhausted?"Restore":"Undo"})]},`rejected-${O.transactionId}-${O.accountId}`)),u?.isSearchingFurther&&i.jsxs("div",{className:"border-b border-border",children:[i.jsxs("p",{className:"flex items-center gap-2.5 px-[18px] py-3.5 text-[13px] text-slate-500",children:[i.jsx("span",{className:"w-3.5 h-3.5 rounded-full border-2 border-badge-blue border-t-brand animate-spin"}),"Searching further days. You can still match anything already listed."]}),i.jsx("div",{className:"flex justify-end px-[18px] pb-2.5",children:i.jsx("button",{type:"button",onClick:u.onStopSearching,className:"font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg text-slate-500 hover:bg-slate-100",children:"Stop searching"})})]}),!n&&!r&&h.length===0&&g.length===0&&!u?.isSearchingFurther&&i.jsx("p",{className:"px-[18px] py-6 text-[13px] text-slate-500 text-center",children:"No candidate transaction inside the search window. The bank may not have posted the charge yet."}),!n&&!r&&h.map((O,T)=>i.jsx(f1e,{candidate:O,isBest:T===0,isMatching:a===O.transactionId,isDisabled:a!==null,currency:d,onMatch:s,onReject:p?u?.onReject:void 0},`${O.transactionId}-${O.accountId}`)),u?.searchError&&i.jsx("p",{role:"alert",className:"px-[18px] py-3 text-[12.5px] text-amount-neg border-b border-border",children:u.searchError}),!n&&!r&&u?.canSearchFurther&&!u.isSearchingFurther&&N&&i.jsxs("div",{className:"mx-[18px] my-3.5 flex items-center gap-3.5 flex-wrap border border-dashed border-slate-300 rounded-[10px] px-3.5 py-3 bg-surface-2",children:[i.jsxs("p",{className:"flex-1 text-[13px] text-slate-900",children:[g.length>0?"Still not right?":"Not the right transaction?",i.jsx("small",{className:"block text-[11.5px] text-slate-500 mt-0.5",children:g.length>0?`${k6(p)} more days to search (±${N.from} to ±${N.to}).`:`Search the remaining days (±${N.from} to ±${N.to}) for other matches. Matches found so far stay in the list.`})]}),i.jsx("button",{type:"button",onClick:u.onKeepSearching,className:Sk,children:"Keep searching"})]}),S&&p&&i.jsxs("p",{className:"mx-[18px] my-3.5 rounded-[10px] px-3.5 py-3 bg-badge-yellow text-badge-yellow-text text-[13px]",children:[i.jsxs("b",{className:"text-yellow-900",children:["No other likely match within ",p.maxDays," days of ",Ha(p.documentDate),"."]})," ","The bank may not have posted the charge yet, or it was paid from an account that is not connected."]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 px-[18px] py-3 bg-surface-2 border-t border-border text-[12.5px] text-slate-500 flex-wrap",children:[i.jsxs("span",{children:["Nothing here fits?"," ",i.jsx(gt,{to:Gf(e.id),className:"text-brand font-semibold hover:underline",children:"Open the document"})," ","to check what was parsed."]}),i.jsx("button",{type:"button",onClick:l,className:Sk,children:"Skip for now"})]})]})}const VG=25,Ck=Object.freeze({minScore:1.9,minConfidence:.9,minDateConsistent:.8}),g1e=e=>{switch(e?.engine){case"jev":return e.factsVerified===!0&&typeof e.jev?.score=="number"&&e.jev.score>=Ck.minScore&&e.jev.confidence>=Ck.minConfidence&&e.jev.dateConsistent>=Ck.minDateConsistent;case"heuristic":return DG(e.confidence_score);default:return!1}},x1e=e=>{const t=[`Matched ${e.matched} of ${e.examined} examined`];return e.noCandidate>0&&t.push(`${e.noCandidate} had no candidate sure enough to link unread`),e.failed>0&&t.push(`${e.failed} failed`),`${t.join(" â ")}.`};function E6({queueLength:e,isRunning:t,progress:n,result:r,onRun:a}){const s=Math.min(VG,e);return i.jsxs("div",{className:"flex items-center gap-3.5 border border-blue-200 bg-blue-50/60 rounded-xl px-[18px] py-3.5 mb-4 flex-wrap",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-badge-blue text-badge-blue-text flex items-center justify-center flex-none",children:i.jsx(LS,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"flex-1 min-w-0 basis-[calc(100%-48px)] lg:basis-auto lg:min-w-[260px]",children:[i.jsxs("b",{className:"text-sm font-bold text-slate-900",children:[e," document",e===1?"":"s"," have no transaction yet"]}),i.jsx("p",{className:"text-[12.5px] text-blue-900 mt-0.5",children:t&&n?`Checking ${n.done} of ${n.of}â¦`:r?x1e(r):`Candidates are looked up one document at a time, so a run checks the top ${s} and accepts only the ones sure enough to link unread.`})]}),i.jsxs("button",{type:"button",onClick:a,disabled:t||e===0,className:"w-full justify-center min-h-[42px] lg:w-auto lg:justify-start lg:min-h-0 inline-flex items-center gap-2 font-semibold text-sm px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50",children:[i.jsx(LS,{className:"w-[15px] h-[15px]"}),t?"Matchingâ¦":`Auto-match the top ${s}`]})]})}const O6=10,Lc=(e,t)=>{console.info(`[MatchWorkbench] mobile step -> ${e} (${t})`)};function b1e(){const{unmatched:e}=jh(),{matchTransaction:t}=BG(),n=Ms(),[r,a]=v.useState(null),[s,o]=v.useState([]),[l,u]=v.useState([]),[d,h]=v.useState(null),[p,g]=v.useState(null),[x,y]=v.useState(null),[w,j]=v.useState(null),[N,k]=v.useState("queue"),[S,E]=v.useState(null),O=v.useRef(r);O.current=r;const T=v.useMemo(()=>e.filter(I=>!s.includes(I.id)),[e,s]);v.useEffect(()=>{const I=r!==null&&T.some(H=>H.id===r);if(!n){r!==null&&!I&&(a(null),k("queue"),Lc("queue","selected document left the queue"));return}if(T.length===0){r!==null&&a(null);return}I||a(T[0].id)},[T,r,n]);const P=T.find(I=>I.id===r)??null,M=P?T.indexOf(P)+1:0,D=!n&&N==="candidates"&&P!==null,A=v.useCallback(I=>{a(I),E(null),k("candidates"),Lc("candidates",`document ${I} picked`)},[]),L=v.useCallback(()=>{a(null),k("queue"),Lc("queue","back pressed")},[]),F=PG(P?.id??null,O6),B=v.useCallback(async(I,H)=>{await t(I,H.accountId,H.transactionId,H.transaction.date,H.confidence_score,void 0,!0)},[t]),U=v.useCallback(async I=>{if(P){j(null),h(I.transactionId);try{await B(P.id,I),u(H=>[...H,P.id]),!n&&O.current!==P.id?Lc("candidates",`document ${P.id}
491 matched after moving on, staying put`):n||(E(`Matched ${Vn(P)}.`),a(null),k("queue"),Lc("queue",`document ${P.id} matched`))}catch(H){!n&&O.current!==P.id?console.warn(`[MatchWorkbench] match for document ${P.id} failed after moving on`,H):j("That transaction could not be linked. Nothing was changed.")}finally{h(null)}}},[B,P,n]),z=v.useCallback(()=>{if(!P)return;if(o(H=>[...H,P.id]),n){a(null);return}const I=T[M]??null;a(I?.id??null),I?Lc("candidates",`skipped ${P.id}, advanced to ${I.id}`):(k("queue"),Lc("queue",`skipped ${P.id}, queue exhausted`))},[P,n,T,M]),$=v.useCallback(async()=>{const I=T.slice(0,VG);if(I.length===0)return;j(null),y(null),g({done:0,of:I.length});const H={examined:I.length,matched:0,noCandidate:0,failed:0};for(const[V,X]of I.entries()){g({done:V+1,of:I.length});try{const{matches:te}=await tv({receipt_id:X.id,days_range:O6}),fe=[...te].sort((ae,ke)=>ke.confidence_score-ae.confidence_score)[0];if(!fe||!g1e(fe)){H.noCandidate+=1,console.info(`[MatchWorkbench] auto-match left document ${X.id} unmatched`,{candidates:te.length,engine:fe?.engine??null,score:fe?.confidence_score??null,jev:fe?.jev??null,factsVerified:fe?.factsVerified??null});continue}await B(X.id,fe),console.info(`[MatchWorkbench] auto-match linked document ${X.id}`,{transactionId:fe.transactionId,engine:fe.engine??null,score:fe.confidence_score}),H.matched+=1,u(ae=>[...ae,X.id])}catch(te){H.failed+=1,console.warn(`[MatchWorkbench] auto-match failed for document ${X.id}`,te)}}g(null),y(H)},[B,T]),K=P&&i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsxs("header",{className:"flex items-center gap-2.5 px-4 py-3 bg-surface-2 border-b border-border",children:[i.jsx(Es,{name:Vn(P)}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h2",{className:"text-sm font-extrabold text-slate-900 truncate",children:Vn(P)}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-px truncate",children:["Document #",P.id," · from ",Js(P),P.uploaded_at?` · ${qu(P.uploaded_at)}`:""]})]}),i.jsx(Pu,{document:P})]}),i.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2.5 p-[18px]",children:[{label:"Total",value:wa(P)===null?"not found":Re(wa(P),Cs(P))},{label:"Document date",value:bh(P)??"not found"},{label:"Source",value:Js(P)},{label:"Line items",value:String(Array.isArray(P.parsed_data?.items)?P.parsed_data.items.length:0)}].map(I=>i.jsxs("div",{className:"border border-border rounded-[9px] px-2.5 py-2 bg-surface-2",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.08em] text-slate-400",children:I.label}),i.jsx("b",{className:"block text-sm font-bold mt-0.5 tabular-nums text-slate-900",children:I.value})]},I.label))}),i.jsx(m1e,{document:P,candidates:F.candidates,isLoading:F.isLoading,isError:F.isError,matchingTransactionId:d,onMatch:I=>void U(I),onRetry:()=>void F.refetch(),onSkip:z,daySearch:{search:F.search,rejected:F.rejected,isSearchingFurther:F.isSearchingFurther,searchError:F.searchError,canSearchFurther:F.canSearchFurther,onKeepSearching:()=>void F.keepSearching(),onReject:F.reject,onRestore:F.restore,onStopSearching:F.stopSearching}})]}),G=i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-12 text-center",children:[i.jsx("h3",{className:"text-[17px] font-extrabold text-slate-900",children:e.length===0?"Everything is matched":"Nothing selected"}),i.jsx("p",{className:"text-[13px] text-slate-500 mt-1.5",children:e.length===0?"Every parsed document is linked to a transaction.":`You skipped the ${s.length} document${s.length===1?"":"s"} in this queue. They stay unmatched until you come back.`}),s.length>0&&i.jsx("button",{type:"button",onClick:()=>o([]),className:"inline-flex items-center justify-center gap-2 font-semibold text-[12.5px] px-2.5 py-1.5 min-h-[42px] lg:min-h-0 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 mt-4",children:"Bring the skipped ones back"})]}),W=w&&i.jsx("p",{role:"alert",className:"text-[12.5px] text-amount-neg mb-3",children:w});return D&&P?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx("button",{type:"button",onClick:L,disabled:d!==null,"aria-label":"Back to queue",className:"w-[42px] h-[42px] flex-none inline-flex items-center justify-center rounded-lg text-slate-600 hover:bg-slate-100",children:i.jsx(ky,{className:"w-[18px] h-[18px]"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-sm font-extrabold text-slate-900 truncate",children:"Match a transaction"}),i.jsxs("p",{className:"text-[11.5px] text-slate-500",children:["Document ",M," of ",T.length]})]}),i.jsx("button",{type:"button",onClick:z,disabled:d!==null,className:"inline-flex items-center justify-center font-semibold text-[13px] px-3 min-h-[42px] rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 disabled:opacity-50 flex-none",children:"Skip"})]}),W,K]}):n?i.jsxs(i.Fragment,{children:[i.jsx(E6,{queueLength:T.length,isRunning:p!==null,progress:p,result:x,onRun:()=>void $()}),W,i.jsxs("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-[1fr_1.35fr] items-start",children:[i.jsx(C6,{documents:T,selectedId:r,matchedIds:l,onSelect:a}),K||G]})]}):i.jsxs(i.Fragment,{children:[i.jsx(E6,{queueLength:T.length,isRunning:p!==null,progress:p,result:x,onRun:()=>void $()}),S&&i.jsx("p",{role:"status",className:"rounded-lg bg-badge-green text-badge-green-text text-[12.5px] font-semibold px-3 py-2 mb-3",children:S}),W,T.length===0?G:i.jsx(C6,{documents:T,selectedId:r,matchedIds:l,onSelect:A})]})}const y1e={default:"text-slate-900",negative:"text-amount-neg",positive:"text-amount-pos"};
491function GG({title:e,subtitle:t,icon:n,iconClass:r,badge:a,stats:s,actions:o,notice:l,disabled:u=!1,children:d,className:h=""}){return i.jsxs("section",{"aria-disabled":u||void 0,className:`rounded-xl border border-border bg-surface shadow-card px-[18px] py-4 flex flex-col gap-3 ${u?"opacity-70":""} ${h}`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:`w-[38px] h-[38px] rounded-[10px] flex items-center justify-center flex-none ${u?"bg-surface-muted text-slate-400":r}`,children:n}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("b",{className:"text-[14.5px] font-bold block text-slate-900",children:e}),i.jsx("span",{className:"text-xs text-slate-500 truncate block",children:t})]}),a]}),d,l?i.jsx("p",{className:"text-[12.5px] text-slate-500 border-t border-dashed border-border pt-2.5",children:l}):s.length>0&&i.jsx("div",{children:s.map(p=>i.jsxs("div",{className:"flex justify-between text-[12.5px] py-1.5 border-t border-dashed border-border",children:[i.jsx("span",{className:"text-slate-600",children:p.label}),i.jsx("b",{className:`font-bold tabular-nums ${y1e[p.tone??"default"]}`,children:p.value})]},p.label))}),o&&i.jsx("div",{className:"flex gap-2 flex-wrap",children:o})]})}function v1e({sources:e,totalDocuments:t}){return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsxs("header",{className:"flex items-center gap-3 px-[18px] py-3 bg-surface-2 border-b border-border",children:[i.jsx("span",{className:"w-[30px] h-[30px] rounded-lg flex-none flex items-center justify-center bg-brand-soft text-brand",children:i.jsx(xr,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h2",{className:"text-sm font-extrabold text-slate-900",children:"Source activity"}),i.jsx("p",{className:"text-xs text-slate-500 mt-px",children:"what each source has brought in"})]}),i.jsxs("div",{className:"text-right",children:[i.jsx("b",{className:"text-[15px] font-extrabold tabular-nums text-slate-900",children:t}),i.jsx("p",{className:"text-[11px] text-slate-500",children:"in total"})]})]}),e.map(n=>i.jsxs("div",{className:"flex items-center gap-3 px-[18px] py-3 border-b border-border last:border-b-0",children:[i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900",children:n.label}),i.jsx("span",{className:"text-[11.5px] text-slate-500 mt-0.5 block",children:n.documents===0?"nothing from this source yet":`last document ${n.lastAt?qu(n.lastAt):"at an unknown time"}`})]}),i.jsx("span",{className:"w-14 lg:w-[120px] flex-none",children:i.jsx("span",{className:"block h-1.5 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full bg-brand",style:{width:`${n.share}%`}})})}),i.jsxs("span",{className:"w-[76px] lg:w-[104px] flex-none text-right",children:[i.jsx("b",{className:"text-[13.5px] font-bold tabular-nums text-slate-900",children:n.documents}),i.jsxs("span",{className:"text-[11.5px] text-slate-500",children:[" · ",n.share,"%"]})]})]},n.source))]})}function w1e({isOpen:e,address:t,isRotating:n,error:r,onConfirm:a,onCancel:s}){return i.jsxs(qt,{show:e,onClose:s,size:"md",position:"center",dismissible:!n,theme:Gu,children:[i.jsx(qt.Header,{className:"dialog-header",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"dialog-header-icon",children:i.jsx(Jt,{})}),i.jsxs("div",{children:[i.jsx("h3",{className:"dialog-header-title",children:"Rotate your forwarding address?"}),i.jsx("p",{className:"dialog-header-subtitle",children:"Your current address stops working the moment you confirm"})]})]})}),i.jsx(qt.Body,{className:"dialog-body",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-2.5 items-start border border-badge-red bg-red-50 rounded-lg p-4",children:[i.jsx(Jt,{className:"w-[18px] h-[18px] flex-none text-badge-red-text mt-px"}),i.jsxs("p",{className:"text-sm text-red-900 leading-relaxed",children:[i.jsx("b",{children:"There is no grace peri
491od."})," Anything still sent to the old address â including mail from a Gmail forwarding rule you set up â bounces straight away and is not kept for you."]})]}),i.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[i.jsx("p",{className:"text-[12px] text-gray-600 mb-1",children:"This address stops working"}),i.jsx("code",{className:"font-mono text-[12px] text-gray-900 break-all line-through decoration-red-600 decoration-2",children:t})]}),i.jsx("div",{className:"dialog-warning-box",children:i.jsxs("p",{className:"text-sm text-gray-600",children:[i.jsx("b",{className:"text-gray-900",children:"Before you continue, make sure you can update wherever the old address is used."})," ","After rotating you will get a new address to copy; documents you have already received are untouched."]})}),r&&i.jsx("p",{role:"alert",className:"text-[12.5px] text-amount-neg",children:r})]})}),i.jsx(qt.Footer,{className:"dialog-footer",children:i.jsxs("div",{className:lc,children:[i.jsx(mt,{color:"gray",onClick:s,disabled:n,className:"dialog-cancel-button",children:"Keep current address"}),i.jsx(mt,{color:"failure",onClick:a,disabled:n,className:"dialog-confirm-button",children:n?"Rotating...":"Rotate â old address stops working"})]})})]})}const WG="INBOUND_EMAIL_NOT_CONFIGURED",YG="INBOUND_ADDRESS_DISABLED",XG="NoMoneylogzAccount",Qb=e=>{const t=e instanceof ma?e.code:void 0;return t===WG?"not_configured":t===YG?"disabled":t===XG?"no_account":"other"},Zb=e=>{const t=e instanceof ma?e.data:void 0,n=typeof t?.error=="string"?t.error.trim():"",r=e instanceof Error?e.message.trim():"",a=r===""||r==="An error occurred"?n:r;return a===""?"The request failed without a message.":a},QG=(e,t)=>{const n=e?.data,r=typeof n?.address=="string"?n.address.trim():"";if(r==="")throw new ma(`The ${t} answered without a forwarding address.`);return{address:r,domain:typeof n?.domain=="string"?n.domain.trim():"",createdAt:typeof n?.createdAt=="string"&&n.createdAt.trim()!==""?n.createdAt:null,retired:typeof n?.retired=="number"?n.retired:void 0}},j1e=async()=>{const{data:e}=await Je.get("/me/inbound-address");return QG(e,"address read")},N1e=async()=>{const{data:e}=await Je.post("/me/inbound-address/rotate");return QG(e,"rotation")},A6=["inbound-address"],_1e=30*60*1e3,T6=5*60*1e3,k1e={not_configured:"not_configured",disabled:"disabled",no_account:"no_account",other:"error"},Jb=e=>e instanceof ma?e.statusCode:void 0,S1e=()=>{const e=mn(),[t,n]=v.useState(null),r=Nt({queryKey:A6,queryFn:j1e,enabled:!!Et(),staleTime:_1e}),a=Pf({mutationFn:N1e,onSuccess:u=>{const d=u.retired??0;console.info("[inbound-address] rotated the address",{retired:d,domain:u.domain}),ql("inbound_address_rotated",{retired:d}),e.setQueryData(A6,u),n({retired:d})},onError:u=>{console.error("[inbound-address] rotation failed, the old address still works",{statusCode:Jb(u),failure:Qb(u),message:Zb(u)}),ql("inbound_address_rotate_failed",{statusCode:Jb(u),failure:Qb(u)})}});v.useEffect(()=>{if(!t)return;const u=setTimeout(()=>{console.info("[inbound-address] the rotation notice expired",{retired:t.retired,afterMs:T6}),n(null)},T6);return()=>clearTimeout(u)},[t]);const s=r.error;v.useEffect(()=>{s&&console.warn("[inbound-address] could not read the address",{statusCode:Jb(s),failure:Qb(s),message:Zb(s)})},[s]);const o=()=>{r.refetch()},l=r.isError?Qb(r.error):null;return{status:l?k1e[l]:r.data?"ready":"loading",address:l?null:r.data??null,failureMessage:l?Zb(r.error):null,failureStatusCode:l?Jb(r.error)??null:null,refetch:o,isRefetching:r.isFetching,rotate:a.mutate,isRotating:a.isPending,rotateError:a.isError?Zb(a.error):null,dismissRotateError:a.reset,justRotated:t}},C1e=2e3,P6="inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold",Ek="inline-block rounded-[5px] bg-surface-muted px-2 py-0.5 text-[11px] font-mono text-slate-600 mt-1.5",ZG="inline-flex items-center gap-2 min-h-[42px] lg:min-h-0 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border",Ok=`${ZG} border-border bg-surface text-slate-900 hover:bg-slate-100 disabled:opacity-50`,R6=`${ZG} border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50`,E1e={loading:{label:"Loadingâ¦",className:"bg-surface-muted text-slate-600"},ready:{label:"Active",className:"bg-badge-green text-badge-green-text"},not_configured:{label:"Not set up here",className:"bg-badge-yellow text-badge-yellow-text"},disabled:{label:"Turned off",className:"bg-badge-red text-badge-red-text"},no_account:{label:"No address yet",className:"bg-surface-muted text-slate-600"},error:{label:"Could not load",className:"bg-badge-red text-badge-red-text"}},O1e={disabled:"bg-badge-red text-badge-red-text",no_account:"bg-surface-muted text-slate-400"},A1e=e=>e===1?"1 old address retired and it no longer accepts mail.":e>1?`${e} old addresses retired and they no longer accept mail.`:"The address you had before no longer accepts mail.",T1e=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?"at an unknown time":t.toLocaleDateString("en-US",{day:"2-digit",month:"short",year:"numeric"})},P1e=(e,t)=>{const n=t?Date.parse(t):Number.NaN;return Number.isNaN(n)?e.length:e.filter(r=>{const a=r?Date.parse(r):Number.NaN;return!Number.isNaN(a)&&a>=n}).length},e0=({muted:e=!1})=>i.jsx("div",{className:`grid grid-cols-1 lg:grid-cols-3 gap-3 border-t border-dashed border-border pt-3 ${e?"text-slate-400":"text-slate-600"}`,children:[{Icon:LS,title:"Arrives on its own",body:"Each attachment on a message becomes a document and goe
491s through the same parser as an upload."},{Icon:jce,title:fG,body:"Other attachments and the message body are ignored."},{Icon:nue,title:"Forward from any mailbox",body:"Only the address it is sent to matters, so a Gmail rule, a colleague or a vendor can all use it."}].map(({Icon:t,title:n,body:r})=>i.jsxs("div",{className:"flex gap-2 text-[12px] leading-snug",children:[i.jsx(t,{className:`w-[15px] h-[15px] flex-none mt-px ${e?"text-slate-400":"text-brand"}`}),i.jsxs("span",{children:[i.jsx("b",{className:`block text-[12.5px] font-bold ${e?"text-slate-500":"text-slate-900"}`,children:n}),r]})]},n))});function R1e({emailDocumentDates:e}){const{status:t,address:n,failureMessage:r,failureStatusCode:a,refetch:s,isRefetching:o,rotate:l,isRotating:u,rotateError:d,dismissRotateError:h,justRotated:p}=S1e(),[g,x]=v.useState(!1),[y,w]=v.useState("idle"),j=v.useRef(null),{cardTitle:N,cardSubtitle:k,Icon:S,iconClass:E}=pG("email");v.useEffect(()=>{p&&x(!1)},[p]),v.useEffect(()=>{if(y!=="copied")return;const $=setTimeout(()=>w("idle"),C1e);return()=>clearTimeout($)},[y]);const O=()=>{const $=j.current;if(!$||typeof window.getSelection!="function")return;const K=document.createRange();K.selectNodeContents($);const G=window.getSelection();G?.removeAllRanges(),G?.addRange(K)},T=async()=>{const $=n?.address??"";if($!=="")try{if(typeof navigator.clipboard?.writeText!="function")throw new Error("This browser does not offer the clipboard.");await navigator.clipboard.writeText($),w("copied")}catch(K){console.warn("[inbound-address] could not copy the address to the clipboard",{message:K instanceof Error?K.message:String(K)}),O(),w("unavailable")}},P=$=>u?(console.warn("[inbound-address] ignored a rotate dialog action while a rotation was in flight",{action:$}),!0):!1,M=()=>{P("open")||(h(),x(!0))},D=()=>{P("close")||(x(!1),h())},A=d?`Rotation did not go through, so this address still works. ${d}`:null,L=$=>a?`${a} · ${$}`:$,F=y==="copied"?"Copied":y==="unavailable"?"Select and copy":"Copy address",B=()=>i.jsxs("div",{className:`rounded-[10px] border px-3.5 py-3 flex flex-col gap-3 lg:flex-row lg:items-center ${p?"border-badge-green bg-badge-green/40":"border-border bg-surface-2"}`,children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 flex items-center gap-2",children:["Your forwarding address",p&&i.jsx("span",{className:`${P6} bg-badge-green text-badge-green-text`,children:"New"})]}),i.jsx("code",{ref:j,className:"block font-mono text-[14px] font-semibold text-slate-900 break-all mt-1",children:n?.address}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-1",children:[p?"Created just now":`Created ${n?.createdAt?T1e(n.createdAt):"at an unknown time"}`," ","· ",P1e(e,n?.createdAt??null)," documents received"]})]}),i.jsxs("button",{type:"button",onClick:T,"aria-label":"Copy forwarding address",className:R6,children:[y==="copied"?i.jsx(Zt,{className:"w-[13px] h-[13px]"}):i.jsx($le,{className:"w-[13px] h-[13px]"}),F]})]}),U=()=>{switch(t){case"loading":return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rounded-[10px] border border-border bg-surface-2 px-3.5 py-3",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Your forwarding address"}),i.jsx("span",{className:"sr-only",children:"Getting your forwarding addressâ¦"}),i.jsx("span",{className:"block h-[18px] w-3/5 rounded bg-surface-muted animate-pulse mt-2"}),i.jsx("span",{className:"block h-[11px] w-1/3 rounded bg-surface-muted animate-pulse mt-2.5"})]}),i.jsx(e0,{})]});case"ready":return i.jsxs(i.Fragment,{children:[p&&i.jsxs("p",{role:"status",className:"flex gap-2.5 items-start rounded-[10px] border border-badge-green bg-badge-green/40 px-3 py-2.5 text-[12.5px] text-badge-green-text leading-relaxed",children:[i.jsx(Zt,{className:"w-[15px] h-[15px] flex-none mt-px"}),i.jsxs("span",{children:[i.jsx("b",{children:"Address rotated."})," ",A1e(p.retired)," Update your Gmail forwarding rule, or anyone you gave the old address to, with the new one below."]})]}),B(),i.jsx(e0,{}),i.jsxs("div",{className:"flex flex-col gap-2.5 lg:flex-row lg:items-center lg:justify-between border-t border-dashed border-border pt-3",children:[i.jsx("small",{className:"text-[11.5px] text-slate-500",children:"The address is private to you. If it leaks, rotate it â the old one stops working straight away."}),i.jsxs("button",{type:"button",onClick:M,className:Ok,children:[i.jsx(Pce,{className:"w-[13px] h-[13px]"}),"Rotate addressâ¦"]})]})]});case"not_configured":return i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-[12.5px] text-slate-500 border-t border-dashed border-border pt-2.5 leading-relaxed",children:["Forwarding by email is not switched on in this environment, so there is no address to give you yet. Nothing is wrong with your account â once a receiving domain is configured, your address will appear here on its own.",i.jsx("span",{className:`${Ek} block w-fit`,children:L(WG)})]}),i.jsx("div",{children:i.jsxs("button",{type:"button",onClick:s,disabled:o,className:Ok,children:[i.jsx(dt,{className:`w-[13px] h-[13px] ${o?"animate-spin":""}`}),o?"Checkingâ¦":"Check again"]})})]});case"disabled":return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex gap-3 items-start rounded-[10px] border border-badge-red bg-red-50 px-3.5 py-3",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-badge-red text-badge-red-text flex items-center justify-center flex-none",children:i.jsx(jg,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("b",{className:"text-[14px] font-bold text-red-900 block",children:"Email forwarding is turned off for your account"}),i.jsxs("p",{className:"text-[12.5px] text-red-800 mt-1 leading-relaxed",children:["Mail sent to your forwarding address is no longer accepted, and the address is not shown while forwarding is off. The documents you already received by email are still in your library. If you think this is a mistake, contact"," ",i.jsx("a",{href:`mailto:${fC}`,className:"font-semibold underline text-red-900",children:fC}),"."]}
491),i.jsx("span",{className:Ek,children:L(YG)})]})]}),i.jsx(e0,{muted:!0})]});case"no_account":return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex gap-3 items-start rounded-[10px] border border-dashed border-border bg-surface-2 px-3.5 py-3",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-surface-muted text-slate-600 flex items-center justify-center flex-none",children:i.jsx(eue,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("b",{className:"text-[14px] font-bold text-slate-900 block",children:"Your login has no Moneylogz account yet"}),i.jsx("p",{className:"text-[12.5px] text-slate-500 mt-1 leading-relaxed",children:"A forwarding address belongs to an account, and this sign-in is not attached to one. Finish setting up your account and come back â the address is created the first time you open this tab."}),i.jsx("span",{className:Ek,children:L(XG)})]})]}),i.jsx(e0,{}),i.jsx("div",{children:i.jsx(gt,{to:"/connections",className:Ok,children:"Go to Connections"})})]});case"error":return i.jsxs("div",{className:"flex gap-3 items-start rounded-[10px] border border-badge-red bg-red-50 px-3.5 py-3",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-badge-red text-badge-red-text flex items-center justify-center flex-none",children:i.jsx(Jt,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("b",{className:"text-[14px] font-bold text-red-900 block",children:"We could not fetch your forwarding address"}),i.jsx("p",{className:"text-[12.5px] text-red-800 mt-1 leading-relaxed",children:"Your address still exists and mail sent to it is still accepted â only this request failed."}),i.jsx("span",{className:"inline-block max-w-full break-words font-mono text-[11.5px] text-badge-red-text mt-2 bg-surface border border-badge-red rounded-[7px] px-2.5 py-1.5",children:r}),i.jsx("div",{className:"mt-3",children:i.jsxs("button",{type:"button",onClick:s,disabled:o,className:R6,children:[i.jsx(dt,{className:`w-[13px] h-[13px] ${o?"animate-spin":""}`}),o?"Trying againâ¦":"Try again"]})})]})]})}},z=E1e[t];return i.jsxs(i.Fragment,{children:[i.jsx(GG,{title:N,subtitle:k,icon:i.jsx(S,{className:"w-[18px] h-[18px]"}),iconClass:O1e[t]??E,badge:i.jsx("span",{className:`${P6} ${z.className}`,children:z.label}),stats:[],disabled:t==="not_configured",className:"xl:col-span-2",children:U()}),i.jsx(w1e,{isOpen:g,address:n?.address??"",isRotating:u,error:A,onConfirm:l,onCancel:D})]})}const Ak="text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",Tk="text-xs text-slate-500 mt-0.5",M1e=i.jsx("span",{className:"inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-badge-yellow text-badge-yellow-text",children:"Coming soon"}),D1e=i.jsx("span",{className:"inline-flex items-center rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-surface-muted text-slate-600",children:"Always on"});function $1e(){const{documents:e,summary:t,sources:n,storage:r,onImportClick:a}=jh(),s=n.find(x=>x.source==="upload"),o=n.find(x=>x.source==="email"),l=ve.useMemo(()=>e.filter(x=>j1(x)==="email").map(x=>x.uploaded_at),[e]),u=n.filter(x=>Hm(x.source)),d=u.reduce((x,y)=>x+y.documents,0),h=u.map(x=>({...x,share:mr(x.documents,d)})),p=x=>String(n.find(y=>y.source===x)?.documents??0),g=[{source:"upload",badge:D1e,stats:[{label:"Uploaded by hand",value:String(s?.documents??0)},{label:"Storage used",value:r.label},{label:"Backed up to Drive",value:String(t.drive.backedUp)}],actions:i.jsxs("button",{type:"button",onClick:a,className:"inline-flex items-center gap-2 min-h-[42px] lg:min-h-0 font-semibold text-[12.5px] px-2.5 py-1.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover",children:[i.jsx(Oo,{className:"w-[13px] h-[13px]"}),"Add Documents"]})},{source:"email",stats:[]},{source:"gmail",stats:[{label:"From Gmail",value:p("gmail")}]},{source:"drive",stats:[{label:"From Drive",value:p("drive")}]}];return i.jsxs(i.Fragment,{children:[i.jsxs(wh,{className:"mb-4",children:[i.jsxs(On,{label:"Uploaded by hand",children:[i.jsx("p",{className:Ak,children:s?.documents??0}),i.jsxs("p",{className:Tk,children:[s?.share??0,"% of all documents"]})]}),i.jsxs(On,{label:"Forwarded by email",children:[i.jsx("p",{className:Ak,children:o?.documents??0}),i.jsxs("p",{className:Tk,children:[o?.share??0,"% of all documents"]})]}),i.jsxs(On,{label:"Backed up to Drive",children:[i.jsx("p",{className:Ak,children:t.total===0?"â":`${mr(t.drive.backedUp,t.total)}%`}),i.jsxs("p",{className:Tk,children:[t.drive.backedUp," of ",t.total," · ",t.drive.failed," error",t.drive.failed===1?"":"s"]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-3.5 lg:grid-cols-2 xl:grid-cols-3 mb-4",children:g.map(x=>{const{cardTitle:y,cardSubtitle:w,pendingNotice:j,Icon:N,iconClass:k}=pG(x.source),S=Hm(x.source);return S&&x.source==="email"?i.jsx(R1e,{emailDocumentDates:l},x.source):i.jsx(GG,{title:y,subtitle:w,icon:i.jsx(N,{className:"w-[18px] h-[18px]"}),iconClass:k,badge:S?x.badge??null:M1e,disabled:!S,notice:S?void 0:j,stats:S?x.stats:[],actions:S?x.actions:void 0},x.source)})}),i.jsx(v1e,{sources:h,totalDocuments:d})]})}const I1e=300,Q0=e=>console.warn(`[useTransactionsWindow] ${e}`),bC=()=>typeof window>"u"?void 0:window.localStorage,JG=(e,{linkParam:t}={})=>{const[n,r]=Li(),a=t?n.get(t):null,[s,o]=v.useState(()=>a?Hf():Pbe(bC(),new Date,e)),[l,u]=v.useState(a);a&&a!==l&&(u(a),o(Hf())),v.useEffect(()=>{a&&Q0(`link ${t}=${a}: unset filters fall back to defaults, not the saved ones`)},[t,a]);const d=v.useMemo(()=>Abe(n,s),[n,s]),h=v.useCallback(p=>{Rbe(bC(),p,e),r(uA(p),{replace:!0})},[r,e]);return{filters:d,onFiltersChange:h}},eW=(e,t={})=>{const n=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),r=v.useMemo(()=>n.data?.accounts??[],[n.data?.accounts]),a=v.useMemo(()=>qV(r),[r]),s=v.useMemo(()=>e.accountIds.length?e.accountIds:a.map(k=>String(k.id)),[e.accountIds,a]),[o,l]=v.useState(null),u=v.useMemo(()=>
491({accountIds:s,startDate:e.startDate,endDate:e.endDate}),[s,e.startDate,e.endDate]);v.useEffect(()=>{if(!u.accountIds.length)return;const k=setTimeout(()=>{l(S=>S&&FI(S,u)?S:u)},I1e);return()=>clearTimeout(k)},[u]),v.useEffect(()=>{o&&Q0(`request ${o.startDate}..${o.endDate} accounts=${o.accountIds.length}`)},[o]);const{data:d,isError:h,error:p,isFetching:g,refetch:x}=mV(o,!0,t),y=v.useCallback(()=>{if(!u.accountIds.length){Q0("fetch skipped: no readable account selected");return}if(o&&FI(o,u)){Q0(`fetch refetches ${u.startDate}..${u.endDate}, window unchanged`),x();return}l(u)},[u,o,x]),w=!d&&!h||n.isLoading,j=!n.isLoading&&r.length===0,N=!n.isLoading&&r.length>0&&a.length===0&&e.accountIds.length===0;return{accounts:r,selectedAccountIds:s,queryParams:o,data:d,isError:h,error:p,isFetching:g,isUserFetching:n.isFetching,refetch:x,handleFetch:y,isLoading:w,hasNoAccounts:j,hasNoReadableAccounts:N}};function L1e({onFetch:e,isLoading:t,rangeLabel:n}){return i.jsxs(Vu,{title:"Transactions",subtitle:"Review, filter and reconcile bank transactions.",children:[i.jsx("span",{className:"inline-flex items-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-600 text-sm tabular-nums",children:n}),i.jsxs("button",{type:"button",onClick:e,disabled:t,className:"inline-flex items-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50",children:[i.jsx(dt,{className:`h-[15px] w-[15px] ${t?"animate-spin":""}`}),"Get transactions"]})]})}function F1e({counts:e,attentionCount:t}){return i.jsx(U1,{tabs:vbe,tabPath:Ko,counts:e,attention:{path:Gm,count:t,label:`${t} transaction${t===1?"":"s"} need a document`}})}function z1e({isOpen:e,onClose:t,transaction:n}){const[r,a]=v.useState(0),[s,o]=v.useState([]),[l,u]=v.useState(!1),[d,h]=v.useState(null),[p,g]=v.useState(!1),[x,y]=v.useState(!1),w=v.useRef(null),{addProcessingReceipt:j}=EA(),N=mn(),{uploadFiles:k,isUploading:S}=dG({transactionId:n?.transaction_id,onError:M=>{h(M.message||"Failed to upload files"),y(!1)},onProgress:M=>{a(M)},onComplete:()=>{y(!0)},onUploadSuccess:M=>{T(M)}});ve.useEffect(()=>{if(x&&s.length>0&&n){const M=s.filter(D=>D.id>0);M.length>0&&E(M)}},[x,s,n]);const E=async M=>{if(!(!n||M.length===0))try{u(!0),h(null);for(const D of M)await AA(D.id,n.ml_account_id,n.transaction_id,n.date,100,"Auto-matched during upload"),j(D.id);await Promise.all([N.invalidateQueries({queryKey:["transaction-matches"]}),N.invalidateQueries({queryKey:["receipts"]})]),g(!0)}catch(D){h(D instanceof Error?D.message:"Failed to match documents with transaction")}finally{u(!1)}};ve.useEffect(()=>{},[]);const O=async M=>{const D=M.target.files;if(!(!D||D.length===0))try{h(null),a(0),o([]),y(!1),g(!1);const A=Array.from(D).map((L,F)=>({name:L.name,id:-(Date.now()+F)}));o(A),await k(D)}catch{y(!1)}},T=M=>{o(D=>D.map((A,L)=>{const F=M[L];return F?{name:F.filename,id:F.id}:A}))};ve.useEffect(()=>{e&&(a(0),o([]),h(null),g(!1),y(!1),u(!1))},[e]);const P=()=>{!S&&!l&&(a(0),o([]),h(null),g(!1),y(!1),u(!1),w.current&&(w.current.value=""),t())};return i.jsxs(qt,{show:e,onClose:P,size:"md",position:"center",dismissible:!S&&!l,theme:Gu,children:[i.jsx(qt.Header,{className:"border-b border-gray-200 !p-4 lg:!p-6 !m-0",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:i.jsx(Oo,{className:"h-6 w-6 text-blue-600"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:"Upload & Match Document"}),i.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Upload document(s) to match with this transaction"})]})]})}),i.jsxs(qt.Body,{className:"!p-4 lg:!p-6",children:[d&&i.jsxs("div",{className:"mb-4 p-4 bg-red-50 text-red-600 rounded-lg flex items-center gap-2",children:[i.jsx(Qt,{className:"w-5 h-5"}),i.jsx("span",{children:d})]}),n&&i.jsxs("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg",children:[i.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Transaction Details"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-gray-600",children:"Date:"}),i.jsx("span",{className:"ml-2 font-medium",children:Km(n.date)})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-gray-600",children:"Amount:"}),i.jsxs("span",{className:"ml-2 font-medium",children:["$",Math.abs(n.amount).toFixed(2)]})]}),i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"text-gray-600",children:"Merchant:"}),i.jsx("span",{className:"ml-2 font-medium",children:n.merchant_name||n.name})]})]})]}),p?i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(vs,{className:"w-8 h-8 text-green-600"})}),i.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Upload & Match Complete!"}),i.jsxs("p",{className:"text-gray-600 mb-4",children:["Successfully uploaded ",s.length," document",s.length!==1?"s":""," and matched with the transaction."]}),i.jsx("div",{className:"space-y-2",children:s.map((M,D)=>i.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-green-600",children:[i.jsx(vs,{className:"w-4 h-4"}),i.jsx("span",{children:M.name})]},D))})]}):i.jsxs("div",{className:"space-y-4",children:[i.jsx(DO,{id:"transaction-upload",onChange:O,disabled:S||l,accept:"image/*,.pdf",multiple:!0,ref:w,helperText:"Upload receipts, invoices, or other documents related to this transaction"}),(S||l||x)&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-gray-600",children:l?"Matching documents...":x?"Upload completed!":"Uploading..."}),(S||l)&&i.jsx(Dt,{size:"sm"})]}),i.jsx(LO,{progress:x||l?100:r,size:"lg",color:x||l?"green":"blue"}),s.length>0&&i.jsx("div",{className:"space-y-1",children:s.map((M,D)=>i.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[i.jsx(vs,{className:`w-4 h-4 ${x?"text-green-600":"text-gray-400"}`}),i.jsx("span",{children:M.name})]},D))})]})]})]}),i.jsx(qt.Footer,{className:"border-t border-gray-200 !p-4 lg:!p-6",children:i.jsx("div",{className:lc,children:i.jsx(mt,{color:"gray",onClick:P,disabled:S||l,className:"bg-white hover:bg-gray-50 border border-gray-300",children:p?"Close":"Cancel"})})})]})}const B1e=[{key:"date",label:"Date"},{key:"amount",label:"Amount"},{key:"merchant",label:"Merchant"}];function tW({candidate:e,isBest:t,isAccepting:n,onAccept:r,onDismiss:a,showShortcuts:s=!1,layout:o="inline"}){const l=o==="stacked",u=l?"w-full justify-center h-[42px]":"";return i.jsxs("article",{className:`border rounded-xl p-3.5 mb-3 ${t?"border-green-200 bg-[#f7fdf9] shadow-[0_0_0_3px_rgba(22,163,74,.06)]":"border-border bg-surface"}`,children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-[38px] h-[48px] rounded-lg border border-border flex-none flex items-end justify-center pb-1 text-[9px] font-bold text-slate-400 bg-[repeating-linear-gradient(180deg,#fff_0_6px,#f1f5f9_6px_8px)]",children:(e.type||"doc").slice(0,3).toUpperCase()}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("b",{className:"block text-[13.5px] font-bold text-slate-900 truncate",children:e.receiptName}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-0.5 truncate",children:[e.date?Ue(e.date):"undated",e.merchant?` · ${e.merchant}`:"",e.total!==null?` · ${Re(e.total,e.totalCurrency)}`:""]})]}),i.jsxs("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-bold whitespace-nowrap ${K1(e.confidence_score)}`,children:[e.confidence_score,"% match"]})]}),i.jsx("div",{className:"mt-3",children:B1e.map(({key:d,label:h})=>i.jsxs("div",{className:"flex items-center gap-2.5 mb-1.5 last:mb-0",children:[i.jsx("span",{className:"w-[64px] flex-none text-[11px] font-bold uppercase tracking-[0.05em] text-slate-400",children:h}),i.jsx("span",{className:"flex-1 h-1.5 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:`block h-full ${u1e(e,d)}`,style:{width:`${o1e(e,d)*100}%`}})}),i.jsx("span",{className:"w-[70px] flex-none text-right text-[11.5px] font-semibold text-slate-600 tabular-nums",children:c1e(e,d)})]},d))}),i.jsxs("div",{className:`${l?"grid grid-cols-1":"flex items-center"} gap-2 mt-3 pt-3 border-t border-dashed border-border`,children:[i.jsxs("button",{type:"button",onClick:r,disabled:n,className:`inline-flex items-center gap-1.5 font-semibold px-2.5 py-1.5 rounded-lg text-[12.5px] disabled:opacity-50 ${u} ${t?"border border-amount-pos bg-amount-pos text-white":"border border-border bg-surface text-slate-700"}`,children:[i.jsx(Zt,{className:"w-3.5 h-3.5"}),n?"Attachingâ¦":"Accept match"]}),s&&t&&!l&&i.jsx("kbd",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 rounded-[5px] border border-border bg-surface-2 text-[10.5px] font-bold text-slate-500",children:"A"}),a&&i.jsxs("button",{type:"button",onClick:a,className:`inline-flex items-center gap-1.5 font-semibold px-2.5 py-1.5 rounded-lg border border-border bg-surface text-slate-700 text-[12.5px] ${u}`,children:[i.jsx(Ut,{className:"w-3.5 h-3.5"}),"Not this one"]})]})]})}const nW=()=>{const[e,t]=v.useState(null),[n,r]=v.useState(null),[a,s]=v.useState(null),o=v.useRef(!1),l=MA();return{accept:v.useCallback(async(d,h)=>{if(o.current)return!1;o.current=!0,t(d.transaction_id),r(h.receiptId),s(null);try{return await AA(h.receiptId,d.ml_account_id,d.transaction_id,String(d.date??"").slice(0,10),h.confidence_score,void 0,!0),await l(),!0}catch(p){const g=p instanceof Error?p.message:"Failed to attach the document";return s(g),!1}finally{o.current=!1,t(null),r(null)}},[l]),acceptingId:e,acceptingReceiptId:n,error:a}};function U1e(e){return[{label:"Primary Account",value:e.primary_account||"N/A"},{label:"Account Name",value:e.account_name||"N/A"},{label:"Account - Last 4",value:e.mask||"N/A"},{label:"Name",value:e.name||"N/A"},{label:"Merchant",value:e.merchant_name||"N/A"},{label:"Category",value:e.category||"N/A"},{label:"Sub Category",value:e.sub_category||"N/A"}]}const Pk=({children:e})=>i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:e}),t0="inline-flex items-center gap-1.5 font-semibold px-2.5 py-1.5 rounded-lg text-[12.5px]";function M6({row:e,matchesResolved:t,onClose:n,onAttach:r,variant:a="panel"}){const s=a==="sheet",o=s?"justify-center min-h-[42px]":"",l=$g(e,t),u=br(e),d=Number(e.amount),h=Vve(e.transaction_id),p=h.data??[],{unlink:g,unlinkingId:x,error:y}=Gve(),w=RA(e,l==="needs-receipt"),{accept:j,acceptingId:N,acceptingReceiptId:k,error:S}=nW(),E=p.length===1?p[0].id:null,[O,T]=v.useState(null);v.useEffect(()=>{T(null)},[e.transaction_id]);const P=F=>{T(F)},M=()=>{T(null)},D=async F=>{T(null),await g(F)&&r(e)},A=[...U1e(e),{label:"Currency",value:e.iso_currency_code||"N/A"},{label:"Payment channel",value:e.payment_channel||"N/A"},{label:"Authorized date",value:e.authorized_date?Ue(e.authorized_date):"N/A"}
491,{label:"City / State",value:[e.city,e.state].filter(Boolean).join(", ")||"N/A"},{label:"Transaction ID",value:e.transaction_id}],L=s?"div":"aside";return i.jsxs(L,{"aria-label":s?void 0:"Transaction details",className:s?"flex-1 bg-surface flex flex-col overflow-hidden min-h-0":"rounded-xl border border-border bg-surface shadow-card flex flex-col overflow-hidden min-h-0",children:[i.jsxs("div",{className:`border-b border-border ${s?"flex-none px-[18px] pt-2 pb-4":"p-[18px]"}`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Es,{name:u,className:"w-10 h-10 rounded-[10px] text-sm"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h2",{className:"text-base font-extrabold tracking-tight text-slate-900 truncate",children:u}),i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5 truncate",children:[e.name," · ",Ue(String(e.date??"").slice(0,10))]})]}),i.jsx("button",{type:"button",onClick:n,"aria-label":"Close details",className:`rounded-md text-slate-500 hover:bg-slate-100 hover:text-slate-900 ${s?"w-[42px] h-[42px] flex items-center justify-center flex-none":"p-1.5"}`,children:i.jsx(Ut,{className:"w-[18px] h-[18px]"})})]}),i.jsx("p",{className:`text-[30px] leading-none font-extrabold tracking-tight tabular-nums mt-3.5 ${Number.isFinite(d)&&d<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(e.amount,e.iso_currency_code)}),i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-1",children:[e.account_name,e.mask?` â¢â¢${e.mask}`:""," · ",e.pending?"pending":"posted"]}),i.jsxs("div",{className:"flex gap-2 flex-wrap mt-3.5",children:[i.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-bold ${cC[l]}`,children:[Kl[l],l==="matched"&&e.match?` ${Math.round(e.match.match_confidence)}%`:""]}),e.category&&i.jsx("span",{className:"inline-flex rounded-full px-2.5 py-1 text-[11px] font-bold bg-surface-muted text-slate-600",children:e.category}),e.payment_channel&&i.jsx("span",{className:"inline-flex rounded-full px-2.5 py-1 text-[11px] font-bold bg-surface-muted text-slate-600",children:e.payment_channel})]}),i.jsxs("div",{className:`${s?"grid grid-cols-2 gap-2":"flex gap-2 flex-wrap"} mt-3.5`,children:[i.jsxs("button",{type:"button",onClick:()=>r(e),className:`${t0} border border-brand bg-brand text-white ${o} ${s&&E===null?"col-span-2":""}`,children:[i.jsx(Qs,{className:"w-3.5 h-3.5"}),"Attach document"]}),E!==null&&i.jsxs("button",{type:"button",onClick:()=>P(E),disabled:x!==null||O!==null,className:`${t0} border border-border bg-surface text-slate-700 disabled:opacity-50 ${o}`,children:[i.jsx(Zs,{className:"w-3.5 h-3.5"}),x!==null?"Unlinkingâ¦":"Change match"]})]}),O!==null&&i.jsxs("div",{role:"alertdialog","aria-label":"Confirm change match",className:"mt-3 rounded-[10px] border border-border bg-surface-muted p-3",children:[i.jsxs("p",{className:"text-[12.5px] text-slate-700",children:["The attached document is detached right away. Until you attach a replacement this transaction goes back to â",Kl["needs-receipt"],"â."]}),i.jsxs("div",{className:`${s?"grid grid-cols-1":"flex flex-wrap"} gap-2 mt-2.5`,children:[i.jsx("button",{type:"button",onClick:()=>D(O),className:`${t0} border border-brand bg-brand text-white ${o}`,children:"Detach and choose another"}),i.jsx("button",{type:"button",onClick:M,className:`${t0} border border-border bg-surface text-slate-700 ${o}`,children:"Keep current document"})]})]}),(y||S)&&i.jsx("p",{className:"text-[12px] text-badge-red-text mt-3",children:y??S})]}),i.jsxs("div",{className:"overflow-auto flex-1 min-h-0 p-[18px]",children:[i.jsxs(Pk,{children:["Matched documents · ",p.length]}),h.isLoading?i.jsxs("p",{className:"flex items-center gap-2 text-[12.5px] text-slate-500",children:[i.jsx(Dt,{size:"sm"}),"Loading documentsâ¦"]}):h.isError?i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"The attached documents could not be loaded."}):p.length===0?i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"Nothing attached to this transaction yet."}):p.map(F=>{const B=F.parsed_data?.total;return i.jsxs("div",{className:"flex items-center gap-2.5 p-2.5 border border-border rounded-[10px] mb-2 bg-surface",children:[i.jsx(ri,{className:"w-4 h-4 text-slate-400 flex-none"}),i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13px] font-semibold text-slate-900 truncate",children:F.receipt_name}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500",children:["Uploaded ",qu(F.uploaded_at),F.type?` · ${F.type}`:""]})]}),B!=null&&i.jsx("span",{className:"text-[13px] font-bold tabular-nums text-slate-900",children:Re(B,F.parsed_data?.total_currency)}),i.jsx("button",{type:"button",onClick:()=>g(F.id),disabled:x===F.id,className:"text-[11.5px] font-semibold text-slate-500 underline disabled:opacity-50",children:"Unlink"})]},F.id)}),l==="needs-receipt"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mt-5",children:i.jsxs(Pk,{children:["Suggested documents · ",w.data?.length??0]})}),w.isFetching&&!w.data?i.jsxs("p",{className:"flex items-center gap-2 text-[12.5px] text-slate-500",children:[i.jsx(Dt,{size:"sm"}),"Looking for a matching documentâ¦"]}):(w.data?.length??0)===0?i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"No document in your library looks like this transaction."}):w.data.map((F,B)=>i.jsx(tW,{candidate:F,isBest:B===0,isAccepting:N===e.transaction_id&&k===F.receiptId,onAccept:()=>j(e,F),layout:s?"stacked":"inline"},F.receiptId))]}),l==="matched"&&i.jsxs("p",{className:"flex items-center gap-1.5 text-[12.5px] text-amount-pos font-semibold mt-4",children:[i.jsx(Zt,{className:"w-3.5 h-3.5"}),"This transaction is reconciled."]}),i.jsxs("div",{className:"mt-6",children:[i.jsx(Pk,{children:"Transaction details"}),i.jsx("div",{className:"grid grid-cols-2 gap-x-3.5 gap-y-3",children:A.map(F=>i.jsxs("div",{className:s?"min-w-0 break-words":void 0,children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.06em] text-slate-400",children:F.label}),i.jsx("p",{className:"text-[13px] font-semibold text-slate-900 mt-0.5 break-words",children:F.value})]},F.label))})]})]})]})}const q1e=3;function rW(e,t){const n=o=>t.find(l=>String(l.id)===String(o))?.title||`Account ${o}`,r=[...new Set(e.map(o=>
491o.error_message).filter(Boolean))],a=e.slice(0,q1e).map(o=>n(o.account_id)),s=e.length-a.length;return{named:a,remaining:s,reasons:r,detail:`${a.join(", ")}${s>0?` and ${s} more`:""}${r.length>0?` · ${r.join("; ")}`:""}`}}function aW({errors:e,accounts:t,noun:n="account"}){if(e.length===0)return null;const{detail:r}=rW(e,t),a=`${e.length} ${n}${e.length===1?"":"s"}`;return i.jsxs("div",{role:"status",className:"flex items-start gap-3.5 rounded-xl border border-amber-200 bg-amber-50 px-[18px] py-3.5 mb-4",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-badge-yellow text-badge-yellow-text flex items-center justify-center flex-none",children:i.jsx(Jt,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{children:[i.jsxs("p",{className:"text-sm font-bold text-slate-900",children:[a," could not be read â what you see below is missing"," ",e.length===1?"its":"their"," transactions"]}),i.jsx("p",{className:"text-[12.5px] text-amber-800 mt-0.5",children:r})]})]})}function sW({accountCount:e}){return i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-12 text-center",children:[i.jsx("span",{className:"w-[76px] h-[76px] rounded-[20px] bg-badge-yellow text-badge-yellow-text flex items-center justify-center mx-auto mb-[18px]",children:i.jsx(rc,{className:"w-8 h-8"})}),i.jsx("h3",{className:"text-[19px] font-extrabold tracking-tight text-slate-900 mb-1.5",children:"None of your connections can be read right now"}),i.jsxs("p",{className:"max-w-[460px] mx-auto text-slate-500 leading-relaxed",children:[e," connection",e===1?" is":"s are"," linked, but none of them is active with the transactions product. Reconnect them on the Accounts screen and they will report here again."]})]})}function iW({body:e}){return i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-12 text-center",children:[i.jsx("span",{className:"w-[76px] h-[76px] rounded-[20px] bg-brand-soft text-brand flex items-center justify-center mx-auto mb-[18px]",children:i.jsx(rc,{className:"w-8 h-8"})}),i.jsx("h3",{className:"text-[19px] font-extrabold tracking-tight text-slate-900 mb-1.5",children:"Connect an account to see transactions"}),i.jsx("p",{className:"max-w-[440px] mx-auto text-slate-500 leading-relaxed",children:e})]})}const oW=({children:e})=>i.jsxs("div",{className:"flex items-center gap-2.5 px-[18px] py-3 bg-surface-2 border-b border-border text-[12.5px] font-semibold text-slate-500",children:[i.jsx(dt,{className:"w-[15px] h-[15px] text-brand animate-spin"}),e]});function lW({rows:e=5,label:t,withHero:n=!1,ariaLabel:r}){return i.jsxs("div",{"aria-busy":"true","aria-label":r,children:[n&&i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1.7fr_1fr] mb-4",children:[i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card p-5",children:[i.jsx("span",{className:"block h-2.5 w-24 rounded-full bg-surface-muted animate-pulse"}),i.jsx("span",{className:"block h-8 w-56 rounded bg-surface-muted animate-pulse mt-3"}),i.jsx("span",{className:"block h-2.5 w-40 rounded-full bg-surface-muted animate-pulse mt-3 opacity-70"}),i.jsx("div",{className:"mt-5 pt-4 border-t border-border",children:[0,1,2].map(a=>i.jsxs("span",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsx("span",{className:"w-[88px] h-2.5 rounded-full bg-surface-muted animate-pulse flex-none"}),i.jsx("span",{className:"flex-1 h-5 rounded-md bg-surface-muted animate-pulse"}),i.jsx("span",{className:"w-[104px] h-2.5 rounded-full bg-surface-muted animate-pulse flex-none"})]},a))})]}),i.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2].map(a=>i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card p-4",children:[i.jsx("span",{className:"block h-2.5 w-20 rounded-full bg-surface-muted animate-pulse"}),i.jsx("span",{className:"block h-6 w-32 rounded bg-surface-muted animate-pulse mt-2.5"}),i.jsx("span",{className:"block h-2 w-40 rounded-full bg-surface-muted animate-pulse mt-3 opacity-70"})]},a))})]}),i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[t&&i.jsx(oW,{children:t}),Array.from({length:e}).map((a,s)=>i.jsxs("div",{className:"flex items-center gap-3 px-[18px] py-3.5 border-b border-border last:border-b-0",children:[i.jsx("span",{className:"w-[26px] h-[26px] rounded-[7px] bg-surface-muted animate-pulse flex-none"}),i.jsxs("span",{className:"flex-1",children:[i.jsx("span",{className:"block h-2.5 rounded-full bg-surface-muted animate-pulse w-[34%]"}),i.jsx("span",{className:"block h-2 rounded-full bg-surface-muted animate-pulse w-[58%] mt-[7px] opacity-70"})]}),i.jsx("span",{className:"w-24 flex-none",children:i.jsx("span",{className:"block h-2.5 rounded-full bg-surface-muted animate-pulse"})})]},s))]})]})}const n0=e=>console.warn(`[TransactionsPage] ${e}`);function H1e(){const{pathname:e}=Gr(),t=Ms(),[n,r]=Li(),a=n.get(xf),[s,o]=v.useState(null),[l,u]=v.useState(a),{filters:d,onFiltersChange:h}=JG(void 0,{linkParam:xf}),{accounts:p,selectedAccountIds:g,queryParams:x,data:y,isError:w,error:j,isFetching:N,isUserFetching:k,refetch:S,handleFetch:E,isLoading:O,hasNoAccounts:T,hasNoReadableAccounts:P}=eW(d),M=v.useMemo(()=>y?.rows??[],[y?.rows]),D=y?.matchesResolved??!1,A=v.useMemo(()=>y?.accountErrors??[],[y?.accountErrors]),L=v.useMemo(()=>pu(M,d,D),[M,d,D]),F=v.useMemo(()=>L.filter(H=>$g(H,D)==="needs-receipt").length,[L,D]),B=v.useMemo(()=>M.find(H=>H.transaction_id===l)??null,[M,l]),U=v.useCallback(H=>{u(H.transaction_id)},[]),z=v.useCallback(()=>{u(null);const H=new URLSearchParams(n),V=H.get(xf);if(V===null){n0("Closed the inspector: no linked id in the URL to clear");return}H.delete(xf),n0(`Closed the inspector: cleared linked transaction ${V} from the URL`),r(H,{replace:!0})},[n,r]),$=B&&{row:B,matchesResolved:D,onClose:z,onAttach:o},K=v.useRef(e),G=v.useRef(a);v.useEffect(()=>{const H=K.current!==e,V=G.current!==a;if(K.current=e,G.current=a,V&&a){n0(`Following link to transaction ${a} on ${e}`),u(a);return}H&&(n0(`Clearing the inspected transaction: moved to ${e}
491 with no linked id`),u(null))},[e,a]);const W=v.useMemo(()=>({rows:M,filtered:L,matchesResolved:D,accounts:p,selectedAccountIds:g,filters:d,fetchedWindow:x,onFiltersChange:h,onFetch:E,isFetching:N,truncated:y?.truncated??!1,accountErrors:A,onAttachDocument:o,onSelectTransaction:U}),[M,L,D,p,g,d,x,h,E,N,y?.truncated,A,U]);let I;if(w&&!y)I=i.jsx(B1,{title:"We couldn't load your transactions",body:"The request to Moneylogz failed, so no transactions could be read. Your accounts and documents are unaffected.",message:j instanceof Error?j.message:"Failed to fetch transactions",isRetrying:N,onRetry:()=>S()});else if(P)I=i.jsx(sW,{accountCount:p.length});else if(T)I=i.jsx(iW,{body:"Moneylogz reads transactions from your linked banks and cards, then matches the documents you upload against them."});else if(O)I=i.jsx(lW,{rows:6,label:"Fetching transactions from your connected accounts",withHero:!0,ariaLabel:"Loading transactions"});else if(M.length===0){const H=A.length>0;I=i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-12 text-center",children:[i.jsx(rc,{className:"w-10 h-10 mx-auto mb-3 text-slate-300"}),i.jsx("p",{className:"text-[15px] font-semibold text-slate-900",children:H?"No transactions could be read for this window":"No transactions in this window"}),i.jsx("p",{className:"text-sm text-slate-500 mt-1",children:H?`None of the accounts you selected returned transactions between ${Ue(d.startDate)} and ${Ue(d.endDate)} â see the reasons above.`:`Nothing posted between ${Ue(d.startDate)} and ${Ue(d.endDate)}. Widen the date range and fetch again.`})]})}else I=i.jsx(yg,{context:W});return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx(L1e,{onFetch:E,isLoading:N||k,rangeLabel:`${Ue(d.startDate)} â ${Ue(d.endDate)}`}),i.jsx(aW,{errors:A,accounts:p}),i.jsx(F1e,{counts:{all:M.length||void 0,[Gm]:D?F:void 0},attentionCount:D?F:0}),i.jsxs("div",{className:`flex-1 min-h-0 ${B&&t?"grid grid-cols-1 xl:grid-cols-[minmax(0,1fr)_400px] gap-4":""}`,children:[i.jsx("div",{className:"min-w-0 overflow-auto",children:I}),$&&t&&i.jsx(M6,{...$})]}),$&&!t&&i.jsx(Wu,{isOpen:s===null,size:"tall",label:"Transaction details",onClose:z,bodyClassName:"flex flex-col",children:i.jsx(M6,{...$,variant:"sheet"})}),i.jsx(z1e,{isOpen:s!==null,onClose:()=>o(null),transaction:s})]})}function K1e({summary:e,coverage:t,matchesResolved:n,previousNet:r}){return i.jsxs(wh,{className:"mb-4",children:[i.jsxs(On,{label:`Money out${e.currency?` · ${e.currency}`:""}`,children:[i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-amount-neg",children:Ee(-e.moneyOut,e.currency)}),i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:[e.count," transaction",e.count===1?"":"s"]})]}),i.jsx(On,{label:"Money in",children:i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-amount-pos",children:ge(e.moneyIn,e.currency)})}),i.jsxs(On,{label:"Net flow",children:[i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:Ee(e.net,e.currency)}),r!==null&&i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5 tabular-nums",children:["vs ",Ee(r,e.currency)," last period"]})]}),i.jsxs(On,{label:"Documents matched",children:[i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:n&&t.percent!==null?`${t.percent}%`:je}),i.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:n?`${t.matched} of ${t.eligible} · ${t.needsReceipt} unmatched`:"document status unavailable"})]}),e.pendingCount>0&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-bold rounded-full px-2.5 py-1 bg-badge-blue text-badge-blue-text self-center",children:[i.jsx(xr,{className:"w-3 h-3"}),e.pendingCount," pending"]}),e.otherCurrencyCount>0&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-bold rounded-full px-2.5 py-1 bg-surface-muted text-slate-600 self-center",children:[i.jsx(na,{className:"w-3 h-3"}),e.otherCurrencyCount," not counted"]})]})}
491const V1e=["bg-brand","bg-sky-500","bg-orange-500","bg-violet-500","bg-slate-400","bg-slate-300"],G1e=6;function W1e({summary:e,categories:t,rangeLabel:n,accountCount:r}){const a=t.slice(0,G1e),s=a.reduce((o,l)=>Math.max(o,l.amount),0);return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card p-4 lg:p-5",children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:["Money out · ",n,e.currency?` · ${e.currency}`:""]}),i.jsx("p",{className:"text-[30px] lg:text-[34px] leading-none font-extrabold tracking-tight tabular-nums text-amount-neg mt-2",children:Ee(-e.moneyOut,e.currency)}),i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-2",children:[i.jsx("span",{className:"font-bold text-amount-pos tabular-nums",children:ge(e.moneyIn,e.currency)})," ","in ·"," ",i.jsx("span",{className:"font-bold text-amount-neg tabular-nums",children:Ee(-e.moneyOut,e.currency)})," ","out · across ",r," connection",r===1?"":"s"]}),a.length>0&&i.jsxs("div",{className:"mt-5 pt-4 border-t border-border",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-3",children:"Where the money went"}),a.map((o,l)=>i.jsxs("div",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsx("span",{className:"w-[84px] lg:w-[104px] flex-none text-xs font-semibold text-slate-600 truncate",children:o.category}),i.jsx("span",{className:"flex-1 h-5 rounded-md bg-surface-muted overflow-hidden",children:i.jsx("span",{className:`block h-full ${V1e[l]??"bg-slate-300"}`,style:{width:s>0?`${o.amount/s*100}%`:"0%"}})}),i.jsx("span",{className:"min-w-[88px] lg:w-[104px] flex-none whitespace-nowrap text-right text-[12.5px] font-bold tabular-nums text-amount-neg",children:Ee(-o.amount,e.currency)})]},o.category))]})]})}const IA=({children:e})=>i.jsx("section",{className:"rounded-xl border border-border bg-surface shadow-card p-4",children:e}),LA=({children:e})=>i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:e}),FA=({percent:e,className:t})=>i.jsx("span",{className:"block h-2 rounded-full bg-surface-muted overflow-hidden mt-2.5",children:i.jsx("span",{className:`block h-full ${t}`,style:{width:`${Math.min(Math.max(e,0),100)}%`}})});function Y1e({coverage:e,matchesResolved:t}){return i.jsxs(IA,{children:[i.jsxs("div",{className:"flex justify-between items-baseline",children:[i.jsx(LA,{children:"Document coverage"}),t&&e.needsReceipt===0&&e.eligible>0&&i.jsx("span",{className:"text-[11px] font-bold rounded-full px-2.5 py-1 bg-badge-green text-badge-green-text",children:"All matched"})]}),i.jsx("p",{className:"text-lg font-extrabold tabular-nums mt-1.5 text-slate-900",children:t?i.jsxs(i.Fragment,{children:[e.matched," ",i.jsxs("span",{className:"text-xs font-semibold text-slate-500",children:["of ",e.eligible," matched"]})]}):je}),i.jsx(FA,{percent:t?e.percent??0:0,className:"bg-amount-pos"}),i.jsx("p",{className:"text-xs text-slate-500 mt-2",children:t?`${e.needsReceipt} still need a document`:"the document lookup failed, so coverage is unknown"})]})}function X1e({merchants:e,currency:t,moneyOut:n}){const r=e[0]??null,a=r&&n>0?Math.round(r.amount/n*100):0;return i.jsxs(IA,{children:[i.jsx(LA,{children:"Top merchant"}),i.jsx("p",{className:"text-lg font-extrabold tabular-nums mt-1.5 text-slate-900 truncate",children:r?r.merchant:je}),i.jsx(FA,{percent:a,className:"bg-brand"}),i.jsx("p",{className:"text-xs text-slate-500 mt-2 tabular-nums",children:r?`${r.count} transaction${r.count===1?"":"s"} · ${Ee(-r.amount,t)}`:"no spend in this window"})]})}function Q1e({summary:e}){const t=e.moneyOut>0?Math.round(Math.abs(e.pendingValue)/e.moneyOut*100):0;return i.jsxs(IA,{children:[i.jsxs("div",{className:"flex justify-between items-baseline",children:[i.jsx(LA,{children:"Pending & uncleared"}),e.pendingCount>0&&i.jsx("span",{className:"text-[11px] font-bold rounded-full px-2.5 py-1 bg-badge-blue text-badge-blue-text",children:e.pendingCount})]}),i.jsx("p",{className:"text-lg font-extrabold tabular-nums mt-1.5 text-slate-900",children:e.pendingCount>0?Ee(e.pendingValue,e.currency):je}),i.jsx(FA,{percent:t,className:"bg-badge-blue-text"}),i.jsx("p",{className:"text-xs text-slate-500 mt-2",children:e.pendingCount>0?"amounts may change when they post":"everything in this window has posted"})]})}const Z1e=[{match:/food|grocer|restaurant|coffee/i,icon:zce,className:"bg-badge-green text-badge-green-text"},{match:/travel|airline|transport|taxi/i,icon:kce,className:"bg-badge-yellow text-badge-yellow-text"},{match:/rent|housing|mortgage|home/i,icon:HU,className:"bg-brand-soft text-brand"},{match:/income|payroll|deposit|transfer|payment/i,icon:Uo,className:"bg-badge-green text-badge-green-text"},{match:/subscription|software|service/i,icon:dO,className:"bg-badge-blue text-badge-blue-text"}],J1e={matched:Zt,"needs-receipt":ri,pending:xr,"not-required":vce,unknown:e1},ewe=(e,t)=>{const n=`${e} ${t}`;return Z1e.find(a=>a.match.test(n))??{icon:ea,className:"bg-surface-muted text-slate-500"}},twe=e=>[...new Set([e.category,e.sub_category].map(t=>t?.trim()).filter(t=>!!t))];function cW({row:e,matchesResolved:t,variant:n="list",onSelect:r,children:a}){const s=$g(e,t),o=J1e[s],{icon:l,className:u}=ewe(e.category??"",e.sub_category??""),d=br(e),h=Number(e.amount),p=Ue(String(e.date??"").slice(0,10)),g=`${Kl[s]}${s==="matched"&&e.match?` ${Math.round(e.match.match_confidence)}%`:""}`,x=twe(e);return i.jsxs("div",{className:"border-b border-border last:border-b-0",children:[i.jsxs("button",{type:"button",onClick:()=>r(e),className:"w-full flex items-center gap-2.5 lg:gap-3 px-3.5 lg:px-[18px] py-[11px] text-left hover:bg-surface-2 transition-colors",children:[n!=="day"&&i.jsx("span",{className:"hidden lg:block w-[84px] flex-none text-xs text-slate-500 tabular-nums",children:p}),i.jsx(Es,{name:d}),i.jsx("span",{className:`hidden lg:flex w-[26px] h-[26px] rounded-[7px] flex-none items-center justify-center ${u}`,children:i.jsx(l,{className:"w-[15px] h-[15px]"})}),i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:d}),i.jsxs("span",{className:"flex items-center gap-1.5 lg:gap-[7px] flex-nowrap lg:flex-wrap overflow-hidden lg:overflow-visible text-[11.5px] text-slate-500 mt-0.5",children:[i.jsxs("span",{className:"truncate min-w-0",children:[n!=="day"&&i.jsxs("span",{className:"lg:hidden",children:[p," · "]}),e.account_name,e.mask?` â¢â¢${e.mask}`:""]}),x.map((y,w)=>i.jsx("span",{className:`${w===0?"inline-flex":"hidden lg:inline-flex"} flex-none rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500`,children:y},y)),e.payment_channel&&i.jsx("span",{className:"hidden lg:inline",children:e.payment_channel})]})]}
491),i.jsx("span",{role:"img","aria-label":g,title:g,className:`lg:hidden w-6 h-6 rounded-full flex-none inline-flex items-center justify-center ${cC[s]}`,children:i.jsx(o,{className:"w-[13px] h-[13px]"})}),i.jsx("span",{className:"hidden lg:flex w-[188px] flex-none justify-end",children:i.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-bold whitespace-nowrap ${cC[s]}`,children:[i.jsx(o,{className:"w-[13px] h-[13px]"}),Kl[s],s==="matched"&&e.match?` ${Math.round(e.match.match_confidence)}%`:""]})}),i.jsxs("span",{className:"flex-none lg:w-[130px] text-right",children:[i.jsx("span",{className:`block text-[14px] font-bold tabular-nums ${Number.isFinite(h)&&h<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(e.amount,e.iso_currency_code)}),e.pending&&i.jsx("span",{className:"block text-[11.5px] text-slate-500 mt-0.5",children:"not posted yet"})]})]}),a]})}function nwe({day:e,currency:t,matchesResolved:n,onSelect:r}){return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden mb-4",children:[i.jsxs("header",{className:"flex items-center gap-3 px-3.5 lg:px-[18px] py-3.5 bg-surface-2 border-b border-border",children:[i.jsx("span",{className:"w-[30px] h-[30px] rounded-lg flex-none flex items-center justify-center bg-brand-soft text-brand",children:i.jsx(jle,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-slate-900",children:Ue(e.date)}),i.jsxs("p",{className:"text-xs text-slate-500 mt-px",children:[e.rows.length," transaction",e.rows.length===1?"":"s"," · ",e.accounts," account",e.accounts===1?"":"s"]})]}),i.jsxs("div",{className:"ml-auto text-right",children:[i.jsx("p",{className:`text-base font-extrabold tabular-nums ${e.net<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(e.net,t)}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-px",children:"day net"})]})]}),e.rows.map(a=>i.jsx(cW,{row:a,matchesResolved:n,variant:"day",onSelect:r},a.transaction_id))]})}const zA=()=>Gv(),rwe="transactionsComparison",awe=864e5,D6=e=>{const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?null:t},$6=(e,t)=>{const n=new Date(e);return n.setDate(n.getDate()+t),n};function swe(e){const t=D6(e.startDate),n=D6(e.endDate);if(!t||!n||n<t)return null;const r=Math.round((n.getTime()-t.getTime())/awe)+1,a=$6(t,-1),s=$6(a,-(r-1));return{...e,startDate:Vr(s),endDate:Vr(a)}}const uW=(e,t)=>{const n=v.useMemo(()=>e?swe(e):null,[e]),r=Nt({queryKey:[rwe,n],enabled:t&&!!Et()&&!!n&&n.accountIds.length>0,staleTime:5*60*1e3,retry:!1,queryFn:async()=>{if(!n)throw new Error("No comparison window");const s=(await k1({accountIds:n.accountIds,startDate:new Date(`${n.startDate}T00:00:00`).toISOString(),endDate:new Date(`${n.endDate}T00:00:00`).toISOString(),limit:500})).transactions??[];return{rows:s,net:Xl(s).net}}});return{previous:n,data:r.isSuccess?r.data??null:null}},iwe=(e,t)=>{const{data:n}=uW(e,t);return n?n.net:null},owe=(e,t)=>{const{previous:n,data:r}=uW(e,t);return{rows:r?r.rows:null,window:r?n:null}},lwe=3;function cwe(){const{rows:e,filtered:t,matchesResolved:n,filters:r,fetchedWindow:a,selectedAccountIds:s,onSelectTransaction:o,truncated:l}=zA(),u=v.useMemo(()=>Xl(t),[t]),d=v.useMemo(()=>F1(t),[t]),h=v.useMemo(()=>z1(t),[t]),p=v.useMemo(()=>wA(t,n),[t,n]),g=v.useMemo(()=>L0e(t).slice(0,lwe),[t]),x=iwe(a,e.length>0),y=`${Ue(r.startDate)} â ${Ue(r.endDate)}`,w=g.reduce((j,N)=>j+N.rows.length,0);return i.jsxs(i.Fragment,{children:[i.jsx(K1e,{summary:u,coverage:p,matchesResolved:n,previousNet:x}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1.7fr_1fr] mb-4",children:[i.jsx(W1e,{summary:u,categories:d,rangeLabel:y,accountCount:s.length}),i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsx(Y1e,{coverage:p,matchesResolved:n}),i.jsx(X1e,{merchants:h,currency:u.currency,moneyOut:u.moneyOut}),i.jsx(Q1e,{summary:u})]})]}),g.map(j=>i.jsx(nwe,{day:j,currency:u.currency,matchesResolved:n,onSelect:o},j.date)),i.jsxs("div",{className:"flex flex-col items-start gap-1.5 lg:flex-row lg:items-center lg:justify-between lg:gap-0 rounded-xl border border-border bg-surface shadow-card px-3.5 lg:px-[18px] py-3 text-[12.5px] text-slate-500",children:[i.jsxs("span",{children:["Showing ",w," of ",t.length," transaction",t.length===1?"":"s",l?" · the window was truncated, narrow the dates for the full picture":""]}),i.jsx(gt,{to:Ko("all"),className:"text-brand font-semibold",children:"View all transactions â"})]})]})}function uwe(e){switch(e.toUpperCase()){case"ACTIVE":return"bg-badge-green text-badge-green-text";case"ITEM_LOGIN_REQUIRED":case"ERROR":return"bg-badge-red text-badge-red-text";default:return"bg-surface-muted text-slate-600"}}function dwe(e){return e.toUpperCase()==="ITEM_LOGIN_REQUIRED"?"Login Broken":e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}function fwe({label:e,options:t,selectedValues:n,onChange:r,onBlur:a,placeholder:s="Select accounts",minWidth:o=200}){const[l,u]=v.useState(!1),d=v.useRef(null);v.useEffect(()=>{if(!l)return;const g=x=>{d.current&&!d.current.contains(x.target)&&(u(!1),a?.())};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[l,a]);const h=v.useMemo(()=>t.length?[...t].sort((g,x)=>(g.status||"").localeCompare(x.status||"")):[],[t]),p=n.length;return i.jsxs("div",{className:"relative",ref:d,children:[i.jsxs("button",{type:"button",onClick:()=>u(g=>!g),className:Sf,style:{minWidth:o},children:[i.jsx("span",{children:e}),p>0&&i.jsx("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1.5 rounded-full bg-brand text-white text-[11px] font-bold leading-none",children:p}),i.jsx(Ca,{className:`w-4 h-4 text-slate-400 ml-auto transition-transform ${l?"rotate-180":""}`})]}),l&&i.jsx("div",{className:"absolute z-20 mt-2 w-full min-w-[240px] max-h-64 overflow-auto rounded-lg border border-border bg-surface shadow-card py-1",children:h.length===0?i.jsx("div",{className:"px-3 py-2 text-sm text-slate-500",children:s}):h.map(g=>{const x=g.id.toString(),y=n.includes(x),w=g.status!=="active";return i.jsxs("button",{type:"button",disabled:w,onClick:()=>r(Lg(n,x)),className:`w-full flex items-center gap-2.5 px-3 py-2 text-sm text-left transition-colors ${w?"opacity-60 cursor-not-allowed":y?"bg-brand-soft text-brand font-medium":"text-slate-700 hover:bg-slate-100"}`,children:[i.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border shrink-0 ${y?"bg-brand border-brand text-white":"border-slate-300"}`,children:y&&i.jsx(Zt,{className:"w-3 h-3"})}),i.jsx("span",{className:"truncate flex-1",children:g.title}),g.status&&g.status!=="active"&&i.jsx("span",{className:`shrink-0 text-[10px] font-semibold px-2 py-0.5 rounded-full ${uwe(g.status)}`,children:dwe(g.status)})]},x)})})]})}const hwe=[{key:"date",label:"Date",type:"fixed"},{key:"amount",label:"Amount",type:"fixed"},{key:"primary_account",label:"Primary Account",type:"active"}],pwe=[{key:"account_name",label:"Account",type:"active"},{key:"name",label:"Name",type:"active"},{key:"merchant_name",label:"Merchant",type:"active"},{key:"mask",label:"Account - Last 4",type:"active"},{key:"category",label:"Category",type:"active"},{key:"sub_category",label:"Sub Category",type:"active"}],mwe=[{key:"transaction_id",label:"Transaction ID",type:"available"},{key:"iso_currency_code",label:"Currency",type:"available"},{key:"country",label:"Country",type:"available"},{key:"state",label:"State",type:"available"},{key:"city",label:"City",type:"available"},{key:"payment_channel",label:"Payment Channel",type:"available"},{key:"authorized_date",label:"Auth Date",type:"available"},{key:"payment_reference_number",label:"Reference #",type:"available"},{key:"payment_payee",label:"Payee",type:"available"}];function gwe(){const{visibleColumns:e,setVisibleColumns:t}=$n(),n=r=>{r.type!=="fixed"&&t(a=>a.includes(r.key)?a.filter(o=>o!==r.key):[...a,r.key])};return i.jsx(bH,{color:"light",label:i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-900",children:[i.jsx(VU,{className:"w-[15px] h-[15px]"}),"Edit Columns"]}),theme:{floating:{target:"border border-border bg-surface hover:bg-slate-100 rounded-lg"}},dismissOnClick:!1,className:"w-72",children:i.jsxs("div",{className:"p-4 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Fixed columns"}),i.jsx("div",{className:"space-y-2",children:hwe.map(r=>i.jsxs("div",{className:"flex items-center",children:[i.jsx(Nm,{checked:!0,disabled:!0,className:"mr-2"}),i.jsx("span",{className:"text-sm text-gray-600",children:r.label})]},r.key))})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Active columns"}),i.jsx("div",{className:"space-y-2",children:pwe.map(r=>i.jsxs("div",{className:"flex items-center",children:[i.jsx(Nm,{checked:e.includes(r.key),onChange:()=>n(r),className:"mr-2"}),i.jsx("span",{className:"text-sm text-gray-600",children:r.label})]},r.key))})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Available columns"}),i.jsx("div",{className:"space-y-2",children:mwe.map(r=>i.jsxs("div",{className:"flex items-center",children:[i.jsx(Nm,{checked:e.includes(r.key),onChange:()=>n(r),className:"mr-2"}),i.jsx("span",{className:"text-sm text-gray-600",children:r.label})]},r.key))})]})]})})}const dW=e=>
491({...Hf(),startDate:e.startDate,endDate:e.endDate,accountIds:e.accountIds});function I6({filters:e,onChange:t,accounts:n,shownCount:r,totalCount:a,summary:s}){const o=new Map(n.map(u=>[String(u.id),u.title||u.name])),l=pA(e,o);return i.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-2.5 lg:mt-3 lg:pt-3 lg:border-t lg:border-dashed lg:border-border",children:[l.length>0&&i.jsxs("div",{className:"flex items-center gap-1.5 w-full overflow-x-auto whitespace-nowrap lg:contents",children:[l.map(u=>i.jsxs("button",{type:"button",onClick:()=>t(Ibe(e,u)),className:"inline-flex flex-none items-center gap-1.5 rounded-full px-2.5 py-1 text-[11.5px] font-semibold bg-brand-soft text-brand",children:[u.label,i.jsx(Ut,{className:"w-3 h-3"})]},`${u.key}:${u.value??""}`)),i.jsx("button",{type:"button",onClick:()=>t(dW(e)),className:"flex-none text-[11.5px] font-semibold text-slate-500 underline",children:"Clear all"})]}),i.jsxs("span",{className:"w-full lg:w-auto lg:ml-auto text-[11.5px] text-slate-500 tabular-nums",children:["Showing ",i.jsx("b",{className:"text-slate-900",children:r})," of ",a," · out"," ",i.jsx("b",{className:"text-amount-neg",children:Ee(-s.moneyOut,s.currency)})," · in"," ",i.jsx("b",{className:"text-amount-pos",children:ge(s.moneyIn,s.currency)})]})]})}const L6="h-[26px] px-1 bg-transparent text-sm text-slate-700 outline-none focus:text-slate-900 [color-scheme:light]";function fW({filters:e,onChange:t,accounts:n,categories:r,merchants:a,channels:s,shownCount:o,totalCount:l,summary:u,showStatus:d=!0,trailing:h=i.jsx(gwe,{}),countFor:p,noun:g="transactions"}){const x=Ms(),[y,w]=v.useState(!1),j=k=>t({...e,...k}),N=v.useMemo(()=>hve({accounts:Wy(n).map(k=>({id:String(k.id),title:k.title||k.name})),categories:r,merchants:a,channels:s},{showStatus:d}),[n,r,a,s,d]);return x?i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card p-4 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[i.jsx(Jy,{value:e.search,onChange:k=>j({search:k}),placeholder:"Search merchant, name, amountâ¦"}),i.jsx(fwe,{label:"Accounts",options:Wy(n),selectedValues:e.accountIds,onChange:k=>j({accountIds:k}),placeholder:"All accounts",minWidth:170}),i.jsxs("span",{className:`${Sf} gap-1.5`,children:[i.jsx("input",{type:"date","aria-label":"Start date",value:e.startDate,onChange:k=>{k.target.value&&j({startDate:k.target.value})},className:L6}),i.jsx("span",{className:"text-slate-400",children:"â"}),i.jsx("input",{type:"date","aria-label":"End date",value:e.endDate,onChange:k=>{k.target.value&&j({endDate:k.target.value})},className:L6})]}),r.length>0&&i.jsx(ko,{label:"Category",options:r,selectedValues:e.categories,onChange:k=>j({categories:k}),placeholder:"All categories",minWidth:150}),a.length>0&&i.jsx(ko,{label:"Merchant",options:a,selectedValues:e.merchants,onChange:k=>j({merchants:k}),placeholder:"All merchants",minWidth:150}),s.length>0&&i.jsx(ko,{label:"Channel",options:s,selectedValues:e.channels,onChange:k=>j({channels:k}),placeholder:"All channels",minWidth:140}),i.jsxs("span",{className:`${Sf} gap-1.5`,children:[i.jsx("span",{className:"text-slate-500",children:"Amount"}),i.jsx("input",{type:"number",inputMode:"decimal","aria-label":"Min amount",placeholder:"min",value:e.minAmount,onChange:k=>j({minAmount:k.target.value}),className:"w-[58px] h-[26px] px-1 bg-transparent text-sm text-slate-900 outline-none placeholder:text-slate-400"}),i.jsx("span",{className:"text-slate-400",children:"â"}),i.jsx("input",{type:"number",inputMode:"decimal","aria-label":"Max amount",placeholder:"max",value:e.maxAmount,onChange:k=>j({maxAmount:k.target.value}),className:"w-[58px] h-[26px] px-1 bg-transparent text-sm text-slate-900 outline-none placeholder:text-slate-400"})]}),d&&i.jsxs("span",{className:`${Sf} relative gap-1.5`,children:[i.jsx("select",{"aria-label":"Document status",value:e.status,onChange:k=>{const S=k.target.value;D1(S)&&j({status:S})},className:"h-[26px] bg-transparent text-sm font-medium text-slate-700 outline-none appearance-none pr-1 cursor-pointer",children:UV.map(k=>i.jsx("option",{value:k.value,children:k.label},k.value))}),i.jsx(Ca,{className:"w-3.5 h-3.5 text-slate-500 pointer-events-none"})]}),h&&i.jsx("div",{className:"ml-auto",children:h})]}),i.jsx(I6,{filters:e,onChange:t,accounts:n,shownCount:o,totalCount:l,summary:u})]}):i.jsxs("div",{className:"mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx(Jy,{value:e.search,onChange:k=>j({search:k}),placeholder:"Search merchant, name, amountâ¦"})}),i.jsx(EG,{activeCount:pA(e).length,onClick:()=>w(!0)})]}),i.jsx(I6,{filters:e,onChange:t,accounts:n,shownCount:o,totalCount:l,summary:u}),i.jsx(CG,{isOpen:y,onClose:()=>w(!1),value:e,sections:N,onApply:t,cleared:dW,countFor:p??(()=>o),noun:g})]})}function xwe(){return i.jsxs("div",{"aria-label":"Transaction list columns",className:"hidden lg:flex items-center gap-3 px-[18px] py-2.5 bg-surface-2 border-b border-border text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:[i.jsx("span",{className:"w-[84px] flex-none",children:"Date"}),i.jsx("span",{className:"w-[64px] flex-none","aria-hidden":"true"}),i.jsx("span",{className:"flex-1 min-w-0",children:"Merchant · account · category"}),i.jsx("span",{className:"w-[188px] flex-none text-right",children:"Document"}),i.jsx("span",{className:"w-[130px] flex-none text-right",children:"Amount"})]})}const Rk=50;function bwe(){const{rows:e,filtered:t,matchesResolved:n,accounts:r,filters:a,onFiltersChange:s,onSelectTransaction:o}=zA(),[l,u]=v.useState(1),d=v.useMemo(()=>HV(e),[e]),h=v.useMemo(()=>Wm(e.map(k=>br(k))),[e]),p=v.useMemo(()=>Wm(e.map(k=>k.payment_channel)),[e]),g=v.useCallback(k=>pu(e,k,n).length,[e,n]),x=v.useMemo(()=>Xl(t),[t]),y=Math.max(1,Math.ceil(t.length/Rk)),w=Math.min(l,y),j=v.useMemo(()=>t.slice((w-1)*Rk,w*Rk),[t,w]),N=v.useMemo(()=>Xl(j),[j]);return i.jsxs(i.Fragment,{children:[i.jsx(fW,{filters:a,onChange:k=>{u(1),s(k)},accounts:r,categories:d,merchants:h,channels:p,shownCount:t.length,totalCount:e.length,summary:x,countFor:g}),i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx(xwe,{}),j.length===0?i.jsxs("div",{className:"px-6 py-12 text-center",children:[i.jsx(rc,{className:"w-10 h-10 mx-auto mb-3 text-slate-300"}),i.jsx("p",{className:"text-[15px] font-semibold text-slate-900",children:"No transactions match these filters"}),i.jsxs("p",{className:"text-sm text-slate-500 mt-1",children:[e.length," transaction",e.length===1?"":"s"," were loaded for this window â widen the filters to
491see them."]})]}):j.map(k=>i.jsx(cW,{row:k,matchesResolved:n,onSelect:o},k.transaction_id)),i.jsxs("div",{className:"flex items-center justify-between gap-x-4 gap-y-1.5 lg:gap-y-4 flex-wrap px-3.5 lg:px-[18px] py-2.5 lg:py-3 bg-surface-2 border-t border-border text-xs lg:text-[12.5px] text-slate-500",children:[i.jsxs("div",{className:"contents lg:flex gap-4 tabular-nums flex-wrap",children:[i.jsxs("span",{className:"order-1 lg:order-none",children:["Page total"," ",i.jsx("b",{className:"text-slate-900",children:Ee(N.net,N.currency)})]}),i.jsxs("span",{className:"order-3 lg:order-none w-full lg:w-auto flex gap-4 lg:contents",children:[i.jsxs("span",{children:["Filtered total"," ",i.jsx("b",{className:"text-slate-900",children:Ee(x.net,x.currency)})]}),i.jsxs("span",{children:["Rows ",i.jsx("b",{className:"text-slate-900",children:t.length})]})]})]}),i.jsxs("div",{className:"order-2 lg:order-none flex items-center gap-1.5 lg:gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>u(k=>Math.max(1,k-1)),disabled:w===1,className:"min-h-[42px] lg:min-h-0 px-3 lg:px-2.5 py-1 rounded-lg border border-border bg-surface text-slate-600 font-semibold disabled:opacity-40",children:[i.jsx("span",{className:"lg:hidden",children:"Prev"}),i.jsx("span",{className:"hidden lg:inline",children:"Previous"})]}),i.jsxs("span",{className:"tabular-nums",children:[i.jsxs("span",{className:"hidden lg:inline",children:["Page ",w," of ",y]}),i.jsxs("span",{className:"lg:hidden",children:[w," / ",y]})]}),i.jsx("button",{type:"button",onClick:()=>u(k=>Math.min(y,k+1)),disabled:w===y,className:"min-h-[42px] lg:min-h-0 px-3 lg:px-2.5 py-1 rounded-lg border border-border bg-surface text-slate-600 font-semibold disabled:opacity-40",children:"Next"})]})]})]})]})}function ywe({row:e,isSelected:t,onSelect:n}){const{data:r,isFetching:a}=RA(e,t),s=r?.[0],o=br(e);return i.jsxs("button",{type:"button","aria-current":t,onClick:()=>n(e),className:`w-full flex items-center gap-2.5 lg:gap-3 px-3.5 lg:px-4 py-3 border-b border-border last:border-b-0 text-left border-l-[3px] transition-colors ${t?"bg-brand-soft border-l-brand":"border-l-transparent hover:bg-surface-2"}`,children:[i.jsx(Es,{name:o,className:"w-[30px] h-[30px] rounded-lg"}),i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:o}),i.jsxs("span",{className:"flex items-center gap-[7px] flex-wrap text-[11.5px] text-slate-500 mt-0.5",children:[i.jsxs("span",{children:[Ue(String(e.date??"").slice(0,10))," · ",e.account_name,e.mask?` â¢â¢${e.mask}`:""]}),e.category&&i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:e.category})]})]}),t&&i.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-bold whitespace-nowrap ${s?K1(s.confidence_score):"bg-surface-muted text-slate-500"}`,children:a&&!r?"Lookingâ¦":s?`${s.confidence_score}%`:"No candidate"}),i.jsx("span",{className:"w-[92px] flex-none text-right text-[14px] font-bold tabular-nums text-amount-neg",children:Ee(e.amount,e.iso_currency_code)})]})}const r0=e=>console.info(`[NeedsReceiptTab] ${e}`),a0=({children:e})=>i.jsx("kbd",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 rounded-[5px] border border-border bg-surface text-[10.5px] font-bold text-slate-500",children:e});function vwe(){const{rows:e,matchesResolved:t,filters:n,onAttachDocument:r}=zA(),{accept:a,acceptingId:s,acceptingReceiptId:o,error:l}=nW(),u=Ms(),[d,h]=v.useState(null),[p,g]=v.useState(!1),[x,y]=v.useState({}),w=v.useMemo(()=>pu(e,{...n,status:"all"},t),[e,n,t]),j=v.useMemo(()=>pu(e,{...n,status:"needs-receipt"},t).sort(($,K)=>Math.abs(Number(K.amount))-Math.abs(Number($.amount))),[e,n,t]),N=v.useMemo(()=>Xl(j),[j]),k=v.useMemo(()=>wA(w,t),[w,t]),S=v.useMemo(()=>j.find($=>$.transaction_id===d)??j[0]??null,[j,d]),E=RA(S,!!S),O=v.useMemo(()=>{const $=S?x[S.transaction_id]??[]:[];return(E.data??[]).filter(K=>!$.includes(K.receiptId))},[E.data,x,S]),T=v.useCallback($=>{if(!S||j.length===0)return;const K=j.findIndex(W=>W.transaction_id===S.transaction_id),G=j[Math.min(Math.max(K+$,0),j.length-1)];h(G.transaction_id)},[j,S]),P=v.useCallback(($,K)=>{y(G=>({...G,[$]:[...G[$]??[],K]}))},[]),M=O[0]??null,D=v.useCallback($=>{h($.transaction_id),!u&&(r0(`opened candidates for ${$.transaction_id} in a sheet`),g(!0))},[u]),A=v.useCallback(()=>{r0(`closed the candidate sheet for ${d??"no transaction"}`),g(!1)},[d]);v.useEffect(()=>{!p||!d||j.some($=>$.transaction_id===d)||(r0(`closed the candidate sheet: ${d} left the queue`),g(!1))},[j,d,p]),v.useEffect(()=>{!u||!p||(r0("closed the candidate sheet: the viewport reached the desktop layout, which shows the pane inline"),g(!1))},[u,p]),v.useEffect(()=>{const $=K=>{const G=K.target;if(G&&/^(INPUT|TEXTAREA|SELECT)$/.test(G.tagName)||K.metaKey||K.ctrlKey||K.altKey||K.repeat)return;const W=K.key.toLowerCase();if(W==="j")T(1);else if(W==="k")T(-1);else if(W==="a"&&S&&M&&!s)K.preventDefault(),a(S,M);else if(W==="x"&&S&&M)P(S.transaction_id,M.receiptId);else return};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[a,s,M,P,S,T]);const L=$=>i.jsxs("header",{className:"flex items-center gap-3 p-3.5 lg:p-[18px] border-b border-border",children:[i.jsx(Es,{name:br($),className:"w-[42px] h-[42px] rounded-[11px] text-sm"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"text-[17px] font-extrabold tracking-tight text-slate-900 truncate",children:br($)}),i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5 truncate",children:[$.name," · ",Ue(String($.date??"").slice(0,10))," ·"," ",$.account_name]})]}),i.jsxs("div",{className:"text-right flex-none",children:[i.jsx("b",{className:"text-xl lg:text-2xl font-extrabold tabular-nums text-amount-neg",children:Ee($.amount,$.iso_currency_code)}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 mt-0.5",children:$.category||"Uncategorised"})]})]}),F=$=>i.jsxs("div",{className:"overflow-auto flex-1 min-h-0 p-3.5 lg:p-[18px]",children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:["Candidate documents · ",O.length]}),E.isFetching&&!E.data?i.jsxs("p",{className:"flex items-center gap-2 text-[12.5px] text-slate-500",children:[i.jsx(Dt,{size:"sm"}),"Looking for a matching documentâ¦"]}):E.isError?i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"Suggestions are unavailable right now."}):O.length===0?i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"No document in your library looks like this transaction."}):O.map((K,G)=>i.jsx(tW,{candidate:K,isBest:G===0,isAccepting:s===$.transaction_id&&o===K.receiptId,showShortcuts:!0,onAccept:()=>a($,K),onDismiss:()=>P($.transaction_id,K.receiptId)},K.receiptId)),i.jsxs("div",{className:"flex gap-2 flex-wrap mt-2",children:[i.jsxs("button",{type:"button",onClick:()=>r($),className:"inline-flex items-center gap-1.5 font-semibold px-2.5 py-1.5 min-h-[42px] lg:min-h-0 rounded-lg border border-border bg-surface text-slate-700 text-[12.5px]",children:[i.jsx(Qs,{className:"w-3.5 h-3.5"}),"Attach a document"]}),i.jsxs("button",{type:"button",onClick:()=>T(1),className:"inline-flex items-center gap-1.5 font-semibold px-2.5 py-1.5 min-h-[42px] lg:min-h-0 rounded-lg border border-border bg-surface text-slate-700 text-[12.5px]",children:[i.jsx(uh,{className:"w-3.5 h-3.5"}),"Skip to the next one"]})]})]});if(!t)return i.jsxs("div",{className:"flex items-center gap-3.5 rounded-xl border border-border bg-surface shadow-card px-[18px] py-4",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-surface-muted text-slate-500 flex items-center justify-center flex-none",children:i.jsx(Jt,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-bold text-slate-900",children:"Document status is unavailable"}),i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-0.5",children:[e.length," transaction",e.length===1?"":"s"," loaded, but the document lookup failed â none of them can be reported as missing a document until it succeeds. Refresh to try again."]})]})]});const B=k.matched,U=k.eligible,z=U>0?Math.round(B/U*100):0;return i.jsxs("div",{className:"lg:h-full flex flex-col min-h-0",children:[i.jsxs("div",{className:"flex items-center gap-3.5 rounded-xl border border-amber-200 bg-amber-50 px-[18px] py-3.5 mb-4 flex-none",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-badge-yellow text-badge-yellow-text flex items-center justify-center flex-none",children:j.length>0?i.jsx(Jt,{className:"w-[15px] h-[15px]"}):i.jsx(Zt,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"text-sm font-bold text-slate-900",children:j.length>0?`${j.length} transaction${j.length===1?" still needs":"s still need"} a document â ${Ee(-N.moneyOut,N.currency)} of spend`:"Every transaction in this window has its document"}),i.jsx("p",{className:"text-[12.5px] text-amber-800 mt-0.5",children:j.length>0?"Pick a transaction, then accept the document Moneylogz already holds or upload a new one.":"Nothing to re
491concile here â income, transfers and fees never need one."})]}),j.length>0&&i.jsxs("p",{className:"hidden lg:flex text-[11.5px] text-amber-800 items-center gap-1.5 flex-none",children:[i.jsx(a0,{children:"J"}),i.jsx(a0,{children:"K"})," move · ",i.jsx(a0,{children:"A"})," accept · ",i.jsx(a0,{children:"X"})," skip"]})]}),l&&i.jsxs("div",{className:"rounded-xl border border-red-200 bg-surface px-[18px] py-3 mb-4 text-[12.5px] text-badge-red-text flex-none",children:["The document could not be attached: ",l]}),j.length===0?i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-12 text-center",children:[i.jsx(ri,{className:"w-10 h-10 mx-auto mb-3 text-slate-300"}),i.jsx("p",{className:"text-[15px] font-semibold text-slate-900",children:"Nothing is waiting for a document"}),i.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Every transaction in this window is matched or does not need a document."})]}):i.jsxs("div",{className:"lg:flex-1 grid grid-cols-1 xl:grid-cols-[minmax(0,1fr)_minmax(0,1.05fr)] gap-4 min-h-0",children:[i.jsxs("section",{"aria-label":"Unmatched queue",className:"rounded-xl border border-border bg-surface shadow-card flex flex-col overflow-hidden min-h-0",children:[i.jsxs("header",{className:"flex items-center gap-2.5 px-4 py-3 bg-surface-2 border-b border-border",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("h2",{className:"text-[13.5px] font-extrabold tracking-tight text-slate-900",children:"Unmatched queue"}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-px",children:"Sorted by amount · highest first"})]}),i.jsxs("span",{className:"inline-flex rounded-full px-2.5 py-1 text-[11px] font-bold bg-surface-muted text-slate-600",children:[j.length," left"]})]}),i.jsx("div",{className:"overflow-auto flex-1 min-h-0",children:j.map($=>i.jsx(ywe,{row:$,isSelected:S?.transaction_id===$.transaction_id,onSelect:D},$.transaction_id))}),i.jsxs("div",{className:"flex items-center gap-2.5 px-[18px] py-3 border-t border-border bg-surface-2",children:[i.jsxs("span",{className:"text-[12px] font-bold text-slate-600 tabular-nums",children:[B," of ",U," reconciled"]}),i.jsx("span",{className:"flex-1 h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full bg-amount-pos",style:{width:`${z}%`}})}),i.jsxs("span",{className:"text-[12px] text-slate-500 tabular-nums",children:[z,"%"]})]})]}),S&&u&&i.jsxs("section",{"aria-label":"Candidate documents",className:"rounded-xl border border-border bg-surface shadow-card flex flex-col overflow-hidden min-h-0",children:[L(S),F(S)]})]}),!u&&S&&i.jsx(Wu,{isOpen:p,onClose:A,label:"Candidate documents",size:"tall",bodyClassName:"flex flex-col",header:i.jsx("div",{className:"flex-none",children:L(S)}),children:F(S)})]})}function F6({variant:e="popover"}){const{visibleCharts:t,setVisibleCharts:n}=$n(),r=e==="sheet",a=s=>{n(o=>Lg(o,s.key))};return i.jsxs("div",{className:r?"space-y-2":"p-4 space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center border-b border-border pb-2",children:[i.jsx("h3",{className:"text-sm font-medium text-slate-700",children:bue(t)}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:()=>n(ff()),className:`text-xs text-brand hover:text-brand-hover ${r?"min-h-[42px] px-2 font-semibold":""}`,children:"All"}),i.jsx("button",{type:"button",onClick:()=>n([]),className:`text-xs text-slate-500 hover:text-slate-700 ${r?"min-h-[42px] px-2 font-semibold":""}`,children:"None"})]})]}),i.jsx("div",{className:r?"":"space-y-2 max-h-64 overflow-y-auto",children:Ng.map(s=>{const o=s.icon;return i.jsxs("label",{className:`flex items-center cursor-pointer ${r?"min-h-[44px] border-b border-border last:border-b-0":""}`,children:[i.jsx(Nm,{checked:t.includes(s.key),onChange:()=>a(s),className:"mr-3"}),i.jsxs("span",{className:"text-sm text-slate-600 flex items-center gap-2",children:[i.jsx(o,{className:"w-4 h-4 text-slate-400"}),s.label]})]},s.key)})})]})}function wwe({mobileTriggerClassName:e=""}){const t=Ms(),[n,r]=v.useState(!1);return t?i.jsx(bH,{color:"light",label:i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-900",children:[i.jsx(IS,{className:"w-[15px] h-[15px]"}),"Edit charts"]}),theme:{floating:{target:"border border-border bg-surface hover:bg-slate-100 rounded-lg"}},dismissOnClick:!1,className:"w-80",children:i.jsx(F6,{})}):i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button","aria-label":"Edit charts",title:"Edit charts",onClick:()=>r(!0),className:`w-[42px] h-[42px] inline-flex items-center justify-center rounded-lg border border-border bg-surface text-slate-700 hover:bg-slate-100 ${e}`,children:i.jsx(IS,{className:"w-[18px] h-[18px]","aria-hidden":"true"})}),i.jsx(Wu,{isOpen:n,onClose:()=>r(!1),label:"Edit charts",title:"Edit charts",size:"auto",children:i.jsx(F6,{variant:"sheet"})})]})}function jwe({range:e,onRangeChange:t,startDate:n,endDate:r,onFetch:a,isLoading:s}){return i.jsxs(Vu,{title:"Analytics",subtitle:"Spending, income and where the money goes across your accounts.",children:[i.jsx(gA,{value:e,onCh
491ange:t,label:"Analytics date range",className:"col-span-2 w-full lg:w-auto"}),i.jsxs("span",{className:"inline-flex items-center gap-2 font-semibold min-h-[42px] lg:min-h-0 px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-600 text-sm tabular-nums",children:[Ue(n)," â ",Ue(r)]}),i.jsx(wwe,{mobileTriggerClassName:"order-last col-span-2 justify-self-end"}),i.jsxs("button",{type:"button",onClick:a,disabled:s,className:"inline-flex items-center gap-2 font-semibold min-h-[42px] lg:min-h-0 px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50",children:[i.jsx(dt,{className:`h-[15px] w-[15px] ${s?"animate-spin":""}`}),s?"Getting transactions...":"Get transactions"]})]})}function Nwe({insights:e,onTogglePending:t,onCurrencyChange:n}){const{summary:r,currency:a,currencies:s,pending:o,previousNet:l,days:u,average:d,busiest:h,depositCount:p,rows:g}=e,x=g.length,y=x===0,w=o.included&&o.count>0;return i.jsxs(wh,{className:"mb-4",children:[i.jsxs(On,{label:`Money out${a?` · ${a}`:""}`,children:[i.jsx("p",{className:`text-2xl font-extrabold tracking-tight mt-1.5 ${y?"text-slate-400":"text-amount-neg"}`,children:y?je:Ee(-r.moneyOut,a)}),i.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:y?"no transactions match":`${x} transaction${x===1?"":"s"}${w?` · incl. ${o.count} pending`:""}`})]}),i.jsxs(On,{label:"Money in",children:[i.jsx("p",{className:`text-2xl font-extrabold tracking-tight mt-1.5 ${y?"text-slate-400":"text-amount-pos"}`,children:y?je:ge(r.moneyIn,a)}),i.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:y?"no deposits match":`${p} deposit${p===1?"":"s"}`})]}),i.jsxs(On,{label:"Net flow",children:[i.jsx("p",{className:`text-2xl font-extrabold tracking-tight mt-1.5 ${y?"text-slate-400":"text-slate-900"}`,children:y?je:Ee(r.net,a)}),i.jsx("p",{className:"text-xs text-slate-500 mt-0.5 tabular-nums",children:y?"nothing to compare":l!==null?`vs ${Ee(l,a)} last period`:"no comparison available"})]}),i.jsxs(On,{label:"Daily average",children:[i.jsx("p",{className:`text-2xl font-extrabold tracking-tight mt-1.5 ${y?"text-slate-400":"text-amount-neg"}`,children:y?je:Ee(-d,a)}),i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:["over ",u," day",u===1?"":"s",h?` · busiest ${Ue(h.date)}`:""]})]}),o.count>0&&(t?i.jsxs("button",{type:"button","aria-pressed":o.included,onClick:t,title:o.included?"Pending transactions are counted in every figure. Their amounts can still change when they post.":"Count pending transactions in every figure, as if they had already posted.",className:`inline-flex items-center gap-1.5 text-[11px] font-bold rounded-full px-2.5 py-1 self-center flex-none transition-colors ${o.included?"bg-brand text-white":"bg-badge-blue text-badge-blue-text hover:bg-blue-200"}`,children:[i.jsx(xr,{className:"w-3 h-3"}),o.count," pending",i.jsx("span",{className:"font-semibold opacity-80",children:o.included?" · counted":" · count them"})]}):i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-bold rounded-full px-2.5 py-1 bg-badge-blue text-badge-blue-text self-center flex-none",children:[i.jsx(xr,{className:"w-3 h-3"}),o.count," pending"]})),s.length>1&&n?i.jsx("div",{role:"group","aria-label":"Currency",className:"flex flex-none gap-0.5 border border-border rounded-lg p-[3px] bg-surface self-center",children:s.map(j=>i.jsxs("button",{type:"button","aria-pressed":j.currency===a,onClick:()=>n(j.currency),className:`px-2.5 py-1 rounded-md text-xs font-semibold tabular-nums transition-colors ${j.currency===a?"bg-surface-muted text-slate-900":"text-slate-500 hover:text-slate-900"}`,children:[j.currency," · ",j.count]},j.currency))}):r.otherCurrencyCount>0&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-bold rounded-full px-2.5 py-1 bg-surface-muted text-slate-600 self-center flex-none",children:[i.jsx(na,{className:"w-3 h-3"}),r.otherCurrencyCount," not counted"]})]})}const Mk=e=>`w-7 h-7 rounded-md flex items-center justify-center transition-colors ${e?"bg-surface-muted text-slate-900":"text-slate-500 hover:text-slate-900"}`;
491function _we({title:e,subtitle:t,icon:n,view:r,onViewChange:a,onExpand:s,children:o}){return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card flex flex-col",children:[i.jsxs("div",{className:"flex items-center gap-2.5 px-[18px] py-3.5 border-b border-border",children:[i.jsx("span",{className:"w-[26px] h-[26px] rounded-[7px] bg-brand-soft text-brand flex items-center justify-center flex-none",children:i.jsx(n,{className:"w-[15px] h-[15px]"})}),i.jsx("h2",{className:"text-[14.5px] font-extrabold tracking-tight text-slate-900 min-w-0 truncate lg:overflow-visible lg:whitespace-normal",children:e}),t&&i.jsx("span",{className:"text-[12px] text-slate-500 font-medium min-w-0 truncate lg:overflow-visible lg:whitespace-normal",children:t}),i.jsxs("div",{className:"ml-auto flex items-center gap-0.5 flex-none",children:[r&&a&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button","aria-label":`Show ${e} as a chart`,"aria-pressed":r==="chart",onClick:()=>a("chart"),className:Mk(r==="chart"),children:i.jsx(Bo,{className:"w-[15px] h-[15px]"})}),i.jsx("button",{type:"button","aria-label":`Show ${e} as a table`,"aria-pressed":r==="table",onClick:()=>a("table"),className:Mk(r==="table"),children:i.jsx(Kce,{className:"w-[15px] h-[15px]"})})]}),s&&i.jsx("button",{type:"button","aria-label":`Expand ${e}`,onClick:s,className:`${Mk(!1)} ml-1.5`,children:i.jsx(Kle,{className:"w-[15px] h-[15px]"})})]})]}),i.jsx("div",{className:"px-[18px] pt-4 pb-3.5 flex-1",children:o})]})}const z6=({children:e})=>i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-3 pt-2.5 border-t border-border leading-relaxed",children:e}),kwe=100;function hW({columns:e,rows:t,caption:n,maxHeight:r="none",pageSize:a=kwe}){const[s,o]=v.useState(a);v.useEffect(()=>{o(a),t.length>a&&console.log(`[ChartTable] "${n}" rendering ${a} of ${t.length} rows (${t.length-a} behind the reveal button)`)},[t,a,n]);const l=s>=t.length?t:t.slice(0,s),u=t.length-l.length,d=()=>{const h=Math.min(s+a,t.length);console.log(`[ChartTable] "${n}" revealing rows ${s}â${h} of ${t.length}`),o(h)};return i.jsxs("div",{className:"overflow-auto -mx-[18px]",style:{maxHeight:r},children:[i.jsxs("table",{className:"w-full border-collapse text-[13px]",children:[i.jsx("caption",{className:"sr-only",children:n}),i.jsx("thead",{children:i.jsx("tr",{children:e.map(h=>i.jsx("th",{scope:"col",className:`sticky top-0 bg-surface px-[18px] py-2.5 border-b border-border text-[10.5px] font-bold uppercase tracking-[0.08em] text-slate-400 ${h.align==="right"?"text-right":"text-left"}`,children:h.label},h.key))})}),i.jsx("tbody",{children:l.map(h=>i.jsx("tr",{className:h.emphasis?"bg-brand-soft":void 0,children:h.cells.map((p,g)=>i.jsx("td",{className:`px-[18px] py-2.5 border-b border-border last:border-b-0 ${e[g]?.align==="right"?"text-right tabular-nums font-bold text-slate-900":"text-slate-700"}`,children:p},e[g]?.key??g))},h.key))})]}),u>0&&i.jsxs("div",{className:"px-[18px] py-2.5 flex items-center gap-3 text-[12px] text-slate-500",children:[i.jsx("button",{type:"button",onClick:d,className:"font-semibold px-3 py-1.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 text-[12.5px]",children:`Show ${Math.min(a,u)} more`}),i.jsx("span",{"aria-live":"polite",children:`${l.length} of ${t.length} rows`})]})]})}const Swe="/accounts",B6="overview",Cwe=[{path:"overview",label:"Overview",icon:Bo},{path:"all",label:"All accounts",icon:ac},{path:"connections",label:"Connections",icon:Jt}],G1=e=>`${Swe}/${e}`,Z0="id",XBe=e=>`${G1("all")}?${Z0}=${encodeURIComponent(e)}`,Gd=e=>`px-[18px] py-2.5 border-b border-border bg-surface-2 text-[10.5px] font-bold uppercase tracking-[0.08em] text-slate-400 ${e==="right"?"text-right":"text-left"}`;function Ewe({totals:e,currency:t,accounts:n,accountErrors:r,accountCount:a}){const s=r.length>0?rW(r,n):null,o=Math.max(a-r.length,0);return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card flex flex-col",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 px-[18px] py-3.5 border-b border-border",children:[i.jsx("span",{className:"w-[26px] h-[26px] rounded-[7px] bg-brand-soft text-brand flex items-center justify-center flex-none",children:i.jsx(ea,{className:"w-[15px] h-[15px]"})}),i.jsx("h2",{className:"text-[14.5px] font-extrabold tracking-tight text-slate-900",children:"By account"}),i.jsxs("span",{className:"text-[12px] text-slate-500 font-medium",children:[o," of ",a,"
491connection",a===1?"":"s"," read"]})]}),e.length===0?i.jsx("p",{className:"px-[18px] py-6 text-[12.5px] text-slate-500",children:"No account reported activity in this window."}):i.jsxs(i.Fragment,{children:[i.jsx("ul",{className:"lg:hidden","aria-label":"Accounts",children:e.map(l=>{const u=l.moneyIn>0,d=u?l.net:-l.moneyOut;return i.jsxs("li",{className:"flex items-center gap-3 px-4 py-3 border-b border-border last:border-b-0",children:[i.jsx(ra,{name:l.title,className:"w-8 h-8"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"text-[13.5px] font-semibold text-slate-900 truncate",children:l.subtitle??l.title}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 truncate",children:[l.title,l.mask?` ${An(l.mask)}`:""," · ",l.count," transaction",l.count===1?"":"s"]})]}),i.jsxs("div",{className:"flex-none text-right",children:[i.jsx("p",{className:`text-[13.5px] font-bold tabular-nums ${d<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(d,t)}),i.jsx("p",{className:"text-[11px] text-slate-500",children:u?"net":"out"})]})]},l.accountId)})}),i.jsx("div",{className:"hidden lg:block overflow-auto",children:i.jsxs("table",{className:"w-full border-collapse text-[13px]",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",className:Gd("left"),children:"Account"}),i.jsx("th",{scope:"col",className:Gd("right"),children:"Money out"}),i.jsx("th",{scope:"col",className:Gd("right"),children:"Money in"}),i.jsx("th",{scope:"col",className:Gd("right"),children:"Net"}),i.jsx("th",{scope:"col",className:Gd("left"),children:"Share of money out"}),i.jsx("th",{scope:"col",className:Gd("right"),children:"Transactions"})]})}),i.jsx("tbody",{children:e.map(l=>i.jsxs("tr",{children:[i.jsxs("td",{className:"px-[18px] py-3 border-b border-border last:border-b-0",children:[i.jsxs("p",{className:"font-semibold text-slate-900",children:[l.title,l.mask&&i.jsx("span",{className:"text-slate-400 ml-1.5",children:An(l.mask)})]}),l.subtitle&&i.jsx("p",{className:"text-[11.5px] text-slate-500",children:l.subtitle})]}),i.jsx("td",{className:"px-[18px] py-3 border-b border-border text-right tabular-nums font-bold text-amount-neg",children:l.moneyOut>0?Ee(-l.moneyOut,t):je}),i.jsx("td",{className:"px-[18px] py-3 border-b border-border text-right tabular-nums font-bold text-amount-pos",children:l.moneyIn>0?ge(l.moneyIn,t):je}),i.jsx("td",{className:`px-[18px] py-3 border-b border-border text-right tabular-nums font-bold ${l.net<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(l.net,t)}),i.jsx("td",{className:"px-[18px] py-3 border-b border-border",children:i.jsxs("span",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-[120px] h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full rounded-full bg-brand",style:{width:`${l.percent}%`}})}),i.jsxs("span",{className:"text-[12px] text-slate-500 tabular-nums",children:[l.percent,"%"]})]})}),i.jsx("td",{className:"px-[18px] py-3 border-b border-border text-right tabular-nums text-slate-700",children:l.count})]},l.accountId))})]})})]}),s&&i.jsxs("div",{className:"flex flex-wrap lg:flex-nowrap items-start gap-3 px-[18px] py-3 border-t border-border bg-surface-2 rounded-b-xl",children:[i.jsx("span",{className:"w-[26px] h-[26px] rounded-[7px] bg-badge-yellow text-badge-yellow-text flex items-center justify-center flex-none",children:i.jsx(Jt,{className:"w-[14px] h-[14px]"})}),i.jsxs("p",{className:"text-[11.5px] text-slate-600 leading-relaxed min-w-0 flex-1 lg:flex-initial",children:[i.jsxs("b",{className:"text-slate-900",children:[r.length," connection",r.length===1?"":"s"," could not be read."]})," ",s.detail,". Their transactions are missing from every figure on this screen, so the totals are lower than your real activity."]}),i.jsx(gt,{to:G1("connections"),className:"ml-auto flex-none text-[12px] font-bold text-brand whitespace-nowrap",children:"Reconnect on Accounts â"})]})]})}function pW(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=pW(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xe(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=pW(e))&&(r&&(r+=" "),r+=t);return r}var Dk={},$k={},U6;function Owe(){return U6||(U6=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t}($k)),$k}var Ik={},q6;function mW(){return q6||(q6=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t}(Ik)),Ik}var Lk={},H6;function gW(){return H6||(H6=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="string"||typeof n=="symbol"?n:Object.is(n?.valueOf?.(),-0)?"-0":String(n)}e.toKey=t}(Lk)),Lk}var Fk={},K6;function BA(){return K6||(K6=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){const r=[],a=n.length;if(a===0)return r;let s=0,o="",l="",u=!1;for(n.charCodeAt(0)===46&&(r.push(""),s++);s<a;){const d=n[s];l?d==="\\"&&s+1<a?(s++,o+=n[s]):d===l?l="":o+=d:u?d==='"'||d==="'"?l=d:d==="]"?(u=!1,r.push(o),o=""):o+=d:d==="["?(u=!0,o&&(r.push(o),o="")):d==="."?o&&(r.push(o),o=""):o+=d,s++}return o&&r.push(o),r}e.toPath=t}(Fk)),Fk}var V6;function UA(){return V6||(V6=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Owe(),n=mW(),r=gW(),a=BA();function s(l,u,d){if(l==null)return d;
491switch(typeof u){case"string":{if(t.isUnsafeProperty(u))return d;const h=l[u];return h===void 0?n.isDeepKey(u)?s(l,a.toPath(u),d):d:h}case"number":case"symbol":{typeof u=="number"&&(u=r.toKey(u));const h=l[u];return h===void 0?d:h}default:{if(Array.isArray(u))return o(l,u,d);if(Object.is(u?.valueOf(),-0)?u="-0":u=String(u),t.isUnsafeProperty(u))return d;const h=l[u];return h===void 0?d:h}}}function o(l,u,d){if(u.length===0)return d;let h=l;for(let p=0;p<u.length;p++){if(h==null||t.isUnsafeProperty(u[p]))return d;h=h[u[p]]}return h===void 0?d:h}e.get=s}(Dk)),Dk}var zk,G6;function Awe(){return G6||(G6=1,zk=UA().get),zk}var Twe=Awe();const Zl=ka(Twe);var Bk={exports:{}},wt={};/** @license React v16.13.1 492 * react-is.production.min.js 493 * 494 * Copyright (c) Facebook, Inc. and its affiliates. 495 * 496 * This source code is licensed under the MIT license found in the 497 * LICENSE file in the root directory of this source tree. 498 */var W6;function Pwe(){if(W6)return wt;W6=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,w=e?Symbol.for("react.block"):60121,j=e?Symbol.for("react.fundamental"):60117,N=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function S(O){if(typeof O=="object"&&O!==null){var T=O.$$typeof;switch(T){case t:switch(O=O.type,O){case u:case d:case r:case s:case a:case p:return O;default:switch(O=O&&O.$$typeof,O){case l:case h:case y:case x:case o:return O;default:return T}}case n:return T}}}function E(O){return S(O)===d}return wt.AsyncMode=u,wt.ConcurrentMode=d,wt.ContextConsumer=l,wt.ContextProvider=o,wt.Element=t,wt.ForwardRef=h,wt.Fragment=r,wt.Lazy=y,wt.Memo=x,wt.Portal=n,wt.Profiler=s,wt.StrictMode=a,wt.Suspense=p,wt.isAsyncMode=function(O){return E(O)||S(O)===u},wt.isConcurrentMode=E,wt.isContextConsumer=function(O){return S(O)===l},wt.isContextProvider=function(O){return S(O)===o},wt.isElement=function(O){return typeof O=="object"&&O!==null&&O.$$typeof===t},wt.isForwardRef=function(O){return S(O)===h},wt.isFragment=function(O){return S(O)===r},wt.isLazy=function(O){return S(O)===y},wt.isMemo=function(O){return S(O)===x},wt.isPortal=function(O){return S(O)===n},wt.isProfiler=function(O){return S(O)===s},wt.isStrictMode=function(O){return S(O)===a},wt.isSuspense=function(O){return S(O)===p},wt.isValidElementType=function(O){return typeof O=="string"||typeof O=="function"||O===r||O===d||O===s||O===a||O===p||O===g||typeof O=="object"&&O!==null&&(O.$$typeof===y||O.$$typeof===x||O.$$typeof===o||O.$$typeof===l||O.$$typeof===h||O.$$typeof===j||O.$$typeof===N||O.$$typeof===k||O.$$typeof===w)},wt.typeOf=S,wt}var Y6;function xW(){return Y6||(Y6=1,Bk.exports=Pwe()),Bk.exports}var Rwe=xW(),gr=e=>e===0?0:e>0?1:-1,Na=e=>typeof e=="number"&&e!=+e,eu=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Pe=e=>(typeof e=="number"||e instanceof Number)&&!Na(e),Os=e=>Pe(e)||typeof e=="string",Mwe=0,Jl=e=>{var t=++Mwe;return"".concat(e||"").concat(t)},ta=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Pe(t)&&typeof t!="string")return r;var s;if(eu(t)){if(n==null)return r;var o=t.indexOf("%");s=n*parseFloat(t.slice(0,o))/100}else s=+t;return Na(s)&&(s=r),a&&n!=null&&s>n&&(s=n),s},bW=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[e[r]])n[e[r]]=!0;else return!0;return!1},Ka=(e,t)=>Pe(e)&&Pe(t)?n=>e+n*(t-e):()=>t;function Wd(e,t,n){return Pe(e)&&Pe(t)?e+n*(t-e):t}function yW(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Zl(r,t))===n)}var Ct=e=>e===null||typeof e>"u",Fg=e=>Ct(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),Dwe=["viewBox","children"],$we=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRen
498dering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],X6=["points","pathLength"],Uk={svg:Dwe,polygon:X6,polyline:X6},qA=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDrag
498Capture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],HA=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(v.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(a=>{qA.includes(a)&&(r[a]=s=>n[a](n,s))}),r},Iwe=(e,t,n)=>r=>(e(t,n,r),null),W1=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(a=>{var s=e[a];qA.includes(a)&&typeof s=="function"&&(r||(r={}),r[a]=Iwe(s,t,n))}),r},Q6=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Z6=null,qk=null,vW=e=>{if(e===Z6&&Array.isArray(qk))return qk;var t=[];return v.Children.forEach(e,n=>{Ct(n)||(Rwe.isFragment(n)?t=t.concat(vW(n.props.children)):t.push(n))}),qk=t,Z6=e,t};function zg(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(a=>Q6(a)):r=[Q6(t)],vW(e).forEach(a=>{var s=Zl(a,"type.displayName")||Zl(a,"type.name");r.indexOf(s)!==-1&&n.push(a)}),n}var Y1=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,Lwe=(e,t,n,r)=>{var a,s=(a=r&&Uk?.[r])!==null&&a!==void 0?a:[];return t.startsWith("data-")||typeof e!="function"&&(r&&s.includes(t)||$we.includes(t))||n&&qA.includes(t)},rt=(e,t,n)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(v.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var a={};return Object.keys(r).forEach(s=>{var o;Lwe((o=r)===null||o===void 0?void 0:o[s],s,t,n)&&(a[s]=r[s])}),a},Fwe=["children","width","height","viewBox","className","style","title","desc"];function yC(){return yC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yC.apply(null,arguments)}function zwe(e,t){if(e==null)return{};var n,r,a=Bwe(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)&&(a[n]=e[n])}return a}function Bwe(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 wW=v.forwardRef((e,t)=>{var{children:n,width:r,height:a,viewBox:s,className:o,style:l,title:u,desc:d}=e,h=zwe(e,Fwe),p=s||{width:r,height:a,x:0,y:0},g=Xe("recharts-surface",o);return v.createElement("svg",yC({},rt(h,!0,"svg"),{className:g,width:r,height:a,style:l,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),v.createElement("title",null,u),v.createElement("desc",null,d),n)}),Uwe=["children","className"];function vC(){return vC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vC.apply(null,arguments)}function qwe(e,t){if(e==null)return{};var n,r,a=Hwe(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)&&(a[n]=e[n])}return a}function Hwe(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 pn=v.forwardRef((e,t)=>
498{var{children:n,className:r}=e,a=qwe(e,Uwe),s=Xe("recharts-layer",r);return v.createElement("g",vC({className:s},rt(a,!0),{ref:t}),n)}),Kwe=v.createContext(null);function Gt(e){return function(){return e}}const jW=Math.cos,nv=Math.sin,si=Math.sqrt,rv=Math.PI,X1=2*rv,wC=Math.PI,jC=2*wC,Kc=1e-6,Vwe=jC-Kc;function NW(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Gwe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return NW;const n=10**t;return function(r){this._+=r[0];for(let a=1,s=r.length;a<s;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class Wwe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?NW:Gwe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,s,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+s},${this._y1=+o}`}arcTo(t,n,r,a,s){if(t=+t,n=+n,r=+r,a=+a,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,l=this._y1,u=r-t,d=a-n,h=o-t,p=l-n,g=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Kc)if(!(Math.abs(p*u-d*h)>Kc)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-o,y=a-l,w=u*u+d*d,j=x*x+y*y,N=Math.sqrt(w),k=Math.sqrt(g),S=s*Math.tan((wC-Math.acos((w+g-j)/(2*N*k)))/2),E=S/k,O=S/N;Math.abs(E-1)>Kc&&this._append`L${t+E*h},${n+E*p}`,this._append`A${s},${s},0,0,${+(p*x>h*y)},${this._x1=t+O*u},${this._y1=n+O*d}`}}arc(t,n,r,a,s,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(a),u=r*Math.sin(a),d=t+l,h=n+u,p=1^o,g=o?a-s:s-a;this._x1===null?this._append`M${d},${h}`:(Math.abs(this._x1-d)>Kc||Math.abs(this._y1-h)>Kc)&&this._append`L${d},${h}`,r&&(g<0&&(g=g%jC+jC),g>Vwe?this._append`A${r},${r},0,1,${p},${t-l},${n-u}A${r},${r},0,1,${p},${this._x1=d},${this._y1=h}`:g>Kc&&this._append`A${r},${r},0,${+(g>=wC)},${p},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function KA(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Wwe(t)}function VA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _W(e){this._context=e}_W.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Q1(e){return new _W(e)}function kW(e){return e[0]}function SW(e){return e[1]}function CW(e,t){var n=Gt(!0),r=null,a=Q1,s=null,o=KA(l);e=typeof e=="function"?e:e===void 0?kW:Gt(e),t=typeof t=="function"?t:t===void 0?SW:Gt(t);function l(u){var d,h=(u=VA(u)).length,p,g=!1,x;for(r==null&&(s=a(x=o())),d=0;d<=h;++d)!(d<h&&n(p=u[d],d,u))===g&&((g=!g)?s.lineStart():s.lineEnd()),g&&s.point(+e(p,d,u),+t(p,d,u));if(x)return s=null,x+""||null}return l.x=function(u){return arguments.length?(e=typeof u=="function"?u:Gt(+u),l):e},l.y=function(u){return arguments.length?(t=typeof u=="function"?u:Gt(+u),l):t},l.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Gt(!!u),l):n},l.curve=function(u){return arguments.length?(a=u,r!=null&&(s=a(r)),l):a},l.context=function(u){return arguments.length?(u==null?r=s=null:s=a(r=u),l):r},l}function s0(e,t,n){var r=null,a=Gt(!0),s=null,o=Q1,l=null,u=KA(d);e=typeof e=="function"?e:e===void 0?kW:Gt(+e),t=typeof t=="function"?t:Gt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?SW:Gt(+n);function d(p){var g,x,y,w=(p=VA(p)).length,j,N=!1,k,S=new Array(w),E=new Array(w);for(s==null&&(l=o(k=u())),g=0;g<=w;++g){if(!(g<w&&a(j=p[g],g,p))===N)if(N=!N)x=g,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),y=g-1;y>=x;--y)l.point(S[y],E[y]);l.lineEnd(),l.areaEnd()}N&&(S[g]=+e(j,g,p),E[g]=+t(j,g,p),l.point(r?+r(j,g,p):S[g],n?+n(j,g,p):E[g]))}if(k)return l=null,k+""||null}function h(){return CW().defined(a).curve(o).context(s)}return d.x=function(p){return arguments.length?(e=typeof p=="function"?p:Gt(+p),r=null,d):e},d.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Gt(+p),d):e},d.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Gt(+p),d):r},d.y=function(p){return arguments.length?(t=typeof p=="function"?p:Gt(+p),n=null,d):t},d.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Gt(+p),d):t},d.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Gt(+p),d):n},d.lineX0=d.lineY0=function(){return h().x(e).y(t)},d.lineY1=function(){return h().x(e).y(n)},d.lineX1=function(){return h().x(r).y(t)},d.defined=function(p){return arguments.length?(a=typeof p=="function"?p:Gt(!!p),d):a},d.curve=function(p){return arguments.length?(o=p,s!=null&&(l=o(s)),d):o},d.context=function(p){return arguments.length?(p==null?s=l=null:l=o(s=p),d):s},d}class EW{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}
498point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Ywe(e){return new EW(e,!0)}function Xwe(e){return new EW(e,!1)}const GA={draw(e,t){const n=si(t/rv);e.moveTo(n,0),e.arc(0,0,n,0,X1)}},Qwe={draw(e,t){const n=si(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},OW=si(1/3),Zwe=OW*2,Jwe={draw(e,t){const n=si(t/Zwe),r=n*OW;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},eje={draw(e,t){const n=si(t),r=-n/2;e.rect(r,r,n,n)}},tje=.8908130915292852,AW=nv(rv/10)/nv(7*rv/10),nje=nv(X1/10)*AW,rje=-jW(X1/10)*AW,aje={draw(e,t){const n=si(t*tje),r=nje*n,a=rje*n;e.moveTo(0,-n),e.lineTo(r,a);for(let s=1;s<5;++s){const o=X1*s/5,l=jW(o),u=nv(o);e.lineTo(u*n,-l*n),e.lineTo(l*r-u*a,u*r+l*a)}e.closePath()}},Hk=si(3),sje={draw(e,t){const n=-si(t/(Hk*3));e.moveTo(0,n*2),e.lineTo(-Hk*n,-n),e.lineTo(Hk*n,-n),e.closePath()}},ps=-.5,ms=si(3)/2,NC=1/si(12),ije=(NC/2+1)*3,oje={draw(e,t){const n=si(t/ije),r=n/2,a=n*NC,s=r,o=n*NC+n,l=-s,u=o;e.moveTo(r,a),e.lineTo(s,o),e.lineTo(l,u),e.lineTo(ps*r-ms*a,ms*r+ps*a),e.lineTo(ps*s-ms*o,ms*s+ps*o),e.lineTo(ps*l-ms*u,ms*l+ps*u),e.lineTo(ps*r+ms*a,ps*a-ms*r),e.lineTo(ps*s+ms*o,ps*o-ms*s),e.lineTo(ps*l+ms*u,ps*u-ms*l),e.closePath()}};function lje(e,t){let n=null,r=KA(a);e=typeof e=="function"?e:Gt(e||GA),t=typeof t=="function"?t:Gt(t===void 0?64:+t);function a(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return a.type=function(s){return arguments.length?(e=typeof s=="function"?s:Gt(s),a):e},a.size=function(s){return arguments.length?(t=typeof s=="function"?s:Gt(+s),a):t},a.context=function(s){return arguments.length?(n=s??null,a):n},a}function av(){}function sv(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function TW(e){this._context=e}TW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:sv(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:sv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cje(e){return new TW(e)}function PW(e){this._context=e}PW.prototype={areaStart:av,areaEnd:av,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:sv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uje(e){return new PW(e)}function RW(e){this._context=e}RW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:sv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dje(e){return new RW(e)}function MW(e){this._context=e}MW.prototype={areaStart:av,areaEnd:av,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function fje(e){return new MW(e)}function J6(e){return e<0?-1:1}
498function eL(e,t,n){var r=e._x1-e._x0,a=t-e._x1,s=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),l=(s*a+o*r)/(r+a);return(J6(s)+J6(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function tL(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Kk(e,t,n){var r=e._x0,a=e._y0,s=e._x1,o=e._y1,l=(s-r)/3;e._context.bezierCurveTo(r+l,a+l*t,s-l,o-l*n,s,o)}function iv(e){this._context=e}iv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Kk(this,this._t0,tL(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Kk(this,tL(this,n=eL(this,e,t)),n);break;default:Kk(this,this._t0,n=eL(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function DW(e){this._context=new $W(e)}(DW.prototype=Object.create(iv.prototype)).point=function(e,t){iv.prototype.point.call(this,t,e)};function $W(e){this._context=e}$W.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,s){this._context.bezierCurveTo(t,e,r,n,s,a)}};function hje(e){return new iv(e)}function pje(e){return new DW(e)}function IW(e){this._context=e}IW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=nL(e),a=nL(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(r[0][s],a[0][s],r[1][s],a[1][s],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function nL(e){var t,n=e.length-1,r,a=new Array(n),s=new Array(n),o=new Array(n);for(a[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,s[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/s[t-1],s[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/s[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/s[t];for(s[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-a[t+1];return[a,s]}function mje(e){return new IW(e)}function Z1(e,t){this._context=e,this._t=t}Z1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function gje(e){return new Z1(e,.5)}function xje(e){return new Z1(e,0)}function bje(e){return new Z1(e,1)}function Wf(e,t){if((o=e.length)>1)for(var n=1,r,a,s=e[t[0]],o,l=s.length;n<o;++n)for(a=s,s=e[t[n]],r=0;r<l;++r)s[r][1]+=s[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function _C(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function yje(e,t){return e[t]}function vje(e){const t=[];return t.key=e,t}function wje(){var e=Gt([]),t=_C,n=Wf,r=yje;function a(s){var o=Array.from(e.apply(this,arguments),vje),l,u=o.length,d=-1,h;for(const p of s)for(l=0,++d;l<u;++l)(o[l][d]=[0,+r(p,o[l].key,d,s)]).data=p;for(l=0,h=VA(t(o));l<u;++l)o[h[l]].index=l;return n(o,h),o}return a.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Gt(Array.from(s)),a):e},a.value=function(s){return arguments.length?(r=typeof s=="function"?s:Gt(+s),a):r},a.order=function(s){return arguments.length?(t=s==null?_C:typeof s=="function"?s:Gt(Array.from(s)),a):t},a.offset=function(s){return arguments.length?(n=s??Wf,a):n},a}function jje(e,t){if((r=e.length)>0){for(var n,r,a=0,s=e[0].length,o;a<s;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}Wf(e,t)}}function Nje(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,s=r.length;n<s;++n){for(var o=0,l=0;o<a;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}Wf(e,t)}}function _je(e,t){if(!(!((o=e.length)>0)||!((s=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,s,o;r<s;++r){for(var l=0,u=0,d=0;l<o;++l){for(var h=e[t[l]],p=h[r][1]||0,g=h[r-1][1]||0,x=(p-g)/2,y=0;y<l;++y){var w=e[t[y]],j=w[r][1]||0,N=w[r-1][1]||0;x+=j-N}u+=p,d+=x*p}
498a[r-1][1]+=a[r-1][0]=n,u&&(n-=d/u)}a[r-1][1]+=a[r-1][0]=n,Wf(e,t)}}var kje=["type","size","sizeType"];function kC(){return kC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kC.apply(null,arguments)}function rL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function aL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rL(Object(n),!0).forEach(function(r){Sje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sje(e,t,n){return(t=Cje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cje(e){var t=Eje(e,"string");return typeof t=="symbol"?t:t+""}function Eje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oje(e,t){if(e==null)return{};var n,r,a=Aje(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)&&(a[n]=e[n])}return a}function Aje(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 LW={symbolCircle:GA,symbolCross:Qwe,symbolDiamond:Jwe,symbolSquare:eje,symbolStar:aje,symbolTriangle:sje,symbolWye:oje},Tje=Math.PI/180,Pje=e=>{var t="symbol".concat(Fg(e));return LW[t]||GA},Rje=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*Tje;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Mje=(e,t)=>{LW["symbol".concat(Fg(e))]=t},FW=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,a=Oje(e,kje),s=aL(aL({},a),{},{type:t,size:n,sizeType:r}),o=()=>{var p=Pje(t),g=lje().type(p).size(Rje(n,r,t));return g()},{className:l,cx:u,cy:d}=s,h=rt(s,!0);return u===+u&&d===+d&&n===+n?v.createElement("path",kC({}
498,h,{className:Xe("recharts-symbols",l),transform:"translate(".concat(u,", ").concat(d,")"),d:o()})):null};FW.registerSymbol=Mje;var Vk={},Gk={},sL;function Dje(){return sL||(sL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const a=new Map;for(let s=0;s<n.length;s++){const o=n[s],l=r(o);a.has(l)||a.set(l,o)}return Array.from(a.values())}e.uniqBy=t}(Gk)),Gk}var Wk={},iL;function zW(){return iL||(iL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t}(Wk)),Wk}var Yk={},Xk={},Qk={},oL;function $je(){return oL||(oL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t}(Qk)),Qk}var lL;function WA(){return lL||(lL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$je();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n}(Xk)),Xk}var Zk={},cL;function Ije(){return cL||(cL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t}(Zk)),Zk}var uL;function Lje(){return uL||(uL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WA(),n=Ije();function r(a){return n.isObjectLike(a)&&t.isArrayLike(a)}e.isArrayLikeObject=r}(Yk)),Yk}var Jk={},e2={},dL;function Fje(){return dL||(dL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UA();function n(r){return function(a){return t.get(a,r)}}e.property=n}(e2)),e2}var t2={},n2={},r2={},a2={},fL;function BW(){return fL||(fL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t}(a2)),a2}var s2={},hL;function UW(){return hL||(hL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t}(s2)),s2}var i2={},pL;function YA(){return pL||(pL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.eq=t}(i2)),i2}var mL;function zje(){return mL||(mL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=XA(),n=BW(),r=UW(),a=YA();function s(p,g,x){return typeof x!="function"?t.isMatch(p,g):o(p,g,function y(w,j,N,k,S,E){const O=x(w,j,N,k,S,E);return O!==void 0?!!O:o(w,j,y,E)},new Map)}function o(p,g,x,y){if(g===p)return!0;switch(typeof g){case"object":return l(p,g,x,y);case"function":return Object.keys(g).length>0?o(p,{...g},x,y):a.eq(p,g);default:return n.isObject(p)?typeof g=="string"?g==="":!0:a.eq(p,g)}}function l(p,g,x,y){if(g==null)return!0;if(Array.isArray(g))return d(p,g,x,y);if(g instanceof Map)return u(p,g,x,y);if(g instanceof Set)return h(p,g,x,y);const w=Object.keys(g);if(p==null)return w.length===0;if(w.length===0)return!0;if(y&&y.has(g))return y.get(g)===p;y&&y.set(g,p);try{for(let j=0;j<w.length;j++){const N=w[j];if(!r.isPrimitive(p)&&!(N in p)||g[N]===void 0&&p[N]!==void 0||g[N]===null&&p[N]!==null||!x(p[N],g[N],N,p,g,y))return!1}return!0}finally{y&&y.delete(g)}}function u(p,g,x,y){if(g.size===0)return!0;if(!(p instanceof Map))return!1;for(const[w,j]of g.entries()){const N=p.get(w);if(x(N,j,w,p,g,y)===!1)return!1}return!0}function d(p,g,x,y){if(g.length===0)return!0;if(!Array.isArray(p))return!1;const w=new Set;for(let j=0;j<g.length;j++){const N=g[j];let k=!1;for(let S=0;S<p.length;S++){if(w.has(S))continue;const E=p[S];let O=!1;if(x(E,N,j,p,g,y)&&(O=!0),O){w.add(S),k=!0;break}}if(!k)return!1}return!0}function h(p,g,x,y){return g.size===0?!0:p instanceof Set?d([...p],[...g],x,y):!1}e.isMatchWith=s,e.isSetMatch=h}(r2)),r2}var gL;function XA(){return gL||(gL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zje();function n(r,a){return t.isMatchWith(r,a,()=>{})}e.isMatch=n}(n2)),n2}var o2={},l2={},c2={},xL;function qW(){return xL||(xL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t}(c2)),c2}var u2={},bL;function QA(){return bL||(bL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});
498function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t}(u2)),u2}var d2={},yL;function ZA(){return yL||(yL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",a="[object Boolean]",s="[object Arguments]",o="[object Symbol]",l="[object Date]",u="[object Map]",d="[object Set]",h="[object Array]",p="[object Function]",g="[object ArrayBuffer]",x="[object Object]",y="[object Error]",w="[object DataView]",j="[object Uint8Array]",N="[object Uint8ClampedArray]",k="[object Uint16Array]",S="[object Uint32Array]",E="[object BigUint64Array]",O="[object Int8Array]",T="[object Int16Array]",P="[object Int32Array]",M="[object BigInt64Array]",D="[object Float32Array]",A="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=g,e.arrayTag=h,e.bigInt64ArrayTag=M,e.bigUint64ArrayTag=E,e.booleanTag=a,e.dataViewTag=w,e.dateTag=l,e.errorTag=y,e.float32ArrayTag=D,e.float64ArrayTag=A,e.functionTag=p,e.int16ArrayTag=T,e.int32ArrayTag=P,e.int8ArrayTag=O,e.mapTag=u,e.numberTag=r,e.objectTag=x,e.regexpTag=t,e.setTag=d,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=k,e.uint32ArrayTag=S,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=N}(d2)),d2}var f2={},vL;function Bje(){return vL||(vL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t}(f2)),f2}var wL;function HW(){return wL||(wL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qW(),n=QA(),r=ZA(),a=UW(),s=Bje();function o(h,p){return l(h,void 0,h,new Map,p)}function l(h,p,g,x=new Map,y=void 0){const w=y?.(h,p,g,x);if(w!=null)return w;if(a.isPrimitive(h))return h;if(x.has(h))return x.get(h);if(Array.isArray(h)){const j=new Array(h.length);x.set(h,j);for(let N=0;N<h.length;N++)j[N]=l(h[N],N,g,x,y);return Object.hasOwn(h,"index")&&(j.index=h.index),Object.hasOwn(h,"input")&&(j.input=h.input),j}if(h instanceof Date)return new Date(h.getTime());if(h instanceof RegExp){const j=new RegExp(h.source,h.flags);return j.lastIndex=h.lastIndex,j}if(h instanceof Map){const j=new Map;x.set(h,j);for(const[N,k]of h)j.set(N,l(k,N,g,x,y));return j}if(h instanceof Set){const j=new Set;x.set(h,j);for(const N of h)j.add(l(N,void 0,g,x,y));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(h))return h.subarray();if(s.isTypedArray(h)){const j=new(Object.getPrototypeOf(h)).constructor(h.length);x.set(h,j);for(let N=0;N<h.length;N++)j[N]=l(h[N],N,g,x,y);return j}if(h instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&h instanceof SharedArrayBuffer)return h.slice(0);if(h instanceof DataView){const j=new DataView(h.buffer.slice(0),h.byteOffset,h.byteLength);return x.set(h,j),u(j,h,g,x,y),j}if(typeof File<"u"&&h instanceof File){const j=new File([h],h.name,{type:h.type});return x.set(h,j),u(j,h,g,x,y),j}if(h instanceof Blob){const j=new Blob([h],{type:h.type});return x.set(h,j),u(j,h,g,x,y),j}if(h instanceof Error){const j=new h.constructor;return x.set(h,j),j.message=h.message,j.name=h.name,j.stack=h.stack,j.cause=h.cause,u(j,h,g,x,y),j}if(typeof h=="object"&&d(h)){const j=Object.create(Object.getPrototypeOf(h));return x.set(h,j),u(j,h,g,x,y),j}return h}function u(h,p,g=h,x,y){const w=[...Object.keys(p),...t.getSymbols(p)];for(let j=0;j<w.length;j++){const N=w[j],k=Object.getOwnPropertyDescriptor(h,N);(k==null||k.writable)&&(h[N]=l(p[N],N,g,x,y))}}function d(h){switch(n.getTag(h)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=l,e.copyProperties=u}(l2)),l2}var jL;function Uje(){return jL||(jL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=HW();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n}(o2)),o2}var NL;function qje(){return NL||(NL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=XA(),n=Uje();function r(a){return a=n.cloneDeep(a),s=>t.isMatch(s,a)}e.matches=r}(t2)),t2}var h2={},p2={},m2={},_L;function Hje(){return _L||(_L=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=HW(),n=ZA();function r(a,s){return t.cloneDeepWith(a,(o,l,u,d)=>{const h=s?.(o,l,u,d);if(h!=null)return h;if(typeof a=="object")switch(Object.prototype.toString.call(a)){case n.numberTag:case n.stringTag:case n.booleanTag:{const p=new a.constructor(a?.valueOf());return t.copyProperties(p,a),p}case n.argumentsTag:{const p={};return t.copyProperties(p,a),p.length=a.length,p[Symbol.iterator]=a[Symbol.iterator],p}default:return}})}e.cloneDeepWith=r}(m2)),m2}var kL;function Kje(){return kL||(kL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hje();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n}(p2)),p2}var g2={},x2={},SL;function KW(){return SL||(SL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,a=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<a;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n}(x2)),x2}var b2={},CL;function Vje(){return CL||(CL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QA();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n}(b2)),b2}var EL;function Gje(){return EL||(EL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mW(),n=KW(),r=Vje(),a=BA();function s(o,l){let u;if(Array.isArray(l)?u=l:typeof l=="string"&&t.isDeepKey(l)&&o?.[l]==null?u=a.toPath(l):u=[l],u.length===0)return!1;let d=o;for(let h=0;h<u.length;h++){const p=u[h];if((d==null||!Object.hasOwn(d,p))&&!((Array.isArray(d)||r.isArguments(d))&&n.isIndex(p)&&p<d.length))return!1;d=d[p]}return!0}e.has=s}(g2)),g2}var OL;
498function Wje(){return OL||(OL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=XA(),n=gW(),r=Kje(),a=UA(),s=Gje();function o(l,u){switch(typeof l){case"object":{Object.is(l?.valueOf(),-0)&&(l="-0");break}case"number":{l=n.toKey(l);break}}return u=r.cloneDeep(u),function(d){const h=a.get(d,l);return h===void 0?s.has(d,l):u===void 0?h===void 0:t.isMatch(h,u)}}e.matchesProperty=o}(h2)),h2}var AL;function Yje(){return AL||(AL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zW(),n=Fje(),r=qje(),a=Wje();function s(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?a.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=s}(Jk)),Jk}var TL;function Xje(){return TL||(TL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Dje(),n=zW(),r=Lje(),a=Yje();function s(o,l=n.identity){return r.isArrayLikeObject(o)?t.uniqBy(Array.from(o),a.iteratee(l)):[]}e.uniqBy=s}(Vk)),Vk}var y2,PL;function Qje(){return PL||(PL=1,y2=Xje().uniqBy),y2}var Zje=Qje();const RL=ka(Zje);function Jje(e,t,n){return t===!0?RL(e,n):typeof t=="function"?RL(e,t):e}var v2={exports:{}},w2={},j2={exports:{}},N2={};/** 499 * @license React 500 * use-sync-external-store-shim.production.js 501 * 502 * Copyright (c) Meta Platforms, Inc. and affiliates. 503 * 504 * This source code is licensed under the MIT license found in the 505 * LICENSE file in the root directory of this source tree. 506 */var ML;function eNe(){if(ML)return N2;ML=1;var e=ti();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function l(p,g){var x=g(),y=r({inst:{value:x,getSnapshot:g}}),w=y[0].inst,j=y[1];return s(function(){w.value=x,w.getSnapshot=g,u(w)&&j({inst:w})},[p,x,g]),a(function(){return u(w)&&j({inst:w}),p(function(){u(w)&&j({inst:w})})},[p]),o(x),x}function u(p){var g=p.getSnapshot;p=p.value;try{var x=g();return!n(p,x)}catch{return!0}}function d(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return N2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,N2}var DL;function tNe(){return DL||(DL=1,j2.exports=eNe()),j2.exports}/** 507 * @license React 508 * use-sync-external-store-shim/with-selector.production.js 509 * 510 * Copyright (c) Meta Platforms, Inc. and affiliates. 511 * 512 * This source code is licensed under the MIT license found in the 513 * LICENSE file in the root directory of this source tree. 514 */var $L;function nNe(){if($L)return w2;$L=1;var e=ti(),t=tNe();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,l=e.useMemo,u=e.useDebugValue;return w2.useSyncExternalStoreWithSelector=function(d,h,p,g,x){var y=s(null);if(y.current===null){var w={hasValue:!1,value:null};y.current=w}else w=y.current;y=l(function(){function N(T){if(!k){if(k=!0,S=T,T=g(T),x!==void 0&&w.hasValue){var P=w.value;if(x(P,T))return E=P}return E=T}if(P=E,r(S,T))return P;var M=g(T);return x!==void 0&&x(P,M)?(S=T,P):(S=T,E=M)}var k=!1,S,E,O=p===void 0?null:p;return[function(){return N(h())},O===null?void 0:function(){return N(O())}]},[h,p,g,x]);var j=a(d,y[0],y[1]);return o(function(){w.hasValue=!0,w.value=j},[j]),u(j),j},w2}var IL;function rNe(){return IL||(IL=1,v2.exports=nNe()),v2.exports}var aNe=rNe(),JA=v.createContext(null),sNe=e=>e,wn=()=>{var e=v.useContext(JA);return e?e.store.dispatch:sNe},J0=()=>{},iNe=()=>J0,oNe=(e,t)=>e===t;function Be(e){var t=v.useContext(JA);return aNe.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:iNe,t?t.store.getState:J0,t?t.store.getState:J0,t?e:J0,oNe)}function lNe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function cNe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function uNe(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var LL=e=>Array.isArray(e)?e:[e];function dNe(e){const t=Array.isArray(e[0])?e[0]:e;return uNe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function fNe(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}var hNe=class{constructor(e){this.value=e}deref(){return this.value}},pNe=typeof WeakRef<"u"?WeakRef:hNe,mNe=0,FL=1;function i0(){return{s:mNe,v:void 0,o:null,p:null}}function VW(e,t={}){let n=i0();const{resultEqualityCheck:r}=t;let a,s=0;function o(){let l=n;const{length:u}=arguments;for(let p=0,g=u;p<g;p++){const x=arguments[p];if(typeof x=="function"||typeof x=="object"&&x!==null){let y=l.o;y===null&&(l.o=y=new WeakMap);const w=y.get(x);w===void 0?(l=i0(),y.set(x,l)):l=w}else{let y=l.p;y===null&&(l.p=y=new Map);const w=y.get(x);w===void 0?(l=i0(),y.set(x,l)):l=w}}const d=l;let h;if(l.s===FL)h=l.v;else if(h=e.apply(null,arguments),s++,r){const p=a?.deref?.()??a;p!=null&&r(p,h)&&(h=p,s!==0&&s--),a=typeof h=="object"&&h!==null||typeof h=="function"?new pNe(h):h}return d.s=FL,d.v=h,h}return o.clearCache=()=>{n=i0(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function gNe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...a)=>{let s=0,o=0,l,u={},d=a.pop();typeof d=="object"&&(u=d,d=a.pop()),lNe(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const h={...n,...u},{memoize:p,memoizeOptions:g=[],argsMemoize:x=VW,argsMemoizeOptions:y=[]}=h,w=LL(g),j=LL(y),N=dNe(a),k=p(function(){return s++,d.apply(null,arguments)},...w),S=x(function(){o++;const O=fNe(N,arguments);return l=k.apply(null,O),l},...j);return Object.assign(S,{resultFunc:d,memoizedResultFunc:k,dependencies:N,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:p,argsMemoize:x})};return Object.assign(r,{withTypes:()=>r}),r}var ie=gNe(VW),xNe=Object.assign((e,t=ie)=>{cNe(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((o,l,u)=>(o[n[u]]=l,o),{}))},{withTypes:()=>xNe}),_2={},k2={},S2={},zL;function bNe(){return zL||(zL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,a,s)=>{if(r!==a){const o=t(r),l=t(a);if(o===l&&o===0){if(r<a)return s==="desc"?1:-1;if(r>a)return s==="desc"?-1:1}return s==="desc"?l-o:o-l}return 0};e.compareValues=n}(S2)),S2}var C2={},E2={},BL;function GW(){return BL||(BL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}
514e.isSymbol=t}(E2)),E2}var UL;function yNe(){return UL||(UL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GW(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(s,o){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||t.isSymbol(s)?!0:typeof s=="string"&&(r.test(s)||!n.test(s))||o!=null&&Object.hasOwn(o,s)}e.isKey=a}(C2)),C2}var qL;function vNe(){return qL||(qL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bNe(),n=yNe(),r=BA();function a(s,o,l,u){if(s==null)return[];l=u?void 0:l,Array.isArray(s)||(s=Object.values(s)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(x=>String(x));const d=(x,y)=>{let w=x;for(let j=0;j<y.length&&w!=null;++j)w=w[y[j]];return w},h=(x,y)=>y==null||x==null?y:typeof x=="object"&&"key"in x?Object.hasOwn(y,x.key)?y[x.key]:d(y,x.path):typeof x=="function"?x(y):Array.isArray(x)?d(y,x):typeof y=="object"?y[x]:y,p=o.map(x=>(Array.isArray(x)&&x.length===1&&(x=x[0]),x==null||typeof x=="function"||Array.isArray(x)||n.isKey(x)?x:{key:x,path:r.toPath(x)}));return s.map(x=>({original:x,criteria:p.map(y=>h(y,x))})).slice().sort((x,y)=>{for(let w=0;w<p.length;w++){const j=t.compareValues(x.criteria[w],y.criteria[w],l[w]);if(j!==0)return j}return 0}).map(x=>x.original)}e.orderBy=a}(k2)),k2}var O2={},HL;function wNe(){return HL||(HL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const a=[],s=Math.floor(r),o=(l,u)=>{for(let d=0;d<l.length;d++){const h=l[d];Array.isArray(h)&&u<s?o(h,u+1):a.push(h)}};return o(n,0),a}e.flatten=t}(O2)),O2}var A2={},KL;function WW(){return KL||(KL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KW(),n=WA(),r=BW(),a=YA();function s(o,l,u){return r.isObject(u)&&(typeof l=="number"&&n.isArrayLike(u)&&t.isIndex(l)&&l<u.length||typeof l=="string"&&l in u)?a.eq(u[l],o):!1}e.isIterateeCall=s}(A2)),A2}var VL;function jNe(){return VL||(VL=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vNe(),n=wNe(),r=WW();function a(s,...o){const l=o.length;return l>1&&r.isIterateeCall(s,o[0],o[1])?o=[]:l>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(s,n.flatten(o),["asc"])}e.sortBy=a}(_2)),_2}var T2,GL;function NNe(){return GL||(GL=1,T2=jNe().sortBy),T2}var _Ne=NNe();const J1=ka(_Ne);var YW=e=>e.legend.settings,kNe=e=>e.legend.size,SNe=e=>e.legend.payload;ie([SNe,YW],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?J1(r,n):r});var o0=1;function CNe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=v.useState({height:0,left:0,top:0,width:0}),r=v.useCallback(a=>
514{if(a!=null){var s=a.getBoundingClientRect(),o={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(o.height-t.height)>o0||Math.abs(o.left-t.left)>o0||Math.abs(o.top-t.top)>o0||Math.abs(o.width-t.width)>o0)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function kr(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ENe=typeof Symbol=="function"&&Symbol.observable||"@@observable",WL=ENe,P2=()=>Math.random().toString(36).substring(7).split("").join("."),ONe={INIT:`@@redux/INIT${P2()}`,REPLACE:`@@redux/REPLACE${P2()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${P2()}`},ov=ONe;function eT(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function XW(e,t,n){if(typeof e!="function")throw new Error(kr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(kr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(kr(1));return n(XW)(e,t)}let r=e,a=t,s=new Map,o=s,l=0,u=!1;
514function d(){o===s&&(o=new Map,s.forEach((j,N)=>{o.set(N,j)}))}function h(){if(u)throw new Error(kr(3));return a}function p(j){if(typeof j!="function")throw new Error(kr(4));if(u)throw new Error(kr(5));let N=!0;d();const k=l++;return o.set(k,j),function(){if(N){if(u)throw new Error(kr(6));N=!1,d(),o.delete(k),s=null}}}function g(j){if(!eT(j))throw new Error(kr(7));if(typeof j.type>"u")throw new Error(kr(8));if(typeof j.type!="string")throw new Error(kr(17));if(u)throw new Error(kr(9));try{u=!0,a=r(a,j)}finally{u=!1}return(s=o).forEach(k=>{k()}),j}function x(j){if(typeof j!="function")throw new Error(kr(10));r=j,g({type:ov.REPLACE})}function y(){const j=p;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(kr(11));function k(){const E=N;E.next&&E.next(h())}return k(),{unsubscribe:j(k)}},[WL](){return this}}}return g({type:ov.INIT}),{dispatch:g,subscribe:p,getState:h,replaceReducer:x,[WL]:y}}function ANe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:ov.INIT})>"u")throw new Error(kr(12));if(typeof n(void 0,{type:ov.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(kr(13))})}function QW(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const o=t[s];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let a;try{ANe(n)}catch(s){a=s}return function(o={},l){if(a)throw a;let u=!1;const d={};for(let h=0;h<r.length;h++){const p=r[h],g=n[p],x=o[p],y=g(x,l);if(typeof y>"u")throw l&&l.type,new Error(kr(14));d[p]=y,u=u||y!==x}return u=u||r.length!==Object.keys(o).length,u?d:o}}function lv(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function TNe(...e){return t=>(n,r)=>{const a=t(n,r);let s=()=>{throw new Error(kr(15))};const o={getState:a.getState,dispatch:(u,...d)=>s(u,...d)},l=e.map(u=>u(o));return s=lv(...l)(a.dispatch),{...a,dispatch:s}}}function ZW(e){return eT(e)&&"type"in e&&typeof e.type=="string"}var JW=Symbol.for("immer-nothing"),YL=Symbol.for("immer-draftable"),es=Symbol.for("immer-state");function Ws(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Yf=Object.getPrototypeOf;function Ru(e){return!!e&&!!e[es]}function Mo(e){return e?eY(e)||Array.isArray(e)||!!e[YL]||!!e.constructor?.[YL]||tw(e)||nw(e):!1}var PNe=Object.prototype.constructor.toString();function eY(e){if(!e||typeof e!="object")return!1;const t=Yf(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===PNe}function cv(e,t){ew(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ew(e){const t=e[es];return t?t.type_:Array.isArray(e)?1:tw(e)?2:nw(e)?3:0}function SC(e,t){return ew(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function tY(e,t,n){const r=ew(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function RNe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function tw(e){return e instanceof Map}function nw(e){return e instanceof Set}function Vc(e){return e.copy_||e.base_}function CC(e,t){if(tw(e))return new Map(e);if(nw(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=eY(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[es];let a=Reflect.ownKeys(r);for(let s=0;s<a.length;s++){const o=a[s],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(Yf(e),r)}else{const r=Yf(e);if(r!==null&&n)return{...e};const a=Object.create(r);return Object.assign(a,e)}}function tT(e,t=!1){return rw(e)||Ru(e)||!Mo(e)||(ew(e)>1&&(e.set=e.add=e.clear=e.delete=MNe),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>tT(r,!0))),e}function MNe(){Ws(2)}function rw(e){return Object.isFrozen(e)}var DNe={};function Mu(e){const t=DNe[e];return t||Ws(0,e),t}var Jm;function nY(){return Jm}function $Ne(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function XL(e,t){t&&(Mu("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function EC(e){OC(e),e.drafts_.forEach(INe),e.drafts_=null}function OC(e){e===Jm&&(Jm=e.parent_)}function QL(e){return Jm=$Ne(Jm,e)}function INe(e){const t=e[es];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ZL(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[es].modified_&&(EC(t),Ws(4)),Mo(e)&&(e=uv(t,e),t.parent_||dv(t,e)),t.patches_&&Mu("Patches").generateReplacementPatches_(n[es].base_,e,t.patches_,t.inversePatches_)):e=uv(t,n,[]),EC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==JW?e:void 0}function uv(e,t,n){if(rw(t))return t;const r=t[es];if(!r)return cv(t,(a,s)=>JL(e,r,t,a,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return dv(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const a=r.copy_;let s=a,o=!1;
514r.type_===3&&(s=new Set(a),a.clear(),o=!0),cv(s,(l,u)=>JL(e,r,a,l,u,n,o)),dv(e,a,!1),n&&e.patches_&&Mu("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function JL(e,t,n,r,a,s,o){if(Ru(a)){const l=s&&t&&t.type_!==3&&!SC(t.assigned_,r)?s.concat(r):void 0,u=uv(e,a,l);if(tY(n,r,u),Ru(u))e.canAutoFreeze_=!1;else return}else o&&n.add(a);if(Mo(a)&&!rw(a)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;uv(e,a),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&dv(e,a)}}function dv(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&tT(t,n)}function LNe(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:nY(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=r,s=nT;n&&(a=[r],s=eg);const{revoke:o,proxy:l}=Proxy.revocable(a,s);return r.draft_=l,r.revoke_=o,l}var nT={get(e,t){if(t===es)return e;const n=Vc(e);if(!SC(n,t))return FNe(e,n,t);const r=n[t];return e.finalized_||!Mo(r)?r:r===R2(e.base_,t)?(M2(e),e.copy_[t]=TC(r,e)):r},has(e,t){return t in Vc(e)},ownKeys(e){return Reflect.ownKeys(Vc(e))},set(e,t,n){const r=rY(Vc(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const a=R2(Vc(e),t),s=a?.[es];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(RNe(n,a)&&(n!==void 0||SC(e.base_,t)))return!0;M2(e),AC(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return R2(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,M2(e),AC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Vc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Ws(11)},getPrototypeOf(e){return Yf(e.base_)},setPrototypeOf(){Ws(12)}},eg={};cv(nT,(e,t)=>{eg[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});eg.deleteProperty=function(e,t){return eg.set.call(this,e,t,void 0)};eg.set=function(e,t,n){return nT.set.call(this,e[0],t,n,e[0])};function R2(e,t){const n=e[es];return(n?Vc(n):e)[t]}function FNe(e,t,n){const r=rY(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function rY(e,t){if(!(t in e))return;let n=Yf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Yf(n)}}function AC(e){e.modified_||(e.modified_=!0,e.parent_&&AC(e.parent_))}function M2(e){e.copy_||(e.copy_=CC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zNe=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const o=this;return function(u=s,...d){return o.produce(u,h=>n.call(this,h,...d))}}typeof n!="function"&&Ws(6),r!==void 0&&typeof r!="function"&&Ws(7);let a;if(Mo(t)){const s=QL(this),o=TC(t,void 0);let l=!0;try{a=n(o),l=!1}finally{l?EC(s):OC(s)}return XL(s,r),ZL(a,s)}else if(!t||typeof t!="object"){if(a=n(t),a===void 0&&(a=t),a===JW&&(a=void 0),this.autoFreeze_&&tT(a,!0),r){const s=[],o=[];Mu("Patches").generateReplacementPatches_(t,a,s,o),r(s,o)}return a}else Ws(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,u=>t(u,...l));let r,a;return[this.produce(t,n,(o,l)=>{r=o,a=l}),r,a]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Mo(e)||Ws(8),Ru(e)&&(e=So(e));const t=QL(this),n=TC(e,void 0);return n[es].isManual_=!0,OC(t),n}finishDraft(e,t){const n=e&&e[es];(!n||!n.isManual_)&&Ws(9);const{scope_:r}=n;return XL(r,t),ZL(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));const r=Mu("Patches").applyPatches_;return Ru(e)?r(e,t):this.produce(e,a=>r(a,t))}};function TC(e,t){const n=tw(e)?Mu("MapSet").proxyMap_(e,t):nw(e)?Mu("MapSet").proxySet_(e,t):LNe(e,t);return(t?t.scope_:nY()).drafts_.push(n),n}function So(e){return Ru(e)||Ws(10,e),aY(e)}function aY(e){if(!Mo(e)||rw(e))return e;const t=e[es];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=CC(e,t.scope_.immer_.useStrictShallowCopy_)}else n=CC(e,!0);return cv(n,(r,a)=>{tY(n,r,aY(a))}),t&&(t.finalized_=!1),n}var ts=new zNe,sY=ts.produce;ts.produceWithPatches.bind(ts);ts.setAutoFreeze.bind(ts);ts.setUseStrictShallowCopy.bind(ts);ts.applyPatches.bind(ts);ts.createDraft.bind(ts);ts.finishDraft.bind(ts);function iY(e){return({dispatch:n,getState:r})=>a=>s=>typeof s=="function"?s(n,r,e):a(s)}var BNe=iY(),UNe=iY,qNe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?lv:lv.apply(null,arguments)};function As(e,t){function n(...r){if(t){let a=t(...r);if(!a)throw new Error(Xa(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>ZW(r)&&r.type===e,n}var oY=class gm extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,gm.prototype)}static get[Symbol.species](){return gm}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new gm(...t[0].concat(this)):new gm(...t.concat(this))}};function e8(e){return Mo(e)?sY(e,()=>{}):e}function l0(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function HNe(e){return typeof e=="boolean"}var KNe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:a=!0,actionCreatorCheck:s=!0}=t??{};let o=new oY;return n&&(HNe(n)?o.push(BNe):o.push(UNe(n.extraArgument))),o},VNe="RTK_autoBatch",t8=e=>t=>{setTimeout(t,e)},GNe=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let a=!0,s=!1,o=!1;const l=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:t8(10):e.type==="callback"?e.queueNotification:t8(e.timeout),d=()=>{o=!1,s&&(s=!1,l.forEach(h=>h()))};return Object.assign({},r,{subscribe(h){const p=()=>a&&h(),g=r.subscribe(p);return l.add(h),()=>{g(),l.delete(h)}},dispatch(h){try{return a=!h?.meta?.[VNe],s=!a,s&&(o||(o=!0,u(d))),r.dispatch(h)}finally{a=!0}}})},WNe=e=>function(n){const{autoBatch:r=!0}=n??{};let a=new oY(e);return r&&a.push(GNe(typeof r=="object"?r:void 0)),a};function YNe(e){const t=KNe(),{reducer:n=void 0,middleware:r,devTools:a=!0,preloadedState:s=void 0,enhancers:o=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(eT(n))l=QW(n);else throw new Error(Xa(1));let u;typeof r=="function"?u=r(t):u=t();let d=lv;a&&(d=qNe({trace:!1,...typeof a=="object"&&a}));const h=TNe(...u),p=WNe(h);let g=typeof o=="function"?o(p):p();const x=d(...g);return XW(l,s,x)}function lY(e){const t={},n=[];let r;const a={addCase(s,o){const l=typeof s=="string"?s:s.type;if(!l)throw new Error(Xa(28));if(l in t)throw new Error(Xa(29));return t[l]=o,a},addMatcher(s,o){return n.push({matcher:s,reducer:o}),a},addDefaultCase(s){return r=s,a}};return e(a),[t,n,r]}function XNe(e){return typeof e=="function"}function QNe(e,t){let[n,r,a]=lY(t),s;if(XNe(e))s=()=>e8(e());else{const l=e8(e);s=()=>l}function o(l=s(),u){let d=[n[u.type],...r.filter(({matcher:h})=>h(u)).map(({reducer:h})=>h)];return d.filter(h=>
514!!h).length===0&&(d=[a]),d.reduce((h,p)=>{if(p)if(Ru(h)){const x=p(h,u);return x===void 0?h:x}else{if(Mo(h))return sY(h,g=>p(g,u));{const g=p(h,u);if(g===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return h},l)}return o.getInitialState=s,o}var ZNe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",JNe=(e=21)=>{let t="",n=e;for(;n--;)t+=ZNe[Math.random()*64|0];return t},e_e=Symbol.for("rtk-slice-createasyncthunk");function t_e(e,t){return`${e}/${t}`}function n_e({creators:e}={}){const t=e?.asyncThunk?.[e_e];return function(r){const{name:a,reducerPath:s=a}=r;if(!a)throw new Error(Xa(11));const o=(typeof r.reducers=="function"?r.reducers(a_e()):r.reducers)||{},l=Object.keys(o),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(S,E){const O=typeof S=="string"?S:S.type;if(!O)throw new Error(Xa(12));if(O in u.sliceCaseReducersByType)throw new Error(Xa(13));return u.sliceCaseReducersByType[O]=E,d},addMatcher(S,E){return u.sliceMatchers.push({matcher:S,reducer:E}),d},exposeAction(S,E){return u.actionCreators[S]=E,d},exposeCaseReducer(S,E){return u.sliceCaseReducersByName[S]=E,d}};l.forEach(S=>{const E=o[S],O={reducerName:S,type:t_e(a,S),createNotation:typeof r.reducers=="function"};i_e(E)?l_e(O,E,d,t):s_e(O,E,d)});function h(){const[S={},E=[],O=void 0]=typeof r.extraReducers=="function"?lY(r.extraReducers):[r.extraReducers],T={...S,...u.sliceCaseReducersByType};return QNe(r.initialState,P=>{for(let M in T)P.addCase(M,T[M]);for(let M of u.sliceMatchers)P.addMatcher(M.matcher,M.reducer);for(let M of E)P.addMatcher(M.matcher,M.reducer);O&&P.addDefaultCase(O)})}const p=S=>S,g=new Map,x=new WeakMap;let y;function w(S,E){return y||(y=h()),y(S,E)}function j(){return y||(y=h()),y.getInitialState()}function N(S,E=!1){function O(P){let M=P[S];return typeof M>"u"&&E&&(M=l0(x,O,j)),M}function T(P=p){const M=l0(g,E,()=>new WeakMap);return l0(M,P,()=>{const D={};for(const[A,L]of Object.entries(r.selectors??{}))D[A]=r_e(L,P,()=>l0(x,P,j),E);return D})}return{reducerPath:S,getSelectors:T,get selectors(){return T(O)},selectSlice:O}}const k={name:a,reducer:w,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:j,...N(s),injectInto(S,{reducerPath:E,...O}={}){const T=E??s;return S.inject({reducerPath:T,reducer:w},O),{...k,...N(T,!0)}}};return k}}function r_e(e,t,n,r){function a(s,...o){let l=t(s);return typeof l>"u"&&r&&(l=n()),e(l,...o)}return a.unwrapped=e,a}var Ds=n_e();function a_e(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function s_e({type:e,reducerName:t,createNotation:n},r,a){let s,o;if("reducer"in r){if(n&&!o_e(r))throw new Error(Xa(17));s=r.reducer,o=r.prepare}else s=r;a.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,o?As(e,o):As(e))}function i_e(e){return e._reducerDefinitionType==="asyncThunk"}function o_e(e){return e._reducerDefinitionType==="reducerWithPrepare"}function l_e({type:e,reducerName:t},n,r,a){if(!a)throw new Error(Xa(18));const{payloadCreator:s,fulfilled:o,pending:l,rejected:u,settled:d,options:h}=n,p=a(e,s,h);r.exposeAction(t,p),o&&r.addCase(p.fulfilled,o),l&&r.addCase(p.pending,l),u&&r.addCase(p.rejected,u),d&&r.addMatcher(p.settled,d),r.exposeCaseReducer(t,{fulfilled:o||c0,pending:l||c0,rejected:u||c0,settled:d||c0})}function c0(){}var c_e="task",cY="listener",uY="completed",rT="cancelled",u_e=`task-${rT}`,d_e=`task-${uY}`,PC=`${cY}-${rT}`,f_e=`${cY}-${uY}`,aw=class{constructor(e){this.code=e,this.message=`${c_e} ${rT} (reason: ${e})`}name="TaskAbortError";message},aT=(e,t)=>{if(typeof e!="function")throw new TypeError(Xa(32))},fv=()=>{},dY=(e,t=fv)=>(e.catch(t),e),fY=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),gu=(e,t)=>{const n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},xu=e=>{if(e.aborted){const{reason:t}=e;throw new aw(t)}};function hY(e,t){let n=fv;return new Promise((r,a)=>{const s=()=>a(new aw(e.reason));if(e.aborted){s();return}n=fY(e,s),t.finally(()=>n()).then(r,a)}).finally(()=>{n=fv})}var h_e=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof aw?"cancelled":"rejected",error:n}}finally{t?.()}},hv=e=>t=>dY(hY(e,t).then(n=>(xu(e),n))),pY=e=>{const t=hv(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Cf}=Object,n8={},sw="listenerMiddleware",p_e=(e,t)=>
514{const n=r=>fY(e,()=>gu(r,e.reason));return(r,a)=>{aT(r);const s=new AbortController;n(s);const o=h_e(async()=>{xu(e),xu(s.signal);const l=await r({pause:hv(s.signal),delay:pY(s.signal),signal:s.signal});return xu(s.signal),l},()=>gu(s,d_e));return a?.autoJoin&&t.push(o.catch(fv)),{result:hv(e)(o),cancel(){gu(s,u_e)}}}},m_e=(e,t)=>{const n=async(r,a)=>{xu(t);let s=()=>{};const l=[new Promise((u,d)=>{let h=e({predicate:r,effect:(p,g)=>{g.unsubscribe(),u([p,g.getState(),g.getOriginalState()])}});s=()=>{h(),d()}})];a!=null&&l.push(new Promise(u=>setTimeout(u,a,null)));try{const u=await hY(t,Promise.race(l));return xu(t),u}finally{s()}};return(r,a)=>dY(n(r,a))},mY=e=>{let{type:t,actionCreator:n,matcher:r,predicate:a,effect:s}=e;if(t)a=As(t).match;else if(n)t=n.type,a=n.match;else if(r)a=r;else if(!a)throw new Error(Xa(21));return aT(s),{predicate:a,type:t,effect:s}},gY=Cf(e=>{const{type:t,predicate:n,effect:r}=mY(e);return{id:JNe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Xa(22))}}},{withTypes:()=>gY}),r8=(e,t)=>{const{type:n,effect:r,predicate:a}=mY(t);return Array.from(e.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===a)&&s.effect===r)},RC=e=>{e.pending.forEach(t=>{gu(t,PC)})},g_e=e=>()=>{e.forEach(RC),e.clear()},a8=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},xY=Cf(As(`${sw}/add`),{withTypes:()=>xY}),x_e=As(`${sw}/removeAll`),bY=Cf(As(`${sw}/remove`),{withTypes:()=>bY}),b_e=(...e)=>{console.error(`${sw}/error`,...e)},Bg=(e={})=>{const t=new Map,{extra:n,onError:r=b_e}=e;aT(r);const a=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),p=>{h.unsubscribe(),p?.cancelActive&&RC(h)}),s=h=>{const p=r8(t,h)??gY(h);return a(p)};Cf(s,{withTypes:()=>s});const o=h=>{const p=r8(t,h);return p&&(p.unsubscribe(),h.cancelActive&&RC(p)),!!p};Cf(o,{withTypes:()=>o});const l=async(h,p,g,x)=>{const y=new AbortController,w=m_e(s,y.signal),j=[];try{h.pending.add(y),await Promise.resolve(h.effect(p,Cf({},g,{getOriginalState:x,condition:(N,k)=>w(N,k).then(Boolean),take:w,delay:pY(y.signal),pause:hv(y.signal),extra:n,signal:y.signal,fork:p_e(y.signal,j),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((N,k,S)=>{N!==y&&(gu(N,PC),S.delete(N))})},cancel:()=>{gu(y,PC),h.pending.delete(y)},throwIfCancelled:()=>{xu(y.signal)}})))}catch(N){N instanceof aw||a8(r,N,{raisedBy:"effect"})}finally{await Promise.all(j),gu(y,f_e),h.pending.delete(y)}},u=g_e(t);return{middleware:h=>p=>g=>{if(!ZW(g))return p(g);if(xY.match(g))return s(g.payload);if(x_e.match(g)){u();return}if(bY.match(g))return o(g.payload);let x=h.getState();const y=()=>{if(x===n8)throw new Error(Xa(23));return x};let w;try{if(w=p(g),t.size>0){const j=h.getState(),N=Array.from(t.values());for(const k of N){let S=!1;try{S=k.predicate(g,j,x)}catch(E){S=!1,a8(r,E,{raisedBy:"predicate"})}S&&l(k,g,h,y)}}}finally{x=n8}return w},startListening:s,stopListening:o,clearListeners:u}};function Xa(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var y_e={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},yY=Ds({name:"chartLayout",initialState:y_e,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top,e.margin.right=t.payload.right,e.margin.bottom=t.payload.bottom,e.margin.left=t.payload.left},setScale(e,t){e.scale=t.payload}}}),{setMargin:v_e,setLayout:w_e,setChartSize:j_e,setScale:N_e}=yY.actions,__e=yY.reducer;function s8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function i8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s8(Object(n),!0).forEach(function(r){k_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s8(Object(n)).forEac
514h(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function k_e(e,t,n){return(t=S_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S_e(e){var t=C_e(e,"string");return typeof t=="symbol"?t:t+""}function C_e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pv=Math.PI/180,E_e=e=>e*180/Math.PI,Xn=(e,t,n,r)=>({x:e+Math.cos(-pv*r)*n,y:t+Math.sin(-pv*r)*n}),vY=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},O_e=(e,t)=>{var{x:n,y:r}=e,{x:a,y:s}=t;return Math.sqrt((n-a)**2+(r-s)**2)},A_e=(e,t)=>{var{x:n,y:r}=e,{cx:a,cy:s}=t,o=O_e({x:n,y:r},{x:a,y:s});if(o<=0)return{radius:o,angle:0};var l=(n-a)/o,u=Math.acos(l);return r>s&&(u=2*Math.PI-u),{radius:o,angle:E_e(u),angleInRadian:u}},T_e=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),a=Math.floor(n/360),s=Math.min(r,a);return{startAngle:t-s*360,endAngle:n-s*360}},P_e=(e,t)=>{var{startAngle:n,endAngle:r}=t,a=Math.floor(n/360),s=Math.floor(r/360),o=Math.min(a,s);return e+o*360},R_e=(e,t)=>{var{x:n,y:r}=e,{radius:a,angle:s}=A_e({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(a<o||a>l||a===0)return null;var{startAngle:u,endAngle:d}=T_e(t),h=s,p;if(u<=d){for(;h>d;)h-=360;for(;h<u;)h+=360;p=h>=u&&h<=d}else{for(;h>u;)h-=360;for(;h<d;)h+=360;p=h>=d&&h<=u}return p?i8(i8({},t),{},{radius:a,angle:P_e(h,t)}):null};function o8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o8(Object(n),!0).forEach(function(r){M_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function M_e(e,t,n){return(t=D_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D_e(e){var t=$_e(e,"string");return typeof t=="symbol"?t:t+""}function $_e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bt(e,t,n){return Ct(e)||Ct(t)?n:Os(t)?Zl(e,t,n):typeof t=="function"?t(e):n}var I_e=(e,t,n,r,a)=>{var s,o=-1,l=(s=t?.length)!==null&&s!==void 0?s:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&a!=null&&Math.abs(Math.abs(a[1]-a[0])-360)<=1e-6)for(var u=0;u<l;u++){var d=u>0?n[u-1].coordinate:n[l-1].coordinate,h=n[u].coordinate,p=u>=l-1?n[0].coordinate:n[u+1].coordinate,g=void 0;if(gr(h-d)!==gr(p-h)){var x=[];if(gr(p-h)===gr(a[1]-a[0])){g=p;var y=h+a[1]-a[0];x[0]=Math.min(y,(y+d)/2),x[1]=Math.max(y,(y+d)/2)}else{g=d;var w=p+a[1]-a[0];x[0]=Math.min(h,(w+h)/2),x[1]=Math.max(h,(w+h)/2)}var j=[Math.min(h,(g+h)/2),Math.max(h,(g+h)/2)];if(e>j[0]&&e<=j[1]||e>=x[0]&&e<=x[1]){({index:o}=n[u]);break}}else{var N=Math.min(d,p),k=Math.max(d,p);if(e>(N+h)/2&&e<=(k+h)/2){({index:o}=n[u]);break}}}else if(t){for(var S=0;S<l;S++)if(S===0&&e<=(t[S].coordinate+t[S+1].coordinate)/2||S>0&&S<l-1&&e>(t[S].coordinate+t[S-1].coordinate)/2&&e<=(t[S].coordinate+t[S+1].coordinate)/2||S===l-1&&e>(t[S].coordinate+t[S-1].coordinate)/2){({index:o}=t[S]);break}}return o},L_e=(e,t,n)=>{if(t&&n){var{width:r,height:a}=n,{align:s,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&s!=="center"&&Pe(e[s]))return bs(bs({},e),{},{[s]:e[s]+(r||0)});if((l==="horizontal"||l==="vertical"&&s==="center")&&o!=="middle"&&Pe(e[o]))return bs(bs({},e),{},{[o]:e[o]+(a||0)})}return e},Ui=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",wY=(e,t,n,r)=>{if(r)return e.map(l=>l.coordinate);var a,s,o=e.map(l=>
514(l.coordinate===t&&(a=!0),l.coordinate===n&&(s=!0),l.coordinate));return a||o.push(t),s||o.push(n),o},jY=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:a,range:s,scale:o,realScaleType:l,isCategorical:u,categoricalDomain:d,tickCount:h,ticks:p,niceTicks:g,axisType:x}=e;if(!o)return null;var y=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,w=a==="category"&&o.bandwidth?o.bandwidth()/y:0;if(w=x==="angleAxis"&&s&&s.length>=2?gr(s[0]-s[1])*2*w:w,p||g){var j=(p||g||[]).map((N,k)=>{var S=r?r.indexOf(N):N;return{coordinate:o(S)+w,value:N,offset:w,index:k}});return j.filter(N=>!Na(N.coordinate))}return u&&d?d.map((N,k)=>({coordinate:o(N)+w,value:N,index:k,offset:w})):o.ticks&&h!=null?o.ticks(h).map((N,k)=>({coordinate:o(N)+w,value:N,offset:w,index:k})):o.domain().map((N,k)=>({coordinate:o(N)+w,value:r?r[N]:N,index:k,offset:w}))},l8=1e-4,F_e=e=>{var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,r=e.range(),a=Math.min(r[0],r[1])-l8,s=Math.max(r[0],r[1])+l8,o=e(t[0]),l=e(t[n-1]);(o<a||o>s||l<a||l>s)&&e.domain([t[0],t[n-1]])}},z_e=(e,t)=>{if(!t||t.length!==2||!Pe(t[0])||!Pe(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),a=[e[0],e[1]];return(!Pe(e[0])||e[0]<n)&&(a[0]=n),(!Pe(e[1])||e[1]>r)&&(a[1]=r),a[0]>r&&(a[0]=r),a[1]<n&&(a[1]=n),a},B_e=e=>{var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var a=0,s=0,o=0;o<t;++o){var l=Na(e[o][n][1])?e[o][n][0]:e[o][n][1];l>=0?(e[o][n][0]=a,e[o][n][1]=a+l,a=e[o][n][1]):(e[o][n][0]=s,e[o][n][1]=s+l,s=e[o][n][1])}},U_e=e=>{var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var a=0,s=0;s<t;++s){var o=Na(e[s][n][1])?e[s][n][0]:e[s][n][1];o>=0?(e[s][n][0]=a,e[s][n][1]=a+o,a=e[s][n][1]):(e[s][n][0]=0,e[s][n][1]=0)}},q_e={sign:B_e,expand:jje,none:Wf,silhouette:Nje,wiggle:_je,positive:U_e},H_e=(e,t,n)=>{var r=q_e[n],a=wje().keys(t).value((s,o)=>+Bt(s,o,0)).order(_C).offset(r);return a(e)};function sT(e){return e==null?void 0:String(e)}function mv(e){var{axis:t,ticks:n,bandSize:r,entry:a,index:s,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ct(a[t.dataKey])){var l=yW(n,"value",a[t.dataKey]);if(l)return l.coordinate+r/2}return n[s]?n[s].coordinate+r/2:null}var u=Bt(a,Ct(o)?t.dataKey:o);return Ct(u)?null:t.scale(u)}var c8=e=>{var{axis:t,ticks:n,offset:r,bandSize:a,entry:s,index:o}=e;if(t.type==="category")return n[o]?n[o].coordinate+r:null;var l=Bt(s,t.dataKey,t.scale.domain()[o]);return Ct(l)?null:t.scale(l)-a/2+r},K_e=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return r<=0&&a>=0?0:a<0?a:r}return n[0]},V_e=e=>{var t=e.flat(2).filter(Pe);return[Math.min(...t),Math.max(...t)]},G_e=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],W_e=(e,t,n)=>{if(e!=null)return G_e(Object.keys(e).reduce((r,a)=>{var s=e[a],{stackedData:o}=s,l=o.reduce((u,d)=>{var h=V_e(d.slice(t,n+1));return[Math.min(u[0],h[0]),Math.max(u[1],h[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},u8=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,d8=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Du=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var a=J1(t,h=>h.coordinate),s=1/0,o=1,l=a.length;o<l;o++){var u=a[o],d=a[o-1];s=Math.min((u.coordinate||0)-(d.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0};function f8(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:a,name:s}=e;return bs(bs({},t),{},{dataKey:n,payload:r,value:a,name:s})}function cc(e,t){if(e)return String(e);if(typeof t=="string")return t}function Y_e(e,t,n,r,a){if(n==="horizontal"||n==="vertical"){var s=e>=a.left&&e<=a.left+a.width&&t>=a.top&&t<=a.top+a.height;return s?{x:e,y:t}:null}return r?R_e({x:e,y:t},r):null}var X_e=(e,t,n,r)=>{var a=t.find(d=>d&&d.index===n);if(a){if(e==="horizontal")return{x:a.coordinate,y:r.y};if(e==="vertical")return{x:r.x,y:a.coordinate};if(e==="centric"){var s=a.coordinate,{radius:o}=r;return bs(bs(bs({},r),Xn(r.cx,r.cy,o,s)),{},{angle:s,radius:o})}var l=a.coordinate,{angle:u}=r;return bs(bs(bs({},r),Xn(r.cx,r.cy,l,u)),{},{angle:u,radius:l})}return{x:0,y:0}},Q_e=(e,t)=>
514t==="horizontal"?e.x:t==="vertical"?e.y:t==="centric"?e.angle:e.radius,Vo=e=>e.layout.width,Go=e=>e.layout.height,Z_e=e=>e.layout.scale,NY=e=>e.layout.margin,iT=ie(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),oT=ie(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),_Y="data-recharts-item-index",kY="data-recharts-item-data-key",iw=60;function h8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h8(Object(n),!0).forEach(function(r){J_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J_e(e,t,n){return(t=eke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eke(e){var t=tke(e,"string");return typeof t=="symbol"?t:t+""}function tke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}
514var nke=e=>e.brush.height,sr=ie([Vo,Go,NY,nke,iT,oT,YW,kNe],(e,t,n,r,a,s,o,l)=>{var u=s.reduce((y,w)=>{var{orientation:j}=w;if(!w.mirror&&!w.hide){var N=typeof w.width=="number"?w.width:iw;return _l(_l({},y),{},{[j]:y[j]+N})}return y},{left:n.left||0,right:n.right||0}),d=a.reduce((y,w)=>{var{orientation:j}=w;return!w.mirror&&!w.hide?_l(_l({},y),{},{[j]:Zl(y,"".concat(j))+w.height}):y},{top:n.top||0,bottom:n.bottom||0}),h=_l(_l({},d),u),p=h.bottom;h.bottom+=r,h=L_e(h,o,l);var g=e-h.left-h.right,x=t-h.top-h.bottom;return _l(_l({brushBottom:p},h),{},{width:Math.max(g,0),height:Math.max(x,0)})}),rke=ie(sr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),SY=ie(Vo,Go,(e,t)=>({x:0,y:0,width:e,height:t})),ake=v.createContext(null),Rr=()=>v.useContext(ake)!=null,ow=e=>e.brush,lw=ie([ow,sr,NY],(e,t,n)=>({height:e.height,x:Pe(e.x)?e.x:t.left,y:Pe(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Pe(e.width)?e.width:t.width})),lT=()=>{var e,t=Rr(),n=Be(rke),r=Be(lw),a=(e=Be(ow))===null||e===void 0?void 0:e.padding;return!t||!r||!a?n:{width:r.width-a.left-a.right,height:r.height-a.top-a.bottom,x:a.left,y:a.top}},ske={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},CY=()=>{var e;return(e=Be(sr))!==null&&e!==void 0?e:ske},EY=()=>Be(Vo),OY=()=>Be(Go),ht=e=>e.layout.layoutType,Ug=()=>Be(ht),ike={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},AY=Ds({name:"legend",initialState:ike,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload(e,t){e.payload.push(t.payload)},removeLegendPayload(e,t){var n=So(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)}}}),{setLegendSize:QBe,setLegendSettings:ZBe,addLegendPayload:TY,removeLegendPayload:PY}=AY.actions,oke=AY.reducer;function MC(){return MC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MC.apply(null,arguments)}function p8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function D2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p8(Object(n),!0).forEach(function(r){lke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lke(e,t,n){return(t=cke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cke(e){var t=uke(e,"string");return typeof t=="symbol"?t:t+""}function uke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dke(e){return Array.isArray(e)&&Os(e[0])&&Os(e[1])?e.join(" ~ "):e}var fke=e=>{var{separator:t=" : ",contentStyle:n={},itemStyle:r={},labelStyle:a={},payload:s,formatter:o,itemSorter:l,wrapperClassName:u,labelClassName:d,label:h,labelFormatter:p,accessibilityLayer:g=!1}=e,x=()=>{if(s&&s.length){var O={padding:0,margin:0},T=(l?J1(s,l):s).map((P,M)=>{if(P.type==="none")return null;var D=P.formatter||o||dke,{value:A,name:L}=P,F=A,B=L;if(D){var U=D(A,L,P,M,s);if(Array.isArray(U))[F,B]=U;else if(U!=null)F=U;else return null}var z=D2({display:"block",paddingTop:4,paddingBottom:4,color:P.color||"#000"},r);return v.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:z},Os(B)?v.createElement("span",{className:"recharts-tooltip-item-name"},B):null,Os(B)?v.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,v.createElement("span",{className:"recharts-tooltip-item-value"},F),v.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return v.createElement("ul",{className:"recharts-tooltip-item-list",style:O},T)}return null},y=D2({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},n),w=D2({margin:0},a),j=!Ct(h),N=j?h:"",k=Xe("recharts-default-tooltip",u),S=Xe("recharts-tooltip-label",d);
514j&&p&&s!==void 0&&s!==null&&(N=p(h,s));var E=g?{role:"status","aria-live":"assertive"}:{};return v.createElement("div",MC({className:k,style:y},E),v.createElement("p",{className:S,style:w},v.isValidElement(N)?N:"".concat(N)),x())},Gp="recharts-tooltip-wrapper",hke={visibility:"hidden"};function pke(e){var{coordinate:t,translateX:n,translateY:r}=e;return Xe(Gp,{["".concat(Gp,"-right")]:Pe(n)&&t&&Pe(t.x)&&n>=t.x,["".concat(Gp,"-left")]:Pe(n)&&t&&Pe(t.x)&&n<t.x,["".concat(Gp,"-bottom")]:Pe(r)&&t&&Pe(t.y)&&r>=t.y,["".concat(Gp,"-top")]:Pe(r)&&t&&Pe(t.y)&&r<t.y})}function m8(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offsetTopLeft:a,position:s,reverseDirection:o,tooltipDimension:l,viewBox:u,viewBoxDimension:d}=e;if(s&&Pe(s[r]))return s[r];var h=n[r]-l-(a>0?a:0),p=n[r]+a;if(t[r])return o[r]?h:p;var g=u[r];if(g==null)return 0;if(o[r]){var x=h,y=g;return x<y?Math.max(p,g):Math.max(h,g)}if(d==null)return 0;var w=p+l,j=g+d;return w>j?Math.max(h,g):Math.max(p,g)}function mke(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function gke(e){var{allowEscapeViewBox:t,coordinate:n,offsetTopLeft:r,position:a,reverseDirection:s,tooltipBox:o,useTranslate3d:l,viewBox:u}=e,d,h,p;return o.height>0&&o.width>0&&n?(h=m8({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),p=m8({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:s,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=mke({translateX:h,translateY:p,useTranslate3d:l})):d=hke,{cssProperties:d,cssClasses:pke({translateX:h,translateY:p,coordinate:n})}}function g8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function u0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g8(Object(n),!0).forEach(function(r){DC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DC(e,t,n){return(t=xke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xke(e){var t=bke(e,"string");return typeof t=="symbol"?t:t+""}function bke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class yke extends v.PureComponent{constructor(){super(...arguments),DC(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),DC(this,"handleKeyDown",t=>{if(t.key==="Escape"){var n,r,a,s;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0,y:(a=(s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:r,animationEasing:a,children:s,coordinate:o,hasPayload:l,isAnimationActive:u,offset:d,position:h,reverseDirection:p,useTranslate3d:g,viewBox:x,wrapperStyle:y,lastBoundingBox:w,innerRef:j,hasPortalFromProps:N}=this.props,{cssClasses:k,cssProperties:S}=gke({allowEscapeViewBox:n,coordinate:o,offsetTopLeft:d,position:h,reverseDirection:p,tooltipBox:{height:w.height,width:w.width},useTranslate3d:g,viewBox:x}),E=N?{}:u0(u0({transition:u&&t?"transform ".concat(r,"ms ").concat(a):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),O=u0(u0({},E),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},y);return v.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,
514className:k,style:O,ref:j},s)}}var vke=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),uc={isSsr:vke()},RY=()=>Be(e=>e.rootProps.accessibilityLayer);function Pr(e){return Number.isFinite(e)}function Xf(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function $C(){return $C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$C.apply(null,arguments)}function x8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function b8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x8(Object(n),!0).forEach(function(r){wke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wke(e,t,n){return(t=jke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jke(e){var t=Nke(e,"string");return typeof t=="symbol"?t:t+""}function Nke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var y8={curveBasisClosed:uje,curveBasisOpen:dje,curveBasis:cje,curveBumpX:Ywe,curveBumpY:Xwe,curveLinearClosed:fje,curveLinear:Q1,curveMonotoneX:hje,curveMonotoneY:pje,curveNatural:mje,curveStep:gje,curveStepAfter:bje,curveStepBefore:xje},d0=e=>Pr(e.x)&&Pr(e.y),Wp=e=>e.x,Yp=e=>e.y,_ke=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Fg(e));return(n==="curveMonotone"||n==="curveBump")&&t?y8["".concat(n).concat(t==="vertical"?"Y":"X")]:y8[n]||Q1},kke=e=>{var{type:t="linear",points:n=[],baseLine:r,layout:a,connectNulls:s=!1}=e,o=_ke(t,a),l=s?n.filter(d0):n,u;if(Array.isArray(r)){var d=s?r.filter(p=>d0(p)):r,h=l.map((p,g)=>b8(b8({},p),{},{base:d[g]}));return a==="vertical"?u=s0().y(Yp).x1(Wp).x0(p=>p.base.x):u=s0().x(Wp).y1(Yp).y0(p=>p.base.y),u.defined(d0).curve(o),u(h)}return a==="vertical"&&Pe(r)?u=s0().y(Yp).x1(Wp).x0(r):Pe(r)?u=s0().x(Wp).y1(Yp).y0(r):u=CW().x(Wp).y(Yp),u.defined(d0).curve(o),u(l)},Ef=e=>{var{className:t,points:n,path:r,pathRef:a}=e;if((!n||!n.length)&&!r)return null;var s=n&&n.length?kke(e):r;return v.createElement("path",$C({},rt(e,!1),HA(e),{className:Xe("recharts-curve",t),d:s===null?void 0:s,ref:a}))},Ske=["x","y","top","left","width","height","className"];function IC(){return IC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IC.apply(null,arguments)}function v8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Cke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v8(Object(n),!0).forEach(function(r){Eke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eke(e,t,n){return(t=Oke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oke(e){var t=Ake(e,"string");return typeof t=="symbol"?t:t+""}function Ake(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tke(e,t){if(e==null)return{};var n,r,a=Pke(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)&&(a[n]=e[n])}return a}function Pke(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 Rke=(e,t,n,r,a,s)=>"M".concat(e,",").concat(a,"v").concat(r,"M").concat(s,",").concat(t,"h").concat(n),Mke=e=>{var{x:t=0,y:n=0,top:r=0,left:a=0,width:s=0,height:o=0,className:l}=e,u=Tke(e,Ske),d=Cke({x:t,y:n,top:r,left:a,width:s,height:o},u);return!Pe(t)||!Pe(n)||!Pe(s)||!Pe(o)||!Pe(r)||!Pe(a)?null:v.createElement("path",IC({},rt(d,!0),{className:Xe("recharts-cross",l),d:Rke(t,n,s,o,r,a)}))};function Dke(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function w8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
514t%2?w8(Object(n),!0).forEach(function(r){Ike(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ike(e,t,n){return(t=Lke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lke(e){var t=Fke(e,"string");return typeof t=="symbol"?t:t+""}function Fke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function as(e,t){var n=$ke({},e),r=t,a=Object.keys(t),s=a.reduce((o,l)=>(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return s}var $2={},I2={},L2={},j8;function zke(){return j8||(j8=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(!n||typeof n!="object")return!1;const r=Object.getPrototypeOf(n);return r===null||r===Object.prototype||Object.getPrototypeOf(r)===null?Object.prototype.toString.call(n)==="[object Object]":!1}e.isPlainObject=t}(L2)),L2}var N8;function Bke(){return N8||(N8=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zke(),n=qW(),r=QA(),a=ZA(),s=YA();function o(d,h,p){return l(d,h,void 0,void 0,void 0,void 0,p)}function l(d,h,p,g,x,y,w){const j=w(d,h,p,g,x,y);if(j!==void 0)return j;if(typeof d==typeof h)switch(typeof d){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return d===h;case"number":return d===h||Object.is(d,h);case"function":return d===h;case"object":return u(d,h,y,w)}return u(d,h,y,w)}function u(d,h,p,g){if(Object.is(d,h))return!0;let x=r.getTag(d),y=r.getTag(h);if(x===a.argumentsTag&&(x=a.objectTag),y===a.argumentsTag&&(y=a.objectTag),x!==y)return!1;switch(x){case a.stringTag:return d.toString()===h.toString();case a.numberTag:{const N=d.valueOf(),k=h.valueOf();return s.eq(N,k)}case a.booleanTag:case a.dateTag:case a.symbolTag:return Object.is(d.valueOf(),h.valueOf());case a.regexpTag:return d.source===h.source&&d.flags===h.flags;case a.functionTag:return d===h}p=p??new Map;const w=p.get(d),j=p.get(h);if(w!=null&&j!=null)return w===h;p.set(d,h),p.set(h,d);try{switch(x){case a.mapTag:{if(d.size!==h.size)return!1;for(const[N,k]of d.entries())if(!h.has(N)||!l(k,h.get(N),N,d,h,p,g))return!1;return!0}case a.setTag:{if(d.size!==h.size)return!1;const N=Array.from(d.values()),k=Array.from(h.values());for(let S=0;S<N.length;S++){const E=N[S],O=k.findIndex(T=>l(E,T,void 0,d,h,p,g));if(O===-1)return!1;k.splice(O,1)}return!0}case a.arrayTag:case a.uint8ArrayTag:case a.uint8ClampedArrayTag:case a.uint16ArrayTag:case a.uint32ArrayTag:case a.bigUint64ArrayTag:case a.int8ArrayTag:case a.int16ArrayTag:case a.int32ArrayTag:case a.bigInt64ArrayTag:case a.float32ArrayTag:case a.float64ArrayTag:{if(typeof Buffer<"u"&&Buffer.isBuffer(d)!==Buffer.isBuffer(h)||d.length!==h.length)return!1;for(let N=0;N<d.length;N++)if(!l(d[N],h[N],N,d,h,p,g))return!1;return!0}case a.arrayBufferTag:return d.byteLength!==h.byteLength?!1:u(new Uint8Array(d),new Uint8Array(h),p,g);case a.dataViewTag:return d.byteLength!==h.byteLength||d.byteOffset!==h.byteOffset?!1:u(new Uint8Array(d),new Uint8Array(h),p,g);case a.errorTag:return d.name===h.name&&d.message===h.message;case a.objectTag:{if(!(u(d.constructor,h.constructor,p,g)||t.isPlainObject(d)&&t.isPlainObject(h)))return!1;const k=[...Object.keys(d),...n.getSymbols(d)],S=[...Object.keys(h),...n.getSymbols(h)];if(k.length!==S.length)return!1;for(let E=0;E<k.length;E++){const O=k[E],T=d[O];if(!Object.hasOwn(h,O))return!1;const P=h[O];if(!l(T,P,O,d,h,p,g))return!1}return!0}default:return!1}}finally{p.delete(d),p.delete(h)}}e.isEqualWith=o}(I2)),I2}var F2={},_8;function Uke(){return _8||(_8=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(){}e.noop=t}(F2)),F2}var k8;function qke(){return k8||(k8=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bke(),n=Uke();function r(a,s){return t.isEqualWith(a,s,n.noop)}e.isEqual=r}($2)),$2}var z2,S8;function Hke(){return S8||(S8=1,z2=qke().isEqual),z2}var Kke=Hke();const Vke=ka(Kke);function Gke(e){var t={},n=()=>null,r=!1,a=null,s=o=>
514{if(!r){if(Array.isArray(o)){if(!o.length)return;var l=o,[u,...d]=l;if(typeof u=="number"){a=e.setTimeout(s.bind(null,d),u);return}s(u),a=e.setTimeout(s.bind(null,d));return}typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,a&&(a(),a=null),s(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}var gv=1e-4,MY=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],DY=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),C8=(e,t)=>n=>{var r=MY(e,t);return DY(r,n)},Wke=(e,t)=>n=>{var r=MY(e,t),a=[...r.map((s,o)=>s*o).slice(1),0];return DY(a,n)},E8=function(){for(var t,n,r,a,s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];if(o.length===1)switch(o[0]){case"linear":[t,r,n,a]=[0,0,1,1];break;case"ease":[t,r,n,a]=[.25,.1,.25,1];break;case"ease-in":[t,r,n,a]=[.42,0,1,1];break;case"ease-out":[t,r,n,a]=[.42,0,.58,1];break;case"ease-in-out":[t,r,n,a]=[0,0,.58,1];break;default:{var u=o[0].split("(");u[0]==="cubic-bezier"&&u[1].split(")")[0].split(",").length===4&&([t,r,n,a]=u[1].split(")")[0].split(",").map(y=>parseFloat(y)))}}else o.length===4&&([t,r,n,a]=o);var d=C8(t,n),h=C8(r,a),p=Wke(t,n),g=y=>y>1?1:y<0?0:y,x=y=>{for(var w=y>1?1:y,j=w,N=0;N<8;++N){var k=d(j)-w,S=p(j);if(Math.abs(k-w)<gv||S<gv)return h(j);j=g(j-k/S)}return h(j)};return x.isStepper=!1,x},Yke=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:a=17}=t,s=(o,l,u)=>{var d=-(o-l)*n,h=u*r,p=u+(d-h)*a/1e3,g=u*a/1e3+o;return Math.abs(g-l)<gv&&Math.abs(p)<gv?[l,0]:[g,p]};return s.isStepper=!0,s.dt=a,s},Xke=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return E8(e);case"spring":return Yke();default:if(e.split("(")[0]==="cubic-bezier")return E8(e)}return typeof e=="function"?e:null};function O8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function A8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O8(Object(n),!0).forEach(function(r){Qke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qke(e,t,n){return(t=Zke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zke(e){var t=Jke(e,"string");return typeof t=="symbol"?t:t+""}function Jke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var e2e=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),t2e=(e,t,n)=>e.map(r=>"".concat(e2e(r)," ").concat(t,"ms ").concat(n)).join(","),n2e=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(a=>r.includes(a))),tg=(e,t)=>Object.keys(t).reduce((n,r)=>A8(A8({},n),{},{[r]:e(r,t[r])}),{});function T8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Er(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T8(Object(n),!0).forEach(function(r){r2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r2e(e,t,n){return(t=a2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a2e(e){var t=s2e(e,"string");return typeof t=="symbol"?t:t+""}function s2e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xv=(e,t,n)=>e+(t-e)*n,LC=e=>{var{from:t,to:n}=e;return t!==n}
514,$Y=(e,t,n)=>{var r=tg((a,s)=>{if(LC(s)){var[o,l]=e(s.from,s.to,s.velocity);return Er(Er({},s),{},{from:o,velocity:l})}return s},t);return n<1?tg((a,s)=>LC(s)?Er(Er({},s),{},{velocity:xv(s.velocity,r[a].velocity,n),from:xv(s.from,r[a].from,n)}):s,t):$Y(e,r,n-1)};function i2e(e,t,n,r,a,s){var o,l=r.reduce((g,x)=>Er(Er({},g),{},{[x]:{from:e[x],velocity:0,to:t[x]}}),{}),u=()=>tg((g,x)=>x.from,l),d=()=>!Object.values(l).filter(LC).length,h=null,p=g=>{o||(o=g);var x=g-o,y=x/n.dt;l=$Y(n,l,y),a(Er(Er(Er({},e),t),u())),o=g,d()||(h=s.setTimeout(p))};return()=>(h=s.setTimeout(p),()=>{h()})}function o2e(e,t,n,r,a,s,o){var l=null,u=a.reduce((p,g)=>Er(Er({},p),{},{[g]:[e[g],t[g]]}),{}),d,h=p=>{d||(d=p);var g=(p-d)/r,x=tg((w,j)=>xv(...j,n(g)),u);if(s(Er(Er(Er({},e),t),x)),g<1)l=o.setTimeout(h);else{var y=tg((w,j)=>xv(...j,n(1)),u);s(Er(Er(Er({},e),t),y))}};return()=>(l=o.setTimeout(h),()=>{l()})}const l2e=(e,t,n,r,a,s)=>{var o=n2e(e,t);return n.isStepper===!0?i2e(e,t,n,o,a,s):o2e(e,t,n,r,o,a,s)};class c2e{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),a=null,s=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(a=requestAnimationFrame(s))};return a=requestAnimationFrame(s),()=>{cancelAnimationFrame(a)}}}var u2e=["children","begin","duration","attributeName","easing","isActive","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart","animationManager"];function FC(){return FC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FC.apply(null,arguments)}function d2e(e,t){if(e==null)return{};var n,r,a=f2e(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)&&(a[n]=e[n])}return a}function f2e(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}function P8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function kl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P8(Object(n),!0).forEach(function(r){tu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tu(e,t,n){return(t=h2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h2e(e){var t=p2e(e,"string");return typeof t=="symbol"?t:t+""}function p2e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m2e(){return Gke(new c2e)}class cT extends v.PureComponent{constructor(t,n){super(t,n),tu(this,"mounted",!1),tu(this,"manager",null),tu(this,"stopJSAnimation",null),tu(this,"unSubscribe",null);var{isActive:r,attributeName:a,from:s,to:o,children:l,duration:u,animationManager:d}=this.props;if(this.manager=d,this.handleStyleChange=this.handleStyleChange.bind(this),this.changeStyle=this.changeStyle.bind(this),!r||u<=0){this.state={style:{}},typeof l=="function"&&(this.state={style:o});return}if(s){if(typeof l=="function"){this.state={style:s};return}this.state={style:a?{[a]:s}:s}}else this.state={style:{}}}componentDidMount(){var{isActive:t,canBegin:n}=this.props;this.mounted=!0,!(!t||!n)&&this.runAnimation(this.props)}componentDidUpdate(t){var{isActive:n,canBegin:r,attributeName:a,shouldReAnimate:s,to:o,from:l}=this.props,{style:u}=this.state;if(r){if(!n){var d={style:a?{[a]:o}:o};this.state&&u&&(a&&u[a]!==o||!a&&u!==o)&&this.setState(d);return}if(!(Vke(t.to,o)&&t.canBegin&&t.isActive)){var h=!t.canBegin||!t.isActive;this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=h||s?l:t.to;if(this.state&&u){var g={style:a?{[a]:p}:p};(a&&u[a]!==p||!a&&u!==p)&&this.setState(g)}this.runAnimation(kl(kl({},this.props),{},{from:p,begin:0}))}}}componentWillUnmount(){this.mounted=!1;var{onAnimationEnd:t}=this.props;this.unSubscribe&&this.unSubscribe(),this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation(),t&&t()}handleStyleChange(t){this.changeStyle(t)}changeStyle(t){this.mounted&&this.setState({style:t})}runJSAnimation(t){var{from:n,to:r,duration:a,easing:s,begin:o,onAnimationEnd:l,onAnimationStart:u}=t,d=l2e(n,r,Xke(s),a,this.changeStyle,this.manager.getTimeoutController()),h=()=>{this.stopJSAnimation=d()};this.manager.start([u,o,h,a,l])}runAnimation(t){var{begin:n,duration:r,attributeName:a,to:s,easing:o,onAnimationStart:l,onAnimationEnd:u,children:d}=t;if(this.unSubscribe=this.manager.subscribe(this.handleStyleChange),typeof o=="function"||typeof d=="function"||o==="spring"){this.runJSAnimation(t);return}var h=a?{[a]:s}:s,p=t2e(Object.keys(h),r,o);this.manager.start([l,n,kl(kl({},h),{},{transition:p}),r,u])}render(){var t=this.props,{children:n,begin:r,duration:a,attributeName:s,easing:o,isActive:l,from:u,to:d,canBegin:h,onAnimationEnd:p,shouldReAnimate:g,onAnimationReStart:x,animationManager:y}=t,w=d2e(t,u2e),j=v.Children.count(n),N=this.state.style;if(typeof n=="function")return n(N);if(!l||j===0||a<=0)return n;var k=S=>
514{var{style:E={},className:O}=S.props,T=v.cloneElement(S,kl(kl({},w),{},{style:kl(kl({},E),N),className:O}));return T};return j===1?k(v.Children.only(n)):v.createElement("div",null,v.Children.map(n,S=>k(S)))}}tu(cT,"displayName","Animate");tu(cT,"defaultProps",{begin:0,duration:1e3,attributeName:"",easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}});var g2e=v.createContext(null);function Do(e){var t,n,r=v.useContext(g2e);return v.createElement(cT,FC({},e,{animationManager:(t=(n=e.animationManager)!==null&&n!==void 0?n:r)!==null&&t!==void 0?t:m2e()}))}function bv(){return bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bv.apply(null,arguments)}var R8=(e,t,n,r,a)=>{var s=Math.min(Math.abs(n)/2,Math.abs(r)/2),o=r>=0?1:-1,l=n>=0?1:-1,u=r>=0&&n>=0||r<0&&n<0?1:0,d;if(s>0&&a instanceof Array){for(var h=[0,0,0,0],p=0,g=4;p<g;p++)h[p]=a[p]>s?s:a[p];d="M".concat(e,",").concat(t+o*h[0]),h[0]>0&&(d+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(u,",").concat(e+l*h[0],",").concat(t)),d+="L ".concat(e+n-l*h[1],",").concat(t),h[1]>0&&(d+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(u,`, 515 `).concat(e+n,",").concat(t+o*h[1])),d+="L ".concat(e+n,",").concat(t+r-o*h[2]),h[2]>0&&(d+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(u,`, 516 `).concat(e+n-l*h[2],",").concat(t+r)),d+="L ".concat(e+l*h[3],",").concat(t+r),h[3]>0&&(d+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(u,`, 517 `).concat(e,",").concat(t+r-o*h[3])),d+="Z"}else if(s>0&&a===+a&&a>0){var x=Math.min(s,a);d="M ".concat(e,",").concat(t+o*x,` 518 A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(e+l*x,",").concat(t,` 519 L `).concat(e+n-l*x,",").concat(t,` 520 A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(e+n,",").concat(t+o*x,` 521 L `).concat(e+n,",").concat(t+r-o*x,` 522 A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(e+n-l*x,",").concat(t+r,` 523 L `).concat(e+l*x,",").concat(t+r,` 524 A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(e,",").concat(t+r-o*x," Z")}else d="M ".concat(e,",").concat(t," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return d},x2e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},IY=e=>{var t=as(e,x2e),n=v.useRef(null),[r,a]=v.useState(-1);v.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var N=n.current.getTotalLength();N&&a(N)}catch{}},[]);var{x:s,y:o,width:l,height:u,radius:d,className:h}=t,{animationEasing:p,animationDuration:g,animationBegin:x,isAnimationActive:y,isUpdateAnimationActive:w}=t;if(s!==+s||o!==+o||l!==+l||u!==+u||l===0||u===0)return null;var j=Xe("recharts-rectangle",h);return w?v.createElement(Do,{canBegin:r>0,from:{width:l,height:u,x:s,y:o},to:{width:l,height:u,x:s,y:o},duration:g,animationEasing:p,isActive:w},N=>{var{width:k,height:S,x:E,y:O}=N;return v.createElement(Do,{canBegin:r>0,from:"0px ".concat(r===-1?1:r,"px"),to:"".concat(r,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:g,isActive:y,easing:p},v.createElement("path",bv({},rt(t,!0),{className:j,d:R8(E,O,k,S,d),ref:n})))}):v.createElement("path",bv({},rt(t,!0),{className:j,d:R8(s,o,l,u,d)}))};function LY(e){var{cx:t,cy:n,radius:r,startAngle:a,endAngle:s}=e,o=Xn(t,n,r,a),l=Xn(t,n,r,s);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:a,endAngle:s}}function zC(){return zC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zC.apply(null,arguments)}var b2e=(e,t)=>{var n=gr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},f0=e=>{var{cx:t,cy:n,radius:r,angle:a,sign:s,isExternal:o,cornerRadius:l,cornerIsExternal:u}=e,d=l*(o?1:-1)+r,h=Math.asin(l/d)/pv,p=u?a:a+s*h,g=Xn(t,n,d,p),x=Xn(t,n,r,p),y=u?a-s*h:a,w=Xn(t,n,d*Math.cos(h*pv),y);return{center:g,circleTangency:x,lineTangency:w,theta:h}},FY=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:a,startAngle:s,endAngle:o}=e,l=b2e(s,o),u=s+l,d=Xn(t,n,a,s),h=Xn(t,n,a,u),p="M ".concat(d.x,",").concat(d.y,` 525 A `).concat(a,",").concat(a,`,0, 526 `).concat(+(Math.abs(l)>180),",").concat(+(s>u),`, 527 `).concat(h.x,",").concat(h.y,` 528 `);if(r>0){var g=Xn(t,n,r,s),x=Xn(t,n,r,u);p+="L ".concat(x.x,",").concat(x.y,` 529 A `).concat(r,",").concat(r,`,0, 530 `).concat(+(Math.abs(l)>180),",").concat(+(s<=u),`, 531 `).concat(g.x,",").concat(g.y," Z")}else p+="L ".concat(t,",").concat(n," Z");return p},y2e=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:a,cornerRadius:s,forceCornerRadius:o,cornerIsExternal:l,startAngle:u,endAngle:d}=e,h=gr(d-u),{circleTangency:p,lineTangency:g,theta:x}=f0({cx:t,cy:n,radius:a,angle:u,sign:h,cornerRadius:s,cornerIsExternal:l}),{circleTangency:y,lineTangency:w,theta:j}=f0({cx:t,cy:n,radius:a,angle:d,sign:-h,cornerRadius:s,cornerIsExternal:l}),N=l?Math.abs(u-d):Math.abs(u-d)-x-j;if(N<0)return o?"M ".concat(g.x,",").concat(g.y,` 532 a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 533 a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 534 `):FY({cx:t,cy:n,innerRadius:r,outerRadius:a,startAngle:u,endAngle:d});var k="M ".concat(g.x,",").concat(g.y,` 535 A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(p.x,",").concat(p.y,` 536 A`).concat(a,",").concat(a,",0,").concat(+(N>180),",").concat(+(h<0),",").concat(y.x,",").concat(y.y,` 537 A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(w.x,",").concat(w.y,` 538 `);if(r>0){var{circleTangency:S,lineTangency:E,theta:O}=f0({cx:t,cy:n,radius:r,angle:u,sign:h,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),{circleTangency:T,lineTangency:P,theta:M}=f0({cx:t,cy:n,radius:r,angle:d,sign:-h,isExternal:!0,cornerRadius:s,cornerIsExternal:l}
538),D=l?Math.abs(u-d):Math.abs(u-d)-O-M;if(D<0&&s===0)return"".concat(k,"L").concat(t,",").concat(n,"Z");k+="L".concat(P.x,",").concat(P.y,` 539 A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(T.x,",").concat(T.y,` 540 A`).concat(r,",").concat(r,",0,").concat(+(D>180),",").concat(+(h>0),",").concat(S.x,",").concat(S.y,` 541 A`).concat(s,",").concat(s,",0,0,").concat(+(h<0),",").concat(E.x,",").concat(E.y,"Z")}else k+="L".concat(t,",").concat(n,"Z");return k},v2e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},zY=e=>{var t=as(e,v2e),{cx:n,cy:r,innerRadius:a,outerRadius:s,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:h,className:p}=t;if(s<a||d===h)return null;var g=Xe("recharts-sector",p),x=s-a,y=ta(o,x,0,!0),w;return y>0&&Math.abs(d-h)<360?w=y2e({cx:n,cy:r,innerRadius:a,outerRadius:s,cornerRadius:Math.min(y,x/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:h}):w=FY({cx:n,cy:r,innerRadius:a,outerRadius:s,startAngle:d,endAngle:h}),v.createElement("path",zC({},rt(t,!0),{className:g,d:w}))};function w2e(e,t,n){var r,a,s,o;if(e==="horizontal")r=t.x,s=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,s=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var{cx:l,cy:u,innerRadius:d,outerRadius:h,angle:p}=t,g=Xn(l,u,d,p),x=Xn(l,u,h,p);r=g.x,a=g.y,s=x.x,o=x.y}else return LY(t);return[{x:r,y:a},{x:s,y:o}]}var B2={},U2={},q2={},M8;function j2e(){return M8||(M8=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GW();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n}(q2)),q2}var D8;function N2e(){return D8||(D8=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=j2e();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n}(U2)),U2}var $8;function _2e(){return $8||($8=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WW(),n=N2e();function r(a,s,o){o&&typeof o!="number"&&t.isIterateeCall(a,s,o)&&(s=o=void 0),a=n.toFinite(a),s===void 0?(s=a,a=0):s=n.toFinite(s),o=o===void 0?a<s?1:-1:n.toFinite(o);const l=Math.max(Math.ceil((s-a)/(o||1)),0),u=new Array(l);for(let d=0;d<l;d++)u[d]=a,a+=o;return u}e.range=r}(B2)),B2}var H2,I8;function k2e(){return I8||(I8=1,H2=_2e().range),H2}var S2e=k2e();const BY=ka(S2e);function Vl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function C2e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function uT(e){let t,n,r;e.length!==2?(t=Vl,n=(l,u)=>Vl(e(l),u),r=(l,u)=>e(l)-u):(t=e===Vl||e===C2e?e:E2e,n=e,r=e);function a(l,u,d=0,h=l.length){if(d<h){if(t(u,u)!==0)return h;do{const p=d+h>>>1;n(l[p],u)<0?d=p+1:h=p}while(d<h)}return d}function s(l,u,d=0,h=l.length){if(d<h){if(t(u,u)!==0)return h;do{const p=d+h>>>1;n(l[p],u)<=0?d=p+1:h=p}while(d<h)}return d}function o(l,u,d=0,h=l.length){const p=a(l,u,d,h-1);return p>d&&r(l[p-1],u)>-r(l[p],u)?p-1:p}return{left:a,center:o,right:s}}function E2e(){return 0}function UY(e){return e===null?NaN:+e}function*O2e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const A2e=uT(Vl),qg=A2e.right;uT(UY).center;class L8 extends Map{constructor(t,n=R2e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(F8(this,t))}has(t){return super.has(F8(this,t))}set(t,n){return super.set(T2e(this,t),n)}delete(t){return super.delete(P2e(this,t))}}function F8({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function T2e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function P2e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function R2e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function M2e(e=Vl){if(e===Vl)return qY;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function qY(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const D2e=Math.sqrt(50),$2e=Math.sqrt(10),I2e=Math.sqrt(2);function yv(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),s=r/Math.pow(10,a),o=s>=D2e?10:s>=$2e?5:s>=I2e?2:1;let l,u,d;return a<0?(d=Math.pow(10,-a)/o,l=Math.round(e*d),u=Math.round(t*d),l/d<e&&++l,u/d>t&&--u,d=-d):(d=Math.pow(10,a)*o,l=Math.round(e/d),u=Math.round(t/d),l*d<e&&++l,u*d>t&&--u),u<l&&.5<=n&&n<2?yv(e,t,n*2):[l,u,d]}function BC(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,s,o]=r?yv(t,e,n):yv(e,t,n);if(!(s>=a))return[];const l=s-a+1,u=new Array(l);if(r)if(o<0)for(let d=0;d<l;++d)u[d]=(s-d)/-o;else for(let d=0;d<l;++d)u[d]=(s-d)*o;else if(o<0)for(let d=0;d<l;++d)u[d]=(a+d)/-o;else for(let d=0;d<l;++d)u[d]=(a+d)*o;return u}function UC(e,t,n){return t=+t,e=+e,n=+n,yv(e,t,n)[2]}function qC(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?UC(t,e,n):UC(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function z8(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function B8(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function HY(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?qY:M2e(a);r>n;){if(r-n>600){const u=r-n+1,d=t-n+1,h=Math.log(u),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(u-p)/u)*(d-u/2<0?-1:1),x=Math.max(n,Math.floor(t-d*p/u+g)),y=Math.min(r,Math.floor(t+(u-d)*p/u+g));HY(e,t,x,y,a)}const s=e[t];let o=n,l=r;
541for(Xp(e,n,t),a(e[r],s)>0&&Xp(e,n,r);o<l;){for(Xp(e,o,l),++o,--l;a(e[o],s)<0;)++o;for(;a(e[l],s)>0;)--l}a(e[n],s)===0?Xp(e,n,l):(++l,Xp(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Xp(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function L2e(e,t,n){if(e=Float64Array.from(O2e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return B8(e);if(t>=1)return z8(e);var r,a=(r-1)*t,s=Math.floor(a),o=z8(HY(e,s).subarray(0,s+1)),l=B8(e.subarray(s+1));return o+(l-o)*(a-s)}}function F2e(e,t,n=UY){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,s=Math.floor(a),o=+n(e[s],s,e),l=+n(e[s+1],s+1,e);return o+(l-o)*(a-s)}}function z2e(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(a);++r<a;)s[r]=e+r*n;return s}function $s(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Wo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const HC=Symbol("implicit");function dT(){var e=new L8,t=[],n=[],r=HC;function a(s){let o=e.get(s);if(o===void 0){if(r!==HC)return r;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return a.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new L8;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(s){return arguments.length?(n=Array.from(s),a):n.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return dT(t,n).unknown(r)},$s.apply(a,arguments),a}function fT(){var e=dT().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,s,o,l=!1,u=0,d=0,h=.5;delete e.unknown;function p(){var g=t().length,x=a<r,y=x?a:r,w=x?r:a;s=(w-y)/Math.max(1,g-u+d*2),l&&(s=Math.floor(s)),y+=(w-y-s*(g-u))*h,o=s*(1-u),l&&(y=Math.round(y),o=Math.round(o));var j=z2e(g).map(function(N){return y+s*N});return n(x?j.reverse():j)}return e.domain=function(g){return arguments.length?(t(g),p()):t()},e.range=function(g){return arguments.length?([r,a]=g,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(g){return[r,a]=g,r=+r,a=+a,l=!0,p()},e.bandwidth=function(){return o},e.step=function(){return s},e.round=function(g){return arguments.length?(l=!!g,p()):l},e.padding=function(g){return arguments.length?(u=Math.min(1,d=+g),p()):u},e.paddingInner=function(g){return arguments.length?(u=Math.min(1,g),p()):u},e.paddingOuter=function(g){return arguments.length?(d=+g,p()):d},e.align=function(g){return arguments.length?(h=Math.max(0,Math.min(1,g)),p()):h},e.copy=function(){return fT(t(),[r,a]).round(l).paddingInner(u).paddingOuter(d).align(h)},$s.apply(p(),arguments)}function KY(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return KY(t())},e}function B2e(){return KY(fT.apply(null,arguments).paddingInner(1))}function hT(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function VY(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Hg(){}var ng=.7,vv=1/ng,Of="\\s*([+-]?\\d+)\\s*",rg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ai="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",U2e=/^#([0-9a-f]{3,8})$/,q2e=new RegExp(`^rgb\\(${Of},${Of},${Of}\\)$`),H2e=new RegExp(`^rgb\\(${Ai},${Ai},${Ai}\\)$`),K2e=new RegExp(`^rgba\\(${Of},${Of},${Of},${rg}\\)$`),V2e=new RegExp(`^rgba\\(${Ai},${Ai},${Ai},${rg}\\)$`),G2e=new RegExp(`^hsl\\(${rg},${Ai},${Ai}\\)$`),W2e=new RegExp(`^hsla\\(${rg},${Ai},${Ai},${rg}\\)$`),U8={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};hT(Hg,ag,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:q8,formatHex:q8,formatHex8:Y2e,formatHsl:X2e,formatRgb:H8,toString:H8});function q8(){return this.rgb().formatHex()}function Y2e(){return this.rgb().formatHex8()}function X2e(){return GY(this).formatHsl()}function H8(){return this.rgb().formatRgb()}function ag(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=U2e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?K8(t):n===3?new ga(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?h0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?h0(t>>
vendor: 4,252 bytes, line 541
54112&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=q2e.exec(e))?new ga(t[1],t[2],t[3],1):(t=H2e.exec(e))?new ga(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=K2e.exec(e))?h0(t[1],t[2],t[3],t[4]):(t=V2e.exec(e))?h0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=G2e.exec(e))?W8(t[1],t[2]/100,t[3]/100,1):(t=W2e.exec(e))?W8(t[1],t[2]/100,t[3]/100,t[4]):U8.hasOwnProperty(e)?K8(U8[e]):e==="transparent"?new ga(NaN,NaN,NaN,0):null}function K8(e){return new ga(e>>16&255,e>>8&255,e&255,1)}function h0(e,t,n,r){return r<=0&&(e=t=n=NaN),new ga(e,t,n,r)}function Q2e(e){return e instanceof Hg||(e=ag(e)),e?(e=e.rgb(),new ga(e.r,e.g,e.b,e.opacity)):new ga}function KC(e,t,n,r){return arguments.length===1?Q2e(e):new ga(e,t,n,r??1)}function ga(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}hT(ga,KC,VY(Hg,{brighter(e){return e=e==null?vv:Math.pow(vv,e),new ga(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ng:Math.pow(ng,e),new ga(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ga(bu(this.r),bu(this.g),bu(this.b),wv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:V8,formatHex:V8,formatHex8:Z2e,formatRgb:G8,toString:G8}));function V8(){return`#${nu(this.r)}${nu(this.g)}${nu(this.b)}`}function Z2e(){return`#${nu(this.r)}${nu(this.g)}${nu(this.b)}${nu((isNaN(this.opacity)?1:this.opacity)*255)}`}function G8(){const e=wv(this.opacity);return`${e===1?"rgb(":"rgba("}${bu(this.r)}, ${bu(this.g)}, ${bu(this.b)}${e===1?")":`, ${e})`}`}function wv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function bu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function nu(e){return e=bu(e),(e<16?"0":"")+e.toString(16)}function W8(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ys(e,t,n,r)}function GY(e){if(e instanceof Ys)return new Ys(e.h,e.s,e.l,e.opacity);if(e instanceof Hg||(e=ag(e)),!e)return new Ys;if(e instanceof Ys)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,l=s-a,u=(s+a)/2;return l?(t===s?o=(n-r)/l+(n<r)*6:n===s?o=(r-t)/l+2:o=(t-n)/l+4,l/=u<.5?s+a:2-s-a,o*=60):l=u>0&&u<1?0:o,new Ys(o,l,u,e.opacity)}function J2e(e,t,n,r){return arguments.length===1?GY(e):new Ys(e,t,n,r??1)}function Ys(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}hT(Ys,J2e,VY(Hg,{brighter(e){return e=e==null?vv:Math.pow(vv,e),new Ys(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ng:Math.pow(ng,e),new Ys(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new ga(K2(e>=240?e-240:e+120,a,r),K2(e,a,r),K2(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Ys(Y8(this.h),p0(this.s),p0(this.l),wv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=wv(this.opacity);return`${e===1?"hsl(":"hsla("}${Y8(this.h)}, ${p0(this.s)*100}%, ${p0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Y8(e){return e=(e||0)%360,e<0?e+360:e}function p0(e){return Math.max(0,Math.min(1,e||0))}function K2(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const pT=e=>()=>e;function e5e(e,t){return function(n){return e+n*t}}function t5e(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function n5e(e){return(e=+e)==1?WY:function(t,n){return n-t?t5e(t,n,e):pT(isNaN(t)?n:t)}}function WY(e,t){var n=t-e;return n?e5e(e,n):pT(isNaN(e)?t:e)}const X8=function e(t){var n=n5e(t);function r(a,s){var o=n((a=KC(a)).r,(s=KC(s)).r),l=n(a.g,s.g),u=n(a.b,s.b),d=WY(a.opacity,s.opacity);return function(h){return a.r=o(h),a.g=l(h),a.b=u(h),a.opacity=d(h),a+""}}return r.gamma=e,r}(1);function r5e(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(s){for(a=0;a<n;++a)r[a]=e[a]*(1-s)+t[a]*s;return r}}function a5e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function s5e(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),s=new Array(n),o;for(o=0;o<r;++o)a[o]=Nh(e[o],t[o]);for(;o<n;
vendor: 5,514 bytes, line 541
541++o)s[o]=t[o];return function(l){for(o=0;o<r;++o)s[o]=a[o](l);return s}}function i5e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function jv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function o5e(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Nh(e[a],t[a]):r[a]=t[a];return function(s){for(a in n)r[a]=n[a](s);return r}}var VC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,V2=new RegExp(VC.source,"g");function l5e(e){return function(){return e}}function c5e(e){return function(t){return e(t)+""}}function u5e(e,t){var n=VC.lastIndex=V2.lastIndex=0,r,a,s,o=-1,l=[],u=[];for(e=e+"",t=t+"";(r=VC.exec(e))&&(a=V2.exec(t));)(s=a.index)>n&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(r=r[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,u.push({i:o,x:jv(r,a)})),n=V2.lastIndex;return n<t.length&&(s=t.slice(n),l[o]?l[o]+=s:l[++o]=s),l.length<2?u[0]?c5e(u[0].x):l5e(t):(t=u.length,function(d){for(var h=0,p;h<t;++h)l[(p=u[h]).i]=p.x(d);return l.join("")})}function Nh(e,t){var n=typeof t,r;return t==null||n==="boolean"?pT(t):(n==="number"?jv:n==="string"?(r=ag(t))?(t=r,X8):u5e:t instanceof ag?X8:t instanceof Date?i5e:a5e(t)?r5e:Array.isArray(t)?s5e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?o5e:jv)(e,t)}function mT(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function d5e(e,t){t===void 0&&(t=e,e=Nh);for(var n=0,r=t.length-1,a=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(a,a=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return s[l](o-l)}}function f5e(e){return function(){return e}}function Nv(e){return+e}var Q8=[0,1];function Jr(e){return e}function GC(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:f5e(isNaN(t)?NaN:.5)}function h5e(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function p5e(e,t,n){var r=e[0],a=e[1],s=t[0],o=t[1];return a<r?(r=GC(a,r),s=n(o,s)):(r=GC(r,a),s=n(s,o)),function(l){return s(r(l))}}function m5e(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),s=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=GC(e[o],e[o+1]),s[o]=n(t[o],t[o+1]);return function(l){var u=qg(e,l,1,r)-1;return s[u](a[u](l))}}function Kg(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function cw(){var e=Q8,t=Q8,n=Nh,r,a,s,o=Jr,l,u,d;function h(){var g=Math.min(e.length,t.length);return o!==Jr&&(o=h5e(e[0],e[g-1])),l=g>2?m5e:p5e,u=d=null,p}function p(g){return g==null||isNaN(g=+g)?s:(u||(u=l(e.map(r),t,n)))(r(o(g)))}return p.invert=function(g){return o(a((d||(d=l(t,e.map(r),jv)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,Nv),h()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),h()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=mT,h()},p.clamp=function(g){return arguments.length?(o=g?!0:Jr,h()):o!==Jr},p.interpolate=function(g){return arguments.length?(n=g,h()):n},p.unknown=function(g){return arguments.length?(s=g,p):s},function(g,x){return r=g,a=x,h()}}function gT(){return cw()(Jr,Jr)}function g5e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function _v(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Qf(e){return e=_v(Math.abs(e)),e?e[1]:NaN}function x5e(e,t){return function(n,r){for(var a=n.length,s=[],o=0,l=e[0],u=0;a>0&&l>0&&(u+l+1>r&&(l=Math.max(1,r-u)),s.push(n.substring(a-=l,a+l)),!((u+=l+1)>r));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function b5e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var y5e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sg(e){if(!(t=y5e.exec(e)))throw new Error("invalid format: "+e);var t;return new xT({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}sg.prototype=xT.prototype;function xT(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}xT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function v5e(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var YY;function w5e(e,t){var n=_v(e,t);if(!n)return e+"";var r=n[0],a=n[1],s=a-(YY=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return s===o?r:s>o?r+new Array(s-o+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+_v(e,Math.max(0,t+s-1))[0]}function Z8(e,t){var n=_v(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const J8={"%":(e,t)=>
541(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:g5e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Z8(e*100,t),r:Z8,s:w5e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function e9(e){return e}var t9=Array.prototype.map,n9=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function j5e(e){var t=e.grouping===void 0||e.thousands===void 0?e9:x5e(t9.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?e9:b5e(t9.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"â":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function d(p){p=sg(p);var g=p.fill,x=p.align,y=p.sign,w=p.symbol,j=p.zero,N=p.width,k=p.comma,S=p.precision,E=p.trim,O=p.type;O==="n"?(k=!0,O="g"):J8[O]||(S===void 0&&(S=12),E=!0,O="g"),(j||g==="0"&&x==="=")&&(j=!0,g="0",x="=");var T=w==="$"?n:w==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():"",P=w==="$"?r:/[%p]/.test(O)?o:"",M=J8[O],D=/[defgprs%]/.test(O);S=S===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function A(L){var F=T,B=P,U,z,$;if(O==="c")B=M(L)+B,L="";else{L=+L;var K=L<0||1/L<0;if(L=isNaN(L)?u:M(Math.abs(L),S),E&&(L=v5e(L)),K&&+L==0&&y!=="+"&&(K=!1),F=(K?y==="("?y:l:y==="-"||y==="("?"":y)+F,B=(O==="s"?n9[8+YY/3]:"")+B+(K&&y==="("?")":""),D){for(U=-1,z=L.length;++U<z;)if($=L.charCodeAt(U),48>$||$>57){B=($===46?a+L.slice(U+1):L.slice(U))+B,L=L.slice(0,U);break}}}k&&!j&&(L=t(L,1/0));var G=F.length+L.length+B.length,W=G<N?new Array(N-G+1).join(g):"";switch(k&&j&&(L=t(W+L,W.length?N-B.length:1/0),W=""),x){case"<":L=F+L+B+W;break;case"=":L=F+W+L+B;break;case"^":L=W.slice(0,G=W.length>>1)+F+L+B+W.slice(G);break;default:L=W+F+L+B;break}return s(L)}return A.toString=function(){return p+""},A}function h(p,g){var x=d((p=sg(p),p.type="f",p)),y=Math.max(-8,Math.min(8,Math.floor(Qf(g)/3)))*3,w=Math.pow(10,-y),j=n9[8+y/3];return function(N){return x(w*N)+j}}return{format:d,formatPrefix:h}}var m0,bT,XY;N5e({thousands:",",grouping:[3],currency:["$",""]});function N5e(e){return m0=j5e(e),bT=m0.format,XY=m0.formatPrefix,m0}function _5e(e){return Math.max(0,-Qf(Math.abs(e)))}function k5e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Qf(t)/3)))*3-Qf(Math.abs(e)))}function S5e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Qf(t)-Qf(e))+1}function QY(e,t,n,r){var a=qC(e,t,n),s;switch(r=sg(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=k5e(a,o))&&(r.precision=s),XY(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=S5e(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=_5e(a))&&(r.precision=s-(r.type==="%")*2);break}}return bT(r)}function dc(e){var t=e.domain;return e.ticks=function(n){var r=t();return BC(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return QY(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,s=r.length-1,o=r[a],l=r[s],u,d,h=10;for(l<o&&(d=o,o=l,l=d,d=a,a=s,s=d);h-- >0;){if(d=UC(o,l,n),d===u)return r[a]=o,r[s]=l,t(r);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;u=d}return e},e}function ZY(){var e=gT();return e.copy=function(){return Kg(e,ZY())},$s.apply(e,arguments),dc(e)}function JY(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Nv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return JY(e).unknown(t)},e=arguments.length?Array.from(e,Nv):[0,1],dc(n)}function eX(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],s=e[r],o;return s<a&&(o=n,n=r,r=o,o=a,a=s,s=o),e[n]=t.floor(a),e[r]=t.ceil(s),e}function r9(e){return Math.log(e)}function a9(e){return Math.exp(e)}function C5e(e){return-Math.log(-e)}function E5e(e){return-Math.exp(-e)}function O5e(e){return isFinite(e)?+("1e"+e):e<0?0:e}function A5e(e){return e===10?O5e:e===Math.E?Math.exp:t=>Math.pow(e,t)}function T5e(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function s9(e){return(t,n)=>-e(-t,n)}function yT(e){const t=e(r9,a9),n=t.domain;let r=10,a,s;function o(){return a=T5e(r),s=A5e(r),n()[0]<0?(a=s9(a),s=s9(s),e(C5e,E5e)):e(r9,a9),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const u=n();let d=u[0],h=u[u.length-1];const p=h<d;p&&([d,h]=[h,d]);let g=a(d),x=a(h),y,w;const j=l==null?10:+l;let N=[];if(!(r%1)&&x-g<j){if(g=Math.floor(g),x=Math.ceil(x),d>0){for(;g<=x;++g)for(y=1;y<r;++y)if(w=g<0?y/s(-g):y*s(g),!(w<d)){if(w>h)break;N.push(w)}}else for(;g<=x;++g)for(y=r-1;y>=1;--y)if(w=g>0?y/s(-g):y*s(g),!(w<d)){if(w>h)break;N.push(w)}N.length*2<j&&(N=BC(d,h,j))}else N=BC(g,x,Math.min(x-g,j)).map(s);return p?N.reverse():N},t.tickFormat=(l,u)=>{if(l==null&&(l=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=sg(u)).precision==null&&(u.trim=!0),u=bT(u)),l===1/0)return u;const d=Math.max(1,r*l/t.ticks().length);return h=>{let p=h/s(Math.round(a(h)));return p*r<r-.5&&(p*=r),p<=d?u(h):""}},t.nice=()=>n(eX(n(),{floor:l=>s(Math.floor(a(l))),ceil:l=>s(Math.ceil(a(l)))})),t}function tX(){const e=yT(cw()).domain([1,10]);return e.copy=()=>Kg(e,tX()).base(e.base()),$s.apply(e,arguments),e}
541function i9(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function o9(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function vT(e){var t=1,n=e(i9(t),o9(t));return n.constant=function(r){return arguments.length?e(i9(t=+r),o9(t)):t},dc(n)}function nX(){var e=vT(cw());return e.copy=function(){return Kg(e,nX()).constant(e.constant())},$s.apply(e,arguments)}function l9(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function P5e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function R5e(e){return e<0?-e*e:e*e}function wT(e){var t=e(Jr,Jr),n=1;function r(){return n===1?e(Jr,Jr):n===.5?e(P5e,R5e):e(l9(n),l9(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},dc(t)}function jT(){var e=wT(cw());return e.copy=function(){return Kg(e,jT()).exponent(e.exponent())},$s.apply(e,arguments),e}function M5e(){return jT.apply(null,arguments).exponent(.5)}function c9(e){return Math.sign(e)*e*e}function D5e(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function rX(){var e=gT(),t=[0,1],n=!1,r;function a(s){var o=D5e(e(s));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(s){return e.invert(c9(s))},a.domain=function(s){return arguments.length?(e.domain(s),a):e.domain()},a.range=function(s){return arguments.length?(e.range((t=Array.from(s,Nv)).map(c9)),a):t.slice()},a.rangeRound=function(s){return a.range(s).round(!0)},a.round=function(s){return arguments.length?(n=!!s,a):n},a.clamp=function(s){return arguments.length?(e.clamp(s),a):e.clamp()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.copy=function(){return rX(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},$s.apply(a,arguments),dc(a)}function aX(){var e=[],t=[],n=[],r;function a(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=F2e(e,o/l);return s}function s(o){return o==null||isNaN(o=+o)?r:t[qg(n,o)]}return s.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Vl),a()},s.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},s.unknown=function(o){return arguments.length?(r=o,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return aX().domain(e).range(t).unknown(r)},$s.apply(s,arguments)}function sX(){var e=0,t=1,n=1,r=[.5],a=[0,1],s;function o(u){return u!=null&&u<=u?a[qg(r,u,0,n)]:s}function l(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*t-(u-n)*e)/(n+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,l()):[e,t]},o.range=function(u){return arguments.length?(n=(a=Array.from(u)).length-1,l()):a.slice()},o.invertExtent=function(u){var d=a.indexOf(u);return d<0?[NaN,NaN]:d<1?[e,r[0]]:d>=n?[r[n-1],t]:[r[d-1],r[d]]},o.unknown=function(u){return arguments.length&&(s=u),o},o.thresholds=function(){return r.slice()},o.copy=function(){return sX().domain([e,t]).range(a).unknown(s)},$s.apply(dc(o),arguments)}function iX(){var e=[.5],t=[0,1],n,r=1;function a(s){return s!=null&&s<=s?t[qg(e,s,0,r)]:n}return a.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},a.unknown=function(s){return arguments.length?(n=s,a):n},a.copy=function(){return iX().domain(e).range(t).unknown(n)},$s.apply(a,arguments)}const G2=new Date,W2=new Date;function ir(e,t,n,r){function a(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return a.floor=s=>(e(s=new Date(+s)),s),a.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),a.round=s=>{const o=a(s),l=a.ceil(s);return s-o<l-s?o:l},a.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),a.range=(s,o,l)=>{const u=[];if(s=a.ceil(s),l=l==null?1:Math.floor(l),!(s<o)||!(l>0))return u;let d;do u.push(d=new Date(+s)),t(s,l),e(s);while(d<s&&s<o);return u},a.filter=s=>ir(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),n&&(a.count=(s,o)=>(G2.setTime(+s),W2.setTime(+o),e(G2),e(W2),Math.floor(n(G2,W2))),a.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?a.filter(r?o=>r(o)%s===0:o=>a.count(0,o)%s===0):a)),a}const kv=ir(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);kv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ir(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):kv);kv.range;const wo=1e3,ws=wo*60,jo=ws*60,$o=jo*24,NT=$o*7,u9=$o*30,Y2=$o*365,ru=ir(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*wo)},(e,t)=>(t-e)/wo,e=>e.getUTCSeconds());ru.range;const _T=ir(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wo)},(e,t)=>{e.setTime(+e+t*ws)},(e,t)=>(t-e)/ws,e=>e.getMinutes());_T.range;
541const kT=ir(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ws)},(e,t)=>(t-e)/ws,e=>e.getUTCMinutes());kT.range;const ST=ir(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*wo-e.getMinutes()*ws)},(e,t)=>{e.setTime(+e+t*jo)},(e,t)=>(t-e)/jo,e=>e.getHours());ST.range;const CT=ir(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*jo)},(e,t)=>(t-e)/jo,e=>e.getUTCHours());CT.range;const Vg=ir(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ws)/$o,e=>e.getDate()-1);Vg.range;const uw=ir(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$o,e=>e.getUTCDate()-1);uw.range;const oX=ir(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$o,e=>Math.floor(e/$o));oX.range;function Yu(e){return ir(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ws)/NT)}const dw=Yu(0),Sv=Yu(1),$5e=Yu(2),I5e=Yu(3),Zf=Yu(4),L5e=Yu(5),F5e=Yu(6);dw.range;Sv.range;$5e.range;I5e.range;Zf.range;L5e.range;F5e.range;function Xu(e){return ir(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/NT)}const fw=Xu(0),Cv=Xu(1),z5e=Xu(2),B5e=Xu(3),Jf=Xu(4),U5e=Xu(5),q5e=Xu(6);fw.range;Cv.range;z5e.range;B5e.range;Jf.range;U5e.range;q5e.range;const ET=ir(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ET.range;const OT=ir(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());OT.range;const Io=ir(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Io.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ir(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Io.range;const Lo=ir(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Lo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ir(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Lo.range;function lX(e,t,n,r,a,s){const o=[[ru,1,wo],[ru,5,5*wo],[ru,15,15*wo],[ru,30,30*wo],[s,1,ws],[s,5,5*ws],[s,15,15*ws],[s,30,30*ws],[a,1,jo],[a,3,3*jo],[a,6,6*jo],[a,12,12*jo],[r,1,$o],[r,2,2*$o],[n,1,NT],[t,1,u9],[t,3,3*u9],[e,1,Y2]];function l(d,h,p){const g=h<d;g&&([d,h]=[h,d]);const x=p&&typeof p.range=="function"?p:u(d,h,p),y=x?x.range(d,+h+1):[];return g?y.reverse():y}function u(d,h,p){const g=Math.abs(h-d)/p,x=uT(([,,j])=>j).right(o,g);if(x===o.length)return e.every(qC(d/Y2,h/Y2,p));if(x===0)return kv.every(Math.max(qC(d,h,p),1));const[y,w]=o[g/o[x-1][2]<o[x][2]/g?x-1:x];return y.every(w)}return[l,u]}const[H5e,K5e]=lX(Lo,OT,fw,oX,CT,kT),[V5e,G5e]=lX(Io,ET,dw,Vg,ST,_T);function X2(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Q2(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Qp(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function W5e(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,s=e.days,o=e.shortDays,l=e.months,u=e.shortMonths,d=Zp(a),h=Jp(a),p=Zp(s),g=Jp(s),x=Zp(o),y=Jp(o),w=Zp(l),j=Jp(l),N=Zp(u),k=Jp(u),S={a:K,A:G,b:W,B:I,c:null,d:g9,e:g9,f:xSe,g:CSe,G:OSe,H:pSe,I:mSe,j:gSe,L:cX,m:bSe,M:ySe,p:H,q:V,Q:y9,s:v9,S:vSe,u:wSe,U:jSe,V:NSe,w:_Se,W:kSe,x:null,X:null,y:SSe,Y:ESe,Z:ASe,"%":b9},E={a:X,A:te,b:fe,B:ae,c:null,d:x9,e:x9,f:MSe,g:HSe,G:VSe,H:TSe,I:PSe,j:RSe,L:dX,m:DSe,M:$Se,p:ke,q:xe,Q:y9,s:v9,S:ISe,u:LSe,U:FSe,V:zSe,w:BSe,W:USe,x:null,X:null,y:qSe,Y:KSe,Z:GSe,"%":b9}
vendor: 4,403 bytes, line 541
541,O={a:A,A:L,b:F,B,c:U,d:p9,e:p9,f:uSe,g:h9,G:f9,H:m9,I:m9,j:iSe,L:cSe,m:sSe,M:oSe,p:D,q:aSe,Q:fSe,s:hSe,S:lSe,u:J5e,U:eSe,V:tSe,w:Z5e,W:nSe,x:z,X:$,y:h9,Y:f9,Z:rSe,"%":dSe};S.x=T(n,S),S.X=T(r,S),S.c=T(t,S),E.x=T(n,E),E.X=T(r,E),E.c=T(t,E);function T(ue,we){return function(Oe){var ne=[],_e=-1,ye=0,Me=ue.length,qe,be,Ce;for(Oe instanceof Date||(Oe=new Date(+Oe));++_e<Me;)ue.charCodeAt(_e)===37&&(ne.push(ue.slice(ye,_e)),(be=d9[qe=ue.charAt(++_e)])!=null?qe=ue.charAt(++_e):be=qe==="e"?" ":"0",(Ce=we[qe])&&(qe=Ce(Oe,be)),ne.push(qe),ye=_e+1);return ne.push(ue.slice(ye,_e)),ne.join("")}}function P(ue,we){return function(Oe){var ne=Qp(1900,void 0,1),_e=M(ne,ue,Oe+="",0),ye,Me;if(_e!=Oe.length)return null;if("Q"in ne)return new Date(ne.Q);if("s"in ne)return new Date(ne.s*1e3+("L"in ne?ne.L:0));if(we&&!("Z"in ne)&&(ne.Z=0),"p"in ne&&(ne.H=ne.H%12+ne.p*12),ne.m===void 0&&(ne.m="q"in ne?ne.q:0),"V"in ne){if(ne.V<1||ne.V>53)return null;"w"in ne||(ne.w=1),"Z"in ne?(ye=Q2(Qp(ne.y,0,1)),Me=ye.getUTCDay(),ye=Me>4||Me===0?Cv.ceil(ye):Cv(ye),ye=uw.offset(ye,(ne.V-1)*7),ne.y=ye.getUTCFullYear(),ne.m=ye.getUTCMonth(),ne.d=ye.getUTCDate()+(ne.w+6)%7):(ye=X2(Qp(ne.y,0,1)),Me=ye.getDay(),ye=Me>4||Me===0?Sv.ceil(ye):Sv(ye),ye=Vg.offset(ye,(ne.V-1)*7),ne.y=ye.getFullYear(),ne.m=ye.getMonth(),ne.d=ye.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),Me="Z"in ne?Q2(Qp(ne.y,0,1)).getUTCDay():X2(Qp(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(Me+5)%7:ne.w+ne.U*7-(Me+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,Q2(ne)):X2(ne)}}function M(ue,we,Oe,ne){for(var _e=0,ye=we.length,Me=Oe.length,qe,be;_e<ye;){if(ne>=Me)return-1;if(qe=we.charCodeAt(_e++),qe===37){if(qe=we.charAt(_e++),be=O[qe in d9?we.charAt(_e++):qe],!be||(ne=be(ue,Oe,ne))<0)return-1}else if(qe!=Oe.charCodeAt(ne++))return-1}return ne}function D(ue,we,Oe){var ne=d.exec(we.slice(Oe));return ne?(ue.p=h.get(ne[0].toLowerCase()),Oe+ne[0].length):-1}function A(ue,we,Oe){var ne=x.exec(we.slice(Oe));return ne?(ue.w=y.get(ne[0].toLowerCase()),Oe+ne[0].length):-1}function L(ue,we,Oe){var ne=p.exec(we.slice(Oe));return ne?(ue.w=g.get(ne[0].toLowerCase()),Oe+ne[0].length):-1}function F(ue,we,Oe){var ne=N.exec(we.slice(Oe));return ne?(ue.m=k.get(ne[0].toLowerCase()),Oe+ne[0].length):-1}function B(ue,we,Oe){var ne=w.exec(we.slice(Oe));return ne?(ue.m=j.get(ne[0].toLowerCase()),Oe+ne[0].length):-1}function U(ue,we,Oe){return M(ue,t,we,Oe)}function z(ue,we,Oe){return M(ue,n,we,Oe)}function $(ue,we,Oe){return M(ue,r,we,Oe)}function K(ue){return o[ue.getDay()]}function G(ue){return s[ue.getDay()]}function W(ue){return u[ue.getMonth()]}function I(ue){return l[ue.getMonth()]}function H(ue){return a[+(ue.getHours()>=12)]}function V(ue){return 1+~~(ue.getMonth()/3)}function X(ue){return o[ue.getUTCDay()]}function te(ue){return s[ue.getUTCDay()]}function fe(ue){return u[ue.getUTCMonth()]}function ae(ue){return l[ue.getUTCMonth()]}function ke(ue){return a[+(ue.getUTCHours()>=12)]}function xe(ue){return 1+~~(ue.getUTCMonth()/3)}return{format:function(ue){var we=T(ue+="",S);return we.toString=function(){return ue},we},parse:function(ue){var we=P(ue+="",!1);return we.toString=function(){return ue},we},utcFormat:function(ue){var we=T(ue+="",E);return we.toString=function(){return ue},we},utcParse:function(ue){var we=P(ue+="",!0);return we.toString=function(){return ue},we}}}var d9={"-":"",_:" ",0:"0"},vr=/^\s*\d+/,Y5e=/^%/,X5e=/[\\^$*+?|[\]().{}]/g;function xt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",s=a.length;return r+(s<n?new Array(n-s+1).join(t)+a:a)}function Q5e(e){return e.replace(X5e,"\\$&")}function Zp(e){return new RegExp("^(?:"+e.map(Q5e).join("|")+")","i")}function Jp(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Z5e(e,t,n){var r=vr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function J5e(e,t,n){var r=vr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function eSe(e,t,n){var r=vr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function tSe(e,t,n){var r=vr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function nSe(e,t,n){var r=vr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function f9(e,t,n){var r=vr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function h9(e,t,n){var r=vr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}
vendor: 8,540 bytes, line 541
541function rSe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function aSe(e,t,n){var r=vr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function sSe(e,t,n){var r=vr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function p9(e,t,n){var r=vr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function iSe(e,t,n){var r=vr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function m9(e,t,n){var r=vr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function oSe(e,t,n){var r=vr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function lSe(e,t,n){var r=vr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function cSe(e,t,n){var r=vr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function uSe(e,t,n){var r=vr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function dSe(e,t,n){var r=Y5e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function fSe(e,t,n){var r=vr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function hSe(e,t,n){var r=vr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function g9(e,t){return xt(e.getDate(),t,2)}function pSe(e,t){return xt(e.getHours(),t,2)}function mSe(e,t){return xt(e.getHours()%12||12,t,2)}function gSe(e,t){return xt(1+Vg.count(Io(e),e),t,3)}function cX(e,t){return xt(e.getMilliseconds(),t,3)}function xSe(e,t){return cX(e,t)+"000"}function bSe(e,t){return xt(e.getMonth()+1,t,2)}function ySe(e,t){return xt(e.getMinutes(),t,2)}function vSe(e,t){return xt(e.getSeconds(),t,2)}function wSe(e){var t=e.getDay();return t===0?7:t}function jSe(e,t){return xt(dw.count(Io(e)-1,e),t,2)}function uX(e){var t=e.getDay();return t>=4||t===0?Zf(e):Zf.ceil(e)}function NSe(e,t){return e=uX(e),xt(Zf.count(Io(e),e)+(Io(e).getDay()===4),t,2)}function _Se(e){return e.getDay()}function kSe(e,t){return xt(Sv.count(Io(e)-1,e),t,2)}function SSe(e,t){return xt(e.getFullYear()%100,t,2)}function CSe(e,t){return e=uX(e),xt(e.getFullYear()%100,t,2)}function ESe(e,t){return xt(e.getFullYear()%1e4,t,4)}function OSe(e,t){var n=e.getDay();return e=n>=4||n===0?Zf(e):Zf.ceil(e),xt(e.getFullYear()%1e4,t,4)}function ASe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+xt(t/60|0,"0",2)+xt(t%60,"0",2)}function x9(e,t){return xt(e.getUTCDate(),t,2)}function TSe(e,t){return xt(e.getUTCHours(),t,2)}function PSe(e,t){return xt(e.getUTCHours()%12||12,t,2)}function RSe(e,t){return xt(1+uw.count(Lo(e),e),t,3)}function dX(e,t){return xt(e.getUTCMilliseconds(),t,3)}function MSe(e,t){return dX(e,t)+"000"}function DSe(e,t){return xt(e.getUTCMonth()+1,t,2)}function $Se(e,t){return xt(e.getUTCMinutes(),t,2)}function ISe(e,t){return xt(e.getUTCSeconds(),t,2)}function LSe(e){var t=e.getUTCDay();return t===0?7:t}function FSe(e,t){return xt(fw.count(Lo(e)-1,e),t,2)}function fX(e){var t=e.getUTCDay();return t>=4||t===0?Jf(e):Jf.ceil(e)}function zSe(e,t){return e=fX(e),xt(Jf.count(Lo(e),e)+(Lo(e).getUTCDay()===4),t,2)}function BSe(e){return e.getUTCDay()}function USe(e,t){return xt(Cv.count(Lo(e)-1,e),t,2)}function qSe(e,t){return xt(e.getUTCFullYear()%100,t,2)}function HSe(e,t){return e=fX(e),xt(e.getUTCFullYear()%100,t,2)}function KSe(e,t){return xt(e.getUTCFullYear()%1e4,t,4)}function VSe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Jf(e):Jf.ceil(e),xt(e.getUTCFullYear()%1e4,t,4)}function GSe(){return"+0000"}function b9(){return"%"}function y9(e){return+e}function v9(e){return Math.floor(+e/1e3)}var Yd,hX,pX;WSe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function WSe(e){return Yd=W5e(e),hX=Yd.format,Yd.parse,pX=Yd.utcFormat,Yd.utcParse,Yd}function YSe(e){return new Date(e)}function XSe(e){return e instanceof Date?+e:+new Date(+e)}function AT(e,t,n,r,a,s,o,l,u,d){var h=gT(),p=h.invert,g=h.domain,x=d(".%L"),y=d(":%S"),w=d("%I:%M"),j=d("%I %p"),N=d("%a %d"),k=d("%b %d"),S=d("%B"),E=d("%Y");function O(T){return(u(T)<T?x:l(T)<T?y:o(T)<T?w:s(T)<T?j:r(T)<T?a(T)<T?N:k:n(T)<T?S:E)(T)}return h.invert=function(T){return new Date(p(T))},h.domain=function(T){return arguments.length?g(Array.from(T,XSe)):g().map(YSe)},h.ticks=function(T){var P=g();return e(P[0],P[P.length-1],T??10)},h.tickFormat=function(T,P){return P==null?O:d(P)},h.nice=function(T){var P=g();return(!T||typeof T.range!="function")&&(T=t(P[0],P[P.length-1],T??10)),T?g(eX(P,T)):h},h.copy=function(){return Kg(h,AT(e,t,n,r,a,s,o,l,u,d))},h}function QSe(){return $s.apply(AT(V5e,G5e,Io,ET,dw,Vg,ST,_T,ru,hX).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ZSe(){return $s.apply(AT(H5e,K5e,Lo,OT,fw,uw,CT,kT,ru,pX).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function hw(){var e=0,t=1,n,r,a,s,o=Jr,l=!1,u;function d(p){return p==null||isNaN(p=+p)?u:o(a===0?.5:(p=(s(p)-n)*a,l?Math.max(0,Math.min(1,p)):p))}d.domain=function(p){return arguments.length?([e,t]=p,n=s(e=+e),r=s(t=+t),a=n===r?0:1/(r-n),d):[e,t]},d.clamp=function(p){return arguments.length?(l=!!p,d):l},d.interpolator=function(p){return arguments.length?(o=p,d):o};function h(p){return function(g){var x,y;return arguments.length?([x,y]=g,o=p(x,y),d):[o(0),o(1)]}}return d.range=h(Nh),d.rangeRound=h(mT),d.unknown=function(p){return arguments.length?(u=p,d):u},function(p){return s=p,n=p(e),r=p(t),a=n===r?0:1/(r-n),d}}function fc(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function mX(){var e=dc(hw()(Jr));return e.copy=function(){return fc(e,mX())},Wo.apply(e,arguments)}function gX(){var e=yT(hw()).domain([1,10]);return e.copy=function(){return fc(e,gX()).base(e.base())},Wo.apply(e,arguments)}function xX(){var e=vT(hw());return e.copy=function(){return fc(e,xX()).constant(e.constant())},Wo.apply(e,arguments)}function TT(){var e=wT(hw());return e.copy=function(){return fc(e,TT()).exponent(e.exponent())},Wo.apply(e,arguments)}function JSe(){return TT.apply(null,arguments).exponent(.5)}function bX(){var e=[],t=Jr;function n(r){if(r!=null&&!isNaN(r=+r))return t((qg(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Vl),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,s)=>L2e(e,s/r))},n.copy=function(){return bX(t).domain(e)},Wo.apply(n,arguments)}function pw(){var e=0,t=.5,n=1,r=1,a,s,o,l,u,d=Jr,h,p=!1,g;function x(w){return isNaN(w=+w)?g:(w=.5+((w=+h(w))-s)*(r*w<r*s?l:u),d(p?Math.max(0,Math.min(1,w)):w))}x.domain=function(w){return arguments.length?([e,t,n]=w,a=h(e=+e),s=h(t=+t),o=h(n=+n),l=a===s?0:.5/(s-a),u=s===o?0:.5/(o-s),r=s<a?-1:1,x):[e,t,n]},x.clamp=function(w){return arguments.length?(p=!!w,x):p},x.interpolator=function(w){return arguments.length?(d=w,x):d};function y(w){return function(j){var N,k,S;return arguments.length?([N,k,S]=j,d=d5e(w,[N,k,S]),x):[d(0),d(.5),d(1)]}}return x.range=y(Nh),x.rangeRound=y(mT),x.unknown=function(w){return arguments.length?(g=w,x):g},function(w){return h=w,a=w(e),s=w(t),o=w(n),l=a===s?0:.5/(s-a),u=s===o?0:.5/(o-s),r=s<a?-1:1,x}}function yX(){var e=dc(pw()(Jr));return e.copy=function(){return fc(e,yX())},Wo.apply(e,arguments)}function vX(){var e=yT(pw()).domain([.1,1,10]);return e.copy=function(){return fc(e,vX()).base(e.base())},Wo.apply(e,arguments)}function wX(){var e=vT(pw());return e.copy=function(){return fc(e,wX()).constant(e.constant())},Wo.apply(e,arguments)}function PT(){var e=wT(pw());return e.copy=function(){return fc(e,PT()).exponent(e.exponent())},Wo.apply(e,arguments)}function eCe(){return PT.apply(null,arguments).exponent(.5)}const xm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:fT,scaleDiverging:yX,scaleDivergingLog:vX,scaleDivergingPow:PT,scaleDivergingSqrt:eCe,scaleDivergingSymlog:wX,scaleIdentity:JY,scaleImplicit:HC,scaleLinear:ZY,scaleLog:tX,scaleOrdinal:dT,scalePoint:B2e,scalePow:jT,scaleQuantile:aX,scaleQuantize:sX,scaleRadial:rX,scaleSequential:mX,scaleSequentialLog:gX,scaleSequentialPow:TT,scaleSequentialQuantile:bX,scaleSequentialSqrt:J
541Se,scaleSequentialSymlog:xX,scaleSqrt:M5e,scaleSymlog:nX,scaleThreshold:iX,scaleTime:QSe,scaleUtc:ZSe,tickFormat:QY},Symbol.toStringTag,{value:"Module"}));var Qu=e=>e.chartData,RT=ie([Qu],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),mw=(e,t,n,r)=>r?RT(e):Qu(e);function eh(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Pr(t)&&Pr(n))return!0}return!1}function w9(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function tCe(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,a,s;if(Pr(n))a=n;else if(typeof n=="function")return;if(Pr(r))s=r;else if(typeof r=="function")return;var o=[a,s];if(eh(o))return o}}function nCe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(eh(r))return w9(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[a,s]=e,o,l;if(a==="auto")t!=null&&(o=Math.min(...t));else if(Pe(a))o=a;else if(typeof a=="function")try{t!=null&&(o=a(t?.[0]))}catch{}else if(typeof a=="string"&&u8.test(a)){var u=u8.exec(a);if(u==null||t==null)o=void 0;else{var d=+u[1];o=t[0]-d}}else o=t?.[0];if(s==="auto")t!=null&&(l=Math.max(...t));else if(Pe(s))l=s;else if(typeof s=="function")try{t!=null&&(l=s(t?.[1]))}catch{}else if(typeof s=="string"&&d8.test(s)){var h=d8.exec(s);if(h==null||t==null)l=void 0;else{var p=+h[1];l=t[1]+p}}else l=t?.[1];var g=[o,l];if(eh(g))return t==null?g:w9(g,t,n)}}}var _h=1e9,rCe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},DT,fn=!0,Ts="[DecimalError] ",yu=Ts+"Invalid argument: ",MT=Ts+"Exponent out of range: ",kh=Math.floor,Gc=Math.pow,aCe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Va,pr=1e7,rn=7,jX=9007199254740991,Ev=kh(jX/rn),$e={};$e.absoluteValue=$e.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};$e.comparedTo=$e.cmp=function(e){var t,n,r,a,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===a?0:r>a^s.s<0?1:-1};$e.decimalPlaces=$e.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*rn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};$e.dividedBy=$e.div=function(e){return Co(this,new this.constructor(e))};$e.dividedToIntegerBy=$e.idiv=function(e){var t=this,n=t.constructor;return Ht(Co(t,new n(e),0,1),n.precision)};$e.equals=$e.eq=function(e){return!this.cmp(e)};$e.exponent=function(){return Qn(this)};$e.greaterThan=$e.gt=function(e){return this.cmp(e)>0};$e.greaterThanOrEqualTo=$e.gte=function(e){return this.cmp(e)>=0};$e.isInteger=$e.isint=function(){return this.e>this.d.length-2};$e.isNegative=$e.isneg=function(){return this.s<0};$e.isPositive=$e.ispos=function(){return this.s>0};$e.isZero=function(){return this.s===0};$e.lessThan=$e.lt=function(e){return this.cmp(e)<0};$e.lessThanOrEqualTo=$e.lte=function(e){return this.cmp(e)<1};$e.logarithm=$e.log=function(e){var t,n=this,r=n.constructor,a=r.precision,s=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Va))throw Error(Ts+"NaN");if(n.s<1)throw Error(Ts+(n.s?"NaN":"-Infinity"));return n.eq(Va)?new r(0):(fn=!1,t=Co(ig(n,s),ig(e,s),s),fn=!0,Ht(t,a))};$e.minus=$e.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kX(t,e):NX(t,(e.s=-e.s,e))};$e.modulo=$e.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Ts+"NaN");return n.s?(fn=!1,t=Co(n,e,0,1).times(e),fn=!0,n.minus(t)):Ht(new r(n),a)};$e.naturalExponential=$e.exp=function(){return _X(this)};$e.naturalLogarithm=$e.ln=function(){return ig(this)};$e.negated=$e.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};$e.plus=$e.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?NX(t,e):kX(t,(e.s=-e.s,e))};$e.precision=$e.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(yu+e);if(t=Qn(a)+1,r=a.d.length-1,n=r*rn+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};$e.squareRoot=$e.sqrt=function(){var e,t,n,r,a,s,o,l=this,u=l.constructor;if(l.s<1){if(!l.s)return new u(0);throw Error(Ts+"NaN")}for(e=Qn(l),fn=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=_i(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=kh((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new u(t)):r=new u(a.toString()),n=u.precision,a=o=n+3;;)if(s=r,r=s.plus(Co(l,s,o+2)).times(.5),_i(s.d).slice(0,o)===(t=_i(r.d)).slice(0,o)){if
541(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(Ht(s,n+1,0),s.times(s).eq(l)){r=s;break}}else if(t!="9999")break;o+=4}return fn=!0,Ht(r,n)};$e.times=$e.mul=function(e){var t,n,r,a,s,o,l,u,d,h=this,p=h.constructor,g=h.d,x=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,u=g.length,d=x.length,u<d&&(s=g,g=x,x=s,o=u,u=d,d=o),s=[],o=u+d,r=o;r--;)s.push(0);for(r=d;--r>=0;){for(t=0,a=u+r;a>r;)l=s[a]+x[r]*g[a-r-1]+t,s[a--]=l%pr|0,t=l/pr|0;s[a]=(s[a]+t)%pr|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,fn?Ht(e,p.precision):e};$e.toDecimalPlaces=$e.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Di(e,0,_h),t===void 0?t=r.rounding:Di(t,0,8),Ht(n,e+Qn(n)+1,t))};$e.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=$u(r,!0):(Di(e,0,_h),t===void 0?t=a.rounding:Di(t,0,8),r=Ht(new a(r),e+1,t),n=$u(r,!0,e+1)),n};$e.toFixed=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?$u(a):(Di(e,0,_h),t===void 0?t=s.rounding:Di(t,0,8),r=Ht(new s(a),e+Qn(a)+1,t),n=$u(r.abs(),!1,e+Qn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};$e.toInteger=$e.toint=function(){var e=this,t=e.constructor;return Ht(new t(e),Qn(e)+1,t.rounding)};$e.toNumber=function(){return+this};$e.toPower=$e.pow=function(e){var t,n,r,a,s,o,l=this,u=l.constructor,d=12,h=+(e=new u(e));if(!e.s)return new u(Va);if(l=new u(l),!l.s){if(e.s<1)throw Error(Ts+"Infinity");return l}if(l.eq(Va))return l;if(r=u.precision,e.eq(Va))return Ht(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,s=l.s,o){if((n=h<0?-h:h)<=jX){for(a=new u(Va),t=Math.ceil(r/rn+4),fn=!1;n%2&&(a=a.times(l),N9(a.d,t)),n=kh(n/2),n!==0;)l=l.times(l),N9(l.d,t);return fn=!0,e.s<0?new u(Va).div(a):Ht(a,r)}}else if(s<0)throw Error(Ts+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,fn=!1,a=e.times(ig(l,r+d)),fn=!0,a=_X(a),a.s=s,a};$e.toPrecision=function(e,t){var n,r,a=this,s=a.constructor;return e===void 0?(n=Qn(a),r=$u(a,n<=s.toExpNeg||n>=s.toExpPos)):(Di(e,1,_h),t===void 0?t=s.rounding:Di(t,0,8),a=Ht(new s(a),e,t),n=Qn(a),r=$u(a,e<=n||n<=s.toExpNeg,e)),r};$e.toSignificantDigits=$e.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Di(e,1,_h),t===void 0?t=r.rounding:Di(t,0,8)),Ht(new r(n),e,t)};$e.toString=$e.valueOf=$e.val=$e.toJSON=$e[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Qn(e),n=e.constructor;return $u(e,t<=n.toExpNeg||t>=n.toExpPos)};function NX(e,t){var n,r,a,s,o,l,u,d,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),fn?Ht(t,p):t;if(u=e.d,d=t.d,o=e.e,a=t.e,u=u.slice(),s=o-a,s){for(s<0?(r=u,s=-s,l=d.length):(r=d,a=o,l=u.length),o=Math.ceil(p/rn),l=o>l?o+1:l+1,s>l&&(s=l,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(l=u.length,s=d.length,l-s<0&&(s=l,r=d,d=u,u=r),n=0;s;)n=(u[--s]=u[s]+d[s]+n)/pr|0,u[s]%=pr;for(n&&(u.unshift(n),++a),l=u.length;u[--l]==0;)u.pop();return t.d=u,t.e=a,fn?Ht(t,p):t}function Di(e,t,n){if(e!==~~e||e<t||e>n)throw Error(yu+e)}function _i(e){var t,n,r,a=e.length-1,s="",o=e[0];if(a>0){for(s+=o,t=1;t<a;t++)r=e[t]+"",n=rn-r.length,n&&(s+=Tl(n)),s+=r;o=e[t],r=o+"",n=rn-r.length,n&&(s+=Tl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}var Co=function(){function e(r,a){var s,o=0,l=r.length;for(r=r.slice();l--;)s=r[l]*a+o,r[l]=s%pr|0,o=s/pr|0;return o&&r.unshift(o),r}function t(r,a,s,o){var l,u;if(s!=o)u=s>o?1:-1;else for(l=u=0;l<s;l++)if(r[l]!=a[l]){u=r[l]>a[l]?1:-1;break}return u}function n(r,a,s){for(var o=0;s--;)r[s]-=o,o=r[s]<a[s]?1:0,r[s]=o*pr+r[s]-a[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,s,o){var l,u,d,h,p,g,x,y,w,j,N,k,S,E,O,T,P,M,D=r.constructor,A=r.s==a.s?1:-1,L=r.d,F=a.d;if(!r.s)return new D(r);if(!a.s)throw Error(Ts+"Division by zero");for(u=r.e-a.e,P=F.length,O=L.length,x=new D(A),y=x.d=[],d=0;F[d]==(L[d]||0);)++d;if(F[d]>(L[d]||0)&&--u,s==null?k=s=D.precision:o?k=s+(Qn(r)-Qn(a))+1:k=s,k<0)return new D(0);if(k=k/rn+2|0,d=0,P==1)for(h=0,F=F[0],k++;(d<O||h)&&k--;d++)S=h*pr+(L[d]||0),y[d]=S/F|0,h=S%F|0;else{for(h=pr/(F[0]+1)|0,h>1&&(F=e(F,h),L=e(L,h),P=F.length,O=L.length),E=P,w=L.slice(0,P),j=w.length;j<P;)w[j++]=0;M=F.slice(),M.unshift(0),T=F[0],F[1]>=pr/2&&++T;do h=0,l=t(F,w,P,j),l<0?(N=w[0],P!=j&&(N=N*pr+(w[1]||0)),h=N/T|0,h>1?(h>=pr&&(h=pr-1),p=e(F,h),g=p.length,j=w.length,l=t(p,w,g,j),l==1&&(h--,n(p,P<g?M:F,g))):(h==0&&(l=h=1),p=F.slice()),g=p.length,g<j&&p.unshift(0),n(w,p,j),l==-1&&(j=w.length,l=t(F,w,P,j),l<1&&(h++,n(w,P<j?M:F,j))),j=w.length):l===0&&(h++,w=[0]),y[d++]=h,l&&w[0]?w[j++]=L[E]||0:(w=[L[E]],j=1);while((E++<O||w[0]!==void 0)&&k--)}
541return y[0]||y.shift(),x.e=u,Ht(x,o?s+Qn(x)+1:s)}}();function _X(e,t){var n,r,a,s,o,l,u=0,d=0,h=e.constructor,p=h.precision;if(Qn(e)>16)throw Error(MT+Qn(e));if(!e.s)return new h(Va);for(fn=!1,l=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(r=Math.log(Gc(2,d))/Math.LN10*2+5|0,l+=r,n=a=s=new h(Va),h.precision=l;;){if(a=Ht(a.times(e),l),n=n.times(++u),o=s.plus(Co(a,n,l)),_i(o.d).slice(0,l)===_i(s.d).slice(0,l)){for(;d--;)s=Ht(s.times(s),l);return h.precision=p,t==null?(fn=!0,Ht(s,p)):s}s=o}}function Qn(e){for(var t=e.e*rn,n=e.d[0];n>=10;n/=10)t++;return t}function Z2(e,t,n){if(t>e.LN10.sd())throw fn=!0,n&&(e.precision=n),Error(Ts+"LN10 precision limit exceeded");return Ht(new e(e.LN10),t)}function Tl(e){for(var t="";e--;)t+="0";return t}function ig(e,t){var n,r,a,s,o,l,u,d,h,p=1,g=10,x=e,y=x.d,w=x.constructor,j=w.precision;if(x.s<1)throw Error(Ts+(x.s?"NaN":"-Infinity"));if(x.eq(Va))return new w(0);if(t==null?(fn=!1,d=j):d=t,x.eq(10))return t==null&&(fn=!0),Z2(w,d);if(d+=g,w.precision=d,n=_i(y),r=n.charAt(0),s=Qn(x),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=_i(x.d),r=n.charAt(0),p++;s=Qn(x),r>1?(x=new w("0."+n),s++):x=new w(r+"."+n.slice(1))}else return u=Z2(w,d+2,j).times(s+""),x=ig(new w(r+"."+n.slice(1)),d-g).plus(u),w.precision=j,t==null?(fn=!0,Ht(x,j)):x;for(l=o=x=Co(x.minus(Va),x.plus(Va),d),h=Ht(x.times(x),d),a=3;;){if(o=Ht(o.times(h),d),u=l.plus(Co(o,new w(a),d)),_i(u.d).slice(0,d)===_i(l.d).slice(0,d))return l=l.times(2),s!==0&&(l=l.plus(Z2(w,d+2,j).times(s+""))),l=Co(l,new w(p),d),w.precision=j,t==null?(fn=!0,Ht(l,j)):l;l=u,a+=2}}function j9(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=kh(n/rn),e.d=[],r=(n+1)%rn,n<0&&(r+=rn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=rn;r<a;)e.d.push(+t.slice(r,r+=rn));t=t.slice(r),r=rn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),fn&&(e.e>Ev||e.e<-Ev))throw Error(MT+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ht(e,t,n){var r,a,s,o,l,u,d,h,p=e.d;for(o=1,s=p[0];s>=10;s/=10)o++;if(r=t-o,r<0)r+=rn,a=t,d=p[h=0];else{if(h=Math.ceil((r+1)/rn),s=p.length,h>=s)return e;for(d=s=p[h],o=1;s>=10;s/=10)o++;r%=rn,a=r-rn+o}if(n!==void 0&&(s=Gc(10,o-a-1),l=d/s%10|0,u=t<0||p[h+1]!==void 0||d%s,u=n<4?(l||u)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||u||n==6&&(r>0?a>0?d/Gc(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return u?(s=Qn(e),p.length=1,t=t-s-1,p[0]=Gc(10,(rn-t%rn)%rn),e.e=kh(-t/rn)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,s=1,h--):(p.length=h+1,s=Gc(10,rn-r),p[h]=a>0?(d/Gc(10,o-a)%Gc(10,a)|0)*s:0),u)for(;;)if(h==0){(p[0]+=s)==pr&&(p[0]=1,++e.e);break}else{if(p[h]+=s,p[h]!=pr)break;p[h--]=0,s=1}for(r=p.length;p[--r]===0;)p.pop();if(fn&&(e.e>Ev||e.e<-Ev))throw Error(MT+Qn(e));return e}function kX(e,t){var n,r,a,s,o,l,u,d,h,p,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),fn?Ht(t,x):t;if(u=e.d,p=t.d,r=t.e,d=e.e,u=u.slice(),o=d-r,o){for(h=o<0,h?(n=u,o=-o,l=p.length):(n=p,r=d,l=u.length),a=Math.max(Math.ceil(x/rn),l)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=u.length,l=p.length,h=a<l,h&&(l=a),a=0;a<l;a++)if(u[a]!=p[a]){h=u[a]<p[a];break}o=0}for(h&&(n=u,u=p,p=n,t.s=-t.s),l=u.length,a=p.length-l;a>0;--a)u[l++]=0;for(a=p.length;a>o;){if(u[--a]<p[a]){for(s=a;s&&u[--s]===0;)u[s]=pr-1;--u[s],u[a]+=pr}u[a]-=p[a]}for(;u[--l]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(t.d=u,t.e=r,fn?Ht(t,x):t):new g(0)}function $u(e,t,n){var r,a=Qn(e),s=_i(e.d),o=s.length;return t?(n&&(r=n-o)>0?s=s.charAt(0)+"."+s.slice(1)+Tl(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(a<0?"e":"e+")+a):a<0?(s="0."+Tl(-a-1)+s,n&&(r=n-o)>0&&(s+=Tl(r))):a>=o?(s+=Tl(a+1-o),n&&(r=n-a-1)>0&&(s=s+"."+Tl(r))):((r=a+1)<o&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(s+="."),s+=Tl(r))),e.s<0?"-"+s:s}function N9(e,t){if(e.length>t)return e.length=t,!0}function SX(e){var t,n,r;function a(s){var o=this;if(!(o instanceof a))return new a(s);if(o.constructor=a,s instanceof a){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(yu+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return j9(o,s.toString())}
541else if(typeof s!="string")throw Error(yu+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,aCe.test(s))j9(o,s);else throw Error(yu+s)}if(a.prototype=$e,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=SX,a.config=a.set=sCe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return a.config(e),a}function sCe(e){if(!e||typeof e!="object")throw Error(Ts+"Object expected");var t,n,r,a=["precision",1,_h,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(kh(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(yu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(yu+n+": "+r);return this}var DT=SX(rCe);Va=new DT(1);const St=DT;var iCe=e=>e,CX={},EX=e=>e===CX,_9=e=>function t(){return arguments.length===0||arguments.length===1&&EX(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},OX=(e,t)=>e===1?t:_9(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];var s=r.filter(o=>o!==CX).length;return s>=e?t(...r):OX(e-s,_9(function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];var d=r.map(h=>EX(h)?l.shift():h);return t(...d,...l)}))}),gw=e=>OX(e.length,e),WC=(e,t)=>{for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},oCe=gw((e,t)=>Array.isArray(t)?t.map(e):Object.keys(t).map(n=>t[n]).map(e)),lCe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return iCe;var a=n.reverse(),s=a[0],o=a.slice(1);return function(){return o.reduce((l,u)=>u(l),s(...arguments))}},YC=e=>Array.isArray(e)?e.reverse():e.split("").reverse().join(""),AX=e=>{var t=null,n=null;return function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return t&&a.every((o,l)=>{var u;return o===((u=t)===null||u===void 0?void 0:u[l])}
541)||(t=a,n=e(...a)),n}};function TX(e){var t;return e===0?t=1:t=Math.floor(new St(e).abs().log(10).toNumber())+1,t}function PX(e,t,n){for(var r=new St(e),a=0,s=[];r.lt(t)&&a<1e5;)s.push(r.toNumber()),r=r.add(n),a++;return s}gw((e,t,n)=>{var r=+e,a=+t;return r+n*(a-r)});gw((e,t,n)=>{var r=t-+e;return r=r||1/0,(n-e)/r});gw((e,t,n)=>{var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});var RX=e=>{var[t,n]=e,[r,a]=[t,n];return t>n&&([r,a]=[n,t]),[r,a]},MX=(e,t,n)=>{if(e.lte(0))return new St(0);var r=TX(e.toNumber()),a=new St(10).pow(r),s=e.div(a),o=r!==1?.05:.1,l=new St(Math.ceil(s.div(o).toNumber())).add(n).mul(o),u=l.mul(a);return t?new St(u.toNumber()):new St(Math.ceil(u.toNumber()))},cCe=(e,t,n)=>{var r=new St(1),a=new St(e);if(!a.isint()&&n){var s=Math.abs(e);s<1?(r=new St(10).pow(TX(e)-1),a=new St(Math.floor(a.div(r).toNumber())).mul(r)):s>1&&(a=new St(Math.floor(e)))}else e===0?a=new St(Math.floor((t-1)/2)):n||(a=new St(Math.floor(e)));var o=Math.floor((t-1)/2),l=lCe(oCe(u=>a.add(new St(u-o).mul(r)).toNumber()),WC);return l(0,t)},DX=function(t,n,r,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new St(0),tickMin:new St(0),tickMax:new St(0)};var o=MX(new St(n).sub(t).div(r-1),a,s),l;t<=0&&n>=0?l=new St(0):(l=new St(t).add(n).div(2),l=l.sub(new St(l).mod(o)));var u=Math.ceil(l.sub(t).div(o).toNumber()),d=Math.ceil(new St(n).sub(l).div(o).toNumber()),h=u+d+1;return h>r?DX(t,n,r,a,s+1):(h<r&&(d=n>0?d+(r-h):d,u=n>0?u:u+(r-h)),{step:o,tickMin:l.sub(new St(u).mul(o)),tickMax:l.add(new St(
541d).mul(o))})};function uCe(e){var[t,n]=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(r,2),[o,l]=RX([t,n]);if(o===-1/0||l===1/0){var u=l===1/0?[o,...WC(0,r-1).map(()=>1/0)]:[...WC(0,r-1).map(()=>-1/0),l];return t>n?YC(u):u}if(o===l)return cCe(o,r,a);var{step:d,tickMin:h,tickMax:p}=DX(o,l,s,a,0),g=PX(h,p.add(new St(.1).mul(d)),d);return t>n?YC(g):g}function dCe(e,t){var[n,r]=e,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[s,o]=RX([n,r]);if(s===-1/0||o===1/0)return[n,r];if(s===o)return[s];var l=Math.max(t,2),u=MX(new St(o).sub(s).div(l-1),a,0),d=[...PX(new St(s),new St(o),u),o];return a===!1&&(d=d.map(h=>Math.round(h))),n>r?YC(d):d}var fCe=AX(uCe),hCe=AX(dCe),$X=e=>e.rootProps.maxBarSize,pCe=e=>e.rootProps.barGap,IX=e=>e.rootProps.barCategoryGap,mCe=e=>e.rootProps.barSize,Gg=e=>e.rootProps.stackOffset,$T=e=>e.options.chartName,IT=e=>e.rootProps.syncId,LX=e=>e.rootProps.syncMethod,LT=e=>e.options.eventEmitter,bo={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},qa={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},xw=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},gCe={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:bo.angleAxisId,includeHidden:!1,name:void 0,reversed:bo.reversed,scale:bo.scale,tick:bo.tick,tickCount:void 0,ticks:void 0,type:bo.type,unit:void 0},xCe={allowDataOverflow:qa.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:qa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:qa.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:qa.scale,tick:qa.tick,tickCount:qa.tickCount,ticks:void 0,type:qa.type,unit:void 0},bCe={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:bo.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:bo.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:bo.scale,tick:bo.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},yCe={allowDataOverflow:qa.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:qa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:qa.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:qa.scale,tick:qa.tick,tickCount:qa.tickCount,ticks:void 0,type:"category",unit:void 0},FT=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?bCe:gCe,zT=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?yCe:xCe,bw=e=>e.polarOptions,BT=ie([Vo,Go,sr],vY),FX=ie([bw,BT],(e,t)=>{if(e!=null)return ta(e.innerRadius,t,0)}),zX=ie([bw,BT],(e,t)=>{if(e!=null)return ta(e.outerRadius,t,t*.8)}),vCe=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},BX=ie([bw],vCe);ie([FT,BX],xw);var UX=ie([BT,FX,zX],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});ie([zT,UX],xw);var wCe=ie([ht,bw,FX,zX,Vo,Go],(e,t,n,r,a,s)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:l,startAngle:u,endAngle:d}=t;return{cx:ta(o,a,a/2),cy:ta(l,s,s/2),innerRadius:n,outerRadius:r,startAngle:u,endAngle:d,clockWise:!1}}}),Ln=(e,t)=>t,Wg=(e,t,n)=>n;function k9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ov(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k9(Object(n),!0).forEach(function(r){jCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jCe(e,t,n){return(t=NCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NCe(e){var t=_Ce(e,"string");return typeof t=="symbol"?t:t+""}function _Ce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var XC=[0,"auto"],za={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},Yo=(e,t)=>{var n=e.cartesianAxis.xAxis[t];return n??za},Ba={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:XC,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:iw},hc=(e,t)=>{var n=e.cartesianAxis.yAxis[t];return n??Ba},kCe={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},UT=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??kCe},Fn=(e,t,n)=>{switch(t){case"xAxis":return Yo(e,n);case"yAxis":return hc(e,n);case"zAxis":return UT(e,n);case"angleAxis":return FT(e,n);case"radiusAxis":return zT(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},SCe=(e,t,n)=>{switch(t){case"xAxis":return Yo(e,n);case"yAxis":return hc(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Yg=(e,t,n)=>{switch(t){case"xAxis":return Yo(e,n);case"yAxis":return hc(e,n);case"angleAxis":return FT(e,n);case"radiusAxis":return zT(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},qX=e=>e.graphicalItems.countOfBars>0;function qT(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var Xg=e=>e.graphicalItems.cartesianItems,CCe=ie([Ln,Wg],qT),HT=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Qg=ie([Xg,Fn,CCe],HT),HX=e=>e.filter(t=>t.stackId===void 0),ECe=ie([Qg],HX),KT=e=>e.map(t=>
541t.data).filter(Boolean).flat(1),OCe=ie([Qg],KT),VT=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:a}=t;return e.length>0?e:n.slice(r,a+1)},yw=ie([OCe,mw],VT),GT=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Bt(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(a=>({value:Bt(a,r)}))):e.map(r=>({value:r})),vw=ie([yw,Fn,Qg],GT);function KX(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Zu(e){return e.filter(t=>Os(t)||t instanceof Date).map(Number).filter(t=>Na(t)===!1)}function ACe(e,t,n){return!n||typeof t!="number"||Na(t)?[]:n.length?Zu(n.flatMap(r=>{var a=Bt(e,r.dataKey),s,o;if(Array.isArray(a)?[s,o]=a:s=o=a,!(!Pr(s)||!Pr(o)))return[t-s,t+o]})):[]}var VX=(e,t,n)=>{var r={},a=t.reduce((s,o)=>(o.stackId==null||(s[o.stackId]==null&&(s[o.stackId]=[]),s[o.stackId].push(o)),s),r);return Object.fromEntries(Object.entries(a).map(s=>{var[o,l]=s,u=l.map(d=>d.dataKey);return[o,{stackedData:H_e(e,u,n),graphicalItems:l}]}))},og=ie([yw,Qg,Gg],VX),GX=(e,t,n)=>{var{dataStartIndex:r,dataEndIndex:a}=t;if(n!=="zAxis"){var s=W_e(e,r,a);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},TCe=ie([og,Qu,Ln],GX),WX=(e,t,n,r)=>n.length>0?e.flatMap(a=>n.flatMap(s=>{var o,l,u=(o=s.errorBars)===null||o===void 0?void 0:o.filter(h=>KX(r,h)),d=Bt(a,(l=t.dataKey)!==null&&l!==void 0?l:s.dataKey);return{value:d,errorDomain:ACe(a,d,u)}})).filter(Boolean):t?.dataKey!=null?e.map(a=>({value:Bt(a,t.dataKey),errorDomain:[]})):e.map(a=>({value:a,errorDomain:[]})),PCe=ie(yw,Fn,ECe,Ln,WX);function RCe(e){var{value:t}=e;if(Os(t)||t instanceof Date)return t}var MCe=e=>{var t=e.flatMap(r=>[r.value,r.errorDomain]).flat(1),n=Zu(t);if(n.length!==0)return[Math.min(...n),Math.max(...n)]},DCe=(e,t,n)=>{var r=e.map(RCe).filter(a=>a!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&bW(r))?BY(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},WT=e=>{var t;if(e==null||!("domain"in e))return XC;if(e.domain!=null)return e.domain;if(e.ticks!=null){if(e.type==="number"){var n=Zu(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:XC},YT=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n.filter(Boolean);if(a.length!==0){var s=a.flat(),o=Math.min(...s),l=Math.max(...s);return[o,l]}},YX=e=>e.referenceElements.dots,Sh=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),$Ce=ie([YX,Ln,Wg],Sh),XX=e=>e.referenceElements.areas,ICe=ie([XX,Ln,Wg],Sh),QX=e=>e.referenceElements.lines,LCe=ie([QX,Ln,Wg],Sh),ZX=(e,t)=>{var n=Zu(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]},FCe=ie($Ce,Ln,ZX),JX=(e,t)=>{var n=Zu(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]},zCe=ie([ICe,Ln],JX),eQ=(e,t)=>{var n=Zu(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]},BCe=ie(LCe,Ln,eQ),UCe=ie(FCe,BCe,zCe,(e,t,n)=>YT(e,n,t)),tQ=ie([Fn],WT),XT=(e,t,n,r,a)=>{var s=tCe(t,e.allowDataOverflow);return s??nCe(t,YT(n,a,MCe(r)),e.allowDataOverflow)},qCe=ie([Fn,tQ,TCe,PCe,UCe],XT),HCe=[0,1],QT=(e,t,n,r,a,s,o)=>{if(!(e==null||n==null||n.length===0)){var{dataKey:l,type:u}=e,d=Ui(t,s);return d&&l==null?BY(0,n.length):u==="category"?DCe(r,e,d):a==="expand"?HCe:o}},ZT=ie([Fn,ht,yw,vw,Gg,Ln,qCe],QT),nQ=(e,t,n,r,a)=>{if(e!=null){var{scale:s,type:o}=e;if(s==="auto")return t==="radial"&&a==="radiusAxis"?"band":t==="radial"&&a==="angleAxis"?"linear":o==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>
541=0||r.indexOf("ComposedChart")>=0&&!n)?"point":o==="category"?"band":"linear";if(typeof s=="string"){var l="scale".concat(Fg(s));return l in xm?l:"point"}}},Ch=ie([Fn,ht,qX,$T,Ln],nQ);function KCe(e){if(e!=null){if(e in xm)return xm[e]();var t="scale".concat(Fg(e));if(t in xm)return xm[t]()}}function JT(e,t,n,r){if(!(n==null||r==null)){if(typeof e.scale=="function")return e.scale.copy().domain(n).range(r);var a=KCe(t);if(a!=null){var s=a.domain(n).range(r);return F_e(s),s}}}var eP=(e,t,n)=>{var r=WT(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(r)&&(r[0]==="auto"||r[1]==="auto")&&eh(e))return fCe(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&eh(e))return hCe(e,t.tickCount,t.allowDecimals)}},tP=ie([ZT,Yg,Ch],eP),nP=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&eh(t)&&Array.isArray(n)&&n.length>0){var a=t[0],s=n[0],o=t[1],l=n[n.length-1];return[Math.min(a,s),Math.max(o,l)]}return t},VCe=ie([Fn,ZT,tP,Ln],nP),GCe=ie(vw,Fn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Zu(e.map(l=>l.value))).sort((l,u)=>l-u);if(r.length<2)return 1/0;var a=r[r.length-1]-r[0];if(a===0)return 1/0;for(var s=0;s<r.length-1;s++){var o=r[s+1]-r[s];n=Math.min(n,o)}return n/a}}),rQ=ie(GCe,ht,IX,sr,(e,t,n,r)=>r,(e,t,n,r,a)=>{if(!Pr(e))return 0;var s=t==="vertical"?r.height:r.width;if(a==="gap")return e*s/2;if(a==="no-gap"){var o=ta(n,e*s),l=e*s/2;return l-o-(l-o)/s*o}return 0}),WCe=(e,t)=>{var n=Yo(e,t);return n==null||typeof n.padding!="string"?0:rQ(e,"xAxis",t,n.padding)},YCe=(e,t)=>{var n=hc(e,t);return n==null||typeof n.padding!="string"?0:rQ(e,"yAxis",t,n.padding)},XCe=ie(Yo,WCe,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:a}=e;return typeof a=="string"?{left:t,right:t}:{left:((n=a.left)!==null&&n!==void 0?n:0)+t,right:((r=a.right)!==null&&r!==void 0?r:0)+t}}),QCe=ie(hc,YCe,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:a}=e;return typeof a=="string"?{top:t,bottom:t}:{top:((n=a.top)!==null&&n!==void 0?n:0)+t,bottom:((r=a.bottom)!==null&&r!==void 0?r:0)+t}}),ZCe=ie([sr,XCe,lw,ow,(e,t,n)=>n],(e,t,n,r,a)=>{var{padding:s}=r;return a?[s.left,n.width-s.right]:[e.left+t.left,e.left+e.width-t.right]}),JCe=ie([sr,ht,QCe,lw,ow,(e,t,n)=>n],(e,t,n,r,a,s)=>{var{padding:o}=a;return s?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Zg=(e,t,n,r)=>{var a;switch(t){case"xAxis":return ZCe(e,n,r);case"yAxis":return JCe(e,n,r);case"zAxis":return(a=UT(e,n))===null||a===void 0?void 0:a.range;case"angleAxis":return BX(e);case"radiusAxis":return UX(e,n);default:return}},aQ=ie([Fn,Zg],xw),ec=ie([Fn,Ch,VCe,aQ],JT);ie(Qg,Ln,(e,t)=>e.flatMap(n=>{var r;return(r=n.errorBars)!==null&&r!==void 0?r:[]}).filter(n=>KX(t,n)));function sQ(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var ww=(e,t)=>t,jw=(e,t,n)=>n,eEe=ie(iT,ww,jw,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(sQ)),tEe=ie(oT,ww,jw,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(sQ)),iQ=(e,t)=>({width:e.width,height:t.height}),nEe=(e,t)=>{var n=typeof t.width=="number"?t.width:iw;return{width:n,height:e.height}},oQ=ie(sr,Yo,iQ),rEe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},aEe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},sEe=ie(Go,sr,eEe,ww,jw,(e,t,n,r,a)=>{var s={},o;return n.forEach(l=>{var u=iQ(t,l);o==null&&(o=rEe(t,r,e));var d=r==="top"&&!a||r==="bottom"&&a;s[l.id]=o-Number(d)*u.height,o+=(d?-1:1)*u.height}),s}),iEe=ie(Vo,sr,tEe,ww,jw,(e,t,n,r,a)=>{var s={},o;return n.forEach(l=>{var u=nEe(t,l);o==null&&(o=aEe(t,r,e));var d=r==="left"&&!a||r==="right"&&a;s[l.id]=o-Number(d)*u.width,o+=(d?-1:1)*u.width}),s}),oEe=(e,t)=>{var n=sr(e),r=Yo(e,t);if(r!=null){var a=sEe(e,r.orientation,r.mirror),s=a[t];return s==null?{x:n.left,y:0}:{x:n.left,y:s}}},lEe=(e,t)=>{var n=sr(e),r=hc(e,t);if(r!=null){var a=iEe(e,r.orientation,r.mirror),s=a[t];return s==null?{x:0,y:n.top}:{x:s,y:n.top}}},lQ=ie(sr,hc,(e,t)=>{var n=typeof t.width=="number"?t.width:iw;return{width:n,height:e.height}}),S9=(e,t,n)=>{switch(t){case"xAxis":return oQ(e,n).width;case"yAxis":return lQ(e,n).height;default:return}},cQ=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:a,type:s,dataKey:o}=n,l=Ui(e,r),u=t.map(d=>d.value);if(o&&l&&s==="category"&&a&&bW(u))return u}},rP=ie([ht,vw,Fn,Ln],cQ),uQ=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:a,scale:s}=n,o=Ui(e,r);if(o&&(a==="number"||s!=="auto"))return t.map(l=>l.value)}},aP=ie([ht,vw,Yg,Ln],uQ),C9=ie([ht,SCe,Ch,ec,rP,aP,Zg,tP,Ln],(e,t,n,r,a,s,o,l,u)=>{if(t==null)return null;var d=Ui(e,u);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:u,categoricalDomain:s,duplicateDomain:a,isCategorical:d,niceTicks:l,range:o,realScaleType:n,scale:r}}),cEe=(e,t,n,r,a,s,o,l,u)=>{if(!(t==null||r==null)){var d=Ui(e,u),{type:h,ticks:p,tickCount:g}=t,x=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,y=h==="category"&&r.bandwidth?r.bandwidth()/x:0;y=u==="angleAxis"&&s!=null&&s.length>=2?gr(s[0]-s[1])*2*y:y;var w=p||a;if(w){var j=w.map((N,k)=>{var S=o?o.indexOf(N):N;return{index:k,coordinate:r(S)+y,value:N,offset:y}});return j.filter(N=>!Na(N.coordinate))}return d&&l?l.map((N,k)=>({coordinate:r(N)+y,value:N,index:k,offset:y})):r.ticks?r.ticks(g).map(N=>({coordinate:r(N)+y,value:N,offset:y})):r.domain().map((N,k)=>({coordinate:r(N)+y,value:o?o[N]:N,index:k,offset:y}))}},dQ=ie([ht,Yg,Ch,ec,tP,Zg,rP,aP,Ln],cEe),uEe=(e,t,n,r,a,s,o)=>
541{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=Ui(e,o),{tickCount:u}=t,d=0;return d=o==="angleAxis"&&r?.length>=2?gr(r[0]-r[1])*2*d:d,l&&s?s.map((h,p)=>({coordinate:n(h)+d,value:h,index:p,offset:d})):n.ticks?n.ticks(u).map(h=>({coordinate:n(h)+d,value:h,offset:d})):n.domain().map((h,p)=>({coordinate:n(h)+d,value:a?a[h]:h,index:p,offset:d}))}},$i=ie([ht,Yg,ec,Zg,rP,aP,Ln],uEe),Ps=ie(Fn,ec,(e,t)=>{if(!(e==null||t==null))return Ov(Ov({},e),{},{scale:t})}),dEe=ie([Fn,Ch,ZT,aQ],JT);ie((e,t,n)=>UT(e,n),dEe,(e,t)=>{if(!(e==null||t==null))return Ov(Ov({},e),{},{scale:t})});var fEe=ie([ht,iT,oT],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),fQ=e=>e.options.defaultTooltipEventType,hQ=e=>e.options.validateTooltipEventTypes;function pQ(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function sP(e,t){var n=fQ(e),r=hQ(e);return pQ(t,n,r)}function hEe(e){return Be(t=>sP(t,e))}var mQ=(e,t)=>{var n,r=Number(t);if(!(Na(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},pEe=e=>e.tooltip.settings,Rl={active:!1,index:null,dataKey:void 0,coordinate:void 0},mEe={itemInteraction:{click:Rl,hover:Rl},axisInteraction:{click:Rl,hover:Rl},keyboardInteraction:Rl,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},gQ=Ds({name:"tooltip",initialState:mEe,reducers:{addTooltipEntrySettings(e,t){e.tooltipItemPayloads.push(t.payload)},removeTooltipEntrySettings(e,t){var n=So(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate,e.keyboardInteraction.dataKey=t.payload.activeDataKey}}}),{addTooltipEntrySettings:gEe,removeTooltipEntrySettings:xEe,setTooltipSettingsState:bEe,setActiveMouseOverItemIndex:xQ,mouseLeaveItem:yEe,mouseLeaveChart:bQ,setActiveClickItemIndex:vEe,setMouseOverAxisIndex:yQ,setMouseClickAxisIndex:wEe,setSyncInteraction:QC,setKeyboardInteraction:ZC}=gQ.actions,jEe=gQ.reducer;function E9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function g0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
541t%2?E9(Object(n),!0).forEach(function(r){NEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NEe(e,t,n){return(t=_Ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Ee(e){var t=kEe(e,"string");return typeof t=="symbol"?t:t+""}function kEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SEe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function CEe(e){return e.index!=null}var vQ=(e,t,n,r)=>{if(t==null)return Rl;var a=SEe(e,t,n);if(a==null)return Rl;if(a.active)return a;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var s=e.settings.active===!0;if(CEe(a)){if(s)return g0(g0({},a),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r};return g0(g0({},Rl),{},{coordinate:a.coordinate})},iP=(e,t)=>{var n=e?.index;if(n==null)return null;var r=Number(n);if(!Pr(r))return n;var a=0,s=1/0;return t.length>0&&(s=t.length-1),String(Math.max(a,Math.min(r,s)))},wQ=(e,t,n,r,a,s,o,l)=>{if(!(s==null||l==null)){var u=o[0],d=u==null?void 0:l(u.positions,s);if(d!=null)return d;var h=a?.[Number(s)];if(h)switch(n){case"horizontal":return{x:h.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:h.coordinate}}}},jQ=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var a;return n==="hover"?a=e.itemInteraction.hover.dataKey:a=e.itemInteraction.click.dataKey,a==null&&r!=null?[e.tooltipItemPayloads[0]]:e.tooltipItemPayloads.filter(s=>{var o;return((o=s.settings)===null||o===void 0?void 0:o.dataKey)===a})},Jg=e=>e.options.tooltipPayloadSearcher,Eh=e=>e.tooltip;function O9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function A9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O9(Object(n),!0).forEach(function(r){EEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EEe(e,t,n){return(t=OEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OEe(e){var t=AEe(e,"string");return typeof t=="symbol"?t:t+""}function AEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function TEe(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function PEe(e,t){return e??t}var NQ=(e,t,n,r,a,s,o)=>{if(!(t==null||s==null)){var{chartData:l,computedData:u,dataStartIndex:d,dataEndIndex:h}=n,p=[];return e.reduce((g,x)=>{var y,{dataDefinedOnItem:w,settings:j}=x,N=PEe(w,l),k=TEe(N,d,h),S=(y=j?.dataKey)!==null&&y!==void 0?y:r?.dataKey,E=j?.nameKey,O;if(r!=null&&r.dataKey&&Array.isArray(k)&&!Array.isArray(k[0])&&o==="axis"?O=yW(k,r.dataKey,a):O=s(k,t,u,E),Array.isArray(O))O.forEach(P=>{var M=A9(A9({},j),{},{name:P.name,unit:P.unit,color:void 0,fill:void 0});g.push(f8({tooltipEntrySettings:M,dataKey:P.dataKey,payload:P.payload,value:Bt(P.payload,P.dataKey),name:P.name}))});else{var T;g.push(f8({tooltipEntrySettings:j,dataKey:S,payload:O,value:Bt(O,S),name:(T=Bt(O,E))!==null&&T!==void 0?T:j?.name}))}return g},p)}},wr=e=>{var t=ht(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Oh=e=>e.tooltip.settings.axisId,Mr=e=>{var t=wr(e),n=Oh(e);return Yg(e,t,n)},oP=ie([Mr,ht,qX,$T,wr],nQ),REe=ie([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),MEe=ie([wr,Oh],qT),Nw=ie([REe,Mr,MEe],HT),DEe=ie([Nw],KT),Ju=ie([DEe,Qu],VT),lP=ie([Ju,Mr,Nw],GT),$Ee=ie([Mr],WT),IEe=ie([Ju,Nw,Gg],VX),LEe=ie([IEe,Qu,wr],GX),FEe=ie([Nw],HX),zEe=ie([Ju,Mr,FEe,wr],WX),BEe=ie([YX,wr,Oh],Sh),UEe=ie([BEe,wr],ZX),qEe=ie([XX,wr,Oh],Sh),HEe=ie([qEe,wr],JX),KEe=ie([QX,wr,Oh],Sh),VEe=ie([KEe,wr],eQ),GEe=ie([UEe,VEe,HEe],YT),WEe=ie([Mr,$Ee,LEe,zEe,GEe],XT),_Q=ie([Mr,ht,Ju,lP,Gg,wr,WEe],QT),YEe=ie([_Q,Mr,oP],eP),XEe=ie([Mr,_Q,YEe,wr],nP),kQ=e=>{var t=wr(e),n=Oh(e),r=!1;return Zg(e,t,n,r)},SQ=ie([Mr,kQ],xw),CQ=ie([Mr,oP,XEe,SQ],JT),QEe=ie([ht,lP,Mr,wr],cQ),ZEe=ie([ht,lP,Mr,wr],uQ),JEe=(e,t,n,r,a,s,o,l)=>{if(t){var{type:u}=t,d=Ui(e,l);if(r){var h=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,p=u==="category"&&r.bandwidth?r.bandwidth()/h:0;return p=l==="angleAxis"&&a!=null&&a?.length>=2?gr(a[0]-a[1])*2*p:p,d&&o?o.map((g,x)=>({coordinate:r(g)+p,value:g,index:x,offset:p})):r.domain().map((g,x)=>({coordinate:r(g)+p,value:s?s[g]:g,index:x,offset:p}))}}},Xo=ie([ht,Mr,oP,CQ,kQ,QEe,ZEe,wr],JEe),cP=ie([fQ,hQ,pEe],(e,t,n)=>pQ(n.shared,e,t)),EQ=e=>e.tooltip.settings.trigger,uP=e=>e.tooltip.settings.defaultIndex,_w=ie([Eh,cP,EQ,uP],vQ),tc=ie([_w,Ju],iP),OQ=ie([Xo,tc],mQ),AQ=ie([_w],e=>{if(e)return e.dataKey}),TQ=ie([Eh,cP,EQ,uP],jQ),eOe=ie([Vo,Go,ht,sr,Xo,uP,TQ,Jg],wQ),tOe=ie([_w,eOe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),nOe=ie([_w],e=>e.active),rOe=ie([TQ,tc,Qu,Mr,OQ,Jg,cP],NQ),aOe=ie([rOe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function T9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function P9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
541t%2?T9(Object(n),!0).forEach(function(r){sOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sOe(e,t,n){return(t=iOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iOe(e){var t=oOe(e,"string");return typeof t=="symbol"?t:t+""}function oOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lOe=()=>Be(Mr),cOe=()=>{var e=lOe(),t=Be(Xo),n=Be(CQ);return Du(P9(P9({},e),{},{scale:n}),t)},PQ=()=>Be($T),dP=(e,t)=>t,RQ=(e,t,n)=>n,fP=(e,t,n,r)=>r,uOe=ie(Xo,e=>J1(e,t=>t.coordinate)),hP=ie([Eh,dP,RQ,fP],vQ),MQ=ie([hP,Ju],iP),dOe=(e,t,n)=>{if(t!=null){var r=Eh(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},DQ=ie([Eh,dP,RQ,fP],jQ),Av=ie([Vo,Go,ht,sr,Xo,fP,DQ,Jg],wQ),fOe=ie([hP,Av],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),$Q=ie(Xo,MQ,mQ),hOe=ie([DQ,MQ,Qu,Mr,$Q,Jg,dP],NQ),pOe=ie([hP],e=>({isActive:e.active,activeIndex:e.index})),mOe=(e,t,n,r,a,s,o,l)=>{if(!(!e||!t||!r||!a||!s)){var u=Y_e(e.chartX,e.chartY,t,n,l);if(u){var d=Q_e(u,t),h=I_e(d,o,s,r,a),p=X_e(t,s,h,u);return{activeIndex:String(h),activeCoordinate:p}}}};function JC(){return JC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JC.apply(null,arguments)}function R9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function x0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R9(Object(n),!0).forEach(function(r){gOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gOe(e,t,n){return(t=xOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xOe(e){var t=bOe(e,"string");return typeof t=="symbol"?t:t+""}function bOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yOe(e){var{coordinate:t,payload:n,index:r,offset:a,tooltipAxisBandSize:s,layout:o,cursor:l,tooltipEventType:u,chartName:d}=e,h=t,p=n,g=r;if(!l||!h||d!=="ScatterChart"&&u!=="axis")return null;var x,y;if(d==="ScatterChart")x=h,y=Mke;else if(d==="BarChart")x=Dke(o,h,a,s),y=IY;else if(o==="radial"){var{cx:w,cy:j,radius:N,startAngle:k,endAngle:S}=LY(h);x={cx:w,cy:j,startAngle:k,endAngle:S,innerRadius:N,outerRadius:N},y=zY}else x={points:w2e(o,h,a)},y=Ef;var E=typeof l=="object"&&"className"in l?l.className:void 0,O=x0(x0(x0(x0({stroke:"#ccc",pointerEvents:"none"},a),x),rt(l,!1)),{},{payload:p,payloadIndex:g,className:Xe("recharts-tooltip-cursor",E)});return v.isValidElement(l)?v.cloneElement(l,O):v.createElement(y,O)}function vOe(e){var t=cOe(),n=CY(),r=Ug(),a=PQ();return v.createElement(yOe,JC({},e,{coordinate:e.coordinate,index:e.index,payload:e.payload,offset:n,layout:r,tooltipAxisBandSize:t,chart
541Name:a}))}var IQ=v.createContext(null),wOe=()=>v.useContext(IQ),J2={exports:{}},M9;function jOe(){return M9||(M9=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(u,d,h){this.fn=u,this.context=d,this.once=h||!1}function s(u,d,h,p,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var x=new a(h,p||u,g),y=n?n+d:d;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],x]:u._events[y].push(x):(u._events[y]=x,u._eventsCount++),u}function o(u,d){--u._eventsCount===0?u._events=new r:delete u._events[d]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],h,p;if(this._eventsCount===0)return d;for(p in h=this._events)t.call(h,p)&&d.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},l.prototype.listeners=function(d){var h=n?n+d:d,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var g=0,x=p.length,y=new Array(x);g<x;g++)y[g]=p[g].fn;return y},l.prototype.listenerCount=function(d){var h=n?n+d:d,p=this._events[h];return p?p.fn?1:p.length:0},l.prototype.emit=function(d,h,p,g,x,y){var w=n?n+d:d;if(!this._events[w])return!1;var j=this._events[w],N=arguments.length,k,S;if(j.fn){switch(j.once&&this.removeListener(d,j.fn,void 0,!0),N){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,h),!0;case 3:return j.fn.call(j.context,h,p),!0;case 4:return j.fn.call(j.context,h,p,g),!0;case 5:return j.fn.call(j.context,h,p,g,x),!0;case 6:return j.fn.call(j.context,h,p,g,x,y),!0}for(S=1,k=new Array(N-1);S<N;S++)k[S-1]=arguments[S];j.fn.apply(j.context,k)}else{var E=j.length,O;for(S=0;S<E;S++)switch(j[S].once&&this.removeListener(d,j[S].fn,void 0,!0),N){case 1:j[S].fn.call(j[S].context);break;case 2:j[S].fn.call(j[S].context,h);break;case 3:j[S].fn.call(j[S].context,h,p);break;case 4:j[S].fn.call(j[S].context,h,p,g);break;default:if(!k)for(O=1,k=new Array(N-1);O<N;O++)k[O-1]=arguments[O];j[S].fn.apply(j[S].context,k)}}return!0},l.prototype.on=function(d,h,p){return s(this,d,h,p,!1)},l.prototype.once=function(d,h,p){return s(this,d,h,p,!0)},l.prototype.removeListener=function(d,h,p,g){var x=n?n+d:d;if(!this._events[x])return this;if(!h)return o(this,x),this;var y=this._events[x];if(y.fn)y.fn===h&&(!g||y.once)&&(!p||y.context===p)&&o(this,x);else{for(var w=0,j=[],N=y.length;w<N;w++)(y[w].fn!==h||g&&!y[w].once||p&&y[w].context!==p)&&j.push(y[w]);j.length?this._events[x]=j.length===1?j[0]:j:o(this,x)}return this},l.prototype.removeAllListeners=function(d){var h;return d?(h=n?n+d:d,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l}(J2)),J2.exports}var NOe=jOe();const _Oe=ka(NOe);var lg=new _Oe,eE="recharts.syncEvent.tooltip",D9="recharts.syncEvent.brush";function pP(e,t){if(t){var n=Number.parseInt(t,10);if(!Na(n))return e?.[n]}}var kOe={chartName:"",tooltipPayloadSearcher:void 0,eventEmitter:void 0,defaultTooltipEventType:"axis"},LQ=Ds({name:"options",initialState:kOe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),SOe=LQ.reducer,{createEventEmitter:COe}=LQ.actions;function EOe(e){return e.tooltip.syncInteraction}var OOe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},FQ=Ds({name:"chartData",initialState:OOe,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:$9,setDataStartEndIndexes:AOe,setComputedData:JBe}=FQ.actions,TOe=FQ.reducer,zQ=()=>{};function POe(){var e=Be(IT),t=Be(LT),n=wn(),r=Be(LX),a=Be(Xo),s=Ug(),o=lT(),l=Be(u=>u.rootProps.className);v.useEffect(()=>{if(e==null)return zQ;var u=(d,h,p)=>{if(t!==p&&e===d){if(r==="index"){n(h);return}if(a!=null){var g;if(typeof r=="function"){var x={activeTooltipIndex:h.payload.index==null?void 0:Number(h.payload.index),isTooltipActive:h.payload.active,activeIndex:h.payload.index==null?void 0:Number(h.payload.index),activeLabel:h.payload.label,activeDataKey:h.payload.dataKey,activeCoordinate:h.payload.coordinate},y=r(a,x);g=a[y]}else r==="value"&&(g=a.find(T=>String(T.value)===h.payload.label));var{coordinate:w}=h.payload;if(g==null||h.payload.active===!1||w==null||o==null){n(QC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0}));return}var{x:j,y:N}=w,k=Math.min(j,o.x+o.width),S=Math.min(N,o.y+o.height),E={x:s==="horizontal"?g.coordinate:k,y:s==="horizontal"?S:g.coordinate},O=QC({active:h.payload.active,coordinate:E,dataKey:h.payload.dataKey,index:String(g.index),label:h.payload.label});n(O)}}};return lg.on(eE,u),()=>{lg.off(eE,u)}},[l,n,t,e,r,a,s,o])}function ROe(){var e=Be(IT),t=Be(LT),n=wn();v.useEffect(()=>{if(e==null)return zQ;var r=(a,s,o)=>{t!==o&&e===a&&n(AOe(s))};return lg.on(D9,r),()=>{lg.off(D9,r)}},[n,t,e])}function MOe(){var e=wn();v.useEffect(()=>{e(COe())},[e]),POe(),ROe()}function DOe(e,t,n,r,a,s){var o=Be(g=>dOe(g,e,t)),l=Be(LT),u=Be(IT),d=Be(LX),h=Be(EOe),p=h?.active;v.useEffect(()=>{if(!p&&u!=null&&l!=null){var g=QC({active:s,coordinate:n,dataKey:o,index:a,label:typeof r=="number"?String(r):r});lg.emit(eE,u,g,l)}},[p,n,o,a,r,l,u,d,s])}function I9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function L9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
541t%2?I9(Object(n),!0).forEach(function(r){$Oe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Oe(e,t,n){return(t=IOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IOe(e){var t=LOe(e,"string");return typeof t=="symbol"?t:t+""}function LOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FOe(e){return e.dataKey}function zOe(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e=="function"?v.createElement(e,t):v.createElement(fke,t)}var F9=[],BOe={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,isAnimationActive:!uc.isSsr,itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function mP(e){var t=as(e,BOe),{active:n,allowEscapeViewBox:r,animationDuration:a,animationEasing:s,content:o,filterNull:l,isAnimationActive:u,offset:d,payloadUniqBy:h,position:p,reverseDirection:g,useTranslate3d:x,wrapperStyle:y,cursor:w,shared:j,trigger:N,defaultIndex:k,portal:S,axisId:E}=t,O=wn(),T=typeof k=="number"?String(k):k;v.useEffect(()=>{O(bEe({shared:j,trigger:N,axisId:E,active:n,defaultIndex:T}))},[O,j,N,E,n,T]);var P=lT(),M=RY(),D=hEe(j),{activeIndex:A,isActive:L}=Be(fe=>pOe(fe,D,N,T)),F=Be(fe=>hOe(fe,D,N,T)),B=Be(fe=>$Q(fe,D,N,T)),U=Be(fe=>fOe(fe,D,N,T)),z=F,$=wOe(),K=n??L,[G,W]=CNe([z,K]),I=D==="axis"?B:void 0;DOe(D,N,U,I,A,K);var H=S??$;if(H==null)return null;var V=z??F9;K||(V=F9),l&&V.length&&(V=Jje(z.filter(fe=>fe.value!=null&&(fe.hide!==!0||t.includeHidden)),h,FOe));var X=V.length>0,te=v.createElement(yke,{allowEscapeViewBox:r,animationDuration:a,animationEasing:s,isAnimationActive:u,active:K,coordinate:U,hasPayload:X,offset:d,position:p,reverseDirection:g,useTranslate3d:x,viewB
541ox:P,wrapperStyle:y,lastBoundingBox:G,innerRef:W,hasPortalFromProps:!!S},zOe(o,L9(L9({},t),{},{payload:V,label:I,active:K,coordinate:U,accessibilityLayer:M})));return v.createElement(v.Fragment,null,qE.createPortal(te,H),K&&v.createElement(vOe,{cursor:w,tooltipEventType:D,coordinate:U,payload:z,index:A}))}var e5={},t5={},n5={},z9;function UOe(){return z9||(z9=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:a,edges:s}={}){let o,l=null;const u=s!=null&&s.includes("leading"),d=s==null||s.includes("trailing"),h=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},p=()=>{d&&h(),w()};let g=null;const x=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,p()},r)},y=()=>{g!==null&&(clearTimeout(g),g=null)},w=()=>{y(),o=void 0,l=null},j=()=>{y(),h()},N=function(...k){if(a?.aborted)return;o=this,l=k;const S=g==null;x(),u&&S&&h()};return N.schedule=x,N.cancel=w,N.flush=j,a?.addEventListener("abort",w,{once:!0}),N}e.debounce=t}(n5)),n5}var B9;function qOe(){return B9||(B9=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UOe();function n(r,a=0,s={}){typeof s!="object"&&(s={});const{leading:o=!1,trailing:l=!0,maxWait:u}=s,d=Array(2);o&&(d[0]="leading"),l&&(d[1]="trailing");let h,p=null;const g=t.debounce(function(...w){h=r.apply(this,w),p=null},a,{edges:d}),x=function(...w){return u!=null&&(p===null&&(p=Date.now()),Date.now()-p>=u)?(h=r.apply(this,w),p=Date.now(),g.cancel(),g.schedule(),h):(g.apply(this,w),h)},y=()=>(g.flush(),h);return x.cancel=g.cancel,x.flush=y,x}e.debounce=n}(t5)),t5}var U9;function HOe(){return U9||(U9=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qOe();function n(r,a=0,s={}){typeof s!="object"&&(s={});const{leading:o=!0,trailing:l=!0}=s;return t.debounce(r,a,{leading:o,trailing:l,maxWait:a})}e.throttle=n}(e5)),e5}var r5,q9;function KOe(){return q9||(q9=1,r5=HOe().throttle),r5}var VOe=KOe();const GOe=ka(VOe);var Om=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),s=2;s<r;s++)a[s-2]=arguments[s]};function H9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function a5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H9(Object(n),!0).forEach(function(r){WOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WOe(e,t,n){return(t=YOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YOe(e){var t=XOe(e,"string");return typeof t=="symbol"?t:t+""}function XOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kw=v.forwardRef((e,t)=>{var{aspect:n,initialDimension:r={width:-1,height:-1},width:a="100%",height:s="100%",minWidth:o=0,minHeight:l,maxHeight:u,children:d,debounce:h=0,id:p,className:g,onResize:x,style:y={}}=e,w=v.useRef(null),j=v.useRef();j.current=x,v.useImperativeHandle(t,()=>w.current);var[N,k]=v.useState({containerWidth:r.width,containerHeight:r.height}),S=v.useCallback((O,T)=>{k(P=>{var M=Math.round(O),D=Math.round(T);return P.containerWidth===M&&P.containerHeight===D?P:{containerWidth:M,containerHeight:D}})},[]);v.useEffect(()=>{var O=D=>{var A,{width:L,height:F}=D[0].contentRect;S(L,F),(A=j.current)===null||A===void 0||A.call(j,L,F)};h>0&&(O=GOe(O,h,{trailing:!0,leading:!1}));var T=new ResizeObserver(O),{width:P,height:M}=w.current.getBoundingClientRect();return S(P,M),T.observe(w.current),()=>{T.disconnect()}},[S,h]);var E=v.useMemo(()=>{var{containerWidth:O,containerHeight:T}=N;if(O<0||T<0)return null;Om(eu(a)||eu(s),`The width(%s) and height(%s) are both fixed numbers, 542 maybe you don't need to use a ResponsiveContainer.`,a,s),Om(!n||n>0,"The aspect(%s) must be greater than zero.",n);var P=eu(a)?O:a,M=eu(s)?T:s;return n&&n>0&&(P?M=P/n:M&&(P=M*n),u&&M>u&&(M=u)),Om(P>0||M>0,`The width(%s) and height(%s) of chart should be greater than 0, 543 please check the style of container, or the props width(%s) and height(%s), 544 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 545 height and width.`,P,M,a,s,o,l,n),v.Children.map(d,D=>v.cloneElement(D,{width:P,height:M,style:a5({width:P,height:M},D.props.style)}))},[n,d,s,u,l,o,N,a]);return v.createElement("div",{id:p?"".concat(p):void 0,className:Xe("recharts-responsive-container",g),style:a5(a5({},y),{},{width:a,height:s,minWidth:o,minHeight:l,maxHeight:u}),ref:w},v.createElement("div",{style:{width:0,height:0,overflow:"visible"}},E))}),Ah=e=>null;Ah.displayName="Cell";function K9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
545t%2?K9(Object(n),!0).forEach(function(r){QOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QOe(e,t,n){return(t=ZOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZOe(e){var t=JOe(e,"string");return typeof t=="symbol"?t:t+""}function JOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xd={widthCache:{},cacheCount:0},eAe=2e3,tAe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},V9="recharts_measurement_span";function nAe(e){var t=tE({},e);return Object.keys(t).forEach(n=>{t[n]||delete t[n]}),t}var Am=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||uc.isSsr)return{width:0,height:0};var r=nAe(n),a=JSON.stringify({text:t,copyStyle:r});if(Xd.widthCache[a])return Xd.widthCache[a];try{var s=document.getElementById(V9);s||(s=document.createElement("span"),s.setAttribute("id",V9),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=tE(tE({},tAe),r);Object.assign(s.style,o),s.textContent="".concat(t);var l=s.getBoundingClientRect(),u={width:l.width,height:l.height};return Xd.widthCache[a]=u,++Xd.cacheCount>eAe&&(Xd.cacheCount=0,Xd.widthCache={}),u}catch{return{width:0,height:0}}},G9=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,W9=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,rAe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,aAe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,BQ={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},sAe=Object.keys(BQ),bf="NaN";function iAe(e,t){return e*BQ[t]}class ua{static parse(t){var n,[,r,a]=(n=aAe.exec(t))!==null&&n!==void 0?n:[];return new ua(parseFloat(r),a??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Na(t)&&(this.unit=""),n!==""&&!rAe.test(n)&&(this.num=NaN,this.unit=""),sAe.includes(n)&&(this.num=iAe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new ua(NaN,""):new ua(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new ua(NaN,""):new ua(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new ua(NaN,""):new ua(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new ua(NaN,""):new ua(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Na(this.num)}}function UQ(e){if(e.includes(bf))return bf;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,a,s]=(n=G9.exec(t))!==null&&n!==void 0?n:[],o=ua.parse(r??""),l=ua.parse(s??""),u=a==="*"?o.multiply(l):o.divide(l);if(u.isNaN())return bf;t=t.replace(G9,u.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,h,p,g]=(d=W9.exec(t))!==null&&d!==void 0?d:[],x=ua.parse(h??""),y=ua.parse(g??""),w=p==="+"?x.add(y):x.subtract(y);if(w.isNaN())return bf;t=t.replace(W9,w.toString())}return t}var Y9=/\(([^()]*)\)/;function oAe(e){for(var t=e,n;(n=Y9.exec(t))!=null;){var[,r]=n;t=t.replace(Y9,UQ(r))}return t}function lAe(e){var t=e.replace(/\s+/g,"");return t=oAe(t),t=UQ(t),t}function cAe(e){try{return lAe(e)}catch{return bf}}function s5(e){var t=cAe(e.slice(5,-1));return t===bf?"":t}var uAe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],dAe=["dx","dy","angle","className","breakAll"];function nE(){return nE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nE.apply(null,arguments)}function X9(e,t){if(e==null)return{};var n,r,a=fAe(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)&&(a[n]=e[n])}return a}function fAe(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 qQ=/[ \f\n\r\t\v\u2028\u2029]+/,HQ=e=>{var{children:t,breakAll:n,style:r}=e;try{var a=[];Ct(t)||(n?a=t.toString().split(""):a=t.toString().split(qQ));
545var s=a.map(l=>({word:l,width:Am(l,r).width})),o=n?0:Am(" ",r).width;return{wordsWithComputedWidth:s,spaceWidth:o}}catch{return null}},hAe=(e,t,n,r,a)=>{var{maxLines:s,children:o,style:l,breakAll:u}=e,d=Pe(s),h=o,p=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce((F,B)=>{var{word:U,width:z}=B,$=F[F.length-1];if($&&(r==null||a||$.width+z+n<Number(r)))$.words.push(U),$.width+=z+n;else{var K={words:[U],width:z};F.push(K)}return F},[])},g=p(t),x=A=>A.reduce((L,F)=>L.width>F.width?L:F);if(!d||a)return g;var y=g.length>s||x(g).width>Number(r);if(!y)return g;for(var w="â¦",j=A=>{var L=h.slice(0,A),F=HQ({breakAll:u,style:l,children:L+w}).wordsWithComputedWidth,B=p(F),U=B.length>s||x(B).width>Number(r);return[U,B]},N=0,k=h.length-1,S=0,E;N<=k&&S<=h.length-1;){var O=Math.floor((N+k)/2),T=O-1,[P,M]=j(T),[D]=j(O);if(!P&&!D&&(N=O+1),P&&D&&(k=O-1),!P&&D){E=M;break}S++}return E||g},Q9=e=>{var t=Ct(e)?[]:e.toString().split(qQ);return[{words:t}]},pAe=e=>{var{width:t,scaleToFit:n,children:r,style:a,breakAll:s,maxLines:o}=e;if((t||n)&&!uc.isSsr){var l,u,d=HQ({breakAll:s,children:r,style:a});if(d){var{wordsWithComputedWidth:h,spaceWidth:p}=d;l=h,u=p}else return Q9(r);return hAe({breakAll:s,children:r,maxLines:o,style:a},l,u,t,n)}return Q9(r)},Z9="#808080",Sw=v.forwardRef((e,t)=>{var{x:n=0,y:r=0,lineHeight:a="1em",capHeight:s="0.71em",scaleToFit:o=!1,textAnchor:l="start",verticalAnchor:u="end",fill:d=Z9}=e,h=X9(e,uAe),p=v.useMemo(()=>pAe({breakAll:h.breakAll,children:h.children,maxLines:h.maxLines,scaleToFit:o,style:h.style,width:h.width}),[h.breakAll,h.children,h.maxLines,o,h.style,h.width]),{dx:g,dy:x,angle:y,className:w,breakAll:j}=h,N=X9(h,dAe);if(!Os(n)||!Os(r))return null;var k=n+(Pe(g)?g:0),S=r+(Pe(x)?x:0),E;switch(u){case"start":E=s5("calc(".concat(s,")"));break;case"middle":E=s5("calc(".concat((p.length-1)/2," * -").concat(a," + (").concat(s," / 2))"));break;default:E=s5("calc(".concat(p.length-1," * -").concat(a,")"));break}var O=[];if(o){var T=p[0].width,{width:P}=h;O.push("scale(".concat(Pe(P)?P/T:1,")"))}return y&&O.push("rotate(".concat(y,", ").concat(k,", ").concat(S,")")),O.length&&(N.transform=O.join(" ")),v.createElement("text",nE({},rt(N,!0),{ref:t,x:k,y:S,className:Xe("recharts-text",w),textAnchor:l,fill:d.includes("url")?Z9:d}),p.map((M,D)=>{var A=M.words.join(j?"":" ");return v.createElement("tspan",{x:k,dy:D===0?E:a,key:"".concat(A,"-").concat(D)},A)}))});Sw.displayName="Text";var mAe=["offset"],gAe=["labelRef"];function J9(e,t){if(e==null)return{};var n,r,a=xAe(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)&&(a[n]=e[n])}return a}function xAe(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}function e7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Hn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e7(Object(n),!0).forEach(function(r){bAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bAe(e,t,n){return(t=yAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yAe(e){var t=vAe(e,"string");return typeof t=="symbol"?t:t+""}function vAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yo(){return yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yo.apply(null,arguments)}var wAe=e=>{var{value:t,formatter:n}=e,r=Ct(e.children)?t:e.children;return typeof n=="function"?n(r):r},gP=e=>e!=null&&typeof e=="function",jAe=(e,t)=>
545{var n=gr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},NAe=(e,t,n)=>{var{position:r,viewBox:a,offset:s,className:o}=e,{cx:l,cy:u,innerRadius:d,outerRadius:h,startAngle:p,endAngle:g,clockWise:x}=a,y=(d+h)/2,w=jAe(p,g),j=w>=0?1:-1,N,k;r==="insideStart"?(N=p+j*s,k=x):r==="insideEnd"?(N=g-j*s,k=!x):r==="end"&&(N=g+j*s,k=x),k=w<=0?k:!k;var S=Xn(l,u,y,N),E=Xn(l,u,y,N+(k?1:-1)*359),O="M".concat(S.x,",").concat(S.y,` 546 A`).concat(y,",").concat(y,",0,1,").concat(k?0:1,`, 547 `).concat(E.x,",").concat(E.y),T=Ct(e.id)?Jl("recharts-radial-line-"):e.id;return v.createElement("text",yo({},n,{dominantBaseline:"central",className:Xe("recharts-radial-bar-label",o)}),v.createElement("defs",null,v.createElement("path",{id:T,d:O})),v.createElement("textPath",{xlinkHref:"#".concat(T)},t))},_Ae=e=>{var{viewBox:t,offset:n,position:r}=e,{cx:a,cy:s,innerRadius:o,outerRadius:l,startAngle:u,endAngle:d}=t,h=(u+d)/2;if(r==="outside"){var{x:p,y:g}=Xn(a,s,l+n,h);return{x:p,y:g,textAnchor:p>=a?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var x=(o+l)/2,{x:y,y:w}=Xn(a,s,x,h);return{x:y,y:w,textAnchor:"middle",verticalAnchor:"middle"}},kAe=(e,t)=>{var{parentViewBox:n,offset:r,position:a}=e,{x:s,y:o,width:l,height:u}=t,d=u>=0?1:-1,h=d*r,p=d>0?"end":"start",g=d>0?"start":"end",x=l>=0?1:-1,y=x*r,w=x>0?"end":"start",j=x>0?"start":"end";if(a==="top"){var N={x:s+l/2,y:o-d*r,textAnchor:"middle",verticalAnchor:p};return Hn(Hn({},N),n?{height:Math.max(o-n.y,0),width:l}:{})}if(a==="bottom"){var k={x:s+l/2,y:o+u+h,textAnchor:"middle",verticalAnchor:g};return Hn(Hn({},k),n?{height:Math.max(n.y+n.height-(o+u),0),width:l}:{})}if(a==="left"){var S={x:s-y,y:o+u/2,textAnchor:w,verticalAnchor:"middle"};return Hn(Hn({},S),n?{width:Math.max(S.x-n.x,0),height:u}:{})}if(a==="right"){var E={x:s+l+y,y:o+u/2,textAnchor:j,verticalAnchor:"middle"};return Hn(Hn({},E),n?{width:Math.max(n.x+n.width-E.x,0),height:u}:{})}var O=n?{width:l,height:u}:{};return a==="insideLeft"?Hn({x:s+y,y:o+u/2,textAnchor:j,verticalAnchor:"middle"},O):a==="insideRight"?Hn({x:s+l-y,y:o+u/2,textAnchor:w,verticalAnchor:"middle"},O):a==="insideTop"?Hn({x:s+l/2,y:o+h,textAnchor:"middle",verticalAnchor:g},O):a==="insideBottom"?Hn({x:s+l/2,y:o+u-h,textAnchor:"middle",verticalAnchor:p},O):a==="insideTopLeft"?Hn({x:s+y,y:o+h,textAnchor:j,verticalAnchor:g},O):a==="insideTopRight"?Hn({x:s+l-y,y:o+h,textAnchor:w,verticalAnchor:g},O):a==="insideBottomLeft"?Hn({x:s+y,y:o+u-h,textAnchor:j,verticalAnchor:p},O):a==="insideBottomRight"?Hn({x:s+l-y,y:o+u-h,textAnchor:w,verticalAnchor:p},O):a&&typeof a=="object"&&(Pe(a.x)||eu(a.x))&&(Pe(a.y)||eu(a.y))?Hn({x:s+ta(a.x,l),y:o+ta(a.y,u),textAnchor:"end",verticalAnchor:"end"},O):Hn({x:s+l/2,y:o+u/2,textAnchor:"middle",verticalAnchor:"middle"},O)},SAe=e=>"cx"in e&&Pe(e.cx);function fa(e){var{offset:t=5}=e,n=J9(e,mAe),r=Hn({offset:t},n),{viewBox:a,position:s,value:o,children:l,content:u,className:d="",textBreakAll:h,labelRef:p}=r,g=lT(),x=a||g;if(!x||Ct(o)&&Ct(l)&&!v.isValidElement(u)&&typeof u!="function")return null;if(v.isValidElement(u)){var{labelRef:y}=r,w=J9(r,gAe);return v.cloneElement(u,w)}var j;if(typeof u=="function"){if(j=v.createElement(u,r),v.isValidElement(j))return j}else j=wAe(r);var N=SAe(x),k=rt(r,!0);if(N&&(s==="insideStart"||s==="insideEnd"||s==="end"))return NAe(r,j,k);var S=N?_Ae(r):kAe(r,x);return v.createElement(Sw,yo({ref:p,className:Xe("recharts-label",d)},k,S,{breakAll:h}),j)}fa.displayName="Label";var KQ=e=>{var{cx:t,cy:n,angle:r,startAngle:a,endAngle:s,r:o,radius:l,innerRadius:u,outerRadius:d,x:h,y:p,top:g,left:x,width:y,height:w,clockWise:j,labelViewBox:N}=e;if(N)return N;if(Pe(y)&&Pe(w)){if(Pe(h)&&Pe(p))return{x:h,y:p,width:y,height:w};if(Pe(g)&&Pe(x))return{x:g,y:x,width:y,height:w}}if(Pe(h)&&Pe(p))return{x:h,y:p,width:0,height:0};if(Pe(t)&&Pe(n))return{cx:t,cy:n,startAngle:a||r||0,endAngle:s||r||0,innerRadius:u||0,outerRadius:d||l||o||0,clockWise:j};if(e.viewBox)return e.viewBox}
547,CAe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(fa,yo({key:"label-implicit"},r)):Os(e)?v.createElement(fa,yo({key:"label-implicit",value:e},r)):v.isValidElement(e)?e.type===fa?v.cloneElement(e,Hn({key:"label-implicit"},r)):v.createElement(fa,yo({key:"label-implicit",content:e},r)):gP(e)?v.createElement(fa,yo({key:"label-implicit",content:e},r)):e&&typeof e=="object"?v.createElement(fa,yo({},e,{key:"label-implicit"},r)):null},EAe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var{children:a,labelRef:s}=t,o=KQ(t),l=zg(a,fa).map((d,h)=>v.cloneElement(d,{viewBox:n||o,key:"label-".concat(h)}));if(!r)return l;var u=CAe(t.label,n||o,s);return[u,...l]};fa.parseViewBox=KQ;fa.renderCallByParent=EAe;var i5={},o5={},t7;function OAe(){return t7||(t7=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t}(o5)),o5}var l5={},n7;function AAe(){return n7||(n7=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t}(l5)),l5}var r7;function TAe(){return r7||(r7=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=OAe(),n=AAe(),r=WA();function a(s){if(r.isArrayLike(s))return t.last(n.toArray(s))}e.last=a}(i5)),i5}var c5,a7;function PAe(){return a7||(a7=1,c5=TAe().last),c5}var RAe=PAe();const MAe=ka(RAe);var DAe=["valueAccessor"],$Ae=["data","dataKey","clockWise","id","textBreakAll"];function Tv(){return Tv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tv.apply(null,arguments)}function s7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function i7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s7(Object(n),!0).forEach(function(r){IAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IAe(e,t,n){return(t=LAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LAe(e){var t=FAe(e,"string");return typeof t=="symbol"?t:t+""}function FAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o7(e,t){if(e==null)return{};var n,r,a=zAe(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)&&(a[n]=e[n])}return a}function zAe(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 BAe=e=>Array.isArray(e.value)?MAe(e.value):e.value;function Ti(e){var{valueAccessor:t=BAe}=e,n=o7(e,DAe),{data:r,dataKey:a,clockWise:s,id:o,textBreakAll:l}=n,u=o7(n,$Ae);return!r||!r.length?null:v.createElement(pn,{className:"recharts-label-list"},r.map((d,h)=>{var p=Ct(a)?t(d,h):Bt(d&&d.payload,a),g=Ct(o)?{}:{id:"".concat(o,"-").concat(h)};return v.createElement(fa,Tv({},rt(d,!0),u,g,{parentViewBox:d.parentViewBox,value:p,textBreakAll:l,viewBox:fa.parseViewBox(Ct(s)?d:i7(i7({},d),{},{clockWise:s})),key:"label-".concat(h),index:h}))}))}Ti.displayName="LabelList";function UAe(e,t){return e?e===!0?v.createElement(Ti,{key:"labelList-implicit",data:t}):v.isValidElement(e)||gP(e)?v.createElement(Ti,{key:"labelList-implicit",data:t,content:e}):typeof e=="object"?v.createElement(Ti,Tv({data:t},e,{key:"labelList-implicit"})):null:null}function qAe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var{children:r}=e,a=zg(r,Ti).map((o,l)=>v.cloneElement(o,{data:t,key:"labelList-".concat(l)}));if(!n)return a;var s=UAe(e.label,t);return[s,...a]}Ti.renderCallByParent=qAe;function rE(){return rE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rE.apply(null,arguments)}var Cw=e=>{var{cx:t,cy:n,r,className:a}=e,s=Xe("recharts-dot",a);return t===+t&&n===+n&&r===+r?v.createElement("circle",rE({},rt(e,!1),HA(e),{className:s,cx:t,cy:n,r})):null},VQ=e=>e.graphicalItems.polarItems,HAe=ie([Ln,Wg],qT),xP=ie([VQ,Fn,HAe],HT),KAe=ie([xP],KT),bP=ie([KAe,RT],VT),VAe=ie([bP,Fn,xP],GT),GAe=ie([bP,Fn,xP],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(a=>{var s,o=Bt(r,(s=t.dataKey)!==null&&s!==void 0?s:a.dataKey);return{value:o,errorDomain:[]}}
547)).filter(Boolean):t?.dataKey!=null?e.map(r=>({value:Bt(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]}))),l7=()=>{},WAe=ie([Fn,tQ,l7,GAe,l7],XT),GQ=ie([Fn,ht,bP,VAe,Gg,Ln,WAe],QT),YAe=ie([GQ,Fn,Ch],eP);ie([Fn,GQ,YAe,Ln],nP);var XAe={radiusAxis:{},angleAxis:{}},WQ=Ds({name:"polarAxis",initialState:XAe,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:eUe,removeRadiusAxis:tUe,addAngleAxis:nUe,removeAngleAxis:rUe}=WQ.actions,QAe=WQ.reducer;function c7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function u7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c7(Object(n),!0).forEach(function(r){ZAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZAe(e,t,n){return(t=JAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JAe(e){var t=eTe(e,"string");return typeof t=="symbol"?t:t+""}function eTe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yP=(e,t)=>t,tTe=[],vP=(e,t,n)=>n?.length===0?tTe:n,YQ=ie([RT,yP,vP],(e,t,n)=>{var{chartData:r}=e,a;if(t?.data!=null&&t.data.length>0?a=t.data:a=r,(!a||!a.length)&&n!=null&&(a=n.map(s=>u7(u7({},t.presentationProps),s.props))),a!=null)return a}),nTe=ie([YQ,yP,vP],(e,t,n)=>{if(e!=null)return e.map((r,a)=>{var s,o=Bt(r,t.nameKey,t.name),l;return n!=null&&(s=n[a])!==null&&s!==void 0&&(s=s.props)!==null&&s!==void 0&&s.fill?l=n[a].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:cc(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),rTe=ie([VQ,yP],(e,t)=>{if(e.some(n=>n.type==="pie"&&t.dataKey===n.dataKey&&t.data===n.data))return t}),aTe=ie([YQ,rTe,vP,sr],(e,t,n,r)=>{if(!(t==null||e==null))return YTe({offset:r,pieSettings:t,displayedData:e,cells:n})}),sTe={countOfBars:0,cartesianItems:[],polarItems:[]},XQ=Ds({name:"graphicalItems",initialState:sTe,reducers:{addBar(e){e.countOfBars+=1},removeBar(e){e.countOfBars-=1},addCartesianGraphicalItem(e,t){e.cartesianItems.push(t.payload)},replaceCartesianGraphicalItem(e,t){var{prev:n,next:r}=t.payload,a=So(e).cartesianItems.indexOf(n);a>-1&&(e.cartesianItems[a]=r)},removeCartesianGraphicalItem(e,t){var n=So(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},addPolarGraphicalItem(e,t){e.polarItems.push(t.payload)},removePolarGraphicalItem(e,t){var n=So(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)}}}),{addBar:iTe,removeBar:oTe,addCartesianGraphicalItem:lTe,replaceCartesianGraphicalItem:cTe,removeCartesianGraphicalItem:uTe,addPolarGraphicalItem:dTe,removePolarGraphicalItem:fTe}=XQ.actions,hTe=XQ.reducer;function d7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function f7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d7(Object(n),!0).forEach(function(r){pTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pTe(e,t,n){return(t=mTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mTe(e){var t=gTe(e,"string");return typeof t=="symbol"?t:t+""}function gTe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xTe(e){var t=wn(),n=v.useRef(null);return v.useEffect(()=>{var r=f7(f7({},e),{},{stackId:sT(e.stackId)});n.current===null?t(lTe(r)):n.current!==r&&t(cTe({prev:n.current,next:r})),n.current=r},[t,e]),v.useEffect(()=>()=>{n.current&&(t(uTe(n.current)),n.current=null)},[t]),null}function bTe(e){var t=wn();return v.useEffect(()=>(t(dTe(e)),()=>{t(fTe(e))}),[t,e]),null}var u5={},h7;
547function yTe(){return h7||(h7=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const a=n[Symbol.toStringTag];return a==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${a}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t}(u5)),u5}var d5,p7;function vTe(){return p7||(p7=1,d5=yTe().isPlainObject),d5}var wTe=vTe();const jTe=ka(wTe);function Pv(){return Pv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pv.apply(null,arguments)}var m7=(e,t,n,r,a)=>{var s=n-r,o;return o="M ".concat(e,",").concat(t),o+="L ".concat(e+n,",").concat(t),o+="L ".concat(e+n-s/2,",").concat(t+a),o+="L ".concat(e+n-s/2-r,",").concat(t+a),o+="L ".concat(e,",").concat(t," Z"),o},NTe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},_Te=e=>{var t=as(e,NTe),n=v.useRef(),[r,a]=v.useState(-1);v.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var j=n.current.getTotalLength();j&&a(j)}catch{}},[]);var{x:s,y:o,upperWidth:l,lowerWidth:u,height:d,className:h}=t,{animationEasing:p,animationDuration:g,animationBegin:x,isUpdateAnimationActive:y}=t;if(s!==+s||o!==+o||l!==+l||u!==+u||d!==+d||l===0&&u===0||d===0)return null;var w=Xe("recharts-trapezoid",h);return y?v.createElement(Do,{canBegin:r>0,from:{upperWidth:0,lowerWidth:0,height:d,x:s,y:o},to:{upperWidth:l,lowerWidth:u,height:d,x:s,y:o},duration:g,animationEasing:p,isActive:y},j=>{var{upperWidth:N,lowerWidth:k,height:S,x:E,y:O}=j;return v.createElement(Do,{canBegin:r>0,from:"0px ".concat(r===-1?1:r,"px"),to:"".concat(r,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:g,easing:p},v.createElement("path",Pv({},rt(t,!0),{className:w,d:m7(E,O,N,k,S),ref:n})))}):v.createElement("g",null,v.createElement("path",Pv({},rt(t,!0),{className:w,d:m7(s,o,l,u,d)})))},kTe=["option","shapeType","propTransformer","activeClassName","isActive"];function STe(e,t){if(e==null)return{};var n,r,a=CTe(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)&&(a[n]=e[n])}return a}function CTe(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}function g7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Rv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g7(Object(n),!0).forEach(function(r){ETe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ETe(e,t,n){return(t=OTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OTe(e){var t=ATe(e,"string");return typeof t=="symbol"?t:t+""}function ATe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function TTe(e,t){return Rv(Rv({},t),e)}function PTe(e,t){return e==="symbols"}function x7(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return v.createElement(IY,n);case"trapezoid":return v.createElement(_Te,n);case"sector":return v.createElement(zY,n);case"symbols":if(PTe(t))return v.createElement(FW,n);break;default:return null}}function RTe(e){return v.isValidElement(e)?e.props:e}function QQ(e){var{option:t,shapeType:n,propTransformer:r=TTe,activeClassName:a="recharts-active-shape",isActive:s}=e,o=STe(e,kTe),l;if(v.isValidElement(t))l=v.cloneElement(t,Rv(Rv({},o),RTe(t)));else if(typeof t=="function")l=t(o);else if(jTe(t)&&typeof t!="boolean"){var u=r(t,o);l=v.createElement(x7,{shapeType:n,elementProps:u})}else{var d=o;l=v.createElement(x7,{shapeType:n,elementProps:d})}return s?v.createElement(pn,{className:a},l):l}var wP=(e,t)=>
547{var n=wn();return(r,a)=>s=>{e?.(r,a,s),n(xQ({activeIndex:String(a),activeDataKey:t,activeCoordinate:r.tooltipPosition}))}},jP=e=>{var t=wn();return(n,r)=>a=>{e?.(n,r,a),t(yEe())}},NP=(e,t)=>{var n=wn();return(r,a)=>s=>{e?.(r,a,s),n(vEe({activeIndex:String(a),activeDataKey:t,activeCoordinate:r.tooltipPosition}))}};function Ew(e){var{fn:t,args:n}=e,r=wn(),a=Rr();return v.useEffect(()=>{if(!a){var s=t(n);return r(gEe(s)),()=>{r(xEe(s))}}},[t,n,r,a]),null}var ZQ=()=>{};function _P(e){var{legendPayload:t}=e,n=wn(),r=Rr();return v.useEffect(()=>r?ZQ:(n(TY(t)),()=>{n(PY(t))}),[n,r,t]),null}function MTe(e){var{legendPayload:t}=e,n=wn(),r=Be(ht);return v.useEffect(()=>r!=="centric"&&r!=="radial"?ZQ:(n(TY(t)),()=>{n(PY(t))}),[n,r,t]),null}function Ow(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=v.useRef(Jl(t)),r=v.useRef(e);return r.current!==e&&(n.current=Jl(t),r.current=e),n.current}var DTe=["onMouseEnter","onClick","onMouseLeave"];function $Te(e,t){if(e==null)return{};var n,r,a=ITe(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)&&(a[n]=e[n])}return a}function ITe(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}function b7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b7(Object(n),!0).forEach(function(r){Aw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Aw(e,t,n){return(t=LTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LTe(e){var t=FTe(e,"string");return typeof t=="symbol"?t:t+""}function FTe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Iu(){return Iu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iu.apply(null,arguments)}function zTe(e){var t=v.useMemo(()=>rt(e,!1),[e]),n=v.useMemo(()=>zg(e.children,Ah),[e.children]),r=v.useMemo(()=>({name:e.name,nameKey:e.nameKey,tooltipType:e.tooltipType,data:e.data,dataKey:e.dataKey,cx:e.cx,cy:e.cy,startAngle:e.startAngle,endAngle:e.endAngle,minAngle:e.minAngle,paddingAngle:e.paddingAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius,legendT
547ype:e.legendType,fill:e.fill,presentationProps:t}),[e.cornerRadius,e.cx,e.cy,e.data,e.dataKey,e.endAngle,e.innerRadius,e.minAngle,e.name,e.nameKey,e.outerRadius,e.paddingAngle,e.startAngle,e.tooltipType,e.legendType,e.fill,t]),a=Be(s=>nTe(s,r,n));return v.createElement(MTe,{legendPayload:a})}function BTe(e){var{dataKey:t,nameKey:n,sectors:r,stroke:a,strokeWidth:s,fill:o,name:l,hide:u,tooltipType:d}=e;return{dataDefinedOnItem:r?.map(h=>h.tooltipPayload),positions:r?.map(h=>h.tooltipPosition),settings:{stroke:a,strokeWidth:s,fill:o,dataKey:t,nameKey:n,name:cc(l,t),hide:u,type:d,color:o,unit:""}}}var UTe=(e,t)=>e>t?"start":e<t?"end":"middle",qTe=(e,t,n)=>typeof t=="function"?t(e):ta(t,n,n*.8),HTe=(e,t,n)=>{var{top:r,left:a,width:s,height:o}=t,l=vY(s,o),u=a+ta(e.cx,s,s/2),d=r+ta(e.cy,o,o/2),h=ta(e.innerRadius,l,0),p=qTe(n,e.outerRadius,l),g=e.maxRadius||Math.sqrt(s*s+o*o)/2;return{cx:u,cy:d,innerRadius:h,outerRadius:p,maxRadius:g}},KTe=(e,t)=>{var n=gr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},VTe=(e,t)=>{if(v.isValidElement(e))return v.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Xe("recharts-pie-label-line",typeof e!="boolean"?e.className:"");return v.createElement(Ef,Iu({},t,{type:"linear",className:n}))},GTe=(e,t,n)=>{if(v.isValidElement(e))return v.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),v.isValidElement(r)))return r;var a=Xe("recharts-pie-label-text",typeof e!="boolean"&&typeof e!="function"?e.className:"");return v.createElement(Sw,Iu({},t,{alignmentBaseline:"middle",className:a}),r)};function WTe(e){var{sectors:t,props:n,showLabels:r}=e,{label:a,labelLine:s,dataKey:o}=n;if(!r||!a||!t)return null;var l=rt(n,!1),u=rt(a,!1),d=rt(s,!1),h=typeof a=="object"&&"offsetRadius"in a&&a.offsetRadius||20,p=t.map((g,x)=>{var y=(g.startAngle+g.endAngle)/2,w=Xn(g.cx,g.cy,g.outerRadius+h,y),j=Cn(Cn(Cn(Cn({},l),g),{},{stroke:"none"},u),{},{index:x,textAnchor:UTe(w.x,g.cx)},w),N=Cn(Cn(Cn(Cn({},l),g),{},{fill:"none",stroke:g.fill},d),{},{index:x,points:[Xn(g.cx,g.cy,g.outerRadius,y),w],key:"line"});return v.createElement(pn,{key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(x)},s&&VTe(s,N),GTe(a,j,Bt(g,o)))});return v.createElement(pn,{className:"recharts-pie-labels"},p)}function JQ(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:a,showLabels:s}=e,o=Be(tc),{onMouseEnter:l,onClick:u,onMouseLeave:d}=a,h=$Te(a,DTe),p=wP(l,a.dataKey),g=jP(d),x=NP(u,a.dataKey);return t==null?null:v.createElement(v.Fragment,null,t.map((y,w)=>{if(y?.startAngle===0&&y?.endAngle===0&&t.length!==1)return null;var j=n&&String(w)===o,N=o?r:null,k=j?n:N,S=Cn(Cn({},y),{},{stroke:y.stroke,tabIndex:-1,[_Y]:w,[kY]:a.dataKey});return v.createElement(pn,Iu({tabIndex:-1,className:"recharts-pie-sector"},W1(h,y,w),{onMouseEnter:p(y,w),onMouseLeave:g(y,w),onClick:x(y,w),key:"sector-".concat(y?.startAngle,"-").concat(y?.endAngle,"-").concat(y.midAngle,"-").concat(w)}),v.createElement(QQ,Iu({option:k,isActive:j,shapeType:"sector"},S)))}),v.createElement(WTe,{sectors:t,props:a,showLabels:s}))}function YTe(e){var t,{pieSettings:n,displayedData:r,cells:a,offset:s}=e,{cornerRadius:o,startAngle:l,endAngle:u,dataKey:d,nameKey:h,tooltipType:p}=n,g=Math.abs(n.minAngle),x=KTe(l,u),y=Math.abs(x),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,j=r.filter(T=>Bt(T,d,0)!==0).length,N=(y>=360?j:j-1)*w,k=y-j*g-N,S=r.reduce((T,P)=>{var M=Bt(P,d,0);return T+(Pe(M)?M:0)},0),E;if(S>0){var O;E=r.map((T,P)=>{var M=Bt(T,d,0),D=Bt(T,h,P),A=HTe(n,s,T),L=(Pe(M)?M:0)/S,F,B=Cn(Cn({},T),a&&a[P]&&a[P].props);P?F=O.endAngle+gr(x)*w*(M!==0?1:0):F=l;var U=F+gr(x)*((M!==0?g:0)+L*k),z=(F+U)/2,$=(A.innerRadius+A.outerRadius)/2,K=[{name:D,value:M,payload:B,dataKey:d,type:p}],G=Xn(A.cx,A.cy,$,z);return O=Cn(Cn(Cn(Cn({},n.presentationProps),{},{percent:L,cornerRadius:o,name:D,tooltipPayload:K,midAngle:z,middleRadius:$,tooltipPosition:G},B),A),{},{value:Bt(T,d),startAngle:F,endAngle:U,payload:B,paddingAngle:gr(x)*w}),O})}return E}function XTe(e){var{props:t,previousSectorsRef:n}=e,{sectors:r,isAnimationActive:a,animationBegin:s,animationDuration:o,animationEasing:l,activeShape:u,inactiveShape:d,onAnimationStart:h,onAnimationEnd:p}=t,g=Ow(t,"recharts-pie-"),x=n.current,[y,w]=v.useState(!0),j=v.useCallback(()=>{typeof p=="function"&&p(),w(!1)},[p]),N=v.useCallback(()=>{typeof h=="function"&&h(),w(!0)}
547,[h]);return v.createElement(Do,{begin:s,duration:o,isActive:a,easing:l,from:{t:0},to:{t:1},onAnimationStart:N,onAnimationEnd:j,key:g},k=>{var{t:S}=k,E=[],O=r&&r[0],T=O.startAngle;return r.forEach((P,M)=>{var D=x&&x[M],A=M>0?Zl(P,"paddingAngle",0):0;if(D){var L=Ka(D.endAngle-D.startAngle,P.endAngle-P.startAngle),F=Cn(Cn({},P),{},{startAngle:T+A,endAngle:T+L(S)+A});E.push(F),T=F.endAngle}else{var{endAngle:B,startAngle:U}=P,z=Ka(0,B-U),$=z(S),K=Cn(Cn({},P),{},{startAngle:T+A,endAngle:T+$+A});E.push(K),T=K.endAngle}}),n.current=E,v.createElement(pn,null,v.createElement(JQ,{sectors:E,activeShape:u,inactiveShape:d,allOtherPieProps:t,showLabels:!y}))})}function QTe(e){var{sectors:t,isAnimationActive:n,activeShape:r,inactiveShape:a}=e,s=v.useRef(null),o=s.current;return n&&t&&t.length&&(!o||o!==t)?v.createElement(XTe,{props:e,previousSectorsRef:s}):v.createElement(JQ,{sectors:t,activeShape:r,inactiveShape:a,allOtherPieProps:e,showLabels:!0})}function ZTe(e){var{hide:t,className:n,rootTabIndex:r}=e,a=Xe("recharts-pie",n);return t?null:v.createElement(pn,{tabIndex:r,className:a},v.createElement(QTe,e))}var eZ={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:!uc.isSsr,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff"};function JTe(e){var t=as(e,eZ),n=v.useMemo(()=>zg(e.children,Ah),[e.children]),r=rt(t,!1),a=v.useMemo(()=>({name:t.name,nameKey:t.nameKey,tooltipType:t.tooltipType,data:t.data,dataKey:t.dataKey,cx:t.cx,cy:t.cy,startAngle:t.startAngle,endAngle:t.endAngle,minAngle:t.minAngle,paddingAngle:t.paddingAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,cornerRadius:t.cornerRadius,legendT
547ype:t.legendType,fill:t.fill,presentationProps:r}),[t.cornerRadius,t.cx,t.cy,t.data,t.dataKey,t.endAngle,t.innerRadius,t.minAngle,t.name,t.nameKey,t.outerRadius,t.paddingAngle,t.startAngle,t.tooltipType,t.legendType,t.fill,r]),s=Be(o=>aTe(o,a,n));return v.createElement(v.Fragment,null,v.createElement(Ew,{fn:BTe,args:Cn(Cn({},t),{},{sectors:s})}),v.createElement(ZTe,Iu({},t,{sectors:s})))}class kP extends v.PureComponent{constructor(){super(...arguments),Aw(this,"id",Jl("recharts-pie-"))}render(){return v.createElement(v.Fragment,null,v.createElement(bTe,{data:this.props.data,dataKey:this.props.dataKey,hide:this.props.hide,angleAxisId:0,radiusAxisId:0,stackId:void 0,barSize:void 0,type:"pie"}),v.createElement(zTe,this.props),v.createElement(JTe,this.props),this.props.children)}}Aw(kP,"displayName","Pie");Aw(kP,"defaultProps",eZ);var ePe=ie([sr],e=>{if(e)return{top:e.top,bottom:e.bottom,left:e.left,right:e.right}}),tPe=ie([ePe,Vo,Go],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),nPe=e=>{var t=Rr();return Be(n=>Ps(n,"xAxis",e,t))},rPe=e=>{var t=Rr();return Be(n=>Ps(n,"yAxis",e,t))},Tw=()=>Be(tPe),aPe=()=>Be(aOe);function y7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function v7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y7(Object(n),!0).forEach(function(r){sPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sPe(e,t,n){return(t=iPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iPe(e){var t=oPe(e,"string");return typeof t=="symbol"?t:t+""}function oPe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lPe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:a,dataKey:s}=e;if(a===!1||t.x==null||t.y==null)return null;var o=v7(v7({index:n,dataKey:s,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},rt(a,!1)),HA(a)),l;return v.isValidElement(a)?l=v.cloneElement(a,o):typeof a=="function"?l=a(o):l=v.createElement(Cw,o),v.createElement(pn,{className:"recharts-active-dot"},l)};function aE(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:a}=e,s=Be(tc),o=aPe();if(t==null||o==null)return null;var l=t.find(u=>o.includes(u.payload));return Ct(l)?null:lPe({point:l,childIndex:Number(s),mainColor:n,dataKey:a,activeDot:r})}var cPe=()=>{var e=wn();return v.useEffect(()=>(e(iTe()),()=>{e(oTe())})),null},uPe=["children"];function dPe(e,t){if(e==null)return{};var n,r,a=fPe(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)&&(a[n]=e[n])}return a}function fPe(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 w7=()=>{},tZ=v.createContext({addErrorBar:w7,removeErrorBar:w7}),hPe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},nZ=v.createContext(hPe);function rZ(e){var{children:t}=e,n=dPe(e,uPe);return v.createElement(nZ.Provider,{value:n},t)}var pPe=()=>v.useContext(nZ),SP=e=>{var{children:t,xAxisId:n,yAxisId:r,zAxisId:a,dataKey:s,data:o,stackId:l,hide:u,type:d,barSize:h}=e,[p,g]=v.useState([]),x=v.useCallback(j=>{g(N=>[...N,j])},[g]),y=v.useCallback(j=>{g(N=>N.filter(k=>k!==j))},[g]),w=Rr();return v.createElement(tZ.Provider,{value:{addErrorBar:x,removeErrorBar:y}},v.createElement(xTe,{type:d,data:o,xAxisId:n,yAxisId:r,zAxisId:a,dataKey:s,errorBars:p,stackId:l,hide:u,barSize:h,isPanorama:w}),t)};function mPe(e){var{addErrorBar:t,removeErrorBar:n}=v.useContext(tZ);return v.useEffect(()=>(t(e),()=>{n(e)}),[t,n,e]),null}var gPe=["direction","width","dataKey","isAnimationActive","animationBegin","animationDuration","animationEasing"];function aZ(e,t,n){return(t=xPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xPe(e){var t=bPe(e,"string");return typeof t=="symbol"?t:t+""}function bPe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cg(){return cg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cg.apply(null,arguments)}function yPe(e,t){if(e==null)return{};var n,r,a=vPe(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)&&(a[n]=e[n])}return a}function vPe(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}function wPe(e){var{direction:t,width:n,dataKey:r,isAnimationActive:a,animationBegin:s,animationDuration:o,animationEasing:l}=e,u=yPe(e,gPe),d=rt(u,!1),{data:h,dataPointFormatter:p,xAxisId:g,yAxisId:x,errorBarOffset:y}=pPe(),w=nPe(g),j=rPe(x);if(w?.scale==null||j?.scale==null||h==null||t==="x"&&w.type!=="number")return null;var N=h.map(k=>{var{x:S,y:E,value:O,errorVal:T}=p(k,r,t);if(!T)return null;var P=[],M,D;if(Array.isArray(T)?[M,D]=T:M=D=T,t==="x"){var{scale:A}=w,L=E+y,F=L+n,B=L-n,U=A(O-M),z=A(O+D);P.push({x1:z,y1:F,x2:z,y2:B}),P.push({x1:U,y1:L,x2:z,y2:L}),P.push({x1:U,y1:F,x2:U,y2:B})}else if(t==="y"){var{scale:$}=j,K=S+y,G=K-n,W=K+n,I=$(O-M),H=$(O+D);P.push({x1:G,y1:H,x2:W,y2:H}),P.push({x1:K,y1:I,x2:K,y2:H}),P.push({x1:G,y1:I,x2:W,y2:I})}var V="".concat(S+y,"px ").concat(E+y,"px");return v.createElement(pn,cg({className:"recharts-errorBar",key:"bar-".concat(P.map(X=>"".concat(X.x1,"-").concat(X.x2,"-").concat(X.y1,"-").concat(X.y2)))},d),P.map(X=>{var te=a?{transformOrigin:"".concat(X.x1-5,"px")}:void 0;return v.createElement(Do,{from:{transform:"scaleY(0)",transformOrigin:V},to:{transform:"scaleY(1)",transformOrigin:V},begin:s,easing:l,isActive:a,duration:o,key:"line-".concat(X.x1,"-").concat(X.x2,"-").concat(X.y1,"-").concat(X.y2),style:{transformOrigin:V}},v.createElement("line",cg({},X,{style:te})))}))});return v.createElement(pn,{className:"recharts-errorBars"},N)}var sZ=v.createContext(void 0);function jPe(e){var t=v.useContext(sZ);return e??t??"x"}function iZ(e){var{direction:t,children:n}=e;return v.createElement(sZ.Provider,{value:t},n)}var oZ={stroke:"black",strokeWidth:1.5,width:5,offset:0,isAnimationActive:!0,animationBegin:0,animationDuration:400,animationEasing:"ease-in-out"};function NPe(e){var t=jPe(e.direction),{width:n,isAnimationActive:r,animationBegin:a,animationDuration:s,animationEasing:o}=as(e,oZ);return v.createElement(v.Fragment,null,v.createElement(mPe,{dataKey:e.dataKey,direction:t}),v.createElement(wPe,cg({},e,{direction:t,width:n,isAnimationActive:r,animationBegin:a,animationDuration:s,animationEasing:o})))}class lZ extends v.Component{render(){return v.createElement(NPe,this.props)}}aZ(lZ,"defaultProps",oZ);aZ(lZ,"displayName","ErrorBar");var _Pe="Invariant failed";function kPe(e,t){throw new Error(_Pe)}var SPe=["x","y"];function sE(){return sE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sE.apply(null,arguments)}function j7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function em(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
547t%2?j7(Object(n),!0).forEach(function(r){CPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CPe(e,t,n){return(t=EPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EPe(e){var t=OPe(e,"string");return typeof t=="symbol"?t:t+""}function OPe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function APe(e,t){if(e==null)return{};var n,r,a=TPe(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)&&(a[n]=e[n])}return a}function TPe(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}function PPe(e,t){var{x:n,y:r}=e,a=APe(e,SPe),s="".concat(n),o=parseInt(s,10),l="".concat(r),u=parseInt(l,10),d="".concat(t.height||a.height),h=parseInt(d,10),p="".concat(t.width||a.width),g=parseInt(p,10);return em(em(em(em(em({},t),a),o?{x:o}:{}),u?{y:u}:{}),{},{height:h,width:g,name:t.name,radius:t.radius})}function cZ(e){return v.createElement(QQ,sE({shapeType:"rectangle",propTransformer:PPe,activeClassName:"recharts-active-bar"},e))}var RPe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,a)=>{if(Pe(t))return t;var s=Pe(r)||Ct(r);return s?t(r,a):(s||kPe(),n)}};function Pw(e,t){var n,r,a=Be(d=>Yo(d,e)),s=Be(d=>hc(d,t)),o=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:za.allowDataOverflow,l=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:Ba.allowDataOverflow,u=o||l;return{needClip:u,needClipX:o,needClipY:l}}function CP(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,a=Tw(),{needClipX:s,needClipY:o,needClip:l}=Pw(t,n);if(!l)return null;var{x:u,y:d,width:h,height:p}=a;return v.createElement("clipPath",{id:"clipPath-".concat(r)},v.createElement("rect",{x:s?u:u-h/2,y:o?d:d-p/2,width:s?h:h*2,height:o?p:p*2}))}var MPe=["onMouseEnter","onMouseLeave","onClick"],DPe=["value","background","tooltipPosition"],$Pe=["onMouseEnter","onClick","onMouseLeave"];function ug(){return ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ug.apply(null,arguments)}function N7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N7(Object(n),!0).forEach(function(r){Rw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rw(e,t,n){return(t=IPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IPe(e){var t=LPe(e,"string");return typeof t=="symbol"?t:t+""}function LPe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iE(e,t){if(e==null)return{};var n,r,a=FPe(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)&&(a[n]=e[n])}return a}function FPe(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 zPe=e=>{var{dataKey:t,name:n,fill:r,legendType:a,hide:s}=e;return[{inactive:s,dataKey:t,type:a,color:r,value:cc(n,t),payload:e}]};function BPe(e){var{dataKey:t,stroke:n,strokeWidth:r,fill:a,name:s,hide:o,unit:l}=e;return{dataDefinedOnItem:void 0,positions:void 0,settings:{stroke:n,strokeWidth:r,fill:a,dataKey:t,nameKey:void 0,name:cc(s,t),hide:o,type:e.tooltipType,color:e.fill,unit:l}}}function UPe(e){var t=Be(tc),{data:n,dataKey:r,background:a,allOtherBarProps:s}=e,{onMouseEnter:o,onMouseLeave:l,onClick:u}=s,d=iE(s,MPe),h=wP(o,r),p=jP(l),g=NP(u,r);if(!a||n==null)return null;var x=rt(a,!1);return v.createElement(v.Fragment,null,n.map((y,w)=>{var{value:j,background:N,tooltipPosition:k}=y,S=iE(y,DPe);if(!N)return null;var E=h(y,w),O=p(y,w),T=g(y,w),P=qr(qr(qr(qr(qr({option:a,isActive:String(w)===t},S),{},{fill:"#eee"},N),x),W1(d,y,w)),{},{onMouseEnter:E,onMouseLeave:O,onClick:T,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return v.createElement(cZ,ug({key:"background-bar-".concat(w)},P))}))}function uZ(e){var{data:t,props:n,showLabels:r}=e,a=rt(n,!1),{shape:s,dataKey:o,activeBar:l}=n,u=Be(tc),d=Be(AQ),{onMouseEnter:h,onClick:p,onMouseLeave:g}=n,x=iE(n,$Pe),y=wP(h,o),w=jP(g),j=NP(p,o);return t?v.createElement(v.Fragment,null,t.map((N,k)=>{var S=l&&String(k)===u&&(d==null||o===d),E=S?l:s,O=qr(qr(qr({},a),N),{},{isActive:S,option:E,index:k,dataKey:o});return v.createElement(pn,ug({className:"recharts-bar-rectangle"},W1(x,N,k),{onMouseEnter:y(N,k),onMouseLeave:w(N,k),onClick:j(N,k),key:"rectangle-".concat(N?.x,"-").concat(N?.y,"-").concat(N?.value,"-").concat(k)}),v.createElement(cZ,O))}),r&&Ti.renderCallByParent(n,t)):null}function qPe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:a,isAnimationActive:s,animationBegin:o,animationDuration:l,animationEasing:u,onAnimationEnd:d,onAnimationStart:h}=t,p=n.current,g=Ow(t,"recharts-bar-"),[x,y]=v.useState(!1),w=v.useCallback(()=>{typeof d=="function"&&d(),y(!1)},[d]),j=v.useCallback(()=>{typeof h=="function"&&h(),y(!0)}
547,[h]);return v.createElement(Do,{begin:o,duration:l,isActive:s,easing:u,from:{t:0},to:{t:1},onAnimationEnd:w,onAnimationStart:j,key:g},N=>{var{t:k}=N,S=k===1?r:r.map((E,O)=>{var T=p&&p[O];if(T){var P=Ka(T.x,E.x),M=Ka(T.y,E.y),D=Ka(T.width,E.width),A=Ka(T.height,E.height);return qr(qr({},E),{},{x:P(k),y:M(k),width:D(k),height:A(k)})}if(a==="horizontal"){var L=Ka(0,E.height),F=L(k);return qr(qr({},E),{},{y:E.y+E.height-F,height:F})}var B=Ka(0,E.width),U=B(k);return qr(qr({},E),{},{width:U})});return k>0&&(n.current=S),v.createElement(pn,null,v.createElement(uZ,{props:t,data:S,showLabels:!x}))})}function HPe(e){var{data:t,isAnimationActive:n}=e,r=v.useRef(null);return n&&t&&t.length&&(r.current==null||r.current!==t)?v.createElement(qPe,{previousRectanglesRef:r,props:e}):v.createElement(uZ,{props:e,data:t,showLabels:!0})}var dZ=0,KPe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:Bt(e,t)}};class VPe extends v.PureComponent{constructor(){super(...arguments),Rw(this,"id",Jl("recharts-bar-"))}render(){var{hide:t,data:n,dataKey:r,className:a,xAxisId:s,yAxisId:o,needClip:l,background:u,id:d,layout:h}=this.props;if(t)return null;var p=Xe("recharts-bar",a),g=Ct(d)?this.id:d;return v.createElement(pn,{className:p},l&&v.createElement("defs",null,v.createElement(CP,{clipPathId:g,xAxisId:s,yAxisId:o})),v.createElement(pn,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(g,")"):null},v.createElement(UPe,{data:n,dataKey:r,background:u,allOtherBarProps:this.props}),v.createElement(HPe,this.props)),v.createElement(iZ,{direction:h==="horizontal"?"y":"x"},this.props.children))}}var fZ={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",hide:!1,isAnimationActive:!uc.isSsr,legendType:"rect",minPointSize:dZ,xAxisId:0,yAxisId:0};function GPe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:s,activeBar:o,animationBegin:l,animationDuration:u,animationEasing:d,isAnimationActive:h}=as(e,fZ),{needClip:p}=Pw(t,n),g=Ug(),x=Rr(),y=v.useMemo(()=>({barSize:e.barSize,data:void 0,dataKey:e.dataKey,maxBarSize:e.maxBarSize,minPointSize:s,stackId:sT(e.stackId)}),[e.barSize,e.dataKey,e.maxBarSize,s,e.stackId]),w=zg(e.children,Ah),j=Be(S=>w3e(S,t,n,x,y,w));if(g!=="vertical"&&g!=="horizontal")return null;var N,k=j?.[0];return k==null||k.height==null||k.width==null?N=0:N=g==="vertical"?k.height/2:k.width/2,v.createElement(rZ,{xAxisId:t,yAxisId:n,data:j,dataPointFormatter:KPe,errorBarOffset:N},v.createElement(VPe,ug({},e,{layout:g,needClip:p,data:j,xAxisId:t,yAxisId:n,hide:r,legendType:a,minPointSize:s,activeBar:o,animationBegin:l,animationDuration:u,animationEasing:d,isAnimationActive:h})))}function WPe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r},pos:a,bandSize:s,xAxis:o,yAxis:l,xAxisTicks:u,yAxisTicks:d,stackedData:h,displayedData:p,offset:g,cells:x}=e,y=t==="horizontal"?l:o,w=h?y.scale.domain():null,j=K_e({numericAxis:y});return p.map((N,k)=>{var S,E,O,T,P,M;h?S=z_e(h[k],w):(S=Bt(N,n),Array.isArray(S)||(S=[j,S]));var D=RPe(r,dZ)(S[1],k);if(t==="horizontal"){var A,[L,F]=[l.scale(S[0]),l.scale(S[1])];E=c8({axis:o,ticks:u,bandSize:s,offset:a.offset,entry:N,index:k}),O=(A=F??L)!==null&&A!==void 0?A:void 0,T=a.size;var B=L-F;if(P=Na(B)?0:B,M={x:E,y:g.top,width:T,height:g.height},Math.abs(D)>0&&Math.abs(P)<Math.abs(D)){var U=gr(P||D)*(Math.abs(D)-Math.abs(P));O-=U,P+=U}}else{var[z,$]=[o.scale(S[0]),o.scale(S[1])];if(E=z,O=c8({axis:l,ticks:d,bandSize:s,offset:a.offset,entry:N,index:k}),T=$-z,P=a.size,M={x:g.left,y:O,width:g.width,height:P},Math.abs(D)>0&&Math.abs(T)<Math.abs(D)){var K=gr(T||D)*(Math.abs(D)-Math.abs(T));T+=K}}var G=qr(qr({},N),{},{x:E,y:O,width:T,height:P,value:h?S:S[1],payload:N,background:M,tooltipPosition:{x:E+T/2,y:O+P/2}},x&&x[k]&&x[k].props);return G})}class dg extends v.PureComponent{render(){return v.createElement(SP,{type:"bar",data:null,xAxisId:this.props.xAxisId,yAxisId:this.props.yAxisId,zAxisId:0,dataKey:this.props.dataKey,stackId:this.props.stackId,hide:this.props.hide,barSize:this.props.barSize},v.createElement(cPe,null),v.createElement(_P,{legendPayload:zPe(this.props)}),v.createElement(Ew,{fn:BPe,args:this.props}),v.createElement(GPe,this.props))}}Rw(dg,"displayName","Bar");Rw(dg,"defaultProps",fZ);function _7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function b0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
547t%2?_7(Object(n),!0).forEach(function(r){YPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YPe(e,t,n){return(t=XPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XPe(e){var t=QPe(e,"string");return typeof t=="symbol"?t:t+""}function QPe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZPe=(e,t)=>t,JPe=(e,t,n)=>n,e3e=(e,t,n,r)=>r,EP=(e,t,n,r,a)=>a,t3e=(e,t,n,r,a)=>a.maxBarSize,n3e=(e,t,n,r,a,s)=>s,k7=(e,t,n)=>{var r=n??e;if(!Ct(r))return ta(r,t,0)},r3e=ie([ht,Xg,ZPe,JPe,e3e],(e,t,n,r,a)=>t.filter(s=>e==="horizontal"?s.xAxisId===n:s.yAxisId===r).filter(s=>s.isPanorama===a).filter(s=>s.hide===!1).filter(s=>s.type==="bar")),a3e=(e,t,n,r)=>{var a=ht(e);return a==="horizontal"?og(e,"yAxis",n,r):og(e,"xAxis",t,r)},s3e=(e,t,n)=>{var r=ht(e);return r==="horizontal"?S9(e,"xAxis",t):S9(e,"yAxis",n)};function i3e(e){return e.stackId!=null&&e.dataKey!=null}var o3e=(e,t,n)=>{var r={},a=e.filter(i3e),s=e.filter(d=>d.stackId==null),o=a.reduce((d,h)=>(d[h.stackId]||(d[h.stackId]=[]),d[h.stackId].push(h),d),r),l=Object.entries(o).map(d=>{var[h,p]=d,g=p.map(y=>y.dataKey),x=k7(t,n,p[0].barSize);return{stackId:h,dataKeys:g,barSize:x}}),u=s.map(d=>{var h=[d.dataKey].filter(g=>g!=null),p=k7(t,n,d.barSize);return{stackId:void 0,dataKeys:h,barSize:p}});return[...l,...u]},l3e=ie([r3e,mCe,s3e],o3e),c3e=(e,t,n,r,a)=>{var s,o,l=ht(e),u=$X(e),{maxBarSize:d}=a,h=Ct(d)?u:d,p,g;return l==="horizontal"?(p=Ps(e,"xAxis",t,r),g=$i(e,"xAxis",t,r)):(p=Ps(e,"yAxis",n,r),g=$i(e,"yAxis",n,r)),(s=(o=Du(p,g,!0))!==null&&o!==void 0?o:h)!==null&&s!==void 0?s:0},hZ=(e,t,n,r)=>{var a=ht(e),s,o;return a==="horizontal"?(s=Ps(e,"xAxis",t,r),o=$i(e,"xAxis",t,r)):(s=Ps(e,"yAxis",n,r),o=$i(e,"yAxis",n,r)),Du(s,o)};function u3e(e,t,n,r,a){var s=r.length;if(!(s<1)){var o=ta(e,n,0,!0),l,u=[];if(Pr(r[0].barSize)){var d=!1,h=n/s,p=r.reduce((N,k)=>N+(k.barSize||0),0);p+=(s-1)*o,p>=n&&(p-=(s-1)*o,o=0),p>=n&&h>0&&(d=!0,h*=.9,p=s*h);var g=(n-p)/2>>0,x={offset:g-o,size:0};l=r.reduce((N,k)=>{var S,E={stackId:k.stackId,dataKeys:k.dataKeys,position:{offset:x.offset+x.size+o,size:d?h:(S=k.barSize)!==null&&S!==void 0?S:0}}
547,O=[...N,E];return x=O[O.length-1].position,O},u)}else{var y=ta(t,n,0,!0);n-2*y-(s-1)*o<=0&&(o=0);var w=(n-2*y-(s-1)*o)/s;w>1&&(w>>=0);var j=Pr(a)?Math.min(w,a):w;l=r.reduce((N,k,S)=>[...N,{stackId:k.stackId,dataKeys:k.dataKeys,position:{offset:y+(w+o)*S+(w-j)/2,size:j}}],u)}return l}}var d3e=(e,t,n,r,a,s,o)=>{var l=Ct(o)?t:o,u=u3e(n,r,a!==s?a:s,e,l);return a!==s&&u!=null&&(u=u.map(d=>b0(b0({},d),{},{position:b0(b0({},d.position),{},{offset:d.position.offset-a/2})}))),u},f3e=ie([l3e,$X,pCe,IX,c3e,hZ,t3e],d3e),h3e=(e,t,n,r)=>Ps(e,"xAxis",t,r),p3e=(e,t,n,r)=>Ps(e,"yAxis",n,r),m3e=(e,t,n,r)=>$i(e,"xAxis",t,r),g3e=(e,t,n,r)=>$i(e,"yAxis",n,r),x3e=ie([f3e,EP],(e,t)=>{if(e!=null){var n=e.find(r=>r.stackId===t.stackId&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}}),b3e=(e,t)=>{if(!(!e||t?.dataKey==null)){var{stackId:n}=t;if(n!=null){var r=e[n];if(r){var{stackedData:a}=r;if(a){var s=a.find(o=>o.key===t.dataKey);return s}}}}},y3e=ie([Xg,EP],(e,t)=>{if(e.some(n=>n.type==="bar"&&t.dataKey===n.dataKey&&t.stackId===n.stackId&&t.stackId===n.stackId))return t}),v3e=ie([a3e,EP],b3e),w3e=ie([sr,h3e,p3e,m3e,g3e,x3e,ht,mw,hZ,v3e,y3e,n3e],(e,t,n,r,a,s,o,l,u,d,h,p)=>{var{chartData:g,dataStartIndex:x,dataEndIndex:y}=l;if(!(h==null||s==null||o!=="horizontal"&&o!=="vertical"||t==null||n==null||r==null||a==null||u==null)){var{data:w}=h,j;if(w!=null&&w.length>0?j=w:j=g?.slice(x,y+1),j!=null)return WPe({layout:o,barSettings:h,pos:s,bandSize:u,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:a,stackedData:d,displayedData:j,offset:e,cells:p})}}),pZ=e=>{var{chartData:t}=e,n=wn(),r=Rr();return v.useEffect(()=>r?()=>{}:(n($9(t)),()=>{n($9(void 0))}),[t,n,r]),null},S7={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},mZ=Ds({name:"brush",initialState:S7,reducers:{setBrushSettings(e,t){return t.payload==null?S7:t.payload}}}),{setBrushSettings:aUe}=mZ.actions,j3e=mZ.reducer;function C7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function y0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C7(Object(n),!0).forEach(function(r){gZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gZ(e,t,n){return(t=N3e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N3e(e){var t=_3e(e,"string");return typeof t=="symbol"?t:t+""}function _3e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Mw{static create(t){return new Mw(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}
547apply(t){var{bandAware:n,position:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(r)switch(r){case"start":return this.scale(t);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(t)+s}default:return this.scale(t)}if(n){var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+o}return this.scale(t)}}isInRange(t){var n=this.range(),r=n[0],a=n[n.length-1];return r<=a?t>=r&&t<=a:t>=a&&t<=r}}gZ(Mw,"EPS",1e-4);var k3e=e=>{var t=Object.keys(e).reduce((n,r)=>y0(y0({},n),{},{[r]:Mw.create(e[r])}),{});return y0(y0({},t),{},{apply(n){var{bandAware:r,position:a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.fromEntries(Object.entries(n).map(s=>{var[o,l]=s;return[o,t[o].apply(l,{bandAware:r,position:a})]}))},isInRange(n){return Object.keys(n).every(r=>t[r].isInRange(n[r]))}})};function S3e(e){return(e%180+180)%180}var C3e=function(t){var{width:n,height:r}=t,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=S3e(a),o=s*Math.PI/180,l=Math.atan(r/n),u=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(u)},E3e={dots:[],areas:[],lines:[]},xZ=Ds({name:"referenceElements",initialState:E3e,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=So(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=So(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=So(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:O3e,removeDot:A3e,addArea:sUe,removeArea:iUe,addLine:oUe,removeLine:lUe}=xZ.actions,T3e=xZ.reducer,bZ=v.createContext(void 0),P3e=e=>{var{children:t}=e,[n]=v.useState("".concat(Jl("recharts"),"-clip")),r=Tw();if(r==null)return null;var{x:a,y:s,width:o,height:l}=r;return v.createElement(bZ.Provider,{value:n},v.createElement("defs",null,v.createElement("clipPath",{id:n},v.createElement("rect",{x:a,y:s,height:l,width:o}))),t)},R3e=()=>v.useContext(bZ);function E7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function O7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E7(Object(n),!0).forEach(function(r){OP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OP(e,t,n){return(t=M3e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M3e(e){var t=D3e(e,"string");return typeof t=="symbol"?t:t+""}function D3e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oE(){return oE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oE.apply(null,arguments)}var $3e=(e,t,n,r,a)=>{var s=Os(e),o=Os(t),l=Rr(),u=Be(g=>ec(g,"xAxis",n,l)),d=Be(g=>ec(g,"yAxis",r,l));if(!s||!o||u==null||d==null)return null;var h=k3e({x:u,y:d}),p=h.apply({x:e,y:t},{bandAware:!0});return a==="discard"&&!h.isInRange(p)?null:p};function I3e(e){var t=wn();return v.useEffect(()=>(t(O3e(e)),()=>{t(A3e(e))})),null}var L3e=(e,t)=>{var n;return v.isValidElement(e)?n=v.cloneElement(e,t):typeof e=="function"?n=e(t):n=v.createElement(Cw,oE({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n};function F3e(e){var{x:t,y:n,r}=e,a=R3e(),s=$3e(t,n,e.xAxisId,e.yAxisId,e.ifOverflow);if(!s)return null;var{x:o,y:l}=s,{shape:u,className:d,ifOverflow:h}=e,p=h==="hidden"?"url(#".concat(a,")"):void 0,g=O7(O7({clipPath:p},rt(e,!0)),{},{cx:o,cy:l});return v.createElement(pn,{className:Xe("recharts-reference-dot",d)},L3e(u,g),fa.renderCallByParent(e,{x:o-r,y:l-r,width:2*r,height:2*r}))}function z3e(e){var{x:t,y:n,r,ifOverflow:a,yAxisId:s,xAxisId:o}=e;return v.createElement(v.Fragment,null,v.createElement(I3e,{y:n,x:t,r,yAxisId:s,xAxisId:o,ifOverflow:a}),v.createElement(F3e,e))}class AP extends v.Component{render(){return v.createElement(z3e,this.props)}}OP(AP,"displayName","ReferenceDot");OP(AP,"defaultProps",{ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});function f5(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}
547function yZ(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function B3e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return C3e(r,n)}function U3e(e,t,n){var r=n==="width",{x:a,y:s,width:o,height:l}=e;return t===1?{start:r?a:s,end:r?a+o:s+l}:{start:r?a+o:s+l,end:r?a:s}}function Mv(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-a)<=0}function q3e(e,t){return yZ(e,t+1)}function H3e(e,t,n,r,a){for(var s=(r||[]).slice(),{start:o,end:l}=t,u=0,d=1,h=o,p=function(){var y=r?.[u];if(y===void 0)return{v:yZ(r,d)};var w=u,j,N=()=>(j===void 0&&(j=n(y,w)),j),k=y.coordinate,S=u===0||Mv(e,k,N,h,l);S||(u=0,h=o,d+=1),S&&(h=k+e*(N()/2+a),u+=d)},g;d<=s.length;)if(g=p(),g)return g.v;return[]}function A7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A7(Object(n),!0).forEach(function(r){K3e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function K3e(e,t,n){return(t=V3e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V3e(e){var t=G3e(e,"string");return typeof t=="symbol"?t:t+""}function G3e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W3e(e,t,n,r,a){for(var s=(r||[]).slice(),o=s.length,{start:l}=t,{end:u}=t,d=function(g){var x=s[g],y,w=()=>(y===void 0&&(y=n(x,g)),y);if(g===o-1){var j=e*(x.coordinate+e*w()/2-u);s[g]=x=Br(Br({},x),{},{tickCoord:j>0?x.coordinate-j*e:x.coordinate})}else s[g]=x=Br(Br({},x),{},{tickCoord:x.coordinate});var N=Mv(e,x.tickCoord,w,l,u);N&&(u=x.tickCoord-e*(w()/2+a),s[g]=Br(Br({},x),{},{isShow:!0}))},h=o-1;h>=0;h--)d(h);return s}function Y3e(e,t,n,r,a,s){var o=(r||[]).slice(),l=o.length,{start:u,end:d}=t;if(s){var h=r[l-1],p=n(h,l-1),g=e*(h.coordinate+e*p/2-d);o[l-1]=h=Br(Br({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate});var x=Mv(e,h.tickCoord,()=>p,u,d);x&&(d=h.tickCoord-e*(p/2+a),o[l-1]=Br(Br({},h),{},{isShow:!0}))}for(var y=s?l-1:l,w=function(k){var S=o[k],E,O=()=>(E===void 0&&(E=n(S,k)),E);if(k===0){var T=e*(S.coordinate-e*O()/2-u);o[k]=S=Br(Br({},S),{},{tickCoord:T<0?S.coordinate-T*e:S.coordinate})}else o[k]=S=Br(Br({},S),{},{tickCoord:S.coordinate});var P=Mv(e,S.tickCoord,O,u,d);P&&(u=S.tickCoord+e*(O()/2+a),o[k]=Br(Br({},S),{},{isShow:!0}))},j=0;j<y;j++)w(j);return o}function TP(e,t,n){var{tick:r,ticks:a,viewBox:s,minTickGap:o,orientation:l,interval:u,tickFormatter:d,unit:h,angle:p}=e;if(!a||!a.length||!r)return[];if(Pe(u)||uc.isSsr){var g;return(g=q3e(a,Pe(u)?u:0))!==null&&g!==void 0?g:[]}var x=[],y=l==="top"||l==="bottom"?"width":"height",w=h&&y==="width"?Am(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(S,E)=>{var O=typeof d=="function"?d(S.value,E):S.value;return y==="width"?B3e(Am(O,{fontSize:t,letterSpacing:n}),w,p):Am(O,{fontSize:t,letterSpacing:n})[y]},N=a.length>=2?gr(a[1].coordinate-a[0].coordinate):1,k=U3e(s,N,y);return u==="equidistantPreserveStart"?H3e(N,k,j,a,o):(u==="preserveStart"||u==="preserveStartEnd"?x=Y3e(N,k,j,a,o,u==="preserveStartEnd"):x=W3e(N,k,j,a,o),x.filter(S=>S.isShow))}var X3e=["viewBox"],Q3e=["viewBox"];function yf(){return yf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yf.apply(null,arguments)}function T7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
547t%2?T7(Object(n),!0).forEach(function(r){PP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P7(e,t){if(e==null)return{};var n,r,a=Z3e(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)&&(a[n]=e[n])}return a}function Z3e(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}function PP(e,t,n){return(t=J3e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J3e(e){var t=eRe(e,"string");return typeof t=="symbol"?t:t+""}function eRe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class pc extends v.Component{constructor(t){super(t),this.tickRefs=v.createRef(),this.tickRefs.current=[],this.state={fontSize:"",letterSpacing:""}}shouldComponentUpdate(t,n){var{viewBox:r}=t,a=P7(t,X3e),s=this.props,{viewBox:o}=s,l=P7(s,Q3e);return!f5(r,o)||!f5(a,l)||!f5(n,this.state)}getTickLineCoord(t){var{x:n,y:r,width:a,height:s,orientation:o,tickSize:l,mirror:u,tickMargin:d}=this.props,h,p,g,x,y,w,j=u?-1:1,N=t.tickSize||l,k=Pe(t.tickCoord)?t.tickCoord:t.coordinate;switch(o){case"top":h=p=t.coordinate,x=r+ +!u*s,g=x-j*N,w=g-j*d,y=k;break;case"left":g=x=t.coordinate,p=n+ +!u*a,h=p-j*N,y=h-j*d,w=k;break;case"right":g=x=t.coordinate,p=n+ +u*a,h=p+j*N,y=h+j*d,w=k;break;default:h=p=t.coordinate,x=r+ +u*s,g=x+j*N,w=g+j*d,y=k;break}return{line:{x1:h,y1:g,x2:p,y2:x},tick:{x:y,y:w}}}getTickTextAnchor(){var{orientation:t,mirror:n}=this.props,r;switch(t){case"left":r=n?"start":"end";break;case"right":r=n?"end":"start";break;default:r="middle";break}return r}getTickVerticalAnchor(){var{orientation:t,mirror:n}=this.props;switch(t){case"left":case"right":return"middle";case"top":return n?"start":"end";default:return n?"end":"start"}}renderAxisLine(){var{x:t,y:n,width:r,height:a,orientation:s,mirror:o,axisLine:l}=this.props,u=tr(tr(tr({},rt(this.props,!1)),rt(l,!1)),{},{fill:"none"});if(s==="top"||s==="bottom"){var d=+(s==="top"&&!o||s==="bottom"&&o);u=tr(tr({},u),{},{x1:t,y1:n+d*a,x2:t+r,y2:n+d*a})}else{var h=+(s==="left"&&!o||s==="right"&&o);u=tr(tr({},u),{},{x1:t+h*r,y1:n,x2:t+h*r,y2:n+a})}return v.createElement("line",yf({},u,{className:Xe("recharts-cartesian-axis-line",Zl(l,"className"))}))}static renderTickItem(t,n,r){var a,s=Xe(n.className,"recharts-cartesian-axis-tick-value");if(v.isValidElement(t))a=v.cloneElement(t,tr(tr({},n),{},{className:s}));else if(typeof t=="function")a=t(tr(tr({},n),{},{className:s}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Xe(o,t.className)),a=v.createElement(Sw,yf({},n,{className:o}),r)}return a}renderTicks(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],{tickLine:a,stroke:s,tick:o,tickFormatter:l,unit:u}=this.props,d=TP(tr(tr({},this.props),{},{ticks:r}),t,n),h=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),g=rt(this.props,!1),x=rt(o,!1),y=tr(tr({},g),{},{fill:"none"},rt(a,!1)),w=d.map((j,N)=>{var{line:k,tick:S}=this.getTickLineCoord(j),E=tr(tr(tr(tr({textAnchor:h,verticalAnchor:p},g),{},{stroke:"none",fill:s},x),S),{},{index:N,payload:j,visibleTicksCount:d.length,tickFormatter:l});return v.createElement(pn,yf({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},W1(this.props,j,N)),a&&v.createElement("line",yf({},y,k,{className:Xe("recharts-cartesian-axis-tick-line",Zl(a,"className"))})),o&&pc.renderTickItem(o,E,"".concat(typeof l=="function"?l(j.value,N):j.value).concat(u||"")))});return w.length>0?v.createElement("g",{className:"recharts-cartesian-axis-ticks"},w):null}render(){var{axisLine:t,width:n,height:r,className:a,hide:s}=this.props;if(s)return null;var{ticks:o}=this.props;return n!=null&&n<=0||r!=null&&r<=0?null:v.createElement(pn,{className:Xe("recharts-cartesian-axis",a),ref:l=>{if(l){var u=l.getElementsByClassName("recharts-cartesian-axis-tick-value");this.tickRefs.current=Array.from(u);var d=u[0];if(d){var h=window.getComputedStyle(d).fontSize,p=window.getComputedStyle(d).letterSpacing;(h!==this.state.fontSize||p!==this.state.letterSpacing)&&this.setState({fontSize:window.getComputedStyle(d).fontSize,letterSpacing:window.getComputedStyle(d).letterSpacing})}}}},t&&this.renderAxisLine(),this.renderTicks(this.state.fontSize,this.state.letterSpacing,o),fa.renderCallByParent(this.props))}}
547PP(pc,"displayName","CartesianAxis");PP(pc,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var tRe=["x1","y1","x2","y2","key"],nRe=["offset"],rRe=["xAxisId","yAxisId"],aRe=["xAxisId","yAxisId"];function R7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Hr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R7(Object(n),!0).forEach(function(r){sRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sRe(e,t,n){return(t=iRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iRe(e){var t=oRe(e,"string");return typeof t=="symbol"?t:t+""}function oRe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},au.apply(null,arguments)}function Dv(e,t){if(e==null)return{};var n,r,a=lRe(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)&&(a[n]=e[n])}return a}function lRe(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 cRe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:a,width:s,height:o,ry:l}=e;return v.createElement("rect",{x:r,y:a,ry:l,width:s,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function vZ(e,t){var n;if(v.isValidElement(e))n=v.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{var{x1:r,y1:a,x2:s,y2:o,key:l}=t,u=Dv(t,tRe),d=rt(u,!1),{offset:h}=d,p=Dv(d,nRe);n=v.createElement("line",au({},p,{x1:r,y1:a,x2:s,y2:o,fill:"none",key:l}))}return n}function uRe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:a}=e;if(!r||!a||!a.length)return null;var{xAxisId:s,yAxisId:o}=e,l=Dv(e,rRe),u=a.map((d,h)=>{var p=Hr(Hr({},l),{},{x1:t,y1:d,x2:t+n,y2:d,key:"line-".concat(h),index:h});return vZ(r,p)});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function dRe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:a}=e;if(!r||!a||!a.length)return null;var{xAxisId:s,yAxisId:o}=e,l=Dv(e,aRe),u=a.map((d,h)=>{var p=Hr(Hr({},l),{},{x1:d,y1:t,x2:d,y2:t+n,key:"line-".concat(h),index:h});return vZ(r,p)});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function fRe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:a,width:s,height:o,horizontalPoints:l,horizontal:u=!0}=e;if(!u||!t||!t.length)return null;var d=l.map(p=>Math.round(p+a-a)).sort((p,g)=>p-g);a!==d[0]&&d.unshift(0);var h=d.map((p,g)=>{var x=!d[g+1],y=x?a+o-p:d[g+1]-p;if(y<=0)return null;var w=g%t.length;return v.createElement("rect",{key:"react-".concat(g),y:p,x:r,height:y,width:s,stroke:"none",fill:t[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function hRe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:a,y:s,width:o,height:l,verticalPoints:u}=e;if(!t||!n||!n.length)return null;var d=u.map(p=>Math.round(p+a-a)).sort((p,g)=>p-g);a!==d[0]&&d.unshift(0);var h=d.map((p,g)=>{var x=!d[g+1],y=x?a+o-p:d[g+1]-p;if(y<=0)return null;var w=g%n.length;return v.createElement("rect",{key:"react-".concat(g),x:p,y:s,width:y,height:l,stroke:"none",fill:n[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var pRe=(e,t)=>{var{xAxis:n,width:r,height:a,offset:s}=e;return wY(TP(Hr(Hr(Hr({},pc.defaultProps),n),{}
547,{ticks:jY(n),viewBox:{x:0,y:0,width:r,height:a}})),s.left,s.left+s.width,t)},mRe=(e,t)=>{var{yAxis:n,width:r,height:a,offset:s}=e;return wY(TP(Hr(Hr(Hr({},pc.defaultProps),n),{},{ticks:jY(n),viewBox:{x:0,y:0,width:r,height:a}})),s.top,s.top+s.height,t)},gRe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0};function Dw(e){var t=EY(),n=OY(),r=CY(),a=Hr(Hr({},as(e,gRe)),{},{x:Pe(e.x)?e.x:r.left,y:Pe(e.y)?e.y:r.top,width:Pe(e.width)?e.width:r.width,height:Pe(e.height)?e.height:r.height}),{xAxisId:s,yAxisId:o,x:l,y:u,width:d,height:h,syncWithTicks:p,horizontalValues:g,verticalValues:x}=a,y=Rr(),w=Be(D=>C9(D,"xAxis",s,y)),j=Be(D=>C9(D,"yAxis",o,y));if(!Pe(d)||d<=0||!Pe(h)||h<=0||!Pe(l)||l!==+l||!Pe(u)||u!==+u)return null;var N=a.verticalCoordinatesGenerator||pRe,k=a.horizontalCoordinatesGenerator||mRe,{horizontalPoints:S,verticalPoints:E}=a;if((!S||!S.length)&&typeof k=="function"){var O=g&&g.length,T=k({yAxis:j?Hr(Hr({},j),{},{ticks:O?g:j.ticks}):void 0,width:t,height:n,offset:r},O?!0:p);Om(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(S=T)}if((!E||!E.length)&&typeof N=="function"){var P=x&&x.length,M=N({xAxis:w?Hr(Hr({},w),{},{ticks:P?x:w.ticks}):void 0,width:t,height:n,offset:r},P?!0:p);Om(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(E=M)}return v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(cRe,{fill:a.fill,fillOpacity:a.fillOpacity,x:a.x,y:a.y,width:a.width,height:a.height,ry:a.ry}),v.createElement(fRe,au({},a,{horizontalPoints:S})),v.createElement(hRe,au({},a,{verticalPoints:E})),v.createElement(uRe,au({},a,{offset:r,horizontalPoints:S,xAxis:w,yAxis:j})),v.createElement(dRe,au({},a,{offset:r,verticalPoints:E,xAxis:w,yAxis:j})))}Dw.displayName="CartesianGrid";var wZ=(e,t,n,r)=>Ps(e,"xAxis",t,r),jZ=(e,t,n,r)=>$i(e,"xAxis",t,r),NZ=(e,t,n,r)=>Ps(e,"yAxis",n,r),_Z=(e,t,n,r)=>$i(e,"yAxis",n,r),xRe=ie([ht,wZ,NZ,jZ,_Z],(e,t,n,r,a)=>Ui(e,"xAxis")?Du(t,r,!1):Du(n,a,!1)),bRe=(e,t,n,r,a)=>a,yRe=ie([Xg,bRe],(e,t)=>{if(e.some(n=>n.type==="line"&&t.dataKey===n.dataKey&&t.data===n.data))return t}),vRe=ie([ht,wZ,NZ,jZ,_Z,yRe,xRe,mw],(e,t,n,r,a,s,o,l)=>{var{chartData:u,dataStartIndex:d,dataEndIndex:h}=l;if(!(s==null||t==null||n==null||r==null||a==null||r.length===0||a.length===0||o==null)){var{dataKey:p,data:g}=s,x;if(g!=null&&g.length>0?x=g:x=u?.slice(d,h+1),x!=null)return FRe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:a,dataKey:p,bandSize:o,displayedData:x})}}),wRe=["type","layout","connectNulls","needClip"],jRe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId"];function kZ(e,t){if(e==null)return{};var n,r,a=NRe(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)&&(a[n]=e[n])}return a}function NRe(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}function M7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Vs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M7(Object(n),!0).forEach(function(r){$w(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $w(e,t,n){return(t=_Re(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Re(e){var t=kRe(e,"string");return typeof t=="symbol"?t:t+""}function kRe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function th(){return th=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},th.apply(null,arguments)}var SRe=e=>{var{dataKey:t,name:n,stroke:r,legendType:a,hide:s}=e;return[{inactive:s,dataKey:t,type:a,color:r,value:cc(n,t),payload:e}]};function CRe(e){var{dataKey:t,data:n,stroke:r,strokeWidth:a,fill:s,name:o,hide:l,unit:u}=e;return{dataDefinedOnItem:n,positions:void 0,settings:{stroke:r,strokeWidth:a,fill:s,dataKey:t,nameKey:void 0,name:cc(o,t),hide:l,type:e.tooltipType,color:e.stroke,unit:u}}}var SZ=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function ERe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],a=0;a<t;
547++a)r=[...r,...n];return r}var ORe=(e,t,n)=>{var r=n.reduce((p,g)=>p+g);if(!r)return SZ(t,e);for(var a=Math.floor(e/r),s=e%r,o=t-e,l=[],u=0,d=0;u<n.length;d+=n[u],++u)if(d+n[u]>s){l=[...n.slice(0,u),s-d];break}var h=l.length%2===0?[0,o]:[o];return[...ERe(n,a),...l,...h].map(p=>"".concat(p,"px")).join(", ")};function ARe(e,t){var n;if(v.isValidElement(e))n=v.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{var r=Xe("recharts-line-dot",typeof e!="boolean"?e.className:"");n=v.createElement(Cw,th({},t,{className:r}))}return n}function TRe(e,t){return e==null?!1:t?!0:e.length===1}function PRe(e){var{clipPathId:t,points:n,props:r}=e,{dot:a,dataKey:s,needClip:o}=r;if(!TRe(n,a))return null;var l=Y1(a),u=rt(r,!1),d=rt(a,!0),h=n.map((g,x)=>{var y=Vs(Vs(Vs({key:"dot-".concat(x),r:3},u),d),{},{index:x,cx:g.x,cy:g.y,dataKey:s,value:g.value,payload:g.payload,points:n});return ARe(a,y)}),p={clipPath:o?"url(#clipPath-".concat(l?"":"dots-").concat(t,")"):null};return v.createElement(pn,th({className:"recharts-line-dots",key:"dots"},p),h)}function lE(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:a,props:s,showLabels:o}=e,{type:l,layout:u,connectNulls:d,needClip:h}=s,p=kZ(s,wRe),g=Vs(Vs({},rt(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:h?"url(#clipPath-".concat(t,")"):null,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:a??s.strokeDasharray});return v.createElement(v.Fragment,null,r?.length>1&&v.createElement(Ef,th({},g,{pathRef:n})),v.createElement(PRe,{points:r,clipPathId:t,props:s}),o&&Ti.renderCallByParent(s,r))}function RRe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function MRe(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:a,longestAnimatedLengthRef:s}=e,{points:o,strokeDasharray:l,isAnimationActive:u,animationBegin:d,animationDuration:h,animationEasing:p,animateNewValues:g,width:x,height:y,onAnimationEnd:w,onAnimationStart:j}=n,N=a.current,k=Ow(n,"recharts-line-"),[S,E]=v.useState(!1),O=v.useCallback(()=>{typeof w=="function"&&w(),E(!1)},[w]),T=v.useCallback(()=>{typeof j=="function"&&j(),E(!0)},[j]),P=RRe(r.current),M=s.current;return v.createElement(Do,{begin:d,duration:h,isActive:u,easing:p,from:{t:0},to:{t:1},onAnimationEnd:O,onAnimationStart:T,key:k},D=>{var{t:A}=D,L=Ka(M,P+M),F=Math.min(L(A),P),B;if(l){var U="".concat(l).split(/[,\s]+/gim).map(K=>parseFloat(K));B=ORe(F,P,U)}else B=SZ(P,F);if(N){var z=N.length/o.length,$=A===1?o:o.map((K,G)=>{var W=Math.floor(G*z);if(N[W]){var I=N[W],H=Ka(I.x,K.x),V=Ka(I.y,K.y);return Vs(Vs({},K),{},{x:H(A),y:V(A)})}if(g){var X=Ka(x*2,K.x),te=Ka(y/2,K.y);return Vs(Vs({},K),{},{x:X(A),y:te(A)})}return Vs(Vs({},K),{},{x:K.x,y:K.y})});return a.current=$,v.createElement(lE,{props:n,points:$,clipPathId:t,pathRef:r,showLabels:!S,strokeDasharray:B})}return A>0&&P>0&&(a.current=o,s.current=F),v.createElement(lE,{props:n,points:o,clipPathId:t,pathRef:r,showLabels:!S,strokeDasharray:B})})}function DRe(e){var{clipPathId:t,props:n}=e,{points:r,isAnimationActive:a}=n,s=v.useRef(null),o=v.useRef(0),l=v.useRef(null),u=s.current;return a&&r&&r.length&&u!==r?v.createElement(MRe,{props:n,clipPathId:t,previousPointsRef:s,longestAnimatedLengthRef:o,pathRef:l}):v.createElement(lE,{props:n,points:r,clipPathId:t,pathRef:l,showLabels:!0})}var $Re=(e,t)=>({x:e.x,y:e.y,value:e.value,errorVal:Bt(e.payload,t)});class IRe extends v.Component{constructor(){super(...arguments),$w(this,"id",Jl("recharts-line-"))}render(){var t,{hide:n,dot:r,points:a,className:s,xAxisId:o,yAxisId:l,top:u,left:d,width:h,height:p,id:g,needClip:x,layout:y}=this.props;if(n)return null;var w=Xe("recharts-line",s),j=Ct(g)?this.id:g,{r:N=3,strokeWidth:k=2}=(t=rt(r,!1))!==null&&t!==void 0?t:{r:3,strokeWidth:2},S=Y1(r),E=N*2+k;return v.createElement(v.Fragment,null,v.createElement(pn,{className:w},x&&v.createElement("defs",null,v.createElement(CP,{clipPathId:j,xAxisId:o,yAxisId:l}),!S&&v.createElement("clipPath",{id:"clipPath-dots-".concat(j)},v.createElement("rect",{x:d-E/2,y:u-E/2,width:h+E,height:p+E}))),v.createElement(DRe,{props:this.props,clipPathId:j}),v.createElement(iZ,{direction:y==="horizontal"?"y":"x"},v.createElement(rZ,{xAxisId:o,yAxisId:l,data:a,dataPointFormatter:$Re,errorBarOffset:0},this.props.children))),v.createElement(aE,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey}))}}var CZ={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:!uc.isSsr,label:!1,legendT
547ype:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0};function LRe(e){var t=as(e,CZ),{activeDot:n,animateNewValues:r,animationBegin:a,animationDuration:s,animationEasing:o,connectNulls:l,dot:u,hide:d,isAnimationActive:h,label:p,legendType:g,xAxisId:x,yAxisId:y}=t,w=kZ(t,jRe),{needClip:j}=Pw(x,y),{height:N,width:k,x:S,y:E}=Tw(),O=Ug(),T=Rr(),P=v.useMemo(()=>({dataKey:e.dataKey,data:e.data}),[e.dataKey,e.data]),M=Be(D=>vRe(D,x,y,T,P));return O!=="horizontal"&&O!=="vertical"?null:v.createElement(IRe,th({},w,{connectNulls:l,dot:u,activeDot:n,animateNewValues:r,animationBegin:a,animationDuration:s,animationEasing:o,isAnimationActive:h,hide:d,label:p,legendType:g,xAxisId:x,yAxisId:y,points:M,layout:O,height:N,width:k,left:S,top:E,needClip:j}))}function FRe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:a,yAxisTicks:s,dataKey:o,bandSize:l,displayedData:u}=e;return u.map((d,h)=>{var p=Bt(d,o);return t==="horizontal"?{x:mv({axis:n,ticks:a,bandSize:l,entry:d,index:h}),y:Ct(p)?null:r.scale(p),value:p,payload:d}:{x:Ct(p)?null:n.scale(p),y:mv({axis:r,ticks:s,bandSize:l,entry:d,index:h}),value:p,payload:d}})}class RP extends v.PureComponent{render(){return v.createElement(SP,{type:"line",data:this.props.data,xAxisId:this.props.xAxisId,yAxisId:this.props.yAxisId,zAxisId:0,dataKey:this.props.dataKey,stackId:void 0,hide:this.props.hide,barSize:void 0},v.createElement(_P,{legendPayload:SRe(this.props)}),v.createElement(Ew,{fn:CRe,args:this.props}),v.createElement(LRe,this.props))}}$w(RP,"displayName","Line");$w(RP,"defaultProps",CZ);var EZ=(e,t,n,r)=>Ps(e,"xAxis",t,r),OZ=(e,t,n,r)=>$i(e,"xAxis",t,r),AZ=(e,t,n,r)=>Ps(e,"yAxis",n,r),TZ=(e,t,n,r)=>$i(e,"yAxis",n,r),zRe=ie([ht,EZ,AZ,OZ,TZ],(e,t,n,r,a)=>Ui(e,"xAxis")?Du(t,r,!1):Du(n,a,!1)),BRe=(e,t,n,r,a)=>{var s,o=ht(e),l=Ui(o,"xAxis"),u;if(l?u=og(e,"yAxis",n,r):u=og(e,"xAxis",t,r),u!=null){var{dataKey:d,stackId:h}=a;if(h!=null){var p=(s=u[h])===null||s===void 0?void 0:s.stackedData;return p?.find(g=>g.key===d)}}},URe=(e,t,n,r,a)=>a,qRe=ie([Xg,URe],(e,t)=>{if(e.some(n=>n.type==="area"&&t.dataKey===n.dataKey&&sT(t.stackId)===n.stackId&&t.data===n.data))return t}),HRe=ie([ht,EZ,AZ,OZ,TZ,BRe,mw,zRe,qRe],(e,t,n,r,a,s,o,l,u)=>{var{chartData:d,dataStartIndex:h,dataEndIndex:p}=o;if(!(u==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||a==null||r.length===0||a.length===0||l==null)){var{data:g}=u,x;if(g&&g.length>0?x=g:x=d?.slice(h,p+1),x!=null){var y=void 0;return c4e({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:a,dataStartIndex:h,areaSettings:u,stackedData:s,displayedData:x,chartBaseValue:y,bandSize:l})}}}),KRe=["layout","type","stroke","connectNulls","isRange"],VRe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function PZ(e,t){if(e==null)return{};var n,r,a=GRe(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)&&(a[n]=e[n])}return a}function GRe(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}function D7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function su(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D7(Object(n),!0).forEach(function(r){Iw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iw(e,t,n){return(t=WRe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WRe(e){var t=YRe(e,"string");return typeof t=="symbol"?t:t+""}function YRe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gl.apply(null,arguments)}function $v(e,t){return e&&e!=="none"?e:t}var XRe=e=>
547{var{dataKey:t,name:n,stroke:r,fill:a,legendType:s,hide:o}=e;return[{inactive:o,dataKey:t,type:s,color:$v(r,a),value:cc(n,t),payload:e}]};function QRe(e){var{dataKey:t,data:n,stroke:r,strokeWidth:a,fill:s,name:o,hide:l,unit:u}=e;return{dataDefinedOnItem:n,positions:void 0,settings:{stroke:r,strokeWidth:a,fill:s,dataKey:t,nameKey:void 0,name:cc(o,t),hide:l,type:e.tooltipType,color:$v(r,s),unit:u}}}var ZRe=(e,t)=>{var n;if(v.isValidElement(e))n=v.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{var r=Xe("recharts-area-dot",typeof e!="boolean"?e.className:"");n=v.createElement(Cw,Gl({},t,{className:r}))}return n};function JRe(e,t){return e==null?!1:t?!0:e.length===1}function e4e(e){var{clipPathId:t,points:n,props:r}=e,{needClip:a,dot:s,dataKey:o}=r;if(!JRe(n,s))return null;var l=Y1(s),u=rt(r,!1),d=rt(s,!0),h=n.map((g,x)=>{var y=su(su(su({key:"dot-".concat(x),r:3},u),d),{},{index:x,cx:g.x,cy:g.y,dataKey:o,value:g.value,payload:g.payload,points:n});return ZRe(s,y)}),p={clipPath:a?"url(#clipPath-".concat(l?"":"dots-").concat(t,")"):void 0};return v.createElement(pn,Gl({className:"recharts-area-dots"},p),h)}function cE(e){var{points:t,baseLine:n,needClip:r,clipPathId:a,props:s,showLabels:o}=e,{layout:l,type:u,stroke:d,connectNulls:h,isRange:p}=s,g=PZ(s,KRe);return v.createElement(v.Fragment,null,t?.length>1&&v.createElement(pn,{clipPath:r?"url(#clipPath-".concat(a,")"):void 0},v.createElement(Ef,Gl({},rt(g,!0),{points:t,connectNulls:h,type:u,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Ef,Gl({},rt(s,!1),{className:"recharts-area-curve",layout:l,type:u,connectNulls:h,fill:"none",points:t})),d!=="none"&&p&&v.createElement(Ef,Gl({},rt(s,!1),{className:"recharts-area-curve",layout:l,type:u,connectNulls:h,fill:"none",points:n}))),v.createElement(e4e,{points:t,props:s,clipPathId:a}),o&&Ti.renderCallByParent(s,t))}function t4e(e){var{alpha:t,baseLine:n,points:r,strokeWidth:a}=e,s=r[0].y,o=r[r.length-1].y;if(!Pr(s)||!Pr(o))return null;var l=t*Math.abs(s-o),u=Math.max(...r.map(d=>d.x||0));return Pe(n)?u=Math.max(n,u):n&&Array.isArray(n)&&n.length&&(u=Math.max(...n.map(d=>d.x||0),u)),Pe(u)?v.createElement("rect",{x:0,y:s<o?s:s-l,width:u+(a?parseInt("".concat(a),10):1),height:Math.floor(l)}):null}function n4e(e){var{alpha:t,baseLine:n,points:r,strokeWidth:a}=e,s=r[0].x,o=r[r.length-1].x;if(!Pr(s)||!Pr(o))return null;var l=t*Math.abs(s-o),u=Math.max(...r.map(d=>d.y||0));return Pe(n)?u=Math.max(n,u):n&&Array.isArray(n)&&n.length&&(u=Math.max(...n.map(d=>d.y||0),u)),Pe(u)?v.createElement("rect",{x:s<o?s:s-l,y:0,width:l,height:Math.floor(u+(a?parseInt("".concat(a),10):1))}):null}function r4e(e){var{alpha:t,layout:n,points:r,baseLine:a,strokeWidth:s}=e;return n==="vertical"?v.createElement(t4e,{alpha:t,points:r,baseLine:a,strokeWidth:s}):v.createElement(n4e,{alpha:t,points:r,baseLine:a,strokeWidth:s})}function a4e(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:a,previousBaselineRef:s}=e,{points:o,baseLine:l,isAnimationActive:u,animationBegin:d,animationDuration:h,animationEasing:p,onAnimationStart:g,onAnimationEnd:x}=r,y=Ow(r,"recharts-area-"),[w,j]=v.useState(!0),N=v.useCallback(()=>{typeof x=="function"&&x(),j(!1)},[x]),k=v.useCallback(()=>{typeof g=="function"&&g(),j(!0)},[g]),S=a.current,E=s.current;return v.createElement(Do,{begin:d,duration:h,isActive:u,easing:p,from:{t:0},to:{t:1},onAnimationEnd:N,onAnimationStart:k,key:y},O=>{var{t:T}=O;if(S){var P=S.length/o.length,M=T===1?o:o.map((A,L)=>{var F=Math.floor(L*P);if(S[F]){var B=S[F];return su(su({},A),{},{x:Wd(B.x,A.x,T),y:Wd(B.y,A.y,T)})}return A}),D;return Pe(l)?D=Wd(E,l,T):Ct(l)||Na(l)?D=Wd(E,0,T):D=l.map((A,L)=>{var F=Math.floor(L*P);if(Array.isArray(E)&&E[F]){var B=E[F];return su(su({},A),{},{x:Wd(B.x,A.x,T),y:Wd(B.y,A.y,T)})}return A}),T>0&&(a.current=M,s.current=D),v.createElement(cE,{points:M,baseLine:D,needClip:t,clipPathId:n,props:r,showLabels:!w})}return T>0&&(a.current=o,s.current=l),v.createElement(pn,null,v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(n)}
547,v.createElement(r4e,{alpha:T,points:o,baseLine:l,layout:r.layout,strokeWidth:r.strokeWidth}))),v.createElement(pn,{clipPath:"url(#animationClipPath-".concat(n,")")},v.createElement(cE,{points:o,baseLine:l,needClip:t,clipPathId:n,props:r,showLabels:!0})))})}function s4e(e){var{needClip:t,clipPathId:n,props:r}=e,{points:a,baseLine:s,isAnimationActive:o}=r,l=v.useRef(null),u=v.useRef(),d=l.current,h=u.current;return o&&a&&a.length&&(d!==a||h!==s)?v.createElement(a4e,{needClip:t,clipPathId:n,props:r,previousPointsRef:l,previousBaselineRef:u}):v.createElement(cE,{points:a,baseLine:s,needClip:t,clipPathId:n,props:r,showLabels:!0})}class i4e extends v.PureComponent{constructor(){super(...arguments),Iw(this,"id",Jl("recharts-area-"))}render(){var t,{hide:n,dot:r,points:a,className:s,top:o,left:l,needClip:u,xAxisId:d,yAxisId:h,width:p,height:g,id:x,baseLine:y}=this.props;if(n)return null;var w=Xe("recharts-area",s),j=Ct(x)?this.id:x,{r:N=3,strokeWidth:k=2}=(t=rt(r,!1))!==null&&t!==void 0?t:{r:3,strokeWidth:2},S=Y1(r),E=N*2+k;return v.createElement(v.Fragment,null,v.createElement(pn,{className:w},u&&v.createElement("defs",null,v.createElement(CP,{clipPathId:j,xAxisId:d,yAxisId:h}),!S&&v.createElement("clipPath",{id:"clipPath-dots-".concat(j)},v.createElement("rect",{x:l-E/2,y:o-E/2,width:p+E,height:g+E}))),v.createElement(s4e,{needClip:u,clipPathId:j,props:this.props})),v.createElement(aE,{points:a,mainColor:$v(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot}),this.props.isRange&&Array.isArray(y)&&v.createElement(aE,{points:y,mainColor:$v(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot}))}}var RZ={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:!uc.isSsr,legendType:"line",stroke:"#3182bd",xAxisId:0,yAxisId:0};function o4e(e){var t,n=as(e,RZ),{activeDot:r,animationBegin:a,animationDuration:s,animationEasing:o,connectNulls:l,dot:u,fill:d,fillOpacity:h,hide:p,isAnimationActive:g,legendType:x,stroke:y,xAxisId:w,yAxisId:j}=n,N=PZ(n,VRe),k=Ug(),S=PQ(),{needClip:E}=Pw(w,j),O=Rr(),T=v.useMemo(()=>({baseValue:e.baseValue,stackId:e.stackId,connectNulls:l,data:e.data,dataKey:e.dataKey}),[e.baseValue,e.stackId,l,e.data,e.dataKey]),{points:P,isRange:M,baseLine:D}=(t=Be(U=>HRe(U,w,j,O,T)))!==null&&t!==void 0?t:{},{height:A,width:L,x:F,y:B}=Tw();return k!=="horizontal"&&k!=="vertical"||S!=="AreaChart"&&S!=="ComposedChart"?null:v.createElement(i4e,Gl({},N,{activeDot:r,animationBegin:a,animationDuration:s,animationEasing:o,baseLine:D,connectNulls:l,dot:u,fill:d,fillOpacity:h,height:A,hide:p,layout:k,isAnimationActive:g,isRange:M,legendT
547ype:x,needClip:E,points:P,stroke:y,width:L,left:F,top:B,xAxisId:w,yAxisId:j}))}var l4e=(e,t,n,r,a)=>{var s=n??t;if(Pe(s))return s;var o=e==="horizontal"?a:r,l=o.scale.domain();if(o.type==="number"){var u=Math.max(l[0],l[1]),d=Math.min(l[0],l[1]);return s==="dataMin"?d:s==="dataMax"||u<0?u:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]};function c4e(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:a,layout:s,chartBaseValue:o,xAxis:l,yAxis:u,displayedData:d,dataStartIndex:h,xAxisTicks:p,yAxisTicks:g,bandSize:x}=e,y=a&&a.length,w=l4e(s,o,n,l,u),j=s==="horizontal",N=!1,k=d.map((E,O)=>{var T;y?T=a[h+O]:(T=Bt(E,r),Array.isArray(T)?N=!0:T=[w,T]);var P=T[1]==null||y&&!t&&Bt(E,r)==null;return j?{x:mv({axis:l,ticks:p,bandSize:x,entry:E,index:O}),y:P?null:u.scale(T[1]),value:T,payload:E}:{x:P?null:l.scale(T[1]),y:mv({axis:u,ticks:g,bandSize:x,entry:E,index:O}),value:T,payload:E}}),S;return y||N?S=k.map(E=>{var O=Array.isArray(E.value)?E.value[0]:null;return j?{x:E.x,y:O!=null&&E.y!=null?u.scale(O):null}:{x:O!=null?l.scale(O):null,y:E.y}}):S=j?u.scale(w):l.scale(w),{points:k,baseLine:S,isRange:N}}class MP extends v.PureComponent{render(){return v.createElement(SP,{type:"area",data:this.props.data,dataKey:this.props.dataKey,xAxisId:this.props.xAxisId,yAxisId:this.props.yAxisId,zAxisId:0,stackId:this.props.stackId,hide:this.props.hide,barSize:void 0},v.createElement(_P,{legendPayload:XRe(this.props)}),v.createElement(Ew,{fn:QRe,args:this.props}),v.createElement(o4e,this.props))}}Iw(MP,"displayName","Area");Iw(MP,"defaultProps",RZ);function $7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function I7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$7(Object(n),!0).forEach(function(r){u4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u4e(e,t,n){return(t=d4e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d4e(e){var t=f4e(e,"string");return typeof t=="symbol"?t:t+""}function f4e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var h4e={xAxis:{},yAxis:{},zAxis:{}},MZ=Ds({name:"cartesianAxis",initialState:h4e,reducers:{addXAxis(e,t){e.xAxis[t.payload.id]=t.payload},removeXAxis(e,t){delete e.xAxis[t.payload.id]},addYAxis(e,t){e.yAxis[t.payload.id]=t.payload},removeYAxis(e,t){delete e.yAxis[t.payload.id]},addZAxis(e,t){e.zAxis[t.payload.id]=t.payload},removeZAxis(e,t){delete e.zAxis[t.payload.id]},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload;e.yAxis[n]&&(e.yAxis[n]=I7(I7({},e.yAxis[n]),{},{width:r}))}}}),{addXAxis:p4e,removeXAxis:m4e,addYAxis:g4e,removeYAxis:x4e,addZAxis:cUe,removeZAxis:uUe,updateYAxisWidth:b4e}=MZ.actions,y4e=MZ.reducer,v4e=["children"],w4e=["dangerouslySetInnerHTML","ticks"];function DZ(e,t,n){return(t=j4e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j4e(e){var t=N4e(e,"string");return typeof t=="symbol"?t:t+""}function N4e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uE(){return uE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uE.apply(null,arguments)}function $Z(e,t){if(e==null)return{};var n,r,a=_4e(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)&&(a[n]=e[n])}return a}function _4e(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}function k4e(e){var t=wn(),n=v.useMemo(()=>{var{children:s}=e,o=$Z(e,v4e);return o},[e]),r=Be(s=>Yo(s,n.id)),a=n===r;return v.useEffect(()=>(t(p4e(n)),()=>{t(m4e(n))}),[n,t]),a?e.children:null}var S4e=e=>{var{xAxisId:t,className:n}=e,r=Be(SY),a=Rr(),s="xAxis",o=Be(x=>ec(x,s,t,a)),l=Be(x=>dQ(x,s,t,a)),u=Be(x=>oQ(x,t)),d=Be(x=>oEe(x,t));if(u==null||d==null)return null;var{dangerouslySetInnerHTML:h,ticks:p}=e,g=$Z(e,w4e);return v.createElement(pc,uE({},g,{scale:o,x:d.x,y:d.y,width:u.width,height:u.height,className:Xe("recharts-".concat(s," ").concat(s),n),viewBox:r,ticks:l}))},C4e=e=>{var t,n,r,a,s;return v.createElement(k4e,{interval:(t=e.interval)!==null&&t!==void 0?t:"preserveEnd",id:e.xAxisId,scale:e.scale,type:e.type,padding:e.padding,allowDataOverflow:e.allowDataOverflow,domain:e.domain,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,includeHidden:(n=e.includeHidden)!==null&&n!==void 0?n:!1,reversed:e.reversed,ticks:e.ticks,height:e.height,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:(r=e.angle)!==null&&r!==void 0?r:0,minTickGap:(a=e.minTickGap)!==null&&a!==void 0?a:5,tick:(s=e.tick)!==null&&s!==void 0?s:!0,tickFormatter:e.tickFormatter},v.createElement(S4e,e))};class ex extends v.Component{render(){return v.createElement(C4e,this.props)}}
547DZ(ex,"displayName","XAxis");DZ(ex,"defaultProps",{allowDataOverflow:za.allowDataOverflow,allowDecimals:za.allowDecimals,allowDuplicatedCategory:za.allowDuplicatedCategory,height:za.height,hide:!1,mirror:za.mirror,orientation:za.orientation,padding:za.padding,reversed:za.reversed,scale:za.scale,tickCount:za.tickCount,type:za.type,xAxisId:0});var E4e=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:a=0,tickMargin:s=0}=e,o=0;if(t){t.forEach(h=>{if(h){var p=h.getBoundingClientRect();p.width>o&&(o=p.width)}});var l=n?n.getBoundingClientRect().width:0,u=a+s,d=o+u+l+(n?r:0);return Math.round(d)}return 0},O4e=["dangerouslySetInnerHTML","ticks"];function IZ(e,t,n){return(t=A4e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A4e(e){var t=T4e(e,"string");return typeof t=="symbol"?t:t+""}function T4e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dE(){return dE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dE.apply(null,arguments)}function P4e(e,t){if(e==null)return{};var n,r,a=R4e(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)&&(a[n]=e[n])}return a}function R4e(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}function M4e(e){var t=wn();return v.useEffect(()=>(t(g4e(e)),()=>{t(x4e(e))}),[e,t]),null}var D4e=e=>{var t,{yAxisId:n,className:r,width:a,label:s}=e,o=v.useRef(null),l=v.useRef(null),u=Be(SY),d=Rr(),h=wn(),p="yAxis",g=Be(S=>ec(S,p,n,d)),x=Be(S=>lQ(S,n)),y=Be(S=>lEe(S,n)),w=Be(S=>dQ(S,p,n,d));if(v.useLayoutEffect(()=>{var S;if(!(a!=="auto"||!x||gP(s)||v.isValidElement(s))){var E=o.current,O=E==null||(S=E.tickRefs)===null||S===void 0?void 0:S.current,{tickSize:T,tickMargin:P}=E.props,M=E4e({ticks:O,label:l.current,labelGapWithTick:5,tickSize:T,tickMargin:P});Math.round(x.width)!==Math.round(M)&&h(b4e({id:n,width:M}))}},[o,o==null||(t=o.current)===null||t===void 0||(t=t.tickRefs)===null||t===void 0?void 0:t.current,x?.width,x,h,s,n,a]),x==null||y==null)return null;var{dangerouslySetInnerHTML:j,ticks:N}=e,k=P4e(e,O4e);return v.createElement(pc,dE({},k,{ref:o,labelRef:l,scale:g,x:y.x,y:y.y,width:x.width,height:x.height,className:Xe("recharts-".concat(p," ").concat(p),r),viewBox:u,ticks:w}))},$4e=e=>{var t,n,r,a,s;return v.createElement(v.Fragment,null,v.createElement(M4e,{interval:(t=e.interval)!==null&&t!==void 0?t:"preserveEnd",id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:(n=e.includeHidden)!==null&&n!==void 0?n:!1,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:(r=e.angle)!==null&&r!==void 0?r:0,minTickGap:(a=e.minTickGap)!==null&&a!==void 0?a:5,tick:(s=e.tick)!==null&&s!==void 0?s:!0,tickFormatter:e.tickFormatter}),v.createElement(D4e,e))},I4e={allowDataOverflow:Ba.allowDataOverflow,allowDecimals:Ba.allowDecimals,allowDuplicatedCategory:Ba.allowDuplicatedCategory,hide:!1,mirror:Ba.mirror,orientation:Ba.orientation,padding:Ba.padding,reversed:Ba.reversed,scale:Ba.scale,tickCount:Ba.tickCount,type:Ba.type,width:Ba.width,yAxisId:0};class tx extends v.Component{render(){return v.createElement($4e,this.props)}}IZ(tx,"displayName","YAxis");IZ(tx,"defaultProps",I4e);var h5={exports:{}},p5={};/** 548 * @license React 549 * use-sync-external-store-with-selector.production.js 550 * 551 * Copyright (c) Meta Platforms, Inc. and affiliates. 552 * 553 * This source code is licensed under the MIT license found in the 554 * LICENSE file in the root directory of this source tree. 555 */var L7;function L4e(){if(L7)return p5;L7=1;var e=ti();function t(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,a=e.useRef,s=e.useEffect,o=e.useMemo,l=e.useDebugValue;return p5.useSyncExternalStoreWithSelector=function(u,d,h,p,g){var x=a(null);if(x.current===null){var y={hasValue:!1,value:null};x.current=y}else y=x.current;x=o(function(){function j(O){if(!N){if(N=!0,k=O,O=p(O),g!==void 0&&y.hasValue){var T=y.value;if(g(T,O))return S=T}return S=O}if(T=S,n(k,O))return T;var P=p(O);return g!==void 0&&g(T,P)?(k=O,T):(k=O,S=P)}var N=!1,k,S,E=h===void 0?null:h;return[function(){return j(d())},E===null?void 0:function(){return j(E())}]},[d,h,p,g]);var w=r(u,x[0],x[1]);return s(function(){y.hasValue=!0,y.value=w},[w]),l(w),w},p5}var F7;function F4e(){return F7||(F7=1,h5.exports=L4e()),h5.exports}F4e();function z4e(e){e()}
555function B4e(){let e=null,t=null;return{clear(){e=null,t=null},notify(){z4e(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const a=t={callback:n,next:null,prev:t};return a.prev?a.prev.next=a:e=a,function(){!r||e===null||(r=!1,a.next?a.next.prev=a.prev:t=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var z7={notify(){},get:()=>[]};function U4e(e,t){let n,r=z7,a=0,s=!1;function o(w){h();const j=r.subscribe(w);let N=!1;return()=>{N||(N=!0,j(),p())}}function l(){r.notify()}function u(){y.onStateChange&&y.onStateChange()}function d(){return s}function h(){a++,n||(n=e.subscribe(u),r=B4e())}function p(){a--,n&&a===0&&(n(),n=void 0,r.clear(),r=z7)}function g(){s||(s=!0,h())}function x(){s&&(s=!1,p())}const y={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:u,isSubscribed:d,trySubscribe:g,tryUnsubscribe:x,getListeners:()=>r};return y}var q4e=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",H4e=q4e(),K4e=()=>typeof navigator<"u"&&navigator.product==="ReactNative",V4e=K4e(),G4e=()=>H4e||V4e?v.useLayoutEffect:v.useEffect,W4e=G4e(),Y4e=Symbol.for("react-redux-context"),X4e=typeof globalThis<"u"?globalThis:{};function Q4e(){if(!v.createContext)return{};const e=X4e[Y4e]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var Z4e=Q4e();function J4e(e){const{children:t,context:n,serverState:r,store:a}=e,s=v.useMemo(()=>{const u=U4e(a);return{store:a,subscription:u,getServerState:r?()=>r:void 0}},[a,r]),o=v.useMemo(()=>a.getState(),[a]);W4e(()=>{const{subscription:u}=s;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),o!==a.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[s,o]);const l=n||Z4e;return v.createElement(l.Provider,{value:s},t)}var eMe=J4e,tMe=(e,t)=>t,DP=ie([tMe,ht,wCe,wr,SQ,Xo,uOe,sr],mOe),$P=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,r=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/r)}},LZ=As("mouseClick"),FZ=Bg();FZ.startListening({actionCreator:LZ,effect:(e,t)=>{var n=e.payload,r=DP(t.getState(),$P(n));r?.activeIndex!=null&&t.dispatch(wEe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var fE=As("mouseMove"),zZ=Bg();zZ.startListening({actionCreator:fE,effect:(e,t)=>{var n=e.payload,r=t.getState(),a=sP(r,r.tooltip.settings.shared),s=DP(r,$P(n));a==="axis"&&(s?.activeIndex!=null?t.dispatch(yQ({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate})):t.dispatch(bQ()))}});function nMe(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":t}var B7={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},BZ=Ds({name:"rootProps",initialState:B7,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:B7.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),rMe=BZ.reducer,{updateOptions:aMe}=BZ.actions,UZ=Ds({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:sMe}=UZ.actions,iMe=UZ.reducer,qZ=As("keyDown"),HZ=As("focus"),IP=Bg();IP.startListening({actionCreator:qZ,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:a}=n.tooltip,s=e.payload;if(!(s!=="ArrowRight"&&s!=="ArrowLeft"&&s!=="Enter")){var o=Number(iP(a,Ju(n))),l=Xo(n);if(s==="Enter"){var u=Av(n,"axis","hover",String(a.index));t.dispatch(ZC({active:!a.active,activeIndex:a.index,activeDataKey:a.dataKey,activeCoordinate:u}));return}var d=fEe(n),h=d==="left-to-right"?1:-1,p=s==="ArrowRight"?1:-1,g=o+p*h;if(!(l==null||g>=l.length||g<0)){var x=Av(n,"axis","hover",String(g));t.dispatch(ZC({active:!0,activeIndex:g.toString(),activeDataKey:void 0,activeCoordinate:x}))}}}}});IP.startListening({actionCreator:HZ,effect:(e,t)=>
555{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:a}=n.tooltip;if(!a.active&&a.index==null){var s="0",o=Av(n,"axis","hover",String(s));t.dispatch(ZC({activeDataKey:void 0,active:!0,activeIndex:s,activeCoordinate:o}))}}}});var gs=As("externalEvent"),KZ=Bg();KZ.startListening({actionCreator:gs,effect:(e,t)=>{if(e.payload.handler!=null){var n=t.getState(),r={activeCoordinate:tOe(n),activeDataKey:AQ(n),activeIndex:tc(n),activeLabel:OQ(n),activeTooltipIndex:tc(n),isTooltipActive:nOe(n)};e.payload.handler(r,e.payload.reactEvent)}}});var oMe=ie([Eh],e=>e.tooltipItemPayloads),lMe=ie([oMe,Jg,(e,t,n)=>t,(e,t,n)=>n],(e,t,n,r)=>{var a=e.find(l=>l.settings.dataKey===r);if(a!=null){var{positions:s}=a;if(s!=null){var o=t(s,n);return o}}}),VZ=As("touchMove"),GZ=Bg();GZ.startListening({actionCreator:VZ,effect:(e,t)=>{var n=e.payload,r=t.getState(),a=sP(r,r.tooltip.settings.shared);if(a==="axis"){var s=DP(r,$P({clientX:n.touches[0].clientX,clientY:n.touches[0].clientY,currentTarget:n.currentTarget}));s?.activeIndex!=null&&t.dispatch(yQ({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate}))}else if(a==="item"){var o,l=n.touches[0],u=document.elementFromPoint(l.clientX,l.clientY);if(!u||!u.getAttribute)return;var d=u.getAttribute(_Y),h=(o=u.getAttribute(kY))!==null&&o!==void 0?o:void 0,p=lMe(t.getState(),d,h);t.dispatch(xQ({activeDataKey:h,activeIndex:d,activeCoordinate:p}))}}});var cMe=QW({brush:j3e,cartesianAxis:y4e,chartData:TOe,graphicalItems:hTe,layout:__e,legend:oke,options:SOe,polarAxis:QAe,polarOptions:iMe,referenceElements:T3e,rootProps:rMe,tooltip:jEe}),uMe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return YNe({reducer:cMe,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([FZ.middleware,zZ.middleware,IP.middleware,KZ.middleware,GZ.middleware]),devTools:{serialize:{replacer:nMe},name:"recharts-".concat(n)}})};function WZ(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,a=Rr(),s=v.useRef(null);if(a)return n;s.current==null&&(s.current=uMe(t,r));var o=JA;return v.createElement(eMe,{context:o,store:s.current},n)}function YZ(e){var{layout:t,width:n,height:r,margin:a}=e,s=wn(),o=Rr();return v.useEffect(()=>{o||(s(w_e(t)),s(j_e({width:n,height:r})),s(v_e(a)))},[s,o,t,n,r,a]),null}function XZ(e){var t=wn();return v.useEffect(()=>{t(aMe(e))},[t,e]),null}var dMe=["children"];function fMe(e,t){if(e==null)return{};var n,r,a=hMe(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)&&(a[n]=e[n])}return a}function hMe(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}function Iv(){return Iv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iv.apply(null,arguments)}var pMe={width:"100%",height:"100%"},mMe=v.forwardRef((e,t)=>{var n=EY(),r=OY(),a=RY();if(!Xf(n)||!Xf(r))return null;var{children:s,otherAttributes:o,title:l,desc:u}=e,d,h;return typeof o.tabIndex=="number"?d=o.tabIndex:d=a?0:void 0,typeof o.role=="string"?h=o.role:h=a?"application":void 0,v.createElement(wW,Iv({},o,{title:l,desc:u,role:h,tabIndex:d,width:n,height:r,style:pMe,ref:t}),s)}),gMe=e=>{var{children:t}=e,n=Be(lw);if(!n)return null;var{width:r,height:a,y:s,x:o}=n;return v.createElement(wW,{width:r,height:a,x:o,y:s},t)},U7=v.forwardRef((e,t)=>{var{children:n}=e,r=fMe(e,dMe),a=Rr();return a?v.createElement(gMe,null,n):v.createElement(mMe,Iv({ref:t},r),n)});function xMe(){var e=wn(),[t,n]=v.useState(null),r=Be(Z_e);return v.useEffect(()=>{if(t!=null){var a=t.getBoundingClientRect(),s=a.width/t.offsetWidth;Pr(s)&&s!==r&&e(N_e(s))}},[t,e,r]),n}function q7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bMe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
555t%2?q7(Object(n),!0).forEach(function(r){yMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q7(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yMe(e,t,n){return(t=vMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vMe(e){var t=wMe(e,"string");return typeof t=="symbol"?t:t+""}function wMe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jMe=v.forwardRef((e,t)=>{var{children:n,className:r,height:a,onClick:s,onContextMenu:o,onDoubleClick:l,onMouseDown:u,onMouseEnter:d,onMouseLeave:h,onMouseMove:p,onMouseUp:g,onTouchEnd:x,onTouchMove:y,onTouchStart:w,style:j,width:N}=e,k=wn(),[S,E]=v.useState(null),[O,T]=v.useState(null);MOe();var P=xMe(),M=v.useCallback(V=>{P(V),typeof t=="function"&&t(V),E(V),T(V)},[P,t,E,T]),D=v.useCallback(V=>{k(LZ(V)),k(gs({handler:s,reactEvent:V}))},[k,s]),A=v.useCallback(V=>{k(fE(V)),k(gs({handler:d,reactEvent:V}))},[k,d]),L=v.useCallback(V=>{k(bQ()),k(gs({handler:h,reactEvent:V}))},[k,h]),F=v.useCallback(V=>{k(fE(V)),k(gs({handler:p,reactEvent:V}))},[k,p]),B=v.useCallback(()=>{k(HZ())},[k]),U=v.useCallback(V=>{k(qZ(V.key))},[k]),z=v.useCallback(V=>{k(gs({handler:o,reactEvent:V}))},[k,o]),$=v.useCallback(V=>{k(gs({handler:l,reactEvent:V}))},[k,l]),K=v.useCallback(V=>{k(gs({handler:u,reactEvent:V}))},[k,u]),G=v.useCallback(V=>{k(gs({handler:g,reactEvent:V}))},[k,g]),W=v.useCallback(V=>{k(gs({handler:w,reactEvent:V}))},[k,w]),I=v.useCallback(V=>{k(VZ(V)),k(gs({handler:y,reactEvent:V}))},[k,y]),H=v.useCallback(V=>{k(gs({handler:x,reactEvent:V}))},[k,x]);return v.createElement(IQ.Provider,{value:S},v.createElement(Kwe.Provider,{value:O},v.createElement("div",{className:Xe("recharts-wrapper",r),style:bMe({position:"relative",cursor:"default",width:N,height:a},j),onClick:D,onContextMenu:z,onDoubleClick:$,onFocus:B,onKeyDown:U,onMouseDown:K,onMouseEnter:A,onMouseLeave:L,onMouseMove:F,onMouseUp:G,onTouchEnd:H,onTouchMove:I,onTouchStart:W,ref:M},n)))}),NMe=["children","className","width","height","style","compact","title","desc"];function _Me(e,t){if(e==null)return{};var n,r,a=kMe(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)&&(a[n]=e[n])}return a}function kMe(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 QZ=v.forwardRef((e,t)=>{var{children:n,className:r,width:a,height:s,style:o,compact:l,title:u,desc:d}=e,h=_Me(e,NMe),p=rt(h,!1);return l?v.createElement(U7,{otherAttributes:p,title:u,desc:d},n):v.createElement(jMe,{className:r,style:o,width:a,height:s,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(U7,{otherAttributes:p,title:u,desc:d,ref:t},v.createElement(P3e,null,n)))}),SMe=["width","height"];function hE(){return hE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hE.apply(null,arguments)}function CMe(e,t){if(e==null)return{};var n,r,a=EMe(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)&&(a[n]=e[n])}return a}function EMe(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 OMe={top:5,right:5,bottom:5,left:5},AMe={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:OMe,reverseStackOrder:!1,syncMethod:"index"},ZZ=v.forwardRef(function(t,n){var r,a=as(t.categoricalChartProps,AMe),{width:s,height:o}=a,l=CMe(a,SMe);
555if(!Xf(s)||!Xf(o))return null;var{chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:h,tooltipPayloadSearcher:p,categoricalChartProps:g}=t,x={chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:h,tooltipPayloadSearcher:p,eventEmitter:void 0};return v.createElement(WZ,{preloadedState:{options:x},reduxStoreName:(r=g.id)!==null&&r!==void 0?r:u},v.createElement(pZ,{chartData:g.data}),v.createElement(YZ,{width:s,height:o,layout:a.layout,margin:a.margin}),v.createElement(XZ,{accessibilityLayer:a.accessibilityLayer,barCategoryGap:a.barCategoryGap,maxBarSize:a.maxBarSize,stackOffset:a.stackOffset,barGap:a.barGap,barSize:a.barSize,syncId:a.syncId,syncMethod:a.syncMethod,className:a.className}),v.createElement(QZ,hE({},l,{width:s,height:o,ref:n})))}),TMe=["axis","item"],JZ=v.forwardRef((e,t)=>v.createElement(ZZ,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:TMe,tooltipPayloadSearcher:pP,categoricalChartProps:e,ref:t}));function PMe(e){var t=wn();return v.useEffect(()=>{t(sMe(e))},[t,e]),null}var RMe=["width","height","layout"];function pE(){return pE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pE.apply(null,arguments)}function MMe(e,t){if(e==null)return{};var n,r,a=DMe(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)&&(a[n]=e[n])}return a}function DMe(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 $Me={top:5,right:5,bottom:5,left:5},IMe={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:$Me,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},LMe=v.forwardRef(function(t,n){var r,a=as(t.categoricalChartProps,IMe),{width:s,height:o,layout:l}=a,u=MMe(a,RMe);if(!Xf(s)||!Xf(o))return null;var{chartName:d,defaultTooltipEventType:h,validateTooltipEventTypes:p,tooltipPayloadSearcher:g}=t,x={chartName:d,defaultTooltipEventType:h,validateTooltipEventTypes:p,tooltipPayloadSearcher:g,eventEmitter:void 0};return v.createElement(WZ,{preloadedState:{options:x},reduxStoreName:(r=a.id)!==null&&r!==void 0?r:d},v.createElement(pZ,{chartData:a.data}),v.createElement(YZ,{width:s,height:o,layout:l,margin:a.margin}),v.createElement(XZ,{accessibilityLayer:a.accessibilityLayer,barCategoryGap:a.barCategoryGap,maxBarSize:a.maxBarSize,stackOffset:a.stackOffset,barGap:a.barGap,barSize:a.barSize,syncId:a.syncId,syncMethod:a.syncMethod,className:a.className}),v.createElement(PMe,{cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius}),v.createElement(QZ,pE({width:s,height:o},u,{ref:n})))}),FMe=["item"],zMe={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},BMe=v.forwardRef((e,t)=>{var n=as(e,zMe);return v.createElement(LMe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:FMe,tooltipPayloadSearcher:pP,categoricalChartProps:n,ref:t})}),UMe=["axis"],qMe=v.forwardRef((e,t)=>
555v.createElement(ZZ,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:UMe,tooltipPayloadSearcher:pP,categoricalChartProps:e,ref:t}));const H7=e=>{const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?e:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})},HMe=({currentLabel:e,previousLabel:t})=>i.jsxs("div",{className:"flex gap-4 flex-wrap mt-2.5 text-[11.5px] text-slate-600",children:[i.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[i.jsx("i",{className:"w-3.5 h-[3px] rounded-sm",style:{background:du}}),"This period · ",e]}),t&&i.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[i.jsx("i",{className:"w-3.5 h-[3px] rounded-sm",style:{background:eA}}),"Previous period · ",t]})]}),KMe=({active:e,payload:t,currency:n})=>{const r=e?t?.[0]?.payload:void 0;return r?i.jsxs("div",{className:"rounded-lg bg-slate-900 px-3 py-2.5 text-white shadow-lg",children:[i.jsxs("p",{className:"text-[11px] text-slate-300",children:[r.weekday,", ",Ue(r.date)]}),i.jsxs("p",{className:"flex items-center gap-2 mt-1.5 text-[11px]",children:[i.jsx("i",{className:"w-2 h-2 rounded-full",style:{background:du}}),"This period",i.jsx("b",{className:"ml-auto tabular-nums",children:ge(r.current,n)})]}),r.previous!==null&&i.jsxs("p",{className:"flex items-center gap-2 mt-1 text-[11px]",children:[i.jsx("i",{className:"w-2 h-2 rounded-full",style:{background:eA}}),"Previous",i.jsx("b",{className:"ml-auto tabular-nums",children:ge(r.previous,n)})]})]}):null};function VMe({days:e,currency:t,busiestDate:n,height:r=210,currentLabel:a,previousLabel:s}){const o=n?e.findIndex(p=>p.date===n):-1,l=o>=0?e[o]:void 0,u=e.some(p=>p.previous!==null),d=e.length>1?o/(e.length-1):.5,h=d>=.12&&d<=.88;return i.jsxs("div",{children:[i.jsx(kw,{className:"ph-no-capture",width:"100%",height:r,children:i.jsxs(qMe,{data:e,margin:{top:18,right:10,bottom:0,left:0},children:[i.jsx(Dw,{stroke:Bf,strokeWidth:1,vertical:!1}),i.jsx(ex,{dataKey:"date",tickFormatter:H7,tick:{fill:Uf,fontSize:11},tickLine:!1,axisLine:{stroke:Bf},minTickGap:28}
555),i.jsx(tx,{tick:{fill:Uf,fontSize:11},tickLine:!1,axisLine:!1,width:58,tickFormatter:p=>ge(p,t)}),i.jsx(mP,{content:i.jsx(KMe,{currency:t}),cursor:{stroke:"#94a3b8",strokeWidth:1}}),u&&i.jsx(RP,{type:"monotone",dataKey:"previous",name:"Previous period",stroke:eA,strokeWidth:2,dot:!1,isAnimationActive:!1,connectNulls:!0}),i.jsx(MP,{type:"monotone",dataKey:"current",name:"This period",stroke:du,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",fill:du,fillOpacity:.1,dot:!1,isAnimationActive:!1}),l&&i.jsx(AP,{x:l.date,y:l.current,r:4,fill:du,stroke:Uxe,strokeWidth:2,label:h?{value:`${H7(l.date)} · ${ge(l.current,t)}`,position:"top",fontSize:11,fontWeight:700,fill:"#0f172a"}:void 0})]})}),i.jsx(HMe,{currentLabel:a,previousLabel:u?s:null})]})}const GMe=e=>{const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?e:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})},WMe=({active:e,payload:t,currency:n})=>{const r=e?t?.[0]?.payload:void 0;return r?i.jsxs("div",{className:"rounded-lg bg-slate-900 px-3 py-2.5 text-white shadow-lg",children:[i.jsxs("p",{className:"text-[11px] text-slate-300",children:["Week of ",Ue(r.weekStart)]}),i.jsxs("p",{className:"flex items-center gap-2 mt-1.5 text-[11px]",children:[i.jsx("i",{className:"w-2 h-2 rounded-full",style:{background:qy}}),"Money in",i.jsx("b",{className:"ml-auto tabular-nums",children:ge(r.moneyIn,n)})]}),i.jsxs("p",{className:"flex items-center gap-2 mt-1 text-[11px]",children:[i.jsx("i",{className:"w-2 h-2 rounded-full",style:{background:Hy}}),"Money out",i.jsx("b",{className:"ml-auto tabular-nums",children:ge(r.moneyOut,n)})]}),r.partial&&i.jsx("p",{className:"text-[10.5px] text-slate-400 mt-1.5",children:"partial week"})]}):null};function YMe({weeks:e,currency:t,height:n=210}){const r=e.filter(a=>a.partial).length;return i.jsxs("div",{children:[i.jsx(kw,{className:"ph-no-capture",width:"100%",height:n,children:i.jsxs(JZ,{data:e,margin:{top:12,right:8,bottom:0,left:0},barGap:2,children:[i.jsx(Dw,{stroke:Bf,strokeWidth:1,vertical:!1}),i.jsx(ex,{dataKey:"weekStart",tickFormatter:GMe,tick:{fill:Uf,fontSize:11},tickLine:!1,axisLine:{stroke:Bf}}
555),i.jsx(tx,{tick:{fill:Uf,fontSize:11},tickLine:!1,axisLine:!1,width:64,tickFormatter:a=>ge(a,t)}),i.jsx(mP,{content:i.jsx(WMe,{currency:t}),cursor:{fill:"rgba(148,163,184,.12)"}}),i.jsx(dg,{dataKey:"moneyIn",name:"Money in",fill:qy,maxBarSize:18,radius:[4,4,0,0],isAnimationActive:!1}),i.jsx(dg,{dataKey:"moneyOut",name:"Money out",fill:Hy,maxBarSize:18,radius:[4,4,0,0],isAnimationActive:!1})]})}),i.jsxs("div",{className:"flex gap-4 flex-wrap mt-2.5 text-[11.5px] text-slate-600",children:[i.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[i.jsx("i",{className:"w-2.5 h-2.5 rounded-[3px]",style:{background:qy}}),"Money in"]}),i.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[i.jsx("i",{className:"w-2.5 h-2.5 rounded-[3px]",style:{background:Hy}}),"Money out"]}),r>0&&i.jsxs("span",{className:"ml-auto text-slate-400",children:[r," week",r===1?" is":"s are"," partial"]})]})]})}const XMe=({active:e,payload:t,valueLabel:n})=>{const r=e?t?.[0]?.payload:void 0;return r?i.jsxs("div",{className:"rounded-lg bg-slate-900 px-3 py-2 text-white shadow-lg",children:[i.jsx("p",{className:"text-[11px] text-slate-300",children:r.label}),i.jsxs("p",{className:"text-[11px] mt-1",children:[n," ",i.jsx("b",{className:"tabular-nums ml-1.5",children:r.display})]})]}):null};function eJ({data:e,valueLabel:t,height:n=190,tickFormatter:r}){const a=e.reduce((o,l)=>Math.max(o,l.value),0),s=e.map(o=>({...o,peakLabel:a>0&&o.value===a?o.display:""}));return i.jsx(kw,{className:"ph-no-capture",width:"100%",height:n,children:i.jsxs(JZ,{data:s,margin:{top:18,right:8,bottom:0,left:0},children:[i.jsx(Dw,{stroke:Bf,strokeWidth:1,vertical:!1}),i.jsx(ex,{dataKey:"label",tick:{fill:Uf,fontSize:11},tickLine:!1,axisLine:{stroke:Bf}}
555),i.jsx(tx,{tick:{fill:Uf,fontSize:11},tickLine:!1,axisLine:!1,width:r?62:34,tickFormatter:r}),i.jsx(mP,{content:i.jsx(XMe,{valueLabel:t}),cursor:{fill:"rgba(148,163,184,.12)"}}),i.jsxs(dg,{dataKey:"value",maxBarSize:24,radius:[4,4,0,0],isAnimationActive:!1,children:[s.map(o=>i.jsx(Ah,{fill:du},o.label)),i.jsx(Ti,{dataKey:"peakLabel",position:"top",fontSize:11,fontWeight:700,fill:"#0f172a"})]})]})})}function QMe({composition:e,subCategories:t,currency:n}){const[r,a]=v.useState(null),s=v.useId(),{slices:o,total:l,categoryCount:u}=e;if(o.length===0)return i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"No spend to break down in this window."});const d=o.reduce((h,p)=>Math.max(h,p.amount),0);return i.jsxs("div",{children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:["Money out · ",u," categor",u===1?"y":"ies"]}),i.jsx("p",{className:"text-2xl font-extrabold tracking-tight text-amount-neg mt-1",children:Ee(-l,n)}),i.jsx("div",{className:"flex gap-0.5 h-2.5 rounded-full overflow-hidden my-3.5",children:o.map((h,p)=>i.jsx("span",{className:"block h-full",style:{flex:`0 0 ${h.percent}%`,background:zI(p,h.isOther)}},h.category))}),i.jsx("ul",{children:o.map((h,p)=>{const g=zI(p,h.isOther),x=h.isOther?[]:t[h.category]??[],y=r===h.category,w=`${s}-subcategories-${p}`;return i.jsxs("li",{className:"mb-2.5 last:mb-0",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[x.length>0?i.jsxs("button",{type:"button","aria-expanded":y,"aria-controls":w,onClick:()=>a(j=>j===h.category?null:h.category),className:"w-[128px] flex-none flex items-center gap-1.5 text-xs font-semibold text-slate-600 text-left hover:text-slate-900 min-w-0",children:[i.jsx(va,{"aria-hidden":"true",className:`w-3 h-3 flex-none transition-transform ${y?"rotate-90":""}`}),i.jsx("i",{className:"w-2 h-2 rounded-full flex-none",style:{background:g}}),i.jsx("span",{className:"truncate",children:h.category})]}):i.jsxs("span",{className:"w-[128px] flex-none flex items-center gap-1.5 pl-[18px] text-xs font-semibold text-slate-600 min-w-0",children:[i.jsx("i",{className:"w-2 h-2 rounded-full flex-none",style:{background:g}}),i.jsx("span",{className:"truncate",children:h.category})]}),i.jsx("span",{className:"flex-1 h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full rounded-full",style:{width:d>0?`${h.amount/d*100}%`:"0%",background:g}})}),i.jsx("span",{className:"w-[92px] flex-none text-right text-[12.5px] font-bold tabular-nums text-amount-neg",children:Ee(-h.amount,n)}),i.jsxs("span",{className:"w-[38px] flex-none text-right text-[11px] tabular-nums text-slate-400",children:[h.percent,"%"]})]}),y&&i.jsx("ul",{id:w,className:"ml-[7px] mt-2 mb-1 pl-3 border-l border-border",children:x.map(j=>i.jsxs("li",{className:"flex items-center gap-2.5 py-1 text-[11.5px]",children:[i.jsx("span",{className:"w-[120px] flex-none truncate text-slate-600",children:j.subCategory}),i.jsx("span",{className:"flex-1 h-1.5 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full rounded-full",style:{width:`${j.percent}%`,background:g}})}),i.jsx("span",{className:"w-[84px] flex-none text-right font-semibold tabular-nums text-slate-700",children:Ee(-j.amount,n)}),i.jsxs("span",{className:"w-[38px] flex-none text-right tabular-nums text-slate-400",children:[j.percent,"%"]})]},j.subCategory))})]},h.category)})})]})}const tJ=v.createContext({onSelectMerchant:()=>{}}),ZMe=()=>v.useContext(tJ);function Lw({merchant:e,className:t=""}){const{onSelectMerchant:n}=ZMe();return i.jsx("button",{type:"button",onClick:()=>n(e),title:`See every ${e} transaction in this window`,className:`truncate text-left hover:text-brand hover:underline underline-offset-2 ${t}`,children:e})}function JMe({summary:e,currency:t}){const{merchants:n}=e;if(n.length===0)return i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"No spend to rank in this window."});const r=n[0].amount;return i.jsx("ul",{children:n.map(a=>i.jsxs("li",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsx("span",{className:"w-[108px] flex-none text-xs font-semibold text-slate-600 truncate",children:i.jsx(Lw,{merchant:a.merchant})}),i.jsx("span",{className:"flex-1 h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full rounded-full",style:{width:r>0?`${a.amount/r*100}%`:"0%",background:du}}
555)}),i.jsx("span",{className:"w-[92px] flex-none text-right text-[12.5px] font-bold tabular-nums text-amount-neg",children:Ee(-a.amount,t)}),i.jsxs("span",{className:"w-[68px] flex-none text-right text-[11px] tabular-nums text-slate-400",children:[a.count," charge",a.count===1?"":"s"]})]},a.merchant))})}function eDe({channels:e,transactionCount:t}){if(e.length===0)return i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"No transactions to split by channel."});const n=e.reduce((r,a)=>Math.max(r,a.count),0);return i.jsxs("div",{children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:[t," transaction",t===1?"":"s"]}),i.jsx("div",{className:"flex gap-0.5 h-3.5 rounded-full overflow-hidden mt-2.5 mb-4",children:e.map((r,a)=>i.jsx("span",{className:"block h-full",style:{flex:`0 0 ${r.percent}%`,background:fk(a)}},r.channel))}),i.jsx("ul",{children:e.map((r,a)=>i.jsxs("li",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsxs("span",{className:"w-[108px] flex-none flex items-center gap-2 text-xs font-semibold text-slate-600 truncate capitalize",children:[i.jsx("i",{className:"w-2 h-2 rounded-full flex-none",style:{background:fk(a)}}),r.channel]}),i.jsx("span",{className:"flex-1 h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full rounded-full",style:{width:n>0?`${r.count/n*100}%`:"0%",background:fk(a)}})}),i.jsx("span",{className:"w-[52px] flex-none text-right text-[12.5px] font-bold tabular-nums text-slate-900",children:r.count}),i.jsxs("span",{className:"w-[38px] flex-none text-right text-[11px] tabular-nums text-slate-400",children:[r.percent,"%"]})]},r.channel))})]})}const jt=e=>Math.round(e*100)/100,Il=e=>String(e??"").slice(0,10),Ii=e=>{const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?null:t},LP=(e,t)=>{const n=new Date(e);return n.setDate(n.getDate()+t),n},Ar=e=>{const t=Number(e.amount);return Number.isFinite(t)&&t<0?Math.abs(t):0},nJ=e=>{const t=Number(e.amount);return Number.isFinite(t)&&t>0?t:0};function K7(e,t=hA(e),n=!1){return e.filter(r=>r.pending&&!n?!1:t?r.iso_currency_code?.trim()===t:!0)}const FP=(e,t)=>Math.round((t.getTime()-e.getTime())/864e5);function Lv(e){const t=Ii(e.startDate),n=Ii(e.endDate);if(!t||!n)return 1;const r=FP(t,n)+1;return r>0?r:1}const rJ=400,mE=e=>Ii(e.startDate)!==null&&Lv(e)<=rJ;function V7(e,t){const n=new Map;for(const s of e){const o=Ar(s);if(o===0)continue;const l=Il(s.date);if(!l)continue;const u=n.get(l)??{amount:0,count:0};u.amount+=o,u.count+=1,n.set(l,u)}const r=Ii(t.startDate),a=Lv(t);return!r||!mE(t)?[...n.entries()].sort((s,o)=>s[0].localeCompare(o[0])).map(([s,o])=>({date:s,amount:jt(o.amount),count:o.count})):Array.from({length:a},(s,o)=>{const l=Vr(LP(r,o)),u=n.get(l);return{date:l,amount:u?jt(u.amount):0,count:u?.count??0}})}function tDe(e){return e.reduce((t,n)=>n.amount>0&&(!t||n.amount>t.amount)?n:t,null)}function nDe(e,t){return t>0?jt(e/t):0}const aJ=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],rDe=e=>{const t=Ii(e);return t?aJ[t.getDay()]:""};function G7(e,t){return e.map((n,r)=>{const a=t?.[r]??null;return{date:n.date,weekday:rDe(n.date),current:n.amount,previous:a?a.amount:null,change:a?jt(n.amount-a.amount):null,count:n.count}})}const aDe=e=>{const t=new Date(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Vr(t)};function sJ(e,t){const n=new Map;for(const r of e){const a=Ii(Il(r.date));if(!a)continue;const s=Number(r.amount);if(!Number.isFinite(s))continue;const o=aDe(a),l=n.get(o)??{moneyIn:0,moneyOut:0};s>=0?l.moneyIn+=s:l.moneyOut+=Math.abs(s),n.set(o,l)}return[...n.entries()].sort((r,a)=>r[0].localeCompare(a[0])).map(([r,a])=>{const s=Ii(r),o=s?Vr(LP(s,6)):r;return{weekStart:r,moneyIn:jt(a.moneyIn),moneyOut:jt(a.moneyOut),partial:r<t.startDate||o>t.endDate}})}const W7=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function sDe(e){const t=new Map(W7.map(n=>[n,{amount:0,count:0}]));for(const n of e){const r=Ar(n);if(r===0)continue;const a=Ii(Il(n.date));if(!a)continue;const s=t.get(aJ[a.getDay()]);s&&(s.amount+=r,s.count+=1)}return W7.map(n=>{const r=t.get(n);return{weekday:n,amount:jt(r.amount),count:r.count}})}function iDe(e){const t=e.reduce((r,a)=>r+a.amount,0);if(t<=0)return null;const n=e.filter(r=>r.weekday==="Sat"||r.weekday==="Sun").reduce((r,a)=>r+a.amount,0);return Math.round(n/t*100)}const m5=[{range:"$0â10",min:0,max:10},{range:"$10â50",min:10,max:50},{range:"$50â100",min:50,max:100},{range:"$100â500",min:100,max:500},{range:"$500+",min:500,max:1/0}];function oDe(e){const t=m5.map(()=>0);for(const n of e){const r=Ar(n);if(r<=0)continue;const a=m5.findIndex(({min:s,max:o})=>r>=s&&r<o);a!==-1&&(t[a]+=1)}return m5.map(({range:n},r)=>({range:n,count:t[r]}))}const Fv=e=>{const t=[...e].sort((r,a)=>r-a),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]};function lDe(e){const t=e.map(Ar).filter(n=>n>0);return t.length?jt(Fv(t)):null}const cDe="Unknown";function uDe(e){const t=new Map;for(const r of e){const a=r.payment_channel?.trim()||cDe,s=t.get(a)??{count:0,amount:0,spendRows:0};s.count+=1;const o=Ar(r);o>0&&(s.amount+=o,s.spendRows+=1),t.set(a,s)}const n=e.length;return[...t.entries()].map(([r,a])=>({channel:r,count:a.count,percent:n>0?Math.round(a.count/n*100):0,amount:jt(a.amount),averageSpend:a.spendRows>0?jt(a.amount/a.spendRows):null})).sort((r,a)=>a.count-r.count||r.channel.localeCompare(a.channel))}function iJ(e,t,n,r,a){const s=jt(e.reduce((d,h)=>d+n(h),0)),o=d=>s>0?Math.round(d/s*100):0,l=e.slice(0,t).map(d=>r(d,o(n(d)))),u=e.slice(t);if(u.length>0){const d=jt(u.reduce((h,p)=>h+n(p),0));l.push(a(u,d,o(d)))}return{slices:l,total:s}}function dDe(e,t=6){const n=F1(e),{slices:r,total:a}=iJ(n,t,s=>s.amount,(s,o)=>({...s,percent:o,isOther:!1}),(s,o,l)=>({category:"Other",amount:o,percent:l,isOther:!0}));return{slices:r,total:a,categoryCount:n.length}}function fDe(e,t=8){const n=z1(e,t),r=new Set(e.filter(o=>Ar(o)>0).map(o=>
555br(o))).size,a=e.reduce((o,l)=>o+Ar(l),0),s=jt(n.reduce((o,l)=>o+l.amount,0));return{merchants:n,totalMerchants:r,shownAmount:s,sharePercent:a>0?Math.round(s/a*100):null}}function hDe(e,t){const n=oJ(t),r=new Map;for(const s of e){const o=String(s.ml_account_id??"");if(!o)continue;const l=Number(s.amount);if(!Number.isFinite(l))continue;const u=r.get(o)??{title:n(s),moneyOut:0,moneyIn:0,count:0,mask:null,subtitle:null};l>=0?u.moneyIn+=l:u.moneyOut+=Math.abs(l),u.count+=1,u.mask=u.mask??(s.mask?.trim()||null),u.subtitle=u.subtitle??(s.account_name?.trim()||null),r.set(o,u)}const a=[...r.values()].reduce((s,o)=>s+o.moneyOut,0);return[...r.entries()].map(([s,o])=>({accountId:s,title:o.title,mask:o.mask,subtitle:o.subtitle,moneyOut:jt(o.moneyOut),moneyIn:jt(o.moneyIn),net:jt(o.moneyIn-o.moneyOut),count:o.count,percent:a>0?Math.round(o.moneyOut/a*100):0})).sort((s,o)=>o.moneyOut-s.moneyOut||s.title.localeCompare(o.title))}function oJ(e){const t=new Map(e.map(n=>[String(n.id),n]));return n=>{const r=String(n.ml_account_id??""),a=t.get(r);return a?.title||a?.name||(r?`Account ${r}`:"Unknown account")}}const lJ=(e,t)=>t>0?Math.round((e-t)/t*100):null;function g5(e,t,n,r=n,a=6){const s=new Map,o=(l,u)=>{for(const d of l){const h=Ar(d);if(h===0)continue;const p=n(d),g=s.get(p)??{label:r(d),current:0,previous:0};g[u]+=h,s.set(p,g)}};return o(e,"current"),o(t,"previous"),[...s.entries()].map(([l,u])=>{const d=jt(u.current),h=jt(u.previous);return{key:l,label:u.label,current:d,previous:h,change:jt(u.current-u.previous),percent:lJ(d,h)}}).filter(l=>l.change!==0).sort((l,u)=>Math.abs(u.change)-Math.abs(l.change)||l.label.localeCompare(u.label)).slice(0,a)}const ey=e=>e.percent===null?"new":`${e.percent>0?"+":""}${e.percent}%`,gE={category:"Category",merchant:"Merchant",account:"Account"},pDe="No sub-category";function mDe(e){const t=new Map;for(const n of e){const r=Ar(n);if(r===0)continue;const a=vh(n),s=n.sub_category?.trim()||pDe,o=t.get(a)??new Map,l=o.get(s)??{amount:0,count:0};l.amount+=r,l.count+=1,o.set(s,l),t.set(a,o)}return Object.fromEntries([...t.entries()].map(([n,r])=>{const a=[...r.values()].reduce((o,l)=>o+l.amount,0),s=[...r.entries()].map(([o,l])=>({subCategory:o,amount:jt(l.amount),count:l.count,percent:a>0?Math.round(l.amount/a*100):0})).sort((o,l)=>l.amount-o.amount||o.subCategory.localeCompare(l.subCategory));return[n,s]}))}function gDe(e){const t=e.filter(s=>Ar(s)>0),n=t.filter(s=>vh(s)===fA),r=n.reduce((s,o)=>s+Ar(o),0),a=t.reduce((s,o)=>s+Ar(o),0);return{count:n.length,amount:jt(r),percent:a>0?Math.round(r/a*100):null,merchants:z1(n,3).map(s=>s.merchant)}}function xDe(e,t=5){const n=new Map;for(const o of e){const l=nJ(o);if(l<=0)continue;const u=br(o),d=n.get(u)??{amount:0,count:0};d.amount+=l,d.count+=1,n.set(u,d)}const r=[...n.entries()].sort((o,l)=>l[1].amount-o[1].amount||o[0].localeCompare(l[0])),{slices:a,total:s}=iJ(r,t,([,o])=>o.amount,([o,l],u)=>({source:o,amount:jt(l.amount),count:l.count,percent:u,isOther:!1}),(o,l,u)=>({source:"Other",amount:l,count:o.reduce((d,[,h])=>d+h.count,0),percent:u,isOther:!0}));return{sources:a,total:s,sourceCount:n.size}}const bDe=[{cadence:"weekly",min:6,max:8,minCharges:3},{cadence:"every two weeks",min:13,max:15,minCharges:3},{cadence:"monthly",min:27,max:33,minCharges:2},{cadence:"quarterly",min:85,max:97,minCharges:2},{cadence:"yearly",min:355,max:375,minCharges:2}],yDe=30.44;function vDe(e,t){const n=new Map,r=new Set;for(const s of e){const o=Ar(s);if(o===0)continue;if(s.transaction_id){if(r.has(s.transaction_id))continue;r.add(s.transaction_id)}const l=Il(s.date),u=Ii(l);if(!u)continue;const d=br(s),h=n.get(d)??[];h.push({date:l,day:u,amount:o}),n.set(d,h)}const a=[];for(const[s,o]of n){if(o.length<2)continue;o.sort((j,N)=>j.date.localeCompare(N.date));const l=o.slice(1).map((j,N)=>FP(o[N].day,j.day));if(l.some(j=>j<=0))continue;const u=Fv(l),d=bDe.find(j=>u>=j.min&&u<=j.max);if(!d||o.length<d.minCharges)continue;const h=Math.max(2,u*.12);if(l.some(j=>Math.abs(j-u)>h))continue;const p=o.map(j=>j.amount),g=Fv(p),x=Math.max(1,g*.1);if(p.some(j=>Math.abs(j-g)>x))continue;const y=o.filter(j=>j.date>=t.startDate&&j.date<=t.endDate).length;if(y===0)continue;const w=o[o.length-1];a.push({merchant:s,cadence:d.cadence,intervalDays:Math.round(u),typicalAmount:jt(g),occurrences:o.length,inWindow:y,lastDate:w.date,nextDate:Vr(LP(w.day,Math.round(u))),monthlyCost:jt(g*yDe/u)})}return a.sort((s,o)=>o.monthlyCost-s.monthlyCost||s.merchant.localeCompare(o.merchant))}function cJ(e){const t=new Map;for(const n of e){const r=n.iso_currency_code?.trim();r&&t.set(r,(t.get(r)??0)+1)}return[...t.entries()].map(([n,r])=>({currency:n,count:r})).sort((n,r)=>r.count-n.count||n.currency.localeCompare(r.currency))}const Y7=(e,t,n)=>Xl(n?e.map(r=>r.pending?{...r,pending:!1}:r):e,t);function wDe({rows:e,previousRows:t,previousWindow:n,window:r,accounts:a,includePending:s=!1,currency:o=null}){const l=cJ(e),u=o&&l.some(T=>T.currency===o)?o:hA(e),d=Xl(e,u),h=s?Y7(e,u,!0):d,p=K7(e,u,s),g=t?K7(t,u,s):null,x=Lv(r),y=V7(p,r),w=sDe(p),j=g&&n?V7(g,n):null,N=j!==null&&n!==null&&mE(r)&&mE(n);j&&!N&&console.warn(`[analyticsInsights] window ${r.startDate}..${r.endDate} (${x} days) is past the ${rJ}-day zero-fill cap â dropping the per-day comparison against ${n?.startDate}..${n?.endDate}`);const k=T=>String(T.ml_account_id??""),S=oJ(a),E=T=>E1(S(T),T.mask?.trim()||null),O=vDe(g?[...p,...g]:p,r);return{window:r,days:x,currency:u,currencies:l,summary:h,pending:{count:d.pendingCount,value:d.pendingValue,included:s},depositCount:p.filter(T=>Number(T.amount)>0).length,daily:y,previousDaily:j,previousDailyByOffset:N?j:null,previousWindow:n,previousNet:t?Y7(t,u,s).net:null,busiest:tDe(y),average:nDe(h.moneyOut,x),weekly:sJ(p,r),weekdays:w,weekend:iDe(w),sizes:oDe(p),median:lDe(p),channels:uDe(p),categories:dDe(p),subCategories:mDe(p),merchants:fDe(p),accounts:hDe(p,a),changes:g?{category:g5(p,g,vh),merchant:g5(p,g,br),account:g5(p,g,k,E)}:null,recurring:{charges:O,monthlyTotal:jt(O.reduce((T,P)=>T+P.monthlyCost,0)),historyDays:x+(n&&g?Lv(n):0)},uncategorised:gDe(p),income:xDe(p),rows:p,previousRows:g}}function jDe(e,t){const n=e.rows.filter(h=>br(h)===t).sort((h,p)=>Il(p.date).localeCompare(Il(h.date))),r=n.filter(h=>Ar(h)>0),a=r.reduce((h,p)=>h+Ar(p),0),s=n.reduce((h,p)=>h+nJ(p),0),o=r.map(h=>Ii(Il(h.date))).filter(h=>h!==null).sort((h,p)=>h.getTime()-p.getTime()),l=o.slice(1).map((h,p)=>FP(o[p],h)),u=e.previousRows?jt(e.previousRows.filter(h=>br(h)===t&&Ar(h)>0).reduce((h,p)=>h+Ar(p),0)):null,d=n.map(h=>
555Il(h.date)).filter(Boolean).sort();return{merchant:t,rows:n,moneyOut:jt(a),moneyIn:jt(s),spendCount:r.length,averageSpend:r.length>0?jt(a/r.length):null,firstDate:d[0]??null,lastDate:d[d.length-1]??null,medianGapDays:l.length>0?Math.round(Fv(l)):null,previousMoneyOut:u,changePercent:u===null?null:lJ(jt(a),u),weekly:sJ(n,e.window),recurring:e.recurring.charges.find(h=>h.merchant===t)??null}}const NDe=Object.entries(gE);function _De({changes:e,currency:t}){const[n,r]=v.useState("category");if(!e)return i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"The previous period has not been read yet, so there is nothing to compare this one against."});const a=e[n];return i.jsxs("div",{children:[i.jsx("div",{role:"group","aria-label":"Compare by",className:"inline-flex gap-0.5 border border-border rounded-lg p-[3px] bg-surface mb-3",children:NDe.map(([s,o])=>i.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>r(s),className:`px-2.5 py-1 rounded-md text-xs font-semibold transition-colors ${s===n?"bg-surface-muted text-slate-900":"text-slate-500 hover:text-slate-900"}`,children:o},s))}),a.length===0?i.jsxs("p",{className:"text-[12.5px] text-slate-500",children:["Spend matched the previous period for every ",n,"."]}):i.jsx("ul",{children:a.map(s=>{const o=s.change>0,l=o?xle:ole;return i.jsxs("li",{className:"flex items-center gap-2.5 py-2 border-b border-dashed border-border last:border-b-0",children:[i.jsx(l,{"aria-hidden":"true",className:`w-4 h-4 flex-none ${o?"text-amount-neg":"text-amount-pos"}`}),i.jsx("span",{className:"flex-1 min-w-0 text-[12.5px] font-semibold text-slate-700 truncate",children:n==="merchant"&&s.current>0?i.jsx(Lw,{merchant:s.key}):s.label}),i.jsxs("span",{className:"text-[11.5px] text-slate-400 tabular-nums whitespace-nowrap",children:["was ",ge(s.previous,t)]}),i.jsxs("span",{className:"w-[108px] flex-none text-right text-[12.5px] font-bold tabular-nums text-slate-900",children:[ge(Math.abs(s.change),t)," ",o?"more":"less"]}),i.jsx("span",{className:"w-[92px] flex-none text-right text-[11.5px] tabular-nums text-slate-500",children:ey(s)})]},s.key)})})]})}function kDe({recurring:e,currency:t}){const{charges:n,monthlyTotal:r,historyDays:a}=e;return n.length===0?i.jsxs("p",{className:"text-[12.5px] text-slate-500 leading-relaxed",children:["No regular charges found in the last ",a," days. A monthly charge has to appear twice before it can be told apart from a one-off, so a longer range finds more."]}):i.jsxs("div",{children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:[n.length," regular charge",n.length===1?"":"s"]}),i.jsxs("p",{className:"text-2xl font-extrabold tracking-tight text-slate-900 mt-1",children:["about ",ge(r,t)," a month"]}),i.jsx("ul",{className:"mt-3",children:n.map(s=>i.jsxs("li",{className:"flex items-center gap-2.5 py-2 border-b border-dashed border-border last:border-b-0",children:[i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx(Lw,{merchant:s.merchant,className:"block max-w-full text-[12.5px] font-semibold text-slate-800"}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500",children:[s.cadence," · next around ",Ue(s.nextDate)]})]}),i.jsxs("span",{className:"text-right",children:[i.jsx("span",{className:"block text-[12.5px] font-bold tabular-nums text-slate-900",children:ge(s.typicalAmount,t)}),i.jsxs("span",{className:"block text-[11px] tabular-nums text-slate-400",children:[ge(s.monthlyCost,t)," / month"]})]})]},s.merchant))})]})}function SDe({income:e,currency:t}){const{sources:n,total:r,sourceCount:a}=e;if(n.length===0)return i.jsx("p",{className:"text-[12.5px] text-slate-500",children:"No money came in during this window."});const s=n.reduce((o,l)=>Math.max(o,l.amount),0);return i.jsxs("div",{children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:["Money in · ",a," source",a===1?"":"s"]}),i.jsx("p",{className:"text-2xl font-extrabold tracking-tight text-amount-pos mt-1",children:ge(r,t)}),i.jsx("ul",{className:"mt-3",children:n.map(o=>i.jsxs("li",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsx("span",{className:"w-[120px] flex-none text-xs font-semibold text-slate-600 truncate",children:o.isOther?o.source:i.jsx(Lw,{merchant:o.source})}),i.jsx("span",{className:"flex-1 h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full rounded-full",style:{width:s>0?`${o.amount/s*100}%`:"0%",background:o.isOther?rC:qy}})}),i.jsx("span",{className:"w-[96px] flex-none text-right text-[12.5px] font-bold tabular-nums text-amount-pos",children:ge(o.amount,t)}),i.jsxs("span",{className:"w-[72px] flex-none text-right text-[11px] tabular-nums text-slate-400",children:[o.count," deposit",o.count===1?"":"s"]})]},o.source))})]})}const qi=e=>{const t=Ng.find(n=>n.key===e);if(!t)throw new Error(`[chartRegistry] no chart named '${e}' in AVAILABLE_CHARTS`);return{key:e,title:t.label,icon:t.icon}},xE=e=>`${Ue(e.startDate)} â ${Ue(e.endDate)}`,uJ=e=>e.previousDaily?.reduce((t,n)=>t+n.amount,0)??null,CDe=(e,t)=>{if(t<=0)return null;const n=Math.round((e-t)/t*100);return`${n>=0?"+":""}${n}%`},EDe=e=>e.startsWith("-")?"positive":e==="+0%"?"neutral":"negative",ODe={...qi("spendingOverTime"),subtitle:e=>e.previousDailyByOffset?`daily · vs previous ${e.days} days`:"daily",renderChart:(e,t)=>i.jsx(VMe,{days:G7(e.daily,e.previousDailyByOffset),currency:e.currency,busiestDate:e.busiest?.date??null,height:t?420:210,currentLabel:xE(e.window),previousLabel:e.previousDailyByOffset&&e.previousWindow?xE(e.previousWindow):null}),table:e=>({columns:[{key:"day",label:"Day"},{key:"current",label:"This period",align:"right"},{key:"previous",label:"Previous period",align:"right"},{key:"change",label:"Change",align:"right"},{key:"count",label:"Transactions",align:"right"}],rows:G7(e.daily,e.previousDailyByOffset).map(t=>({key:t.date,emphasis:t.date===e.busiest?.date,cells:[`${Ue(t.date)} · ${t.weekday}${t.date===e.busiest?.date?" · busiest":""}`,Ee(-t.current,e.currency),t.previous===null?je:Ee(-t.previous,e.currency),t.change===null?je:Ee(-t.change,e.currency),String(t.count)]}))}),note:e=>e.busiest?`Busiest day ${Ue(e.busiest.date)} at ${ge(e.busiest.amount,e.currency)} across ${e.busiest.count} transaction${e.busiest.count===1?"":"s"}
555.`:null,detail:e=>{const t=uJ(e),n=t!==null?CDe(e.summary.moneyOut,t):null;return[{label:"This period",value:Ee(-e.summary.moneyOut,e.currency),tone:"negative"},{label:"Previous period",value:t===null?je:Ee(-t,e.currency)},{label:"Change",value:n??je,tone:n===null?void 0:EDe(n)},{label:"Busiest day",value:e.busiest?`${Ue(e.busiest.date)} · ${ge(e.busiest.amount,e.currency)}`:je}]},csvName:"spending-over-time"},ADe={...qi("categories"),subtitle:()=>{},renderChart:e=>i.jsx(QMe,{composition:e.categories,subCategories:e.subCategories,currency:e.currency}),table:e=>({columns:[{key:"category",label:"Category"},{key:"amount",label:"Money out",align:"right"},{key:"share",label:"Share",align:"right"}],rows:e.categories.slices.map(t=>({key:t.category,cells:[t.category,Ee(-t.amount,e.currency),`${t.percent}%`]}))}),note:e=>{const t=e.categories.slices.filter(r=>!r.isOther).slice(0,2);if(t.length===0)return null;const n=t.reduce((r,a)=>r+a.percent,0);return`${t.map(r=>r.category).join(" and ")} are ${n}% of money out.`},detail:e=>[{label:"Money out",value:Ee(-e.categories.total,e.currency),tone:"negative"},{label:"Categories",value:String(e.categories.categoryCount)},{label:"Largest",value:e.categories.slices[0]?`${e.categories.slices[0].category} · ${e.categories.slices[0].percent}%`:je}],csvName:"spend-by-category"},TDe={...qi("incomeVsExpense"),subtitle:()=>"by week",renderChart:(e,t)=>i.jsx(YMe,{weeks:e.weekly,currency:e.currency,height:t?420:210}),table:e=>({columns:[{key:"week",label:"Week of"},{key:"in",label:"Money in",align:"right"},{key:"out",label:"Money out",align:"right"},{key:"net",label:"Net",align:"right"}],rows:e.weekly.map(t=>({key:t.weekStart,cells:[`${Ue(t.weekStart)}${t.partial?" · partial":""}`,ge(t.moneyIn,e.currency),Ee(-t.moneyOut,e.currency),Ee(t.moneyIn-t.moneyOut,e.currency)]}))}),note:e=>e.weekly.length>0?`${e.weekly.length} week${e.weekly.length===1?"":"s"} in this window · net ${Ee(e.summary.net,e.currency)}.`:null,detail:e=>[{label:"Money in",value:ge(e.summary.moneyIn,e.currency),tone:"positive"},{label:"Money out",value:Ee(-e.summary.moneyOut,e.currency),tone:"negative"},{label:"Net flow",value:Ee(e.summary.net,e.currency)},{label:"Weeks",value:String(e.weekly.length)}],csvName:"income-vs-expenses"},PDe={...qi("topMerchants"),subtitle:()=>"by money out",renderChart:e=>i.jsx(JMe,{summary:e.merchants,currency:e.currency}),table:e=>({columns:[{key:"merchant",label:"Merchant"},{key:"amount",label:"Money out",align:"right"},{key:"count",label:"Charges",align:"right"}],rows:e.merchants.merchants.map(t=>({key:t.merchant,cells:[t.merchant,Ee(-t.amount,e.currency),String(t.count)]}))}),note:e=>{const{merchants:t,totalMerchants:n,shownAmount:r,sharePercent:a}=e.merchants;return t.length===0?null:`Top ${t.length} of ${n} merchants · ${ge(r,e.currency)}${a===null?"":` (${a}% of money out)`}.`},detail:e=>[{label:"Largest",value:e.merchants.merchants[0]?.merchant??je},{label:"Its spend",value:e.merchants.merchants[0]?Ee(-e.merchants.merchants[0].amount,e.currency):je,tone:"negative"},{label:"Merchants",value:String(e.merchants.totalMerchants)}],csvName:"top-merchants"},RDe={...qi("weekday"),subtitle:()=>{},renderChart:(e,t)=>i.jsx(eJ,{data:e.weekdays.map(n=>({label:n.weekday,value:n.amount,display:ge(n.amount,e.currency)})),valueLabel:"Money out",height:t?420:190,tickFormatter:n=>ge(n,e.currency)}),table:e=>({columns:[{key:"weekday",label:"Weekday"},{key:"amount",label:"Money out",align:"right"},{key:"count",label:"Transactions",align:"right"}],rows:e.weekdays.map(t=>({key:t.weekday,cells:[t.weekday,Ee(-t.amount,e.currency),String(t.count)]}))}),note:e=>e.weekend===null?null:`Weekends carry ${e.weekend}% of money out.`,detail:e=>{const t=[...e.weekdays].sort((n,r)=>r.amount-n.amount)[0];return[{label:"Heaviest day",value:t&&t.amount>0?t.weekday:je},{label:"Its spend",value:t&&t.amount>0?Ee(-t.amount,e.currency):je,tone:"negative"},{label:"Weekend share",value:e.weekend===null?je:`${e.weekend}%`}]},csvName:"spend-by-weekday"},MDe={...qi("sizes"),subtitle:()=>{},renderChart:(e,t)=>i.jsx(eJ,{data:e.sizes.map(n=>({label:n.range,value:n.count,display:String(n.count)})),valueLabel:"Transactions",height:t?420:190}),table:e=>({columns:[{key:"range",label:"Size"},{key:"count",label:"Transactions",align:"right"}],rows:e.sizes.map(t=>({key:t.range,cells:[t.range,String(t.count)]}))}),note:e=>{if(e.median===null)return null;const t=e.sizes[e.sizes.length-1],n=ge(e.median,e.currency);return t?`Median transaction ${n} · ${t.count} in ${t.range}.`:`Median transaction ${n}.`},detail:e=>[{label:"Median",value:e.median===null?je:ge(e.median,e.currency)},{label:"Largest",value:e.summary.largestSpend===null?je:ge(e.summary.largestSpend,e.currency)},{label:"Average",value:e.summary.averageSpend===null?je:ge(e.summary.averageSpend,e.currency)}],csvName:"transaction-sizes"},DDe={...qi("channels"),subtitle:()=>{},renderChart:e=>i.jsx(eDe,{channels:e.channels,transactionCount:e.rows.length}),table:e=>({columns:[{key:"channel",label:"Channel"},{key:"count",label:"Transactions",align:"right"},{key:"share",label:"Share",align:"right"},{key:"average",label:"Average spend",align:"right"}],rows:e.channels.map(t=>({key:t.channel,cells:[t.channel,String(t.count),`${t.percent}%`,t.averageSpend===null?je:ge(t.averageSpend,e.currency)]}))}),note:e=>{const t=e.channels.filter(n=>n.averageSpend!==null).slice(0,2);return t.length===0?null:t.map(n=>`${n.channel} averages ${ge(n.averageSpend,e.currency)} per charge`).join(" · ")},detail:e=>[{label:"Channels",value:String(e.channels.length)},{label:"Most used",value:e.channels[0]?.channel??je},{label:"Its share",value:e.channels[0]?`${e.channels[0].percent}%`:je}],csvName:"payment-channels"},$De=e=>e.percent===null?"up from nothing":`${e.change>0?"up":"down"} ${Math.abs(e.percent)}
555%`,X7=e=>e.find(t=>t.change>0)??null,Q7=e=>e.find(t=>t.change<0)??null,IDe={...qi("changes"),subtitle:e=>e.changes&&e.previousWindow?`vs ${xE(e.previousWindow)}`:void 0,renderChart:e=>i.jsx(_De,{changes:e.changes,currency:e.currency}),table:e=>({columns:[{key:"dimension",label:"Compared by"},{key:"name",label:"Name"},{key:"previous",label:"Previous period",align:"right"},{key:"current",label:"This period",align:"right"},{key:"change",label:"Change in spend",align:"right"},{key:"percent",label:"Change",align:"right"}],rows:e.changes?Object.keys(gE).flatMap(t=>e.changes[t].map(n=>({key:`${t}:${n.key}`,cells:[gE[t],n.label,ge(n.previous,e.currency),ge(n.current,e.currency),Ee(n.change,e.currency),ey(n)]}))):[]}),note:e=>{const t=e.changes?.category??[],n=[X7(t),Q7(t)].filter(r=>r!==null).map(r=>`${r.label} is ${$De(r)}`);return n.length>0?`${n.join("; ")} on the previous period.`:null},detail:e=>{const t=e.changes?.category??[],n=X7(t),r=Q7(t),a=uJ(e);return[{label:"This period",value:Ee(-e.summary.moneyOut,e.currency),tone:"negative"},{label:"Previous period",value:a===null?je:Ee(-a,e.currency)},{label:"Biggest rise",value:n?`${n.label} · ${ey(n)}`:je,tone:n?"negative":void 0},{label:"Biggest fall",value:r?`${r.label} · ${ey(r)}`:je,tone:r?"positive":void 0}]},csvName:"what-changed"},LDe={...qi("recurring"),subtitle:e=>`last ${e.recurring.historyDays} days`,renderChart:e=>i.jsx(kDe,{recurring:e.recurring,currency:e.currency}),table:e=>({columns:[{key:"merchant",label:"Merchant"},{key:"cadence",label:"How often"},{key:"amount",label:"Typical charge",align:"right"},{key:"monthly",label:"Per month",align:"right"},{key:"last",label:"Last charged",align:"right"},{key:"next",label:"Next expected",align:"right"}],rows:e.recurring.charges.map(t=>({key:t.merchant,cells:[t.merchant,t.cadence,ge(t.typicalAmount,e.currency),ge(t.monthlyCost,e.currency),Ue(t.lastDate),Ue(t.nextDate)]}))}),note:e=>{const{charges:t,monthlyTotal:n,historyDays:r}=e.recurring;return t.length===0?null:`${t.length} regular charge${t.length===1?"":"s"}, about ${ge(n,e.currency)} a month, spotted across ${r} days of history.`},detail:e=>[{label:"Regular charges",value:String(e.recurring.charges.length)},{label:"Per month",value:ge(e.recurring.monthlyTotal,e.currency),tone:e.recurring.charges.length>0?"negative":void 0},{label:"Largest",value:e.recurring.charges[0]?.merchant??je}],csvName:"recurring-charges"},FDe={...qi("incomeSources"),subtitle:()=>"by who paid",renderChart:e=>i.jsx(SDe,{income:e.income,currency:e.currency}),table:e=>({columns:[{key:"source",label:"Source"},{key:"amount",label:"Money in",align:"right"},{key:"count",label:"Deposits",align:"right"},{key:"share",label:"Share",align:"right"}],rows:e.income.sources.map(t=>({key:t.source,cells:[t.source,ge(t.amount,e.currency),String(t.count),`${t.percent}%`]}))}),note:e=>{const t=e.income.sources.find(n=>!n.isOther);return t?`${t.source} is ${t.percent}% of money in.`:null},detail:e=>[{label:"Money in",value:ge(e.income.total,e.currency),tone:"positive"},{label:"Sources",value:String(e.income.sourceCount)},{label:"Largest",value:e.income.sources.find(t=>!t.isOther)?.source??je}],csvName:"income-by-source"},dJ=[ODe,ADe,TDe,PDe,IDe,LDe,FDe,RDe,MDe,DDe],zDe=Object.fromEntries(dJ.map(e=>[e.key,e]));function BDe(e){const t=new Set(e);return dJ.filter(n=>t.has(n.key))}const v0=50;function x5({definition:e,insights:t,onExpand:n}){const[r,a]=v.useState("chart"),s=r==="chart"?e.note(t):null,o=r==="table"?e.table(t):null,l=o?Math.max(o.rows.length-v0,0):0;return o&&l>0&&console.warn(`[AnalyticsGrid] card "${e.key}" table view capped at ${v0} of ${o.rows.length} rows (${l} hidden) â expand for all`),i.jsx(_we,{title:e.title,subtitle:e.subtitle(t),icon:e.icon,view:r,onViewChange:a,onExpand:()=>n(e.key),children:o===null?i.jsxs(i.Fragment,{children:[e.renderChart(t,!1),s&&i.jsx(z6,{children:s})]}):i.jsxs(i.Fragment,{children:[i.jsx(hW,{columns:o.columns,rows:l>0?o.rows.slice(0,v0):o.rows,caption:`${e.title}, as a table`,maxHeight:"260px"}),l>0&&i.jsx(z6,{children:`Showing the first ${v0} of ${o.rows.length} rows â expand the card for all ${o.rows.length}.`})]})})}function UDe({insights:e,visibleCharts:t,accounts:n,accountErrors:r,accountCount:a,onExpand:s}
555){const o=BDe(t),l=w=>o.find(j=>j.key===w),u=["spendingOverTime","categories"],d=[["incomeVsExpense","topMerchants"],["changes","recurring"]],h=u.map(l).filter(Boolean),p=d.map(w=>w.map(l).filter(Boolean)),g=new Set([...h,...p.flat()]),x=o.filter(w=>!g.has(w)),y=x.length%3!==0&&x.length%2===0?"lg:grid-cols-2":"lg:grid-cols-3";return i.jsxs(i.Fragment,{children:[o.length===0?i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-12 text-center mb-4",children:[i.jsx(Bo,{className:"w-10 h-10 mx-auto mb-3 text-slate-300"}),i.jsx("p",{className:"text-[15px] font-semibold text-slate-900",children:"No charts selected"}),i.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Use âEdit chartsâ in the header to choose what this screen draws. The table below still covers every account."})]}):i.jsxs(i.Fragment,{children:[h.length>0&&i.jsx("div",{className:`grid grid-cols-1 gap-4 mb-4 ${h.length===2?"lg:grid-cols-[1.7fr_1fr]":"lg:grid-cols-1"}`,children:h.map(w=>i.jsx(x5,{definition:w,insights:e,onExpand:s},w.key))}),p.map(w=>w.length>0&&i.jsx("div",{className:`grid grid-cols-1 gap-4 mb-4 ${w.length===2?"lg:grid-cols-2":""}`,children:w.map(j=>i.jsx(x5,{definition:j,insights:e,onExpand:s},j.key))},w.map(j=>j.key).join("+"))),x.length>0&&i.jsx("div",{className:`grid grid-cols-1 gap-4 mb-4 ${y}`,children:x.map(w=>i.jsx(x5,{definition:w,insights:e,onExpand:s},w.key))})]}),i.jsx(Ewe,{totals:e.accounts,currency:e.currency,accounts:n,accountErrors:r,accountCount:a})]})}const En=({className:e,style:t})=>i.jsx("span",{className:`block bg-surface-muted animate-pulse ${e??""}`,style:t}),Sl=({children:e})=>i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card",children:[i.jsxs("div",{className:"flex items-center gap-2.5 px-[18px] py-3.5 border-b border-border",children:[i.jsx(En,{className:"w-[26px] h-[26px] rounded-[7px]"}),i.jsx(En,{className:"h-2.5 w-[140px] rounded-full"})]}),i.jsx("div",{className:"px-[18px] py-4",children:e})]}),w0=({heights:e})=>i.jsx("div",{className:"flex items-end gap-2.5 h-[150px] border-b border-border",children:e.map((t,n)=>i.jsx(En,{className:"flex-1 rounded-t",style:{height:`${t}%`}},n))}),b5=({widths:e})=>i.jsx("div",{children:e.map((t,n)=>i.jsxs("span",{className:"flex items-center gap-2.5 mb-3 last:mb-0",children:[i.jsx(En,{className:"w-[92px] h-2.5 rounded-full flex-none"}),i.jsx("span",{className:"flex-1",children:i.jsx(En,{className:"h-2 rounded-full",style:{width:t}})}),i.jsx(En,{className:"w-[70px] h-2.5 rounded-full flex-none"})]},n))}),qDe=()=>i.jsxs("div",{children:[i.jsx("div",{className:"flex items-center gap-2.5 pb-3 border-b border-border",children:[70,64,56,34,110,76].map((e,t)=>i.jsx(En,{className:`h-[7px] rounded-full flex-none opacity-70 ${t===1?"ml-auto":""}`,style:{width:e}},t))}),[150,170,110].map((e,t)=>i.jsxs("div",{className:"flex items-center gap-2.5 py-1.5",children:[i.jsx(En,{className:"w-[26px] h-[26px] rounded-[7px] flex-none"}),i.jsx(En,{className:"h-2 rounded-full flex-none",style:{width:e}}),i.jsx(En,{className:"h-2 w-20 rounded-full flex-none ml-auto"}),i.jsx(En,{className:"h-2 w-20 rounded-full flex-none"}),i.jsx(En,{className:"h-2 w-20 rounded-full flex-none"}),i.jsx(En,{className:"h-2 rounded-full flex-none",style:{width:[120,92,70][t]}}),i.jsx(En,{className:"h-2 w-[34px] rounded-full flex-none"})]},t))]});function HDe({startDate:e,endDate:t,accountCount:n}){return i.jsxs("div",{"aria-busy":"true","aria-label":"Loading analytics",children:[i.jsx("div",{className:"rounded-xl border border-border overflow-hidden mb-4",children:i.jsxs(oW,{children:["Fetching transactions from your connected accounts · ",Ue(e)," â"," ",Ue(t)," · ",n," account",n===1?"":"s"]})}),i.jsx("div",{className:"flex items-start gap-6 flex-wrap bg-surface border border-border rounded-xl shadow-card px-[22px] py-[18px] mb-4",children:["Money out","Money in","Net flow","Daily average"].map((r,a,s)=>i.jsxs("div",{className:`pr-6 flex-1 ${a===s.length-1?"":"border-r border-border"}`,children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:r}),i.jsx(En,{className:"h-7 w-[150px] rounded mt-2"}),i.jsx(En,{className:"h-2 w-[100px] rounded-full mt-2.5 opacity-70"})]},r))}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1.7fr_1fr] mb-4",children:[i.jsxs(Sl,{children:[i.jsx(w0,{heights:[40,30,65,25,50,45,85,35,55,100,48,22,60,70,38,30,58,78,33,42]}),i.jsx("div",{className:"flex justify-between mt-2.5",children:[0,1,2,3,4].map(r=>i.jsx(En,{className:"h-2 w-10 rounded-full"},r))})]}),i.jsxs(Sl,{children:[i.jsx(En,{className:"h-2 w-[90px] rounded-full"}),i.jsx(En,{className:"h-7 w-[160px] rounded mt-2.5"}),i.jsx(En,{className:"h-2.5 w-full rounded-full my-4"}),i.jsx(b5,{widths:["100%","80%","62%","50%","44%","30%"]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 mb-4",children:[i.jsx(Sl,{children:i.jsx(w0,{heights:[90,25,4,35,2,30,92,28,3,32]})}),i.jsx(Sl,{children:i.jsx(b5,{widths:["100%","80%","62%","50%","44%","30%"]})})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3 mb-4",children:[i.jsx(Sl,{children:i.jsx(w0,{heights:[55,45,50,70,88,100,52]})}),i.jsx(Sl,{children:i.jsx(w0,{heights:[65,100,35,22,5]})}),i.jsxs(Sl,{children:[i.jsx(En,{className:"h-2 w-[90px] rounded-full"}),i.jsx(En,{className:"h-3.5 w-full rounded-full my-4"}),i.jsx(b5,{widths:["100%","60%","15%"]})]})]}),i.jsx(Sl,{children:i.jsx(qDe,{})})]})}function KDe({reason:e,startDate:t,endDate:n,totalCount:r,filterDescription:a,onWidenRange:s,onClearFilters:o,everyAccountFailed:l}){const u=`${Ue(t)} and ${Ue(n)}`,d=e==="filters"?"Nothing to chart for these filters":l?"No transactions could be read for this window":"No transactions in this window",h=e==="filters"?`${r} transaction${r===1?" was":"s were"} read between ${u}, but ${a?`${r===1?"it is not":"none of them is"} ${a}`:`${r===1?"it does not":"none of them"} match your filters`}. Loosen a filter, or widen the window and fetch again.`:l?`None of the accounts you selected returned transactions between ${u} â see the reasons above.`:`Nothing posted between ${u}. Widen the date range and fetch again.`;return i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card px-5 lg:px-6 py-10 lg:py-14 text-center",children:[i.jsx("span",{className:"w-[76px] h-[76px] rounded-[20px] bg-brand-soft text-brand flex items-center justify-center mx-auto mb-[18px]",children:i.jsx(Bo,{className:"w-8 h-8"})}),i.jsx("h3",{className:"text-[19px] font-extrabold tracking-tight text-slate-900 mb-1.5",children:d}),i.jsx("p",{className:"max-w-[460px] mx-auto text-slate-500 leading-relaxed",children:h}),i.jsxs("div",{className:"flex flex-col gap-2.5 justify-center mt-[22px] lg:flex-row",children:[i.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center justify-center gap-2 font-semibold min-h-[44px] lg:min-h-0 px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover",children:[i.jsx(zU,{className:"h-[15p
555x] w-[15px]"}),"Show last 90 days"]}),e==="filters"&&i.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center justify-center gap-2 font-semibold min-h-[44px] lg:min-h-0 px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100",children:[i.jsx(Ut,{className:"h-[15px] w-[15px]"}),"Clear filters"]})]})]})}const VDe=/^[=+\-@\t\r]/,GDe=/^[-+]?(?:[A-Z]{2,4} |[$â¬Â£Â¥âªâ¹])?\d[\d,]*(?:\.\d{1,4})?%?$/,WDe=e=>{if(e==null)return"";const t=String(e),n=VDe.test(t)&&!GDe.test(t)?`'${t}`:t;return/[",\r\n]/.test(n)||n!==t?`"${n.replace(/"/g,'""')}"`:n};function YDe(e,t){return[e,...t].map(n=>n.map(WDe).join(",")).join(`\r 556`)}function XDe(e,t){if(typeof document>"u"||typeof URL.createObjectURL!="function")return;const n=URL.createObjectURL(new Blob([t],{type:"text/csv;charset=utf-8;"}));try{const r=document.createElement("a");r.href=n,r.download=e,document.body.appendChild(r),r.click(),r.remove()}finally{setTimeout(()=>URL.revokeObjectURL(n),0)}}const QDe=e=>e==="negative"?"text-amount-neg":e==="positive"?"text-amount-pos":"text-slate-900";function ZDe({definition:e,insights:t,filters:n,accountCount:r,onClose:a}){const[s,o]=v.useState("chart");qo(!0),v.useEffect(()=>{const p=g=>{g.key==="Escape"&&a()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[a]);const l=v.useMemo(()=>e.table(t),[e,t]),u=v.useMemo(()=>e.detail(t),[e,t]),d=()=>{XDe(`${e.csvName}-${t.window.startDate}-to-${t.window.endDate}.csv`,YDe(l.columns.map(p=>p.label),l.rows.map(p=>p.cells)))},h=p=>`px-2.5 py-1.5 rounded-md text-xs font-semibold transition-colors ${p?"bg-surface-muted text-slate-900":"text-slate-500 hover:text-slate-900"}`;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 bg-[rgba(17,24,39,0.5)] z-40",onClick:a,"aria-hidden":"true"}),i.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center p-0 lg:p-6 overflow-auto pointer-events-none",children:i.jsxs("div",{role:"dialog","aria-label":e.title,className:"w-[980px] max-w-full min-h-[100dvh] lg:min-h-0 bg-surface rounded-none lg:rounded-xl shadow-[0_24px_60px_rgba(15,23,42,0.28)] overflow-hidden pointer-events-auto",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4 lg:px-5 py-4 border-b border-border",children:[i.jsx("span",{className:"w-[26px] h-[26px] rounded-[7px] bg-brand-soft text-brand flex items-center justify-center flex-none",children:i.jsx(e.icon,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-[17px] font-extrabold tracking-tight text-slate-900",children:e.title}),i.jsxs("p",{className:"text-[12.5px] text-slate-500 truncate",children:[Ue(t.window.startDate)," â"," ",Ue(t.window.endDate)," · ",t.days," day",t.days===1?"":"s"," · ",r," account",r===1?"":"s",t.previousWindow?` · compared with ${Ue(t.previousWindow.startDate)} â ${Ue(t.previousWindow.endDate)}`:""]})]}),i.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2.5",children:[i.jsxs("div",{role:"group","aria-label":"View",className:"flex gap-0.5 border border-border rounded-lg p-[3px] bg-surface",children:[i.jsxs("button",{type:"button","aria-pressed":s==="chart",onClick:()=>o("chart"),className:`${h(s==="chart")} inline-flex items-center gap-1.5`,children:[i.jsx(Bo,{className:"w-[13px] h-[13px]"}),"Chart"]}),i.jsx("button",{type:"button","aria-pressed":s==="table",onClick:()=>o("table"),className:h(s==="table"),children:"Table"})]}),i.jsx("button",{type:"button",onClick:a,"aria-label":"Close",className:"w-[42px] h-[42px] lg:w-8 lg:h-8 rounded-lg border border-border flex items-center justify-center text-slate-500 hover:bg-slate-100 flex-none",children:i.jsx(Ut,{className:"w-4 h-4"})})]})]}),i.jsx("div",{className:"flex gap-6 flex-wrap px-5 py-3.5 bg-surface-2 border-b border-border",children:u.map(p=>i.jsxs("div",{className:"pr-6",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:p.label}),i.jsx("p",{className:`text-lg font-extrabold tracking-tight mt-0.5 tabular-nums ${QDe(p.tone)}`,children:p.value})]},p.label))}),i.jsx("div",{className:"max-h-[440px] overflow-auto px-5 py-4",children:s==="chart"?e.renderChart(t,!0):i.jsx(hW,{...l,caption:`${e.title}, as a table`})}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4 lg:px-5 py-3 border-t border-border bg-surface-2 text-[12px] text-slate-500",children:[i.jsxs("span",{children:[l.rows.length," row",l.rows.length===1?"":"s"]}),i.jsxs("button",{type:"button",onClick:d,className:"inline-flex items-center gap-2 font-semibold px-3 py-1.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 text-[12.5px]",children:[i.jsx(Ble,{className:"h-[14px] w-[14px]"}),"Download CSV"]}),i.jsx(gt,{to:dA(n),className:"ml-auto text-brand font-bold",children:"Open these transactions â"})]})]})})]})}const JDe=12,j0=({label:e,value:t,meta:n})=>i.jsxs("div",{className:"py-3.5",children:[i.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:e}),i.jsx("p",{className:"text-[17px] font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:t}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-0.5",children:n})]});function e$e({merchant:e,insights:t,filters:n,onClose:r}){qo(!0),v.useEffect(()=>{const d=h=>{h.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[r]);const a=v.useMemo(()=>jDe(t,e),[t,e]),{currency:s}=t,o=a.weekly.reduce((d,h)=>Math.max(d,h.moneyOut),0),l=a.rows.slice(0,JDe),u=dA({...n,merchants:[e]});return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 bg-[rgba(17,24,39,0.5)] z-40",onClick:r,"aria-hidden":"true"}),i.jsxs("aside",{role:"dialog","aria-label":`${e} detail`,className:"fixed inset-x-0 bottom-0 top-auto h-[88dvh] rounded-t-[20px] lg:inset-y-0 lg:left-auto lg:right-0 lg:h-auto lg:w-[520px] lg:rounded-none w-full bg-surface z-50 shadow-[-18px_0_48px_rgba(15,23,42,.18)] flex flex-col",children:[i.jsxs("div",{className:"px-4 lg:px-6 pt-5 pb-4 border-b border-border",children:[i.jsxs("div",{className:"flex items-start gap-3.5",children:[i.jsx("span",{className:"w-[46px] h-[46px] rounded-[11px] bg-brand-soft text-brand flex items-center justify-center flex-none",children:i.jsx(Sy,{className:"w-5 h-5"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-xl font-extrabold tracking-tight text-slate-900 truncate",children:e}),i.jsxs("p",{className:"text-[13px] text-slate-500 mt-0.5",children:[Ue(t.window.startDate)," â ",Ue(t.window.endDate)," ·"," ",a.rows.length," transaction",a.rows.length===1?"":"s"]})]}),i.jsx("button",{type:"button",onClick:r,"aria-label":"Close merchant detail",className:"ml-auto w-[42px] h-[42px] lg:w-8 lg:h-8 rounded-[7px] border border-border flex items-center justify-center text-slate-500 hover:bg-slate-100 flex-none",children:i.jsx(Ut,{className:"w-4 h-4"})})]}),a.recurring&&i.jsx("div",{className:"flex gap-1.5 mt-3 flex-wrap",children:i.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-bold bg-brand-soft text-brand",children:[i.jsx(dO,{className:"w-3 h-3"}),"Recurring · ",a.recurring.cadence," · about"," ",ge(a.recurring.typicalAmount,s)]})})]}),i.jsxs("div",{className:"flex-1 overflow-auto px-4 lg:px-6 pt-5 pb-7",children:[i.jsxs("div",{className:"pb-4 border-b border-border",children:[i.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:a.moneyOut>0?"Money out":"Money in"}),i.jsx("p",{className:`text-[34px] leading-none font-extrabold tracking-tight mt-2 ${a.moneyOut>0?"text-amount-neg":"text-amount-pos"}`,children:a.moneyOut>0?Ee(-a.moneyOut,s):ge(a.moneyIn,s)})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-x-4 border-b border-border",children:[i.jsx(j0,{label:"Average charge",value:a.averageSpend===null?je:ge(a.averageSpend,s),meta:`over ${a.spendCount} charge${a.spendCount===1?"":"s"}`}),i.jsx(j0,{label:"Typical gap",value:a.medianGapDays===null?je:`${a.medianGapDays} days`,meta:a.medianGapDays===null?"needs two charges":"between charges"}),i.jsx(j0,{label:"Previous period",value:a.previousMoneyOut===null?je:Ee(-a.previousMoneyOut,s),meta:a.previousMoneyOut===null?"not read yet":a.changePercent===null?"nothing spent here before":`${a.changePercent>0?"+":""}${a.changePercent}% this period`}),i.jsx(j0,{label:"Last seen",value:a.lastDate?Ue(a.lastDate):je,meta:a.firstDate?`first on ${Ue(a.firstDate)}`:""})]}),o>0&&i.jsxs("section",{className:"mt-5",children:[i.jsx("h3",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"Week by week"}),i.jsx("ul",{children:a.weekly.map(d=>i.jsxs("li",{className:"flex items-center gap-2.5 mb-2 last:mb-0",children:[i.jsx("span",{className:"w-[92px] flex-none text-xs text-slate-500",children:Ue(d.weekStart)}),i.jsx("span",{className:"flex-1 h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full rounded-full",style:{width:`${d.moneyOut/o*100}%`,background:Hy}})}),i.jsx("span",{className:"w-[88px] flex-none text-right text-xs font-bold tabular-nums text-slate-900",children:ge(d.moneyOut,s)})]},d.weekStart))})]}),i.jsxs("section",{className:"mt-5",children:[i.jsx("h3",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-1",children:"Transactions"}),i.jsx("ul",{children:l.map(d=>i.jsxs("li",{className:"flex items-center gap-3 py-2.5 border-b border-border last:border-b-0",children:[i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13px] font-semibold text-slate-900",children:Ue(String(d.date).slice(0,10))}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 truncate",children:[d.account_name,d.category].filter(
556Boolean).join(" · ")})]}),i.jsx("span",{className:`text-[13px] font-bold tabular-nums ${Number(d.amount)<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(Number(d.amount),s)})]},d.transaction_id))}),a.rows.length>l.length&&i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-2",children:["Showing the latest ",l.length," of ",a.rows.length,"."]})]})]}),i.jsx("div",{className:"px-6 py-3.5 border-t border-border bg-surface-2",children:i.jsxs(gt,{to:u,className:"text-[12.5px] font-bold text-brand",children:["Open ",e," in Transactions â"]})})]})]})}const t$e=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`;function n$e({uncategorised:e,currency:t,href:n}){const{count:r,amount:a,percent:s,merchants:o}=e;return r===0?null:i.jsxs("div",{role:"status",className:"flex flex-wrap lg:flex-nowrap items-start gap-3 rounded-xl border border-border bg-surface shadow-card px-[18px] py-3.5 mb-4",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-badge-yellow text-badge-yellow-text flex items-center justify-center flex-none",children:i.jsx(Cy,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"min-w-0 flex-1 lg:flex-initial",children:[i.jsxs("p",{className:"text-sm font-bold text-slate-900",children:[r," transaction",r===1?"":"s"," worth ",ge(a,t),s===null?"":` (${s}% of money out)`," ",r===1?"has":"have"," no category"]}),i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-0.5",children:[o.length>0?`Most of it is at ${t$e(o)}. `:"","The category chart can only explain spend that has one."]})]}),i.jsx(gt,{to:n,className:"w-full lg:w-auto lg:ml-auto flex-none self-center inline-flex items-center justify-center min-h-[42px] lg:min-h-0 rounded-lg border border-border lg:border-0 text-[12px] font-bold text-brand whitespace-nowrap",children:"Review in Transactions â"})]})}const r$e=["analyticsSelectedAccounts","analyticsDateRange","analyticsSelectedCategories","analyticsSelectedMerchants","analyticsMinAmount","analyticsMaxAmount","analyticsSelectedPaymentChannels"],a$e=e=>{if(e)try{r$e.forEach(t=>e.removeItem(t))}catch{}},Qd=e=>console.warn(`[AnalyticsPage] ${e}`),Z7=({shown:e,total:t})=>i.jsxs("p",{className:"flex gap-2 items-start rounded-lg bg-badge-blue text-badge-blue-text px-3 py-2.5 mb-4 text-[11.5px] leading-relaxed",children:[i.jsx(na,{className:"w-3.5 h-3.5 flex-none mt-px"}),i.jsxs("span",{children:["The window was truncated â every figure below covers"," ",t>e?`${e} of ${t} transactions`:`the first ${e} transactions`,". Narrow the dates for the full picture."]})]});function s$e(){const[e,t]=v.useState(null),[n,r]=v.useState(null),[a,s]=v.useState(!1),[o,l]=v.useState(null),[u,d]=v.useState(null),h=$n(be=>be.visibleCharts);v.useEffect(()=>{a$e(bC())},[]);const{filters:p,onFiltersChange:g}=JG(Sbe),x=v.useMemo(()=>({...p,status:"all"}),[p]),{accounts:y,selectedAccountIds:w,queryParams:j,data:N,isError:k,error:S,isFetching:E,isUserFetching:O,refetch:T,handleFetch:P,isLoading:M,hasNoAccounts:D,hasNoReadableAccounts:A}=eW(x,{withMatches:!1}),L=v.useMemo(()=>N?.rows??[],[N?.rows]),F=v.useMemo(()=>N?.accountErrors??[],[N?.accountErrors]),B=N?.truncated??!1,U=N?.total??L.length;v.useEffect(()=>{!N||!j||Qd(`window ${j.startDate}..${j.endDate} accounts=${j.accountIds.length} rows=${L.length} total=${U} truncated=${B} unreadable=${F.length}`)},[N,j,L.length,U,B,F.length]);const z=v.useMemo(()=>pu(L,x,!1),[L,x]),{rows:$,window:K}=owe(j,L.length>0),G=v.useMemo(()=>!$||!K?null:pu($,{...x,startDate:K.startDate,endDate:K.endDate},!1),[$,K,x]),W=v.useMemo(()=>o&&cJ(z).some(be=>be.currency===o)?o:null,[o,z]),I=v.useMemo(()=>wDe({rows:z,previousRows:G,previousWindow:K?{startDate:K.startDate,endDate:K.endDate}:null,window:{startDate:x.startDate,endDate:x.endDate},accounts:y,includePending:a,currency:W}),[z,G,K,x.startDate,x.endDate,y,a,W]);v.useEffect(()=>{o&&!W&&(Qd(`currency ${o} has no rows under the current filters â back to ${I.currency}`),l(null))},[o,W,I.currency]);const H=v.useMemo(()=>!u||I.rows.some(be=>br(be)===u),[u,I.rows]);v.useEffect(()=>{H||(Qd(`merchant detail closed: ${u} has no rows under the current filters`),d(null))},[H,u]);const V=v.useCallback(be=>{const Ce=yh(be);
556r(be),g({...x,startDate:Ce.startDate,endDate:Ce.endDate})},[x,g]),X=v.useCallback(()=>{g({...Hf(),startDate:x.startDate,endDate:x.endDate,accountIds:x.accountIds})},[x.startDate,x.endDate,x.accountIds,g]),te=I.pending.count,fe=v.useCallback(()=>{Qd(`pending ${a?"excluded":"included"} count=${te}`),s(!a)},[a,te]),ae=v.useCallback(be=>{Qd(`currency switched to ${be}`),l(be)},[]),ke=v.useMemo(()=>({onSelectMerchant:be=>{Qd(`merchant detail opened: ${be}`),t(null),d(be)}}),[]),xe=v.useMemo(()=>HV(L),[L]),ue=v.useMemo(()=>Wm(L.map(be=>br(be))),[L]),we=v.useMemo(()=>Wm(L.map(be=>be.payment_channel)),[L]),Oe=v.useCallback(be=>pu(L,{...be,status:"all"},!1).length,[L]),ne=v.useMemo(()=>{const be=new Map(y.map(Ce=>[String(Ce.id),Ce.title||Ce.name]));return $be(x,be)},[x,y]),_e=v.useMemo(()=>dA({...x,categories:[fA]}),[x]),ye=e&&z.length>0?zDe[e]??null:null;v.useEffect(()=>{e&&z.length===0&&t(null)},[e,z.length]);const Me=i.jsx(Nwe,{insights:I,onTogglePending:fe,onCurrencyChange:ae});let qe;return k&&!N?qe=i.jsx(B1,{title:"We couldn't load your analytics",body:`The request to Moneylogz failed, so no transactions could be read for ${Ue(x.startDate)} â ${Ue(x.endDate)}. Your accounts and documents are unaffected.`,message:S instanceof Error?S.message:"Failed to fetch transactions",isRetrying:E,onRetry:()=>void T()}):A?qe=i.jsx(sW,{accountCount:y.length}):D?qe=i.jsx(iW,{body:"Moneylogz charts the transactions it reads from your linked banks and cards. Connect one and this screen fills in."}):M?qe=i.jsx(HDe,{startDate:x.startDate,endDate:x.endDate,accountCount:w.length}):L.length===0||z.length===0?qe=i.jsxs(i.Fragment,{children:[Me,B&&i.jsx(Z7,{shown:L.length,total:U}),i.jsx(aW,{errors:F,accounts:y,noun:"connection"}),i.jsx(KDe,{reason:L.length===0?"window":"filters",startDate:x.startDate,endDate:x.endDate,totalCount:L.length,filterDescription:ne,onWidenRange:()=>V("90d"),onClearFilters:X,everyAccountFailed:L.length===0&&F.length>0})]}):qe=i.jsxs("div",{"aria-busy":E,className:E?"opacity-60 transition-opacity":"transition-opacity",children:[Me,B&&i.jsx(Z7,{shown:L.length,total:U}),i.jsx(n$e,{uncategorised:I.uncategorised,currency:I.currency,href:_e}),i.jsx(UDe,{insights:I,visibleCharts:h,accounts:y,accountErrors:F,accountCount:w.length,onExpand:t})]}),i.jsx(tJ.Provider,{value:ke,children:i.jsxs("div",{className:"lg:h-full flex flex-col",children:[i.jsx(jwe,{range:TV({startDate:x.startDate,endDate:x.endDate},new Date,n),onRangeChange:V,startDate:x.startDate,endDate:x.endDate,onFetch:P,isLoading:E||O}),i.jsx(fW,{filters:x,onChange:g,accounts:y,categories:xe,merchants:ue,channels:we,shownCount:z.length,totalCount:L.length,summary:I.summary,showStatus:!1,trailing:null,countFor:Oe}),i.jsx("div",{className:"lg:flex-1 lg:min-h-0 lg:overflow-auto",children:qe}),ye&&i.jsx(ZDe,{definition:ye,insights:I,filters:x,accountCount:w.length,onClose:()=>t(null)}),u&&H&&i.jsx(e$e,{merchant:u,insights:I,filters:x,onClose:()=>d(null)})]})})}const i$e=()=>{const[e,t]=v.useState(null),n=mn(),r=async()=>{await n.invalidateQueries({queryKey:["user"]}),await n.invalidateQueries({queryKey:[Uu]}),await n.invalidateQueries({queryKey:[xh]}),await n.invalidateQueries({queryKey:[Ku]})};return{removeAccount:async s=>{try{t(s),n.setQueriesData({queryKey:["user"]},o=>o&&{...o,accounts:o.accounts.filter(l=>l.id!==s)}),await oxe(s),await r()}catch(o){throw await r(),o}finally{t(null)}},isDeleting:e}},o$e=()=>{const[e,t]=v.useState(null),n=mn(),r=async()=>{await n.invalidateQueries({queryKey:["user"]}),await n.invalidateQueries({queryKey:[xh]}),await n.invalidateQueries({queryKey:[Ku]})};return{editAccountTitle:async(s,o)=>{try{t(s),n.setQueriesData({queryKey:["user"]},l=>l&&{...l,accounts:l.accounts.map(u=>u.id===s?{...u,title:o}:u)}),await lxe(s,o),await r()}catch(l){throw await r(),l}finally{t(null)}},isEditing:e}};function l$e({onRefresh:e,isLoading:t}){return i.jsxs(Vu,{title:"Accounts",subtitle:"Connect and manage your linked bank and investment accounts.",children:[i.jsxs("button",{type:"button",onClick:e,disabled:t,className:"inline-flex items-center gap-2 font-semibold whitespace-nowrap h-[42px] text-sm lg:text-base lg:h-auto px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 disabled:opacity-50",children:[i.jsx(dt,{className:`h-[15px] w-[15px] ${t?"animate-spin":""}`}),"Refresh"]}),i.jsx(Ql,{fullWidthOnMobile:!0,mobileLabel:"Add Account"})]})}function c$e({counts:e,attentionCount:t}){return i.jsx(U1,{tabs:Cwe,tabPath:G1,counts:e,attention:{path:"connections",count:t,label:`${t} connection${t===1?"":"s"} need attention`}})}
556function u$e({rows:e=5,label:t}){return i.jsx(lW,{rows:e,label:t,withHero:!0,ariaLabel:"Loading balances"})}function d$e({message:e,isRetrying:t,onRetry:n}){return i.jsx(B1,{title:"We couldn't load your accounts",body:"The request to Moneylogz failed, so no balances or connections could be read. Your accounts and data are unaffected.",message:e,isRetrying:t,onRetry:n})}const f$e=e=>(e||"?").split(" ").filter(Boolean).slice(0,2).map(t=>t[0]?.toUpperCase()??"").join("")||"?";function h$e({rows:e,total:t,isLoading:n,isError:r,truncated:a=!1,matchesResolved:s}){return r?i.jsx("p",{className:"px-3.5 py-4 text-[12.5px] text-slate-500",children:"Transactions could not be loaded. The balances above are unaffected."}):n?i.jsx("p",{className:"px-3.5 py-4 text-[12.5px] text-slate-500",children:"Loading transactions..."}):e.length===0?i.jsx("p",{className:"px-3.5 py-4 text-[12.5px] text-slate-500",children:"No transactions on this account in the last 30 days."}):i.jsxs(i.Fragment,{children:[e.map(o=>i.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 py-2.5 border-b border-border last:border-b-0",children:[i.jsx("span",{className:"w-[30px] h-[30px] rounded-[7px] bg-surface-muted text-slate-600 flex items-center justify-center text-[10px] font-extrabold flex-none",children:f$e(o.merchant_name||o.name)}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[13px] font-semibold text-slate-900 truncate",children:o.merchant_name||o.name}),i.jsxs("span",{className:"flex items-center gap-1.5 flex-wrap text-[11px] text-slate-500 mt-0.5",children:[i.jsx("span",{children:Ue(o.date)}),o.category&&i.jsxs("span",{children:["· ",o.category]}),s&&(o.match?i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-badge-green text-badge-green-text",children:"Receipt matched"}):i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:"No receipt"}))]})]}),i.jsx("span",{className:`text-[13.5px] font-bold tabular-nums whitespace-nowrap ${o.amount<0?"text-amount-neg":"text-amount-pos"}`,children:ge(o.amount,o.iso_currency_code)})]},o.transaction_id)),(t>e.length||a)&&i.jsxs("p",{className:"px-3.5 py-2.5 text-[11.5px] text-slate-500 bg-surface-2 border-t border-border",children:["Showing the ",e.length," most recent of ",a?`at least ${t}`:t," in the last 30 days."]})]})}function p$e({categories:e,currency:t,isLoading:n,isError:r=!1,truncated:a=!1,limit:s=5}){if(r)return i.jsx("p",{className:"px-4 py-3.5 text-[12.5px] text-slate-500",children:"Spend could not be loaded. The balances above are unaffected."});if(n)return i.jsx("p",{className:"px-4 py-3.5 text-[12.5px] text-slate-500",children:"Loading spend..."});if(e.length===0)return i.jsx("p",{className:"px-4 py-3.5 text-[12.5px] text-slate-500",children:"No spend on this account in the last 30 days."});const o=e.slice(0,s),l=o[0].amount;return i.jsxs("div",{className:"px-4 py-3.5",children:[o.map((u,d)=>i.jsxs("div",{className:"flex items-center gap-2.5 mb-2.5 last:mb-0",children:[i.jsx("span",{className:"w-[92px] flex-none text-xs font-semibold text-slate-600 truncate",children:u.category}),i.jsx("span",{className:"flex-1 h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full",style:{width:l>0?`${u.amount/l*100}%`:"0%",background:gf[d%gf.length]}})}),i.jsx("span",{className:"w-[74px] flex-none text-right text-xs font-bold tabular-nums text-slate-900",children:ge(u.amount,t)})]},u.category)),a&&i.jsx("p",{className:"mt-2.5 text-[11.5px] text-slate-500",children:"Based on part of the last 30 days - this account has more transactions than we could load."})]})}const y5="flex-1 lg:flex-none inline-flex items-center justify-center gap-1.5 rounded-lg border border-border bg-surface px-2 lg:px-3 h-[42px] lg:h-auto lg:py-2 text-xs font-bold whitespace-nowrap hover:bg-slate-100",Zd=({label:e,value:t})=>i.jsxs("div",{className:"flex justify-between gap-3 px-3.5 py-2.5 border-b border-border last:border-b-0 text-[12.5px]",children:[i.jsx("span",{className:"text-slate-500",children:e}),i.jsx("span",{className:"font-bold tabular-nums text-slate-900 text-right",children:t})]}),m$e=[{label:"Display name",hint:"Show your own name for this account across Moneylogz"},{label:"Include in net worth",hint:"Count this account toward the totals on this screen"},{label:"Sync to balances sheet",hint:"Mirror this balance into your Google Sheet"},{label:"Hide from lists",hint:"Keep syncing, but leave it out of the account lists"}];function g$e({row:e,logo:t,state:n,siblingCount:r,isReconnecting:a,onClose:s,onRename:o,onReconnect:l,onRemove:u}){const d=!!e;qo(d),v.useEffect(()=>{if(!d)return;const k=S=>{S.key==="Escape"&&s()};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k)}},[d,s]);const h=Kve({moneylogzAccountId:e?.moneylogz_account_id??null,plaidAccountId:e?.plaid_account_id??null,enabled:d});if(!e)return null;const p=ic[n],g=sc(e),x=Mg(e.current,e.limit),y=RV(x),w=Dg(e),j=An(e.mask),N=!!e.next_payment_due_date||typeof e.minimum_payment_amount=="number";return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-40",onClick:s,"aria-hidden":"true"}),i.jsxs("aside",{role:"dialog","aria-label":`${e.account_name} detail`,className:"fixed top-0 right-0 bottom-0 w-full lg:w-[560px] bg-surface z-50 shadow-[-18px_0_48px_rgba(15,23,42,.18)] flex flex-col",children:[i.jsx("header",{className:"flex-none px-4 pt-[max(16px,env(safe-area-inset-top))] pb-3.5 lg:px-5 lg:pt-5 lg:pb-4 border-b border-border",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ra,{name:e.institution,logo:t,className:"w-[42px] h-[42px]"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-[18px] lg:text-[19px] font-extrabold tracking-tight text-slate-900",children:e.account_name}),i.jsxs("p",{className:"flex items-center gap-2 flex-wrap text-[12.5px] text-slate-500 mt-1",children:[i.jsxs("span",{children:[e.institution,j?` · ${j}`:""]}),i.jsx("span",{className:"inline-flex rounded-full px-2.5 py-0.5 text-[11px] font-bold bg-surface-muted text-slate-600",children:e.subtype??e.type??"account"}),i.jsxs("span",{className:`${ja} ${p.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${p.dotClassName}`}),p.label]})]})]}),i.jsx("button",{type:"button",onClick:s,"aria-label":"Close account detail",className:"ml-auto w-[42px] h-[42px] lg:w-8 lg:h-8 rounded-[7px] border border-border flex items-center justify-center text-slate-500 hover:bg-slate-100 flex-none",children:i.jsx(Ut,{className:"w-4 h-4"})})]})}),i.jsxs("div",{className:"flex-1 min-h-0 overflow-auto overscroll-contain px-4 pt-4 pb-6 lg:px-5 lg:pt-5 lg:pb-7",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Current balance"}),i.jsx("p",{className:`text-[34px] leading-none font-extrabold tracking-tight tabular-nums mt-2 ${g!==null&&g<0?"text-amount-neg":"text-slate-900"}`,children:g===null?je:ge(g,e.currency)}),i.jsx("p",{className:"text-[12.5px] text-slate-500 mt-2",children:g===null?"This institution reported no balance for this account.":e.side==="liability"?"owed to this institution":"held at this institution"}),i.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-2.5 mt-4",children:[i.jsxs("div",{className:"border border-border rounded-[10px] px-3.5 py-3",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:e.side==="liability"?"Available credit":"Available"}),i.jsx("p",{className:"text-[17px] font-extrabold tracking-tight tabular-nums text-slate-900 mt-1.5",children:typeof e.available=="number"?ge(e.available,e.currency):je}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-1",children:typeof e.limit=="number"?`of a ${ge(e.limit,e.currency)} limit`:w?"reported by the institution":"not reported"})]}),i.jsxs("div",{className:"border border-border rounded-[10px] px-3.5 py-3",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Utilisation"}),i.jsx("p",{className:"text-[17px] font-extrabold tracking-tight tabular-nums text-slate-900 mt-1.5",children:x===null?je:`${x}%`}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-1",children:y?lC[y].toLowerCase():"no limit reported"})]}),i.jsxs("div",{className:"col-span-2 lg:col-span-1 border border-border rounded-[10px] px-3.5 py-3",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Statement"}),i.jsx("p",{className:"text-[15px] font-extrabold tracking-tight text-slate-900 mt-1.5",children:e.next_payment_due_date?`Due ${Ue(e.next_payment_due_date)}`:je}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-1",children:typeof e.minimum_payment_amount=="number"?`min ${ge(e.minimum_payment_amount,e.currency)}`:N?"no minimum reported":"not shared by this connection"})]})]}),i.jsxs("section",{className:"mt-5",children:[i.jsx("h3",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"Recent transactions · last 30 days"}),i.jsx("div",{className:"border border-border rounded-[10px] overflow-hidden",children:i.jsx(h$e,{rows:h.data?.recent??[],total:h.data?.total??0,isLoading:h.isFetching&&!h.data,isError:h.isError,truncated:h.data?.truncated??!1,matchesResolved:h.data?.matchesResolved??!1})})]}),i.jsxs("section",{className:"mt-5",children:[i.jsx("h3",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"Spend by category · last 30 days"}),i.jsx("div",{className:"border border-border rounded-[10px] overflow-hidden",children:i.jsx(p$e,{categories:h.data?.categories??[],currency:e.currency,isLoading:h.isFetching&&!h.data,isError:h.isError,truncated:h.data?.truncated??!1})})]}),i.jsxs("section",{className:"mt-5",children:[i.jsx("h3",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"Account details"}),i.jsxs("div",{className:"border border-border rounded-[10px] overflow-hidden",children:[i.jsx(Zd,{label:"Type · subtype",value:`${e.type??je} · ${e.subtype??je}`}),i.jsx(Zd,{label:"Currency",value:e.currency}),i.jsx(Zd,{label:"Rate",value:typeof e.apr_percentage=="number"?`${e.apr_percentage}%`:je}),i.jsx(Zd,{label:"Credit limit",value:typeof e.limit=="number"?ge(e.limit,e.currency):je}),i.jsx(Zd,{label:"Last statement",value:typeof e.last_statement_balance=="number"?ge(e.last_statement_balance,e.currency):je}),i.jsx(Zd,{label:"Connection",value:`${e.connection_title} · ${r} account${r===1?"":"s"}`})]})]}),i.jsxs("section",{className:"mt-5",children:[i.jsx("h3",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"This account"}),i.jsx("fieldset",{disabled:!0,"aria-describedby":"sub-account-settings-pending",className:"border border-border rounded-[10px] overflow-hidden opacity-60",children:m$e.map(k=>i.jsxs("div",{className:"flex justify-between items-center gap-3 px-3.5 py-2.5 border-b border-border last:border-b-0",children:[i.jsxs("span",{className:"text-[12.5px]",children:[i.jsx("span",{className:"block text-slate-500",children:k.label}),i.jsx("span",{className:"block text-[11px] text-slate-400 mt-0.5",children:k.hint})]}),i.jsx("button",{type:"button",disabled:!0,"aria-label":`${k.label} (coming soon)`,className:"w-[34px] h-[19px] rounded-full bg-slate-300 relative flex-none cursor-not-allowed",children:i.jsx("span",{className:"absolute top-0.5 left-0.5 w-[15px] h-[15px] rounded-full bg-white"})})]},k.label))}),i.jsxs("p",{id:"sub-account-settings-pending",className:"flex gap-2.5 items-start bg-brand-soft text-blue-900 rounded-lg px-3 py-2.5 text-[12.5px] leading-relaxed mt-2.5",children:[i.jsx(na,{className:"w-[15px] h-[15px] flex-none mt-px"}),i.jsx("span",{children:"Per-account settings are coming soon. Balance and available credit come straight from the institution at each sync â Moneylogz never edits them."})]})]})]}),i.jsxs("footer",{className:"flex-none border-t border-border px-4 pt-3 pb-[max(14px,env(safe-area-inset-bottom))] lg:px-5 lg:py-3.5 flex gap-2 items-center bg-surface-2 lg:flex-wrap",children:[i.jsxs("button",{type:"button",onClick:o,className:`${y5} text-slate-900`,children:[i.jsx(Si,{className:"w-3 h-3"}),i.jsx("span",{className:"lg:hidden",children:"Rename"}),i.jsx("span",{className:"hidden lg:inline",children:"Rename connection"})]}),i.jsxs("button",{type:"button",onClick:l,disabled:a,className:`${y5} text-slate-900 disabled:opacity-50`,children:[a?i.jsx(Dt,{size:"sm",className:"text-brand"}):i.jsx(Zs,{className:"w-3 h-3"}),a?"Reconnecting...":i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"lg:hidden",children:"Re-auth"}),i.jsx("span",{className:"hidden lg:inline",children:"Re-authenticate"})]})]}),i.jsxs("button",{type:"button",onClick:u,className:`${y5} text-amount-neg`,children:[i.jsx(Ya,{className:"w-3 h-3"}),i.jsx("span",{className:"lg:hidden",children:"Remove"}
556),i.jsx("span",{className:"hidden lg:inline",children:"Remove connection"})]}),i.jsxs("span",{className:"ml-auto hidden lg:inline text-[11.5px] text-slate-500",children:["Affects all ",r," account",r===1?"":"s"," on ",e.connection_title,"."]})]})]})]})}function x$e({isOpen:e,accountTitle:t,onConfirm:n,onCancel:r,isDeleting:a}){return i.jsxs(qt,{show:e,onClose:r,size:"md",position:"center",dismissible:!0,theme:Gu,children:[i.jsx(qt.Header,{className:"dialog-header",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"dialog-header-icon",children:i.jsx(Jt,{})}),i.jsxs("div",{children:[i.jsx("h3",{className:"dialog-header-title",children:"Remove Account"}),i.jsx("p",{className:"dialog-header-subtitle",children:"This action cannot be undone"})]})]})}),i.jsx(qt.Body,{className:"dialog-body",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("p",{className:"text-slate-900",children:["Are you sure you want to remove ",i.jsx("span",{className:"font-semibold",children:t}),"?"]}),i.jsxs("div",{className:"dialog-warning-box",children:[i.jsx("p",{className:"text-sm text-slate-500",children:"This will:"}),i.jsxs("ul",{className:"dialog-warning-list",children:[i.jsx("li",{children:"⢠Disconnect the account from your profile"}),i.jsx("li",{children:"⢠Remove all associated transaction data"}),i.jsx("li",{children:"⢠Cancel any scheduled syncs"})]})]})]})}),i.jsx(qt.Footer,{className:"dialog-footer",children:i.jsxs("div",{className:lc,children:[i.jsx(mt,{color:"gray",onClick:r,disabled:a,className:"dialog-cancel-button",children:"Cancel"}),i.jsx(mt,{color:"failure",onClick:n,disabled:a,className:"dialog-confirm-button",children:a?"Removing...":"Remove Account"})]})})]})}function b$e({isOpen:e,currentTitle:t,accountCount:n,isSaving:r,onConfirm:a,onCancel:s}){const[o,l]=v.useState(t);v.useEffect(()=>{e&&l(t)},[e,t]);const u=o.trim(),d=u.length>0&&u!==t&&!r;return i.jsxs(qt,{show:e,onClose:s,size:"md",position:"center",dismissible:!0,theme:Gu,children:[i.jsx(qt.Body,{children:i.jsxs("div",{className:"flex items-start gap-3.5",children:[i.jsx("span",{className:"w-10 h-10 rounded-[10px] bg-brand-soft text-brand flex items-center justify-center flex-none",children:i.jsx(Si,{className:"w-[18px] h-[18px]"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h3",{className:"text-base font-extrabold tracking-tight text-slate-900",children:"Rename connection"}),i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-1",children:["This is the name Moneylogz shows for the whole connection and its ",n," account",n===1?"":"s",". It does not change anything at your bank."]}),i.jsx(bO,{className:"mt-3.5",value:o,autoFocus:!0,onChange:h=>l(h.target.value),onKeyDown:h=>{h.key==="Enter"&&d&&a(u),h.key==="Escape"&&s()}})]})]})}),i.jsx(qt.Footer,{children:i.jsxs("div",{className:lc,children:[i.jsx(mt,{color:"gray",onClick:s,disabled:r,children:"Cancel"}),i.jsxs(mt,{color:"blue",onClick:()=>a(u),disabled:!d,children:[r?i.jsx(Dt,{size:"sm",className:"mr-2"}):null,r?"Saving...":"Save name"]})]})})]})}function y$e(){const[e,t]=v.useState(null),[n,r]=v.useState(null),[a,s]=v.useState(null),{pathname:o}=Gr(),l=iV(),{data:u,isError:d,error:h,isFetching:p,refetch:g}=l,x=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),y=mn(),w=v.useMemo(()=>x.data?.accounts??[],[x.data?.accounts]),j=v.useMemo(()=>x.data?.logos??{},[x.data?.logos]),{removeAccount:N,isDeleting:k}=i$e(),{editAccountTitle:S,isEditing:E}=o$e(),{startReconnect:O,isReconnecting:T}=mA({onReconnected:()=>g()}),[P,M]=v.useState(null);v.useEffect(()=>{T===null&&M(null)},[T]);const D=v.useCallback((be,Ce)=>{M(be),O(be,Ce)},[O]),A=v.useMemo(()=>u?.balances??[],[u?.balances]),L=v.useMemo(()=>IV(u?.errors),[u?.errors]),F=v.useMemo(()=>LV(w,L),[w,L]),B=v.useMemo(()=>new Set(F.map(be=>be.account.id)),[F]),U=v.useMemo(()=>new Map(w.map(be=>[be.id,be.institution_id])),[w]),z=DV(u?.totals_by_currency),$=v.useMemo(()=>ube(A,u?.totals_by_type),[A,u?.totals_by_type]),K=v.useMemo(()=>fbe(w,A,L),[w,A,L]),G=v.useMemo(()=>A.filter(be=>be.group==="cash"&&be.currency===z),[A,z]),W=v.useMemo(()=>[...new Set(G.map(be=>be.moneylogz_account_id))],[G]),I=v.useMemo(()=>[...new Set(G.map(be=>be.plaid_account_id))],[G]),H=v.useMemo(()=>(u?.totals_by_type??[]).find(Ce=>Ce.group==="cash")?.totals.find(Ce=>Ce.currency===z)?.total??null,[u?.totals_by_type,z]),{runway:V}=AV({accountIds:W,plaidAccountIds:I,cash:H}),X=v.useMemo(()=>A.find(be=>be.plaid_account_id===e)??null,[A,e]),te=v.useMemo(()=>X?A.filter(be=>be.moneylogz_account_id===X.moneylogz_account_id).length:0,[A,X]),fe=v.useCallback(be=>w.find(Ce=>Ce.id===be)??null,[w]),ae=fe(n),ke=fe(a),xe=v.useCallback(async()=>{await Promise.allSettled([g(),x.refetch(),y.invalidateQueries({queryKey:[Ku]})])},[g,x,y]),ue=async()=>
556{if(n!==null)try{await N(n),t(null),r(null)}catch{alert("Failed to remove account. Please try again.")}},we=async be=>{if(a!==null)try{await S(a,be),s(null)}catch{alert("Failed to rename account. Please try again.")}},Oe=!u&&!d,ne=d&&!!u,_e=o.startsWith(G1("connections")),ye=!!u?.empty_reason&&!(_e&&w.length>0),Me=v.useMemo(()=>({data:u,balances:A,accounts:w,logos:j,groups:$,connections:K,attention:F,errorsById:L,staleAccountIds:B,institutionIdByAccount:U,currency:z,runway:V,cashTotal:H,onSelectSubAccount:t,onReconnect:O,onAddProducts:D,isReconnecting:T,addingProductsId:P,onRename:s,onRemove:r,onRetry:()=>g(),isRefreshing:p}),[u,A,w,j,$,K,F,L,B,U,z,V,H,O,D,T,P,g,p]);let qe;return Oe?qe=i.jsx(u$e,{label:"Fetching balances from your connected accounts"}):d&&!u?qe=i.jsx(d$e,{message:h instanceof Error?h.message:"Failed to fetch balances",isRetrying:p,onRetry:()=>g()}):ye?qe=i.jsx(H0e,{reason:u.empty_reason,connectionCount:w.length}):qe=i.jsx(yg,{context:Me}),i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx(l$e,{onRefresh:xe,isLoading:p||x.isFetching}),ne&&i.jsx(Ay,{color:"warning",icon:Qt,className:"mb-[18px]",children:i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsxs("span",{className:"text-sm",children:["Could not refresh your balances â"," ",h instanceof Error?h.message:"Failed to fetch balances",". Showing the last successful snapshot."]}),i.jsx(mt,{size:"xs",color:"warning",disabled:p,onClick:()=>g(),className:"ml-auto",children:p?"Retrying...":"Try Again"})]})}),i.jsx(c$e,{counts:{all:u?.count,connections:w.length||void 0},attentionCount:F.length}),i.jsx("div",{className:"flex-1 min-h-0",children:qe}),i.jsx(g$e,{row:X,logo:j[U.get(X?.moneylogz_account_id??-1)??""],state:P1(fe(X?.moneylogz_account_id??null)?.status,L.get(X?.moneylogz_account_id??-1)),siblingCount:te,isReconnecting:T===X?.moneylogz_account_id,onClose:()=>t(null),onRename:()=>s(X?.moneylogz_account_id??null),onReconnect:()=>{X&&O(X.moneylogz_account_id)},onRemove:()=>r(X?.moneylogz_account_id??null)}),i.jsx(x$e,{isOpen:n!==null,accountTitle:ae?.title??"",onConfirm:ue,onCancel:()=>r(null),isDeleting:k===n}),i.jsx(b$e,{isOpen:a!==null,currentTitle:ke?.title??"",accountCount:A.filter(be=>be.moneylogz_account_id===a).length,isSaving:E===a,onConfirm:we,onCancel:()=>s(null)})]})}function v$e({entries:e,logos:t,isReconnecting:n,onReconnect:r,onRetry:a,isRefreshing:s}){return e.length===0?null:i.jsxs("section",{className:"rounded-xl border border-red-200 bg-surface shadow-card overflow-hidden mb-4",children:[i.jsxs("header",{className:"flex items-center flex-wrap gap-x-2.5 gap-y-1 px-4 lg:px-[18px] py-3 bg-surface-2 border-b border-border",children:[i.jsx(Jt,{className:"w-4 h-4 text-badge-red-text"}),i.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-slate-900",children:"Needs your attention"}),i.jsx("span",{className:"text-[11px] font-extrabold rounded-full px-2 py-0.5 bg-badge-red text-badge-red-text",children:e.length}),i.jsx("span",{className:"w-full lg:w-auto lg:ml-auto text-xs text-slate-500",children:"Balances below are not counted until these are fixed"})]}),e.map(({account:o,state:l,error:u})=>{const d=bA[l],h=ic[l];return i.jsxs("article",{className:"px-4 lg:px-[18px] py-4 border-b border-border last:border-b-0",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ra,{name:o.name,logo:t[o.institution_id],className:"w-[34px] h-[34px]"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("p",{className:"flex items-center gap-2.5 flex-wrap",children:[i.jsx("span",{className:"text-[14.5px] font-extrabold tracking-tight text-slate-900",children:o.title}),i.jsxs("span",{className:`${ja} ${h.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${h.dotClassName}`}),h.label]})]}),i.jsx("p",{className:"text-[12.5px] text-slate-500 mt-0.5",children:o.name})]})]}),i.jsxs("p",{className:`flex gap-2.5 items-start rounded-lg px-3 py-2.5 mt-3 text-[12.5px] leading-relaxed ${R1[l]}`,children:[i.jsx(d,{className:"w-[15px] h-[15px] flex-none mt-px"}),i.jsx("span",{children:u?.error??M1[l]})]}),i.jsx("div",{className:"flex flex-col gap-2 mt-3 lg:flex-row lg:flex-wrap",children:l==="preparing"?i.jsxs("button",{type:"button",onClick:a,disabled:s,className:"inline-flex items-center justify-center gap-1.5 rounded-lg border border-border bg-surface px-3 h-[42px] lg:h-auto lg:justify-start py-1.5 text-xs font-bold text-slate-600 hover:bg-slate-100 disabled:opacity-50",children:[i.jsx(dt,{className:`w-3 h-3 ${s?"animate-spin":""}`}),s?"Checking...":"Try again"]}):i.jsxs("button",{type:"button",onClick:()=>r(o.id),disabled:n===o.id,className:"inline-flex items-center justify-center gap-1.5 rounded-lg border border-brand bg-brand px-3 h-[42px] lg:h-auto lg:justify-start py-1.5 text-xs font-bold text-white hover:bg-brand-hover disabled:opacity-50",children:[n===o.id?i.jsx(Dt,{size:"sm",className:"text-white"}):i.jsx(Zs,{className:"w-3 h-3"}),n===o.id?"Reconnecting...":`Reconnect ${o.name}`]})})]},o.id)})]})}function w$e({totals:e}){return!e||e.length<2?null:i.jsxs("section",{className:"mb-4",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:"Totals by currency"}),i.jsx("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-3",children:e.map(t=>i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card p-4",children:[i.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-surface-muted px-2.5 py-1 text-[11px] font-extrabold tracking-wide text-slate-500",children:[i.jsx(qU,{className:"w-3 h-3"}),t.currency," · ",t.accounts," account",t.accounts===1?"":"s"]}),i.jsx("p",{className:"text-[22px] font-extrabold tracking-tight tabular-nums text-slate-900 mt-2.5",children:ge(t.net,t.currency)}),i.jsxs("dl",{className:"mt-3 pt-2.5 border-t border-border text-[12.5px]",children:[i.jsxs("div",{className:"flex justify-between py-1",children:[i.jsx("dt",{className:"text-slate-500",children:"Assets"}),i.jsx("dd",{className:"font-bold tabular-nums",children:ge(t.assets,t.currency)})]}),i.jsxs("div",{className:"flex justify-between py-1",children:[i.jsx("dt",{className:"text-slate-500",children:"Liabilities"}),i.jsx("dd",{className:"font-bold tabular-nums text-amount-neg",children:ge(t.liabilities,t.currency)})]})]}),t.partial&&i.jsx("p",{className:"text-[11px] text-badge-yellow-text mt-2",children:"An account in this currency reported no balance."})]},t.currency))}),i.jsxs("p",{className:"flex gap-2 items-center text-xs text-slate-500 mt-2.5",children:[i.jsx(na,{className:"w-3.5 h-3.5 flex-none"}),"No conversion is applied â each currency keeps its own total."]})]})}const J7={cash:lO,credit:ea,investments:zi,loans:ea,other:e1},eF={cash:"bg-surface-muted text-slate-600",credit:"bg-badge-red text-badge-red-text",investments:"bg-badge-green text-badge-green-text",loans:"bg-badge-yellow text-badge-yellow-text",other:"bg-surface-muted text-slate-500"};function j$e({row:e,logo:t,groupTotal:n,isStale:r,onSelect:a}){const s=J7[e.group]??J7.other,o=sc(e),l=cbe(e.current,n),u=Mg(e.current,e.limit),d=Dg(e),h=A1(e),p=MV(e),g=An(e.mask);return i.jsxs("button",{type:"button",onClick:a,className:"w-full flex items-center gap-2.5 lg:gap-3 px-4 lg:px-[18px] py-[11px] border-b border-border last:border-b-0 text-left hover:bg-surface-2 transition-colors",children:[i.jsx(ra,{name:e.institution,logo:t,className:"w-[26px] h-[26px]"}),i.jsx("span",{className:`w-[26px] h-[26px] rounded-[7px] flex-none flex items-center justify-center ${eF[e.group]??eF.other}`,children:i.jsx(s,{className:"w-[15px] h-[15px]"})}),i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:e.account_name}),i.jsxs("span",{className:"flex items-center gap-[7px] flex-wrap text-[11.5px] text-slate-500 mt-0.5",children:[i.jsxs("span",{className:"truncate",children:[e.institution,g?` ${g}`:""]}),i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:e.subtype??e.type??"account"}),p&&i.jsx("span",{className:"font-bold text-amount-pos",children:p}),h&&i.jsx("span",{children:h})]})]}),i.jsx("span",{className:"w-[132px] flex-none hidden lg:block",children:l===null?i.jsx("span",{className:"block text-[10.5px] text-slate-400",children:"share unavailable"}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"block h-1.5 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("span",{className:"block h-full bg-brand",style:{width:`${Math.min(l,100)}%`}})}),i.jsxs("span",{className:"block text-[10.5px] text-slate-500 mt-1",children:[l,"% of group"]})]})}),i.jsxs("span",{className:"flex-none text-right lg:w-[148px]",children:[i.jsx("span",{className:`block text-[14px] font-bold tabular-nums ${r?"text-slate-400":o!==null&&o<0?"text-amount-neg":"text-slate-900"}`,children:o===null?je:ge(o,e.currency)}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 mt-0.5 tabular-nums",children:r?"last known":u!==null?`${u}% of ${ge(e.limit,e.currency)}`:d??je})]})]})}const tF={cash:lO,credit:ea,investments:zi,loans:ea,other:e1},nF={cash:"bg-brand-soft text-brand",credit:"bg-badge-red text-badge-red-text",investments:"bg-badge-green text-badge-green-text",loans:"bg-badge-yellow text-badge-yellow-text",other:"bg-surface-muted text-slate-500"};function N$e({view:e,logos:t,institutionIdByAccount:n,staleAccountIds:r,currency:a,onSelect:s}){const o=tF[e.group]??tF.other,l=$V(e.totals,a),u=e.totals.filter(d=>d.currency!==l?.currency);return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden mb-4",children:[i.jsxs("header",{className:"flex items-center gap-3 px-4 lg:px-[18px] py-3.5 bg-surface-2 border-b border-border",children:[i.jsx("span",{className:`w-[30px] h-[30px] rounded-lg flex-none flex items-center justify-center ${nF[e.group]??nF.other}`,children:i.jsx(o,{className:"w-[15px] h-[15px]"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-slate-900",children:e.label}),i.jsxs("p",{className:"text-xs text-slate-500 mt-px",children:[e.accounts," account",e.accounts===1?"":"s"," · ",e.institutions," institution",e.institutions===1?"":"s"]})]}),i.jsxs("div",{className:"ml-auto text-right",children:[i.jsx("p",{className:`text-base font-extrabold tabular-nums ${l&&l.total<0?"text-amount-neg":"text-slate-900"}`,children:l?ge(l.total,l.currency):je}),u.length>0&&i.jsx("p",{className:"text-[11px] text-slate-500 mt-px tabular-nums",children:u.map(d=>ge(d.total,d.currency)).join(" · ")})]})]}),e.rows.map(d=>i.jsx(j$e,{row:d,logo:t[n.get(d.moneylogz_account_id)??""],groupTotal:e.totals.find(h=>h.currency===d.currency)?.total??null,isStale:r.has(d.moneylogz_account_id),onSelect:()=>s(d.plaid_account_id)},d.plaid_account_id)),(e.partial||e.group==="other")&&i.jsxs("p",{className:"flex gap-2.5 items-start px-4 lg:px-[18px] py-2.5 bg-surface-2 border-t border-border text-xs text-slate-500 leading-relaxed",children:[i.jsx(na,{className:"w-3.5 h-3.5 flex-none mt-px text-slate-400"}),i.jsx("span",{children:e.group==="other"?lbe:"An account in this group reported no balance, so the total above does not cover all of them."})]})]})}const zP=()=>Gv();function _$e(){const{data:e,logos:t,groups:n,attention:r,staleAccountIds:a,institutionIdByAccount:s,currency:o,runway:l,cashTotal:u,onSelectSubAccount:d,onReconnect:h,isReconnecting:p,onRetry:g,isRefreshing:x}=zP(),y=T1(e.totals_by_currency,o),w=(e.totals_by_currency??[]).filter(N=>N.currency!==o),j={excluded:(e.excluded_accounts??[]).filter(N=>!a.has(N.moneylogz_account_id)),errors:(e.errors??[]).filter(N=>!a.has(N.moneylogz_account_id))};return i.jsxs(i.Fragment,{children:[i.jsx(v$e,{entries:r,logos:t,isReconnecting:p,onReconnect:h,onRetry:g,isRefreshing:x}),i.jsx(oG,{excluded:j.excluded,errors:j.errors,hasPartialCurrency:cA(e.totals_by_currency)}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1.7fr_1fr] mb-4",children:[i.jsx(iG,{totals:y,currency:o,otherCurrencies:w,totalsByType:e.totals_by_type}),i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsx(NA,{totals:y}),i.jsx(_A,{utilisation:Gy(e.credit_utilisation,o)}),i.jsx(kA,{runway:l,cash:u,currency:o})]})]}),i.jsx(w$e,{totals:e.totals_by_currency}),n.map(N=>i.jsx(N$e,{view:N,logos:t,institutionIdByAccount:s,staleAccountIds:a,currency:o,onSelect:d},N.group))]})}function k$e({totals:e,utilisation:t,currency:n,excludedCount:r}){return i.jsxs(wh,{className:"mb-4",children:[i.jsxs(On,{label:`Net worth${n?` · ${n}`:""}`,children:[i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:e?ge(e.net,e.currency):je}),i.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:e?`${e.accounts} account${e.accounts===1?"":"s"}`:"nothing reported yet"})]}),i.jsx(On,{label:"Assets",children:i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:e?ge(e.assets,e.currency):je})}),i.jsx(On,{label:"Liabilities",children:i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-amount-neg",children:e?ge(e.liabilities,e.currency):je})}),i.jsxs(On,{label:"Credit used",children:[i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:t?.percent===null||t===null?je:`${t.percent}%`}),i.jsx("p",{className:"text-xs text-slate-500 mt-0.5 tabular-nums",children:t&&t.percent!==null?`${ge(t.used,t.currency)} of ${ge(t.limit,t.currency)}`:"no card reported a limit"})]}),r>0&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-bold rounded-full px-2.5 py-1 bg-surface-muted text-slate-600 self-center flex-none whitespace-nowrap mx-4 lg:mx-0",children:[i.jsx(na,{className:"w-3 h-3"}),r," not counted"]})]})}const rF=e=>["inline-flex flex-none items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs font-bold whitespace-nowrap transition-colors",e?"border-brand bg-brand-soft text-brand":"border-border bg-surface text-slate-600 hover:bg-slate-100"].join(" "),aF=e=>["inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-bold transition-colors",e?"bg-surface-muted text-slate-900":"text-slate-500 hover:text-slate-900"].join(" ");function S$e({search:e,onSearchChange:t,group:n,onGroupChange:r,groupCounts:a,totalCount:s,attentionCount:o,currency:l,currencies:u,onCurrencyChange:d,view:h,onViewChange:p}){return i.jsxs("div",{className:"flex flex-col gap-2.5 mb-4 lg:flex-row lg:items-center lg:gap-3 lg:flex-wrap",children:[i.jsxs("label",{className:"relative flex items-center w-full lg:w-auto",children:[i.jsx(uh,{className:"w-[15px] h-[15px] text-slate-400 absolute left-3"}),i.jsx("span",{className:"sr-only",children:"Search accounts"}
556),i.jsx("input",{type:"search",value:e,onChange:g=>t(g.target.value),placeholder:"Search institutions or accounts",className:"w-full h-[42px] lg:h-auto lg:w-[260px] rounded-lg border border-border bg-surface pl-9 pr-3 py-2 text-[13px] text-slate-900 placeholder:text-slate-400 focus:border-brand focus:ring-0"})]}),i.jsxs("div",{className:"flex items-center gap-2 flex-nowrap overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden -mx-4 px-4 lg:contents",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-nowrap lg:flex-wrap",children:[i.jsxs("button",{type:"button",onClick:()=>r(null),className:rF(n===null),children:["All ",i.jsx("span",{className:"tabular-nums",children:s})]}),oC.filter(g=>(a[g]??0)>0).map(g=>i.jsxs("button",{type:"button",onClick:()=>r(g),className:rF(n===g),children:[Vy[g]," ",i.jsx("span",{className:"tabular-nums",children:a[g]})]},g)),o>0&&i.jsxs("span",{className:"inline-flex flex-none items-center gap-1.5 rounded-full border border-badge-red bg-badge-red px-3 py-1.5 text-xs font-bold text-badge-red-text whitespace-nowrap",children:["Needs attention ",i.jsx("span",{className:"tabular-nums",children:o})]})]}),u.length>1&&i.jsxs("label",{className:"flex flex-none items-center gap-2 text-xs font-semibold text-slate-500 whitespace-nowrap",children:["Currency",i.jsxs("select",{value:l??"",onChange:g=>d(g.target.value||null),className:"rounded-lg border border-border bg-surface px-2.5 py-1.5 text-[13px] font-semibold text-slate-900 focus:border-brand focus:ring-0",children:[i.jsx("option",{value:"",children:"All currencies"}),u.map(g=>i.jsx("option",{value:g,children:g},g))]})]})]}),i.jsxs("div",{className:"ml-auto hidden lg:flex items-center gap-0.5 rounded-lg border border-border p-1",children:[i.jsxs("button",{type:"button",onClick:()=>p("cards"),"aria-pressed":h==="cards",className:aF(h==="cards"),children:[i.jsx(sce,{className:"w-3.5 h-3.5"}),"Cards"]}),i.jsxs("button",{type:"button",onClick:()=>p("table"),"aria-pressed":h==="table",className:aF(h==="table"),children:[i.jsx(cce,{className:"w-3.5 h-3.5"}),"Table"]})]})]})}function C$e({row:e,isStale:t,lastUpdate:n,onSelect:r}){const a=sc(e),s=Mg(e.current,e.limit),o=Dg(e),l=A1(e),u=MV(e),d=An(e.mask),h=t?dbe:ic.active;return i.jsxs("tr",{className:"border-b border-border last:border-b-0 hover:bg-surface-2",children:[i.jsx("td",{className:"w-[34px]"}),i.jsxs("td",{className:"px-3 py-2.5",children:[i.jsx("span",{className:"block text-[13px] font-semibold text-slate-900",children:e.account_name}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 mt-0.5",children:[d,u,l].filter(
556Boolean).join(" · ")||e.institution})]}),i.jsx("td",{className:"px-3 py-2.5",children:i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:e.subtype??e.type??"account"})}),i.jsx("td",{className:`px-3 py-2.5 text-right text-[13px] font-bold tabular-nums ${t?"text-slate-400":a!==null&&a<0?"text-amount-neg":"text-slate-900"}`,children:a===null?je:ge(a,e.currency)}),i.jsx("td",{className:"px-3 py-2.5 text-right text-[12.5px] text-slate-500 tabular-nums",children:o===null?je:ge(e.available,e.currency)}),i.jsx("td",{className:"px-3 py-2.5 text-right text-[12.5px] text-slate-500 tabular-nums",children:s===null?je:i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"block",children:[s,"% of ",ge(e.limit,e.currency)]}),i.jsx("span",{className:"block h-1.5 w-full rounded-full bg-surface-muted overflow-hidden mt-1",children:i.jsx("span",{className:`block h-full ${t?"bg-slate-300":"bg-brand"}`,style:{width:`${Math.min(s,100)}%`}})})]})}),i.jsx("td",{className:"px-3 py-2.5",children:i.jsxs("span",{className:`${ja} ${h.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${h.dotClassName}`}),h.label]})}),i.jsx("td",{className:"px-3 py-2.5 text-[12.5px] text-slate-500",children:n??je}),i.jsx("td",{className:"px-3 py-2.5 text-right",children:i.jsx("button",{type:"button",onClick:r,className:"text-xs font-bold text-brand hover:underline",children:"Details"})})]})}const v5="inline-flex items-center justify-center w-[30px] h-[30px] rounded-[7px] text-slate-500 hover:bg-slate-100 hover:text-slate-900 transition-colors";function E$e({view:e,rows:t,hasFilter:n,logo:r,isExpanded:a,onToggle:s,onSelectSubAccount:o,onReconnect:l,onRename:u,onRemove:d}){const{account:h,state:p,totals:g,partial:x}=e,y=ic[p],w=qf(p),j=g[0]??null,N=nA(h.updated_at),k=a?Ca:va;return i.jsxs(i.Fragment,{children:[i.jsxs("tr",{className:"bg-surface-2 border-b border-border",children:[i.jsx("td",{className:"w-[34px] pl-3",children:i.jsx("button",{type:"button",onClick:s,"aria-expanded":a,"aria-label":`${a?"Collapse":"Expand"} ${h.title||h.name}`,className:"text-slate-500 hover:text-slate-900",children:i.jsx(k,{className:"w-4 h-4"})})}),i.jsx("td",{className:"px-3 py-3",children:i.jsxs("span",{className:"flex items-center gap-2.5",children:[i.jsx(ra,{name:h.name,logo:r,className:"w-[26px] h-[26px]"}),i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-extrabold tracking-tight text-slate-900",children:h.title||h.name}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500",children:[h.name," · ",e.subAccounts," account",e.subAccounts===1?"":"s"]})]})]})}),i.jsx("td",{className:"px-3 py-3 text-[12px] text-slate-500 capitalize",children:e.products.join(", ")||je}),i.jsxs("td",{className:"px-3 py-3 text-right",children:[i.jsx("span",{className:`block text-[13.5px] font-extrabold tabular-nums ${w?"text-slate-400":j&&j.net<0?"text-amount-neg":"text-slate-900"}`,children:j?ge(j.net,j.currency):je}),g.length>1&&i.jsx("span",{className:"block text-[11px] text-slate-500 mt-px tabular-nums",children:g.slice(1).map(S=>ge(S.net,S.currency)).join(" · ")}),x&&i.jsx("span",{className:"block text-[11px] text-slate-500 mt-px",children:"partial"})]}),i.jsx("td",{className:"px-3 py-3 text-right text-[12.5px] text-slate-400",children:je}),i.jsx("td",{className:"px-3 py-3 text-right text-[12.5px] text-slate-400",children:je}),i.jsx("td",{className:"px-3 py-3",children:i.jsxs("span",{className:`${ja} ${y.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${y.dotClassName}`}),y.label]})}),i.jsx("td",{className:"px-3 py-3 text-[12.5px] text-slate-500",children:N??je}),i.jsx("td",{className:"px-3 py-3",children:i.jsxs("span",{className:"flex items-center justify-end gap-0.5",children:[i.jsx("button",{type:"button",onClick:u,"aria-label":`Rename ${h.title||h.name}`,className:v5,children:i.jsx(Si,{className:"w-3.5 h-3.5"})}),i.jsx("button",{type:"button",onClick:l,"aria-label":`Reconnect ${h.title||h.name}`,className:v5,children:i.jsx(Zs,{className:"w-3.5 h-3.5"})}),i.jsx("button",{type:"button",onClick:d,"aria-label":`Remove ${h.title||h.name}`,className:v5,children:i.jsx(Ya,{className:"w-3.5 h-3.5"})})]})})]}),a&&t.length===0&&i.jsx("tr",{className:"border-b border-border",children:i.jsx("td",{colSpan:9,className:"px-[46px] py-3 text-[12.5px] text-slate-500",children:w?"This connection reported no balances on the last refresh.":n?"No account in this connection matches the current filters.":"This connection returned no sub-accounts on the last refresh."})}),a&&t.map(S=>i.jsx(C$e,{row:S,isStale:w,lastUpdate:N,onSelect:()=>o(S.plaid_account_id)},S.plaid_account_id))]})}const Cl="px-3 py-2.5 text-[11px] font-bold uppercase tracking-[0.08em] text-slate-400";function O$e({views:e,rowsByAccount:t,hasFilter:n,logos:r,institutionIdByAccount:a,onSelectSubAccount:s,onReconnect:o,onRename:l,onRemove:u}){const[d,h]=v.useState([]),p=d.length===0,g=e.map(N=>zV(N,t.get(N.account.id)??[])),x=g.filter(N=>N.state==="active"),y=pbe(x),w=g.length-x.length,j=g.reduce((N,k
556)=>N+k.rows.length,0);return i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[i.jsxs("button",{type:"button",onClick:()=>h(p?e.map(N=>N.account.id):[]),className:"flex items-center gap-2 text-sm font-semibold text-slate-500 hover:text-slate-900",children:[p?i.jsx(Ca,{className:"w-4 h-4"}):i.jsx(va,{className:"w-4 h-4"}),p?"Collapse All":"Expand All"]}),i.jsxs("span",{className:"ml-auto text-xs text-slate-500",children:[e.length," connection",e.length===1?"":"s"," · ",j," account",j===1?"":"s"]})]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-left",children:[i.jsx("thead",{className:"bg-surface-2 border-b border-border",children:i.jsxs("tr",{children:[i.jsx("th",{className:"w-[34px]"}),i.jsx("th",{className:`${Cl} min-w-[260px]`,children:"Account"}),i.jsx("th",{className:Cl,children:"Type"}),i.jsx("th",{className:`${Cl} text-right`,children:"Balance"}),i.jsx("th",{className:`${Cl} text-right`,children:"Available"}),i.jsx("th",{className:`${Cl} text-right`,children:"Limit / Utilisation"}),i.jsx("th",{className:Cl,children:"Status"}),i.jsx("th",{className:Cl,children:"Last update"}),i.jsx("th",{className:`${Cl} text-right`,children:"Actions"})]})}),i.jsx("tbody",{children:g.map(N=>i.jsx(E$e,{view:N,rows:N.rows,hasFilter:n,logo:r[a.get(N.account.id)??""],isExpanded:!d.includes(N.account.id),onToggle:()=>h(k=>k.includes(N.account.id)?k.filter(S=>S!==N.account.id):[...k,N.account.id]),onSelectSubAccount:s,onReconnect:()=>o(N.account.id),onRename:()=>l(N.account.id),onRemove:()=>u(N.account.id)},N.account.id))}),i.jsxs("tfoot",{className:"bg-surface-2 border-t border-border",children:[y.map(N=>i.jsxs("tr",{"data-testid":`totals-${N.currency}`,children:[i.jsx("td",{}),i.jsxs("td",{className:"px-3 py-3 text-[12.5px] font-bold text-slate-900",children:["Total · ",N.currency]}),i.jsx("td",{}),i.jsx("td",{className:"px-3 py-3 text-right text-[13px] font-extrabold tabular-nums text-slate-900",children:ge(N.net,N.currency)}),i.jsx("td",{colSpan:5})]},N.currency)),w>0&&i.jsxs("tr",{"data-testid":"totals-excluded",children:[i.jsx("td",{}),i.jsxs("td",{colSpan:8,className:"px-3 py-3 text-[12.5px] font-medium text-slate-500",children:["excludes ",w," connection",w===1?"":"s"," needing attention"]})]})]})]})})]})}const w5="inline-flex items-center justify-center w-8 h-8 lg:w-[28px] lg:h-[28px] rounded-[7px] text-slate-500 hover:bg-slate-100 hover:text-slate-900 transition-colors";function A$e({view:e,rows:t,hasFilter:n,logo:r,onSelectSubAccount:a,onReconnect:s,onRename:o,onRemove:l}){const{account:u,state:d,totals:h,partial:p,subAccounts:g}=zV(e,t),x=ic[d],y=qf(d),w=h[0]??null,j=nA(u.updated_at);return i.jsxs("article",{className:`rounded-xl border bg-surface shadow-card overflow-hidden ${y?"border-badge-red":"border-border"}`,children:[i.jsxs("header",{className:"flex items-start gap-2.5 px-4 lg:px-[18px] py-4",children:[i.jsx(ra,{name:u.name,logo:r,className:"w-[34px] h-[34px]"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h3",{className:"text-[14.5px] font-extrabold tracking-tight text-slate-900 truncate",children:u.title||u.name}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-px",children:[u.name," · ",g," account",g===1?"":"s"]})]}),i.jsxs("span",{className:`${ja} ${x.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${x.dotClassName}`}),x.label]})]}),i.jsxs("div",{className:"px-4 lg:px-[18px] pb-3",children:[i.jsx("p",{className:`text-2xl font-extrabold tracking-tight tabular-nums ${y?"text-slate-400":w&&w.net<0?"text-amount-neg":"text-slate-900"}`,children:w?ge(w.net,w.currency):je}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-1 tabular-nums",children:[w?`${ge(w.assets,w.currency)} assets · ${ge(w.liabilities,w.currency)} owed`:"no balance reported",h.length>1&&` · ${h.slice(1).map(N=>ge(N.net,N.currency)).join(" · ")}`]})]}),y&&i.jsxs("p",{className:`flex gap-2.5 items-start mx-4 lg:mx-[18px] mb-3 rounded-lg px-3 py-2.5 text-[12px] leading-relaxed ${R1[d]}`,children:[i.jsx(Jt,{className:"w-[15px] h-[15px] flex-none mt-px"}),i.jsx("span",{children:e.error?.error??M1[d]})]}),p&&!y&&i.jsx("p",{className:"mx-4 lg:mx-[18px] mb-3 text-[11.5px] text-slate-500",children:"An account in this connection reported no balance, so the total above does not cover all of them."}),i.jsxs("div",{className:"border-t border-border",children:[i.jsx("p",{className:"px-4 lg:px-[18px] pt-3 pb-1 text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Sub-accounts"}),t.length===0?i.jsx("p",{className:"px-4 lg:px-[18px] pb-3 text-[12px] text-slate-500",children:y?"No balances came back on the last refresh.":n?"No account here matches the current filters.":"This connection returned no sub-accounts."}):t.map(N=>{const k=sc(N),S=Mg(N.current,N.limit),E=Dg(N),O=A1(N);return i.jsxs("button",{type:"button",onClick:()=>a(N.plaid_account_id),className:"w-full flex items-center gap-3 px-4 lg:px-[18px] py-2.5 text-left border-b border-border last:border-b-0 hover:bg-surface-2 transition-colors",children:[i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13px] font-semibold text-slate-900 truncate",children:N.account_name}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 mt-px truncate",children:[An(N.mask),N.subtype??N.type,O].filter(
556Boolean).join(" · ")})]}),i.jsxs("span",{className:"text-right flex-none",children:[i.jsx("span",{className:`block text-[13px] font-bold tabular-nums ${y?"text-slate-400":k!==null&&k<0?"text-amount-neg":"text-slate-900"}`,children:k===null?je:ge(k,N.currency)}),i.jsx("span",{className:"block text-[11px] text-slate-500 mt-px tabular-nums",children:y?"last known":S!==null?`${S}% of ${ge(N.limit,N.currency)}`:E??je})]})]},N.plaid_account_id)})]}),i.jsxs("footer",{className:"flex items-center gap-2 flex-wrap px-4 lg:px-[18px] py-2.5 bg-surface-2 border-t border-border text-[11.5px] text-slate-500",children:[i.jsx(xr,{className:"w-3 h-3"}),j?`Synced ${j}`:"Never synced",e.products.map(N=>i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:N},N)),i.jsxs("span",{className:"ml-auto flex items-center gap-0.5",children:[i.jsx("button",{type:"button",onClick:o,"aria-label":`Rename ${u.title||u.name}`,className:w5,children:i.jsx(Si,{className:"w-3.5 h-3.5"})}),i.jsx("button",{type:"button",onClick:s,"aria-label":`Reconnect ${u.title||u.name}`,className:w5,children:i.jsx(Zs,{className:"w-3.5 h-3.5"})}),i.jsx("button",{type:"button",onClick:l,"aria-label":`Remove ${u.title||u.name}`,className:w5,children:i.jsx(Ya,{className:"w-3.5 h-3.5"})})]})]})]})}const sF="view",T$e=e=>e==="cards"?"cards":"table",N0=e=>console.warn(`[AllAccountsTab] ${e}`);function P$e(){const{data:e,balances:t,logos:n,connections:r,attention:a,staleAccountIds:s,institutionIdByAccount:o,currency:l,onSelectSubAccount:u,onReconnect:d,onRename:h,onRemove:p}=zP(),[g,x]=Li(),[y,w]=v.useState(""),[j,N]=v.useState(null),[k,S]=v.useState(null),E=Ms(),O=T$e(g.get(sF)),T=E?O:"cards",P=!E&&O==="table";v.useEffect(()=>{P&&N0("Phone layout: showing cards over the stored table view")},[P]);const M=V=>{const X=new URLSearchParams(g);X.set(sF,V),x(X,{replace:!0})},D=()=>{const V=new URLSearchParams(g);V.has(Z0)&&(V.delete(Z0),N0(`Cleared the linked connection: showing all ${r.length} connections`),x(V,{replace:!0}))},A=V=>{D(),w(V)},L=V=>{D(),N(V)},F=V=>{D(),S(V)},B=v.useMemo(()=>[...new Set(t.map(V=>V.currency))].sort((V,X)=>V.localeCompare(X)),[t]),U=v.useMemo(()=>t.reduce((V,X)=>(V[X.group]=(V[X.group]??0)+1,V),{}),[t]),z=v.useMemo(()=>hbe(t,{search:y,group:j,currency:k}),[t,y,j,k]),$=v.useMemo(()=>{const V=new Map;for(const X of z)V.has(X.moneylogz_account_id)||V.set(X.moneylogz_account_id,[]),V.get(X.moneylogz_account_id).push(X);return V},[z]),K=v.useMemo(()=>{const V=Number(g.get(Z0));return Number.isInteger(V)&&V>0?V:null},[g]),G=v.useMemo(()=>K===null?null:r.find(V=>V.account.id===K)??null,[r,K]);v.useEffect(()=>{K!==null&&N0(G?`Narrowed to linked connection ${K} of ${r.length}`:`Linked connection ${K} matched none of ${r.length}: showing all`)},[K,G,r.length]);const W=y.trim()!==""||j!==null||k!==null,I=v.useMemo(()=>G&&!W?[G]:W?r.filter(V=>$.has(V.account.id)):r,[r,$,W,G]),H=v.useMemo(()=>(e.excluded_accounts??[]).filter(V=>!s.has(V.moneylogz_account_id)).length+(e.errors??[]).filter(V=>!s.has(V.moneylogz_account_id)).length,[e.excluded_accounts,e.errors,s]);return i.jsxs("div",{className:"pb-2",children:[i.jsx(k$e,{totals:T1(e.totals_by_currency,l),utilisation:Gy(e.credit_utilisation,l),currency:l,excludedCount:H}),i.jsx(S$e,{search:y,onSearchChange:A,group:j,onGroupChange:L,groupCounts:U,totalCount:t.length,attentionCount:a.length,currency:k,currencies:B,onCurrencyChange:F,view:T,onViewChange:M}),G&&!W&&i.jsxs("div",{className:"mb-4 flex items-center gap-2 text-xs font-semibold text-slate-500",children:["Showing 1 of ",r.length,i.jsxs("button",{type:"button",onClick:D,className:"inline-flex items-center gap-1.5 rounded-full border border-brand bg-brand-soft px-3 py-1.5 text-xs font-bold text-brand transition-colors hover:bg-slate-100",children:[i.jsx(Ut,{className:"w-3.5 h-3.5"}),"Show all accounts"]})]}),I.length===0?i.jsxs("p",{className:"flex flex-col items-center gap-2 rounded-xl border border-border bg-surface shadow-card px-6 py-12 text-center text-sm text-slate-500",children:[i.jsx(Mce,{className:"w-6 h-6 text-slate-400"}),"No account matches these filters. Clear the search or pick another type to see the rest."]}):T==="cards"?i.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-[18px]",children:I.map(V=>i.jsx(A$e,{view:V,rows:$.get(V.account.id)??[],hasFilter:W,logo:n[o.get(V.account.id)??""],onSelectSubAccount:u,onReconnect:()=>d(V.account.id),onRename:()=>h(V.account.id),onRemove:()=>p(V.account.id)},V.account.id))}):i.jsx(O$e,{views:I,rowsByAccount:$,hasFilter:W,logos:n,institutionIdByAccount:o,onSelectSubAccount:u,onReconnect:d,onRename:h,onRemove:p})]})}const R$e={login_required:"bg-badge-red-text",error:"bg-badge-red-text",preparing:"bg-badge-yellow-text",not_reporting:"bg-slate-400"};function M$e({view:e,logo:t,isReconnecting:n,isRefreshing:r,onReconnect:a,onRetry:s,onRemove:o}){const{account:l,state:u,rows:d,totals:h,error:p}=e,g=ic[u],x=bA[u],y=h[0]??null;return i.jsxs("article",{className:"flex rounded-xl border border-border bg-surface shadow-card overflow-hidden mb-3",children:[i.jsx("span",{className:`w-1 flex-none ${R$e[u]??"bg-slate-400"}`}),i.jsxs("div",{className:"flex-1 min-w-0 px-4 lg:px-[18px] py-4",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ra,{name:l.name,logo:t,className:"w-[34px] h-[34px]"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("p",{className:"flex items-center gap-2.5 flex-wrap",children:[i.jsx("span",{className:"text-[14.5px] font-extrabold tracking-tight text-slate-900",children:l.title||l.name}),i.jsxs("span",{className:`${ja} ${g.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${g.dotClassName}`}),g.label]})]}),i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-0.5",children:[l.name," · ",e.subAccounts," account",e.subAccounts===1?"":"s",l.created_at?` · connected ${Ue(l.created_at.slice(0,10))}`:""]})]}),i.jsxs("div",{className:"text-right flex-none",children:[i.jsx("p",{className:"text-[15px] font-extrabold tabular-nums text-slate-400",children:y?ge(y.net,y.currency):je}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-px",children:y?"last known":"no balance yet"})]})]}),i.jsxs("p",{className:`flex gap-2.5 items-start rounded-lg px-3 py-2.5 mt-3 text-[12.5px] leading-relaxed ${R1[u]}`,children:[i.jsx(x,{className:"w-[15px] h-[15px] flex-none mt-px"}),i.jsx("span",{children:p?.error??M1[u]})]}),d.length>0&&i.jsxs("div",{className:"mt-3 rounded-lg border border-border overflow-hidden",children:[i.jsx("p",{className:"px-3 py-2 bg-surface-2 border-b border-border text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Accounts affected"}),d.map(w=>{const j=sc(w);return i.jsxs("p",{className:"flex items-center gap-3 px-3 py-2 border-b border-border last:border-b-0",children:[i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[12.5px] font-semibold text-slate-900 truncate",children:w.account_name}),i.jsx("span",{className:"block text-[11px] text-slate-500",children:[An(w.mask),w.subtype??w.type].filter(
556Boolean).join(" · ")})]}),i.jsx("span",{className:"text-[12.5px] font-bold tabular-nums text-slate-400",children:j===null?je:ge(j,w.currency)})]},w.plaid_account_id)})]}),i.jsxs("div",{className:"flex flex-col gap-2 mt-3 lg:flex-row lg:flex-wrap",children:[u==="preparing"?i.jsxs("button",{type:"button",onClick:s,disabled:r,className:"inline-flex items-center justify-center gap-1.5 rounded-lg border border-border bg-surface px-3 h-[42px] lg:h-auto lg:justify-start py-1.5 text-xs font-bold text-slate-600 hover:bg-slate-100 disabled:opacity-50",children:[i.jsx(dt,{className:`w-3 h-3 ${r?"animate-spin":""}`}),r?"Checking...":"Try again"]}):i.jsxs("button",{type:"button",onClick:a,disabled:n,className:"inline-flex items-center justify-center gap-1.5 rounded-lg border border-brand bg-brand px-3 h-[42px] lg:h-auto lg:justify-start py-1.5 text-xs font-bold text-white hover:bg-brand-hover disabled:opacity-50",children:[n?i.jsx(Dt,{size:"sm",className:"text-white"}):i.jsx(Zs,{className:"w-3 h-3"}),n?"Reconnecting...":`Reconnect ${l.name}`]}),i.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center justify-center gap-1.5 rounded-lg border border-border bg-surface px-3 h-[42px] lg:h-auto lg:justify-start py-1.5 text-xs font-bold text-slate-600 hover:bg-slate-100",children:[i.jsx(Ya,{className:"w-3 h-3"}
556),"Remove connection"]})]})]})]})}const j5="inline-flex items-center justify-center w-8 h-8 lg:w-[28px] lg:h-[28px] rounded-[7px] text-slate-500 hover:bg-slate-100 hover:text-slate-900 transition-colors",iF=Object.fromEntries($1.map(({id:e,label:t})=>[e,t]));function D$e({view:e,health:t,logo:n,onSelectSubAccount:r,onReconnect:a,onAddProducts:s,isAddingProducts:o,onRename:l,onRemove:u}){const[d,h]=v.useState(!0),[p,g]=v.useState(new Set),{account:x,state:y,rows:w,totals:j,partial:N}=e,k=a0e(e.products),S=t?.supported_products??null,E=B=>S===null||S.includes(B),O=k.filter(E),T=O.filter(B=>p.has(B)),P=v.useRef(o);v.useEffect(()=>{P.current&&!o&&g(new Set),P.current=o},[o]);const M=B=>g(U=>{const z=new Set(U);return z.has(B)?z.delete(B):z.add(B),z}),D=ic[y],A=j[0]??null,L=nA(x.updated_at),F=d?Ca:va;return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden mb-3",children:[i.jsxs("header",{className:"flex items-center flex-wrap gap-3 px-4 py-3.5 lg:flex-nowrap lg:px-[18px]",children:[i.jsx("button",{type:"button",onClick:()=>h(B=>!B),"aria-expanded":d,"aria-label":`${d?"Collapse":"Expand"} ${x.title||x.name}`,className:"flex-none text-slate-500 hover:text-slate-900",children:i.jsx(F,{className:"w-4 h-4"})}),i.jsx(ra,{name:x.name,logo:n,className:"w-[30px] h-[30px]"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h3",{className:"text-[14px] font-extrabold tracking-tight text-slate-900 truncate",children:x.title||x.name}),i.jsxs("p",{className:"flex items-center gap-2 flex-wrap text-[11.5px] text-slate-500 mt-px",children:[i.jsxs("span",{children:[x.name," · ",e.subAccounts," account",e.subAccounts===1?"":"s"]}),i.jsxs("span",{className:`${ja} ${D.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${D.dotClassName}`}),D.label]}),L&&i.jsxs("span",{className:"inline-flex items-center gap-1",children:[i.jsx(xr,{className:"w-3 h-3"}),L]})]})]}),i.jsxs("div",{className:"order-last w-full pl-[58px] text-left lg:order-none lg:w-auto lg:pl-0 lg:text-right flex-none",children:[i.jsx("p",{className:`text-[15px] font-extrabold tabular-nums ${A&&A.net<0?"text-amount-neg":"text-slate-900"}`,children:A?ge(A.net,A.currency):je}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-px tabular-nums",children:A?`${ge(A.assets,A.currency)} assets · ${ge(A.liabilities,A.currency)} owed`:"no balance reported"})]}),i.jsxs("span",{className:"flex items-center gap-0.5 flex-none",children:[i.jsx("button",{type:"button",onClick:l,"aria-label":`Rename ${x.title||x.name}`,className:j5,children:i.jsx(Si,{className:"w-3.5 h-3.5"})}),i.jsx("button",{type:"button",onClick:a,disabled:o,"aria-label":`Reconnect ${x.title||x.name}`,className:`${j5} disabled:opacity-50`,children:i.jsx(Zs,{className:"w-3.5 h-3.5"})}),i.jsx("button",{type:"button",onClick:u,"aria-label":`Remove ${x.title||x.name}`,className:j5,children:i.jsx(Ya,{className:"w-3.5 h-3.5"})})]})]}),d&&i.jsx("div",{className:"border-t border-border",children:w.length===0?i.jsx("p",{className:"px-4 lg:px-[18px] py-3 text-[12px] text-slate-500",children:"This connection returned no sub-accounts on the last refresh."}):w.map(B=>{const U=sc(B),z=Mg(B.current,B.limit),$=Dg(B),K=A1(B);return i.jsxs("button",{type:"button",onClick:()=>r(B.plaid_account_id),className:"w-full flex items-center gap-3 px-4 lg:px-[18px] py-2.5 text-left border-b border-border last:border-b-0 hover:bg-surface-2 transition-colors",children:[i.jsxs("span",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"block text-[13px] font-semibold text-slate-900 truncate",children:B.account_name}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 mt-px truncate",children:[An(B.mask),B.subtype??B.type,K].filter(Boolean).join(" · ")})]}),i.jsxs("span",{className:"text-right flex-none",children:[i.jsx("span",{className:`block text-[13px] font-bold tabular-nums ${U!==null&&U<0?"text-amount-neg":"text-slate-900"}`,children:U===null?je:ge(U,B.currency)}),i.jsx("span",{className:"block text-[11px] text-slate-500 mt-px tabular-nums",children:z!==null?`${z}% of ${ge(B.limit,B.currency)}`:$??je})]})]},B.plaid_account_id)})}),i.jsxs("footer",{className:"flex items-center gap-x-4 gap-y-2 flex-wrap px-4 lg:px-[18px] py-2.5 bg-surface-2 border-t border-border text-[11.5px] text-slate-500",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:["Products",e.products.length===0?i.jsx("span",{children:je}):e.products.map(B=>i.jsx("span",{className:"inline-flex rounded-[5px] px-1.5 py-px text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-500",children:B},B))]}),t?.transactions&&i.jsxs("span",{children:["Transactions ",i.jsx("b",{className:"text-slate-900",children:t.transactions.total})," · unmatched"," ",i.jsx("b",{className:"text-slate-900",children:t.transactions.unmatched})," over"," ",t.transactions.window_days," days"]}),t?.consent_expiration_time&&i.jsxs("span",{children:["Consent renews"," ",i.jsx("b",{className:"text-slate-900",children:Ue(t.consent_expiration_time.slice(0,10))})]}),N&&i.jsx("span",{children:"Some accounts reported no balance, so the total above is partial."}),i.jsx("span",{className:"flex items-center gap-2 flex-wrap lg:ml-auto",children:O.length===0?i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-bold text-badge-green-text",children:[i.jsx(fO,{className:"w-3.5 h-3.5"}),"All available products connected"]}):i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-bold text-slate-600",children:[i.jsx(Qs,{className:"w-3 h-3 text-brand"}),"Add to this connection"]}),k.map(B=>{const U=p.has(B),z=E(B);return i.jsxs("button",{type:"button",onClick:()=>M(B),disabled:o||!z,"aria-pressed":U,title:z?void 0:`${x.name} does not support ${iF[B].toLowerCase()}`,className:`inline-flex items-center gap-1 rounded-full px-2.5 py-[3px] text-[11px] font-extrabold transition-colors ${z?U?"text-white bg-brand border border-brand":"text-brand bg-brand-soft border border-dashed border-blue-300 hover:border-brand disabled:opacity-50":"text-slate-400 bg-surface-muted border border-border
556cursor-not-allowed"}`,children:[U?i.jsx(Zt,{className:"w-3 h-3"}):i.jsx(Qs,{className:"w-3 h-3"}),iF[B]]},B)}),T.length>0&&i.jsx("button",{type:"button",onClick:()=>s(T),disabled:o,className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-1 text-[11px] font-extrabold text-white bg-brand border border-brand shadow-nav-active hover:bg-brand-hover disabled:opacity-50",children:o?i.jsxs(i.Fragment,{children:[i.jsx(Dt,{size:"sm",className:"text-white"}),"Opening Plaidâ¦"]}):i.jsxs(i.Fragment,{children:[i.jsx(Qs,{className:"w-3 h-3"}),"Add ",T.length," product",T.length===1?"":"s"]})})]})})]})]})}function $$e(){const{data:e,logos:t,connections:n,institutionIdByAccount:r,currency:a,onSelectSubAccount:s,onReconnect:o,onAddProducts:l,isReconnecting:u,addingProductsId:d,onRename:h,onRemove:p,onRetry:g,isRefreshing:x}=zP(),y=t0e(),w=v.useMemo(()=>new Map((y.data?.connections??[]).map(T=>[T.moneylogz_account_id,T])),[y.data?.connections]),j=v.useMemo(()=>gbe(n),[n]),N=j.filter(T=>qf(T.state)),k=j.filter(T=>!qf(T.state)),S=T1(e.totals_by_currency,a),E=mbe(j,a),O=T=>t[r.get(T)??""];return i.jsxs("div",{className:"pb-2",children:[i.jsxs(wh,{className:"mb-5",children:[i.jsxs(On,{label:`Net worth${a?` · ${a}`:""}`,children:[i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:S?ge(S.net,S.currency):je}),i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:["from ",S?.accounts??0," reporting account",S?.accounts===1?"":"s"]})]}),i.jsxs(On,{label:"Not counted",children:[i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-badge-yellow-text",children:E===null?je:ge(E.net,E.currency)}),i.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:N.length===0?"every connection reported":`${N.length} connection${N.length===1?"":"s"} stale or preparing`})]}),i.jsxs(On,{label:"Connections",children:[i.jsx("p",{className:"text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:j.length}),i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:[k.length," healthy · ",N.length," need you"]})]})]}),N.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center flex-wrap gap-x-2.5 gap-y-1 mb-3",children:[i.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-slate-900",children:"Needs your attention"}),i.jsx("span",{className:"text-[11px] font-extrabold rounded-full px-2 py-0.5 bg-badge-red text-badge-red-text",children:N.length}),i.jsx("span",{className:"w-full lg:w-auto lg:ml-auto text-xs text-slate-500",children:"Balances below are excluded from the total until they are fixed"})]}),N.map(T=>i.jsx(M$e,{view:T,logo:O(T.account.id),isReconnecting:u===T.account.id,isRefreshing:x,onReconnect:()=>o(T.account.id),onRetry:g,onRemove:()=>p(T.account.id)},T.account.id))]}),i.jsxs("div",{className:"flex items-center flex-wrap gap-x-2.5 gap-y-1 mt-6 mb-3",children:[i.jsx("h2",{className:"text-sm font-extrabold tracking-tight text-slate-900",children:"Healthy connections"}),i.jsx("span",{className:"text-[11px] font-extrabold rounded-full px-2 py-0.5 bg-surface-muted text-slate-500",children:k.length}),S&&i.jsxs("span",{className:"w-full lg:w-auto lg:ml-auto text-xs text-slate-500 tabular-nums",children:[ge(S.assets,S.currency)," assets ·"," ",ge(S.liabilities,S.currency)," owed"]})]}),k.length===0?i.jsx("p",{className:"rounded-xl border border-border bg-surface shadow-card px-6 py-10 text-center text-sm text-slate-500",children:"No connection is reporting right now. Fix the ones above to see them here."}):k.map(T=>i.jsx(D$e,{view:T,health:w.get(T.account.id),logo:O(T.account.id),onSelectSubAccount:s,onReconnect:()=>o(T.account.id),onAddProducts:P=>l(T.account.id,P),isAddingProducts:d===T.account.id,onRename:()=>h(T.account.id),onRemove:()=>p(T.account.id)},T.account.id)),i.jsxs("p",{className:"flex items-center gap-2 mt-4 text-xs text-slate-500",children:[i.jsx(fO,{className:"w-3.5 h-3.5"}),"Moneylogz never stores your bank credentials â connections are held by Plaid and can be revoked here at any time."]})]})}function I$e({asOf:e,pricedAsOf:t,isStale:n,isRefreshing:r,onRefresh:a}){const s=Yxe(t),o=Jxe(t),l=s?`Priced ${s}${o?` · ${o}`:""}`:`As of ${pm(e)}`;return i.jsxs("div",{className:YV,children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-[22px] lg:text-2xl leading-tight font-extrabold tracking-tight text-slate-900",children:"Investments"}),i.jsx("p",{className:"hidden lg:block text-slate-500 mt-1",children:"Holdings and activity across your connected brokerage, IRA, 401(k) and HSA accounts."}),i.jsxs("p",{title:`Fetched ${pm(e)}`,className:`lg:hidden text-[13px] mt-1 ${n?"inline-flex items-center gap-1.5 rounded-lg bg-badge-yellow text-badge-yellow-text font-bold px-2.5 py-1.5":"text-slate-500"}`,children:[n&&i.jsx(xr,{className:"h-3.5 w-3.5 flex-none"}),i.jsx("span",{children:l})]})]}),i.jsxs("div",{className:XV,children:[i.jsxs("span",{title:`Fetched ${pm(e)}`,className:`hidden lg:inline-flex items-center gap-[7px] rounded-full border px-3 py-1.5 text-[12.5px] ${n?"bg-badge-yellow border-yellow-200 text-badge-yellow-text font-bold":"bg-surface border-border text-slate-500 font-semibold"}`,children:[i.jsx(xr,{className:"h-3.5 w-3.5"}),s?i.jsxs(i.Fragment,{children:["Priced ",s,o&&i.jsxs("span",{className:"font-normal opacity-80",children:["· ",o]})]}):`As of ${pm(e)}`]}),i.jsxs("button",{type:"button",onClick:a,disabled:r,className:"inline-flex items-center gap-2 font-semibold whitespace-nowrap h-[42px] text-sm lg:text-base lg:h-auto px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100 disabled:opacity-50",children:[i.jsx(dt,{className:`h-[15px] w-[15px] ${r?"animate-spin":""}`}),r?"Refreshing...":"Refresh"]}),i.jsx(Ql,{label:"Add Investment Account",mobileLabel:"Add Account",fullWidthOnMobile:!0,defaultProducts:I1})]})]})}function L$e({isAdmin:e,counts:t,attentionCount:n}){return i.jsx(U1,{tabs:M0e(e),tabPath:Ym,counts:t,attention:{path:"accounts",count:n,label:`${n} account${n===1?"":"s"} need attention`}})}const F$e="/docs/investments/connecting-an-investment-account",fJ={no_accounts:"No bank accounts connected",no_investment_accounts:"None of your connected accounts include investments",no_requested_investment_accounts:"None of the selected accounts hold investments",none_selected:"No investment accounts found"},dUe=e=>typeof e=="string"&&Object.prototype.hasOwnProperty.call(fJ,e),z$e=(e,t)=>
556e==="no_accounts"?"Connect a brokerage, IRA, 401(k) or HSA to see your holdings and trade activity here.":e==="no_investment_accounts"?`You have ${t===1?"1 bank connection":`${t} bank connections`}, but none were linked with Investments ticked â so they carry no holdings at all. Connect a brokerage, IRA, 401(k) or HSA to fill this screen.`:e==="no_requested_investment_accounts"?"Clear the account filter, or connect an investment account to see holdings here.":"Connect a brokerage, IRA, 401(k) or HSA to see your holdings and trade activity here.",bE=[{title:"Tick Investments",detail:"In Add Bank Account, tick Investments before you continue. It cannot be added afterwards without relinking."},{title:"Pick your broker",detail:"Plaid lists only institutions that support every product you ticked."},{title:"Wait a minute",detail:"Holdings usually appear 1-2 minutes after linking, once your broker finishes preparing them."}],fUe=[bE[0],bE[1],{title:"Ask me again",detail:"Holdings usually appear 1-2 minutes after linking. Then ask for your investments overview again."}],B$e=[{icon:GU,title:"Every position",detail:"Ticker, security name, quantity, price, market value, cost basis and unrealised gain or loss."},{icon:oO,title:"Allocation",detail:"A breakdown by security type â equity, ETF, mutual fund, fixed income, cash â with totals per currency."},{icon:Uo,title:"Activity",detail:"Buys, sells, dividends, fees and transfers over a date range. Cancelled trades stay visible as cancellations."},{icon:jg,title:"Read-only, always",detail:"Your account is linked with read-only permission, so Moneylogz can never place a trade or move money."}];function U$e({reason:e,connectionCount:t}){return i.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-[1fr_380px] gap-5 items-start",children:[i.jsxs("div",{className:"bg-surface border border-border rounded-2xl shadow-card px-4 pt-8 pb-6 lg:px-10 lg:pt-10 lg:pb-8 text-center",children:[i.jsxs("div",{className:"w-[72px] h-[72px] mx-auto mb-5 relative",children:[i.jsx("span",{className:"absolute inset-0 rounded-full border-4 border-brand"}),i.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-brand",children:i.jsx(zi,{className:"w-7 h-7"})})]}),i.jsx("h2",{className:"text-xl font-extrabold tracking-tight text-slate-900",children:fJ[e]}),i.jsx("p",{className:"text-sm text-slate-500 mt-2 mx-auto max-w-[460px] leading-relaxed",children:z$e(e,t)}),i.jsxs("div",{className:"flex flex-col lg:flex-row gap-2.5 justify-center mt-6",children:[i.jsx(Ql,{label:"Connect an investment account",defaultProducts:I1,fullWidthOnMobile:!0}),i.jsxs(gt,{to:F$e,className:"inline-flex items-center justify-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-border bg-surface text-slate-900 hover:bg-slate-100",children:[i.jsx(yle,{className:"h-[15px] w-[15px]"}),"Read the guide"]})]}),i.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3.5 mt-8 text-left",children:bE.map((n,r)=>i.jsxs("div",{className:"border border-border rounded-xl p-4 bg-surface-2",children:[i.jsx("span",{className:"w-[22px] h-[22px] rounded-full bg-brand text-white text-[11px] font-extrabold flex items-center justify-center mb-2.5",children:r+1}),i.jsx("p",{className:"text-[13.5px] font-bold text-slate-900",children:n.title}),i.jsx("p",{className:"text-[12.5px] text-slate-500 mt-1 leading-relaxed",children:n.detail})]},n.title))})]}),i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx("div",{className:"px-[18px] py-3.5 border-b border-border",children:i.jsx("h2",{className:"text-[15px] font-bold tracking-tight text-slate-900",children:"What you will see here"})}),B$e.map(({icon:n,title:r,detail:a})=>i.jsxs("div",{className:"flex gap-3 px-[18px] py-3 items-start",children:[i.jsx("span",{className:"w-[30px] h-[30px] rounded-lg bg-brand-soft text-brand flex-none flex items-center justify-center",children:i.jsx(n,{className:"w-[15px] h-[15px]"})}),i.jsxs("span",{children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900",children:r}),i.jsx("span",{className:"block text-[12.5px] text-slate-500 leading-relaxed mt-0.5",children:a})]})]},r))]})]})}
556function hJ({rows:e=5,label:t}){return i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[t&&i.jsxs("div",{className:"flex items-center gap-2.5 px-[18px] py-3 bg-surface-2 border-b border-border text-[12.5px] font-semibold text-slate-500",children:[i.jsx(dt,{className:"w-[15px] h-[15px] text-brand animate-spin"}),t]}),i.jsx("div",{"aria-busy":"true","aria-label":"Loading holdings",children:Array.from({length:e}).map((n,r)=>i.jsxs("div",{className:"flex items-center gap-3 px-[18px] py-3.5 border-b border-border last:border-b-0",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-lg bg-surface-muted animate-pulse flex-none"}),i.jsxs("span",{className:"flex-1",children:[i.jsx("span",{className:"block h-2.5 rounded-full bg-surface-muted animate-pulse w-[36%]"}),i.jsx("span",{className:"block h-2 rounded-full bg-surface-muted animate-pulse w-[62%] mt-[7px] opacity-70"})]}),i.jsx("span",{className:"w-24 flex-none",children:i.jsx("span",{className:"block h-2.5 rounded-full bg-surface-muted animate-pulse"})})]},r))})]})}const q$e={ITEM_LOGIN_REQUIRED:{label:"Reconnect Now",icon:Zs,kind:"reconnect",severity:"high"},ADDITIONAL_CONSENT_REQUIRED:{label:"Grant permission",icon:Zt,kind:"reconnect",severity:"high"},PRODUCT_NOT_READY:{label:"Try again",icon:dt,kind:"retry",severity:"medium"},PRODUCTS_NOT_SUPPORTED:{label:"Manage in Accounts",icon:Ut,kind:"none",severity:"low"},NO_INVESTMENT_ACCOUNTS:{label:"Relink and pick accounts",icon:Zs,kind:"reconnect",severity:"low"}},H$e={label:"Try again",icon:dt,kind:"retry",severity:"medium"},K$e={high:"bg-badge-red-text",medium:"bg-badge-yellow-text",low:"bg-slate-300"};function V$e({errors:e,onReconnect:t,onRetry:n,isReconnecting:r}){return e.length?i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden mb-[18px]",children:[i.jsxs("div",{className:"flex items-center gap-2.5 px-4 lg:px-[18px] py-3.5 border-b border-border",children:[i.jsx("h2",{className:"text-[15px] font-bold tracking-tight text-slate-900",children:"Accounts that could not be reached"}),i.jsxs("span",{className:"ml-auto inline-flex items-center rounded-full px-2.5 py-0.5 text-[11px] font-bold bg-badge-red text-badge-red-text",children:[e.length," account",e.length===1?"":"s"]})]}),e.map(a=>{const s=q$e[a.code]??H$e,o=s.icon,l=r===a.moneylogz_account_id;return i.jsxs("div",{className:"flex gap-3 items-start px-4 lg:px-[18px] py-3.5 border-b border-border last:border-b-0",children:[i.jsx("span",{className:`w-1.5 self-stretch rounded-full flex-none ${K$e[s.severity]}`}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("span",{className:"text-[13.5px] font-bold text-slate-900",children:a.account_name}),i.jsx("span",{className:"font-mono text-[10.5px] font-bold bg-surface-muted text-slate-600 rounded px-1.5 py-0.5",children:a.code})]}),i.jsx("p",{className:"text-[12.5px] text-slate-600 mt-1.5 leading-relaxed",children:a.error}),s.kind!=="none"&&i.jsxs("button",{type:"button",disabled:l,onClick:()=>s.kind==="reconnect"?t(a.moneylogz_account_id):n(),className:"mt-2.5 w-full h-[42px] justify-center lg:mt-2 lg:w-auto lg:h-auto lg:justify-start inline-flex items-center gap-1.5 rounded-lg border border-brand bg-brand-soft px-2.5 py-1.5 text-xs font-bold text-brand hover:bg-brand hover:text-white disabled:opacity-50 transition-colors",children:[i.jsx(o,{className:`w-3 h-3 ${l?"animate-spin":""}`}),l?"Reconnecting...":s.label]})]})]},`${a.moneylogz_account_id}-${a.code}`)}),i.jsx("p",{className:"px-4 lg:px-[18px] py-3 bg-brand-soft text-[12.5px] leading-relaxed text-blue-900",children:"One unreachable account never blanks the rest of the portfolio â every account is fetched and reported separately, so the working ones still show."})]}):null}const pJ=()=>{const e=mn(),t=()=>e.invalidateQueries({queryKey:[Uu]}),n=Pf({mutationFn:a=>Fxe(a),onSuccess:t}),r=Pf({mutationFn:a=>zxe(a),onSuccess:t});return{save:n,remove:r}},G$e={buy:"bg-badge-blue text-badge-blue-text",sell:"bg-badge-green text-badge-green-text",cash:"bg-purple-100 text-purple-700",fee:"bg-badge-red text-badge-red-text",transfer:"bg-surface-muted text-slate-600",cancel:"bg-surface-muted text-slate-500 line-through"};function Fw({type:e,subtype:t}){const n=String(e||"").trim().toLowerCase(),r=G$e[n]??"bg-surface-muted text-slate-600",a=n?n[0].toUpperCase()+n.slice(1):"Unknown",s=t&&t.toLowerCase()!==n;return i.jsx("span",{className:`${ja} ${r} capitalize`,children:s?`${a} · ${t}`:a})}function W$e(e){const t=e.replace(/[$,\s]/g,"");if(t==="")return null;const n=Number(t);return!Number.isFinite(n)||n<0?null:n}function yE({holding:e,onSaved:t,compact:n=!1,autoFocus:r=!1}){const[a,s]=v.useState(""),o=v.useId(),{save:l}=pJ(),u=W$e(a),d=xV({cost_basis:u,quantity:e.quantity}),h=u!==null&&e.value!==null?e.value-u:null,p=Hu(h,u),g=(h??0)<0,x=y=>{y.preventDefault(),!(u===null||l.isPending)&&l.mutate({moneylogzAccountId:e.moneylogz_account_id,plaidAccountId:e.plaid_account_id,securityId:e.security_id,costBasis:u,currency:e.currency},{onSuccess:()=>t?.()})};return i.jsxs("form",{onSubmit:x,children:[i.jsxs("label",{htmlFor:o,className:"block text-[11px] font-bold uppercase tracking-[0.08em] text-slate-500 mb-1.5",children:["Total cost basis (",e.currency,")"]}),i.jsxs("div",{className:"flex gap-2.5",children:[i.jsxs("div",{className:"flex-1 flex items-center rounded-[10px] border-2 border-brand bg-surface ring-4 ring-brand-soft overflow-hidden",children:[i.jsx("span",{className:`pl-3.5 pr-1 font-extrabold text-slate-400 ${n?"text-lg":"text-[22px]"}`,children:"$"}),i.jsx("input",{id:o,inputMode:"decimal",autoFocus:r,value:a,onChange:y=>s(y.target.value),placeholder:"0.00","aria-label":"Total cost basis",className:`flex-1 min-w-0 border-0 outline-none py-2.5 pr-3 font-extrabold text-slate-900 tabular-nums bg-transparent ${n?"text-lg":"text-[22px]"}`})]}),i.jsxs("button",{type:"submit",disabled:u===null||l.isPending,className:"inline-flex items-center gap-2 px-4 roun
556ded-[10px] font-bold text-white bg-brand hover:bg-brand-hover disabled:opacity-50 shadow-[0_6px_16px_-6px_rgba(37,99,235,0.55)]",children:[i.jsx(Zt,{className:"w-[15px] h-[15px]"}),l.isPending?"Savingâ¦":"Save"]})]}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-2 leading-relaxed",children:["The total you paid for all ",e.quantity??0," units, across every purchase."]}),u!==null&&i.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-1 mt-3 text-xs text-slate-500",children:[i.jsxs("span",{children:["Average cost / unit"," ",i.jsx("b",{className:"text-slate-900 tabular-nums",children:d===null?"â":Re(d,e.currency)})]}),i.jsxs("span",{children:["Unrealised G/L"," ",i.jsx("b",{className:`tabular-nums ${g?"text-amount-neg":"text-amount-pos"}`,children:h===null?"â":`${h>0?"+":""}${Re(h,e.currency)}${p===null?"":` · ${p>0?"+":""}${p}%`}`})]})]}),l.isError&&i.jsx("p",{className:"text-[11.5px] text-badge-red-text mt-2.5",children:l.error instanceof Error?l.error.message:"Could not save. Please try again."}),i.jsxs("p",{className:"flex gap-2 items-start text-[11px] text-badge-yellow-text mt-3 leading-relaxed",children:[i.jsx(na,{className:"w-[13px] h-[13px] flex-none mt-px"}),i.jsxs("span",{children:["Saved to Moneylogz only â this never changes anything at ",e.institution,". If the institution later reports its own cost basis, that value replaces yours."]})]})]})}const Y$e=365,_0=({label:e,value:t,meta:n})=>i.jsxs("div",{className:"py-3.5",children:[i.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:e}),i.jsx("p",{className:"text-[17px] font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:t}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-0.5",children:n})]});function X$e({holdingKey:e,holdings:t,totals:n,asOf:r,onClose:a}){const s=Sa(),o=sA(t,e),l=!!o,[u,d]=v.useState(!1),{remove:h}=pJ();qo(l),v.useEffect(()=>{if(!l)return;const A=L=>{L.key==="Escape"&&a()};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[l,a]),v.useEffect(()=>{d(!1)},[o?.plaid_account_id,o?.security_id]);const p=C1({startDate:Mi(Y$e),endDate:Vr(new Date),ticker:o?.ticker??void 0},{enabled:l&&!!o?.ticker});if(!o)return null;const g=Ou(n).find(A=>A.currency===o.currency)?.value,x=fu(o.value,g),y=xV(o),w=Hu(o.unrealized_gain_loss,o.cost_basis),j=Gxe(t,o.security_id),N=(o.unrealized_gain_loss??0)<0,k=o.cost_basis!==null&&o.value?o.cost_basis/o.value*100:100,S=o.ticker?(p.data?.investment_transactions??[]).slice(0,6):[],E=o.cost_basis===null,O=Wxe(o),T=vn(o),P=iA(t).filter(A=>vn(A)!==T).length,M=()=>{a(),s("/investments/allocation")},D=()=>h.mutate({plaidAccountId:o.plaid_account_id,securityId:o.security_id});return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`fixed inset-0 z-40 ${_G} lg:bg-transparent`,onClick:a,"aria-hidden":"true"}),i.jsxs("aside",{role:"dialog","aria-label":`${o.ticker??"Position"} detail`,className:`fixed inset-x-0 bottom-0 ${jG.tall} ${NG} lg:inset-x-auto lg:top-0 lg:right-0 lg:h-auto lg:w-[560px] lg:rounded-none lg:shadow-[-18px_0_48px_rgba(15,23,42,.18)] bg-surface z-50 flex flex-col overflow-hidden`,children:[i.jsx("span",{"aria-hidden":"true",className:`${kG} lg:hidden`}),i.jsxs("div",{className:"flex-none px-4 pt-2 pb-3.5 lg:px-6 lg:pt-5 lg:pb-4 border-b border-border",children:[i.jsxs("div",{className:"flex items-start gap-3.5",children:[i.jsx(oc,{ticker:o.ticker,fallback:"CASH",className:"w-[46px] h-[46px] rounded-[11px] bg-brand-soft text-brand"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-xl font-extrabold tracking-tight text-slate-900",children:o.ticker??"Cash position"}),i.jsx("p",{className:"text-[13.5px] text-slate-500 mt-0.5",children:o.security_name??"Unknown security"})]}),i.jsx("button",{type:"button",onClick:a,"aria-label":"Close position detail",className:"ml-auto w-[42px] h-[42px] lg:w-8 lg:h-8 rounded-[7px] border border-border flex items-center justify-center text-slate-500 hover:bg-slate-100 flex-none",children:i.jsx(Ut,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"flex gap-1.5 mt-3 flex-wrap",children:[i.jsx("span",{className:"inline-flex items-center rounded-full px-2.5 py-1 text-[11px] font-bold text-white",style:{background:Ja(o.security_type)},children:ei(o.security_type)}),i.jsx("span",{className:"inline-flex items-center rounded-full px-2.5 py-1 text-[11px] font-bold bg-surface-muted text-slate-600",children:o.currency}),i.jsxs("span",{className:"inline-flex items-center rounded-full px-2.5 py-1 text-[11px] font-bold bg-surface-muted text-slate-600",children:["Held in ",j.length," account",j.length===1?"":"s"]}),x!==null&&i.jsxs("span",{className:"inline-flex items-center rounded-full px-2.5 py-1 text-[11px] font-bold bg-badge-green text-badge-green-text",children:[x,"% of portfolio"]}),E&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-bold bg-badge-yellow text-badge-yellow-text",children:[i.jsx(Qt,{className:"w-3 h-3"}),"No cost basis"]}),O&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-bold bg-brand-soft text-brand",children:[i.jsx(Si,{className:"w-3 h-3"}),"Cost basis added by you"]})]})]}),i.jsxs("div",{className:"flex-1 min-h-0 overflow-auto overscroll-contain px-4 pt-4 pb-6 lg:px-6 lg:pt-5 lg:pb-7",children:[i.jsxs("div",{className:"flex items-end gap-3.5 pb-4 border-b border-border",children:[i.jsx("p",{className:"text-[28px] lg:text-[34px] leading-none font-extrabold tracking-tight tabular-nums text-slate-900",children:Re(o.value,o.currency)}),i.jsx("div",{className:"pb-0.5",children:o.unrealized_gain_loss===null?i.jsxs("div",{children:[i.jsxs("p",{className:"text-[13px] font-bold text-badge-yellow-text inline-flex items-center gap-1.5",children:[i.jsx(Qt,{className:"w-3.5 h-3.5"}),"Cost basis not reported"]}),i.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"gain/loss can't be shown until a cost is added"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:`text-[15px] font-extrabold tabular-nums ${N?"text-amount-neg":"text-amount-pos"}`,children:Ee(o.unrealized_gain_loss,o.currency)}),i.jsxs("p",{className:"text-xs text-slate-500",children:["unrealised",w===null?"":` · ${w>0?"+":""}${w}%`]})]})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-x-4 border-b border-border",children:[i.jsx(_0,{label:"Quantity",value:hu(o.quantity),meta:"units held"}),i.jsx(_0,{label:"Institution price",value:Re(o.price,o.currency),meta:o.price_as_of?`as of ${Ue(o.price_as_of)}`:"as reported"}
556),i.jsx(_0,{label:"Cost basis",value:E?"â":Re(o.cost_basis,o.currency),meta:E?`not reported by ${o.institution}`:O?"added by you":"total for the position"}),i.jsx(_0,{label:"Average cost / unit",value:y===null?"â":Re(y,o.currency),meta:"cost basis ÷ quantity"})]}),E&&i.jsxs("section",{className:"mt-5 rounded-xl border border-[#fde68a] bg-[#fffdf5] overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-[#fde68a]",children:[i.jsx("span",{className:"w-[30px] h-[30px] rounded-lg bg-[#fef08a] text-badge-yellow-text flex-none flex items-center justify-center",children:i.jsx(Qs,{className:"w-4 h-4"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[13.5px] font-extrabold text-[#854d0e]",children:"Add the cost basis yourself"}),i.jsx("p",{className:"text-[11.5px] text-[#a16207]",children:"Enter the total you paid to bring this position into gain/loss."})]})]}),i.jsx("div",{className:"p-4",children:i.jsx(yE,{holding:o,compact:!0},vn(o))})]}),o.cost_basis!==null&&o.value!==null&&i.jsxs("section",{className:"mt-5",children:[i.jsx("h3",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-slate-400 mb-2.5",children:"Value against cost"}),i.jsxs("div",{className:"flex h-[34px] rounded-[9px] overflow-hidden gap-0.5 mb-2.5",children:[i.jsxs("span",{className:"flex items-center justify-center text-[11.5px] font-bold text-white bg-brand overflow-hidden whitespace-nowrap",style:{width:`${Math.min(k,100)}%`},children:["Cost ",Re(o.cost_basis,o.currency)]}),o.unrealized_gain_loss!==null&&o.unrealized_gain_loss>0&&i.jsxs("span",{className:"flex items-center justify-center text-[11.5px] font-bold text-white bg-amount-pos overflow-hidden whitespace-nowrap",style:{width:`${Math.max(100-k,0)}%`},children:["Gain ",Re(o.unrealized_gain_loss,o.currency)]})]})]}),O&&i.jsx("section",{className:"mt-4 rounded-xl border border-border bg-surface-2 overflow-hidden",children:u?i.jsx("div",{className:"p-4",children:i.jsx(yE,{holding:o,compact:!0,onSaved:()=>d(!1)},vn(o))}):i.jsxs("div",{className:"px-4 py-3",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx(Si,{className:"w-4 h-4 text-brand flex-none"}),i.jsx("p",{className:"text-[12.5px] text-slate-600",children:"You entered this cost basis. A broker-reported value will replace it."}),i.jsxs("div",{className:"ml-auto flex gap-2 flex-none",children:[i.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[12px] font-bold border border-border bg-surface text-slate-600 hover:bg-slate-100",children:[i.jsx(Si,{className:"w-3.5 h-3.5"}),"Edit"]}),i.jsxs("button",{type:"button",onClick:D,disabled:h.isPending,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[12px] font-bold border border-border bg-surface text-slate-600 hover:bg-slate-100 disabled:opacity-50",children:[i.jsx(Ace,{className:"w-3.5 h-3.5"}),h.isPending?"Removingâ¦":"Undo"]})]})]}),h.isError&&i.jsx("p",{className:"text-[11.5px] text-badge-red-text mt-2.5",children:h.error instanceof Error?h.error.message:"Could not remove. Please try again."})]})}),P>0&&i.jsxs("button",{type:"button",onClick:M,className:"w-full flex items-center gap-2.5 bg-surface-2 border border-border rounded-[10px] px-3.5 py-3 mt-4 text-left hover:border-brand",children:[i.jsx(Qt,{className:"w-4 h-4 text-badge-yellow-text flex-none"}),i.jsxs("span",{children:[i.jsxs("span",{className:"block text-[12.5px] font-bold text-slate-900",children:[P," more position",P===1?"":"s"," missing cost basis"]}),i.jsx("span",{className:"block text-[11.5px] text-slate-500",children:"Review and add them all on the Allocation tab."})]}),i.jsx(zu,{className:"ml-auto w-4 h-4 text-brand flex-none"})]}),i.jsxs("section",{className:"mt-5",children:[i.jsx("h3",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-slate-400 mb-2.5",children:"Where it is held"}),i.jsx("div",{className:"border border-border rounded-xl overflow-hidden",children:j.map(A=>i.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 py-3 border-b border-border last:border-b-0",children:[i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900",children:A.account_name}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500",children:[A.institution," · ",A.account_subtype??"investment",An(A.mask)?` · ${An(A.mask)}`:""]})]}),i.jsxs("span",{className:"ml-auto text-right tabular-nums",children:[i.jsx("span",{className:"block text-[13.5px] font-bold text-slate-900",children:Re(A.value,A.currency)}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500",children:[hu(A.quantity)," units"]})]})]},`${A.plaid_account_id}-${A.security_id}`))})]}),o.ticker&&i.jsxs("section",{className:"mt-5",children:[i.jsxs("h3",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-slate-400 mb-2.5",children:["Activity for ",o.ticker," · last 12 months"]}),i.jsx("div",{className:"border border-border rounded-xl overflow-hidden",children:p.isError?i.jsx("p",{className:"px-3.5 py-4 text-[12.5px] text-slate-500",children:"Activity could not be loaded. The position above is unaffected."}):S.length===0?i.jsx("p",{className:"px-3.5 py-4 text-[12.5px] text-slate-500",children:p.isFetching?"Loading activity...":`No ${o.ticker} activity in the last 12 months.`}):S.map(A=>i.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 py-3 border-b border-border last:border-b-0 text-[13px]",children:[i.jsx("span",{className:"w-[86px] flex-none tabular-nums text-slate-600",children:Ue(A.date)}),i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:"block font-semibold text-slate-900 truncate",children:A.name}),i.jsx("span",{className:"block text-[11.5px] text-slate-500",children:A.quantity===null?"amount only â no units changed hands":`${hu(A.quantity)} @ ${Re(A.price,A.currency)}`})]}),i.jsx(Fw,{type:A.type,subtype:A.subtype}),i.jsx("span",{className:`ml-auto font-bold tabular-nums whitespace-nowrap ${(A.amount??0)<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(A.amount,A.currency)})]},A.investment_transaction_id))})]}),i.jsxs("p",{className:"flex gap-2.5 items-start bg-surface-2 border border-border rounded-[10px] px-3 py-2.5 text-xs text-slate-600 leading-relaxed mt-5",children:[i.jsx(na,{className:"w-[15px] h-[15px] flex-none mt-px text-slate-400"}),i.jsxs("span",{children:["Fetched ",pm(r),". The institution prices each position once per market day, so the price above is as of that date and will differ from your broker's live quote."]})]})]}),i.jsx("div",{className:"flex-none border-t border-border px-4 pt-3 pb-[max(14px,env(safe-area-inset-bottom))] lg:px-6 lg:py-3.5 flex gap-2.5 bg-surface-2",children:i.jsxs("button",{type:"button",disabled:!o.ticker,onClick:()=>{a(),s(R0e(o.ticker))},className:"flex-1 inline-flex items-center justify-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover disabled:opacity-50",children:[i.jsx(Uo,{className:"h-[15p
556x] w-[15px]"}),o.ticker?`All ${o.ticker} activity`:"No ticker to filter"]})})]})]})}const N5=e=>console.warn(`[InvestmentsPage] ${e}`);function Q$e(){const{user:e}=ns(),t=e?.email===pO,[n,r]=Li(),a=n.get(Y0),[s,o]=v.useState(a),l=JO(),{data:u,isError:d,error:h,isFetching:p,refetch:g}=l;v.useEffect(()=>{a&&(N5(`Following link to position ${a}`),o(a))},[a]),v.useEffect(()=>{!a||!u?.holdings||sA(u.holdings,a)||N5(`Linked position ${a} is not among the ${u.holdings.length} holdings; no drawer opened`)},[a,u?.holdings]);const x=v.useCallback(()=>{o(null);const D=n.get(Y0);if(D===null)return;const A=new URLSearchParams(n);A.delete(Y0),N5(`Closed the position drawer: cleared linked position ${D} from the URL`),r(A,{replace:!0})},[n,r]),y=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),{startReconnect:w,isReconnecting:j}=mA({onReconnected:async()=>{await g()}}),N=v.useMemo(()=>u?.holdings??[],[u]),k=v.useMemo(()=>Po(N).length,[N]),S=v.useMemo(()=>u?.errors??[],[u?.errors]),E=v.useMemo(()=>SV(y.data?.accounts??[],CV(S)),[y.data?.accounts,S]),O=v.useMemo(()=>({data:u,holdings:N,selectedHoldingKey:s,onSelectHolding:o,onReconnect:w,isReconnecting:j}),[u,N,s,w,j]),T=!u&&!d,P=d&&!!u;let M;return T?M=i.jsx(hJ,{label:"Fetching holdings from your investment accounts"}):d&&!u?M=i.jsx(Ay,{color:"failure",icon:Qt,children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-medium mb-2",children:"Could not load your investments"}),i.jsx("p",{className:"text-sm text-slate-500",children:h instanceof Error?h.message:"Failed to fetch investment holdings"}),i.jsx(mt,{color:"failure",className:"mt-4",onClick:()=>g(),children:"Try Again"})]})}):u.empty_reason?M=i.jsx(U$e,{reason:u.empty_reason,connectionCount:y.data?.accounts?.length??0}):M=i.jsxs(i.Fragment,{children:[S.length>0&&i.jsx(V$e,{errors:S,onReconnect:w,onRetry:()=>g(),isReconnecting:j}),i.jsx(yg,{context:O})]}),i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx(I$e,{asOf:u?.as_of,pricedAsOf:u?.priced_as_of,isStale:Zxe(u?.priced_as_of),isRefreshing:p,onRefresh:()=>g()}),P&&i.jsx(Ay,{color:"warning",icon:Qt,className:"mb-[18px]",children:i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsxs("span",{className:"text-sm",children:["Could not refresh your investments â"," ",h instanceof Error?h.message:"Failed to fetch investment holdings",". Showing the last successful snapshot."]}),i.jsx(mt,{size:"xs",color:"warning",disabled:p,onClick:()=>g(),className:"ml-auto",children:p?"Retrying...":"Try Again"})]})}),i.jsx(L$e,{isAdmin:t,counts:{holdings:u?.count,accounts:k||void 0},attentionCount:E}),i.jsx("div",{className:"flex-1 min-h-0",children:M}),u&&i.jsx(X$e,{holdingKey:s,holdings:N,totals:u.totals_by_currency,asOf:u.as_of,onClose:x})]})}const nx=()=>Gv();function mJ({transaction:e}){const t=aA(e.type),n=An(e.mask);return i.jsxs("li",{className:`flex items-center gap-2.5 px-4 py-2.5 ${t?"bg-[#fffbfb]":""}`,children:[i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[i.jsx("span",{className:`min-w-0 truncate text-[13.5px] font-semibold ${t?"text-slate-500":"text-slate-900"}`,children:e.name}),i.jsx("span",{className:"flex-none",children:i.jsx(Fw,{type:e.type,subtype:e.subtype})})]}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500 mt-0.5 truncate",children:[Ue(e.date)," · ",e.institution," · ",e.account_name,n?` ${n}`:""]})]}),i.jsx("span",{className:`flex-none text-[13.5px] font-bold tabular-nums ${yV(e)}`,children:Ee(e.amount,e.currency)})]})}function Z$e({allocation:e,currency:t,total:n}){if(!e.length)return i.jsx("p",{className:"px-[18px] py-6 text-sm text-slate-500",children:"No valued positions to allocate."});const r=n>=1e3?`${Re(n/1e3,t)}k`:Re(n,t);return i.jsxs("div",{className:"flex flex-row items-center gap-5 lg:gap-[22px] px-4 py-4 lg:px-[18px] lg:py-5",children:[i.jsxs("div",{className:"relative w-[120px] h-[120px] lg:w-[180px] lg:h-[180px] flex-none",children:[i.jsx(kw,{className:"ph-no-capture",width:"100%",height:"100%",children:i.jsx(BMe,{children:i.jsx(kP,{data:e,dataKey:"value",nameKey:"security_type",cx:"50%",cy:"50%",innerRadius:"65.5%",outerRadius:"90%",paddingAngle:1,stroke:"#ffffff",strokeWidth:2,isAnimationActive:!1,children:e.map(a=>i.jsx(Ah,{fill:Ja(a.security_type)},a.security_type))})})}),i.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[i.jsx("span",{className:"text-[10px] lg:text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Total"}),i.jsx("span",{className:"text-[14px] lg:text-[19px] font-extrabold tracking-tight text-slate-900 tabular-nums",children:r})]})]}
556),i.jsx("ul",{className:"flex-1 min-w-0 w-full",children:e.map(a=>i.jsxs("li",{className:"flex items-center gap-2 lg:gap-2.5 py-1.5 lg:py-2 border-b border-dashed border-border last:border-b-0",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-[3px] flex-none",style:{background:Ja(a.security_type)}}),i.jsx("span",{className:"min-w-0 truncate text-[12.5px] lg:text-[13.5px] font-semibold text-slate-900",children:ei(a.security_type)}),i.jsxs("span",{className:"ml-auto flex items-baseline gap-3 tabular-nums",children:[i.jsx("span",{className:"text-[12px] lg:text-[13px] font-bold text-slate-700 lg:w-[52px] text-right",children:a.percent===null?"â":`${a.percent.toFixed(2)}%`}),i.jsx("span",{className:"hidden lg:inline text-[12.5px] text-slate-500 w-[92px] text-right",children:Re(a.value,t)})]})]},a.security_type))})]})}const k0=({title:e,sub:t,to:n,linkLabel:r})=>i.jsxs("div",{className:"flex items-center flex-wrap gap-x-2.5 gap-y-1 px-4 lg:px-[18px] py-3.5 border-b border-border",children:[i.jsx("h2",{className:"text-[15px] font-bold tracking-tight text-slate-900",children:e}),t&&i.jsx("span",{className:"text-[12.5px] text-slate-500 font-medium",children:t}),n&&i.jsxs(gt,{to:n,className:"ml-auto text-[12.5px] font-semibold text-brand inline-flex items-center gap-1.5",children:[r,i.jsx(va,{className:"w-3.5 h-3.5"})]})]});function J$e({totals:e,holdings:t}){const n=t.filter(l=>l.currency===e.currency),r=oA(n),a=rA(n).find(l=>l.security_type==="cash"),s=Hu(e.unrealized_gain_loss,e.cost_basis),o=e.unrealized_gain_loss>=0;return i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card flex flex-col lg:flex-row overflow-hidden mb-[18px]",children:[i.jsxs("div",{className:"p-4 lg:p-6 lg:w-[340px] flex-none lg:border-r border-border",children:[i.jsxs("p",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-slate-400",children:["Portfolio value · ",e.currency]}),i.jsx("p",{className:"text-[34px] lg:text-[38px] leading-none font-extrabold tracking-tight text-slate-900 mt-2 tabular-nums",children:Re(e.value,e.currency)}),i.jsxs("div",{className:"flex items-center flex-wrap gap-2.5 mt-2.5",children:[i.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[13px] font-bold tabular-nums ${o?"bg-badge-green text-badge-green-text":"bg-badge-red text-badge-red-text"}`,children:[i.jsx(zi,{className:"w-3.5 h-3.5"}),Ee(e.unrealized_gain_loss,e.currency)]}),i.jsxs("span",{className:"text-[12.5px] text-slate-500",children:["unrealised",s===null?"":` · ${s>0?"+":""}${s}%`]})]}),i.jsx("div",{className:"mt-3.5",children:i.jsx(rG,{missingCostBasis:r,totalPositions:n.length,coveredValue:e.covered_value,totalValue:e.value,reviewTo:"/investments/allocation"})})]}),i.jsxs("div",{className:"flex-1 grid grid-cols-3 border-t border-border lg:border-t-0",children:[i.jsxs("div",{className:"min-w-0 px-3 py-3 lg:p-[22px] border-r border-border",children:[i.jsx("p",{className:"text-[10px] lg:text-[11px] font-bold uppercase tracking-[0.08em] lg:tracking-[0.12em] text-slate-400",children:"Cost basis"}),i.jsx("p",{className:"text-[17px] lg:text-[23px] font-extrabold tracking-tight mt-[5px] lg:mt-[7px] truncate tabular-nums text-slate-900",children:Re(e.cost_basis,e.currency)}),i.jsxs("p",{className:"text-[11px] lg:text-[12.5px] text-slate-500 mt-1 lg:mt-1.5",children:["across ",n.length-r," of ",n.length," positions"]})]}),i.jsxs("div",{className:"min-w-0 px-3 py-3 lg:p-[22px] border-r border-border",children:[i.jsx("p",{className:"text-[10px] lg:text-[11px] font-bold uppercase tracking-[0.08em] lg:tracking-[0.12em] text-slate-400",children:"Positions"}),i.jsx("p",{className:"text-[17px] lg:text-[23px] font-extrabold tracking-tight mt-[5px] lg:mt-[7px] truncate tabular-nums text-slate-900",children:n.length}),i.jsxs("p",{className:"text-[11px] lg:text-[12.5px] text-slate-500 mt-1 lg:mt-1.5",children:[Po(n).length," account",Po(n).length===1?"":"s"]})]}),i.jsxs("div",{className:"min-w-0 px-3 py-3 lg:p-[22px]",children:[i.jsx("p",{className:"text-[10px] lg:text-[11px] font-bold uppercase tracking-[0.08em] lg:tracking-[0.12em] text-slate-400",children:"Cash & equivalents"}),i.jsx("p",{className:"text-[17px] lg:text-[23px] font-extrabold tracking-tight mt-[5px] lg:mt-[7px] truncate tabular-nums text-slate-900",children:Re(a?.value??0,e.currency)}),i.jsxs("p",{className:"text-[11px] lg:text-[12.5px] text-slate-500 mt-1 lg:mt-1.5",children:[a?.percent===null||a?.percent===void 0?"â":`${a.percent}%`," of portfolio"]})]})]})]})}function eIe(){const{data:e,holdings:t,onSelectHolding:n}=nx(),r=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),a=r.data?.logos??{},s=C1({startDate:Mi(30),endDate:Vr(new Date)}),o=Ou(e.totals_by_currency),l=o[0],u=Po(t),d=u[0]?.byCurrency[0]?.value??0,h=kV(r.data?.accounts??[],CV(e.errors)),p=e.allocation_by_security_type??[],g=vV(t,5),x=(s.data?.investment_transactions??[]).slice(0,5);return i.jsxs("div",{className:"pb-2",children:[o.map(y=>i.jsx(J$e,{totals:y,holdings:t},y.currency)),i.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-[18px] mb-[18px]",children:[i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card",children:[i.jsx(k0,{title:"Allocation",sub:"by security type",to:"/investments/allocation",linkLabel:"Allocation tab"}),i.jsx(Z$e,{allocation:p,currency:l?.currency??"USD",total:l?.value??0})]}),i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card",children:[i.jsx(k0,{title:"Value by account",sub:h.length>0?`${u.length} reporting · ${h.length} needs fixing`:`${u.length} investment account${u.length===1?"":"s"}`,to:"/investments/accounts",linkLabel:"Accounts tab"}),i.jsxs("div",{className:"px-4 lg:px-[18px] py-4",children:[u.map(y=>
556{const w=y.byCurrency[0],j=fu(w?.value??0,d)??0;return i.jsxs("div",{className:"py-2.5 border-b border-dashed border-border last:border-b-0",children:[i.jsxs("div",{className:"flex items-center flex-wrap gap-x-2.5 gap-y-1 mb-[7px]",children:[i.jsx(ra,{name:y.institution,logo:a[y.institution_id??""],className:"w-6 h-6"}),i.jsxs("span",{className:"min-w-0 flex-1 lg:flex-initial",children:[i.jsx("span",{className:"text-[13.5px] font-semibold text-slate-900",children:y.account_name})," ",i.jsx("span",{className:"text-[11.5px] text-slate-500",children:E1(y.institution,y.mask)})]}),i.jsx("span",{className:"ml-auto text-[13.5px] font-bold tabular-nums text-slate-900",children:Re(w?.value??0,w?.currency)}),i.jsx("span",{className:`text-[11.5px] font-bold lg:w-[86px] text-right tabular-nums ${(w?.unrealized_gain_loss??0)<0?"text-amount-neg":"text-amount-pos"}`,children:w?.partial&&w.cost_basis===0?"â":Ee(w?.unrealized_gain_loss,w?.currency)})]}),i.jsx("div",{className:"h-2 rounded-full bg-surface-muted overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full bg-brand",style:{width:`${j}%`}})})]},y.key)}),h.map(({account:y,state:w})=>{const j=_V[w];return i.jsxs("div",{className:"py-2.5 border-b border-dashed border-border last:border-b-0",children:[i.jsxs("div",{className:"flex items-center flex-wrap gap-x-2.5 gap-y-1 mb-[7px]",children:[i.jsx(ra,{name:y.name,logo:a[y.institution_id],className:"w-6 h-6"}),i.jsxs("span",{className:"min-w-0 flex-1 lg:flex-initial",children:[i.jsx("span",{className:"text-[13.5px] font-semibold text-slate-900",children:y.title||y.name})," ",i.jsx("span",{className:"text-[11.5px] text-slate-500",children:y.name})]}),i.jsxs("span",{className:`ml-auto ${ja} ${j.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${j.dotClassName}`}),j.label]}),i.jsx(gt,{to:"/investments/accounts",className:"text-[11.5px] font-bold text-brand lg:w-[86px] text-right hover:underline",children:"Fix"})]}),i.jsx("div",{className:"h-2 rounded-full bg-surface-muted overflow-hidden"})]},`needs-fixing-${y.id}`)})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-[1.35fr_1fr] gap-[18px]",children:[i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx(k0,{title:"Recent activity",sub:"last 30 days",to:"/investments/activity",linkLabel:"Activity tab"}),s.isError?i.jsx("p",{className:"px-4 lg:px-[18px] py-6 text-sm text-slate-500",children:"Recent activity could not be loaded. The holdings above are unaffected."}):x.length===0?i.jsx("p",{className:"px-4 lg:px-[18px] py-6 text-sm text-slate-500",children:s.isFetching?"Loading recent activity...":"No activity in the last 30 days."}):i.jsxs(i.Fragment,{children:[i.jsx("ul",{className:"lg:hidden divide-y divide-border","data-testid":"recent-activity-rows",children:x.map(y=>i.jsx(mJ,{transaction:y},y.investment_transaction_id))}),i.jsxs("table",{className:"hidden lg:table w-full text-[13px] text-left",children:[i.jsx("thead",{className:"bg-surface-2 border-b border-border text-[11px] font-bold uppercase tracking-wide text-slate-500",children:i.jsxs("tr",{children:[i.jsx("th",{className:"px-[18px] py-2.5",children:"Date"}),i.jsx("th",{className:"px-[18px] py-2.5",children:"Activity"}),i.jsx("th",{className:"px-[18px] py-2.5",children:"Type"}),i.jsx("th",{className:"px-[18px] py-2.5 text-right",children:"Amount"})]})}),i.jsx("tbody",{className:"divide-y divide-border",children:x.map(y=>i.jsxs("tr",{children:[i.jsx("td",{className:"px-[18px] py-3 tabular-nums text-slate-600",children:Ue(y.date)}),i.jsxs("td",{className:"px-[18px] py-3",children:[i.jsx("span",{className:"font-semibold text-slate-900",children:y.name}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500",children:[y.institution," · ",y.account_name]})]}),i.jsx("td",{className:"px-[18px] py-3",children:i.jsx(Fw,{type:y.type,subtype:y.subtype})}),i.jsx("td",{className:`px-[18px] py-3 text-right font-bold tabular-nums ${(y.amount??0)<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(y.amount,y.currency)})]},y.investment_transaction_id))})]})]}),i.jsx("p",{className:"px-4 lg:px-[18px] py-3 border-t border-border bg-surface-2 text-[12.5px] text-slate-500",children:"Money out is negative, money in is positive."})]}),i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx(k0,{title:"Largest positions",sub:"by market value",to:"/investments/holdings",linkLabel:"Holdings tab"}),g.map(y=>i.jsxs("button",{type:"button",onClick:()=>n(vn(y)),className:"w-full flex items-center gap-2.5 px-4 lg:px-[18px] py-3 border-b border-border last:border-b-0 hover:bg-slate-100 transition-colors text-left",children:[i.jsx(oc,{ticker:y.ticker,className:"w-[38px] h-[38px] rounded-[9px] bg-surface-muted text-slate-600"}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:y.security_name??y.ticker??"Unknown security"}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500",children:[y.quantity??"â"," units · ",Re(y.price,y.currency)]})]}),i.jsxs("span",{className:"ml-auto flex-none text-right tabular-nums",children:[i.jsx("span",{className:"block text-[13.5px] font-bold text-slate-900",children:Re(y.value,y.currency)}),i.jsx("span",{className:`block text-[11.5px] font-bold ${y.unrealized_gain_loss===null?"text-slate-300":y.unrealized_gain_loss<0?"text-amount-neg":"text-amount-pos"}`,children:y.unrealized_gain_loss===null?"not reported":Ee(y.unrealized_gain_loss,y.currency)})]})]},vn(y))),i.jsxs("p",{className:"px-4 lg:px-[18px] py-3 border-t border-border bg-surface-2 text-[12.5px] text-slate-500",children:["Showing ",g.length," of ",t.length]})]})]})]})}const tIe=[{field:"security",label:"Security",align:"left",width:"w-[300px]"},{field:"quantity",label:"Quantity",align:"right",width:"w-[118px]"},{field:"price",label:"Price",align:"right",width:"w-[118px]"},{field:"value",label:"Value",align:"right",width:"w-[135px]"},{field:"cost_basis",label:"Cost basis",align:"right",width:"w-[130px]"},{field:"unrealized_gain_loss",label:"Unrealised G/L",align:"right",width:"w-[150px]"}];function nIe({sortField:e,sortDirection:t,onSort:n}){return i.jsx("thead",{className:"sticky top-0 z-[2] bg-surface-2 border-b border-border text-[11px] font-bold uppercase tracking-wide text-slate-500",children:i.jsxs("tr",{children:[tIe.map(({field:r,label:a,align:s,width:o})=>{const l=e===r,u=t==="asc"?BU:Ca;return i.jsx("th",{className:`px-4 py-3 ${o} ${s==="right"?"text-right":""}`,children:i.jsxs("button",{type:"button",onClick:()=>n(r),className:`inline-flex items-center gap-1 uppercase ${l?"text-brand":""}`,children:[a,l&&i.jsx(u,{className:"w-3 h-3"})]})},r)}),i.jsx("th",{className:"px-4 py-3 w-[110px]",children:"Type"}),i.jsx("th",{className:"px-4 py-3 w-[60px]"})]})})}function rIe({holding:e,isSelected:t,onSelect:n}){const r=Hu(e.unrealized_gain_loss,e.cost_basis),a=(e.unrealized_gain_loss??0)<0;
556return i.jsxs("tr",{onClick:n,className:`cursor-pointer transition-colors ${t?"bg-brand-soft":"hover:bg-surface-muted"}`,children:[i.jsx("td",{className:"px-4 py-3 max-w-[300px]",children:i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx(oc,{ticker:e.ticker}),i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:"block text-[13px] font-bold text-slate-900 truncate",children:e.ticker??"Cash"}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 truncate",title:e.security_name??void 0,children:e.security_name??"Unknown security"})]})]})}),i.jsx("td",{className:"px-4 py-3 text-right tabular-nums whitespace-nowrap",children:hu(e.quantity)}),i.jsxs("td",{className:"px-4 py-3 text-right tabular-nums whitespace-nowrap",children:[Re(e.price,e.currency),e.price_as_of&&i.jsx("span",{className:"block text-[11px] text-slate-400",children:e.price_as_of})]}),i.jsx("td",{className:"px-4 py-3 text-right tabular-nums font-bold whitespace-nowrap",children:Re(e.value,e.currency)}),i.jsx("td",{className:"px-4 py-3 text-right tabular-nums whitespace-nowrap",children:e.cost_basis===null?i.jsx("span",{className:"text-slate-300 font-semibold",children:"â"}):Re(e.cost_basis,e.currency)}),i.jsx("td",{className:"px-4 py-3 text-right tabular-nums whitespace-nowrap",children:e.unrealized_gain_loss===null?i.jsx("span",{className:"text-slate-300 font-semibold",children:"not reported"}):i.jsxs("span",{className:`font-bold ${a?"text-amount-neg":"text-amount-pos"}`,children:[Ee(e.unrealized_gain_loss,e.currency),r!==null&&i.jsxs("span",{className:"text-[11px] font-bold",children:[" ","(",r>0?"+":"",r,"%)"]})]})}),i.jsx("td",{className:"px-4 py-3",children:i.jsx("span",{className:"inline-flex rounded-full px-2.5 py-[3px] text-[10.5px] font-bold capitalize text-white",style:{background:Ja(e.security_type)},children:ei(e.security_type)})}),i.jsx("td",{className:"px-4 py-3",children:i.jsx(va,{className:"w-4 h-4 text-slate-400"})})]})}const oF=8;function aIe({group:e,logo:t,isExpanded:n,onToggleExpand:r,selectedHoldingKey:a,onSelectHolding:s}){const o=e.byCurrency[0],l=n?Ca:va;return i.jsxs(i.Fragment,{children:[i.jsx("tr",{className:"bg-surface-2",children:i.jsx("td",{colSpan:oF,className:"px-4 py-2.5",children:i.jsxs("button",{type:"button",onClick:()=>r(!n),className:"w-full flex items-center gap-2.5 text-left",children:[i.jsx(l,{className:"w-4 h-4 text-slate-500 flex-none"}),i.jsx(ra,{name:e.institution,logo:t}),i.jsxs("span",{children:[i.jsx("span",{className:"text-[13.5px] font-bold text-slate-900",children:e.institution})," ",i.jsxs("span",{className:"text-[11.5px] text-slate-500 font-medium",children:["· ",e.accounts.length," account",e.accounts.length===1?"":"s"," ·"," ",e.holdingCount," position",e.holdingCount===1?"":"s"]})]}),i.jsxs("span",{className:"ml-auto flex items-baseline gap-3.5 tabular-nums",children:[i.jsx("span",{className:"text-[13.5px] font-extrabold text-slate-900",children:Re(o?.value??0,o?.currency)}),i.jsx("span",{className:`text-xs font-bold ${(o?.unrealized_gain_loss??0)<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(o?.unrealized_gain_loss,o?.currency)})]})]})})}),n&&e.accounts.map(u=>i.jsxs(ve.Fragment,{children:[i.jsx("tr",{children:i.jsxs("td",{colSpan:oF,className:"pl-11 pr-4 py-[7px] bg-[#fcfdff]",children:[i.jsx("span",{className:"text-[11.5px] font-bold uppercase tracking-wide text-slate-500",children:u.account_name}),i.jsxs("span",{className:"ml-2 text-[11px] font-semibold text-slate-400",children:[u.account_subtype??"investment",An(u.mask)?` · ${An(u.mask)}`:""," ·"," ",Re(u.byCurrency[0]?.value??0,u.byCurrency[0]?.currency)]})]})}),u.holdings.map(d=>i.jsx(rIe,{holding:d,isSelected:a===vn(d),onSelect:()=>s(vn(d))},vn(d)))]},u.key))]})}function sIe({holding:e,isSelected:t,onSelect:n}){const r=e.unrealized_gain_loss;return i.jsxs("button",{type:"button",onClick:n,className:`w-full flex items-center gap-2.5 px-4 py-2.5 min-h-[58px] text-left transition-colors ${t?"bg-brand-soft":"hover:bg-surface-muted"}`,children:[i.jsx(oc,{ticker:e.ticker,className:"w-[38px] h-[38px] rounded-[9px] bg-surface-muted text-slate-600"}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[13.5px] font-semibold text-slate-900 truncate",children:e.security_name??e.ticker??"Unknown security"}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500 mt-0.5 truncate tabular-nums",children:[hu(e.quantity)," units Ã"," ",Re(e.price,e.currency)]})]}),i.jsxs("span",{className:"flex-none text-right tabular-nums",children:[i.jsx("span",{className:"block text-[13.5px] font-bold text-slate-900",children:Re(e.value,e.currency)}),i.jsx("span",{className:`block text-[11.5px] font-bold ${r===null?"text-slate-300":r<0?"text-amount-neg":"text-amount-pos"}`,children:r===null?"not reported":Ee(r,e.currency)})]})]})}function iIe({groups:e,logos:t,collapsed:n,onToggleExpand:r,selectedHoldingKey:a,onSelectHolding:s}){return e.length===0?i.jsx("p",{className:"px-4 py-10 text-center text-sm text-slate-500",children:"No positions match these filters."}):i.jsx("div",{"data-testid":"holdings-row-list",children:e.map(o=>{const l=!n.includes(o.institution),u=o.byCurrency[0],d=l?Ca:va;return i.jsxs("section",{className:"border-b border-border last:border-b-0",children:[i.jsxs("button",{type:"button",onClick:()=>r(o.institution,!l),"aria-expanded":l,className:"w-full flex items-center gap-2.5 px-4 py-2.5 min-h-[48px] bg-surface-2 text-left",children:[i.jsx(d,{className:"w-4 h-4 text-slate-500 flex-none"}),i.jsx(ra,{name:o.institution,logo:t[o.institution_id??""]}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[13.5px] font-bold text-slate-900 truncate",children:o.institution}),i.jsxs("span",{className:"block text-[11px] text-slate-500 font-medium",children:[o.holdingCount," position",o.holdingCount===1?"":"s"]})]}),i.jsxs("span",{className:"flex-none text-right tabular-nums",children:[i.jsx("span",{className:"block text-[13.5px] font-extrabold text-slate-900",children:Re(u?.value??0,u?.currency)}),i.jsx("span",{className:`block text-[11.5px] font-bold ${(u?.unrealized_gain_loss??0)<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(u?.unrealized_gain_loss,u?.currency)})]})]}),l&&o.accounts.map(h=>i.jsxs("div",{className:"divide-y divide-border border-t border-border",children:[i.jsxs("p",{className:"px-4 py-[7px] text-[11px] font-bold uppercase tracking-wide text-slate-500 truncate",children:[h.account_name,i.jsxs("span",{className:"ml-2 normal-case font-semibold text-slate-400",children:[h.account_subtype??"investment",An(h.mask)?` · ${An(h.mask)}`:""]})]}),h.holdings.map(p=>i.jsx(sIe,{holding:p,isSelected:a===vn(p),onSelect:()=>s(vn(p))},vn(p)))]},h.key))]},o.institution_id??o.institution)})})}const lF=(e,t)=>t==="security"?e.ticker??e.security_name??"":e[t]??Number.NEGATIVE_INFINITY;function oIe(){const{data:e,holdings:t,selectedHoldingKey:n,onSelectHolding:r}=nx(),a=Ms(),[s,o]=v.useState(""),[l,u]=v.useState([]),[d,h]=v.useState([]),[p,g]=v.useState("value"),[x,y]=v.useState("desc"),[w,j]=v.useState([]),k=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}).data?.logos??{},S=v.useMemo(()=>{const B=new Map;return t.forEach(U=>{B.set(aC(U),E1(U.account_name,U.mask))}),[...B.entries()].map(([U,z])=>({id:U,title:z}))},[t]),E=v.useMemo(()=>{const B=new Set;return t.forEach(U=>B.add(U.security_type||"unknown")),[...B].map(U=>({id:U,title:ei(U)}))}
556,[t]),O=v.useMemo(()=>{const B=s.trim().toLowerCase();return t.filter(U=>l.length&&!l.includes(aC(U))||d.length&&!d.includes(U.security_type||"unknown")?!1:B?(U.ticker??"").toLowerCase().includes(B)||(U.security_name??"").toLowerCase().includes(B):!0)},[t,s,l,d]),T=v.useMemo(()=>{const B=x==="asc"?1:-1;return(U,z)=>{const $=lF(U,p),K=lF(z,p);return typeof $=="string"||typeof K=="string"?String($).localeCompare(String(K))*B:($-K)*B}},[p,x]),P=v.useMemo(()=>Hxe(O,T),[O,T]),D=O.length!==t.length?Ou(O1(O))[0]:Ou(e.totals_by_currency)[0],A=B=>{if(B===p){y(U=>U==="asc"?"desc":"asc");return}g(B),y(B==="security"?"asc":"desc")},L=w.length===P.length&&P.length>0,F=(B,U)=>j(z=>U?z.filter($=>$!==B):[...z,B]);return i.jsxs("div",{className:"flex flex-col min-h-0",children:[i.jsxs("div",{className:"flex items-center gap-2.5 mb-4 flex-wrap",children:[i.jsxs("div",{className:"relative w-full lg:w-auto lg:flex-1 lg:min-w-[220px] lg:max-w-[340px]",children:[i.jsx(uh,{className:vG}),i.jsx("input",{value:s,onChange:B=>o(B.target.value),placeholder:"Search ticker or security name",className:wG})]}),i.jsx(ko,{label:"Accounts",options:S,selectedValues:l,onChange:u}),i.jsx(ko,{label:"Security type",options:E,selectedValues:d,onChange:h}),i.jsxs("div",{className:"w-full lg:w-auto lg:ml-auto inline-flex flex-wrap items-baseline gap-x-2.5 bg-surface border border-border rounded-lg px-3.5 py-2 shadow-card",children:[i.jsxs("span",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:[O.length," position",O.length===1?"":"s"]}),i.jsx("span",{className:"text-base font-extrabold tracking-tight tabular-nums text-slate-900",children:Re(D?.value??0,D?.currency)}),i.jsx("span",{className:`text-[12.5px] font-bold tabular-nums ${(D?.unrealized_gain_loss??0)<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(D?.unrealized_gain_loss,D?.currency)})]})]}),i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden flex flex-col min-h-0",children:[i.jsx("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border",children:i.jsxs("button",{type:"button",onClick:()=>j(L?[]:P.map(B=>B.institution)),className:"flex items-center gap-2 min-h-[42px] lg:min-h-0 text-sm font-medium text-slate-500 hover:text-slate-900",children:[L?i.jsx(va,{className:"w-4 h-4"}):i.jsx(Ca,{className:"w-4 h-4"}),L?"Expand All":"Collapse All"]})}),a?i.jsx("div",{className:"overflow-auto flex-1 min-h-0",children:i.jsxs("table",{className:"w-full text-[13px] text-left text-slate-900",children:[i.jsx(nIe,{sortField:p,sortDirection:x,onSort:A}),i.jsxs("tbody",{className:"bg-white divide-y divide-border",children:[P.map(B=>i.jsx(aIe,{group:B,logo:k[B.institution_id??""],isExpanded:!w.includes(B.institution),onToggleExpand:U=>F(B.institution,U),selectedHoldingKey:n,onSelectHolding:r},B.institution_id??B.institution)),P.length===0&&i.jsx("tr",{children:i.jsx("td",{colSpan:8,className:"px-4 py-10 text-center text-sm text-slate-500",children:"No positions match these filters."})})]})]})}):i.jsx(iIe,{groups:P,logos:k,collapsed:w,onToggleExpand:F,selectedHoldingKey:n,onSelectHolding:r}),i.jsx("p",{className:"px-4 py-3 border-t border-border bg-surface-2 text-[12.5px] text-slate-500",children:"Click any row to open the position detail. Values are a point-in-time snapshot, not your broker's end-of-day statement."})]})]})}function lIe(e){if(e.length<=3)return[e,[]];let t=0,n=0;for(;n<e.length-1&&t<60;)t+=e[n].percent,n+=1;return[e.slice(0,n),e.slice(n)]}const cIe=e=>{const t=e.reduce((n,r)=>n+r.percent,0);return t<=0?e.map(()=>100/Math.max(e.length,1)):e.map(n=>n.percent/t*100)};function uIe({holdings:e,total:t,onSelectHolding:n}){const r=e.filter(u=>u.value!==null&&u.value>0).map(u=>({holding:u,percent:fu(u.value,t)??0})).sort((u,d)=>d.percent-u.percent);if(!r.length)return i.jsx("p",{className:"px-[18px] py-6 text-sm text-slate-500",children:"No valued positions to map."});const[a,s]=lIe(r),o=s.length?[a,s]:[a],l=s.length?["55%","45%"]:["100%"];return i.jsxs("div",{className:"px-4 lg:px-[18px] py-4",children:[i.jsx("div",{className:"h-[260px] lg:h-[360px] flex flex-col gap-[3px]",children:o.map((u,d)=>{const h=cIe(u);return i.jsx("div",{className:"flex gap-[3px]",style:{height:l[d]},children:u.map((p,g)=>{const x=h[g],y=x<9;return i.jsxs("button",{type:"button",onClick:()=>n(vn(p.holding)),style:{width:`${x}%`,background:Ja(p.holding.security_type)},className:`rounded-md overflow-hidden text-left text-white flex flex-col justify-between ${y?"px-[7
556px] py-1.5":"px-2.5 py-2.5"}`,children:[i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:`block font-extrabold tracking-tight leading-tight truncate ${y?"text-[10.5px]":"text-[13px]"}`,children:p.holding.ticker??"Cash"}),!y&&i.jsx("span",{className:"block text-[10.5px] font-medium opacity-90 leading-tight mt-0.5 line-clamp-2",children:p.holding.security_name??""})]}),i.jsxs("span",{className:"min-w-0",children:[!y&&i.jsx("span",{className:"block text-[11.5px] font-bold tabular-nums",children:Re(p.holding.value,p.holding.currency)}),i.jsxs("span",{className:`block font-semibold tabular-nums opacity-90 ${y?"text-[9.5px]":"text-[10.5px]"}`,children:[p.percent.toFixed(1),"%"]})]})]},vn(p.holding))})},d)})}),i.jsx("ul",{className:"flex flex-wrap gap-4 mt-3.5 pt-3 border-t border-border",children:[...new Set(r.map(u=>u.holding.security_type||"unknown"))].map(u=>i.jsxs("li",{className:"flex items-center gap-[7px] text-[12.5px] font-semibold text-slate-600",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-[3px]",style:{background:Ja(u)}}),ei(u)]},u))})]})}function dIe({accounts:e,logos:t}){return i.jsx("div",{className:"px-[18px] py-4",children:e.map(n=>{const r=n.byCurrency[0];return i.jsxs("div",{className:"mb-4 last:mb-0",children:[i.jsxs("div",{className:"flex items-center gap-2.5 mb-[7px]",children:[i.jsx(ra,{name:n.institution,logo:t[n.institution_id??""],className:"w-6 h-6"}),i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:"text-[13.5px] font-semibold text-slate-900",children:n.account_name})," ",i.jsx("span",{className:"text-[11.5px] text-slate-500",children:n.institution})]}),i.jsx("span",{className:"ml-auto text-[13.5px] font-bold tabular-nums text-slate-900",children:Re(r?.value??0,r?.currency)})]}),i.jsx("div",{className:"flex gap-0.5 h-6 rounded-md overflow-hidden bg-surface-muted",children:n.allocation.map(a=>i.jsx("span",{style:{width:`${a.percent??0}%`,background:Ja(a.security_type)},className:"flex items-center justify-center text-[10px] font-bold text-white overflow-hidden whitespace-nowrap",children:(a.percent??0)>=18&&`${ei(a.security_type)} ${Math.round(a.percent??0)}%`},a.security_type))})]},n.key)})})}function fIe({holdings:e,totals:t,onSelectHolding:n,onAddCostBasis:r}){const a=iA(e);if(a.length===0)return null;const s=e.length-a.length,o=t?fu(t.covered_value,t.value):null;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-wrap lg:flex-nowrap gap-3.5 items-center bg-badge-yellow border border-[#fde68a] rounded-xl px-4 lg:px-[18px] py-3.5 mb-[18px]",children:[i.jsx("span",{className:"w-[34px] h-[34px] rounded-[9px] bg-[#fef08a] text-badge-yellow-text flex-none flex items-center justify-center",children:i.jsx(Qt,{className:"w-[18px] h-[18px]"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("p",{className:"text-sm font-extrabold text-[#854d0e]",children:["Partial totals â gain/loss covers ",s," of ",e.length," positions"]}),i.jsxs("p",{className:"text-[12.5px] text-[#854d0e] mt-0.5 leading-relaxed",children:[i.jsxs("b",{children:[a.length," position",a.length===1?"":"s"," carr",a.length===1?"ies":"y"," no cost basis"]}),", so they are excluded from gain/loss rather than counted as zero",o===null?"":`. Covered positions are ${o}% of portfolio value`,". Add the cost you paid to bring them in."]})]}),i.jsxs("button",{type:"button",onClick:()=>r(a[0]),className:"w-full lg:w-auto justify-center h-[42px] lg:h-auto inline-flex items-center gap-2 px-3.5 py-2.5 rounded-lg font-semibold text-white bg-badge-yellow-text hover:opacity-90 shadow-[0_6px_16px_-6px_rgba(161,98,7,0.5)] flex-none",children:[i.jsx(Qs,{className:"w-[15px] h-[15px]"}),"Add cost basis"]})]}),i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsxs("div",{className:"flex items-center flex-wrap gap-x-2.5 gap-y-1 px-4 lg:px-[18px] py-3.5 border-b border-border",children:[i.jsx("h2",{className:"text-[15px] font-bold tracking-tight text-slate-900",children:"Positions missing cost basis"}),i.jsx("span",{className:"text-[12.5px] text-slate-500 font-medium",children:"excluded from gain/loss until you add a cost"}),i.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 rounded-full px-2.5 py-[3px] text-[11px] font-bold bg-badge-yellow text-badge-yellow-text",children:[i.jsx(Qt,{className:"w-3 h-3"}),a.length," to review"]})]}),a.map(l=>{const u=l.is_cash_equivalent===!0;return i.jsxs("div",{className:"flex flex-wrap lg:flex-nowrap items-center gap-x-3.5 gap-y-2 px-4 lg:px-[18px] py-3 border-b border-border last:border-b-0",children:[i.jsxs("button",{type:"button",onClick:()=>n(vn(l)),className:"flex items-center gap-2.5 min-w-0 flex-1 lg:w-[280px] lg:flex-none text-left group",children:[i.jsx(oc,{ticker:l.ticker,fallback:"CASH",className:"w-9 h-9 rounded-[9px] bg-surface-muted text-slate-600"}),i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:"block text-[13.5px] font-bold text-slate-900 group-hover:text-brand truncate",children:l.ticker??"Cash"}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500 truncate",children:[l.security_name??"Unknown security"," · ",l.account_name]})]})]}),i.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[10.5px] font-bold whitespace-nowrap ${u?"bg-surface-muted text-slate-600":"bg-badge-yellow text-badge-yellow-text"}`,children:[u?i.jsx(ac,{className:"w-3 h-3"}):i.jsx(Qt,{className:"w-3 h-3"}),u?"Cash sweep â usually no gain":"No cost basis"]}),i.jsxs("span",{className:"ml-auto text-right tabular-nums",children:[i.jsx("span",{className:"block text-[13.5px] font-extrabold text-slate-900",children:Re(l.value,l.currency)}),i.jsxs("span",{className:"block text-[11px] text-slate-500",children:[hu(l.quantity)," units · ",Re(l.price,l.currency)]})]}),i.jsxs("button",{type:"button",onClick:()=>r(l),className:"w-full lg:w-auto justify-center h-[42px] lg:h-auto inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-[12.5px] font-bold border border-brand bg-brand-soft text-brand hover:bg-brand hover:text-white whitespace-nowrap",children:[i.jsx(Qs,{className:"w-3.5 h-3.5"}),"Add cost basis"]})]},vn(l))}),i.jsxs("p",{className:"flex gap-2 items-start px-4 lg:px-[18px] py-3 bg-surface-2 border-t border-border text-xs text-slate-600 leading-relaxed",children:[i.jsx(Qt,{className:"w-[15px] h-[15px] flex-none mt-px text-slate-400"}),i.jsx("span",{children:"A cost you enter is stored on your Moneylogz position only â it never changes your broker. If the institution later reports its own cost basis, that reported value takes over. Money-market sweeps rarely have a real gain, so adding a cost there is o
556ptional."})]})]})]})}const _5=({label:e,value:t})=>i.jsxs("div",{className:"flex-1 px-3.5 py-3 border-r border-border last:border-r-0",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.09em] text-slate-400",children:e}),i.jsx("p",{className:"text-[15px] font-extrabold tracking-tight mt-1 tabular-nums text-slate-900",children:t})]});function hIe({holding:e,onClose:t}){const n=!!e;return qo(n),v.useEffect(()=>{if(!n)return;const r=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n,t]),e?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 bg-[rgba(17,24,39,0.5)] z-40",onClick:t,"aria-hidden":"true"}),i.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center p-0 lg:items-center lg:p-6",role:"dialog","aria-label":"Add cost basis",children:i.jsxs("div",{className:"w-full lg:w-[480px] max-w-full max-h-[92dvh] overflow-y-auto lg:max-h-none lg:overflow-hidden bg-surface rounded-t-2xl lg:rounded-2xl shadow-[0_24px_60px_rgba(15,23,42,0.28)] pb-[env(safe-area-inset-bottom)] lg:pb-0",children:[i.jsxs("div",{className:"flex items-start gap-3.5 px-4 lg:px-[22px] pt-5 pb-4 border-b border-border",children:[i.jsx(oc,{ticker:e.ticker,fallback:"CASH",className:"w-11 h-11 rounded-[11px] bg-brand-soft text-brand"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-lg font-extrabold tracking-tight text-slate-900",children:"Add cost basis"}),i.jsxs("p",{className:"text-[13px] text-slate-500 mt-0.5 truncate",children:[e.ticker??"Cash position"," · ",e.security_name??"Unknown security"]})]}),i.jsx("button",{type:"button",onClick:t,"aria-label":"Close",className:"ml-auto w-[42px] h-[42px] lg:w-8 lg:h-8 rounded-lg border border-border flex items-center justify-center text-slate-500 hover:bg-slate-100 flex-none",children:i.jsx(Ut,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"px-4 lg:px-[22px] pt-4 pb-5",children:[i.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-4",children:[i.jsxs("span",{className:"inline-flex items-center rounded-full px-2.5 py-1 text-[11px] font-bold bg-surface-muted text-slate-600",children:[e.institution,An(e.mask)?` · ${An(e.mask)}`:""]}),i.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-bold bg-badge-yellow text-badge-yellow-text",children:[i.jsx(Qt,{className:"w-3 h-3"}),"No cost basis reported"]})]}),i.jsxs("div",{className:"flex rounded-[11px] border border-border bg-surface-2 overflow-hidden mb-4",children:[i.jsx(_5,{label:"Quantity",value:e.quantity===null?"â":String(e.quantity)}),i.jsx(_5,{label:"Price",value:Re(e.price,e.currency)}),i.jsx(_5,{label:"Market value",value:Re(e.value,e.currency)})]}),i.jsx(yE,{holding:e,onSaved:t,autoFocus:!0})]})]})})]}):null}const S0=({title:e,sub:t})=>i.jsxs("div",{className:"flex items-center flex-wrap gap-x-2.5 gap-y-1 px-4 lg:px-[18px] py-3.5 border-b border-border",children:[i.jsx("h2",{className:"text-[15px] font-bold tracking-tight text-slate-900",children:e}),t&&i.jsx("span",{className:"text-[12.5px] text-slate-500 font-medium",children:t})]});function pIe(e){const t=new Map;return e.forEach(n=>{const r=n.security_type||"unknown";t.has(r)||t.set(r,{costBasis:0,coveredValue:0,covered:0,positions:0});const a=t.get(r);a.positions+=1,n.cost_basis!==null&&n.cost_basis!==void 0&&n.value!==null&&n.value!==void 0&&(a.costBasis+=n.cost_basis,a.coveredValue+=n.value,a.covered+=1)}),t}function mIe(){const{data:e,holdings:t,onSelectHolding:n}=nx(),[r,a]=v.useState(null),o=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}).data?.logos??{},l=Ou(e.totals_by_currency),u=l[0],d=e.allocation_by_security_type??[],h=v.useMemo(()=>Po(t),[t]),p=v.useMemo(()=>pIe(t),[t]),g=d[0]?.value??0,x=v.useMemo(()=>t.filter(N=>N.currency===u?.currency),[t,u?.currency]),y=v.useMemo(()=>[...x].sort((N,k)=>(k.value??0)-(N.value??0)).slice(0,5),[x]),w=y.slice(0,3).reduce((N,k)=>N+(fu(k.value,u?.value??0)??0),0),j=y.slice(0,3).reduce((N,k)=>N+(k.value??0),0);return i.jsxs("div",{className:"pb-2",children:[i.jsx(fIe,{holdings:t,totals:u,onSelectHolding:n,onAddCostBasis:N=>a(vn(N))}),i.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-[1fr_320px] gap-[18px] mb-[18px]",children:[i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx(S0,{title:"Position map",sub:"tile area = market value · colour = security type"}),i.jsx(uIe,{holdings:x,total:u?.value??0,onSelectHolding:n})]}),i.jsxs("div",{className:"flex flex-col gap-[18px]",children:[i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-[18px] py-4",children:[i.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-slate-400",children:"Top 3 concentration"}),i.jsxs("p",{className:"text-[28px] font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:[w.toFixed(1),"%"]}),i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-1 leading-relaxed",children:[y.slice(0,3).map(N=>N.ticker??"Cash").join(", ")," ","together account for ",Re(j,u?.currency)," of the portfolio."]})]}),i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx(S0,{title:"Largest exposures"}),i.jsx("ol",{className:"py-1.5",children:y.map((N,k)=>i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>n(vn(N)),className:"w-full flex items-center gap-2.5 px-[18px] py-2.5 border-b border-dashed border-border last:border-b-0 hover:bg-slate-100 text-left",children:[i.jsx("span",{className:"w-5 h-5 rounded-md bg-surface-muted text-slate-500 text-[10.5px] font-extrabold flex items-center justify-center flex-none",children:k+1}),i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:"block text-[13px] font-bold text-slate-900",children:N.ticker??"Cash"}),i.jsxs("span",{className:"block text-[11.5px] text-slate-500 truncate",children:[ei(N.security_type)," · ",N.account_name]})]}),i.jsxs("span",{className:"ml-auto text-[13px] font-extrabold tabular-nums text-slate-900",children:[(fu(N.value,u?.value??0)??0).toFixed(1),"%"]})]})},vn(N)))})]}),i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card px-[18px] py-4",children:[i.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-slate-400",children:"Currencies"}),i.jsx("p",{className:"text-[28px] font-extrabold tracking-tight mt-1.5 text-slate-900",children:l.length===1?`${l[0].currency} only`:`${l.length} currencies`}),i.jsx("p",{className:"text-[12.5px] text-slate-500 mt-1 leading-relaxed",children:l.length===1?`All ${t.length} positions report in ${l[0].currency}. Values in different currencies are never added together â a second currency would get its own total.`:`${l.map(N=>`${N.currency} ${Re(N.value,N.currency)}`).join(" · ")}. These are never added together.`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-[18px]",children:[i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx(S0,{title:"Mix by account",sub:"share of each account's value"}),i.jsx(dIe,{accounts:h,logos:o})]}),i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden",children:[i.jsx(S0,{title:"By security type",sub:"value against cost basis"}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-[13px] text-left",children:[i.jsx("thead",{className:"bg-surface-2 border-b border-border text-[11px] font-bold uppercase tracking-wide text-slate-500",children:i.jsxs("tr",{children:[i.jsx("th",{className:"px-[18px] py-3",children:"Type"}),i.jsx("th",{className:"px-[18px] py-3 text-right",children:"Value"}),i.jsx("th",{className:"px-[18px] py-3 text-right",children:"Cost basis"}),i.jsx("th",{className:"px-[18px] py-3 text-right",children:"Unrealised G/L"})]})}),i.jsx("tbody",{className:"divide-y divide-border",children:d.map(N=>{const k=p.get(N.security_type),S=k!==void 0&&k.costBasis>0,E=S?k.coveredValue-k.costBasis:null,O=Hu(E,k?.costBasis),T=S&&k.covered<k.positions;return i.jsxs("tr",{children:[i.jsxs("td",{className:"px-[18px] py-3",children:[i.jsxs("div",{className:"flex items-center gap-2.5 font-bold text-slate-900",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-[3px]",style:{background:Ja(N.security_type)}}),ei(N.security_type)]}),i.jsx("div",{className:"h-1.5 w-[120px] rounded-full bg-surface-muted overflow-hidden mt-1.5",children:i.jsx("span",{className:"block h-full rounded-full",style:{width:`${fu(N.value,g)??0}%`,background:Ja(N.security_type)}})})]}),i.jsxs("td",{className:"px-[18px] py-3 text-right tabular-nums",children:[Re(N.value,u?.currency),i.jsx("span",{className:"block text-[11px] text-slate-500",children:N.percent===null?"â":`${N.percent}%`})]}),i.jsx("td",{className:"px-[18px] py-3 text-right tabular-nums",children:S?i.jsxs(i.Fragment,{children:[Re(k.costBasis,u?.currency),T&&i.jsxs("span",{className:"block text-[11px] text-slate-500",children:[k.covered," of ",k.positions," positions"]})]}):i.jsx("span",{className:"text-slate-300 font-semibold",children:"â"})}),i.jsx("td",{className:"px-[18px] py-3 text-right tabular-nums",children:E===null?i.jsx("span",{className:"text-slate-300 font-semibold",children:"not reported"}):i.jsxs("span",{className:`font-bold ${E<0?"text-amount-neg":"text-amount-pos"}`,children:[Ee(E,u?.currency),O!==null&&i.jsxs("span",{className:"block text-[11px] font-bold",children:[O>0?"+":"",O,"%"]}),T&&i.jsx("span",{className:"block text-[11px] font-semibold text-slate-500",children:"partial"})]})})]},N.security_type)})}),i.jsx("tfoot",{children:i.jsxs("tr",{className:"bg-surface-2 border-t border-border font-extrabold",children:[i.jsxs("td",{className:"px-[18px] py-3",children:["Total · ",u?.currency??"USD"]}),i.jsx("td",{className:"px-[18px] py-3 text-right tabular-nums",children:Re(u?.value??0,u?.currency)}),i.jsx("td",{className:"px-[18px] py-3 text-right tabular-nums",children:Re(u?.cost_basis??0,u?.currency)}),i.jsx("td",{className:`px-[18px] py-3 text-right tabular-nums ${(u?.unrealized_gain_loss??0)<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(u?.unrealized_gain_loss,u?.currency)})]})})]})})]})]}),i.jsx(hIe,{holding:sA(t,r),onClose:()=>a(null)})]})}function k5(e){const{rollup:t,institution:n,accountTitle:r,subtype:a,mask:s,logo:o,accountError:l}=e,u=NV({withoutInvestments:e.withoutInvestments,errorCode:l?.code??null,status:e.status}),d=_V[u],h=t?.byCurrency[0],p=Hu(h?.unrealized_gain_loss,h?.cost_basis),g=u==="active"&&!!h;return i.jsxs("section",{className:`bg-surface border rounded-xl shadow-card flex flex-col overflow-hidden ${u==="login_required"?"border-red-200":"border-border"}`,children:[i.jsxs("div",{className:"flex items-start gap-2.5 px-4 lg:px-[18px] pt-4 pb-3.5",children:[i.jsx(ra,{name:n,logo:o,className:"w-[38px] h-[38px]"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-[15px] font-bold tracking-tight leading-tight text-slate-900",children:r}),i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:[n,An(s)?` · ${An(s)}`:""]}),i.jsxs("div",{className:"mt-[7px] flex gap-1.5 flex-wrap",children:[i.jsx("span",{className:"inline-flex rounded-[5px] px-[7px] py-0.5 text-[10px] font-extrabold uppercase tracking-wide bg-surface-muted text-slate-600",children:a??"investment"}),i.jsxs("span",{className:`${ja} ${d.className}`,children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${d.dotClassName}`}),d.label]})]})]})]}),g?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"px-4 lg:px-[18px] pb-3.5",children:[i.jsx("p",{className:"text-[26px] font-extrabold tracking-tight tabular-nums text-slate-900",children:Re(h.value,h.currency)}),i.jsxs("p",{className:"flex items-center gap-2 mt-1.5 text-[12.5px]",children:[i.jsx("span",{className:`font-bold tabular-nums ${h.unrealized_gain_loss<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(h.unrealized_gain_loss,h.currency)}),i.jsxs("span",{className:"text-slate-500",children:["unrealised",p===null?"":` · ${p>0?"+":""}${p}%`]})]})]}),i.jsx("div",{className:"flex gap-0.5 h-2 mx-4 lg:mx-[18px] mb-2 rounded-full overflow-hidden bg-surface-muted",children:t.allocation.map(x=>i.jsx("span",{style:{width:`${x.percent??0}%`,background:Ja(x.security_type)}},x.security_type))}),i.jsx("ul",{className:"flex flex-wrap gap-3 px-4 lg:px-[18px] pb-3.5 text-[11.5px] font-semibold text-slate-500",children:t.allocation.slice(0,3).map(x=>i.jsxs("li",{children:[i.jsx("span",{className:"inline-block w-2 h-2 rounded-sm mr-1.5",style:{background:Ja(x.security_type)}}),ei(x.security_type)," ",Math.round(x.percent??0),"%"]},x.security_type))}),i.jsxs("div",{className:"border-t border-border px-4 lg:px-[18px] py-3 flex-1",children:[i.jsxs("p",{className:"text-[10.5px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-2.5",children:["Top holdings · ",t.holdings.length," position",t.holdings.length===1?"":"s"]}),t.holdings.slice(0,3).map(x=>i.jsxs("button",{type:"button",onClick:()=>e.onSelectHolding(vn(x)),className:"w-full flex items-center gap-2.5 py-1.5 text-[13px] text-left hover:text-brand",children:[i.jsx("span",{className:"font-extrabold text-[11px] w-[52px] flex-none text-slate-600 truncate",title:x.ticker??void 0,children:x.ticker??"â"}),i.jsx("span",{className:"min-w-0 text-slate-600 truncate",children:x.security_name??"Unknown security"}),i.jsx("span",{className:"ml-auto font-bold tabular-nums whitespace-nowrap text-slate-900",children:Re(x.value,x.currency)})]},vn(x)))]})]}):i.jsxs("div",{className:"flex-1",children:[u!=="no_investments"&&i.jsxs("div",{className:"px-4 lg:px-[18px] pb-3.5",children:[i.jsx("p",{className:"text-[26px] font-extrabold tracking-tight tabular-nums text-slate-400",children:h?Re(h.value,h.currency):"â â â"}),i.jsx("p",{className:"mt-1.5 text-[12.5px] text-slate-500",children:u==="preparing"?"holdings not available yet"
556:"excluded from portfolio totals"})]}),i.jsxs("div",{className:`mx-4 lg:mx-[18px] mb-3.5 rounded-lg px-3 py-2.5 text-[12.5px] leading-relaxed flex gap-2.5 items-start ${u==="login_required"?"bg-badge-red text-badge-red-text":u==="preparing"?"bg-badge-yellow text-badge-yellow-text":"bg-brand-soft text-blue-900"}`,children:[u==="login_required"?i.jsx(Jt,{className:"w-[15px] h-[15px] flex-none mt-px"}):u==="preparing"?i.jsx(xr,{className:"w-[15px] h-[15px] flex-none mt-px"}):i.jsx(na,{className:"w-[15px] h-[15px] flex-none mt-px"}),i.jsx("span",{children:u==="no_investments"?i.jsxs(i.Fragment,{children:["This connection was made without ",i.jsx("strong",{children:"Investments"})," ticked, so it carries no holdings. Investments cannot be added to a connection after it is made, so connecting ",n," again with Investments ticked creates a second connection that sits alongside this one."]}):l?.error??"This account could not be reached."})]}),u==="no_investments"&&i.jsx("div",{className:"px-4 lg:px-[18px] pb-3.5",children:i.jsx(Ql,{label:"Connect with Investments",defaultProducts:I1,skipProductPicker:!0,fullWidthOnMobile:!0})}),u==="login_required"&&i.jsx("div",{className:"px-4 lg:px-[18px] pb-3.5",children:i.jsxs("button",{type:"button",onClick:e.onReconnect,disabled:e.isReconnecting,className:"w-full lg:w-auto justify-center lg:justify-start h-[42px] lg:h-auto inline-flex items-center gap-1.5 rounded-lg border border-brand bg-brand-soft px-3 py-1.5 text-xs font-bold text-brand hover:bg-brand hover:text-white disabled:opacity-50 transition-colors",children:[i.jsx(Zs,{className:"w-3 h-3"}),e.isReconnecting?"Reconnecting...":"Reconnect Now"]})}),u==="preparing"&&i.jsx("div",{className:"px-4 lg:px-[18px] pb-3.5",children:i.jsxs("button",{type:"button",onClick:e.onRetry,className:"w-full lg:w-auto justify-center lg:justify-start h-[42px] lg:h-auto inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-xs font-bold text-slate-600 hover:bg-slate-100",children:[i.jsx(dt,{className:"w-3 h-3"}),"Try again"]})})]}),i.jsxs("div",{className:"border-t border-border px-4 lg:px-[18px] py-3 bg-surface-2 flex items-center gap-2.5 text-xs text-slate-500",children:[g?"Reporting":u==="no_investments"?"Transactions only":"Not reporting",g?i.jsxs(gt,{to:"/investments/holdings",className:"ml-auto inline-flex items-center gap-1.5 text-brand font-bold hover:underline",children:["Holdings tab",i.jsx(va,{className:"w-3 h-3"})]}):i.jsxs(gt,{to:"/accounts",className:"ml-auto inline-flex items-center gap-1.5 text-brand font-bold hover:underline",children:["Manage connection",i.jsx(va,{className:"w-3 h-3"})]})]})]})}function gIe(){const{data:e,holdings:t,onSelectHolding:n,onReconnect:r,isReconnecting:a}=nx(),{refetch:s}=JO(),o=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),l=o.data?.accounts??[],u=o.data?.logos??{},d=v.useMemo(()=>Po(t),[t]),h=v.useMemo(()=>{const k=new Map;return(e.errors??[]).forEach(S=>k.set(S.moneylogz_account_id,S)),k},[e.errors]),p=l.filter(k=>Ky(k.products)),g=l.filter(k=>!Ky(k.products)),y=Ou(O1(t))[0],w=SV(l,h),j=p.flatMap(k=>{const S=d.filter(O=>O.moneylogz_account_id===k.id),E=h.get(k.id);return S.length===0?[i.jsx(k5,{institution:k.name,accountTitle:k.title||k.name,subtype:null,mask:null,logo:u[k.institution_id],status:k.status,accountId:k.id,accountError:E,isReconnecting:a===k.id,onReconnect:()=>r(k.id),onRetry:()=>s(),onSelectHolding:n},`account-${k.id}`)]:S.map(O=>i.jsx(k5,{rollup:O,institution:O.institution,accountTitle:O.account_name,subtype:O.account_subtype,mask:O.mask,logo:u[O.institution_id??""],status:k.status,accountId:k.id,accountError:E,isReconnecting:a===k.id,onReconnect:()=>r(k.id),onRetry:()=>s(),onSelectHolding:n},O.key))}),N=j.length;return i.jsxs("div",{className:"pb-2",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:flex lg:items-center lg:gap-6 lg:flex-wrap bg-surface border border-border rounded-xl shadow-card px-4 py-4 lg:px-[22px] lg:py-[18px] mb-5",children:[i.jsxs("div",{className:"min-w-0 lg:pr-6 lg:border-r border-border",children:[i.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Reporting"}),i.jsx("p",{className:"text-xl lg:text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums text-slate-900",children:Re(y?.value??0,y?.currency)}),i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:[d.length," of ",N," investment account",N===1?"":"s"]})]}),i.jsxs("div",{className:"min-w-0 lg:pr-6 lg:border-r border-border",children:[i.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Unrealised"}),i.jsx("p",{className:`text-xl lg:text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums ${(y?.unrealized_gain_loss??0)<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(y?.unrealized_gain_loss,y?.currency)}),i.jsxs("p",{className:"text-xs text-slate-500 mt-0.5",children:["against ",Re(y?.cost_basis??0,y?.currency)," cost basis"]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Needs attention"}),i.jsx("p",{className:`text-xl lg:text-2xl font-extrabold tracking-tight mt-1.5 tabular-nums ${w>0?"text-amount-neg":"text-slate-900"}`,children:w}),i.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:w===0?"every account reported":"see the card for the fix"})]}),i.jsxs("p",{className:"col-span-2 lg:ml-auto flex items-center gap-2.5 text-[12.5px] font-semibold text-slate-500",children:[i.jsx(xr,{className:"w-[15px] h-[15px]"}),"Excluded accounts are left out of every figure, never counted as zero"]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-[18px]",children:[j,g.map(k=>i.jsx(k5,{institution:k.name,accountTitle:k.title||k.name,subtype:"depository",mask:null,logo:u[k.institution_id],status:k.status,accountId:k.id,withoutInvestments:!0,isReconnecting:a===k.id,onReconnect:()=>r(k.id),onRetry:()=>s(),onSelectHolding:n},`no-investments-${k.id}`))]})]})}const BP=["buy","sell","cash","fee","transfer","cancel"],xIe={buy:"bg-badge-blue-text",sell:"bg-badge-green-text",cash:"bg-purple-600",fee:"bg-badge-red-text",transfer:"bg-slate-500",cancel:"bg-slate-300"};function bIe({value:e,accountOptions:t,totalsByType:n,totalCount:r,onChange:a}){const s=l=>n.find(u=>u.type===l)?.count,o=e.accountIds.length>0||e.type!==null||e.ticker!=="";return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-end gap-2.5 mb-3 flex-wrap",children:[i.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-[140px] lg:flex-none lg:min-w-0",children:[i.jsx("label",{className:yk,htmlFor:"investments-start-date",children:"From"}),i.jsx("input",{id:"investments-start-date",type:"date",value:e.startDate,max:e.endDate,onChange:l=>{l.target.value&&a({...e,startDate:l.target.value})},className:`${mu} w-full lg:w-[160px]`})]}),i.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-[140px] lg:flex-none lg:min-w-0",children:[i.jsx("label",{className:yk,htmlFor:"investments-end-date",children:"To"}),i.jsx("input",{id:"investments-end-date",type:"date",value:e.endDate,min:e.startDate,onChange:l=>{l.target.value&&a({...e,endDate:l.target.value})},className:`${mu} w-full lg:w-[160px]`})]}),i.jsx(ko,{label:"Accounts",options:t,selectedValues:e.accountIds,onChange:l=>a({...e,accountIds:l})}),i.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-[140px] lg:flex-none lg:min-w-0",children:[i.jsx("label",{className:yk,htmlFor:"investments-ticker",children:"Ticker â exact match"}),i.jsx("input",{id:"investments-ticker",value:e.ticker,onChange:l=>a({...e,ticker:l.target.value}),placeholder:"e.g. VTI",className:`${mu} font-mono uppercase w-full lg:w-[150px] placeholder:font-sans placeholder:normal-case`})]}),o&&i.jsxs("button",{type:"button",onClick:()=>a({...e,accountIds:[],type:null,ticker:""}),className:"h-[42px] inline-flex items-center gap-1.5 px-3 text-sm font-semibold text-slate-500 hover:text-slate-900",children:[i.jsx(Ut,{className:"w-4 h-4"}),"Clear all"]})]}),i.jsxs("div",{className:"flex items-center gap-2 mb-4 flex-nowrap overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden -mx-4 px-4 lg:mx-0 lg:px-0 lg:flex-wrap lg:overflow-visible",children:[i.jsxs("button",{type:"button",onClick:()=>a({...e,type:null}),className:`inline-flex flex-none items-center gap-2 h-[34px] px-3.5 rounded-full border text-[13px] font-semibold whitespace-nowrap transition-colors ${e.type===null?"bg-brand-soft border-blue-200 text-brand":"bg-surface border-border text-slate-600 hover:border-slate-300"}`,children:["All",i.jsx("span",{className:"text-[11px] font-bold text-slate-400",children:r})]}),BP.map(l=>{const u=s(l),d=e.type===l;return i.jsxs("button",{type:"button",onClick:()=>a({...e,type:d?null:l}),className:`inline-flex flex-none items-center gap-2 h-[34px] px-3.5 rounded-full border text-[13px] font-semibold capitalize whitespace-nowrap transition-colors ${d?"bg-brand-soft border-blue-200 text-brand":"bg-surface border-border text-slate-600 hover:border-slate-300"}`,children:[i.jsx("span",{className:`w-2 h-2 rounded-full ${xIe[l]}`}),l,u!==void 0&&i.jsx("span",{className:`text-[11px] font-bold ${d?"text-brand":"text-slate-400"}`,children:u})]},l)})]})]})}const yIe={buy:"bg-badge-blue-text",sell:"bg-badge-green-text",cash:"bg-purple-600",fee:"bg-badge-red-text",transfer:"bg-slate-500",cancel:"bg-slate-300"};function vIe({totals:e,currency:t}){const n=new Map(e.map(s=>[s.type,s])),r=BP.filter(s=>n.has(s)),a=e.reduce((s,o)=>s+o.amount,0);
556return r.length?i.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 bg-surface border border-border rounded-xl shadow-card overflow-hidden mb-4",children:[r.map(s=>{const o=n.get(s);return i.jsxs("div",{className:"px-3 py-3 lg:px-4 lg:py-3.5 border-r last:border-r-0 border-b xl:border-b-0 border-border",children:[i.jsxs("p",{className:"flex items-center gap-[7px] text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:[i.jsx("span",{className:`w-2 h-2 rounded-full ${yIe[s]??"bg-slate-400"}`}),s]}),i.jsx("p",{className:`text-[19px] font-extrabold tracking-tight mt-1.5 tabular-nums ${o.amount<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(o.amount,t)}),i.jsxs("p",{className:"text-[11.5px] text-slate-500 mt-0.5",children:[o.count," transaction",o.count===1?"":"s"]})]},s)}),i.jsxs("div",{className:"px-4 py-3.5",children:[i.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400",children:"Net"}),i.jsx("p",{className:`text-[19px] font-extrabold tracking-tight mt-1.5 tabular-nums ${a<0?"text-amount-neg":"text-amount-pos"}`,children:Ee(a,t)}),i.jsx("p",{className:"text-[11.5px] text-slate-500 mt-0.5",children:a<0?"cash moved out":"cash moved in"})]})]}):null}const cF=i.jsx("span",{className:"text-slate-300 font-semibold",children:"â"});function wIe({transaction:e}){const t=aA(e.type);return i.jsxs("tr",{className:t?"bg-[#fffbfb] hover:bg-[#fff5f5]":"hover:bg-surface-muted",children:[i.jsx("td",{className:"px-[18px] py-3 whitespace-nowrap",children:Ue(e.date)}),i.jsx("td",{className:"px-[18px] py-3 max-w-[280px]",children:i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx(oc,{ticker:e.ticker}),i.jsxs("span",{className:"min-w-0",children:[i.jsx("span",{className:`block text-[13px] font-bold truncate ${t?"text-slate-500":"text-slate-900"}`,title:e.name,children:e.name}),i.jsx("span",{className:"block text-[11.5px] text-slate-500 truncate",title:e.security_name??void 0,children:e.security_name??"No security"})]})]})}),i.jsxs("td",{className:"px-[18px] py-3 text-[12.5px]",children:[e.account_name,i.jsxs("span",{className:"block text-[11.5px] text-slate-500",children:[e.institution,An(e.mask)?` ${An(e.mask)}`:""]})]}),i.jsx("td",{className:"px-[18px] py-3",children:i.jsx(Fw,{type:e.type,subtype:e.subtype})}),i.jsx("td",{className:"px-[18px] py-3 text-right tabular-nums whitespace-nowrap",children:e.quantity===null?cF:hu(e.quantity)}),i.jsx("td",{className:"px-[18px] py-3 text-right tabular-nums whitespace-nowrap",children:e.price===null?cF:Re(e.price,e.currency)}),i.jsx("td",{className:"px-[18px] py-3 text-right tabular-nums whitespace-nowrap",children:Re(e.fees??0,e.currency)}),i.jsx("td",{className:`px-[18px] py-3 text-right font-bold tabular-nums whitespace-nowrap ${yV(e)}`,children:Ee(e.amount,e.currency)})]})}const uF=90,jIe=7,NIe=864e5,_Ie=e=>!!e&&BP.includes(e),dF=e=>{const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?null:t},fF=(e,t)=>`${e??""}|${t}`;function kIe(){const{holdings:e}=nx(),t=Ms(),[n,r]=Li(),[a,s]=v.useState(()=>({startDate:Mi(uF),endDate:Vr(new Date),accountIds:[]})),o=_Ie(n.get("type"))?n.get("type"):null,l=n.get(X0)?.toUpperCase()??"",u=v.useMemo(()=>({...a,type:o,ticker:l}),[a,o,l]),d=v.useRef(null);v.useEffect(()=>{const P=fF(o,l);d.current!==P&&(d.current=P)},[o,l]);const h=v.useMemo(()=>qxe(e),[e]),p=C1({startDate:u.startDate,endDate:u.endDate,accountIds:u.accountIds.length?u.accountIds.map(Number):void 0,type:u.type??void 0,ticker:u.ticker.trim()||void 0}),g=P=>{s({startDate:P.startDate,endDate:P.endDate,accountIds:P.accountIds});const M=new URLSearchParams(n),D=P.ticker.trim()?P.ticker.trim().toUpperCase():"";D?M.set(X0,D):M.delete(X0),P.type?M.set("type",P.type):M.delete("type"),d.current=fF(P.type,D),r(M,{replace:!0})},x=p.data,y=x?.investment_transactions??[],w=y[0]?.currency,j=x?.message??"No investment transactions found for these filters.",N=dF(u.startDate),k=dF(u.endDate),S=N&&k?Math.max(0,Math.round((k.getTime()-N.getTime())/NIe)):uF,E=Math.max(jIe,Math.floor(S/2)),O=E<S,T=()=>{const M=Mi(E,k??new Date);g({...u,startDate:M})};return i.jsxs("div",{className:"flex flex-col min-h-0",children:[i.jsx(bIe,{value:u,accountOptions:h,totalsByType:x?.totals_by_type??[],totalCount:x?.count??0,onChange:g}),i.jsx(vIe,{totals:x?.totals_by_type??[],currency:w}),p.isError?i.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-card px-[18px] py-8 text-center",children:[i.jsx("p",{className:"text-[15px] font-bold text-slate-900",children:"Could not load activity"}),i.jsx("p",{className:"text-sm text-slate-500 mt-1",children:p.error instanceof Error?p.error.message:"Failed to fetch investment transactions"}),i.jsx("button",{type:"button",onClick:()=>p.refetch(),className:"mt-4 inline-flex items-center gap-2 font-semibold px-3.5 py-2.5 rounded-lg border border-brand bg-brand text-white hover:bg-brand-hover",children:"Try again"})]}):x?i.jsxs("section",{className:"rounded-xl border border-border bg-surface shadow-card overflow-hidden flex flex-col min-h-0",children:[x.truncated&&i.jsxs("div",{className:"flex flex-wrap lg:flex-nowrap items-start gap-2.5 px-4 lg:px-[18px] py-3 bg-badge-yellow text-badge-yellow-text text-[12.5px] leading-relaxed border-b border-yellow-200",children:[i.jsx(Jt,{className:"w-[15px] h-[15px] flex-none mt-px"}),i.jsxs("span",{className:"min-w-0 flex-1 lg:flex-initial",children:[i.jsx("strong",{children:"Not every transaction in this range was fetched."})," ",O?x.note??"Narrow the date range for a complete answer.":"Filter by account or ticker for a complete answer."]}
556),O&&i.jsxs("button",{type:"button",onClick:T,className:"ml-auto min-h-[42px] lg:min-h-0 font-bold underline whitespace-nowrap",children:["Narrow to ",E," days"]})]}),t?i.jsx("div",{className:"overflow-auto flex-1 min-h-0",children:i.jsxs("table",{className:"w-full text-[13px] text-left text-slate-900",children:[i.jsx("thead",{className:"sticky top-0 z-[2] bg-surface-2 border-b border-border text-[11px] font-bold uppercase tracking-wide text-slate-500",children:i.jsxs("tr",{children:[i.jsx("th",{className:"px-[18px] py-3 w-[118px]",children:"Date"}),i.jsx("th",{className:"px-[18px] py-3 w-[280px]",children:"Security"}),i.jsx("th",{className:"px-[18px] py-3 w-[210px]",children:"Account"}),i.jsx("th",{className:"px-[18px] py-3 w-[110px]",children:"Type"}),i.jsx("th",{className:"px-[18px] py-3 w-[110px] text-right",children:"Quantity"}),i.jsx("th",{className:"px-[18px] py-3 w-[110px] text-right",children:"Price"}),i.jsx("th",{className:"px-[18px] py-3 w-[90px] text-right",children:"Fees"}),i.jsx("th",{className:"px-[18px] py-3 w-[140px] text-right",children:"Amount"})]})}),i.jsxs("tbody",{className:"bg-white divide-y divide-border",children:[y.map(P=>i.jsx(wIe,{transaction:P},P.investment_transaction_id)),y.length===0&&i.jsx("tr",{children:i.jsx("td",{colSpan:8,className:"px-[18px] py-10 text-center text-sm text-slate-500",children:j})})]})]})}):y.length===0?i.jsx("p",{className:"px-4 py-10 text-center text-sm text-slate-500",children:j}):i.jsx("ul",{className:"divide-y divide-border","data-testid":"activity-row-list",children:y.map(P=>i.jsx(mJ,{transaction:P},P.investment_transaction_id))}),i.jsxs("div",{className:"flex items-center gap-3.5 px-4 lg:px-[18px] py-3 border-t border-border bg-surface-2 text-[12.5px] text-slate-500",children:[i.jsxs("span",{children:["Showing ",y.length," of ",x.count," · dividends and fees report an amount only, never a per-unit price."]}),p.isFetching&&i.jsx(Dt,{size:"sm",className:"ml-auto"})]})]}):i.jsx(hJ,{rows:6,label:"Fetching investment activity"})]})}const SIe="rounded-xl border border-border bg-surface shadow-card p-4 lg:p-5 mb-3.5 lg:mb-6",hF="inline-flex items-center justify-center gap-2 h-11 lg:h-10 w-full lg:w-auto px-3.5 rounded-lg text-sm font-semibold disabled:opacity-60 disabled:cursor-not-allowed",pF="inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-bold whitespace-nowrap align-middle";function CIe({icon:e,wellClassName:t,title:n,badges:r,description:a,error:s,action:o}){return i.jsx("section",{className:SIe,"aria-label":n,children:i.jsxs("div",{className:"flex flex-col gap-3.5 lg:flex-row lg:items-center lg:justify-between lg:gap-4",children:[i.jsxs("div",{className:"flex items-start gap-3 lg:gap-4 min-w-0",children:[i.jsx("span",{className:`w-12 h-12 rounded-xl flex-none inline-flex items-center justify-center ${t}`,children:e}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("h3",{className:"text-base lg:text-lg font-extrabold tracking-tight text-slate-900 flex flex-wrap items-center gap-2",children:[n,r]}),i.jsx("p",{className:"text-[13px] lg:text-sm text-slate-500 mt-1 leading-normal",children:a}),s&&i.jsxs("p",{role:"alert",className:"mt-2 flex items-start gap-2 text-sm text-amount-neg",children:[i.jsx(Qt,{className:"w-4 h-4 flex-none mt-0.5","aria-hidden":"true"}),s]})]})]}),o&&i.jsx("div",{className:"flex-none flex flex-col lg:flex-row",children:o})]})})}function EIe({className:e="w-7 h-7"}){return i.jsxs("svg",{viewBox:"0 0 48 48",className:e,role:"img","aria-label":"Google Drive","data-testid":"google-drive-icon",children:[i.jsx("path",{className:"fill-amount-pos",d:"M17 6h14l13 22H30z"}),i.jsx("path",{className:"fill-brand",d:"M4 28 17 6l13 22-6.5 11z"}),i.jsx("path",{className:"fill-amber-500",d:"M10.5 39 17 28h27l-6.5 11z"})]})}const OIe="bg-red-50 hover:bg-red-100 border border-red-200 text-red-700",mF="Failed to disconnect from Google Drive. Please try again.";function AIe(){const{connections:e,setConnections:t}=$n(),[n,r]=ve.useState(!1),[a,s]=ve.useState(null),o=ose({flow:"auth-code",onSuccess:d=>{const h=`/connections/drive/callback?code=${d.code}&service=drive`;window.location.href=h},scope:"https://www.googleapis.com/auth/drive.file"}),l=async()=>{try{if(r(!0),s(null),await qye()){console.info("[ConnectionsPage] Google Drive disconnected");const h=await Qm();t(h)}else console.warn("[ConnectionsPage] Google Drive disconnect was refused by the server"),s(mF)}catch(d){console.warn("[ConnectionsPage] Google Drive disconnect failed",d),s(mF)}finally{r(!1)}};ve.useEffect(()=>{a&&!e?.drive.connected&&s(null)},[e?.drive.connected,a]);const u=!!e?.drive.connected;return i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx(Vu,{title:"Connections",subtitle:"Connect your accounts to enhance your Moneylogz experience."}),i.jsx(CIe,{icon:i.jsx(EIe,{}),wellClassName:u?"bg-badge-green":"bg-brand-soft",title:"Google Drive",badges:i.jsxs(i.Fragment,{children:[u&&i.jsx("span",{className:`${pF} bg-badge-green text-badge-green-text`,children:"Connected"}),e?.drive.status==="processing"&&i.jsxs("span",{className:`${pF} bg-badge-yellow text-badge-yellow-text`,children:[i.jsx(Yn,{className:"w-3 h-3 animate-spin","aria-hidden":"true"}),"Processing"]})]}),description:u?"Your documents are automatically backed up to Google Drive.":"Store and organize your documents securely.",error:a,action:u?i.jsx("button",{type:"button",onClick:l,disabled:n,className:`${hF} ${OIe}`,children:n?i.jsxs(i.Fragment,{children:[i.jsx(Qt,{className:"w-4 h-4 animate-spin","aria-hidden":"true"}),"Disconnecting..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Ut,{className:"w-4 h-4","aria-hidden":"true"}),"Disconnect Drive"]})}):i.jsxs("button",{type:"button",onClick:()=>o(),className:`${hF} bg-brand-soft hover:bg-badge-blue border border-badge-blue text-brand`,children:[i.jsx(Yn,{className:"w-4 h-4","aria-hidden":"true"}),"Connect Drive"]})})]})}const vE=async(e=!1)=>{const t=e?{no_cache:"true"}:{},{data:n}=await Je.get("/spreadsheets",{params:t,headers:{"Content-Type":"application/json"}});if(!n.success||!n.data)throw new Error("Failed to fetch spreadsheets");return n.data.spreadsheets};var S5,gF;function TIe(){if(gF)return S5;gF=1,S5=function(a,s,o){var l=document.head||document.getElementsByTagName("head")[0],u=document.createElement("script");typeof s=="function"&&(o=s,s={}),s=s||{},o=o||function(){},u.type=s.type||"text/javascript",u.charset=s.charset||"utf8",u.async="async"in s?!!s.async:!0,u.src=a,s.attrs&&e(u,s.attrs),s.text&&(u.text=""+s.text);var d="onload"in u?t:n;d(u,o),u.onload||t(u,o),l.appendChild(u)};function e(r,a){for(var s in a)r.setAttribute(s,a[s])}function t(r,a){r.onload=function(){this.onerror=this.onload=null,a(null,r)},r.onerror=function(){this.onerror=this.onload=null,a(new Error("Failed to load "+this.src),r)}}function n(r,a){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,a(null,r))}}return S5}var C5,xF;function gJ(){if(xF)return C5;xF=1;var e=function(k){return t(k)&&!n(k)};function t(N){return!!N&&typeof N=="object"}function n(N){var k=Object.prototype.toString.call(N);return k==="[object RegExp]"||k==="[object Date]"||s(N)}
556var r=typeof Symbol=="function"&&Symbol.for,a=r?Symbol.for("react.element"):60103;function s(N){return N.$$typeof===a}function o(N){return Array.isArray(N)?[]:{}}function l(N,k){return k.clone!==!1&&k.isMergeableObject(N)?w(o(N),N,k):N}function u(N,k,S){return N.concat(k).map(function(E){return l(E,S)})}function d(N,k){if(!k.customMerge)return w;var S=k.customMerge(N);return typeof S=="function"?S:w}function h(N){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(N).filter(function(k){return Object.propertyIsEnumerable.call(N,k)}):[]}function p(N){return Object.keys(N).concat(h(N))}function g(N,k){try{return k in N}catch{return!1}}function x(N,k){return g(N,k)&&!(Object.hasOwnProperty.call(N,k)&&Object.propertyIsEnumerable.call(N,k))}function y(N,k,S){var E={};return S.isMergeableObject(N)&&p(N).forEach(function(O){E[O]=l(N[O],S)}),p(k).forEach(function(O){x(N,O)||(g(N,O)&&S.isMergeableObject(k[O])?E[O]=d(O,S)(N[O],k[O],S):E[O]=l(k[O],S))}),E}function w(N,k,S){S=S||{},S.arrayMerge=S.arrayMerge||u,S.isMergeableObject=S.isMergeableObject||e,S.cloneUnlessOtherwiseSpecified=l;var E=Array.isArray(k),O=Array.isArray(N),T=E===O;return T?E?S.arrayMerge(N,k,S):y(N,k,S):l(k,S)}w.all=function(k,S){if(!Array.isArray(k))throw new Error("first argument should be an array");return k.reduce(function(E,O){return w(E,O,S)},{})};var j=w;return C5=j,C5}var E5,bF;function zw(){if(bF)return E5;bF=1;var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,o=(W,I)=>{for(var H in I)t(W,H,{get:I[H],enumerable:!0})},l=(W,I,H,V)=>{if(I&&typeof I=="object"||typeof I=="function")for(let X of r(I))!s.call(W,X)&&X!==H&&t(W,X,{get:()=>I[X],enumerable:!(V=n(I,X))||V.enumerable});return W},u=(W,I,H)=>(H=W!=null?e(a(W)):{},l(!W||!W.__esModule?t(H,"default",{value:W,enumerable:!0}):H,W)),d=W=>l(t({},"__esModule",{value:!0}),W),h={};o(h,{callPlayer:()=>U,getConfig:()=>F,getSDK:()=>L,isBlobUrl:()=>$,isMediaStream:()=>z,lazy:()=>y,omit:()=>B,parseEndTime:()=>T,parseStartTime:()=>O,queryString:()=>M,randomString:()=>P,supportsWebKitPresentationMode:()=>K}),E5=d(h);var p=u(ti()),g=u(TIe()),x=u(gJ());const y=W=>p.default.lazy(async()=>{const I=await W();return typeof I.default=="function"?I:I.default}),w=/[?&#](?:start|t)=([0-9hms]+)/,j=/[?&#]end=([0-9hms]+)/,N=/(\d+)(h|m|s)/g,k=/^\d+$/;function S(W,I){if(W instanceof Array)return;const H=W.match(I);if(H){const V=H[1];if(V.match(N))return E(V);if(k.test(V))return parseInt(V)}}function E(W){let I=0,H=N.exec(W);for(;H!==null;){const[,V,X]=H;X==="h"&&(I+=parseInt(V,10)*60*60),X==="m"&&(I+=parseInt(V,10)*60),X==="s"&&(I+=parseInt(V,10)),H=N.exec(W)}return I}function O(W){return S(W,w)}function T(W){return S(W,j)}function P(){return Math.random().toString(36).substr(2,5)}function M(W){return Object.keys(W).map(I=>`${I}=${W[I]}`).join("&")}function D(W){return window[W]?window[W]:window.exports&&window.exports[W]?window.exports[W]:window.module&&window.module.exports&&window.module.exports[W]?window.module.exports[W]:null}const A={},L=function(I,H,V=null,X=()=>!0,te=g.default){const fe=D(H);return fe&&X(fe)?Promise.resolve(fe):new Promise((ae,ke)=>{if(A[I]){A[I].push({resolve:ae,reject:ke});return}A[I]=[{resolve:ae,reject:ke}];const xe=ue=>{A[I].forEach(we=>we.resolve(ue))};if(V){const ue=window[V];window[V]=function(){ue&&ue(),xe(D(H))}}te(I,ue=>{ue?(A[I].forEach(we=>we.reject(ue)),A[I]=null):V||xe(D(H))})})};function F(W,I){return(0,x.default)(I.config,W.config)}function B(W,...I){const H=[].concat(...I),V={},X=Object.keys(W);for(const te of X)H.indexOf(te)===-1&&(V[te]=W[te]);return V}function U(W,...I){if(!this.player||!this.player[W]){let H=`ReactPlayer: ${this.constructor.displayName} player could not call %c${W}%c â `;return this.player?this.player[W]||(H+="The method was not available"):H+="The player was not available",console.warn(H,"font-weight: bold",""),null}return this.player[W](...I)}function z(W){return typeof window<"u"&&typeof window.MediaStream<"u"&&W instanceof window.MediaStream}function $(W){return/^blob:/.test(W)}function K(W=document.createElement("video")){const I=/iPhone|iPod/.test(navigator.userAgent)===!1;return W.webkitSupportsPresentationMode&&typeof W.webkitSetPresentationMode=="function"&&I}function G(W){return W}return E5}var O5,yF;function PIe(){if(yF)return O5;yF=1;var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,a=(U,z)=>{for(var $ in z)e(U,$,{get:z[$],enumerable:!0})},s=(U,z,$,K)=>{if(z&&typeof z=="object"||typeof z=="function")for(let G of n(z))!r.call(U,G)&&G!==$&&e(U,G,{get:()=>z[G],enumerable:!(K=t(z,G))||K.enumerable});return U},o=U=>s(e({},"__esModule",{value:!0}),U),l={};a(l,{AUDIO_EXTENSIONS:()=>P,DASH_EXTENSIONS:()=>A,FLV_EXTENSIONS:()=>L,HLS_EXTENSIONS:()=>D,MATCH_URL_DAILYMOTION:()=>S,MATCH_URL_FACEBOOK:()=>x,MATCH_URL_FACEBOOK_WATCH:()=>y,MATCH_URL_KALTURA:()=>T,MATCH_URL_MIXCLOUD:()=>E,MATCH_URL_MUX:()=>g,MATCH_URL_SOUNDCLOUD:()=>h,MATCH_URL_STREAMABLE:()=>w,MATCH_URL_TWITCH_CHANNEL:()=>k,MATCH_URL_TWITCH_VIDEO:()=>N,MATCH_URL_VIDYARD:()=>O,MATCH_URL_VIMEO:()=>p,MATCH_URL_WISTIA:()=>j,MATCH_URL_YOUTUBE:()=>d,VIDEO_EXTENSIONS:()=>M,canPlay:()=>B}),O5=o(l);var u=zw();const d=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|wat
556ch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,h=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,p=/vimeo\.com\/(?!progressive_redirect).+/,g=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,x=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,y=/^https?:\/\/fb\.watch\/.+$/,w=/streamable\.com\/([a-z0-9]+)$/,j=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,N=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,k=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,S=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,E=/mixcloud\.com\/([^/]+\/[^/]+)/,O=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,T=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,P=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,M=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,D=/\.(m3u8)($|\?)/i,A=/\.(mpd)($|\?)/i,L=/\.(flv)($|\?)/i,F=U=>{if(U instanceof Array){for(const z of U)if(typeof z=="string"&&F(z)||F(z.src))return!0;return!1}return(0,u.isMediaStream)(U)||(0,u.isBlobUrl)(U)?!0:P.test(U)||M.test(U)||D.test(U)||A.test(U)||L.test(U)},B={youtube:U=>U instanceof Array?U.every(z=>d.test(z)):d.test(U),soundcloud:U=>h.test(U)&&!P.test(U),vimeo:U=>p.test(U)&&!M.test(U)&&!D.test(U),mux:U=>g.test(U),facebook:U=>x.test(U)||y.test(U),streamable:U=>w.test(U),wistia:U=>j.test(U),twitch:U=>N.test(U)||k.test(U),dailymotion:U=>S.test(U),mixcloud:U=>E.test(U),vidyard:U=>O.test(U),kaltura:U=>T.test(U),file:F};return O5}var A5,vF;function RIe(){if(vF)return A5;vF=1;var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,a=(p,g)=>{for(var x in g)e(p,x,{get:g[x],enumerable:!0})},s=(p,g,x,y)=>{if(g&&typeof g=="object"||typeof g=="function")for(let w of n(g))!r.call(p,w)&&w!==x&&e(p,w,{get:()=>g[w],enumerable:!(y=t(g,w))||y.enumerable});return p},o=p=>s(e({},"__esModule",{value:!0}),p),l={};a(l,{default:()=>h}),A5=o(l);var u=zw(),d=PIe(),h=[{key:"youtube",name:"YouTube",canPlay:d.canPlay.youtube,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./YouTube-5rDLMWG8.js").then(p=>p.Y),[]))},{key:"soundcloud",name:"SoundCloud",canPlay:d.canPlay.soundcloud,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./SoundCloud-Blsoqsft.js").then(p=>p.S),[]))},{key:"vimeo",name:"Vimeo",canPlay:d.canPlay.vimeo,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./Vimeo-Bgl_rAla.js").then(p=>p.V),[]))},{key:"mux",name:"Mux",canPlay:d.canPlay.mux,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./Mux-CMJVj8fm.js").then(p=>p.M),[]))},{key:"facebook",name:"Facebook",canPlay:d.canPlay.facebook,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./Facebook-D_Du7hwy.js").then(p=>p.F),[]))},{key:"streamable",name:"Streamable",canPlay:d.canPlay.streamable,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./Streamable-BAmlc_R0.js").then(p=>p.S),[]))},{key:"wistia",name:"Wistia",canPlay:d.canPlay.wistia,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./Wistia-B0b4Zc0o.js").then(p=>p.W),[]))},{key:"twitch",name:"Twitch",canPlay:d.canPlay.twitch,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./Twitch-C-u_Aftb.js").then(p=>p.T),[]))},{key:"dailymotion",name:"DailyMotion",canPlay:d.canPlay.dailymotion,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./DailyMotion-Dj81I9Gu.js").then(p=>p.D),[]))},{key:"mixcloud",name:"Mixcloud",canPlay:d.canPlay.mixcloud,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./Mixcloud-DeVl1nLm.js").then(p=>p.M),[]))},{key:"vidyard",name:"Vidyard",canPlay:d.canPlay.vidyard,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./Vidyard-BGSbLKr4.js").then(p=>p.V),[]))},{key:"kaltura",name:"Kaltura",canPlay:d.canPlay.kaltura,lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./Kaltura-D2b-p-cI.js").then(p=>p.K),[]))},{key:"file",name:"FilePlayer",canPlay:d.canPlay.file,canEnablePIP:p=>d.canPlay.file(p)&&(document.pictureInPictureEnabled||(0,u.supportsWebKitPresentationMode)())&&!d.AUDIO_EXTENSIONS.test(p),lazyPlayer:(0,u.lazy)(()=>nr(()=>import("./FilePlayer-DQrGb1Kb.js").then(p=>p.F),[]))}];return A5}var wF=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function MIe(e,t){return!!(e===t||wF(e)&&wF(t))}function DIe(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!MIe(e[n],t[n]))return!1;return!0}function $Ie(e,t){t===void 0&&(t=DIe);var n,r=[],a,s=!1;function o(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return s&&n===this&&t(l,r)||(a=e.apply(this,l),s=!0,n=this,r=l),a}return o}const IIe=Object.freeze(Object.defineProperty({__proto__:null,default:$Ie},Symbol.toStringTag,{value:"Module"})),LIe=zne(IIe);var T5,jF;function xJ(){if(jF)return T5;jF=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function a(s,o){if(s===o)return!0;
556if(s&&o&&typeof s=="object"&&typeof o=="object"){if(s.constructor!==o.constructor)return!1;var l,u,d;if(Array.isArray(s)){if(l=s.length,l!=o.length)return!1;for(u=l;u--!==0;)if(!a(s[u],o[u]))return!1;return!0}var h;if(t&&s instanceof Map&&o instanceof Map){if(s.size!==o.size)return!1;for(h=s.entries();!(u=h.next()).done;)if(!o.has(u.value[0]))return!1;for(h=s.entries();!(u=h.next()).done;)if(!a(u.value[1],o.get(u.value[0])))return!1;return!0}if(n&&s instanceof Set&&o instanceof Set){if(s.size!==o.size)return!1;for(h=s.entries();!(u=h.next()).done;)if(!o.has(u.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(s)&&ArrayBuffer.isView(o)){if(l=s.length,l!=o.length)return!1;for(u=l;u--!==0;)if(s[u]!==o[u])return!1;return!0}if(s.constructor===RegExp)return s.source===o.source&&s.flags===o.flags;if(s.valueOf!==Object.prototype.valueOf&&typeof s.valueOf=="function"&&typeof o.valueOf=="function")return s.valueOf()===o.valueOf();if(s.toString!==Object.prototype.toString&&typeof s.toString=="function"&&typeof o.toString=="function")return s.toString()===o.toString();if(d=Object.keys(s),l=d.length,l!==Object.keys(o).length)return!1;for(u=l;u--!==0;)if(!Object.prototype.hasOwnProperty.call(o,d[u]))return!1;if(e&&s instanceof Element)return!1;for(u=l;u--!==0;)if(!((d[u]==="_owner"||d[u]==="__v"||d[u]==="__o")&&s.$$typeof)&&!a(s[d[u]],o[d[u]]))return!1;return!0}return s!==s&&o!==o}return T5=function(o,l){try{return a(o,l)}catch(u){if((u.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw u}},T5}var P5={exports:{}},R5,NF;function FIe(){if(NF)return R5;NF=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return R5=e,R5}var M5,_F;function zIe(){if(_F)return M5;_F=1;var e=FIe();function t(){}function n(){}return n.resetWarningCache=t,M5=function(){function r(o,l,u,d,h,p){if(p!==e){var g=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 g.name="Invariant Violation",g}}r.isRequired=r;function a(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},M5}var kF;function bJ(){return kF||(kF=1,P5.exports=zIe()()),P5.exports}var D5,SF;function yJ(){if(SF)return D5;SF=1;var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,o=(M,D)=>{for(var A in D)t(M,A,{get:D[A],enumerable:!0})},l=(M,D,A,L)=>{if(D&&typeof D=="object"||typeof D=="function")for(let F of r(D))!s.call(M,F)&&F!==A&&t(M,F,{get:()=>D[F],enumerable:!(L=n(D,F))||L.enumerable});return M},u=(M,D,A)=>(A=M!=null?e(a(M)):{},l(!M||!M.__esModule?t(A,"default",{value:M,enumerable:!0}):A,M)),d=M=>l(t({},"__esModule",{value:!0}),M),h={};o(h,{defaultProps:()=>P,propTypes:()=>O}),D5=d(h);var p=u(bJ());const{string:g,bool:x,number:y,array:w,oneOfType:j,shape:N,object:k,func:S,node:E}=p.default,O={url:j([g,w,k]),playing:x,loop:x,controls:x,volume:y,muted:x,playbackRate:y,width:j([g,y]),height:j([g,y]),style:k,progressInterval:y,playsinline:x,pip:x,stopOnUnmount:x,light:j([x,g,k]),playIcon:E,previewTabIndex:y,previewAriaLabel:g,fallback:E,oEmbedUrl:g,wrapper:j([g,S,N({render:S.isRequired})]),config:N({soundcloud:N({options:k}),youtube:N({playerVars:k,embedOptions:k,onUnstarted:S}),facebook:N({appId:g,version:g,playerId:g,attributes:k}),dailymotion:N({params:k}),vimeo:N({playerOptions:k,title:g}),mux:N({attributes:k,version:g}),file:N({attributes:k,tracks:w,forceVideo:x,forceAudio:x,forceHLS:x,forceSafariHLS:x,forceDisableHls:x,forceDASH:x,forceFLV:x,hlsOptions:k,hlsVersion:g,dashVersion:g,flvVersion:g}),wistia:N({options:k,playerId:g,customControls:w}),mixcloud:N({options:k}),twitch:N({options:k,playerId:g}),vidyard:N({options:k})}),onReady:S,onStart:S,onPlay:S,onPause:S,onBuffer:S,onBufferEnd:S,onEnded:S,onError:S,onDuration:S,onSeek:S,onPlaybackRateChange:S,onPlaybackQualityChange:S,onProgress:S,onClickPreview:S,onEnablePIP:S,onDisablePIP:S},T=()=>{},P={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{}
556,progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:T},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},mux:{attributes:{},version:"2"},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:T,onStart:T,onPlay:T,onPause:T,onBuffer:T,onBufferEnd:T,onEnded:T,onError:T,onDuration:T,onSeek:T,onPlaybackRateChange:T,onPlaybackQualityChange:T,onProgress:T,onClickPreview:T,onEnablePIP:T,onDisablePIP:T};return D5}var $5,CF;function BIe(){if(CF)return $5;CF=1;var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,o=(S,E,O)=>E in S?t(S,E,{enumerable:!0,configurable:!0,writable:!0,value:O}):S[E]=O,l=(S,E)=>{for(var O in E)t(S,O,{get:E[O],enumerable:!0})},u=(S,E,O,T)=>{if(E&&typeof E=="object"||typeof E=="function")for(let P of r(E))!s.call(S,P)&&P!==O&&t(S,P,{get:()=>E[P],enumerable:!(T=n(E,P))||T.enumerable});return S},d=(S,E,O)=>(O=S!=null?e(a(S)):{},u(!S||!S.__esModule?t(O,"default",{value:S,enumerable:!0}):O,S)),h=S=>u(t({},"__esModule",{value:!0}),S),p=(S,E,O)=>(o(S,typeof E!="symbol"?E+"":E,O),O),g={};l(g,{default:()=>k}),$5=h(g);var x=d(ti()),y=d(xJ()),w=yJ(),j=zw();const N=5e3;class k extends x.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"isReady",!1),p(this,"isPlaying",!1),p(this,"isLoading",!0),p(this,"loadOnReady",null),p(this,"startOnPlay",!0),p(this,"seekOnPlay",null),p(this,"onDurationCalled",!1),p(this,"handlePlayerMount",E=>{if(this.player){this.progress();return}this.player=E,this.player.load(this.props.url),this.progress()}),p(this,"getInternalPlayer",E=>this.player?this.player[E]:null),p(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const E=this.getCurrentTime()||0,O=this.getSecondsLoaded(),T=this.getDuration();if(T){const P={playedSeconds:E,played:E/T};O!==null&&(P.loadedSeconds=O,P.loaded=O/T),(P.playedSeconds!==this.prevPlayed||P.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(P),this.prevPlayed=P.playedSeconds,this.prevLoaded=P.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),p(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:E,playing:O,volume:T,muted:P}=this.props;E(),!P&&T!==null&&this.player.setVolume(T),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):O&&this.player.play(),this.handleDurationCheck()}),p(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:E,onPlay:O,playbackRate:T}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&T!==1&&this.player.setPlaybackRate(T),E(),this.startOnPlay=!1),O(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),p(this,"handlePause",E=>{this.isPlaying=!1,this.isLoading||this.props.onPause(E)}),p(this,"handleEnded",()=>{const{activePlayer:E,loop:O,onEnded:T}=this.props;E.loopOnEnded&&O&&this.seekTo(0),O||(this.isPlaying=!1,T())}),p(this,"handleError",(...E)=>{this.isLoading=!1,this.props.onError(...E)}),p(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const E=this.getDuration();E?this.onDurationCalled||(this.props.onDuration(E),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),p(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP(
556)),this.mounted=!1}componentDidUpdate(E){if(!this.player)return;const{url:O,playing:T,volume:P,muted:M,playbackRate:D,pip:A,loop:L,activePlayer:F,disableDeferredLoading:B}=this.props;if(!(0,y.default)(E.url,O)){if(this.isLoading&&!F.forceLoad&&!B&&!(0,j.isMediaStream)(O)){console.warn(`ReactPlayer: the attempt to load ${O} is being deferred until the player has loaded`),this.loadOnReady=O;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(O,this.isReady)}!E.playing&&T&&!this.isPlaying&&this.player.play(),E.playing&&!T&&this.isPlaying&&this.player.pause(),!E.pip&&A&&this.player.enablePIP&&this.player.enablePIP(),E.pip&&!A&&this.player.disablePIP&&this.player.disablePIP(),E.volume!==P&&P!==null&&this.player.setVolume(P),E.muted!==M&&(M?this.player.mute():(this.player.unmute(),P!==null&&setTimeout(()=>this.player.setVolume(P)))),E.playbackRate!==D&&this.player.setPlaybackRate&&this.player.setPlaybackRate(D),E.loop!==L&&this.player.setLoop&&this.player.setLoop(L)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(E,O,T){if(!this.isReady){E!==0&&(this.seekOnPlay=E,setTimeout(()=>{this.seekOnPlay=null},N));return}if(O?O==="fraction":E>0&&E<1){const M=this.player.getDuration();if(!M){console.warn("ReactPlayer: could not seek using fraction â duration not yet available");return}this.player.seekTo(M*E,T);return}this.player.seekTo(E,T)}render(){const E=this.props.activePlayer;return E?x.default.createElement(E,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}return p(k,"displayName","Player"),p(k,"propTypes",w.propTypes),p(k,"defaultProps",w.defaultProps),$5}var I5,EF;function UIe(){if(EF)return I5;EF=1;var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,o=(L,F,B)=>F in L?t(L,F,{enumerable:!0,configurable:!0,writable:!0,value:B}):L[F]=B,l=(L,F)=>{for(var B in F)t(L,B,{get:F[B],enumerable:!0})},u=(L,F,B,U)=>{if(F&&typeof F=="object"||typeof F=="function")for(let z of r(F))!s.call(L,z)&&z!==B&&t(L,z,{get:()=>F[z],enumerable:!(U=n(F,z))||U.enumerable});return L},d=(L,F,B)=>(B=L!=null?e(a(L)):{},u(!L||!L.__esModule?t(B,"default",{value:L,enumerable:!0}):B,L)),h=L=>u(t({},"__esModule",{value:!0}),L),p=(L,F,B)=>(o(L,typeof F!="symbol"?F+"":F,B),B),g={};l(g,{createReactPlayer:()=>A}),I5=h(g);var x=d(ti()),y=d(gJ()),w=d(LIe),j=d(xJ()),N=yJ(),k=zw(),S=d(BIe());const E=(0,k.lazy)(()=>nr(()=>import("./Preview-DPaXRg5M.js").then(L=>L.P),[])),O=typeof window<"u"&&window.document&&typeof document<"u",T=typeof b_<"u"&&b_.window&&b_.window.document,P=Object.keys(N.propTypes),M=O||T?x.Suspense:()=>null,D=[],A=(L,F)=>{var B;return B=class extends x.Component{constructor(){super(...arguments),p(this,"state",{showPreview:!!this.props.light}),p(this,"references",{wrapper:U=>{this.wrapper=U},player:U=>{this.player=U}}),p(this,"handleClickPreview",U=>{this.setState({showPreview:!1}),this.props.onClickPreview(U)}),p(this,"showPreview",()=>{this.setState({showPreview:!0})}),p(this,"getDuration",()=>this.player?this.player.getDuration():null),p(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),p(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),p(this,"getInternalPlayer",(U="player")=>this.player?this.player.getInternalPlayer(U):null),p(this,"seekTo",(U,z,$)=>{if(!this.player)return null;this.player.seekTo(U,z,$)}),p(this,"handleReady",()=>{this.props.onReady(this)}),p(this,"getActivePlayer",(0,w.default)(U=>{for(const z of[...D,...L])if(z.canPlay(U))return z;return F||null})),p(this,"getConfig",(0,w.default)((U,z)=>{const{config:$}=this.props;return y.default.all([N.defaultProps.config,N.defaultProps.config[z]||{},$,$[z]||{}])})),p(this,"getAttributes",(0,w.default)(U=>(0,k.omit)(this.props,P))),p(this,"renderActivePlayer",U=>{if(!U)return null;const z=this.getActivePlayer(U);if(!z)return null;const $=this.getConfig(U,z.key);return x.default.createElement(S.default,{...this.props,key:z.key,ref:this.references.player,config:$,activePlayer:z.lazyPlayer||z,onReady:this.handleReady})})}shouldComponentUpdate(U,z){return!(0,j.default)(this.props,U)||!(0,j.default)(this.state,z)}componentDidUpdate(U){const{light:z}=this.props;!U.light&&z&&this.setState({showPreview:!0}),U.light&&!z&&this.setState({showPreview:!1})}renderPreview(U){if(!U)return null;const{light:z,playIcon:$,previewTabIndex:K,oEmbedUrl:G,previewAriaLabel:W}=this.props;return x.default.createElement(E,{url:U,light:z,playIcon:$,previewTabIndex:K,previewAriaLabel:W,oEmbedUrl:G,onClick:this.handleClickPreview})}render(){const{url:U,style:z,width:$,height:K,fallback:G,wrapper:W}=this.props,{showPreview:I}=this.state,H=this.getAttributes(U),V=typeof W=="string"?this.references.wrapper:void 0;return x.default.createElement(W,{ref:V,style:{...z,width:$,height:K},...H},x.default.createElement(M,{fallback:G},I?this.renderPreview(U):this.renderActivePlayer(U)))}},p(B,"displayName","ReactPlayer"),p(B,"propTypes",N.propTypes),p(B,"defaultProps",N.defaultProps),p(B,"addCustomPlayer",U=>{D.push(U)}),p(B,"removeCustomPlayers",()=>{D.length=0}),p(B,"canPlay",U=>{for(const z of[...D,...L])if(z.canPlay(U))return!0;return!1}),p(B,"canEnablePIP",U=>{for(const z of[...D,...L])if(z.canEnablePIP&&z.canEnablePIP(U))return!0;return!1}),B};return I5}var L5,OF;function qIe(){if(OF)return L5;OF=1;var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,o=(w,j)=>{for(var N in j)t(w,N,{get:j[N],enumerable:!0})},l=(w,j,N,k)=>{if(j&&typeof j=="object"||typeof j=="function")for(let S of r(j))!s.call(w,S)&&S!==N&&t(w,S,{get:()=>j[S],enumerable:!(k=n(j,S))||k.enumerable});return w},u=(w,j,N)=>(N=w!=null?e(a(w)):{},l(!w||!w.__esModule?t(N,"default",{value:w,enumerable:!0}):N,w)),d=w=>l(t({},"__esModule",{value:!0}),w),h={};o(h,{default:()=>y}),L5=d(h);var p=u(RIe()),g=UIe();const x=p.default[p.default.length-1];var y=(0,g.createReactPlayer)(p.default,x);return L5}var HIe=qIe();const KIe=ka(HIe);function VIe(){const e=()=>{window.open("https://workspace.google.com/marketplace/app/moneylogz/430666016442","_blank","noopener,noreferrer")},t=[{number:1,icon:Sy,title:"Install the Moneylogz App",description:"Get the Moneylogz app from the Google Worksp
556ace Marketplace"},{number:2,icon:a1,title:"Launch the app",description:"Open the app from any Google Spreadsheet file"},{number:3,icon:Fi,title:"Link your accounts",description:"Connect your bank accounts and credit cards"},{number:4,icon:cle,title:"Start fetching transactions",description:"Automatically sync your transactions to spreadsheets"}];return i.jsx("div",{className:"w-full",children:i.jsx("div",{className:"bg-white rounded-2xl shadow-xl border border-gray-200 p-5 lg:p-12",children:i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-12",children:[i.jsxs("div",{className:"min-w-0 space-y-4",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl lg:text-2xl font-bold text-gray-900 mb-2",children:"Watch How It Works"}),i.jsx("p",{className:"text-gray-600 text-sm",children:"See how easy it is to set up Moneylogz with Google Spreadsheets"})]}),i.jsx("div",{className:"relative w-full rounded-xl overflow-hidden shadow-lg bg-gray-900",children:i.jsx("div",{className:"w-full aspect-video",children:i.jsx(KIe,{url:"https://www.youtube.com/watch?v=nzyHyZuLLfA",width:"100%",height:"100%",controls:!0,playing:!0,muted:!0,config:{youtube:{playerVars:{modestbranding:1,rel:0}}}})})})]}),i.jsxs("div",{className:"min-w-0 flex flex-col",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl lg:text-2xl font-bold text-gray-900 mb-2",children:"Get Started with Moneylogz"}),i.jsx("p",{className:"text-gray-600 text-sm",children:"Follow these simple steps to connect your spreadsheets"})]}),i.jsx("div",{className:"space-y-5 mt-6",children:t.map(n=>{const r=n.icon;return i.jsxs("div",{className:"flex gap-4",children:[i.jsx("div",{className:"flex-shrink-0",children:i.jsx("div",{className:"w-10 h-10 rounded-full bg-green-600 text-white flex items-center justify-center font-bold text-sm shadow-md",children:n.number})}),i.jsxs("div",{className:"flex-1 min-w-0 pt-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(r,{className:"w-4 h-4 text-green-600"}),i.jsx("h3",{className:"font-semibold text-gray-900",children:n.title})]}),i.jsx("p",{className:"text-sm text-gray-600",children:n.description})]})]},n.number)})}),i.jsx("div",{className:"mt-auto pt-6",children:i.jsxs(mt,{onClick:e,className:"w-full min-h-[46px] bg-green-600 hover:bg-green-700 text-white font-semibold text-center",size:"lg",children:[i.jsx(Sy,{className:"w-5 h-5 mr-2 shrink-0"}),"Install from Google Workspace Marketplace",i.jsx(n1,{className:"w-4 h-4 ml-2 shrink-0"})]})})]})]})})})}function GIe(){const[e,t]=v.useState(!1),{data:n=[],isLoading:r}=Nt({queryKey:["spreadsheets"],queryFn:()=>vE(!1),enabled:!!Et(),staleTime:3e4}),a=[...n].sort((l,u)=>{const d=new Date(l.externally_edited_at||l.updated_at).getTime();return new Date(u.externally_edited_at||u.updated_at).getTime()-d}),s=async()=>{t(!0);try{await vE(!0)}catch(l){console.warn("[GoogleSpreadsheetsPage] manual refresh failed; keeping the cached list",l)}finally{t(!1)}},o=l=>{window.open(`https://docs.google.com/spreadsheets/d/${l}/edit`,"_blank","noopener,noreferrer")};return r?i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})}):i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"mb-3 lg:mb-8 flex flex-col gap-3 lg:flex-row lg:justify-between lg:items-center lg:pr-14",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h1",{className:"text-[22px] leading-tight font-extrabold tracking-tight lg:text-3xl lg:leading-normal lg:font-bold lg:tracking-normal text-gray-900",children:"Google Spreadsheets"}),i.jsxs("p",{className:"text-[13px] mt-1 lg:text-base lg:mt-2 text-gray-600",children:["Manage your connected Google Spreadsheets",n.length>0&&i.jsxs("span",{"data-testid":"spreadsheets-count-inline",className:"lg:hidden",children:[" ","· ",n.length," connected"]})]}),n.length>0&&i.jsxs("p",{className:"hidden lg:block text-sm text-gray-500 mt-1",children:[n.length," ",n.length===1?"spreadsheet":"spreadsheets"," connected"]})]}),a.length>0&&i.jsxs(mt,{color:"gray",onClick:s,disabled:e,className:"w-full h-[42px] lg:w-auto lg:h-auto bg-white hover:bg-gray-50 border border-gray-300",children:[i.jsx(dt,{className:`w-4 h-4 mr-2 ${e?"animate-spin":""}`}),e?"Refreshing...":"Refresh"]})]}),a.length===0?i.jsx(VIe,{}):i.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3 lg:gap-6",children:a.map(l
556=>i.jsx(WIe,{spreadsheet:l,onClick:()=>o(l.spreadsheet_id)},l.id))})]})}function WIe({spreadsheet:e,onClick:t}){const n=e.externally_edited_at||e.updated_at,r=e.balances_sheet_enabled===1;return i.jsxs("div",{onClick:t,"data-testid":"spreadsheet-card",className:"bg-white border border-gray-200 rounded-xl lg:rounded-lg shadow-card lg:shadow-none px-4 py-3.5 lg:p-6 hover:shadow-lg hover:border-blue-300 transition-all cursor-pointer group flex items-start gap-3 lg:grid lg:grid-cols-[1fr_auto] lg:grid-rows-[auto_1fr] lg:gap-0",children:[i.jsx("div",{className:"shrink-0 p-2 lg:p-3 bg-green-50 rounded-[10px] lg:rounded-lg group-hover:bg-green-100 transition-colors lg:col-start-1 lg:row-start-1 lg:justify-self-start lg:mb-4",children:i.jsx(a1,{className:"w-6 h-6 text-green-600"})}),i.jsxs("div",{className:"flex-1 min-w-0 flex flex-col lg:col-span-2 lg:row-start-2",children:[i.jsxs("div",{className:"mb-2 lg:mb-3",children:[i.jsx("h3",{className:"text-[14.5px] lg:text-base font-semibold text-gray-900 mb-1 break-words",children:e.title||e.spreadsheet_id}),e.title&&i.jsx("p",{"data-testid":"spreadsheet-id",className:"text-[11px] lg:text-xs text-gray-500 break-all",children:e.spreadsheet_id}),i.jsxs("p",{className:"text-xs text-gray-400 mt-1 break-all",children:["ID: ",e.id]})]}),i.jsx("div",{className:`mb-2 lg:mb-3 lg:min-h-[28px] items-start ${r?"flex":"hidden lg:flex"}`,children:r&&i.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 bg-green-50 px-2 py-1 rounded-md w-fit",children:[i.jsx(vs,{className:"w-3 h-3"}),i.jsx("span",{children:"Balances Sheet Enabled"})]})}),i.jsxs("div",{className:"pt-2 lg:pt-3 border-t border-gray-100 mt-auto",children:[i.jsxs("p",{className:"text-xs text-gray-500",children:["Last edited: ",Km(n)]}),i.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["Created: ",Km(e.created_at)]})]})]}),i.jsx(n1,{"aria-hidden":"true",className:"shrink-0 w-[18px] h-[18px] lg:w-5 lg:h-5 text-slate-400 group-hover:text-blue-600 transition-colors lg:col-start-2 lg:row-start-1"})]})}function YIe(){const[e]=Li(),t=Sa(),{setUser:n,setConnections:r}=$n(),a=v.useRef(!1),[s,o]=ve.useState("connecting"),[l,u]=ve.useState(0);return v.useEffect(()=>{const d=setInterval(()=>{u(g=>g>=90?(clearInterval(d),90):g+Math.random()*10)},200),h=new AbortController;return(async()=>{if(a.current)return;const g=e.get("code"),x=e.get("service");if(!g||x!=="drive"){o("error"),setTimeout(()=>t("/connections"),2e3);return}if(!h.signal.aborted){if(a.current=!0,(await Uye(g)).success)try{u(100),o("success"),n(j=>j?{...j,driveConnected:!0}:null);const w=await Qm();r(w)}catch{o("error")}else o("error");setTimeout(()=>t("/connections"),s==="success"?1500:2e3)}})(),()=>{h.abort(),clearInterval(d)}},[e,t,n,r,s]),i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-green-50 flex items-center justify-center p-4",children:i.jsx("div",{className:"max-w-md w-full",children:i.jsxs("div",{className:"bg-white rounded-2xl shadow-xl border border-gray-100 p-8 text-center",children:[i.jsxs("div",{className:"mb-8",children:[i.jsxs("div",{className:`relative w-20 h-20 mx-auto mb-4 ${s==="connecting"?"animate-pulse":""}`,children:[i.jsx("img",{src:"https://img.icons8.com/fluency/80/google-drive--v1.png",alt:"Google Drive",className:"w-full h-full"}),s==="success"&&i.jsx("div",{className:"absolute -top-1 -right-1 w-6 h-6 bg-green-500 rounded-full flex items-center justify-center animate-bounce",children:i.jsx(vs,{className:"w-4 h-4 text-white"})})]}),s==="connecting"&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Connecting to Google Drive"}),i.jsx("p",{className:"text-gray-600 mb-6",children:"Securing your connection and setting up document sync..."})]}),s==="success"&&i.jsx(i.Fragment,{children:i.jsx("h2",{className:"text-2xl font-bold text-green-700 mb-2",children:"Successfully Connected!"})}),s==="error"&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"text-2xl font-bold text-red-700 mb-2",children:"Connection Failed"}),i.jsx("p",{className:"text-red-600 mb-6",children:"Unable to connect to Google Drive. Please try again."})]})]}),s==="connecting"&&i.jsxs("div",{className:"mb-8",children:[i.jsxs("div",{className:"flex justify-between text-sm text-gray-500 mb-2",children:[i.jsx("span",{children:"Progress"}),i.jsxs("span",{children:[Math.round(l),"%"]})]}),i.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:i.jsx("div",{className:"bg-gradient-to-r from-blue-500 to-green-500 h-2 rounded-full transition-all duration-300 ease-out",style:{width:`${l}%`}})})]}),s==="connecting"&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[i.jsx("div",{className:"w-5 h-5 bg-blue-500 rounded-full flex items-center justify-center",children:i.jsx(vs,{className:"w-3 h-3 text-white"})}),i.jsx("span",{className:"text-gray-700",children:"Authenticating with Google"})]}),i.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[i.jsx("div",{className:`w-5 h-5 rounded-full flex items-center justify-center ${l>30?"bg-blue-500":"bg-gray-200"}`,children:l>30?i.jsx(vs,{className:"w-3 h-3 text-white"}):i.jsx(Yn,{className:"w-3 h-3 text-gray-400 animate-spin"})}),i.jsx("span",{className:l>30?"text-gray-700":"text-gray-400",children:"Setting up Drive permissions"})]}),i.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[i.jsx("div",{className:`w-5 h-5 rounded-full flex items-center justify-center ${l>70?"bg-blue-500":"bg-gray-200"}`,children:l>70?i.jsx(vs,{className:"w-3 h-3 text-white"}):i.jsx(Yn,{className:"w-3 h-3 text-gray-400"})}),i.jsx("span",{className:l>70?"text-gray-700":"text-gray-400",children:"Finalizing connection"})]})]}),s==="success"&&i.jsxs("div",{className:"flex items-center justify-center gap-2 text-green-600 animate-fade-in",children:[i.jsx("span",{className:"text-sm font-medium",children:"Redirecting to connections"}),i.jsx(zu,{className:"w-4 h-4 animate-pulse"})]}),s==="error"&&i.jsx("div",{className:"text-red-600 text-sm",children:"Redirecting back to connections..."})]})})})}async function XIe(e){try{const{data:t}=await Je.post("/gmail/auth/callback",{code:e,redirect_uri:Ig()});return t}catch(t){return t.name==="CanceledError"?{success:!1}:{success:!1,error:t.response?.data?.error||"Failed to exchange code for tokens"}}}function QIe(){const[e]=Li(),t=Sa(),{setUser:n}=$n(),r=v.useRef(!1);return v.useEffect(()=>{const a=new AbortController;return(async()=>
556{if(r.current)return;const o=e.get("code"),l=e.get("service");if(!o||l!=="gmail"){t("/connections");return}a.signal.aborted||(r.current=!0,(await XIe(o)).success&&n(d=>d?{...d,gmailConnected:!0}:null),t("/connections"))})(),()=>{a.abort()}},[e,t,n]),i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx(Dt,{size:"xl",className:"mb-4"}),i.jsx("p",{className:"text-gray-600",children:"Connecting to Gmail..."})]})})}async function ZIe(e){try{const{data:t}=await Je.get("/monday/oauth/callback",{params:e});return t}catch(t){return t.name==="CanceledError"?{success:!1}:{success:!1,error:t.response?.data?.error||"Failed to exchange code for tokens"}}}function JIe(){const[e]=Li(),t=Sa(),{setUser:n}=$n(),r=v.useRef(!1);return v.useEffect(()=>{const a=new AbortController;return(async()=>{if(r.current)return;const o=new URLSearchParams(window.location.search),l=o.get("code"),u=o.get("scope"),d=o.get("state"),h=o.get("region");a.signal.aborted||(r.current=!0,(await ZIe({code:l,region:h,scope:u,state:d})).success&&n(g=>g?{...g,gmailConnected:!0}:null),t("/connections"))})(),()=>{a.abort()}},[e,t,n]),i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx(Dt,{size:"xl",className:"mb-4"}),i.jsx("p",{className:"text-gray-600",children:"Connecting to monday.com..."})]})})}const C0="â",wE="rounded-xl border border-border bg-surface shadow-card p-4 lg:p-6",AF=e=>e.charAt(0).toUpperCase()+e.slice(1),TF=(e,t)=>{if(!e)return null;const n=new Date(e);return Number.isNaN(n.getTime())?null:n.toLocaleDateString(void 0,t)},F5=(e,t,n)=>{ve.useEffect(()=>{e&&console.warn(n,t)},[e,t,n])};function e6e({icon:e,label:t,value:n}){return i.jsxs("div",{className:`${wE} !p-3.5 lg:!p-5 flex flex-col gap-1.5`,children:[i.jsx("span",{className:"w-8 h-8 rounded-lg bg-brand-soft text-brand inline-flex items-center justify-center",children:i.jsx(e,{className:"w-4 h-4","aria-hidden":"true"})}),i.jsx("p",{className:"text-[22px] lg:text-3xl font-extrabold tracking-tight tabular-nums text-slate-900",children:n}),i.jsx("p",{className:"text-xs lg:text-sm text-slate-500",children:t})]})}function PF({icon:e,label:t,value:n}){return i.jsxs("div",{className:"flex items-center gap-2.5 py-2.5 border-b border-border last:border-b-0 text-[13.5px] text-slate-900",children:[i.jsx("span",{className:"w-[86px] flex-none text-[11px] font-bold uppercase tracking-wider text-slate-400",children:t}),i.jsx(e,{className:"w-4 h-4 flex-none text-slate-400","aria-hidden":"true"}),i.jsx("span",{className:"min-w-0 break-words",children:n})]})}function t6e(){const{logout:e}=ns(),t=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),n=Nt({queryKey:["spreadsheets"],queryFn:()=>vE(!1),enabled:!!Et(),staleTime:3e4}),r=YO({sortBy:"date",sortOrder:"desc"}),{total:a,matched:s}=ve.useMemo(()=>{const j=hV(r.data?.receipts??[]);return{total:j.length,matched:j.filter(Yl).length}},[r.data?.receipts]),o=t.data,l=r.data!==void 0&&!r.isError,u=n.data!==void 0&&!n.isError;F5(n.isError,n.error,"[ProfilePage] spreadsheets stat unavailable: query failed"),F5(r.isError,r.error,"[ProfilePage] documents stats unavailable: query failed"),F5(t.isError,t.error,"[ProfilePage] account data unavailable: user query failed");const d=[{icon:ac,label:"Connected accounts",value:o&&!t.isError?String(o.accounts?.length??0):C0},{icon:rc,label:"Documents",value:l?String(a):C0},{icon:Fi,label:"Matched",value:l&&a>0?`${Math.round(s/a*100)}%`:C0},{icon:a1,label:"Spreadsheets",value:u?String(n.data?.length??0):C0}],h=o?.gas?.user,p=o?.gas?.subscription,g=AF(p?.plan||"Free"),x=p?.price,y=TF(h?.created_at,{month:"short",year:"numeric"}),w=TF(p?.next_cycle_date,{month:"short",day:"numeric",year:"numeric"});return i.jsxs("div",{className:"max-w-7xl mx-auto lg:px-4 lg:py-8",children:[i.jsx(Vu,{title:"Profile",subtitle:"Your account, plan and what is connected."}),i.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2.5 lg:gap-6 mb-3.5 lg:mb-8",children:d.map(j=>i.jsx(e6e,{...j},j.label))}),o&&i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-3.5 lg:gap-8",children:[i.jsxs("section",{className:wE,"aria-label":"Account data",children:[i.jsx("p",{className:"text-[10.5px] font-bold uppercase tracking-widest text-slate-400",children:"Account data"}),i.jsxs("div",{className:"flex items-center gap-3 mt-3",children:[i.jsx("span",{className:"w-14 h-14 roun
556ded-full flex-none bg-brand text-white flex items-center justify-center text-lg font-bold",children:yG(h?.name||h?.email)}),i.jsxs("div",{className:"min-w-0",children:[i.jsxs("p",{className:"text-[17px] font-extrabold tracking-tight text-slate-900 flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:"break-words",children:h?.name}),i.jsx("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-bold bg-badge-blue text-badge-blue-text whitespace-nowrap",children:g})]}),y&&i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-0.5",children:["Member since ",y]})]})]}),i.jsxs("div",{className:"mt-2",children:[h?.email&&i.jsx(PF,{icon:If,label:"Email",value:h.email}),h?.country&&i.jsx(PF,{icon:qU,label:"Country",value:h.country})]})]}),i.jsxs("section",{className:wE,"aria-label":"Subscription",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-8 h-8 rounded-lg bg-brand-soft text-brand inline-flex items-center justify-center flex-none",children:i.jsx(ea,{className:"w-4 h-4","aria-hidden":"true"})}),i.jsxs("h2",{className:"text-base font-extrabold text-slate-900",children:[g," plan"]}),p?.status&&i.jsx("span",{className:"ml-auto inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-bold bg-badge-green text-badge-green-text whitespace-nowrap",children:AF(p.status)})]}),i.jsxs("p",{className:"text-2xl font-extrabold tracking-tight text-slate-900 mt-3",children:["$",(x?.amount||0)/100,i.jsxs("small",{className:"text-[13px] font-semibold text-slate-500",children:["/",x?.interval||"month"]})]}),w&&i.jsxs("p",{className:"text-[12.5px] text-slate-500 mt-1",children:["Next billing date: ",w]}),i.jsx("ul",{className:"mt-2.5 space-y-2",children:[`${o.gas?.user?.credits?.accounts??1} connected financial accounts`,"Google Spreadsheet integration"].map(j=>i.jsxs("li",{className:"flex items-center gap-2 text-[13.5px] text-slate-700",children:[i.jsx("span",{className:"w-[18px] h-[18px] rounded-full bg-badge-green text-badge-green-text inline-flex items-center justify-center flex-none",children:i.jsx(Zt,{className:"w-[11px] h-[11px]","aria-hidden":"true"})}),j]},j))}),i.jsx(gt,{to:"/billing",className:"mt-3.5 flex items-center justify-center h-[42px] w-full rounded-lg border border-border bg-surface text-sm font-semibold text-slate-900 hover:bg-surface-2",children:"Manage billing"})]})]}),i.jsxs("button",{type:"button",onClick:()=>e(),className:"mt-3.5 lg:mt-8 flex items-center justify-center gap-2 h-[42px] w-full lg:w-auto lg:px-6 rounded-lg border border-border bg-surface text-sm font-semibold text-slate-500 hover:bg-surface-2",children:[i.jsx(uO,{className:"w-4 h-4","aria-hidden":"true"}),"Log out"]})]})}const n6e="_pricing_1o55i_2",r6e="_pricingContainer_1o55i_12",a6e="_periodToggleBar_1o55i_25",z5={pricing:n6e,pricingContainer:r6e,periodToggleBar:a6e},s6e="_pricingHeader_1sfou_1",i6e="_subtitle_1sfou_5",o6e="_heading_1sfou_308",B5={pricingHeader:s6e,subtitle:i6e,heading:o6e},l6e=()=>i.jsxs("div",{className:B5.pricingHeader,children:[i.jsx("h1",{className:B5.heading,children:"Compare plans"}),i.jsx("p",{className:B5.subtitle,children:"Every plan is a 14-day free trial. Pick the number of accounts you need â the features come with all of them."})]}),c6e="_plansTriggers_mt8jn_1",u6e="_plansTrigger_mt8jn_1",d6e="_save_mt8jn_29",f6e="_plansTriggerActive_mt8jn_45",Jd={plansTriggers:c6e,plansTrigger:u6e,save:d6e,plansTriggerActive:f6e},h6e=({period:e,setPeriod:t})=>i.jsxs("div",{className:Jd.plansTriggers,children:[i.jsx("button",{className:K$(Jd.plansTrigger,{[Jd.plansTriggerActive]:e==="month"}),onClick:()=>t("month"),children:"Monthly"}),i.jsxs("button",{className:K$(Jd.plansTrigger,{[Jd.plansTriggerActive]:e==="year"}),onClick:()=>t("year"),children:["Yearly",i.jsx("span",{className:Jd.save,children:"2 months free"})]})]}),jE={BLACKMON25:{single:{year:{price:30,originalPrice:50,price_id:"ay"},month:{price:3,originalPrice:5,price_id:"am"}},standard:{year:{price:84,originalPrice:140,price_id:"by"},month:{price:8.4,originalPrice:14,price_id:"bm"}}
556,pro:{year:{price:132,originalPrice:220,price_id:"cy"},month:{price:13.2,originalPrice:22,price_id:"cm"}}}},p6e=(e,t,n)=>{const r=e[t],a=e.title.toLowerCase().replace(" plan","");return!n||!jE[n]?r:jE[n][a]?.[t]||r};function vJ({plan:e,planKey:t,period:n,coupon:r}){const a=Sa(),s=Au(t),o=r==="BLACKMON25",l=p6e(e,n,r),u=!!l.originalPrice&&l.originalPrice!==l.price,d=n==="year"?"yr":"mo";let h=null;return!o&&s&&(h="MOST POPULAR"),o&&!s&&(h="40% OFF"),o&&s&&(h="MOST POPULAR - 40% OFF"),{isFeatured:s,pricing:l,hasStrikethrough:u,periodSuffix:d,badge:h,selectPlan:()=>{localStorage.setItem("price_id",l.price_id),r&&localStorage.setItem("coupon",r),ql("pricing_plan_selected",{plan:e.title,period:n,price_id:l.price_id,coupon:r||null}),a("/checkout")}}}const m6e="_tableWrap_1ih81_1",g6e="_table_1ih81_1",x6e="_brandCell_1ih81_31",b6e="_brand_1ih81_31",y6e="_brandLogo_1ih81_47",v6e="_brandTag_1ih81_52",w6e="_planhead_1ih81_58",j6e="_featured_1ih81_63",N6e="_featuredCol_1ih81_64",_6e="_pop_1ih81_70",k6e="_pname_1ih81_85",S6e="_pprice_1ih81_93",C6e="_porig_1ih81_106",E6e="_cta_1ih81_113",O6e="_groupRow_1ih81_140",A6e="_featureCol_1ih81_159",T6e="_newTag_1ih81_165",P6e="_desc_1ih81_176",R6e="_chk_1ih81_183",M6e="_val_1ih81_198",Rn={tableWrap:m6e,table:g6e,brandCell:x6e,brand:b6e,brandLogo:y6e,brandTag:v6e,planhead:w6e,featured:j6e,featuredCol:N6e,pop:_6e,pname:k6e,pprice:S6e,porig:C6e,cta:E6e,groupRow:O6e,featureCol:A6e,newTag:T6e,desc:P6e,chk:R6e,val:M6e},D6e=({plan:e,planKey:t,period:n,coupon:r})=>{const{isFeatured:a,pricing:s,hasStrikethrough:o,periodSuffix:l,badge:u,selectPlan:d}=vJ({plan:e,planKey:t,period:n,coupon:r});return i.jsxs("th",{className:`${Rn.planhead} ${a?Rn.featured:""}`,"data-featured":a?"true":void 0,children:[u&&i.jsx("div",{className:Rn.pop,children:u}),i.jsx("div",{className:Rn.pname,children:e.title.replace(" PLAN","")}),i.jsxs("div",{className:Rn.pprice,children:["$",s.price,i.jsxs("small",{children:[" /",l]})]}),i.jsx("div",{className:Rn.porig,children:o?`$${s.originalPrice} /${l}`:""}),i.jsx("button",{className:Rn.cta,onClick:d,children:"Start free trial"})]})},$6e=()=>i.jsx("span",{className:Rn.chk,"aria-label":"Included",children:i.jsx("svg",{viewBox:"0 0 14 10","aria-hidden":"true",children:i.jsx("path",{d:"M1 5.06 4.43 7.9 9 2.2",stroke:"#fff",strokeWidth:"1.6",strokeLinecap:"round",fill:"none"})})}),I6e=({period:e,coupon:t})=>i.jsx("div",{className:Rn.tableWrap,children:i.jsxs("table",{className:Rn.table,children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsxs("th",{className:Rn.brandCell,children:[i.jsxs("div",{className:Rn.brand,children:[i.jsx("img",{className:Rn.brandLogo,src:hO,alt:D$,width:"26",height:"26"}),D$]}),i.jsxs("div",{className:Rn.brandTag,children:["Billed ",e==="year"?"yearly":"monthly"," · cancel anytime"]})]}),_s.map(n=>i.jsx(D6e,{plan:Vf[n],planKey:n,period:e,coupon:t},n))]})}),i.jsx("tbody",{children:Qy.map(n=>i.jsxs(ve.Fragment,{children:[i.jsxs("tr",{className:Rn.groupRow,children:[i.jsx("td",{children:n.section}),_s.map(r=>{const a=Au(r);return i.jsx("td",{className:a?Rn.featuredCol:"","data-featured":a?"true":void 0},r)})]}),n.rows.map(r=>i.jsxs("tr",{children:[i.jsxs("td",{className:Rn.featureCol,children:[r.label,r.isNew&&i.jsx("span",{className:Rn.newTag,children:"NEW"}),r.description&&i.jsx("span",{className:Rn.desc,children:r.description})]}),_s.map(a=>{const s=tG(r,a),o=Au(a);return i.jsx("td",{className:o?Rn.featuredCol:"","data-featured":o?"true":void 0,children:s.kind==="value"?i.jsx("span",{className:Rn.val,children:s.text}):i.jsx($6e,{})},a)})]},r.label))]},n.section))})]})}),L6e="_banner_1c4w9_1",F6e="_bannerContent_1c4w9_21",z6e="_bannerLeft_1c4w9_29",B6e="_iconWrapper_1c4w9_35",U6e="_icon_1c4w9_35",q6e="_textContent_1c4w9_50",H6e="_title_1c4w9_55",K6e="_subtitle_1c4w9_63",V6e="_countdown_1c4w9_70",G6e="_timeBlock_1c4w9_76",W6e="_timeValue_1c4w9_87",Y6e="_timeLabel_1c4w9_94",X6e="_separator_1c4w9_103",cn={banner:L6e,bannerContent:F6e,bannerLeft:z6e,iconWrapper:B6e,icon:U6e,textContent:q6e,title:H6e,subtitle:K6e,countdown:V6e,timeBlock:G6e,timeValue:W6e,timeLabel:Y6e,separator:X6e},Q6e=()=>{const[e,t]=v.useState({days:0,hours:0,minutes:0,seconds:0});return v.useEffect(()=>{const r=()=>{const s=new Date("2025-12-04T13:59:59"),o=new Date,l=s.getTime()-o.getTime();return l>0?{days:Math.floor(l/864e5),hours:Math.floor(l/36e5%24),minutes:Math.floor(l/1e3/60%60),seconds:Math.floor(l/1e3%60)}:{days:0,hours:0,minutes:0,seconds:0}};t(r());const a=setInterval(()=>{t(r())},1e3);return()=>clearInterval(a)},[]),e.days===0&&e.hours===0&&e.minutes===0&&e.seconds===0?null:i.jsx("div",{className:cn.banner,children:i.jsxs("div",{className:cn.bannerContent,children:[i.jsxs("div",{className:cn.bannerLeft,children:[i.jsx("div",{className:cn.iconWrapper,children:i.jsx(Cy,{className:cn.icon})}),i.jsxs("div",{className:cn.textContent,children:[i.jsx("h2",{className:cn.title,children:"Black Friday Sale"}),i.jsx("p",{className:cn.subtitle,children:"40% Off All Plans"})]})]}),i.jsxs("div",{className:cn.countdown,children:[i.jsxs("div",{className:cn.timeBlock,children:[i.jsx("span",{className:cn.timeValue,children:e.days}),i.jsx("span",{className:cn.timeLabel,children:"Days"})]}),i.jsx("span",{className:cn.separator,children:":"}),i.jsxs("div",{className:cn.timeBlock,children:[i.jsx("span",{className:cn.timeValue,children:String(e.hours).padStart(2,"0")}),i.jsx("span",{className:cn.timeLabel,children:"Hours"})]}),i.jsx("span",{className:cn.separator,children:":"}),i.jsxs("div",{className:cn.timeBlock,children:[i.jsx("span",{className:cn.timeValue,children:String(e.minutes).padStart(2,"0")}),i.jsx("span",{className:cn.timeLabel,children:"Minutes"})]}),i.jsx("span",{className:cn.separator,children:":"}),i.jsxs("div",{className:cn.timeBlock,children:[i.jsx("span",{className:cn.timeValue,children:String(e.seconds).padStart(2,"0")}),i.jsx("span",{className:cn.timeLabel,children:"Seconds"})]})]})]})})},RF=4,Z6e=({planKey:e,period:t,coupon:n})=>{const r=Vf[e],{isFeatured:a,pricing:s,hasStrikethrough:o,periodSuffix:l,badge:u,selectPlan:d}=vJ({plan:r,planKey:e,period:t,coupon:n}),h=xA(e),p=h.length-RF;return i.jsxs("div",{"data-testid":`pricing-plan-card-${e}`,"data-featured":a?"true":void 0,className:`relative mt-4 rounded-xl bg-surface p-4 pt-5 text-left shadow-card ${a?"border-2 border-[#e85c33]":"border border-border"}`,children:[u&&i.jsx("span",{className:"absolute -top-3 left-4 rounded-full bg-[#e85c33] px-3 py-1 text-[11px] font-extrabold tracking-wide text-white",children:u}),i.jsx("p",{className:"text-[13px] font-extrabold tracking-widest text-slate-500",children:r.title.replace(" PLAN","")}),i.jsx("p",{className:"mb-2.5 mt-1 text-[12.5px] leading-snug text-slate-500",children:r.subtitle}),i.jsxs("p",{className:"text-[32px] font-extrabold tracking-tight text-slate-900",children:["$",s.price,i.jsxs("small",{className:"ml-1 text-[13px] font-semibold text-slate-500",children:["/",l]})]}),o&&i.jsxs("p",{className:"mt-0.5 text-[12.5px] text-slate-400",children:[i.jsxs("s",{children:["$",s.originalPrice," /",l]}),n?` · ${n} applied`:""]}),i.jsx("ul",{className:"mb-1 mt-2.5",children:h.slice(0,RF).map(g=>i.jsxs("li",{className:"my-2 flex items-start gap-2 text-[13.5px] text-slate-700",children:[i.jsx("span",{className:"mt-px inline-flex h-[18px] w-[18px] flex-none items-center justify-center rounded-[5px] bg-badge-green text-badge-green-text",children:i.jsx(Zt,{className:"h-3 w-3","aria-hidden":"true"})}),g]},g))}),p>0&&i.jsxs("p",{className:"text-[12.5px] text-slate-500",children:["+ ",p," more included â compare every feature below"]}),i.jsx("button",{type:"button",onClick:d,className:`mt-3 inline-flex h-11 w-full items-center justify-center rounded-lg border text-[14.5px] font-bold ${a?"border-brand bg-brand text-white hover:bg-brand-hover":"border-border bg-surface text-slate-700 hover:bg-surface-2"}`,children:"Start free trial"})]})},J6e=[..._s.filter(e=>Au(e)),..._s.filter(e=>!Au(e))],eLe=({period:e,coupon:t})=>i.jsx("div",{"data-testid":"pricing-plan-cards",children:J6e.map(n=>i.jsx(Z6e,{planKey:n,period:e,coupon:t},n))}),MF={gridTemplateColumns:`1fr repeat(${_s.length}, 44px)`},DF=e=>Au(e)?"bg-[#e85c33]/[0.06]":"",tLe=()=>{const[e,t]=v.useState(()=>new Set(Qy.slice(0,1).map(r=>r.section))),n=r=>{ql("pricing_feature_section_toggled",{section:r,open:!e.has(r)}),t(a=>
556{const s=new Set(a);return s.has(r)?s.delete(r):s.add(r),s})};return i.jsx("div",{className:"mt-4 overflow-hidden rounded-xl border border-border bg-surface text-left","data-testid":"pricing-feature-accordion",children:Qy.map((r,a)=>{const s=e.has(r.section),o=`pricing-feature-section-${a}`;return i.jsxs("div",{className:a>0?"border-t border-border":"",children:[i.jsxs("button",{type:"button","aria-expanded":s,"aria-controls":o,onClick:()=>n(r.section),className:"flex min-h-[44px] w-full items-center justify-between px-3.5 text-left text-[13.5px] font-bold text-slate-900",children:[r.section,i.jsx(Ca,{className:`h-4 w-4 text-slate-500 transition-transform ${s?"rotate-180":""}`,"aria-hidden":"true"})]}),s&&i.jsxs("div",{id:o,children:[i.jsxs("div",{className:"grid items-stretch border-t border-border bg-surface-2 px-3.5 text-[10.5px] font-bold uppercase tracking-wider text-slate-400",style:MF,children:[i.jsx("span",{className:"py-2",children:"Feature"}),_s.map(l=>i.jsx("span",{className:`flex items-center justify-center py-2 ${DF(l)}`,children:_o(l).slice(0,3)},l))]}),r.rows.map(l=>i.jsxs("div",{className:"grid items-stretch border-t border-border px-3.5 text-[12.5px] text-slate-700",style:MF,children:[i.jsxs("span",{className:"py-2.5 pr-2",children:[l.label,l.isNew&&i.jsx("span",{className:"ml-1.5 rounded-full bg-badge-blue px-1.5 py-px text-[9.5px] font-bold text-badge-blue-text",children:"NEW"})]}),_s.map(u=>{const d=tG(l,u);return i.jsx("span",{"data-featured":Au(u)?"true":void 0,className:`flex items-center justify-center py-2.5 ${DF(u)}`,children:d.kind==="value"?i.jsx("span",{className:"text-center text-[11.5px] font-bold",children:d.text}):i.jsx("span",{className:"inline-flex h-[18px] w-[18px] items-center justify-center rounded-full bg-amount-pos text-white","aria-label":"Included",children:i.jsx(Zt,{className:"h-3 w-3","aria-hidden":"true"})})},u)})]},l.label))]})]},r.section)})})},wJ="moneylogz_coupon",nLe=()=>localStorage.getItem(wJ),$F=e=>{e&&localStorage.setItem(wJ,e)},IF=e=>e&&jE[e],rLe=()=>{const[e,t]=v.useState("year"),[n]=Li(),[r,a]=v.useState(null);return v.useEffect(()=>{const s=()=>new Date<new Date("2025-12-04T13:59:59"),o=n.get("coupon"),l=nLe();s()?($F("BLACKMON25"),a("BLACKMON25")):o&&IF(o)?($F(o),a(o)):l&&IF(l)&&a(l)},[n]),i.jsxs("div",{className:z5.pricing,children:[i.jsx(Q6e,{}),i.jsx(l6e,{}),i.jsxs("div",{className:z5.pricingContainer,children:[i.jsx("div",{className:z5.periodToggleBar,children:i.jsx(h6e,{period:e,setPeriod:t})}),i.jsxs("div",{className:"w-full lg:hidden",children:[i.jsx(eLe,{period:e,coupon:r}),i.jsx(tLe,{})]}),i.jsx("div",{className:"hidden w-full lg:block",children:i.jsx(I6e,{period:e,coupon:r})})]})]})},Bw=(e,t)=>{if(e instanceof ma){const n=e.data,r=n?.details||n?.error||t;return console.error(`[stripeApi] request failed (${e.statusCode??"no status"}): ${r}`),r}return e instanceof Error?e.message:t},aLe=async()=>{const{data:e}=await Je.post("/stripe/session/create-checkout-session",{price_id:ZV(localStorage.getItem("price_id")),coupon:localStorage.getItem("coupon")||null,env:"gas"});if(!e.success)throw new Error(e.message||"Failed to update account title");return e.data},sLe=async()=>{const{data:e}=await Je.post("/stripe/subscription/cancel");if(!e.success)throw new Error(e.message||"Failed to cancel subscription");return e},iLe=async()=>{const{data:e}=await Je.post("/stripe/subscription/activate");if(!e.success)throw new Error(e.message||"Failed to activate subscription");return e},oLe=async e=>{try{const{data:t}=await Je.post("/stripe/subscription/preview",{price_id:e});return t.data}catch(t){throw new Error(Bw(t,"Failed to preview subscription change"))}},lLe=async(e,t)=>{try{const{data:n}=await Je.post("/stripe/subscription/update",{price_id:e,plan:t});return n.data}catch(n){throw new Error(Bw(n,"Failed to update subscription"))}},cLe=async()=>{try{const{data:e}=await Je.post("/stripe/payment-method/setup-intent");if(!e.data?.client_secret)throw new Error("Failed to start payment method update");return e.data.client_secret}catch(e){throw new Error(Bw(e,"Failed to start payment method update"))}},uLe=async e=>{try{const{data:t}=await Je.post("/stripe/payment-method/update",{payment_method:e});return t.data}catch(t){throw new Error(Bw(t,"Failed to update payment method"))}},U5={single:1,standard:2,pro:3};function dLe(e,t,n,r){if(e===n&&t===r)return"current";const a=e?U5[e]??0:0;return U5[n]>a?"upgrade":U5[n]<a?"downgrade":"switch-period"}function fLe(e,t){return e==="cancel_at_period_end"?!1:e==="succeeded"||t}function hLe(e,t,n){const r=_o(t);switch(e){case"current":return"Your current plan";case"upgrade":return`Upgrade to ${r}`;case"downgrade":return`Downgrade to ${r}`;case"switch-period":return n==="year"?"Switch to yearly":"Switch to monthly"}}function pLe({currentPlan:e,currentPeriod:t,onSelect:n}){const[r,a]=v.useState(t==="year"?"year":"month"),s=e&&_s.includes(e)?e:void 0,o=l=>{const u=Vf[l],d=r==="year"?u.year:u.month;n({plan:l,period:r,priceId:h0e(l,r),title:_o(l),amount:d.price})};return i.jsxs("div",{className:"mb-8",children:[i.jsxs("div",{className:"flex items-center justify-between gap-4 mb-5 flex-wrap",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:"Change your plan"}),i.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Upgrade, downgrade or switch billing period â
556changes are prorated instantly."})]}),i.jsxs("div",{className:"flex w-full lg:inline-flex lg:w-auto bg-slate-100 border border-slate-200 rounded-xl p-1",children:[i.jsx("button",{type:"button",onClick:()=>a("month"),className:`flex-1 lg:flex-none min-h-[42px] lg:min-h-0 px-6 py-2 rounded-lg text-sm font-semibold transition-colors ${r==="month"?"bg-white border border-brand text-brand shadow-sm":"text-slate-600"}`,children:"Monthly"}),i.jsxs("button",{type:"button",onClick:()=>a("year"),className:`flex-1 lg:flex-none min-h-[42px] lg:min-h-0 px-3 lg:px-6 py-2 rounded-lg text-sm font-semibold transition-colors flex items-center justify-center gap-2 ${r==="year"?"bg-white border border-brand text-brand shadow-sm":"text-slate-600"}`,children:["Yearly",i.jsx("span",{className:"text-[11px] font-bold bg-badge-green text-badge-green-text px-2 py-0.5 rounded-full",children:"2 months free"})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5",children:_s.map(l=>{const u=Vf[l],d=r==="year"?u.year:u.month,h=dLe(s,t,l,r),p=h==="current",g=l==="standard"&&h!=="downgrade";return i.jsxs("div",{"data-testid":`plan-card-${l}`,className:`relative bg-white rounded-xl shadow-card p-4 lg:p-6 flex flex-col border ${p?"order-first lg:order-none":""} ${p?"border-2 border-amount-pos":g?"border-[#e85c33]":"border-border"}`,children:[p&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 bg-amount-pos text-white text-[11px] font-extrabold tracking-wide px-4 py-1 rounded-full whitespace-nowrap",children:"â CURRENT PLAN"}),i.jsx("div",{className:"text-[13px] font-extrabold tracking-widest text-slate-500 mb-1",children:u.title}),i.jsx("p",{className:"text-[12.5px] text-slate-500 min-h-[34px] mb-3 leading-snug",children:u.subtitle}),i.jsxs("div",{className:"flex items-baseline gap-1.5 mb-1",children:[i.jsxs("span",{className:"text-4xl font-extrabold tracking-tight text-gray-900",children:["$",d.price]}),i.jsxs("span",{className:"text-sm text-slate-500 font-semibold",children:["/ ",r]})]}),r==="year"&&"originalPrice"in d&&d.originalPrice?i.jsxs("div",{className:"text-[13px] text-slate-400 line-through h-4 mb-3",children:["$",d.originalPrice," / ",r]}):i.jsx("div",{className:"h-4 mb-3"}),i.jsx("ul",{className:"flex-1 flex flex-col gap-2.5 my-3",children:xA(l).map(x=>i.jsxs("li",{className:"flex items-start gap-2.5 text-[13.5px] text-slate-700",children:[i.jsx("span",{className:"w-[18px] h-[18px] rounded-md bg-badge-green text-badge-green-text flex items-center justify-center flex-shrink-0 mt-0.5",children:i.jsx(Zt,{className:"w-3 h-3"})}),x]},x))}),i.jsx("button",{type:"button",disabled:p,onClick:()=>o(l),className:`w-full rounded-lg py-3 text-[14.5px] font-bold transition-colors ${p?"bg-slate-100 text-slate-400 cursor-default":h==="upgrade"?"bg-brand hover:bg-brand-hover text-white":"bg-white border border-border text-slate-700 hover:bg-surface-2"}`,children:hLe(h,l,r)})]},l)})}),i.jsx("div",{className:"flex items-center gap-1.5 text-xs text-slate-400 mt-3",children:i.jsx("span",{children:"Upgrades take effect immediately; downgrades and period changes apply on your next renewal."})})]})}const jJ=["user"];function mLe(){return Pf({mutationFn:e=>oLe(e)})}function gLe(){const e=mn();return Pf({mutationFn:({priceId:t,plan:n})=>lLe(t,n),onSuccess:async()=>{await e.invalidateQueries({queryKey:jJ})}})}function xLe(){const e=mn();return Pf({mutationFn:t=>uLe(t),onSuccess:async()=>{await e.invalidateQueries({queryKey:jJ})}})}const fo=e=>e==null||Number.isNaN(e)?"â":`$${(e/100).toFixed(2)}`,Uw=`fixed inset-0 z-50 p-0 lg:p-5 ${gG}`,qw=`w-full max-w-none lg:max-w-md bg-white ${bG} lg:rounded-2xl shadow-2xl overflow-y-auto lg:max-h-none lg:overflow-hidden`,LF=e=>{if(!e)return"â";const t=new Date(e.replace(" ","T"));return Number.isNaN(t.getTime())?"â":t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})};function bLe({selection:e,currentPlanTitle:t,currentAmount:n,currentPeriod:r,cardLast4:a,isTrial:s=!1,onClose:o,onSuccess:l,onError:u}){const d=mLe(),h=gLe(),p=d.mutate;v.useEffect(()=>{p(e.priceId)},[p,e.priceId]);const g=()=>{h.mutate({priceId:e.priceId,plan:e.plan},{onSuccess:w=>l(w,e),onError:w=>u(w instanceof Error?w.message:"Failed to update subscription")})},x=d.data,y=x?fo(x.amountDueToday):null;return i.jsx("div",{className:Uw,"data-testid":"confirm-plan-change-sheet",children:i.jsxs("div",{className:`${qw} pb-[env(safe-area-inset-bottom)] lg:pb-0`,children:[i.jsxs("div",{className:"pt-5 lg:pt-6 px-5 lg:px-6 flex items-start gap-3.5",children:[i.jsx("div",{className:"w-11 h-11 rounded-xl bg-brand-soft flex items-center justify-center flex-shrink-0",children:i.jsx(dt,{className:"w-5 h-5 text-brand"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-extrabold text-gray-900",children:"Confirm plan change"}),i.jsx("p",{className:"text-[13.5px] text-slate-500 mt-1 leading-snug",children:"Review the details before confirming your subscription change."})]}),i.jsx("button",{onClick:o,className:"ml-auto min-w-[42px] min-h-[42px] lg:min-w-0 lg:min-h-0 flex items-center justify-center text-slate-400 hover:text-slate-600 p-1","aria-label":"Close",children:i.jsx(Ut,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"px-5 lg:px-6 pt-5 pb-1",children:[i.jsxs("div",{className:"flex items-stretch gap-3 mb-4",children:[i.jsxs("div",{className:"flex-1 border border-border rounded-xl p-3.5 text-center bg-surface-2",children:[i.jsx("div",{className:"text-[10.5px] font-extrabold tracking-wider up
556percase text-slate-400 mb-1.5",children:"Current"}),i.jsx("div",{className:"text-[15px] font-extrabold text-gray-900",children:t}),i.jsxs("div",{className:"text-[12.5px] text-slate-500 mt-0.5",children:[fo(n*100)," / ",r]})]}),i.jsx("div",{className:"flex items-center text-slate-400",children:i.jsx(zu,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex-1 border border-brand rounded-xl p-3.5 text-center bg-brand-soft",children:[i.jsx("div",{className:"text-[10.5px] font-extrabold tracking-wider uppercase text-brand mb-1.5",children:"New"}),i.jsx("div",{className:"text-[15px] font-extrabold text-gray-900",children:e.title}),i.jsxs("div",{className:"text-[12.5px] text-slate-500 mt-0.5",children:["$",e.amount," / ",e.period]})]})]}),d.isPending&&i.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-slate-500",children:[i.jsx(Dt,{size:"sm"})," Calculating prorationâ¦"]}),d.isError&&i.jsx("div",{className:"text-[13px] text-badge-red-text bg-badge-red border border-red-200 rounded-xl p-3 mb-2",children:"Couldn't calculate the prorated amount. You can still confirm â Stripe will charge the correct amount."}),x&&i.jsxs("div",{className:"border border-border rounded-xl overflow-hidden",children:[i.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-[13.5px] border-b border-border",children:[i.jsx("span",{className:"text-slate-600",children:"New recurring price"}),i.jsxs("span",{className:"font-semibold text-gray-900",children:[fo(x.newAmount)," / ",x.interval]})]}),i.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-[13.5px] border-b border-border",children:[i.jsx("span",{className:"text-slate-600",children:"Effective"}),i.jsx("span",{className:"font-semibold text-gray-900 capitalize",children:x.effectiveDate})]}),!s&&x.prorationCredit>0&&i.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-[13.5px] border-b border-border",children:[i.jsxs("span",{className:"text-slate-600",children:["Unused ",t," credit"]}),i.jsxs("span",{className:"font-semibold text-amount-pos",children:["â ",fo(x.prorationCredit)]})]}),!s&&x.prorationCharge>0&&i.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-[13.5px] border-b border-border",children:[i.jsxs("span",{className:"text-slate-600",children:["Prorated ",e.title," charge"]}),i.jsx("span",{className:"font-semibold text-gray-900",children:fo(x.prorationCharge)})]}),i.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-[13.5px] bg-surface-2",children:[i.jsx("span",{className:"font-bold text-gray-900",children:s?"Due today (trial)":`Charged${a?` to card ···· ${a}`:""} today`}),i.jsx("span",{className:"text-base font-extrabold text-gray-900",children:s?fo(0):y})]})]}),x&&i.jsx("p",{className:"text-xs text-slate-500 mt-3 leading-snug",children:s?`You won't be charged while your trial is active. Billing starts${x.nextCycleDate?` on ${LF(x.nextCycleDate)}`:" when your trial ends"} at ${fo(x.newAmount)} / ${x.interval}.`:x.nextCycleDate?`Your next full charge of ${fo(x.newAmount)} will be on ${LF(x.nextCycleDate)}. Proration is calculated by Stripe.`:"Proration is calculated by Stripe."})]}),i.jsxs("div",{className:`${lc} px-5 lg:px-6 pt-5 pb-5 lg:pb-6`,children:[i.jsx("button",{onClick:o,disabled:h.isPending,className:"lg:flex-1 rounded-lg py-3 text-[14.5px] font-bold border border-border bg-white text-slate-700 hover:bg-surface-2 disabled:opacity-60",children:"Cancel"}),i.jsx("button",{onClick:g,disabled:h.isPending||d.isPending,className:"lg:flex-1 rounded-lg py-3 text-[14.5px] font-bold bg-brand hover:bg-brand-hover text-white flex items-center justify-center gap-2 disabled:opacity-60",children:h.isPending?i.jsxs(i.Fragment,{children:[i.jsx(Dt,{size:"sm",className:"text-white"})," Processingâ¦"]}):s?"Confirm change":i.jsxs(i.Fragment,{children:["Confirm",y?` & pay ${y}`:" change"]})})]})]})})}const yLe=e=>{if(!e)return"â";const t=new Date(e.replace(" ","T"));return Number.isNaN(t.getTime())?"â":t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})};function vLe({result:e,onClose:t}){const n=`${_o(e.plan)} · ${e.period==="year"?"Yearly":"Monthly"}`;return i.jsx("div",{className:Uw,"data-testid":"plan-changed-success-sheet",children:i.jsxs("div",{className:`${qw} p-6 pb-[calc(1.5rem+env(safe-area-inset-bottom))] lg:p-8 text-center`,children:[i.jsx("div",{className:"w-[72px] h-[72px] rounded-full bg-badge-green flex items-center justify-center mx-auto mb-5 ring-8 ring-badge-green/40",children:i.jsx(Zt,{className:"w-9 h-9 text-badge-green-text"})}),i.jsxs("h3",{className:"text-xl font-extrabold text-gray-900 mb-2",children:["You're on ",_o(e.plan)," ð"]}),i.jsxs("p",{className:"text-sm text-slate-500 mb-5 leading-relaxed",children:["Your subscription was updated to the ",i.jsxs("b",{className:"text-gray-900",children:[_o(e.plan)," plan"]}),"."]}),i.jsxs("div",{className:"border border-border rounded-xl overflow-hidden text-left mb-6",children:[i.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-[13.5px] border-b border-border",children:[i.jsx("span",{className:"text-slate-600",children:"New plan"}),i.jsx("span",{className:"inline-flex items-center gap-1.5 text-xs font-extrabold px-2.5 py-1 rounded-full bg-badge-green text-badge-green-text",children:n})]}),i.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-[13.5px] border-b border-border",children:[i.jsx("span",{className:"text-slate-600",children:"New recurring price"}),i.jsxs("span",{className:"font-bold text-gray-900",children:[fo(e.amount)," / ",e.period]})]}),i.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-[13.5px] border-b border-border",children:[i.jsx("span",{className:"text-slate-600",children:"Next charge"}),i.jsx("span",{className:"font-bold text-gray-900",children:yLe(e.nextCycleDate)})]}),i.jsxs("div",{className:"flex justify-between items-center px-4 py-3 text-[13.5px]",children:[i.jsx("span",{className:"text-slate-600",children:"Status"}),i.jsx("span",{className:"font-bold text-amount-pos",children:"Active"})]})]}),i.jsxs("button",{onClick:t,className:"w-full rounded-lg py-3 text-[15px] font-bold bg-brand hover:bg-brand-hover text-white flex items-center justify-center gap-2",children:["Back to Billing",i.jsx(zu,{className:"w-4 h-4"})]})]})})}
556function wLe({message:e,currentPlanTitle:t,onRetry:n,onUpdatePayment:r,onClose:a}){return i.jsx("div",{className:Uw,"data-testid":"plan-change-error-sheet",children:i.jsxs("div",{className:`${qw} p-6 pb-[calc(1.5rem+env(safe-area-inset-bottom))] lg:p-8 text-center`,children:[i.jsx("div",{className:"w-[70px] h-[70px] rounded-full bg-badge-red flex items-center justify-center mx-auto mb-4 ring-8 ring-badge-red/40",children:i.jsx(Jt,{className:"w-8 h-8 text-badge-red-text"})}),i.jsx("h3",{className:"text-xl font-extrabold text-gray-900 mb-2",children:"We couldn't update your plan"}),i.jsx("p",{className:"text-sm text-slate-500 mb-4 leading-relaxed",children:"Your subscription change wasn't applied."}),i.jsxs("div",{className:"flex gap-2.5 text-left bg-red-50 border border-red-200 rounded-xl px-4 py-3 mb-4",children:[i.jsx(ea,{className:"w-[18px] h-[18px] text-amount-neg flex-shrink-0 mt-0.5"}),i.jsx("div",{className:"text-[13px] text-red-900 leading-snug",children:e})]}),i.jsxs("div",{className:"flex items-center justify-center gap-2 text-[12.5px] text-slate-500 bg-surface-2 border border-border rounded-xl px-3.5 py-3 mb-5",children:[i.jsx(vs,{className:"w-[15px] h-[15px] text-slate-400"}),"You're still on ",i.jsxs("b",{className:"text-gray-900",children:["Â ",t,"Â "]})," â nothing was charged."]}),i.jsxs("div",{className:"flex flex-col gap-2.5",children:[i.jsxs("button",{onClick:n,className:"w-full rounded-lg py-3 text-[14.5px] font-bold bg-brand hover:bg-brand-hover text-white flex items-center justify-center gap-2",children:[i.jsx(dt,{className:"w-4 h-4"}),"Try again"]}),i.jsx("button",{onClick:r,className:"w-full rounded-lg py-3 text-[14.5px] font-bold border border-border bg-white text-slate-700 hover:bg-surface-2",children:"Update payment method"}),i.jsx("button",{onClick:a,className:"w-full rounded-lg py-2 min-h-[42px] lg:min-h-0 text-[13.5px] font-semibold text-slate-500 hover:text-slate-700",children:"Close"})]})]})})}var jLe=bJ();const bn=ka(jLe);function FF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FF(Object(n),!0).forEach(function(r){NJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ty(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ty=function(t){return typeof t}:ty=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ty(e)}function NJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NLe(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,s;for(s=0;s<r.length;s++)a=r[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function _Le(e,t){if(e==null)return{};var n=NLe(e,t),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UP(e,t){return kLe(e)||SLe(e,t)||CLe(e,t)||ELe()}function kLe(e){if(Array.isArray(e))return e}function SLe(e,t){var n=e&&(typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"]);if(n!=null){var r=[],a=!0,s=!1,o,l;try{for(n=n.call(e);!(a=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));a=!0);}catch(u){s=!0,l=u}finally{try{!a&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function CLe(e,t){if(e){if(typeof e=="string")return BF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BF(e,t)}}function BF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
556function ELe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 557In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var La=function(t,n,r){var a=!!r,s=ve.useRef(r);ve.useEffect(function(){s.current=r},[r]),ve.useEffect(function(){if(!a||!t)return function(){};var o=function(){s.current&&s.current.apply(s,arguments)};return t.on(n,o),function(){t.off(n,o)}},[a,n,t,s])},fg=function(t){var n=ve.useRef(t);return ve.useEffect(function(){n.current=t},[t]),n.current},nh=function(t){return t!==null&&ty(t)==="object"},OLe=function(t){return nh(t)&&typeof t.then=="function"},ALe=function(t){return nh(t)&&typeof t.elements=="function"&&typeof t.createToken=="function"&&typeof t.createPaymentMethod=="function"&&typeof t.confirmCardPayment=="function"},UF="[object Object]",TLe=function e(t,n){if(!nh(t)||!nh(n))return t===n;var r=Array.isArray(t),a=Array.isArray(n);if(r!==a)return!1;var s=Object.prototype.toString.call(t)===UF,o=Object.prototype.toString.call(n)===UF;if(s!==o)return!1;if(!s&&!r)return t===n;var l=Object.keys(t),u=Object.keys(n);if(l.length!==u.length)return!1;for(var d={},h=0;h<l.length;h+=1)d[l[h]]=!0;for(var p=0;p<u.length;p+=1)d[u[p]]=!0;var g=Object.keys(d);if(g.length!==l.length)return!1;var x=t,y=n,w=function(N){return e(x[N],y[N])};return g.every(w)},_J=function(t,n,r){return nh(t)?Object.keys(t).reduce(function(a,s){var o=!nh(n)||!TLe(t[s],n[s]);return r.includes(s)?(o&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),a):o?zF(zF({},a||{}),{},NJ({},s,t[s])):a},null):null},kJ="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",qF=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kJ;if(t===null||ALe(t))return t;throw new Error(n)},SJ=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kJ;if(OLe(t))return{tag:"async",stripePromise:Promise.resolve(t).then(function(a){return qF(a,n)})};var r=qF(t,n);return r===null?{tag:"empty"}:{tag:"sync",stripe:r}},CJ=function(t){!t||!t._registerWrapper||!t.registerAppInfo||(t._registerWrapper({name:"react-stripe-js",version:"3.7.0"}),t.registerAppInfo({name:"react-stripe-js",version:"3.7.0",url:"https://stripe.com/docs/stripe-js/react"}))},Hw=ve.createContext(null);Hw.displayName="ElementsContext";var EJ=function(t,n){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return t},OJ=function(t){var n=t.stripe,r=t.options,a=t.children,s=ve.useMemo(function(){return SJ(n)},[n]),o=ve.useState(function(){return{stripe:s.tag==="sync"?s.stripe:null,elements:s.tag==="sync"?s.stripe.elements(r):null}}),l=UP(o,2),u=l[0],d=l[1];ve.useEffect(function(){var g=!0,x=function(w){d(function(j){return j.stripe?j:{stripe:w,elements:w.elements(r)}})};return s.tag==="async"&&!u.stripe?s.stripePromise.then(function(y){y&&g&&x(y)}):s.tag==="sync"&&!u.stripe&&x(s.stripe),function(){g=!1}},[s,u,r]);var h=fg(n);ve.useEffect(function(){h!==null&&h!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[h,n]);var p=fg(r);return ve.useEffect(function(){if(u.elements){var g=_J(r,p,["clientSecret","fonts"]);g&&u.elements.update(g)}},[r,p,u.elements]),ve.useEffect(function(){CJ(u.stripe)},[u.stripe]),ve.createElement(Hw.Provider,{value:u},a)};OJ.propTypes={stripe:bn.any,options:bn.object};var PLe=function(t){var n=ve.useContext(Hw);return EJ(n,t)},RLe=function(){var t=PLe("calls useElements()"),n=t.elements;return n};bn.func.isRequired;var AJ=ve.createContext(null);AJ.displayName="CheckoutSdkContext";var MLe=function(t,n){if(!t)throw new Error("Could not find CheckoutProvider context; You need to wrap the part of your app that ".concat(n," in an <CheckoutProvider> provider."));return t},DLe=ve.createContext(null);DLe.displayName="CheckoutContext";bn.any,bn.shape({fetchClientSecret:bn.func.isRequired,elementsOptions:bn.object}).isRequired;var NE=function(t){var n=ve.useContext(AJ),r=ve.useContext(Hw);if(n&&r)throw new Error("You cannot wrap the part of your app that ".concat(t," in both <CheckoutProvider> and <Elements> providers."));return n?MLe(n,t):EJ(r,t)},$Le=["mode"],ILe=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},Zn=function(t,n){var r="".concat(ILe(t),"Element"),a=function(u){var d=u.id,h=u.className,p=u.options,g=p===void 0?{}:p,x=u.onBlur,y=u.onFocus,w=u.onReady,j=u.onChange,N=u.onEscape,k=u.onClick,S=u.onLoadError,E=u.onLoaderStart,O=u.onNetworksChange,T=u.onConfirm,P=u.onCancel,M=u.onShippingAddressChange,D=u.onShippingRateChange,A=NE("mounts <".concat(r,">")),L="elements"in A?A.elements:null,F="checkoutSdk"in A?A.checkoutSdk:null,B=ve.useState(null),U=UP(B,2),z=U[0],$=U[1],K=ve.useRef(null),G=ve.useRef(null);La(z,"blur",x),La(z,"focus",y),La(z,"escape",N),La(z,"click",k),La(z,"loaderror",S),La(z,"loaderstart",E),La(z,"
557networkschange",O),La(z,"confirm",T),La(z,"cancel",P),La(z,"shippingaddresschange",M),La(z,"shippingratechange",D),La(z,"change",j);var W;w&&(t==="expressCheckout"?W=w:W=function(){w(z)}),La(z,"ready",W),ve.useLayoutEffect(function(){if(K.current===null&&G.current!==null&&(L||F)){var H=null;if(F)switch(t){case"payment":H=F.createPaymentElement(g);break;case"address":if("mode"in g){var V=g.mode,X=_Le(g,$Le);if(V==="shipping")H=F.createShippingAddressElement(X);else if(V==="billing")H=F.createBillingAddressElement(X);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":H=F.createExpressCheckoutElement(g);break;case"currencySelector":H=F.createCurrencySelectorElement();break;default:throw new Error("Invalid Element type ".concat(r,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else L&&(H=L.create(t,g));K.current=H,$(H),H&&H.mount(G.current)}},[L,F,g]);var I=fg(g);return ve.useEffect(function(){if(K.current){var H=_J(g,I,["paymentRequest"]);H&&"update"in K.current&&K.current.update(H)}},[g,I]),ve.useLayoutEffect(function(){return function(){if(K.current&&typeof K.current.destroy=="function")try{K.current.destroy(),K.current=null}catch{}}},[]),ve.createElement("div",{id:d,className:h,ref:G})},s=function(u){NE("mounts <".concat(r,">"));var d=u.id,h=u.className;return ve.createElement("div",{id:d,className:h})},o=n?s:a;return o.propTypes={id:bn.string,className:bn.string,onChange:bn.func,onBlur:bn.func,onFocus:bn.func,onReady:bn.func,onEscape:bn.func,onClick:bn.func,onLoadError:bn.func,onLoaderStart:bn.func,onNetworksChange:bn.func,onConfirm:bn.func,onCancel:bn.func,onShippingAddressChange:bn.func,onShippingRateChange:bn.func,options:bn.object},o.displayName=r,o.__elementType=t,o},zn=typeof window>"u",qP=ve.createContext(null);qP.displayName="EmbeddedCheckoutProviderContext";var TJ=function(){var t=ve.useContext(qP);if(!t)throw new Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");return t},LLe="Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",FLe=function(t){var n=t.stripe,r=t.options,a=t.children,s=ve.useMemo(function(){return SJ(n,LLe)},[n]),o=ve.useRef(null),l=ve.useRef(null),u=ve.useState({embeddedCheckout:null}),d=UP(u,2),h=d[0],p=d[1];ve.useEffect(function(){if(!(l.current||o.current)){var y=function(j){l.current||o.current||(l.current=j,o.current=l.current.initEmbeddedCheckout(r).then(function(N){p({embeddedCheckout:N})}))};s.tag==="async"&&!l.current&&(r.clientSecret||r.fetchClientSecret)?s.stripePromise.then(function(w){w&&y(w)}):s.tag==="sync"&&!l.current&&(r.clientSecret||r.fetchClientSecret)&&y(s.stripe)}},[s,r,h,l]),ve.useEffect(function(){return function(){h.embeddedCheckout?(o.current=null,h.embeddedCheckout.destroy()):o.current&&o.current.then(function(){o.current=null,h.embeddedCheckout&&h.embeddedCheckout.destroy()})}},[h.embeddedCheckout]),ve.useEffect(function(){CJ(l)},[l]);var g=fg(n);ve.useEffect(function(){g!==null&&g!==n&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.")},[g,n]);var x=fg(r);return ve.useEffect(function(){if(x!=null){if(r==null){console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");return}r.clientSecret===void 0&&r.fetchClientSecret===void 0&&console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."),x.clientSecret!=null&&r.clientSecret!==x.clientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),x.fetchClientSecret!=null&&r.fetchClientSecret!==x.fetchClientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),x.onComplete!=null&&r.onComplete!==x.onComplete&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."),x.onShippingDetailsChange!=null&&r.onShippingDetailsChange!==x.onShippingDetailsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."),x.onLineItemsChange!=null&&r.onLineItemsChange!==x.onLineItemsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.")}},[x,r]),ve.createElement(qP.Provider,{value:h},a)},zLe=function(t){var n=t.id,r=t.className,a=TJ(),s=a.embeddedCheckout,o=ve.useRef(!1),l=ve.useRef(null);return ve.useLayoutEffect(function(){return!o.current&&s&&l.current!==null&&(s.mount(l.current),o.current=!0),function(){if(o.current&&s)try{s.unmount(),o.current=!1}catch{}}},[s]),ve.createElement("div",{ref:l,id:n,className:r})},BLe=function(t){var n=t.id,r=t.className;return TJ(),ve.createElement("div",{id:n,className:r})},ULe=zn?BLe:zLe,qLe=function(){var t=NE("calls useStripe()"),n=t.stripe;return n};Zn("auBankAccount",zn);Zn("card",zn);Zn("cardNumber",zn);Zn("cardExpiry",zn);Zn("cardCvc",zn);Zn("fpxBank",zn);Zn("iban",zn);Zn("idealBank",zn);Zn("p24Bank",zn);Zn("epsBank",zn);var HLe=Zn("payment",zn);Zn("expressCheckout",zn);Zn("currencySelector",zn);Zn("paymentRequestButton",zn);Zn("linkAuthentication",zn);Zn("address",zn);Zn("shippingAddress",zn);Zn("paymentMethodMessaging",zn);Zn("affirmMessage",zn);Zn("afterpayClearpayMessage",zn);var PJ="basil",KLe=function(t){return t===3?"v3":t},RJ="https://js.stripe.com",VLe="".concat(RJ,"/").concat(PJ,"/stripe.js"),GLe=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,WLe=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;var YLe=function(t){return GLe.test(t)||WLe.test(t)},XLe=function(){for(var t=document.querySelectorAll('script[src^="'.concat(RJ,'"]')),n=0;n<t.length;n++){var r=t[n];if(YLe(r.src))return r}return null},HF=function(t){var n="",r=document.createElement("script");r.src="".concat(VLe).concat(n);var a=document.head||document.body;if(!a)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return a.appendChild(r),r},QLe=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"7.4.0",startTime:n})},tm=null,E0=null,O0=null,ZLe=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},JLe=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},e8e=function(t){return tm!==null?tm:(tm=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe){n(window.Stripe);return}try{var a=XLe();if(!(a&&t)){if(!a)a=HF(t);else if(a&&O0!==null&&E0!==null){var s;a.removeEventListener("load",O0),a.removeEventListener("error",E0),(s=a.parentNode)===null||s===void 0||s.removeChild(a),a=HF(t)}}O0=JLe(n,r),E0=ZLe(r),a.addEventListener("load",O0),a.addEventListener("error",E0)}catch(o){r(o);return}}),tm.catch(function(n){return tm=null,Promise.reject(n)}))},t8e=function(t,n,r){if(t===null)return null;var a=n[0],s=a.match(/^pk_test/),o=KLe(t.version),l=PJ;s&&o!==l&&console.warn("Stripe.js@".concat(o," was loaded on the page, but @stripe/stripe-js@").concat("7.4.0"," expected Stripe.js@").concat(l,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var u=t.apply(void 0,n);return QLe(u,r),u}
557,nm,MJ=!1,DJ=function(){return nm||(nm=e8e(null).catch(function(t){return nm=null,Promise.reject(t)}),nm)};Promise.resolve().then(function(){return DJ()}).catch(function(e){MJ||console.warn(e)});var n8e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];MJ=!0;var a=Date.now();return DJ().then(function(s){return t8e(s,n,a)})};let q5=null;function $J(){return q5||(q5=n8e("pk_live_51IRxqCBJWl1jKWtm81lDMuVLxXoPw8CUeEZ4IJ1WZGvb2VNgUdDDXzFsUxsL0jYwCIEObsYIkHi3SbeXwmZ94Tmx00dZrtQ8P2")),q5}function r8e({onClose:e,onSuccess:t}){const n=qLe(),r=RLe(),[a,s]=v.useState(null),[o,l]=v.useState(!1),u=xLe(),d=async()=>{if(!(!n||!r)){s(null),l(!0);try{const{error:p,setupIntent:g}=await n.confirmSetup({elements:r,redirect:"if_required"});if(p){s(p.message||"Could not save your card. Please try again.");return}const x=typeof g?.payment_method=="string"?g.payment_method:g?.payment_method?.id;if(!x){s("Could not read the saved card. Please try again.");return}await u.mutateAsync(x),t()}catch(p){s(p instanceof Error?p.message:"Could not update your payment method.")}finally{l(!1)}}},h=o||u.isPending;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"px-6 pt-5 pb-1",children:[i.jsx("div",{className:"text-[12.5px] font-bold text-slate-700 mb-2",children:"New card"}),i.jsx(HLe,{options:{layout:"tabs"}}),a&&i.jsx("div",{className:"mt-3 text-[13px] text-badge-red-text bg-badge-red border border-red-200 rounded-xl px-3.5 py-2.5",children:a}),i.jsxs("div",{className:"flex items-center gap-1.5 text-[11.5px] text-slate-500 mt-3",children:[i.jsx(jg,{className:"w-3.5 h-3.5 text-slate-400"}),"Your card is tokenized by Stripe and set as the default for your subscription."]})]}),i.jsxs("div",{className:`${lc} px-6 pt-4 pb-6`,children:[i.jsx("button",{onClick:e,disabled:h,className:"lg:flex-1 rounded-lg py-3 text-[14.5px] font-bold border border-border bg-white text-slate-700 hover:bg-surface-2 disabled:opacity-60",children:"Cancel"}),i.jsx("button",{onClick:d,disabled:!n||h,className:"lg:flex-1 rounded-lg py-3 text-[14.5px] font-bold bg-brand hover:bg-brand-hover text-white flex items-center justify-center gap-2 disabled:opacity-60",children:h?i.jsxs(i.Fragment,{children:[i.jsx(Dt,{size:"sm",className:"text-white"})," Savingâ¦"]}):"Save card"})]})]})}function a8e({currentCard:e,onClose:t,onSuccess:n}){const[r,a]=v.useState(null),[s,o]=v.useState(null),l=$J();return v.useEffect(()=>{let u=!1;return cLe().then(d=>{u||a(d)}).catch(d=>{u||o(d instanceof Error?d.message:"Failed to start card update")}),()=>{u=!0}},[]),i.jsx("div",{className:Uw,"data-testid":"update-payment-method-sheet",children:i.jsxs("div",{className:`${qw} pb-[env(safe-area-inset-bottom)] lg:pb-0`,children:[i.jsxs("div",{className:"pt-6 px-6 flex items-start gap-3.5",children:[i.jsx("div",{className:"w-11 h-11 rounded-xl bg-brand-soft flex items-center justify-center flex-shrink-0",children:i.jsx(ea,{className:"w-5 h-5 text-brand"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-extrabold text-gray-900",children:"Update payment method"}),i.jsx("p",{className:"text-[13.5px] text-slate-500 mt-1 leading-snug",children:"Card details are entered directly into Stripe â they never touch our servers."})]}),i.jsx("button",{onClick:t,className:"ml-auto min-w-[42px] min-h-[42px] lg:min-w-0 lg:min-h-0 flex items-center justify-center text-slate-400 hover:text-slate-600 p-1","aria-label":"Close",children:i.jsx(Ut,{className:"w-5 h-5"})})]}),e?.last4&&i.jsxs("div",{className:"mx-6 mt-4 flex items-center gap-3 bg-surface-2 border border-border rounded-xl px-3.5 py-3",children:[i.jsx("div",{className:"w-[42px] h-7 rounded-md bg-gradient-to-br from-slate-800 to-slate-500 flex items-center justify-center",children:i.jsx(ea,{className:"w-[19px] h-[19px] text-white"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-[13.5px] font-semibold text-gray-900 capitalize",children:[e.brand||"Card"," ending in ",e.last4]}),e.exp_month&&e.exp_year&&i.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:["Expires ",String(e.exp_month).padStart(2,"0")," / ",e.exp_year]})]}),i.jsx("span",{className:"ml-auto text-[10.5px] font-extrabold tracking-wide text-slate-400 border border-border rounded-full px-2.5 py-1",children:"CURRENT"})]}),s&&i.jsx("div",{className:"mx-6 my-4 text-[13px] text-badge-red-text bg-badge-red border border-red-200 rounded-xl px-3.5 py-2.5",children:s}),!r&&!s&&i.jsxs("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-slate-500",children:[i.jsx(Dt,{size:"sm"})," Loading secure card formâ¦"]}),r&&i.jsx(OJ,{stripe:l,options:{clientSecret:r,appearance:{theme:"stripe"}},children:i.jsx(r8e,{onClose:t,onSuccess:n})}),s&&i.jsx("div",{className:"flex px-6 pb-6",children:i.jsx("button",{onClick:t,className:"flex-1 rounded-lg py-3 text-[14.5px] font-bold border border-border bg-white text-slate-700 hover:bg-surface-2",children:"Close"})})]})})}function s8e(){const[e,t]=v.useState(!1),[n,r]=v.useState(!1),[a,s]=v.useState(!1),[o,l]=v.useState(null),[u,d]=v.useState(null),[h,p]=v.useState(null),[g,x]=v.useState(""),[y,w]=v.useState(!1),j=mn(),{data:N,isLoading:k}=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),S=N;if(k||!N)return i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})});const E=S?.gas?.subscription,O=E?.plan,T=(E?.price?.amount||0)/100,P=E?.price,M=P?.has_active_discount||!1,D=(P?.original_amount||0)/100,A=(P?.total_discount_amount||0)/100,L=P?.discounts?.[0],F=L?.value||0,B=L?.coupon_name||"",U=L?.coupon_id||"",z=E?.trial,$
557=z?.is_trial||!1,K=z?.days_remaining||0,G=z?.trial_end?new Date(z.trial_end*1e3-6e4).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):null,W=E?.status==="succeeded",I=E?.status==="cancel_at_period_end",H=E?.next_cycle_date,V=E?.cancel_date,X=E?.period==="year"?"year":"month",te=E?.payment_method,fe=fLe(E?.status,$),ae=_o(O??""),ke=_e=>{d(_e),x(""),l("confirm")},xe=_e=>{p(_e),l("success")},ue=_e=>{x(_e),l("error")},we=[{icon:ea,name:"Bank Accounts Connections",title:"Connections",requests:`${S?.gas?.user?.credits?.accounts||0}`,estimatedCost:"Included",color:"text-purple-600",bgColor:"bg-purple-100"},{icon:ea,name:"Google Spreadsheet⢠Integration",title:"",requests:"",estimatedCost:"Included",color:"text-purple-600",bgColor:"bg-purple-100"}],Oe=async()=>{try{r(!0),await sLe(),await j.invalidateQueries({queryKey:["user"]}),t(!1)}catch(_e){alert(_e instanceof Error?_e.message:"Failed to cancel subscription. Please try again.")}finally{r(!1)}},ne=async()=>{try{s(!0),await iLe(),await j.invalidateQueries({queryKey:["user"]})}catch(_e){alert(_e instanceof Error?_e.message:"Failed to activate subscription. Please try again.")}finally{s(!1)}};return i.jsxs("div",{className:"max-w-6xl mx-auto px-0 py-0 lg:px-4 lg:py-8",children:[i.jsx("h1",{className:"text-[22px] lg:text-3xl font-bold text-gray-900 mb-4 lg:mb-8",children:"Billing"}),i.jsxs($b,{className:"mb-4 lg:mb-8 p-4 lg:p-8",children:[i.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row lg:justify-between items-start mb-6",children:[i.jsx("div",{children:i.jsxs("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:[(O??"").charAt(0).toUpperCase()+(O??"").slice(1)," plan"]})}),i.jsxs("div",{className:"text-left lg:text-right",children:[M&&i.jsx("div",{className:"flex items-center justify-start lg:justify-end gap-3 mb-2",children:i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-gradient-to-r from-orange-500 to-orange-600 text-white text-sm font-bold",children:[i.jsx(Cy,{className:"h-4 w-4"}),B," - ",F,"% OFF"]})}),M&&D>0&&i.jsxs("p",{className:"text-xl text-gray-500 line-through mb-1",children:["$",D.toFixed(2)," / ",E?.period]}),i.jsxs("p",{className:`text-[30px] lg:text-4xl font-bold ${M?"text-green-600":"text-gray-900"}`,children:["$",T.toFixed(2)," / ",E?.period]}),M&&A>0&&i.jsxs("p",{className:"text-sm text-green-600 font-semibold mt-1",children:["You save $",A.toFixed(2)," / ",E?.period]})]})]}),M&&L&&i.jsx("div",{className:"mb-6 p-4 rounded-lg border-2 border-orange-200 bg-orange-50",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"p-2 bg-gradient-to-r from-orange-500 to-orange-600 rounded-lg",children:i.jsx(Cy,{className:"h-5 w-5 text-white"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-1",children:B||"Special Discount"}),i.jsxs("p",{className:"text-sm text-gray-700 mb-2",children:[F,"% discount applied with coupon code: ",i.jsx("span",{className:"font-mono font-semibold",children:U})]}),i.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-gray-600",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-semibold",children:"Discount:"})," $",A.toFixed(2)," / ",E?.period]}),L.duration&&i.jsxs("div",{children:[i.jsx("span",{className:"font-semibold",children:"Duration:"})," ",L.duration==="once"?"First payment only":L.duration==="forever"?"Forever":`${L.duration_in_months} months`]})]})]})]})}),i.jsxs("div",{className:"mb-8",children:[!I&&(W||$)&&i.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3 p-3 lg:p-4 rounded-lg border border-green-200 bg-green-50",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("p",{className:"text-sm text-gray-700",children:[i.jsx("span",{className:"font-semibold",children:"Status:"})," ",$?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-blue-600 font-semibold",children:"Trial"}),K>0&&i.jsxs("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded-full font-medium",children:[K," ",K===1?"day":"days"," remaining"]})]}):"Active"]}),$&&G?i.jsxs("p",{className:"text-sm text-gray-700",children:[i.jsx("span",{className:"font-semibold",children:"Trial ends:"})," ",G]}):i.jsxs("p",{className:"text-sm text-gray-700",children:[i.jsx("span",{className:"font-semibold",children:"Subscription Renew date:"})," ",H?Km(H):"N/A"]})]}),i.jsx("div",{children:i.jsx(mt,{color:"gray",onClick:()=>t(!0),className:"w-full lg:w-auto min-h-[42px] lg:min-h-0 bg-red-50 hover:bg-red-100 border border-red-200 text-red-700",children:"Cancel Subscription"})})]}),I&&i.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3 p-3 lg:p-4 roun
557ded-lg border border-yellow-200 bg-yellow-50",children:[i.jsx("div",{className:"space-y-1",children:i.jsxs("p",{className:"text-sm text-gray-700",children:[i.jsx("span",{className:"font-semibold",children:"To Be Canceled At:"})," ",V?Km(V):"End of period"]})}),i.jsx("div",{children:i.jsx(mt,{color:"gray",onClick:ne,className:"w-full lg:w-auto min-h-[42px] lg:min-h-0 bg-green-600 hover:bg-green-700 text-white border-green-600",disabled:a,children:a?i.jsxs(i.Fragment,{children:[i.jsx(Dt,{size:"sm",className:"mr-2 text-white"}),"Activating..."]}):"Activate Subscription"})})]})]}),i.jsxs("div",{className:"mb-8",children:[i.jsx("div",{className:"flex justify-between items-center mb-6",children:i.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:"Usage"})}),i.jsxs("div",{className:"space-y-4",children:[we.map((_e,ye)=>i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 py-3 last:border-b-0",children:[i.jsxs("div",{className:"flex items-center gap-3 lg:gap-4 min-w-0",children:[i.jsx("div",{className:`p-2 rounded-lg flex-shrink-0 ${_e.bgColor}`,children:i.jsx(_e.icon,{className:`h-5 w-5 ${_e.color}`})}),i.jsx("span",{className:"font-medium text-gray-900 text-[13.5px] lg:text-base",children:_e.name})]}),i.jsxs("div",{className:"ml-auto flex flex-col-reverse items-end lg:flex-row lg:items-center lg:gap-8",children:[i.jsx("div",{className:"text-right",children:i.jsxs("p",{className:"text-sm text-gray-500",children:[_e.requests," ",_e.title]})}),i.jsx("div",{className:"text-right min-w-[80px]",children:i.jsx("p",{className:"font-semibold text-gray-900",children:_e.estimatedCost})})]})]},ye)),i.jsx("div",{className:"flex justify-end pt-4 border-t border-gray-200",children:i.jsxs("div",{className:"text-right",children:[i.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Total:"}),M&&D>0&&i.jsxs("p",{className:"text-lg text-gray-500 line-through mb-1",children:["$",D.toFixed(2)," / ",E?.period]}),i.jsxs("p",{className:`text-xl font-bold ${M?"text-green-600":"text-gray-900"}`,children:["$",T.toFixed(2)," / ",E?.period]}),M&&A>0&&i.jsxs("p",{className:"text-sm text-green-600 font-semibold mt-1",children:["Total savings: $",A.toFixed(2)," / ",E?.period]})]})})]})]})]}),fe&&i.jsx($b,{className:"mb-4 lg:mb-8 p-4 lg:p-8",children:i.jsx(pLe,{currentPlan:O,currentPeriod:X,onSelect:ke})}),i.jsx($b,{className:"mb-4 lg:mb-8 cursor-pointer",onClick:()=>l("payment"),children:i.jsxs("div",{className:"flex items-center justify-between gap-3 lg:gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3 lg:gap-3.5 min-w-0",children:[i.jsx("div",{className:"w-11 h-8 rounded-md bg-gradient-to-br from-slate-800 to-slate-500 flex items-center justify-center flex-shrink-0",children:i.jsx(ea,{className:"w-5 h-5 text-white"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-[14.5px] font-semibold text-gray-900 capitalize",children:te?.last4?`${te.brand||"Card"} ending in ${te.last4}`:"No card on file"}),te?.exp_month&&te?.exp_year&&i.jsxs("div",{className:"text-[12.5px] text-slate-500 mt-0.5",children:["Expires ",String(te.exp_month).padStart(2,"0")," / ",te.exp_year]})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 text-[13.5px] font-bold text-brand flex-shrink-0 min-h-[42px] lg:min-h-0",children:[i.jsxs("span",{children:["Update",i.jsx("span",{className:"sr-only lg:not-sr-only",children:" payment method"})]}),i.jsx(va,{className:"w-4 h-4","aria-hidden":"true"})]})]})}),o==="confirm"&&u&&i.jsx(bLe,{selection:u,currentPlanTitle:ae,currentAmount:T,currentPeriod:X,cardLast4:te?.last4,isTrial:$,onClose:()=>l(null),onSuccess:xe,onError:ue}),o==="success"&&h&&i.jsx(vLe,{result:h,onClose:()=>l(null)}),o==="error"&&i.jsx(wLe,{message:g||"Your card was declined, so the change was not applied.",currentPlanTitle:ae,onRetry:()=>l("confirm"),onUpdatePayment:()=>{w(!0),l("payment")},onClose:()=>l(null)}),o==="payment"&&i.jsx(a8e,{currentCard:te,onClose:()=>{w(!1),l(null)},onSuccess:()=>{y&&u?(console.info("[BillingPage] Card updated from plan-change error; resuming confirm for plan",u.priceId),w(!1),x(""),l("confirm")):l(null)}}),e&&i.jsx("div",{className:"fixed inset-0 bg-gray-900/50 backdrop-blur-sm flex items-end lg:items-center justify-center z-50","data-testid":"cancel-subscription-dialog",children:i.jsxs($b,{className:"max-w-none lg:max-w-md w-full mx-0 lg:mx-4 rounded-b-none rounded-t-2xl lg:rou
557nded-lg pb-[env(safe-area-inset-bottom)] lg:pb-0",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"p-2 bg-red-100 rounded-lg",children:i.jsx(Jt,{className:"h-6 w-6 text-red-600"})}),i.jsx("div",{children:i.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Cancel Subscription"})})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("p",{className:"text-gray-700 mb-4",children:"Are you sure you want to cancel your subscription? You'll lose access to:"}),i.jsxs("ul",{className:"space-y-2 text-sm text-gray-600",children:[i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(Ut,{className:"h-4 w-4 text-red-500"}),"Documents Analysis"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(Ut,{className:"h-4 w-4 text-red-500"}),"Documents Backup"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(Ut,{className:"h-4 w-4 text-red-500"}),"Bank account connections"]}),i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx(Ut,{className:"h-4 w-4 text-red-500"}),"Transaction matching"]})]})]}),i.jsxs("div",{className:"flex flex-col-reverse gap-2.5 lg:flex-row lg:gap-3",children:[i.jsx(mt,{color:"gray",onClick:()=>t(!1),className:"w-full min-h-[42px] lg:w-auto lg:min-h-0 lg:flex-1",disabled:n,children:"Close"}),i.jsx(mt,{color:"failure",onClick:Oe,className:"w-full min-h-[42px] lg:w-auto lg:min-h-0 lg:flex-1 bg-gray-600 hover:bg-gray-700 text-white border-gray-600",disabled:n,children:n?i.jsxs(i.Fragment,{children:[i.jsx(Dt,{size:"sm",className:"mr-2 text-white"}),"Canceling..."]}):"Cancel Subscription"})]})]})})]})}class i8e extends v.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}handleRetry=()=>{this.setState({hasError:!1,error:null}),window.location.reload()};render(){return this.state.hasError?i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 p-4",children:i.jsxs("div",{className:"max-w-md w-full text-center",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:i.jsx(Qt,{className:"h-12 w-12 text-red-500"})}),i.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Oops! Something went wrong"}),i.jsx("p",{className:"text-gray-600 mb-6",children:this.state.error?.message||"An unexpected error occurred"}),i.jsxs("div",{className:"space-x-4",children:[i.jsx(mt,{gradientDuoTone:"purpleToBlue",onClick:this.handleRetry,children:"Try Again"}),i.jsx(mt,{color:"gray",onClick:()=>window.location.href="/",children:"Go Home"})]})]})}):this.props.children}}const KF=3,o8e=e=>new Promise(t=>setTimeout(t,e)),l8e=()=>{const e=v.useRef(!1),t=v.useRef(!1),[n,r]=v.useState(null),[a,s]=v.useState(!1),{user:o,isAuthenticated:l,isLoading:u,getAccessTokenSilently:d,logout:h}=ns(),{setUser:p}=$n(),g=mn(),x=v.useCallback(()=>{r(null),sxe(),p(null),g.clear(),g.resetQueries()},[p,g]),y=v.useCallback(async()=>{x(),await h({logoutParams:{returnTo:Ig()}})},[x,h]),w=v.useCallback(async()=>{for(let N=1;N<=KF;N++)try{const k=await Oa();return p(k.user),s(!1),t.current=!0,!1}catch(k){if(exe(k))return!0;if(k?.code===rV)return!1;if(N===KF)return s(!0),!1;const S=rxe(k,N);if(S===null)return console.warn(`[useAuth] profile load refused for longer than the retry ceiling after attempt ${N}; surfacing the error instead of retrying`),s(!0),!1;await o8e(S)}return!1},[p]),j=v.useCallback(async()=>{await w()&&await y()},[w,y]);return v.useEffect(()=>{(async()=>{if(!(e.current||u)){e.current=!0;try{if(x(),!l||!o)return;let k;try{k=await d({authorizationParams:{audience:"https://www.moneylogs.com/website"}})}catch{await y();return}axe(k),r(k),bi.identify(o?.email,{email:o?.email,name:o?.name}),await w()&&await y()}finally{e.current=!1}}})()},[l,o,d,u,y,x,w]),{isAuthenticated:l,isLoading:u,isInitialized:t.current,token:n,profileError:a,reloadProfile:j}};function IJ(){const{data:e,isLoading:t}=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:3e4}),n=!!e?.gas?.subscription;return{isLoading:t,hasSubscription:n}}const c8e=()=>({createStripeSession:async()=>await aLe()}),u8e=()=>{const{createStripeSession:e}=c8e(),t=$J(),r={fetchClientSecret:v.useCallback(async()=>(await e()).client_secret,[])};return i.jsx("div",{id:"checkout",children:i.jsx(FLe,{stripe:t,options:r,children:i.jsx(ULe,{})})})};function or(e,t){t===void 0&&(t={});var n=t.insertAt;if(e&&typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n==="top"&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}or(`.react-loading-indicator-normalize, 558[class$=rli-bounding-box] { 559 font-size: 1rem; 560 display: inline-block; 561 box-sizing: border-box; 562 text-align: unset; 563 isolation: isolate; 564} 565 566.rli-d-i-b { 567 display: inline-block; 568} 569 570.rli-text-format { 571 white-space: nowrap; 572 overflow: hidden; 573 text-overflow: ellipsis; 574 font-weight: 600; 575 width: 90%; 576 text-transform: uppercase; 577 text-align: center; 578 font-size: 0.7em; 579 letter-spacing: 0.5px; 580 font-family: system-ui, -apple-system, BlinkMacSystemFont, "Avenir Next", "Avenir", "Segoe UI", "Lucida Grande", "Helvetica Neue", "Helvetica", "Fira Sans", "Roboto", "Noto", "Droid Sans", "Cantarell", "Oxygen", "Ubuntu", "Franklin Gothic Medium", "Century Gothic", "Liberation Sans", sans-serif; 581}`);var Gs=function(){return Gs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Gs.apply(this,arguments)};function zv(e){return zv=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},zv(e)}var d8e=/^\s+/,f8e=/\s+$/;function Ve(e,t){if(t=t||{},(e=e||"")instanceof Ve)return e;if(!(this instanceof Ve))return new Ve(e,t);var n=function(r){var a={r:0,g:0,b:0},s=1,o=null,l=null,u=null,d=!1,h=!1;typeof r=="string"&&(r=function(y){y=y.replace(d8e,"").replace(f8e,"").toLowerCase();var w,j=!1;if(_E[y])y=_E[y],j=!0;else if(y=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(w=Hs.rgb.exec(y))?{r:w[1],g:w[2],b:w[3]}:(w=Hs.rgba.exec(y))?{r:w[1],g:w[2],b:w[3],a:w[4]}:(w=Hs.hsl.exec(y))?{h:w[1],s:w[2],l:w[3]}:(w=Hs.hsla.exec(y))?{h:w[1],s:w[2],l:w[3],a:w[4]}:(w=Hs.hsv.exec(y))?{h:w[1],s:w[2],v:w[3]}:(w=Hs.hsva.exec(y))?{h:w[1],s:w[2],v:w[3],a:w[4]}:(w=Hs.hex8.exec(y))?{r:Fa(w[1]),g:Fa(w[2]),b:Fa(w[3]),a:QF(w[4]),format:j?"name":"hex8"}:(w=Hs.hex6.exec(y))?{r:Fa(w[1]),g:Fa(w[2]),b:Fa(w[3]),format:j?"name":"hex"}:(w=Hs.hex4.exec(y))?{r:Fa(w[1]+""+w[1]),g:Fa(w[2]+""+w[2]),b:Fa(w[3]+""+w[3]),a:QF(w[4]+""+w[4]),format:j?"name":"hex8"}:(w=Hs.hex3.exec(y))?{r:Fa(w[1]+""+w[1]),g:Fa(w[2]+""+w[2]),b:Fa(w[3]+""+w[3]),format:j?"name":"hex"}:!1}(r)),zv(r)=="object"&&(lo(r.r)&&lo(r.g)&&lo(r.b)?(p=r.r,g=r.g,x=r.b,a={r:255*dn(p,255),g:255*dn(g,255),b:255*dn(x,255)},d=!0,h=String(r.r).substr(-1)==="%"?"prgb":"rgb"):lo(r.h)&&lo(r.s)&&lo(r.v)?(o=bm(r.s),l=bm(r.v),a=function(y,w,j){y=6*dn(y,360),w=dn(w,100),j=dn(j,100);var N=Math.floor(y),k=y-N,S=j*(1-w),E=j*(1-k*w),O=j*(1-(1-k)*w),T=N%6,P=[j,E,S,S,O,j][T],M=[O,j,j,E,S,S][T],D=[S,S,O,j,j,E][T];return{r:255*P,g:255*M,b:255*D}}(r.h,o,l),d=!0,h="hsv"):lo(r.h)&&lo(r.s)&&lo(r.l)&&(o=bm(r.s),u=bm(r.l),a=function(y,w,j){var N,k,S;function E(P,M,D){return D<0&&(D+=1),D>1&&(D-=1),D<1/6?P+6*(M-P)*D:D<.5?M:D<2/3?P+(M-P)*(2/3-D)*6:P}if(y=dn(y,360),w=dn(w,100),j=dn(j,100),w===0)N=k=S=j;else{var O=j<.5?j*(1+w):j+w-j*w,T=2*j-O;N=E(T,O,y+1/3),k=E(T,O,y),S=E(T,O,y-1/3)}return{r:255*N,g:255*k,b:255*S}}(r.h,o,u),d=!0,h="hsl"),r.hasOwnProperty("a")&&(s=r.a));var p,g,x;return s=LJ(s),{ok:d,format:r.format||h,r:Math.min(255,Math.max(a.r,0)),g:Math.min(255,Math.max(a.g,0)),b:Math.min(255,Math.max(a.b,0)),a:s}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}
vendor: 9,854 bytes, line 581
581function VF(e,t,n){e=dn(e,255),t=dn(t,255),n=dn(n,255);var r,a,s=Math.max(e,t,n),o=Math.min(e,t,n),l=(s+o)/2;if(s==o)r=a=0;else{var u=s-o;switch(a=l>.5?u/(2-s-o):u/(s+o),s){case e:r=(t-n)/u+(t<n?6:0);break;case t:r=(n-e)/u+2;break;case n:r=(e-t)/u+4}r/=6}return{h:r,s:a,l}}function GF(e,t,n){e=dn(e,255),t=dn(t,255),n=dn(n,255);var r,a,s=Math.max(e,t,n),o=Math.min(e,t,n),l=s,u=s-o;if(a=s===0?0:u/s,s==o)r=0;else{switch(s){case e:r=(t-n)/u+(t<n?6:0);break;case t:r=(n-e)/u+2;break;case n:r=(e-t)/u+4}r/=6}return{h:r,s:a,v:l}}function WF(e,t,n,r){var a=[Xs(Math.round(e).toString(16)),Xs(Math.round(t).toString(16)),Xs(Math.round(n).toString(16))];return r&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function YF(e,t,n,r){return[Xs(FJ(r)),Xs(Math.round(e).toString(16)),Xs(Math.round(t).toString(16)),Xs(Math.round(n).toString(16))].join("")}function h8e(e,t){t=t===0?0:t||10;var n=Ve(e).toHsl();return n.s-=t/100,n.s=Kw(n.s),Ve(n)}function p8e(e,t){t=t===0?0:t||10;var n=Ve(e).toHsl();return n.s+=t/100,n.s=Kw(n.s),Ve(n)}function m8e(e){return Ve(e).desaturate(100)}function g8e(e,t){t=t===0?0:t||10;var n=Ve(e).toHsl();return n.l+=t/100,n.l=Kw(n.l),Ve(n)}function x8e(e,t){t=t===0?0:t||10;var n=Ve(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),Ve(n)}function b8e(e,t){t=t===0?0:t||10;var n=Ve(e).toHsl();return n.l-=t/100,n.l=Kw(n.l),Ve(n)}function y8e(e,t){var n=Ve(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,Ve(n)}function v8e(e){var t=Ve(e).toHsl();return t.h=(t.h+180)%360,Ve(t)}function XF(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Ve(e).toHsl(),r=[Ve(e)],a=360/t,s=1;s<t;s++)r.push(Ve({h:(n.h+s*a)%360,s:n.s,l:n.l}));return r}function w8e(e){var t=Ve(e).toHsl(),n=t.h;return[Ve(e),Ve({h:(n+72)%360,s:t.s,l:t.l}),Ve({h:(n+216)%360,s:t.s,l:t.l})]}function j8e(e,t,n){t=t||6,n=n||30;var r=Ve(e).toHsl(),a=360/n,s=[Ve(e)];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,s.push(Ve(r));return s}function N8e(e,t){t=t||6;for(var n=Ve(e).toHsv(),r=n.h,a=n.s,s=n.v,o=[],l=1/t;t--;)o.push(Ve({h:r,s:a,v:s})),s=(s+l)%1;return o}Ve.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=LJ(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=GF(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=GF(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return this._a==1?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=VF(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=VF(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return this._a==1?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return WF(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(t,n,r,a,s){var o=[Xs(Math.round(t).toString(16)),Xs(Math.round(n).toString(16)),Xs(Math.round(r).toString(16)),Xs(FJ(a))];return s&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*dn(this._r,255))+"%",g:Math.round(100*dn(this._g,255))+"%",b:Math.round(100*dn(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(100*dn(this._r,255))+"%, "+Math.round(100*dn(this._g,255))+"%, "+Math.round(100*dn(this._b,255))+"%)":"rgba("+Math.round(100*dn(this._r,255))+"%, "+Math.round(100*dn(this._g,255))+"%, "+Math.round(100*dn(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(_8e[WF(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+YF(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var a=Ve(e);n="#"+YF(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||e!=="hex"&&e!=="hex6"&&e!=="hex3"&&e!=="hex4"&&e!=="hex8"&&e!=="name"?(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),e!=="hex"&&e!=="hex6"||(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString()):e==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return Ve(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(g8e,arguments)},brighten:function(){return this._applyModification(x8e,arguments)},darken:function(){return this._applyModification(b8e,arguments)},desaturate:function(){return this._applyModification(h8e,arguments)},saturate:function(){return this._applyModification(p8e,arguments)},greyscale:function(){return this._applyModification(m8e,arguments)},spin:function(){return this._applyModification(y8e,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(j8e,arguments)},complement:function(){return this._applyCombination(v8e,arguments)},monochromatic:function(){return this._applyCombination(N8e,arguments)},splitcomplement:function(){return this._applyCombination(w8e,arguments)},triad:function(){return this._applyCombination(XF,[3])},tetrad:function(){return this._applyCombination(XF,[4])}},Ve.fromRatio=function(e,t){if(zv(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=r==="a"?e[r]:bm(e[r]));e=n}return Ve(e,t)},Ve.equals=function(e,t){return!(!e||!t)&&Ve(e).toRgbString()==Ve(t).toRgbString()},Ve.random=function(){return Ve.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ve.mix=function(e,t,n){n=n===0?0:n||50;var r=Ve(e).toRgb(),a=Ve(t).toRgb(),s=n/100;return Ve({r:(a.r-r.r)*s+r.r,g:(a.g-r.g)*s+r.g,b:(a.b-r.b)*s+r.b,a:(a.a-r.a)*s+r.a})},Ve.readability=function(e,t){var n=Ve(e),r=Ve(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Ve.isReadable=function(e,t,n){var r,a,s=Ve.readability(e,t);switch(a=!1,(r=function(o){var l,u;return l=((o=o||{level:"AA",size:"small"}).level||"AA").toUpperCase(),u=(o.size||"small").toLowerCase(),l!=="AA"&&l!=="AAA"&&(l="AA"),u!=="small"&&u!=="large"&&(u="small"),{level:l,size:u}}(n)).level+r.size){case"AAsmall":case"AAAlarge":a=s>=4.5;break;case"AAlarge":a=s>=3;break;case"AAAsmall":a=s>=7}return a},Ve.mostReadable=function(e,t,n){var r,a,s,o,l=null,u=0;a=(n=n||{}).includeFallbackColors,s=n.level,o=n.size;for(var d=0;d<t.length;d++)(r=Ve.readability(e,t[d]))>u&&(u=r,l=Ve(t[d]));return Ve.isReadable(e,l,{level:s,size:o})||!a?l:(n.includeFallbackColors=!1,Ve.mostReadable(e,["#fff","#000"],n))};var _E=Ve.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
5810",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_8e=Ve.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(_E);function LJ(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function dn(e,t){(function(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1})(e)&&(e="100%");var n=function(r){return typeof r=="string"&&r.indexOf("%")!=-1}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Kw(e){return Math.min(1,Math.max(0,e))}function Fa(e){return parseInt(e,16)}function Xs(e){return e.length==1?"0"+e:""+e}function bm(e){return e<=1&&(e=100*e+"%"),e}function FJ(e){return Math.round(255*parseFloat(e)).toString(16)}function QF(e){return Fa(e)/255}var El,A0,T0,Hs=(A0="[\\s|\\(]+("+(El="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+El+")[,|\\s]+("+El+")\\s*\\)?",T0="[\\s|\\(]+("+El+")[,|\\s]+("+El+")[,|\\s]+("+El+")[,|\\s]+("+El+")\\s*\\)?",{CSS_UNIT:new RegExp(El),rgb:new RegExp("rgb"+A0),rgba:new RegExp("rgba"+T0),hsl:new RegExp("hsl"+A0),hsla:new RegExp("hsla"+T0),hsv:new RegExp("hsv"+A0),hsva:new RegExp("hsva"
581+T0),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function lo(e){return!!Hs.CSS_UNIT.exec(e)}var k8e=function(e,t){var n=(typeof e=="string"?parseInt(e):e)||0;if(n>=-5&&n<=5){var r=n,a=parseFloat(t),s=a+r*(a/5)*-1;return(s==0||s<=Number.EPSILON)&&(s=.1),{animationPeriod:s+"s"}}return{animationPeriod:t}},S8e=function(e,t){var n=e||{},r="";switch(t){case"small":r="12px";break;case"medium":r="16px";break;case"large":r="20px";break;default:r=void 0}var a={};if(n.fontSize){var s=n.fontSize;a=function(o,l){var u={};for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&l.indexOf(d)<0&&(u[d]=o[d]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(d=Object.getOwnPropertySymbols(o);h<d.length;h++)l.indexOf(d[h])<0&&Object.prototype.propertyIsEnumerable.call(o,d[h])&&(u[d[h]]=o[d[h]])}return u}(n,["fontSize"]),r=s}return{fontSize:r,styles:a}},C8e={color:"currentColor",mixBlendMode:"difference",width:"unset",display:"block",paddingTop:"2px"},E8e=function(e){var t=e.className,n=e.text,r=e.textColor,a=e.staticText,s=e.style;return n?ve.createElement("span",{className:"rli-d-i-b rli-text-format ".concat(t||"").trim(),style:Gs(Gs(Gs({},a&&C8e),r&&{color:r,mixBlendMode:"unset"}),s&&s)},typeof n=="string"&&n.length?n:"loading"):null},zJ="rgb(50, 205, 50)";function O8e(e,t){if(t===void 0&&(t=0),e.length===0)throw new Error("Input array cannot be empty!");var n=[];return function r(a,s){return s===void 0&&(s=0),n.push.apply(n,a),n.length<s&&r(n,s),n.slice(0,s)}(e,t)}or(`.atom-rli-bounding-box { 582 --atom-phase1-rgb: 50, 205, 50; 583 color: rgba(var(--atom-phase1-rgb), 1); 584 font-size: 16px; 585 position: relative; 586 text-align: unset; 587 isolation: isolate; 588} 589.atom-rli-bounding-box .atom-indicator { 590 width: 6em; 591 height: 6em; 592 position: relative; 593 perspective: 6em; 594 overflow: hidden; 595 color: rgba(var(--atom-phase1-rgb), 1); 596 animation: calc(var(--rli-animation-duration, 1s) * 4) var(--rli-animation-function, linear) infinite uxlv7gg; 597} 598.atom-rli-bounding-box .atom-indicator::after, .atom-rli-bounding-box .atom-indicator::before { 599 content: ""; 600 position: absolute; 601 top: 0; 602 right: 0; 603 bottom: 0; 604 left: 0; 605 width: 0.48em; 606 height: 0.48em; 607 margin: auto; 608 border-radius: 50%; 609 background-image: radial-gradient(circle at 35% 15%, rgba(var(--atom-phase1-rgb), 0.1), rgba(var(--atom-phase1-rgb), 0.3) 37%, rgba(var(--atom-phase1-rgb), 1) 100%); 610 animation: calc(var(--rli-animation-duration, 1s) * 4) var(--rli-animation-function, linear) infinite uxlv7eg; 611} 612.atom-rli-bounding-box .atom-indicator::before { 613 filter: drop-shadow(0px 0px 0.0625em currentColor); 614} 615.atom-rli-bounding-box .atom-indicator .electron-orbit { 616 color: rgba(var(--atom-phase1-rgb), 0.85); 617 border: 0; 618 border-left: 0.4em solid currentColor; 619 box-sizing: border-box; 620 position: absolute; 621 top: 0; 622 right: 0; 623 bottom: 0; 624 left: 0; 625 margin: auto; 626 width: 4.8em; 627 height: 4.8em; 628 background-color: transparent; 629 border-radius: 50%; 630 transform-style: preserve-3d; 631 animation: var(--rli-animation-duration, 1s) var(--rli-animation-function, linear) infinite uxlv7fj, calc(var(--rli-animation-duration, 1s) * 4) var(--rli-animation-function, linear) infinite uxlv7gy; 632} 633.atom-rli-bounding-box .atom-indicator .electron-orbit::after { 634 content: ""; 635 position: absolute; 636 top: 0; 637 right: 0; 638 bottom: 0; 639 left: 0; 640 border-radius: 50%; 641 color: rgba(var(--atom-phase1-rgb), 0.18); 642 animation: calc(var(--rli-animation-duration, 1s) * 4) var(--rli-animation-function, linear) infinite uxlv7hv; 643 border: 0.125em solid currentColor; 644} 645.atom-rli-bounding-box .atom-indicator .electron-orbit::before { 646 content: ""; 647 width: 0.192em; 648 height: 0.192em; 649 position: absolute; 650 border-radius: 50%; 651 top: -0.096em; 652 right: 0; 653 bottom: 0; 654 left: 0; 655 margin: 0 auto; 656 color: rgba(var(--atom-phase1-rgb), 1); 657 box-shadow: 0px 0px 0.0625em 0.0625em currentColor, 0px 0px 0.0625em 0.125em currentColor; 658 background-color: currentColor; 659 transform: rotateY(-70deg); 660 animation: var(--rli-animation-duration, 1s) var(--rli-animation-function, linear) infinite uxlv7ew, calc(var(--rli-animation-duration, 1s) * 4) var(--rli-animation-function, linear) infinite uxlv7gg; 661} 662.atom-rli-bounding-box .atom-indicator .electron-orbit:nth-of-type(1) { 663 --orbit-vector-factor: -1; 664 transform: rotateY(65deg) rotateX(calc(54deg * var(--orbit-vector-factor))); 665} 666.atom-rli-bounding-box .atom-indicator .electron-orbit:nth-of-type(2) { 667 --orbit-vector-factor: 1; 668 transform: rotateY(65deg) rotateX(calc(54deg * var(--orbit-vector-factor))); 669} 670.atom-rli-bounding-box .atom-indicator .electron-orbit:nth-of-type(3) { 671 --orbit-vector-factor: 0; 672 transform: rotateY(65deg) rotateX(calc(54deg * var(--orbit-vector-factor))); 673 animation-delay: calc(var(--rli-animation-duration, 1s) * 0.5 * -1), calc(var(--rli-animation-duration, 1s) * 4 * -1); 674} 675.atom-rli-bounding-box .atom-indicator .electron-orbit:nth-of-type(3)::before { 676 animation-delay: calc(var(--rli-animation-duration, 1s) * 0.5 * -1), calc(var(--rli-animation-duration, 1s) * 4 * -1); 677} 678.atom-rli-bounding-box .atom-text { 679 color: currentColor; 680 mix-blend-mode: difference; 681 width: unset; 682 display: block; 683} 684 685@property --atom-phase1-rgb { 686 syntax: "<number>#"; 687 inherits: true; 688 initial-value: 50, 205, 50; 689} 690@property --atom-phase2-rgb { 691 syntax: "<number>#"; 692 inherits: true; 693 initial-value: 50, 205, 50; 694} 695@property --atom-phase3-rgb { 696 syntax: "<number>#"; 697 inherits: true; 698 initial-value: 50, 205, 50; 699} 700@property --atom-phase4-rgb { 701 syntax: "<number>#"; 702 inherits: true; 703 initial-value: 50, 205, 50; 704} 705@property --rli-animation-duration { 706 syntax: "<time>"; 707 inherits: true; 708 initial-value: 1s; 709} 710@keyframes uxlv7fj { 711 from { 712 transform: rotateY(70deg) rotateX(calc(54deg * var(--orbit-vector-factor))) rotateZ(0deg); 713 } 714 to { 715 transform: rotateY(70deg) rotateX(calc(54deg * var(--orbit-vector-factor))) rotateZ(360deg); 716 } 717} 718@keyframes uxlv7ew { 719 from { 720 transform: rotateY(-70deg) rotateX(0deg); 721 } 722 to { 723 transform: rotateY(-70deg) rotateX(-360deg); 724 } 725} 726@keyframes uxlv7eg { 727 100%, 0% { 728 background-image: radial-gradient(circle at 35% 15%, rgba(var(--atom-phase1-rgb), 0.1), rgba(var(--atom-phase1-rgb), 0.3) 37%, rgba(var(--atom-phase1-rgb), 1) 100%); 729 } 730 20% { 731 background-image: radial-gradient(circle at 35% 15%, rgba(var(--atom-phase1-rgb), 0.1), rgba(var(--atom-phase1-rgb), 0.3) 37%, rgba(var(--atom-phase1-rgb), 1) 100%); 732 } 733 25% { 734 background-image: radial-gradient(circle at 35% 15%, rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 0.1), rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 0.3) 37%, rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 1) 100%); 735 } 736 45% { 737 background-image: radial-gradient(circle at 35% 15%, rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 0.1), rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 0.3) 37%, rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 1) 100%); 738 } 739 50% { 740 background-image: radial-gradient(circle at 35% 15%, rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 0.1), rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 0.3) 37%, rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 1) 100%); 741 } 742 70% { 743 background-image: radial-gradient(circle at 35% 15%, rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 0.1), rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 0.3) 37%, rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 1) 100%); 744 } 745 75% { 746 background-image: radial-gradient(circle at 35% 15%, rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 0.1), rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 0.3) 37%, rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 1) 100%); 747 } 748 95% { 749 background-image: radial-gradient(circle at 35% 15%, rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 0.1), rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 0.3) 37%, rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 1) 100%); 750 } 751} 752@keyframes uxlv7gg { 753 100%, 0% { 754 color: rgba(var(--atom-phase1-rgb), 1); 755 } 756 20% { 757 color: rgba(var(--atom-phase1-rgb), 1); 758 } 759 25% { 760 color: rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 1); 761 } 762 45% { 763 color: rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 1); 764 } 765 50% { 766 color: rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 1); 767 } 768 70% { 769 color: rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 1); 770 } 771 75% { 772 color: rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 1); 773 } 774 95% { 775 color: rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 1); 776 } 777} 778@keyframes uxlv7gy { 779 100%, 0% { 780 color: rgba(var(--atom-phase1-rgb), 0.85); 781 } 782 20% { 783 color: rgba(var(--atom-phase1-rgb), 0.85); 784 } 785 25% { 786 color: rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 0.85); 787 } 788 45% { 789 color: rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 0.85); 790 } 791 50% { 792 color: rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 0.85); 793 } 794 70% { 795 color: rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 0.85); 796 } 797 75% { 798 color: rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 0.85); 799 } 800 95% { 801 color: rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 0.85); 802 } 803} 804@keyframes uxlv7hv { 805 100%, 0% { 806 color: rgba(var(--atom-phase1-rgb), 0.18); 807 } 808 20% { 809 color: rgba(var(--atom-phase1-rgb), 0.18); 810 } 811 25% { 812 color: rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 0.18); 813 } 814 45% { 815 color: rgba(var(--atom-phase2-rgb, var(--atom-phase1-rgb)), 0.18); 816 } 817 50% { 818 color: rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 0.18); 819 } 820 70% { 821 color: rgba(var(--atom-phase3-rgb, var(--atom-phase1-rgb)), 0.18); 822 } 823 75% { 824 color: rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 0.18); 825 } 826 95% { 827 color: rgba(var(--atom-phase4-rgb, var(--atom-phase1-rgb)), 0.18); 828 } 829}`);Ve(zJ).toRgb();Array.from({length:4},function(e,t){return"--atom-phase".concat(t+1,"-rgb")});or(`.commet-rli-bounding-box { 830 --commet-phase1-color: rgb(50, 205, 50); 831 font-size: 16px; 832 width: 6.85em; 833 height: 6.85em; 834 overflow: hidden; 835 display: inline-block; 836 box-sizing: border-box; 837 position: relative; 838 isolation: isolate; 839} 840.commet-rli-bounding-box .commet-indicator { 841 top: 0; 842 right: 0; 843 bottom: 0; 844 left: 0; 845 margin: auto; 846 box-sizing: border-box; 847 width: 6em; 848 height: 6em; 849 color: var(--commet-phase1-color); 850 display: inline-block; 851 isolation: isolate; 852 position: absolute; 853 z-index: 0; 854 animation: calc(var(--rli-animation-duration, 1.2s) * 4) var(--rli-animation-function, cubic-bezier(0.08, 0.03, 0.91, 0.93)) infinite uxlv7cp; 855} 856.commet-rli-bounding-box .commet-indicator .commet-box { 857 position: absolute; 858 display: inline-block; 859 top: 0; 860 right: 0; 861 bottom: 0; 862 bottom: 0; 863 left: 0; 864 margin: auto; 865 animation: uxlv7bx var(--rli-animation-duration, 1.2s) var(--rli-animation-function, cubic-bezier(0.08, 0.03, 0.91, 0.93)) infinite; 866} 867.commet-rli-bounding-box .commet-indicator .commet-box:nth-of-type(1) { 868 width: 100%; 869 height: 100%; 870 animation-direction: normal; 871} 872.commet-rli-bounding-box .commet-indicator .commet-box:nth-of-type(2) { 873 width: 70%; 874 height: 70%; 875 animation-direction: reverse; 876} 877.commet-rli-bounding-box .commet-indicator .commet-box .commetball-box { 878 position: absolute; 879 top: 0; 880 right: 0; 881 bottom: 0; 882 bottom: 0; 883 left: 0; 884 display: inline-block; 885} 886.commet-rli-bounding-box .commet-indicator .commet-box .commetball-box::before { 887 content: ""; 888 width: 0.5em; 889 height: 0.5em; 890 border-radius: 50%; 891 background-color: currentColor; 892 position: absolute; 893 top: -0.125em; 894 left: 50%; 895 transform: translateX(-50%); 896 box-shadow: 0 0 0.2em 0em currentColor, 0 0 0.6em 0em currentColor; 897}
898.commet-rli-bounding-box .commet-indicator .commet-box .commet-trail { 899 position: absolute; 900 top: 0; 901 right: 0; 902 bottom: 0; 903 bottom: 0; 904 left: 0; 905 border-radius: 50%; 906 box-sizing: border-box; 907 border-style: solid; 908} 909.commet-rli-bounding-box .commet-indicator .commet-box .commet-trail.trail1 { 910 border-color: currentColor transparent transparent currentColor; 911 border-width: 0.25em 0.25em 0 0; 912 transform: rotateZ(-45deg); 913} 914.commet-rli-bounding-box .commet-indicator .commet-box .commet-trail.trail2 { 915 border-color: currentColor currentColor transparent transparent; 916 border-width: 0.25em 0 0 0.25em; 917 transform: rotateZ(45deg); 918} 919.commet-rli-bounding-box .commet-text { 920 mix-blend-mode: difference; 921 position: absolute; 922 top: 50%; 923 left: 50%; 924 transform: translate(-50%, -50%); 925 color: var(--commet-phase1-color); 926} 927 928@property --commet-phase1-color { 929 syntax: "<color>"; 930 inherits: true; 931 initial-value: rgb(50, 205, 50); 932} 933@property --commet-phase2-color { 934 syntax: "<color>"; 935 inherits: true; 936 initial-value: rgb(50, 205, 50); 937} 938@property --commet-phase3-color { 939 syntax: "<color>"; 940 inherits: true; 941 initial-value: rgb(50, 205, 50); 942} 943@property --commet-phase4-color { 944 syntax: "<color>"; 945 inherits: true; 946 initial-value: rgb(50, 205, 50); 947} 948@property --rli-animation-duration { 949 syntax: "<time>"; 950 inherits: true; 951 initial-value: 1.2s; 952} 953@keyframes uxlv7bx { 954 to { 955 transform: rotate(1turn); 956 } 957} 958@keyframes uxlv7cp { 959 100%, 0% { 960 color: var(--commet-phase1-color); 961 } 962 20% { 963 color: var(--commet-phase1-color); 964 } 965 25% { 966 color: var(--commet-phase2-color, var(--commet-phase1-color)); 967 } 968 45% { 969 color: var(--commet-phase2-color, var(--commet-phase1-color)); 970 } 971 50% { 972 color: var(--commet-phase3-color, var(--commet-phase1-color)); 973 } 974 70% { 975 color: var(--commet-phase3-color, var(--commet-phase1-color)); 976 } 977 75% { 978 color: var(--commet-phase4-color, var(--commet-phase1-color)); 979 } 980 95% { 981 color: var(--commet-phase4-color, var(--commet-phase1-color)); 982 } 983}`);Array.from({length:4},function(e,t){return"--commet-phase".concat(t+1,"-color")});or(`.OP-annulus-rli-bounding-box { 984 --OP-annulus-phase1-color: rgb(50, 205, 50); 985 font-size: 16px; 986 display: inline-block; 987} 988.OP-annulus-rli-bounding-box .OP-annulus-indicator { 989 width: 5em; 990 height: 5em; 991 color: var(--OP-annulus-phase1-color); 992 display: inline-block; 993 position: relative; 994 z-index: 0; 995} 996.OP-annulus-rli-bounding-box .OP-annulus-indicator .whirl { 997 animation: uxlv7n7 calc(var(--rli-animation-duration, 1.5s) * 1.33) linear infinite; 998 height: 100%; 999 transform-origin: center center; 1000 width: 100%; 1001 position: absolute; 1002 top: 0; 1003 bottom: 0; 1004 left: 0; 1005 right: 0; 1006 margin: auto; 1007} 1008.OP-annulus-rli-bounding-box .OP-annulus-indicator .path { 1009 stroke-dasharray: 1, 125; 1010 stroke-dashoffset: 0; 1011 animation: var(--rli-animation-duration, 1.5s) var(--rli-animation-function, ease-in-out) infinite uxlv7oa, calc(var(--rli-animation-duration, 1.5s) * 4) var(--rli-animation-function, ease-in-out) infinite uxlv7p5; 1012 stroke-linecap: round; 1013} 1014.OP-annulus-rli-bounding-box .OP-annulus-text { 1015 mix-blend-mode: difference; 1016 position: absolute; 1017 top: 50%; 1018 left: 50%; 1019 transform: translate(-50%, -50%); 1020 z-index: -2; 1021} 1022 1023@property --OP-annulus-phase1-color { 1024 syntax: "<color>"; 1025 inherits: true; 1026 initial-value: rgb(50, 205, 50); 1027} 1028@property --OP-annulus-phase2-color { 1029 syntax: "<color>"; 1030 inherits: true; 1031 initial-value: rgb(50, 205, 50); 1032} 1033@property --OP-annulus-phase3-color { 1034 syntax: "<color>"; 1035 inherits: true; 1036 initial-value: rgb(50, 205, 50); 1037} 1038@property --OP-annulus-phase4-color { 1039 syntax: "<color>"; 1040 inherits: true; 1041 initial-value: rgb(50, 205, 50); 1042} 1043@property --rli-animation-duration { 1044 syntax: "<time>"; 1045 inherits: true; 1046 initial-value: 1.5s; 1047} 1048@keyframes uxlv7n7 { 1049 100% { 1050 transform: rotate(360deg); 1051 } 1052} 1053@keyframes uxlv7oa { 1054 0% { 1055 stroke-dasharray: 1, 125; 1056 stroke-dashoffset: 0; 1057 } 1058 50% { 1059 stroke-dasharray: 98, 125; 1060 stroke-dashoffset: -35px; 1061 } 1062 100% { 1063 stroke-dasharray: 98, 125; 1064 stroke-dashoffset: -124px; 1065 } 1066} 1067@keyframes uxlv7p5 { 1068 100%, 0% { 1069 stroke: var(--OP-annulus-phase1-color); 1070 } 1071 22% { 1072 stroke: var(--OP-annulus-phase1-color); 1073 } 1074 25% { 1075 stroke: var(--OP-annulus-phase2-color, var(--OP-annulus-phase1-color)); 1076 } 1077 42% { 1078 stroke: var(--OP-annulus-phase2-color, var(--OP-annulus-phase1-color)); 1079 } 1080 50% { 1081 stroke: var(--OP-annulus-phase3-color, var(--OP-annulus-phase1-color)); 1082 } 1083 72% { 1084 stroke: var(--OP-annulus-phase3-color, var(--OP-annulus-phase1-color)); 1085 } 1086 75% { 1087 stroke: var(--OP-annulus-phase4-color, var(--OP-annulus-phase1-color)); 1088 } 1089 97% { 1090 stroke: var(--OP-annulus-phase4-color, var(--OP-annulus-phase1-color)); 1091 } 1092}`);Array.from({length:4},function(e,t){return"--OP-annulus-phase".concat(t+1,"-color")});function H5(e){return e&&e.Math===Math&&e}or(`.OP-dotted-rli-bounding-box { 1093 --OP-dotted-phase1-color: rgb(50, 205, 50); 1094 font-size: 16px; 1095 box-sizing: border-box; 1096 display: inline-block; 1097} 1098.OP-dotted-rli-bounding-box .OP-dotted-indicator { 1099 width: 5em; 1100 height: 5em; 1101 color: var(--OP-dotted-phase1-color); 1102 display: inline-block; 1103 position: relative; 1104 z-index: 0; 1105} 1106.OP-dotted-rli-bounding-box .OP-dotted-indicator .OP-dotted-text { 1107 mix-blend-mode: difference; 1108 position: absolute; 1109 top: 50%; 1110 left: 50%; 1111 transform: translate(-50%, -50%); 1112 z-index: -2; 1113} 1114.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder { 1115 position: absolute; 1116 left: 0; 1117 top: 0; 1118 bottom: 0; 1119 right: 0; 1120} 1121.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder .dot {
1122 display: block; 1123 margin: 0 auto; 1124 width: 15%; 1125 height: 15%; 1126 background-color: currentColor; 1127 border-radius: 50%; 1128 animation: var(--rli-animation-duration, 1.2s) var(--rli-animation-function, ease-in-out) infinite uxlv7nu, calc(var(--rli-animation-duration, 1.2s) * 4) var(--rli-animation-function, ease-in-out) infinite uxlv7ol; 1129} 1130.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(1) { 1131 transform: rotate(0deg); 1132} 1133.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(1) .dot { 1134 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 12 * -1); 1135} 1136.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(2) { 1137 transform: rotate(30deg); 1138} 1139.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(2) .dot { 1140 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 11 * -1); 1141} 1142.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(3) { 1143 transform: rotate(60deg); 1144} 1145.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(3) .dot { 1146 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 10 * -1); 1147} 1148.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(4) { 1149 transform: rotate(90deg); 1150} 1151.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(4) .dot { 1152 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 9 * -1); 1153} 1154.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(5) { 1155 transform: rotate(120deg); 1156} 1157.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(5) .dot { 1158 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 8 * -1); 1159} 1160.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(6) { 1161 transform: rotate(150deg); 1162} 1163.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(6) .dot { 1164 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 7 * -1); 1165} 1166.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(7) { 1167 transform: rotate(180deg); 1168} 1169.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(7) .dot { 1170 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 6 * -1); 1171} 1172.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(8) { 1173 transform: rotate(210deg); 1174} 1175.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(8) .dot { 1176 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 5 * -1); 1177} 1178.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(9) { 1179 transform: rotate(240deg); 1180} 1181.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(9) .dot { 1182 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 4 * -1); 1183} 1184.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(10) { 1185 transform: rotate(270deg); 1186} 1187.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(10) .dot { 1188 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 3 * -1); 1189} 1190.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(11) { 1191 transform: rotate(300deg); 1192} 1193.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(11) .dot { 1194 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 2 * -1); 1195} 1196.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(12) { 1197 transform: rotate(330deg); 1198} 1199.OP-dotted-rli-bounding-box .OP-dotted-indicator .dot-shape-holder:nth-of-type(12) .dot { 1200 animation-delay: calc(var(--rli-animation-duration, 1.2s) / 12 * 1 * -1); 1201} 1202 1203@property --OP-dotted-phase1-color { 1204 syntax: "<color>"; 1205 inherits: true; 1206 initial-value: rgb(50, 205, 50); 1207} 1208@property --OP-dotted-phase2-color { 1209 syntax: "<color>"; 1210 inherits: true; 1211 initial-value: rgb(50, 205, 50); 1212} 1213@property --OP-dotted-phase3-color { 1214 syntax: "<color>"; 1215 inherits: true; 1216 initial-value: rgb(50, 205, 50); 1217} 1218@property --OP-dotted-phase4-color { 1219 syntax: "<color>"; 1220 inherits: true; 1221 initial-value: rgb(50, 205, 50); 1222} 1223@property --rli-animation-duration { 1224 syntax: "<time>"; 1225 inherits: true; 1226 initial-value: 1.2s; 1227} 1228@keyframes uxlv7nu { 1229 0%, 39%, 100% { 1230 opacity: 0; 1231 } 1232 40% { 1233 opacity: 1; 1234 } 1235} 1236@keyframes uxlv7ol { 1237 100%, 0% { 1238 background-color: var(--OP-dotted-phase1-color); 1239 } 1240 22% { 1241 background-color: var(--OP-dotted-phase1-color); 1242 } 1243 25% { 1244 background-color: var(--OP-dotted-phase2-color, var(--OP-dotted-phase1-color)); 1245 } 1246 47% { 1247 background-color: var(--OP-dotted-phase2-color, var(--OP-dotted-phase1-color)); 1248 } 1249 50% { 1250 background-color: var(--OP-dotted-phase3-color, var(--OP-dotted-phase1-color)); 1251 } 1252 72% { 1253 background-color: var(--OP-dotted-phase3-color, var(--OP-dotted-phase1-color)); 1254 } 1255 75% { 1256 background-color: var(--OP-dotted-phase4-color, var(--OP-dotted-phase1-color)); 1257 } 1258 97% { 1259 background-color: var(--OP-dotted-phase4-color, var(--OP-dotted-phase1-color)); 1260 } 1261}`);H5(typeof window=="object"&&window)||H5(typeof self=="object"&&self)||H5(typeof global=="object"&&global)||function(){return this}()||Function("return this")();Array.from({length:4},function(e,t){return"--OP-dotted-phase".concat(t+1,"-color")});or(`.OP-spokes-rli-bounding-box { 1262 --OP-spokes-phase1-color: rgb(50, 205, 50); 1263 font-size: 16px; 1264 position: relative; 1265 color: var(--OP-spokes-phase1-color); 1266} 1267.OP-spokes-rli-bounding-box .OP-spokes-indicator { 1268 width: 4.8em; 1269 height: 4.8em; 1270 display: block; 1271 position: relative; 1272} 1273.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke { 1274 position: absolute; 1275 height: 1.2em; 1276 width: 0.4em; 1277 top: 0; 1278 left: 0; 1279 right: 0; 1280 bottom: 0; 1281 margin: auto auto auto 50%; 1282 background-color: var(--OP-spokes-phase1-color); 1283 border-radius: 0.24em; 1284 opacity: 0; 1285 animation: var(--rli-animation-duration, 1.2s) var(--rli-animation-function, ease-in-out) backwards infinite uxlv7pw, calc(var(--rli-animation-duration, 1.2s) * 4) var(--rli-animation-function, ease-in-out) infinite uxlv7qn; 1286 transform-origin: left center; 1287} 1288.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(1) { 1289 transform: rotate(calc(0 * 360deg / 12)) translate(-50%, -1.56em); 1290 animation-delay: calc(11 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1291} 1292.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(2) { 1293 transform: rotate(calc(1 * 360deg / 12)) translate(-50%, -1.56em); 1294 animation-delay: calc(10 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1295} 1296.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(3) { 1297 transform: rotate(calc(2 * 360deg / 12)) translate(-50%, -1.56em); 1298 animation-delay: calc(9 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1299} 1300.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(4) { 1301 transform: rotate(calc(3 * 360deg / 12)) translate(-50%, -1.56em); 1302 animation-delay: calc(8 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1303} 1304.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(5) { 1305 transform: rotate(calc(4 * 360deg / 12)) translate(-50%, -1.56em); 1306 animation-delay: calc(7 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1307} 1308.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(6) { 1309 transform: rotate(calc(5 * 360deg / 12)) translate(-50%, -1.56em); 1310 animation-delay: calc(6 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1311} 1312.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(7) { 1313 transform: rotate(calc(6 * 360deg / 12)) translate(-50%, -1.56em); 1314 animation-delay: calc(5 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1315} 1316.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(8) { 1317 transform: rotate(calc(7 * 360deg / 12)) translate(-50%, -1.56em); 1318 animation-delay: calc(4 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1319} 1320.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(9) { 1321 transform: rotate(calc(8 * 360deg / 12)) translate(-50%, -1.56em); 1322 animation-delay: calc(3 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1323} 1324.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(10) { 1325 transform: rotate(calc(9 * 360deg / 12)) translate(-50%, -1.56em); 1326 animation-delay: calc(2 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1327} 1328.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(11) { 1329 transform: rotate(calc(10 * 360deg / 12)) translate(-50%, -1.56em); 1330 animation-delay: calc(1 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1331} 1332.OP-spokes-rli-bounding-box .OP-spokes-indicator .spoke:nth-of-type(12) { 1333 transform: rotate(calc(11 * 360deg / 12)) translate(-50%, -1.56em); 1334 animation-delay: calc(0 * var(--rli-animation-duration, 1.2s) / 12 * -1); 1335} 1336.OP-spokes-rli-bounding-box .OP-spokes-indicator-text { 1337 mix-blend-mode: difference; 1338 position: absolute; 1339 top: 50%; 1340 left: 50%; 1341 transform: translate(-50%, -50%); 1342 color: var(--OP-spokes-phase1-color); 1343 z-index: -2; 1344} 1345 1346@property --OP-spokes-phase1-color { 1347 syntax: "<color>"; 1348 inherits: true; 1349 initial-value: rgb(50, 205, 50); 1350} 1351@property --OP-spokes-phase2-color { 1352 syntax: "<color>"; 1353 inherits: true; 1354 initial-value: rgb(50, 205, 50); 1355} 1356@property --OP-spokes-phase3-color { 1357 syntax: "<color>"; 1358 inherits: true; 1359 initial-value: rgb(50, 205, 50); 1360} 1361@property --OP-spokes-phase4-color { 1362 syntax: "<color>"; 1363 inherits: true; 1364 initial-value: rgb(50, 205, 50); 1365} 1366@property --rli-animation-duration { 1367 syntax: "<time>"; 1368 inherits: true; 1369 initial-value: 1.2s; 1370} 1371@keyframes uxlv7pw { 1372 from { 1373 opacity: 1; 1374 } 1375 to { 1376 opacity: 0; 1377 } 1378} 1379@keyframes uxlv7qn { 1380 100%, 0% { 1381 background-color: var(--OP-spokes-phase1-color); 1382 } 1383 22% { 1384 background-color: var(--OP-spokes-phase1-color); 1385 } 1386 25% { 1387 background-color: var(--OP-spokes-phase2-color, var(--OP-spokes-phase1-color)); 1388 } 1389 42% { 1390 background-color: var(--OP-spokes-phase2-color, var(--OP-spokes-phase1-color)); 1391 } 1392 50% { 1393 background-color: var(--OP-spokes-phase3-color, var(--OP-spokes-phase1-color)); 1394 } 1395 72% { 1396 background-color: var(--OP-spokes-phase3-color, var(--OP-spokes-phase1-color)); 1397 } 1398 75% { 1399 background-color: var(--OP-spokes-phase4-color, var(--OP-spokes-phase1-color)); 1400 } 1401 97% { 1402 background-color: var(--OP-spokes-phase4-color, var(--OP-spokes-phase1-color)); 1403 } 1404}`);Array.from({length:4},function(e,t){return"--OP-spokes-phase".concat(t+1,"-color")});or(`.OP-annulus-dual-sectors-rli-bounding-box { 1405 --OP-annulus-dual-sectors-phase1-color: rgb(50, 205, 50); 1406 font-size: 16px; 1407 box-sizing: border-box; 1408 display: inline-block; 1409} 1410.OP-annulus-dual-sectors-rli-bounding-box .OP-annulus-dual-sectors-indicator { 1411 width: 5em; 1412 height: 5em; 1413 display: inline-block; 1414 position: relative; 1415 z-index: 0; 1416 color: var(--OP-annulus-dual-sectors-phase1-color); 1417} 1418.OP-annulus-dual-sectors-rli-bounding-box .OP-annulus-dual-sectors-indicator .annulus-sectors { 1419 box-sizing: border-box; 1420 width: 100%; 1421 height: 100%; 1422 border-radius: 50%; 1423 border-width: 0.34em; 1424 border-style: solid; 1425 border-color: var(--OP-annulus-dual-sectors-phase1-color) transparent var(--OP-annulus-dual-sectors-phase1-color) transparent; 1426 background-color: transparent; 1427 animation: var(--rli-animation-duration, 1.2s) var(--rli-animation-function, linear) infinite uxlv7ra, calc(var(--rli-animation-duration, 1.2s) * 4) var(--rli-animation-function, linear) infinite uxlv7sv; 1428} 1429.OP-annulus-dual-sectors-rli-bounding-box .OP-annulus-dual-sectors-indicator .OP-annulus-dual-sectors-text { 1430 mix-blend-mode: difference; 1431 position: absolute; 1432 top: 50%; 1433 left: 50%; 1434 transform: translate(-50%, -50%); 1435 z-index: -2; 1436} 1437 1438@property --OP-annulus-dual-sectors-phase1-color { 1439 syntax: "<color>"; 1440 inherits: true; 1441 initial-value: rgb(50, 205, 50); 1442} 1443@property --OP-annulus-dual-sectors-phase2-color { 1444 syntax: "<color>"; 1445 inherits: true; 1446 initial-value: rgb(50, 205, 50); 1447} 1448@property --OP-annulus-dual-sectors-phase3-color { 1449 syntax: "<color>"; 1450 inherits: true; 1451 initial-value: rgb(50, 205, 50); 1452} 1453@property --OP-annulus-dual-sectors-phase4-color { 1454 syntax: "<color>"; 1455 inherits: true; 1456 initial-value: rgb(50, 205, 50); 1457} 1458@property --rli-animation-duration { 1459 syntax: "<time>"; 1460 inherits: true; 1461 initial-value: 1.2s; 1462} 1463@keyframes uxlv7ra { 1464 0% { 1465 transform: rotate(0deg); 1466 } 1467 100% { 1468 transform: rotate(360deg); 1469 } 1470} 1471@keyframes uxlv7sv { 1472 100%, 0% { 1473 border-color: var(--OP-annulus-dual-sectors-phase1-color) transparent; 1474 } 1475 20% { 1476 border-color: var(--OP-annulus-dual-sectors-phase1-color) transparent; 1477 } 1478 25% { 1479 border-color: var(--OP-annulus-dual-sectors-phase2-color, var(--OP-annulus-dual-sectors-phase1-color)) transparent; 1480 } 1481 45% { 1482 border-color: var(--OP-annulus-dual-sectors-phase2-color, var(--OP-annulus-dual-sectors-phase1-color)) transparent; 1483 } 1484 50% { 1485 border-color: var(--OP-annulus-dual-sectors-phase3-color, var(--OP-annulus-dual-sectors-phase1-color)) transparent; 1486 } 1487 70% { 1488 border-color: var(--OP-annulus-dual-sectors-phase3-color, var(--OP-annulus-dual-sectors-phase1-color)) transparent; 1489 } 1490 75% { 1491 border-color: var(--OP-annulus-dual-sectors-phase4-color, var(--OP-annulus-dual-sectors-phase1-color)) transparent; 1492 } 1493 95% { 1494 border-color: var(--OP-annulus-dual-sectors-phase4-color, var(--OP-annulus-dual-sectors-phase1-color)) transparent; 1495 } 1496}`);Array.from({length:4},function(e,t){return"--OP-annulus-dual-sectors-phase".concat(t+1,"-color")});or(`.OP-annulus-sector-track-rli-bounding-box { 1497 --OP-annulus-track-phase1-color: rgba(50, 205, 50, 0.22); 1498 --OP-annulus-sector-phase1-color: rgb(50, 205, 50); 1499 font-size: 16px; 1500 display: inline-block; 1501} 1502.OP-annulus-sector-track-rli-bounding-box .OP-annulus-sector-track-indicator { 1503 width: 5em; 1504 height: 5em; 1505 color: var(--OP-annulus-sector-phase1-color); 1506 display: inline-block; 1507 position: relative; 1508 z-index: 0; 1509} 1510.OP-annulus-sector-track-rli-bounding-box .OP-annulus-sector-track-indicator .annulus-track-ring { 1511 width: 100%; 1512 height: 100%; 1513 border-width: 0.34em; 1514 border-style: solid; 1515 border-radius: 50%; 1516 box-sizing: border-box; 1517 border-color: var(--OP-annulus-track-phase1-color); 1518 border-top-color: var(--OP-annulus-sector-phase1-color); 1519 animation: var(--rli-animation-duration, 1s) var(--rli-animation-function, linear) infinite uxlv7rl, calc(var(--rli-animation-duration, 1s) * 4) var(--rli-animation-function, linear) infinite uxlv7tf; 1520} 1521.OP-annulus-sector-track-rli-bounding-box .OP-annulus-sector-track-indicator .OP-annulus-sector-text { 1522 mix-blend-mode: difference; 1523 position: absolute; 1524 top: 50%; 1525 left: 50%; 1526 transform: translate(-50%, -50%); 1527 z-index: -2; 1528} 1529 1530@property --OP-annulus-track-phase1-color { 1531 syntax: "<color>"; 1532 inherits: true; 1533 initial-value: rgba(50, 205, 50, 0.22); 1534} 1535@property --OP-annulus-track-phase2-color { 1536 syntax: "<color>"; 1537 inherits: true; 1538 initial-value: rgba(50, 205, 50, 0.22); 1539} 1540@property --OP-annulus-track-phase3-color { 1541 syntax: "<color>"; 1542 inherits: true; 1543 initial-value: rgba(50, 205, 50, 0.22); 1544} 1545@property --OP-annulus-track-phase4-color { 1546 syntax: "<color>"; 1547 inherits: true; 1548 initial-value: rgba(50, 205, 50, 0.22); 1549} 1550@property --OP-annulus-sector-phase1-color { 1551 syntax: "<color>"; 1552 inherits: true; 1553 initial-value: rgb(50, 205, 50); 1554} 1555@property --OP-annulus-sector-phase2-color { 1556 syntax: "<color>"; 1557 inherits: true; 1558 initial-value: rgb(50, 205, 50); 1559} 1560@property --OP-annulus-sector-phase3-color { 1561 syntax: "<color>"; 1562 inherits: true; 1563 initial-value: rgb(50, 205, 50); 1564} 1565@property --OP-annulus-sector-phase4-color { 1566 syntax: "<color>"; 1567 inherits: true; 1568 initial-value: rgb(50, 205, 50); 1569} 1570@property --rli-animation-duration { 1571 syntax: "<time>"; 1572 inherits: true; 1573 initial-value: 1s; 1574} 1575@keyframes uxlv7rl { 1576 to { 1577 transform: rotate(1turn); 1578 } 1579} 1580@keyframes uxlv7tf { 1581 100%, 0% { 1582 border-color: var(--OP-annulus-track-phase1-color); 1583 border-top-color: var(--OP-annulus-sector-phase1-color); 1584 } 1585 18% { 1586 border-color: var(--OP-annulus-track-phase1-color); 1587 border-top-color: var(--OP-annulus-sector-phase1-color); 1588 } 1589 25% { 1590 border-color: var(--OP-annulus-track-phase2-color, var(--OP-annulus-track-phase1-color)); 1591 border-top-color: var(--OP-annulus-sector-phase2-color, var(--OP-annulus-sector-p
1591hase1-color)); 1592 } 1593 43% { 1594 border-color: var(--OP-annulus-track-phase2-color, var(--OP-annulus-track-phase1-color)); 1595 border-top-color: var(--OP-annulus-sector-phase2-color, var(--OP-annulus-sector-phase1-color)); 1596 } 1597 50% { 1598 border-color: var(--OP-annulus-track-phase3-color, var(--OP-annulus-track-phase1-color)); 1599 border-top-color: var(--OP-annulus-sector-phase3-color, var(--OP-annulus-sector-phase1-color)); 1600 } 1601 68% { 1602 border-color: var(--OP-annulus-track-phase3-color, var(--OP-annulus-track-phase1-color)); 1603 border-top-color: var(--OP-annulus-sector-phase3-color, var(--OP-annulus-sector-phase1-color)); 1604 } 1605 75% { 1606 border-color: var(--OP-annulus-track-phase4-color, var(--OP-annulus-track-phase1-color)); 1607 border-top-color: var(--OP-annulus-sector-phase4-color, var(--OP-annulus-sector-phase1-color)); 1608 } 1609 93% { 1610 border-color: var(--OP-annulus-track-phase4-color, var(--OP-annulus-track-phase1-color)); 1611 border-top-color: var(--OP-annulus-sector-phase4-color, var(--OP-annulus-sector-phase1-color)); 1612 } 1613}`);Array.from({length:4},function(e,t){return["--OP-annulus-track-phase".concat(t+1,"-color"),"--OP-annulus-sector-phase".concat(t+1,"-color")]});or(`.foursquare-rli-bounding-box { 1614 --four-square-phase1-color: rgb(50, 205, 50); 1615 font-size: 16px; 1616 box-sizing: border-box; 1617 color: var(--four-square-phase1-color); 1618 display: inline-block; 1619 overflow: hidden; 1620} 1621.foursquare-rli-bounding-box .foursquare-indicator { 1622 height: 5.3033008589em; 1623 width: 5.3033008589em; 1624 position: relative; 1625 display: block; 1626} 1627.foursquare-rli-bounding-box .foursquare-indicator .squares-container { 1628 position: absolute; 1629 z-index: 0; 1630 top: 0; 1631 right: 0; 1632 bottom: 0; 1633 left: 0; 1634 margin: auto; 1635 height: 2.5em; 1636 width: 2.5em; 1637 color: inherit; 1638 will-change: color, width, height; 1639 transform: rotate(45deg); 1640 animation: var(--rli-animation-duration, 1s) var(--rli-animation-function, cubic-bezier(0.05, 0.28, 0.79, 0.98)) infinite uxlv7dk, calc(var(--rli-animation-duration, 1s) * 4) var(--rli-animation-function, cubic-bezier(0.05, 0.28, 0.79, 0.98)) infinite uxlv7es; 1641} 1642.foursquare-rli-bounding-box .foursquare-indicator .squares-container .square { 1643 position: absolute; 1644 width: 1.25em; 1645 height: 1.25em; 1646 border-radius: 0.1875em; 1647 background-color: currentColor; 1648 animation: uxlv7dd var(--rli-animation-duration, 1s) var(--rli-animation-function, cubic-bezier(0.05, 0.28, 0.79, 0.98)) both infinite; 1649} 1650.foursquare-rli-bounding-box .foursquare-indicator .squares-container .square.square1 { 1651 top: 0; 1652 left: 0; 1653} 1654.foursquare-rli-bounding-box .foursquare-indicator .squares-container .square.square2 { 1655 top: 0; 1656 right: 0; 1657} 1658.foursquare-rli-bounding-box .foursquare-indicator .squares-container .square.square3 { 1659 bottom: 0; 1660 left: 0; 1661} 1662.foursquare-rli-bounding-box .foursquare-indicator .squares-container .square.square4 { 1663 bottom: 0; 1664 right: 0; 1665} 1666 1667@property --four-square-phase1-color { 1668 syntax: "<color>"; 1669 inherits: true; 1670 initial-value: rgb(50, 205, 50); 1671} 1672@property --four-square-phase2-color { 1673 syntax: "<color>"; 1674 inherits: true; 1675 initial-value: rgb(50, 205, 50); 1676} 1677@property --four-square-phase3-color { 1678 syntax: "<color>"; 1679 inherits: true; 1680 initial-value: rgb(50, 205, 50); 1681} 1682@property --four-square-phase4-color { 1683 syntax: "<color>"; 1684 inherits: true; 1685 initial-value: rgb(50, 205, 50); 1686} 1687@property --rli-animation-duration { 1688 syntax: "<time>"; 1689 inherits: true; 1690 initial-value: 1s; 1691} 1692@keyframes uxlv7dk { 1693 0% { 1694 width: 2.5em; 1695 height: 2.5em; 1696 } 1697 10% { 1698 width: 2.5em; 1699 height: 2.5em; 1700 } 1701 50% { 1702 width: 3.75em; 1703 height: 3.75em; 1704 } 1705 90% { 1706 width: 2.5em; 1707 height: 2.5em; 1708 } 1709 100% { 1710 width: 2.5em; 1711 height: 2.5em; 1712 } 1713} 1714@keyframes uxlv7dd { 1715 0% { 1716 transform: rotateZ(0deg); 1717 } 1718 10% { 1719 transform: rotateZ(0deg); 1720 } 1721 50% { 1722 transform: rotateZ(90deg); 1723 } 1724 90% { 1725 transform: rotateZ(90deg); 1726 } 1727 100% { 1728 transform: rotateZ(90deg); 1729 } 1730} 1731@keyframes uxlv7es { 1732 100%, 0% { 1733 color: var(--four-square-phase1-color); 1734 } 1735 20% { 1736 color: var(--four-square-phase1-color); 1737 } 1738 25% { 1739 color: var(--four-square-phase2-color, var(--four-square-phase1-color)); 1740 } 1741 45% { 1742 color: var(--four-square-phase2-color, var(--four-square-phase1-color)); 1743 } 1744 50% { 1745 color: var(--four-square-phase3-color, var(--four-square-phase1-color)); 1746 } 1747 70% { 1748 color: var(--four-square-phase3-color, var(--four-square-phase1-color)); 1749 } 1750 75% { 1751 color: var(--four-square-phase4-color, var(--four-square-phase1-color)); 1752 } 1753 95% { 1754 color: var(--four-square-phase4-color, var(--four-square-phase1-color)); 1755 } 1756}`);Array.from({length:4},function(e,t){return"--four-square-phase".concat(t+1,"-color")});or(`.mosaic-rli-bounding-box { 1757 --mosaic-phase1-color: rgb(50, 205, 50); 1758 box-sizing: border-box; 1759 font-size: 16px; 1760 color: var(--mosaic-phase1-color); 1761} 1762.mosaic-rli-bounding-box .mosaic-indicator { 1763 width: 5em; 1764 height: 5em; 1765 color: currentColor; 1766 display: grid; 1767 gap: 0.125em; 1768 grid-template-columns: repeat(3, 1fr); 1769 grid-template-areas: "a b c" "d e f" "g h i"; 1770 position: relative; 1771 z-index: 0; 1772} 1773.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube-text { 1774 mix-blend-mode: difference; 1775 position: absolute; 1776 top: 105%; 1777 left: 50%; 1778 transform: translateX(-50%); 1779 z-index: -2; 1780} 1781.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube { 1782 background-color: var(--mosaic-phase1-color); 1783 animation-name: uxlv7i4, uxlv7is;
1784 animation-duration: var(--rli-animation-duration, 1.5s), calc(var(--rli-animation-duration, 1.5s) * 4); 1785 animation-timing-function: var(--rli-animation-function, ease-in-out); 1786 animation-iteration-count: infinite; 1787} 1788.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube1 { 1789 animation-delay: calc(var(--mosaic-skip-interval, 0.1s) * 2); 1790 grid-area: a; 1791} 1792.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube2 { 1793 animation-delay: calc(var(--mosaic-skip-interval, 0.1s) * 3); 1794 grid-area: b; 1795} 1796.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube3 { 1797 grid-area: c; 1798 animation-delay: calc(var(--mosaic-skip-interval, 0.1s) * 4); 1799} 1800.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube4 { 1801 grid-area: d; 1802 animation-delay: calc(var(--mosaic-skip-interval, 0.1s) * 1); 1803} 1804.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube5 { 1805 grid-area: e; 1806 animation-delay: calc(var(--mosaic-skip-interval, 0.1s) * 2); 1807} 1808.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube6 { 1809 grid-area: f; 1810 animation-delay: calc(var(--mosaic-skip-interval, 0.1s) * 3); 1811} 1812.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube7 { 1813 grid-area: g; 1814 animation-delay: 0s; 1815} 1816.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube8 { 1817 grid-area: h; 1818 animation-delay: calc(var(--mosaic-skip-interval, 0.1s) * 1); 1819} 1820.mosaic-rli-bounding-box .mosaic-indicator .mosaic-cube9 { 1821 grid-area: i; 1822 animation-delay: calc(var(--mosaic-skip-interval, 0.1s) * 2); 1823} 1824 1825@property --mosaic-phase1-color { 1826 syntax: "<color>"; 1827 inherits: true; 1828 initial-value: rgb(50, 205, 50); 1829} 1830@property --mosaic-phase2-color { 1831 syntax: "<color>"; 1832 inherits: true; 1833 initial-value: rgb(50, 205, 50); 1834} 1835@property --mosaic-phase3-color { 1836 syntax: "<color>"; 1837 inherits: true; 1838 initial-value: rgb(50, 205, 50); 1839} 1840@property --mosaic-phase4-color { 1841 syntax: "<color>"; 1842 inherits: true; 1843 initial-value: rgb(50, 205, 50); 1844} 1845@property --rli-animation-duration { 1846 syntax: "<time>"; 1847 inherits: true; 1848 initial-value: 1.5s; 1849} 1850@keyframes uxlv7i4 { 1851 0%, 60%, 100% { 1852 transform: scale3D(1, 1, 1); 1853 } 1854 30% { 1855 transform: scale3D(0, 0, 1); 1856 } 1857} 1858@keyframes uxlv7is { 1859 100%, 0% { 1860 background-color: var(--mosaic-phase1-color); 1861 } 1862 25% { 1863 background-color: var(--mosaic-phase2-color, var(--mosaic-phase1-color)); 1864 } 1865 50% { 1866 background-color: var(--mosaic-phase3-color, var(--mosaic-phase1-color)); 1867 } 1868 75% { 1869 background-color: var(--mosaic-phase4-color, var(--mosaic-phase1-color)); 1870 } 1871}`);var ef=Array.from({length:4},function(e,t){return"--mosaic-phase".concat(t+1,"-color")}),A8e=function(e){var t,n=S8e(e?.style,e?.size),r=n.styles,a=n.fontSize,s=e?.easing,o=k8e(e?.speedPlus,"1.5s").animationPeriod,l=Math.round(parseFloat(o)/9*100)/100;l+="s";var u=function(d){var h={};if(d instanceof Array){for(var p=O8e(d,ef.length),g=0;g<p.length&&!(g>=4);g++)h[ef[g]]=p[g];return h}try{if(typeof d!="string")throw new Error("Color String expected");for(var x=0;x<ef.length;x++)h[ef[x]]=d}catch(y){for(y instanceof Error?console.warn("[".concat(y.message,']: Received "').concat(typeof d,'" instead with value, ').concat(JSON.stringify(d))):console.warn("".concat(JSON.stringify(d)," received in <Mosaic /> indicator cannot be processed. Using default instead!")),x=0;x<ef.length;x++)h[ef[x]]=zJ}return h}((t=e?.color)!==null&&t!==void 0?t:"");return ve.createElement("span",{className:"rli-d-i-b mosaic-rli-bounding-box",style:Gs(Gs(Gs(Gs(Gs({},a&&{fontSize:a}),o&&{"--rli-animation-duration":o}),s&&{"--rli-animation-function":s}),u),r),role:"status","aria-live":"polite","aria-label":"Loading"},ve.createElement("span",{className:"rli-d-i-b mosaic-indicator",style:Gs({},l&&{"--mosaic-skip-interval":l})},ve.createElement("span",{className:"rli-d-i-b mosaic-cube mosaic-cube1"}),ve.createElement("span",{className:"rli-d-i-b mosaic-cube mosaic-cube2"}),ve.createElement("span",{className:"rli-d-i-b mosaic-cube mosaic-cube3"}),ve.createElement("span",{className:"rli-d-i-b mosaic-cube mosaic-cube4"}),ve.createElement("span",{className:"rli-d-i-b mosaic-cube mosaic-cube5"}),ve.createElement("span",{className:"rli-d-i-b mosaic-cube mosaic-cube6"}),ve.createElement("span",{className:"rli-d-i-b mosaic-cube mosaic-cube7"}),ve.createElement("span",{className:"rli-d-i-b mosaic-cube mosaic-cube8"}),ve.createElement("span",{className:"rli-d-i-b mosaic-cube mosaic-cube9"})),ve.createElement(E8e,{staticText:!0,text:e?.text,textColor:e?.textColor}))};or(`.riple-rli-bounding-box { 1872 --riple-phase1-color: rgb(50, 205, 50); 1873 box-sizing: border-box; 1874 font-size: 16px; 1875 display: inline-block; 1876 color: var(--riple-phase1-color); 1877} 1878.riple-rli-bounding-box .riple-indicator { 1879 display: inline-block; 1880 width: 5em; 1881 height: 5em; 1882 position: relative; 1883 z-index: 0; 1884} 1885.riple-rli-bounding-box .riple-indicator .riple-text { 1886 mix-blend-mode: difference; 1887 position: absolute; 1888 top: 50%; 1889 left: 50%; 1890 transform: translate(-50%, -50%); 1891 z-index: -2; 1892} 1893.riple-rli-bounding-box .riple-indicator .riple { 1894 --border-width: 0.25em; 1895 position: absolute; 1896 border: var(--border-width) solid var(--riple-phase1-color); 1897 opacity: 1; 1898 border-radius: 50%; 1899 will-change: top, right, left, bottom, border-color; 1900 animation: var(--rli-animation-duration, 1s) var(--rli-animation-function, cubic-bezier(0, 0.2, 0.8, 1)) infinite uxlv7i1, calc(var(--rli-animation-duration, 1s) * 4) var(--rli-animation-function, cubic-bezier(0, 0.2, 0.8, 1)) infinite uxlv7io; 1901} 1902.riple-rli-bounding-box .riple-indicator .riple:nth-of-type(2) { 1903 animation-delay: calc(var(--rli-animation-duration, 1s) / 2 * -1); 1904} 1905 1906@property --riple-phase1-color { 1907 syntax: "<color>"; 1908 inherits: true; 1909 initial-value: rgb(50, 205, 50); 1910} 1911@property --riple-phase2-color { 1912 syntax: "<color>"; 1913 inherits: true; 1914 initial-value: rgb(50, 205, 50); 1915} 1916@property --riple-phase3-color { 1917 syntax: "<color>"; 1918 inherits: true; 1919 initial-value: rgb(50, 205, 50); 1920} 1921@property --riple-phase4-color { 1922 syntax: "<color>"; 1923 inherits: true; 1924 initial-value: rgb(50, 205, 50); 1925} 1926@property --rli-animation-duration { 1927 syntax: "<time>"; 1928 inherits: true; 1929 initial-value: 1s; 1930} 1931@keyframes uxlv7i1 { 1932 0% { 1933 top: calc(50% - var(--border-width)); 1934 left: calc(50% - var(--border-width)); 1935 right: calc(50% - var(--border-width)); 1936 bottom: calc(50% - var(--border-width)); 1937 opacity: 0; 1938 }
1939 4.9% { 1940 top: calc(50% - var(--border-width)); 1941 left: calc(50% - var(--border-width)); 1942 right: calc(50% - var(--border-width)); 1943 bottom: calc(50% - var(--border-width)); 1944 opacity: 0; 1945 } 1946 5% { 1947 top: calc(50% - var(--border-width)); 1948 left: calc(50% - var(--border-width)); 1949 right: calc(50% - var(--border-width)); 1950 bottom: calc(50% - var(--border-width)); 1951 opacity: 1; 1952 } 1953 100% { 1954 top: 0; 1955 left: 0; 1956 right: 0; 1957 bottom: 0; 1958 opacity: 0; 1959 } 1960} 1961@keyframes uxlv7io { 1962 100%, 0% { 1963 border-color: var(--riple-phase1-color); 1964 } 1965 24.9% { 1966 border-color: var(--riple-phase1-color); 1967 } 1968 25% { 1969 border-color: var(--riple-phase2-color, var(--riple-phase1-color)); 1970 } 1971 49.9% { 1972 border-color: var(--riple-phase2-color, var(--riple-phase1-color)); 1973 } 1974 50% { 1975 border-color: var(--riple-phase3-color, var(--riple-phase1-color)); 1976 } 1977 74.9% { 1978 border-color: var(--riple-phase3-color, var(--riple-phase1-color)); 1979 } 1980 75% { 1981 border-color: var(--riple-phase4-color, var(--riple-phase1-color)); 1982 } 1983 99.9% { 1984 border-color: var(--riple-phase4-color, var(--riple-phase1-color)); 1985 } 1986}`);Array.from({length:4},function(e,t){return"--riple-phase".concat(t+1,"-color")});or(`.pulsate-rli-bounding-box { 1987 --TD-pulsate-phase1-color: rgb(50, 205, 50); 1988 font-size: 16px; 1989 display: inline-block; 1990 box-sizing: border-box; 1991 color: var(--TD-pulsate-phase1-color); 1992} 1993.pulsate-rli-bounding-box .pulsate-indicator { 1994 width: 4.4em; 1995 height: 1.1em; 1996 text-align: center; 1997 position: relative; 1998 z-index: 0; 1999 display: flex; 2000 justify-content: space-between; 2001 flex-wrap: nowrap; 2002 align-items: center; 2003} 2004.pulsate-rli-bounding-box .pulsate-indicator .pulsate-dot { 2005 width: 1.1em; 2006 height: 1.1em; 2007 border-radius: 50%; 2008 background-color: var(--TD-pulsate-phase1-color); 2009 transform: scale(0); 2010 animation: var(--rli-animation-duration, 1.2s) var(--rli-animation-function, ease-in-out) var(--delay) infinite uxlv7s0, calc(var(--rli-animation-duration, 1.2s) * 4) var(--rli-animation-function, ease-in-out) var(--delay) infinite uxlv7to; 2011} 2012.pulsate-rli-bounding-box .pulsate-indicator .pulsate-dot:nth-of-type(1) { 2013 --delay: calc(var(--rli-animation-duration, 1.2s) * 0.15 * -1); 2014} 2015.pulsate-rli-bounding-box .pulsate-indicator .pulsate-dot:nth-of-type(2) { 2016 --delay: calc(var(--rli-animation-duration, 1.2s) * 0); 2017} 2018.pulsate-rli-bounding-box .pulsate-indicator .pulsate-dot:nth-of-type(3) { 2019 --delay: calc(var(--rli-animation-duration, 1.2s) * 0.15); 2020} 2021.pulsate-rli-bounding-box .pulsate-text { 2022 white-space: nowrap; 2023 overflow: hidden; 2024 text-overflow: ellipsis; 2025 width: 80%; 2026 text-transform: uppercase; 2027 text-align: center; 2028 font-size: 0.6em; 2029 letter-spacing: 0.5px; 2030 font-family: sans-serif; 2031 mix-blend-mode: difference; 2032 position: absolute; 2033 top: 50%; 2034 left: 50%; 2035 transform: translate(-50%, -50%); 2036 z-index: -2; 2037} 2038 2039@property --TD-pulsate-phase1-color { 2040 syntax: "<color>"; 2041 inherits: true; 2042 initial-value: rgb(50, 205, 50); 2043} 2044@property --TD-pulsate-phase2-color { 2045 syntax: "<color>"; 2046 inherits: true; 2047 initial-value: rgb(50, 205, 50); 2048} 2049@property --TD-pulsate-phase3-color { 2050 syntax: "<color>"; 2051 inherits: true; 2052 initial-value: rgb(50, 205, 50); 2053} 2054@property --TD-pulsate-phase4-color { 2055 syntax: "<color>"; 2056 inherits: true; 2057 initial-value: rgb(50, 205, 50); 2058} 2059@property --rli-animation-duration { 2060 syntax: "<time>"; 2061 inherits: true; 2062 initial-value: 1.2s; 2063} 2064@keyframes uxlv7s0 { 2065 0%, 90%, 100% { 2066 transform: scale(0); 2067 } 2068 40% { 2069 transform: scale(1); 2070 } 2071} 2072@keyframes uxlv7to { 2073 0%, 100% { 2074 background-color: var(--TD-pulsate-phase1-color); 2075 } 2076 24.9% { 2077 background-color: var(--TD-pulsate-phase1-color); 2078 } 2079 25% { 2080 background-color: var(--TD-pulsate-phase2-color, var(--TD-pulsate-phase1-color)); 2081 } 2082 49.9% { 2083 background-color: var(--TD-pulsate-phase2-color, var(--TD-pulsate-phase1-color)); 2084 } 2085 50% { 2086 background-color: var(--TD-pulsate-phase3-color, var(--TD-pulsate-phase1-color)); 2087 } 2088 74.9% { 2089 background-color: var(--TD-pulsate-phase3-color, var(--TD-pulsate-phase1-color)); 2090 } 2091 75% { 2092 background-color: var(--TD-pulsate-phase4-color, var(--TD-pulsate-phase1-color)); 2093 } 2094 99.9% { 2095 background-color: var(--TD-pulsate-phase4-color, var(--TD-pulsate-phase1-color)); 2096 } 2097}`);Array.from({length:4},function(e,t){return"--TD-pulsate-phase".concat(t+1,"-color")});or(`.brick-stack-rli-bounding-box { 2098 --TD-brick-stack-phase1-color: rgb(50, 205, 50); 2099 box-sizing: border-box; 2100 font-size: 16px; 2101 display: inline-block; 2102 color: var(--TD-brick-stack-phase1-color); 2103} 2104.brick-stack-rli-bounding-box .brick-stack-indicator { 2105 width: 2.8em; 2106 height: 2.8em; 2107 position: relative; 2108 display: block; 2109 margin: 0 auto; 2110} 2111.brick-stack-rli-bounding-box .brick-stack { 2112 width: 100%; 2113 height: 100%; 2114 background: radial-gradient(circle closest-side, currentColor 0% 95%, rgba(0, 0, 0, 0) calc(95% + 1px)) 0 0/40% 40% no-repeat, radial-gradient(circle closest-side, currentColor 0% 95%, rgba(0, 0, 0, 0) calc(95% + 1px)) 0 100%/40% 40% no-repeat, radial-gradient(circle closest-side, currentColor 0% 95%, rgba(0, 0, 0, 0) calc(95% + 1px)) 100% 100%/40% 40% no-repeat; 2115 animation: var(--rli-animation-duration, 1s) var(--rli-animation-function, ease-out) infinite uxlv7tu, calc(var(--rli-animation-duration, 1s) * 4) var(--rli-animation-function, ease-out) infinite uxlv7us; 2116} 2117 2118@property --TD-brick-stack-phase1-color { 2119 syntax: "<color>"; 2120 inherits: true; 2121 initial-value: rgb(50, 205, 50); 2122} 2123@property --TD-brick-stack-phase2-color { 2124 syntax: "<color>"; 2125 inherits: true; 2126 initial-value: rgb(50, 205, 50); 2127} 2128@property --TD-brick-stack-phase3-color { 2129 syntax: "<color>"; 2130 inherits: true; 2131 initial-value: rgb(50, 205, 50); 2132} 2133@property --TD-brick-stack-phase4-color { 2134 syntax: "<color>"; 2135 inherits: true; 2136 initial-value: rgb(50, 205, 50); 2137} 2138@property --rli-animation-duration { 2139 syntax: "<time>"; 2140 inherits: true; 2141 initial-value: 1s; 2142} 2143@keyframes uxlv7tu { 2144 0% { 2145 background-position: 0 0, 0 100%, 100% 100%; 2146 } 2147 25% { 2148 background-position: 100% 0, 0 100%, 100% 100%; 2149 } 2150 50% { 2151 background-position: 100% 0, 0 0, 100% 100%; 2152 } 2153 75% { 2154 background-position: 100% 0, 0 0, 0 100%; 2155 } 2156 100% { 2157 background-position: 100% 100%, 0 0, 0 100%; 2158 } 2159} 2160@keyframes uxlv7us { 2161 100%, 0% { 2162 color: var(--TD-brick-stack-phase1-color); 2163 } 2164 20% { 2165 color: var(--TD-brick-stack-phase1-color); 2166 } 2167 25% { 2168 color: var(--TD-brick-stack-phase2-color, var(--TD-brick-stack-phase1-color)); 2169 } 2170 45% { 2171 color: var(--TD-brick-stack-phase2-color, var(--TD-brick-stack-phase1-color)); 2172 } 2173 50% { 2174 color: var(--TD-brick-stack-phase3-color, var(--TD-brick-stack-phase1-color)); 2175 } 2176 70% { 2177 color: var(--TD-brick-stack-phase3-color, var(--TD-brick-stack-phase1-color)); 2178 } 2179 75% { 2180 color: var(--TD-brick-stack-phase4-color, var(--TD-brick-stack-phase1-color)); 2181 } 2182 95% { 2183 color: var(--TD-brick-stack-phase4-color, var(--TD-brick-stack-phase1-color)); 2184 } 2185}`);Array.from({length:4},function(e,t){return"--TD-brick-stack-phase".concat(t+1,"-color")});or(`.bob-rli-bounding-box { 2186 --TD-bob-phase1-color: rgb(50, 205, 50); 2187 box-sizing: border-box; 2188 font-size: 16px; 2189 display: inline-block; 2190 color: var(--TD-bob-phase1-color); 2191} 2192.bob-rli-bounding-box .bob-indicator { 2193 width: 4.4em; 2194 height: 2.2em; 2195 position: relative; 2196 display: block; 2197 margin: 0 auto; 2198} 2199.bob-rli-bounding-box .bob-indicator .bobbing, 2200.bob-rli-bounding-box .bob-indicator .bobbing::before, 2201.bob-rli-bounding-box .bob-indicator .bobbing::after { 2202 width: 1.1em; 2203 height: 100%; 2204 display: grid; 2205 animation: var(--rli-animation-duration, 1.2s) var(--rli-animation-function, linear) var(--delay) infinite uxlv7u0, calc(var(--rli-animation-duration, 1.2s) * 4) var(--rli-animation-function, linear) var(--delay) infinite uxlv7vq; 2206} 2207.bob-rli-bounding-box .bob-indicator .bobbing::before, 2208.bob-rli-bounding-box .bob-indicator .bobbing::after {
2209 content: ""; 2210 grid-area: 1/1; 2211} 2212.bob-rli-bounding-box .bob-indicator .bobbing { 2213 --delay: calc(var(--rli-animation-duration, 1.2s) * 0.12 * -1); 2214 background: radial-gradient(circle closest-side at center, currentColor 0% 92%, rgba(0, 0, 0, 0) calc(92% + 1px)) 50% 50%/100% 50% no-repeat; 2215} 2216.bob-rli-bounding-box .bob-indicator .bobbing::before { 2217 --delay: calc(var(--rli-animation-duration, 1.2s) * 0); 2218 transform: translateX(150%); 2219 background: radial-gradient(circle closest-side at center, currentColor 0% 92%, rgba(0, 0, 0, 0) calc(92% + 1px)) 50% 50%/100% 50% no-repeat; 2220} 2221.bob-rli-bounding-box .bob-indicator .bobbing::after { 2222 --delay: calc(var(--rli-animation-duration, 1.2s) * 0.12); 2223 transform: translateX(300%); 2224 background: radial-gradient(circle closest-side at center, currentColor 0% 92%, rgba(0, 0, 0, 0) calc(92% + 1px)) 50% 50%/100% 50% no-repeat; 2225} 2226 2227@property --TD-bob-phase1-color { 2228 syntax: "<color>"; 2229 inherits: true; 2230 initial-value: rgb(50, 205, 50); 2231} 2232@property --TD-bob-phase2-color { 2233 syntax: "<color>"; 2234 inherits: true; 2235 initial-value: rgb(50, 205, 50); 2236} 2237@property --TD-bob-phase3-color { 2238 syntax: "<color>"; 2239 inherits: true; 2240 initial-value: rgb(50, 205, 50); 2241} 2242@property --TD-bob-phase4-color { 2243 syntax: "<color>"; 2244 inherits: true; 2245 initial-value: rgb(50, 205, 50); 2246} 2247@property --rli-animation-duration { 2248 syntax: "<time>"; 2249 inherits: true; 2250 initial-value: 1.2s; 2251} 2252@keyframes uxlv7u0 { 2253 100%, 0% { 2254 background-position: 50% 50%; 2255 } 2256 15% { 2257 background-position: 50% 10%; 2258 } 2259 30% { 2260 background-position: 50% 100%; 2261 } 2262 40% { 2263 background-position: 50% 0%; 2264 } 2265 50% { 2266 background-position: 50% 90%; 2267 } 2268 70% { 2269 background-position: 50% 10%; 2270 } 2271 98% { 2272 background-position: 50% 50%; 2273 } 2274} 2275@keyframes uxlv7vq { 2276 100%, 0% { 2277 color: var(--TD-bob-phase1-color); 2278 } 2279 22% { 2280 color: var(--TD-bob-phase1-color); 2281 } 2282 25% { 2283 color: var(--TD-bob-phase2-color, var(--TD-bob-phase1-color)); 2284 } 2285 47% { 2286 color: var(--TD-bob-phase2-color, var(--TD-bob-phase1-color)); 2287 } 2288 50% { 2289 color: var(--TD-bob-phase3-color, var(--TD-bob-phase1-color)); 2290 } 2291 72% { 2292 color: var(--TD-bob-phase3-color, var(--TD-bob-phase1-color)); 2293 } 2294 75% { 2295 color: var(--TD-bob-phase4-color, var(--TD-bob-phase1-color)); 2296 } 2297 97% { 2298 color: var(--TD-bob-phase4-color, var(--TD-bob-phase1-color)); 2299 } 2300}`);Array.from({length:4},function(e,t){return"--TD-bob-phase".concat(t+1,"-color")});or(`.bounce-rli-bounding-box { 2301 --TD-bounce-phase1-color: rgb(50, 205, 50); 2302 font-size: 16px; 2303 color: var(--TD-bounce-phase1-color); 2304 display: inline-block; 2305 padding-bottom: 0.25125em; 2306} 2307.bounce-rli-bounding-box .wrapper { 2308 --dot1-delay: 0s; 2309 --dot1-x-offset: 0.55em; 2310 --dot2-delay: calc((var(--rli-animation-duration, 0.5s) + var(--rli-animation-duration, 0.5s) * 0.75) * -1); 2311 --dot2-x-offset: 2.2em; 2312 --dot3-delay: calc((var(--rli-animation-duration, 0.5s) + var(--rli-animation-duration, 0.5s) * 0.5) * -1); 2313 --dot3-x-offset: 3.85em; 2314 width: 5.5em; 2315 height: 3.125em; 2316 position: relative; 2317 display: block; 2318 margin: 0 auto; 2319} 2320.bounce-rli-bounding-box .wrapper .group { 2321 display: block; 2322 position: absolute; 2323 top: 0; 2324 right: 0; 2325 bottom: 0; 2326 left: 0; 2327} 2328.bounce-rli-bounding-box .wrapper .group .dot { 2329 width: 1.1em; 2330 height: 1.1em; 2331 position: absolute; 2332 border-radius: 50%; 2333 background-color: var(--TD-bounce-phase1-color); 2334 transform-origin: 50%; 2335 animation: var(--rli-animation-duration, 0.5s) var(--rli-animation-function, cubic-bezier(0.74, 0.1, 0.74, 1)) alternate infinite uxlv7wc, calc(var(--rli-animation-duration, 0.5s) * 4) var(--rli-animation-function, cubic-bezier(0.74, 0.1, 0.74, 1)) infinite uxlv7x6; 2336} 2337.bounce-rli-bounding-box .wrapper .group .dot:nth-of-type(1) { 2338 left: var(--dot1-x-offset); 2339 animation-delay: var(--dot1-delay), 0s; 2340} 2341.bounce-rli-bounding-box .wrapper .group .dot:nth-of-type(2) { 2342 left: var(--dot2-x-offset); 2343 animation-delay: var(--dot2-delay), 0s; 2344} 2345.bounce-rli-bounding-box .wrapper .group .dot:nth-of-type(3) { 2346 left: var(--dot3-x-offset); 2347 animation-delay: var(--dot3-delay), 0s; 2348} 2349.bounce-rli-bounding-box .wrapper .group .shadow { 2350 width: 1.1em; 2351 height: 0.22em; 2352 border-radius: 50%; 2353 background-color: rgba(0, 0, 0, 0.5); 2354 position: absolute; 2355 top: 101%; 2356 transform-origin: 50%; 2357 z-index: -1; 2358 filter: blur(1px); 2359 animation: var(--rli-animation-duration, 0.5s) var(--rli-animation-function, cubic-bezier(0.74, 0.1, 0.74, 1)) alternate infinite uxlv7ww; 2360} 2361.bounce-rli-bounding-box .wrapper .group .shadow:nth-of-type(1) { 2362 left: var(--dot1-x-offset); 2363 animation-delay: var(--dot1-delay); 2364} 2365.bounce-rli-bounding-box .wrapper .group .shadow:nth-of-type(2) { 2366 left: var(--dot2-x-offset); 2367 animation-delay: var(--dot2-delay); 2368} 2369.bounce-rli-bounding-box .wrapper .group .shadow:nth-of-type(3) { 2370 left: var(--dot3-x-offset); 2371 animation-delay: var(--dot3-delay); 2372} 2373 2374@property --TD-bounce-phase1-color { 2375 syntax: "<color>"; 2376 inherits: true; 2377 initial-value: rgb(50, 205, 50); 2378} 2379@property --TD-bounce-phase2-color { 2380 syntax: "<color>"; 2381 inherits: true; 2382 initial-value: rgb(50, 205, 50); 2383} 2384@property --TD-bounce-phase3-color { 2385 syntax: "<color>"; 2386 inherits: true; 2387 initial-value: rgb(50, 205, 50); 2388} 2389@property --TD-bounce-phase4-color { 2390 syntax: "<color>"; 2391 inherits: true; 2392 initial-value: rgb(50, 205, 50); 2393} 2394@property --rli-animation-duration { 2395 syntax: "<time>"; 2396 inherits: true; 2397 initial-value: 0.5s; 2398} 2399@keyframes uxlv7wc { 2400 0% { 2401 top: 0%; 2402 } 2403 60% { 2404 height: 1.25em; 2405 border-radius: 50%; 2406 transform: scaleX(1); 2407 } 2408 100% { 2409 top: 100%; 2410 height: 0.22em; 2411 transform: scaleX(1.5); 2412 filter: blur(0.4px); 2413 } 2414} 2415@keyframes uxlv7ww { 2416 0% { 2417 transform: scaleX(0.2); 2418 opacity: 0.2; 2419 } 2420 60% { 2421 opacity: 0.4; 2422 } 2423 100% { 2424 transform: scaleX(1.5); 2425 opacity: 0.6; 2426 } 2427} 2428@keyframes uxlv7x6 { 2429 0%, 100% { 2430 background-color: var(--TD-bounce-phase1-color); 2431 } 2432 20% { 2433 background-color: var(--TD-bounce-phase1-color); 2434 } 2435 25% { 2436 background-color: var(--TD-bounce-phase2-color, var(--TD-bounce-phase1-color)); 2437 } 2438 45% { 2439 background-color: var(--TD-bounce-phase2-color, var(--TD-bounce-phase1-color)); 2440 } 2441 50% { 2442 background-color: var(--TD-bounce-phase3-color, var(--TD-bounce-phase1-color)); 2443 } 2444 70% { 2445 background-color: var(--TD-bounce-phase3-color, var(--TD-bounce-phase1-color)); 2446 } 2447 75% { 2448 background-color: var(--TD-bounce-phase4-color, var(--TD-bounce-phase1-color)); 2449 } 2450 95% { 2451 background-color: var(--TD-bounce-phase4-color, var(--TD-bounce-phase1-color)); 2452 } 2453}`);Array.from({length:4},function(e,t){return"--TD-bounce-phase".concat(t+1,"-color")});or(`.blink-blur-rli-bounding-box { 2454 --shape-phase1-color: rgb(50, 205, 50); 2455 font-size: 16px; 2456 color: var(--shape-phase1-color); 2457} 2458.blink-blur-rli-bounding-box .blink-blur-indicator { 2459 isolation: isolate; 2460 display: flex; 2461 flex-direction: row; 2462 -moz-column-gap: 0.4em; 2463 column-gap: 0.4em; 2464} 2465.blink-blur-rli-bounding-box .blink-blur-indicator .blink-blur-shape { 2466 --x-deg: -20deg; 2467 width: 1.8em; 2468 height: 2.25em; 2469 border-radius: 0.25em; 2470 color: inherit; 2471 transform: skewX(var(--x-deg)); 2472 background-color: var(--shape-phase1-color); 2473 animation-name: uxlv7id, uxlv7jl; 2474 animation-duration: var(--rli-animation-duration, 1.2s), calc(var(--rli-animation-duration, 1.2s) * 4); 2475 animation-timing-function: var(--rli-animation-function, ease-in); 2476 animation-iteration-count: infinite; 2477} 2478.blink-blur-rli-bounding-box .blink-blur-indicator .blink-blur-shape.blink-blur-shape1 { 2479 animation-delay: calc(var(--rli-animation-duration, 1.2s) * 0.5 * -1); 2480} 2481.blink-blur-rli-bounding-box .blink-blur-indicator .blink-blur-shape.blink-blur-shape2 { 2482 animation-delay: calc(var(--rli-animation-duration, 1.2s) * 0.4 * -1); 2483} 2484.blink-blur-rli-bounding-box .blink-blur-indicator .blink-blur-shape.blink-blur-shape3 { 2485 animation-delay: calc(var(--rli-animation-duration, 1.2s) * 0.3 * -1); 2486} 2487.blink-blur-rli-bounding-box .blink-blur-indicator .blink-blur-shape.blink-blur-shape4 { 2488 animation-delay: calc(var(--rli-animation-duration, 1.2s) * 0.2 * -1); 2489} 2490.blink-blur-rli-bounding-box .blink-blur-indicator .blink-blur-shape.blink-blur-shape5 { 2491 animation-delay: calc(var(--rli-animation-duration, 1.2s) * 0.1 * -1); 2492} 2493 2494@property --shape-phase1-color { 2495 syntax: "<color>"; 2496 inherits: true; 2497 initial-value: rgb(50, 205, 50); 2498} 2499@property --shape-phase2-color { 2500 syntax: "<color>"; 2501 inherits: true; 2502 initial-value: rgb(50, 205, 50); 2503} 2504@property --shape-phase3-color { 2505 syntax: "<color>"; 2506 inherits: true; 2507 initial-value: rgb(50, 205, 50); 2508} 2509@property --shape-phase4-color { 2510 syntax: "<color>"; 2511 inherits: true; 2512 initial-value: rgb(50, 205, 50); 2513} 2514@property --rli-animation-duration { 2515 syntax: "<time>"; 2516 inherits: true; 2517 initial-value: 1.2s; 2518} 2519@keyframes uxlv7id { 2520 100%, 0% { 2521 opacity: 0.3; 2522 filter: blur(0.0675em) drop-shadow(0 0 0.0625em); 2523 transform: skewX(var(--x-deg)) scale(1.2, 1.45); 2524 } 2525 39% { 2526 opacity: 0.8; 2527 } 2528 40%, 41%, 42% { 2529 opacity: 0; 2530 } 2531 43% { 2532 opacity: 0.8; 2533 } 2534 50% { 2535 opacity: 1; 2536 filter: blur(0em) drop-shadow(0 0 0em); 2537 transform: skewX(var(--x-deg)) scale(1, 1); 2538 } 2539} 2540@keyframes uxlv7jl { 2541 100%, 0% { 2542 color: var(--shape-phase1-color); 2543 background-color: var(--shape-phase1-color); 2544 } 2545 25% { 2546 color: var(--shape-phase2-color, var(--shape-phase1-color)); 2547 background-color: var(--shape-phase2-color, var(--shape-phase1-color)); 2548 } 2549 50% { 2550 color: var(--shape-phase3-color, var(--shape-phase1-color)); 2551 background-color: var(--shape-phase3-color, var(--shape-phase1-color)); 2552 } 2553 75% { 2554 color: var(--shape-phase4-color, var(--shape-phase1-color)); 2555 background-color: var(--shape-phase4-color, var(--shape-phase1-color)); 2556 } 2557}`);Array.from({length:4},function(e,t){return"--shape-phase".concat(t+1,"-color")});or(`.trophy-spin-rli-bounding-box { 2558 --trophySpin-phase1-color: rgb(50, 205, 50); 2559 box-sizing: border-box; 2560 font-size: 16px; 2561 position: relative; 2562 isolation: isolate; 2563 color: var(--trophySpin-phase1-color); 2564} 2565.trophy-spin-rli-bounding-box .trophy-spin-indicator { 2566 width: 4em; 2567 perspective: 1000px; 2568 transform-style: preserve-3d; 2569 display: block; 2570 margin: 0 auto; 2571} 2572.trophy-spin-rli-bounding-box .trophy-spin-indicator .blade { 2573 display: block; 2574 width: 4em; 2575 height: 0.5em; 2576 background: var(--trophySpin-phase1-color); 2577 animation: uxlv7ki var(--rli-animation-duration, 2.5s) var(--rli-animation-function, linear) infinite, uxlv7l2 calc(var(--rli-animation-duration, 2.5s) * 0.5) var(--rli-animation-function, linear) infinite, uxlv7ly calc(var(--rli-animation-duration, 2.5s) * 4) var(--rli-animation-function, linear) infinite; 2578} 2579.trophy-spin-rli-bounding-box .trophy-spin-indicator .blade:nth-of-type(8) { 2580 animation-delay: calc(var(--rli-animation-duration, 2.5s) / 2 / 8 * 0 * -1); 2581} 2582.trophy-spin-rli-bounding-box .trophy-spin-indicator .blade:nth-of-type(7) { 2583 animation-delay: calc(var(--rli-animation-duration, 2.5s) / 2 / 8 * 1 * -1); 2584} 2585.trophy-spin-rli-bounding-box .trophy-spin-indicator .blade:nth-of-type(6) { 2586 animation-delay: calc(var(--rli-animation-duration, 2.5s) / 2 / 8 * 2 * -1); 2587} 2588.trophy-spin-rli-bounding-box .trophy-spin-indicator .blade:nth-of-type(5) { 2589 animation-delay: calc(var(--rli-animation-duration, 2.5s) / 2 / 8 * 3 * -1); 2590} 2591.trophy-spin-rli-bounding-box .trophy-spin-indicator .blade:nth-of-type(4) { 2592 animation-delay: calc(var(--rli-animation-duration, 2.5s) / 2 / 8 * 4 * -1); 2593} 2594.trophy-spin-rli-bounding-box .trophy-spin-indicator .blade:nth-of-type(3) { 2595 animation-delay: calc(var(--rli-animation-duration, 2.5s) / 2 / 8 * 5 * -1); 2596} 2597.trophy-spin-rli-bounding-box .trophy-spin-indicator .blade:nth-of-type(2) { 2598 animation-delay: calc(var(--rli-animation-duration, 2.5s) / 2 / 8 * 6 * -1); 2599} 2600.trophy-spin-rli-bounding-box .trophy-spin-indicator .blade:nth-of-type(1) { 2601 animation-delay: calc(var(--rli-animation-duration, 2.5s) / 2 / 8 * 7 * -1); 2602} 2603 2604@property --trophySpin-phase1-color { 2605 syntax: "<color>"; 2606 inherits: true; 2607 initial-value: rgb(50, 205, 50); 2608} 2609@property --trophySpin-phase2-color { 2610 syntax: "<color>"; 2611 inherits: true; 2612 initial-value: rgb(50, 205, 50); 2613} 2614@property --trophySpin-phase3-color { 2615 syntax: "<color>"; 2616 inherits: true; 2617 initial-value: rgb(50, 205, 50); 2618} 2619@property --trophySpin-phase4-color { 2620 syntax: "<color>"; 2621 inherits: true; 2622 initial-value: rgb(50, 205, 50); 2623} 2624@property --rli-animation-duration { 2625 syntax: "<time>"; 2626 inherits: true; 2627 initial-value: 2.5s; 2628} 2629@keyframes uxlv7ki { 2630 to { 2631 transform: rotateY(1turn) rotateX(-25deg); 2632 } 2633} 2634@keyframes uxlv7l2 { 2635 100%, 0% { 2636 filter: brightness(1); 2637 opacity: 1; 2638 } 2639 15% { 2640 filter: brightness(1); 2641 } 2642 25% { 2643 opacity: 0.96; 2644 } 2645 30% { 2646 filter: brightness(0.92); 2647 } 2648 50% { 2649 filter: brightness(0.7); 2650 opacity: 1; 2651 } 2652 75% { 2653 filter: brightness(0.92); 2654 opacity: 0.96; 2655 } 2656 90% { 2657 filter: brightness(1); 2658 } 2659} 2660@keyframes uxlv7ly { 2661 100%, 0% { 2662 background-color: var(--trophySpin-phase1-color); 2663 } 2664 18% { 2665 background-color: var(--trophySpin-phase1-color); 2666 } 2667 25% { 2668 background-color: var(--trophySpin-phase2-color, var(--trophySpin-phase1-color)); 2669 } 2670 43% { 2671 background-color: var(--trophySpin-phase2-color, var(--trophySpin-phase1-color)); 2672 } 2673 50% { 2674 background-color: var(--trophySpin-phase3-color, var(--trophySpin-phase1-color)); 2675 } 2676 68% { 2677 background-color: var(--trophySpin-phase3-color, var(--trophySpin-phase1-color)); 2678 } 2679 75% { 2680 background-color: var(--trophySpin-phase4-color, var(--trophySpin-phase1-color)); 2681 } 2682 93% { 2683 background-color: var(--trophySpin-phase4-color, var(--trophySpin-phase1-color)); 2684 } 2685}`);Array.from({length:4},function(e,t){return"--trophySpin-phase".concat(t+1,"-color")});or(`.slab-rli-bounding-box { 2686 --slab-phase1-color: rgb(50, 205, 50); 2687 font-size: 16px; 2688 color: var(--slab-phase1-color); 2689 position: relative; 2690} 2691.slab-rli-bounding-box .slab-indicator { 2692 position: relative; 2693 display: block; 2694 width: 7em; 2695 height: 4em; 2696 margin: 0 auto; 2697 overflow: hidden; 2698} 2699.slab-rli-bounding-box .slab-indicator .slabs-wrapper { 2700 width: 4em; 2701 height: 4em; 2702 transform: perspective(15em) rotateX(66deg) rotateZ(-25deg); 2703 transform-style: preserve-3d; 2704 transform-origin: 50% 100%; 2705 display: block; 2706 position: absolute; 2707 bottom: 0; 2708 right: 0; 2709} 2710.slab-rli-bounding-box .slab-indicator .slabs-wrapper .slab { 2711 position: absolute; 2712 top: 0; 2713 left: 0; 2714 right: 0; 2715 bottom: 0; 2716 background-color: var(--slab-phase1-color); 2717 opacity: 0; 2718 box-shadow: -0.08em 0.15em 0 rgba(0, 0, 0, 0.45); 2719 transform-origin: 0% 0%; 2720 animation: calc(var(--rli-animation-duration-unitless, 3) * 1s) var(--rli-animation-function, linear) infinite uxlv7md, calc(var(--rli-animation-duration-unitless, 3) * 4s) var(--rli-animation-function, linear) infinite uxlv7n0; 2721} 2722.slab-rli-bounding-box .slab-indicator .slabs-wrapper .slab:nth-child(1) { 2723 animation-delay: calc(4 / (16 / var(--rli-animation-duration-unitless, 3)) * 3 * -1 * 1s); 2724} 2725.slab-rli-bounding-box .slab-indicator .slabs-wrapper .slab:nth-child(2) { 2726 animation-delay: calc(4 / (16 / var(--rli-animation-duration-unitless, 3)) * 2 * -1 * 1s); 2727} 2728.slab-rli-bounding-box .slab-indicator .slabs-wrapper .slab:nth-child(3) { 2729 animation-delay: calc(4 / (16 / var(--rli-animation-duration-unitless, 3)) * -1 * 1s); 2730} 2731.slab-rli-bounding-box .slab-indicator .slabs-wrapper .slab:nth-child(4) { 2732 animation-delay: 0s; 2733} 2734 2735@property --slab-phase1-color { 2736 syntax: "<color>"; 2737 inherits: true; 2738 initial-value: rgb(50, 205, 50); 2739} 2740@property --slab-phase2-color { 2741 syntax: "<color>"; 2742 inherits: true; 2743 initial-value: rgb(50, 205, 50); 2744} 2745@property --slab-phase3-color { 2746 syntax: "<color>"; 2747 inherits: true; 2748 initial-value: rgb(50, 205, 50); 2749} 2750@property --slab-phase4-color { 2751 syntax: "<color>"; 2752 inherits: true; 2753 initial-value: rgb(50, 205, 50); 2754} 2755@property --rli-animation-duration-unitless { 2756 syntax: "<number>"; 2757 inherits: true; 2758 initial-value: 3; 2759} 2760@keyframes uxlv7md { 2761 0% { 2762 transform: translateY(0) rotateX(30deg); 2763 opacity: 0; 2764 } 2765 10% { 2766 transform: translateY(-40%) rotateX(0deg); 2767 opacity: 1; 2768 } 2769 25% { 2770 opacity: 1; 2771 } 2772 100% { 2773 transform: translateY(-400%) rotateX(0deg); 2774 opacity: 0; 2775 } 2776} 2777@keyframes uxlv7n0 { 2778 100%, 0% { 2779 background-colo
2779r: var(--slab-phase1-color); 2780 } 2781 24.9% { 2782 background-color: var(--slab-phase1-color); 2783 } 2784 25% { 2785 background-color: var(--slab-phase2-color, var(--slab-phase1-color)); 2786 } 2787 49.9% { 2788 background-color: var(--slab-phase2-color, var(--slab-phase1-color)); 2789 } 2790 50% { 2791 background-color: var(--slab-phase3-color, var(--slab-phase1-color)); 2792 } 2793 74.9% { 2794 background-color: var(--slab-phase3-color, var(--slab-phase1-color)); 2795 } 2796 75% { 2797 background-color: var(--slab-phase4-color, var(--slab-phase1-color)); 2798 } 2799 99.9% { 2800 background-color: var(--slab-phase4-color, var(--slab-phase1-color)); 2801 } 2802}`);Array.from({length:4},function(e,t){return"--slab-phase".concat(t+1,"-color")});or(`.lifeline-rli-bounding-box { 2803 --life-line-phase1-color: rgb(50, 205, 50); 2804 font-size: 16px; 2805 isolation: isolate; 2806 color: var(--life-line-phase1-color); 2807} 2808.lifeline-rli-bounding-box .lifeline-indicator { 2809 position: relative; 2810 text-align: center; 2811} 2812.lifeline-rli-bounding-box .lifeline-indicator path.rli-lifeline { 2813 stroke-dasharray: 474.7616760254 30.3039367676; 2814 animation: var(--rli-animation-duration, 2s) var(--rli-animation-function, linear) infinite uxlv7k3, calc(var(--rli-animation-duration, 2s) * 4) var(--rli-animation-function, linear) infinite uxlv7kg; 2815} 2816.lifeline-rli-bounding-box .lifeline-text { 2817 color: currentColor; 2818 mix-blend-mode: difference; 2819 width: unset; 2820 display: block; 2821} 2822 2823@property --life-line-phase1-color { 2824 syntax: "<color>"; 2825 inherits: true; 2826 initial-value: rgb(50, 205, 50); 2827} 2828@property --life-line-phase2-color { 2829 syntax: "<color>"; 2830 inherits: true; 2831 initial-value: rgb(50, 205, 50); 2832} 2833@property --life-line-phase3-color { 2834 syntax: "<color>"; 2835 inherits: true; 2836 initial-value: rgb(50, 205, 50); 2837} 2838@property --life-line-phase4-color { 2839 syntax: "<color>"; 2840 inherits: true; 2841 initial-value: rgb(50, 205, 50); 2842} 2843@property --rli-animation-duration { 2844 syntax: "<time>"; 2845 inherits: true; 2846 initial-value: 2s; 2847} 2848@keyframes uxlv7k3 { 2849 to { 2850 stroke-dashoffset: -1010.1312255859; 2851 } 2852} 2853@keyframes uxlv7kg { 2854 100%, 0% { 2855 color: var(--life-line-phase1-color); 2856 } 2857 20% { 2858 color: var(--life-line-phase1-color); 2859 } 2860 25% { 2861 color: var(--life-line-phase2-color, var(--life-line-phase1-color)); 2862 } 2863 45% { 2864 color: var(--life-line-phase2-color, var(--life-line-phase1-color)); 2865 } 2866 50% { 2867 color: var(--life-line-phase3-color, var(--life-line-phase1-color)); 2868 } 2869 70% { 2870 color: var(--life-line-phase3-color, var(--life-line-phase1-color)); 2871 } 2872 75% { 2873 color: var(--life-line-phase4-color, var(--life-line-phase1-color)); 2874 } 2875 95% { 2876 color: var(--life-line-phase4-color, var(--life-line-phase1-color)); 2877 } 2878}`);Array.from({length:4},function(e,t){return"--life-line-phase".concat(t+1,"-color")});const hg={black:"#000",white:"#fff"},tf={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},nf={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},rf={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},af={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},sf={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},rm={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},T8e={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function Lu(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const BJ="$$material";function Bv(){return Bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bv.apply(null,arguments)}function P8e(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function R8e(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var M8e=function(){function e(n){var r=this;this._insertTag=function(a){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(a,s),r.tags.push(a)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(R8e(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var s=P8e(a);
2878try{s.insertRule(r,s.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var a;return(a=r.parentNode)==null?void 0:a.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Lr="-ms-",Uv="-moz-",yt="-webkit-",UJ="comm",HP="rule",KP="decl",D8e="@import",qJ="@keyframes",$8e="@layer",I8e=Math.abs,Vw=String.fromCharCode,L8e=Object.assign;function F8e(e,t){return Or(e,0)^45?(((t<<2^Or(e,0))<<2^Or(e,1))<<2^Or(e,2))<<2^Or(e,3):0}function HJ(e){return e.trim()}function z8e(e,t){return(e=t.exec(e))?e[0]:e}function vt(e,t,n){return e.replace(t,n)}function kE(e,t){return e.indexOf(t)}function Or(e,t){return e.charCodeAt(t)|0}function pg(e,t,n){return e.slice(t,n)}function gi(e){return e.length}function VP(e){return e.length}function P0(e,t){return t.push(e),e}function B8e(e,t){return e.map(t).join("")}var Gw=1,rh=1,KJ=0,_a=0,Gn=0,Th="";function Ww(e,t,n,r,a,s,o){return{value:e,root:t,parent:n,type:r,props:a,children:s,line:Gw,column:rh,length:o,return:""}}function am(e,t){return L8e(Ww("",null,null,"",null,null,0),e,{length:-e.length},t)}function U8e(){return Gn}function q8e(){return Gn=_a>0?Or(Th,--_a):0,rh--,Gn===10&&(rh=1,Gw--),Gn}function Qa(){return Gn=_a<KJ?Or(Th,_a++):0,rh++,Gn===10&&(rh=1,Gw++),Gn}function Pi(){return Or(Th,_a)}function ny(){return _a}function rx(e,t){return pg(Th,e,t)}function mg(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function VJ(e){return Gw=rh=1,KJ=gi(Th=e),_a=0,[]}function GJ(e){return Th="",e}function ry(e){return HJ(rx(_a-1,SE(e===91?e+2:e===40?e+1:e)))}function H8e(e){for(;(Gn=Pi())&&Gn<33;)Qa();return mg(e)>2||mg(Gn)>3?"":" "}function K8e(e,t){for(;--t&&Qa()&&!(Gn<48||Gn>102||Gn>57&&Gn<65||Gn>70&&Gn<97););return rx(e,ny()+(t<6&&Pi()==32&&Qa()==32))}function SE(e){for(;Qa();)switch(Gn){case e:return _a;case 34:case 39:e!==34&&e!==39&&SE(Gn);break;case 40:e===41&&SE(e);break;case 92:Qa();break}return _a}function V8e(e,t){for(;Qa()&&e+Gn!==57;)if(e+Gn===84&&Pi()===47)break;return"/*"+rx(t,_a-1)+"*"+Vw(e===47?e:Qa())}function G8e(e){for(;!mg(Pi());)Qa();return rx(e,_a)}function W8e(e){return GJ(ay("",null,null,null,[""],e=VJ(e),0,[0],e))}function ay(e,t,n,r,a,s,o,l,u){for(var d=0,h=0,p=o,g=0,x=0,y=0,w=1,j=1,N=1,k=0,S="",E=a,O=s,T=r,P=S;j;)switch(y=k,k=Qa()){case 40:if(y!=108&&Or(P,p-1)==58){kE(P+=vt(ry(k),"&","&\f"),"&\f")!=-1&&(N=-1);break}case 34:case 39:case 91:P+=ry(k);break;case 9:case 10:case 13:case 32:P+=H8e(y);break;case 92:P+=K8e(ny()-1,7);continue;case 47:switch(Pi()){case 42:case 47:P0(Y8e(V8e(Qa(),ny()),t,n),u);break;default:P+="/"}break;case 123*w:l[d++]=gi(P)*N;case 125*w:case 59:case 0:switch(k){case 0:case 125:j=0;case 59+h:N==-1&&(P=vt(P,/\f/g,"")),x>0&&gi(P)-p&&P0(x>32?JF(P+";",r,n,p-1):JF(vt(P," ","")+";",r,n,p-2),u);break;case 59:P+=";";default:if(P0(T=ZF(P,t,n,d,h,a,l,S,E=[],O=[],p),s),k===123)if(h===0)ay(P,t,T,T,E,s,p,l,O);else switch(g===99&&Or(P,3)===110?100:g){case 100:case 108:case 109:case 115:ay(e,T,T,r&&P0(ZF(e,T,T,0,0,a,l,S,a,E=[],p),O),a,O,p,l,r?E:O);break;default:ay(P,T,T,T,[""],O,0,l,O)}}d=h=x=0,w=N=1,S=P="",p=o;break;case 58:p=1+gi(P),x=y;default:if(w<1){if(k==123)--w;else if(k==125&&w++==0&&q8e()==125)continue}switch(P+=Vw(k),k*w){case 38:N=h>0?1:(P+="\f",-1);break;case 44:l[d++]=(gi(P)-1)*N,N=1;break;case 64:Pi()===45&&(P+=ry(Qa())),g=Pi(),h=p=gi(S=P+=G8e(ny())),k++;break;case 45:y===45&&gi(P)==2&&(w=0)}}return s}function ZF(e,t,n,r,a,s,o,l,u,d,h){for(var p=a-1,g=a===0?s:[""],x=VP(g),y=0,w=0,j=0;y<r;++y)for(var N=0,k=pg(e,p+1,p=I8e(w=o[y])),S=e;N<x;++N)(S=HJ(w>0?g[N]+" "+k:vt(k,/&\f/g,g[N])))&&(u[j++]=S);return Ww(e,t,n,a===0?HP:l,u,d,h)}function Y8e(e,t,n){return Ww(e,t,n,UJ,Vw(U8e()),pg(e,2,-2),0)}function JF(e,t,n,r){return Ww(e,t,n,KP,pg(e,0,r),pg(e,r+1,-1),r)}function Af(e,t){for(var n="",r=VP(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function X8e(e,t,n,r){switch(e.type){case $8e:if(e.children.length)break;case D8e:case KP:return e.return=e.return||e.value;case UJ:return"";case qJ:return e.return=e.value+"{"+Af(e.children,r)+"}";case HP:e.value=e.props.join(",")}return gi(n=Af(e.children,r))?e.return=e.value+"{"+n+"}":""}function Q8e(e){var t=VP(e);return function(n,r,a,s){for(var o="",l=0;l<t;l++)o+=e[l](n,r,a,s)||"";return o}}
2878function Z8e(e){return function(t){t.root||(t=t.return)&&e(t)}}function WJ(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var J8e=function(t,n,r){for(var a=0,s=0;a=s,s=Pi(),a===38&&s===12&&(n[r]=1),!mg(s);)Qa();return rx(t,_a)},e9e=function(t,n){var r=-1,a=44;do switch(mg(a)){case 0:a===38&&Pi()===12&&(n[r]=1),t[r]+=J8e(_a-1,n,r);break;case 2:t[r]+=ry(a);break;case 4:if(a===44){t[++r]=Pi()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Vw(a)}while(a=Qa());return t},t9e=function(t,n){return GJ(e9e(VJ(t),n))},ez=new WeakMap,n9e=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,a=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!ez.get(r))&&!a){ez.set(t,!0);for(var s=[],o=t9e(n,s),l=r.props,u=0,d=0;u<o.length;u++)for(var h=0;h<l.length;h++,d++)t.props[d]=s[u]?o[u].replace(/&\f/g,l[h]):l[h]+" "+o[u]}}},r9e=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function YJ(e,t){switch(F8e(e,t)){case 5103:return yt+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return yt+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return yt+e+Uv+e+Lr+e+e;case 6828:case 4268:return yt+e+Lr+e+e;case 6165:return yt+e+Lr+"flex-"+e+e;case 5187:return yt+e+vt(e,/(\w+).+(:[^]+)/,yt+"box-$1$2"+Lr+"flex-$1$2")+e;case 5443:return yt+e+Lr+"flex-item-"+vt(e,/flex-|-self/,"")+e;case 4675:return yt+e+Lr+"flex-line-pack"+vt(e,/align-content|flex-|-self/,"")+e;case 5548:return yt+e+Lr+vt(e,"shrink","negative")+e;case 5292:return yt+e+Lr+vt(e,"basis","preferred-size")+e;case 6060:return yt+"box-"+vt(e,"-grow","")+yt+e+Lr+vt(e,"grow","positive")+e;case 4554:return yt+vt(e,/([^-])(transform)/g,"$1"+yt+"$2")+e;case 6187:return vt(vt(vt(e,/(zoom-|grab)/,yt+"$1"),/(image-set)/,yt+"$1"),e,"")+e;case 5495:case 3959:return vt(e,/(image-set\([^]*)/,yt+"$1$`$1");case 4968:return vt(vt(e,/(.+:)(flex-)?(.*)/,yt+"box-pack:$3"+Lr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+yt+e+e;case 4095:case 3583:case 4068:case 2532:return vt(e,/(.+)-inline(.+)/,yt+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(gi(e)-1-t>6)switch(Or(e,t+1)){case 109:if(Or(e,t+4)!==45)break;case 102:return vt(e,/(.+:)(.+)-([^]+)/,"$1"+yt+"$2-$3$1"+Uv+(Or(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~kE(e,"stretch")?YJ(vt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Or(e,t+1)!==115)break;case 6444:switch(Or(e,gi(e)-3-(~kE(e,"!important")&&10))){case 107:return vt(e,":",":"+yt)+e;case 101:return vt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+yt+(Or(e,14)===45?"inline-":"")+"box$3$1"+yt+"$2$3$1"+Lr+"$2box$3")+e}break;case 5936:switch(Or(e,t+11)){case 114:return yt+e+Lr+vt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return yt+e+Lr+vt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return yt+e+Lr+vt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return yt+e+Lr+e+e}return e}var a9e=function(t,n,r,a){if(t.length>-1&&!t.return)switch(t.type){case KP:t.return=YJ(t.value,t.length);break;case qJ:return Af([am(t,{value:vt(t.value,"@","@"+yt)})],a);case HP:if(t.length)return B8e(t.props,function(s){switch(z8e(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Af([am(t,{props:[vt(s,/:(read-\w+)/,":"+Uv+"$1")]})],a);case"::placeholder":return Af([am(t,{props:[vt(s,/:(plac\w+)/,":"+yt+"input-$1")]}),am(t,{props:[vt(s,/:(plac\w+)/,":"+Uv+"$1")]}),am(t,{props:[vt(s,/:(plac\w+)/,Lr+"input-$1")]})],a)}return""})}},s9e=[a9e],i9e=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var j=w.getAttribute("data-emotion");j.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var a=t.stylisPlugins||s9e,s={},o,l=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var j=w.getAttribute("data-emotion").split(" "),N=1;N<j.length;N++)s[j[N]]=!0;l.push(w)});var u,d=[n9e,r9e];{var h,p=[X8e,Z8e(function(w){h.insert(w)})],g=Q8e(d.concat(a,p)),x=function(j){return Af(W8e(j),g)};u=function(j,N,k,S){h=k,x(j?j+"{"+N.styles+"}":N.styles),S&&(y.inserted[N.name]=!0)}}var y={key:n,sheet:new M8e({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:s,registered:{},insert:u};return y.sheet.hydrate(l),y},K5,tz;function o9e(){if(tz)return K5;tz=1;var e=xW(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[e.ForwardRef]=r,s[e.Memo]=a;function o(y){return e.isMemo(y)?a:s[y.$$typeof]||t}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,g=Object.prototype;
2878function x(y,w,j){if(typeof w!="string"){if(g){var N=p(w);N&&N!==g&&x(y,N,j)}var k=u(w);d&&(k=k.concat(d(w)));for(var S=o(y),E=o(w),O=0;O<k.length;++O){var T=k[O];if(!n[T]&&!(j&&j[T])&&!(E&&E[T])&&!(S&&S[T])){var P=h(w,T);try{l(y,T,P)}catch{}}}}return y}return K5=x,K5}o9e();var l9e=!0;function XJ(e,t,n){var r="";return n.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(r+=a+" ")}),r}var GP=function(t,n,r){var a=t.key+"-"+n.name;(r===!1||l9e===!1)&&t.registered[a]===void 0&&(t.registered[a]=n.styles)},QJ=function(t,n,r){GP(t,n,r);var a=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+a:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function c9e(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var u9e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},d9e=/[A-Z]|^ms/g,f9e=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ZJ=function(t){return t.charCodeAt(1)===45},nz=function(t){return t!=null&&typeof t!="boolean"},V5=WJ(function(e){return ZJ(e)?e:e.replace(d9e,"-$&").toLowerCase()}),rz=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(f9e,function(r,a,s){return xi={name:a,styles:s,next:xi},a})}return u9e[t]!==1&&!ZJ(t)&&typeof n=="number"&&n!==0?n+"px":n};function gg(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var a=n;if(a.anim===1)return xi={name:a.name,styles:a.styles,next:xi},a.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)xi={name:o.name,styles:o.styles,next:xi},o=o.next;var l=s.styles+";";return l}return h9e(e,t,n)}case"function":{if(e!==void 0){var u=xi,d=n(e);return xi=u,gg(e,t,d)}break}}var h=n;if(t==null)return h;var p=t[h];return p!==void 0?p:h}function h9e(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=gg(e,t,n[a])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var l=o;t!=null&&t[l]!==void 0?r+=s+"{"+t[l]+"}":nz(l)&&(r+=V5(s)+":"+rz(s,l)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var u=0;u<o.length;u++)nz(o[u])&&(r+=V5(s)+":"+rz(s,o[u])+";");else{var d=gg(e,t,o);switch(s){case"animation":case"animationName":{r+=V5(s)+":"+d+";";break}default:r+=s+"{"+d+"}"}}}return r}var az=/label:\s*([^\s;{]+)\s*(;|$)/g,xi;function Yw(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,a="";xi=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,a+=gg(n,t,s);else{var o=s;a+=o[0]}for(var l=1;l<e.length;l++)if(a+=gg(n,t,e[l]),r){var u=s;a+=u[l]}az.lastIndex=0;for(var d="",h;(h=az.exec(a))!==null;)d+="-"+h[1];var p=c9e(a)+d;return{name:p,styles:a,next:xi}}var p9e=function(t){return t()},m9e=Pm.useInsertionEffect?Pm.useInsertionEffect:!1,JJ=m9e||p9e,eee=v.createContext(typeof HTMLElement<"u"?i9e({key:"css"}):null);eee.Provider;var tee=function(t){return v.forwardRef(function(n,r){var a=v.useContext(eee);return t(n,a,r)})},WP=v.createContext({}),YP={}.hasOwnProperty,CE="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",g9e=function(t,n){var r={};for(var a in n)YP.call(n,a)&&(r[a]=n[a]);return r[CE]=t,r},x9e=function(t){var n=t.cache,r=t.serialized,a=t.isStringTag;return GP(n,r,a),JJ(function(){return QJ(n,r,a)}),null},b9e=tee(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var a=e[CE],s=[r],o="";typeof e.className=="string"?o=XJ(t.registered,s,e.className):e.className!=null&&(o=e.className+" ");var l=Yw(s,void 0,v.useContext(WP));o+=t.key+"-"+l.name;var u={};for(var d in e)YP.call(e,d)&&d!=="css"&&d!==CE&&(u[d]=e[d]);return u.className=o,n&&(u.ref=n),v.createElement(v.Fragment,null,v.createElement(x9e,{cache:t,serialized:l,isStringTag:typeof a=="str
2878ing"}),v.createElement(a,u))}),y9e=b9e,sz=function(t,n){var r=arguments;if(n==null||!YP.call(n,"css"))return v.createElement.apply(void 0,r);var a=r.length,s=new Array(a);s[0]=y9e,s[1]=g9e(t,n);for(var o=2;o<a;o++)s[o]=r[o];return v.createElement.apply(null,s)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(sz||(sz={}));function XP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Yw(t)}function ax(){var e=XP.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var v9e=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,w9e=WJ(function(e){return v9e.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),j9e=w9e,N9e=function(t){return t!=="theme"},iz=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?j9e:N9e},oz=function(t,n,r){var a;if(n){var s=n.shouldForwardProp;a=t.__emotion_forwardProp&&s?function(o){return t.__emotion_forwardProp(o)&&s(o)}:s}return typeof a!="function"&&r&&(a=t.__emotion_forwardProp),a},_9e=function(t){var n=t.cache,r=t.serialized,a=t.isStringTag;return GP(n,r,a),JJ(function(){return QJ(n,r,a)}),null},k9e=function e(t,n){var r=t.__emotion_real===t,a=r&&t.__emotion_base||t,s,o;n!==void 0&&(s=n.label,o=n.target);var l=oz(t,n,r),u=l||iz(a),d=!u("as");return function(){var h=arguments,p=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(s!==void 0&&p.push("label:"+s+";
2878"),h[0]==null||h[0].raw===void 0)p.push.apply(p,h);else{var g=h[0];p.push(g[0]);for(var x=h.length,y=1;y<x;y++)p.push(h[y],g[y])}var w=tee(function(j,N,k){var S=d&&j.as||a,E="",O=[],T=j;if(j.theme==null){T={};for(var P in j)T[P]=j[P];T.theme=v.useContext(WP)}typeof j.className=="string"?E=XJ(N.registered,O,j.className):j.className!=null&&(E=j.className+" ");var M=Yw(p.concat(O),N.registered,T);E+=N.key+"-"+M.name,o!==void 0&&(E+=" "+o);var D=d&&l===void 0?iz(S):u,A={};for(var L in j)d&&L==="as"||D(L)&&(A[L]=j[L]);return A.className=E,k&&(A.ref=k),v.createElement(v.Fragment,null,v.createElement(_9e,{cache:N,serialized:M,isStringTag:typeof S=="string"}),v.createElement(S,A))});return w.displayName=s!==void 0?s:"Styled("+(typeof a=="string"?a:a.displayName||a.name||"Component")+")",w.defaultProps=t.defaultProps,w.__emotion_real=w,w.__emotion_base=a,w.__emotion_styles=p,w.__emotion_forwardProp=l,Object.defineProperty(w,"toString",{value:function(){return"."+o}}),w.withComponent=function(j,N){var k=e(j,Bv({},n,N,{shouldForwardProp:oz(w,N,!0)}));return k.apply(void 0,p)},w}},S9e=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],EE=k9e.bind(null);S9e.forEach(function(e){EE[e]=EE(e)});function nee(e,t){return EE(e,t)}function C9e(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const lz=[];function vu(e){return lz[0]=e,Yw(lz)}var G5={exports:{}},Rt={};/** 2879 * @license React 2880 * react-is.production.js 2881 * 2882 * Copyright (c) Meta Platforms, Inc. and affiliates. 2883 * 2884 * This source code is licensed under the MIT license found in the 2885 * LICENSE file in the root directory of this source tree. 2886 */var cz;function E9e(){if(cz)return Rt;cz=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function y(w){if(typeof w=="object"&&w!==null){var j=w.$$typeof;switch(j){case e:switch(w=w.type,w){case n:case a:case r:case u:case d:case g:return w;default:switch(w=w&&w.$$typeof,w){case o:case l:case p:case h:return w;case s:return w;default:return j}}case t:return j}}}return Rt.ContextConsumer=s,Rt.ContextProvider=o,Rt.Element=e,Rt.ForwardRef=l,Rt.Fragment=n,Rt.Lazy=p,Rt.Memo=h,Rt.Portal=t,Rt.Profiler=a,Rt.StrictMode=r,Rt.Suspense=u,Rt.SuspenseList=d,Rt.isContextConsumer=function(w){return y(w)===s},Rt.isContextProvider=function(w){return y(w)===o},Rt.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Rt.isForwardRef=function(w){return y(w)===l},Rt.isFragment=function(w){return y(w)===n},Rt.isLazy=function(w){return y(w)===p},Rt.isMemo=function(w){return y(w)===h},Rt.isPortal=function(w){return y(w)===t},Rt.isProfiler=function(w){return y(w)===a},Rt.isStrictMode=function(w){return y(w)===r},Rt.isSuspense=function(w){return y(w)===u},Rt.isSuspenseList=function(w){return y(w)===d},Rt.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===a||w===r||w===u||w===d||typeof w=="object"&&w!==null&&(w.$$typeof===p||w.$$typeof===h||w.$$typeof===o||w.$$typeof===s||w.$$typeof===l||w.$$typeof===x||w.getModuleId!==void 0)},Rt.typeOf=y,Rt}var uz;function O9e(){return uz||(uz=1,G5.exports=E9e()),G5.exports}var ree=O9e();function wi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);
2886return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function aee(e){if(v.isValidElement(e)||ree.isValidElementType(e)||!wi(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=aee(e[n])}),t}function Za(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return wi(e)&&wi(t)&&Object.keys(t).forEach(a=>{v.isValidElement(t[a])||ree.isValidElementType(t[a])?r[a]=t[a]:wi(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&wi(e[a])?r[a]=Za(e[a],t[a],n):n.clone?r[a]=wi(t[a])?aee(t[a]):t[a]:r[a]=t[a]}),r}const A9e=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function T9e(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...a}=e,s=A9e(t),o=Object.keys(s);function l(g){return`@media (min-width:${typeof t[g]=="number"?t[g]:g}${n})`}function u(g){return`@media (max-width:${(typeof t[g]=="number"?t[g]:g)-r/100}${n})`}function d(g,x){const y=o.indexOf(x);return`@media (min-width:${typeof t[g]=="number"?t[g]:g}${n}) and (max-width:${(y!==-1&&typeof t[o[y]]=="number"?t[o[y]]:x)-r/100}${n})`}function h(g){return o.indexOf(g)+1<o.length?d(g,o[o.indexOf(g)+1]):l(g)}function p(g){const x=o.indexOf(g);return x===0?l(o[1]):x===o.length-1?u(o[x]):d(g,o[o.indexOf(g)+1]).replace("@media","@media not all and")}return{keys:o,values:s,up:l,down:u,between:d,only:h,not:p,unit:n,...a}}function dz(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,a)=>{const s=/min-width:\s*([0-9.]+)/;return+(r.match(s)?.[1]||0)-+(a.match(s)?.[1]||0)});return n.length?n.reduce((r,a)=>{const s=t[a];return delete r[a],r[a]=s,r},{...t}):t}function P9e(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function R9e(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,a]=n,s=Number.isNaN(+r)?r||0:+r;return e.containerQueries(a).up(s)}function M9e(e){const t=(s,o)=>s.replace("@media",o?`@container ${o}`:"@container");function n(s,o){s.up=(...l)=>t(e.breakpoints.up(...l),o),s.down=(...l)=>t(e.breakpoints.down(...l),o),s.between=(...l)=>t(e.breakpoints.between(...l),o),s.only=(...l)=>t(e.breakpoints.only(...l),o),s.not=(...l)=>{const u=t(e.breakpoints.not(...l),o);return u.includes("not all and")?u.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):u}}const r={},a=s=>(n(r,s),r);return n(a),{...e,containerQueries:a}}const D9e={borderRadius:4};function Tm(e,t){return t?Za(e,t,{clone:!1}):e}const Xw={xs:0,sm:600,md:900,lg:1200,xl:1536},fz={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Xw[e]}px)`},$9e={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Xw[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};
2886function Fo(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const s=r.breakpoints||fz;return t.reduce((o,l,u)=>(o[s.up(s.keys[u])]=n(t[u]),o),{})}if(typeof t=="object"){const s=r.breakpoints||fz;return Object.keys(t).reduce((o,l)=>{if(P9e(s.keys,l)){const u=R9e(r.containerQueries?r:$9e,l);u&&(o[u]=n(t[l],l))}else if(Object.keys(s.values||Xw).includes(l)){const u=s.up(l);o[u]=n(t[l],l)}else{const u=l;o[u]=t[u]}return o},{})}return n(t)}function I9e(e={}){return e.keys?.reduce((n,r)=>{const a=e.up(r);return n[a]={},n},{})||{}}function hz(e,t){return e.reduce((n,r)=>{const a=n[r];return(!a||Object.keys(a).length===0)&&delete n[r],n},t)}function Dn(e){if(typeof e!="string")throw new Error(Lu(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Qw(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((a,s)=>a&&a[s]?a[s]:null,e);if(r!=null)return r}return t.split(".").reduce((r,a)=>r&&r[a]!=null?r[a]:null,e)}function qv(e,t,n,r=n){let a;return typeof e=="function"?a=e(n):Array.isArray(e)?a=e[n]||r:a=Qw(e,n)||r,t&&(a=t(a,r,e)),a}function Bn(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:a}=e,s=o=>{if(o[t]==null)return null;const l=o[t],u=o.theme,d=Qw(u,r)||{};return Fo(o,l,p=>{let g=qv(d,a,p);return p===g&&typeof p=="string"&&(g=qv(d,a,`${t}${p==="default"?"":Dn(p)}`,p)),n===!1?g:{[n]:g}})};return s.propTypes={},s.filterProps=[t],s}function L9e(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const F9e={m:"margin",p:"padding"},z9e={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},pz={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},B9e=L9e(e=>{if(e.length>2)if(pz[e])e=pz[e];else return[e];const[t,n]=e.split(""),r=F9e[t],a=z9e[n]||"";return Array.isArray(a)?a.map(s=>r+s):[r+a]}),QP=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],ZP=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...QP,...ZP];function sx(e,t,n,r){const a=Qw(e,t,!0)??n;return typeof a=="number"||typeof a=="string"?s=>typeof s=="string"?s:typeof a=="string"?a.startsWith("var(")&&s===0?0:a.startsWith("var(")&&s===1?a:`calc(${s} * ${a})`:a*s:Array.isArray(a)?s=>{if(typeof s=="string")return s;const o=Math.abs(s),l=a[o];return s>=0?l:typeof l=="number"?-l:typeof l=="string"&&l.startsWith("var(")?`calc(-1 * ${l})`:`-${l}`}:typeof a=="function"?a:()=>{}}function JP(e){return sx(e,"spacing",8)}function ix(e,t){return typeof t=="string"||t==null?t:e(t)}function U9e(e,t){return n=>e.reduce((r,a)=>(r[a]=ix(t,n),r),{})}function q9e(e,t,n,r){if(!t.includes(n))return null;const a=B9e(n),s=U9e(a,r),o=e[n];return Fo(e,o,s)}function see(e,t){const n=JP(e.theme);return Object.keys(e).map(r=>q9e(e,t,r,n)).reduce(Tm,{})}function kn(e){return see(e,QP)}kn.propTypes={};kn.filterProps=QP;function Sn(e){return see(e,ZP)}Sn.propTypes={};Sn.filterProps=ZP;function iee(e=8,t=JP({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(s=>{const o=t(s);return typeof o=="number"?`${o}px`:o}).join(" ");return n.mui=!0,n}function Zw(...e){const t=e.reduce((r,a)=>(a.filterProps.forEach(s=>{r[s]=a}),r),{}),n=r=>Object.keys(r).reduce((a,s)=>t[s]?Tm(a,t[s](r)):a,{});return n.propTypes={},n.filterProps=e.reduce((r,a)=>r.concat(a.filterProps),[]),n}function ys(e){return typeof e!="number"?e:`${e}px solid`}function Is(e,t){return Bn({prop:e,themeKey:"borders",transform:t})}const H9e=Is("border",ys),K9e=Is("borderTop",ys),V9e=Is("borderRight",ys),G9e=Is("borderBottom",ys),W9e=Is("borderLeft",ys),Y9e=Is("borderColor"),X9e=Is("borderTopColor"),Q9e=Is("borderRightColor"),Z9e=Is("borderBottomColor"),J9e=Is("borderLeftColor"),e7e=Is("outline",ys),t7e=Is("outlineColor"),Jw=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=sx(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:ix(t,r)});return Fo(e,e.borderRadius,n)}return null};Jw.propTypes={};Jw.filterProps=["borderRadius"];Zw(H9e,K9e,V9e,G9e,W9e,Y9e,X9e,Q9e,Z9e,J9e,Jw,e7e,t7e);const ej=e=>{if(e.gap!==void 0&&e.gap!==null){const t=sx(e.theme,"spacing",8),n=r=>({gap:ix(t,r)});return Fo(e,e.gap,n)}return null};ej.propTypes={};ej.filterProps=["gap"];const tj=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=sx(e.theme,"spacing",8),n=r=>({columnGap:ix(t,r)});return Fo(e,e.columnGap,n)}return null};tj.propTypes={};tj.filterProps=["columnGap"];const nj=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=sx(e.theme,"spacing",8),n=r=>({rowGap:ix(t,r)});return Fo(e,e.rowGap,n)}return null};nj.propTypes={};nj.filterProps=["rowGap"];const n7e=Bn({prop:"gridColumn"}),r7e=Bn({prop:"gridRow"}),a7e=Bn({prop:"gridAutoFlow"}),s7e=Bn({prop:"gridAutoColumns"}),i7e=Bn({prop:"gridAutoRows"}),o7e=Bn({prop:"gridTemplateColumns"}
2886),l7e=Bn({prop:"gridTemplateRows"}),c7e=Bn({prop:"gridTemplateAreas"}),u7e=Bn({prop:"gridArea"});Zw(ej,tj,nj,n7e,r7e,a7e,s7e,i7e,o7e,l7e,c7e,u7e);function Tf(e,t){return t==="grey"?t:e}const d7e=Bn({prop:"color",themeKey:"palette",transform:Tf}),f7e=Bn({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Tf}),h7e=Bn({prop:"backgroundColor",themeKey:"palette",transform:Tf});Zw(d7e,f7e,h7e);function Ga(e){return e<=1&&e!==0?`${e*100}%`:e}const p7e=Bn({prop:"width",transform:Ga}),e3=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||Xw[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Ga(n)}};return Fo(e,e.maxWidth,t)}return null};e3.filterProps=["maxWidth"];const m7e=Bn({prop:"minWidth",transform:Ga}),g7e=Bn({prop:"height",transform:Ga}),x7e=Bn({prop:"maxHeight",transform:Ga}),b7e=Bn({prop:"minHeight",transform:Ga});Bn({prop:"size",cssProperty:"width",transform:Ga});Bn({prop:"size",cssProperty:"height",transform:Ga});const y7e=Bn({prop:"boxSizing"});Zw(p7e,e3,m7e,g7e,x7e,b7e,y7e);const ox={border:{themeKey:"borders",transform:ys},borderTop:{themeKey:"borders",transform:ys},borderRight:{themeKey:"borders",transform:ys},borderBottom:{themeKey:"borders",transform:ys},borderLeft:{themeKey:"borders",transform:ys},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ys},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Jw},color:{themeKey:"palette",transform:Tf},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Tf},backgroundColor:{themeKey:"palette",transform:Tf},p:{style:Sn},pt:{style:Sn},pr:{style:Sn},pb:{style:Sn},pl:{style:Sn},px:{style:Sn},py:{style:Sn},padding:{style:Sn},paddingTop:{style:Sn},paddingRight:{style:Sn},paddingBottom:{style:Sn},paddingLeft:{style:Sn},paddingX:{style:Sn},paddingY:{style:Sn},paddingInline:{style:Sn},paddingInlineStart:{style:Sn},paddingInlineEnd:{style:Sn},paddingBlock:{style:Sn},paddingBlockStart:{style:Sn},paddingBlockEnd:{style:Sn},m:{style:kn},mt:{style:kn},mr:{style:kn},mb:{style:kn},ml:{style:kn},mx:{style:kn},my:{style:kn},margin:{style:kn},marginTop:{style:kn},marginRight:{style:kn},marginBottom:{style:kn},marginLeft:{style:kn},marginX:{style:kn},marginY:{style:kn},marginInline:{style:kn},marginInlineStart:{style:kn},marginInlineEnd:{style:kn},marginBlock:{style:kn},marginBlockStart:{style:kn},marginBlockEnd:{style:kn},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:ej},rowGap:{style:nj},columnGap:{style:tj},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ga},maxWidth:{style:e3},minWidth:{transform:Ga},height:{transform:Ga},maxHeight:{transform:Ga},minHeight:{transform:Ga},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function v7e(...e){const t=e.reduce((r,a)=>r.concat(Object.keys(a)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function w7e(e,t){return typeof e=="function"?e(t):e}function j7e(){function e(n,r,a,s){const o={[n]:r,theme:a},l=s[n];if(!l)return{[n]:r};const{cssProperty:u=n,themeKey:d,transform:h,style:p}=l;if(r==null)return null;if(d==="typography"&&r==="inherit")return{[n]:r};const g=Qw(a,d)||{};return p?p(o):Fo(o,r,y=>{let w=qv(g,h,y);return y===w&&typeof y=="string"&&(w=qv(g,h,`${n}${y==="default"?"":Dn(y)}`,y)),u===!1?w:{[u]:w}})}function t(n){const{sx:r,theme:a={},nested:s}=n||{};if(!r)return null;const o=a.unstable_sxConfig??ox;function l(u){let d=u;if(typeof u=="function")d=u(a);else if(typeof u!="object")return u;if(!d)return null;const h=I9e(a.breakpoints),p=Object.keys(h);let g=h;
2886return Object.keys(d).forEach(x=>{const y=w7e(d[x],a);if(y!=null)if(typeof y=="object")if(o[x])g=Tm(g,e(x,y,a,o));else{const w=Fo({theme:a},y,j=>({[x]:j}));v7e(w,y)?g[x]=t({sx:y,theme:a,nested:!0}):g=Tm(g,w)}else g=Tm(g,e(x,y,a,o))}),!s&&a.modularCssLayers?{"@layer sx":dz(a,hz(p,g))}:dz(a,hz(p,g))}return Array.isArray(r)?r.map(l):l(r)}return t}const Fu=j7e();Fu.filterProps=["sx"];function N7e(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function t3(e={},...t){const{breakpoints:n={},palette:r={},spacing:a,shape:s={},...o}=e,l=T9e(n),u=iee(a);let d=Za({breakpoints:l,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:u,shape:{...D9e,...s}},o);return d=M9e(d),d.applyStyles=N7e,d=t.reduce((h,p)=>Za(h,p),d),d.unstable_sxConfig={...ox,...o?.unstable_sxConfig},d.unstable_sx=function(p){return Fu({sx:p,theme:this})},d}function _7e(e){return Object.keys(e).length===0}function k7e(e=null){const t=v.useContext(WP);return!t||_7e(t)?e:t}const S7e=t3();function C7e(e=S7e){return k7e(e)}const E7e=e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??ox;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function oee(e){const{sx:t,...n}=e,{systemProps:r,otherProps:a}=E7e(n);let s;return Array.isArray(t)?s=[r,...t]:typeof t=="function"?s=(...o)=>{const l=t(...o);return wi(l)?{...r,...l}:r}:s={...r,...t},{...a,sx:s}}const mz=e=>e,O7e=()=>{let e=mz;return{configure(t){e=t},generate(t){return e(t)},reset(){e=mz}}},lee=O7e();function A7e(e={}){const{themeId:t,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:a}=e,s=nee("div",{shouldForwardProp:l=>l!=="theme"&&l!=="sx"&&l!=="as"})(Fu);return v.forwardRef(function(u,d){const h=C7e(n),{className:p,component:g="div",...x}=oee(u);return i.jsx(s,{as:g,ref:d,className:Xe(p,a?a(r):r),theme:t&&h[t]||h,...x})})}const T7e={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function lx(e,t,n="Mui"){const r=T7e[t];return r?`${n}-${r}`:`${lee.generate(e)}-${t}`}function Ph(e,t,n="Mui"){const r={};return t.forEach(a=>{r[a]=lx(e,a,n)}),r}function cee(e){const{variants:t,...n}=e,r={variants:t,style:vu(n),isProcessed:!0};return r.style===n||t&&t.forEach(a=>{typeof a.style!="function"&&(a.style=vu(a.style))}),r}const P7e=t3();function W5(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function iu(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function R7e(e){return e?(t,n)=>n[e]:null}function M7e(e,t,n){e.theme=I7e(e.theme)?n:e.theme[t]||e.theme}function sy(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(a=>sy(e,a,n));if(Array.isArray(r?.variants)){let a;if(r.isProcessed)a=n?iu(r.style,n):r.style;else{const{variants:s,...o}=r;a=n?iu(vu(o),n):o}return uee(e,r.variants,[a],n)}return r?.isProcessed?n?iu(vu(r.style),n):r.style:n?iu(vu(r),n):r}function uee(e,t,n=[],r=void 0){let a;e:for(let s=0;s<t.length;s+=1){const o=t[s];if(typeof o.props=="function"){if(a??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(a))continue}else for(const l in o.props)if(e[l]!==o.props[l]&&e.ownerState?.[l]!==o.props[l])continue e;typeof o.style=="function"?(a??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?iu(vu(o.style(a)),r):o.style(a))):n.push(r?iu(vu(o.style),r):o.style)}return n}function D7e(e={}){const{themeId:t,defaultTheme:n=P7e,rootShouldForwardProp:r=W5,slotShouldForwardProp:a=W5}=e;function s(l){M7e(l,t,n)}return(l,u={})=>{C9e(l,T=>T.filter(P=>P!==Fu));const{name:d,slot:h,skipVariantsResolver:p,skipSx:g,overridesResolver:x=R7e(F7e(h)),...y}=u,w=d&&d.startsWith("Mui")||h?"components":"custom",j=p!==void 0?p:h&&h!=="Root"&&h!=="root"||!1,N=g||!1;let k=W5;h==="Root"||h==="root"?k=r:h?k=a:L7e(l)&&(k=void 0);const S=nee(l,{shouldForwardProp:k,label:$7e(),...y}),E=T=>{if(T.__emotion_real===T)return T;if(typeof T=="function")return function(M){return sy(M,T,M.theme.modularCssLayers?w:void 0)};if(wi(T)){const P=cee(T);return function(D){return P.variants?sy(D,P,D.theme.modularCssLayers?w:void 0):D.theme.modularCssLayers?iu(P.style,w):P.style}}return T},O=(...T)=>{const P=[],M=T.map(E),D=[];if(P.push(s),d&&x&&D.push(function(B){const z=B.theme.components?.[d]?.styleOverrides;if(!z)return null;const $={};for(const K in z)$[K]=sy(B,z[K],B.theme.modularCssLayers?"theme":void 0);return x(B,$)}),d&&!j&&D.push(function(B){const z=B.theme?.components?.[d]?.variants;return z?uee(B,z,[],B.theme.modularCssLayers?"theme":void 0):null}),N||D.push(Fu),Array.isArray(M[0])){const F=M.shift(),B=new Array(P.length).fill(""),U=new Array(D.length).fill("");let z;z=[...B,...F,...U],z.raw=[...B,...F.raw,...U],P.unshift(z)}const A=[...P,...M,...D],L=S(...A);return l.muiName&&(L.muiName=l.muiName),L};return S.withConfig&&(O.withConfig=S.withConfig),O}}function $7e(e,t){return void 0}function I7e(e){for(const t in e)return!1;return!0}function L7e(e){return typeof e=="string"&&e.charCodeAt(0)>96}function F7e(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Hv(e,t,n=!1){const r={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const s=a;if(s==="components"||s==="slots")r[s]={...e[s],...r[s]};else if(s==="componentsProps"||s==="slotProps"){const o=e[s],l=t[s];if(!l)r[s]=o||{};else if(!o)r[s]=l;else{r[s]={...l};for(const u in o)if(Object.prototype.hasOwnProperty.call(o,u)){const d=u;r[s][d]=Hv(o[d],l[d],n)}}}else s==="className"&&n&&t.className?r.className=Xe(e?.className,t?.className):s==="style"&&n&&t.style?r.style={...e?.style,...t?.style}:r[s]===void 0&&(r[s]=e[s])}return r}const z7e=typeof window<"u"?v.useLayoutEffect:v.useEffect;function B7e(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function n3(e,t=0,n=1){return B7e(e,t,n)}function U7e(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,a)=>a<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function nc(e){if(e.type)return e;if(e.charAt(0)==="#")return nc(U7e(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(Lu(9,e));let r=e.substring(t+1,e.length-1),a;if(n==="color"){if(r=r.split(" "),a=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(Lu(10,a))}else r=r.split(",");return r=r.map(s=>parseFloat(s)),{type:n,values:r,colorSpace:a}}const q7e=e=>{const t=nc(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},ym=(e,t)=>{try{return q7e(e)}catch{return e}};function rj(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((a,s)=>s<3?parseInt(a,10):a):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n}
2886 ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function dee(e){e=nc(e);const{values:t}=e,n=t[0],r=t[1]/100,a=t[2]/100,s=r*Math.min(a,1-a),o=(d,h=(d+n/30)%12)=>a-s*Math.max(Math.min(h-3,9-h,1),-1);let l="rgb";const u=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type==="hsla"&&(l+="a",u.push(t[3])),rj({type:l,values:u})}function OE(e){e=nc(e);let t=e.type==="hsl"||e.type==="hsla"?nc(dee(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function H7e(e,t){const n=OE(e),r=OE(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function cf(e,t){return e=nc(e),t=n3(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,rj(e)}function R0(e,t,n){try{return cf(e,t)}catch{return e}}function r3(e,t){if(e=nc(e),t=n3(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return rj(e)}function Lt(e,t,n){try{return r3(e,t)}catch{return e}}function a3(e,t){if(e=nc(e),t=n3(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return rj(e)}function Ft(e,t,n){try{return a3(e,t)}catch{return e}}function K7e(e,t=.15){return OE(e)>.5?r3(e,t):a3(e,t)}function M0(e,t,n){try{return K7e(e,t)}catch{return e}}const V7e=v.createContext(void 0);function G7e(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const a=t.components[n];return a.defaultProps?Hv(a.defaultProps,r,t.components.mergeClassNameAndStyle):!a.styleOverrides&&!a.variants?Hv(a,r,t.components.mergeClassNameAndStyle):r}function W7e({props:e,name:t}){const n=v.useContext(V7e);return G7e({props:e,name:t,theme:{components:n}})}let gz=0;function Y7e(e){const[t,n]=v.useState(e),r=e||t;return v.useEffect(()=>{t==null&&(gz+=1,n(`mui-${gz}`))},[t]),r}const X7e={...Pm},xz=X7e.useId;function Q7e(e){if(xz!==void 0){const t=xz();return e??t}return Y7e(e)}const bz={theme:void 0};function Z7e(e){let t,n;return function(a){let s=t;return(s===void 0||a.theme!==n)&&(bz.theme=a.theme,s=cee(e(bz)),t=s,n=a.theme),s}}function J7e(e=""){function t(...r){if(!r.length)return"";const a=r[0];return typeof a=="string"&&!a.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${a}${t(...r.slice(1))})`:`, ${a}`}return(r,...a)=>`var(--${e?`${e}-`:""}${r}${t(...a)})`}const yz=(e,t,n,r=[])=>{let a=e;t.forEach((s,o)=>{o===t.length-1?Array.isArray(a)?a[Number(s)]=n:a&&typeof a=="object"&&(a[s]=n):a&&typeof a=="object"&&(a[s]||(a[s]=r.includes(s)?[]:{}),a=a[s])})},eFe=(e,t,n)=>{function r(a,s=[],o=[]){Object.entries(a).forEach(([l,u])=>{(!n||n&&!n([...s,l]))&&u!=null&&(typeof u=="object"&&Object.keys(u).length>0?r(u,[...s,l],Array.isArray(u)?[...o,l]:o):t([...s,l],u,o))})}r(e)},tFe=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Y5(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},a={},s={},o={};return eFe(e,(l,u,d)=>{if((typeof u=="string"||typeof u=="number")&&(!r||!r(l,u))){const h=`--${n?`${n}-`:""}${l.join("-")}`,p=tFe(l,u);Object.assign(a,{[h]:p}),yz(s,l,`var(${h})`,d),yz(o,l,`var(${h}, ${p})`,d)}},l=>l[0]==="vars"),{css:a,vars:s,varsWithDefaults:o}}function nFe(e,t={}){const{getSelector:n=j,disableCssColorScheme:r,colorSchemeSelector:a}=t,{colorSchemes:s={},components:o,defaultColorScheme:l="light",...u}=e,{vars:d,css:h,varsWithDefaults:p}=Y5(u,t);let g=p;const x={},{[l]:y,...w}=s;if(Object.entries(w||{}).forEach(([S,E])=>{const{vars:O,css:T,varsWithDefaults:P}=Y5(E,t);g=Za(g,P),x[S]={css:T,vars:O}}),y){const{css:S,vars:E,varsWithDefaults:O}=Y5(y,t);g=Za(g,O),x[l]={css:S,vars:E}}function j(S,E){let O=a;if(a==="class"&&(O=".%s"),a==="data"&&(O="[data-%s]"),a?.startsWith("data-")&&!a.includes("%s")&&(O=`[${a}="%s"]`),S){if(O==="media")return e.defaultColorScheme===S?":root":{[`@media (prefers-color-scheme: ${s[S]?.palette?.mode||S})`]:{":root":E}};if(O)return e.defaultColorScheme===S?`:root, ${O.replace("%s",String(S))}`:O.replace("%s",String(S))}return":root"}
2886return{vars:g,generateThemeVars:()=>{let S={...d};return Object.entries(x).forEach(([,{vars:E}])=>{S=Za(S,E)}),S},generateStyleSheets:()=>{const S=[],E=e.defaultColorScheme||"light";function O(M,D){Object.keys(D).length&&S.push(typeof M=="string"?{[M]:{...D}}:M)}O(n(void 0,{...h}),h);const{[E]:T,...P}=x;if(T){const{css:M}=T,D=s[E]?.palette?.mode,A=!r&&D?{colorScheme:D,...M}:{...M};O(n(E,{...A}),A)}return Object.entries(P).forEach(([M,{css:D}])=>{const A=s[M]?.palette?.mode,L=!r&&A?{colorScheme:A,...D}:{...D};O(n(M,{...L}),L)}),S}}}function rFe(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}function aj(e,t,n=void 0){const r={};for(const a in e){const s=e[a];let o="",l=!0;for(let u=0;u<s.length;u+=1){const d=s[u];d&&(o+=(l===!0?"":" ")+t(d),l=!1,n&&n[d]&&(o+=" "+n[d]))}r[a]=o}return r}function fee(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:hg.white,default:hg.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const aFe=fee();function hee(){return{text:{primary:hg.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:hg.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const vz=hee();function wz(e,t,n,r){const a=r.light||r,s=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=a3(e.main,a):t==="dark"&&(e.dark=r3(e.main,s)))}function sFe(e="light"){return e==="dark"?{main:rf[200],light:rf[50],dark:rf[400]}:{main:rf[700],light:rf[400],dark:rf[800]}}function iFe(e="light"){return e==="dark"?{main:nf[200],light:nf[50],dark:nf[400]}:{main:nf[500],light:nf[300],dark:nf[700]}}function oFe(e="light"){return e==="dark"?{main:tf[500],light:tf[300],dark:tf[700]}:{main:tf[700],light:tf[400],dark:tf[800]}}function lFe(e="light"){return e==="dark"?{main:af[400],light:af[300],dark:af[700]}:{main:af[700],light:af[500],dark:af[900]}}function cFe(e="light"){return e==="dark"?{main:sf[400],light:sf[300],dark:sf[700]}:{main:sf[800],light:sf[500],dark:sf[900]}}function uFe(e="light"){return e==="dark"?{main:rm[400],light:rm[300],dark:rm[700]}:{main:"#ed6c02",light:rm[500],dark:rm[900]}}function s3(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...a}=e,s=e.primary||sFe(t),o=e.secondary||iFe(t),l=e.error||oFe(t),u=e.info||lFe(t),d=e.success||cFe(t),h=e.warning||uFe(t);function p(w){return H7e(w,vz.text.primary)>=n?vz.text.primary:aFe.text.primary}const g=({color:w,name:j,mainShade:N=500,lightShade:k=300,darkShade:S=700})=>{if(w={...w},!w.main&&w[N]&&(w.main=w[N]),!w.hasOwnProperty("main"))throw new Error(Lu(11,j?` (${j})`:"",N));if(typeof w.main!="string")throw new Error(Lu(12,j?` (${j})`:"",JSON.stringify(w.main)));return wz(w,"light",k,r),wz(w,"dark",S,r),w.contrastText||(w.contrastText=p(w.main)),w};let x;return t==="light"?x=fee():t==="dark"&&(x=hee()),Za({common:{...hg},mode:t,primary:g({color:s,name:"primary"}),secondary:g({color:o,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:g({color:l,name:"error"}),warning:g({color:h,name:"warning"}),info:g({color:u,name:"info"}),success:g({color:d,name:"success"}),grey:T8e,contrastThreshold:n,getContrastText:p,augmentColor:g,tonalOffset:r,...x},a)}function dFe(e){const t={};return Object.entries(e).forEach(r=>{const[a,s]=r;typeof s=="object"&&(t[a]=`${s.fontStyle?`${s.fontStyle} `:""}${s.fontVariant?`${s.fontVariant} `:""}${s.fontWeight?`${s.fontWeight} `:""}${s.fontStretch?`${s.fontStretch} `:""}${s.fontSize||""}${s.lineHeight?`/${s.lineHeight} `:""}${s.fontFamily||""}`)}),t}function fFe(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function hFe(e){return Math.round(e*1e5)/1e5}const jz={textTransform:"uppercase"},Nz='"Roboto", "Helvetica", "Arial", sans-serif';function pFe(e,t){const{fontFamily:n=Nz,fontSize:r=14,fontWeightLight:a=300,fontWeightRegular:s=400,fontWeightMedium:o=500,fontWeightBold:l
2886=700,htmlFontSize:u=16,allVariants:d,pxToRem:h,...p}=typeof t=="function"?t(e):t,g=r/14,x=h||(j=>`${j/u*g}rem`),y=(j,N,k,S,E)=>({fontFamily:n,fontWeight:j,fontSize:x(N),lineHeight:k,...n===Nz?{letterSpacing:`${hFe(S/N)}em`}:{},...E,...d}),w={h1:y(a,96,1.167,-1.5),h2:y(a,60,1.2,-.5),h3:y(s,48,1.167,0),h4:y(s,34,1.235,.25),h5:y(s,24,1.334,0),h6:y(o,20,1.6,.15),subtitle1:y(s,16,1.75,.15),subtitle2:y(o,14,1.57,.1),body1:y(s,16,1.5,.15),body2:y(s,14,1.43,.15),button:y(o,14,1.75,.4,jz),caption:y(s,12,1.66,.4),overline:y(s,12,2.66,1,jz),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Za({htmlFontSize:u,pxToRem:x,fontFamily:n,fontSize:r,fontWeightLight:a,fontWeightRegular:s,fontWeightMedium:o,fontWeightBold:l,...w},p,{clone:!1})}const mFe=.2,gFe=.14,xFe=.12;function un(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${mFe})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${gFe})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${xFe})`].join(",")}const bFe=["none",un(0,2,1,-1,0,1,1,0,0,1,3,0),un(0,3,1,-2,0,2,2,0,0,1,5,0),un(0,3,3,-2,0,3,4,0,0,1,8,0),un(0,2,4,-1,0,4,5,0,0,1,10,0),un(0,3,5,-1,0,5,8,0,0,1,14,0),un(0,3,5,-1,0,6,10,0,0,1,18,0),un(0,4,5,-2,0,7,10,1,0,2,16,1),un(0,5,5,-3,0,8,10,1,0,3,14,2),un(0,5,6,-3,0,9,12,1,0,3,16,2),un(0,6,6,-3,0,10,14,1,0,4,18,3),un(0,6,7,-4,0,11,15,1,0,4,20,3),un(0,7,8,-4,0,12,17,2,0,5,22,4),un(0,7,8,-4,0,13,19,2,0,5,24,4),un(0,7,9,-4,0,14,21,2,0,5,26,4),un(0,8,9,-5,0,15,22,2,0,6,28,5),un(0,8,10,-5,0,16,24,2,0,6,30,5),un(0,8,11,-5,0,17,26,2,0,6,32,5),un(0,9,11,-5,0,18,28,2,0,7,34,6),un(0,9,12,-6,0,19,29,2,0,7,36,6),un(0,10,13,-6,0,20,31,3,0,8,38,7),un(0,10,13,-6,0,21,33,3,0,8,40,7),un(0,10,14,-6,0,22,35,3,0,8,42,7),un(0,11,14,-7,0,23,36,3,0,9,44,8),un(0,11,15,-7,0,24,38,3,0,9,46,8)],yFe={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},vFe={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function _z(e){return`${Math.round(e)}ms`}function wFe(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function jFe(e){const t={...yFe,...e.easing},n={...vFe,...e.duration};return{getAutoHeightDuration:wFe,create:(a=["all"],s={})=>{const{duration:o=n.standard,easing:l=t.easeInOut,delay:u=0,...d}=s;return(Array.isArray(a)?a:[a]).map(h=>`${h} ${typeof o=="string"?o:_z(o)} ${l} ${typeof u=="string"?u:_z(u)}`).join(",")},...e,easing:t,duration:n}}const NFe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function _Fe(e){return wi(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function pee(e={}){const t={...e};function n(r){const a=Object.entries(r);for(let s=0;s<a.length;s++){const[o,l]=a[s];!_Fe(l)||o.startsWith("unstable_")?delete r[o]:wi(l)&&(r[o]={...l},n(r[o]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles'; 2887 2888const theme = ${JSON.stringify(t,null,2)}; 2889 2890theme.breakpoints = createBreakpoints(theme.breakpoints || {}); 2891theme.transitions = createTransitions(theme.transitions || {}); 2892 2893export default theme;`}function AE(e={},...t){const{breakpoints:n,mixins:r={},spacing:a,palette:s={},transitions:o={},typography:l={},shape:u,...d}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(Lu(20));const h=s3(s),p=t3(e);let g=Za(p,{mixins:fFe(p.breakpoints,r),palette:h,shadows:bFe.slice(),typography:pFe(h,l),transitions:jFe(o),zIndex:{...NFe}});return g=Za(g,d),g=t.reduce((x,y)=>Za(x,y),g),g.unstable_sxConfig={...ox,...d?.unstable_sxConfig},g.unstable_sx=function(y){return Fu({sx:y,theme:this})},g.toRuntimeSource=pee,g}function kFe(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const SFe=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=kFe(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function mee(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function gee(e){return e==="dark"?SFe:[]}function CFe(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...a}=e,s=s3(t);return{palette:s,opacity:{...mee(s.mode),...n},overlays:r||gee(s.mode),...a}}function EFe(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const OFe=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],AFe=e=>(t,n)=>{const r=e.rootSelector||":root",a=e.colorSchemeSelector;let s=a;if(a==="class"&&(s=".%s"),a==="data"&&(s="[data-%s]"),a?.startsWith("data-")&&!a.includes("%s")&&(s=`[${a}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const o={};
2893return OFe(e.cssVarPrefix).forEach(l=>{o[l]=n[l],delete n[l]}),s==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:o}}:s?{[s.replace("%s",t)]:o,[`${r}, ${s.replace("%s",t)}`]:n}:{[r]:{...n,...o}}}if(s&&s!=="media")return`${r}, ${s.replace("%s",String(t))}`}else if(t){if(s==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(s)return s.replace("%s",String(t))}return r};function TFe(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function de(e,t,n){!e[t]&&n&&(e[t]=n)}function vm(e){return typeof e!="string"||!e.startsWith("hsl")?e:dee(e)}function co(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ym(vm(e[t])))}function PFe(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const pi=e=>{try{return e()}catch{}},RFe=(e="mui")=>J7e(e);function X5(e,t,n,r){if(!t)return;t=t===!0?{}:t;const a=r==="dark"?"dark":"light";if(!n){e[r]=CFe({...t,palette:{mode:a,...t?.palette}});return}const{palette:s,...o}=AE({...n,palette:{mode:a,...t?.palette}});return e[r]={...t,palette:s,opacity:{...mee(a),...t?.opacity},overlays:t?.overlays||gee(a)},o}function MFe(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:a=!1,cssVarPrefix:s="mui",shouldSkipGeneratingVar:o=EFe,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:u=":root",...d}=e,h=Object.keys(n)[0],p=r||(n.light&&h!=="light"?"light":h),g=RFe(s),{[p]:x,light:y,dark:w,...j}=n,N={...j};let k=x;if((p==="dark"&&!("dark"in n)||p==="light"&&!("light"in n))&&(k=!0),!k)throw new Error(Lu(21,p));const S=X5(N,k,d,p);y&&!N.light&&X5(N,y,void 0,"light"),w&&!N.dark&&X5(N,w,void 0,"dark");let E={defaultColorScheme:p,...S,cssVarPrefix:s,colorSchemeSelector:l,rootSelector:u,getCssVar:g,colorSchemes:N,font:{...dFe(S.typography),...S.font},spacing:PFe(d.spacing)};Object.keys(E.colorSchemes).forEach(D=>{const A=E.colorSchemes[D].palette,L=F=>{const B=F.split("-"),U=B[1],z=B[2];return g(F,A[U][z])};if(A.mode==="light"&&(de(A.common,"background","#fff"),de(A.common,"onBackground","#000")),A.mode==="dark"&&(de(A.common,"background","#000"),de(A.common,"onBackground","#fff")),TFe(A,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),A.mode==="light"){de(A.Alert,"errorColor",Lt(A.error.light,.6)),de(A.Alert,"infoColor",Lt(A.info.light,.6)),de(A.Alert,"successColor",Lt(A.success.light,.6)),de(A.Alert,"warningColor",Lt(A.warning.light,.6)),de(A.Alert,"errorFilledBg",L("palette-error-main")),de(A.Alert,"infoFilledBg",L("palette-info-main")),de(A.Alert,"successFilledBg",L("palette-success-main")),de(A.Alert,"warningFilledBg",L("palette-warning-main")),de(A.Alert,"errorFilledColor",pi(()=>A.getContrastText(A.error.main))),de(A.Alert,"infoFilledColor",pi(()=>A.getContrastText(A.info.main))),de(A.Alert,"successFilledColor",pi(()=>A.getContrastText(A.success.main))),de(A.Alert,"warningFilledColor",pi(()=>A.getContrastText(A.warning.main))),de(A.Alert,"errorStandardBg",Ft(A.error.light,.9)),de(A.Alert,"infoStandardBg",Ft(A.info.light,.9)),de(A.Alert,"successStandardBg",Ft(A.success.light,.9)),de(A.Alert,"warningStandardBg",Ft(A.warning.light,.9)),de(A.Alert,"errorIconColor",L("palette-error-main")),de(A.Alert,"infoIconColor",L("palette-info-main")),de(A.Alert,"successIconColor",L("palette-success-main")),de(A.Alert,"warningIconColor",L("palette-warning-main")),de(A.AppBar,"defaultBg",L("palette-grey-100")),de(A.Avatar,"defaultBg",L("palette-grey-400")),de(A.Button,"inheritContainedBg",L("palette-grey-300")),de(A.Button,"inheritContainedHoverBg",L("palette-grey-A100")),de(A.Chip,"defaultBorder",L("palette-grey-400")),de(A.Chip,"defaultAvatarColor",L("palette-grey-700")),de(A.Chip,"defaultIconColor",L("palette-grey-700")),de(A.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),de(A.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),de(A.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),de(A.LinearProgress,"primaryBg",Ft(A.primary.main,.62)),de(A.LinearProgress,"secondaryBg",Ft(A.secondary.main,.62)),de(A.LinearProgress,"errorBg",Ft(A.error.main,.62)),de(A.LinearProgress,"infoBg",Ft(A.info.main,.62)),de(A.LinearProgress,"successBg",Ft(A.success.main,.62)),de(A.LinearProgress,"warningBg",Ft(A.warning.main,.62)),de(A.Skeleton,"bg",`rgba(${L("palette-text-primaryChannel")} / 0.11)`),de(A.Slider,"primaryTrack",Ft(A.primary.main,.62)),de(A.Slider,"secondaryTrack",Ft(A.secondary.main,.62)),de(A.Slider,"errorTrack",Ft(A.error.main,.62)),de(A.Slider,"infoTrack",Ft(A.info.main,.62)),de(A.Slider,"successTrack",Ft(A.success.main,.62)),de(A.Slider,"warningTrack",Ft(A.warning.main,.62));const F=M0(A.background.default,.8);de(A.SnackbarContent,"bg",F),de(A.SnackbarContent,"color",pi(()=>A.getContrastText(F))),de(A.SpeedDialAction,"fabHoverBg",M0(A.background.paper,.15)),de(A.StepConnector,"border",L("palette-grey-400")),de(A.StepContent,"border",L("palette-grey-400")),de(A.Switch,"defaultColor",L("palette-common-white")),de(A.Switch,"defaultDisabledColor",L("palette-grey-100")),de(A.Switch,"primaryDisabledColor",Ft(A.primary.main,.62)),de(A.Switch,"secondary
2893DisabledColor",Ft(A.secondary.main,.62)),de(A.Switch,"errorDisabledColor",Ft(A.error.main,.62)),de(A.Switch,"infoDisabledColor",Ft(A.info.main,.62)),de(A.Switch,"successDisabledColor",Ft(A.success.main,.62)),de(A.Switch,"warningDisabledColor",Ft(A.warning.main,.62)),de(A.TableCell,"border",Ft(R0(A.divider,1),.88)),de(A.Tooltip,"bg",R0(A.grey[700],.92))}if(A.mode==="dark"){de(A.Alert,"errorColor",Ft(A.error.light,.6)),de(A.Alert,"infoColor",Ft(A.info.light,.6)),de(A.Alert,"successColor",Ft(A.success.light,.6)),de(A.Alert,"warningColor",Ft(A.warning.light,.6)),de(A.Alert,"errorFilledBg",L("palette-error-dark")),de(A.Alert,"infoFilledBg",L("palette-info-dark")),de(A.Alert,"successFilledBg",L("palette-success-dark")),de(A.Alert,"warningFilledBg",L("palette-warning-dark")),de(A.Alert,"errorFilledColor",pi(()=>A.getContrastText(A.error.dark))),de(A.Alert,"infoFilledColor",pi(()=>A.getContrastText(A.info.dark))),de(A.Alert,"successFilledColor",pi(()=>A.getContrastText(A.success.dark))),de(A.Alert,"warningFilledColor",pi(()=>A.getContrastText(A.warning.dark))),de(A.Alert,"errorStandardBg",Lt(A.error.light,.9)),de(A.Alert,"infoStandardBg",Lt(A.info.light,.9)),de(A.Alert,"successStandardBg",Lt(A.success.light,.9)),de(A.Alert,"warningStandardBg",Lt(A.warning.light,.9)),de(A.Alert,"errorIconColor",L("palette-error-main")),de(A.Alert,"infoIconColor",L("palette-info-main")),de(A.Alert,"successIconColor",L("palette-success-main")),de(A.Alert,"warningIconColor",L("palette-warning-main")),de(A.AppBar,"defaultBg",L("palette-grey-900")),de(A.AppBar,"darkBg",L("palette-background-paper")),de(A.AppBar,"darkColor",L("palette-text-primary")),de(A.Avatar,"defaultBg",L("palette-grey-600")),de(A.Button,"inheritContainedBg",L("palette-grey-800")),de(A.Button,"inheritContainedHoverBg",L("palette-grey-700")),de(A.Chip,"defaultBorder",L("palette-grey-700")),de(A.Chip,"defaultAvatarColor",L("palette-grey-300")),de(A.Chip,"defaultIconColor",L("palette-grey-300")),de(A.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),de(A.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),de(A.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),de(A.LinearProgress,"primaryBg",Lt(A.primary.main,.5)),de(A.LinearProgress,"secondaryBg",Lt(A.secondary.main,.5)),de(A.LinearProgress,"errorBg",Lt(A.error.main,.5)),de(A.LinearProgress,"infoBg",Lt(A.info.main,.5)),de(A.LinearProgress,"successBg",Lt(A.success.main,.5)),de(A.LinearProgress,"warningBg",Lt(A.warning.main,.5)),de(A.Skeleton,"bg",`rgba(${L("palette-text-primaryChannel")} / 0.13)`),de(A.Slider,"primaryTrack",Lt(A.primary.main,.5)),de(A.Slider,"secondaryTrack",Lt(A.secondary.main,.5)),de(A.Slider,"errorTrack",Lt(A.error.main,.5)),de(A.Slider,"infoTrack",Lt(A.info.main,.5)),de(A.Slider,"successTrack",Lt(A.success.main,.5)),de(A.Slider,"warningTrack",Lt(A.warning.main,.5));const F=M0(A.background.default,.98);de(A.SnackbarContent,"bg",F),de(A.SnackbarContent,"color",pi(()=>A.getContrastText(F))),de(A.SpeedDialAction,"fabHoverBg",M0(A.background.paper,.15)),de(A.StepConnector,"border",L("palette-grey-600")),de(A.StepContent,"border",L("palette-grey-600")),de(A.Switch,"defaultColor",L("palette-grey-300")),de(A.Switch,"defaultDisabledColor",L("palette-grey-600")),de(A.Switch,"primaryDisabledColor",Lt(A.primary.main,.55)),de(A.Switch,"secondaryDisabledColor",Lt(A.secondary.main,.55)),de(A.Switch,"errorDisabledColor",Lt(A.error.main,.55)),de(A.Switch,"infoDisabledColor",Lt(A.info.main,.55)),de(A.Switch,"successDisabledColor",Lt(A.success.main,.55)),de(A.Switch,"warningDisabledColor",Lt(A.warning.main,.55)),de(A.TableCell,"border",Lt(R0(A.divider,1),.68)),de(A.Tooltip,"bg",R0(A.grey[700],.92))}co(A.background,"default"),co(A.background,"paper"),co(A.common,"background"),co(A.common,"onBackground"),co(A,"divider"),Object.keys(A).forEach(F=>{const B=A[F];F!=="tonalOffset"&&B&&typeof B=="object"&&(B.main&&de(A[F],"mainChannel",ym(vm(B.main))),B.light&&de(A[F],"lightChannel",ym(vm(B.light))),B.dark&&de(A[F],"darkChannel",ym(vm(B.dark))),B.contrastText&&de(A[F],"contrastTextChannel",ym(vm(B.contrastText))),F==="text"&&(co(A[F],"primary"),co(A[F],"secondary")),F==="action"&&(B.active&&co(A[F],"active"),B.selected&&co(A[F],"selected")))})}),E=t.reduce((D,A)=>Za(D,A),E);const O={prefix:s,disableCssColorScheme:a,shouldSkipGeneratingVar:o,getSelector:AFe(E)}
2893,{vars:T,generateThemeVars:P,generateStyleSheets:M}=nFe(E,O);return E.vars=T,Object.entries(E.colorSchemes[E.defaultColorScheme]).forEach(([D,A])=>{E[D]=A}),E.generateThemeVars=P,E.generateStyleSheets=M,E.generateSpacing=function(){return iee(d.spacing,JP(this))},E.getColorSchemeSelector=rFe(l),E.spacing=E.generateSpacing(),E.shouldSkipGeneratingVar=o,E.unstable_sxConfig={...ox,...d?.unstable_sxConfig},E.unstable_sx=function(A){return Fu({sx:A,theme:this})},E.toRuntimeSource=pee,E}function kz(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:s3({...n===!0?{}:n.palette,mode:t})})}function xee(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:a=n?void 0:{light:!0},defaultColorScheme:s=n?.mode,...o}=e,l=s||"light",u=a?.[l],d={...a,...n?{[l]:{...typeof u!="boolean"&&u,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return AE(e,...t);let h=n;"palette"in e||d[l]&&(d[l]!==!0?h=d[l].palette:l==="dark"&&(h={mode:"dark"}));const p=AE({...e,palette:h},...t);return p.defaultColorScheme=l,p.colorSchemes=d,p.palette.mode==="light"&&(p.colorSchemes.light={...d.light!==!0&&d.light,palette:p.palette},kz(p,"dark",d.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark={...d.dark!==!0&&d.dark,palette:p.palette},kz(p,"light",d.light)),p}return!n&&!("light"in d)&&l==="light"&&(d.light=!0),MFe({...o,colorSchemes:d,defaultColorScheme:l,...typeof r!="boolean"&&r},...t)}const DFe=xee();function $Fe(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const bee=e=>$Fe(e)&&e!=="classes",Ls=D7e({themeId:BJ,defaultTheme:DFe,rootShouldForwardProp:bee});function IFe(){return oee}const sj=Z7e;function cx(e){return W7e(e)}function iy(e){const t=v.useRef(e);return z7e(()=>{t.current=e}),v.useRef((...n)=>(0,t.current)(...n)).current}function Sz(...e){const t=v.useRef(void 0),n=v.useCallback(r=>{const a=e.map(s=>{if(s==null)return null;if(typeof s=="function"){const o=s,l=o(r);return typeof l=="function"?l:()=>{o(null)}}return s.current=r,()=>{s.current=null}});return()=>{a.forEach(s=>s?.())}},e);return v.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function LFe(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}function TE(e,t){return TE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},TE(e,t)}function FFe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,TE(e,t)}const Cz=ve.createContext(null);function zFe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i3(e,t){var n=function(s){return t&&v.isValidElement(s)?t(s):s},r=Object.create(null);return e&&v.Children.map(e,function(a){return a}).forEach(function(a){r[a.key]=n(a)}),r}function BFe(e,t){e=e||{},t=t||{};function n(h){return h in t?t[h]:e[h]}var r=Object.create(null),a=[];for(var s in e)s in t?a.length&&(r[s]=a,a=[]):a.push(s);var o,l={};for(var u in t){if(r[u])for(o=0;o<r[u].length;o++){var d=r[u][o];l[r[u][o]]=n(d)}l[u]=n(u)}for(o=0;o<a.length;o++)l[a[o]]=n(a[o]);return l}function ou(e,t,n){return n[t]!=null?n[t]:e.props[t]}function UFe(e,t){return i3(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ou(n,"appear",e),enter:ou(n,"enter",e),exit:ou(n,"exit",e)})})}function qFe(e,t,n){var r=i3(e.children),a=BFe(t,r);return Object.keys(a).forEach(function(s){var o=a[s];if(v.isValidElement(o)){var l=s in t,u=s in r,d=t[s],h=v.isValidElement(d)&&!d.props.in;u&&(!l||h)?a[s]=v.cloneElement(o,{onExited:n.bind(null,o),in:!0,exit:ou(o,"exit",e),enter:ou(o,"enter",e)}):!u&&l&&!h?a[s]=v.cloneElement(o,{in:!1}):u&&l&&v.isValidElement(d)&&(a[s]=v.cloneElement(o,{onExited:n.bind(null,o),in:d.props.in,exit:ou(o,"exit",e),enter:ou(o,"enter",e)}))}}),a}var HFe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},KFe={component:"div",childFactory:function(t){return t}},o3=function(e){FFe(t,e);function t(r,a){var s;s=e.call(this,r,a)||this;var o=s.handleExited.bind(zFe(s));return s.state={contextValue:{isMounting:!0}
2893,handleExited:o,firstRender:!0},s}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(a,s){var o=s.children,l=s.handleExited,u=s.firstRender;return{children:u?UFe(a,l):qFe(a,o,l),firstRender:!1}},n.handleExited=function(a,s){var o=i3(this.props.children);a.key in o||(a.props.onExited&&a.props.onExited(s),this.mounted&&this.setState(function(l){var u=Bv({},l.children);return delete u[a.key],{children:u}}))},n.render=function(){var a=this.props,s=a.component,o=a.childFactory,l=LFe(a,["component","childFactory"]),u=this.state.contextValue,d=HFe(this.state.children).map(o);return delete l.appear,delete l.enter,delete l.exit,s===null?ve.createElement(Cz.Provider,{value:u},d):ve.createElement(Cz.Provider,{value:u},ve.createElement(s,l,d))},t}(ve.Component);o3.propTypes={};o3.defaultProps=KFe;const Ez={};function yee(e,t){const n=v.useRef(Ez);return n.current===Ez&&(n.current=e(t)),n}const VFe=[];function GFe(e){v.useEffect(e,VFe)}class l3{static create(){return new l3}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function WFe(){const e=yee(l3.create).current;return GFe(e.disposeEffect),e}function Oz(e){try{return e.matches(":focus-visible")}catch{}return!1}class Kv{static create(){return new Kv}static use(){const t=yee(Kv.create).current,[n,r]=v.useState(!1);return t.shouldMount=n,t.setShouldMount=r,v.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=XFe(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function YFe(){return Kv.use()}function XFe(){let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n}function QFe(e){const{className:t,classes:n,pulsate:r=!1,rippleX:a,rippleY:s,rippleSize:o,in:l,onExited:u,timeout:d}=e,[h,p]=v.useState(!1),g=Xe(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),x={width:o,height:o,top:-(o/2)+s,left:-(o/2)+a},y=Xe(n.child,h&&n.childLeaving,r&&n.childPulsate);return!l&&!h&&p(!0),v.useEffect(()=>{if(!l&&u!=null){const w=setTimeout(u,d);return()=>{clearTimeout(w)}}},[u,l,d]),i.jsx("span",{className:g,style:x,children:i.jsx("span",{className:y})})}const xs=Ph("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),PE=550,ZFe=80,JFe=ax` 2894 0% { 2895 transform: scale(0); 2896 opacity: 0.1; 2897 } 2898 2899 100% { 2900 transform: scale(1); 2901 opacity: 0.3; 2902 } 2903`,eze=ax` 2904 0% { 2905 opacity: 1; 2906 } 2907 2908 100% { 2909 opacity: 0; 2910 } 2911`,tze=ax` 2912 0% { 2913 transform: scale(1); 2914 } 2915 2916 50% { 2917 transform: scale(0.92); 2918 } 2919 2920 100% { 2921 transform: scale(1); 2922 } 2923`,nze=Ls("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),rze=Ls(QFe,{name:"MuiTouchRipple",slot:"Ripple"})` 2924 opacity: 0; 2925 position: absolute; 2926 2927 &.${xs.rippleVisible} { 2928 opacity: 0.3; 2929 transform: scale(1); 2930 animation-name: ${JFe}; 2931 animation-duration: ${PE}ms; 2932 animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; 2933 } 2934 2935 &.${xs.ripplePulsate} { 2936 animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms; 2937 } 2938 2939 & .${xs.child} { 2940 opacity: 1; 2941 display: block; 2942 width: 100%; 2943 height: 100%; 2944 border-radius: 50%; 2945 background-color: currentColor; 2946 } 2947 2948 & .${xs.childLeaving} { 2949 opacity: 0; 2950 animation-name: ${eze}; 2951 animation-duration: ${PE}ms; 2952 animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; 2953 } 2954 2955 & .${xs.childPulsate} { 2956 position: absolute; 2957 /* @noflip */ 2958 left: 0px; 2959 top: 0; 2960 animation-name: ${tze}; 2961 animation-duration: 2500ms; 2962 animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; 2963 animation-iteration-count: infinite; 2964 animation-delay: 200ms; 2965 } 2966`,aze=v.forwardRef(function(t,n){const r=cx({props:t,name:"MuiTouchRipple"}),{center:a=!1,classes:s={},className:o,...l}=r,[u,d]=v.useState([]),h=v.useRef(0),p=v.useRef(null);v.useEffect(()=>{p.current&&(p.current(),p.current=null)},[u]);const g=v.useRef(!1),x=WFe(),y=v.useRef(null),w=v.useRef(null),j=v.useCallback(E=>{const{pulsate:O,rippleX:T,rippleY:P,rippleSize:M,cb:D}=E;d(A=>[...A,i.jsx(rze,{classes:{ripple:Xe(s.ripple,xs.ripple),rippleVisible:Xe(s.rippleVisible,xs.rippleVisible),ripplePulsate:Xe(s.ripplePulsate,xs.ripplePulsate),
2966child:Xe(s.child,xs.child),childLeaving:Xe(s.childLeaving,xs.childLeaving),childPulsate:Xe(s.childPulsate,xs.childPulsate)},timeout:PE,pulsate:O,rippleX:T,rippleY:P,rippleSize:M},h.current)]),h.current+=1,p.current=D},[s]),N=v.useCallback((E={},O={},T=()=>{})=>{const{pulsate:P=!1,center:M=a||O.pulsate,fakeElement:D=!1}=O;if(E?.type==="mousedown"&&g.current){g.current=!1;return}E?.type==="touchstart"&&(g.current=!0);const A=D?null:w.current,L=A?A.getBoundingClientRect():{width:0,height:0,left:0,top:0};let F,B,U;if(M||E===void 0||E.clientX===0&&E.clientY===0||!E.clientX&&!E.touches)F=Math.round(L.width/2),B=Math.round(L.height/2);else{const{clientX:z,clientY:$}=E.touches&&E.touches.length>0?E.touches[0]:E;F=Math.round(z-L.left),B=Math.round($-L.top)}if(M)U=Math.sqrt((2*L.width**2+L.height**2)/3),U%2===0&&(U+=1);else{const z=Math.max(Math.abs((A?A.clientWidth:0)-F),F)*2+2,$=Math.max(Math.abs((A?A.clientHeight:0)-B),B)*2+2;U=Math.sqrt(z**2+$**2)}E?.touches?y.current===null&&(y.current=()=>{j({pulsate:P,rippleX:F,rippleY:B,rippleSize:U,cb:T})},x.start(ZFe,()=>{y.current&&(y.current(),y.current=null)})):j({pulsate:P,rippleX:F,rippleY:B,rippleSize:U,cb:T})},[a,j,x]),k=v.useCallback(()=>{N({},{pulsate:!0})},[N]),S=v.useCallback((E,O)=>{if(x.clear(),E?.type==="touchend"&&y.current){y.current(),y.current=null,x.start(0,()=>{S(E,O)});return}y.current=null,d(T=>T.length>0?T.slice(1):T),p.current=O},[x]);return v.useImperativeHandle(n,()=>({pulsate:k,start:N,stop:S}),[k,N,S]),i.jsx(nze,{className:Xe(xs.root,s.root,o),ref:w,...l,children:i.jsx(o3,{component:null,exit:!0,children:u})})});function sze(e){return lx("MuiButtonBase",e)}const ize=Ph("MuiButtonBase",["root","disabled","focusVisible"]),oze=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:a}=e,o=aj({root:["root",t&&"disabled",n&&"focusVisible"]},sze,a);return n&&r&&(o.root+=` ${r}`),o},lze=Ls("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${ize.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),cze=v.forwardRef(function(t,n){const r=cx({props:t,name:"MuiButtonBase"}),{action:a,centerRipple:s=!1,children:o,className:l,component:u="button",disabled:d=!1,disableRipple:h=!1,disableTouchRipple:p=!1,focusRipple:g=!1,focusVisibleClassName:x,LinkComponent:y="a",onBlur:w,onClick:j,onContextMenu:N,onDragLeave:k,onFocus:S,onFocusVisible:E,onKeyDown:O,onKeyUp:T,onMouseDown:P,onMouseLeave:M,onMouseUp:D,onTouchEnd:A,onTouchMove:L,onTouchStart:F,tabIndex:B=0,TouchRippleProps:U,touchRippleRef:z,type:$,...K}=r,G=v.useRef(null),W=YFe(),I=Sz(W.ref,z),[H,V]=v.useState(!1);d&&H&&V(!1),v.useImperativeHandle(a,()=>({focusVisible:()=>{V(!0),G.current.focus()}}),[]);const X=W.shouldMount&&!h&&!d;v.useEffect(()=>{H&&g&&!h&&W.pulsate()},[h,g,H,W]);const te=uo(W,"start",P,p),fe=uo(W,"stop",N,p),ae=uo(W,"stop",k,p),ke=uo(W,"stop",D,p),xe=uo(W,"stop",Le=>{H&&Le.preventDefault(),M&&M(Le)},p),ue=uo(W,"start",F,p),we=uo(W,"stop",A,p),Oe=uo(W,"stop",L,p),ne=uo(W,"stop",Le=>{Oz(Le.target)||V(!1),w&&w(Le)},!1),_e=iy(Le=>{G.current||(G.current=Le.currentTarget),Oz(Le.target)&&(V(!0),E&&E(Le)),S&&S(Le)}),ye=()=>{const Le=G.current;return u&&u!=="button"&&!(Le.tagName==="A"&&Le.href)},Me=iy(Le=>{g&&!Le.repeat&&H&&Le.key===" "&&W.stop(Le,()=>{W.start(Le)}),Le.target===Le.currentTarget&&ye()&&Le.key===" "&&Le.preventDefault(),O&&O(Le),Le.target===Le.currentTarget&&ye()&&Le.key==="Enter"&&!d&&(Le.preventDefault(),j&&j(Le))}),qe=iy(Le=>{g&&Le.key===" "&&H&&!Le.defaultPrevented&&W.stop(Le,()=>{W.pulsate(Le)}),T&&T(Le),j&&Le.target===Le.currentTarget&&ye()&&Le.key===" "&&!Le.defaultPrevented&&j(Le)});let be=u;be==="button"&&(K.href||K.to)&&(be=y);const Ce={};be==="button"?(Ce.type=$===void 0?"button":$,Ce.disabled=d):(!K.href&&!K.to&&(Ce.role="button"),d&&(Ce["aria-disabled"]=d));const $t=Sz(n,G),en={...r,centerRipple:s,component:u,disabled:d,disableRipple:h,disableTouchRipple:p,focusRipple:g,tabIndex:B,focusVisible:H},Ot=oze(en);return i.jsxs(lze,{as:be,className:Xe(Ot.root,l),ownerState:en,onBlur:ne,onClick:j,onContextMenu:fe,onFocus:_e,onKeyDown:Me,onKeyUp:qe,onMouseDown:te,onMouseLeave:xe,onMouseUp:ke,onDragLeave:ae,onTouchEnd:we,onTouchMove:Oe,onTouchStart:ue,ref:$t,tabIndex:d?-1:B,type:$,...Ce,...K,children:[o,X?i.jsx(aze,{ref:I,center:s,...U}):null]})});function uo(e,t,n,r=!1){return iy(a=>(n&&n(a),r||e[t](a),!0))}function uze(e){return typeof e.main=="string"}function dze(e,t=[]){if(!uze(e))return!1;
2966for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function c3(e=[]){return([,t])=>t&&dze(t,e)}function fze(e){return lx("MuiCircularProgress",e)}Ph("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Ol=44,RE=ax` 2967 0% { 2968 transform: rotate(0deg); 2969 } 2970 2971 100% { 2972 transform: rotate(360deg); 2973 } 2974`,ME=ax` 2975 0% { 2976 stroke-dasharray: 1px, 200px; 2977 stroke-dashoffset: 0; 2978 } 2979 2980 50% { 2981 stroke-dasharray: 100px, 200px; 2982 stroke-dashoffset: -15px; 2983 } 2984 2985 100% { 2986 stroke-dasharray: 1px, 200px; 2987 stroke-dashoffset: -126px; 2988 } 2989`,hze=typeof RE!="string"?XP` 2990 animation: ${RE} 1.4s linear infinite; 2991 `:null,pze=typeof ME!="string"?XP` 2992 animation: ${ME} 1.4s ease-in-out infinite; 2993 `:null,mze=e=>{const{classes:t,variant:n,color:r,disableShrink:a}=e,s={root:["root",n,`color${Dn(r)}`],svg:["svg"],circle:["circle",`circle${Dn(n)}`,a&&"circleDisableShrink"]};return aj(s,fze,t)},gze=Ls("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${Dn(n.color)}`]]}})(sj(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:hze||{animation:`${RE} 1.4s linear infinite`}},...Object.entries(e.palette).filter(c3()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),xze=Ls("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),bze=Ls("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Dn(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(sj(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:pze||{animation:`${ME} 1.4s ease-in-out infinite`}}]}))),u3=v.forwardRef(function(t,n){const r=cx({props:t,name:"MuiCircularProgress"}),{className:a,color:s="primary",disableShrink:o=!1,size:l=40,style:u,thickness:d=3.6,value:h=0,variant:p="indeterminate",...g}=r,x={...r,color:s,disableShrink:o,size:l,thickness:d,value:h,variant:p},y=mze(x),w={},j={},N={};if(p==="determinate"){const k=2*Math.PI*((Ol-d)/2);w.strokeDasharray=k.toFixed(3),N["aria-valuenow"]=Math.round(h),w.strokeDashoffset=`${((100-h)/100*k).toFixed(3)}px`,j.transform="rotate(-90deg)"}return i.jsx(gze,{className:Xe(y.root,a),style:{width:l,height:l,...j,...u},ownerState:x,ref:n,role:"progressbar",...N,...g,children:i.jsx(xze,{className:y.svg,ownerState:x,viewBox:`${Ol/2} ${Ol/2} ${Ol} ${Ol}`,children:i.jsx(bze,{className:y.circle,style:w,ownerState:x,cx:Ol,cy:Ol,r:(Ol-d)/2,fill:"none",strokeWidth:d})})})});function yze(e){return lx("MuiTypography",e)}Ph("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const vze={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},wze=IFe(),jze=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:a,variant:s,classes:o}=e,l={root:["root",s,e.align!=="inherit"&&`align${Dn(t)}`,n&&"gutterBottom",r&&"noWrap",a&&"paragraph"]};return aj(l,yze,o)},Nze=Ls("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${Dn(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(sj(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(c3()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${Dn(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}
2993))),Az={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},sm=v.forwardRef(function(t,n){const{color:r,...a}=cx({props:t,name:"MuiTypography"}),s=!vze[r],o=wze({...a,...s&&{color:r}}),{align:l="inherit",className:u,component:d,gutterBottom:h=!1,noWrap:p=!1,paragraph:g=!1,variant:x="body1",variantMapping:y=Az,...w}=o,j={...o,align:l,color:r,className:u,component:d,gutterBottom:h,noWrap:p,paragraph:g,variant:x,variantMapping:y},N=d||(g?"p":y[x]||Az[x])||"span",k=jze(j);return i.jsx(Nze,{as:N,ref:n,className:Xe(k.root,u),...w,ownerState:j,style:{...l!=="inherit"&&{"--Typography-textAlign":l},...w.style}})}),_ze=Ph("MuiBox",["root"]),kze=xee(),Fc=A7e({themeId:BJ,defaultTheme:kze,defaultClassName:_ze.root,generateClassName:lee.generate});function Sze(e){return lx("MuiButton",e)}const zc=Ph("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),Cze=v.createContext({}),Eze=v.createContext(void 0),Oze=e=>{const{color:t,disableElevation:n,fullWidth:r,size:a,variant:s,loading:o,loadingPosition:l,classes:u}=e,d={root:["root",o&&"loading",s,`${s}${Dn(t)}`,`size${Dn(a)}`,`${s}Size${Dn(a)}`,`color${Dn(t)}`,n&&"disableElevation",r&&"fullWidth",o&&`loadingPosition${Dn(l)}`],startIcon:["icon","startIcon",`iconSize${Dn(a)}`],endIcon:["icon","endIcon",`iconSize${Dn(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},h=aj(d,Sze,u);return{...u,...h}},vee=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Aze=Ls(cze,{shouldForwardProp:e=>bee(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Dn(n.color)}`],t[`size${Dn(n.size)}`],t[`${n.variant}Size${Dn(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(sj(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${zc.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${zc.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${zc.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${zc.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackgroun
2993d}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(c3()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.vars?`rgba(${e.vars.palette[r].mainChannel} / 0.5)`:cf(e.palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:cf(e.palette[r].main,e.palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette[r].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:cf(e.palette[r].main,e.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:cf(e.palette.text.primary,e.palette.action.hoverOpacity),"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:cf(e.palette.text.primary,e.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${zc.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${zc.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${zc.loading}`]:{color:"transparent"}}}]}})),Tze=Ls("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Dn(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...vee]})),Pze=Ls("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Dn(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...vee]})),Rze=Ls("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),Tz=Ls("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Pz=v.forwardRef(function(t,n){const r=v.useContext(Cze),a=v.useContext(Eze),s=Hv(r,t),o=cx({props:s,name:"MuiButton"}),{children:l,color:u="primary",component:d="button",className:h,disabled:p=!1,disableElevation:g=!1,disableFocusRipple:x=!1,endIcon:y,focusVisibleClassName:w,fullWidth:j=!1,id:N,loading:k=null,loadingIndicator:S,loadingPosition:E="center",size:O="medium",startIcon:T,type:P,variant:M="text",...D}=o,A=Q7e(N),L=S??i.jsx(u3,{"aria-labelledby":A,color:"inherit",size:16}),F={...o,color:u,component:d,disabled:p,disableElevation:g,disableFocusRipple:x,fullWidth:j,loading:k,loadingIndicator:L,loadingPosition:E,size:O,type:P,variant:M},B=Oze(F),U=(T||k&&E==="start")&&i.jsx(Tze,{className:B.startIcon,ownerState:F,children:T||i.jsx(Tz,{className:B.loadingIconPlaceholder,ownerState:F})}),z=(y||k&&E==="end")&&i.jsx(Pze,{className:B.endIcon,ownerState:F,children:y||i.jsx(Tz,{className:B.loadingIconPlaceholder,ownerState:F})}),$=a||"",K=typeof k=="boolean"?i.jsx("span",{className:B.loadingWrapper,style:{display:"contents"},children:k&&i.jsx(Rze,{className:B.loadingIndicator,ownerState:F,children:L})}):null;return i.jsxs(Aze,{ownerState:F,className:Xe(r.className,B.root,h,$),component:d,disabled:p||k,focusRipple:!x,focusVisibleClassName:Xe(B.focusVisible,w),ref:n,type:P,id:k?A:N,...D,classes:B,children:[U,E!=="end"&&K,l,E==="end"&&K,z]})}),Rz=15,Mze=2e3,Dze=()=>{const{isLoading:e}=ns(),t=mn(),[n,r]=v.useState(0),[a,s]=v.useState(!1),[o,l]=v.useState(!1),{data:u,isLoading:d,refetch:h}=Nt({queryKey:["user"],queryFn:Oa,enabled:!!Et(),staleTime:0,gcTime:0,refetchOnMount:!0});v.useEffect(()=>{t.invalidateQueries({queryKey:["user"]}),sessionStorage.setItem("payment_flow","true")},[t]),v.useEffect(()=>{if(u?.gas?.subscription){s(!0),sessionStorage.removeItem("payment_flow");return}if(n>=Rz){l(!0);return}if(!d&&!a){const x=setTimeout(()=>{r(y=>y+1),t.invalidateQueries({queryKey:["user"]}),h()},Mze);return()=>clearTimeout(x)}},[u,n,d,a,h,t]);const p=()=>{l(!1),r(0),t.invalidateQueries({queryKey:["user"]}),h()};if(e)return i.jsx(Fc,{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",children:i.jsx(A8e,{})});if(a)return i.jsx(fr,{to:"/dashboard",replace:!0});if(o)return i.jsxs(Fc,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100vh",padding:4,textAlign:"center",children:[i.jsx(sm,{variant:"h5",gutterBottom:!0,color:"error",children:"Subscription Verification Taking Longer Than Expected"}),i.jsx(sm,{variant:"body1",color:"textSecondary",marginBottom:3,children:"Your payment was successful, but we're still processing your subscription. This usually takes just a few moments."}),i.jsxs(Fc,{display:"flex",gap:2,children:[i.jsx(Pz,{variant:"contained",color:"primary",onClick:p,children:"Retry Now"}),i.jsx(Pz,{variant:"outlined",onClick:()=>window.location.href="/billing",children:"Go to Billing"})]}),i.jsx(sm,{variant:"caption",color:"textSecondary",marginTop:3,children:"If this issue persists, please contact support with your payment confirmation."})]});const g=Math.min(n/Rz*100,95);return i.jsxs(Fc,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100vh",padding:4,children:[i.jsx(u3,{size:60,thickness:4}),i.jsx(sm,{variant:"h5",marginTop:3,marginBottom:1,children:"Processing Your Subscription"}),i.jsx(sm,{variant:"body1",color:"textSecondary",marginBottom:2,children:"Please wait while we set up your account..."}),i.jsx(Fc,{width:"100%",maxWidth:400,marginTop:2,children:i.jsx(Fc,{width:"100%",height:4,bgcolor:"grey.300",borderRadius:2,children:i.jsx(Fc,{width:`${g}%`,height:"100%",bgcolor:"primary.main",borderRadius:2,sx:{transition:"width 0.3s ease-in-out"}})})})]})};function wee(){const e=Gr();return i.jsx(fr,{to:"/login",state:{returnTo:dme(e)},replace:!0})}function Us({children:e}){const{isAuthenticated:t,isLoading:n}=ns(),{hasSubscription:r,isLoading:a}=IJ();
2993return n?null:t?a?i.jsx("div",{className:"flex items-center justify-center min-h-screen",children:i.jsx(u3,{color:"inherit"})}):r?i.jsx(i.Fragment,{children:e}):i.jsx(fr,{to:"/pricing",replace:!0}):i.jsx(wee,{})}const Mz="flex-1 min-h-[100dvh] lg:min-h-full flex items-center justify-center bg-canvas lg:bg-white px-5 py-6 lg:p-4",Dz="w-full h-[46px] lg:h-auto";function $z(){const[e]=Li(),t=Sa(),n=Gr(),r=e.get("error"),a=e.get("error_description"),s=OK({error:r,errorDescription:a}),o=s==="email-verification",l=s==="error";if(v.useEffect(()=>{if(n.pathname==="/"&&o){const d=n.search;t(`/verify${d}`,{replace:!0});return}if(l){console.warn("[EmailVerificationError] rendering non-verification auth error in place",{error:r});return}if(n.pathname==="/verify"&&!o){t("/login",{replace:!0});return}if(n.pathname==="/"&&!o){t("/login",{replace:!0});return}},[o,l,r,t,n.pathname,n.search]),n.pathname==="/"&&o)return null;if(l)return i.jsx("div",{className:Mz,children:i.jsxs("div",{className:"max-w-md w-full",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-red-100 mb-4",children:i.jsx(Qt,{className:"h-8 w-8 text-red-600"})}),i.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Couldn't sign you in"}),i.jsx("p",{className:"text-gray-600 mb-6",children:AK({error:r})})]}),i.jsxs(mt,{onClick:()=>t("/login",{replace:!0}),color:"gray",className:Dz,outline:!0,children:[i.jsx(ky,{className:"w-4 h-4 mr-2"}),"Try again"]}),i.jsx("div",{className:"mt-6 text-center",children:i.jsx("p",{className:"text-sm text-gray-500",children:"Still stuck? Contact support at [email protected]."})})]})});if(n.pathname==="/verify"&&!o||n.pathname==="/"&&!o)return null;const u=()=>{window.location.assign("/login")};return i.jsx("div",{className:Mz,children:i.jsxs("div",{className:"max-w-md w-full",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-blue-100 mb-4",children:i.jsx(If,{className:"h-8 w-8 text-blue-600"})}),i.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:Wt.heading}),i.jsx("p",{className:"text-gray-600 mb-6",children:"Please check your email and click the verification link to complete your account setup."})]}),i.jsx("div",{className:"space-y-3",children:i.jsxs(mt,{onClick:u,color:"gray",className:Dz,outline:!0,children:[i.jsx(ky,{className:"w-4 h-4 mr-2"}),"Back to sign in"]})}),i.jsx("div",{className:"mt-6 text-center",children:i.jsxs("p",{className:"text-sm text-gray-500",children:[Wt.footerHelp," ",Wt.supportEmail,"."]})})]})})}const $ze="VERIFICATION_EMAIL_THROTTLED";class jee extends ma{constructor(t,n){super(t,429,$ze),this.retryAfterMs=n,this.name="ResendThrottledError"}}const Ize=async()=>{const{data:e}=await Je.get("/me/verification-status");return{verified:e?.data?.verified===!0}},Lze=async()=>{try{const{data:e}=await Je.post("/me/verification-email");return{retryAfterMs:e?.data?.retryAfterMs??0}}catch(e){if(e instanceof ma&&e.statusCode===429){const t=e.data?.retryAfterMs;throw new jee(e.message,typeof t=="number"?t:0)}throw e}};function Nee(){return i.jsx("a",{href:`mailto:${Wt.supportEmail}`,className:"text-slate-600 font-semibold border-b border-slate-300",children:Wt.supportEmail})}function _ee({icon:e,tone:t,heading:n,children:r,signOutDivider:a=!1,footer:s}){const{logout:o}=ns();return i.jsx("div",{className:"min-h-[100dvh] flex items-center justify-center bg-canvas px-5 py-6",children:i.jsxs("div",{className:"max-w-md w-full text-center",children:[i.jsx("div",{className:`mx-auto flex items-center justify-center h-16 w-16 rounded-full mb-[18px] ${t}`,children:e}),i.jsx("h1",{className:"text-[21px] font-extrabold tracking-tight text-slate-900 mb-2",children:n}),r,a&&i.jsxs("div",{className:"flex items-center gap-2.5 my-4 mb-3 text-slate-400 text-[11px] font-bold uppercase tracking-wider",children:[i.jsx("span",{className:"h-px bg-border flex-1"}),"or",i.jsx("span",{className:"h-px bg-border flex-1"})]}),i.jsxs("button",{type:"button",onClick:()=>o({logoutParams:{returnTo:Ig()}}),className:`w-full min-h-[46px] inline-flex items-center justify-center gap-2 py-2.5 text-sm font-semibold text-slate-500 hover:text-slate-900 transition-colors ${a?"":"mt-2.5"}`,children:[i.jsx(uO,{className:"w-[15px] h-[15px]"}),Wt.signOut]}),i.jsx("p",{className:"mt-5 text-[12.5px] text-slate-500 leading-relaxed",children:s})]})})}const Fze={"resend-sent":Wt.resendSent,"resend-throttled":Wt.resendThrottled,"resend-failed":Wt.resendFailed,"still-unverified":Wt.stillUnverified,"check-failed":Wt.checkFailed},zze={"resend-sent":{box:"bg-badge-green text-badge-green-text border-green-200",Icon:Zt},"resend-throttled":{box:"bg-badge-yellow text-badge-yellow-text border-yellow-200",Icon:xr},"resend-failed":{box:"bg-badge-red text-badge-red-text border-red-200",Icon:Qt},"still-unverified":{box:"bg-badge-blue text-badge-blue-text border-blue-200",Icon:na},"check-failed":{box:"bg-badge-red text-badge-red-text border-red-200",Icon:Qt}};function Bze({checkState:e,onRecheck:t}){const{user:n}=ns(),[r,a]=v.useState(null),[s,o]=v.useState(!1),[l,u]=v.useState(0),d=v.useRef(0),h=e==="checking";v.useEffect(()=>{if(l<=0)return;const j=setInterval(()=>{u(Math.max(0,d.current-Date.now()))},1e3);return()=>clearInterval(j)},[l]);const p=v.useCallback(j=>{j<=0||(d.current=Date.now()+j,u(j))},[]),g=v.useCallback(async()=>{o(!0);try{const{retryAfterMs:j}=await Lze();p(j),a({kind:"resend-sent"})}catch(j){j instanceof jee?(p(j.retryAfterMs),a({kind:"resend-throttled"})):a({kind:"resend-failed"})}finally{o(!1)}},[p]);v.useEffect(()=>{e==="unverified"?a({kind:"still-unverified"}):e==="failed"?a({kind:"check-failed"}):e==="checking"&&a(null)},[e]);const x=r?.kind==="still-unverified"||r?.kind==="check-failed",y=l>0,w=r?zze[r.kind]:null;return i.jsxs(_ee,{icon:i.jsx(If,{className:"h-8 w-8"}),tone:"bg-brand-soft text-brand",heading:Wt.heading,signOutDivider:!0,footer:r?.kind==="still-unverified"?Wt.footerWrongAddress:i.jsxs(i.Fragment,{children:[Wt.footerHelp," ",i.jsx(Nee,{}),"."]}),children:[i.jsx("p",{className:"text-slate-600 leading-relaxed mb-1.5",children:Wt.lede}),i.jsxs("span",{className:"inline-flex items-center gap-[7px] my-2 mb-[22px] px-[13px] py-[7px] rounded-full bg-surface border border-border shadow-card text-[13px] font-bold text-slate-900",children:[i.jsx(If,{className:"w-[15px] h-[15px] text-slate-400"}),n?.email]}),r&&w&&i.jsxs("div",{role:"status",className:`flex gap-2.5 text-left px-[13px] py-[11px] rounded-[9px] text-[13px] leading-snug mb-3 border ${w.box}`,children:[i.jsx(w.Icon,{className:"w-[15px] h-[15px] mt-px shrink-0"}),i.jsx("span",{children:Fze[r.kind]})]}),i.jsxs("div",{className:"flex flex-col gap-2.5",children:[i.jsx(mt,{onClick:t,disabled:h,className:"w-full h-[46px]",children:h?i.jsxs(i.Fragment,{children:[i.jsx(cO,{className:"w-4 h-4 mr-2 animate-spin"}),Wt.checkWorking]}):i.jsxs(i.Fragment,{children:[i.jsx(Zt,{className:"w-4 h-4 mr-2"}),x?Wt.checkRetry:Wt.checkIdle]})}),i.jsx(mt,{onClick:g,color:"gray",outline:!0,className:"w-full h-[46px]",disabled:s||h||y,children:y?i.jsxs(i.Fragment,{children:[i.jsx(xr,{className:"w-4 h-4 mr-2"}),Wt.resendCoolingDown(Zge(l))]}):i.jsxs(i.Fragment,{children:[i.jsx(dt,{className:"w-4 h-4 mr-2"}),r?.kind==="resend-failed"?Wt.resendRetry:Wt.resendIdle]})})]})]})}function Iz({isChecking:e,onRetry:t}){return i.jsxs(_ee,{icon:i.jsx(Qt,{className:"h-8 w-8"}),tone:"bg-badge-yellow text-badge-yellow-text",heading:Wt.unavailableHeading,footer
2993:i.jsxs(i.Fragment,{children:[Wt.unavailableFooter," ",i.jsx(Nee,{}),"."]}),children:[i.jsx("p",{className:"text-slate-600 leading-relaxed mb-[22px]",children:Wt.unavailableLede}),i.jsx(mt,{onClick:t,disabled:e,className:"w-full h-[46px]",children:e?i.jsxs(i.Fragment,{children:[i.jsx(cO,{className:"w-4 h-4 mr-2 animate-spin"}),Wt.checkWorking]}):i.jsxs(i.Fragment,{children:[i.jsx(dt,{className:"w-4 h-4 mr-2"}),Wt.unavailableRetry]})})]})}const im=e=>console.warn(`[useEmailVerification] ${e}`);function Uze(e){const{user:t,getAccessTokenSilently:n}=ns(),r=typeof t?.sub=="string"?t.sub:null,a=qge(t),[s,o]=v.useState(()=>MI(r)),[l,u]=v.useState(!1),[d,h]=v.useState(!1),[p,g]=v.useState("idle"),x=v.useRef(!1),y=v.useRef(r),w=v.useRef(null),j=v.useRef(0),N=v.useRef(0),k=v.useRef(null),S=v.useCallback(()=>{N.current+=1,w.current!==null&&(clearTimeout(w.current),w.current=null)},[]),E=v.useCallback(async({refreshFirst:M,announce:D})=>{S();const A=N.current,L=()=>N.current!==A;if(D&&g("checking"),M)try{await n({cacheMode:"off"})}catch{}try{const{verified:F}=await Ize();if(L()){im(`answered for ${r??"unknown subject"} after a newer check took over; discarding`);return}j.current=0,h(!1),u(!0),o(F),F&&r&&Hge(r),F||Kge(r),g(F||!D?"idle":"unverified")}catch(F){if(L()){im(`failed for ${r??"unknown subject"} after a newer check took over; discarding`);return}j.current+=1,h(!0),g(D?"failed":"idle");const B=F?.statusCode,U=F instanceof Error?F.message:String(F),z=j.current;if(!Xge(F)){im(`refused (${B??"no status"}) for ${r??"unknown subject"}; not retrying: ${U}`);return}if(z>=DI){im(`failed ${z} times for ${r??"unknown subject"}; giving up until asked again: ${U}`);return}const $=Qge(F,z);im(`failed (${B??"no status"}) for ${r??"unknown subject"}, attempt ${z}/${DI}; retrying in ${$}ms: ${U}`),w.current=setTimeout(()=>{w.current=null,k.current?.({refreshFirst:!1,announce:!1})},$)}},[S,n,r]);v.useEffect(()=>{k.current=E},[E]),v.useEffect(()=>S,[S]),v.useEffect(()=>{y.current!==r&&(y.current=r,x.current=!1,j.current=0,S(),o(MI(r)),u(!1),h(!1))},[r,S]),v.useEffect(()=>{a||s||!e||x.current||(x.current=!0,E({refreshFirst:!1,announce:!1}))},[a,s,e,E]);const O=v.useCallback(()=>(j.current=0,E({refreshFirst:!0,announce:!0})),[E]);return{status:a||s?"verified":l?"unverified":d?"unavailable":"resolving",checkState:p,recheck:O}}const qze=v.lazy(()=>nr(()=>import("./DocsRoutes-B56pVzgg.js"),__vite__mapDeps([4,1,2,3,5]))),Hze=v.lazy(()=>nr(()=>import("./ChatPage-CTjqkeWn.js"),__vite__mapDeps([6,7,8,3,5]))),Kze=v.lazy(()=>nr(()=>import("./ChatWidget-CEHoUjps.js"),__vite__mapDeps([9,7,8,3,5]))),Vze=v.lazy(()=>nr(()=>import("./WorkbenchTab-D9I7lzjE.js"),__vite__mapDeps([10,8,3,5]))),Q5=e=>console.warn(`[AuthenticatedApp] ${e}`),Gze=new Nse({defaultOptions:{queries:{enabled:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:(e,t)=>t instanceof Error&&t.name==="ApiError"?!1:e<3,staleTime:5*60*1e3,gcTime:10*60*1e3}}});function Wze(){const{user:e,isLoading:t}=ns(),{isAuthenticated:n,isInitialized:r,token:a,profileError:s,reloadProfile:o}=l8e(),{setConnections:l}=$n(),{status:u,checkState:d,recheck:h}=Uze(a),p=u==="verified",[g,x]=v.useState(!1),y=v.useRef(!1),w=v.useRef(!1),j=v.useCallback(async()=>{x(!0),Q5("loading the profile again");try{await o(),Q5("profile load finished")}finally{x(!1)}},[o]);return v.useEffect(()=>{if(u==="unverified"||u==="unavailable"){y.current=!0;return}p&&!r&&y.current&&!w.current&&(w.current=!0,Q5("verification cleared with no profile loaded; loading it again"),j())},[u,p,r,j]),v.useEffect(()=>{(async()=>{if(a&&p)try{const k=await Qm();l(k)}catch{}})()},[a,p,l]),t?i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsx(Dt,{size:"xl"})}):n&&u==="unverified"?i.jsx(Bze,{checkState:d,onRecheck:h}):n&&u==="unavailable"?i.jsx(Iz,{isChecking:d==="checking",onRetry:h}):n&&!r&&s?i.jsx(Iz,{isChecking:g,onRetry:j}):!n||!r?i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsx(Dt,{size:"xl"})}):i.jsxs(i.Fragment,{children:[i.jsx(zE,{children:i.jsxs(Ke,{element:i.jsx(lme,{}),children:[i.jsx(Ke,{path:"/checkout",element:i.jsx(u8e,{})}),i.jsx(Ke,{path:"/dashboard",element:i.jsx(Us,{children:i.jsx(oye,{})})}),i.jsx(Ke,{path:"/home",element:i.jsx(fr,{to:"/dashboard",replace:!0})}),i.jsx(Ke,{path:"/payment_successful",element:i.jsx(Dze,{})}),i.jsxs(Ke,{path:"/documents",element:i.jsx(Us,{children:i.jsx(Xye,{})}),children:[i.jsx(Ke,{index:!0,element:i.jsx(fr,{to:t6,replace:!0})}),i.jsx(Ke,{path:"overview",element:i.jsx(sve,{})}),i.jsx(Ke,{path:"all",element:i.jsx(j6,{})}),i.jsx(Ke,{path:"all/:documentId",element:i.jsx(j6,{})}),i.jsx(Ke,{path:"review",element:i.jsx(zve,{})}),i.jsx(Ke,{path:"review/inbox",element:i.jsx(s1e,{})}),i.jsx(Ke,{path:"review/match",element:i.jsx(b1e,{})}),i.jsx(Ke,{path:"sources",element:i.jsx($1e,{})}),i.jsx(Ke,{path:"*",element:i.jsx(fr,{to:t6,replace:!0})})]}),i.jsxs(Ke,{path:"/accounts",element:i.jsx(Us,{children:i.jsx(y$e,{})}),children:[i.jsx(Ke,{index:!0,element:i.jsx(fr,{to:B6,replace:!0})}),i.jsx(Ke,{path:"overview",element:i.jsx(_$e,{})}),i.jsx(Ke,{path:"all",element:i.jsx(P$e,{})}),i.jsx(Ke,{path:"connections",element:i.jsx($$e,{})}),i.jsx(Ke,{path:"*",element:i.jsx(fr,{to:B6,replace:!0})})]}),i.jsxs(Ke,{path:"/investments",element:i.jsx(Us,{children:i.jsx(Q$e,{})}),children:[i.jsx(Ke,{index:!0,element:i.jsx(fr,{to:n6,replace:!0})}),i.jsx(Ke,{path:"overview",element:i.jsx(eIe,{})}),i.jsx(Ke,{path:"holdings",element:i.jsx(oIe,{})}),i.jsx(Ke,{path:"allocation",element:i.jsx(mIe,{})}),i.jsx(Ke,{path:"accounts",element:i.jsx(gIe,{})}),i.jsx(Ke,{path:"activity",element:i.jsx(kIe,{})}),e?.email===pO&&i.jsx(Ke,{path:"workbench",element:i.jsx(v.Suspense,{fallback:i.jsx("div",{className:"flex items-center justify-center py-16",children:i.jsx(Dt,{size:"xl"})}),children:i.jsx(Vze,{})})}),i.jsx(Ke,{path:"*",element:i.jsx(fr,{to:n6,replace:!0})})]}),i.jsx(Ke,{path:"/investments-beta",element:i.jsx(fr,{to:"/investments",replace:!0})}),i.jsxs(Ke,{path:"/transactions",element:i.jsx(Us,{children:i.jsx(H1e,{})}),children:[i.jsx(Ke,{index:!0,element:i.jsx(fr,{to:HI,replace:!0})}),i.jsx(Ke,{path:"overview",element:i.jsx(cwe,{})}),i.jsx(Ke,{path:"all",element:i.jsx(bwe,{})}),i.jsx(Ke,{path:Gm,element:i.jsx(vwe,{})}),i.jsx(Ke,{path:ybe,element:i.jsx(fr,{to:Ko(Gm),replace:!0})}),i.jsx(Ke,{path:"*",element:i.jsx(fr,{to:HI,replace:!0})})]}),i.jsx(Ke,{path:"/analytics",element:i.jsx(Us,{children:i.jsx(s$e,{})})}),i.jsx(Ke,{path:"/connections",element:i.jsx(Us,{children:i.jsx(AIe,{})})}),i.jsx(Ke,{path:"/spreadsheets",element:i.jsx(Us,{children:i.jsx(GIe,{})})}),i.jsx(Ke,{path:"/profile",element:i.jsx(Us,{children:i.jsx(t6e,{})})}),i.jsx(Ke,{path:"/billing",element:i.jsx(Us,{children:i.jsx(s8e,{})})}),i.jsx(Ke,{path:"/chat",element:i.jsx(Us,{children:i.jsx(v.Suspense,{fallback:i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-canvas",children:i.jsx(Dt,{size:"xl"})}),children:i.jsx(Hze,{})})})}),i.jsx(Ke,{path:"/pricing",element:i.jsx(rLe,{})}),i.jsx(Ke,{path:"/connections/drive/callback",element:i.jsx(YIe,{})}),i.jsx(Ke,{path:"/connections/gmail/callback",element:i.jsx(QIe,{})}),i.jsx(Ke,{path:"/connections/monday/callback",element:i.jsx(JIe,{})}),i.jsx(Ke,{path:"/",element:i.jsx(fr,{to:"/dashboard",replace:!0})}),i.jsx(Ke,{path:"*",element:i.jsx(fr,{to:"/dashboard",replace:!0})})]})}),i.jsx(Yze,{})]})}function Yze(){const{hasSubscription:e}=IJ();return e?i.jsx(v.Suspense,{fallback:null,children:i.jsx(Kze,{})}):null}
2993function Xze(){return i.jsxs(zE,{children:[i.jsx(Ke,{path:"/docs/*",element:i.jsx(v.Suspense,{fallback:i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-canvas",children:i.jsx(Dt,{size:"xl"})}),children:i.jsx(qze,{})})}),i.jsx(Ke,{path:"*",element:i.jsx(Qze,{})})]})}function Qze(){const{isAuthenticated:e,isLoading:t}=ns();return t?null:e?i.jsx(Wze,{}):i.jsxs(zE,{children:[i.jsx(Ke,{path:"/login",element:i.jsx(fme,{})}),i.jsx(Ke,{path:"/verify",element:i.jsxs("div",{className:ime,children:[i.jsx(YU,{}),i.jsx("main",{className:rme,children:i.jsx($z,{})})]})}),i.jsx(Ke,{path:"/",element:i.jsx($z,{})}),i.jsx(Ke,{path:"*",element:i.jsx(wee,{})})]})}function Zze({children:e}){const t=Sa(),n=v.useCallback(r=>{const a=TK(r?.returnTo);t(a??ume,{replace:!0})},[t]);return i.jsx(rse,{onRedirectCallback:n,domain:"moneylogz.us.auth0.com",clientId:"g0FKx5AG4BEanWuAdmpo5MVo38JqjYes",authorizationParams:{redirect_uri:Ig(),audience:"https://www.moneylogs.com/website"},useRefreshTokens:!0,cacheLocation:"localstorage",children:e})}function Jze(){return i.jsx(Yoe,{apiKey:"phc_jt1jbPLn9oSafBUJl2DkqOsAtt20w0dbEOvfKLewOCj",options:ele,children:i.jsx(sse,{clientId:"430666016442-tr0odpd46h72dd2r158hqb3trfuvtg6t.apps.googleusercontent.com",children:i.jsx(Ese,{client:Gze,children:i.jsx(i8e,{children:i.jsx(pae,{children:i.jsx(Zze,{children:i.jsx(Xze,{})})})})})})})}Yne.createRoot(document.getElementById("root")).render(i.jsx(v.StrictMode,{children:i.jsx(Jze,{})}));export{Ay as $,hO as A,yle as B,Ca as C,oBe as D,ma as E,ri as F,Zt as G,Qt as H,na as I,cO as J,bBe as K,gt as L,KU as M,ly as N,yg as O,Mce as P,Gr as Q,dt as R,uh as S,Jt as T,fr as U,zU as V,zE as W,Ke as X,Li as Y,Sa as Z,Ms as _,lBe as a,fJ as a$,D$ as a0,OBe as a1,$n as a2,iue as a3,n1 as a4,Ut as a5,mce as a6,vce as a7,qt as a8,mt as a9,kw as aA,Dw as aB,ex as aC,tx as aD,mP as aE,RP as aF,JZ as aG,dg as aH,BMe as aI,kP as aJ,Ah as aK,rs as aL,Ue as aM,je as aN,G1 as aO,Ym as aP,Yxe as aQ,Jxe as aR,zi as aS,ge as aT,fu as aU,Ee as aV,Ja as aW,ei as aX,oc as aY,hu as aZ,dUe as a_,Qs as aa,Ya as ab,eue as ac,fO as ad,Wu as ae,ky as af,mn as ag,Nt as ah,Pf as ai,Et as aj,nx as ak,Po as al,vn as am,Ou as an,O1 as ao,E1 as ap,Re as aq,Hu as ar,jg as as,ZZ as at,pP as au,R0e as av,YBe as aw,XBe as ax,WBe as ay,Gf as az,cBe as b,z$e as b0,Ql as b1,I1 as b2,F$e as b3,fUe as b4,ra as b5,ja as b6,ic as b7,P1 as b8,$1 as b9,rc as bA,a1 as bB,Bo as bC,VU as bD,kBe as bE,ka as bF,ti as bG,zw as bH,PIe as bI,nr as bJ,RV as ba,ac as bb,lC as bc,Vy as bd,qu as be,nA as bf,Fi as bg,TA as bh,Tu as bi,yxe as bj,Uo as bk,yV as bl,lO as bm,dO as bn,dle as bo,ea as bp,GU as bq,P0e as br,Kce as bs,oue as bt,BU as bu,CBe as bv,e1 as bw,EBe as bx,gBe as by,HU as bz,Se as c,uBe as d,va as e,dBe as f,ns as g,xBe as h,yBe as i,i as j,pBe as k,zu as l,vBe as m,NBe as n,wBe as o,jBe as p,hBe as q,v as r,xr as s,fBe as t,Ore as u,mBe as v,_Be as w,SBe as x,Je as y,ql as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.