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

25 lines
302 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();/**
* @vue/shared v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function ja(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ft={},Ar=[],En=()=>{},Lu=()=>!1,Qo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Zo=e=>e.startsWith("onUpdate:"),Et=Object.assign,Da=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Qf=Object.prototype.hasOwnProperty,ot=(e,t)=>Qf.call(e,t),Le=Array.isArray,rr=e=>Fs(e)==="[object Map]",Bn=e=>Fs(e)==="[object Set]",Nl=e=>Fs(e)==="[object Date]",Ge=e=>typeof e=="function",bt=e=>typeof e=="string",$n=e=>typeof e=="symbol",at=e=>e!==null&&typeof e=="object",Ku=e=>(at(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),Fu=Object.prototype.toString,Fs=e=>Fu.call(e),Zf=e=>Fs(e).slice(8,-1),Nu=e=>Fs(e)==="[object Object]",Ra=e=>bt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bs=ja(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ei=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ed=/-\w/g,hn=ei(e=>e.replace(ed,t=>t.slice(1).toUpperCase())),td=/\B([A-Z])/g,cr=ei(e=>e.replace(td,"-$1").toLowerCase()),Vu=ei(e=>e.charAt(0).toUpperCase()+e.slice(1)),Yi=ei(e=>e?`on${Vu(e)}`:""),Cn=(e,t)=>!Object.is(e,t),So=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Bu=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},ti=e=>{const t=parseFloat(e);return isNaN(t)?e:t},nd=e=>{const t=bt(e)?Number(e):NaN;return isNaN(t)?e:t};let Vl;const ni=()=>Vl||(Vl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function sr(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=bt(s)?id(s):sr(s);if(o)for(const a in o)t[a]=o[a]}return t}else if(bt(e)||at(e))return e}const rd=/;(?![^(]*\))/g,sd=/:([^]+)/,od=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function id(e){const t={};return e.replace(od,n=>n.startsWith("/*")?"":n).split(rd).forEach(n=>{if(n){const s=n.split(sd);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function et(e){let t="";if(bt(e))t=e;else if(Le(e))for(let n=0;n<e.length;n++){const s=et(e[n]);s&&(t+=s+" ")}else if(at(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ad="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",ld=ja(ad);function Uu(e){return!!e||e===""}function ud(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=Un(e[o],t[o],n);return s}function Bl(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),o=new Uint8Array(s.length);for(const a of e){let c=-1;for(let d=0;d<s.length;d++)if(!o[d]&&Un(a,s[d],n)){c=d;break}if(c<0)return!1;o[c]=1}return!0}function cd(e,t,n){let s=rr(e),o=rr(t);if(s||o||(s=Bn(e),o=Bn(t),s||o))return s&&o?Bl(e,t,n):!1;const a=Object.keys(e).length,c=Object.keys(t).length;if(a!==c)return!1;for(const d in e){const h=e.hasOwnProperty(d),y=t.hasOwnProperty(d);if(h&&!y||!h&&y||!Un(e[d],t[d],n))return!1}return String(e)===String(t)}function Ul(e,t,n,s){n||(n=[new Map,new Map]);const[o,a]=n;if(o.has(e)||a.has(t))return o.get(e)===t&&a.get(t)===e;o.set(e,t),a.set(t,e);const c=s(e,t,n);return o.delete(e),a.delete(t),c}function Un(e,t,n){if(e===t)return!0;let s=Nl(e),o=Nl(t);return s||o?s&&o?e.getTime()===t.getTime():!1:(s=$n(e),o=$n(t),s||o?e===t:(s=Le(e),o=Le(t),s||o?s&&o?Ul(e,t,n,ud):!1:(s=at(e),o=at(t),s||o?!s||!o?!1:Ul(e,t,n,cd):String(e)===String(t))))}function La(e,t){return e.findIndex(n=>Un(n,t))}const qu=e=>!!(e&&e.__v_isRef===!0),re=e=>bt(e)?e:e==null?"":Le(e)||at(e)&&(e.toString===Fu||!Ge(e.toString))?qu(e)?re(e.value):JSON.stringify(e,Hu,2):String(e),Hu=(e,t)=>qu(t)?Hu(e,t.value):rr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],a)=>(n[Ji(s,a)+" =>"]=o,n),{})}:Bn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Ji(n))}:$n(t)?Ji(t):at(t)&&!Le(t)&&!Nu(t)?String(t):t,Ji=(e,t="")=>{var n;return $n(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
* @vue/reactivity v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Mt;class fd{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Mt&&(Mt.active?(this.parent=Mt,this.index=(Mt.scopes||(Mt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=Mt;try{return Mt=this,t()}finally{Mt=n}}}on(){++this._on===1&&(this.prevScope=Mt,Mt=this)}off(){if(this._on>0&&--this._on===0){if(Mt===this)Mt=this.prevScope;else{let t=Mt;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function dd(){return Mt}let pt;const Xi=new WeakSet;class Wu{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Mt&&(Mt.active?Mt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Xi.has(this)&&(Xi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Gu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ql(this),Yu(this);const t=pt,n=vn;pt=this,vn=!0;try{return this.fn()}finally{Ju(this),pt=t,vn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Na(t);this.deps=this.depsTail=void 0,ql(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Xi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){fa(this)&&this.run()}get dirty(){return fa(this)}}let zu=0,ws,_s;function Gu(e,t=!1){if(e.flags|=8,t){e.next=_s,_s=e;return}e.next=ws,ws=e}function Ka(){zu++}function Fa(){if(--zu>0)return;if(_s){let t=_s;for(_s=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ws;){let t=ws;for(ws=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Yu(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ju(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Na(s),pd(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function fa(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Xu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Xu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===As)||(e.globalVersion=As,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!fa(e))))return;e.flags|=2;const t=e.dep,n=pt,s=vn;pt=e,vn=!0;try{Yu(e);const o=e.fn(e._value);(t.version===0||Cn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{pt=n,vn=s,Ju(e),e.flags&=-3}}function Na(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)Na(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function pd(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let vn=!0;const Qu=[];function An(){Qu.push(vn),vn=!1}function Pn(){const e=Qu.pop();vn=e===void 0?!0:e}function ql(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=pt;pt=void 0;try{t()}finally{pt=n}}}let As=0;class hd{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 Va{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(!pt||!vn||pt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pt)n=this.activeLink=new hd(pt,this),pt.deps?(n.prevDep=pt.depsTail,pt.depsTail.nextDep=n,pt.depsTail=n):pt.deps=pt.depsTail=n,Zu(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=pt.depsTail,n.nextDep=void 0,pt.depsTail.nextDep=n,pt.depsTail=n,pt.deps===n&&(pt.deps=s)}return n}trigger(t){this.version++,As++,this.notify(t)}notify(t){Ka();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Fa()}}}function Zu(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Zu(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const da=new WeakMap,Pr=Symbol(""),pa=Symbol(""),Ps=Symbol("");function Kt(e,t,n){if(vn&&pt){let s=da.get(e);s||da.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Va),o.map=s,o.key=n),o.track()}}function Rn(e,t,n,s,o,a){const c=da.get(e);if(!c){As++;return}const d=h=>{h&&h.trigger()};if(Ka(),t==="clear")c.forEach(d);else{const h=Le(e),y=h&&Ra(n);if(h&&n==="length"){const m=Number(s);c.forEach((k,D)=>{(D==="length"||D===Ps||!$n(D)&&D>=m)&&d(k)})}else switch((n!==void 0||c.has(void 0))&&d(c.get(n)),y&&d(c.get(Ps)),t){case"add":h?y&&d(c.get("length")):(d(c.get(Pr)),rr(e)&&d(c.get(pa)));break;case"delete":h||(d(c.get(Pr)),rr(e)&&d(c.get(pa)));break;case"set":rr(e)&&d(c.get(Pr));break}}Fa()}function qr(e){const t=st(e);return t===e||(Kt(t,"iterate",Ps),ln(e))?t:Tn(e)?or(e)?t.map(n=>ir(un(n))):t.map(ir):t.map(un)}function ri(e){return Kt(e=st(e),"iterate",Ps),e}function _n(e,t){return Tn(e)?ir(or(e)?un(t):t):un(t)}const vd={__proto__:null,[Symbol.iterator](){return Qi(this,Symbol.iterator,e=>_n(this,e))},concat(...e){return qr(this).concat(...e.map(t=>Le(t)?qr(t):t))},entries(){return Qi(this,"entries",e=>(e[1]=_n(this,e[1]),e))},every(e,t){return In(this,"every",e,t,void 0,arguments)},filter(e,t){return In(this,"filter",e,t,n=>n.map(s=>_n(this,s)),arguments)},find(e,t){return In(this,"find",e,t,n=>_n(this,n),arguments)},findIndex(e,t){return In(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return In(this,"findLast",e,t,n=>_n(this,n),arguments)},findLastIndex(e,t){return In(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return In(this,"forEach",e,t,void 0,arguments)},includes(...e){return Zi(this,"includes",e)},indexOf(...e){return Zi(this,"indexOf",e)},join(e){return qr(this).join(e)},lastIndexOf(...e){return Zi(this,"lastIndexOf",e)},map(e,t){return In(this,"map",e,t,void 0,arguments)},pop(){return ps(this,"pop")},push(...e){return ps(this,"push",e)},reduce(e,...t){return Wl(this,"reduce",e,t)},reduceRight(e,...t){return Wl(this,"reduceRight",e,t)},shift(){return ps(this,"shift")},some(e,t){return In(this,"some",e,t,void 0,arguments)},splice(...e){return ps(this,"splice",e)},toReversed(){return qr(this).toReversed()},toSorted(e){return qr(this).toSorted(e)},toSpliced(...e){return qr(this).toSpliced(...e)},unshift(...e){return ps(this,"unshift",e)},values(){return Qi(this,"values",e=>_n(this,e))}};function Qi(e,t,n){const s=ri(e),o=s[t],a=o.call(s);if(s!==e&&!ln(e)){if(a[Symbol.toStringTag]==="Array Iterator"){const c=Object.create(Object.getPrototypeOf(a));return c.next=()=>Hl(a.next(),n),o!==ec[t]&&Object.defineProperties(c,{return:{get(){const d=a.return;return typeof d=="function"?d.bind(a):d}},throw:{get(){const d=a.throw;return typeof d=="function"?d.bind(a):d}}}),c}a._next=a.next,a.next=()=>Hl(a._next(),n)}return a}function Hl(e,t){return e.done||(e.value=t(e.value)),e}const ec=Array.prototype;function In(e,t,n,s,o,a){const c=ri(e),d=c!==e&&!ln(e),h=c[t];if(h!==ec[t]){const k=h.apply(e,a);return d?un(k):k}let y=n;c!==e&&(d?y=function(k,D){return n.call(this,_n(e,k),D,e)}:n.length>2&&(y=function(k,D){return n.call(this,k,D,e)}));const m=h.call(c,y,s);return d&&o?o(m):m}function Wl(e,t,n,s){const o=ri(e),a=o!==e&&!ln(e);let c=n,d=!1;o!==e&&(a?(d=s.length===0,c=function(y,m,k){return d&&(d=!1,y=_n(e,y)),n.call(this,y,_n(e,m),k,e)}):n.length>3&&(c=function(y,m,k){return n.call(this,y,m,k,e)}));const h=o[t](c,...s);return d?_n(e,h):h}function Zi(e,t,n){const s=st(e);Kt(s,"iterate",Ps);const o=s[t](...n);return(o===-1||o===!1)&&Ha(n[0])?(n[0]=st(n[0]),s[t](...n)):o}function ps(e,t,n=[]){An(),Ka();const s=st(e)[t].apply(e,n);return Fa(),Pn(),s}const md=ja("__proto__,__v_isRef,__isVue"),tc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter($n));function yd(e){$n(e)||(e=String(e));const t=st(this);return Kt(t,"has",e),t.hasOwnProperty(e)}class nc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return a;if(n==="__v_raw")return s===(o?a?$d:ic:a?oc:sc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const c=Le(t);if(!o){let h;if(c&&(h=vd[n]))return h;if(n==="hasOwnProperty")return yd}const d=Reflect.get(t,n,Nt(t)?t:s);if(($n(n)?tc.has(n):md(n))||(o||Kt(t,"get",n),a))return d;if(Nt(d)){const h=c&&Ra(n)?d:d.value;return o&&at(h)?va(h):h}return at(d)?o?va(d):Ua(d):d}}class rc extends nc{constructor(t=!1){super(!1,t)}set(t,n,s,o){let a=t[n];const c=Le(t)&&Ra(n);if(!this._isShallow){const y=Tn(a);if(!ln(s)&&!Tn(s)&&(a=st(a),s=st(s)),!c&&Nt(a)&&!Nt(s))return y||(a.value=s),!0}const d=c?Number(n)<t.length:ot(t,n),h=Reflect.set(t,n,s,Nt(t)?t:o);return t===st(o)&&h&&(d?Cn(s,a)&&Rn(t,"set",n,s):Rn(t,"add",n,s)),h}deleteProperty(t,n){const s=ot(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Rn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!$n(n)||!tc.has(n))&&Kt(t,"has",n),s}ownKeys(t){return Kt(t,"iterate",Le(t)?"length":Pr),Reflect.ownKeys(t)}}class gd extends nc{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const bd=new rc,wd=new gd,_d=new rc(!0);const ha=e=>e,go=e=>Reflect.getPrototypeOf(e);function kd(e,t,n){return function(...s){const o=this.__v_raw,a=st(o),c=rr(a),d=e==="entries"||e===Symbol.iterator&&c,h=e==="keys"&&c,y=o[e](...s),m=n?ha:t?ir:un;return!t&&Kt(a,"iterate",h?pa:Pr),Et(Object.create(y),{next(){const{value:k,done:D}=y.next();return D?{value:k,done:D}:{value:d?[m(k[0]),m(k[1])]:m(k),done:D}}})}}function bo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function xd(e,t){const n={get(o){const a=this.__v_raw,c=st(a),d=st(o);e||(Cn(o,d)&&Kt(c,"get",o),Kt(c,"get",d));const{has:h}=go(c),y=t?ha:e?ir:un;if(h.call(c,o))return y(a.get(o));if(h.call(c,d))return y(a.get(d));a!==c&&a.get(o)},get size(){const o=this.__v_raw;return!e&&Kt(st(o),"iterate",Pr),o.size},has(o){const a=this.__v_raw,c=st(a),d=st(o);return e||(Cn(o,d)&&Kt(c,"has",o),Kt(c,"has",d)),o===d?a.has(o):a.has(o)||a.has(d)},forEach(o,a){const c=this,d=c.__v_raw,h=st(d),y=t?ha:e?ir:un;return!e&&Kt(h,"iterate",Pr),d.forEach((m,k)=>o.call(a,y(m),y(k),c))}};return Et(n,e?{add:bo("add"),set:bo("set"),delete:bo("delete"),clear:bo("clear")}:{add(o){const a=st(this),c=go(a),d=st(o),h=!t&&!ln(o)&&!Tn(o)?d:o;return c.has.call(a,h)||Cn(o,h)&&c.has.call(a,o)||Cn(d,h)&&c.has.call(a,d)||(a.add(h),Rn(a,"add",h,h)),this},set(o,a){!t&&!ln(a)&&!Tn(a)&&(a=st(a));const c=st(this),{has:d,get:h}=go(c);let y=d.call(c,o);y||(o=st(o),y=d.call(c,o));const m=h.call(c,o);return c.set(o,a),y?Cn(a,m)&&Rn(c,"set",o,a):Rn(c,"add",o,a),this},delete(o){const a=st(this),{has:c,get:d}=go(a);let h=c.call(a,o);h||(o=st(o),h=c.call(a,o)),d&&d.call(a,o);const y=a.delete(o);return h&&Rn(a,"delete",o,void 0),y},clear(){const o=st(this),a=o.size!==0,c=o.clear();return a&&Rn(o,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=kd(o,e,t)}),n}function Ba(e,t){const n=xd(e,t);return(s,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?s:Reflect.get(ot(n,o)&&o in s?n:s,o,a)}const Cd={get:Ba(!1,!1)},Sd={get:Ba(!1,!0)},Ed={get:Ba(!0,!1)};const sc=new WeakMap,oc=new WeakMap,ic=new WeakMap,$d=new WeakMap;function Ad(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ua(e){return Tn(e)?e:qa(e,!1,bd,Cd,sc)}function Pd(e){return qa(e,!1,_d,Sd,oc)}function va(e){return qa(e,!0,wd,Ed,ic)}function qa(e,t,n,s,o){if(!at(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const a=o.get(e);if(a)return a;const c=Ad(Zf(e));if(c===0)return e;const d=new Proxy(e,c===2?s:n);return o.set(e,d),d}function or(e){return Tn(e)?or(e.__v_raw):!!(e&&e.__v_isReactive)}function Tn(e){return!!(e&&e.__v_isReadonly)}function ln(e){return!!(e&&e.__v_isShallow)}function Ha(e){return e?!!e.__v_raw:!1}function st(e){const t=e&&e.__v_raw;return t?st(t):e}function Td(e){return!ot(e,"__v_skip")&&Object.isExtensible(e)&&Bu(e,"__v_skip",!0),e}const un=e=>at(e)?Ua(e):e,ir=e=>at(e)?va(e):e;function Nt(e){return e?e.__v_isRef===!0:!1}function V(e){return Od(e,!1)}function Od(e,t){return Nt(e)?e:new Md(e,t)}class Md{constructor(t,n){this.dep=new Va,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:st(t),this._value=n?t:un(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||ln(t)||Tn(t);t=s?t:st(t),Cn(t,n)&&(this._rawValue=t,this._value=s?t:un(t),this.dep.trigger())}}function Qt(e){return Nt(e)?e.value:e}const Id={get:(e,t,n)=>t==="__v_raw"?e:Qt(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Nt(o)&&!Nt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function ac(e){return or(e)?e:new Proxy(e,Id)}class jd{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Va(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=As-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&pt!==this)return Gu(this,!0),!0}get value(){const t=this.dep.track();return Xu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Dd(e,t,n=!1){let s,o;return Ge(e)?s=e:(s=e.get,o=e.set),new jd(s,o,n)}const wo={},Mo=new WeakMap;let Cr;function Rd(e,t=!1,n=Cr){if(n){let s=Mo.get(n);s||Mo.set(n,s=[]),s.push(e)}}function Ld(e,t,n=ft){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:d,call:h}=n,y=G=>o?G:ln(G)||o===!1||o===0?Ln(G,1):Ln(G);let m,k,D,T,L=!1,X=!1;if(Nt(e)?(k=()=>e.value,L=ln(e)):or(e)?(k=()=>y(e),L=!0):Le(e)?(X=!0,L=e.some(G=>or(G)||ln(G)),k=()=>e.map(G=>{if(Nt(G))return G.value;if(or(G))return y(G);if(Ge(G))return h?h(G,2):G()})):Ge(e)?t?k=h?()=>h(e,2):e:k=()=>{if(D){An();try{D()}finally{Pn()}}const G=Cr;Cr=m;try{return h?h(e,3,[T]):e(T)}finally{Cr=G}}:k=En,t&&o){const G=k,de=o===!0?1/0:o;k=()=>Ln(G(),de)}const ce=dd(),Q=()=>{m.stop(),ce&&ce.active&&Da(ce.effects,m)};if(a&&t){const G=t;t=(...de)=>{try{return G(...de)}finally{Q()}}}let E=X?new Array(e.length).fill(wo):wo;const N=G=>{if(!(!(m.flags&1)||!m.dirty&&!G))if(t){const de=m.run();if(G||o||L||(X?de.some((ae,Z)=>Cn(ae,E[Z])):Cn(de,E))){const ae=Cr;An();try{D&&D(),Cr=m;const Z=[de,E===wo?void 0:X&&E[0]===wo?[]:E,T];E=de,h?h(t,3,Z):t(...Z)}finally{Cr=ae,Pn()}}}else m.run()};return d&&d(N),m=new Wu(k),m.scheduler=c?()=>c(N,!1):N,T=G=>Rd(G,!1,m),D=m.onStop=()=>{const G=Mo.get(m);if(G){if(h)h(G,4);else for(const de of G)de();Mo.delete(m)}},t?s?N(!0):E=m.run():c?c(N.bind(null,!0),!0):m.run(),Q.pause=m.pause.bind(m),Q.resume=m.resume.bind(m),Q.stop=Q,Q}function Ln(e,t=1/0,n){if(t<=0||!at(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Nt(e))Ln(e.value,t,n);else if(Le(e))for(let s=0;s<e.length;s++)Ln(e[s],t,n);else if(Bn(e)||rr(e))e.forEach(s=>{Ln(s,t,n)});else if(Nu(e)){for(const s in e)Ln(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ln(e[s],t,n)}return e}/**
* @vue/runtime-core v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Ns(e,t,n,s){try{return s?e(...s):e()}catch(o){si(o,t,n)}}function cn(e,t,n,s){if(Ge(e)){const o=Ns(e,t,n,s);return o&&Ku(o)&&o.catch(a=>{si(a,t,n)}),o}if(Le(e)){const o=[];for(let a=0;a<e.length;a++)o.push(cn(e[a],t,n,s));return o}}function si(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||ft;if(t){let d=t.parent;const h=t.proxy,y=`https://vuejs.org/error-reference/#runtime-${n}`;for(;d;){const m=d.ec;if(m){for(let k=0;k<m.length;k++)if(m[k](e,h,y)===!1)return}d=d.parent}if(a){An(),Ns(a,null,10,[e,h,y]),Pn();return}}Kd(e,n,o,s,c)}function Kd(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Wt=[];let pn=-1;const kn=[];let tr=null,Hr=0;const lc=Promise.resolve();let Io=null;function ts(e){const t=Io||lc;return e?t.then(this?e.bind(this):e):t}function Fd(e){let t=pn+1,n=Wt.length;for(;t<n;){const s=t+n>>>1,o=Wt[s],a=Ts(o);a<e||a===e&&o.flags&2?t=s+1:n=s}return t}function Wa(e){if(!(e.flags&1)){const t=Ts(e),n=Wt[Wt.length-1];!n||!(e.flags&2)&&t>=Ts(n)?Wt.push(e):Wt.splice(Fd(t),0,e),e.flags|=1,uc()}}function uc(){Io||(Io=lc.then(dc))}function Nd(e){if(!Le(e))tr&&e.id===-1?tr.splice(Hr+1,0,e):e.flags&1||(kn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)kn.push(e[t]);uc()}function cc(e,t,n,s=pn+1){for(;s<Wt.length;s++){const o=Wt[s];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;Wt.splice(s,1),s=e?s-1:pn,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function fc(e,t,n=0){if(kn.length){let s=kn,o=0;if(t){s=[];for(let c=0;c<kn.length;c++){const d=kn[c];(d.i!==void 0?!d.i||d.i.uid<n:t.has(d))?kn[o++]=d:s.push(d)}}const a=[...new Set(s)].sort((c,d)=>Ts(c)-Ts(d));if(kn.length=o,tr){for(let c=0;c<a.length;c++)tr.push(a[c]);return}for(tr=a,Hr=0;Hr<tr.length;Hr++){const c=tr[Hr];c.flags&4&&(c.flags&=-2),c.flags&8||c(),c.flags&=-2}tr=null,Hr=0}}let ea=!1;function Vd(e,t){if(ea){e();return}const n=t===void 0?void 0:new Set(kn);e(),ea=!0;try{cc(void 0,t),fc(void 0,n,t)}finally{ea=!1}}const Ts=e=>e.id==null?e.flags&2?-1:1/0:e.id;function dc(e){try{for(pn=0;pn<Wt.length;pn++){const t=Wt[pn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ns(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;pn<Wt.length;pn++){const t=Wt[pn];t&&(t.flags&=-2)}pn=-1,Wt.length=0,fc(),Io=null,(Wt.length||kn.length)&&dc()}}let an=null,pc=null;function jo(e){const t=an;return an=e,pc=e&&e.type.__scopeId||null,t}function fr(e,t=an,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Ko(-1);const a=jo(t),c=Tr.length;let d;try{d=e(...o)}finally{for(let h=Tr.length;h>c;h--)Vc();jo(a),s._d&&Ko(1)}return d};return s._n=!0,s._c=!0,s._d=!0,s}function Ee(e,t){if(an===null)return e;const n=ci(an),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,c,d,h=ft]=t[o];a&&(Ge(a)&&(a={mounted:a,updated:a}),a.deep&&Ln(c),s.push({dir:a,instance:n,value:c,oldValue:void 0,arg:d,modifiers:h}))}return e}function _r(e,t,n,s){const o=e.dirs,a=t&&t.dirs;for(let c=0;c<o.length;c++){const d=o[c];a&&(d.oldValue=a[c].value);let h=d.dir[s];h&&(An(),cn(h,n,8,[e.el,d,e,t]),Pn())}}function Bd(e,t){if(zt){let n=zt.provides;const s=zt.parent&&zt.parent.provides;s===n&&(n=zt.provides=Object.create(s)),n[e]=t}}function Eo(e,t,n=!1){const s=Xa();if(s||zr){let o=zr?zr._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Ge(t)?t.call(s&&s.proxy):t}}const Ud=Symbol.for("v-scx"),qd=()=>Eo(Ud);function gt(e,t,n){return hc(e,t,n)}function hc(e,t,n=ft){const{immediate:s,deep:o,flush:a,once:c}=n,d=Et({},n),h=t&&s||!t&&a!=="post";let y;if(Rs){if(a==="sync"){const T=qd();y=T.__watcherHandles||(T.__watcherHandles=[])}else if(!h){const T=()=>{};return T.stop=En,T.resume=En,T.pause=En,T}}const m=zt;d.call=(T,L,X)=>cn(T,m,L,X);let k=!1;a==="post"?d.scheduler=T=>{T.i=m,Ht(T,m&&m.suspense)}:a!=="sync"&&(k=!0,d.scheduler=(T,L)=>{L?T():Wa(T)}),d.augmentJob=T=>{t&&(T.flags|=4),k&&(T.flags|=2,m&&(T.id=m.uid,T.i=m))};const D=Ld(e,t,d);return Rs&&(y?y.push(D):h&&D()),D}function Hd(e,t,n){const s=this.proxy,o=bt(e)?e.includes(".")?vc(s,e):()=>s[e]:e.bind(s,s);let a;Ge(t)?a=t:(a=t.handler,n=t);const c=Bs(this),d=hc(o,a.bind(s),n);return c(),d}function vc(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Zn=new WeakMap,mc=Symbol("_vte"),oi=e=>e.__isTeleport,Er=e=>e&&(e.disabled||e.disabled===""),Wd=e=>e&&(e.defer||e.defer===""),zl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Gl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ma=(e,t)=>{const n=e&&e.to;return bt(n)?t?t(n):null:n},zd={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,a,c,d,h,y){const{mc:m,pc:k,pbc:D,o:{insert:T,querySelector:L,createText:X,createComment:ce,parentNode:Q}}=y,E=Er(t.props);let{dynamicChildren:N}=t;const G=(Z,$,x)=>{Z.shapeFlag&16&&m(Z.children,$,x,o,a,c,d,h)},de=(Z=t)=>{const $=Er(Z.props),x=Z.target=ma(Z.props,L),le=ya(x,Z,X,T);x&&(c!=="svg"&&zl(x)?c="svg":c!=="mathml"&&Gl(x)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(x),$||(G(Z,x,le),ms(Z,!1)))},ae=Z=>{const $=()=>{if(Zn.get(Z)===$){if(Zn.delete(Z),Er(Z.props)){const x=Q(Z.el)||n;G(Z,x,Z.anchor),ms(Z,!0)}de(Z)}};Zn.set(Z,$),Ht($,a)};if(e==null){const Z=t.el=X(""),$=t.anchor=X("");if(T(Z,n,s),T($,n,s),Wd(t.props)||a&&a.pendingBranch){ae(t);return}E&&(G(t,n,$),ms(t,!0)),de()}else{t.el=e.el;const Z=t.anchor=e.anchor,$=Zn.get(e);if($){$.flags|=8,Zn.delete(e),ae(t);return}t.targetStart=e.targetStart;const x=t.target=e.target,le=t.targetAnchor=e.targetAnchor,ke=Er(e.props),J=ke?n:x,xe=ke?Z:le;if(c==="svg"||zl(x)?c="svg":(c==="mathml"||Gl(x))&&(c="mathml"),N?(D(e.dynamicChildren,N,J,o,a,c,d),Ja(e,t,!0)):h||k(e,t,J,xe,o,a,c,d,!1),E)ke?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):_o(t,n,Z,y,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Ve=ma(t.props,L);Ve&&(t.target=Ve,_o(t,Ve,null,y,0))}else ke&&_o(t,x,le,y,1);ms(t,E)}},remove(e,t,n,{um:s,o:{remove:o}},a){const{shapeFlag:c,children:d,anchor:h,targetStart:y,targetAnchor:m,target:k,props:D}=e,T=Er(D),L=a||!T,X=Zn.get(e);if(X&&(X.flags|=8,Zn.delete(e)),k&&(o(y),o(m)),a&&o(h),!X&&(T||k)&&c&16)for(let ce=0;ce<d.length;ce++){const Q=d[ce];s(Q,t,n,L,!!Q.dynamicChildren)}},move:_o,hydrate:Gd};function _o(e,t,n,{o:{insert:s},m:o},a=2){a===0&&(e.targetStart&&s(e.targetStart,t,n),s(e.targetAnchor,t,n),n=e.targetAnchor);const{el:c,anchor:d,shapeFlag:h,children:y,props:m}=e,k=a===2;if(k&&s(c,t,n),!Zn.has(e)&&(!k||Er(m))&&h&16)for(let D=0;D<y.length;D++)o(y[D],t,n,2);k&&s(d,t,n)}function Gd(e,t,n,s,o,a,{o:{nextSibling:c,parentNode:d,querySelector:h,insert:y,createText:m}},k){function D(ce,Q){let E=Q;for(;E;){if(E&&E.nodeType===8){if(E.data==="teleport start anchor")t.targetStart=E;else if(E.data==="teleport anchor"){t.targetAnchor=E,ce._lpa=t.targetAnchor&&c(t.targetAnchor);break}}E=c(E)}}function T(ce,Q){Q.anchor=k(c(ce),Q,d(ce),n,s,o,a)}const L=t.target=ma(t.props,h),X=Er(t.props);if(L){const ce=L._lpa||L.firstChild;t.shapeFlag&16&&(X?(T(e,t),D(L,ce),t.targetAnchor||ya(L,t,m,y,d(e)===L?e:null)):(t.anchor=c(e),D(L,ce),t.targetAnchor||ya(L,t,m,y),k(ce&&c(ce),t,L,n,s,o,a))),ms(t,X)}else X&&t.shapeFlag&16&&(T(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const Vs=zd;function ms(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function ya(e,t,n,s,o=null){const a=t.targetStart=n(""),c=t.targetAnchor=n("");return a[mc]=c,e&&(s(a,e,o),s(c,e,o)),c}const on=Symbol("_leaveCb"),hs=Symbol("_enterCb");function yc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return fn(()=>{e.isMounted=!0}),Cc(()=>{e.isUnmounting=!0}),e}const sn=[Function,Array],gc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:sn,onEnter:sn,onAfterEnter:sn,onEnterCancelled:sn,onBeforeLeave:sn,onLeave:sn,onAfterLeave:sn,onLeaveCancelled:sn,onBeforeAppear:sn,onAppear:sn,onAfterAppear:sn,onAppearCancelled:sn},Yd={name:"BaseTransition",props:gc,setup(e,{slots:t}){const n=Xa(),s=yc();return()=>{const o=t.default&&za(t.default(),!0),a=o&&o.length?bc(o):n.subTree?Se():void 0;if(!a)return;const c=st(e),{mode:d}=c;if(s.isLeaving)return ta(a);const h=Do(a);if(!h)return ta(a);let y=Os(h,c,s,n,k=>y=k);h.type!==Ft&&ar(h,y);let m=n.subTree&&Do(n.subTree);if(m&&m.type!==Ft&&!$r(m,h)&&Ms(n.subTree)){let k=Os(m,c,s,n);if(ar(m,k),d==="out-in"&&h.type!==Ft)return s.isLeaving=!0,k.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete k.afterLeave,m=void 0},ta(a);d==="in-out"&&h.type!==Ft?k.delayLeave=(D,T,L)=>{const X=wc(s,m);X[String(m.key)]=m,D[on]=()=>{T(),D[on]=void 0,delete y.delayedLeave,m=void 0},y.delayedLeave=()=>{L(),delete y.delayedLeave,m=void 0}}:m=void 0}else m&&(m=void 0);return a}}};function bc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ft){t=n;break}}return t}const Jd=Yd;function wc(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Os(e,t,n,s,o){const{appear:a,mode:c,persisted:d=!1,onBeforeEnter:h,onEnter:y,onAfterEnter:m,onEnterCancelled:k,onBeforeLeave:D,onLeave:T,onAfterLeave:L,onLeaveCancelled:X,onBeforeAppear:ce,onAppear:Q,onAfterAppear:E,onAppearCancelled:N}=t,G=String(e.key),de=wc(n,e),ae=(x,le)=>{x&&cn(x,s,9,le)},Z=(x,le)=>{const ke=le[1];ae(x,le),Le(x)?x.every(J=>J.length<=1)&&ke():x.length<=1&&ke()},$={mode:c,persisted:d,beforeEnter(x){let le=h;if(!n.isMounted)if(a)le=ce||h;else return;x[on]&&x[on](!0);const ke=de[G];if(ke&&$r(e,ke)){let J=ke.el[on];if(!J){const xe=Ms(ke);J=xe&&xe.el[on]}J&&J()}ae(le,[x])},enter(x){if(de[G]===e)return;let le=y,ke=m,J=k;if(!n.isMounted)if(a)le=Q||y,ke=E||m,J=N||k;else return;let xe=!1;x[hs]=nt=>{xe||(xe=!0,nt?ae(J,[x]):ae(ke,[x]),$.delayedLeave&&$.delayedLeave(),x[hs]=void 0)};const Ve=x[hs].bind(null,!1);le?Z(le,[x,Ve]):Ve()},leave(x,le){const ke=String(e.key);if(x[hs]&&x[hs](!0),n.isUnmounting)return le();ae(D,[x]);let J=!1;x[on]=Ve=>{J||(J=!0,le(),Ve?ae(X,[x]):ae(L,[x]),x[on]=void 0,de[ke]===e&&delete de[ke])};const xe=x[on].bind(null,!1);de[ke]=e,T?Z(T,[x,xe]):xe()},clone(x){const le=Os(x,t,n,s,o);return o&&o(le),le}};return $}function ta(e){if(ii(e))return e=lr(e),e.children=null,e}function Do(e){if(!ii(e))return oi(e.type)&&e.children?bc(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ge(n.default))return n.default()}}function ar(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;ar(oi(n.type)&&Do(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===Re&&Le(e.children)){const n=Pc(e.children,!1);n&&ar(n,t)}}function za(e,t=!1,n){let s=[],o=0;for(let a=0;a<e.length;a++){let c=e[a];const d=n==null?c.key:String(n)+String(c.key!=null?c.key:a);c.type===Re?(c.patchFlag&128&&o++,s=s.concat(za(c.children,t,d))):(t||c.type!==Ft)&&s.push(d!=null?lr(c,{key:d}):c)}if(o>1)for(let a=0;a<s.length;a++)s[a].patchFlag=-2;return s}function Ms(e){if(e.component)return Ms(e.component.subTree);if(e.type===Re){const t=Le(e.children)&&Pc(e.children,!1);return t?Ms(t):void 0}if(e.type!==Ft)return e}function Vt(e,t){return Ge(e)?Et({name:e.name},t,{setup:e}):e}function _c(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Yl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ro=new WeakMap;function ks(e,t,n,s,o=!1){if(Le(e)){e.forEach((X,ce)=>ks(X,t&&(Le(t)?t[ce]:t),n,s,o));return}if(xs(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ks(e,t,n,s.component.subTree);return}const a=s.shapeFlag&4?ci(s.component):s.el,c=o?null:a,{i:d,r:h}=e,y=t&&t.r,m=d.refs===ft?d.refs={}:d.refs,k=d.setupState,D=st(k),T=k===ft?Lu:X=>Yl(m,X)?!1:ot(D,X),L=(X,ce)=>!(ce&&Yl(m,ce));if(y!=null&&y!==h){if(Jl(t),bt(y))m[y]=null,T(y)&&(k[y]=null);else if(Nt(y)){const X=t;L(y,X.k)&&(y.value=null),X.k&&(m[X.k]=null)}}if(Ge(h))Ns(h,d,12,[c,m]);else{const X=bt(h),ce=Nt(h);if(X||ce){const Q=()=>{if(e.f){const E=X?T(h)?k[h]:m[h]:L()||!e.k?h.value:m[e.k];if(o)Le(E)&&Da(E,a);else if(Le(E))E.includes(a)||E.push(a);else if(X)m[h]=[a],T(h)&&(k[h]=m[h]);else{const N=[a];L(h,e.k)&&(h.value=N),e.k&&(m[e.k]=N)}}else X?(m[h]=c,T(h)&&(k[h]=c)):ce&&(L(h,e.k)&&(h.value=c),e.k&&(m[e.k]=c))};if(c){const E=()=>{Q(),Ro.delete(e)};E.id=-1,Ro.set(e,E),Ht(E,n)}else Jl(e),Q()}}}function Jl(e){const t=Ro.get(e);t&&(t.flags|=8,Ro.delete(e))}ni().requestIdleCallback;ni().cancelIdleCallback;const xs=e=>!!e.type.__asyncLoader,ii=e=>e.type.__isKeepAlive;function Xd(e,t){kc(e,"a",t)}function Qd(e,t){kc(e,"da",t)}function kc(e,t,n=zt){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ai(t,s,n),n){let o=n.parent;for(;o&&o.parent;)ii(o.parent.vnode)&&Zd(s,t,n,o),o=o.parent}}function Zd(e,t,n,s){const o=ai(t,e,s,!0);dr(()=>{Da(s[t],o)},n)}function ai(e,t,n=zt,s=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...c)=>{An();const d=Bs(n),h=cn(t,n,e,c);return d(),Pn(),h});return s?o.unshift(a):o.push(a),a}}const qn=e=>(t,n=zt)=>{(!Rs||e==="sp")&&ai(e,(...s)=>t(...s),n)},ep=qn("bm"),fn=qn("m"),tp=qn("bu"),xc=qn("u"),Cc=qn("bum"),dr=qn("um"),np=qn("sp"),rp=qn("rtg"),sp=qn("rtc");function op(e,t=zt){ai("ec",e,t)}const ip=Symbol.for("v-ndc");function ut(e,t,n,s){let o;const a=n,c=Le(e);if(c||bt(e)){const d=c&&or(e);let h=!1,y=!1;d&&(h=!ln(e),y=Tn(e),e=ri(e)),o=new Array(e.length);for(let m=0,k=e.length;m<k;m++)o[m]=t(h?y?ir(un(e[m])):un(e[m]):e[m],m,void 0,a)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)o=[];else{o=new Array(e);for(let d=0;d<e;d++)o[d]=t(d+1,d,void 0,a)}else if(at(e))if(e[Symbol.iterator])o=Array.from(e,(d,h)=>t(d,h,void 0,a));else{const d=Object.keys(e);o=new Array(d.length);for(let h=0,y=d.length;h<y;h++){const m=d[h];o[h]=t(e[m],m,h,a)}}else o=[];return o}const ga=e=>e?Hc(e)?ci(e):ga(e.parent):null,Cs=Et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ga(e.parent),$root:e=>ga(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ec(e),$forceUpdate:e=>e.f||(e.f=()=>{Wa(e.update)}),$nextTick:e=>e.n||(e.n=ts.bind(e.proxy)),$watch:e=>Hd.bind(e)}),na=(e,t)=>e!==ft&&!e.__isScriptSetup&&ot(e,t),ap={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:c,type:d,appContext:h}=e;if(t[0]!=="$"){const D=c[t];if(D!==void 0)switch(D){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(na(s,t))return c[t]=1,s[t];if(o!==ft&&ot(o,t))return c[t]=2,o[t];if(ot(a,t))return c[t]=3,a[t];if(n!==ft&&ot(n,t))return c[t]=4,n[t];ba&&(c[t]=0)}}const y=Cs[t];let m,k;if(y)return t==="$attrs"&&Kt(e.attrs,"get",""),y(e);if((m=d.__cssModules)&&(m=m[t]))return m;if(n!==ft&&ot(n,t))return c[t]=4,n[t];if(k=h.config.globalProperties,ot(k,t))return k[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:a}=e;return na(o,t)?(o[t]=n,!0):s!==ft&&ot(s,t)?(s[t]=n,!0):ot(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:a,type:c}},d){let h;return!!(n[d]||e!==ft&&d[0]!=="$"&&ot(e,d)||na(t,d)||ot(a,d)||ot(s,d)||ot(Cs,d)||ot(o.config.globalProperties,d)||(h=c.__cssModules)&&h[d])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ot(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Xl(e){return Le(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let ba=!0;function lp(e){const t=Ec(e),n=e.proxy,s=e.ctx;ba=!1,t.beforeCreate&&Ql(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:c,watch:d,provide:h,inject:y,created:m,beforeMount:k,mounted:D,beforeUpdate:T,updated:L,activated:X,deactivated:ce,beforeDestroy:Q,beforeUnmount:E,destroyed:N,unmounted:G,render:de,renderTracked:ae,renderTriggered:Z,errorCaptured:$,serverPrefetch:x,expose:le,inheritAttrs:ke,components:J,directives:xe,filters:Ve}=t;if(y&&up(y,s,null),c)for(const He in c){const ge=c[He];Ge(ge)&&(s[He]=ge.bind(n))}if(o){const He=o.call(n,n);at(He)&&(e.data=Ua(He))}if(ba=!0,a)for(const He in a){const ge=a[He],Oe=Ge(ge)?ge.bind(n,n):Ge(ge.get)?ge.get.bind(n,n):En,Fe=!Ge(ge)&&Ge(ge.set)?ge.set.bind(n):En,je=it({get:Oe,set:Fe});Object.defineProperty(s,He,{enumerable:!0,configurable:!0,get:()=>je.value,set:ne=>je.value=ne})}if(d)for(const He in d)Sc(d[He],s,n,He);if(h){const He=Ge(h)?h.call(n):h;Reflect.ownKeys(He).forEach(ge=>{Bd(ge,He[ge])})}m&&Ql(m,e,"c");function qe(He,ge){Le(ge)?ge.forEach(Oe=>He(Oe.bind(n))):ge&&He(ge.bind(n))}if(qe(ep,k),qe(fn,D),qe(tp,T),qe(xc,L),qe(Xd,X),qe(Qd,ce),qe(op,$),qe(sp,ae),qe(rp,Z),qe(Cc,E),qe(dr,G),qe(np,x),Le(le))if(le.length){const He=e.exposed||(e.exposed={});le.forEach(ge=>{Object.defineProperty(He,ge,{get:()=>n[ge],set:Oe=>n[ge]=Oe,enumerable:!0})})}else e.exposed||(e.exposed={});de&&e.render===En&&(e.render=de),ke!=null&&(e.inheritAttrs=ke),J&&(e.components=J),xe&&(e.directives=xe),x&&_c(e)}function up(e,t,n=En){Le(e)&&(e=wa(e));for(const s in e){const o=e[s];let a;at(o)?"default"in o?a=Eo(o.from||s,o.default,!0):a=Eo(o.from||s):a=Eo(o),Nt(a)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:c=>a.value=c}):t[s]=a}}function Ql(e,t,n){cn(Le(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Sc(e,t,n,s){let o=s.includes(".")?vc(n,s):()=>n[s];if(bt(e)){const a=t[e];Ge(a)&&gt(o,a)}else if(Ge(e))gt(o,e.bind(n));else if(at(e))if(Le(e))e.forEach(a=>Sc(a,t,n,s));else{const a=Ge(e.handler)?e.handler.bind(n):t[e.handler];Ge(a)&&gt(o,a,e)}}function Ec(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:c}}=e.appContext,d=a.get(t);let h;return d?h=d:!o.length&&!n&&!s?h=t:(h={},o.length&&o.forEach(y=>Lo(h,y,c,!0)),Lo(h,t,c)),at(t)&&a.set(t,h),h}function Lo(e,t,n,s=!1){const{mixins:o,extends:a}=t;a&&Lo(e,a,n,!0),o&&o.forEach(c=>Lo(e,c,n,!0));for(const c in t)if(!(s&&c==="expose")){const d=cp[c]||n&&n[c];e[c]=d?d(e[c],t[c]):t[c]}return e}const cp={data:Zl,props:eu,emits:eu,methods:ys,computed:ys,beforeCreate:qt,created:qt,beforeMount:qt,mounted:qt,beforeUpdate:qt,updated:qt,beforeDestroy:qt,beforeUnmount:qt,destroyed:qt,unmounted:qt,activated:qt,deactivated:qt,errorCaptured:qt,serverPrefetch:qt,components:ys,directives:ys,watch:dp,provide:Zl,inject:fp};function Zl(e,t){return t?e?function(){return Et(Ge(e)?e.call(this,this):e,Ge(t)?t.call(this,this):t)}:t:e}function fp(e,t){return ys(wa(e),wa(t))}function wa(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function qt(e,t){return e?[...new Set([].concat(e,t))]:t}function ys(e,t){return e?Et(Object.create(null),e,t):t}function eu(e,t){return e?Le(e)&&Le(t)?[...new Set([...e,...t])]:Et(Object.create(null),Xl(e),Xl(t??{})):t}function dp(e,t){if(!e)return t;if(!t)return e;const n=Et(Object.create(null),e);for(const s in t)n[s]=qt(e[s],t[s]);return n}function $c(){return{app:null,config:{isNativeTag:Lu,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 pp=0;function hp(e,t){return function(s,o=null){Ge(s)||(s=Et({},s)),o!=null&&!at(o)&&(o=null);const a=$c(),c=new WeakSet,d=[];let h=!1;const y=a.app={_uid:pp++,_component:s,_props:o,_container:null,_context:a,_instance:null,version:Wp,get config(){return a.config},set config(m){},use(m,...k){return c.has(m)||(m&&Ge(m.install)?(c.add(m),m.install(y,...k)):Ge(m)&&(c.add(m),m(y,...k))),y},mixin(m){return a.mixins.includes(m)||a.mixins.push(m),y},component(m,k){return k?(a.components[m]=k,y):a.components[m]},directive(m,k){return k?(a.directives[m]=k,y):a.directives[m]},mount(m,k,D){if(!h){const T=y._ceVNode||Te(s,o);return T.appContext=a,D===!0?D="svg":D===!1&&(D=void 0),e(T,m,D),h=!0,y._container=m,m.__vue_app__=y,ci(T.component)}},onUnmount(m){d.push(m)},unmount(){h&&(cn(d,y._instance,16),e(null,y._container),delete y._container.__vue_app__)},provide(m,k){return a.provides[m]=k,y},runWithContext(m){const k=zr;zr=y;try{return m()}finally{zr=k}}};return y}}let zr=null;const vp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${hn(t)}Modifiers`]||e[`${cr(t)}Modifiers`];function mp(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ft;let o=n;const a=t.startsWith("update:"),c=a&&vp(s,t.slice(7));c&&(c.trim&&(o=n.map(m=>bt(m)?m.trim():m)),c.number&&(o=o.map(ti)));let d,h=s[d=Yi(t)]||s[d=Yi(hn(t))];!h&&a&&(h=s[d=Yi(cr(t))]),h&&cn(h,e,6,o);const y=s[d+"Once"];if(y){if(!e.emitted)e.emitted={};else if(e.emitted[d])return;e.emitted[d]=!0,cn(y,e,6,o)}}const yp=new WeakMap;function Ac(e,t,n=!1){const s=n?yp:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const a=e.emits;let c={},d=!1;if(!Ge(e)){const h=y=>{const m=Ac(y,t,!0);m&&(d=!0,Et(c,m))};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}return!a&&!d?(at(e)&&s.set(e,null),null):(Le(a)?a.forEach(h=>c[h]=null):Et(c,a),at(e)&&s.set(e,c),c)}function li(e,t){return!e||!Qo(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),ot(e,t[0].toLowerCase()+t.slice(1))||ot(e,cr(t))||ot(e,t))}function tu(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[a],slots:c,attrs:d,emit:h,render:y,renderCache:m,props:k,data:D,setupState:T,ctx:L,inheritAttrs:X}=e,ce=jo(e);let Q,E;try{if(n.shapeFlag&4){const G=o||s,de=G;Q=xn(y.call(de,G,m,k,T,D,L)),E=d}else{const G=t;Q=xn(G.length>1?G(k,{attrs:d,slots:c,emit:h}):G(k,null)),E=t.props?d:gp(d)}}catch(G){Tr.length=0,si(G,e,1),Q=Te(Ft)}let N=Q;if(E&&X!==!1){const G=Object.keys(E),{shapeFlag:de}=N;G.length&&de&7&&(a&&G.some(Zo)&&(E=bp(E,a)),N=lr(N,E,!1,!0))}if(n.dirs&&(N=lr(N,null,!1,!0),N.dirs=N.dirs?N.dirs.concat(n.dirs):n.dirs),n.transition){const G=oi(N.type)&&Do(N)||N;ar(G,n.transition)}return Q=N,jo(ce),Q}function Pc(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(js(o)){if(o.type!==Ft||o.children==="v-if"){if(n)return;n=o}}else return}return n}const gp=e=>{let t;for(const n in e)(n==="class"||n==="style"||Qo(n))&&((t||(t={}))[n]=e[n]);return t},bp=(e,t)=>{const n={};for(const s in e)(!Zo(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function wp(e,t,n){const{props:s,children:o,component:a}=e,{props:c,children:d,patchFlag:h}=t,y=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&h>=0){if(h&1024)return!0;if(h&16)return s?nu(s,c,y):!!c;if(h&8){const m=t.dynamicProps;for(let k=0;k<m.length;k++){const D=m[k];if(Tc(c,s,D)&&!li(y,D))return!0}}}else return(o||d)&&(!d||!d.$stable)?!0:s===c?!1:s?c?nu(s,c,y):!0:!!c;return!1}function nu(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const a=s[o];if(!ot(e,a)||Tc(t,e,a)&&!li(n,a))return!0}return!1}function Tc(e,t,n){const s=e[n],o=t[n];return n==="style"&&at(s)&&at(o)?!Un(s,o):s!==o}function _p({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Oc={},Mc=()=>Object.create(Oc),Ic=e=>Object.getPrototypeOf(e)===Oc;function kp(e,t,n,s=!1){const o={},a=Mc();e.propsDefaults=Object.create(null),jc(e,t,o,a);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=s?o:Pd(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function xp(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:c}}=e,d=st(o),[h]=e.propsOptions;let y=!1;if((s||c>0)&&!(c&16)){if(c&8){const m=e.vnode.dynamicProps;for(let k=0;k<m.length;k++){let D=m[k];if(li(e.emitsOptions,D))continue;const T=t[D];if(h)if(ot(a,D))T!==a[D]&&(a[D]=T,y=!0);else{const L=hn(D);o[L]=_a(h,d,L,T,e,!1)}else T!==a[D]&&(a[D]=T,y=!0)}}}else{jc(e,t,o,a)&&(y=!0);let m;for(const k in d)(!t||!ot(t,k)&&((m=cr(k))===k||!ot(t,m)))&&(h?n&&(n[k]!==void 0||n[m]!==void 0)&&(o[k]=_a(h,d,k,void 0,e,!0)):delete o[k]);if(a!==d)for(const k in a)(!t||!ot(t,k))&&(delete a[k],y=!0)}y&&Rn(e.attrs,"set","")}function jc(e,t,n,s){const[o,a]=e.propsOptions;let c=!1,d;if(t)for(let h in t){if(bs(h))continue;const y=t[h];let m;o&&ot(o,m=hn(h))?!a||!a.includes(m)?n[m]=y:(d||(d={}))[m]=y:li(e.emitsOptions,h)||(!(h in s)||y!==s[h])&&(s[h]=y,c=!0)}if(a){const h=st(n),y=d||ft;for(let m=0;m<a.length;m++){const k=a[m];n[k]=_a(o,h,k,y[k],e,!ot(y,k))}}return c}function _a(e,t,n,s,o,a){const c=e[n];if(c!=null){const d=ot(c,"default");if(d&&s===void 0){const h=c.default;if(c.type!==Function&&!c.skipFactory&&Ge(h)){const{propsDefaults:y}=o;if(n in y)s=y[n];else{const m=Bs(o);s=y[n]=h.call(null,t),m()}}else s=h;o.ce&&o.ce._setProp(n,s)}c[0]&&(a&&!d?s=!1:c[1]&&(s===""||s===cr(n))&&(s=!0))}return s}const Cp=new WeakMap;function Dc(e,t,n=!1){const s=n?Cp:t.propsCache,o=s.get(e);if(o)return o;const a=e.props,c={},d=[];let h=!1;if(!Ge(e)){const m=k=>{h=!0;const[D,T]=Dc(k,t,!0);Et(c,D),T&&d.push(...T)};!n&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}if(!a&&!h)return at(e)&&s.set(e,Ar),Ar;if(Le(a))for(let m=0;m<a.length;m++){const k=hn(a[m]);ru(k)&&(c[k]=ft)}else if(a)for(const m in a){const k=hn(m);if(ru(k)){const D=a[m],T=c[k]=Le(D)||Ge(D)?{type:D}:Et({},D),L=T.type;let X=!1,ce=!0;if(Le(L))for(let Q=0;Q<L.length;++Q){const E=L[Q],N=Ge(E)&&E.name;if(N==="Boolean"){X=!0;break}else N==="String"&&(ce=!1)}else X=Ge(L)&&L.name==="Boolean";T[0]=X,T[1]=ce,(X||ot(T,"default"))&&d.push(k)}}const y=[c,d];return at(e)&&s.set(e,y),y}function ru(e){return e[0]!=="$"&&!bs(e)}const Ga=e=>e==="_"||e==="_ctx"||e==="$stable",Ya=e=>Le(e)?e.map(xn):[xn(e)],Sp=(e,t,n)=>{if(t._n)return t;const s=fr((...o)=>Ya(t(...o)),n);return s._c=!1,s},Rc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Ga(o))continue;const a=e[o];if(Ge(a))t[o]=Sp(o,a,s);else if(a!=null){const c=Ya(a);t[o]=()=>c}}},Lc=(e,t)=>{const n=Ya(t);e.slots.default=()=>n},Kc=(e,t,n)=>{for(const s in t)(n||!Ga(s))&&(e[s]=t[s])},Ep=(e,t,n)=>{const s=e.slots=Mc();if(e.vnode.shapeFlag&32){const o=t._;o?(Kc(s,t,n),n&&Bu(s,"_",o,!0)):Rc(t,s)}else t&&Lc(e,t)},$p=(e,t,n)=>{const{vnode:s,slots:o}=e;let a=!0,c=ft;if(s.shapeFlag&32){const d=t._;d?n&&d===1?a=!1:Kc(o,t,n):(a=!t.$stable,Rc(t,o)),c=t}else t&&(Lc(e,t),c={default:1});if(a)for(const d in o)!Ga(d)&&c[d]==null&&delete o[d]},Ht=Mp;function Ap(e){return Pp(e)}function Pp(e,t){const n=ni();n.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:c,createText:d,createComment:h,setText:y,setElementText:m,parentNode:k,nextSibling:D,setScopeId:T=En,insertStaticContent:L}=e,X=(w,g,P,ie=null,se=null,ue=null,ye=void 0,oe=null,we=!!g.dynamicChildren)=>{if(w===g)return;w&&!$r(w,g)&&(ie=ht(w),ne(w,se,ue,!0),w=null),g.patchFlag===-2&&(we=!1,g.dynamicChildren=null),g.dynamicChildren&&w&&w.dynamicChildren&&w.dynamicChildren.hasOnce&&(g.dynamicChildren===Ar&&(g.dynamicChildren=[]),g.dynamicChildren.hasOnce=!0);const{type:W,ref:q,shapeFlag:Y}=g;switch(W){case ui:ce(w,g,P,ie);break;case Ft:Q(w,g,P,ie);break;case $o:w==null&&E(g,P,ie,ye);break;case Re:J(w,g,P,ie,se,ue,ye,oe,we);break;default:Y&1?de(w,g,P,ie,se,ue,ye,oe,we):Y&6?xe(w,g,P,ie,se,ue,ye,oe,we):(Y&64||Y&128)&&W.process(w,g,P,ie,se,ue,ye,oe,we,Jt)}q!=null&&se?ks(q,w&&w.ref,ue,g||w,!g):q==null&&w&&w.ref!=null&&ks(w.ref,null,ue,w,!0)},ce=(w,g,P,ie)=>{if(w==null)s(g.el=d(g.children),P,ie);else{const se=g.el=w.el;g.children!==w.children&&y(se,g.children)}},Q=(w,g,P,ie)=>{w==null?s(g.el=h(g.children||""),P,ie):g.el=w.el},E=(w,g,P,ie)=>{[w.el,w.anchor]=L(w.children,g,P,ie,w.el,w.anchor)},N=({el:w,anchor:g},P,ie)=>{let se;for(;w&&w!==g;)se=D(w),s(w,P,ie),w=se;s(g,P,ie)},G=({el:w,anchor:g})=>{let P;for(;w&&w!==g;)P=D(w),o(w),w=P;o(g)},de=(w,g,P,ie,se,ue,ye,oe,we)=>{if(g.type==="svg"?ye="svg":g.type==="math"&&(ye="mathml"),w==null)ae(g,P,ie,se,ue,ye,oe,we);else{const W=w.el&&w.el._isVueCE?w.el:null;try{W&&W._beginPatch(),x(w,g,se,ue,ye,oe,we)}finally{W&&W._endPatch()}}},ae=(w,g,P,ie,se,ue,ye,oe)=>{let we,W;const{props:q,shapeFlag:Y,transition:$e,dirs:Ne}=w;if(we=w.el=c(w.type,ue,q&&q.is,q),Y&8?m(we,w.children):Y&16&&$(w.children,we,null,ie,se,ra(w,ue),ye,oe),Ne&&_r(w,null,ie,"created"),Z(we,w,w.scopeId,ye,ie),q){for(const Je in q)Je!=="value"&&!bs(Je)&&a(we,Je,null,q[Je],ue,ie);"value"in q&&a(we,"value",null,q.value,ue),(W=q.onVnodeBeforeMount)&&gn(W,ie,w)}Ne&&_r(w,null,ie,"beforeMount");const Xe=Tp(se,$e);Xe&&$e.beforeEnter(we),s(we,g,P),((W=q&&q.onVnodeMounted)||Xe||Ne)&&Ht(()=>{try{W&&gn(W,ie,w),Xe&&$e.enter(we),Ne&&_r(w,null,ie,"mounted")}finally{}},se)},Z=(w,g,P,ie,se)=>{if(P&&T(w,P),ie)for(let ue=0;ue<ie.length;ue++)T(w,ie[ue]);if(se){let ue=se.subTree;if(g===ue||Nc(ue.type)&&(ue.ssContent===g||ue.ssFallback===g)){const ye=se.vnode;Z(w,ye,ye.scopeId,ye.slotScopeIds,se.parent)}}},$=(w,g,P,ie,se,ue,ye,oe,we=0)=>{for(let W=we;W<w.length;W++){const q=w[W]=oe?Dn(w[W]):xn(w[W]);X(null,q,g,P,ie,se,ue,ye,oe)}},x=(w,g,P,ie,se,ue,ye)=>{const oe=g.el=w.el;let{patchFlag:we,dynamicChildren:W,dirs:q}=g;we|=w.patchFlag&16;const Y=w.props||ft,$e=g.props||ft;let Ne;if(P&&kr(P,!1),(Ne=$e.onVnodeBeforeUpdate)&&gn(Ne,P,g,w),q&&_r(g,w,P,"beforeUpdate"),P&&kr(P,!0),W&&(!w.dynamicChildren||w.dynamicChildren.length!==W.length)&&(we=0,ye=!1,W=null),(Y.innerHTML&&$e.innerHTML==null||Y.textContent&&$e.textContent==null)&&m(oe,""),W?le(w.dynamicChildren,W,oe,P,ie,ra(g,se),ue):ye||ge(w,g,oe,null,P,ie,ra(g,se),ue,!1),we>0){if(we&16)ke(oe,Y,$e,P,se);else if(we&2&&Y.class!==$e.class&&a(oe,"class",null,$e.class,se),we&4&&a(oe,"style",Y.style,$e.style,se),we&8){const Xe=g.dynamicProps;for(let Je=0;Je<Xe.length;Je++){const Qe=Xe[Je],vt=Y[Qe],_t=$e[Qe];(_t!==vt||Qe==="value")&&a(oe,Qe,vt,_t,se,P)}}we&1&&w.children!==g.children&&m(oe,g.children)}else!ye&&W==null&&ke(oe,Y,$e,P,se);((Ne=$e.onVnodeUpdated)||q)&&Ht(()=>{Ne&&gn(Ne,P,g,w),q&&_r(g,w,P,"updated")},ie)},le=(w,g,P,ie,se,ue,ye)=>{for(let oe=0;oe<g.length;oe++){const we=w[oe],W=g[oe],q=we.el||ka(we),Y=q&&(we.type===Re||!$r(we,W)||we.shapeFlag&198)?k(q):P;X(we,W,Y,null,ie,se,ue,ye,!0)}},ke=(w,g,P,ie,se)=>{if(g!==P){if(g!==ft)for(const ue in g)!bs(ue)&&!(ue in P)&&a(w,ue,g[ue],null,se,ie);for(const ue in P){if(bs(ue))continue;const ye=P[ue],oe=g[ue];ye!==oe&&ue!=="value"&&a(w,ue,oe,ye,se,ie)}"value"in P&&a(w,"value",g.value,P.value,se)}},J=(w,g,P,ie,se,ue,ye,oe,we)=>{const W=g.el=w?w.el:d(""),q=g.anchor=w?w.anchor:d("");let{patchFlag:Y,dynamicChildren:$e,slotScopeIds:Ne}=g;Ne&&(oe=oe?oe.concat(Ne):Ne),w==null?(s(W,P,ie),s(q,P,ie),$(g.children||[],P,q,se,ue,ye,oe,we)):Y>0&&Y&64&&$e&&w.dynamicChildren&&w.dynamicChildren.length===$e.length?(le(w.dynamicChildren,$e,P,se,ue,ye,oe),(g.key!=null||se&&g===se.subTree)&&Ja(w,g,!0)):ge(w,g,P,q,se,ue,ye,oe,we)},xe=(w,g,P,ie,se,ue,ye,oe,we)=>{g.slotScopeIds=oe,w==null?g.shapeFlag&512?se.ctx.activate(g,P,ie,ye,we):Ve(g,P,ie,se,ue,ye,we):nt(w,g,we)},Ve=(w,g,P,ie,se,ue,ye)=>{const oe=w.component=Fp(w,ie,se);if(ii(w)&&(oe.ctx.renderer=Jt),Np(oe,!1,ye),oe.asyncDep){if(se&&se.registerDep(oe,qe,ye,ue),!w.el){const we=oe.subTree=Te(Ft);Q(null,we,g,P),w.placeholder=we.el}}else qe(oe,w,g,P,se,ue,ye)},nt=(w,g,P)=>{const ie=g.component=w.component;if(wp(w,g,P))if(ie.asyncDep&&!ie.asyncResolved){g.el=w.el,g.placeholder=w.placeholder,He(ie,g,P);return}else ie.next=g,ie.update();else g.el=w.el,g.placeholder=w.placeholder,ie.vnode=g},qe=(w,g,P,ie,se,ue,ye)=>{const oe=()=>{if(w.isMounted){let{next:Y,bu:$e,u:Ne,parent:Xe,vnode:Je}=w;{const Bt=Fc(w);if(Bt){Y&&(Y.el=Je.el,He(w,Y,ye)),Bt.asyncDep.then(()=>{Ht(()=>{w.isUnmounted||W()},se)});return}}let Qe=Y,vt;kr(w,!1),Y?(Y.el=Je.el,He(w,Y,ye)):Y=Je,$e&&So($e),(vt=Y.props&&Y.props.onVnodeBeforeUpdate)&&gn(vt,Xe,Y,Je),kr(w,!0);const _t=tu(w),Xt=w.subTree;w.subTree=_t,X(Xt,_t,k(Xt.el),ht(Xt),w,se,ue),Y.el=_t.el,Qe===null&&_p(w,_t.el),Ne&&Ht(Ne,se),(vt=Y.props&&Y.props.onVnodeUpdated)&&Ht(()=>gn(vt,Xe,Y,Je),se)}else{let Y;const{el:$e,props:Ne}=g,{bm:Xe,m:Je,parent:Qe,root:vt,type:_t}=w,Xt=xs(g);kr(w,!1),Xe&&So(Xe),!Xt&&(Y=Ne&&Ne.onVnodeBeforeMount)&&gn(Y,Qe,g),kr(w,!0);{vt.ce&&vt.ce._hasShadowRoot()&&vt.ce._injectChildStyle(_t,w.parent?w.parent.type:void 0);const Bt=w.subTree=tu(w);X(null,Bt,P,ie,w,se,ue),g.el=Bt.el}if(Je&&Ht(Je,se),!Xt&&(Y=Ne&&Ne.onVnodeMounted)){const Bt=g;Ht(()=>gn(Y,Qe,Bt),se)}(g.shapeFlag&256||Qe&&xs(Qe.vnode)&&Qe.vnode.shapeFlag&256)&&w.a&&Ht(w.a,se),w.isMounted=!0,g=P=ie=null}};w.scope.on();const we=w.effect=new Wu(oe);w.scope.off();const W=w.update=we.run.bind(we),q=w.job=we.runIfDirty.bind(we);q.i=w,q.id=w.uid,we.scheduler=()=>Wa(q),kr(w,!0),W()},He=(w,g,P)=>{g.component=w;const ie=w.vnode.props;w.vnode=g,w.next=null,xp(w,g.props,ie,P),$p(w,g.children,P),An(),cc(w),Pn()},ge=(w,g,P,ie,se,ue,ye,oe,we=!1)=>{const W=w&&w.children,q=w?w.shapeFlag:0,Y=g.children,{patchFlag:$e,shapeFlag:Ne}=g;if($e>0){if($e&128){Fe(W,Y,P,ie,se,ue,ye,oe,we);return}else if($e&256){Oe(W,Y,P,ie,se,ue,ye,oe,we);return}}Ne&8?(q&16&&ct(W,se,ue),Y!==W&&m(P,Y)):q&16?Ne&16?Fe(W,Y,P,ie,se,ue,ye,oe,we):ct(W,se,ue,!0):(q&8&&m(P,""),Ne&16&&$(Y,P,ie,se,ue,ye,oe,we))},Oe=(w,g,P,ie,se,ue,ye,oe,we)=>{w=w||Ar,g=g||Ar;const W=w.length,q=g.length,Y=Math.min(W,q);let $e;for($e=0;$e<Y;$e++){const Ne=g[$e]=we?Dn(g[$e]):xn(g[$e]);X(w[$e],Ne,P,null,se,ue,ye,oe,we)}W>q?ct(w,se,ue,!0,!1,Y):$(g,P,ie,se,ue,ye,oe,we,Y)},Fe=(w,g,P,ie,se,ue,ye,oe,we)=>{let W=0;const q=g.length;let Y=w.length-1,$e=q-1;for(;W<=Y&&W<=$e;){const Ne=w[W],Xe=g[W]=we?Dn(g[W]):xn(g[W]);if($r(Ne,Xe))X(Ne,Xe,P,null,se,ue,ye,oe,we);else break;W++}for(;W<=Y&&W<=$e;){const Ne=w[Y],Xe=g[$e]=we?Dn(g[$e]):xn(g[$e]);if($r(Ne,Xe))X(Ne,Xe,P,null,se,ue,ye,oe,we);else break;Y--,$e--}if(W>Y){if(W<=$e){const Ne=$e+1,Xe=Ne<q?g[Ne].el:ie;for(;W<=$e;)X(null,g[W]=we?Dn(g[W]):xn(g[W]),P,Xe,se,ue,ye,oe,we),W++}}else if(W>$e)for(;W<=Y;)ne(w[W],se,ue,!0),W++;else{const Ne=W,Xe=W,Je=new Map;for(W=Xe;W<=$e;W++){const Ot=g[W]=we?Dn(g[W]):xn(g[W]);Ot.key!=null&&Je.set(Ot.key,W)}let Qe,vt=0;const _t=$e-Xe+1;let Xt=!1,Bt=0;const Zt=new Array(_t);for(W=0;W<_t;W++)Zt[W]=0;for(W=Ne;W<=Y;W++){const Ot=w[W];if(vt>=_t){ne(Ot,se,ue,!0);continue}let $t;if(Ot.key!=null)$t=Je.get(Ot.key);else for(Qe=Xe;Qe<=$e;Qe++)if(Zt[Qe-Xe]===0&&$r(Ot,g[Qe])){$t=Qe;break}$t===void 0?ne(Ot,se,ue,!0):(Zt[$t-Xe]=W+1,$t>=Bt?Bt=$t:Xt=!0,X(Ot,g[$t],P,null,se,ue,ye,oe,we),vt++)}const pr=Xt?Op(Zt):Ar;for(Qe=pr.length-1,W=_t-1;W>=0;W--){const Ot=Xe+W,$t=g[Ot],Me=g[Ot+1],Hn=Ot+1<q?Me.el||ka(Me):ie;Zt[W]===0?X(null,$t,P,Hn,se,ue,ye,oe,we):Xt&&(Qe<0||W!==pr[Qe]?je($t,P,Hn,2):Qe--)}}},je=(w,g,P,ie,se=null)=>{const{el:ue,type:ye,transition:oe,children:we,shapeFlag:W}=w;if(W&6){je(w.component.subTree,g,P,ie);return}if(W&128){w.suspense.move(g,P,ie);return}if(W&64){ye.move(w,g,P,Jt);return}if(ye===Re){s(ue,g,P);for(let Y=0;Y<we.length;Y++)je(we[Y],g,P,ie);s(w.anchor,g,P);return}if(ye===$o){N(w,g,P);return}if(ie!==2&&W&1&&oe)if(ie===0)oe.persisted&&!ue[on]?s(ue,g,P):(oe.beforeEnter(ue),s(ue,g,P),Ht(()=>oe.enter(ue),se));else{const{leave:Y,delayLeave:$e,afterLeave:Ne}=oe,Xe=()=>{w.ctx.isUnmounted?o(ue):s(ue,g,P)},Je=()=>{const Qe=ue._isLeaving||!!ue[on];ue._isLeaving&&ue[on](!0),oe.persisted&&!Qe?Xe():Y(ue,()=>{Xe(),Ne&&Ne()})};$e?$e(ue,Xe,Je):Je()}else s(ue,g,P)},ne=(w,g,P,ie=!1,se=!1)=>{const{type:ue,props:ye,ref:oe,children:we,dynamicChildren:W,shapeFlag:q,patchFlag:Y,dirs:$e,cacheIndex:Ne,memo:Xe}=w;if((Y===-2||W&&W.hasOnce)&&(se=!1),oe!=null&&(An(),ks(oe,null,P,w,!0),Pn()),Ne!=null&&(!w.ctx||w.ctx===g)&&(g.renderCache[Ne]=void 0),q&256){g.ctx.deactivate(w);return}const Je=q&1&&$e,Qe=!xs(w);let vt;if(Qe&&(vt=ye&&ye.onVnodeBeforeUnmount)&&gn(vt,g,w),q&6)Ke(w.component,P,ie);else{if(q&128){w.suspense.unmount(P,ie);return}Je&&_r(w,null,g,"beforeUnmount"),q&64?w.type.remove(w,g,P,Jt,ie):W&&!W.hasOnce&&(ue!==Re||Y>0&&Y&64)?ct(W,g,P,!1,!0):(ue===Re&&Y&384||!se&&q&16)&&ct(we,g,P),ie&&F(w)}const _t=Xe!=null&&Ne==null;(Qe&&(vt=ye&&ye.onVnodeUnmounted)||Je||_t)&&Ht(()=>{vt&&gn(vt,g,w),Je&&_r(w,null,g,"unmounted"),_t&&(w.el=null)},P)},F=w=>{const{type:g,el:P,anchor:ie,transition:se}=w,ue=g===Re;if(ue&&!se){fe(P,ie);return}if(g===$o){G(w),se&&!se.persisted&&se.afterLeave&&se.afterLeave();return}const ye=ue?Ms(w):w,oe=()=>{ue?k(P)&&fe(P,ie):o(P),se&&!se.persisted&&se.afterLeave&&se.afterLeave()};if(ye&&ye.shapeFlag&1&&se&&!se.persisted){const{leave:we,delayLeave:W}=se,q=ye.el,Y=()=>we(q,oe);W?W(q,oe,Y):Y()}else oe()},fe=(w,g)=>{let P;for(;w!==g;)P=D(w),o(w),w=P;o(g)},Ke=(w,g,P)=>{const{bum:ie,scope:se,job:ue,subTree:ye,um:oe,m:we,a:W}=w;su(we),su(W),ie&&So(ie),se.stop(),ue?(ue.flags|=8,ne(ye,w,g,P)):w.vnode.el&&ye&&(ye.transition=w.vnode.transition,ne(ye,w,g,P)),oe&&Ht(oe,g),Ht(()=>{w.isUnmounted=!0},g)},ct=(w,g,P,ie=!1,se=!1,ue=0)=>{for(let ye=ue;ye<w.length;ye++)ne(w[ye],g,P,ie,se)},ht=w=>{if(w.shapeFlag&6)return ht(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const g=D(w.anchor||w.el),P=g&&g[mc];return P?D(P):g},Yt=(w,g,P)=>{const ie=w&&g._vnode?void 0:w&&w.component?w.component.uid:Kp();Vd(()=>{w==null?g._vnode&&ne(g._vnode,null,null,!0):X(g._vnode||null,w,g,null,null,null,P),g._vnode=w},ie)},Jt={p:X,um:ne,m:je,r:F,mt:Ve,mc:$,pc:ge,pbc:le,n:ht,o:e};return{render:Yt,hydrate:void 0,createApp:hp(Yt)}}function ra({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function kr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Tp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ja(e,t,n=!1){const s=e.children,o=t.children;if(Le(s)&&Le(o))for(let a=0;a<s.length;a++){const c=s[a];let d=o[a];d.shapeFlag&1&&!d.dynamicChildren&&((d.patchFlag<=0||d.patchFlag===32)&&(d=o[a]=Dn(o[a]),d.el=c.el),!n&&d.patchFlag!==-2&&Ja(c,d)),d.type===ui&&(d.patchFlag===-1&&(d=o[a]=Dn(d)),d.el=c.el),d.type===Ft&&!d.el&&(d.el=c.el)}}function Op(e){const t=e.slice(),n=[0];let s,o,a,c,d;const h=e.length;for(s=0;s<h;s++){const y=e[s];if(y!==0){if(o=n[n.length-1],e[o]<y){t[s]=o,n.push(s);continue}for(a=0,c=n.length-1;a<c;)d=a+c>>1,e[n[d]]<y?a=d+1:c=d;y<e[n[a]]&&(a>0&&(t[s]=n[a-1]),n[a]=s)}}for(a=n.length,c=n[a-1];a-- >0;)n[a]=c,c=t[c];return n}function Fc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Fc(t)}function su(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ka(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?ka(t.subTree):null}const Nc=e=>e.__isSuspense;function Mp(e,t){t&&t.pendingBranch?Le(e)?t.effects.push(...e):t.effects.push(e):Nd(e)}const Re=Symbol.for("v-fgt"),ui=Symbol.for("v-txt"),Ft=Symbol.for("v-cmt"),$o=Symbol.for("v-stc"),Tr=[];let rn=null;function K(e=!1){Tr.push(rn=e?null:[])}function Vc(){Tr.pop(),rn=Tr[Tr.length-1]||null}let Is=1;function Ko(e,t=!1){Is+=e,e<0&&rn&&t&&(rn.hasOnce=!0)}function Bc(e){return e.dynamicChildren=Is>0?rn||Ar:null,Vc(),Is>0&&rn&&rn.push(e),e}function H(e,t,n,s,o,a){return Bc(u(e,t,n,s,o,a,!0))}function It(e,t,n,s,o){return Bc(Te(e,t,n,s,o,!0))}function js(e){return e?e.__v_isVNode===!0:!1}function $r(e,t){return e.type===t.type&&e.key===t.key}const Uc=({key:e})=>e??null,Ao=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bt(e)||Nt(e)||Ge(e)?{i:an,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,s=0,o=null,a=e===Re?0:1,c=!1,d=!1){const h={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Uc(t),ref:t&&Ao(t),scopeId:pc,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:an};return d?(Fo(h,n),a&128&&e.normalize(h)):n&&(h.shapeFlag|=bt(n)?8:16),Is>0&&!c&&rn&&(h.patchFlag>0||a&6)&&h.patchFlag!==32&&rn.push(h),h}const Te=Ip;function Ip(e,t=null,n=null,s=0,o=null,a=!1){if((!e||e===ip)&&(e=Ft),js(e)){const d=lr(e,t,!0);return n&&Fo(d,n),Is>0&&!a&&rn&&(d.shapeFlag&6?rn[rn.indexOf(e)]=d:rn.push(d)),d.patchFlag=-2,d}if(qp(e)&&(e=e.__vccOpts),t){t=jp(t);let{class:d,style:h}=t;d&&!bt(d)&&(t.class=et(d)),at(h)&&(Ha(h)&&!Le(h)&&(h=Et({},h)),t.style=sr(h))}const c=bt(e)?1:Nc(e)?128:oi(e)?64:at(e)?4:Ge(e)?2:0;return u(e,t,n,s,o,c,a,!0)}function jp(e){return e?Ha(e)||Ic(e)?Et({},e):e:null}function lr(e,t,n=!1,s=!1){const{props:o,ref:a,patchFlag:c,children:d,transition:h}=e,y=t?Rp(o||{},t):o,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:y,key:y&&Uc(y),ref:t&&t.ref?n&&a?Le(a)?a.concat(Ao(t)):[a,Ao(t)]:Ao(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:d,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Re?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:h,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&lr(e.ssContent),ssFallback:e.ssFallback&&lr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return h&&s&&ar(m,h.clone(m)),m}function nn(e=" ",t=0){return Te(ui,null,e,t)}function Dp(e,t){const n=Te($o,null,e);return n.staticCount=t,n}function Se(e="",t=!1){return t?(K(),It(Ft,null,e)):Te(Ft,null,e)}function xn(e){return e==null||typeof e=="boolean"?Te(Ft):Le(e)?Te(Re,null,e.slice()):js(e)?Dn(e):Te(ui,null,String(e))}function Dn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:lr(e)}function Fo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Le(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Fo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Ic(t)?t._ctx=an:o===3&&an&&(an.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Ge(t)){if(s&65){Fo(e,{default:t});return}t={default:t,_ctx:an},n=32}else t=String(t),s&64?(n=16,t=[nn(t)]):n=8;e.children=t,e.shapeFlag|=n}function Rp(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=et([t.class,s.class]));else if(o==="style")t.style=sr([t.style,s.style]);else if(Qo(o)){const a=t[o],c=s[o];c&&a!==c&&!(Le(a)&&a.includes(c))?t[o]=a?[].concat(a,c):c:c==null&&a==null&&!Zo(o)&&(t[o]=c)}else o!==""&&(t[o]=s[o])}return t}function gn(e,t,n,s=null){cn(e,t,7,[n,s])}const Lp=$c();let qc=0;function Kp(){return qc}function Fp(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Lp,a={uid:qc++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new fd(!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:Dc(s,o),emitsOptions:Ac(s,o),emit:null,emitted:null,propsDefaults:ft,inheritAttrs:s.inheritAttrs,ctx:ft,data:ft,props:ft,attrs:ft,slots:ft,refs:ft,setupState:ft,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=mp.bind(null,a),e.ce&&e.ce(a),a}let zt=null;const Xa=()=>zt||an;let No,Ds;{const e=ni(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),a=>{o.length>1?o.forEach(c=>c(a)):o[0](a)}};No=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),Ds=t("__VUE_SSR_SETTERS__",n=>Rs=n)}const Bs=e=>{const t=zt;return No(e),e.scope.on(),()=>{e.scope.off(),No(t)}},ou=()=>{zt&&zt.scope.off(),No(null)};function Hc(e){return e.vnode.shapeFlag&4}let Rs=!1;function Np(e,t=!1,n=!1){t&&Ds(t);const{props:s,children:o}=e.vnode,a=Hc(e);kp(e,s,a,t),Ep(e,o,n||t);const c=a?Vp(e,t):void 0;return t&&Ds(!1),c}function Vp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ap);const{setup:s}=n;if(s){An();const o=e.setupContext=s.length>1?Up(e):null,a=Bs(e),c=Ns(s,e,0,[e.props,o]),d=Ku(c);if(Pn(),a(),(d||e.sp)&&!xs(e)&&_c(e),d){if(c.then(ou,ou),t)return c.then(h=>{Ds(!0);try{iu(e,h,t)}finally{Ds(!1)}}).catch(h=>{si(h,e,0)});e.asyncDep=c}else iu(e,c)}else Wc(e)}function iu(e,t,n){Ge(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:at(t)&&(e.setupState=ac(t)),Wc(e)}function Wc(e,t,n){const s=e.type;e.render||(e.render=s.render||En);{const o=Bs(e);An();try{lp(e)}finally{Pn(),o()}}}const Bp={get(e,t){return Kt(e,"get",""),e[t]}};function Up(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Bp),slots:e.slots,emit:e.emit,expose:t}}function ci(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ac(Td(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Cs)return Cs[n](e)},has(t,n){return n in t||n in Cs}})):e.proxy}function qp(e){return Ge(e)&&"__vccOpts"in e}const it=(e,t)=>Dd(e,t,Rs);function Hp(e,t,n){try{Ko(-1);const s=arguments.length;return s===2?at(t)&&!Le(t)?js(t)?Te(e,null,[t]):Te(e,t):Te(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&js(n)&&(n=[n]),Te(e,t,n))}finally{Ko(1)}}const Wp="3.5.44";/**
* @vue/runtime-dom v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let xa;const au=typeof window<"u"&&window.trustedTypes;if(au)try{xa=au.createPolicy("vue",{createHTML:e=>e})}catch{}const zc=xa?e=>xa.createHTML(e):e=>e,zp="http://www.w3.org/2000/svg",Gp="http://www.w3.org/1998/Math/MathML",jn=typeof document<"u"?document:null,lu=jn&&jn.createElement("template"),Yp={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?jn.createElementNS(zp,e):t==="mathml"?jn.createElementNS(Gp,e):n?jn.createElement(e,{is:n}):jn.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>jn.createTextNode(e),createComment:e=>jn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>jn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,a){const c=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{lu.innerHTML=zc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const d=lu.content;if(s==="svg"||s==="mathml"){const h=d.firstChild;for(;h.firstChild;)d.appendChild(h.firstChild);d.removeChild(h)}t.insertBefore(d,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Qn="transition",vs="animation",Jr=Symbol("_vtc"),Gc={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},Yc=Et({},gc,Gc),Jp=e=>(e.displayName="Transition",e.props=Yc,e),ns=Jp((e,{slots:t})=>Hp(Jd,Jc(e),t)),xr=(e,t=[])=>{Le(e)?e.forEach(n=>n(...t)):e&&e(...t)},uu=e=>e?Le(e)?e.some(t=>t.length>1):e.length>1:!1;function Jc(e){const t={};for(const J in e)J in Gc||(t[J]=e[J]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:a=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:d=`${n}-enter-to`,appearFromClass:h=a,appearActiveClass:y=c,appearToClass:m=d,leaveFromClass:k=`${n}-leave-from`,leaveActiveClass:D=`${n}-leave-active`,leaveToClass:T=`${n}-leave-to`}=e,L=Xp(o),X=L&&L[0],ce=L&&L[1],{onBeforeEnter:Q,onEnter:E,onEnterCancelled:N,onLeave:G,onLeaveCancelled:de,onBeforeAppear:ae=Q,onAppear:Z=E,onAppearCancelled:$=N}=t,x=(J,xe,Ve,nt)=>{J._enterCancelled=nt,er(J,xe?m:d),er(J,xe?y:c),Ve&&Ve()},le=(J,xe)=>{J._isLeaving=!1,er(J,k),er(J,T),er(J,D),xe&&xe()},ke=J=>(xe,Ve)=>{const nt=J?Z:E,qe=()=>x(xe,J,Ve);xr(nt,[xe,qe]),cu(()=>{er(xe,J?h:a),bn(xe,J?m:d),uu(nt)||fu(xe,s,X,qe)})};return Et(t,{onBeforeEnter(J){xr(Q,[J]),bn(J,a),bn(J,c)},onBeforeAppear(J){xr(ae,[J]),bn(J,h),bn(J,y)},onEnter:ke(!1),onAppear:ke(!0),onLeave(J,xe){J._isLeaving=!0;const Ve=()=>le(J,xe);bn(J,k),J._enterCancelled?(bn(J,D),Ca(J)):(Ca(J),bn(J,D)),cu(()=>{J._isLeaving&&(er(J,k),bn(J,T),uu(G)||fu(J,s,ce,Ve))}),xr(G,[J,Ve])},onEnterCancelled(J){x(J,!1,void 0,!0),xr(N,[J])},onAppearCancelled(J){x(J,!0,void 0,!0),xr($,[J])},onLeaveCancelled(J){le(J),xr(de,[J])}})}function Xp(e){if(e==null)return null;if(at(e))return[sa(e.enter),sa(e.leave)];{const t=sa(e);return[t,t]}}function sa(e){return nd(e)}function bn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Jr]||(e[Jr]=new Set)).add(t)}function er(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Jr];n&&(n.delete(t),n.size||(e[Jr]=void 0))}function cu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Qp=0;function fu(e,t,n,s){const o=e._endId=++Qp,a=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(a,n);const{type:c,timeout:d,propCount:h}=Xc(e,t);if(!c)return s();const y=c+"end";let m=0;const k=()=>{e.removeEventListener(y,D),a()},D=T=>{T.target===e&&++m>=h&&k()};setTimeout(()=>{m<h&&k()},d+1),e.addEventListener(y,D)}function Xc(e,t){const n=window.getComputedStyle(e),s=L=>(n[L]||"").split(", "),o=s(`${Qn}Delay`),a=s(`${Qn}Duration`),c=du(o,a),d=s(`${vs}Delay`),h=s(`${vs}Duration`),y=du(d,h);let m=null,k=0,D=0;t===Qn?c>0&&(m=Qn,k=c,D=a.length):t===vs?y>0&&(m=vs,k=y,D=h.length):(k=Math.max(c,y),m=k>0?c>y?Qn:vs:null,D=m?m===Qn?a.length:h.length:0);const T=m===Qn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Qn}Property`).toString());return{type:m,timeout:k,propCount:D,hasTransform:T}}function du(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>pu(n)+pu(e[s])))}function pu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ca(e){return(e?e.ownerDocument:document).body.offsetHeight}function Zp(e,t,n){const s=e[Jr];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const hu=Symbol("_vod"),Qc=Symbol("_vsh"),eh=Symbol(""),th=/(?:^|;)\s*display\s*:/;function nh(e,t,n){const s=e.style,o=bt(n);let a=!1;if(n&&!o){if(t)if(bt(t))for(const c of t.split(";")){const d=c.slice(0,c.indexOf(":")).trim();n[d]==null&&gs(s,d,"")}else for(const c in t)n[c]==null&&gs(s,c,"");for(const c in n){c==="display"&&(a=!0);const d=n[c];d!=null?sh(e,c,!bt(t)&&t?t[c]:void 0,d)||gs(s,c,d):gs(s,c,"")}}else if(o){if(t!==n){const c=s[eh];c&&(n+=";"+c),s.cssText=n,a=th.test(n)}}else t&&e.removeAttribute("style");hu in e&&((!o||t!==n)&&(e[hu]=a?s.display:""),e[Qc]&&(s.display="none"))}const ko=/\s*!important$/;function gs(e,t,n){if(Le(n))n.forEach(s=>gs(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))ko.test(n)?e.setProperty(t,n.replace(ko,""),"important"):e.setProperty(t,n);else{const s=rh(e,t);ko.test(n)?e.setProperty(cr(s),n.replace(ko,""),"important"):e[s]=n}}const vu=["Webkit","Moz","ms"],oa={};function rh(e,t){const n=oa[t];if(n)return n;let s=hn(t);if(s!=="filter"&&s in e)return oa[t]=s;s=Vu(s);for(let o=0;o<vu.length;o++){const a=vu[o]+s;if(a in e)return oa[t]=a}return t}function sh(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bt(s)&&n===s}const mu="http://www.w3.org/1999/xlink";function yu(e,t,n,s,o,a=ld(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(mu,t.slice(6,t.length)):e.setAttributeNS(mu,t,n):n==null||a&&!Uu(n)?e.removeAttribute(t):e.setAttribute(t,a?"":$n(n)?String(n):n)}function gu(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?zc(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const d=a==="OPTION"?e.getAttribute("value")||"":e.value,h=n==null?e.type==="checkbox"?"on":"":String(n);(d!==h||!("_value"in e))&&(e.value=h),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const d=typeof e[t];d==="boolean"?n=Uu(n):n==null&&d==="string"?(n="",c=!0):d==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(o||t)}function nr(e,t,n,s){e.addEventListener(t,n,s)}function oh(e,t,n,s){e.removeEventListener(t,n,s)}const bu=Symbol("_vei");function ih(e,t,n,s,o=null){const a=e[bu]||(e[bu]={}),c=a[t];if(s&&c)c.value=s;else{const[d,h]=uh(t);if(s){const y=a[t]=dh(s,o);nr(e,d,y,h)}else c&&(oh(e,d,c,h),a[t]=void 0)}}const ah=/(Once|Passive|Capture)$/,lh=/^on:?(?:Once|Passive|Capture)$/;function uh(e){let t,n;for(;(n=e.match(ah))&&!lh.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):cr(e.slice(2)),t]}let ia=0;const ch=Promise.resolve(),fh=()=>ia||(ch.then(()=>ia=0),ia=Date.now());function dh(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(Le(o)){const a=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{a.call(s),s._stopped=!0};const c=o.slice(),d=[s];for(let h=0;h<c.length&&!s._stopped;h++){const y=c[h];y&&cn(y,t,5,d)}}else cn(o,t,5,[s])};return n.value=e,n.attached=fh(),n}const wu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ph=(e,t,n,s,o,a)=>{const c=o==="svg";t==="class"?Zp(e,s,c):t==="style"?nh(e,n,s):Qo(t)?Zo(t)||ih(e,t,n,s,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):hh(e,t,s,c))?(gu(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&yu(e,t,s,c,a,t!=="value")):e._isVueCE&&(vh(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bt(s)))?gu(e,hn(t),s,a,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),yu(e,t,s,c))};function hh(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&wu(t)&&Ge(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return wu(t)&&bt(n)?!1:t in e}function vh(e,t){const n=e._def.props;if(!n)return!1;const s=hn(t);return Array.isArray(n)?n.some(o=>hn(o)===s):Object.keys(n).some(o=>hn(o)===s)}const Zc=new WeakMap,ef=new WeakMap,Vo=Symbol("_moveCb"),_u=Symbol("_enterCb"),Sa=new WeakMap,mh=e=>(delete e.props.mode,e),yh=mh({name:"TransitionGroup",props:Et({},Yc,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Xa(),s=yc();let o,a,c,d;const h=()=>(d===void 0&&(d=o.length>0&&Sh(o[0].el,n.vnode.el,ku(e))),d);return xc(()=>{if(Sa.delete(n),!h()){o=[],c=void 0;return}const y=ku(e);o.forEach(bh);const m=c&&Ch(c,n.vnode.el);c=void 0,o.forEach(D=>wh(D,m));const k=o.filter(_h);Ca(n.vnode.el),k.forEach(D=>{const T=D.el,L=T.style;bn(T,y),L.transform=L.webkitTransform=L.transitionDuration="";const X=T[Vo]=ce=>{ce&&ce.target!==T||(!ce||ce.propertyName.endsWith("transform"))&&(T.removeEventListener("transitionend",X),T[Vo]=null,er(T,y))};T.addEventListener("transitionend",X)}),o=[]}),()=>{const y=st(e),m=Jc(y);let k=y.tag||Re;if(o=[],d=void 0,a)for(let D=0;D<a.length;D++){const T=a[D];T.el&&T.el instanceof Element&&!T.el[Qc]&&(o.push(T),ar(T,Os(T,m,s,n)),Zc.set(T,fi(T.el)))}a=t.default?za(t.default()):[];for(let D=0;D<a.length;D++){const T=a[D];T.key!=null&&ar(T,Os(T,m,s,n))}return o.length&&(c=kh(n),Sa.set(n,h)),Te(k,null,a)}}}),gh=yh;function bh(e){const t=e.el;t[Vo]&&t[Vo](),t[_u]&&t[_u]()}function ku(e){return e.moveClass||`${e.name||"v"}-move`}function wh(e,t){ef.set(e,fi(e.el,t))}function _h(e){const t=Zc.get(e),n=ef.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const a=e.el,c=a.style,d=a.getBoundingClientRect();let h=1,y=1;return a.offsetWidth&&(h=d.width/a.offsetWidth),a.offsetHeight&&(y=d.height/a.offsetHeight),(!Number.isFinite(h)||h===0)&&(h=1),(!Number.isFinite(y)||y===0)&&(y=1),Math.abs(h-1)<.01&&(h=1),Math.abs(y-1)<.01&&(y=1),c.transform=c.webkitTransform=`translate(${s/h}px,${o/y}px)`,c.transitionDuration="0s",e}}function fi(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function kh(e){let t;for(let n=e.parent;n;n=n.parent){const s=Sa.get(n);if(s){const o=xh(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push(Et(fi(o),{item:o,willMove:s}))}}return t}function xh(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 Ch(e,t){const n=e.find(s=>s.willMove()&&s.item.contains(t));return n&&fi(n.item,n)}function Sh(e,t,n){const s=e.cloneNode(),o=e[Jr];o&&o.forEach(d=>{d.split(/\s+/).forEach(h=>h&&s.classList.remove(h))}),n.split(/\s+/).forEach(d=>d&&s.classList.add(d)),s.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(s);const{hasTransform:c}=Xc(s);return a.removeChild(s),c}const Xr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Le(t)?n=>So(t,n):t};function Eh(e){e.target.composing=!0}function xu(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Sn=Symbol("_assign"),xo=Symbol("_initialValue");function aa(e,t,n){return t&&(e=e.trim()),n&&(e=ti(e)),e}const De={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[xo]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[xo]=e.defaultValue.replace(/\r\n?/g,`
`))),e[Sn]=Xr(o);const a=s||o.props&&o.props.type==="number";nr(e,t?"change":"input",c=>{c.target.composing||e[Sn](aa(e.value,n,a))}),(n||a)&&nr(e,"change",()=>{e.value=aa(e.value,n,a)}),t||(nr(e,"compositionstart",Eh),nr(e,"compositionend",xu),nr(e,"change",xu))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",a=e[xo];delete e[xo],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[Sn](aa(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:a}},c){if(e[Sn]=Xr(c),e.composing)return;const d=(a||e.type==="number")&&!/^0\d/.test(e.value)?ti(e.value):e.value,h=t??"";if(d===h)return;const y=e.getRootNode();(y instanceof Document||y instanceof ShadowRoot)&&y.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===h)||(e.value=h)}},$h={deep:!0,created(e,t,n){e[Sn]=Xr(n),nr(e,"change",()=>{const s=e._modelValue,o=Ls(e),a=e.checked,c=e[Sn];if(Le(s)){const d=La(s,o),h=d!==-1;if(a&&!h)c(s.concat(o));else if(!a&&h){const y=[...s];y.splice(d,1),c(y)}}else if(Bn(s)){const d=new Set(s);a?d.add(o):d.delete(o),c(d)}else c(tf(e,a))})},mounted:Cu,beforeUpdate(e,t,n){e[Sn]=Xr(n),Cu(e,t,n)}};function Cu(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(Le(t))o=La(t,s.props.value)>-1;else if(Bn(t))o=t.has(s.props.value);else{if(t===n)return;o=Un(t,tf(e,!0))}e.checked!==o&&(e.checked=o)}const Fn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,nr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,h=>h.selected).map(h=>n?ti(Ls(h)):Ls(h)),a=e.multiple,c=a?Bn(e._modelValue)?new Set(o):o:o[0],d=e._pendingValue=[a,a?Le(c)?o.slice():o:c];try{e[Sn](c)}finally{ts(()=>{e._pendingValue===d&&(e._pendingValue=void 0)})}}),e[Sn]=Xr(s)},mounted(e,{value:t}){Su(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Sn]=Xr(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Ah(t,n[1],n[0]))&&Su(e,t)}};function Ah(e,t,n){if(!n||Le(e))return Un(e,t);if(Bn(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function Su(e,t){const n=e.multiple,s=Le(t);if(!(n&&!s&&!Bn(t))){for(let o=0,a=e.options.length;o<a;o++){const c=e.options[o],d=Ls(c);if(n)if(s){const h=typeof d;h==="string"||h==="number"?c.selected=t.some(y=>String(y)===String(d)):c.selected=La(t,d)>-1}else c.selected=t.has(d);else if(Un(Ls(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ls(e){return"_value"in e?e._value:e.value}function tf(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ph=["ctrl","shift","alt","meta"],Th={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)=>Ph.some(n=>e[`${n}Key`]&&!t.includes(n))},Mr=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(o,...a)=>{for(let c=0;c<t.length;c++){const d=Th[t[c]];if(d&&d(o,t))return}return e(o,...a)})},Oh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},jt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=o=>{if(!("key"in o))return;const a=cr(o.key);if(t.some(c=>c===a||Oh[c]===a))return e(o)})},Mh=Et({patchProp:ph},Yp);let Eu;function Ih(){return Eu||(Eu=Ap(Mh))}const jh=(...e)=>{const t=Ih().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Rh(s);if(!o)return;const a=t._component;!Ge(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,Dh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function Dh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Rh(e){return bt(e)?document.querySelector(e):e}function At(e){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">'+e+"</svg>"}const Lh={calendar:At('<rect x="4" y="5.5" width="16" height="14" rx="2"/><path d="M8.5 3.5v3.5M15.5 3.5v3.5M4 10.5h16"/>'),clock:At('<circle cx="12" cy="12" r="8.25"/><path d="M12 7.75V12l2.75 1.75"/>'),"check-circle":At('<circle cx="12" cy="12" r="8.25"/><path d="M8.5 12.4l2.4 2.4 4.6-5.2"/>'),edit:At('<path d="M4.5 19.5v-3.2L16 4.8a1.9 1.9 0 0 1 2.7 2.7L7.2 19l-2.7.5z"/>'),tag:At('<path d="M4.5 5.5a1 1 0 0 1 1-1h5.6l8.4 8.4-6.6 6.6-8.4-8.4V5.5z"/><circle cx="8.8" cy="8.8" r="1.1"/>'),star:At('<path d="M12 4l2.5 5.1 5.6.8-4 3.9.9 5.6-5-2.7-5 2.7.9-5.6-4-3.9 5.6-.8L12 4z"/>'),close:At('<path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/>'),flag:At('<path d="M6.5 21V4"/><path d="M6.5 4.5h10.8l-2.6 3.7 2.6 3.7H6.5"/>'),chart:At('<path d="M4.5 19.5h15"/><path d="M7.5 19.5V12M12 19.5V6.5M16.5 19.5V9.5"/>'),export:At('<path d="M12 4.5V14M8.25 10.25L12 14l3.75-3.75"/><path d="M5 19.5h14"/>'),"chevron-left":At('<path d="M14.5 6l-6 6 6 6"/>'),"chevron-right":At('<path d="M9.5 6l6 6-6 6"/>'),"chevron-down":At('<path d="M6 9.5l6 6 6-6"/>'),plus:At('<path d="M12 5.5v13M5.5 12h13"/>'),search:At('<circle cx="11" cy="11" r="6.5"/><path d="M15.8 15.8L20 20"/>'),settings:At('<circle cx="12" cy="12" r="3"/><path d="M12 4.5v2.2M12 17.3v2.2M4.5 12h2.2M17.3 12h2.2M6.8 6.8l1.6 1.6M15.6 15.6l1.6 1.6M17.2 6.8l-1.6 1.6M8.4 15.6l-1.6 1.6"/>'),memo:At('<path d="M6.5 3.5h7.5L18.5 8v11a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-15a1 1 0 0 1 1-1z"/><path d="M14 3.5V8h4.5M9.5 12h5M9.5 15.5h5"/>'),lock:At('<rect x="5.5" y="10.5" width="13" height="9.5" rx="1.5"/><path d="M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5"/>'),wallet:At('<rect x="3.5" y="6" width="17" height="12.5" rx="2"/><path d="M3.5 10h17"/><circle cx="16.4" cy="14.2" r="1.1"/>')},Kh=["innerHTML"],lt=Vt({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=it(()=>Lh[t.name]||"");return(s,o)=>(K(),H("span",{class:"icon",style:sr({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,Kh))}}),Fh=["aria-label"],Nh={class:"dialog-title"},Vh={class:"dialog-msg"},Bh={class:"dialog-btns"},Uh=Vt({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmText:{default:"确认"},cancelText:{default:"取消"},danger:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(e,{emit:t}){const n=e,s=t;function o(a){n.open&&a.key==="Escape"&&s("cancel")}return gt(()=>n.open,a=>{a?window.addEventListener("keydown",o):window.removeEventListener("keydown",o)}),dr(()=>window.removeEventListener("keydown",o)),(a,c)=>(K(),It(Vs,{to:"body"},[Te(ns,{name:"modal"},{default:fr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:c[2]||(c[2]=Mr(d=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",Nh,re(e.title),1),u("div",Vh,re(e.message),1),u("div",Bh,[u("button",{class:"btn btn-sm",onClick:c[0]||(c[0]=d=>s("cancel"))},re(e.cancelText),1),u("button",{class:et(["btn btn-sm",e.danger?"btn-danger-solid":"btn-primary"]),onClick:c[1]||(c[1]=d=>s("confirm"))},re(e.confirmText),3)])],8,Fh)])):Se("",!0)]),_:1})]))}}),Gt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},ur=Gt(Uh,[["__scopeId","data-v-f27041d4"]]);var $u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nf={exports:{}};(function(e,t){((n,s)=>{e.exports=s()})($u,function(){var n=function(r,i){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(l,f){l.__proto__=f}:function(l,f){for(var p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}))(r,i)},s=function(){return(s=Object.assign||function(r){for(var i,l=1,f=arguments.length;l<f;l++)for(var p in i=arguments[l])Object.prototype.hasOwnProperty.call(i,p)&&(r[p]=i[p]);return r}).apply(this,arguments)};function o(r,i,l){for(var f,p=0,v=i.length;p<v;p++)!f&&p in i||((f=f||Array.prototype.slice.call(i,0,p))[p]=i[p]);return r.concat(f||Array.prototype.slice.call(i))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:$u,c=Object.keys,d=Array.isArray;function h(r,i){return typeof i=="object"&&c(i).forEach(function(l){r[l]=i[l]}),r}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var y=Object.getPrototypeOf,m={}.hasOwnProperty;function k(r,i){return m.call(r,i)}function D(r,i){typeof i=="function"&&(i=i(y(r))),(typeof Reflect>"u"?c:Reflect.ownKeys)(i).forEach(function(l){L(r,l,i[l])})}var T=Object.defineProperty;function L(r,i,l,f){T(r,i,h(l&&k(l,"get")&&typeof l.get=="function"?{get:l.get,set:l.set,configurable:!0}:{value:l,configurable:!0,writable:!0},f))}function X(r){return{from:function(i){return r.prototype=Object.create(i.prototype),L(r.prototype,"constructor",r),{extend:D.bind(null,r.prototype)}}}}var ce=Object.getOwnPropertyDescriptor,Q=[].slice;function E(r,i,l){return Q.call(r,i,l)}function N(r,i){return i(r)}function G(r){if(!r)throw new Error("Assertion Failed")}function de(r){a.setImmediate?setImmediate(r):setTimeout(r,0)}function ae(r,i){if(typeof i=="string"&&k(r,i))return r[i];if(!i)return r;if(typeof i!="string"){for(var l=[],f=0,p=i.length;f<p;++f){var v=ae(r,i[f]);l.push(v)}return l}var b,_=i.indexOf(".");return _===-1||(b=r[i.substr(0,_)])==null?void 0:ae(b,i.substr(_+1))}function Z(r,i,l){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){G(typeof l!="string"&&"length"in l);for(var f=0,p=i.length;f<p;++f)Z(r,i[f],l[f])}else{var v=i.indexOf(".");if(v!==-1){var b=i.substr(0,v),v=i.substr(v+1);if(v==="")l===void 0?d(r)&&!isNaN(parseInt(b))?r.splice(b,1):delete r[b]:r[b]=l;else{var _=r[b];if(!_||!k(r,b)){if(l===void 0)return;_=r[b]={}}Z(_,v,l)}}else l===void 0?d(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=l}}function $(r){var i,l={};for(i in r)k(r,i)&&(l[i]=r[i]);return l}var x=[].concat;function le(r){return x.apply([],r)}var ne="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(le([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return a[r]}),ke=new Set(ne.map(function(r){return a[r]})),J=null;function xe(r){return J=new WeakMap,r=function i(l){if(!l||typeof l!="object")return l;var f=J.get(l);if(f)return f;if(d(l)){f=[],J.set(l,f);for(var p=0,v=l.length;p<v;++p)f.push(i(l[p]))}else if(ke.has(l.constructor))f=l;else{var b,_=y(l);for(b in f=_===Object.prototype?{}:Object.create(_),J.set(l,f),l)k(l,b)&&(f[b]=i(l[b]))}return f}(r),J=null,r}var Ve={}.toString;function nt(r){return Ve.call(r).slice(8,-1)}var qe=typeof Symbol<"u"?Symbol.iterator:"@@iterator",He=typeof qe=="symbol"?function(r){var i;return r!=null&&(i=r[qe])&&i.apply(r)}:function(){return null};function ge(r,i){i=r.indexOf(i),0<=i&&r.splice(i,1)}var Oe={};function Fe(r){var i,l,f,p;if(arguments.length===1){if(d(r))return r.slice();if(this===Oe&&typeof r=="string")return[r];if(p=He(r))for(l=[];!(f=p.next()).done;)l.push(f.value);else{if(r==null)return[r];if(typeof(i=r.length)!="number")return[r];for(l=new Array(i);i--;)l[i]=r[i]}}else for(i=arguments.length,l=new Array(i);i--;)l[i]=arguments[i];return l}var je=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},ne=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Je=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ne),F={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 fe(r,i){this.name=r,this.message=i}function Ke(r,i){return r+". Errors: "+Object.keys(i).map(function(l){return i[l].toString()}).filter(function(l,f,p){return p.indexOf(l)===f}).join(`
`)}function ct(r,i,l,f){this.failures=i,this.failedKeys=f,this.successCount=l,this.message=Ke(r,i)}function ht(r,i){this.name="BulkError",this.failures=Object.keys(i).map(function(l){return i[l]}),this.failuresByPos=i,this.message=Ke(r,this.failures)}X(fe).from(Error).extend({toString:function(){return this.name+": "+this.message}}),X(ct).from(fe),X(ht).from(fe);var Yt=Je.reduce(function(r,i){return r[i]=i+"Error",r},{}),Jt=fe,Ie=Je.reduce(function(r,i){var l=i+"Error";function f(p,v){this.name=l,p?typeof p=="string"?(this.message="".concat(p).concat(v?`
`+v:""),this.inner=v||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=F[i]||l,this.inner=null)}return X(f).from(Jt),r[i]=f,r},{}),w=(Ie.Syntax=SyntaxError,Ie.Type=TypeError,Ie.Range=RangeError,ne.reduce(function(r,i){return r[i+"Error"]=Ie[i],r},{}));ne=Je.reduce(function(r,i){return["Syntax","Type","Range"].indexOf(i)===-1&&(r[i+"Error"]=Ie[i]),r},{});function g(){}function P(r){return r}function ie(r,i){return r==null||r===P?i:function(l){return i(r(l))}}function se(r,i){return function(){r.apply(this,arguments),i.apply(this,arguments)}}function ue(r,i){return r===g?i:function(){var l=r.apply(this,arguments),f=(l!==void 0&&(arguments[0]=l),this.onsuccess),p=this.onerror,v=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?se(f,this.onsuccess):f),p&&(this.onerror=this.onerror?se(p,this.onerror):p),v!==void 0?v:l}}function ye(r,i){return r===g?i:function(){r.apply(this,arguments);var l=this.onsuccess,f=this.onerror;this.onsuccess=this.onerror=null,i.apply(this,arguments),l&&(this.onsuccess=this.onsuccess?se(l,this.onsuccess):l),f&&(this.onerror=this.onerror?se(f,this.onerror):f)}}function oe(r,i){return r===g?i:function(){var l=r.apply(this,arguments),f=(h(arguments[0],l),this.onsuccess),p=this.onerror,v=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?se(f,this.onsuccess):f),p&&(this.onerror=this.onerror?se(p,this.onerror):p),l===void 0?v===void 0?void 0:v:h(l,v)}}function we(r,i){return r===g?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function W(r,i){return r===g?i:function(){var l=r.apply(this,arguments);if(l&&typeof l.then=="function"){for(var f=this,p=arguments.length,v=new Array(p);p--;)v[p]=arguments[p];return l.then(function(){return i.apply(f,v)})}return i.apply(this,arguments)}}ne.ModifyError=ct,ne.DexieError=fe,ne.BulkError=ht;var q=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Y(r){q=r}var $e={},Ne=100,Xe=typeof Promise>"u"?[]:(Je=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Xe=crypto.subtle.digest("SHA-512",new Uint8Array([0])),y(Xe),Je]:[Je,y(Je),Je]),Je=Xe[0],Br=Xe[1],Br=Br&&Br.then,Qe=Je&&Je.constructor,vt=!!Xe[2],_t=function(r,i){Hn.push([r,i]),Bt&&(queueMicrotask(Af),Bt=!1)},Xt=!0,Bt=!0,Zt=[],pr=[],Ot=P,$t={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:g,pgp:!1,env:{},finalize:g},Me=$t,Hn=[],hr=0,Ws=[];function Ce(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var i=this._PSD=Me;if(typeof r!="function"){if(r!==$e)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&bi(this,this._value)}else this._state=null,this._value=null,++i.ref,function l(f,p){try{p(function(v){if(f._state===null){if(v===f)throw new TypeError("A promise cannot be resolved with itself.");var b=f._lib&&Rr();v&&typeof v.then=="function"?l(f,function(_,S){v instanceof Ce?v._then(_,S):v.then(_,S)}):(f._state=!0,f._value=v,ll(f)),b&&Lr()}},bi.bind(null,f))}catch(v){bi(f,v)}}(this,r)}var gi={get:function(){var r=Me,i=Js;function l(f,p){var v=this,b=!r.global&&(r!==Me||i!==Js),_=b&&!zn(),S=new Ce(function(B,O){wi(v,new al(cl(f,r,b,_),cl(p,r,b,_),B,O,r))});return this._consoleTask&&(S._consoleTask=this._consoleTask),S}return l.prototype=$e,l},set:function(r){L(this,"then",r&&r.prototype===$e?gi:{get:function(){return r},set:gi.set})}};function al(r,i,l,f,p){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof i=="function"?i:null,this.resolve=l,this.reject=f,this.psd=p}function bi(r,i){var l,f;pr.push(i),r._state===null&&(l=r._lib&&Rr(),i=Ot(i),r._state=!1,r._value=i,f=r,Zt.some(function(p){return p._value===f._value})||Zt.push(f),ll(r),l)&&Lr()}function ll(r){var i=r._listeners;r._listeners=[];for(var l=0,f=i.length;l<f;++l)wi(r,i[l]);var p=r._PSD;--p.ref||p.finalize(),hr===0&&(++hr,_t(function(){--hr==0&&_i()},[]))}function wi(r,i){if(r._state===null)r._listeners.push(i);else{var l=r._state?i.onFulfilled:i.onRejected;if(l===null)return(r._state?i.resolve:i.reject)(r._value);++i.psd.ref,++hr,_t($f,[l,r,i])}}function $f(r,i,l){try{var f,p=i._value;!i._state&&pr.length&&(pr=[]),f=q&&i._consoleTask?i._consoleTask.run(function(){return r(p)}):r(p),i._state||pr.indexOf(p)!==-1||(v=>{for(var b=Zt.length;b;)if(Zt[--b]._value===v._value)return Zt.splice(b,1)})(i),l.resolve(f)}catch(v){l.reject(v)}finally{--hr==0&&_i(),--l.psd.ref||l.psd.finalize()}}function Af(){vr($t,function(){Rr()&&Lr()})}function Rr(){var r=Xt;return Bt=Xt=!1,r}function Lr(){var r,i,l;do for(;0<Hn.length;)for(r=Hn,Hn=[],l=r.length,i=0;i<l;++i){var f=r[i];f[0].apply(null,f[1])}while(0<Hn.length);Bt=Xt=!0}function _i(){for(var r=Zt,i=(Zt=[],r.forEach(function(f){f._PSD.onunhandled.call(null,f._value,f)}),Ws.slice(0)),l=i.length;l;)i[--l]()}function zs(r){return new Ce($e,!1,r)}function mt(r,i){var l=Me;return function(){var f=Rr(),p=Me;try{return Gn(l,!0),r.apply(this,arguments)}catch(v){i&&i(v)}finally{Gn(p,!1),f&&Lr()}}}D(Ce.prototype,{then:gi,_then:function(r,i){wi(this,new al(null,null,r,i,Me))},catch:function(r){var i,l;return arguments.length===1?this.then(null,r):(i=r,l=arguments[1],typeof i=="function"?this.then(null,function(f){return(f instanceof i?l:zs)(f)}):this.then(null,function(f){return(f&&f.name===i?l:zs)(f)}))},finally:function(r){return this.then(function(i){return Ce.resolve(r()).then(function(){return i})},function(i){return Ce.resolve(r()).then(function(){return zs(i)})})},timeout:function(r,i){var l=this;return r<1/0?new Ce(function(f,p){var v=setTimeout(function(){return p(new Ie.Timeout(i))},r);l.then(f,p).finally(clearTimeout.bind(null,v))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&L(Ce.prototype,Symbol.toStringTag,"Dexie.Promise"),$t.env=ul(),D(Ce,{all:function(){var r=Fe.apply(null,arguments).map(Xs);return new Ce(function(i,l){r.length===0&&i([]);var f=r.length;r.forEach(function(p,v){return Ce.resolve(p).then(function(b){r[v]=b,--f||i(r)},l)})})},resolve:function(r){return r instanceof Ce?r:r&&typeof r.then=="function"?new Ce(function(i,l){r.then(i,l)}):new Ce($e,!0,r)},reject:zs,race:function(){var r=Fe.apply(null,arguments).map(Xs);return new Ce(function(i,l){r.map(function(f){return Ce.resolve(f).then(i,l)})})},PSD:{get:function(){return Me},set:function(r){return Me=r}},totalEchoes:{get:function(){return Js}},newPSD:Wn,usePSD:vr,scheduler:{get:function(){return _t},set:function(r){_t=r}},rejectionMapper:{get:function(){return Ot},set:function(r){Ot=r}},follow:function(r,i){return new Ce(function(l,f){return Wn(function(p,v){var b=Me;b.unhandleds=[],b.onunhandled=v,b.finalize=se(function(){var _,S=this;_=function(){S.unhandleds.length===0?p():v(S.unhandleds[0])},Ws.push(function B(){_(),Ws.splice(Ws.indexOf(B),1)}),++hr,_t(function(){--hr==0&&_i()},[])},b.finalize),r()},i,l,f)})}}),Qe&&(Qe.allSettled&&L(Ce,"allSettled",function(){var r=Fe.apply(null,arguments).map(Xs);return new Ce(function(i){r.length===0&&i([]);var l=r.length,f=new Array(l);r.forEach(function(p,v){return Ce.resolve(p).then(function(b){return f[v]={status:"fulfilled",value:b}},function(b){return f[v]={status:"rejected",reason:b}}).then(function(){return--l||i(f)})})})}),Qe.any&&typeof AggregateError<"u"&&L(Ce,"any",function(){var r=Fe.apply(null,arguments).map(Xs);return new Ce(function(i,l){r.length===0&&l(new AggregateError([]));var f=r.length,p=new Array(f);r.forEach(function(v,b){return Ce.resolve(v).then(function(_){return i(_)},function(_){p[b]=_,--f||l(new AggregateError(p))})})})}),Qe.withResolvers)&&(Ce.withResolvers=Qe.withResolvers);var Pt={awaits:0,echoes:0,id:0},Pf=0,Gs=[],Ys=0,Js=0,Tf=0;function Wn(r,b,l,f){var p=Me,v=Object.create(p),b=(v.parent=p,v.ref=0,v.global=!1,v.id=++Tf,$t.env,v.env=vt?{Promise:Ce,PromiseProp:{value:Ce,configurable:!0,writable:!0},all:Ce.all,race:Ce.race,allSettled:Ce.allSettled,any:Ce.any,resolve:Ce.resolve,reject:Ce.reject}:{},b&&h(v,b),++p.ref,v.finalize=function(){--this.parent.ref||this.parent.finalize()},vr(v,r,l,f));return v.ref===0&&v.finalize(),b}function Kr(){return Pt.id||(Pt.id=++Pf),++Pt.awaits,Pt.echoes+=Ne,Pt.id}function zn(){return!!Pt.awaits&&(--Pt.awaits==0&&(Pt.id=0),Pt.echoes=Pt.awaits*Ne,!0)}function Xs(r){return Pt.echoes&&r&&r.constructor===Qe?(Kr(),r.then(function(i){return zn(),i},function(i){return zn(),Ct(i)})):r}function Of(){var r=Gs[Gs.length-1];Gs.pop(),Gn(r,!1)}function Gn(r,i){var l,f,p=Me;(i?!Pt.echoes||Ys++&&r===Me:!Ys||--Ys&&r===Me)||queueMicrotask(i?(function(v){++Js,Pt.echoes&&--Pt.echoes!=0||(Pt.echoes=Pt.awaits=Pt.id=0),Gs.push(Me),Gn(v,!0)}).bind(null,r):Of),r!==Me&&(Me=r,p===$t&&($t.env=ul()),vt)&&(l=$t.env.Promise,f=r.env,p.global||r.global)&&(Object.defineProperty(a,"Promise",f.PromiseProp),l.all=f.all,l.race=f.race,l.resolve=f.resolve,l.reject=f.reject,f.allSettled&&(l.allSettled=f.allSettled),f.any)&&(l.any=f.any)}function ul(){var r=a.Promise;return vt?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function vr(r,i,l,f,p){var v=Me;try{return Gn(r,!0),i(l,f,p)}finally{Gn(v,!1)}}function cl(r,i,l,f){return typeof r!="function"?r:function(){var p=Me;l&&Kr(),Gn(i,!0);try{return r.apply(this,arguments)}finally{Gn(p,!1),f&&queueMicrotask(zn)}}}function ki(r){Promise===Qe&&Pt.echoes===0?Ys===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+Br).indexOf("[native code]")===-1&&(Kr=zn=g);var Ct=Ce.reject,mr="￿",On="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",fl="String expected.",Qs="__dbnames",xi="readonly",Ci="readwrite";function yr(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var dl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Zs(r){return typeof r!="string"||/\./.test(r)?function(i){return i}:function(i){return i[r]===void 0&&r in i&&delete(i=xe(i))[r],i}}function pl(){throw Ie.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function tt(r,i){try{var l=hl(r),f=hl(i);if(l!==f)return l==="Array"?1:f==="Array"?-1:l==="binary"?1:f==="binary"?-1:l==="string"?1:f==="string"?-1:l==="Date"?1:f!=="Date"?NaN:-1;switch(l){case"number":case"Date":case"string":return i<r?1:r<i?-1:0;case"binary":for(var p=vl(r),v=vl(i),b=p.length,_=v.length,S=b<_?b:_,B=0;B<S;++B)if(p[B]!==v[B])return p[B]<v[B]?-1:1;return b===_?0:b<_?-1:1;case"Array":for(var O=r,C=i,A=O.length,R=C.length,I=A<R?A:R,M=0;M<I;++M){var j=tt(O[M],C[M]);if(j!==0)return j}return A===R?0:A<R?-1:1}}catch{}return NaN}function hl(r){var i=typeof r;return i=="object"&&(ArrayBuffer.isView(r)||(i=nt(r))==="ArrayBuffer")?"binary":i}function vl(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}function eo(r,i,l){var f=r.schema.yProps;return f?(i&&0<l.numFailures&&(i=i.filter(function(p,v){return!l.failures[v]})),Promise.all(f.map(function(p){return p=p.updatesTable,i?r.db.table(p).where("k").anyOf(i).delete():r.db.table(p).clear()})).then(function(){return l})):l}ml.prototype.execute=function(r){var i=this["@@propmod"];if(i.add!==void 0){var l=i.add;if(d(l))return o(o([],d(r)?r:[],!0),l).sort();if(typeof l=="number")return(Number(r)||0)+l;if(typeof l=="bigint")try{return BigInt(r)+l}catch{return BigInt(0)+l}throw new TypeError("Invalid term ".concat(l))}if(i.remove!==void 0){var f=i.remove;if(d(f))return d(r)?r.filter(function(p){return!f.includes(p)}).sort():[];if(typeof f=="number")return Number(r)-f;if(typeof f=="bigint")try{return BigInt(r)-f}catch{return BigInt(0)-f}throw new TypeError("Invalid subtrahend ".concat(f))}return l=(l=i.replacePrefix)==null?void 0:l[0],l&&typeof r=="string"&&r.startsWith(l)?i.replacePrefix[1]+r.substring(l.length):r};var ss=ml;function ml(r){this["@@propmod"]=r}function yl(r,i){for(var l=c(i),f=l.length,p=!1,v=0;v<f;++v){var b=l[v],_=i[b],S=ae(r,b);_ instanceof ss?(Z(r,b,_.execute(S)),p=!0):S!==_&&(Z(r,b,_),p=!0)}return p}dt.prototype._trans=function(r,i,l){var f=this._tx||Me.trans,p=this.name,v=q&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function b(B,O,C){if(C.schema[p])return i(C.idbtrans,C);throw new Ie.NotFound("Table "+p+" not part of transaction")}var _=Rr();try{var S=f&&f.db._novip===this.db._novip?f===Me.trans?f._promise(r,b,l):Wn(function(){return f._promise(r,b,l)},{trans:f,transless:Me.transless||Me}):function B(O,C,A,R){if(O.idbdb&&(O._state.openComplete||Me.letThrough||O._vip)){var I=O._createTransaction(C,A,O._dbSchema);try{I.create(),O._state.PR1398_maxLoop=3}catch(M){return M.name===Yt.InvalidState&&O.isOpen()&&0<--O._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),O.close({disableAutoOpen:!1}),O.open().then(function(){return B(O,C,A,R)})):Ct(M)}return I._promise(C,function(M,j){return Wn(function(){return Me.trans=I,R(M,j,I)})}).then(function(M){if(C==="readwrite")try{I.idbtrans.commit()}catch{}return C==="readonly"?M:I._completion.then(function(){return M})})}if(O._state.openComplete)return Ct(new Ie.DatabaseClosed(O._state.dbOpenError));if(!O._state.isBeingOpened){if(!O._state.autoOpen)return Ct(new Ie.DatabaseClosed);O.open().catch(g)}return O._state.dbReadyPromise.then(function(){return B(O,C,A,R)})}(this.db,r,[this.name],b);return v&&(S._consoleTask=v,S=S.catch(function(B){return console.trace(B),Ct(B)})),S}finally{_&&Lr()}},dt.prototype.get=function(r,i){var l=this;return r&&r.constructor===Object?this.where(r).first(i):r==null?Ct(new Ie.Type("Invalid argument to Table.get()")):this._trans("readonly",function(f){return l.core.get({trans:f,key:r}).then(function(p){return l.hook.reading.fire(p)})}).then(i)},dt.prototype.where=function(r){if(typeof r=="string")return new this.db.WhereClause(this,r);if(d(r))return new this.db.WhereClause(this,"[".concat(r.join("+"),"]"));var i=c(r);if(i.length===1)return this.where(i[0]).equals(r[i[0]]);var l=this.schema.indexes.concat(this.schema.primKey).filter(function(_){if(_.compound&&i.every(function(B){return 0<=_.keyPath.indexOf(B)})){for(var S=0;S<i.length;++S)if(i.indexOf(_.keyPath[S])===-1)return!1;return!0}return!1}).sort(function(_,S){return _.keyPath.length-S.keyPath.length})[0];if(l&&this.db._maxKey!==mr)return b=l.keyPath.slice(0,i.length),this.where(b).equals(b.map(function(_){return r[_]}));!l&&q&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(i.join("+"),"]"));var f=this.schema.idxByName;function p(_,S){return tt(_,S)===0}var b=i.reduce(function(O,S){var B=O[0],O=O[1],C=f[S],A=r[S];return[B||C,B||!C?yr(O,C&&C.multi?function(R){return R=ae(R,S),d(R)&&R.some(function(I){return p(A,I)})}:function(R){return p(A,ae(R,S))}):O]},[null,null]),v=b[0],b=b[1];return v?this.where(v.name).equals(r[v.keyPath]).filter(b):l?this.filter(b):this.where(i).equals("")},dt.prototype.filter=function(r){return this.toCollection().and(r)},dt.prototype.count=function(r){return this.toCollection().count(r)},dt.prototype.offset=function(r){return this.toCollection().offset(r)},dt.prototype.limit=function(r){return this.toCollection().limit(r)},dt.prototype.each=function(r){return this.toCollection().each(r)},dt.prototype.toArray=function(r){return this.toCollection().toArray(r)},dt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},dt.prototype.orderBy=function(r){return new this.db.Collection(new this.db.WhereClause(this,d(r)?"[".concat(r.join("+"),"]"):r))},dt.prototype.reverse=function(){return this.toCollection().reverse()},dt.prototype.mapToClass=function(r){for(var i=this.db,l=this.name,f=((this.schema.mappedClass=r).prototype instanceof pl&&(r=(b=>{var _=O,S=b;if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function B(){this.constructor=_}function O(){return b!==null&&b.apply(this,arguments)||this}return n(_,S),_.prototype=S===null?Object.create(S):(B.prototype=S.prototype,new B),Object.defineProperty(O.prototype,"db",{get:function(){return i},enumerable:!1,configurable:!0}),O.prototype.table=function(){return l},O})(r)),new Set),p=r.prototype;p;p=y(p))Object.getOwnPropertyNames(p).forEach(function(b){return f.add(b)});function v(b){if(!b)return b;var _,S=Object.create(r.prototype);for(_ in b)if(!f.has(_))try{S[_]=b[_]}catch{}return S}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=v,this.hook("reading",v),r},dt.prototype.defineClass=function(){return this.mapToClass(function(r){h(this,r)})},dt.prototype.add=function(r,i){var l=this,f=this.schema.primKey,p=f.auto,v=f.keyPath,b=r;return v&&p&&(b=Zs(v)(r)),this._trans("readwrite",function(_){return l.core.mutate({trans:_,type:"add",keys:i!=null?[i]:null,values:[b]})}).then(function(_){return _.numFailures?Ce.reject(_.failures[0]):_.lastResult}).then(function(_){if(v)try{Z(r,v,_)}catch{}return _})},dt.prototype.upsert=function(r,i){var l=this,f=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return l.core.get({trans:p,key:r}).then(function(v){var b=v??{};return yl(b,i),f&&Z(b,f,r),l.core.mutate({trans:p,type:"put",values:[b],keys:[r],upsert:!0,updates:{keys:[r],changeSpecs:[i]}}).then(function(_){return _.numFailures?Ce.reject(_.failures[0]):!!v})})})},dt.prototype.update=function(r,i){return typeof r!="object"||d(r)?this.where(":id").equals(r).modify(i):(r=ae(r,this.schema.primKey.keyPath))===void 0?Ct(new Ie.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(i)},dt.prototype.put=function(r,i){var l=this,f=this.schema.primKey,p=f.auto,v=f.keyPath,b=r;return v&&p&&(b=Zs(v)(r)),this._trans("readwrite",function(_){return l.core.mutate({trans:_,type:"put",values:[b],keys:i!=null?[i]:null})}).then(function(_){return _.numFailures?Ce.reject(_.failures[0]):_.lastResult}).then(function(_){if(v)try{Z(r,v,_)}catch{}return _})},dt.prototype.delete=function(r){var i=this;return this._trans("readwrite",function(l){return i.core.mutate({trans:l,type:"delete",keys:[r]}).then(function(f){return eo(i,[r],f)}).then(function(f){return f.numFailures?Ce.reject(f.failures[0]):void 0})})},dt.prototype.clear=function(){var r=this;return this._trans("readwrite",function(i){return r.core.mutate({trans:i,type:"deleteRange",range:dl}).then(function(l){return eo(r,null,l)})}).then(function(i){return i.numFailures?Ce.reject(i.failures[0]):void 0})},dt.prototype.bulkGet=function(r){var i=this;return this._trans("readonly",function(l){return i.core.getMany({keys:r,trans:l}).then(function(f){return f.map(function(p){return i.hook.reading.fire(p)})})})},dt.prototype.bulkAdd=function(r,i,l){var f=this,p=Array.isArray(i)?i:void 0,v=(l=l||(p?void 0:i))?l.allKeys:void 0;return this._trans("readwrite",function(b){var _=f.schema.primKey,B=_.auto,_=_.keyPath;if(_&&p)throw new Ie.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new Ie.InvalidArgument("Arguments objects and keys must have the same length");var S=r.length,B=_&&B?r.map(Zs(_)):r;return f.core.mutate({trans:b,type:"add",keys:p,values:B,wantResults:v}).then(function(O){var C=O.numFailures,A=O.failures;if(C===0)return v?O.results:O.lastResult;throw new ht("".concat(f.name,".bulkAdd(): ").concat(C," of ").concat(S," operations failed"),A)})})},dt.prototype.bulkPut=function(r,i,l){var f=this,p=Array.isArray(i)?i:void 0,v=(l=l||(p?void 0:i))?l.allKeys:void 0;return this._trans("readwrite",function(b){var _=f.schema.primKey,B=_.auto,_=_.keyPath;if(_&&p)throw new Ie.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new Ie.InvalidArgument("Arguments objects and keys must have the same length");var S=r.length,B=_&&B?r.map(Zs(_)):r;return f.core.mutate({trans:b,type:"put",keys:p,values:B,wantResults:v}).then(function(O){var C=O.numFailures,A=O.failures;if(C===0)return v?O.results:O.lastResult;throw new ht("".concat(f.name,".bulkPut(): ").concat(C," of ").concat(S," operations failed"),A)})})},dt.prototype.bulkUpdate=function(r){var i=this,l=this.core,f=r.map(function(b){return b.key}),p=r.map(function(b){return b.changes}),v=[];return this._trans("readwrite",function(b){return l.getMany({trans:b,keys:f,cache:"clone"}).then(function(_){var S=[],B=[],O=(r.forEach(function(C,A){var R=C.key,I=C.changes,M=_[A];if(M){for(var j=0,z=Object.keys(I);j<z.length;j++){var U=z[j],ee=I[U];if(U===i.schema.primKey.keyPath){if(tt(ee,R)!==0)throw new Ie.Constraint("Cannot update primary key in bulkUpdate()")}else Z(M,U,ee)}v.push(A),S.push(R),B.push(M)}}),S.length);return l.mutate({trans:b,type:"put",keys:S,values:B,updates:{keys:f,changeSpecs:p}}).then(function(C){var A=C.numFailures,R=C.failures;if(A===0)return O;for(var I=0,M=Object.keys(R);I<M.length;I++){var j,z=M[I],U=v[Number(z)];U!=null&&(j=R[z],delete R[z],R[U]=j)}throw new ht("".concat(i.name,".bulkUpdate(): ").concat(A," of ").concat(O," operations failed"),R)})})})},dt.prototype.bulkDelete=function(r){var i=this,l=r.length;return this._trans("readwrite",function(f){return i.core.mutate({trans:f,type:"delete",keys:r}).then(function(p){return eo(i,r,p)})}).then(function(f){var p=f.numFailures,v=f.failures;if(p===0)return f.lastResult;throw new ht("".concat(i.name,".bulkDelete(): ").concat(p," of ").concat(l," operations failed"),v)})};var gl=dt;function dt(){}function os(r){function i(b,_){if(_){for(var S=arguments.length,B=new Array(S-1);--S;)B[S-1]=arguments[S];return l[b].subscribe.apply(null,B),r}if(typeof b=="string")return l[b]}var l={};i.addEventType=v;for(var f=1,p=arguments.length;f<p;++f)v(arguments[f]);return i;function v(b,_,S){var B,O;if(typeof b!="object")return _=_||we,O={subscribers:[],fire:S=S||g,subscribe:function(C){O.subscribers.indexOf(C)===-1&&(O.subscribers.push(C),O.fire=_(O.fire,C))},unsubscribe:function(C){O.subscribers=O.subscribers.filter(function(A){return A!==C}),O.fire=O.subscribers.reduce(_,S)}},l[b]=i[b]=O;c(B=b).forEach(function(C){var A=B[C];if(d(A))v(C,B[C][0],B[C][1]);else{if(A!=="asap")throw new Ie.InvalidArgument("Invalid event config");var R=v(C,P,function(){for(var I=arguments.length,M=new Array(I);I--;)M[I]=arguments[I];R.subscribers.forEach(function(j){de(function(){j.apply(null,M)})})})}})}}function is(r,i){return X(i).from({prototype:r}),i}function Fr(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function Si(r,i){r.filter=yr(r.filter,i)}function Ei(r,i,l){var f=r.replayFilter;r.replayFilter=f?function(){return yr(f(),i())}:i,r.justLimit=l&&!f}function to(r,i){if(r.isPrimKey)return i.primaryKey;var l=i.getIndexByKeyPath(r.index);if(l)return l;throw new Ie.Schema("KeyPath "+r.index+" on object store "+i.name+" is not indexed")}function bl(r,i,l){var f=to(r,i.schema);return i.openCursor({trans:l,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:f,range:r.range}})}function no(r,i,l,f){var p,v,b=r.replayFilter?yr(r.filter,r.replayFilter()):r.filter;return r.or?(p={},v=function(_,S,B){var O,C;b&&!b(S,B,function(A){return S.stop(A)},function(A){return S.fail(A)})||((C=""+(O=S.primaryKey))=="[object ArrayBuffer]"&&(C=""+new Uint8Array(O)),k(p,C))||(p[C]=!0,i(_,S,B))},Promise.all([r.or._iterate(v,l),wl(bl(r,f,l),r.algorithm,v,!r.keysOnly&&r.valueMapper)])):wl(bl(r,f,l),yr(r.algorithm,b),i,!r.keysOnly&&r.valueMapper)}function wl(r,i,l,f){var p=mt(f?function(v,b,_){return l(f(v),b,_)}:l);return r.then(function(v){if(v)return v.start(function(){var b=function(){return v.continue()};i&&!i(v,function(_){return b=_},function(_){v.stop(_),b=g},function(_){v.fail(_),b=g})||p(v.value,v,function(_){return b=_}),b()})})}rt.prototype._read=function(r,i){var l=this._ctx;return l.error?l.table._trans(null,Ct.bind(null,l.error)):l.table._trans("readonly",r).then(i)},rt.prototype._write=function(r){var i=this._ctx;return i.error?i.table._trans(null,Ct.bind(null,i.error)):i.table._trans("readwrite",r,"locked")},rt.prototype._addAlgorithm=function(r){var i=this._ctx;i.algorithm=yr(i.algorithm,r)},rt.prototype._iterate=function(r,i){return no(this._ctx,r,i,this._ctx.table.core)},rt.prototype.clone=function(r){var i=Object.create(this.constructor.prototype),l=Object.create(this._ctx);return r&&h(l,r),i._ctx=l,i},rt.prototype.raw=function(){return this._ctx.valueMapper=null,this},rt.prototype.each=function(r){var i=this._ctx;return this._read(function(l){return no(i,r,l,i.table.core)})},rt.prototype.count=function(r){var i=this;return this._read(function(l){var f,p=i._ctx,v=p.table.core;return Fr(p,!0)?v.count({trans:l,query:{index:to(p,v.schema),range:p.range}}).then(function(b){return Math.min(b,p.limit)}):(f=0,no(p,function(){return++f,!1},l,v).then(function(){return f}))}).then(r)},rt.prototype.sortBy=function(r,i){var l=r.split(".").reverse(),f=l[0],p=l.length-1;function v(S,B){return B?v(S[l[B]],B-1):S[f]}var b=this._ctx.dir==="next"?1:-1;function _(S,B){return tt(v(S,p),v(B,p))*b}return this.toArray(function(S){return S.slice().sort(_)}).then(i)},rt.prototype.toArray=function(r){var i=this;return this._read(function(l){var f,p,v,b=i._ctx;return Fr(b,!0)&&0<b.limit?(f=b.valueMapper,p=to(b,b.table.core.schema),b.table.core.query({trans:l,limit:b.limit,values:!0,direction:b.dir==="prev"?"prev":void 0,query:{index:p,range:b.range}}).then(function(_){return _=_.result,f?_.map(f):_})):(v=[],no(b,function(_){return v.push(_)},l,b.table.core).then(function(){return v}))},r)},rt.prototype.offset=function(r){var i=this._ctx;return r<=0||(i.offset+=r,Fr(i)?Ei(i,function(){var l=r;return function(f,p){return l===0||(l===1?--l:p(function(){f.advance(l),l=0}),!1)}}):Ei(i,function(){var l=r;return function(){return--l<0}})),this},rt.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),Ei(this._ctx,function(){var i=r;return function(l,f,p){return--i<=0&&f(p),0<=i}},!0),this},rt.prototype.until=function(r,i){return Si(this._ctx,function(l,f,p){return!r(l.value)||(f(p),i)}),this},rt.prototype.first=function(r){return this.limit(1).toArray(function(i){return i[0]}).then(r)},rt.prototype.last=function(r){return this.reverse().first(r)},rt.prototype.filter=function(r){var i;return Si(this._ctx,function(l){return r(l.value)}),(i=this._ctx).isMatch=yr(i.isMatch,r),this},rt.prototype.and=function(r){return this.filter(r)},rt.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},rt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},rt.prototype.desc=function(){return this.reverse()},rt.prototype.eachKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(l,f){r(f.key,f)})},rt.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},rt.prototype.eachPrimaryKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(l,f){r(f.primaryKey,f)})},rt.prototype.keys=function(r){var i=this._ctx,l=(i.keysOnly=!i.isMatch,[]);return this.each(function(f,p){l.push(p.key)}).then(function(){return l}).then(r)},rt.prototype.primaryKeys=function(r){var i=this._ctx;if(Fr(i,!0)&&0<i.limit)return this._read(function(f){var p=to(i,i.table.core.schema);return i.table.core.query({trans:f,values:!1,limit:i.limit,direction:i.dir==="prev"?"prev":void 0,query:{index:p,range:i.range}})}).then(function(f){return f.result}).then(r);i.keysOnly=!i.isMatch;var l=[];return this.each(function(f,p){l.push(p.primaryKey)}).then(function(){return l}).then(r)},rt.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},rt.prototype.firstKey=function(r){return this.limit(1).keys(function(i){return i[0]}).then(r)},rt.prototype.lastKey=function(r){return this.reverse().firstKey(r)},rt.prototype.distinct=function(){var r,i=this._ctx,i=i.index&&i.table.schema.idxByName[i.index];return i&&i.multi&&(r={},Si(this._ctx,function(f){var f=f.primaryKey.toString(),p=k(r,f);return r[f]=!0,!p})),this},rt.prototype.modify=function(r){var i=this,l=this._ctx;return this._write(function(f){function p(M,j){var z=j.failures;A+=M-j.numFailures;for(var U=0,ee=c(z);U<ee.length;U++){var pe=ee[U];C.push(z[pe])}}var v=typeof r=="function"?r:function(M){return yl(M,r)},b=l.table.core,O=b.schema.primaryKey,_=O.outbound,S=O.extractKey,B=200,O=i.db._options.modifyChunkSize,C=(O&&(B=typeof O=="object"?O[b.name]||O["*"]||200:O),[]),A=0,R=[],I=r===_l;return i.clone().primaryKeys().then(function(M){function j(U){var ee=Math.min(B,M.length-U),pe=M.slice(U,U+ee);return(I?Promise.resolve([]):b.getMany({trans:f,keys:pe,cache:"immutable"})).then(function(ve){var _e=[],me=[],Ae=_?[]:null,be=I?pe:[];if(!I)for(var Pe=0;Pe<ee;++Pe){var he=ve[Pe],Be={value:xe(he),primKey:M[U+Pe]};v.call(Be,Be.value,Be)!==!1&&(Be.value==null?be.push(M[U+Pe]):_||tt(S(he),S(Be.value))===0?(me.push(Be.value),_&&Ae.push(M[U+Pe])):(be.push(M[U+Pe]),_e.push(Be.value)))}return Promise.resolve(0<_e.length&&b.mutate({trans:f,type:"add",values:_e}).then(function(Ue){for(var Ye in Ue.failures)be.splice(parseInt(Ye),1);p(_e.length,Ue)})).then(function(){return(0<me.length||z&&typeof r=="object")&&b.mutate({trans:f,type:"put",keys:Ae,values:me,criteria:z,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<U}).then(function(Ue){return p(me.length,Ue)})}).then(function(){return(0<be.length||z&&I)&&b.mutate({trans:f,type:"delete",keys:be,criteria:z,isAdditionalChunk:0<U}).then(function(Ue){return eo(l.table,be,Ue)}).then(function(Ue){return p(be.length,Ue)})}).then(function(){return M.length>U+ee&&j(U+B)})})}var z=Fr(l)&&l.limit===1/0&&(typeof r!="function"||I)&&{index:l.index,range:l.range};return j(0).then(function(){if(0<C.length)throw new ct("Error modifying one or more objects",C,A,R);return M.length})})})},rt.prototype.delete=function(){var r=this._ctx,i=r.range;return!Fr(r)||r.table.schema.yProps||!r.isPrimKey&&i.type!==3?this.modify(_l):this._write(function(l){var f=r.table.core.schema.primaryKey,p=i;return r.table.core.count({trans:l,query:{index:f,range:p}}).then(function(v){return r.table.core.mutate({trans:l,type:"deleteRange",range:p}).then(function(S){var _=S.failures,S=S.numFailures;if(S)throw new ct("Could not delete some values",Object.keys(_).map(function(B){return _[B]}),v-S);return v-S})})})};var Mf=rt;function rt(){}var _l=function(r,i){return i.value=null};function If(r,i){return r<i?-1:r===i?0:1}function jf(r,i){return i<r?-1:r===i?0:1}function en(r,i,l){return r=r instanceof xl?new r.Collection(r):r,r._ctx.error=new(l||TypeError)(i),r}function Nr(r){return new r.Collection(r,function(){return kl("")}).limit(0)}function ro(R,i,l,f){var p,v,b,_,S,B,O,C=l.length;if(!l.every(function(M){return typeof M=="string"}))return en(R,fl);function A(M){p=M==="next"?function(z){return z.toUpperCase()}:function(z){return z.toLowerCase()},v=M==="next"?function(z){return z.toLowerCase()}:function(z){return z.toUpperCase()},b=M==="next"?If:jf;var j=l.map(function(z){return{lower:v(z),upper:p(z)}}).sort(function(z,U){return b(z.lower,U.lower)});_=j.map(function(z){return z.upper}),S=j.map(function(z){return z.lower}),O=(B=M)==="next"?"":f}A("next");var R=new R.Collection(R,function(){return Yn(_[0],S[C-1]+f)}),I=(R._ondirectionchange=function(M){A(M)},0);return R._addAlgorithm(function(M,j,z){var U=M.key;if(typeof U=="string"){var ee=v(U);if(i(ee,S,I))return!0;for(var pe=null,ve=I;ve<C;++ve){var _e=((me,Ae,be,Pe,he,Be)=>{for(var Ue=Math.min(me.length,Pe.length),Ye=-1,Ze=0;Ze<Ue;++Ze){var tn=Ae[Ze];if(tn!==Pe[Ze])return he(me[Ze],be[Ze])<0?me.substr(0,Ze)+be[Ze]+be.substr(Ze+1):he(me[Ze],Pe[Ze])<0?me.substr(0,Ze)+Pe[Ze]+be.substr(Ze+1):0<=Ye?me.substr(0,Ye)+Ae[Ye]+be.substr(Ye+1):null;he(me[Ze],tn)<0&&(Ye=Ze)}return Ue<Pe.length&&Be==="next"?me+be.substr(me.length):Ue<me.length&&Be==="prev"?me.substr(0,be.length):Ye<0?null:me.substr(0,Ye)+Pe[Ye]+be.substr(Ye+1)})(U,ee,_[ve],S[ve],b,B);_e===null&&pe===null?I=ve+1:(pe===null||0<b(pe,_e))&&(pe=_e)}j(pe!==null?function(){M.continue(pe+O)}:z)}return!1}),R}function Yn(r,i,l,f){return{type:2,lower:r,upper:i,lowerOpen:l,upperOpen:f}}function kl(r){return{type:1,lower:r,upper:r}}Object.defineProperty(Tt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Tt.prototype.between=function(r,i,l,f){l=l!==!1,f=f===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(l||f)&&(!l||!f)?Nr(this):new this.Collection(this,function(){return Yn(r,i,!l,!f)})}catch{return en(this,On)}},Tt.prototype.equals=function(r){return r==null?en(this,On):new this.Collection(this,function(){return kl(r)})},Tt.prototype.above=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(r,void 0,!0)})},Tt.prototype.aboveOrEqual=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(r,void 0,!1)})},Tt.prototype.below=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(void 0,r,!1,!0)})},Tt.prototype.belowOrEqual=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(void 0,r)})},Tt.prototype.startsWith=function(r){return typeof r!="string"?en(this,fl):this.between(r,r+mr,!0,!0)},Tt.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):ro(this,function(i,l){return i.indexOf(l[0])===0},[r],mr)},Tt.prototype.equalsIgnoreCase=function(r){return ro(this,function(i,l){return i===l[0]},[r],"")},Tt.prototype.anyOfIgnoreCase=function(){var r=Fe.apply(Oe,arguments);return r.length===0?Nr(this):ro(this,function(i,l){return l.indexOf(i)!==-1},r,"")},Tt.prototype.startsWithAnyOfIgnoreCase=function(){var r=Fe.apply(Oe,arguments);return r.length===0?Nr(this):ro(this,function(i,l){return l.some(function(f){return i.indexOf(f)===0})},r,mr)},Tt.prototype.anyOf=function(){var r,i,l=this,f=Fe.apply(Oe,arguments),p=this._cmp;try{f.sort(p)}catch{return en(this,On)}return f.length===0?Nr(this):((r=new this.Collection(this,function(){return Yn(f[0],f[f.length-1])}))._ondirectionchange=function(v){p=v==="next"?l._ascending:l._descending,f.sort(p)},i=0,r._addAlgorithm(function(v,b,_){for(var S=v.key;0<p(S,f[i]);)if(++i===f.length)return b(_),!1;return p(S,f[i])===0||(b(function(){v.continue(f[i])}),!1)}),r)},Tt.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Tt.prototype.noneOf=function(){var r=Fe.apply(Oe,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return en(this,On)}var i=r.reduce(function(l,f){return l?l.concat([[l[l.length-1][1],f]]):[[-1/0,f]]},null);return i.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(i,{includeLowers:!1,includeUppers:!1})},Tt.prototype.inAnyRange=function(r,z){var l=this,f=this._cmp,p=this._ascending,v=this._descending,b=this._min,_=this._max;if(r.length===0)return Nr(this);if(!r.every(function(U){return U[0]!==void 0&&U[1]!==void 0&&p(U[0],U[1])<=0}))return en(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ie.InvalidArgument);var S=!z||z.includeLowers!==!1,B=z&&z.includeUppers===!0,O,C=p;function A(U,ee){return C(U[0],ee[0])}try{(O=r.reduce(function(U,ee){for(var pe=0,ve=U.length;pe<ve;++pe){var _e=U[pe];if(f(ee[0],_e[1])<0&&0<f(ee[1],_e[0])){_e[0]=b(_e[0],ee[0]),_e[1]=_(_e[1],ee[1]);break}}return pe===ve&&U.push(ee),U},[])).sort(A)}catch{return en(this,On)}var R=0,I=B?function(U){return 0<p(U,O[R][1])}:function(U){return 0<=p(U,O[R][1])},M=S?function(U){return 0<v(U,O[R][0])}:function(U){return 0<=v(U,O[R][0])},j=I,z=new this.Collection(this,function(){return Yn(O[0][0],O[O.length-1][1],!S,!B)});return z._ondirectionchange=function(U){C=U==="next"?(j=I,p):(j=M,v),O.sort(A)},z._addAlgorithm(function(U,ee,pe){for(var ve,_e=U.key;j(_e);)if(++R===O.length)return ee(pe),!1;return!I(ve=_e)&&!M(ve)||(l._cmp(_e,O[R][1])===0||l._cmp(_e,O[R][0])===0||ee(function(){C===p?U.continue(O[R][0]):U.continue(O[R][1])}),!1)}),z},Tt.prototype.startsWithAnyOf=function(){var r=Fe.apply(Oe,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Nr(this):this.inAnyRange(r.map(function(i){return[i,i+mr]})):en(this,"startsWithAnyOf() only works with strings")};var xl=Tt;function Tt(){}function dn(r){return mt(function(i){return as(i),r(i.target.error),!1})}function as(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var so="storagemutated",$i="x-storagemutated-1",Jn=os(null,so),Df=(yn.prototype._lock=function(){return G(!Me.global),++this._reculock,this._reculock!==1||Me.global||(Me.lockOwnerFor=this),this},yn.prototype._unlock=function(){if(G(!Me.global),--this._reculock==0)for(Me.global||(Me.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{vr(r[1],r[0])}catch{}}return this},yn.prototype._locked=function(){return this._reculock&&Me.lockOwnerFor!==this},yn.prototype.create=function(r){var i=this;if(this.mode){var l=this.db.idbdb,f=this.db._state.dbOpenError;if(G(!this.idbtrans),!r&&!l)switch(f&&f.name){case"DatabaseClosedError":throw new Ie.DatabaseClosed(f);case"MissingAPIError":throw new Ie.MissingAPI(f.message,f);default:throw new Ie.OpenFailed(f)}if(!this.active)throw new Ie.TransactionInactive;G(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||l).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=mt(function(p){as(p),i._reject(r.error)}),r.onabort=mt(function(p){as(p),i.active&&i._reject(new Ie.Abort(r.error)),i.active=!1,i.on("abort").fire(p)}),r.oncomplete=mt(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&Jn.storagemutated.fire(r.mutatedParts)})}return this},yn.prototype._promise=function(r,i,l){var f,p=this;return r==="readwrite"&&this.mode!=="readwrite"?Ct(new Ie.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Ce(function(v,b){p._blockedFuncs.push([function(){p._promise(r,i,l).then(v,b)},Me])}):l?Wn(function(){var v=new Ce(function(b,_){p._lock();var S=i(b,_,p);S&&S.then&&S.then(b,_)});return v.finally(function(){return p._unlock()}),v._lib=!0,v}):((f=new Ce(function(v,b){var _=i(v,b,p);_&&_.then&&_.then(v,b)}))._lib=!0,f):Ct(new Ie.TransactionInactive)},yn.prototype._root=function(){return this.parent?this.parent._root():this},yn.prototype.waitFor=function(r){var i,l=this._root(),f=Ce.resolve(r),p=(l._waitingFor?l._waitingFor=l._waitingFor.then(function(){return f}):(l._waitingFor=f,l._waitingQueue=[],i=l.idbtrans.objectStore(l.storeNames[0]),function v(){for(++l._spinCount;l._waitingQueue.length;)l._waitingQueue.shift()();l._waitingFor&&(i.get(-1/0).onsuccess=v)}()),l._waitingFor);return new Ce(function(v,b){f.then(function(_){return l._waitingQueue.push(mt(v.bind(null,_)))},function(_){return l._waitingQueue.push(mt(b.bind(null,_)))}).finally(function(){l._waitingFor===p&&(l._waitingFor=null)})})},yn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ie.Abort))},yn.prototype.table=function(r){var i=this._memoizedTables||(this._memoizedTables={});if(k(i,r))return i[r];var l=this.schema[r];if(l)return(l=new this.db.Table(r,l,this)).core=this.db.core.table(r),i[r]=l;throw new Ie.NotFound("Table "+r+" not part of transaction")},yn);function yn(){}function Ai(r,i,l,f,p,v,b,_){return{name:r,keyPath:i,unique:l,multi:f,auto:p,compound:v,src:(l&&!b?"&":"")+(f?"*":"")+(p?"++":"")+Cl(i),type:_}}function Cl(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function Pi(r,i,l){return{name:r,primKey:i,indexes:l,mappedClass:null,idxByName:(f=function(p){return[p.name,p]},l.reduce(function(p,v,b){return v=f(v,b),v&&(p[v[0]]=v[1]),p},{}))};var f}var ls=function(r){try{return r.only([[]]),ls=function(){return[[]]},[[]]}catch{return ls=function(){return mr},mr}};function Ti(r){return r==null?function(){}:typeof r=="string"?(i=r).split(".").length===1?function(l){return l[i]}:function(l){return ae(l,i)}:function(l){return ae(l,r)};var i}function Sl(r){return[].slice.call(r)}var Rf=0;function us(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function Lf(r,i,b){function f(j){if(j.type===3)return null;if(j.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var R=j.lower,I=j.upper,M=j.lowerOpen,j=j.upperOpen;return R===void 0?I===void 0?null:i.upperBound(I,!!j):I===void 0?i.lowerBound(R,!!M):i.bound(R,I,!!M,!!j)}function p(A){var R,I,M=A.name;return{name:M,schema:A,mutate:function(j){var z=j.trans,U=j.type,ee=j.keys,pe=j.values,ve=j.range;return new Promise(function(_e,me){_e=mt(_e);var Ae=z.objectStore(M),be=Ae.keyPath==null,Pe=U==="put"||U==="add";if(!Pe&&U!=="delete"&&U!=="deleteRange")throw new Error("Invalid operation type: "+U);var he,Be=(ee||pe||{length:1}).length;if(ee&&pe&&ee.length!==pe.length)throw new Error("Given keys array must have same length as given values array.");if(Be===0)return _e({numFailures:0,failures:{},results:[],lastResult:void 0});function Ue(Ut){++tn,as(Ut)}var Ye=[],Ze=[],tn=0;if(U==="deleteRange"){if(ve.type===4)return _e({numFailures:tn,failures:Ze,results:[],lastResult:void 0});ve.type===3?Ye.push(he=Ae.clear()):Ye.push(he=Ae.delete(f(ve)))}else{var be=Pe?be?[pe,ee]:[pe,null]:[ee,null],ze=be[0],Rt=be[1];if(Pe)for(var Lt=0;Lt<Be;++Lt)Ye.push(he=Rt&&Rt[Lt]!==void 0?Ae[U](ze[Lt],Rt[Lt]):Ae[U](ze[Lt])),he.onerror=Ue;else for(Lt=0;Lt<Be;++Lt)Ye.push(he=Ae[U](ze[Lt])),he.onerror=Ue}function yo(Ut){Ut=Ut.target.result,Ye.forEach(function(wr,Gi){return wr.error!=null&&(Ze[Gi]=wr.error)}),_e({numFailures:tn,failures:Ze,results:U==="delete"?ee:Ye.map(function(wr){return wr.result}),lastResult:Ut})}he.onerror=function(Ut){Ue(Ut),yo(Ut)},he.onsuccess=yo})},getMany:function(j){var z=j.trans,U=j.keys;return new Promise(function(ee,pe){ee=mt(ee);for(var ve,_e=z.objectStore(M),me=U.length,Ae=new Array(me),be=0,Pe=0,he=function(Ye){Ye=Ye.target,Ae[Ye._pos]=Ye.result,++Pe===be&&ee(Ae)},Be=dn(pe),Ue=0;Ue<me;++Ue)U[Ue]!=null&&((ve=_e.get(U[Ue]))._pos=Ue,ve.onsuccess=he,ve.onerror=Be,++be);be===0&&ee(Ae)})},get:function(j){var z=j.trans,U=j.key;return new Promise(function(ee,pe){ee=mt(ee);var ve=z.objectStore(M).get(U);ve.onsuccess=function(_e){return ee(_e.target.result)},ve.onerror=dn(pe)})},query:(R=S,I=B,function(j){return new Promise(function(z,U){z=mt(z);var ee,pe,ve,_e,Be=j.trans,me=j.values,Ae=j.limit,he=j.query,be=(be=j.direction)!=null?be:"next",Pe=Ae===1/0?void 0:Ae,Ue=he.index,he=he.range,Be=Be.objectStore(M),Be=Ue.isPrimaryKey?Be:Be.index(Ue.name),Ue=f(he);if(Ae===0)return z({result:[]});I?(he={query:Ue,count:Pe,direction:be},(ee=me?Be.getAll(he):Be.getAllKeys(he)).onsuccess=function(Ye){return z({result:Ye.target.result})},ee.onerror=dn(U)):R&&be==="next"?((ee=me?Be.getAll(Ue,Pe):Be.getAllKeys(Ue,Pe)).onsuccess=function(Ye){return z({result:Ye.target.result})},ee.onerror=dn(U)):(pe=0,ve=!me&&"openKeyCursor"in Be?Be.openKeyCursor(Ue,be):Be.openCursor(Ue,be),_e=[],ve.onsuccess=function(){var Ye=ve.result;return!Ye||(_e.push(me?Ye.value:Ye.primaryKey),++pe===Ae)?z({result:_e}):void Ye.continue()},ve.onerror=dn(U))})}),openCursor:function(j){var z=j.trans,U=j.values,ee=j.query,pe=j.reverse,ve=j.unique;return new Promise(function(_e,me){_e=mt(_e);var Pe=ee.index,Ae=ee.range,be=z.objectStore(M),be=Pe.isPrimaryKey?be:be.index(Pe.name),Pe=pe?ve?"prevunique":"prev":ve?"nextunique":"next",he=!U&&"openKeyCursor"in be?be.openKeyCursor(f(Ae),Pe):be.openCursor(f(Ae),Pe);he.onerror=dn(me),he.onsuccess=mt(function(Be){var Ue,Ye,Ze,tn,ze=he.result;ze?(ze.___id=++Rf,ze.done=!1,Ue=ze.continue.bind(ze),Ye=(Ye=ze.continuePrimaryKey)&&Ye.bind(ze),Ze=ze.advance.bind(ze),tn=function(){throw new Error("Cursor not stopped")},ze.trans=z,ze.stop=ze.continue=ze.continuePrimaryKey=ze.advance=function(){throw new Error("Cursor not started")},ze.fail=mt(me),ze.next=function(){var Rt=this,Lt=1;return this.start(function(){return Lt--?Rt.continue():Rt.stop()}).then(function(){return Rt})},ze.start=function(Rt){function Lt(){if(he.result)try{Rt()}catch(Ut){ze.fail(Ut)}else ze.done=!0,ze.start=function(){throw new Error("Cursor behind last entry")},ze.stop()}var yo=new Promise(function(Ut,wr){Ut=mt(Ut),he.onerror=dn(wr),ze.fail=wr,ze.stop=function(Gi){ze.stop=ze.continue=ze.continuePrimaryKey=ze.advance=tn,Ut(Gi)}});return he.onsuccess=mt(function(Ut){he.onsuccess=Lt,Lt()}),ze.continue=Ue,ze.continuePrimaryKey=Ye,ze.advance=Ze,Lt(),yo},_e(ze)):_e(null)},me)})},count:function(j){var z=j.query,U=j.trans,ee=z.index,pe=z.range;return new Promise(function(ve,_e){var me=U.objectStore(M),me=ee.isPrimaryKey?me:me.index(ee.name),Ae=f(pe),Ae=Ae?me.count(Ae):me.count();Ae.onsuccess=mt(function(be){return ve(be.target.result)}),Ae.onerror=dn(_e)})}}}v=b,_=Sl((b=r).objectStoreNames),O=0<_.length?v.objectStore(_[0]):{};var v,b={schema:{name:b.name,tables:_.map(function(A){return v.objectStore(A)}).map(function(A){var R=A.keyPath,I=A.autoIncrement,j=d(R),M={},j={name:A.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:R==null,compound:j,keyPath:R,autoIncrement:I,unique:!0,extractKey:Ti(R)},indexes:Sl(A.indexNames).map(function(z){return A.index(z)}).map(function(pe){var ve=pe.name,U=pe.unique,ee=pe.multiEntry,pe=pe.keyPath,ve={name:ve,compound:d(pe),keyPath:pe,unique:U,multiEntry:ee,extractKey:Ti(pe)};return M[us(pe)]=ve}),getIndexByKeyPath:function(z){return M[us(z)]}};return M[":id"]=j.primaryKey,R!=null&&(M[us(R)]=j.primaryKey),j})},hasGetAll:0<_.length&&"getAll"in O&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in O},_=b.schema,S=b.hasGetAll,B=b.hasIdb3Features,O=_.tables.map(p),C={};return O.forEach(function(A){return C[A.name]=A}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(A){if(C[A])return C[A];throw new Error("Table '".concat(A,"' not found"))},MIN_KEY:-1/0,MAX_KEY:ls(i),schema:_}}function Kf(r,i,l,f){return l=l.IDBKeyRange,i=Lf(i,l,f),{dbcore:r.dbcore.reduce(function(p,v){return v=v.create,s(s({},p),v(p))},i)}}function oo(r,i){var l=i.db,l=Kf(r._middlewares,l,r._deps,i);r.core=l.dbcore,r.tables.forEach(function(f){var p=f.name;r.core.schema.tables.some(function(v){return v.name===p})&&(f.core=r.core.table(p),r[p]instanceof r.Table)&&(r[p].core=f.core)})}function io(r,i,l,f){l.forEach(function(p){var v=f[p];i.forEach(function(b){var _=function S(B,O){return ce(B,O)||(B=y(B))&&S(B,O)}(b,p);(!_||"value"in _&&_.value===void 0)&&(b===r.Transaction.prototype||b instanceof r.Transaction?L(b,p,{get:function(){return this.table(p)},set:function(S){T(this,p,{value:S,writable:!0,configurable:!0,enumerable:!0})}}):b[p]=new r.Table(p,v))})})}function Oi(r,i){i.forEach(function(l){for(var f in l)l[f]instanceof r.Table&&delete l[f]})}function Ff(r,i){return r._cfg.version-i._cfg.version}function Nf(r,i,l,f){var p=r._dbSchema,v=(l.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=Pi("$meta",$l("")[0],[]),r._storeNames.push("$meta")),r._createTransaction("readwrite",r._storeNames,p)),b=(v.create(l),v._completion.catch(f),v._reject.bind(v)),_=Me.transless||Me;Wn(function(){if(Me.trans=v,Me.transless=_,i!==0)return oo(r,l),B=i,((S=v).storeNames.includes("$meta")?S.table("$meta").get("version").then(function(O){return O??B}):Ce.resolve(B)).then(function(j){var C=r,A=j,R=v,I=l,M=[],j=C._versions,z=C._dbSchema=lo(0,C.idbdb,I);return(j=j.filter(function(U){return U._cfg.version>=A})).length===0?Ce.resolve():(j.forEach(function(U){M.push(function(){var ee,pe,ve,_e=z,me=U._cfg.dbschema,Ae=(uo(C,_e,I),uo(C,me,I),z=C._dbSchema=me,Mi(_e,me)),be=(Ae.add.forEach(function(Pe){Ii(I,Pe[0],Pe[1].primKey,Pe[1].indexes)}),Ae.change.forEach(function(Pe){if(Pe.recreate)throw new Ie.Upgrade("Not yet support for changing primary key");var he=I.objectStore(Pe.name);Pe.add.forEach(function(Be){return ao(he,Be)}),Pe.change.forEach(function(Be){he.deleteIndex(Be.name),ao(he,Be)}),Pe.del.forEach(function(Be){return he.deleteIndex(Be)})}),U._cfg.contentUpgrade);if(be&&U._cfg.version>A)return oo(C,I),R._memoizedTables={},ee=$(me),Ae.del.forEach(function(Pe){ee[Pe]=_e[Pe]}),Oi(C,[C.Transaction.prototype]),io(C,[C.Transaction.prototype],c(ee),ee),R.schema=ee,(pe=je(be))&&Kr(),me=Ce.follow(function(){var Pe;(ve=be(R))&&pe&&(Pe=zn.bind(null,null),ve.then(Pe,Pe))}),ve&&typeof ve.then=="function"?Ce.resolve(ve):me.then(function(){return ve})}),M.push(function(ee){var pe,ve,_e=U._cfg.dbschema;pe=_e,ve=ee,[].slice.call(ve.db.objectStoreNames).forEach(function(me){return pe[me]==null&&ve.db.deleteObjectStore(me)}),Oi(C,[C.Transaction.prototype]),io(C,[C.Transaction.prototype],C._storeNames,C._dbSchema),R.schema=C._dbSchema}),M.push(function(ee){C.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(C.idbdb.version/10)===U._cfg.version?(C.idbdb.deleteObjectStore("$meta"),delete C._dbSchema.$meta,C._storeNames=C._storeNames.filter(function(pe){return pe!=="$meta"})):ee.objectStore("$meta").put(U._cfg.version,"version"))})}),function U(){return M.length?Ce.resolve(M.shift()(R.idbtrans)).then(U):Ce.resolve()}().then(function(){El(z,I)}))}).catch(b);var S,B;c(p).forEach(function(O){Ii(l,O,p[O].primKey,p[O].indexes)}),oo(r,l),Ce.follow(function(){return r.on.populate.fire(v)}).catch(b)})}function Vf(r,i){El(r._dbSchema,i),i.db.version%10!=0||i.objectStoreNames.contains("$meta")||i.db.createObjectStore("$meta").add(Math.ceil(i.db.version/10-1),"version");var l=lo(0,r.idbdb,i);uo(r,r._dbSchema,i);for(var f=0,p=Mi(l,r._dbSchema).change;f<p.length;f++){var v=(b=>{if(b.change.length||b.recreate)return console.warn("Unable to patch indexes of table ".concat(b.name," because it has changes on the type of index or primary key.")),{value:void 0};var _=i.objectStore(b.name);b.add.forEach(function(S){q&&console.debug("Dexie upgrade patch: Creating missing index ".concat(b.name,".").concat(S.src)),ao(_,S)})})(p[f]);if(typeof v=="object")return v.value}}function Mi(r,i){var l,f={del:[],add:[],change:[]};for(l in r)i[l]||f.del.push(l);for(l in i){var p=r[l],v=i[l];if(p){var b={name:l,def:v,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(v.primKey.keyPath||"")||p.primKey.auto!==v.primKey.auto)b.recreate=!0,f.change.push(b);else{var _=p.idxByName,S=v.idxByName,B=void 0;for(B in _)S[B]||b.del.push(B);for(B in S){var O=_[B],C=S[B];O?O.src!==C.src&&b.change.push(C):b.add.push(C)}(0<b.del.length||0<b.add.length||0<b.change.length)&&f.change.push(b)}}else f.add.push([l,v])}return f}function Ii(r,i,l,f){var p=r.db.createObjectStore(i,l.keyPath?{keyPath:l.keyPath,autoIncrement:l.auto}:{autoIncrement:l.auto});f.forEach(function(v){return ao(p,v)})}function El(r,i){c(r).forEach(function(l){i.db.objectStoreNames.contains(l)||(q&&console.debug("Dexie: Creating missing table",l),Ii(i,l,r[l].primKey,r[l].indexes))})}function ao(r,i){r.createIndex(i.name,i.keyPath,{unique:i.unique,multiEntry:i.multi})}function lo(r,i,l){var f={};return E(i.objectStoreNames,0).forEach(function(p){for(var v=l.objectStore(p),b=Ai(Cl(B=v.keyPath),B||"",!0,!1,!!v.autoIncrement,B&&typeof B!="string",!0),_=[],S=0;S<v.indexNames.length;++S){var O=v.index(v.indexNames[S]),B=O.keyPath,O=Ai(O.name,B,!!O.unique,!!O.multiEntry,!1,B&&typeof B!="string",!1);_.push(O)}f[p]=Pi(p,b,_)}),f}function uo(r,i,l){for(var f=l.db.objectStoreNames,p=0;p<f.length;++p){var v=f[p],b=l.objectStore(v);r._hasGetAll="getAll"in b;for(var _=0;_<b.indexNames.length;++_){var S,B=b.indexNames[_],O=b.index(B).keyPath,O=typeof O=="string"?O:"["+E(O).join("+")+"]";i[v]&&(S=i[v].idxByName[O])&&(S.name=B,delete i[v].idxByName[O],i[v].idxByName[B]=S)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function $l(r){return r.split(",").map(function(i,l){var p=i.split(":"),f=(f=p[1])==null?void 0:f.trim(),p=(i=p[0].trim()).replace(/([&*]|\+\+)/g,""),v=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return Ai(p,v||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),d(v),l===0,f)})}Vr.prototype._createTableSchema=Pi,Vr.prototype._parseIndexSyntax=$l,Vr.prototype._parseStoresSpec=function(r,i){var l=this;c(r).forEach(function(f){if(r[f]!==null){var p=l._parseIndexSyntax(r[f]),v=p.shift();if(!v)throw new Ie.Schema("Invalid schema for table "+f+": "+r[f]);if(v.unique=!0,v.multi)throw new Ie.Schema("Primary key cannot be multiEntry*");p.forEach(function(b){if(b.auto)throw new Ie.Schema("Only primary key can be marked as autoIncrement (++)");if(!b.keyPath)throw new Ie.Schema("Index must have a name and cannot be an empty string")}),v=l._createTableSchema(f,v,p),i[f]=v}})},Vr.prototype.stores=function(l){var i=this.db,l=(this._cfg.storesSource=this._cfg.storesSource?h(this._cfg.storesSource,l):l,i._versions),f={},p={};return l.forEach(function(v){h(f,v._cfg.storesSource),p=v._cfg.dbschema={},v._parseStoresSpec(f,p)}),i._dbSchema=p,Oi(i,[i._allTables,i,i.Transaction.prototype]),io(i,[i._allTables,i,i.Transaction.prototype,this._cfg.tables],c(p),p),i._storeNames=c(p),this},Vr.prototype.upgrade=function(r){return this._cfg.contentUpgrade=W(this._cfg.contentUpgrade||g,r),this};var Bf=Vr;function Vr(){}var cs=(()=>{var r,i,l;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(r=new Set,i=new FinalizationRegistry(function(f){r.delete(f)}),{toArray:function(){return Array.from(r).map(function(f){return f.deref()}).filter(function(f){return f!==void 0})},add:function(f){var p=new WeakRef(f._novip);r.add(p),i.register(f._novip,p,p),r.size>f._options.maxConnections&&(p=r.values().next().value,r.delete(p),i.unregister(p))},remove:function(f){if(f)for(var p=r.values(),v=p.next();!v.done;){var b=v.value;if(b.deref()===f._novip)return r.delete(b),void i.unregister(b);v=p.next()}}}):(l=[],{toArray:function(){return l},add:function(f){l.push(f._novip)},remove:function(f){f&&(f=l.indexOf(f._novip))!==-1&&l.splice(f,1)}})})();function ji(r,i){var l=r._dbNamesDB;return l||(l=r._dbNamesDB=new Mn(Qs,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),l.table("dbnames")}function Di(r){return r&&typeof r.databases=="function"}function Ri(r){return Wn(function(){return Me.letThrough=!0,r()})}function Li(r){return!("from"in r)}var Dt=function(r,i){var l;if(!this)return l=new Dt,r&&"d"in r&&h(l,r),l;h(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function fs(r,i,l){var f=tt(i,l);if(!isNaN(f)){if(0<f)throw RangeError();if(Li(r))return h(r,{from:i,to:l,d:1});var f=r.l,p=r.r;if(tt(l,r.from)<0)return f?fs(f,i,l):r.l={from:i,to:l,d:1,l:null,r:null},Pl(r);if(0<tt(i,r.to))return p?fs(p,i,l):r.r={from:i,to:l,d:1,l:null,r:null},Pl(r);tt(i,r.from)<0&&(r.from=i,r.l=null,r.d=p?p.d+1:1),0<tt(l,r.to)&&(r.to=l,r.r=null,r.d=r.l?r.l.d+1:1),i=!r.r,f&&!r.l&&ds(r,f),p&&i&&ds(r,p)}}function ds(r,i){Li(i)||function l(f,p){var v=p.from,b=p.l,_=p.r;fs(f,v,p.to),b&&l(f,b),_&&l(f,_)}(r,i)}function Al(r,i){var l=co(i),f=l.next();if(!f.done)for(var p=f.value,v=co(r),b=v.next(p.from),_=b.value;!f.done&&!b.done;){if(tt(_.from,p.to)<=0&&0<=tt(_.to,p.from))return!0;tt(p.from,_.from)<0?p=(f=l.next(_.from)).value:_=(b=v.next(p.from)).value}return!1}function co(r){var i=Li(r)?null:{s:0,n:r};return{next:function(l){for(var f=0<arguments.length;i;)switch(i.s){case 0:if(i.s=1,f)for(;i.n.l&&tt(l,i.n.from)<0;)i={up:i,n:i.n.l,s:1};else for(;i.n.l;)i={up:i,n:i.n.l,s:1};case 1:if(i.s=2,!f||tt(l,i.n.to)<=0)return{value:i.n,done:!1};case 2:if(i.n.r){i.s=3,i={up:i,n:i.n.r,s:0};continue}case 3:i=i.up}return{done:!0}}}}function Pl(r){var i,l,f,p=(((p=r.r)==null?void 0:p.d)||0)-(((p=r.l)==null?void 0:p.d)||0),p=1<p?"r":p<-1?"l":"";p&&(i=p=="r"?"l":"r",l=s({},r),f=r[p],r.from=f.from,r.to=f.to,r[p]=f[p],l[p]=f[i],(r[i]=l).d=Tl(l)),r.d=Tl(r)}function Tl(l){var i=l.r,l=l.l;return(i?l?Math.max(i.d,l.d):i.d:l?l.d:0)+1}function fo(r,i){return c(i).forEach(function(l){r[l]?ds(r[l],i[l]):r[l]=function f(p){var v,b,_={};for(v in p)k(p,v)&&(b=p[v],_[v]=!b||typeof b!="object"||ke.has(b.constructor)?b:f(b));return _}(i[l])}),r}function Ki(r,i){return r.all||i.all||Object.keys(r).some(function(l){return i[l]&&Al(i[l],r[l])})}D(Dt.prototype,((Je={add:function(r){return ds(this,r),this},addKey:function(r){return fs(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(l){return fs(i,l,l)}),this},hasKey:function(r){var i=co(this).next(r).value;return i&&tt(i.from,r)<=0&&0<=tt(i.to,r)}})[qe]=function(){return co(this)},Je));var gr={},Fi={},Ni=!1;function po(r){fo(Fi,r),Ni||(Ni=!0,setTimeout(function(){Ni=!1,Vi(Fi,!(Fi={}))},0))}function Vi(r,i){i===void 0&&(i=!1);var l=new Set;if(r.all)for(var f=0,p=Object.values(gr);f<p.length;f++)Ol(_=p[f],r,l,i);else for(var v in r){var b,_,v=/^idb\:\/\/(.*)\/(.*)\//.exec(v);v&&(b=v[1],v=v[2],_=gr["idb://".concat(b,"/").concat(v)])&&Ol(_,r,l,i)}l.forEach(function(S){return S()})}function Ol(r,i,l,f){for(var p=[],v=0,b=Object.entries(r.queries.query);v<b.length;v++){for(var _=b[v],S=_[0],B=[],O=0,C=_[1];O<C.length;O++){var A=C[O];Ki(i,A.obsSet)?A.subscribers.forEach(function(j){return l.add(j)}):f&&B.push(A)}f&&p.push([S,B])}if(f)for(var R=0,I=p;R<I.length;R++){var M=I[R],S=M[0],B=M[1];r.queries.query[S]=B}}function Uf(r){var i=r._state,l=r._deps.indexedDB;if(i.isBeingOpened||r.idbdb)return i.dbReadyPromise.then(function(){return i.dbOpenError?Ct(i.dbOpenError):r});i.isBeingOpened=!0,i.dbOpenError=null,i.openComplete=!1;var f=i.openCanceller,p=Math.round(10*r.verno),v=!1;function b(){if(i.openCanceller!==f)throw new Ie.DatabaseClosed("db.open() was cancelled")}function _(){return new Ce(function(A,R){if(b(),!l)throw new Ie.MissingAPI;var I=r.name,M=i.autoSchema||!p?l.open(I):l.open(I,p);if(!M)throw new Ie.MissingAPI;M.onerror=dn(R),M.onblocked=mt(r._fireOnBlocked),M.onupgradeneeded=mt(function(j){var z;O=M.transaction,i.autoSchema&&!r._options.allowEmptyDB?(M.onerror=as,O.abort(),M.result.close(),(z=l.deleteDatabase(I)).onsuccess=z.onerror=mt(function(){R(new Ie.NoSuchDatabase("Database ".concat(I," doesnt exist")))})):(O.onerror=dn(R),z=j.oldVersion>Math.pow(2,62)?0:j.oldVersion,C=z<1,r.idbdb=M.result,v&&Vf(r,O),Nf(r,z/10,O,R))},R),M.onsuccess=mt(function(){O=null;var j,z,U,ee,pe,ve,_e=r.idbdb=M.result,me=E(_e.objectStoreNames);if(0<me.length)try{var Ae=_e.transaction((pe=me).length===1?pe[0]:pe,"readonly");if(i.autoSchema)ve=_e,ee=Ae,(U=r).verno=ve.version/10,ee=U._dbSchema=lo(0,ve,ee),U._storeNames=E(ve.objectStoreNames,0),io(U,[U._allTables],c(ee),ee);else if(uo(r,r._dbSchema,Ae),z=Ae,((z=Mi(lo(0,(j=r).idbdb,z),j._dbSchema)).add.length||z.change.some(function(be){return be.add.length||be.change.length}))&&!v)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),_e.close(),p=_e.version+1,v=!0,A(_());oo(r,Ae)}catch{}cs.add(r),_e.onversionchange=mt(function(be){i.vcFired=!0,r.on("versionchange").fire(be)}),_e.onclose=mt(function(){r.close({disableAutoOpen:!1})}),C&&(me=r._deps,pe=I,Di(ve=me.indexedDB)||pe===Qs||ji(ve,me.IDBKeyRange).put({name:pe}).catch(g)),A()},R)}).catch(function(A){switch(A==null?void 0:A.name){case"UnknownError":if(0<i.PR1398_maxLoop)return i.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),_();break;case"VersionError":if(0<p)return p=0,_()}return Ce.reject(A)})}var S,B=i.dbReadyResolve,O=null,C=!1;return Ce.race([f,(typeof navigator>"u"?Ce.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(A){function R(){return indexedDB.databases().finally(A)}S=setInterval(R,100),R()}).finally(function(){return clearInterval(S)}):Promise.resolve()).then(_)]).then(function(){return b(),i.onReadyBeingFired=[],Ce.resolve(Ri(function(){return r.on.ready.fire(r.vip)})).then(function A(){var R;if(0<i.onReadyBeingFired.length)return R=i.onReadyBeingFired.reduce(W,g),i.onReadyBeingFired=[],Ce.resolve(Ri(function(){return R(r.vip)})).then(A)})}).finally(function(){i.openCanceller===f&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(A){i.dbOpenError=A;try{O&&O.abort()}catch{}return f===i.openCanceller&&r._close(),Ct(A)}).finally(function(){i.openComplete=!0,B()}).then(function(){var A;return C&&(A={},r.tables.forEach(function(R){R.schema.indexes.forEach(function(I){I.name&&(A["idb://".concat(r.name,"/").concat(R.name,"/").concat(I.name)]=new Dt(-1/0,[[[]]]))}),A["idb://".concat(r.name,"/").concat(R.name,"/")]=A["idb://".concat(r.name,"/").concat(R.name,"/:dels")]=new Dt(-1/0,[[[]]])}),Jn(so).fire(A),Vi(A,!0)),r})}function Bi(r){function i(v){return r.next(v)}var l=p(i),f=p(function(v){return r.throw(v)});function p(v){return function(_){var _=v(_),S=_.value;return _.done?S:S&&typeof S.then=="function"?S.then(l,f):d(S)?Promise.all(S).then(l,f):l(S)}}return p(i)()}function ho(r,i,l){for(var f=d(r)?r.slice():[r],p=0;p<l;++p)f.push(i);return f}var qf={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return s(s({},r),{table:function(f){var l=r.table(f),f=l.schema,p=Object.create(null),v=[];function b(A,R,I){var U=us(A),M=p[U]=p[U]||[],j=A==null?0:typeof A=="string"?1:A.length,z=0<R,U=s(s({},I),{name:z?"".concat(U,"(virtual-from:").concat(I.name,")"):I.name,lowLevelIndex:I,isVirtual:z,keyTail:R,keyLength:j,extractKey:Ti(A),unique:!z&&I.unique});return M.push(U),U.isPrimaryKey||v.push(U),1<j&&b(j===2?A[0]:A.slice(0,j-1),R+1,I),M.sort(function(ee,pe){return ee.keyTail-pe.keyTail}),U}var _=b(f.primaryKey.keyPath,0,f.primaryKey);p[":id"]=[_];for(var S=0,B=f.indexes;S<B.length;S++){var O=B[S];b(O.keyPath,0,O)}function C(A){var R,I=A.query.index;return I.isVirtual?s(s({},A),{query:{index:I.lowLevelIndex,range:(R=A.query.range,I=I.keyTail,{type:R.type===1?2:R.type,lower:ho(R.lower,R.lowerOpen?r.MAX_KEY:r.MIN_KEY,I),lowerOpen:!0,upper:ho(R.upper,R.upperOpen?r.MIN_KEY:r.MAX_KEY,I),upperOpen:!0})}}):A}return s(s({},l),{schema:s(s({},f),{primaryKey:_,indexes:v,getIndexByKeyPath:function(A){return(A=p[us(A)])&&A[0]}}),count:function(A){return l.count(C(A))},query:function(A){return l.query(C(A))},openCursor:function(A){var R=A.query.index,I=R.keyTail,M=R.keyLength;return R.isVirtual?l.openCursor(C(A)).then(function(z){return z&&j(z)}):l.openCursor(A);function j(z){return Object.create(z,{continue:{value:function(U){U!=null?z.continue(ho(U,A.reverse?r.MAX_KEY:r.MIN_KEY,I)):A.unique?z.continue(z.key.slice(0,M).concat(A.reverse?r.MIN_KEY:r.MAX_KEY,I)):z.continue()}},continuePrimaryKey:{value:function(U,ee){z.continuePrimaryKey(ho(U,r.MAX_KEY,I),ee)}},primaryKey:{get:function(){return z.primaryKey}},key:{get:function(){var U=z.key;return M===1?U[0]:U.slice(0,M)}},value:{get:function(){return z.value}}})}}})}})}};function Ui(r,i,l,f){return l=l||{},f=f||"",c(r).forEach(function(p){var v,b,_;k(i,p)?(v=r[p],b=i[p],typeof v=="object"&&typeof b=="object"&&v&&b?(_=nt(v))!==nt(b)?l[f+p]=i[p]:_==="Object"?Ui(v,b,l,f+p+"."):v!==b&&(l[f+p]=i[p]):v!==b&&(l[f+p]=i[p])):l[f+p]=void 0}),c(i).forEach(function(p){k(r,p)||(l[f+p]=i[p])}),l}function qi(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var Hf={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return s(s({},r),{table:function(i){var l=r.table(i),f=l.schema.primaryKey;return s(s({},l),{mutate:function(p){var v=Me.trans,b=v.table(i).hook,_=b.deleting,S=b.creating,B=b.updating;switch(p.type){case"add":if(S.fire===g)break;return v._promise("readwrite",function(){return O(p)},!0);case"put":if(S.fire===g&&B.fire===g)break;return v._promise("readwrite",function(){return O(p)},!0);case"delete":if(_.fire===g)break;return v._promise("readwrite",function(){return O(p)},!0);case"deleteRange":if(_.fire===g)break;return v._promise("readwrite",function(){return function C(A,R,I){return l.query({trans:A,values:!1,query:{index:f,range:R},limit:I}).then(function(M){var j=M.result;return O({type:"delete",keys:j,trans:A}).then(function(z){return 0<z.numFailures?Promise.reject(z.failures[0]):j.length<I?{failures:[],numFailures:0,lastResult:void 0}:C(A,s(s({},R),{lower:j[j.length-1],lowerOpen:!0}),I)})})}(p.trans,p.range,1e4)},!0)}return l.mutate(p);function O(C){var A,R,I,M=Me.trans,j=C.keys||qi(f,C);if(j)return(C=C.type==="add"||C.type==="put"?s(s({},C),{keys:j}):s({},C)).type!=="delete"&&(C.values=o([],C.values)),C.keys&&(C.keys=o([],C.keys)),A=l,I=j,((R=C).type==="add"?Promise.resolve([]):A.getMany({trans:R.trans,keys:I,cache:"immutable"})).then(function(z){var U=j.map(function(ee,pe){var ve,_e,me,Ae=z[pe],be={onerror:null,onsuccess:null};return C.type==="delete"?_.fire.call(be,ee,Ae,M):C.type==="add"||Ae===void 0?(ve=S.fire.call(be,ee,C.values[pe],M),ee==null&&ve!=null&&(C.keys[pe]=ee=ve,f.outbound||Z(C.values[pe],f.keyPath,ee))):(ve=Ui(Ae,C.values[pe]),(_e=B.fire.call(be,ve,ee,Ae,M))&&(me=C.values[pe],Object.keys(_e).forEach(function(Pe){k(me,Pe)?me[Pe]=_e[Pe]:Z(me,Pe,_e[Pe])}))),be});return l.mutate(C).then(function(ee){for(var pe=ee.failures,ve=ee.results,_e=ee.numFailures,ee=ee.lastResult,me=0;me<j.length;++me){var Ae=(ve||j)[me],be=U[me];Ae==null?be.onerror&&be.onerror(pe[me]):be.onsuccess&&be.onsuccess(C.type==="put"&&z[me]?C.values[me]:Ae)}return{failures:pe,results:ve,numFailures:_e,lastResult:ee}}).catch(function(ee){return U.forEach(function(pe){return pe.onerror&&pe.onerror(ee)}),Promise.reject(ee)})});throw new Error("Keys missing")}}})}})}};function Ml(r,i,l){try{if(!i||i.keys.length<r.length)return null;for(var f=[],p=0,v=0;p<i.keys.length&&v<r.length;++p)tt(i.keys[p],r[v])===0&&(f.push(l?xe(i.values[p]):i.values[p]),++v);return f.length===r.length?f:null}catch{return null}}var Wf={stack:"dbcore",level:-1,create:function(r){return{table:function(i){var l=r.table(i);return s(s({},l),{getMany:function(f){var p;return f.cache?(p=Ml(f.keys,f.trans._cache,f.cache==="clone"))?Ce.resolve(p):l.getMany(f).then(function(v){return f.trans._cache={keys:f.keys,values:f.cache==="clone"?xe(v):v},v}):l.getMany(f)},mutate:function(f){return f.type!=="add"&&(f.trans._cache=null),l.mutate(f)}})}}}};function Il(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function jl(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var zf={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,l=new Dt(r.MIN_KEY,r.MAX_KEY);return s(s({},r),{transaction:function(f,p,v){if(Me.subscr&&p!=="readonly")throw new Ie.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Me.querier));return r.transaction(f,p,v)},table:function(f){function p(j){var M,j=j.query;return[M=j.index,new Dt((M=(j=j.range).lower)!=null?M:r.MIN_KEY,(M=j.upper)!=null?M:r.MAX_KEY)]}var v=r.table(f),b=v.schema,_=b.primaryKey,S=b.indexes,B=_.extractKey,O=_.outbound,C=_.autoIncrement&&S.filter(function(I){return I.compound&&I.keyPath.includes(_.keyPath)}),A=s(s({},v),{mutate:function(I){function M(he){return he="idb://".concat(i,"/").concat(f,"/").concat(he),pe[he]||(pe[he]=new Dt)}var j,z,U,ee=I.trans,pe=I.mutatedParts||(I.mutatedParts={}),ve=M(""),_e=M(":dels"),me=I.type,be=I.type==="deleteRange"?[I.range]:I.type==="delete"?[I.keys]:I.values.length<50?[qi(_,I).filter(function(he){return he}),I.values]:[],Ae=be[0],be=be[1],Pe=I.trans._cache;return d(Ae)?(ve.addKeys(Ae),(me=me==="delete"||Ae.length===be.length?Ml(Ae,Pe):null)||_e.addKeys(Ae),(me||be)&&(j=M,z=me,U=be,b.indexes.forEach(function(he){var Be=j(he.name||"");function Ue(Ze){return Ze!=null?he.extractKey(Ze):null}function Ye(Ze){he.multiEntry&&d(Ze)?Ze.forEach(function(tn){return Be.addKey(tn)}):Be.addKey(Ze)}(z||U).forEach(function(Ze,Rt){var ze=z&&Ue(z[Rt]),Rt=U&&Ue(U[Rt]);tt(ze,Rt)!==0&&(ze!=null&&Ye(ze),Rt!=null)&&Ye(Rt)})}))):Ae?(be={from:(Pe=Ae.lower)!=null?Pe:r.MIN_KEY,to:(me=Ae.upper)!=null?me:r.MAX_KEY},_e.add(be),ve.add(be)):(ve.add(l),_e.add(l),b.indexes.forEach(function(he){return M(he.name).add(l)})),v.mutate(I).then(function(he){return!Ae||I.type!=="add"&&I.type!=="put"||(ve.addKeys(he.results),C&&C.forEach(function(Be){for(var Ue=I.values.map(function(ze){return Be.extractKey(ze)}),Ye=Be.keyPath.findIndex(function(ze){return ze===_.keyPath}),Ze=0,tn=he.results.length;Ze<tn;++Ze)Ue[Ze][Ye]=he.results[Ze];M(Be.name).addKeys(Ue)})),ee.mutatedParts=fo(ee.mutatedParts||{},pe),he})}}),R={get:function(I){return[_,new Dt(I.key)]},getMany:function(I){return[_,new Dt().addKeys(I.keys)]},count:p,query:p,openCursor:p};return c(R).forEach(function(I){A[I]=function(M){var j=Me.subscr,z=!!j,U=Il(Me,v)&&jl(I,M)?M.obsSet={}:j;if(z){var ee,j=function(be){return be="idb://".concat(i,"/").concat(f,"/").concat(be),U[be]||(U[be]=new Dt)},pe=j(""),ve=j(":dels"),z=R[I](M),_e=z[0],z=z[1];if((I==="query"&&_e.isPrimaryKey&&!M.values?ve:j(_e.name||"")).add(z),!_e.isPrimaryKey){if(I!=="count")return ee=I==="query"&&O&&M.values&&v.query(s(s({},M),{values:!1})),v[I].apply(this,arguments).then(function(be){if(I==="query"){if(O&&M.values)return ee.then(function(Ue){return Ue=Ue.result,pe.addKeys(Ue),be});var Pe=M.values?be.result.map(B):be.result;(M.values?pe:ve).addKeys(Pe)}else{var he,Be;if(I==="openCursor")return Be=M.values,(he=be)&&Object.create(he,{key:{get:function(){return ve.addKey(he.primaryKey),he.key}},primaryKey:{get:function(){var Ue=he.primaryKey;return ve.addKey(Ue),Ue}},value:{get:function(){return Be&&pe.addKey(he.primaryKey),he.value}}})}return be});ve.add(l)}}return v[I].apply(this,arguments)}}),A}})}};function Dl(r,i,l){var f;return l.numFailures===0?i:i.type==="deleteRange"||(f=i.keys?i.keys.length:"values"in i&&i.values?i.values.length:1,l.numFailures===f)?null:(f=s({},i),d(f.keys)&&(f.keys=f.keys.filter(function(p,v){return!(v in l.failures)})),"values"in f&&d(f.values)&&(f.values=f.values.filter(function(p,v){return!(v in l.failures)})),f)}function Hi(r,i){return l=r,((f=i).lower===void 0||(f.lowerOpen?0<tt(l,f.lower):0<=tt(l,f.lower)))&&(l=r,(f=i).upper===void 0||(f.upperOpen?tt(l,f.upper)<0:tt(l,f.upper)<=0));var l,f}function Rl(r,i,l,f,p,v){var b,_,S,B,O,C,A;return!l||l.length===0||(b=i.query.index,_=b.multiEntry,S=i.query.range,B=f.schema.primaryKey.extractKey,O=b.extractKey,C=(b.lowLevelIndex||b).extractKey,(f=l.reduce(function(R,I){var M=R,j=[];if(I.type==="add"||I.type==="put")for(var z=new Dt,U=I.values.length-1;0<=U;--U){var ee,pe=I.values[U],ve=B(pe);!z.hasKey(ve)&&(ee=O(pe),_&&d(ee)?ee.some(function(Pe){return Hi(Pe,S)}):Hi(ee,S))&&(z.addKey(ve),j.push(pe))}switch(I.type){case"add":var _e=new Dt().addKeys(i.values?R.map(function(he){return B(he)}):R),M=R.concat(i.values?j.filter(function(he){return he=B(he),!_e.hasKey(he)&&(_e.addKey(he),!0)}):j.map(function(he){return B(he)}).filter(function(he){return!_e.hasKey(he)&&(_e.addKey(he),!0)}));break;case"put":var me=new Dt().addKeys(I.values.map(function(he){return B(he)}));M=R.filter(function(he){return!me.hasKey(i.values?B(he):he)}).concat(i.values?j:j.map(function(he){return B(he)}));break;case"delete":var Ae=new Dt().addKeys(I.keys);M=R.filter(function(he){return!Ae.hasKey(i.values?B(he):he)});break;case"deleteRange":var be=I.range;M=R.filter(function(he){return!Hi(B(he),be)})}return M},r))===r)?r:(A=function(R,I){return tt(C(R),C(I))||tt(B(R),B(I))},f.sort(i.direction==="prev"||i.direction==="prevunique"?function(R,I){return A(I,R)}:A),i.limit&&i.limit<1/0&&(f.length>i.limit?f.length=i.limit:r.length===i.limit&&f.length<i.limit&&(p.dirty=!0)),v?Object.freeze(f):f)}function Ll(r,i){return tt(r.lower,i.lower)===0&&tt(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function Gf(r,i){return((l,f,p,v)=>{if(l===void 0)return f!==void 0?-1:0;if(f===void 0)return 1;if((l=tt(l,f))===0){if(p&&v)return 0;if(p)return 1;if(v)return-1}return l})(r.lower,i.lower,r.lowerOpen,i.lowerOpen)<=0&&0<=((l,f,p,v)=>{if(l===void 0)return f!==void 0?1:0;if(f===void 0)return-1;if((l=tt(l,f))===0){if(p&&v)return 0;if(p)return-1;if(v)return 1}return l})(r.upper,i.upper,r.upperOpen,i.upperOpen)}function Yf(r,i,l,f){r.subscribers.add(l),f.addEventListener("abort",function(){var p,v;r.subscribers.delete(l),r.subscribers.size===0&&(p=r,v=i,setTimeout(function(){p.subscribers.size===0&&ge(v,p)},3e3))})}var Jf={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return s(s({},r),{transaction:function(l,f,p){var v,b,_=r.transaction(l,f,p);return f==="readwrite"&&(p=(v=new AbortController).signal,_.addEventListener("abort",(b=function(S){return function(){if(v.abort(),f==="readwrite"){for(var B=new Set,O=0,C=l;O<C.length;O++){var A=C[O],R=gr["idb://".concat(i,"/").concat(A)];if(R){var I=r.table(A),M=R.optimisticOps.filter(function(he){return he.trans===_});if(_._explicit&&S&&_.mutatedParts)for(var j=0,z=Object.values(R.queries.query);j<z.length;j++)for(var U=0,ee=(_e=z[j]).slice();U<ee.length;U++)Ki((me=ee[U]).obsSet,_.mutatedParts)&&(ge(_e,me),me.subscribers.forEach(function(he){return B.add(he)}));else if(0<M.length){R.optimisticOps=R.optimisticOps.filter(function(he){return he.trans!==_});for(var pe=0,ve=Object.values(R.queries.query);pe<ve.length;pe++)for(var _e,me,Ae,be=0,Pe=(_e=ve[pe]).slice();be<Pe.length;be++)(me=Pe[be]).res!=null&&_.mutatedParts&&(S&&!me.dirty?(Ae=Object.isFrozen(me.res),Ae=Rl(me.res,me.req,M,I,me,Ae),me.dirty?(ge(_e,me),me.subscribers.forEach(function(he){return B.add(he)})):Ae!==me.res&&(me.res=Ae,me.promise=Ce.resolve({result:Ae}))):(me.dirty&&ge(_e,me),me.subscribers.forEach(function(he){return B.add(he)})))}}}B.forEach(function(he){return he()})}}})(!1),{signal:p}),_.addEventListener("error",b(!1),{signal:p}),_.addEventListener("complete",b(!0),{signal:p})),_},table:function(l){var f=r.table(l),p=f.schema.primaryKey;return s(s({},f),{mutate:function(v){var b,_=Me.trans;return!p.outbound&&_.db._options.cache!=="disabled"&&!_.explicit&&_.idbtrans.mode==="readwrite"&&(b=gr["idb://".concat(i,"/").concat(l)])?(_=f.mutate(v),v.type!=="add"&&v.type!=="put"||!(50<=v.values.length||qi(p,v).some(function(S){return S==null}))?(b.optimisticOps.push(v),v.mutatedParts&&po(v.mutatedParts),_.then(function(S){0<S.numFailures&&(ge(b.optimisticOps,v),(S=Dl(0,v,S))&&b.optimisticOps.push(S),v.mutatedParts)&&po(v.mutatedParts)}),_.catch(function(){ge(b.optimisticOps,v),v.mutatedParts&&po(v.mutatedParts)})):_.then(function(S){var B=Dl(0,s(s({},v),{values:v.values.map(function(O,C){var A;return S.failures[C]?O:(Z(A=(A=p.keyPath)!=null&&A.includes(".")?xe(O):s({},O),p.keyPath,S.results[C]),A)})}),S);b.optimisticOps.push(B),queueMicrotask(function(){return v.mutatedParts&&po(v.mutatedParts)})}),_):f.mutate(v)},query:function(v){var b,_,S,B,O,C,A;return Il(Me,f)&&jl("query",v)?(b=((S=Me.trans)==null?void 0:S.db._options.cache)==="immutable",_=(S=Me).requery,S=S.signal,C=((R,I,M,j)=>{var z=gr["idb://".concat(R,"/").concat(I)];if(!z)return[];if(!(R=z.queries[M]))return[null,!1,z,null];var U=R[(j.query?j.query.index.name:null)||""];if(!U)return[null,!1,z,null];switch(M){case"query":var ee=(pe=j.direction)!=null?pe:"next",pe=U.find(function(ve){var _e;return ve.req.limit===j.limit&&ve.req.values===j.values&&((_e=ve.req.direction)!=null?_e:"next")===ee&&Ll(ve.req.query.range,j.query.range)});return pe?[pe,!0,z,U]:[U.find(function(ve){var _e;return("limit"in ve.req?ve.req.limit:1/0)>=j.limit&&((_e=ve.req.direction)!=null?_e:"next")===ee&&(!j.values||ve.req.values)&&Gf(ve.req.query.range,j.query.range)}),!1,z,U];case"count":return pe=U.find(function(ve){return Ll(ve.req.query.range,j.query.range)}),[pe,!!pe,z,U]}})(i,l,"query",v),A=C[0],B=C[2],O=C[3],A&&C[1]?A.obsSet=v.obsSet:(C=f.query(v).then(function(R){var I=R.result;if(A&&(A.res=I),b){for(var M=0,j=I.length;M<j;++M)Object.freeze(I[M]);Object.freeze(I)}return R}).catch(function(R){return O&&A&&ge(O,A),Promise.reject(R)}),A={obsSet:v.obsSet,promise:C,subscribers:new Set,type:"query",req:v,dirty:!1},O?O.push(A):(O=[A],(B=B||(gr["idb://".concat(i,"/").concat(l)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[v.query.index.name||""]=O)),Yf(A,O,_,S),A.promise.then(function(R){return R=Rl(R.result,v,B==null?void 0:B.optimisticOps,f,A,b),{result:b?R:xe(R)}})):f.query(v)}})}})}};function vo(r,i){return new Proxy(r,{get:function(l,f,p){return f==="db"?i:Reflect.get(l,f,p)}})}St.prototype.version=function(r){if(isNaN(r)||r<.1)throw new Ie.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new Ie.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var i=this._versions,l=i.filter(function(f){return f._cfg.version===r})[0];return l||(l=new this.Version(r),i.push(l),i.sort(Ff),l.stores({}),this._state.autoSchema=!1),l},St.prototype._whenReady=function(r){var i=this;return this.idbdb&&(this._state.openComplete||Me.letThrough||this._vip)?r():new Ce(function(l,f){if(i._state.openComplete)return f(new Ie.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void f(new Ie.DatabaseClosed);i.open().catch(g)}i._state.dbReadyPromise.then(l,f)}).then(r)},St.prototype.use=function(p){var i=p.stack,l=p.create,f=p.level,p=p.name,v=(p&&this.unuse({stack:i,name:p}),this._middlewares[i]||(this._middlewares[i]=[]));return v.push({stack:i,create:l,level:f??10,name:p}),v.sort(function(b,_){return b.level-_.level}),this},St.prototype.unuse=function(r){var i=r.stack,l=r.name,f=r.create;return i&&this._middlewares[i]&&(this._middlewares[i]=this._middlewares[i].filter(function(p){return f?p.create!==f:!!l&&p.name!==l})),this},St.prototype.open=function(){var r=this;return vr($t,function(){return Uf(r)})},St.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var r=this._state;if(cs.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new Ce(function(i){r.dbReadyResolve=i}),r.openCanceller=new Ce(function(i,l){r.cancelOpen=l}))},St.prototype.close=function(i){var i=(i===void 0?{disableAutoOpen:!0}:i).disableAutoOpen,l=this._state;i?(l.isBeingOpened&&l.cancelOpen(new Ie.DatabaseClosed),this._close(),l.autoOpen=!1,l.dbOpenError=new Ie.DatabaseClosed):(this._close(),l.autoOpen=this._options.autoOpen||l.isBeingOpened,l.openComplete=!1,l.dbOpenError=null)},St.prototype.delete=function(r){var i=this,l=(r===void 0&&(r={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),f=this._state;return new Ce(function(p,v){function b(){i.close(r);var _=i._deps.indexedDB.deleteDatabase(i.name);_.onsuccess=mt(function(){var S,B,O;S=i._deps,B=i.name,Di(O=S.indexedDB)||B===Qs||ji(O,S.IDBKeyRange).delete(B).catch(g),p()}),_.onerror=dn(v),_.onblocked=i._fireOnBlocked}if(l)throw new Ie.InvalidArgument("Invalid closeOptions argument to db.delete()");f.isBeingOpened?f.dbReadyPromise.then(b):b()})},St.prototype.backendDB=function(){return this.idbdb},St.prototype.isOpen=function(){return this.idbdb!==null},St.prototype.hasBeenClosed=function(){var r=this._state.dbOpenError;return r&&r.name==="DatabaseClosed"},St.prototype.hasFailed=function(){return this._state.dbOpenError!==null},St.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(St.prototype,"tables",{get:function(){var r=this;return c(this._allTables).map(function(i){return r._allTables[i]})},enumerable:!1,configurable:!0}),St.prototype.transaction=function(){var r=(function(i,l,f){var p=arguments.length;if(p<2)throw new Ie.InvalidArgument("Too few arguments");for(var v=new Array(p-1);--p;)v[p-1]=arguments[p];return f=v.pop(),[i,le(v),f]}).apply(this,arguments);return this._transaction.apply(this,r)},St.prototype._transaction=function(r,i,l){var f,p,v=this,b=Me.trans,_=(b&&b.db===this&&r.indexOf("!")===-1||(b=null),r.indexOf("?")!==-1);r=r.replace("!","").replace("?","");try{if(p=i.map(function(B){if(B=B instanceof v.Table?B.name:B,typeof B!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return B}),r=="r"||r===xi)f=xi;else{if(r!="rw"&&r!=Ci)throw new Ie.InvalidArgument("Invalid transaction mode: "+r);f=Ci}if(b){if(b.mode===xi&&f===Ci){if(!_)throw new Ie.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");b=null}b&&p.forEach(function(B){if(b&&b.storeNames.indexOf(B)===-1){if(!_)throw new Ie.SubTransaction("Table "+B+" not included in parent transaction.");b=null}}),_&&b&&!b.active&&(b=null)}}catch(B){return b?b._promise(null,function(O,C){C(B)}):Ct(B)}var S=(function B(O,C,A,R,I){return Ce.resolve().then(function(){var U=Me.transless||Me,M=O._createTransaction(C,A,O._dbSchema,R),U=(M.explicit=!0,{trans:M,transless:U});if(R)M.idbtrans=R.idbtrans;else try{M.create(),M.idbtrans._explicit=!0,O._state.PR1398_maxLoop=3}catch(ee){return ee.name===Yt.InvalidState&&O.isOpen()&&0<--O._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),O.close({disableAutoOpen:!1}),O.open().then(function(){return B(O,C,A,null,I)})):Ct(ee)}var j,z=je(I),U=(z&&Kr(),Ce.follow(function(){var ee;(j=I.call(M,M))&&(z?(ee=zn.bind(null,null),j.then(ee,ee)):typeof j.next=="function"&&typeof j.throw=="function"&&(j=Bi(j)))},U));return(j&&typeof j.then=="function"?Ce.resolve(j).then(function(ee){return M.active?ee:Ct(new Ie.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):U.then(function(){return j})).then(function(ee){return R&&M._resolve(),M._completion.then(function(){return ee})}).catch(function(ee){return M._reject(ee),Ct(ee)})})}).bind(null,this,f,p,b,l);return b?b._promise(f,S,"lock"):Me.trans?vr(Me.transless,function(){return v._whenReady(S)}):this._whenReady(S)},St.prototype.table=function(r){if(k(this._allTables,r))return this._allTables[r];throw new Ie.InvalidTable("Table ".concat(r," does not exist"))};var Mn=St;function St(r,i){var l,f,p,v,b,_=this,S=(this._middlewares={},this.verno=0,St.dependencies),S=(this._options=i=s({addons:St.addons,autoOpen:!0,indexedDB:S.indexedDB,IDBKeyRange:S.IDBKeyRange,cache:"cloned",maxConnections:1e3},i),this._deps={indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},i.addons),B=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:g,dbReadyPromise:null,cancelOpen:g,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:i.autoOpen}),O=(B.dbReadyPromise=new Ce(function(C){B.dbReadyResolve=C}),B.openCanceller=new Ce(function(C,A){B.cancelOpen=A}),this._state=B,this.name=r,this.on=os(this,"populate","blocked","versionchange","close",{ready:[W,g]}),this.once=function(C,A){var R=function(){for(var I=[],M=0;M<arguments.length;M++)I[M]=arguments[M];_.on(C).unsubscribe(R),A.apply(_,I)};return _.on(C,R)},this.on.ready.subscribe=N(this.on.ready.subscribe,function(C){return function(A,R){St.vip(function(){var I,M=_._state;M.openComplete?(M.dbOpenError||Ce.resolve().then(A),R&&C(A)):M.onReadyBeingFired?(M.onReadyBeingFired.push(A),R&&C(A)):(C(A),I=_,R||C(function j(){I.on.ready.unsubscribe(A),I.on.ready.unsubscribe(j)}))})}}),this.Collection=(l=this,is(Mf.prototype,function(j,M){this.db=l;var R=dl,I=null;if(M)try{R=M()}catch(U){I=U}var M=j._ctx,j=M.table,z=j.hook.reading.fire;this._ctx={table:j,index:M.index,isPrimKey:!M.index||j.schema.primKey.keyPath&&M.index===j.schema.primKey.name,range:R,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:I,or:M.or,valueMapper:z!==P?z:null}})),this.Table=(f=this,is(gl.prototype,function(C,A,R){this.db=f,this._tx=R,this.name=C,this.schema=A,this.hook=f._allTables[C]?f._allTables[C].hook:os(null,{creating:[ue,g],reading:[ie,P],updating:[oe,g],deleting:[ye,g]})})),this.Transaction=(p=this,is(Df.prototype,function(C,A,R,I,M){var j=this;C!=="readonly"&&A.forEach(function(z){z=(z=R[z])==null?void 0:z.yProps,z&&(A=A.concat(z.map(function(U){return U.updatesTable})))}),this.db=p,this.mode=C,this.storeNames=A,this.schema=R,this.chromeTransactionDurability=I,this.idbtrans=null,this.on=os(this,"complete","error","abort"),this.parent=M||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 Ce(function(z,U){j._resolve=z,j._reject=U}),this._completion.then(function(){j.active=!1,j.on.complete.fire()},function(z){var U=j.active;return j.active=!1,j.on.error.fire(z),j.parent?j.parent._reject(z):U&&j.idbtrans&&j.idbtrans.abort(),Ct(z)})})),this.Version=(v=this,is(Bf.prototype,function(C){this.db=v,this._cfg={version:C,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(b=this,is(xl.prototype,function(C,A,R){if(this.db=b,this._ctx={table:C,index:A===":id"?null:A,or:R},this._cmp=this._ascending=tt,this._descending=function(I,M){return tt(M,I)},this._max=function(I,M){return 0<tt(I,M)?I:M},this._min=function(I,M){return tt(I,M)<0?I:M},this._IDBKeyRange=b._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ie.MissingAPI})),this.on("versionchange",function(C){0<C.newVersion?console.warn("Another connection wants to upgrade database '".concat(_.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(_.name,"'. Closing db now to resume the delete request.")),_.close({disableAutoOpen:!1})}),this.on("blocked",function(C){!C.newVersion||C.newVersion<C.oldVersion?console.warn("Dexie.delete('".concat(_.name,"') was blocked")):console.warn("Upgrade '".concat(_.name,"' blocked by other connection holding version ").concat(C.oldVersion/10))}),this._maxKey=ls(i.IDBKeyRange),this._createTransaction=function(C,A,R,I){return new _.Transaction(C,A,R,_._options.chromeTransactionDurability,I)},this._fireOnBlocked=function(C){_.on("blocked").fire(C),cs.toArray().filter(function(A){return A.name===_.name&&A!==_&&!A._state.vcFired}).map(function(A){return A.on("versionchange").fire(C)})},this.use(Wf),this.use(Jf),this.use(zf),this.use(qf),this.use(Hf),new Proxy(this,{get:function(C,A,R){var I;return A==="_vip"||(A==="table"?function(M){return vo(_.table(M),O)}:(I=Reflect.get(C,A,R))instanceof gl?vo(I,O):A==="tables"?I.map(function(M){return vo(M,O)}):A==="_createTransaction"?function(){return vo(I.apply(this,arguments),O)}:I)}}));this.vip=O,S.forEach(function(C){return C(_)})}var mo,Br=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Xf=(Wi.prototype.subscribe=function(r,i,l){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:l})},Wi.prototype[Br]=function(){return this},Wi);function Wi(r){this._subscribe=r}try{mo={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{mo={indexedDB:null,IDBKeyRange:null}}function Kl(r){var i,l=!1,f=new Xf(function(p){var v=je(r),b,_=!1,S={},B={},O={get closed(){return _},unsubscribe:function(){_||(_=!0,b&&b.abort(),C&&Jn.storagemutated.unsubscribe(I))}},C=(p.start&&p.start(O),!1),A=function(){return ki(M)};function R(){return Ki(B,S)}var I=function(j){fo(S,j),R()&&A()},M=function(){var j,z,U;!_&&mo.indexedDB&&(S={},j={},b&&b.abort(),b=new AbortController,U=(ee=>{var pe=Rr();try{v&&Kr();var ve=Wn(r,ee);return ve=v?ve.finally(zn):ve}finally{pe&&Lr()}})(z={subscr:j,signal:b.signal,requery:A,querier:r,trans:null}),C||(Jn.storagemutated.subscribe(I),C=!0),Promise.resolve(U).then(function(ee){l=!0,i=ee,_||z.signal.aborted||(R()||(B=j,R())?A():(S={},ki(function(){return!_&&p.next&&p.next(ee)})))},function(ee){l=!1,["DatabaseClosedError","AbortError"].includes(ee==null?void 0:ee.name)||_||ki(function(){_||p.error&&p.error(ee)})}))};return setTimeout(A,0),O});return f.hasValue=function(){return l},f.getValue=function(){return i},f}var br=Mn;function zi(r){var i=Xn;try{Xn=!0,Jn.storagemutated.fire(r),Vi(r,!0)}finally{Xn=i}}D(br,s(s({},ne),{delete:function(r){return new br(r,{addons:[]}).delete()},exists:function(r){return new br(r,{addons:[]}).open().then(function(i){return i.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return i=br.dependencies,l=i.indexedDB,i=i.IDBKeyRange,(Di(l)?Promise.resolve(l.databases()).then(function(f){return f.map(function(p){return p.name}).filter(function(p){return p!==Qs})}):ji(l,i).toCollection().primaryKeys()).then(r)}catch{return Ct(new Ie.MissingAPI)}var i,l},defineClass:function(){return function(r){h(this,r)}},ignoreTransaction:function(r){return Me.trans?vr(Me.transless||$t,r):r()},vip:Ri,async:function(r){return function(){try{var i=Bi(r.apply(this,arguments));return i&&typeof i.then=="function"?i:Ce.resolve(i)}catch(l){return Ct(l)}}},spawn:function(r,i,l){try{var f=Bi(r.apply(l,i||[]));return f&&typeof f.then=="function"?f:Ce.resolve(f)}catch(p){return Ct(p)}},currentTransaction:{get:function(){return Me.trans||null}},waitFor:function(r,i){return r=Ce.resolve(typeof r=="function"?br.ignoreTransaction(r):r).timeout(i||6e4),Me.trans?Me.trans.waitFor(r):r},Promise:Ce,debug:{get:function(){return q},set:function(r){Y(r)}},derive:X,extend:h,props:D,override:N,Events:os,on:Jn,liveQuery:Kl,extendObservabilitySet:fo,getByKeyPath:ae,setByKeyPath:Z,delByKeyPath:function(r,i){typeof i=="string"?Z(r,i,void 0):"length"in i&&[].map.call(i,function(l){Z(r,l,void 0)})},shallowClone:$,deepClone:xe,getObjectDiff:Ui,cmp:tt,asap:de,minKey:-1/0,addons:[],connections:{get:cs.toArray},errnames:Yt,dependencies:mo,cache:gr,semVer:"4.4.6",version:"4.4.6".split(".").map(function(r){return parseInt(r)}).reduce(function(r,i,l){return r+i/Math.pow(10,2*l)})})),br.maxKey=ls(br.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Jn(so,function(r){Xn||(r=new CustomEvent($i,{detail:r}),Xn=!0,dispatchEvent(r),Xn=!1)}),addEventListener($i,function(r){r=r.detail,Xn||zi(r)}));var Ur,Xn=!1,Fl=function(){};return typeof BroadcastChannel<"u"&&((Fl=function(){(Ur=new BroadcastChannel($i)).onmessage=function(r){return r.data&&zi(r.data)}})(),typeof Ur.unref=="function"&&Ur.unref(),Jn(so,function(r){Xn||Ur.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!Mn.disableBfCache&&r.persisted){q&&console.debug("Dexie: handling persisted pagehide"),Ur!=null&&Ur.close();for(var i=0,l=cs.toArray();i<l.length;i++)l[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!Mn.disableBfCache&&r.persisted&&(q&&console.debug("Dexie: handling persisted pageshow"),Fl(),zi({all:new Dt(-1/0,[[]])}))})),Ce.rejectionMapper=function(r,i){return!r||r instanceof fe||r instanceof TypeError||r instanceof SyntaxError||!r.name||!w[r.name]?r:(i=new w[r.name](i||r.message,r),"stack"in r&&L(i,"stack",{get:function(){return this.inner.stack}}),i)},Y(q),s(Mn,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Mn,Entity:pl,PropModification:ss,RangeSet:Dt,add:function(r){return new ss({add:r})},cmp:tt,default:Mn,liveQuery:Kl,mergeRanges:ds,rangesOverlap:Al,remove:function(r){return new ss({remove:r})},replacePrefix:function(r,i){return new ss({replacePrefix:[r,i]})}}),{default:Mn}),Mn})})(nf);var Hh=nf.exports;const Ea=qh(Hh),Au=Symbol.for("Dexie"),Ir=globalThis[Au]||(globalThis[Au]=Ea);if(Ea.semVer!==Ir.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Ea.semVer} and ${Ir.semVer}`);const{liveQuery:Wh,mergeRanges:$0,rangesOverlap:A0,RangeSet:P0,cmp:T0,Entity:O0,PropModification:M0,replacePrefix:I0,add:j0,remove:D0,DexieYProvider:R0}=Ir;class rf extends Ir{constructor(t="intern_worklog"){super(t),this.version(1).stores({project:"++id, &name, archived",work_log:"++id, &date",log_item:"++id, work_log_id, project_id, category",attendance:"++id, &date",weekly_note:"++id, &week_start",setting:"key"}),this.version(2).stores({memo:"++id, updated_at",credential:"++id, system, updated_at"}),this.version(3).stores({transaction:"++id, date, type, category"}),this.version(4).stores({sync_mirror:"++id, table, uuid",tombstone:"++id, table, uuid, deleted_at"})}}let te;function zh(e){te=e}function sf(){te&&te.close(),te=void 0}const Gh=4,Wr=["餐饮","交通","住房","通讯","学习","娱乐","其他"],Bo=["工资","报销","其他"],Pu=["公司","客户现场","出差","居家办公"],Us=[{key:"dev",label:"开发"},{key:"bugfix",label:"BUG修复"},{key:"test",label:"测试"},{key:"learning",label:"学习成长"},{key:"meeting",label:"会议沟通"},{key:"doc",label:"文档输出"},{key:"other",label:"其他"}];function Qa(e){const t=Us.find(n=>n.key===e);return t?t.label:"其他"}const Yh={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},Jh={class:"dialog-head"},Xh={key:0,class:"muted dialog-sub"},Qh={class:"dialog-body"},Zh={class:"form-grid"},ev={class:"field span2"},tv={key:0,class:"form-error"},nv={class:"field"},rv=["value"],sv={class:"field"},ov=["value"],iv={class:"field"},av={class:"field"},lv={class:"field span2"},uv={class:"field"},cv={class:"field"},fv={class:"dialog-btns"},dv=Vt({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=V(""),a=V(null),c=V("dev"),d=V(null),h=V(""),y=V(""),m=V(0),k=V(0),D=V(""),T=V(null),L=it(()=>{var N;const Q=n.projects.filter(G=>G.archived!==1),E=(N=n.item)==null?void 0:N.project_id;if(E&&!Q.some(G=>G.id===E)){const G=n.projects.find(ae=>ae.id===E),de=Q.slice();return G&&de.unshift({...G,name:G.name+"(已归档)"}),de}return Q});function X(Q){n.open&&Q.key==="Escape"&&s("cancel")}gt(()=>n.open,async Q=>{var E;if(Q){const N=n.item;o.value=(N==null?void 0:N.content)??"",a.value=(N==null?void 0:N.project_id)??null,c.value=(N==null?void 0:N.category)??"dev",d.value=(N==null?void 0:N.minutes)??null,h.value=(N==null?void 0:N.takeaway)??"",y.value=(N==null?void 0:N.remark)??"",m.value=(N==null?void 0:N.is_milestone)??0,k.value=(N==null?void 0:N.needs_followup)??0,D.value="",window.addEventListener("keydown",X),await ts(),(E=T.value)==null||E.focus()}else window.removeEventListener("keydown",X)}),dr(()=>window.removeEventListener("keydown",X)),gt(o,()=>{D.value&&(D.value="")});function ce(){const Q=o.value.trim();if(!Q){D.value="请填写工作内容";return}if(!n.item||!n.item.id){s("cancel");return}s("save",{id:n.item.id,content:Q,project_id:a.value,category:c.value,minutes:d.value&&d.value>0?d.value:null,takeaway:h.value.trim()||null,remark:y.value.trim()||null,is_milestone:m.value?1:0,needs_followup:k.value?1:0})}return(Q,E)=>(K(),It(Vs,{to:"body"},[Te(ns,{name:"modal"},{default:fr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:E[10]||(E[10]=Mr(N=>s("cancel"),["self"]))},[u("div",Yh,[u("div",Jh,[u("div",null,[E[11]||(E[11]=u("div",{class:"dialog-title"},"编辑工作记录",-1)),e.date?(K(),H("div",Xh,re(e.date),1)):Se("",!0)]),u("button",{class:"icon-btn",title:"关闭",onClick:E[0]||(E[0]=N=>s("cancel"))},[Te(lt,{name:"close",size:16})])]),u("div",Qh,[u("div",Zh,[u("div",ev,[E[12]||(E[12]=u("label",null,"工作内容(必填)",-1)),Ee(u("input",{ref_key:"contentInput",ref:T,class:et(["input",{invalid:D.value}]),"onUpdate:modelValue":E[1]||(E[1]=N=>o.value=N),onKeydown:jt(ce,["enter"])},null,34),[[De,o.value]]),D.value?(K(),H("div",tv,re(D.value),1)):Se("",!0)]),u("div",nv,[E[14]||(E[14]=u("label",null,"所属项目",-1)),Ee(u("select",{class:"select","onUpdate:modelValue":E[2]||(E[2]=N=>a.value=N)},[E[13]||(E[13]=u("option",{value:null},"无项目",-1)),(K(!0),H(Re,null,ut(L.value,N=>(K(),H("option",{key:N.id,value:N.id},re(N.name),9,rv))),128))],512),[[Fn,a.value]])]),u("div",sv,[E[15]||(E[15]=u("label",null,"工作分类",-1)),Ee(u("select",{class:"select","onUpdate:modelValue":E[3]||(E[3]=N=>c.value=N)},[(K(!0),H(Re,null,ut(Qt(Us),N=>(K(),H("option",{key:N.key,value:N.key},re(N.label),9,ov))),128))],512),[[Fn,c.value]])]),u("div",iv,[E[16]||(E[16]=u("label",null,"耗时(分钟)",-1)),Ee(u("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":E[4]||(E[4]=N=>d.value=N),placeholder:"选填"},null,512),[[De,d.value,void 0,{number:!0}]])]),u("div",av,[E[17]||(E[17]=u("label",null,"主要收获",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":E[5]||(E[5]=N=>h.value=N),placeholder:"一句话:学到了什么"},null,512),[[De,h.value]])]),u("div",lv,[E[18]||(E[18]=u("label",null,"备注",-1)),Ee(u("textarea",{class:"textarea","onUpdate:modelValue":E[6]||(E[6]=N=>y.value=N),placeholder:"背景、链接、未决事项(选填)"},null,512),[[De,y.value]])]),u("div",uv,[E[19]||(E[19]=u("label",null,"成果标记",-1)),u("button",{class:et(["toggle-btn",{on:m.value===1}]),onClick:E[7]||(E[7]=N=>m.value=m.value===1?0:1)},re(m.value===1?"已标记为成果":"未标记"),3)]),u("div",cv,[E[20]||(E[20]=u("label",null,"待跟进",-1)),u("button",{class:et(["toggle-btn",{onwarn:k.value===1}]),onClick:E[8]||(E[8]=N=>k.value=k.value===1?0:1)},re(k.value===1?"需要跟进":"无需跟进"),3)])])]),u("div",fv,[u("button",{class:"btn btn-sm",onClick:E[9]||(E[9]=N=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:ce},"保存修改")])])])):Se("",!0)]),_:1})]))}}),pv=Gt(dv,[["__scopeId","data-v-63bc0b48"]]);function Ss(e){return e<10?"0"+e:String(e)}function Nn(e){return e.getFullYear()+"-"+Ss(e.getMonth()+1)+"-"+Ss(e.getDate())}function xt(){return Nn(new Date)}function wt(){const e=new Date;return Nn(e)+"T"+Ss(e.getHours())+":"+Ss(e.getMinutes())+":"+Ss(e.getSeconds())}function Vn(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function rs(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Kn(e,t){const n=rs(e);return n.setDate(n.getDate()+t),Nn(n)}function Uo(e,t){const n=rs(e),s=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(s,o)),Nn(n)}function Es(e){const t=rs(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Nn(t)}function hv(e){const t=rs(e).getDay();return t===0||t===6}function vv(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function of(e){const t=rs(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}async function yt(e,t){const n=await te.setting.get(e);return n?n.value:t}async function kt(e,t){await te.setting.put({key:e,value:t})}async function jr(){const e=await Promise.all([yt("work_start","09:00"),yt("work_end","18:00"),yt("grace_minutes","10"),yt("lunch_minutes","60"),yt("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 mv(){const e=await yt("last_project",""),t=await yt("last_category","dev");return{project_id:e?Number(e):null,category:t||"dev"}}async function yv(){return yt("last_location","")}async function gv(e,t){const n=t.trim();await kt("last_location",n),n&&await qo(n);const s=await mn(e);s&&s.id?await te.attendance.update(s.id,{location:n||null}):n&&await te.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:wt()})}async function Za(){const e=await yt("location_presets","");if(!e)return Pu.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 Pu.slice()}async function af(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await kt("location_presets",JSON.stringify(t))}async function qo(e){const t=e.trim();if(!t)return;const n=await Za();n.includes(t)||await af([...n,t])}async function Ks(e=!1){const t=await te.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function bv(e){await te.project.add({name:e.trim(),archived:0,created_at:wt()})}async function wv(e,t){await te.project.update(e,{name:t.trim()})}async function _v(e,t){await te.project.update(e,{archived:t?1:0})}async function mn(e){return te.attendance.where("date").equals(e).first()}async function lf(e,t){const n=((t===void 0?await yt("last_location",""):t)||"").trim(),s=await mn(e);if(s&&s.id){if(!s.clock_in_at){const o={clock_in_at:wt()};n&&(o.location=n),await te.attendance.update(s.id,o)}n&&(await kt("last_location",n),await qo(n));return}await te.attendance.add({date:e,clock_in_at:wt(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:wt()}),n&&(await kt("last_location",n),await qo(n))}async function kv(e){const t=await mn(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&await te.attendance.update(t.id,{clock_out_at:wt()})}async function xv(){const e=new Date,t=Nn(e);if(e.getHours()<4){const s=await mn(Kn(t,-1));if(s&&s.id&&s.clock_in_at&&!s.clock_out_at)return await te.attendance.update(s.id,{clock_out_at:wt()}),s.date}const n=await mn(t);if(n&&n.id&&n.clock_in_at&&!n.clock_out_at)return await te.attendance.update(n.id,{clock_out_at:wt()}),n.date;throw new Error("没有进行中的打卡")}async function Cv(e,t,n,s,o){(o||"").trim()&&await qo(o);const a=await mn(e),c={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:s||null,location:(o||"").trim()||null,created_at:wt()};a&&a.id?await te.attendance.update(a.id,c):await te.attendance.add(c)}async function Sv(e,t,n){const s=(n||"").trim();if(!s)return;const o=await mn(e);o&&o.id&&await te.attendance.update(o.id,{[t]:e+"T"+s+":00"})}async function di(e,t){return te.attendance.where("date").between(e,t,!0,!0).toArray()}async function Ev(e,t){const n=await mn(e);if(t){const s={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:wt()};n&&n.id?await te.attendance.update(n.id,s):await te.attendance.add({...s,note:null,location:null})}else n&&n.id&&await te.attendance.update(n.id,{kind:"normal"})}async function $v(e){const t=await te.work_log.where("date").equals(e).first();return t||{id:await te.work_log.add({date:e,created_at:wt()}),date:e,created_at:wt()}}async function Av(e){return te.work_log.where("date").equals(e).first()}async function Pv(e){const t=await Av(e);return!t||!t.id?[]:(await te.log_item.where("work_log_id").equals(t.id).toArray()).sort((s,o)=>o.id-s.id)}async function Tv(e,t){const n=await $v(e);await te.log_item.add({work_log_id:n.id,content:t.content,project_id:t.project_id,category:t.category,minutes:t.minutes,is_milestone:0,needs_followup:0,takeaway:t.takeaway,remark:t.remark,sort_order:0,created_at:wt()}),await kt("last_project",t.project_id?String(t.project_id):""),await kt("last_category",t.category)}async function la(e,t){await te.log_item.update(e,t)}async function Ov(e){await te.log_item.delete(e)}async function pi(e,t){const n=await te.work_log.where("date").between(e,t,!0,!0).toArray();if(!n.length)return[];const s=new Map(n.map(a=>[a.id,a.date]));return(await te.log_item.where("work_log_id").anyOf(n.map(a=>a.id)).toArray()).map(a=>({...a,date:s.get(a.work_log_id)||""})).sort((a,c)=>a.date===c.date?a.id-c.id:a.date<c.date?-1:1)}async function el(e){return te.weekly_note.where("week_start").equals(e).first()}async function Mv(e,t){const n=await el(e);n&&n.id?await te.weekly_note.update(n.id,t):await te.weekly_note.add({week_start:e,highlights:t.highlights??null,challenges:t.challenges??null,plan_next:t.plan_next??null,created_at:wt()})}async function Iv(e,t){return te.weekly_note.where("week_start").between(e,t,!0,!0).toArray()}async function jv(){return(await te.memo.toArray()).sort((t,n)=>t.updated_at<n.updated_at?1:-1)}async function Dv(e,t){const n=wt();return{id:await te.memo.add({title:e.trim(),content:t,created_at:n,updated_at:n}),title:e.trim(),content:t,created_at:n,updated_at:n}}async function Rv(e,t,n){await te.memo.update(e,{title:t.trim(),content:n,updated_at:wt()})}async function Lv(e){await te.memo.delete(e)}async function Kv(e,t=8){const n=e.trim().toLowerCase();if(!n)return[];const s=await te.work_log.toArray(),o=new Map(s.map(c=>[c.id,c.date]));return(await te.log_item.toArray()).filter(c=>((c.content||"")+" "+(c.takeaway||"")+" "+(c.remark||"")).toLowerCase().includes(n)).sort((c,d)=>d.id-c.id).slice(0,t).map(c=>({...c,date:o.get(c.work_log_id)||""}))}async function Fv(e,t=4){const n=e.trim().toLowerCase();return n?(await te.memo.toArray()).filter(o=>((o.title||"")+" "+(o.content||"")).toLowerCase().includes(n)).sort((o,a)=>o.updated_at<a.updated_at?1:-1).slice(0,t):[]}async function Nv(e,t){return te.table("transaction").where("date").between(e,t,!0,!0).toArray()}async function Vv(e){await te.table("transaction").add({...e,created_at:wt()})}async function Bv(e,t){await te.table("transaction").update(e,{...t})}async function Uv(e){await te.table("transaction").delete(e)}async function qv(e,t){await te.table("transaction").update(e,{reimbursed:1})}async function Hv(){const e=await Promise.all([te.project.toArray(),te.work_log.toArray(),te.log_item.toArray(),te.attendance.toArray(),te.weekly_note.toArray(),te.setting.toArray(),te.memo.toArray(),te.credential.toArray(),te.table("transaction").toArray()]);return JSON.stringify({schema_version:Gh,exported_at:wt(),data:{project:e[0],work_log:e[1],log_item:e[2],attendance:e[3],weekly_note:e[4],setting:e[5],memo:e[6],credential:e[7],transaction:e[8]}},null,2)}async function Wv(e){let t=null;try{t=JSON.parse(e)}catch{throw new Error("不是有效的 JSON 文件")}if(!t||t.schema_version!==1&&t.schema_version!==2&&t.schema_version!==3||!t.data)throw new Error("文件格式或 schema 版本不匹配");const n=t.data;await te.transaction("rw",[te.project,te.work_log,te.log_item,te.attendance,te.weekly_note,te.setting,te.memo,te.credential,te.table("transaction")],async()=>{await Promise.all([te.project.clear(),te.work_log.clear(),te.log_item.clear(),te.attendance.clear(),te.weekly_note.clear(),te.setting.clear(),te.memo.clear(),te.credential.clear(),te.table("transaction").clear()]),n.project&&n.project.length&&await te.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await te.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await te.log_item.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await te.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await te.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await te.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await te.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await te.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await te.table("transaction").bulkAdd(n.transaction)})}function Co(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function qs(e,t,n,s){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(hv(t))return{status:"rest",label:"休息日",makeup:!1,workedMinutes:null};if(!e||!e.clock_in_at)return s?{status:"none",label:"未打卡",makeup:!1,workedMinutes:null}:{status:"absent",label:"缺勤",makeup:!!(e&&e.kind==="makeup"),workedMinutes:null};const o=e.kind==="makeup";if(!e.clock_out_at)return{status:"incomplete",label:s?"进行中":"未完成",makeup:o,workedMinutes:null};const a=Co(Vn(e.clock_in_at)),c=Co(Vn(e.clock_out_at)),d=Co(n.work_start),h=Co(n.work_end);let y="normal";!o&&a>d+n.grace_minutes?y="late":!o&&c<h&&(y="early");const m=vv(e.clock_in_at,e.clock_out_at),k=Math.max(0,m-n.lunch_minutes);return{status:y,label:o?"补卡":y==="late"?"迟到":y==="early"?"早退":"正常",makeup:o,workedMinutes:k}}const Po=V([]);let zv=0;function We(e){const t=++zv;Po.value.push({id:t,text:e}),setTimeout(()=>{Po.value=Po.value.filter(n=>n.id!==t)},2e3)}function Gv(){return Po}const $a=V(null),Aa=V(null),Hs=V(0);function Sr(){Hs.value++}const Yv={class:"day-panel"},Jv={class:"dp-head"},Xv={class:"dp-date"},Qv={class:"card sec"},Zv={class:"att-grid"},em={class:"att-cell"},tm={key:0,class:"edit-row"},nm={key:1,class:"att-val"},rm={class:"att-cell"},sm={key:0,class:"edit-row"},om={key:1,class:"att-val"},im={class:"att-cell"},am=["list"],lm=["id"],um=["value"],cm={class:"att-cell"},fm={class:"att-val status-val"},dm={key:0,class:"tag"},pm={key:1,class:"muted"},hm={key:0,class:"att-note muted"},vm={class:"att-actions"},mm=["disabled"],ym=["disabled"],gm=["disabled"],bm=["disabled"],wm={key:0,class:"card sec makeup"},_m={class:"form-grid"},km={class:"field"},xm={class:"field"},Cm={class:"field span2"},Sm=["list"],Em={class:"field span2"},$m={key:0,class:"form-error"},Am={class:"form-footer"},Pm={class:"card sec"},Tm={class:"form-grid"},Om={class:"field span2"},Mm={key:0,class:"form-error"},Im={class:"field"},jm=["value"],Dm={class:"field"},Rm=["value"],Lm={class:"field"},Km={class:"field"},Fm={class:"field span2"},Nm={class:"form-footer"},Vm=["disabled"],Bm=["disabled"],Um={class:"list-sec"},qm={class:"sec-title"},Hm={key:0,class:"empty muted"},Wm={class:"item-main"},zm={class:"tag"},Gm=["onClick"],Ym={key:0,class:"muted item-meta"},Jm={key:1,class:"muted num item-meta"},Xm=["onClick"],Qm=["onClick"],Zm=["onClick"],ey=["onClick"],ty={key:0,class:"item-sub"},ny={key:0,class:"muted2"},ry={key:1,class:"muted"},sy={key:1,class:"dp-foot muted num"},oy=Vt({__name:"DayPanel",props:{date:{}},setup(e){const t=e,n=V(!0),s=V(null),o=V(void 0),a=V([]),c=V([]),d=V(""),h=V([]),y=it(()=>"loc-list-"+t.date),m=it(()=>t.date===xt());async function k(){n.value=!0,s.value=await jr(),o.value=await mn(t.date),a.value=await Pv(t.date),c.value=await Ks(!0),h.value=await Za(),d.value=o.value&&o.value.location||await yv(),n.value=!1}fn(k),gt(()=>t.date,k),gt(Hs,()=>{k()});const D=it(()=>c.value.filter(W=>W.archived!==1));function T(W){if(!W)return"";const q=c.value.find(Y=>Y.id===W);return q?q.name:"已删除项目"}const L=it(()=>s.value?qs(o.value,t.date,s.value,m.value):null),X=it(()=>a.value.reduce((W,q)=>W+(q.minutes||0),0)),ce=V(!1);async function Q(){ce.value||(ce.value=!0,await lf(t.date,d.value),await k(),Sr(),We("上班打卡成功"),ce.value=!1)}async function E(){ce.value||(ce.value=!0,await kv(t.date),await k(),Sr(),We("下班打卡成功"),ce.value=!1)}async function N(){await gv(t.date,d.value),Sr(),We("地点已更新")}const G=V(!1),de=it(()=>{var W;return((W=o.value)==null?void 0:W.kind)==="leave"});function ae(){if(o.value&&o.value.clock_in_at){G.value=!0;return}Z(!0)}async function Z(W){G.value=!1,await Ev(t.date,W),await k(),Sr(),We(W?"已标记为休假":"已取消休假")}const $=V(null),x=V(""),le=V(null);gt($,async W=>{var q;W&&(await ts(),(q=le.value)==null||q.focus())});function ke(W){var Y,$e;const q=W==="in"?(Y=o.value)==null?void 0:Y.clock_in_at:($e=o.value)==null?void 0:$e.clock_out_at;$.value=W,x.value=q?Vn(q):W==="in"?"09:00":"18:00"}function J(){$.value=null}async function xe(){const W=$.value;W&&($.value=null,x.value&&(await Sv(t.date,W==="in"?"clock_in_at":"clock_out_at",x.value),await k(),Sr(),We("打卡时间已修改")))}const Ve=V(!1),nt=V("09:00"),qe=V("18:00"),He=V(""),ge=V(""),Oe=V("");function Fe(){ge.value=d.value,Oe.value="",Ve.value=!Ve.value}async function je(){if(!nt.value||!qe.value){Oe.value="请填写上班与下班时间";return}await Cv(t.date,t.date+"T"+nt.value+":00",t.date+"T"+qe.value+":00",He.value.trim(),ge.value),Ve.value=!1,He.value="",Oe.value="",await k(),Sr(),We("补卡已保存")}const ne=V(""),F=V("");gt(ne,()=>{F.value&&(F.value="")});const fe=V(null),Ke=V("dev"),ct=V(null),ht=V(""),Yt=V(""),Jt=V(!1),Ie=it(()=>!!(ne.value.trim()||ct.value||ht.value.trim()||Yt.value.trim()));fn(async()=>{const W=await mv();fe.value=W.project_id,Ke.value=W.category});function w(){ne.value="",ct.value=null,ht.value="",Yt.value="",F.value=""}async function g(){const W=ne.value.trim();if(!W){F.value="请填写工作内容";return}Jt.value||(Jt.value=!0,await Tv(t.date,{content:W,project_id:fe.value,category:Ke.value,minutes:ct.value&&ct.value>0?ct.value:null,takeaway:ht.value.trim()||null,remark:Yt.value.trim()||null}),w(),await k(),We("记录已添加"),Jt.value=!1)}const P=V(null);function ie(W){P.value=W}async function se(W){const q=W.id,Y={content:W.content,project_id:W.project_id,category:W.category,minutes:W.minutes,takeaway:W.takeaway,remark:W.remark,is_milestone:W.is_milestone,needs_followup:W.needs_followup};await la(q,Y),P.value=null,await k(),We("修改已保存")}async function ue(W){await la(W.id,{is_milestone:W.is_milestone?0:1}),await k()}async function ye(W){await la(W.id,{needs_followup:W.needs_followup?0:1}),await k()}const oe=V(null);async function we(){oe.value&&oe.value.id&&await Ov(oe.value.id),oe.value=null,await k(),We("记录已删除")}return(W,q)=>(K(),H("div",Yv,[u("div",Jv,[u("div",Xv,re(Qt(of)(e.date)),1)]),u("div",Qv,[q[25]||(q[25]=u("div",{class:"sec-title"},"出勤信息",-1)),u("div",Zv,[u("div",em,[q[21]||(q[21]=u("label",null,"上班时间",-1)),$.value==="in"?(K(),H("div",tm,[Ee(u("input",{ref_key:"timeInput",ref:le,type:"time",class:"input time-input","onUpdate:modelValue":q[0]||(q[0]=Y=>x.value=Y),onKeydown:[jt(xe,["enter"]),jt(J,["esc"])]},null,544),[[De,x.value]]),u("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),u("button",{class:"btn btn-sm",onClick:J},"取消")])):(K(),H("div",nm,[u("span",{class:et(["num",{"val-empty":!(o.value&&o.value.clock_in_at)}])},re(o.value&&o.value.clock_in_at?Qt(Vn)(o.value.clock_in_at):"未打卡"),3),o.value&&o.value.id?(K(),H("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:q[1]||(q[1]=Y=>ke("in"))},[Te(lt,{name:"edit",size:13})])):Se("",!0)]))]),u("div",rm,[q[22]||(q[22]=u("label",null,"下班时间",-1)),$.value==="out"?(K(),H("div",sm,[Ee(u("input",{ref_key:"timeInput",ref:le,type:"time",class:"input time-input","onUpdate:modelValue":q[2]||(q[2]=Y=>x.value=Y),onKeydown:[jt(xe,["enter"]),jt(J,["esc"])]},null,544),[[De,x.value]]),u("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),u("button",{class:"btn btn-sm",onClick:J},"取消")])):(K(),H("div",om,[u("span",{class:et(["num",{"val-empty":!(o.value&&o.value.clock_out_at)}])},re(o.value&&o.value.clock_out_at?Qt(Vn)(o.value.clock_out_at):"未打卡"),3),o.value&&o.value.id?(K(),H("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:q[3]||(q[3]=Y=>ke("out"))},[Te(lt,{name:"edit",size:13})])):Se("",!0)]))]),u("div",im,[q[23]||(q[23]=u("label",null,"上班地点",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":q[4]||(q[4]=Y=>d.value=Y),list:y.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:N},null,40,am),[[De,d.value]]),u("datalist",{id:y.value},[(K(!0),H(Re,null,ut(h.value,Y=>(K(),H("option",{key:Y,value:Y},null,8,um))),128))],8,lm)]),u("div",cm,[q[24]||(q[24]=u("label",null,"考勤状态",-1)),u("div",fm,[L.value?(K(),H(Re,{key:0},[u("span",{class:et(["dot",L.value.status])},null,2),u("span",null,re(L.value.label),1),o.value&&o.value.kind==="makeup"?(K(),H("span",dm,"补卡")):Se("",!0)],64)):(K(),H("span",pm,"--"))])])]),o.value&&o.value.note?(K(),H("div",hm,"补卡说明:"+re(o.value.note),1)):Se("",!0),u("div",vm,[m.value&&(!o.value||!o.value.clock_in_at)?(K(),H("button",{key:0,class:"btn btn-primary btn-sm",disabled:ce.value,onClick:Q},"上班打卡",8,mm)):m.value&&o.value&&o.value.clock_in_at&&!o.value.clock_out_at?(K(),H("button",{key:1,class:"btn btn-primary btn-sm",disabled:ce.value,onClick:E},"下班打卡",8,ym)):Se("",!0),!m.value&&(!o.value||!o.value.clock_in_at)?(K(),H("button",{key:2,class:"btn btn-sm",onClick:Fe},"补卡")):Se("",!0),de.value?(K(),H("button",{key:4,class:"btn btn-sm",disabled:ce.value,onClick:q[5]||(q[5]=Y=>Z(!1))},"取消休假",8,bm)):(K(),H("button",{key:3,class:"btn btn-sm",disabled:ce.value,onClick:ae},"标记休假",8,gm))])]),Ve.value?(K(),H("div",wm,[q[30]||(q[30]=u("div",{class:"sec-title"},"补卡登记",-1)),u("div",_m,[u("div",km,[q[26]||(q[26]=u("label",null,"上班时间",-1)),Ee(u("input",{type:"time",class:"input","onUpdate:modelValue":q[6]||(q[6]=Y=>nt.value=Y)},null,512),[[De,nt.value]])]),u("div",xm,[q[27]||(q[27]=u("label",null,"下班时间",-1)),Ee(u("input",{type:"time",class:"input","onUpdate:modelValue":q[7]||(q[7]=Y=>qe.value=Y)},null,512),[[De,qe.value]])]),u("div",Cm,[q[28]||(q[28]=u("label",null,"上班地点",-1)),Ee(u("input",{class:"input",list:y.value,"onUpdate:modelValue":q[8]||(q[8]=Y=>ge.value=Y),placeholder:"可直接输入"},null,8,Sm),[[De,ge.value]])]),u("div",Em,[q[29]||(q[29]=u("label",null,"补卡原因",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":q[9]||(q[9]=Y=>He.value=Y),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[De,He.value]])])]),Oe.value?(K(),H("div",$m,re(Oe.value),1)):Se("",!0),u("div",Am,[u("button",{class:"btn btn-sm",onClick:q[10]||(q[10]=Y=>Ve.value=!1)},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:je},"保存补卡")])])):Se("",!0),u("div",Pm,[q[38]||(q[38]=u("div",{class:"sec-head"},[u("span",{class:"sec-title"},"新增工作记录"),u("span",{class:"muted form-hint"},"内容必填,其余选填")],-1)),u("div",Tm,[u("div",Om,[q[31]||(q[31]=u("label",null,"工作内容(必填)",-1)),Ee(u("input",{class:et(["input",{invalid:F.value}]),"onUpdate:modelValue":q[11]||(q[11]=Y=>ne.value=Y),placeholder:"做了什么,一句话一条",onKeydown:jt(g,["enter"])},null,34),[[De,ne.value]]),F.value?(K(),H("div",Mm,re(F.value),1)):Se("",!0)]),u("div",Im,[q[33]||(q[33]=u("label",null,"所属项目",-1)),Ee(u("select",{class:"select","onUpdate:modelValue":q[12]||(q[12]=Y=>fe.value=Y)},[q[32]||(q[32]=u("option",{value:null},"无项目",-1)),(K(!0),H(Re,null,ut(D.value,Y=>(K(),H("option",{key:Y.id,value:Y.id},re(Y.name),9,jm))),128))],512),[[Fn,fe.value]])]),u("div",Dm,[q[34]||(q[34]=u("label",null,"工作分类",-1)),Ee(u("select",{class:"select","onUpdate:modelValue":q[13]||(q[13]=Y=>Ke.value=Y)},[(K(!0),H(Re,null,ut(Qt(Us),Y=>(K(),H("option",{key:Y.key,value:Y.key},re(Y.label),9,Rm))),128))],512),[[Fn,Ke.value]])]),u("div",Lm,[q[35]||(q[35]=u("label",null,"耗时(分钟)",-1)),Ee(u("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":q[14]||(q[14]=Y=>ct.value=Y),placeholder:"选填"},null,512),[[De,ct.value,void 0,{number:!0}]])]),u("div",Km,[q[36]||(q[36]=u("label",null,"主要收获",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":q[15]||(q[15]=Y=>ht.value=Y),placeholder:"一句话:学到了什么"},null,512),[[De,ht.value]])]),u("div",Fm,[q[37]||(q[37]=u("label",null,"备注",-1)),Ee(u("textarea",{class:"textarea","onUpdate:modelValue":q[16]||(q[16]=Y=>Yt.value=Y),placeholder:"背景、链接、未决事项(选填)"},null,512),[[De,Yt.value]])])]),u("div",Nm,[u("button",{class:"btn btn-sm",disabled:!Ie.value,onClick:w},"重置",8,Vm),u("button",{class:"btn btn-primary btn-sm",disabled:Jt.value,onClick:g},"添加记录",8,Bm)])]),u("div",Um,[u("div",qm,"工作记录("+re(a.value.length)+")",1),!a.value.length&&!n.value?(K(),H("div",Hm,"暂无记录")):Se("",!0),(K(!0),H(Re,null,ut(a.value,Y=>(K(),H("div",{key:Y.id,class:"item"},[u("div",Wm,[u("span",zm,re(Qt(Qa)(Y.category)),1),u("span",{class:"item-content",title:"点击编辑",onClick:$e=>ie(Y)},re(Y.content),9,Gm),Y.project_id?(K(),H("span",Ym,re(T(Y.project_id)),1)):Se("",!0),Y.minutes?(K(),H("span",Jm,re(Y.minutes)+" 分钟",1)):Se("",!0),q[39]||(q[39]=u("span",{class:"flex1"},null,-1)),u("button",{class:"icon-btn",title:"编辑完整信息",onClick:$e=>ie(Y)},[Te(lt,{name:"edit",size:14})],8,Xm),u("button",{class:et(["icon-btn",{active:Y.is_milestone===1}]),title:"成果标记",onClick:$e=>ue(Y)},[Te(lt,{name:"star",size:14})],10,Qm),u("button",{class:et(["icon-btn",{"active-warn":Y.needs_followup===1}]),title:"待跟进",onClick:$e=>ye(Y)},[Te(lt,{name:"flag",size:14})],10,Zm),u("button",{class:"icon-btn",title:"删除",onClick:$e=>oe.value=Y},[Te(lt,{name:"close",size:14})],8,ey)]),Y.takeaway||Y.remark?(K(),H("div",ty,[Y.takeaway?(K(),H("div",ny,"收获:"+re(Y.takeaway),1)):Se("",!0),Y.remark?(K(),H("div",ry,"备注:"+re(Y.remark),1)):Se("",!0)])):Se("",!0)]))),128)),a.value.length?(K(),H("div",sy,[nn(" 共 "+re(a.value.length)+" 条事项 ",1),X.value?(K(),H(Re,{key:0},[nn(" · "+re((X.value/60).toFixed(1))+" 小时",1)],64)):Se("",!0)])):Se("",!0)]),Te(ur,{open:!!oe.value,title:"删除确认",message:oe.value?"将删除工作记录「"+oe.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:q[17]||(q[17]=Y=>oe.value=null),onConfirm:we},null,8,["open","message"]),Te(ur,{open:G.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:q[18]||(q[18]=Y=>G.value=!1),onConfirm:q[19]||(q[19]=Y=>Z(!0))},null,8,["open"]),Te(pv,{open:!!P.value,item:P.value,projects:c.value,date:e.date,onCancel:q[20]||(q[20]=Y=>P.value=null),onSave:se},null,8,["open","item","projects","date"])]))}}),uf=Gt(oy,[["__scopeId","data-v-2e90c9d8"]]),iy={class:"cal-page"},ay={class:"cal-toolbar"},ly={class:"cal-title num"},uy={class:"cal-head"},cy={class:"cal-grid"},fy=["title","onClick"],dy={class:"cal-marks"},py={key:0,class:"drawer"},hy={class:"drawer-head"},vy={class:"drawer-body"},my=Vt({__name:"CalendarView",setup(e){const t=V(xt()),n=it(()=>Number(t.value.slice(0,4))),s=it(()=>Number(t.value.slice(5,7))-1),o=it(()=>n.value+" 年 "+(s.value+1)+" 月"),a=["一","二","三","四","五","六","日"],c=it(()=>{const G=(new Date(n.value,s.value,1).getDay()+6)%7,de=new Date(n.value,s.value+1,0).getDate(),ae=[];for(let Z=0;Z<G;Z++)ae.push({date:"",inMonth:!1,weekend:!1});for(let Z=1;Z<=de;Z++){const $=new Date(n.value,s.value,Z),x=$.getDay();ae.push({date:Nn($),inMonth:!0,weekend:x===0||x===6})}return ae}),d=V(new Map),h=xt();async function y(){var le;const N=Nn(new Date(n.value,s.value,1)),G=Nn(new Date(n.value,s.value+1,0)),de=await Promise.all([jr(),di(N,G),pi(N,G)]),ae=de[0],Z=new Map(de[1].map(ke=>[ke.date,ke])),$=de[2],x=new Map;for(const ke of c.value){if(!ke.inMonth)continue;const J=qs(Z.get(ke.date),ke.date,ae,ke.date===h),xe=$.filter(Ve=>Ve.date===ke.date);x.set(ke.date,{status:J.status,label:J.label,location:((le=Z.get(ke.date))==null?void 0:le.location)||"",hasLog:xe.length>0,hasMilestone:xe.some(Ve=>Ve.is_milestone===1)})}d.value=x}gt([n,s],y,{immediate:!0}),gt(Hs,()=>{y()});function m(N){var G;return((G=d.value.get(N))==null?void 0:G.status)??""}function k(N){const G=d.value.get(N);return G?N+" · "+G.label+(G.location?" · "+G.location:""):N}function D(N){var G;return!!((G=d.value.get(N))!=null&&G.hasLog)}function T(N){var G;return!!((G=d.value.get(N))!=null&&G.hasMilestone)}function L(){t.value=Uo(t.value,-1)}function X(){t.value=Uo(t.value,1)}function ce(){t.value=xt()}const Q=V(null);function E(N,G){G&&(Q.value=N)}return gt($a,N=>{N&&(t.value=N,Q.value=N,$a.value=null)},{immediate:!0}),(N,G)=>(K(),H("div",iy,[u("div",ay,[u("button",{class:"icon-btn",onClick:L},[Te(lt,{name:"chevron-left",size:16})]),u("span",ly,re(o.value),1),u("button",{class:"icon-btn",onClick:X},[Te(lt,{name:"chevron-right",size:16})]),u("button",{class:"btn btn-sm",onClick:ce},"回到今天")]),u("div",uy,[(K(),H(Re,null,ut(a,de=>u("span",{key:de,class:"cal-week muted"},re(de),1)),64))]),u("div",cy,[(K(!0),H(Re,null,ut(c.value,(de,ae)=>(K(),H("button",{key:ae,class:et(["cal-cell",{blank:!de.inMonth,weekend:de.weekend,selected:Q.value===de.date}]),title:de.inMonth?k(de.date):void 0,onClick:Z=>E(de.date,de.inMonth)},[de.inMonth?(K(),H(Re,{key:0},[u("span",{class:et(["daynum num",{today:de.date===Qt(h)}])},re(Number(de.date.slice(8,10))),3),u("span",dy,[m(de.date)?(K(),H("span",{key:0,class:et(["dot",m(de.date)])},null,2)):Se("",!0),D(de.date)?(K(),It(lt,{key:1,name:"check-circle",size:12,class:"mark-log"})):Se("",!0),T(de.date)?(K(),It(lt,{key:2,name:"star",size:12,class:"mark-star"})):Se("",!0)])],64)):Se("",!0)],10,fy))),128))]),Te(ns,{name:"drawer"},{default:fr(()=>[Q.value?(K(),H("aside",py,[u("div",hy,[G[1]||(G[1]=u("span",{class:"drawer-title"},"当日详情",-1)),u("button",{class:"icon-btn",onClick:G[0]||(G[0]=de=>Q.value=null)},[Te(lt,{name:"close",size:16})])]),u("div",vy,[Te(uf,{date:Q.value},null,8,["date"])])])):Se("",!0)]),_:1})]))}}),yy=Gt(my,[["__scopeId","data-v-2404dfbe"]]),gy={class:"detail-page"},by={class:"detail-toolbar"},wy=["value"],_y=["disabled"],ky=Vt({__name:"TodayView",setup(e){const t=V(xt()),n=it(()=>t.value===xt());function s(){t.value=Kn(t.value,-1)}function o(){t.value=Kn(t.value,1)}function a(){t.value=xt()}function c(d){const h=d.target.value;h&&(t.value=h)}return(d,h)=>(K(),H("div",gy,[u("div",by,[u("button",{class:"icon-btn",title:"前一天",onClick:s},[Te(lt,{name:"chevron-left",size:16})]),u("span",{class:et(["date-title num",{"is-today":n.value}])},re(Qt(of)(t.value)),3),u("button",{class:"icon-btn",title:"后一天",onClick:o},[Te(lt,{name:"chevron-right",size:16})]),u("input",{type:"date",class:"input w-date",value:t.value,onChange:c},null,40,wy),u("button",{class:"btn btn-sm",disabled:n.value,onClick:a},"回到今天",8,_y)]),Te(uf,{date:t.value},null,8,["date"])]))}}),xy=Gt(ky,[["__scopeId","data-v-76243d98"]]),Cy={class:"stats"},Sy={class:"cards"},Ey={class:"card stat-card"},$y={class:"stat-num num"},Ay={class:"card stat-card"},Py={class:"stat-num num"},Ty={class:"card stat-card"},Oy={class:"stat-num num"},My={class:"card stat-card"},Iy={class:"stat-num num"},jy={class:"card section"},Dy={class:"heat"},Ry=["title"],Ly={class:"two-col"},Ky={class:"card section"},Fy={class:"bar-label"},Ny={class:"bar-track"},Vy={class:"muted num bar-num"},By={key:0,class:"muted"},Uy={class:"card section"},qy={class:"bar-label"},Hy={class:"bar-track"},Wy={class:"muted num bar-num"},zy={key:0,class:"muted"},Gy={class:"card section"},Yy={class:"bar-label loc-label"},Jy={class:"bar-track"},Xy={class:"muted num bar-num"},Qy={key:0,class:"muted"},Zy=Vt({__name:"StatsView",setup(e){const t=V({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=V([]),s=V([]),o=V([]),a=V([]);async function c(){const y=xt(),m="2000-01-01",k=await Promise.all([jr(),di(m,y),pi(m,y),Ks(!0)]),D=k[0],T=k[1],L=k[2],X=k[3],ce=T.filter(J=>J.clock_in_at||J.kind==="makeup");let Q=0;for(const J of ce){const xe=qs(J,J.date,D,J.date===y);Q+=xe.workedMinutes??0}const E=new Set(L.map(J=>J.date));let N=0,G=y;for(E.has(G)||(G=Kn(y,-1));E.has(G);)N++,G=Kn(G,-1);t.value={attendDays:ce.length,totalHours:(Q/60).toFixed(1),itemCount:L.length,streak:N};const de=new Map;for(const J of ce){const xe=J.location||"未记录";de.set(xe,(de.get(xe)||0)+1)}a.value=Array.from(de.entries()).map(J=>({name:J[0],count:J[1],percent:Math.round(J[1]/(ce.length||1)*100)})).sort((J,xe)=>xe.count-J.count);const ae=L.length||1;s.value=Us.map(J=>{const xe=L.filter(Ve=>Ve.category===J.key).length;return{key:J.key,label:J.label,count:xe,percent:Math.round(xe/ae*100)}}).filter(J=>J.count>0).sort((J,xe)=>xe.count-J.count);const Z=new Map(X.map(J=>[J.id,J.name])),$=new Map;for(const J of L){const xe=J.project_id?Z.get(J.project_id)||"已删除项目":"无项目";$.set(xe,($.get(xe)||0)+1)}o.value=Array.from($.entries()).map(J=>({name:J[0],count:J[1],percent:Math.round(J[1]/ae*100)})).sort((J,xe)=>xe.count-J.count);const x=new Map;for(const J of L)x.set(J.date,(x.get(J.date)||0)+1);const le=Es(y),ke=[];for(let J=11;J>=0;J--){const xe=Kn(le,-7*J),Ve=[];for(let nt=0;nt<7;nt++){const qe=Kn(xe,nt);Ve.push({date:qe,count:x.get(qe)||0})}ke.push(Ve)}n.value=ke}fn(async()=>{await c()}),gt(Hs,()=>{c()});function d(y){return y===0?0:y===1?1:y<=3?2:y<=5?3:4}function h(y,m){return y+" · "+(m?m+" 条":"无记录")}return(y,m)=>(K(),H("div",Cy,[u("div",Sy,[u("div",Ey,[m[0]||(m[0]=u("div",{class:"muted"},"出勤天数",-1)),u("div",$y,re(t.value.attendDays),1)]),u("div",Ay,[m[1]||(m[1]=u("div",{class:"muted"},"累计工时(小时)",-1)),u("div",Py,re(t.value.totalHours),1)]),u("div",Ty,[m[2]||(m[2]=u("div",{class:"muted"},"记录条数",-1)),u("div",Oy,re(t.value.itemCount),1)]),u("div",My,[m[3]||(m[3]=u("div",{class:"muted"},"连续记录(天)",-1)),u("div",Iy,re(t.value.streak),1)])]),u("div",jy,[m[4]||(m[4]=u("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),u("div",Dy,[(K(!0),H(Re,null,ut(n.value,(k,D)=>(K(),H("div",{key:D,class:"heat-col"},[(K(!0),H(Re,null,ut(k,T=>(K(),H("span",{key:T.date,class:et(["heat-cell","lv"+d(T.count)]),title:h(T.date,T.count)},null,10,Ry))),128))]))),128))]),m[5]||(m[5]=Dp('<div class="heat-legend muted" data-v-73e5ba49><span data-v-73e5ba49>少</span><span class="heat-cell lv0" data-v-73e5ba49></span><span class="heat-cell lv1" data-v-73e5ba49></span><span class="heat-cell lv2" data-v-73e5ba49></span><span class="heat-cell lv3" data-v-73e5ba49></span><span class="heat-cell lv4" data-v-73e5ba49></span><span data-v-73e5ba49>多</span></div>',1))]),u("div",Ly,[u("div",Ky,[m[6]||(m[6]=u("div",{class:"section-title"},"分类分布",-1)),(K(!0),H(Re,null,ut(s.value,k=>(K(),H("div",{key:k.key,class:"bar-row"},[u("span",Fy,re(k.label),1),u("span",Ny,[u("span",{class:"bar-fill",style:sr({width:k.percent+"%"})},null,4)]),u("span",Vy,re(k.count)+" 条 · "+re(k.percent)+"%",1)]))),128)),s.value.length?Se("",!0):(K(),H("div",By,"暂无数据"))]),u("div",Uy,[m[7]||(m[7]=u("div",{class:"section-title"},"项目投入",-1)),(K(!0),H(Re,null,ut(o.value,k=>(K(),H("div",{key:k.name,class:"bar-row"},[u("span",qy,re(k.name),1),u("span",Hy,[u("span",{class:"bar-fill",style:sr({width:k.percent+"%"})},null,4)]),u("span",Wy,re(k.count)+" 条 · "+re(k.percent)+"%",1)]))),128)),o.value.length?Se("",!0):(K(),H("div",zy,"暂无数据"))])]),u("div",Gy,[m[8]||(m[8]=u("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(K(!0),H(Re,null,ut(a.value,k=>(K(),H("div",{key:k.name,class:"bar-row"},[u("span",Yy,re(k.name),1),u("span",Jy,[u("span",{class:"bar-fill",style:sr({width:k.percent+"%"})},null,4)]),u("span",Xy,re(k.count)+" 天 · "+re(k.percent)+"%",1)]))),128)),a.value.length?Se("",!0):(K(),H("div",Qy,"暂无数据"))])]))}}),eg=Gt(Zy,[["__scopeId","data-v-73e5ba49"]]);async function tg(e,t,n){const s=xt(),o=await Promise.all([jr(),di(e,t),pi(e,t),Ks(!0),Iv(e,t)]),a=o[0],c=o[1],d=o[2],h=o[3],y=o[4];let m=0,k=0,D=0;for(const $ of c){($.clock_in_at||$.kind==="makeup")&&m++,$.kind==="makeup"&&D++;const x=qs($,$.date,a,$.date===s);k+=x.workedMinutes??0}const T=new Map;for(const $ of c){if(!($.clock_in_at||$.kind==="makeup"))continue;const x=$.location||"未记录";T.set(x,(T.get(x)||0)+1)}const L=Array.from(T.entries()).map($=>({name:$[0],count:$[1]})).sort(($,x)=>x.count-$.count),X=d.length||1,ce=Us.map($=>{const x=d.filter(le=>le.category===$.key).length;return{key:$.key,label:$.label,count:x,percent:Math.round(x/X*100)}}).filter($=>$.count>0).sort(($,x)=>x.count-$.count),Q=new Map(h.map($=>[$.id,$.name])),E=new Map;for(const $ of d){const x=$.project_id?Q.get($.project_id)||"已删除项目":"无项目";E.set(x,(E.get(x)||0)+1)}const N=Array.from(E.entries()).map($=>({name:$[0],count:$[1]})).sort(($,x)=>x.count-$.count),G=d.filter($=>$.is_milestone===1).map($=>({date:$.date,content:$.content})),de=d.filter($=>$.needs_followup===1).map($=>({date:$.date,content:$.content,remark:$.remark||""})),ae=d.filter($=>!!$.takeaway).map($=>({date:$.date,text:$.takeaway})),Z=y.map($=>({weekStart:$.week_start,highlights:$.highlights||"",challenges:$.challenges||"",plan_next:$.plan_next||""}));return{range:{start:e,end:t,label:n},attendDays:m,totalHours:(k/60).toFixed(1),makeupCount:D,leaveCount:c.filter($=>$.kind==="leave").length,itemCount:d.length,categoryStats:ce,projectStats:N,locationStats:L,milestones:G,followups:de,takeaways:ae,weekNotes:Z}}function ng(e){const t=[];t.push("# 实习工作总结("+e.range.start+" ~ "+e.range.end+")"),t.push(""),t.push("## 一、考勤概况"),t.push(""),t.push("出勤 "+e.attendDays+" 天,累计工时 "+e.totalHours+" 小时,补卡 "+e.makeupCount+" 次"+(e.leaveCount?",请假 "+e.leaveCount+" 天":""));const n=e.locationStats.filter(s=>s.name!=="未记录");n.length&&t.push("其中:"+n.map(s=>s.name+" "+s.count+" 天").join(",")),t.push(""),t.push("## 二、工作内容分布"),t.push(""),t.push(e.categoryStats.length?e.categoryStats.map(s=>s.label+" "+s.percent+"%("+s.count+" 条)").join(","):"(无记录)"),t.push(""),t.push("## 三、项目投入"),t.push(""),t.push(e.projectStats.length?e.projectStats.map(s=>s.name+" "+s.count+" 条").join(","):"(无记录)"),t.push(""),t.push("## 四、主要成果"),t.push(""),e.milestones.length?e.milestones.forEach((s,o)=>t.push(o+1+". 【成果】"+s.content+"("+s.date+")")):t.push("(无)"),t.push(""),t.push("## 五、待跟进事项"),t.push(""),e.followups.length?e.followups.forEach(s=>t.push("- 【待跟进】"+s.content+(s.remark?"("+s.date+" 备注:"+s.remark+")":"("+s.date+")"))):t.push("(无)"),t.push(""),t.push("## 六、学习与成长"),t.push(""),e.takeaways.length?e.takeaways.forEach(s=>t.push("- "+s.text+"("+s.date+")")):t.push("(无)");for(const s of e.weekNotes)t.push(""),t.push("### 周记("+s.weekStart+" 起)"),t.push(""),t.push("- 本周亮点:"+(s.highlights||"(无)")),t.push("- 踩的坑:"+(s.challenges||"(无)")),t.push("- 下周计划:"+(s.plan_next||"(无)"));return t.push(""),t.join(`
`)}const rg="modulepreload",sg=function(e,t){return new URL(e,t).href},Tu={},cf=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=Promise.allSettled(n.map(y=>{if(y=sg(y,s),y in Tu)return;Tu[y]=!0;const m=y.endsWith(".css"),k=m?'[rel="stylesheet"]':"";if(!!s)for(let L=c.length-1;L>=0;L--){const X=c[L];if(X.href===y&&(!m||X.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${k}`))return;const T=document.createElement("link");if(T.rel=m?"stylesheet":rg,m||(T.as="script"),T.crossOrigin="",T.href=y,h&&T.setAttribute("nonce",h),document.head.appendChild(T),m)return new Promise((L,X)=>{T.addEventListener("load",L),T.addEventListener("error",()=>X(new Error(`Unable to preload CSS for ${y}`)))})}))}function a(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return o.then(c=>{for(const d of c||[])d.status==="rejected"&&a(d.reason);return t().catch(a)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const og=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},s=(a,c)=>{n.platforms.set(a,c)},o=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))};return n.addPlatform=s,n.setPlatform=o,n},ig=e=>e.CapacitorPlatforms=og(e),ff=ig(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});ff.addPlatform;ff.setPlatform;var Qr;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Qr||(Qr={}));class ua extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const ag=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"},lg=e=>{var t,n,s,o,a;const c=e.CapacitorCustomPlatform||null,d=e.Capacitor||{},h=d.Plugins=d.Plugins||{},y=e.CapacitorPlatforms,m=()=>c!==null?c.name:ag(e),k=((t=y==null?void 0:y.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||m,D=()=>k()!=="web",T=((n=y==null?void 0:y.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||D,L=Z=>{const $=G.get(Z);return!!($!=null&&$.platforms.has(k())||Q(Z))},X=((s=y==null?void 0:y.currentPlatform)===null||s===void 0?void 0:s.isPluginAvailable)||L,ce=Z=>{var $;return($=d.PluginHeaders)===null||$===void 0?void 0:$.find(x=>x.name===Z)},Q=((o=y==null?void 0:y.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||ce,E=Z=>e.console.error(Z),N=(Z,$,x)=>Promise.reject(`${x} does not have an implementation of "${$}".`),G=new Map,de=(Z,$={})=>{const x=G.get(Z);if(x)return console.warn(`Capacitor plugin "${Z}" already registered. Cannot register plugins twice.`),x.proxy;const le=k(),ke=Q(Z);let J;const xe=async()=>(!J&&le in $?J=typeof $[le]=="function"?J=await $[le]():J=$[le]:c!==null&&!J&&"web"in $&&(J=typeof $.web=="function"?J=await $.web():J=$.web),J),Ve=(Fe,je)=>{var ne,F;if(ke){const fe=ke==null?void 0:ke.methods.find(Ke=>je===Ke.name);if(fe)return fe.rtype==="promise"?Ke=>d.nativePromise(Z,je.toString(),Ke):(Ke,ct)=>d.nativeCallback(Z,je.toString(),Ke,ct);if(Fe)return(ne=Fe[je])===null||ne===void 0?void 0:ne.bind(Fe)}else{if(Fe)return(F=Fe[je])===null||F===void 0?void 0:F.bind(Fe);throw new ua(`"${Z}" plugin is not implemented on ${le}`,Qr.Unimplemented)}},nt=Fe=>{let je;const ne=(...F)=>{const fe=xe().then(Ke=>{const ct=Ve(Ke,Fe);if(ct){const ht=ct(...F);return je=ht==null?void 0:ht.remove,ht}else throw new ua(`"${Z}.${Fe}()" is not implemented on ${le}`,Qr.Unimplemented)});return Fe==="addListener"&&(fe.remove=async()=>je()),fe};return ne.toString=()=>`${Fe.toString()}() { [capacitor code] }`,Object.defineProperty(ne,"name",{value:Fe,writable:!1,configurable:!1}),ne},qe=nt("addListener"),He=nt("removeListener"),ge=(Fe,je)=>{const ne=qe({eventName:Fe},je),F=async()=>{const Ke=await ne;He({eventName:Fe,callbackId:Ke},je)},fe=new Promise(Ke=>ne.then(()=>Ke({remove:F})));return fe.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await F()},fe},Oe=new Proxy({},{get(Fe,je){switch(je){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return ke?ge:qe;case"removeListener":return He;default:return nt(je)}}});return h[Z]=Oe,G.set(Z,{name:Z,proxy:Oe,platforms:new Set([...Object.keys($),...ke?[le]:[]])}),Oe},ae=((a=y==null?void 0:y.currentPlatform)===null||a===void 0?void 0:a.registerPlugin)||de;return d.convertFileSrc||(d.convertFileSrc=Z=>Z),d.getPlatform=k,d.handleError=E,d.isNativePlatform=T,d.isPluginAvailable=X,d.pluginMethodNoop=N,d.registerPlugin=ae,d.Exception=ua,d.DEBUG=!!d.DEBUG,d.isLoggingEnabled=!!d.isLoggingEnabled,d.platform=d.getPlatform(),d.isNative=d.isNativePlatform(),d},ug=e=>e.Capacitor=lg(e),Zr=ug(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),df=Zr.registerPlugin;Zr.Plugins;class pf{constructor(t){this.listeners={},this.retainedEventArguments={},this.windowListeners={},t&&(console.warn(`Capacitor WebPlugin "${t.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=t)}addListener(t,n){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),s&&this.sendRetainedArgumentsForEvent(t);const c=async()=>this.removeListener(t,n);return Promise.resolve({remove:c})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,s){const o=this.listeners[t];if(!o){if(s){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}o.forEach(a=>a(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:s=>{this.notifyListeners(n,s)}}}unimplemented(t="not implemented"){return new Zr.Exception(t,Qr.Unimplemented)}unavailable(t="not available"){return new Zr.Exception(t,Qr.Unavailable)}async removeListener(t,n){const s=this.listeners[t];if(!s)return;const o=s.indexOf(n);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(s=>{this.notifyListeners(t,s)}))}}const Ou=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Mu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class cg extends pf{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[o,a]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=Mu(o).trim(),a=Mu(a).trim(),n[o]=a}),n}async setCookie(t){try{const n=Ou(t.key),s=Ou(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,a=(t.path||"/").replace("path=",""),c=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${s||""}${o}; path=${a}; ${c};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}df("CapacitorCookies",{web:()=>new cg});const fg=async e=>new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const o=s.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},s.onerror=o=>n(o),s.readAsDataURL(e)}),dg=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,a,c)=>(o[a]=e[t[c]],o),{})},pg=(e,t=!0)=>e?Object.entries(e).reduce((s,o)=>{const[a,c]=o;let d,h;return Array.isArray(c)?(h="",c.forEach(y=>{d=t?encodeURIComponent(y):y,h+=`${a}=${d}&`}),h.slice(0,-1)):(d=t?encodeURIComponent(c):c,h=`${a}=${d}`),`${s}&${h}`},"").substr(1):null,hg=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=dg(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[c,d]of Object.entries(e.data||{}))a.set(c,d);n.body=a.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((d,h)=>{a.append(h,d)});else for(const d of Object.keys(e.data))a.append(d,e.data[d]);n.body=a;const c=new Headers(n.headers);c.delete("content-type"),n.headers=c}else(o.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class vg extends pf{async request(t){const n=hg(t,t.webFetchExtra),s=pg(t.params,t.shouldEncodeUrlParams),o=s?`${t.url}?${s}`:t.url,a=await fetch(o,n),c=a.headers.get("content-type")||"";let{responseType:d="text"}=a.ok?t:{};c.includes("application/json")&&(d="json");let h,y;switch(d){case"arraybuffer":case"blob":y=await a.blob(),h=await fg(y);break;case"json":h=await a.json();break;case"document":case"text":default:h=await a.text()}const m={};return a.headers.forEach((k,D)=>{m[D]=k}),{data:h,headers:m,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}df("CapacitorHttp",{web:()=>new vg});async function tl(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(Zr.isNativePlatform()){const{Filesystem:c,Directory:d,Encoding:h}=await cf(async()=>{const{Filesystem:y,Directory:m,Encoding:k}=await import("./index-mjAVYvQ7.js");return{Filesystem:y,Directory:m,Encoding:k}},[],import.meta.url);try{return(await c.writeFile({path:e,data:t,directory:d.Documents,encoding:h.UTF8,recursive:!0})).uri}catch{return(await c.writeFile({path:e,data:t,directory:d.Cache,encoding:h.UTF8,recursive:!0})).uri}}const s=new Blob([t],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(s),a=document.createElement("a");return a.href=o,a.download=e,a.click(),window.setTimeout(()=>URL.revokeObjectURL(o),1e4),""}const mg=Object.freeze(Object.defineProperty({__proto__:null,downloadText:tl},Symbol.toStringTag,{value:"Module"}));async function Pa(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 yg(e){const t=await Promise.all([yt("ai_base_url",""),yt("ai_api_key",""),yt("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),s=t[1].trim(),o=t[2].trim();if(!n||!o)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const a=n+"/chat/completions",c={"Content-Type":"application/json"};s&&(c.Authorization="Bearer "+s);const h=JSON.stringify({model:o,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let y;try{y=await fetch(a,{method:"POST",headers:c,body:h})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!y.ok){let D="接口返回 "+y.status;try{const T=await y.json();T&&T.error&&T.error.message&&(D+=":"+T.error.message)}catch{}throw new Error(D)}const m=await y.json(),k=m&&m.choices&&m.choices[0]&&m.choices[0].message&&m.choices[0].message.content;if(!k)throw new Error("接口未返回内容");return String(k)}const gg={class:"report"},bg={class:"report-toolbar"},wg={class:"seg"},_g=["onClick"],kg=["disabled"],xg=["disabled"],Cg={key:0,class:"ai-error"},Sg={class:"report-grid"},Eg={class:"report-left"},$g={class:"card section"},Ag={class:"section-title"},Pg={class:"muted note-saved"},Tg={class:"card section"},Og={class:"report-right"},Mg={key:0,class:"card section"},Ig={class:"sum-row"},jg={class:"num"},Dg={class:"sum-row"},Rg={class:"num"},Lg={class:"sum-row"},Kg={class:"num"},Fg={class:"sum-row"},Ng={class:"num"},Vg={class:"sum-row"},Bg={class:"num"},Ug={class:"muted"},qg={class:"num"},Hg={key:0,class:"muted sum-empty"},Wg={class:"muted"},zg={key:1,class:"muted sum-empty"},Gg={class:"muted"},Yg={key:2,class:"muted sum-empty"},Jg={class:"muted"},Xg={key:3,class:"muted sum-empty"},Qg=Vt({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=V("week"),s=V(Es(xt())),o=V(xt()),a=V(null),c=V(""),d=V(!1),h=V(!1),y=V(null),m=V(""),k=V(Es(xt())),D=V(""),T=V(""),L=V(""),X=V(!1);async function ce(){const $=await el(k.value);D.value=($==null?void 0:$.highlights)||"",T.value=($==null?void 0:$.challenges)||"",L.value=($==null?void 0:$.plan_next)||"",X.value=!1}async function Q(){await Mv(k.value,{highlights:D.value.trim()||null,challenges:T.value.trim()||null,plan_next:L.value.trim()||null}),X.value=!0,await N()}function E($){const x=xt();if($==="week"){const le=Es(x);return{start:le,end:Kn(le,6),label:"本周"}}if($==="month"){const le=x.slice(0,7);return{start:le+"-01",end:x,label:le+" 本月"}}return $==="all"?{start:"2000-01-01",end:x,label:"全部实习期"}:{start:s.value,end:o.value,label:s.value+" ~ "+o.value}}async function N(){d.value=!0;const $=E(n.value),x=await tg($.start,$.end,$.label);a.value=x,c.value=ng(x),d.value=!1}gt(n,N),gt([s,o],()=>{n.value==="custom"&&N()}),fn(async()=>{await ce(),await N()});async function G(){const $=xt().replace(/-/g,""),x=await tl("实习工作总结_"+$+".md",c.value);We(x?"总结已导出到:"+x:"总结已导出到系统下载目录")}async function de(){await Pa(c.value),We("总结已复制到剪贴板")}async function ae(){if(h.value)return;m.value="";const $=c.value.trim();if(!$){m.value="当前草稿为空,无法润色";return}h.value=!0;try{y.value=c.value,c.value=await yg($),We("AI 润色完成")}catch(x){y.value=null,m.value=x instanceof Error?x.message:"润色失败"}h.value=!1}function Z(){y.value!==null&&(c.value=y.value),y.value=null}return($,x)=>(K(),H("div",gg,[u("div",bg,[u("div",wg,[(K(),H(Re,null,ut(t,le=>u("button",{key:le.key,class:et(["seg-btn",{active:n.value===le.key}]),onClick:ke=>n.value=le.key},re(le.label),11,_g)),64))]),n.value==="custom"?(K(),H(Re,{key:0},[Ee(u("input",{type:"date",class:"input w-date","onUpdate:modelValue":x[0]||(x[0]=le=>s.value=le)},null,512),[[De,s.value]]),x[6]||(x[6]=u("span",{class:"muted"},"至",-1)),Ee(u("input",{type:"date",class:"input w-date","onUpdate:modelValue":x[1]||(x[1]=le=>o.value=le)},null,512),[[De,o.value]])],64)):Se("",!0),x[10]||(x[10]=u("span",{class:"flex1"},null,-1)),u("button",{class:"btn btn-sm",disabled:h.value,onClick:ae},[Te(lt,{name:"edit",size:14}),x[7]||(x[7]=nn("AI 润色 ",-1))],8,kg),y.value!==null?(K(),H("button",{key:1,class:"btn btn-sm",onClick:Z},"还原润色前")):Se("",!0),u("button",{class:"btn btn-sm",disabled:d.value,onClick:N},[Te(lt,{name:"edit",size:14}),x[8]||(x[8]=nn("重新生成 ",-1))],8,xg),u("button",{class:"btn btn-sm",onClick:de},"复制"),u("button",{class:"btn btn-primary btn-sm",onClick:G},[Te(lt,{name:"export",size:14}),x[9]||(x[9]=nn("导出 Markdown ",-1))])]),m.value?(K(),H("div",Cg,re(m.value),1)):Se("",!0),u("div",Sg,[u("div",Eg,[u("div",$g,[u("div",Ag,"本周周记("+re(k.value)+" 起)",1),x[11]||(x[11]=u("label",{class:"note-label muted"},"本周亮点",-1)),Ee(u("textarea",{class:"textarea","onUpdate:modelValue":x[2]||(x[2]=le=>D.value=le),placeholder:"本周最有价值的一件事",onBlur:Q},null,544),[[De,D.value]]),x[12]||(x[12]=u("label",{class:"note-label muted"},"踩的坑",-1)),Ee(u("textarea",{class:"textarea","onUpdate:modelValue":x[3]||(x[3]=le=>T.value=le),placeholder:"遇到的问题与教训",onBlur:Q},null,544),[[De,T.value]]),x[13]||(x[13]=u("label",{class:"note-label muted"},"下周计划",-1)),Ee(u("textarea",{class:"textarea","onUpdate:modelValue":x[4]||(x[4]=le=>L.value=le),placeholder:"下周准备做什么",onBlur:Q},null,544),[[De,L.value]]),u("div",Pg,re(X.value?"已保存":"失焦自动保存"),1)]),u("div",Tg,[x[14]||(x[14]=u("div",{class:"section-title"},"总结草稿(可编辑)",-1)),Ee(u("textarea",{class:"textarea md-editor","onUpdate:modelValue":x[5]||(x[5]=le=>c.value=le),spellcheck:"false"},null,512),[[De,c.value]])])]),u("div",Og,[a.value?(K(),H("div",Mg,[x[20]||(x[20]=u("div",{class:"section-title"},"数据摘要",-1)),u("div",Ig,[x[15]||(x[15]=u("span",{class:"muted"},"出勤",-1)),u("span",jg,re(a.value.attendDays)+" 天",1)]),u("div",Dg,[x[16]||(x[16]=u("span",{class:"muted"},"工时",-1)),u("span",Rg,re(a.value.totalHours)+" 小时",1)]),u("div",Lg,[x[17]||(x[17]=u("span",{class:"muted"},"补卡",-1)),u("span",Kg,re(a.value.makeupCount)+" 次",1)]),u("div",Fg,[x[18]||(x[18]=u("span",{class:"muted"},"请假",-1)),u("span",Ng,re(a.value.leaveCount)+" 天",1)]),u("div",Vg,[x[19]||(x[19]=u("span",{class:"muted"},"记录",-1)),u("span",Bg,re(a.value.itemCount)+" 条",1)]),x[21]||(x[21]=u("div",{class:"section-sub"},"分类分布",-1)),(K(!0),H(Re,null,ut(a.value.categoryStats,le=>(K(),H("div",{key:le.key,class:"sum-row"},[u("span",Ug,re(le.label),1),u("span",qg,re(le.count)+" 条 · "+re(le.percent)+"%",1)]))),128)),a.value.categoryStats.length?Se("",!0):(K(),H("div",Hg,"(无)")),x[22]||(x[22]=u("div",{class:"section-sub"},"主要成果",-1)),(K(!0),H(Re,null,ut(a.value.milestones,(le,ke)=>(K(),H("div",{key:"m"+ke,class:"sum-item"},[nn(re(le.content),1),u("span",Wg,"("+re(le.date)+")",1)]))),128)),a.value.milestones.length?Se("",!0):(K(),H("div",zg,"(无)")),x[23]||(x[23]=u("div",{class:"section-sub"},"待跟进",-1)),(K(!0),H(Re,null,ut(a.value.followups,(le,ke)=>(K(),H("div",{key:"f"+ke,class:"sum-item"},[nn(re(le.content),1),u("span",Gg,"("+re(le.date)+")",1)]))),128)),a.value.followups.length?Se("",!0):(K(),H("div",Yg,"(无)")),x[24]||(x[24]=u("div",{class:"section-sub"},"学习与成长",-1)),(K(!0),H(Re,null,ut(a.value.takeaways,(le,ke)=>(K(),H("div",{key:"t"+ke,class:"sum-item"},[nn(re(le.text),1),u("span",Jg,"("+re(le.date)+")",1)]))),128)),a.value.takeaways.length?Se("",!0):(K(),H("div",Xg,"(无)"))])):Se("",!0)])])]))}}),Zg=Gt(Qg,[["__scopeId","data-v-43f9c59b"]]),eb=["aria-label"],tb={class:"dialog-head"},nb={class:"dialog-title"},rb={class:"dialog-body"},sb={class:"form-grid"},ob={class:"field span2"},ib={class:"seg"},ab={class:"field"},lb={class:"field"},ub={class:"field"},cb=["value"],fb={key:0,class:"field"},db={class:"seg"},pb={class:"field span2"},hb={key:0,class:"form-error"},vb={class:"dialog-btns"},mb=Vt({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=V("expense"),a=V("餐饮"),c=V(""),d=V(""),h=V(""),y=V(!1),m=V(!1),k=V(""),D=V(null);function T(Q){n.open&&Q.key==="Escape"&&s("cancel")}gt(()=>n.open,async Q=>{var E;Q?(o.value=n.initial.type==="income"?"income":"expense",a.value=n.initial.category,c.value=n.initial.amountYuan,d.value=n.initial.date,h.value=n.initial.note,y.value=n.initial.reimbursable===1,m.value=n.initial.reimbursed===1,k.value="",window.addEventListener("keydown",T),await ts(),(E=D.value)==null||E.focus()):window.removeEventListener("keydown",T)}),dr(()=>window.removeEventListener("keydown",T)),gt(o,Q=>{a.value=Q==="expense"?Wr[0]:Bo[0]});const L=it(()=>o.value==="expense"?Wr:Bo);function X(){return a.value&&L.value.includes(a.value)?a.value:L.value[0]}function ce(){const Q=Number(c.value);if(!c.value.trim()||!isFinite(Q)||Q<=0){k.value="请填写大于 0 的金额";return}if(!d.value){k.value="请选择日期";return}const E=o.value==="expense"&&y.value?1:0;s("save",{type:o.value,category:X(),amount:Math.round(Q*100),date:d.value,note:h.value.trim(),reimbursable:E,reimbursed:E&&m.value?1:0})}return(Q,E)=>(K(),It(Vs,{to:"body"},[Te(ns,{name:"modal"},{default:fr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:E[11]||(E[11]=Mr(N=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",tb,[u("span",nb,re(e.title),1),u("button",{class:"icon-btn",title:"关闭",onClick:E[0]||(E[0]=N=>s("cancel"))},[Te(lt,{name:"close",size:16})])]),u("div",rb,[u("div",sb,[u("div",ob,[E[12]||(E[12]=u("label",null,"类型",-1)),u("div",ib,[u("button",{class:et(["seg-btn",{active:o.value==="expense"}]),onClick:E[1]||(E[1]=N=>o.value="expense")},"支出",2),u("button",{class:et(["seg-btn",{active:o.value==="income"}]),onClick:E[2]||(E[2]=N=>o.value="income")},"收入",2)])]),u("div",ab,[E[13]||(E[13]=u("label",null,"金额(元,必填)",-1)),Ee(u("input",{ref_key:"amountInput",ref:D,class:et(["input",{invalid:k.value}]),"onUpdate:modelValue":E[3]||(E[3]=N=>c.value=N),type:"number",min:"0",step:"0.01",placeholder:"0.00"},null,2),[[De,c.value]])]),u("div",lb,[E[14]||(E[14]=u("label",null,"日期(必填)",-1)),Ee(u("input",{class:"input",type:"date","onUpdate:modelValue":E[4]||(E[4]=N=>d.value=N)},null,512),[[De,d.value]])]),u("div",ub,[E[15]||(E[15]=u("label",null,"分类",-1)),Ee(u("select",{class:"select","onUpdate:modelValue":E[5]||(E[5]=N=>a.value=N)},[(K(!0),H(Re,null,ut(L.value,N=>(K(),H("option",{key:N,value:N},re(N),9,cb))),128))],512),[[Fn,a.value]])]),o.value==="expense"?(K(),H("div",fb,[E[16]||(E[16]=u("label",null,"报销状态",-1)),u("div",db,[u("button",{class:et(["seg-btn",{active:!y.value}]),onClick:E[6]||(E[6]=N=>{y.value=!1,m.value=!1})},"无需报销",2),u("button",{class:et(["seg-btn",{active:y.value&&!m.value}]),onClick:E[7]||(E[7]=N=>{y.value=!0,m.value=!1})},"待报销",2),u("button",{class:et(["seg-btn",{active:y.value&&m.value}]),onClick:E[8]||(E[8]=N=>{y.value=!0,m.value=!0})},"已报销",2)])])):Se("",!0),u("div",pb,[E[17]||(E[17]=u("label",null,"备注",-1)),Ee(u("textarea",{class:"textarea","onUpdate:modelValue":E[9]||(E[9]=N=>h.value=N),placeholder:"选填"},null,512),[[De,h.value]])])]),k.value?(K(),H("div",hb,re(k.value),1)):Se("",!0)]),u("div",vb,[u("button",{class:"btn btn-sm",onClick:E[10]||(E[10]=N=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:ce},"保存")])],8,eb)])):Se("",!0)]),_:1})]))}}),yb=Gt(mb,[["__scopeId","data-v-e3568c0d"]]),gb={class:"ledger-page"},bb={class:"ledger-toolbar"},wb={class:"month-title num"},_b={class:"cards"},kb={class:"card stat-card"},xb={class:"stat-num num amt-income"},Cb={class:"card stat-card"},Sb={class:"stat-num num"},Eb={class:"card stat-card"},$b={class:"card stat-card"},Ab={class:"stat-num num amt-warn"},Pb={class:"card sec"},Tb={class:"form-grid"},Ob={class:"field span2"},Mb={class:"seg"},Ib={class:"field"},jb={class:"field"},Db={class:"field"},Rb=["value"],Lb={key:0,class:"field"},Kb={class:"field span2"},Fb={key:0,class:"form-error"},Nb={class:"form-footer"},Vb=["disabled"],Bb=["disabled"],Ub={key:0,class:"card sec"},qb={class:"bar-label"},Hb={class:"bar-track"},Wb={class:"muted num bar-num"},zb={key:1,class:"card section"},Gb={class:"form-error"},Yb={class:"card table-card"},Jb={class:"tx-table"},Xb={class:"num"},Qb={class:"tag"},Zb={class:"td-note"},ew={key:0,class:"muted"},tw={key:1,class:"tx-done"},nw={key:2,class:"tx-pending"},rw={class:"ops"},sw=["onClick"],ow=["onClick"],iw=["onClick"],aw={key:0},lw={class:"muted vault-note num"},uw=Vt({__name:"LedgerView",setup(e){const t=V(xt()),n=V([]),s=V(!0),o=V("expense"),a=V(""),c=V(Wr[0]),d=V(xt()),h=V(""),y=V(!1),m=V(""),k=V(""),D=V(!1),T=V(!1),L=V(null),X=V({type:"expense",category:Wr[0],amountYuan:"",date:xt(),note:"",reimbursable:0,reimbursed:0}),ce=V(null),Q=it(()=>t.value.slice(0,7)+"-01"),E=it(()=>{const ne=Number(t.value.slice(0,4)),F=Number(t.value.slice(5,7))-1,fe=new Date(ne,F+1,0).getDate();return t.value.slice(0,7)+"-"+(fe<10?"0"+fe:String(fe))}),N=it(()=>Number(t.value.slice(0,4))+" 年 "+Number(t.value.slice(5,7))+" 月");async function G(){s.value=!0;try{n.value=await Nv(Q.value,E.value),k.value=""}catch(ne){k.value="账目加载失败:"+(ne instanceof Error?ne.stack||ne.message:String(ne)),We("账目加载失败")}s.value=!1}fn(G),gt(t,G),gt(o,ne=>{c.value=ne==="expense"?Wr[0]:Bo[0]});const de=it(()=>n.value.slice().sort((ne,F)=>ne.date===F.date?F.id-ne.id:ne.date<F.date?1:-1)),ae=it(()=>{let ne=0,F=0,fe=0;for(const Ke of n.value)Ke.type==="income"?ne+=Ke.amount:(F+=Ke.amount,Ke.reimbursable===1&&Ke.reimbursed!==1&&(fe+=Ke.amount));return{income:ne,expense:F,pending:fe,balance:ne-F}}),Z=V("all"),$=V("all"),x=it(()=>de.value.filter(ne=>!(Z.value!=="all"&&ne.type!==Z.value||$.value==="pending"&&!(ne.type==="expense"&&ne.reimbursable===1&&ne.reimbursed!==1)||$.value==="done"&&!(ne.reimbursable===1&&ne.reimbursed===1)))),le=it(()=>{const ne=new Map;let F=0;for(const Ke of n.value)Ke.type==="expense"&&(ne.set(Ke.category,(ne.get(Ke.category)||0)+Ke.amount),F+=Ke.amount);const fe=F||1;return Array.from(ne.entries()).map(Ke=>({name:Ke[0],amount:Ke[1],percent:Math.round(Ke[1]/fe*100)})).sort((Ke,ct)=>ct.amount-Ke.amount)});function ke(ne){return(ne/100).toFixed(2)}function J(ne){return(ne.type==="income"?"+":"-")+ke(ne.amount)}function xe(){t.value=Uo(t.value,-1)}function Ve(){t.value=Uo(t.value,1)}function nt(){t.value=xt()}gt(a,()=>{m.value&&(m.value="")});async function qe(){const ne=Number(a.value);if(!a.value.trim()||!isFinite(ne)||ne<=0){m.value="请填写大于 0 的金额";return}if(!d.value){m.value="请选择日期";return}if(!D.value){D.value=!0;try{await Vv({type:o.value,category:c.value,amount:Math.round(ne*100),date:d.value,note:h.value.trim(),reimbursable:o.value==="expense"&&y.value?1:0,reimbursed:0})}catch(F){We("添加失败:"+(F instanceof Error?F.message:String(F))),D.value=!1;return}a.value="",h.value="",y.value=!1,m.value="",await G(),We("记账已添加"),D.value=!1}}function He(){a.value="",h.value="",y.value=!1,m.value=""}async function ge(ne){await qv(ne.id),await G(),We("已标记为已报销")}function Oe(ne){L.value=ne.id,X.value={type:ne.type,category:ne.category,amountYuan:ke(ne.amount),date:ne.date,note:ne.note||"",reimbursable:ne.reimbursable,reimbursed:ne.reimbursed},T.value=!0}async function Fe(ne){const F=L.value;await Bv(F,ne),T.value=!1,await G(),We("账目已更新")}async function je(){ce.value&&ce.value.id&&await Uv(ce.value.id),ce.value=null,await G(),We("账目已删除")}return(ne,F)=>(K(),H("div",gb,[u("div",bb,[u("button",{class:"icon-btn",onClick:xe},[Te(lt,{name:"chevron-left",size:16})]),u("span",wb,re(N.value),1),u("button",{class:"icon-btn",onClick:Ve},[Te(lt,{name:"chevron-right",size:16})]),u("button",{class:"btn btn-sm",onClick:nt},"回到本月"),F[13]||(F[13]=u("span",{class:"flex1"},null,-1)),Ee(u("select",{class:"select w-filter","onUpdate:modelValue":F[0]||(F[0]=fe=>Z.value=fe)},[...F[11]||(F[11]=[u("option",{value:"all"},"全部类型",-1),u("option",{value:"expense"},"仅支出",-1),u("option",{value:"income"},"仅收入",-1)])],512),[[Fn,Z.value]]),Ee(u("select",{class:"select w-filter","onUpdate:modelValue":F[1]||(F[1]=fe=>$.value=fe)},[...F[12]||(F[12]=[u("option",{value:"all"},"全部报销",-1),u("option",{value:"pending"},"待报销",-1),u("option",{value:"done"},"已报销",-1)])],512),[[Fn,$.value]])]),u("div",_b,[u("div",kb,[F[14]||(F[14]=u("div",{class:"muted"},"本月收入(元)",-1)),u("div",xb,re(ke(ae.value.income)),1)]),u("div",Cb,[F[15]||(F[15]=u("div",{class:"muted"},"本月支出(元)",-1)),u("div",Sb,re(ke(ae.value.expense)),1)]),u("div",Eb,[F[16]||(F[16]=u("div",{class:"muted"},"本月结余(元)",-1)),u("div",{class:et(["stat-num num",{"amt-income":ae.value.balance>=0,"amt-expense":ae.value.balance<0}])},re(ke(ae.value.balance)),3)]),u("div",$b,[F[17]||(F[17]=u("div",{class:"muted"},"待报销(元)",-1)),u("div",Ab,re(ke(ae.value.pending)),1)])]),u("div",Pb,[F[24]||(F[24]=u("div",{class:"sec-head"},[u("span",{class:"sec-title"},"新增一笔"),u("span",{class:"muted form-hint"},"金额必填,回车快速添加")],-1)),u("div",Tb,[u("div",Ob,[F[18]||(F[18]=u("label",null,"类型",-1)),u("div",Mb,[u("button",{class:et(["seg-btn",{active:o.value==="expense"}]),onClick:F[2]||(F[2]=fe=>o.value="expense")},"支出",2),u("button",{class:et(["seg-btn",{active:o.value==="income"}]),onClick:F[3]||(F[3]=fe=>o.value="income")},"收入",2)])]),u("div",Ib,[F[19]||(F[19]=u("label",null,"金额(元,必填)",-1)),Ee(u("input",{class:et(["input",{invalid:m.value}]),"onUpdate:modelValue":F[4]||(F[4]=fe=>a.value=fe),type:"number",min:"0",step:"0.01",placeholder:"0.00",onKeydown:jt(qe,["enter"])},null,34),[[De,a.value]])]),u("div",jb,[F[20]||(F[20]=u("label",null,"日期",-1)),Ee(u("input",{class:"input",type:"date","onUpdate:modelValue":F[5]||(F[5]=fe=>d.value=fe)},null,512),[[De,d.value]])]),u("div",Db,[F[21]||(F[21]=u("label",null,"分类",-1)),Ee(u("select",{class:"select","onUpdate:modelValue":F[6]||(F[6]=fe=>c.value=fe)},[(K(!0),H(Re,null,ut(o.value==="expense"?Qt(Wr):Qt(Bo),fe=>(K(),H("option",{key:fe,value:fe},re(fe),9,Rb))),128))],512),[[Fn,c.value]])]),o.value==="expense"?(K(),H("div",Lb,[F[22]||(F[22]=u("label",null,"报销",-1)),u("button",{class:et(["toggle-btn",{on:y.value}]),onClick:F[7]||(F[7]=fe=>y.value=!y.value)},re(y.value?"需要报销":"无需报销"),3)])):Se("",!0),u("div",Kb,[F[23]||(F[23]=u("label",null,"备注",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":F[8]||(F[8]=fe=>h.value=fe),placeholder:"选填,如:客户现场午餐",onKeydown:jt(qe,["enter"])},null,544),[[De,h.value]])])]),m.value?(K(),H("div",Fb,re(m.value),1)):Se("",!0),u("div",Nb,[u("button",{class:"btn btn-sm",disabled:!(a.value.trim()||h.value.trim()),onClick:He},"重置",8,Vb),u("button",{class:"btn btn-primary btn-sm",disabled:D.value,onClick:qe},"添加记录",8,Bb)])]),le.value.length?(K(),H("div",Ub,[F[25]||(F[25]=u("div",{class:"sec-title"},"本月支出分类",-1)),(K(!0),H(Re,null,ut(le.value,fe=>(K(),H("div",{key:fe.name,class:"bar-row"},[u("span",qb,re(fe.name),1),u("span",Hb,[u("span",{class:"bar-fill",style:sr({width:fe.percent+"%"})},null,4)]),u("span",Wb,re(ke(fe.amount))+" 元 · "+re(fe.percent)+"%",1)]))),128))])):Se("",!0),k.value?(K(),H("div",zb,[u("div",Gb,re(k.value),1),F[26]||(F[26]=u("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):Se("",!0),u("div",Yb,[u("table",Jb,[F[28]||(F[28]=u("thead",null,[u("tr",null,[u("th",null,"日期"),u("th",null,"分类"),u("th",null,"金额(元)"),u("th",null,"备注"),u("th",null,"报销"),u("th",{class:"th-ops"},"操作")])],-1)),u("tbody",null,[(K(!0),H(Re,null,ut(x.value,fe=>(K(),H("tr",{key:fe.id},[u("td",Xb,re(fe.date),1),u("td",null,[u("span",Qb,re(fe.category),1)]),u("td",{class:et(["num",fe.type==="income"?"amt-income":"amt-expense"])},re(J(fe)),3),u("td",Zb,re(fe.note||"--"),1),u("td",null,[fe.type!=="expense"||fe.reimbursable!==1?(K(),H("span",ew,"--")):fe.reimbursed===1?(K(),H("span",tw,"已报销")):(K(),H("span",nw,"待报销"))]),u("td",null,[u("div",rw,[fe.type==="expense"&&fe.reimbursable===1&&fe.reimbursed!==1?(K(),H("button",{key:0,class:"btn btn-xs",onClick:Ke=>ge(fe)},"标记已报销",8,sw)):Se("",!0),u("button",{class:"btn btn-xs",onClick:Ke=>Oe(fe)},"编辑",8,ow),u("button",{class:"btn btn-xs",onClick:Ke=>ce.value=fe},"删除",8,iw)])])]))),128)),!x.value.length&&!s.value?(K(),H("tr",aw,[...F[27]||(F[27]=[u("td",{colspan:"6",class:"empty muted"},"本月暂无账目",-1)])])):Se("",!0)])])]),u("div",lw,"筛选结果 "+re(x.value.length)+" 条 / 本月共 "+re(n.value.length)+" 条",1),Te(yb,{open:T.value,title:(L.value,"编辑账目"),initial:X.value,onCancel:F[9]||(F[9]=fe=>T.value=!1),onSave:Fe},null,8,["open","title","initial"]),Te(ur,{open:!!ce.value,title:"删除确认",message:ce.value?"将删除 "+ce.value.date+" 的账目("+ce.value.category+" "+ke(ce.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:F[10]||(F[10]=fe=>ce.value=null),onConfirm:je},null,8,["open","message"])]))}}),cw=Gt(uw,[["__scopeId","data-v-2b678001"]]),fw={class:"memo-page"},dw={class:"card memo-list"},pw={class:"pane-head"},hw={class:"pane-title"},vw={class:"memo-scroll"},mw=["onClick"],yw={class:"memo-item-title"},gw={class:"muted memo-item-sub"},bw={class:"muted num memo-item-time"},ww={key:0,class:"muted empty"},_w={class:"card memo-editor"},kw={class:"editor-foot"},xw={class:"muted foot-info"},Cw=["disabled"],Sw=["disabled"],Ew={key:1,class:"empty muted editor-empty"},$w=Vt({__name:"MemoView",setup(e){const t=V([]),n=V(null),s=V(!1),o=V(""),a=V(""),c=V(null),d=V(null);async function h(){if(t.value=await jv(),n.value&&n.value.id){const ae=t.value.find(Z=>Z.id===n.value.id);ae&&(n.value=ae)}}fn(async()=>{await h(),t.value.length&&k(t.value[0]),window.addEventListener("keydown",y)}),dr(()=>window.removeEventListener("keydown",y)),gt(Aa,async ae=>{if(!ae)return;t.value.length||await h();const Z=t.value.find($=>$.id===ae);Aa.value=null,Z&&D(Z)},{immediate:!0});function y(ae){(ae.ctrlKey||ae.metaKey)&&ae.key.toLowerCase()==="s"&&s.value&&m.value&&(ae.preventDefault(),ce())}const m=it(()=>{if(!s.value)return!1;const ae=n.value?n.value.title:"",Z=n.value?n.value.content:"";return o.value!==ae||a.value!==Z});function k(ae){n.value=ae,s.value=!0,o.value=ae.title,a.value=ae.content}function D(ae){if(!(s.value&&n.value&&n.value.id===ae.id)){if(m.value){d.value={type:"select",memo:ae};return}k(ae)}}function T(){if(m.value){d.value={type:"new"};return}L()}function L(){n.value=null,s.value=!0,o.value="",a.value=""}function X(){n.value?k(n.value):L()}async function ce(){if(!o.value.trim()&&!a.value.trim()){We("标题与内容不能都为空");return}if(n.value&&n.value.id)await Rv(n.value.id,o.value,a.value),We("备忘已保存");else{const ae=await Dv(o.value,a.value);n.value=ae,o.value=ae.title,a.value=ae.content,We("备忘已创建")}await h()}function Q(){n.value&&n.value.id&&(c.value=n.value)}async function E(){c.value&&c.value.id&&(await Lv(c.value.id),We("备忘已删除")),c.value=null,await h(),L()}function N(){const ae=d.value;d.value=null,ae&&(ae.type==="select"?k(ae.memo):L())}function G(ae){return(ae.content||"").replace(/\s+/g," ").slice(0,30)}function de(ae){return ae.replace("T"," ").slice(0,16)}return(ae,Z)=>(K(),H("div",fw,[u("aside",dw,[u("div",pw,[u("span",hw,"备忘录("+re(t.value.length)+")",1),u("button",{class:"btn btn-primary btn-sm",onClick:T},"新建")]),u("div",vw,[(K(!0),H(Re,null,ut(t.value,$=>(K(),H("div",{key:$.id,class:et(["memo-item",{active:s.value&&n.value&&n.value.id===$.id}]),onClick:x=>D($)},[u("div",yw,re($.title||"无标题"),1),u("div",gw,re(G($)||"空"),1),u("div",bw,re(de($.updated_at)),1)],10,mw))),128)),t.value.length?Se("",!0):(K(),H("div",ww,"暂无备忘"))])]),u("section",_w,[s.value?(K(),H(Re,{key:0},[Ee(u("input",{class:"input title-input","onUpdate:modelValue":Z[0]||(Z[0]=$=>o.value=$),placeholder:"标题"},null,512),[[De,o.value]]),Ee(u("textarea",{class:"textarea content-textarea","onUpdate:modelValue":Z[1]||(Z[1]=$=>a.value=$),placeholder:"内容"},null,512),[[De,a.value]]),u("div",kw,[u("span",xw,[m.value?(K(),H(Re,{key:0},[nn("有未保存修改")],64)):n.value&&n.value.id?(K(),H(Re,{key:1},[nn("更新于 "+re(de(n.value.updated_at)),1)],64)):(K(),H(Re,{key:2},[nn("新备忘")],64))]),Z[4]||(Z[4]=u("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(K(),H("button",{key:0,class:"btn btn-sm",onClick:Q},"删除")):Se("",!0),u("button",{class:"btn btn-sm",disabled:!m.value,onClick:X},"放弃修改",8,Cw),u("button",{class:"btn btn-primary btn-sm",disabled:!m.value,onClick:ce},"保存",8,Sw)])],64)):(K(),H("div",Ew,"选择左侧备忘,或点击右上角新建"))]),Te(ur,{open:!!c.value,title:"删除确认",message:c.value?"将删除备忘「"+(c.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Z[2]||(Z[2]=$=>c.value=null),onConfirm:E},null,8,["open","message"]),Te(ur,{open:!!d.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:Z[3]||(Z[3]=$=>d.value=null),onConfirm:N},null,8,["open"])]))}}),Aw=Gt($w,[["__scopeId","data-v-74d60dba"]]),Pw=["aria-label"],Tw={class:"dialog-head"},Ow={class:"dialog-title"},Mw={class:"dialog-body"},Iw={class:"form-grid"},jw={class:"field span2"},Dw={class:"field span2"},Rw={class:"field span2"},Lw={class:"pwd-row"},Kw={class:"field span2"},Fw={key:0,class:"form-error"},Nw={class:"dialog-btns"},Vw=Vt({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=V(""),a=V(""),c=V(""),d=V(""),h=V(""),y=V(null);function m(T){n.open&&T.key==="Escape"&&s("cancel")}gt(()=>n.open,async T=>{var L;T?(o.value=n.initial.system,a.value=n.initial.account,c.value=n.initial.password,d.value=n.initial.remark,h.value="",window.addEventListener("keydown",m),await ts(),(L=y.value)==null||L.focus()):window.removeEventListener("keydown",m)}),dr(()=>window.removeEventListener("keydown",m));function k(){const T="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",L="!@#$%^&*",X=crypto.getRandomValues(new Uint8Array(14));let ce="";for(let Q=0;Q<X.length;Q++)ce+=T[X[Q]%T.length];ce+=L[crypto.getRandomValues(new Uint8Array(1))[0]%L.length],c.value=ce,h.value=""}function D(){if(!o.value.trim()||!a.value.trim()||!c.value){h.value="系统名称、账号、密码为必填项";return}s("save",{system:o.value.trim(),account:a.value.trim(),password:c.value,remark:d.value.trim()})}return(T,L)=>(K(),It(Vs,{to:"body"},[Te(ns,{name:"modal"},{default:fr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:L[6]||(L[6]=Mr(X=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",Tw,[u("span",Ow,re(e.title),1),u("button",{class:"icon-btn",title:"关闭",onClick:L[0]||(L[0]=X=>s("cancel"))},[Te(lt,{name:"close",size:16})])]),u("div",Mw,[u("div",Iw,[u("div",jw,[L[7]||(L[7]=u("label",null,"系统名称(必填)",-1)),Ee(u("input",{ref_key:"systemInput",ref:y,class:"input","onUpdate:modelValue":L[1]||(L[1]=X=>o.value=X),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[De,o.value]])]),u("div",Dw,[L[8]||(L[8]=u("label",null,"账号(必填)",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":L[2]||(L[2]=X=>a.value=X),placeholder:"用户名、工号或邮箱"},null,512),[[De,a.value]])]),u("div",Rw,[L[9]||(L[9]=u("label",null,"密码(必填)",-1)),u("div",Lw,[Ee(u("input",{class:"input","onUpdate:modelValue":L[3]||(L[3]=X=>c.value=X),placeholder:"输入或点击生成"},null,512),[[De,c.value]]),u("button",{class:"btn btn-sm",onClick:k},"生成")])]),u("div",Kw,[L[10]||(L[10]=u("label",null,"备注",-1)),Ee(u("textarea",{class:"textarea","onUpdate:modelValue":L[4]||(L[4]=X=>d.value=X),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[De,d.value]])])]),h.value?(K(),H("div",Fw,re(h.value),1)):Se("",!0)]),u("div",Nw,[u("button",{class:"btn btn-sm",onClick:L[5]||(L[5]=X=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:D},"保存")])],8,Pw)])):Se("",!0)]),_:1})]))}}),Bw=Gt(Vw,[["__scopeId","data-v-f383b0a6"]]),hf=15e4;function Ho(e){const t=new Uint8Array(e);let n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return btoa(n)}function Wo(e){const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}function nl(){return Ho(crypto.getRandomValues(new Uint8Array(16)).buffer)}async function zo(e,t){const n=new TextEncoder,s=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveBits"]),o=await crypto.subtle.deriveBits({name:"PBKDF2",salt:Wo(t),iterations:hf,hash:"SHA-256"},s,256);return Ho(o)}async function Go(e,t){const n=new TextEncoder,s=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:Wo(t),iterations:hf,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Yo(e,t){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,new TextEncoder().encode(t));return Ho(n.buffer)+":"+Ho(s)}async function hi(e,t){const n=t.split(":");if(n.length!==2)throw new Error("密文格式错误");const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:Wo(n[0])},e,Wo(n[1]));return new TextDecoder().decode(s)}const vf="intern-log-vault-verify",es="enc:v1:";let Dr=null;function Uw(){return Dr!==null}function Jo(){Dr=null}async function mf(){return await yt("pwd_salt","")!==""}async function qw(e){if(e.length<6)throw new Error("主密码至少 6 位");if(await mf())throw new Error("主密码已设置");const t=nl(),n=await Go(e,t),s=await Yo(n,vf);await kt("pwd_salt",t),await kt("pwd_verifier",s),Dr=n}async function Hw(e){const t=await yt("pwd_salt","");if(!t)throw new Error("主密码尚未设置");const n=await Go(e,t),s=await yt("pwd_verifier","");try{await hi(n,s)}catch{throw new Error("主密码不正确")}Dr=n}async function yf(){if(!Dr)throw new Error("密码库未解锁");return Dr}async function Ww(e){const t=await yf();return es+await Yo(t,e)}async function zw(e){if(!e)return"";if(!e.startsWith(es))return e;const t=await yf();return hi(t,e.slice(es.length))}async function Gw(){return te.credential.orderBy("system").toArray()}async function Yw(e,t){const n=await Ww(e.password),s={system:e.system.trim(),account:e.account.trim(),password:n,remark:e.remark.trim()};t?await te.credential.update(t,{...s,updated_at:wt()}):await te.credential.add({...s,created_at:wt(),updated_at:wt()})}async function Jw(e){await te.credential.delete(e)}async function ca(e){const t=await te.credential.get(e);if(!t)throw new Error("记录不存在");return zw(t.password)}async function Xw(e,t){if(!e)throw new Error("请输入旧主密码");if(t.length<6)throw new Error("新主密码至少 6 位");if(t===e)throw new Error("新主密码不能与旧主密码相同");const n=await yt("pwd_salt","");if(!n)throw new Error("密码库尚未初始化");const s=await Go(e,n),o=await yt("pwd_verifier","");try{await hi(s,o)}catch{throw new Error("旧主密码不正确")}const a=await Go(t,n),c=await te.credential.toArray();let d=0;for(const h of c){if(h.id==null)continue;const y=await Qw(h.password,s),m=es+await Yo(a,y);await te.credential.update(h.id,{password:m}),d++}return await kt("pwd_verifier",await Yo(a,vf)),Dr=a,d}async function Qw(e,t){return e?e.startsWith(es)?hi(t,e.slice(es.length)):e:""}const Zw={class:"vault-page"},e_={key:0,class:"empty muted"},t_={key:1,class:"card lock-card"},n_={class:"lock-badge"},r_={key:0,class:"form-error"},s_=["disabled"],o_={key:0,class:"form-error"},i_=["disabled"],a_={class:"vault-toolbar"},l_={class:"search-wrap"},u_={class:"card table-card"},c_={class:"cred-table"},f_={class:"td-system"},d_=["onClick"],p_={class:"pwd-cell"},h_={class:"num pwd-text"},v_=["onClick"],m_=["onClick"],y_={class:"td-remark"},g_={class:"ops"},b_=["onClick"],w_=["onClick"],__={key:0},k_={class:"muted vault-note num"},x_={class:"dialog pwd-dialog"},C_={class:"dialog-head"},S_={class:"dialog-body"},E_={class:"vp-field"},$_={class:"vp-field"},A_={class:"vp-field"},P_={key:0,class:"form-error"},T_={class:"dialog-btns"},O_=5*60*1e3,M_=Vt({__name:"VaultView",setup(e){const t=V(null),n=V(Uw()),s=V(!1),o=V(""),a=V(""),c=V(""),d=V(""),h=V(""),y=V([]),m=V(""),k=V({}),D=V(!1),T=V(null),L=V({system:"",account:"",password:"",remark:""}),X=V(null),ce=V(!1),Q=V(""),E=V(""),N=V(""),G=V("");async function de(){y.value=await Gw(),k.value={}}let ae=null;function Z(){ae!==null&&window.clearTimeout(ae),ae=window.setTimeout(()=>{n.value&&(Jo(),n.value=!1,y.value=[],k.value={},We("长时间未操作,密码库已自动锁定"))},O_)}function $(){n.value&&Z()}fn(async()=>{t.value=await mf(),window.addEventListener("click",$),window.addEventListener("keydown",$),n.value&&Z()}),dr(()=>{window.removeEventListener("click",$),window.removeEventListener("keydown",$),ae!==null&&window.clearTimeout(ae)});const x=it(()=>{const ne=m.value.trim().toLowerCase();return ne?y.value.filter(F=>(F.system+" "+F.account+" "+(F.remark||"")).toLowerCase().includes(ne)):y.value});async function le(){if(!s.value){if(c.value="",!o.value){c.value="请输入主密码";return}if(o.value.length<6){c.value="主密码至少 6 位";return}if(o.value!==a.value){c.value="两次输入的主密码不一致";return}s.value=!0;try{await qw(o.value),o.value="",a.value="",n.value=!0,Z(),await de(),We("主密码已设置,密码库已解锁")}catch(ne){c.value=ne instanceof Error?ne.message:"设置失败"}s.value=!1}}async function ke(){if(!s.value){if(h.value="",!d.value){h.value="请输入主密码";return}s.value=!0;try{await Hw(d.value),d.value="",n.value=!0,Z(),await de()}catch(ne){h.value=ne instanceof Error?ne.message:"解锁失败"}s.value=!1}}function J(){Jo(),n.value=!1,y.value=[],k.value={},ae!==null&&window.clearTimeout(ae),We("密码库已锁定")}async function xe(ne){const F=ne.id;if(k.value[F]){k.value[F]=!1;return}try{ne.passwordPlain=await ca(F),k.value[F]=!0}catch(fe){We(fe instanceof Error?fe.message:"解密失败")}}async function Ve(ne){try{const F=await ca(ne.id);await Pa(F),We("密码已复制")}catch(F){We(F instanceof Error?F.message:"复制失败")}}async function nt(ne){await Pa(ne.account),We("账号已复制")}function qe(){T.value=null,L.value={system:"",account:"",password:"",remark:""},D.value=!0}async function He(ne){try{const F=await ca(ne.id);T.value=ne.id,L.value={system:ne.system,account:ne.account,password:F,remark:ne.remark||""},D.value=!0}catch(F){We(F instanceof Error?F.message:"解密失败")}}async function ge(ne){const F=T.value??void 0;await Yw(ne,F),D.value=!1,await de(),We(F?"账号已更新":"账号已添加")}async function Oe(){X.value&&X.value.id&&(await Jw(X.value.id),We("账号已删除")),X.value=null,await de()}function Fe(){Q.value="",E.value="",N.value="",G.value="",ce.value=!0}async function je(){G.value="";try{const ne=await Xw(Q.value,E.value);ce.value=!1,Q.value="",E.value="",N.value="",We("主密码已修改,"+ne+" 条账号密码已重新加密")}catch(ne){G.value=ne instanceof Error?ne.message:"修改失败"}}return(ne,F)=>(K(),H("div",Zw,[t.value===null?(K(),H("div",e_,"加载中")):n.value?(K(),H(Re,{key:2},[u("div",a_,[u("div",l_,[Te(lt,{name:"search",size:14,class:"search-icon"}),Ee(u("input",{class:"input","onUpdate:modelValue":F[3]||(F[3]=fe=>m.value=fe),placeholder:"搜索系统名称、账号或备注"},null,512),[[De,m.value]])]),F[16]||(F[16]=u("span",{class:"flex1"},null,-1)),u("button",{class:"btn btn-sm",onClick:Fe},"修改主密码"),u("button",{class:"btn btn-sm",onClick:J},"锁定"),u("button",{class:"btn btn-primary btn-sm",onClick:qe},"新增账号")]),u("div",u_,[u("table",c_,[F[18]||(F[18]=u("thead",null,[u("tr",null,[u("th",null,"系统名称"),u("th",null,"账号"),u("th",null,"密码"),u("th",null,"备注"),u("th",{class:"th-ops"},"操作")])],-1)),u("tbody",null,[(K(!0),H(Re,null,ut(x.value,fe=>(K(),H("tr",{key:fe.id},[u("td",f_,re(fe.system),1),u("td",null,[u("span",{class:"copyable",title:"点击复制账号",onClick:Ke=>nt(fe)},re(fe.account),9,d_)]),u("td",null,[u("div",p_,[u("span",h_,re(k.value[fe.id]?fe.passwordPlain:"........"),1),u("button",{class:"btn btn-xs",onClick:Ke=>xe(fe)},re(k.value[fe.id]?"隐藏":"显示"),9,v_),u("button",{class:"btn btn-xs",onClick:Ke=>Ve(fe)},"复制",8,m_)])]),u("td",y_,re(fe.remark||"--"),1),u("td",null,[u("div",g_,[u("button",{class:"btn btn-xs",onClick:Ke=>He(fe)},"编辑",8,b_),u("button",{class:"btn btn-xs",onClick:Ke=>X.value=fe},"删除",8,w_)])])]))),128)),x.value.length?Se("",!0):(K(),H("tr",__,[...F[17]||(F[17]=[u("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),u("div",k_,"共 "+re(y.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密存储于本机",1)],64)):(K(),H("div",t_,[u("div",n_,[Te(lt,{name:"lock",size:26})]),t.value===!1?(K(),H(Re,{key:0},[F[12]||(F[12]=u("div",{class:"lock-title"},"设置主密码",-1)),F[13]||(F[13]=u("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":F[0]||(F[0]=fe=>o.value=fe),placeholder:"设置主密码(至少 6 位)",onKeydown:jt(le,["enter"])},null,544),[[De,o.value]]),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":F[1]||(F[1]=fe=>a.value=fe),placeholder:"再次输入主密码",onKeydown:jt(le,["enter"])},null,544),[[De,a.value]]),c.value?(K(),H("div",r_,re(c.value),1)):Se("",!0),u("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:le},"完成设置并解锁",8,s_)],64)):(K(),H(Re,{key:1},[F[14]||(F[14]=u("div",{class:"lock-title"},"密码库已锁定",-1)),F[15]||(F[15]=u("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":F[2]||(F[2]=fe=>d.value=fe),placeholder:"主密码",onKeydown:jt(ke,["enter"])},null,544),[[De,d.value]]),h.value?(K(),H("div",o_,re(h.value),1)):Se("",!0),u("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:ke},"解锁",8,i_)],64))])),Te(Bw,{open:D.value,title:T.value?"编辑账号":"新增账号",initial:L.value,onCancel:F[4]||(F[4]=fe=>D.value=!1),onSave:ge},null,8,["open","title","initial"]),Te(ur,{open:!!X.value,title:"删除确认",message:X.value?"将删除系统「"+X.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:F[5]||(F[5]=fe=>X.value=null),onConfirm:Oe},null,8,["open","message"]),(K(),It(Vs,{to:"body"},[Te(ns,{name:"modal"},{default:fr(()=>[ce.value?(K(),H("div",{key:0,class:"mask",onClick:F[11]||(F[11]=Mr(fe=>ce.value=!1,["self"]))},[u("div",x_,[u("div",C_,[F[19]||(F[19]=u("span",{class:"dialog-title"},"修改主密码",-1)),u("button",{class:"icon-btn",title:"关闭",onClick:F[6]||(F[6]=fe=>ce.value=!1)},[Te(lt,{name:"close",size:16})])]),u("div",S_,[u("div",E_,[F[20]||(F[20]=u("label",null,"旧主密码",-1)),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":F[7]||(F[7]=fe=>Q.value=fe)},null,512),[[De,Q.value]])]),u("div",$_,[F[21]||(F[21]=u("label",null,"新主密码(至少 6 位)",-1)),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":F[8]||(F[8]=fe=>E.value=fe)},null,512),[[De,E.value]])]),u("div",A_,[F[22]||(F[22]=u("label",null,"确认新主密码",-1)),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":F[9]||(F[9]=fe=>N.value=fe)},null,512),[[De,N.value]])]),G.value?(K(),H("div",P_,re(G.value),1)):Se("",!0),F[23]||(F[23]=u("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),u("div",T_,[u("button",{class:"btn btn-sm",onClick:F[10]||(F[10]=fe=>ce.value=!1)},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:je},"确认修改")])])])):Se("",!0)]),_:1})]))]))}}),I_=Gt(M_,[["__scopeId","data-v-6820bc9c"]]);function j_(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Iu(e,t){const s="\uFEFF"+t.map(d=>d.map(j_).join(",")).join(`\r
`);if(Zr.isNativePlatform()){const{downloadText:d}=await cf(async()=>{const{downloadText:h}=await Promise.resolve().then(()=>mg);return{downloadText:h}},void 0,import.meta.url);return d(e,s)}const o=new Blob([s],{type:"text/csv;charset=utf-8"}),a=URL.createObjectURL(o),c=document.createElement("a");return c.href=a,c.download=e,c.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e4),""}class D_ extends Ir{constructor(){super("intern_worklog_users"),this.version(1).stores({user:"id, &username"})}}const Or=new D_,vi="intern_worklog",rl="dsh_session_user";function mi(){try{const e=localStorage.getItem(rl);if(!e)return null;const t=JSON.parse(e);if(t&&t.userId&&t.username)return t}catch{}return null}function gf(e){localStorage.setItem(rl,JSON.stringify(e))}function bf(){localStorage.removeItem(rl)}const sl="dsh_cloud_creds";function wf(e,t){localStorage.setItem(sl,JSON.stringify({username:e,password:t}))}function yi(){try{const e=localStorage.getItem(sl);if(!e)return null;const t=JSON.parse(e);if(t&&t.username&&t.password)return t}catch{}return null}function _f(){localStorage.removeItem(sl)}function ol(e){zh(new rf(vi+"_"+e))}async function R_(e,t,n){const s=e.trim();if(s.length<2||s.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");if(await Or.user.where("username").equals(s).first())throw new Error("用户名已存在");const a=nl(),c=await zo(t,a),d="u_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,6);await Or.user.add({id:d,username:s,pwd_hash:c,pwd_salt:a,created_at:new Date().toISOString()}),ol(d);let h=0;n&&await kf()&&(h=await V_(),await Or.user.update(d,{legacy_imported_at:new Date().toISOString()}));const y={userId:d,username:s};return gf(y),wf(y.username,t),h&&B_(h),y}async function L_(e,t){const n=e.trim(),s=await Or.user.where("username").equals(n).first();if(!s)throw new Error("用户不存在");if(await zo(t,s.pwd_salt)!==s.pwd_hash)throw new Error("密码不正确");ol(s.id);const a={userId:s.id,username:s.username};return gf(a),wf(a.username,t),a}async function K_(){Jo(),sf(),bf(),_f()}async function F_(e,t){const n=mi();if(!n)throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const s=await Or.user.get(n.userId);if(!s)throw new Error("用户不存在");if(await zo(e,s.pwd_salt)!==s.pwd_hash)throw new Error("旧密码不正确");const a=nl(),c=await zo(t,a);await Or.user.update(s.id,{pwd_hash:c,pwd_salt:a})}async function N_(){const e=mi();if(!e)throw new Error("未登录");Jo(),sf(),await Ir.delete(vi+"_"+e.userId),await Or.user.delete(e.userId),bf(),_f()}async function kf(){return Ir.exists(vi)}async function V_(){if(!te)throw new Error("用户数据库未就绪");const e=new rf(vi),t=await Promise.all([e.project.toArray(),e.work_log.toArray(),e.log_item.toArray(),e.attendance.toArray(),e.weekly_note.toArray(),e.setting.toArray(),e.memo.toArray(),e.credential.toArray()]);await te.transaction("rw",[te.project,te.work_log,te.log_item,te.attendance,te.weekly_note,te.setting,te.memo,te.credential],async()=>{await Promise.all([te.project.clear(),te.work_log.clear(),te.log_item.clear(),te.attendance.clear(),te.weekly_note.clear(),te.setting.clear(),te.memo.clear(),te.credential.clear()]),t[0].length&&await te.project.bulkAdd(t[0]),t[1].length&&await te.work_log.bulkAdd(t[1]),t[2].length&&await te.log_item.bulkAdd(t[2]),t[3].length&&await te.attendance.bulkAdd(t[3]),t[4].length&&await te.weekly_note.bulkAdd(t[4]),t[5].length&&await te.setting.bulkAdd(t[5]),t[6].length&&await te.memo.bulkAdd(t[6]),t[7].length&&await te.credential.bulkAdd(t[7])});const n=t[0].length+t[1].length+t[2].length+t[3].length+t[4].length+t[6].length+t[7].length;return e.close(),n}function B_(e){try{sessionStorage.setItem("dsh_migrate_toast",String(e))}catch{}}const U_="https://daywk.linyux.cn",Xo=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","transaction"],Ta=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);function q_(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function ju(e){const t={...e};return delete t.id,t}function Du(e){return JSON.stringify(e)}async function H_(e){return te.table(e).toArray()}function Oa(e,t){return e==="setting"?t.key:t.id}async function W_(){for(const e of Xo){const t=te.table(e),n=await t.toArray();for(const s of n){if(e==="setting"&&Ta.has(s.key))continue;const o={};s.uuid||(o.uuid=q_()),s.updated_at||(o.updated_at=s.created_at||wt()),Object.keys(o).length&&await t.update(Oa(e,s),o)}}}async function il(){return await yt("sync_base_url","")||U_}async function xf(){const e=yi();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await il(),username:e.username,password:e.password}}async function z_(){return Ef(await xf())}async function Cf(){const e=yi();if(!e)throw new Error("未登录");const t=await il(),n={"Content-Type":"application/json"},s=JSON.stringify({username:e.username,password:e.password});let o=await fetch(t+"/api/auth/register",{method:"POST",headers:n,body:s});if(o.status===409){if(o=await fetch(t+"/api/auth/login",{method:"POST",headers:n,body:s}),!o.ok)throw new Error("云端已存在同名账号且密码不一致,请检查")}else if(!o.ok)throw new Error("云端绑定失败:"+o.status)}async function G_(){return yi()!=null}async function Y_(){return yt("sync_last_time","")}async function Sf(e,t){const n=await fetch(e+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.username.trim(),password:t.password})});if(!n.ok)throw new Error("云端账号或密码不正确");const s=await n.json();if(!s||!s.token)throw new Error("云端登录异常");return String(s.token)}async function J_(e,t){let n=await yt("sync_token","");return n||(n=await Sf(e,t),await kt("sync_token",n),n)}let $s=!1,To=!1,Ma=!1,Gr=null,wn=null,Ia="",Ru=!1,Oo=null;async function Yr(){if($s){To=!0;return}try{if(!await G_())return;await Ef(await xf())}catch{}}function X_(){if(Ru)return;Ru=!0,Oo=Wh(async()=>{const t={};for(const n of Xo)t[n]=await te.table(n).count();return t}).subscribe({next:()=>{Ma||$s||(Gr&&globalThis.clearTimeout(Gr),Gr=globalThis.setTimeout(()=>{Yr()},3e3))},error:()=>{}})}function Q_(){Oo&&(Oo.unsubscribe(),Oo=null),wn&&(wn.close(),wn=null,Ia=""),Gr&&(globalThis.clearTimeout(Gr),Gr=null)}function Z_(e,t){const n=e+"|"+t;if(!(wn&&Ia===n)){wn&&(wn.close(),wn=null);try{wn=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),Ia=n,wn.onmessage=()=>{Yr()}}catch{wn=null}}}async function Ef(e){if($s)return To=!0,{pushed:0,pulled:0,removed:0,at:""};$s=!0,Ma=!0;try{const t=await e1(e);return To&&(To=!1,globalThis.setTimeout(()=>{Yr()},800)),t}finally{$s=!1,Ma=!1}}async function e1(e){const t=e.baseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("请先配置同步服务地址");await W_();const n=await te.sync_mirror.toArray(),s=new Map;for(const Q of n)s.set(Q.table+"|"+Q.uuid,Q);const o={},a=[];let c=0;for(const Q of Xo){let E=await H_(Q);Q==="setting"&&(E=E.filter(G=>!Ta.has(G.key)));const N=new Map;for(const G of E)N.set(G.uuid,G);for(const[G,de]of N){const ae=ju(de),Z=Du(ae),$=s.get(Q+"|"+G);(!$||$.hash!==Z)&&(o[Q]=o[Q]||[],o[Q].push(ae),c++)}for(const[G,de]of s)G.startsWith(Q+"|")&&!N.has(de.uuid)&&a.push({table:Q,uuid:de.uuid,deleted_at:wt()});o[Q]=o[Q]||[]}const d=await J_(t,e),h=Q=>fetch(t+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Q},body:JSON.stringify({device:"client",tables:o,tombstones:a})});let y=await h(d);if(y.status===401){await kt("sync_token","");const Q=await Sf(t,e);await kt("sync_token",Q),y=await h(Q)}if(!y.ok)throw new Error("同步服务返回 "+y.status);const m=await y.json(),k=m.tables||{},D=m.tombstones||[];let T=0,L=0;const X=[];for(const Q of Xo){const E=te.table(Q),N=await E.toArray(),G=new Map;for(const x of N)G.set(x.uuid,x);const de=k[Q]||[],ae=new Map;for(const x of de)ae.set(x.uuid,x);const Z=new Set(D.filter(x=>x.table===Q).map(x=>x.uuid));for(const[x,le]of G)Z.has(x)&&(await E.delete(Oa(Q,le)),L++);for(const x of de){if(Z.has(x.uuid))continue;const le=G.get(x.uuid);if(!le)await E.add({...x}),T++;else{const ke=String(le.updated_at||"");if(String(x.updated_at||"")>ke){const xe={...x};Q==="setting"&&delete xe.key,await E.update(Oa(Q,le),xe),T++}}}const $=await E.toArray();for(const x of $)Q==="setting"&&Ta.has(x.key)||X.push({table:Q,uuid:x.uuid,hash:Du(ju(x))})}await te.sync_mirror.clear(),X.length&&await te.sync_mirror.bulkAdd(X.map(Q=>({...Q}))),Z_(t,d);const ce=wt();return await kt("sync_last_time",ce),{pushed:c,pulled:T,removed:L,at:ce}}const t1={class:"settings"},n1={class:"card section"},r1={class:"muted acc-line"},s1={class:"ai-grid"},o1={class:"rule-item"},i1={class:"rule-item"},a1={class:"rule-item"},l1={key:0,class:"form-error"},u1={class:"rule-save"},c1={class:"card section"},f1={class:"rule-grid"},d1={class:"rule-item"},p1={class:"rule-item"},h1={class:"rule-item"},v1={class:"rule-item"},m1={class:"rule-item"},y1={class:"card section"},g1={class:"proj-add"},b1={key:0,class:"muted proj-tip"},w1=["onKeydown"],_1=["onClick"],k1=["onClick"],x1=["onClick"],C1={key:1,class:"muted"},S1={class:"card section"},E1={class:"card section"},$1={class:"muted acc-line"},A1={class:"rule-item"},P1={class:"rule-save"},T1=["disabled"],O1={key:0,class:"muted acc-line"},M1={key:1,class:"form-error"},I1={class:"card section"},j1={class:"ai-grid"},D1={class:"rule-item"},R1={class:"rule-item"},L1={class:"rule-item"},K1={class:"card section"},F1={class:"backup-row"},N1={key:0,class:"import-error"},V1=Vt({__name:"SettingsView",setup(e){var Ie;const t=V({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=V([]),s=V(""),o=V(""),a=V(""),c=V(""),d=V(""),h=V(""),y=V(null),m=V(""),k=V(null),D=V(null),T=V(""),L=V(((Ie=mi())==null?void 0:Ie.username)||""),X=V(""),ce=V(""),Q=V(""),E=V(""),N=V(!1),G="0.2.0",de=V(""),ae=V(""),Z=V(""),$=V(""),x=V(!1),le=V("");async function ke(){var w;de.value=await il(),ae.value=((w=yi())==null?void 0:w.username)||"",le.value=await Y_()}async function J(){await kt("sync_base_url",de.value.trim()),We("同步地址已保存")}async function xe(){$.value="";try{await Cf(),We("云端绑定已重建")}catch(w){$.value=w instanceof Error?w.message:"绑定失败"}}async function Ve(){if(!x.value){$.value="",x.value=!0;try{await J();const w=await z_();le.value=w.at,Z.value="推送 "+w.pushed+" 条 · 拉取 "+w.pulled+" 条 · 删除 "+w.removed+" 条",We("同步完成")}catch(w){$.value=w instanceof Error?w.message:"同步失败"}x.value=!1}}async function nt(){if(E.value="",ce.value!==Q.value){E.value="两次输入的新密码不一致";return}try{await F_(X.value,ce.value),X.value="",ce.value="",Q.value="",We("登录密码已修改")}catch(w){E.value=w instanceof Error?w.message:"修改失败"}}async function qe(){await N_(),window.location.reload()}async function He(){t.value=await jr(),n.value=await Ks(!0),a.value=(await Za()).join(`
`),c.value=await yt("ai_base_url",""),d.value=await yt("ai_api_key",""),h.value=await yt("ai_model",""),await ke()}async function ge(){await kt("ai_base_url",c.value.trim()),await kt("ai_api_key",d.value.trim()),await kt("ai_model",h.value.trim()),We("AI 配置已保存")}async function Oe(){const w=xt(),g=await Promise.all([pi("2000-01-01",w),Ks(!0)]),P=g[0],ie=g[1],se=new Map(ie.map(oe=>[oe.id,oe.name])),ue=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const oe of P)ue.push([oe.date,Qa(oe.category),oe.project_id&&se.get(oe.project_id)||"",oe.content,oe.minutes==null?"":oe.minutes,oe.is_milestone?"是":"",oe.needs_followup?"是":"",oe.takeaway||"",oe.remark||""]);const ye=await Iu("工作记录_"+w.replace(/-/g,"")+".csv",ue);We(ye?"CSV 已导出到:"+ye:"CSV 已导出到系统下载目录")}async function Fe(){const w=xt(),g=await Promise.all([jr(),di("2000-01-01",w)]),P=g[0],ie=g[1],se=["周日","周一","周二","周三","周四","周五","周六"],ue=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const oe of ie){const we=qs(oe,oe.date,P,oe.date===w);ue.push([oe.date,se[rs(oe.date).getDay()],we.label,oe.clock_in_at?Vn(oe.clock_in_at):"",oe.clock_out_at?Vn(oe.clock_out_at):"",oe.location||"",oe.kind==="makeup"?"补卡":oe.kind==="leave"?"休假":"正常",oe.note||""])}const ye=await Iu("考勤记录_"+w.replace(/-/g,"")+".csv",ue);We(ye?"CSV 已导出到:"+ye:"CSV 已导出到系统下载目录")}fn(He);async function je(){await kt("work_start",t.value.work_start),await kt("work_end",t.value.work_end),await kt("grace_minutes",String(t.value.grace_minutes)),await kt("lunch_minutes",String(t.value.lunch_minutes)),await kt("remind_weekly",t.value.remind_weekly),We("打卡规则已保存")}async function ne(){await af(a.value.split(`
`)),We("常用地点已保存")}async function F(){const w=s.value.trim();if(w){try{await bv(w),o.value="",s.value=""}catch{o.value="项目名已存在"}await He()}}function fe(w){y.value=w.id,m.value=w.name}async function Ke(w){const g=m.value.trim();if(g)try{await wv(w.id,g),o.value=""}catch{o.value="项目名已存在"}y.value=null,await He()}async function ct(w){await _v(w.id,w.archived!==1),await He()}async function ht(){try{const w=await Hv(),g=await tl("实习日志备份_"+xt().replace(/-/g,"")+".json",w);We(g?"备份已导出到:"+g:"备份已导出到系统下载目录")}catch(w){We("导出失败:"+(w instanceof Error?w.message:String(w)))}}function Yt(w){const g=w.target,P=g.files&&g.files[0];if(T.value="",!P)return;const ie=P.name;P.text().then(se=>{D.value={name:ie,text:se}}),g.value=""}async function Jt(){if(D.value)try{await Wv(D.value.text),D.value=null,T.value="",await He(),We("数据导入完成")}catch(w){D.value=null,T.value=w instanceof Error?w.message:"导入失败"}}return(w,g)=>(K(),H("div",t1,[u("div",n1,[g[23]||(g[23]=u("div",{class:"section-title"},"账号与隐私",-1)),u("div",r1,"版本 v"+re(Qt(G))+" · 当前用户:"+re(L.value)+" · 每位用户独立数据库隔离存储于本机 · 登录密码仅保存 PBKDF2 哈希",1),u("div",s1,[u("div",o1,[g[20]||(g[20]=u("label",null,"旧登录密码",-1)),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":g[0]||(g[0]=P=>X.value=P)},null,512),[[De,X.value]])]),u("div",i1,[g[21]||(g[21]=u("label",null,"新登录密码(至少 6 位)",-1)),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":g[1]||(g[1]=P=>ce.value=P)},null,512),[[De,ce.value]])]),u("div",a1,[g[22]||(g[22]=u("label",null,"确认新登录密码",-1)),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":g[2]||(g[2]=P=>Q.value=P)},null,512),[[De,Q.value]])])]),E.value?(K(),H("div",l1,re(E.value),1)):Se("",!0),u("div",u1,[u("button",{class:"btn btn-primary btn-sm",onClick:nt},"修改登录密码"),u("button",{class:"btn btn-sm btn-danger",onClick:g[3]||(g[3]=P=>N.value=!0)},"删除此用户及全部数据")])]),u("div",c1,[g[30]||(g[30]=u("div",{class:"section-title"},"打卡规则",-1)),u("div",f1,[u("div",d1,[g[24]||(g[24]=u("label",null,"上班时间",-1)),Ee(u("input",{type:"time",class:"input","onUpdate:modelValue":g[4]||(g[4]=P=>t.value.work_start=P)},null,512),[[De,t.value.work_start]])]),u("div",p1,[g[25]||(g[25]=u("label",null,"下班时间",-1)),Ee(u("input",{type:"time",class:"input","onUpdate:modelValue":g[5]||(g[5]=P=>t.value.work_end=P)},null,512),[[De,t.value.work_end]])]),u("div",h1,[g[26]||(g[26]=u("label",null,"迟到宽限(分钟)",-1)),Ee(u("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":g[6]||(g[6]=P=>t.value.grace_minutes=P)},null,512),[[De,t.value.grace_minutes,void 0,{number:!0}]])]),u("div",v1,[g[27]||(g[27]=u("label",null,"午休扣除(分钟)",-1)),Ee(u("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":g[7]||(g[7]=P=>t.value.lunch_minutes=P)},null,512),[[De,t.value.lunch_minutes,void 0,{number:!0}]])]),u("div",m1,[g[29]||(g[29]=u("label",null,"周记提醒",-1)),Ee(u("select",{class:"select","onUpdate:modelValue":g[8]||(g[8]=P=>t.value.remind_weekly=P)},[...g[28]||(g[28]=[u("option",{value:"friday"},"每周五提醒",-1),u("option",{value:"off"},"关闭",-1)])],512),[[Fn,t.value.remind_weekly]])])]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:je},"保存规则")])]),u("div",y1,[g[31]||(g[31]=u("div",{class:"section-title"},"项目管理",-1)),u("div",g1,[Ee(u("input",{class:"input","onUpdate:modelValue":g[9]||(g[9]=P=>s.value=P),placeholder:"新项目名称",onKeydown:jt(F,["enter"])},null,544),[[De,s.value]]),u("button",{class:"btn btn-sm",onClick:F},"添加")]),o.value?(K(),H("div",b1,re(o.value),1)):Se("",!0),(K(!0),H(Re,null,ut(n.value,P=>(K(),H("div",{key:P.id,class:"proj-row"},[y.value===P.id?(K(),H(Re,{key:0},[Ee(u("input",{class:"input","onUpdate:modelValue":g[10]||(g[10]=ie=>m.value=ie),onKeydown:jt(ie=>Ke(P),["enter"])},null,40,w1),[[De,m.value]]),u("button",{class:"btn btn-sm",onClick:ie=>Ke(P)},"保存",8,_1),u("button",{class:"btn btn-sm",onClick:g[11]||(g[11]=ie=>y.value=null)},"取消")],64)):(K(),H(Re,{key:1},[u("span",{class:et(["proj-name",{archived:P.archived===1}])},re(P.name),3),u("button",{class:"icon-btn",title:"重命名",onClick:ie=>fe(P)},[Te(lt,{name:"edit",size:14})],8,k1),u("button",{class:"btn btn-sm",onClick:ie=>ct(P)},re(P.archived===1?"恢复":"归档"),9,x1)],64))]))),128)),n.value.length?Se("",!0):(K(),H("div",C1,"暂无项目,先添加一个"))]),u("div",S1,[g[33]||(g[33]=u("div",{class:"section-title"},"常用地点",-1)),Ee(u("textarea",{class:"textarea","onUpdate:modelValue":g[12]||(g[12]=P=>a.value=P),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[De,a.value]]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:ne},"保存地点"),g[32]||(g[32]=u("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),u("div",E1,[g[35]||(g[35]=u("div",{class:"section-title"},"多端数据同步",-1)),u("div",$1,"云端账号:"+re(ae.value||"未绑定")+" · 登录即自动绑定并同步(变更实时推送 + 每 5 分钟兜底);密码库以密文同步,主密码永不出本机",1),u("div",A1,[g[34]||(g[34]=u("label",null,"同步服务地址(默认即可)",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":g[13]||(g[13]=P=>de.value=P),placeholder:"https://daywk.linyux.cn"},null,512),[[De,de.value]])]),u("div",P1,[u("button",{class:"btn btn-sm",onClick:J},"保存地址"),u("button",{class:"btn btn-primary btn-sm",disabled:x.value,onClick:Ve},re(x.value?"同步中":"立即同步"),9,T1),u("button",{class:"btn btn-sm",onClick:xe},"重建云端绑定")]),Z.value?(K(),H("div",O1,"上次同步:"+re(le.value||"--")+" · "+re(Z.value),1)):Se("",!0),$.value?(K(),H("div",M1,re($.value),1)):Se("",!0)]),u("div",I1,[g[40]||(g[40]=u("div",{class:"section-title"},"AI 润色配置(可选)",-1)),u("div",j1,[u("div",D1,[g[36]||(g[36]=u("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":g[14]||(g[14]=P=>c.value=P),placeholder:"https://api.example.com/v1"},null,512),[[De,c.value]])]),u("div",R1,[g[37]||(g[37]=u("label",null,"API Key",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":g[15]||(g[15]=P=>d.value=P),placeholder:"sk-..."},null,512),[[De,d.value]])]),u("div",L1,[g[38]||(g[38]=u("label",null,"模型名称",-1)),Ee(u("input",{class:"input","onUpdate:modelValue":g[16]||(g[16]=P=>h.value=P),placeholder:"如:deepseek-chat"},null,512),[[De,h.value]])])]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:ge},"保存 AI 配置"),g[39]||(g[39]=u("span",{class:"muted loc-note"},"配置仅保存在本机浏览器;总结页可用 AI 润色草稿,需服务端允许浏览器跨域",-1))])]),u("div",K1,[g[41]||(g[41]=u("div",{class:"section-title"},"数据备份",-1)),u("div",F1,[u("button",{class:"btn btn-sm",onClick:ht},"导出 JSON 备份"),u("button",{class:"btn btn-sm",onClick:g[17]||(g[17]=P=>{var ie;return(ie=k.value)==null?void 0:ie.click()})},"导入 JSON 备份"),u("button",{class:"btn btn-sm",onClick:Oe},"导出工作记录 CSV"),u("button",{class:"btn btn-sm",onClick:Fe},"导出考勤 CSV"),u("input",{ref_key:"fileInput",ref:k,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:Yt},null,544)]),T.value?(K(),H("div",N1,re(T.value),1)):Se("",!0),g[42]||(g[42]=u("div",{class:"muted backup-note"},"数据保存在浏览器 IndexedDB 中,建议定期导出 JSON 备份。",-1))]),Te(ur,{open:!!D.value,title:"导入确认",message:D.value?"将从文件「"+D.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:g[18]||(g[18]=P=>D.value=null),onConfirm:Jt},null,8,["open","message"]),Te(ur,{open:N.value,title:"删除用户确认",message:"将永久删除用户「"+L.value+"」及其全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:g[19]||(g[19]=P=>N.value=!1),onConfirm:qe},null,8,["open","message"])]))}}),B1=Gt(V1,[["__scopeId","data-v-81598f02"]]),U1={class:"login-page"},q1={class:"card login-card"},H1={class:"login-brand"},W1={class:"brand-icon"},z1={class:"seg"},G1=["placeholder"],Y1={key:1,class:"mig-row"},J1={key:2,class:"form-error"},X1=["disabled"],Q1=Vt({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,s=V("login"),o=V(""),a=V(""),c=V(""),d=V(!0),h=V(!1),y=V(""),m=V(!1);fn(async()=>{h.value=await kf()});function k(T){s.value=T,y.value="",c.value=""}async function D(){if(!m.value){y.value="",m.value=!0;try{let T;if(s.value==="login")T=await L_(o.value,a.value);else{if(a.value.length<6){y.value="登录密码至少 6 位",m.value=!1;return}if(a.value!==c.value){y.value="两次输入的密码不一致",m.value=!1;return}T=await R_(o.value,a.value,d.value)}n("login",T)}catch(T){y.value=T instanceof Error?T.message:"操作失败"}m.value=!1}}return(T,L)=>(K(),H("div",U1,[u("div",q1,[u("div",H1,[u("div",W1,[Te(lt,{name:"calendar",size:22})]),L[6]||(L[6]=u("div",{class:"login-title"},"实习工作日志",-1)),L[7]||(L[7]=u("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),L[8]||(L[8]=u("div",{class:"muted login-sub"},"每位用户独立数据库,数据彼此隔离并保存在本机",-1))]),u("div",z1,[u("button",{class:et(["seg-btn",{active:s.value==="login"}]),onClick:L[0]||(L[0]=X=>k("login"))},"登录",2),u("button",{class:et(["seg-btn",{active:s.value==="create"}]),onClick:L[1]||(L[1]=X=>k("create"))},"创建用户",2)]),Ee(u("input",{class:"input","onUpdate:modelValue":L[2]||(L[2]=X=>o.value=X),placeholder:"用户名(2 到 20 个字符)",onKeydown:jt(D,["enter"])},null,544),[[De,o.value]]),Ee(u("input",{type:"password",class:"input","onUpdate:modelValue":L[3]||(L[3]=X=>a.value=X),placeholder:s.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:jt(D,["enter"])},null,40,G1),[[De,a.value]]),s.value==="create"?Ee((K(),H("input",{key:0,type:"password",class:"input","onUpdate:modelValue":L[4]||(L[4]=X=>c.value=X),placeholder:"再次输入密码",onKeydown:jt(D,["enter"])},null,544)),[[De,c.value]]):Se("",!0),s.value==="create"&&h.value?(K(),H("label",Y1,[Ee(u("input",{type:"checkbox","onUpdate:modelValue":L[5]||(L[5]=X=>d.value=X)},null,512),[[$h,d.value]]),L[9]||(L[9]=u("span",null,"导入本机原有工作日志数据到此用户(原数据保留不删除)",-1))])):Se("",!0),y.value?(K(),H("div",J1,re(y.value),1)):Se("",!0),u("button",{class:"btn btn-primary login-btn",disabled:m.value,onClick:D},re(s.value==="login"?"登录":"创建并进入"),9,X1),L[10]||(L[10]=u("div",{class:"muted login-note"}," 登录后自动开启云端同步(密码会保存在本机用于云同步);系统只保存密码哈希,忘记密码将无法访问该用户数据 ",-1))])]))}}),Z1=Gt(Q1,[["__scopeId","data-v-d3d6c8cb"]]),e0={key:1,class:"app"},t0={class:"side"},n0=["data-tip","onClick"],r0={class:"main"},s0={class:"topbar"},o0={class:"title"},i0={class:"gsearch"},a0={key:0,class:"gs-panel"},l0={key:0,class:"gs-group muted"},u0=["onMousedown"],c0={class:"tag"},f0={class:"gs-text"},d0={class:"muted num gs-date"},p0={key:1,class:"gs-group muted"},h0=["onMousedown"],v0={class:"gs-text"},m0={class:"muted gs-sub"},y0={key:1,class:"gs-empty muted"},g0={class:"topbar-actions"},b0={class:"user-chip num"},w0=["disabled"],_0={class:"num"},k0={class:"content"},x0={class:"content-inner"},C0={class:"toast-wrap"},S0=Vt({__name:"App",setup(e){const t=Gv(),n=V(mi());async function s(ge){n.value=ge,location.hash="#/calendar",de.value="calendar",await ke(),await He(),c();try{await Cf(),await Yr()}catch{}showToast("欢迎,"+ge.username);const Oe=sessionStorage.getItem("dsh_migrate_toast");Oe&&(sessionStorage.removeItem("dsh_migrate_toast"),showToast("已迁移原有数据 "+Oe+" 条"))}async function o(){Q_(),a!==null&&(window.clearInterval(a),a=null),await K_(),n.value=null,de.value="calendar",location.hash="#/calendar",showToast("已退出登录")}let a=null;function c(){X_(),a!==null&&window.clearInterval(a),a=window.setInterval(()=>{Yr()},60*1e3),Yr()}const d=V(null),h=V(""),y=V(!1),m=V({logs:[],memos:[]});let k=null;const D=it(()=>!!(m.value.logs.length||m.value.memos.length));function T(){k&&window.clearTimeout(k);const ge=h.value;k=window.setTimeout(async()=>{const Oe=ge.trim();if(!Oe){m.value={logs:[],memos:[]};return}const Fe=await Promise.all([Kv(Oe,8),Fv(Oe,4)]);m.value={logs:Fe[0],memos:Fe[1]}},200)}function L(){h.value="",m.value={logs:[],memos:[]},y.value=!1}function X(ge){$a.value=ge.date,ae("calendar"),L()}function ce(ge){Aa.value=ge.id,ae("memo"),L()}function Q(){window.setTimeout(()=>{y.value=!1},150)}function E(ge){var Oe;(ge.ctrlKey||ge.metaKey)&&ge.key.toLowerCase()==="k"&&(ge.preventDefault(),(Oe=d.value)==null||Oe.focus())}const N=[{key:"calendar",name:"日历",icon:"calendar"},{key:"today",name:"详情",icon:"edit"},{key:"stats",name:"统计",icon:"chart"},{key:"report",name:"总结",icon:"export"},{key:"ledger",name:"记账",icon:"wallet"},{key:"memo",name:"备忘录",icon:"memo"},{key:"vault",name:"密码库",icon:"lock"},{key:"settings",name:"设置",icon:"settings"}];function G(){const ge=(location.hash||"").replace("#/","");return N.some(Oe=>Oe.key===ge)?ge:"calendar"}const de=V(G());window.addEventListener("hashchange",()=>{de.value=G()});function ae(ge){location.hash="#/"+ge}const Z=it(()=>N.find(ge=>ge.key===de.value)||N[0]),$=V(xt()),x=V(void 0),le=V(!1);async function ke(){if(x.value=await mn($.value),le.value=!1,new Date().getHours()<4){const Oe=await mn(Kn($.value,-1));le.value=!!(Oe&&Oe.clock_in_at&&!Oe.clock_out_at)}}const J=it(()=>{const ge=x.value;return ge&&ge.clock_in_at&&!ge.clock_out_at?!0:le.value&&!(ge&&ge.clock_in_at)}),xe=it(()=>{const ge=x.value;return!!(ge&&ge.clock_in_at&&ge.clock_out_at)}),Ve=it(()=>{const ge=x.value;return J.value?"下班打卡":xe.value?"已打卡 "+Vn(ge==null?void 0:ge.clock_in_at)+" - "+Vn(ge==null?void 0:ge.clock_out_at):"上班打卡"});async function nt(){if(J.value)try{await xv()}catch{}else await lf($.value);await ke(),Sr()}gt(Hs,()=>{n.value&&ke()});const qe=V(!1);async function He(){if((await jr()).remind_weekly==="off"){qe.value=!1;return}const Oe=new Date().getDay();if(Oe===5||Oe===6||Oe===0){const Fe=await el(Es($.value));qe.value=!Fe||!Fe.highlights&&!Fe.challenges&&!Fe.plan_next}else qe.value=!1}return fn(async()=>{window.addEventListener("keydown",E),n.value&&(ol(n.value.userId),await ke(),await He(),c())}),(ge,Oe)=>{var Fe;return n.value?(K(),H("div",e0,[u("nav",t0,[(K(),H(Re,null,ut(N,je=>u("button",{key:je.key,class:et(["nav-btn",{active:de.value===je.key}]),"data-tip":je.name,onClick:ne=>ae(je.key)},[Te(lt,{name:je.icon,size:18},null,8,["name"])],10,n0)),64))]),u("div",r0,[u("header",s0,[u("span",o0,re(Z.value.name),1),u("div",i0,[Te(lt,{name:"search",size:14,class:"gs-icon"}),Ee(u("input",{ref_key:"gsInput",ref:d,class:"input gs-input","onUpdate:modelValue":Oe[0]||(Oe[0]=je=>h.value=je),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:T,onFocus:Oe[1]||(Oe[1]=je=>y.value=!0),onBlur:Q,onKeydown:jt(L,["esc"])},null,544),[[De,h.value]]),y.value&&h.value.trim()?(K(),H("div",a0,[D.value?(K(),H(Re,{key:0},[m.value.logs.length?(K(),H("div",l0,"工作记录")):Se("",!0),(K(!0),H(Re,null,ut(m.value.logs,je=>(K(),H("div",{key:"l"+je.id,class:"gs-item",onMousedown:Mr(ne=>X(je),["prevent"])},[u("span",c0,re(Qt(Qa)(je.category)),1),u("span",f0,re(je.content),1),u("span",d0,re(je.date),1)],40,u0))),128)),m.value.memos.length?(K(),H("div",p0,"备忘录")):Se("",!0),(K(!0),H(Re,null,ut(m.value.memos,je=>(K(),H("div",{key:"m"+je.id,class:"gs-item",onMousedown:Mr(ne=>ce(je),["prevent"])},[u("span",v0,re(je.title||"无标题"),1),u("span",m0,re(je.content),1)],40,h0))),128))],64)):(K(),H("div",y0,"无匹配结果"))])):Se("",!0)]),Oe[4]||(Oe[4]=u("span",{class:"flex1"},null,-1)),u("div",g0,[qe.value?(K(),H("button",{key:0,class:"week-tip",onClick:Oe[2]||(Oe[2]=je=>ae("report"))},[...Oe[3]||(Oe[3]=[u("span",{class:"dot",style:{background:"var(--warn)"}},null,-1),nn(" 填写本周周记 ",-1)])])):Se("",!0),u("span",b0,re((Fe=n.value)==null?void 0:Fe.username),1),u("button",{class:"btn btn-sm",onClick:o},"退出"),u("button",{class:"btn btn-primary btn-sm",disabled:xe.value,onClick:nt},[Te(lt,{name:xe.value?"check-circle":"clock",size:14},null,8,["name"]),u("span",_0,re(Ve.value),1)],8,w0)])]),u("main",k0,[u("div",x0,[de.value==="calendar"?(K(),It(yy,{key:0})):de.value==="today"?(K(),It(xy,{key:1})):de.value==="stats"?(K(),It(eg,{key:2})):de.value==="report"?(K(),It(Zg,{key:3})):de.value==="ledger"?(K(),It(cw,{key:4})):de.value==="memo"?(K(),It(Aw,{key:5})):de.value==="vault"?(K(),It(I_,{key:6})):(K(),It(B1,{key:7}))])])]),u("div",C0,[Te(gh,{name:"toast"},{default:fr(()=>[(K(!0),H(Re,null,ut(Qt(t),je=>(K(),H("div",{key:je.id,class:"toast"},re(je.text),1))),128))]),_:1})])])):(K(),It(Z1,{key:0,onLogin:s}))}}}),E0=Gt(S0,[["__scopeId","data-v-57e72b29"]]);jh(E0).mount("#app");"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})});export{pf as W,cf as _,hg as b,df as r};