27 lines
306 KiB
JavaScript
27 lines
306 KiB
JavaScript
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();/**
|
||
* @vue/shared v3.5.44
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function Na(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const dt={},Ar=[],En=()=>{},Wu=()=>!1,ri=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),si=e=>e.startsWith("onUpdate:"),Et=Object.assign,Va=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},af=Object.prototype.hasOwnProperty,it=(e,t)=>af.call(e,t),Ke=Array.isArray,sr=e=>Bs(e)==="[object Map]",Bn=e=>Bs(e)==="[object Set]",zl=e=>Bs(e)==="[object Date]",Ge=e=>typeof e=="function",wt=e=>typeof e=="string",$n=e=>typeof e=="symbol",lt=e=>e!==null&&typeof e=="object",zu=e=>(lt(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),Gu=Object.prototype.toString,Bs=e=>Gu.call(e),lf=e=>Bs(e).slice(8,-1),Yu=e=>Bs(e)==="[object Object]",Ba=e=>wt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bs=Na(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),oi=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},uf=/-\w/g,hn=oi(e=>e.replace(uf,t=>t.slice(1).toUpperCase())),cf=/\B([A-Z])/g,dr=oi(e=>e.replace(cf,"-$1").toLowerCase()),Ju=oi(e=>e.charAt(0).toUpperCase()+e.slice(1)),Zi=oi(e=>e?`on${Ju(e)}`:""),Cn=(e,t)=>!Object.is(e,t),Po=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Xu=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},ii=e=>{const t=parseFloat(e);return isNaN(t)?e:t},df=e=>{const t=wt(e)?Number(e):NaN;return isNaN(t)?e:t};let Gl;const ai=()=>Gl||(Gl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function or(e){if(Ke(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=wt(s)?vf(s):or(s);if(o)for(const a in o)t[a]=o[a]}return t}else if(wt(e)||lt(e))return e}const ff=/;(?![^(]*\))/g,pf=/:([^]+)/,hf=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function vf(e){const t={};return e.replace(hf,n=>n.startsWith("/*")?"":n).split(ff).forEach(n=>{if(n){const s=n.split(pf);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function tt(e){let t="";if(wt(e))t=e;else if(Ke(e))for(let n=0;n<e.length;n++){const s=tt(e[n]);s&&(t+=s+" ")}else if(lt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const mf="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",yf=Na(mf);function Qu(e){return!!e||e===""}function gf(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=Un(e[o],t[o],n);return s}function Yl(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),o=new Uint8Array(s.length);for(const a of e){let u=-1;for(let f=0;f<s.length;f++)if(!o[f]&&Un(a,s[f],n)){u=f;break}if(u<0)return!1;o[u]=1}return!0}function bf(e,t,n){let s=sr(e),o=sr(t);if(s||o||(s=Bn(e),o=Bn(t),s||o))return s&&o?Yl(e,t,n):!1;const a=Object.keys(e).length,u=Object.keys(t).length;if(a!==u)return!1;for(const f in e){const h=e.hasOwnProperty(f),y=t.hasOwnProperty(f);if(h&&!y||!h&&y||!Un(e[f],t[f],n))return!1}return String(e)===String(t)}function Jl(e,t,n,s){n||(n=[new Map,new Map]);const[o,a]=n;if(o.has(e)||a.has(t))return o.get(e)===t&&a.get(t)===e;o.set(e,t),a.set(t,e);const u=s(e,t,n);return o.delete(e),a.delete(t),u}function Un(e,t,n){if(e===t)return!0;let s=zl(e),o=zl(t);return s||o?s&&o?e.getTime()===t.getTime():!1:(s=$n(e),o=$n(t),s||o?e===t:(s=Ke(e),o=Ke(t),s||o?s&&o?Jl(e,t,n,gf):!1:(s=lt(e),o=lt(t),s||o?!s||!o?!1:Jl(e,t,n,bf):String(e)===String(t))))}function Ua(e,t){return e.findIndex(n=>Un(n,t))}const Zu=e=>!!(e&&e.__v_isRef===!0),se=e=>wt(e)?e:e==null?"":Ke(e)||lt(e)&&(e.toString===Gu||!Ge(e.toString))?Zu(e)?se(e.value):JSON.stringify(e,ec,2):String(e),ec=(e,t)=>Zu(t)?ec(e,t.value):sr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],a)=>(n[ea(s,a)+" =>"]=o,n),{})}:Bn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ea(n))}:$n(t)?ea(t):lt(t)&&!Ke(t)&&!Yu(t)?String(t):t,ea=(e,t="")=>{var n;return $n(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
||
* @vue/reactivity v3.5.44
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let Mt;class wf{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Mt&&(Mt.active?(this.parent=Mt,this.index=(Mt.scopes||(Mt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=Mt;try{return Mt=this,t()}finally{Mt=n}}}on(){++this._on===1&&(this.prevScope=Mt,Mt=this)}off(){if(this._on>0&&--this._on===0){if(Mt===this)Mt=this.prevScope;else{let t=Mt;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function _f(){return Mt}let ht;const ta=new WeakSet;class tc{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Mt&&(Mt.active?Mt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ta.has(this)&&(ta.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||rc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Xl(this),sc(this);const t=ht,n=vn;ht=this,vn=!0;try{return this.fn()}finally{oc(this),ht=t,vn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Wa(t);this.deps=this.depsTail=void 0,Xl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ta.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ya(this)&&this.run()}get dirty(){return ya(this)}}let nc=0,ws,_s;function rc(e,t=!1){if(e.flags|=8,t){e.next=_s,_s=e;return}e.next=ws,ws=e}function qa(){nc++}function Ha(){if(--nc>0)return;if(_s){let t=_s;for(_s=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ws;){let t=ws;for(ws=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function sc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function oc(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Wa(s),kf(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function ya(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ic(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ic(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ps)||(e.globalVersion=Ps,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ya(e))))return;e.flags|=2;const t=e.dep,n=ht,s=vn;ht=e,vn=!0;try{sc(e);const o=e.fn(e._value);(t.version===0||Cn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ht=n,vn=s,oc(e),e.flags&=-3}}function Wa(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)Wa(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function kf(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let vn=!0;const ac=[];function An(){ac.push(vn),vn=!1}function Pn(){const e=ac.pop();vn=e===void 0?!0:e}function Xl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ht;ht=void 0;try{t()}finally{ht=n}}}let Ps=0;class xf{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class za{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ht||!vn||ht===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ht)n=this.activeLink=new xf(ht,this),ht.deps?(n.prevDep=ht.depsTail,ht.depsTail.nextDep=n,ht.depsTail=n):ht.deps=ht.depsTail=n,lc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=ht.depsTail,n.nextDep=void 0,ht.depsTail.nextDep=n,ht.depsTail=n,ht.deps===n&&(ht.deps=s)}return n}trigger(t){this.version++,Ps++,this.notify(t)}notify(t){qa();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ha()}}}function lc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)lc(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ga=new WeakMap,Pr=Symbol(""),ba=Symbol(""),Ts=Symbol("");function Kt(e,t,n){if(vn&&ht){let s=ga.get(e);s||ga.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new za),o.map=s,o.key=n),o.track()}}function Rn(e,t,n,s,o,a){const u=ga.get(e);if(!u){Ps++;return}const f=h=>{h&&h.trigger()};if(qa(),t==="clear")u.forEach(f);else{const h=Ke(e),y=h&&Ba(n);if(h&&n==="length"){const m=Number(s);u.forEach((w,C)=>{(C==="length"||C===Ts||!$n(C)&&C>=m)&&f(w)})}else switch((n!==void 0||u.has(void 0))&&f(u.get(n)),y&&f(u.get(Ts)),t){case"add":h?y&&f(u.get("length")):(f(u.get(Pr)),sr(e)&&f(u.get(ba)));break;case"delete":h||(f(u.get(Pr)),sr(e)&&f(u.get(ba)));break;case"set":sr(e)&&f(u.get(Pr));break}}Ha()}function qr(e){const t=ot(e);return t===e||(Kt(t,"iterate",Ts),ln(e))?t:Tn(e)?ir(e)?t.map(n=>ar(un(n))):t.map(ar):t.map(un)}function li(e){return Kt(e=ot(e),"iterate",Ts),e}function _n(e,t){return Tn(e)?ar(ir(e)?un(t):t):un(t)}const Cf={__proto__:null,[Symbol.iterator](){return na(this,Symbol.iterator,e=>_n(this,e))},concat(...e){return qr(this).concat(...e.map(t=>Ke(t)?qr(t):t))},entries(){return na(this,"entries",e=>(e[1]=_n(this,e[1]),e))},every(e,t){return In(this,"every",e,t,void 0,arguments)},filter(e,t){return In(this,"filter",e,t,n=>n.map(s=>_n(this,s)),arguments)},find(e,t){return In(this,"find",e,t,n=>_n(this,n),arguments)},findIndex(e,t){return In(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return In(this,"findLast",e,t,n=>_n(this,n),arguments)},findLastIndex(e,t){return In(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return In(this,"forEach",e,t,void 0,arguments)},includes(...e){return ra(this,"includes",e)},indexOf(...e){return ra(this,"indexOf",e)},join(e){return qr(this).join(e)},lastIndexOf(...e){return ra(this,"lastIndexOf",e)},map(e,t){return In(this,"map",e,t,void 0,arguments)},pop(){return ps(this,"pop")},push(...e){return ps(this,"push",e)},reduce(e,...t){return Zl(this,"reduce",e,t)},reduceRight(e,...t){return Zl(this,"reduceRight",e,t)},shift(){return ps(this,"shift")},some(e,t){return In(this,"some",e,t,void 0,arguments)},splice(...e){return ps(this,"splice",e)},toReversed(){return qr(this).toReversed()},toSorted(e){return qr(this).toSorted(e)},toSpliced(...e){return qr(this).toSpliced(...e)},unshift(...e){return ps(this,"unshift",e)},values(){return na(this,"values",e=>_n(this,e))}};function na(e,t,n){const s=li(e),o=s[t],a=o.call(s);if(s!==e&&!ln(e)){if(a[Symbol.toStringTag]==="Array Iterator"){const u=Object.create(Object.getPrototypeOf(a));return u.next=()=>Ql(a.next(),n),o!==uc[t]&&Object.defineProperties(u,{return:{get(){const f=a.return;return typeof f=="function"?f.bind(a):f}},throw:{get(){const f=a.throw;return typeof f=="function"?f.bind(a):f}}}),u}a._next=a.next,a.next=()=>Ql(a._next(),n)}return a}function Ql(e,t){return e.done||(e.value=t(e.value)),e}const uc=Array.prototype;function In(e,t,n,s,o,a){const u=li(e),f=u!==e&&!ln(e),h=u[t];if(h!==uc[t]){const w=h.apply(e,a);return f?un(w):w}let y=n;u!==e&&(f?y=function(w,C){return n.call(this,_n(e,w),C,e)}:n.length>2&&(y=function(w,C){return n.call(this,w,C,e)}));const m=h.call(u,y,s);return f&&o?o(m):m}function Zl(e,t,n,s){const o=li(e),a=o!==e&&!ln(e);let u=n,f=!1;o!==e&&(a?(f=s.length===0,u=function(y,m,w){return f&&(f=!1,y=_n(e,y)),n.call(this,y,_n(e,m),w,e)}):n.length>3&&(u=function(y,m,w){return n.call(this,y,m,w,e)}));const h=o[t](u,...s);return f?_n(e,h):h}function ra(e,t,n){const s=ot(e);Kt(s,"iterate",Ts);const o=s[t](...n);return(o===-1||o===!1)&&Xa(n[0])?(n[0]=ot(n[0]),s[t](...n)):o}function ps(e,t,n=[]){An(),qa();const s=ot(e)[t].apply(e,n);return Ha(),Pn(),s}const Sf=Na("__proto__,__v_isRef,__isVue"),cc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter($n));function Ef(e){$n(e)||(e=String(e));const t=ot(this);return Kt(t,"has",e),t.hasOwnProperty(e)}class dc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return a;if(n==="__v_raw")return s===(o?a?Rf:vc:a?hc:pc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const u=Ke(t);if(!o){let h;if(u&&(h=Cf[n]))return h;if(n==="hasOwnProperty")return Ef}const f=Reflect.get(t,n,Nt(t)?t:s);if(($n(n)?cc.has(n):Sf(n))||(o||Kt(t,"get",n),a))return f;if(Nt(f)){const h=u&&Ba(n)?f:f.value;return o&<(h)?_a(h):h}return lt(f)?o?_a(f):Ya(f):f}}class fc extends dc{constructor(t=!1){super(!1,t)}set(t,n,s,o){let a=t[n];const u=Ke(t)&&Ba(n);if(!this._isShallow){const y=Tn(a);if(!ln(s)&&!Tn(s)&&(a=ot(a),s=ot(s)),!u&&Nt(a)&&!Nt(s))return y||(a.value=s),!0}const f=u?Number(n)<t.length:it(t,n),h=Reflect.set(t,n,s,Nt(t)?t:o);return t===ot(o)&&h&&(f?Cn(s,a)&&Rn(t,"set",n,s):Rn(t,"add",n,s)),h}deleteProperty(t,n){const s=it(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Rn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!$n(n)||!cc.has(n))&&Kt(t,"has",n),s}ownKeys(t){return Kt(t,"iterate",Ke(t)?"length":Pr),Reflect.ownKeys(t)}}class $f extends dc{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Af=new fc,Pf=new $f,Tf=new fc(!0);const wa=e=>e,ko=e=>Reflect.getPrototypeOf(e);function Of(e,t,n){return function(...s){const o=this.__v_raw,a=ot(o),u=sr(a),f=e==="entries"||e===Symbol.iterator&&u,h=e==="keys"&&u,y=o[e](...s),m=n?wa:t?ar:un;return!t&&Kt(a,"iterate",h?ba:Pr),Et(Object.create(y),{next(){const{value:w,done:C}=y.next();return C?{value:w,done:C}:{value:f?[m(w[0]),m(w[1])]:m(w),done:C}}})}}function xo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Mf(e,t){const n={get(o){const a=this.__v_raw,u=ot(a),f=ot(o);e||(Cn(o,f)&&Kt(u,"get",o),Kt(u,"get",f));const{has:h}=ko(u),y=t?wa:e?ar:un;if(h.call(u,o))return y(a.get(o));if(h.call(u,f))return y(a.get(f));a!==u&&a.get(o)},get size(){const o=this.__v_raw;return!e&&Kt(ot(o),"iterate",Pr),o.size},has(o){const a=this.__v_raw,u=ot(a),f=ot(o);return e||(Cn(o,f)&&Kt(u,"has",o),Kt(u,"has",f)),o===f?a.has(o):a.has(o)||a.has(f)},forEach(o,a){const u=this,f=u.__v_raw,h=ot(f),y=t?wa:e?ar:un;return!e&&Kt(h,"iterate",Pr),f.forEach((m,w)=>o.call(a,y(m),y(w),u))}};return Et(n,e?{add:xo("add"),set:xo("set"),delete:xo("delete"),clear:xo("clear")}:{add(o){const a=ot(this),u=ko(a),f=ot(o),h=!t&&!ln(o)&&!Tn(o)?f:o;return u.has.call(a,h)||Cn(o,h)&&u.has.call(a,o)||Cn(f,h)&&u.has.call(a,f)||(a.add(h),Rn(a,"add",h,h)),this},set(o,a){!t&&!ln(a)&&!Tn(a)&&(a=ot(a));const u=ot(this),{has:f,get:h}=ko(u);let y=f.call(u,o);y||(o=ot(o),y=f.call(u,o));const m=h.call(u,o);return u.set(o,a),y?Cn(a,m)&&Rn(u,"set",o,a):Rn(u,"add",o,a),this},delete(o){const a=ot(this),{has:u,get:f}=ko(a);let h=u.call(a,o);h||(o=ot(o),h=u.call(a,o)),f&&f.call(a,o);const y=a.delete(o);return h&&Rn(a,"delete",o,void 0),y},clear(){const o=ot(this),a=o.size!==0,u=o.clear();return a&&Rn(o,"clear",void 0,void 0),u}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Of(o,e,t)}),n}function Ga(e,t){const n=Mf(e,t);return(s,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?s:Reflect.get(it(n,o)&&o in s?n:s,o,a)}const If={get:Ga(!1,!1)},jf={get:Ga(!1,!0)},Df={get:Ga(!0,!1)};const pc=new WeakMap,hc=new WeakMap,vc=new WeakMap,Rf=new WeakMap;function Lf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ya(e){return Tn(e)?e:Ja(e,!1,Af,If,pc)}function Kf(e){return Ja(e,!1,Tf,jf,hc)}function _a(e){return Ja(e,!0,Pf,Df,vc)}function Ja(e,t,n,s,o){if(!lt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const a=o.get(e);if(a)return a;const u=Lf(lf(e));if(u===0)return e;const f=new Proxy(e,u===2?s:n);return o.set(e,f),f}function ir(e){return Tn(e)?ir(e.__v_raw):!!(e&&e.__v_isReactive)}function Tn(e){return!!(e&&e.__v_isReadonly)}function ln(e){return!!(e&&e.__v_isShallow)}function Xa(e){return e?!!e.__v_raw:!1}function ot(e){const t=e&&e.__v_raw;return t?ot(t):e}function Ff(e){return!it(e,"__v_skip")&&Object.isExtensible(e)&&Xu(e,"__v_skip",!0),e}const un=e=>lt(e)?Ya(e):e,ar=e=>lt(e)?_a(e):e;function Nt(e){return e?e.__v_isRef===!0:!1}function N(e){return Nf(e,!1)}function Nf(e,t){return Nt(e)?e:new Vf(e,t)}class Vf{constructor(t,n){this.dep=new za,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ot(t),this._value=n?t:un(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||ln(t)||Tn(t);t=s?t:ot(t),Cn(t,n)&&(this._rawValue=t,this._value=s?t:un(t),this.dep.trigger())}}function Qt(e){return Nt(e)?e.value:e}const Bf={get:(e,t,n)=>t==="__v_raw"?e:Qt(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Nt(o)&&!Nt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function mc(e){return ir(e)?e:new Proxy(e,Bf)}class Uf{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new za(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ps-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ht!==this)return rc(this,!0),!0}get value(){const t=this.dep.track();return ic(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function qf(e,t,n=!1){let s,o;return Ge(e)?s=e:(s=e.get,o=e.set),new Uf(s,o,n)}const Co={},Lo=new WeakMap;let Sr;function Hf(e,t=!1,n=Sr){if(n){let s=Lo.get(n);s||Lo.set(n,s=[]),s.push(e)}}function Wf(e,t,n=dt){const{immediate:s,deep:o,once:a,scheduler:u,augmentJob:f,call:h}=n,y=X=>o?X:ln(X)||o===!1||o===0?Ln(X,1):Ln(X);let m,w,C,S,M=!1,B=!1;if(Nt(e)?(w=()=>e.value,M=ln(e)):ir(e)?(w=()=>y(e),M=!0):Ke(e)?(B=!0,M=e.some(X=>ir(X)||ln(X)),w=()=>e.map(X=>{if(Nt(X))return X.value;if(ir(X))return y(X);if(Ge(X))return h?h(X,2):X()})):Ge(e)?t?w=h?()=>h(e,2):e:w=()=>{if(C){An();try{C()}finally{Pn()}}const X=Sr;Sr=m;try{return h?h(e,3,[S]):e(S)}finally{Sr=X}}:w=En,t&&o){const X=w,de=o===!0?1/0:o;w=()=>Ln(X(),de)}const oe=_f(),ae=()=>{m.stop(),oe&&oe.active&&Va(oe.effects,m)};if(a&&t){const X=t;t=(...de)=>{try{return X(...de)}finally{ae()}}}let T=B?new Array(e.length).fill(Co):Co;const E=X=>{if(!(!(m.flags&1)||!m.dirty&&!X))if(t){const de=m.run();if(X||o||M||(B?de.some((ie,te)=>Cn(ie,T[te])):Cn(de,T))){const ie=Sr;An();try{C&&C(),Sr=m;const te=[de,T===Co?void 0:B&&T[0]===Co?[]:T,S];T=de,h?h(t,3,te):t(...te)}finally{Sr=ie,Pn()}}}else m.run()};return f&&f(E),m=new tc(w),m.scheduler=u?()=>u(E,!1):E,S=X=>Hf(X,!1,m),C=m.onStop=()=>{const X=Lo.get(m);if(X){if(h)h(X,4);else for(const de of X)de();Lo.delete(m)}},t?s?E(!0):T=m.run():u?u(E.bind(null,!0),!0):m.run(),ae.pause=m.pause.bind(m),ae.resume=m.resume.bind(m),ae.stop=ae,ae}function Ln(e,t=1/0,n){if(t<=0||!lt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Nt(e))Ln(e.value,t,n);else if(Ke(e))for(let s=0;s<e.length;s++)Ln(e[s],t,n);else if(Bn(e)||sr(e))e.forEach(s=>{Ln(s,t,n)});else if(Yu(e)){for(const s in e)Ln(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ln(e[s],t,n)}return e}/**
|
||
* @vue/runtime-core v3.5.44
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function Us(e,t,n,s){try{return s?e(...s):e()}catch(o){ui(o,t,n)}}function cn(e,t,n,s){if(Ge(e)){const o=Us(e,t,n,s);return o&&zu(o)&&o.catch(a=>{ui(a,t,n)}),o}if(Ke(e)){const o=[];for(let a=0;a<e.length;a++)o.push(cn(e[a],t,n,s));return o}}function ui(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:u}=t&&t.appContext.config||dt;if(t){let f=t.parent;const h=t.proxy,y=`https://vuejs.org/error-reference/#runtime-${n}`;for(;f;){const m=f.ec;if(m){for(let w=0;w<m.length;w++)if(m[w](e,h,y)===!1)return}f=f.parent}if(a){An(),Us(a,null,10,[e,h,y]),Pn();return}}zf(e,n,o,s,u)}function zf(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Wt=[];let pn=-1;const kn=[];let tr=null,Hr=0;const yc=Promise.resolve();let Ko=null;function ts(e){const t=Ko||yc;return e?t.then(this?e.bind(this):e):t}function Gf(e){let t=pn+1,n=Wt.length;for(;t<n;){const s=t+n>>>1,o=Wt[s],a=Os(o);a<e||a===e&&o.flags&2?t=s+1:n=s}return t}function Qa(e){if(!(e.flags&1)){const t=Os(e),n=Wt[Wt.length-1];!n||!(e.flags&2)&&t>=Os(n)?Wt.push(e):Wt.splice(Gf(t),0,e),e.flags|=1,gc()}}function gc(){Ko||(Ko=yc.then(_c))}function Yf(e){if(!Ke(e))tr&&e.id===-1?tr.splice(Hr+1,0,e):e.flags&1||(kn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)kn.push(e[t]);gc()}function bc(e,t,n,s=pn+1){for(;s<Wt.length;s++){const o=Wt[s];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;Wt.splice(s,1),s=e?s-1:pn,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function wc(e,t,n=0){if(kn.length){let s=kn,o=0;if(t){s=[];for(let u=0;u<kn.length;u++){const f=kn[u];(f.i!==void 0?!f.i||f.i.uid<n:t.has(f))?kn[o++]=f:s.push(f)}}const a=[...new Set(s)].sort((u,f)=>Os(u)-Os(f));if(kn.length=o,tr){for(let u=0;u<a.length;u++)tr.push(a[u]);return}for(tr=a,Hr=0;Hr<tr.length;Hr++){const u=tr[Hr];u.flags&4&&(u.flags&=-2),u.flags&8||u(),u.flags&=-2}tr=null,Hr=0}}let sa=!1;function Jf(e,t){if(sa){e();return}const n=t===void 0?void 0:new Set(kn);e(),sa=!0;try{bc(void 0,t),wc(void 0,n,t)}finally{sa=!1}}const Os=e=>e.id==null?e.flags&2?-1:1/0:e.id;function _c(e){try{for(pn=0;pn<Wt.length;pn++){const t=Wt[pn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Us(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;pn<Wt.length;pn++){const t=Wt[pn];t&&(t.flags&=-2)}pn=-1,Wt.length=0,wc(),Ko=null,(Wt.length||kn.length)&&_c()}}let an=null,kc=null;function Fo(e){const t=an;return an=e,kc=e&&e.type.__scopeId||null,t}function fr(e,t=an,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Uo(-1);const a=Fo(t),u=Tr.length;let f;try{f=e(...o)}finally{for(let h=Tr.length;h>u;h--)Jc();Fo(a),s._d&&Uo(1)}return f};return s._n=!0,s._c=!0,s._d=!0,s}function $e(e,t){if(an===null)return e;const n=vi(an),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,u,f,h=dt]=t[o];a&&(Ge(a)&&(a={mounted:a,updated:a}),a.deep&&Ln(u),s.push({dir:a,instance:n,value:u,oldValue:void 0,arg:f,modifiers:h}))}return e}function kr(e,t,n,s){const o=e.dirs,a=t&&t.dirs;for(let u=0;u<o.length;u++){const f=o[u];a&&(f.oldValue=a[u].value);let h=f.dir[s];h&&(An(),cn(h,n,8,[e.el,f,e,t]),Pn())}}function Xf(e,t){if(zt){let n=zt.provides;const s=zt.parent&&zt.parent.provides;s===n&&(n=zt.provides=Object.create(s)),n[e]=t}}function To(e,t,n=!1){const s=rl();if(s||zr){let o=zr?zr._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Ge(t)?t.call(s&&s.proxy):t}}const Qf=Symbol.for("v-scx"),Zf=()=>To(Qf);function mt(e,t,n){return xc(e,t,n)}function xc(e,t,n=dt){const{immediate:s,deep:o,flush:a,once:u}=n,f=Et({},n),h=t&&s||!t&&a!=="post";let y;if(Ls){if(a==="sync"){const S=Zf();y=S.__watcherHandles||(S.__watcherHandles=[])}else if(!h){const S=()=>{};return S.stop=En,S.resume=En,S.pause=En,S}}const m=zt;f.call=(S,M,B)=>cn(S,m,M,B);let w=!1;a==="post"?f.scheduler=S=>{S.i=m,Ht(S,m&&m.suspense)}:a!=="sync"&&(w=!0,f.scheduler=(S,M)=>{M?S():Qa(S)}),f.augmentJob=S=>{t&&(S.flags|=4),w&&(S.flags|=2,m&&(S.id=m.uid,S.i=m))};const C=Wf(e,t,f);return Ls&&(y?y.push(C):h&&C()),C}function ep(e,t,n){const s=this.proxy,o=wt(e)?e.includes(".")?Cc(s,e):()=>s[e]:e.bind(s,s);let a;Ge(t)?a=t:(a=t.handler,n=t);const u=Hs(this),f=xc(o,a.bind(s),n);return u(),f}function Cc(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Zn=new WeakMap,Sc=Symbol("_vte"),ci=e=>e.__isTeleport,Er=e=>e&&(e.disabled||e.disabled===""),tp=e=>e&&(e.defer||e.defer===""),eu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,tu=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ka=(e,t)=>{const n=e&&e.to;return wt(n)?t?t(n):null:n},np={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,a,u,f,h,y){const{mc:m,pc:w,pbc:C,o:{insert:S,querySelector:M,createText:B,createComment:oe,parentNode:ae}}=y,T=Er(t.props);let{dynamicChildren:E}=t;const X=(te,O,j)=>{te.shapeFlag&16&&m(te.children,O,j,o,a,u,f,h)},de=(te=t)=>{const O=Er(te.props),j=te.target=ka(te.props,M),ce=xa(j,te,B,S);j&&(u!=="svg"&&eu(j)?u="svg":u!=="mathml"&&tu(j)&&(u="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(j),O||(X(te,j,ce),ms(te,!1)))},ie=te=>{const O=()=>{if(Zn.get(te)===O){if(Zn.delete(te),Er(te.props)){const j=ae(te.el)||n;X(te,j,te.anchor),ms(te,!0)}de(te)}};Zn.set(te,O),Ht(O,a)};if(e==null){const te=t.el=B(""),O=t.anchor=B("");if(S(te,n,s),S(O,n,s),tp(t.props)||a&&a.pendingBranch){ie(t);return}T&&(X(t,n,O),ms(t,!0)),de()}else{t.el=e.el;const te=t.anchor=e.anchor,O=Zn.get(e);if(O){O.flags|=8,Zn.delete(e),ie(t);return}t.targetStart=e.targetStart;const j=t.target=e.target,ce=t.targetAnchor=e.targetAnchor,ke=Er(e.props),J=ke?n:j,xe=ke?te:ce;if(u==="svg"||eu(j)?u="svg":(u==="mathml"||tu(j))&&(u="mathml"),E?(C(e.dynamicChildren,E,J,o,a,u,f),nl(e,t,!0)):h||w(e,t,J,xe,o,a,u,f,!1),T)ke?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):So(t,n,te,y,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Ue=ka(t.props,M);Ue&&(t.target=Ue,So(t,Ue,null,y,0))}else ke&&So(t,j,ce,y,1);ms(t,T)}},remove(e,t,n,{um:s,o:{remove:o}},a){const{shapeFlag:u,children:f,anchor:h,targetStart:y,targetAnchor:m,target:w,props:C}=e,S=Er(C),M=a||!S,B=Zn.get(e);if(B&&(B.flags|=8,Zn.delete(e)),w&&(o(y),o(m)),a&&o(h),!B&&(S||w)&&u&16)for(let oe=0;oe<f.length;oe++){const ae=f[oe];s(ae,t,n,M,!!ae.dynamicChildren)}},move:So,hydrate:rp};function So(e,t,n,{o:{insert:s},m:o},a=2){a===0&&(e.targetStart&&s(e.targetStart,t,n),s(e.targetAnchor,t,n),n=e.targetAnchor);const{el:u,anchor:f,shapeFlag:h,children:y,props:m}=e,w=a===2;if(w&&s(u,t,n),!Zn.has(e)&&(!w||Er(m))&&h&16)for(let C=0;C<y.length;C++)o(y[C],t,n,2);w&&s(f,t,n)}function rp(e,t,n,s,o,a,{o:{nextSibling:u,parentNode:f,querySelector:h,insert:y,createText:m}},w){function C(oe,ae){let T=ae;for(;T;){if(T&&T.nodeType===8){if(T.data==="teleport start anchor")t.targetStart=T;else if(T.data==="teleport anchor"){t.targetAnchor=T,oe._lpa=t.targetAnchor&&u(t.targetAnchor);break}}T=u(T)}}function S(oe,ae){ae.anchor=w(u(oe),ae,f(oe),n,s,o,a)}const M=t.target=ka(t.props,h),B=Er(t.props);if(M){const oe=M._lpa||M.firstChild;t.shapeFlag&16&&(B?(S(e,t),C(M,oe),t.targetAnchor||xa(M,t,m,y,f(e)===M?e:null)):(t.anchor=u(e),C(M,oe),t.targetAnchor||xa(M,t,m,y),w(oe&&u(oe),t,M,n,s,o,a))),ms(t,B)}else B&&t.shapeFlag&16&&(S(e,t),t.targetStart=e,t.targetAnchor=u(e));return t.anchor&&u(t.anchor)}const qs=np;function ms(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function xa(e,t,n,s,o=null){const a=t.targetStart=n(""),u=t.targetAnchor=n("");return a[Sc]=u,e&&(s(a,e,o),s(u,e,o)),u}const on=Symbol("_leaveCb"),hs=Symbol("_enterCb");function Ec(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return dn(()=>{e.isMounted=!0}),Ic(()=>{e.isUnmounting=!0}),e}const sn=[Function,Array],$c={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:sn,onEnter:sn,onAfterEnter:sn,onEnterCancelled:sn,onBeforeLeave:sn,onLeave:sn,onAfterLeave:sn,onLeaveCancelled:sn,onBeforeAppear:sn,onAppear:sn,onAfterAppear:sn,onAppearCancelled:sn},sp={name:"BaseTransition",props:$c,setup(e,{slots:t}){const n=rl(),s=Ec();return()=>{const o=t.default&&Za(t.default(),!0),a=o&&o.length?Ac(o):n.subTree?Ee():void 0;if(!a)return;const u=ot(e),{mode:f}=u;if(s.isLeaving)return oa(a);const h=No(a);if(!h)return oa(a);let y=Ms(h,u,s,n,w=>y=w);h.type!==Ft&&lr(h,y);let m=n.subTree&&No(n.subTree);if(m&&m.type!==Ft&&!$r(m,h)&&Is(n.subTree)){let w=Ms(m,u,s,n);if(lr(m,w),f==="out-in"&&h.type!==Ft)return s.isLeaving=!0,w.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete w.afterLeave,m=void 0},oa(a);f==="in-out"&&h.type!==Ft?w.delayLeave=(C,S,M)=>{const B=Pc(s,m);B[String(m.key)]=m,C[on]=()=>{S(),C[on]=void 0,delete y.delayedLeave,m=void 0},y.delayedLeave=()=>{M(),delete y.delayedLeave,m=void 0}}:m=void 0}else m&&(m=void 0);return a}}};function Ac(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ft){t=n;break}}return t}const op=sp;function Pc(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Ms(e,t,n,s,o){const{appear:a,mode:u,persisted:f=!1,onBeforeEnter:h,onEnter:y,onAfterEnter:m,onEnterCancelled:w,onBeforeLeave:C,onLeave:S,onAfterLeave:M,onLeaveCancelled:B,onBeforeAppear:oe,onAppear:ae,onAfterAppear:T,onAppearCancelled:E}=t,X=String(e.key),de=Pc(n,e),ie=(j,ce)=>{j&&cn(j,s,9,ce)},te=(j,ce)=>{const ke=ce[1];ie(j,ce),Ke(j)?j.every(J=>J.length<=1)&&ke():j.length<=1&&ke()},O={mode:u,persisted:f,beforeEnter(j){let ce=h;if(!n.isMounted)if(a)ce=oe||h;else return;j[on]&&j[on](!0);const ke=de[X];if(ke&&$r(e,ke)){let J=ke.el[on];if(!J){const xe=Is(ke);J=xe&&xe.el[on]}J&&J()}ie(ce,[j])},enter(j){if(de[X]===e)return;let ce=y,ke=m,J=w;if(!n.isMounted)if(a)ce=ae||y,ke=T||m,J=E||w;else return;let xe=!1;j[hs]=rt=>{xe||(xe=!0,rt?ie(J,[j]):ie(ke,[j]),O.delayedLeave&&O.delayedLeave(),j[hs]=void 0)};const Ue=j[hs].bind(null,!1);ce?te(ce,[j,Ue]):Ue()},leave(j,ce){const ke=String(e.key);if(j[hs]&&j[hs](!0),n.isUnmounting)return ce();ie(C,[j]);let J=!1;j[on]=Ue=>{J||(J=!0,ce(),Ue?ie(B,[j]):ie(M,[j]),j[on]=void 0,de[ke]===e&&delete de[ke])};const xe=j[on].bind(null,!1);de[ke]=e,S?te(S,[j,xe]):xe()},clone(j){const ce=Ms(j,t,n,s,o);return o&&o(ce),ce}};return O}function oa(e){if(di(e))return e=ur(e),e.children=null,e}function No(e){if(!di(e))return ci(e.type)&&e.children?Ac(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ge(n.default))return n.default()}}function lr(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;lr(ci(n.type)&&No(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===Le&&Ke(e.children)){const n=Kc(e.children,!1);n&&lr(n,t)}}function Za(e,t=!1,n){let s=[],o=0;for(let a=0;a<e.length;a++){let u=e[a];const f=n==null?u.key:String(n)+String(u.key!=null?u.key:a);u.type===Le?(u.patchFlag&128&&o++,s=s.concat(Za(u.children,t,f))):(t||u.type!==Ft)&&s.push(f!=null?ur(u,{key:f}):u)}if(o>1)for(let a=0;a<s.length;a++)s[a].patchFlag=-2;return s}function Is(e){if(e.component)return Is(e.component.subTree);if(e.type===Le){const t=Ke(e.children)&&Kc(e.children,!1);return t?Is(t):void 0}if(e.type!==Ft)return e}function Vt(e,t){return Ge(e)?Et({name:e.name},t,{setup:e}):e}function Tc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function nu(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vo=new WeakMap;function ks(e,t,n,s,o=!1){if(Ke(e)){e.forEach((B,oe)=>ks(B,t&&(Ke(t)?t[oe]:t),n,s,o));return}if(xs(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ks(e,t,n,s.component.subTree);return}const a=s.shapeFlag&4?vi(s.component):s.el,u=o?null:a,{i:f,r:h}=e,y=t&&t.r,m=f.refs===dt?f.refs={}:f.refs,w=f.setupState,C=ot(w),S=w===dt?Wu:B=>nu(m,B)?!1:it(C,B),M=(B,oe)=>!(oe&&nu(m,oe));if(y!=null&&y!==h){if(ru(t),wt(y))m[y]=null,S(y)&&(w[y]=null);else if(Nt(y)){const B=t;M(y,B.k)&&(y.value=null),B.k&&(m[B.k]=null)}}if(Ge(h))Us(h,f,12,[u,m]);else{const B=wt(h),oe=Nt(h);if(B||oe){const ae=()=>{if(e.f){const T=B?S(h)?w[h]:m[h]:M()||!e.k?h.value:m[e.k];if(o)Ke(T)&&Va(T,a);else if(Ke(T))T.includes(a)||T.push(a);else if(B)m[h]=[a],S(h)&&(w[h]=m[h]);else{const E=[a];M(h,e.k)&&(h.value=E),e.k&&(m[e.k]=E)}}else B?(m[h]=u,S(h)&&(w[h]=u)):oe&&(M(h,e.k)&&(h.value=u),e.k&&(m[e.k]=u))};if(u){const T=()=>{ae(),Vo.delete(e)};T.id=-1,Vo.set(e,T),Ht(T,n)}else ru(e),ae()}}}function ru(e){const t=Vo.get(e);t&&(t.flags|=8,Vo.delete(e))}ai().requestIdleCallback;ai().cancelIdleCallback;const xs=e=>!!e.type.__asyncLoader,di=e=>e.type.__isKeepAlive;function ip(e,t){Oc(e,"a",t)}function ap(e,t){Oc(e,"da",t)}function Oc(e,t,n=zt){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(fi(t,s,n),n){let o=n.parent;for(;o&&o.parent;)di(o.parent.vnode)&&lp(s,t,n,o),o=o.parent}}function lp(e,t,n,s){const o=fi(t,e,s,!0);pr(()=>{Va(s[t],o)},n)}function fi(e,t,n=zt,s=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...u)=>{An();const f=Hs(n),h=cn(t,n,e,u);return f(),Pn(),h});return s?o.unshift(a):o.push(a),a}}const qn=e=>(t,n=zt)=>{(!Ls||e==="sp")&&fi(e,(...s)=>t(...s),n)},up=qn("bm"),dn=qn("m"),cp=qn("bu"),Mc=qn("u"),Ic=qn("bum"),pr=qn("um"),dp=qn("sp"),fp=qn("rtg"),pp=qn("rtc");function hp(e,t=zt){fi("ec",e,t)}const vp=Symbol.for("v-ndc");function ct(e,t,n,s){let o;const a=n,u=Ke(e);if(u||wt(e)){const f=u&&ir(e);let h=!1,y=!1;f&&(h=!ln(e),y=Tn(e),e=li(e)),o=new Array(e.length);for(let m=0,w=e.length;m<w;m++)o[m]=t(h?y?ar(un(e[m])):un(e[m]):e[m],m,void 0,a)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)o=[];else{o=new Array(e);for(let f=0;f<e;f++)o[f]=t(f+1,f,void 0,a)}else if(lt(e))if(e[Symbol.iterator])o=Array.from(e,(f,h)=>t(f,h,void 0,a));else{const f=Object.keys(e);o=new Array(f.length);for(let h=0,y=f.length;h<y;h++){const m=f[h];o[h]=t(e[m],m,h,a)}}else o=[];return o}const Ca=e=>e?ed(e)?vi(e):Ca(e.parent):null,Cs=Et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ca(e.parent),$root:e=>Ca(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Dc(e),$forceUpdate:e=>e.f||(e.f=()=>{Qa(e.update)}),$nextTick:e=>e.n||(e.n=ts.bind(e.proxy)),$watch:e=>ep.bind(e)}),ia=(e,t)=>e!==dt&&!e.__isScriptSetup&&it(e,t),mp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:u,type:f,appContext:h}=e;if(t[0]!=="$"){const C=u[t];if(C!==void 0)switch(C){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(ia(s,t))return u[t]=1,s[t];if(o!==dt&&it(o,t))return u[t]=2,o[t];if(it(a,t))return u[t]=3,a[t];if(n!==dt&&it(n,t))return u[t]=4,n[t];Sa&&(u[t]=0)}}const y=Cs[t];let m,w;if(y)return t==="$attrs"&&Kt(e.attrs,"get",""),y(e);if((m=f.__cssModules)&&(m=m[t]))return m;if(n!==dt&&it(n,t))return u[t]=4,n[t];if(w=h.config.globalProperties,it(w,t))return w[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:a}=e;return ia(o,t)?(o[t]=n,!0):s!==dt&&it(s,t)?(s[t]=n,!0):it(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:a,type:u}},f){let h;return!!(n[f]||e!==dt&&f[0]!=="$"&&it(e,f)||ia(t,f)||it(a,f)||it(s,f)||it(Cs,f)||it(o.config.globalProperties,f)||(h=u.__cssModules)&&h[f])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:it(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function su(e){return Ke(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Sa=!0;function yp(e){const t=Dc(e),n=e.proxy,s=e.ctx;Sa=!1,t.beforeCreate&&ou(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:u,watch:f,provide:h,inject:y,created:m,beforeMount:w,mounted:C,beforeUpdate:S,updated:M,activated:B,deactivated:oe,beforeDestroy:ae,beforeUnmount:T,destroyed:E,unmounted:X,render:de,renderTracked:ie,renderTriggered:te,errorCaptured:O,serverPrefetch:j,expose:ce,inheritAttrs:ke,components:J,directives:xe,filters:Ue}=t;if(y&&gp(y,s,null),u)for(const Ye in u){const me=u[Ye];Ge(me)&&(s[Ye]=me.bind(n))}if(o){const Ye=o.call(n,n);lt(Ye)&&(e.data=Ya(Ye))}if(Sa=!0,a)for(const Ye in a){const me=a[Ye],Me=Ge(me)?me.bind(n,n):Ge(me.get)?me.get.bind(n,n):En,Fe=!Ge(me)&&Ge(me.set)?me.set.bind(n):En,De=at({get:Me,set:Fe});Object.defineProperty(s,Ye,{enumerable:!0,configurable:!0,get:()=>De.value,set:Ce=>De.value=Ce})}if(f)for(const Ye in f)jc(f[Ye],s,n,Ye);if(h){const Ye=Ge(h)?h.call(n):h;Reflect.ownKeys(Ye).forEach(me=>{Xf(me,Ye[me])})}m&&ou(m,e,"c");function We(Ye,me){Ke(me)?me.forEach(Me=>Ye(Me.bind(n))):me&&Ye(me.bind(n))}if(We(up,w),We(dn,C),We(cp,S),We(Mc,M),We(ip,B),We(ap,oe),We(hp,O),We(pp,ie),We(fp,te),We(Ic,T),We(pr,X),We(dp,j),Ke(ce))if(ce.length){const Ye=e.exposed||(e.exposed={});ce.forEach(me=>{Object.defineProperty(Ye,me,{get:()=>n[me],set:Me=>n[me]=Me,enumerable:!0})})}else e.exposed||(e.exposed={});de&&e.render===En&&(e.render=de),ke!=null&&(e.inheritAttrs=ke),J&&(e.components=J),xe&&(e.directives=xe),j&&Tc(e)}function gp(e,t,n=En){Ke(e)&&(e=Ea(e));for(const s in e){const o=e[s];let a;lt(o)?"default"in o?a=To(o.from||s,o.default,!0):a=To(o.from||s):a=To(o),Nt(a)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:u=>a.value=u}):t[s]=a}}function ou(e,t,n){cn(Ke(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function jc(e,t,n,s){let o=s.includes(".")?Cc(n,s):()=>n[s];if(wt(e)){const a=t[e];Ge(a)&&mt(o,a)}else if(Ge(e))mt(o,e.bind(n));else if(lt(e))if(Ke(e))e.forEach(a=>jc(a,t,n,s));else{const a=Ge(e.handler)?e.handler.bind(n):t[e.handler];Ge(a)&&mt(o,a,e)}}function Dc(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:u}}=e.appContext,f=a.get(t);let h;return f?h=f:!o.length&&!n&&!s?h=t:(h={},o.length&&o.forEach(y=>Bo(h,y,u,!0)),Bo(h,t,u)),lt(t)&&a.set(t,h),h}function Bo(e,t,n,s=!1){const{mixins:o,extends:a}=t;a&&Bo(e,a,n,!0),o&&o.forEach(u=>Bo(e,u,n,!0));for(const u in t)if(!(s&&u==="expose")){const f=bp[u]||n&&n[u];e[u]=f?f(e[u],t[u]):t[u]}return e}const bp={data:iu,props:au,emits:au,methods:ys,computed:ys,beforeCreate:qt,created:qt,beforeMount:qt,mounted:qt,beforeUpdate:qt,updated:qt,beforeDestroy:qt,beforeUnmount:qt,destroyed:qt,unmounted:qt,activated:qt,deactivated:qt,errorCaptured:qt,serverPrefetch:qt,components:ys,directives:ys,watch:_p,provide:iu,inject:wp};function iu(e,t){return t?e?function(){return Et(Ge(e)?e.call(this,this):e,Ge(t)?t.call(this,this):t)}:t:e}function wp(e,t){return ys(Ea(e),Ea(t))}function Ea(e){if(Ke(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function qt(e,t){return e?[...new Set([].concat(e,t))]:t}function ys(e,t){return e?Et(Object.create(null),e,t):t}function au(e,t){return e?Ke(e)&&Ke(t)?[...new Set([...e,...t])]:Et(Object.create(null),su(e),su(t??{})):t}function _p(e,t){if(!e)return t;if(!t)return e;const n=Et(Object.create(null),e);for(const s in t)n[s]=qt(e[s],t[s]);return n}function Rc(){return{app:null,config:{isNativeTag:Wu,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let kp=0;function xp(e,t){return function(s,o=null){Ge(s)||(s=Et({},s)),o!=null&&!lt(o)&&(o=null);const a=Rc(),u=new WeakSet,f=[];let h=!1;const y=a.app={_uid:kp++,_component:s,_props:o,_container:null,_context:a,_instance:null,version:th,get config(){return a.config},set config(m){},use(m,...w){return u.has(m)||(m&&Ge(m.install)?(u.add(m),m.install(y,...w)):Ge(m)&&(u.add(m),m(y,...w))),y},mixin(m){return a.mixins.includes(m)||a.mixins.push(m),y},component(m,w){return w?(a.components[m]=w,y):a.components[m]},directive(m,w){return w?(a.directives[m]=w,y):a.directives[m]},mount(m,w,C){if(!h){const S=y._ceVNode||Oe(s,o);return S.appContext=a,C===!0?C="svg":C===!1&&(C=void 0),e(S,m,C),h=!0,y._container=m,m.__vue_app__=y,vi(S.component)}},onUnmount(m){f.push(m)},unmount(){h&&(cn(f,y._instance,16),e(null,y._container),delete y._container.__vue_app__)},provide(m,w){return a.provides[m]=w,y},runWithContext(m){const w=zr;zr=y;try{return m()}finally{zr=w}}};return y}}let zr=null;const Cp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${hn(t)}Modifiers`]||e[`${dr(t)}Modifiers`];function Sp(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||dt;let o=n;const a=t.startsWith("update:"),u=a&&Cp(s,t.slice(7));u&&(u.trim&&(o=n.map(m=>wt(m)?m.trim():m)),u.number&&(o=o.map(ii)));let f,h=s[f=Zi(t)]||s[f=Zi(hn(t))];!h&&a&&(h=s[f=Zi(dr(t))]),h&&cn(h,e,6,o);const y=s[f+"Once"];if(y){if(!e.emitted)e.emitted={};else if(e.emitted[f])return;e.emitted[f]=!0,cn(y,e,6,o)}}const Ep=new WeakMap;function Lc(e,t,n=!1){const s=n?Ep:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const a=e.emits;let u={},f=!1;if(!Ge(e)){const h=y=>{const m=Lc(y,t,!0);m&&(f=!0,Et(u,m))};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}return!a&&!f?(lt(e)&&s.set(e,null),null):(Ke(a)?a.forEach(h=>u[h]=null):Et(u,a),lt(e)&&s.set(e,u),u)}function pi(e,t){return!e||!ri(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),it(e,t[0].toLowerCase()+t.slice(1))||it(e,dr(t))||it(e,t))}function lu(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[a],slots:u,attrs:f,emit:h,render:y,renderCache:m,props:w,data:C,setupState:S,ctx:M,inheritAttrs:B}=e,oe=Fo(e);let ae,T;try{if(n.shapeFlag&4){const X=o||s,de=X;ae=xn(y.call(de,X,m,w,S,C,M)),T=f}else{const X=t;ae=xn(X.length>1?X(w,{attrs:f,slots:u,emit:h}):X(w,null)),T=t.props?f:$p(f)}}catch(X){Tr.length=0,ui(X,e,1),ae=Oe(Ft)}let E=ae;if(T&&B!==!1){const X=Object.keys(T),{shapeFlag:de}=E;X.length&&de&7&&(a&&X.some(si)&&(T=Ap(T,a)),E=ur(E,T,!1,!0))}if(n.dirs&&(E=ur(E,null,!1,!0),E.dirs=E.dirs?E.dirs.concat(n.dirs):n.dirs),n.transition){const X=ci(E.type)&&No(E)||E;lr(X,n.transition)}return ae=E,Fo(oe),ae}function Kc(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Ds(o)){if(o.type!==Ft||o.children==="v-if"){if(n)return;n=o}}else return}return n}const $p=e=>{let t;for(const n in e)(n==="class"||n==="style"||ri(n))&&((t||(t={}))[n]=e[n]);return t},Ap=(e,t)=>{const n={};for(const s in e)(!si(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Pp(e,t,n){const{props:s,children:o,component:a}=e,{props:u,children:f,patchFlag:h}=t,y=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&h>=0){if(h&1024)return!0;if(h&16)return s?uu(s,u,y):!!u;if(h&8){const m=t.dynamicProps;for(let w=0;w<m.length;w++){const C=m[w];if(Fc(u,s,C)&&!pi(y,C))return!0}}}else return(o||f)&&(!f||!f.$stable)?!0:s===u?!1:s?u?uu(s,u,y):!0:!!u;return!1}function uu(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const a=s[o];if(!it(e,a)||Fc(t,e,a)&&!pi(n,a))return!0}return!1}function Fc(e,t,n){const s=e[n],o=t[n];return n==="style"&<(s)&<(o)?!Un(s,o):s!==o}function Tp({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Nc={},Vc=()=>Object.create(Nc),Bc=e=>Object.getPrototypeOf(e)===Nc;function Op(e,t,n,s=!1){const o={},a=Vc();e.propsDefaults=Object.create(null),Uc(e,t,o,a);for(const u in e.propsOptions[0])u in o||(o[u]=void 0);n?e.props=s?o:Kf(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function Mp(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:u}}=e,f=ot(o),[h]=e.propsOptions;let y=!1;if((s||u>0)&&!(u&16)){if(u&8){const m=e.vnode.dynamicProps;for(let w=0;w<m.length;w++){let C=m[w];if(pi(e.emitsOptions,C))continue;const S=t[C];if(h)if(it(a,C))S!==a[C]&&(a[C]=S,y=!0);else{const M=hn(C);o[M]=$a(h,f,M,S,e,!1)}else S!==a[C]&&(a[C]=S,y=!0)}}}else{Uc(e,t,o,a)&&(y=!0);let m;for(const w in f)(!t||!it(t,w)&&((m=dr(w))===w||!it(t,m)))&&(h?n&&(n[w]!==void 0||n[m]!==void 0)&&(o[w]=$a(h,f,w,void 0,e,!0)):delete o[w]);if(a!==f)for(const w in a)(!t||!it(t,w))&&(delete a[w],y=!0)}y&&Rn(e.attrs,"set","")}function Uc(e,t,n,s){const[o,a]=e.propsOptions;let u=!1,f;if(t)for(let h in t){if(bs(h))continue;const y=t[h];let m;o&&it(o,m=hn(h))?!a||!a.includes(m)?n[m]=y:(f||(f={}))[m]=y:pi(e.emitsOptions,h)||(!(h in s)||y!==s[h])&&(s[h]=y,u=!0)}if(a){const h=ot(n),y=f||dt;for(let m=0;m<a.length;m++){const w=a[m];n[w]=$a(o,h,w,y[w],e,!it(y,w))}}return u}function $a(e,t,n,s,o,a){const u=e[n];if(u!=null){const f=it(u,"default");if(f&&s===void 0){const h=u.default;if(u.type!==Function&&!u.skipFactory&&Ge(h)){const{propsDefaults:y}=o;if(n in y)s=y[n];else{const m=Hs(o);s=y[n]=h.call(null,t),m()}}else s=h;o.ce&&o.ce._setProp(n,s)}u[0]&&(a&&!f?s=!1:u[1]&&(s===""||s===dr(n))&&(s=!0))}return s}const Ip=new WeakMap;function qc(e,t,n=!1){const s=n?Ip:t.propsCache,o=s.get(e);if(o)return o;const a=e.props,u={},f=[];let h=!1;if(!Ge(e)){const m=w=>{h=!0;const[C,S]=qc(w,t,!0);Et(u,C),S&&f.push(...S)};!n&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}if(!a&&!h)return lt(e)&&s.set(e,Ar),Ar;if(Ke(a))for(let m=0;m<a.length;m++){const w=hn(a[m]);cu(w)&&(u[w]=dt)}else if(a)for(const m in a){const w=hn(m);if(cu(w)){const C=a[m],S=u[w]=Ke(C)||Ge(C)?{type:C}:Et({},C),M=S.type;let B=!1,oe=!0;if(Ke(M))for(let ae=0;ae<M.length;++ae){const T=M[ae],E=Ge(T)&&T.name;if(E==="Boolean"){B=!0;break}else E==="String"&&(oe=!1)}else B=Ge(M)&&M.name==="Boolean";S[0]=B,S[1]=oe,(B||it(S,"default"))&&f.push(w)}}const y=[u,f];return lt(e)&&s.set(e,y),y}function cu(e){return e[0]!=="$"&&!bs(e)}const el=e=>e==="_"||e==="_ctx"||e==="$stable",tl=e=>Ke(e)?e.map(xn):[xn(e)],jp=(e,t,n)=>{if(t._n)return t;const s=fr((...o)=>tl(t(...o)),n);return s._c=!1,s},Hc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(el(o))continue;const a=e[o];if(Ge(a))t[o]=jp(o,a,s);else if(a!=null){const u=tl(a);t[o]=()=>u}}},Wc=(e,t)=>{const n=tl(t);e.slots.default=()=>n},zc=(e,t,n)=>{for(const s in t)(n||!el(s))&&(e[s]=t[s])},Dp=(e,t,n)=>{const s=e.slots=Vc();if(e.vnode.shapeFlag&32){const o=t._;o?(zc(s,t,n),n&&Xu(s,"_",o,!0)):Hc(t,s)}else t&&Wc(e,t)},Rp=(e,t,n)=>{const{vnode:s,slots:o}=e;let a=!0,u=dt;if(s.shapeFlag&32){const f=t._;f?n&&f===1?a=!1:zc(o,t,n):(a=!t.$stable,Hc(t,o)),u=t}else t&&(Wc(e,t),u={default:1});if(a)for(const f in o)!el(f)&&u[f]==null&&delete o[f]},Ht=Vp;function Lp(e){return Kp(e)}function Kp(e,t){const n=ai();n.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:u,createText:f,createComment:h,setText:y,setElementText:m,parentNode:w,nextSibling:C,setScopeId:S=En,insertStaticContent:M}=e,B=(k,_,x,G=null,ne=null,ue=null,ge=void 0,ve=null,le=!!_.dynamicChildren)=>{if(k===_)return;k&&!$r(k,_)&&(G=ft(k),Ce(k,ne,ue,!0),k=null),_.patchFlag===-2&&(le=!1,_.dynamicChildren=null),_.dynamicChildren&&k&&k.dynamicChildren&&k.dynamicChildren.hasOnce&&(_.dynamicChildren===Ar&&(_.dynamicChildren=[]),_.dynamicChildren.hasOnce=!0);const{type:H,ref:W,shapeFlag:Y}=_;switch(H){case hi:oe(k,_,x,G);break;case Ft:ae(k,_,x,G);break;case Oo:k==null&&T(_,x,G,ge);break;case Le:J(k,_,x,G,ne,ue,ge,ve,le);break;default:Y&1?de(k,_,x,G,ne,ue,ge,ve,le):Y&6?xe(k,_,x,G,ne,ue,ge,ve,le):(Y&64||Y&128)&&H.process(k,_,x,G,ne,ue,ge,ve,le,Jt)}W!=null&&ne?ks(W,k&&k.ref,ue,_||k,!_):W==null&&k&&k.ref!=null&&ks(k.ref,null,ue,k,!0)},oe=(k,_,x,G)=>{if(k==null)s(_.el=f(_.children),x,G);else{const ne=_.el=k.el;_.children!==k.children&&y(ne,_.children)}},ae=(k,_,x,G)=>{k==null?s(_.el=h(_.children||""),x,G):_.el=k.el},T=(k,_,x,G)=>{[k.el,k.anchor]=M(k.children,_,x,G,k.el,k.anchor)},E=({el:k,anchor:_},x,G)=>{let ne;for(;k&&k!==_;)ne=C(k),s(k,x,G),k=ne;s(_,x,G)},X=({el:k,anchor:_})=>{let x;for(;k&&k!==_;)x=C(k),o(k),k=x;o(_)},de=(k,_,x,G,ne,ue,ge,ve,le)=>{if(_.type==="svg"?ge="svg":_.type==="math"&&(ge="mathml"),k==null)ie(_,x,G,ne,ue,ge,ve,le);else{const H=k.el&&k.el._isVueCE?k.el:null;try{H&&H._beginPatch(),j(k,_,ne,ue,ge,ve,le)}finally{H&&H._endPatch()}}},ie=(k,_,x,G,ne,ue,ge,ve)=>{let le,H;const{props:W,shapeFlag:Y,transition:Ae,dirs:Ne}=k;if(le=k.el=u(k.type,ue,W&&W.is,W),Y&8?m(le,k.children):Y&16&&O(k.children,le,null,G,ne,aa(k,ue),ge,ve),Ne&&kr(k,null,G,"created"),te(le,k,k.scopeId,ge,G),W){for(const Xe in W)Xe!=="value"&&!bs(Xe)&&a(le,Xe,null,W[Xe],ue,G);"value"in W&&a(le,"value",null,W.value,ue),(H=W.onVnodeBeforeMount)&&gn(H,G,k)}Ne&&kr(k,null,G,"beforeMount");const Qe=Fp(ne,Ae);Qe&&Ae.beforeEnter(le),s(le,_,x),((H=W&&W.onVnodeMounted)||Qe||Ne)&&Ht(()=>{try{H&&gn(H,G,k),Qe&&Ae.enter(le),Ne&&kr(k,null,G,"mounted")}finally{}},ne)},te=(k,_,x,G,ne)=>{if(x&&S(k,x),G)for(let ue=0;ue<G.length;ue++)S(k,G[ue]);if(ne){let ue=ne.subTree;if(_===ue||Yc(ue.type)&&(ue.ssContent===_||ue.ssFallback===_)){const ge=ne.vnode;te(k,ge,ge.scopeId,ge.slotScopeIds,ne.parent)}}},O=(k,_,x,G,ne,ue,ge,ve,le=0)=>{for(let H=le;H<k.length;H++){const W=k[H]=ve?Dn(k[H]):xn(k[H]);B(null,W,_,x,G,ne,ue,ge,ve)}},j=(k,_,x,G,ne,ue,ge)=>{const ve=_.el=k.el;let{patchFlag:le,dynamicChildren:H,dirs:W}=_;le|=k.patchFlag&16;const Y=k.props||dt,Ae=_.props||dt;let Ne;if(x&&xr(x,!1),(Ne=Ae.onVnodeBeforeUpdate)&&gn(Ne,x,_,k),W&&kr(_,k,x,"beforeUpdate"),x&&xr(x,!0),H&&(!k.dynamicChildren||k.dynamicChildren.length!==H.length)&&(le=0,ge=!1,H=null),(Y.innerHTML&&Ae.innerHTML==null||Y.textContent&&Ae.textContent==null)&&m(ve,""),H?ce(k.dynamicChildren,H,ve,x,G,aa(_,ne),ue):ge||me(k,_,ve,null,x,G,aa(_,ne),ue,!1),le>0){if(le&16)ke(ve,Y,Ae,x,ne);else if(le&2&&Y.class!==Ae.class&&a(ve,"class",null,Ae.class,ne),le&4&&a(ve,"style",Y.style,Ae.style,ne),le&8){const Qe=_.dynamicProps;for(let Xe=0;Xe<Qe.length;Xe++){const Ze=Qe[Xe],yt=Y[Ze],_t=Ae[Ze];(_t!==yt||Ze==="value")&&a(ve,Ze,yt,_t,ne,x)}}le&1&&k.children!==_.children&&m(ve,_.children)}else!ge&&H==null&&ke(ve,Y,Ae,x,ne);((Ne=Ae.onVnodeUpdated)||W)&&Ht(()=>{Ne&&gn(Ne,x,_,k),W&&kr(_,k,x,"updated")},G)},ce=(k,_,x,G,ne,ue,ge)=>{for(let ve=0;ve<_.length;ve++){const le=k[ve],H=_[ve],W=le.el||Aa(le),Y=W&&(le.type===Le||!$r(le,H)||le.shapeFlag&198)?w(W):x;B(le,H,Y,null,G,ne,ue,ge,!0)}},ke=(k,_,x,G,ne)=>{if(_!==x){if(_!==dt)for(const ue in _)!bs(ue)&&!(ue in x)&&a(k,ue,_[ue],null,ne,G);for(const ue in x){if(bs(ue))continue;const ge=x[ue],ve=_[ue];ge!==ve&&ue!=="value"&&a(k,ue,ve,ge,ne,G)}"value"in x&&a(k,"value",_.value,x.value,ne)}},J=(k,_,x,G,ne,ue,ge,ve,le)=>{const H=_.el=k?k.el:f(""),W=_.anchor=k?k.anchor:f("");let{patchFlag:Y,dynamicChildren:Ae,slotScopeIds:Ne}=_;Ne&&(ve=ve?ve.concat(Ne):Ne),k==null?(s(H,x,G),s(W,x,G),O(_.children||[],x,W,ne,ue,ge,ve,le)):Y>0&&Y&64&&Ae&&k.dynamicChildren&&k.dynamicChildren.length===Ae.length?(ce(k.dynamicChildren,Ae,x,ne,ue,ge,ve),(_.key!=null||ne&&_===ne.subTree)&&nl(k,_,!0)):me(k,_,x,W,ne,ue,ge,ve,le)},xe=(k,_,x,G,ne,ue,ge,ve,le)=>{_.slotScopeIds=ve,k==null?_.shapeFlag&512?ne.ctx.activate(_,x,G,ge,le):Ue(_,x,G,ne,ue,ge,le):rt(k,_,le)},Ue=(k,_,x,G,ne,ue,ge)=>{const ve=k.component=Gp(k,G,ne);if(di(k)&&(ve.ctx.renderer=Jt),Yp(ve,!1,ge),ve.asyncDep){if(ne&&ne.registerDep(ve,We,ge,ue),!k.el){const le=ve.subTree=Oe(Ft);ae(null,le,_,x),k.placeholder=le.el}}else We(ve,k,_,x,ne,ue,ge)},rt=(k,_,x)=>{const G=_.component=k.component;if(Pp(k,_,x))if(G.asyncDep&&!G.asyncResolved){_.el=k.el,_.placeholder=k.placeholder,Ye(G,_,x);return}else G.next=_,G.update();else _.el=k.el,_.placeholder=k.placeholder,G.vnode=_},We=(k,_,x,G,ne,ue,ge)=>{const ve=()=>{if(k.isMounted){let{next:Y,bu:Ae,u:Ne,parent:Qe,vnode:Xe}=k;{const Bt=Gc(k);if(Bt){Y&&(Y.el=Xe.el,Ye(k,Y,ge)),Bt.asyncDep.then(()=>{Ht(()=>{k.isUnmounted||H()},ne)});return}}let Ze=Y,yt;xr(k,!1),Y?(Y.el=Xe.el,Ye(k,Y,ge)):Y=Xe,Ae&&Po(Ae),(yt=Y.props&&Y.props.onVnodeBeforeUpdate)&&gn(yt,Qe,Y,Xe),xr(k,!0);const _t=lu(k),Xt=k.subTree;k.subTree=_t,B(Xt,_t,w(Xt.el),ft(Xt),k,ne,ue),Y.el=_t.el,Ze===null&&Tp(k,_t.el),Ne&&Ht(Ne,ne),(yt=Y.props&&Y.props.onVnodeUpdated)&&Ht(()=>gn(yt,Qe,Y,Xe),ne)}else{let Y;const{el:Ae,props:Ne}=_,{bm:Qe,m:Xe,parent:Ze,root:yt,type:_t}=k,Xt=xs(_);xr(k,!1),Qe&&Po(Qe),!Xt&&(Y=Ne&&Ne.onVnodeBeforeMount)&&gn(Y,Ze,_),xr(k,!0);{yt.ce&&yt.ce._hasShadowRoot()&&yt.ce._injectChildStyle(_t,k.parent?k.parent.type:void 0);const Bt=k.subTree=lu(k);B(null,Bt,x,G,k,ne,ue),_.el=Bt.el}if(Xe&&Ht(Xe,ne),!Xt&&(Y=Ne&&Ne.onVnodeMounted)){const Bt=_;Ht(()=>gn(Y,Ze,Bt),ne)}(_.shapeFlag&256||Ze&&xs(Ze.vnode)&&Ze.vnode.shapeFlag&256)&&k.a&&Ht(k.a,ne),k.isMounted=!0,_=x=G=null}};k.scope.on();const le=k.effect=new tc(ve);k.scope.off();const H=k.update=le.run.bind(le),W=k.job=le.runIfDirty.bind(le);W.i=k,W.id=k.uid,le.scheduler=()=>Qa(W),xr(k,!0),H()},Ye=(k,_,x)=>{_.component=k;const G=k.vnode.props;k.vnode=_,k.next=null,Mp(k,_.props,G,x),Rp(k,_.children,x),An(),bc(k),Pn()},me=(k,_,x,G,ne,ue,ge,ve,le=!1)=>{const H=k&&k.children,W=k?k.shapeFlag:0,Y=_.children,{patchFlag:Ae,shapeFlag:Ne}=_;if(Ae>0){if(Ae&128){Fe(H,Y,x,G,ne,ue,ge,ve,le);return}else if(Ae&256){Me(H,Y,x,G,ne,ue,ge,ve,le);return}}Ne&8?(W&16&&Ve(H,ne,ue),Y!==H&&m(x,Y)):W&16?Ne&16?Fe(H,Y,x,G,ne,ue,ge,ve,le):Ve(H,ne,ue,!0):(W&8&&m(x,""),Ne&16&&O(Y,x,G,ne,ue,ge,ve,le))},Me=(k,_,x,G,ne,ue,ge,ve,le)=>{k=k||Ar,_=_||Ar;const H=k.length,W=_.length,Y=Math.min(H,W);let Ae;for(Ae=0;Ae<Y;Ae++){const Ne=_[Ae]=le?Dn(_[Ae]):xn(_[Ae]);B(k[Ae],Ne,x,null,ne,ue,ge,ve,le)}H>W?Ve(k,ne,ue,!0,!1,Y):O(_,x,G,ne,ue,ge,ve,le,Y)},Fe=(k,_,x,G,ne,ue,ge,ve,le)=>{let H=0;const W=_.length;let Y=k.length-1,Ae=W-1;for(;H<=Y&&H<=Ae;){const Ne=k[H],Qe=_[H]=le?Dn(_[H]):xn(_[H]);if($r(Ne,Qe))B(Ne,Qe,x,null,ne,ue,ge,ve,le);else break;H++}for(;H<=Y&&H<=Ae;){const Ne=k[Y],Qe=_[Ae]=le?Dn(_[Ae]):xn(_[Ae]);if($r(Ne,Qe))B(Ne,Qe,x,null,ne,ue,ge,ve,le);else break;Y--,Ae--}if(H>Y){if(H<=Ae){const Ne=Ae+1,Qe=Ne<W?_[Ne].el:G;for(;H<=Ae;)B(null,_[H]=le?Dn(_[H]):xn(_[H]),x,Qe,ne,ue,ge,ve,le),H++}}else if(H>Ae)for(;H<=Y;)Ce(k[H],ne,ue,!0),H++;else{const Ne=H,Qe=H,Xe=new Map;for(H=Qe;H<=Ae;H++){const Ot=_[H]=le?Dn(_[H]):xn(_[H]);Ot.key!=null&&Xe.set(Ot.key,H)}let Ze,yt=0;const _t=Ae-Qe+1;let Xt=!1,Bt=0;const Zt=new Array(_t);for(H=0;H<_t;H++)Zt[H]=0;for(H=Ne;H<=Y;H++){const Ot=k[H];if(yt>=_t){Ce(Ot,ne,ue,!0);continue}let $t;if(Ot.key!=null)$t=Xe.get(Ot.key);else for(Ze=Qe;Ze<=Ae;Ze++)if(Zt[Ze-Qe]===0&&$r(Ot,_[Ze])){$t=Ze;break}$t===void 0?Ce(Ot,ne,ue,!0):(Zt[$t-Qe]=H+1,$t>=Bt?Bt=$t:Xt=!0,B(Ot,_[$t],x,null,ne,ue,ge,ve,le),yt++)}const hr=Xt?Np(Zt):Ar;for(Ze=hr.length-1,H=_t-1;H>=0;H--){const Ot=Qe+H,$t=_[Ot],Ie=_[Ot+1],Hn=Ot+1<W?Ie.el||Aa(Ie):G;Zt[H]===0?B(null,$t,x,Hn,ne,ue,ge,ve,le):Xt&&(Ze<0||H!==hr[Ze]?De($t,x,Hn,2):Ze--)}}},De=(k,_,x,G,ne=null)=>{const{el:ue,type:ge,transition:ve,children:le,shapeFlag:H}=k;if(H&6){De(k.component.subTree,_,x,G);return}if(H&128){k.suspense.move(_,x,G);return}if(H&64){ge.move(k,_,x,Jt);return}if(ge===Le){s(ue,_,x);for(let Y=0;Y<le.length;Y++)De(le[Y],_,x,G);s(k.anchor,_,x);return}if(ge===Oo){E(k,_,x);return}if(G!==2&&H&1&&ve)if(G===0)ve.persisted&&!ue[on]?s(ue,_,x):(ve.beforeEnter(ue),s(ue,_,x),Ht(()=>ve.enter(ue),ne));else{const{leave:Y,delayLeave:Ae,afterLeave:Ne}=ve,Qe=()=>{k.ctx.isUnmounted?o(ue):s(ue,_,x)},Xe=()=>{const Ze=ue._isLeaving||!!ue[on];ue._isLeaving&&ue[on](!0),ve.persisted&&!Ze?Qe():Y(ue,()=>{Qe(),Ne&&Ne()})};Ae?Ae(ue,Qe,Xe):Xe()}else s(ue,_,x)},Ce=(k,_,x,G=!1,ne=!1)=>{const{type:ue,props:ge,ref:ve,children:le,dynamicChildren:H,shapeFlag:W,patchFlag:Y,dirs:Ae,cacheIndex:Ne,memo:Qe}=k;if((Y===-2||H&&H.hasOnce)&&(ne=!1),ve!=null&&(An(),ks(ve,null,x,k,!0),Pn()),Ne!=null&&(!k.ctx||k.ctx===_)&&(_.renderCache[Ne]=void 0),W&256){_.ctx.deactivate(k);return}const Xe=W&1&&Ae,Ze=!xs(k);let yt;if(Ze&&(yt=ge&&ge.onVnodeBeforeUnmount)&&gn(yt,_,k),W&6)_e(k.component,x,G);else{if(W&128){k.suspense.unmount(x,G);return}Xe&&kr(k,null,_,"beforeUnmount"),W&64?k.type.remove(k,_,x,Jt,G):H&&!H.hasOnce&&(ue!==Le||Y>0&&Y&64)?Ve(H,_,x,!1,!0):(ue===Le&&Y&384||!ne&&W&16)&&Ve(le,_,x),G&&Q(k)}const _t=Qe!=null&&Ne==null;(Ze&&(yt=ge&&ge.onVnodeUnmounted)||Xe||_t)&&Ht(()=>{yt&&gn(yt,_,k),Xe&&kr(k,null,_,"unmounted"),_t&&(k.el=null)},x)},Q=k=>{const{type:_,el:x,anchor:G,transition:ne}=k,ue=_===Le;if(ue&&!ne){Z(x,G);return}if(_===Oo){X(k),ne&&!ne.persisted&&ne.afterLeave&&ne.afterLeave();return}const ge=ue?Is(k):k,ve=()=>{ue?w(x)&&Z(x,G):o(x),ne&&!ne.persisted&&ne.afterLeave&&ne.afterLeave()};if(ge&&ge.shapeFlag&1&&ne&&!ne.persisted){const{leave:le,delayLeave:H}=ne,W=ge.el,Y=()=>le(W,ve);H?H(W,ve,Y):Y()}else ve()},Z=(k,_)=>{let x;for(;k!==_;)x=C(k),o(k),k=x;o(_)},_e=(k,_,x)=>{const{bum:G,scope:ne,job:ue,subTree:ge,um:ve,m:le,a:H}=k;du(le),du(H),G&&Po(G),ne.stop(),ue?(ue.flags|=8,Ce(ge,k,_,x)):k.vnode.el&&ge&&(ge.transition=k.vnode.transition,Ce(ge,k,_,x)),ve&&Ht(ve,_),Ht(()=>{k.isUnmounted=!0},_)},Ve=(k,_,x,G=!1,ne=!1,ue=0)=>{for(let ge=ue;ge<k.length;ge++)Ce(k[ge],_,x,G,ne)},ft=k=>{if(k.shapeFlag&6)return ft(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const _=C(k.anchor||k.el),x=_&&_[Sc];return x?C(x):_},Yt=(k,_,x)=>{const G=k&&_._vnode?void 0:k&&k.component?k.component.uid:zp();Jf(()=>{k==null?_._vnode&&Ce(_._vnode,null,null,!0):B(_._vnode||null,k,_,null,null,null,x),_._vnode=k},G)},Jt={p:B,um:Ce,m:De,r:Q,mt:Ue,mc:O,pc:me,pbc:ce,n:ft,o:e};return{render:Yt,hydrate:void 0,createApp:xp(Yt)}}function aa({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function xr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Fp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function nl(e,t,n=!1){const s=e.children,o=t.children;if(Ke(s)&&Ke(o))for(let a=0;a<s.length;a++){const u=s[a];let f=o[a];f.shapeFlag&1&&!f.dynamicChildren&&((f.patchFlag<=0||f.patchFlag===32)&&(f=o[a]=Dn(o[a]),f.el=u.el),!n&&f.patchFlag!==-2&&nl(u,f)),f.type===hi&&(f.patchFlag===-1&&(f=o[a]=Dn(f)),f.el=u.el),f.type===Ft&&!f.el&&(f.el=u.el)}}function Np(e){const t=e.slice(),n=[0];let s,o,a,u,f;const h=e.length;for(s=0;s<h;s++){const y=e[s];if(y!==0){if(o=n[n.length-1],e[o]<y){t[s]=o,n.push(s);continue}for(a=0,u=n.length-1;a<u;)f=a+u>>1,e[n[f]]<y?a=f+1:u=f;y<e[n[a]]&&(a>0&&(t[s]=n[a-1]),n[a]=s)}}for(a=n.length,u=n[a-1];a-- >0;)n[a]=u,u=t[u];return n}function Gc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Gc(t)}function du(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Aa(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Aa(t.subTree):null}const Yc=e=>e.__isSuspense;function Vp(e,t){t&&t.pendingBranch?Ke(e)?t.effects.push(...e):t.effects.push(e):Yf(e)}const Le=Symbol.for("v-fgt"),hi=Symbol.for("v-txt"),Ft=Symbol.for("v-cmt"),Oo=Symbol.for("v-stc"),Tr=[];let rn=null;function F(e=!1){Tr.push(rn=e?null:[])}function Jc(){Tr.pop(),rn=Tr[Tr.length-1]||null}let js=1;function Uo(e,t=!1){js+=e,e<0&&rn&&t&&(rn.hasOnce=!0)}function Xc(e){return e.dynamicChildren=js>0?rn||Ar:null,Jc(),js>0&&rn&&rn.push(e),e}function q(e,t,n,s,o,a){return Xc(c(e,t,n,s,o,a,!0))}function It(e,t,n,s,o){return Xc(Oe(e,t,n,s,o,!0))}function Ds(e){return e?e.__v_isVNode===!0:!1}function $r(e,t){return e.type===t.type&&e.key===t.key}const Qc=({key:e})=>e??null,Mo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?wt(e)||Nt(e)||Ge(e)?{i:an,r:e,k:t,f:!!n}:e:null);function c(e,t=null,n=null,s=0,o=null,a=e===Le?0:1,u=!1,f=!1){const h={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Qc(t),ref:t&&Mo(t),scopeId:kc,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:an};return f?(qo(h,n),a&128&&e.normalize(h)):n&&(h.shapeFlag|=wt(n)?8:16),js>0&&!u&&rn&&(h.patchFlag>0||a&6)&&h.patchFlag!==32&&rn.push(h),h}const Oe=Bp;function Bp(e,t=null,n=null,s=0,o=null,a=!1){if((!e||e===vp)&&(e=Ft),Ds(e)){const f=ur(e,t,!0);return n&&qo(f,n),js>0&&!a&&rn&&(f.shapeFlag&6?rn[rn.indexOf(e)]=f:rn.push(f)),f.patchFlag=-2,f}if(Zp(e)&&(e=e.__vccOpts),t){t=Up(t);let{class:f,style:h}=t;f&&!wt(f)&&(t.class=tt(f)),lt(h)&&(Xa(h)&&!Ke(h)&&(h=Et({},h)),t.style=or(h))}const u=wt(e)?1:Yc(e)?128:ci(e)?64:lt(e)?4:Ge(e)?2:0;return c(e,t,n,s,o,u,a,!0)}function Up(e){return e?Xa(e)||Bc(e)?Et({},e):e:null}function ur(e,t,n=!1,s=!1){const{props:o,ref:a,patchFlag:u,children:f,transition:h}=e,y=t?Hp(o||{},t):o,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:y,key:y&&Qc(y),ref:t&&t.ref?n&&a?Ke(a)?a.concat(Mo(t)):[a,Mo(t)]:Mo(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:f,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Le?u===-1?16:u|16:u,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:h,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ur(e.ssContent),ssFallback:e.ssFallback&&ur(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return h&&s&&lr(m,h.clone(m)),m}function nn(e=" ",t=0){return Oe(hi,null,e,t)}function qp(e,t){const n=Oe(Oo,null,e);return n.staticCount=t,n}function Ee(e="",t=!1){return t?(F(),It(Ft,null,e)):Oe(Ft,null,e)}function xn(e){return e==null||typeof e=="boolean"?Oe(Ft):Ke(e)?Oe(Le,null,e.slice()):Ds(e)?Dn(e):Oe(hi,null,String(e))}function Dn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ur(e)}function qo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Ke(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),qo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Bc(t)?t._ctx=an:o===3&&an&&(an.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Ge(t)){if(s&65){qo(e,{default:t});return}t={default:t,_ctx:an},n=32}else t=String(t),s&64?(n=16,t=[nn(t)]):n=8;e.children=t,e.shapeFlag|=n}function Hp(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=tt([t.class,s.class]));else if(o==="style")t.style=or([t.style,s.style]);else if(ri(o)){const a=t[o],u=s[o];u&&a!==u&&!(Ke(a)&&a.includes(u))?t[o]=a?[].concat(a,u):u:u==null&&a==null&&!si(o)&&(t[o]=u)}else o!==""&&(t[o]=s[o])}return t}function gn(e,t,n,s=null){cn(e,t,7,[n,s])}const Wp=Rc();let Zc=0;function zp(){return Zc}function Gp(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Wp,a={uid:Zc++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new wf(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:qc(s,o),emitsOptions:Lc(s,o),emit:null,emitted:null,propsDefaults:dt,inheritAttrs:s.inheritAttrs,ctx:dt,data:dt,props:dt,attrs:dt,slots:dt,refs:dt,setupState:dt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=Sp.bind(null,a),e.ce&&e.ce(a),a}let zt=null;const rl=()=>zt||an;let Ho,Rs;{const e=ai(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),a=>{o.length>1?o.forEach(u=>u(a)):o[0](a)}};Ho=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),Rs=t("__VUE_SSR_SETTERS__",n=>Ls=n)}const Hs=e=>{const t=zt;return Ho(e),e.scope.on(),()=>{e.scope.off(),Ho(t)}},fu=()=>{zt&&zt.scope.off(),Ho(null)};function ed(e){return e.vnode.shapeFlag&4}let Ls=!1;function Yp(e,t=!1,n=!1){t&&Rs(t);const{props:s,children:o}=e.vnode,a=ed(e);Op(e,s,a,t),Dp(e,o,n||t);const u=a?Jp(e,t):void 0;return t&&Rs(!1),u}function Jp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,mp);const{setup:s}=n;if(s){An();const o=e.setupContext=s.length>1?Qp(e):null,a=Hs(e),u=Us(s,e,0,[e.props,o]),f=zu(u);if(Pn(),a(),(f||e.sp)&&!xs(e)&&Tc(e),f){if(u.then(fu,fu),t)return u.then(h=>{Rs(!0);try{pu(e,h,t)}finally{Rs(!1)}}).catch(h=>{ui(h,e,0)});e.asyncDep=u}else pu(e,u)}else td(e)}function pu(e,t,n){Ge(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:lt(t)&&(e.setupState=mc(t)),td(e)}function td(e,t,n){const s=e.type;e.render||(e.render=s.render||En);{const o=Hs(e);An();try{yp(e)}finally{Pn(),o()}}}const Xp={get(e,t){return Kt(e,"get",""),e[t]}};function Qp(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Xp),slots:e.slots,emit:e.emit,expose:t}}function vi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(mc(Ff(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Cs)return Cs[n](e)},has(t,n){return n in t||n in Cs}})):e.proxy}function Zp(e){return Ge(e)&&"__vccOpts"in e}const at=(e,t)=>qf(e,t,Ls);function eh(e,t,n){try{Uo(-1);const s=arguments.length;return s===2?lt(t)&&!Ke(t)?Ds(t)?Oe(e,null,[t]):Oe(e,t):Oe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Ds(n)&&(n=[n]),Oe(e,t,n))}finally{Uo(1)}}const th="3.5.44";/**
|
||
* @vue/runtime-dom v3.5.44
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let Pa;const hu=typeof window<"u"&&window.trustedTypes;if(hu)try{Pa=hu.createPolicy("vue",{createHTML:e=>e})}catch{}const nd=Pa?e=>Pa.createHTML(e):e=>e,nh="http://www.w3.org/2000/svg",rh="http://www.w3.org/1998/Math/MathML",jn=typeof document<"u"?document:null,vu=jn&&jn.createElement("template"),sh={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?jn.createElementNS(nh,e):t==="mathml"?jn.createElementNS(rh,e):n?jn.createElement(e,{is:n}):jn.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>jn.createTextNode(e),createComment:e=>jn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>jn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,a){const u=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{vu.innerHTML=nd(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const f=vu.content;if(s==="svg"||s==="mathml"){const h=f.firstChild;for(;h.firstChild;)f.appendChild(h.firstChild);f.removeChild(h)}t.insertBefore(f,n)}return[u?u.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Qn="transition",vs="animation",Jr=Symbol("_vtc"),rd={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},sd=Et({},$c,rd),oh=e=>(e.displayName="Transition",e.props=sd,e),ns=oh((e,{slots:t})=>eh(op,od(e),t)),Cr=(e,t=[])=>{Ke(e)?e.forEach(n=>n(...t)):e&&e(...t)},mu=e=>e?Ke(e)?e.some(t=>t.length>1):e.length>1:!1;function od(e){const t={};for(const J in e)J in rd||(t[J]=e[J]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:a=`${n}-enter-from`,enterActiveClass:u=`${n}-enter-active`,enterToClass:f=`${n}-enter-to`,appearFromClass:h=a,appearActiveClass:y=u,appearToClass:m=f,leaveFromClass:w=`${n}-leave-from`,leaveActiveClass:C=`${n}-leave-active`,leaveToClass:S=`${n}-leave-to`}=e,M=ih(o),B=M&&M[0],oe=M&&M[1],{onBeforeEnter:ae,onEnter:T,onEnterCancelled:E,onLeave:X,onLeaveCancelled:de,onBeforeAppear:ie=ae,onAppear:te=T,onAppearCancelled:O=E}=t,j=(J,xe,Ue,rt)=>{J._enterCancelled=rt,er(J,xe?m:f),er(J,xe?y:u),Ue&&Ue()},ce=(J,xe)=>{J._isLeaving=!1,er(J,w),er(J,S),er(J,C),xe&&xe()},ke=J=>(xe,Ue)=>{const rt=J?te:T,We=()=>j(xe,J,Ue);Cr(rt,[xe,We]),yu(()=>{er(xe,J?h:a),bn(xe,J?m:f),mu(rt)||gu(xe,s,B,We)})};return Et(t,{onBeforeEnter(J){Cr(ae,[J]),bn(J,a),bn(J,u)},onBeforeAppear(J){Cr(ie,[J]),bn(J,h),bn(J,y)},onEnter:ke(!1),onAppear:ke(!0),onLeave(J,xe){J._isLeaving=!0;const Ue=()=>ce(J,xe);bn(J,w),J._enterCancelled?(bn(J,C),Ta(J)):(Ta(J),bn(J,C)),yu(()=>{J._isLeaving&&(er(J,w),bn(J,S),mu(X)||gu(J,s,oe,Ue))}),Cr(X,[J,Ue])},onEnterCancelled(J){j(J,!1,void 0,!0),Cr(E,[J])},onAppearCancelled(J){j(J,!0,void 0,!0),Cr(O,[J])},onLeaveCancelled(J){ce(J),Cr(de,[J])}})}function ih(e){if(e==null)return null;if(lt(e))return[la(e.enter),la(e.leave)];{const t=la(e);return[t,t]}}function la(e){return df(e)}function bn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Jr]||(e[Jr]=new Set)).add(t)}function er(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Jr];n&&(n.delete(t),n.size||(e[Jr]=void 0))}function yu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ah=0;function gu(e,t,n,s){const o=e._endId=++ah,a=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(a,n);const{type:u,timeout:f,propCount:h}=id(e,t);if(!u)return s();const y=u+"end";let m=0;const w=()=>{e.removeEventListener(y,C),a()},C=S=>{S.target===e&&++m>=h&&w()};setTimeout(()=>{m<h&&w()},f+1),e.addEventListener(y,C)}function id(e,t){const n=window.getComputedStyle(e),s=M=>(n[M]||"").split(", "),o=s(`${Qn}Delay`),a=s(`${Qn}Duration`),u=bu(o,a),f=s(`${vs}Delay`),h=s(`${vs}Duration`),y=bu(f,h);let m=null,w=0,C=0;t===Qn?u>0&&(m=Qn,w=u,C=a.length):t===vs?y>0&&(m=vs,w=y,C=h.length):(w=Math.max(u,y),m=w>0?u>y?Qn:vs:null,C=m?m===Qn?a.length:h.length:0);const S=m===Qn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Qn}Property`).toString());return{type:m,timeout:w,propCount:C,hasTransform:S}}function bu(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>wu(n)+wu(e[s])))}function wu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ta(e){return(e?e.ownerDocument:document).body.offsetHeight}function lh(e,t,n){const s=e[Jr];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const _u=Symbol("_vod"),ad=Symbol("_vsh"),uh=Symbol(""),ch=/(?:^|;)\s*display\s*:/;function dh(e,t,n){const s=e.style,o=wt(n);let a=!1;if(n&&!o){if(t)if(wt(t))for(const u of t.split(";")){const f=u.slice(0,u.indexOf(":")).trim();n[f]==null&&gs(s,f,"")}else for(const u in t)n[u]==null&&gs(s,u,"");for(const u in n){u==="display"&&(a=!0);const f=n[u];f!=null?ph(e,u,!wt(t)&&t?t[u]:void 0,f)||gs(s,u,f):gs(s,u,"")}}else if(o){if(t!==n){const u=s[uh];u&&(n+=";"+u),s.cssText=n,a=ch.test(n)}}else t&&e.removeAttribute("style");_u in e&&((!o||t!==n)&&(e[_u]=a?s.display:""),e[ad]&&(s.display="none"))}const Eo=/\s*!important$/;function gs(e,t,n){if(Ke(n))n.forEach(s=>gs(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))Eo.test(n)?e.setProperty(t,n.replace(Eo,""),"important"):e.setProperty(t,n);else{const s=fh(e,t);Eo.test(n)?e.setProperty(dr(s),n.replace(Eo,""),"important"):e[s]=n}}const ku=["Webkit","Moz","ms"],ua={};function fh(e,t){const n=ua[t];if(n)return n;let s=hn(t);if(s!=="filter"&&s in e)return ua[t]=s;s=Ju(s);for(let o=0;o<ku.length;o++){const a=ku[o]+s;if(a in e)return ua[t]=a}return t}function ph(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&wt(s)&&n===s}const xu="http://www.w3.org/1999/xlink";function Cu(e,t,n,s,o,a=yf(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(xu,t.slice(6,t.length)):e.setAttributeNS(xu,t,n):n==null||a&&!Qu(n)?e.removeAttribute(t):e.setAttribute(t,a?"":$n(n)?String(n):n)}function Su(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?nd(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const f=a==="OPTION"?e.getAttribute("value")||"":e.value,h=n==null?e.type==="checkbox"?"on":"":String(n);(f!==h||!("_value"in e))&&(e.value=h),n==null&&e.removeAttribute(t),e._value=n;return}let u=!1;if(n===""||n==null){const f=typeof e[t];f==="boolean"?n=Qu(n):n==null&&f==="string"?(n="",u=!0):f==="number"&&(n=0,u=!0)}try{e[t]=n}catch{}u&&e.removeAttribute(o||t)}function rr(e,t,n,s){e.addEventListener(t,n,s)}function hh(e,t,n,s){e.removeEventListener(t,n,s)}const Eu=Symbol("_vei");function vh(e,t,n,s,o=null){const a=e[Eu]||(e[Eu]={}),u=a[t];if(s&&u)u.value=s;else{const[f,h]=gh(t);if(s){const y=a[t]=_h(s,o);rr(e,f,y,h)}else u&&(hh(e,f,u,h),a[t]=void 0)}}const mh=/(Once|Passive|Capture)$/,yh=/^on:?(?:Once|Passive|Capture)$/;function gh(e){let t,n;for(;(n=e.match(mh))&&!yh.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):dr(e.slice(2)),t]}let ca=0;const bh=Promise.resolve(),wh=()=>ca||(bh.then(()=>ca=0),ca=Date.now());function _h(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(Ke(o)){const a=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{a.call(s),s._stopped=!0};const u=o.slice(),f=[s];for(let h=0;h<u.length&&!s._stopped;h++){const y=u[h];y&&cn(y,t,5,f)}}else cn(o,t,5,[s])};return n.value=e,n.attached=wh(),n}const $u=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,kh=(e,t,n,s,o,a)=>{const u=o==="svg";t==="class"?lh(e,s,u):t==="style"?dh(e,n,s):ri(t)?si(t)||vh(e,t,n,s,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):xh(e,t,s,u))?(Su(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Cu(e,t,s,u,a,t!=="value")):e._isVueCE&&(Ch(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!wt(s)))?Su(e,hn(t),s,a,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Cu(e,t,s,u))};function xh(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&$u(t)&&Ge(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return $u(t)&&wt(n)?!1:t in e}function Ch(e,t){const n=e._def.props;if(!n)return!1;const s=hn(t);return Array.isArray(n)?n.some(o=>hn(o)===s):Object.keys(n).some(o=>hn(o)===s)}const ld=new WeakMap,ud=new WeakMap,Wo=Symbol("_moveCb"),Au=Symbol("_enterCb"),Oa=new WeakMap,Sh=e=>(delete e.props.mode,e),Eh=Sh({name:"TransitionGroup",props:Et({},sd,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=rl(),s=Ec();let o,a,u,f;const h=()=>(f===void 0&&(f=o.length>0&&jh(o[0].el,n.vnode.el,Pu(e))),f);return Mc(()=>{if(Oa.delete(n),!h()){o=[],u=void 0;return}const y=Pu(e);o.forEach(Ah);const m=u&&Ih(u,n.vnode.el);u=void 0,o.forEach(C=>Ph(C,m));const w=o.filter(Th);Ta(n.vnode.el),w.forEach(C=>{const S=C.el,M=S.style;bn(S,y),M.transform=M.webkitTransform=M.transitionDuration="";const B=S[Wo]=oe=>{oe&&oe.target!==S||(!oe||oe.propertyName.endsWith("transform"))&&(S.removeEventListener("transitionend",B),S[Wo]=null,er(S,y))};S.addEventListener("transitionend",B)}),o=[]}),()=>{const y=ot(e),m=od(y);let w=y.tag||Le;if(o=[],f=void 0,a)for(let C=0;C<a.length;C++){const S=a[C];S.el&&S.el instanceof Element&&!S.el[ad]&&(o.push(S),lr(S,Ms(S,m,s,n)),ld.set(S,mi(S.el)))}a=t.default?Za(t.default()):[];for(let C=0;C<a.length;C++){const S=a[C];S.key!=null&&lr(S,Ms(S,m,s,n))}return o.length&&(u=Oh(n),Oa.set(n,h)),Oe(w,null,a)}}}),$h=Eh;function Ah(e){const t=e.el;t[Wo]&&t[Wo](),t[Au]&&t[Au]()}function Pu(e){return e.moveClass||`${e.name||"v"}-move`}function Ph(e,t){ud.set(e,mi(e.el,t))}function Th(e){const t=ld.get(e),n=ud.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const a=e.el,u=a.style,f=a.getBoundingClientRect();let h=1,y=1;return a.offsetWidth&&(h=f.width/a.offsetWidth),a.offsetHeight&&(y=f.height/a.offsetHeight),(!Number.isFinite(h)||h===0)&&(h=1),(!Number.isFinite(y)||y===0)&&(y=1),Math.abs(h-1)<.01&&(h=1),Math.abs(y-1)<.01&&(y=1),u.transform=u.webkitTransform=`translate(${s/h}px,${o/y}px)`,u.transitionDuration="0s",e}}function mi(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function Oh(e){let t;for(let n=e.parent;n;n=n.parent){const s=Oa.get(n);if(s){const o=Mh(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push(Et(mi(o),{item:o,willMove:s}))}}return t}function Mh(e,t){const n=e.nodeType===1?e:e.parentNode;for(;t&&t.parentNode!==n;)t=t.parentNode;if(t&&t.nodeType===1)return t}function Ih(e,t){const n=e.find(s=>s.willMove()&&s.item.contains(t));return n&&mi(n.item,n)}function jh(e,t,n){const s=e.cloneNode(),o=e[Jr];o&&o.forEach(f=>{f.split(/\s+/).forEach(h=>h&&s.classList.remove(h))}),n.split(/\s+/).forEach(f=>f&&s.classList.add(f)),s.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(s);const{hasTransform:u}=id(s);return a.removeChild(s),u}const Xr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ke(t)?n=>Po(t,n):t};function Dh(e){e.target.composing=!0}function Tu(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Sn=Symbol("_assign"),$o=Symbol("_initialValue");function da(e,t,n){return t&&(e=e.trim()),n&&(e=ii(e)),e}const Re={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[$o]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[$o]=e.defaultValue.replace(/\r\n?/g,`
|
||
`))),e[Sn]=Xr(o);const a=s||o.props&&o.props.type==="number";rr(e,t?"change":"input",u=>{u.target.composing||e[Sn](da(e.value,n,a))}),(n||a)&&rr(e,"change",()=>{e.value=da(e.value,n,a)}),t||(rr(e,"compositionstart",Dh),rr(e,"compositionend",Tu),rr(e,"change",Tu))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",a=e[$o];delete e[$o],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[Sn](da(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:a}},u){if(e[Sn]=Xr(u),e.composing)return;const f=(a||e.type==="number")&&!/^0\d/.test(e.value)?ii(e.value):e.value,h=t??"";if(f===h)return;const y=e.getRootNode();(y instanceof Document||y instanceof ShadowRoot)&&y.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===h)||(e.value=h)}},Rh={deep:!0,created(e,t,n){e[Sn]=Xr(n),rr(e,"change",()=>{const s=e._modelValue,o=Ks(e),a=e.checked,u=e[Sn];if(Ke(s)){const f=Ua(s,o),h=f!==-1;if(a&&!h)u(s.concat(o));else if(!a&&h){const y=[...s];y.splice(f,1),u(y)}}else if(Bn(s)){const f=new Set(s);a?f.add(o):f.delete(o),u(f)}else u(cd(e,a))})},mounted:Ou,beforeUpdate(e,t,n){e[Sn]=Xr(n),Ou(e,t,n)}};function Ou(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(Ke(t))o=Ua(t,s.props.value)>-1;else if(Bn(t))o=t.has(s.props.value);else{if(t===n)return;o=Un(t,cd(e,!0))}e.checked!==o&&(e.checked=o)}const Fn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,rr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,h=>h.selected).map(h=>n?ii(Ks(h)):Ks(h)),a=e.multiple,u=a?Bn(e._modelValue)?new Set(o):o:o[0],f=e._pendingValue=[a,a?Ke(u)?o.slice():o:u];try{e[Sn](u)}finally{ts(()=>{e._pendingValue===f&&(e._pendingValue=void 0)})}}),e[Sn]=Xr(s)},mounted(e,{value:t}){Mu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Sn]=Xr(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Lh(t,n[1],n[0]))&&Mu(e,t)}};function Lh(e,t,n){if(!n||Ke(e))return Un(e,t);if(Bn(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function Mu(e,t){const n=e.multiple,s=Ke(t);if(!(n&&!s&&!Bn(t))){for(let o=0,a=e.options.length;o<a;o++){const u=e.options[o],f=Ks(u);if(n)if(s){const h=typeof f;h==="string"||h==="number"?u.selected=t.some(y=>String(y)===String(f)):u.selected=Ua(t,f)>-1}else u.selected=t.has(f);else if(Un(Ks(u),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ks(e){return"_value"in e?e._value:e.value}function cd(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Kh=["ctrl","shift","alt","meta"],Fh={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Kh.some(n=>e[`${n}Key`]&&!t.includes(n))},Mr=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(o,...a)=>{for(let u=0;u<t.length;u++){const f=Fh[t[u]];if(f&&f(o,t))return}return e(o,...a)})},Nh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},jt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=o=>{if(!("key"in o))return;const a=dr(o.key);if(t.some(u=>u===a||Nh[u]===a))return e(o)})},Vh=Et({patchProp:kh},sh);let Iu;function Bh(){return Iu||(Iu=Lp(Vh))}const Uh=(...e)=>{const t=Bh().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Hh(s);if(!o)return;const a=t._component;!Ge(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const u=n(o,!1,qh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),u},t};function qh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Hh(e){return wt(e)?document.querySelector(e):e}function At(e){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">'+e+"</svg>"}const Wh={calendar:At('<rect x="4" y="5.5" width="16" height="14" rx="2"/><path d="M8.5 3.5v3.5M15.5 3.5v3.5M4 10.5h16"/>'),clock:At('<circle cx="12" cy="12" r="8.25"/><path d="M12 7.75V12l2.75 1.75"/>'),"check-circle":At('<circle cx="12" cy="12" r="8.25"/><path d="M8.5 12.4l2.4 2.4 4.6-5.2"/>'),edit:At('<path d="M4.5 19.5v-3.2L16 4.8a1.9 1.9 0 0 1 2.7 2.7L7.2 19l-2.7.5z"/>'),tag:At('<path d="M4.5 5.5a1 1 0 0 1 1-1h5.6l8.4 8.4-6.6 6.6-8.4-8.4V5.5z"/><circle cx="8.8" cy="8.8" r="1.1"/>'),star:At('<path d="M12 4l2.5 5.1 5.6.8-4 3.9.9 5.6-5-2.7-5 2.7.9-5.6-4-3.9 5.6-.8L12 4z"/>'),close:At('<path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/>'),flag:At('<path d="M6.5 21V4"/><path d="M6.5 4.5h10.8l-2.6 3.7 2.6 3.7H6.5"/>'),chart:At('<path d="M4.5 19.5h15"/><path d="M7.5 19.5V12M12 19.5V6.5M16.5 19.5V9.5"/>'),export:At('<path d="M12 4.5V14M8.25 10.25L12 14l3.75-3.75"/><path d="M5 19.5h14"/>'),"chevron-left":At('<path d="M14.5 6l-6 6 6 6"/>'),"chevron-right":At('<path d="M9.5 6l6 6-6 6"/>'),"chevron-down":At('<path d="M6 9.5l6 6 6-6"/>'),plus:At('<path d="M12 5.5v13M5.5 12h13"/>'),search:At('<circle cx="11" cy="11" r="6.5"/><path d="M15.8 15.8L20 20"/>'),settings:At('<circle cx="12" cy="12" r="3"/><path d="M12 4.5v2.2M12 17.3v2.2M4.5 12h2.2M17.3 12h2.2M6.8 6.8l1.6 1.6M15.6 15.6l1.6 1.6M17.2 6.8l-1.6 1.6M8.4 15.6l-1.6 1.6"/>'),memo:At('<path d="M6.5 3.5h7.5L18.5 8v11a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-15a1 1 0 0 1 1-1z"/><path d="M14 3.5V8h4.5M9.5 12h5M9.5 15.5h5"/>'),lock:At('<rect x="5.5" y="10.5" width="13" height="9.5" rx="1.5"/><path d="M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5"/>'),wallet:At('<rect x="3.5" y="6" width="17" height="12.5" rx="2"/><path d="M3.5 10h17"/><circle cx="16.4" cy="14.2" r="1.1"/>')},zh=["innerHTML"],ut=Vt({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=at(()=>Wh[t.name]||"");return(s,o)=>(F(),q("span",{class:"icon",style:or({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,zh))}}),Gh=["aria-label"],Yh={class:"dialog-title"},Jh={class:"dialog-msg"},Xh={class:"dialog-btns"},Qh=Vt({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmText:{default:"确认"},cancelText:{default:"取消"},danger:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(e,{emit:t}){const n=e,s=t;function o(a){n.open&&a.key==="Escape"&&s("cancel")}return mt(()=>n.open,a=>{a?window.addEventListener("keydown",o):window.removeEventListener("keydown",o)}),pr(()=>window.removeEventListener("keydown",o)),(a,u)=>(F(),It(qs,{to:"body"},[Oe(ns,{name:"modal"},{default:fr(()=>[e.open?(F(),q("div",{key:0,class:"mask",onClick:u[2]||(u[2]=Mr(f=>s("cancel"),["self"]))},[c("div",{class:"dialog",role:"dialog","aria-label":e.title},[c("div",Yh,se(e.title),1),c("div",Jh,se(e.message),1),c("div",Xh,[c("button",{class:"btn btn-sm",onClick:u[0]||(u[0]=f=>s("cancel"))},se(e.cancelText),1),c("button",{class:tt(["btn btn-sm",e.danger?"btn-danger-solid":"btn-primary"]),onClick:u[1]||(u[1]=f=>s("confirm"))},se(e.confirmText),3)])],8,Gh)])):Ee("",!0)]),_:1})]))}}),Gt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},cr=Gt(Qh,[["__scopeId","data-v-f27041d4"]]);var ju=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dd={exports:{}};(function(e,t){((n,s)=>{e.exports=s()})(ju,function(){var n=function(r,i){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(l,d){l.__proto__=d}:function(l,d){for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(l[p]=d[p])}))(r,i)},s=function(){return(s=Object.assign||function(r){for(var i,l=1,d=arguments.length;l<d;l++)for(var p in i=arguments[l])Object.prototype.hasOwnProperty.call(i,p)&&(r[p]=i[p]);return r}).apply(this,arguments)};function o(r,i,l){for(var d,p=0,v=i.length;p<v;p++)!d&&p in i||((d=d||Array.prototype.slice.call(i,0,p))[p]=i[p]);return r.concat(d||Array.prototype.slice.call(i))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:ju,u=Object.keys,f=Array.isArray;function h(r,i){return typeof i=="object"&&u(i).forEach(function(l){r[l]=i[l]}),r}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var y=Object.getPrototypeOf,m={}.hasOwnProperty;function w(r,i){return m.call(r,i)}function C(r,i){typeof i=="function"&&(i=i(y(r))),(typeof Reflect>"u"?u:Reflect.ownKeys)(i).forEach(function(l){M(r,l,i[l])})}var S=Object.defineProperty;function M(r,i,l,d){S(r,i,h(l&&w(l,"get")&&typeof l.get=="function"?{get:l.get,set:l.set,configurable:!0}:{value:l,configurable:!0,writable:!0},d))}function B(r){return{from:function(i){return r.prototype=Object.create(i.prototype),M(r.prototype,"constructor",r),{extend:C.bind(null,r.prototype)}}}}var oe=Object.getOwnPropertyDescriptor,ae=[].slice;function T(r,i,l){return ae.call(r,i,l)}function E(r,i){return i(r)}function X(r){if(!r)throw new Error("Assertion Failed")}function de(r){a.setImmediate?setImmediate(r):setTimeout(r,0)}function ie(r,i){if(typeof i=="string"&&w(r,i))return r[i];if(!i)return r;if(typeof i!="string"){for(var l=[],d=0,p=i.length;d<p;++d){var v=ie(r,i[d]);l.push(v)}return l}var g,b=i.indexOf(".");return b===-1||(g=r[i.substr(0,b)])==null?void 0:ie(g,i.substr(b+1))}function te(r,i,l){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){X(typeof l!="string"&&"length"in l);for(var d=0,p=i.length;d<p;++d)te(r,i[d],l[d])}else{var v=i.indexOf(".");if(v!==-1){var g=i.substr(0,v),v=i.substr(v+1);if(v==="")l===void 0?f(r)&&!isNaN(parseInt(g))?r.splice(g,1):delete r[g]:r[g]=l;else{var b=r[g];if(!b||!w(r,g)){if(l===void 0)return;b=r[g]={}}te(b,v,l)}}else l===void 0?f(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=l}}function O(r){var i,l={};for(i in r)w(r,i)&&(l[i]=r[i]);return l}var j=[].concat;function ce(r){return j.apply([],r)}var Ce="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ce([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return a[r]}),ke=new Set(Ce.map(function(r){return a[r]})),J=null;function xe(r){return J=new WeakMap,r=function i(l){if(!l||typeof l!="object")return l;var d=J.get(l);if(d)return d;if(f(l)){d=[],J.set(l,d);for(var p=0,v=l.length;p<v;++p)d.push(i(l[p]))}else if(ke.has(l.constructor))d=l;else{var g,b=y(l);for(g in d=b===Object.prototype?{}:Object.create(b),J.set(l,d),l)w(l,g)&&(d[g]=i(l[g]))}return d}(r),J=null,r}var Ue={}.toString;function rt(r){return Ue.call(r).slice(8,-1)}var We=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Ye=typeof We=="symbol"?function(r){var i;return r!=null&&(i=r[We])&&i.apply(r)}:function(){return null};function me(r,i){i=r.indexOf(i),0<=i&&r.splice(i,1)}var Me={};function Fe(r){var i,l,d,p;if(arguments.length===1){if(f(r))return r.slice();if(this===Me&&typeof r=="string")return[r];if(p=Ye(r))for(l=[];!(d=p.next()).done;)l.push(d.value);else{if(r==null)return[r];if(typeof(i=r.length)!="number")return[r];for(l=new Array(i);i--;)l[i]=r[i]}}else for(i=arguments.length,l=new Array(i);i--;)l[i]=arguments[i];return l}var De=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Ce=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Xe=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ce),Q={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 Z(r,i){this.name=r,this.message=i}function _e(r,i){return r+". Errors: "+Object.keys(i).map(function(l){return i[l].toString()}).filter(function(l,d,p){return p.indexOf(l)===d}).join(`
|
||
`)}function Ve(r,i,l,d){this.failures=i,this.failedKeys=d,this.successCount=l,this.message=_e(r,i)}function ft(r,i){this.name="BulkError",this.failures=Object.keys(i).map(function(l){return i[l]}),this.failuresByPos=i,this.message=_e(r,this.failures)}B(Z).from(Error).extend({toString:function(){return this.name+": "+this.message}}),B(Ve).from(Z),B(ft).from(Z);var Yt=Xe.reduce(function(r,i){return r[i]=i+"Error",r},{}),Jt=Z,je=Xe.reduce(function(r,i){var l=i+"Error";function d(p,v){this.name=l,p?typeof p=="string"?(this.message="".concat(p).concat(v?`
|
||
`+v:""),this.inner=v||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=Q[i]||l,this.inner=null)}return B(d).from(Jt),r[i]=d,r},{}),k=(je.Syntax=SyntaxError,je.Type=TypeError,je.Range=RangeError,Ce.reduce(function(r,i){return r[i+"Error"]=je[i],r},{}));Ce=Xe.reduce(function(r,i){return["Syntax","Type","Range"].indexOf(i)===-1&&(r[i+"Error"]=je[i]),r},{});function _(){}function x(r){return r}function G(r,i){return r==null||r===x?i:function(l){return i(r(l))}}function ne(r,i){return function(){r.apply(this,arguments),i.apply(this,arguments)}}function ue(r,i){return r===_?i:function(){var l=r.apply(this,arguments),d=(l!==void 0&&(arguments[0]=l),this.onsuccess),p=this.onerror,v=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?ne(d,this.onsuccess):d),p&&(this.onerror=this.onerror?ne(p,this.onerror):p),v!==void 0?v:l}}function ge(r,i){return r===_?i:function(){r.apply(this,arguments);var l=this.onsuccess,d=this.onerror;this.onsuccess=this.onerror=null,i.apply(this,arguments),l&&(this.onsuccess=this.onsuccess?ne(l,this.onsuccess):l),d&&(this.onerror=this.onerror?ne(d,this.onerror):d)}}function ve(r,i){return r===_?i:function(){var l=r.apply(this,arguments),d=(h(arguments[0],l),this.onsuccess),p=this.onerror,v=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?ne(d,this.onsuccess):d),p&&(this.onerror=this.onerror?ne(p,this.onerror):p),l===void 0?v===void 0?void 0:v:h(l,v)}}function le(r,i){return r===_?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function H(r,i){return r===_?i:function(){var l=r.apply(this,arguments);if(l&&typeof l.then=="function"){for(var d=this,p=arguments.length,v=new Array(p);p--;)v[p]=arguments[p];return l.then(function(){return i.apply(d,v)})}return i.apply(this,arguments)}}Ce.ModifyError=Ve,Ce.DexieError=Z,Ce.BulkError=ft;var W=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Y(r){W=r}var Ae={},Ne=100,Qe=typeof Promise>"u"?[]:(Xe=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Qe=crypto.subtle.digest("SHA-512",new Uint8Array([0])),y(Qe),Xe]:[Xe,y(Xe),Xe]),Xe=Qe[0],Br=Qe[1],Br=Br&&Br.then,Ze=Xe&&Xe.constructor,yt=!!Qe[2],_t=function(r,i){Hn.push([r,i]),Bt&&(queueMicrotask(Rd),Bt=!1)},Xt=!0,Bt=!0,Zt=[],hr=[],Ot=x,$t={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:_,pgp:!1,env:{},finalize:_},Ie=$t,Hn=[],vr=0,Js=[];function Se(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var i=this._PSD=Ie;if(typeof r!="function"){if(r!==Ae)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&xi(this,this._value)}else this._state=null,this._value=null,++i.ref,function l(d,p){try{p(function(v){if(d._state===null){if(v===d)throw new TypeError("A promise cannot be resolved with itself.");var g=d._lib&&Rr();v&&typeof v.then=="function"?l(d,function(b,A){v instanceof Se?v._then(b,A):v.then(b,A)}):(d._state=!0,d._value=v,vl(d)),g&&Lr()}},xi.bind(null,d))}catch(v){xi(d,v)}}(this,r)}var ki={get:function(){var r=Ie,i=eo;function l(d,p){var v=this,g=!r.global&&(r!==Ie||i!==eo),b=g&&!zn(),A=new Se(function(V,I){Ci(v,new hl(yl(d,r,g,b),yl(p,r,g,b),V,I,r))});return this._consoleTask&&(A._consoleTask=this._consoleTask),A}return l.prototype=Ae,l},set:function(r){M(this,"then",r&&r.prototype===Ae?ki:{get:function(){return r},set:ki.set})}};function hl(r,i,l,d,p){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof i=="function"?i:null,this.resolve=l,this.reject=d,this.psd=p}function xi(r,i){var l,d;hr.push(i),r._state===null&&(l=r._lib&&Rr(),i=Ot(i),r._state=!1,r._value=i,d=r,Zt.some(function(p){return p._value===d._value})||Zt.push(d),vl(r),l)&&Lr()}function vl(r){var i=r._listeners;r._listeners=[];for(var l=0,d=i.length;l<d;++l)Ci(r,i[l]);var p=r._PSD;--p.ref||p.finalize(),vr===0&&(++vr,_t(function(){--vr==0&&Si()},[]))}function Ci(r,i){if(r._state===null)r._listeners.push(i);else{var l=r._state?i.onFulfilled:i.onRejected;if(l===null)return(r._state?i.resolve:i.reject)(r._value);++i.psd.ref,++vr,_t(Dd,[l,r,i])}}function Dd(r,i,l){try{var d,p=i._value;!i._state&&hr.length&&(hr=[]),d=W&&i._consoleTask?i._consoleTask.run(function(){return r(p)}):r(p),i._state||hr.indexOf(p)!==-1||(v=>{for(var g=Zt.length;g;)if(Zt[--g]._value===v._value)return Zt.splice(g,1)})(i),l.resolve(d)}catch(v){l.reject(v)}finally{--vr==0&&Si(),--l.psd.ref||l.psd.finalize()}}function Rd(){mr($t,function(){Rr()&&Lr()})}function Rr(){var r=Xt;return Bt=Xt=!1,r}function Lr(){var r,i,l;do for(;0<Hn.length;)for(r=Hn,Hn=[],l=r.length,i=0;i<l;++i){var d=r[i];d[0].apply(null,d[1])}while(0<Hn.length);Bt=Xt=!0}function Si(){for(var r=Zt,i=(Zt=[],r.forEach(function(d){d._PSD.onunhandled.call(null,d._value,d)}),Js.slice(0)),l=i.length;l;)i[--l]()}function Xs(r){return new Se(Ae,!1,r)}function gt(r,i){var l=Ie;return function(){var d=Rr(),p=Ie;try{return Gn(l,!0),r.apply(this,arguments)}catch(v){i&&i(v)}finally{Gn(p,!1),d&&Lr()}}}C(Se.prototype,{then:ki,_then:function(r,i){Ci(this,new hl(null,null,r,i,Ie))},catch:function(r){var i,l;return arguments.length===1?this.then(null,r):(i=r,l=arguments[1],typeof i=="function"?this.then(null,function(d){return(d instanceof i?l:Xs)(d)}):this.then(null,function(d){return(d&&d.name===i?l:Xs)(d)}))},finally:function(r){return this.then(function(i){return Se.resolve(r()).then(function(){return i})},function(i){return Se.resolve(r()).then(function(){return Xs(i)})})},timeout:function(r,i){var l=this;return r<1/0?new Se(function(d,p){var v=setTimeout(function(){return p(new je.Timeout(i))},r);l.then(d,p).finally(clearTimeout.bind(null,v))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&M(Se.prototype,Symbol.toStringTag,"Dexie.Promise"),$t.env=ml(),C(Se,{all:function(){var r=Fe.apply(null,arguments).map(to);return new Se(function(i,l){r.length===0&&i([]);var d=r.length;r.forEach(function(p,v){return Se.resolve(p).then(function(g){r[v]=g,--d||i(r)},l)})})},resolve:function(r){return r instanceof Se?r:r&&typeof r.then=="function"?new Se(function(i,l){r.then(i,l)}):new Se(Ae,!0,r)},reject:Xs,race:function(){var r=Fe.apply(null,arguments).map(to);return new Se(function(i,l){r.map(function(d){return Se.resolve(d).then(i,l)})})},PSD:{get:function(){return Ie},set:function(r){return Ie=r}},totalEchoes:{get:function(){return eo}},newPSD:Wn,usePSD:mr,scheduler:{get:function(){return _t},set:function(r){_t=r}},rejectionMapper:{get:function(){return Ot},set:function(r){Ot=r}},follow:function(r,i){return new Se(function(l,d){return Wn(function(p,v){var g=Ie;g.unhandleds=[],g.onunhandled=v,g.finalize=ne(function(){var b,A=this;b=function(){A.unhandleds.length===0?p():v(A.unhandleds[0])},Js.push(function V(){b(),Js.splice(Js.indexOf(V),1)}),++vr,_t(function(){--vr==0&&Si()},[])},g.finalize),r()},i,l,d)})}}),Ze&&(Ze.allSettled&&M(Se,"allSettled",function(){var r=Fe.apply(null,arguments).map(to);return new Se(function(i){r.length===0&&i([]);var l=r.length,d=new Array(l);r.forEach(function(p,v){return Se.resolve(p).then(function(g){return d[v]={status:"fulfilled",value:g}},function(g){return d[v]={status:"rejected",reason:g}}).then(function(){return--l||i(d)})})})}),Ze.any&&typeof AggregateError<"u"&&M(Se,"any",function(){var r=Fe.apply(null,arguments).map(to);return new Se(function(i,l){r.length===0&&l(new AggregateError([]));var d=r.length,p=new Array(d);r.forEach(function(v,g){return Se.resolve(v).then(function(b){return i(b)},function(b){p[g]=b,--d||l(new AggregateError(p))})})})}),Ze.withResolvers)&&(Se.withResolvers=Ze.withResolvers);var Pt={awaits:0,echoes:0,id:0},Ld=0,Qs=[],Zs=0,eo=0,Kd=0;function Wn(r,g,l,d){var p=Ie,v=Object.create(p),g=(v.parent=p,v.ref=0,v.global=!1,v.id=++Kd,$t.env,v.env=yt?{Promise:Se,PromiseProp:{value:Se,configurable:!0,writable:!0},all:Se.all,race:Se.race,allSettled:Se.allSettled,any:Se.any,resolve:Se.resolve,reject:Se.reject}:{},g&&h(v,g),++p.ref,v.finalize=function(){--this.parent.ref||this.parent.finalize()},mr(v,r,l,d));return v.ref===0&&v.finalize(),g}function Kr(){return Pt.id||(Pt.id=++Ld),++Pt.awaits,Pt.echoes+=Ne,Pt.id}function zn(){return!!Pt.awaits&&(--Pt.awaits==0&&(Pt.id=0),Pt.echoes=Pt.awaits*Ne,!0)}function to(r){return Pt.echoes&&r&&r.constructor===Ze?(Kr(),r.then(function(i){return zn(),i},function(i){return zn(),Ct(i)})):r}function Fd(){var r=Qs[Qs.length-1];Qs.pop(),Gn(r,!1)}function Gn(r,i){var l,d,p=Ie;(i?!Pt.echoes||Zs++&&r===Ie:!Zs||--Zs&&r===Ie)||queueMicrotask(i?(function(v){++eo,Pt.echoes&&--Pt.echoes!=0||(Pt.echoes=Pt.awaits=Pt.id=0),Qs.push(Ie),Gn(v,!0)}).bind(null,r):Fd),r!==Ie&&(Ie=r,p===$t&&($t.env=ml()),yt)&&(l=$t.env.Promise,d=r.env,p.global||r.global)&&(Object.defineProperty(a,"Promise",d.PromiseProp),l.all=d.all,l.race=d.race,l.resolve=d.resolve,l.reject=d.reject,d.allSettled&&(l.allSettled=d.allSettled),d.any)&&(l.any=d.any)}function ml(){var r=a.Promise;return yt?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function mr(r,i,l,d,p){var v=Ie;try{return Gn(r,!0),i(l,d,p)}finally{Gn(v,!1)}}function yl(r,i,l,d){return typeof r!="function"?r:function(){var p=Ie;l&&Kr(),Gn(i,!0);try{return r.apply(this,arguments)}finally{Gn(p,!1),d&&queueMicrotask(zn)}}}function Ei(r){Promise===Ze&&Pt.echoes===0?Zs===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+Br).indexOf("[native code]")===-1&&(Kr=zn=_);var Ct=Se.reject,yr="",On="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",gl="String expected.",no="__dbnames",$i="readonly",Ai="readwrite";function gr(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var bl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ro(r){return typeof r!="string"||/\./.test(r)?function(i){return i}:function(i){return i[r]===void 0&&r in i&&delete(i=xe(i))[r],i}}function wl(){throw je.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function nt(r,i){try{var l=_l(r),d=_l(i);if(l!==d)return l==="Array"?1:d==="Array"?-1:l==="binary"?1:d==="binary"?-1:l==="string"?1:d==="string"?-1:l==="Date"?1:d!=="Date"?NaN:-1;switch(l){case"number":case"Date":case"string":return i<r?1:r<i?-1:0;case"binary":for(var p=kl(r),v=kl(i),g=p.length,b=v.length,A=g<b?g:b,V=0;V<A;++V)if(p[V]!==v[V])return p[V]<v[V]?-1:1;return g===b?0:g<b?-1:1;case"Array":for(var I=r,$=i,P=I.length,K=$.length,R=P<K?P:K,D=0;D<R;++D){var L=nt(I[D],$[D]);if(L!==0)return L}return P===K?0:P<K?-1:1}}catch{}return NaN}function _l(r){var i=typeof r;return i=="object"&&(ArrayBuffer.isView(r)||(i=rt(r))==="ArrayBuffer")?"binary":i}function kl(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}function so(r,i,l){var d=r.schema.yProps;return d?(i&&0<l.numFailures&&(i=i.filter(function(p,v){return!l.failures[v]})),Promise.all(d.map(function(p){return p=p.updatesTable,i?r.db.table(p).where("k").anyOf(i).delete():r.db.table(p).clear()})).then(function(){return l})):l}xl.prototype.execute=function(r){var i=this["@@propmod"];if(i.add!==void 0){var l=i.add;if(f(l))return o(o([],f(r)?r:[],!0),l).sort();if(typeof l=="number")return(Number(r)||0)+l;if(typeof l=="bigint")try{return BigInt(r)+l}catch{return BigInt(0)+l}throw new TypeError("Invalid term ".concat(l))}if(i.remove!==void 0){var d=i.remove;if(f(d))return f(r)?r.filter(function(p){return!d.includes(p)}).sort():[];if(typeof d=="number")return Number(r)-d;if(typeof d=="bigint")try{return BigInt(r)-d}catch{return BigInt(0)-d}throw new TypeError("Invalid subtrahend ".concat(d))}return l=(l=i.replacePrefix)==null?void 0:l[0],l&&typeof r=="string"&&r.startsWith(l)?i.replacePrefix[1]+r.substring(l.length):r};var ss=xl;function xl(r){this["@@propmod"]=r}function Cl(r,i){for(var l=u(i),d=l.length,p=!1,v=0;v<d;++v){var g=l[v],b=i[g],A=ie(r,g);b instanceof ss?(te(r,g,b.execute(A)),p=!0):A!==b&&(te(r,g,b),p=!0)}return p}pt.prototype._trans=function(r,i,l){var d=this._tx||Ie.trans,p=this.name,v=W&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function g(V,I,$){if($.schema[p])return i($.idbtrans,$);throw new je.NotFound("Table "+p+" not part of transaction")}var b=Rr();try{var A=d&&d.db._novip===this.db._novip?d===Ie.trans?d._promise(r,g,l):Wn(function(){return d._promise(r,g,l)},{trans:d,transless:Ie.transless||Ie}):function V(I,$,P,K){if(I.idbdb&&(I._state.openComplete||Ie.letThrough||I._vip)){var R=I._createTransaction($,P,I._dbSchema);try{R.create(),I._state.PR1398_maxLoop=3}catch(D){return D.name===Yt.InvalidState&&I.isOpen()&&0<--I._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),I.close({disableAutoOpen:!1}),I.open().then(function(){return V(I,$,P,K)})):Ct(D)}return R._promise($,function(D,L){return Wn(function(){return Ie.trans=R,K(D,L,R)})}).then(function(D){if($==="readwrite")try{R.idbtrans.commit()}catch{}return $==="readonly"?D:R._completion.then(function(){return D})})}if(I._state.openComplete)return Ct(new je.DatabaseClosed(I._state.dbOpenError));if(!I._state.isBeingOpened){if(!I._state.autoOpen)return Ct(new je.DatabaseClosed);I.open().catch(_)}return I._state.dbReadyPromise.then(function(){return V(I,$,P,K)})}(this.db,r,[this.name],g);return v&&(A._consoleTask=v,A=A.catch(function(V){return console.trace(V),Ct(V)})),A}finally{b&&Lr()}},pt.prototype.get=function(r,i){var l=this;return r&&r.constructor===Object?this.where(r).first(i):r==null?Ct(new je.Type("Invalid argument to Table.get()")):this._trans("readonly",function(d){return l.core.get({trans:d,key:r}).then(function(p){return l.hook.reading.fire(p)})}).then(i)},pt.prototype.where=function(r){if(typeof r=="string")return new this.db.WhereClause(this,r);if(f(r))return new this.db.WhereClause(this,"[".concat(r.join("+"),"]"));var i=u(r);if(i.length===1)return this.where(i[0]).equals(r[i[0]]);var l=this.schema.indexes.concat(this.schema.primKey).filter(function(b){if(b.compound&&i.every(function(V){return 0<=b.keyPath.indexOf(V)})){for(var A=0;A<i.length;++A)if(i.indexOf(b.keyPath[A])===-1)return!1;return!0}return!1}).sort(function(b,A){return b.keyPath.length-A.keyPath.length})[0];if(l&&this.db._maxKey!==yr)return g=l.keyPath.slice(0,i.length),this.where(g).equals(g.map(function(b){return r[b]}));!l&&W&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(i.join("+"),"]"));var d=this.schema.idxByName;function p(b,A){return nt(b,A)===0}var g=i.reduce(function(I,A){var V=I[0],I=I[1],$=d[A],P=r[A];return[V||$,V||!$?gr(I,$&&$.multi?function(K){return K=ie(K,A),f(K)&&K.some(function(R){return p(P,R)})}:function(K){return p(P,ie(K,A))}):I]},[null,null]),v=g[0],g=g[1];return v?this.where(v.name).equals(r[v.keyPath]).filter(g):l?this.filter(g):this.where(i).equals("")},pt.prototype.filter=function(r){return this.toCollection().and(r)},pt.prototype.count=function(r){return this.toCollection().count(r)},pt.prototype.offset=function(r){return this.toCollection().offset(r)},pt.prototype.limit=function(r){return this.toCollection().limit(r)},pt.prototype.each=function(r){return this.toCollection().each(r)},pt.prototype.toArray=function(r){return this.toCollection().toArray(r)},pt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},pt.prototype.orderBy=function(r){return new this.db.Collection(new this.db.WhereClause(this,f(r)?"[".concat(r.join("+"),"]"):r))},pt.prototype.reverse=function(){return this.toCollection().reverse()},pt.prototype.mapToClass=function(r){for(var i=this.db,l=this.name,d=((this.schema.mappedClass=r).prototype instanceof wl&&(r=(g=>{var b=I,A=g;if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function V(){this.constructor=b}function I(){return g!==null&&g.apply(this,arguments)||this}return n(b,A),b.prototype=A===null?Object.create(A):(V.prototype=A.prototype,new V),Object.defineProperty(I.prototype,"db",{get:function(){return i},enumerable:!1,configurable:!0}),I.prototype.table=function(){return l},I})(r)),new Set),p=r.prototype;p;p=y(p))Object.getOwnPropertyNames(p).forEach(function(g){return d.add(g)});function v(g){if(!g)return g;var b,A=Object.create(r.prototype);for(b in g)if(!d.has(b))try{A[b]=g[b]}catch{}return A}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=v,this.hook("reading",v),r},pt.prototype.defineClass=function(){return this.mapToClass(function(r){h(this,r)})},pt.prototype.add=function(r,i){var l=this,d=this.schema.primKey,p=d.auto,v=d.keyPath,g=r;return v&&p&&(g=ro(v)(r)),this._trans("readwrite",function(b){return l.core.mutate({trans:b,type:"add",keys:i!=null?[i]:null,values:[g]})}).then(function(b){return b.numFailures?Se.reject(b.failures[0]):b.lastResult}).then(function(b){if(v)try{te(r,v,b)}catch{}return b})},pt.prototype.upsert=function(r,i){var l=this,d=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return l.core.get({trans:p,key:r}).then(function(v){var g=v??{};return Cl(g,i),d&&te(g,d,r),l.core.mutate({trans:p,type:"put",values:[g],keys:[r],upsert:!0,updates:{keys:[r],changeSpecs:[i]}}).then(function(b){return b.numFailures?Se.reject(b.failures[0]):!!v})})})},pt.prototype.update=function(r,i){return typeof r!="object"||f(r)?this.where(":id").equals(r).modify(i):(r=ie(r,this.schema.primKey.keyPath))===void 0?Ct(new je.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(i)},pt.prototype.put=function(r,i){var l=this,d=this.schema.primKey,p=d.auto,v=d.keyPath,g=r;return v&&p&&(g=ro(v)(r)),this._trans("readwrite",function(b){return l.core.mutate({trans:b,type:"put",values:[g],keys:i!=null?[i]:null})}).then(function(b){return b.numFailures?Se.reject(b.failures[0]):b.lastResult}).then(function(b){if(v)try{te(r,v,b)}catch{}return b})},pt.prototype.delete=function(r){var i=this;return this._trans("readwrite",function(l){return i.core.mutate({trans:l,type:"delete",keys:[r]}).then(function(d){return so(i,[r],d)}).then(function(d){return d.numFailures?Se.reject(d.failures[0]):void 0})})},pt.prototype.clear=function(){var r=this;return this._trans("readwrite",function(i){return r.core.mutate({trans:i,type:"deleteRange",range:bl}).then(function(l){return so(r,null,l)})}).then(function(i){return i.numFailures?Se.reject(i.failures[0]):void 0})},pt.prototype.bulkGet=function(r){var i=this;return this._trans("readonly",function(l){return i.core.getMany({keys:r,trans:l}).then(function(d){return d.map(function(p){return i.hook.reading.fire(p)})})})},pt.prototype.bulkAdd=function(r,i,l){var d=this,p=Array.isArray(i)?i:void 0,v=(l=l||(p?void 0:i))?l.allKeys:void 0;return this._trans("readwrite",function(g){var b=d.schema.primKey,V=b.auto,b=b.keyPath;if(b&&p)throw new je.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new je.InvalidArgument("Arguments objects and keys must have the same length");var A=r.length,V=b&&V?r.map(ro(b)):r;return d.core.mutate({trans:g,type:"add",keys:p,values:V,wantResults:v}).then(function(I){var $=I.numFailures,P=I.failures;if($===0)return v?I.results:I.lastResult;throw new ft("".concat(d.name,".bulkAdd(): ").concat($," of ").concat(A," operations failed"),P)})})},pt.prototype.bulkPut=function(r,i,l){var d=this,p=Array.isArray(i)?i:void 0,v=(l=l||(p?void 0:i))?l.allKeys:void 0;return this._trans("readwrite",function(g){var b=d.schema.primKey,V=b.auto,b=b.keyPath;if(b&&p)throw new je.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new je.InvalidArgument("Arguments objects and keys must have the same length");var A=r.length,V=b&&V?r.map(ro(b)):r;return d.core.mutate({trans:g,type:"put",keys:p,values:V,wantResults:v}).then(function(I){var $=I.numFailures,P=I.failures;if($===0)return v?I.results:I.lastResult;throw new ft("".concat(d.name,".bulkPut(): ").concat($," of ").concat(A," operations failed"),P)})})},pt.prototype.bulkUpdate=function(r){var i=this,l=this.core,d=r.map(function(g){return g.key}),p=r.map(function(g){return g.changes}),v=[];return this._trans("readwrite",function(g){return l.getMany({trans:g,keys:d,cache:"clone"}).then(function(b){var A=[],V=[],I=(r.forEach(function($,P){var K=$.key,R=$.changes,D=b[P];if(D){for(var L=0,z=Object.keys(R);L<z.length;L++){var U=z[L],re=R[U];if(U===i.schema.primKey.keyPath){if(nt(re,K)!==0)throw new je.Constraint("Cannot update primary key in bulkUpdate()")}else te(D,U,re)}v.push(P),A.push(K),V.push(D)}}),A.length);return l.mutate({trans:g,type:"put",keys:A,values:V,updates:{keys:d,changeSpecs:p}}).then(function($){var P=$.numFailures,K=$.failures;if(P===0)return I;for(var R=0,D=Object.keys(K);R<D.length;R++){var L,z=D[R],U=v[Number(z)];U!=null&&(L=K[z],delete K[z],K[U]=L)}throw new ft("".concat(i.name,".bulkUpdate(): ").concat(P," of ").concat(I," operations failed"),K)})})})},pt.prototype.bulkDelete=function(r){var i=this,l=r.length;return this._trans("readwrite",function(d){return i.core.mutate({trans:d,type:"delete",keys:r}).then(function(p){return so(i,r,p)})}).then(function(d){var p=d.numFailures,v=d.failures;if(p===0)return d.lastResult;throw new ft("".concat(i.name,".bulkDelete(): ").concat(p," of ").concat(l," operations failed"),v)})};var Sl=pt;function pt(){}function os(r){function i(g,b){if(b){for(var A=arguments.length,V=new Array(A-1);--A;)V[A-1]=arguments[A];return l[g].subscribe.apply(null,V),r}if(typeof g=="string")return l[g]}var l={};i.addEventType=v;for(var d=1,p=arguments.length;d<p;++d)v(arguments[d]);return i;function v(g,b,A){var V,I;if(typeof g!="object")return b=b||le,I={subscribers:[],fire:A=A||_,subscribe:function($){I.subscribers.indexOf($)===-1&&(I.subscribers.push($),I.fire=b(I.fire,$))},unsubscribe:function($){I.subscribers=I.subscribers.filter(function(P){return P!==$}),I.fire=I.subscribers.reduce(b,A)}},l[g]=i[g]=I;u(V=g).forEach(function($){var P=V[$];if(f(P))v($,V[$][0],V[$][1]);else{if(P!=="asap")throw new je.InvalidArgument("Invalid event config");var K=v($,x,function(){for(var R=arguments.length,D=new Array(R);R--;)D[R]=arguments[R];K.subscribers.forEach(function(L){de(function(){L.apply(null,D)})})})}})}}function is(r,i){return B(i).from({prototype:r}),i}function Fr(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function Pi(r,i){r.filter=gr(r.filter,i)}function Ti(r,i,l){var d=r.replayFilter;r.replayFilter=d?function(){return gr(d(),i())}:i,r.justLimit=l&&!d}function oo(r,i){if(r.isPrimKey)return i.primaryKey;var l=i.getIndexByKeyPath(r.index);if(l)return l;throw new je.Schema("KeyPath "+r.index+" on object store "+i.name+" is not indexed")}function El(r,i,l){var d=oo(r,i.schema);return i.openCursor({trans:l,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:d,range:r.range}})}function io(r,i,l,d){var p,v,g=r.replayFilter?gr(r.filter,r.replayFilter()):r.filter;return r.or?(p={},v=function(b,A,V){var I,$;g&&!g(A,V,function(P){return A.stop(P)},function(P){return A.fail(P)})||(($=""+(I=A.primaryKey))=="[object ArrayBuffer]"&&($=""+new Uint8Array(I)),w(p,$))||(p[$]=!0,i(b,A,V))},Promise.all([r.or._iterate(v,l),$l(El(r,d,l),r.algorithm,v,!r.keysOnly&&r.valueMapper)])):$l(El(r,d,l),gr(r.algorithm,g),i,!r.keysOnly&&r.valueMapper)}function $l(r,i,l,d){var p=gt(d?function(v,g,b){return l(d(v),g,b)}:l);return r.then(function(v){if(v)return v.start(function(){var g=function(){return v.continue()};i&&!i(v,function(b){return g=b},function(b){v.stop(b),g=_},function(b){v.fail(b),g=_})||p(v.value,v,function(b){return g=b}),g()})})}st.prototype._read=function(r,i){var l=this._ctx;return l.error?l.table._trans(null,Ct.bind(null,l.error)):l.table._trans("readonly",r).then(i)},st.prototype._write=function(r){var i=this._ctx;return i.error?i.table._trans(null,Ct.bind(null,i.error)):i.table._trans("readwrite",r,"locked")},st.prototype._addAlgorithm=function(r){var i=this._ctx;i.algorithm=gr(i.algorithm,r)},st.prototype._iterate=function(r,i){return io(this._ctx,r,i,this._ctx.table.core)},st.prototype.clone=function(r){var i=Object.create(this.constructor.prototype),l=Object.create(this._ctx);return r&&h(l,r),i._ctx=l,i},st.prototype.raw=function(){return this._ctx.valueMapper=null,this},st.prototype.each=function(r){var i=this._ctx;return this._read(function(l){return io(i,r,l,i.table.core)})},st.prototype.count=function(r){var i=this;return this._read(function(l){var d,p=i._ctx,v=p.table.core;return Fr(p,!0)?v.count({trans:l,query:{index:oo(p,v.schema),range:p.range}}).then(function(g){return Math.min(g,p.limit)}):(d=0,io(p,function(){return++d,!1},l,v).then(function(){return d}))}).then(r)},st.prototype.sortBy=function(r,i){var l=r.split(".").reverse(),d=l[0],p=l.length-1;function v(A,V){return V?v(A[l[V]],V-1):A[d]}var g=this._ctx.dir==="next"?1:-1;function b(A,V){return nt(v(A,p),v(V,p))*g}return this.toArray(function(A){return A.slice().sort(b)}).then(i)},st.prototype.toArray=function(r){var i=this;return this._read(function(l){var d,p,v,g=i._ctx;return Fr(g,!0)&&0<g.limit?(d=g.valueMapper,p=oo(g,g.table.core.schema),g.table.core.query({trans:l,limit:g.limit,values:!0,direction:g.dir==="prev"?"prev":void 0,query:{index:p,range:g.range}}).then(function(b){return b=b.result,d?b.map(d):b})):(v=[],io(g,function(b){return v.push(b)},l,g.table.core).then(function(){return v}))},r)},st.prototype.offset=function(r){var i=this._ctx;return r<=0||(i.offset+=r,Fr(i)?Ti(i,function(){var l=r;return function(d,p){return l===0||(l===1?--l:p(function(){d.advance(l),l=0}),!1)}}):Ti(i,function(){var l=r;return function(){return--l<0}})),this},st.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),Ti(this._ctx,function(){var i=r;return function(l,d,p){return--i<=0&&d(p),0<=i}},!0),this},st.prototype.until=function(r,i){return Pi(this._ctx,function(l,d,p){return!r(l.value)||(d(p),i)}),this},st.prototype.first=function(r){return this.limit(1).toArray(function(i){return i[0]}).then(r)},st.prototype.last=function(r){return this.reverse().first(r)},st.prototype.filter=function(r){var i;return Pi(this._ctx,function(l){return r(l.value)}),(i=this._ctx).isMatch=gr(i.isMatch,r),this},st.prototype.and=function(r){return this.filter(r)},st.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},st.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},st.prototype.desc=function(){return this.reverse()},st.prototype.eachKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(l,d){r(d.key,d)})},st.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},st.prototype.eachPrimaryKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(l,d){r(d.primaryKey,d)})},st.prototype.keys=function(r){var i=this._ctx,l=(i.keysOnly=!i.isMatch,[]);return this.each(function(d,p){l.push(p.key)}).then(function(){return l}).then(r)},st.prototype.primaryKeys=function(r){var i=this._ctx;if(Fr(i,!0)&&0<i.limit)return this._read(function(d){var p=oo(i,i.table.core.schema);return i.table.core.query({trans:d,values:!1,limit:i.limit,direction:i.dir==="prev"?"prev":void 0,query:{index:p,range:i.range}})}).then(function(d){return d.result}).then(r);i.keysOnly=!i.isMatch;var l=[];return this.each(function(d,p){l.push(p.primaryKey)}).then(function(){return l}).then(r)},st.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},st.prototype.firstKey=function(r){return this.limit(1).keys(function(i){return i[0]}).then(r)},st.prototype.lastKey=function(r){return this.reverse().firstKey(r)},st.prototype.distinct=function(){var r,i=this._ctx,i=i.index&&i.table.schema.idxByName[i.index];return i&&i.multi&&(r={},Pi(this._ctx,function(d){var d=d.primaryKey.toString(),p=w(r,d);return r[d]=!0,!p})),this},st.prototype.modify=function(r){var i=this,l=this._ctx;return this._write(function(d){function p(D,L){var z=L.failures;P+=D-L.numFailures;for(var U=0,re=u(z);U<re.length;U++){var fe=re[U];$.push(z[fe])}}var v=typeof r=="function"?r:function(D){return Cl(D,r)},g=l.table.core,I=g.schema.primaryKey,b=I.outbound,A=I.extractKey,V=200,I=i.db._options.modifyChunkSize,$=(I&&(V=typeof I=="object"?I[g.name]||I["*"]||200:I),[]),P=0,K=[],R=r===Al;return i.clone().primaryKeys().then(function(D){function L(U){var re=Math.min(V,D.length-U),fe=D.slice(U,U+re);return(R?Promise.resolve([]):g.getMany({trans:d,keys:fe,cache:"immutable"})).then(function(he){var we=[],ye=[],Pe=b?[]:null,be=R?fe:[];if(!R)for(var Te=0;Te<re;++Te){var pe=he[Te],qe={value:xe(pe),primKey:D[U+Te]};v.call(qe,qe.value,qe)!==!1&&(qe.value==null?be.push(D[U+Te]):b||nt(A(pe),A(qe.value))===0?(ye.push(qe.value),b&&Pe.push(D[U+Te])):(be.push(D[U+Te]),we.push(qe.value)))}return Promise.resolve(0<we.length&&g.mutate({trans:d,type:"add",values:we}).then(function(He){for(var Je in He.failures)be.splice(parseInt(Je),1);p(we.length,He)})).then(function(){return(0<ye.length||z&&typeof r=="object")&&g.mutate({trans:d,type:"put",keys:Pe,values:ye,criteria:z,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<U}).then(function(He){return p(ye.length,He)})}).then(function(){return(0<be.length||z&&R)&&g.mutate({trans:d,type:"delete",keys:be,criteria:z,isAdditionalChunk:0<U}).then(function(He){return so(l.table,be,He)}).then(function(He){return p(be.length,He)})}).then(function(){return D.length>U+re&&L(U+V)})})}var z=Fr(l)&&l.limit===1/0&&(typeof r!="function"||R)&&{index:l.index,range:l.range};return L(0).then(function(){if(0<$.length)throw new Ve("Error modifying one or more objects",$,P,K);return D.length})})})},st.prototype.delete=function(){var r=this._ctx,i=r.range;return!Fr(r)||r.table.schema.yProps||!r.isPrimKey&&i.type!==3?this.modify(Al):this._write(function(l){var d=r.table.core.schema.primaryKey,p=i;return r.table.core.count({trans:l,query:{index:d,range:p}}).then(function(v){return r.table.core.mutate({trans:l,type:"deleteRange",range:p}).then(function(A){var b=A.failures,A=A.numFailures;if(A)throw new Ve("Could not delete some values",Object.keys(b).map(function(V){return b[V]}),v-A);return v-A})})})};var Nd=st;function st(){}var Al=function(r,i){return i.value=null};function Vd(r,i){return r<i?-1:r===i?0:1}function Bd(r,i){return i<r?-1:r===i?0:1}function en(r,i,l){return r=r instanceof Tl?new r.Collection(r):r,r._ctx.error=new(l||TypeError)(i),r}function Nr(r){return new r.Collection(r,function(){return Pl("")}).limit(0)}function ao(K,i,l,d){var p,v,g,b,A,V,I,$=l.length;if(!l.every(function(D){return typeof D=="string"}))return en(K,gl);function P(D){p=D==="next"?function(z){return z.toUpperCase()}:function(z){return z.toLowerCase()},v=D==="next"?function(z){return z.toLowerCase()}:function(z){return z.toUpperCase()},g=D==="next"?Vd:Bd;var L=l.map(function(z){return{lower:v(z),upper:p(z)}}).sort(function(z,U){return g(z.lower,U.lower)});b=L.map(function(z){return z.upper}),A=L.map(function(z){return z.lower}),I=(V=D)==="next"?"":d}P("next");var K=new K.Collection(K,function(){return Yn(b[0],A[$-1]+d)}),R=(K._ondirectionchange=function(D){P(D)},0);return K._addAlgorithm(function(D,L,z){var U=D.key;if(typeof U=="string"){var re=v(U);if(i(re,A,R))return!0;for(var fe=null,he=R;he<$;++he){var we=((ye,Pe,be,Te,pe,qe)=>{for(var He=Math.min(ye.length,Te.length),Je=-1,et=0;et<He;++et){var tn=Pe[et];if(tn!==Te[et])return pe(ye[et],be[et])<0?ye.substr(0,et)+be[et]+be.substr(et+1):pe(ye[et],Te[et])<0?ye.substr(0,et)+Te[et]+be.substr(et+1):0<=Je?ye.substr(0,Je)+Pe[Je]+be.substr(Je+1):null;pe(ye[et],tn)<0&&(Je=et)}return He<Te.length&&qe==="next"?ye+be.substr(ye.length):He<ye.length&&qe==="prev"?ye.substr(0,be.length):Je<0?null:ye.substr(0,Je)+Te[Je]+be.substr(Je+1)})(U,re,b[he],A[he],g,V);we===null&&fe===null?R=he+1:(fe===null||0<g(fe,we))&&(fe=we)}L(fe!==null?function(){D.continue(fe+I)}:z)}return!1}),K}function Yn(r,i,l,d){return{type:2,lower:r,upper:i,lowerOpen:l,upperOpen:d}}function Pl(r){return{type:1,lower:r,upper:r}}Object.defineProperty(Tt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Tt.prototype.between=function(r,i,l,d){l=l!==!1,d=d===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(l||d)&&(!l||!d)?Nr(this):new this.Collection(this,function(){return Yn(r,i,!l,!d)})}catch{return en(this,On)}},Tt.prototype.equals=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Pl(r)})},Tt.prototype.above=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(r,void 0,!0)})},Tt.prototype.aboveOrEqual=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(r,void 0,!1)})},Tt.prototype.below=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(void 0,r,!1,!0)})},Tt.prototype.belowOrEqual=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(void 0,r)})},Tt.prototype.startsWith=function(r){return typeof r!="string"?en(this,gl):this.between(r,r+yr,!0,!0)},Tt.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):ao(this,function(i,l){return i.indexOf(l[0])===0},[r],yr)},Tt.prototype.equalsIgnoreCase=function(r){return ao(this,function(i,l){return i===l[0]},[r],"")},Tt.prototype.anyOfIgnoreCase=function(){var r=Fe.apply(Me,arguments);return r.length===0?Nr(this):ao(this,function(i,l){return l.indexOf(i)!==-1},r,"")},Tt.prototype.startsWithAnyOfIgnoreCase=function(){var r=Fe.apply(Me,arguments);return r.length===0?Nr(this):ao(this,function(i,l){return l.some(function(d){return i.indexOf(d)===0})},r,yr)},Tt.prototype.anyOf=function(){var r,i,l=this,d=Fe.apply(Me,arguments),p=this._cmp;try{d.sort(p)}catch{return en(this,On)}return d.length===0?Nr(this):((r=new this.Collection(this,function(){return Yn(d[0],d[d.length-1])}))._ondirectionchange=function(v){p=v==="next"?l._ascending:l._descending,d.sort(p)},i=0,r._addAlgorithm(function(v,g,b){for(var A=v.key;0<p(A,d[i]);)if(++i===d.length)return g(b),!1;return p(A,d[i])===0||(g(function(){v.continue(d[i])}),!1)}),r)},Tt.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Tt.prototype.noneOf=function(){var r=Fe.apply(Me,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return en(this,On)}var i=r.reduce(function(l,d){return l?l.concat([[l[l.length-1][1],d]]):[[-1/0,d]]},null);return i.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(i,{includeLowers:!1,includeUppers:!1})},Tt.prototype.inAnyRange=function(r,z){var l=this,d=this._cmp,p=this._ascending,v=this._descending,g=this._min,b=this._max;if(r.length===0)return Nr(this);if(!r.every(function(U){return U[0]!==void 0&&U[1]!==void 0&&p(U[0],U[1])<=0}))return en(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",je.InvalidArgument);var A=!z||z.includeLowers!==!1,V=z&&z.includeUppers===!0,I,$=p;function P(U,re){return $(U[0],re[0])}try{(I=r.reduce(function(U,re){for(var fe=0,he=U.length;fe<he;++fe){var we=U[fe];if(d(re[0],we[1])<0&&0<d(re[1],we[0])){we[0]=g(we[0],re[0]),we[1]=b(we[1],re[1]);break}}return fe===he&&U.push(re),U},[])).sort(P)}catch{return en(this,On)}var K=0,R=V?function(U){return 0<p(U,I[K][1])}:function(U){return 0<=p(U,I[K][1])},D=A?function(U){return 0<v(U,I[K][0])}:function(U){return 0<=v(U,I[K][0])},L=R,z=new this.Collection(this,function(){return Yn(I[0][0],I[I.length-1][1],!A,!V)});return z._ondirectionchange=function(U){$=U==="next"?(L=R,p):(L=D,v),I.sort(P)},z._addAlgorithm(function(U,re,fe){for(var he,we=U.key;L(we);)if(++K===I.length)return re(fe),!1;return!R(he=we)&&!D(he)||(l._cmp(we,I[K][1])===0||l._cmp(we,I[K][0])===0||re(function(){$===p?U.continue(I[K][0]):U.continue(I[K][1])}),!1)}),z},Tt.prototype.startsWithAnyOf=function(){var r=Fe.apply(Me,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Nr(this):this.inAnyRange(r.map(function(i){return[i,i+yr]})):en(this,"startsWithAnyOf() only works with strings")};var Tl=Tt;function Tt(){}function fn(r){return gt(function(i){return as(i),r(i.target.error),!1})}function as(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var lo="storagemutated",Oi="x-storagemutated-1",Jn=os(null,lo),Ud=(yn.prototype._lock=function(){return X(!Ie.global),++this._reculock,this._reculock!==1||Ie.global||(Ie.lockOwnerFor=this),this},yn.prototype._unlock=function(){if(X(!Ie.global),--this._reculock==0)for(Ie.global||(Ie.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{mr(r[1],r[0])}catch{}}return this},yn.prototype._locked=function(){return this._reculock&&Ie.lockOwnerFor!==this},yn.prototype.create=function(r){var i=this;if(this.mode){var l=this.db.idbdb,d=this.db._state.dbOpenError;if(X(!this.idbtrans),!r&&!l)switch(d&&d.name){case"DatabaseClosedError":throw new je.DatabaseClosed(d);case"MissingAPIError":throw new je.MissingAPI(d.message,d);default:throw new je.OpenFailed(d)}if(!this.active)throw new je.TransactionInactive;X(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||l).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=gt(function(p){as(p),i._reject(r.error)}),r.onabort=gt(function(p){as(p),i.active&&i._reject(new je.Abort(r.error)),i.active=!1,i.on("abort").fire(p)}),r.oncomplete=gt(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&Jn.storagemutated.fire(r.mutatedParts)})}return this},yn.prototype._promise=function(r,i,l){var d,p=this;return r==="readwrite"&&this.mode!=="readwrite"?Ct(new je.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Se(function(v,g){p._blockedFuncs.push([function(){p._promise(r,i,l).then(v,g)},Ie])}):l?Wn(function(){var v=new Se(function(g,b){p._lock();var A=i(g,b,p);A&&A.then&&A.then(g,b)});return v.finally(function(){return p._unlock()}),v._lib=!0,v}):((d=new Se(function(v,g){var b=i(v,g,p);b&&b.then&&b.then(v,g)}))._lib=!0,d):Ct(new je.TransactionInactive)},yn.prototype._root=function(){return this.parent?this.parent._root():this},yn.prototype.waitFor=function(r){var i,l=this._root(),d=Se.resolve(r),p=(l._waitingFor?l._waitingFor=l._waitingFor.then(function(){return d}):(l._waitingFor=d,l._waitingQueue=[],i=l.idbtrans.objectStore(l.storeNames[0]),function v(){for(++l._spinCount;l._waitingQueue.length;)l._waitingQueue.shift()();l._waitingFor&&(i.get(-1/0).onsuccess=v)}()),l._waitingFor);return new Se(function(v,g){d.then(function(b){return l._waitingQueue.push(gt(v.bind(null,b)))},function(b){return l._waitingQueue.push(gt(g.bind(null,b)))}).finally(function(){l._waitingFor===p&&(l._waitingFor=null)})})},yn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new je.Abort))},yn.prototype.table=function(r){var i=this._memoizedTables||(this._memoizedTables={});if(w(i,r))return i[r];var l=this.schema[r];if(l)return(l=new this.db.Table(r,l,this)).core=this.db.core.table(r),i[r]=l;throw new je.NotFound("Table "+r+" not part of transaction")},yn);function yn(){}function Mi(r,i,l,d,p,v,g,b){return{name:r,keyPath:i,unique:l,multi:d,auto:p,compound:v,src:(l&&!g?"&":"")+(d?"*":"")+(p?"++":"")+Ol(i),type:b}}function Ol(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function Ii(r,i,l){return{name:r,primKey:i,indexes:l,mappedClass:null,idxByName:(d=function(p){return[p.name,p]},l.reduce(function(p,v,g){return v=d(v,g),v&&(p[v[0]]=v[1]),p},{}))};var d}var ls=function(r){try{return r.only([[]]),ls=function(){return[[]]},[[]]}catch{return ls=function(){return yr},yr}};function ji(r){return r==null?function(){}:typeof r=="string"?(i=r).split(".").length===1?function(l){return l[i]}:function(l){return ie(l,i)}:function(l){return ie(l,r)};var i}function Ml(r){return[].slice.call(r)}var qd=0;function us(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function Hd(r,i,g){function d(L){if(L.type===3)return null;if(L.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var K=L.lower,R=L.upper,D=L.lowerOpen,L=L.upperOpen;return K===void 0?R===void 0?null:i.upperBound(R,!!L):R===void 0?i.lowerBound(K,!!D):i.bound(K,R,!!D,!!L)}function p(P){var K,R,D=P.name;return{name:D,schema:P,mutate:function(L){var z=L.trans,U=L.type,re=L.keys,fe=L.values,he=L.range;return new Promise(function(we,ye){we=gt(we);var Pe=z.objectStore(D),be=Pe.keyPath==null,Te=U==="put"||U==="add";if(!Te&&U!=="delete"&&U!=="deleteRange")throw new Error("Invalid operation type: "+U);var pe,qe=(re||fe||{length:1}).length;if(re&&fe&&re.length!==fe.length)throw new Error("Given keys array must have same length as given values array.");if(qe===0)return we({numFailures:0,failures:{},results:[],lastResult:void 0});function He(Ut){++tn,as(Ut)}var Je=[],et=[],tn=0;if(U==="deleteRange"){if(he.type===4)return we({numFailures:tn,failures:et,results:[],lastResult:void 0});he.type===3?Je.push(pe=Pe.clear()):Je.push(pe=Pe.delete(d(he)))}else{var be=Te?be?[fe,re]:[fe,null]:[re,null],ze=be[0],Rt=be[1];if(Te)for(var Lt=0;Lt<qe;++Lt)Je.push(pe=Rt&&Rt[Lt]!==void 0?Pe[U](ze[Lt],Rt[Lt]):Pe[U](ze[Lt])),pe.onerror=He;else for(Lt=0;Lt<qe;++Lt)Je.push(pe=Pe[U](ze[Lt])),pe.onerror=He}function _o(Ut){Ut=Ut.target.result,Je.forEach(function(_r,Qi){return _r.error!=null&&(et[Qi]=_r.error)}),we({numFailures:tn,failures:et,results:U==="delete"?re:Je.map(function(_r){return _r.result}),lastResult:Ut})}pe.onerror=function(Ut){He(Ut),_o(Ut)},pe.onsuccess=_o})},getMany:function(L){var z=L.trans,U=L.keys;return new Promise(function(re,fe){re=gt(re);for(var he,we=z.objectStore(D),ye=U.length,Pe=new Array(ye),be=0,Te=0,pe=function(Je){Je=Je.target,Pe[Je._pos]=Je.result,++Te===be&&re(Pe)},qe=fn(fe),He=0;He<ye;++He)U[He]!=null&&((he=we.get(U[He]))._pos=He,he.onsuccess=pe,he.onerror=qe,++be);be===0&&re(Pe)})},get:function(L){var z=L.trans,U=L.key;return new Promise(function(re,fe){re=gt(re);var he=z.objectStore(D).get(U);he.onsuccess=function(we){return re(we.target.result)},he.onerror=fn(fe)})},query:(K=A,R=V,function(L){return new Promise(function(z,U){z=gt(z);var re,fe,he,we,qe=L.trans,ye=L.values,Pe=L.limit,pe=L.query,be=(be=L.direction)!=null?be:"next",Te=Pe===1/0?void 0:Pe,He=pe.index,pe=pe.range,qe=qe.objectStore(D),qe=He.isPrimaryKey?qe:qe.index(He.name),He=d(pe);if(Pe===0)return z({result:[]});R?(pe={query:He,count:Te,direction:be},(re=ye?qe.getAll(pe):qe.getAllKeys(pe)).onsuccess=function(Je){return z({result:Je.target.result})},re.onerror=fn(U)):K&&be==="next"?((re=ye?qe.getAll(He,Te):qe.getAllKeys(He,Te)).onsuccess=function(Je){return z({result:Je.target.result})},re.onerror=fn(U)):(fe=0,he=!ye&&"openKeyCursor"in qe?qe.openKeyCursor(He,be):qe.openCursor(He,be),we=[],he.onsuccess=function(){var Je=he.result;return!Je||(we.push(ye?Je.value:Je.primaryKey),++fe===Pe)?z({result:we}):void Je.continue()},he.onerror=fn(U))})}),openCursor:function(L){var z=L.trans,U=L.values,re=L.query,fe=L.reverse,he=L.unique;return new Promise(function(we,ye){we=gt(we);var Te=re.index,Pe=re.range,be=z.objectStore(D),be=Te.isPrimaryKey?be:be.index(Te.name),Te=fe?he?"prevunique":"prev":he?"nextunique":"next",pe=!U&&"openKeyCursor"in be?be.openKeyCursor(d(Pe),Te):be.openCursor(d(Pe),Te);pe.onerror=fn(ye),pe.onsuccess=gt(function(qe){var He,Je,et,tn,ze=pe.result;ze?(ze.___id=++qd,ze.done=!1,He=ze.continue.bind(ze),Je=(Je=ze.continuePrimaryKey)&&Je.bind(ze),et=ze.advance.bind(ze),tn=function(){throw new Error("Cursor not stopped")},ze.trans=z,ze.stop=ze.continue=ze.continuePrimaryKey=ze.advance=function(){throw new Error("Cursor not started")},ze.fail=gt(ye),ze.next=function(){var Rt=this,Lt=1;return this.start(function(){return Lt--?Rt.continue():Rt.stop()}).then(function(){return Rt})},ze.start=function(Rt){function Lt(){if(pe.result)try{Rt()}catch(Ut){ze.fail(Ut)}else ze.done=!0,ze.start=function(){throw new Error("Cursor behind last entry")},ze.stop()}var _o=new Promise(function(Ut,_r){Ut=gt(Ut),pe.onerror=fn(_r),ze.fail=_r,ze.stop=function(Qi){ze.stop=ze.continue=ze.continuePrimaryKey=ze.advance=tn,Ut(Qi)}});return pe.onsuccess=gt(function(Ut){pe.onsuccess=Lt,Lt()}),ze.continue=He,ze.continuePrimaryKey=Je,ze.advance=et,Lt(),_o},we(ze)):we(null)},ye)})},count:function(L){var z=L.query,U=L.trans,re=z.index,fe=z.range;return new Promise(function(he,we){var ye=U.objectStore(D),ye=re.isPrimaryKey?ye:ye.index(re.name),Pe=d(fe),Pe=Pe?ye.count(Pe):ye.count();Pe.onsuccess=gt(function(be){return he(be.target.result)}),Pe.onerror=fn(we)})}}}v=g,b=Ml((g=r).objectStoreNames),I=0<b.length?v.objectStore(b[0]):{};var v,g={schema:{name:g.name,tables:b.map(function(P){return v.objectStore(P)}).map(function(P){var K=P.keyPath,R=P.autoIncrement,L=f(K),D={},L={name:P.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:K==null,compound:L,keyPath:K,autoIncrement:R,unique:!0,extractKey:ji(K)},indexes:Ml(P.indexNames).map(function(z){return P.index(z)}).map(function(fe){var he=fe.name,U=fe.unique,re=fe.multiEntry,fe=fe.keyPath,he={name:he,compound:f(fe),keyPath:fe,unique:U,multiEntry:re,extractKey:ji(fe)};return D[us(fe)]=he}),getIndexByKeyPath:function(z){return D[us(z)]}};return D[":id"]=L.primaryKey,K!=null&&(D[us(K)]=L.primaryKey),L})},hasGetAll:0<b.length&&"getAll"in I&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in I},b=g.schema,A=g.hasGetAll,V=g.hasIdb3Features,I=b.tables.map(p),$={};return I.forEach(function(P){return $[P.name]=P}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(P){if($[P])return $[P];throw new Error("Table '".concat(P,"' not found"))},MIN_KEY:-1/0,MAX_KEY:ls(i),schema:b}}function Wd(r,i,l,d){return l=l.IDBKeyRange,i=Hd(i,l,d),{dbcore:r.dbcore.reduce(function(p,v){return v=v.create,s(s({},p),v(p))},i)}}function uo(r,i){var l=i.db,l=Wd(r._middlewares,l,r._deps,i);r.core=l.dbcore,r.tables.forEach(function(d){var p=d.name;r.core.schema.tables.some(function(v){return v.name===p})&&(d.core=r.core.table(p),r[p]instanceof r.Table)&&(r[p].core=d.core)})}function co(r,i,l,d){l.forEach(function(p){var v=d[p];i.forEach(function(g){var b=function A(V,I){return oe(V,I)||(V=y(V))&&A(V,I)}(g,p);(!b||"value"in b&&b.value===void 0)&&(g===r.Transaction.prototype||g instanceof r.Transaction?M(g,p,{get:function(){return this.table(p)},set:function(A){S(this,p,{value:A,writable:!0,configurable:!0,enumerable:!0})}}):g[p]=new r.Table(p,v))})})}function Di(r,i){i.forEach(function(l){for(var d in l)l[d]instanceof r.Table&&delete l[d]})}function zd(r,i){return r._cfg.version-i._cfg.version}function Gd(r,i,l,d){var p=r._dbSchema,v=(l.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=Ii("$meta",jl("")[0],[]),r._storeNames.push("$meta")),r._createTransaction("readwrite",r._storeNames,p)),g=(v.create(l),v._completion.catch(d),v._reject.bind(v)),b=Ie.transless||Ie;Wn(function(){if(Ie.trans=v,Ie.transless=b,i!==0)return uo(r,l),V=i,((A=v).storeNames.includes("$meta")?A.table("$meta").get("version").then(function(I){return I??V}):Se.resolve(V)).then(function(L){var $=r,P=L,K=v,R=l,D=[],L=$._versions,z=$._dbSchema=po(0,$.idbdb,R);return(L=L.filter(function(U){return U._cfg.version>=P})).length===0?Se.resolve():(L.forEach(function(U){D.push(function(){var re,fe,he,we=z,ye=U._cfg.dbschema,Pe=(ho($,we,R),ho($,ye,R),z=$._dbSchema=ye,Ri(we,ye)),be=(Pe.add.forEach(function(Te){Li(R,Te[0],Te[1].primKey,Te[1].indexes)}),Pe.change.forEach(function(Te){if(Te.recreate)throw new je.Upgrade("Not yet support for changing primary key");var pe=R.objectStore(Te.name);Te.add.forEach(function(qe){return fo(pe,qe)}),Te.change.forEach(function(qe){pe.deleteIndex(qe.name),fo(pe,qe)}),Te.del.forEach(function(qe){return pe.deleteIndex(qe)})}),U._cfg.contentUpgrade);if(be&&U._cfg.version>P)return uo($,R),K._memoizedTables={},re=O(ye),Pe.del.forEach(function(Te){re[Te]=we[Te]}),Di($,[$.Transaction.prototype]),co($,[$.Transaction.prototype],u(re),re),K.schema=re,(fe=De(be))&&Kr(),ye=Se.follow(function(){var Te;(he=be(K))&&fe&&(Te=zn.bind(null,null),he.then(Te,Te))}),he&&typeof he.then=="function"?Se.resolve(he):ye.then(function(){return he})}),D.push(function(re){var fe,he,we=U._cfg.dbschema;fe=we,he=re,[].slice.call(he.db.objectStoreNames).forEach(function(ye){return fe[ye]==null&&he.db.deleteObjectStore(ye)}),Di($,[$.Transaction.prototype]),co($,[$.Transaction.prototype],$._storeNames,$._dbSchema),K.schema=$._dbSchema}),D.push(function(re){$.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil($.idbdb.version/10)===U._cfg.version?($.idbdb.deleteObjectStore("$meta"),delete $._dbSchema.$meta,$._storeNames=$._storeNames.filter(function(fe){return fe!=="$meta"})):re.objectStore("$meta").put(U._cfg.version,"version"))})}),function U(){return D.length?Se.resolve(D.shift()(K.idbtrans)).then(U):Se.resolve()}().then(function(){Il(z,R)}))}).catch(g);var A,V;u(p).forEach(function(I){Li(l,I,p[I].primKey,p[I].indexes)}),uo(r,l),Se.follow(function(){return r.on.populate.fire(v)}).catch(g)})}function Yd(r,i){Il(r._dbSchema,i),i.db.version%10!=0||i.objectStoreNames.contains("$meta")||i.db.createObjectStore("$meta").add(Math.ceil(i.db.version/10-1),"version");var l=po(0,r.idbdb,i);ho(r,r._dbSchema,i);for(var d=0,p=Ri(l,r._dbSchema).change;d<p.length;d++){var v=(g=>{if(g.change.length||g.recreate)return console.warn("Unable to patch indexes of table ".concat(g.name," because it has changes on the type of index or primary key.")),{value:void 0};var b=i.objectStore(g.name);g.add.forEach(function(A){W&&console.debug("Dexie upgrade patch: Creating missing index ".concat(g.name,".").concat(A.src)),fo(b,A)})})(p[d]);if(typeof v=="object")return v.value}}function Ri(r,i){var l,d={del:[],add:[],change:[]};for(l in r)i[l]||d.del.push(l);for(l in i){var p=r[l],v=i[l];if(p){var g={name:l,def:v,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(v.primKey.keyPath||"")||p.primKey.auto!==v.primKey.auto)g.recreate=!0,d.change.push(g);else{var b=p.idxByName,A=v.idxByName,V=void 0;for(V in b)A[V]||g.del.push(V);for(V in A){var I=b[V],$=A[V];I?I.src!==$.src&&g.change.push($):g.add.push($)}(0<g.del.length||0<g.add.length||0<g.change.length)&&d.change.push(g)}}else d.add.push([l,v])}return d}function Li(r,i,l,d){var p=r.db.createObjectStore(i,l.keyPath?{keyPath:l.keyPath,autoIncrement:l.auto}:{autoIncrement:l.auto});d.forEach(function(v){return fo(p,v)})}function Il(r,i){u(r).forEach(function(l){i.db.objectStoreNames.contains(l)||(W&&console.debug("Dexie: Creating missing table",l),Li(i,l,r[l].primKey,r[l].indexes))})}function fo(r,i){r.createIndex(i.name,i.keyPath,{unique:i.unique,multiEntry:i.multi})}function po(r,i,l){var d={};return T(i.objectStoreNames,0).forEach(function(p){for(var v=l.objectStore(p),g=Mi(Ol(V=v.keyPath),V||"",!0,!1,!!v.autoIncrement,V&&typeof V!="string",!0),b=[],A=0;A<v.indexNames.length;++A){var I=v.index(v.indexNames[A]),V=I.keyPath,I=Mi(I.name,V,!!I.unique,!!I.multiEntry,!1,V&&typeof V!="string",!1);b.push(I)}d[p]=Ii(p,g,b)}),d}function ho(r,i,l){for(var d=l.db.objectStoreNames,p=0;p<d.length;++p){var v=d[p],g=l.objectStore(v);r._hasGetAll="getAll"in g;for(var b=0;b<g.indexNames.length;++b){var A,V=g.indexNames[b],I=g.index(V).keyPath,I=typeof I=="string"?I:"["+T(I).join("+")+"]";i[v]&&(A=i[v].idxByName[I])&&(A.name=V,delete i[v].idxByName[I],i[v].idxByName[V]=A)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function jl(r){return r.split(",").map(function(i,l){var p=i.split(":"),d=(d=p[1])==null?void 0:d.trim(),p=(i=p[0].trim()).replace(/([&*]|\+\+)/g,""),v=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return Mi(p,v||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),f(v),l===0,d)})}Vr.prototype._createTableSchema=Ii,Vr.prototype._parseIndexSyntax=jl,Vr.prototype._parseStoresSpec=function(r,i){var l=this;u(r).forEach(function(d){if(r[d]!==null){var p=l._parseIndexSyntax(r[d]),v=p.shift();if(!v)throw new je.Schema("Invalid schema for table "+d+": "+r[d]);if(v.unique=!0,v.multi)throw new je.Schema("Primary key cannot be multiEntry*");p.forEach(function(g){if(g.auto)throw new je.Schema("Only primary key can be marked as autoIncrement (++)");if(!g.keyPath)throw new je.Schema("Index must have a name and cannot be an empty string")}),v=l._createTableSchema(d,v,p),i[d]=v}})},Vr.prototype.stores=function(l){var i=this.db,l=(this._cfg.storesSource=this._cfg.storesSource?h(this._cfg.storesSource,l):l,i._versions),d={},p={};return l.forEach(function(v){h(d,v._cfg.storesSource),p=v._cfg.dbschema={},v._parseStoresSpec(d,p)}),i._dbSchema=p,Di(i,[i._allTables,i,i.Transaction.prototype]),co(i,[i._allTables,i,i.Transaction.prototype,this._cfg.tables],u(p),p),i._storeNames=u(p),this},Vr.prototype.upgrade=function(r){return this._cfg.contentUpgrade=H(this._cfg.contentUpgrade||_,r),this};var Jd=Vr;function Vr(){}var cs=(()=>{var r,i,l;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(r=new Set,i=new FinalizationRegistry(function(d){r.delete(d)}),{toArray:function(){return Array.from(r).map(function(d){return d.deref()}).filter(function(d){return d!==void 0})},add:function(d){var p=new WeakRef(d._novip);r.add(p),i.register(d._novip,p,p),r.size>d._options.maxConnections&&(p=r.values().next().value,r.delete(p),i.unregister(p))},remove:function(d){if(d)for(var p=r.values(),v=p.next();!v.done;){var g=v.value;if(g.deref()===d._novip)return r.delete(g),void i.unregister(g);v=p.next()}}}):(l=[],{toArray:function(){return l},add:function(d){l.push(d._novip)},remove:function(d){d&&(d=l.indexOf(d._novip))!==-1&&l.splice(d,1)}})})();function Ki(r,i){var l=r._dbNamesDB;return l||(l=r._dbNamesDB=new Mn(no,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),l.table("dbnames")}function Fi(r){return r&&typeof r.databases=="function"}function Ni(r){return Wn(function(){return Ie.letThrough=!0,r()})}function Vi(r){return!("from"in r)}var Dt=function(r,i){var l;if(!this)return l=new Dt,r&&"d"in r&&h(l,r),l;h(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function ds(r,i,l){var d=nt(i,l);if(!isNaN(d)){if(0<d)throw RangeError();if(Vi(r))return h(r,{from:i,to:l,d:1});var d=r.l,p=r.r;if(nt(l,r.from)<0)return d?ds(d,i,l):r.l={from:i,to:l,d:1,l:null,r:null},Rl(r);if(0<nt(i,r.to))return p?ds(p,i,l):r.r={from:i,to:l,d:1,l:null,r:null},Rl(r);nt(i,r.from)<0&&(r.from=i,r.l=null,r.d=p?p.d+1:1),0<nt(l,r.to)&&(r.to=l,r.r=null,r.d=r.l?r.l.d+1:1),i=!r.r,d&&!r.l&&fs(r,d),p&&i&&fs(r,p)}}function fs(r,i){Vi(i)||function l(d,p){var v=p.from,g=p.l,b=p.r;ds(d,v,p.to),g&&l(d,g),b&&l(d,b)}(r,i)}function Dl(r,i){var l=vo(i),d=l.next();if(!d.done)for(var p=d.value,v=vo(r),g=v.next(p.from),b=g.value;!d.done&&!g.done;){if(nt(b.from,p.to)<=0&&0<=nt(b.to,p.from))return!0;nt(p.from,b.from)<0?p=(d=l.next(b.from)).value:b=(g=v.next(p.from)).value}return!1}function vo(r){var i=Vi(r)?null:{s:0,n:r};return{next:function(l){for(var d=0<arguments.length;i;)switch(i.s){case 0:if(i.s=1,d)for(;i.n.l&&nt(l,i.n.from)<0;)i={up:i,n:i.n.l,s:1};else for(;i.n.l;)i={up:i,n:i.n.l,s:1};case 1:if(i.s=2,!d||nt(l,i.n.to)<=0)return{value:i.n,done:!1};case 2:if(i.n.r){i.s=3,i={up:i,n:i.n.r,s:0};continue}case 3:i=i.up}return{done:!0}}}}function Rl(r){var i,l,d,p=(((p=r.r)==null?void 0:p.d)||0)-(((p=r.l)==null?void 0:p.d)||0),p=1<p?"r":p<-1?"l":"";p&&(i=p=="r"?"l":"r",l=s({},r),d=r[p],r.from=d.from,r.to=d.to,r[p]=d[p],l[p]=d[i],(r[i]=l).d=Ll(l)),r.d=Ll(r)}function Ll(l){var i=l.r,l=l.l;return(i?l?Math.max(i.d,l.d):i.d:l?l.d:0)+1}function mo(r,i){return u(i).forEach(function(l){r[l]?fs(r[l],i[l]):r[l]=function d(p){var v,g,b={};for(v in p)w(p,v)&&(g=p[v],b[v]=!g||typeof g!="object"||ke.has(g.constructor)?g:d(g));return b}(i[l])}),r}function Bi(r,i){return r.all||i.all||Object.keys(r).some(function(l){return i[l]&&Dl(i[l],r[l])})}C(Dt.prototype,((Xe={add:function(r){return fs(this,r),this},addKey:function(r){return ds(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(l){return ds(i,l,l)}),this},hasKey:function(r){var i=vo(this).next(r).value;return i&&nt(i.from,r)<=0&&0<=nt(i.to,r)}})[We]=function(){return vo(this)},Xe));var br={},Ui={},qi=!1;function yo(r){mo(Ui,r),qi||(qi=!0,setTimeout(function(){qi=!1,Hi(Ui,!(Ui={}))},0))}function Hi(r,i){i===void 0&&(i=!1);var l=new Set;if(r.all)for(var d=0,p=Object.values(br);d<p.length;d++)Kl(b=p[d],r,l,i);else for(var v in r){var g,b,v=/^idb\:\/\/(.*)\/(.*)\//.exec(v);v&&(g=v[1],v=v[2],b=br["idb://".concat(g,"/").concat(v)])&&Kl(b,r,l,i)}l.forEach(function(A){return A()})}function Kl(r,i,l,d){for(var p=[],v=0,g=Object.entries(r.queries.query);v<g.length;v++){for(var b=g[v],A=b[0],V=[],I=0,$=b[1];I<$.length;I++){var P=$[I];Bi(i,P.obsSet)?P.subscribers.forEach(function(L){return l.add(L)}):d&&V.push(P)}d&&p.push([A,V])}if(d)for(var K=0,R=p;K<R.length;K++){var D=R[K],A=D[0],V=D[1];r.queries.query[A]=V}}function Xd(r){var i=r._state,l=r._deps.indexedDB;if(i.isBeingOpened||r.idbdb)return i.dbReadyPromise.then(function(){return i.dbOpenError?Ct(i.dbOpenError):r});i.isBeingOpened=!0,i.dbOpenError=null,i.openComplete=!1;var d=i.openCanceller,p=Math.round(10*r.verno),v=!1;function g(){if(i.openCanceller!==d)throw new je.DatabaseClosed("db.open() was cancelled")}function b(){return new Se(function(P,K){if(g(),!l)throw new je.MissingAPI;var R=r.name,D=i.autoSchema||!p?l.open(R):l.open(R,p);if(!D)throw new je.MissingAPI;D.onerror=fn(K),D.onblocked=gt(r._fireOnBlocked),D.onupgradeneeded=gt(function(L){var z;I=D.transaction,i.autoSchema&&!r._options.allowEmptyDB?(D.onerror=as,I.abort(),D.result.close(),(z=l.deleteDatabase(R)).onsuccess=z.onerror=gt(function(){K(new je.NoSuchDatabase("Database ".concat(R," doesnt exist")))})):(I.onerror=fn(K),z=L.oldVersion>Math.pow(2,62)?0:L.oldVersion,$=z<1,r.idbdb=D.result,v&&Yd(r,I),Gd(r,z/10,I,K))},K),D.onsuccess=gt(function(){I=null;var L,z,U,re,fe,he,we=r.idbdb=D.result,ye=T(we.objectStoreNames);if(0<ye.length)try{var Pe=we.transaction((fe=ye).length===1?fe[0]:fe,"readonly");if(i.autoSchema)he=we,re=Pe,(U=r).verno=he.version/10,re=U._dbSchema=po(0,he,re),U._storeNames=T(he.objectStoreNames,0),co(U,[U._allTables],u(re),re);else if(ho(r,r._dbSchema,Pe),z=Pe,((z=Ri(po(0,(L=r).idbdb,z),L._dbSchema)).add.length||z.change.some(function(be){return be.add.length||be.change.length}))&&!v)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),we.close(),p=we.version+1,v=!0,P(b());uo(r,Pe)}catch{}cs.add(r),we.onversionchange=gt(function(be){i.vcFired=!0,r.on("versionchange").fire(be)}),we.onclose=gt(function(){r.close({disableAutoOpen:!1})}),$&&(ye=r._deps,fe=R,Fi(he=ye.indexedDB)||fe===no||Ki(he,ye.IDBKeyRange).put({name:fe}).catch(_)),P()},K)}).catch(function(P){switch(P==null?void 0:P.name){case"UnknownError":if(0<i.PR1398_maxLoop)return i.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),b();break;case"VersionError":if(0<p)return p=0,b()}return Se.reject(P)})}var A,V=i.dbReadyResolve,I=null,$=!1;return Se.race([d,(typeof navigator>"u"?Se.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(P){function K(){return indexedDB.databases().finally(P)}A=setInterval(K,100),K()}).finally(function(){return clearInterval(A)}):Promise.resolve()).then(b)]).then(function(){return g(),i.onReadyBeingFired=[],Se.resolve(Ni(function(){return r.on.ready.fire(r.vip)})).then(function P(){var K;if(0<i.onReadyBeingFired.length)return K=i.onReadyBeingFired.reduce(H,_),i.onReadyBeingFired=[],Se.resolve(Ni(function(){return K(r.vip)})).then(P)})}).finally(function(){i.openCanceller===d&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(P){i.dbOpenError=P;try{I&&I.abort()}catch{}return d===i.openCanceller&&r._close(),Ct(P)}).finally(function(){i.openComplete=!0,V()}).then(function(){var P;return $&&(P={},r.tables.forEach(function(K){K.schema.indexes.forEach(function(R){R.name&&(P["idb://".concat(r.name,"/").concat(K.name,"/").concat(R.name)]=new Dt(-1/0,[[[]]]))}),P["idb://".concat(r.name,"/").concat(K.name,"/")]=P["idb://".concat(r.name,"/").concat(K.name,"/:dels")]=new Dt(-1/0,[[[]]])}),Jn(lo).fire(P),Hi(P,!0)),r})}function Wi(r){function i(v){return r.next(v)}var l=p(i),d=p(function(v){return r.throw(v)});function p(v){return function(b){var b=v(b),A=b.value;return b.done?A:A&&typeof A.then=="function"?A.then(l,d):f(A)?Promise.all(A).then(l,d):l(A)}}return p(i)()}function go(r,i,l){for(var d=f(r)?r.slice():[r],p=0;p<l;++p)d.push(i);return d}var Qd={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return s(s({},r),{table:function(d){var l=r.table(d),d=l.schema,p=Object.create(null),v=[];function g(P,K,R){var U=us(P),D=p[U]=p[U]||[],L=P==null?0:typeof P=="string"?1:P.length,z=0<K,U=s(s({},R),{name:z?"".concat(U,"(virtual-from:").concat(R.name,")"):R.name,lowLevelIndex:R,isVirtual:z,keyTail:K,keyLength:L,extractKey:ji(P),unique:!z&&R.unique});return D.push(U),U.isPrimaryKey||v.push(U),1<L&&g(L===2?P[0]:P.slice(0,L-1),K+1,R),D.sort(function(re,fe){return re.keyTail-fe.keyTail}),U}var b=g(d.primaryKey.keyPath,0,d.primaryKey);p[":id"]=[b];for(var A=0,V=d.indexes;A<V.length;A++){var I=V[A];g(I.keyPath,0,I)}function $(P){var K,R=P.query.index;return R.isVirtual?s(s({},P),{query:{index:R.lowLevelIndex,range:(K=P.query.range,R=R.keyTail,{type:K.type===1?2:K.type,lower:go(K.lower,K.lowerOpen?r.MAX_KEY:r.MIN_KEY,R),lowerOpen:!0,upper:go(K.upper,K.upperOpen?r.MIN_KEY:r.MAX_KEY,R),upperOpen:!0})}}):P}return s(s({},l),{schema:s(s({},d),{primaryKey:b,indexes:v,getIndexByKeyPath:function(P){return(P=p[us(P)])&&P[0]}}),count:function(P){return l.count($(P))},query:function(P){return l.query($(P))},openCursor:function(P){var K=P.query.index,R=K.keyTail,D=K.keyLength;return K.isVirtual?l.openCursor($(P)).then(function(z){return z&&L(z)}):l.openCursor(P);function L(z){return Object.create(z,{continue:{value:function(U){U!=null?z.continue(go(U,P.reverse?r.MAX_KEY:r.MIN_KEY,R)):P.unique?z.continue(z.key.slice(0,D).concat(P.reverse?r.MIN_KEY:r.MAX_KEY,R)):z.continue()}},continuePrimaryKey:{value:function(U,re){z.continuePrimaryKey(go(U,r.MAX_KEY,R),re)}},primaryKey:{get:function(){return z.primaryKey}},key:{get:function(){var U=z.key;return D===1?U[0]:U.slice(0,D)}},value:{get:function(){return z.value}}})}}})}})}};function zi(r,i,l,d){return l=l||{},d=d||"",u(r).forEach(function(p){var v,g,b;w(i,p)?(v=r[p],g=i[p],typeof v=="object"&&typeof g=="object"&&v&&g?(b=rt(v))!==rt(g)?l[d+p]=i[p]:b==="Object"?zi(v,g,l,d+p+"."):v!==g&&(l[d+p]=i[p]):v!==g&&(l[d+p]=i[p])):l[d+p]=void 0}),u(i).forEach(function(p){w(r,p)||(l[d+p]=i[p])}),l}function Gi(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var Zd={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return s(s({},r),{table:function(i){var l=r.table(i),d=l.schema.primaryKey;return s(s({},l),{mutate:function(p){var v=Ie.trans,g=v.table(i).hook,b=g.deleting,A=g.creating,V=g.updating;switch(p.type){case"add":if(A.fire===_)break;return v._promise("readwrite",function(){return I(p)},!0);case"put":if(A.fire===_&&V.fire===_)break;return v._promise("readwrite",function(){return I(p)},!0);case"delete":if(b.fire===_)break;return v._promise("readwrite",function(){return I(p)},!0);case"deleteRange":if(b.fire===_)break;return v._promise("readwrite",function(){return function $(P,K,R){return l.query({trans:P,values:!1,query:{index:d,range:K},limit:R}).then(function(D){var L=D.result;return I({type:"delete",keys:L,trans:P}).then(function(z){return 0<z.numFailures?Promise.reject(z.failures[0]):L.length<R?{failures:[],numFailures:0,lastResult:void 0}:$(P,s(s({},K),{lower:L[L.length-1],lowerOpen:!0}),R)})})}(p.trans,p.range,1e4)},!0)}return l.mutate(p);function I($){var P,K,R,D=Ie.trans,L=$.keys||Gi(d,$);if(L)return($=$.type==="add"||$.type==="put"?s(s({},$),{keys:L}):s({},$)).type!=="delete"&&($.values=o([],$.values)),$.keys&&($.keys=o([],$.keys)),P=l,R=L,((K=$).type==="add"?Promise.resolve([]):P.getMany({trans:K.trans,keys:R,cache:"immutable"})).then(function(z){var U=L.map(function(re,fe){var he,we,ye,Pe=z[fe],be={onerror:null,onsuccess:null};return $.type==="delete"?b.fire.call(be,re,Pe,D):$.type==="add"||Pe===void 0?(he=A.fire.call(be,re,$.values[fe],D),re==null&&he!=null&&($.keys[fe]=re=he,d.outbound||te($.values[fe],d.keyPath,re))):(he=zi(Pe,$.values[fe]),(we=V.fire.call(be,he,re,Pe,D))&&(ye=$.values[fe],Object.keys(we).forEach(function(Te){w(ye,Te)?ye[Te]=we[Te]:te(ye,Te,we[Te])}))),be});return l.mutate($).then(function(re){for(var fe=re.failures,he=re.results,we=re.numFailures,re=re.lastResult,ye=0;ye<L.length;++ye){var Pe=(he||L)[ye],be=U[ye];Pe==null?be.onerror&&be.onerror(fe[ye]):be.onsuccess&&be.onsuccess($.type==="put"&&z[ye]?$.values[ye]:Pe)}return{failures:fe,results:he,numFailures:we,lastResult:re}}).catch(function(re){return U.forEach(function(fe){return fe.onerror&&fe.onerror(re)}),Promise.reject(re)})});throw new Error("Keys missing")}}})}})}};function Fl(r,i,l){try{if(!i||i.keys.length<r.length)return null;for(var d=[],p=0,v=0;p<i.keys.length&&v<r.length;++p)nt(i.keys[p],r[v])===0&&(d.push(l?xe(i.values[p]):i.values[p]),++v);return d.length===r.length?d:null}catch{return null}}var ef={stack:"dbcore",level:-1,create:function(r){return{table:function(i){var l=r.table(i);return s(s({},l),{getMany:function(d){var p;return d.cache?(p=Fl(d.keys,d.trans._cache,d.cache==="clone"))?Se.resolve(p):l.getMany(d).then(function(v){return d.trans._cache={keys:d.keys,values:d.cache==="clone"?xe(v):v},v}):l.getMany(d)},mutate:function(d){return d.type!=="add"&&(d.trans._cache=null),l.mutate(d)}})}}}};function Nl(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function Vl(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var tf={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,l=new Dt(r.MIN_KEY,r.MAX_KEY);return s(s({},r),{transaction:function(d,p,v){if(Ie.subscr&&p!=="readonly")throw new je.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ie.querier));return r.transaction(d,p,v)},table:function(d){function p(L){var D,L=L.query;return[D=L.index,new Dt((D=(L=L.range).lower)!=null?D:r.MIN_KEY,(D=L.upper)!=null?D:r.MAX_KEY)]}var v=r.table(d),g=v.schema,b=g.primaryKey,A=g.indexes,V=b.extractKey,I=b.outbound,$=b.autoIncrement&&A.filter(function(R){return R.compound&&R.keyPath.includes(b.keyPath)}),P=s(s({},v),{mutate:function(R){function D(pe){return pe="idb://".concat(i,"/").concat(d,"/").concat(pe),fe[pe]||(fe[pe]=new Dt)}var L,z,U,re=R.trans,fe=R.mutatedParts||(R.mutatedParts={}),he=D(""),we=D(":dels"),ye=R.type,be=R.type==="deleteRange"?[R.range]:R.type==="delete"?[R.keys]:R.values.length<50?[Gi(b,R).filter(function(pe){return pe}),R.values]:[],Pe=be[0],be=be[1],Te=R.trans._cache;return f(Pe)?(he.addKeys(Pe),(ye=ye==="delete"||Pe.length===be.length?Fl(Pe,Te):null)||we.addKeys(Pe),(ye||be)&&(L=D,z=ye,U=be,g.indexes.forEach(function(pe){var qe=L(pe.name||"");function He(et){return et!=null?pe.extractKey(et):null}function Je(et){pe.multiEntry&&f(et)?et.forEach(function(tn){return qe.addKey(tn)}):qe.addKey(et)}(z||U).forEach(function(et,Rt){var ze=z&&He(z[Rt]),Rt=U&&He(U[Rt]);nt(ze,Rt)!==0&&(ze!=null&&Je(ze),Rt!=null)&&Je(Rt)})}))):Pe?(be={from:(Te=Pe.lower)!=null?Te:r.MIN_KEY,to:(ye=Pe.upper)!=null?ye:r.MAX_KEY},we.add(be),he.add(be)):(he.add(l),we.add(l),g.indexes.forEach(function(pe){return D(pe.name).add(l)})),v.mutate(R).then(function(pe){return!Pe||R.type!=="add"&&R.type!=="put"||(he.addKeys(pe.results),$&&$.forEach(function(qe){for(var He=R.values.map(function(ze){return qe.extractKey(ze)}),Je=qe.keyPath.findIndex(function(ze){return ze===b.keyPath}),et=0,tn=pe.results.length;et<tn;++et)He[et][Je]=pe.results[et];D(qe.name).addKeys(He)})),re.mutatedParts=mo(re.mutatedParts||{},fe),pe})}}),K={get:function(R){return[b,new Dt(R.key)]},getMany:function(R){return[b,new Dt().addKeys(R.keys)]},count:p,query:p,openCursor:p};return u(K).forEach(function(R){P[R]=function(D){var L=Ie.subscr,z=!!L,U=Nl(Ie,v)&&Vl(R,D)?D.obsSet={}:L;if(z){var re,L=function(be){return be="idb://".concat(i,"/").concat(d,"/").concat(be),U[be]||(U[be]=new Dt)},fe=L(""),he=L(":dels"),z=K[R](D),we=z[0],z=z[1];if((R==="query"&&we.isPrimaryKey&&!D.values?he:L(we.name||"")).add(z),!we.isPrimaryKey){if(R!=="count")return re=R==="query"&&I&&D.values&&v.query(s(s({},D),{values:!1})),v[R].apply(this,arguments).then(function(be){if(R==="query"){if(I&&D.values)return re.then(function(He){return He=He.result,fe.addKeys(He),be});var Te=D.values?be.result.map(V):be.result;(D.values?fe:he).addKeys(Te)}else{var pe,qe;if(R==="openCursor")return qe=D.values,(pe=be)&&Object.create(pe,{key:{get:function(){return he.addKey(pe.primaryKey),pe.key}},primaryKey:{get:function(){var He=pe.primaryKey;return he.addKey(He),He}},value:{get:function(){return qe&&fe.addKey(pe.primaryKey),pe.value}}})}return be});he.add(l)}}return v[R].apply(this,arguments)}}),P}})}};function Bl(r,i,l){var d;return l.numFailures===0?i:i.type==="deleteRange"||(d=i.keys?i.keys.length:"values"in i&&i.values?i.values.length:1,l.numFailures===d)?null:(d=s({},i),f(d.keys)&&(d.keys=d.keys.filter(function(p,v){return!(v in l.failures)})),"values"in d&&f(d.values)&&(d.values=d.values.filter(function(p,v){return!(v in l.failures)})),d)}function Yi(r,i){return l=r,((d=i).lower===void 0||(d.lowerOpen?0<nt(l,d.lower):0<=nt(l,d.lower)))&&(l=r,(d=i).upper===void 0||(d.upperOpen?nt(l,d.upper)<0:nt(l,d.upper)<=0));var l,d}function Ul(r,i,l,d,p,v){var g,b,A,V,I,$,P;return!l||l.length===0||(g=i.query.index,b=g.multiEntry,A=i.query.range,V=d.schema.primaryKey.extractKey,I=g.extractKey,$=(g.lowLevelIndex||g).extractKey,(d=l.reduce(function(K,R){var D=K,L=[];if(R.type==="add"||R.type==="put")for(var z=new Dt,U=R.values.length-1;0<=U;--U){var re,fe=R.values[U],he=V(fe);!z.hasKey(he)&&(re=I(fe),b&&f(re)?re.some(function(Te){return Yi(Te,A)}):Yi(re,A))&&(z.addKey(he),L.push(fe))}switch(R.type){case"add":var we=new Dt().addKeys(i.values?K.map(function(pe){return V(pe)}):K),D=K.concat(i.values?L.filter(function(pe){return pe=V(pe),!we.hasKey(pe)&&(we.addKey(pe),!0)}):L.map(function(pe){return V(pe)}).filter(function(pe){return!we.hasKey(pe)&&(we.addKey(pe),!0)}));break;case"put":var ye=new Dt().addKeys(R.values.map(function(pe){return V(pe)}));D=K.filter(function(pe){return!ye.hasKey(i.values?V(pe):pe)}).concat(i.values?L:L.map(function(pe){return V(pe)}));break;case"delete":var Pe=new Dt().addKeys(R.keys);D=K.filter(function(pe){return!Pe.hasKey(i.values?V(pe):pe)});break;case"deleteRange":var be=R.range;D=K.filter(function(pe){return!Yi(V(pe),be)})}return D},r))===r)?r:(P=function(K,R){return nt($(K),$(R))||nt(V(K),V(R))},d.sort(i.direction==="prev"||i.direction==="prevunique"?function(K,R){return P(R,K)}:P),i.limit&&i.limit<1/0&&(d.length>i.limit?d.length=i.limit:r.length===i.limit&&d.length<i.limit&&(p.dirty=!0)),v?Object.freeze(d):d)}function ql(r,i){return nt(r.lower,i.lower)===0&&nt(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function nf(r,i){return((l,d,p,v)=>{if(l===void 0)return d!==void 0?-1:0;if(d===void 0)return 1;if((l=nt(l,d))===0){if(p&&v)return 0;if(p)return 1;if(v)return-1}return l})(r.lower,i.lower,r.lowerOpen,i.lowerOpen)<=0&&0<=((l,d,p,v)=>{if(l===void 0)return d!==void 0?1:0;if(d===void 0)return-1;if((l=nt(l,d))===0){if(p&&v)return 0;if(p)return-1;if(v)return 1}return l})(r.upper,i.upper,r.upperOpen,i.upperOpen)}function rf(r,i,l,d){r.subscribers.add(l),d.addEventListener("abort",function(){var p,v;r.subscribers.delete(l),r.subscribers.size===0&&(p=r,v=i,setTimeout(function(){p.subscribers.size===0&&me(v,p)},3e3))})}var sf={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return s(s({},r),{transaction:function(l,d,p){var v,g,b=r.transaction(l,d,p);return d==="readwrite"&&(p=(v=new AbortController).signal,b.addEventListener("abort",(g=function(A){return function(){if(v.abort(),d==="readwrite"){for(var V=new Set,I=0,$=l;I<$.length;I++){var P=$[I],K=br["idb://".concat(i,"/").concat(P)];if(K){var R=r.table(P),D=K.optimisticOps.filter(function(pe){return pe.trans===b});if(b._explicit&&A&&b.mutatedParts)for(var L=0,z=Object.values(K.queries.query);L<z.length;L++)for(var U=0,re=(we=z[L]).slice();U<re.length;U++)Bi((ye=re[U]).obsSet,b.mutatedParts)&&(me(we,ye),ye.subscribers.forEach(function(pe){return V.add(pe)}));else if(0<D.length){K.optimisticOps=K.optimisticOps.filter(function(pe){return pe.trans!==b});for(var fe=0,he=Object.values(K.queries.query);fe<he.length;fe++)for(var we,ye,Pe,be=0,Te=(we=he[fe]).slice();be<Te.length;be++)(ye=Te[be]).res!=null&&b.mutatedParts&&(A&&!ye.dirty?(Pe=Object.isFrozen(ye.res),Pe=Ul(ye.res,ye.req,D,R,ye,Pe),ye.dirty?(me(we,ye),ye.subscribers.forEach(function(pe){return V.add(pe)})):Pe!==ye.res&&(ye.res=Pe,ye.promise=Se.resolve({result:Pe}))):(ye.dirty&&me(we,ye),ye.subscribers.forEach(function(pe){return V.add(pe)})))}}}V.forEach(function(pe){return pe()})}}})(!1),{signal:p}),b.addEventListener("error",g(!1),{signal:p}),b.addEventListener("complete",g(!0),{signal:p})),b},table:function(l){var d=r.table(l),p=d.schema.primaryKey;return s(s({},d),{mutate:function(v){var g,b=Ie.trans;return!p.outbound&&b.db._options.cache!=="disabled"&&!b.explicit&&b.idbtrans.mode==="readwrite"&&(g=br["idb://".concat(i,"/").concat(l)])?(b=d.mutate(v),v.type!=="add"&&v.type!=="put"||!(50<=v.values.length||Gi(p,v).some(function(A){return A==null}))?(g.optimisticOps.push(v),v.mutatedParts&&yo(v.mutatedParts),b.then(function(A){0<A.numFailures&&(me(g.optimisticOps,v),(A=Bl(0,v,A))&&g.optimisticOps.push(A),v.mutatedParts)&&yo(v.mutatedParts)}),b.catch(function(){me(g.optimisticOps,v),v.mutatedParts&&yo(v.mutatedParts)})):b.then(function(A){var V=Bl(0,s(s({},v),{values:v.values.map(function(I,$){var P;return A.failures[$]?I:(te(P=(P=p.keyPath)!=null&&P.includes(".")?xe(I):s({},I),p.keyPath,A.results[$]),P)})}),A);g.optimisticOps.push(V),queueMicrotask(function(){return v.mutatedParts&&yo(v.mutatedParts)})}),b):d.mutate(v)},query:function(v){var g,b,A,V,I,$,P;return Nl(Ie,d)&&Vl("query",v)?(g=((A=Ie.trans)==null?void 0:A.db._options.cache)==="immutable",b=(A=Ie).requery,A=A.signal,$=((K,R,D,L)=>{var z=br["idb://".concat(K,"/").concat(R)];if(!z)return[];if(!(K=z.queries[D]))return[null,!1,z,null];var U=K[(L.query?L.query.index.name:null)||""];if(!U)return[null,!1,z,null];switch(D){case"query":var re=(fe=L.direction)!=null?fe:"next",fe=U.find(function(he){var we;return he.req.limit===L.limit&&he.req.values===L.values&&((we=he.req.direction)!=null?we:"next")===re&&ql(he.req.query.range,L.query.range)});return fe?[fe,!0,z,U]:[U.find(function(he){var we;return("limit"in he.req?he.req.limit:1/0)>=L.limit&&((we=he.req.direction)!=null?we:"next")===re&&(!L.values||he.req.values)&&nf(he.req.query.range,L.query.range)}),!1,z,U];case"count":return fe=U.find(function(he){return ql(he.req.query.range,L.query.range)}),[fe,!!fe,z,U]}})(i,l,"query",v),P=$[0],V=$[2],I=$[3],P&&$[1]?P.obsSet=v.obsSet:($=d.query(v).then(function(K){var R=K.result;if(P&&(P.res=R),g){for(var D=0,L=R.length;D<L;++D)Object.freeze(R[D]);Object.freeze(R)}return K}).catch(function(K){return I&&P&&me(I,P),Promise.reject(K)}),P={obsSet:v.obsSet,promise:$,subscribers:new Set,type:"query",req:v,dirty:!1},I?I.push(P):(I=[P],(V=V||(br["idb://".concat(i,"/").concat(l)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[v.query.index.name||""]=I)),rf(P,I,b,A),P.promise.then(function(K){return K=Ul(K.result,v,V==null?void 0:V.optimisticOps,d,P,g),{result:g?K:xe(K)}})):d.query(v)}})}})}};function bo(r,i){return new Proxy(r,{get:function(l,d,p){return d==="db"?i:Reflect.get(l,d,p)}})}St.prototype.version=function(r){if(isNaN(r)||r<.1)throw new je.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new je.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var i=this._versions,l=i.filter(function(d){return d._cfg.version===r})[0];return l||(l=new this.Version(r),i.push(l),i.sort(zd),l.stores({}),this._state.autoSchema=!1),l},St.prototype._whenReady=function(r){var i=this;return this.idbdb&&(this._state.openComplete||Ie.letThrough||this._vip)?r():new Se(function(l,d){if(i._state.openComplete)return d(new je.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void d(new je.DatabaseClosed);i.open().catch(_)}i._state.dbReadyPromise.then(l,d)}).then(r)},St.prototype.use=function(p){var i=p.stack,l=p.create,d=p.level,p=p.name,v=(p&&this.unuse({stack:i,name:p}),this._middlewares[i]||(this._middlewares[i]=[]));return v.push({stack:i,create:l,level:d??10,name:p}),v.sort(function(g,b){return g.level-b.level}),this},St.prototype.unuse=function(r){var i=r.stack,l=r.name,d=r.create;return i&&this._middlewares[i]&&(this._middlewares[i]=this._middlewares[i].filter(function(p){return d?p.create!==d:!!l&&p.name!==l})),this},St.prototype.open=function(){var r=this;return mr($t,function(){return Xd(r)})},St.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var r=this._state;if(cs.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new Se(function(i){r.dbReadyResolve=i}),r.openCanceller=new Se(function(i,l){r.cancelOpen=l}))},St.prototype.close=function(i){var i=(i===void 0?{disableAutoOpen:!0}:i).disableAutoOpen,l=this._state;i?(l.isBeingOpened&&l.cancelOpen(new je.DatabaseClosed),this._close(),l.autoOpen=!1,l.dbOpenError=new je.DatabaseClosed):(this._close(),l.autoOpen=this._options.autoOpen||l.isBeingOpened,l.openComplete=!1,l.dbOpenError=null)},St.prototype.delete=function(r){var i=this,l=(r===void 0&&(r={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),d=this._state;return new Se(function(p,v){function g(){i.close(r);var b=i._deps.indexedDB.deleteDatabase(i.name);b.onsuccess=gt(function(){var A,V,I;A=i._deps,V=i.name,Fi(I=A.indexedDB)||V===no||Ki(I,A.IDBKeyRange).delete(V).catch(_),p()}),b.onerror=fn(v),b.onblocked=i._fireOnBlocked}if(l)throw new je.InvalidArgument("Invalid closeOptions argument to db.delete()");d.isBeingOpened?d.dbReadyPromise.then(g):g()})},St.prototype.backendDB=function(){return this.idbdb},St.prototype.isOpen=function(){return this.idbdb!==null},St.prototype.hasBeenClosed=function(){var r=this._state.dbOpenError;return r&&r.name==="DatabaseClosed"},St.prototype.hasFailed=function(){return this._state.dbOpenError!==null},St.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(St.prototype,"tables",{get:function(){var r=this;return u(this._allTables).map(function(i){return r._allTables[i]})},enumerable:!1,configurable:!0}),St.prototype.transaction=function(){var r=(function(i,l,d){var p=arguments.length;if(p<2)throw new je.InvalidArgument("Too few arguments");for(var v=new Array(p-1);--p;)v[p-1]=arguments[p];return d=v.pop(),[i,ce(v),d]}).apply(this,arguments);return this._transaction.apply(this,r)},St.prototype._transaction=function(r,i,l){var d,p,v=this,g=Ie.trans,b=(g&&g.db===this&&r.indexOf("!")===-1||(g=null),r.indexOf("?")!==-1);r=r.replace("!","").replace("?","");try{if(p=i.map(function(V){if(V=V instanceof v.Table?V.name:V,typeof V!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return V}),r=="r"||r===$i)d=$i;else{if(r!="rw"&&r!=Ai)throw new je.InvalidArgument("Invalid transaction mode: "+r);d=Ai}if(g){if(g.mode===$i&&d===Ai){if(!b)throw new je.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");g=null}g&&p.forEach(function(V){if(g&&g.storeNames.indexOf(V)===-1){if(!b)throw new je.SubTransaction("Table "+V+" not included in parent transaction.");g=null}}),b&&g&&!g.active&&(g=null)}}catch(V){return g?g._promise(null,function(I,$){$(V)}):Ct(V)}var A=(function V(I,$,P,K,R){return Se.resolve().then(function(){var U=Ie.transless||Ie,D=I._createTransaction($,P,I._dbSchema,K),U=(D.explicit=!0,{trans:D,transless:U});if(K)D.idbtrans=K.idbtrans;else try{D.create(),D.idbtrans._explicit=!0,I._state.PR1398_maxLoop=3}catch(re){return re.name===Yt.InvalidState&&I.isOpen()&&0<--I._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),I.close({disableAutoOpen:!1}),I.open().then(function(){return V(I,$,P,null,R)})):Ct(re)}var L,z=De(R),U=(z&&Kr(),Se.follow(function(){var re;(L=R.call(D,D))&&(z?(re=zn.bind(null,null),L.then(re,re)):typeof L.next=="function"&&typeof L.throw=="function"&&(L=Wi(L)))},U));return(L&&typeof L.then=="function"?Se.resolve(L).then(function(re){return D.active?re:Ct(new je.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):U.then(function(){return L})).then(function(re){return K&&D._resolve(),D._completion.then(function(){return re})}).catch(function(re){return D._reject(re),Ct(re)})})}).bind(null,this,d,p,g,l);return g?g._promise(d,A,"lock"):Ie.trans?mr(Ie.transless,function(){return v._whenReady(A)}):this._whenReady(A)},St.prototype.table=function(r){if(w(this._allTables,r))return this._allTables[r];throw new je.InvalidTable("Table ".concat(r," does not exist"))};var Mn=St;function St(r,i){var l,d,p,v,g,b=this,A=(this._middlewares={},this.verno=0,St.dependencies),A=(this._options=i=s({addons:St.addons,autoOpen:!0,indexedDB:A.indexedDB,IDBKeyRange:A.IDBKeyRange,cache:"cloned",maxConnections:1e3},i),this._deps={indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},i.addons),V=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:_,dbReadyPromise:null,cancelOpen:_,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:i.autoOpen}),I=(V.dbReadyPromise=new Se(function($){V.dbReadyResolve=$}),V.openCanceller=new Se(function($,P){V.cancelOpen=P}),this._state=V,this.name=r,this.on=os(this,"populate","blocked","versionchange","close",{ready:[H,_]}),this.once=function($,P){var K=function(){for(var R=[],D=0;D<arguments.length;D++)R[D]=arguments[D];b.on($).unsubscribe(K),P.apply(b,R)};return b.on($,K)},this.on.ready.subscribe=E(this.on.ready.subscribe,function($){return function(P,K){St.vip(function(){var R,D=b._state;D.openComplete?(D.dbOpenError||Se.resolve().then(P),K&&$(P)):D.onReadyBeingFired?(D.onReadyBeingFired.push(P),K&&$(P)):($(P),R=b,K||$(function L(){R.on.ready.unsubscribe(P),R.on.ready.unsubscribe(L)}))})}}),this.Collection=(l=this,is(Nd.prototype,function(L,D){this.db=l;var K=bl,R=null;if(D)try{K=D()}catch(U){R=U}var D=L._ctx,L=D.table,z=L.hook.reading.fire;this._ctx={table:L,index:D.index,isPrimKey:!D.index||L.schema.primKey.keyPath&&D.index===L.schema.primKey.name,range:K,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:R,or:D.or,valueMapper:z!==x?z:null}})),this.Table=(d=this,is(Sl.prototype,function($,P,K){this.db=d,this._tx=K,this.name=$,this.schema=P,this.hook=d._allTables[$]?d._allTables[$].hook:os(null,{creating:[ue,_],reading:[G,x],updating:[ve,_],deleting:[ge,_]})})),this.Transaction=(p=this,is(Ud.prototype,function($,P,K,R,D){var L=this;$!=="readonly"&&P.forEach(function(z){z=(z=K[z])==null?void 0:z.yProps,z&&(P=P.concat(z.map(function(U){return U.updatesTable})))}),this.db=p,this.mode=$,this.storeNames=P,this.schema=K,this.chromeTransactionDurability=R,this.idbtrans=null,this.on=os(this,"complete","error","abort"),this.parent=D||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 Se(function(z,U){L._resolve=z,L._reject=U}),this._completion.then(function(){L.active=!1,L.on.complete.fire()},function(z){var U=L.active;return L.active=!1,L.on.error.fire(z),L.parent?L.parent._reject(z):U&&L.idbtrans&&L.idbtrans.abort(),Ct(z)})})),this.Version=(v=this,is(Jd.prototype,function($){this.db=v,this._cfg={version:$,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(g=this,is(Tl.prototype,function($,P,K){if(this.db=g,this._ctx={table:$,index:P===":id"?null:P,or:K},this._cmp=this._ascending=nt,this._descending=function(R,D){return nt(D,R)},this._max=function(R,D){return 0<nt(R,D)?R:D},this._min=function(R,D){return nt(R,D)<0?R:D},this._IDBKeyRange=g._deps.IDBKeyRange,!this._IDBKeyRange)throw new je.MissingAPI})),this.on("versionchange",function($){0<$.newVersion?console.warn("Another connection wants to upgrade database '".concat(b.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(b.name,"'. Closing db now to resume the delete request.")),b.close({disableAutoOpen:!1})}),this.on("blocked",function($){!$.newVersion||$.newVersion<$.oldVersion?console.warn("Dexie.delete('".concat(b.name,"') was blocked")):console.warn("Upgrade '".concat(b.name,"' blocked by other connection holding version ").concat($.oldVersion/10))}),this._maxKey=ls(i.IDBKeyRange),this._createTransaction=function($,P,K,R){return new b.Transaction($,P,K,b._options.chromeTransactionDurability,R)},this._fireOnBlocked=function($){b.on("blocked").fire($),cs.toArray().filter(function(P){return P.name===b.name&&P!==b&&!P._state.vcFired}).map(function(P){return P.on("versionchange").fire($)})},this.use(ef),this.use(sf),this.use(tf),this.use(Qd),this.use(Zd),new Proxy(this,{get:function($,P,K){var R;return P==="_vip"||(P==="table"?function(D){return bo(b.table(D),I)}:(R=Reflect.get($,P,K))instanceof Sl?bo(R,I):P==="tables"?R.map(function(D){return bo(D,I)}):P==="_createTransaction"?function(){return bo(R.apply(this,arguments),I)}:R)}}));this.vip=I,A.forEach(function($){return $(b)})}var wo,Br=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",of=(Ji.prototype.subscribe=function(r,i,l){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:l})},Ji.prototype[Br]=function(){return this},Ji);function Ji(r){this._subscribe=r}try{wo={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{wo={indexedDB:null,IDBKeyRange:null}}function Hl(r){var i,l=!1,d=new of(function(p){var v=De(r),g,b=!1,A={},V={},I={get closed(){return b},unsubscribe:function(){b||(b=!0,g&&g.abort(),$&&Jn.storagemutated.unsubscribe(R))}},$=(p.start&&p.start(I),!1),P=function(){return Ei(D)};function K(){return Bi(V,A)}var R=function(L){mo(A,L),K()&&P()},D=function(){var L,z,U;!b&&wo.indexedDB&&(A={},L={},g&&g.abort(),g=new AbortController,U=(re=>{var fe=Rr();try{v&&Kr();var he=Wn(r,re);return he=v?he.finally(zn):he}finally{fe&&Lr()}})(z={subscr:L,signal:g.signal,requery:P,querier:r,trans:null}),$||(Jn.storagemutated.subscribe(R),$=!0),Promise.resolve(U).then(function(re){l=!0,i=re,b||z.signal.aborted||(K()||(V=L,K())?P():(A={},Ei(function(){return!b&&p.next&&p.next(re)})))},function(re){l=!1,["DatabaseClosedError","AbortError"].includes(re==null?void 0:re.name)||b||Ei(function(){b||p.error&&p.error(re)})}))};return setTimeout(P,0),I});return d.hasValue=function(){return l},d.getValue=function(){return i},d}var wr=Mn;function Xi(r){var i=Xn;try{Xn=!0,Jn.storagemutated.fire(r),Hi(r,!0)}finally{Xn=i}}C(wr,s(s({},Ce),{delete:function(r){return new wr(r,{addons:[]}).delete()},exists:function(r){return new wr(r,{addons:[]}).open().then(function(i){return i.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return i=wr.dependencies,l=i.indexedDB,i=i.IDBKeyRange,(Fi(l)?Promise.resolve(l.databases()).then(function(d){return d.map(function(p){return p.name}).filter(function(p){return p!==no})}):Ki(l,i).toCollection().primaryKeys()).then(r)}catch{return Ct(new je.MissingAPI)}var i,l},defineClass:function(){return function(r){h(this,r)}},ignoreTransaction:function(r){return Ie.trans?mr(Ie.transless||$t,r):r()},vip:Ni,async:function(r){return function(){try{var i=Wi(r.apply(this,arguments));return i&&typeof i.then=="function"?i:Se.resolve(i)}catch(l){return Ct(l)}}},spawn:function(r,i,l){try{var d=Wi(r.apply(l,i||[]));return d&&typeof d.then=="function"?d:Se.resolve(d)}catch(p){return Ct(p)}},currentTransaction:{get:function(){return Ie.trans||null}},waitFor:function(r,i){return r=Se.resolve(typeof r=="function"?wr.ignoreTransaction(r):r).timeout(i||6e4),Ie.trans?Ie.trans.waitFor(r):r},Promise:Se,debug:{get:function(){return W},set:function(r){Y(r)}},derive:B,extend:h,props:C,override:E,Events:os,on:Jn,liveQuery:Hl,extendObservabilitySet:mo,getByKeyPath:ie,setByKeyPath:te,delByKeyPath:function(r,i){typeof i=="string"?te(r,i,void 0):"length"in i&&[].map.call(i,function(l){te(r,l,void 0)})},shallowClone:O,deepClone:xe,getObjectDiff:zi,cmp:nt,asap:de,minKey:-1/0,addons:[],connections:{get:cs.toArray},errnames:Yt,dependencies:wo,cache:br,semVer:"4.4.6",version:"4.4.6".split(".").map(function(r){return parseInt(r)}).reduce(function(r,i,l){return r+i/Math.pow(10,2*l)})})),wr.maxKey=ls(wr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Jn(lo,function(r){Xn||(r=new CustomEvent(Oi,{detail:r}),Xn=!0,dispatchEvent(r),Xn=!1)}),addEventListener(Oi,function(r){r=r.detail,Xn||Xi(r)}));var Ur,Xn=!1,Wl=function(){};return typeof BroadcastChannel<"u"&&((Wl=function(){(Ur=new BroadcastChannel(Oi)).onmessage=function(r){return r.data&&Xi(r.data)}})(),typeof Ur.unref=="function"&&Ur.unref(),Jn(lo,function(r){Xn||Ur.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!Mn.disableBfCache&&r.persisted){W&&console.debug("Dexie: handling persisted pagehide"),Ur!=null&&Ur.close();for(var i=0,l=cs.toArray();i<l.length;i++)l[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!Mn.disableBfCache&&r.persisted&&(W&&console.debug("Dexie: handling persisted pageshow"),Wl(),Xi({all:new Dt(-1/0,[[]])}))})),Se.rejectionMapper=function(r,i){return!r||r instanceof Z||r instanceof TypeError||r instanceof SyntaxError||!r.name||!k[r.name]?r:(i=new k[r.name](i||r.message,r),"stack"in r&&M(i,"stack",{get:function(){return this.inner.stack}}),i)},Y(W),s(Mn,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Mn,Entity:wl,PropModification:ss,RangeSet:Dt,add:function(r){return new ss({add:r})},cmp:nt,default:Mn,liveQuery:Hl,mergeRanges:fs,rangesOverlap:Dl,remove:function(r){return new ss({remove:r})},replacePrefix:function(r,i){return new ss({replacePrefix:[r,i]})}}),{default:Mn}),Mn})})(dd);var ev=dd.exports;const Ma=Zh(ev),Du=Symbol.for("Dexie"),Ir=globalThis[Du]||(globalThis[Du]=Ma);if(Ma.semVer!==Ir.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Ma.semVer} and ${Ir.semVer}`);const{liveQuery:tv,mergeRanges:F0,rangesOverlap:N0,RangeSet:V0,cmp:B0,Entity:U0,PropModification:q0,replacePrefix:H0,add:W0,remove:z0,DexieYProvider:G0}=Ir;class fd extends Ir{constructor(t="intern_worklog"){super(t),this.version(1).stores({project:"++id, &name, archived",work_log:"++id, &date",log_item:"++id, work_log_id, project_id, category",attendance:"++id, &date",weekly_note:"++id, &week_start",setting:"key"}),this.version(2).stores({memo:"++id, updated_at",credential:"++id, system, updated_at"}),this.version(3).stores({transaction:"++id, date, type, category"}),this.version(4).stores({sync_mirror:"++id, table, uuid",tombstone:"++id, table, uuid, deleted_at"})}}let ee;function nv(e){ee=e}function sl(){ee&&ee.close(),ee=void 0}const rv=4,Wr=["餐饮","交通","住房","通讯","学习","娱乐","其他"],zo=["工资","报销","其他"],Ru=["公司","客户现场","出差","居家办公"],Ws=[{key:"dev",label:"开发"},{key:"bugfix",label:"BUG修复"},{key:"test",label:"测试"},{key:"learning",label:"学习成长"},{key:"meeting",label:"会议沟通"},{key:"doc",label:"文档输出"},{key:"other",label:"其他"}];function ol(e){const t=Ws.find(n=>n.key===e);return t?t.label:"其他"}const sv={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},ov={class:"dialog-head"},iv={key:0,class:"muted dialog-sub"},av={class:"dialog-body"},lv={class:"form-grid"},uv={class:"field span2"},cv={key:0,class:"form-error"},dv={class:"field"},fv=["value"],pv={class:"field"},hv=["value"],vv={class:"field"},mv={class:"field"},yv={class:"field span2"},gv={class:"field"},bv={class:"field"},wv={class:"dialog-btns"},_v=Vt({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=N(""),a=N(null),u=N("dev"),f=N(null),h=N(""),y=N(""),m=N(0),w=N(0),C=N(""),S=N(null),M=at(()=>{var E;const ae=n.projects.filter(X=>X.archived!==1),T=(E=n.item)==null?void 0:E.project_id;if(T&&!ae.some(X=>X.id===T)){const X=n.projects.find(ie=>ie.id===T),de=ae.slice();return X&&de.unshift({...X,name:X.name+"(已归档)"}),de}return ae});function B(ae){n.open&&ae.key==="Escape"&&s("cancel")}mt(()=>n.open,async ae=>{var T;if(ae){const E=n.item;o.value=(E==null?void 0:E.content)??"",a.value=(E==null?void 0:E.project_id)??null,u.value=(E==null?void 0:E.category)??"dev",f.value=(E==null?void 0:E.minutes)??null,h.value=(E==null?void 0:E.takeaway)??"",y.value=(E==null?void 0:E.remark)??"",m.value=(E==null?void 0:E.is_milestone)??0,w.value=(E==null?void 0:E.needs_followup)??0,C.value="",window.addEventListener("keydown",B),await ts(),(T=S.value)==null||T.focus()}else window.removeEventListener("keydown",B)}),pr(()=>window.removeEventListener("keydown",B)),mt(o,()=>{C.value&&(C.value="")});function oe(){const ae=o.value.trim();if(!ae){C.value="请填写工作内容";return}if(!n.item||!n.item.id){s("cancel");return}s("save",{id:n.item.id,content:ae,project_id:a.value,category:u.value,minutes:f.value&&f.value>0?f.value:null,takeaway:h.value.trim()||null,remark:y.value.trim()||null,is_milestone:m.value?1:0,needs_followup:w.value?1:0})}return(ae,T)=>(F(),It(qs,{to:"body"},[Oe(ns,{name:"modal"},{default:fr(()=>[e.open?(F(),q("div",{key:0,class:"mask",onClick:T[10]||(T[10]=Mr(E=>s("cancel"),["self"]))},[c("div",sv,[c("div",ov,[c("div",null,[T[11]||(T[11]=c("div",{class:"dialog-title"},"编辑工作记录",-1)),e.date?(F(),q("div",iv,se(e.date),1)):Ee("",!0)]),c("button",{class:"icon-btn",title:"关闭",onClick:T[0]||(T[0]=E=>s("cancel"))},[Oe(ut,{name:"close",size:16})])]),c("div",av,[c("div",lv,[c("div",uv,[T[12]||(T[12]=c("label",null,"工作内容(必填)",-1)),$e(c("input",{ref_key:"contentInput",ref:S,class:tt(["input",{invalid:C.value}]),"onUpdate:modelValue":T[1]||(T[1]=E=>o.value=E),onKeydown:jt(oe,["enter"])},null,34),[[Re,o.value]]),C.value?(F(),q("div",cv,se(C.value),1)):Ee("",!0)]),c("div",dv,[T[14]||(T[14]=c("label",null,"所属项目",-1)),$e(c("select",{class:"select","onUpdate:modelValue":T[2]||(T[2]=E=>a.value=E)},[T[13]||(T[13]=c("option",{value:null},"无项目",-1)),(F(!0),q(Le,null,ct(M.value,E=>(F(),q("option",{key:E.id,value:E.id},se(E.name),9,fv))),128))],512),[[Fn,a.value]])]),c("div",pv,[T[15]||(T[15]=c("label",null,"工作分类",-1)),$e(c("select",{class:"select","onUpdate:modelValue":T[3]||(T[3]=E=>u.value=E)},[(F(!0),q(Le,null,ct(Qt(Ws),E=>(F(),q("option",{key:E.key,value:E.key},se(E.label),9,hv))),128))],512),[[Fn,u.value]])]),c("div",vv,[T[16]||(T[16]=c("label",null,"耗时(分钟)",-1)),$e(c("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":T[4]||(T[4]=E=>f.value=E),placeholder:"选填"},null,512),[[Re,f.value,void 0,{number:!0}]])]),c("div",mv,[T[17]||(T[17]=c("label",null,"主要收获",-1)),$e(c("input",{class:"input","onUpdate:modelValue":T[5]||(T[5]=E=>h.value=E),placeholder:"一句话:学到了什么"},null,512),[[Re,h.value]])]),c("div",yv,[T[18]||(T[18]=c("label",null,"备注",-1)),$e(c("textarea",{class:"textarea","onUpdate:modelValue":T[6]||(T[6]=E=>y.value=E),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Re,y.value]])]),c("div",gv,[T[19]||(T[19]=c("label",null,"成果标记",-1)),c("button",{class:tt(["toggle-btn",{on:m.value===1}]),onClick:T[7]||(T[7]=E=>m.value=m.value===1?0:1)},se(m.value===1?"已标记为成果":"未标记"),3)]),c("div",bv,[T[20]||(T[20]=c("label",null,"待跟进",-1)),c("button",{class:tt(["toggle-btn",{onwarn:w.value===1}]),onClick:T[8]||(T[8]=E=>w.value=w.value===1?0:1)},se(w.value===1?"需要跟进":"无需跟进"),3)])])]),c("div",wv,[c("button",{class:"btn btn-sm",onClick:T[9]||(T[9]=E=>s("cancel"))},"取消"),c("button",{class:"btn btn-primary btn-sm",onClick:oe},"保存修改")])])])):Ee("",!0)]),_:1})]))}}),kv=Gt(_v,[["__scopeId","data-v-63bc0b48"]]);function Ss(e){return e<10?"0"+e:String(e)}function Nn(e){return e.getFullYear()+"-"+Ss(e.getMonth()+1)+"-"+Ss(e.getDate())}function xt(){return Nn(new Date)}function vt(){const e=new Date;return Nn(e)+"T"+Ss(e.getHours())+":"+Ss(e.getMinutes())+":"+Ss(e.getSeconds())}function Vn(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function rs(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Kn(e,t){const n=rs(e);return n.setDate(n.getDate()+t),Nn(n)}function Go(e,t){const n=rs(e),s=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(s,o)),Nn(n)}function Es(e){const t=rs(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Nn(t)}function xv(e){const t=rs(e).getDay();return t===0||t===6}function Cv(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function pd(e){const t=rs(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}async function bt(e,t){const n=await ee.setting.get(e);return n?n.value:t}async function kt(e,t){await ee.setting.put({key:e,value:t})}async function jr(){const e=await Promise.all([bt("work_start","09:00"),bt("work_end","18:00"),bt("grace_minutes","10"),bt("lunch_minutes","60"),bt("remind_weekly","friday")]);return{work_start:e[0],work_end:e[1],grace_minutes:Number(e[2])||0,lunch_minutes:Number(e[3])||0,remind_weekly:e[4]}}async function Sv(){const e=await bt("last_project",""),t=await bt("last_category","dev");return{project_id:e?Number(e):null,category:t||"dev"}}async function Ev(){return bt("last_location","")}async function $v(e,t){const n=t.trim();await kt("last_location",n),n&&await Yo(n);const s=await mn(e);s&&s.id?await ee.attendance.update(s.id,{location:n||null}):n&&await ee.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:vt()})}async function il(){const e=await bt("location_presets","");if(!e)return Ru.slice();try{const t=JSON.parse(e);if(Array.isArray(t))return t.filter(n=>typeof n=="string"&&n.trim()).map(n=>n.trim())}catch{}return Ru.slice()}async function hd(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await kt("location_presets",JSON.stringify(t))}async function Yo(e){const t=e.trim();if(!t)return;const n=await il();n.includes(t)||await hd([...n,t])}async function Fs(e=!1){const t=await ee.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function Av(e){await ee.project.add({name:e.trim(),archived:0,created_at:vt()})}async function Pv(e,t){await ee.project.update(e,{name:t.trim()})}async function Tv(e,t){await ee.project.update(e,{archived:t?1:0})}async function mn(e){return ee.attendance.where("date").equals(e).first()}async function vd(e,t){const n=((t===void 0?await bt("last_location",""):t)||"").trim(),s=await mn(e);if(s&&s.id){if(!s.clock_in_at){const o={clock_in_at:vt()};n&&(o.location=n),await ee.attendance.update(s.id,o)}n&&(await kt("last_location",n),await Yo(n));return}await ee.attendance.add({date:e,clock_in_at:vt(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:vt()}),n&&(await kt("last_location",n),await Yo(n))}async function Ov(e){const t=await mn(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&await ee.attendance.update(t.id,{clock_out_at:vt()})}async function Mv(){const e=new Date,t=Nn(e);if(e.getHours()<4){const s=await mn(Kn(t,-1));if(s&&s.id&&s.clock_in_at&&!s.clock_out_at)return await ee.attendance.update(s.id,{clock_out_at:vt()}),s.date}const n=await mn(t);if(n&&n.id&&n.clock_in_at&&!n.clock_out_at)return await ee.attendance.update(n.id,{clock_out_at:vt()}),n.date;throw new Error("没有进行中的打卡")}async function Iv(e,t,n,s,o){(o||"").trim()&&await Yo(o);const a=await mn(e),u={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:s||null,location:(o||"").trim()||null,created_at:vt()};a&&a.id?await ee.attendance.update(a.id,u):await ee.attendance.add(u)}async function jv(e,t,n){const s=(n||"").trim();if(!s)return;const o=await mn(e);o&&o.id&&await ee.attendance.update(o.id,{[t]:e+"T"+s+":00"})}async function yi(e,t){return ee.attendance.where("date").between(e,t,!0,!0).toArray()}async function Dv(e,t){const n=await mn(e);if(t){const s={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:vt()};n&&n.id?await ee.attendance.update(n.id,s):await ee.attendance.add({...s,note:null,location:null})}else n&&n.id&&await ee.attendance.update(n.id,{kind:"normal"})}async function Rv(e){const t=await ee.work_log.where("date").equals(e).first();return t||{id:await ee.work_log.add({date:e,created_at:vt()}),date:e,created_at:vt()}}async function Lv(e){return ee.work_log.where("date").equals(e).first()}async function Kv(e){const t=await Lv(e);return!t||!t.id?[]:(await ee.log_item.where("work_log_id").equals(t.id).toArray()).sort((s,o)=>o.id-s.id)}async function Fv(e,t){const n=await Rv(e);await ee.log_item.add({work_log_id:n.id,content:t.content,project_id:t.project_id,category:t.category,minutes:t.minutes,is_milestone:0,needs_followup:0,takeaway:t.takeaway,remark:t.remark,sort_order:0,created_at:vt()}),await kt("last_project",t.project_id?String(t.project_id):""),await kt("last_category",t.category)}async function fa(e,t){await ee.log_item.update(e,t)}async function Nv(e){await ee.log_item.delete(e)}async function gi(e,t){const n=await ee.work_log.where("date").between(e,t,!0,!0).toArray();if(!n.length)return[];const s=new Map(n.map(a=>[a.id,a.date]));return(await ee.log_item.where("work_log_id").anyOf(n.map(a=>a.id)).toArray()).map(a=>({...a,date:s.get(a.work_log_id)||""})).sort((a,u)=>a.date===u.date?a.id-u.id:a.date<u.date?-1:1)}async function al(e){return ee.weekly_note.where("week_start").equals(e).first()}async function Vv(e,t){const n=await al(e);n&&n.id?await ee.weekly_note.update(n.id,t):await ee.weekly_note.add({week_start:e,highlights:t.highlights??null,challenges:t.challenges??null,plan_next:t.plan_next??null,created_at:vt()})}async function Bv(e,t){return ee.weekly_note.where("week_start").between(e,t,!0,!0).toArray()}async function Uv(){return(await ee.memo.toArray()).sort((t,n)=>t.updated_at<n.updated_at?1:-1)}async function qv(e,t){const n=vt();return{id:await ee.memo.add({title:e.trim(),content:t,created_at:n,updated_at:n}),title:e.trim(),content:t,created_at:n,updated_at:n}}async function Hv(e,t,n){await ee.memo.update(e,{title:t.trim(),content:n,updated_at:vt()})}async function Wv(e){await ee.memo.delete(e)}async function zv(e,t=8){const n=e.trim().toLowerCase();if(!n)return[];const s=await ee.work_log.toArray(),o=new Map(s.map(u=>[u.id,u.date]));return(await ee.log_item.toArray()).filter(u=>((u.content||"")+" "+(u.takeaway||"")+" "+(u.remark||"")).toLowerCase().includes(n)).sort((u,f)=>f.id-u.id).slice(0,t).map(u=>({...u,date:o.get(u.work_log_id)||""}))}async function Gv(e,t=4){const n=e.trim().toLowerCase();return n?(await ee.memo.toArray()).filter(o=>((o.title||"")+" "+(o.content||"")).toLowerCase().includes(n)).sort((o,a)=>o.updated_at<a.updated_at?1:-1).slice(0,t):[]}async function Yv(e,t){return ee.table("transaction").where("date").between(e,t,!0,!0).toArray()}async function Jv(e){await ee.table("transaction").add({...e,created_at:vt()})}async function Xv(e,t){await ee.table("transaction").update(e,{...t})}async function Qv(e){await ee.table("transaction").delete(e)}async function Zv(e,t){await ee.table("transaction").update(e,{reimbursed:1})}async function em(){const e=await Promise.all([ee.project.toArray(),ee.work_log.toArray(),ee.log_item.toArray(),ee.attendance.toArray(),ee.weekly_note.toArray(),ee.setting.toArray(),ee.memo.toArray(),ee.credential.toArray(),ee.table("transaction").toArray()]);return JSON.stringify({schema_version:rv,exported_at:vt(),data:{project:e[0],work_log:e[1],log_item:e[2],attendance:e[3],weekly_note:e[4],setting:e[5],memo:e[6],credential:e[7],transaction:e[8]}},null,2)}async function tm(e){let t=null;try{t=JSON.parse(e)}catch{throw new Error("不是有效的 JSON 文件")}if(!t||t.schema_version!==1&&t.schema_version!==2&&t.schema_version!==3||!t.data)throw new Error("文件格式或 schema 版本不匹配");const n=t.data;await ee.transaction("rw",[ee.project,ee.work_log,ee.log_item,ee.attendance,ee.weekly_note,ee.setting,ee.memo,ee.credential,ee.table("transaction")],async()=>{await Promise.all([ee.project.clear(),ee.work_log.clear(),ee.log_item.clear(),ee.attendance.clear(),ee.weekly_note.clear(),ee.setting.clear(),ee.memo.clear(),ee.credential.clear(),ee.table("transaction").clear()]),n.project&&n.project.length&&await ee.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await ee.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await ee.log_item.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await ee.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await ee.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await ee.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await ee.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await ee.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await ee.table("transaction").bulkAdd(n.transaction)})}function Ao(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function zs(e,t,n,s){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(xv(t))return{status:"rest",label:"休息日",makeup:!1,workedMinutes:null};if(!e||!e.clock_in_at)return s?{status:"none",label:"未打卡",makeup:!1,workedMinutes:null}:{status:"absent",label:"缺勤",makeup:!!(e&&e.kind==="makeup"),workedMinutes:null};const o=e.kind==="makeup";if(!e.clock_out_at)return{status:"incomplete",label:s?"进行中":"未完成",makeup:o,workedMinutes:null};const a=Ao(Vn(e.clock_in_at)),u=Ao(Vn(e.clock_out_at)),f=Ao(n.work_start),h=Ao(n.work_end);let y="normal";!o&&a>f+n.grace_minutes?y="late":!o&&u<h&&(y="early");const m=Cv(e.clock_in_at,e.clock_out_at),w=Math.max(0,m-n.lunch_minutes);return{status:y,label:o?"补卡":y==="late"?"迟到":y==="early"?"早退":"正常",makeup:o,workedMinutes:w}}const Io=N([]);let nm=0;function Be(e){const t=++nm;Io.value.push({id:t,text:e}),setTimeout(()=>{Io.value=Io.value.filter(n=>n.id!==t)},2e3)}function rm(){return Io}const Ia=N(null),ja=N(null),Gs=N(0);function nr(){Gs.value++}const sm={class:"day-panel"},om={class:"dp-head"},im={class:"dp-date"},am={class:"card sec"},lm={class:"att-grid"},um={class:"att-cell"},cm={key:0,class:"edit-row"},dm={key:1,class:"att-val"},fm={class:"att-cell"},pm={key:0,class:"edit-row"},hm={key:1,class:"att-val"},vm={class:"att-cell"},mm=["list"],ym=["id"],gm=["value"],bm={class:"att-cell"},wm={class:"att-val status-val"},_m={key:0,class:"tag"},km={key:1,class:"muted"},xm={key:0,class:"att-note muted"},Cm={class:"att-actions"},Sm=["disabled"],Em=["disabled"],$m=["disabled"],Am=["disabled"],Pm={key:0,class:"card sec makeup"},Tm={class:"form-grid"},Om={class:"field"},Mm={class:"field"},Im={class:"field span2"},jm=["list"],Dm={class:"field span2"},Rm={key:0,class:"form-error"},Lm={class:"form-footer"},Km={class:"card sec"},Fm={class:"form-grid"},Nm={class:"field span2"},Vm={key:0,class:"form-error"},Bm={class:"field"},Um=["value"],qm={class:"field"},Hm=["value"],Wm={class:"field"},zm={class:"field"},Gm={class:"field span2"},Ym={class:"form-footer"},Jm=["disabled"],Xm=["disabled"],Qm={class:"list-sec"},Zm={class:"sec-title"},ey={key:0,class:"empty muted"},ty={class:"item-main"},ny={class:"tag"},ry=["onClick"],sy={key:0,class:"muted item-meta"},oy={key:1,class:"muted num item-meta"},iy=["onClick"],ay=["onClick"],ly=["onClick"],uy=["onClick"],cy={key:0,class:"item-sub"},dy={key:0,class:"muted2"},fy={key:1,class:"muted"},py={key:1,class:"dp-foot muted num"},hy=Vt({__name:"DayPanel",props:{date:{}},setup(e){const t=e,n=N(!0),s=N(null),o=N(void 0),a=N([]),u=N([]),f=N(""),h=N([]),y=at(()=>"loc-list-"+t.date),m=at(()=>t.date===xt());async function w(){n.value=!0,s.value=await jr(),o.value=await mn(t.date),a.value=await Kv(t.date),u.value=await Fs(!0),h.value=await il(),f.value=o.value&&o.value.location||await Ev(),n.value=!1}dn(w),mt(()=>t.date,w),mt(Gs,()=>{w()});const C=at(()=>u.value.filter(H=>H.archived!==1));function S(H){if(!H)return"";const W=u.value.find(Y=>Y.id===H);return W?W.name:"已删除项目"}const M=at(()=>s.value?zs(o.value,t.date,s.value,m.value):null),B=at(()=>a.value.reduce((H,W)=>H+(W.minutes||0),0)),oe=N(!1);async function ae(){oe.value||(oe.value=!0,await vd(t.date,f.value),await w(),nr(),Be("上班打卡成功"),oe.value=!1)}async function T(){oe.value||(oe.value=!0,await Ov(t.date),await w(),nr(),Be("下班打卡成功"),oe.value=!1)}async function E(){await $v(t.date,f.value),nr(),Be("地点已更新")}const X=N(!1),de=at(()=>{var H;return((H=o.value)==null?void 0:H.kind)==="leave"});function ie(){if(o.value&&o.value.clock_in_at){X.value=!0;return}te(!0)}async function te(H){X.value=!1,await Dv(t.date,H),await w(),nr(),Be(H?"已标记为休假":"已取消休假")}const O=N(null),j=N(""),ce=N(null);mt(O,async H=>{var W;H&&(await ts(),(W=ce.value)==null||W.focus())});function ke(H){var Y,Ae;const W=H==="in"?(Y=o.value)==null?void 0:Y.clock_in_at:(Ae=o.value)==null?void 0:Ae.clock_out_at;O.value=H,j.value=W?Vn(W):H==="in"?"09:00":"18:00"}function J(){O.value=null}async function xe(){const H=O.value;H&&(O.value=null,j.value&&(await jv(t.date,H==="in"?"clock_in_at":"clock_out_at",j.value),await w(),nr(),Be("打卡时间已修改")))}const Ue=N(!1),rt=N("09:00"),We=N("18:00"),Ye=N(""),me=N(""),Me=N("");function Fe(){me.value=f.value,Me.value="",Ue.value=!Ue.value}async function De(){if(!rt.value||!We.value){Me.value="请填写上班与下班时间";return}await Iv(t.date,t.date+"T"+rt.value+":00",t.date+"T"+We.value+":00",Ye.value.trim(),me.value),Ue.value=!1,Ye.value="",Me.value="",await w(),nr(),Be("补卡已保存")}const Ce=N(""),Q=N("");mt(Ce,()=>{Q.value&&(Q.value="")});const Z=N(null),_e=N("dev"),Ve=N(null),ft=N(""),Yt=N(""),Jt=N(!1),je=at(()=>!!(Ce.value.trim()||Ve.value||ft.value.trim()||Yt.value.trim()));dn(async()=>{const H=await Sv();Z.value=H.project_id,_e.value=H.category});function k(){Ce.value="",Ve.value=null,ft.value="",Yt.value="",Q.value=""}async function _(){const H=Ce.value.trim();if(!H){Q.value="请填写工作内容";return}Jt.value||(Jt.value=!0,await Fv(t.date,{content:H,project_id:Z.value,category:_e.value,minutes:Ve.value&&Ve.value>0?Ve.value:null,takeaway:ft.value.trim()||null,remark:Yt.value.trim()||null}),k(),await w(),Be("记录已添加"),Jt.value=!1)}const x=N(null);function G(H){x.value=H}async function ne(H){const W=H.id,Y={content:H.content,project_id:H.project_id,category:H.category,minutes:H.minutes,takeaway:H.takeaway,remark:H.remark,is_milestone:H.is_milestone,needs_followup:H.needs_followup};await fa(W,Y),x.value=null,await w(),Be("修改已保存")}async function ue(H){await fa(H.id,{is_milestone:H.is_milestone?0:1}),await w()}async function ge(H){await fa(H.id,{needs_followup:H.needs_followup?0:1}),await w()}const ve=N(null);async function le(){ve.value&&ve.value.id&&await Nv(ve.value.id),ve.value=null,await w(),Be("记录已删除")}return(H,W)=>(F(),q("div",sm,[c("div",om,[c("div",im,se(Qt(pd)(e.date)),1)]),c("div",am,[W[25]||(W[25]=c("div",{class:"sec-title"},"出勤信息",-1)),c("div",lm,[c("div",um,[W[21]||(W[21]=c("label",null,"上班时间",-1)),O.value==="in"?(F(),q("div",cm,[$e(c("input",{ref_key:"timeInput",ref:ce,type:"time",class:"input time-input","onUpdate:modelValue":W[0]||(W[0]=Y=>j.value=Y),onKeydown:[jt(xe,["enter"]),jt(J,["esc"])]},null,544),[[Re,j.value]]),c("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),c("button",{class:"btn btn-sm",onClick:J},"取消")])):(F(),q("div",dm,[c("span",{class:tt(["num",{"val-empty":!(o.value&&o.value.clock_in_at)}])},se(o.value&&o.value.clock_in_at?Qt(Vn)(o.value.clock_in_at):"未打卡"),3),o.value&&o.value.id?(F(),q("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:W[1]||(W[1]=Y=>ke("in"))},[Oe(ut,{name:"edit",size:13})])):Ee("",!0)]))]),c("div",fm,[W[22]||(W[22]=c("label",null,"下班时间",-1)),O.value==="out"?(F(),q("div",pm,[$e(c("input",{ref_key:"timeInput",ref:ce,type:"time",class:"input time-input","onUpdate:modelValue":W[2]||(W[2]=Y=>j.value=Y),onKeydown:[jt(xe,["enter"]),jt(J,["esc"])]},null,544),[[Re,j.value]]),c("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),c("button",{class:"btn btn-sm",onClick:J},"取消")])):(F(),q("div",hm,[c("span",{class:tt(["num",{"val-empty":!(o.value&&o.value.clock_out_at)}])},se(o.value&&o.value.clock_out_at?Qt(Vn)(o.value.clock_out_at):"未打卡"),3),o.value&&o.value.id?(F(),q("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:W[3]||(W[3]=Y=>ke("out"))},[Oe(ut,{name:"edit",size:13})])):Ee("",!0)]))]),c("div",vm,[W[23]||(W[23]=c("label",null,"上班地点",-1)),$e(c("input",{class:"input","onUpdate:modelValue":W[4]||(W[4]=Y=>f.value=Y),list:y.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:E},null,40,mm),[[Re,f.value]]),c("datalist",{id:y.value},[(F(!0),q(Le,null,ct(h.value,Y=>(F(),q("option",{key:Y,value:Y},null,8,gm))),128))],8,ym)]),c("div",bm,[W[24]||(W[24]=c("label",null,"考勤状态",-1)),c("div",wm,[M.value?(F(),q(Le,{key:0},[c("span",{class:tt(["dot",M.value.status])},null,2),c("span",null,se(M.value.label),1),o.value&&o.value.kind==="makeup"?(F(),q("span",_m,"补卡")):Ee("",!0)],64)):(F(),q("span",km,"--"))])])]),o.value&&o.value.note?(F(),q("div",xm,"补卡说明:"+se(o.value.note),1)):Ee("",!0),c("div",Cm,[m.value&&(!o.value||!o.value.clock_in_at)?(F(),q("button",{key:0,class:"btn btn-primary btn-sm",disabled:oe.value,onClick:ae},"上班打卡",8,Sm)):m.value&&o.value&&o.value.clock_in_at&&!o.value.clock_out_at?(F(),q("button",{key:1,class:"btn btn-primary btn-sm",disabled:oe.value,onClick:T},"下班打卡",8,Em)):Ee("",!0),!m.value&&(!o.value||!o.value.clock_in_at)?(F(),q("button",{key:2,class:"btn btn-sm",onClick:Fe},"补卡")):Ee("",!0),de.value?(F(),q("button",{key:4,class:"btn btn-sm",disabled:oe.value,onClick:W[5]||(W[5]=Y=>te(!1))},"取消休假",8,Am)):(F(),q("button",{key:3,class:"btn btn-sm",disabled:oe.value,onClick:ie},"标记休假",8,$m))])]),Ue.value?(F(),q("div",Pm,[W[30]||(W[30]=c("div",{class:"sec-title"},"补卡登记",-1)),c("div",Tm,[c("div",Om,[W[26]||(W[26]=c("label",null,"上班时间",-1)),$e(c("input",{type:"time",class:"input","onUpdate:modelValue":W[6]||(W[6]=Y=>rt.value=Y)},null,512),[[Re,rt.value]])]),c("div",Mm,[W[27]||(W[27]=c("label",null,"下班时间",-1)),$e(c("input",{type:"time",class:"input","onUpdate:modelValue":W[7]||(W[7]=Y=>We.value=Y)},null,512),[[Re,We.value]])]),c("div",Im,[W[28]||(W[28]=c("label",null,"上班地点",-1)),$e(c("input",{class:"input",list:y.value,"onUpdate:modelValue":W[8]||(W[8]=Y=>me.value=Y),placeholder:"可直接输入"},null,8,jm),[[Re,me.value]])]),c("div",Dm,[W[29]||(W[29]=c("label",null,"补卡原因",-1)),$e(c("input",{class:"input","onUpdate:modelValue":W[9]||(W[9]=Y=>Ye.value=Y),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[Re,Ye.value]])])]),Me.value?(F(),q("div",Rm,se(Me.value),1)):Ee("",!0),c("div",Lm,[c("button",{class:"btn btn-sm",onClick:W[10]||(W[10]=Y=>Ue.value=!1)},"取消"),c("button",{class:"btn btn-primary btn-sm",onClick:De},"保存补卡")])])):Ee("",!0),c("div",Km,[W[38]||(W[38]=c("div",{class:"sec-head"},[c("span",{class:"sec-title"},"新增工作记录"),c("span",{class:"muted form-hint"},"内容必填,其余选填")],-1)),c("div",Fm,[c("div",Nm,[W[31]||(W[31]=c("label",null,"工作内容(必填)",-1)),$e(c("input",{class:tt(["input",{invalid:Q.value}]),"onUpdate:modelValue":W[11]||(W[11]=Y=>Ce.value=Y),placeholder:"做了什么,一句话一条",onKeydown:jt(_,["enter"])},null,34),[[Re,Ce.value]]),Q.value?(F(),q("div",Vm,se(Q.value),1)):Ee("",!0)]),c("div",Bm,[W[33]||(W[33]=c("label",null,"所属项目",-1)),$e(c("select",{class:"select","onUpdate:modelValue":W[12]||(W[12]=Y=>Z.value=Y)},[W[32]||(W[32]=c("option",{value:null},"无项目",-1)),(F(!0),q(Le,null,ct(C.value,Y=>(F(),q("option",{key:Y.id,value:Y.id},se(Y.name),9,Um))),128))],512),[[Fn,Z.value]])]),c("div",qm,[W[34]||(W[34]=c("label",null,"工作分类",-1)),$e(c("select",{class:"select","onUpdate:modelValue":W[13]||(W[13]=Y=>_e.value=Y)},[(F(!0),q(Le,null,ct(Qt(Ws),Y=>(F(),q("option",{key:Y.key,value:Y.key},se(Y.label),9,Hm))),128))],512),[[Fn,_e.value]])]),c("div",Wm,[W[35]||(W[35]=c("label",null,"耗时(分钟)",-1)),$e(c("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":W[14]||(W[14]=Y=>Ve.value=Y),placeholder:"选填"},null,512),[[Re,Ve.value,void 0,{number:!0}]])]),c("div",zm,[W[36]||(W[36]=c("label",null,"主要收获",-1)),$e(c("input",{class:"input","onUpdate:modelValue":W[15]||(W[15]=Y=>ft.value=Y),placeholder:"一句话:学到了什么"},null,512),[[Re,ft.value]])]),c("div",Gm,[W[37]||(W[37]=c("label",null,"备注",-1)),$e(c("textarea",{class:"textarea","onUpdate:modelValue":W[16]||(W[16]=Y=>Yt.value=Y),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Re,Yt.value]])])]),c("div",Ym,[c("button",{class:"btn btn-sm",disabled:!je.value,onClick:k},"重置",8,Jm),c("button",{class:"btn btn-primary btn-sm",disabled:Jt.value,onClick:_},"添加记录",8,Xm)])]),c("div",Qm,[c("div",Zm,"工作记录("+se(a.value.length)+")",1),!a.value.length&&!n.value?(F(),q("div",ey,"暂无记录")):Ee("",!0),(F(!0),q(Le,null,ct(a.value,Y=>(F(),q("div",{key:Y.id,class:"item"},[c("div",ty,[c("span",ny,se(Qt(ol)(Y.category)),1),c("span",{class:"item-content",title:"点击编辑",onClick:Ae=>G(Y)},se(Y.content),9,ry),Y.project_id?(F(),q("span",sy,se(S(Y.project_id)),1)):Ee("",!0),Y.minutes?(F(),q("span",oy,se(Y.minutes)+" 分钟",1)):Ee("",!0),W[39]||(W[39]=c("span",{class:"flex1"},null,-1)),c("button",{class:"icon-btn",title:"编辑完整信息",onClick:Ae=>G(Y)},[Oe(ut,{name:"edit",size:14})],8,iy),c("button",{class:tt(["icon-btn",{active:Y.is_milestone===1}]),title:"成果标记",onClick:Ae=>ue(Y)},[Oe(ut,{name:"star",size:14})],10,ay),c("button",{class:tt(["icon-btn",{"active-warn":Y.needs_followup===1}]),title:"待跟进",onClick:Ae=>ge(Y)},[Oe(ut,{name:"flag",size:14})],10,ly),c("button",{class:"icon-btn",title:"删除",onClick:Ae=>ve.value=Y},[Oe(ut,{name:"close",size:14})],8,uy)]),Y.takeaway||Y.remark?(F(),q("div",cy,[Y.takeaway?(F(),q("div",dy,"收获:"+se(Y.takeaway),1)):Ee("",!0),Y.remark?(F(),q("div",fy,"备注:"+se(Y.remark),1)):Ee("",!0)])):Ee("",!0)]))),128)),a.value.length?(F(),q("div",py,[nn(" 共 "+se(a.value.length)+" 条事项 ",1),B.value?(F(),q(Le,{key:0},[nn(" · "+se((B.value/60).toFixed(1))+" 小时",1)],64)):Ee("",!0)])):Ee("",!0)]),Oe(cr,{open:!!ve.value,title:"删除确认",message:ve.value?"将删除工作记录「"+ve.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:W[17]||(W[17]=Y=>ve.value=null),onConfirm:le},null,8,["open","message"]),Oe(cr,{open:X.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:W[18]||(W[18]=Y=>X.value=!1),onConfirm:W[19]||(W[19]=Y=>te(!0))},null,8,["open"]),Oe(kv,{open:!!x.value,item:x.value,projects:u.value,date:e.date,onCancel:W[20]||(W[20]=Y=>x.value=null),onSave:ne},null,8,["open","item","projects","date"])]))}}),md=Gt(hy,[["__scopeId","data-v-2e90c9d8"]]),vy={class:"cal-page"},my={class:"cal-toolbar"},yy={class:"cal-title num"},gy={class:"cal-head"},by={class:"cal-grid"},wy=["title","onClick"],_y={class:"cal-marks"},ky={key:0,class:"drawer"},xy={class:"drawer-head"},Cy={class:"drawer-body"},Sy=Vt({__name:"CalendarView",setup(e){const t=N(xt()),n=at(()=>Number(t.value.slice(0,4))),s=at(()=>Number(t.value.slice(5,7))-1),o=at(()=>n.value+" 年 "+(s.value+1)+" 月"),a=["一","二","三","四","五","六","日"],u=at(()=>{const X=(new Date(n.value,s.value,1).getDay()+6)%7,de=new Date(n.value,s.value+1,0).getDate(),ie=[];for(let te=0;te<X;te++)ie.push({date:"",inMonth:!1,weekend:!1});for(let te=1;te<=de;te++){const O=new Date(n.value,s.value,te),j=O.getDay();ie.push({date:Nn(O),inMonth:!0,weekend:j===0||j===6})}return ie}),f=N(new Map),h=xt();async function y(){var ce;const E=Nn(new Date(n.value,s.value,1)),X=Nn(new Date(n.value,s.value+1,0)),de=await Promise.all([jr(),yi(E,X),gi(E,X)]),ie=de[0],te=new Map(de[1].map(ke=>[ke.date,ke])),O=de[2],j=new Map;for(const ke of u.value){if(!ke.inMonth)continue;const J=zs(te.get(ke.date),ke.date,ie,ke.date===h),xe=O.filter(Ue=>Ue.date===ke.date);j.set(ke.date,{status:J.status,label:J.label,location:((ce=te.get(ke.date))==null?void 0:ce.location)||"",hasLog:xe.length>0,hasMilestone:xe.some(Ue=>Ue.is_milestone===1)})}f.value=j}mt([n,s],y,{immediate:!0}),mt(Gs,()=>{y()});function m(E){var X;return((X=f.value.get(E))==null?void 0:X.status)??""}function w(E){const X=f.value.get(E);return X?E+" · "+X.label+(X.location?" · "+X.location:""):E}function C(E){var X;return!!((X=f.value.get(E))!=null&&X.hasLog)}function S(E){var X;return!!((X=f.value.get(E))!=null&&X.hasMilestone)}function M(){t.value=Go(t.value,-1)}function B(){t.value=Go(t.value,1)}function oe(){t.value=xt()}const ae=N(null);function T(E,X){X&&(ae.value=E)}return mt(Ia,E=>{E&&(t.value=E,ae.value=E,Ia.value=null)},{immediate:!0}),(E,X)=>(F(),q("div",vy,[c("div",my,[c("button",{class:"icon-btn",onClick:M},[Oe(ut,{name:"chevron-left",size:16})]),c("span",yy,se(o.value),1),c("button",{class:"icon-btn",onClick:B},[Oe(ut,{name:"chevron-right",size:16})]),c("button",{class:"btn btn-sm",onClick:oe},"回到今天")]),c("div",gy,[(F(),q(Le,null,ct(a,de=>c("span",{key:de,class:"cal-week muted"},se(de),1)),64))]),c("div",by,[(F(!0),q(Le,null,ct(u.value,(de,ie)=>(F(),q("button",{key:ie,class:tt(["cal-cell",{blank:!de.inMonth,weekend:de.weekend,selected:ae.value===de.date}]),title:de.inMonth?w(de.date):void 0,onClick:te=>T(de.date,de.inMonth)},[de.inMonth?(F(),q(Le,{key:0},[c("span",{class:tt(["daynum num",{today:de.date===Qt(h)}])},se(Number(de.date.slice(8,10))),3),c("span",_y,[m(de.date)?(F(),q("span",{key:0,class:tt(["dot",m(de.date)])},null,2)):Ee("",!0),C(de.date)?(F(),It(ut,{key:1,name:"check-circle",size:12,class:"mark-log"})):Ee("",!0),S(de.date)?(F(),It(ut,{key:2,name:"star",size:12,class:"mark-star"})):Ee("",!0)])],64)):Ee("",!0)],10,wy))),128))]),Oe(ns,{name:"drawer"},{default:fr(()=>[ae.value?(F(),q("aside",ky,[c("div",xy,[X[1]||(X[1]=c("span",{class:"drawer-title"},"当日详情",-1)),c("button",{class:"icon-btn",onClick:X[0]||(X[0]=de=>ae.value=null)},[Oe(ut,{name:"close",size:16})])]),c("div",Cy,[Oe(md,{date:ae.value},null,8,["date"])])])):Ee("",!0)]),_:1})]))}}),Ey=Gt(Sy,[["__scopeId","data-v-2404dfbe"]]),$y={class:"detail-page"},Ay={class:"detail-toolbar"},Py=["value"],Ty=["disabled"],Oy=Vt({__name:"TodayView",setup(e){const t=N(xt()),n=at(()=>t.value===xt());function s(){t.value=Kn(t.value,-1)}function o(){t.value=Kn(t.value,1)}function a(){t.value=xt()}function u(f){const h=f.target.value;h&&(t.value=h)}return(f,h)=>(F(),q("div",$y,[c("div",Ay,[c("button",{class:"icon-btn",title:"前一天",onClick:s},[Oe(ut,{name:"chevron-left",size:16})]),c("span",{class:tt(["date-title num",{"is-today":n.value}])},se(Qt(pd)(t.value)),3),c("button",{class:"icon-btn",title:"后一天",onClick:o},[Oe(ut,{name:"chevron-right",size:16})]),c("input",{type:"date",class:"input w-date",value:t.value,onChange:u},null,40,Py),c("button",{class:"btn btn-sm",disabled:n.value,onClick:a},"回到今天",8,Ty)]),Oe(md,{date:t.value},null,8,["date"])]))}}),My=Gt(Oy,[["__scopeId","data-v-76243d98"]]),Iy={class:"stats"},jy={class:"cards"},Dy={class:"card stat-card"},Ry={class:"stat-num num"},Ly={class:"card stat-card"},Ky={class:"stat-num num"},Fy={class:"card stat-card"},Ny={class:"stat-num num"},Vy={class:"card stat-card"},By={class:"stat-num num"},Uy={class:"card section"},qy={class:"heat"},Hy=["title"],Wy={class:"two-col"},zy={class:"card section"},Gy={class:"bar-label"},Yy={class:"bar-track"},Jy={class:"muted num bar-num"},Xy={key:0,class:"muted"},Qy={class:"card section"},Zy={class:"bar-label"},eg={class:"bar-track"},tg={class:"muted num bar-num"},ng={key:0,class:"muted"},rg={class:"card section"},sg={class:"bar-label loc-label"},og={class:"bar-track"},ig={class:"muted num bar-num"},ag={key:0,class:"muted"},lg=Vt({__name:"StatsView",setup(e){const t=N({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=N([]),s=N([]),o=N([]),a=N([]);async function u(){const y=xt(),m="2000-01-01",w=await Promise.all([jr(),yi(m,y),gi(m,y),Fs(!0)]),C=w[0],S=w[1],M=w[2],B=w[3],oe=S.filter(J=>J.clock_in_at||J.kind==="makeup");let ae=0;for(const J of oe){const xe=zs(J,J.date,C,J.date===y);ae+=xe.workedMinutes??0}const T=new Set(M.map(J=>J.date));let E=0,X=y;for(T.has(X)||(X=Kn(y,-1));T.has(X);)E++,X=Kn(X,-1);t.value={attendDays:oe.length,totalHours:(ae/60).toFixed(1),itemCount:M.length,streak:E};const de=new Map;for(const J of oe){const xe=J.location||"未记录";de.set(xe,(de.get(xe)||0)+1)}a.value=Array.from(de.entries()).map(J=>({name:J[0],count:J[1],percent:Math.round(J[1]/(oe.length||1)*100)})).sort((J,xe)=>xe.count-J.count);const ie=M.length||1;s.value=Ws.map(J=>{const xe=M.filter(Ue=>Ue.category===J.key).length;return{key:J.key,label:J.label,count:xe,percent:Math.round(xe/ie*100)}}).filter(J=>J.count>0).sort((J,xe)=>xe.count-J.count);const te=new Map(B.map(J=>[J.id,J.name])),O=new Map;for(const J of M){const xe=J.project_id?te.get(J.project_id)||"已删除项目":"无项目";O.set(xe,(O.get(xe)||0)+1)}o.value=Array.from(O.entries()).map(J=>({name:J[0],count:J[1],percent:Math.round(J[1]/ie*100)})).sort((J,xe)=>xe.count-J.count);const j=new Map;for(const J of M)j.set(J.date,(j.get(J.date)||0)+1);const ce=Es(y),ke=[];for(let J=11;J>=0;J--){const xe=Kn(ce,-7*J),Ue=[];for(let rt=0;rt<7;rt++){const We=Kn(xe,rt);Ue.push({date:We,count:j.get(We)||0})}ke.push(Ue)}n.value=ke}dn(async()=>{await u()}),mt(Gs,()=>{u()});function f(y){return y===0?0:y===1?1:y<=3?2:y<=5?3:4}function h(y,m){return y+" · "+(m?m+" 条":"无记录")}return(y,m)=>(F(),q("div",Iy,[c("div",jy,[c("div",Dy,[m[0]||(m[0]=c("div",{class:"muted"},"出勤天数",-1)),c("div",Ry,se(t.value.attendDays),1)]),c("div",Ly,[m[1]||(m[1]=c("div",{class:"muted"},"累计工时(小时)",-1)),c("div",Ky,se(t.value.totalHours),1)]),c("div",Fy,[m[2]||(m[2]=c("div",{class:"muted"},"记录条数",-1)),c("div",Ny,se(t.value.itemCount),1)]),c("div",Vy,[m[3]||(m[3]=c("div",{class:"muted"},"连续记录(天)",-1)),c("div",By,se(t.value.streak),1)])]),c("div",Uy,[m[4]||(m[4]=c("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),c("div",qy,[(F(!0),q(Le,null,ct(n.value,(w,C)=>(F(),q("div",{key:C,class:"heat-col"},[(F(!0),q(Le,null,ct(w,S=>(F(),q("span",{key:S.date,class:tt(["heat-cell","lv"+f(S.count)]),title:h(S.date,S.count)},null,10,Hy))),128))]))),128))]),m[5]||(m[5]=qp('<div class="heat-legend muted" data-v-73e5ba49><span data-v-73e5ba49>少</span><span class="heat-cell lv0" data-v-73e5ba49></span><span class="heat-cell lv1" data-v-73e5ba49></span><span class="heat-cell lv2" data-v-73e5ba49></span><span class="heat-cell lv3" data-v-73e5ba49></span><span class="heat-cell lv4" data-v-73e5ba49></span><span data-v-73e5ba49>多</span></div>',1))]),c("div",Wy,[c("div",zy,[m[6]||(m[6]=c("div",{class:"section-title"},"分类分布",-1)),(F(!0),q(Le,null,ct(s.value,w=>(F(),q("div",{key:w.key,class:"bar-row"},[c("span",Gy,se(w.label),1),c("span",Yy,[c("span",{class:"bar-fill",style:or({width:w.percent+"%"})},null,4)]),c("span",Jy,se(w.count)+" 条 · "+se(w.percent)+"%",1)]))),128)),s.value.length?Ee("",!0):(F(),q("div",Xy,"暂无数据"))]),c("div",Qy,[m[7]||(m[7]=c("div",{class:"section-title"},"项目投入",-1)),(F(!0),q(Le,null,ct(o.value,w=>(F(),q("div",{key:w.name,class:"bar-row"},[c("span",Zy,se(w.name),1),c("span",eg,[c("span",{class:"bar-fill",style:or({width:w.percent+"%"})},null,4)]),c("span",tg,se(w.count)+" 条 · "+se(w.percent)+"%",1)]))),128)),o.value.length?Ee("",!0):(F(),q("div",ng,"暂无数据"))])]),c("div",rg,[m[8]||(m[8]=c("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(F(!0),q(Le,null,ct(a.value,w=>(F(),q("div",{key:w.name,class:"bar-row"},[c("span",sg,se(w.name),1),c("span",og,[c("span",{class:"bar-fill",style:or({width:w.percent+"%"})},null,4)]),c("span",ig,se(w.count)+" 天 · "+se(w.percent)+"%",1)]))),128)),a.value.length?Ee("",!0):(F(),q("div",ag,"暂无数据"))])]))}}),ug=Gt(lg,[["__scopeId","data-v-73e5ba49"]]);async function cg(e,t,n){const s=xt(),o=await Promise.all([jr(),yi(e,t),gi(e,t),Fs(!0),Bv(e,t)]),a=o[0],u=o[1],f=o[2],h=o[3],y=o[4];let m=0,w=0,C=0;for(const O of u){(O.clock_in_at||O.kind==="makeup")&&m++,O.kind==="makeup"&&C++;const j=zs(O,O.date,a,O.date===s);w+=j.workedMinutes??0}const S=new Map;for(const O of u){if(!(O.clock_in_at||O.kind==="makeup"))continue;const j=O.location||"未记录";S.set(j,(S.get(j)||0)+1)}const M=Array.from(S.entries()).map(O=>({name:O[0],count:O[1]})).sort((O,j)=>j.count-O.count),B=f.length||1,oe=Ws.map(O=>{const j=f.filter(ce=>ce.category===O.key).length;return{key:O.key,label:O.label,count:j,percent:Math.round(j/B*100)}}).filter(O=>O.count>0).sort((O,j)=>j.count-O.count),ae=new Map(h.map(O=>[O.id,O.name])),T=new Map;for(const O of f){const j=O.project_id?ae.get(O.project_id)||"已删除项目":"无项目";T.set(j,(T.get(j)||0)+1)}const E=Array.from(T.entries()).map(O=>({name:O[0],count:O[1]})).sort((O,j)=>j.count-O.count),X=f.filter(O=>O.is_milestone===1).map(O=>({date:O.date,content:O.content})),de=f.filter(O=>O.needs_followup===1).map(O=>({date:O.date,content:O.content,remark:O.remark||""})),ie=f.filter(O=>!!O.takeaway).map(O=>({date:O.date,text:O.takeaway})),te=y.map(O=>({weekStart:O.week_start,highlights:O.highlights||"",challenges:O.challenges||"",plan_next:O.plan_next||""}));return{range:{start:e,end:t,label:n},attendDays:m,totalHours:(w/60).toFixed(1),makeupCount:C,leaveCount:u.filter(O=>O.kind==="leave").length,itemCount:f.length,categoryStats:oe,projectStats:E,locationStats:M,milestones:X,followups:de,takeaways:ie,weekNotes:te}}function dg(e){const t=[];t.push("# 实习工作总结("+e.range.start+" ~ "+e.range.end+")"),t.push(""),t.push("## 一、考勤概况"),t.push(""),t.push("出勤 "+e.attendDays+" 天,累计工时 "+e.totalHours+" 小时,补卡 "+e.makeupCount+" 次"+(e.leaveCount?",请假 "+e.leaveCount+" 天":""));const n=e.locationStats.filter(s=>s.name!=="未记录");n.length&&t.push("其中:"+n.map(s=>s.name+" "+s.count+" 天").join(",")),t.push(""),t.push("## 二、工作内容分布"),t.push(""),t.push(e.categoryStats.length?e.categoryStats.map(s=>s.label+" "+s.percent+"%("+s.count+" 条)").join(","):"(无记录)"),t.push(""),t.push("## 三、项目投入"),t.push(""),t.push(e.projectStats.length?e.projectStats.map(s=>s.name+" "+s.count+" 条").join(","):"(无记录)"),t.push(""),t.push("## 四、主要成果"),t.push(""),e.milestones.length?e.milestones.forEach((s,o)=>t.push(o+1+". 【成果】"+s.content+"("+s.date+")")):t.push("(无)"),t.push(""),t.push("## 五、待跟进事项"),t.push(""),e.followups.length?e.followups.forEach(s=>t.push("- 【待跟进】"+s.content+(s.remark?"("+s.date+" 备注:"+s.remark+")":"("+s.date+")"))):t.push("(无)"),t.push(""),t.push("## 六、学习与成长"),t.push(""),e.takeaways.length?e.takeaways.forEach(s=>t.push("- "+s.text+"("+s.date+")")):t.push("(无)");for(const s of e.weekNotes)t.push(""),t.push("### 周记("+s.weekStart+" 起)"),t.push(""),t.push("- 本周亮点:"+(s.highlights||"(无)")),t.push("- 踩的坑:"+(s.challenges||"(无)")),t.push("- 下周计划:"+(s.plan_next||"(无)"));return t.push(""),t.join(`
|
||
`)}const fg="modulepreload",pg=function(e,t){return new URL(e,t).href},Lu={},yd=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){const u=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=Promise.allSettled(n.map(y=>{if(y=pg(y,s),y in Lu)return;Lu[y]=!0;const m=y.endsWith(".css"),w=m?'[rel="stylesheet"]':"";if(!!s)for(let M=u.length-1;M>=0;M--){const B=u[M];if(B.href===y&&(!m||B.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${w}`))return;const S=document.createElement("link");if(S.rel=m?"stylesheet":fg,m||(S.as="script"),S.crossOrigin="",S.href=y,h&&S.setAttribute("nonce",h),document.head.appendChild(S),m)return new Promise((M,B)=>{S.addEventListener("load",M),S.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${y}`)))})}))}function a(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return o.then(u=>{for(const f of u||[])f.status==="rejected"&&a(f.reason);return t().catch(a)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const hg=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},s=(a,u)=>{n.platforms.set(a,u)},o=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))};return n.addPlatform=s,n.setPlatform=o,n},vg=e=>e.CapacitorPlatforms=hg(e),gd=vg(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});gd.addPlatform;gd.setPlatform;var Qr;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Qr||(Qr={}));class pa extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const mg=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},yg=e=>{var t,n,s,o,a;const u=e.CapacitorCustomPlatform||null,f=e.Capacitor||{},h=f.Plugins=f.Plugins||{},y=e.CapacitorPlatforms,m=()=>u!==null?u.name:mg(e),w=((t=y==null?void 0:y.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||m,C=()=>w()!=="web",S=((n=y==null?void 0:y.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||C,M=te=>{const O=X.get(te);return!!(O!=null&&O.platforms.has(w())||ae(te))},B=((s=y==null?void 0:y.currentPlatform)===null||s===void 0?void 0:s.isPluginAvailable)||M,oe=te=>{var O;return(O=f.PluginHeaders)===null||O===void 0?void 0:O.find(j=>j.name===te)},ae=((o=y==null?void 0:y.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||oe,T=te=>e.console.error(te),E=(te,O,j)=>Promise.reject(`${j} does not have an implementation of "${O}".`),X=new Map,de=(te,O={})=>{const j=X.get(te);if(j)return console.warn(`Capacitor plugin "${te}" already registered. Cannot register plugins twice.`),j.proxy;const ce=w(),ke=ae(te);let J;const xe=async()=>(!J&&ce in O?J=typeof O[ce]=="function"?J=await O[ce]():J=O[ce]:u!==null&&!J&&"web"in O&&(J=typeof O.web=="function"?J=await O.web():J=O.web),J),Ue=(Fe,De)=>{var Ce,Q;if(ke){const Z=ke==null?void 0:ke.methods.find(_e=>De===_e.name);if(Z)return Z.rtype==="promise"?_e=>f.nativePromise(te,De.toString(),_e):(_e,Ve)=>f.nativeCallback(te,De.toString(),_e,Ve);if(Fe)return(Ce=Fe[De])===null||Ce===void 0?void 0:Ce.bind(Fe)}else{if(Fe)return(Q=Fe[De])===null||Q===void 0?void 0:Q.bind(Fe);throw new pa(`"${te}" plugin is not implemented on ${ce}`,Qr.Unimplemented)}},rt=Fe=>{let De;const Ce=(...Q)=>{const Z=xe().then(_e=>{const Ve=Ue(_e,Fe);if(Ve){const ft=Ve(...Q);return De=ft==null?void 0:ft.remove,ft}else throw new pa(`"${te}.${Fe}()" is not implemented on ${ce}`,Qr.Unimplemented)});return Fe==="addListener"&&(Z.remove=async()=>De()),Z};return Ce.toString=()=>`${Fe.toString()}() { [capacitor code] }`,Object.defineProperty(Ce,"name",{value:Fe,writable:!1,configurable:!1}),Ce},We=rt("addListener"),Ye=rt("removeListener"),me=(Fe,De)=>{const Ce=We({eventName:Fe},De),Q=async()=>{const _e=await Ce;Ye({eventName:Fe,callbackId:_e},De)},Z=new Promise(_e=>Ce.then(()=>_e({remove:Q})));return Z.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await Q()},Z},Me=new Proxy({},{get(Fe,De){switch(De){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return ke?me:We;case"removeListener":return Ye;default:return rt(De)}}});return h[te]=Me,X.set(te,{name:te,proxy:Me,platforms:new Set([...Object.keys(O),...ke?[ce]:[]])}),Me},ie=((a=y==null?void 0:y.currentPlatform)===null||a===void 0?void 0:a.registerPlugin)||de;return f.convertFileSrc||(f.convertFileSrc=te=>te),f.getPlatform=w,f.handleError=T,f.isNativePlatform=S,f.isPluginAvailable=B,f.pluginMethodNoop=E,f.registerPlugin=ie,f.Exception=pa,f.DEBUG=!!f.DEBUG,f.isLoggingEnabled=!!f.isLoggingEnabled,f.platform=f.getPlatform(),f.isNative=f.isNativePlatform(),f},gg=e=>e.Capacitor=yg(e),Zr=gg(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),bd=Zr.registerPlugin;Zr.Plugins;class wd{constructor(t){this.listeners={},this.retainedEventArguments={},this.windowListeners={},t&&(console.warn(`Capacitor WebPlugin "${t.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=t)}addListener(t,n){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),s&&this.sendRetainedArgumentsForEvent(t);const u=async()=>this.removeListener(t,n);return Promise.resolve({remove:u})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,s){const o=this.listeners[t];if(!o){if(s){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}o.forEach(a=>a(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:s=>{this.notifyListeners(n,s)}}}unimplemented(t="not implemented"){return new Zr.Exception(t,Qr.Unimplemented)}unavailable(t="not available"){return new Zr.Exception(t,Qr.Unavailable)}async removeListener(t,n){const s=this.listeners[t];if(!s)return;const o=s.indexOf(n);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(s=>{this.notifyListeners(t,s)}))}}const Ku=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Fu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class bg extends wd{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[o,a]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=Fu(o).trim(),a=Fu(a).trim(),n[o]=a}),n}async setCookie(t){try{const n=Ku(t.key),s=Ku(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,a=(t.path||"/").replace("path=",""),u=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${s||""}${o}; path=${a}; ${u};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}bd("CapacitorCookies",{web:()=>new bg});const wg=async e=>new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const o=s.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},s.onerror=o=>n(o),s.readAsDataURL(e)}),_g=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,a,u)=>(o[a]=e[t[u]],o),{})},kg=(e,t=!0)=>e?Object.entries(e).reduce((s,o)=>{const[a,u]=o;let f,h;return Array.isArray(u)?(h="",u.forEach(y=>{f=t?encodeURIComponent(y):y,h+=`${a}=${f}&`}),h.slice(0,-1)):(f=t?encodeURIComponent(u):u,h=`${a}=${f}`),`${s}&${h}`},"").substr(1):null,xg=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=_g(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[u,f]of Object.entries(e.data||{}))a.set(u,f);n.body=a.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((f,h)=>{a.append(h,f)});else for(const f of Object.keys(e.data))a.append(f,e.data[f]);n.body=a;const u=new Headers(n.headers);u.delete("content-type"),n.headers=u}else(o.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class Cg extends wd{async request(t){const n=xg(t,t.webFetchExtra),s=kg(t.params,t.shouldEncodeUrlParams),o=s?`${t.url}?${s}`:t.url,a=await fetch(o,n),u=a.headers.get("content-type")||"";let{responseType:f="text"}=a.ok?t:{};u.includes("application/json")&&(f="json");let h,y;switch(f){case"arraybuffer":case"blob":y=await a.blob(),h=await wg(y);break;case"json":h=await a.json();break;case"document":case"text":default:h=await a.text()}const m={};return a.headers.forEach((w,C)=>{m[C]=w}),{data:h,headers:m,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}bd("CapacitorHttp",{web:()=>new Cg});async function ll(e,t){const n=window;if(n.electronAPI&&n.electronAPI.saveFile){const u=await n.electronAPI.saveFile(e,t);return u&&u.saved?u.path:""}if(Zr.isNativePlatform()){const{Filesystem:u,Directory:f,Encoding:h}=await yd(async()=>{const{Filesystem:y,Directory:m,Encoding:w}=await import("./index-BYlgk7tc.js");return{Filesystem:y,Directory:m,Encoding:w}},[],import.meta.url);try{return(await u.writeFile({path:e,data:t,directory:f.Documents,encoding:h.UTF8,recursive:!0})).uri}catch{return(await u.writeFile({path:e,data:t,directory:f.Cache,encoding:h.UTF8,recursive:!0})).uri}}const s=new Blob([t],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(s),a=document.createElement("a");return a.href=o,a.download=e,a.click(),window.setTimeout(()=>URL.revokeObjectURL(o),1e4),""}const Sg=Object.freeze(Object.defineProperty({__proto__:null,downloadText:ll},Symbol.toStringTag,{value:"Module"}));async function Da(e){try{await navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}async function Eg(e){const t=await Promise.all([bt("ai_base_url",""),bt("ai_api_key",""),bt("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),s=t[1].trim(),o=t[2].trim();if(!n||!o)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const a=n+"/chat/completions",u={"Content-Type":"application/json"};s&&(u.Authorization="Bearer "+s);const h=JSON.stringify({model:o,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let y;try{y=await fetch(a,{method:"POST",headers:u,body:h})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!y.ok){let C="接口返回 "+y.status;try{const S=await y.json();S&&S.error&&S.error.message&&(C+=":"+S.error.message)}catch{}throw new Error(C)}const m=await y.json(),w=m&&m.choices&&m.choices[0]&&m.choices[0].message&&m.choices[0].message.content;if(!w)throw new Error("接口未返回内容");return String(w)}const $g={class:"report"},Ag={class:"report-toolbar"},Pg={class:"seg"},Tg=["onClick"],Og=["disabled"],Mg=["disabled"],Ig={key:0,class:"ai-error"},jg={class:"report-grid"},Dg={class:"report-left"},Rg={class:"card section"},Lg={class:"section-title"},Kg={class:"muted note-saved"},Fg={class:"card section"},Ng={class:"report-right"},Vg={key:0,class:"card section"},Bg={class:"sum-row"},Ug={class:"num"},qg={class:"sum-row"},Hg={class:"num"},Wg={class:"sum-row"},zg={class:"num"},Gg={class:"sum-row"},Yg={class:"num"},Jg={class:"sum-row"},Xg={class:"num"},Qg={class:"muted"},Zg={class:"num"},eb={key:0,class:"muted sum-empty"},tb={class:"muted"},nb={key:1,class:"muted sum-empty"},rb={class:"muted"},sb={key:2,class:"muted sum-empty"},ob={class:"muted"},ib={key:3,class:"muted sum-empty"},ab=Vt({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=N("week"),s=N(Es(xt())),o=N(xt()),a=N(null),u=N(""),f=N(!1),h=N(!1),y=N(null),m=N(""),w=N(Es(xt())),C=N(""),S=N(""),M=N(""),B=N(!1);async function oe(){const O=await al(w.value);C.value=(O==null?void 0:O.highlights)||"",S.value=(O==null?void 0:O.challenges)||"",M.value=(O==null?void 0:O.plan_next)||"",B.value=!1}async function ae(){await Vv(w.value,{highlights:C.value.trim()||null,challenges:S.value.trim()||null,plan_next:M.value.trim()||null}),B.value=!0,await E()}function T(O){const j=xt();if(O==="week"){const ce=Es(j);return{start:ce,end:Kn(ce,6),label:"本周"}}if(O==="month"){const ce=j.slice(0,7);return{start:ce+"-01",end:j,label:ce+" 本月"}}return O==="all"?{start:"2000-01-01",end:j,label:"全部实习期"}:{start:s.value,end:o.value,label:s.value+" ~ "+o.value}}async function E(){f.value=!0;const O=T(n.value),j=await cg(O.start,O.end,O.label);a.value=j,u.value=dg(j),f.value=!1}mt(n,E),mt([s,o],()=>{n.value==="custom"&&E()}),dn(async()=>{await oe(),await E()});async function X(){const O=xt().replace(/-/g,""),j=await ll("实习工作总结_"+O+".md",u.value);Be(j?"总结已导出到:"+j:"总结已导出到系统下载目录")}async function de(){await Da(u.value),Be("总结已复制到剪贴板")}async function ie(){if(h.value)return;m.value="";const O=u.value.trim();if(!O){m.value="当前草稿为空,无法润色";return}h.value=!0;try{y.value=u.value,u.value=await Eg(O),Be("AI 润色完成")}catch(j){y.value=null,m.value=j instanceof Error?j.message:"润色失败"}h.value=!1}function te(){y.value!==null&&(u.value=y.value),y.value=null}return(O,j)=>(F(),q("div",$g,[c("div",Ag,[c("div",Pg,[(F(),q(Le,null,ct(t,ce=>c("button",{key:ce.key,class:tt(["seg-btn",{active:n.value===ce.key}]),onClick:ke=>n.value=ce.key},se(ce.label),11,Tg)),64))]),n.value==="custom"?(F(),q(Le,{key:0},[$e(c("input",{type:"date",class:"input w-date","onUpdate:modelValue":j[0]||(j[0]=ce=>s.value=ce)},null,512),[[Re,s.value]]),j[6]||(j[6]=c("span",{class:"muted"},"至",-1)),$e(c("input",{type:"date",class:"input w-date","onUpdate:modelValue":j[1]||(j[1]=ce=>o.value=ce)},null,512),[[Re,o.value]])],64)):Ee("",!0),j[10]||(j[10]=c("span",{class:"flex1"},null,-1)),c("button",{class:"btn btn-sm",disabled:h.value,onClick:ie},[Oe(ut,{name:"edit",size:14}),j[7]||(j[7]=nn("AI 润色 ",-1))],8,Og),y.value!==null?(F(),q("button",{key:1,class:"btn btn-sm",onClick:te},"还原润色前")):Ee("",!0),c("button",{class:"btn btn-sm",disabled:f.value,onClick:E},[Oe(ut,{name:"edit",size:14}),j[8]||(j[8]=nn("重新生成 ",-1))],8,Mg),c("button",{class:"btn btn-sm",onClick:de},"复制"),c("button",{class:"btn btn-primary btn-sm",onClick:X},[Oe(ut,{name:"export",size:14}),j[9]||(j[9]=nn("导出 Markdown ",-1))])]),m.value?(F(),q("div",Ig,se(m.value),1)):Ee("",!0),c("div",jg,[c("div",Dg,[c("div",Rg,[c("div",Lg,"本周周记("+se(w.value)+" 起)",1),j[11]||(j[11]=c("label",{class:"note-label muted"},"本周亮点",-1)),$e(c("textarea",{class:"textarea","onUpdate:modelValue":j[2]||(j[2]=ce=>C.value=ce),placeholder:"本周最有价值的一件事",onBlur:ae},null,544),[[Re,C.value]]),j[12]||(j[12]=c("label",{class:"note-label muted"},"踩的坑",-1)),$e(c("textarea",{class:"textarea","onUpdate:modelValue":j[3]||(j[3]=ce=>S.value=ce),placeholder:"遇到的问题与教训",onBlur:ae},null,544),[[Re,S.value]]),j[13]||(j[13]=c("label",{class:"note-label muted"},"下周计划",-1)),$e(c("textarea",{class:"textarea","onUpdate:modelValue":j[4]||(j[4]=ce=>M.value=ce),placeholder:"下周准备做什么",onBlur:ae},null,544),[[Re,M.value]]),c("div",Kg,se(B.value?"已保存":"失焦自动保存"),1)]),c("div",Fg,[j[14]||(j[14]=c("div",{class:"section-title"},"总结草稿(可编辑)",-1)),$e(c("textarea",{class:"textarea md-editor","onUpdate:modelValue":j[5]||(j[5]=ce=>u.value=ce),spellcheck:"false"},null,512),[[Re,u.value]])])]),c("div",Ng,[a.value?(F(),q("div",Vg,[j[20]||(j[20]=c("div",{class:"section-title"},"数据摘要",-1)),c("div",Bg,[j[15]||(j[15]=c("span",{class:"muted"},"出勤",-1)),c("span",Ug,se(a.value.attendDays)+" 天",1)]),c("div",qg,[j[16]||(j[16]=c("span",{class:"muted"},"工时",-1)),c("span",Hg,se(a.value.totalHours)+" 小时",1)]),c("div",Wg,[j[17]||(j[17]=c("span",{class:"muted"},"补卡",-1)),c("span",zg,se(a.value.makeupCount)+" 次",1)]),c("div",Gg,[j[18]||(j[18]=c("span",{class:"muted"},"请假",-1)),c("span",Yg,se(a.value.leaveCount)+" 天",1)]),c("div",Jg,[j[19]||(j[19]=c("span",{class:"muted"},"记录",-1)),c("span",Xg,se(a.value.itemCount)+" 条",1)]),j[21]||(j[21]=c("div",{class:"section-sub"},"分类分布",-1)),(F(!0),q(Le,null,ct(a.value.categoryStats,ce=>(F(),q("div",{key:ce.key,class:"sum-row"},[c("span",Qg,se(ce.label),1),c("span",Zg,se(ce.count)+" 条 · "+se(ce.percent)+"%",1)]))),128)),a.value.categoryStats.length?Ee("",!0):(F(),q("div",eb,"(无)")),j[22]||(j[22]=c("div",{class:"section-sub"},"主要成果",-1)),(F(!0),q(Le,null,ct(a.value.milestones,(ce,ke)=>(F(),q("div",{key:"m"+ke,class:"sum-item"},[nn(se(ce.content),1),c("span",tb,"("+se(ce.date)+")",1)]))),128)),a.value.milestones.length?Ee("",!0):(F(),q("div",nb,"(无)")),j[23]||(j[23]=c("div",{class:"section-sub"},"待跟进",-1)),(F(!0),q(Le,null,ct(a.value.followups,(ce,ke)=>(F(),q("div",{key:"f"+ke,class:"sum-item"},[nn(se(ce.content),1),c("span",rb,"("+se(ce.date)+")",1)]))),128)),a.value.followups.length?Ee("",!0):(F(),q("div",sb,"(无)")),j[24]||(j[24]=c("div",{class:"section-sub"},"学习与成长",-1)),(F(!0),q(Le,null,ct(a.value.takeaways,(ce,ke)=>(F(),q("div",{key:"t"+ke,class:"sum-item"},[nn(se(ce.text),1),c("span",ob,"("+se(ce.date)+")",1)]))),128)),a.value.takeaways.length?Ee("",!0):(F(),q("div",ib,"(无)"))])):Ee("",!0)])])]))}}),lb=Gt(ab,[["__scopeId","data-v-43f9c59b"]]),ub=["aria-label"],cb={class:"dialog-head"},db={class:"dialog-title"},fb={class:"dialog-body"},pb={class:"form-grid"},hb={class:"field span2"},vb={class:"seg"},mb={class:"field"},yb={class:"field"},gb={class:"field"},bb=["value"],wb={key:0,class:"field"},_b={class:"seg"},kb={class:"field span2"},xb={key:0,class:"form-error"},Cb={class:"dialog-btns"},Sb=Vt({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=N("expense"),a=N("餐饮"),u=N(""),f=N(""),h=N(""),y=N(!1),m=N(!1),w=N(""),C=N(null);function S(ae){n.open&&ae.key==="Escape"&&s("cancel")}mt(()=>n.open,async ae=>{var T;ae?(o.value=n.initial.type==="income"?"income":"expense",a.value=n.initial.category,u.value=n.initial.amountYuan,f.value=n.initial.date,h.value=n.initial.note,y.value=n.initial.reimbursable===1,m.value=n.initial.reimbursed===1,w.value="",window.addEventListener("keydown",S),await ts(),(T=C.value)==null||T.focus()):window.removeEventListener("keydown",S)}),pr(()=>window.removeEventListener("keydown",S)),mt(o,ae=>{a.value=ae==="expense"?Wr[0]:zo[0]});const M=at(()=>o.value==="expense"?Wr:zo);function B(){return a.value&&M.value.includes(a.value)?a.value:M.value[0]}function oe(){const ae=String(u.value??"").trim(),T=Number(ae);if(!ae||!isFinite(T)||T<=0){w.value="请填写大于 0 的金额";return}if(!f.value){w.value="请选择日期";return}const E=o.value==="expense"&&y.value?1:0;s("save",{type:o.value,category:B(),amount:Math.round(T*100),date:f.value,note:String(h.value??"").trim(),reimbursable:E,reimbursed:E&&m.value?1:0})}return(ae,T)=>(F(),It(qs,{to:"body"},[Oe(ns,{name:"modal"},{default:fr(()=>[e.open?(F(),q("div",{key:0,class:"mask",onClick:T[11]||(T[11]=Mr(E=>s("cancel"),["self"]))},[c("div",{class:"dialog",role:"dialog","aria-label":e.title},[c("div",cb,[c("span",db,se(e.title),1),c("button",{class:"icon-btn",title:"关闭",onClick:T[0]||(T[0]=E=>s("cancel"))},[Oe(ut,{name:"close",size:16})])]),c("div",fb,[c("div",pb,[c("div",hb,[T[12]||(T[12]=c("label",null,"类型",-1)),c("div",vb,[c("button",{class:tt(["seg-btn",{active:o.value==="expense"}]),onClick:T[1]||(T[1]=E=>o.value="expense")},"支出",2),c("button",{class:tt(["seg-btn",{active:o.value==="income"}]),onClick:T[2]||(T[2]=E=>o.value="income")},"收入",2)])]),c("div",mb,[T[13]||(T[13]=c("label",null,"金额(元,必填)",-1)),$e(c("input",{ref_key:"amountInput",ref:C,class:tt(["input",{invalid:w.value}]),"onUpdate:modelValue":T[3]||(T[3]=E=>u.value=E),type:"number",min:"0",step:"0.01",placeholder:"0.00"},null,2),[[Re,u.value]])]),c("div",yb,[T[14]||(T[14]=c("label",null,"日期(必填)",-1)),$e(c("input",{class:"input",type:"date","onUpdate:modelValue":T[4]||(T[4]=E=>f.value=E)},null,512),[[Re,f.value]])]),c("div",gb,[T[15]||(T[15]=c("label",null,"分类",-1)),$e(c("select",{class:"select","onUpdate:modelValue":T[5]||(T[5]=E=>a.value=E)},[(F(!0),q(Le,null,ct(M.value,E=>(F(),q("option",{key:E,value:E},se(E),9,bb))),128))],512),[[Fn,a.value]])]),o.value==="expense"?(F(),q("div",wb,[T[16]||(T[16]=c("label",null,"报销状态",-1)),c("div",_b,[c("button",{class:tt(["seg-btn",{active:!y.value}]),onClick:T[6]||(T[6]=E=>{y.value=!1,m.value=!1})},"无需报销",2),c("button",{class:tt(["seg-btn",{active:y.value&&!m.value}]),onClick:T[7]||(T[7]=E=>{y.value=!0,m.value=!1})},"待报销",2),c("button",{class:tt(["seg-btn",{active:y.value&&m.value}]),onClick:T[8]||(T[8]=E=>{y.value=!0,m.value=!0})},"已报销",2)])])):Ee("",!0),c("div",kb,[T[17]||(T[17]=c("label",null,"备注",-1)),$e(c("textarea",{class:"textarea","onUpdate:modelValue":T[9]||(T[9]=E=>h.value=E),placeholder:"选填"},null,512),[[Re,h.value]])])]),w.value?(F(),q("div",xb,se(w.value),1)):Ee("",!0)]),c("div",Cb,[c("button",{class:"btn btn-sm",onClick:T[10]||(T[10]=E=>s("cancel"))},"取消"),c("button",{class:"btn btn-primary btn-sm",onClick:oe},"保存")])],8,ub)])):Ee("",!0)]),_:1})]))}}),Eb=Gt(Sb,[["__scopeId","data-v-edca3327"]]),$b={class:"ledger-page"},Ab={class:"ledger-toolbar"},Pb={class:"month-title num"},Tb={class:"cards"},Ob={class:"card stat-card"},Mb={class:"stat-num num amt-income"},Ib={class:"card stat-card"},jb={class:"stat-num num"},Db={class:"card stat-card"},Rb={class:"card stat-card"},Lb={class:"stat-num num amt-warn"},Kb={class:"card sec"},Fb={class:"form-grid"},Nb={class:"field span2"},Vb={class:"seg"},Bb={class:"field"},Ub={class:"field"},qb={class:"field"},Hb=["value"],Wb={key:0,class:"field"},zb={class:"field span2"},Gb={key:0,class:"form-error"},Yb={class:"form-footer"},Jb=["disabled"],Xb=["disabled"],Qb={key:0,class:"card sec"},Zb={class:"bar-label"},ew={class:"bar-track"},tw={class:"muted num bar-num"},nw={key:1,class:"card section"},rw={class:"form-error"},sw={class:"card table-card"},ow={class:"tx-table"},iw={class:"num"},aw={class:"tag"},lw={class:"td-note"},uw={key:0,class:"muted"},cw={key:1,class:"tx-done"},dw={key:2,class:"tx-pending"},fw={class:"ops"},pw=["onClick"],hw=["onClick"],vw=["onClick"],mw={key:0},yw={class:"muted vault-note num"},gw=Vt({__name:"LedgerView",setup(e){const t=N(xt()),n=N([]),s=N(!0),o=N("expense"),a=N(""),u=N(Wr[0]),f=N(xt()),h=N(""),y=N(!1),m=N(""),w=N(""),C=N(!1),S=N(!1),M=N(null),B=N({type:"expense",category:Wr[0],amountYuan:"",date:xt(),note:"",reimbursable:0,reimbursed:0}),oe=N(null),ae=at(()=>t.value.slice(0,7)+"-01"),T=at(()=>{const Q=Number(t.value.slice(0,4)),Z=Number(t.value.slice(5,7))-1,_e=new Date(Q,Z+1,0).getDate();return t.value.slice(0,7)+"-"+(_e<10?"0"+_e:String(_e))}),E=at(()=>Number(t.value.slice(0,4))+" 年 "+Number(t.value.slice(5,7))+" 月");async function X(){s.value=!0;try{n.value=await Yv(ae.value,T.value),w.value=""}catch(Q){w.value="账目加载失败:"+(Q instanceof Error?Q.stack||Q.message:String(Q)),Be("账目加载失败")}s.value=!1}dn(X),mt(t,X),mt(o,Q=>{u.value=Q==="expense"?Wr[0]:zo[0]});const de=at(()=>n.value.slice().sort((Q,Z)=>Q.date===Z.date?Z.id-Q.id:Q.date<Z.date?1:-1)),ie=at(()=>{let Q=0,Z=0,_e=0;for(const Ve of n.value)Ve.type==="income"?Q+=Ve.amount:(Z+=Ve.amount,Ve.reimbursable===1&&Ve.reimbursed!==1&&(_e+=Ve.amount));return{income:Q,expense:Z,pending:_e,balance:Q-Z}}),te=N("all"),O=N("all"),j=at(()=>de.value.filter(Q=>!(te.value!=="all"&&Q.type!==te.value||O.value==="pending"&&!(Q.type==="expense"&&Q.reimbursable===1&&Q.reimbursed!==1)||O.value==="done"&&!(Q.reimbursable===1&&Q.reimbursed===1)))),ce=at(()=>{const Q=new Map;let Z=0;for(const Ve of n.value)Ve.type==="expense"&&(Q.set(Ve.category,(Q.get(Ve.category)||0)+Ve.amount),Z+=Ve.amount);const _e=Z||1;return Array.from(Q.entries()).map(Ve=>({name:Ve[0],amount:Ve[1],percent:Math.round(Ve[1]/_e*100)})).sort((Ve,ft)=>ft.amount-Ve.amount)});function ke(Q){return(Q/100).toFixed(2)}function J(Q){return(Q.type==="income"?"+":"-")+ke(Q.amount)}function xe(){t.value=Go(t.value,-1)}function Ue(){t.value=Go(t.value,1)}function rt(){t.value=xt()}mt(a,()=>{m.value&&(m.value="")});async function We(){const Q=String(a.value??"").trim(),Z=Number(Q);if(!Q||!isFinite(Z)||Z<=0){m.value="请填写大于 0 的金额";return}if(!f.value){m.value="请选择日期";return}if(!C.value){C.value=!0;try{await Jv({type:o.value,category:u.value,amount:Math.round(Z*100),date:f.value,note:String(h.value??"").trim(),reimbursable:o.value==="expense"&&y.value?1:0,reimbursed:0})}catch(_e){Be("添加失败:"+(_e instanceof Error?_e.message:String(_e))),C.value=!1;return}a.value="",h.value="",y.value=!1,m.value="",await X(),Be("记账已添加"),C.value=!1}}const Ye=at(()=>String(a.value??"").trim()!==""||String(h.value??"").trim()!=="");function me(){a.value="",h.value="",y.value=!1,m.value=""}async function Me(Q){await Zv(Q.id),await X(),Be("已标记为已报销")}function Fe(Q){M.value=Q.id,B.value={type:Q.type,category:Q.category,amountYuan:ke(Q.amount),date:Q.date,note:Q.note||"",reimbursable:Q.reimbursable,reimbursed:Q.reimbursed},S.value=!0}async function De(Q){const Z=M.value;await Xv(Z,Q),S.value=!1,await X(),Be("账目已更新")}async function Ce(){oe.value&&oe.value.id&&await Qv(oe.value.id),oe.value=null,await X(),Be("账目已删除")}return(Q,Z)=>(F(),q("div",$b,[c("div",Ab,[c("button",{class:"icon-btn",onClick:xe},[Oe(ut,{name:"chevron-left",size:16})]),c("span",Pb,se(E.value),1),c("button",{class:"icon-btn",onClick:Ue},[Oe(ut,{name:"chevron-right",size:16})]),c("button",{class:"btn btn-sm",onClick:rt},"回到本月"),Z[13]||(Z[13]=c("span",{class:"flex1"},null,-1)),$e(c("select",{class:"select w-filter","onUpdate:modelValue":Z[0]||(Z[0]=_e=>te.value=_e)},[...Z[11]||(Z[11]=[c("option",{value:"all"},"全部类型",-1),c("option",{value:"expense"},"仅支出",-1),c("option",{value:"income"},"仅收入",-1)])],512),[[Fn,te.value]]),$e(c("select",{class:"select w-filter","onUpdate:modelValue":Z[1]||(Z[1]=_e=>O.value=_e)},[...Z[12]||(Z[12]=[c("option",{value:"all"},"全部报销",-1),c("option",{value:"pending"},"待报销",-1),c("option",{value:"done"},"已报销",-1)])],512),[[Fn,O.value]])]),c("div",Tb,[c("div",Ob,[Z[14]||(Z[14]=c("div",{class:"muted"},"本月收入(元)",-1)),c("div",Mb,se(ke(ie.value.income)),1)]),c("div",Ib,[Z[15]||(Z[15]=c("div",{class:"muted"},"本月支出(元)",-1)),c("div",jb,se(ke(ie.value.expense)),1)]),c("div",Db,[Z[16]||(Z[16]=c("div",{class:"muted"},"本月结余(元)",-1)),c("div",{class:tt(["stat-num num",{"amt-income":ie.value.balance>=0,"amt-expense":ie.value.balance<0}])},se(ke(ie.value.balance)),3)]),c("div",Rb,[Z[17]||(Z[17]=c("div",{class:"muted"},"待报销(元)",-1)),c("div",Lb,se(ke(ie.value.pending)),1)])]),c("div",Kb,[Z[24]||(Z[24]=c("div",{class:"sec-head"},[c("span",{class:"sec-title"},"新增一笔"),c("span",{class:"muted form-hint"},"金额必填,回车快速添加")],-1)),c("div",Fb,[c("div",Nb,[Z[18]||(Z[18]=c("label",null,"类型",-1)),c("div",Vb,[c("button",{class:tt(["seg-btn",{active:o.value==="expense"}]),onClick:Z[2]||(Z[2]=_e=>o.value="expense")},"支出",2),c("button",{class:tt(["seg-btn",{active:o.value==="income"}]),onClick:Z[3]||(Z[3]=_e=>o.value="income")},"收入",2)])]),c("div",Bb,[Z[19]||(Z[19]=c("label",null,"金额(元,必填)",-1)),$e(c("input",{class:tt(["input",{invalid:m.value}]),"onUpdate:modelValue":Z[4]||(Z[4]=_e=>a.value=_e),type:"number",min:"0",step:"0.01",placeholder:"0.00",onKeydown:jt(We,["enter"])},null,34),[[Re,a.value]])]),c("div",Ub,[Z[20]||(Z[20]=c("label",null,"日期",-1)),$e(c("input",{class:"input",type:"date","onUpdate:modelValue":Z[5]||(Z[5]=_e=>f.value=_e)},null,512),[[Re,f.value]])]),c("div",qb,[Z[21]||(Z[21]=c("label",null,"分类",-1)),$e(c("select",{class:"select","onUpdate:modelValue":Z[6]||(Z[6]=_e=>u.value=_e)},[(F(!0),q(Le,null,ct(o.value==="expense"?Qt(Wr):Qt(zo),_e=>(F(),q("option",{key:_e,value:_e},se(_e),9,Hb))),128))],512),[[Fn,u.value]])]),o.value==="expense"?(F(),q("div",Wb,[Z[22]||(Z[22]=c("label",null,"报销",-1)),c("button",{class:tt(["toggle-btn",{on:y.value}]),onClick:Z[7]||(Z[7]=_e=>y.value=!y.value)},se(y.value?"需要报销":"无需报销"),3)])):Ee("",!0),c("div",zb,[Z[23]||(Z[23]=c("label",null,"备注",-1)),$e(c("input",{class:"input","onUpdate:modelValue":Z[8]||(Z[8]=_e=>h.value=_e),placeholder:"选填,如:客户现场午餐",onKeydown:jt(We,["enter"])},null,544),[[Re,h.value]])])]),m.value?(F(),q("div",Gb,se(m.value),1)):Ee("",!0),c("div",Yb,[c("button",{class:"btn btn-sm",disabled:!Ye.value,onClick:me},"重置",8,Jb),c("button",{class:"btn btn-primary btn-sm",disabled:C.value,onClick:We},"添加记录",8,Xb)])]),ce.value.length?(F(),q("div",Qb,[Z[25]||(Z[25]=c("div",{class:"sec-title"},"本月支出分类",-1)),(F(!0),q(Le,null,ct(ce.value,_e=>(F(),q("div",{key:_e.name,class:"bar-row"},[c("span",Zb,se(_e.name),1),c("span",ew,[c("span",{class:"bar-fill",style:or({width:_e.percent+"%"})},null,4)]),c("span",tw,se(ke(_e.amount))+" 元 · "+se(_e.percent)+"%",1)]))),128))])):Ee("",!0),w.value?(F(),q("div",nw,[c("div",rw,se(w.value),1),Z[26]||(Z[26]=c("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):Ee("",!0),c("div",sw,[c("table",ow,[Z[28]||(Z[28]=c("thead",null,[c("tr",null,[c("th",null,"日期"),c("th",null,"分类"),c("th",null,"金额(元)"),c("th",null,"备注"),c("th",null,"报销"),c("th",{class:"th-ops"},"操作")])],-1)),c("tbody",null,[(F(!0),q(Le,null,ct(j.value,_e=>(F(),q("tr",{key:_e.id},[c("td",iw,se(_e.date),1),c("td",null,[c("span",aw,se(_e.category),1)]),c("td",{class:tt(["num",_e.type==="income"?"amt-income":"amt-expense"])},se(J(_e)),3),c("td",lw,se(_e.note||"--"),1),c("td",null,[_e.type!=="expense"||_e.reimbursable!==1?(F(),q("span",uw,"--")):_e.reimbursed===1?(F(),q("span",cw,"已报销")):(F(),q("span",dw,"待报销"))]),c("td",null,[c("div",fw,[_e.type==="expense"&&_e.reimbursable===1&&_e.reimbursed!==1?(F(),q("button",{key:0,class:"btn btn-xs",onClick:Ve=>Me(_e)},"标记已报销",8,pw)):Ee("",!0),c("button",{class:"btn btn-xs",onClick:Ve=>Fe(_e)},"编辑",8,hw),c("button",{class:"btn btn-xs",onClick:Ve=>oe.value=_e},"删除",8,vw)])])]))),128)),!j.value.length&&!s.value?(F(),q("tr",mw,[...Z[27]||(Z[27]=[c("td",{colspan:"6",class:"empty muted"},"本月暂无账目",-1)])])):Ee("",!0)])])]),c("div",yw,"筛选结果 "+se(j.value.length)+" 条 / 本月共 "+se(n.value.length)+" 条",1),Oe(Eb,{open:S.value,title:(M.value,"编辑账目"),initial:B.value,onCancel:Z[9]||(Z[9]=_e=>S.value=!1),onSave:De},null,8,["open","title","initial"]),Oe(cr,{open:!!oe.value,title:"删除确认",message:oe.value?"将删除 "+oe.value.date+" 的账目("+oe.value.category+" "+ke(oe.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Z[10]||(Z[10]=_e=>oe.value=null),onConfirm:Ce},null,8,["open","message"])]))}}),bw=Gt(gw,[["__scopeId","data-v-0f950d19"]]),ww={class:"memo-page"},_w={class:"card memo-list"},kw={class:"pane-head"},xw={class:"pane-title"},Cw={class:"memo-scroll"},Sw=["onClick"],Ew={class:"memo-item-title"},$w={class:"muted memo-item-sub"},Aw={class:"muted num memo-item-time"},Pw={key:0,class:"muted empty"},Tw={class:"card memo-editor"},Ow={class:"editor-foot"},Mw={class:"muted foot-info"},Iw=["disabled"],jw=["disabled"],Dw={key:1,class:"empty muted editor-empty"},Rw=Vt({__name:"MemoView",setup(e){const t=N([]),n=N(null),s=N(!1),o=N(""),a=N(""),u=N(null),f=N(null);async function h(){if(t.value=await Uv(),n.value&&n.value.id){const ie=t.value.find(te=>te.id===n.value.id);ie&&(n.value=ie)}}dn(async()=>{await h(),t.value.length&&w(t.value[0]),window.addEventListener("keydown",y)}),pr(()=>window.removeEventListener("keydown",y)),mt(ja,async ie=>{if(!ie)return;t.value.length||await h();const te=t.value.find(O=>O.id===ie);ja.value=null,te&&C(te)},{immediate:!0});function y(ie){(ie.ctrlKey||ie.metaKey)&&ie.key.toLowerCase()==="s"&&s.value&&m.value&&(ie.preventDefault(),oe())}const m=at(()=>{if(!s.value)return!1;const ie=n.value?n.value.title:"",te=n.value?n.value.content:"";return o.value!==ie||a.value!==te});function w(ie){n.value=ie,s.value=!0,o.value=ie.title,a.value=ie.content}function C(ie){if(!(s.value&&n.value&&n.value.id===ie.id)){if(m.value){f.value={type:"select",memo:ie};return}w(ie)}}function S(){if(m.value){f.value={type:"new"};return}M()}function M(){n.value=null,s.value=!0,o.value="",a.value=""}function B(){n.value?w(n.value):M()}async function oe(){if(!o.value.trim()&&!a.value.trim()){Be("标题与内容不能都为空");return}if(n.value&&n.value.id)await Hv(n.value.id,o.value,a.value),Be("备忘已保存");else{const ie=await qv(o.value,a.value);n.value=ie,o.value=ie.title,a.value=ie.content,Be("备忘已创建")}await h()}function ae(){n.value&&n.value.id&&(u.value=n.value)}async function T(){u.value&&u.value.id&&(await Wv(u.value.id),Be("备忘已删除")),u.value=null,await h(),M()}function E(){const ie=f.value;f.value=null,ie&&(ie.type==="select"?w(ie.memo):M())}function X(ie){return(ie.content||"").replace(/\s+/g," ").slice(0,30)}function de(ie){return ie.replace("T"," ").slice(0,16)}return(ie,te)=>(F(),q("div",ww,[c("aside",_w,[c("div",kw,[c("span",xw,"备忘录("+se(t.value.length)+")",1),c("button",{class:"btn btn-primary btn-sm",onClick:S},"新建")]),c("div",Cw,[(F(!0),q(Le,null,ct(t.value,O=>(F(),q("div",{key:O.id,class:tt(["memo-item",{active:s.value&&n.value&&n.value.id===O.id}]),onClick:j=>C(O)},[c("div",Ew,se(O.title||"无标题"),1),c("div",$w,se(X(O)||"空"),1),c("div",Aw,se(de(O.updated_at)),1)],10,Sw))),128)),t.value.length?Ee("",!0):(F(),q("div",Pw,"暂无备忘"))])]),c("section",Tw,[s.value?(F(),q(Le,{key:0},[$e(c("input",{class:"input title-input","onUpdate:modelValue":te[0]||(te[0]=O=>o.value=O),placeholder:"标题"},null,512),[[Re,o.value]]),$e(c("textarea",{class:"textarea content-textarea","onUpdate:modelValue":te[1]||(te[1]=O=>a.value=O),placeholder:"内容"},null,512),[[Re,a.value]]),c("div",Ow,[c("span",Mw,[m.value?(F(),q(Le,{key:0},[nn("有未保存修改")],64)):n.value&&n.value.id?(F(),q(Le,{key:1},[nn("更新于 "+se(de(n.value.updated_at)),1)],64)):(F(),q(Le,{key:2},[nn("新备忘")],64))]),te[4]||(te[4]=c("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(F(),q("button",{key:0,class:"btn btn-sm",onClick:ae},"删除")):Ee("",!0),c("button",{class:"btn btn-sm",disabled:!m.value,onClick:B},"放弃修改",8,Iw),c("button",{class:"btn btn-primary btn-sm",disabled:!m.value,onClick:oe},"保存",8,jw)])],64)):(F(),q("div",Dw,"选择左侧备忘,或点击右上角新建"))]),Oe(cr,{open:!!u.value,title:"删除确认",message:u.value?"将删除备忘「"+(u.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:te[2]||(te[2]=O=>u.value=null),onConfirm:T},null,8,["open","message"]),Oe(cr,{open:!!f.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:te[3]||(te[3]=O=>f.value=null),onConfirm:E},null,8,["open"])]))}}),Lw=Gt(Rw,[["__scopeId","data-v-74d60dba"]]),Kw=["aria-label"],Fw={class:"dialog-head"},Nw={class:"dialog-title"},Vw={class:"dialog-body"},Bw={class:"form-grid"},Uw={class:"field span2"},qw={class:"field span2"},Hw={class:"field span2"},Ww={class:"pwd-row"},zw={class:"field span2"},Gw={key:0,class:"form-error"},Yw={class:"dialog-btns"},Jw=Vt({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=N(""),a=N(""),u=N(""),f=N(""),h=N(""),y=N(null);function m(S){n.open&&S.key==="Escape"&&s("cancel")}mt(()=>n.open,async S=>{var M;S?(o.value=n.initial.system,a.value=n.initial.account,u.value=n.initial.password,f.value=n.initial.remark,h.value="",window.addEventListener("keydown",m),await ts(),(M=y.value)==null||M.focus()):window.removeEventListener("keydown",m)}),pr(()=>window.removeEventListener("keydown",m));function w(){const S="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",M="!@#$%^&*",B=crypto.getRandomValues(new Uint8Array(14));let oe="";for(let ae=0;ae<B.length;ae++)oe+=S[B[ae]%S.length];oe+=M[crypto.getRandomValues(new Uint8Array(1))[0]%M.length],u.value=oe,h.value=""}function C(){if(!o.value.trim()||!a.value.trim()||!u.value){h.value="系统名称、账号、密码为必填项";return}s("save",{system:o.value.trim(),account:a.value.trim(),password:u.value,remark:f.value.trim()})}return(S,M)=>(F(),It(qs,{to:"body"},[Oe(ns,{name:"modal"},{default:fr(()=>[e.open?(F(),q("div",{key:0,class:"mask",onClick:M[6]||(M[6]=Mr(B=>s("cancel"),["self"]))},[c("div",{class:"dialog",role:"dialog","aria-label":e.title},[c("div",Fw,[c("span",Nw,se(e.title),1),c("button",{class:"icon-btn",title:"关闭",onClick:M[0]||(M[0]=B=>s("cancel"))},[Oe(ut,{name:"close",size:16})])]),c("div",Vw,[c("div",Bw,[c("div",Uw,[M[7]||(M[7]=c("label",null,"系统名称(必填)",-1)),$e(c("input",{ref_key:"systemInput",ref:y,class:"input","onUpdate:modelValue":M[1]||(M[1]=B=>o.value=B),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[Re,o.value]])]),c("div",qw,[M[8]||(M[8]=c("label",null,"账号(必填)",-1)),$e(c("input",{class:"input","onUpdate:modelValue":M[2]||(M[2]=B=>a.value=B),placeholder:"用户名、工号或邮箱"},null,512),[[Re,a.value]])]),c("div",Hw,[M[9]||(M[9]=c("label",null,"密码(必填)",-1)),c("div",Ww,[$e(c("input",{class:"input","onUpdate:modelValue":M[3]||(M[3]=B=>u.value=B),placeholder:"输入或点击生成"},null,512),[[Re,u.value]]),c("button",{class:"btn btn-sm",onClick:w},"生成")])]),c("div",zw,[M[10]||(M[10]=c("label",null,"备注",-1)),$e(c("textarea",{class:"textarea","onUpdate:modelValue":M[4]||(M[4]=B=>f.value=B),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[Re,f.value]])])]),h.value?(F(),q("div",Gw,se(h.value),1)):Ee("",!0)]),c("div",Yw,[c("button",{class:"btn btn-sm",onClick:M[5]||(M[5]=B=>s("cancel"))},"取消"),c("button",{class:"btn btn-primary btn-sm",onClick:C},"保存")])],8,Kw)])):Ee("",!0)]),_:1})]))}}),Xw=Gt(Jw,[["__scopeId","data-v-f383b0a6"]]),_d=15e4;function Jo(e){const t=new Uint8Array(e);let n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return btoa(n)}function Xo(e){const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}function ul(){return Jo(crypto.getRandomValues(new Uint8Array(16)).buffer)}async function Qo(e,t){const n=new TextEncoder,s=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveBits"]),o=await crypto.subtle.deriveBits({name:"PBKDF2",salt:Xo(t),iterations:_d,hash:"SHA-256"},s,256);return Jo(o)}async function Zo(e,t){const n=new TextEncoder,s=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:Xo(t),iterations:_d,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function ei(e,t){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,new TextEncoder().encode(t));return Jo(n.buffer)+":"+Jo(s)}async function bi(e,t){const n=t.split(":");if(n.length!==2)throw new Error("密文格式错误");const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:Xo(n[0])},e,Xo(n[1]));return new TextDecoder().decode(s)}const kd="intern-log-vault-verify",es="enc:v1:";let Dr=null;function Qw(){return Dr!==null}function ti(){Dr=null}async function xd(){return await bt("pwd_salt","")!==""}async function Zw(e){if(e.length<6)throw new Error("主密码至少 6 位");if(await xd())throw new Error("主密码已设置");const t=ul(),n=await Zo(e,t),s=await ei(n,kd);await kt("pwd_salt",t),await kt("pwd_verifier",s),Dr=n}async function e_(e){const t=await bt("pwd_salt","");if(!t)throw new Error("主密码尚未设置");const n=await Zo(e,t),s=await bt("pwd_verifier","");try{await bi(n,s)}catch{throw new Error("主密码不正确")}Dr=n}async function Cd(){if(!Dr)throw new Error("密码库未解锁");return Dr}async function t_(e){const t=await Cd();return es+await ei(t,e)}async function n_(e){if(!e)return"";if(!e.startsWith(es))return e;const t=await Cd();return bi(t,e.slice(es.length))}async function r_(){return ee.credential.orderBy("system").toArray()}async function s_(e,t){const n=await t_(e.password),s={system:e.system.trim(),account:e.account.trim(),password:n,remark:e.remark.trim()};t?await ee.credential.update(t,{...s,updated_at:vt()}):await ee.credential.add({...s,created_at:vt(),updated_at:vt()})}async function o_(e){await ee.credential.delete(e)}async function ha(e){const t=await ee.credential.get(e);if(!t)throw new Error("记录不存在");return n_(t.password)}async function i_(e,t){if(!e)throw new Error("请输入旧主密码");if(t.length<6)throw new Error("新主密码至少 6 位");if(t===e)throw new Error("新主密码不能与旧主密码相同");const n=await bt("pwd_salt","");if(!n)throw new Error("密码库尚未初始化");const s=await Zo(e,n),o=await bt("pwd_verifier","");try{await bi(s,o)}catch{throw new Error("旧主密码不正确")}const a=await Zo(t,n),u=await ee.credential.toArray();let f=0;for(const h of u){if(h.id==null)continue;const y=await a_(h.password,s),m=es+await ei(a,y);await ee.credential.update(h.id,{password:m}),f++}return await kt("pwd_verifier",await ei(a,kd)),Dr=a,f}async function a_(e,t){return e?e.startsWith(es)?bi(t,e.slice(es.length)):e:""}const l_={class:"vault-page"},u_={key:0,class:"empty muted"},c_={key:1,class:"card lock-card"},d_={class:"lock-badge"},f_={key:0,class:"form-error"},p_=["disabled"],h_={key:0,class:"form-error"},v_=["disabled"],m_={class:"vault-toolbar"},y_={class:"search-wrap"},g_={class:"card table-card"},b_={class:"cred-table"},w_={class:"td-system"},__=["onClick"],k_={class:"pwd-cell"},x_={class:"num pwd-text"},C_=["onClick"],S_=["onClick"],E_={class:"td-remark"},$_={class:"ops"},A_=["onClick"],P_=["onClick"],T_={key:0},O_={class:"muted vault-note num"},M_={class:"dialog pwd-dialog"},I_={class:"dialog-head"},j_={class:"dialog-body"},D_={class:"vp-field"},R_={class:"vp-field"},L_={class:"vp-field"},K_={key:0,class:"form-error"},F_={class:"dialog-btns"},N_=5*60*1e3,V_=Vt({__name:"VaultView",setup(e){const t=N(null),n=N(Qw()),s=N(!1),o=N(""),a=N(""),u=N(""),f=N(""),h=N(""),y=N([]),m=N(""),w=N({}),C=N(!1),S=N(null),M=N({system:"",account:"",password:"",remark:""}),B=N(null),oe=N(!1),ae=N(""),T=N(""),E=N(""),X=N("");async function de(){y.value=await r_(),w.value={}}let ie=null;function te(){ie!==null&&window.clearTimeout(ie),ie=window.setTimeout(()=>{n.value&&(ti(),n.value=!1,y.value=[],w.value={},Be("长时间未操作,密码库已自动锁定"))},N_)}function O(){n.value&&te()}dn(async()=>{t.value=await xd(),window.addEventListener("click",O),window.addEventListener("keydown",O),n.value&&te()}),pr(()=>{window.removeEventListener("click",O),window.removeEventListener("keydown",O),ie!==null&&window.clearTimeout(ie)});const j=at(()=>{const Ce=m.value.trim().toLowerCase();return Ce?y.value.filter(Q=>(Q.system+" "+Q.account+" "+(Q.remark||"")).toLowerCase().includes(Ce)):y.value});async function ce(){if(!s.value){if(u.value="",!o.value){u.value="请输入主密码";return}if(o.value.length<6){u.value="主密码至少 6 位";return}if(o.value!==a.value){u.value="两次输入的主密码不一致";return}s.value=!0;try{await Zw(o.value),o.value="",a.value="",n.value=!0,te(),await de(),Be("主密码已设置,密码库已解锁")}catch(Ce){u.value=Ce instanceof Error?Ce.message:"设置失败"}s.value=!1}}async function ke(){if(!s.value){if(h.value="",!f.value){h.value="请输入主密码";return}s.value=!0;try{await e_(f.value),f.value="",n.value=!0,te(),await de()}catch(Ce){h.value=Ce instanceof Error?Ce.message:"解锁失败"}s.value=!1}}function J(){ti(),n.value=!1,y.value=[],w.value={},ie!==null&&window.clearTimeout(ie),Be("密码库已锁定")}async function xe(Ce){const Q=Ce.id;if(w.value[Q]){w.value[Q]=!1;return}try{Ce.passwordPlain=await ha(Q),w.value[Q]=!0}catch(Z){Be(Z instanceof Error?Z.message:"解密失败")}}async function Ue(Ce){try{const Q=await ha(Ce.id);await Da(Q),Be("密码已复制")}catch(Q){Be(Q instanceof Error?Q.message:"复制失败")}}async function rt(Ce){await Da(Ce.account),Be("账号已复制")}function We(){S.value=null,M.value={system:"",account:"",password:"",remark:""},C.value=!0}async function Ye(Ce){try{const Q=await ha(Ce.id);S.value=Ce.id,M.value={system:Ce.system,account:Ce.account,password:Q,remark:Ce.remark||""},C.value=!0}catch(Q){Be(Q instanceof Error?Q.message:"解密失败")}}async function me(Ce){const Q=S.value??void 0;await s_(Ce,Q),C.value=!1,await de(),Be(Q?"账号已更新":"账号已添加")}async function Me(){B.value&&B.value.id&&(await o_(B.value.id),Be("账号已删除")),B.value=null,await de()}function Fe(){ae.value="",T.value="",E.value="",X.value="",oe.value=!0}async function De(){X.value="";try{const Ce=await i_(ae.value,T.value);oe.value=!1,ae.value="",T.value="",E.value="",Be("主密码已修改,"+Ce+" 条账号密码已重新加密")}catch(Ce){X.value=Ce instanceof Error?Ce.message:"修改失败"}}return(Ce,Q)=>(F(),q("div",l_,[t.value===null?(F(),q("div",u_,"加载中")):n.value?(F(),q(Le,{key:2},[c("div",m_,[c("div",y_,[Oe(ut,{name:"search",size:14,class:"search-icon"}),$e(c("input",{class:"input","onUpdate:modelValue":Q[3]||(Q[3]=Z=>m.value=Z),placeholder:"搜索系统名称、账号或备注"},null,512),[[Re,m.value]])]),Q[16]||(Q[16]=c("span",{class:"flex1"},null,-1)),c("button",{class:"btn btn-sm",onClick:Fe},"修改主密码"),c("button",{class:"btn btn-sm",onClick:J},"锁定"),c("button",{class:"btn btn-primary btn-sm",onClick:We},"新增账号")]),c("div",g_,[c("table",b_,[Q[18]||(Q[18]=c("thead",null,[c("tr",null,[c("th",null,"系统名称"),c("th",null,"账号"),c("th",null,"密码"),c("th",null,"备注"),c("th",{class:"th-ops"},"操作")])],-1)),c("tbody",null,[(F(!0),q(Le,null,ct(j.value,Z=>(F(),q("tr",{key:Z.id},[c("td",w_,se(Z.system),1),c("td",null,[c("span",{class:"copyable",title:"点击复制账号",onClick:_e=>rt(Z)},se(Z.account),9,__)]),c("td",null,[c("div",k_,[c("span",x_,se(w.value[Z.id]?Z.passwordPlain:"........"),1),c("button",{class:"btn btn-xs",onClick:_e=>xe(Z)},se(w.value[Z.id]?"隐藏":"显示"),9,C_),c("button",{class:"btn btn-xs",onClick:_e=>Ue(Z)},"复制",8,S_)])]),c("td",E_,se(Z.remark||"--"),1),c("td",null,[c("div",$_,[c("button",{class:"btn btn-xs",onClick:_e=>Ye(Z)},"编辑",8,A_),c("button",{class:"btn btn-xs",onClick:_e=>B.value=Z},"删除",8,P_)])])]))),128)),j.value.length?Ee("",!0):(F(),q("tr",T_,[...Q[17]||(Q[17]=[c("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),c("div",O_,"共 "+se(y.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密存储于本机",1)],64)):(F(),q("div",c_,[c("div",d_,[Oe(ut,{name:"lock",size:26})]),t.value===!1?(F(),q(Le,{key:0},[Q[12]||(Q[12]=c("div",{class:"lock-title"},"设置主密码",-1)),Q[13]||(Q[13]=c("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":Q[0]||(Q[0]=Z=>o.value=Z),placeholder:"设置主密码(至少 6 位)",onKeydown:jt(ce,["enter"])},null,544),[[Re,o.value]]),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":Q[1]||(Q[1]=Z=>a.value=Z),placeholder:"再次输入主密码",onKeydown:jt(ce,["enter"])},null,544),[[Re,a.value]]),u.value?(F(),q("div",f_,se(u.value),1)):Ee("",!0),c("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:ce},"完成设置并解锁",8,p_)],64)):(F(),q(Le,{key:1},[Q[14]||(Q[14]=c("div",{class:"lock-title"},"密码库已锁定",-1)),Q[15]||(Q[15]=c("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":Q[2]||(Q[2]=Z=>f.value=Z),placeholder:"主密码",onKeydown:jt(ke,["enter"])},null,544),[[Re,f.value]]),h.value?(F(),q("div",h_,se(h.value),1)):Ee("",!0),c("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:ke},"解锁",8,v_)],64))])),Oe(Xw,{open:C.value,title:S.value?"编辑账号":"新增账号",initial:M.value,onCancel:Q[4]||(Q[4]=Z=>C.value=!1),onSave:me},null,8,["open","title","initial"]),Oe(cr,{open:!!B.value,title:"删除确认",message:B.value?"将删除系统「"+B.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Q[5]||(Q[5]=Z=>B.value=null),onConfirm:Me},null,8,["open","message"]),(F(),It(qs,{to:"body"},[Oe(ns,{name:"modal"},{default:fr(()=>[oe.value?(F(),q("div",{key:0,class:"mask",onClick:Q[11]||(Q[11]=Mr(Z=>oe.value=!1,["self"]))},[c("div",M_,[c("div",I_,[Q[19]||(Q[19]=c("span",{class:"dialog-title"},"修改主密码",-1)),c("button",{class:"icon-btn",title:"关闭",onClick:Q[6]||(Q[6]=Z=>oe.value=!1)},[Oe(ut,{name:"close",size:16})])]),c("div",j_,[c("div",D_,[Q[20]||(Q[20]=c("label",null,"旧主密码",-1)),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":Q[7]||(Q[7]=Z=>ae.value=Z)},null,512),[[Re,ae.value]])]),c("div",R_,[Q[21]||(Q[21]=c("label",null,"新主密码(至少 6 位)",-1)),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":Q[8]||(Q[8]=Z=>T.value=Z)},null,512),[[Re,T.value]])]),c("div",L_,[Q[22]||(Q[22]=c("label",null,"确认新主密码",-1)),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":Q[9]||(Q[9]=Z=>E.value=Z)},null,512),[[Re,E.value]])]),X.value?(F(),q("div",K_,se(X.value),1)):Ee("",!0),Q[23]||(Q[23]=c("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),c("div",F_,[c("button",{class:"btn btn-sm",onClick:Q[10]||(Q[10]=Z=>oe.value=!1)},"取消"),c("button",{class:"btn btn-primary btn-sm",onClick:De},"确认修改")])])])):Ee("",!0)]),_:1})]))]))}}),B_=Gt(V_,[["__scopeId","data-v-6820bc9c"]]);function U_(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Nu(e,t){const s="\uFEFF"+t.map(f=>f.map(U_).join(",")).join(`\r
|
||
`);if(Zr.isNativePlatform()){const{downloadText:f}=await yd(async()=>{const{downloadText:h}=await Promise.resolve().then(()=>Sg);return{downloadText:h}},void 0,import.meta.url);return f(e,s)}const o=new Blob([s],{type:"text/csv;charset=utf-8"}),a=URL.createObjectURL(o),u=document.createElement("a");return u.href=a,u.download=e,u.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e4),""}class q_ extends Ir{constructor(){super("intern_worklog_users"),this.version(1).stores({user:"id, &username"})}}const Or=new q_,wi="intern_worklog",cl="dsh_session_user";function Ys(){try{const e=localStorage.getItem(cl);if(!e)return null;const t=JSON.parse(e);if(t&&t.userId&&t.username)return t}catch{}return null}function Sd(e){localStorage.setItem(cl,JSON.stringify(e))}function Ed(){localStorage.removeItem(cl)}const dl="dsh_cloud_creds";function $d(e,t){localStorage.setItem(dl,JSON.stringify({username:e,password:t}))}function _i(){try{const e=localStorage.getItem(dl);if(!e)return null;const t=JSON.parse(e);if(t&&t.username&&t.password)return t}catch{}return null}function Ad(){localStorage.removeItem(dl)}let ni=null;function Ns(e){ni===e&&ee||(ee&&sl(),nv(new fd(wi+"_"+e)),ni=e)}async function H_(e,t,n){const s=e.trim();if(s.length<2||s.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");if(await Or.user.where("username").equals(s).first())throw new Error("用户名已存在");const a=ul(),u=await Qo(t,a),f="u_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,6);await Or.user.add({id:f,username:s,pwd_hash:u,pwd_salt:a,created_at:new Date().toISOString()}),Ns(f),n&&await Pd()&&(await J_(),await Or.user.update(f,{legacy_imported_at:new Date().toISOString()}));const h={userId:f,username:s};return Sd(h),$d(h.username,t),h}async function W_(e,t){const n=e.trim(),s=await Or.user.where("username").equals(n).first();if(!s)throw new Error("用户不存在");if(await Qo(t,s.pwd_salt)!==s.pwd_hash)throw new Error("密码不正确");Ns(s.id);const a={userId:s.id,username:s.username};return Sd(a),$d(a.username,t),a}async function z_(){ti(),sl(),ni=null,Ed(),Ad()}async function G_(e,t){const n=Ys();if(!n)throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const s=await Or.user.get(n.userId);if(!s)throw new Error("用户不存在");if(await Qo(e,s.pwd_salt)!==s.pwd_hash)throw new Error("旧密码不正确");const a=ul(),u=await Qo(t,a);await Or.user.update(s.id,{pwd_hash:u,pwd_salt:a})}async function Y_(){const e=Ys();if(!e)throw new Error("未登录");ti(),sl(),ni=null,await Ir.delete(wi+"_"+e.userId),await Or.user.delete(e.userId),Ed(),Ad()}async function Pd(){return Ir.exists(wi)}async function J_(){if(!ee)throw new Error("用户数据库未就绪");const e=new fd(wi),t=await Promise.all([e.project.toArray(),e.work_log.toArray(),e.log_item.toArray(),e.attendance.toArray(),e.weekly_note.toArray(),e.setting.toArray(),e.memo.toArray(),e.credential.toArray()]);await ee.transaction("rw",[ee.project,ee.work_log,ee.log_item,ee.attendance,ee.weekly_note,ee.setting,ee.memo,ee.credential],async()=>{await Promise.all([ee.project.clear(),ee.work_log.clear(),ee.log_item.clear(),ee.attendance.clear(),ee.weekly_note.clear(),ee.setting.clear(),ee.memo.clear(),ee.credential.clear()]),t[0].length&&await ee.project.bulkAdd(t[0]),t[1].length&&await ee.work_log.bulkAdd(t[1]),t[2].length&&await ee.log_item.bulkAdd(t[2]),t[3].length&&await ee.attendance.bulkAdd(t[3]),t[4].length&&await ee.weekly_note.bulkAdd(t[4]),t[5].length&&await ee.setting.bulkAdd(t[5]),t[6].length&&await ee.memo.bulkAdd(t[6]),t[7].length&&await ee.credential.bulkAdd(t[7])});const n=t[0].length+t[1].length+t[2].length+t[3].length+t[4].length+t[6].length+t[7].length;return e.close(),n}const $s=N(""),Vs=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","transaction"],Ra=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]),X_={project:"name",work_log:"date",attendance:"date",weekly_note:"week_start",setting:"key"};function Q_(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Vu(e){return JSON.stringify(e)}async function Z_(e){return ee.table(e).toArray()}function La(e,t){return e==="setting"?t.key:t.id}async function e1(){for(const e of Vs){const t=ee.table(e),n=await t.toArray();for(const s of n){if(e==="setting"&&Ra.has(s.key))continue;const o={};s.uuid||(o.uuid=Q_()),s.updated_at||(o.updated_at=s.created_at||vt()),Object.keys(o).length&&await t.update(La(e,s),o)}}}async function t1(){return _i()!=null}async function n1(){return bt("sync_last_time","")}async function Td(e,t){const n=await fetch(e+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.username.trim(),password:t.password})});if(!n.ok)throw new Error("云端账号或密码不正确");const s=await n.json();if(!s||!s.token)throw new Error("云端登录异常");return String(s.token)}async function r1(e,t){let n=await bt("sync_token","");return n||(n=await Td(e,t),await kt("sync_token",n),n)}let As=!1,jo=!1,Ka=!1,Gr=null,wn=null,Fa="",Bu=!1,Do=null;async function Yr(){if(As){jo=!0;return}try{if(!await t1())return;await Id(await Od()),$s.value=""}catch(e){$s.value=e instanceof Error?e.message:String(e)}}function s1(){if(Bu)return;Bu=!0,Do=tv(async()=>{const t={};for(const n of Vs)t[n]=await ee.table(n).count();return t}).subscribe({next:()=>{Ka||As||(Gr&&globalThis.clearTimeout(Gr),Gr=globalThis.setTimeout(()=>{Yr()},3e3))},error:()=>{}})}function o1(){Do&&(Do.unsubscribe(),Do=null),wn&&(wn.close(),wn=null,Fa=""),Gr&&(globalThis.clearTimeout(Gr),Gr=null)}function i1(e,t){const n=e+"|"+t;if(!(wn&&Fa===n)){wn&&(wn.close(),wn=null);try{wn=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),Fa=n,wn.onmessage=()=>{Yr()}}catch{wn=null}}}async function fl(){return await bt("sync_base_url","")||a1}const a1="https://daywk.linyux.cn";async function Od(){const e=_i();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await fl(),username:e.username,password:e.password}}async function Md(){const e=_i();if(!e)throw new Error("未登录");const t=await fl(),n={"Content-Type":"application/json"},s=JSON.stringify({username:e.username,password:e.password});let o=await fetch(t+"/api/auth/register",{method:"POST",headers:n,body:s});if(o.status===409){if(o=await fetch(t+"/api/auth/login",{method:"POST",headers:n,body:s}),!o.ok)throw new Error("云端已存在同名账号且密码不一致,请检查")}else if(!o.ok)throw new Error("云端绑定失败:"+o.status)}async function l1(){return Id(await Od())}function Uu(e,t,n){const s={};for(const o of Object.keys(t))o!=="id"&&(s[o]=t[o]);if(e==="log_item"){delete s.work_log_id,delete s.project_id;const o=t.work_log_id?n.workLog.get(t.work_log_id):null;o&&o.uuid&&(s.wuuid=o.uuid);const a=t.project_id?n.project.get(t.project_id):null;a&&a.uuid&&(s.puuid=a.uuid)}return s}async function qu(){const e=await ee.work_log.toArray(),t=await ee.project.toArray();return{workLog:new Map(e.map(n=>[n.id,n])),project:new Map(t.map(n=>[n.id,n]))}}let Ro=0;async function Id(e){if(As)return jo=!0,{pushed:0,pulled:0,removed:0,errors:0,at:""};As=!0,Ka=!0,Ro=0;try{const t=await u1(e);return jo&&(jo=!1,globalThis.setTimeout(()=>{Yr()},800)),t}finally{As=!1,Ka=!1}}async function u1(e){const t=e.baseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("请先配置同步服务地址");await e1();const n=await qu(),s=await ee.sync_mirror.toArray(),o=new Map;for(const E of s)o.set(E.table+"|"+E.uuid,E);const a={},u=[];let f=0;for(const E of Vs){let X=await Z_(E);E==="setting"&&(X=X.filter(ie=>!Ra.has(ie.key)));const de=new Map;for(const ie of X)de.set(ie.uuid,ie);for(const[ie,te]of de){const O=Uu(E,te,n),j=Vu(O),ce=o.get(E+"|"+ie);(!ce||ce.hash!==j)&&(a[E]=a[E]||[],a[E].push(O),f++)}for(const[ie,te]of o)ie.startsWith(E+"|")&&!de.has(te.uuid)&&u.push({table:E,uuid:te.uuid,deleted_at:vt()});a[E]=a[E]||[]}const h=await ee.tombstone.toArray();for(const E of h)u.push({table:E.table,uuid:E.uuid,deleted_at:E.deleted_at});const y=await r1(t,e),m=E=>fetch(t+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+E},body:JSON.stringify({device:"client",tables:a,tombstones:u})});let w=await m(y);if(w.status===401){await kt("sync_token","");const E=await Td(t,e);await kt("sync_token",E),w=await m(E)}if(!w.ok)throw new Error("同步服务返回 "+w.status);const C=await w.json(),S=C.tables||{},M=C.tombstones||[],B=await d1(S,M),oe=await qu(),ae=[];for(const E of Vs){const X=await ee.table(E).toArray();for(const de of X)E==="setting"&&Ra.has(de.key)||ae.push({table:E,uuid:de.uuid,hash:Vu(Uu(E,de,oe))})}await ee.sync_mirror.clear(),ae.length&&await ee.sync_mirror.bulkAdd(ae.map(E=>({...E}))),i1(t,y);const T=vt();if(await kt("sync_last_time",T),(B.pulled>0||B.removed>0)&&nr(),h.length){const E=new Set(h.map(X=>X.id));await ee.tombstone.where("id").anyOf(Array.from(E)).delete()}return{pushed:f,pulled:B.pulled,removed:B.removed,errors:B.errors,at:T}}let va=new Map,ma=new Map,c1=0;async function d1(e,t){let n=0,s=0;for(const o of Vs){const a=ee.table(o),u=await a.toArray(),f=new Map;for(const C of u)f.set(C.uuid,C);const h=X_[o]||null,y=new Map;if(h)for(const C of u){const S=C[h];S!=null&&S!==""&&y.set(String(S),C)}const m=new Set(t.filter(C=>C.table===o).map(C=>C.uuid)),w=e[o]||[];for(const C of w)try{if(m.has(C.uuid))continue;const S=f.get(C.uuid);if(S){const M=String(S.updated_at||"");if(String(C.updated_at||"")>M){const oe={...C};if(o==="setting"&&delete oe.key,o==="log_item"){const ae=C.wuuid?va.get(C.wuuid):null;if(!ae)continue;oe.work_log_id=ae,delete oe.wuuid,oe.project_id=C.puuid?ma.get(C.puuid)??null:S.project_id??null,delete oe.puuid}await a.update(S.id,oe),n++}}else{const M=h&&C[h]!=null&&C[h]!==""?String(C[h]):null,B=M?y.get(M):void 0;if(B&&B.uuid!==C.uuid){const oe=String(B.updated_at||"");if(String(C.updated_at||"")>=oe){o==="work_log"&&await ee.log_item.where("work_log_id").equals(B.id).modify({work_log_id:-1}),await a.delete(La(o,B)),await ee.tombstone.add({table:o,uuid:B.uuid,deleted_at:vt()});const T=await a.add({...C});o==="work_log"&&await ee.log_item.where("work_log_id").equals(-1).modify({work_log_id:T}),f.set(C.uuid,{...C,id:T}),h&&M&&y.set(M,{...C,id:T}),n++}else await ee.tombstone.add({table:o,uuid:C.uuid,deleted_at:vt()}),c1++}else{if(o==="log_item"){const ae=C.wuuid?va.get(C.wuuid):null;if(!ae)continue;C.work_log_id=ae,delete C.wuuid,C.project_id=C.puuid?ma.get(C.puuid)??null:null,delete C.puuid}const oe=await a.add({...C});f.set(C.uuid,{...C,id:oe}),h&&M&&y.set(M,{...C,id:oe}),n++}}}catch(S){Ro++,S instanceof Error?S.message:String(S)}for(const C of u)if(m.has(C.uuid))try{if(o==="work_log"){const M=(await a.toArray()).find(B=>B.date===C.date&&!m.has(B.uuid)&&B.uuid!==C.uuid);M&&C.id&&await ee.log_item.where("work_log_id").equals(C.id).modify({work_log_id:M.id})}await a.delete(La(o,C)),s++}catch{Ro++}if(o==="work_log"){const C=await a.toArray();va=new Map(C.map(S=>[S.uuid,S.id]))}if(o==="project"){const C=await a.toArray();ma=new Map(C.map(S=>[S.uuid,S.id]))}}return{pulled:n,removed:s,errors:Ro}}const f1={class:"settings"},p1={class:"card section"},h1={class:"muted acc-line"},v1={class:"ai-grid"},m1={class:"rule-item"},y1={class:"rule-item"},g1={class:"rule-item"},b1={key:0,class:"form-error"},w1={class:"rule-save"},_1={class:"card section"},k1={class:"rule-grid"},x1={class:"rule-item"},C1={class:"rule-item"},S1={class:"rule-item"},E1={class:"rule-item"},$1={class:"rule-item"},A1={class:"card section"},P1={class:"proj-add"},T1={key:0,class:"muted proj-tip"},O1=["onKeydown"],M1=["onClick"],I1=["onClick"],j1=["onClick"],D1={key:1,class:"muted"},R1={class:"card section"},L1={class:"card section"},K1={class:"muted acc-line"},F1={class:"rule-item"},N1={class:"rule-save"},V1=["disabled"],B1={key:0,class:"muted acc-line"},U1={key:1,class:"form-error"},q1={key:2,class:"form-error"},H1={class:"card section"},W1={class:"ai-grid"},z1={class:"rule-item"},G1={class:"rule-item"},Y1={class:"rule-item"},J1={class:"card section"},X1={class:"backup-row"},Q1={key:0,class:"import-error"},Z1=Vt({__name:"SettingsView",setup(e){var k;const t=N({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=N([]),s=N(""),o=N(""),a=N(""),u=N(""),f=N(""),h=N(""),y=N(null),m=N(""),w=N(null),C=N(null),S=N(""),M=N(((k=Ys())==null?void 0:k.username)||""),B=N(""),oe=N(""),ae=N(""),T=N(""),E=N(!1),X="0.2.0",de=N(""),ie=N(""),te=N(""),O=N(""),j=N(""),ce=N(!1),ke=N("");async function J(){var _;de.value=await fl(),ie.value=((_=_i())==null?void 0:_.username)||"",ke.value=await n1(),j.value=$s.value}mt($s,_=>{j.value=_});async function xe(){await kt("sync_base_url",de.value.trim()),Be("同步地址已保存")}async function Ue(){O.value="";try{await Md(),Be("云端绑定已重建")}catch(_){O.value=_ instanceof Error?_.message:"绑定失败"}}async function rt(){if(!ce.value){O.value="",j.value=$s.value,ce.value=!0;try{await xe();const _=await l1();ke.value=_.at,te.value="推送 "+_.pushed+" 条 · 拉取 "+_.pulled+" 条 · 删除 "+_.removed+" 条",j.value="",Be("同步完成")}catch(_){O.value=_ instanceof Error?_.message:"同步失败"}ce.value=!1}}async function We(){if(T.value="",oe.value!==ae.value){T.value="两次输入的新密码不一致";return}try{await G_(B.value,oe.value),B.value="",oe.value="",ae.value="",Be("登录密码已修改")}catch(_){T.value=_ instanceof Error?_.message:"修改失败"}}async function Ye(){await Y_(),window.location.reload()}async function me(){t.value=await jr(),n.value=await Fs(!0),a.value=(await il()).join(`
|
||
`),u.value=await bt("ai_base_url",""),f.value=await bt("ai_api_key",""),h.value=await bt("ai_model",""),await J()}async function Me(){await kt("ai_base_url",u.value.trim()),await kt("ai_api_key",f.value.trim()),await kt("ai_model",h.value.trim()),Be("AI 配置已保存")}async function Fe(){const _=xt(),x=await Promise.all([gi("2000-01-01",_),Fs(!0)]),G=x[0],ne=x[1],ue=new Map(ne.map(le=>[le.id,le.name])),ge=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const le of G)ge.push([le.date,ol(le.category),le.project_id&&ue.get(le.project_id)||"",le.content,le.minutes==null?"":le.minutes,le.is_milestone?"是":"",le.needs_followup?"是":"",le.takeaway||"",le.remark||""]);const ve=await Nu("工作记录_"+_.replace(/-/g,"")+".csv",ge);Be(ve?"CSV 已导出到:"+ve:"CSV 已导出到系统下载目录")}async function De(){const _=xt(),x=await Promise.all([jr(),yi("2000-01-01",_)]),G=x[0],ne=x[1],ue=["周日","周一","周二","周三","周四","周五","周六"],ge=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const le of ne){const H=zs(le,le.date,G,le.date===_);ge.push([le.date,ue[rs(le.date).getDay()],H.label,le.clock_in_at?Vn(le.clock_in_at):"",le.clock_out_at?Vn(le.clock_out_at):"",le.location||"",le.kind==="makeup"?"补卡":le.kind==="leave"?"休假":"正常",le.note||""])}const ve=await Nu("考勤记录_"+_.replace(/-/g,"")+".csv",ge);Be(ve?"CSV 已导出到:"+ve:"CSV 已导出到系统下载目录")}dn(me);async function Ce(){await kt("work_start",t.value.work_start),await kt("work_end",t.value.work_end),await kt("grace_minutes",String(t.value.grace_minutes)),await kt("lunch_minutes",String(t.value.lunch_minutes)),await kt("remind_weekly",t.value.remind_weekly),Be("打卡规则已保存")}async function Q(){await hd(a.value.split(`
|
||
`)),Be("常用地点已保存")}async function Z(){const _=s.value.trim();if(_){try{await Av(_),o.value="",s.value=""}catch{o.value="项目名已存在"}await me()}}function _e(_){y.value=_.id,m.value=_.name}async function Ve(_){const x=m.value.trim();if(x)try{await Pv(_.id,x),o.value=""}catch{o.value="项目名已存在"}y.value=null,await me()}async function ft(_){await Tv(_.id,_.archived!==1),await me()}async function Yt(){try{const _=await em(),x=await ll("实习日志备份_"+xt().replace(/-/g,"")+".json",_);Be(x?"备份已导出到:"+x:"备份已导出到系统下载目录")}catch(_){Be("导出失败:"+(_ instanceof Error?_.message:String(_)))}}function Jt(_){const x=_.target,G=x.files&&x.files[0];if(S.value="",!G)return;const ne=G.name;G.text().then(ue=>{C.value={name:ne,text:ue}}),x.value=""}async function je(){if(C.value)try{await tm(C.value.text),C.value=null,S.value="",await me(),Be("数据导入完成")}catch(_){C.value=null,S.value=_ instanceof Error?_.message:"导入失败"}}return(_,x)=>(F(),q("div",f1,[c("div",p1,[x[23]||(x[23]=c("div",{class:"section-title"},"账号与隐私",-1)),c("div",h1,"版本 v"+se(Qt(X))+" · 当前用户:"+se(M.value)+" · 每位用户独立数据库隔离存储于本机 · 登录密码仅保存 PBKDF2 哈希",1),c("div",v1,[c("div",m1,[x[20]||(x[20]=c("label",null,"旧登录密码",-1)),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":x[0]||(x[0]=G=>B.value=G)},null,512),[[Re,B.value]])]),c("div",y1,[x[21]||(x[21]=c("label",null,"新登录密码(至少 6 位)",-1)),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":x[1]||(x[1]=G=>oe.value=G)},null,512),[[Re,oe.value]])]),c("div",g1,[x[22]||(x[22]=c("label",null,"确认新登录密码",-1)),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":x[2]||(x[2]=G=>ae.value=G)},null,512),[[Re,ae.value]])])]),T.value?(F(),q("div",b1,se(T.value),1)):Ee("",!0),c("div",w1,[c("button",{class:"btn btn-primary btn-sm",onClick:We},"修改登录密码"),c("button",{class:"btn btn-sm btn-danger",onClick:x[3]||(x[3]=G=>E.value=!0)},"删除此用户及全部数据")])]),c("div",_1,[x[30]||(x[30]=c("div",{class:"section-title"},"打卡规则",-1)),c("div",k1,[c("div",x1,[x[24]||(x[24]=c("label",null,"上班时间",-1)),$e(c("input",{type:"time",class:"input","onUpdate:modelValue":x[4]||(x[4]=G=>t.value.work_start=G)},null,512),[[Re,t.value.work_start]])]),c("div",C1,[x[25]||(x[25]=c("label",null,"下班时间",-1)),$e(c("input",{type:"time",class:"input","onUpdate:modelValue":x[5]||(x[5]=G=>t.value.work_end=G)},null,512),[[Re,t.value.work_end]])]),c("div",S1,[x[26]||(x[26]=c("label",null,"迟到宽限(分钟)",-1)),$e(c("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":x[6]||(x[6]=G=>t.value.grace_minutes=G)},null,512),[[Re,t.value.grace_minutes,void 0,{number:!0}]])]),c("div",E1,[x[27]||(x[27]=c("label",null,"午休扣除(分钟)",-1)),$e(c("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":x[7]||(x[7]=G=>t.value.lunch_minutes=G)},null,512),[[Re,t.value.lunch_minutes,void 0,{number:!0}]])]),c("div",$1,[x[29]||(x[29]=c("label",null,"周记提醒",-1)),$e(c("select",{class:"select","onUpdate:modelValue":x[8]||(x[8]=G=>t.value.remind_weekly=G)},[...x[28]||(x[28]=[c("option",{value:"friday"},"每周五提醒",-1),c("option",{value:"off"},"关闭",-1)])],512),[[Fn,t.value.remind_weekly]])])]),c("div",{class:"rule-save"},[c("button",{class:"btn btn-primary btn-sm",onClick:Ce},"保存规则")])]),c("div",A1,[x[31]||(x[31]=c("div",{class:"section-title"},"项目管理",-1)),c("div",P1,[$e(c("input",{class:"input","onUpdate:modelValue":x[9]||(x[9]=G=>s.value=G),placeholder:"新项目名称",onKeydown:jt(Z,["enter"])},null,544),[[Re,s.value]]),c("button",{class:"btn btn-sm",onClick:Z},"添加")]),o.value?(F(),q("div",T1,se(o.value),1)):Ee("",!0),(F(!0),q(Le,null,ct(n.value,G=>(F(),q("div",{key:G.id,class:"proj-row"},[y.value===G.id?(F(),q(Le,{key:0},[$e(c("input",{class:"input","onUpdate:modelValue":x[10]||(x[10]=ne=>m.value=ne),onKeydown:jt(ne=>Ve(G),["enter"])},null,40,O1),[[Re,m.value]]),c("button",{class:"btn btn-sm",onClick:ne=>Ve(G)},"保存",8,M1),c("button",{class:"btn btn-sm",onClick:x[11]||(x[11]=ne=>y.value=null)},"取消")],64)):(F(),q(Le,{key:1},[c("span",{class:tt(["proj-name",{archived:G.archived===1}])},se(G.name),3),c("button",{class:"icon-btn",title:"重命名",onClick:ne=>_e(G)},[Oe(ut,{name:"edit",size:14})],8,I1),c("button",{class:"btn btn-sm",onClick:ne=>ft(G)},se(G.archived===1?"恢复":"归档"),9,j1)],64))]))),128)),n.value.length?Ee("",!0):(F(),q("div",D1,"暂无项目,先添加一个"))]),c("div",R1,[x[33]||(x[33]=c("div",{class:"section-title"},"常用地点",-1)),$e(c("textarea",{class:"textarea","onUpdate:modelValue":x[12]||(x[12]=G=>a.value=G),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[Re,a.value]]),c("div",{class:"rule-save"},[c("button",{class:"btn btn-primary btn-sm",onClick:Q},"保存地点"),x[32]||(x[32]=c("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),c("div",L1,[x[35]||(x[35]=c("div",{class:"section-title"},"多端数据同步",-1)),c("div",K1,"云端账号:"+se(ie.value||"未绑定")+" · 登录即自动绑定并同步(变更实时推送 + 每 5 分钟兜底);密码库以密文同步,主密码永不出本机",1),c("div",F1,[x[34]||(x[34]=c("label",null,"同步服务地址(默认即可)",-1)),$e(c("input",{class:"input","onUpdate:modelValue":x[13]||(x[13]=G=>de.value=G),placeholder:"https://daywk.linyux.cn"},null,512),[[Re,de.value]])]),c("div",N1,[c("button",{class:"btn btn-sm",onClick:xe},"保存地址"),c("button",{class:"btn btn-primary btn-sm",disabled:ce.value,onClick:rt},se(ce.value?"同步中":"立即同步"),9,V1),c("button",{class:"btn btn-sm",onClick:Ue},"重建云端绑定")]),te.value?(F(),q("div",B1,"上次同步:"+se(ke.value||"--")+" · "+se(te.value),1)):Ee("",!0),O.value?(F(),q("div",U1,se(O.value),1)):Ee("",!0),j.value?(F(),q("div",q1,"最近自动同步失败:"+se(j.value)+"(可点「立即同步」重试)",1)):Ee("",!0)]),c("div",H1,[x[40]||(x[40]=c("div",{class:"section-title"},"AI 润色配置(可选)",-1)),c("div",W1,[c("div",z1,[x[36]||(x[36]=c("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),$e(c("input",{class:"input","onUpdate:modelValue":x[14]||(x[14]=G=>u.value=G),placeholder:"https://api.example.com/v1"},null,512),[[Re,u.value]])]),c("div",G1,[x[37]||(x[37]=c("label",null,"API Key",-1)),$e(c("input",{class:"input","onUpdate:modelValue":x[15]||(x[15]=G=>f.value=G),placeholder:"sk-..."},null,512),[[Re,f.value]])]),c("div",Y1,[x[38]||(x[38]=c("label",null,"模型名称",-1)),$e(c("input",{class:"input","onUpdate:modelValue":x[16]||(x[16]=G=>h.value=G),placeholder:"如:deepseek-chat"},null,512),[[Re,h.value]])])]),c("div",{class:"rule-save"},[c("button",{class:"btn btn-primary btn-sm",onClick:Me},"保存 AI 配置"),x[39]||(x[39]=c("span",{class:"muted loc-note"},"配置仅保存在本机浏览器;总结页可用 AI 润色草稿,需服务端允许浏览器跨域",-1))])]),c("div",J1,[x[41]||(x[41]=c("div",{class:"section-title"},"数据备份",-1)),c("div",X1,[c("button",{class:"btn btn-sm",onClick:Yt},"导出 JSON 备份"),c("button",{class:"btn btn-sm",onClick:x[17]||(x[17]=G=>{var ne;return(ne=w.value)==null?void 0:ne.click()})},"导入 JSON 备份"),c("button",{class:"btn btn-sm",onClick:Fe},"导出工作记录 CSV"),c("button",{class:"btn btn-sm",onClick:De},"导出考勤 CSV"),c("input",{ref_key:"fileInput",ref:w,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:Jt},null,544)]),S.value?(F(),q("div",Q1,se(S.value),1)):Ee("",!0),x[42]||(x[42]=c("div",{class:"muted backup-note"},"数据保存在浏览器 IndexedDB 中,建议定期导出 JSON 备份。",-1))]),Oe(cr,{open:!!C.value,title:"导入确认",message:C.value?"将从文件「"+C.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:x[18]||(x[18]=G=>C.value=null),onConfirm:je},null,8,["open","message"]),Oe(cr,{open:E.value,title:"删除用户确认",message:"将永久删除用户「"+M.value+"」及其全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:x[19]||(x[19]=G=>E.value=!1),onConfirm:Ye},null,8,["open","message"])]))}}),e0=Gt(Z1,[["__scopeId","data-v-1a8e0505"]]),t0={class:"login-page"},n0={class:"card login-card"},r0={class:"login-brand"},s0={class:"brand-icon"},o0={class:"seg"},i0=["placeholder"],a0={key:1,class:"mig-row"},l0={key:2,class:"form-error"},u0=["disabled"],c0=Vt({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,s=N("login"),o=N(""),a=N(""),u=N(""),f=N(!0),h=N(!1),y=N(""),m=N(!1);dn(async()=>{h.value=await Pd()});function w(S){s.value=S,y.value="",u.value=""}async function C(){if(!m.value){y.value="",m.value=!0;try{let S;if(s.value==="login")S=await W_(o.value,a.value);else{if(a.value.length<6){y.value="登录密码至少 6 位",m.value=!1;return}if(a.value!==u.value){y.value="两次输入的密码不一致",m.value=!1;return}S=await H_(o.value,a.value,f.value)}n("login",S)}catch(S){y.value=S instanceof Error?S.message:"操作失败"}m.value=!1}}return(S,M)=>(F(),q("div",t0,[c("div",n0,[c("div",r0,[c("div",s0,[Oe(ut,{name:"calendar",size:22})]),M[6]||(M[6]=c("div",{class:"login-title"},"实习工作日志",-1)),M[7]||(M[7]=c("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),M[8]||(M[8]=c("div",{class:"muted login-sub"},"每位用户独立数据库,数据彼此隔离并保存在本机",-1))]),c("div",o0,[c("button",{class:tt(["seg-btn",{active:s.value==="login"}]),onClick:M[0]||(M[0]=B=>w("login"))},"登录",2),c("button",{class:tt(["seg-btn",{active:s.value==="create"}]),onClick:M[1]||(M[1]=B=>w("create"))},"创建用户",2)]),$e(c("input",{class:"input","onUpdate:modelValue":M[2]||(M[2]=B=>o.value=B),placeholder:"用户名(2 到 20 个字符)",onKeydown:jt(C,["enter"])},null,544),[[Re,o.value]]),$e(c("input",{type:"password",class:"input","onUpdate:modelValue":M[3]||(M[3]=B=>a.value=B),placeholder:s.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:jt(C,["enter"])},null,40,i0),[[Re,a.value]]),s.value==="create"?$e((F(),q("input",{key:0,type:"password",class:"input","onUpdate:modelValue":M[4]||(M[4]=B=>u.value=B),placeholder:"再次输入密码",onKeydown:jt(C,["enter"])},null,544)),[[Re,u.value]]):Ee("",!0),s.value==="create"&&h.value?(F(),q("label",a0,[$e(c("input",{type:"checkbox","onUpdate:modelValue":M[5]||(M[5]=B=>f.value=B)},null,512),[[Rh,f.value]]),M[9]||(M[9]=c("span",null,"导入本机原有工作日志数据到此用户(原数据保留不删除)",-1))])):Ee("",!0),y.value?(F(),q("div",l0,se(y.value),1)):Ee("",!0),c("button",{class:"btn btn-primary login-btn",disabled:m.value,onClick:C},se(s.value==="login"?"登录":"创建并进入"),9,u0),M[10]||(M[10]=c("div",{class:"muted login-note"}," 登录后自动开启云端同步(密码会保存在本机用于云同步);系统只保存密码哈希,忘记密码将无法访问该用户数据 ",-1))])]))}}),d0=Gt(c0,[["__scopeId","data-v-d3d6c8cb"]]),f0={key:1,class:"app"},p0={class:"side"},h0=["data-tip","onClick"],v0={class:"main"},m0={class:"topbar"},y0={class:"title"},g0={class:"gsearch"},b0={key:0,class:"gs-panel"},w0={key:0,class:"gs-group muted"},_0=["onMousedown"],k0={class:"tag"},x0={class:"gs-text"},C0={class:"muted num gs-date"},S0={key:1,class:"gs-group muted"},E0=["onMousedown"],$0={class:"gs-text"},A0={class:"muted gs-sub"},P0={key:1,class:"gs-empty muted"},T0={class:"topbar-actions"},O0={class:"user-chip num"},M0=["disabled"],I0={class:"num"},j0={class:"content"},D0={class:"content-inner"},R0={class:"toast-wrap"},L0=Vt({__name:"App",setup(e){const t=rm(),n=N(Ys());async function s(me){n.value=me,Ns(me.userId),location.hash="#/calendar",de.value="calendar",await ke(),await Ye(),u();try{await Md(),await Yr()}catch{}Be("欢迎,"+me.username);const Me=sessionStorage.getItem("dsh_migrate_toast");Me&&(sessionStorage.removeItem("dsh_migrate_toast"),Be("已迁移原有数据 "+Me+" 条"))}async function o(){o1(),a!==null&&(window.clearInterval(a),a=null),await z_(),n.value=null,de.value="calendar",location.hash="#/calendar",Be("已退出登录")}let a=null;function u(){s1(),a!==null&&window.clearInterval(a),a=window.setInterval(()=>{Yr()},60*1e3),Yr()}const f=N(null),h=N(""),y=N(!1),m=N({logs:[],memos:[]});let w=null;const C=at(()=>!!(m.value.logs.length||m.value.memos.length));function S(){w&&window.clearTimeout(w);const me=h.value;w=window.setTimeout(async()=>{const Me=me.trim();if(!Me){m.value={logs:[],memos:[]};return}const Fe=await Promise.all([zv(Me,8),Gv(Me,4)]);m.value={logs:Fe[0],memos:Fe[1]}},200)}function M(){h.value="",m.value={logs:[],memos:[]},y.value=!1}function B(me){Ia.value=me.date,ie("calendar"),M()}function oe(me){ja.value=me.id,ie("memo"),M()}function ae(){window.setTimeout(()=>{y.value=!1},150)}function T(me){var Me;(me.ctrlKey||me.metaKey)&&me.key.toLowerCase()==="k"&&(me.preventDefault(),(Me=f.value)==null||Me.focus())}const E=[{key:"calendar",name:"日历",icon:"calendar"},{key:"today",name:"详情",icon:"edit"},{key:"stats",name:"统计",icon:"chart"},{key:"report",name:"总结",icon:"export"},{key:"ledger",name:"记账",icon:"wallet"},{key:"memo",name:"备忘录",icon:"memo"},{key:"vault",name:"密码库",icon:"lock"},{key:"settings",name:"设置",icon:"settings"}];function X(){const me=(location.hash||"").replace("#/","");return E.some(Me=>Me.key===me)?me:"calendar"}const de=N(X());window.addEventListener("hashchange",()=>{de.value=X()});function ie(me){location.hash="#/"+me}const te=at(()=>E.find(me=>me.key===de.value)||E[0]),O=N(xt()),j=N(void 0),ce=N(!1);async function ke(){if(j.value=await mn(O.value),ce.value=!1,new Date().getHours()<4){const Me=await mn(Kn(O.value,-1));ce.value=!!(Me&&Me.clock_in_at&&!Me.clock_out_at)}}const J=at(()=>{const me=j.value;return me&&me.clock_in_at&&!me.clock_out_at?!0:ce.value&&!(me&&me.clock_in_at)}),xe=at(()=>{const me=j.value;return!!(me&&me.clock_in_at&&me.clock_out_at)}),Ue=at(()=>{const me=j.value;return J.value?"下班打卡":xe.value?"已打卡 "+Vn(me==null?void 0:me.clock_in_at)+" - "+Vn(me==null?void 0:me.clock_out_at):"上班打卡"});async function rt(){if(J.value)try{await Mv()}catch{}else await vd(O.value);await ke(),nr()}mt(Gs,()=>{n.value&&ke()});const We=N(!1);async function Ye(){if((await jr()).remind_weekly==="off"){We.value=!1;return}const Me=new Date().getDay();if(Me===5||Me===6||Me===0){const Fe=await al(Es(O.value));We.value=!Fe||!Fe.highlights&&!Fe.challenges&&!Fe.plan_next}else We.value=!1}return dn(async()=>{window.addEventListener("keydown",T),n.value&&(Ns(n.value.userId),await ke(),await Ye(),u())}),(me,Me)=>{var Fe;return n.value?(F(),q("div",f0,[c("nav",p0,[(F(),q(Le,null,ct(E,De=>c("button",{key:De.key,class:tt(["nav-btn",{active:de.value===De.key}]),"data-tip":De.name,onClick:Ce=>ie(De.key)},[Oe(ut,{name:De.icon,size:18},null,8,["name"])],10,h0)),64))]),c("div",v0,[c("header",m0,[c("span",y0,se(te.value.name),1),c("div",g0,[Oe(ut,{name:"search",size:14,class:"gs-icon"}),$e(c("input",{ref_key:"gsInput",ref:f,class:"input gs-input","onUpdate:modelValue":Me[0]||(Me[0]=De=>h.value=De),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:S,onFocus:Me[1]||(Me[1]=De=>y.value=!0),onBlur:ae,onKeydown:jt(M,["esc"])},null,544),[[Re,h.value]]),y.value&&h.value.trim()?(F(),q("div",b0,[C.value?(F(),q(Le,{key:0},[m.value.logs.length?(F(),q("div",w0,"工作记录")):Ee("",!0),(F(!0),q(Le,null,ct(m.value.logs,De=>(F(),q("div",{key:"l"+De.id,class:"gs-item",onMousedown:Mr(Ce=>B(De),["prevent"])},[c("span",k0,se(Qt(ol)(De.category)),1),c("span",x0,se(De.content),1),c("span",C0,se(De.date),1)],40,_0))),128)),m.value.memos.length?(F(),q("div",S0,"备忘录")):Ee("",!0),(F(!0),q(Le,null,ct(m.value.memos,De=>(F(),q("div",{key:"m"+De.id,class:"gs-item",onMousedown:Mr(Ce=>oe(De),["prevent"])},[c("span",$0,se(De.title||"无标题"),1),c("span",A0,se(De.content),1)],40,E0))),128))],64)):(F(),q("div",P0,"无匹配结果"))])):Ee("",!0)]),Me[4]||(Me[4]=c("span",{class:"flex1"},null,-1)),c("div",T0,[We.value?(F(),q("button",{key:0,class:"week-tip",onClick:Me[2]||(Me[2]=De=>ie("report"))},[...Me[3]||(Me[3]=[c("span",{class:"dot",style:{background:"var(--warn)"}},null,-1),nn(" 填写本周周记 ",-1)])])):Ee("",!0),c("span",O0,se((Fe=n.value)==null?void 0:Fe.username),1),c("button",{class:"btn btn-sm",onClick:o},"退出"),c("button",{class:"btn btn-primary btn-sm",disabled:xe.value,onClick:rt},[Oe(ut,{name:xe.value?"check-circle":"clock",size:14},null,8,["name"]),c("span",I0,se(Ue.value),1)],8,M0)])]),c("main",j0,[c("div",D0,[de.value==="calendar"?(F(),It(Ey,{key:0})):de.value==="today"?(F(),It(My,{key:1})):de.value==="stats"?(F(),It(ug,{key:2})):de.value==="report"?(F(),It(lb,{key:3})):de.value==="ledger"?(F(),It(bw,{key:4})):de.value==="memo"?(F(),It(Lw,{key:5})):de.value==="vault"?(F(),It(B_,{key:6})):(F(),It(e0,{key:7}))])])]),c("div",R0,[Oe($h,{name:"toast"},{default:fr(()=>[(F(!0),q(Le,null,ct(Qt(t),De=>(F(),q("div",{key:De.id,class:"toast"},se(De.text),1))),128))]),_:1})])])):(F(),It(d0,{key:0,onLogin:s}))}}}),K0=Gt(L0,[["__scopeId","data-v-d5bd1ff7"]]);function pl(e,t){try{let n=document.getElementById("fatal-overlay");n||(n=document.createElement("div"),n.id="fatal-overlay",n.style.cssText="position:fixed;inset:0;z-index:99999;background:#FFFFFF;color:#1D2129;padding:20px;overflow:auto;font:13px/1.7 -apple-system,PingFang SC,Microsoft YaHei,sans-serif;",n.addEventListener("click",o=>{o.target===n&&n.parentElement&&n.parentElement.removeChild(n)}),document.body.appendChild(n));const s=document.createElement("div");s.style.cssText="border:1px solid #E5484D;border-radius:8px;padding:12px;margin-bottom:12px;word-break:break-all;white-space:pre-wrap;",s.textContent=e+`
|
||
`+t,n.appendChild(s)}catch{}}const Hu=Ys();Hu&&Ns(Hu.userId);const jd=Uh(K0);jd.config.errorHandler=(e,t,n)=>{const s=e;pl("应用内部错误(点击空白处关闭,请将以下内容发送给开发者)",s&&(s.stack||s.message)||String(e)+`
|
||
触发位置: `+n)};window.addEventListener("unhandledrejection",e=>{const t=e.reason;pl("未处理的异步错误(点击空白处关闭)",t&&(t.stack||t.message)||String(e.reason))});window.addEventListener("error",e=>{e.message&&e.message!=="ResizeObserver loop limit exceeded"&&pl("运行错误(点击空白处关闭)",e.message)});jd.mount("#app");"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})});export{wd as W,yd as _,xg as b,bd as r};
|