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

27 lines
333 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"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
* @vue/shared v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function zi(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const _t={},Os=[],An=()=>{},qu=()=>!1,la=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ua=e=>e.startsWith("onUpdate:"),It=Object.assign,Gi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},af=Object.prototype.hasOwnProperty,vt=(e,t)=>af.call(e,t),Ye=Array.isArray,os=e=>zr(e)==="[object Map]",Ds=e=>zr(e)==="[object Set]",Ql=e=>zr(e)==="[object Date]",st=e=>typeof e=="function",St=e=>typeof e=="string",On=e=>typeof e=="symbol",ht=e=>e!==null&&typeof e=="object",Hu=e=>(ht(e)||st(e))&&st(e.then)&&st(e.catch),Wu=Object.prototype.toString,zr=e=>Wu.call(e),lf=e=>zr(e).slice(8,-1),zu=e=>zr(e)==="[object Object]",Yi=e=>St(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,$r=zi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ca=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},uf=/-\w/g,yn=ca(e=>e.replace(uf,t=>t.slice(1).toUpperCase())),cf=/\B([A-Z])/g,ps=ca(e=>e.replace(cf,"-$1").toLowerCase()),Gu=ca(e=>e.charAt(0).toUpperCase()+e.slice(1)),ni=ca(e=>e?`on${Gu(e)}`:""),Tn=(e,t)=>!Object.is(e,t),Oo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Yu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},da=e=>{const t=parseFloat(e);return isNaN(t)?e:t},df=e=>{const t=St(e)?Number(e):NaN;return isNaN(t)?e:t};let Zl;const fa=()=>Zl||(Zl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function as(e){if(Ye(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=St(r)?mf(r):as(r);if(o)for(const i in o)t[i]=o[i]}return t}else if(St(e)||ht(e))return e}const ff=/;(?![^(]*\))/g,pf=/:([^]+)/,vf=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function mf(e){const t={};return e.replace(vf,n=>n.startsWith("/*")?"":n).split(ff).forEach(n=>{if(n){const r=n.split(pf);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function tt(e){let t="";if(St(e))t=e;else if(Ye(e))for(let n=0;n<e.length;n++){const r=tt(e[n]);r&&(t+=r+" ")}else if(ht(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const hf="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",yf=zi(hf);function Ju(e){return!!e||e===""}function gf(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let o=0;r&&o<e.length;o++)r=ls(e[o],t[o],n);return r}function eu(e,t,n){if(e.size!==t.size)return!1;const r=Array.from(t),o=new Uint8Array(r.length);for(const i of e){let c=-1;for(let f=0;f<r.length;f++)if(!o[f]&&ls(i,r[f],n)){c=f;break}if(c<0)return!1;o[c]=1}return!0}function bf(e,t,n){let r=os(e),o=os(t);if(r||o||(r=Ds(e),o=Ds(t),r||o))return r&&o?eu(e,t,n):!1;const i=Object.keys(e).length,c=Object.keys(t).length;if(i!==c)return!1;for(const f in e){const v=e.hasOwnProperty(f),y=t.hasOwnProperty(f);if(v&&!y||!v&&y||!ls(e[f],t[f],n))return!1}return String(e)===String(t)}function tu(e,t,n,r){n||(n=[new Map,new Map]);const[o,i]=n;if(o.has(e)||i.has(t))return o.get(e)===t&&i.get(t)===e;o.set(e,t),i.set(t,e);const c=r(e,t,n);return o.delete(e),i.delete(t),c}function ls(e,t,n){if(e===t)return!0;let r=Ql(e),o=Ql(t);return r||o?r&&o?e.getTime()===t.getTime():!1:(r=On(e),o=On(t),r||o?e===t:(r=Ye(e),o=Ye(t),r||o?r&&o?tu(e,t,n,gf):!1:(r=ht(e),o=ht(t),r||o?!r||!o?!1:tu(e,t,n,bf):String(e)===String(t))))}function wf(e,t){return e.findIndex(n=>ls(n,t))}const Xu=e=>!!(e&&e.__v_isRef===!0),z=e=>St(e)?e:e==null?"":Ye(e)||ht(e)&&(e.toString===Wu||!st(e.toString))?Xu(e)?z(e.value):JSON.stringify(e,Qu,2):String(e),Qu=(e,t)=>Xu(t)?Qu(e,t.value):os(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],i)=>(n[si(r,i)+" =>"]=o,n),{})}:Ds(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>si(n))}:On(t)?si(t):ht(t)&&!Ye(t)&&!zu(t)?String(t):t,si=(e,t="")=>{var n;return On(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 Bt;class _f{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&&Bt&&(Bt.active?(this.parent=Bt,this.index=(Bt.scopes||(Bt.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 r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[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 r=this.effects.slice();for(t=0,n=r.length;t<n;t++)r[t].resume()}}run(t){if(this._active){const n=Bt;try{return Bt=this,t()}finally{Bt=n}}}on(){++this._on===1&&(this.prevScope=Bt,Bt=this)}off(){if(this._on>0&&--this._on===0){if(Bt===this)Bt=this.prevScope;else{let t=Bt;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,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,r=o.length;n<r;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 kf(){return Bt}let xt;const ri=new WeakSet;class Zu{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,Bt&&(Bt.active?Bt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ri.has(this)&&(ri.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||tc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,nu(this),nc(this);const t=xt,n=gn;xt=this,gn=!0;try{return this.fn()}finally{sc(this),xt=t,gn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Qi(t);this.deps=this.depsTail=void 0,nu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ri.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){wi(this)&&this.run()}get dirty(){return wi(this)}}let ec=0,Sr,Er;function tc(e,t=!1){if(e.flags|=8,t){e.next=Er,Er=e;return}e.next=Sr,Sr=e}function Ji(){ec++}function Xi(){if(--ec>0)return;if(Er){let t=Er;for(Er=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Sr;){let t=Sr;for(Sr=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function nc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function sc(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Qi(r),xf(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function wi(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===Ir)||(e.globalVersion=Ir,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!wi(e))))return;e.flags|=2;const t=e.dep,n=xt,r=gn;xt=e,gn=!0;try{nc(e);const o=e.fn(e._value);(t.version===0||Tn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{xt=n,gn=r,sc(e),e.flags&=-3}}function Qi(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Qi(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function xf(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let gn=!0;const oc=[];function Mn(){oc.push(gn),gn=!1}function In(){const e=oc.pop();gn=e===void 0?!0:e}function nu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=xt;xt=void 0;try{t()}finally{xt=n}}}let Ir=0;class Cf{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 Zi{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(!xt||!gn||xt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==xt)n=this.activeLink=new Cf(xt,this),xt.deps?(n.prevDep=xt.depsTail,xt.depsTail.nextDep=n,xt.depsTail=n):xt.deps=xt.depsTail=n,ac(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=xt.depsTail,n.nextDep=void 0,xt.depsTail.nextDep=n,xt.depsTail=n,xt.deps===n&&(xt.deps=r)}return n}trigger(t){this.version++,Ir++,this.notify(t)}notify(t){Ji();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Xi()}}}function ac(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)ac(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const _i=new WeakMap,Is=Symbol(""),ki=Symbol(""),jr=Symbol("");function zt(e,t,n){if(gn&&xt){let r=_i.get(e);r||_i.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Zi),o.map=r,o.key=n),o.track()}}function Fn(e,t,n,r,o,i){const c=_i.get(e);if(!c){Ir++;return}const f=v=>{v&&v.trigger()};if(Ji(),t==="clear")c.forEach(f);else{const v=Ye(e),y=v&&Yi(n);if(v&&n==="length"){const h=Number(r);c.forEach((w,C)=>{(C==="length"||C===jr||!On(C)&&C>=h)&&f(w)})}else switch((n!==void 0||c.has(void 0))&&f(c.get(n)),y&&f(c.get(jr)),t){case"add":v?y&&f(c.get("length")):(f(c.get(Is)),os(e)&&f(c.get(ki)));break;case"delete":v||(f(c.get(Is)),os(e)&&f(c.get(ki)));break;case"set":os(e)&&f(c.get(Is));break}}Xi()}function Gs(e){const t=pt(e);return t===e||(zt(t,"iterate",jr),fn(e))?t:jn(e)?is(e)?t.map(n=>us(pn(n))):t.map(us):t.map(pn)}function pa(e){return zt(e=pt(e),"iterate",jr),e}function $n(e,t){return jn(e)?us(is(e)?pn(t):t):pn(t)}const $f={__proto__:null,[Symbol.iterator](){return oi(this,Symbol.iterator,e=>$n(this,e))},concat(...e){return Gs(this).concat(...e.map(t=>Ye(t)?Gs(t):t))},entries(){return oi(this,"entries",e=>(e[1]=$n(this,e[1]),e))},every(e,t){return Kn(this,"every",e,t,void 0,arguments)},filter(e,t){return Kn(this,"filter",e,t,n=>n.map(r=>$n(this,r)),arguments)},find(e,t){return Kn(this,"find",e,t,n=>$n(this,n),arguments)},findIndex(e,t){return Kn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Kn(this,"findLast",e,t,n=>$n(this,n),arguments)},findLastIndex(e,t){return Kn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Kn(this,"forEach",e,t,void 0,arguments)},includes(...e){return ai(this,"includes",e)},indexOf(...e){return ai(this,"indexOf",e)},join(e){return Gs(this).join(e)},lastIndexOf(...e){return ai(this,"lastIndexOf",e)},map(e,t){return Kn(this,"map",e,t,void 0,arguments)},pop(){return br(this,"pop")},push(...e){return br(this,"push",e)},reduce(e,...t){return ru(this,"reduce",e,t)},reduceRight(e,...t){return ru(this,"reduceRight",e,t)},shift(){return br(this,"shift")},some(e,t){return Kn(this,"some",e,t,void 0,arguments)},splice(...e){return br(this,"splice",e)},toReversed(){return Gs(this).toReversed()},toSorted(e){return Gs(this).toSorted(e)},toSpliced(...e){return Gs(this).toSpliced(...e)},unshift(...e){return br(this,"unshift",e)},values(){return oi(this,"values",e=>$n(this,e))}};function oi(e,t,n){const r=pa(e),o=r[t],i=o.call(r);if(r!==e&&!fn(e)){if(i[Symbol.toStringTag]==="Array Iterator"){const c=Object.create(Object.getPrototypeOf(i));return c.next=()=>su(i.next(),n),o!==ic[t]&&Object.defineProperties(c,{return:{get(){const f=i.return;return typeof f=="function"?f.bind(i):f}},throw:{get(){const f=i.throw;return typeof f=="function"?f.bind(i):f}}}),c}i._next=i.next,i.next=()=>su(i._next(),n)}return i}function su(e,t){return e.done||(e.value=t(e.value)),e}const ic=Array.prototype;function Kn(e,t,n,r,o,i){const c=pa(e),f=c!==e&&!fn(e),v=c[t];if(v!==ic[t]){const w=v.apply(e,i);return f?pn(w):w}let y=n;c!==e&&(f?y=function(w,C){return n.call(this,$n(e,w),C,e)}:n.length>2&&(y=function(w,C){return n.call(this,w,C,e)}));const h=v.call(c,y,r);return f&&o?o(h):h}function ru(e,t,n,r){const o=pa(e),i=o!==e&&!fn(e);let c=n,f=!1;o!==e&&(i?(f=r.length===0,c=function(y,h,w){return f&&(f=!1,y=$n(e,y)),n.call(this,y,$n(e,h),w,e)}):n.length>3&&(c=function(y,h,w){return n.call(this,y,h,w,e)}));const v=o[t](c,...r);return f?$n(e,v):v}function ai(e,t,n){const r=pt(e);zt(r,"iterate",jr);const o=r[t](...n);return(o===-1||o===!1)&&sl(n[0])?(n[0]=pt(n[0]),r[t](...n)):o}function br(e,t,n=[]){Mn(),Ji();const r=pt(e)[t].apply(e,n);return Xi(),In(),r}const Sf=zi("__proto__,__v_isRef,__isVue"),lc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(On));function Ef(e){On(e)||(e=String(e));const t=pt(this);return zt(t,"has",e),t.hasOwnProperty(e)}class uc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(o?i?Kf:pc:i?fc:dc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const c=Ye(t);if(!o){let v;if(c&&(v=$f[n]))return v;if(n==="hasOwnProperty")return Ef}const f=Reflect.get(t,n,Yt(t)?t:r);if((On(n)?lc.has(n):Sf(n))||(o||zt(t,"get",n),i))return f;if(Yt(f)){const v=c&&Yi(n)?f:f.value;return o&&ht(v)?Ci(v):v}return ht(f)?o?Ci(f):tl(f):f}}class cc extends uc{constructor(t=!1){super(!1,t)}set(t,n,r,o){let i=t[n];const c=Ye(t)&&Yi(n);if(!this._isShallow){const y=jn(i);if(!fn(r)&&!jn(r)&&(i=pt(i),r=pt(r)),!c&&Yt(i)&&!Yt(r))return y||(i.value=r),!0}const f=c?Number(n)<t.length:vt(t,n),v=Reflect.set(t,n,r,Yt(t)?t:o);return t===pt(o)&&v&&(f?Tn(r,i)&&Fn(t,"set",n,r):Fn(t,"add",n,r)),v}deleteProperty(t,n){const r=vt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&Fn(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return(!On(n)||!lc.has(n))&&zt(t,"has",n),r}ownKeys(t){return zt(t,"iterate",Ye(t)?"length":Is),Reflect.ownKeys(t)}}class Tf extends uc{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Af=new cc,Pf=new Tf,Of=new cc(!0);const xi=e=>e,Co=e=>Reflect.getPrototypeOf(e);function Mf(e,t,n){return function(...r){const o=this.__v_raw,i=pt(o),c=os(i),f=e==="entries"||e===Symbol.iterator&&c,v=e==="keys"&&c,y=o[e](...r),h=n?xi:t?us:pn;return!t&&zt(i,"iterate",v?ki:Is),It(Object.create(y),{next(){const{value:w,done:C}=y.next();return C?{value:w,done:C}:{value:f?[h(w[0]),h(w[1])]:h(w),done:C}}})}}function $o(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function If(e,t){const n={get(o){const i=this.__v_raw,c=pt(i),f=pt(o);e||(Tn(o,f)&&zt(c,"get",o),zt(c,"get",f));const{has:v}=Co(c),y=t?xi:e?us:pn;if(v.call(c,o))return y(i.get(o));if(v.call(c,f))return y(i.get(f));i!==c&&i.get(o)},get size(){const o=this.__v_raw;return!e&&zt(pt(o),"iterate",Is),o.size},has(o){const i=this.__v_raw,c=pt(i),f=pt(o);return e||(Tn(o,f)&&zt(c,"has",o),zt(c,"has",f)),o===f?i.has(o):i.has(o)||i.has(f)},forEach(o,i){const c=this,f=c.__v_raw,v=pt(f),y=t?xi:e?us:pn;return!e&&zt(v,"iterate",Is),f.forEach((h,w)=>o.call(i,y(h),y(w),c))}};return It(n,e?{add:$o("add"),set:$o("set"),delete:$o("delete"),clear:$o("clear")}:{add(o){const i=pt(this),c=Co(i),f=pt(o),v=!t&&!fn(o)&&!jn(o)?f:o;return c.has.call(i,v)||Tn(o,v)&&c.has.call(i,o)||Tn(f,v)&&c.has.call(i,f)||(i.add(v),Fn(i,"add",v,v)),this},set(o,i){!t&&!fn(i)&&!jn(i)&&(i=pt(i));const c=pt(this),{has:f,get:v}=Co(c);let y=f.call(c,o);y||(o=pt(o),y=f.call(c,o));const h=v.call(c,o);return c.set(o,i),y?Tn(i,h)&&Fn(c,"set",o,i):Fn(c,"add",o,i),this},delete(o){const i=pt(this),{has:c,get:f}=Co(i);let v=c.call(i,o);v||(o=pt(o),v=c.call(i,o)),f&&f.call(i,o);const y=i.delete(o);return v&&Fn(i,"delete",o,void 0),y},clear(){const o=pt(this),i=o.size!==0,c=o.clear();return i&&Fn(o,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Mf(o,e,t)}),n}function el(e,t){const n=If(e,t);return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?r:Reflect.get(vt(n,o)&&o in r?n:r,o,i)}const jf={get:el(!1,!1)},Df={get:el(!1,!0)},Lf={get:el(!0,!1)};const dc=new WeakMap,fc=new WeakMap,pc=new WeakMap,Kf=new WeakMap;function Rf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function tl(e){return jn(e)?e:nl(e,!1,Af,jf,dc)}function Nf(e){return nl(e,!1,Of,Df,fc)}function Ci(e){return nl(e,!0,Pf,Lf,pc)}function nl(e,t,n,r,o){if(!ht(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const c=Rf(lf(e));if(c===0)return e;const f=new Proxy(e,c===2?r:n);return o.set(e,f),f}function is(e){return jn(e)?is(e.__v_raw):!!(e&&e.__v_isReactive)}function jn(e){return!!(e&&e.__v_isReadonly)}function fn(e){return!!(e&&e.__v_isShallow)}function sl(e){return e?!!e.__v_raw:!1}function pt(e){const t=e&&e.__v_raw;return t?pt(t):e}function Ff(e){return!vt(e,"__v_skip")&&Object.isExtensible(e)&&Yu(e,"__v_skip",!0),e}const pn=e=>ht(e)?tl(e):e,us=e=>ht(e)?Ci(e):e;function Yt(e){return e?e.__v_isRef===!0:!1}function P(e){return Vf(e,!1)}function Vf(e,t){return Yt(e)?e:new Bf(e,t)}class Bf{constructor(t,n){this.dep=new Zi,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:pt(t),this._value=n?t:pn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||fn(t)||jn(t);t=r?t:pt(t),Tn(t,n)&&(this._rawValue=t,this._value=r?t:pn(t),this.dep.trigger())}}function cn(e){return Yt(e)?e.value:e}const Uf={get:(e,t,n)=>t==="__v_raw"?e:cn(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Yt(o)&&!Yt(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function vc(e){return is(e)?e:new Proxy(e,Uf)}class qf{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Zi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ir-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&xt!==this)return tc(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 Hf(e,t,n=!1){let r,o;return st(e)?r=e:(r=e.get,o=e.set),new qf(r,o,n)}const So={},Vo=new WeakMap;let Ss;function Wf(e,t=!1,n=Ss){if(n){let r=Vo.get(n);r||Vo.set(n,r=[]),r.push(e)}}function zf(e,t,n=_t){const{immediate:r,deep:o,once:i,scheduler:c,augmentJob:f,call:v}=n,y=T=>o?T:fn(T)||o===!1||o===0?Vn(T,1):Vn(T);let h,w,C,O,B=!1,te=!1;if(Yt(e)?(w=()=>e.value,B=fn(e)):is(e)?(w=()=>y(e),B=!0):Ye(e)?(te=!0,B=e.some(T=>is(T)||fn(T)),w=()=>e.map(T=>{if(Yt(T))return T.value;if(is(T))return y(T);if(st(T))return v?v(T,2):T()})):st(e)?t?w=v?()=>v(e,2):e:w=()=>{if(C){Mn();try{C()}finally{In()}}const T=Ss;Ss=h;try{return v?v(e,3,[O]):e(O)}finally{Ss=T}}:w=An,t&&o){const T=w,U=o===!0?1/0:o;w=()=>Vn(T(),U)}const se=kf(),ae=()=>{h.stop(),se&&se.active&&Gi(se.effects,h)};if(i&&t){const T=t;t=(...U)=>{try{return T(...U)}finally{ae()}}}let re=te?new Array(e.length).fill(So):So;const V=T=>{if(!(!(h.flags&1)||!h.dirty&&!T))if(t){const U=h.run();if(T||o||B||(te?U.some((J,Y)=>Tn(J,re[Y])):Tn(U,re))){const J=Ss;Mn();try{C&&C(),Ss=h;const Y=[U,re===So?void 0:te&&re[0]===So?[]:re,O];re=U,v?v(t,3,Y):t(...Y)}finally{Ss=J,In()}}}else h.run()};return f&&f(V),h=new Zu(w),h.scheduler=c?()=>c(V,!1):V,O=T=>Wf(T,!1,h),C=h.onStop=()=>{const T=Vo.get(h);if(T){if(v)v(T,4);else for(const U of T)U();Vo.delete(h)}},t?r?V(!0):re=h.run():c?c(V.bind(null,!0),!0):h.run(),ae.pause=h.pause.bind(h),ae.resume=h.resume.bind(h),ae.stop=ae,ae}function Vn(e,t=1/0,n){if(t<=0||!ht(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Yt(e))Vn(e.value,t,n);else if(Ye(e))for(let r=0;r<e.length;r++)Vn(e[r],t,n);else if(Ds(e)||os(e))e.forEach(r=>{Vn(r,t,n)});else if(zu(e)){for(const r in e)Vn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Vn(e[r],t,n)}return e}/**
* @vue/runtime-core v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Gr(e,t,n,r){try{return r?e(...r):e()}catch(o){va(o,t,n)}}function vn(e,t,n,r){if(st(e)){const o=Gr(e,t,n,r);return o&&Hu(o)&&o.catch(i=>{va(i,t,n)}),o}if(Ye(e)){const o=[];for(let i=0;i<e.length;i++)o.push(vn(e[i],t,n,r));return o}}function va(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||_t;if(t){let f=t.parent;const v=t.proxy,y=`https://vuejs.org/error-reference/#runtime-${n}`;for(;f;){const h=f.ec;if(h){for(let w=0;w<h.length;w++)if(h[w](e,v,y)===!1)return}f=f.parent}if(i){Mn(),Gr(i,null,10,[e,v,y]),In();return}}Gf(e,n,o,r,c)}function Gf(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}const Zt=[];let hn=-1;const Sn=[];let ss=null,Ys=0;const mc=Promise.resolve();let Bo=null;function ir(e){const t=Bo||mc;return e?t.then(this?e.bind(this):e):t}function Yf(e){let t=hn+1,n=Zt.length;for(;t<n;){const r=t+n>>>1,o=Zt[r],i=Dr(o);i<e||i===e&&o.flags&2?t=r+1:n=r}return t}function rl(e){if(!(e.flags&1)){const t=Dr(e),n=Zt[Zt.length-1];!n||!(e.flags&2)&&t>=Dr(n)?Zt.push(e):Zt.splice(Yf(t),0,e),e.flags|=1,hc()}}function hc(){Bo||(Bo=mc.then(bc))}function Jf(e){if(!Ye(e))ss&&e.id===-1?ss.splice(Ys+1,0,e):e.flags&1||(Sn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Sn.push(e[t]);hc()}function yc(e,t,n,r=hn+1){for(;r<Zt.length;r++){const o=Zt[r];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;Zt.splice(r,1),r=e?r-1:hn,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function gc(e,t,n=0){if(Sn.length){let r=Sn,o=0;if(t){r=[];for(let c=0;c<Sn.length;c++){const f=Sn[c];(f.i!==void 0?!f.i||f.i.uid<n:t.has(f))?Sn[o++]=f:r.push(f)}}const i=[...new Set(r)].sort((c,f)=>Dr(c)-Dr(f));if(Sn.length=o,ss){for(let c=0;c<i.length;c++)ss.push(i[c]);return}for(ss=i,Ys=0;Ys<ss.length;Ys++){const c=ss[Ys];c.flags&4&&(c.flags&=-2),c.flags&8||c(),c.flags&=-2}ss=null,Ys=0}}let ii=!1;function Xf(e,t){if(ii){e();return}const n=t===void 0?void 0:new Set(Sn);e(),ii=!0;try{yc(void 0,t),gc(void 0,n,t)}finally{ii=!1}}const Dr=e=>e.id==null?e.flags&2?-1:1/0:e.id;function bc(e){try{for(hn=0;hn<Zt.length;hn++){const t=Zt[hn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Gr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;hn<Zt.length;hn++){const t=Zt[hn];t&&(t.flags&=-2)}hn=-1,Zt.length=0,gc(),Bo=null,(Zt.length||Sn.length)&&bc()}}let dn=null,wc=null;function Uo(e){const t=dn;return dn=e,wc=e&&e.type.__scopeId||null,t}function vs(e,t=dn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&zo(-1);const i=Uo(t),c=js.length;let f;try{f=e(...o)}finally{for(let v=js.length;v>c;v--)Gc();Uo(i),r._d&&zo(1)}return f};return r._n=!0,r._c=!0,r._d=!0,r}function Oe(e,t){if(dn===null)return e;const n=wa(dn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,c,f,v=_t]=t[o];i&&(st(i)&&(i={mounted:i,updated:i}),i.deep&&Vn(c),r.push({dir:i,instance:n,value:c,oldValue:void 0,arg:f,modifiers:v}))}return e}function xs(e,t,n,r){const o=e.dirs,i=t&&t.dirs;for(let c=0;c<o.length;c++){const f=o[c];i&&(f.oldValue=i[c].value);let v=f.dir[r];v&&(Mn(),vn(v,n,8,[e.el,f,e,t]),In())}}function Qf(e,t){if(tn){let n=tn.provides;const r=tn.parent&&tn.parent.provides;r===n&&(n=tn.provides=Object.create(r)),n[e]=t}}function Mo(e,t,n=!1){const r=ul();if(r||Xs){let o=Xs?Xs._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&st(t)?t.call(r&&r.proxy):t}}const Zf=Symbol.for("v-scx"),ep=()=>Mo(Zf);function wt(e,t,n){return _c(e,t,n)}function _c(e,t,n=_t){const{immediate:r,deep:o,flush:i,once:c}=n,f=It({},n),v=t&&r||!t&&i!=="post";let y;if(Vr){if(i==="sync"){const O=ep();y=O.__watcherHandles||(O.__watcherHandles=[])}else if(!v){const O=()=>{};return O.stop=An,O.resume=An,O.pause=An,O}}const h=tn;f.call=(O,B,te)=>vn(O,h,B,te);let w=!1;i==="post"?f.scheduler=O=>{O.i=h,Qt(O,h&&h.suspense)}:i!=="sync"&&(w=!0,f.scheduler=(O,B)=>{B?O():rl(O)}),f.augmentJob=O=>{t&&(O.flags|=4),w&&(O.flags|=2,h&&(O.id=h.uid,O.i=h))};const C=zf(e,t,f);return Vr&&(y?y.push(C):v&&C()),C}function tp(e,t,n){const r=this.proxy,o=St(e)?e.includes(".")?kc(r,e):()=>r[e]:e.bind(r,r);let i;st(t)?i=t:(i=t.handler,n=t);const c=Yr(this),f=_c(o,i.bind(r),n);return c(),f}function kc(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const ts=new WeakMap,xc=Symbol("_vte"),ma=e=>e.__isTeleport,Ts=e=>e&&(e.disabled||e.disabled===""),np=e=>e&&(e.defer||e.defer===""),ou=e=>typeof SVGElement<"u"&&e instanceof SVGElement,au=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,$i=(e,t)=>{const n=e&&e.to;return St(n)?t?t(n):null:n},sp={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,i,c,f,v,y){const{mc:h,pc:w,pbc:C,o:{insert:O,querySelector:B,createText:te,createComment:se,parentNode:ae}}=y,re=Ts(t.props);let{dynamicChildren:V}=t;const T=(Y,ne,$)=>{Y.shapeFlag&16&&h(Y.children,ne,$,o,i,c,f,v)},U=(Y=t)=>{const ne=Ts(Y.props),$=Y.target=$i(Y.props,B),R=Si($,Y,te,O);$&&(c!=="svg"&&ou($)?c="svg":c!=="mathml"&&au($)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add($),ne||(T(Y,$,R),kr(Y,!1)))},J=Y=>{const ne=()=>{if(ts.get(Y)===ne){if(ts.delete(Y),Ts(Y.props)){const $=ae(Y.el)||n;T(Y,$,Y.anchor),kr(Y,!0)}U(Y)}};ts.set(Y,ne),Qt(ne,i)};if(e==null){const Y=t.el=te(""),ne=t.anchor=te("");if(O(Y,n,r),O(ne,n,r),np(t.props)||i&&i.pendingBranch){J(t);return}re&&(T(t,n,ne),kr(t,!0)),U()}else{t.el=e.el;const Y=t.anchor=e.anchor,ne=ts.get(e);if(ne){ne.flags|=8,ts.delete(e),J(t);return}t.targetStart=e.targetStart;const $=t.target=e.target,R=t.targetAnchor=e.targetAnchor,F=Ts(e.props),ee=F?n:$,Ie=F?Y:R;if(c==="svg"||ou($)?c="svg":(c==="mathml"||au($))&&(c="mathml"),V?(C(e.dynamicChildren,V,ee,o,i,c,f),ll(e,t,!0)):v||w(e,t,ee,Ie,o,i,c,f,!1),re)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Eo(t,n,Y,y,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Pe=$i(t.props,B);Pe&&(t.target=Pe,Eo(t,Pe,null,y,0))}else F&&Eo(t,$,R,y,1);kr(t,re)}},remove(e,t,n,{um:r,o:{remove:o}},i){const{shapeFlag:c,children:f,anchor:v,targetStart:y,targetAnchor:h,target:w,props:C}=e,O=Ts(C),B=i||!O,te=ts.get(e);if(te&&(te.flags|=8,ts.delete(e)),w&&(o(y),o(h)),i&&o(v),!te&&(O||w)&&c&16)for(let se=0;se<f.length;se++){const ae=f[se];r(ae,t,n,B,!!ae.dynamicChildren)}},move:Eo,hydrate:rp};function Eo(e,t,n,{o:{insert:r},m:o},i=2){i===0&&(e.targetStart&&r(e.targetStart,t,n),r(e.targetAnchor,t,n),n=e.targetAnchor);const{el:c,anchor:f,shapeFlag:v,children:y,props:h}=e,w=i===2;if(w&&r(c,t,n),!ts.has(e)&&(!w||Ts(h))&&v&16)for(let C=0;C<y.length;C++)o(y[C],t,n,2);w&&r(f,t,n)}function rp(e,t,n,r,o,i,{o:{nextSibling:c,parentNode:f,querySelector:v,insert:y,createText:h}},w){function C(se,ae){let re=ae;for(;re;){if(re&&re.nodeType===8){if(re.data==="teleport start anchor")t.targetStart=re;else if(re.data==="teleport anchor"){t.targetAnchor=re,se._lpa=t.targetAnchor&&c(t.targetAnchor);break}}re=c(re)}}function O(se,ae){ae.anchor=w(c(se),ae,f(se),n,r,o,i)}const B=t.target=$i(t.props,v),te=Ts(t.props);if(B){const se=B._lpa||B.firstChild;t.shapeFlag&16&&(te?(O(e,t),C(B,se),t.targetAnchor||Si(B,t,h,y,f(e)===B?e:null)):(t.anchor=c(e),C(B,se),t.targetAnchor||Si(B,t,h,y),w(se&&c(se),t,B,n,r,o,i))),kr(t,te)}else te&&t.shapeFlag&16&&(O(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const cs=sp;function kr(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Si(e,t,n,r,o=null){const i=t.targetStart=n(""),c=t.targetAnchor=n("");return i[xc]=c,e&&(r(i,e,o),r(c,e,o)),c}const un=Symbol("_leaveCb"),wr=Symbol("_enterCb");function Cc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return an(()=>{e.isMounted=!0}),Oc(()=>{e.isUnmounting=!0}),e}const ln=[Function,Array],$c={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ln,onEnter:ln,onAfterEnter:ln,onEnterCancelled:ln,onBeforeLeave:ln,onLeave:ln,onAfterLeave:ln,onLeaveCancelled:ln,onBeforeAppear:ln,onAppear:ln,onAfterAppear:ln,onAppearCancelled:ln},op={name:"BaseTransition",props:$c,setup(e,{slots:t}){const n=ul(),r=Cc();return()=>{const o=t.default&&ol(t.default(),!0),i=o&&o.length?Sc(o):n.subTree?we():void 0;if(!i)return;const c=pt(e),{mode:f}=c;if(r.isLeaving)return li(i);const v=qo(i);if(!v)return li(i);let y=Lr(v,c,r,n,w=>y=w);v.type!==Gt&&ds(v,y);let h=n.subTree&&qo(n.subTree);if(h&&h.type!==Gt&&!As(h,v)&&Kr(n.subTree)){let w=Lr(h,c,r,n);if(ds(h,w),f==="out-in"&&v.type!==Gt)return r.isLeaving=!0,w.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete w.afterLeave,h=void 0},li(i);f==="in-out"&&v.type!==Gt?w.delayLeave=(C,O,B)=>{const te=Ec(r,h);te[String(h.key)]=h,C[un]=()=>{O(),C[un]=void 0,delete y.delayedLeave,h=void 0},y.delayedLeave=()=>{B(),delete y.delayedLeave,h=void 0}}:h=void 0}else h&&(h=void 0);return i}}};function Sc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Gt){t=n;break}}return t}const ap=op;function Ec(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Lr(e,t,n,r,o){const{appear:i,mode:c,persisted:f=!1,onBeforeEnter:v,onEnter:y,onAfterEnter:h,onEnterCancelled:w,onBeforeLeave:C,onLeave:O,onAfterLeave:B,onLeaveCancelled:te,onBeforeAppear:se,onAppear:ae,onAfterAppear:re,onAppearCancelled:V}=t,T=String(e.key),U=Ec(n,e),J=($,R)=>{$&&vn($,r,9,R)},Y=($,R)=>{const F=R[1];J($,R),Ye($)?$.every(ee=>ee.length<=1)&&F():$.length<=1&&F()},ne={mode:c,persisted:f,beforeEnter($){let R=v;if(!n.isMounted)if(i)R=se||v;else return;$[un]&&$[un](!0);const F=U[T];if(F&&As(e,F)){let ee=F.el[un];if(!ee){const Ie=Kr(F);ee=Ie&&Ie.el[un]}ee&&ee()}J(R,[$])},enter($){if(U[T]===e)return;let R=y,F=h,ee=w;if(!n.isMounted)if(i)R=ae||y,F=re||h,ee=V||w;else return;let Ie=!1;$[wr]=ke=>{Ie||(Ie=!0,ke?J(ee,[$]):J(F,[$]),ne.delayedLeave&&ne.delayedLeave(),$[wr]=void 0)};const Pe=$[wr].bind(null,!1);R?Y(R,[$,Pe]):Pe()},leave($,R){const F=String(e.key);if($[wr]&&$[wr](!0),n.isUnmounting)return R();J(C,[$]);let ee=!1;$[un]=Pe=>{ee||(ee=!0,R(),Pe?J(te,[$]):J(B,[$]),$[un]=void 0,U[F]===e&&delete U[F])};const Ie=$[un].bind(null,!1);U[F]=e,O?Y(O,[$,Ie]):Ie()},clone($){const R=Lr($,t,n,r,o);return o&&o(R),R}};return ne}function li(e){if(ha(e))return e=fs(e),e.children=null,e}function qo(e){if(!ha(e))return ma(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&&st(n.default))return n.default()}}function ds(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;ds(ma(n.type)&&qo(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===Ke&&Ye(e.children)){const n=Lc(e.children,!1);n&&ds(n,t)}}function ol(e,t=!1,n){let r=[],o=0;for(let i=0;i<e.length;i++){let c=e[i];const f=n==null?c.key:String(n)+String(c.key!=null?c.key:i);c.type===Ke?(c.patchFlag&128&&o++,r=r.concat(ol(c.children,t,f))):(t||c.type!==Gt)&&r.push(f!=null?fs(c,{key:f}):c)}if(o>1)for(let i=0;i<r.length;i++)r[i].patchFlag=-2;return r}function Kr(e){if(e.component)return Kr(e.component.subTree);if(e.type===Ke){const t=Ye(e.children)&&Lc(e.children,!1);return t?Kr(t):void 0}if(e.type!==Gt)return e}function Ft(e,t){return st(e)?It({name:e.name},t,{setup:e}):e}function Tc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function iu(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ho=new WeakMap;function Tr(e,t,n,r,o=!1){if(Ye(e)){e.forEach((te,se)=>Tr(te,t&&(Ye(t)?t[se]:t),n,r,o));return}if(Ar(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Tr(e,t,n,r.component.subTree);return}const i=r.shapeFlag&4?wa(r.component):r.el,c=o?null:i,{i:f,r:v}=e,y=t&&t.r,h=f.refs===_t?f.refs={}:f.refs,w=f.setupState,C=pt(w),O=w===_t?qu:te=>iu(h,te)?!1:vt(C,te),B=(te,se)=>!(se&&iu(h,se));if(y!=null&&y!==v){if(lu(t),St(y))h[y]=null,O(y)&&(w[y]=null);else if(Yt(y)){const te=t;B(y,te.k)&&(y.value=null),te.k&&(h[te.k]=null)}}if(st(v))Gr(v,f,12,[c,h]);else{const te=St(v),se=Yt(v);if(te||se){const ae=()=>{if(e.f){const re=te?O(v)?w[v]:h[v]:B()||!e.k?v.value:h[e.k];if(o)Ye(re)&&Gi(re,i);else if(Ye(re))re.includes(i)||re.push(i);else if(te)h[v]=[i],O(v)&&(w[v]=h[v]);else{const V=[i];B(v,e.k)&&(v.value=V),e.k&&(h[e.k]=V)}}else te?(h[v]=c,O(v)&&(w[v]=c)):se&&(B(v,e.k)&&(v.value=c),e.k&&(h[e.k]=c))};if(c){const re=()=>{ae(),Ho.delete(e)};re.id=-1,Ho.set(e,re),Qt(re,n)}else lu(e),ae()}}}function lu(e){const t=Ho.get(e);t&&(t.flags|=8,Ho.delete(e))}fa().requestIdleCallback;fa().cancelIdleCallback;const Ar=e=>!!e.type.__asyncLoader,ha=e=>e.type.__isKeepAlive;function ip(e,t){Ac(e,"a",t)}function lp(e,t){Ac(e,"da",t)}function Ac(e,t,n=tn){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ya(t,r,n),n){let o=n.parent;for(;o&&o.parent;)ha(o.parent.vnode)&&up(r,t,n,o),o=o.parent}}function up(e,t,n,r){const o=ya(t,e,r,!0);Wn(()=>{Gi(r[t],o)},n)}function ya(e,t,n=tn,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...c)=>{Mn();const f=Yr(n),v=vn(t,n,e,c);return f(),In(),v});return r?o.unshift(i):o.push(i),i}}const Hn=e=>(t,n=tn)=>{(!Vr||e==="sp")&&ya(e,(...r)=>t(...r),n)},cp=Hn("bm"),an=Hn("m"),dp=Hn("bu"),Pc=Hn("u"),Oc=Hn("bum"),Wn=Hn("um"),fp=Hn("sp"),pp=Hn("rtg"),vp=Hn("rtc");function mp(e,t=tn){ya("ec",e,t)}const hp=Symbol.for("v-ndc");function at(e,t,n,r){let o;const i=n,c=Ye(e);if(c||St(e)){const f=c&&is(e);let v=!1,y=!1;f&&(v=!fn(e),y=jn(e),e=pa(e)),o=new Array(e.length);for(let h=0,w=e.length;h<w;h++)o[h]=t(v?y?us(pn(e[h])):pn(e[h]):e[h],h,void 0,i)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)o=[];else{o=new Array(e);for(let f=0;f<e;f++)o[f]=t(f+1,f,void 0,i)}else if(ht(e))if(e[Symbol.iterator])o=Array.from(e,(f,v)=>t(f,v,void 0,i));else{const f=Object.keys(e);o=new Array(f.length);for(let v=0,y=f.length;v<y;v++){const h=f[v];o[v]=t(e[h],h,v,i)}}else o=[];return o}const Ei=e=>e?Qc(e)?wa(e):Ei(e.parent):null,Pr=It(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=>Ei(e.parent),$root:e=>Ei(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ic(e),$forceUpdate:e=>e.f||(e.f=()=>{rl(e.update)}),$nextTick:e=>e.n||(e.n=ir.bind(e.proxy)),$watch:e=>tp.bind(e)}),ui=(e,t)=>e!==_t&&!e.__isScriptSetup&&vt(e,t),yp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:i,accessCache:c,type:f,appContext:v}=e;if(t[0]!=="$"){const C=c[t];if(C!==void 0)switch(C){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(ui(r,t))return c[t]=1,r[t];if(o!==_t&&vt(o,t))return c[t]=2,o[t];if(vt(i,t))return c[t]=3,i[t];if(n!==_t&&vt(n,t))return c[t]=4,n[t];Ti&&(c[t]=0)}}const y=Pr[t];let h,w;if(y)return t==="$attrs"&&zt(e.attrs,"get",""),y(e);if((h=f.__cssModules)&&(h=h[t]))return h;if(n!==_t&&vt(n,t))return c[t]=4,n[t];if(w=v.config.globalProperties,vt(w,t))return w[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:i}=e;return ui(o,t)?(o[t]=n,!0):r!==_t&&vt(r,t)?(r[t]=n,!0):vt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:i,type:c}},f){let v;return!!(n[f]||e!==_t&&f[0]!=="$"&&vt(e,f)||ui(t,f)||vt(i,f)||vt(r,f)||vt(Pr,f)||vt(o.config.globalProperties,f)||(v=c.__cssModules)&&v[f])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:vt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function uu(e){return Ye(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ti=!0;function gp(e){const t=Ic(e),n=e.proxy,r=e.ctx;Ti=!1,t.beforeCreate&&cu(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:c,watch:f,provide:v,inject:y,created:h,beforeMount:w,mounted:C,beforeUpdate:O,updated:B,activated:te,deactivated:se,beforeDestroy:ae,beforeUnmount:re,destroyed:V,unmounted:T,render:U,renderTracked:J,renderTriggered:Y,errorCaptured:ne,serverPrefetch:$,expose:R,inheritAttrs:F,components:ee,directives:Ie,filters:Pe}=t;if(y&&bp(y,r,null),c)for(const xe in c){const me=c[xe];st(me)&&(r[xe]=me.bind(n))}if(o){const xe=o.call(n,n);ht(xe)&&(e.data=tl(xe))}if(Ti=!0,i)for(const xe in i){const me=i[xe],_e=st(me)?me.bind(n,n):st(me.get)?me.get.bind(n,n):An,We=!st(me)&&st(me.set)?me.set.bind(n):An,Xe=it({get:_e,set:We});Object.defineProperty(r,xe,{enumerable:!0,configurable:!0,get:()=>Xe.value,set:Ae=>Xe.value=Ae})}if(f)for(const xe in f)Mc(f[xe],r,n,xe);if(v){const xe=st(v)?v.call(n):v;Reflect.ownKeys(xe).forEach(me=>{Qf(me,xe[me])})}h&&cu(h,e,"c");function Re(xe,me){Ye(me)?me.forEach(_e=>xe(_e.bind(n))):me&&xe(me.bind(n))}if(Re(cp,w),Re(an,C),Re(dp,O),Re(Pc,B),Re(ip,te),Re(lp,se),Re(mp,ne),Re(vp,J),Re(pp,Y),Re(Oc,re),Re(Wn,T),Re(fp,$),Ye(R))if(R.length){const xe=e.exposed||(e.exposed={});R.forEach(me=>{Object.defineProperty(xe,me,{get:()=>n[me],set:_e=>n[me]=_e,enumerable:!0})})}else e.exposed||(e.exposed={});U&&e.render===An&&(e.render=U),F!=null&&(e.inheritAttrs=F),ee&&(e.components=ee),Ie&&(e.directives=Ie),$&&Tc(e)}function bp(e,t,n=An){Ye(e)&&(e=Ai(e));for(const r in e){const o=e[r];let i;ht(o)?"default"in o?i=Mo(o.from||r,o.default,!0):i=Mo(o.from||r):i=Mo(o),Yt(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:c=>i.value=c}):t[r]=i}}function cu(e,t,n){vn(Ye(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Mc(e,t,n,r){let o=r.includes(".")?kc(n,r):()=>n[r];if(St(e)){const i=t[e];st(i)&&wt(o,i)}else if(st(e))wt(o,e.bind(n));else if(ht(e))if(Ye(e))e.forEach(i=>Mc(i,t,n,r));else{const i=st(e.handler)?e.handler.bind(n):t[e.handler];st(i)&&wt(o,i,e)}}function Ic(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:c}}=e.appContext,f=i.get(t);let v;return f?v=f:!o.length&&!n&&!r?v=t:(v={},o.length&&o.forEach(y=>Wo(v,y,c,!0)),Wo(v,t,c)),ht(t)&&i.set(t,v),v}function Wo(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&Wo(e,i,n,!0),o&&o.forEach(c=>Wo(e,c,n,!0));for(const c in t)if(!(r&&c==="expose")){const f=wp[c]||n&&n[c];e[c]=f?f(e[c],t[c]):t[c]}return e}const wp={data:du,props:fu,emits:fu,methods:xr,computed:xr,beforeCreate:Xt,created:Xt,beforeMount:Xt,mounted:Xt,beforeUpdate:Xt,updated:Xt,beforeDestroy:Xt,beforeUnmount:Xt,destroyed:Xt,unmounted:Xt,activated:Xt,deactivated:Xt,errorCaptured:Xt,serverPrefetch:Xt,components:xr,directives:xr,watch:kp,provide:du,inject:_p};function du(e,t){return t?e?function(){return It(st(e)?e.call(this,this):e,st(t)?t.call(this,this):t)}:t:e}function _p(e,t){return xr(Ai(e),Ai(t))}function Ai(e){if(Ye(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Xt(e,t){return e?[...new Set([].concat(e,t))]:t}function xr(e,t){return e?It(Object.create(null),e,t):t}function fu(e,t){return e?Ye(e)&&Ye(t)?[...new Set([...e,...t])]:It(Object.create(null),uu(e),uu(t??{})):t}function kp(e,t){if(!e)return t;if(!t)return e;const n=It(Object.create(null),e);for(const r in t)n[r]=Xt(e[r],t[r]);return n}function jc(){return{app:null,config:{isNativeTag:qu,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 xp=0;function Cp(e,t){return function(r,o=null){st(r)||(r=It({},r)),o!=null&&!ht(o)&&(o=null);const i=jc(),c=new WeakSet,f=[];let v=!1;const y=i.app={_uid:xp++,_component:r,_props:o,_container:null,_context:i,_instance:null,version:nv,get config(){return i.config},set config(h){},use(h,...w){return c.has(h)||(h&&st(h.install)?(c.add(h),h.install(y,...w)):st(h)&&(c.add(h),h(y,...w))),y},mixin(h){return i.mixins.includes(h)||i.mixins.push(h),y},component(h,w){return w?(i.components[h]=w,y):i.components[h]},directive(h,w){return w?(i.directives[h]=w,y):i.directives[h]},mount(h,w,C){if(!v){const O=y._ceVNode||Me(r,o);return O.appContext=i,C===!0?C="svg":C===!1&&(C=void 0),e(O,h,C),v=!0,y._container=h,h.__vue_app__=y,wa(O.component)}},onUnmount(h){f.push(h)},unmount(){v&&(vn(f,y._instance,16),e(null,y._container),delete y._container.__vue_app__)},provide(h,w){return i.provides[h]=w,y},runWithContext(h){const w=Xs;Xs=y;try{return h()}finally{Xs=w}}};return y}}let Xs=null;const $p=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${yn(t)}Modifiers`]||e[`${ps(t)}Modifiers`];function Sp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||_t;let o=n;const i=t.startsWith("update:"),c=i&&$p(r,t.slice(7));c&&(c.trim&&(o=n.map(h=>St(h)?h.trim():h)),c.number&&(o=o.map(da)));let f,v=r[f=ni(t)]||r[f=ni(yn(t))];!v&&i&&(v=r[f=ni(ps(t))]),v&&vn(v,e,6,o);const y=r[f+"Once"];if(y){if(!e.emitted)e.emitted={};else if(e.emitted[f])return;e.emitted[f]=!0,vn(y,e,6,o)}}const Ep=new WeakMap;function Dc(e,t,n=!1){const r=n?Ep:t.emitsCache,o=r.get(e);if(o!==void 0)return o;const i=e.emits;let c={},f=!1;if(!st(e)){const v=y=>{const h=Dc(y,t,!0);h&&(f=!0,It(c,h))};!n&&t.mixins.length&&t.mixins.forEach(v),e.extends&&v(e.extends),e.mixins&&e.mixins.forEach(v)}return!i&&!f?(ht(e)&&r.set(e,null),null):(Ye(i)?i.forEach(v=>c[v]=null):It(c,i),ht(e)&&r.set(e,c),c)}function ga(e,t){return!e||!la(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),vt(e,t[0].toLowerCase()+t.slice(1))||vt(e,ps(t))||vt(e,t))}function pu(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[i],slots:c,attrs:f,emit:v,render:y,renderCache:h,props:w,data:C,setupState:O,ctx:B,inheritAttrs:te}=e,se=Uo(e);let ae,re;try{if(n.shapeFlag&4){const T=o||r,U=T;ae=En(y.call(U,T,h,w,O,C,B)),re=f}else{const T=t;ae=En(T.length>1?T(w,{attrs:f,slots:c,emit:v}):T(w,null)),re=t.props?f:Tp(f)}}catch(T){js.length=0,va(T,e,1),ae=Me(Gt)}let V=ae;if(re&&te!==!1){const T=Object.keys(re),{shapeFlag:U}=V;T.length&&U&7&&(i&&T.some(ua)&&(re=Ap(re,i)),V=fs(V,re,!1,!0))}if(n.dirs&&(V=fs(V,null,!1,!0),V.dirs=V.dirs?V.dirs.concat(n.dirs):n.dirs),n.transition){const T=ma(V.type)&&qo(V)||V;ds(T,n.transition)}return ae=V,Uo(se),ae}function Lc(e,t=!0){let n;for(let r=0;r<e.length;r++){const o=e[r];if(Nr(o)){if(o.type!==Gt||o.children==="v-if"){if(n)return;n=o}}else return}return n}const Tp=e=>{let t;for(const n in e)(n==="class"||n==="style"||la(n))&&((t||(t={}))[n]=e[n]);return t},Ap=(e,t)=>{const n={};for(const r in e)(!ua(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Pp(e,t,n){const{props:r,children:o,component:i}=e,{props:c,children:f,patchFlag:v}=t,y=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&v>=0){if(v&1024)return!0;if(v&16)return r?vu(r,c,y):!!c;if(v&8){const h=t.dynamicProps;for(let w=0;w<h.length;w++){const C=h[w];if(Kc(c,r,C)&&!ga(y,C))return!0}}}else return(o||f)&&(!f||!f.$stable)?!0:r===c?!1:r?c?vu(r,c,y):!0:!!c;return!1}function vu(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const i=r[o];if(!vt(e,i)||Kc(t,e,i)&&!ga(n,i))return!0}return!1}function Kc(e,t,n){const r=e[n],o=t[n];return n==="style"&&ht(r)&&ht(o)?!ls(r,o):r!==o}function Op({vnode:e,parent:t,suspense:n},r){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=r,e=o),o===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Rc={},Nc=()=>Object.create(Rc),Fc=e=>Object.getPrototypeOf(e)===Rc;function Mp(e,t,n,r=!1){const o={},i=Nc();e.propsDefaults=Object.create(null),Vc(e,t,o,i);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=r?o:Nf(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function Ip(e,t,n,r){const{props:o,attrs:i,vnode:{patchFlag:c}}=e,f=pt(o),[v]=e.propsOptions;let y=!1;if((r||c>0)&&!(c&16)){if(c&8){const h=e.vnode.dynamicProps;for(let w=0;w<h.length;w++){let C=h[w];if(ga(e.emitsOptions,C))continue;const O=t[C];if(v)if(vt(i,C))O!==i[C]&&(i[C]=O,y=!0);else{const B=yn(C);o[B]=Pi(v,f,B,O,e,!1)}else O!==i[C]&&(i[C]=O,y=!0)}}}else{Vc(e,t,o,i)&&(y=!0);let h;for(const w in f)(!t||!vt(t,w)&&((h=ps(w))===w||!vt(t,h)))&&(v?n&&(n[w]!==void 0||n[h]!==void 0)&&(o[w]=Pi(v,f,w,void 0,e,!0)):delete o[w]);if(i!==f)for(const w in i)(!t||!vt(t,w))&&(delete i[w],y=!0)}y&&Fn(e.attrs,"set","")}function Vc(e,t,n,r){const[o,i]=e.propsOptions;let c=!1,f;if(t)for(let v in t){if($r(v))continue;const y=t[v];let h;o&&vt(o,h=yn(v))?!i||!i.includes(h)?n[h]=y:(f||(f={}))[h]=y:ga(e.emitsOptions,v)||(!(v in r)||y!==r[v])&&(r[v]=y,c=!0)}if(i){const v=pt(n),y=f||_t;for(let h=0;h<i.length;h++){const w=i[h];n[w]=Pi(o,v,w,y[w],e,!vt(y,w))}}return c}function Pi(e,t,n,r,o,i){const c=e[n];if(c!=null){const f=vt(c,"default");if(f&&r===void 0){const v=c.default;if(c.type!==Function&&!c.skipFactory&&st(v)){const{propsDefaults:y}=o;if(n in y)r=y[n];else{const h=Yr(o);r=y[n]=v.call(null,t),h()}}else r=v;o.ce&&o.ce._setProp(n,r)}c[0]&&(i&&!f?r=!1:c[1]&&(r===""||r===ps(n))&&(r=!0))}return r}const jp=new WeakMap;function Bc(e,t,n=!1){const r=n?jp:t.propsCache,o=r.get(e);if(o)return o;const i=e.props,c={},f=[];let v=!1;if(!st(e)){const h=w=>{v=!0;const[C,O]=Bc(w,t,!0);It(c,C),O&&f.push(...O)};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!i&&!v)return ht(e)&&r.set(e,Os),Os;if(Ye(i))for(let h=0;h<i.length;h++){const w=yn(i[h]);mu(w)&&(c[w]=_t)}else if(i)for(const h in i){const w=yn(h);if(mu(w)){const C=i[h],O=c[w]=Ye(C)||st(C)?{type:C}:It({},C),B=O.type;let te=!1,se=!0;if(Ye(B))for(let ae=0;ae<B.length;++ae){const re=B[ae],V=st(re)&&re.name;if(V==="Boolean"){te=!0;break}else V==="String"&&(se=!1)}else te=st(B)&&B.name==="Boolean";O[0]=te,O[1]=se,(te||vt(O,"default"))&&f.push(w)}}const y=[c,f];return ht(e)&&r.set(e,y),y}function mu(e){return e[0]!=="$"&&!$r(e)}const al=e=>e==="_"||e==="_ctx"||e==="$stable",il=e=>Ye(e)?e.map(En):[En(e)],Dp=(e,t,n)=>{if(t._n)return t;const r=vs((...o)=>il(t(...o)),n);return r._c=!1,r},Uc=(e,t,n)=>{const r=e._ctx;for(const o in e){if(al(o))continue;const i=e[o];if(st(i))t[o]=Dp(o,i,r);else if(i!=null){const c=il(i);t[o]=()=>c}}},qc=(e,t)=>{const n=il(t);e.slots.default=()=>n},Hc=(e,t,n)=>{for(const r in t)(n||!al(r))&&(e[r]=t[r])},Lp=(e,t,n)=>{const r=e.slots=Nc();if(e.vnode.shapeFlag&32){const o=t._;o?(Hc(r,t,n),n&&Yu(r,"_",o,!0)):Uc(t,r)}else t&&qc(e,t)},Kp=(e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,c=_t;if(r.shapeFlag&32){const f=t._;f?n&&f===1?i=!1:Hc(o,t,n):(i=!t.$stable,Uc(t,o)),c=t}else t&&(qc(e,t),c={default:1});if(i)for(const f in o)!al(f)&&c[f]==null&&delete o[f]},Qt=Bp;function Rp(e){return Np(e)}function Np(e,t){const n=fa();n.__VUE__=!0;const{insert:r,remove:o,patchProp:i,createElement:c,createText:f,createComment:v,setText:y,setElementText:h,parentNode:w,nextSibling:C,setScopeId:O=An,insertStaticContent:B}=e,te=(b,_,X,de=null,H=null,ie=null,Se=void 0,Ee=null,ge=!!_.dynamicChildren)=>{if(b===_)return;b&&!As(b,_)&&(de=fe(b),Ae(b,H,ie,!0),b=null),_.patchFlag===-2&&(ge=!1,_.dynamicChildren=null),_.dynamicChildren&&b&&b.dynamicChildren&&b.dynamicChildren.hasOnce&&(_.dynamicChildren===Os&&(_.dynamicChildren=[]),_.dynamicChildren.hasOnce=!0);const{type:ce,ref:le,shapeFlag:S}=_;switch(ce){case ba:se(b,_,X,de);break;case Gt:ae(b,_,X,de);break;case Io:b==null&&re(_,X,de,Se);break;case Ke:ee(b,_,X,de,H,ie,Se,Ee,ge);break;default:S&1?U(b,_,X,de,H,ie,Se,Ee,ge):S&6?Ie(b,_,X,de,H,ie,Se,Ee,ge):(S&64||S&128)&&ce.process(b,_,X,de,H,ie,Se,Ee,ge,rt)}le!=null&&H?Tr(le,b&&b.ref,ie,_||b,!_):le==null&&b&&b.ref!=null&&Tr(b.ref,null,ie,b,!0)},se=(b,_,X,de)=>{if(b==null)r(_.el=f(_.children),X,de);else{const H=_.el=b.el;_.children!==b.children&&y(H,_.children)}},ae=(b,_,X,de)=>{b==null?r(_.el=v(_.children||""),X,de):_.el=b.el},re=(b,_,X,de)=>{[b.el,b.anchor]=B(b.children,_,X,de,b.el,b.anchor)},V=({el:b,anchor:_},X,de)=>{let H;for(;b&&b!==_;)H=C(b),r(b,X,de),b=H;r(_,X,de)},T=({el:b,anchor:_})=>{let X;for(;b&&b!==_;)X=C(b),o(b),b=X;o(_)},U=(b,_,X,de,H,ie,Se,Ee,ge)=>{if(_.type==="svg"?Se="svg":_.type==="math"&&(Se="mathml"),b==null)J(_,X,de,H,ie,Se,Ee,ge);else{const ce=b.el&&b.el._isVueCE?b.el:null;try{ce&&ce._beginPatch(),$(b,_,H,ie,Se,Ee,ge)}finally{ce&&ce._endPatch()}}},J=(b,_,X,de,H,ie,Se,Ee)=>{let ge,ce;const{props:le,shapeFlag:S,transition:x,dirs:Z}=b;if(ge=b.el=c(b.type,ie,le&&le.is,le),S&8?h(ge,b.children):S&16&&ne(b.children,ge,null,de,H,ci(b,ie),Se,Ee),Z&&xs(b,null,de,"created"),Y(ge,b,b.scopeId,Se,de),le){for(const Ue in le)Ue!=="value"&&!$r(Ue)&&i(ge,Ue,null,le[Ue],ie,de);"value"in le&&i(ge,"value",null,le.value,ie),(ce=le.onVnodeBeforeMount)&&kn(ce,de,b)}Z&&xs(b,null,de,"beforeMount");const Te=Fp(H,x);Te&&x.beforeEnter(ge),r(ge,_,X),((ce=le&&le.onVnodeMounted)||Te||Z)&&Qt(()=>{try{ce&&kn(ce,de,b),Te&&x.enter(ge),Z&&xs(b,null,de,"mounted")}finally{}},H)},Y=(b,_,X,de,H)=>{if(X&&O(b,X),de)for(let ie=0;ie<de.length;ie++)O(b,de[ie]);if(H){let ie=H.subTree;if(_===ie||zc(ie.type)&&(ie.ssContent===_||ie.ssFallback===_)){const Se=H.vnode;Y(b,Se,Se.scopeId,Se.slotScopeIds,H.parent)}}},ne=(b,_,X,de,H,ie,Se,Ee,ge=0)=>{for(let ce=ge;ce<b.length;ce++){const le=b[ce]=Ee?Nn(b[ce]):En(b[ce]);te(null,le,_,X,de,H,ie,Se,Ee)}},$=(b,_,X,de,H,ie,Se)=>{const Ee=_.el=b.el;let{patchFlag:ge,dynamicChildren:ce,dirs:le}=_;ge|=b.patchFlag&16;const S=b.props||_t,x=_.props||_t;let Z;if(X&&Cs(X,!1),(Z=x.onVnodeBeforeUpdate)&&kn(Z,X,_,b),le&&xs(_,b,X,"beforeUpdate"),X&&Cs(X,!0),ce&&(!b.dynamicChildren||b.dynamicChildren.length!==ce.length)&&(ge=0,Se=!1,ce=null),(S.innerHTML&&x.innerHTML==null||S.textContent&&x.textContent==null)&&h(Ee,""),ce?R(b.dynamicChildren,ce,Ee,X,de,ci(_,H),ie):Se||me(b,_,Ee,null,X,de,ci(_,H),ie,!1),ge>0){if(ge&16)F(Ee,S,x,X,H);else if(ge&2&&S.class!==x.class&&i(Ee,"class",null,x.class,H),ge&4&&i(Ee,"style",S.style,x.style,H),ge&8){const Te=_.dynamicProps;for(let Ue=0;Ue<Te.length;Ue++){const Je=Te[Ue],ct=S[Je],Ge=x[Je];(Ge!==ct||Je==="value")&&i(Ee,Je,ct,Ge,H,X)}}ge&1&&b.children!==_.children&&h(Ee,_.children)}else!Se&&ce==null&&F(Ee,S,x,X,H);((Z=x.onVnodeUpdated)||le)&&Qt(()=>{Z&&kn(Z,X,_,b),le&&xs(_,b,X,"updated")},de)},R=(b,_,X,de,H,ie,Se)=>{for(let Ee=0;Ee<_.length;Ee++){const ge=b[Ee],ce=_[Ee],le=ge.el||Oi(ge),S=le&&(ge.type===Ke||!As(ge,ce)||ge.shapeFlag&198)?w(le):X;te(ge,ce,S,null,de,H,ie,Se,!0)}},F=(b,_,X,de,H)=>{if(_!==X){if(_!==_t)for(const ie in _)!$r(ie)&&!(ie in X)&&i(b,ie,_[ie],null,H,de);for(const ie in X){if($r(ie))continue;const Se=X[ie],Ee=_[ie];Se!==Ee&&ie!=="value"&&i(b,ie,Ee,Se,H,de)}"value"in X&&i(b,"value",_.value,X.value,H)}},ee=(b,_,X,de,H,ie,Se,Ee,ge)=>{const ce=_.el=b?b.el:f(""),le=_.anchor=b?b.anchor:f("");let{patchFlag:S,dynamicChildren:x,slotScopeIds:Z}=_;Z&&(Ee=Ee?Ee.concat(Z):Z),b==null?(r(ce,X,de),r(le,X,de),ne(_.children||[],X,le,H,ie,Se,Ee,ge)):S>0&&S&64&&x&&b.dynamicChildren&&b.dynamicChildren.length===x.length?(R(b.dynamicChildren,x,X,H,ie,Se,Ee),(_.key!=null||H&&_===H.subTree)&&ll(b,_,!0)):me(b,_,X,le,H,ie,Se,Ee,ge)},Ie=(b,_,X,de,H,ie,Se,Ee,ge)=>{_.slotScopeIds=Ee,b==null?_.shapeFlag&512?H.ctx.activate(_,X,de,Se,ge):Pe(_,X,de,H,ie,Se,ge):ke(b,_,ge)},Pe=(b,_,X,de,H,ie,Se)=>{const Ee=b.component=Yp(b,de,H);if(ha(b)&&(Ee.ctx.renderer=rt),Jp(Ee,!1,Se),Ee.asyncDep){if(H&&H.registerDep(Ee,Re,Se,ie),!b.el){const ge=Ee.subTree=Me(Gt);ae(null,ge,_,X),b.placeholder=ge.el}}else Re(Ee,b,_,X,H,ie,Se)},ke=(b,_,X)=>{const de=_.component=b.component;if(Pp(b,_,X))if(de.asyncDep&&!de.asyncResolved){_.el=b.el,_.placeholder=b.placeholder,xe(de,_,X);return}else de.next=_,de.update();else _.el=b.el,_.placeholder=b.placeholder,de.vnode=_},Re=(b,_,X,de,H,ie,Se)=>{const Ee=()=>{if(b.isMounted){let{next:S,bu:x,u:Z,parent:Te,vnode:Ue}=b;{const Kt=Wc(b);if(Kt){S&&(S.el=Ue.el,xe(b,S,Se)),Kt.asyncDep.then(()=>{Qt(()=>{b.isUnmounted||ce()},H)});return}}let Je=S,ct;Cs(b,!1),S?(S.el=Ue.el,xe(b,S,Se)):S=Ue,x&&Oo(x),(ct=S.props&&S.props.onVnodeBeforeUpdate)&&kn(ct,Te,S,Ue),Cs(b,!0);const Ge=pu(b),Lt=b.subTree;b.subTree=Ge,te(Lt,Ge,w(Lt.el),fe(Lt),b,H,ie),S.el=Ge.el,Je===null&&Op(b,Ge.el),Z&&Qt(Z,H),(ct=S.props&&S.props.onVnodeUpdated)&&Qt(()=>kn(ct,Te,S,Ue),H)}else{let S;const{el:x,props:Z}=_,{bm:Te,m:Ue,parent:Je,root:ct,type:Ge}=b,Lt=Ar(_);Cs(b,!1),Te&&Oo(Te),!Lt&&(S=Z&&Z.onVnodeBeforeMount)&&kn(S,Je,_),Cs(b,!0);{ct.ce&&ct.ce._hasShadowRoot()&&ct.ce._injectChildStyle(Ge,b.parent?b.parent.type:void 0);const Kt=b.subTree=pu(b);te(null,Kt,X,de,b,H,ie),_.el=Kt.el}if(Ue&&Qt(Ue,H),!Lt&&(S=Z&&Z.onVnodeMounted)){const Kt=_;Qt(()=>kn(S,Je,Kt),H)}(_.shapeFlag&256||Je&&Ar(Je.vnode)&&Je.vnode.shapeFlag&256)&&b.a&&Qt(b.a,H),b.isMounted=!0,_=X=de=null}};b.scope.on();const ge=b.effect=new Zu(Ee);b.scope.off();const ce=b.update=ge.run.bind(ge),le=b.job=ge.runIfDirty.bind(ge);le.i=b,le.id=b.uid,ge.scheduler=()=>rl(le),Cs(b,!0),ce()},xe=(b,_,X)=>{_.component=b;const de=b.vnode.props;b.vnode=_,b.next=null,Ip(b,_.props,de,X),Kp(b,_.children,X),Mn(),yc(b),In()},me=(b,_,X,de,H,ie,Se,Ee,ge=!1)=>{const ce=b&&b.children,le=b?b.shapeFlag:0,S=_.children,{patchFlag:x,shapeFlag:Z}=_;if(x>0){if(x&128){We(ce,S,X,de,H,ie,Se,Ee,ge);return}else if(x&256){_e(ce,S,X,de,H,ie,Se,Ee,ge);return}}Z&8?(le&16&&je(ce,H,ie),S!==ce&&h(X,S)):le&16?Z&16?We(ce,S,X,de,H,ie,Se,Ee,ge):je(ce,H,ie,!0):(le&8&&h(X,""),Z&16&&ne(S,X,de,H,ie,Se,Ee,ge))},_e=(b,_,X,de,H,ie,Se,Ee,ge)=>{b=b||Os,_=_||Os;const ce=b.length,le=_.length,S=Math.min(ce,le);let x;for(x=0;x<S;x++){const Z=_[x]=ge?Nn(_[x]):En(_[x]);te(b[x],Z,X,null,H,ie,Se,Ee,ge)}ce>le?je(b,H,ie,!0,!1,S):ne(_,X,de,H,ie,Se,Ee,ge,S)},We=(b,_,X,de,H,ie,Se,Ee,ge)=>{let ce=0;const le=_.length;let S=b.length-1,x=le-1;for(;ce<=S&&ce<=x;){const Z=b[ce],Te=_[ce]=ge?Nn(_[ce]):En(_[ce]);if(As(Z,Te))te(Z,Te,X,null,H,ie,Se,Ee,ge);else break;ce++}for(;ce<=S&&ce<=x;){const Z=b[S],Te=_[x]=ge?Nn(_[x]):En(_[x]);if(As(Z,Te))te(Z,Te,X,null,H,ie,Se,Ee,ge);else break;S--,x--}if(ce>S){if(ce<=x){const Z=x+1,Te=Z<le?_[Z].el:de;for(;ce<=x;)te(null,_[ce]=ge?Nn(_[ce]):En(_[ce]),X,Te,H,ie,Se,Ee,ge),ce++}}else if(ce>x)for(;ce<=S;)Ae(b[ce],H,ie,!0),ce++;else{const Z=ce,Te=ce,Ue=new Map;for(ce=Te;ce<=x;ce++){const Vt=_[ce]=ge?Nn(_[ce]):En(_[ce]);Vt.key!=null&&Ue.set(Vt.key,ce)}let Je,ct=0;const Ge=x-Te+1;let Lt=!1,Kt=0;const gt=new Array(Ge);for(ce=0;ce<Ge;ce++)gt[ce]=0;for(ce=Z;ce<=S;ce++){const Vt=b[ce];if(ct>=Ge){Ae(Vt,H,ie,!0);continue}let jt;if(Vt.key!=null)jt=Ue.get(Vt.key);else for(Je=Te;Je<=x;Je++)if(gt[Je-Te]===0&&As(Vt,_[Je])){jt=Je;break}jt===void 0?Ae(Vt,H,ie,!0):(gt[jt-Te]=ce+1,jt>=Kt?Kt=jt:Lt=!0,te(Vt,_[jt],X,null,H,ie,Se,Ee,ge),ct++)}const ms=Lt?Vp(gt):Os;for(Je=ms.length-1,ce=Ge-1;ce>=0;ce--){const Vt=Te+ce,jt=_[Vt],ze=_[Vt+1],zn=Vt+1<le?ze.el||Oi(ze):de;gt[ce]===0?te(null,jt,X,zn,H,ie,Se,Ee,ge):Lt&&(Je<0||ce!==ms[Je]?Xe(jt,X,zn,2):Je--)}}},Xe=(b,_,X,de,H=null)=>{const{el:ie,type:Se,transition:Ee,children:ge,shapeFlag:ce}=b;if(ce&6){Xe(b.component.subTree,_,X,de);return}if(ce&128){b.suspense.move(_,X,de);return}if(ce&64){Se.move(b,_,X,rt);return}if(Se===Ke){r(ie,_,X);for(let S=0;S<ge.length;S++)Xe(ge[S],_,X,de);r(b.anchor,_,X);return}if(Se===Io){V(b,_,X);return}if(de!==2&&ce&1&&Ee)if(de===0)Ee.persisted&&!ie[un]?r(ie,_,X):(Ee.beforeEnter(ie),r(ie,_,X),Qt(()=>Ee.enter(ie),H));else{const{leave:S,delayLeave:x,afterLeave:Z}=Ee,Te=()=>{b.ctx.isUnmounted?o(ie):r(ie,_,X)},Ue=()=>{const Je=ie._isLeaving||!!ie[un];ie._isLeaving&&ie[un](!0),Ee.persisted&&!Je?Te():S(ie,()=>{Te(),Z&&Z()})};x?x(ie,Te,Ue):Ue()}else r(ie,_,X)},Ae=(b,_,X,de=!1,H=!1)=>{const{type:ie,props:Se,ref:Ee,children:ge,dynamicChildren:ce,shapeFlag:le,patchFlag:S,dirs:x,cacheIndex:Z,memo:Te}=b;if((S===-2||ce&&ce.hasOnce)&&(H=!1),Ee!=null&&(Mn(),Tr(Ee,null,X,b,!0),In()),Z!=null&&(!b.ctx||b.ctx===_)&&(_.renderCache[Z]=void 0),le&256){_.ctx.deactivate(b);return}const Ue=le&1&&x,Je=!Ar(b);let ct;if(Je&&(ct=Se&&Se.onVnodeBeforeUnmount)&&kn(ct,_,b),le&6)dt(b.component,X,de);else{if(le&128){b.suspense.unmount(X,de);return}Ue&&xs(b,null,_,"beforeUnmount"),le&64?b.type.remove(b,_,X,rt,de):ce&&!ce.hasOnce&&(ie!==Ke||S>0&&S&64)?je(ce,_,X,!1,!0):(ie===Ke&&S&384||!H&&le&16)&&je(ge,_,X),de&&pe(b)}const Ge=Te!=null&&Z==null;(Je&&(ct=Se&&Se.onVnodeUnmounted)||Ue||Ge)&&Qt(()=>{ct&&kn(ct,_,b),Ue&&xs(b,null,_,"unmounted"),Ge&&(b.el=null)},X)},pe=b=>{const{type:_,el:X,anchor:de,transition:H}=b,ie=_===Ke;if(ie&&!H){Ne(X,de);return}if(_===Io){T(b),H&&!H.persisted&&H.afterLeave&&H.afterLeave();return}const Se=ie?Kr(b):b,Ee=()=>{ie?w(X)&&Ne(X,de):o(X),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(Se&&Se.shapeFlag&1&&H&&!H.persisted){const{leave:ge,delayLeave:ce}=H,le=Se.el,S=()=>ge(le,Ee);ce?ce(le,Ee,S):S()}else Ee()},Ne=(b,_)=>{let X;for(;b!==_;)X=C(b),o(b),b=X;o(_)},dt=(b,_,X)=>{const{bum:de,scope:H,job:ie,subTree:Se,um:Ee,m:ge,a:ce}=b;hu(ge),hu(ce),de&&Oo(de),H.stop(),ie?(ie.flags|=8,Ae(Se,b,_,X)):b.vnode.el&&Se&&(Se.transition=b.vnode.transition,Ae(Se,b,_,X)),Ee&&Qt(Ee,_),Qt(()=>{b.isUnmounted=!0},_)},je=(b,_,X,de=!1,H=!1,ie=0)=>{for(let Se=ie;Se<b.length;Se++)Ae(b[Se],_,X,de,H)},fe=b=>{if(b.shapeFlag&6)return fe(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const _=C(b.anchor||b.el),X=_&&_[xc];return X?C(X):_},De=(b,_,X)=>{const de=b&&_._vnode?void 0:b&&b.component?b.component.uid:Gp();Xf(()=>{b==null?_._vnode&&Ae(_._vnode,null,null,!0):te(_._vnode||null,b,_,null,null,null,X),_._vnode=b},de)},rt={p:te,um:Ae,m:Xe,r:pe,mt:Pe,mc:ne,pc:me,pbc:R,n:fe,o:e};return{render:De,hydrate:void 0,createApp:Cp(De)}}function ci({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 Cs({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Fp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ll(e,t,n=!1){const r=e.children,o=t.children;if(Ye(r)&&Ye(o))for(let i=0;i<r.length;i++){const c=r[i];let f=o[i];f.shapeFlag&1&&!f.dynamicChildren&&((f.patchFlag<=0||f.patchFlag===32)&&(f=o[i]=Nn(o[i]),f.el=c.el),!n&&f.patchFlag!==-2&&ll(c,f)),f.type===ba&&(f.patchFlag===-1&&(f=o[i]=Nn(f)),f.el=c.el),f.type===Gt&&!f.el&&(f.el=c.el)}}function Vp(e){const t=e.slice(),n=[0];let r,o,i,c,f;const v=e.length;for(r=0;r<v;r++){const y=e[r];if(y!==0){if(o=n[n.length-1],e[o]<y){t[r]=o,n.push(r);continue}for(i=0,c=n.length-1;i<c;)f=i+c>>1,e[n[f]]<y?i=f+1:c=f;y<e[n[i]]&&(i>0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,c=n[i-1];i-- >0;)n[i]=c,c=t[c];return n}function Wc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Wc(t)}function hu(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Oi(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Oi(t.subTree):null}const zc=e=>e.__isSuspense;function Bp(e,t){t&&t.pendingBranch?Ye(e)?t.effects.push(...e):t.effects.push(e):Jf(e)}const Ke=Symbol.for("v-fgt"),ba=Symbol.for("v-txt"),Gt=Symbol.for("v-cmt"),Io=Symbol.for("v-stc"),js=[];let rn=null;function E(e=!1){js.push(rn=e?null:[])}function Gc(){js.pop(),rn=js[js.length-1]||null}let Rr=1;function zo(e,t=!1){Rr+=e,e<0&&rn&&t&&(rn.hasOnce=!0)}function Yc(e){return e.dynamicChildren=Rr>0?rn||Os:null,Gc(),Rr>0&&rn&&rn.push(e),e}function A(e,t,n,r,o,i){return Yc(l(e,t,n,r,o,i,!0))}function At(e,t,n,r,o){return Yc(Me(e,t,n,r,o,!0))}function Nr(e){return e?e.__v_isVNode===!0:!1}function As(e,t){return e.type===t.type&&e.key===t.key}const Jc=({key:e})=>e??null,jo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?St(e)||Yt(e)||st(e)?{i:dn,r:e,k:t,f:!!n}:e:null);function l(e,t=null,n=null,r=0,o=null,i=e===Ke?0:1,c=!1,f=!1){const v={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Jc(t),ref:t&&jo(t),scopeId:wc,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:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:dn};return f?(Go(v,n),i&128&&e.normalize(v)):n&&(v.shapeFlag|=St(n)?8:16),Rr>0&&!c&&rn&&(v.patchFlag>0||i&6)&&v.patchFlag!==32&&rn.push(v),v}const Me=Up;function Up(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===hp)&&(e=Gt),Nr(e)){const f=fs(e,t,!0);return n&&Go(f,n),Rr>0&&!i&&rn&&(f.shapeFlag&6?rn[rn.indexOf(e)]=f:rn.push(f)),f.patchFlag=-2,f}if(ev(e)&&(e=e.__vccOpts),t){t=qp(t);let{class:f,style:v}=t;f&&!St(f)&&(t.class=tt(f)),ht(v)&&(sl(v)&&!Ye(v)&&(v=It({},v)),t.style=as(v))}const c=St(e)?1:zc(e)?128:ma(e)?64:ht(e)?4:st(e)?2:0;return l(e,t,n,r,o,c,i,!0)}function qp(e){return e?sl(e)||Fc(e)?It({},e):e:null}function fs(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:c,children:f,transition:v}=e,y=t?Wp(o||{},t):o,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:y,key:y&&Jc(y),ref:t&&t.ref?n&&i?Ye(i)?i.concat(jo(t)):[i,jo(t)]:jo(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:f,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ke?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:v,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&fs(e.ssContent),ssFallback:e.ssFallback&&fs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return v&&r&&ds(h,v.clone(h)),h}function Pt(e=" ",t=0){return Me(ba,null,e,t)}function Hp(e,t){const n=Me(Io,null,e);return n.staticCount=t,n}function we(e="",t=!1){return t?(E(),At(Gt,null,e)):Me(Gt,null,e)}function En(e){return e==null||typeof e=="boolean"?Me(Gt):Ye(e)?Me(Ke,null,e.slice()):Nr(e)?Nn(e):Me(ba,null,String(e))}function Nn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:fs(e)}function Go(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Ye(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Go(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Fc(t)?t._ctx=dn:o===3&&dn&&(dn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(st(t)){if(r&65){Go(e,{default:t});return}t={default:t,_ctx:dn},n=32}else t=String(t),r&64?(n=16,t=[Pt(t)]):n=8;e.children=t,e.shapeFlag|=n}function Wp(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=tt([t.class,r.class]));else if(o==="style")t.style=as([t.style,r.style]);else if(la(o)){const i=t[o],c=r[o];c&&i!==c&&!(Ye(i)&&i.includes(c))?t[o]=i?[].concat(i,c):c:c==null&&i==null&&!ua(o)&&(t[o]=c)}else o!==""&&(t[o]=r[o])}return t}function kn(e,t,n,r=null){vn(e,t,7,[n,r])}const zp=jc();let Xc=0;function Gp(){return Xc}function Yp(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||zp,i={uid:Xc++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new _f(!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:Bc(r,o),emitsOptions:Dc(r,o),emit:null,emitted:null,propsDefaults:_t,inheritAttrs:r.inheritAttrs,ctx:_t,data:_t,props:_t,attrs:_t,slots:_t,refs:_t,setupState:_t,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 i.ctx={_:i},i.root=t?t.root:i,i.emit=Sp.bind(null,i),e.ce&&e.ce(i),i}let tn=null;const ul=()=>tn||dn;let Yo,Fr;{const e=fa(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),i=>{o.length>1?o.forEach(c=>c(i)):o[0](i)}};Yo=t("__VUE_INSTANCE_SETTERS__",n=>tn=n),Fr=t("__VUE_SSR_SETTERS__",n=>Vr=n)}const Yr=e=>{const t=tn;return Yo(e),e.scope.on(),()=>{e.scope.off(),Yo(t)}},yu=()=>{tn&&tn.scope.off(),Yo(null)};function Qc(e){return e.vnode.shapeFlag&4}let Vr=!1;function Jp(e,t=!1,n=!1){t&&Fr(t);const{props:r,children:o}=e.vnode,i=Qc(e);Mp(e,r,i,t),Lp(e,o,n||t);const c=i?Xp(e,t):void 0;return t&&Fr(!1),c}function Xp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,yp);const{setup:r}=n;if(r){Mn();const o=e.setupContext=r.length>1?Zp(e):null,i=Yr(e),c=Gr(r,e,0,[e.props,o]),f=Hu(c);if(In(),i(),(f||e.sp)&&!Ar(e)&&Tc(e),f){if(c.then(yu,yu),t)return c.then(v=>{Fr(!0);try{gu(e,v,t)}finally{Fr(!1)}}).catch(v=>{va(v,e,0)});e.asyncDep=c}else gu(e,c)}else Zc(e)}function gu(e,t,n){st(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ht(t)&&(e.setupState=vc(t)),Zc(e)}function Zc(e,t,n){const r=e.type;e.render||(e.render=r.render||An);{const o=Yr(e);Mn();try{gp(e)}finally{In(),o()}}}const Qp={get(e,t){return zt(e,"get",""),e[t]}};function Zp(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Qp),slots:e.slots,emit:e.emit,expose:t}}function wa(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(vc(Ff(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Pr)return Pr[n](e)},has(t,n){return n in t||n in Pr}})):e.proxy}function ev(e){return st(e)&&"__vccOpts"in e}const it=(e,t)=>Hf(e,t,Vr);function tv(e,t,n){try{zo(-1);const r=arguments.length;return r===2?ht(t)&&!Ye(t)?Nr(t)?Me(e,null,[t]):Me(e,t):Me(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Nr(n)&&(n=[n]),Me(e,t,n))}finally{zo(1)}}const nv="3.5.44";/**
* @vue/runtime-dom v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Mi;const bu=typeof window<"u"&&window.trustedTypes;if(bu)try{Mi=bu.createPolicy("vue",{createHTML:e=>e})}catch{}const ed=Mi?e=>Mi.createHTML(e):e=>e,sv="http://www.w3.org/2000/svg",rv="http://www.w3.org/1998/Math/MathML",Rn=typeof document<"u"?document:null,wu=Rn&&Rn.createElement("template"),ov={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?Rn.createElementNS(sv,e):t==="mathml"?Rn.createElementNS(rv,e):n?Rn.createElement(e,{is:n}):Rn.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>Rn.createTextNode(e),createComment:e=>Rn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Rn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,i){const c=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{wu.innerHTML=ed(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const f=wu.content;if(r==="svg"||r==="mathml"){const v=f.firstChild;for(;v.firstChild;)f.appendChild(v.firstChild);f.removeChild(v)}t.insertBefore(f,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},es="transition",_r="animation",sr=Symbol("_vtc"),td={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},nd=It({},$c,td),av=e=>(e.displayName="Transition",e.props=nd,e),lr=av((e,{slots:t})=>tv(ap,sd(e),t)),$s=(e,t=[])=>{Ye(e)?e.forEach(n=>n(...t)):e&&e(...t)},_u=e=>e?Ye(e)?e.some(t=>t.length>1):e.length>1:!1;function sd(e){const t={};for(const ee in e)ee in td||(t[ee]=e[ee]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:f=`${n}-enter-to`,appearFromClass:v=i,appearActiveClass:y=c,appearToClass:h=f,leaveFromClass:w=`${n}-leave-from`,leaveActiveClass:C=`${n}-leave-active`,leaveToClass:O=`${n}-leave-to`}=e,B=iv(o),te=B&&B[0],se=B&&B[1],{onBeforeEnter:ae,onEnter:re,onEnterCancelled:V,onLeave:T,onLeaveCancelled:U,onBeforeAppear:J=ae,onAppear:Y=re,onAppearCancelled:ne=V}=t,$=(ee,Ie,Pe,ke)=>{ee._enterCancelled=ke,ns(ee,Ie?h:f),ns(ee,Ie?y:c),Pe&&Pe()},R=(ee,Ie)=>{ee._isLeaving=!1,ns(ee,w),ns(ee,O),ns(ee,C),Ie&&Ie()},F=ee=>(Ie,Pe)=>{const ke=ee?Y:re,Re=()=>$(Ie,ee,Pe);$s(ke,[Ie,Re]),ku(()=>{ns(Ie,ee?v:i),xn(Ie,ee?h:f),_u(ke)||xu(Ie,r,te,Re)})};return It(t,{onBeforeEnter(ee){$s(ae,[ee]),xn(ee,i),xn(ee,c)},onBeforeAppear(ee){$s(J,[ee]),xn(ee,v),xn(ee,y)},onEnter:F(!1),onAppear:F(!0),onLeave(ee,Ie){ee._isLeaving=!0;const Pe=()=>R(ee,Ie);xn(ee,w),ee._enterCancelled?(xn(ee,C),Ii(ee)):(Ii(ee),xn(ee,C)),ku(()=>{ee._isLeaving&&(ns(ee,w),xn(ee,O),_u(T)||xu(ee,r,se,Pe))}),$s(T,[ee,Pe])},onEnterCancelled(ee){$(ee,!1,void 0,!0),$s(V,[ee])},onAppearCancelled(ee){$(ee,!0,void 0,!0),$s(ne,[ee])},onLeaveCancelled(ee){R(ee),$s(U,[ee])}})}function iv(e){if(e==null)return null;if(ht(e))return[di(e.enter),di(e.leave)];{const t=di(e);return[t,t]}}function di(e){return df(e)}function xn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[sr]||(e[sr]=new Set)).add(t)}function ns(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[sr];n&&(n.delete(t),n.size||(e[sr]=void 0))}function ku(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let lv=0;function xu(e,t,n,r){const o=e._endId=++lv,i=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(i,n);const{type:c,timeout:f,propCount:v}=rd(e,t);if(!c)return r();const y=c+"end";let h=0;const w=()=>{e.removeEventListener(y,C),i()},C=O=>{O.target===e&&++h>=v&&w()};setTimeout(()=>{h<v&&w()},f+1),e.addEventListener(y,C)}function rd(e,t){const n=window.getComputedStyle(e),r=B=>(n[B]||"").split(", "),o=r(`${es}Delay`),i=r(`${es}Duration`),c=Cu(o,i),f=r(`${_r}Delay`),v=r(`${_r}Duration`),y=Cu(f,v);let h=null,w=0,C=0;t===es?c>0&&(h=es,w=c,C=i.length):t===_r?y>0&&(h=_r,w=y,C=v.length):(w=Math.max(c,y),h=w>0?c>y?es:_r:null,C=h?h===es?i.length:v.length:0);const O=h===es&&/\b(?:transform|all)(?:,|$)/.test(r(`${es}Property`).toString());return{type:h,timeout:w,propCount:C,hasTransform:O}}function Cu(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>$u(n)+$u(e[r])))}function $u(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ii(e){return(e?e.ownerDocument:document).body.offsetHeight}function uv(e,t,n){const r=e[sr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Su=Symbol("_vod"),od=Symbol("_vsh"),cv=Symbol(""),dv=/(?:^|;)\s*display\s*:/;function fv(e,t,n){const r=e.style,o=St(n);let i=!1;if(n&&!o){if(t)if(St(t))for(const c of t.split(";")){const f=c.slice(0,c.indexOf(":")).trim();n[f]==null&&Cr(r,f,"")}else for(const c in t)n[c]==null&&Cr(r,c,"");for(const c in n){c==="display"&&(i=!0);const f=n[c];f!=null?vv(e,c,!St(t)&&t?t[c]:void 0,f)||Cr(r,c,f):Cr(r,c,"")}}else if(o){if(t!==n){const c=r[cv];c&&(n+=";"+c),r.cssText=n,i=dv.test(n)}}else t&&e.removeAttribute("style");Su in e&&((!o||t!==n)&&(e[Su]=i?r.display:""),e[od]&&(r.display="none"))}const To=/\s*!important$/;function Cr(e,t,n){if(Ye(n))n.forEach(r=>Cr(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))To.test(n)?e.setProperty(t,n.replace(To,""),"important"):e.setProperty(t,n);else{const r=pv(e,t);To.test(n)?e.setProperty(ps(r),n.replace(To,""),"important"):e[r]=n}}const Eu=["Webkit","Moz","ms"],fi={};function pv(e,t){const n=fi[t];if(n)return n;let r=yn(t);if(r!=="filter"&&r in e)return fi[t]=r;r=Gu(r);for(let o=0;o<Eu.length;o++){const i=Eu[o]+r;if(i in e)return fi[t]=i}return t}function vv(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&St(r)&&n===r}const Tu="http://www.w3.org/1999/xlink";function Au(e,t,n,r,o,i=yf(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Tu,t.slice(6,t.length)):e.setAttributeNS(Tu,t,n):n==null||i&&!Ju(n)?e.removeAttribute(t):e.setAttribute(t,i?"":On(n)?String(n):n)}function Pu(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ed(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const f=i==="OPTION"?e.getAttribute("value")||"":e.value,v=n==null?e.type==="checkbox"?"on":"":String(n);(f!==v||!("_value"in e))&&(e.value=v),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const f=typeof e[t];f==="boolean"?n=Ju(n):n==null&&f==="string"?(n="",c=!0):f==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(o||t)}function Ps(e,t,n,r){e.addEventListener(t,n,r)}function mv(e,t,n,r){e.removeEventListener(t,n,r)}const Ou=Symbol("_vei");function hv(e,t,n,r,o=null){const i=e[Ou]||(e[Ou]={}),c=i[t];if(r&&c)c.value=r;else{const[f,v]=bv(t);if(r){const y=i[t]=kv(r,o);Ps(e,f,y,v)}else c&&(mv(e,f,c,v),i[t]=void 0)}}const yv=/(Once|Passive|Capture)$/,gv=/^on:?(?:Once|Passive|Capture)$/;function bv(e){let t,n;for(;(n=e.match(yv))&&!gv.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):ps(e.slice(2)),t]}let pi=0;const wv=Promise.resolve(),_v=()=>pi||(wv.then(()=>pi=0),pi=Date.now());function kv(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;const o=n.value;if(Ye(o)){const i=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{i.call(r),r._stopped=!0};const c=o.slice(),f=[r];for(let v=0;v<c.length&&!r._stopped;v++){const y=c[v];y&&vn(y,t,5,f)}}else vn(o,t,5,[r])};return n.value=e,n.attached=_v(),n}const Mu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,xv=(e,t,n,r,o,i)=>{const c=o==="svg";t==="class"?uv(e,r,c):t==="style"?fv(e,n,r):la(t)?ua(t)||hv(e,t,n,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Cv(e,t,r,c))?(Pu(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Au(e,t,r,c,i,t!=="value")):e._isVueCE&&($v(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!St(r)))?Pu(e,yn(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Au(e,t,r,c))};function Cv(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Mu(t)&&st(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 Mu(t)&&St(n)?!1:t in e}function $v(e,t){const n=e._def.props;if(!n)return!1;const r=yn(t);return Array.isArray(n)?n.some(o=>yn(o)===r):Object.keys(n).some(o=>yn(o)===r)}const ad=new WeakMap,id=new WeakMap,Jo=Symbol("_moveCb"),Iu=Symbol("_enterCb"),ji=new WeakMap,Sv=e=>(delete e.props.mode,e),Ev=Sv({name:"TransitionGroup",props:It({},nd,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ul(),r=Cc();let o,i,c,f;const v=()=>(f===void 0&&(f=o.length>0&&Dv(o[0].el,n.vnode.el,ju(e))),f);return Pc(()=>{if(ji.delete(n),!v()){o=[],c=void 0;return}const y=ju(e);o.forEach(Av);const h=c&&jv(c,n.vnode.el);c=void 0,o.forEach(C=>Pv(C,h));const w=o.filter(Ov);Ii(n.vnode.el),w.forEach(C=>{const O=C.el,B=O.style;xn(O,y),B.transform=B.webkitTransform=B.transitionDuration="";const te=O[Jo]=se=>{se&&se.target!==O||(!se||se.propertyName.endsWith("transform"))&&(O.removeEventListener("transitionend",te),O[Jo]=null,ns(O,y))};O.addEventListener("transitionend",te)}),o=[]}),()=>{const y=pt(e),h=sd(y);let w=y.tag||Ke;if(o=[],f=void 0,i)for(let C=0;C<i.length;C++){const O=i[C];O.el&&O.el instanceof Element&&!O.el[od]&&(o.push(O),ds(O,Lr(O,h,r,n)),ad.set(O,_a(O.el)))}i=t.default?ol(t.default()):[];for(let C=0;C<i.length;C++){const O=i[C];O.key!=null&&ds(O,Lr(O,h,r,n))}return o.length&&(c=Mv(n),ji.set(n,v)),Me(w,null,i)}}}),Tv=Ev;function Av(e){const t=e.el;t[Jo]&&t[Jo](),t[Iu]&&t[Iu]()}function ju(e){return e.moveClass||`${e.name||"v"}-move`}function Pv(e,t){id.set(e,_a(e.el,t))}function Ov(e){const t=ad.get(e),n=id.get(e),r=t.left-n.left,o=t.top-n.top;if(r||o){const i=e.el,c=i.style,f=i.getBoundingClientRect();let v=1,y=1;return i.offsetWidth&&(v=f.width/i.offsetWidth),i.offsetHeight&&(y=f.height/i.offsetHeight),(!Number.isFinite(v)||v===0)&&(v=1),(!Number.isFinite(y)||y===0)&&(y=1),Math.abs(v-1)<.01&&(v=1),Math.abs(y-1)<.01&&(y=1),c.transform=c.webkitTransform=`translate(${r/v}px,${o/y}px)`,c.transitionDuration="0s",e}}function _a(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function Mv(e){let t;for(let n=e.parent;n;n=n.parent){const r=ji.get(n);if(r){const o=Iv(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push(It(_a(o),{item:o,willMove:r}))}}return t}function Iv(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 jv(e,t){const n=e.find(r=>r.willMove()&&r.item.contains(t));return n&&_a(n.item,n)}function Dv(e,t,n){const r=e.cloneNode(),o=e[sr];o&&o.forEach(f=>{f.split(/\s+/).forEach(v=>v&&r.classList.remove(v))}),n.split(/\s+/).forEach(f=>f&&r.classList.add(f)),r.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(r);const{hasTransform:c}=rd(r);return i.removeChild(r),c}const Xo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ye(t)?n=>Oo(t,n):t};function Lv(e){e.target.composing=!0}function Du(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ms=Symbol("_assign"),Ao=Symbol("_initialValue");function vi(e,t,n){return t&&(e=e.trim()),n&&(e=da(e)),e}const Fe={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e.parentNode&&(e.type==="text"?e[Ao]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Ao]=e.defaultValue.replace(/\r\n?/g,`
`))),e[Ms]=Xo(o);const i=r||o.props&&o.props.type==="number";Ps(e,t?"change":"input",c=>{c.target.composing||e[Ms](vi(e.value,n,i))}),(n||i)&&Ps(e,"change",()=>{e.value=vi(e.value,n,i)}),t||(Ps(e,"compositionstart",Lv),Ps(e,"compositionend",Du),Ps(e,"change",Du))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){const o=t??"",i=e[Ao];delete e[Ao],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[Ms](vi(e.value,n,r)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:i}},c){if(e[Ms]=Xo(c),e.composing)return;const f=(i||e.type==="number")&&!/^0\d/.test(e.value)?da(e.value):e.value,v=t??"";if(f===v)return;const y=e.getRootNode();(y instanceof Document||y instanceof ShadowRoot)&&y.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===v)||(e.value=v)}},Pn={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Ps(e,"change",()=>{const o=Array.prototype.filter.call(e.options,v=>v.selected).map(v=>n?da(Qo(v)):Qo(v)),i=e.multiple,c=i?Ds(e._modelValue)?new Set(o):o:o[0],f=e._pendingValue=[i,i?Ye(c)?o.slice():o:c];try{e[Ms](c)}finally{ir(()=>{e._pendingValue===f&&(e._pendingValue=void 0)})}}),e[Ms]=Xo(r)},mounted(e,{value:t}){Lu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ms]=Xo(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Kv(t,n[1],n[0]))&&Lu(e,t)}};function Kv(e,t,n){if(!n||Ye(e))return ls(e,t);if(Ds(e)){if(e.size!==t.length)return!1;for(const r of t)if(!e.has(r))return!1;return!0}return!1}function Lu(e,t){const n=e.multiple,r=Ye(t);if(!(n&&!r&&!Ds(t))){for(let o=0,i=e.options.length;o<i;o++){const c=e.options[o],f=Qo(c);if(n)if(r){const v=typeof f;v==="string"||v==="number"?c.selected=t.some(y=>String(y)===String(f)):c.selected=wf(t,f)>-1}else c.selected=t.has(f);else if(ls(Qo(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Qo(e){return"_value"in e?e._value:e.value}const Rv=["ctrl","shift","alt","meta"],Nv={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)=>Rv.some(n=>e[`${n}Key`]&&!t.includes(n))},en=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...i)=>{for(let c=0;c<t.length;c++){const f=Nv[t[c]];if(f&&f(o,t))return}return e(o,...i)})},Fv={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Et=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const i=ps(o.key);if(t.some(c=>c===i||Fv[c]===i))return e(o)})},Vv=It({patchProp:xv},ov);let Ku;function Bv(){return Ku||(Ku=Rp(Vv))}const Uv=(...e)=>{const t=Bv().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=Hv(r);if(!o)return;const i=t._component;!st(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,qv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function qv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Hv(e){return St(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 Wv={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"/>'),more:Tt('<circle cx="5.4" cy="12" r="1.7"/><circle cx="12" cy="12" r="1.7"/><circle cx="18.6" cy="12" r="1.7"/>'),shield:Tt('<path d="M12 3.5l7.2 2.7v5.1c0 4.7-3.1 7.8-7.2 9.4-4.1-1.6-7.2-4.7-7.2-9.4V6.2z"/><path d="M9.3 12.2l1.9 1.9 3.6-4"/>'),plan:Tt('<rect x="4.5" y="4" width="15" height="16.5" rx="2"/><path d="M8.5 9.5l1.4 1.4 2.6-2.9M8.5 15l1.4 1.4 2.6-2.9M15 9.8h.01M15 15.3h.01"/>')},zv=["innerHTML"],et=Ft({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=it(()=>Wv[t.name]||"");return(r,o)=>(E(),A("span",{class:"icon",style:as({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,zv))}}),Gv=["aria-label"],Yv={class:"dialog-title"},Jv={class:"dialog-msg"},Xv={class:"dialog-btns"},Qv=Ft({__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,r=t;function o(i){n.open&&i.key==="Escape"&&r("cancel")}return wt(()=>n.open,i=>{i?window.addEventListener("keydown",o):window.removeEventListener("keydown",o)}),Wn(()=>window.removeEventListener("keydown",o)),(i,c)=>(E(),At(cs,{to:"body"},[Me(lr,{name:"modal"},{default:vs(()=>[e.open?(E(),A("div",{key:0,class:"mask",onClick:c[2]||(c[2]=en(f=>r("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",Yv,z(e.title),1),l("div",Jv,z(e.message),1),l("div",Xv,[l("button",{class:"btn btn-sm",onClick:c[0]||(c[0]=f=>r("cancel"))},z(e.cancelText),1),l("button",{class:tt(["btn btn-sm",e.danger?"btn-danger-solid":"btn-primary"]),onClick:c[1]||(c[1]=f=>r("confirm"))},z(e.confirmText),3)])],8,Gv)])):we("",!0)]),_:1})]))}}),Ut=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},qn=Ut(Qv,[["__scopeId","data-v-f27041d4"]]);var Ru=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ld={exports:{}};(function(e,t){((n,r)=>{e.exports=r()})(Ru,function(){var n=function(s,a){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(u,d){u.__proto__=d}:function(u,d){for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(u[p]=d[p])}))(s,a)},r=function(){return(r=Object.assign||function(s){for(var a,u=1,d=arguments.length;u<d;u++)for(var p in a=arguments[u])Object.prototype.hasOwnProperty.call(a,p)&&(s[p]=a[p]);return s}).apply(this,arguments)};function o(s,a,u){for(var d,p=0,m=a.length;p<m;p++)!d&&p in a||((d=d||Array.prototype.slice.call(a,0,p))[p]=a[p]);return s.concat(d||Array.prototype.slice.call(a))}var i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Ru,c=Object.keys,f=Array.isArray;function v(s,a){return typeof a=="object"&&c(a).forEach(function(u){s[u]=a[u]}),s}typeof Promise>"u"||i.Promise||(i.Promise=Promise);var y=Object.getPrototypeOf,h={}.hasOwnProperty;function w(s,a){return h.call(s,a)}function C(s,a){typeof a=="function"&&(a=a(y(s))),(typeof Reflect>"u"?c:Reflect.ownKeys)(a).forEach(function(u){B(s,u,a[u])})}var O=Object.defineProperty;function B(s,a,u,d){O(s,a,v(u&&w(u,"get")&&typeof u.get=="function"?{get:u.get,set:u.set,configurable:!0}:{value:u,configurable:!0,writable:!0},d))}function te(s){return{from:function(a){return s.prototype=Object.create(a.prototype),B(s.prototype,"constructor",s),{extend:C.bind(null,s.prototype)}}}}var se=Object.getOwnPropertyDescriptor,ae=[].slice;function re(s,a,u){return ae.call(s,a,u)}function V(s,a){return a(s)}function T(s){if(!s)throw new Error("Assertion Failed")}function U(s){i.setImmediate?setImmediate(s):setTimeout(s,0)}function J(s,a){if(typeof a=="string"&&w(s,a))return s[a];if(!a)return s;if(typeof a!="string"){for(var u=[],d=0,p=a.length;d<p;++d){var m=J(s,a[d]);u.push(m)}return u}var g,k=a.indexOf(".");return k===-1||(g=s[a.substr(0,k)])==null?void 0:J(g,a.substr(k+1))}function Y(s,a,u){if(s&&a!==void 0&&!("isFrozen"in Object&&Object.isFrozen(s)))if(typeof a!="string"&&"length"in a){T(typeof u!="string"&&"length"in u);for(var d=0,p=a.length;d<p;++d)Y(s,a[d],u[d])}else{var m=a.indexOf(".");if(m!==-1){var g=a.substr(0,m),m=a.substr(m+1);if(m==="")u===void 0?f(s)&&!isNaN(parseInt(g))?s.splice(g,1):delete s[g]:s[g]=u;else{var k=s[g];if(!k||!w(s,g)){if(u===void 0)return;k=s[g]={}}Y(k,m,u)}}else u===void 0?f(s)&&!isNaN(parseInt(a))?s.splice(a,1):delete s[a]:s[a]=u}}function ne(s){var a,u={};for(a in s)w(s,a)&&(u[a]=s[a]);return u}var $=[].concat;function R(s){return $.apply([],s)}var Ae="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(R([8,16,32,64].map(function(s){return["Int","Uint","Float"].map(function(a){return a+s+"Array"})}))).filter(function(s){return i[s]}),F=new Set(Ae.map(function(s){return i[s]})),ee=null;function Ie(s){return ee=new WeakMap,s=function a(u){if(!u||typeof u!="object")return u;var d=ee.get(u);if(d)return d;if(f(u)){d=[],ee.set(u,d);for(var p=0,m=u.length;p<m;++p)d.push(a(u[p]))}else if(F.has(u.constructor))d=u;else{var g,k=y(u);for(g in d=k===Object.prototype?{}:Object.create(k),ee.set(u,d),u)w(u,g)&&(d[g]=a(u[g]))}return d}(s),ee=null,s}var Pe={}.toString;function ke(s){return Pe.call(s).slice(8,-1)}var Re=typeof Symbol<"u"?Symbol.iterator:"@@iterator",xe=typeof Re=="symbol"?function(s){var a;return s!=null&&(a=s[Re])&&a.apply(s)}:function(){return null};function me(s,a){a=s.indexOf(a),0<=a&&s.splice(a,1)}var _e={};function We(s){var a,u,d,p;if(arguments.length===1){if(f(s))return s.slice();if(this===_e&&typeof s=="string")return[s];if(p=xe(s))for(u=[];!(d=p.next()).done;)u.push(d.value);else{if(s==null)return[s];if(typeof(a=s.length)!="number")return[s];for(u=new Array(a);a--;)u[a]=s[a]}}else for(a=arguments.length,u=new Array(a);a--;)u[a]=arguments[a];return u}var Xe=typeof Symbol<"u"?function(s){return s[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Ae=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ue=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ae),pe={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 Ne(s,a){this.name=s,this.message=a}function dt(s,a){return s+". Errors: "+Object.keys(a).map(function(u){return a[u].toString()}).filter(function(u,d,p){return p.indexOf(u)===d}).join(`
`)}function je(s,a,u,d){this.failures=a,this.failedKeys=d,this.successCount=u,this.message=dt(s,a)}function fe(s,a){this.name="BulkError",this.failures=Object.keys(a).map(function(u){return a[u]}),this.failuresByPos=a,this.message=dt(s,this.failures)}te(Ne).from(Error).extend({toString:function(){return this.name+": "+this.message}}),te(je).from(Ne),te(fe).from(Ne);var De=Ue.reduce(function(s,a){return s[a]=a+"Error",s},{}),rt=Ne,Ve=Ue.reduce(function(s,a){var u=a+"Error";function d(p,m){this.name=u,p?typeof p=="string"?(this.message="".concat(p).concat(m?`
`+m:""),this.inner=m||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=pe[a]||u,this.inner=null)}return te(d).from(rt),s[a]=d,s},{}),b=(Ve.Syntax=SyntaxError,Ve.Type=TypeError,Ve.Range=RangeError,Ae.reduce(function(s,a){return s[a+"Error"]=Ve[a],s},{}));Ae=Ue.reduce(function(s,a){return["Syntax","Type","Range"].indexOf(a)===-1&&(s[a+"Error"]=Ve[a]),s},{});function _(){}function X(s){return s}function de(s,a){return s==null||s===X?a:function(u){return a(s(u))}}function H(s,a){return function(){s.apply(this,arguments),a.apply(this,arguments)}}function ie(s,a){return s===_?a:function(){var u=s.apply(this,arguments),d=(u!==void 0&&(arguments[0]=u),this.onsuccess),p=this.onerror,m=(this.onsuccess=null,this.onerror=null,a.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?H(d,this.onsuccess):d),p&&(this.onerror=this.onerror?H(p,this.onerror):p),m!==void 0?m:u}}function Se(s,a){return s===_?a:function(){s.apply(this,arguments);var u=this.onsuccess,d=this.onerror;this.onsuccess=this.onerror=null,a.apply(this,arguments),u&&(this.onsuccess=this.onsuccess?H(u,this.onsuccess):u),d&&(this.onerror=this.onerror?H(d,this.onerror):d)}}function Ee(s,a){return s===_?a:function(){var u=s.apply(this,arguments),d=(v(arguments[0],u),this.onsuccess),p=this.onerror,m=(this.onsuccess=null,this.onerror=null,a.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?H(d,this.onsuccess):d),p&&(this.onerror=this.onerror?H(p,this.onerror):p),u===void 0?m===void 0?void 0:m:v(u,m)}}function ge(s,a){return s===_?a:function(){return a.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function ce(s,a){return s===_?a:function(){var u=s.apply(this,arguments);if(u&&typeof u.then=="function"){for(var d=this,p=arguments.length,m=new Array(p);p--;)m[p]=arguments[p];return u.then(function(){return a.apply(d,m)})}return a.apply(this,arguments)}}Ae.ModifyError=je,Ae.DexieError=Ne,Ae.BulkError=fe;var le=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function S(s){le=s}var x={},Z=100,Te=typeof Promise>"u"?[]:(Ue=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Te=crypto.subtle.digest("SHA-512",new Uint8Array([0])),y(Te),Ue]:[Ue,y(Ue),Ue]),Ue=Te[0],Ws=Te[1],Ws=Ws&&Ws.then,Je=Ue&&Ue.constructor,ct=!!Te[2],Ge=function(s,a){zn.push([s,a]),Kt&&(queueMicrotask(Ld),Kt=!1)},Lt=!0,Kt=!0,gt=[],ms=[],Vt=X,jt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:_,pgp:!1,env:{},finalize:_},ze=jt,zn=[],hs=0,Qr=[];function Le(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var a=this._PSD=ze;if(typeof s!="function"){if(s!==x)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Sa(this,this._value)}else this._state=null,this._value=null,++a.ref,function u(d,p){try{p(function(m){if(d._state===null){if(m===d)throw new TypeError("A promise cannot be resolved with itself.");var g=d._lib&&Fs();m&&typeof m.then=="function"?u(d,function(k,I){m instanceof Le?m._then(k,I):m.then(k,I)}):(d._state=!0,d._value=m,wl(d)),g&&Vs()}},Sa.bind(null,d))}catch(m){Sa(d,m)}}(this,s)}var $a={get:function(){var s=ze,a=no;function u(d,p){var m=this,g=!s.global&&(s!==ze||a!==no),k=g&&!Yn(),I=new Le(function(W,D){Ea(m,new bl(kl(d,s,g,k),kl(p,s,g,k),W,D,s))});return this._consoleTask&&(I._consoleTask=this._consoleTask),I}return u.prototype=x,u},set:function(s){B(this,"then",s&&s.prototype===x?$a:{get:function(){return s},set:$a.set})}};function bl(s,a,u,d,p){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof a=="function"?a:null,this.resolve=u,this.reject=d,this.psd=p}function Sa(s,a){var u,d;ms.push(a),s._state===null&&(u=s._lib&&Fs(),a=Vt(a),s._state=!1,s._value=a,d=s,gt.some(function(p){return p._value===d._value})||gt.push(d),wl(s),u)&&Vs()}function wl(s){var a=s._listeners;s._listeners=[];for(var u=0,d=a.length;u<d;++u)Ea(s,a[u]);var p=s._PSD;--p.ref||p.finalize(),hs===0&&(++hs,Ge(function(){--hs==0&&Ta()},[]))}function Ea(s,a){if(s._state===null)s._listeners.push(a);else{var u=s._state?a.onFulfilled:a.onRejected;if(u===null)return(s._state?a.resolve:a.reject)(s._value);++a.psd.ref,++hs,Ge(Dd,[u,s,a])}}function Dd(s,a,u){try{var d,p=a._value;!a._state&&ms.length&&(ms=[]),d=le&&a._consoleTask?a._consoleTask.run(function(){return s(p)}):s(p),a._state||ms.indexOf(p)!==-1||(m=>{for(var g=gt.length;g;)if(gt[--g]._value===m._value)return gt.splice(g,1)})(a),u.resolve(d)}catch(m){u.reject(m)}finally{--hs==0&&Ta(),--u.psd.ref||u.psd.finalize()}}function Ld(){ys(jt,function(){Fs()&&Vs()})}function Fs(){var s=Lt;return Kt=Lt=!1,s}function Vs(){var s,a,u;do for(;0<zn.length;)for(s=zn,zn=[],u=s.length,a=0;a<u;++a){var d=s[a];d[0].apply(null,d[1])}while(0<zn.length);Kt=Lt=!0}function Ta(){for(var s=gt,a=(gt=[],s.forEach(function(d){d._PSD.onunhandled.call(null,d._value,d)}),Qr.slice(0)),u=a.length;u;)a[--u]()}function Zr(s){return new Le(x,!1,s)}function $t(s,a){var u=ze;return function(){var d=Fs(),p=ze;try{return Jn(u,!0),s.apply(this,arguments)}catch(m){a&&a(m)}finally{Jn(p,!1),d&&Vs()}}}C(Le.prototype,{then:$a,_then:function(s,a){Ea(this,new bl(null,null,s,a,ze))},catch:function(s){var a,u;return arguments.length===1?this.then(null,s):(a=s,u=arguments[1],typeof a=="function"?this.then(null,function(d){return(d instanceof a?u:Zr)(d)}):this.then(null,function(d){return(d&&d.name===a?u:Zr)(d)}))},finally:function(s){return this.then(function(a){return Le.resolve(s()).then(function(){return a})},function(a){return Le.resolve(s()).then(function(){return Zr(a)})})},timeout:function(s,a){var u=this;return s<1/0?new Le(function(d,p){var m=setTimeout(function(){return p(new Ve.Timeout(a))},s);u.then(d,p).finally(clearTimeout.bind(null,m))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&B(Le.prototype,Symbol.toStringTag,"Dexie.Promise"),jt.env=_l(),C(Le,{all:function(){var s=We.apply(null,arguments).map(so);return new Le(function(a,u){s.length===0&&a([]);var d=s.length;s.forEach(function(p,m){return Le.resolve(p).then(function(g){s[m]=g,--d||a(s)},u)})})},resolve:function(s){return s instanceof Le?s:s&&typeof s.then=="function"?new Le(function(a,u){s.then(a,u)}):new Le(x,!0,s)},reject:Zr,race:function(){var s=We.apply(null,arguments).map(so);return new Le(function(a,u){s.map(function(d){return Le.resolve(d).then(a,u)})})},PSD:{get:function(){return ze},set:function(s){return ze=s}},totalEchoes:{get:function(){return no}},newPSD:Gn,usePSD:ys,scheduler:{get:function(){return Ge},set:function(s){Ge=s}},rejectionMapper:{get:function(){return Vt},set:function(s){Vt=s}},follow:function(s,a){return new Le(function(u,d){return Gn(function(p,m){var g=ze;g.unhandleds=[],g.onunhandled=m,g.finalize=H(function(){var k,I=this;k=function(){I.unhandleds.length===0?p():m(I.unhandleds[0])},Qr.push(function W(){k(),Qr.splice(Qr.indexOf(W),1)}),++hs,Ge(function(){--hs==0&&Ta()},[])},g.finalize),s()},a,u,d)})}}),Je&&(Je.allSettled&&B(Le,"allSettled",function(){var s=We.apply(null,arguments).map(so);return new Le(function(a){s.length===0&&a([]);var u=s.length,d=new Array(u);s.forEach(function(p,m){return Le.resolve(p).then(function(g){return d[m]={status:"fulfilled",value:g}},function(g){return d[m]={status:"rejected",reason:g}}).then(function(){return--u||a(d)})})})}),Je.any&&typeof AggregateError<"u"&&B(Le,"any",function(){var s=We.apply(null,arguments).map(so);return new Le(function(a,u){s.length===0&&u(new AggregateError([]));var d=s.length,p=new Array(d);s.forEach(function(m,g){return Le.resolve(m).then(function(k){return a(k)},function(k){p[g]=k,--d||u(new AggregateError(p))})})})}),Je.withResolvers)&&(Le.withResolvers=Je.withResolvers);var Rt={awaits:0,echoes:0,id:0},Kd=0,eo=[],to=0,no=0,Rd=0;function Gn(s,g,u,d){var p=ze,m=Object.create(p),g=(m.parent=p,m.ref=0,m.global=!1,m.id=++Rd,jt.env,m.env=ct?{Promise:Le,PromiseProp:{value:Le,configurable:!0,writable:!0},all:Le.all,race:Le.race,allSettled:Le.allSettled,any:Le.any,resolve:Le.resolve,reject:Le.reject}:{},g&&v(m,g),++p.ref,m.finalize=function(){--this.parent.ref||this.parent.finalize()},ys(m,s,u,d));return m.ref===0&&m.finalize(),g}function Bs(){return Rt.id||(Rt.id=++Kd),++Rt.awaits,Rt.echoes+=Z,Rt.id}function Yn(){return!!Rt.awaits&&(--Rt.awaits==0&&(Rt.id=0),Rt.echoes=Rt.awaits*Z,!0)}function so(s){return Rt.echoes&&s&&s.constructor===Je?(Bs(),s.then(function(a){return Yn(),a},function(a){return Yn(),Ot(a)})):s}function Nd(){var s=eo[eo.length-1];eo.pop(),Jn(s,!1)}function Jn(s,a){var u,d,p=ze;(a?!Rt.echoes||to++&&s===ze:!to||--to&&s===ze)||queueMicrotask(a?(function(m){++no,Rt.echoes&&--Rt.echoes!=0||(Rt.echoes=Rt.awaits=Rt.id=0),eo.push(ze),Jn(m,!0)}).bind(null,s):Nd),s!==ze&&(ze=s,p===jt&&(jt.env=_l()),ct)&&(u=jt.env.Promise,d=s.env,p.global||s.global)&&(Object.defineProperty(i,"Promise",d.PromiseProp),u.all=d.all,u.race=d.race,u.resolve=d.resolve,u.reject=d.reject,d.allSettled&&(u.allSettled=d.allSettled),d.any)&&(u.any=d.any)}function _l(){var s=i.Promise;return ct?{Promise:s,PromiseProp:Object.getOwnPropertyDescriptor(i,"Promise"),all:s.all,race:s.race,allSettled:s.allSettled,any:s.any,resolve:s.resolve,reject:s.reject}:{}}function ys(s,a,u,d,p){var m=ze;try{return Jn(s,!0),a(u,d,p)}finally{Jn(m,!1)}}function kl(s,a,u,d){return typeof s!="function"?s:function(){var p=ze;u&&Bs(),Jn(a,!0);try{return s.apply(this,arguments)}finally{Jn(p,!1),d&&queueMicrotask(Yn)}}}function Aa(s){Promise===Je&&Rt.echoes===0?to===0?s():enqueueNativeMicroTask(s):setTimeout(s,0)}(""+Ws).indexOf("[native code]")===-1&&(Bs=Yn=_);var Ot=Le.reject,gs="￿",Dn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",xl="String expected.",ro="__dbnames",Pa="readonly",Oa="readwrite";function bs(s,a){return s?a?function(){return s.apply(this,arguments)&&a.apply(this,arguments)}:s:a}var Cl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function oo(s){return typeof s!="string"||/\./.test(s)?function(a){return a}:function(a){return a[s]===void 0&&s in a&&delete(a=Ie(a))[s],a}}function $l(){throw Ve.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ut(s,a){try{var u=Sl(s),d=Sl(a);if(u!==d)return u==="Array"?1:d==="Array"?-1:u==="binary"?1:d==="binary"?-1:u==="string"?1:d==="string"?-1:u==="Date"?1:d!=="Date"?NaN:-1;switch(u){case"number":case"Date":case"string":return a<s?1:s<a?-1:0;case"binary":for(var p=El(s),m=El(a),g=p.length,k=m.length,I=g<k?g:k,W=0;W<I;++W)if(p[W]!==m[W])return p[W]<m[W]?-1:1;return g===k?0:g<k?-1:1;case"Array":for(var D=s,M=a,j=D.length,q=M.length,K=j<q?j:q,L=0;L<K;++L){var N=ut(D[L],M[L]);if(N!==0)return N}return j===q?0:j<q?-1:1}}catch{}return NaN}function Sl(s){var a=typeof s;return a=="object"&&(ArrayBuffer.isView(s)||(a=ke(s))==="ArrayBuffer")?"binary":a}function El(s){return s instanceof Uint8Array?s:ArrayBuffer.isView(s)?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s)}function ao(s,a,u){var d=s.schema.yProps;return d?(a&&0<u.numFailures&&(a=a.filter(function(p,m){return!u.failures[m]})),Promise.all(d.map(function(p){return p=p.updatesTable,a?s.db.table(p).where("k").anyOf(a).delete():s.db.table(p).clear()})).then(function(){return u})):u}Tl.prototype.execute=function(s){var a=this["@@propmod"];if(a.add!==void 0){var u=a.add;if(f(u))return o(o([],f(s)?s:[],!0),u).sort();if(typeof u=="number")return(Number(s)||0)+u;if(typeof u=="bigint")try{return BigInt(s)+u}catch{return BigInt(0)+u}throw new TypeError("Invalid term ".concat(u))}if(a.remove!==void 0){var d=a.remove;if(f(d))return f(s)?s.filter(function(p){return!d.includes(p)}).sort():[];if(typeof d=="number")return Number(s)-d;if(typeof d=="bigint")try{return BigInt(s)-d}catch{return BigInt(0)-d}throw new TypeError("Invalid subtrahend ".concat(d))}return u=(u=a.replacePrefix)==null?void 0:u[0],u&&typeof s=="string"&&s.startsWith(u)?a.replacePrefix[1]+s.substring(u.length):s};var cr=Tl;function Tl(s){this["@@propmod"]=s}function Al(s,a){for(var u=c(a),d=u.length,p=!1,m=0;m<d;++m){var g=u[m],k=a[g],I=J(s,g);k instanceof cr?(Y(s,g,k.execute(I)),p=!0):I!==k&&(Y(s,g,k),p=!0)}return p}kt.prototype._trans=function(s,a,u){var d=this._tx||ze.trans,p=this.name,m=le&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(s==="readonly"?"read":"write"," ").concat(this.name));function g(W,D,M){if(M.schema[p])return a(M.idbtrans,M);throw new Ve.NotFound("Table "+p+" not part of transaction")}var k=Fs();try{var I=d&&d.db._novip===this.db._novip?d===ze.trans?d._promise(s,g,u):Gn(function(){return d._promise(s,g,u)},{trans:d,transless:ze.transless||ze}):function W(D,M,j,q){if(D.idbdb&&(D._state.openComplete||ze.letThrough||D._vip)){var K=D._createTransaction(M,j,D._dbSchema);try{K.create(),D._state.PR1398_maxLoop=3}catch(L){return L.name===De.InvalidState&&D.isOpen()&&0<--D._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),D.close({disableAutoOpen:!1}),D.open().then(function(){return W(D,M,j,q)})):Ot(L)}return K._promise(M,function(L,N){return Gn(function(){return ze.trans=K,q(L,N,K)})}).then(function(L){if(M==="readwrite")try{K.idbtrans.commit()}catch{}return M==="readonly"?L:K._completion.then(function(){return L})})}if(D._state.openComplete)return Ot(new Ve.DatabaseClosed(D._state.dbOpenError));if(!D._state.isBeingOpened){if(!D._state.autoOpen)return Ot(new Ve.DatabaseClosed);D.open().catch(_)}return D._state.dbReadyPromise.then(function(){return W(D,M,j,q)})}(this.db,s,[this.name],g);return m&&(I._consoleTask=m,I=I.catch(function(W){return console.trace(W),Ot(W)})),I}finally{k&&Vs()}},kt.prototype.get=function(s,a){var u=this;return s&&s.constructor===Object?this.where(s).first(a):s==null?Ot(new Ve.Type("Invalid argument to Table.get()")):this._trans("readonly",function(d){return u.core.get({trans:d,key:s}).then(function(p){return u.hook.reading.fire(p)})}).then(a)},kt.prototype.where=function(s){if(typeof s=="string")return new this.db.WhereClause(this,s);if(f(s))return new this.db.WhereClause(this,"[".concat(s.join("+"),"]"));var a=c(s);if(a.length===1)return this.where(a[0]).equals(s[a[0]]);var u=this.schema.indexes.concat(this.schema.primKey).filter(function(k){if(k.compound&&a.every(function(W){return 0<=k.keyPath.indexOf(W)})){for(var I=0;I<a.length;++I)if(a.indexOf(k.keyPath[I])===-1)return!1;return!0}return!1}).sort(function(k,I){return k.keyPath.length-I.keyPath.length})[0];if(u&&this.db._maxKey!==gs)return g=u.keyPath.slice(0,a.length),this.where(g).equals(g.map(function(k){return s[k]}));!u&&le&&console.warn("The query ".concat(JSON.stringify(s)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(a.join("+"),"]"));var d=this.schema.idxByName;function p(k,I){return ut(k,I)===0}var g=a.reduce(function(D,I){var W=D[0],D=D[1],M=d[I],j=s[I];return[W||M,W||!M?bs(D,M&&M.multi?function(q){return q=J(q,I),f(q)&&q.some(function(K){return p(j,K)})}:function(q){return p(j,J(q,I))}):D]},[null,null]),m=g[0],g=g[1];return m?this.where(m.name).equals(s[m.keyPath]).filter(g):u?this.filter(g):this.where(a).equals("")},kt.prototype.filter=function(s){return this.toCollection().and(s)},kt.prototype.count=function(s){return this.toCollection().count(s)},kt.prototype.offset=function(s){return this.toCollection().offset(s)},kt.prototype.limit=function(s){return this.toCollection().limit(s)},kt.prototype.each=function(s){return this.toCollection().each(s)},kt.prototype.toArray=function(s){return this.toCollection().toArray(s)},kt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},kt.prototype.orderBy=function(s){return new this.db.Collection(new this.db.WhereClause(this,f(s)?"[".concat(s.join("+"),"]"):s))},kt.prototype.reverse=function(){return this.toCollection().reverse()},kt.prototype.mapToClass=function(s){for(var a=this.db,u=this.name,d=((this.schema.mappedClass=s).prototype instanceof $l&&(s=(g=>{var k=D,I=g;if(typeof I!="function"&&I!==null)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function W(){this.constructor=k}function D(){return g!==null&&g.apply(this,arguments)||this}return n(k,I),k.prototype=I===null?Object.create(I):(W.prototype=I.prototype,new W),Object.defineProperty(D.prototype,"db",{get:function(){return a},enumerable:!1,configurable:!0}),D.prototype.table=function(){return u},D})(s)),new Set),p=s.prototype;p;p=y(p))Object.getOwnPropertyNames(p).forEach(function(g){return d.add(g)});function m(g){if(!g)return g;var k,I=Object.create(s.prototype);for(k in g)if(!d.has(k))try{I[k]=g[k]}catch{}return I}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=m,this.hook("reading",m),s},kt.prototype.defineClass=function(){return this.mapToClass(function(s){v(this,s)})},kt.prototype.add=function(s,a){var u=this,d=this.schema.primKey,p=d.auto,m=d.keyPath,g=s;return m&&p&&(g=oo(m)(s)),this._trans("readwrite",function(k){return u.core.mutate({trans:k,type:"add",keys:a!=null?[a]:null,values:[g]})}).then(function(k){return k.numFailures?Le.reject(k.failures[0]):k.lastResult}).then(function(k){if(m)try{Y(s,m,k)}catch{}return k})},kt.prototype.upsert=function(s,a){var u=this,d=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return u.core.get({trans:p,key:s}).then(function(m){var g=m??{};return Al(g,a),d&&Y(g,d,s),u.core.mutate({trans:p,type:"put",values:[g],keys:[s],upsert:!0,updates:{keys:[s],changeSpecs:[a]}}).then(function(k){return k.numFailures?Le.reject(k.failures[0]):!!m})})})},kt.prototype.update=function(s,a){return typeof s!="object"||f(s)?this.where(":id").equals(s).modify(a):(s=J(s,this.schema.primKey.keyPath))===void 0?Ot(new Ve.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(s).modify(a)},kt.prototype.put=function(s,a){var u=this,d=this.schema.primKey,p=d.auto,m=d.keyPath,g=s;return m&&p&&(g=oo(m)(s)),this._trans("readwrite",function(k){return u.core.mutate({trans:k,type:"put",values:[g],keys:a!=null?[a]:null})}).then(function(k){return k.numFailures?Le.reject(k.failures[0]):k.lastResult}).then(function(k){if(m)try{Y(s,m,k)}catch{}return k})},kt.prototype.delete=function(s){var a=this;return this._trans("readwrite",function(u){return a.core.mutate({trans:u,type:"delete",keys:[s]}).then(function(d){return ao(a,[s],d)}).then(function(d){return d.numFailures?Le.reject(d.failures[0]):void 0})})},kt.prototype.clear=function(){var s=this;return this._trans("readwrite",function(a){return s.core.mutate({trans:a,type:"deleteRange",range:Cl}).then(function(u){return ao(s,null,u)})}).then(function(a){return a.numFailures?Le.reject(a.failures[0]):void 0})},kt.prototype.bulkGet=function(s){var a=this;return this._trans("readonly",function(u){return a.core.getMany({keys:s,trans:u}).then(function(d){return d.map(function(p){return a.hook.reading.fire(p)})})})},kt.prototype.bulkAdd=function(s,a,u){var d=this,p=Array.isArray(a)?a:void 0,m=(u=u||(p?void 0:a))?u.allKeys:void 0;return this._trans("readwrite",function(g){var k=d.schema.primKey,W=k.auto,k=k.keyPath;if(k&&p)throw new Ve.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new Ve.InvalidArgument("Arguments objects and keys must have the same length");var I=s.length,W=k&&W?s.map(oo(k)):s;return d.core.mutate({trans:g,type:"add",keys:p,values:W,wantResults:m}).then(function(D){var M=D.numFailures,j=D.failures;if(M===0)return m?D.results:D.lastResult;throw new fe("".concat(d.name,".bulkAdd(): ").concat(M," of ").concat(I," operations failed"),j)})})},kt.prototype.bulkPut=function(s,a,u){var d=this,p=Array.isArray(a)?a:void 0,m=(u=u||(p?void 0:a))?u.allKeys:void 0;return this._trans("readwrite",function(g){var k=d.schema.primKey,W=k.auto,k=k.keyPath;if(k&&p)throw new Ve.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new Ve.InvalidArgument("Arguments objects and keys must have the same length");var I=s.length,W=k&&W?s.map(oo(k)):s;return d.core.mutate({trans:g,type:"put",keys:p,values:W,wantResults:m}).then(function(D){var M=D.numFailures,j=D.failures;if(M===0)return m?D.results:D.lastResult;throw new fe("".concat(d.name,".bulkPut(): ").concat(M," of ").concat(I," operations failed"),j)})})},kt.prototype.bulkUpdate=function(s){var a=this,u=this.core,d=s.map(function(g){return g.key}),p=s.map(function(g){return g.changes}),m=[];return this._trans("readwrite",function(g){return u.getMany({trans:g,keys:d,cache:"clone"}).then(function(k){var I=[],W=[],D=(s.forEach(function(M,j){var q=M.key,K=M.changes,L=k[j];if(L){for(var N=0,Q=Object.keys(K);N<Q.length;N++){var G=Q[N],oe=K[G];if(G===a.schema.primKey.keyPath){if(ut(oe,q)!==0)throw new Ve.Constraint("Cannot update primary key in bulkUpdate()")}else Y(L,G,oe)}m.push(j),I.push(q),W.push(L)}}),I.length);return u.mutate({trans:g,type:"put",keys:I,values:W,updates:{keys:d,changeSpecs:p}}).then(function(M){var j=M.numFailures,q=M.failures;if(j===0)return D;for(var K=0,L=Object.keys(q);K<L.length;K++){var N,Q=L[K],G=m[Number(Q)];G!=null&&(N=q[Q],delete q[Q],q[G]=N)}throw new fe("".concat(a.name,".bulkUpdate(): ").concat(j," of ").concat(D," operations failed"),q)})})})},kt.prototype.bulkDelete=function(s){var a=this,u=s.length;return this._trans("readwrite",function(d){return a.core.mutate({trans:d,type:"delete",keys:s}).then(function(p){return ao(a,s,p)})}).then(function(d){var p=d.numFailures,m=d.failures;if(p===0)return d.lastResult;throw new fe("".concat(a.name,".bulkDelete(): ").concat(p," of ").concat(u," operations failed"),m)})};var Pl=kt;function kt(){}function dr(s){function a(g,k){if(k){for(var I=arguments.length,W=new Array(I-1);--I;)W[I-1]=arguments[I];return u[g].subscribe.apply(null,W),s}if(typeof g=="string")return u[g]}var u={};a.addEventType=m;for(var d=1,p=arguments.length;d<p;++d)m(arguments[d]);return a;function m(g,k,I){var W,D;if(typeof g!="object")return k=k||ge,D={subscribers:[],fire:I=I||_,subscribe:function(M){D.subscribers.indexOf(M)===-1&&(D.subscribers.push(M),D.fire=k(D.fire,M))},unsubscribe:function(M){D.subscribers=D.subscribers.filter(function(j){return j!==M}),D.fire=D.subscribers.reduce(k,I)}},u[g]=a[g]=D;c(W=g).forEach(function(M){var j=W[M];if(f(j))m(M,W[M][0],W[M][1]);else{if(j!=="asap")throw new Ve.InvalidArgument("Invalid event config");var q=m(M,X,function(){for(var K=arguments.length,L=new Array(K);K--;)L[K]=arguments[K];q.subscribers.forEach(function(N){U(function(){N.apply(null,L)})})})}})}}function fr(s,a){return te(a).from({prototype:s}),a}function Us(s,a){return!(s.filter||s.algorithm||s.or)&&(a?s.justLimit:!s.replayFilter)}function Ma(s,a){s.filter=bs(s.filter,a)}function Ia(s,a,u){var d=s.replayFilter;s.replayFilter=d?function(){return bs(d(),a())}:a,s.justLimit=u&&!d}function io(s,a){if(s.isPrimKey)return a.primaryKey;var u=a.getIndexByKeyPath(s.index);if(u)return u;throw new Ve.Schema("KeyPath "+s.index+" on object store "+a.name+" is not indexed")}function Ol(s,a,u){var d=io(s,a.schema);return a.openCursor({trans:u,values:!s.keysOnly,reverse:s.dir==="prev",unique:!!s.unique,query:{index:d,range:s.range}})}function lo(s,a,u,d){var p,m,g=s.replayFilter?bs(s.filter,s.replayFilter()):s.filter;return s.or?(p={},m=function(k,I,W){var D,M;g&&!g(I,W,function(j){return I.stop(j)},function(j){return I.fail(j)})||((M=""+(D=I.primaryKey))=="[object ArrayBuffer]"&&(M=""+new Uint8Array(D)),w(p,M))||(p[M]=!0,a(k,I,W))},Promise.all([s.or._iterate(m,u),Ml(Ol(s,d,u),s.algorithm,m,!s.keysOnly&&s.valueMapper)])):Ml(Ol(s,d,u),bs(s.algorithm,g),a,!s.keysOnly&&s.valueMapper)}function Ml(s,a,u,d){var p=$t(d?function(m,g,k){return u(d(m),g,k)}:u);return s.then(function(m){if(m)return m.start(function(){var g=function(){return m.continue()};a&&!a(m,function(k){return g=k},function(k){m.stop(k),g=_},function(k){m.fail(k),g=_})||p(m.value,m,function(k){return g=k}),g()})})}ft.prototype._read=function(s,a){var u=this._ctx;return u.error?u.table._trans(null,Ot.bind(null,u.error)):u.table._trans("readonly",s).then(a)},ft.prototype._write=function(s){var a=this._ctx;return a.error?a.table._trans(null,Ot.bind(null,a.error)):a.table._trans("readwrite",s,"locked")},ft.prototype._addAlgorithm=function(s){var a=this._ctx;a.algorithm=bs(a.algorithm,s)},ft.prototype._iterate=function(s,a){return lo(this._ctx,s,a,this._ctx.table.core)},ft.prototype.clone=function(s){var a=Object.create(this.constructor.prototype),u=Object.create(this._ctx);return s&&v(u,s),a._ctx=u,a},ft.prototype.raw=function(){return this._ctx.valueMapper=null,this},ft.prototype.each=function(s){var a=this._ctx;return this._read(function(u){return lo(a,s,u,a.table.core)})},ft.prototype.count=function(s){var a=this;return this._read(function(u){var d,p=a._ctx,m=p.table.core;return Us(p,!0)?m.count({trans:u,query:{index:io(p,m.schema),range:p.range}}).then(function(g){return Math.min(g,p.limit)}):(d=0,lo(p,function(){return++d,!1},u,m).then(function(){return d}))}).then(s)},ft.prototype.sortBy=function(s,a){var u=s.split(".").reverse(),d=u[0],p=u.length-1;function m(I,W){return W?m(I[u[W]],W-1):I[d]}var g=this._ctx.dir==="next"?1:-1;function k(I,W){return ut(m(I,p),m(W,p))*g}return this.toArray(function(I){return I.slice().sort(k)}).then(a)},ft.prototype.toArray=function(s){var a=this;return this._read(function(u){var d,p,m,g=a._ctx;return Us(g,!0)&&0<g.limit?(d=g.valueMapper,p=io(g,g.table.core.schema),g.table.core.query({trans:u,limit:g.limit,values:!0,direction:g.dir==="prev"?"prev":void 0,query:{index:p,range:g.range}}).then(function(k){return k=k.result,d?k.map(d):k})):(m=[],lo(g,function(k){return m.push(k)},u,g.table.core).then(function(){return m}))},s)},ft.prototype.offset=function(s){var a=this._ctx;return s<=0||(a.offset+=s,Us(a)?Ia(a,function(){var u=s;return function(d,p){return u===0||(u===1?--u:p(function(){d.advance(u),u=0}),!1)}}):Ia(a,function(){var u=s;return function(){return--u<0}})),this},ft.prototype.limit=function(s){return this._ctx.limit=Math.min(this._ctx.limit,s),Ia(this._ctx,function(){var a=s;return function(u,d,p){return--a<=0&&d(p),0<=a}},!0),this},ft.prototype.until=function(s,a){return Ma(this._ctx,function(u,d,p){return!s(u.value)||(d(p),a)}),this},ft.prototype.first=function(s){return this.limit(1).toArray(function(a){return a[0]}).then(s)},ft.prototype.last=function(s){return this.reverse().first(s)},ft.prototype.filter=function(s){var a;return Ma(this._ctx,function(u){return s(u.value)}),(a=this._ctx).isMatch=bs(a.isMatch,s),this},ft.prototype.and=function(s){return this.filter(s)},ft.prototype.or=function(s){return new this.db.WhereClause(this._ctx.table,s,this)},ft.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ft.prototype.desc=function(){return this.reverse()},ft.prototype.eachKey=function(s){var a=this._ctx;return a.keysOnly=!a.isMatch,this.each(function(u,d){s(d.key,d)})},ft.prototype.eachUniqueKey=function(s){return this._ctx.unique="unique",this.eachKey(s)},ft.prototype.eachPrimaryKey=function(s){var a=this._ctx;return a.keysOnly=!a.isMatch,this.each(function(u,d){s(d.primaryKey,d)})},ft.prototype.keys=function(s){var a=this._ctx,u=(a.keysOnly=!a.isMatch,[]);return this.each(function(d,p){u.push(p.key)}).then(function(){return u}).then(s)},ft.prototype.primaryKeys=function(s){var a=this._ctx;if(Us(a,!0)&&0<a.limit)return this._read(function(d){var p=io(a,a.table.core.schema);return a.table.core.query({trans:d,values:!1,limit:a.limit,direction:a.dir==="prev"?"prev":void 0,query:{index:p,range:a.range}})}).then(function(d){return d.result}).then(s);a.keysOnly=!a.isMatch;var u=[];return this.each(function(d,p){u.push(p.primaryKey)}).then(function(){return u}).then(s)},ft.prototype.uniqueKeys=function(s){return this._ctx.unique="unique",this.keys(s)},ft.prototype.firstKey=function(s){return this.limit(1).keys(function(a){return a[0]}).then(s)},ft.prototype.lastKey=function(s){return this.reverse().firstKey(s)},ft.prototype.distinct=function(){var s,a=this._ctx,a=a.index&&a.table.schema.idxByName[a.index];return a&&a.multi&&(s={},Ma(this._ctx,function(d){var d=d.primaryKey.toString(),p=w(s,d);return s[d]=!0,!p})),this},ft.prototype.modify=function(s){var a=this,u=this._ctx;return this._write(function(d){function p(L,N){var Q=N.failures;j+=L-N.numFailures;for(var G=0,oe=c(Q);G<oe.length;G++){var ve=oe[G];M.push(Q[ve])}}var m=typeof s=="function"?s:function(L){return Al(L,s)},g=u.table.core,D=g.schema.primaryKey,k=D.outbound,I=D.extractKey,W=200,D=a.db._options.modifyChunkSize,M=(D&&(W=typeof D=="object"?D[g.name]||D["*"]||200:D),[]),j=0,q=[],K=s===Il;return a.clone().primaryKeys().then(function(L){function N(G){var oe=Math.min(W,L.length-G),ve=L.slice(G,G+oe);return(K?Promise.resolve([]):g.getMany({trans:d,keys:ve,cache:"immutable"})).then(function(ye){var $e=[],be=[],Be=k?[]:null,Ce=K?ve:[];if(!K)for(var qe=0;qe<oe;++qe){var he=ye[qe],Qe={value:Ie(he),primKey:L[G+qe]};m.call(Qe,Qe.value,Qe)!==!1&&(Qe.value==null?Ce.push(L[G+qe]):k||ut(I(he),I(Qe.value))===0?(be.push(Qe.value),k&&Be.push(L[G+qe])):(Ce.push(L[G+qe]),$e.push(Qe.value)))}return Promise.resolve(0<$e.length&&g.mutate({trans:d,type:"add",values:$e}).then(function(Ze){for(var ot in Ze.failures)Ce.splice(parseInt(ot),1);p($e.length,Ze)})).then(function(){return(0<be.length||Q&&typeof s=="object")&&g.mutate({trans:d,type:"put",keys:Be,values:be,criteria:Q,changeSpec:typeof s!="function"&&s,isAdditionalChunk:0<G}).then(function(Ze){return p(be.length,Ze)})}).then(function(){return(0<Ce.length||Q&&K)&&g.mutate({trans:d,type:"delete",keys:Ce,criteria:Q,isAdditionalChunk:0<G}).then(function(Ze){return ao(u.table,Ce,Ze)}).then(function(Ze){return p(Ce.length,Ze)})}).then(function(){return L.length>G+oe&&N(G+W)})})}var Q=Us(u)&&u.limit===1/0&&(typeof s!="function"||K)&&{index:u.index,range:u.range};return N(0).then(function(){if(0<M.length)throw new je("Error modifying one or more objects",M,j,q);return L.length})})})},ft.prototype.delete=function(){var s=this._ctx,a=s.range;return!Us(s)||s.table.schema.yProps||!s.isPrimKey&&a.type!==3?this.modify(Il):this._write(function(u){var d=s.table.core.schema.primaryKey,p=a;return s.table.core.count({trans:u,query:{index:d,range:p}}).then(function(m){return s.table.core.mutate({trans:u,type:"deleteRange",range:p}).then(function(I){var k=I.failures,I=I.numFailures;if(I)throw new je("Could not delete some values",Object.keys(k).map(function(W){return k[W]}),m-I);return m-I})})})};var Fd=ft;function ft(){}var Il=function(s,a){return a.value=null};function Vd(s,a){return s<a?-1:s===a?0:1}function Bd(s,a){return a<s?-1:s===a?0:1}function nn(s,a,u){return s=s instanceof Dl?new s.Collection(s):s,s._ctx.error=new(u||TypeError)(a),s}function qs(s){return new s.Collection(s,function(){return jl("")}).limit(0)}function uo(q,a,u,d){var p,m,g,k,I,W,D,M=u.length;if(!u.every(function(L){return typeof L=="string"}))return nn(q,xl);function j(L){p=L==="next"?function(Q){return Q.toUpperCase()}:function(Q){return Q.toLowerCase()},m=L==="next"?function(Q){return Q.toLowerCase()}:function(Q){return Q.toUpperCase()},g=L==="next"?Vd:Bd;var N=u.map(function(Q){return{lower:m(Q),upper:p(Q)}}).sort(function(Q,G){return g(Q.lower,G.lower)});k=N.map(function(Q){return Q.upper}),I=N.map(function(Q){return Q.lower}),D=(W=L)==="next"?"":d}j("next");var q=new q.Collection(q,function(){return Xn(k[0],I[M-1]+d)}),K=(q._ondirectionchange=function(L){j(L)},0);return q._addAlgorithm(function(L,N,Q){var G=L.key;if(typeof G=="string"){var oe=m(G);if(a(oe,I,K))return!0;for(var ve=null,ye=K;ye<M;++ye){var $e=((be,Be,Ce,qe,he,Qe)=>{for(var Ze=Math.min(be.length,qe.length),ot=-1,lt=0;lt<Ze;++lt){var sn=Be[lt];if(sn!==qe[lt])return he(be[lt],Ce[lt])<0?be.substr(0,lt)+Ce[lt]+Ce.substr(lt+1):he(be[lt],qe[lt])<0?be.substr(0,lt)+qe[lt]+Ce.substr(lt+1):0<=ot?be.substr(0,ot)+Be[ot]+Ce.substr(ot+1):null;he(be[lt],sn)<0&&(ot=lt)}return Ze<qe.length&&Qe==="next"?be+Ce.substr(be.length):Ze<be.length&&Qe==="prev"?be.substr(0,Ce.length):ot<0?null:be.substr(0,ot)+qe[ot]+Ce.substr(ot+1)})(G,oe,k[ye],I[ye],g,W);$e===null&&ve===null?K=ye+1:(ve===null||0<g(ve,$e))&&(ve=$e)}N(ve!==null?function(){L.continue(ve+D)}:Q)}return!1}),q}function Xn(s,a,u,d){return{type:2,lower:s,upper:a,lowerOpen:u,upperOpen:d}}function jl(s){return{type:1,lower:s,upper:s}}Object.defineProperty(Nt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Nt.prototype.between=function(s,a,u,d){u=u!==!1,d=d===!0;try{return 0<this._cmp(s,a)||this._cmp(s,a)===0&&(u||d)&&(!u||!d)?qs(this):new this.Collection(this,function(){return Xn(s,a,!u,!d)})}catch{return nn(this,Dn)}},Nt.prototype.equals=function(s){return s==null?nn(this,Dn):new this.Collection(this,function(){return jl(s)})},Nt.prototype.above=function(s){return s==null?nn(this,Dn):new this.Collection(this,function(){return Xn(s,void 0,!0)})},Nt.prototype.aboveOrEqual=function(s){return s==null?nn(this,Dn):new this.Collection(this,function(){return Xn(s,void 0,!1)})},Nt.prototype.below=function(s){return s==null?nn(this,Dn):new this.Collection(this,function(){return Xn(void 0,s,!1,!0)})},Nt.prototype.belowOrEqual=function(s){return s==null?nn(this,Dn):new this.Collection(this,function(){return Xn(void 0,s)})},Nt.prototype.startsWith=function(s){return typeof s!="string"?nn(this,xl):this.between(s,s+gs,!0,!0)},Nt.prototype.startsWithIgnoreCase=function(s){return s===""?this.startsWith(s):uo(this,function(a,u){return a.indexOf(u[0])===0},[s],gs)},Nt.prototype.equalsIgnoreCase=function(s){return uo(this,function(a,u){return a===u[0]},[s],"")},Nt.prototype.anyOfIgnoreCase=function(){var s=We.apply(_e,arguments);return s.length===0?qs(this):uo(this,function(a,u){return u.indexOf(a)!==-1},s,"")},Nt.prototype.startsWithAnyOfIgnoreCase=function(){var s=We.apply(_e,arguments);return s.length===0?qs(this):uo(this,function(a,u){return u.some(function(d){return a.indexOf(d)===0})},s,gs)},Nt.prototype.anyOf=function(){var s,a,u=this,d=We.apply(_e,arguments),p=this._cmp;try{d.sort(p)}catch{return nn(this,Dn)}return d.length===0?qs(this):((s=new this.Collection(this,function(){return Xn(d[0],d[d.length-1])}))._ondirectionchange=function(m){p=m==="next"?u._ascending:u._descending,d.sort(p)},a=0,s._addAlgorithm(function(m,g,k){for(var I=m.key;0<p(I,d[a]);)if(++a===d.length)return g(k),!1;return p(I,d[a])===0||(g(function(){m.continue(d[a])}),!1)}),s)},Nt.prototype.notEqual=function(s){return this.inAnyRange([[-1/0,s],[s,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Nt.prototype.noneOf=function(){var s=We.apply(_e,arguments);if(s.length===0)return new this.Collection(this);try{s.sort(this._ascending)}catch{return nn(this,Dn)}var a=s.reduce(function(u,d){return u?u.concat([[u[u.length-1][1],d]]):[[-1/0,d]]},null);return a.push([s[s.length-1],this.db._maxKey]),this.inAnyRange(a,{includeLowers:!1,includeUppers:!1})},Nt.prototype.inAnyRange=function(s,Q){var u=this,d=this._cmp,p=this._ascending,m=this._descending,g=this._min,k=this._max;if(s.length===0)return qs(this);if(!s.every(function(G){return G[0]!==void 0&&G[1]!==void 0&&p(G[0],G[1])<=0}))return nn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ve.InvalidArgument);var I=!Q||Q.includeLowers!==!1,W=Q&&Q.includeUppers===!0,D,M=p;function j(G,oe){return M(G[0],oe[0])}try{(D=s.reduce(function(G,oe){for(var ve=0,ye=G.length;ve<ye;++ve){var $e=G[ve];if(d(oe[0],$e[1])<0&&0<d(oe[1],$e[0])){$e[0]=g($e[0],oe[0]),$e[1]=k($e[1],oe[1]);break}}return ve===ye&&G.push(oe),G},[])).sort(j)}catch{return nn(this,Dn)}var q=0,K=W?function(G){return 0<p(G,D[q][1])}:function(G){return 0<=p(G,D[q][1])},L=I?function(G){return 0<m(G,D[q][0])}:function(G){return 0<=m(G,D[q][0])},N=K,Q=new this.Collection(this,function(){return Xn(D[0][0],D[D.length-1][1],!I,!W)});return Q._ondirectionchange=function(G){M=G==="next"?(N=K,p):(N=L,m),D.sort(j)},Q._addAlgorithm(function(G,oe,ve){for(var ye,$e=G.key;N($e);)if(++q===D.length)return oe(ve),!1;return!K(ye=$e)&&!L(ye)||(u._cmp($e,D[q][1])===0||u._cmp($e,D[q][0])===0||oe(function(){M===p?G.continue(D[q][0]):G.continue(D[q][1])}),!1)}),Q},Nt.prototype.startsWithAnyOf=function(){var s=We.apply(_e,arguments);return s.every(function(a){return typeof a=="string"})?s.length===0?qs(this):this.inAnyRange(s.map(function(a){return[a,a+gs]})):nn(this,"startsWithAnyOf() only works with strings")};var Dl=Nt;function Nt(){}function mn(s){return $t(function(a){return pr(a),s(a.target.error),!1})}function pr(s){s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault()}var co="storagemutated",ja="x-storagemutated-1",Qn=dr(null,co),Ud=(_n.prototype._lock=function(){return T(!ze.global),++this._reculock,this._reculock!==1||ze.global||(ze.lockOwnerFor=this),this},_n.prototype._unlock=function(){if(T(!ze.global),--this._reculock==0)for(ze.global||(ze.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var s=this._blockedFuncs.shift();try{ys(s[1],s[0])}catch{}}return this},_n.prototype._locked=function(){return this._reculock&&ze.lockOwnerFor!==this},_n.prototype.create=function(s){var a=this;if(this.mode){var u=this.db.idbdb,d=this.db._state.dbOpenError;if(T(!this.idbtrans),!s&&!u)switch(d&&d.name){case"DatabaseClosedError":throw new Ve.DatabaseClosed(d);case"MissingAPIError":throw new Ve.MissingAPI(d.message,d);default:throw new Ve.OpenFailed(d)}if(!this.active)throw new Ve.TransactionInactive;T(this._completion._state===null),(s=this.idbtrans=s||(this.db.core||u).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=$t(function(p){pr(p),a._reject(s.error)}),s.onabort=$t(function(p){pr(p),a.active&&a._reject(new Ve.Abort(s.error)),a.active=!1,a.on("abort").fire(p)}),s.oncomplete=$t(function(){a.active=!1,a._resolve(),"mutatedParts"in s&&Qn.storagemutated.fire(s.mutatedParts)})}return this},_n.prototype._promise=function(s,a,u){var d,p=this;return s==="readwrite"&&this.mode!=="readwrite"?Ot(new Ve.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Le(function(m,g){p._blockedFuncs.push([function(){p._promise(s,a,u).then(m,g)},ze])}):u?Gn(function(){var m=new Le(function(g,k){p._lock();var I=a(g,k,p);I&&I.then&&I.then(g,k)});return m.finally(function(){return p._unlock()}),m._lib=!0,m}):((d=new Le(function(m,g){var k=a(m,g,p);k&&k.then&&k.then(m,g)}))._lib=!0,d):Ot(new Ve.TransactionInactive)},_n.prototype._root=function(){return this.parent?this.parent._root():this},_n.prototype.waitFor=function(s){var a,u=this._root(),d=Le.resolve(s),p=(u._waitingFor?u._waitingFor=u._waitingFor.then(function(){return d}):(u._waitingFor=d,u._waitingQueue=[],a=u.idbtrans.objectStore(u.storeNames[0]),function m(){for(++u._spinCount;u._waitingQueue.length;)u._waitingQueue.shift()();u._waitingFor&&(a.get(-1/0).onsuccess=m)}()),u._waitingFor);return new Le(function(m,g){d.then(function(k){return u._waitingQueue.push($t(m.bind(null,k)))},function(k){return u._waitingQueue.push($t(g.bind(null,k)))}).finally(function(){u._waitingFor===p&&(u._waitingFor=null)})})},_n.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ve.Abort))},_n.prototype.table=function(s){var a=this._memoizedTables||(this._memoizedTables={});if(w(a,s))return a[s];var u=this.schema[s];if(u)return(u=new this.db.Table(s,u,this)).core=this.db.core.table(s),a[s]=u;throw new Ve.NotFound("Table "+s+" not part of transaction")},_n);function _n(){}function Da(s,a,u,d,p,m,g,k){return{name:s,keyPath:a,unique:u,multi:d,auto:p,compound:m,src:(u&&!g?"&":"")+(d?"*":"")+(p?"++":"")+Ll(a),type:k}}function Ll(s){return typeof s=="string"?s:s?"["+[].join.call(s,"+")+"]":""}function La(s,a,u){return{name:s,primKey:a,indexes:u,mappedClass:null,idxByName:(d=function(p){return[p.name,p]},u.reduce(function(p,m,g){return m=d(m,g),m&&(p[m[0]]=m[1]),p},{}))};var d}var vr=function(s){try{return s.only([[]]),vr=function(){return[[]]},[[]]}catch{return vr=function(){return gs},gs}};function Ka(s){return s==null?function(){}:typeof s=="string"?(a=s).split(".").length===1?function(u){return u[a]}:function(u){return J(u,a)}:function(u){return J(u,s)};var a}function Kl(s){return[].slice.call(s)}var qd=0;function mr(s){return s==null?":id":typeof s=="string"?s:"[".concat(s.join("+"),"]")}function Hd(s,a,g){function d(N){if(N.type===3)return null;if(N.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var q=N.lower,K=N.upper,L=N.lowerOpen,N=N.upperOpen;return q===void 0?K===void 0?null:a.upperBound(K,!!N):K===void 0?a.lowerBound(q,!!L):a.bound(q,K,!!L,!!N)}function p(j){var q,K,L=j.name;return{name:L,schema:j,mutate:function(N){var Q=N.trans,G=N.type,oe=N.keys,ve=N.values,ye=N.range;return new Promise(function($e,be){$e=$t($e);var Be=Q.objectStore(L),Ce=Be.keyPath==null,qe=G==="put"||G==="add";if(!qe&&G!=="delete"&&G!=="deleteRange")throw new Error("Invalid operation type: "+G);var he,Qe=(oe||ve||{length:1}).length;if(oe&&ve&&oe.length!==ve.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 Ze(Jt){++sn,pr(Jt)}var ot=[],lt=[],sn=0;if(G==="deleteRange"){if(ye.type===4)return $e({numFailures:sn,failures:lt,results:[],lastResult:void 0});ye.type===3?ot.push(he=Be.clear()):ot.push(he=Be.delete(d(ye)))}else{var Ce=qe?Ce?[ve,oe]:[ve,null]:[oe,null],nt=Ce[0],Ht=Ce[1];if(qe)for(var Wt=0;Wt<Qe;++Wt)ot.push(he=Ht&&Ht[Wt]!==void 0?Be[G](nt[Wt],Ht[Wt]):Be[G](nt[Wt])),he.onerror=Ze;else for(Wt=0;Wt<Qe;++Wt)ot.push(he=Be[G](nt[Wt])),he.onerror=Ze}function xo(Jt){Jt=Jt.target.result,ot.forEach(function(ks,ti){return ks.error!=null&&(lt[ti]=ks.error)}),$e({numFailures:sn,failures:lt,results:G==="delete"?oe:ot.map(function(ks){return ks.result}),lastResult:Jt})}he.onerror=function(Jt){Ze(Jt),xo(Jt)},he.onsuccess=xo})},getMany:function(N){var Q=N.trans,G=N.keys;return new Promise(function(oe,ve){oe=$t(oe);for(var ye,$e=Q.objectStore(L),be=G.length,Be=new Array(be),Ce=0,qe=0,he=function(ot){ot=ot.target,Be[ot._pos]=ot.result,++qe===Ce&&oe(Be)},Qe=mn(ve),Ze=0;Ze<be;++Ze)G[Ze]!=null&&((ye=$e.get(G[Ze]))._pos=Ze,ye.onsuccess=he,ye.onerror=Qe,++Ce);Ce===0&&oe(Be)})},get:function(N){var Q=N.trans,G=N.key;return new Promise(function(oe,ve){oe=$t(oe);var ye=Q.objectStore(L).get(G);ye.onsuccess=function($e){return oe($e.target.result)},ye.onerror=mn(ve)})},query:(q=I,K=W,function(N){return new Promise(function(Q,G){Q=$t(Q);var oe,ve,ye,$e,Qe=N.trans,be=N.values,Be=N.limit,he=N.query,Ce=(Ce=N.direction)!=null?Ce:"next",qe=Be===1/0?void 0:Be,Ze=he.index,he=he.range,Qe=Qe.objectStore(L),Qe=Ze.isPrimaryKey?Qe:Qe.index(Ze.name),Ze=d(he);if(Be===0)return Q({result:[]});K?(he={query:Ze,count:qe,direction:Ce},(oe=be?Qe.getAll(he):Qe.getAllKeys(he)).onsuccess=function(ot){return Q({result:ot.target.result})},oe.onerror=mn(G)):q&&Ce==="next"?((oe=be?Qe.getAll(Ze,qe):Qe.getAllKeys(Ze,qe)).onsuccess=function(ot){return Q({result:ot.target.result})},oe.onerror=mn(G)):(ve=0,ye=!be&&"openKeyCursor"in Qe?Qe.openKeyCursor(Ze,Ce):Qe.openCursor(Ze,Ce),$e=[],ye.onsuccess=function(){var ot=ye.result;return!ot||($e.push(be?ot.value:ot.primaryKey),++ve===Be)?Q({result:$e}):void ot.continue()},ye.onerror=mn(G))})}),openCursor:function(N){var Q=N.trans,G=N.values,oe=N.query,ve=N.reverse,ye=N.unique;return new Promise(function($e,be){$e=$t($e);var qe=oe.index,Be=oe.range,Ce=Q.objectStore(L),Ce=qe.isPrimaryKey?Ce:Ce.index(qe.name),qe=ve?ye?"prevunique":"prev":ye?"nextunique":"next",he=!G&&"openKeyCursor"in Ce?Ce.openKeyCursor(d(Be),qe):Ce.openCursor(d(Be),qe);he.onerror=mn(be),he.onsuccess=$t(function(Qe){var Ze,ot,lt,sn,nt=he.result;nt?(nt.___id=++qd,nt.done=!1,Ze=nt.continue.bind(nt),ot=(ot=nt.continuePrimaryKey)&&ot.bind(nt),lt=nt.advance.bind(nt),sn=function(){throw new Error("Cursor not stopped")},nt.trans=Q,nt.stop=nt.continue=nt.continuePrimaryKey=nt.advance=function(){throw new Error("Cursor not started")},nt.fail=$t(be),nt.next=function(){var Ht=this,Wt=1;return this.start(function(){return Wt--?Ht.continue():Ht.stop()}).then(function(){return Ht})},nt.start=function(Ht){function Wt(){if(he.result)try{Ht()}catch(Jt){nt.fail(Jt)}else nt.done=!0,nt.start=function(){throw new Error("Cursor behind last entry")},nt.stop()}var xo=new Promise(function(Jt,ks){Jt=$t(Jt),he.onerror=mn(ks),nt.fail=ks,nt.stop=function(ti){nt.stop=nt.continue=nt.continuePrimaryKey=nt.advance=sn,Jt(ti)}});return he.onsuccess=$t(function(Jt){he.onsuccess=Wt,Wt()}),nt.continue=Ze,nt.continuePrimaryKey=ot,nt.advance=lt,Wt(),xo},$e(nt)):$e(null)},be)})},count:function(N){var Q=N.query,G=N.trans,oe=Q.index,ve=Q.range;return new Promise(function(ye,$e){var be=G.objectStore(L),be=oe.isPrimaryKey?be:be.index(oe.name),Be=d(ve),Be=Be?be.count(Be):be.count();Be.onsuccess=$t(function(Ce){return ye(Ce.target.result)}),Be.onerror=mn($e)})}}}m=g,k=Kl((g=s).objectStoreNames),D=0<k.length?m.objectStore(k[0]):{};var m,g={schema:{name:g.name,tables:k.map(function(j){return m.objectStore(j)}).map(function(j){var q=j.keyPath,K=j.autoIncrement,N=f(q),L={},N={name:j.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:q==null,compound:N,keyPath:q,autoIncrement:K,unique:!0,extractKey:Ka(q)},indexes:Kl(j.indexNames).map(function(Q){return j.index(Q)}).map(function(ve){var ye=ve.name,G=ve.unique,oe=ve.multiEntry,ve=ve.keyPath,ye={name:ye,compound:f(ve),keyPath:ve,unique:G,multiEntry:oe,extractKey:Ka(ve)};return L[mr(ve)]=ye}),getIndexByKeyPath:function(Q){return L[mr(Q)]}};return L[":id"]=N.primaryKey,q!=null&&(L[mr(q)]=N.primaryKey),N})},hasGetAll:0<k.length&&"getAll"in D&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in D},k=g.schema,I=g.hasGetAll,W=g.hasIdb3Features,D=k.tables.map(p),M={};return D.forEach(function(j){return M[j.name]=j}),{stack:"dbcore",transaction:s.transaction.bind(s),table:function(j){if(M[j])return M[j];throw new Error("Table '".concat(j,"' not found"))},MIN_KEY:-1/0,MAX_KEY:vr(a),schema:k}}function Wd(s,a,u,d){return u=u.IDBKeyRange,a=Hd(a,u,d),{dbcore:s.dbcore.reduce(function(p,m){return m=m.create,r(r({},p),m(p))},a)}}function fo(s,a){var u=a.db,u=Wd(s._middlewares,u,s._deps,a);s.core=u.dbcore,s.tables.forEach(function(d){var p=d.name;s.core.schema.tables.some(function(m){return m.name===p})&&(d.core=s.core.table(p),s[p]instanceof s.Table)&&(s[p].core=d.core)})}function po(s,a,u,d){u.forEach(function(p){var m=d[p];a.forEach(function(g){var k=function I(W,D){return se(W,D)||(W=y(W))&&I(W,D)}(g,p);(!k||"value"in k&&k.value===void 0)&&(g===s.Transaction.prototype||g instanceof s.Transaction?B(g,p,{get:function(){return this.table(p)},set:function(I){O(this,p,{value:I,writable:!0,configurable:!0,enumerable:!0})}}):g[p]=new s.Table(p,m))})})}function Ra(s,a){a.forEach(function(u){for(var d in u)u[d]instanceof s.Table&&delete u[d]})}function zd(s,a){return s._cfg.version-a._cfg.version}function Gd(s,a,u,d){var p=s._dbSchema,m=(u.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=La("$meta",Nl("")[0],[]),s._storeNames.push("$meta")),s._createTransaction("readwrite",s._storeNames,p)),g=(m.create(u),m._completion.catch(d),m._reject.bind(m)),k=ze.transless||ze;Gn(function(){if(ze.trans=m,ze.transless=k,a!==0)return fo(s,u),W=a,((I=m).storeNames.includes("$meta")?I.table("$meta").get("version").then(function(D){return D??W}):Le.resolve(W)).then(function(N){var M=s,j=N,q=m,K=u,L=[],N=M._versions,Q=M._dbSchema=mo(0,M.idbdb,K);return(N=N.filter(function(G){return G._cfg.version>=j})).length===0?Le.resolve():(N.forEach(function(G){L.push(function(){var oe,ve,ye,$e=Q,be=G._cfg.dbschema,Be=(ho(M,$e,K),ho(M,be,K),Q=M._dbSchema=be,Na($e,be)),Ce=(Be.add.forEach(function(qe){Fa(K,qe[0],qe[1].primKey,qe[1].indexes)}),Be.change.forEach(function(qe){if(qe.recreate)throw new Ve.Upgrade("Not yet support for changing primary key");var he=K.objectStore(qe.name);qe.add.forEach(function(Qe){return vo(he,Qe)}),qe.change.forEach(function(Qe){he.deleteIndex(Qe.name),vo(he,Qe)}),qe.del.forEach(function(Qe){return he.deleteIndex(Qe)})}),G._cfg.contentUpgrade);if(Ce&&G._cfg.version>j)return fo(M,K),q._memoizedTables={},oe=ne(be),Be.del.forEach(function(qe){oe[qe]=$e[qe]}),Ra(M,[M.Transaction.prototype]),po(M,[M.Transaction.prototype],c(oe),oe),q.schema=oe,(ve=Xe(Ce))&&Bs(),be=Le.follow(function(){var qe;(ye=Ce(q))&&ve&&(qe=Yn.bind(null,null),ye.then(qe,qe))}),ye&&typeof ye.then=="function"?Le.resolve(ye):be.then(function(){return ye})}),L.push(function(oe){var ve,ye,$e=G._cfg.dbschema;ve=$e,ye=oe,[].slice.call(ye.db.objectStoreNames).forEach(function(be){return ve[be]==null&&ye.db.deleteObjectStore(be)}),Ra(M,[M.Transaction.prototype]),po(M,[M.Transaction.prototype],M._storeNames,M._dbSchema),q.schema=M._dbSchema}),L.push(function(oe){M.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(M.idbdb.version/10)===G._cfg.version?(M.idbdb.deleteObjectStore("$meta"),delete M._dbSchema.$meta,M._storeNames=M._storeNames.filter(function(ve){return ve!=="$meta"})):oe.objectStore("$meta").put(G._cfg.version,"version"))})}),function G(){return L.length?Le.resolve(L.shift()(q.idbtrans)).then(G):Le.resolve()}().then(function(){Rl(Q,K)}))}).catch(g);var I,W;c(p).forEach(function(D){Fa(u,D,p[D].primKey,p[D].indexes)}),fo(s,u),Le.follow(function(){return s.on.populate.fire(m)}).catch(g)})}function Yd(s,a){Rl(s._dbSchema,a),a.db.version%10!=0||a.objectStoreNames.contains("$meta")||a.db.createObjectStore("$meta").add(Math.ceil(a.db.version/10-1),"version");var u=mo(0,s.idbdb,a);ho(s,s._dbSchema,a);for(var d=0,p=Na(u,s._dbSchema).change;d<p.length;d++){var m=(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 k=a.objectStore(g.name);g.add.forEach(function(I){le&&console.debug("Dexie upgrade patch: Creating missing index ".concat(g.name,".").concat(I.src)),vo(k,I)})})(p[d]);if(typeof m=="object")return m.value}}function Na(s,a){var u,d={del:[],add:[],change:[]};for(u in s)a[u]||d.del.push(u);for(u in a){var p=s[u],m=a[u];if(p){var g={name:u,def:m,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(m.primKey.keyPath||"")||p.primKey.auto!==m.primKey.auto)g.recreate=!0,d.change.push(g);else{var k=p.idxByName,I=m.idxByName,W=void 0;for(W in k)I[W]||g.del.push(W);for(W in I){var D=k[W],M=I[W];D?D.src!==M.src&&g.change.push(M):g.add.push(M)}(0<g.del.length||0<g.add.length||0<g.change.length)&&d.change.push(g)}}else d.add.push([u,m])}return d}function Fa(s,a,u,d){var p=s.db.createObjectStore(a,u.keyPath?{keyPath:u.keyPath,autoIncrement:u.auto}:{autoIncrement:u.auto});d.forEach(function(m){return vo(p,m)})}function Rl(s,a){c(s).forEach(function(u){a.db.objectStoreNames.contains(u)||(le&&console.debug("Dexie: Creating missing table",u),Fa(a,u,s[u].primKey,s[u].indexes))})}function vo(s,a){s.createIndex(a.name,a.keyPath,{unique:a.unique,multiEntry:a.multi})}function mo(s,a,u){var d={};return re(a.objectStoreNames,0).forEach(function(p){for(var m=u.objectStore(p),g=Da(Ll(W=m.keyPath),W||"",!0,!1,!!m.autoIncrement,W&&typeof W!="string",!0),k=[],I=0;I<m.indexNames.length;++I){var D=m.index(m.indexNames[I]),W=D.keyPath,D=Da(D.name,W,!!D.unique,!!D.multiEntry,!1,W&&typeof W!="string",!1);k.push(D)}d[p]=La(p,g,k)}),d}function ho(s,a,u){for(var d=u.db.objectStoreNames,p=0;p<d.length;++p){var m=d[p],g=u.objectStore(m);s._hasGetAll="getAll"in g;for(var k=0;k<g.indexNames.length;++k){var I,W=g.indexNames[k],D=g.index(W).keyPath,D=typeof D=="string"?D:"["+re(D).join("+")+"]";a[m]&&(I=a[m].idxByName[D])&&(I.name=W,delete a[m].idxByName[D],a[m].idxByName[W]=I)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(s._hasGetAll=!1)}function Nl(s){return s.split(",").map(function(a,u){var p=a.split(":"),d=(d=p[1])==null?void 0:d.trim(),p=(a=p[0].trim()).replace(/([&*]|\+\+)/g,""),m=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return Da(p,m||null,/\&/.test(a),/\*/.test(a),/\+\+/.test(a),f(m),u===0,d)})}Hs.prototype._createTableSchema=La,Hs.prototype._parseIndexSyntax=Nl,Hs.prototype._parseStoresSpec=function(s,a){var u=this;c(s).forEach(function(d){if(s[d]!==null){var p=u._parseIndexSyntax(s[d]),m=p.shift();if(!m)throw new Ve.Schema("Invalid schema for table "+d+": "+s[d]);if(m.unique=!0,m.multi)throw new Ve.Schema("Primary key cannot be multiEntry*");p.forEach(function(g){if(g.auto)throw new Ve.Schema("Only primary key can be marked as autoIncrement (++)");if(!g.keyPath)throw new Ve.Schema("Index must have a name and cannot be an empty string")}),m=u._createTableSchema(d,m,p),a[d]=m}})},Hs.prototype.stores=function(u){var a=this.db,u=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,u):u,a._versions),d={},p={};return u.forEach(function(m){v(d,m._cfg.storesSource),p=m._cfg.dbschema={},m._parseStoresSpec(d,p)}),a._dbSchema=p,Ra(a,[a._allTables,a,a.Transaction.prototype]),po(a,[a._allTables,a,a.Transaction.prototype,this._cfg.tables],c(p),p),a._storeNames=c(p),this},Hs.prototype.upgrade=function(s){return this._cfg.contentUpgrade=ce(this._cfg.contentUpgrade||_,s),this};var Jd=Hs;function Hs(){}var hr=(()=>{var s,a,u;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(s=new Set,a=new FinalizationRegistry(function(d){s.delete(d)}),{toArray:function(){return Array.from(s).map(function(d){return d.deref()}).filter(function(d){return d!==void 0})},add:function(d){var p=new WeakRef(d._novip);s.add(p),a.register(d._novip,p,p),s.size>d._options.maxConnections&&(p=s.values().next().value,s.delete(p),a.unregister(p))},remove:function(d){if(d)for(var p=s.values(),m=p.next();!m.done;){var g=m.value;if(g.deref()===d._novip)return s.delete(g),void a.unregister(g);m=p.next()}}}):(u=[],{toArray:function(){return u},add:function(d){u.push(d._novip)},remove:function(d){d&&(d=u.indexOf(d._novip))!==-1&&u.splice(d,1)}})})();function Va(s,a){var u=s._dbNamesDB;return u||(u=s._dbNamesDB=new Ln(ro,{addons:[],indexedDB:s,IDBKeyRange:a})).version(1).stores({dbnames:"name"}),u.table("dbnames")}function Ba(s){return s&&typeof s.databases=="function"}function Ua(s){return Gn(function(){return ze.letThrough=!0,s()})}function qa(s){return!("from"in s)}var qt=function(s,a){var u;if(!this)return u=new qt,s&&"d"in s&&v(u,s),u;v(this,arguments.length?{d:1,from:s,to:1<arguments.length?a:s}:{d:0})};function yr(s,a,u){var d=ut(a,u);if(!isNaN(d)){if(0<d)throw RangeError();if(qa(s))return v(s,{from:a,to:u,d:1});var d=s.l,p=s.r;if(ut(u,s.from)<0)return d?yr(d,a,u):s.l={from:a,to:u,d:1,l:null,r:null},Vl(s);if(0<ut(a,s.to))return p?yr(p,a,u):s.r={from:a,to:u,d:1,l:null,r:null},Vl(s);ut(a,s.from)<0&&(s.from=a,s.l=null,s.d=p?p.d+1:1),0<ut(u,s.to)&&(s.to=u,s.r=null,s.d=s.l?s.l.d+1:1),a=!s.r,d&&!s.l&&gr(s,d),p&&a&&gr(s,p)}}function gr(s,a){qa(a)||function u(d,p){var m=p.from,g=p.l,k=p.r;yr(d,m,p.to),g&&u(d,g),k&&u(d,k)}(s,a)}function Fl(s,a){var u=yo(a),d=u.next();if(!d.done)for(var p=d.value,m=yo(s),g=m.next(p.from),k=g.value;!d.done&&!g.done;){if(ut(k.from,p.to)<=0&&0<=ut(k.to,p.from))return!0;ut(p.from,k.from)<0?p=(d=u.next(k.from)).value:k=(g=m.next(p.from)).value}return!1}function yo(s){var a=qa(s)?null:{s:0,n:s};return{next:function(u){for(var d=0<arguments.length;a;)switch(a.s){case 0:if(a.s=1,d)for(;a.n.l&&ut(u,a.n.from)<0;)a={up:a,n:a.n.l,s:1};else for(;a.n.l;)a={up:a,n:a.n.l,s:1};case 1:if(a.s=2,!d||ut(u,a.n.to)<=0)return{value:a.n,done:!1};case 2:if(a.n.r){a.s=3,a={up:a,n:a.n.r,s:0};continue}case 3:a=a.up}return{done:!0}}}}function Vl(s){var a,u,d,p=(((p=s.r)==null?void 0:p.d)||0)-(((p=s.l)==null?void 0:p.d)||0),p=1<p?"r":p<-1?"l":"";p&&(a=p=="r"?"l":"r",u=r({},s),d=s[p],s.from=d.from,s.to=d.to,s[p]=d[p],u[p]=d[a],(s[a]=u).d=Bl(u)),s.d=Bl(s)}function Bl(u){var a=u.r,u=u.l;return(a?u?Math.max(a.d,u.d):a.d:u?u.d:0)+1}function go(s,a){return c(a).forEach(function(u){s[u]?gr(s[u],a[u]):s[u]=function d(p){var m,g,k={};for(m in p)w(p,m)&&(g=p[m],k[m]=!g||typeof g!="object"||F.has(g.constructor)?g:d(g));return k}(a[u])}),s}function Ha(s,a){return s.all||a.all||Object.keys(s).some(function(u){return a[u]&&Fl(a[u],s[u])})}C(qt.prototype,((Ue={add:function(s){return gr(this,s),this},addKey:function(s){return yr(this,s,s),this},addKeys:function(s){var a=this;return s.forEach(function(u){return yr(a,u,u)}),this},hasKey:function(s){var a=yo(this).next(s).value;return a&&ut(a.from,s)<=0&&0<=ut(a.to,s)}})[Re]=function(){return yo(this)},Ue));var ws={},Wa={},za=!1;function bo(s){go(Wa,s),za||(za=!0,setTimeout(function(){za=!1,Ga(Wa,!(Wa={}))},0))}function Ga(s,a){a===void 0&&(a=!1);var u=new Set;if(s.all)for(var d=0,p=Object.values(ws);d<p.length;d++)Ul(k=p[d],s,u,a);else for(var m in s){var g,k,m=/^idb\:\/\/(.*)\/(.*)\//.exec(m);m&&(g=m[1],m=m[2],k=ws["idb://".concat(g,"/").concat(m)])&&Ul(k,s,u,a)}u.forEach(function(I){return I()})}function Ul(s,a,u,d){for(var p=[],m=0,g=Object.entries(s.queries.query);m<g.length;m++){for(var k=g[m],I=k[0],W=[],D=0,M=k[1];D<M.length;D++){var j=M[D];Ha(a,j.obsSet)?j.subscribers.forEach(function(N){return u.add(N)}):d&&W.push(j)}d&&p.push([I,W])}if(d)for(var q=0,K=p;q<K.length;q++){var L=K[q],I=L[0],W=L[1];s.queries.query[I]=W}}function Xd(s){var a=s._state,u=s._deps.indexedDB;if(a.isBeingOpened||s.idbdb)return a.dbReadyPromise.then(function(){return a.dbOpenError?Ot(a.dbOpenError):s});a.isBeingOpened=!0,a.dbOpenError=null,a.openComplete=!1;var d=a.openCanceller,p=Math.round(10*s.verno),m=!1;function g(){if(a.openCanceller!==d)throw new Ve.DatabaseClosed("db.open() was cancelled")}function k(){return new Le(function(j,q){if(g(),!u)throw new Ve.MissingAPI;var K=s.name,L=a.autoSchema||!p?u.open(K):u.open(K,p);if(!L)throw new Ve.MissingAPI;L.onerror=mn(q),L.onblocked=$t(s._fireOnBlocked),L.onupgradeneeded=$t(function(N){var Q;D=L.transaction,a.autoSchema&&!s._options.allowEmptyDB?(L.onerror=pr,D.abort(),L.result.close(),(Q=u.deleteDatabase(K)).onsuccess=Q.onerror=$t(function(){q(new Ve.NoSuchDatabase("Database ".concat(K," doesnt exist")))})):(D.onerror=mn(q),Q=N.oldVersion>Math.pow(2,62)?0:N.oldVersion,M=Q<1,s.idbdb=L.result,m&&Yd(s,D),Gd(s,Q/10,D,q))},q),L.onsuccess=$t(function(){D=null;var N,Q,G,oe,ve,ye,$e=s.idbdb=L.result,be=re($e.objectStoreNames);if(0<be.length)try{var Be=$e.transaction((ve=be).length===1?ve[0]:ve,"readonly");if(a.autoSchema)ye=$e,oe=Be,(G=s).verno=ye.version/10,oe=G._dbSchema=mo(0,ye,oe),G._storeNames=re(ye.objectStoreNames,0),po(G,[G._allTables],c(oe),oe);else if(ho(s,s._dbSchema,Be),Q=Be,((Q=Na(mo(0,(N=s).idbdb,Q),N._dbSchema)).add.length||Q.change.some(function(Ce){return Ce.add.length||Ce.change.length}))&&!m)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,m=!0,j(k());fo(s,Be)}catch{}hr.add(s),$e.onversionchange=$t(function(Ce){a.vcFired=!0,s.on("versionchange").fire(Ce)}),$e.onclose=$t(function(){s.close({disableAutoOpen:!1})}),M&&(be=s._deps,ve=K,Ba(ye=be.indexedDB)||ve===ro||Va(ye,be.IDBKeyRange).put({name:ve}).catch(_)),j()},q)}).catch(function(j){switch(j==null?void 0:j.name){case"UnknownError":if(0<a.PR1398_maxLoop)return a.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),k();break;case"VersionError":if(0<p)return p=0,k()}return Le.reject(j)})}var I,W=a.dbReadyResolve,D=null,M=!1;return Le.race([d,(typeof navigator>"u"?Le.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(j){function q(){return indexedDB.databases().finally(j)}I=setInterval(q,100),q()}).finally(function(){return clearInterval(I)}):Promise.resolve()).then(k)]).then(function(){return g(),a.onReadyBeingFired=[],Le.resolve(Ua(function(){return s.on.ready.fire(s.vip)})).then(function j(){var q;if(0<a.onReadyBeingFired.length)return q=a.onReadyBeingFired.reduce(ce,_),a.onReadyBeingFired=[],Le.resolve(Ua(function(){return q(s.vip)})).then(j)})}).finally(function(){a.openCanceller===d&&(a.onReadyBeingFired=null,a.isBeingOpened=!1)}).catch(function(j){a.dbOpenError=j;try{D&&D.abort()}catch{}return d===a.openCanceller&&s._close(),Ot(j)}).finally(function(){a.openComplete=!0,W()}).then(function(){var j;return M&&(j={},s.tables.forEach(function(q){q.schema.indexes.forEach(function(K){K.name&&(j["idb://".concat(s.name,"/").concat(q.name,"/").concat(K.name)]=new qt(-1/0,[[[]]]))}),j["idb://".concat(s.name,"/").concat(q.name,"/")]=j["idb://".concat(s.name,"/").concat(q.name,"/:dels")]=new qt(-1/0,[[[]]])}),Qn(co).fire(j),Ga(j,!0)),s})}function Ya(s){function a(m){return s.next(m)}var u=p(a),d=p(function(m){return s.throw(m)});function p(m){return function(k){var k=m(k),I=k.value;return k.done?I:I&&typeof I.then=="function"?I.then(u,d):f(I)?Promise.all(I).then(u,d):u(I)}}return p(a)()}function wo(s,a,u){for(var d=f(s)?s.slice():[s],p=0;p<u;++p)d.push(a);return d}var Qd={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(s){return r(r({},s),{table:function(d){var u=s.table(d),d=u.schema,p=Object.create(null),m=[];function g(j,q,K){var G=mr(j),L=p[G]=p[G]||[],N=j==null?0:typeof j=="string"?1:j.length,Q=0<q,G=r(r({},K),{name:Q?"".concat(G,"(virtual-from:").concat(K.name,")"):K.name,lowLevelIndex:K,isVirtual:Q,keyTail:q,keyLength:N,extractKey:Ka(j),unique:!Q&&K.unique});return L.push(G),G.isPrimaryKey||m.push(G),1<N&&g(N===2?j[0]:j.slice(0,N-1),q+1,K),L.sort(function(oe,ve){return oe.keyTail-ve.keyTail}),G}var k=g(d.primaryKey.keyPath,0,d.primaryKey);p[":id"]=[k];for(var I=0,W=d.indexes;I<W.length;I++){var D=W[I];g(D.keyPath,0,D)}function M(j){var q,K=j.query.index;return K.isVirtual?r(r({},j),{query:{index:K.lowLevelIndex,range:(q=j.query.range,K=K.keyTail,{type:q.type===1?2:q.type,lower:wo(q.lower,q.lowerOpen?s.MAX_KEY:s.MIN_KEY,K),lowerOpen:!0,upper:wo(q.upper,q.upperOpen?s.MIN_KEY:s.MAX_KEY,K),upperOpen:!0})}}):j}return r(r({},u),{schema:r(r({},d),{primaryKey:k,indexes:m,getIndexByKeyPath:function(j){return(j=p[mr(j)])&&j[0]}}),count:function(j){return u.count(M(j))},query:function(j){return u.query(M(j))},openCursor:function(j){var q=j.query.index,K=q.keyTail,L=q.keyLength;return q.isVirtual?u.openCursor(M(j)).then(function(Q){return Q&&N(Q)}):u.openCursor(j);function N(Q){return Object.create(Q,{continue:{value:function(G){G!=null?Q.continue(wo(G,j.reverse?s.MAX_KEY:s.MIN_KEY,K)):j.unique?Q.continue(Q.key.slice(0,L).concat(j.reverse?s.MIN_KEY:s.MAX_KEY,K)):Q.continue()}},continuePrimaryKey:{value:function(G,oe){Q.continuePrimaryKey(wo(G,s.MAX_KEY,K),oe)}},primaryKey:{get:function(){return Q.primaryKey}},key:{get:function(){var G=Q.key;return L===1?G[0]:G.slice(0,L)}},value:{get:function(){return Q.value}}})}}})}})}};function Ja(s,a,u,d){return u=u||{},d=d||"",c(s).forEach(function(p){var m,g,k;w(a,p)?(m=s[p],g=a[p],typeof m=="object"&&typeof g=="object"&&m&&g?(k=ke(m))!==ke(g)?u[d+p]=a[p]:k==="Object"?Ja(m,g,u,d+p+"."):m!==g&&(u[d+p]=a[p]):m!==g&&(u[d+p]=a[p])):u[d+p]=void 0}),c(a).forEach(function(p){w(s,p)||(u[d+p]=a[p])}),u}function Xa(s,a){return a.type==="delete"?a.keys:a.keys||a.values.map(s.extractKey)}var Zd={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(s){return r(r({},s),{table:function(a){var u=s.table(a),d=u.schema.primaryKey;return r(r({},u),{mutate:function(p){var m=ze.trans,g=m.table(a).hook,k=g.deleting,I=g.creating,W=g.updating;switch(p.type){case"add":if(I.fire===_)break;return m._promise("readwrite",function(){return D(p)},!0);case"put":if(I.fire===_&&W.fire===_)break;return m._promise("readwrite",function(){return D(p)},!0);case"delete":if(k.fire===_)break;return m._promise("readwrite",function(){return D(p)},!0);case"deleteRange":if(k.fire===_)break;return m._promise("readwrite",function(){return function M(j,q,K){return u.query({trans:j,values:!1,query:{index:d,range:q},limit:K}).then(function(L){var N=L.result;return D({type:"delete",keys:N,trans:j}).then(function(Q){return 0<Q.numFailures?Promise.reject(Q.failures[0]):N.length<K?{failures:[],numFailures:0,lastResult:void 0}:M(j,r(r({},q),{lower:N[N.length-1],lowerOpen:!0}),K)})})}(p.trans,p.range,1e4)},!0)}return u.mutate(p);function D(M){var j,q,K,L=ze.trans,N=M.keys||Xa(d,M);if(N)return(M=M.type==="add"||M.type==="put"?r(r({},M),{keys:N}):r({},M)).type!=="delete"&&(M.values=o([],M.values)),M.keys&&(M.keys=o([],M.keys)),j=u,K=N,((q=M).type==="add"?Promise.resolve([]):j.getMany({trans:q.trans,keys:K,cache:"immutable"})).then(function(Q){var G=N.map(function(oe,ve){var ye,$e,be,Be=Q[ve],Ce={onerror:null,onsuccess:null};return M.type==="delete"?k.fire.call(Ce,oe,Be,L):M.type==="add"||Be===void 0?(ye=I.fire.call(Ce,oe,M.values[ve],L),oe==null&&ye!=null&&(M.keys[ve]=oe=ye,d.outbound||Y(M.values[ve],d.keyPath,oe))):(ye=Ja(Be,M.values[ve]),($e=W.fire.call(Ce,ye,oe,Be,L))&&(be=M.values[ve],Object.keys($e).forEach(function(qe){w(be,qe)?be[qe]=$e[qe]:Y(be,qe,$e[qe])}))),Ce});return u.mutate(M).then(function(oe){for(var ve=oe.failures,ye=oe.results,$e=oe.numFailures,oe=oe.lastResult,be=0;be<N.length;++be){var Be=(ye||N)[be],Ce=G[be];Be==null?Ce.onerror&&Ce.onerror(ve[be]):Ce.onsuccess&&Ce.onsuccess(M.type==="put"&&Q[be]?M.values[be]:Be)}return{failures:ve,results:ye,numFailures:$e,lastResult:oe}}).catch(function(oe){return G.forEach(function(ve){return ve.onerror&&ve.onerror(oe)}),Promise.reject(oe)})});throw new Error("Keys missing")}}})}})}};function ql(s,a,u){try{if(!a||a.keys.length<s.length)return null;for(var d=[],p=0,m=0;p<a.keys.length&&m<s.length;++p)ut(a.keys[p],s[m])===0&&(d.push(u?Ie(a.values[p]):a.values[p]),++m);return d.length===s.length?d:null}catch{return null}}var ef={stack:"dbcore",level:-1,create:function(s){return{table:function(a){var u=s.table(a);return r(r({},u),{getMany:function(d){var p;return d.cache?(p=ql(d.keys,d.trans._cache,d.cache==="clone"))?Le.resolve(p):u.getMany(d).then(function(m){return d.trans._cache={keys:d.keys,values:d.cache==="clone"?Ie(m):m},m}):u.getMany(d)},mutate:function(d){return d.type!=="add"&&(d.trans._cache=null),u.mutate(d)}})}}}};function Hl(s,a){return s.trans.mode==="readonly"&&!!s.subscr&&!s.trans.explicit&&s.trans.db._options.cache!=="disabled"&&!a.schema.primaryKey.outbound}function Wl(s,a){switch(s){case"query":return a.values&&!a.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var tf={stack:"dbcore",level:0,name:"Observability",create:function(s){var a=s.schema.name,u=new qt(s.MIN_KEY,s.MAX_KEY);return r(r({},s),{transaction:function(d,p,m){if(ze.subscr&&p!=="readonly")throw new Ve.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ze.querier));return s.transaction(d,p,m)},table:function(d){function p(N){var L,N=N.query;return[L=N.index,new qt((L=(N=N.range).lower)!=null?L:s.MIN_KEY,(L=N.upper)!=null?L:s.MAX_KEY)]}var m=s.table(d),g=m.schema,k=g.primaryKey,I=g.indexes,W=k.extractKey,D=k.outbound,M=k.autoIncrement&&I.filter(function(K){return K.compound&&K.keyPath.includes(k.keyPath)}),j=r(r({},m),{mutate:function(K){function L(he){return he="idb://".concat(a,"/").concat(d,"/").concat(he),ve[he]||(ve[he]=new qt)}var N,Q,G,oe=K.trans,ve=K.mutatedParts||(K.mutatedParts={}),ye=L(""),$e=L(":dels"),be=K.type,Ce=K.type==="deleteRange"?[K.range]:K.type==="delete"?[K.keys]:K.values.length<50?[Xa(k,K).filter(function(he){return he}),K.values]:[],Be=Ce[0],Ce=Ce[1],qe=K.trans._cache;return f(Be)?(ye.addKeys(Be),(be=be==="delete"||Be.length===Ce.length?ql(Be,qe):null)||$e.addKeys(Be),(be||Ce)&&(N=L,Q=be,G=Ce,g.indexes.forEach(function(he){var Qe=N(he.name||"");function Ze(lt){return lt!=null?he.extractKey(lt):null}function ot(lt){he.multiEntry&&f(lt)?lt.forEach(function(sn){return Qe.addKey(sn)}):Qe.addKey(lt)}(Q||G).forEach(function(lt,Ht){var nt=Q&&Ze(Q[Ht]),Ht=G&&Ze(G[Ht]);ut(nt,Ht)!==0&&(nt!=null&&ot(nt),Ht!=null)&&ot(Ht)})}))):Be?(Ce={from:(qe=Be.lower)!=null?qe:s.MIN_KEY,to:(be=Be.upper)!=null?be:s.MAX_KEY},$e.add(Ce),ye.add(Ce)):(ye.add(u),$e.add(u),g.indexes.forEach(function(he){return L(he.name).add(u)})),m.mutate(K).then(function(he){return!Be||K.type!=="add"&&K.type!=="put"||(ye.addKeys(he.results),M&&M.forEach(function(Qe){for(var Ze=K.values.map(function(nt){return Qe.extractKey(nt)}),ot=Qe.keyPath.findIndex(function(nt){return nt===k.keyPath}),lt=0,sn=he.results.length;lt<sn;++lt)Ze[lt][ot]=he.results[lt];L(Qe.name).addKeys(Ze)})),oe.mutatedParts=go(oe.mutatedParts||{},ve),he})}}),q={get:function(K){return[k,new qt(K.key)]},getMany:function(K){return[k,new qt().addKeys(K.keys)]},count:p,query:p,openCursor:p};return c(q).forEach(function(K){j[K]=function(L){var N=ze.subscr,Q=!!N,G=Hl(ze,m)&&Wl(K,L)?L.obsSet={}:N;if(Q){var oe,N=function(Ce){return Ce="idb://".concat(a,"/").concat(d,"/").concat(Ce),G[Ce]||(G[Ce]=new qt)},ve=N(""),ye=N(":dels"),Q=q[K](L),$e=Q[0],Q=Q[1];if((K==="query"&&$e.isPrimaryKey&&!L.values?ye:N($e.name||"")).add(Q),!$e.isPrimaryKey){if(K!=="count")return oe=K==="query"&&D&&L.values&&m.query(r(r({},L),{values:!1})),m[K].apply(this,arguments).then(function(Ce){if(K==="query"){if(D&&L.values)return oe.then(function(Ze){return Ze=Ze.result,ve.addKeys(Ze),Ce});var qe=L.values?Ce.result.map(W):Ce.result;(L.values?ve:ye).addKeys(qe)}else{var he,Qe;if(K==="openCursor")return Qe=L.values,(he=Ce)&&Object.create(he,{key:{get:function(){return ye.addKey(he.primaryKey),he.key}},primaryKey:{get:function(){var Ze=he.primaryKey;return ye.addKey(Ze),Ze}},value:{get:function(){return Qe&&ve.addKey(he.primaryKey),he.value}}})}return Ce});ye.add(u)}}return m[K].apply(this,arguments)}}),j}})}};function zl(s,a,u){var d;return u.numFailures===0?a:a.type==="deleteRange"||(d=a.keys?a.keys.length:"values"in a&&a.values?a.values.length:1,u.numFailures===d)?null:(d=r({},a),f(d.keys)&&(d.keys=d.keys.filter(function(p,m){return!(m in u.failures)})),"values"in d&&f(d.values)&&(d.values=d.values.filter(function(p,m){return!(m in u.failures)})),d)}function Qa(s,a){return u=s,((d=a).lower===void 0||(d.lowerOpen?0<ut(u,d.lower):0<=ut(u,d.lower)))&&(u=s,(d=a).upper===void 0||(d.upperOpen?ut(u,d.upper)<0:ut(u,d.upper)<=0));var u,d}function Gl(s,a,u,d,p,m){var g,k,I,W,D,M,j;return!u||u.length===0||(g=a.query.index,k=g.multiEntry,I=a.query.range,W=d.schema.primaryKey.extractKey,D=g.extractKey,M=(g.lowLevelIndex||g).extractKey,(d=u.reduce(function(q,K){var L=q,N=[];if(K.type==="add"||K.type==="put")for(var Q=new qt,G=K.values.length-1;0<=G;--G){var oe,ve=K.values[G],ye=W(ve);!Q.hasKey(ye)&&(oe=D(ve),k&&f(oe)?oe.some(function(qe){return Qa(qe,I)}):Qa(oe,I))&&(Q.addKey(ye),N.push(ve))}switch(K.type){case"add":var $e=new qt().addKeys(a.values?q.map(function(he){return W(he)}):q),L=q.concat(a.values?N.filter(function(he){return he=W(he),!$e.hasKey(he)&&($e.addKey(he),!0)}):N.map(function(he){return W(he)}).filter(function(he){return!$e.hasKey(he)&&($e.addKey(he),!0)}));break;case"put":var be=new qt().addKeys(K.values.map(function(he){return W(he)}));L=q.filter(function(he){return!be.hasKey(a.values?W(he):he)}).concat(a.values?N:N.map(function(he){return W(he)}));break;case"delete":var Be=new qt().addKeys(K.keys);L=q.filter(function(he){return!Be.hasKey(a.values?W(he):he)});break;case"deleteRange":var Ce=K.range;L=q.filter(function(he){return!Qa(W(he),Ce)})}return L},s))===s)?s:(j=function(q,K){return ut(M(q),M(K))||ut(W(q),W(K))},d.sort(a.direction==="prev"||a.direction==="prevunique"?function(q,K){return j(K,q)}:j),a.limit&&a.limit<1/0&&(d.length>a.limit?d.length=a.limit:s.length===a.limit&&d.length<a.limit&&(p.dirty=!0)),m?Object.freeze(d):d)}function Yl(s,a){return ut(s.lower,a.lower)===0&&ut(s.upper,a.upper)===0&&!!s.lowerOpen==!!a.lowerOpen&&!!s.upperOpen==!!a.upperOpen}function nf(s,a){return((u,d,p,m)=>{if(u===void 0)return d!==void 0?-1:0;if(d===void 0)return 1;if((u=ut(u,d))===0){if(p&&m)return 0;if(p)return 1;if(m)return-1}return u})(s.lower,a.lower,s.lowerOpen,a.lowerOpen)<=0&&0<=((u,d,p,m)=>{if(u===void 0)return d!==void 0?1:0;if(d===void 0)return-1;if((u=ut(u,d))===0){if(p&&m)return 0;if(p)return-1;if(m)return 1}return u})(s.upper,a.upper,s.upperOpen,a.upperOpen)}function sf(s,a,u,d){s.subscribers.add(u),d.addEventListener("abort",function(){var p,m;s.subscribers.delete(u),s.subscribers.size===0&&(p=s,m=a,setTimeout(function(){p.subscribers.size===0&&me(m,p)},3e3))})}var rf={stack:"dbcore",level:0,name:"Cache",create:function(s){var a=s.schema.name;return r(r({},s),{transaction:function(u,d,p){var m,g,k=s.transaction(u,d,p);return d==="readwrite"&&(p=(m=new AbortController).signal,k.addEventListener("abort",(g=function(I){return function(){if(m.abort(),d==="readwrite"){for(var W=new Set,D=0,M=u;D<M.length;D++){var j=M[D],q=ws["idb://".concat(a,"/").concat(j)];if(q){var K=s.table(j),L=q.optimisticOps.filter(function(he){return he.trans===k});if(k._explicit&&I&&k.mutatedParts)for(var N=0,Q=Object.values(q.queries.query);N<Q.length;N++)for(var G=0,oe=($e=Q[N]).slice();G<oe.length;G++)Ha((be=oe[G]).obsSet,k.mutatedParts)&&(me($e,be),be.subscribers.forEach(function(he){return W.add(he)}));else if(0<L.length){q.optimisticOps=q.optimisticOps.filter(function(he){return he.trans!==k});for(var ve=0,ye=Object.values(q.queries.query);ve<ye.length;ve++)for(var $e,be,Be,Ce=0,qe=($e=ye[ve]).slice();Ce<qe.length;Ce++)(be=qe[Ce]).res!=null&&k.mutatedParts&&(I&&!be.dirty?(Be=Object.isFrozen(be.res),Be=Gl(be.res,be.req,L,K,be,Be),be.dirty?(me($e,be),be.subscribers.forEach(function(he){return W.add(he)})):Be!==be.res&&(be.res=Be,be.promise=Le.resolve({result:Be}))):(be.dirty&&me($e,be),be.subscribers.forEach(function(he){return W.add(he)})))}}}W.forEach(function(he){return he()})}}})(!1),{signal:p}),k.addEventListener("error",g(!1),{signal:p}),k.addEventListener("complete",g(!0),{signal:p})),k},table:function(u){var d=s.table(u),p=d.schema.primaryKey;return r(r({},d),{mutate:function(m){var g,k=ze.trans;return!p.outbound&&k.db._options.cache!=="disabled"&&!k.explicit&&k.idbtrans.mode==="readwrite"&&(g=ws["idb://".concat(a,"/").concat(u)])?(k=d.mutate(m),m.type!=="add"&&m.type!=="put"||!(50<=m.values.length||Xa(p,m).some(function(I){return I==null}))?(g.optimisticOps.push(m),m.mutatedParts&&bo(m.mutatedParts),k.then(function(I){0<I.numFailures&&(me(g.optimisticOps,m),(I=zl(0,m,I))&&g.optimisticOps.push(I),m.mutatedParts)&&bo(m.mutatedParts)}),k.catch(function(){me(g.optimisticOps,m),m.mutatedParts&&bo(m.mutatedParts)})):k.then(function(I){var W=zl(0,r(r({},m),{values:m.values.map(function(D,M){var j;return I.failures[M]?D:(Y(j=(j=p.keyPath)!=null&&j.includes(".")?Ie(D):r({},D),p.keyPath,I.results[M]),j)})}),I);g.optimisticOps.push(W),queueMicrotask(function(){return m.mutatedParts&&bo(m.mutatedParts)})}),k):d.mutate(m)},query:function(m){var g,k,I,W,D,M,j;return Hl(ze,d)&&Wl("query",m)?(g=((I=ze.trans)==null?void 0:I.db._options.cache)==="immutable",k=(I=ze).requery,I=I.signal,M=((q,K,L,N)=>{var Q=ws["idb://".concat(q,"/").concat(K)];if(!Q)return[];if(!(q=Q.queries[L]))return[null,!1,Q,null];var G=q[(N.query?N.query.index.name:null)||""];if(!G)return[null,!1,Q,null];switch(L){case"query":var oe=(ve=N.direction)!=null?ve:"next",ve=G.find(function(ye){var $e;return ye.req.limit===N.limit&&ye.req.values===N.values&&(($e=ye.req.direction)!=null?$e:"next")===oe&&Yl(ye.req.query.range,N.query.range)});return ve?[ve,!0,Q,G]:[G.find(function(ye){var $e;return("limit"in ye.req?ye.req.limit:1/0)>=N.limit&&(($e=ye.req.direction)!=null?$e:"next")===oe&&(!N.values||ye.req.values)&&nf(ye.req.query.range,N.query.range)}),!1,Q,G];case"count":return ve=G.find(function(ye){return Yl(ye.req.query.range,N.query.range)}),[ve,!!ve,Q,G]}})(a,u,"query",m),j=M[0],W=M[2],D=M[3],j&&M[1]?j.obsSet=m.obsSet:(M=d.query(m).then(function(q){var K=q.result;if(j&&(j.res=K),g){for(var L=0,N=K.length;L<N;++L)Object.freeze(K[L]);Object.freeze(K)}return q}).catch(function(q){return D&&j&&me(D,j),Promise.reject(q)}),j={obsSet:m.obsSet,promise:M,subscribers:new Set,type:"query",req:m,dirty:!1},D?D.push(j):(D=[j],(W=W||(ws["idb://".concat(a,"/").concat(u)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[m.query.index.name||""]=D)),sf(j,D,k,I),j.promise.then(function(q){return q=Gl(q.result,m,W==null?void 0:W.optimisticOps,d,j,g),{result:g?q:Ie(q)}})):d.query(m)}})}})}};function _o(s,a){return new Proxy(s,{get:function(u,d,p){return d==="db"?a:Reflect.get(u,d,p)}})}Mt.prototype.version=function(s){if(isNaN(s)||s<.1)throw new Ve.Type("Given version is not a positive number");if(s=Math.round(10*s)/10,this.idbdb||this._state.isBeingOpened)throw new Ve.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,s);var a=this._versions,u=a.filter(function(d){return d._cfg.version===s})[0];return u||(u=new this.Version(s),a.push(u),a.sort(zd),u.stores({}),this._state.autoSchema=!1),u},Mt.prototype._whenReady=function(s){var a=this;return this.idbdb&&(this._state.openComplete||ze.letThrough||this._vip)?s():new Le(function(u,d){if(a._state.openComplete)return d(new Ve.DatabaseClosed(a._state.dbOpenError));if(!a._state.isBeingOpened){if(!a._state.autoOpen)return void d(new Ve.DatabaseClosed);a.open().catch(_)}a._state.dbReadyPromise.then(u,d)}).then(s)},Mt.prototype.use=function(p){var a=p.stack,u=p.create,d=p.level,p=p.name,m=(p&&this.unuse({stack:a,name:p}),this._middlewares[a]||(this._middlewares[a]=[]));return m.push({stack:a,create:u,level:d??10,name:p}),m.sort(function(g,k){return g.level-k.level}),this},Mt.prototype.unuse=function(s){var a=s.stack,u=s.name,d=s.create;return a&&this._middlewares[a]&&(this._middlewares[a]=this._middlewares[a].filter(function(p){return d?p.create!==d:!!u&&p.name!==u})),this},Mt.prototype.open=function(){var s=this;return ys(jt,function(){return Xd(s)})},Mt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var s=this._state;if(hr.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}s.isBeingOpened||(s.dbReadyPromise=new Le(function(a){s.dbReadyResolve=a}),s.openCanceller=new Le(function(a,u){s.cancelOpen=u}))},Mt.prototype.close=function(a){var a=(a===void 0?{disableAutoOpen:!0}:a).disableAutoOpen,u=this._state;a?(u.isBeingOpened&&u.cancelOpen(new Ve.DatabaseClosed),this._close(),u.autoOpen=!1,u.dbOpenError=new Ve.DatabaseClosed):(this._close(),u.autoOpen=this._options.autoOpen||u.isBeingOpened,u.openComplete=!1,u.dbOpenError=null)},Mt.prototype.delete=function(s){var a=this,u=(s===void 0&&(s={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),d=this._state;return new Le(function(p,m){function g(){a.close(s);var k=a._deps.indexedDB.deleteDatabase(a.name);k.onsuccess=$t(function(){var I,W,D;I=a._deps,W=a.name,Ba(D=I.indexedDB)||W===ro||Va(D,I.IDBKeyRange).delete(W).catch(_),p()}),k.onerror=mn(m),k.onblocked=a._fireOnBlocked}if(u)throw new Ve.InvalidArgument("Invalid closeOptions argument to db.delete()");d.isBeingOpened?d.dbReadyPromise.then(g):g()})},Mt.prototype.backendDB=function(){return this.idbdb},Mt.prototype.isOpen=function(){return this.idbdb!==null},Mt.prototype.hasBeenClosed=function(){var s=this._state.dbOpenError;return s&&s.name==="DatabaseClosed"},Mt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Mt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Mt.prototype,"tables",{get:function(){var s=this;return c(this._allTables).map(function(a){return s._allTables[a]})},enumerable:!1,configurable:!0}),Mt.prototype.transaction=function(){var s=(function(a,u,d){var p=arguments.length;if(p<2)throw new Ve.InvalidArgument("Too few arguments");for(var m=new Array(p-1);--p;)m[p-1]=arguments[p];return d=m.pop(),[a,R(m),d]}).apply(this,arguments);return this._transaction.apply(this,s)},Mt.prototype._transaction=function(s,a,u){var d,p,m=this,g=ze.trans,k=(g&&g.db===this&&s.indexOf("!")===-1||(g=null),s.indexOf("?")!==-1);s=s.replace("!","").replace("?","");try{if(p=a.map(function(W){if(W=W instanceof m.Table?W.name:W,typeof W!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return W}),s=="r"||s===Pa)d=Pa;else{if(s!="rw"&&s!=Oa)throw new Ve.InvalidArgument("Invalid transaction mode: "+s);d=Oa}if(g){if(g.mode===Pa&&d===Oa){if(!k)throw new Ve.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");g=null}g&&p.forEach(function(W){if(g&&g.storeNames.indexOf(W)===-1){if(!k)throw new Ve.SubTransaction("Table "+W+" not included in parent transaction.");g=null}}),k&&g&&!g.active&&(g=null)}}catch(W){return g?g._promise(null,function(D,M){M(W)}):Ot(W)}var I=(function W(D,M,j,q,K){return Le.resolve().then(function(){var G=ze.transless||ze,L=D._createTransaction(M,j,D._dbSchema,q),G=(L.explicit=!0,{trans:L,transless:G});if(q)L.idbtrans=q.idbtrans;else try{L.create(),L.idbtrans._explicit=!0,D._state.PR1398_maxLoop=3}catch(oe){return oe.name===De.InvalidState&&D.isOpen()&&0<--D._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),D.close({disableAutoOpen:!1}),D.open().then(function(){return W(D,M,j,null,K)})):Ot(oe)}var N,Q=Xe(K),G=(Q&&Bs(),Le.follow(function(){var oe;(N=K.call(L,L))&&(Q?(oe=Yn.bind(null,null),N.then(oe,oe)):typeof N.next=="function"&&typeof N.throw=="function"&&(N=Ya(N)))},G));return(N&&typeof N.then=="function"?Le.resolve(N).then(function(oe){return L.active?oe:Ot(new Ve.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):G.then(function(){return N})).then(function(oe){return q&&L._resolve(),L._completion.then(function(){return oe})}).catch(function(oe){return L._reject(oe),Ot(oe)})})}).bind(null,this,d,p,g,u);return g?g._promise(d,I,"lock"):ze.trans?ys(ze.transless,function(){return m._whenReady(I)}):this._whenReady(I)},Mt.prototype.table=function(s){if(w(this._allTables,s))return this._allTables[s];throw new Ve.InvalidTable("Table ".concat(s," does not exist"))};var Ln=Mt;function Mt(s,a){var u,d,p,m,g,k=this,I=(this._middlewares={},this.verno=0,Mt.dependencies),I=(this._options=a=r({addons:Mt.addons,autoOpen:!0,indexedDB:I.indexedDB,IDBKeyRange:I.IDBKeyRange,cache:"cloned",maxConnections:1e3},a),this._deps={indexedDB:a.indexedDB,IDBKeyRange:a.IDBKeyRange},a.addons),W=(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:a.autoOpen}),D=(W.dbReadyPromise=new Le(function(M){W.dbReadyResolve=M}),W.openCanceller=new Le(function(M,j){W.cancelOpen=j}),this._state=W,this.name=s,this.on=dr(this,"populate","blocked","versionchange","close",{ready:[ce,_]}),this.once=function(M,j){var q=function(){for(var K=[],L=0;L<arguments.length;L++)K[L]=arguments[L];k.on(M).unsubscribe(q),j.apply(k,K)};return k.on(M,q)},this.on.ready.subscribe=V(this.on.ready.subscribe,function(M){return function(j,q){Mt.vip(function(){var K,L=k._state;L.openComplete?(L.dbOpenError||Le.resolve().then(j),q&&M(j)):L.onReadyBeingFired?(L.onReadyBeingFired.push(j),q&&M(j)):(M(j),K=k,q||M(function N(){K.on.ready.unsubscribe(j),K.on.ready.unsubscribe(N)}))})}}),this.Collection=(u=this,fr(Fd.prototype,function(N,L){this.db=u;var q=Cl,K=null;if(L)try{q=L()}catch(G){K=G}var L=N._ctx,N=L.table,Q=N.hook.reading.fire;this._ctx={table:N,index:L.index,isPrimKey:!L.index||N.schema.primKey.keyPath&&L.index===N.schema.primKey.name,range:q,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:K,or:L.or,valueMapper:Q!==X?Q:null}})),this.Table=(d=this,fr(Pl.prototype,function(M,j,q){this.db=d,this._tx=q,this.name=M,this.schema=j,this.hook=d._allTables[M]?d._allTables[M].hook:dr(null,{creating:[ie,_],reading:[de,X],updating:[Ee,_],deleting:[Se,_]})})),this.Transaction=(p=this,fr(Ud.prototype,function(M,j,q,K,L){var N=this;M!=="readonly"&&j.forEach(function(Q){Q=(Q=q[Q])==null?void 0:Q.yProps,Q&&(j=j.concat(Q.map(function(G){return G.updatesTable})))}),this.db=p,this.mode=M,this.storeNames=j,this.schema=q,this.chromeTransactionDurability=K,this.idbtrans=null,this.on=dr(this,"complete","error","abort"),this.parent=L||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 Le(function(Q,G){N._resolve=Q,N._reject=G}),this._completion.then(function(){N.active=!1,N.on.complete.fire()},function(Q){var G=N.active;return N.active=!1,N.on.error.fire(Q),N.parent?N.parent._reject(Q):G&&N.idbtrans&&N.idbtrans.abort(),Ot(Q)})})),this.Version=(m=this,fr(Jd.prototype,function(M){this.db=m,this._cfg={version:M,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(g=this,fr(Dl.prototype,function(M,j,q){if(this.db=g,this._ctx={table:M,index:j===":id"?null:j,or:q},this._cmp=this._ascending=ut,this._descending=function(K,L){return ut(L,K)},this._max=function(K,L){return 0<ut(K,L)?K:L},this._min=function(K,L){return ut(K,L)<0?K:L},this._IDBKeyRange=g._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ve.MissingAPI})),this.on("versionchange",function(M){0<M.newVersion?console.warn("Another connection wants to upgrade database '".concat(k.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(k.name,"'. Closing db now to resume the delete request.")),k.close({disableAutoOpen:!1})}),this.on("blocked",function(M){!M.newVersion||M.newVersion<M.oldVersion?console.warn("Dexie.delete('".concat(k.name,"') was blocked")):console.warn("Upgrade '".concat(k.name,"' blocked by other connection holding version ").concat(M.oldVersion/10))}),this._maxKey=vr(a.IDBKeyRange),this._createTransaction=function(M,j,q,K){return new k.Transaction(M,j,q,k._options.chromeTransactionDurability,K)},this._fireOnBlocked=function(M){k.on("blocked").fire(M),hr.toArray().filter(function(j){return j.name===k.name&&j!==k&&!j._state.vcFired}).map(function(j){return j.on("versionchange").fire(M)})},this.use(ef),this.use(rf),this.use(tf),this.use(Qd),this.use(Zd),new Proxy(this,{get:function(M,j,q){var K;return j==="_vip"||(j==="table"?function(L){return _o(k.table(L),D)}:(K=Reflect.get(M,j,q))instanceof Pl?_o(K,D):j==="tables"?K.map(function(L){return _o(L,D)}):j==="_createTransaction"?function(){return _o(K.apply(this,arguments),D)}:K)}}));this.vip=D,I.forEach(function(M){return M(k)})}var ko,Ws=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",of=(Za.prototype.subscribe=function(s,a,u){return this._subscribe(s&&typeof s!="function"?s:{next:s,error:a,complete:u})},Za.prototype[Ws]=function(){return this},Za);function Za(s){this._subscribe=s}try{ko={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{ko={indexedDB:null,IDBKeyRange:null}}function Jl(s){var a,u=!1,d=new of(function(p){var m=Xe(s),g,k=!1,I={},W={},D={get closed(){return k},unsubscribe:function(){k||(k=!0,g&&g.abort(),M&&Qn.storagemutated.unsubscribe(K))}},M=(p.start&&p.start(D),!1),j=function(){return Aa(L)};function q(){return Ha(W,I)}var K=function(N){go(I,N),q()&&j()},L=function(){var N,Q,G;!k&&ko.indexedDB&&(I={},N={},g&&g.abort(),g=new AbortController,G=(oe=>{var ve=Fs();try{m&&Bs();var ye=Gn(s,oe);return ye=m?ye.finally(Yn):ye}finally{ve&&Vs()}})(Q={subscr:N,signal:g.signal,requery:j,querier:s,trans:null}),M||(Qn.storagemutated.subscribe(K),M=!0),Promise.resolve(G).then(function(oe){u=!0,a=oe,k||Q.signal.aborted||(q()||(W=N,q())?j():(I={},Aa(function(){return!k&&p.next&&p.next(oe)})))},function(oe){u=!1,["DatabaseClosedError","AbortError"].includes(oe==null?void 0:oe.name)||k||Aa(function(){k||p.error&&p.error(oe)})}))};return setTimeout(j,0),D});return d.hasValue=function(){return u},d.getValue=function(){return a},d}var _s=Ln;function ei(s){var a=Zn;try{Zn=!0,Qn.storagemutated.fire(s),Ga(s,!0)}finally{Zn=a}}C(_s,r(r({},Ae),{delete:function(s){return new _s(s,{addons:[]}).delete()},exists:function(s){return new _s(s,{addons:[]}).open().then(function(a){return a.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return a=_s.dependencies,u=a.indexedDB,a=a.IDBKeyRange,(Ba(u)?Promise.resolve(u.databases()).then(function(d){return d.map(function(p){return p.name}).filter(function(p){return p!==ro})}):Va(u,a).toCollection().primaryKeys()).then(s)}catch{return Ot(new Ve.MissingAPI)}var a,u},defineClass:function(){return function(s){v(this,s)}},ignoreTransaction:function(s){return ze.trans?ys(ze.transless||jt,s):s()},vip:Ua,async:function(s){return function(){try{var a=Ya(s.apply(this,arguments));return a&&typeof a.then=="function"?a:Le.resolve(a)}catch(u){return Ot(u)}}},spawn:function(s,a,u){try{var d=Ya(s.apply(u,a||[]));return d&&typeof d.then=="function"?d:Le.resolve(d)}catch(p){return Ot(p)}},currentTransaction:{get:function(){return ze.trans||null}},waitFor:function(s,a){return s=Le.resolve(typeof s=="function"?_s.ignoreTransaction(s):s).timeout(a||6e4),ze.trans?ze.trans.waitFor(s):s},Promise:Le,debug:{get:function(){return le},set:function(s){S(s)}},derive:te,extend:v,props:C,override:V,Events:dr,on:Qn,liveQuery:Jl,extendObservabilitySet:go,getByKeyPath:J,setByKeyPath:Y,delByKeyPath:function(s,a){typeof a=="string"?Y(s,a,void 0):"length"in a&&[].map.call(a,function(u){Y(s,u,void 0)})},shallowClone:ne,deepClone:Ie,getObjectDiff:Ja,cmp:ut,asap:U,minKey:-1/0,addons:[],connections:{get:hr.toArray},errnames:De,dependencies:ko,cache:ws,semVer:"4.4.6",version:"4.4.6".split(".").map(function(s){return parseInt(s)}).reduce(function(s,a,u){return s+a/Math.pow(10,2*u)})})),_s.maxKey=vr(_s.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Qn(co,function(s){Zn||(s=new CustomEvent(ja,{detail:s}),Zn=!0,dispatchEvent(s),Zn=!1)}),addEventListener(ja,function(s){s=s.detail,Zn||ei(s)}));var zs,Zn=!1,Xl=function(){};return typeof BroadcastChannel<"u"&&((Xl=function(){(zs=new BroadcastChannel(ja)).onmessage=function(s){return s.data&&ei(s.data)}})(),typeof zs.unref=="function"&&zs.unref(),Qn(co,function(s){Zn||zs.postMessage(s)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(s){if(!Ln.disableBfCache&&s.persisted){le&&console.debug("Dexie: handling persisted pagehide"),zs!=null&&zs.close();for(var a=0,u=hr.toArray();a<u.length;a++)u[a].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(s){!Ln.disableBfCache&&s.persisted&&(le&&console.debug("Dexie: handling persisted pageshow"),Xl(),ei({all:new qt(-1/0,[[]])}))})),Le.rejectionMapper=function(s,a){return!s||s instanceof Ne||s instanceof TypeError||s instanceof SyntaxError||!s.name||!b[s.name]?s:(a=new b[s.name](a||s.message,s),"stack"in s&&B(a,"stack",{get:function(){return this.inner.stack}}),a)},S(le),r(Ln,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Ln,Entity:$l,PropModification:cr,RangeSet:qt,add:function(s){return new cr({add:s})},cmp:ut,default:Ln,liveQuery:Jl,mergeRanges:gr,rangesOverlap:Fl,remove:function(s){return new cr({remove:s})},replacePrefix:function(s,a){return new cr({replacePrefix:[s,a]})}}),{default:Ln}),Ln})})(ld);var em=ld.exports;const Di=Zv(em),Nu=Symbol.for("Dexie"),Zo=globalThis[Nu]||(globalThis[Nu]=Di);if(Di.semVer!==Zo.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Di.semVer} and ${Zo.semVer}`);const{liveQuery:tm,mergeRanges:_C,rangesOverlap:kC,RangeSet:xC,cmp:CC,Entity:$C,PropModification:SC,replacePrefix:EC,add:TC,remove:AC,DexieYProvider:PC}=Zo;class nm extends Zo{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"}),this.version(5).stores({plan:"++id, date, status"}).upgrade(async n=>{const r={dev:"项目实操",test:"项目实操",bugfix:"售后服务",learning:"产品学习",meeting:"打杂",doc:"打杂",other:"打杂"};await n.table("log_item").toCollection().modify(o=>{o.category&&r[o.category]&&(o.category=r[o.category])})})}}let ue;function sm(e){ue=e}function cl(){ue&&ue.close(),ue=void 0}const rm=5,Fu=["公司","客户现场","出差","居家办公"],om={dev:"项目实操",test:"项目实操",bugfix:"售后服务",learning:"产品学习",meeting:"打杂",doc:"打杂",other:"打杂"};function Li(e){return om[e]||e}function Or(e){return e<10?"0"+e:String(e)}function Bn(e){return e.getFullYear()+"-"+Or(e.getMonth()+1)+"-"+Or(e.getDate())}function bt(){return Bn(new Date)}function mt(){const e=new Date;return Bn(e)+"T"+Or(e.getHours())+":"+Or(e.getMinutes())+":"+Or(e.getSeconds())}function Un(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function Rs(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function on(e,t){const n=Rs(e);return n.setDate(n.getDate()+t),Bn(n)}function ea(e,t){const n=Rs(e),r=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(r,o)),Bn(n)}function Qs(e){const t=Rs(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Bn(t)}function am(e){const t=Rs(e).getDay();return t===0||t===6}function im(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function ud(e){const t=Rs(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}const lm=15e4;function Ki(e){const t=new Uint8Array(e);let n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n)}function Ri(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function um(){return Ki(crypto.getRandomValues(new Uint8Array(16)).buffer)}async function ta(e,t){const n=new TextEncoder,r=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:Ri(t),iterations:lm,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function na(e,t){const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,new TextEncoder().encode(t));return Ki(n.buffer)+":"+Ki(r)}async function ka(e,t){const n=t.split(":");if(n.length!==2)throw new Error("密文格式错误");const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:Ri(n[0])},e,Ri(n[1]));return new TextDecoder().decode(r)}async function dl(){await bd()}const cd="intern-log-vault-verify",rr="enc:v1:";let Ls=null;function cm(){return Ls!==null}function sa(){Ls=null}async function dd(){return await Ct("pwd_salt","")!==""}async function dm(e){if(e.length<6)throw new Error("主密码至少 6 位");if(await dd())throw new Error("主密码已设置");const t=um(),n=await ta(e,t),r=await na(n,cd);await Dt("pwd_salt",t),await Dt("pwd_verifier",r),Ls=n}async function fm(e){const t=await Ct("pwd_salt","");if(!t)throw new Error("主密码尚未设置");const n=await ta(e,t),r=await Ct("pwd_verifier","");try{await ka(n,r)}catch{throw new Error("主密码不正确")}Ls=n}async function fd(){if(!Ls)throw new Error("密码库未解锁");return Ls}async function pm(e){const t=await fd();return rr+await na(t,e)}async function vm(e){if(!e)return"";if(!e.startsWith(rr))return e;const t=await fd();return ka(t,e.slice(rr.length))}async function mm(){return ue.credential.orderBy("system").toArray()}async function hm(e,t){const n=await pm(e.password),r={system:e.system.trim(),account:e.account.trim(),password:n,remark:e.remark.trim()};t?await ue.credential.update(t,{...r,updated_at:mt()}):await ue.credential.add({...r,created_at:mt(),updated_at:mt()}),await dl()}async function ym(e){await ue.credential.delete(e),await dl()}async function mi(e){const t=await ue.credential.get(e);if(!t)throw new Error("记录不存在");return vm(t.password)}async function gm(e,t){if(!e)throw new Error("请输入旧主密码");if(t.length<6)throw new Error("新主密码至少 6 位");if(t===e)throw new Error("新主密码不能与旧主密码相同");const n=await Ct("pwd_salt","");if(!n)throw new Error("密码库尚未初始化");const r=await ta(e,n),o=await Ct("pwd_verifier","");try{await ka(r,o)}catch{throw new Error("旧主密码不正确")}const i=await ta(t,n),c=await ue.credential.toArray();let f=0;for(const v of c){if(v.id==null)continue;const y=await bm(v.password,r),h=rr+await na(i,y);await ue.credential.update(v.id,{password:h}),f++}return await Dt("pwd_verifier",await na(i,cd)),Ls=i,await dl(),f}async function bm(e,t){return e?e.startsWith(rr)?ka(t,e.slice(rr.length)):e:""}const wm="https://daywk.linyux.cn",_m="dsh_sync_base",Ni="dsh_sync_token";function pd(e){try{return localStorage.getItem(e)||""}catch{return""}}function km(e,t){try{localStorage.setItem(e,t)}catch{}}function xm(e){try{localStorage.removeItem(e)}catch{}}async function Ns(){return pd(_m)||wm}function xa(){const e=pd(Ni);if(!e)return"";try{return e}catch{return""}}function Br(e){e?km(Ni,e):xm(Ni)}const Cm="intern_worklog",fl="dsh_session_user";function Ur(){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 $m(e){localStorage.setItem(fl,JSON.stringify(e))}function vd(){localStorage.removeItem(fl)}const pl="dsh_cloud_creds";function md(e,t){localStorage.setItem(pl,JSON.stringify({username:e,password:t}))}function bn(){try{const e=localStorage.getItem(pl);if(!e)return null;const t=JSON.parse(e);if(t&&t.username&&t.password)return t}catch{}return null}function Sm(){localStorage.removeItem(pl)}let ra=null;function oa(e){ra===e&&ue||(ue&&cl(),sm(new nm(Cm+"_"+e)),ra=e)}async function Em(e,t,n){const r=await Ns();let o;try{o=await fetch(r+"/api/auth/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.trim(),password:n})})}catch{throw new Error("无法连接同步服务器:请检查网络后重试")}const i=await o.json().catch(()=>({}));if(!o.ok){const c=i&&i.error||"服务返回 "+o.status;throw e==="register"&&o.status===409?new Error("云端已有同名账号且密码一致,直接登录即可"):new Error(String(c))}if(!i.userId||!i.username)throw new Error("登录响应异常");return{userId:String(i.userId),username:String(i.username)}}async function vl(e,t,n){const r=await Em(n,e,t);oa(r.userId);const o={userId:r.userId,username:r.username};return $m(o),md(r.username,t),o}async function Tm(e,t){const n=(e||"").trim();if(!n||!t)throw new Error("请输入用户名与密码");return vl(n,t,"login")}async function Am(e,t,n){const r=(e||"").trim();if(r.length<2||r.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");return vl(r,t,"register")}async function Pm(){const e=bn();if(!e)return null;try{return await vl(e.username,e.password,"login")}catch{return null}}async function Om(){sa(),cl(),ra=null,vd()}function Mm(){sa(),cl(),ra=null,vd(),Sm()}async function Im(e,t){if(!Ur())throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const r=bn();if(!r||r.password!==e)throw new Error("旧密码不正确");const o=await Ns();let i;try{i=await fetch(o+"/api/auth/password",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+hd()},body:JSON.stringify({oldPassword:e,newPassword:t})})}catch{throw new Error("无法连接同步服务器")}if(!i.ok){const c=await i.json().catch(()=>({}));throw new Error(c&&c.error||"修改失败 "+i.status)}md(r.username,t)}async function jm(){if(!Ur())throw new Error("未登录");const t=await Ns();let n;try{n=await fetch(t+"/api/auth/delete",{method:"POST",headers:{Authorization:"Bearer "+hd()}})}catch{throw new Error("无法连接同步服务器")}if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r&&r.error||"删除失败 "+n.status)}Mm()}function hd(){return xa()}const Fi=P(null),Vi=P(null),ur=P(0);function rs(){ur.value++}const Zs=P(""),qr=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","transaction","plan"],Js=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);function Do(e){return JSON.stringify(e)}async function Dm(e){return ue.table(e).toArray()}function Lo(e,t){return e==="setting"?t.key:t.id}async function Lm(){for(const e of qr){const t=ue.table(e),n=await t.toArray();for(const r of n){if(e==="setting"&&Js.has(r.key))continue;const o={};r.uuid||(o.uuid=Km()),!r.updated_at&&r.created_at&&(o.updated_at=r.created_at),Object.keys(o).length&&await t.update(Lo(e,r),o)}}}function Km(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"u"+Date.now().toString(36)+Math.random().toString(36).slice(2,10)}async function Rm(){return bn()!=null}async function Nm(){try{return localStorage.getItem("dsh_last_sync")||""}catch{return""}}async function Fm(e){try{localStorage.setItem("dsh_last_sync",e)}catch{}}async function yd(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 r=await n.json();if(!r||!r.token)throw new Error("云端登录异常");return String(r.token)}async function Vm(e,t){let n=xa();return n||(n=await yd(e,t),Br(n),n)}async function gd(){const e=bn();if(!e)throw new Error("未登录");const t=await Ns(),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 Bi(){const e=bn();if(!e)throw new Error("未登录,无法同步");return kd({baseUrl:await Ns(),username:e.username,password:e.password})}async function bd(){try{await Bi()}catch(e){Zs.value=e instanceof Error?e.message:String(e);try{await Bi()}catch{}throw e}}function wd(e,t,n){const r={};for(const o of Object.keys(t))o!=="id"&&(r[o]=t[o]);if(e==="log_item"){delete r.work_log_id,delete r.project_id;const o=t.work_log_id?n.workLog.get(t.work_log_id):null;o&&o.uuid&&(r.wuuid=o.uuid);const i=t.project_id?n.project.get(t.project_id):null;i&&i.uuid&&(r.puuid=i.uuid)}return r}async function _d(){const e=await ue.work_log.toArray(),t=await ue.project.toArray();return{workLog:new Map(e.map(n=>[n.id,n])),project:new Map(t.map(n=>[n.id,n]))}}let Mr=!1,Ko=!1,Ui=!1,er=null,Cn=null,qi="",Hi=!1,Ro=null;async function tr(){if(Mr){Ko=!0;return}try{if(!await Rm())return;await kd(await Bm()),Zs.value=""}catch(e){Zs.value=e instanceof Error?e.message:String(e)}}async function Bm(){const e=bn();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await Ns(),username:e.username,password:e.password}}function Um(){if(Hi)return;Hi=!0,Ro=tm(async()=>{const t={};for(const n of qr)t[n]=await ue.table(n).count();return t}).subscribe({next:()=>{Ui||Mr||(er&&globalThis.clearTimeout(er),er=globalThis.setTimeout(()=>{tr()},3e3))},error:()=>{}})}function qm(){Ro&&(Ro.unsubscribe(),Ro=null),Cn&&(Cn.close(),Cn=null,qi=""),er&&(globalThis.clearTimeout(er),er=null),Hi=!1}function Hm(e,t){const n=e+"|"+t;if(!(Cn&&qi===n)){Cn&&(Cn.close(),Cn=null);try{Cn=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),qi=n,Cn.onmessage=()=>{tr()}}catch{Cn=null}}}async function kd(e){if(Mr)return Ko=!0,{pushed:0,pulled:0,removed:0,errors:0,at:""};Mr=!0,Ui=!0;try{const t=await Wm(e);return Ko&&(Ko=!1,globalThis.setTimeout(()=>{tr()},800)),t}finally{Mr=!1,Ui=!1}}async function Wm(e){const t=e.baseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("请先配置同步服务地址");await Lm();const n=await _d(),r=await ue.sync_mirror.toArray(),o=new Map;for(const se of r)o.set(se.table+"|"+se.uuid,se);const i={},c=[];let f=0;for(const se of qr){let ae=await Dm(se);se==="setting"&&(ae=ae.filter(V=>!Js.has(V.key)));const re=new Map;for(const V of ae)re.set(V.uuid,V);for(const[V,T]of re){const U=wd(se,T,n),J=Do(U),Y=o.get(se+"|"+V);(!Y||Y.hash!==J)&&(i[se]=i[se]||[],i[se].push(U),f++)}for(const[V,T]of o)V.startsWith(se+"|")&&!re.has(T.uuid)&&c.push({table:se,uuid:T.uuid,deleted_at:mt()});i[se]=i[se]||[]}c.push(...Xm());const v=await Vm(t,e),y=se=>fetch(t+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+se},body:JSON.stringify({device:"client",tables:i,tombstones:c})});let h=await y(v);if(h.status===401){Br("");const se=await yd(t,e);Br(se),h=await y(se)}if(!h.ok)throw new Error("同步服务返回 "+h.status);const w=await h.json(),C=w.tables||{},O=w.tombstones||[],B=await Ym(C,O);Hm(t,xa()||v);const te=mt();return await Fm(te),(B.changed>0||B.removed>0||f>0)&&rs(),{pushed:f,pulled:B.changed,removed:B.removed,errors:0,at:te}}function xd(){var t;return"dsh_idmap_"+(((t=bn())==null?void 0:t.username)||"anon")}function zm(){try{const e=localStorage.getItem(xd());if(e)return JSON.parse(e)}catch{}return{}}function Gm(e){try{localStorage.setItem(xd(),JSON.stringify(e))}catch{}}async function Ym(e,t){const n=zm(),r=new Set(t.map(C=>C.table+"|"+C.uuid)),o=new Map;for(const C of await ue.sync_mirror.toArray())o.set(C.table+"|"+C.uuid,C);const i=new Set(Array.from(o.keys()).map(C=>C.split("|")[1]));let c=0,f=0;const v={},y={};for(const C of qr){const O=ue.table(C),B=await O.toArray(),te=new Map(B.map($=>[Lo(C,$),$])),se=new Map(B.filter($=>$.uuid).map($=>[$.uuid,$])),ae=(e[C]||[]).filter($=>!r.has(C+"|"+$.uuid)),re=ae.filter($=>!(C==="setting"&&Js.has($.key))),V=ae.filter($=>C==="setting"&&Js.has($.key));for(const $ of V)Jm(C,$.uuid);const T=C==="setting"?[]:B.filter($=>$.uuid&&!i.has($.uuid)&&!r.has(C+"|"+$.uuid)),U={v:Math.max(0,...B.map($=>Number($.id)||0))};re.length;const J=[];for(const $ of re){const R={...$};if(C==="log_item"){const Ie=R.wuuid?v[R.wuuid]:void 0;if(!Ie)continue;R.work_log_id=Ie,delete R.wuuid,R.project_id=R.puuid?y[R.puuid]??null:null,delete R.puuid}let F=Lo(C,$);if(C==="setting")F=$.key;else{const Ie=n[C]&&n[C][$.uuid],Pe=se.get($.uuid);Pe&&Pe.id!=null?F=Pe.id:typeof Ie=="number"?F=Ie:F=++U.v}const ee={...R,id:F};C==="setting"&&Js.has(ee.key)||(J.push(ee),C==="work_log"&&(v[$.uuid]=F),C==="project"&&(y[$.uuid]=F))}const Y=J.concat(T);for(const $ of Y){const R=te.get(Lo(C,$));(!R||Do(R)!==Do($))&&c++}f+=B.filter($=>$.uuid&&!J.some(R=>R.uuid===$.uuid)&&!r.has(C+"|"+$.uuid)).length,await O.clear(),Y.length&&await O.bulkPut(Y);const ne={};for(const $ of Y)$.uuid&&(ne[$.uuid]=$.id);n[C]=ne}Gm(n);const h=await _d(),w=[];for(const C of qr){const O=await ue.table(C).toArray();for(const B of O)C==="setting"&&Js.has(B.key)||B.uuid&&w.push({table:C,uuid:B.uuid,hash:Do(wd(C,B,h))})}return await ue.sync_mirror.clear(),w.length&&await ue.sync_mirror.bulkAdd(w.map(C=>({...C}))),await ue.tombstone.clear(),{changed:c,removed:f+aa.length}}const aa=[];function Jm(e,t){aa.some(n=>n.table===e&&n.uuid===t)||aa.push({table:e,uuid:t,deleted_at:mt()})}function Xm(){return aa.splice(0)}const Qm=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);async function yt(){await bd()}async function Ct(e,t){const n=await ue.setting.get(e);return n?n.value:t}async function Dt(e,t){await ue.setting.put({key:e,value:t}),Qm.has(e)||await yt()}async function Ks(){const e=await Promise.all([Ct("work_start","09:00"),Ct("work_end","18:00"),Ct("grace_minutes","10"),Ct("lunch_minutes","60"),Ct("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 Zm(){const e=await Ct("last_project",""),t=await Ct("last_category","dev");return{project_id:e?Number(e):null,category:t||"dev"}}async function eh(){return Ct("last_location","")}async function th(e,t){const n=t.trim();await Dt("last_location",n),n&&await ia(n);let r=!1;const o=await wn(e);o&&o.id?(o.location||"")!==n&&(await ue.attendance.update(o.id,{location:n||null}),r=!0):n&&(await ue.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:mt()}),r=!0),r&&await yt()}async function ml(){const e=await Ct("location_presets","");if(!e)return Fu.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 Fu.slice()}async function Cd(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await Dt("location_presets",JSON.stringify(t))}async function ia(e){const t=e.trim();if(!t)return;const n=await ml();n.includes(t)||await Cd([...n,t])}async function nr(e=!1){const t=await ue.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function nh(e){await ue.project.add({name:e.trim(),archived:0,created_at:mt()}),await yt()}async function sh(e,t){await ue.project.update(e,{name:t.trim()}),await yt()}async function rh(e,t){await ue.project.update(e,{archived:t?1:0}),await yt()}async function wn(e){return ue.attendance.where("date").equals(e).first()}async function $d(e,t){const n=((t===void 0?await Ct("last_location",""):t)||"").trim();let r=!1;const o=await wn(e);if(o&&o.id){if(!o.clock_in_at){const i={clock_in_at:mt()};n&&(i.location=n),await ue.attendance.update(o.id,i),r=!0}n&&(await Ct("last_location","")!==n&&await Dt("last_location",n),await ia(n)),r&&await yt();return}await ue.attendance.add({date:e,clock_in_at:mt(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:mt()}),n&&(await Dt("last_location",n),await ia(n)),await yt()}async function oh(e){const t=await wn(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&(await ue.attendance.update(t.id,{clock_out_at:mt()}),await yt())}async function ah(){const e=new Date,t=Bn(e);let n="";if(e.getHours()<4){const r=await wn(on(t,-1));r&&r.id&&r.clock_in_at&&!r.clock_out_at&&(await ue.attendance.update(r.id,{clock_out_at:mt()}),n=r.date)}if(!n){const r=await wn(t);r&&r.id&&r.clock_in_at&&!r.clock_out_at&&(await ue.attendance.update(r.id,{clock_out_at:mt()}),n=r.date)}if(!n)throw new Error("没有进行中的打卡");return await yt(),n}async function ih(e,t,n,r,o){(o||"").trim()&&await ia(o);const i=await wn(e),c={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:r||null,location:(o||"").trim()||null,created_at:mt()};i&&i.id?await ue.attendance.update(i.id,c):await ue.attendance.add(c),await yt()}async function lh(e,t,n){const r=(n||"").trim();if(!r)return;const o=await wn(e);o&&o.id&&(await ue.attendance.update(o.id,{[t]:e+"T"+r+":00"}),await yt())}async function Ca(e,t){return ue.attendance.where("date").between(e,t,!0,!0).toArray()}async function uh(e,t){const n=await wn(e);if(t){const r={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:mt()};n&&n.id?await ue.attendance.update(n.id,r):await ue.attendance.add({...r,note:null,location:null})}else n&&n.id&&await ue.attendance.update(n.id,{kind:"normal"});await yt()}async function ch(e){const t=await ue.work_log.where("date").equals(e).first();return t||{id:await ue.work_log.add({date:e,created_at:mt()}),date:e,created_at:mt()}}async function dh(e){return ue.work_log.where("date").equals(e).first()}async function fh(e){const t=await dh(e);return!t||!t.id?[]:(await ue.log_item.where("work_log_id").equals(t.id).toArray()).sort((r,o)=>o.id-r.id)}async function ph(e,t){const n=await ue.work_log.where("date").equals(e).first();let r;n&&n.id?r=n:r=await ch(e),await ue.table("log_item").add({work_log_id:r.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:mt()});const o=t.project_id?String(t.project_id):"";await Ct("last_project","")!==o&&await Dt("last_project",o),await Ct("last_category","")!==t.category&&await Dt("last_category",t.category),await yt()}async function hi(e,t){await ue.table("log_item").update(e,t),await yt()}async function vh(e){await ue.table("log_item").delete(e),await yt()}async function Hr(e,t){const n=await ue.work_log.where("date").between(e,t,!0,!0).toArray();if(!n.length)return[];const r=new Map(n.map(i=>[i.id,i.date]));return(await ue.table("log_item").where("work_log_id").anyOf(n.map(i=>i.id)).toArray()).map(i=>({...i,date:r.get(i.work_log_id)||""})).sort((i,c)=>i.date===c.date?i.id-c.id:i.date<c.date?-1:1)}async function hl(e){return ue.weekly_note.where("week_start").equals(e).first()}async function mh(e,t){const n=await hl(e);n&&n.id?await ue.weekly_note.update(n.id,t):await ue.weekly_note.add({week_start:e,highlights:t.highlights??null,challenges:t.challenges??null,plan_next:t.plan_next??null,created_at:mt()}),await yt()}async function hh(e,t){return ue.weekly_note.where("week_start").between(e,t,!0,!0).toArray()}async function yh(e){return(await ue.plan.where("date").equals(e).toArray()).sort((n,r)=>n.start_time<r.start_time?-1:1)}async function gh(e){const t=mt();await ue.plan.add({date:e.date,start_time:e.start_time,end_time:e.end_time,title:e.title.trim(),kind:e.kind.trim()||"其他",note:e.note||null,status:"todo",actual_minutes:0,timer_started_at:null,uuid:"",created_at:t,updated_at:t}),await yt()}async function bh(e,t){await ue.plan.update(e,{...t,updated_at:mt()}),await yt()}async function wh(e){await ue.plan.delete(e),await yt()}async function _h(e,t){const n=await ue.plan.get(e);n&&(t!=="todo"&&n.timer_started_at&&await yl(e),await ue.plan.update(e,{status:t,updated_at:mt()}),await yt())}async function kh(e){const t=await ue.plan.filter(n=>!!n.timer_started_at).toArray();for(const n of t)n.id!==e&&await yl(n.id);await ue.plan.update(e,{timer_started_at:mt(),updated_at:mt()}),await yt()}async function yl(e){const t=await ue.plan.get(e);if(!t||!t.timer_started_at)return;const n=Math.max(0,Math.round((Date.now()-new Date(t.timer_started_at).getTime())/6e4));await ue.plan.update(e,{actual_minutes:(t.actual_minutes||0)+n,timer_started_at:null,updated_at:mt()}),await yt()}async function xh(){return(await ue.memo.toArray()).sort((t,n)=>t.updated_at<n.updated_at?1:-1)}async function Ch(e,t){const n=mt(),r=await ue.memo.add({title:e.trim(),content:t,created_at:n,updated_at:n});return await yt(),{id:r,title:e.trim(),content:t,created_at:n,updated_at:n}}async function $h(e,t,n){await ue.memo.update(e,{title:t.trim(),content:n,updated_at:mt()}),await yt()}async function Sh(e){await ue.memo.delete(e),await yt()}async function Eh(e,t=8){const n=e.trim().toLowerCase();if(!n)return[];const r=await ue.work_log.toArray(),o=new Map(r.map(c=>[c.id,c.date]));return(await ue.table("log_item").toArray()).filter(c=>((c.content||"")+" "+(c.takeaway||"")+" "+(c.remark||"")).toLowerCase().includes(n)).sort((c,f)=>f.id-c.id).slice(0,t).map(c=>({...c,date:o.get(c.work_log_id)||""}))}async function Th(e,t=4){const n=e.trim().toLowerCase();return n?(await ue.memo.toArray()).filter(o=>((o.title||"")+" "+(o.content||"")).toLowerCase().includes(n)).sort((o,i)=>o.updated_at<i.updated_at?1:-1).slice(0,t):[]}async function Ah(e,t){return ue.table("transaction").where("date").between(e,t,!0,!0).toArray()}async function Ph(e){await ue.table("transaction").add({...e,created_at:mt()}),await yt()}async function Oh(e,t){await ue.table("transaction").update(e,{...t}),await yt()}async function Mh(e){await ue.table("transaction").delete(e),await yt()}async function Ih(e,t){await ue.table("transaction").update(e,{reimbursed:1}),await yt()}async function jh(){const e=await Promise.all([ue.project.toArray(),ue.work_log.toArray(),ue.table("log_item").toArray(),ue.attendance.toArray(),ue.weekly_note.toArray(),ue.setting.toArray(),ue.memo.toArray(),ue.credential.toArray(),ue.table("transaction").toArray(),ue.plan.toArray()]);return JSON.stringify({schema_version:rm,exported_at:mt(),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],plan:e[9]}},null,2)}async function Dh(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.schema_version!==4&&t.schema_version!==5||!t.data)throw new Error("文件格式或 schema 版本不匹配");const n=t.data,r=ue.table("log_item"),o=ue.table("transaction"),i=ue.plan;await ue.transaction("rw",[ue.project,ue.work_log,r,ue.attendance,ue.weekly_note,ue.setting,ue.memo,ue.credential,o,i],async()=>{await Promise.all([ue.project.clear(),ue.work_log.clear(),r.clear(),ue.attendance.clear(),ue.weekly_note.clear(),ue.setting.clear(),ue.memo.clear(),ue.credential.clear(),o.clear(),i.clear()]),n.project&&n.project.length&&await ue.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await ue.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await r.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await ue.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await ue.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await ue.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await ue.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await ue.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await o.bulkAdd(n.transaction),n.plan&&n.plan.length&&await i.bulkAdd(n.plan)}),await yt()}const Lh=["制度学习","产品学习","打杂","项目实操","售后服务"],Kh=["餐饮","交通","住房","通讯","学习","娱乐","其他"],Rh=["工资","报销","其他"],Sd="log_categories",Ed="ledger_expense_categories",Td="ledger_income_categories";function Ad(e,t){if(!e)return t.slice();try{const n=JSON.parse(e);if(Array.isArray(n)){const r=n.filter(o=>typeof o=="string"&&o.trim()).map(o=>o.trim());if(r.length)return Array.from(new Set(r))}}catch{}return t.slice()}async function Jr(){return Ad(await Ct(Sd,""),Lh)}async function yi(e){await Dt(Sd,JSON.stringify(e))}async function Wr(e){return Ad(await Ct(e==="expense"?Ed:Td,""),e==="expense"?Kh:Rh)}async function Es(e,t){await Dt(e==="expense"?Ed:Td,JSON.stringify(t))}const Nh={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},Fh={class:"dialog-head"},Vh={key:0,class:"muted dialog-sub"},Bh={class:"dialog-body"},Uh={class:"form-grid"},qh={class:"field span2"},Hh={key:0,class:"form-error"},Wh={class:"field"},zh=["value"],Gh={class:"field"},Yh=["value"],Jh={class:"field"},Xh={class:"field"},Qh={class:"field span2"},Zh={class:"field"},ey={class:"field"},ty={class:"dialog-btns"},ny=Ft({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=P([]);Jr().then(re=>{n.value=re});const r=e,o=t,i=P(""),c=P(null),f=P("dev"),v=P(null),y=P(""),h=P(""),w=P(0),C=P(0),O=P(""),B=P(null),te=it(()=>{var T;const re=r.projects.filter(U=>U.archived!==1),V=(T=r.item)==null?void 0:T.project_id;if(V&&!re.some(U=>U.id===V)){const U=r.projects.find(Y=>Y.id===V),J=re.slice();return U&&J.unshift({...U,name:U.name+"(已归档)"}),J}return re});function se(re){r.open&&re.key==="Escape"&&o("cancel")}wt(()=>r.open,async re=>{var V;if(re){const T=r.item;i.value=(T==null?void 0:T.content)??"",c.value=(T==null?void 0:T.project_id)??null,f.value=(T==null?void 0:T.category)??"dev",v.value=(T==null?void 0:T.minutes)??null,y.value=(T==null?void 0:T.takeaway)??"",h.value=(T==null?void 0:T.remark)??"",w.value=(T==null?void 0:T.is_milestone)??0,C.value=(T==null?void 0:T.needs_followup)??0,O.value="",window.addEventListener("keydown",se),await ir(),(V=B.value)==null||V.focus()}else window.removeEventListener("keydown",se)}),Wn(()=>window.removeEventListener("keydown",se)),wt(i,()=>{O.value&&(O.value="")});function ae(){const re=i.value.trim();if(!re){O.value="请填写工作内容";return}if(!r.item||!r.item.id){o("cancel");return}o("save",{id:r.item.id,content:re,project_id:c.value,category:f.value,minutes:v.value&&v.value>0?v.value:null,takeaway:y.value.trim()||null,remark:h.value.trim()||null,is_milestone:w.value?1:0,needs_followup:C.value?1:0})}return(re,V)=>(E(),At(cs,{to:"body"},[Me(lr,{name:"modal"},{default:vs(()=>[e.open?(E(),A("div",{key:0,class:"mask",onClick:V[10]||(V[10]=en(T=>o("cancel"),["self"]))},[l("div",Nh,[l("div",Fh,[l("div",null,[V[11]||(V[11]=l("div",{class:"dialog-title"},"编辑工作记录",-1)),e.date?(E(),A("div",Vh,z(e.date),1)):we("",!0)]),l("button",{class:"icon-btn",title:"关闭",onClick:V[0]||(V[0]=T=>o("cancel"))},[Me(et,{name:"close",size:16})])]),l("div",Bh,[l("div",Uh,[l("div",qh,[V[12]||(V[12]=l("label",null,"工作内容(必填)",-1)),Oe(l("input",{ref_key:"contentInput",ref:B,class:tt(["input",{invalid:O.value}]),"onUpdate:modelValue":V[1]||(V[1]=T=>i.value=T),onKeydown:Et(ae,["enter"])},null,34),[[Fe,i.value]]),O.value?(E(),A("div",Hh,z(O.value),1)):we("",!0)]),l("div",Wh,[V[14]||(V[14]=l("label",null,"所属项目",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":V[2]||(V[2]=T=>c.value=T)},[V[13]||(V[13]=l("option",{value:null},"无项目",-1)),(E(!0),A(Ke,null,at(te.value,T=>(E(),A("option",{key:T.id,value:T.id},z(T.name),9,zh))),128))],512),[[Pn,c.value]])]),l("div",Gh,[V[15]||(V[15]=l("label",null,"工作分类",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":V[3]||(V[3]=T=>f.value=T)},[(E(!0),A(Ke,null,at(n.value,T=>(E(),A("option",{key:T,value:T},z(T),9,Yh))),128))],512),[[Pn,f.value]])]),l("div",Jh,[V[16]||(V[16]=l("label",null,"耗时(分钟)",-1)),Oe(l("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":V[4]||(V[4]=T=>v.value=T),placeholder:"选填"},null,512),[[Fe,v.value,void 0,{number:!0}]])]),l("div",Xh,[V[17]||(V[17]=l("label",null,"主要收获",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":V[5]||(V[5]=T=>y.value=T),placeholder:"一句话:学到了什么"},null,512),[[Fe,y.value]])]),l("div",Qh,[V[18]||(V[18]=l("label",null,"备注",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":V[6]||(V[6]=T=>h.value=T),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Fe,h.value]])]),l("div",Zh,[V[19]||(V[19]=l("label",null,"成果标记",-1)),l("button",{class:tt(["toggle-btn",{on:w.value===1}]),onClick:V[7]||(V[7]=T=>w.value=w.value===1?0:1)},z(w.value===1?"已标记为成果":"未标记"),3)]),l("div",ey,[V[20]||(V[20]=l("label",null,"待跟进",-1)),l("button",{class:tt(["toggle-btn",{onwarn:C.value===1}]),onClick:V[8]||(V[8]=T=>C.value=C.value===1?0:1)},z(C.value===1?"需要跟进":"无需跟进"),3)])])]),l("div",ty,[l("button",{class:"btn btn-sm",onClick:V[9]||(V[9]=T=>o("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:ae},"保存修改")])])])):we("",!0)]),_:1})]))}}),sy=Ut(ny,[["__scopeId","data-v-aaf87f80"]]);function Po(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function Xr(e,t,n,r){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(am(t))return{status:"rest",label:"休息日",makeup:!1,workedMinutes:null};if(!e||!e.clock_in_at)return r?{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:r?"进行中":"未完成",makeup:o,workedMinutes:null};const i=Po(Un(e.clock_in_at)),c=Po(Un(e.clock_out_at)),f=Po(n.work_start),v=Po(n.work_end);let y="normal";!o&&i>f+n.grace_minutes?y="late":!o&&c<v&&(y="early");const h=im(e.clock_in_at,e.clock_out_at),w=Math.max(0,h-n.lunch_minutes);return{status:y,label:o?"补卡":y==="late"?"迟到":y==="early"?"早退":"正常",makeup:o,workedMinutes:w}}const No=P([]);let ry=0;function He(e){const t=++ry;No.value.push({id:t,text:e}),setTimeout(()=>{No.value=No.value.filter(n=>n.id!==t)},2e3)}function oy(){return No}const ay={class:"day-panel"},iy={class:"dp-head"},ly={class:"dp-date"},uy={class:"card sec"},cy={class:"att-grid"},dy={class:"att-cell"},fy={key:0,class:"edit-row"},py={key:1,class:"att-val"},vy={class:"att-cell"},my={key:0,class:"edit-row"},hy={key:1,class:"att-val"},yy={class:"att-cell"},gy=["list"],by=["id"],wy=["value"],_y={class:"att-cell"},ky={class:"att-val status-val"},xy={key:0,class:"tag"},Cy={key:1,class:"muted"},$y={key:0,class:"att-note muted"},Sy={class:"att-actions"},Ey=["disabled"],Ty=["disabled"],Ay=["disabled"],Py=["disabled"],Oy={key:0,class:"card sec makeup"},My={class:"form-grid"},Iy={class:"field"},jy={class:"field"},Dy={class:"field span2"},Ly=["list"],Ky={class:"field span2"},Ry={key:0,class:"form-error"},Ny={class:"form-footer"},Fy={class:"card sec"},Vy={class:"form-grid"},By={class:"field span2"},Uy={key:0,class:"form-error"},qy={class:"field"},Hy=["value"],Wy={class:"field"},zy=["value"],Gy={class:"field"},Yy={class:"field"},Jy={class:"field span2"},Xy={class:"form-footer"},Qy=["disabled"],Zy=["disabled"],eg={class:"list-sec"},tg={class:"sec-title"},ng={key:0,class:"empty muted"},sg={class:"item-main"},rg={class:"tag"},og=["onClick"],ag={key:0,class:"muted item-meta"},ig={key:1,class:"muted num item-meta"},lg=["onClick"],ug=["onClick"],cg=["onClick"],dg=["onClick"],fg={key:0,class:"item-sub"},pg={key:0,class:"muted2"},vg={key:1,class:"muted"},mg={key:1,class:"dp-foot muted num"},hg=Ft({__name:"DayPanel",props:{date:{}},setup(e){const t=P([]);Jr().then(le=>{t.value=le});const n=e,r=P(!0),o=P(null),i=P(void 0),c=P([]),f=P([]),v=P(""),y=P([]),h=it(()=>"loc-list-"+n.date),w=it(()=>n.date===bt());async function C(){r.value=!0,o.value=await Ks(),i.value=await wn(n.date),c.value=await fh(n.date),f.value=await nr(!0),y.value=await ml(),v.value=i.value&&i.value.location||await eh(),r.value=!1}an(C),wt(()=>n.date,C),wt(ur,()=>{C()});const O=it(()=>f.value.filter(le=>le.archived!==1));function B(le){if(!le)return"";const S=f.value.find(x=>x.id===le);return S?S.name:"已删除项目"}const te=it(()=>o.value?Xr(i.value,n.date,o.value,w.value):null),se=it(()=>c.value.reduce((le,S)=>le+(S.minutes||0),0)),ae=P(!1);async function re(){ae.value||(ae.value=!0,await $d(n.date,v.value),await C(),rs(),He("上班打卡成功"),ae.value=!1)}async function V(){ae.value||(ae.value=!0,await oh(n.date),await C(),rs(),He("下班打卡成功"),ae.value=!1)}async function T(){await th(n.date,v.value),rs(),He("地点已更新")}const U=P(!1),J=it(()=>{var le;return((le=i.value)==null?void 0:le.kind)==="leave"});function Y(){if(i.value&&i.value.clock_in_at){U.value=!0;return}ne(!0)}async function ne(le){U.value=!1,await uh(n.date,le),await C(),rs(),He(le?"已标记为休假":"已取消休假")}const $=P(null),R=P(""),F=P(null);wt($,async le=>{var S;le&&(await ir(),(S=F.value)==null||S.focus())});function ee(le){var x,Z;const S=le==="in"?(x=i.value)==null?void 0:x.clock_in_at:(Z=i.value)==null?void 0:Z.clock_out_at;$.value=le,R.value=S?Un(S):le==="in"?"09:00":"18:00"}function Ie(){$.value=null}async function Pe(){const le=$.value;le&&($.value=null,R.value&&(await lh(n.date,le==="in"?"clock_in_at":"clock_out_at",R.value),await C(),rs(),He("打卡时间已修改")))}const ke=P(!1),Re=P("09:00"),xe=P("18:00"),me=P(""),_e=P(""),We=P("");function Xe(){_e.value=v.value,We.value="",ke.value=!ke.value}async function Ae(){if(!Re.value||!xe.value){We.value="请填写上班与下班时间";return}await ih(n.date,n.date+"T"+Re.value+":00",n.date+"T"+xe.value+":00",me.value.trim(),_e.value),ke.value=!1,me.value="",We.value="",await C(),rs(),He("补卡已保存")}const pe=P(""),Ne=P("");wt(pe,()=>{Ne.value&&(Ne.value="")});const dt=P(null),je=P("dev"),fe=P(null),De=P(""),rt=P(""),Ve=P(!1),b=it(()=>!!(pe.value.trim()||fe.value||De.value.trim()||rt.value.trim()));an(async()=>{const le=await Zm();dt.value=le.project_id,je.value=le.category});function _(){pe.value="",fe.value=null,De.value="",rt.value="",Ne.value=""}async function X(){const le=pe.value.trim();if(!le){Ne.value="请填写工作内容";return}Ve.value||(Ve.value=!0,await ph(n.date,{content:le,project_id:dt.value,category:je.value,minutes:fe.value&&fe.value>0?fe.value:null,takeaway:De.value.trim()||null,remark:rt.value.trim()||null}),_(),await C(),He("记录已添加"),Ve.value=!1)}const de=P(null);function H(le){de.value=le}async function ie(le){const S=le.id,x={content:le.content,project_id:le.project_id,category:le.category,minutes:le.minutes,takeaway:le.takeaway,remark:le.remark,is_milestone:le.is_milestone,needs_followup:le.needs_followup};await hi(S,x),de.value=null,await C(),He("修改已保存")}async function Se(le){await hi(le.id,{is_milestone:le.is_milestone?0:1}),await C()}async function Ee(le){await hi(le.id,{needs_followup:le.needs_followup?0:1}),await C()}const ge=P(null);async function ce(){ge.value&&ge.value.id&&await vh(ge.value.id),ge.value=null,await C(),He("记录已删除")}return(le,S)=>(E(),A("div",ay,[l("div",iy,[l("div",ly,z(cn(ud)(e.date)),1)]),l("div",uy,[S[25]||(S[25]=l("div",{class:"sec-title"},"出勤信息",-1)),l("div",cy,[l("div",dy,[S[21]||(S[21]=l("label",null,"上班时间",-1)),$.value==="in"?(E(),A("div",fy,[Oe(l("input",{ref_key:"timeInput",ref:F,type:"time",class:"input time-input","onUpdate:modelValue":S[0]||(S[0]=x=>R.value=x),onKeydown:[Et(Pe,["enter"]),Et(Ie,["esc"])]},null,544),[[Fe,R.value]]),l("button",{class:"btn btn-primary btn-sm",onClick:Pe},"确认"),l("button",{class:"btn btn-sm",onClick:Ie},"取消")])):(E(),A("div",py,[l("span",{class:tt(["num",{"val-empty":!(i.value&&i.value.clock_in_at)}])},z(i.value&&i.value.clock_in_at?cn(Un)(i.value.clock_in_at):"未打卡"),3),i.value&&i.value.id?(E(),A("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:S[1]||(S[1]=x=>ee("in"))},[Me(et,{name:"edit",size:13})])):we("",!0)]))]),l("div",vy,[S[22]||(S[22]=l("label",null,"下班时间",-1)),$.value==="out"?(E(),A("div",my,[Oe(l("input",{ref_key:"timeInput",ref:F,type:"time",class:"input time-input","onUpdate:modelValue":S[2]||(S[2]=x=>R.value=x),onKeydown:[Et(Pe,["enter"]),Et(Ie,["esc"])]},null,544),[[Fe,R.value]]),l("button",{class:"btn btn-primary btn-sm",onClick:Pe},"确认"),l("button",{class:"btn btn-sm",onClick:Ie},"取消")])):(E(),A("div",hy,[l("span",{class:tt(["num",{"val-empty":!(i.value&&i.value.clock_out_at)}])},z(i.value&&i.value.clock_out_at?cn(Un)(i.value.clock_out_at):"未打卡"),3),i.value&&i.value.id?(E(),A("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:S[3]||(S[3]=x=>ee("out"))},[Me(et,{name:"edit",size:13})])):we("",!0)]))]),l("div",yy,[S[23]||(S[23]=l("label",null,"上班地点",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":S[4]||(S[4]=x=>v.value=x),list:h.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:T},null,40,gy),[[Fe,v.value]]),l("datalist",{id:h.value},[(E(!0),A(Ke,null,at(y.value,x=>(E(),A("option",{key:x,value:x},null,8,wy))),128))],8,by)]),l("div",_y,[S[24]||(S[24]=l("label",null,"考勤状态",-1)),l("div",ky,[te.value?(E(),A(Ke,{key:0},[l("span",{class:tt(["dot",te.value.status])},null,2),l("span",null,z(te.value.label),1),i.value&&i.value.kind==="makeup"?(E(),A("span",xy,"补卡")):we("",!0)],64)):(E(),A("span",Cy,"--"))])])]),i.value&&i.value.note?(E(),A("div",$y,"补卡说明:"+z(i.value.note),1)):we("",!0),l("div",Sy,[w.value&&(!i.value||!i.value.clock_in_at)?(E(),A("button",{key:0,class:"btn btn-primary btn-sm",disabled:ae.value,onClick:re},"上班打卡",8,Ey)):w.value&&i.value&&i.value.clock_in_at&&!i.value.clock_out_at?(E(),A("button",{key:1,class:"btn btn-primary btn-sm",disabled:ae.value,onClick:V},"下班打卡",8,Ty)):we("",!0),!w.value&&(!i.value||!i.value.clock_in_at)?(E(),A("button",{key:2,class:"btn btn-sm",onClick:Xe},"补卡")):we("",!0),J.value?(E(),A("button",{key:4,class:"btn btn-sm",disabled:ae.value,onClick:S[5]||(S[5]=x=>ne(!1))},"取消休假",8,Py)):(E(),A("button",{key:3,class:"btn btn-sm",disabled:ae.value,onClick:Y},"标记休假",8,Ay))])]),ke.value?(E(),A("div",Oy,[S[30]||(S[30]=l("div",{class:"sec-title"},"补卡登记",-1)),l("div",My,[l("div",Iy,[S[26]||(S[26]=l("label",null,"上班时间",-1)),Oe(l("input",{type:"time",class:"input","onUpdate:modelValue":S[6]||(S[6]=x=>Re.value=x)},null,512),[[Fe,Re.value]])]),l("div",jy,[S[27]||(S[27]=l("label",null,"下班时间",-1)),Oe(l("input",{type:"time",class:"input","onUpdate:modelValue":S[7]||(S[7]=x=>xe.value=x)},null,512),[[Fe,xe.value]])]),l("div",Dy,[S[28]||(S[28]=l("label",null,"上班地点",-1)),Oe(l("input",{class:"input",list:h.value,"onUpdate:modelValue":S[8]||(S[8]=x=>_e.value=x),placeholder:"可直接输入"},null,8,Ly),[[Fe,_e.value]])]),l("div",Ky,[S[29]||(S[29]=l("label",null,"补卡原因",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":S[9]||(S[9]=x=>me.value=x),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[Fe,me.value]])])]),We.value?(E(),A("div",Ry,z(We.value),1)):we("",!0),l("div",Ny,[l("button",{class:"btn btn-sm",onClick:S[10]||(S[10]=x=>ke.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:Ae},"保存补卡")])])):we("",!0),l("div",Fy,[S[38]||(S[38]=l("div",{class:"sec-head"},[l("span",{class:"sec-title"},"新增工作记录"),l("span",{class:"muted form-hint"},"内容必填,其余选填")],-1)),l("div",Vy,[l("div",By,[S[31]||(S[31]=l("label",null,"工作内容(必填)",-1)),Oe(l("input",{class:tt(["input",{invalid:Ne.value}]),"onUpdate:modelValue":S[11]||(S[11]=x=>pe.value=x),placeholder:"做了什么,一句话一条",onKeydown:Et(X,["enter"])},null,34),[[Fe,pe.value]]),Ne.value?(E(),A("div",Uy,z(Ne.value),1)):we("",!0)]),l("div",qy,[S[33]||(S[33]=l("label",null,"所属项目",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":S[12]||(S[12]=x=>dt.value=x)},[S[32]||(S[32]=l("option",{value:null},"无项目",-1)),(E(!0),A(Ke,null,at(O.value,x=>(E(),A("option",{key:x.id,value:x.id},z(x.name),9,Hy))),128))],512),[[Pn,dt.value]])]),l("div",Wy,[S[34]||(S[34]=l("label",null,"工作分类",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":S[13]||(S[13]=x=>je.value=x)},[(E(!0),A(Ke,null,at(t.value,x=>(E(),A("option",{key:x,value:x},z(x),9,zy))),128))],512),[[Pn,je.value]])]),l("div",Gy,[S[35]||(S[35]=l("label",null,"耗时(分钟)",-1)),Oe(l("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":S[14]||(S[14]=x=>fe.value=x),placeholder:"选填"},null,512),[[Fe,fe.value,void 0,{number:!0}]])]),l("div",Yy,[S[36]||(S[36]=l("label",null,"主要收获",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":S[15]||(S[15]=x=>De.value=x),placeholder:"一句话:学到了什么"},null,512),[[Fe,De.value]])]),l("div",Jy,[S[37]||(S[37]=l("label",null,"备注",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":S[16]||(S[16]=x=>rt.value=x),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Fe,rt.value]])])]),l("div",Xy,[l("button",{class:"btn btn-sm",disabled:!b.value,onClick:_},"重置",8,Qy),l("button",{class:"btn btn-primary btn-sm",disabled:Ve.value,onClick:X},"添加记录",8,Zy)])]),l("div",eg,[l("div",tg,"工作记录("+z(c.value.length)+")",1),!c.value.length&&!r.value?(E(),A("div",ng,"暂无记录")):we("",!0),(E(!0),A(Ke,null,at(c.value,x=>(E(),A("div",{key:x.id,class:"item"},[l("div",sg,[l("span",rg,z(cn(Li)(x.category)),1),l("span",{class:"item-content",title:"点击编辑",onClick:Z=>H(x)},z(x.content),9,og),x.project_id?(E(),A("span",ag,z(B(x.project_id)),1)):we("",!0),x.minutes?(E(),A("span",ig,z(x.minutes)+" 分钟",1)):we("",!0),S[39]||(S[39]=l("span",{class:"flex1"},null,-1)),l("button",{class:"icon-btn",title:"编辑完整信息",onClick:Z=>H(x)},[Me(et,{name:"edit",size:14})],8,lg),l("button",{class:tt(["icon-btn",{active:x.is_milestone===1}]),title:"成果标记",onClick:Z=>Se(x)},[Me(et,{name:"star",size:14})],10,ug),l("button",{class:tt(["icon-btn",{"active-warn":x.needs_followup===1}]),title:"待跟进",onClick:Z=>Ee(x)},[Me(et,{name:"flag",size:14})],10,cg),l("button",{class:"icon-btn",title:"删除",onClick:Z=>ge.value=x},[Me(et,{name:"close",size:14})],8,dg)]),x.takeaway||x.remark?(E(),A("div",fg,[x.takeaway?(E(),A("div",pg,"收获:"+z(x.takeaway),1)):we("",!0),x.remark?(E(),A("div",vg,"备注:"+z(x.remark),1)):we("",!0)])):we("",!0)]))),128)),c.value.length?(E(),A("div",mg,[Pt(" 共 "+z(c.value.length)+" 条事项 ",1),se.value?(E(),A(Ke,{key:0},[Pt(" · "+z((se.value/60).toFixed(1))+" 小时",1)],64)):we("",!0)])):we("",!0)]),Me(qn,{open:!!ge.value,title:"删除确认",message:ge.value?"将删除工作记录「"+ge.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:S[17]||(S[17]=x=>ge.value=null),onConfirm:ce},null,8,["open","message"]),Me(qn,{open:U.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:S[18]||(S[18]=x=>U.value=!1),onConfirm:S[19]||(S[19]=x=>ne(!0))},null,8,["open"]),Me(sy,{open:!!de.value,item:de.value,projects:f.value,date:e.date,onCancel:S[20]||(S[20]=x=>de.value=null),onSave:ie},null,8,["open","item","projects","date"])]))}}),Pd=Ut(hg,[["__scopeId","data-v-de6fe794"]]),yg={class:"cal-page"},gg={class:"cal-toolbar"},bg={class:"cal-title num"},wg={class:"cal-head"},_g={class:"cal-grid"},kg=["title","onClick"],xg={class:"cal-marks"},Cg={key:0,class:"drawer"},$g={class:"drawer-head"},Sg={class:"drawer-body"},Eg=Ft({__name:"CalendarView",setup(e){const t=P(bt()),n=it(()=>Number(t.value.slice(0,4))),r=it(()=>Number(t.value.slice(5,7))-1),o=it(()=>n.value+" 年 "+(r.value+1)+" 月"),i=["一","二","三","四","五","六","日"],c=it(()=>{const T=(new Date(n.value,r.value,1).getDay()+6)%7,U=new Date(n.value,r.value+1,0).getDate(),J=[];for(let Y=0;Y<T;Y++)J.push({date:"",inMonth:!1,weekend:!1});for(let Y=1;Y<=U;Y++){const ne=new Date(n.value,r.value,Y),$=ne.getDay();J.push({date:Bn(ne),inMonth:!0,weekend:$===0||$===6})}return J}),f=P(new Map),v=bt();async function y(){var R;const V=Bn(new Date(n.value,r.value,1)),T=Bn(new Date(n.value,r.value+1,0)),U=await Promise.all([Ks(),Ca(V,T),Hr(V,T)]),J=U[0],Y=new Map(U[1].map(F=>[F.date,F])),ne=U[2],$=new Map;for(const F of c.value){if(!F.inMonth)continue;const ee=Xr(Y.get(F.date),F.date,J,F.date===v),Ie=ne.filter(Pe=>Pe.date===F.date);$.set(F.date,{status:ee.status,label:ee.label,location:((R=Y.get(F.date))==null?void 0:R.location)||"",hasLog:Ie.length>0,hasMilestone:Ie.some(Pe=>Pe.is_milestone===1)})}f.value=$}wt([n,r],y,{immediate:!0}),wt(ur,()=>{y()});function h(V){var T;return((T=f.value.get(V))==null?void 0:T.status)??""}function w(V){const T=f.value.get(V);return T?V+" · "+T.label+(T.location?" · "+T.location:""):V}function C(V){var T;return!!((T=f.value.get(V))!=null&&T.hasLog)}function O(V){var T;return!!((T=f.value.get(V))!=null&&T.hasMilestone)}function B(){t.value=ea(t.value,-1)}function te(){t.value=ea(t.value,1)}function se(){t.value=bt()}const ae=P(null);function re(V,T){T&&(ae.value=V)}return wt(Fi,V=>{V&&(t.value=V,ae.value=V,Fi.value=null)},{immediate:!0}),(V,T)=>(E(),A("div",yg,[l("div",gg,[l("button",{class:"icon-btn",onClick:B},[Me(et,{name:"chevron-left",size:16})]),l("span",bg,z(o.value),1),l("button",{class:"icon-btn",onClick:te},[Me(et,{name:"chevron-right",size:16})]),l("button",{class:"btn btn-sm",onClick:se},"回到今天")]),l("div",wg,[(E(),A(Ke,null,at(i,U=>l("span",{key:U,class:"cal-week muted"},z(U),1)),64))]),l("div",_g,[(E(!0),A(Ke,null,at(c.value,(U,J)=>(E(),A("button",{key:J,class:tt(["cal-cell",{blank:!U.inMonth,weekend:U.weekend,selected:ae.value===U.date}]),title:U.inMonth?w(U.date):void 0,onClick:Y=>re(U.date,U.inMonth)},[U.inMonth?(E(),A(Ke,{key:0},[l("span",{class:tt(["daynum num",{today:U.date===cn(v)}])},z(Number(U.date.slice(8,10))),3),l("span",xg,[h(U.date)?(E(),A("span",{key:0,class:tt(["dot",h(U.date)])},null,2)):we("",!0),C(U.date)?(E(),At(et,{key:1,name:"check-circle",size:12,class:"mark-log"})):we("",!0),O(U.date)?(E(),At(et,{key:2,name:"star",size:12,class:"mark-star"})):we("",!0)])],64)):we("",!0)],10,kg))),128))]),Me(lr,{name:"drawer"},{default:vs(()=>[ae.value?(E(),A("aside",Cg,[l("div",$g,[T[1]||(T[1]=l("span",{class:"drawer-title"},"当日详情",-1)),l("button",{class:"icon-btn",onClick:T[0]||(T[0]=U=>ae.value=null)},[Me(et,{name:"close",size:16})])]),l("div",Sg,[Me(Pd,{date:ae.value},null,8,["date"])])])):we("",!0)]),_:1})]))}}),Tg=Ut(Eg,[["__scopeId","data-v-2404dfbe"]]),Ag={class:"detail-page"},Pg={class:"detail-toolbar"},Og=["value"],Mg=["disabled"],Ig=Ft({__name:"TodayView",setup(e){const t=P(bt()),n=it(()=>t.value===bt());function r(){t.value=on(t.value,-1)}function o(){t.value=on(t.value,1)}function i(){t.value=bt()}function c(f){const v=f.target.value;v&&(t.value=v)}return(f,v)=>(E(),A("div",Ag,[l("div",Pg,[l("button",{class:"icon-btn",title:"前一天",onClick:r},[Me(et,{name:"chevron-left",size:16})]),l("span",{class:tt(["date-title num",{"is-today":n.value}])},z(cn(ud)(t.value)),3),l("button",{class:"icon-btn",title:"后一天",onClick:o},[Me(et,{name:"chevron-right",size:16})]),l("input",{type:"date",class:"input w-date",value:t.value,onChange:c},null,40,Og),l("button",{class:"btn btn-sm",disabled:n.value,onClick:i},"回到今天",8,Mg)]),Me(Pd,{date:t.value},null,8,["date"])]))}}),jg=Ut(Ig,[["__scopeId","data-v-76243d98"]]),Dg={class:"plan-page"},Lg={class:"card sec plan-head"},Kg={class:"nav-row"},Rg={class:"date-box"},Ng={class:"date-main num"},Fg={class:"muted date-sub num"},Vg={class:"muted sum-line"},Bg={class:"plan-list"},Ug={key:0,class:"card sec empty muted"},qg={class:"pi-time num"},Hg={class:"muted"},Wg={class:"pi-main"},zg={class:"pi-title"},Gg={class:"tag"},Yg={key:0,class:"state-done"},Jg={key:1,class:"state-skip"},Xg={key:0,class:"muted pi-note"},Qg={class:"muted pi-meta num"},Zg={key:0,class:"timer-live"},eb={class:"pi-ops"},tb=["onClick"],nb=["onClick"],sb=["onClick"],rb=["onClick"],ob=["onClick"],ab=["onClick"],ib={class:"dialog",role:"dialog","aria-label":"计划"},lb={class:"dialog-head"},ub={class:"dialog-title"},cb={class:"dialog-body"},db={class:"form-row"},fb={class:"form-row"},pb=["value"],vb={class:"form-row two"},mb={class:"form-row"},hb={key:0,class:"form-error"},yb={class:"dialog-btns"},gb=Ft({__name:"PlanView",setup(e){const t=P(bt()),n=P([]),r=P(!0),o=P(Date.now());let i=null;const c=it(()=>t.value===bt());async function f(){r.value=!0,n.value=await yh(t.value),r.value=!1}wt(t,f),wt(ur,f),an(()=>{f(),i=window.setInterval(()=>{o.value=Date.now()},3e4)}),Wn(()=>{i&&window.clearInterval(i)});function v(){t.value=on(t.value,-1)}function y(){t.value=on(t.value,1)}function h(){t.value=bt()}const w=it(()=>{const xe=n.value.length,me=n.value.filter(Ae=>Ae.status==="done").length,_e=n.value.reduce((Ae,pe)=>Ae+C(pe),0),We=n.value.reduce((Ae,pe)=>Ae+(pe.actual_minutes||0),0),Xe=B.value;if(Xe){const Ae=n.value.find(pe=>pe.id===Xe);Ae&&We+elapsedMinutes(Ae)}return{total:xe,done:me,plannedMin:_e,actualMin:We}});function C(xe){const[me,_e]=xe.start_time.split(":").map(Number),[We,Xe]=xe.end_time.split(":").map(Number);return Math.max(0,We*60+Xe-(me*60+_e))}function O(xe){return xe<60?xe+" 分钟":Math.floor(xe/60)+" 小时 "+xe%60+" 分"}const B=it(()=>{const xe=n.value.find(me=>!!me.timer_started_at);return xe?xe.id:null});function te(xe){if(!xe.timer_started_at)return xe.actual_minutes||0;const me=Math.max(0,Math.round((o.value-new Date(xe.timer_started_at).getTime())/6e4));return(xe.actual_minutes||0)+me}async function se(xe){xe.timer_started_at?(await yl(xe.id),He("已停止计时:"+xe.title)):(await kh(xe.id),He("开始计时:"+xe.title)),await f()}async function ae(xe,me){await _h(xe.id,me),await f()}const re=P(!1),V=P(null),T=P(""),U=P("学习"),J=P("09:00"),Y=P("10:00"),ne=P(""),$=P(""),R=["学习","健身","自律","工作","阅读","其他"];function F(){V.value=null,T.value="",U.value="学习",J.value="09:00",Y.value="10:00",ne.value="",$.value="",re.value=!0}function ee(xe){V.value=xe.id,T.value=xe.title,U.value=xe.kind,J.value=xe.start_time,Y.value=xe.end_time,ne.value=xe.note||"",$.value="",re.value=!0}async function Ie(){if(!T.value.trim()){$.value="请填写计划内容";return}if(Y.value<=J.value){$.value="结束时间需晚于开始时间";return}V.value?(await bh(V.value,{title:T.value.trim(),kind:U.value,start_time:J.value,end_time:Y.value,note:ne.value}),He("计划已更新")):(await gh({date:t.value,start_time:J.value,end_time:Y.value,title:T.value,kind:U.value,note:ne.value}),He("计划已添加")),re.value=!1,await f()}async function Pe(xe){await wh(xe.id),He("已删除"),await f()}const ke=["周日","周一","周二","周三","周四","周五","周六"];function Re(xe){return ke[Rs(xe).getDay()]}return(xe,me)=>(E(),A("div",Dg,[l("div",Lg,[l("div",Kg,[l("button",{class:"icon-btn",onClick:v},[Me(et,{name:"chevron-left",size:16})]),l("div",Rg,[l("span",Ng,z(t.value.slice(5))+" "+z(Re(t.value)),1),l("span",Fg,z(t.value),1)]),l("button",{class:"icon-btn",onClick:y},[Me(et,{name:"chevron-right",size:16})]),l("button",{class:tt(["btn btn-sm",{"btn-primary":!c.value}]),onClick:h},"今天",2),me[9]||(me[9]=l("span",{class:"flex1"},null,-1)),l("button",{class:"btn btn-primary btn-sm",onClick:F},[Me(et,{name:"plus",size:14}),me[8]||(me[8]=Pt(" 添加计划",-1))])]),l("div",Vg,[Pt(" 共 "+z(w.value.total)+" 项 · 完成 "+z(w.value.done)+" 项 · 计划 "+z(O(w.value.plannedMin))+" · 实际投入 "+z(O(w.value.actualMin))+" ",1),B.value?(E(),A(Ke,{key:0},[me[10]||(me[10]=Pt(" · ",-1)),me[11]||(me[11]=l("span",{class:"timer-live"},"计时中",-1))],64)):we("",!0)])]),l("div",Bg,[!r.value&&!n.value.length?(E(),A("div",Ug," 今天还没有计划,点右上角「添加计划」开始规划:学习、健身、自律…… ")):we("",!0),(E(!0),A(Ke,null,at(n.value,_e=>(E(),A("div",{key:_e.id,class:tt(["card sec plan-item",{done:_e.status==="done",skip:_e.status==="skip",running:!!_e.timer_started_at}])},[l("div",qg,[Pt(z(_e.start_time),1),l("span",Hg," - "+z(_e.end_time),1)]),l("div",Wg,[l("div",zg,[l("span",Gg,z(_e.kind),1),l("span",{class:tt(["pi-text",{strike:_e.status==="done"}])},z(_e.title),3),_e.status==="done"?(E(),A("span",Yg,"已完成")):_e.status==="skip"?(E(),A("span",Jg,"已跳过")):we("",!0)]),_e.note?(E(),A("div",Xg,z(_e.note),1)):we("",!0),l("div",Qg,[_e.timer_started_at?(E(),A("span",Zg,"计时中 · 已 "+z(te(_e))+" 分钟",1)):_e.actual_minutes>0?(E(),A(Ke,{key:1},[Pt("实际投入 "+z(_e.actual_minutes)+" 分钟",1)],64)):we("",!0)])]),l("div",eb,[_e.status!=="done"?(E(),A("button",{key:0,class:tt(["btn btn-xs",{"timer-on":!!_e.timer_started_at}]),onClick:We=>se(_e)},z(_e.timer_started_at?"停止计时":"计时"),11,tb)):we("",!0),_e.status!=="done"?(E(),A("button",{key:1,class:"btn btn-xs",onClick:We=>ae(_e,"done")},"完成",8,nb)):we("",!0),_e.status==="todo"?(E(),A("button",{key:2,class:"btn btn-xs",onClick:We=>ae(_e,"skip")},"跳过",8,sb)):we("",!0),_e.status!=="todo"?(E(),A("button",{key:3,class:"btn btn-xs",onClick:We=>ae(_e,"todo")},"恢复",8,rb)):we("",!0),l("button",{class:"icon-btn",title:"编辑",onClick:We=>ee(_e)},[Me(et,{name:"edit",size:14})],8,ob),l("button",{class:"icon-btn",title:"删除",onClick:We=>Pe(_e)},[Me(et,{name:"close",size:14})],8,ab)])],2))),128))]),(E(),At(cs,{to:"body"},[re.value?(E(),A("div",{key:0,class:"fixed-mask",onClick:me[7]||(me[7]=en(_e=>re.value=!1,["self"]))},[l("div",ib,[l("div",lb,[l("span",ub,z(V.value?"编辑计划":"添加计划"),1),l("button",{class:"icon-btn",onClick:me[0]||(me[0]=_e=>re.value=!1)},[Me(et,{name:"close",size:16})])]),l("div",cb,[l("div",db,[me[12]||(me[12]=l("label",null,"计划内容(学什么、做什么)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":me[1]||(me[1]=_e=>T.value=_e),placeholder:"如:产品文档第三章 / 晨跑 5 公里",onKeydown:Et(Ie,["enter"])},null,544),[[Fe,T.value]])]),l("div",fb,[me[13]||(me[13]=l("label",null,"类别",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":me[2]||(me[2]=_e=>U.value=_e)},[(E(),A(Ke,null,at(R,_e=>l("option",{key:_e,value:_e},z(_e),9,pb)),64))],512),[[Pn,U.value]])]),l("div",vb,[l("div",null,[me[14]||(me[14]=l("label",null,"开始时间",-1)),Oe(l("input",{class:"input",type:"time","onUpdate:modelValue":me[3]||(me[3]=_e=>J.value=_e)},null,512),[[Fe,J.value]])]),l("div",null,[me[15]||(me[15]=l("label",null,"结束时间",-1)),Oe(l("input",{class:"input",type:"time","onUpdate:modelValue":me[4]||(me[4]=_e=>Y.value=_e)},null,512),[[Fe,Y.value]])])]),l("div",mb,[me[16]||(me[16]=l("label",null,"备注(选填)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":me[5]||(me[5]=_e=>ne.value=_e),placeholder:"目标、资料、提醒等",onKeydown:Et(Ie,["enter"])},null,544),[[Fe,ne.value]])]),$.value?(E(),A("div",hb,z($.value),1)):we("",!0)]),l("div",yb,[l("button",{class:"btn btn-sm",onClick:me[6]||(me[6]=_e=>re.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:Ie},z(V.value?"保存":"添加"),1)])])])):we("",!0)]))]))}}),bb=Ut(gb,[["__scopeId","data-v-dd89fae2"]]),wb={class:"stats"},_b={class:"cards"},kb={class:"card stat-card"},xb={class:"stat-num num"},Cb={class:"card stat-card"},$b={class:"stat-num num"},Sb={class:"card stat-card"},Eb={class:"stat-num num"},Tb={class:"card stat-card"},Ab={class:"stat-num num"},Pb={class:"card section"},Ob={class:"heat"},Mb=["title"],Ib={class:"two-col"},jb={class:"card section"},Db={class:"bar-label"},Lb={class:"bar-track"},Kb={class:"muted num bar-num"},Rb={key:0,class:"muted"},Nb={class:"card section"},Fb={class:"bar-label"},Vb={class:"bar-track"},Bb={class:"muted num bar-num"},Ub={key:0,class:"muted"},qb={class:"card section"},Hb={class:"bar-label loc-label"},Wb={class:"bar-track"},zb={class:"muted num bar-num"},Gb={key:0,class:"muted"},Yb=Ft({__name:"StatsView",setup(e){const t=P({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=P([]),r=P([]),o=P([]),i=P([]);async function c(){const y=bt(),h="2000-01-01",w=await Promise.all([Ks(),Ca(h,y),Hr(h,y),nr(!0)]),C=w[0],O=w[1],B=w[2],te=w[3],se=O.filter(ke=>ke.clock_in_at||ke.kind==="makeup");let ae=0;for(const ke of se){const Re=Xr(ke,ke.date,C,ke.date===y);ae+=Re.workedMinutes??0}const re=new Set(B.map(ke=>ke.date));let V=0,T=y;for(re.has(T)||(T=on(y,-1));re.has(T);)V++,T=on(T,-1);t.value={attendDays:se.length,totalHours:(ae/60).toFixed(1),itemCount:B.length,streak:V};const U=new Map;for(const ke of se){const Re=ke.location||"未记录";U.set(Re,(U.get(Re)||0)+1)}i.value=Array.from(U.entries()).map(ke=>({name:ke[0],count:ke[1],percent:Math.round(ke[1]/(se.length||1)*100)})).sort((ke,Re)=>Re.count-ke.count);const J=B.length||1,Y=await Jr(),ne=new Map;for(const ke of B)ne.set(ke.category,(ne.get(ke.category)||0)+1);const $=new Set(Y);for(const ke of ne.keys())$.has(ke)||Y.push(ke);r.value=Y.map(ke=>{const Re=ne.get(ke)||0;return{key:ke,label:ke,count:Re,percent:Math.round(Re/J*100)}}).filter(ke=>ke.count>0).sort((ke,Re)=>Re.count-ke.count);const R=new Map(te.map(ke=>[ke.id,ke.name])),F=new Map;for(const ke of B){const Re=ke.project_id?R.get(ke.project_id)||"已删除项目":"无项目";F.set(Re,(F.get(Re)||0)+1)}o.value=Array.from(F.entries()).map(ke=>({name:ke[0],count:ke[1],percent:Math.round(ke[1]/J*100)})).sort((ke,Re)=>Re.count-ke.count);const ee=new Map;for(const ke of B)ee.set(ke.date,(ee.get(ke.date)||0)+1);const Ie=Qs(y),Pe=[];for(let ke=11;ke>=0;ke--){const Re=on(Ie,-7*ke),xe=[];for(let me=0;me<7;me++){const _e=on(Re,me);xe.push({date:_e,count:ee.get(_e)||0})}Pe.push(xe)}n.value=Pe}an(async()=>{await c()}),wt(ur,()=>{c()});function f(y){return y===0?0:y===1?1:y<=3?2:y<=5?3:4}function v(y,h){return y+" · "+(h?h+" 条":"无记录")}return(y,h)=>(E(),A("div",wb,[l("div",_b,[l("div",kb,[h[0]||(h[0]=l("div",{class:"muted"},"出勤天数",-1)),l("div",xb,z(t.value.attendDays),1)]),l("div",Cb,[h[1]||(h[1]=l("div",{class:"muted"},"累计工时(小时)",-1)),l("div",$b,z(t.value.totalHours),1)]),l("div",Sb,[h[2]||(h[2]=l("div",{class:"muted"},"记录条数",-1)),l("div",Eb,z(t.value.itemCount),1)]),l("div",Tb,[h[3]||(h[3]=l("div",{class:"muted"},"连续记录(天)",-1)),l("div",Ab,z(t.value.streak),1)])]),l("div",Pb,[h[4]||(h[4]=l("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),l("div",Ob,[(E(!0),A(Ke,null,at(n.value,(w,C)=>(E(),A("div",{key:C,class:"heat-col"},[(E(!0),A(Ke,null,at(w,O=>(E(),A("span",{key:O.date,class:tt(["heat-cell","lv"+f(O.count)]),title:v(O.date,O.count)},null,10,Mb))),128))]))),128))]),h[5]||(h[5]=Hp('<div class="heat-legend muted" data-v-f8410651><span data-v-f8410651>少</span><span class="heat-cell lv0" data-v-f8410651></span><span class="heat-cell lv1" data-v-f8410651></span><span class="heat-cell lv2" data-v-f8410651></span><span class="heat-cell lv3" data-v-f8410651></span><span class="heat-cell lv4" data-v-f8410651></span><span data-v-f8410651>多</span></div>',1))]),l("div",Ib,[l("div",jb,[h[6]||(h[6]=l("div",{class:"section-title"},"分类分布",-1)),(E(!0),A(Ke,null,at(r.value,w=>(E(),A("div",{key:w.key,class:"bar-row"},[l("span",Db,z(w.label),1),l("span",Lb,[l("span",{class:"bar-fill",style:as({width:w.percent+"%"})},null,4)]),l("span",Kb,z(w.count)+" 条 · "+z(w.percent)+"%",1)]))),128)),r.value.length?we("",!0):(E(),A("div",Rb,"暂无数据"))]),l("div",Nb,[h[7]||(h[7]=l("div",{class:"section-title"},"项目投入",-1)),(E(!0),A(Ke,null,at(o.value,w=>(E(),A("div",{key:w.name,class:"bar-row"},[l("span",Fb,z(w.name),1),l("span",Vb,[l("span",{class:"bar-fill",style:as({width:w.percent+"%"})},null,4)]),l("span",Bb,z(w.count)+" 条 · "+z(w.percent)+"%",1)]))),128)),o.value.length?we("",!0):(E(),A("div",Ub,"暂无数据"))])]),l("div",qb,[h[8]||(h[8]=l("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(E(!0),A(Ke,null,at(i.value,w=>(E(),A("div",{key:w.name,class:"bar-row"},[l("span",Hb,z(w.name),1),l("span",Wb,[l("span",{class:"bar-fill",style:as({width:w.percent+"%"})},null,4)]),l("span",zb,z(w.count)+" 天 · "+z(w.percent)+"%",1)]))),128)),i.value.length?we("",!0):(E(),A("div",Gb,"暂无数据"))])]))}}),Jb=Ut(Yb,[["__scopeId","data-v-f8410651"]]);async function Xb(e,t,n){const r=bt(),o=await Promise.all([Ks(),Ca(e,t),Hr(e,t),nr(!0),hh(e,t),Jr()]),i=o[0],c=o[1],f=o[2],v=o[3],y=o[4],h=o[5];let w=0,C=0,O=0;for(const F of c){(F.clock_in_at||F.kind==="makeup")&&w++,F.kind==="makeup"&&O++;const ee=Xr(F,F.date,i,F.date===r);C+=ee.workedMinutes??0}const B=new Map;for(const F of c){if(!(F.clock_in_at||F.kind==="makeup"))continue;const ee=F.location||"未记录";B.set(ee,(B.get(ee)||0)+1)}const te=Array.from(B.entries()).map(F=>({name:F[0],count:F[1]})).sort((F,ee)=>ee.count-F.count),se=f.length||1,ae=new Map;for(const F of f)ae.set(F.category,(ae.get(F.category)||0)+1);const re=new Set(h);for(const F of ae.keys())re.has(F)||h.push(F);const V=h.map(F=>{const ee=ae.get(F)||0;return{key:F,label:F,count:ee,percent:Math.round(ee/se*100)}}).filter(F=>F.count>0).sort((F,ee)=>ee.count-F.count),T=new Map(v.map(F=>[F.id,F.name])),U=new Map;for(const F of f){const ee=F.project_id?T.get(F.project_id)||"已删除项目":"无项目";U.set(ee,(U.get(ee)||0)+1)}const J=Array.from(U.entries()).map(F=>({name:F[0],count:F[1]})).sort((F,ee)=>ee.count-F.count),Y=f.filter(F=>F.is_milestone===1).map(F=>({date:F.date,content:F.content})),ne=f.filter(F=>F.needs_followup===1).map(F=>({date:F.date,content:F.content,remark:F.remark||""})),$=f.filter(F=>!!F.takeaway).map(F=>({date:F.date,text:F.takeaway})),R=y.map(F=>({weekStart:F.week_start,highlights:F.highlights||"",challenges:F.challenges||"",plan_next:F.plan_next||""}));return{range:{start:e,end:t,label:n},attendDays:w,totalHours:(C/60).toFixed(1),makeupCount:O,leaveCount:c.filter(F=>F.kind==="leave").length,itemCount:f.length,categoryStats:V,projectStats:J,locationStats:te,milestones:Y,followups:ne,takeaways:$,weekNotes:R}}function Qb(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(r=>r.name!=="未记录");n.length&&t.push("其中:"+n.map(r=>r.name+" "+r.count+" 天").join(",")),t.push(""),t.push("## 二、工作内容分布"),t.push(""),t.push(e.categoryStats.length?e.categoryStats.map(r=>r.label+" "+r.percent+"%("+r.count+" 条)").join(","):"(无记录)"),t.push(""),t.push("## 三、项目投入"),t.push(""),t.push(e.projectStats.length?e.projectStats.map(r=>r.name+" "+r.count+" 条").join(","):"(无记录)"),t.push(""),t.push("## 四、主要成果"),t.push(""),e.milestones.length?e.milestones.forEach((r,o)=>t.push(o+1+". 【成果】"+r.content+"("+r.date+")")):t.push("(无)"),t.push(""),t.push("## 五、待跟进事项"),t.push(""),e.followups.length?e.followups.forEach(r=>t.push("- 【待跟进】"+r.content+(r.remark?"("+r.date+" 备注:"+r.remark+")":"("+r.date+")"))):t.push("(无)"),t.push(""),t.push("## 六、学习与成长"),t.push(""),e.takeaways.length?e.takeaways.forEach(r=>t.push("- "+r.text+"("+r.date+")")):t.push("(无)");for(const r of e.weekNotes)t.push(""),t.push("### 周记("+r.weekStart+" 起)"),t.push(""),t.push("- 本周亮点:"+(r.highlights||"(无)")),t.push("- 踩的坑:"+(r.challenges||"(无)")),t.push("- 下周计划:"+(r.plan_next||"(无)"));return t.push(""),t.join(`
`)}const Zb="modulepreload",ew=function(e,t){return new URL(e,t).href},Vu={},Od=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),v=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=Promise.allSettled(n.map(y=>{if(y=ew(y,r),y in Vu)return;Vu[y]=!0;const h=y.endsWith(".css"),w=h?'[rel="stylesheet"]':"";if(!!r)for(let B=c.length-1;B>=0;B--){const te=c[B];if(te.href===y&&(!h||te.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${w}`))return;const O=document.createElement("link");if(O.rel=h?"stylesheet":Zb,h||(O.as="script"),O.crossOrigin="",O.href=y,v&&O.setAttribute("nonce",v),document.head.appendChild(O),h)return new Promise((B,te)=>{O.addEventListener("load",B),O.addEventListener("error",()=>te(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return o.then(c=>{for(const f of c||[])f.status==="rejected"&&i(f.reason);return t().catch(i)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const tw=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},r=(i,c)=>{n.platforms.set(i,c)},o=i=>{n.platforms.has(i)&&(n.currentPlatform=n.platforms.get(i))};return n.addPlatform=r,n.setPlatform=o,n},nw=e=>e.CapacitorPlatforms=tw(e),Md=nw(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});Md.addPlatform;Md.setPlatform;var or;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(or||(or={}));class gi extends Error{constructor(t,n,r){super(t),this.message=t,this.code=n,this.data=r}}const sw=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"},rw=e=>{var t,n,r,o,i;const c=e.CapacitorCustomPlatform||null,f=e.Capacitor||{},v=f.Plugins=f.Plugins||{},y=e.CapacitorPlatforms,h=()=>c!==null?c.name:sw(e),w=((t=y==null?void 0:y.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||h,C=()=>w()!=="web",O=((n=y==null?void 0:y.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||C,B=Y=>{const ne=T.get(Y);return!!(ne!=null&&ne.platforms.has(w())||ae(Y))},te=((r=y==null?void 0:y.currentPlatform)===null||r===void 0?void 0:r.isPluginAvailable)||B,se=Y=>{var ne;return(ne=f.PluginHeaders)===null||ne===void 0?void 0:ne.find($=>$.name===Y)},ae=((o=y==null?void 0:y.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||se,re=Y=>e.console.error(Y),V=(Y,ne,$)=>Promise.reject(`${$} does not have an implementation of "${ne}".`),T=new Map,U=(Y,ne={})=>{const $=T.get(Y);if($)return console.warn(`Capacitor plugin "${Y}" already registered. Cannot register plugins twice.`),$.proxy;const R=w(),F=ae(Y);let ee;const Ie=async()=>(!ee&&R in ne?ee=typeof ne[R]=="function"?ee=await ne[R]():ee=ne[R]:c!==null&&!ee&&"web"in ne&&(ee=typeof ne.web=="function"?ee=await ne.web():ee=ne.web),ee),Pe=(We,Xe)=>{var Ae,pe;if(F){const Ne=F==null?void 0:F.methods.find(dt=>Xe===dt.name);if(Ne)return Ne.rtype==="promise"?dt=>f.nativePromise(Y,Xe.toString(),dt):(dt,je)=>f.nativeCallback(Y,Xe.toString(),dt,je);if(We)return(Ae=We[Xe])===null||Ae===void 0?void 0:Ae.bind(We)}else{if(We)return(pe=We[Xe])===null||pe===void 0?void 0:pe.bind(We);throw new gi(`"${Y}" plugin is not implemented on ${R}`,or.Unimplemented)}},ke=We=>{let Xe;const Ae=(...pe)=>{const Ne=Ie().then(dt=>{const je=Pe(dt,We);if(je){const fe=je(...pe);return Xe=fe==null?void 0:fe.remove,fe}else throw new gi(`"${Y}.${We}()" is not implemented on ${R}`,or.Unimplemented)});return We==="addListener"&&(Ne.remove=async()=>Xe()),Ne};return Ae.toString=()=>`${We.toString()}() { [capacitor code] }`,Object.defineProperty(Ae,"name",{value:We,writable:!1,configurable:!1}),Ae},Re=ke("addListener"),xe=ke("removeListener"),me=(We,Xe)=>{const Ae=Re({eventName:We},Xe),pe=async()=>{const dt=await Ae;xe({eventName:We,callbackId:dt},Xe)},Ne=new Promise(dt=>Ae.then(()=>dt({remove:pe})));return Ne.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await pe()},Ne},_e=new Proxy({},{get(We,Xe){switch(Xe){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return F?me:Re;case"removeListener":return xe;default:return ke(Xe)}}});return v[Y]=_e,T.set(Y,{name:Y,proxy:_e,platforms:new Set([...Object.keys(ne),...F?[R]:[]])}),_e},J=((i=y==null?void 0:y.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||U;return f.convertFileSrc||(f.convertFileSrc=Y=>Y),f.getPlatform=w,f.handleError=re,f.isNativePlatform=O,f.isPluginAvailable=te,f.pluginMethodNoop=V,f.registerPlugin=J,f.Exception=gi,f.DEBUG=!!f.DEBUG,f.isLoggingEnabled=!!f.isLoggingEnabled,f.platform=f.getPlatform(),f.isNative=f.isNativePlatform(),f},ow=e=>e.Capacitor=rw(e),ar=ow(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Id=ar.registerPlugin;ar.Plugins;class jd{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 r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(n);const i=this.windowListeners[t];i&&!i.registered&&this.addWindowListener(i),r&&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,r){const o=this.listeners[t];if(!o){if(r){let i=this.retainedEventArguments[t];i||(i=[]),i.push(n),this.retainedEventArguments[t]=i}return}o.forEach(i=>i(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(t="not implemented"){return new ar.Exception(t,or.Unimplemented)}unavailable(t="not available"){return new ar.Exception(t,or.Unavailable)}async removeListener(t,n){const r=this.listeners[t];if(!r)return;const o=r.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(r=>{this.notifyListeners(t,r)}))}}const Bu=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Uu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class aw extends jd{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[o,i]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=Uu(o).trim(),i=Uu(i).trim(),n[o]=i}),n}async setCookie(t){try{const n=Bu(t.key),r=Bu(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,i=(t.path||"/").replace("path=",""),c=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${r||""}${o}; path=${i}; ${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)}}}Id("CapacitorCookies",{web:()=>new aw});const iw=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const o=r.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},r.onerror=o=>n(o),r.readAsDataURL(e)}),lw=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,i,c)=>(o[i]=e[t[c]],o),{})},uw=(e,t=!0)=>e?Object.entries(e).reduce((r,o)=>{const[i,c]=o;let f,v;return Array.isArray(c)?(v="",c.forEach(y=>{f=t?encodeURIComponent(y):y,v+=`${i}=${f}&`}),v.slice(0,-1)):(f=t?encodeURIComponent(c):c,v=`${i}=${f}`),`${r}&${v}`},"").substr(1):null,cw=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=lw(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const i=new URLSearchParams;for(const[c,f]of Object.entries(e.data||{}))i.set(c,f);n.body=i.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const i=new FormData;if(e.data instanceof FormData)e.data.forEach((f,v)=>{i.append(v,f)});else for(const f of Object.keys(e.data))i.append(f,e.data[f]);n.body=i;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 dw extends jd{async request(t){const n=cw(t,t.webFetchExtra),r=uw(t.params,t.shouldEncodeUrlParams),o=r?`${t.url}?${r}`:t.url,i=await fetch(o,n),c=i.headers.get("content-type")||"";let{responseType:f="text"}=i.ok?t:{};c.includes("application/json")&&(f="json");let v,y;switch(f){case"arraybuffer":case"blob":y=await i.blob(),v=await iw(y);break;case"json":v=await i.json();break;case"document":case"text":default:v=await i.text()}const h={};return i.headers.forEach((w,C)=>{h[C]=w}),{data:v,headers:h,status:i.status,url:i.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"}))}}Id("CapacitorHttp",{web:()=>new dw});async function gl(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(ar.isNativePlatform()){const{Filesystem:c,Directory:f,Encoding:v}=await Od(async()=>{const{Filesystem:y,Directory:h,Encoding:w}=await import("./index-NiysaoXd.js");return{Filesystem:y,Directory:h,Encoding:w}},[],import.meta.url);try{return(await c.writeFile({path:e,data:t,directory:f.Documents,encoding:v.UTF8,recursive:!0})).uri}catch{return(await c.writeFile({path:e,data:t,directory:f.Cache,encoding:v.UTF8,recursive:!0})).uri}}const r=new Blob([t],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(r),i=document.createElement("a");return i.href=o,i.download=e,i.click(),window.setTimeout(()=>URL.revokeObjectURL(o),1e4),""}const fw=Object.freeze(Object.defineProperty({__proto__:null,downloadText:gl},Symbol.toStringTag,{value:"Module"}));async function Wi(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 pw(e){const t=await Promise.all([Ct("ai_base_url",""),Ct("ai_api_key",""),Ct("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),r=t[1].trim(),o=t[2].trim();if(!n||!o)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const i=n+"/chat/completions",c={"Content-Type":"application/json"};r&&(c.Authorization="Bearer "+r);const v=JSON.stringify({model:o,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let y;try{y=await fetch(i,{method:"POST",headers:c,body:v})}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 h=await y.json(),w=h&&h.choices&&h.choices[0]&&h.choices[0].message&&h.choices[0].message.content;if(!w)throw new Error("接口未返回内容");return String(w)}const vw={class:"report"},mw={class:"report-toolbar"},hw={class:"seg"},yw=["onClick"],gw=["disabled"],bw=["disabled"],ww={key:0,class:"ai-error"},_w={class:"report-grid"},kw={class:"report-left"},xw={class:"card section"},Cw={class:"section-title"},$w={class:"muted note-saved"},Sw={class:"card section"},Ew={class:"report-right"},Tw={key:0,class:"card section"},Aw={class:"sum-row"},Pw={class:"num"},Ow={class:"sum-row"},Mw={class:"num"},Iw={class:"sum-row"},jw={class:"num"},Dw={class:"sum-row"},Lw={class:"num"},Kw={class:"sum-row"},Rw={class:"num"},Nw={class:"muted"},Fw={class:"num"},Vw={key:0,class:"muted sum-empty"},Bw={class:"muted"},Uw={key:1,class:"muted sum-empty"},qw={class:"muted"},Hw={key:2,class:"muted sum-empty"},Ww={class:"muted"},zw={key:3,class:"muted sum-empty"},Gw=Ft({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=P("week"),r=P(Qs(bt())),o=P(bt()),i=P(null),c=P(""),f=P(!1),v=P(!1),y=P(null),h=P(""),w=P(Qs(bt())),C=P(""),O=P(""),B=P(""),te=P(!1);async function se(){const ne=await hl(w.value);C.value=(ne==null?void 0:ne.highlights)||"",O.value=(ne==null?void 0:ne.challenges)||"",B.value=(ne==null?void 0:ne.plan_next)||"",te.value=!1}async function ae(){await mh(w.value,{highlights:C.value.trim()||null,challenges:O.value.trim()||null,plan_next:B.value.trim()||null}),te.value=!0,await V()}function re(ne){const $=bt();if(ne==="week"){const R=Qs($);return{start:R,end:on(R,6),label:"本周"}}if(ne==="month"){const R=$.slice(0,7);return{start:R+"-01",end:$,label:R+" 本月"}}return ne==="all"?{start:"2000-01-01",end:$,label:"全部实习期"}:{start:r.value,end:o.value,label:r.value+" ~ "+o.value}}async function V(){f.value=!0;const ne=re(n.value),$=await Xb(ne.start,ne.end,ne.label);i.value=$,c.value=Qb($),f.value=!1}wt(n,V),wt([r,o],()=>{n.value==="custom"&&V()}),an(async()=>{await se(),await V()});async function T(){const ne=bt().replace(/-/g,""),$=await gl("实习工作总结_"+ne+".md",c.value);He($?"总结已导出到:"+$:"总结已导出到系统下载目录")}async function U(){await Wi(c.value),He("总结已复制到剪贴板")}async function J(){if(v.value)return;h.value="";const ne=c.value.trim();if(!ne){h.value="当前草稿为空,无法润色";return}v.value=!0;try{y.value=c.value,c.value=await pw(ne),He("AI 润色完成")}catch($){y.value=null,h.value=$ instanceof Error?$.message:"润色失败"}v.value=!1}function Y(){y.value!==null&&(c.value=y.value),y.value=null}return(ne,$)=>(E(),A("div",vw,[l("div",mw,[l("div",hw,[(E(),A(Ke,null,at(t,R=>l("button",{key:R.key,class:tt(["seg-btn",{active:n.value===R.key}]),onClick:F=>n.value=R.key},z(R.label),11,yw)),64))]),n.value==="custom"?(E(),A(Ke,{key:0},[Oe(l("input",{type:"date",class:"input w-date","onUpdate:modelValue":$[0]||($[0]=R=>r.value=R)},null,512),[[Fe,r.value]]),$[6]||($[6]=l("span",{class:"muted"},"至",-1)),Oe(l("input",{type:"date",class:"input w-date","onUpdate:modelValue":$[1]||($[1]=R=>o.value=R)},null,512),[[Fe,o.value]])],64)):we("",!0),$[10]||($[10]=l("span",{class:"flex1"},null,-1)),l("button",{class:"btn btn-sm",disabled:v.value,onClick:J},[Me(et,{name:"edit",size:14}),$[7]||($[7]=Pt("AI 润色 ",-1))],8,gw),y.value!==null?(E(),A("button",{key:1,class:"btn btn-sm",onClick:Y},"还原润色前")):we("",!0),l("button",{class:"btn btn-sm",disabled:f.value,onClick:V},[Me(et,{name:"edit",size:14}),$[8]||($[8]=Pt("重新生成 ",-1))],8,bw),l("button",{class:"btn btn-sm",onClick:U},"复制"),l("button",{class:"btn btn-primary btn-sm",onClick:T},[Me(et,{name:"export",size:14}),$[9]||($[9]=Pt("导出 Markdown ",-1))])]),h.value?(E(),A("div",ww,z(h.value),1)):we("",!0),l("div",_w,[l("div",kw,[l("div",xw,[l("div",Cw,"本周周记("+z(w.value)+" 起)",1),$[11]||($[11]=l("label",{class:"note-label muted"},"本周亮点",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":$[2]||($[2]=R=>C.value=R),placeholder:"本周最有价值的一件事",onBlur:ae},null,544),[[Fe,C.value]]),$[12]||($[12]=l("label",{class:"note-label muted"},"踩的坑",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":$[3]||($[3]=R=>O.value=R),placeholder:"遇到的问题与教训",onBlur:ae},null,544),[[Fe,O.value]]),$[13]||($[13]=l("label",{class:"note-label muted"},"下周计划",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":$[4]||($[4]=R=>B.value=R),placeholder:"下周准备做什么",onBlur:ae},null,544),[[Fe,B.value]]),l("div",$w,z(te.value?"已保存":"失焦自动保存"),1)]),l("div",Sw,[$[14]||($[14]=l("div",{class:"section-title"},"总结草稿(可编辑)",-1)),Oe(l("textarea",{class:"textarea md-editor","onUpdate:modelValue":$[5]||($[5]=R=>c.value=R),spellcheck:"false"},null,512),[[Fe,c.value]])])]),l("div",Ew,[i.value?(E(),A("div",Tw,[$[20]||($[20]=l("div",{class:"section-title"},"数据摘要",-1)),l("div",Aw,[$[15]||($[15]=l("span",{class:"muted"},"出勤",-1)),l("span",Pw,z(i.value.attendDays)+" 天",1)]),l("div",Ow,[$[16]||($[16]=l("span",{class:"muted"},"工时",-1)),l("span",Mw,z(i.value.totalHours)+" 小时",1)]),l("div",Iw,[$[17]||($[17]=l("span",{class:"muted"},"补卡",-1)),l("span",jw,z(i.value.makeupCount)+" 次",1)]),l("div",Dw,[$[18]||($[18]=l("span",{class:"muted"},"请假",-1)),l("span",Lw,z(i.value.leaveCount)+" 天",1)]),l("div",Kw,[$[19]||($[19]=l("span",{class:"muted"},"记录",-1)),l("span",Rw,z(i.value.itemCount)+" 条",1)]),$[21]||($[21]=l("div",{class:"section-sub"},"分类分布",-1)),(E(!0),A(Ke,null,at(i.value.categoryStats,R=>(E(),A("div",{key:R.key,class:"sum-row"},[l("span",Nw,z(R.label),1),l("span",Fw,z(R.count)+" 条 · "+z(R.percent)+"%",1)]))),128)),i.value.categoryStats.length?we("",!0):(E(),A("div",Vw,"(无)")),$[22]||($[22]=l("div",{class:"section-sub"},"主要成果",-1)),(E(!0),A(Ke,null,at(i.value.milestones,(R,F)=>(E(),A("div",{key:"m"+F,class:"sum-item"},[Pt(z(R.content),1),l("span",Bw,"("+z(R.date)+")",1)]))),128)),i.value.milestones.length?we("",!0):(E(),A("div",Uw,"(无)")),$[23]||($[23]=l("div",{class:"section-sub"},"待跟进",-1)),(E(!0),A(Ke,null,at(i.value.followups,(R,F)=>(E(),A("div",{key:"f"+F,class:"sum-item"},[Pt(z(R.content),1),l("span",qw,"("+z(R.date)+")",1)]))),128)),i.value.followups.length?we("",!0):(E(),A("div",Hw,"(无)")),$[24]||($[24]=l("div",{class:"section-sub"},"学习与成长",-1)),(E(!0),A(Ke,null,at(i.value.takeaways,(R,F)=>(E(),A("div",{key:"t"+F,class:"sum-item"},[Pt(z(R.text),1),l("span",Ww,"("+z(R.date)+")",1)]))),128)),i.value.takeaways.length?we("",!0):(E(),A("div",zw,"(无)"))])):we("",!0)])])]))}}),Yw=Ut(Gw,[["__scopeId","data-v-43f9c59b"]]),Jw=["aria-label"],Xw={class:"dialog-head"},Qw={class:"dialog-title"},Zw={class:"dialog-body"},e_={class:"form-grid"},t_={class:"field span2"},n_={class:"seg"},s_={class:"field"},r_={class:"field"},o_={class:"field"},a_=["value"],i_={class:"add-cat"},l_=["onKeydown"],u_={key:0,class:"field"},c_={class:"seg"},d_={class:"field span2"},f_={key:0,class:"form-error"},p_={class:"dialog-btns"},v_=Ft({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,r=t,o=P("expense"),i=P(""),c=P(""),f=P(""),v=P(""),y=P(!1),h=P(!1),w=P(""),C=P(null);function O(T){n.open&&T.key==="Escape"&&r("cancel")}wt(()=>n.open,async T=>{var U;T?(await te(),o.value=n.initial.type==="income"?"income":"expense",i.value=n.initial.category,c.value=n.initial.amountYuan,f.value=n.initial.date,v.value=n.initial.note,y.value=n.initial.reimbursable===1,h.value=n.initial.reimbursed===1,w.value="",window.addEventListener("keydown",O),await ir(),(U=C.value)==null||U.focus()):window.removeEventListener("keydown",O)}),Wn(()=>window.removeEventListener("keydown",O)),wt(o,T=>{i.value=T==="expense"?EXPENSE_CATEGORIES[0]:INCOME_CATEGORIES[0]});const B=P([]);async function te(){B.value=await Wr(o.value)}const se=P("");async function ae(){const T=se.value.trim();if(T){if(B.value.includes(T)){se.value="";return}B.value.push(T),await Es(o.value,B.value),i.value=T,se.value=""}}function re(){return i.value&&B.value.includes(i.value)?i.value:B.value[0]}function V(){const T=String(c.value??"").trim(),U=Number(T);if(!T||!isFinite(U)||U<=0){w.value="请填写大于 0 的金额";return}if(!f.value){w.value="请选择日期";return}const J=o.value==="expense"&&y.value?1:0;r("save",{type:o.value,category:re(),amount:Math.round(U*100),date:f.value,note:String(v.value??"").trim(),reimbursable:J,reimbursed:J&&h.value?1:0})}return(T,U)=>(E(),At(cs,{to:"body"},[Me(lr,{name:"modal"},{default:vs(()=>[e.open?(E(),A("div",{key:0,class:"mask",onClick:U[12]||(U[12]=en(J=>r("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",Xw,[l("span",Qw,z(e.title),1),l("button",{class:"icon-btn",title:"关闭",onClick:U[0]||(U[0]=J=>r("cancel"))},[Me(et,{name:"close",size:16})])]),l("div",Zw,[l("div",e_,[l("div",t_,[U[13]||(U[13]=l("label",null,"类型",-1)),l("div",n_,[l("button",{class:tt(["seg-btn",{active:o.value==="expense"}]),onClick:U[1]||(U[1]=J=>o.value="expense")},"支出",2),l("button",{class:tt(["seg-btn",{active:o.value==="income"}]),onClick:U[2]||(U[2]=J=>o.value="income")},"收入",2)])]),l("div",s_,[U[14]||(U[14]=l("label",null,"金额(元,必填)",-1)),Oe(l("input",{ref_key:"amountInput",ref:C,class:tt(["input",{invalid:w.value}]),"onUpdate:modelValue":U[3]||(U[3]=J=>c.value=J),type:"number",min:"0",step:"0.01",placeholder:"0.00"},null,2),[[Fe,c.value]])]),l("div",r_,[U[15]||(U[15]=l("label",null,"日期(必填)",-1)),Oe(l("input",{class:"input",type:"date","onUpdate:modelValue":U[4]||(U[4]=J=>f.value=J)},null,512),[[Fe,f.value]])]),l("div",o_,[U[16]||(U[16]=l("label",null,"分类(可直接新增)",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":U[5]||(U[5]=J=>i.value=J)},[(E(!0),A(Ke,null,at(B.value,J=>(E(),A("option",{key:J,value:J},z(J),9,a_))),128))],512),[[Pn,i.value]]),l("div",i_,[Oe(l("input",{class:"input add-cat-input","onUpdate:modelValue":U[6]||(U[6]=J=>se.value=J),placeholder:"新增分类名",onKeydown:Et(en(ae,["prevent"]),["enter"])},null,40,l_),[[Fe,se.value]]),l("button",{class:"btn btn-xs",type:"button",onClick:ae},"添加")])]),o.value==="expense"?(E(),A("div",u_,[U[17]||(U[17]=l("label",null,"报销状态",-1)),l("div",c_,[l("button",{class:tt(["seg-btn",{active:!y.value}]),onClick:U[7]||(U[7]=J=>{y.value=!1,h.value=!1})},"无需报销",2),l("button",{class:tt(["seg-btn",{active:y.value&&!h.value}]),onClick:U[8]||(U[8]=J=>{y.value=!0,h.value=!1})},"待报销",2),l("button",{class:tt(["seg-btn",{active:y.value&&h.value}]),onClick:U[9]||(U[9]=J=>{y.value=!0,h.value=!0})},"已报销",2)])])):we("",!0),l("div",d_,[U[18]||(U[18]=l("label",null,"备注",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":U[10]||(U[10]=J=>v.value=J),placeholder:"选填"},null,512),[[Fe,v.value]])])]),w.value?(E(),A("div",f_,z(w.value),1)):we("",!0)]),l("div",p_,[l("button",{class:"btn btn-sm",onClick:U[11]||(U[11]=J=>r("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:V},"保存")])],8,Jw)])):we("",!0)]),_:1})]))}}),m_=Ut(v_,[["__scopeId","data-v-9f38206c"]]),h_={class:"ledger-page"},y_={class:"ledger-toolbar"},g_={class:"month-title num"},b_={class:"cards"},w_={class:"card stat-card"},__={class:"stat-num num amt-income"},k_={class:"card stat-card"},x_={class:"stat-num num"},C_={class:"card stat-card"},$_={class:"card stat-card"},S_={class:"stat-num num amt-warn"},E_={class:"card sec"},T_={class:"form-grid"},A_={class:"field span2"},P_={class:"seg"},O_={class:"field"},M_={class:"field"},I_={class:"field"},j_=["value"],D_={key:0,class:"field"},L_={class:"field span2"},K_={key:0,class:"form-error"},R_={class:"form-footer"},N_=["disabled"],F_=["disabled"],V_={key:0,class:"card sec"},B_={class:"bar-label"},U_={class:"bar-track"},q_={class:"muted num bar-num"},H_={key:1,class:"card section"},W_={class:"form-error"},z_={class:"card table-card"},G_={class:"tx-table"},Y_={class:"num","data-label":"日期"},J_={"data-label":"分类"},X_={class:"tag"},Q_={class:"td-note","data-label":"备注"},Z_={"data-label":"报销"},e1={key:0,class:"muted"},t1={key:1,class:"tx-done"},n1={key:2,class:"tx-pending"},s1={class:"ops-cell"},r1={class:"ops"},o1=["onClick"],a1=["onClick"],i1=["onClick"],l1={key:0},u1={class:"muted vault-note num"},c1=Ft({__name:"LedgerView",setup(e){const t=P(bt()),n=P([]),r=P(!0),o=P("expense"),i=P(""),c=P(""),f=P(bt()),v=P(""),y=P(!1),h=P(""),w=P(""),C=P(!1),O=P(!1),B=P(null),te=P({type:"expense",category:"",amountYuan:"",date:bt(),note:"",reimbursable:0,reimbursed:0}),se=P(null),ae=it(()=>t.value.slice(0,7)+"-01"),re=it(()=>{const je=Number(t.value.slice(0,4)),fe=Number(t.value.slice(5,7))-1,De=new Date(je,fe+1,0).getDate();return t.value.slice(0,7)+"-"+(De<10?"0"+De:String(De))}),V=it(()=>Number(t.value.slice(0,4))+" 年 "+Number(t.value.slice(5,7))+" 月");async function T(){r.value=!0;try{n.value=await Ah(ae.value,re.value),w.value=""}catch(je){w.value="账目加载失败:"+(je instanceof Error?je.stack||je.message:String(je)),He("账目加载失败")}r.value=!1}an(T),wt(t,T);const U=P([]),J=P([]);async function Y(){U.value=await Wr("expense"),J.value=await Wr("income"),o.value==="expense"&&!U.value.includes(c.value)&&(c.value=U.value[0]||""),o.value==="income"&&!J.value.includes(c.value)&&(c.value=J.value[0]||"")}Y(),wt(o,je=>{c.value=je==="expense"?U.value[0]||"":J.value[0]||""});const ne=it(()=>n.value.slice().sort((je,fe)=>je.date===fe.date?fe.id-je.id:je.date<fe.date?1:-1)),$=it(()=>{let je=0,fe=0,De=0;for(const rt of n.value)rt.type==="income"?je+=rt.amount:(fe+=rt.amount,rt.reimbursable===1&&rt.reimbursed!==1&&(De+=rt.amount));return{income:je,expense:fe,pending:De,balance:je-fe}}),R=P("all"),F=P("all"),ee=it(()=>ne.value.filter(je=>!(R.value!=="all"&&je.type!==R.value||F.value==="pending"&&!(je.type==="expense"&&je.reimbursable===1&&je.reimbursed!==1)||F.value==="done"&&!(je.reimbursable===1&&je.reimbursed===1)))),Ie=it(()=>{const je=new Map;let fe=0;for(const rt of n.value)rt.type==="expense"&&(je.set(rt.category,(je.get(rt.category)||0)+rt.amount),fe+=rt.amount);const De=fe||1;return Array.from(je.entries()).map(rt=>({name:rt[0],amount:rt[1],percent:Math.round(rt[1]/De*100)})).sort((rt,Ve)=>Ve.amount-rt.amount)});function Pe(je){return(je/100).toFixed(2)}function ke(je){return(je.type==="income"?"+":"-")+Pe(je.amount)}function Re(){t.value=ea(t.value,-1)}function xe(){t.value=ea(t.value,1)}function me(){t.value=bt()}wt(i,()=>{h.value&&(h.value="")});async function _e(){const je=String(i.value??"").trim(),fe=Number(je);if(!je||!isFinite(fe)||fe<=0){h.value="请填写大于 0 的金额";return}if(!f.value){h.value="请选择日期";return}if(!C.value){C.value=!0;try{await Ph({type:o.value,category:c.value,amount:Math.round(fe*100),date:f.value,note:String(v.value??"").trim(),reimbursable:o.value==="expense"&&y.value?1:0,reimbursed:0})}catch(De){He("添加失败:"+(De instanceof Error?De.message:String(De))),C.value=!1;return}i.value="",v.value="",y.value=!1,h.value="",await T(),He("记账已添加"),C.value=!1}}const We=it(()=>String(i.value??"").trim()!==""||String(v.value??"").trim()!=="");function Xe(){i.value="",v.value="",y.value=!1,h.value=""}async function Ae(je){await Ih(je.id),await T(),He("已标记为已报销")}function pe(je){B.value=je.id,te.value={type:je.type,category:je.category,amountYuan:Pe(je.amount),date:je.date,note:je.note||"",reimbursable:je.reimbursable,reimbursed:je.reimbursed},O.value=!0}async function Ne(je){const fe=B.value;await Oh(fe,je),O.value=!1,await T(),He("账目已更新")}async function dt(){se.value&&se.value.id&&await Mh(se.value.id),se.value=null,await T(),He("账目已删除")}return(je,fe)=>(E(),A("div",h_,[l("div",y_,[l("button",{class:"icon-btn",onClick:Re},[Me(et,{name:"chevron-left",size:16})]),l("span",g_,z(V.value),1),l("button",{class:"icon-btn",onClick:xe},[Me(et,{name:"chevron-right",size:16})]),l("button",{class:"btn btn-sm",onClick:me},"回到本月"),fe[13]||(fe[13]=l("span",{class:"flex1"},null,-1)),Oe(l("select",{class:"select w-filter","onUpdate:modelValue":fe[0]||(fe[0]=De=>R.value=De)},[...fe[11]||(fe[11]=[l("option",{value:"all"},"全部类型",-1),l("option",{value:"expense"},"仅支出",-1),l("option",{value:"income"},"仅收入",-1)])],512),[[Pn,R.value]]),Oe(l("select",{class:"select w-filter","onUpdate:modelValue":fe[1]||(fe[1]=De=>F.value=De)},[...fe[12]||(fe[12]=[l("option",{value:"all"},"全部报销",-1),l("option",{value:"pending"},"待报销",-1),l("option",{value:"done"},"已报销",-1)])],512),[[Pn,F.value]])]),l("div",b_,[l("div",w_,[fe[14]||(fe[14]=l("div",{class:"muted"},"本月收入(元)",-1)),l("div",__,z(Pe($.value.income)),1)]),l("div",k_,[fe[15]||(fe[15]=l("div",{class:"muted"},"本月支出(元)",-1)),l("div",x_,z(Pe($.value.expense)),1)]),l("div",C_,[fe[16]||(fe[16]=l("div",{class:"muted"},"本月结余(元)",-1)),l("div",{class:tt(["stat-num num",{"amt-income":$.value.balance>=0,"amt-expense":$.value.balance<0}])},z(Pe($.value.balance)),3)]),l("div",$_,[fe[17]||(fe[17]=l("div",{class:"muted"},"待报销(元)",-1)),l("div",S_,z(Pe($.value.pending)),1)])]),l("div",E_,[fe[24]||(fe[24]=l("div",{class:"sec-head"},[l("span",{class:"sec-title"},"新增一笔"),l("span",{class:"muted form-hint"},"金额必填,回车快速添加")],-1)),l("div",T_,[l("div",A_,[fe[18]||(fe[18]=l("label",null,"类型",-1)),l("div",P_,[l("button",{class:tt(["seg-btn",{active:o.value==="expense"}]),onClick:fe[2]||(fe[2]=De=>o.value="expense")},"支出",2),l("button",{class:tt(["seg-btn",{active:o.value==="income"}]),onClick:fe[3]||(fe[3]=De=>o.value="income")},"收入",2)])]),l("div",O_,[fe[19]||(fe[19]=l("label",null,"金额(元,必填)",-1)),Oe(l("input",{class:tt(["input",{invalid:h.value}]),"onUpdate:modelValue":fe[4]||(fe[4]=De=>i.value=De),type:"number",min:"0",step:"0.01",placeholder:"0.00",onKeydown:Et(_e,["enter"])},null,34),[[Fe,i.value]])]),l("div",M_,[fe[20]||(fe[20]=l("label",null,"日期",-1)),Oe(l("input",{class:"input",type:"date","onUpdate:modelValue":fe[5]||(fe[5]=De=>f.value=De)},null,512),[[Fe,f.value]])]),l("div",I_,[fe[21]||(fe[21]=l("label",null,"分类",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":fe[6]||(fe[6]=De=>c.value=De)},[(E(!0),A(Ke,null,at(o.value==="expense"?U.value:J.value,De=>(E(),A("option",{key:De,value:De},z(De),9,j_))),128))],512),[[Pn,c.value]])]),o.value==="expense"?(E(),A("div",D_,[fe[22]||(fe[22]=l("label",null,"报销",-1)),l("button",{class:tt(["toggle-btn",{on:y.value}]),onClick:fe[7]||(fe[7]=De=>y.value=!y.value)},z(y.value?"需要报销":"无需报销"),3)])):we("",!0),l("div",L_,[fe[23]||(fe[23]=l("label",null,"备注",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":fe[8]||(fe[8]=De=>v.value=De),placeholder:"选填,如:客户现场午餐",onKeydown:Et(_e,["enter"])},null,544),[[Fe,v.value]])])]),h.value?(E(),A("div",K_,z(h.value),1)):we("",!0),l("div",R_,[l("button",{class:"btn btn-sm",disabled:!We.value,onClick:Xe},"重置",8,N_),l("button",{class:"btn btn-primary btn-sm",disabled:C.value,onClick:_e},"添加记录",8,F_)])]),Ie.value.length?(E(),A("div",V_,[fe[25]||(fe[25]=l("div",{class:"sec-title"},"本月支出分类",-1)),(E(!0),A(Ke,null,at(Ie.value,De=>(E(),A("div",{key:De.name,class:"bar-row"},[l("span",B_,z(De.name),1),l("span",U_,[l("span",{class:"bar-fill",style:as({width:De.percent+"%"})},null,4)]),l("span",q_,z(Pe(De.amount))+" 元 · "+z(De.percent)+"%",1)]))),128))])):we("",!0),w.value?(E(),A("div",H_,[l("div",W_,z(w.value),1),fe[26]||(fe[26]=l("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):we("",!0),l("div",z_,[l("table",G_,[fe[28]||(fe[28]=l("thead",null,[l("tr",null,[l("th",null,"日期"),l("th",null,"分类"),l("th",null,"金额(元)"),l("th",null,"备注"),l("th",null,"报销"),l("th",{class:"th-ops"},"操作")])],-1)),l("tbody",null,[(E(!0),A(Ke,null,at(ee.value,De=>(E(),A("tr",{key:De.id},[l("td",Y_,z(De.date),1),l("td",J_,[l("span",X_,z(De.category),1)]),l("td",{class:tt(["num",De.type==="income"?"amt-income":"amt-expense"]),"data-label":"金额"},z(ke(De)),3),l("td",Q_,z(De.note||"--"),1),l("td",Z_,[De.type!=="expense"||De.reimbursable!==1?(E(),A("span",e1,"--")):De.reimbursed===1?(E(),A("span",t1,"已报销")):(E(),A("span",n1,"待报销"))]),l("td",s1,[l("div",r1,[De.type==="expense"&&De.reimbursable===1&&De.reimbursed!==1?(E(),A("button",{key:0,class:"btn btn-xs",onClick:rt=>Ae(De)},"标记已报销",8,o1)):we("",!0),l("button",{class:"btn btn-xs",onClick:rt=>pe(De)},"编辑",8,a1),l("button",{class:"btn btn-xs",onClick:rt=>se.value=De},"删除",8,i1)])])]))),128)),!ee.value.length&&!r.value?(E(),A("tr",l1,[...fe[27]||(fe[27]=[l("td",{colspan:"6",class:"empty muted"},"本月暂无账目",-1)])])):we("",!0)])])]),l("div",u1,"本月 "+z(n.value.length)+" 条 · 当前筛选 "+z(ee.value.length)+" 条",1),Me(m_,{open:O.value,title:(B.value,"编辑账目"),initial:te.value,onCancel:fe[9]||(fe[9]=De=>O.value=!1),onSave:Ne},null,8,["open","title","initial"]),Me(qn,{open:!!se.value,title:"删除确认",message:se.value?"将删除 "+se.value.date+" 的账目("+se.value.category+" "+Pe(se.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:fe[10]||(fe[10]=De=>se.value=null),onConfirm:dt},null,8,["open","message"])]))}}),d1=Ut(c1,[["__scopeId","data-v-2660d908"]]),f1={class:"memo-page"},p1={class:"card memo-list"},v1={class:"pane-head"},m1={class:"pane-title"},h1={class:"memo-scroll"},y1=["onClick"],g1={class:"memo-item-title"},b1={class:"muted memo-item-sub"},w1={class:"muted num memo-item-time"},_1={key:0,class:"muted empty"},k1={class:"card memo-editor"},x1={class:"editor-foot"},C1={class:"muted foot-info"},$1=["disabled"],S1=["disabled"],E1={key:1,class:"empty muted editor-empty"},T1=Ft({__name:"MemoView",setup(e){const t=P([]),n=P(null),r=P(!1),o=P(""),i=P(""),c=P(null),f=P(null);async function v(){if(t.value=await xh(),n.value&&n.value.id){const J=t.value.find(Y=>Y.id===n.value.id);J&&(n.value=J)}}an(async()=>{await v(),t.value.length&&w(t.value[0]),window.addEventListener("keydown",y)}),Wn(()=>window.removeEventListener("keydown",y)),wt(Vi,async J=>{if(!J)return;t.value.length||await v();const Y=t.value.find(ne=>ne.id===J);Vi.value=null,Y&&C(Y)},{immediate:!0});function y(J){(J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="s"&&r.value&&h.value&&(J.preventDefault(),se())}const h=it(()=>{if(!r.value)return!1;const J=n.value?n.value.title:"",Y=n.value?n.value.content:"";return o.value!==J||i.value!==Y});function w(J){n.value=J,r.value=!0,o.value=J.title,i.value=J.content}function C(J){if(!(r.value&&n.value&&n.value.id===J.id)){if(h.value){f.value={type:"select",memo:J};return}w(J)}}function O(){if(h.value){f.value={type:"new"};return}B()}function B(){n.value=null,r.value=!0,o.value="",i.value=""}function te(){n.value?w(n.value):B()}async function se(){if(!o.value.trim()&&!i.value.trim()){He("标题与内容不能都为空");return}if(n.value&&n.value.id)await $h(n.value.id,o.value,i.value),He("备忘已保存");else{const J=await Ch(o.value,i.value);n.value=J,o.value=J.title,i.value=J.content,He("备忘已创建")}await v()}function ae(){n.value&&n.value.id&&(c.value=n.value)}async function re(){c.value&&c.value.id&&(await Sh(c.value.id),He("备忘已删除")),c.value=null,await v(),B()}function V(){const J=f.value;f.value=null,J&&(J.type==="select"?w(J.memo):B())}function T(J){return(J.content||"").replace(/\s+/g," ").slice(0,30)}function U(J){return J.replace("T"," ").slice(0,16)}return(J,Y)=>(E(),A("div",f1,[l("aside",p1,[l("div",v1,[l("span",m1,"备忘录("+z(t.value.length)+")",1),l("button",{class:"btn btn-primary btn-sm",onClick:O},"新建")]),l("div",h1,[(E(!0),A(Ke,null,at(t.value,ne=>(E(),A("div",{key:ne.id,class:tt(["memo-item",{active:r.value&&n.value&&n.value.id===ne.id}]),onClick:$=>C(ne)},[l("div",g1,z(ne.title||"无标题"),1),l("div",b1,z(T(ne)||"空"),1),l("div",w1,z(U(ne.updated_at)),1)],10,y1))),128)),t.value.length?we("",!0):(E(),A("div",_1,"暂无备忘"))])]),l("section",k1,[r.value?(E(),A(Ke,{key:0},[Oe(l("input",{class:"input title-input","onUpdate:modelValue":Y[0]||(Y[0]=ne=>o.value=ne),placeholder:"标题"},null,512),[[Fe,o.value]]),Oe(l("textarea",{class:"textarea content-textarea","onUpdate:modelValue":Y[1]||(Y[1]=ne=>i.value=ne),placeholder:"内容"},null,512),[[Fe,i.value]]),l("div",x1,[l("span",C1,[h.value?(E(),A(Ke,{key:0},[Pt("有未保存修改")],64)):n.value&&n.value.id?(E(),A(Ke,{key:1},[Pt("更新于 "+z(U(n.value.updated_at)),1)],64)):(E(),A(Ke,{key:2},[Pt("新备忘")],64))]),Y[4]||(Y[4]=l("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(E(),A("button",{key:0,class:"btn btn-sm",onClick:ae},"删除")):we("",!0),l("button",{class:"btn btn-sm",disabled:!h.value,onClick:te},"放弃修改",8,$1),l("button",{class:"btn btn-primary btn-sm",disabled:!h.value,onClick:se},"保存",8,S1)])],64)):(E(),A("div",E1,"选择左侧备忘,或点击右上角新建"))]),Me(qn,{open:!!c.value,title:"删除确认",message:c.value?"将删除备忘「"+(c.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Y[2]||(Y[2]=ne=>c.value=null),onConfirm:re},null,8,["open","message"]),Me(qn,{open:!!f.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:Y[3]||(Y[3]=ne=>f.value=null),onConfirm:V},null,8,["open"])]))}}),A1=Ut(T1,[["__scopeId","data-v-74d60dba"]]),P1=["aria-label"],O1={class:"dialog-head"},M1={class:"dialog-title"},I1={class:"dialog-body"},j1={class:"form-grid"},D1={class:"field span2"},L1={class:"field span2"},K1={class:"field span2"},R1={class:"pwd-row"},N1={class:"field span2"},F1={key:0,class:"form-error"},V1={class:"dialog-btns"},B1=Ft({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,r=t,o=P(""),i=P(""),c=P(""),f=P(""),v=P(""),y=P(null);function h(O){n.open&&O.key==="Escape"&&r("cancel")}wt(()=>n.open,async O=>{var B;O?(o.value=n.initial.system,i.value=n.initial.account,c.value=n.initial.password,f.value=n.initial.remark,v.value="",window.addEventListener("keydown",h),await ir(),(B=y.value)==null||B.focus()):window.removeEventListener("keydown",h)}),Wn(()=>window.removeEventListener("keydown",h));function w(){const O="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",B="!@#$%^&*",te=crypto.getRandomValues(new Uint8Array(14));let se="";for(let ae=0;ae<te.length;ae++)se+=O[te[ae]%O.length];se+=B[crypto.getRandomValues(new Uint8Array(1))[0]%B.length],c.value=se,v.value=""}function C(){if(!o.value.trim()||!i.value.trim()||!c.value){v.value="系统名称、账号、密码为必填项";return}r("save",{system:o.value.trim(),account:i.value.trim(),password:c.value,remark:f.value.trim()})}return(O,B)=>(E(),At(cs,{to:"body"},[Me(lr,{name:"modal"},{default:vs(()=>[e.open?(E(),A("div",{key:0,class:"mask",onClick:B[6]||(B[6]=en(te=>r("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",O1,[l("span",M1,z(e.title),1),l("button",{class:"icon-btn",title:"关闭",onClick:B[0]||(B[0]=te=>r("cancel"))},[Me(et,{name:"close",size:16})])]),l("div",I1,[l("div",j1,[l("div",D1,[B[7]||(B[7]=l("label",null,"系统名称(必填)",-1)),Oe(l("input",{ref_key:"systemInput",ref:y,class:"input","onUpdate:modelValue":B[1]||(B[1]=te=>o.value=te),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[Fe,o.value]])]),l("div",L1,[B[8]||(B[8]=l("label",null,"账号(必填)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":B[2]||(B[2]=te=>i.value=te),placeholder:"用户名、工号或邮箱"},null,512),[[Fe,i.value]])]),l("div",K1,[B[9]||(B[9]=l("label",null,"密码(必填)",-1)),l("div",R1,[Oe(l("input",{class:"input","onUpdate:modelValue":B[3]||(B[3]=te=>c.value=te),placeholder:"输入或点击生成"},null,512),[[Fe,c.value]]),l("button",{class:"btn btn-sm",onClick:w},"生成")])]),l("div",N1,[B[10]||(B[10]=l("label",null,"备注",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":B[4]||(B[4]=te=>f.value=te),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[Fe,f.value]])])]),v.value?(E(),A("div",F1,z(v.value),1)):we("",!0)]),l("div",V1,[l("button",{class:"btn btn-sm",onClick:B[5]||(B[5]=te=>r("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:C},"保存")])],8,P1)])):we("",!0)]),_:1})]))}}),U1=Ut(B1,[["__scopeId","data-v-f383b0a6"]]),q1={class:"vault-page"},H1={key:0,class:"empty muted"},W1={key:1,class:"card lock-card"},z1={class:"lock-badge"},G1={key:0,class:"form-error"},Y1=["disabled"],J1={key:0,class:"form-error"},X1=["disabled"],Q1={class:"vault-toolbar"},Z1={class:"search-wrap"},e0={class:"card table-card"},t0={class:"cred-table"},n0={class:"td-system"},s0=["onClick"],r0={class:"pwd-cell"},o0={class:"num pwd-text"},a0=["onClick"],i0=["onClick"],l0={class:"td-remark"},u0={class:"td-ops"},c0={class:"ops"},d0=["onClick"],f0=["onClick"],p0={key:0},v0={class:"muted vault-note num"},m0={class:"dialog pwd-dialog"},h0={class:"dialog-head"},y0={class:"dialog-body"},g0={class:"vp-field"},b0={class:"vp-field"},w0={class:"vp-field"},_0={key:0,class:"form-error"},k0={class:"dialog-btns"},x0=5*60*1e3,C0=Ft({__name:"VaultView",setup(e){const t=P(null),n=P(cm()),r=P(!1),o=P(""),i=P(""),c=P(""),f=P(""),v=P(""),y=P([]),h=P(""),w=P({}),C=P(!1),O=P(null),B=P({system:"",account:"",password:"",remark:""}),te=P(null),se=P(!1),ae=P(""),re=P(""),V=P(""),T=P("");async function U(){y.value=await mm(),w.value={}}let J=null;function Y(){J!==null&&window.clearTimeout(J),J=window.setTimeout(()=>{n.value&&(sa(),n.value=!1,y.value=[],w.value={},He("长时间未操作,密码库已自动锁定"))},x0)}function ne(){n.value&&Y()}an(async()=>{t.value=await dd(),window.addEventListener("click",ne),window.addEventListener("keydown",ne),n.value&&Y()}),Wn(()=>{window.removeEventListener("click",ne),window.removeEventListener("keydown",ne),J!==null&&window.clearTimeout(J)});const $=it(()=>{const Ae=h.value.trim().toLowerCase();return Ae?y.value.filter(pe=>(pe.system+" "+pe.account+" "+(pe.remark||"")).toLowerCase().includes(Ae)):y.value});async function R(){if(!r.value){if(c.value="",!o.value){c.value="请输入主密码";return}if(o.value.length<6){c.value="主密码至少 6 位";return}if(o.value!==i.value){c.value="两次输入的主密码不一致";return}r.value=!0;try{await dm(o.value),o.value="",i.value="",n.value=!0,Y(),await U(),He("主密码已设置,密码库已解锁")}catch(Ae){c.value=Ae instanceof Error?Ae.message:"设置失败"}r.value=!1}}async function F(){if(!r.value){if(v.value="",!f.value){v.value="请输入主密码";return}r.value=!0;try{await fm(f.value),f.value="",n.value=!0,Y(),await U()}catch(Ae){v.value=Ae instanceof Error?Ae.message:"解锁失败"}r.value=!1}}function ee(){sa(),n.value=!1,y.value=[],w.value={},J!==null&&window.clearTimeout(J),He("密码库已锁定")}async function Ie(Ae){const pe=Ae.id;if(w.value[pe]){w.value[pe]=!1;return}try{Ae.passwordPlain=await mi(pe),w.value[pe]=!0}catch(Ne){He(Ne instanceof Error?Ne.message:"解密失败")}}async function Pe(Ae){try{const pe=await mi(Ae.id);await Wi(pe),He("密码已复制")}catch(pe){He(pe instanceof Error?pe.message:"复制失败")}}async function ke(Ae){await Wi(Ae.account),He("账号已复制")}function Re(){O.value=null,B.value={system:"",account:"",password:"",remark:""},C.value=!0}async function xe(Ae){try{const pe=await mi(Ae.id);O.value=Ae.id,B.value={system:Ae.system,account:Ae.account,password:pe,remark:Ae.remark||""},C.value=!0}catch(pe){He(pe instanceof Error?pe.message:"解密失败")}}async function me(Ae){const pe=O.value??void 0;await hm(Ae,pe),C.value=!1,await U(),He(pe?"账号已更新":"账号已添加")}async function _e(){te.value&&te.value.id&&(await ym(te.value.id),He("账号已删除")),te.value=null,await U()}function We(){ae.value="",re.value="",V.value="",T.value="",se.value=!0}async function Xe(){T.value="";try{const Ae=await gm(ae.value,re.value);se.value=!1,ae.value="",re.value="",V.value="",He("主密码已修改,"+Ae+" 条账号密码已重新加密")}catch(Ae){T.value=Ae instanceof Error?Ae.message:"修改失败"}}return(Ae,pe)=>(E(),A("div",q1,[t.value===null?(E(),A("div",H1,"加载中")):n.value?(E(),A(Ke,{key:2},[l("div",Q1,[l("div",Z1,[Me(et,{name:"search",size:14,class:"search-icon"}),Oe(l("input",{class:"input","onUpdate:modelValue":pe[3]||(pe[3]=Ne=>h.value=Ne),placeholder:"搜索系统名称、账号或备注"},null,512),[[Fe,h.value]])]),pe[16]||(pe[16]=l("span",{class:"flex1"},null,-1)),l("button",{class:"btn btn-sm",onClick:We},"修改主密码"),l("button",{class:"btn btn-sm",onClick:ee},"锁定"),l("button",{class:"btn btn-primary btn-sm",onClick:Re},"新增账号")]),l("div",e0,[l("table",t0,[pe[18]||(pe[18]=l("thead",null,[l("tr",null,[l("th",null,"系统名称"),l("th",null,"账号"),l("th",null,"密码"),l("th",null,"备注"),l("th",{class:"th-ops"},"操作")])],-1)),l("tbody",null,[(E(!0),A(Ke,null,at($.value,Ne=>(E(),A("tr",{key:Ne.id},[l("td",n0,z(Ne.system),1),l("td",null,[l("span",{class:"copyable",title:"点击复制账号",onClick:dt=>ke(Ne)},z(Ne.account),9,s0)]),l("td",null,[l("div",r0,[l("span",o0,z(w.value[Ne.id]?Ne.passwordPlain:"........"),1),l("button",{class:"btn btn-xs",onClick:dt=>Ie(Ne)},z(w.value[Ne.id]?"隐藏":"显示"),9,a0),l("button",{class:"btn btn-xs",onClick:dt=>Pe(Ne)},"复制",8,i0)])]),l("td",l0,z(Ne.remark||"--"),1),l("td",u0,[l("div",c0,[l("button",{class:"btn btn-xs",onClick:dt=>xe(Ne)},"编辑",8,d0),l("button",{class:"btn btn-xs",onClick:dt=>te.value=Ne},"删除",8,f0)])])]))),128)),$.value.length?we("",!0):(E(),A("tr",p0,[...pe[17]||(pe[17]=[l("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),l("div",v0,"共 "+z(y.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密,服务器仅存密文",1)],64)):(E(),A("div",W1,[l("div",z1,[Me(et,{name:"lock",size:26})]),t.value===!1?(E(),A(Ke,{key:0},[pe[12]||(pe[12]=l("div",{class:"lock-title"},"设置主密码",-1)),pe[13]||(pe[13]=l("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":pe[0]||(pe[0]=Ne=>o.value=Ne),placeholder:"设置主密码(至少 6 位)",onKeydown:Et(R,["enter"])},null,544),[[Fe,o.value]]),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":pe[1]||(pe[1]=Ne=>i.value=Ne),placeholder:"再次输入主密码",onKeydown:Et(R,["enter"])},null,544),[[Fe,i.value]]),c.value?(E(),A("div",G1,z(c.value),1)):we("",!0),l("button",{class:"btn btn-primary lock-btn",disabled:r.value,onClick:R},"完成设置并解锁",8,Y1)],64)):(E(),A(Ke,{key:1},[pe[14]||(pe[14]=l("div",{class:"lock-title"},"密码库已锁定",-1)),pe[15]||(pe[15]=l("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":pe[2]||(pe[2]=Ne=>f.value=Ne),placeholder:"主密码",onKeydown:Et(F,["enter"])},null,544),[[Fe,f.value]]),v.value?(E(),A("div",J1,z(v.value),1)):we("",!0),l("button",{class:"btn btn-primary lock-btn",disabled:r.value,onClick:F},"解锁",8,X1)],64))])),Me(U1,{open:C.value,title:O.value?"编辑账号":"新增账号",initial:B.value,onCancel:pe[4]||(pe[4]=Ne=>C.value=!1),onSave:me},null,8,["open","title","initial"]),Me(qn,{open:!!te.value,title:"删除确认",message:te.value?"将删除系统「"+te.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:pe[5]||(pe[5]=Ne=>te.value=null),onConfirm:_e},null,8,["open","message"]),(E(),At(cs,{to:"body"},[Me(lr,{name:"modal"},{default:vs(()=>[se.value?(E(),A("div",{key:0,class:"mask",onClick:pe[11]||(pe[11]=en(Ne=>se.value=!1,["self"]))},[l("div",m0,[l("div",h0,[pe[19]||(pe[19]=l("span",{class:"dialog-title"},"修改主密码",-1)),l("button",{class:"icon-btn",title:"关闭",onClick:pe[6]||(pe[6]=Ne=>se.value=!1)},[Me(et,{name:"close",size:16})])]),l("div",y0,[l("div",g0,[pe[20]||(pe[20]=l("label",null,"旧主密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":pe[7]||(pe[7]=Ne=>ae.value=Ne)},null,512),[[Fe,ae.value]])]),l("div",b0,[pe[21]||(pe[21]=l("label",null,"新主密码(至少 6 位)",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":pe[8]||(pe[8]=Ne=>re.value=Ne)},null,512),[[Fe,re.value]])]),l("div",w0,[pe[22]||(pe[22]=l("label",null,"确认新主密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":pe[9]||(pe[9]=Ne=>V.value=Ne)},null,512),[[Fe,V.value]])]),T.value?(E(),A("div",_0,z(T.value),1)):we("",!0),pe[23]||(pe[23]=l("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),l("div",k0,[l("button",{class:"btn btn-sm",onClick:pe[10]||(pe[10]=Ne=>se.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:Xe},"确认修改")])])])):we("",!0)]),_:1})]))]))}}),$0=Ut(C0,[["__scopeId","data-v-c2db283d"]]);function S0(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function bi(e,t){const r="\uFEFF"+t.map(f=>f.map(S0).join(",")).join(`\r
`);if(ar.isNativePlatform()){const{downloadText:f}=await Od(async()=>{const{downloadText:v}=await Promise.resolve().then(()=>fw);return{downloadText:v}},void 0,import.meta.url);return f(e,r)}const o=new Blob([r],{type:"text/csv;charset=utf-8"}),i=URL.createObjectURL(o),c=document.createElement("a");return c.href=i,c.download=e,c.click(),window.setTimeout(()=>URL.revokeObjectURL(i),1e4),""}const E0={class:"settings"},T0={class:"card section"},A0={class:"muted acc-line"},P0={class:"ai-grid"},O0={class:"rule-item"},M0={class:"rule-item"},I0={class:"rule-item"},j0={key:0,class:"form-error"},D0={class:"rule-save"},L0={class:"card section"},K0={class:"rule-grid"},R0={class:"rule-item"},N0={class:"rule-item"},F0={class:"rule-item"},V0={class:"rule-item"},B0={class:"rule-item"},U0={class:"card section"},q0={class:"proj-add"},H0={key:0,class:"muted proj-tip"},W0=["onKeydown"],z0=["onClick"],G0=["onClick"],Y0=["onClick"],J0={key:1,class:"muted"},X0={class:"card section"},Q0={class:"card section"},Z0={class:"muted acc-line"},ek={class:"rule-save"},tk=["disabled"],nk={key:0,class:"muted acc-line"},sk={key:1,class:"form-error"},rk={key:2,class:"form-error"},ok={class:"card section"},ak={class:"ai-grid"},ik={class:"rule-item"},lk={class:"rule-item"},uk={class:"rule-item"},ck={class:"card section"},dk={class:"cat-block"},fk={class:"cat-head"},pk={class:"cat-chips"},vk=["onClick"],mk=["onClick"],hk={class:"cat-block"},yk={class:"cat-head"},gk={class:"cat-chips"},bk=["onClick"],wk=["onClick"],_k={class:"cat-block"},kk={class:"cat-head"},xk={class:"cat-chips"},Ck=["onClick"],$k=["onClick"],Sk={class:"card section"},Ek={class:"seg"},Tk={class:"exp-dates"},Ak={class:"muted loc-note"},Pk={class:"card section"},Ok={class:"backup-row"},Mk={key:0,class:"import-error"},Ik=Ft({__name:"SettingsView",setup(e){var le;const t=P({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=P([]),r=P(""),o=P(""),i=P(""),c=P(""),f=P(""),v=P(""),y=P(null),h=P(""),w=P([]),C=P([]),O=P([]);async function B(){w.value=await Jr(),C.value=await Wr("expense"),O.value=await Wr("income")}async function te(S){const x=window.prompt("新分类名称");if(!x||!x.trim())return;const Z=S==="log"?w.value:S==="expense"?C.value:O.value,Te=x.trim();if(Z.includes(Te)){He("分类已存在");return}const Ue=[...Z,Te];S==="log"?(w.value=Ue,await yi(Ue)):S==="expense"?(C.value=Ue,await Es("expense",Ue)):(O.value=Ue,await Es("income",Ue)),He("分类已添加")}async function se(S,x,Z){const Te=window.prompt("修改分类名称",Z);if(!Te||!Te.trim()||Te.trim()===Z)return;const Je=(S==="log"?w.value:S==="expense"?C.value:O.value).map((ct,Ge)=>Ge===x?Te.trim():ct);S==="log"?(w.value=Je,await yi(Je)):S==="expense"?(C.value=Je,await Es("expense",Je)):(O.value=Je,await Es("income",Je)),He("分类已更新(历史记录自动跟随显示)")}async function ae(S,x){const Z=S==="log"?w.value:S==="expense"?C.value:O.value;if(Z.length<=1){He("至少保留一个分类");return}if(!window.confirm("删除分类「"+Z[x]+"」?历史记录不受影响。"))return;const Te=Z.filter((Ue,Je)=>Je!==x);S==="log"?(w.value=Te,await yi(Te)):S==="expense"?(C.value=Te,await Es("expense",Te)):(O.value=Te,await Es("income",Te)),He("分类已删除")}const re=P("day"),V=P(bt()),T=P(bt());function U(){if(bt(),re.value==="day")return{start:V.value,end:V.value,label:V.value};if(re.value==="week"){const S=Qs(V.value);return{start:S,end:on(S,6),label:S+" ~ "+on(S,6)}}if(re.value==="month"){const S=V.value.slice(0,4),x=V.value.slice(5,7),Z=new Date(Number(S),Number(x),0).getDate();return{start:S+"-"+x+"-01",end:S+"-"+x+"-"+Z,label:S+"-"+x}}return{start:V.value,end:T.value,label:V.value+" ~ "+T.value}}async function J(){const{start:S,end:x,label:Z}=U(),Te=await Promise.all([Hr(S,x),nr(!0)]),Ue=Te[0],Je=Te[1],ct=new Map(Je.map(gt=>[gt.id,gt.name])),Ge=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const gt of Ue)Ge.push([gt.date,categoryLabel(gt.category),gt.project_id&&ct.get(gt.project_id)||"",gt.content,gt.minutes==null?"":gt.minutes,gt.is_milestone?"是":"",gt.needs_followup?"是":"",gt.takeaway||"",gt.remark||""]);const Lt="工作详情_"+Z.replace(/[~s]/g,"_")+".csv",Kt=await bi(Lt,Ge);He(Kt?"已导出:"+Kt:"已导出到系统下载目录("+Ue.length+" 条)")}const Y=P(null),ne=P(null),$=P(""),R=P(((le=Ur())==null?void 0:le.username)||""),F=P(""),ee=P(""),Ie=P(""),Pe=P(""),ke=P(!1),Re="0.3.1",xe=P(""),me=P(""),_e=P(""),We=P(""),Xe=P(!1),Ae=P("");async function pe(){var S;xe.value=((S=bn())==null?void 0:S.username)||"",Ae.value=await Nm(),We.value=Zs.value}wt(Zs,S=>{We.value=S});async function Ne(){_e.value="";try{await gd(),He("云端绑定已重建")}catch(S){_e.value=S instanceof Error?S.message:"绑定失败"}}async function dt(){if(!Xe.value){_e.value="",We.value=Zs.value,Xe.value=!0;try{const S=await Bi();Ae.value=S.at,me.value="推送 "+S.pushed+" 条 · 拉取 "+S.pulled+" 条 · 删除 "+S.removed+" 条",We.value="",He("同步完成")}catch(S){_e.value=S instanceof Error?S.message:"同步失败"}Xe.value=!1}}async function je(){if(Pe.value="",ee.value!==Ie.value){Pe.value="两次输入的新密码不一致";return}try{await Im(F.value,ee.value),F.value="",ee.value="",Ie.value="",He("登录密码已修改")}catch(S){Pe.value=S instanceof Error?S.message:"修改失败"}}async function fe(){await jm(),window.location.reload()}async function De(){t.value=await Ks(),n.value=await nr(!0),i.value=(await ml()).join(`
`),c.value=await Ct("ai_base_url",""),f.value=await Ct("ai_api_key",""),v.value=await Ct("ai_model",""),await pe(),await B()}async function rt(){await Dt("ai_base_url",c.value.trim()),await Dt("ai_api_key",f.value.trim()),await Dt("ai_model",v.value.trim()),He("AI 配置已保存")}async function Ve(){const S=bt(),x=await Promise.all([Hr("2000-01-01",S),nr(!0)]),Z=x[0],Te=x[1],Ue=new Map(Te.map(Ge=>[Ge.id,Ge.name])),Je=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const Ge of Z)Je.push([Ge.date,categoryLabel(Ge.category),Ge.project_id&&Ue.get(Ge.project_id)||"",Ge.content,Ge.minutes==null?"":Ge.minutes,Ge.is_milestone?"是":"",Ge.needs_followup?"是":"",Ge.takeaway||"",Ge.remark||""]);const ct=await bi("工作记录_"+S.replace(/-/g,"")+".csv",Je);He(ct?"CSV 已导出到:"+ct:"CSV 已导出到系统下载目录")}async function b(){const S=bt(),x=await Promise.all([Ks(),Ca("2000-01-01",S)]),Z=x[0],Te=x[1],Ue=["周日","周一","周二","周三","周四","周五","周六"],Je=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const Ge of Te){const Lt=Xr(Ge,Ge.date,Z,Ge.date===S);Je.push([Ge.date,Ue[Rs(Ge.date).getDay()],Lt.label,Ge.clock_in_at?Un(Ge.clock_in_at):"",Ge.clock_out_at?Un(Ge.clock_out_at):"",Ge.location||"",Ge.kind==="makeup"?"补卡":Ge.kind==="leave"?"休假":"正常",Ge.note||""])}const ct=await bi("考勤记录_"+S.replace(/-/g,"")+".csv",Je);He(ct?"CSV 已导出到:"+ct:"CSV 已导出到系统下载目录")}an(De);async function _(){await Dt("work_start",t.value.work_start),await Dt("work_end",t.value.work_end),await Dt("grace_minutes",String(t.value.grace_minutes)),await Dt("lunch_minutes",String(t.value.lunch_minutes)),await Dt("remind_weekly",t.value.remind_weekly),He("打卡规则已保存")}async function X(){await Cd(i.value.split(`
`)),He("常用地点已保存")}async function de(){const S=r.value.trim();if(S){try{await nh(S),o.value="",r.value=""}catch{o.value="项目名已存在"}await De()}}function H(S){y.value=S.id,h.value=S.name}async function ie(S){const x=h.value.trim();if(x)try{await sh(S.id,x),o.value=""}catch{o.value="项目名已存在"}y.value=null,await De()}async function Se(S){await rh(S.id,S.archived!==1),await De()}async function Ee(){try{const S=await jh(),x=await gl("实习日志备份_"+bt().replace(/-/g,"")+".json",S);He(x?"备份已导出到:"+x:"备份已导出到系统下载目录")}catch(S){He("导出失败:"+(S instanceof Error?S.message:String(S)))}}function ge(S){const x=S.target,Z=x.files&&x.files[0];if($.value="",!Z)return;const Te=Z.name;Z.text().then(Ue=>{ne.value={name:Te,text:Ue}}),x.value=""}async function ce(){if(ne.value)try{await Dh(ne.value.text),ne.value=null,$.value="",await De(),He("数据导入完成")}catch(S){ne.value=null,$.value=S instanceof Error?S.message:"导入失败"}}return(S,x)=>(E(),A("div",E0,[l("div",T0,[x[32]||(x[32]=l("div",{class:"section-title"},"账号与隐私",-1)),l("div",A0,"v"+z(cn(Re))+" · 当前账号 "+z(R.value)+" · 登录密码仅存 PBKDF2 哈希",1),l("div",P0,[l("div",O0,[x[29]||(x[29]=l("label",null,"旧登录密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":x[0]||(x[0]=Z=>F.value=Z)},null,512),[[Fe,F.value]])]),l("div",M0,[x[30]||(x[30]=l("label",null,"新登录密码(至少 6 位)",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":x[1]||(x[1]=Z=>ee.value=Z)},null,512),[[Fe,ee.value]])]),l("div",I0,[x[31]||(x[31]=l("label",null,"确认新登录密码",-1)),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":x[2]||(x[2]=Z=>Ie.value=Z)},null,512),[[Fe,Ie.value]])])]),Pe.value?(E(),A("div",j0,z(Pe.value),1)):we("",!0),l("div",D0,[l("button",{class:"btn btn-primary btn-sm",onClick:je},"修改登录密码"),l("button",{class:"btn btn-sm btn-danger",onClick:x[3]||(x[3]=Z=>ke.value=!0)},"删除此用户及全部数据")])]),l("div",L0,[x[39]||(x[39]=l("div",{class:"section-title"},"打卡规则",-1)),l("div",K0,[l("div",R0,[x[33]||(x[33]=l("label",null,"上班时间",-1)),Oe(l("input",{type:"time",class:"input","onUpdate:modelValue":x[4]||(x[4]=Z=>t.value.work_start=Z)},null,512),[[Fe,t.value.work_start]])]),l("div",N0,[x[34]||(x[34]=l("label",null,"下班时间",-1)),Oe(l("input",{type:"time",class:"input","onUpdate:modelValue":x[5]||(x[5]=Z=>t.value.work_end=Z)},null,512),[[Fe,t.value.work_end]])]),l("div",F0,[x[35]||(x[35]=l("label",null,"迟到宽限(分钟)",-1)),Oe(l("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":x[6]||(x[6]=Z=>t.value.grace_minutes=Z)},null,512),[[Fe,t.value.grace_minutes,void 0,{number:!0}]])]),l("div",V0,[x[36]||(x[36]=l("label",null,"午休扣除(分钟)",-1)),Oe(l("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":x[7]||(x[7]=Z=>t.value.lunch_minutes=Z)},null,512),[[Fe,t.value.lunch_minutes,void 0,{number:!0}]])]),l("div",B0,[x[38]||(x[38]=l("label",null,"周记提醒",-1)),Oe(l("select",{class:"select","onUpdate:modelValue":x[8]||(x[8]=Z=>t.value.remind_weekly=Z)},[...x[37]||(x[37]=[l("option",{value:"friday"},"每周五提醒",-1),l("option",{value:"off"},"关闭",-1)])],512),[[Pn,t.value.remind_weekly]])])]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:_},"保存规则")])]),l("div",U0,[x[40]||(x[40]=l("div",{class:"section-title"},"项目管理",-1)),l("div",q0,[Oe(l("input",{class:"input","onUpdate:modelValue":x[9]||(x[9]=Z=>r.value=Z),placeholder:"新项目名称",onKeydown:Et(de,["enter"])},null,544),[[Fe,r.value]]),l("button",{class:"btn btn-sm",onClick:de},"添加")]),o.value?(E(),A("div",H0,z(o.value),1)):we("",!0),(E(!0),A(Ke,null,at(n.value,Z=>(E(),A("div",{key:Z.id,class:"proj-row"},[y.value===Z.id?(E(),A(Ke,{key:0},[Oe(l("input",{class:"input","onUpdate:modelValue":x[10]||(x[10]=Te=>h.value=Te),onKeydown:Et(Te=>ie(Z),["enter"])},null,40,W0),[[Fe,h.value]]),l("button",{class:"btn btn-sm",onClick:Te=>ie(Z)},"保存",8,z0),l("button",{class:"btn btn-sm",onClick:x[11]||(x[11]=Te=>y.value=null)},"取消")],64)):(E(),A(Ke,{key:1},[l("span",{class:tt(["proj-name",{archived:Z.archived===1}])},z(Z.name),3),l("button",{class:"icon-btn",title:"重命名",onClick:Te=>H(Z)},[Me(et,{name:"edit",size:14})],8,G0),l("button",{class:"btn btn-sm",onClick:Te=>Se(Z)},z(Z.archived===1?"恢复":"归档"),9,Y0)],64))]))),128)),n.value.length?we("",!0):(E(),A("div",J0,"暂无项目,先添加一个"))]),l("div",X0,[x[42]||(x[42]=l("div",{class:"section-title"},"常用地点",-1)),Oe(l("textarea",{class:"textarea","onUpdate:modelValue":x[12]||(x[12]=Z=>i.value=Z),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[Fe,i.value]]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:X},"保存地点"),x[41]||(x[41]=l("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),l("div",Q0,[x[43]||(x[43]=l("div",{class:"section-title"},"多端数据同步",-1)),l("div",Z0,"云端账号:"+z(xe.value||"未绑定")+" · 数据存于服务器,其他端变更秒级自动刷新",1),l("div",ek,[l("button",{class:"btn btn-primary btn-sm",disabled:Xe.value,onClick:dt},z(Xe.value?"同步中":"立即同步"),9,tk),l("button",{class:"btn btn-sm",onClick:Ne},"重新校验连接")]),me.value?(E(),A("div",nk,"上次同步:"+z(Ae.value||"--")+" · "+z(me.value),1)):we("",!0),_e.value?(E(),A("div",sk,z(_e.value),1)):we("",!0),We.value?(E(),A("div",rk,"最近自动同步失败:"+z(We.value)+"(可点「立即同步」重试)",1)):we("",!0)]),l("div",ok,[x[48]||(x[48]=l("div",{class:"section-title"},"AI 润色配置(可选)",-1)),l("div",ak,[l("div",ik,[x[44]||(x[44]=l("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":x[13]||(x[13]=Z=>c.value=Z),placeholder:"https://api.example.com/v1"},null,512),[[Fe,c.value]])]),l("div",lk,[x[45]||(x[45]=l("label",null,"API Key",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":x[14]||(x[14]=Z=>f.value=Z),placeholder:"sk-..."},null,512),[[Fe,f.value]])]),l("div",uk,[x[46]||(x[46]=l("label",null,"模型名称",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":x[15]||(x[15]=Z=>v.value=Z),placeholder:"如:deepseek-chat"},null,512),[[Fe,v.value]])])]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:rt},"保存 AI 配置"),x[47]||(x[47]=l("span",{class:"muted loc-note"},"配置仅保存在本机;总结页「AI 润色」需此处先配置",-1))])]),l("div",ck,[x[52]||(x[52]=l("div",{class:"section-title"},"工作分类",-1)),l("div",dk,[l("div",fk,[x[49]||(x[49]=l("span",{class:"muted"},"工作记录分类",-1)),l("button",{class:"btn btn-xs",onClick:x[16]||(x[16]=Z=>te("log"))},"添加")]),l("div",pk,[(E(!0),A(Ke,null,at(w.value,(Z,Te)=>(E(),A("span",{key:Z+Te,class:"cat-chip"},[Pt(z(Z)+" ",1),l("button",{class:"chip-btn",title:"修改",onClick:Ue=>se("log",Te,Z)},"改",8,vk),l("button",{class:"chip-btn",title:"删除",onClick:Ue=>ae("log",Te)},"删",8,mk)]))),128))])]),l("div",hk,[l("div",yk,[x[50]||(x[50]=l("span",{class:"muted"},"记账支出分类",-1)),l("button",{class:"btn btn-xs",onClick:x[17]||(x[17]=Z=>te("expense"))},"添加")]),l("div",gk,[(E(!0),A(Ke,null,at(C.value,(Z,Te)=>(E(),A("span",{key:Z+Te,class:"cat-chip"},[Pt(z(Z)+" ",1),l("button",{class:"chip-btn",title:"修改",onClick:Ue=>se("expense",Te,Z)},"改",8,bk),l("button",{class:"chip-btn",title:"删除",onClick:Ue=>ae("expense",Te)},"删",8,wk)]))),128))])]),l("div",_k,[l("div",kk,[x[51]||(x[51]=l("span",{class:"muted"},"记账收入分类",-1)),l("button",{class:"btn btn-xs",onClick:x[18]||(x[18]=Z=>te("income"))},"添加")]),l("div",xk,[(E(!0),A(Ke,null,at(O.value,(Z,Te)=>(E(),A("span",{key:Z+Te,class:"cat-chip"},[Pt(z(Z)+" ",1),l("button",{class:"chip-btn",title:"修改",onClick:Ue=>se("income",Te,Z)},"改",8,Ck),l("button",{class:"chip-btn",title:"删除",onClick:Ue=>ae("income",Te)},"删",8,$k)]))),128))])])]),l("div",Sk,[x[54]||(x[54]=l("div",{class:"section-title"},"工作详情导出",-1)),l("div",Ek,[l("button",{class:tt(["seg-btn",{active:re.value==="day"}]),onClick:x[19]||(x[19]=Z=>re.value="day")},"当日",2),l("button",{class:tt(["seg-btn",{active:re.value==="week"}]),onClick:x[20]||(x[20]=Z=>re.value="week")},"当周",2),l("button",{class:tt(["seg-btn",{active:re.value==="month"}]),onClick:x[21]||(x[21]=Z=>re.value="month")},"当月",2),l("button",{class:tt(["seg-btn",{active:re.value==="custom"}]),onClick:x[22]||(x[22]=Z=>re.value="custom")},"自定义",2)]),l("div",Tk,[re.value==="custom"?(E(),A(Ke,{key:0},[Oe(l("input",{class:"input",type:"date","onUpdate:modelValue":x[23]||(x[23]=Z=>V.value=Z)},null,512),[[Fe,V.value]]),x[53]||(x[53]=l("span",{class:"muted"},"至",-1)),Oe(l("input",{class:"input",type:"date","onUpdate:modelValue":x[24]||(x[24]=Z=>T.value=Z)},null,512),[[Fe,T.value]])],64)):(E(),A(Ke,{key:1},[Oe(l("input",{class:"input",type:"date","onUpdate:modelValue":x[25]||(x[25]=Z=>V.value=Z)},null,512),[[Fe,V.value]]),l("span",Ak,z(re.value==="day"?"导出该日":re.value==="week"?"导出该日期所在一周":"导出该日期所在月份"),1)],64))]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:J},"导出 CSV")])]),l("div",Pk,[x[55]||(x[55]=l("div",{class:"section-title"},"数据备份",-1)),l("div",Ok,[l("button",{class:"btn btn-sm",onClick:Ee},"导出 JSON 备份"),l("button",{class:"btn btn-sm",onClick:x[26]||(x[26]=Z=>{var Te;return(Te=Y.value)==null?void 0:Te.click()})},"导入 JSON 备份"),l("button",{class:"btn btn-sm",onClick:Ve},"导出工作记录 CSV"),l("button",{class:"btn btn-sm",onClick:b},"导出考勤 CSV"),l("input",{ref_key:"fileInput",ref:Y,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:ge},null,544)]),$.value?(E(),A("div",Mk,z($.value),1)):we("",!0),x[56]||(x[56]=l("div",{class:"muted backup-note"},"数据保存在云端服务器;导出的 JSON 备份用于跨设备迁移或灾后恢复。",-1))]),Me(qn,{open:!!ne.value,title:"导入确认",message:ne.value?"将从文件「"+ne.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:x[27]||(x[27]=Z=>ne.value=null),onConfirm:ce},null,8,["open","message"]),Me(qn,{open:ke.value,title:"删除用户确认",message:"将永久删除云端账号「"+R.value+"」及其服务器上的全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,任何设备都无法再取回,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:x[28]||(x[28]=Z=>ke.value=!1),onConfirm:fe},null,8,["open","message"])]))}}),jk=Ut(Ik,[["__scopeId","data-v-e3f1f671"]]),Dk={class:"admin-page"},Lk={class:"card sec"},Kk={class:"toolbar"},Rk={key:0,class:"form-error"},Nk={class:"card table-card admin-table-card"},Fk={class:"admin-table"},Vk={class:"td-name","data-label":"用户名"},Bk={"data-label":"角色"},Uk={key:0,class:"role-badge"},qk={key:1,class:"muted"},Hk={class:"muted num","data-label":"创建时间"},Wk={class:"muted num","data-label":"数据量"},zk={class:"td-ops"},Gk={class:"ops"},Yk=["onClick"],Jk=["disabled","onClick"],Xk={key:0},Qk={key:0,class:"muted load-line"},Zk={class:"dialog create-dialog",role:"dialog","aria-label":"新增用户"},ex={class:"dialog-head"},tx={class:"dialog-body"},nx={class:"form-row"},sx={class:"form-row"},rx={class:"form-row"},ox={key:0,class:"form-error"},ax={class:"dialog-btns"},ix=["disabled"],lx={class:"dialog create-dialog",role:"dialog","aria-label":"重置密码"},ux={class:"dialog-head"},cx={class:"dialog-title"},dx={class:"dialog-body"},fx={class:"form-row"},px={key:0,class:"form-error"},vx={class:"dialog-btns"},mx=["disabled"],hx=Ft({__name:"UserAdminView",setup(e){const t=P([]),n=P(""),r=P(!0),o=P("");async function i($,R){const F=await Ns();let ee=xa();if(!ee){const Pe=bn(),ke=await fetch(F+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Pe==null?void 0:Pe.username,password:Pe==null?void 0:Pe.password})});if(ke.ok){const Re=await ke.json();ee=String(Re.token||""),Br(ee)}}const Ie=await fetch(F+$,{method:R?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+ee},body:R?JSON.stringify(R):void 0});if(Ie.status===401&&bn()){const Pe=bn(),ke=await fetch(F+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Pe==null?void 0:Pe.username,password:Pe==null?void 0:Pe.password})});if(ke.ok){const Re=await ke.json();ee=String(Re.token||""),Br(ee);const xe=await fetch(F+$,{method:R?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+ee},body:R?JSON.stringify(R):void 0});return{ok:xe.ok,status:xe.status,data:await xe.json().catch(()=>({}))}}}return{ok:Ie.ok,status:Ie.status,data:await Ie.json().catch(()=>({}))}}async function c(){r.value=!0,o.value="";const $=await i("/api/admin/users");if(!$.ok){r.value=!1,o.value=$.data&&$.data.error||"加载失败 "+$.status;return}t.value=$.data.users||[],n.value=$.data.me||"",r.value=!1}function f($){return $<=0?"--":$<1024?$+" B":$<1024*1024?($/1024).toFixed(1)+" KB":($/1024/1024).toFixed(2)+" MB"}function v($){return($||"").slice(0,10)}const y=P(!1),h=P(""),w=P(""),C=P(""),O=P(""),B=P(!1);function te(){y.value=!0,O.value="",h.value="",w.value="",C.value=""}async function se(){const $=h.value.trim();if(w.value!==C.value){O.value="两次输入的密码不一致";return}if(w.value.length<6){O.value="密码至少 6 位";return}B.value=!0;const R=await i("/api/admin/users/create",{username:$,password:w.value});if(B.value=!1,!R.ok){O.value=R.data&&R.data.error||"创建失败 "+R.status;return}He("用户「"+$+"」已创建"),y.value=!1,await c()}const ae=P(null),re=P(""),V=P(""),T=P(!1);function U($){ae.value=$,re.value="",V.value=""}async function J(){if(!ae.value)return;if(re.value.length<6){V.value="密码至少 6 位";return}T.value=!0;const $=await i("/api/admin/users/password",{userId:ae.value.id,newPassword:re.value});if(T.value=!1,!$.ok){V.value=$.data&&$.data.error||"重置失败 "+$.status;return}He("已重置「"+ae.value.username+"」的登录密码"),ae.value=null}const Y=P(null);async function ne(){if(!Y.value)return;const $=await i("/api/admin/users/delete",{userId:Y.value.id});if(!$.ok){Y.value=null,He($.data&&$.data.error||"删除失败");return}He("已删除账号「"+Y.value.username+"」及其全部云端数据"),Y.value=null,await c()}return an(c),($,R)=>(E(),A("div",Dk,[l("div",Lk,[l("div",Kk,[R[12]||(R[12]=l("div",{class:"head-wrap"},[l("div",{class:"sec-title"},"用户管理"),l("div",{class:"muted head-sub"},"云端账号统一管理 · 管理员:xionglin")],-1)),l("button",{class:"btn btn-primary btn-sm",onClick:te},[Me(et,{name:"plus",size:14}),R[11]||(R[11]=Pt(" 新增用户 ",-1))])]),o.value?(E(),A("div",Rk,z(o.value),1)):we("",!0)]),l("div",Nk,[l("table",Fk,[R[14]||(R[14]=l("thead",null,[l("tr",null,[l("th",null,"用户名"),l("th",null,"角色"),l("th",null,"创建时间"),l("th",null,"数据量"),l("th",{class:"th-ops"},"操作")])],-1)),l("tbody",null,[(E(!0),A(Ke,null,at(t.value,F=>(E(),A("tr",{key:F.id},[l("td",Vk,z(F.username),1),l("td",Bk,[F.role==="admin"?(E(),A("span",Uk,"管理员")):(E(),A("span",qk,"普通用户"))]),l("td",Hk,z(v(F.created_at)),1),l("td",Wk,z(f(F.data_bytes)),1),l("td",zk,[l("div",Gk,[l("button",{class:"btn btn-xs",onClick:ee=>U(F)},"重置密码",8,Yk),l("button",{class:"btn btn-xs btn-danger",disabled:F.id===n.value,onClick:ee=>Y.value=F},"删除",8,Jk)])])]))),128)),!r.value&&!t.value.length?(E(),A("tr",Xk,[...R[13]||(R[13]=[l("td",{colspan:"5",class:"empty muted"},"加载结果为空",-1)])])):we("",!0)])]),r.value?(E(),A("div",Qk,"加载中")):we("",!0)]),R[20]||(R[20]=l("div",{class:"muted admin-note"},"重置密码立即生效;删除账号将移除其全部云端数据,不可恢复。自己的账号不能删除。",-1)),(E(),At(cs,{to:"body"},[y.value?(E(),A("div",{key:0,class:"fixed-mask",onClick:R[5]||(R[5]=en(F=>y.value=!1,["self"]))},[l("div",Zk,[l("div",ex,[R[15]||(R[15]=l("span",{class:"dialog-title"},"新增用户",-1)),l("button",{class:"icon-btn",onClick:R[0]||(R[0]=F=>y.value=!1)},[Me(et,{name:"close",size:16})])]),l("div",tx,[l("div",nx,[R[16]||(R[16]=l("label",null,"用户名(2 到 20 个字符)",-1)),Oe(l("input",{class:"input","onUpdate:modelValue":R[1]||(R[1]=F=>h.value=F),placeholder:"如:xiaowang"},null,512),[[Fe,h.value]])]),l("div",sx,[R[17]||(R[17]=l("label",null,"初始登录密码(至少 6 位)",-1)),Oe(l("input",{class:"input",type:"password","onUpdate:modelValue":R[2]||(R[2]=F=>w.value=F),placeholder:"转发给使用者,登录后可自行修改"},null,512),[[Fe,w.value]])]),l("div",rx,[R[18]||(R[18]=l("label",null,"确认密码",-1)),Oe(l("input",{class:"input",type:"password","onUpdate:modelValue":R[3]||(R[3]=F=>C.value=F),onKeydown:Et(se,["enter"])},null,544),[[Fe,C.value]])]),O.value?(E(),A("div",ox,z(O.value),1)):we("",!0)]),l("div",ax,[l("button",{class:"btn btn-sm",onClick:R[4]||(R[4]=F=>y.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",disabled:B.value||!h.value.trim(),onClick:se},z(B.value?"创建中":"创建"),9,ix)])])])):we("",!0)])),(E(),At(cs,{to:"body"},[ae.value?(E(),A("div",{key:0,class:"fixed-mask",onClick:R[9]||(R[9]=en(F=>ae.value=null,["self"]))},[l("div",lx,[l("div",ux,[l("span",cx,"重置「"+z(ae.value.username)+"」的登录密码",1),l("button",{class:"icon-btn",onClick:R[6]||(R[6]=F=>ae.value=null)},[Me(et,{name:"close",size:16})])]),l("div",dx,[l("div",fx,[R[19]||(R[19]=l("label",null,"新登录密码(至少 6 位)",-1)),Oe(l("input",{class:"input",type:"password","onUpdate:modelValue":R[7]||(R[7]=F=>re.value=F),onKeydown:Et(J,["enter"])},null,544),[[Fe,re.value]])]),V.value?(E(),A("div",px,z(V.value),1)):we("",!0)]),l("div",vx,[l("button",{class:"btn btn-sm",onClick:R[8]||(R[8]=F=>ae.value=null)},"取消"),l("button",{class:"btn btn-primary btn-sm",disabled:T.value,onClick:J},z(T.value?"提交中":"重置"),9,mx)])])])):we("",!0)])),Me(qn,{open:!!Y.value,title:"删除用户确认",message:Y.value?"将永久删除云端账号「"+Y.value.username+"」及其服务器上的全部数据,不可恢复。请确认。":"","confirm-text":"永久删除",danger:"",onCancel:R[10]||(R[10]=F=>Y.value=null),onConfirm:ne},null,8,["open","message"])]))}}),yx=Ut(hx,[["__scopeId","data-v-06be07ff"]]),gx={class:"login-page"},bx={class:"card login-card"},wx={class:"login-brand"},_x={class:"brand-icon"},kx={class:"seg"},xx=["placeholder"],Cx={key:1,class:"form-error"},$x=["disabled"],Sx=Ft({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,r=P("login"),o=P(""),i=P(""),c=P(""),f=P(""),v=P(!1);function y(w){r.value=w,f.value="",c.value=""}async function h(){if(!v.value){f.value="",v.value=!0;try{let w;if(r.value==="login")w=await Tm(o.value,i.value);else{if(i.value.length<6){f.value="登录密码至少 6 位",v.value=!1;return}if(i.value!==c.value){f.value="两次输入的密码不一致",v.value=!1;return}w=await Am(o.value,i.value)}n("login",w)}catch(w){f.value=w instanceof Error?w.message:"操作失败"}v.value=!1}}return(w,C)=>(E(),A("div",gx,[l("div",bx,[l("div",wx,[l("div",_x,[Me(et,{name:"calendar",size:22})]),C[5]||(C[5]=l("div",{class:"login-title"},"实习工作日志",-1)),C[6]||(C[6]=l("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),C[7]||(C[7]=l("div",{class:"muted login-sub"},"数据保存在云端服务器,所有设备登录同一账号即可实时同步",-1))]),l("div",kx,[l("button",{class:tt(["seg-btn",{active:r.value==="login"}]),onClick:C[0]||(C[0]=O=>y("login"))},"登录",2),l("button",{class:tt(["seg-btn",{active:r.value==="create"}]),onClick:C[1]||(C[1]=O=>y("create"))},"创建用户",2)]),Oe(l("input",{class:"input","onUpdate:modelValue":C[2]||(C[2]=O=>o.value=O),placeholder:"用户名(2 到 20 个字符)",onKeydown:Et(h,["enter"])},null,544),[[Fe,o.value]]),Oe(l("input",{type:"password",class:"input","onUpdate:modelValue":C[3]||(C[3]=O=>i.value=O),placeholder:r.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:Et(h,["enter"])},null,40,xx),[[Fe,i.value]]),r.value==="create"?Oe((E(),A("input",{key:0,type:"password",class:"input","onUpdate:modelValue":C[4]||(C[4]=O=>c.value=O),placeholder:"再次输入密码",onKeydown:Et(h,["enter"])},null,544)),[[Fe,c.value]]):we("",!0),f.value?(E(),A("div",Cx,z(f.value),1)):we("",!0),l("button",{class:"btn btn-primary login-btn",disabled:v.value,onClick:h},z(r.value==="login"?"登录":"创建并进入"),9,$x),C[8]||(C[8]=l("div",{class:"muted login-note"}," 登录密码仅服务器保存哈希;本机保存加密的自动登录凭据,登录后无需重复输入 ",-1))])]))}}),Ex=Ut(Sx,[["__scopeId","data-v-bf714afa"]]),Tx={key:1,class:"app"},Ax={class:"side"},Px={key:0,class:"nav-sep"},Ox=["data-tip","onClick"],Mx={class:"main"},Ix={class:"topbar"},jx={class:"title"},Dx={class:"gsearch"},Lx={key:0,class:"gs-panel"},Kx={key:0,class:"gs-group muted"},Rx=["onMousedown"],Nx={class:"tag"},Fx={class:"gs-text"},Vx={class:"muted num gs-date"},Bx={key:1,class:"gs-group muted"},Ux=["onMousedown"],qx={class:"gs-text"},Hx={class:"muted gs-sub"},Wx={key:1,class:"gs-empty muted"},zx={class:"topbar-actions"},Gx={class:"user-chip num mobile-hide"},Yx=["disabled"],Jx={class:"num"},Xx={class:"content"},Qx={class:"content-inner"},Zx={class:"tabbar"},eC=["onClick"],tC={class:"sheet-user num"},nC=["onClick"],sC={class:"sheet-name"},rC={class:"msw"},oC={class:"msw-bar"},aC={class:"msw-results"},iC={key:0,class:"gs-group muted"},lC=["onMousedown"],uC={class:"tag"},cC={class:"gs-text"},dC={class:"muted num gs-date"},fC={key:1,class:"gs-group muted"},pC=["onMousedown"],vC={class:"gs-text"},mC={class:"muted gs-sub"},hC={key:1,class:"gs-empty muted"},yC={class:"toast-wrap"},gC=Ft({__name:"App",setup(e){const t=oy(),n=P(Ur());async function r(b){n.value=b,oa(b.userId),location.hash="#/calendar",U.value="calendar",await Ne(),await Ve(),c();try{await gd(),await tr()}catch{}He("欢迎,"+b.username);const _=sessionStorage.getItem("dsh_migrate_toast");_&&(sessionStorage.removeItem("dsh_migrate_toast"),He("已迁移原有数据 "+_+" 条"))}async function o(){Re.value=!1,Pe.value=!1,qm(),i!==null&&(window.clearInterval(i),i=null),await Om(),n.value=null,U.value="calendar",location.hash="#/calendar",He("已退出登录")}let i=null;function c(){Um(),i!==null&&window.clearInterval(i),i=window.setInterval(()=>{tr()},60*1e3),tr()}const f=P(null),v=P(""),y=P(!1),h=P({logs:[],memos:[]});let w=null;const C=it(()=>!!(h.value.logs.length||h.value.memos.length));function O(){w&&window.clearTimeout(w);const b=v.value;w=window.setTimeout(async()=>{const _=b.trim();if(!_){h.value={logs:[],memos:[]};return}const X=await Promise.all([Eh(_,8),Th(_,4)]);h.value={logs:X[0],memos:X[1]}},200)}function B(){v.value="",h.value={logs:[],memos:[]},y.value=!1}function te(b){Fi.value=b.date,J("calendar"),B()}function se(b){Vi.value=b.id,J("memo"),B()}function ae(){window.setTimeout(()=>{y.value=!1},150)}function re(b){var _;(b.ctrlKey||b.metaKey)&&b.key.toLowerCase()==="k"&&(b.preventDefault(),(_=f.value)==null||_.focus())}const V=[{key:"calendar",name:"日历",icon:"calendar",group:"记录"},{key:"today",name:"详情",icon:"edit",group:"记录"},{key:"plan",name:"计划",icon:"plan",group:"记录"},{key:"ledger",name:"记账",icon:"wallet",group:"工具"},{key:"memo",name:"备忘录",icon:"memo",group:"工具"},{key:"stats",name:"统计",icon:"chart",group:"分析"},{key:"report",name:"总结",icon:"export",group:"分析"},{key:"vault",name:"密码库",icon:"lock",group:"系统"},{key:"settings",name:"设置",icon:"settings",group:"系统"},{key:"admin",name:"用户管理",icon:"shield",group:"系统"}];function T(){var _;const b=(location.hash||"").replace("#/","");return!V.some(X=>X.key===b)||b==="admin"&&(((_=Ur())==null?void 0:_.username)||"")!=="xionglin"?"calendar":b}const U=P(T());window.addEventListener("hashchange",()=>{U.value=T()});function J(b){location.hash="#/"+b}const Y=it(()=>V.find(b=>b.key===U.value)||V[0]),ne=it(()=>{var b;return(((b=n.value)==null?void 0:b.username)||"")==="xionglin"}),$=it(()=>ne.value?V:V.filter(b=>b.key!=="admin")),R=it(()=>{const b=V.filter(_=>!ee.includes(_.key));return ne.value?b:b.filter(_=>_.key!=="admin")}),F=it(()=>R.value.some(b=>b.key===U.value));wt([ne,U],()=>{U.value==="admin"&&!ne.value&&J("calendar")},{immediate:!0});const ee=["calendar","today","plan","ledger"],Ie=V.filter(b=>ee.includes(b.key)),Pe=P(!1);function ke(b){Pe.value=!1,J(b)}const Re=P(!1),xe=P(null);function me(){Re.value=!0,window.setTimeout(()=>{var b;return(b=xe.value)==null?void 0:b.focus()},60)}function _e(b){te(b),Re.value=!1}function We(b){se(b),Re.value=!1}const Xe=P(bt()),Ae=P(void 0),pe=P(!1);async function Ne(){if(Ae.value=await wn(Xe.value),pe.value=!1,new Date().getHours()<4){const _=await wn(on(Xe.value,-1));pe.value=!!(_&&_.clock_in_at&&!_.clock_out_at)}}const dt=it(()=>{const b=Ae.value;return b&&b.clock_in_at&&!b.clock_out_at?!0:pe.value&&!(b&&b.clock_in_at)}),je=it(()=>{const b=Ae.value;return!!(b&&b.clock_in_at&&b.clock_out_at)}),fe=it(()=>{const b=Ae.value;return dt.value?"下班打卡":je.value?"已打卡 "+Un(b==null?void 0:b.clock_in_at)+" - "+Un(b==null?void 0:b.clock_out_at):"上班打卡"});async function De(){if(dt.value)try{await ah()}catch{}else await $d(Xe.value);await Ne(),rs()}wt(ur,()=>{n.value&&Ne()});const rt=P(!1);async function Ve(){if((await Ks()).remind_weekly==="off"){rt.value=!1;return}const _=new Date().getDay();if(_===5||_===6||_===0){const X=await hl(Qs(Xe.value));rt.value=!X||!X.highlights&&!X.challenges&&!X.plan_next}else rt.value=!1}return an(async()=>{window.addEventListener("keydown",re),n.value&&(oa(n.value.userId),await Ne(),await Ve(),c())}),(b,_)=>{var X,de;return n.value?(E(),A("div",Tx,[l("nav",Ax,[(E(!0),A(Ke,null,at($.value,(H,ie)=>(E(),A(Ke,{key:H.key},[ie>0&&H.group!==$.value[ie-1].group?(E(),A("div",Px)):we("",!0),l("button",{class:tt(["nav-btn",{active:U.value===H.key}]),"data-tip":H.name,onClick:Se=>J(H.key)},[Me(et,{name:H.icon,size:18},null,8,["name"])],10,Ox)],64))),128))]),l("div",Mx,[l("header",Ix,[l("span",jx,z(Y.value.name),1),l("button",{class:"mob-search-btn",title:"搜索",onClick:me},[Me(et,{name:"search",size:16})]),l("div",Dx,[Me(et,{name:"search",size:14,class:"gs-icon"}),Oe(l("input",{ref_key:"gsInput",ref:f,class:"input gs-input","onUpdate:modelValue":_[0]||(_[0]=H=>v.value=H),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:O,onFocus:_[1]||(_[1]=H=>y.value=!0),onBlur:ae,onKeydown:Et(B,["esc"])},null,544),[[Fe,v.value]]),y.value&&v.value.trim()?(E(),A("div",Lx,[C.value?(E(),A(Ke,{key:0},[h.value.logs.length?(E(),A("div",Kx,"工作记录")):we("",!0),(E(!0),A(Ke,null,at(h.value.logs,H=>(E(),A("div",{key:"l"+H.id,class:"gs-item",onMousedown:en(ie=>te(H),["prevent"])},[l("span",Nx,z(cn(Li)(H.category)),1),l("span",Fx,z(H.content),1),l("span",Vx,z(H.date),1)],40,Rx))),128)),h.value.memos.length?(E(),A("div",Bx,"备忘录")):we("",!0),(E(!0),A(Ke,null,at(h.value.memos,H=>(E(),A("div",{key:"m"+H.id,class:"gs-item",onMousedown:en(ie=>se(H),["prevent"])},[l("span",qx,z(H.title||"无标题"),1),l("span",Hx,z(H.content),1)],40,Ux))),128))],64)):(E(),A("div",Wx,"无匹配结果"))])):we("",!0)]),_[12]||(_[12]=l("span",{class:"flex1"},null,-1)),l("div",zx,[rt.value?(E(),A("button",{key:0,class:"week-tip",onClick:_[2]||(_[2]=H=>J("report"))},[..._[11]||(_[11]=[l("span",{class:"dot",style:{background:"var(--warn)"}},null,-1),Pt(" 填写本周周记 ",-1)])])):we("",!0),l("span",Gx,z((X=n.value)==null?void 0:X.username),1),l("button",{class:"btn btn-sm mobile-hide",onClick:o},"退出"),l("button",{class:"btn btn-primary btn-sm",disabled:je.value,onClick:De},[Me(et,{name:je.value?"check-circle":"clock",size:14},null,8,["name"]),l("span",Jx,z(fe.value),1)],8,Yx)])]),l("main",Xx,[l("div",Qx,[U.value==="calendar"?(E(),At(Tg,{key:0})):U.value==="today"?(E(),At(jg,{key:1})):U.value==="plan"?(E(),At(bb,{key:2})):U.value==="stats"?(E(),At(Jb,{key:3})):U.value==="report"?(E(),At(Yw,{key:4})):U.value==="ledger"?(E(),At(d1,{key:5})):U.value==="memo"?(E(),At(A1,{key:6})):U.value==="vault"?(E(),At($0,{key:7})):U.value==="admin"?(E(),At(yx,{key:8})):(E(),At(jk,{key:9}))])]),l("nav",Zx,[(E(!0),A(Ke,null,at(cn(Ie),H=>(E(),A("button",{key:H.key,class:tt(["tab-btn",{active:U.value===H.key}]),onClick:ie=>J(H.key)},[Me(et,{name:H.icon,size:20},null,8,["name"]),l("span",null,z(H.name),1)],10,eC))),128)),l("button",{class:tt(["tab-btn",{active:F.value}]),onClick:_[3]||(_[3]=H=>Pe.value=!0)},[Me(et,{name:"more",size:20}),_[13]||(_[13]=l("span",null,"更多",-1))],2)]),Pe.value?(E(),A("div",{key:0,class:"sheet-mask",onClick:_[6]||(_[6]=H=>Pe.value=!1)},[l("div",{class:"more-sheet",onClick:_[5]||(_[5]=en(()=>{},["stop"]))},[l("div",tC,z((de=n.value)==null?void 0:de.username),1),(E(!0),A(Ke,null,at(R.value,H=>(E(),A("button",{key:H.key,class:"sheet-row",onClick:ie=>ke(H.key)},[Me(et,{name:H.icon,size:18},null,8,["name"]),l("span",sC,z(H.name),1),Me(et,{name:"chevron-right",size:14,class:"sheet-go"})],8,nC))),128)),_[15]||(_[15]=l("div",{class:"sheet-divider"},null,-1)),l("button",{class:"sheet-row sheet-danger",onClick:_[4]||(_[4]=H=>{Pe.value=!1,o()})},[Me(et,{name:"close",size:18}),_[14]||(_[14]=l("span",{class:"sheet-name"},"退出登录",-1))])])])):we("",!0),Re.value?(E(),A("div",{key:1,class:"msw-mask",onClick:_[10]||(_[10]=en(H=>Re.value=!1,["self"]))},[l("div",rC,[l("div",oC,[Me(et,{name:"search",size:16,class:"msw-icon"}),Oe(l("input",{ref_key:"msInput",ref:xe,class:"msw-input","onUpdate:modelValue":_[7]||(_[7]=H=>v.value=H),placeholder:"搜索工作记录与备忘录",onInput:O,onKeydown:_[8]||(_[8]=Et(H=>Re.value=!1,["esc"]))},null,544),[[Fe,v.value]]),l("button",{class:"icon-btn",onClick:_[9]||(_[9]=H=>{B(),Re.value=!1})},[Me(et,{name:"close",size:16})])]),l("div",aC,[C.value?(E(),A(Ke,{key:0},[h.value.logs.length?(E(),A("div",iC,"工作记录")):we("",!0),(E(!0),A(Ke,null,at(h.value.logs,H=>(E(),A("div",{key:"l"+H.id,class:"msw-item",onMousedown:en(ie=>_e(H),["prevent"])},[l("span",uC,z(cn(Li)(H.category)),1),l("span",cC,z(H.content),1),l("span",dC,z(H.date),1)],40,lC))),128)),h.value.memos.length?(E(),A("div",fC,"备忘录")):we("",!0),(E(!0),A(Ke,null,at(h.value.memos,H=>(E(),A("div",{key:"m"+H.id,class:"msw-item",onMousedown:en(ie=>We(H),["prevent"])},[l("span",vC,z(H.title||"无标题"),1),l("span",mC,z(H.content),1)],40,pC))),128))],64)):v.value.trim()?(E(),A("div",hC,"无匹配结果")):we("",!0)])])])):we("",!0)]),l("div",yC,[Me(Tv,{name:"toast"},{default:vs(()=>[(E(!0),A(Ke,null,at(cn(t),H=>(E(),A("div",{key:H.id,class:"toast"},z(H.text),1))),128))]),_:1})])])):(E(),At(Ex,{key:0,onLogin:r}))}}}),bC=Ut(gC,[["__scopeId","data-v-c88c3788"]]);function Fo(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",i=>{i.target===n&&n.parentElement&&n.parentElement.removeChild(n)}),document.body.appendChild(n));const r=document.createElement("div");r.style.cssText="border:1px solid #E5484D;border-radius:8px;padding:12px;margin-bottom:12px;word-break:break-all;white-space:pre-wrap;",r.textContent=e+`
`+t;const o=document.createElement("button");o.textContent="重新加载",o.style.cssText="margin:-4px 0 12px;padding:6px 16px;border:1px solid #E5484D;border-radius:6px;background:#FFFFFF;color:#E5484D;font-size:13px;cursor:pointer;",o.addEventListener("click",()=>{try{location.reload()}catch{}}),n.appendChild(r),n.appendChild(o)}catch{}}async function wC(){const e=await Pm();e&&oa(e.userId);const t=Uv(bC);t.config.errorHandler=(n,r,o)=>{const i=n;Fo("应用内部错误(点击空白处关闭,请将以下内容发送给开发者)",i&&(i.stack||i.message)||String(n)+`
触发位置: `+o)},window.addEventListener("unhandledrejection",n=>{const r=n.reason;Fo("未处理的异步错误(点击空白处关闭)",r&&(r.stack||r.message)||String(n.reason))}),window.addEventListener("error",n=>{n.message&&n.message!=="ResizeObserver loop limit exceeded"&&Fo("运行错误(点击空白处关闭)",n.message)}),t.mount("#app"),"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})})}wC().catch(e=>{Fo("无法启动:连接同步服务器失败",e&&(e.stack||e.message)||String(e))});export{jd as W,Od as _,cw as b,Id as r};