From e0cbd0075f867db0f2eadac05672abc7b2a9db7f Mon Sep 17 00:00:00 2001 From: dudiq Date: Sat, 23 Mar 2024 15:42:44 +0300 Subject: [PATCH] fix: update base url --- .env.development | 2 +- docs/assets/index-DfKF4hG7.js | 64 +++++++++++++++++++++++++++++++++++ docs/index.html | 2 +- docs/sw.js | 2 +- 4 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 docs/assets/index-DfKF4hG7.js diff --git a/.env.development b/.env.development index c503bc2..e0fa3eb 100644 --- a/.env.development +++ b/.env.development @@ -1 +1 @@ -VITE_BASE_URL=/ +#VITE_BASE_URL=/ diff --git a/docs/assets/index-DfKF4hG7.js b/docs/assets/index-DfKF4hG7.js new file mode 100644 index 0000000..ccde450 --- /dev/null +++ b/docs/assets/index-DfKF4hG7.js @@ -0,0 +1,64 @@ +var d1=Object.defineProperty;var h1=(e,t,n)=>t in e?d1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var O=(e,t,n)=>(h1(e,typeof t!="symbol"?t+"":t,n),n);function p1(e,t){for(var n=0;nr[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function _v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wv={exports:{}},kl={},Sv={exports:{}},W={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ca=Symbol.for("react.element"),v1=Symbol.for("react.portal"),m1=Symbol.for("react.fragment"),g1=Symbol.for("react.strict_mode"),y1=Symbol.for("react.profiler"),_1=Symbol.for("react.provider"),w1=Symbol.for("react.context"),S1=Symbol.for("react.forward_ref"),b1=Symbol.for("react.suspense"),x1=Symbol.for("react.memo"),E1=Symbol.for("react.lazy"),Bh=Symbol.iterator;function C1(e){return e===null||typeof e!="object"?null:(e=Bh&&e[Bh]||e["@@iterator"],typeof e=="function"?e:null)}var bv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xv=Object.assign,Ev={};function Ri(e,t,n){this.props=e,this.context=t,this.refs=Ev,this.updater=n||bv}Ri.prototype.isReactComponent={};Ri.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ri.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Cv(){}Cv.prototype=Ri.prototype;function ud(e,t,n){this.props=e,this.context=t,this.refs=Ev,this.updater=n||bv}var cd=ud.prototype=new Cv;cd.constructor=ud;xv(cd,Ri.prototype);cd.isPureReactComponent=!0;var zh=Array.isArray,Ov=Object.prototype.hasOwnProperty,fd={current:null},jv={key:!0,ref:!0,__self:!0,__source:!0};function Pv(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)Ov.call(t,r)&&!jv.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,Oe=D[me];if(0>>1;mei(du,V))rri(ka,du)?(D[me]=ka,D[rr]=V,me=rr):(D[me]=du,D[nr]=V,me=nr);else if(rri(ka,V))D[me]=ka,D[rr]=V,me=rr;else break e}}return z}function i(D,z){var V=D.sortIndex-z.sortIndex;return V!==0?V:D.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,g=!1,S=!1,y=!1,E=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(D){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=D)r(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(u)}}function w(D){if(y=!1,v(D),!S)if(n(l)!==null)S=!0,Nt(x);else{var z=n(u);z!==null&&Ce(w,z.startTime-D)}}function x(D,z){S=!1,y&&(y=!1,p(C),C=-1),g=!0;var V=f;try{for(v(z),d=n(l);d!==null&&(!(d.expirationTime>z)||D&&!U());){var me=d.callback;if(typeof me=="function"){d.callback=null,f=d.priorityLevel;var Oe=me(d.expirationTime<=z);z=e.unstable_now(),typeof Oe=="function"?d.callback=Oe:d===n(l)&&r(l),v(z)}else r(l);d=n(l)}if(d!==null)var Ra=!0;else{var nr=n(u);nr!==null&&Ce(w,nr.startTime-z),Ra=!1}return Ra}finally{d=null,f=V,g=!1}}var _=!1,b=null,C=-1,P=5,M=-1;function U(){return!(e.unstable_now()-MD||125me?(D.sortIndex=V,t(u,D),n(l)===null&&D===n(u)&&(y?(p(C),C=-1):y=!0,Ce(w,V-me))):(D.sortIndex=Oe,t(l,D),S||g||(S=!0,Nt(x))),D},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(D){var z=f;return function(){var V=f;f=z;try{return D.apply(this,arguments)}finally{f=V}}}})(Dv);kv.exports=Dv;var M1=kv.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Lv=N,st=M1;function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lc=Object.prototype.hasOwnProperty,$1=/^[: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]*$/,Uh={},Kh={};function F1(e){return lc.call(Kh,e)?!0:lc.call(Uh,e)?!1:$1.test(e)?Kh[e]=!0:(Uh[e]=!0,!1)}function B1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function z1(e,t,n,r){if(t===null||typeof t>"u"||B1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xe(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ie[e]=new Xe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ie[t]=new Xe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ie[e]=new Xe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ie[e]=new Xe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ie[e]=new Xe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ie[e]=new Xe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ie[e]=new Xe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ie[e]=new Xe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ie[e]=new Xe(e,5,!1,e.toLowerCase(),null,!1,!1)});var hd=/[\-:]([a-z])/g;function pd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(hd,pd);Ie[t]=new Xe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(hd,pd);Ie[t]=new Xe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(hd,pd);Ie[t]=new Xe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ie[e]=new Xe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ie.xlinkHref=new Xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ie[e]=new Xe(e,1,!1,e.toLowerCase(),null,!0,!0)});function vd(e,t,n,r){var i=Ie.hasOwnProperty(t)?Ie[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` +`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{vu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qi(e):""}function V1(e){switch(e.tag){case 5:return qi(e.type);case 16:return qi("Lazy");case 13:return qi("Suspense");case 19:return qi("SuspenseList");case 0:case 2:case 15:return e=mu(e.type,!1),e;case 11:return e=mu(e.type.render,!1),e;case 1:return e=mu(e.type,!0),e;default:return""}}function dc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hr:return"Fragment";case Kr:return"Portal";case uc:return"Profiler";case md:return"StrictMode";case cc:return"Suspense";case fc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Tv:return(e.displayName||"Context")+".Consumer";case Nv:return(e._context.displayName||"Context")+".Provider";case gd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yd:return t=e.displayName||null,t!==null?t:dc(e.type)||"Memo";case Cn:t=e._payload,e=e._init;try{return dc(e(t))}catch{}}return null}function U1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dc(t);case 8:return t===md?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $v(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function K1(e){var t=$v(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ia(e){e._valueTracker||(e._valueTracker=K1(e))}function Fv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$v(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ls(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function hc(e,t){var n=t.checked;return ce({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Wh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Un(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Bv(e,t){t=t.checked,t!=null&&vd(e,"checked",t,!1)}function pc(e,t){Bv(e,t);var n=Un(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vc(e,t.type,n):t.hasOwnProperty("defaultValue")&&vc(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function vc(e,t,n){(t!=="number"||Ls(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Xi=Array.isArray;function oi(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Na.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function So(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ro={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},H1=["Webkit","ms","Moz","O"];Object.keys(ro).forEach(function(e){H1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ro[t]=ro[e]})});function Kv(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ro.hasOwnProperty(e)&&ro[e]?(""+t).trim():t+"px"}function Hv(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Kv(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var W1=ce({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yc(e,t){if(t){if(W1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(A(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(A(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(A(61))}if(t.style!=null&&typeof t.style!="object")throw Error(A(62))}}function _c(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 wc=null;function _d(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sc=null,ai=null,si=null;function qh(e){if(e=ha(e)){if(typeof Sc!="function")throw Error(A(280));var t=e.stateNode;t&&(t=Tl(t),Sc(e.stateNode,e.type,t))}}function Wv(e){ai?si?si.push(e):si=[e]:ai=e}function Yv(){if(ai){var e=ai,t=si;if(si=ai=null,qh(e),t)for(e=0;e>>=0,e===0?32:31-(r2(e)/i2|0)|0}var Ta=64,Ma=4194304;function Zi(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ms(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Zi(s):(o&=a,o!==0&&(r=Zi(o)))}else a=n&~i,a!==0?r=Zi(a):o!==0&&(r=Zi(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function fa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function l2(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=oo),op=" ",ap=!1;function h3(e,t){switch(e){case"keyup":return T2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function p3(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function $2(e,t){switch(e){case"compositionend":return p3(t);case"keypress":return t.which!==32?null:(ap=!0,op);case"textInput":return e=t.data,e===op&&ap?null:e;default:return null}}function F2(e,t){if(Wr)return e==="compositionend"||!jd&&h3(e,t)?(e=f3(),hs=Ed=kn=null,Wr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cp(n)}}function y3(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?y3(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _3(){for(var e=window,t=Ls();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ls(e.document)}return t}function Pd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function G2(e){var t=_3(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&y3(n.ownerDocument.documentElement,n)){if(r!==null&&Pd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=fp(n,o);var a=fp(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Yr=null,jc=null,so=null,Pc=!1;function dp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pc||Yr==null||Yr!==Ls(r)||(r=Yr,"selectionStart"in r&&Pd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),so&&jo(so,r)||(so=r,r=Bs(jc,"onSelect"),0qr||(e.current=Ic[qr],Ic[qr]=null,qr--)}function Z(e,t){qr++,Ic[qr]=e.current,e.current=t}var Kn={},Ve=Xn(Kn),et=Xn(!1),_r=Kn;function vi(e,t){var n=e.type.contextTypes;if(!n)return Kn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function tt(e){return e=e.childContextTypes,e!=null}function Vs(){ie(et),ie(Ve)}function _p(e,t,n){if(Ve.current!==Kn)throw Error(A(168));Z(Ve,t),Z(et,n)}function P3(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(A(108,U1(e)||"Unknown",i));return ce({},n,r)}function Us(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kn,_r=Ve.current,Z(Ve,e),Z(et,et.current),!0}function wp(e,t,n){var r=e.stateNode;if(!r)throw Error(A(169));n?(e=P3(e,t,_r),r.__reactInternalMemoizedMergedChildContext=e,ie(et),ie(Ve),Z(Ve,e)):ie(et),Z(et,n)}var Xt=null,Ml=!1,Ru=!1;function A3(e){Xt===null?Xt=[e]:Xt.push(e)}function a_(e){Ml=!0,A3(e)}function Zn(){if(!Ru&&Xt!==null){Ru=!0;var e=0,t=q;try{var n=Xt;for(q=1;e>=a,i-=a,tn=1<<32-jt(t)+i|n<C?(P=b,b=null):P=b.sibling;var M=f(p,b,v[C],w);if(M===null){b===null&&(b=P);break}e&&b&&M.alternate===null&&t(p,b),h=o(M,h,C),_===null?x=M:_.sibling=M,_=M,b=P}if(C===v.length)return n(p,b),ae&&ar(p,C),x;if(b===null){for(;CC?(P=b,b=null):P=b.sibling;var U=f(p,b,M.value,w);if(U===null){b===null&&(b=P);break}e&&b&&U.alternate===null&&t(p,b),h=o(U,h,C),_===null?x=U:_.sibling=U,_=U,b=P}if(M.done)return n(p,b),ae&&ar(p,C),x;if(b===null){for(;!M.done;C++,M=v.next())M=d(p,M.value,w),M!==null&&(h=o(M,h,C),_===null?x=M:_.sibling=M,_=M);return ae&&ar(p,C),x}for(b=r(p,b);!M.done;C++,M=v.next())M=g(b,p,C,M.value,w),M!==null&&(e&&M.alternate!==null&&b.delete(M.key===null?C:M.key),h=o(M,h,C),_===null?x=M:_.sibling=M,_=M);return e&&b.forEach(function(ve){return t(p,ve)}),ae&&ar(p,C),x}function E(p,h,v,w){if(typeof v=="object"&&v!==null&&v.type===Hr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case La:e:{for(var x=v.key,_=h;_!==null;){if(_.key===x){if(x=v.type,x===Hr){if(_.tag===7){n(p,_.sibling),h=i(_,v.props.children),h.return=p,p=h;break e}}else if(_.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Cn&&jp(x)===_.type){n(p,_.sibling),h=i(_,v.props),h.ref=Ki(p,_,v),h.return=p,p=h;break e}n(p,_);break}else t(p,_);_=_.sibling}v.type===Hr?(h=pr(v.props.children,p.mode,w,v.key),h.return=p,p=h):(w=Ss(v.type,v.key,v.props,null,p.mode,w),w.ref=Ki(p,h,v),w.return=p,p=w)}return a(p);case Kr:e:{for(_=v.key;h!==null;){if(h.key===_)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){n(p,h.sibling),h=i(h,v.children||[]),h.return=p,p=h;break e}else{n(p,h);break}else t(p,h);h=h.sibling}h=$u(v,p.mode,w),h.return=p,p=h}return a(p);case Cn:return _=v._init,E(p,h,_(v._payload),w)}if(Xi(v))return S(p,h,v,w);if(Fi(v))return y(p,h,v,w);Ka(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,h!==null&&h.tag===6?(n(p,h.sibling),h=i(h,v),h.return=p,p=h):(n(p,h),h=Mu(v,p.mode,w),h.return=p,p=h),a(p)):n(p,h)}return E}var gi=M3(!0),$3=M3(!1),pa={},Vt=Xn(pa),ko=Xn(pa),Do=Xn(pa);function fr(e){if(e===pa)throw Error(A(174));return e}function Md(e,t){switch(Z(Do,t),Z(ko,e),Z(Vt,pa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gc(t,e)}ie(Vt),Z(Vt,t)}function yi(){ie(Vt),ie(ko),ie(Do)}function F3(e){fr(Do.current);var t=fr(Vt.current),n=gc(t,e.type);t!==n&&(Z(ko,e),Z(Vt,n))}function $d(e){ko.current===e&&(ie(Vt),ie(ko))}var se=Xn(0);function Qs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ku=[];function Fd(){for(var e=0;en?n:4,e(!0);var r=Du.transition;Du.transition={};try{e(!1),t()}finally{q=n,Du.transition=r}}function tm(){return bt().memoizedState}function c_(e,t,n){var r=zn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},nm(e))rm(t,n);else if(n=L3(e,t,n,r),n!==null){var i=We();Pt(n,e,r,i),im(n,t,r)}}function f_(e,t,n){var r=zn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(nm(e))rm(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Dt(s,a)){var l=t.interleaved;l===null?(i.next=i,Nd(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=L3(e,t,i,r),n!==null&&(i=We(),Pt(n,e,r,i),im(n,t,r))}}function nm(e){var t=e.alternate;return e===ue||t!==null&&t===ue}function rm(e,t){lo=qs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function im(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Sd(e,n)}}var Xs={readContext:St,useCallback:Te,useContext:Te,useEffect:Te,useImperativeHandle:Te,useInsertionEffect:Te,useLayoutEffect:Te,useMemo:Te,useReducer:Te,useRef:Te,useState:Te,useDebugValue:Te,useDeferredValue:Te,useTransition:Te,useMutableSource:Te,useSyncExternalStore:Te,useId:Te,unstable_isNewReconciler:!1},d_={readContext:St,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:Ap,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,gs(4194308,4,q3.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gs(4194308,4,e,t)},useInsertionEffect:function(e,t){return gs(4,2,e,t)},useMemo:function(e,t){var n=Mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=c_.bind(null,ue,e),[r.memoizedState,e]},useRef:function(e){var t=Mt();return e={current:e},t.memoizedState=e},useState:Pp,useDebugValue:Kd,useDeferredValue:function(e){return Mt().memoizedState=e},useTransition:function(){var e=Pp(!1),t=e[0];return e=u_.bind(null,e[1]),Mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ue,i=Mt();if(ae){if(n===void 0)throw Error(A(407));n=n()}else{if(n=t(),Re===null)throw Error(A(349));Sr&30||V3(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Ap(K3.bind(null,r,o,e),[e]),r.flags|=2048,No(9,U3.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Mt(),t=Re.identifierPrefix;if(ae){var n=nn,r=tn;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Lo++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Ft]=t,e[Ro]=r,hm(e,t,!1,!1),t.stateNode=e;e:{switch(a=_c(n,r),n){case"dialog":ne("cancel",e),ne("close",e),i=r;break;case"iframe":case"object":case"embed":ne("load",e),i=r;break;case"video":case"audio":for(i=0;iwi&&(t.flags|=128,r=!0,Hi(o,!1),t.lanes=4194304)}else{if(!r)if(e=Qs(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!ae)return Me(t),null}else 2*ge()-o.renderingStartTime>wi&&n!==1073741824&&(t.flags|=128,r=!0,Hi(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ge(),t.sibling=null,n=se.current,Z(se,r?n&1|2:n&1),t):(Me(t),null);case 22:case 23:return qd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?it&1073741824&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),null;case 24:return null;case 25:return null}throw Error(A(156,t.tag))}function w_(e,t){switch(Rd(t),t.tag){case 1:return tt(t.type)&&Vs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yi(),ie(et),ie(Ve),Fd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $d(t),null;case 13:if(ie(se),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(se),null;case 4:return yi(),null;case 10:return Id(t.type._context),null;case 22:case 23:return qd(),null;case 24:return null;default:return null}}var Wa=!1,$e=!1,S_=typeof WeakSet=="function"?WeakSet:Set,I=null;function ei(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){de(e,t,r)}else n.current=null}function Wc(e,t,n){try{n()}catch(r){de(e,t,r)}}var $p=!1;function b_(e,t){if(Ac=$s,e=_3(),Pd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var g;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++u===i&&(s=a),f===o&&++c===r&&(l=a),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rc={focusedElem:e,selectionRange:n},$s=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var y=S.memoizedProps,E=S.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?y:Et(t.type,y),E);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(A(163))}}catch(w){de(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return S=$p,$p=!1,S}function uo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Wc(t,n,o)}i=i.next}while(i!==r)}}function Bl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Yc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function mm(e){var t=e.alternate;t!==null&&(e.alternate=null,mm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ft],delete t[Ro],delete t[Lc],delete t[i_],delete t[o_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function gm(e){return e.tag===5||e.tag===3||e.tag===4}function Fp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=zs));else if(r!==4&&(e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}var De=null,Ct=!1;function xn(e,t,n){for(n=n.child;n!==null;)ym(e,t,n),n=n.sibling}function ym(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Dl,n)}catch{}switch(n.tag){case 5:$e||ei(n,t);case 6:var r=De,i=Ct;De=null,xn(e,t,n),De=r,Ct=i,De!==null&&(Ct?(e=De,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):De.removeChild(n.stateNode));break;case 18:De!==null&&(Ct?(e=De,n=n.stateNode,e.nodeType===8?Au(e.parentNode,n):e.nodeType===1&&Au(e,n),Co(e)):Au(De,n.stateNode));break;case 4:r=De,i=Ct,De=n.stateNode.containerInfo,Ct=!0,xn(e,t,n),De=r,Ct=i;break;case 0:case 11:case 14:case 15:if(!$e&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&Wc(n,t,a),i=i.next}while(i!==r)}xn(e,t,n);break;case 1:if(!$e&&(ei(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){de(n,t,s)}xn(e,t,n);break;case 21:xn(e,t,n);break;case 22:n.mode&1?($e=(r=$e)||n.memoizedState!==null,xn(e,t,n),$e=r):xn(e,t,n);break;default:xn(e,t,n)}}function Bp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new S_),t.forEach(function(r){var i=k_.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function xt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=ge()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*E_(r/1960))-r,10e?16:e,Dn===null)var r=!1;else{if(e=Dn,Dn=null,el=0,Y&6)throw Error(A(331));var i=Y;for(Y|=4,I=e.current;I!==null;){var o=I,a=o.child;if(I.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lge()-Gd?hr(e,0):Yd|=n),nt(e,t)}function Om(e,t){t===0&&(e.mode&1?(t=Ma,Ma<<=1,!(Ma&130023424)&&(Ma=4194304)):t=1);var n=We();e=dn(e,t),e!==null&&(fa(e,t,n),nt(e,n))}function R_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Om(e,n)}function k_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(A(314))}r!==null&&r.delete(t),Om(e,n)}var jm;jm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||et.current)Je=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Je=!1,y_(e,t,n);Je=!!(e.flags&131072)}else Je=!1,ae&&t.flags&1048576&&R3(t,Hs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ys(e,t),e=t.pendingProps;var i=vi(t,Ve.current);ui(t,n),i=zd(null,t,r,e,i,n);var o=Vd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tt(r)?(o=!0,Us(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Td(t),i.updater=$l,t.stateNode=i,i._reactInternals=t,Fc(t,r,e,n),t=Vc(null,t,r,!0,o,n)):(t.tag=0,ae&&o&&Ad(t),Ke(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ys(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=L_(r),e=Et(r,e),i){case 0:t=zc(null,t,r,e,n);break e;case 1:t=Np(null,t,r,e,n);break e;case 11:t=Lp(null,t,r,e,n);break e;case 14:t=Ip(null,t,r,Et(r.type,e),n);break e}throw Error(A(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Et(r,i),zc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Et(r,i),Np(e,t,r,i,n);case 3:e:{if(cm(t),e===null)throw Error(A(387));r=t.pendingProps,o=t.memoizedState,i=o.element,I3(e,t),Gs(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=_i(Error(A(423)),t),t=Tp(e,t,r,n,i);break e}else if(r!==i){i=_i(Error(A(424)),t),t=Tp(e,t,r,n,i);break e}else for(ot=$n(t.stateNode.containerInfo.firstChild),at=t,ae=!0,Ot=null,n=$3(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(mi(),r===i){t=hn(e,t,n);break e}Ke(e,t,r,n)}t=t.child}return t;case 5:return F3(t),e===null&&Tc(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,kc(r,i)?a=null:o!==null&&kc(r,o)&&(t.flags|=32),um(e,t),Ke(e,t,a,n),t.child;case 6:return e===null&&Tc(t),null;case 13:return fm(e,t,n);case 4:return Md(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gi(t,null,r,n):Ke(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Et(r,i),Lp(e,t,r,i,n);case 7:return Ke(e,t,t.pendingProps,n),t.child;case 8:return Ke(e,t,t.pendingProps.children,n),t.child;case 12:return Ke(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,Z(Ws,r._currentValue),r._currentValue=a,o!==null)if(Dt(o.value,a)){if(o.children===i.children&&!et.current){t=hn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=on(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Mc(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(A(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Mc(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Ke(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ui(t,n),i=St(i),r=r(i),t.flags|=1,Ke(e,t,r,n),t.child;case 14:return r=t.type,i=Et(r,t.pendingProps),i=Et(r.type,i),Ip(e,t,r,i,n);case 15:return sm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Et(r,i),ys(e,t),t.tag=1,tt(r)?(e=!0,Us(t)):e=!1,ui(t,n),T3(t,r,i),Fc(t,r,i,n),Vc(null,t,r,!0,e,n);case 19:return dm(e,t,n);case 22:return lm(e,t,n)}throw Error(A(156,t.tag))};function Pm(e,t){return e3(e,t)}function D_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gt(e,t,n,r){return new D_(e,t,n,r)}function Zd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function L_(e){if(typeof e=="function")return Zd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gd)return 11;if(e===yd)return 14}return 2}function Vn(e,t){var n=e.alternate;return n===null?(n=gt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ss(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")Zd(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Hr:return pr(n.children,i,o,t);case md:a=8,i|=8;break;case uc:return e=gt(12,n,t,i|2),e.elementType=uc,e.lanes=o,e;case cc:return e=gt(13,n,t,i),e.elementType=cc,e.lanes=o,e;case fc:return e=gt(19,n,t,i),e.elementType=fc,e.lanes=o,e;case Mv:return Vl(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nv:a=10;break e;case Tv:a=9;break e;case gd:a=11;break e;case yd:a=14;break e;case Cn:a=16,r=null;break e}throw Error(A(130,e==null?e:typeof e,""))}return t=gt(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function pr(e,t,n,r){return e=gt(7,e,r,t),e.lanes=n,e}function Vl(e,t,n,r){return e=gt(22,e,r,t),e.elementType=Mv,e.lanes=n,e.stateNode={isHidden:!1},e}function Mu(e,t,n){return e=gt(6,e,null,t),e.lanes=n,e}function $u(e,t,n){return t=gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function I_(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yu(0),this.expirationTimes=yu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Jd(e,t,n,r,i,o,a,s,l){return e=new I_(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=gt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Td(o),e}function N_(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Dm)}catch(e){console.error(e)}}Dm(),Rv.exports=ut;var rh=Rv.exports,Gp=rh;sc.createRoot=Gp.createRoot,sc.hydrateRoot=Gp.hydrateRoot;/** + * @license + * author: dudiq + * jr-translate.js v2.0.0 + * Released under the MIT license. + */const Qp=typeof navigator=="object"?navigator:void 0,Fu="en";class B_{constructor(){O(this,"defaultLanguage",Fu);O(this,"currentLanguage",(Qp&&Qp.language||"").substring(0,2).toLowerCase()||Fu);O(this,"languageList",[Fu])}setDefaultLanguage(t){this.defaultLanguage=t}setLanguage(t){this.currentLanguage=t}setLanguageList(t){this.languageList=t}}const pn=new B_,z_=typeof window<"u",V_=z_?!!window.Intl:!0,Bu={};function zu(e,t){Bu[e]!==!1&&(Bu[e]=V_?new Intl.NumberFormat(e):!1);const n=Bu[e];return isNaN(t)||n===!1?t+"":n.format(t)}function ef(e,t,n){if(n===void 0)return zu(e,t);const r=Math.pow(10,n),i=Math.floor(t*r),o=1/(r*10),a=Math.floor(t);let s=Math.floor(i-a*r)/r;s+=o;const l=zu(e,a);let u=zu(e,s);return u=u.substring(1,u.length-1),l+(u.length>1?u:"")}function eo(e,t,n){return typeof e=="number"?ef(pn.currentLanguage,e,t):ef(e,t,n)}const U_={lang:"en",getIndex:e=>e!==1?1:0},K_={lang:"ru",getIndex:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},H_={lang:"es",getIndex:e=>e!==1?1:0},W_={lang:"fr",getIndex:e=>e>1?1:0},Y_=typeof console=="object";function ih(...e){Y_&&console.error("#translate:",...e)}const tf={};function qp(e){if(tf[e.lang]){ih(`trying register already defined plural - ${e.lang}`);return}tf[e.lang]=e}function oh(e,t,n){const r=tf[e];let i=t.key||"";const o=typeof n=="object";for(const a in t){if(a==="key")continue;const s=o?n[a]:n,l=t[a],u=r.getIndex(s);let c=l?l[u]:"";const d=ef(e,s);c=c.replace("{#}",d),i=i.replace(`{#${a}}`,c)}if(!o)return i;for(const a in n){if(Object.prototype.hasOwnProperty.call(t,a))continue;const s=n[a];i=i.replace(`{#${a}}`,`${s}`)}return i}oh.addPlural=function(e){if(!Array.isArray(e)){qp(e);return}e.forEach(function(t){qp(t)})};oh.addPlural([U_,K_,H_,W_]);const Mo={},G_=".";function Q_(e,t){if(!t)return e;if(typeof t!="object")return e.replace("{#}",`${t}`);let n=e;for(const r in t){const i=t[r];n=n.replace(`{#${r}}`,`${i}`)}return n}function q_(e,t,n){Array.isArray(n)?Xp(n,e,t,n):Xp(e,e,t,n)}function Lm(e,t,n,r){if(typeof e!="object"||Array.isArray(e)){q_(t,n,e);return}for(const i in e){const o=n?n+r+i:i,a=e[i];Lm(a,t,o,r)}}function X_(e){Mo[e]=Mo[e]||{}}function Z_(e,t){t.forEach(X_),Lm(e,t,"",G_)}function Xp(e,t,n,r){for(let i=0,o=e.length;iiw(e,"name",{value:t,configurable:!0});function Nm(e,t){var n;return n=class{constructor(i){O(this,"key");O(this,"message");O(this,"error");O(this,"stack");this.stack=i!=null&&i.key?void 0:new Error().stack,this.error=i,this.message=i!=null&&i.message?`${t}; ${i.message}`:t,this.key=e}},Yl(n,"ErrorClass"),n}Yl(Nm,"createErrorClass");var aa,ow=(aa=class{static getErrors(t,n){return Object.keys(n).reduce((i,o)=>{const a=n[o],s=`${t}.${String(o)}`;return i[o]=Nm(s,a),i},{})}},Yl(aa,"ErrorBlock"),aa);function Jn(e,t){return{[e]:ow.getErrors(e,t)}}Yl(Jn,"errorFactory");var aw=Object.defineProperty,Li=(e,t)=>aw(e,"name",{value:t,configurable:!0});function nf(e){return e?"error"in e:!1}Li(nf,"checkError");function H(e){return Array.isArray(e)?!!e.find(n=>nf(n)):nf(e)}Li(H,"isErr");function sw(e){return Array.isArray(e)?e.filter(n=>H(n)):H(e)?[e]:[]}Li(sw,"getErrorResults");function lw(e){return Array.isArray(e)?e.filter(n=>!H(n)):H(e)?[]:[e]}Li(lw,"getOkResults");function _e(e){return{error:e}}Li(_e,"resultErr");function be(e){return{data:e}}Li(be,"resultOk");function G(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vw(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mw(e){var t=vw(e,"string");return typeof t=="symbol"?t:String(t)}var Bt=Symbol("mobx-stored-annotations");function Kt(e){function t(n,r){if(ga(r))return e.decorate_20223_(n,r);Ni(n,r,e)}return Object.assign(t,e)}function Ni(e,t,n){an(e,Bt)||va(e,Bt,Cr({},e[Bt])),Cw(n)||(e[Bt][t]=n)}function gw(e){return an(e,Bt)||va(e,Bt,Cr({},e[Bt])),e[Bt]}function ga(e){return typeof e=="object"&&typeof e.kind=="string"}var F=Symbol("mobx administration"),ya=function(){function e(n){n===void 0&&(n="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Q.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.reportObserved=function(){return lg(this)},t.reportChanged=function(){yt(),ug(this),_t()},t.toString=function(){return this.name_},e}(),lh=Lr("Atom",ya);function Hm(e,t,n){t===void 0&&(t=ni),n===void 0&&(n=ni);var r=new ya(e);return t!==ni&&A6(r,t),n!==ni&&pg(r,n),r}function yw(e,t){return e===t}function _w(e,t){return gh(e,t)}function ww(e,t){return gh(e,t,1)}function Sw(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var il={identity:yw,structural:_w,default:Sw,shallow:ww};function Or(e,t,n){return hh(e)?e:Array.isArray(e)?Ae.array(e,{name:n}):vn(e)?Ae.object(e,void 0,{name:n}):Ii(e)?Ae.map(e,{name:n}):ma(e)?Ae.set(e,{name:n}):typeof e=="function"&&!eu(e)&&!Bo(e)?Bm(e)?xi(e):Fo(n,e):e}function bw(e,t,n){if(e==null||zo(e)||tu(e)||Nr(e)||Ti(e))return e;if(Array.isArray(e))return Ae.array(e,{name:n,deep:!1});if(vn(e))return Ae.object(e,void 0,{name:n,deep:!1});if(Ii(e))return Ae.map(e,{name:n,deep:!1});if(ma(e))return Ae.set(e,{name:n,deep:!1})}function ql(e){return e}function xw(e,t){return gh(e,t)?t:e}var Ew="override";function Cw(e){return e.annotationType_===Ew}function _a(e,t){return{annotationType_:e,options_:t,make_:Ow,extend_:jw,decorate_20223_:Pw}}function Ow(e,t,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,n,!1)===null?0:1;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if(eu(n.value))return 1;var o=Wm(e,this,t,n,!1);return Ut(r,t,o),2}function jw(e,t,n,r){var i=Wm(e,this,t,n);return e.defineProperty_(t,i,r)}function Pw(e,t){var n=t.kind,r=t.name,i=t.addInitializer,o=this,a=function(u){var c,d,f,g;return jr((c=(d=o.options_)==null?void 0:d.name)!=null?c:r.toString(),u,(f=(g=o.options_)==null?void 0:g.autoAction)!=null?f:!1)};if(n=="field"){i(function(){Ni(this,r,o)});return}if(n=="method"){var s;return eu(e)||(e=a(e)),(s=this.options_)!=null&&s.bound&&i(function(){var l=this,u=l[r].bind(l);u.isMobxAction=!0,l[r]=u}),e}G("Cannot apply '"+o.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(` +'`+o.annotationType_+"' can only be used on properties with a function value."))}function Aw(e,t,n,r){t.annotationType_,r.value}function Wm(e,t,n,r,i){var o,a,s,l,u,c,d;i===void 0&&(i=R.safeDescriptors),Aw(e,t,n,r);var f=r.value;if((o=t.options_)!=null&&o.bound){var g;f=f.bind((g=e.proxy_)!=null?g:e.target_)}return{value:jr((a=(s=t.options_)==null?void 0:s.name)!=null?a:n.toString(),f,(l=(u=t.options_)==null?void 0:u.autoAction)!=null?l:!1,(c=t.options_)!=null&&c.bound?(d=e.proxy_)!=null?d:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Ym(e,t){return{annotationType_:e,options_:t,make_:Rw,extend_:kw,decorate_20223_:Dw}}function Rw(e,t,n,r){var i;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!an(e.target_,t)||!Bo(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(Bo(n.value))return 1;var o=Gm(e,this,t,n,!1,!1);return Ut(r,t,o),2}function kw(e,t,n,r){var i,o=Gm(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,o,r)}function Dw(e,t){var n,r=t.name,i=t.addInitializer;return Bo(e)||(e=xi(e)),(n=this.options_)!=null&&n.bound&&i(function(){var o=this,a=o[r].bind(o);a.isMobXFlow=!0,o[r]=a}),e}function Lw(e,t,n,r){t.annotationType_,r.value}function Gm(e,t,n,r,i,o){o===void 0&&(o=R.safeDescriptors),Lw(e,t,n,r);var a=r.value;if(Bo(a)||(a=xi(a)),i){var s;a=a.bind((s=e.proxy_)!=null?s:e.target_),a.isMobXFlow=!0}return{value:a,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function uh(e,t){return{annotationType_:e,options_:t,make_:Iw,extend_:Nw,decorate_20223_:Tw}}function Iw(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Nw(e,t,n,r){return Mw(e,this,t,n),e.defineComputedProperty_(t,Cr({},this.options_,{get:n.get,set:n.set}),r)}function Tw(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var o=Tr(this)[F],a=Cr({},n.options_,{get:e,context:this});a.name||(a.name="ObservableObject."+r.toString()),o.values_.set(r,new bi(a))}),function(){return this[F].getObservablePropValue_(r)}}function Mw(e,t,n,r){t.annotationType_,r.get}function Xl(e,t){return{annotationType_:e,options_:t,make_:$w,extend_:Fw,decorate_20223_:Bw}}function $w(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Fw(e,t,n,r){var i,o;return zw(e,this),e.defineObservableProperty_(t,n.value,(i=(o=this.options_)==null?void 0:o.enhancer)!=null?i:Or,r)}function Bw(e,t){var n=this,r=t.kind,i=t.name,o=new WeakSet;function a(s,l){var u,c,d=Tr(s)[F],f=new vr(l,(u=(c=n.options_)==null?void 0:c.enhancer)!=null?u:Or,"ObservableObject."+i.toString(),!1);d.values_.set(i,f),o.add(s)}if(r=="accessor")return{get:function(){return o.has(this)||a(this,e.get.call(this)),this[F].getObservablePropValue_(i)},set:function(l){return o.has(this)||a(this,l),this[F].setObservablePropValue_(i,l)},init:function(l){return o.has(this)||a(this,l),l}}}function zw(e,t,n,r){t.annotationType_}var Vw="true",Uw=Qm();function Qm(e){return{annotationType_:Vw,options_:e,make_:Kw,extend_:Hw,decorate_20223_:Ww}}function Kw(e,t,n,r){var i,o;if(n.get)return Zl.make_(e,t,n,r);if(n.set){var a=jr(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:R.safeDescriptors?e.isPlainObject_:!0,set:a})===null?0:2:(Ut(r,t,{configurable:!0,set:a}),2)}if(r!==e.target_&&typeof n.value=="function"){var s;if(Bm(n.value)){var l,u=(l=this.options_)!=null&&l.autoBind?xi.bound:xi;return u.make_(e,t,n,r)}var c=(s=this.options_)!=null&&s.autoBind?Fo.bound:Fo;return c.make_(e,t,n,r)}var d=((i=this.options_)==null?void 0:i.deep)===!1?Ae.ref:Ae;if(typeof n.value=="function"&&(o=this.options_)!=null&&o.autoBind){var f;n.value=n.value.bind((f=e.proxy_)!=null?f:e.target_)}return d.make_(e,t,n,r)}function Hw(e,t,n,r){var i,o;if(n.get)return Zl.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:R.safeDescriptors?e.isPlainObject_:!0,set:jr(t.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var a;n.value=n.value.bind((a=e.proxy_)!=null?a:e.target_)}var s=((o=this.options_)==null?void 0:o.deep)===!1?Ae.ref:Ae;return s.extend_(e,t,n,r)}function Ww(e,t){G("'"+this.annotationType_+"' cannot be used as a decorator")}var Yw="observable",Gw="observable.ref",Qw="observable.shallow",qw="observable.struct",qm={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(qm);function Qa(e){return e||qm}var af=Xl(Yw),Xw=Xl(Gw,{enhancer:ql}),Zw=Xl(Qw,{enhancer:bw}),Jw=Xl(qw,{enhancer:xw}),Xm=Kt(af);function qa(e){return e.deep===!0?Or:e.deep===!1?ql:t6(e.defaultDecorator)}function e6(e){var t;return e?(t=e.defaultDecorator)!=null?t:Qm(e):void 0}function t6(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:Or}function Zm(e,t,n){if(ga(t))return af.decorate_20223_(e,t);if(Er(t)){Ni(e,t,af);return}return hh(e)?e:vn(e)?Ae.object(e,t,n):Array.isArray(e)?Ae.array(e,t):Ii(e)?Ae.map(e,t):ma(e)?Ae.set(e,t):typeof e=="object"&&e!==null?e:Ae.box(e,t)}Tm(Zm,Xm);var n6={box:function(t,n){var r=Qa(n);return new vr(t,qa(r),r.name,!0,r.equals)},array:function(t,n){var r=Qa(n);return(R.useProxies===!1||r.proxy===!1?Z6:V6)(t,qa(r),r.name)},map:function(t,n){var r=Qa(n);return new xg(t,qa(r),r.name)},set:function(t,n){var r=Qa(n);return new Og(t,qa(r),r.name)},object:function(t,n,r){return er(function(){return mg(R.useProxies===!1||(r==null?void 0:r.proxy)===!1?Tr({},r):F6({},r),t,n)})},ref:Kt(Xw),shallow:Kt(Zw),deep:Xm,struct:Kt(Jw)},Ae=Tm(Zm,n6),Jm="computed",r6="computed.struct",sf=uh(Jm),i6=uh(r6,{equals:il.structural}),Zl=function(t,n){if(ga(n))return sf.decorate_20223_(t,n);if(Er(n))return Ni(t,n,sf);if(vn(t))return Kt(uh(Jm,t));var r=vn(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new bi(r)};Object.assign(Zl,sf);Zl.struct=Kt(i6);var t0,n0,ol=0,o6=1,a6=(t0=(n0=rl(function(){},"name"))==null?void 0:n0.configurable)!=null?t0:!1,r0={value:"action",configurable:!0,writable:!1,enumerable:!1};function jr(e,t,n,r){n===void 0&&(n=!1);function i(){return s6(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},a6&&(r0.value=e,Ut(i,"name",r0)),i}function s6(e,t,n,r,i){var o=l6(e,t);try{return n.apply(r,i)}catch(a){throw o.error_=a,a}finally{u6(o)}}function l6(e,t,n,r){var i=!1,o=0,a=R.trackingDerivation,s=!t||!a;yt();var l=R.allowStateChanges;s&&(Ir(),l=ch(!0));var u=dh(!0),c={runAsAction_:s,prevDerivation_:a,prevAllowStateChanges_:l,prevAllowStateReads_:u,notifySpy_:i,startTime_:o,actionId_:o6++,parentActionId_:ol};return ol=c.actionId_,c}function u6(e){ol!==e.actionId_&&G(30),ol=e.parentActionId_,e.error_!==void 0&&(R.suppressReactionErrors=!0),fh(e.prevAllowStateChanges_),ho(e.prevAllowStateReads_),_t(),e.runAsAction_&&sn(e.prevDerivation_),R.suppressReactionErrors=!1}function ch(e){var t=R.allowStateChanges;return R.allowStateChanges=e,t}function fh(e){R.allowStateChanges=e}var eg;eg=Symbol.toPrimitive;var vr=function(e){Km(t,e);function t(r,i,o,a,s){var l;return o===void 0&&(o="ObservableValue"),s===void 0&&(s=il.default),l=e.call(this,o)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=i,l.name_=o,l.equals=s,l.value_=i(r,void 0,o),l}var n=t.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==R.UNCHANGED&&this.setNewValue_(i)},n.prepareNewValue_=function(i){if(vt(this)){var o=mt(this,{object:this,type:Ht,newValue:i});if(!o)return R.UNCHANGED;i=o.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?R.UNCHANGED:i},n.setNewValue_=function(i){var o=this.value_;this.value_=i,this.reportChanged(),At(this)&&Rt(this,{type:Ht,object:this,newValue:i,oldValue:o})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return wa(this,i)},n.observe_=function(i,o){return o&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Ht,newValue:this.value_,oldValue:void 0}),Sa(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Um(this.get())},n[eg]=function(){return this.valueOf()},t}(ya),tg;tg=Symbol.toPrimitive;var bi=function(){function e(n){this.dependenciesState_=Q.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Q.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new sl(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=al.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||G(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=jr("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?il.structural:il.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){p6(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.get=function(){if(this.isComputing_&&G(32,this.name_,this.derivation),R.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)lf(this)&&(this.warnAboutUntrackedRead_(),yt(),this.value_=this.computeValue_(!1),_t());else if(lg(this),lf(this)){var r=R.trackingContext;this.keepAlive_&&!r&&(R.trackingContext=this),this.trackAndCompute()&&h6(this),R.trackingContext=r}var i=this.value_;if(bs(i))throw i.cause;return i},t.set=function(r){if(this.setter_){this.isRunningSetter_&&G(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter_=!1}}else G(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===Q.NOT_TRACKING_,o=this.computeValue_(!0),a=i||bs(r)||bs(o)||!this.equals_(r,o);return a&&(this.value_=o),a},t.computeValue_=function(r){this.isComputing_=!0;var i=ch(!1),o;if(r)o=ng(this,this.derivation,this.scope_);else if(R.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(a){o=new sl(a)}return fh(i),this.isComputing_=!1,o},t.suspend_=function(){this.keepAlive_||(uf(this),this.value_=void 0)},t.observe_=function(r,i){var o=this,a=!0,s=void 0;return E6(function(){var l=o.get();if(!a||i){var u=Ir();r({observableKind:"computed",debugObjectName:o.name_,type:Ht,object:o,newValue:l,oldValue:s}),sn(u)}a=!1,s=l})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Um(this.get())},t[tg]=function(){return this.valueOf()},e}(),Jl=Lr("ComputedValue",bi),Q;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Q||(Q={}));var al;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(al||(al={}));var sl=function(t){this.cause=void 0,this.cause=t};function bs(e){return e instanceof sl}function lf(e){switch(e.dependenciesState_){case Q.UP_TO_DATE_:return!1;case Q.NOT_TRACKING_:case Q.STALE_:return!0;case Q.POSSIBLY_STALE_:{for(var t=dh(!0),n=Ir(),r=e.observing_,i=r.length,o=0;or&&(r=s.dependenciesState_)}for(n.length=i,e.newObserving_=null,o=t.length;o--;){var l=t[o];l.diffValue_===0&&ag(l,e),l.diffValue_=0}for(;i--;){var u=n[i];u.diffValue_===1&&(u.diffValue_=0,d6(u,e))}r!==Q.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function uf(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)ag(t[n],e);e.dependenciesState_=Q.NOT_TRACKING_}function rg(e){var t=Ir();try{return e()}finally{sn(t)}}function Ir(){var e=R.trackingDerivation;return R.trackingDerivation=null,e}function sn(e){R.trackingDerivation=e}function dh(e){var t=R.allowStateReads;return R.allowStateReads=e,t}function ho(e){R.allowStateReads=e}function ig(e){if(e.dependenciesState_!==Q.UP_TO_DATE_){e.dependenciesState_=Q.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Q.UP_TO_DATE_}}var xs=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Es=!0,og=!1,R=function(){var e=ah();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Es=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new xs().version&&(Es=!1),Es?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new xs):(setTimeout(function(){og||G(35)},1),new xs)}();function f6(){if((R.pendingReactions.length||R.inBatch||R.isRunningReactions)&&G(36),og=!0,Es){var e=ah();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),R=new xs}}function d6(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function ag(e,t){e.observers_.delete(t),e.observers_.size===0&&sg(e)}function sg(e){e.isPendingUnobservation_===!1&&(e.isPendingUnobservation_=!0,R.pendingUnobservations.push(e))}function yt(){R.inBatch++}function _t(){if(--R.inBatch===0){cg();for(var e=R.pendingUnobservations,t=0;t0&&sg(e),!1)}function ug(e){e.lowestObserverState_!==Q.STALE_&&(e.lowestObserverState_=Q.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Q.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=Q.STALE_}))}function h6(e){e.lowestObserverState_!==Q.STALE_&&(e.lowestObserverState_=Q.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Q.POSSIBLY_STALE_?t.dependenciesState_=Q.STALE_:t.dependenciesState_===Q.UP_TO_DATE_&&(e.lowestObserverState_=Q.UP_TO_DATE_)}))}function p6(e){e.lowestObserverState_===Q.UP_TO_DATE_&&(e.lowestObserverState_=Q.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Q.UP_TO_DATE_&&(t.dependenciesState_=Q.POSSIBLY_STALE_,t.onBecomeStale_())}))}var ll=function(){function e(n,r,i,o){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Q.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=al.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=o}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,R.pendingReactions.push(this),cg())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){yt(),this.isScheduled_=!1;var r=R.trackingContext;if(R.trackingContext=this,lf(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}R.trackingContext=r,_t()}},t.track=function(r){if(!this.isDisposed_){yt(),this.isRunning_=!0;var i=R.trackingContext;R.trackingContext=this;var o=ng(this,r,void 0);R.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&uf(this),bs(o)&&this.reportExceptionInDerivation_(o.cause),_t()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(R.disableErrorBoundaries)throw r;var o="[mobx] uncaught error in '"+this+"'";R.suppressReactionErrors||console.error(o,r),R.globalReactionErrorHandlers.forEach(function(a){return a(r,i)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(yt(),uf(this),_t()))},t.getDisposer_=function(r){var i=this,o=function a(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",a)};return r==null||r.addEventListener==null||r.addEventListener("abort",o),o[F]=this,o},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){},e}(),v6=100,cf=function(t){return t()};function cg(){R.inBatch>0||R.isRunningReactions||cf(m6)}function m6(){R.isRunningReactions=!0;for(var e=R.pendingReactions,t=0;e.length>0;){++t===v6&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r0&&(t.dependencies=I6(e.observing_).map(gg)),t}function I6(e){return Array.from(new Set(e))}var N6=0;function yg(){this.message="FLOW_CANCELLED"}yg.prototype=Object.create(Error.prototype);var Uu=Ym("flow"),T6=Ym("flow.bound",{bound:!0}),xi=Object.assign(function(t,n){if(ga(n))return Uu.decorate_20223_(t,n);if(Er(n))return Ni(t,n,Uu);var r=t,i=r.name||"",o=function(){var s=this,l=arguments,u=++N6,c=ii(i+" - runid: "+u+" - init",r).apply(s,l),d,f=void 0,g=new Promise(function(S,y){var E=0;d=y;function p(w){f=void 0;var x;try{x=ii(i+" - runid: "+u+" - yield "+E++,c.next).call(c,w)}catch(_){return y(_)}v(x)}function h(w){f=void 0;var x;try{x=ii(i+" - runid: "+u+" - yield "+E++,c.throw).call(c,w)}catch(_){return y(_)}v(x)}function v(w){if(Lt(w==null?void 0:w.then)){w.then(v,y);return}return w.done?S(w.value):(f=Promise.resolve(w.value),f.then(p,h))}p(void 0)});return g.cancel=ii(i+" - runid: "+u+" - cancel",function(){try{f&&i0(f);var S=c.return(void 0),y=Promise.resolve(S.value);y.then(ni,ni),i0(y),d(new yg)}catch(E){d(E)}}),g};return o.isMobXFlow=!0,o},Uu);xi.bound=Kt(T6);function i0(e){Lt(e.cancel)&&e.cancel()}function Bo(e){return(e==null?void 0:e.isMobXFlow)===!0}function M6(e,t){return e?t!==void 0?zo(e)?e[F].values_.has(t):!1:zo(e)||!!e[F]||lh(e)||ul(e)||Jl(e):!1}function hh(e){return M6(e)}function Jt(e,t){t===void 0&&(t=void 0),yt();try{return e.apply(t)}finally{_t()}}function Fr(e){return e[F]}var $6={has:function(t,n){return Fr(t).has_(n)},get:function(t,n){return Fr(t).get_(n)},set:function(t,n,r){var i;return Er(n)?(i=Fr(t).set_(n,r,!0))!=null?i:!0:!1},deleteProperty:function(t,n){var r;return Er(n)?(r=Fr(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return(i=Fr(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return Fr(t).ownKeys_()},preventExtensions:function(t){G(13)}};function F6(e,t){var n,r;return $m(),e=Tr(e,t),(r=(n=e[F]).proxy_)!=null?r:n.proxy_=new Proxy(e,$6)}function vt(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function wa(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),Fm(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function mt(e,t){var n=Ir();try{for(var r=[].concat(e.interceptors_||[]),i=0,o=r.length;i0}function Sa(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),Fm(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function Rt(e,t){var n=Ir(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,o=r.length;i0?r.map(this.dehancer):r},t.intercept_=function(r){return wa(this,r)},t.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Sa(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&G("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var o=new Array(r-i),a=0;a0&&Rg(r+i+1)},t.spliceWithArray_=function(r,i,o){var a=this;this.atom_;var s=this.values_.length;if(r===void 0?r=0:r>s?r=s:r<0&&(r=Math.max(0,s+r)),arguments.length===1?i=s-r:i==null?i=0:i=Math.max(0,Math.min(i,s-r)),o===void 0&&(o=rf),vt(this)){var l=mt(this,{object:this.proxy_,type:o0,index:r,removedCount:i,added:o});if(!l)return rf;i=l.removedCount,o=l.added}if(o=o.length===0?o:o.map(function(d){return a.enhancer_(d,void 0)}),this.legacyMode_){var u=o.length-i;this.updateArrayLength_(s,u)}var c=this.spliceItemsIntoValues_(r,i,o);return(i!==0||o.length!==0)&&this.notifyArraySplice_(r,o,c),this.dehanceValues_(c)},t.spliceItemsIntoValues_=function(r,i,o){if(o.length=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},t.set_=function(r,i){var o=this.values_;if(this.legacyMode_&&r>o.length&&G(17,r,o.length),r2?r-2:0),o=2;o-1?(this.splice(r,1),!0):!1}};J("at",ft);J("concat",ft);J("flat",ft);J("includes",ft);J("indexOf",ft);J("join",ft);J("lastIndexOf",ft);J("slice",ft);J("toString",ft);J("toLocaleString",ft);J("toSorted",ft);J("toSpliced",ft);J("with",ft);J("every",It);J("filter",It);J("find",It);J("findIndex",It);J("findLast",It);J("findLastIndex",It);J("flatMap",It);J("forEach",It);J("map",It);J("some",It);J("toReversed",It);J("reduce",wg);J("reduceRight",wg);function J(e,t){typeof Array.prototype[e]=="function"&&(cl[e]=t(e))}function ft(e){return function(){var t=this[F];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function It(e){return function(t,n){var r=this,i=this[F];i.atom_.reportObserved();var o=i.dehanceValues_(i.values_);return o[e](function(a,s){return t.call(n,a,s,r)})}}function wg(e){return function(){var t=this,n=this[F];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(o,a,s){return i(o,a,s,t)},r[e].apply(r,arguments)}}var U6=Lr("ObservableArrayAdministration",vh);function tu(e){return Ql(e)&&U6(e[F])}var Sg,bg,K6={},Ln="add",fl="delete";Sg=Symbol.iterator;bg=Symbol.toStringTag;var xg=function(){function e(n,r,i){var o=this;r===void 0&&(r=Or),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[F]=K6,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=i,Lt(Map)||G(18),er(function(){o.keysAtom_=Hm("ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,n&&o.merge(n)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var i=this;if(!R.trackingDerivation)return this.has_(r);var o=this.hasMap_.get(r);if(!o){var a=o=new vr(this.has_(r),ql,"ObservableMap.key?",!1);this.hasMap_.set(r,a),pg(a,function(){return i.hasMap_.delete(r)})}return o.get()},t.set=function(r,i){var o=this.has_(r);if(vt(this)){var a=mt(this,{type:o?Ht:Ln,object:this,newValue:i,name:r});if(!a)return this;i=a.newValue}return o?this.updateValue_(r,i):this.addValue_(r,i),this},t.delete=function(r){var i=this;if(this.keysAtom_,vt(this)){var o=mt(this,{type:fl,object:this,name:r});if(!o)return!1}if(this.has_(r)){var a=po(),s=At(this),l=s||a?{observableKind:"map",debugObjectName:this.name_,type:fl,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return Jt(function(){var u;i.keysAtom_.reportChanged(),(u=i.hasMap_.get(r))==null||u.setNewValue_(!1);var c=i.data_.get(r);c.setNewValue_(void 0),i.data_.delete(r)}),s&&Rt(this,l),!0}return!1},t.updateValue_=function(r,i){var o=this.data_.get(r);if(i=o.prepareNewValue_(i),i!==R.UNCHANGED){var a=po(),s=At(this),l=s||a?{observableKind:"map",debugObjectName:this.name_,type:Ht,object:this,oldValue:o.value_,name:r,newValue:i}:null;o.setNewValue_(i),s&&Rt(this,l)}},t.addValue_=function(r,i){var o=this;this.keysAtom_,Jt(function(){var u,c=new vr(i,o.enhancer_,"ObservableMap.key",!1);o.data_.set(r,c),i=c.value_,(u=o.hasMap_.get(r))==null||u.setNewValue_(!0),o.keysAtom_.reportChanged()});var a=po(),s=At(this),l=s||a?{observableKind:"map",debugObjectName:this.name_,type:Ln,object:this,name:r,newValue:i}:null;s&&Rt(this,l)},t.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var r=this,i=this.keys();return Vo({next:function(){var a=i.next(),s=a.done,l=a.value;return{done:s,value:s?void 0:r.get(l)}}})},t.entries=function(){var r=this,i=this.keys();return Vo({next:function(){var a=i.next(),s=a.done,l=a.value;return{done:s,value:s?void 0:[l,r.get(l)]}}})},t[Sg]=function(){return this.entries()},t.forEach=function(r,i){for(var o=ri(this),a;!(a=o()).done;){var s=a.value,l=s[0],u=s[1];r.call(i,u,l,this)}},t.merge=function(r){var i=this;return Nr(r)&&(r=new Map(r)),Jt(function(){vn(r)?dw(r).forEach(function(o){return i.set(o,r[o])}):Array.isArray(r)?r.forEach(function(o){var a=o[0],s=o[1];return i.set(a,s)}):Ii(r)?(r.constructor!==Map&&G(19,r),r.forEach(function(o,a){return i.set(a,o)})):r!=null&&G(20,r)}),this},t.clear=function(){var r=this;Jt(function(){rg(function(){for(var i=ri(r.keys()),o;!(o=i()).done;){var a=o.value;r.delete(a)}})})},t.replace=function(r){var i=this;return Jt(function(){for(var o=H6(r),a=new Map,s=!1,l=ri(i.data_.keys()),u;!(u=l()).done;){var c=u.value;if(!o.has(c)){var d=i.delete(c);if(d)s=!0;else{var f=i.data_.get(c);a.set(c,f)}}}for(var g=ri(o.entries()),S;!(S=g()).done;){var y=S.value,E=y[0],p=y[1],h=i.data_.has(E);if(i.set(E,p),i.data_.has(E)){var v=i.data_.get(E);a.set(E,v),h||(s=!0)}}if(!s)if(i.data_.size!==a.size)i.keysAtom_.reportChanged();else for(var w=i.data_.keys(),x=a.keys(),_=w.next(),b=x.next();!_.done;){if(_.value!==b.value){i.keysAtom_.reportChanged();break}_=w.next(),b=x.next()}i.data_=a}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,i){return Sa(this,r)},t.intercept_=function(r){return wa(this,r)},sh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:bg,get:function(){return"Map"}}]),e}(),Nr=Lr("ObservableMap",xg);function H6(e){if(Ii(e)||Nr(e))return e;if(Array.isArray(e))return new Map(e);if(vn(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return G(21,e)}var Eg,Cg,W6={};Eg=Symbol.iterator;Cg=Symbol.toStringTag;var Og=function(){function e(n,r,i){var o=this;r===void 0&&(r=Or),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[F]=W6,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Lt(Set)||G(22),this.enhancer_=function(a,s){return r(a,s,i)},er(function(){o.atom_=Hm(o.name_),n&&o.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.clear=function(){var r=this;Jt(function(){rg(function(){for(var i=ri(r.data_.values()),o;!(o=i()).done;){var a=o.value;r.delete(a)}})})},t.forEach=function(r,i){for(var o=ri(this),a;!(a=o()).done;){var s=a.value;r.call(i,s,s,this)}},t.add=function(r){var i=this;if(this.atom_,vt(this)){var o=mt(this,{type:Ln,object:this,newValue:r});if(!o)return this}if(!this.has(r)){Jt(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var a=!1,s=At(this),l=s||a?{observableKind:"set",debugObjectName:this.name_,type:Ln,object:this,newValue:r}:null;s&&Rt(this,l)}return this},t.delete=function(r){var i=this;if(vt(this)){var o=mt(this,{type:fl,object:this,oldValue:r});if(!o)return!1}if(this.has(r)){var a=!1,s=At(this),l=s||a?{observableKind:"set",debugObjectName:this.name_,type:fl,object:this,oldValue:r}:null;return Jt(function(){i.atom_.reportChanged(),i.data_.delete(r)}),s&&Rt(this,l),!0}return!1},t.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},t.entries=function(){var r=0,i=Array.from(this.keys()),o=Array.from(this.values());return Vo({next:function(){var s=r;return r+=1,sHu){for(var t=Hu;t=0&&n++;break}e=f0(e),t=f0(t);var s=a==="[object Array]";if(!s){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,u=t.constructor;if(l!==u&&!(Lt(l)&&l instanceof l&&Lt(u)&&u instanceof u)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var c=r.length;c--;)if(r[c]===e)return i[c]===t;if(r.push(e),i.push(t),s){if(c=e.length,c!==t.length)return!1;for(;c--;)if(!pf(e[c],t[c],n-1,r,i))return!1}else{var d=Object.keys(e),f;if(c=d.length,Object.keys(t).length!==c)return!1;for(;c--;)if(f=d[c],!(an(t,f)&&pf(e[f],t[f],n-1,r,i)))return!1}return r.pop(),i.pop(),!0}function f0(e){return tu(e)?e.slice():Ii(e)||Nr(e)||ma(e)||Ti(e)?Array.from(e.entries()):e}function Vo(e){return e[Symbol.iterator]=J6,e}function J6(){return this}["Symbol","Map","Set"].forEach(function(e){var t=ah();typeof t[e]>"u"&&G("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:y6,extras:{getDebugName:hf},$mobx:F});if(!N.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!ph)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function eS(e){e()}function tS(e){e||(e=eS),D6({reactionScheduler:e})}function nS(e){return L6(e)}var rS=1e4,iS=1e4,oS=function(){function e(t){var n=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=rS),clearTimeout(n.sweepTimeout),n.sweepTimeout=void 0;var i=Date.now();n.registrations.forEach(function(o,a){i-o.registeredAt>=r&&(n.finalize(o.value),n.registrations.delete(a))}),n.registrations.size>0&&n.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){n.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r){this.registrations.set(r,{value:n,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,iS))}}),e}(),aS=typeof FinalizationRegistry<"u"?FinalizationRegistry:oS,vf=new aS(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),Dg={exports:{}},Lg={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ci=N;function sS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lS=typeof Object.is=="function"?Object.is:sS,uS=Ci.useState,cS=Ci.useEffect,fS=Ci.useLayoutEffect,dS=Ci.useDebugValue;function hS(e,t){var n=t(),r=uS({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return fS(function(){i.value=n,i.getSnapshot=t,Wu(i)&&o({inst:i})},[e,n,t]),cS(function(){return Wu(i)&&o({inst:i}),e(function(){Wu(i)&&o({inst:i})})},[e]),dS(n),n}function Wu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lS(e,n)}catch{return!0}}function pS(e,t){return t()}var vS=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?pS:hS;Lg.useSyncExternalStore=Ci.useSyncExternalStore!==void 0?Ci.useSyncExternalStore:vS;Dg.exports=Lg;var Ig=Dg.exports;function d0(e){e.reaction=new ll("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function mS(e,t){t===void 0&&(t="observed");var n=j.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(s){return vf.unregister(r),r.onStoreChange=s,r.reaction||(d0(r),r.stateVersion=Symbol()),function(){var l;r.onStoreChange=null,(l=r.reaction)===null||l===void 0||l.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(d0(i),vf.register(n,i,i)),j.useDebugValue(i.reaction,nS),Ig.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var o,a;if(i.reaction.track(function(){try{o=e()}catch(s){a=s}}),a)throw a;return o}var Yu,Gu,Ng=typeof Symbol=="function"&&Symbol.for,gS=(Gu=(Yu=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Yu===void 0?void 0:Yu.configurable)!==null&&Gu!==void 0?Gu:!1,h0=Ng?Symbol.for("react.forward_ref"):typeof N.forwardRef=="function"&&N.forwardRef(function(e){return null}).$$typeof,p0=Ng?Symbol.for("react.memo"):typeof N.memo=="function"&&N.memo(function(e){return null}).$$typeof;function ee(e,t){var n;if(p0&&e.$$typeof===p0)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var r=(n=t==null?void 0:t.forwardRef)!==null&&n!==void 0?n:!1,i=e,o=e.displayName||e.name;if(h0&&e.$$typeof===h0&&(r=!0,i=e.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var a=function(s,l){return mS(function(){return i(s,l)},o)};return a.displayName=e.displayName,gS&&Object.defineProperty(a,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(a.contextTypes=e.contextTypes),r&&(a=N.forwardRef(a)),a=N.memo(a),_S(e,a),a}var yS={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function _S(e,t){Object.keys(e).forEach(function(n){yS[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}var Qu;tS(rh.unstable_batchedUpdates);Qu=vf.finalizeAllImmediately;var wS=Object.defineProperty,pe=(e,t)=>wS(e,"name",{value:t,configurable:!0}),{AdapterErrors:SS}=Jn("AdapterErrors",{UnexpectedError:"Unexpected error type"});function yh(e){const t=new Set;for(;e=Reflect.getPrototypeOf(e);){if(e.constructor===Object)return Array.from(t);Reflect.ownKeys(e).forEach(r=>{typeof r=="string"&&r!=="constructor"&&typeof e[r]=="function"&&t.add(r)})}return Array.from(t)}pe(yh,"getAllMethodNames");function Tg(e,t){typeof e[t]=="function"&&(e[t]=e[t].bind(e))}pe(Tg,"bindContext");function Mg(e){yh(e).forEach(n=>{Tg(e,n)})}pe(Mg,"autoBind");function ba(e,t){var r;let n=(r=class extends e{constructor(...o){super(...o)}static instance(){return r.instanceLink||(r.instanceLink=new r),r.instanceLink}},pe(r,"InstanceClass"),O(r,"instanceLink"),r);return Object.defineProperty(n,"name",{value:t}),n}pe(ba,"declareClass");function Ne(){return pe(function(t){var r;let n=(r=class extends t{constructor(...o){super(...o),Mg(this)}},pe(r,"SubClass"),r);return ba(n,t.name)},"extend")}pe(Ne,"Service");var Wt=Ne;function nu(e,t){return async(...n)=>{try{return await e(...n)}catch(r){const i=t!=null&&t.Error?new t.Error(r):new SS.UnexpectedError(r);return _e(i)}}}pe(nu,"Adapter");function xa(e){var n;let t=(n=class extends e{constructor(...i){super(...i),yh(this).forEach(a=>{typeof this[a]=="function"&&(this[a]=nu(this[a].bind(this)))})}},pe(n,"SubClass"),n);return ba(t,e.name)}pe(xa,"AdapterService");function tr(){return pe(function(t){return ba(t,t.name)},"extend")}pe(tr,"DataProvider");var sa,$g=(sa=class{constructor(t){O(this,"data");O(this,"error");O(this,"isLoading");this.data=t==null?void 0:t.data,this.isLoading=(t==null?void 0:t.isLoading)??!0,this.error=t==null?void 0:t.error,_g(this)}get isDataLoaded(){return this.isLoading?!1:!!this.data}get isError(){return!!this.error}start(){this.isLoading=!0,this.error=void 0}setResult(t){const n=H(t);n&&(this.data=void 0,this.error=t.error),n||(this.error=void 0,this.data=t.data)}finish(){this.isLoading=!1}},pe(sa,"DataState"),sa);function k(e){if("instance"in e&&typeof e.instance=="function")return e.instance();debugger;throw new Error("Class definition must be instantiated")}pe(k,"Inject");function Fg(e){return Object.keys(e).reduce((n,r)=>(n[r]=k(e[r]),n),{})}pe(Fg,"getInstances");var bS="@repo:",la,ru=(la=class{constructor(t,n){O(this,"key");O(this,"options");O(this,"value");this.key=t,this.options=n,this.value=this.getValue(),window.addEventListener("storage",r=>{(!r.key||r.key===this.usedKey)&&(this.value=this.getValue())}),ph(this,{value:Ae})}get usedKey(){var t;return`${((t=this.options)==null?void 0:t.prefix)||bS}-${this.key}`}set(t){this.value=t;try{const n=JSON.stringify({value:t});window.localStorage.setItem(this.usedKey,n)}catch{}}getValue(){var n,r;const t=window.localStorage.getItem(this.usedKey);if(!t)return(n=this.options)==null?void 0:n.initialValue;try{const i=JSON.parse(t);return i?i.value:(r=this.options)==null?void 0:r.initialValue}catch{}}remove(){return window.localStorage.removeItem(this.usedKey)}},pe(la,"LocalStorageItem"),la),v0=Symbol("annotationsSymbol"),m0=Object.prototype;function Bg(e){const t={},n={};if(hh(e))throw new Error("Target must not be observable");let r=e[v0];if(!r){r={};let i=e;for(;i&&i!==m0;)Reflect.ownKeys(i).forEach(a=>{a===F||a==="constructor"||(r[a]=t&&a in t?t[a]:!0)}),i=Object.getPrototypeOf(i);const o=Object.getPrototypeOf(e);o&&o!==m0&&Object.defineProperty(o,v0,{value:r})}return ph(e,r,n)}pe(Bg,"makeSimpleAutoObserv");function dt(){return pe(function(t){var r;let n=(r=class extends t{constructor(...o){super(...o),Bg(this)}},pe(r,"SubClass"),r);return ba(n,t.name)},"extend")}pe(dt,"Store");var ua;ua=class{constructor(){O(this,"isOpen",!1);O(this,"handleOpen",()=>{this.isOpen=!0});O(this,"handleClose",()=>{this.isOpen=!1});O(this,"handleToggle",()=>{if(this.isOpen){this.handleClose();return}this.handleOpen()});_g(this)}},pe(ua,"Toggle");function ke(...e){return N.useMemo(()=>Fg(...e),[])}const{AnalyticErrors:xS}=Jn("AnalyticErrors",{GetRangeReport:"",UnexpectedGetRangeReport:""}),re=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,we=Object.keys,Be=Array.isArray;function Ge(e,t){return typeof t!="object"||we(t).forEach(function(n){e[n]=t[n]}),e}typeof Promise>"u"||re.Promise||(re.Promise=Promise);const Uo=Object.getPrototypeOf,ES={}.hasOwnProperty;function lt(e,t){return ES.call(e,t)}function Oi(e,t){typeof t=="function"&&(t=t(Uo(e))),(typeof Reflect>"u"?we:Reflect.ownKeys)(t).forEach(n=>{ln(e,n,t[n])})}const zg=Object.defineProperty;function ln(e,t,n,r){zg(e,t,Ge(n&<(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function fi(e){return{from:function(t){return e.prototype=Object.create(t.prototype),ln(e.prototype,"constructor",e),{extend:Oi.bind(null,e.prototype)}}}}const CS=Object.getOwnPropertyDescriptor;function _h(e,t){let n;return CS(e,t)||(n=Uo(e))&&_h(n,t)}const OS=[].slice;function dl(e,t,n){return OS.call(e,t,n)}function Vg(e,t){return t(e)}function to(e){if(!e)throw new Error("Assertion Failed")}function Ug(e){re.setImmediate?setImmediate(e):setTimeout(e,0)}function Kg(e,t){return e.reduce((n,r,i)=>{var o=t(r,i);return o&&(n[o[0]]=o[1]),n},{})}function un(e,t){if(typeof t=="string"&<(e,t))return e[t];if(!t)return e;if(typeof t!="string"){for(var n=[],r=0,i=t.length;r["Int","Uint","Float"].map(t=>t+e+"Array")))).filter(e=>re[e]),PS=Yg.map(e=>re[e]);Kg(Yg,e=>[e,!0]);let jn=null;function Ea(e){jn=typeof WeakMap<"u"&&new WeakMap;const t=mf(e);return jn=null,t}function mf(e){if(!e||typeof e!="object")return e;let t=jn&&jn.get(e);if(t)return t;if(Be(e)){t=[],jn&&jn.set(e,t);for(var n=0,r=e.length;n=0)t=e;else{const o=Uo(e);for(var i in t=o===Object.prototype?{}:Object.create(o),jn&&jn.set(e,t),e)lt(e,i)&&(t[i]=mf(e[i]))}return t}const{toString:AS}={};function gf(e){return AS.call(e).slice(8,-1)}const yf=typeof Symbol<"u"?Symbol.iterator:"@@iterator",RS=typeof yf=="symbol"?function(e){var t;return e!=null&&(t=e[yf])&&t.apply(e)}:function(){return null},Ur={};function en(e){var t,n,r,i;if(arguments.length===1){if(Be(e))return e.slice();if(this===Ur&&typeof e=="string")return[e];if(i=RS(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(e==null)return[e];if(typeof(t=e.length)=="number"){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}const wh=typeof Symbol<"u"?e=>e[Symbol.toStringTag]==="AsyncFunction":()=>!1;var Yt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Gg(e,t){Yt=e,Qg=t}var Qg=()=>!0;const kS=!new Error("").stack;function Mr(){if(kS)try{throw Mr.arguments,new Error}catch(e){return e}return new Error}function _f(e,t){var n=e.stack;return n?(t=t||0,n.indexOf(e.name)===0&&(t+=(e.name+e.message).split(` +`).length),n.split(` +`).slice(t).filter(Qg).map(r=>` +`+r).join("")):""}var qg=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Sh=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(qg),DS={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function di(e,t){this._e=Mr(),this.name=e,this.message=t}function Xg(e,t){return e+". Errors: "+Object.keys(t).map(n=>t[n].toString()).filter((n,r,i)=>i.indexOf(n)===r).join(` +`)}function hl(e,t,n,r){this._e=Mr(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Xg(e,t)}function vo(e,t){this._e=Mr(),this.name="BulkError",this.failures=Object.keys(t).map(n=>t[n]),this.failuresByPos=t,this.message=Xg(e,t)}fi(di).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+_f(this._e,2))}},toString:function(){return this.name+": "+this.message}}),fi(hl).from(di),fi(vo).from(di);var bh=Sh.reduce((e,t)=>(e[t]=t+"Error",e),{});const LS=di;var B=Sh.reduce((e,t)=>{var n=t+"Error";function r(i,o){this._e=Mr(),this.name=n,i?typeof i=="string"?(this.message=`${i}${o?` + `+o:""}`,this.inner=o||null):typeof i=="object"&&(this.message=`${i.name} ${i.message}`,this.inner=i):(this.message=DS[t]||n,this.inner=null)}return fi(r).from(LS),e[t]=r,e},{});B.Syntax=SyntaxError,B.Type=TypeError,B.Range=RangeError;var g0=qg.reduce((e,t)=>(e[t+"Error"]=B[t],e),{}),Cs=Sh.reduce((e,t)=>(["Syntax","Type","Range"].indexOf(t)===-1&&(e[t+"Error"]=B[t]),e),{});function X(){}function Ko(e){return e}function IS(e,t){return e==null||e===Ko?t:function(n){return t(e(n))}}function Pr(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function NS(e,t){return e===X?t:function(){var n=e.apply(this,arguments);n!==void 0&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Pr(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Pr(i,this.onerror):i),o!==void 0?o:n}}function TS(e,t){return e===X?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Pr(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Pr(r,this.onerror):r)}}function MS(e,t){return e===X?t:function(n){var r=e.apply(this,arguments);Ge(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Pr(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Pr(o,this.onerror):o),r===void 0?a===void 0?void 0:a:Ge(r,a)}}function $S(e,t){return e===X?t:function(){return t.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function xh(e,t){return e===X?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then=="function"){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}Cs.ModifyError=hl,Cs.DexieError=di,Cs.BulkError=vo;var Ho={};const Zg=100,[wf,pl,Sf]=typeof Promise>"u"?[]:(()=>{let e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,Uo(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,Uo(t),e]})(),Jg=pl&&pl.then,Os=wf&&wf.constructor,Eh=!!Sf;var bf=!1,FS=Sf?()=>{Sf.then(Za)}:re.setImmediate?setImmediate.bind(null,Za):re.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{Za(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(Za,0)},mo=function(e,t){no.push([e,t]),vl&&(FS(),vl=!1)},xf=!0,vl=!0,mr=[],js=[],Ef=null,Cf=Ko,hi={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:w0,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{w0(e[0],e[1])}catch{}})}},$=hi,no=[],gr=0,Ps=[];function L(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=X,this._lib=!1;var t=this._PSD=$;if(Yt&&(this._stackHolder=Mr(),this._prev=null,this._numPrev=0),typeof e!="function"){if(e!==Ho)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&jf(this,this._value))}this._state=null,this._value=null,++t.ref,ty(this,e)}const Of={get:function(){var e=$,t=ml;function n(r,i){var o=!e.global&&(e!==$||t!==ml);const a=o&&!mn();var s=new L((l,u)=>{Ch(this,new ey(gl(r,e,o,a),gl(i,e,o,a),l,u,e))});return Yt&&iy(s,this),s}return n.prototype=Ho,n},set:function(e){ln(this,"then",e&&e.prototype===Ho?Of:{get:function(){return e},set:Of.set})}};function ey(e,t,n,r,i){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.resolve=n,this.reject=r,this.psd=i}function ty(e,t){try{t(n=>{if(e._state===null){if(n===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&Ca();n&&typeof n.then=="function"?ty(e,(i,o)=>{n instanceof L?n._then(i,o):n.then(i,o)}):(e._state=!0,e._value=n,ny(e)),r&&Oa()}},jf.bind(null,e))}catch(n){jf(e,n)}}function jf(e,t){if(js.push(t),e._state===null){var n=e._lib&&Ca();t=Cf(t),e._state=!1,e._value=t,Yt&&t!==null&&typeof t=="object"&&!t._promise&&function(r,i,o){try{r.apply(null,o)}catch(a){i&&i(a)}}(()=>{var r=_h(t,"stack");t._promise=e,ln(t,"stack",{get:()=>bf?r&&(r.get?r.get.apply(t):r.value):e.stack})}),function(r){mr.some(i=>i._value===r._value)||mr.push(r)}(e),ny(e),n&&Oa()}}function ny(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n{--gr==0&&Oh()},[]))}function Ch(e,t){if(e._state!==null){var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++gr,mo(BS,[n,e,t])}else e._listeners.push(t)}function BS(e,t,n){try{Ef=t;var r,i=t._value;t._state?r=e(i):(js.length&&(js=[]),r=e(i),js.indexOf(i)===-1&&function(o){for(var a=mr.length;a;)if(mr[--a]._value===o._value)return void mr.splice(a,1)}(t)),n.resolve(r)}catch(o){n.reject(o)}finally{Ef=null,--gr==0&&Oh(),--n.psd.ref||n.psd.finalize()}}function ry(e,t,n){if(t.length===n)return t;var r="";if(e._state===!1){var i,o,a=e._value;a!=null?(i=a.name||"Error",o=a.message||a,r=_f(a,0)):(i=a,o=""),t.push(i+(o?": "+o:"")+r)}return Yt&&((r=_f(e._stackHolder,2))&&t.indexOf(r)===-1&&t.push(r),e._prev&&ry(e._prev,t,n)),t}function iy(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function Za(){Ca()&&Oa()}function Ca(){var e=xf;return xf=!1,vl=!1,e}function Oa(){var e,t,n;do for(;no.length>0;)for(e=no,no=[],n=e.length,t=0;t0);xf=!0,vl=!0}function Oh(){var e=mr;mr=[],e.forEach(r=>{r._PSD.onunhandled.call(null,r._value,r)});for(var t=Ps.slice(0),n=t.length;n;)t[--n]()}function Ja(e){return new L(Ho,!1,e)}function oe(e,t){var n=$;return function(){var r=Ca(),i=$;try{return Wn(n,!0),e.apply(this,arguments)}catch(o){t&&t(o)}finally{Wn(i,!1),r&&Oa()}}}Oi(L.prototype,{then:Of,_then:function(e,t){Ch(this,new ey(null,null,e,t,$))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=arguments[0],n=arguments[1];return typeof t=="function"?this.then(null,r=>r instanceof t?n(r):Ja(r)):this.then(null,r=>r&&r.name===t?n(r):Ja(r))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),Ja(t)))},stack:{get:function(){if(this._stack)return this._stack;try{bf=!0;var e=ry(this,[],20).join(` +From previous: `);return this._state!==null&&(this._stack=e),e}finally{bf=!1}}},timeout:function(e,t){return e<1/0?new L((n,r)=>{var i=setTimeout(()=>r(new B.Timeout(t)),e);this.then(n,r).finally(clearTimeout.bind(null,i))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&ln(L.prototype,Symbol.toStringTag,"Dexie.Promise"),hi.env=oy(),Oi(L,{all:function(){var e=en.apply(null,arguments).map(es);return new L(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach((i,o)=>L.resolve(i).then(a=>{e[o]=a,--r||t(e)},n))})},resolve:e=>{if(e instanceof L)return e;if(e&&typeof e.then=="function")return new L((n,r)=>{e.then(n,r)});var t=new L(Ho,!0,e);return iy(t,Ef),t},reject:Ja,race:function(){var e=en.apply(null,arguments).map(es);return new L((t,n)=>{e.map(r=>L.resolve(r).then(t,n))})},PSD:{get:()=>$,set:e=>$=e},totalEchoes:{get:()=>ml},newPSD:Hn,usePSD:$i,scheduler:{get:()=>mo,set:e=>{mo=e}},rejectionMapper:{get:()=>Cf,set:e=>{Cf=e}},follow:(e,t)=>new L((n,r)=>Hn((i,o)=>{var a=$;a.unhandleds=[],a.onunhandled=o,a.finalize=Pr(function(){(function(s){function l(){s(),Ps.splice(Ps.indexOf(l),1)}Ps.push(l),++gr,mo(()=>{--gr==0&&Oh()},[])})(()=>{this.unhandleds.length===0?i():o(this.unhandleds[0])})},a.finalize),e()},t,n,r))}),Os&&(Os.allSettled&&ln(L,"allSettled",function(){const e=en.apply(null,arguments).map(es);return new L(t=>{e.length===0&&t([]);let n=e.length;const r=new Array(n);e.forEach((i,o)=>L.resolve(i).then(a=>r[o]={status:"fulfilled",value:a},a=>r[o]={status:"rejected",reason:a}).then(()=>--n||t(r)))})}),Os.any&&typeof AggregateError<"u"&&ln(L,"any",function(){const e=en.apply(null,arguments).map(es);return new L((t,n)=>{e.length===0&&n(new AggregateError([]));let r=e.length;const i=new Array(r);e.forEach((o,a)=>L.resolve(o).then(s=>t(s),s=>{i[a]=s,--r||n(new AggregateError(i))}))})}));const Fe={awaits:0,echoes:0,id:0};var zS=0,As=[],qu=0,ml=0,VS=0;function Hn(e,t,n,r){var i=$,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++VS;var a=hi.env;o.env=Eh?{Promise:L,PromiseProp:{value:L,configurable:!0,writable:!0},all:L.all,race:L.race,allSettled:L.allSettled,any:L.any,resolve:L.resolve,reject:L.reject,nthen:y0(a.nthen,o),gthen:y0(a.gthen,o)}:{},t&&Ge(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=$i(o,e,n,r);return o.ref===0&&o.finalize(),s}function Mi(){return Fe.id||(Fe.id=++zS),++Fe.awaits,Fe.echoes+=Zg,Fe.id}function mn(){return!!Fe.awaits&&(--Fe.awaits==0&&(Fe.id=0),Fe.echoes=Fe.awaits*Zg,!0)}function es(e){return Fe.echoes&&e&&e.constructor===Os?(Mi(),e.then(t=>(mn(),t),t=>(mn(),Ee(t)))):e}function US(e){++ml,Fe.echoes&&--Fe.echoes!=0||(Fe.echoes=Fe.id=0),As.push($),Wn(e,!0)}function KS(){var e=As[As.length-1];As.pop(),Wn(e,!1)}function Wn(e,t){var n=$;if((t?!Fe.echoes||qu++&&e===$:!qu||--qu&&e===$)||ay(t?US.bind(null,e):KS),e!==$&&($=e,n===hi&&(hi.env=oy()),Eh)){var r=hi.env.Promise,i=e.env;pl.then=i.nthen,r.prototype.then=i.gthen,(n.global||e.global)&&(Object.defineProperty(re,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function oy(){var e=re.Promise;return Eh?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(re,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:pl.then,gthen:e.prototype.then}:{}}function $i(e,t,n,r,i){var o=$;try{return Wn(e,!0),t(n,r,i)}finally{Wn(o,!1)}}function ay(e){Jg.call(wf,e)}function gl(e,t,n,r){return typeof e!="function"?e:function(){var i=$;n&&Mi(),Wn(t,!0);try{return e.apply(this,arguments)}finally{Wn(i,!1),r&&ay(mn)}}}function y0(e,t){return function(n,r){return e.call(this,gl(n,t),gl(r,t))}}(""+Jg).indexOf("[native code]")===-1&&(Mi=mn=X);const _0="unhandledrejection";function w0(e,t){var n;try{n=t.onuncatched(e)}catch{}if(n!==!1)try{var r,i={promise:t,reason:e};if(re.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(_0,!0,!0),Ge(r,i)):re.CustomEvent&&Ge(r=new CustomEvent(_0,{detail:i}),i),r&&re.dispatchEvent&&(dispatchEvent(r),!re.PromiseRejectionEvent&&re.onunhandledrejection))try{re.onunhandledrejection(r)}catch{}Yt&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch{}}var Ee=L.reject;function Pf(e,t,n,r){if(e.idbdb&&(e._state.openComplete||$.letThrough||e._vip)){var i=e._createTransaction(t,n,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===bh.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then(()=>Pf(e,t,n,r))):Ee(o)}return i._promise(t,(o,a)=>Hn(()=>($.trans=i,r(o,a,i)))).then(o=>i._completion.then(()=>o))}if(e._state.openComplete)return Ee(new B.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Ee(new B.DatabaseClosed);e.open().catch(X)}return e._state.dbReadyPromise.then(()=>Pf(e,t,n,r))}const S0="3.2.6",dr="￿",Af=-1/0,Gt="Invalid key provided. Keys must be of type string, number, Date or Array.",sy="String expected.",go=[],iu=typeof navigator<"u"&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),HS=iu,WS=iu,ly=e=>!/(dexie\.js|dexie\.min\.js)/.test(e),ou="__dbnames",Xu="readonly",Zu="readwrite";function Ar(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const uy={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ts(e){return typeof e!="string"||/\./.test(e)?t=>t:t=>(t[e]===void 0&&e in t&&delete(t=Ea(t))[e],t)}class YS{_trans(t,n,r){const i=this._tx||$.trans,o=this.name;function a(l,u,c){if(!c.schema[o])throw new B.NotFound("Table "+o+" not part of transaction");return n(c.idbtrans,c)}const s=Ca();try{return i&&i.db===this.db?i===$.trans?i._promise(t,a,r):Hn(()=>i._promise(t,a,r),{trans:i,transless:$.transless||$}):Pf(this.db,t,[this.name],a)}finally{s&&Oa()}}get(t,n){return t&&t.constructor===Object?this.where(t).first(n):this._trans("readonly",r=>this.core.get({trans:r,key:t}).then(i=>this.hook.reading.fire(i))).then(n)}where(t){if(typeof t=="string")return new this.db.WhereClause(this,t);if(Be(t))return new this.db.WhereClause(this,`[${t.join("+")}]`);const n=we(t);if(n.length===1)return this.where(n[0]).equals(t[n[0]]);const r=this.schema.indexes.concat(this.schema.primKey).filter(u=>{if(u.compound&&n.every(c=>u.keyPath.indexOf(c)>=0)){for(let c=0;cu.keyPath.length-c.keyPath.length)[0];if(r&&this.db._maxKey!==dr){const u=r.keyPath.slice(0,n.length);return this.where(u).equals(u.map(c=>t[c]))}!r&&Yt&&console.warn(`The query ${JSON.stringify(t)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);const{idxByName:i}=this.schema,o=this.db._deps.indexedDB;function a(u,c){try{return o.cmp(u,c)===0}catch{return!1}}const[s,l]=n.reduce(([u,c],d)=>{const f=i[d],g=t[d];return[u||f,u||!f?Ar(c,f&&f.multi?S=>{const y=un(S,d);return Be(y)&&y.some(E=>a(g,E))}:S=>a(g,un(S,d))):c]},[null,null]);return s?this.where(s.name).equals(t[s.keyPath]).filter(l):r?this.filter(l):this.where(n).equals("")}filter(t){return this.toCollection().and(t)}count(t){return this.toCollection().count(t)}offset(t){return this.toCollection().offset(t)}limit(t){return this.toCollection().limit(t)}each(t){return this.toCollection().each(t)}toArray(t){return this.toCollection().toArray(t)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(t){return new this.db.Collection(new this.db.WhereClause(this,Be(t)?`[${t.join("+")}]`:t))}reverse(){return this.toCollection().reverse()}mapToClass(t){this.schema.mappedClass=t;const n=r=>{if(!r)return r;const i=Object.create(t.prototype);for(var o in r)if(lt(r,o))try{i[o]=r[o]}catch{}return i};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=n,this.hook("reading",n),t}defineClass(){return this.mapToClass(function(t){Ge(this,t)})}add(t,n){const{auto:r,keyPath:i}=this.schema.primKey;let o=t;return i&&r&&(o=ts(i)(t)),this._trans("readwrite",a=>this.core.mutate({trans:a,type:"add",keys:n!=null?[n]:null,values:[o]})).then(a=>a.numFailures?L.reject(a.failures[0]):a.lastResult).then(a=>{if(i)try{kt(t,i,a)}catch{}return a})}update(t,n){if(typeof t!="object"||Be(t))return this.where(":id").equals(t).modify(n);{const r=un(t,this.schema.primKey.keyPath);if(r===void 0)return Ee(new B.InvalidArgument("Given object does not contain its primary key"));try{typeof n!="function"?we(n).forEach(i=>{kt(t,i,n[i])}):n(t,{value:t,primKey:r})}catch{}return this.where(":id").equals(r).modify(n)}}put(t,n){const{auto:r,keyPath:i}=this.schema.primKey;let o=t;return i&&r&&(o=ts(i)(t)),this._trans("readwrite",a=>this.core.mutate({trans:a,type:"put",values:[o],keys:n!=null?[n]:null})).then(a=>a.numFailures?L.reject(a.failures[0]):a.lastResult).then(a=>{if(i)try{kt(t,i,a)}catch{}return a})}delete(t){return this._trans("readwrite",n=>this.core.mutate({trans:n,type:"delete",keys:[t]})).then(n=>n.numFailures?L.reject(n.failures[0]):void 0)}clear(){return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"deleteRange",range:uy})).then(t=>t.numFailures?L.reject(t.failures[0]):void 0)}bulkGet(t){return this._trans("readonly",n=>this.core.getMany({keys:t,trans:n}).then(r=>r.map(i=>this.hook.reading.fire(i))))}bulkAdd(t,n,r){const i=Array.isArray(n)?n:void 0,o=(r=r||(i?void 0:n))?r.allKeys:void 0;return this._trans("readwrite",a=>{const{auto:s,keyPath:l}=this.schema.primKey;if(l&&i)throw new B.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(i&&i.length!==t.length)throw new B.InvalidArgument("Arguments objects and keys must have the same length");const u=t.length;let c=l&&s?t.map(ts(l)):t;return this.core.mutate({trans:a,type:"add",keys:i,values:c,wantResults:o}).then(({numFailures:d,results:f,lastResult:g,failures:S})=>{if(d===0)return o?f:g;throw new vo(`${this.name}.bulkAdd(): ${d} of ${u} operations failed`,S)})})}bulkPut(t,n,r){const i=Array.isArray(n)?n:void 0,o=(r=r||(i?void 0:n))?r.allKeys:void 0;return this._trans("readwrite",a=>{const{auto:s,keyPath:l}=this.schema.primKey;if(l&&i)throw new B.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(i&&i.length!==t.length)throw new B.InvalidArgument("Arguments objects and keys must have the same length");const u=t.length;let c=l&&s?t.map(ts(l)):t;return this.core.mutate({trans:a,type:"put",keys:i,values:c,wantResults:o}).then(({numFailures:d,results:f,lastResult:g,failures:S})=>{if(d===0)return o?f:g;throw new vo(`${this.name}.bulkPut(): ${d} of ${u} operations failed`,S)})})}bulkDelete(t){const n=t.length;return this._trans("readwrite",r=>this.core.mutate({trans:r,type:"delete",keys:t})).then(({numFailures:r,lastResult:i,failures:o})=>{if(r===0)return i;throw new vo(`${this.name}.bulkDelete(): ${r} of ${n} operations failed`,o)})}}function yo(e){var t={},n=function(a,s){if(s){for(var l=arguments.length,u=new Array(l-1);--l;)u[l-1]=arguments[l];return t[a].subscribe.apply(null,u),e}if(typeof a=="string")return t[a]};n.addEventType=o;for(var r=1,i=arguments.length;rAr(r(),t()):t,e.justLimit=n&&!r}function Rs(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new B.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function b0(e,t,n){const r=Rs(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir==="prev",unique:!!e.unique,query:{index:r,range:e.range}})}function ns(e,t,n,r){const i=e.replayFilter?Ar(e.filter,e.replayFilter()):e.filter;if(e.or){const o={},a=(s,l,u)=>{if(!i||i(l,u,f=>l.stop(f),f=>l.fail(f))){var c=l.primaryKey,d=""+c;d==="[object ArrayBuffer]"&&(d=""+new Uint8Array(c)),lt(o,d)||(o[d]=!0,t(s,l,u))}};return Promise.all([e.or._iterate(a,n),x0(b0(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return x0(b0(e,r,n),Ar(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function x0(e,t,n,r){var i=oe(r?(o,a,s)=>n(r(o),a,s):n);return e.then(o=>{if(o)return o.start(()=>{var a=()=>o.continue();t&&!t(o,s=>a=s,s=>{o.stop(s),a=X},s=>{o.fail(s),a=X})||i(o.value,o,s=>a=s),a()})})}function He(e,t){try{const n=E0(e),r=E0(t);if(n!==r)return n==="Array"?1:r==="Array"?-1:n==="binary"?1:r==="binary"?-1:n==="string"?1:r==="string"?-1:n==="Date"?1:r!=="Date"?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:ens(n,t,r,n.table.core))}count(t){return this._read(n=>{const r=this._ctx,i=r.table.core;if(Br(r,!0))return i.count({trans:n,query:{index:Rs(r,i.schema),range:r.range}}).then(a=>Math.min(a,r.limit));var o=0;return ns(r,()=>(++o,!1),n,i).then(()=>o)}).then(t)}sortBy(t,n){const r=t.split(".").reverse(),i=r[0],o=r.length-1;function a(u,c){return c?a(u[r[c]],c-1):u[i]}var s=this._ctx.dir==="next"?1:-1;function l(u,c){var d=a(u,o),f=a(c,o);return df?s:0}return this.toArray(function(u){return u.sort(l)}).then(n)}toArray(t){return this._read(n=>{var r=this._ctx;if(r.dir==="next"&&Br(r,!0)&&r.limit>0){const{valueMapper:i}=r,o=Rs(r,r.table.core.schema);return r.table.core.query({trans:n,limit:r.limit,values:!0,query:{index:o,range:r.range}}).then(({result:a})=>i?a.map(i):a)}{const i=[];return ns(r,o=>i.push(o),n,r.table.core).then(()=>i)}},t)}offset(t){var n=this._ctx;return t<=0||(n.offset+=t,Br(n)?ec(n,()=>{var r=t;return(i,o)=>r===0||(r===1?(--r,!1):(o(()=>{i.advance(r),r=0}),!1))}):ec(n,()=>{var r=t;return()=>--r<0})),this}limit(t){return this._ctx.limit=Math.min(this._ctx.limit,t),ec(this._ctx,()=>{var n=t;return function(r,i,o){return--n<=0&&i(o),n>=0}},!0),this}until(t,n){return Ju(this._ctx,function(r,i,o){return!t(r.value)||(i(o),n)}),this}first(t){return this.limit(1).toArray(function(n){return n[0]}).then(t)}last(t){return this.reverse().first(t)}filter(t){var n,r;return Ju(this._ctx,function(i){return t(i.value)}),n=this._ctx,r=t,n.isMatch=Ar(n.isMatch,r),this}and(t){return this.filter(t)}or(t){return new this.db.WhereClause(this._ctx.table,t,this)}reverse(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(r,i){t(i.key,i)})}eachUniqueKey(t){return this._ctx.unique="unique",this.eachKey(t)}eachPrimaryKey(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each(function(r,i){t(i.primaryKey,i)})}keys(t){var n=this._ctx;n.keysOnly=!n.isMatch;var r=[];return this.each(function(i,o){r.push(o.key)}).then(function(){return r}).then(t)}primaryKeys(t){var n=this._ctx;if(n.dir==="next"&&Br(n,!0)&&n.limit>0)return this._read(i=>{var o=Rs(n,n.table.core.schema);return n.table.core.query({trans:i,values:!1,limit:n.limit,query:{index:o,range:n.range}})}).then(({result:i})=>i).then(t);n.keysOnly=!n.isMatch;var r=[];return this.each(function(i,o){r.push(o.primaryKey)}).then(function(){return r}).then(t)}uniqueKeys(t){return this._ctx.unique="unique",this.keys(t)}firstKey(t){return this.limit(1).keys(function(n){return n[0]}).then(t)}lastKey(t){return this.reverse().firstKey(t)}distinct(){var t=this._ctx,n=t.index&&t.table.schema.idxByName[t.index];if(!n||!n.multi)return this;var r={};return Ju(this._ctx,function(i){var o=i.primaryKey.toString(),a=lt(r,o);return r[o]=!0,!a}),this}modify(t){var n=this._ctx;return this._write(r=>{var i;if(typeof t=="function")i=t;else{var o=we(t),a=o.length;i=function(y){for(var E=!1,p=0;p{const{failures:p,numFailures:h}=E;f+=y-h;for(let v of we(p))d.push(p[v])};return this.clone().primaryKeys().then(y=>{const E=p=>{const h=Math.min(c,y.length-p);return s.getMany({trans:r,keys:y.slice(p,p+h),cache:"immutable"}).then(v=>{const w=[],x=[],_=l?[]:null,b=[];for(let P=0;P0&&s.mutate({trans:r,type:"add",values:w}).then(P=>{for(let M in P.failures)b.splice(parseInt(M),1);S(w.length,P)})).then(()=>(x.length>0||C&&typeof t=="object")&&s.mutate({trans:r,type:"put",keys:_,values:x,criteria:C,changeSpec:typeof t!="function"&&t}).then(P=>S(x.length,P))).then(()=>(b.length>0||C&&t===tc)&&s.mutate({trans:r,type:"delete",keys:b,criteria:C}).then(P=>S(b.length,P))).then(()=>y.length>p+h&&E(p+c))})};return E(0).then(()=>{if(d.length>0)throw new hl("Error modifying one or more objects",d,f,g);return y.length})})})}delete(){var t=this._ctx,n=t.range;return Br(t)&&(t.isPrimKey&&!WS||n.type===3)?this._write(r=>{const{primaryKey:i}=t.table.core.schema,o=n;return t.table.core.count({trans:r,query:{index:i,range:o}}).then(a=>t.table.core.mutate({trans:r,type:"deleteRange",range:o}).then(({failures:s,lastResult:l,results:u,numFailures:c})=>{if(c)throw new hl("Could not delete some values",Object.keys(s).map(d=>s[d]),a-c);return a-c}))}):this.modify(tc)}}const tc=(e,t)=>t.value=null;function QS(e,t){return et?-1:e===t?0:1}function rt(e,t,n){var r=e instanceof fy?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function zr(e){return new e.Collection(e,()=>cy("")).limit(0)}function XS(e,t,n,r,i,o){for(var a=Math.min(e.length,r.length),s=-1,l=0;l=0?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[l],u)<0&&(s=l)}return atypeof y=="string"))return rt(e,sy);function f(y){i=function(p){return p==="next"?h=>h.toUpperCase():h=>h.toLowerCase()}(y),o=function(p){return p==="next"?h=>h.toLowerCase():h=>h.toUpperCase()}(y),a=y==="next"?QS:qS;var E=n.map(function(p){return{lower:o(p),upper:i(p)}}).sort(function(p,h){return a(p.lower,h.lower)});s=E.map(function(p){return p.upper}),l=E.map(function(p){return p.lower}),u=y,c=y==="next"?"":r}f("next");var g=new e.Collection(e,()=>En(s[0],l[d-1]+r));g._ondirectionchange=function(y){f(y)};var S=0;return g._addAlgorithm(function(y,E,p){var h=y.key;if(typeof h!="string")return!1;var v=o(h);if(t(v,l,S))return!0;for(var w=null,x=S;x0)&&(w=_)}return E(w!==null?function(){y.continue(w+c)}:p),!1}),g}function En(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function cy(e){return{type:1,lower:e,upper:e}}class fy{get Collection(){return this._ctx.table.db.Collection}between(t,n,r,i){r=r!==!1,i=i===!0;try{return this._cmp(t,n)>0||this._cmp(t,n)===0&&(r||i)&&(!r||!i)?zr(this):new this.Collection(this,()=>En(t,n,!r,!i))}catch{return rt(this,Gt)}}equals(t){return t==null?rt(this,Gt):new this.Collection(this,()=>cy(t))}above(t){return t==null?rt(this,Gt):new this.Collection(this,()=>En(t,void 0,!0))}aboveOrEqual(t){return t==null?rt(this,Gt):new this.Collection(this,()=>En(t,void 0,!1))}below(t){return t==null?rt(this,Gt):new this.Collection(this,()=>En(void 0,t,!1,!0))}belowOrEqual(t){return t==null?rt(this,Gt):new this.Collection(this,()=>En(void 0,t))}startsWith(t){return typeof t!="string"?rt(this,sy):this.between(t,t+dr,!0,!0)}startsWithIgnoreCase(t){return t===""?this.startsWith(t):rs(this,(n,r)=>n.indexOf(r[0])===0,[t],dr)}equalsIgnoreCase(t){return rs(this,(n,r)=>n===r[0],[t],"")}anyOfIgnoreCase(){var t=en.apply(Ur,arguments);return t.length===0?zr(this):rs(this,(n,r)=>r.indexOf(n)!==-1,t,"")}startsWithAnyOfIgnoreCase(){var t=en.apply(Ur,arguments);return t.length===0?zr(this):rs(this,(n,r)=>r.some(i=>n.indexOf(i)===0),t,dr)}anyOf(){const t=en.apply(Ur,arguments);let n=this._cmp;try{t.sort(n)}catch{return rt(this,Gt)}if(t.length===0)return zr(this);const r=new this.Collection(this,()=>En(t[0],t[t.length-1]));r._ondirectionchange=o=>{n=o==="next"?this._ascending:this._descending,t.sort(n)};let i=0;return r._addAlgorithm((o,a,s)=>{const l=o.key;for(;n(l,t[i])>0;)if(++i,i===t.length)return a(s),!1;return n(l,t[i])===0||(a(()=>{o.continue(t[i])}),!1)}),r}notEqual(t){return this.inAnyRange([[Af,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const t=en.apply(Ur,arguments);if(t.length===0)return new this.Collection(this);try{t.sort(this._ascending)}catch{return rt(this,Gt)}const n=t.reduce((r,i)=>r?r.concat([[r[r.length-1][1],i]]):[[Af,i]],null);return n.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})}inAnyRange(t,n){const r=this._cmp,i=this._ascending,o=this._descending,a=this._min,s=this._max;if(t.length===0)return zr(this);if(!t.every(h=>h[0]!==void 0&&h[1]!==void 0&&i(h[0],h[1])<=0))return rt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",B.InvalidArgument);const l=!n||n.includeLowers!==!1,u=n&&n.includeUppers===!0;let c,d=i;function f(h,v){return d(h[0],v[0])}try{c=t.reduce(function(h,v){let w=0,x=h.length;for(;w0){_[0]=a(_[0],v[0]),_[1]=s(_[1],v[1]);break}}return w===x&&h.push(v),h},[]),c.sort(f)}catch{return rt(this,Gt)}let g=0;const S=u?h=>i(h,c[g][1])>0:h=>i(h,c[g][1])>=0,y=l?h=>o(h,c[g][0])>0:h=>o(h,c[g][0])>=0;let E=S;const p=new this.Collection(this,()=>En(c[0][0],c[c.length-1][1],!l,!u));return p._ondirectionchange=h=>{h==="next"?(E=S,d=i):(E=y,d=o),c.sort(f)},p._addAlgorithm((h,v,w)=>{for(var x=h.key;E(x);)if(++g,g===c.length)return v(w),!1;return!!function(_){return!S(_)&&!y(_)}(x)||(this._cmp(x,c[g][1])===0||this._cmp(x,c[g][0])===0||v(()=>{d===i?h.continue(c[g][0]):h.continue(c[g][1])}),!1)}),p}startsWithAnyOf(){const t=en.apply(Ur,arguments);return t.every(n=>typeof n=="string")?t.length===0?zr(this):this.inAnyRange(t.map(n=>[n,n+dr])):rt(this,"startsWithAnyOf() only works with strings")}}function $t(e){return oe(function(t){return Wo(t),e(t.target.error),!1})}function Wo(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const Yo="storagemutated",Rn="x-storagemutated-1",Yn=yo(null,Yo);class ZS{_lock(){return to(!$.global),++this._reculock,this._reculock!==1||$.global||($.lockOwnerFor=this),this}_unlock(){if(to(!$.global),--this._reculock==0)for($.global||($.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{$i(t[1],t[0])}catch{}}return this}_locked(){return this._reculock&&$.lockOwnerFor!==this}create(t){if(!this.mode)return this;const n=this.db.idbdb,r=this.db._state.dbOpenError;if(to(!this.idbtrans),!t&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new B.DatabaseClosed(r);case"MissingAPIError":throw new B.MissingAPI(r.message,r);default:throw new B.OpenFailed(r)}if(!this.active)throw new B.TransactionInactive;return to(this._completion._state===null),(t=this.idbtrans=t||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=oe(i=>{Wo(i),this._reject(t.error)}),t.onabort=oe(i=>{Wo(i),this.active&&this._reject(new B.Abort(t.error)),this.active=!1,this.on("abort").fire(i)}),t.oncomplete=oe(()=>{this.active=!1,this._resolve(),"mutatedParts"in t&&Yn.storagemutated.fire(t.mutatedParts)}),this}_promise(t,n,r){if(t==="readwrite"&&this.mode!=="readwrite")return Ee(new B.ReadOnly("Transaction is readonly"));if(!this.active)return Ee(new B.TransactionInactive);if(this._locked())return new L((o,a)=>{this._blockedFuncs.push([()=>{this._promise(t,n,r).then(o,a)},$])});if(r)return Hn(()=>{var o=new L((a,s)=>{this._lock();const l=n(a,s,this);l&&l.then&&l.then(a,s)});return o.finally(()=>this._unlock()),o._lib=!0,o});var i=new L((o,a)=>{var s=n(o,a,this);s&&s.then&&s.then(o,a)});return i._lib=!0,i}_root(){return this.parent?this.parent._root():this}waitFor(t){var n=this._root();const r=L.resolve(t);if(n._waitingFor)n._waitingFor=n._waitingFor.then(()=>r);else{n._waitingFor=r,n._waitingQueue=[];var i=n.idbtrans.objectStore(n.storeNames[0]);(function a(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(i.get(-1/0).onsuccess=a)})()}var o=n._waitingFor;return new L((a,s)=>{r.then(l=>n._waitingQueue.push(oe(a.bind(null,l))),l=>n._waitingQueue.push(oe(s.bind(null,l)))).finally(()=>{n._waitingFor===o&&(n._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new B.Abort))}table(t){const n=this._memoizedTables||(this._memoizedTables={});if(lt(n,t))return n[t];const r=this.schema[t];if(!r)throw new B.NotFound("Table "+t+" not part of transaction");const i=new this.db.Table(t,r,this);return i.core=this.db.core.table(t),n[t]=i,i}}function Rf(e,t,n,r,i,o,a){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!a?"&":"")+(r?"*":"")+(i?"++":"")+dy(t)}}function dy(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function hy(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:Kg(n,r=>[r.name,r])}}let Go=e=>{try{return e.only([[]]),Go=()=>[[]],[[]]}catch{return Go=()=>dr,dr}};function kf(e){return e==null?()=>{}:typeof e=="string"?function(t){return t.split(".").length===1?r=>r[t]:r=>un(r,t)}(e):t=>un(t,e)}function O0(e){return[].slice.call(e)}let JS=0;function _o(e){return e==null?":id":typeof e=="string"?e:`[${e.join("+")}]`}function eb(e,t,n){function r(l){if(l.type===3)return null;if(l.type===4)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:u,upper:c,lowerOpen:d,upperOpen:f}=l;return u===void 0?c===void 0?null:t.upperBound(c,!!f):c===void 0?t.lowerBound(u,!!d):t.bound(u,c,!!d,!!f)}const{schema:i,hasGetAll:o}=function(l,u){const c=O0(l.objectStoreNames);return{schema:{name:l.name,tables:c.map(d=>u.objectStore(d)).map(d=>{const{keyPath:f,autoIncrement:g}=d,S=Be(f),y=f==null,E={},p={name:d.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:y,compound:S,keyPath:f,autoIncrement:g,unique:!0,extractKey:kf(f)},indexes:O0(d.indexNames).map(h=>d.index(h)).map(h=>{const{name:v,unique:w,multiEntry:x,keyPath:_}=h,b={name:v,compound:Be(_),keyPath:_,unique:w,multiEntry:x,extractKey:kf(_)};return E[_o(_)]=b,b}),getIndexByKeyPath:h=>E[_o(h)]};return E[":id"]=p.primaryKey,f!=null&&(E[_o(f)]=p.primaryKey),p})},hasGetAll:c.length>0&&"getAll"in u.objectStore(c[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),a=i.tables.map(l=>function(u){const c=u.name;return{name:c,schema:u,mutate:function({trans:d,type:f,keys:g,values:S,range:y}){return new Promise((E,p)=>{E=oe(E);const h=d.objectStore(c),v=h.keyPath==null,w=f==="put"||f==="add";if(!w&&f!=="delete"&&f!=="deleteRange")throw new Error("Invalid operation type: "+f);const{length:x}=g||S||{length:1};if(g&&S&&g.length!==S.length)throw new Error("Given keys array must have same length as given values array.");if(x===0)return E({numFailures:0,failures:{},results:[],lastResult:void 0});let _;const b=[],C=[];let P=0;const M=ve=>{++P,Wo(ve)};if(f==="deleteRange"){if(y.type===4)return E({numFailures:P,failures:C,results:[],lastResult:void 0});y.type===3?b.push(_=h.clear()):b.push(_=h.delete(r(y)))}else{const[ve,fe]=w?v?[S,g]:[S,null]:[g,null];if(w)for(let te=0;te{const fe=ve.target.result;b.forEach((te,bn)=>te.error!=null&&(C[bn]=te.error)),E({numFailures:P,failures:C,results:f==="delete"?g:b.map(te=>te.result),lastResult:fe})};_.onerror=ve=>{M(ve),U(ve)},_.onsuccess=U})},getMany:({trans:d,keys:f})=>new Promise((g,S)=>{g=oe(g);const y=d.objectStore(c),E=f.length,p=new Array(E);let h,v=0,w=0;const x=b=>{const C=b.target;p[C._pos]=C.result,++w===v&&g(p)},_=$t(S);for(let b=0;bnew Promise((g,S)=>{g=oe(g);const y=d.objectStore(c).get(f);y.onsuccess=E=>g(E.target.result),y.onerror=$t(S)}),query:function(d){return f=>new Promise((g,S)=>{g=oe(g);const{trans:y,values:E,limit:p,query:h}=f,v=p===1/0?void 0:p,{index:w,range:x}=h,_=y.objectStore(c),b=w.isPrimaryKey?_:_.index(w.name),C=r(x);if(p===0)return g({result:[]});if(d){const P=E?b.getAll(C,v):b.getAllKeys(C,v);P.onsuccess=M=>g({result:M.target.result}),P.onerror=$t(S)}else{let P=0;const M=E||!("openKeyCursor"in b)?b.openCursor(C):b.openKeyCursor(C),U=[];M.onsuccess=ve=>{const fe=M.result;return fe?(U.push(E?fe.value:fe.primaryKey),++P===p?g({result:U}):void fe.continue()):g({result:U})},M.onerror=$t(S)}})}(o),openCursor:function({trans:d,values:f,query:g,reverse:S,unique:y}){return new Promise((E,p)=>{E=oe(E);const{index:h,range:v}=g,w=d.objectStore(c),x=h.isPrimaryKey?w:w.index(h.name),_=S?y?"prevunique":"prev":y?"nextunique":"next",b=f||!("openKeyCursor"in x)?x.openCursor(r(v),_):x.openKeyCursor(r(v),_);b.onerror=$t(p),b.onsuccess=oe(C=>{const P=b.result;if(!P)return void E(null);P.___id=++JS,P.done=!1;const M=P.continue.bind(P);let U=P.continuePrimaryKey;U&&(U=U.bind(P));const ve=P.advance.bind(P),fe=()=>{throw new Error("Cursor not stopped")};P.trans=d,P.stop=P.continue=P.continuePrimaryKey=P.advance=()=>{throw new Error("Cursor not started")},P.fail=oe(p),P.next=function(){let te=1;return this.start(()=>te--?this.continue():this.stop()).then(()=>this)},P.start=te=>{const bn=new Promise((Ce,D)=>{Ce=oe(Ce),b.onerror=$t(D),P.fail=D,P.stop=z=>{P.stop=P.continue=P.continuePrimaryKey=P.advance=fe,Ce(z)}}),Nt=()=>{if(b.result)try{te()}catch(Ce){P.fail(Ce)}else P.done=!0,P.start=()=>{throw new Error("Cursor behind last entry")},P.stop()};return b.onsuccess=oe(Ce=>{b.onsuccess=Nt,Nt()}),P.continue=M,P.continuePrimaryKey=U,P.advance=ve,Nt(),bn},E(P)},p)})},count({query:d,trans:f}){const{index:g,range:S}=d;return new Promise((y,E)=>{const p=f.objectStore(c),h=g.isPrimaryKey?p:p.index(g.name),v=r(S),w=v?h.count(v):h.count();w.onsuccess=oe(x=>y(x.target.result)),w.onerror=$t(E)})}}}(l)),s={};return a.forEach(l=>s[l.name]=l),{stack:"dbcore",transaction:e.transaction.bind(e),table(l){if(!s[l])throw new Error(`Table '${l}' not found`);return s[l]},MIN_KEY:-1/0,MAX_KEY:Go(t),schema:i}}function Df({_novip:e},t){const n=t.db,r=function(i,o,{IDBKeyRange:a,indexedDB:s},l){return{dbcore:function(c,d){return d.reduce((f,{create:g})=>({...f,...g(f)}),c)}(eb(o,a,l),i.dbcore)}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach(i=>{const o=i.name;e.core.schema.tables.some(a=>a.name===o)&&(i.core=e.core.table(o),e[o]instanceof e.Table&&(e[o].core=i.core))})}function yl({_novip:e},t,n,r){n.forEach(i=>{const o=r[i];t.forEach(a=>{const s=_h(a,i);(!s||"value"in s&&s.value===void 0)&&(a===e.Transaction.prototype||a instanceof e.Transaction?ln(a,i,{get(){return this.table(i)},set(l){zg(this,i,{value:l,writable:!0,configurable:!0,enumerable:!0})}}):a[i]=new e.Table(i,o))})})}function Lf({_novip:e},t){t.forEach(n=>{for(let r in n)n[r]instanceof e.Table&&delete n[r]})}function tb(e,t){return e._cfg.version-t._cfg.version}function nb(e,t,n,r){const i=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,i);o.create(n),o._completion.catch(r);const a=o._reject.bind(o),s=$.transless||$;Hn(()=>{$.trans=o,$.transless=s,t===0?(we(i).forEach(l=>{nc(n,l,i[l].primKey,i[l].indexes)}),Df(e,n),L.follow(()=>e.on.populate.fire(o)).catch(a)):function({_novip:l},u,c,d){const f=[],g=l._versions;let S=l._dbSchema=Nf(l,l.idbdb,d),y=!1;const E=g.filter(h=>h._cfg.version>=u);function p(){return f.length?L.resolve(f.shift()(c.idbtrans)).then(p):L.resolve()}return E.forEach(h=>{f.push(()=>{const v=S,w=h._cfg.dbschema;Tf(l,v,d),Tf(l,w,d),S=l._dbSchema=w;const x=py(v,w);x.add.forEach(b=>{nc(d,b[0],b[1].primKey,b[1].indexes)}),x.change.forEach(b=>{if(b.recreate)throw new B.Upgrade("Not yet support for changing primary key");{const C=d.objectStore(b.name);b.add.forEach(P=>If(C,P)),b.change.forEach(P=>{C.deleteIndex(P.name),If(C,P)}),b.del.forEach(P=>C.deleteIndex(P))}});const _=h._cfg.contentUpgrade;if(_&&h._cfg.version>u){Df(l,d),c._memoizedTables={},y=!0;let b=Hg(w);x.del.forEach(U=>{b[U]=v[U]}),Lf(l,[l.Transaction.prototype]),yl(l,[l.Transaction.prototype],we(b),b),c.schema=b;const C=wh(_);let P;C&&Mi();const M=L.follow(()=>{if(P=_(c),P&&C){var U=mn.bind(null,null);P.then(U,U)}});return P&&typeof P.then=="function"?L.resolve(P):M.then(()=>P)}}),f.push(v=>{(!y||!HS)&&function(w,x){[].slice.call(x.db.objectStoreNames).forEach(_=>w[_]==null&&x.db.deleteObjectStore(_))}(h._cfg.dbschema,v),Lf(l,[l.Transaction.prototype]),yl(l,[l.Transaction.prototype],l._storeNames,l._dbSchema),c.schema=l._dbSchema})}),p().then(()=>{var h,v;v=d,we(h=S).forEach(w=>{v.db.objectStoreNames.contains(w)||nc(v,w,h[w].primKey,h[w].indexes)})})}(e,t,o,n).catch(a)})}function py(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const i=e[r],o=t[r];if(i){const a={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto&&!iu)a.recreate=!0,n.change.push(a);else{const s=i.idxByName,l=o.idxByName;let u;for(u in s)l[u]||a.del.push(u);for(u in l){const c=s[u],d=l[u];c?c.src!==d.src&&a.change.push(d):a.add.push(d)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}else n.add.push([r,o])}return n}function nc(e,t,n,r){const i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(o=>If(i,o)),i}function If(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Nf(e,t,n){const r={};return dl(t.objectStoreNames,0).forEach(i=>{const o=n.objectStore(i);let a=o.keyPath;const s=Rf(dy(a),a||"",!1,!1,!!o.autoIncrement,a&&typeof a!="string",!0),l=[];for(let c=0;c{if(t[r]!==null){var i=t[r].split(",").map((a,s)=>{const l=(a=a.trim()).replace(/([&*]|\+\+)/g,""),u=/^\[/.test(l)?l.match(/^\[(.*)\]$/)[1].split("+"):l;return Rf(l,u||null,/\&/.test(a),/\*/.test(a),/\+\+/.test(a),Be(u),s===0)}),o=i.shift();if(o.multi)throw new B.Schema("Primary key cannot be multi-valued");i.forEach(a=>{if(a.auto)throw new B.Schema("Only primary key can be marked as autoIncrement (++)");if(!a.keyPath)throw new B.Schema("Index must have a name and cannot be an empty string")}),n[r]=hy(r,o,i)}})}stores(t){const n=this.db;this._cfg.storesSource=this._cfg.storesSource?Ge(this._cfg.storesSource,t):t;const r=n._versions,i={};let o={};return r.forEach(a=>{Ge(i,a._cfg.storesSource),o=a._cfg.dbschema={},a._parseStoresSpec(i,o)}),n._dbSchema=o,Lf(n,[n._allTables,n,n.Transaction.prototype]),yl(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],we(o),o),n._storeNames=we(o),this}upgrade(t){return this._cfg.contentUpgrade=xh(this._cfg.contentUpgrade||X,t),this}}function jh(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new yr(ou,{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function Ph(e){return e&&typeof e.databases=="function"}function Mf(e){return Hn(function(){return $.letThrough=!0,e()})}function ib(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()}).finally(function(){return clearInterval(e)}):Promise.resolve()}function ob(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(()=>t.dbOpenError?Ee(t.dbOpenError):e);Yt&&(t.openCanceller._stackHolder=Mr()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function i(){if(t.openCanceller!==r)throw new B.DatabaseClosed("db.open() was cancelled")}let o=t.dbReadyResolve,a=null,s=!1;const l=()=>new L((u,c)=>{if(i(),!n)throw new B.MissingAPI;const d=e.name,f=t.autoSchema?n.open(d):n.open(d,Math.round(10*e.verno));if(!f)throw new B.MissingAPI;f.onerror=$t(c),f.onblocked=oe(e._fireOnBlocked),f.onupgradeneeded=oe(g=>{if(a=f.transaction,t.autoSchema&&!e._options.allowEmptyDB){f.onerror=Wo,a.abort(),f.result.close();const y=n.deleteDatabase(d);y.onsuccess=y.onerror=oe(()=>{c(new B.NoSuchDatabase(`Database ${d} doesnt exist`))})}else{a.onerror=$t(c);var S=g.oldVersion>Math.pow(2,62)?0:g.oldVersion;s=S<1,e._novip.idbdb=f.result,nb(e,S/10,a,c)}},c),f.onsuccess=oe(()=>{a=null;const g=e._novip.idbdb=f.result,S=dl(g.objectStoreNames);if(S.length>0)try{const E=g.transaction((y=S).length===1?y[0]:y,"readonly");t.autoSchema?function({_novip:p},h,v){p.verno=h.version/10;const w=p._dbSchema=Nf(0,h,v);p._storeNames=dl(h.objectStoreNames,0),yl(p,[p._allTables],we(w),w)}(e,g,E):(Tf(e,e._dbSchema,E),function(p,h){const v=py(Nf(0,p.idbdb,h),p._dbSchema);return!(v.add.length||v.change.some(w=>w.add.length||w.change.length))}(e,E)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Df(e,E)}catch{}var y;go.push(e),g.onversionchange=oe(E=>{t.vcFired=!0,e.on("versionchange").fire(E)}),g.onclose=oe(E=>{e.on("close").fire(E)}),s&&function({indexedDB:E,IDBKeyRange:p},h){!Ph(E)&&h!==ou&&jh(E,p).put({name:h}).catch(X)}(e._deps,d),u()},c)}).catch(u=>u&&u.name==="UnknownError"&&t.PR1398_maxLoop>0?(t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),l()):L.reject(u));return L.race([r,(typeof navigator>"u"?L.resolve():ib()).then(l)]).then(()=>(i(),t.onReadyBeingFired=[],L.resolve(Mf(()=>e.on.ready.fire(e.vip))).then(function u(){if(t.onReadyBeingFired.length>0){let c=t.onReadyBeingFired.reduce(xh,X);return t.onReadyBeingFired=[],L.resolve(Mf(()=>c(e.vip))).then(u)}}))).finally(()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1}).then(()=>e).catch(u=>{t.dbOpenError=u;try{a&&a.abort()}catch{}return r===t.openCanceller&&e._close(),Ee(u)}).finally(()=>{t.openComplete=!0,o()})}function $f(e){var t=o=>e.next(o),n=i(t),r=i(o=>e.throw(o));function i(o){return a=>{var s=o(a),l=s.value;return s.done?l:l&&typeof l.then=="function"?l.then(n,r):Be(l)?Promise.all(l).then(n,r):n(l)}}return i(t)()}function ab(e,t,n){var r=arguments.length;if(r<2)throw new B.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,Wg(i),n]}function vy(e,t,n,r,i){return L.resolve().then(()=>{const o=$.transless||$,a=e._createTransaction(t,n,e._dbSchema,r),s={trans:a,transless:o};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(d){return d.name===bh.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then(()=>vy(e,t,n,null,i))):Ee(d)}const l=wh(i);let u;l&&Mi();const c=L.follow(()=>{if(u=i.call(a,a),u)if(l){var d=mn.bind(null,null);u.then(d,d)}else typeof u.next=="function"&&typeof u.throw=="function"&&(u=$f(u))},s);return(u&&typeof u.then=="function"?L.resolve(u).then(d=>a.active?d:Ee(new B.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):c.then(()=>u)).then(d=>(r&&a._resolve(),a._completion.then(()=>d))).catch(d=>(a._reject(d),Ee(d)))})}function is(e,t,n){const r=Be(e)?e.slice():[e];for(let i=0;i0,p={...f,isVirtual:E,keyTail:d,keyLength:y,extractKey:kf(c),unique:!E&&f.unique};return S.push(p),p.isPrimaryKey||o.push(p),y>1&&a(y===2?c[0]:c.slice(0,y-1),d+1,f),S.sort((h,v)=>h.keyTail-v.keyTail),p}const s=a(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[s];for(const c of r.indexes)a(c.keyPath,0,c);function l(c){const d=c.query.index;return d.isVirtual?{...c,query:{index:d,range:(f=c.query.range,g=d.keyTail,{type:f.type===1?2:f.type,lower:is(f.lower,f.lowerOpen?e.MAX_KEY:e.MIN_KEY,g),lowerOpen:!0,upper:is(f.upper,f.upperOpen?e.MIN_KEY:e.MAX_KEY,g),upperOpen:!0})}}:c;var f,g}return{...n,schema:{...r,primaryKey:s,indexes:o,getIndexByKeyPath:function(c){const d=i[_o(c)];return d&&d[0]}},count:c=>n.count(l(c)),query:c=>n.query(l(c)),openCursor(c){const{keyTail:d,isVirtual:f,keyLength:g}=c.query.index;return f?n.openCursor(l(c)).then(S=>S&&function(y){return Object.create(y,{continue:{value:function(p){p!=null?y.continue(is(p,c.reverse?e.MAX_KEY:e.MIN_KEY,d)):c.unique?y.continue(y.key.slice(0,g).concat(c.reverse?e.MIN_KEY:e.MAX_KEY,d)):y.continue()}},continuePrimaryKey:{value(p,h){y.continuePrimaryKey(is(p,e.MAX_KEY,d),h)}},primaryKey:{get:()=>y.primaryKey},key:{get(){const p=y.key;return g===1?p[0]:p.slice(0,g)}},value:{get:()=>y.value}})}(S)):n.openCursor(c)}}}}}};function Ah(e,t,n,r){return n=n||{},r=r||"",we(e).forEach(i=>{if(lt(t,i)){var o=e[i],a=t[i];if(typeof o=="object"&&typeof a=="object"&&o&&a){const s=gf(o);s!==gf(a)?n[r+i]=t[i]:s==="Object"?Ah(o,a,n,r+i+"."):o!==a&&(n[r+i]=t[i])}else o!==a&&(n[r+i]=t[i])}else n[r+i]=void 0}),we(t).forEach(i=>{lt(e,i)||(n[r+i]=t[i])}),n}const lb={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const n=e.table(t),{primaryKey:r}=n.schema;return{...n,mutate(o){const a=$.trans,{deleting:s,creating:l,updating:u}=a.table(t).hook;switch(o.type){case"add":if(l.fire===X)break;return a._promise("readwrite",()=>c(o),!0);case"put":if(l.fire===X&&u.fire===X)break;return a._promise("readwrite",()=>c(o),!0);case"delete":if(s.fire===X)break;return a._promise("readwrite",()=>c(o),!0);case"deleteRange":if(s.fire===X)break;return a._promise("readwrite",()=>function(f){return d(f.trans,f.range,1e4)}(o),!0)}return n.mutate(o);function c(f){const g=$.trans,S=f.keys||function(y,E){return E.type==="delete"?E.keys:E.keys||E.values.map(y.extractKey)}(r,f);if(!S)throw new Error("Keys missing");return(f=f.type==="add"||f.type==="put"?{...f,keys:S}:{...f}).type!=="delete"&&(f.values=[...f.values]),f.keys&&(f.keys=[...f.keys]),function(y,E,p){return E.type==="add"?Promise.resolve([]):y.getMany({trans:E.trans,keys:p,cache:"immutable"})}(n,f,S).then(y=>{const E=S.map((p,h)=>{const v=y[h],w={onerror:null,onsuccess:null};if(f.type==="delete")s.fire.call(w,p,v,g);else if(f.type==="add"||v===void 0){const x=l.fire.call(w,p,f.values[h],g);p==null&&x!=null&&(p=x,f.keys[h]=p,r.outbound||kt(f.values[h],r.keyPath,p))}else{const x=Ah(v,f.values[h]),_=u.fire.call(w,x,p,v,g);if(_){const b=f.values[h];Object.keys(_).forEach(C=>{lt(b,C)?b[C]=_[C]:kt(b,C,_[C])})}}return w});return n.mutate(f).then(({failures:p,results:h,numFailures:v,lastResult:w})=>{for(let x=0;x(E.forEach(h=>h.onerror&&h.onerror(p)),Promise.reject(p)))})}function d(f,g,S){return n.query({trans:f,values:!1,query:{index:r,range:g},limit:S}).then(({result:y})=>c({type:"delete",keys:y,trans:f}).then(E=>E.numFailures>0?Promise.reject(E.failures[0]):y.length({table:t=>{const n=e.table(t);return{...n,getMany:r=>{if(!r.cache)return n.getMany(r);const i=my(r.keys,r.trans._cache,r.cache==="clone");return i?L.resolve(i):n.getMany(r).then(o=>(r.trans._cache={keys:r.keys,values:r.cache==="clone"?Ea(o):o},o))},mutate:r=>(r.type!=="add"&&(r.trans._cache=null),n.mutate(r))}}})};function Rh(e){return!("from"in e)}const Zt=function(e,t){if(!this){const n=new Zt;return e&&"d"in e&&Ge(n,e),n}Ge(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function Qo(e,t,n){const r=He(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(Rh(e))return Ge(e,{from:t,to:n,d:1});const i=e.l,o=e.r;if(He(n,e.from)<0)return i?Qo(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},j0(e);if(He(t,e.to)>0)return o?Qo(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},j0(e);He(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),He(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const a=!e.r;i&&!e.l&&_l(e,i),o&&a&&_l(e,o)}function _l(e,t){Rh(t)||function n(r,{from:i,to:o,l:a,r:s}){Qo(r,i,o),a&&n(r,a),s&&n(r,s)}(e,t)}function cb(e,t){const n=Ff(t);let r=n.next();if(r.done)return!1;let i=r.value;const o=Ff(e);let a=o.next(i.from),s=a.value;for(;!r.done&&!a.done;){if(He(s.from,i.to)<=0&&He(s.to,i.from)>=0)return!0;He(i.from,s.from)<0?i=(r=n.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}function Ff(e){let t=Rh(e)?null:{s:0,n:e};return{next(n){const r=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&He(n,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||He(n,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function j0(e){var t,n;const r=(((t=e.r)===null||t===void 0?void 0:t.d)||0)-(((n=e.l)===null||n===void 0?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const o=i==="r"?"l":"r",a={...e},s=e[i];e.from=s.from,e.to=s.to,e[i]=s[i],a[i]=s[o],e[o]=a,a.d=P0(a)}e.d=P0(e)}function P0({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}Oi(Zt.prototype,{add(e){return _l(this,e),this},addKey(e){return Qo(this,e,e),this},addKeys(e){return e.forEach(t=>Qo(this,t,t)),this},[yf](){return Ff(this)}});const fb={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new Zt(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{const i=e.table(r),{schema:o}=i,{primaryKey:a}=o,{extractKey:s,outbound:l}=a,u={...i,mutate:f=>{const g=f.trans,S=g.mutatedParts||(g.mutatedParts={}),y=_=>{const b=`idb://${t}/${r}/${_}`;return S[b]||(S[b]=new Zt)},E=y(""),p=y(":dels"),{type:h}=f;let[v,w]=f.type==="deleteRange"?[f.range]:f.type==="delete"?[f.keys]:f.values.length<50?[[],f.values]:[];const x=f.trans._cache;return i.mutate(f).then(_=>{if(Be(v)){h!=="delete"&&(v=_.results),E.addKeys(v);const b=my(v,x);b||h==="add"||p.addKeys(v),(b||w)&&function(C,P,M,U){function ve(fe){const te=C(fe.name||"");function bn(Ce){return Ce!=null?fe.extractKey(Ce):null}const Nt=Ce=>fe.multiEntry&&Be(Ce)?Ce.forEach(D=>te.addKey(D)):te.addKey(Ce);(M||U).forEach((Ce,D)=>{const z=M&&bn(M[D]),V=U&&bn(U[D]);He(z,V)!==0&&(z!=null&&Nt(z),V!=null&&Nt(V))})}P.indexes.forEach(ve)}(y,o,b,w)}else if(v){const b={from:v.lower,to:v.upper};p.add(b),E.add(b)}else E.add(n),p.add(n),o.indexes.forEach(b=>y(b.name).add(n));return _})}},c=({query:{index:f,range:g}})=>{var S,y;return[f,new Zt((S=g.lower)!==null&&S!==void 0?S:e.MIN_KEY,(y=g.upper)!==null&&y!==void 0?y:e.MAX_KEY)]},d={get:f=>[a,new Zt(f.key)],getMany:f=>[a,new Zt().addKeys(f.keys)],count:c,query:c,openCursor:c};return we(d).forEach(f=>{u[f]=function(g){const{subscr:S}=$;if(S){const y=w=>{const x=`idb://${t}/${r}/${w}`;return S[x]||(S[x]=new Zt)},E=y(""),p=y(":dels"),[h,v]=d[f](g);if(y(h.name||"").add(v),!h.isPrimaryKey){if(f!=="count"){const w=f==="query"&&l&&g.values&&i.query({...g,values:!1});return i[f].apply(this,arguments).then(x=>{if(f==="query"){if(l&&g.values)return w.then(({result:b})=>(E.addKeys(b),x));const _=g.values?x.result.map(s):x.result;g.values?E.addKeys(_):p.addKeys(_)}else if(f==="openCursor"){const _=x,b=g.values;return _&&Object.create(_,{key:{get:()=>(p.addKey(_.primaryKey),_.key)},primaryKey:{get(){const C=_.primaryKey;return p.addKey(C),C}},value:{get:()=>(b&&E.addKey(_.primaryKey),_.value)}})}return x})}p.add(n)}}return i[f].apply(this,arguments)}}),u}}}};class yr{constructor(t,n){this._middlewares={},this.verno=0;const r=yr.dependencies;this._options=n={addons:yr.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange,...n},this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:i}=n;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:X,dbReadyPromise:null,cancelOpen:X,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var a;o.dbReadyPromise=new L(s=>{o.dbReadyResolve=s}),o.openCanceller=new L((s,l)=>{o.cancelOpen=l}),this._state=o,this.name=t,this.on=yo(this,"populate","blocked","versionchange","close",{ready:[xh,X]}),this.on.ready.subscribe=Vg(this.on.ready.subscribe,s=>(l,u)=>{yr.vip(()=>{const c=this._state;if(c.openComplete)c.dbOpenError||L.resolve().then(l),u&&s(l);else if(c.onReadyBeingFired)c.onReadyBeingFired.push(l),u&&s(l);else{s(l);const d=this;u||s(function f(){d.on.ready.unsubscribe(l),d.on.ready.unsubscribe(f)})}})}),this.Collection=(a=this,Yi(GS.prototype,function(s,l){this.db=a;let u=uy,c=null;if(l)try{u=l()}catch(S){c=S}const d=s._ctx,f=d.table,g=f.hook.reading.fire;this._ctx={table:f,index:d.index,isPrimKey:!d.index||f.schema.primKey.keyPath&&d.index===f.schema.primKey.name,range:u,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:c,or:d.or,valueMapper:g!==Ko?g:null}})),this.Table=function(s){return Yi(YS.prototype,function(l,u,c){this.db=s,this._tx=c,this.name=l,this.schema=u,this.hook=s._allTables[l]?s._allTables[l].hook:yo(null,{creating:[NS,X],reading:[IS,Ko],updating:[MS,X],deleting:[TS,X]})})}(this),this.Transaction=function(s){return Yi(ZS.prototype,function(l,u,c,d,f){this.db=s,this.mode=l,this.storeNames=u,this.schema=c,this.chromeTransactionDurability=d,this.idbtrans=null,this.on=yo(this,"complete","error","abort"),this.parent=f||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new L((g,S)=>{this._resolve=g,this._reject=S}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},g=>{var S=this.active;return this.active=!1,this.on.error.fire(g),this.parent?this.parent._reject(g):S&&this.idbtrans&&this.idbtrans.abort(),Ee(g)})})}(this),this.Version=function(s){return Yi(rb.prototype,function(l){this.db=s,this._cfg={version:l,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(s){return Yi(fy.prototype,function(l,u,c){this.db=s,this._ctx={table:l,index:u===":id"?null:u,or:c};const d=s._deps.indexedDB;if(!d)throw new B.MissingAPI;this._cmp=this._ascending=d.cmp.bind(d),this._descending=(f,g)=>d.cmp(g,f),this._max=(f,g)=>d.cmp(f,g)>0?f:g,this._min=(f,g)=>d.cmp(f,g)<0?f:g,this._IDBKeyRange=s._deps.IDBKeyRange})}(this),this.on("versionchange",s=>{s.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()}),this.on("blocked",s=>{!s.newVersion||s.newVersionnew this.Transaction(s,l,u,this._options.chromeTransactionDurability,c),this._fireOnBlocked=s=>{this.on("blocked").fire(s),go.filter(l=>l.name===this.name&&l!==this&&!l._state.vcFired).map(l=>l.on("versionchange").fire(s))},this.use(sb),this.use(lb),this.use(fb),this.use(ub),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach(s=>s(this))}version(t){if(isNaN(t)||t<.1)throw new B.Type("Given version is not a positive number");if(t=Math.round(10*t)/10,this.idbdb||this._state.isBeingOpened)throw new B.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);const n=this._versions;var r=n.filter(i=>i._cfg.version===t)[0];return r||(r=new this.Version(t),n.push(r),n.sort(tb),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(t){return this.idbdb&&(this._state.openComplete||$.letThrough||this._vip)?t():new L((n,r)=>{if(this._state.openComplete)return r(new B.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void r(new B.DatabaseClosed);this.open().catch(X)}this._state.dbReadyPromise.then(n,r)}).then(t)}use({stack:t,create:n,level:r,name:i}){i&&this.unuse({stack:t,name:i});const o=this._middlewares[t]||(this._middlewares[t]=[]);return o.push({stack:t,create:n,level:r??10,name:i}),o.sort((a,s)=>a.level-s.level),this}unuse({stack:t,name:n,create:r}){return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(i=>r?i.create!==r:!!n&&i.name!==n)),this}open(){return ob(this)}_close(){const t=this._state,n=go.indexOf(this);if(n>=0&&go.splice(n,1),this.idbdb){try{this.idbdb.close()}catch{}this._novip.idbdb=null}t.dbReadyPromise=new L(r=>{t.dbReadyResolve=r}),t.openCanceller=new L((r,i)=>{t.cancelOpen=i})}close(){this._close();const t=this._state;this._options.autoOpen=!1,t.dbOpenError=new B.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError)}delete(){const t=arguments.length>0,n=this._state;return new L((r,i)=>{const o=()=>{this.close();var a=this._deps.indexedDB.deleteDatabase(this.name);a.onsuccess=oe(()=>{(function({indexedDB:s,IDBKeyRange:l},u){!Ph(s)&&u!==ou&&jh(s,l).delete(u).catch(X)})(this._deps,this.name),r()}),a.onerror=$t(i),a.onblocked=this._fireOnBlocked};if(t)throw new B.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(o):o()})}backendDB(){return this.idbdb}isOpen(){return this.idbdb!==null}hasBeenClosed(){const t=this._state.dbOpenError;return t&&t.name==="DatabaseClosed"}hasFailed(){return this._state.dbOpenError!==null}dynamicallyOpened(){return this._state.autoSchema}get tables(){return we(this._allTables).map(t=>this._allTables[t])}transaction(){const t=ab.apply(this,arguments);return this._transaction.apply(this,t)}_transaction(t,n,r){let i=$.trans;i&&i.db===this&&t.indexOf("!")===-1||(i=null);const o=t.indexOf("?")!==-1;let a,s;t=t.replace("!","").replace("?","");try{if(s=n.map(u=>{var c=u instanceof this.Table?u.name:u;if(typeof c!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return c}),t=="r"||t===Xu)a=Xu;else{if(t!="rw"&&t!=Zu)throw new B.InvalidArgument("Invalid transaction mode: "+t);a=Zu}if(i){if(i.mode===Xu&&a===Zu){if(!o)throw new B.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&s.forEach(u=>{if(i&&i.storeNames.indexOf(u)===-1){if(!o)throw new B.SubTransaction("Table "+u+" not included in parent transaction.");i=null}}),o&&i&&!i.active&&(i=null)}}catch(u){return i?i._promise(null,(c,d)=>{d(u)}):Ee(u)}const l=vy.bind(null,this,a,s,i,r);return i?i._promise(a,l,"lock"):$.trans?$i($.transless,()=>this._whenReady(l)):this._whenReady(l)}table(t){if(!lt(this._allTables,t))throw new B.InvalidTable(`Table ${t} does not exist`);return this._allTables[t]}}const db=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable";class hb{constructor(t){this._subscribe=t}subscribe(t,n,r){return this._subscribe(t&&typeof t!="function"?t:{next:t,error:n,complete:r})}[db](){return this}}function gy(e,t){return we(t).forEach(n=>{_l(e[n]||(e[n]=new Zt),t[n])}),e}function pb(e){let t,n=!1;const r=new hb(i=>{const o=wh(e);let a=!1,s={},l={};const u={get closed(){return a},unsubscribe:()=>{a=!0,Yn.storagemutated.unsubscribe(g)}};i.start&&i.start(u);let c=!1,d=!1;function f(){return we(l).some(y=>s[y]&&cb(s[y],l[y]))}const g=y=>{gy(s,y),f()&&S()},S=()=>{if(c||a)return;s={};const y={},E=function(p){o&&Mi();const h=()=>Hn(e,{subscr:p,trans:null}),v=$.trans?$i($.transless,h):h();return o&&v.then(mn,mn),v}(y);d||(Yn(Yo,g),d=!0),c=!0,Promise.resolve(E).then(p=>{n=!0,t=p,c=!1,a||(f()?S():(s={},l=y,i.next&&i.next(p)))},p=>{c=!1,n=!1,i.error&&i.error(p),u.unsubscribe()})};return S(),u});return r.hasValue=()=>n,r.getValue=()=>t,r}let Bf;try{Bf={indexedDB:re.indexedDB||re.mozIndexedDB||re.webkitIndexedDB||re.msIndexedDB,IDBKeyRange:re.IDBKeyRange||re.webkitIDBKeyRange}}catch{Bf={indexedDB:null,IDBKeyRange:null}}const ir=yr;function ks(e){let t=rn;try{rn=!0,Yn.storagemutated.fire(e)}finally{rn=t}}Oi(ir,{...Cs,delete:e=>new ir(e,{addons:[]}).delete(),exists:e=>new ir(e,{addons:[]}).open().then(t=>(t.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return function({indexedDB:t,IDBKeyRange:n}){return Ph(t)?Promise.resolve(t.databases()).then(r=>r.map(i=>i.name).filter(i=>i!==ou)):jh(t,n).toCollection().primaryKeys()}(ir.dependencies).then(e)}catch{return Ee(new B.MissingAPI)}},defineClass:()=>function(e){Ge(this,e)},ignoreTransaction:e=>$.trans?$i($.transless,e):e(),vip:Mf,async:function(e){return function(){try{var t=$f(e.apply(this,arguments));return t&&typeof t.then=="function"?t:L.resolve(t)}catch(n){return Ee(n)}}},spawn:function(e,t,n){try{var r=$f(e.apply(n,t||[]));return r&&typeof r.then=="function"?r:L.resolve(r)}catch(i){return Ee(i)}},currentTransaction:{get:()=>$.trans||null},waitFor:function(e,t){const n=L.resolve(typeof e=="function"?ir.ignoreTransaction(e):e).timeout(t||6e4);return $.trans?$.trans.waitFor(n):n},Promise:L,debug:{get:()=>Yt,set:e=>{Gg(e,e==="dexie"?()=>!0:ly)}},derive:fi,extend:Ge,props:Oi,override:Vg,Events:yo,on:Yn,liveQuery:pb,extendObservabilitySet:gy,getByKeyPath:un,setByKeyPath:kt,delByKeyPath:function(e,t){typeof t=="string"?kt(e,t,void 0):"length"in t&&[].map.call(t,function(n){kt(e,n,void 0)})},shallowClone:Hg,deepClone:Ea,getObjectDiff:Ah,cmp:He,asap:Ug,minKey:Af,addons:[],connections:go,errnames:bh,dependencies:Bf,semVer:S0,version:S0.split(".").map(e=>parseInt(e)).reduce((e,t,n)=>e+t/Math.pow(10,2*n))}),ir.maxKey=Go(ir.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Yn(Yo,e=>{if(!rn){let t;iu?(t=document.createEvent("CustomEvent"),t.initCustomEvent(Rn,!0,!0,e)):t=new CustomEvent(Rn,{detail:e}),rn=!0,dispatchEvent(t),rn=!1}}),addEventListener(Rn,({detail:e})=>{rn||ks(e)}));let rn=!1;if(typeof BroadcastChannel<"u"){const e=new BroadcastChannel(Rn);typeof e.unref=="function"&&e.unref(),Yn(Yo,t=>{rn||e.postMessage(t)}),e.onmessage=t=>{t.data&&ks(t.data)}}else if(typeof self<"u"&&typeof navigator<"u"){Yn(Yo,t=>{try{rn||(typeof localStorage<"u"&&localStorage.setItem(Rn,JSON.stringify({trig:Math.random(),changedParts:t})),typeof self.clients=="object"&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(n=>n.postMessage({type:Rn,changedParts:t})))}catch{}}),typeof addEventListener<"u"&&addEventListener("storage",t=>{if(t.key===Rn){const n=JSON.parse(t.newValue);n&&ks(n.changedParts)}});const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:t}){t&&t.type===Rn&&ks(t.changedParts)})}L.rejectionMapper=function(e,t){if(!e||e instanceof di||e instanceof TypeError||e instanceof SyntaxError||!e.name||!g0[e.name])return e;var n=new g0[e.name](t||e.message,e);return"stack"in e&&ln(n,"stack",{get:function(){return this.inner.stack}}),n},Gg(Yt,ly);const vb="finansoDb",lr=class lr extends yr{constructor(){super(vb);O(this,"pouch");O(this,"category");O(this,"expense");this.version(1).stores({pouch:"&id,dateBegin,dateEnd,desc,name",category:"id,catId,title,dateBegin,dateEnd",expense:"&id,catId,cost,dateBegin,dateEnd,desc,pouchId,state,time"})}static instance(){return lr._instance||(lr._instance=new lr),lr._instance}};O(lr,"_instance");let zf=lr;function mb(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class Gn{constructor(){O(this,"databaseClient",zf.instance())}get client(){return this.databaseClient}ok(t){return be(t)}error(t){return _e(t)}}Gn=mb([tr()],Gn);function gb(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function A0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function yb(e){return!e.dateEnd}class Vf{constructor(t=k(Gn)){O(this,"databaseDataProvider");this.databaseDataProvider=t}async getRangeReport({startDate:t,endDate:n,pouchId:r}){const i=this.databaseDataProvider,[o,a]=await Promise.all([i.client.category.filter(yb).toArray(),i.client.expense.where("time").between(t,n).filter(s=>s.pouchId==r&&s.dateEnd==null).toArray()]);return i.ok({categoryList:o,expenseList:a})}}Vf=gb([tr(),A0("design:type",Function),A0("design:paramtypes",[void 0])],Vf);const _b=nu(async({startDate:e,endDate:t,pouchId:n})=>{const r=await k(Vf).getRangeReport({startDate:e,endDate:t,pouchId:n});return H(r)?_e(new xS.GetRangeReport(r.error)):be(r.data)});function wb(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}const Sb=window.confirm,bb=window.prompt,xb=window.alert;class gn{async confirm(t){return new Promise(n=>Sb(t)?n(!0):n(!1))}async prompt(t,n){return new Promise(r=>{const i=bb(t,n);if(i)return r({data:i,isApplied:!0});r({isApplied:!1,data:""})})}async alert(t){return new Promise(n=>(xb(t),n()))}}gn=wb([Ne()],gn);const yy=new ru("guid");let Ds=yy.value;const Qt=[];function Eb(){Ds||(Ds=Math.abs(Math.random()*255|0).toString(16),yy.set(Ds));for(let e=0;e<256;e++)Qt[e]=(e<16?"0":"")+e.toString(16)}Eb();function kh(){const e=new Date().getTime(),t=Math.floor(e/1e3),r=e-t*1e3+Math.random()*65535|0,i=Math.random()*4294967295|0,o=Ds;return t.toString(16)+Qt[o&255]+Qt[r&255]+Qt[r>>8&255]+Qt[r>>16&15|64]+Qt[i&63|128]+Qt[i>>8&255]+Qt[i>>16&255]+Qt[i>>24&255]}const{PouchesErrors:rc}=Jn("PouchesErrors",{GetPouchesResponse:"Failed load pouches",RemovePouchResponse:"Failed to remove pouch",AddPouchResponse:"Failed to add pouch"});function Cb(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function R0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Ob(e){return!e.dateEnd}class Uf{constructor(t=k(Gn)){O(this,"databaseDataProvider");this.databaseDataProvider=t}get client(){return this.databaseDataProvider.client}get ok(){return this.databaseDataProvider.ok}async getPouches(){const t=await this.client.pouch.filter(Ob).toArray();return this.ok(t)}async addPouch(t){const n=await this.client.pouch.add(t);return this.ok(n)}async removePouch(t){const n=await this.client.pouch.update(t,{dateEnd:Date.now()});return this.ok(!!n)}}Uf=Cb([tr(),R0("design:type",Function),R0("design:paramtypes",[void 0])],Uf);const jb=xa(class{constructor(t=k(Uf)){O(this,"pouchesDataProvider");this.pouchesDataProvider=t}async getPouches(){const t=await this.pouchesDataProvider.getPouches();return H(t)?_e(new rc.GetPouchesResponse(t.error)):be(t.data)}async addPouch(t){const n={id:kh(),name:t},r=await this.pouchesDataProvider.addPouch(n);return H(r)?_e(new rc.AddPouchResponse(r.error)):be(r.data)}async removePouch(t){const n=await this.pouchesDataProvider.removePouch(t);return H(n)?_e(new rc.RemovePouchResponse(n.error)):be(n.data)}});function Pb(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class Qn{constructor(){O(this,"pouchLocalStorage",new ru("pouch"));O(this,"isLoading",!0);O(this,"pouches",[])}get currentPouch(){const t=this.pouchLocalStorage.value;if(t)return this.pouches.find(({id:n})=>t===n)}get currentPouchId(){const t=this.currentPouch;return(t==null?void 0:t.id)||null}get currentPouchName(){var t;return((t=this.currentPouch)==null?void 0:t.name)||T("export.pouchMain")}setCurrentPouch(t){this.pouchLocalStorage.set(t)}setIsLoading(t){this.isLoading=t}setPouches(t){this.pouches=t}dropEntities(){this.setPouches([])}}Qn=Pb([dt()],Qn);function Ab(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function k0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class qo{constructor(t=k(jb),n=k(Qn),r=k(gn)){O(this,"pouchesAdapter");O(this,"pouchStore");O(this,"messageBoxService");this.pouchesAdapter=t,this.pouchStore=n,this.messageBoxService=r}async loadPouches(){this.pouchStore.setPouches([]);const t=await this.pouchesAdapter.getPouches();H(t)||this.pouchStore.setPouches(t.data)}async addPouch(){const{isApplied:t,data:n}=await this.messageBoxService.prompt(T("pouchBlock.addTitle"),"");if(!t)return;const r=await this.pouchesAdapter.addPouch(n);if(!H(r))return r.data}async removePouch(t){if(!t||!await this.messageBoxService.confirm(T("pouchBlock.removeAsk")))return!1;const r=await this.pouchesAdapter.removePouch(t);return!H(r)}async selectPouch(t){this.pouchStore.setCurrentPouch(t)}}qo=Ab([Ne(),k0("design:type",Function),k0("design:paramtypes",[void 0,void 0,void 0])],qo);wn({data:{pouchBlock:{modalTitle:["Wallets","Кошельки"],add:["Add Wallet","Добавить кошелек"],addTitle:["New wallet","Новый кошелек"],removeAsk:["Delete wallet permanently?","Удалить кошелек безвозвратно?"]}}});function Rb(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,o,a=[],s="",l=e.split("/");for(l[0]||l.shift();i=l.shift();)n=i[0],n==="*"?(a.push(n),s+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=i.indexOf("?",1),o=i.indexOf(".",1),a.push(i.substring(1,~r?r:~o?o:i.length)),s+=~r&&!~o?"(?:/([^/]+?))?":"/([^/]+?)",~o&&(s+=(~r?"?":"")+"\\"+i.substring(o))):s+="/"+i;return{keys:a,pattern:new RegExp("^"+s+(t?"(?=$|/)":"/?$"),"i")}}const{useEffect:kb,useLayoutEffect:Db,useRef:Lb,useInsertionEffect:Ib}=R1,Nb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Tb=Nb?Db:kb,Mb=Ib||Tb,_y=e=>{const t=Lb([e,(...n)=>t[0](...n)]).current;return Mb(()=>{t[0]=e}),t[1]},$b="popstate",Dh="pushState",Lh="replaceState",Fb="hashchange",D0=[$b,Dh,Lh,Fb],Bb=e=>{for(const t of D0)addEventListener(t,e);return()=>{for(const t of D0)removeEventListener(t,e)}},wy=(e,t)=>Ig.useSyncExternalStore(Bb,e,t),zb=()=>location.search,Vb=({ssrSearch:e=""}={})=>wy(zb,()=>e),L0=()=>location.pathname,Ub=({ssrPath:e}={})=>wy(L0,e?()=>e:L0),Kb=(e,{replace:t=!1,state:n=null}={})=>history[t?Lh:Dh](n,"",e),Hb=(e={})=>[Ub(e),Kb],I0=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[I0]>"u"){for(const e of[Dh,Lh]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,I0,{value:!0})}const Wb=(e="",t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",Yb=(e,t="")=>e[0]==="~"?e.slice(1):t+e,Gb=e=>{try{return decodeURI(e)}catch{return e}},Sy={hook:Hb,searchHook:Vb,parser:Rb,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},by=N.createContext(Sy),ja=()=>N.useContext(by),Qb=N.createContext({}),au=e=>{const[t,n]=e.hook(e);return[Gb(Wb(e.base,t)),_y((r,i)=>n(Yb(r,e.base),i))]},Ih=()=>au(ja()),xy=(e,t,n,r)=>{const{pattern:i,keys:o}=e(t||"*",r),[a,...s]=i.exec(n)||[];return a!==void 0?[!0,Object.fromEntries(o.map((l,u)=>[l,s[u]])),...r?[a]:[]]:[!1,null]},Ey=({children:e,...t})=>{var c,d;const n=ja(),r=t.hook?Sy:n;let i=r;const[o,a]=((c=t.ssrPath)==null?void 0:c.split("?"))??[];a&&(t.ssrSearch=a,t.ssrPath=o),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs);let s=N.useRef({}),l=s.current,u=l;for(let f in r){const g=f==="base"?r[f]+(t[f]||""):t[f]||r[f];l===u&&g!==u[f]&&(s.current=u={...u}),u[f]=g,g!==r[f]&&(i=u)}return N.createElement(by.Provider,{value:i,children:e})},N0=({children:e,component:t},n)=>t?N.createElement(t,{params:n}):typeof e=="function"?e(n):e,or=({path:e,nest:t,match:n,...r})=>{const i=ja(),[o]=au(i),[a,s,l]=n??xy(i.parser,e,o,t);if(!a)return null;const u=l?N.createElement(Ey,{base:l},N0(r,s)):N0(r,s);return N.createElement(Qb.Provider,{value:s,children:u})};N.forwardRef((e,t)=>{const n=ja(),[r,i]=au(n),{to:o,href:a=o,onClick:s,asChild:l,children:u,className:c,replace:d,state:f,...g}=e,S=_y(E=>{E.ctrlKey||E.metaKey||E.altKey||E.shiftKey||E.button!==0||(s==null||s(E),E.defaultPrevented||(E.preventDefault(),i(a,e)))}),y=n.hrefs(a[0]==="~"?a.slice(1):n.base+a,n);return l&&N.isValidElement(u)?N.cloneElement(u,{onClick:S,href:y}):N.createElement("a",{...g,onClick:S,href:y,className:c!=null&&c.call?c(r===y):c,children:u,ref:t})});const Cy=e=>Array.isArray(e)?e.flatMap(t=>Cy(t&&t.type===N.Fragment?t.props.children:t)):[e],qb=({children:e,location:t})=>{const n=ja(),[r]=au(n);for(const i of Cy(e)){let o=0;if(N.isValidElement(i)&&(o=xy(n.parser,i.props.path,t||r,i.props.nest))[0])return N.cloneElement(i,{match:o})}return null};function Xb(e){const[t,n]=Ih(),r=N.useMemo(()=>new URLSearchParams(t.split("?")[1]),[t]),i=N.useMemo(()=>{const u=t.split("?")[0];return u.endsWith("/")?u:`${u}/`},[t]),o=`${e}=open`,a=t.includes(o),s=N.useCallback(()=>{r.set(e,"open"),n(`${i}?${r.toString()}`)},[r,e,t,n]),l=N.useCallback(()=>{r.delete(e);const u=r.toString(),c=u?`?${u}`:"";n(`${i}${c}`)},[i,r,e,n]);return{isOpen:a,handleOpen:s,handleClose:l}}var Oy=Object.defineProperty,K=(e,t)=>Oy(e,"name",{value:t,configurable:!0}),Zb=(e,t)=>{for(var n in t)Oy(e,n,{get:t[n],enumerable:!0})},Kf={};Zb(Kf,{ALeft:()=>jy,ARight:()=>Py,Activity:()=>Ay,Cross:()=>Ry,Download:()=>ky,EditL:()=>Dy,Error:()=>Ly,Fea:()=>Iy,Info:()=>Ny,Layers:()=>Ty,Load:()=>My,Menu:()=>$y,Moon:()=>Fy,Plus:()=>By,Settings:()=>zy,Translate:()=>Vy,Trash:()=>Uy,Upload:()=>Ky,Wallet:()=>Hy,Warn:()=>Wy});function jy(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M26.667 15.333h-18.133l5.733-5.733c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-8 8c-0.133 0.133-0.267 0.267-0.267 0.4-0.133 0.267-0.133 0.667 0 1.067 0.133 0.133 0.133 0.267 0.267 0.4l8 8c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4c0.533-0.533 0.533-1.333 0-1.867l-5.733-5.733h18.133c0.8 0 1.333-0.533 1.333-1.333s-0.533-1.333-1.333-1.333z",fill:"currentColor"}))}K(jy,"ALeft");function Py(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M27.867 17.2c0.133-0.267 0.133-0.667 0-1.067-0.133-0.133-0.133-0.267-0.267-0.4l-8-8c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l5.733 5.733h-18.133c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333h18.133l-5.733 5.733c-0.533 0.533-0.533 1.333 0 1.867 0.267 0.267 0.667 0.4 0.933 0.4s0.667-0.133 0.933-0.4l8-8c0.133-0.133 0.267-0.267 0.267-0.4z",fill:"currentColor"}))}K(Py,"ARight");function Ay(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M29.333 15.333h-5.333c-0.533 0-1.067 0.4-1.2 0.933l-2.8 8.133-6.8-20.133c-0.133-0.533-0.667-0.933-1.2-0.933s-1.067 0.4-1.2 0.933l-3.733 11.067h-4.4c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333h5.333c0.533 0 1.067-0.4 1.2-0.933l2.8-8.133 6.8 20.267c0.133 0.533 0.667 0.933 1.2 0.933s1.067-0.4 1.2-0.933l3.733-11.067h4.4c0.8 0 1.333-0.533 1.333-1.333s-0.533-1.467-1.333-1.467z",fill:"currentColor"}))}K(Ay,"Activity");function Ry(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M17.867 16.667l7.067-7.067c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-7.067 7.067-7.067-7.067c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l7.067 7.067-7.067 7.067c-0.533 0.533-0.533 1.333 0 1.867 0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4l7.067-7.067 7.067 7.067c0.267 0.267 0.667 0.4 0.933 0.4s0.667-0.133 0.933-0.4c0.533-0.533 0.533-1.333 0-1.867l-7.067-7.067z",fill:"currentColor"}))}K(Ry,"Cross");function ky(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M28 22c-0.8 0-1.333 0.533-1.333 1.333v4c0 0.8-0.533 1.333-1.333 1.333h-18.667c-0.8 0-1.333-0.533-1.333-1.333v-4c0-0.8-0.533-1.333-1.333-1.333s-1.333 0.533-1.333 1.333v4c0 2.267 1.733 4 4 4h18.667c2.267 0 4-1.733 4-4v-4c0-0.8-0.533-1.333-1.333-1.333zM15.067 22.933c0.133 0.133 0.267 0.267 0.4 0.267 0.133 0.133 0.4 0.133 0.533 0.133s0.4 0 0.533-0.133c0.133-0.133 0.267-0.133 0.4-0.267l5.333-5.333c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-3.067 3.067v-15.467c0-0.8-0.533-1.333-1.333-1.333s-1.333 0.533-1.333 1.333v15.467l-3.067-3.067c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l5.333 5.333z",fill:"currentColor"}))}K(ky,"Download");function Dy(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M4 24.667h5.333c0.4 0 0.667-0.133 0.933-0.4l14.667-14.667c0.533-0.533 0.533-1.333 0-1.867l-5.333-5.333c-0.533-0.533-1.333-0.533-1.867 0l-14.667 14.667c-0.267 0.267-0.4 0.533-0.4 0.933v5.333c0 0.8 0.533 1.333 1.333 1.333zM5.333 18.533l13.333-13.333 3.467 3.467-13.333 13.333h-3.467v-3.467zM28 28.667h-24c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333h24c0.8 0 1.333-0.533 1.333-1.333s-0.533-1.333-1.333-1.333z",fill:"currentColor"}))}K(Dy,"EditL");function Ly(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M30.267 10.267l-7.867-7.867c-0.133-0.267-0.533-0.4-0.933-0.4h-10.933c-0.4 0-0.8 0.133-0.933 0.4l-7.867 7.867c-0.267 0.133-0.4 0.533-0.4 0.933v11.067c0 0.4 0.133 0.667 0.4 0.933l7.867 7.867c0.133 0.133 0.533 0.267 0.933 0.267h11.067c0.4 0 0.667-0.133 0.933-0.4l7.867-7.867c0.267-0.267 0.4-0.533 0.4-0.933v-10.933c-0.133-0.4-0.267-0.8-0.533-0.933zM28 21.6l-7.067 7.067h-9.867l-7.067-7.067v-9.867l7.067-7.067h10l6.933 7.067v9.867zM16 10c-0.8 0-1.333 0.533-1.333 1.333v5.333c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-5.333c0-0.8-0.533-1.333-1.333-1.333zM15.067 21.067c-0.267 0.267-0.4 0.533-0.4 0.933s0.133 0.667 0.4 0.933c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4c0.267-0.267 0.4-0.667 0.4-0.933s-0.133-0.667-0.4-0.933c-0.533-0.533-1.333-0.533-1.867 0z",fill:"currentColor"}))}K(Ly,"Error");function Iy(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M27.867 4.667c-3.6-3.6-9.6-3.6-13.2 0l-8.933 9.067c-0.267 0.267-0.4 0.533-0.4 0.933v10.8l-3.6 3.6c-0.533 0.533-0.533 1.333 0 1.867 0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4l3.6-3.6h10.8c0.4 0 0.667-0.133 0.933-0.4l8.933-9.067c3.733-3.6 3.733-9.467 0-13.2zM17.467 24.667h-7.6l2.667-2.667h7.6l-2.667 2.667zM26 16c0 0 0 0 0 0l-3.2 3.333c0 0 0 0-0.133 0h-7.467l7.067-7.067c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-9.333 9.333c0 0 0 0 0 0l-3.067 3.067v-7.6l8.667-8.667c2.667-2.667 6.8-2.667 9.467 0 2.533 2.667 2.533 6.933-0.133 9.467z",fill:"currentColor"}))}K(Iy,"Fea");function Ny(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M16 2c-8.133 0-14.667 6.533-14.667 14.667s6.533 14.667 14.667 14.667 14.667-6.533 14.667-14.667-6.533-14.667-14.667-14.667zM16 28.667c-6.667 0-12-5.333-12-12s5.333-12 12-12c6.667 0 12 5.333 12 12s-5.333 12-12 12zM16 15.333c-0.8 0-1.333 0.533-1.333 1.333v5.333c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-5.333c0-0.8-0.533-1.333-1.333-1.333zM15.067 10.4c-0.267 0.267-0.4 0.533-0.4 0.933s0.133 0.667 0.4 0.933c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4c0.267-0.267 0.4-0.533 0.4-0.933s-0.133-0.667-0.4-0.933c-0.533-0.533-1.333-0.533-1.867 0z",fill:"currentColor"}))}K(Ny,"Info");function Ty(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M2.133 11.2l13.333 6.667c0.133 0.133 0.267 0.133 0.533 0.133s0.4 0 0.533-0.133l13.333-6.667c0.533-0.267 0.8-0.667 0.8-1.2s-0.267-0.933-0.8-1.2l-13.333-6.667c-0.4-0.133-0.8-0.133-1.2 0l-13.333 6.667c-0.4 0.267-0.667 0.667-0.667 1.2s0.267 0.933 0.8 1.2zM16 4.8l10.4 5.2-10.4 5.2-10.4-5.2 10.4-5.2zM28.8 22.133l-12.8 6.4-12.8-6.4c-0.667-0.267-1.467 0-1.733 0.533s0 1.467 0.533 1.733l13.333 6.667c0.267 0.267 0.4 0.267 0.667 0.267s0.4 0 0.533-0.133l13.333-6.667c0.667-0.267 0.933-1.067 0.533-1.733-0.267-0.667-1.067-0.933-1.6-0.667zM28.8 15.467l-12.8 6.4-12.8-6.4c-0.667-0.267-1.467 0-1.733 0.533-0.267 0.667 0 1.467 0.533 1.733l13.333 6.667c0.267 0.267 0.4 0.267 0.667 0.267s0.4 0 0.533-0.133l13.333-6.667c0.667-0.267 0.933-1.067 0.533-1.733-0.267-0.667-1.067-0.933-1.6-0.667z",fill:"currentColor"}))}K(Ty,"Layers");function My(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M16 2c-0.8 0-1.333 0.533-1.333 1.333v5.333c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-5.333c0-0.8-0.533-1.333-1.333-1.333zM16 23.333c-0.8 0-1.333 0.533-1.333 1.333v5.333c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-5.333c0-0.8-0.533-1.333-1.333-1.333zM7.467 6.267c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l3.733 3.733c0.267 0.267 0.667 0.4 0.933 0.4s0.667-0.133 0.933-0.4c0.533-0.533 0.533-1.333 0-1.867l-3.733-3.733zM22.533 21.333c-0.533-0.533-1.333-0.533-1.867 0s-0.533 1.333 0 1.867l3.733 3.733c0.267 0.267 0.667 0.4 0.933 0.4s0.667-0.133 0.933-0.4c0.533-0.533 0.533-1.333 0-1.867l-3.733-3.733zM9.333 16.667c0-0.8-0.533-1.333-1.333-1.333h-5.333c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333h5.333c0.8 0 1.333-0.533 1.333-1.333zM29.333 15.333h-5.333c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333h5.333c0.8 0 1.333-0.533 1.333-1.333s-0.533-1.333-1.333-1.333zM9.467 21.333l-3.733 3.733c-0.533 0.533-0.533 1.333 0 1.867 0.267 0.267 0.667 0.4 0.933 0.4s0.667-0.133 0.933-0.4l3.733-3.733c0.533-0.533 0.533-1.333 0-1.867s-1.467-0.533-1.867 0zM21.6 12.4c0.4 0 0.667-0.133 0.933-0.4l3.733-3.733c0.533-0.533 0.533-1.333 0-1.867s-1.333-0.533-1.867 0l-3.733 3.733c-0.533 0.533-0.533 1.333 0 1.867 0.267 0.267 0.667 0.4 0.933 0.4z",fill:"currentColor"}))}K(My,"Load");function $y(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M28 15.333h-24c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333h24c0.8 0 1.333-0.533 1.333-1.333s-0.533-1.333-1.333-1.333zM4 10h24c0.8 0 1.333-0.533 1.333-1.333s-0.533-1.333-1.333-1.333h-24c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333zM28 23.333h-24c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333h24c0.8 0 1.333-0.533 1.333-1.333s-0.533-1.333-1.333-1.333z",fill:"currentColor"}))}K($y,"Menu");function Fy(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M28.667 16.533c-0.4-0.267-1.067-0.267-1.467 0.133-2.8 2.133-6.667 2.133-9.467 0-3.6-2.667-4.4-7.6-1.733-11.2 0.267-0.4 0.4-0.933 0.133-1.467-0.267-0.4-0.8-0.667-1.333-0.667-6.4 0.533-11.467 5.6-12 12-0.667 7.333 4.667 13.867 12 14.533 0.4 0 0.8 0 1.2 0 3.067 0 6.133-1.067 8.533-3.067 2.8-2.267 4.4-5.467 4.8-9.067 0-0.4-0.267-0.933-0.667-1.2zM22.933 24.8c-2.133 1.867-4.933 2.667-7.733 2.4-5.867-0.533-10.133-5.733-9.6-11.6 0.4-4.133 3.2-7.733 6.933-9.067-1.6 4.267-0.133 9.333 3.733 12.267 2.933 2.133 6.667 2.667 10 1.467-0.8 1.733-1.867 3.333-3.333 4.533z",fill:"currentColor"}))}K(Fy,"Moon");function By(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M25.333 15.333h-8v-8c0-0.8-0.533-1.333-1.333-1.333s-1.333 0.533-1.333 1.333v8h-8c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333h8v8c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-8h8c0.8 0 1.333-0.533 1.333-1.333s-0.533-1.333-1.333-1.333z",fill:"currentColor"}))}K(By,"Plus");function zy(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M16 11.333c-2.933 0-5.333 2.4-5.333 5.333s2.4 5.333 5.333 5.333c2.933 0 5.333-2.4 5.333-5.333s-2.4-5.333-5.333-5.333zM16 19.333c-1.467 0-2.667-1.2-2.667-2.667s1.2-2.667 2.667-2.667c1.467 0 2.667 1.2 2.667 2.667s-1.2 2.667-2.667 2.667zM27.067 21.2c0.133-0.267 0.4-0.533 0.933-0.533 2.267 0 4-1.733 4-4s-1.733-4-4-4h-0.267c-0.267 0-0.533-0.133-0.667-0.4l-0.133-0.267c-0.133-0.267-0.133-0.667 0.267-1.067 1.467-1.467 1.6-3.6 0.4-5.2v-0.4l-0.533-0.267c-0.667-0.667-1.6-1.067-2.667-1.067 0 0 0 0 0 0-1.067 0-2.133 0.4-2.933 1.2-0.267 0.267-0.667 0.267-0.933 0.133-0.267 0.133-0.533-0.267-0.533-0.667 0-2.267-1.733-4-4-4s-4 1.733-4 4v0.267c0 0.267-0.133 0.533-0.4 0.667l-0.267 0.133c-0.267 0.133-0.667 0-1.067-0.267-1.6-1.6-4.133-1.6-5.6 0-1.6 1.6-1.6 4.133 0.133 5.733 0.267 0.267 0.267 0.667 0.133 1.067-0.133 0.267-0.533 0.533-0.933 0.533-2.267 0-4 1.733-4 4s1.733 4 4 4h0.267c0.4 0 0.667 0.267 0.8 0.533s0.133 0.667-0.267 1.067c-0.8 0.8-1.2 1.733-1.2 2.8 0 0.933 0.4 1.867 1.067 2.667l0.133 0.133c0 0 0 0 0 0l0.4 0.4c1.6 1.2 3.733 1.067 5.333-0.4 0.267-0.267 0.667-0.267 1.067-0.133s0.533 0.4 0.533 0.933c0 2.267 1.733 4 4 4s4-1.733 4-4v-0.267c0-0.4 0.267-0.667 0.533-0.8s0.667-0.133 1.067 0.267c1.6 1.6 4.133 1.6 5.6 0 1.6-1.6 1.6-4.133-0.133-5.733-0.133-0.4-0.267-0.8-0.133-1.067v0zM25.467 24.133c0.267 0.267 0.4 0.533 0.4 0.933s-0.133 0.667-0.4 0.933c-0.267 0.267-0.533 0.4-0.933 0.4 0 0 0 0 0 0-0.4 0-0.667-0.133-1.067-0.533-1.067-1.067-2.533-1.333-3.867-0.667-1.333 0.533-2.133 1.867-2.133 3.2v0.267c0 0.8-0.533 1.333-1.333 1.333s-1.333-0.533-1.333-1.333v-0.133c0-1.467-0.933-2.667-2.267-3.2-0.4-0.267-0.933-0.267-1.467-0.267-0.933 0-1.867 0.4-2.533 1.067-0.533 0.533-1.2 0.533-1.733 0.133l-0.267-0.533h-0.133c-0.133-0.133-0.133-0.4-0.133-0.533 0-0.4 0.133-0.667 0.533-1.067 1.067-1.067 1.333-2.533 0.667-3.867-0.533-1.333-1.867-2.133-3.2-2.133h-0.267c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h0.133c1.467 0 2.667-0.933 3.2-2.267s0.267-2.8-0.8-4c-0.533-0.533-0.533-1.333 0-1.867s1.333-0.533 2 0.133c0.933 0.933 2.4 1.2 3.6 0.8l0.4-0.133c1.333-0.533 2.133-1.867 2.133-3.2v-0.267c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.467c0 1.467 0.8 2.667 2.133 3.2s2.8 0.267 4-0.8c0.267-0.267 0.533-0.4 0.933-0.4v0c0.4 0 0.667 0.133 0.933 0.4v0c0.533 0.533 0.533 1.333-0.133 2-0.933 0.933-1.2 2.4-0.8 3.6l0.133 0.4c0.533 1.333 1.867 2.133 3.2 2.133h0.267c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.467 1.333c-1.467 0-2.667 0.8-3.2 2.133-0.667 1.333-0.267 2.8 0.8 4z",fill:"currentColor"}))}K(zy,"Settings");function Vy(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M21.188 23.354h4.313l-2.188-5.813zM24.688 13.979l6 16h-2.688l-1.5-4h-6.313l-1.5 4h-2.688l6-16h2.688zM17.188 20.729l-1.063 2.75-4.125-4.125-6.688 6.625-1.875-1.875 6.813-6.688c-1.688-1.875-3-3.875-4-6.063h2.688c0.813 1.563 1.813 3.063 3.063 4.438 1.938-2.125 3.375-4.563 4.25-7.125h-14.938v-2.688h9.375v-2.625h2.625v2.625h9.375v2.688h-3.938c-1 3.125-2.625 6.125-4.938 8.688l-0.063 0.063z",fill:"currentColor"}))}K(Vy,"Translate");function Uy(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M28 7.333h-5.333v-1.333c0-2.267-1.733-4-4-4h-5.333c-2.267 0-4 1.733-4 4v1.333h-5.333c-0.8 0-1.333 0.533-1.333 1.333s0.533 1.333 1.333 1.333h1.333v17.333c0 2.267 1.733 4 4 4h13.333c2.267 0 4-1.733 4-4v-17.333h1.333c0.8 0 1.333-0.533 1.333-1.333s-0.533-1.333-1.333-1.333zM12 6c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v1.333h-8v-1.333zM24 27.333c0 0.8-0.533 1.333-1.333 1.333h-13.333c-0.8 0-1.333-0.533-1.333-1.333v-17.333h16v17.333zM13.333 14c-0.8 0-1.333 0.533-1.333 1.333v8c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-8c0-0.8-0.533-1.333-1.333-1.333zM18.667 14c-0.8 0-1.333 0.533-1.333 1.333v8c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-8c0-0.8-0.533-1.333-1.333-1.333z",fill:"currentColor"}))}K(Uy,"Trash");function Ky(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M28 22c-0.8 0-1.333 0.533-1.333 1.333v4c0 0.8-0.533 1.333-1.333 1.333h-18.667c-0.8 0-1.333-0.533-1.333-1.333v-4c0-0.8-0.533-1.333-1.333-1.333s-1.333 0.533-1.333 1.333v4c0 2.267 1.733 4 4 4h18.667c2.267 0 4-1.733 4-4v-4c0-0.8-0.533-1.333-1.333-1.333zM11.6 9.6l3.067-3.067v15.467c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-15.467l3.067 3.067c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4c0.533-0.533 0.533-1.333 0-1.867l-5.333-5.333c-0.133-0.133-0.267-0.267-0.4-0.267-0.267-0.133-0.667-0.133-1.067 0-0.133 0.133-0.267 0.133-0.4 0.267l-5.333 5.333c-0.533 0.533-0.533 1.333 0 1.867s1.333 0.533 1.867 0z",fill:"currentColor"}))}K(Ky,"Upload");function Hy(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M21.313 18.667c1.125 0 2-0.875 2-2s-0.875-2-2-2-2 0.875-2 2 0.875 2 2 2zM16 21.979v-10.625h13.313v10.625h-13.313zM28 24.667v1.313c0 1.438-1.25 2.688-2.688 2.688h-18.625c-1.5 0-2.688-1.25-2.688-2.688v-18.625c0-1.438 1.188-2.688 2.688-2.688h18.625c1.438 0 2.688 1.25 2.688 2.688v1.313h-12c-1.5 0-2.688 1.25-2.688 2.688v10.625c0 1.438 1.188 2.688 2.688 2.688h12z",fill:"currentColor"}))}K(Hy,"Wallet");function Wy(){return j.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 32 32"},j.createElement("path",{d:"M30.667 24l-11.2-18.933c-0.533-0.933-1.467-1.6-2.533-1.867s-2.133-0.133-3.067 0.4c-0.533 0.267-1.067 0.8-1.333 1.333 0 0 0 0 0 0l-11.2 19.067c-1.067 1.867-0.4 4.4 1.467 5.467 0.533 0.4 1.2 0.533 1.867 0.533h22.667c1.067 0 2.133-0.4 2.8-1.2 0.8-0.8 1.2-1.733 1.2-2.8-0.133-0.667-0.267-1.467-0.667-2zM28.267 26.933c-0.267 0.267-0.667 0.4-0.933 0.4h-22.667c-0.267 0-0.4 0-0.667-0.133-0.667-0.4-0.8-1.2-0.533-1.867l11.333-18.8c0.133-0.133 0.267-0.4 0.4-0.4 0.667-0.4 1.467-0.133 1.867 0.4l11.333 18.8c0.133 0.133 0.133 0.4 0.133 0.667 0.133 0.4-0.133 0.667-0.267 0.933zM16 11.333c-0.8 0-1.333 0.533-1.333 1.333v5.333c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-5.333c0-0.8-0.533-1.333-1.333-1.333zM15.067 22.4c-0.267 0.267-0.4 0.533-0.4 0.933s0.133 0.667 0.4 0.933c0.267 0.267 0.533 0.4 0.933 0.4s0.667-0.133 0.933-0.4c0.267-0.267 0.4-0.667 0.4-0.933s-0.133-0.667-0.4-0.933c-0.533-0.533-1.333-0.533-1.867 0z",fill:"currentColor"}))}K(Wy,"Warn");var Jb={big:"h-[18px] w-[18px]",huge:"h-[28px] w-[28px]",normal:"h-[14px] w-[14px]",small:"h-[10px] w-[10px]"};function Qe({name:e,size:t="normal"}){if(!e)return null;Kf[e]||console.error("-icon not defined name",e);const n=Jb[t],r=Kf[e]||null;return j.createElement("span",{className:`flex items-center justify-center ${n}`,"data-icon":e},j.createElement(r,null))}K(Qe,"Icon");function Ye(e){return"has"in e?e.has?j.createElement(j.Fragment,null,e.children):null:e.is?j.createElement(j.Fragment,null,e.isSlot):j.createElement(j.Fragment,null,e.children)}K(Ye,"Swap");var ex={circle:"rounded-full w-14 h-14 flex items-center justify-center",rect:" rounded-lg"},tx="text-gray-900 bg-white border-gray-200 hover:bg-gray-100 hover:text-blue-700 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",nx={flat:"",primary:"",secondary:""},rx="shadow-lg dark:shadow-slate-950 py-2.5 px-3 text-sm font-medium focus:outline-none border focus:z-10 focus:ring-4 focus:ring-gray-100 inline-flex gap-2 items-center";function ze({children:e,iconName:t,iconSize:n,variant:r="flat",onClick:i,isDisabled:o,shape:a="rect"}){const s=ex[a]||"",l=nx[r]||"",u=`${rx} ${tx} ${s} ${l}`;return j.createElement("button",{onClick:i,disabled:o,className:u},j.createElement(Ye,{has:!!t},!!t&&j.createElement(Qe,{name:t,size:n})),e)}K(ze,"Button");function Yy({value:e,type:t="text",onChange:n}){const r=N.useCallback(i=>{const o=i.target;n(o.value)},[n]);return j.createElement("div",null,j.createElement("input",{type:t,value:e,onChange:r,className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"}))}K(Yy,"Input");function su({children:e,icon:t,onClick:n}){return j.createElement("a",{className:"flex cursor-pointer items-center gap-2",onClick:n},!!t&&j.createElement(Qe,{name:t}),j.createElement("div",{className:"underline"},e))}K(su,"Link");function Gy({children:e,onClick:t}){return j.createElement("div",{className:"flex min-h-10 items-center gap-2",onClick:t},e)}K(Gy,"ListRow");function Qy({children:e}){return j.createElement("div",{className:"flex"},e)}K(Qy,"ListCell");function qy({children:e}){return j.createElement("div",null,e)}K(qy,"ListRoot");Object.assign(qy,{Row:Gy,Cell:Qy});function Pa(){return j.createElement("div",{className:"flex items-center justify-center h-10 w-10 animate-spin"},j.createElement(Qe,{name:"Load",size:"normal"}))}K(Pa,"Loader");function Xy(){return j.createElement("div",{className:"fixed inset-0 flex items-center justify-center opacity-80 text-black bg-white dark:bg-gray-800 dark:text-white"},j.createElement(Pa,null))}K(Xy,"BlockLoader");function Zy({children:e}){const t=document.getElementById("portal");return t?j.createElement(j.Fragment,null,rh.createPortal(j.createElement(j.Fragment,null,e),t)):null}K(Zy,"Portal");function Jy({children:e}){return j.createElement("div",{className:"p-2 md:p-3 space-y-2"},e)}K(Jy,"ModalBody");function e1({children:e}){return j.createElement("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600"},e)}K(e1,"ModalFooter");function t1({onClose:e,title:t}){return j.createElement("div",{className:"flex items-center justify-between p-2 md:p-3 border-b rounded-t dark:border-gray-600"},j.createElement("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white"},t),j.createElement("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white","data-modal-hide":"default-modal",onClick:e},j.createElement("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14"},j.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})),j.createElement("span",{className:"sr-only"},"Close modal")))}K(t1,"ModalHeader");function n1({children:e,isOpen:t}){return t?j.createElement(Zy,null,j.createElement("div",{tabIndex:-1,"aria-hidden":"true",className:"overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 bottom-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%)] max-h-full flex"},j.createElement("div",{className:"absolute top-0 left-0 right-0 bottom-0 bg-gray-200 dark:bg-gray-700 dark:opacity-30 opacity-50"}),j.createElement("div",{className:"relative p-4 w-full max-w-2xl max-h-full"},j.createElement("div",{className:"relative bg-white rounded-lg shadow dark:bg-gray-700"},e)))):null}K(n1,"ModalRoot");var ic=Object.assign(n1,{Footer:e1,Header:t1,Body:Jy});function Xo({name:e,value:t,checkValue:n,children:r,onChange:i}){const o=N.useCallback(s=>{const l=s.target.value;i(l)},[i]),a=n===t;return j.createElement("label",{className:"flex items-center gap-2 cursor-pointer"},j.createElement("input",{type:"radio",value:t,name:e,onChange:o,checked:a,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),j.createElement("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-300"},r))}K(Xo,"RadioButton");var lu=K(({children:e})=>j.createElement("div",{className:"w-full overflow-y-auto overflow-x-hidden top-0 bottom-0 absolute",style:{WebkitOverflowScrolling:"touch"}},e),"ScrollContainer");function r1({value:e,options:t,onChange:n}){return j.createElement("div",{className:"w-full "},j.createElement("select",{className:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",value:e,onChange:r=>{n(r.target.value)}},t.map(r=>j.createElement("option",{value:r.value,key:r.value},r.label))))}K(r1,"Select");var wl=K(()=>j.createElement("div",{className:"h-[1px] w-full bg-gradient-to-r dark:from-black dark:via-gray-600 dark:to-black from-gray-50 via-gray-400 to-gray-50"}),"Separator");function i1({name:e,checked:t,children:n}){return j.createElement("label",{className:"inline-flex items-center cursor-pointer"},j.createElement("input",{type:"checkbox",checked:t,className:"sr-only peer",name:e,disabled:!0}),j.createElement("div",{className:"relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"}),n)}K(i1,"Toggle");function o1({children:e,onChange:t}){const n=N.useCallback(r=>{const i=r.target,o=i.files||void 0;t&&t(o),i.value=""},[t]);return j.createElement("label",null,e,j.createElement("input",{type:"file",className:"hidden",onChange:n}))}K(o1,"UploadArea");function ix(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function T0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class Hf{constructor(t=k(Qn),n=k(qo)){O(this,"pouchStore");O(this,"pouchService");this.pouchStore=t,this.pouchService=n}async handleRemove(t){const n=t===this.pouchStore.currentPouchId;await this.pouchService.removePouch(t)&&(await this.pouchService.loadPouches(),n&&await this.handleSelect(null))}async handleAdd(){const t=await this.pouchService.addPouch();t&&(await this.pouchService.loadPouches(),await this.handleSelect(t))}async handleSelect(t){await this.pouchService.selectPouch(t)}}Hf=ix([Wt(),T0("design:type",Function),T0("design:paramtypes",[void 0,void 0])],Hf);function M0({pouch:e,onRemove:t,isSelected:n,onSelect:r}){const i=N.useCallback(()=>{t&&t(e.id)},[t,e]),o=N.useCallback(()=>{r(e.id)},[r,e.id]);return m.jsxs("div",{className:"flex items-center",children:[m.jsxs("div",{className:"flex items-center",onClick:o,children:[m.jsx("div",{className:"my-1 mx-2 w-4",children:!!n&&m.jsx(Qe,{name:"Wallet"})}),m.jsx("div",{className:"cursor-pointer",children:e.name})]}),!!t&&m.jsx("div",{className:"ml-auto",children:m.jsx(ze,{variant:"flat",onClick:i,children:m.jsx("div",{className:"text-red-500",children:m.jsx(Qe,{name:"Trash"})})})})]})}const ox=ee(({onSelect:e})=>{const{pouchStore:t,pouchAction:n}=ke({pouchStore:Qn,pouchAction:Hf}),r=t.currentPouchId,i=N.useCallback(o=>{n.handleSelect(o),e(o)},[e,n]);return m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsx(M0,{isSelected:r===null,pouch:{name:T("export.pouchMain"),id:null},onSelect:i}),t.pouches.map(o=>m.jsx(M0,{isSelected:r===o.id,pouch:o,onRemove:n.handleRemove,onSelect:i},`${o.id}-${o.name}`)),m.jsx(ze,{onClick:n.handleAdd,children:T("pouchBlock.add")})]})}),ax=ee(({onSelect:e})=>{const{pouchStore:t}=ke({pouchStore:Qn}),{isOpen:n,handleOpen:r,handleClose:i}=Xb("pouch-modal");return m.jsxs(m.Fragment,{children:[m.jsx(su,{icon:"Wallet",onClick:r,children:t.currentPouchName}),m.jsxs(ic,{onClose:i,isOpen:n,children:[m.jsx(ic.Header,{title:T("pouchBlock.modalTitle"),onClose:i}),m.jsx(ic.Body,{children:m.jsx(ox,{onSelect:e})})]})]})});function a1({onSelect:e}){return m.jsx(ax,{onSelect:e})}var le;(function(e){e.MONTHLY="MONTHLY",e.SEASONALLY="SEASONALLY",e.YEARLY="YEARLY",e.FIVE_YEARLY="FIVE_YEARLY",e.ALL="ALL"})(le||(le={}));function sx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class Zo{mapExpenseToExpenseViewEntityList(t,n){const r={};return n.forEach(i=>{r[i.id]=i}),t.map(i=>{const o=i.catId,a=r[o],s=a!=null&&a.catId?r[a.catId]:null;return{id:i.id,catId:i.catId,cost:i.cost,pouchId:i.pouchId,time:i.time,state:i.state,dateBegin:i.dateBegin,dateEnd:i.dateEnd,desc:i.desc,catParentTitle:s?s.title:"",catParentId:s==null?void 0:s.id,catTitle:a?a.title:""}})}}Zo=sx([Ne()],Zo);function lx(e){return e?new Date(e):new Date}function Wf(e){const t=lx(e);return new Date(t.getFullYear(),t.getMonth()).getTime()}const ux=24*60*60*1e3;function Vr(e){const t=Wf(e),n=new Date(t),r=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return t+r*ux-1}const cx={11:11,0:1,1:1,2:4,3:4,4:4,5:7,6:7,7:7,8:10,9:10,10:10},fx={[le.MONTHLY](e){const t=Wf(e),n=Vr(e);return{startDate:t,endDate:n}},[le.SEASONALLY](e){const t=Vr(e),n=new Date(t),r=n.getMonth();let i=new Date(n.getFullYear(),cx[r],10);r===11&&(i=new Date(n.getFullYear()+1,1,10));const o=Vr(i),a=new Date(i);return a.setMonth(i.getMonth()-2),{startDate:Wf(a.getTime()),endDate:o}},[le.YEARLY](e){const t=Vr(e),n=new Date(t),r=new Date(n.getFullYear(),0),i=new Date(n.getFullYear(),11),o=Vr(i);return{startDate:r.getTime(),endDate:o}},[le.FIVE_YEARLY](e){const t=Vr(e),n=new Date(t);return{startDate:new Date(n.getFullYear()-5,n.getMonth()).getTime(),endDate:t}},[le.ALL](){return{startDate:0,endDate:Date.now()}}};function dx({viewType:e,viewDate:t}){return fx[e](t)}function hx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function $0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class Rr{constructor(t=k(Zo)){O(this,"expenseViewListService");O(this,"reportView");O(this,"lists");O(this,"viewDate");O(this,"selectedCategoryId");this.expenseViewListService=t,this.reportView=le.MONTHLY,this.lists=new $g,this.viewDate=Date.now(),this.selectedCategoryId=""}get expenseList(){var t;return((t=this.lists.data)==null?void 0:t.expenseList)||[]}get categoryList(){var t;return((t=this.lists.data)==null?void 0:t.categoryList)||[]}get isLoading(){return this.lists.isLoading}setSelectedCategory(t){this.selectedCategoryId=t}setReportView(t){this.reportView=t}setViewDate(t){this.viewDate=t}get isPrevAvailable(){return this.reportView!==le.ALL}get totalCost(){return this.expenseList.reduce((t,n)=>t+Number(n.cost),0)}get categoryMap(){return this.categoryList.reduce((t,n)=>(t[n.id]=n,t),{})}get categoryReportView(){return Object.values(this.categoryReportViewMap).map(t=>({node:t.node,children:Object.values(t.children)}))}get expenseListView(){const t=this.categoryMap,n=this.expenseList.filter(r=>{const i=t[r.catId].catId;return!!this.checkCategorySelection(r.catId,i)});return this.expenseViewListService.mapExpenseToExpenseViewEntityList(n,this.categoryList)}checkCategorySelection(t,n){const r=this.selectedCategoryId;return r?!(r&&!(r===n||r===t)):!0}get categoryReportViewMap(){const t=this.categoryMap;return this.expenseList.reduce((n,r)=>{const{catId:i,cost:o}=r,a=t[i].catId;if(!this.checkCategorySelection(i,a))return n;if(a){const l=n[a]=n[a]||{node:{id:a,title:t[a].title,cost:0},children:{}};l.node.cost=l.node.cost+Number(o);const u=l.children[i]=l.children[i]||{id:i,cost:0,title:t[i].title};return u.cost=u.cost+Number(o),n}const s=n[i]=n[i]||{node:{id:i,cost:0,title:t[i].title},children:{}};return s.node.cost=s.node.cost+Number(o),n},{})}get isNextAvailable(){return this.reportView===le.ALL?!1:this.range.endDate=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function F0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class Yf{constructor(t=k(Rr),n=k(Qn)){O(this,"analyticStore");O(this,"pouchStore");this.analyticStore=t,this.pouchStore=n}async handleReport(){const{startDate:t,endDate:n}=this.analyticStore.range,r=this.pouchStore.currentPouchId,i=await _b({startDate:t,endDate:n,pouchId:r});this.analyticStore.lists.setResult(i)}}Yf=px([Ne(),F0("design:type",Function),F0("design:paramtypes",[void 0,void 0])],Yf);function vx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function B0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class Jo{constructor(t=k(Yf),n=k(Rr),r=k(qo)){O(this,"analyticReportService");O(this,"analyticStore");O(this,"pouchService");this.analyticReportService=t,this.analyticStore=n,this.pouchService=r}handleToggleSelectedCategory(t){if(t){if(this.analyticStore.selectedCategoryId===t){this.analyticStore.setSelectedCategory("");return}this.analyticStore.setSelectedCategory(t)}}async handleChangeReportView(t){this.analyticStore.lists.start(),this.analyticStore.setReportView(t),await this.analyticReportService.handleReport(),this.analyticStore.lists.finish()}async handleNextReport(){this.analyticStore.isNextAvailable&&(this.analyticStore.lists.start(),this.analyticStore.setViewDate(this.analyticStore.range.endDate+2e3),await this.analyticReportService.handleReport(),this.analyticStore.lists.finish())}async initialLoadData(){this.analyticStore.lists.start(),await this.pouchService.loadPouches(),await this.analyticReportService.handleReport(),this.analyticStore.lists.finish()}async reloadAnalytic(){await this.analyticReportService.handleReport()}async handlePrevReport(){this.analyticStore.lists.start(),this.analyticStore.setViewDate(this.analyticStore.range.startDate-2e3),await this.analyticReportService.handleReport(),this.analyticStore.lists.finish()}}Jo=vx([Wt(),B0("design:type",Function),B0("design:paramtypes",[void 0,void 0,void 0])],Jo);function Nh(){return ke({analyticStore:Rr,analyticAction:Jo})}const he={expense:"/",expenseItem:"/page/expense",analytic:"/page/analytic",categories:"/page/categories",settings:"/page/settings",empty:"/page/empty"};function os({isActive:e,title:t,icon:n,onClick:r}){const i=e?"text-gray-600 dark:text-gray-100":"text-gray-400 dark:text-gray-400",o=N.useCallback(()=>{e||r()},[r,e]);return m.jsxs("button",{className:`flex ${i} flex-col items-center justify-center w-full p-2`,onClick:o,children:[m.jsx(Qe,{name:n}),m.jsx("div",{className:"text-xs mt-1",children:t})]})}function uu(){const[e,t]=Ih();return m.jsxs("div",{className:"flex w-full",children:[m.jsx(os,{isActive:e===he.expense,icon:"Fea",title:T("pages.expense"),onClick:()=>t(he.expense)}),m.jsx(os,{isActive:e.startsWith(he.analytic),icon:"Activity",title:T("pages.analytic"),onClick:()=>t(he.analytic)}),m.jsx(os,{isActive:e.startsWith(he.categories),icon:"Layers",title:T("pages.category"),onClick:()=>t(he.categories)}),m.jsx(os,{isActive:e.startsWith(he.settings),icon:"Settings",title:T("pages.settings"),onClick:()=>t(he.settings)})]})}function cu({title:e,rightSlot:t}){return m.jsxs("div",{className:"min-h-12 flex items-center gap-2 w-full",children:[m.jsx("div",{className:"text-xl ",children:e}),m.jsx(Ye,{has:!!t,children:m.jsx("div",{className:"ml-auto",children:t})})]})}const Aa=({children:e,headerSlot:t,footerSlot:n})=>m.jsxs("div",{className:"max-w-2xl flex flex-col overflow-x-hidden mx-auto w-full h-screen",children:[m.jsx(Ye,{has:!!t,children:m.jsxs("div",{children:[t,m.jsx(wl,{})]})}),m.jsx("div",{className:"flex flex-col relative flex-1",children:e}),m.jsx(Ye,{has:!!n,children:m.jsxs("div",{children:[m.jsx(wl,{}),n]})})]}),mx=ee(()=>{const{analyticAction:e}=ke({analyticAction:Jo});return m.jsx(a1,{onSelect:()=>{e.reloadAnalytic()}})});function ea(e,t){let n=e;do if(n&&n.hasAttribute&&n.hasAttribute(t))break;while(n&&(n=n.parentNode));if(n&&n.getAttribute)return n.getAttribute(t)||void 0}function gx(e,t){return N.useCallback(r=>{const i=ea(r.target,e);t(i)},[e])}const yx=ee(()=>{const{analyticStore:e,analyticAction:t}=Nh(),n=gx("data-id",t.handleToggleSelectedCategory);return m.jsx("div",{onClick:n,className:"flex flex-col gap-4",children:e.categoryReportView.map(r=>{const i=e.selectedCategoryId===r.node.id,o=i?"ALeft":"Plus";return m.jsxs("div",{children:[m.jsxs("button",{className:"w-full flex text-lg text-gray-500 pr-2 border-b border-gray-300 dark:border-gray-800 py-1","data-id":r.node.id,children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Qe,{name:o}),r.node.title]}),m.jsx("div",{className:"ml-auto",children:$o(r.node.cost)})]}),m.jsx(Ye,{has:!i,children:m.jsx("div",{className:"flex flex-col mr-6",children:r.children.map(a=>{const l=e.selectedCategoryId===a.id?"ALeft":"Plus";return m.jsxs("button",{className:"w-full flex ml-4 py-2 border-b border-gray-300 dark:border-gray-800","data-id":a.id,children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Qe,{name:l}),a.title]}),m.jsx("div",{className:"ml-auto",children:$o(a.cost)})]},a.id)})})})]},r.node.id)})})});function _x(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class Sl{constructor(){O(this,"instance")}setHistory(t){this.instance=t}history(...t){if(this.instance)return this.instance(...t)}}Sl=_x([Ne()],Sl);function wx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function z0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class ji{constructor(t=k(Sl)){O(this,"routerHistory");this.routerHistory=t}push(t){this.routerHistory.history(t)}replace(t){this.routerHistory.history(t,{replace:!0})}}ji=wx([Ne(),z0("design:type",Function),z0("design:paramtypes",[void 0])],ji);const{MoneySpendingErrors:Gi}=Jn("MoneySpendingErrors",{GetExpensesResponse:"Failed load expenses",GetCategoriesResponse:"Failed load categories",RemoveExpenseResponse:"Failed remove expense",AddExpenseResponse:"Failed add expense",UpdateExpenseResponse:"Failed update expense"});function Sx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function V0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class Gf{constructor(t=k(Gn)){O(this,"databaseDataProvider");this.databaseDataProvider=t}get client(){return this.databaseDataProvider.client}get ok(){return this.databaseDataProvider.ok}async getExpenses({offset:t,pouchId:n,limit:r}){const i=await this.client.expense.orderBy("time").reverse().filter(o=>o.dateEnd?!1:!n&&!o.pouchId||o.pouchId===n).offset(t).limit(r).toArray();return this.ok(i)}async getCategories(){const t=await this.client.category.toArray();return this.ok(t)}async removeExpense(t){const n={dateEnd:Date.now()},r=this.client.expense.where("id").equals(t).modify(n);return this.ok(r)}async addExpense(t){return this.client.expense.add(t),this.ok(!0)}async updateExpense(t){const n=this.client.expense.where("id").equals(t.id).modify(t);return this.ok(n)}}Gf=Sx([tr(),V0("design:type",Function),V0("design:paramtypes",[void 0])],Gf);const bx=xa(class{constructor(t=k(Gf)){O(this,"moneySpendingDataProvider");this.moneySpendingDataProvider=t}async getExpenses({pouchId:t,offset:n,limit:r}){const i=await this.moneySpendingDataProvider.getExpenses({offset:n,limit:r,pouchId:t});return H(i)?_e(new Gi.GetExpensesResponse(i.error)):be(i.data)}async getCategories(){const t=await this.moneySpendingDataProvider.getCategories();return H(t)?_e(new Gi.GetCategoriesResponse(t.error)):be(t.data)}async removeExpense(t){const n=await this.moneySpendingDataProvider.removeExpense(t);return H(n)?_e(new Gi.RemoveExpenseResponse(n.error)):be(n.data)}async updateExpense({id:t,time:n,desc:r,cost:i,catId:o,pouchId:a}){const s={id:t,cost:i,desc:r,time:n,state:-1,pouchId:a,catId:o},l=await this.moneySpendingDataProvider.updateExpense(s);return H(l)?_e(new Gi.UpdateExpenseResponse(l.error)):be(l.data)}async addExpense({desc:t,cost:n,catId:r,pouchId:i}){const o={id:kh(),cost:n,desc:t,time:new Date().getTime(),state:-1,pouchId:i,catId:r},a=await this.moneySpendingDataProvider.addExpense(o);return H(a)?_e(new Gi.AddExpenseResponse(a.error)):be(a.data)}});function xx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class ta{constructor(){O(this,"currentExpenseView",null);O(this,"currentDesc","");O(this,"totalCostList",[]);O(this,"currentCostList",[]);O(this,"currentDivideCostList",[]);O(this,"isFloat",!1)}clear(){this.currentCostList=[],this.currentDivideCostList=[],this.totalCostList=[],this.setIsFloat(!1)}setIsFloat(t){this.isFloat=t}addNumberToCost(t){const n=Number(t);if(!isNaN(n)){if(!this.isFloat){this.currentCostList.push(n);return}this.currentDivideCostList.push(n),this.currentDivideCostList.length>2&&this.currentDivideCostList.shift()}}setCurrentDesc(t){this.currentDesc=t}get costValue(){return Number(this.currentCostList.join(""))*100+Number(this.currentDivideCostList.join(""))}pushCurrentToCostList(){const t=this.costValue;this.totalCostList.push(t),this.currentCostList=[],this.currentDivideCostList=[],this.setIsFloat(!1)}backspaceCostList(){if(this.currentDivideCostList.length){this.currentDivideCostList.pop();return}this.setIsFloat(!1),this.currentCostList.pop()}setCurrentExpenseView(t){if(this.currentExpenseView=t?{...t}:null,t){this.setCurrentDesc(t.desc||"");const n=String(t.cost).split("").map(r=>Number(r));this.currentDivideCostList=n.slice(-2),this.currentCostList=n.slice(0,-2)}}get isEditing(){return!!this.currentExpenseView}get costsView(){return this.totalCostList.map(t=>eo(t/100,2)).join(" + ")}get totalCostView(){const t=this.totalCostList.reduce((n,r)=>n+r,this.costValue);return eo(t/100)}get currentCostView(){const t=this.costValue/100;return this.isFloat?eo(t,2):eo(t)}getExpenses(){return[...this.totalCostList,this.costValue]}dropData(){this.currentExpenseView=null,this.totalCostList=[],this.currentCostList=[],this.currentDivideCostList=[],this.isFloat=!1,this.currentDesc=""}}ta=xx([dt()],ta);const Qf=50;function Ex(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class yn{constructor(){O(this,"offset",0);O(this,"selectedCategoryId","");O(this,"isLoading",!0);O(this,"expenses",[]);O(this,"categories",[])}get isShowMoreVisible(){return this.expenses.length>=Qf}get selectedParentCategory(){return this.categories.find(t=>t.catId===this.selectedCategoryId)}get selectedCategory(){return this.categories.find(t=>t.id===this.selectedCategoryId)}get isCalculatorVisible(){return this.selectedCategoryId?!this.selectedParentCategory:!1}get parentCategoryTitle(){if(!this.selectedCategoryId)return"";const t=this.selectedCategory;if(!t)return"";if(!t.catId)return t.title;if(t.catId){const n=this.categories.find(r=>r.id===t.catId);return(n==null?void 0:n.title)||""}return""}get visibleCategories(){if(this.isCalculatorVisible){const t=this.selectedCategory;return t?[t]:[]}return this.categories.filter(t=>t.catId===this.selectedCategoryId||!this.selectedCategoryId&&!t.catId)}get isInitialLoading(){return this.offset===0&&this.isLoading}setSelectedCategoryId(t){if(this.selectedCategoryId!==t){this.selectedCategoryId=t;return}const n=this.selectedCategory;this.selectedCategoryId=(n==null?void 0:n.catId)||""}setIsLoading(t){this.isLoading=t}setOffset(t){this.offset=t}setExpenses(t){this.expenses=t}addExpenses(t){this.expenses=[...this.expenses,...t]}setCategories(t){this.categories=t}removeExpenseById(t){const n=this.expenses.findIndex(r=>r.id===t);n!==-1&&this.expenses.splice(n,1)}dropEntities(){this.setOffset(0),this.setExpenses([]),this.setCategories([])}}yn=Ex([dt()],yn);function Cx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function U0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class bl{constructor(t=k(gn),n=k(yn),r=k(bx),i=k(ta),o=k(qo),a=k(Qn),s=k(ji)){O(this,"messageBoxService");O(this,"moneySpendingStore");O(this,"moneySpendingAdapter");O(this,"expenseSelectionStore");O(this,"pouchService");O(this,"pouchStore");O(this,"historyService");this.messageBoxService=t,this.moneySpendingStore=n,this.moneySpendingAdapter=r,this.expenseSelectionStore=i,this.pouchService=o,this.pouchStore=a,this.historyService=s}async initialLoadData(){this.moneySpendingStore.setExpenses([]),this.moneySpendingStore.setOffset(0);const[t]=await Promise.all([this.moneySpendingAdapter.getCategories(),this.pouchService.loadPouches()]);if(!H(t)){if(this.moneySpendingStore.setCategories(t.data),this.moneySpendingStore.categories.length===0){this.historyService.push(he.empty);return}await this.loadExpenses(0)}}async reloadExpenses(){this.moneySpendingStore.setExpenses([]),this.moneySpendingStore.setOffset(0),await this.loadExpenses(0)}async loadExpenses(t){const n=this.pouchStore.currentPouchId,r=await this.moneySpendingAdapter.getExpenses({offset:t,pouchId:n,limit:Qf});if(H(r))return;this.moneySpendingStore.setOffset(t+Qf);const i=r.data;this.moneySpendingStore.addExpenses(i)}async removeExpense(t){if(!await this.messageBoxService.confirm(T("expense.confirmRemove")))return;this.moneySpendingStore.setIsLoading(!0);const r=await this.moneySpendingAdapter.removeExpense(t);this.moneySpendingStore.setIsLoading(!1),!H(r)&&(this.moneySpendingStore.setOffset(this.moneySpendingStore.offset-1),this.moneySpendingStore.removeExpenseById(t),this.expenseSelectionStore.dropData())}async handleUpdate(){const t=this.expenseSelectionStore.currentExpenseView;if(!t)return;this.moneySpendingStore.setIsLoading(!0);const n=this.pouchStore.currentPouchId;await this.moneySpendingAdapter.updateExpense({id:t.id,time:t.time,pouchId:n,catId:this.moneySpendingStore.selectedCategoryId,cost:this.expenseSelectionStore.costValue,desc:this.expenseSelectionStore.currentDesc}),this.expenseSelectionStore.dropData(),await this.reloadExpenses(),this.historyService.push(he.expense),this.moneySpendingStore.setIsLoading(!1)}async handleApply(){this.moneySpendingStore.setIsLoading(!0);const t=this.pouchStore.currentPouchId,n=this.moneySpendingStore.selectedCategoryId,r=this.expenseSelectionStore.currentDesc,i=this.expenseSelectionStore.getExpenses();for(const o of i)await this.moneySpendingAdapter.addExpense({pouchId:t,catId:n,cost:o,desc:r});this.expenseSelectionStore.dropData(),this.moneySpendingStore.setSelectedCategoryId(""),await this.reloadExpenses(),this.historyService.push(he.expense),this.moneySpendingStore.setIsLoading(!1)}}bl=Cx([Ne(),U0("design:type",Function),U0("design:paramtypes",[void 0,void 0,void 0,void 0,void 0,void 0,void 0])],bl);function Ox(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}const s1="en",qf=new ru("lang",{initialValue:nw()||s1});qf.value&&Im(qf.value);class Pi{constructor(){O(this,"langStorage",qf)}get currentLanguage(){return this.langStorage.value||s1}changeLanguage(t){this.langStorage.set(t),Im(t)}}Pi=Ox([dt()],Pi);function jx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function K0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class xl{constructor(t=k(Pi)){O(this,"langStore");this.langStore=t}handleToggleLanguage(){const n=this.langStore.currentLanguage==="ru"?"en":"ru";this.langStore.changeLanguage(n)}handleChangeLanguage(t){this.langStore.changeLanguage(t)}}xl=jx([Wt(),K0("design:type",Function),K0("design:paramtypes",[void 0])],xl);function Th(){return ke({langAction:xl,langStore:Pi})}function Px(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function H0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class El{constructor(t=k(Pi),n=k(yn),r=k(Zo)){O(this,"langStore");O(this,"moneySpendingStore");O(this,"expenseViewListService");this.langStore=t,this.moneySpendingStore=n,this.expenseViewListService=r}get dateFormatter(){return new Intl.DateTimeFormat(this.langStore.currentLanguage,{weekday:"short",month:"short",day:"numeric"})}get dateYearFormatter(){return new Intl.DateTimeFormat(this.langStore.currentLanguage,{year:"numeric",weekday:"short",month:"short",day:"numeric"})}get startTime(){const t=new Date;return t.setHours(0,0,0,0),t.getTime()}get todayCost(){const t=this.startTime,n=this.moneySpendingStore.expenses.reduce((r,i)=>i.time<=t?r:r+i.cost,0);return $o(n)}get expensesView(){return this.expenseViewListService.mapExpenseToExpenseViewEntityList(this.moneySpendingStore.expenses,this.moneySpendingStore.categories)}getExpenseViewById(t){return this.expensesView.find(n=>n.id===t)||null}}El=Px([dt(),H0("design:type",Function),H0("design:paramtypes",[void 0,void 0,void 0])],El);function Ax(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function W0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class Xf{constructor(t=k(bl),n=k(yn),r=k(ta),i=k(El)){O(this,"moneySpendingService");O(this,"moneySpendingStore");O(this,"expenseSelectionStore");O(this,"expensesViewStore");this.moneySpendingService=t,this.moneySpendingStore=n,this.expenseSelectionStore=r,this.expensesViewStore=i}handleSelectExpense(t){var i;const n=((i=this.expenseSelectionStore.currentExpenseView)==null?void 0:i.id)===t?"":t,r=this.expensesViewStore.getExpenseViewById(n);if(!r){this.expenseSelectionStore.setCurrentExpenseView(null);return}this.moneySpendingStore.setSelectedCategoryId(r.catId),this.expenseSelectionStore.setCurrentExpenseView(r)}async handleRemoveExpense(){var n;const t=(n=this.expenseSelectionStore.currentExpenseView)==null?void 0:n.id;t&&await this.moneySpendingService.removeExpense(t)}handleSelectCategoryId(t){this.moneySpendingStore.setSelectedCategoryId(t)}handleAddNumber(t){this.expenseSelectionStore.addNumberToCost(t)}handlePushCost(){this.expenseSelectionStore.pushCurrentToCostList()}handleBackspaceCost(){this.expenseSelectionStore.backspaceCostList()}handleClear(){this.expenseSelectionStore.clear()}handleChangeDesc(t){this.expenseSelectionStore.setCurrentDesc(t)}handleSetFloat(){this.expenseSelectionStore.setIsFloat(!0)}handleApply(){this.moneySpendingService.handleApply()}handleUpdate(){this.moneySpendingService.handleUpdate()}}Xf=Ax([Wt(),W0("design:type",Function),W0("design:paramtypes",[void 0,void 0,void 0,void 0])],Xf);function Rx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function Y0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class na{constructor(t=k(bl),n=k(yn),r=k(ji)){O(this,"moneySpendingService");O(this,"moneySpendingStore");O(this,"historyService");this.moneySpendingService=t,this.moneySpendingStore=n,this.historyService=r}async initialLoadData(){this.moneySpendingStore.offset===0&&(this.moneySpendingStore.setIsLoading(!0),await this.moneySpendingService.initialLoadData(),this.moneySpendingStore.setIsLoading(!1))}async reloadExpenses(){this.moneySpendingStore.setIsLoading(!0),await this.moneySpendingService.reloadExpenses(),this.moneySpendingStore.setIsLoading(!1)}async handleLoadNextExpenses(){this.moneySpendingStore.setIsLoading(!0),await this.moneySpendingService.loadExpenses(this.moneySpendingStore.offset),this.moneySpendingStore.setIsLoading(!1)}handleOpenExpense(){this.historyService.push(he.expenseItem)}handleOpenExpenseList(){this.historyService.push(he.expense)}handleDropSelectedCategory(){this.moneySpendingStore.setSelectedCategoryId("")}}na=Rx([Wt(),Y0("design:type",Function),Y0("design:paramtypes",[void 0,void 0,void 0])],na);function Sn(){return ke({moneySpendingAction:na,expenseSelectionAction:Xf,moneySpendingStore:yn,expenseSelectionStore:ta,expensesViewStore:El})}const l1=()=>m.jsx("div",{className:"relative",children:m.jsx("span",{className:"-top-1 left-1 absolute shadow w-2 h-2 bg-green-400 border-2 border-white dark:border-gray-800 rounded-full"})});function u1({expenseView:e,isSelected:t,isScrollTo:n}){const{expensesViewStore:r}=Sn(),i=new Date(e.time),s=new Date().getFullYear()===i.getFullYear()?r.dateFormatter.format(i):r.dateYearFormatter.format(i),l=i.getHours(),u=i.getMinutes(),c=u<10?`0${u}`:u,d=e.time>=r.startTime,f=N.useRef(null);N.useEffect(()=>{n&&f.current&&f.current.scrollIntoView({block:"center",inline:"center"})},[]);const g=t?"bg-gray-200 dark:bg-gray-800":"";return m.jsxs("div",{className:`flex w-full py-2 px-4 border-b dark:border-gray-800 border-gray-200 ${g}`,"data-is-selected":t,ref:f,children:[m.jsxs("div",{className:"flex flex-col items-start",children:[m.jsxs("div",{children:[e.catParentTitle?`${e.catParentTitle} / `:""," ",e.catTitle]}),m.jsx("div",{className:"text-gray-400 dark:text-gray-500",children:e.desc})]}),m.jsxs("div",{className:"ml-auto text-right",children:[m.jsx("div",{className:"text-xl",children:$o(e.cost)}),m.jsxs("div",{className:"text-xs dark:text-gray-500 text-gray-400 flex items-center",children:[s," | ",l,":",c,!!d&&m.jsx(l1,{})]})]})]})}const kx=ee(()=>{const{analyticStore:e}=ke({analyticStore:Rr});return e.selectedCategoryId?m.jsxs("div",{children:[m.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[m.jsx(wl,{}),m.jsx("div",{className:"text-xl text-center",children:T("analytic.details")})]}),e.expenseListView.map(t=>m.jsx(u1,{expenseView:t,isSelected:!1},t.id))]}):null}),Dx={0(){return T("analytic.seasons.winter")},1(){return T("analytic.seasons.spring")},2(){return T("analytic.seasons.summer")},3(){return T("analytic.seasons.autumn")}},Lx={11:0,0:0,1:0,2:1,3:1,4:1,5:2,6:2,7:2,8:3,9:3,10:3},as={[le.MONTHLY]({formatter:e,endDate:t}){const n=new Date(t),r=e.format(n),o=new Date().getFullYear()!=n.getFullYear()?n.getFullYear():"";return`${r} ${o}`},[le.SEASONALLY]({endDate:e}){const t=new Date(e),n=t.getMonth(),r=Lx[n],i=Dx[r](),a=new Date().getFullYear()!=t.getFullYear()?t.getFullYear():"";return`${i} ${a}`},[le.YEARLY]({endDate:e}){return`${new Date(e).getFullYear()}`},[le.FIVE_YEARLY]({endDate:e}){const t=new Date(e);return`${t.getFullYear()-5} - ${t.getFullYear()}`},[le.ALL](){return T("analytic.all")}};function Ix(){const{langStore:e}=Th(),{analyticStore:t,analyticAction:n}=Nh(),r=e.currentLanguage,i=N.useMemo(()=>new Intl.DateTimeFormat(r,{month:"long"}),[r]),o=t.viewDate,a=N.useMemo(()=>{const l={formatter:i,endDate:o};return[{label:as[le.MONTHLY](l),value:le.MONTHLY},{label:as[le.SEASONALLY](l),value:le.SEASONALLY},{label:as[le.YEARLY](l),value:le.YEARLY},{label:as[le.ALL](l),value:le.ALL}]},[i,o]);return{onChange:N.useCallback(l=>{n.handleChangeReportView(l)},[n]),options:a,reportView:t.reportView}}const Nx=ee(()=>{const{reportView:e,options:t,onChange:n}=Ix();return m.jsx(r1,{onChange:n,options:t,value:e})}),Tx=ee(()=>{const{analyticAction:e,analyticStore:t}=ke({analyticStore:Rr,analyticAction:Jo});return m.jsx("div",{children:m.jsxs("div",{className:"flex w-full gap-2",children:[m.jsx(ze,{onClick:e.handlePrevReport,isDisabled:!t.isPrevAvailable,children:m.jsx(Qe,{name:"ALeft"})}),m.jsx("div",{className:"flex-1",children:m.jsx(Nx,{})}),m.jsx(ze,{onClick:e.handleNextReport,isDisabled:!t.isNextAvailable,children:m.jsx(Qe,{name:"ARight"})})]})})}),Mx=ee(()=>{const{analyticStore:e,analyticAction:t}=Nh();return N.useEffect(()=>{t.initialLoadData()},[]),m.jsx(Aa,{headerSlot:m.jsxs(m.Fragment,{children:[m.jsx(cu,{title:T("pages.analytic"),rightSlot:m.jsx(mx,{})}),m.jsx(wl,{}),m.jsxs("div",{className:"mt-2",children:[m.jsx(Tx,{}),m.jsxs("div",{className:"flex h-12 items-center text-xl",children:[T("analytic.total"),m.jsx("div",{className:"ml-auto",children:$o(e.totalCost)})]})]})]}),footerSlot:m.jsx(uu,{}),children:m.jsx(lu,{children:m.jsxs(Ye,{is:e.isLoading,isSlot:m.jsx("div",{className:"w-full flex items-center justify-center min-h-64",children:m.jsx(Pa,{})}),children:[m.jsx(yx,{}),m.jsx(kx,{})]})})})}),{AppErrors:$x}=Jn("AppErrors",{DefineCategoryResponse:"Failed define categories"});function Fx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function G0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class Zf{constructor(t=k(Gn)){O(this,"databaseDataProvider");this.databaseDataProvider=t}async defineCategories(t){return await this.databaseDataProvider.client.category.clear(),await this.databaseDataProvider.client.category.bulkAdd(t),this.databaseDataProvider.ok(!0)}}Zf=Fx([tr(),G0("design:type",Function),G0("design:paramtypes",[void 0])],Zf);const Bx=nu(async e=>{const t=await k(Zf).defineCategories(e);return H(t)?_e(new $x.DefineCategoryResponse):be(null)}),zx=[{id:"5a29b6a142c84c408b60f441",title:"Clothes, shoes",catId:void 0},{id:"5a29b6a142784f408c024722",title:"accessories",catId:"5a29b6a142c84c408b60f441"},{id:"5a29b6a14208df40903de075",title:"footwear",catId:"5a29b6a142c84c408b60f441"},{id:"5a29b6a142f7c940ae912738",title:"clothes",catId:"5a29b6a142c84c408b60f441"},{id:"5a29b6a1420afd40b28f75ea",title:"Food",catId:void 0},{id:"5a29b6a1426c004093476371",title:"cafe/restaurant",catId:"5a29b6a1420afd40b28f75ea"},{id:"5a29b6a142b30340b20e6839",title:"snack",catId:"5a29b6a1420afd40b28f75ea"},{id:"5a29b6a142d91440b2102cf3",title:"shop",catId:"5a29b6a1420afd40b28f75ea"},{id:"5a29b6a1426ad340a0c3576e",title:"dinner",catId:"5a29b6a1420afd40b28f75ea"},{id:"5a29b6a142ef4040992cbaca",title:"Other",catId:void 0},{id:"5a29b6a142bd5b409db65b1d",title:"help",catId:"5a29b6a142ef4040992cbaca"},{id:"5a29b6a142c5c3408618b78b",title:"presents",catId:"5a29b6a142ef4040992cbaca"},{id:"5a29b6a142ab6040b0791598",title:"not planned",catId:"5a29b6a142ef4040992cbaca"},{id:"5a29b6a142cd6740a567c3e2",title:"Travels",catId:void 0},{id:"5a29b6a1420dc84090489cee",title:"transport",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a142c81d40a2156380",title:"souvenirs",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a14254cc409594e679",title:"connection",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a14254cc409594e772",title:"housing",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a142d35940913422c9",title:"food",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a142d35940913421c9",title:"other",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a1426c2640b230815c",title:"Personal transport",catId:void 0},{id:"5a29b6a142970240b329d8e3",title:"fuel",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a1424bdc40ad4221a1",title:"repair",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142207340a47d4600",title:"insurance",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142a61e4087159fa1",title:"TI",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a14260924081070e6d",title:"penalty",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142d27840b9aa932a",title:"tax",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142006a40b7509318",title:"parking",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a1424dad40a32d06bf",title:"car wash",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142539c40b39d5ec6",title:"Public transport",catId:void 0},{id:"5a29b6a142eed840a39539ec",title:"taxi",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a142b294409d8ac8d8",title:"train",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a1428627408175ff12",title:"airplane",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a1428627408175fa11",title:"passing car",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a142e708409984fde3",title:"public",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a142d95b40b0010f7f",title:"ship",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a142d994408e7c13dd",title:"House",catId:void 0},{id:"5a29b6a142624940a849393e",title:"household chemicals",catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a14232d6409c91622c",title:"furniture",catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a142143d40bffb6df1",title:"dishes",catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a142f1a9408048a97b",title:"repairs",catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a142066f409f54f8c1",title:`stationery +`,catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a14218fc4086045f3a",title:"Accounts and Services",catId:void 0},{id:"5a29b6a142764d409a6b5e24",title:"mortgage",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a1427f0b40b7a427c7",title:"rent",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a14209dc40846fbbcc",title:"communal payments",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142d88a40a7215421",title:"network",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142b16d40b459f7ef",title:"mobile",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142fa2c40b3009afe",title:"property insurance",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142636240a8171cab",title:"tax",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142636240a8172cab",title:"bank",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a14293fb40b48d4047",title:"credit",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a14227124082b4e98b",title:"Beauty and care",catId:void 0},{id:"5a29b6a1428d8c40a7b51345",title:"cosmetics",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a142de3e408d66e08d",title:"hairdresser",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a142096b40bb29761e",title:"massage",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a142c26040b85fdb46",title:"workout",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a142f61d40b73303dd",title:"procedures",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a14272fb4086aaed1a",title:"Health",catId:void 0},{id:"5a29b6a142543c408678b32d",title:"pharmacy",catId:"5a29b6a14272fb4086aaed1a"},{id:"5a29b6a14264454087a4fb5a",title:"hospital",catId:"5a29b6a14272fb4086aaed1a"},{id:"5a29b6a142f8a640b4ff8816",title:"insurance",catId:"5a29b6a14272fb4086aaed1a"},{id:"5a29b6a14260a0409d9c683f",title:"Children",catId:void 0},{id:"5a29b6a14268cd4095b72250",title:"toys",catId:"5a29b6a14260a0409d9c683f"},{id:"5a29b6a14294594085448e4d",title:"kindergarten, school, university",catId:"5a29b6a14260a0409d9c683f"},{id:"5a29b6a142798a408c797782",title:"Education",catId:void 0},{id:"5a29b6a142464a40b9929469",title:"courses, trainings",catId:"5a29b6a142798a408c797782"},{id:"5a29b6a142a40940b8fd0eba",title:"books, magazines",catId:"5a29b6a142798a408c797782"},{id:"5a29b6a142ae0840ae9e6e4a",title:"University",catId:"5a29b6a142798a408c797782"},{id:"5a29b6a142cc1140a64d322f",title:"Hobbies",catId:void 0},{id:"5a29b6a142d7f540b4f08a1a",title:"Entertainment",catId:void 0}],Vx=[{id:"5a29b6a142c84c408b60f441",title:"Одежда, обувь",catId:void 0},{id:"5a29b6a142784f408c024722",title:"аксесуары",catId:"5a29b6a142c84c408b60f441"},{id:"5a29b6a14208df40903de075",title:"обувь",catId:"5a29b6a142c84c408b60f441"},{id:"5a29b6a142f7c940ae912738",title:"одежда",catId:"5a29b6a142c84c408b60f441"},{id:"5a29b6a1420afd40b28f75ea",title:"Питание",catId:void 0},{id:"5a29b6a1426c004093476371",title:"кафе/ресторан",catId:"5a29b6a1420afd40b28f75ea"},{id:"5a29b6a142b30340b20e6839",title:"перекус (пирожок)",catId:"5a29b6a1420afd40b28f75ea"},{id:"5a29b6a142d91440b2102cf3",title:"магазин",catId:"5a29b6a1420afd40b28f75ea"},{id:"5a29b6a1426ad340a0c3576e",title:"обед",catId:"5a29b6a1420afd40b28f75ea"},{id:"5a29b6a142ef4040992cbaca",title:"Разное",catId:void 0},{id:"5a29b6a142bd5b409db65b1d",title:"помощь",catId:"5a29b6a142ef4040992cbaca"},{id:"5a29b6a142c5c3408618b78b",title:"подарки",catId:"5a29b6a142ef4040992cbaca"},{id:"5a29b6a142ab6040b0791598",title:"незапланированое",catId:"5a29b6a142ef4040992cbaca"},{id:"5a29b6a142cd6740a567c3e2",title:"Путешествия",catId:void 0},{id:"5a29b6a1420dc84090489cee",title:"транспорт",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a142c81d40a2156380",title:"сувениры",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a14254cc409594e679",title:"связь",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a14254cc409594e772",title:"жилье",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a142d35940913422c9",title:"еда",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a142d35940913421c9",title:"разное",catId:"5a29b6a142cd6740a567c3e2"},{id:"5a29b6a1426c2640b230815c",title:"Личный транспорт",catId:void 0},{id:"5a29b6a142970240b329d8e3",title:"топливо",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a1424bdc40ad4221a1",title:"ремонт",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142207340a47d4600",title:"страховка",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142a61e4087159fa1",title:"ТО",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a14260924081070e6d",title:"штраф",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142d27840b9aa932a",title:"налог",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142006a40b7509318",title:"парковка",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a1424dad40a32d06bf",title:"мойка",catId:"5a29b6a1426c2640b230815c"},{id:"5a29b6a142539c40b39d5ec6",title:"Транспорт",catId:void 0},{id:"5a29b6a142eed840a39539ec",title:"такси",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a142b294409d8ac8d8",title:"поезд",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a1428627408175ff12",title:"самолет",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a1428627408175fa11",title:"попутка",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a142e708409984fde3",title:"общественный",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a142d95b40b0010f7f",title:"корабль",catId:"5a29b6a142539c40b39d5ec6"},{id:"5a29b6a142d994408e7c13dd",title:"Дом",catId:void 0},{id:"5a29b6a142624940a849393e",title:"быт. химия",catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a14232d6409c91622c",title:"мебель",catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a142143d40bffb6df1",title:"посуда",catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a142f1a9408048a97b",title:"ремонт",catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a142066f409f54f8c1",title:"канц. товары",catId:"5a29b6a142d994408e7c13dd"},{id:"5a29b6a14218fc4086045f3a",title:"Счета и услуги",catId:void 0},{id:"5a29b6a142764d409a6b5e24",title:"ипотека",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a1427f0b40b7a427c7",title:"аренда",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a14209dc40846fbbcc",title:"коммунальные платежи",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142d88a40a7215421",title:"инет",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142b16d40b459f7ef",title:"моб. связь",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142fa2c40b3009afe",title:"страховка имущества",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142636240a8171cab",title:"налог",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a142636240a8172cab",title:"банк",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a14293fb40b48d4047",title:"кредит",catId:"5a29b6a14218fc4086045f3a"},{id:"5a29b6a14227124082b4e98b",title:"Красота и уход",catId:void 0},{id:"5a29b6a1428d8c40a7b51345",title:"косметика",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a142de3e408d66e08d",title:"парикмахер",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a142096b40bb29761e",title:"массаж",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a142c26040b85fdb46",title:"тренировки",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a142f61d40b73303dd",title:"процедуры",catId:"5a29b6a14227124082b4e98b"},{id:"5a29b6a14272fb4086aaed1a",title:"Здоровье",catId:void 0},{id:"5a29b6a142543c408678b32d",title:"аптека",catId:"5a29b6a14272fb4086aaed1a"},{id:"5a29b6a14264454087a4fb5a",title:"больница",catId:"5a29b6a14272fb4086aaed1a"},{id:"5a29b6a142f8a640b4ff8816",title:"страхование",catId:"5a29b6a14272fb4086aaed1a"},{id:"5a29b6a14260a0409d9c683f",title:"Дети",catId:void 0},{id:"5a29b6a14268cd4095b72250",title:"игрушки",catId:"5a29b6a14260a0409d9c683f"},{id:"5a29b6a14294594085448e4d",title:"садик, школа, универ",catId:"5a29b6a14260a0409d9c683f"},{id:"5a29b6a142798a408c797782",title:"Образование",catId:void 0},{id:"5a29b6a142464a40b9929469",title:"курсы, тренинги",catId:"5a29b6a142798a408c797782"},{id:"5a29b6a142a40940b8fd0eba",title:"книги, журналы",catId:"5a29b6a142798a408c797782"},{id:"5a29b6a142ae0840ae9e6e4a",title:"ВУЗ",catId:"5a29b6a142798a408c797782"},{id:"5a29b6a142cc1140a64d322f",title:"Хобби",catId:void 0},{id:"5a29b6a142d7f540b4f08a1a",title:"Развлечения",catId:void 0}];function Ux(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}const Kx={en:zx,ru:Vx};class Cl{constructor(){O(this,"selectedDefaultCategories","en")}changeDefaultCategory(t){this.selectedDefaultCategories=t}get defaultCategories(){return Kx[this.selectedDefaultCategories]}}Cl=Ux([dt()],Cl);function Hx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function Q0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class Jf{constructor(t=k(Cl),n=k(Pi)){O(this,"emptyStore");O(this,"langStore");this.emptyStore=t,this.langStore=n}changeDefaultCategory(t){this.emptyStore.changeDefaultCategory(t)}async applyDefaultCategory(){const t=this.emptyStore.selectedDefaultCategories;this.langStore.changeLanguage(t);const n=this.emptyStore.defaultCategories;n&&await Bx(n)}}Jf=Hx([Ne(),Q0("design:type",Function),Q0("design:paramtypes",[void 0,void 0])],Jf);function Wx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function q0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class ed{constructor(t=k(ji),n=k(Jf),r=k(xl)){O(this,"historyService");O(this,"emptyService");O(this,"languageAction");this.historyService=t,this.emptyService=n,this.languageAction=r}handleChangeCategory(t){this.languageAction.handleChangeLanguage(t),this.emptyService.changeDefaultCategory(t)}async handleApplyCategory(){await this.emptyService.applyDefaultCategory(),this.historyService.push(he.categories)}handleOpenSettings(){this.historyService.push(he.settings)}}ed=Wx([Wt(),q0("design:type",Function),q0("design:paramtypes",[void 0,void 0,void 0])],ed);const X0="category",Yx=ee(()=>{const{emptyAction:e,emptyStore:t}=ke({emptyAction:ed,emptyStore:Cl});return m.jsxs("div",{className:"m-2 flex flex-col gap-4 max-w-80 mx-auto w-full",children:[m.jsx("div",{className:"text-2xl",children:T("firstView.t")}),m.jsx("div",{children:T("firstView.select")}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx(Xo,{checkValue:t.selectedDefaultCategories,name:X0,value:"ru",onChange:e.handleChangeCategory,children:"Русский набор категорий"}),m.jsx(Xo,{checkValue:t.selectedDefaultCategories,name:X0,value:"en",onChange:e.handleChangeCategory,children:"English category set"}),m.jsx("div",{children:m.jsx(ze,{onClick:e.handleApplyCategory,children:T("firstView.use")})})]}),m.jsxs("div",{children:[m.jsx("div",{children:T("firstView.or")}),m.jsxs(ze,{onClick:e.handleOpenSettings,children:[T("firstView.import")," and upload"]})]})]})});wn({data:{notFound:{title:["Seems page not found","Похоже страницы не существует"]}}});function Gx(){return m.jsx("div",{className:"flex my-10 justify-center items-center text-sm",children:T("notFound.title")})}wn({data:{category:{addNew:["Add new category","Добавить новую категорию"],addSubNew:["Add new sub category","Добавить новую подкатегорию"],edit:["Edit category","Изменить категорию"],confirmRemove:["Are you sure want to remove category?","Точно удалить категорию?"]}}});const{CategoriesErrors:ss}=Jn("CategoriesErrors",{AddResponse:"Failed add category",GetListResponse:"Failed get category list",UpdateCategoryResponse:"Failed update category",RemoveCategoryResponse:"Failed remove category"});function Qx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function Z0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function qx(e){return!e.dateEnd}class td{constructor(t=k(Gn)){O(this,"databaseDataProvider");this.databaseDataProvider=t}get client(){return this.databaseDataProvider.client}get ok(){return this.databaseDataProvider.ok}async addCategory(t){const n=await this.client.category.add(t);return this.ok(n)}async getCategories(){const t=await this.client.category.filter(qx).toArray();return this.ok(t)}async updateCategoryTitle(t,n){const r={title:n},i=await this.client.category.where("id").equals(t).modify(r);return this.ok(i)}async removeCategory(t){const n={dateEnd:Date.now()},r=await this.client.category.where("id").equals(t).modify(n);return this.ok(r)}}td=Qx([tr(),Z0("design:type",Function),Z0("design:paramtypes",[void 0])],td);const Xx=xa(class{constructor(t=k(td)){O(this,"categoriesDataProvider");this.categoriesDataProvider=t}async addCategory(t){const n=await this.categoriesDataProvider.addCategory(t);return H(n)?_e(new ss.AddResponse(n.error)):be(!0)}async getCategories(){const t=await this.categoriesDataProvider.getCategories();return H(t)?_e(new ss.GetListResponse(t.error)):be(t.data)}async updateCategoryTitle(t,n){const r=await this.categoriesDataProvider.updateCategoryTitle(t,n);return H(r)?_e(new ss.UpdateCategoryResponse(r.error)):be(!0)}async removeCategory(t){const n=await this.categoriesDataProvider.removeCategory(t);return H(n)?_e(new ss.RemoveCategoryResponse(n.error)):be(!0)}});function Zx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class Ai{constructor(){O(this,"filter");O(this,"selectedCategoryId","");O(this,"state",new $g)}get categoryList(){return this.state.data||[]}get isLoading(){return this.state.isLoading}setSelectedCategoryId(t){this.selectedCategoryId=t}dropCategories(){this.state.setResult({data:[]})}setFilter(t){this.filter=t}checkFilter(t){return this.filter?this.filter(t):!0}get categoryTreeMaps(){const t={},n={};return this.categoryList.forEach(r=>{n[r.id]=r;const i=!r.catId,o=r.catId?r.catId:r.id,a=t[o]=t[o]||{children:[]};i||this.checkFilter(r)&&a.children.push(r.id)}),{rootMap:t,categoryMap:n}}get isEmptyCategories(){return this.categoryList.length===0}get selectedCategory(){return this.categoryList.find(t=>t.id===this.selectedCategoryId)}get categoryTree(){const{categoryMap:t,rootMap:n}=this.categoryTreeMaps;return Object.keys(n).filter(o=>{const a=t[o];return a?this.checkFilter(a):!1}).reduce((o,a)=>{const s=t[a],l=n[a];return o.push({item:s,isRoot:!0}),l.children.forEach(u=>{const c=t[u];o.push({item:c})}),o},[])}}Ai=Zx([dt()],Ai);function Jx(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function J0(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class nd{constructor(t=k(gn),n=k(Xx),r=k(Ai)){O(this,"messageBoxService");O(this,"categoriesAdapter");O(this,"categoriesStore");this.messageBoxService=t,this.categoriesAdapter=n,this.categoriesStore=r}async removeCategory(){const t=this.categoriesStore.selectedCategory;if(!t||!await this.messageBoxService.confirm(T("category.confirmRemove")))return;const r=await this.categoriesAdapter.removeCategory(t.id);H(r)||(this.categoriesStore.setSelectedCategoryId(""),await this.loadCategories())}async editCategory(){const t=this.categoriesStore.selectedCategory;if(!t)return;const{isApplied:n,data:r}=await this.messageBoxService.prompt(T("category.edit"),t.title);if(!n)return;const i=await this.categoriesAdapter.updateCategoryTitle(t.id,r);H(i)||await this.loadCategories()}async addCategory(){const t=this.categoriesStore.selectedCategoryId,{isApplied:n,data:r}=await this.messageBoxService.prompt(T(t?"category.addSubNew":"category.addNew"));if(!n)return;const i={id:kh(),catId:t,title:r},o=await this.categoriesAdapter.addCategory(i);H(o)||await this.loadCategories()}async loadCategories(){this.categoriesStore.state.start();const t=await this.categoriesAdapter.getCategories();this.categoriesStore.state.setResult(t),this.categoriesStore.state.finish()}}nd=Jx([Ne(),J0("design:type",Function),J0("design:paramtypes",[void 0,void 0,void 0])],nd);function e4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function ev(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class rd{constructor(t=k(nd),n=k(Ai),r=k(ji)){O(this,"categoriesService");O(this,"categoriesStore");O(this,"historyService");this.categoriesService=t,this.categoriesStore=n,this.historyService=r}handleAddCategory(){this.categoriesService.addCategory()}handleEditCategory(){this.categoriesService.editCategory()}handleRemoveCategory(){this.categoriesService.removeCategory()}async handleInitialLoadCategoryList(){this.categoriesStore.isEmptyCategories&&(await this.categoriesService.loadCategories(),this.categoriesStore.isEmptyCategories&&this.historyService.push(he.empty))}toggleSelectedCategoryId(t){const n=this.categoriesStore.selectedCategoryId===t?"":t;this.categoriesStore.setSelectedCategoryId(n)}}rd=e4([Wt(),ev("design:type",Function),ev("design:paramtypes",[void 0,void 0,void 0])],rd);function Mh(){return ke({categoriesAction:rd,categoriesStore:Ai})}const t4=ee(()=>{var o;const{categoriesAction:e,categoriesStore:t}=Mh(),n=!((o=t.selectedCategory)!=null&&o.catId),r=!!t.selectedCategoryId,i=r?"primary":"secondary";return m.jsxs("div",{className:"absolute right-6 bottom-3 flex flex-col gap-2",children:[!!r&&m.jsx(ze,{shape:"circle",iconName:"Trash",iconSize:"huge",onClick:e.handleRemoveCategory}),!!r&&m.jsx(ze,{shape:"circle",iconName:"EditL",iconSize:"huge",onClick:e.handleEditCategory}),!!n&&m.jsx(ze,{shape:"circle",iconName:"Plus",iconSize:"huge",variant:i,onClick:e.handleAddCategory})]})});function n4({isActive:e,isRoot:t,title:n,categoryId:r}){const i=e?"underline text-gray-400 dark:text-gray-600":"",o=t?"":"pl-6";return m.jsx("div",{className:`p-2 cursor-pointer ${i} ${o}`,"data-category-id":r,children:n})}function r4({categoryTree:e,onClick:t,selectedId:n}){const r=N.useCallback(i=>{const o=ea(i.target,"data-category-id");o&&t(o)},[t]);return m.jsx("div",{onClick:r,children:e.map(i=>{const{item:o,isRoot:a}=i,s=o.id===n,l=`${o.id}-${o.title}-${o.catId}`;return m.jsx(n4,{title:o.title,isActive:s,categoryId:o.id,isRoot:a},l)})})}const i4=ee(()=>{const{categoriesAction:e,categoriesStore:t}=Mh(),n=t.selectedCategoryId,r=N.useCallback(i=>{e.toggleSelectedCategoryId(i)},[e]);return m.jsx(r4,{onClick:r,selectedId:n,categoryTree:t.categoryTree})}),o4=ee(()=>{const{categoriesAction:e,categoriesStore:t}=Mh();return N.useEffect(()=>{e.handleInitialLoadCategoryList()},[e]),m.jsxs(Aa,{headerSlot:m.jsx(cu,{title:T("pages.category")}),footerSlot:m.jsx(uu,{}),children:[m.jsx(lu,{children:m.jsx(Ye,{is:t.isLoading,isSlot:m.jsx(Pa,{}),children:m.jsx(i4,{})})}),m.jsx(t4,{})]})});function a4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class Ol{constructor(){O(this,"isTyping",!1)}setIsTyping(t){this.isTyping=t}}Ol=a4([dt()],Ol);function s4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function tv(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}const l4={input:{type:{file:!1,radio:!1,checked:!1}},textarea:!0};function nv(e){const t=e.target,n=t.nodeName.toLowerCase(),r=l4[n];return r!=null&&r.type&&r.type.hasOwnProperty(t.type)&&r.type[t.type]===!1?!1:!!r}class id{constructor(t=k(Ol)){O(this,"focusStore");this.focusStore=t}handleStartTyping(t){nv(t)&&this.focusStore.setIsTyping(!0)}handleStopTyping(t){nv(t)&&this.focusStore.setIsTyping(!1)}}id=s4([Wt(),tv("design:type",Function),tv("design:paramtypes",[void 0])],id);function u4(){const{focusAction:e}=ke({focusAction:id});N.useEffect(()=>(document.body.addEventListener("focus",e.handleStartTyping,!0),document.body.addEventListener("blur",e.handleStopTyping,!0),()=>{document.body.removeEventListener("focus",e.handleStartTyping,!0),document.body.removeEventListener("blur",e.handleStopTyping,!0)}),[e.handleStartTyping,e.handleStopTyping])}wn({data:{moneySpending:{selectCategory:["Select category","Выберите категорию"],selectSubCategory:["Select sub category","Выберите подкатегорию"],typeValue:["Type value","Введите данные"],add:["Add","Добавить"],edit:["Change","Изменить"],commentPh:["refinement","уточнение"]}}});const c4=ee(()=>{const{moneySpendingStore:e,moneySpendingAction:t,expenseSelectionAction:n}=Sn(),{selectedCategoryId:r}=e,i=!!r,o=e.isCalculatorVisible;return m.jsxs("div",{children:[m.jsx("div",{className:"flex items-center justify-between py-3 text-xl",children:m.jsx(Ye,{is:o,isSlot:T("moneySpending.typeValue"),children:m.jsx(Ye,{is:!i,isSlot:T("moneySpending.selectCategory"),children:T("moneySpending.selectSubCategory")})})}),m.jsxs("div",{className:"flex gap-2 flex-wrap px-2",children:[m.jsx(Ye,{has:i,children:m.jsx(ze,{iconName:"ALeft",iconSize:"big",variant:"flat",onClick:t.handleDropSelectedCategory,children:e.parentCategoryTitle})}),m.jsx("div",{className:"flex gap-2 flex-wrap",children:e.visibleCategories.map(a=>{const s=a.id===r;return i&&s&&!a.catId?null:m.jsx(ze,{iconName:s?"ALeft":void 0,iconSize:"big",onClick:()=>{n.handleSelectCategoryId(a.id)},children:a.title},a.id)})})]})]})}),f4=ee(()=>{const{expenseSelectionAction:e,expenseSelectionStore:t}=Sn();return m.jsx("div",{className:"w-full mx-auto",children:m.jsx(Yy,{value:t.currentDesc,onChange:e.handleChangeDesc})})});var je;(function(e){e.NUMBER="NUMBER",e.CLEAR="CLEAR",e.BACKSPACE="BACKSPACE",e.PLUS="PLUS",e.DOT="DOT",e.APPLY="APPLY",e.UPDATE="UPDATE"})(je||(je={}));function d4(){const{expenseSelectionAction:e,expenseSelectionStore:t}=Sn();return{handleClick:N.useCallback(r=>{const i=r.target,o=ea(i,"data-action");if(!o)return;const a=ea(i,"data-value");switch(o){case"CLEAR":e.handleClear();return;case"BACKSPACE":e.handleBackspaceCost();return;case"PLUS":e.handlePushCost();return;case"DOT":e.handleSetFloat();return;case"UPDATE":e.handleUpdate();return;case"APPLY":e.handleApply();return;case"NUMBER":a&&e.handleAddNumber(a)}},[e]),isEditing:t.isEditing}}function ls({children:e}){return m.jsx("div",{className:"flex items-center justify-center gap-1",children:e})}const h4={secondary:"bg-gray-100 dark:bg-gray-600",apply:"bg-green-300 dark:bg-green-600"};function Ue({children:e,disabled:t,widthFill:n,viewType:r,"data-action":i,"data-value":o}){const a=n==="half"?"w-56":"w-28",s=r?h4[r]:"";return m.jsx("button",{className:`h-12 border flex items-center justify-center border-gray-200 active:bg-gray-300 active:text-gray-600 active:border-gray-500 dark:border-gray-700 dark:active:bg-gray-600 dark:active:text-gray-800 dark:active:border-gray-500 ${a} ${s}`,disabled:t,"data-action":i,"data-value":o,children:e})}const p4=ee(()=>{const{handleClick:e,isEditing:t}=d4(),n=t?je.UPDATE:je.APPLY,r=t?void 0:je.PLUS;return m.jsxs("div",{className:"flex flex-col mx-auto max-w-80 gap-1",onClick:e,children:[m.jsxs(ls,{children:[m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"1",children:"1"}),m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"2",children:"2"}),m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"3",children:"3"}),m.jsx(Ue,{"data-action":je.CLEAR,viewType:"secondary",children:"C"})]}),m.jsxs(ls,{children:[m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"4",children:"4"}),m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"5",children:"5"}),m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"6",children:"6"}),m.jsx(Ue,{"data-action":je.BACKSPACE,viewType:"secondary",children:m.jsx(Qe,{name:"ALeft",size:"big"})})]}),m.jsxs(ls,{children:[m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"7",children:"7"}),m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"8",children:"8"}),m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"9",children:"9"}),m.jsx(Ue,{"data-action":r,viewType:"secondary",disabled:t,children:m.jsx(Qe,{name:"Plus",size:"big"})})]}),m.jsxs(ls,{children:[m.jsx(Ue,{"data-action":je.DOT,children:"."}),m.jsx(Ue,{"data-action":je.NUMBER,"data-value":"0",children:"0"}),m.jsx(Ue,{"data-action":n,widthFill:"half",viewType:"apply",children:T(t?"moneySpending.edit":"moneySpending.add")})]})]})}),v4=ee(()=>{const{expenseSelectionStore:e}=Sn();return m.jsxs("div",{className:"w-full text-right h-16 max-w-80 mx-auto text-xs text-gray-400 relative border-l border-r border-gray-600 px-1",children:[m.jsx("div",{children:e.costsView}),m.jsx("div",{className:"absolute right-1 text-xl text-gray-100 top-6",children:e.currentCostView}),m.jsxs("div",{className:"absolute right-1 bottom-0",children:["= ",e.totalCostView]})]})}),m4=ee(()=>{const{focusStore:e}=ke({focusStore:Ol}),{moneySpendingAction:t,moneySpendingStore:n}=ke({moneySpendingAction:na,moneySpendingStore:yn});return m.jsxs(Aa,{children:[m.jsxs(lu,{children:[m.jsx(c4,{}),m.jsx(Ye,{has:n.isCalculatorVisible,children:m.jsxs("div",{className:"mt-2 mx-2 flex flex-col gap-2",children:[m.jsx(f4,{}),m.jsx(v4,{}),m.jsx(p4,{})]})})]}),m.jsx(Ye,{has:!e.isTyping,children:m.jsx("div",{className:"absolute bottom-4 right-4",children:m.jsx(ze,{shape:"circle",iconName:"ALeft",iconSize:"huge",onClick:t.handleOpenExpenseList})})})]})});wn({data:{expense:{loadMore:["Load More...","Загрузить еще..."],today:["Today","Сегодня"],empty:["No expenses are here...","Трат еще пока нет"],confirmRemove:["Are you sure want to remove?","Точно удалить трату?"]}}});const g4=ee(()=>{const{moneySpendingAction:e}=ke({moneySpendingAction:na});return m.jsx(a1,{onSelect:()=>{e.reloadExpenses()}})}),y4=ee(()=>{const{expenseSelectionStore:e,moneySpendingAction:t,expenseSelectionAction:n}=Sn(),{isEditing:r}=e;return m.jsxs("div",{className:"absolute right-6 bottom-3 flex flex-col gap-2",children:[!!r&&m.jsx(ze,{shape:"circle",iconName:"Trash",iconSize:"huge",onClick:n.handleRemoveExpense}),!!r&&m.jsx(ze,{shape:"circle",iconName:"EditL",iconSize:"huge",onClick:t.handleOpenExpense}),!r&&m.jsx(ze,{shape:"circle",iconName:"Plus",iconSize:"huge",onClick:t.handleOpenExpense})]})}),_4=ee(()=>{var a;const{expenseSelectionAction:e,expenseSelectionStore:t,expensesViewStore:n}=Sn(),r=N.useCallback(s=>{const l=ea(s.target,"data-expense-id");l&&e.handleSelectExpense(l)},[e]),i=(a=t.currentExpenseView)==null?void 0:a.id,o=!!i;return m.jsx("div",{onClick:r,children:n.expensesView.map((s,l)=>{const u=`${s.id}-${l}`,c=s.id===i,d=c&&o;return m.jsx("button",{className:"w-full","data-expense-id":s.id,children:m.jsx(u1,{expenseView:s,isSelected:c,isScrollTo:d})},u)})})}),w4=ee(()=>{const{expensesViewStore:e}=Sn();return m.jsxs("div",{className:"flex items-center justify-center w-full h-10 border-b dark:border-gray-800 border-gray-200",children:[m.jsx("div",{className:"flex w-full items-center justify-center text-gray-500",children:T("expense.today")}),m.jsx("div",{className:"flex w-full items-center justify-center",children:m.jsxs("div",{className:"flex items-center",children:[e.todayCost,m.jsx(l1,{})]})})]})}),rv="IntersectionObserver"in window;function S4({onChange:e}){const t=N.useRef(null),n=N.useRef(null),r=N.useRef(e);return r.current=e,{anchorRef:N.useCallback(o=>{if(!rv||(n.current&&t.current&&(n.current.unobserve(t.current),n.current.disconnect(),n.current=null,t.current=null),!o))return;t.current=o;const a=new window.IntersectionObserver(([s])=>{if(s.isIntersecting){r.current("visible");return}r.current("hidden")},{root:null,threshold:.1});a.observe(o),n.current=a},[]),isIntersectionAvailable:rv}}function b4(){const{moneySpendingAction:e,moneySpendingStore:t}=Sn();N.useEffect(()=>{e.initialLoadData()},[e]);const n=N.useCallback(i=>{i!=="hidden"&&e.handleLoadNextExpenses()},[e]),{anchorRef:r}=S4({onChange:n});return{anchorRef:r,moneySpendingStore:t,moneySpendingAction:e}}const x4=ee(()=>{const{anchorRef:e,moneySpendingStore:t,moneySpendingAction:n}=b4();return m.jsxs(Aa,{headerSlot:m.jsx(cu,{title:T("pages.expense"),rightSlot:m.jsx(g4,{})}),footerSlot:m.jsx(uu,{}),children:[m.jsx(lu,{children:m.jsxs(Ye,{is:t.isInitialLoading,isSlot:m.jsx(Pa,{}),children:[m.jsx(w4,{}),m.jsx(_4,{}),m.jsx("div",{ref:e}),m.jsx(Ye,{has:t.isShowMoreVisible,children:m.jsx("div",{children:m.jsx(su,{onClick:n.handleLoadNextExpenses,children:T("expense.loadMore")})})})]})}),m.jsx(y4,{})]})});function E4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class od{constructor(){O(this,"pathname","")}updateState(t){t!==this.pathname&&(this.pathname=t)}}od=E4([dt()],od);function C4(){const[e,t]=Ih(),{historyStore:n,routerHistory:r}=ke({routerHistory:Sl,historyStore:od});return r.setHistory(t),n.updateState(e),null}const iv=(e,t=window.location.hash.replace("#",""))=>t.toLowerCase().indexOf(e.toLowerCase())?`~${t}`:t.slice(e.length)||"/",Qi="",O4=()=>{const[{path:e},t]=N.useState({path:iv(Qi),search:""}),n=N.useRef(e);N.useEffect(()=>{const i=()=>{const o=iv(Qi);if(n.current!==o){n.current=o;const[a,s]=o.split("?");t({path:a,search:s})}};return window.addEventListener("hashchange",i),()=>window.removeEventListener("hashchange",i)},[Qi]);const r=N.useCallback(i=>{window.location.hash=i[0]==="~"?i.slice(1):Qi+i},[Qi]);return[e,r]},j4="/improved-lamp/".slice(0,-1);function P4({children:e}){return m.jsxs(Ey,{base:j4,hook:O4,children:[m.jsx(C4,{}),e]})}wn({data:{settings:{version:["Version","Версия"],build:["Build","Сборка"],importDone:["Data added, import done","Данные добавлены, импорт завершен"],importError:["Import file error!","Ошибка при импорте"],importFin:["Import as .fin","Импорт как .fin"],exportError:["Export error","Ошибка при экспорте"],exportFin:["Export as .fin","Экспорт как .fin"],exportCsv:["Export as .csv","Экспорт как .csv"],sureDrop:["All data will be lost! Are you sure?","Все данные будут утеряны! Точно все удалить?"],dropAll:["Drop ALL","Удалить все"],theme:{dark:["Night Mode","Ночной режим"],light:["Light Mode","Дневной режим"]},lang:{title:["Language","Язык"],en:"English",ru:"Русский",values:["English","Русский"]}}}});const{SettingsErrors:oc}=Jn("SettingsErrors",{ImportResponse:"Failed import",DropDataResponse:"Failed drop data",LoadDataResponse:"Failed load data"});function A4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function ov(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class ad{constructor(t=k(Gn)){O(this,"databaseDataProvider");this.databaseDataProvider=t}get client(){return this.databaseDataProvider.client}get ok(){return this.databaseDataProvider.ok}async importData(t){return await Promise.all([this.client.expense.clear(),this.client.category.clear(),this.client.pouch.clear()]),await Promise.all([this.client.pouch.bulkAdd(t.pouch),this.client.category.bulkAdd(t.category),this.client.expense.bulkAdd(t.expense)]),this.ok(!0)}async dropData(){return await Promise.all([this.client.expense.clear(),this.client.category.clear(),this.client.pouch.clear()]),this.ok(!0)}async getAllData(){const[t,n,r]=await Promise.all([this.client.expense.orderBy("id").toArray(),this.client.category.orderBy("id").toArray(),this.client.pouch.orderBy("id").toArray()]);return this.ok({expense:t,category:n,pouch:r})}}ad=A4([tr(),ov("design:type",Function),ov("design:paramtypes",[void 0])],ad);const fu=xa(class{constructor(t=k(ad)){O(this,"settingsDataProvider");this.settingsDataProvider=t}async importData(t){const n=await this.settingsDataProvider.importData(t);return H(n)?_e(new oc.ImportResponse(n.error)):be(null)}async dropData(){const t=await this.settingsDataProvider.dropData();return H(t)?_e(new oc.DropDataResponse(t.error)):be(null)}async getAllData(){const t=await this.settingsDataProvider.getAllData();return H(t)?_e(new oc.LoadDataResponse(t.error)):be(t.data)}});function R4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function av(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class jl{constructor(t=k(gn),n=k(fu),r=k(Ai),i=k(yn)){O(this,"messageBoxService");O(this,"settingsAdapter");O(this,"categoriesStore");O(this,"moneySpendingStore");this.messageBoxService=t,this.settingsAdapter=n,this.categoriesStore=r,this.moneySpendingStore=i}async dropData(){if(!await this.messageBoxService.confirm(T("settings.sureDrop")))return;const n=await this.settingsAdapter.dropData();H(n),this.dropRelatedStores()}dropRelatedStores(){this.categoriesStore.dropCategories(),this.moneySpendingStore.dropEntities()}}jl=R4([Ne(),av("design:type",Function),av("design:paramtypes",[void 0,void 0,void 0,void 0])],jl);wn({data:{export:{pouchMain:["Main","Основной"],headers:{rootCat:["Main category","Основная категория"],cat:["Sub category","Подкатегория"],desc:["Description","Описание"],date:["Date","Дата"],cost:["Cost","Стоимость"]}}}});function k4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class ra{saveToFile(t,n){const r=document.createElement("a");r.setAttribute("href","data:application/text;charset=utf-8,"+encodeURIComponent(n)),r.setAttribute("download",t),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}async readTextFile(t){return new Promise((n,r)=>{const i=new FileReader;i.onerror=function(o){r&&r(o)},i.onload=function(o){var s;const a=(s=o.target)==null?void 0:s.result;n(a)},i.readAsText(t)})}}ra=k4([Ne()],ra);function D4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function sv(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}const lv=" ";class In{constructor(t=k(Zo)){O(this,"expenseViewListService");this.expenseViewListService=t}static getFullNum(t){return t<10?`0${t}`:t}getPouchesSheetsMap(t){const n={null:{id:null,name:T("export.pouchMain"),rows:[]}};return t.pouch.forEach(i=>{i.id&&(n[i.id]={id:i.id,name:i.name,rows:[]})}),this.expenseViewListService.mapExpenseToExpenseViewEntityList(t.expense,t.category).forEach(i=>{const o=i.pouchId,a=o?n[o]:null;a&&a.rows.push(i)}),n}getExpenseRows(t){return t.map(n=>{const r=n.cost,i=n.cost/100,o=Math.floor(i),a=`${r-o*100}`,s=`${o},${a}`,l=new Date(n.time),u=In.getFullNum(l.getMonth()+1),c=In.getFullNum(l.getDate()),d=In.getFullNum(l.getMinutes()),f=In.getFullNum(l.getSeconds()),g=`${l.getFullYear()}-${u}-${c} ${l.getHours()}:${d}:${f},000`;return[n.catParentTitle,n.catTitle,g,n.desc,s].join(lv)})}getSheets(t){const n=this.getPouchesSheetsMap(t),r=[];for(const i in n){const o=n[i],a=o.name,s=this.getExpenseRows(o.rows),l=[T("export.headers.rootCat"),T("export.headers.cat"),T("export.headers.date"),T("export.headers.desc"),T("export.headers.cost")].join(lv);s.push(l),s.reverse(),r.push({name:a,sheet:s.join(` +`)})}return r}}In=D4([Ne(),sv("design:type",Function),sv("design:paramtypes",[void 0])],In);function L4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function uv(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class ia{constructor(t=k(gn),n=k(fu),r=k(ra),i=k(In)){O(this,"messageBoxService");O(this,"settingsAdapter");O(this,"fileService");O(this,"sheetsService");this.messageBoxService=t,this.settingsAdapter=n,this.fileService=r,this.sheetsService=i}static getFileName(t){const n=new Date,r=n.getDate(),i=r<10?`0${r}`:r;return`${`coinote.${n.getFullYear()}-${n.getMonth()+1}-${i}`}.${t}.csv`}async exportData(){const t=await this.settingsAdapter.getAllData();if(H(t)){console.log("result",t),await this.messageBoxService.alert(T("settings.exportError"));return}const n=t.data;this.sheetsService.getSheets(n).forEach(({sheet:i,name:o})=>{const a=ia.getFileName(o);this.fileService.saveToFile(a,i)})}}ia=L4([Ne(),uv("design:type",Function),uv("design:paramtypes",[void 0,void 0,void 0,void 0])],ia);var $h={exports:{}};$h.exports;(function(e){var t=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function a(l,u){if(!o[l]){o[l]={};for(var c=0;c>>8,c[d*2+1]=g%256}return c},decompressFromUint8Array:function(l){if(l==null)return s.decompress(l);for(var u=new Array(l.length/2),c=0,d=u.length;c>1}else{for(f=1,d=0;d>1}h--,h==0&&(h=Math.pow(2,w),w++),delete S[p]}else for(f=g[p],d=0;d>1;h--,h==0&&(h=Math.pow(2,w),w++),g[E]=v++,p=String(y)}if(p!==""){if(Object.prototype.hasOwnProperty.call(S,p)){if(p.charCodeAt(0)<256){for(d=0;d>1}else{for(f=1,d=0;d>1}h--,h==0&&(h=Math.pow(2,w),w++),delete S[p]}else for(f=g[p],d=0;d>1;h--,h==0&&(h=Math.pow(2,w),w++)}for(f=2,d=0;d>1;for(;;)if(_=_<<1,b==u-1){x.push(c(_));break}else b++;return x.join("")},decompress:function(l){return l==null?"":l==""?null:s._decompress(l.length,32768,function(u){return l.charCodeAt(u)})},_decompress:function(l,u,c){var d=[],f=4,g=4,S=3,y="",E=[],p,h,v,w,x,_,b,C={val:c(0),position:u,index:1};for(p=0;p<3;p+=1)d[p]=p;for(v=0,x=Math.pow(2,2),_=1;_!=x;)w=C.val&C.position,C.position>>=1,C.position==0&&(C.position=u,C.val=c(C.index++)),v|=(w>0?1:0)*_,_<<=1;switch(v){case 0:for(v=0,x=Math.pow(2,8),_=1;_!=x;)w=C.val&C.position,C.position>>=1,C.position==0&&(C.position=u,C.val=c(C.index++)),v|=(w>0?1:0)*_,_<<=1;b=n(v);break;case 1:for(v=0,x=Math.pow(2,16),_=1;_!=x;)w=C.val&C.position,C.position>>=1,C.position==0&&(C.position=u,C.val=c(C.index++)),v|=(w>0?1:0)*_,_<<=1;b=n(v);break;case 2:return""}for(d[3]=b,h=b,E.push(b);;){if(C.index>l)return"";for(v=0,x=Math.pow(2,S),_=1;_!=x;)w=C.val&C.position,C.position>>=1,C.position==0&&(C.position=u,C.val=c(C.index++)),v|=(w>0?1:0)*_,_<<=1;switch(b=v){case 0:for(v=0,x=Math.pow(2,8),_=1;_!=x;)w=C.val&C.position,C.position>>=1,C.position==0&&(C.position=u,C.val=c(C.index++)),v|=(w>0?1:0)*_,_<<=1;d[g++]=n(v),b=g-1,f--;break;case 1:for(v=0,x=Math.pow(2,16),_=1;_!=x;)w=C.val&C.position,C.position>>=1,C.position==0&&(C.position=u,C.val=c(C.index++)),v|=(w>0?1:0)*_,_<<=1;d[g++]=n(v),b=g-1,f--;break;case 2:return E.join("")}if(f==0&&(f=Math.pow(2,S),S++),d[b])y=d[b];else if(b===g)y=h+h.charAt(0);else return null;E.push(y),d[g++]=h+y.charAt(0),f--,h=y,f==0&&(f=Math.pow(2,S),S++)}}};return s}();e!=null?e.exports=t:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t})})($h);var I4=$h.exports;const c1=_v(I4);function N4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function cv(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class sd{constructor(t=k(gn),n=k(ra),r=k(fu)){O(this,"messageBoxService");O(this,"fileService");O(this,"settingsAdapter");this.messageBoxService=t,this.fileService=n,this.settingsAdapter=r}async saveDbToFile(t){try{const n=JSON.stringify(t),r=c1.compressToBase64(n),i=new Date,o=`coinote.${i.getFullYear()}-${i.getMonth()+1}-${i.getDate()}.fin`;this.fileService.saveToFile(o,r)}catch{}}async exportData(){const t=await this.settingsAdapter.getAllData();if(H(t)){await this.messageBoxService.alert(T("settings.exportError"));return}const n=t.data;await this.saveDbToFile({dbVersion:4,data:n,stats:{expenses:n.expense.length,cats:n.category.length,pouch:n.pouch.length}})}}sd=N4([Ne(),cv("design:type",Function),cv("design:paramtypes",[void 0,void 0,void 0])],sd);function T4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function fv(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class oa{constructor(t=k(gn),n=k(ra),r=k(fu),i=k(jl)){O(this,"messageBoxService");O(this,"fileService");O(this,"settingsAdapter");O(this,"dropAllService");this.messageBoxService=t,this.fileService=n,this.settingsAdapter=r,this.dropAllService=i}static decompressFromBase64(t){try{let n=c1.decompressFromBase64(t);return n||(n=t),JSON.parse(n)}catch{return null}}async importFiles(t){if(!t||t.length===0)return;const n=await this.fileService.readTextFile(t[0]),r=oa.decompressFromBase64(n);if(!r||!r.dbVersion||!r.data)return;this.dropAllService.dropRelatedStores();const i=await this.settingsAdapter.importData(r.data);if(H(i)){await this.messageBoxService.alert(T("settings.importError"));return}await this.messageBoxService.alert(T("settings.importDone"))}}oa=T4([Ne(),fv("design:type",Function),fv("design:paramtypes",[void 0,void 0,void 0,void 0])],oa);function M4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}class Pl{constructor(){O(this,"isLoading",!1)}setIsLoading(t){this.isLoading=t}}Pl=M4([dt()],Pl);function $4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function dv(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class Al{constructor(t=k(oa),n=k(sd),r=k(ia),i=k(jl),o=k(Pl)){O(this,"importFinService");O(this,"exportFinService");O(this,"exportCsvService");O(this,"dropAllService");O(this,"settingsStore");this.importFinService=t,this.exportFinService=n,this.exportCsvService=r,this.dropAllService=i,this.settingsStore=o}async handleImportFiles(t){this.settingsStore.setIsLoading(!0),await this.importFinService.importFiles(t),this.settingsStore.setIsLoading(!1)}async handleExportAsFin(){this.settingsStore.setIsLoading(!0),await this.exportFinService.exportData(),this.settingsStore.setIsLoading(!1)}async handleExportAsCsv(){this.settingsStore.setIsLoading(!0),await this.exportCsvService.exportData(),this.settingsStore.setIsLoading(!1)}async handleDropAllData(){this.settingsStore.setIsLoading(!0),await this.dropAllService.dropData(),this.settingsStore.setIsLoading(!1)}}Al=$4([Wt(),dv("design:type",Function),dv("design:paramtypes",[void 0,void 0,void 0,void 0,void 0])],Al);function F4(){return ke({settingsAction:Al,settingsStore:Pl})}function B4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}const hv="light";class Rl{constructor(){O(this,"themeStorage",new ru("theme",{initialValue:hv}))}get currentTheme(){return this.themeStorage.value||hv}changeTheme(t){this.themeStorage.set(t)}}Rl=B4([dt()],Rl);function z4(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function pv(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}class ld{constructor(t=k(Rl)){O(this,"themeStore");this.themeStore=t}handleToggleTheme(){const n=this.themeStore.currentTheme==="light"?"dark":"light";this.themeStore.changeTheme(n)}}ld=z4([Wt(),pv("design:type",Function),pv("design:paramtypes",[void 0])],ld);function f1(){return ke({themeAction:ld,themeStore:Rl})}function vv(e,t,n){const r=e.split(" ").filter(i=>!(i.trim()===n||i.trim()===t));return r.push(n),r.join(" ").trim()}function V4(e,t){return e.split(t).join("")}const mv="",ac="theme-animate",U4=1200;function K4(){const{themeStore:e}=f1();N.useEffect(()=>{const t=e.currentTheme,n=document.getElementsByTagName("html")[0],r=t==="light"?"dark":"light",i=V4(n.className,ac),o=vv(i,`${mv}${r}`,`${mv}${t}`);n.className=vv(o,ac,ac);const a=window.setTimeout(()=>{n.className=o},U4);return()=>{window.clearTimeout(a)}},[e.currentTheme])}const H4=ee(()=>(K4(),null));var gv=1711197715568,Fh={time:gv,date:new Date(gv),appName:"Coinote",version:"6.0.0",hash:`b4e91bc +`};const yv=Fh.date,W4=Fh.hash.substring(0,6);function Y4(){return m.jsxs("div",{className:"text-xs text-gray-500",children:[m.jsxs("div",{children:[T("settings.version"),": ",Fh.version," | ",W4||""]}),m.jsxs("div",{children:[T("settings.build"),":"," ",`${yv.toLocaleTimeString()} | ${yv.toLocaleDateString()}`]})]})}function us({children:e,icon:t,onClick:n}){return m.jsx("div",{onClick:n,children:m.jsx(su,{icon:t,children:e})})}const G4=ee(()=>{const{settingsAction:e}=ke({settingsAction:Al});return m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx(us,{icon:"Upload",children:m.jsx(o1,{onChange:e.handleImportFiles,children:T("settings.importFin")})}),m.jsx(us,{icon:"Download",onClick:e.handleExportAsFin,children:T("settings.exportFin")}),m.jsx(us,{icon:"Download",onClick:e.handleExportAsCsv,children:T("settings.exportCsv")}),m.jsx("div",{className:"my-4 text-red-400 dark:text-red-600",children:m.jsx(us,{icon:"Trash",onClick:e.handleDropAllData,children:T("settings.dropAll")})})]})}),Q4=ee(()=>{const{themeStore:e,themeAction:t}=f1(),{langAction:n,langStore:r}=Th(),{settingsStore:i}=F4();return m.jsxs(m.Fragment,{children:[m.jsx(Aa,{headerSlot:m.jsx(cu,{title:T("pages.settings")}),footerSlot:m.jsx(uu,{}),children:m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex gap-2 items-center mt-4 cursor-pointer",onClick:t.handleToggleTheme,children:[m.jsx("div",{className:"text-gray-400",children:m.jsx(Qe,{name:"Moon"})}),m.jsx("div",{children:T("settings.theme.dark")}),m.jsx(i1,{checked:e.currentTheme==="dark"})]}),m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("div",{className:"text-gray-400",children:m.jsx(Qe,{name:"Translate"})}),T("settings.lang.title")]}),m.jsxs("div",{className:"flex gap-4 flex-col ml-4",children:[m.jsx(Xo,{checkValue:r.currentLanguage,name:"lang",value:"en",onChange:n.handleToggleLanguage,children:T("settings.lang.en")}),m.jsx(Xo,{checkValue:r.currentLanguage,name:"lang",value:"ru",onChange:n.handleToggleLanguage,children:T("settings.lang.ru")})]})]}),m.jsx(G4,{}),m.jsx("div",{className:"text-right",children:m.jsx(Y4,{})})]})}),!!i.isLoading&&m.jsx(Xy,{})]})});function q4(){var n,r;const e=document.getElementById("loader");if(!e)return;(n=e.parentNode)==null||n.removeChild(e);const t=document.querySelector("[data-type='loader']");t&&((r=t.parentNode)==null||r.removeChild(t))}function X4(){return N.useEffect(()=>{const e=window.setTimeout(q4,500);return()=>{window.clearTimeout(e)}},[]),null}const Z4=ee(()=>{const{langStore:e}=Th();return u4(),m.jsxs(N.Fragment,{children:[m.jsx(X4,{}),m.jsx(H4,{}),m.jsx(P4,{children:m.jsxs(qb,{children:[m.jsx(or,{path:`${he.expense}:?params`,component:x4}),m.jsx(or,{path:`${he.expenseItem}`,component:m4}),m.jsx(or,{path:`${he.analytic}/:?params`,component:Mx}),m.jsx(or,{path:he.categories,component:o4}),m.jsx(or,{path:he.settings,component:Q4}),m.jsx(or,{path:he.empty,component:Yx}),m.jsx(or,{children:m.jsx(Gx,{})})]})})]},e.currentLanguage)});function J4(){setTimeout(()=>{const e=document.getElementById("root");if(!e){console.error("Node not found");return}sc.createRoot(e).render(m.jsx(j.StrictMode,{children:m.jsx(Z4,{})}))},0)}J4(); diff --git a/docs/index.html b/docs/index.html index 760c723..e9f2399 100644 --- a/docs/index.html +++ b/docs/index.html @@ -59,7 +59,7 @@ display: none; } - + diff --git a/docs/sw.js b/docs/sw.js index e99dfb3..8b1ed41 100644 --- a/docs/sw.js +++ b/docs/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),d={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map((e=>d[e]||l(e)))).then((e=>(r(...e),o)))}}define(["./workbox-0bb2c59d"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-D28uEXmH.css",revision:null},{url:"assets/index-WVdwVjeK.js",revision:null},{url:"index.html",revision:"b9f485c7953019c66eb12bee6d29309b"},{url:"registerSW.js",revision:"25f4a93a594486f5bedd7f6c3719f22e"},{url:"manifest.webmanifest",revision:"e855ad41b4bfc19655ee26a84ffb9d2b"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const d=e=>i(e,t),f={module:{uri:t},exports:o,require:d};s[t]=Promise.all(n.map((e=>f[e]||d(e)))).then((e=>(r(...e),o)))}}define(["./workbox-0bb2c59d"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-D28uEXmH.css",revision:null},{url:"assets/index-DfKF4hG7.js",revision:null},{url:"index.html",revision:"a24bf2c72d2fcbaa787a4baddcddac3f"},{url:"registerSW.js",revision:"25f4a93a594486f5bedd7f6c3719f22e"},{url:"manifest.webmanifest",revision:"e855ad41b4bfc19655ee26a84ffb9d2b"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));