Files
daywork/intern-log/dist/assets/index-BztxiTek.js
T

27 lines
305 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(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 c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).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 qa(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ft={},Tr=[],En=()=>{},Uu=()=>!1,oi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ii=e=>e.startsWith("onUpdate:"),Et=Object.assign,Ha=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},od=Object.prototype.hasOwnProperty,it=(e,t)=>od.call(e,t),Ke=Array.isArray,tr=e=>Vs(e)==="[object Map]",Mr=e=>Vs(e)==="[object Set]",Jl=e=>Vs(e)==="[object Date]",Ge=e=>typeof e=="function",bt=e=>typeof e=="string",$n=e=>typeof e=="symbol",lt=e=>e!==null&&typeof e=="object",qu=e=>(lt(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),Hu=Object.prototype.toString,Vs=e=>Hu.call(e),id=e=>Vs(e).slice(8,-1),Wu=e=>Vs(e)==="[object Object]",Wa=e=>bt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,_s=qa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ai=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ad=/-\w/g,hn=ai(e=>e.replace(ad,t=>t.slice(1).toUpperCase())),ld=/\B([A-Z])/g,ur=ai(e=>e.replace(ld,"-$1").toLowerCase()),zu=ai(e=>e.charAt(0).toUpperCase()+e.slice(1)),ea=ai(e=>e?`on${zu(e)}`:""),Sn=(e,t)=>!Object.is(e,t),$o=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Gu=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},li=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ud=e=>{const t=bt(e)?Number(e):NaN;return isNaN(t)?e:t};let Xl;const ui=()=>Xl||(Xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function nr(e){if(Ke(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=bt(s)?pd(s):nr(s);if(o)for(const a in o)t[a]=o[a]}return t}else if(bt(e)||lt(e))return e}const cd=/;(?![^(]*\))/g,fd=/:([^]+)/,dd=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function pd(e){const t={};return e.replace(dd,n=>n.startsWith("/*")?"":n).split(cd).forEach(n=>{if(n){const s=n.split(fd);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function tt(e){let t="";if(bt(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 hd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",vd=qa(hd);function Yu(e){return!!e||e===""}function md(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=sr(e[o],t[o],n);return s}function Ql(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 c=-1;for(let d=0;d<s.length;d++)if(!o[d]&&sr(a,s[d],n)){c=d;break}if(c<0)return!1;o[c]=1}return!0}function yd(e,t,n){let s=tr(e),o=tr(t);if(s||o||(s=Mr(e),o=Mr(t),s||o))return s&&o?Ql(e,t,n):!1;const a=Object.keys(e).length,c=Object.keys(t).length;if(a!==c)return!1;for(const d in e){const h=e.hasOwnProperty(d),y=t.hasOwnProperty(d);if(h&&!y||!h&&y||!sr(e[d],t[d],n))return!1}return String(e)===String(t)}function Zl(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 c=s(e,t,n);return o.delete(e),a.delete(t),c}function sr(e,t,n){if(e===t)return!0;let s=Jl(e),o=Jl(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?Zl(e,t,n,md):!1:(s=lt(e),o=lt(t),s||o?!s||!o?!1:Zl(e,t,n,yd):String(e)===String(t))))}function gd(e,t){return e.findIndex(n=>sr(n,t))}const Ju=e=>!!(e&&e.__v_isRef===!0),se=e=>bt(e)?e:e==null?"":Ke(e)||lt(e)&&(e.toString===Hu||!Ge(e.toString))?Ju(e)?se(e.value):JSON.stringify(e,Xu,2):String(e),Xu=(e,t)=>Ju(t)?Xu(e,t.value):tr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],a)=>(n[ta(s,a)+" =>"]=o,n),{})}:Mr(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ta(n))}:$n(t)?ta(t):lt(t)&&!Ke(t)&&!Wu(t)?String(t):t,ta=(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 bd{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 wd(){return Mt}let ht;const na=new WeakSet;class Qu{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,na.has(this)&&(na.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ec(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,eu(this),tc(this);const t=ht,n=vn;ht=this,vn=!0;try{return this.fn()}finally{nc(this),ht=t,vn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ya(t);this.deps=this.depsTail=void 0,eu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?na.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ma(this)&&this.run()}get dirty(){return ma(this)}}let Zu=0,ks,xs;function ec(e,t=!1){if(e.flags|=8,t){e.next=xs,xs=e;return}e.next=ks,ks=e}function za(){Zu++}function Ga(){if(--Zu>0)return;if(xs){let t=xs;for(xs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ks;){let t=ks;for(ks=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 tc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function nc(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Ya(s),_d(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function ma(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(rc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function rc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===As)||(e.globalVersion=As,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ma(e))))return;e.flags|=2;const t=e.dep,n=ht,s=vn;ht=e,vn=!0;try{tc(e);const o=e.fn(e._value);(t.version===0||Sn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ht=n,vn=s,nc(e),e.flags&=-3}}function Ya(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)Ya(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function _d(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 sc=[];function Tn(){sc.push(vn),vn=!1}function Pn(){const e=sc.pop();vn=e===void 0?!0:e}function eu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ht;ht=void 0;try{t()}finally{ht=n}}}let As=0;class kd{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 Ja{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 kd(ht,this),ht.deps?(n.prevDep=ht.depsTail,ht.depsTail.nextDep=n,ht.depsTail=n):ht.deps=ht.depsTail=n,oc(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++,As++,this.notify(t)}notify(t){za();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ga()}}}function oc(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)oc(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ya=new WeakMap,Ar=Symbol(""),ga=Symbol(""),Os=Symbol("");function Ft(e,t,n){if(vn&&ht){let s=ya.get(e);s||ya.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Ja),o.map=s,o.key=n),o.track()}}function Ln(e,t,n,s,o,a){const c=ya.get(e);if(!c){As++;return}const d=h=>{h&&h.trigger()};if(za(),t==="clear")c.forEach(d);else{const h=Ke(e),y=h&&Wa(n);if(h&&n==="length"){const m=Number(s);c.forEach((w,C)=>{(C==="length"||C===Os||!$n(C)&&C>=m)&&d(w)})}else switch((n!==void 0||c.has(void 0))&&d(c.get(n)),y&&d(c.get(Os)),t){case"add":h?y&&d(c.get("length")):(d(c.get(Ar)),tr(e)&&d(c.get(ga)));break;case"delete":h||(d(c.get(Ar)),tr(e)&&d(c.get(ga)));break;case"set":tr(e)&&d(c.get(Ar));break}}Ga()}function Hr(e){const t=ot(e);return t===e||(Ft(t,"iterate",Os),un(e))?t:An(e)?rr(e)?t.map(n=>or(cn(n))):t.map(or):t.map(cn)}function ci(e){return Ft(e=ot(e),"iterate",Os),e}function kn(e,t){return An(e)?or(rr(e)?cn(t):t):cn(t)}const xd={__proto__:null,[Symbol.iterator](){return ra(this,Symbol.iterator,e=>kn(this,e))},concat(...e){return Hr(this).concat(...e.map(t=>Ke(t)?Hr(t):t))},entries(){return ra(this,"entries",e=>(e[1]=kn(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=>kn(this,s)),arguments)},find(e,t){return In(this,"find",e,t,n=>kn(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=>kn(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 sa(this,"includes",e)},indexOf(...e){return sa(this,"indexOf",e)},join(e){return Hr(this).join(e)},lastIndexOf(...e){return sa(this,"lastIndexOf",e)},map(e,t){return In(this,"map",e,t,void 0,arguments)},pop(){return vs(this,"pop")},push(...e){return vs(this,"push",e)},reduce(e,...t){return nu(this,"reduce",e,t)},reduceRight(e,...t){return nu(this,"reduceRight",e,t)},shift(){return vs(this,"shift")},some(e,t){return In(this,"some",e,t,void 0,arguments)},splice(...e){return vs(this,"splice",e)},toReversed(){return Hr(this).toReversed()},toSorted(e){return Hr(this).toSorted(e)},toSpliced(...e){return Hr(this).toSpliced(...e)},unshift(...e){return vs(this,"unshift",e)},values(){return ra(this,"values",e=>kn(this,e))}};function ra(e,t,n){const s=ci(e),o=s[t],a=o.call(s);if(s!==e&&!un(e)){if(a[Symbol.toStringTag]==="Array Iterator"){const c=Object.create(Object.getPrototypeOf(a));return c.next=()=>tu(a.next(),n),o!==ic[t]&&Object.defineProperties(c,{return:{get(){const d=a.return;return typeof d=="function"?d.bind(a):d}},throw:{get(){const d=a.throw;return typeof d=="function"?d.bind(a):d}}}),c}a._next=a.next,a.next=()=>tu(a._next(),n)}return a}function tu(e,t){return e.done||(e.value=t(e.value)),e}const ic=Array.prototype;function In(e,t,n,s,o,a){const c=ci(e),d=c!==e&&!un(e),h=c[t];if(h!==ic[t]){const w=h.apply(e,a);return d?cn(w):w}let y=n;c!==e&&(d?y=function(w,C){return n.call(this,kn(e,w),C,e)}:n.length>2&&(y=function(w,C){return n.call(this,w,C,e)}));const m=h.call(c,y,s);return d&&o?o(m):m}function nu(e,t,n,s){const o=ci(e),a=o!==e&&!un(e);let c=n,d=!1;o!==e&&(a?(d=s.length===0,c=function(y,m,w){return d&&(d=!1,y=kn(e,y)),n.call(this,y,kn(e,m),w,e)}):n.length>3&&(c=function(y,m,w){return n.call(this,y,m,w,e)}));const h=o[t](c,...s);return d?kn(e,h):h}function sa(e,t,n){const s=ot(e);Ft(s,"iterate",Os);const o=s[t](...n);return(o===-1||o===!1)&&el(n[0])?(n[0]=ot(n[0]),s[t](...n)):o}function vs(e,t,n=[]){Tn(),za();const s=ot(e)[t].apply(e,n);return Ga(),Pn(),s}const Cd=qa("__proto__,__v_isRef,__isVue"),ac=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter($n));function Sd(e){$n(e)||(e=String(e));const t=ot(this);return Ft(t,"has",e),t.hasOwnProperty(e)}class lc{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?Dd:dc:a?fc:cc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const c=Ke(t);if(!o){let h;if(c&&(h=xd[n]))return h;if(n==="hasOwnProperty")return Sd}const d=Reflect.get(t,n,Vt(t)?t:s);if(($n(n)?ac.has(n):Cd(n))||(o||Ft(t,"get",n),a))return d;if(Vt(d)){const h=c&&Wa(n)?d:d.value;return o&&lt(h)?wa(h):h}return lt(d)?o?wa(d):Qa(d):d}}class uc extends lc{constructor(t=!1){super(!1,t)}set(t,n,s,o){let a=t[n];const c=Ke(t)&&Wa(n);if(!this._isShallow){const y=An(a);if(!un(s)&&!An(s)&&(a=ot(a),s=ot(s)),!c&&Vt(a)&&!Vt(s))return y||(a.value=s),!0}const d=c?Number(n)<t.length:it(t,n),h=Reflect.set(t,n,s,Vt(t)?t:o);return t===ot(o)&&h&&(d?Sn(s,a)&&Ln(t,"set",n,s):Ln(t,"add",n,s)),h}deleteProperty(t,n){const s=it(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Ln(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!$n(n)||!ac.has(n))&&Ft(t,"has",n),s}ownKeys(t){return Ft(t,"iterate",Ke(t)?"length":Ar),Reflect.ownKeys(t)}}class Ed extends lc{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const $d=new uc,Td=new Ed,Pd=new uc(!0);const ba=e=>e,wo=e=>Reflect.getPrototypeOf(e);function Ad(e,t,n){return function(...s){const o=this.__v_raw,a=ot(o),c=tr(a),d=e==="entries"||e===Symbol.iterator&&c,h=e==="keys"&&c,y=o[e](...s),m=n?ba:t?or:cn;return!t&&Ft(a,"iterate",h?ga:Ar),Et(Object.create(y),{next(){const{value:w,done:C}=y.next();return C?{value:w,done:C}:{value:d?[m(w[0]),m(w[1])]:m(w),done:C}}})}}function _o(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Od(e,t){const n={get(o){const a=this.__v_raw,c=ot(a),d=ot(o);e||(Sn(o,d)&&Ft(c,"get",o),Ft(c,"get",d));const{has:h}=wo(c),y=t?ba:e?or:cn;if(h.call(c,o))return y(a.get(o));if(h.call(c,d))return y(a.get(d));a!==c&&a.get(o)},get size(){const o=this.__v_raw;return!e&&Ft(ot(o),"iterate",Ar),o.size},has(o){const a=this.__v_raw,c=ot(a),d=ot(o);return e||(Sn(o,d)&&Ft(c,"has",o),Ft(c,"has",d)),o===d?a.has(o):a.has(o)||a.has(d)},forEach(o,a){const c=this,d=c.__v_raw,h=ot(d),y=t?ba:e?or:cn;return!e&&Ft(h,"iterate",Ar),d.forEach((m,w)=>o.call(a,y(m),y(w),c))}};return Et(n,e?{add:_o("add"),set:_o("set"),delete:_o("delete"),clear:_o("clear")}:{add(o){const a=ot(this),c=wo(a),d=ot(o),h=!t&&!un(o)&&!An(o)?d:o;return c.has.call(a,h)||Sn(o,h)&&c.has.call(a,o)||Sn(d,h)&&c.has.call(a,d)||(a.add(h),Ln(a,"add",h,h)),this},set(o,a){!t&&!un(a)&&!An(a)&&(a=ot(a));const c=ot(this),{has:d,get:h}=wo(c);let y=d.call(c,o);y||(o=ot(o),y=d.call(c,o));const m=h.call(c,o);return c.set(o,a),y?Sn(a,m)&&Ln(c,"set",o,a):Ln(c,"add",o,a),this},delete(o){const a=ot(this),{has:c,get:d}=wo(a);let h=c.call(a,o);h||(o=ot(o),h=c.call(a,o)),d&&d.call(a,o);const y=a.delete(o);return h&&Ln(a,"delete",o,void 0),y},clear(){const o=ot(this),a=o.size!==0,c=o.clear();return a&&Ln(o,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Ad(o,e,t)}),n}function Xa(e,t){const n=Od(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 Md={get:Xa(!1,!1)},Id={get:Xa(!1,!0)},jd={get:Xa(!0,!1)};const cc=new WeakMap,fc=new WeakMap,dc=new WeakMap,Dd=new WeakMap;function Ld(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Qa(e){return An(e)?e:Za(e,!1,$d,Md,cc)}function Rd(e){return Za(e,!1,Pd,Id,fc)}function wa(e){return Za(e,!0,Td,jd,dc)}function Za(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 c=Ld(id(e));if(c===0)return e;const d=new Proxy(e,c===2?s:n);return o.set(e,d),d}function rr(e){return An(e)?rr(e.__v_raw):!!(e&&e.__v_isReactive)}function An(e){return!!(e&&e.__v_isReadonly)}function un(e){return!!(e&&e.__v_isShallow)}function el(e){return e?!!e.__v_raw:!1}function ot(e){const t=e&&e.__v_raw;return t?ot(t):e}function Kd(e){return!it(e,"__v_skip")&&Object.isExtensible(e)&&Gu(e,"__v_skip",!0),e}const cn=e=>lt(e)?Qa(e):e,or=e=>lt(e)?wa(e):e;function Vt(e){return e?e.__v_isRef===!0:!1}function F(e){return Fd(e,!1)}function Fd(e,t){return Vt(e)?e:new Nd(e,t)}class Nd{constructor(t,n){this.dep=new Ja,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ot(t),this._value=n?t:cn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||un(t)||An(t);t=s?t:ot(t),Sn(t,n)&&(this._rawValue=t,this._value=s?t:cn(t),this.dep.trigger())}}function Zt(e){return Vt(e)?e.value:e}const Vd={get:(e,t,n)=>t==="__v_raw"?e:Zt(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Vt(o)&&!Vt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function pc(e){return rr(e)?e:new Proxy(e,Vd)}class Bd{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ja(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=As-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 ec(this,!0),!0}get value(){const t=this.dep.track();return rc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ud(e,t,n=!1){let s,o;return Ge(e)?s=e:(s=e.get,o=e.set),new Bd(s,o,n)}const ko={},Ro=new WeakMap;let Cr;function qd(e,t=!1,n=Cr){if(n){let s=Ro.get(n);s||Ro.set(n,s=[]),s.push(e)}}function Hd(e,t,n=ft){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:d,call:h}=n,y=J=>o?J:un(J)||o===!1||o===0?Rn(J,1):Rn(J);let m,w,C,O,N=!1,ee=!1;if(Vt(e)?(w=()=>e.value,N=un(e)):rr(e)?(w=()=>y(e),N=!0):Ke(e)?(ee=!0,N=e.some(J=>rr(J)||un(J)),w=()=>e.map(J=>{if(Vt(J))return J.value;if(rr(J))return y(J);if(Ge(J))return h?h(J,2):J()})):Ge(e)?t?w=h?()=>h(e,2):e:w=()=>{if(C){Tn();try{C()}finally{Pn()}}const J=Cr;Cr=m;try{return h?h(e,3,[O]):e(O)}finally{Cr=J}}:w=En,t&&o){const J=w,ce=o===!0?1/0:o;w=()=>Rn(J(),ce)}const te=wd(),ue=()=>{m.stop(),te&&te.active&&Ha(te.effects,m)};if(a&&t){const J=t;t=(...ce)=>{try{return J(...ce)}finally{ue()}}}let P=ee?new Array(e.length).fill(ko):ko;const L=J=>{if(!(!(m.flags&1)||!m.dirty&&!J))if(t){const ce=m.run();if(J||o||N||(ee?ce.some((ie,Q)=>Sn(ie,P[Q])):Sn(ce,P))){const ie=Cr;Tn();try{C&&C(),Cr=m;const Q=[ce,P===ko?void 0:ee&&P[0]===ko?[]:P,O];P=ce,h?h(t,3,Q):t(...Q)}finally{Cr=ie,Pn()}}}else m.run()};return d&&d(L),m=new Qu(w),m.scheduler=c?()=>c(L,!1):L,O=J=>qd(J,!1,m),C=m.onStop=()=>{const J=Ro.get(m);if(J){if(h)h(J,4);else for(const ce of J)ce();Ro.delete(m)}},t?s?L(!0):P=m.run():c?c(L.bind(null,!0),!0):m.run(),ue.pause=m.pause.bind(m),ue.resume=m.resume.bind(m),ue.stop=ue,ue}function Rn(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--,Vt(e))Rn(e.value,t,n);else if(Ke(e))for(let s=0;s<e.length;s++)Rn(e[s],t,n);else if(Mr(e)||tr(e))e.forEach(s=>{Rn(s,t,n)});else if(Wu(e)){for(const s in e)Rn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Rn(e[s],t,n)}return e}/**
* @vue/runtime-core v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Bs(e,t,n,s){try{return s?e(...s):e()}catch(o){fi(o,t,n)}}function fn(e,t,n,s){if(Ge(e)){const o=Bs(e,t,n,s);return o&&qu(o)&&o.catch(a=>{fi(a,t,n)}),o}if(Ke(e)){const o=[];for(let a=0;a<e.length;a++)o.push(fn(e[a],t,n,s));return o}}function fi(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||ft;if(t){let d=t.parent;const h=t.proxy,y=`https://vuejs.org/error-reference/#runtime-${n}`;for(;d;){const m=d.ec;if(m){for(let w=0;w<m.length;w++)if(m[w](e,h,y)===!1)return}d=d.parent}if(a){Tn(),Bs(a,null,10,[e,h,y]),Pn();return}}Wd(e,n,o,s,c)}function Wd(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const zt=[];let pn=-1;const xn=[];let Zn=null,Wr=0;const hc=Promise.resolve();let Ko=null;function rs(e){const t=Ko||hc;return e?t.then(this?e.bind(this):e):t}function zd(e){let t=pn+1,n=zt.length;for(;t<n;){const s=t+n>>>1,o=zt[s],a=Ms(o);a<e||a===e&&o.flags&2?t=s+1:n=s}return t}function tl(e){if(!(e.flags&1)){const t=Ms(e),n=zt[zt.length-1];!n||!(e.flags&2)&&t>=Ms(n)?zt.push(e):zt.splice(zd(t),0,e),e.flags|=1,vc()}}function vc(){Ko||(Ko=hc.then(gc))}function Gd(e){if(!Ke(e))Zn&&e.id===-1?Zn.splice(Wr+1,0,e):e.flags&1||(xn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)xn.push(e[t]);vc()}function mc(e,t,n,s=pn+1){for(;s<zt.length;s++){const o=zt[s];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;zt.splice(s,1),s=e?s-1:pn,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function yc(e,t,n=0){if(xn.length){let s=xn,o=0;if(t){s=[];for(let c=0;c<xn.length;c++){const d=xn[c];(d.i!==void 0?!d.i||d.i.uid<n:t.has(d))?xn[o++]=d:s.push(d)}}const a=[...new Set(s)].sort((c,d)=>Ms(c)-Ms(d));if(xn.length=o,Zn){for(let c=0;c<a.length;c++)Zn.push(a[c]);return}for(Zn=a,Wr=0;Wr<Zn.length;Wr++){const c=Zn[Wr];c.flags&4&&(c.flags&=-2),c.flags&8||c(),c.flags&=-2}Zn=null,Wr=0}}let oa=!1;function Yd(e,t){if(oa){e();return}const n=t===void 0?void 0:new Set(xn);e(),oa=!0;try{mc(void 0,t),yc(void 0,n,t)}finally{oa=!1}}const Ms=e=>e.id==null?e.flags&2?-1:1/0:e.id;function gc(e){try{for(pn=0;pn<zt.length;pn++){const t=zt[pn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Bs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;pn<zt.length;pn++){const t=zt[pn];t&&(t.flags&=-2)}pn=-1,zt.length=0,yc(),Ko=null,(zt.length||xn.length)&&gc()}}let ln=null,bc=null;function Fo(e){const t=ln;return ln=e,bc=e&&e.type.__scopeId||null,t}function cr(e,t=ln,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Uo(-1);const a=Fo(t),c=Or.length;let d;try{d=e(...o)}finally{for(let h=Or.length;h>c;h--)zc();Fo(a),s._d&&Uo(1)}return d};return s._n=!0,s._c=!0,s._d=!0,s}function Te(e,t){if(ln===null)return e;const n=yi(ln),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,c,d,h=ft]=t[o];a&&(Ge(a)&&(a={mounted:a,updated:a}),a.deep&&Rn(c),s.push({dir:a,instance:n,value:c,oldValue:void 0,arg:d,modifiers:h}))}return e}function _r(e,t,n,s){const o=e.dirs,a=t&&t.dirs;for(let c=0;c<o.length;c++){const d=o[c];a&&(d.oldValue=a[c].value);let h=d.dir[s];h&&(Tn(),fn(h,n,8,[e.el,d,e,t]),Pn())}}function Jd(e,t){if(Gt){let n=Gt.provides;const s=Gt.parent&&Gt.parent.provides;s===n&&(n=Gt.provides=Object.create(s)),n[e]=t}}function To(e,t,n=!1){const s=il();if(s||Yr){let o=Yr?Yr._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 Xd=Symbol.for("v-scx"),Qd=()=>To(Xd);function vt(e,t,n){return wc(e,t,n)}function wc(e,t,n=ft){const{immediate:s,deep:o,flush:a,once:c}=n,d=Et({},n),h=t&&s||!t&&a!=="post";let y;if(Ks){if(a==="sync"){const O=Qd();y=O.__watcherHandles||(O.__watcherHandles=[])}else if(!h){const O=()=>{};return O.stop=En,O.resume=En,O.pause=En,O}}const m=Gt;d.call=(O,N,ee)=>fn(O,m,N,ee);let w=!1;a==="post"?d.scheduler=O=>{O.i=m,Wt(O,m&&m.suspense)}:a!=="sync"&&(w=!0,d.scheduler=(O,N)=>{N?O():tl(O)}),d.augmentJob=O=>{t&&(O.flags|=4),w&&(O.flags|=2,m&&(O.id=m.uid,O.i=m))};const C=Hd(e,t,d);return Ks&&(y?y.push(C):h&&C()),C}function Zd(e,t,n){const s=this.proxy,o=bt(e)?e.includes(".")?_c(s,e):()=>s[e]:e.bind(s,s);let a;Ge(t)?a=t:(a=t.handler,n=t);const c=qs(this),d=wc(o,a.bind(s),n);return c(),d}function _c(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 Xn=new WeakMap,kc=Symbol("_vte"),di=e=>e.__isTeleport,Sr=e=>e&&(e.disabled||e.disabled===""),ep=e=>e&&(e.defer||e.defer===""),ru=e=>typeof SVGElement<"u"&&e instanceof SVGElement,su=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,_a=(e,t)=>{const n=e&&e.to;return bt(n)?t?t(n):null:n},tp={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,a,c,d,h,y){const{mc:m,pc:w,pbc:C,o:{insert:O,querySelector:N,createText:ee,createComment:te,parentNode:ue}}=y,P=Sr(t.props);let{dynamicChildren:L}=t;const J=(Q,A,S)=>{Q.shapeFlag&16&&m(Q.children,A,S,o,a,c,d,h)},ce=(Q=t)=>{const A=Sr(Q.props),S=Q.target=_a(Q.props,N),oe=ka(S,Q,ee,O);S&&(c!=="svg"&&ru(S)?c="svg":c!=="mathml"&&su(S)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(S),A||(J(Q,S,oe),gs(Q,!1)))},ie=Q=>{const A=()=>{if(Xn.get(Q)===A){if(Xn.delete(Q),Sr(Q.props)){const S=ue(Q.el)||n;J(Q,S,Q.anchor),gs(Q,!0)}ce(Q)}};Xn.set(Q,A),Wt(A,a)};if(e==null){const Q=t.el=ee(""),A=t.anchor=ee("");if(O(Q,n,s),O(A,n,s),ep(t.props)||a&&a.pendingBranch){ie(t);return}P&&(J(t,n,A),gs(t,!0)),ce()}else{t.el=e.el;const Q=t.anchor=e.anchor,A=Xn.get(e);if(A){A.flags|=8,Xn.delete(e),ie(t);return}t.targetStart=e.targetStart;const S=t.target=e.target,oe=t.targetAnchor=e.targetAnchor,ge=Sr(e.props),Y=ge?n:S,xe=ge?Q:oe;if(c==="svg"||ru(S)?c="svg":(c==="mathml"||su(S))&&(c="mathml"),L?(C(e.dynamicChildren,L,Y,o,a,c,d),ol(e,t,!0)):h||w(e,t,Y,xe,o,a,c,d,!1),P)ge?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):xo(t,n,Q,y,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Fe=_a(t.props,N);Fe&&(t.target=Fe,xo(t,Fe,null,y,0))}else ge&&xo(t,S,oe,y,1);gs(t,P)}},remove(e,t,n,{um:s,o:{remove:o}},a){const{shapeFlag:c,children:d,anchor:h,targetStart:y,targetAnchor:m,target:w,props:C}=e,O=Sr(C),N=a||!O,ee=Xn.get(e);if(ee&&(ee.flags|=8,Xn.delete(e)),w&&(o(y),o(m)),a&&o(h),!ee&&(O||w)&&c&16)for(let te=0;te<d.length;te++){const ue=d[te];s(ue,t,n,N,!!ue.dynamicChildren)}},move:xo,hydrate:np};function xo(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:c,anchor:d,shapeFlag:h,children:y,props:m}=e,w=a===2;if(w&&s(c,t,n),!Xn.has(e)&&(!w||Sr(m))&&h&16)for(let C=0;C<y.length;C++)o(y[C],t,n,2);w&&s(d,t,n)}function np(e,t,n,s,o,a,{o:{nextSibling:c,parentNode:d,querySelector:h,insert:y,createText:m}},w){function C(te,ue){let P=ue;for(;P;){if(P&&P.nodeType===8){if(P.data==="teleport start anchor")t.targetStart=P;else if(P.data==="teleport anchor"){t.targetAnchor=P,te._lpa=t.targetAnchor&&c(t.targetAnchor);break}}P=c(P)}}function O(te,ue){ue.anchor=w(c(te),ue,d(te),n,s,o,a)}const N=t.target=_a(t.props,h),ee=Sr(t.props);if(N){const te=N._lpa||N.firstChild;t.shapeFlag&16&&(ee?(O(e,t),C(N,te),t.targetAnchor||ka(N,t,m,y,d(e)===N?e:null)):(t.anchor=c(e),C(N,te),t.targetAnchor||ka(N,t,m,y),w(te&&c(te),t,N,n,s,o,a))),gs(t,ee)}else ee&&t.shapeFlag&16&&(O(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const Us=tp;function gs(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 ka(e,t,n,s,o=null){const a=t.targetStart=n(""),c=t.targetAnchor=n("");return a[kc]=c,e&&(s(a,e,o),s(c,e,o)),c}const an=Symbol("_leaveCb"),ms=Symbol("_enterCb");function xc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return mn(()=>{e.isMounted=!0}),Ac(()=>{e.isUnmounting=!0}),e}const on=[Function,Array],Cc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:on,onEnter:on,onAfterEnter:on,onEnterCancelled:on,onBeforeLeave:on,onLeave:on,onAfterLeave:on,onLeaveCancelled:on,onBeforeAppear:on,onAppear:on,onAfterAppear:on,onAppearCancelled:on},rp={name:"BaseTransition",props:Cc,setup(e,{slots:t}){const n=il(),s=xc();return()=>{const o=t.default&&nl(t.default(),!0),a=o&&o.length?Sc(o):n.subTree?Ee():void 0;if(!a)return;const c=ot(e),{mode:d}=c;if(s.isLeaving)return ia(a);const h=No(a);if(!h)return ia(a);let y=Is(h,c,s,n,w=>y=w);h.type!==Nt&&ir(h,y);let m=n.subTree&&No(n.subTree);if(m&&m.type!==Nt&&!Er(m,h)&&js(n.subTree)){let w=Is(m,c,s,n);if(ir(m,w),d==="out-in"&&h.type!==Nt)return s.isLeaving=!0,w.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete w.afterLeave,m=void 0},ia(a);d==="in-out"&&h.type!==Nt?w.delayLeave=(C,O,N)=>{const ee=Ec(s,m);ee[String(m.key)]=m,C[an]=()=>{O(),C[an]=void 0,delete y.delayedLeave,m=void 0},y.delayedLeave=()=>{N(),delete y.delayedLeave,m=void 0}}:m=void 0}else m&&(m=void 0);return a}}};function Sc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Nt){t=n;break}}return t}const sp=rp;function Ec(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 Is(e,t,n,s,o){const{appear:a,mode:c,persisted:d=!1,onBeforeEnter:h,onEnter:y,onAfterEnter:m,onEnterCancelled:w,onBeforeLeave:C,onLeave:O,onAfterLeave:N,onLeaveCancelled:ee,onBeforeAppear:te,onAppear:ue,onAfterAppear:P,onAppearCancelled:L}=t,J=String(e.key),ce=Ec(n,e),ie=(S,oe)=>{S&&fn(S,s,9,oe)},Q=(S,oe)=>{const ge=oe[1];ie(S,oe),Ke(S)?S.every(Y=>Y.length<=1)&&ge():S.length<=1&&ge()},A={mode:c,persisted:d,beforeEnter(S){let oe=h;if(!n.isMounted)if(a)oe=te||h;else return;S[an]&&S[an](!0);const ge=ce[J];if(ge&&Er(e,ge)){let Y=ge.el[an];if(!Y){const xe=js(ge);Y=xe&&xe.el[an]}Y&&Y()}ie(oe,[S])},enter(S){if(ce[J]===e)return;let oe=y,ge=m,Y=w;if(!n.isMounted)if(a)oe=ue||y,ge=P||m,Y=L||w;else return;let xe=!1;S[ms]=rt=>{xe||(xe=!0,rt?ie(Y,[S]):ie(ge,[S]),A.delayedLeave&&A.delayedLeave(),S[ms]=void 0)};const Fe=S[ms].bind(null,!1);oe?Q(oe,[S,Fe]):Fe()},leave(S,oe){const ge=String(e.key);if(S[ms]&&S[ms](!0),n.isUnmounting)return oe();ie(C,[S]);let Y=!1;S[an]=Fe=>{Y||(Y=!0,oe(),Fe?ie(ee,[S]):ie(N,[S]),S[an]=void 0,ce[ge]===e&&delete ce[ge])};const xe=S[an].bind(null,!1);ce[ge]=e,O?Q(O,[S,xe]):xe()},clone(S){const oe=Is(S,t,n,s,o);return o&&o(oe),oe}};return A}function ia(e){if(pi(e))return e=ar(e),e.children=null,e}function No(e){if(!pi(e))return di(e.type)&&e.children?Sc(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 ir(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;ir(di(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===Re&&Ke(e.children)){const n=Dc(e.children,!1);n&&ir(n,t)}}function nl(e,t=!1,n){let s=[],o=0;for(let a=0;a<e.length;a++){let c=e[a];const d=n==null?c.key:String(n)+String(c.key!=null?c.key:a);c.type===Re?(c.patchFlag&128&&o++,s=s.concat(nl(c.children,t,d))):(t||c.type!==Nt)&&s.push(d!=null?ar(c,{key:d}):c)}if(o>1)for(let a=0;a<s.length;a++)s[a].patchFlag=-2;return s}function js(e){if(e.component)return js(e.component.subTree);if(e.type===Re){const t=Ke(e.children)&&Dc(e.children,!1);return t?js(t):void 0}if(e.type!==Nt)return e}function Bt(e,t){return Ge(e)?Et({name:e.name},t,{setup:e}):e}function $c(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ou(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vo=new WeakMap;function Cs(e,t,n,s,o=!1){if(Ke(e)){e.forEach((ee,te)=>Cs(ee,t&&(Ke(t)?t[te]:t),n,s,o));return}if(Ss(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Cs(e,t,n,s.component.subTree);return}const a=s.shapeFlag&4?yi(s.component):s.el,c=o?null:a,{i:d,r:h}=e,y=t&&t.r,m=d.refs===ft?d.refs={}:d.refs,w=d.setupState,C=ot(w),O=w===ft?Uu:ee=>ou(m,ee)?!1:it(C,ee),N=(ee,te)=>!(te&&ou(m,te));if(y!=null&&y!==h){if(iu(t),bt(y))m[y]=null,O(y)&&(w[y]=null);else if(Vt(y)){const ee=t;N(y,ee.k)&&(y.value=null),ee.k&&(m[ee.k]=null)}}if(Ge(h))Bs(h,d,12,[c,m]);else{const ee=bt(h),te=Vt(h);if(ee||te){const ue=()=>{if(e.f){const P=ee?O(h)?w[h]:m[h]:N()||!e.k?h.value:m[e.k];if(o)Ke(P)&&Ha(P,a);else if(Ke(P))P.includes(a)||P.push(a);else if(ee)m[h]=[a],O(h)&&(w[h]=m[h]);else{const L=[a];N(h,e.k)&&(h.value=L),e.k&&(m[e.k]=L)}}else ee?(m[h]=c,O(h)&&(w[h]=c)):te&&(N(h,e.k)&&(h.value=c),e.k&&(m[e.k]=c))};if(c){const P=()=>{ue(),Vo.delete(e)};P.id=-1,Vo.set(e,P),Wt(P,n)}else iu(e),ue()}}}function iu(e){const t=Vo.get(e);t&&(t.flags|=8,Vo.delete(e))}ui().requestIdleCallback;ui().cancelIdleCallback;const Ss=e=>!!e.type.__asyncLoader,pi=e=>e.type.__isKeepAlive;function op(e,t){Tc(e,"a",t)}function ip(e,t){Tc(e,"da",t)}function Tc(e,t,n=Gt){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(hi(t,s,n),n){let o=n.parent;for(;o&&o.parent;)pi(o.parent.vnode)&&ap(s,t,n,o),o=o.parent}}function ap(e,t,n,s){const o=hi(t,e,s,!0);fr(()=>{Ha(s[t],o)},n)}function hi(e,t,n=Gt,s=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...c)=>{Tn();const d=qs(n),h=fn(t,n,e,c);return d(),Pn(),h});return s?o.unshift(a):o.push(a),a}}const Bn=e=>(t,n=Gt)=>{(!Ks||e==="sp")&&hi(e,(...s)=>t(...s),n)},lp=Bn("bm"),mn=Bn("m"),up=Bn("bu"),Pc=Bn("u"),Ac=Bn("bum"),fr=Bn("um"),cp=Bn("sp"),fp=Bn("rtg"),dp=Bn("rtc");function pp(e,t=Gt){hi("ec",e,t)}const hp=Symbol.for("v-ndc");function ct(e,t,n,s){let o;const a=n,c=Ke(e);if(c||bt(e)){const d=c&&rr(e);let h=!1,y=!1;d&&(h=!un(e),y=An(e),e=ci(e)),o=new Array(e.length);for(let m=0,w=e.length;m<w;m++)o[m]=t(h?y?or(cn(e[m])):cn(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 d=0;d<e;d++)o[d]=t(d+1,d,void 0,a)}else if(lt(e))if(e[Symbol.iterator])o=Array.from(e,(d,h)=>t(d,h,void 0,a));else{const d=Object.keys(e);o=new Array(d.length);for(let h=0,y=d.length;h<y;h++){const m=d[h];o[h]=t(e[m],m,h,a)}}else o=[];return o}const xa=e=>e?Xc(e)?yi(e):xa(e.parent):null,Es=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=>xa(e.parent),$root:e=>xa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Mc(e),$forceUpdate:e=>e.f||(e.f=()=>{tl(e.update)}),$nextTick:e=>e.n||(e.n=rs.bind(e.proxy)),$watch:e=>Zd.bind(e)}),aa=(e,t)=>e!==ft&&!e.__isScriptSetup&&it(e,t),vp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:c,type:d,appContext:h}=e;if(t[0]!=="$"){const C=c[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(aa(s,t))return c[t]=1,s[t];if(o!==ft&&it(o,t))return c[t]=2,o[t];if(it(a,t))return c[t]=3,a[t];if(n!==ft&&it(n,t))return c[t]=4,n[t];Ca&&(c[t]=0)}}const y=Es[t];let m,w;if(y)return t==="$attrs"&&Ft(e.attrs,"get",""),y(e);if((m=d.__cssModules)&&(m=m[t]))return m;if(n!==ft&&it(n,t))return c[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 aa(o,t)?(o[t]=n,!0):s!==ft&&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:c}},d){let h;return!!(n[d]||e!==ft&&d[0]!=="$"&&it(e,d)||aa(t,d)||it(a,d)||it(s,d)||it(Es,d)||it(o.config.globalProperties,d)||(h=c.__cssModules)&&h[d])},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 au(e){return Ke(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ca=!0;function mp(e){const t=Mc(e),n=e.proxy,s=e.ctx;Ca=!1,t.beforeCreate&&lu(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:c,watch:d,provide:h,inject:y,created:m,beforeMount:w,mounted:C,beforeUpdate:O,updated:N,activated:ee,deactivated:te,beforeDestroy:ue,beforeUnmount:P,destroyed:L,unmounted:J,render:ce,renderTracked:ie,renderTriggered:Q,errorCaptured:A,serverPrefetch:S,expose:oe,inheritAttrs:ge,components:Y,directives:xe,filters:Fe}=t;if(y&&yp(y,s,null),c)for(const Ye in c){const me=c[Ye];Ge(me)&&(s[Ye]=me.bind(n))}if(o){const Ye=o.call(n,n);lt(Ye)&&(e.data=Qa(Ye))}if(Ca=!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,Ne=!Ge(me)&&Ge(me.set)?me.set.bind(n):En,De=at({get:Me,set:Ne});Object.defineProperty(s,Ye,{enumerable:!0,configurable:!0,get:()=>De.value,set:Ce=>De.value=Ce})}if(d)for(const Ye in d)Oc(d[Ye],s,n,Ye);if(h){const Ye=Ge(h)?h.call(n):h;Reflect.ownKeys(Ye).forEach(me=>{Jd(me,Ye[me])})}m&&lu(m,e,"c");function We(Ye,me){Ke(me)?me.forEach(Me=>Ye(Me.bind(n))):me&&Ye(me.bind(n))}if(We(lp,w),We(mn,C),We(up,O),We(Pc,N),We(op,ee),We(ip,te),We(pp,A),We(dp,ie),We(fp,Q),We(Ac,P),We(fr,J),We(cp,S),Ke(oe))if(oe.length){const Ye=e.exposed||(e.exposed={});oe.forEach(me=>{Object.defineProperty(Ye,me,{get:()=>n[me],set:Me=>n[me]=Me,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===En&&(e.render=ce),ge!=null&&(e.inheritAttrs=ge),Y&&(e.components=Y),xe&&(e.directives=xe),S&&$c(e)}function yp(e,t,n=En){Ke(e)&&(e=Sa(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),Vt(a)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:c=>a.value=c}):t[s]=a}}function lu(e,t,n){fn(Ke(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Oc(e,t,n,s){let o=s.includes(".")?_c(n,s):()=>n[s];if(bt(e)){const a=t[e];Ge(a)&&vt(o,a)}else if(Ge(e))vt(o,e.bind(n));else if(lt(e))if(Ke(e))e.forEach(a=>Oc(a,t,n,s));else{const a=Ge(e.handler)?e.handler.bind(n):t[e.handler];Ge(a)&&vt(o,a,e)}}function Mc(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:c}}=e.appContext,d=a.get(t);let h;return d?h=d:!o.length&&!n&&!s?h=t:(h={},o.length&&o.forEach(y=>Bo(h,y,c,!0)),Bo(h,t,c)),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(c=>Bo(e,c,n,!0));for(const c in t)if(!(s&&c==="expose")){const d=gp[c]||n&&n[c];e[c]=d?d(e[c],t[c]):t[c]}return e}const gp={data:uu,props:cu,emits:cu,methods:bs,computed:bs,beforeCreate:Ht,created:Ht,beforeMount:Ht,mounted:Ht,beforeUpdate:Ht,updated:Ht,beforeDestroy:Ht,beforeUnmount:Ht,destroyed:Ht,unmounted:Ht,activated:Ht,deactivated:Ht,errorCaptured:Ht,serverPrefetch:Ht,components:bs,directives:bs,watch:wp,provide:uu,inject:bp};function uu(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 bp(e,t){return bs(Sa(e),Sa(t))}function Sa(e){if(Ke(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ht(e,t){return e?[...new Set([].concat(e,t))]:t}function bs(e,t){return e?Et(Object.create(null),e,t):t}function cu(e,t){return e?Ke(e)&&Ke(t)?[...new Set([...e,...t])]:Et(Object.create(null),au(e),au(t??{})):t}function wp(e,t){if(!e)return t;if(!t)return e;const n=Et(Object.create(null),e);for(const s in t)n[s]=Ht(e[s],t[s]);return n}function Ic(){return{app:null,config:{isNativeTag:Uu,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 _p=0;function kp(e,t){return function(s,o=null){Ge(s)||(s=Et({},s)),o!=null&&!lt(o)&&(o=null);const a=Ic(),c=new WeakSet,d=[];let h=!1;const y=a.app={_uid:_p++,_component:s,_props:o,_container:null,_context:a,_instance:null,version:eh,get config(){return a.config},set config(m){},use(m,...w){return c.has(m)||(m&&Ge(m.install)?(c.add(m),m.install(y,...w)):Ge(m)&&(c.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 O=y._ceVNode||Oe(s,o);return O.appContext=a,C===!0?C="svg":C===!1&&(C=void 0),e(O,m,C),h=!0,y._container=m,m.__vue_app__=y,yi(O.component)}},onUnmount(m){d.push(m)},unmount(){h&&(fn(d,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=Yr;Yr=y;try{return m()}finally{Yr=w}}};return y}}let Yr=null;const xp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${hn(t)}Modifiers`]||e[`${ur(t)}Modifiers`];function Cp(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ft;let o=n;const a=t.startsWith("update:"),c=a&&xp(s,t.slice(7));c&&(c.trim&&(o=n.map(m=>bt(m)?m.trim():m)),c.number&&(o=o.map(li)));let d,h=s[d=ea(t)]||s[d=ea(hn(t))];!h&&a&&(h=s[d=ea(ur(t))]),h&&fn(h,e,6,o);const y=s[d+"Once"];if(y){if(!e.emitted)e.emitted={};else if(e.emitted[d])return;e.emitted[d]=!0,fn(y,e,6,o)}}const Sp=new WeakMap;function jc(e,t,n=!1){const s=n?Sp:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const a=e.emits;let c={},d=!1;if(!Ge(e)){const h=y=>{const m=jc(y,t,!0);m&&(d=!0,Et(c,m))};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}return!a&&!d?(lt(e)&&s.set(e,null),null):(Ke(a)?a.forEach(h=>c[h]=null):Et(c,a),lt(e)&&s.set(e,c),c)}function vi(e,t){return!e||!oi(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),it(e,t[0].toLowerCase()+t.slice(1))||it(e,ur(t))||it(e,t))}function fu(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[a],slots:c,attrs:d,emit:h,render:y,renderCache:m,props:w,data:C,setupState:O,ctx:N,inheritAttrs:ee}=e,te=Fo(e);let ue,P;try{if(n.shapeFlag&4){const J=o||s,ce=J;ue=Cn(y.call(ce,J,m,w,O,C,N)),P=d}else{const J=t;ue=Cn(J.length>1?J(w,{attrs:d,slots:c,emit:h}):J(w,null)),P=t.props?d:Ep(d)}}catch(J){Or.length=0,fi(J,e,1),ue=Oe(Nt)}let L=ue;if(P&&ee!==!1){const J=Object.keys(P),{shapeFlag:ce}=L;J.length&&ce&7&&(a&&J.some(ii)&&(P=$p(P,a)),L=ar(L,P,!1,!0))}if(n.dirs&&(L=ar(L,null,!1,!0),L.dirs=L.dirs?L.dirs.concat(n.dirs):n.dirs),n.transition){const J=di(L.type)&&No(L)||L;ir(J,n.transition)}return ue=L,Fo(te),ue}function Dc(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Ls(o)){if(o.type!==Nt||o.children==="v-if"){if(n)return;n=o}}else return}return n}const Ep=e=>{let t;for(const n in e)(n==="class"||n==="style"||oi(n))&&((t||(t={}))[n]=e[n]);return t},$p=(e,t)=>{const n={};for(const s in e)(!ii(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Tp(e,t,n){const{props:s,children:o,component:a}=e,{props:c,children:d,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?du(s,c,y):!!c;if(h&8){const m=t.dynamicProps;for(let w=0;w<m.length;w++){const C=m[w];if(Lc(c,s,C)&&!vi(y,C))return!0}}}else return(o||d)&&(!d||!d.$stable)?!0:s===c?!1:s?c?du(s,c,y):!0:!!c;return!1}function du(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)||Lc(t,e,a)&&!vi(n,a))return!0}return!1}function Lc(e,t,n){const s=e[n],o=t[n];return n==="style"&&lt(s)&&lt(o)?!sr(s,o):s!==o}function Pp({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 Rc={},Kc=()=>Object.create(Rc),Fc=e=>Object.getPrototypeOf(e)===Rc;function Ap(e,t,n,s=!1){const o={},a=Kc();e.propsDefaults=Object.create(null),Nc(e,t,o,a);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=s?o:Rd(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function Op(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:c}}=e,d=ot(o),[h]=e.propsOptions;let y=!1;if((s||c>0)&&!(c&16)){if(c&8){const m=e.vnode.dynamicProps;for(let w=0;w<m.length;w++){let C=m[w];if(vi(e.emitsOptions,C))continue;const O=t[C];if(h)if(it(a,C))O!==a[C]&&(a[C]=O,y=!0);else{const N=hn(C);o[N]=Ea(h,d,N,O,e,!1)}else O!==a[C]&&(a[C]=O,y=!0)}}}else{Nc(e,t,o,a)&&(y=!0);let m;for(const w in d)(!t||!it(t,w)&&((m=ur(w))===w||!it(t,m)))&&(h?n&&(n[w]!==void 0||n[m]!==void 0)&&(o[w]=Ea(h,d,w,void 0,e,!0)):delete o[w]);if(a!==d)for(const w in a)(!t||!it(t,w))&&(delete a[w],y=!0)}y&&Ln(e.attrs,"set","")}function Nc(e,t,n,s){const[o,a]=e.propsOptions;let c=!1,d;if(t)for(let h in t){if(_s(h))continue;const y=t[h];let m;o&&it(o,m=hn(h))?!a||!a.includes(m)?n[m]=y:(d||(d={}))[m]=y:vi(e.emitsOptions,h)||(!(h in s)||y!==s[h])&&(s[h]=y,c=!0)}if(a){const h=ot(n),y=d||ft;for(let m=0;m<a.length;m++){const w=a[m];n[w]=Ea(o,h,w,y[w],e,!it(y,w))}}return c}function Ea(e,t,n,s,o,a){const c=e[n];if(c!=null){const d=it(c,"default");if(d&&s===void 0){const h=c.default;if(c.type!==Function&&!c.skipFactory&&Ge(h)){const{propsDefaults:y}=o;if(n in y)s=y[n];else{const m=qs(o);s=y[n]=h.call(null,t),m()}}else s=h;o.ce&&o.ce._setProp(n,s)}c[0]&&(a&&!d?s=!1:c[1]&&(s===""||s===ur(n))&&(s=!0))}return s}const Mp=new WeakMap;function Vc(e,t,n=!1){const s=n?Mp:t.propsCache,o=s.get(e);if(o)return o;const a=e.props,c={},d=[];let h=!1;if(!Ge(e)){const m=w=>{h=!0;const[C,O]=Vc(w,t,!0);Et(c,C),O&&d.push(...O)};!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,Tr),Tr;if(Ke(a))for(let m=0;m<a.length;m++){const w=hn(a[m]);pu(w)&&(c[w]=ft)}else if(a)for(const m in a){const w=hn(m);if(pu(w)){const C=a[m],O=c[w]=Ke(C)||Ge(C)?{type:C}:Et({},C),N=O.type;let ee=!1,te=!0;if(Ke(N))for(let ue=0;ue<N.length;++ue){const P=N[ue],L=Ge(P)&&P.name;if(L==="Boolean"){ee=!0;break}else L==="String"&&(te=!1)}else ee=Ge(N)&&N.name==="Boolean";O[0]=ee,O[1]=te,(ee||it(O,"default"))&&d.push(w)}}const y=[c,d];return lt(e)&&s.set(e,y),y}function pu(e){return e[0]!=="$"&&!_s(e)}const rl=e=>e==="_"||e==="_ctx"||e==="$stable",sl=e=>Ke(e)?e.map(Cn):[Cn(e)],Ip=(e,t,n)=>{if(t._n)return t;const s=cr((...o)=>sl(t(...o)),n);return s._c=!1,s},Bc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(rl(o))continue;const a=e[o];if(Ge(a))t[o]=Ip(o,a,s);else if(a!=null){const c=sl(a);t[o]=()=>c}}},Uc=(e,t)=>{const n=sl(t);e.slots.default=()=>n},qc=(e,t,n)=>{for(const s in t)(n||!rl(s))&&(e[s]=t[s])},jp=(e,t,n)=>{const s=e.slots=Kc();if(e.vnode.shapeFlag&32){const o=t._;o?(qc(s,t,n),n&&Gu(s,"_",o,!0)):Bc(t,s)}else t&&Uc(e,t)},Dp=(e,t,n)=>{const{vnode:s,slots:o}=e;let a=!0,c=ft;if(s.shapeFlag&32){const d=t._;d?n&&d===1?a=!1:qc(o,t,n):(a=!t.$stable,Bc(t,o)),c=t}else t&&(Uc(e,t),c={default:1});if(a)for(const d in o)!rl(d)&&c[d]==null&&delete o[d]},Wt=Np;function Lp(e){return Rp(e)}function Rp(e,t){const n=ui();n.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:c,createText:d,createComment:h,setText:y,setElementText:m,parentNode:w,nextSibling:C,setScopeId:O=En,insertStaticContent:N}=e,ee=(k,_,x,z=null,ne=null,le=null,be=void 0,ve=null,ae=!!_.dynamicChildren)=>{if(k===_)return;k&&!Er(k,_)&&(z=dt(k),Ce(k,ne,le,!0),k=null),_.patchFlag===-2&&(ae=!1,_.dynamicChildren=null),_.dynamicChildren&&k&&k.dynamicChildren&&k.dynamicChildren.hasOnce&&(_.dynamicChildren===Tr&&(_.dynamicChildren=[]),_.dynamicChildren.hasOnce=!0);const{type:U,ref:q,shapeFlag:G}=_;switch(U){case mi:te(k,_,x,z);break;case Nt:ue(k,_,x,z);break;case Po:k==null&&P(_,x,z,be);break;case Re:Y(k,_,x,z,ne,le,be,ve,ae);break;default:G&1?ce(k,_,x,z,ne,le,be,ve,ae):G&6?xe(k,_,x,z,ne,le,be,ve,ae):(G&64||G&128)&&U.process(k,_,x,z,ne,le,be,ve,ae,Xt)}q!=null&&ne?Cs(q,k&&k.ref,le,_||k,!_):q==null&&k&&k.ref!=null&&Cs(k.ref,null,le,k,!0)},te=(k,_,x,z)=>{if(k==null)s(_.el=d(_.children),x,z);else{const ne=_.el=k.el;_.children!==k.children&&y(ne,_.children)}},ue=(k,_,x,z)=>{k==null?s(_.el=h(_.children||""),x,z):_.el=k.el},P=(k,_,x,z)=>{[k.el,k.anchor]=N(k.children,_,x,z,k.el,k.anchor)},L=({el:k,anchor:_},x,z)=>{let ne;for(;k&&k!==_;)ne=C(k),s(k,x,z),k=ne;s(_,x,z)},J=({el:k,anchor:_})=>{let x;for(;k&&k!==_;)x=C(k),o(k),k=x;o(_)},ce=(k,_,x,z,ne,le,be,ve,ae)=>{if(_.type==="svg"?be="svg":_.type==="math"&&(be="mathml"),k==null)ie(_,x,z,ne,le,be,ve,ae);else{const U=k.el&&k.el._isVueCE?k.el:null;try{U&&U._beginPatch(),S(k,_,ne,le,be,ve,ae)}finally{U&&U._endPatch()}}},ie=(k,_,x,z,ne,le,be,ve)=>{let ae,U;const{props:q,shapeFlag:G,transition:$e,dirs:Ve}=k;if(ae=k.el=c(k.type,le,q&&q.is,q),G&8?m(ae,k.children):G&16&&A(k.children,ae,null,z,ne,la(k,le),be,ve),Ve&&_r(k,null,z,"created"),Q(ae,k,k.scopeId,be,z),q){for(const Xe in q)Xe!=="value"&&!_s(Xe)&&a(ae,Xe,null,q[Xe],le,z);"value"in q&&a(ae,"value",null,q.value,le),(U=q.onVnodeBeforeMount)&&bn(U,z,k)}Ve&&_r(k,null,z,"beforeMount");const Qe=Kp(ne,$e);Qe&&$e.beforeEnter(ae),s(ae,_,x),((U=q&&q.onVnodeMounted)||Qe||Ve)&&Wt(()=>{try{U&&bn(U,z,k),Qe&&$e.enter(ae),Ve&&_r(k,null,z,"mounted")}finally{}},ne)},Q=(k,_,x,z,ne)=>{if(x&&O(k,x),z)for(let le=0;le<z.length;le++)O(k,z[le]);if(ne){let le=ne.subTree;if(_===le||Wc(le.type)&&(le.ssContent===_||le.ssFallback===_)){const be=ne.vnode;Q(k,be,be.scopeId,be.slotScopeIds,ne.parent)}}},A=(k,_,x,z,ne,le,be,ve,ae=0)=>{for(let U=ae;U<k.length;U++){const q=k[U]=ve?Dn(k[U]):Cn(k[U]);ee(null,q,_,x,z,ne,le,be,ve)}},S=(k,_,x,z,ne,le,be)=>{const ve=_.el=k.el;let{patchFlag:ae,dynamicChildren:U,dirs:q}=_;ae|=k.patchFlag&16;const G=k.props||ft,$e=_.props||ft;let Ve;if(x&&kr(x,!1),(Ve=$e.onVnodeBeforeUpdate)&&bn(Ve,x,_,k),q&&_r(_,k,x,"beforeUpdate"),x&&kr(x,!0),U&&(!k.dynamicChildren||k.dynamicChildren.length!==U.length)&&(ae=0,be=!1,U=null),(G.innerHTML&&$e.innerHTML==null||G.textContent&&$e.textContent==null)&&m(ve,""),U?oe(k.dynamicChildren,U,ve,x,z,la(_,ne),le):be||me(k,_,ve,null,x,z,la(_,ne),le,!1),ae>0){if(ae&16)ge(ve,G,$e,x,ne);else if(ae&2&&G.class!==$e.class&&a(ve,"class",null,$e.class,ne),ae&4&&a(ve,"style",G.style,$e.style,ne),ae&8){const Qe=_.dynamicProps;for(let Xe=0;Xe<Qe.length;Xe++){const Ze=Qe[Xe],mt=G[Ze],kt=$e[Ze];(kt!==mt||Ze==="value")&&a(ve,Ze,mt,kt,ne,x)}}ae&1&&k.children!==_.children&&m(ve,_.children)}else!be&&U==null&&ge(ve,G,$e,x,ne);((Ve=$e.onVnodeUpdated)||q)&&Wt(()=>{Ve&&bn(Ve,x,_,k),q&&_r(_,k,x,"updated")},z)},oe=(k,_,x,z,ne,le,be)=>{for(let ve=0;ve<_.length;ve++){const ae=k[ve],U=_[ve],q=ae.el||$a(ae),G=q&&(ae.type===Re||!Er(ae,U)||ae.shapeFlag&198)?w(q):x;ee(ae,U,G,null,z,ne,le,be,!0)}},ge=(k,_,x,z,ne)=>{if(_!==x){if(_!==ft)for(const le in _)!_s(le)&&!(le in x)&&a(k,le,_[le],null,ne,z);for(const le in x){if(_s(le))continue;const be=x[le],ve=_[le];be!==ve&&le!=="value"&&a(k,le,ve,be,ne,z)}"value"in x&&a(k,"value",_.value,x.value,ne)}},Y=(k,_,x,z,ne,le,be,ve,ae)=>{const U=_.el=k?k.el:d(""),q=_.anchor=k?k.anchor:d("");let{patchFlag:G,dynamicChildren:$e,slotScopeIds:Ve}=_;Ve&&(ve=ve?ve.concat(Ve):Ve),k==null?(s(U,x,z),s(q,x,z),A(_.children||[],x,q,ne,le,be,ve,ae)):G>0&&G&64&&$e&&k.dynamicChildren&&k.dynamicChildren.length===$e.length?(oe(k.dynamicChildren,$e,x,ne,le,be,ve),(_.key!=null||ne&&_===ne.subTree)&&ol(k,_,!0)):me(k,_,x,q,ne,le,be,ve,ae)},xe=(k,_,x,z,ne,le,be,ve,ae)=>{_.slotScopeIds=ve,k==null?_.shapeFlag&512?ne.ctx.activate(_,x,z,be,ae):Fe(_,x,z,ne,le,be,ae):rt(k,_,ae)},Fe=(k,_,x,z,ne,le,be)=>{const ve=k.component=zp(k,z,ne);if(pi(k)&&(ve.ctx.renderer=Xt),Gp(ve,!1,be),ve.asyncDep){if(ne&&ne.registerDep(ve,We,be,le),!k.el){const ae=ve.subTree=Oe(Nt);ue(null,ae,_,x),k.placeholder=ae.el}}else We(ve,k,_,x,ne,le,be)},rt=(k,_,x)=>{const z=_.component=k.component;if(Tp(k,_,x))if(z.asyncDep&&!z.asyncResolved){_.el=k.el,_.placeholder=k.placeholder,Ye(z,_,x);return}else z.next=_,z.update();else _.el=k.el,_.placeholder=k.placeholder,z.vnode=_},We=(k,_,x,z,ne,le,be)=>{const ve=()=>{if(k.isMounted){let{next:G,bu:$e,u:Ve,parent:Qe,vnode:Xe}=k;{const Ut=Hc(k);if(Ut){G&&(G.el=Xe.el,Ye(k,G,be)),Ut.asyncDep.then(()=>{Wt(()=>{k.isUnmounted||U()},ne)});return}}let Ze=G,mt;kr(k,!1),G?(G.el=Xe.el,Ye(k,G,be)):G=Xe,$e&&$o($e),(mt=G.props&&G.props.onVnodeBeforeUpdate)&&bn(mt,Qe,G,Xe),kr(k,!0);const kt=fu(k),Qt=k.subTree;k.subTree=kt,ee(Qt,kt,w(Qt.el),dt(Qt),k,ne,le),G.el=kt.el,Ze===null&&Pp(k,kt.el),Ve&&Wt(Ve,ne),(mt=G.props&&G.props.onVnodeUpdated)&&Wt(()=>bn(mt,Qe,G,Xe),ne)}else{let G;const{el:$e,props:Ve}=_,{bm:Qe,m:Xe,parent:Ze,root:mt,type:kt}=k,Qt=Ss(_);kr(k,!1),Qe&&$o(Qe),!Qt&&(G=Ve&&Ve.onVnodeBeforeMount)&&bn(G,Ze,_),kr(k,!0);{mt.ce&&mt.ce._hasShadowRoot()&&mt.ce._injectChildStyle(kt,k.parent?k.parent.type:void 0);const Ut=k.subTree=fu(k);ee(null,Ut,x,z,k,ne,le),_.el=Ut.el}if(Xe&&Wt(Xe,ne),!Qt&&(G=Ve&&Ve.onVnodeMounted)){const Ut=_;Wt(()=>bn(G,Ze,Ut),ne)}(_.shapeFlag&256||Ze&&Ss(Ze.vnode)&&Ze.vnode.shapeFlag&256)&&k.a&&Wt(k.a,ne),k.isMounted=!0,_=x=z=null}};k.scope.on();const ae=k.effect=new Qu(ve);k.scope.off();const U=k.update=ae.run.bind(ae),q=k.job=ae.runIfDirty.bind(ae);q.i=k,q.id=k.uid,ae.scheduler=()=>tl(q),kr(k,!0),U()},Ye=(k,_,x)=>{_.component=k;const z=k.vnode.props;k.vnode=_,k.next=null,Op(k,_.props,z,x),Dp(k,_.children,x),Tn(),mc(k),Pn()},me=(k,_,x,z,ne,le,be,ve,ae=!1)=>{const U=k&&k.children,q=k?k.shapeFlag:0,G=_.children,{patchFlag:$e,shapeFlag:Ve}=_;if($e>0){if($e&128){Ne(U,G,x,z,ne,le,be,ve,ae);return}else if($e&256){Me(U,G,x,z,ne,le,be,ve,ae);return}}Ve&8?(q&16&&Be(U,ne,le),G!==U&&m(x,G)):q&16?Ve&16?Ne(U,G,x,z,ne,le,be,ve,ae):Be(U,ne,le,!0):(q&8&&m(x,""),Ve&16&&A(G,x,z,ne,le,be,ve,ae))},Me=(k,_,x,z,ne,le,be,ve,ae)=>{k=k||Tr,_=_||Tr;const U=k.length,q=_.length,G=Math.min(U,q);let $e;for($e=0;$e<G;$e++){const Ve=_[$e]=ae?Dn(_[$e]):Cn(_[$e]);ee(k[$e],Ve,x,null,ne,le,be,ve,ae)}U>q?Be(k,ne,le,!0,!1,G):A(_,x,z,ne,le,be,ve,ae,G)},Ne=(k,_,x,z,ne,le,be,ve,ae)=>{let U=0;const q=_.length;let G=k.length-1,$e=q-1;for(;U<=G&&U<=$e;){const Ve=k[U],Qe=_[U]=ae?Dn(_[U]):Cn(_[U]);if(Er(Ve,Qe))ee(Ve,Qe,x,null,ne,le,be,ve,ae);else break;U++}for(;U<=G&&U<=$e;){const Ve=k[G],Qe=_[$e]=ae?Dn(_[$e]):Cn(_[$e]);if(Er(Ve,Qe))ee(Ve,Qe,x,null,ne,le,be,ve,ae);else break;G--,$e--}if(U>G){if(U<=$e){const Ve=$e+1,Qe=Ve<q?_[Ve].el:z;for(;U<=$e;)ee(null,_[U]=ae?Dn(_[U]):Cn(_[U]),x,Qe,ne,le,be,ve,ae),U++}}else if(U>$e)for(;U<=G;)Ce(k[U],ne,le,!0),U++;else{const Ve=U,Qe=U,Xe=new Map;for(U=Qe;U<=$e;U++){const Ot=_[U]=ae?Dn(_[U]):Cn(_[U]);Ot.key!=null&&Xe.set(Ot.key,U)}let Ze,mt=0;const kt=$e-Qe+1;let Qt=!1,Ut=0;const en=new Array(kt);for(U=0;U<kt;U++)en[U]=0;for(U=Ve;U<=G;U++){const Ot=k[U];if(mt>=kt){Ce(Ot,ne,le,!0);continue}let $t;if(Ot.key!=null)$t=Xe.get(Ot.key);else for(Ze=Qe;Ze<=$e;Ze++)if(en[Ze-Qe]===0&&Er(Ot,_[Ze])){$t=Ze;break}$t===void 0?Ce(Ot,ne,le,!0):(en[$t-Qe]=U+1,$t>=Ut?Ut=$t:Qt=!0,ee(Ot,_[$t],x,null,ne,le,be,ve,ae),mt++)}const pr=Qt?Fp(en):Tr;for(Ze=pr.length-1,U=kt-1;U>=0;U--){const Ot=Qe+U,$t=_[Ot],Ie=_[Ot+1],Un=Ot+1<q?Ie.el||$a(Ie):z;en[U]===0?ee(null,$t,x,Un,ne,le,be,ve,ae):Qt&&(Ze<0||U!==pr[Ze]?De($t,x,Un,2):Ze--)}}},De=(k,_,x,z,ne=null)=>{const{el:le,type:be,transition:ve,children:ae,shapeFlag:U}=k;if(U&6){De(k.component.subTree,_,x,z);return}if(U&128){k.suspense.move(_,x,z);return}if(U&64){be.move(k,_,x,Xt);return}if(be===Re){s(le,_,x);for(let G=0;G<ae.length;G++)De(ae[G],_,x,z);s(k.anchor,_,x);return}if(be===Po){L(k,_,x);return}if(z!==2&&U&1&&ve)if(z===0)ve.persisted&&!le[an]?s(le,_,x):(ve.beforeEnter(le),s(le,_,x),Wt(()=>ve.enter(le),ne));else{const{leave:G,delayLeave:$e,afterLeave:Ve}=ve,Qe=()=>{k.ctx.isUnmounted?o(le):s(le,_,x)},Xe=()=>{const Ze=le._isLeaving||!!le[an];le._isLeaving&&le[an](!0),ve.persisted&&!Ze?Qe():G(le,()=>{Qe(),Ve&&Ve()})};$e?$e(le,Qe,Xe):Xe()}else s(le,_,x)},Ce=(k,_,x,z=!1,ne=!1)=>{const{type:le,props:be,ref:ve,children:ae,dynamicChildren:U,shapeFlag:q,patchFlag:G,dirs:$e,cacheIndex:Ve,memo:Qe}=k;if((G===-2||U&&U.hasOnce)&&(ne=!1),ve!=null&&(Tn(),Cs(ve,null,x,k,!0),Pn()),Ve!=null&&(!k.ctx||k.ctx===_)&&(_.renderCache[Ve]=void 0),q&256){_.ctx.deactivate(k);return}const Xe=q&1&&$e,Ze=!Ss(k);let mt;if(Ze&&(mt=be&&be.onVnodeBeforeUnmount)&&bn(mt,_,k),q&6)ke(k.component,x,z);else{if(q&128){k.suspense.unmount(x,z);return}Xe&&_r(k,null,_,"beforeUnmount"),q&64?k.type.remove(k,_,x,Xt,z):U&&!U.hasOnce&&(le!==Re||G>0&&G&64)?Be(U,_,x,!1,!0):(le===Re&&G&384||!ne&&q&16)&&Be(ae,_,x),z&&X(k)}const kt=Qe!=null&&Ve==null;(Ze&&(mt=be&&be.onVnodeUnmounted)||Xe||kt)&&Wt(()=>{mt&&bn(mt,_,k),Xe&&_r(k,null,_,"unmounted"),kt&&(k.el=null)},x)},X=k=>{const{type:_,el:x,anchor:z,transition:ne}=k,le=_===Re;if(le&&!ne){Z(x,z);return}if(_===Po){J(k),ne&&!ne.persisted&&ne.afterLeave&&ne.afterLeave();return}const be=le?js(k):k,ve=()=>{le?w(x)&&Z(x,z):o(x),ne&&!ne.persisted&&ne.afterLeave&&ne.afterLeave()};if(be&&be.shapeFlag&1&&ne&&!ne.persisted){const{leave:ae,delayLeave:U}=ne,q=be.el,G=()=>ae(q,ve);U?U(q,ve,G):G()}else ve()},Z=(k,_)=>{let x;for(;k!==_;)x=C(k),o(k),k=x;o(_)},ke=(k,_,x)=>{const{bum:z,scope:ne,job:le,subTree:be,um:ve,m:ae,a:U}=k;hu(ae),hu(U),z&&$o(z),ne.stop(),le?(le.flags|=8,Ce(be,k,_,x)):k.vnode.el&&be&&(be.transition=k.vnode.transition,Ce(be,k,_,x)),ve&&Wt(ve,_),Wt(()=>{k.isUnmounted=!0},_)},Be=(k,_,x,z=!1,ne=!1,le=0)=>{for(let be=le;be<k.length;be++)Ce(k[be],_,x,z,ne)},dt=k=>{if(k.shapeFlag&6)return dt(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const _=C(k.anchor||k.el),x=_&&_[kc];return x?C(x):_},Jt=(k,_,x)=>{const z=k&&_._vnode?void 0:k&&k.component?k.component.uid:Wp();Yd(()=>{k==null?_._vnode&&Ce(_._vnode,null,null,!0):ee(_._vnode||null,k,_,null,null,null,x),_._vnode=k},z)},Xt={p:ee,um:Ce,m:De,r:X,mt:Fe,mc:A,pc:me,pbc:oe,n:dt,o:e};return{render:Jt,hydrate:void 0,createApp:kp(Jt)}}function la({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 kr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Kp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ol(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 c=s[a];let d=o[a];d.shapeFlag&1&&!d.dynamicChildren&&((d.patchFlag<=0||d.patchFlag===32)&&(d=o[a]=Dn(o[a]),d.el=c.el),!n&&d.patchFlag!==-2&&ol(c,d)),d.type===mi&&(d.patchFlag===-1&&(d=o[a]=Dn(d)),d.el=c.el),d.type===Nt&&!d.el&&(d.el=c.el)}}function Fp(e){const t=e.slice(),n=[0];let s,o,a,c,d;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,c=n.length-1;a<c;)d=a+c>>1,e[n[d]]<y?a=d+1:c=d;y<e[n[a]]&&(a>0&&(t[s]=n[a-1]),n[a]=s)}}for(a=n.length,c=n[a-1];a-- >0;)n[a]=c,c=t[c];return n}function Hc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Hc(t)}function hu(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function $a(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?$a(t.subTree):null}const Wc=e=>e.__isSuspense;function Np(e,t){t&&t.pendingBranch?Ke(e)?t.effects.push(...e):t.effects.push(e):Gd(e)}const Re=Symbol.for("v-fgt"),mi=Symbol.for("v-txt"),Nt=Symbol.for("v-cmt"),Po=Symbol.for("v-stc"),Or=[];let sn=null;function K(e=!1){Or.push(sn=e?null:[])}function zc(){Or.pop(),sn=Or[Or.length-1]||null}let Ds=1;function Uo(e,t=!1){Ds+=e,e<0&&sn&&t&&(sn.hasOnce=!0)}function Gc(e){return e.dynamicChildren=Ds>0?sn||Tr:null,zc(),Ds>0&&sn&&sn.push(e),e}function H(e,t,n,s,o,a){return Gc(u(e,t,n,s,o,a,!0))}function It(e,t,n,s,o){return Gc(Oe(e,t,n,s,o,!0))}function Ls(e){return e?e.__v_isVNode===!0:!1}function Er(e,t){return e.type===t.type&&e.key===t.key}const Yc=({key:e})=>e??null,Ao=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bt(e)||Vt(e)||Ge(e)?{i:ln,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,s=0,o=null,a=e===Re?0:1,c=!1,d=!1){const h={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Yc(t),ref:t&&Ao(t),scopeId:bc,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:ln};return d?(qo(h,n),a&128&&e.normalize(h)):n&&(h.shapeFlag|=bt(n)?8:16),Ds>0&&!c&&sn&&(h.patchFlag>0||a&6)&&h.patchFlag!==32&&sn.push(h),h}const Oe=Vp;function Vp(e,t=null,n=null,s=0,o=null,a=!1){if((!e||e===hp)&&(e=Nt),Ls(e)){const d=ar(e,t,!0);return n&&qo(d,n),Ds>0&&!a&&sn&&(d.shapeFlag&6?sn[sn.indexOf(e)]=d:sn.push(d)),d.patchFlag=-2,d}if(Qp(e)&&(e=e.__vccOpts),t){t=Bp(t);let{class:d,style:h}=t;d&&!bt(d)&&(t.class=tt(d)),lt(h)&&(el(h)&&!Ke(h)&&(h=Et({},h)),t.style=nr(h))}const c=bt(e)?1:Wc(e)?128:di(e)?64:lt(e)?4:Ge(e)?2:0;return u(e,t,n,s,o,c,a,!0)}function Bp(e){return e?el(e)||Fc(e)?Et({},e):e:null}function ar(e,t,n=!1,s=!1){const{props:o,ref:a,patchFlag:c,children:d,transition:h}=e,y=t?qp(o||{},t):o,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:y,key:y&&Yc(y),ref:t&&t.ref?n&&a?Ke(a)?a.concat(Ao(t)):[a,Ao(t)]:Ao(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:d,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Re?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:h,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ar(e.ssContent),ssFallback:e.ssFallback&&ar(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return h&&s&&ir(m,h.clone(m)),m}function rn(e=" ",t=0){return Oe(mi,null,e,t)}function Up(e,t){const n=Oe(Po,null,e);return n.staticCount=t,n}function Ee(e="",t=!1){return t?(K(),It(Nt,null,e)):Oe(Nt,null,e)}function Cn(e){return e==null||typeof e=="boolean"?Oe(Nt):Ke(e)?Oe(Re,null,e.slice()):Ls(e)?Dn(e):Oe(mi,null,String(e))}function Dn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ar(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&&!Fc(t)?t._ctx=ln:o===3&&ln&&(ln.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:ln},n=32}else t=String(t),s&64?(n=16,t=[rn(t)]):n=8;e.children=t,e.shapeFlag|=n}function qp(...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=nr([t.style,s.style]);else if(oi(o)){const a=t[o],c=s[o];c&&a!==c&&!(Ke(a)&&a.includes(c))?t[o]=a?[].concat(a,c):c:c==null&&a==null&&!ii(o)&&(t[o]=c)}else o!==""&&(t[o]=s[o])}return t}function bn(e,t,n,s=null){fn(e,t,7,[n,s])}const Hp=Ic();let Jc=0;function Wp(){return Jc}function zp(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Hp,a={uid:Jc++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new bd(!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:Vc(s,o),emitsOptions:jc(s,o),emit:null,emitted:null,propsDefaults:ft,inheritAttrs:s.inheritAttrs,ctx:ft,data:ft,props:ft,attrs:ft,slots:ft,refs:ft,setupState:ft,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=Cp.bind(null,a),e.ce&&e.ce(a),a}let Gt=null;const il=()=>Gt||ln;let Ho,Rs;{const e=ui(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),a=>{o.length>1?o.forEach(c=>c(a)):o[0](a)}};Ho=t("__VUE_INSTANCE_SETTERS__",n=>Gt=n),Rs=t("__VUE_SSR_SETTERS__",n=>Ks=n)}const qs=e=>{const t=Gt;return Ho(e),e.scope.on(),()=>{e.scope.off(),Ho(t)}},vu=()=>{Gt&&Gt.scope.off(),Ho(null)};function Xc(e){return e.vnode.shapeFlag&4}let Ks=!1;function Gp(e,t=!1,n=!1){t&&Rs(t);const{props:s,children:o}=e.vnode,a=Xc(e);Ap(e,s,a,t),jp(e,o,n||t);const c=a?Yp(e,t):void 0;return t&&Rs(!1),c}function Yp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vp);const{setup:s}=n;if(s){Tn();const o=e.setupContext=s.length>1?Xp(e):null,a=qs(e),c=Bs(s,e,0,[e.props,o]),d=qu(c);if(Pn(),a(),(d||e.sp)&&!Ss(e)&&$c(e),d){if(c.then(vu,vu),t)return c.then(h=>{Rs(!0);try{mu(e,h,t)}finally{Rs(!1)}}).catch(h=>{fi(h,e,0)});e.asyncDep=c}else mu(e,c)}else Qc(e)}function mu(e,t,n){Ge(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:lt(t)&&(e.setupState=pc(t)),Qc(e)}function Qc(e,t,n){const s=e.type;e.render||(e.render=s.render||En);{const o=qs(e);Tn();try{mp(e)}finally{Pn(),o()}}}const Jp={get(e,t){return Ft(e,"get",""),e[t]}};function Xp(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Jp),slots:e.slots,emit:e.emit,expose:t}}function yi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(pc(Kd(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Es)return Es[n](e)},has(t,n){return n in t||n in Es}})):e.proxy}function Qp(e){return Ge(e)&&"__vccOpts"in e}const at=(e,t)=>Ud(e,t,Ks);function Zp(e,t,n){try{Uo(-1);const s=arguments.length;return s===2?lt(t)&&!Ke(t)?Ls(t)?Oe(e,null,[t]):Oe(e,t):Oe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Ls(n)&&(n=[n]),Oe(e,t,n))}finally{Uo(1)}}const eh="3.5.44";/**
* @vue/runtime-dom v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Ta;const yu=typeof window<"u"&&window.trustedTypes;if(yu)try{Ta=yu.createPolicy("vue",{createHTML:e=>e})}catch{}const Zc=Ta?e=>Ta.createHTML(e):e=>e,th="http://www.w3.org/2000/svg",nh="http://www.w3.org/1998/Math/MathML",jn=typeof document<"u"?document:null,gu=jn&&jn.createElement("template"),rh={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(th,e):t==="mathml"?jn.createElementNS(nh,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 c=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{gu.innerHTML=Zc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const d=gu.content;if(s==="svg"||s==="mathml"){const h=d.firstChild;for(;h.firstChild;)d.appendChild(h.firstChild);d.removeChild(h)}t.insertBefore(d,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Jn="transition",ys="animation",Zr=Symbol("_vtc"),ef={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},tf=Et({},Cc,ef),sh=e=>(e.displayName="Transition",e.props=tf,e),ss=sh((e,{slots:t})=>Zp(sp,nf(e),t)),xr=(e,t=[])=>{Ke(e)?e.forEach(n=>n(...t)):e&&e(...t)},bu=e=>e?Ke(e)?e.some(t=>t.length>1):e.length>1:!1;function nf(e){const t={};for(const Y in e)Y in ef||(t[Y]=e[Y]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:a=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:d=`${n}-enter-to`,appearFromClass:h=a,appearActiveClass:y=c,appearToClass:m=d,leaveFromClass:w=`${n}-leave-from`,leaveActiveClass:C=`${n}-leave-active`,leaveToClass:O=`${n}-leave-to`}=e,N=oh(o),ee=N&&N[0],te=N&&N[1],{onBeforeEnter:ue,onEnter:P,onEnterCancelled:L,onLeave:J,onLeaveCancelled:ce,onBeforeAppear:ie=ue,onAppear:Q=P,onAppearCancelled:A=L}=t,S=(Y,xe,Fe,rt)=>{Y._enterCancelled=rt,Qn(Y,xe?m:d),Qn(Y,xe?y:c),Fe&&Fe()},oe=(Y,xe)=>{Y._isLeaving=!1,Qn(Y,w),Qn(Y,O),Qn(Y,C),xe&&xe()},ge=Y=>(xe,Fe)=>{const rt=Y?Q:P,We=()=>S(xe,Y,Fe);xr(rt,[xe,We]),wu(()=>{Qn(xe,Y?h:a),wn(xe,Y?m:d),bu(rt)||_u(xe,s,ee,We)})};return Et(t,{onBeforeEnter(Y){xr(ue,[Y]),wn(Y,a),wn(Y,c)},onBeforeAppear(Y){xr(ie,[Y]),wn(Y,h),wn(Y,y)},onEnter:ge(!1),onAppear:ge(!0),onLeave(Y,xe){Y._isLeaving=!0;const Fe=()=>oe(Y,xe);wn(Y,w),Y._enterCancelled?(wn(Y,C),Pa(Y)):(Pa(Y),wn(Y,C)),wu(()=>{Y._isLeaving&&(Qn(Y,w),wn(Y,O),bu(J)||_u(Y,s,te,Fe))}),xr(J,[Y,Fe])},onEnterCancelled(Y){S(Y,!1,void 0,!0),xr(L,[Y])},onAppearCancelled(Y){S(Y,!0,void 0,!0),xr(A,[Y])},onLeaveCancelled(Y){oe(Y),xr(ce,[Y])}})}function oh(e){if(e==null)return null;if(lt(e))return[ua(e.enter),ua(e.leave)];{const t=ua(e);return[t,t]}}function ua(e){return ud(e)}function wn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Zr]||(e[Zr]=new Set)).add(t)}function Qn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Zr];n&&(n.delete(t),n.size||(e[Zr]=void 0))}function wu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ih=0;function _u(e,t,n,s){const o=e._endId=++ih,a=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(a,n);const{type:c,timeout:d,propCount:h}=rf(e,t);if(!c)return s();const y=c+"end";let m=0;const w=()=>{e.removeEventListener(y,C),a()},C=O=>{O.target===e&&++m>=h&&w()};setTimeout(()=>{m<h&&w()},d+1),e.addEventListener(y,C)}function rf(e,t){const n=window.getComputedStyle(e),s=N=>(n[N]||"").split(", "),o=s(`${Jn}Delay`),a=s(`${Jn}Duration`),c=ku(o,a),d=s(`${ys}Delay`),h=s(`${ys}Duration`),y=ku(d,h);let m=null,w=0,C=0;t===Jn?c>0&&(m=Jn,w=c,C=a.length):t===ys?y>0&&(m=ys,w=y,C=h.length):(w=Math.max(c,y),m=w>0?c>y?Jn:ys:null,C=m?m===Jn?a.length:h.length:0);const O=m===Jn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Jn}Property`).toString());return{type:m,timeout:w,propCount:C,hasTransform:O}}function ku(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>xu(n)+xu(e[s])))}function xu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Pa(e){return(e?e.ownerDocument:document).body.offsetHeight}function ah(e,t,n){const s=e[Zr];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Cu=Symbol("_vod"),sf=Symbol("_vsh"),lh=Symbol(""),uh=/(?:^|;)\s*display\s*:/;function ch(e,t,n){const s=e.style,o=bt(n);let a=!1;if(n&&!o){if(t)if(bt(t))for(const c of t.split(";")){const d=c.slice(0,c.indexOf(":")).trim();n[d]==null&&ws(s,d,"")}else for(const c in t)n[c]==null&&ws(s,c,"");for(const c in n){c==="display"&&(a=!0);const d=n[c];d!=null?dh(e,c,!bt(t)&&t?t[c]:void 0,d)||ws(s,c,d):ws(s,c,"")}}else if(o){if(t!==n){const c=s[lh];c&&(n+=";"+c),s.cssText=n,a=uh.test(n)}}else t&&e.removeAttribute("style");Cu in e&&((!o||t!==n)&&(e[Cu]=a?s.display:""),e[sf]&&(s.display="none"))}const Co=/\s*!important$/;function ws(e,t,n){if(Ke(n))n.forEach(s=>ws(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))Co.test(n)?e.setProperty(t,n.replace(Co,""),"important"):e.setProperty(t,n);else{const s=fh(e,t);Co.test(n)?e.setProperty(ur(s),n.replace(Co,""),"important"):e[s]=n}}const Su=["Webkit","Moz","ms"],ca={};function fh(e,t){const n=ca[t];if(n)return n;let s=hn(t);if(s!=="filter"&&s in e)return ca[t]=s;s=zu(s);for(let o=0;o<Su.length;o++){const a=Su[o]+s;if(a in e)return ca[t]=a}return t}function dh(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bt(s)&&n===s}const Eu="http://www.w3.org/1999/xlink";function $u(e,t,n,s,o,a=vd(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Eu,t.slice(6,t.length)):e.setAttributeNS(Eu,t,n):n==null||a&&!Yu(n)?e.removeAttribute(t):e.setAttribute(t,a?"":$n(n)?String(n):n)}function Tu(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Zc(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const d=a==="OPTION"?e.getAttribute("value")||"":e.value,h=n==null?e.type==="checkbox"?"on":"":String(n);(d!==h||!("_value"in e))&&(e.value=h),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const d=typeof e[t];d==="boolean"?n=Yu(n):n==null&&d==="string"?(n="",c=!0):d==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(o||t)}function $r(e,t,n,s){e.addEventListener(t,n,s)}function ph(e,t,n,s){e.removeEventListener(t,n,s)}const Pu=Symbol("_vei");function hh(e,t,n,s,o=null){const a=e[Pu]||(e[Pu]={}),c=a[t];if(s&&c)c.value=s;else{const[d,h]=yh(t);if(s){const y=a[t]=wh(s,o);$r(e,d,y,h)}else c&&(ph(e,d,c,h),a[t]=void 0)}}const vh=/(Once|Passive|Capture)$/,mh=/^on:?(?:Once|Passive|Capture)$/;function yh(e){let t,n;for(;(n=e.match(vh))&&!mh.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):ur(e.slice(2)),t]}let fa=0;const gh=Promise.resolve(),bh=()=>fa||(gh.then(()=>fa=0),fa=Date.now());function wh(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 c=o.slice(),d=[s];for(let h=0;h<c.length&&!s._stopped;h++){const y=c[h];y&&fn(y,t,5,d)}}else fn(o,t,5,[s])};return n.value=e,n.attached=bh(),n}const Au=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,_h=(e,t,n,s,o,a)=>{const c=o==="svg";t==="class"?ah(e,s,c):t==="style"?ch(e,n,s):oi(t)?ii(t)||hh(e,t,n,s,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):kh(e,t,s,c))?(Tu(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&$u(e,t,s,c,a,t!=="value")):e._isVueCE&&(xh(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bt(s)))?Tu(e,hn(t),s,a,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),$u(e,t,s,c))};function kh(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Au(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 Au(t)&&bt(n)?!1:t in e}function xh(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 of=new WeakMap,af=new WeakMap,Wo=Symbol("_moveCb"),Ou=Symbol("_enterCb"),Aa=new WeakMap,Ch=e=>(delete e.props.mode,e),Sh=Ch({name:"TransitionGroup",props:Et({},tf,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=il(),s=xc();let o,a,c,d;const h=()=>(d===void 0&&(d=o.length>0&&Ih(o[0].el,n.vnode.el,Mu(e))),d);return Pc(()=>{if(Aa.delete(n),!h()){o=[],c=void 0;return}const y=Mu(e);o.forEach($h);const m=c&&Mh(c,n.vnode.el);c=void 0,o.forEach(C=>Th(C,m));const w=o.filter(Ph);Pa(n.vnode.el),w.forEach(C=>{const O=C.el,N=O.style;wn(O,y),N.transform=N.webkitTransform=N.transitionDuration="";const ee=O[Wo]=te=>{te&&te.target!==O||(!te||te.propertyName.endsWith("transform"))&&(O.removeEventListener("transitionend",ee),O[Wo]=null,Qn(O,y))};O.addEventListener("transitionend",ee)}),o=[]}),()=>{const y=ot(e),m=nf(y);let w=y.tag||Re;if(o=[],d=void 0,a)for(let C=0;C<a.length;C++){const O=a[C];O.el&&O.el instanceof Element&&!O.el[sf]&&(o.push(O),ir(O,Is(O,m,s,n)),of.set(O,gi(O.el)))}a=t.default?nl(t.default()):[];for(let C=0;C<a.length;C++){const O=a[C];O.key!=null&&ir(O,Is(O,m,s,n))}return o.length&&(c=Ah(n),Aa.set(n,h)),Oe(w,null,a)}}}),Eh=Sh;function $h(e){const t=e.el;t[Wo]&&t[Wo](),t[Ou]&&t[Ou]()}function Mu(e){return e.moveClass||`${e.name||"v"}-move`}function Th(e,t){af.set(e,gi(e.el,t))}function Ph(e){const t=of.get(e),n=af.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const a=e.el,c=a.style,d=a.getBoundingClientRect();let h=1,y=1;return a.offsetWidth&&(h=d.width/a.offsetWidth),a.offsetHeight&&(y=d.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),c.transform=c.webkitTransform=`translate(${s/h}px,${o/y}px)`,c.transitionDuration="0s",e}}function gi(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function Ah(e){let t;for(let n=e.parent;n;n=n.parent){const s=Aa.get(n);if(s){const o=Oh(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push(Et(gi(o),{item:o,willMove:s}))}}return t}function Oh(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 Mh(e,t){const n=e.find(s=>s.willMove()&&s.item.contains(t));return n&&gi(n.item,n)}function Ih(e,t,n){const s=e.cloneNode(),o=e[Zr];o&&o.forEach(d=>{d.split(/\s+/).forEach(h=>h&&s.classList.remove(h))}),n.split(/\s+/).forEach(d=>d&&s.classList.add(d)),s.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(s);const{hasTransform:c}=rf(s);return a.removeChild(s),c}const zo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ke(t)?n=>$o(t,n):t};function jh(e){e.target.composing=!0}function Iu(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Pr=Symbol("_assign"),So=Symbol("_initialValue");function da(e,t,n){return t&&(e=e.trim()),n&&(e=li(e)),e}const Le={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[So]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[So]=e.defaultValue.replace(/\r\n?/g,`
`))),e[Pr]=zo(o);const a=s||o.props&&o.props.type==="number";$r(e,t?"change":"input",c=>{c.target.composing||e[Pr](da(e.value,n,a))}),(n||a)&&$r(e,"change",()=>{e.value=da(e.value,n,a)}),t||($r(e,"compositionstart",jh),$r(e,"compositionend",Iu),$r(e,"change",Iu))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",a=e[So];delete e[So],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[Pr](da(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:a}},c){if(e[Pr]=zo(c),e.composing)return;const d=(a||e.type==="number")&&!/^0\d/.test(e.value)?li(e.value):e.value,h=t??"";if(d===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)}},Fn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,$r(e,"change",()=>{const o=Array.prototype.filter.call(e.options,h=>h.selected).map(h=>n?li(Go(h)):Go(h)),a=e.multiple,c=a?Mr(e._modelValue)?new Set(o):o:o[0],d=e._pendingValue=[a,a?Ke(c)?o.slice():o:c];try{e[Pr](c)}finally{rs(()=>{e._pendingValue===d&&(e._pendingValue=void 0)})}}),e[Pr]=zo(s)},mounted(e,{value:t}){ju(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Pr]=zo(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Dh(t,n[1],n[0]))&&ju(e,t)}};function Dh(e,t,n){if(!n||Ke(e))return sr(e,t);if(Mr(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function ju(e,t){const n=e.multiple,s=Ke(t);if(!(n&&!s&&!Mr(t))){for(let o=0,a=e.options.length;o<a;o++){const c=e.options[o],d=Go(c);if(n)if(s){const h=typeof d;h==="string"||h==="number"?c.selected=t.some(y=>String(y)===String(d)):c.selected=gd(t,d)>-1}else c.selected=t.has(d);else if(sr(Go(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Go(e){return"_value"in e?e._value:e.value}const Lh=["ctrl","shift","alt","meta"],Rh={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)=>Lh.some(n=>e[`${n}Key`]&&!t.includes(n))},Ir=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(o,...a)=>{for(let c=0;c<t.length;c++){const d=Rh[t[c]];if(d&&d(o,t))return}return e(o,...a)})},Kh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Dt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=o=>{if(!("key"in o))return;const a=ur(o.key);if(t.some(c=>c===a||Kh[c]===a))return e(o)})},Fh=Et({patchProp:_h},rh);let Du;function Nh(){return Du||(Du=Lp(Fh))}const Vh=(...e)=>{const t=Nh().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Uh(s);if(!o)return;const a=t._component;!Ge(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,Bh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function Bh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Uh(e){return bt(e)?document.querySelector(e):e}function Tt(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 qh={calendar:Tt('<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:Tt('<circle cx="12" cy="12" r="8.25"/><path d="M12 7.75V12l2.75 1.75"/>'),"check-circle":Tt('<circle cx="12" cy="12" r="8.25"/><path d="M8.5 12.4l2.4 2.4 4.6-5.2"/>'),edit:Tt('<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:Tt('<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:Tt('<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:Tt('<path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/>'),flag:Tt('<path d="M6.5 21V4"/><path d="M6.5 4.5h10.8l-2.6 3.7 2.6 3.7H6.5"/>'),chart:Tt('<path d="M4.5 19.5h15"/><path d="M7.5 19.5V12M12 19.5V6.5M16.5 19.5V9.5"/>'),export:Tt('<path d="M12 4.5V14M8.25 10.25L12 14l3.75-3.75"/><path d="M5 19.5h14"/>'),"chevron-left":Tt('<path d="M14.5 6l-6 6 6 6"/>'),"chevron-right":Tt('<path d="M9.5 6l6 6-6 6"/>'),"chevron-down":Tt('<path d="M6 9.5l6 6 6-6"/>'),plus:Tt('<path d="M12 5.5v13M5.5 12h13"/>'),search:Tt('<circle cx="11" cy="11" r="6.5"/><path d="M15.8 15.8L20 20"/>'),settings:Tt('<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:Tt('<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:Tt('<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:Tt('<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"/>')},Hh=["innerHTML"],ut=Bt({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=at(()=>qh[t.name]||"");return(s,o)=>(K(),H("span",{class:"icon",style:nr({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,Hh))}}),Wh=["aria-label"],zh={class:"dialog-title"},Gh={class:"dialog-msg"},Yh={class:"dialog-btns"},Jh=Bt({__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 vt(()=>n.open,a=>{a?window.addEventListener("keydown",o):window.removeEventListener("keydown",o)}),fr(()=>window.removeEventListener("keydown",o)),(a,c)=>(K(),It(Us,{to:"body"},[Oe(ss,{name:"modal"},{default:cr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:c[2]||(c[2]=Ir(d=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",zh,se(e.title),1),u("div",Gh,se(e.message),1),u("div",Yh,[u("button",{class:"btn btn-sm",onClick:c[0]||(c[0]=d=>s("cancel"))},se(e.cancelText),1),u("button",{class:tt(["btn btn-sm",e.danger?"btn-danger-solid":"btn-primary"]),onClick:c[1]||(c[1]=d=>s("confirm"))},se(e.confirmText),3)])],8,Wh)])):Ee("",!0)]),_:1})]))}}),Yt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},lr=Yt(Jh,[["__scopeId","data-v-f27041d4"]]);var Lu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lf={exports:{}};(function(e,t){((n,s)=>{e.exports=s()})(Lu,function(){var n=function(r,i){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(l,f){l.__proto__=f}:function(l,f){for(var p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}))(r,i)},s=function(){return(s=Object.assign||function(r){for(var i,l=1,f=arguments.length;l<f;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 f,p=0,v=i.length;p<v;p++)!f&&p in i||((f=f||Array.prototype.slice.call(i,0,p))[p]=i[p]);return r.concat(f||Array.prototype.slice.call(i))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Lu,c=Object.keys,d=Array.isArray;function h(r,i){return typeof i=="object"&&c(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"?c:Reflect.ownKeys)(i).forEach(function(l){N(r,l,i[l])})}var O=Object.defineProperty;function N(r,i,l,f){O(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},f))}function ee(r){return{from:function(i){return r.prototype=Object.create(i.prototype),N(r.prototype,"constructor",r),{extend:C.bind(null,r.prototype)}}}}var te=Object.getOwnPropertyDescriptor,ue=[].slice;function P(r,i,l){return ue.call(r,i,l)}function L(r,i){return i(r)}function J(r){if(!r)throw new Error("Assertion Failed")}function ce(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=[],f=0,p=i.length;f<p;++f){var v=ie(r,i[f]);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 Q(r,i,l){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){J(typeof l!="string"&&"length"in l);for(var f=0,p=i.length;f<p;++f)Q(r,i[f],l[f])}else{var v=i.indexOf(".");if(v!==-1){var g=i.substr(0,v),v=i.substr(v+1);if(v==="")l===void 0?d(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]={}}Q(b,v,l)}}else l===void 0?d(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=l}}function A(r){var i,l={};for(i in r)w(r,i)&&(l[i]=r[i]);return l}var S=[].concat;function oe(r){return S.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(oe([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return a[r]}),ge=new Set(Ce.map(function(r){return a[r]})),Y=null;function xe(r){return Y=new WeakMap,r=function i(l){if(!l||typeof l!="object")return l;var f=Y.get(l);if(f)return f;if(d(l)){f=[],Y.set(l,f);for(var p=0,v=l.length;p<v;++p)f.push(i(l[p]))}else if(ge.has(l.constructor))f=l;else{var g,b=y(l);for(g in f=b===Object.prototype?{}:Object.create(b),Y.set(l,f),l)w(l,g)&&(f[g]=i(l[g]))}return f}(r),Y=null,r}var Fe={}.toString;function rt(r){return Fe.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 Ne(r){var i,l,f,p;if(arguments.length===1){if(d(r))return r.slice();if(this===Me&&typeof r=="string")return[r];if(p=Ye(r))for(l=[];!(f=p.next()).done;)l.push(f.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),X={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 ke(r,i){return r+". Errors: "+Object.keys(i).map(function(l){return i[l].toString()}).filter(function(l,f,p){return p.indexOf(l)===f}).join(`
`)}function Be(r,i,l,f){this.failures=i,this.failedKeys=f,this.successCount=l,this.message=ke(r,i)}function dt(r,i){this.name="BulkError",this.failures=Object.keys(i).map(function(l){return i[l]}),this.failuresByPos=i,this.message=ke(r,this.failures)}ee(Z).from(Error).extend({toString:function(){return this.name+": "+this.message}}),ee(Be).from(Z),ee(dt).from(Z);var Jt=Xe.reduce(function(r,i){return r[i]=i+"Error",r},{}),Xt=Z,je=Xe.reduce(function(r,i){var l=i+"Error";function f(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=X[i]||l,this.inner=null)}return ee(f).from(Xt),r[i]=f,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 z(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 le(r,i){return r===_?i:function(){var l=r.apply(this,arguments),f=(l!==void 0&&(arguments[0]=l),this.onsuccess),p=this.onerror,v=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?ne(f,this.onsuccess):f),p&&(this.onerror=this.onerror?ne(p,this.onerror):p),v!==void 0?v:l}}function be(r,i){return r===_?i:function(){r.apply(this,arguments);var l=this.onsuccess,f=this.onerror;this.onsuccess=this.onerror=null,i.apply(this,arguments),l&&(this.onsuccess=this.onsuccess?ne(l,this.onsuccess):l),f&&(this.onerror=this.onerror?ne(f,this.onerror):f)}}function ve(r,i){return r===_?i:function(){var l=r.apply(this,arguments),f=(h(arguments[0],l),this.onsuccess),p=this.onerror,v=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?ne(f,this.onsuccess):f),p&&(this.onerror=this.onerror?ne(p,this.onerror):p),l===void 0?v===void 0?void 0:v:h(l,v)}}function ae(r,i){return r===_?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function U(r,i){return r===_?i:function(){var l=r.apply(this,arguments);if(l&&typeof l.then=="function"){for(var f=this,p=arguments.length,v=new Array(p);p--;)v[p]=arguments[p];return l.then(function(){return i.apply(f,v)})}return i.apply(this,arguments)}}Ce.ModifyError=Be,Ce.DexieError=Z,Ce.BulkError=dt;var q=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function G(r){q=r}var $e={},Ve=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],Ur=Qe[1],Ur=Ur&&Ur.then,Ze=Xe&&Xe.constructor,mt=!!Qe[2],kt=function(r,i){Un.push([r,i]),Ut&&(queueMicrotask(Df),Ut=!1)},Qt=!0,Ut=!0,en=[],pr=[],Ot=x,$t={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:_,pgp:!1,env:{},finalize:_},Ie=$t,Un=[],hr=0,Gs=[];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!==$e)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Ci(this,this._value)}else this._state=null,this._value=null,++i.ref,function l(f,p){try{p(function(v){if(f._state===null){if(v===f)throw new TypeError("A promise cannot be resolved with itself.");var g=f._lib&&Rr();v&&typeof v.then=="function"?l(f,function(b,$){v instanceof Se?v._then(b,$):v.then(b,$)}):(f._state=!0,f._value=v,gl(f)),g&&Kr()}},Ci.bind(null,f))}catch(v){Ci(f,v)}}(this,r)}var xi={get:function(){var r=Ie,i=Qs;function l(f,p){var v=this,g=!r.global&&(r!==Ie||i!==Qs),b=g&&!Hn(),$=new Se(function(V,M){Si(v,new yl(wl(f,r,g,b),wl(p,r,g,b),V,M,r))});return this._consoleTask&&($._consoleTask=this._consoleTask),$}return l.prototype=$e,l},set:function(r){N(this,"then",r&&r.prototype===$e?xi:{get:function(){return r},set:xi.set})}};function yl(r,i,l,f,p){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof i=="function"?i:null,this.resolve=l,this.reject=f,this.psd=p}function Ci(r,i){var l,f;pr.push(i),r._state===null&&(l=r._lib&&Rr(),i=Ot(i),r._state=!1,r._value=i,f=r,en.some(function(p){return p._value===f._value})||en.push(f),gl(r),l)&&Kr()}function gl(r){var i=r._listeners;r._listeners=[];for(var l=0,f=i.length;l<f;++l)Si(r,i[l]);var p=r._PSD;--p.ref||p.finalize(),hr===0&&(++hr,kt(function(){--hr==0&&Ei()},[]))}function Si(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,++hr,kt(jf,[l,r,i])}}function jf(r,i,l){try{var f,p=i._value;!i._state&&pr.length&&(pr=[]),f=q&&i._consoleTask?i._consoleTask.run(function(){return r(p)}):r(p),i._state||pr.indexOf(p)!==-1||(v=>{for(var g=en.length;g;)if(en[--g]._value===v._value)return en.splice(g,1)})(i),l.resolve(f)}catch(v){l.reject(v)}finally{--hr==0&&Ei(),--l.psd.ref||l.psd.finalize()}}function Df(){vr($t,function(){Rr()&&Kr()})}function Rr(){var r=Qt;return Ut=Qt=!1,r}function Kr(){var r,i,l;do for(;0<Un.length;)for(r=Un,Un=[],l=r.length,i=0;i<l;++i){var f=r[i];f[0].apply(null,f[1])}while(0<Un.length);Ut=Qt=!0}function Ei(){for(var r=en,i=(en=[],r.forEach(function(f){f._PSD.onunhandled.call(null,f._value,f)}),Gs.slice(0)),l=i.length;l;)i[--l]()}function Ys(r){return new Se($e,!1,r)}function yt(r,i){var l=Ie;return function(){var f=Rr(),p=Ie;try{return Wn(l,!0),r.apply(this,arguments)}catch(v){i&&i(v)}finally{Wn(p,!1),f&&Kr()}}}C(Se.prototype,{then:xi,_then:function(r,i){Si(this,new yl(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(f){return(f instanceof i?l:Ys)(f)}):this.then(null,function(f){return(f&&f.name===i?l:Ys)(f)}))},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 Ys(i)})})},timeout:function(r,i){var l=this;return r<1/0?new Se(function(f,p){var v=setTimeout(function(){return p(new je.Timeout(i))},r);l.then(f,p).finally(clearTimeout.bind(null,v))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&N(Se.prototype,Symbol.toStringTag,"Dexie.Promise"),$t.env=bl(),C(Se,{all:function(){var r=Ne.apply(null,arguments).map(Zs);return new Se(function(i,l){r.length===0&&i([]);var f=r.length;r.forEach(function(p,v){return Se.resolve(p).then(function(g){r[v]=g,--f||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($e,!0,r)},reject:Ys,race:function(){var r=Ne.apply(null,arguments).map(Zs);return new Se(function(i,l){r.map(function(f){return Se.resolve(f).then(i,l)})})},PSD:{get:function(){return Ie},set:function(r){return Ie=r}},totalEchoes:{get:function(){return Qs}},newPSD:qn,usePSD:vr,scheduler:{get:function(){return kt},set:function(r){kt=r}},rejectionMapper:{get:function(){return Ot},set:function(r){Ot=r}},follow:function(r,i){return new Se(function(l,f){return qn(function(p,v){var g=Ie;g.unhandleds=[],g.onunhandled=v,g.finalize=ne(function(){var b,$=this;b=function(){$.unhandleds.length===0?p():v($.unhandleds[0])},Gs.push(function V(){b(),Gs.splice(Gs.indexOf(V),1)}),++hr,kt(function(){--hr==0&&Ei()},[])},g.finalize),r()},i,l,f)})}}),Ze&&(Ze.allSettled&&N(Se,"allSettled",function(){var r=Ne.apply(null,arguments).map(Zs);return new Se(function(i){r.length===0&&i([]);var l=r.length,f=new Array(l);r.forEach(function(p,v){return Se.resolve(p).then(function(g){return f[v]={status:"fulfilled",value:g}},function(g){return f[v]={status:"rejected",reason:g}}).then(function(){return--l||i(f)})})})}),Ze.any&&typeof AggregateError<"u"&&N(Se,"any",function(){var r=Ne.apply(null,arguments).map(Zs);return new Se(function(i,l){r.length===0&&l(new AggregateError([]));var f=r.length,p=new Array(f);r.forEach(function(v,g){return Se.resolve(v).then(function(b){return i(b)},function(b){p[g]=b,--f||l(new AggregateError(p))})})})}),Ze.withResolvers)&&(Se.withResolvers=Ze.withResolvers);var Pt={awaits:0,echoes:0,id:0},Lf=0,Js=[],Xs=0,Qs=0,Rf=0;function qn(r,g,l,f){var p=Ie,v=Object.create(p),g=(v.parent=p,v.ref=0,v.global=!1,v.id=++Rf,$t.env,v.env=mt?{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()},vr(v,r,l,f));return v.ref===0&&v.finalize(),g}function Fr(){return Pt.id||(Pt.id=++Lf),++Pt.awaits,Pt.echoes+=Ve,Pt.id}function Hn(){return!!Pt.awaits&&(--Pt.awaits==0&&(Pt.id=0),Pt.echoes=Pt.awaits*Ve,!0)}function Zs(r){return Pt.echoes&&r&&r.constructor===Ze?(Fr(),r.then(function(i){return Hn(),i},function(i){return Hn(),Ct(i)})):r}function Kf(){var r=Js[Js.length-1];Js.pop(),Wn(r,!1)}function Wn(r,i){var l,f,p=Ie;(i?!Pt.echoes||Xs++&&r===Ie:!Xs||--Xs&&r===Ie)||queueMicrotask(i?(function(v){++Qs,Pt.echoes&&--Pt.echoes!=0||(Pt.echoes=Pt.awaits=Pt.id=0),Js.push(Ie),Wn(v,!0)}).bind(null,r):Kf),r!==Ie&&(Ie=r,p===$t&&($t.env=bl()),mt)&&(l=$t.env.Promise,f=r.env,p.global||r.global)&&(Object.defineProperty(a,"Promise",f.PromiseProp),l.all=f.all,l.race=f.race,l.resolve=f.resolve,l.reject=f.reject,f.allSettled&&(l.allSettled=f.allSettled),f.any)&&(l.any=f.any)}function bl(){var r=a.Promise;return mt?{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 vr(r,i,l,f,p){var v=Ie;try{return Wn(r,!0),i(l,f,p)}finally{Wn(v,!1)}}function wl(r,i,l,f){return typeof r!="function"?r:function(){var p=Ie;l&&Fr(),Wn(i,!0);try{return r.apply(this,arguments)}finally{Wn(p,!1),f&&queueMicrotask(Hn)}}}function $i(r){Promise===Ze&&Pt.echoes===0?Xs===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+Ur).indexOf("[native code]")===-1&&(Fr=Hn=_);var Ct=Se.reject,mr="￿",On="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",_l="String expected.",eo="__dbnames",Ti="readonly",Pi="readwrite";function yr(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var kl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function to(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 xl(){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=Cl(r),f=Cl(i);if(l!==f)return l==="Array"?1:f==="Array"?-1:l==="binary"?1:f==="binary"?-1:l==="string"?1:f==="string"?-1:l==="Date"?1:f!=="Date"?NaN:-1;switch(l){case"number":case"Date":case"string":return i<r?1:r<i?-1:0;case"binary":for(var p=Sl(r),v=Sl(i),g=p.length,b=v.length,$=g<b?g:b,V=0;V<$;++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 M=r,E=i,T=M.length,R=E.length,j=T<R?T:R,I=0;I<j;++I){var D=nt(M[I],E[I]);if(D!==0)return D}return T===R?0:T<R?-1:1}}catch{}return NaN}function Cl(r){var i=typeof r;return i=="object"&&(ArrayBuffer.isView(r)||(i=rt(r))==="ArrayBuffer")?"binary":i}function Sl(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}function no(r,i,l){var f=r.schema.yProps;return f?(i&&0<l.numFailures&&(i=i.filter(function(p,v){return!l.failures[v]})),Promise.all(f.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}El.prototype.execute=function(r){var i=this["@@propmod"];if(i.add!==void 0){var l=i.add;if(d(l))return o(o([],d(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 f=i.remove;if(d(f))return d(r)?r.filter(function(p){return!f.includes(p)}).sort():[];if(typeof f=="number")return Number(r)-f;if(typeof f=="bigint")try{return BigInt(r)-f}catch{return BigInt(0)-f}throw new TypeError("Invalid subtrahend ".concat(f))}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 is=El;function El(r){this["@@propmod"]=r}function $l(r,i){for(var l=c(i),f=l.length,p=!1,v=0;v<f;++v){var g=l[v],b=i[g],$=ie(r,g);b instanceof is?(Q(r,g,b.execute($)),p=!0):$!==b&&(Q(r,g,b),p=!0)}return p}pt.prototype._trans=function(r,i,l){var f=this._tx||Ie.trans,p=this.name,v=q&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function g(V,M,E){if(E.schema[p])return i(E.idbtrans,E);throw new je.NotFound("Table "+p+" not part of transaction")}var b=Rr();try{var $=f&&f.db._novip===this.db._novip?f===Ie.trans?f._promise(r,g,l):qn(function(){return f._promise(r,g,l)},{trans:f,transless:Ie.transless||Ie}):function V(M,E,T,R){if(M.idbdb&&(M._state.openComplete||Ie.letThrough||M._vip)){var j=M._createTransaction(E,T,M._dbSchema);try{j.create(),M._state.PR1398_maxLoop=3}catch(I){return I.name===Jt.InvalidState&&M.isOpen()&&0<--M._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),M.close({disableAutoOpen:!1}),M.open().then(function(){return V(M,E,T,R)})):Ct(I)}return j._promise(E,function(I,D){return qn(function(){return Ie.trans=j,R(I,D,j)})}).then(function(I){if(E==="readwrite")try{j.idbtrans.commit()}catch{}return E==="readonly"?I:j._completion.then(function(){return I})})}if(M._state.openComplete)return Ct(new je.DatabaseClosed(M._state.dbOpenError));if(!M._state.isBeingOpened){if(!M._state.autoOpen)return Ct(new je.DatabaseClosed);M.open().catch(_)}return M._state.dbReadyPromise.then(function(){return V(M,E,T,R)})}(this.db,r,[this.name],g);return v&&($._consoleTask=v,$=$.catch(function(V){return console.trace(V),Ct(V)})),$}finally{b&&Kr()}},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(f){return l.core.get({trans:f,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(d(r))return new this.db.WhereClause(this,"[".concat(r.join("+"),"]"));var i=c(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 $=0;$<i.length;++$)if(i.indexOf(b.keyPath[$])===-1)return!1;return!0}return!1}).sort(function(b,$){return b.keyPath.length-$.keyPath.length})[0];if(l&&this.db._maxKey!==mr)return g=l.keyPath.slice(0,i.length),this.where(g).equals(g.map(function(b){return r[b]}));!l&&q&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(i.join("+"),"]"));var f=this.schema.idxByName;function p(b,$){return nt(b,$)===0}var g=i.reduce(function(M,$){var V=M[0],M=M[1],E=f[$],T=r[$];return[V||E,V||!E?yr(M,E&&E.multi?function(R){return R=ie(R,$),d(R)&&R.some(function(j){return p(T,j)})}:function(R){return p(T,ie(R,$))}):M]},[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,d(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,f=((this.schema.mappedClass=r).prototype instanceof xl&&(r=(g=>{var b=M,$=g;if(typeof $!="function"&&$!==null)throw new TypeError("Class extends value "+String($)+" is not a constructor or null");function V(){this.constructor=b}function M(){return g!==null&&g.apply(this,arguments)||this}return n(b,$),b.prototype=$===null?Object.create($):(V.prototype=$.prototype,new V),Object.defineProperty(M.prototype,"db",{get:function(){return i},enumerable:!1,configurable:!0}),M.prototype.table=function(){return l},M})(r)),new Set),p=r.prototype;p;p=y(p))Object.getOwnPropertyNames(p).forEach(function(g){return f.add(g)});function v(g){if(!g)return g;var b,$=Object.create(r.prototype);for(b in g)if(!f.has(b))try{$[b]=g[b]}catch{}return $}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,f=this.schema.primKey,p=f.auto,v=f.keyPath,g=r;return v&&p&&(g=to(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{Q(r,v,b)}catch{}return b})},pt.prototype.upsert=function(r,i){var l=this,f=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 $l(g,i),f&&Q(g,f,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"||d(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,f=this.schema.primKey,p=f.auto,v=f.keyPath,g=r;return v&&p&&(g=to(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{Q(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(f){return no(i,[r],f)}).then(function(f){return f.numFailures?Se.reject(f.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:kl}).then(function(l){return no(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(f){return f.map(function(p){return i.hook.reading.fire(p)})})})},pt.prototype.bulkAdd=function(r,i,l){var f=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=f.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 $=r.length,V=b&&V?r.map(to(b)):r;return f.core.mutate({trans:g,type:"add",keys:p,values:V,wantResults:v}).then(function(M){var E=M.numFailures,T=M.failures;if(E===0)return v?M.results:M.lastResult;throw new dt("".concat(f.name,".bulkAdd(): ").concat(E," of ").concat($," operations failed"),T)})})},pt.prototype.bulkPut=function(r,i,l){var f=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=f.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 $=r.length,V=b&&V?r.map(to(b)):r;return f.core.mutate({trans:g,type:"put",keys:p,values:V,wantResults:v}).then(function(M){var E=M.numFailures,T=M.failures;if(E===0)return v?M.results:M.lastResult;throw new dt("".concat(f.name,".bulkPut(): ").concat(E," of ").concat($," operations failed"),T)})})},pt.prototype.bulkUpdate=function(r){var i=this,l=this.core,f=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:f,cache:"clone"}).then(function(b){var $=[],V=[],M=(r.forEach(function(E,T){var R=E.key,j=E.changes,I=b[T];if(I){for(var D=0,W=Object.keys(j);D<W.length;D++){var B=W[D],re=j[B];if(B===i.schema.primKey.keyPath){if(nt(re,R)!==0)throw new je.Constraint("Cannot update primary key in bulkUpdate()")}else Q(I,B,re)}v.push(T),$.push(R),V.push(I)}}),$.length);return l.mutate({trans:g,type:"put",keys:$,values:V,updates:{keys:f,changeSpecs:p}}).then(function(E){var T=E.numFailures,R=E.failures;if(T===0)return M;for(var j=0,I=Object.keys(R);j<I.length;j++){var D,W=I[j],B=v[Number(W)];B!=null&&(D=R[W],delete R[W],R[B]=D)}throw new dt("".concat(i.name,".bulkUpdate(): ").concat(T," of ").concat(M," operations failed"),R)})})})},pt.prototype.bulkDelete=function(r){var i=this,l=r.length;return this._trans("readwrite",function(f){return i.core.mutate({trans:f,type:"delete",keys:r}).then(function(p){return no(i,r,p)})}).then(function(f){var p=f.numFailures,v=f.failures;if(p===0)return f.lastResult;throw new dt("".concat(i.name,".bulkDelete(): ").concat(p," of ").concat(l," operations failed"),v)})};var Tl=pt;function pt(){}function as(r){function i(g,b){if(b){for(var $=arguments.length,V=new Array($-1);--$;)V[$-1]=arguments[$];return l[g].subscribe.apply(null,V),r}if(typeof g=="string")return l[g]}var l={};i.addEventType=v;for(var f=1,p=arguments.length;f<p;++f)v(arguments[f]);return i;function v(g,b,$){var V,M;if(typeof g!="object")return b=b||ae,M={subscribers:[],fire:$=$||_,subscribe:function(E){M.subscribers.indexOf(E)===-1&&(M.subscribers.push(E),M.fire=b(M.fire,E))},unsubscribe:function(E){M.subscribers=M.subscribers.filter(function(T){return T!==E}),M.fire=M.subscribers.reduce(b,$)}},l[g]=i[g]=M;c(V=g).forEach(function(E){var T=V[E];if(d(T))v(E,V[E][0],V[E][1]);else{if(T!=="asap")throw new je.InvalidArgument("Invalid event config");var R=v(E,x,function(){for(var j=arguments.length,I=new Array(j);j--;)I[j]=arguments[j];R.subscribers.forEach(function(D){ce(function(){D.apply(null,I)})})})}})}}function ls(r,i){return ee(i).from({prototype:r}),i}function Nr(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function Ai(r,i){r.filter=yr(r.filter,i)}function Oi(r,i,l){var f=r.replayFilter;r.replayFilter=f?function(){return yr(f(),i())}:i,r.justLimit=l&&!f}function ro(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 Pl(r,i,l){var f=ro(r,i.schema);return i.openCursor({trans:l,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:f,range:r.range}})}function so(r,i,l,f){var p,v,g=r.replayFilter?yr(r.filter,r.replayFilter()):r.filter;return r.or?(p={},v=function(b,$,V){var M,E;g&&!g($,V,function(T){return $.stop(T)},function(T){return $.fail(T)})||((E=""+(M=$.primaryKey))=="[object ArrayBuffer]"&&(E=""+new Uint8Array(M)),w(p,E))||(p[E]=!0,i(b,$,V))},Promise.all([r.or._iterate(v,l),Al(Pl(r,f,l),r.algorithm,v,!r.keysOnly&&r.valueMapper)])):Al(Pl(r,f,l),yr(r.algorithm,g),i,!r.keysOnly&&r.valueMapper)}function Al(r,i,l,f){var p=yt(f?function(v,g,b){return l(f(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=yr(i.algorithm,r)},st.prototype._iterate=function(r,i){return so(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 so(i,r,l,i.table.core)})},st.prototype.count=function(r){var i=this;return this._read(function(l){var f,p=i._ctx,v=p.table.core;return Nr(p,!0)?v.count({trans:l,query:{index:ro(p,v.schema),range:p.range}}).then(function(g){return Math.min(g,p.limit)}):(f=0,so(p,function(){return++f,!1},l,v).then(function(){return f}))}).then(r)},st.prototype.sortBy=function(r,i){var l=r.split(".").reverse(),f=l[0],p=l.length-1;function v($,V){return V?v($[l[V]],V-1):$[f]}var g=this._ctx.dir==="next"?1:-1;function b($,V){return nt(v($,p),v(V,p))*g}return this.toArray(function($){return $.slice().sort(b)}).then(i)},st.prototype.toArray=function(r){var i=this;return this._read(function(l){var f,p,v,g=i._ctx;return Nr(g,!0)&&0<g.limit?(f=g.valueMapper,p=ro(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,f?b.map(f):b})):(v=[],so(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,Nr(i)?Oi(i,function(){var l=r;return function(f,p){return l===0||(l===1?--l:p(function(){f.advance(l),l=0}),!1)}}):Oi(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),Oi(this._ctx,function(){var i=r;return function(l,f,p){return--i<=0&&f(p),0<=i}},!0),this},st.prototype.until=function(r,i){return Ai(this._ctx,function(l,f,p){return!r(l.value)||(f(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 Ai(this._ctx,function(l){return r(l.value)}),(i=this._ctx).isMatch=yr(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,f){r(f.key,f)})},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,f){r(f.primaryKey,f)})},st.prototype.keys=function(r){var i=this._ctx,l=(i.keysOnly=!i.isMatch,[]);return this.each(function(f,p){l.push(p.key)}).then(function(){return l}).then(r)},st.prototype.primaryKeys=function(r){var i=this._ctx;if(Nr(i,!0)&&0<i.limit)return this._read(function(f){var p=ro(i,i.table.core.schema);return i.table.core.query({trans:f,values:!1,limit:i.limit,direction:i.dir==="prev"?"prev":void 0,query:{index:p,range:i.range}})}).then(function(f){return f.result}).then(r);i.keysOnly=!i.isMatch;var l=[];return this.each(function(f,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={},Ai(this._ctx,function(f){var f=f.primaryKey.toString(),p=w(r,f);return r[f]=!0,!p})),this},st.prototype.modify=function(r){var i=this,l=this._ctx;return this._write(function(f){function p(I,D){var W=D.failures;T+=I-D.numFailures;for(var B=0,re=c(W);B<re.length;B++){var de=re[B];E.push(W[de])}}var v=typeof r=="function"?r:function(I){return $l(I,r)},g=l.table.core,M=g.schema.primaryKey,b=M.outbound,$=M.extractKey,V=200,M=i.db._options.modifyChunkSize,E=(M&&(V=typeof M=="object"?M[g.name]||M["*"]||200:M),[]),T=0,R=[],j=r===Ol;return i.clone().primaryKeys().then(function(I){function D(B){var re=Math.min(V,I.length-B),de=I.slice(B,B+re);return(j?Promise.resolve([]):g.getMany({trans:f,keys:de,cache:"immutable"})).then(function(he){var _e=[],ye=[],Pe=b?[]:null,we=j?de:[];if(!j)for(var Ae=0;Ae<re;++Ae){var pe=he[Ae],qe={value:xe(pe),primKey:I[B+Ae]};v.call(qe,qe.value,qe)!==!1&&(qe.value==null?we.push(I[B+Ae]):b||nt($(pe),$(qe.value))===0?(ye.push(qe.value),b&&Pe.push(I[B+Ae])):(we.push(I[B+Ae]),_e.push(qe.value)))}return Promise.resolve(0<_e.length&&g.mutate({trans:f,type:"add",values:_e}).then(function(He){for(var Je in He.failures)we.splice(parseInt(Je),1);p(_e.length,He)})).then(function(){return(0<ye.length||W&&typeof r=="object")&&g.mutate({trans:f,type:"put",keys:Pe,values:ye,criteria:W,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<B}).then(function(He){return p(ye.length,He)})}).then(function(){return(0<we.length||W&&j)&&g.mutate({trans:f,type:"delete",keys:we,criteria:W,isAdditionalChunk:0<B}).then(function(He){return no(l.table,we,He)}).then(function(He){return p(we.length,He)})}).then(function(){return I.length>B+re&&D(B+V)})})}var W=Nr(l)&&l.limit===1/0&&(typeof r!="function"||j)&&{index:l.index,range:l.range};return D(0).then(function(){if(0<E.length)throw new Be("Error modifying one or more objects",E,T,R);return I.length})})})},st.prototype.delete=function(){var r=this._ctx,i=r.range;return!Nr(r)||r.table.schema.yProps||!r.isPrimKey&&i.type!==3?this.modify(Ol):this._write(function(l){var f=r.table.core.schema.primaryKey,p=i;return r.table.core.count({trans:l,query:{index:f,range:p}}).then(function(v){return r.table.core.mutate({trans:l,type:"deleteRange",range:p}).then(function($){var b=$.failures,$=$.numFailures;if($)throw new Be("Could not delete some values",Object.keys(b).map(function(V){return b[V]}),v-$);return v-$})})})};var Ff=st;function st(){}var Ol=function(r,i){return i.value=null};function Nf(r,i){return r<i?-1:r===i?0:1}function Vf(r,i){return i<r?-1:r===i?0:1}function tn(r,i,l){return r=r instanceof Il?new r.Collection(r):r,r._ctx.error=new(l||TypeError)(i),r}function Vr(r){return new r.Collection(r,function(){return Ml("")}).limit(0)}function oo(R,i,l,f){var p,v,g,b,$,V,M,E=l.length;if(!l.every(function(I){return typeof I=="string"}))return tn(R,_l);function T(I){p=I==="next"?function(W){return W.toUpperCase()}:function(W){return W.toLowerCase()},v=I==="next"?function(W){return W.toLowerCase()}:function(W){return W.toUpperCase()},g=I==="next"?Nf:Vf;var D=l.map(function(W){return{lower:v(W),upper:p(W)}}).sort(function(W,B){return g(W.lower,B.lower)});b=D.map(function(W){return W.upper}),$=D.map(function(W){return W.lower}),M=(V=I)==="next"?"":f}T("next");var R=new R.Collection(R,function(){return zn(b[0],$[E-1]+f)}),j=(R._ondirectionchange=function(I){T(I)},0);return R._addAlgorithm(function(I,D,W){var B=I.key;if(typeof B=="string"){var re=v(B);if(i(re,$,j))return!0;for(var de=null,he=j;he<E;++he){var _e=((ye,Pe,we,Ae,pe,qe)=>{for(var He=Math.min(ye.length,Ae.length),Je=-1,et=0;et<He;++et){var nn=Pe[et];if(nn!==Ae[et])return pe(ye[et],we[et])<0?ye.substr(0,et)+we[et]+we.substr(et+1):pe(ye[et],Ae[et])<0?ye.substr(0,et)+Ae[et]+we.substr(et+1):0<=Je?ye.substr(0,Je)+Pe[Je]+we.substr(Je+1):null;pe(ye[et],nn)<0&&(Je=et)}return He<Ae.length&&qe==="next"?ye+we.substr(ye.length):He<ye.length&&qe==="prev"?ye.substr(0,we.length):Je<0?null:ye.substr(0,Je)+Ae[Je]+we.substr(Je+1)})(B,re,b[he],$[he],g,V);_e===null&&de===null?j=he+1:(de===null||0<g(de,_e))&&(de=_e)}D(de!==null?function(){I.continue(de+M)}:W)}return!1}),R}function zn(r,i,l,f){return{type:2,lower:r,upper:i,lowerOpen:l,upperOpen:f}}function Ml(r){return{type:1,lower:r,upper:r}}Object.defineProperty(At.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),At.prototype.between=function(r,i,l,f){l=l!==!1,f=f===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(l||f)&&(!l||!f)?Vr(this):new this.Collection(this,function(){return zn(r,i,!l,!f)})}catch{return tn(this,On)}},At.prototype.equals=function(r){return r==null?tn(this,On):new this.Collection(this,function(){return Ml(r)})},At.prototype.above=function(r){return r==null?tn(this,On):new this.Collection(this,function(){return zn(r,void 0,!0)})},At.prototype.aboveOrEqual=function(r){return r==null?tn(this,On):new this.Collection(this,function(){return zn(r,void 0,!1)})},At.prototype.below=function(r){return r==null?tn(this,On):new this.Collection(this,function(){return zn(void 0,r,!1,!0)})},At.prototype.belowOrEqual=function(r){return r==null?tn(this,On):new this.Collection(this,function(){return zn(void 0,r)})},At.prototype.startsWith=function(r){return typeof r!="string"?tn(this,_l):this.between(r,r+mr,!0,!0)},At.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):oo(this,function(i,l){return i.indexOf(l[0])===0},[r],mr)},At.prototype.equalsIgnoreCase=function(r){return oo(this,function(i,l){return i===l[0]},[r],"")},At.prototype.anyOfIgnoreCase=function(){var r=Ne.apply(Me,arguments);return r.length===0?Vr(this):oo(this,function(i,l){return l.indexOf(i)!==-1},r,"")},At.prototype.startsWithAnyOfIgnoreCase=function(){var r=Ne.apply(Me,arguments);return r.length===0?Vr(this):oo(this,function(i,l){return l.some(function(f){return i.indexOf(f)===0})},r,mr)},At.prototype.anyOf=function(){var r,i,l=this,f=Ne.apply(Me,arguments),p=this._cmp;try{f.sort(p)}catch{return tn(this,On)}return f.length===0?Vr(this):((r=new this.Collection(this,function(){return zn(f[0],f[f.length-1])}))._ondirectionchange=function(v){p=v==="next"?l._ascending:l._descending,f.sort(p)},i=0,r._addAlgorithm(function(v,g,b){for(var $=v.key;0<p($,f[i]);)if(++i===f.length)return g(b),!1;return p($,f[i])===0||(g(function(){v.continue(f[i])}),!1)}),r)},At.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},At.prototype.noneOf=function(){var r=Ne.apply(Me,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return tn(this,On)}var i=r.reduce(function(l,f){return l?l.concat([[l[l.length-1][1],f]]):[[-1/0,f]]},null);return i.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(i,{includeLowers:!1,includeUppers:!1})},At.prototype.inAnyRange=function(r,W){var l=this,f=this._cmp,p=this._ascending,v=this._descending,g=this._min,b=this._max;if(r.length===0)return Vr(this);if(!r.every(function(B){return B[0]!==void 0&&B[1]!==void 0&&p(B[0],B[1])<=0}))return tn(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 $=!W||W.includeLowers!==!1,V=W&&W.includeUppers===!0,M,E=p;function T(B,re){return E(B[0],re[0])}try{(M=r.reduce(function(B,re){for(var de=0,he=B.length;de<he;++de){var _e=B[de];if(f(re[0],_e[1])<0&&0<f(re[1],_e[0])){_e[0]=g(_e[0],re[0]),_e[1]=b(_e[1],re[1]);break}}return de===he&&B.push(re),B},[])).sort(T)}catch{return tn(this,On)}var R=0,j=V?function(B){return 0<p(B,M[R][1])}:function(B){return 0<=p(B,M[R][1])},I=$?function(B){return 0<v(B,M[R][0])}:function(B){return 0<=v(B,M[R][0])},D=j,W=new this.Collection(this,function(){return zn(M[0][0],M[M.length-1][1],!$,!V)});return W._ondirectionchange=function(B){E=B==="next"?(D=j,p):(D=I,v),M.sort(T)},W._addAlgorithm(function(B,re,de){for(var he,_e=B.key;D(_e);)if(++R===M.length)return re(de),!1;return!j(he=_e)&&!I(he)||(l._cmp(_e,M[R][1])===0||l._cmp(_e,M[R][0])===0||re(function(){E===p?B.continue(M[R][0]):B.continue(M[R][1])}),!1)}),W},At.prototype.startsWithAnyOf=function(){var r=Ne.apply(Me,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Vr(this):this.inAnyRange(r.map(function(i){return[i,i+mr]})):tn(this,"startsWithAnyOf() only works with strings")};var Il=At;function At(){}function dn(r){return yt(function(i){return us(i),r(i.target.error),!1})}function us(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var io="storagemutated",Mi="x-storagemutated-1",Gn=as(null,io),Bf=(gn.prototype._lock=function(){return J(!Ie.global),++this._reculock,this._reculock!==1||Ie.global||(Ie.lockOwnerFor=this),this},gn.prototype._unlock=function(){if(J(!Ie.global),--this._reculock==0)for(Ie.global||(Ie.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{vr(r[1],r[0])}catch{}}return this},gn.prototype._locked=function(){return this._reculock&&Ie.lockOwnerFor!==this},gn.prototype.create=function(r){var i=this;if(this.mode){var l=this.db.idbdb,f=this.db._state.dbOpenError;if(J(!this.idbtrans),!r&&!l)switch(f&&f.name){case"DatabaseClosedError":throw new je.DatabaseClosed(f);case"MissingAPIError":throw new je.MissingAPI(f.message,f);default:throw new je.OpenFailed(f)}if(!this.active)throw new je.TransactionInactive;J(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||l).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=yt(function(p){us(p),i._reject(r.error)}),r.onabort=yt(function(p){us(p),i.active&&i._reject(new je.Abort(r.error)),i.active=!1,i.on("abort").fire(p)}),r.oncomplete=yt(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&Gn.storagemutated.fire(r.mutatedParts)})}return this},gn.prototype._promise=function(r,i,l){var f,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?qn(function(){var v=new Se(function(g,b){p._lock();var $=i(g,b,p);$&&$.then&&$.then(g,b)});return v.finally(function(){return p._unlock()}),v._lib=!0,v}):((f=new Se(function(v,g){var b=i(v,g,p);b&&b.then&&b.then(v,g)}))._lib=!0,f):Ct(new je.TransactionInactive)},gn.prototype._root=function(){return this.parent?this.parent._root():this},gn.prototype.waitFor=function(r){var i,l=this._root(),f=Se.resolve(r),p=(l._waitingFor?l._waitingFor=l._waitingFor.then(function(){return f}):(l._waitingFor=f,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){f.then(function(b){return l._waitingQueue.push(yt(v.bind(null,b)))},function(b){return l._waitingQueue.push(yt(g.bind(null,b)))}).finally(function(){l._waitingFor===p&&(l._waitingFor=null)})})},gn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new je.Abort))},gn.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")},gn);function gn(){}function Ii(r,i,l,f,p,v,g,b){return{name:r,keyPath:i,unique:l,multi:f,auto:p,compound:v,src:(l&&!g?"&":"")+(f?"*":"")+(p?"++":"")+jl(i),type:b}}function jl(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function ji(r,i,l){return{name:r,primKey:i,indexes:l,mappedClass:null,idxByName:(f=function(p){return[p.name,p]},l.reduce(function(p,v,g){return v=f(v,g),v&&(p[v[0]]=v[1]),p},{}))};var f}var cs=function(r){try{return r.only([[]]),cs=function(){return[[]]},[[]]}catch{return cs=function(){return mr},mr}};function Di(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 Dl(r){return[].slice.call(r)}var Uf=0;function fs(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function qf(r,i,g){function f(D){if(D.type===3)return null;if(D.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var R=D.lower,j=D.upper,I=D.lowerOpen,D=D.upperOpen;return R===void 0?j===void 0?null:i.upperBound(j,!!D):j===void 0?i.lowerBound(R,!!I):i.bound(R,j,!!I,!!D)}function p(T){var R,j,I=T.name;return{name:I,schema:T,mutate:function(D){var W=D.trans,B=D.type,re=D.keys,de=D.values,he=D.range;return new Promise(function(_e,ye){_e=yt(_e);var Pe=W.objectStore(I),we=Pe.keyPath==null,Ae=B==="put"||B==="add";if(!Ae&&B!=="delete"&&B!=="deleteRange")throw new Error("Invalid operation type: "+B);var pe,qe=(re||de||{length:1}).length;if(re&&de&&re.length!==de.length)throw new Error("Given keys array must have same length as given values array.");if(qe===0)return _e({numFailures:0,failures:{},results:[],lastResult:void 0});function He(qt){++nn,us(qt)}var Je=[],et=[],nn=0;if(B==="deleteRange"){if(he.type===4)return _e({numFailures:nn,failures:et,results:[],lastResult:void 0});he.type===3?Je.push(pe=Pe.clear()):Je.push(pe=Pe.delete(f(he)))}else{var we=Ae?we?[de,re]:[de,null]:[re,null],ze=we[0],Rt=we[1];if(Ae)for(var Kt=0;Kt<qe;++Kt)Je.push(pe=Rt&&Rt[Kt]!==void 0?Pe[B](ze[Kt],Rt[Kt]):Pe[B](ze[Kt])),pe.onerror=He;else for(Kt=0;Kt<qe;++Kt)Je.push(pe=Pe[B](ze[Kt])),pe.onerror=He}function bo(qt){qt=qt.target.result,Je.forEach(function(wr,Zi){return wr.error!=null&&(et[Zi]=wr.error)}),_e({numFailures:nn,failures:et,results:B==="delete"?re:Je.map(function(wr){return wr.result}),lastResult:qt})}pe.onerror=function(qt){He(qt),bo(qt)},pe.onsuccess=bo})},getMany:function(D){var W=D.trans,B=D.keys;return new Promise(function(re,de){re=yt(re);for(var he,_e=W.objectStore(I),ye=B.length,Pe=new Array(ye),we=0,Ae=0,pe=function(Je){Je=Je.target,Pe[Je._pos]=Je.result,++Ae===we&&re(Pe)},qe=dn(de),He=0;He<ye;++He)B[He]!=null&&((he=_e.get(B[He]))._pos=He,he.onsuccess=pe,he.onerror=qe,++we);we===0&&re(Pe)})},get:function(D){var W=D.trans,B=D.key;return new Promise(function(re,de){re=yt(re);var he=W.objectStore(I).get(B);he.onsuccess=function(_e){return re(_e.target.result)},he.onerror=dn(de)})},query:(R=$,j=V,function(D){return new Promise(function(W,B){W=yt(W);var re,de,he,_e,qe=D.trans,ye=D.values,Pe=D.limit,pe=D.query,we=(we=D.direction)!=null?we:"next",Ae=Pe===1/0?void 0:Pe,He=pe.index,pe=pe.range,qe=qe.objectStore(I),qe=He.isPrimaryKey?qe:qe.index(He.name),He=f(pe);if(Pe===0)return W({result:[]});j?(pe={query:He,count:Ae,direction:we},(re=ye?qe.getAll(pe):qe.getAllKeys(pe)).onsuccess=function(Je){return W({result:Je.target.result})},re.onerror=dn(B)):R&&we==="next"?((re=ye?qe.getAll(He,Ae):qe.getAllKeys(He,Ae)).onsuccess=function(Je){return W({result:Je.target.result})},re.onerror=dn(B)):(de=0,he=!ye&&"openKeyCursor"in qe?qe.openKeyCursor(He,we):qe.openCursor(He,we),_e=[],he.onsuccess=function(){var Je=he.result;return!Je||(_e.push(ye?Je.value:Je.primaryKey),++de===Pe)?W({result:_e}):void Je.continue()},he.onerror=dn(B))})}),openCursor:function(D){var W=D.trans,B=D.values,re=D.query,de=D.reverse,he=D.unique;return new Promise(function(_e,ye){_e=yt(_e);var Ae=re.index,Pe=re.range,we=W.objectStore(I),we=Ae.isPrimaryKey?we:we.index(Ae.name),Ae=de?he?"prevunique":"prev":he?"nextunique":"next",pe=!B&&"openKeyCursor"in we?we.openKeyCursor(f(Pe),Ae):we.openCursor(f(Pe),Ae);pe.onerror=dn(ye),pe.onsuccess=yt(function(qe){var He,Je,et,nn,ze=pe.result;ze?(ze.___id=++Uf,ze.done=!1,He=ze.continue.bind(ze),Je=(Je=ze.continuePrimaryKey)&&Je.bind(ze),et=ze.advance.bind(ze),nn=function(){throw new Error("Cursor not stopped")},ze.trans=W,ze.stop=ze.continue=ze.continuePrimaryKey=ze.advance=function(){throw new Error("Cursor not started")},ze.fail=yt(ye),ze.next=function(){var Rt=this,Kt=1;return this.start(function(){return Kt--?Rt.continue():Rt.stop()}).then(function(){return Rt})},ze.start=function(Rt){function Kt(){if(pe.result)try{Rt()}catch(qt){ze.fail(qt)}else ze.done=!0,ze.start=function(){throw new Error("Cursor behind last entry")},ze.stop()}var bo=new Promise(function(qt,wr){qt=yt(qt),pe.onerror=dn(wr),ze.fail=wr,ze.stop=function(Zi){ze.stop=ze.continue=ze.continuePrimaryKey=ze.advance=nn,qt(Zi)}});return pe.onsuccess=yt(function(qt){pe.onsuccess=Kt,Kt()}),ze.continue=He,ze.continuePrimaryKey=Je,ze.advance=et,Kt(),bo},_e(ze)):_e(null)},ye)})},count:function(D){var W=D.query,B=D.trans,re=W.index,de=W.range;return new Promise(function(he,_e){var ye=B.objectStore(I),ye=re.isPrimaryKey?ye:ye.index(re.name),Pe=f(de),Pe=Pe?ye.count(Pe):ye.count();Pe.onsuccess=yt(function(we){return he(we.target.result)}),Pe.onerror=dn(_e)})}}}v=g,b=Dl((g=r).objectStoreNames),M=0<b.length?v.objectStore(b[0]):{};var v,g={schema:{name:g.name,tables:b.map(function(T){return v.objectStore(T)}).map(function(T){var R=T.keyPath,j=T.autoIncrement,D=d(R),I={},D={name:T.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:R==null,compound:D,keyPath:R,autoIncrement:j,unique:!0,extractKey:Di(R)},indexes:Dl(T.indexNames).map(function(W){return T.index(W)}).map(function(de){var he=de.name,B=de.unique,re=de.multiEntry,de=de.keyPath,he={name:he,compound:d(de),keyPath:de,unique:B,multiEntry:re,extractKey:Di(de)};return I[fs(de)]=he}),getIndexByKeyPath:function(W){return I[fs(W)]}};return I[":id"]=D.primaryKey,R!=null&&(I[fs(R)]=D.primaryKey),D})},hasGetAll:0<b.length&&"getAll"in M&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in M},b=g.schema,$=g.hasGetAll,V=g.hasIdb3Features,M=b.tables.map(p),E={};return M.forEach(function(T){return E[T.name]=T}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(T){if(E[T])return E[T];throw new Error("Table '".concat(T,"' not found"))},MIN_KEY:-1/0,MAX_KEY:cs(i),schema:b}}function Hf(r,i,l,f){return l=l.IDBKeyRange,i=qf(i,l,f),{dbcore:r.dbcore.reduce(function(p,v){return v=v.create,s(s({},p),v(p))},i)}}function ao(r,i){var l=i.db,l=Hf(r._middlewares,l,r._deps,i);r.core=l.dbcore,r.tables.forEach(function(f){var p=f.name;r.core.schema.tables.some(function(v){return v.name===p})&&(f.core=r.core.table(p),r[p]instanceof r.Table)&&(r[p].core=f.core)})}function lo(r,i,l,f){l.forEach(function(p){var v=f[p];i.forEach(function(g){var b=function $(V,M){return te(V,M)||(V=y(V))&&$(V,M)}(g,p);(!b||"value"in b&&b.value===void 0)&&(g===r.Transaction.prototype||g instanceof r.Transaction?N(g,p,{get:function(){return this.table(p)},set:function($){O(this,p,{value:$,writable:!0,configurable:!0,enumerable:!0})}}):g[p]=new r.Table(p,v))})})}function Li(r,i){i.forEach(function(l){for(var f in l)l[f]instanceof r.Table&&delete l[f]})}function Wf(r,i){return r._cfg.version-i._cfg.version}function zf(r,i,l,f){var p=r._dbSchema,v=(l.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=ji("$meta",Rl("")[0],[]),r._storeNames.push("$meta")),r._createTransaction("readwrite",r._storeNames,p)),g=(v.create(l),v._completion.catch(f),v._reject.bind(v)),b=Ie.transless||Ie;qn(function(){if(Ie.trans=v,Ie.transless=b,i!==0)return ao(r,l),V=i,(($=v).storeNames.includes("$meta")?$.table("$meta").get("version").then(function(M){return M??V}):Se.resolve(V)).then(function(D){var E=r,T=D,R=v,j=l,I=[],D=E._versions,W=E._dbSchema=co(0,E.idbdb,j);return(D=D.filter(function(B){return B._cfg.version>=T})).length===0?Se.resolve():(D.forEach(function(B){I.push(function(){var re,de,he,_e=W,ye=B._cfg.dbschema,Pe=(fo(E,_e,j),fo(E,ye,j),W=E._dbSchema=ye,Ri(_e,ye)),we=(Pe.add.forEach(function(Ae){Ki(j,Ae[0],Ae[1].primKey,Ae[1].indexes)}),Pe.change.forEach(function(Ae){if(Ae.recreate)throw new je.Upgrade("Not yet support for changing primary key");var pe=j.objectStore(Ae.name);Ae.add.forEach(function(qe){return uo(pe,qe)}),Ae.change.forEach(function(qe){pe.deleteIndex(qe.name),uo(pe,qe)}),Ae.del.forEach(function(qe){return pe.deleteIndex(qe)})}),B._cfg.contentUpgrade);if(we&&B._cfg.version>T)return ao(E,j),R._memoizedTables={},re=A(ye),Pe.del.forEach(function(Ae){re[Ae]=_e[Ae]}),Li(E,[E.Transaction.prototype]),lo(E,[E.Transaction.prototype],c(re),re),R.schema=re,(de=De(we))&&Fr(),ye=Se.follow(function(){var Ae;(he=we(R))&&de&&(Ae=Hn.bind(null,null),he.then(Ae,Ae))}),he&&typeof he.then=="function"?Se.resolve(he):ye.then(function(){return he})}),I.push(function(re){var de,he,_e=B._cfg.dbschema;de=_e,he=re,[].slice.call(he.db.objectStoreNames).forEach(function(ye){return de[ye]==null&&he.db.deleteObjectStore(ye)}),Li(E,[E.Transaction.prototype]),lo(E,[E.Transaction.prototype],E._storeNames,E._dbSchema),R.schema=E._dbSchema}),I.push(function(re){E.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(E.idbdb.version/10)===B._cfg.version?(E.idbdb.deleteObjectStore("$meta"),delete E._dbSchema.$meta,E._storeNames=E._storeNames.filter(function(de){return de!=="$meta"})):re.objectStore("$meta").put(B._cfg.version,"version"))})}),function B(){return I.length?Se.resolve(I.shift()(R.idbtrans)).then(B):Se.resolve()}().then(function(){Ll(W,j)}))}).catch(g);var $,V;c(p).forEach(function(M){Ki(l,M,p[M].primKey,p[M].indexes)}),ao(r,l),Se.follow(function(){return r.on.populate.fire(v)}).catch(g)})}function Gf(r,i){Ll(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=co(0,r.idbdb,i);fo(r,r._dbSchema,i);for(var f=0,p=Ri(l,r._dbSchema).change;f<p.length;f++){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($){q&&console.debug("Dexie upgrade patch: Creating missing index ".concat(g.name,".").concat($.src)),uo(b,$)})})(p[f]);if(typeof v=="object")return v.value}}function Ri(r,i){var l,f={del:[],add:[],change:[]};for(l in r)i[l]||f.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,f.change.push(g);else{var b=p.idxByName,$=v.idxByName,V=void 0;for(V in b)$[V]||g.del.push(V);for(V in $){var M=b[V],E=$[V];M?M.src!==E.src&&g.change.push(E):g.add.push(E)}(0<g.del.length||0<g.add.length||0<g.change.length)&&f.change.push(g)}}else f.add.push([l,v])}return f}function Ki(r,i,l,f){var p=r.db.createObjectStore(i,l.keyPath?{keyPath:l.keyPath,autoIncrement:l.auto}:{autoIncrement:l.auto});f.forEach(function(v){return uo(p,v)})}function Ll(r,i){c(r).forEach(function(l){i.db.objectStoreNames.contains(l)||(q&&console.debug("Dexie: Creating missing table",l),Ki(i,l,r[l].primKey,r[l].indexes))})}function uo(r,i){r.createIndex(i.name,i.keyPath,{unique:i.unique,multiEntry:i.multi})}function co(r,i,l){var f={};return P(i.objectStoreNames,0).forEach(function(p){for(var v=l.objectStore(p),g=Ii(jl(V=v.keyPath),V||"",!0,!1,!!v.autoIncrement,V&&typeof V!="string",!0),b=[],$=0;$<v.indexNames.length;++$){var M=v.index(v.indexNames[$]),V=M.keyPath,M=Ii(M.name,V,!!M.unique,!!M.multiEntry,!1,V&&typeof V!="string",!1);b.push(M)}f[p]=ji(p,g,b)}),f}function fo(r,i,l){for(var f=l.db.objectStoreNames,p=0;p<f.length;++p){var v=f[p],g=l.objectStore(v);r._hasGetAll="getAll"in g;for(var b=0;b<g.indexNames.length;++b){var $,V=g.indexNames[b],M=g.index(V).keyPath,M=typeof M=="string"?M:"["+P(M).join("+")+"]";i[v]&&($=i[v].idxByName[M])&&($.name=V,delete i[v].idxByName[M],i[v].idxByName[V]=$)}}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 Rl(r){return r.split(",").map(function(i,l){var p=i.split(":"),f=(f=p[1])==null?void 0:f.trim(),p=(i=p[0].trim()).replace(/([&*]|\+\+)/g,""),v=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return Ii(p,v||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),d(v),l===0,f)})}Br.prototype._createTableSchema=ji,Br.prototype._parseIndexSyntax=Rl,Br.prototype._parseStoresSpec=function(r,i){var l=this;c(r).forEach(function(f){if(r[f]!==null){var p=l._parseIndexSyntax(r[f]),v=p.shift();if(!v)throw new je.Schema("Invalid schema for table "+f+": "+r[f]);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(f,v,p),i[f]=v}})},Br.prototype.stores=function(l){var i=this.db,l=(this._cfg.storesSource=this._cfg.storesSource?h(this._cfg.storesSource,l):l,i._versions),f={},p={};return l.forEach(function(v){h(f,v._cfg.storesSource),p=v._cfg.dbschema={},v._parseStoresSpec(f,p)}),i._dbSchema=p,Li(i,[i._allTables,i,i.Transaction.prototype]),lo(i,[i._allTables,i,i.Transaction.prototype,this._cfg.tables],c(p),p),i._storeNames=c(p),this},Br.prototype.upgrade=function(r){return this._cfg.contentUpgrade=U(this._cfg.contentUpgrade||_,r),this};var Yf=Br;function Br(){}var ds=(()=>{var r,i,l;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(r=new Set,i=new FinalizationRegistry(function(f){r.delete(f)}),{toArray:function(){return Array.from(r).map(function(f){return f.deref()}).filter(function(f){return f!==void 0})},add:function(f){var p=new WeakRef(f._novip);r.add(p),i.register(f._novip,p,p),r.size>f._options.maxConnections&&(p=r.values().next().value,r.delete(p),i.unregister(p))},remove:function(f){if(f)for(var p=r.values(),v=p.next();!v.done;){var g=v.value;if(g.deref()===f._novip)return r.delete(g),void i.unregister(g);v=p.next()}}}):(l=[],{toArray:function(){return l},add:function(f){l.push(f._novip)},remove:function(f){f&&(f=l.indexOf(f._novip))!==-1&&l.splice(f,1)}})})();function Fi(r,i){var l=r._dbNamesDB;return l||(l=r._dbNamesDB=new Mn(eo,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),l.table("dbnames")}function Ni(r){return r&&typeof r.databases=="function"}function Vi(r){return qn(function(){return Ie.letThrough=!0,r()})}function Bi(r){return!("from"in r)}var Lt=function(r,i){var l;if(!this)return l=new Lt,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 ps(r,i,l){var f=nt(i,l);if(!isNaN(f)){if(0<f)throw RangeError();if(Bi(r))return h(r,{from:i,to:l,d:1});var f=r.l,p=r.r;if(nt(l,r.from)<0)return f?ps(f,i,l):r.l={from:i,to:l,d:1,l:null,r:null},Fl(r);if(0<nt(i,r.to))return p?ps(p,i,l):r.r={from:i,to:l,d:1,l:null,r:null},Fl(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,f&&!r.l&&hs(r,f),p&&i&&hs(r,p)}}function hs(r,i){Bi(i)||function l(f,p){var v=p.from,g=p.l,b=p.r;ps(f,v,p.to),g&&l(f,g),b&&l(f,b)}(r,i)}function Kl(r,i){var l=po(i),f=l.next();if(!f.done)for(var p=f.value,v=po(r),g=v.next(p.from),b=g.value;!f.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=(f=l.next(b.from)).value:b=(g=v.next(p.from)).value}return!1}function po(r){var i=Bi(r)?null:{s:0,n:r};return{next:function(l){for(var f=0<arguments.length;i;)switch(i.s){case 0:if(i.s=1,f)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,!f||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 Fl(r){var i,l,f,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),f=r[p],r.from=f.from,r.to=f.to,r[p]=f[p],l[p]=f[i],(r[i]=l).d=Nl(l)),r.d=Nl(r)}function Nl(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 ho(r,i){return c(i).forEach(function(l){r[l]?hs(r[l],i[l]):r[l]=function f(p){var v,g,b={};for(v in p)w(p,v)&&(g=p[v],b[v]=!g||typeof g!="object"||ge.has(g.constructor)?g:f(g));return b}(i[l])}),r}function Ui(r,i){return r.all||i.all||Object.keys(r).some(function(l){return i[l]&&Kl(i[l],r[l])})}C(Lt.prototype,((Xe={add:function(r){return hs(this,r),this},addKey:function(r){return ps(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(l){return ps(i,l,l)}),this},hasKey:function(r){var i=po(this).next(r).value;return i&&nt(i.from,r)<=0&&0<=nt(i.to,r)}})[We]=function(){return po(this)},Xe));var gr={},qi={},Hi=!1;function vo(r){ho(qi,r),Hi||(Hi=!0,setTimeout(function(){Hi=!1,Wi(qi,!(qi={}))},0))}function Wi(r,i){i===void 0&&(i=!1);var l=new Set;if(r.all)for(var f=0,p=Object.values(gr);f<p.length;f++)Vl(b=p[f],r,l,i);else for(var v in r){var g,b,v=/^idb\:\/\/(.*)\/(.*)\//.exec(v);v&&(g=v[1],v=v[2],b=gr["idb://".concat(g,"/").concat(v)])&&Vl(b,r,l,i)}l.forEach(function($){return $()})}function Vl(r,i,l,f){for(var p=[],v=0,g=Object.entries(r.queries.query);v<g.length;v++){for(var b=g[v],$=b[0],V=[],M=0,E=b[1];M<E.length;M++){var T=E[M];Ui(i,T.obsSet)?T.subscribers.forEach(function(D){return l.add(D)}):f&&V.push(T)}f&&p.push([$,V])}if(f)for(var R=0,j=p;R<j.length;R++){var I=j[R],$=I[0],V=I[1];r.queries.query[$]=V}}function Jf(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 f=i.openCanceller,p=Math.round(10*r.verno),v=!1;function g(){if(i.openCanceller!==f)throw new je.DatabaseClosed("db.open() was cancelled")}function b(){return new Se(function(T,R){if(g(),!l)throw new je.MissingAPI;var j=r.name,I=i.autoSchema||!p?l.open(j):l.open(j,p);if(!I)throw new je.MissingAPI;I.onerror=dn(R),I.onblocked=yt(r._fireOnBlocked),I.onupgradeneeded=yt(function(D){var W;M=I.transaction,i.autoSchema&&!r._options.allowEmptyDB?(I.onerror=us,M.abort(),I.result.close(),(W=l.deleteDatabase(j)).onsuccess=W.onerror=yt(function(){R(new je.NoSuchDatabase("Database ".concat(j," doesnt exist")))})):(M.onerror=dn(R),W=D.oldVersion>Math.pow(2,62)?0:D.oldVersion,E=W<1,r.idbdb=I.result,v&&Gf(r,M),zf(r,W/10,M,R))},R),I.onsuccess=yt(function(){M=null;var D,W,B,re,de,he,_e=r.idbdb=I.result,ye=P(_e.objectStoreNames);if(0<ye.length)try{var Pe=_e.transaction((de=ye).length===1?de[0]:de,"readonly");if(i.autoSchema)he=_e,re=Pe,(B=r).verno=he.version/10,re=B._dbSchema=co(0,he,re),B._storeNames=P(he.objectStoreNames,0),lo(B,[B._allTables],c(re),re);else if(fo(r,r._dbSchema,Pe),W=Pe,((W=Ri(co(0,(D=r).idbdb,W),D._dbSchema)).add.length||W.change.some(function(we){return we.add.length||we.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."),_e.close(),p=_e.version+1,v=!0,T(b());ao(r,Pe)}catch{}ds.add(r),_e.onversionchange=yt(function(we){i.vcFired=!0,r.on("versionchange").fire(we)}),_e.onclose=yt(function(){r.close({disableAutoOpen:!1})}),E&&(ye=r._deps,de=j,Ni(he=ye.indexedDB)||de===eo||Fi(he,ye.IDBKeyRange).put({name:de}).catch(_)),T()},R)}).catch(function(T){switch(T==null?void 0:T.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(T)})}var $,V=i.dbReadyResolve,M=null,E=!1;return Se.race([f,(typeof navigator>"u"?Se.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(T){function R(){return indexedDB.databases().finally(T)}$=setInterval(R,100),R()}).finally(function(){return clearInterval($)}):Promise.resolve()).then(b)]).then(function(){return g(),i.onReadyBeingFired=[],Se.resolve(Vi(function(){return r.on.ready.fire(r.vip)})).then(function T(){var R;if(0<i.onReadyBeingFired.length)return R=i.onReadyBeingFired.reduce(U,_),i.onReadyBeingFired=[],Se.resolve(Vi(function(){return R(r.vip)})).then(T)})}).finally(function(){i.openCanceller===f&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(T){i.dbOpenError=T;try{M&&M.abort()}catch{}return f===i.openCanceller&&r._close(),Ct(T)}).finally(function(){i.openComplete=!0,V()}).then(function(){var T;return E&&(T={},r.tables.forEach(function(R){R.schema.indexes.forEach(function(j){j.name&&(T["idb://".concat(r.name,"/").concat(R.name,"/").concat(j.name)]=new Lt(-1/0,[[[]]]))}),T["idb://".concat(r.name,"/").concat(R.name,"/")]=T["idb://".concat(r.name,"/").concat(R.name,"/:dels")]=new Lt(-1/0,[[[]]])}),Gn(io).fire(T),Wi(T,!0)),r})}function zi(r){function i(v){return r.next(v)}var l=p(i),f=p(function(v){return r.throw(v)});function p(v){return function(b){var b=v(b),$=b.value;return b.done?$:$&&typeof $.then=="function"?$.then(l,f):d($)?Promise.all($).then(l,f):l($)}}return p(i)()}function mo(r,i,l){for(var f=d(r)?r.slice():[r],p=0;p<l;++p)f.push(i);return f}var Xf={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return s(s({},r),{table:function(f){var l=r.table(f),f=l.schema,p=Object.create(null),v=[];function g(T,R,j){var B=fs(T),I=p[B]=p[B]||[],D=T==null?0:typeof T=="string"?1:T.length,W=0<R,B=s(s({},j),{name:W?"".concat(B,"(virtual-from:").concat(j.name,")"):j.name,lowLevelIndex:j,isVirtual:W,keyTail:R,keyLength:D,extractKey:Di(T),unique:!W&&j.unique});return I.push(B),B.isPrimaryKey||v.push(B),1<D&&g(D===2?T[0]:T.slice(0,D-1),R+1,j),I.sort(function(re,de){return re.keyTail-de.keyTail}),B}var b=g(f.primaryKey.keyPath,0,f.primaryKey);p[":id"]=[b];for(var $=0,V=f.indexes;$<V.length;$++){var M=V[$];g(M.keyPath,0,M)}function E(T){var R,j=T.query.index;return j.isVirtual?s(s({},T),{query:{index:j.lowLevelIndex,range:(R=T.query.range,j=j.keyTail,{type:R.type===1?2:R.type,lower:mo(R.lower,R.lowerOpen?r.MAX_KEY:r.MIN_KEY,j),lowerOpen:!0,upper:mo(R.upper,R.upperOpen?r.MIN_KEY:r.MAX_KEY,j),upperOpen:!0})}}):T}return s(s({},l),{schema:s(s({},f),{primaryKey:b,indexes:v,getIndexByKeyPath:function(T){return(T=p[fs(T)])&&T[0]}}),count:function(T){return l.count(E(T))},query:function(T){return l.query(E(T))},openCursor:function(T){var R=T.query.index,j=R.keyTail,I=R.keyLength;return R.isVirtual?l.openCursor(E(T)).then(function(W){return W&&D(W)}):l.openCursor(T);function D(W){return Object.create(W,{continue:{value:function(B){B!=null?W.continue(mo(B,T.reverse?r.MAX_KEY:r.MIN_KEY,j)):T.unique?W.continue(W.key.slice(0,I).concat(T.reverse?r.MIN_KEY:r.MAX_KEY,j)):W.continue()}},continuePrimaryKey:{value:function(B,re){W.continuePrimaryKey(mo(B,r.MAX_KEY,j),re)}},primaryKey:{get:function(){return W.primaryKey}},key:{get:function(){var B=W.key;return I===1?B[0]:B.slice(0,I)}},value:{get:function(){return W.value}}})}}})}})}};function Gi(r,i,l,f){return l=l||{},f=f||"",c(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[f+p]=i[p]:b==="Object"?Gi(v,g,l,f+p+"."):v!==g&&(l[f+p]=i[p]):v!==g&&(l[f+p]=i[p])):l[f+p]=void 0}),c(i).forEach(function(p){w(r,p)||(l[f+p]=i[p])}),l}function Yi(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var Qf={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return s(s({},r),{table:function(i){var l=r.table(i),f=l.schema.primaryKey;return s(s({},l),{mutate:function(p){var v=Ie.trans,g=v.table(i).hook,b=g.deleting,$=g.creating,V=g.updating;switch(p.type){case"add":if($.fire===_)break;return v._promise("readwrite",function(){return M(p)},!0);case"put":if($.fire===_&&V.fire===_)break;return v._promise("readwrite",function(){return M(p)},!0);case"delete":if(b.fire===_)break;return v._promise("readwrite",function(){return M(p)},!0);case"deleteRange":if(b.fire===_)break;return v._promise("readwrite",function(){return function E(T,R,j){return l.query({trans:T,values:!1,query:{index:f,range:R},limit:j}).then(function(I){var D=I.result;return M({type:"delete",keys:D,trans:T}).then(function(W){return 0<W.numFailures?Promise.reject(W.failures[0]):D.length<j?{failures:[],numFailures:0,lastResult:void 0}:E(T,s(s({},R),{lower:D[D.length-1],lowerOpen:!0}),j)})})}(p.trans,p.range,1e4)},!0)}return l.mutate(p);function M(E){var T,R,j,I=Ie.trans,D=E.keys||Yi(f,E);if(D)return(E=E.type==="add"||E.type==="put"?s(s({},E),{keys:D}):s({},E)).type!=="delete"&&(E.values=o([],E.values)),E.keys&&(E.keys=o([],E.keys)),T=l,j=D,((R=E).type==="add"?Promise.resolve([]):T.getMany({trans:R.trans,keys:j,cache:"immutable"})).then(function(W){var B=D.map(function(re,de){var he,_e,ye,Pe=W[de],we={onerror:null,onsuccess:null};return E.type==="delete"?b.fire.call(we,re,Pe,I):E.type==="add"||Pe===void 0?(he=$.fire.call(we,re,E.values[de],I),re==null&&he!=null&&(E.keys[de]=re=he,f.outbound||Q(E.values[de],f.keyPath,re))):(he=Gi(Pe,E.values[de]),(_e=V.fire.call(we,he,re,Pe,I))&&(ye=E.values[de],Object.keys(_e).forEach(function(Ae){w(ye,Ae)?ye[Ae]=_e[Ae]:Q(ye,Ae,_e[Ae])}))),we});return l.mutate(E).then(function(re){for(var de=re.failures,he=re.results,_e=re.numFailures,re=re.lastResult,ye=0;ye<D.length;++ye){var Pe=(he||D)[ye],we=B[ye];Pe==null?we.onerror&&we.onerror(de[ye]):we.onsuccess&&we.onsuccess(E.type==="put"&&W[ye]?E.values[ye]:Pe)}return{failures:de,results:he,numFailures:_e,lastResult:re}}).catch(function(re){return B.forEach(function(de){return de.onerror&&de.onerror(re)}),Promise.reject(re)})});throw new Error("Keys missing")}}})}})}};function Bl(r,i,l){try{if(!i||i.keys.length<r.length)return null;for(var f=[],p=0,v=0;p<i.keys.length&&v<r.length;++p)nt(i.keys[p],r[v])===0&&(f.push(l?xe(i.values[p]):i.values[p]),++v);return f.length===r.length?f:null}catch{return null}}var Zf={stack:"dbcore",level:-1,create:function(r){return{table:function(i){var l=r.table(i);return s(s({},l),{getMany:function(f){var p;return f.cache?(p=Bl(f.keys,f.trans._cache,f.cache==="clone"))?Se.resolve(p):l.getMany(f).then(function(v){return f.trans._cache={keys:f.keys,values:f.cache==="clone"?xe(v):v},v}):l.getMany(f)},mutate:function(f){return f.type!=="add"&&(f.trans._cache=null),l.mutate(f)}})}}}};function Ul(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function ql(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var ed={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,l=new Lt(r.MIN_KEY,r.MAX_KEY);return s(s({},r),{transaction:function(f,p,v){if(Ie.subscr&&p!=="readonly")throw new je.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ie.querier));return r.transaction(f,p,v)},table:function(f){function p(D){var I,D=D.query;return[I=D.index,new Lt((I=(D=D.range).lower)!=null?I:r.MIN_KEY,(I=D.upper)!=null?I:r.MAX_KEY)]}var v=r.table(f),g=v.schema,b=g.primaryKey,$=g.indexes,V=b.extractKey,M=b.outbound,E=b.autoIncrement&&$.filter(function(j){return j.compound&&j.keyPath.includes(b.keyPath)}),T=s(s({},v),{mutate:function(j){function I(pe){return pe="idb://".concat(i,"/").concat(f,"/").concat(pe),de[pe]||(de[pe]=new Lt)}var D,W,B,re=j.trans,de=j.mutatedParts||(j.mutatedParts={}),he=I(""),_e=I(":dels"),ye=j.type,we=j.type==="deleteRange"?[j.range]:j.type==="delete"?[j.keys]:j.values.length<50?[Yi(b,j).filter(function(pe){return pe}),j.values]:[],Pe=we[0],we=we[1],Ae=j.trans._cache;return d(Pe)?(he.addKeys(Pe),(ye=ye==="delete"||Pe.length===we.length?Bl(Pe,Ae):null)||_e.addKeys(Pe),(ye||we)&&(D=I,W=ye,B=we,g.indexes.forEach(function(pe){var qe=D(pe.name||"");function He(et){return et!=null?pe.extractKey(et):null}function Je(et){pe.multiEntry&&d(et)?et.forEach(function(nn){return qe.addKey(nn)}):qe.addKey(et)}(W||B).forEach(function(et,Rt){var ze=W&&He(W[Rt]),Rt=B&&He(B[Rt]);nt(ze,Rt)!==0&&(ze!=null&&Je(ze),Rt!=null)&&Je(Rt)})}))):Pe?(we={from:(Ae=Pe.lower)!=null?Ae:r.MIN_KEY,to:(ye=Pe.upper)!=null?ye:r.MAX_KEY},_e.add(we),he.add(we)):(he.add(l),_e.add(l),g.indexes.forEach(function(pe){return I(pe.name).add(l)})),v.mutate(j).then(function(pe){return!Pe||j.type!=="add"&&j.type!=="put"||(he.addKeys(pe.results),E&&E.forEach(function(qe){for(var He=j.values.map(function(ze){return qe.extractKey(ze)}),Je=qe.keyPath.findIndex(function(ze){return ze===b.keyPath}),et=0,nn=pe.results.length;et<nn;++et)He[et][Je]=pe.results[et];I(qe.name).addKeys(He)})),re.mutatedParts=ho(re.mutatedParts||{},de),pe})}}),R={get:function(j){return[b,new Lt(j.key)]},getMany:function(j){return[b,new Lt().addKeys(j.keys)]},count:p,query:p,openCursor:p};return c(R).forEach(function(j){T[j]=function(I){var D=Ie.subscr,W=!!D,B=Ul(Ie,v)&&ql(j,I)?I.obsSet={}:D;if(W){var re,D=function(we){return we="idb://".concat(i,"/").concat(f,"/").concat(we),B[we]||(B[we]=new Lt)},de=D(""),he=D(":dels"),W=R[j](I),_e=W[0],W=W[1];if((j==="query"&&_e.isPrimaryKey&&!I.values?he:D(_e.name||"")).add(W),!_e.isPrimaryKey){if(j!=="count")return re=j==="query"&&M&&I.values&&v.query(s(s({},I),{values:!1})),v[j].apply(this,arguments).then(function(we){if(j==="query"){if(M&&I.values)return re.then(function(He){return He=He.result,de.addKeys(He),we});var Ae=I.values?we.result.map(V):we.result;(I.values?de:he).addKeys(Ae)}else{var pe,qe;if(j==="openCursor")return qe=I.values,(pe=we)&&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&&de.addKey(pe.primaryKey),pe.value}}})}return we});he.add(l)}}return v[j].apply(this,arguments)}}),T}})}};function Hl(r,i,l){var f;return l.numFailures===0?i:i.type==="deleteRange"||(f=i.keys?i.keys.length:"values"in i&&i.values?i.values.length:1,l.numFailures===f)?null:(f=s({},i),d(f.keys)&&(f.keys=f.keys.filter(function(p,v){return!(v in l.failures)})),"values"in f&&d(f.values)&&(f.values=f.values.filter(function(p,v){return!(v in l.failures)})),f)}function Ji(r,i){return l=r,((f=i).lower===void 0||(f.lowerOpen?0<nt(l,f.lower):0<=nt(l,f.lower)))&&(l=r,(f=i).upper===void 0||(f.upperOpen?nt(l,f.upper)<0:nt(l,f.upper)<=0));var l,f}function Wl(r,i,l,f,p,v){var g,b,$,V,M,E,T;return!l||l.length===0||(g=i.query.index,b=g.multiEntry,$=i.query.range,V=f.schema.primaryKey.extractKey,M=g.extractKey,E=(g.lowLevelIndex||g).extractKey,(f=l.reduce(function(R,j){var I=R,D=[];if(j.type==="add"||j.type==="put")for(var W=new Lt,B=j.values.length-1;0<=B;--B){var re,de=j.values[B],he=V(de);!W.hasKey(he)&&(re=M(de),b&&d(re)?re.some(function(Ae){return Ji(Ae,$)}):Ji(re,$))&&(W.addKey(he),D.push(de))}switch(j.type){case"add":var _e=new Lt().addKeys(i.values?R.map(function(pe){return V(pe)}):R),I=R.concat(i.values?D.filter(function(pe){return pe=V(pe),!_e.hasKey(pe)&&(_e.addKey(pe),!0)}):D.map(function(pe){return V(pe)}).filter(function(pe){return!_e.hasKey(pe)&&(_e.addKey(pe),!0)}));break;case"put":var ye=new Lt().addKeys(j.values.map(function(pe){return V(pe)}));I=R.filter(function(pe){return!ye.hasKey(i.values?V(pe):pe)}).concat(i.values?D:D.map(function(pe){return V(pe)}));break;case"delete":var Pe=new Lt().addKeys(j.keys);I=R.filter(function(pe){return!Pe.hasKey(i.values?V(pe):pe)});break;case"deleteRange":var we=j.range;I=R.filter(function(pe){return!Ji(V(pe),we)})}return I},r))===r)?r:(T=function(R,j){return nt(E(R),E(j))||nt(V(R),V(j))},f.sort(i.direction==="prev"||i.direction==="prevunique"?function(R,j){return T(j,R)}:T),i.limit&&i.limit<1/0&&(f.length>i.limit?f.length=i.limit:r.length===i.limit&&f.length<i.limit&&(p.dirty=!0)),v?Object.freeze(f):f)}function zl(r,i){return nt(r.lower,i.lower)===0&&nt(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function td(r,i){return((l,f,p,v)=>{if(l===void 0)return f!==void 0?-1:0;if(f===void 0)return 1;if((l=nt(l,f))===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,f,p,v)=>{if(l===void 0)return f!==void 0?1:0;if(f===void 0)return-1;if((l=nt(l,f))===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 nd(r,i,l,f){r.subscribers.add(l),f.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 rd={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return s(s({},r),{transaction:function(l,f,p){var v,g,b=r.transaction(l,f,p);return f==="readwrite"&&(p=(v=new AbortController).signal,b.addEventListener("abort",(g=function($){return function(){if(v.abort(),f==="readwrite"){for(var V=new Set,M=0,E=l;M<E.length;M++){var T=E[M],R=gr["idb://".concat(i,"/").concat(T)];if(R){var j=r.table(T),I=R.optimisticOps.filter(function(pe){return pe.trans===b});if(b._explicit&&$&&b.mutatedParts)for(var D=0,W=Object.values(R.queries.query);D<W.length;D++)for(var B=0,re=(_e=W[D]).slice();B<re.length;B++)Ui((ye=re[B]).obsSet,b.mutatedParts)&&(me(_e,ye),ye.subscribers.forEach(function(pe){return V.add(pe)}));else if(0<I.length){R.optimisticOps=R.optimisticOps.filter(function(pe){return pe.trans!==b});for(var de=0,he=Object.values(R.queries.query);de<he.length;de++)for(var _e,ye,Pe,we=0,Ae=(_e=he[de]).slice();we<Ae.length;we++)(ye=Ae[we]).res!=null&&b.mutatedParts&&($&&!ye.dirty?(Pe=Object.isFrozen(ye.res),Pe=Wl(ye.res,ye.req,I,j,ye,Pe),ye.dirty?(me(_e,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(_e,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 f=r.table(l),p=f.schema.primaryKey;return s(s({},f),{mutate:function(v){var g,b=Ie.trans;return!p.outbound&&b.db._options.cache!=="disabled"&&!b.explicit&&b.idbtrans.mode==="readwrite"&&(g=gr["idb://".concat(i,"/").concat(l)])?(b=f.mutate(v),v.type!=="add"&&v.type!=="put"||!(50<=v.values.length||Yi(p,v).some(function($){return $==null}))?(g.optimisticOps.push(v),v.mutatedParts&&vo(v.mutatedParts),b.then(function($){0<$.numFailures&&(me(g.optimisticOps,v),($=Hl(0,v,$))&&g.optimisticOps.push($),v.mutatedParts)&&vo(v.mutatedParts)}),b.catch(function(){me(g.optimisticOps,v),v.mutatedParts&&vo(v.mutatedParts)})):b.then(function($){var V=Hl(0,s(s({},v),{values:v.values.map(function(M,E){var T;return $.failures[E]?M:(Q(T=(T=p.keyPath)!=null&&T.includes(".")?xe(M):s({},M),p.keyPath,$.results[E]),T)})}),$);g.optimisticOps.push(V),queueMicrotask(function(){return v.mutatedParts&&vo(v.mutatedParts)})}),b):f.mutate(v)},query:function(v){var g,b,$,V,M,E,T;return Ul(Ie,f)&&ql("query",v)?(g=(($=Ie.trans)==null?void 0:$.db._options.cache)==="immutable",b=($=Ie).requery,$=$.signal,E=((R,j,I,D)=>{var W=gr["idb://".concat(R,"/").concat(j)];if(!W)return[];if(!(R=W.queries[I]))return[null,!1,W,null];var B=R[(D.query?D.query.index.name:null)||""];if(!B)return[null,!1,W,null];switch(I){case"query":var re=(de=D.direction)!=null?de:"next",de=B.find(function(he){var _e;return he.req.limit===D.limit&&he.req.values===D.values&&((_e=he.req.direction)!=null?_e:"next")===re&&zl(he.req.query.range,D.query.range)});return de?[de,!0,W,B]:[B.find(function(he){var _e;return("limit"in he.req?he.req.limit:1/0)>=D.limit&&((_e=he.req.direction)!=null?_e:"next")===re&&(!D.values||he.req.values)&&td(he.req.query.range,D.query.range)}),!1,W,B];case"count":return de=B.find(function(he){return zl(he.req.query.range,D.query.range)}),[de,!!de,W,B]}})(i,l,"query",v),T=E[0],V=E[2],M=E[3],T&&E[1]?T.obsSet=v.obsSet:(E=f.query(v).then(function(R){var j=R.result;if(T&&(T.res=j),g){for(var I=0,D=j.length;I<D;++I)Object.freeze(j[I]);Object.freeze(j)}return R}).catch(function(R){return M&&T&&me(M,T),Promise.reject(R)}),T={obsSet:v.obsSet,promise:E,subscribers:new Set,type:"query",req:v,dirty:!1},M?M.push(T):(M=[T],(V=V||(gr["idb://".concat(i,"/").concat(l)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[v.query.index.name||""]=M)),nd(T,M,b,$),T.promise.then(function(R){return R=Wl(R.result,v,V==null?void 0:V.optimisticOps,f,T,g),{result:g?R:xe(R)}})):f.query(v)}})}})}};function yo(r,i){return new Proxy(r,{get:function(l,f,p){return f==="db"?i:Reflect.get(l,f,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(f){return f._cfg.version===r})[0];return l||(l=new this.Version(r),i.push(l),i.sort(Wf),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,f){if(i._state.openComplete)return f(new je.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void f(new je.DatabaseClosed);i.open().catch(_)}i._state.dbReadyPromise.then(l,f)}).then(r)},St.prototype.use=function(p){var i=p.stack,l=p.create,f=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:f??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,f=r.create;return i&&this._middlewares[i]&&(this._middlewares[i]=this._middlewares[i].filter(function(p){return f?p.create!==f:!!l&&p.name!==l})),this},St.prototype.open=function(){var r=this;return vr($t,function(){return Jf(r)})},St.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var r=this._state;if(ds.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"),f=this._state;return new Se(function(p,v){function g(){i.close(r);var b=i._deps.indexedDB.deleteDatabase(i.name);b.onsuccess=yt(function(){var $,V,M;$=i._deps,V=i.name,Ni(M=$.indexedDB)||V===eo||Fi(M,$.IDBKeyRange).delete(V).catch(_),p()}),b.onerror=dn(v),b.onblocked=i._fireOnBlocked}if(l)throw new je.InvalidArgument("Invalid closeOptions argument to db.delete()");f.isBeingOpened?f.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 c(this._allTables).map(function(i){return r._allTables[i]})},enumerable:!1,configurable:!0}),St.prototype.transaction=function(){var r=(function(i,l,f){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 f=v.pop(),[i,oe(v),f]}).apply(this,arguments);return this._transaction.apply(this,r)},St.prototype._transaction=function(r,i,l){var f,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===Ti)f=Ti;else{if(r!="rw"&&r!=Pi)throw new je.InvalidArgument("Invalid transaction mode: "+r);f=Pi}if(g){if(g.mode===Ti&&f===Pi){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(M,E){E(V)}):Ct(V)}var $=(function V(M,E,T,R,j){return Se.resolve().then(function(){var B=Ie.transless||Ie,I=M._createTransaction(E,T,M._dbSchema,R),B=(I.explicit=!0,{trans:I,transless:B});if(R)I.idbtrans=R.idbtrans;else try{I.create(),I.idbtrans._explicit=!0,M._state.PR1398_maxLoop=3}catch(re){return re.name===Jt.InvalidState&&M.isOpen()&&0<--M._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),M.close({disableAutoOpen:!1}),M.open().then(function(){return V(M,E,T,null,j)})):Ct(re)}var D,W=De(j),B=(W&&Fr(),Se.follow(function(){var re;(D=j.call(I,I))&&(W?(re=Hn.bind(null,null),D.then(re,re)):typeof D.next=="function"&&typeof D.throw=="function"&&(D=zi(D)))},B));return(D&&typeof D.then=="function"?Se.resolve(D).then(function(re){return I.active?re:Ct(new je.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):B.then(function(){return D})).then(function(re){return R&&I._resolve(),I._completion.then(function(){return re})}).catch(function(re){return I._reject(re),Ct(re)})})}).bind(null,this,f,p,g,l);return g?g._promise(f,$,"lock"):Ie.trans?vr(Ie.transless,function(){return v._whenReady($)}):this._whenReady($)},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,f,p,v,g,b=this,$=(this._middlewares={},this.verno=0,St.dependencies),$=(this._options=i=s({addons:St.addons,autoOpen:!0,indexedDB:$.indexedDB,IDBKeyRange:$.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}),M=(V.dbReadyPromise=new Se(function(E){V.dbReadyResolve=E}),V.openCanceller=new Se(function(E,T){V.cancelOpen=T}),this._state=V,this.name=r,this.on=as(this,"populate","blocked","versionchange","close",{ready:[U,_]}),this.once=function(E,T){var R=function(){for(var j=[],I=0;I<arguments.length;I++)j[I]=arguments[I];b.on(E).unsubscribe(R),T.apply(b,j)};return b.on(E,R)},this.on.ready.subscribe=L(this.on.ready.subscribe,function(E){return function(T,R){St.vip(function(){var j,I=b._state;I.openComplete?(I.dbOpenError||Se.resolve().then(T),R&&E(T)):I.onReadyBeingFired?(I.onReadyBeingFired.push(T),R&&E(T)):(E(T),j=b,R||E(function D(){j.on.ready.unsubscribe(T),j.on.ready.unsubscribe(D)}))})}}),this.Collection=(l=this,ls(Ff.prototype,function(D,I){this.db=l;var R=kl,j=null;if(I)try{R=I()}catch(B){j=B}var I=D._ctx,D=I.table,W=D.hook.reading.fire;this._ctx={table:D,index:I.index,isPrimKey:!I.index||D.schema.primKey.keyPath&&I.index===D.schema.primKey.name,range:R,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:j,or:I.or,valueMapper:W!==x?W:null}})),this.Table=(f=this,ls(Tl.prototype,function(E,T,R){this.db=f,this._tx=R,this.name=E,this.schema=T,this.hook=f._allTables[E]?f._allTables[E].hook:as(null,{creating:[le,_],reading:[z,x],updating:[ve,_],deleting:[be,_]})})),this.Transaction=(p=this,ls(Bf.prototype,function(E,T,R,j,I){var D=this;E!=="readonly"&&T.forEach(function(W){W=(W=R[W])==null?void 0:W.yProps,W&&(T=T.concat(W.map(function(B){return B.updatesTable})))}),this.db=p,this.mode=E,this.storeNames=T,this.schema=R,this.chromeTransactionDurability=j,this.idbtrans=null,this.on=as(this,"complete","error","abort"),this.parent=I||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(W,B){D._resolve=W,D._reject=B}),this._completion.then(function(){D.active=!1,D.on.complete.fire()},function(W){var B=D.active;return D.active=!1,D.on.error.fire(W),D.parent?D.parent._reject(W):B&&D.idbtrans&&D.idbtrans.abort(),Ct(W)})})),this.Version=(v=this,ls(Yf.prototype,function(E){this.db=v,this._cfg={version:E,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(g=this,ls(Il.prototype,function(E,T,R){if(this.db=g,this._ctx={table:E,index:T===":id"?null:T,or:R},this._cmp=this._ascending=nt,this._descending=function(j,I){return nt(I,j)},this._max=function(j,I){return 0<nt(j,I)?j:I},this._min=function(j,I){return nt(j,I)<0?j:I},this._IDBKeyRange=g._deps.IDBKeyRange,!this._IDBKeyRange)throw new je.MissingAPI})),this.on("versionchange",function(E){0<E.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(E){!E.newVersion||E.newVersion<E.oldVersion?console.warn("Dexie.delete('".concat(b.name,"') was blocked")):console.warn("Upgrade '".concat(b.name,"' blocked by other connection holding version ").concat(E.oldVersion/10))}),this._maxKey=cs(i.IDBKeyRange),this._createTransaction=function(E,T,R,j){return new b.Transaction(E,T,R,b._options.chromeTransactionDurability,j)},this._fireOnBlocked=function(E){b.on("blocked").fire(E),ds.toArray().filter(function(T){return T.name===b.name&&T!==b&&!T._state.vcFired}).map(function(T){return T.on("versionchange").fire(E)})},this.use(Zf),this.use(rd),this.use(ed),this.use(Xf),this.use(Qf),new Proxy(this,{get:function(E,T,R){var j;return T==="_vip"||(T==="table"?function(I){return yo(b.table(I),M)}:(j=Reflect.get(E,T,R))instanceof Tl?yo(j,M):T==="tables"?j.map(function(I){return yo(I,M)}):T==="_createTransaction"?function(){return yo(j.apply(this,arguments),M)}:j)}}));this.vip=M,$.forEach(function(E){return E(b)})}var go,Ur=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",sd=(Xi.prototype.subscribe=function(r,i,l){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:l})},Xi.prototype[Ur]=function(){return this},Xi);function Xi(r){this._subscribe=r}try{go={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{go={indexedDB:null,IDBKeyRange:null}}function Gl(r){var i,l=!1,f=new sd(function(p){var v=De(r),g,b=!1,$={},V={},M={get closed(){return b},unsubscribe:function(){b||(b=!0,g&&g.abort(),E&&Gn.storagemutated.unsubscribe(j))}},E=(p.start&&p.start(M),!1),T=function(){return $i(I)};function R(){return Ui(V,$)}var j=function(D){ho($,D),R()&&T()},I=function(){var D,W,B;!b&&go.indexedDB&&($={},D={},g&&g.abort(),g=new AbortController,B=(re=>{var de=Rr();try{v&&Fr();var he=qn(r,re);return he=v?he.finally(Hn):he}finally{de&&Kr()}})(W={subscr:D,signal:g.signal,requery:T,querier:r,trans:null}),E||(Gn.storagemutated.subscribe(j),E=!0),Promise.resolve(B).then(function(re){l=!0,i=re,b||W.signal.aborted||(R()||(V=D,R())?T():($={},$i(function(){return!b&&p.next&&p.next(re)})))},function(re){l=!1,["DatabaseClosedError","AbortError"].includes(re==null?void 0:re.name)||b||$i(function(){b||p.error&&p.error(re)})}))};return setTimeout(T,0),M});return f.hasValue=function(){return l},f.getValue=function(){return i},f}var br=Mn;function Qi(r){var i=Yn;try{Yn=!0,Gn.storagemutated.fire(r),Wi(r,!0)}finally{Yn=i}}C(br,s(s({},Ce),{delete:function(r){return new br(r,{addons:[]}).delete()},exists:function(r){return new br(r,{addons:[]}).open().then(function(i){return i.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return i=br.dependencies,l=i.indexedDB,i=i.IDBKeyRange,(Ni(l)?Promise.resolve(l.databases()).then(function(f){return f.map(function(p){return p.name}).filter(function(p){return p!==eo})}):Fi(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?vr(Ie.transless||$t,r):r()},vip:Vi,async:function(r){return function(){try{var i=zi(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 f=zi(r.apply(l,i||[]));return f&&typeof f.then=="function"?f:Se.resolve(f)}catch(p){return Ct(p)}},currentTransaction:{get:function(){return Ie.trans||null}},waitFor:function(r,i){return r=Se.resolve(typeof r=="function"?br.ignoreTransaction(r):r).timeout(i||6e4),Ie.trans?Ie.trans.waitFor(r):r},Promise:Se,debug:{get:function(){return q},set:function(r){G(r)}},derive:ee,extend:h,props:C,override:L,Events:as,on:Gn,liveQuery:Gl,extendObservabilitySet:ho,getByKeyPath:ie,setByKeyPath:Q,delByKeyPath:function(r,i){typeof i=="string"?Q(r,i,void 0):"length"in i&&[].map.call(i,function(l){Q(r,l,void 0)})},shallowClone:A,deepClone:xe,getObjectDiff:Gi,cmp:nt,asap:ce,minKey:-1/0,addons:[],connections:{get:ds.toArray},errnames:Jt,dependencies:go,cache:gr,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)})})),br.maxKey=cs(br.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Gn(io,function(r){Yn||(r=new CustomEvent(Mi,{detail:r}),Yn=!0,dispatchEvent(r),Yn=!1)}),addEventListener(Mi,function(r){r=r.detail,Yn||Qi(r)}));var qr,Yn=!1,Yl=function(){};return typeof BroadcastChannel<"u"&&((Yl=function(){(qr=new BroadcastChannel(Mi)).onmessage=function(r){return r.data&&Qi(r.data)}})(),typeof qr.unref=="function"&&qr.unref(),Gn(io,function(r){Yn||qr.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!Mn.disableBfCache&&r.persisted){q&&console.debug("Dexie: handling persisted pagehide"),qr!=null&&qr.close();for(var i=0,l=ds.toArray();i<l.length;i++)l[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!Mn.disableBfCache&&r.persisted&&(q&&console.debug("Dexie: handling persisted pageshow"),Yl(),Qi({all:new Lt(-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&&N(i,"stack",{get:function(){return this.inner.stack}}),i)},G(q),s(Mn,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Mn,Entity:xl,PropModification:is,RangeSet:Lt,add:function(r){return new is({add:r})},cmp:nt,default:Mn,liveQuery:Gl,mergeRanges:hs,rangesOverlap:Kl,remove:function(r){return new is({remove:r})},replacePrefix:function(r,i){return new is({replacePrefix:[r,i]})}}),{default:Mn}),Mn})})(lf);var Qh=lf.exports;const Oa=Xh(Qh),Ru=Symbol.for("Dexie"),Yo=globalThis[Ru]||(globalThis[Ru]=Oa);if(Oa.semVer!==Yo.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Oa.semVer} and ${Yo.semVer}`);const{liveQuery:Zh,mergeRanges:Y0,rangesOverlap:J0,RangeSet:X0,cmp:Q0,Entity:Z0,PropModification:ek,replacePrefix:tk,add:nk,remove:rk,DexieYProvider:sk}=Yo;class ev extends Yo{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 fe;function tv(e){fe=e}function al(){fe&&fe.close(),fe=void 0}const nv=4,zr=["餐饮","交通","住房","通讯","学习","娱乐","其他"],Jo=["工资","报销","其他"],Ku=["公司","客户现场","出差","居家办公"],Hs=[{key:"dev",label:"开发"},{key:"bugfix",label:"BUG修复"},{key:"test",label:"测试"},{key:"learning",label:"学习成长"},{key:"meeting",label:"会议沟通"},{key:"doc",label:"文档输出"},{key:"other",label:"其他"}];function ll(e){const t=Hs.find(n=>n.key===e);return t?t.label:"其他"}const rv={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},sv={class:"dialog-head"},ov={key:0,class:"muted dialog-sub"},iv={class:"dialog-body"},av={class:"form-grid"},lv={class:"field span2"},uv={key:0,class:"form-error"},cv={class:"field"},fv=["value"],dv={class:"field"},pv=["value"],hv={class:"field"},vv={class:"field"},mv={class:"field span2"},yv={class:"field"},gv={class:"field"},bv={class:"dialog-btns"},wv=Bt({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=F(""),a=F(null),c=F("dev"),d=F(null),h=F(""),y=F(""),m=F(0),w=F(0),C=F(""),O=F(null),N=at(()=>{var L;const ue=n.projects.filter(J=>J.archived!==1),P=(L=n.item)==null?void 0:L.project_id;if(P&&!ue.some(J=>J.id===P)){const J=n.projects.find(ie=>ie.id===P),ce=ue.slice();return J&&ce.unshift({...J,name:J.name+"(已归档)"}),ce}return ue});function ee(ue){n.open&&ue.key==="Escape"&&s("cancel")}vt(()=>n.open,async ue=>{var P;if(ue){const L=n.item;o.value=(L==null?void 0:L.content)??"",a.value=(L==null?void 0:L.project_id)??null,c.value=(L==null?void 0:L.category)??"dev",d.value=(L==null?void 0:L.minutes)??null,h.value=(L==null?void 0:L.takeaway)??"",y.value=(L==null?void 0:L.remark)??"",m.value=(L==null?void 0:L.is_milestone)??0,w.value=(L==null?void 0:L.needs_followup)??0,C.value="",window.addEventListener("keydown",ee),await rs(),(P=O.value)==null||P.focus()}else window.removeEventListener("keydown",ee)}),fr(()=>window.removeEventListener("keydown",ee)),vt(o,()=>{C.value&&(C.value="")});function te(){const ue=o.value.trim();if(!ue){C.value="请填写工作内容";return}if(!n.item||!n.item.id){s("cancel");return}s("save",{id:n.item.id,content:ue,project_id:a.value,category:c.value,minutes:d.value&&d.value>0?d.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(ue,P)=>(K(),It(Us,{to:"body"},[Oe(ss,{name:"modal"},{default:cr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:P[10]||(P[10]=Ir(L=>s("cancel"),["self"]))},[u("div",rv,[u("div",sv,[u("div",null,[P[11]||(P[11]=u("div",{class:"dialog-title"},"编辑工作记录",-1)),e.date?(K(),H("div",ov,se(e.date),1)):Ee("",!0)]),u("button",{class:"icon-btn",title:"关闭",onClick:P[0]||(P[0]=L=>s("cancel"))},[Oe(ut,{name:"close",size:16})])]),u("div",iv,[u("div",av,[u("div",lv,[P[12]||(P[12]=u("label",null,"工作内容(必填)",-1)),Te(u("input",{ref_key:"contentInput",ref:O,class:tt(["input",{invalid:C.value}]),"onUpdate:modelValue":P[1]||(P[1]=L=>o.value=L),onKeydown:Dt(te,["enter"])},null,34),[[Le,o.value]]),C.value?(K(),H("div",uv,se(C.value),1)):Ee("",!0)]),u("div",cv,[P[14]||(P[14]=u("label",null,"所属项目",-1)),Te(u("select",{class:"select","onUpdate:modelValue":P[2]||(P[2]=L=>a.value=L)},[P[13]||(P[13]=u("option",{value:null},"无项目",-1)),(K(!0),H(Re,null,ct(N.value,L=>(K(),H("option",{key:L.id,value:L.id},se(L.name),9,fv))),128))],512),[[Fn,a.value]])]),u("div",dv,[P[15]||(P[15]=u("label",null,"工作分类",-1)),Te(u("select",{class:"select","onUpdate:modelValue":P[3]||(P[3]=L=>c.value=L)},[(K(!0),H(Re,null,ct(Zt(Hs),L=>(K(),H("option",{key:L.key,value:L.key},se(L.label),9,pv))),128))],512),[[Fn,c.value]])]),u("div",hv,[P[16]||(P[16]=u("label",null,"耗时(分钟)",-1)),Te(u("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":P[4]||(P[4]=L=>d.value=L),placeholder:"选填"},null,512),[[Le,d.value,void 0,{number:!0}]])]),u("div",vv,[P[17]||(P[17]=u("label",null,"主要收获",-1)),Te(u("input",{class:"input","onUpdate:modelValue":P[5]||(P[5]=L=>h.value=L),placeholder:"一句话:学到了什么"},null,512),[[Le,h.value]])]),u("div",mv,[P[18]||(P[18]=u("label",null,"备注",-1)),Te(u("textarea",{class:"textarea","onUpdate:modelValue":P[6]||(P[6]=L=>y.value=L),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Le,y.value]])]),u("div",yv,[P[19]||(P[19]=u("label",null,"成果标记",-1)),u("button",{class:tt(["toggle-btn",{on:m.value===1}]),onClick:P[7]||(P[7]=L=>m.value=m.value===1?0:1)},se(m.value===1?"已标记为成果":"未标记"),3)]),u("div",gv,[P[20]||(P[20]=u("label",null,"待跟进",-1)),u("button",{class:tt(["toggle-btn",{onwarn:w.value===1}]),onClick:P[8]||(P[8]=L=>w.value=w.value===1?0:1)},se(w.value===1?"需要跟进":"无需跟进"),3)])])]),u("div",bv,[u("button",{class:"btn btn-sm",onClick:P[9]||(P[9]=L=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:te},"保存修改")])])])):Ee("",!0)]),_:1})]))}}),_v=Yt(wv,[["__scopeId","data-v-63bc0b48"]]);function $s(e){return e<10?"0"+e:String(e)}function Nn(e){return e.getFullYear()+"-"+$s(e.getMonth()+1)+"-"+$s(e.getDate())}function xt(){return Nn(new Date)}function wt(){const e=new Date;return Nn(e)+"T"+$s(e.getHours())+":"+$s(e.getMinutes())+":"+$s(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 os(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Kn(e,t){const n=os(e);return n.setDate(n.getDate()+t),Nn(n)}function Xo(e,t){const n=os(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 Ts(e){const t=os(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Nn(t)}function kv(e){const t=os(e).getDay();return t===0||t===6}function xv(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function uf(e){const t=os(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}const Cv=15e4;function Ma(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 Ia(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 Sv(){return Ma(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,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:Ia(t),iterations:Cv,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Zo(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 Ma(n.buffer)+":"+Ma(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:Ia(n[0])},e,Ia(n[1]));return new TextDecoder().decode(s)}async function ul(){await kf()}const cf="intern-log-vault-verify",es="enc:v1:";let jr=null;function Ev(){return jr!==null}function ei(){jr=null}async function ff(){return await gt("pwd_salt","")!==""}async function $v(e){if(e.length<6)throw new Error("主密码至少 6 位");if(await ff())throw new Error("主密码已设置");const t=Sv(),n=await Qo(e,t),s=await Zo(n,cf);await jt("pwd_salt",t),await jt("pwd_verifier",s),jr=n}async function Tv(e){const t=await gt("pwd_salt","");if(!t)throw new Error("主密码尚未设置");const n=await Qo(e,t),s=await gt("pwd_verifier","");try{await bi(n,s)}catch{throw new Error("主密码不正确")}jr=n}async function df(){if(!jr)throw new Error("密码库未解锁");return jr}async function Pv(e){const t=await df();return es+await Zo(t,e)}async function Av(e){if(!e)return"";if(!e.startsWith(es))return e;const t=await df();return bi(t,e.slice(es.length))}async function Ov(){return fe.credential.orderBy("system").toArray()}async function Mv(e,t){const n=await Pv(e.password),s={system:e.system.trim(),account:e.account.trim(),password:n,remark:e.remark.trim()};t?await fe.credential.update(t,{...s,updated_at:wt()}):await fe.credential.add({...s,created_at:wt(),updated_at:wt()}),await ul()}async function Iv(e){await fe.credential.delete(e),await ul()}async function pa(e){const t=await fe.credential.get(e);if(!t)throw new Error("记录不存在");return Av(t.password)}async function jv(e,t){if(!e)throw new Error("请输入旧主密码");if(t.length<6)throw new Error("新主密码至少 6 位");if(t===e)throw new Error("新主密码不能与旧主密码相同");const n=await gt("pwd_salt","");if(!n)throw new Error("密码库尚未初始化");const s=await Qo(e,n),o=await gt("pwd_verifier","");try{await bi(s,o)}catch{throw new Error("旧主密码不正确")}const a=await Qo(t,n),c=await fe.credential.toArray();let d=0;for(const h of c){if(h.id==null)continue;const y=await Dv(h.password,s),m=es+await Zo(a,y);await fe.credential.update(h.id,{password:m}),d++}return await jt("pwd_verifier",await Zo(a,cf)),jr=a,await ul(),d}async function Dv(e,t){return e?e.startsWith(es)?bi(t,e.slice(es.length)):e:""}const pf="https://daywk.linyux.cn",ja="dsh_sync_base",Da="dsh_sync_token";function hf(e){try{return localStorage.getItem(e)||""}catch{return""}}function vf(e,t){try{localStorage.setItem(e,t)}catch{}}function mf(e){try{localStorage.removeItem(e)}catch{}}async function Lr(){return hf(ja)||pf}async function Lv(e){const t=(e||"").trim().replace(/\/+$/,"");t&&t!==pf?vf(ja,t):mf(ja)}function cl(){const e=hf(Da);if(!e)return"";try{return e}catch{return""}}function La(e){e?vf(Da,e):mf(Da)}const Rv="intern_worklog",fl="dsh_session_user";function wi(){try{const e=localStorage.getItem(fl);if(!e)return null;const t=JSON.parse(e);if(t&&t.userId&&t.username)return t}catch{}return null}function Kv(e){localStorage.setItem(fl,JSON.stringify(e))}function yf(){localStorage.removeItem(fl)}const dl="dsh_cloud_creds";function gf(e,t){localStorage.setItem(dl,JSON.stringify({username:e,password:t}))}function dr(){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 Fv(){localStorage.removeItem(dl)}let ti=null;function ni(e){ti===e&&fe||(fe&&al(),tv(new ev(Rv+"_"+e)),ti=e)}async function Nv(e,t,n){const s=await Lr();let o;try{o=await fetch(s+"/api/auth/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.trim(),password:n})})}catch{throw new Error("无法连接同步服务器:请检查网络后重试")}const a=await o.json().catch(()=>({}));if(!o.ok){const c=a&&a.error||"服务返回 "+o.status;throw e==="register"&&o.status===409?new Error("云端已有同名账号且密码一致,直接登录即可"):new Error(String(c))}if(!a.userId||!a.username)throw new Error("登录响应异常");return{userId:String(a.userId),username:String(a.username)}}async function pl(e,t,n){const s=await Nv(n,e,t);ni(s.userId);const o={userId:s.userId,username:s.username};return Kv(o),gf(s.username,t),o}async function Vv(e,t){const n=(e||"").trim();if(!n||!t)throw new Error("请输入用户名与密码");return pl(n,t,"login")}async function Bv(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 位");return pl(s,t,"register")}async function Uv(){const e=dr();if(!e)return null;try{return await pl(e.username,e.password,"login")}catch{return null}}async function qv(){ei(),al(),ti=null,yf()}function Hv(){ei(),al(),ti=null,yf(),Fv()}async function Wv(e,t){if(!wi())throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const s=dr();if(!s||s.password!==e)throw new Error("旧密码不正确");const o=await Lr();let a;try{a=await fetch(o+"/api/auth/password",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+bf()},body:JSON.stringify({oldPassword:e,newPassword:t})})}catch{throw new Error("无法连接同步服务器")}if(!a.ok){const c=await a.json().catch(()=>({}));throw new Error(c&&c.error||"修改失败 "+a.status)}gf(s.username,t)}async function zv(){if(!wi())throw new Error("未登录");const t=await Lr();let n;try{n=await fetch(t+"/api/auth/delete",{method:"POST",headers:{Authorization:"Bearer "+bf()}})}catch{throw new Error("无法连接同步服务器")}if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s&&s.error||"删除失败 "+n.status)}Hv()}function bf(){return cl()}const Ra=F(null),Ka=F(null),Ws=F(0);function er(){Ws.value++}const Jr=F(""),Fs=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","transaction"],Gr=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]),Gv=Lr;function Oo(e){return JSON.stringify(e)}async function Yv(e){return fe.table(e).toArray()}function Mo(e,t){return e==="setting"?t.key:t.id}async function Jv(){for(const e of Fs){const t=fe.table(e),n=await t.toArray();for(const s of n){if(e==="setting"&&Gr.has(s.key))continue;const o={};s.uuid||(o.uuid=Xv()),!s.updated_at&&s.created_at&&(o.updated_at=s.created_at),Object.keys(o).length&&await t.update(Mo(e,s),o)}}}function Xv(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"u"+Date.now().toString(36)+Math.random().toString(36).slice(2,10)}async function Qv(){return dr()!=null}async function Zv(){try{return localStorage.getItem("dsh_last_sync")||""}catch{return""}}async function em(e){try{localStorage.setItem("dsh_last_sync",e)}catch{}}async function wf(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 tm(e,t){let n=cl();return n||(n=await wf(e,t),La(n),n)}async function _f(){const e=dr();if(!e)throw new Error("未登录");const t=await Lr(),n=await fetch(t+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e.username,password:e.password})});if(!n.ok)throw new Error("云端账号校验失败:"+n.status)}async function Fa(){const e=dr();if(!e)throw new Error("未登录,无法同步");return Sf({baseUrl:await Lr(),username:e.username,password:e.password})}async function kf(){try{await Fa()}catch(e){Jr.value=e instanceof Error?e.message:String(e);try{await Fa()}catch{}throw e}}function xf(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 Cf(){const e=await fe.work_log.toArray(),t=await fe.project.toArray();return{workLog:new Map(e.map(n=>[n.id,n])),project:new Map(t.map(n=>[n.id,n]))}}let Ps=!1,Io=!1,Na=!1,Xr=null,_n=null,Va="",Ba=!1,jo=null;async function Qr(){if(Ps){Io=!0;return}try{if(!await Qv())return;await Sf(await nm()),Jr.value=""}catch(e){Jr.value=e instanceof Error?e.message:String(e)}}async function nm(){const e=dr();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await Lr(),username:e.username,password:e.password}}function rm(){if(Ba)return;Ba=!0,jo=Zh(async()=>{const t={};for(const n of Fs)t[n]=await fe.table(n).count();return t}).subscribe({next:()=>{Na||Ps||(Xr&&globalThis.clearTimeout(Xr),Xr=globalThis.setTimeout(()=>{Qr()},3e3))},error:()=>{}})}function sm(){jo&&(jo.unsubscribe(),jo=null),_n&&(_n.close(),_n=null,Va=""),Xr&&(globalThis.clearTimeout(Xr),Xr=null),Ba=!1}function om(e,t){const n=e+"|"+t;if(!(_n&&Va===n)){_n&&(_n.close(),_n=null);try{_n=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),Va=n,_n.onmessage=()=>{Qr()}}catch{_n=null}}}async function Sf(e){if(Ps)return Io=!0,{pushed:0,pulled:0,removed:0,errors:0,at:""};Ps=!0,Na=!0;try{const t=await im(e);return Io&&(Io=!1,globalThis.setTimeout(()=>{Qr()},800)),t}finally{Ps=!1,Na=!1}}async function im(e){const t=e.baseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("请先配置同步服务地址");await Jv();const n=await Cf(),s=await fe.sync_mirror.toArray(),o=new Map;for(const te of s)o.set(te.table+"|"+te.uuid,te);const a={},c=[];let d=0;for(const te of Fs){let ue=await Yv(te);te==="setting"&&(ue=ue.filter(L=>!Gr.has(L.key)));const P=new Map;for(const L of ue)P.set(L.uuid,L);for(const[L,J]of P){const ce=xf(te,J,n),ie=Oo(ce),Q=o.get(te+"|"+L);(!Q||Q.hash!==ie)&&(a[te]=a[te]||[],a[te].push(ce),d++)}for(const[L,J]of o)L.startsWith(te+"|")&&!P.has(J.uuid)&&c.push({table:te,uuid:J.uuid,deleted_at:wt()});a[te]=a[te]||[]}c.push(...fm());const h=await tm(t,e),y=te=>fetch(t+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+te},body:JSON.stringify({device:"client",tables:a,tombstones:c})});let m=await y(h);if(m.status===401){La("");const te=await wf(t,e);La(te),m=await y(te)}if(!m.ok)throw new Error("同步服务返回 "+m.status);const w=await m.json(),C=w.tables||{},O=w.tombstones||[],N=await um(C,O);om(t,cl()||h);const ee=wt();return await em(ee),(N.changed>0||N.removed>0||d>0)&&er(),{pushed:d,pulled:N.changed,removed:N.removed,errors:0,at:ee}}function Ef(){var t;return"dsh_idmap_"+(((t=dr())==null?void 0:t.username)||"anon")}function am(){try{const e=localStorage.getItem(Ef());if(e)return JSON.parse(e)}catch{}return{}}function lm(e){try{localStorage.setItem(Ef(),JSON.stringify(e))}catch{}}async function um(e,t){const n=am(),s=new Set(t.map(C=>C.table+"|"+C.uuid)),o=new Map;for(const C of await fe.sync_mirror.toArray())o.set(C.table+"|"+C.uuid,C);const a=new Set(Array.from(o.keys()).map(C=>C.split("|")[1]));let c=0,d=0;const h={},y={};for(const C of Fs){const O=fe.table(C),N=await O.toArray(),ee=new Map(N.map(S=>[Mo(C,S),S])),te=new Map(N.filter(S=>S.uuid).map(S=>[S.uuid,S])),ue=(e[C]||[]).filter(S=>!s.has(C+"|"+S.uuid)),P=ue.filter(S=>!(C==="setting"&&Gr.has(S.key))),L=ue.filter(S=>C==="setting"&&Gr.has(S.key));for(const S of L)cm(C,S.uuid);const J=C==="setting"?[]:N.filter(S=>S.uuid&&!a.has(S.uuid)&&!s.has(C+"|"+S.uuid)),ce={v:Math.max(0,...N.map(S=>Number(S.id)||0))};P.length;const ie=[];for(const S of P){const oe={...S};if(C==="log_item"){const xe=oe.wuuid?h[oe.wuuid]:void 0;if(!xe)continue;oe.work_log_id=xe,delete oe.wuuid,oe.project_id=oe.puuid?y[oe.puuid]??null:null,delete oe.puuid}let ge=Mo(C,S);if(C==="setting")ge=S.key;else{const xe=n[C]&&n[C][S.uuid],Fe=te.get(S.uuid);Fe&&Fe.id!=null?ge=Fe.id:typeof xe=="number"?ge=xe:ge=++ce.v}const Y={...oe,id:ge};C==="setting"&&Gr.has(Y.key)||(ie.push(Y),C==="work_log"&&(h[S.uuid]=ge),C==="project"&&(y[S.uuid]=ge))}const Q=ie.concat(J);for(const S of Q){const oe=ee.get(Mo(C,S));(!oe||Oo(oe)!==Oo(S))&&c++}d+=N.filter(S=>S.uuid&&!ie.some(oe=>oe.uuid===S.uuid)&&!s.has(C+"|"+S.uuid)).length,await O.clear(),Q.length&&await O.bulkPut(Q);const A={};for(const S of Q)S.uuid&&(A[S.uuid]=S.id);n[C]=A}lm(n);const m=await Cf(),w=[];for(const C of Fs){const O=await fe.table(C).toArray();for(const N of O)C==="setting"&&Gr.has(N.key)||N.uuid&&w.push({table:C,uuid:N.uuid,hash:Oo(xf(C,N,m))})}return await fe.sync_mirror.clear(),w.length&&await fe.sync_mirror.bulkAdd(w.map(C=>({...C}))),await fe.tombstone.clear(),{changed:c,removed:d+ri.length}}const ri=[];function cm(e,t){ri.some(n=>n.table===e&&n.uuid===t)||ri.push({table:e,uuid:t,deleted_at:wt()})}function fm(){return ri.splice(0)}const dm=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);async function _t(){await kf()}async function gt(e,t){const n=await fe.setting.get(e);return n?n.value:t}async function jt(e,t){await fe.setting.put({key:e,value:t}),dm.has(e)||await _t()}async function Dr(){const e=await Promise.all([gt("work_start","09:00"),gt("work_end","18:00"),gt("grace_minutes","10"),gt("lunch_minutes","60"),gt("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 pm(){const e=await gt("last_project",""),t=await gt("last_category","dev");return{project_id:e?Number(e):null,category:t||"dev"}}async function hm(){return gt("last_location","")}async function vm(e,t){const n=t.trim();await jt("last_location",n),n&&await si(n);let s=!1;const o=await yn(e);o&&o.id?(o.location||"")!==n&&(await fe.attendance.update(o.id,{location:n||null}),s=!0):n&&(await fe.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:wt()}),s=!0),s&&await _t()}async function hl(){const e=await gt("location_presets","");if(!e)return Ku.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 Ku.slice()}async function $f(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await jt("location_presets",JSON.stringify(t))}async function si(e){const t=e.trim();if(!t)return;const n=await hl();n.includes(t)||await $f([...n,t])}async function Ns(e=!1){const t=await fe.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function mm(e){await fe.project.add({name:e.trim(),archived:0,created_at:wt()}),await _t()}async function ym(e,t){await fe.project.update(e,{name:t.trim()}),await _t()}async function gm(e,t){await fe.project.update(e,{archived:t?1:0}),await _t()}async function yn(e){return fe.attendance.where("date").equals(e).first()}async function Tf(e,t){const n=((t===void 0?await gt("last_location",""):t)||"").trim();let s=!1;const o=await yn(e);if(o&&o.id){if(!o.clock_in_at){const a={clock_in_at:wt()};n&&(a.location=n),await fe.attendance.update(o.id,a),s=!0}n&&(await gt("last_location","")!==n&&await jt("last_location",n),await si(n)),s&&await _t();return}await fe.attendance.add({date:e,clock_in_at:wt(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:wt()}),n&&(await jt("last_location",n),await si(n)),await _t()}async function bm(e){const t=await yn(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&(await fe.attendance.update(t.id,{clock_out_at:wt()}),await _t())}async function wm(){const e=new Date,t=Nn(e);let n="";if(e.getHours()<4){const s=await yn(Kn(t,-1));s&&s.id&&s.clock_in_at&&!s.clock_out_at&&(await fe.attendance.update(s.id,{clock_out_at:wt()}),n=s.date)}if(!n){const s=await yn(t);s&&s.id&&s.clock_in_at&&!s.clock_out_at&&(await fe.attendance.update(s.id,{clock_out_at:wt()}),n=s.date)}if(!n)throw new Error("没有进行中的打卡");return await _t(),n}async function _m(e,t,n,s,o){(o||"").trim()&&await si(o);const a=await yn(e),c={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:s||null,location:(o||"").trim()||null,created_at:wt()};a&&a.id?await fe.attendance.update(a.id,c):await fe.attendance.add(c),await _t()}async function km(e,t,n){const s=(n||"").trim();if(!s)return;const o=await yn(e);o&&o.id&&(await fe.attendance.update(o.id,{[t]:e+"T"+s+":00"}),await _t())}async function _i(e,t){return fe.attendance.where("date").between(e,t,!0,!0).toArray()}async function xm(e,t){const n=await yn(e);if(t){const s={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:wt()};n&&n.id?await fe.attendance.update(n.id,s):await fe.attendance.add({...s,note:null,location:null})}else n&&n.id&&await fe.attendance.update(n.id,{kind:"normal"});await _t()}async function Cm(e){const t=await fe.work_log.where("date").equals(e).first();return t||{id:await fe.work_log.add({date:e,created_at:wt()}),date:e,created_at:wt()}}async function Sm(e){return fe.work_log.where("date").equals(e).first()}async function Em(e){const t=await Sm(e);return!t||!t.id?[]:(await fe.log_item.where("work_log_id").equals(t.id).toArray()).sort((s,o)=>o.id-s.id)}async function $m(e,t){const n=await fe.work_log.where("date").equals(e).first();let s;n&&n.id?s=n:s=await Cm(e),await fe.table("log_item").add({work_log_id:s.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:wt()});const o=t.project_id?String(t.project_id):"";await gt("last_project","")!==o&&await jt("last_project",o),await gt("last_category","")!==t.category&&await jt("last_category",t.category),await _t()}async function ha(e,t){await fe.table("log_item").update(e,t),await _t()}async function Tm(e){await fe.table("log_item").delete(e),await _t()}async function ki(e,t){const n=await fe.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 fe.table("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,c)=>a.date===c.date?a.id-c.id:a.date<c.date?-1:1)}async function vl(e){return fe.weekly_note.where("week_start").equals(e).first()}async function Pm(e,t){const n=await vl(e);n&&n.id?await fe.weekly_note.update(n.id,t):await fe.weekly_note.add({week_start:e,highlights:t.highlights??null,challenges:t.challenges??null,plan_next:t.plan_next??null,created_at:wt()}),await _t()}async function Am(e,t){return fe.weekly_note.where("week_start").between(e,t,!0,!0).toArray()}async function Om(){return(await fe.memo.toArray()).sort((t,n)=>t.updated_at<n.updated_at?1:-1)}async function Mm(e,t){const n=wt(),s=await fe.memo.add({title:e.trim(),content:t,created_at:n,updated_at:n});return await _t(),{id:s,title:e.trim(),content:t,created_at:n,updated_at:n}}async function Im(e,t,n){await fe.memo.update(e,{title:t.trim(),content:n,updated_at:wt()}),await _t()}async function jm(e){await fe.memo.delete(e),await _t()}async function Dm(e,t=8){const n=e.trim().toLowerCase();if(!n)return[];const s=await fe.work_log.toArray(),o=new Map(s.map(c=>[c.id,c.date]));return(await fe.table("log_item").toArray()).filter(c=>((c.content||"")+" "+(c.takeaway||"")+" "+(c.remark||"")).toLowerCase().includes(n)).sort((c,d)=>d.id-c.id).slice(0,t).map(c=>({...c,date:o.get(c.work_log_id)||""}))}async function Lm(e,t=4){const n=e.trim().toLowerCase();return n?(await fe.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 Rm(e,t){return fe.table("transaction").where("date").between(e,t,!0,!0).toArray()}async function Km(e){await fe.table("transaction").add({...e,created_at:wt()}),await _t()}async function Fm(e,t){await fe.table("transaction").update(e,{...t}),await _t()}async function Nm(e){await fe.table("transaction").delete(e),await _t()}async function Vm(e,t){await fe.table("transaction").update(e,{reimbursed:1}),await _t()}async function Bm(){const e=await Promise.all([fe.project.toArray(),fe.work_log.toArray(),fe.table("log_item").toArray(),fe.attendance.toArray(),fe.weekly_note.toArray(),fe.setting.toArray(),fe.memo.toArray(),fe.credential.toArray(),fe.table("transaction").toArray()]);return JSON.stringify({schema_version:nv,exported_at:wt(),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 Um(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,s=fe.table("log_item"),o=fe.table("transaction");await fe.transaction("rw",[fe.project,fe.work_log,s,fe.attendance,fe.weekly_note,fe.setting,fe.memo,fe.credential,o],async()=>{await Promise.all([fe.project.clear(),fe.work_log.clear(),s.clear(),fe.attendance.clear(),fe.weekly_note.clear(),fe.setting.clear(),fe.memo.clear(),fe.credential.clear(),o.clear()]),n.project&&n.project.length&&await fe.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await fe.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await s.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await fe.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await fe.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await fe.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await fe.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await fe.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await o.bulkAdd(n.transaction)}),await _t()}function Eo(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(kv(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=Eo(Vn(e.clock_in_at)),c=Eo(Vn(e.clock_out_at)),d=Eo(n.work_start),h=Eo(n.work_end);let y="normal";!o&&a>d+n.grace_minutes?y="late":!o&&c<h&&(y="early");const m=xv(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 Do=F([]);let qm=0;function Ue(e){const t=++qm;Do.value.push({id:t,text:e}),setTimeout(()=>{Do.value=Do.value.filter(n=>n.id!==t)},2e3)}function Hm(){return Do}const Wm={class:"day-panel"},zm={class:"dp-head"},Gm={class:"dp-date"},Ym={class:"card sec"},Jm={class:"att-grid"},Xm={class:"att-cell"},Qm={key:0,class:"edit-row"},Zm={key:1,class:"att-val"},ey={class:"att-cell"},ty={key:0,class:"edit-row"},ny={key:1,class:"att-val"},ry={class:"att-cell"},sy=["list"],oy=["id"],iy=["value"],ay={class:"att-cell"},ly={class:"att-val status-val"},uy={key:0,class:"tag"},cy={key:1,class:"muted"},fy={key:0,class:"att-note muted"},dy={class:"att-actions"},py=["disabled"],hy=["disabled"],vy=["disabled"],my=["disabled"],yy={key:0,class:"card sec makeup"},gy={class:"form-grid"},by={class:"field"},wy={class:"field"},_y={class:"field span2"},ky=["list"],xy={class:"field span2"},Cy={key:0,class:"form-error"},Sy={class:"form-footer"},Ey={class:"card sec"},$y={class:"form-grid"},Ty={class:"field span2"},Py={key:0,class:"form-error"},Ay={class:"field"},Oy=["value"],My={class:"field"},Iy=["value"],jy={class:"field"},Dy={class:"field"},Ly={class:"field span2"},Ry={class:"form-footer"},Ky=["disabled"],Fy=["disabled"],Ny={class:"list-sec"},Vy={class:"sec-title"},By={key:0,class:"empty muted"},Uy={class:"item-main"},qy={class:"tag"},Hy=["onClick"],Wy={key:0,class:"muted item-meta"},zy={key:1,class:"muted num item-meta"},Gy=["onClick"],Yy=["onClick"],Jy=["onClick"],Xy=["onClick"],Qy={key:0,class:"item-sub"},Zy={key:0,class:"muted2"},eg={key:1,class:"muted"},tg={key:1,class:"dp-foot muted num"},ng=Bt({__name:"DayPanel",props:{date:{}},setup(e){const t=e,n=F(!0),s=F(null),o=F(void 0),a=F([]),c=F([]),d=F(""),h=F([]),y=at(()=>"loc-list-"+t.date),m=at(()=>t.date===xt());async function w(){n.value=!0,s.value=await Dr(),o.value=await yn(t.date),a.value=await Em(t.date),c.value=await Ns(!0),h.value=await hl(),d.value=o.value&&o.value.location||await hm(),n.value=!1}mn(w),vt(()=>t.date,w),vt(Ws,()=>{w()});const C=at(()=>c.value.filter(U=>U.archived!==1));function O(U){if(!U)return"";const q=c.value.find(G=>G.id===U);return q?q.name:"已删除项目"}const N=at(()=>s.value?zs(o.value,t.date,s.value,m.value):null),ee=at(()=>a.value.reduce((U,q)=>U+(q.minutes||0),0)),te=F(!1);async function ue(){te.value||(te.value=!0,await Tf(t.date,d.value),await w(),er(),Ue("上班打卡成功"),te.value=!1)}async function P(){te.value||(te.value=!0,await bm(t.date),await w(),er(),Ue("下班打卡成功"),te.value=!1)}async function L(){await vm(t.date,d.value),er(),Ue("地点已更新")}const J=F(!1),ce=at(()=>{var U;return((U=o.value)==null?void 0:U.kind)==="leave"});function ie(){if(o.value&&o.value.clock_in_at){J.value=!0;return}Q(!0)}async function Q(U){J.value=!1,await xm(t.date,U),await w(),er(),Ue(U?"已标记为休假":"已取消休假")}const A=F(null),S=F(""),oe=F(null);vt(A,async U=>{var q;U&&(await rs(),(q=oe.value)==null||q.focus())});function ge(U){var G,$e;const q=U==="in"?(G=o.value)==null?void 0:G.clock_in_at:($e=o.value)==null?void 0:$e.clock_out_at;A.value=U,S.value=q?Vn(q):U==="in"?"09:00":"18:00"}function Y(){A.value=null}async function xe(){const U=A.value;U&&(A.value=null,S.value&&(await km(t.date,U==="in"?"clock_in_at":"clock_out_at",S.value),await w(),er(),Ue("打卡时间已修改")))}const Fe=F(!1),rt=F("09:00"),We=F("18:00"),Ye=F(""),me=F(""),Me=F("");function Ne(){me.value=d.value,Me.value="",Fe.value=!Fe.value}async function De(){if(!rt.value||!We.value){Me.value="请填写上班与下班时间";return}await _m(t.date,t.date+"T"+rt.value+":00",t.date+"T"+We.value+":00",Ye.value.trim(),me.value),Fe.value=!1,Ye.value="",Me.value="",await w(),er(),Ue("补卡已保存")}const Ce=F(""),X=F("");vt(Ce,()=>{X.value&&(X.value="")});const Z=F(null),ke=F("dev"),Be=F(null),dt=F(""),Jt=F(""),Xt=F(!1),je=at(()=>!!(Ce.value.trim()||Be.value||dt.value.trim()||Jt.value.trim()));mn(async()=>{const U=await pm();Z.value=U.project_id,ke.value=U.category});function k(){Ce.value="",Be.value=null,dt.value="",Jt.value="",X.value=""}async function _(){const U=Ce.value.trim();if(!U){X.value="请填写工作内容";return}Xt.value||(Xt.value=!0,await $m(t.date,{content:U,project_id:Z.value,category:ke.value,minutes:Be.value&&Be.value>0?Be.value:null,takeaway:dt.value.trim()||null,remark:Jt.value.trim()||null}),k(),await w(),Ue("记录已添加"),Xt.value=!1)}const x=F(null);function z(U){x.value=U}async function ne(U){const q=U.id,G={content:U.content,project_id:U.project_id,category:U.category,minutes:U.minutes,takeaway:U.takeaway,remark:U.remark,is_milestone:U.is_milestone,needs_followup:U.needs_followup};await ha(q,G),x.value=null,await w(),Ue("修改已保存")}async function le(U){await ha(U.id,{is_milestone:U.is_milestone?0:1}),await w()}async function be(U){await ha(U.id,{needs_followup:U.needs_followup?0:1}),await w()}const ve=F(null);async function ae(){ve.value&&ve.value.id&&await Tm(ve.value.id),ve.value=null,await w(),Ue("记录已删除")}return(U,q)=>(K(),H("div",Wm,[u("div",zm,[u("div",Gm,se(Zt(uf)(e.date)),1)]),u("div",Ym,[q[25]||(q[25]=u("div",{class:"sec-title"},"出勤信息",-1)),u("div",Jm,[u("div",Xm,[q[21]||(q[21]=u("label",null,"上班时间",-1)),A.value==="in"?(K(),H("div",Qm,[Te(u("input",{ref_key:"timeInput",ref:oe,type:"time",class:"input time-input","onUpdate:modelValue":q[0]||(q[0]=G=>S.value=G),onKeydown:[Dt(xe,["enter"]),Dt(Y,["esc"])]},null,544),[[Le,S.value]]),u("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),u("button",{class:"btn btn-sm",onClick:Y},"取消")])):(K(),H("div",Zm,[u("span",{class:tt(["num",{"val-empty":!(o.value&&o.value.clock_in_at)}])},se(o.value&&o.value.clock_in_at?Zt(Vn)(o.value.clock_in_at):"未打卡"),3),o.value&&o.value.id?(K(),H("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:q[1]||(q[1]=G=>ge("in"))},[Oe(ut,{name:"edit",size:13})])):Ee("",!0)]))]),u("div",ey,[q[22]||(q[22]=u("label",null,"下班时间",-1)),A.value==="out"?(K(),H("div",ty,[Te(u("input",{ref_key:"timeInput",ref:oe,type:"time",class:"input time-input","onUpdate:modelValue":q[2]||(q[2]=G=>S.value=G),onKeydown:[Dt(xe,["enter"]),Dt(Y,["esc"])]},null,544),[[Le,S.value]]),u("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),u("button",{class:"btn btn-sm",onClick:Y},"取消")])):(K(),H("div",ny,[u("span",{class:tt(["num",{"val-empty":!(o.value&&o.value.clock_out_at)}])},se(o.value&&o.value.clock_out_at?Zt(Vn)(o.value.clock_out_at):"未打卡"),3),o.value&&o.value.id?(K(),H("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:q[3]||(q[3]=G=>ge("out"))},[Oe(ut,{name:"edit",size:13})])):Ee("",!0)]))]),u("div",ry,[q[23]||(q[23]=u("label",null,"上班地点",-1)),Te(u("input",{class:"input","onUpdate:modelValue":q[4]||(q[4]=G=>d.value=G),list:y.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:L},null,40,sy),[[Le,d.value]]),u("datalist",{id:y.value},[(K(!0),H(Re,null,ct(h.value,G=>(K(),H("option",{key:G,value:G},null,8,iy))),128))],8,oy)]),u("div",ay,[q[24]||(q[24]=u("label",null,"考勤状态",-1)),u("div",ly,[N.value?(K(),H(Re,{key:0},[u("span",{class:tt(["dot",N.value.status])},null,2),u("span",null,se(N.value.label),1),o.value&&o.value.kind==="makeup"?(K(),H("span",uy,"补卡")):Ee("",!0)],64)):(K(),H("span",cy,"--"))])])]),o.value&&o.value.note?(K(),H("div",fy,"补卡说明:"+se(o.value.note),1)):Ee("",!0),u("div",dy,[m.value&&(!o.value||!o.value.clock_in_at)?(K(),H("button",{key:0,class:"btn btn-primary btn-sm",disabled:te.value,onClick:ue},"上班打卡",8,py)):m.value&&o.value&&o.value.clock_in_at&&!o.value.clock_out_at?(K(),H("button",{key:1,class:"btn btn-primary btn-sm",disabled:te.value,onClick:P},"下班打卡",8,hy)):Ee("",!0),!m.value&&(!o.value||!o.value.clock_in_at)?(K(),H("button",{key:2,class:"btn btn-sm",onClick:Ne},"补卡")):Ee("",!0),ce.value?(K(),H("button",{key:4,class:"btn btn-sm",disabled:te.value,onClick:q[5]||(q[5]=G=>Q(!1))},"取消休假",8,my)):(K(),H("button",{key:3,class:"btn btn-sm",disabled:te.value,onClick:ie},"标记休假",8,vy))])]),Fe.value?(K(),H("div",yy,[q[30]||(q[30]=u("div",{class:"sec-title"},"补卡登记",-1)),u("div",gy,[u("div",by,[q[26]||(q[26]=u("label",null,"上班时间",-1)),Te(u("input",{type:"time",class:"input","onUpdate:modelValue":q[6]||(q[6]=G=>rt.value=G)},null,512),[[Le,rt.value]])]),u("div",wy,[q[27]||(q[27]=u("label",null,"下班时间",-1)),Te(u("input",{type:"time",class:"input","onUpdate:modelValue":q[7]||(q[7]=G=>We.value=G)},null,512),[[Le,We.value]])]),u("div",_y,[q[28]||(q[28]=u("label",null,"上班地点",-1)),Te(u("input",{class:"input",list:y.value,"onUpdate:modelValue":q[8]||(q[8]=G=>me.value=G),placeholder:"可直接输入"},null,8,ky),[[Le,me.value]])]),u("div",xy,[q[29]||(q[29]=u("label",null,"补卡原因",-1)),Te(u("input",{class:"input","onUpdate:modelValue":q[9]||(q[9]=G=>Ye.value=G),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[Le,Ye.value]])])]),Me.value?(K(),H("div",Cy,se(Me.value),1)):Ee("",!0),u("div",Sy,[u("button",{class:"btn btn-sm",onClick:q[10]||(q[10]=G=>Fe.value=!1)},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:De},"保存补卡")])])):Ee("",!0),u("div",Ey,[q[38]||(q[38]=u("div",{class:"sec-head"},[u("span",{class:"sec-title"},"新增工作记录"),u("span",{class:"muted form-hint"},"内容必填,其余选填")],-1)),u("div",$y,[u("div",Ty,[q[31]||(q[31]=u("label",null,"工作内容(必填)",-1)),Te(u("input",{class:tt(["input",{invalid:X.value}]),"onUpdate:modelValue":q[11]||(q[11]=G=>Ce.value=G),placeholder:"做了什么,一句话一条",onKeydown:Dt(_,["enter"])},null,34),[[Le,Ce.value]]),X.value?(K(),H("div",Py,se(X.value),1)):Ee("",!0)]),u("div",Ay,[q[33]||(q[33]=u("label",null,"所属项目",-1)),Te(u("select",{class:"select","onUpdate:modelValue":q[12]||(q[12]=G=>Z.value=G)},[q[32]||(q[32]=u("option",{value:null},"无项目",-1)),(K(!0),H(Re,null,ct(C.value,G=>(K(),H("option",{key:G.id,value:G.id},se(G.name),9,Oy))),128))],512),[[Fn,Z.value]])]),u("div",My,[q[34]||(q[34]=u("label",null,"工作分类",-1)),Te(u("select",{class:"select","onUpdate:modelValue":q[13]||(q[13]=G=>ke.value=G)},[(K(!0),H(Re,null,ct(Zt(Hs),G=>(K(),H("option",{key:G.key,value:G.key},se(G.label),9,Iy))),128))],512),[[Fn,ke.value]])]),u("div",jy,[q[35]||(q[35]=u("label",null,"耗时(分钟)",-1)),Te(u("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":q[14]||(q[14]=G=>Be.value=G),placeholder:"选填"},null,512),[[Le,Be.value,void 0,{number:!0}]])]),u("div",Dy,[q[36]||(q[36]=u("label",null,"主要收获",-1)),Te(u("input",{class:"input","onUpdate:modelValue":q[15]||(q[15]=G=>dt.value=G),placeholder:"一句话:学到了什么"},null,512),[[Le,dt.value]])]),u("div",Ly,[q[37]||(q[37]=u("label",null,"备注",-1)),Te(u("textarea",{class:"textarea","onUpdate:modelValue":q[16]||(q[16]=G=>Jt.value=G),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Le,Jt.value]])])]),u("div",Ry,[u("button",{class:"btn btn-sm",disabled:!je.value,onClick:k},"重置",8,Ky),u("button",{class:"btn btn-primary btn-sm",disabled:Xt.value,onClick:_},"添加记录",8,Fy)])]),u("div",Ny,[u("div",Vy,"工作记录("+se(a.value.length)+")",1),!a.value.length&&!n.value?(K(),H("div",By,"暂无记录")):Ee("",!0),(K(!0),H(Re,null,ct(a.value,G=>(K(),H("div",{key:G.id,class:"item"},[u("div",Uy,[u("span",qy,se(Zt(ll)(G.category)),1),u("span",{class:"item-content",title:"点击编辑",onClick:$e=>z(G)},se(G.content),9,Hy),G.project_id?(K(),H("span",Wy,se(O(G.project_id)),1)):Ee("",!0),G.minutes?(K(),H("span",zy,se(G.minutes)+" 分钟",1)):Ee("",!0),q[39]||(q[39]=u("span",{class:"flex1"},null,-1)),u("button",{class:"icon-btn",title:"编辑完整信息",onClick:$e=>z(G)},[Oe(ut,{name:"edit",size:14})],8,Gy),u("button",{class:tt(["icon-btn",{active:G.is_milestone===1}]),title:"成果标记",onClick:$e=>le(G)},[Oe(ut,{name:"star",size:14})],10,Yy),u("button",{class:tt(["icon-btn",{"active-warn":G.needs_followup===1}]),title:"待跟进",onClick:$e=>be(G)},[Oe(ut,{name:"flag",size:14})],10,Jy),u("button",{class:"icon-btn",title:"删除",onClick:$e=>ve.value=G},[Oe(ut,{name:"close",size:14})],8,Xy)]),G.takeaway||G.remark?(K(),H("div",Qy,[G.takeaway?(K(),H("div",Zy,"收获:"+se(G.takeaway),1)):Ee("",!0),G.remark?(K(),H("div",eg,"备注:"+se(G.remark),1)):Ee("",!0)])):Ee("",!0)]))),128)),a.value.length?(K(),H("div",tg,[rn(" 共 "+se(a.value.length)+" 条事项 ",1),ee.value?(K(),H(Re,{key:0},[rn(" · "+se((ee.value/60).toFixed(1))+" 小时",1)],64)):Ee("",!0)])):Ee("",!0)]),Oe(lr,{open:!!ve.value,title:"删除确认",message:ve.value?"将删除工作记录「"+ve.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:q[17]||(q[17]=G=>ve.value=null),onConfirm:ae},null,8,["open","message"]),Oe(lr,{open:J.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:q[18]||(q[18]=G=>J.value=!1),onConfirm:q[19]||(q[19]=G=>Q(!0))},null,8,["open"]),Oe(_v,{open:!!x.value,item:x.value,projects:c.value,date:e.date,onCancel:q[20]||(q[20]=G=>x.value=null),onSave:ne},null,8,["open","item","projects","date"])]))}}),Pf=Yt(ng,[["__scopeId","data-v-2e90c9d8"]]),rg={class:"cal-page"},sg={class:"cal-toolbar"},og={class:"cal-title num"},ig={class:"cal-head"},ag={class:"cal-grid"},lg=["title","onClick"],ug={class:"cal-marks"},cg={key:0,class:"drawer"},fg={class:"drawer-head"},dg={class:"drawer-body"},pg=Bt({__name:"CalendarView",setup(e){const t=F(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=["一","二","三","四","五","六","日"],c=at(()=>{const J=(new Date(n.value,s.value,1).getDay()+6)%7,ce=new Date(n.value,s.value+1,0).getDate(),ie=[];for(let Q=0;Q<J;Q++)ie.push({date:"",inMonth:!1,weekend:!1});for(let Q=1;Q<=ce;Q++){const A=new Date(n.value,s.value,Q),S=A.getDay();ie.push({date:Nn(A),inMonth:!0,weekend:S===0||S===6})}return ie}),d=F(new Map),h=xt();async function y(){var oe;const L=Nn(new Date(n.value,s.value,1)),J=Nn(new Date(n.value,s.value+1,0)),ce=await Promise.all([Dr(),_i(L,J),ki(L,J)]),ie=ce[0],Q=new Map(ce[1].map(ge=>[ge.date,ge])),A=ce[2],S=new Map;for(const ge of c.value){if(!ge.inMonth)continue;const Y=zs(Q.get(ge.date),ge.date,ie,ge.date===h),xe=A.filter(Fe=>Fe.date===ge.date);S.set(ge.date,{status:Y.status,label:Y.label,location:((oe=Q.get(ge.date))==null?void 0:oe.location)||"",hasLog:xe.length>0,hasMilestone:xe.some(Fe=>Fe.is_milestone===1)})}d.value=S}vt([n,s],y,{immediate:!0}),vt(Ws,()=>{y()});function m(L){var J;return((J=d.value.get(L))==null?void 0:J.status)??""}function w(L){const J=d.value.get(L);return J?L+" · "+J.label+(J.location?" · "+J.location:""):L}function C(L){var J;return!!((J=d.value.get(L))!=null&&J.hasLog)}function O(L){var J;return!!((J=d.value.get(L))!=null&&J.hasMilestone)}function N(){t.value=Xo(t.value,-1)}function ee(){t.value=Xo(t.value,1)}function te(){t.value=xt()}const ue=F(null);function P(L,J){J&&(ue.value=L)}return vt(Ra,L=>{L&&(t.value=L,ue.value=L,Ra.value=null)},{immediate:!0}),(L,J)=>(K(),H("div",rg,[u("div",sg,[u("button",{class:"icon-btn",onClick:N},[Oe(ut,{name:"chevron-left",size:16})]),u("span",og,se(o.value),1),u("button",{class:"icon-btn",onClick:ee},[Oe(ut,{name:"chevron-right",size:16})]),u("button",{class:"btn btn-sm",onClick:te},"回到今天")]),u("div",ig,[(K(),H(Re,null,ct(a,ce=>u("span",{key:ce,class:"cal-week muted"},se(ce),1)),64))]),u("div",ag,[(K(!0),H(Re,null,ct(c.value,(ce,ie)=>(K(),H("button",{key:ie,class:tt(["cal-cell",{blank:!ce.inMonth,weekend:ce.weekend,selected:ue.value===ce.date}]),title:ce.inMonth?w(ce.date):void 0,onClick:Q=>P(ce.date,ce.inMonth)},[ce.inMonth?(K(),H(Re,{key:0},[u("span",{class:tt(["daynum num",{today:ce.date===Zt(h)}])},se(Number(ce.date.slice(8,10))),3),u("span",ug,[m(ce.date)?(K(),H("span",{key:0,class:tt(["dot",m(ce.date)])},null,2)):Ee("",!0),C(ce.date)?(K(),It(ut,{key:1,name:"check-circle",size:12,class:"mark-log"})):Ee("",!0),O(ce.date)?(K(),It(ut,{key:2,name:"star",size:12,class:"mark-star"})):Ee("",!0)])],64)):Ee("",!0)],10,lg))),128))]),Oe(ss,{name:"drawer"},{default:cr(()=>[ue.value?(K(),H("aside",cg,[u("div",fg,[J[1]||(J[1]=u("span",{class:"drawer-title"},"当日详情",-1)),u("button",{class:"icon-btn",onClick:J[0]||(J[0]=ce=>ue.value=null)},[Oe(ut,{name:"close",size:16})])]),u("div",dg,[Oe(Pf,{date:ue.value},null,8,["date"])])])):Ee("",!0)]),_:1})]))}}),hg=Yt(pg,[["__scopeId","data-v-2404dfbe"]]),vg={class:"detail-page"},mg={class:"detail-toolbar"},yg=["value"],gg=["disabled"],bg=Bt({__name:"TodayView",setup(e){const t=F(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 c(d){const h=d.target.value;h&&(t.value=h)}return(d,h)=>(K(),H("div",vg,[u("div",mg,[u("button",{class:"icon-btn",title:"前一天",onClick:s},[Oe(ut,{name:"chevron-left",size:16})]),u("span",{class:tt(["date-title num",{"is-today":n.value}])},se(Zt(uf)(t.value)),3),u("button",{class:"icon-btn",title:"后一天",onClick:o},[Oe(ut,{name:"chevron-right",size:16})]),u("input",{type:"date",class:"input w-date",value:t.value,onChange:c},null,40,yg),u("button",{class:"btn btn-sm",disabled:n.value,onClick:a},"回到今天",8,gg)]),Oe(Pf,{date:t.value},null,8,["date"])]))}}),wg=Yt(bg,[["__scopeId","data-v-76243d98"]]),_g={class:"stats"},kg={class:"cards"},xg={class:"card stat-card"},Cg={class:"stat-num num"},Sg={class:"card stat-card"},Eg={class:"stat-num num"},$g={class:"card stat-card"},Tg={class:"stat-num num"},Pg={class:"card stat-card"},Ag={class:"stat-num num"},Og={class:"card section"},Mg={class:"heat"},Ig=["title"],jg={class:"two-col"},Dg={class:"card section"},Lg={class:"bar-label"},Rg={class:"bar-track"},Kg={class:"muted num bar-num"},Fg={key:0,class:"muted"},Ng={class:"card section"},Vg={class:"bar-label"},Bg={class:"bar-track"},Ug={class:"muted num bar-num"},qg={key:0,class:"muted"},Hg={class:"card section"},Wg={class:"bar-label loc-label"},zg={class:"bar-track"},Gg={class:"muted num bar-num"},Yg={key:0,class:"muted"},Jg=Bt({__name:"StatsView",setup(e){const t=F({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=F([]),s=F([]),o=F([]),a=F([]);async function c(){const y=xt(),m="2000-01-01",w=await Promise.all([Dr(),_i(m,y),ki(m,y),Ns(!0)]),C=w[0],O=w[1],N=w[2],ee=w[3],te=O.filter(Y=>Y.clock_in_at||Y.kind==="makeup");let ue=0;for(const Y of te){const xe=zs(Y,Y.date,C,Y.date===y);ue+=xe.workedMinutes??0}const P=new Set(N.map(Y=>Y.date));let L=0,J=y;for(P.has(J)||(J=Kn(y,-1));P.has(J);)L++,J=Kn(J,-1);t.value={attendDays:te.length,totalHours:(ue/60).toFixed(1),itemCount:N.length,streak:L};const ce=new Map;for(const Y of te){const xe=Y.location||"未记录";ce.set(xe,(ce.get(xe)||0)+1)}a.value=Array.from(ce.entries()).map(Y=>({name:Y[0],count:Y[1],percent:Math.round(Y[1]/(te.length||1)*100)})).sort((Y,xe)=>xe.count-Y.count);const ie=N.length||1;s.value=Hs.map(Y=>{const xe=N.filter(Fe=>Fe.category===Y.key).length;return{key:Y.key,label:Y.label,count:xe,percent:Math.round(xe/ie*100)}}).filter(Y=>Y.count>0).sort((Y,xe)=>xe.count-Y.count);const Q=new Map(ee.map(Y=>[Y.id,Y.name])),A=new Map;for(const Y of N){const xe=Y.project_id?Q.get(Y.project_id)||"已删除项目":"无项目";A.set(xe,(A.get(xe)||0)+1)}o.value=Array.from(A.entries()).map(Y=>({name:Y[0],count:Y[1],percent:Math.round(Y[1]/ie*100)})).sort((Y,xe)=>xe.count-Y.count);const S=new Map;for(const Y of N)S.set(Y.date,(S.get(Y.date)||0)+1);const oe=Ts(y),ge=[];for(let Y=11;Y>=0;Y--){const xe=Kn(oe,-7*Y),Fe=[];for(let rt=0;rt<7;rt++){const We=Kn(xe,rt);Fe.push({date:We,count:S.get(We)||0})}ge.push(Fe)}n.value=ge}mn(async()=>{await c()}),vt(Ws,()=>{c()});function d(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)=>(K(),H("div",_g,[u("div",kg,[u("div",xg,[m[0]||(m[0]=u("div",{class:"muted"},"出勤天数",-1)),u("div",Cg,se(t.value.attendDays),1)]),u("div",Sg,[m[1]||(m[1]=u("div",{class:"muted"},"累计工时(小时)",-1)),u("div",Eg,se(t.value.totalHours),1)]),u("div",$g,[m[2]||(m[2]=u("div",{class:"muted"},"记录条数",-1)),u("div",Tg,se(t.value.itemCount),1)]),u("div",Pg,[m[3]||(m[3]=u("div",{class:"muted"},"连续记录(天)",-1)),u("div",Ag,se(t.value.streak),1)])]),u("div",Og,[m[4]||(m[4]=u("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),u("div",Mg,[(K(!0),H(Re,null,ct(n.value,(w,C)=>(K(),H("div",{key:C,class:"heat-col"},[(K(!0),H(Re,null,ct(w,O=>(K(),H("span",{key:O.date,class:tt(["heat-cell","lv"+d(O.count)]),title:h(O.date,O.count)},null,10,Ig))),128))]))),128))]),m[5]||(m[5]=Up('<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))]),u("div",jg,[u("div",Dg,[m[6]||(m[6]=u("div",{class:"section-title"},"分类分布",-1)),(K(!0),H(Re,null,ct(s.value,w=>(K(),H("div",{key:w.key,class:"bar-row"},[u("span",Lg,se(w.label),1),u("span",Rg,[u("span",{class:"bar-fill",style:nr({width:w.percent+"%"})},null,4)]),u("span",Kg,se(w.count)+" 条 · "+se(w.percent)+"%",1)]))),128)),s.value.length?Ee("",!0):(K(),H("div",Fg,"暂无数据"))]),u("div",Ng,[m[7]||(m[7]=u("div",{class:"section-title"},"项目投入",-1)),(K(!0),H(Re,null,ct(o.value,w=>(K(),H("div",{key:w.name,class:"bar-row"},[u("span",Vg,se(w.name),1),u("span",Bg,[u("span",{class:"bar-fill",style:nr({width:w.percent+"%"})},null,4)]),u("span",Ug,se(w.count)+" 条 · "+se(w.percent)+"%",1)]))),128)),o.value.length?Ee("",!0):(K(),H("div",qg,"暂无数据"))])]),u("div",Hg,[m[8]||(m[8]=u("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(K(!0),H(Re,null,ct(a.value,w=>(K(),H("div",{key:w.name,class:"bar-row"},[u("span",Wg,se(w.name),1),u("span",zg,[u("span",{class:"bar-fill",style:nr({width:w.percent+"%"})},null,4)]),u("span",Gg,se(w.count)+" 天 · "+se(w.percent)+"%",1)]))),128)),a.value.length?Ee("",!0):(K(),H("div",Yg,"暂无数据"))])]))}}),Xg=Yt(Jg,[["__scopeId","data-v-73e5ba49"]]);async function Qg(e,t,n){const s=xt(),o=await Promise.all([Dr(),_i(e,t),ki(e,t),Ns(!0),Am(e,t)]),a=o[0],c=o[1],d=o[2],h=o[3],y=o[4];let m=0,w=0,C=0;for(const A of c){(A.clock_in_at||A.kind==="makeup")&&m++,A.kind==="makeup"&&C++;const S=zs(A,A.date,a,A.date===s);w+=S.workedMinutes??0}const O=new Map;for(const A of c){if(!(A.clock_in_at||A.kind==="makeup"))continue;const S=A.location||"未记录";O.set(S,(O.get(S)||0)+1)}const N=Array.from(O.entries()).map(A=>({name:A[0],count:A[1]})).sort((A,S)=>S.count-A.count),ee=d.length||1,te=Hs.map(A=>{const S=d.filter(oe=>oe.category===A.key).length;return{key:A.key,label:A.label,count:S,percent:Math.round(S/ee*100)}}).filter(A=>A.count>0).sort((A,S)=>S.count-A.count),ue=new Map(h.map(A=>[A.id,A.name])),P=new Map;for(const A of d){const S=A.project_id?ue.get(A.project_id)||"已删除项目":"无项目";P.set(S,(P.get(S)||0)+1)}const L=Array.from(P.entries()).map(A=>({name:A[0],count:A[1]})).sort((A,S)=>S.count-A.count),J=d.filter(A=>A.is_milestone===1).map(A=>({date:A.date,content:A.content})),ce=d.filter(A=>A.needs_followup===1).map(A=>({date:A.date,content:A.content,remark:A.remark||""})),ie=d.filter(A=>!!A.takeaway).map(A=>({date:A.date,text:A.takeaway})),Q=y.map(A=>({weekStart:A.week_start,highlights:A.highlights||"",challenges:A.challenges||"",plan_next:A.plan_next||""}));return{range:{start:e,end:t,label:n},attendDays:m,totalHours:(w/60).toFixed(1),makeupCount:C,leaveCount:c.filter(A=>A.kind==="leave").length,itemCount:d.length,categoryStats:te,projectStats:L,locationStats:N,milestones:J,followups:ce,takeaways:ie,weekNotes:Q}}function Zg(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 eb="modulepreload",tb=function(e,t){return new URL(e,t).href},Fu={},Af=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=Promise.allSettled(n.map(y=>{if(y=tb(y,s),y in Fu)return;Fu[y]=!0;const m=y.endsWith(".css"),w=m?'[rel="stylesheet"]':"";if(!!s)for(let N=c.length-1;N>=0;N--){const ee=c[N];if(ee.href===y&&(!m||ee.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${w}`))return;const O=document.createElement("link");if(O.rel=m?"stylesheet":eb,m||(O.as="script"),O.crossOrigin="",O.href=y,h&&O.setAttribute("nonce",h),document.head.appendChild(O),m)return new Promise((N,ee)=>{O.addEventListener("load",N),O.addEventListener("error",()=>ee(new Error(`Unable to preload CSS for ${y}`)))})}))}function a(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return o.then(c=>{for(const d of c||[])d.status==="rejected"&&a(d.reason);return t().catch(a)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const nb=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},s=(a,c)=>{n.platforms.set(a,c)},o=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))};return n.addPlatform=s,n.setPlatform=o,n},rb=e=>e.CapacitorPlatforms=nb(e),Of=rb(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});Of.addPlatform;Of.setPlatform;var ts;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(ts||(ts={}));class va extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const sb=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"},ob=e=>{var t,n,s,o,a;const c=e.CapacitorCustomPlatform||null,d=e.Capacitor||{},h=d.Plugins=d.Plugins||{},y=e.CapacitorPlatforms,m=()=>c!==null?c.name:sb(e),w=((t=y==null?void 0:y.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||m,C=()=>w()!=="web",O=((n=y==null?void 0:y.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||C,N=Q=>{const A=J.get(Q);return!!(A!=null&&A.platforms.has(w())||ue(Q))},ee=((s=y==null?void 0:y.currentPlatform)===null||s===void 0?void 0:s.isPluginAvailable)||N,te=Q=>{var A;return(A=d.PluginHeaders)===null||A===void 0?void 0:A.find(S=>S.name===Q)},ue=((o=y==null?void 0:y.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||te,P=Q=>e.console.error(Q),L=(Q,A,S)=>Promise.reject(`${S} does not have an implementation of "${A}".`),J=new Map,ce=(Q,A={})=>{const S=J.get(Q);if(S)return console.warn(`Capacitor plugin "${Q}" already registered. Cannot register plugins twice.`),S.proxy;const oe=w(),ge=ue(Q);let Y;const xe=async()=>(!Y&&oe in A?Y=typeof A[oe]=="function"?Y=await A[oe]():Y=A[oe]:c!==null&&!Y&&"web"in A&&(Y=typeof A.web=="function"?Y=await A.web():Y=A.web),Y),Fe=(Ne,De)=>{var Ce,X;if(ge){const Z=ge==null?void 0:ge.methods.find(ke=>De===ke.name);if(Z)return Z.rtype==="promise"?ke=>d.nativePromise(Q,De.toString(),ke):(ke,Be)=>d.nativeCallback(Q,De.toString(),ke,Be);if(Ne)return(Ce=Ne[De])===null||Ce===void 0?void 0:Ce.bind(Ne)}else{if(Ne)return(X=Ne[De])===null||X===void 0?void 0:X.bind(Ne);throw new va(`"${Q}" plugin is not implemented on ${oe}`,ts.Unimplemented)}},rt=Ne=>{let De;const Ce=(...X)=>{const Z=xe().then(ke=>{const Be=Fe(ke,Ne);if(Be){const dt=Be(...X);return De=dt==null?void 0:dt.remove,dt}else throw new va(`"${Q}.${Ne}()" is not implemented on ${oe}`,ts.Unimplemented)});return Ne==="addListener"&&(Z.remove=async()=>De()),Z};return Ce.toString=()=>`${Ne.toString()}() { [capacitor code] }`,Object.defineProperty(Ce,"name",{value:Ne,writable:!1,configurable:!1}),Ce},We=rt("addListener"),Ye=rt("removeListener"),me=(Ne,De)=>{const Ce=We({eventName:Ne},De),X=async()=>{const ke=await Ce;Ye({eventName:Ne,callbackId:ke},De)},Z=new Promise(ke=>Ce.then(()=>ke({remove:X})));return Z.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await X()},Z},Me=new Proxy({},{get(Ne,De){switch(De){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return ge?me:We;case"removeListener":return Ye;default:return rt(De)}}});return h[Q]=Me,J.set(Q,{name:Q,proxy:Me,platforms:new Set([...Object.keys(A),...ge?[oe]:[]])}),Me},ie=((a=y==null?void 0:y.currentPlatform)===null||a===void 0?void 0:a.registerPlugin)||ce;return d.convertFileSrc||(d.convertFileSrc=Q=>Q),d.getPlatform=w,d.handleError=P,d.isNativePlatform=O,d.isPluginAvailable=ee,d.pluginMethodNoop=L,d.registerPlugin=ie,d.Exception=va,d.DEBUG=!!d.DEBUG,d.isLoggingEnabled=!!d.isLoggingEnabled,d.platform=d.getPlatform(),d.isNative=d.isNativePlatform(),d},ib=e=>e.Capacitor=ob(e),ns=ib(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Mf=ns.registerPlugin;ns.Plugins;class If{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 c=async()=>this.removeListener(t,n);return Promise.resolve({remove:c})}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 ns.Exception(t,ts.Unimplemented)}unavailable(t="not available"){return new ns.Exception(t,ts.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 Nu=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Vu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ab extends If{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=Vu(o).trim(),a=Vu(a).trim(),n[o]=a}),n}async setCookie(t){try{const n=Nu(t.key),s=Nu(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,a=(t.path||"/").replace("path=",""),c=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${s||""}${o}; path=${a}; ${c};`}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)}}}Mf("CapacitorCookies",{web:()=>new ab});const lb=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)}),ub=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,a,c)=>(o[a]=e[t[c]],o),{})},cb=(e,t=!0)=>e?Object.entries(e).reduce((s,o)=>{const[a,c]=o;let d,h;return Array.isArray(c)?(h="",c.forEach(y=>{d=t?encodeURIComponent(y):y,h+=`${a}=${d}&`}),h.slice(0,-1)):(d=t?encodeURIComponent(c):c,h=`${a}=${d}`),`${s}&${h}`},"").substr(1):null,fb=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=ub(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[c,d]of Object.entries(e.data||{}))a.set(c,d);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((d,h)=>{a.append(h,d)});else for(const d of Object.keys(e.data))a.append(d,e.data[d]);n.body=a;const c=new Headers(n.headers);c.delete("content-type"),n.headers=c}else(o.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class db extends If{async request(t){const n=fb(t,t.webFetchExtra),s=cb(t.params,t.shouldEncodeUrlParams),o=s?`${t.url}?${s}`:t.url,a=await fetch(o,n),c=a.headers.get("content-type")||"";let{responseType:d="text"}=a.ok?t:{};c.includes("application/json")&&(d="json");let h,y;switch(d){case"arraybuffer":case"blob":y=await a.blob(),h=await lb(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"}))}}Mf("CapacitorHttp",{web:()=>new db});async function ml(e,t){const n=window;if(n.electronAPI&&n.electronAPI.saveFile){const c=await n.electronAPI.saveFile(e,t);return c&&c.saved?c.path:""}if(ns.isNativePlatform()){const{Filesystem:c,Directory:d,Encoding:h}=await Af(async()=>{const{Filesystem:y,Directory:m,Encoding:w}=await import("./index-2zIp9hhK.js");return{Filesystem:y,Directory:m,Encoding:w}},[],import.meta.url);try{return(await c.writeFile({path:e,data:t,directory:d.Documents,encoding:h.UTF8,recursive:!0})).uri}catch{return(await c.writeFile({path:e,data:t,directory:d.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 pb=Object.freeze(Object.defineProperty({__proto__:null,downloadText:ml},Symbol.toStringTag,{value:"Module"}));async function Ua(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 hb(e){const t=await Promise.all([gt("ai_base_url",""),gt("ai_api_key",""),gt("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",c={"Content-Type":"application/json"};s&&(c.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:c,body:h})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!y.ok){let C="接口返回 "+y.status;try{const O=await y.json();O&&O.error&&O.error.message&&(C+=":"+O.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 vb={class:"report"},mb={class:"report-toolbar"},yb={class:"seg"},gb=["onClick"],bb=["disabled"],wb=["disabled"],_b={key:0,class:"ai-error"},kb={class:"report-grid"},xb={class:"report-left"},Cb={class:"card section"},Sb={class:"section-title"},Eb={class:"muted note-saved"},$b={class:"card section"},Tb={class:"report-right"},Pb={key:0,class:"card section"},Ab={class:"sum-row"},Ob={class:"num"},Mb={class:"sum-row"},Ib={class:"num"},jb={class:"sum-row"},Db={class:"num"},Lb={class:"sum-row"},Rb={class:"num"},Kb={class:"sum-row"},Fb={class:"num"},Nb={class:"muted"},Vb={class:"num"},Bb={key:0,class:"muted sum-empty"},Ub={class:"muted"},qb={key:1,class:"muted sum-empty"},Hb={class:"muted"},Wb={key:2,class:"muted sum-empty"},zb={class:"muted"},Gb={key:3,class:"muted sum-empty"},Yb=Bt({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=F("week"),s=F(Ts(xt())),o=F(xt()),a=F(null),c=F(""),d=F(!1),h=F(!1),y=F(null),m=F(""),w=F(Ts(xt())),C=F(""),O=F(""),N=F(""),ee=F(!1);async function te(){const A=await vl(w.value);C.value=(A==null?void 0:A.highlights)||"",O.value=(A==null?void 0:A.challenges)||"",N.value=(A==null?void 0:A.plan_next)||"",ee.value=!1}async function ue(){await Pm(w.value,{highlights:C.value.trim()||null,challenges:O.value.trim()||null,plan_next:N.value.trim()||null}),ee.value=!0,await L()}function P(A){const S=xt();if(A==="week"){const oe=Ts(S);return{start:oe,end:Kn(oe,6),label:"本周"}}if(A==="month"){const oe=S.slice(0,7);return{start:oe+"-01",end:S,label:oe+" 本月"}}return A==="all"?{start:"2000-01-01",end:S,label:"全部实习期"}:{start:s.value,end:o.value,label:s.value+" ~ "+o.value}}async function L(){d.value=!0;const A=P(n.value),S=await Qg(A.start,A.end,A.label);a.value=S,c.value=Zg(S),d.value=!1}vt(n,L),vt([s,o],()=>{n.value==="custom"&&L()}),mn(async()=>{await te(),await L()});async function J(){const A=xt().replace(/-/g,""),S=await ml("实习工作总结_"+A+".md",c.value);Ue(S?"总结已导出到:"+S:"总结已导出到系统下载目录")}async function ce(){await Ua(c.value),Ue("总结已复制到剪贴板")}async function ie(){if(h.value)return;m.value="";const A=c.value.trim();if(!A){m.value="当前草稿为空,无法润色";return}h.value=!0;try{y.value=c.value,c.value=await hb(A),Ue("AI 润色完成")}catch(S){y.value=null,m.value=S instanceof Error?S.message:"润色失败"}h.value=!1}function Q(){y.value!==null&&(c.value=y.value),y.value=null}return(A,S)=>(K(),H("div",vb,[u("div",mb,[u("div",yb,[(K(),H(Re,null,ct(t,oe=>u("button",{key:oe.key,class:tt(["seg-btn",{active:n.value===oe.key}]),onClick:ge=>n.value=oe.key},se(oe.label),11,gb)),64))]),n.value==="custom"?(K(),H(Re,{key:0},[Te(u("input",{type:"date",class:"input w-date","onUpdate:modelValue":S[0]||(S[0]=oe=>s.value=oe)},null,512),[[Le,s.value]]),S[6]||(S[6]=u("span",{class:"muted"},"至",-1)),Te(u("input",{type:"date",class:"input w-date","onUpdate:modelValue":S[1]||(S[1]=oe=>o.value=oe)},null,512),[[Le,o.value]])],64)):Ee("",!0),S[10]||(S[10]=u("span",{class:"flex1"},null,-1)),u("button",{class:"btn btn-sm",disabled:h.value,onClick:ie},[Oe(ut,{name:"edit",size:14}),S[7]||(S[7]=rn("AI 润色 ",-1))],8,bb),y.value!==null?(K(),H("button",{key:1,class:"btn btn-sm",onClick:Q},"还原润色前")):Ee("",!0),u("button",{class:"btn btn-sm",disabled:d.value,onClick:L},[Oe(ut,{name:"edit",size:14}),S[8]||(S[8]=rn("重新生成 ",-1))],8,wb),u("button",{class:"btn btn-sm",onClick:ce},"复制"),u("button",{class:"btn btn-primary btn-sm",onClick:J},[Oe(ut,{name:"export",size:14}),S[9]||(S[9]=rn("导出 Markdown ",-1))])]),m.value?(K(),H("div",_b,se(m.value),1)):Ee("",!0),u("div",kb,[u("div",xb,[u("div",Cb,[u("div",Sb,"本周周记("+se(w.value)+" 起)",1),S[11]||(S[11]=u("label",{class:"note-label muted"},"本周亮点",-1)),Te(u("textarea",{class:"textarea","onUpdate:modelValue":S[2]||(S[2]=oe=>C.value=oe),placeholder:"本周最有价值的一件事",onBlur:ue},null,544),[[Le,C.value]]),S[12]||(S[12]=u("label",{class:"note-label muted"},"踩的坑",-1)),Te(u("textarea",{class:"textarea","onUpdate:modelValue":S[3]||(S[3]=oe=>O.value=oe),placeholder:"遇到的问题与教训",onBlur:ue},null,544),[[Le,O.value]]),S[13]||(S[13]=u("label",{class:"note-label muted"},"下周计划",-1)),Te(u("textarea",{class:"textarea","onUpdate:modelValue":S[4]||(S[4]=oe=>N.value=oe),placeholder:"下周准备做什么",onBlur:ue},null,544),[[Le,N.value]]),u("div",Eb,se(ee.value?"已保存":"失焦自动保存"),1)]),u("div",$b,[S[14]||(S[14]=u("div",{class:"section-title"},"总结草稿(可编辑)",-1)),Te(u("textarea",{class:"textarea md-editor","onUpdate:modelValue":S[5]||(S[5]=oe=>c.value=oe),spellcheck:"false"},null,512),[[Le,c.value]])])]),u("div",Tb,[a.value?(K(),H("div",Pb,[S[20]||(S[20]=u("div",{class:"section-title"},"数据摘要",-1)),u("div",Ab,[S[15]||(S[15]=u("span",{class:"muted"},"出勤",-1)),u("span",Ob,se(a.value.attendDays)+" 天",1)]),u("div",Mb,[S[16]||(S[16]=u("span",{class:"muted"},"工时",-1)),u("span",Ib,se(a.value.totalHours)+" 小时",1)]),u("div",jb,[S[17]||(S[17]=u("span",{class:"muted"},"补卡",-1)),u("span",Db,se(a.value.makeupCount)+" 次",1)]),u("div",Lb,[S[18]||(S[18]=u("span",{class:"muted"},"请假",-1)),u("span",Rb,se(a.value.leaveCount)+" 天",1)]),u("div",Kb,[S[19]||(S[19]=u("span",{class:"muted"},"记录",-1)),u("span",Fb,se(a.value.itemCount)+" 条",1)]),S[21]||(S[21]=u("div",{class:"section-sub"},"分类分布",-1)),(K(!0),H(Re,null,ct(a.value.categoryStats,oe=>(K(),H("div",{key:oe.key,class:"sum-row"},[u("span",Nb,se(oe.label),1),u("span",Vb,se(oe.count)+" 条 · "+se(oe.percent)+"%",1)]))),128)),a.value.categoryStats.length?Ee("",!0):(K(),H("div",Bb,"(无)")),S[22]||(S[22]=u("div",{class:"section-sub"},"主要成果",-1)),(K(!0),H(Re,null,ct(a.value.milestones,(oe,ge)=>(K(),H("div",{key:"m"+ge,class:"sum-item"},[rn(se(oe.content),1),u("span",Ub,"("+se(oe.date)+")",1)]))),128)),a.value.milestones.length?Ee("",!0):(K(),H("div",qb,"(无)")),S[23]||(S[23]=u("div",{class:"section-sub"},"待跟进",-1)),(K(!0),H(Re,null,ct(a.value.followups,(oe,ge)=>(K(),H("div",{key:"f"+ge,class:"sum-item"},[rn(se(oe.content),1),u("span",Hb,"("+se(oe.date)+")",1)]))),128)),a.value.followups.length?Ee("",!0):(K(),H("div",Wb,"(无)")),S[24]||(S[24]=u("div",{class:"section-sub"},"学习与成长",-1)),(K(!0),H(Re,null,ct(a.value.takeaways,(oe,ge)=>(K(),H("div",{key:"t"+ge,class:"sum-item"},[rn(se(oe.text),1),u("span",zb,"("+se(oe.date)+")",1)]))),128)),a.value.takeaways.length?Ee("",!0):(K(),H("div",Gb,"(无)"))])):Ee("",!0)])])]))}}),Jb=Yt(Yb,[["__scopeId","data-v-43f9c59b"]]),Xb=["aria-label"],Qb={class:"dialog-head"},Zb={class:"dialog-title"},ew={class:"dialog-body"},tw={class:"form-grid"},nw={class:"field span2"},rw={class:"seg"},sw={class:"field"},ow={class:"field"},iw={class:"field"},aw=["value"],lw={key:0,class:"field"},uw={class:"seg"},cw={class:"field span2"},fw={key:0,class:"form-error"},dw={class:"dialog-btns"},pw=Bt({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=F("expense"),a=F("餐饮"),c=F(""),d=F(""),h=F(""),y=F(!1),m=F(!1),w=F(""),C=F(null);function O(ue){n.open&&ue.key==="Escape"&&s("cancel")}vt(()=>n.open,async ue=>{var P;ue?(o.value=n.initial.type==="income"?"income":"expense",a.value=n.initial.category,c.value=n.initial.amountYuan,d.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",O),await rs(),(P=C.value)==null||P.focus()):window.removeEventListener("keydown",O)}),fr(()=>window.removeEventListener("keydown",O)),vt(o,ue=>{a.value=ue==="expense"?zr[0]:Jo[0]});const N=at(()=>o.value==="expense"?zr:Jo);function ee(){return a.value&&N.value.includes(a.value)?a.value:N.value[0]}function te(){const ue=String(c.value??"").trim(),P=Number(ue);if(!ue||!isFinite(P)||P<=0){w.value="请填写大于 0 的金额";return}if(!d.value){w.value="请选择日期";return}const L=o.value==="expense"&&y.value?1:0;s("save",{type:o.value,category:ee(),amount:Math.round(P*100),date:d.value,note:String(h.value??"").trim(),reimbursable:L,reimbursed:L&&m.value?1:0})}return(ue,P)=>(K(),It(Us,{to:"body"},[Oe(ss,{name:"modal"},{default:cr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:P[11]||(P[11]=Ir(L=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",Qb,[u("span",Zb,se(e.title),1),u("button",{class:"icon-btn",title:"关闭",onClick:P[0]||(P[0]=L=>s("cancel"))},[Oe(ut,{name:"close",size:16})])]),u("div",ew,[u("div",tw,[u("div",nw,[P[12]||(P[12]=u("label",null,"类型",-1)),u("div",rw,[u("button",{class:tt(["seg-btn",{active:o.value==="expense"}]),onClick:P[1]||(P[1]=L=>o.value="expense")},"支出",2),u("button",{class:tt(["seg-btn",{active:o.value==="income"}]),onClick:P[2]||(P[2]=L=>o.value="income")},"收入",2)])]),u("div",sw,[P[13]||(P[13]=u("label",null,"金额(元,必填)",-1)),Te(u("input",{ref_key:"amountInput",ref:C,class:tt(["input",{invalid:w.value}]),"onUpdate:modelValue":P[3]||(P[3]=L=>c.value=L),type:"number",min:"0",step:"0.01",placeholder:"0.00"},null,2),[[Le,c.value]])]),u("div",ow,[P[14]||(P[14]=u("label",null,"日期(必填)",-1)),Te(u("input",{class:"input",type:"date","onUpdate:modelValue":P[4]||(P[4]=L=>d.value=L)},null,512),[[Le,d.value]])]),u("div",iw,[P[15]||(P[15]=u("label",null,"分类",-1)),Te(u("select",{class:"select","onUpdate:modelValue":P[5]||(P[5]=L=>a.value=L)},[(K(!0),H(Re,null,ct(N.value,L=>(K(),H("option",{key:L,value:L},se(L),9,aw))),128))],512),[[Fn,a.value]])]),o.value==="expense"?(K(),H("div",lw,[P[16]||(P[16]=u("label",null,"报销状态",-1)),u("div",uw,[u("button",{class:tt(["seg-btn",{active:!y.value}]),onClick:P[6]||(P[6]=L=>{y.value=!1,m.value=!1})},"无需报销",2),u("button",{class:tt(["seg-btn",{active:y.value&&!m.value}]),onClick:P[7]||(P[7]=L=>{y.value=!0,m.value=!1})},"待报销",2),u("button",{class:tt(["seg-btn",{active:y.value&&m.value}]),onClick:P[8]||(P[8]=L=>{y.value=!0,m.value=!0})},"已报销",2)])])):Ee("",!0),u("div",cw,[P[17]||(P[17]=u("label",null,"备注",-1)),Te(u("textarea",{class:"textarea","onUpdate:modelValue":P[9]||(P[9]=L=>h.value=L),placeholder:"选填"},null,512),[[Le,h.value]])])]),w.value?(K(),H("div",fw,se(w.value),1)):Ee("",!0)]),u("div",dw,[u("button",{class:"btn btn-sm",onClick:P[10]||(P[10]=L=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:te},"保存")])],8,Xb)])):Ee("",!0)]),_:1})]))}}),hw=Yt(pw,[["__scopeId","data-v-edca3327"]]),vw={class:"ledger-page"},mw={class:"ledger-toolbar"},yw={class:"month-title num"},gw={class:"cards"},bw={class:"card stat-card"},ww={class:"stat-num num amt-income"},_w={class:"card stat-card"},kw={class:"stat-num num"},xw={class:"card stat-card"},Cw={class:"card stat-card"},Sw={class:"stat-num num amt-warn"},Ew={class:"card sec"},$w={class:"form-grid"},Tw={class:"field span2"},Pw={class:"seg"},Aw={class:"field"},Ow={class:"field"},Mw={class:"field"},Iw=["value"],jw={key:0,class:"field"},Dw={class:"field span2"},Lw={key:0,class:"form-error"},Rw={class:"form-footer"},Kw=["disabled"],Fw=["disabled"],Nw={key:0,class:"card sec"},Vw={class:"bar-label"},Bw={class:"bar-track"},Uw={class:"muted num bar-num"},qw={key:1,class:"card section"},Hw={class:"form-error"},Ww={class:"card table-card"},zw={class:"tx-table"},Gw={class:"num"},Yw={class:"tag"},Jw={class:"td-note"},Xw={key:0,class:"muted"},Qw={key:1,class:"tx-done"},Zw={key:2,class:"tx-pending"},e_={class:"ops"},t_=["onClick"],n_=["onClick"],r_=["onClick"],s_={key:0},o_={class:"muted vault-note num"},i_=Bt({__name:"LedgerView",setup(e){const t=F(xt()),n=F([]),s=F(!0),o=F("expense"),a=F(""),c=F(zr[0]),d=F(xt()),h=F(""),y=F(!1),m=F(""),w=F(""),C=F(!1),O=F(!1),N=F(null),ee=F({type:"expense",category:zr[0],amountYuan:"",date:xt(),note:"",reimbursable:0,reimbursed:0}),te=F(null),ue=at(()=>t.value.slice(0,7)+"-01"),P=at(()=>{const X=Number(t.value.slice(0,4)),Z=Number(t.value.slice(5,7))-1,ke=new Date(X,Z+1,0).getDate();return t.value.slice(0,7)+"-"+(ke<10?"0"+ke:String(ke))}),L=at(()=>Number(t.value.slice(0,4))+" 年 "+Number(t.value.slice(5,7))+" 月");async function J(){s.value=!0;try{n.value=await Rm(ue.value,P.value),w.value=""}catch(X){w.value="账目加载失败:"+(X instanceof Error?X.stack||X.message:String(X)),Ue("账目加载失败")}s.value=!1}mn(J),vt(t,J),vt(o,X=>{c.value=X==="expense"?zr[0]:Jo[0]});const ce=at(()=>n.value.slice().sort((X,Z)=>X.date===Z.date?Z.id-X.id:X.date<Z.date?1:-1)),ie=at(()=>{let X=0,Z=0,ke=0;for(const Be of n.value)Be.type==="income"?X+=Be.amount:(Z+=Be.amount,Be.reimbursable===1&&Be.reimbursed!==1&&(ke+=Be.amount));return{income:X,expense:Z,pending:ke,balance:X-Z}}),Q=F("all"),A=F("all"),S=at(()=>ce.value.filter(X=>!(Q.value!=="all"&&X.type!==Q.value||A.value==="pending"&&!(X.type==="expense"&&X.reimbursable===1&&X.reimbursed!==1)||A.value==="done"&&!(X.reimbursable===1&&X.reimbursed===1)))),oe=at(()=>{const X=new Map;let Z=0;for(const Be of n.value)Be.type==="expense"&&(X.set(Be.category,(X.get(Be.category)||0)+Be.amount),Z+=Be.amount);const ke=Z||1;return Array.from(X.entries()).map(Be=>({name:Be[0],amount:Be[1],percent:Math.round(Be[1]/ke*100)})).sort((Be,dt)=>dt.amount-Be.amount)});function ge(X){return(X/100).toFixed(2)}function Y(X){return(X.type==="income"?"+":"-")+ge(X.amount)}function xe(){t.value=Xo(t.value,-1)}function Fe(){t.value=Xo(t.value,1)}function rt(){t.value=xt()}vt(a,()=>{m.value&&(m.value="")});async function We(){const X=String(a.value??"").trim(),Z=Number(X);if(!X||!isFinite(Z)||Z<=0){m.value="请填写大于 0 的金额";return}if(!d.value){m.value="请选择日期";return}if(!C.value){C.value=!0;try{await Km({type:o.value,category:c.value,amount:Math.round(Z*100),date:d.value,note:String(h.value??"").trim(),reimbursable:o.value==="expense"&&y.value?1:0,reimbursed:0})}catch(ke){Ue("添加失败:"+(ke instanceof Error?ke.message:String(ke))),C.value=!1;return}a.value="",h.value="",y.value=!1,m.value="",await J(),Ue("记账已添加"),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(X){await Vm(X.id),await J(),Ue("已标记为已报销")}function Ne(X){N.value=X.id,ee.value={type:X.type,category:X.category,amountYuan:ge(X.amount),date:X.date,note:X.note||"",reimbursable:X.reimbursable,reimbursed:X.reimbursed},O.value=!0}async function De(X){const Z=N.value;await Fm(Z,X),O.value=!1,await J(),Ue("账目已更新")}async function Ce(){te.value&&te.value.id&&await Nm(te.value.id),te.value=null,await J(),Ue("账目已删除")}return(X,Z)=>(K(),H("div",vw,[u("div",mw,[u("button",{class:"icon-btn",onClick:xe},[Oe(ut,{name:"chevron-left",size:16})]),u("span",yw,se(L.value),1),u("button",{class:"icon-btn",onClick:Fe},[Oe(ut,{name:"chevron-right",size:16})]),u("button",{class:"btn btn-sm",onClick:rt},"回到本月"),Z[13]||(Z[13]=u("span",{class:"flex1"},null,-1)),Te(u("select",{class:"select w-filter","onUpdate:modelValue":Z[0]||(Z[0]=ke=>Q.value=ke)},[...Z[11]||(Z[11]=[u("option",{value:"all"},"全部类型",-1),u("option",{value:"expense"},"仅支出",-1),u("option",{value:"income"},"仅收入",-1)])],512),[[Fn,Q.value]]),Te(u("select",{class:"select w-filter","onUpdate:modelValue":Z[1]||(Z[1]=ke=>A.value=ke)},[...Z[12]||(Z[12]=[u("option",{value:"all"},"全部报销",-1),u("option",{value:"pending"},"待报销",-1),u("option",{value:"done"},"已报销",-1)])],512),[[Fn,A.value]])]),u("div",gw,[u("div",bw,[Z[14]||(Z[14]=u("div",{class:"muted"},"本月收入(元)",-1)),u("div",ww,se(ge(ie.value.income)),1)]),u("div",_w,[Z[15]||(Z[15]=u("div",{class:"muted"},"本月支出(元)",-1)),u("div",kw,se(ge(ie.value.expense)),1)]),u("div",xw,[Z[16]||(Z[16]=u("div",{class:"muted"},"本月结余(元)",-1)),u("div",{class:tt(["stat-num num",{"amt-income":ie.value.balance>=0,"amt-expense":ie.value.balance<0}])},se(ge(ie.value.balance)),3)]),u("div",Cw,[Z[17]||(Z[17]=u("div",{class:"muted"},"待报销(元)",-1)),u("div",Sw,se(ge(ie.value.pending)),1)])]),u("div",Ew,[Z[24]||(Z[24]=u("div",{class:"sec-head"},[u("span",{class:"sec-title"},"新增一笔"),u("span",{class:"muted form-hint"},"金额必填,回车快速添加")],-1)),u("div",$w,[u("div",Tw,[Z[18]||(Z[18]=u("label",null,"类型",-1)),u("div",Pw,[u("button",{class:tt(["seg-btn",{active:o.value==="expense"}]),onClick:Z[2]||(Z[2]=ke=>o.value="expense")},"支出",2),u("button",{class:tt(["seg-btn",{active:o.value==="income"}]),onClick:Z[3]||(Z[3]=ke=>o.value="income")},"收入",2)])]),u("div",Aw,[Z[19]||(Z[19]=u("label",null,"金额(元,必填)",-1)),Te(u("input",{class:tt(["input",{invalid:m.value}]),"onUpdate:modelValue":Z[4]||(Z[4]=ke=>a.value=ke),type:"number",min:"0",step:"0.01",placeholder:"0.00",onKeydown:Dt(We,["enter"])},null,34),[[Le,a.value]])]),u("div",Ow,[Z[20]||(Z[20]=u("label",null,"日期",-1)),Te(u("input",{class:"input",type:"date","onUpdate:modelValue":Z[5]||(Z[5]=ke=>d.value=ke)},null,512),[[Le,d.value]])]),u("div",Mw,[Z[21]||(Z[21]=u("label",null,"分类",-1)),Te(u("select",{class:"select","onUpdate:modelValue":Z[6]||(Z[6]=ke=>c.value=ke)},[(K(!0),H(Re,null,ct(o.value==="expense"?Zt(zr):Zt(Jo),ke=>(K(),H("option",{key:ke,value:ke},se(ke),9,Iw))),128))],512),[[Fn,c.value]])]),o.value==="expense"?(K(),H("div",jw,[Z[22]||(Z[22]=u("label",null,"报销",-1)),u("button",{class:tt(["toggle-btn",{on:y.value}]),onClick:Z[7]||(Z[7]=ke=>y.value=!y.value)},se(y.value?"需要报销":"无需报销"),3)])):Ee("",!0),u("div",Dw,[Z[23]||(Z[23]=u("label",null,"备注",-1)),Te(u("input",{class:"input","onUpdate:modelValue":Z[8]||(Z[8]=ke=>h.value=ke),placeholder:"选填,如:客户现场午餐",onKeydown:Dt(We,["enter"])},null,544),[[Le,h.value]])])]),m.value?(K(),H("div",Lw,se(m.value),1)):Ee("",!0),u("div",Rw,[u("button",{class:"btn btn-sm",disabled:!Ye.value,onClick:me},"重置",8,Kw),u("button",{class:"btn btn-primary btn-sm",disabled:C.value,onClick:We},"添加记录",8,Fw)])]),oe.value.length?(K(),H("div",Nw,[Z[25]||(Z[25]=u("div",{class:"sec-title"},"本月支出分类",-1)),(K(!0),H(Re,null,ct(oe.value,ke=>(K(),H("div",{key:ke.name,class:"bar-row"},[u("span",Vw,se(ke.name),1),u("span",Bw,[u("span",{class:"bar-fill",style:nr({width:ke.percent+"%"})},null,4)]),u("span",Uw,se(ge(ke.amount))+" 元 · "+se(ke.percent)+"%",1)]))),128))])):Ee("",!0),w.value?(K(),H("div",qw,[u("div",Hw,se(w.value),1),Z[26]||(Z[26]=u("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):Ee("",!0),u("div",Ww,[u("table",zw,[Z[28]||(Z[28]=u("thead",null,[u("tr",null,[u("th",null,"日期"),u("th",null,"分类"),u("th",null,"金额(元)"),u("th",null,"备注"),u("th",null,"报销"),u("th",{class:"th-ops"},"操作")])],-1)),u("tbody",null,[(K(!0),H(Re,null,ct(S.value,ke=>(K(),H("tr",{key:ke.id},[u("td",Gw,se(ke.date),1),u("td",null,[u("span",Yw,se(ke.category),1)]),u("td",{class:tt(["num",ke.type==="income"?"amt-income":"amt-expense"])},se(Y(ke)),3),u("td",Jw,se(ke.note||"--"),1),u("td",null,[ke.type!=="expense"||ke.reimbursable!==1?(K(),H("span",Xw,"--")):ke.reimbursed===1?(K(),H("span",Qw,"已报销")):(K(),H("span",Zw,"待报销"))]),u("td",null,[u("div",e_,[ke.type==="expense"&&ke.reimbursable===1&&ke.reimbursed!==1?(K(),H("button",{key:0,class:"btn btn-xs",onClick:Be=>Me(ke)},"标记已报销",8,t_)):Ee("",!0),u("button",{class:"btn btn-xs",onClick:Be=>Ne(ke)},"编辑",8,n_),u("button",{class:"btn btn-xs",onClick:Be=>te.value=ke},"删除",8,r_)])])]))),128)),!S.value.length&&!s.value?(K(),H("tr",s_,[...Z[27]||(Z[27]=[u("td",{colspan:"6",class:"empty muted"},"本月暂无账目",-1)])])):Ee("",!0)])])]),u("div",o_,"筛选结果 "+se(S.value.length)+" 条 / 本月共 "+se(n.value.length)+" 条",1),Oe(hw,{open:O.value,title:(N.value,"编辑账目"),initial:ee.value,onCancel:Z[9]||(Z[9]=ke=>O.value=!1),onSave:De},null,8,["open","title","initial"]),Oe(lr,{open:!!te.value,title:"删除确认",message:te.value?"将删除 "+te.value.date+" 的账目("+te.value.category+" "+ge(te.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Z[10]||(Z[10]=ke=>te.value=null),onConfirm:Ce},null,8,["open","message"])]))}}),a_=Yt(i_,[["__scopeId","data-v-0f950d19"]]),l_={class:"memo-page"},u_={class:"card memo-list"},c_={class:"pane-head"},f_={class:"pane-title"},d_={class:"memo-scroll"},p_=["onClick"],h_={class:"memo-item-title"},v_={class:"muted memo-item-sub"},m_={class:"muted num memo-item-time"},y_={key:0,class:"muted empty"},g_={class:"card memo-editor"},b_={class:"editor-foot"},w_={class:"muted foot-info"},__=["disabled"],k_=["disabled"],x_={key:1,class:"empty muted editor-empty"},C_=Bt({__name:"MemoView",setup(e){const t=F([]),n=F(null),s=F(!1),o=F(""),a=F(""),c=F(null),d=F(null);async function h(){if(t.value=await Om(),n.value&&n.value.id){const ie=t.value.find(Q=>Q.id===n.value.id);ie&&(n.value=ie)}}mn(async()=>{await h(),t.value.length&&w(t.value[0]),window.addEventListener("keydown",y)}),fr(()=>window.removeEventListener("keydown",y)),vt(Ka,async ie=>{if(!ie)return;t.value.length||await h();const Q=t.value.find(A=>A.id===ie);Ka.value=null,Q&&C(Q)},{immediate:!0});function y(ie){(ie.ctrlKey||ie.metaKey)&&ie.key.toLowerCase()==="s"&&s.value&&m.value&&(ie.preventDefault(),te())}const m=at(()=>{if(!s.value)return!1;const ie=n.value?n.value.title:"",Q=n.value?n.value.content:"";return o.value!==ie||a.value!==Q});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){d.value={type:"select",memo:ie};return}w(ie)}}function O(){if(m.value){d.value={type:"new"};return}N()}function N(){n.value=null,s.value=!0,o.value="",a.value=""}function ee(){n.value?w(n.value):N()}async function te(){if(!o.value.trim()&&!a.value.trim()){Ue("标题与内容不能都为空");return}if(n.value&&n.value.id)await Im(n.value.id,o.value,a.value),Ue("备忘已保存");else{const ie=await Mm(o.value,a.value);n.value=ie,o.value=ie.title,a.value=ie.content,Ue("备忘已创建")}await h()}function ue(){n.value&&n.value.id&&(c.value=n.value)}async function P(){c.value&&c.value.id&&(await jm(c.value.id),Ue("备忘已删除")),c.value=null,await h(),N()}function L(){const ie=d.value;d.value=null,ie&&(ie.type==="select"?w(ie.memo):N())}function J(ie){return(ie.content||"").replace(/\s+/g," ").slice(0,30)}function ce(ie){return ie.replace("T"," ").slice(0,16)}return(ie,Q)=>(K(),H("div",l_,[u("aside",u_,[u("div",c_,[u("span",f_,"备忘录("+se(t.value.length)+")",1),u("button",{class:"btn btn-primary btn-sm",onClick:O},"新建")]),u("div",d_,[(K(!0),H(Re,null,ct(t.value,A=>(K(),H("div",{key:A.id,class:tt(["memo-item",{active:s.value&&n.value&&n.value.id===A.id}]),onClick:S=>C(A)},[u("div",h_,se(A.title||"无标题"),1),u("div",v_,se(J(A)||"空"),1),u("div",m_,se(ce(A.updated_at)),1)],10,p_))),128)),t.value.length?Ee("",!0):(K(),H("div",y_,"暂无备忘"))])]),u("section",g_,[s.value?(K(),H(Re,{key:0},[Te(u("input",{class:"input title-input","onUpdate:modelValue":Q[0]||(Q[0]=A=>o.value=A),placeholder:"标题"},null,512),[[Le,o.value]]),Te(u("textarea",{class:"textarea content-textarea","onUpdate:modelValue":Q[1]||(Q[1]=A=>a.value=A),placeholder:"内容"},null,512),[[Le,a.value]]),u("div",b_,[u("span",w_,[m.value?(K(),H(Re,{key:0},[rn("有未保存修改")],64)):n.value&&n.value.id?(K(),H(Re,{key:1},[rn("更新于 "+se(ce(n.value.updated_at)),1)],64)):(K(),H(Re,{key:2},[rn("新备忘")],64))]),Q[4]||(Q[4]=u("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(K(),H("button",{key:0,class:"btn btn-sm",onClick:ue},"删除")):Ee("",!0),u("button",{class:"btn btn-sm",disabled:!m.value,onClick:ee},"放弃修改",8,__),u("button",{class:"btn btn-primary btn-sm",disabled:!m.value,onClick:te},"保存",8,k_)])],64)):(K(),H("div",x_,"选择左侧备忘,或点击右上角新建"))]),Oe(lr,{open:!!c.value,title:"删除确认",message:c.value?"将删除备忘「"+(c.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Q[2]||(Q[2]=A=>c.value=null),onConfirm:P},null,8,["open","message"]),Oe(lr,{open:!!d.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:Q[3]||(Q[3]=A=>d.value=null),onConfirm:L},null,8,["open"])]))}}),S_=Yt(C_,[["__scopeId","data-v-74d60dba"]]),E_=["aria-label"],$_={class:"dialog-head"},T_={class:"dialog-title"},P_={class:"dialog-body"},A_={class:"form-grid"},O_={class:"field span2"},M_={class:"field span2"},I_={class:"field span2"},j_={class:"pwd-row"},D_={class:"field span2"},L_={key:0,class:"form-error"},R_={class:"dialog-btns"},K_=Bt({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=F(""),a=F(""),c=F(""),d=F(""),h=F(""),y=F(null);function m(O){n.open&&O.key==="Escape"&&s("cancel")}vt(()=>n.open,async O=>{var N;O?(o.value=n.initial.system,a.value=n.initial.account,c.value=n.initial.password,d.value=n.initial.remark,h.value="",window.addEventListener("keydown",m),await rs(),(N=y.value)==null||N.focus()):window.removeEventListener("keydown",m)}),fr(()=>window.removeEventListener("keydown",m));function w(){const O="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",N="!@#$%^&*",ee=crypto.getRandomValues(new Uint8Array(14));let te="";for(let ue=0;ue<ee.length;ue++)te+=O[ee[ue]%O.length];te+=N[crypto.getRandomValues(new Uint8Array(1))[0]%N.length],c.value=te,h.value=""}function C(){if(!o.value.trim()||!a.value.trim()||!c.value){h.value="系统名称、账号、密码为必填项";return}s("save",{system:o.value.trim(),account:a.value.trim(),password:c.value,remark:d.value.trim()})}return(O,N)=>(K(),It(Us,{to:"body"},[Oe(ss,{name:"modal"},{default:cr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:N[6]||(N[6]=Ir(ee=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",$_,[u("span",T_,se(e.title),1),u("button",{class:"icon-btn",title:"关闭",onClick:N[0]||(N[0]=ee=>s("cancel"))},[Oe(ut,{name:"close",size:16})])]),u("div",P_,[u("div",A_,[u("div",O_,[N[7]||(N[7]=u("label",null,"系统名称(必填)",-1)),Te(u("input",{ref_key:"systemInput",ref:y,class:"input","onUpdate:modelValue":N[1]||(N[1]=ee=>o.value=ee),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[Le,o.value]])]),u("div",M_,[N[8]||(N[8]=u("label",null,"账号(必填)",-1)),Te(u("input",{class:"input","onUpdate:modelValue":N[2]||(N[2]=ee=>a.value=ee),placeholder:"用户名、工号或邮箱"},null,512),[[Le,a.value]])]),u("div",I_,[N[9]||(N[9]=u("label",null,"密码(必填)",-1)),u("div",j_,[Te(u("input",{class:"input","onUpdate:modelValue":N[3]||(N[3]=ee=>c.value=ee),placeholder:"输入或点击生成"},null,512),[[Le,c.value]]),u("button",{class:"btn btn-sm",onClick:w},"生成")])]),u("div",D_,[N[10]||(N[10]=u("label",null,"备注",-1)),Te(u("textarea",{class:"textarea","onUpdate:modelValue":N[4]||(N[4]=ee=>d.value=ee),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[Le,d.value]])])]),h.value?(K(),H("div",L_,se(h.value),1)):Ee("",!0)]),u("div",R_,[u("button",{class:"btn btn-sm",onClick:N[5]||(N[5]=ee=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:C},"保存")])],8,E_)])):Ee("",!0)]),_:1})]))}}),F_=Yt(K_,[["__scopeId","data-v-f383b0a6"]]),N_={class:"vault-page"},V_={key:0,class:"empty muted"},B_={key:1,class:"card lock-card"},U_={class:"lock-badge"},q_={key:0,class:"form-error"},H_=["disabled"],W_={key:0,class:"form-error"},z_=["disabled"],G_={class:"vault-toolbar"},Y_={class:"search-wrap"},J_={class:"card table-card"},X_={class:"cred-table"},Q_={class:"td-system"},Z_=["onClick"],e1={class:"pwd-cell"},t1={class:"num pwd-text"},n1=["onClick"],r1=["onClick"],s1={class:"td-remark"},o1={class:"ops"},i1=["onClick"],a1=["onClick"],l1={key:0},u1={class:"muted vault-note num"},c1={class:"dialog pwd-dialog"},f1={class:"dialog-head"},d1={class:"dialog-body"},p1={class:"vp-field"},h1={class:"vp-field"},v1={class:"vp-field"},m1={key:0,class:"form-error"},y1={class:"dialog-btns"},g1=5*60*1e3,b1=Bt({__name:"VaultView",setup(e){const t=F(null),n=F(Ev()),s=F(!1),o=F(""),a=F(""),c=F(""),d=F(""),h=F(""),y=F([]),m=F(""),w=F({}),C=F(!1),O=F(null),N=F({system:"",account:"",password:"",remark:""}),ee=F(null),te=F(!1),ue=F(""),P=F(""),L=F(""),J=F("");async function ce(){y.value=await Ov(),w.value={}}let ie=null;function Q(){ie!==null&&window.clearTimeout(ie),ie=window.setTimeout(()=>{n.value&&(ei(),n.value=!1,y.value=[],w.value={},Ue("长时间未操作,密码库已自动锁定"))},g1)}function A(){n.value&&Q()}mn(async()=>{t.value=await ff(),window.addEventListener("click",A),window.addEventListener("keydown",A),n.value&&Q()}),fr(()=>{window.removeEventListener("click",A),window.removeEventListener("keydown",A),ie!==null&&window.clearTimeout(ie)});const S=at(()=>{const Ce=m.value.trim().toLowerCase();return Ce?y.value.filter(X=>(X.system+" "+X.account+" "+(X.remark||"")).toLowerCase().includes(Ce)):y.value});async function oe(){if(!s.value){if(c.value="",!o.value){c.value="请输入主密码";return}if(o.value.length<6){c.value="主密码至少 6 位";return}if(o.value!==a.value){c.value="两次输入的主密码不一致";return}s.value=!0;try{await $v(o.value),o.value="",a.value="",n.value=!0,Q(),await ce(),Ue("主密码已设置,密码库已解锁")}catch(Ce){c.value=Ce instanceof Error?Ce.message:"设置失败"}s.value=!1}}async function ge(){if(!s.value){if(h.value="",!d.value){h.value="请输入主密码";return}s.value=!0;try{await Tv(d.value),d.value="",n.value=!0,Q(),await ce()}catch(Ce){h.value=Ce instanceof Error?Ce.message:"解锁失败"}s.value=!1}}function Y(){ei(),n.value=!1,y.value=[],w.value={},ie!==null&&window.clearTimeout(ie),Ue("密码库已锁定")}async function xe(Ce){const X=Ce.id;if(w.value[X]){w.value[X]=!1;return}try{Ce.passwordPlain=await pa(X),w.value[X]=!0}catch(Z){Ue(Z instanceof Error?Z.message:"解密失败")}}async function Fe(Ce){try{const X=await pa(Ce.id);await Ua(X),Ue("密码已复制")}catch(X){Ue(X instanceof Error?X.message:"复制失败")}}async function rt(Ce){await Ua(Ce.account),Ue("账号已复制")}function We(){O.value=null,N.value={system:"",account:"",password:"",remark:""},C.value=!0}async function Ye(Ce){try{const X=await pa(Ce.id);O.value=Ce.id,N.value={system:Ce.system,account:Ce.account,password:X,remark:Ce.remark||""},C.value=!0}catch(X){Ue(X instanceof Error?X.message:"解密失败")}}async function me(Ce){const X=O.value??void 0;await Mv(Ce,X),C.value=!1,await ce(),Ue(X?"账号已更新":"账号已添加")}async function Me(){ee.value&&ee.value.id&&(await Iv(ee.value.id),Ue("账号已删除")),ee.value=null,await ce()}function Ne(){ue.value="",P.value="",L.value="",J.value="",te.value=!0}async function De(){J.value="";try{const Ce=await jv(ue.value,P.value);te.value=!1,ue.value="",P.value="",L.value="",Ue("主密码已修改,"+Ce+" 条账号密码已重新加密")}catch(Ce){J.value=Ce instanceof Error?Ce.message:"修改失败"}}return(Ce,X)=>(K(),H("div",N_,[t.value===null?(K(),H("div",V_,"加载中")):n.value?(K(),H(Re,{key:2},[u("div",G_,[u("div",Y_,[Oe(ut,{name:"search",size:14,class:"search-icon"}),Te(u("input",{class:"input","onUpdate:modelValue":X[3]||(X[3]=Z=>m.value=Z),placeholder:"搜索系统名称、账号或备注"},null,512),[[Le,m.value]])]),X[16]||(X[16]=u("span",{class:"flex1"},null,-1)),u("button",{class:"btn btn-sm",onClick:Ne},"修改主密码"),u("button",{class:"btn btn-sm",onClick:Y},"锁定"),u("button",{class:"btn btn-primary btn-sm",onClick:We},"新增账号")]),u("div",J_,[u("table",X_,[X[18]||(X[18]=u("thead",null,[u("tr",null,[u("th",null,"系统名称"),u("th",null,"账号"),u("th",null,"密码"),u("th",null,"备注"),u("th",{class:"th-ops"},"操作")])],-1)),u("tbody",null,[(K(!0),H(Re,null,ct(S.value,Z=>(K(),H("tr",{key:Z.id},[u("td",Q_,se(Z.system),1),u("td",null,[u("span",{class:"copyable",title:"点击复制账号",onClick:ke=>rt(Z)},se(Z.account),9,Z_)]),u("td",null,[u("div",e1,[u("span",t1,se(w.value[Z.id]?Z.passwordPlain:"........"),1),u("button",{class:"btn btn-xs",onClick:ke=>xe(Z)},se(w.value[Z.id]?"隐藏":"显示"),9,n1),u("button",{class:"btn btn-xs",onClick:ke=>Fe(Z)},"复制",8,r1)])]),u("td",s1,se(Z.remark||"--"),1),u("td",null,[u("div",o1,[u("button",{class:"btn btn-xs",onClick:ke=>Ye(Z)},"编辑",8,i1),u("button",{class:"btn btn-xs",onClick:ke=>ee.value=Z},"删除",8,a1)])])]))),128)),S.value.length?Ee("",!0):(K(),H("tr",l1,[...X[17]||(X[17]=[u("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),u("div",u1,"共 "+se(y.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密存储于本机",1)],64)):(K(),H("div",B_,[u("div",U_,[Oe(ut,{name:"lock",size:26})]),t.value===!1?(K(),H(Re,{key:0},[X[12]||(X[12]=u("div",{class:"lock-title"},"设置主密码",-1)),X[13]||(X[13]=u("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":X[0]||(X[0]=Z=>o.value=Z),placeholder:"设置主密码(至少 6 位)",onKeydown:Dt(oe,["enter"])},null,544),[[Le,o.value]]),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":X[1]||(X[1]=Z=>a.value=Z),placeholder:"再次输入主密码",onKeydown:Dt(oe,["enter"])},null,544),[[Le,a.value]]),c.value?(K(),H("div",q_,se(c.value),1)):Ee("",!0),u("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:oe},"完成设置并解锁",8,H_)],64)):(K(),H(Re,{key:1},[X[14]||(X[14]=u("div",{class:"lock-title"},"密码库已锁定",-1)),X[15]||(X[15]=u("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":X[2]||(X[2]=Z=>d.value=Z),placeholder:"主密码",onKeydown:Dt(ge,["enter"])},null,544),[[Le,d.value]]),h.value?(K(),H("div",W_,se(h.value),1)):Ee("",!0),u("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:ge},"解锁",8,z_)],64))])),Oe(F_,{open:C.value,title:O.value?"编辑账号":"新增账号",initial:N.value,onCancel:X[4]||(X[4]=Z=>C.value=!1),onSave:me},null,8,["open","title","initial"]),Oe(lr,{open:!!ee.value,title:"删除确认",message:ee.value?"将删除系统「"+ee.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:X[5]||(X[5]=Z=>ee.value=null),onConfirm:Me},null,8,["open","message"]),(K(),It(Us,{to:"body"},[Oe(ss,{name:"modal"},{default:cr(()=>[te.value?(K(),H("div",{key:0,class:"mask",onClick:X[11]||(X[11]=Ir(Z=>te.value=!1,["self"]))},[u("div",c1,[u("div",f1,[X[19]||(X[19]=u("span",{class:"dialog-title"},"修改主密码",-1)),u("button",{class:"icon-btn",title:"关闭",onClick:X[6]||(X[6]=Z=>te.value=!1)},[Oe(ut,{name:"close",size:16})])]),u("div",d1,[u("div",p1,[X[20]||(X[20]=u("label",null,"旧主密码",-1)),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":X[7]||(X[7]=Z=>ue.value=Z)},null,512),[[Le,ue.value]])]),u("div",h1,[X[21]||(X[21]=u("label",null,"新主密码(至少 6 位)",-1)),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":X[8]||(X[8]=Z=>P.value=Z)},null,512),[[Le,P.value]])]),u("div",v1,[X[22]||(X[22]=u("label",null,"确认新主密码",-1)),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":X[9]||(X[9]=Z=>L.value=Z)},null,512),[[Le,L.value]])]),J.value?(K(),H("div",m1,se(J.value),1)):Ee("",!0),X[23]||(X[23]=u("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),u("div",y1,[u("button",{class:"btn btn-sm",onClick:X[10]||(X[10]=Z=>te.value=!1)},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:De},"确认修改")])])])):Ee("",!0)]),_:1})]))]))}}),w1=Yt(b1,[["__scopeId","data-v-6820bc9c"]]);function _1(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Bu(e,t){const s="\uFEFF"+t.map(d=>d.map(_1).join(",")).join(`\r
`);if(ns.isNativePlatform()){const{downloadText:d}=await Af(async()=>{const{downloadText:h}=await Promise.resolve().then(()=>pb);return{downloadText:h}},void 0,import.meta.url);return d(e,s)}const o=new Blob([s],{type:"text/csv;charset=utf-8"}),a=URL.createObjectURL(o),c=document.createElement("a");return c.href=a,c.download=e,c.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e4),""}const k1={class:"settings"},x1={class:"card section"},C1={class:"muted acc-line"},S1={class:"ai-grid"},E1={class:"rule-item"},$1={class:"rule-item"},T1={class:"rule-item"},P1={key:0,class:"form-error"},A1={class:"rule-save"},O1={class:"card section"},M1={class:"rule-grid"},I1={class:"rule-item"},j1={class:"rule-item"},D1={class:"rule-item"},L1={class:"rule-item"},R1={class:"rule-item"},K1={class:"card section"},F1={class:"proj-add"},N1={key:0,class:"muted proj-tip"},V1=["onKeydown"],B1=["onClick"],U1=["onClick"],q1=["onClick"],H1={key:1,class:"muted"},W1={class:"card section"},z1={class:"card section"},G1={class:"muted acc-line"},Y1={class:"rule-item"},J1={class:"rule-save"},X1=["disabled"],Q1={key:0,class:"muted acc-line"},Z1={key:1,class:"form-error"},e0={key:2,class:"form-error"},t0={class:"card section"},n0={class:"ai-grid"},r0={class:"rule-item"},s0={class:"rule-item"},o0={class:"rule-item"},i0={class:"card section"},a0={class:"backup-row"},l0={key:0,class:"import-error"},u0=Bt({__name:"SettingsView",setup(e){var k;const t=F({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=F([]),s=F(""),o=F(""),a=F(""),c=F(""),d=F(""),h=F(""),y=F(null),m=F(""),w=F(null),C=F(null),O=F(""),N=F(((k=wi())==null?void 0:k.username)||""),ee=F(""),te=F(""),ue=F(""),P=F(""),L=F(!1),J="0.2.0",ce=F(""),ie=F(""),Q=F(""),A=F(""),S=F(""),oe=F(!1),ge=F("");async function Y(){var _;ce.value=await Gv(),ie.value=((_=dr())==null?void 0:_.username)||"",ge.value=await Zv(),S.value=Jr.value}vt(Jr,_=>{S.value=_});async function xe(){await Lv(ce.value.trim()),Ue("同步地址已保存")}async function Fe(){A.value="";try{await _f(),Ue("云端绑定已重建")}catch(_){A.value=_ instanceof Error?_.message:"绑定失败"}}async function rt(){if(!oe.value){A.value="",S.value=Jr.value,oe.value=!0;try{await xe();const _=await Fa();ge.value=_.at,Q.value="推送 "+_.pushed+" 条 · 拉取 "+_.pulled+" 条 · 删除 "+_.removed+" 条",S.value="",Ue("同步完成")}catch(_){A.value=_ instanceof Error?_.message:"同步失败"}oe.value=!1}}async function We(){if(P.value="",te.value!==ue.value){P.value="两次输入的新密码不一致";return}try{await Wv(ee.value,te.value),ee.value="",te.value="",ue.value="",Ue("登录密码已修改")}catch(_){P.value=_ instanceof Error?_.message:"修改失败"}}async function Ye(){await zv(),window.location.reload()}async function me(){t.value=await Dr(),n.value=await Ns(!0),a.value=(await hl()).join(`
`),c.value=await gt("ai_base_url",""),d.value=await gt("ai_api_key",""),h.value=await gt("ai_model",""),await Y()}async function Me(){await jt("ai_base_url",c.value.trim()),await jt("ai_api_key",d.value.trim()),await jt("ai_model",h.value.trim()),Ue("AI 配置已保存")}async function Ne(){const _=xt(),x=await Promise.all([ki("2000-01-01",_),Ns(!0)]),z=x[0],ne=x[1],le=new Map(ne.map(ae=>[ae.id,ae.name])),be=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const ae of z)be.push([ae.date,ll(ae.category),ae.project_id&&le.get(ae.project_id)||"",ae.content,ae.minutes==null?"":ae.minutes,ae.is_milestone?"是":"",ae.needs_followup?"是":"",ae.takeaway||"",ae.remark||""]);const ve=await Bu("工作记录_"+_.replace(/-/g,"")+".csv",be);Ue(ve?"CSV 已导出到:"+ve:"CSV 已导出到系统下载目录")}async function De(){const _=xt(),x=await Promise.all([Dr(),_i("2000-01-01",_)]),z=x[0],ne=x[1],le=["周日","周一","周二","周三","周四","周五","周六"],be=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const ae of ne){const U=zs(ae,ae.date,z,ae.date===_);be.push([ae.date,le[os(ae.date).getDay()],U.label,ae.clock_in_at?Vn(ae.clock_in_at):"",ae.clock_out_at?Vn(ae.clock_out_at):"",ae.location||"",ae.kind==="makeup"?"补卡":ae.kind==="leave"?"休假":"正常",ae.note||""])}const ve=await Bu("考勤记录_"+_.replace(/-/g,"")+".csv",be);Ue(ve?"CSV 已导出到:"+ve:"CSV 已导出到系统下载目录")}mn(me);async function Ce(){await jt("work_start",t.value.work_start),await jt("work_end",t.value.work_end),await jt("grace_minutes",String(t.value.grace_minutes)),await jt("lunch_minutes",String(t.value.lunch_minutes)),await jt("remind_weekly",t.value.remind_weekly),Ue("打卡规则已保存")}async function X(){await $f(a.value.split(`
`)),Ue("常用地点已保存")}async function Z(){const _=s.value.trim();if(_){try{await mm(_),o.value="",s.value=""}catch{o.value="项目名已存在"}await me()}}function ke(_){y.value=_.id,m.value=_.name}async function Be(_){const x=m.value.trim();if(x)try{await ym(_.id,x),o.value=""}catch{o.value="项目名已存在"}y.value=null,await me()}async function dt(_){await gm(_.id,_.archived!==1),await me()}async function Jt(){try{const _=await Bm(),x=await ml("实习日志备份_"+xt().replace(/-/g,"")+".json",_);Ue(x?"备份已导出到:"+x:"备份已导出到系统下载目录")}catch(_){Ue("导出失败:"+(_ instanceof Error?_.message:String(_)))}}function Xt(_){const x=_.target,z=x.files&&x.files[0];if(O.value="",!z)return;const ne=z.name;z.text().then(le=>{C.value={name:ne,text:le}}),x.value=""}async function je(){if(C.value)try{await Um(C.value.text),C.value=null,O.value="",await me(),Ue("数据导入完成")}catch(_){C.value=null,O.value=_ instanceof Error?_.message:"导入失败"}}return(_,x)=>(K(),H("div",k1,[u("div",x1,[x[23]||(x[23]=u("div",{class:"section-title"},"账号与隐私",-1)),u("div",C1,"版本 v"+se(Zt(J))+" · 当前用户:"+se(N.value)+" · 每位用户独立数据库隔离存储于本机 · 登录密码仅保存 PBKDF2 哈希",1),u("div",S1,[u("div",E1,[x[20]||(x[20]=u("label",null,"旧登录密码",-1)),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":x[0]||(x[0]=z=>ee.value=z)},null,512),[[Le,ee.value]])]),u("div",$1,[x[21]||(x[21]=u("label",null,"新登录密码(至少 6 位)",-1)),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":x[1]||(x[1]=z=>te.value=z)},null,512),[[Le,te.value]])]),u("div",T1,[x[22]||(x[22]=u("label",null,"确认新登录密码",-1)),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":x[2]||(x[2]=z=>ue.value=z)},null,512),[[Le,ue.value]])])]),P.value?(K(),H("div",P1,se(P.value),1)):Ee("",!0),u("div",A1,[u("button",{class:"btn btn-primary btn-sm",onClick:We},"修改登录密码"),u("button",{class:"btn btn-sm btn-danger",onClick:x[3]||(x[3]=z=>L.value=!0)},"删除此用户及全部数据")])]),u("div",O1,[x[30]||(x[30]=u("div",{class:"section-title"},"打卡规则",-1)),u("div",M1,[u("div",I1,[x[24]||(x[24]=u("label",null,"上班时间",-1)),Te(u("input",{type:"time",class:"input","onUpdate:modelValue":x[4]||(x[4]=z=>t.value.work_start=z)},null,512),[[Le,t.value.work_start]])]),u("div",j1,[x[25]||(x[25]=u("label",null,"下班时间",-1)),Te(u("input",{type:"time",class:"input","onUpdate:modelValue":x[5]||(x[5]=z=>t.value.work_end=z)},null,512),[[Le,t.value.work_end]])]),u("div",D1,[x[26]||(x[26]=u("label",null,"迟到宽限(分钟)",-1)),Te(u("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":x[6]||(x[6]=z=>t.value.grace_minutes=z)},null,512),[[Le,t.value.grace_minutes,void 0,{number:!0}]])]),u("div",L1,[x[27]||(x[27]=u("label",null,"午休扣除(分钟)",-1)),Te(u("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":x[7]||(x[7]=z=>t.value.lunch_minutes=z)},null,512),[[Le,t.value.lunch_minutes,void 0,{number:!0}]])]),u("div",R1,[x[29]||(x[29]=u("label",null,"周记提醒",-1)),Te(u("select",{class:"select","onUpdate:modelValue":x[8]||(x[8]=z=>t.value.remind_weekly=z)},[...x[28]||(x[28]=[u("option",{value:"friday"},"每周五提醒",-1),u("option",{value:"off"},"关闭",-1)])],512),[[Fn,t.value.remind_weekly]])])]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:Ce},"保存规则")])]),u("div",K1,[x[31]||(x[31]=u("div",{class:"section-title"},"项目管理",-1)),u("div",F1,[Te(u("input",{class:"input","onUpdate:modelValue":x[9]||(x[9]=z=>s.value=z),placeholder:"新项目名称",onKeydown:Dt(Z,["enter"])},null,544),[[Le,s.value]]),u("button",{class:"btn btn-sm",onClick:Z},"添加")]),o.value?(K(),H("div",N1,se(o.value),1)):Ee("",!0),(K(!0),H(Re,null,ct(n.value,z=>(K(),H("div",{key:z.id,class:"proj-row"},[y.value===z.id?(K(),H(Re,{key:0},[Te(u("input",{class:"input","onUpdate:modelValue":x[10]||(x[10]=ne=>m.value=ne),onKeydown:Dt(ne=>Be(z),["enter"])},null,40,V1),[[Le,m.value]]),u("button",{class:"btn btn-sm",onClick:ne=>Be(z)},"保存",8,B1),u("button",{class:"btn btn-sm",onClick:x[11]||(x[11]=ne=>y.value=null)},"取消")],64)):(K(),H(Re,{key:1},[u("span",{class:tt(["proj-name",{archived:z.archived===1}])},se(z.name),3),u("button",{class:"icon-btn",title:"重命名",onClick:ne=>ke(z)},[Oe(ut,{name:"edit",size:14})],8,U1),u("button",{class:"btn btn-sm",onClick:ne=>dt(z)},se(z.archived===1?"恢复":"归档"),9,q1)],64))]))),128)),n.value.length?Ee("",!0):(K(),H("div",H1,"暂无项目,先添加一个"))]),u("div",W1,[x[33]||(x[33]=u("div",{class:"section-title"},"常用地点",-1)),Te(u("textarea",{class:"textarea","onUpdate:modelValue":x[12]||(x[12]=z=>a.value=z),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[Le,a.value]]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:X},"保存地点"),x[32]||(x[32]=u("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),u("div",z1,[x[35]||(x[35]=u("div",{class:"section-title"},"多端数据同步",-1)),u("div",G1,"云端账号:"+se(ie.value||"未绑定")+" · 数据仅保存在服务器,本机只是实时缓存(变更 ~3 秒推上云端 + 其他端秒级自动刷新);密码库同步密文,主密码永不出本机",1),u("div",Y1,[x[34]||(x[34]=u("label",null,"同步服务地址(默认即可)",-1)),Te(u("input",{class:"input","onUpdate:modelValue":x[13]||(x[13]=z=>ce.value=z),placeholder:"https://daywk.linyux.cn"},null,512),[[Le,ce.value]])]),u("div",J1,[u("button",{class:"btn btn-sm",onClick:xe},"保存地址"),u("button",{class:"btn btn-primary btn-sm",disabled:oe.value,onClick:rt},se(oe.value?"同步中":"立即同步"),9,X1),u("button",{class:"btn btn-sm",onClick:Fe},"重建云端绑定")]),Q.value?(K(),H("div",Q1,"上次同步:"+se(ge.value||"--")+" · "+se(Q.value),1)):Ee("",!0),A.value?(K(),H("div",Z1,se(A.value),1)):Ee("",!0),S.value?(K(),H("div",e0,"最近自动同步失败:"+se(S.value)+"(可点「立即同步」重试)",1)):Ee("",!0)]),u("div",t0,[x[40]||(x[40]=u("div",{class:"section-title"},"AI 润色配置(可选)",-1)),u("div",n0,[u("div",r0,[x[36]||(x[36]=u("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),Te(u("input",{class:"input","onUpdate:modelValue":x[14]||(x[14]=z=>c.value=z),placeholder:"https://api.example.com/v1"},null,512),[[Le,c.value]])]),u("div",s0,[x[37]||(x[37]=u("label",null,"API Key",-1)),Te(u("input",{class:"input","onUpdate:modelValue":x[15]||(x[15]=z=>d.value=z),placeholder:"sk-..."},null,512),[[Le,d.value]])]),u("div",o0,[x[38]||(x[38]=u("label",null,"模型名称",-1)),Te(u("input",{class:"input","onUpdate:modelValue":x[16]||(x[16]=z=>h.value=z),placeholder:"如:deepseek-chat"},null,512),[[Le,h.value]])])]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:Me},"保存 AI 配置"),x[39]||(x[39]=u("span",{class:"muted loc-note"},"配置仅保存在本机浏览器;总结页可用 AI 润色草稿,需服务端允许浏览器跨域",-1))])]),u("div",i0,[x[41]||(x[41]=u("div",{class:"section-title"},"数据备份",-1)),u("div",a0,[u("button",{class:"btn btn-sm",onClick:Jt},"导出 JSON 备份"),u("button",{class:"btn btn-sm",onClick:x[17]||(x[17]=z=>{var ne;return(ne=w.value)==null?void 0:ne.click()})},"导入 JSON 备份"),u("button",{class:"btn btn-sm",onClick:Ne},"导出工作记录 CSV"),u("button",{class:"btn btn-sm",onClick:De},"导出考勤 CSV"),u("input",{ref_key:"fileInput",ref:w,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:Xt},null,544)]),O.value?(K(),H("div",l0,se(O.value),1)):Ee("",!0),x[42]||(x[42]=u("div",{class:"muted backup-note"},"数据保存在浏览器 IndexedDB 中,建议定期导出 JSON 备份。",-1))]),Oe(lr,{open:!!C.value,title:"导入确认",message:C.value?"将从文件「"+C.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:x[18]||(x[18]=z=>C.value=null),onConfirm:je},null,8,["open","message"]),Oe(lr,{open:L.value,title:"删除用户确认",message:"将永久删除云端账号「"+N.value+"」及其服务器上的全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,任何设备都无法再取回,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:x[19]||(x[19]=z=>L.value=!1),onConfirm:Ye},null,8,["open","message"])]))}}),c0=Yt(u0,[["__scopeId","data-v-cea34561"]]),f0={class:"login-page"},d0={class:"card login-card"},p0={class:"login-brand"},h0={class:"brand-icon"},v0={class:"seg"},m0=["placeholder"],y0={key:1,class:"form-error"},g0=["disabled"],b0=Bt({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,s=F("login"),o=F(""),a=F(""),c=F(""),d=F(""),h=F(!1);function y(w){s.value=w,d.value="",c.value=""}async function m(){if(!h.value){d.value="",h.value=!0;try{let w;if(s.value==="login")w=await Vv(o.value,a.value);else{if(a.value.length<6){d.value="登录密码至少 6 位",h.value=!1;return}if(a.value!==c.value){d.value="两次输入的密码不一致",h.value=!1;return}w=await Bv(o.value,a.value)}n("login",w)}catch(w){d.value=w instanceof Error?w.message:"操作失败"}h.value=!1}}return(w,C)=>(K(),H("div",f0,[u("div",d0,[u("div",p0,[u("div",h0,[Oe(ut,{name:"calendar",size:22})]),C[5]||(C[5]=u("div",{class:"login-title"},"实习工作日志",-1)),C[6]||(C[6]=u("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),C[7]||(C[7]=u("div",{class:"muted login-sub"},"数据保存在云端服务器,所有设备登录同一账号即可实时同步",-1))]),u("div",v0,[u("button",{class:tt(["seg-btn",{active:s.value==="login"}]),onClick:C[0]||(C[0]=O=>y("login"))},"登录",2),u("button",{class:tt(["seg-btn",{active:s.value==="create"}]),onClick:C[1]||(C[1]=O=>y("create"))},"创建用户",2)]),Te(u("input",{class:"input","onUpdate:modelValue":C[2]||(C[2]=O=>o.value=O),placeholder:"用户名(2 到 20 个字符)",onKeydown:Dt(m,["enter"])},null,544),[[Le,o.value]]),Te(u("input",{type:"password",class:"input","onUpdate:modelValue":C[3]||(C[3]=O=>a.value=O),placeholder:s.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:Dt(m,["enter"])},null,40,m0),[[Le,a.value]]),s.value==="create"?Te((K(),H("input",{key:0,type:"password",class:"input","onUpdate:modelValue":C[4]||(C[4]=O=>c.value=O),placeholder:"再次输入密码",onKeydown:Dt(m,["enter"])},null,544)),[[Le,c.value]]):Ee("",!0),d.value?(K(),H("div",y0,se(d.value),1)):Ee("",!0),u("button",{class:"btn btn-primary login-btn",disabled:h.value,onClick:m},se(s.value==="login"?"登录":"创建并进入"),9,g0),C[8]||(C[8]=u("div",{class:"muted login-note"}," 登录密码仅服务器保存哈希;本机保存加密的自动登录凭据,登录后无需重复输入 ",-1))])]))}}),w0=Yt(b0,[["__scopeId","data-v-bf714afa"]]),_0={key:1,class:"app"},k0={class:"side"},x0=["data-tip","onClick"],C0={class:"main"},S0={class:"topbar"},E0={class:"title"},$0={class:"gsearch"},T0={key:0,class:"gs-panel"},P0={key:0,class:"gs-group muted"},A0=["onMousedown"],O0={class:"tag"},M0={class:"gs-text"},I0={class:"muted num gs-date"},j0={key:1,class:"gs-group muted"},D0=["onMousedown"],L0={class:"gs-text"},R0={class:"muted gs-sub"},K0={key:1,class:"gs-empty muted"},F0={class:"topbar-actions"},N0={class:"user-chip num"},V0=["disabled"],B0={class:"num"},U0={class:"content"},q0={class:"content-inner"},H0={class:"toast-wrap"},W0=Bt({__name:"App",setup(e){const t=Hm(),n=F(wi());async function s(me){n.value=me,ni(me.userId),location.hash="#/calendar",ce.value="calendar",await ge(),await Ye(),c();try{await _f(),await Qr()}catch{}Ue("欢迎,"+me.username);const Me=sessionStorage.getItem("dsh_migrate_toast");Me&&(sessionStorage.removeItem("dsh_migrate_toast"),Ue("已迁移原有数据 "+Me+" 条"))}async function o(){sm(),a!==null&&(window.clearInterval(a),a=null),await qv(),n.value=null,ce.value="calendar",location.hash="#/calendar",Ue("已退出登录")}let a=null;function c(){rm(),a!==null&&window.clearInterval(a),a=window.setInterval(()=>{Qr()},60*1e3),Qr()}const d=F(null),h=F(""),y=F(!1),m=F({logs:[],memos:[]});let w=null;const C=at(()=>!!(m.value.logs.length||m.value.memos.length));function O(){w&&window.clearTimeout(w);const me=h.value;w=window.setTimeout(async()=>{const Me=me.trim();if(!Me){m.value={logs:[],memos:[]};return}const Ne=await Promise.all([Dm(Me,8),Lm(Me,4)]);m.value={logs:Ne[0],memos:Ne[1]}},200)}function N(){h.value="",m.value={logs:[],memos:[]},y.value=!1}function ee(me){Ra.value=me.date,ie("calendar"),N()}function te(me){Ka.value=me.id,ie("memo"),N()}function ue(){window.setTimeout(()=>{y.value=!1},150)}function P(me){var Me;(me.ctrlKey||me.metaKey)&&me.key.toLowerCase()==="k"&&(me.preventDefault(),(Me=d.value)==null||Me.focus())}const L=[{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 J(){const me=(location.hash||"").replace("#/","");return L.some(Me=>Me.key===me)?me:"calendar"}const ce=F(J());window.addEventListener("hashchange",()=>{ce.value=J()});function ie(me){location.hash="#/"+me}const Q=at(()=>L.find(me=>me.key===ce.value)||L[0]),A=F(xt()),S=F(void 0),oe=F(!1);async function ge(){if(S.value=await yn(A.value),oe.value=!1,new Date().getHours()<4){const Me=await yn(Kn(A.value,-1));oe.value=!!(Me&&Me.clock_in_at&&!Me.clock_out_at)}}const Y=at(()=>{const me=S.value;return me&&me.clock_in_at&&!me.clock_out_at?!0:oe.value&&!(me&&me.clock_in_at)}),xe=at(()=>{const me=S.value;return!!(me&&me.clock_in_at&&me.clock_out_at)}),Fe=at(()=>{const me=S.value;return Y.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(Y.value)try{await wm()}catch{}else await Tf(A.value);await ge(),er()}vt(Ws,()=>{n.value&&ge()});const We=F(!1);async function Ye(){if((await Dr()).remind_weekly==="off"){We.value=!1;return}const Me=new Date().getDay();if(Me===5||Me===6||Me===0){const Ne=await vl(Ts(A.value));We.value=!Ne||!Ne.highlights&&!Ne.challenges&&!Ne.plan_next}else We.value=!1}return mn(async()=>{window.addEventListener("keydown",P),n.value&&(ni(n.value.userId),await ge(),await Ye(),c())}),(me,Me)=>{var Ne;return n.value?(K(),H("div",_0,[u("nav",k0,[(K(),H(Re,null,ct(L,De=>u("button",{key:De.key,class:tt(["nav-btn",{active:ce.value===De.key}]),"data-tip":De.name,onClick:Ce=>ie(De.key)},[Oe(ut,{name:De.icon,size:18},null,8,["name"])],10,x0)),64))]),u("div",C0,[u("header",S0,[u("span",E0,se(Q.value.name),1),u("div",$0,[Oe(ut,{name:"search",size:14,class:"gs-icon"}),Te(u("input",{ref_key:"gsInput",ref:d,class:"input gs-input","onUpdate:modelValue":Me[0]||(Me[0]=De=>h.value=De),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:O,onFocus:Me[1]||(Me[1]=De=>y.value=!0),onBlur:ue,onKeydown:Dt(N,["esc"])},null,544),[[Le,h.value]]),y.value&&h.value.trim()?(K(),H("div",T0,[C.value?(K(),H(Re,{key:0},[m.value.logs.length?(K(),H("div",P0,"工作记录")):Ee("",!0),(K(!0),H(Re,null,ct(m.value.logs,De=>(K(),H("div",{key:"l"+De.id,class:"gs-item",onMousedown:Ir(Ce=>ee(De),["prevent"])},[u("span",O0,se(Zt(ll)(De.category)),1),u("span",M0,se(De.content),1),u("span",I0,se(De.date),1)],40,A0))),128)),m.value.memos.length?(K(),H("div",j0,"备忘录")):Ee("",!0),(K(!0),H(Re,null,ct(m.value.memos,De=>(K(),H("div",{key:"m"+De.id,class:"gs-item",onMousedown:Ir(Ce=>te(De),["prevent"])},[u("span",L0,se(De.title||"无标题"),1),u("span",R0,se(De.content),1)],40,D0))),128))],64)):(K(),H("div",K0,"无匹配结果"))])):Ee("",!0)]),Me[4]||(Me[4]=u("span",{class:"flex1"},null,-1)),u("div",F0,[We.value?(K(),H("button",{key:0,class:"week-tip",onClick:Me[2]||(Me[2]=De=>ie("report"))},[...Me[3]||(Me[3]=[u("span",{class:"dot",style:{background:"var(--warn)"}},null,-1),rn(" 填写本周周记 ",-1)])])):Ee("",!0),u("span",N0,se((Ne=n.value)==null?void 0:Ne.username),1),u("button",{class:"btn btn-sm",onClick:o},"退出"),u("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"]),u("span",B0,se(Fe.value),1)],8,V0)])]),u("main",U0,[u("div",q0,[ce.value==="calendar"?(K(),It(hg,{key:0})):ce.value==="today"?(K(),It(wg,{key:1})):ce.value==="stats"?(K(),It(Xg,{key:2})):ce.value==="report"?(K(),It(Jb,{key:3})):ce.value==="ledger"?(K(),It(a_,{key:4})):ce.value==="memo"?(K(),It(S_,{key:5})):ce.value==="vault"?(K(),It(w1,{key:6})):(K(),It(c0,{key:7}))])])]),u("div",H0,[Oe(Eh,{name:"toast"},{default:cr(()=>[(K(!0),H(Re,null,ct(Zt(t),De=>(K(),H("div",{key:De.id,class:"toast"},se(De.text),1))),128))]),_:1})])])):(K(),It(w0,{key:0,onLogin:s}))}}}),z0=Yt(W0,[["__scopeId","data-v-d5bd1ff7"]]);function Lo(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{}}async function G0(){const e=await Uv();e&&ni(e.userId);const t=Vh(z0);t.config.errorHandler=(n,s,o)=>{const a=n;Lo("应用内部错误(点击空白处关闭,请将以下内容发送给开发者)",a&&(a.stack||a.message)||String(n)+`
触发位置: `+o)},window.addEventListener("unhandledrejection",n=>{const s=n.reason;Lo("未处理的异步错误(点击空白处关闭)",s&&(s.stack||s.message)||String(n.reason))}),window.addEventListener("error",n=>{n.message&&n.message!=="ResizeObserver loop limit exceeded"&&Lo("运行错误(点击空白处关闭)",n.message)}),t.mount("#app"),"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})})}G0().catch(e=>{Lo("无法启动:连接同步服务器失败",e&&(e.stack||e.message)||String(e))});export{If as W,Af as _,fb as b,Mf as r};