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

27 lines
308 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 Ha(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const pt={},Ar=[],$n=()=>{},Uu=()=>!1,ii=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ai=e=>e.startsWith("onUpdate:"),$t=Object.assign,Wa=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},od=Object.prototype.hasOwnProperty,ft=(e,t)=>od.call(e,t),Re=Array.isArray,nr=e=>Vs(e)==="[object Map]",Ir=e=>Vs(e)==="[object Set]",Jl=e=>Vs(e)==="[object Date]",ze=e=>typeof e=="function",wt=e=>typeof e=="string",Tn=e=>typeof e=="symbol",dt=e=>e!==null&&typeof e=="object",qu=e=>(dt(e)||ze(e))&&ze(e.then)&&ze(e.catch),Hu=Object.prototype.toString,Vs=e=>Hu.call(e),id=e=>Vs(e).slice(8,-1),Wu=e=>Vs(e)==="[object Object]",za=e=>wt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,_s=Ha(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),li=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ad=/-\w/g,vn=li(e=>e.replace(ad,t=>t.slice(1).toUpperCase())),ld=/\B([A-Z])/g,cr=li(e=>e.replace(ld,"-$1").toLowerCase()),zu=li(e=>e.charAt(0).toUpperCase()+e.slice(1)),ta=li(e=>e?`on${zu(e)}`:""),En=(e,t)=>!Object.is(e,t),$o=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Gu=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},ui=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ud=e=>{const t=wt(e)?Number(e):NaN;return isNaN(t)?e:t};let Xl;const ci=()=>Xl||(Xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function rr(e){if(Re(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=wt(s)?pd(s):rr(s);if(o)for(const a in o)t[a]=o[a]}return t}else if(wt(e)||dt(e))return e}const cd=/;(?![^(]*\))/g,fd=/:([^]+)/,dd=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function pd(e){const t={};return e.replace(dd,n=>n.startsWith("/*")?"":n).split(cd).forEach(n=>{if(n){const s=n.split(fd);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ze(e){let t="";if(wt(e))t=e;else if(Re(e))for(let n=0;n<e.length;n++){const s=Ze(e[n]);s&&(t+=s+" ")}else if(dt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const hd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",vd=Ha(hd);function Yu(e){return!!e||e===""}function md(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=or(e[o],t[o],n);return s}function Ql(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),o=new Uint8Array(s.length);for(const a of e){let c=-1;for(let d=0;d<s.length;d++)if(!o[d]&&or(a,s[d],n)){c=d;break}if(c<0)return!1;o[c]=1}return!0}function yd(e,t,n){let s=nr(e),o=nr(t);if(s||o||(s=Ir(e),o=Ir(t),s||o))return s&&o?Ql(e,t,n):!1;const a=Object.keys(e).length,c=Object.keys(t).length;if(a!==c)return!1;for(const d in e){const h=e.hasOwnProperty(d),y=t.hasOwnProperty(d);if(h&&!y||!h&&y||!or(e[d],t[d],n))return!1}return String(e)===String(t)}function Zl(e,t,n,s){n||(n=[new Map,new Map]);const[o,a]=n;if(o.has(e)||a.has(t))return o.get(e)===t&&a.get(t)===e;o.set(e,t),a.set(t,e);const c=s(e,t,n);return o.delete(e),a.delete(t),c}function or(e,t,n){if(e===t)return!0;let s=Jl(e),o=Jl(t);return s||o?s&&o?e.getTime()===t.getTime():!1:(s=Tn(e),o=Tn(t),s||o?e===t:(s=Re(e),o=Re(t),s||o?s&&o?Zl(e,t,n,md):!1:(s=dt(e),o=dt(t),s||o?!s||!o?!1:Zl(e,t,n,yd):String(e)===String(t))))}function gd(e,t){return e.findIndex(n=>or(n,t))}const Ju=e=>!!(e&&e.__v_isRef===!0),ne=e=>wt(e)?e:e==null?"":Re(e)||dt(e)&&(e.toString===Hu||!ze(e.toString))?Ju(e)?ne(e.value):JSON.stringify(e,Xu,2):String(e),Xu=(e,t)=>Ju(t)?Xu(e,t.value):nr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],a)=>(n[na(s,a)+" =>"]=o,n),{})}:Ir(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>na(n))}:Tn(t)?na(t):dt(t)&&!Re(t)&&!Wu(t)?String(t):t,na=(e,t="")=>{var n;return Tn(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 Dt;class bd{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Dt&&(Dt.active?(this.parent=Dt,this.index=(Dt.scopes||(Dt.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=Dt;try{return Dt=this,t()}finally{Dt=n}}}on(){++this._on===1&&(this.prevScope=Dt,Dt=this)}off(){if(this._on>0&&--this._on===0){if(Dt===this)Dt=this.prevScope;else{let t=Dt;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function wd(){return Dt}let vt;const ra=new WeakSet;class Qu{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Dt&&(Dt.active?Dt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ra.has(this)&&(ra.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ec(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,eu(this),tc(this);const t=vt,n=mn;vt=this,mn=!0;try{return this.fn()}finally{nc(this),vt=t,mn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ja(t);this.deps=this.depsTail=void 0,eu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ra.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ya(this)&&this.run()}get dirty(){return ya(this)}}let Zu=0,ks,xs;function ec(e,t=!1){if(e.flags|=8,t){e.next=xs,xs=e;return}e.next=ks,ks=e}function Ga(){Zu++}function Ya(){if(--Zu>0)return;if(xs){let t=xs;for(xs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ks;){let t=ks;for(ks=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function tc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function nc(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Ja(s),_d(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function ya(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(rc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function rc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ps)||(e.globalVersion=Ps,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ya(e))))return;e.flags|=2;const t=e.dep,n=vt,s=mn;vt=e,mn=!0;try{tc(e);const o=e.fn(e._value);(t.version===0||En(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{vt=n,mn=s,nc(e),e.flags&=-3}}function Ja(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)Ja(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function _d(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let mn=!0;const sc=[];function An(){sc.push(mn),mn=!1}function Pn(){const e=sc.pop();mn=e===void 0?!0:e}function eu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=vt;vt=void 0;try{t()}finally{vt=n}}}let Ps=0;class kd{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Xa{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(!vt||!mn||vt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==vt)n=this.activeLink=new kd(vt,this),vt.deps?(n.prevDep=vt.depsTail,vt.depsTail.nextDep=n,vt.depsTail=n):vt.deps=vt.depsTail=n,oc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=vt.depsTail,n.nextDep=void 0,vt.depsTail.nextDep=n,vt.depsTail=n,vt.deps===n&&(vt.deps=s)}return n}trigger(t){this.version++,Ps++,this.notify(t)}notify(t){Ga();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ya()}}}function oc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)oc(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ga=new WeakMap,Or=Symbol(""),ba=Symbol(""),Os=Symbol("");function Bt(e,t,n){if(mn&&vt){let s=ga.get(e);s||ga.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Xa),o.map=s,o.key=n),o.track()}}function Rn(e,t,n,s,o,a){const c=ga.get(e);if(!c){Ps++;return}const d=h=>{h&&h.trigger()};if(Ga(),t==="clear")c.forEach(d);else{const h=Re(e),y=h&&za(n);if(h&&n==="length"){const m=Number(s);c.forEach((_,C)=>{(C==="length"||C===Os||!Tn(C)&&C>=m)&&d(_)})}else switch((n!==void 0||c.has(void 0))&&d(c.get(n)),y&&d(c.get(Os)),t){case"add":h?y&&d(c.get("length")):(d(c.get(Or)),nr(e)&&d(c.get(ba)));break;case"delete":h||(d(c.get(Or)),nr(e)&&d(c.get(ba)));break;case"set":nr(e)&&d(c.get(Or));break}}Ya()}function Hr(e){const t=lt(e);return t===e||(Bt(t,"iterate",Os),un(e))?t:On(e)?sr(e)?t.map(n=>ir(cn(n))):t.map(ir):t.map(cn)}function fi(e){return Bt(e=lt(e),"iterate",Os),e}function xn(e,t){return On(e)?ir(sr(e)?cn(t):t):cn(t)}const xd={__proto__:null,[Symbol.iterator](){return sa(this,Symbol.iterator,e=>xn(this,e))},concat(...e){return Hr(this).concat(...e.map(t=>Re(t)?Hr(t):t))},entries(){return sa(this,"entries",e=>(e[1]=xn(this,e[1]),e))},every(e,t){return jn(this,"every",e,t,void 0,arguments)},filter(e,t){return jn(this,"filter",e,t,n=>n.map(s=>xn(this,s)),arguments)},find(e,t){return jn(this,"find",e,t,n=>xn(this,n),arguments)},findIndex(e,t){return jn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return jn(this,"findLast",e,t,n=>xn(this,n),arguments)},findLastIndex(e,t){return jn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return jn(this,"forEach",e,t,void 0,arguments)},includes(...e){return oa(this,"includes",e)},indexOf(...e){return oa(this,"indexOf",e)},join(e){return Hr(this).join(e)},lastIndexOf(...e){return oa(this,"lastIndexOf",e)},map(e,t){return jn(this,"map",e,t,void 0,arguments)},pop(){return vs(this,"pop")},push(...e){return vs(this,"push",e)},reduce(e,...t){return nu(this,"reduce",e,t)},reduceRight(e,...t){return nu(this,"reduceRight",e,t)},shift(){return vs(this,"shift")},some(e,t){return jn(this,"some",e,t,void 0,arguments)},splice(...e){return vs(this,"splice",e)},toReversed(){return Hr(this).toReversed()},toSorted(e){return Hr(this).toSorted(e)},toSpliced(...e){return Hr(this).toSpliced(...e)},unshift(...e){return vs(this,"unshift",e)},values(){return sa(this,"values",e=>xn(this,e))}};function sa(e,t,n){const s=fi(e),o=s[t],a=o.call(s);if(s!==e&&!un(e)){if(a[Symbol.toStringTag]==="Array Iterator"){const c=Object.create(Object.getPrototypeOf(a));return c.next=()=>tu(a.next(),n),o!==ic[t]&&Object.defineProperties(c,{return:{get(){const d=a.return;return typeof d=="function"?d.bind(a):d}},throw:{get(){const d=a.throw;return typeof d=="function"?d.bind(a):d}}}),c}a._next=a.next,a.next=()=>tu(a._next(),n)}return a}function tu(e,t){return e.done||(e.value=t(e.value)),e}const ic=Array.prototype;function jn(e,t,n,s,o,a){const c=fi(e),d=c!==e&&!un(e),h=c[t];if(h!==ic[t]){const _=h.apply(e,a);return d?cn(_):_}let y=n;c!==e&&(d?y=function(_,C){return n.call(this,xn(e,_),C,e)}:n.length>2&&(y=function(_,C){return n.call(this,_,C,e)}));const m=h.call(c,y,s);return d&&o?o(m):m}function nu(e,t,n,s){const o=fi(e),a=o!==e&&!un(e);let c=n,d=!1;o!==e&&(a?(d=s.length===0,c=function(y,m,_){return d&&(d=!1,y=xn(e,y)),n.call(this,y,xn(e,m),_,e)}):n.length>3&&(c=function(y,m,_){return n.call(this,y,m,_,e)}));const h=o[t](c,...s);return d?xn(e,h):h}function oa(e,t,n){const s=lt(e);Bt(s,"iterate",Os);const o=s[t](...n);return(o===-1||o===!1)&&tl(n[0])?(n[0]=lt(n[0]),s[t](...n)):o}function vs(e,t,n=[]){An(),Ga();const s=lt(e)[t].apply(e,n);return Ya(),Pn(),s}const Cd=Ha("__proto__,__v_isRef,__isVue"),ac=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Tn));function Sd(e){Tn(e)||(e=String(e));const t=lt(this);return Bt(t,"has",e),t.hasOwnProperty(e)}class lc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return a;if(n==="__v_raw")return s===(o?a?Dd:dc:a?fc:cc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const c=Re(t);if(!o){let h;if(c&&(h=xd[n]))return h;if(n==="hasOwnProperty")return Sd}const d=Reflect.get(t,n,qt(t)?t:s);if((Tn(n)?ac.has(n):Cd(n))||(o||Bt(t,"get",n),a))return d;if(qt(d)){const h=c&&za(n)?d:d.value;return o&&dt(h)?_a(h):h}return dt(d)?o?_a(d):Za(d):d}}class uc extends lc{constructor(t=!1){super(!1,t)}set(t,n,s,o){let a=t[n];const c=Re(t)&&za(n);if(!this._isShallow){const y=On(a);if(!un(s)&&!On(s)&&(a=lt(a),s=lt(s)),!c&&qt(a)&&!qt(s))return y||(a.value=s),!0}const d=c?Number(n)<t.length:ft(t,n),h=Reflect.set(t,n,s,qt(t)?t:o);return t===lt(o)&&h&&(d?En(s,a)&&Rn(t,"set",n,s):Rn(t,"add",n,s)),h}deleteProperty(t,n){const s=ft(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(!Tn(n)||!ac.has(n))&&Bt(t,"has",n),s}ownKeys(t){return Bt(t,"iterate",Re(t)?"length":Or),Reflect.ownKeys(t)}}class Ed extends lc{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const $d=new uc,Td=new Ed,Ad=new uc(!0);const wa=e=>e,wo=e=>Reflect.getPrototypeOf(e);function Pd(e,t,n){return function(...s){const o=this.__v_raw,a=lt(o),c=nr(a),d=e==="entries"||e===Symbol.iterator&&c,h=e==="keys"&&c,y=o[e](...s),m=n?wa:t?ir:cn;return!t&&Bt(a,"iterate",h?ba:Or),$t(Object.create(y),{next(){const{value:_,done:C}=y.next();return C?{value:_,done:C}:{value:d?[m(_[0]),m(_[1])]:m(_),done:C}}})}}function _o(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Od(e,t){const n={get(o){const a=this.__v_raw,c=lt(a),d=lt(o);e||(En(o,d)&&Bt(c,"get",o),Bt(c,"get",d));const{has:h}=wo(c),y=t?wa:e?ir:cn;if(h.call(c,o))return y(a.get(o));if(h.call(c,d))return y(a.get(d));a!==c&&a.get(o)},get size(){const o=this.__v_raw;return!e&&Bt(lt(o),"iterate",Or),o.size},has(o){const a=this.__v_raw,c=lt(a),d=lt(o);return e||(En(o,d)&&Bt(c,"has",o),Bt(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=lt(d),y=t?wa:e?ir:cn;return!e&&Bt(h,"iterate",Or),d.forEach((m,_)=>o.call(a,y(m),y(_),c))}};return $t(n,e?{add:_o("add"),set:_o("set"),delete:_o("delete"),clear:_o("clear")}:{add(o){const a=lt(this),c=wo(a),d=lt(o),h=!t&&!un(o)&&!On(o)?d:o;return c.has.call(a,h)||En(o,h)&&c.has.call(a,o)||En(d,h)&&c.has.call(a,d)||(a.add(h),Rn(a,"add",h,h)),this},set(o,a){!t&&!un(a)&&!On(a)&&(a=lt(a));const c=lt(this),{has:d,get:h}=wo(c);let y=d.call(c,o);y||(o=lt(o),y=d.call(c,o));const m=h.call(c,o);return c.set(o,a),y?En(a,m)&&Rn(c,"set",o,a):Rn(c,"add",o,a),this},delete(o){const a=lt(this),{has:c,get:d}=wo(a);let h=c.call(a,o);h||(o=lt(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=lt(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]=Pd(o,e,t)}),n}function Qa(e,t){const n=Od(e,t);return(s,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?s:Reflect.get(ft(n,o)&&o in s?n:s,o,a)}const Md={get:Qa(!1,!1)},Id={get:Qa(!1,!0)},jd={get:Qa(!0,!1)};const cc=new WeakMap,fc=new WeakMap,dc=new WeakMap,Dd=new WeakMap;function Ld(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Za(e){return On(e)?e:el(e,!1,$d,Md,cc)}function Rd(e){return el(e,!1,Ad,Id,fc)}function _a(e){return el(e,!0,Td,jd,dc)}function el(e,t,n,s,o){if(!dt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const a=o.get(e);if(a)return a;const c=Ld(id(e));if(c===0)return e;const d=new Proxy(e,c===2?s:n);return o.set(e,d),d}function sr(e){return On(e)?sr(e.__v_raw):!!(e&&e.__v_isReactive)}function On(e){return!!(e&&e.__v_isReadonly)}function un(e){return!!(e&&e.__v_isShallow)}function tl(e){return e?!!e.__v_raw:!1}function lt(e){const t=e&&e.__v_raw;return t?lt(t):e}function Kd(e){return!ft(e,"__v_skip")&&Object.isExtensible(e)&&Gu(e,"__v_skip",!0),e}const cn=e=>dt(e)?Za(e):e,ir=e=>dt(e)?_a(e):e;function qt(e){return e?e.__v_isRef===!0:!1}function N(e){return Fd(e,!1)}function Fd(e,t){return qt(e)?e:new Nd(e,t)}class Nd{constructor(t,n){this.dep=new Xa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:lt(t),this._value=n?t:cn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||un(t)||On(t);t=s?t:lt(t),En(t,n)&&(this._rawValue=t,this._value=s?t:cn(t),this.dep.trigger())}}function Kt(e){return qt(e)?e.value:e}const Vd={get:(e,t,n)=>t==="__v_raw"?e:Kt(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return qt(o)&&!qt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function pc(e){return sr(e)?e:new Proxy(e,Vd)}class Bd{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Xa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ps-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&vt!==this)return ec(this,!0),!0}get value(){const t=this.dep.track();return rc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ud(e,t,n=!1){let s,o;return ze(e)?s=e:(s=e.get,o=e.set),new Bd(s,o,n)}const ko={},Ro=new WeakMap;let Sr;function qd(e,t=!1,n=Sr){if(n){let s=Ro.get(n);s||Ro.set(n,s=[]),s.push(e)}}function Hd(e,t,n=pt){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:d,call:h}=n,y=X=>o?X:un(X)||o===!1||o===0?Kn(X,1):Kn(X);let m,_,C,A,V=!1,Z=!1;if(qt(e)?(_=()=>e.value,V=un(e)):sr(e)?(_=()=>y(e),V=!0):Re(e)?(Z=!0,V=e.some(X=>sr(X)||un(X)),_=()=>e.map(X=>{if(qt(X))return X.value;if(sr(X))return y(X);if(ze(X))return h?h(X,2):X()})):ze(e)?t?_=h?()=>h(e,2):e:_=()=>{if(C){An();try{C()}finally{Pn()}}const X=Sr;Sr=m;try{return h?h(e,3,[A]):e(A)}finally{Sr=X}}:_=$n,t&&o){const X=_,fe=o===!0?1/0:o;_=()=>Kn(X(),fe)}const te=wd(),ue=()=>{m.stop(),te&&te.active&&Wa(te.effects,m)};if(a&&t){const X=t;t=(...fe)=>{try{return X(...fe)}finally{ue()}}}let P=Z?new Array(e.length).fill(ko):ko;const R=X=>{if(!(!(m.flags&1)||!m.dirty&&!X))if(t){const fe=m.run();if(X||o||V||(Z?fe.some((ie,ee)=>En(ie,P[ee])):En(fe,P))){const ie=Sr;An();try{C&&C(),Sr=m;const ee=[fe,P===ko?void 0:Z&&P[0]===ko?[]:P,A];P=fe,h?h(t,3,ee):t(...ee)}finally{Sr=ie,Pn()}}}else m.run()};return d&&d(R),m=new Qu(_),m.scheduler=c?()=>c(R,!1):R,A=X=>qd(X,!1,m),C=m.onStop=()=>{const X=Ro.get(m);if(X){if(h)h(X,4);else for(const fe of X)fe();Ro.delete(m)}},t?s?R(!0):P=m.run():c?c(R.bind(null,!0),!0):m.run(),ue.pause=m.pause.bind(m),ue.resume=m.resume.bind(m),ue.stop=ue,ue}function Kn(e,t=1/0,n){if(t<=0||!dt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,qt(e))Kn(e.value,t,n);else if(Re(e))for(let s=0;s<e.length;s++)Kn(e[s],t,n);else if(Ir(e)||nr(e))e.forEach(s=>{Kn(s,t,n)});else if(Wu(e)){for(const s in e)Kn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Kn(e[s],t,n)}return e}/**
* @vue/runtime-core v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Bs(e,t,n,s){try{return s?e(...s):e()}catch(o){di(o,t,n)}}function fn(e,t,n,s){if(ze(e)){const o=Bs(e,t,n,s);return o&&qu(o)&&o.catch(a=>{di(a,t,n)}),o}if(Re(e)){const o=[];for(let a=0;a<e.length;a++)o.push(fn(e[a],t,n,s));return o}}function di(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||pt;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 _=0;_<m.length;_++)if(m[_](e,h,y)===!1)return}d=d.parent}if(a){An(),Bs(a,null,10,[e,h,y]),Pn();return}}Wd(e,n,o,s,c)}function Wd(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Jt=[];let pn=-1;const Cn=[];let er=null,Wr=0;const hc=Promise.resolve();let Ko=null;function rs(e){const t=Ko||hc;return e?t.then(this?e.bind(this):e):t}function zd(e){let t=pn+1,n=Jt.length;for(;t<n;){const s=t+n>>>1,o=Jt[s],a=Ms(o);a<e||a===e&&o.flags&2?t=s+1:n=s}return t}function nl(e){if(!(e.flags&1)){const t=Ms(e),n=Jt[Jt.length-1];!n||!(e.flags&2)&&t>=Ms(n)?Jt.push(e):Jt.splice(zd(t),0,e),e.flags|=1,vc()}}function vc(){Ko||(Ko=hc.then(gc))}function Gd(e){if(!Re(e))er&&e.id===-1?er.splice(Wr+1,0,e):e.flags&1||(Cn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Cn.push(e[t]);vc()}function mc(e,t,n,s=pn+1){for(;s<Jt.length;s++){const o=Jt[s];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;Jt.splice(s,1),s=e?s-1:pn,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function yc(e,t,n=0){if(Cn.length){let s=Cn,o=0;if(t){s=[];for(let c=0;c<Cn.length;c++){const d=Cn[c];(d.i!==void 0?!d.i||d.i.uid<n:t.has(d))?Cn[o++]=d:s.push(d)}}const a=[...new Set(s)].sort((c,d)=>Ms(c)-Ms(d));if(Cn.length=o,er){for(let c=0;c<a.length;c++)er.push(a[c]);return}for(er=a,Wr=0;Wr<er.length;Wr++){const c=er[Wr];c.flags&4&&(c.flags&=-2),c.flags&8||c(),c.flags&=-2}er=null,Wr=0}}let ia=!1;function Yd(e,t){if(ia){e();return}const n=t===void 0?void 0:new Set(Cn);e(),ia=!0;try{mc(void 0,t),yc(void 0,n,t)}finally{ia=!1}}const Ms=e=>e.id==null?e.flags&2?-1:1/0:e.id;function gc(e){try{for(pn=0;pn<Jt.length;pn++){const t=Jt[pn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Bs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;pn<Jt.length;pn++){const t=Jt[pn];t&&(t.flags&=-2)}pn=-1,Jt.length=0,yc(),Ko=null,(Jt.length||Cn.length)&&gc()}}let ln=null,bc=null;function Fo(e){const t=ln;return ln=e,bc=e&&e.type.__scopeId||null,t}function fr(e,t=ln,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Uo(-1);const a=Fo(t),c=Mr.length;let d;try{d=e(...o)}finally{for(let h=Mr.length;h>c;h--)zc();Fo(a),s._d&&Uo(1)}return d};return s._n=!0,s._c=!0,s._d=!0,s}function Ae(e,t){if(ln===null)return e;const n=gi(ln),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,c,d,h=pt]=t[o];a&&(ze(a)&&(a={mounted:a,updated:a}),a.deep&&Kn(c),s.push({dir:a,instance:n,value:c,oldValue:void 0,arg:d,modifiers:h}))}return e}function kr(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(),fn(h,n,8,[e.el,d,e,t]),Pn())}}function Jd(e,t){if(Xt){let n=Xt.provides;const s=Xt.parent&&Xt.parent.provides;s===n&&(n=Xt.provides=Object.create(s)),n[e]=t}}function To(e,t,n=!1){const s=al();if(s||Yr){let o=Yr?Yr._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&ze(t)?t.call(s&&s.proxy):t}}const Xd=Symbol.for("v-scx"),Qd=()=>To(Xd);function mt(e,t,n){return wc(e,t,n)}function wc(e,t,n=pt){const{immediate:s,deep:o,flush:a,once:c}=n,d=$t({},n),h=t&&s||!t&&a!=="post";let y;if(Ks){if(a==="sync"){const A=Qd();y=A.__watcherHandles||(A.__watcherHandles=[])}else if(!h){const A=()=>{};return A.stop=$n,A.resume=$n,A.pause=$n,A}}const m=Xt;d.call=(A,V,Z)=>fn(A,m,V,Z);let _=!1;a==="post"?d.scheduler=A=>{A.i=m,Yt(A,m&&m.suspense)}:a!=="sync"&&(_=!0,d.scheduler=(A,V)=>{V?A():nl(A)}),d.augmentJob=A=>{t&&(A.flags|=4),_&&(A.flags|=2,m&&(A.id=m.uid,A.i=m))};const C=Hd(e,t,d);return Ks&&(y?y.push(C):h&&C()),C}function Zd(e,t,n){const s=this.proxy,o=wt(e)?e.includes(".")?_c(s,e):()=>s[e]:e.bind(s,s);let a;ze(t)?a=t:(a=t.handler,n=t);const c=qs(this),d=wc(o,a.bind(s),n);return c(),d}function _c(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Qn=new WeakMap,kc=Symbol("_vte"),pi=e=>e.__isTeleport,Er=e=>e&&(e.disabled||e.disabled===""),ep=e=>e&&(e.defer||e.defer===""),ru=e=>typeof SVGElement<"u"&&e instanceof SVGElement,su=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ka=(e,t)=>{const n=e&&e.to;return wt(n)?t?t(n):null:n},tp={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,a,c,d,h,y){const{mc:m,pc:_,pbc:C,o:{insert:A,querySelector:V,createText:Z,createComment:te,parentNode:ue}}=y,P=Er(t.props);let{dynamicChildren:R}=t;const X=(ee,M,S)=>{ee.shapeFlag&16&&m(ee.children,M,S,o,a,c,d,h)},fe=(ee=t)=>{const M=Er(ee.props),S=ee.target=ka(ee.props,V),oe=xa(S,ee,Z,A);S&&(c!=="svg"&&ru(S)?c="svg":c!=="mathml"&&su(S)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(S),M||(X(ee,S,oe),gs(ee,!1)))},ie=ee=>{const M=()=>{if(Qn.get(ee)===M){if(Qn.delete(ee),Er(ee.props)){const S=ue(ee.el)||n;X(ee,S,ee.anchor),gs(ee,!0)}fe(ee)}};Qn.set(ee,M),Yt(M,a)};if(e==null){const ee=t.el=Z(""),M=t.anchor=Z("");if(A(ee,n,s),A(M,n,s),ep(t.props)||a&&a.pendingBranch){ie(t);return}P&&(X(t,n,M),gs(t,!0)),fe()}else{t.el=e.el;const ee=t.anchor=e.anchor,M=Qn.get(e);if(M){M.flags|=8,Qn.delete(e),ie(t);return}t.targetStart=e.targetStart;const S=t.target=e.target,oe=t.targetAnchor=e.targetAnchor,be=Er(e.props),z=be?n:S,xe=be?ee:oe;if(c==="svg"||ru(S)?c="svg":(c==="mathml"||su(S))&&(c="mathml"),R?(C(e.dynamicChildren,R,z,o,a,c,d),il(e,t,!0)):h||_(e,t,z,xe,o,a,c,d,!1),P)be?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):xo(t,n,ee,y,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Le=ka(t.props,V);Le&&(t.target=Le,xo(t,Le,null,y,0))}else be&&xo(t,S,oe,y,1);gs(t,P)}},remove(e,t,n,{um:s,o:{remove:o}},a){const{shapeFlag:c,children:d,anchor:h,targetStart:y,targetAnchor:m,target:_,props:C}=e,A=Er(C),V=a||!A,Z=Qn.get(e);if(Z&&(Z.flags|=8,Qn.delete(e)),_&&(o(y),o(m)),a&&o(h),!Z&&(A||_)&&c&16)for(let te=0;te<d.length;te++){const ue=d[te];s(ue,t,n,V,!!ue.dynamicChildren)}},move:xo,hydrate:np};function xo(e,t,n,{o:{insert:s},m:o},a=2){a===0&&(e.targetStart&&s(e.targetStart,t,n),s(e.targetAnchor,t,n),n=e.targetAnchor);const{el:c,anchor:d,shapeFlag:h,children:y,props:m}=e,_=a===2;if(_&&s(c,t,n),!Qn.has(e)&&(!_||Er(m))&&h&16)for(let C=0;C<y.length;C++)o(y[C],t,n,2);_&&s(d,t,n)}function np(e,t,n,s,o,a,{o:{nextSibling:c,parentNode:d,querySelector:h,insert:y,createText:m}},_){function C(te,ue){let P=ue;for(;P;){if(P&&P.nodeType===8){if(P.data==="teleport start anchor")t.targetStart=P;else if(P.data==="teleport anchor"){t.targetAnchor=P,te._lpa=t.targetAnchor&&c(t.targetAnchor);break}}P=c(P)}}function A(te,ue){ue.anchor=_(c(te),ue,d(te),n,s,o,a)}const V=t.target=ka(t.props,h),Z=Er(t.props);if(V){const te=V._lpa||V.firstChild;t.shapeFlag&16&&(Z?(A(e,t),C(V,te),t.targetAnchor||xa(V,t,m,y,d(e)===V?e:null)):(t.anchor=c(e),C(V,te),t.targetAnchor||xa(V,t,m,y),_(te&&c(te),t,V,n,s,o,a))),gs(t,Z)}else Z&&t.shapeFlag&16&&(A(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const Us=tp;function gs(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function xa(e,t,n,s,o=null){const a=t.targetStart=n(""),c=t.targetAnchor=n("");return a[kc]=c,e&&(s(a,e,o),s(c,e,o)),c}const an=Symbol("_leaveCb"),ms=Symbol("_enterCb");function xc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return yn(()=>{e.isMounted=!0}),Pc(()=>{e.isUnmounting=!0}),e}const on=[Function,Array],Cc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:on,onEnter:on,onAfterEnter:on,onEnterCancelled:on,onBeforeLeave:on,onLeave:on,onAfterLeave:on,onLeaveCancelled:on,onBeforeAppear:on,onAppear:on,onAfterAppear:on,onAppearCancelled:on},rp={name:"BaseTransition",props:Cc,setup(e,{slots:t}){const n=al(),s=xc();return()=>{const o=t.default&&rl(t.default(),!0),a=o&&o.length?Sc(o):n.subTree?Ee():void 0;if(!a)return;const c=lt(e),{mode:d}=c;if(s.isLeaving)return aa(a);const h=No(a);if(!h)return aa(a);let y=Is(h,c,s,n,_=>y=_);h.type!==Ut&&ar(h,y);let m=n.subTree&&No(n.subTree);if(m&&m.type!==Ut&&!$r(m,h)&&js(n.subTree)){let _=Is(m,c,s,n);if(ar(m,_),d==="out-in"&&h.type!==Ut)return s.isLeaving=!0,_.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete _.afterLeave,m=void 0},aa(a);d==="in-out"&&h.type!==Ut?_.delayLeave=(C,A,V)=>{const Z=Ec(s,m);Z[String(m.key)]=m,C[an]=()=>{A(),C[an]=void 0,delete y.delayedLeave,m=void 0},y.delayedLeave=()=>{V(),delete y.delayedLeave,m=void 0}}:m=void 0}else m&&(m=void 0);return a}}};function Sc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ut){t=n;break}}return t}const sp=rp;function Ec(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Is(e,t,n,s,o){const{appear:a,mode:c,persisted:d=!1,onBeforeEnter:h,onEnter:y,onAfterEnter:m,onEnterCancelled:_,onBeforeLeave:C,onLeave:A,onAfterLeave:V,onLeaveCancelled:Z,onBeforeAppear:te,onAppear:ue,onAfterAppear:P,onAppearCancelled:R}=t,X=String(e.key),fe=Ec(n,e),ie=(S,oe)=>{S&&fn(S,s,9,oe)},ee=(S,oe)=>{const be=oe[1];ie(S,oe),Re(S)?S.every(z=>z.length<=1)&&be():S.length<=1&&be()},M={mode:c,persisted:d,beforeEnter(S){let oe=h;if(!n.isMounted)if(a)oe=te||h;else return;S[an]&&S[an](!0);const be=fe[X];if(be&&$r(e,be)){let z=be.el[an];if(!z){const xe=js(be);z=xe&&xe.el[an]}z&&z()}ie(oe,[S])},enter(S){if(fe[X]===e)return;let oe=y,be=m,z=_;if(!n.isMounted)if(a)oe=ue||y,be=P||m,z=R||_;else return;let xe=!1;S[ms]=rt=>{xe||(xe=!0,rt?ie(z,[S]):ie(be,[S]),M.delayedLeave&&M.delayedLeave(),S[ms]=void 0)};const Le=S[ms].bind(null,!1);oe?ee(oe,[S,Le]):Le()},leave(S,oe){const be=String(e.key);if(S[ms]&&S[ms](!0),n.isUnmounting)return oe();ie(C,[S]);let z=!1;S[an]=Le=>{z||(z=!0,oe(),Le?ie(Z,[S]):ie(V,[S]),S[an]=void 0,fe[be]===e&&delete fe[be])};const xe=S[an].bind(null,!1);fe[be]=e,A?ee(A,[S,xe]):xe()},clone(S){const oe=Is(S,t,n,s,o);return o&&o(oe),oe}};return M}function aa(e){if(hi(e))return e=lr(e),e.children=null,e}function No(e){if(!hi(e))return pi(e.type)&&e.children?Sc(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&ze(n.default))return n.default()}}function ar(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;ar(pi(n.type)&&No(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===je&&Re(e.children)){const n=Dc(e.children,!1);n&&ar(n,t)}}function rl(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===je?(c.patchFlag&128&&o++,s=s.concat(rl(c.children,t,d))):(t||c.type!==Ut)&&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 js(e){if(e.component)return js(e.component.subTree);if(e.type===je){const t=Re(e.children)&&Dc(e.children,!1);return t?js(t):void 0}if(e.type!==Ut)return e}function Ht(e,t){return ze(e)?$t({name:e.name},t,{setup:e}):e}function $c(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ou(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vo=new WeakMap;function Cs(e,t,n,s,o=!1){if(Re(e)){e.forEach((Z,te)=>Cs(Z,t&&(Re(t)?t[te]:t),n,s,o));return}if(Ss(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Cs(e,t,n,s.component.subTree);return}const a=s.shapeFlag&4?gi(s.component):s.el,c=o?null:a,{i:d,r:h}=e,y=t&&t.r,m=d.refs===pt?d.refs={}:d.refs,_=d.setupState,C=lt(_),A=_===pt?Uu:Z=>ou(m,Z)?!1:ft(C,Z),V=(Z,te)=>!(te&&ou(m,te));if(y!=null&&y!==h){if(iu(t),wt(y))m[y]=null,A(y)&&(_[y]=null);else if(qt(y)){const Z=t;V(y,Z.k)&&(y.value=null),Z.k&&(m[Z.k]=null)}}if(ze(h))Bs(h,d,12,[c,m]);else{const Z=wt(h),te=qt(h);if(Z||te){const ue=()=>{if(e.f){const P=Z?A(h)?_[h]:m[h]:V()||!e.k?h.value:m[e.k];if(o)Re(P)&&Wa(P,a);else if(Re(P))P.includes(a)||P.push(a);else if(Z)m[h]=[a],A(h)&&(_[h]=m[h]);else{const R=[a];V(h,e.k)&&(h.value=R),e.k&&(m[e.k]=R)}}else Z?(m[h]=c,A(h)&&(_[h]=c)):te&&(V(h,e.k)&&(h.value=c),e.k&&(m[e.k]=c))};if(c){const P=()=>{ue(),Vo.delete(e)};P.id=-1,Vo.set(e,P),Yt(P,n)}else iu(e),ue()}}}function iu(e){const t=Vo.get(e);t&&(t.flags|=8,Vo.delete(e))}ci().requestIdleCallback;ci().cancelIdleCallback;const Ss=e=>!!e.type.__asyncLoader,hi=e=>e.type.__isKeepAlive;function op(e,t){Tc(e,"a",t)}function ip(e,t){Tc(e,"da",t)}function Tc(e,t,n=Xt){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(vi(t,s,n),n){let o=n.parent;for(;o&&o.parent;)hi(o.parent.vnode)&&ap(s,t,n,o),o=o.parent}}function ap(e,t,n,s){const o=vi(t,e,s,!0);dr(()=>{Wa(s[t],o)},n)}function vi(e,t,n=Xt,s=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...c)=>{An();const d=qs(n),h=fn(t,n,e,c);return d(),Pn(),h});return s?o.unshift(a):o.push(a),a}}const Un=e=>(t,n=Xt)=>{(!Ks||e==="sp")&&vi(e,(...s)=>t(...s),n)},lp=Un("bm"),yn=Un("m"),up=Un("bu"),Ac=Un("u"),Pc=Un("bum"),dr=Un("um"),cp=Un("sp"),fp=Un("rtg"),dp=Un("rtc");function pp(e,t=Xt){vi("ec",e,t)}const hp=Symbol.for("v-ndc");function it(e,t,n,s){let o;const a=n,c=Re(e);if(c||wt(e)){const d=c&&sr(e);let h=!1,y=!1;d&&(h=!un(e),y=On(e),e=fi(e)),o=new Array(e.length);for(let m=0,_=e.length;m<_;m++)o[m]=t(h?y?ir(cn(e[m])):cn(e[m]):e[m],m,void 0,a)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)o=[];else{o=new Array(e);for(let d=0;d<e;d++)o[d]=t(d+1,d,void 0,a)}else if(dt(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 Ca=e=>e?Xc(e)?gi(e):Ca(e.parent):null,Es=$t(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ca(e.parent),$root:e=>Ca(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Mc(e),$forceUpdate:e=>e.f||(e.f=()=>{nl(e.update)}),$nextTick:e=>e.n||(e.n=rs.bind(e.proxy)),$watch:e=>Zd.bind(e)}),la=(e,t)=>e!==pt&&!e.__isScriptSetup&&ft(e,t),vp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:c,type:d,appContext:h}=e;if(t[0]!=="$"){const C=c[t];if(C!==void 0)switch(C){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(la(s,t))return c[t]=1,s[t];if(o!==pt&&ft(o,t))return c[t]=2,o[t];if(ft(a,t))return c[t]=3,a[t];if(n!==pt&&ft(n,t))return c[t]=4,n[t];Sa&&(c[t]=0)}}const y=Es[t];let m,_;if(y)return t==="$attrs"&&Bt(e.attrs,"get",""),y(e);if((m=d.__cssModules)&&(m=m[t]))return m;if(n!==pt&&ft(n,t))return c[t]=4,n[t];if(_=h.config.globalProperties,ft(_,t))return _[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:a}=e;return la(o,t)?(o[t]=n,!0):s!==pt&&ft(s,t)?(s[t]=n,!0):ft(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!==pt&&d[0]!=="$"&&ft(e,d)||la(t,d)||ft(a,d)||ft(s,d)||ft(Es,d)||ft(o.config.globalProperties,d)||(h=c.__cssModules)&&h[d])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ft(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function au(e){return Re(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Sa=!0;function mp(e){const t=Mc(e),n=e.proxy,s=e.ctx;Sa=!1,t.beforeCreate&&lu(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:c,watch:d,provide:h,inject:y,created:m,beforeMount:_,mounted:C,beforeUpdate:A,updated:V,activated:Z,deactivated:te,beforeDestroy:ue,beforeUnmount:P,destroyed:R,unmounted:X,render:fe,renderTracked:ie,renderTriggered:ee,errorCaptured:M,serverPrefetch:S,expose:oe,inheritAttrs:be,components:z,directives:xe,filters:Le}=t;if(y&&yp(y,s,null),c)for(const Ye in c){const Ke=c[Ye];ze(Ke)&&(s[Ye]=Ke.bind(n))}if(o){const Ye=o.call(n,n);dt(Ye)&&(e.data=Za(Ye))}if(Sa=!0,a)for(const Ye in a){const Ke=a[Ye],st=ze(Ke)?Ke.bind(n,n):ze(Ke.get)?Ke.get.bind(n,n):$n,qe=!ze(Ke)&&ze(Ke.set)?Ke.set.bind(n):$n,Qe=ut({get:st,set:qe});Object.defineProperty(s,Ye,{enumerable:!0,configurable:!0,get:()=>Qe.value,set:Ce=>Qe.value=Ce})}if(d)for(const Ye in d)Oc(d[Ye],s,n,Ye);if(h){const Ye=ze(h)?h.call(n):h;Reflect.ownKeys(Ye).forEach(Ke=>{Jd(Ke,Ye[Ke])})}m&&lu(m,e,"c");function He(Ye,Ke){Re(Ke)?Ke.forEach(st=>Ye(st.bind(n))):Ke&&Ye(Ke.bind(n))}if(He(lp,_),He(yn,C),He(up,A),He(Ac,V),He(op,Z),He(ip,te),He(pp,M),He(dp,ie),He(fp,ee),He(Pc,P),He(dr,X),He(cp,S),Re(oe))if(oe.length){const Ye=e.exposed||(e.exposed={});oe.forEach(Ke=>{Object.defineProperty(Ye,Ke,{get:()=>n[Ke],set:st=>n[Ke]=st,enumerable:!0})})}else e.exposed||(e.exposed={});fe&&e.render===$n&&(e.render=fe),be!=null&&(e.inheritAttrs=be),z&&(e.components=z),xe&&(e.directives=xe),S&&$c(e)}function yp(e,t,n=$n){Re(e)&&(e=Ea(e));for(const s in e){const o=e[s];let a;dt(o)?"default"in o?a=To(o.from||s,o.default,!0):a=To(o.from||s):a=To(o),qt(a)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:c=>a.value=c}):t[s]=a}}function lu(e,t,n){fn(Re(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Oc(e,t,n,s){let o=s.includes(".")?_c(n,s):()=>n[s];if(wt(e)){const a=t[e];ze(a)&&mt(o,a)}else if(ze(e))mt(o,e.bind(n));else if(dt(e))if(Re(e))e.forEach(a=>Oc(a,t,n,s));else{const a=ze(e.handler)?e.handler.bind(n):t[e.handler];ze(a)&&mt(o,a,e)}}function Mc(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:c}}=e.appContext,d=a.get(t);let h;return d?h=d:!o.length&&!n&&!s?h=t:(h={},o.length&&o.forEach(y=>Bo(h,y,c,!0)),Bo(h,t,c)),dt(t)&&a.set(t,h),h}function Bo(e,t,n,s=!1){const{mixins:o,extends:a}=t;a&&Bo(e,a,n,!0),o&&o.forEach(c=>Bo(e,c,n,!0));for(const c in t)if(!(s&&c==="expose")){const d=gp[c]||n&&n[c];e[c]=d?d(e[c],t[c]):t[c]}return e}const gp={data:uu,props:cu,emits:cu,methods:bs,computed:bs,beforeCreate:Gt,created:Gt,beforeMount:Gt,mounted:Gt,beforeUpdate:Gt,updated:Gt,beforeDestroy:Gt,beforeUnmount:Gt,destroyed:Gt,unmounted:Gt,activated:Gt,deactivated:Gt,errorCaptured:Gt,serverPrefetch:Gt,components:bs,directives:bs,watch:wp,provide:uu,inject:bp};function uu(e,t){return t?e?function(){return $t(ze(e)?e.call(this,this):e,ze(t)?t.call(this,this):t)}:t:e}function bp(e,t){return bs(Ea(e),Ea(t))}function Ea(e){if(Re(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Gt(e,t){return e?[...new Set([].concat(e,t))]:t}function bs(e,t){return e?$t(Object.create(null),e,t):t}function cu(e,t){return e?Re(e)&&Re(t)?[...new Set([...e,...t])]:$t(Object.create(null),au(e),au(t??{})):t}function wp(e,t){if(!e)return t;if(!t)return e;const n=$t(Object.create(null),e);for(const s in t)n[s]=Gt(e[s],t[s]);return n}function Ic(){return{app:null,config:{isNativeTag:Uu,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let _p=0;function kp(e,t){return function(s,o=null){ze(s)||(s=$t({},s)),o!=null&&!dt(o)&&(o=null);const a=Ic(),c=new WeakSet,d=[];let h=!1;const y=a.app={_uid:_p++,_component:s,_props:o,_container:null,_context:a,_instance:null,version:eh,get config(){return a.config},set config(m){},use(m,..._){return c.has(m)||(m&&ze(m.install)?(c.add(m),m.install(y,..._)):ze(m)&&(c.add(m),m(y,..._))),y},mixin(m){return a.mixins.includes(m)||a.mixins.push(m),y},component(m,_){return _?(a.components[m]=_,y):a.components[m]},directive(m,_){return _?(a.directives[m]=_,y):a.directives[m]},mount(m,_,C){if(!h){const A=y._ceVNode||Te(s,o);return A.appContext=a,C===!0?C="svg":C===!1&&(C=void 0),e(A,m,C),h=!0,y._container=m,m.__vue_app__=y,gi(A.component)}},onUnmount(m){d.push(m)},unmount(){h&&(fn(d,y._instance,16),e(null,y._container),delete y._container.__vue_app__)},provide(m,_){return a.provides[m]=_,y},runWithContext(m){const _=Yr;Yr=y;try{return m()}finally{Yr=_}}};return y}}let Yr=null;const xp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${vn(t)}Modifiers`]||e[`${cr(t)}Modifiers`];function Cp(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||pt;let o=n;const a=t.startsWith("update:"),c=a&&xp(s,t.slice(7));c&&(c.trim&&(o=n.map(m=>wt(m)?m.trim():m)),c.number&&(o=o.map(ui)));let d,h=s[d=ta(t)]||s[d=ta(vn(t))];!h&&a&&(h=s[d=ta(cr(t))]),h&&fn(h,e,6,o);const y=s[d+"Once"];if(y){if(!e.emitted)e.emitted={};else if(e.emitted[d])return;e.emitted[d]=!0,fn(y,e,6,o)}}const Sp=new WeakMap;function jc(e,t,n=!1){const s=n?Sp:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const a=e.emits;let c={},d=!1;if(!ze(e)){const h=y=>{const m=jc(y,t,!0);m&&(d=!0,$t(c,m))};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}return!a&&!d?(dt(e)&&s.set(e,null),null):(Re(a)?a.forEach(h=>c[h]=null):$t(c,a),dt(e)&&s.set(e,c),c)}function mi(e,t){return!e||!ii(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),ft(e,t[0].toLowerCase()+t.slice(1))||ft(e,cr(t))||ft(e,t))}function fu(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[a],slots:c,attrs:d,emit:h,render:y,renderCache:m,props:_,data:C,setupState:A,ctx:V,inheritAttrs:Z}=e,te=Fo(e);let ue,P;try{if(n.shapeFlag&4){const X=o||s,fe=X;ue=Sn(y.call(fe,X,m,_,A,C,V)),P=d}else{const X=t;ue=Sn(X.length>1?X(_,{attrs:d,slots:c,emit:h}):X(_,null)),P=t.props?d:Ep(d)}}catch(X){Mr.length=0,di(X,e,1),ue=Te(Ut)}let R=ue;if(P&&Z!==!1){const X=Object.keys(P),{shapeFlag:fe}=R;X.length&&fe&7&&(a&&X.some(ai)&&(P=$p(P,a)),R=lr(R,P,!1,!0))}if(n.dirs&&(R=lr(R,null,!1,!0),R.dirs=R.dirs?R.dirs.concat(n.dirs):n.dirs),n.transition){const X=pi(R.type)&&No(R)||R;ar(X,n.transition)}return ue=R,Fo(te),ue}function Dc(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Ls(o)){if(o.type!==Ut||o.children==="v-if"){if(n)return;n=o}}else return}return n}const Ep=e=>{let t;for(const n in e)(n==="class"||n==="style"||ii(n))&&((t||(t={}))[n]=e[n]);return t},$p=(e,t)=>{const n={};for(const s in e)(!ai(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Tp(e,t,n){const{props:s,children:o,component:a}=e,{props:c,children:d,patchFlag:h}=t,y=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&h>=0){if(h&1024)return!0;if(h&16)return s?du(s,c,y):!!c;if(h&8){const m=t.dynamicProps;for(let _=0;_<m.length;_++){const C=m[_];if(Lc(c,s,C)&&!mi(y,C))return!0}}}else return(o||d)&&(!d||!d.$stable)?!0:s===c?!1:s?c?du(s,c,y):!0:!!c;return!1}function du(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const a=s[o];if(!ft(e,a)||Lc(t,e,a)&&!mi(n,a))return!0}return!1}function Lc(e,t,n){const s=e[n],o=t[n];return n==="style"&&dt(s)&&dt(o)?!or(s,o):s!==o}function Ap({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Rc={},Kc=()=>Object.create(Rc),Fc=e=>Object.getPrototypeOf(e)===Rc;function Pp(e,t,n,s=!1){const o={},a=Kc();e.propsDefaults=Object.create(null),Nc(e,t,o,a);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=s?o:Rd(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function Op(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:c}}=e,d=lt(o),[h]=e.propsOptions;let y=!1;if((s||c>0)&&!(c&16)){if(c&8){const m=e.vnode.dynamicProps;for(let _=0;_<m.length;_++){let C=m[_];if(mi(e.emitsOptions,C))continue;const A=t[C];if(h)if(ft(a,C))A!==a[C]&&(a[C]=A,y=!0);else{const V=vn(C);o[V]=$a(h,d,V,A,e,!1)}else A!==a[C]&&(a[C]=A,y=!0)}}}else{Nc(e,t,o,a)&&(y=!0);let m;for(const _ in d)(!t||!ft(t,_)&&((m=cr(_))===_||!ft(t,m)))&&(h?n&&(n[_]!==void 0||n[m]!==void 0)&&(o[_]=$a(h,d,_,void 0,e,!0)):delete o[_]);if(a!==d)for(const _ in a)(!t||!ft(t,_))&&(delete a[_],y=!0)}y&&Rn(e.attrs,"set","")}function Nc(e,t,n,s){const[o,a]=e.propsOptions;let c=!1,d;if(t)for(let h in t){if(_s(h))continue;const y=t[h];let m;o&&ft(o,m=vn(h))?!a||!a.includes(m)?n[m]=y:(d||(d={}))[m]=y:mi(e.emitsOptions,h)||(!(h in s)||y!==s[h])&&(s[h]=y,c=!0)}if(a){const h=lt(n),y=d||pt;for(let m=0;m<a.length;m++){const _=a[m];n[_]=$a(o,h,_,y[_],e,!ft(y,_))}}return c}function $a(e,t,n,s,o,a){const c=e[n];if(c!=null){const d=ft(c,"default");if(d&&s===void 0){const h=c.default;if(c.type!==Function&&!c.skipFactory&&ze(h)){const{propsDefaults:y}=o;if(n in y)s=y[n];else{const m=qs(o);s=y[n]=h.call(null,t),m()}}else s=h;o.ce&&o.ce._setProp(n,s)}c[0]&&(a&&!d?s=!1:c[1]&&(s===""||s===cr(n))&&(s=!0))}return s}const Mp=new WeakMap;function Vc(e,t,n=!1){const s=n?Mp:t.propsCache,o=s.get(e);if(o)return o;const a=e.props,c={},d=[];let h=!1;if(!ze(e)){const m=_=>{h=!0;const[C,A]=Vc(_,t,!0);$t(c,C),A&&d.push(...A)};!n&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}if(!a&&!h)return dt(e)&&s.set(e,Ar),Ar;if(Re(a))for(let m=0;m<a.length;m++){const _=vn(a[m]);pu(_)&&(c[_]=pt)}else if(a)for(const m in a){const _=vn(m);if(pu(_)){const C=a[m],A=c[_]=Re(C)||ze(C)?{type:C}:$t({},C),V=A.type;let Z=!1,te=!0;if(Re(V))for(let ue=0;ue<V.length;++ue){const P=V[ue],R=ze(P)&&P.name;if(R==="Boolean"){Z=!0;break}else R==="String"&&(te=!1)}else Z=ze(V)&&V.name==="Boolean";A[0]=Z,A[1]=te,(Z||ft(A,"default"))&&d.push(_)}}const y=[c,d];return dt(e)&&s.set(e,y),y}function pu(e){return e[0]!=="$"&&!_s(e)}const sl=e=>e==="_"||e==="_ctx"||e==="$stable",ol=e=>Re(e)?e.map(Sn):[Sn(e)],Ip=(e,t,n)=>{if(t._n)return t;const s=fr((...o)=>ol(t(...o)),n);return s._c=!1,s},Bc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(sl(o))continue;const a=e[o];if(ze(a))t[o]=Ip(o,a,s);else if(a!=null){const c=ol(a);t[o]=()=>c}}},Uc=(e,t)=>{const n=ol(t);e.slots.default=()=>n},qc=(e,t,n)=>{for(const s in t)(n||!sl(s))&&(e[s]=t[s])},jp=(e,t,n)=>{const s=e.slots=Kc();if(e.vnode.shapeFlag&32){const o=t._;o?(qc(s,t,n),n&&Gu(s,"_",o,!0)):Bc(t,s)}else t&&Uc(e,t)},Dp=(e,t,n)=>{const{vnode:s,slots:o}=e;let a=!0,c=pt;if(s.shapeFlag&32){const d=t._;d?n&&d===1?a=!1:qc(o,t,n):(a=!t.$stable,Bc(t,o)),c=t}else t&&(Uc(e,t),c={default:1});if(a)for(const d in o)!sl(d)&&c[d]==null&&delete o[d]},Yt=Np;function Lp(e){return Rp(e)}function Rp(e,t){const n=ci();n.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:c,createText:d,createComment:h,setText:y,setElementText:m,parentNode:_,nextSibling:C,setScopeId:A=$n,insertStaticContent:V}=e,Z=(x,k,b,W=null,re=null,le=null,ge=void 0,me=null,ae=!!k.dynamicChildren)=>{if(x===k)return;x&&!$r(x,k)&&(W=ct(x),Ce(x,re,le,!0),x=null),k.patchFlag===-2&&(ae=!1,k.dynamicChildren=null),k.dynamicChildren&&x&&x.dynamicChildren&&x.dynamicChildren.hasOnce&&(k.dynamicChildren===Ar&&(k.dynamicChildren=[]),k.dynamicChildren.hasOnce=!0);const{type:q,ref:H,shapeFlag:Y}=k;switch(q){case yi:te(x,k,b,W);break;case Ut:ue(x,k,b,W);break;case Ao:x==null&&P(k,b,W,ge);break;case je:z(x,k,b,W,re,le,ge,me,ae);break;default:Y&1?fe(x,k,b,W,re,le,ge,me,ae):Y&6?xe(x,k,b,W,re,le,ge,me,ae):(Y&64||Y&128)&&q.process(x,k,b,W,re,le,ge,me,ae,$e)}H!=null&&re?Cs(H,x&&x.ref,le,k||x,!k):H==null&&x&&x.ref!=null&&Cs(x.ref,null,le,x,!0)},te=(x,k,b,W)=>{if(x==null)s(k.el=d(k.children),b,W);else{const re=k.el=x.el;k.children!==x.children&&y(re,k.children)}},ue=(x,k,b,W)=>{x==null?s(k.el=h(k.children||""),b,W):k.el=x.el},P=(x,k,b,W)=>{[x.el,x.anchor]=V(x.children,k,b,W,x.el,x.anchor)},R=({el:x,anchor:k},b,W)=>{let re;for(;x&&x!==k;)re=C(x),s(x,b,W),x=re;s(k,b,W)},X=({el:x,anchor:k})=>{let b;for(;x&&x!==k;)b=C(x),o(x),x=b;o(k)},fe=(x,k,b,W,re,le,ge,me,ae)=>{if(k.type==="svg"?ge="svg":k.type==="math"&&(ge="mathml"),x==null)ie(k,b,W,re,le,ge,me,ae);else{const q=x.el&&x.el._isVueCE?x.el:null;try{q&&q._beginPatch(),S(x,k,re,le,ge,me,ae)}finally{q&&q._endPatch()}}},ie=(x,k,b,W,re,le,ge,me)=>{let ae,q;const{props:H,shapeFlag:Y,transition:Pe,dirs:Ne}=x;if(ae=x.el=c(x.type,le,H&&H.is,H),Y&8?m(ae,x.children):Y&16&&M(x.children,ae,null,W,re,ua(x,le),ge,me),Ne&&kr(x,null,W,"created"),ee(ae,x,x.scopeId,ge,W),H){for(const Je in H)Je!=="value"&&!_s(Je)&&a(ae,Je,null,H[Je],le,W);"value"in H&&a(ae,"value",null,H.value,le),(q=H.onVnodeBeforeMount)&&wn(q,W,x)}Ne&&kr(x,null,W,"beforeMount");const Xe=Kp(re,Pe);Xe&&Pe.beforeEnter(ae),s(ae,k,b),((q=H&&H.onVnodeMounted)||Xe||Ne)&&Yt(()=>{try{q&&wn(q,W,x),Xe&&Pe.enter(ae),Ne&&kr(x,null,W,"mounted")}finally{}},re)},ee=(x,k,b,W,re)=>{if(b&&A(x,b),W)for(let le=0;le<W.length;le++)A(x,W[le]);if(re){let le=re.subTree;if(k===le||Wc(le.type)&&(le.ssContent===k||le.ssFallback===k)){const ge=re.vnode;ee(x,ge,ge.scopeId,ge.slotScopeIds,re.parent)}}},M=(x,k,b,W,re,le,ge,me,ae=0)=>{for(let q=ae;q<x.length;q++){const H=x[q]=me?Ln(x[q]):Sn(x[q]);Z(null,H,k,b,W,re,le,ge,me)}},S=(x,k,b,W,re,le,ge)=>{const me=k.el=x.el;let{patchFlag:ae,dynamicChildren:q,dirs:H}=k;ae|=x.patchFlag&16;const Y=x.props||pt,Pe=k.props||pt;let Ne;if(b&&xr(b,!1),(Ne=Pe.onVnodeBeforeUpdate)&&wn(Ne,b,k,x),H&&kr(k,x,b,"beforeUpdate"),b&&xr(b,!0),q&&(!x.dynamicChildren||x.dynamicChildren.length!==q.length)&&(ae=0,ge=!1,q=null),(Y.innerHTML&&Pe.innerHTML==null||Y.textContent&&Pe.textContent==null)&&m(me,""),q?oe(x.dynamicChildren,q,me,b,W,ua(k,re),le):ge||Ke(x,k,me,null,b,W,ua(k,re),le,!1),ae>0){if(ae&16)be(me,Y,Pe,b,re);else if(ae&2&&Y.class!==Pe.class&&a(me,"class",null,Pe.class,re),ae&4&&a(me,"style",Y.style,Pe.style,re),ae&8){const Xe=k.dynamicProps;for(let Je=0;Je<Xe.length;Je++){const tt=Xe[Je],yt=Y[tt],xt=Pe[tt];(xt!==yt||tt==="value")&&a(me,tt,yt,xt,re,b)}}ae&1&&x.children!==k.children&&m(me,k.children)}else!ge&&q==null&&be(me,Y,Pe,b,re);((Ne=Pe.onVnodeUpdated)||H)&&Yt(()=>{Ne&&wn(Ne,b,k,x),H&&kr(k,x,b,"updated")},W)},oe=(x,k,b,W,re,le,ge)=>{for(let me=0;me<k.length;me++){const ae=x[me],q=k[me],H=ae.el||Ta(ae),Y=H&&(ae.type===je||!$r(ae,q)||ae.shapeFlag&198)?_(H):b;Z(ae,q,Y,null,W,re,le,ge,!0)}},be=(x,k,b,W,re)=>{if(k!==b){if(k!==pt)for(const le in k)!_s(le)&&!(le in b)&&a(x,le,k[le],null,re,W);for(const le in b){if(_s(le))continue;const ge=b[le],me=k[le];ge!==me&&le!=="value"&&a(x,le,me,ge,re,W)}"value"in b&&a(x,"value",k.value,b.value,re)}},z=(x,k,b,W,re,le,ge,me,ae)=>{const q=k.el=x?x.el:d(""),H=k.anchor=x?x.anchor:d("");let{patchFlag:Y,dynamicChildren:Pe,slotScopeIds:Ne}=k;Ne&&(me=me?me.concat(Ne):Ne),x==null?(s(q,b,W),s(H,b,W),M(k.children||[],b,H,re,le,ge,me,ae)):Y>0&&Y&64&&Pe&&x.dynamicChildren&&x.dynamicChildren.length===Pe.length?(oe(x.dynamicChildren,Pe,b,re,le,ge,me),(k.key!=null||re&&k===re.subTree)&&il(x,k,!0)):Ke(x,k,b,H,re,le,ge,me,ae)},xe=(x,k,b,W,re,le,ge,me,ae)=>{k.slotScopeIds=me,x==null?k.shapeFlag&512?re.ctx.activate(k,b,W,ge,ae):Le(k,b,W,re,le,ge,ae):rt(x,k,ae)},Le=(x,k,b,W,re,le,ge)=>{const me=x.component=zp(x,W,re);if(hi(x)&&(me.ctx.renderer=$e),Gp(me,!1,ge),me.asyncDep){if(re&&re.registerDep(me,He,ge,le),!x.el){const ae=me.subTree=Te(Ut);ue(null,ae,k,b),x.placeholder=ae.el}}else He(me,x,k,b,re,le,ge)},rt=(x,k,b)=>{const W=k.component=x.component;if(Tp(x,k,b))if(W.asyncDep&&!W.asyncResolved){k.el=x.el,k.placeholder=x.placeholder,Ye(W,k,b);return}else W.next=k,W.update();else k.el=x.el,k.placeholder=x.placeholder,W.vnode=k},He=(x,k,b,W,re,le,ge)=>{const me=()=>{if(x.isMounted){let{next:Y,bu:Pe,u:Ne,parent:Xe,vnode:Je}=x;{const Wt=Hc(x);if(Wt){Y&&(Y.el=Je.el,Ye(x,Y,ge)),Wt.asyncDep.then(()=>{Yt(()=>{x.isUnmounted||q()},re)});return}}let tt=Y,yt;xr(x,!1),Y?(Y.el=Je.el,Ye(x,Y,ge)):Y=Je,Pe&&$o(Pe),(yt=Y.props&&Y.props.onVnodeBeforeUpdate)&&wn(yt,Xe,Y,Je),xr(x,!0);const xt=fu(x),Zt=x.subTree;x.subTree=xt,Z(Zt,xt,_(Zt.el),ct(Zt),x,re,le),Y.el=xt.el,tt===null&&Ap(x,xt.el),Ne&&Yt(Ne,re),(yt=Y.props&&Y.props.onVnodeUpdated)&&Yt(()=>wn(yt,Xe,Y,Je),re)}else{let Y;const{el:Pe,props:Ne}=k,{bm:Xe,m:Je,parent:tt,root:yt,type:xt}=x,Zt=Ss(k);xr(x,!1),Xe&&$o(Xe),!Zt&&(Y=Ne&&Ne.onVnodeBeforeMount)&&wn(Y,tt,k),xr(x,!0);{yt.ce&&yt.ce._hasShadowRoot()&&yt.ce._injectChildStyle(xt,x.parent?x.parent.type:void 0);const Wt=x.subTree=fu(x);Z(null,Wt,b,W,x,re,le),k.el=Wt.el}if(Je&&Yt(Je,re),!Zt&&(Y=Ne&&Ne.onVnodeMounted)){const Wt=k;Yt(()=>wn(Y,tt,Wt),re)}(k.shapeFlag&256||tt&&Ss(tt.vnode)&&tt.vnode.shapeFlag&256)&&x.a&&Yt(x.a,re),x.isMounted=!0,k=b=W=null}};x.scope.on();const ae=x.effect=new Qu(me);x.scope.off();const q=x.update=ae.run.bind(ae),H=x.job=ae.runIfDirty.bind(ae);H.i=x,H.id=x.uid,ae.scheduler=()=>nl(H),xr(x,!0),q()},Ye=(x,k,b)=>{k.component=x;const W=x.vnode.props;x.vnode=k,x.next=null,Op(x,k.props,W,b),Dp(x,k.children,b),An(),mc(x),Pn()},Ke=(x,k,b,W,re,le,ge,me,ae=!1)=>{const q=x&&x.children,H=x?x.shapeFlag:0,Y=k.children,{patchFlag:Pe,shapeFlag:Ne}=k;if(Pe>0){if(Pe&128){qe(q,Y,b,W,re,le,ge,me,ae);return}else if(Pe&256){st(q,Y,b,W,re,le,ge,me,ae);return}}Ne&8?(H&16&&Fe(q,re,le),Y!==q&&m(b,Y)):H&16?Ne&16?qe(q,Y,b,W,re,le,ge,me,ae):Fe(q,re,le,!0):(H&8&&m(b,""),Ne&16&&M(Y,b,W,re,le,ge,me,ae))},st=(x,k,b,W,re,le,ge,me,ae)=>{x=x||Ar,k=k||Ar;const q=x.length,H=k.length,Y=Math.min(q,H);let Pe;for(Pe=0;Pe<Y;Pe++){const Ne=k[Pe]=ae?Ln(k[Pe]):Sn(k[Pe]);Z(x[Pe],Ne,b,null,re,le,ge,me,ae)}q>H?Fe(x,re,le,!0,!1,Y):M(k,b,W,re,le,ge,me,ae,Y)},qe=(x,k,b,W,re,le,ge,me,ae)=>{let q=0;const H=k.length;let Y=x.length-1,Pe=H-1;for(;q<=Y&&q<=Pe;){const Ne=x[q],Xe=k[q]=ae?Ln(k[q]):Sn(k[q]);if($r(Ne,Xe))Z(Ne,Xe,b,null,re,le,ge,me,ae);else break;q++}for(;q<=Y&&q<=Pe;){const Ne=x[Y],Xe=k[Pe]=ae?Ln(k[Pe]):Sn(k[Pe]);if($r(Ne,Xe))Z(Ne,Xe,b,null,re,le,ge,me,ae);else break;Y--,Pe--}if(q>Y){if(q<=Pe){const Ne=Pe+1,Xe=Ne<H?k[Ne].el:W;for(;q<=Pe;)Z(null,k[q]=ae?Ln(k[q]):Sn(k[q]),b,Xe,re,le,ge,me,ae),q++}}else if(q>Pe)for(;q<=Y;)Ce(x[q],re,le,!0),q++;else{const Ne=q,Xe=q,Je=new Map;for(q=Xe;q<=Pe;q++){const jt=k[q]=ae?Ln(k[q]):Sn(k[q]);jt.key!=null&&Je.set(jt.key,q)}let tt,yt=0;const xt=Pe-Xe+1;let Zt=!1,Wt=0;const en=new Array(xt);for(q=0;q<xt;q++)en[q]=0;for(q=Ne;q<=Y;q++){const jt=x[q];if(yt>=xt){Ce(jt,re,le,!0);continue}let Tt;if(jt.key!=null)Tt=Je.get(jt.key);else for(tt=Xe;tt<=Pe;tt++)if(en[tt-Xe]===0&&$r(jt,k[tt])){Tt=tt;break}Tt===void 0?Ce(jt,re,le,!0):(en[Tt-Xe]=q+1,Tt>=Wt?Wt=Tt:Zt=!0,Z(jt,k[Tt],b,null,re,le,ge,me,ae),yt++)}const hr=Zt?Fp(en):Ar;for(tt=hr.length-1,q=xt-1;q>=0;q--){const jt=Xe+q,Tt=k[jt],Ie=k[jt+1],qn=jt+1<H?Ie.el||Ta(Ie):W;en[q]===0?Z(null,Tt,b,qn,re,le,ge,me,ae):Zt&&(tt<0||q!==hr[tt]?Qe(Tt,b,qn,2):tt--)}}},Qe=(x,k,b,W,re=null)=>{const{el:le,type:ge,transition:me,children:ae,shapeFlag:q}=x;if(q&6){Qe(x.component.subTree,k,b,W);return}if(q&128){x.suspense.move(k,b,W);return}if(q&64){ge.move(x,k,b,$e);return}if(ge===je){s(le,k,b);for(let Y=0;Y<ae.length;Y++)Qe(ae[Y],k,b,W);s(x.anchor,k,b);return}if(ge===Ao){R(x,k,b);return}if(W!==2&&q&1&&me)if(W===0)me.persisted&&!le[an]?s(le,k,b):(me.beforeEnter(le),s(le,k,b),Yt(()=>me.enter(le),re));else{const{leave:Y,delayLeave:Pe,afterLeave:Ne}=me,Xe=()=>{x.ctx.isUnmounted?o(le):s(le,k,b)},Je=()=>{const tt=le._isLeaving||!!le[an];le._isLeaving&&le[an](!0),me.persisted&&!tt?Xe():Y(le,()=>{Xe(),Ne&&Ne()})};Pe?Pe(le,Xe,Je):Je()}else s(le,k,b)},Ce=(x,k,b,W=!1,re=!1)=>{const{type:le,props:ge,ref:me,children:ae,dynamicChildren:q,shapeFlag:H,patchFlag:Y,dirs:Pe,cacheIndex:Ne,memo:Xe}=x;if((Y===-2||q&&q.hasOnce)&&(re=!1),me!=null&&(An(),Cs(me,null,b,x,!0),Pn()),Ne!=null&&(!x.ctx||x.ctx===k)&&(k.renderCache[Ne]=void 0),H&256){k.ctx.deactivate(x);return}const Je=H&1&&Pe,tt=!Ss(x);let yt;if(tt&&(yt=ge&&ge.onVnodeBeforeUnmount)&&wn(yt,k,x),H&6)ke(x.component,b,W);else{if(H&128){x.suspense.unmount(b,W);return}Je&&kr(x,null,k,"beforeUnmount"),H&64?x.type.remove(x,k,b,$e,W):q&&!q.hasOnce&&(le!==je||Y>0&&Y&64)?Fe(q,k,b,!1,!0):(le===je&&Y&384||!re&&H&16)&&Fe(ae,k,b),W&&J(x)}const xt=Xe!=null&&Ne==null;(tt&&(yt=ge&&ge.onVnodeUnmounted)||Je||xt)&&Yt(()=>{yt&&wn(yt,k,x),Je&&kr(x,null,k,"unmounted"),xt&&(x.el=null)},b)},J=x=>{const{type:k,el:b,anchor:W,transition:re}=x,le=k===je;if(le&&!re){Q(b,W);return}if(k===Ao){X(x),re&&!re.persisted&&re.afterLeave&&re.afterLeave();return}const ge=le?js(x):x,me=()=>{le?_(b)&&Q(b,W):o(b),re&&!re.persisted&&re.afterLeave&&re.afterLeave()};if(ge&&ge.shapeFlag&1&&re&&!re.persisted){const{leave:ae,delayLeave:q}=re,H=ge.el,Y=()=>ae(H,me);q?q(H,me,Y):Y()}else me()},Q=(x,k)=>{let b;for(;x!==k;)b=C(x),o(x),x=b;o(k)},ke=(x,k,b)=>{const{bum:W,scope:re,job:le,subTree:ge,um:me,m:ae,a:q}=x;hu(ae),hu(q),W&&$o(W),re.stop(),le?(le.flags|=8,Ce(ge,x,k,b)):x.vnode.el&&ge&&(ge.transition=x.vnode.transition,Ce(ge,x,k,b)),me&&Yt(me,k),Yt(()=>{x.isUnmounted=!0},k)},Fe=(x,k,b,W=!1,re=!1,le=0)=>{for(let ge=le;ge<x.length;ge++)Ce(x[ge],k,b,W,re)},ct=x=>{if(x.shapeFlag&6)return ct(x.component.subTree);if(x.shapeFlag&128)return x.suspense.next();const k=C(x.anchor||x.el),b=k&&k[kc];return b?C(b):k},It=(x,k,b)=>{const W=x&&k._vnode?void 0:x&&x.component?x.component.uid:Wp();Yd(()=>{x==null?k._vnode&&Ce(k._vnode,null,null,!0):Z(k._vnode||null,x,k,null,null,null,b),k._vnode=x},W)},$e={p:Z,um:Ce,m:Qe,r:J,mt:Le,mc:M,pc:Ke,pbc:oe,n:ct,o:e};return{render:It,hydrate:void 0,createApp:kp(It)}}function ua({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function xr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Kp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function il(e,t,n=!1){const s=e.children,o=t.children;if(Re(s)&&Re(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]=Ln(o[a]),d.el=c.el),!n&&d.patchFlag!==-2&&il(c,d)),d.type===yi&&(d.patchFlag===-1&&(d=o[a]=Ln(d)),d.el=c.el),d.type===Ut&&!d.el&&(d.el=c.el)}}function Fp(e){const t=e.slice(),n=[0];let s,o,a,c,d;const h=e.length;for(s=0;s<h;s++){const y=e[s];if(y!==0){if(o=n[n.length-1],e[o]<y){t[s]=o,n.push(s);continue}for(a=0,c=n.length-1;a<c;)d=a+c>>1,e[n[d]]<y?a=d+1:c=d;y<e[n[a]]&&(a>0&&(t[s]=n[a-1]),n[a]=s)}}for(a=n.length,c=n[a-1];a-- >0;)n[a]=c,c=t[c];return n}function Hc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Hc(t)}function hu(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ta(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Ta(t.subTree):null}const Wc=e=>e.__isSuspense;function Np(e,t){t&&t.pendingBranch?Re(e)?t.effects.push(...e):t.effects.push(e):Gd(e)}const je=Symbol.for("v-fgt"),yi=Symbol.for("v-txt"),Ut=Symbol.for("v-cmt"),Ao=Symbol.for("v-stc"),Mr=[];let sn=null;function O(e=!1){Mr.push(sn=e?null:[])}function zc(){Mr.pop(),sn=Mr[Mr.length-1]||null}let Ds=1;function Uo(e,t=!1){Ds+=e,e<0&&sn&&t&&(sn.hasOnce=!0)}function Gc(e){return e.dynamicChildren=Ds>0?sn||Ar:null,zc(),Ds>0&&sn&&sn.push(e),e}function F(e,t,n,s,o,a){return Gc(u(e,t,n,s,o,a,!0))}function Lt(e,t,n,s,o){return Gc(Te(e,t,n,s,o,!0))}function Ls(e){return e?e.__v_isVNode===!0:!1}function $r(e,t){return e.type===t.type&&e.key===t.key}const Yc=({key:e})=>e??null,Po=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?wt(e)||qt(e)||ze(e)?{i:ln,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,s=0,o=null,a=e===je?0:1,c=!1,d=!1){const h={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Yc(t),ref:t&&Po(t),scopeId:bc,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:ln};return d?(qo(h,n),a&128&&e.normalize(h)):n&&(h.shapeFlag|=wt(n)?8:16),Ds>0&&!c&&sn&&(h.patchFlag>0||a&6)&&h.patchFlag!==32&&sn.push(h),h}const Te=Vp;function Vp(e,t=null,n=null,s=0,o=null,a=!1){if((!e||e===hp)&&(e=Ut),Ls(e)){const d=lr(e,t,!0);return n&&qo(d,n),Ds>0&&!a&&sn&&(d.shapeFlag&6?sn[sn.indexOf(e)]=d:sn.push(d)),d.patchFlag=-2,d}if(Qp(e)&&(e=e.__vccOpts),t){t=Bp(t);let{class:d,style:h}=t;d&&!wt(d)&&(t.class=Ze(d)),dt(h)&&(tl(h)&&!Re(h)&&(h=$t({},h)),t.style=rr(h))}const c=wt(e)?1:Wc(e)?128:pi(e)?64:dt(e)?4:ze(e)?2:0;return u(e,t,n,s,o,c,a,!0)}function Bp(e){return e?tl(e)||Fc(e)?$t({},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?qp(o||{},t):o,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:y,key:y&&Yc(y),ref:t&&t.ref?n&&a?Re(a)?a.concat(Po(t)):[a,Po(t)]:Po(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!==je?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 rn(e=" ",t=0){return Te(yi,null,e,t)}function Up(e,t){const n=Te(Ao,null,e);return n.staticCount=t,n}function Ee(e="",t=!1){return t?(O(),Lt(Ut,null,e)):Te(Ut,null,e)}function Sn(e){return e==null||typeof e=="boolean"?Te(Ut):Re(e)?Te(je,null,e.slice()):Ls(e)?Ln(e):Te(yi,null,String(e))}function Ln(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:lr(e)}function qo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Re(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),qo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Fc(t)?t._ctx=ln:o===3&&ln&&(ln.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(ze(t)){if(s&65){qo(e,{default:t});return}t={default:t,_ctx:ln},n=32}else t=String(t),s&64?(n=16,t=[rn(t)]):n=8;e.children=t,e.shapeFlag|=n}function qp(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Ze([t.class,s.class]));else if(o==="style")t.style=rr([t.style,s.style]);else if(ii(o)){const a=t[o],c=s[o];c&&a!==c&&!(Re(a)&&a.includes(c))?t[o]=a?[].concat(a,c):c:c==null&&a==null&&!ai(o)&&(t[o]=c)}else o!==""&&(t[o]=s[o])}return t}function wn(e,t,n,s=null){fn(e,t,7,[n,s])}const Hp=Ic();let Jc=0;function Wp(){return Jc}function zp(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Hp,a={uid:Jc++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new bd(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Vc(s,o),emitsOptions:jc(s,o),emit:null,emitted:null,propsDefaults:pt,inheritAttrs:s.inheritAttrs,ctx:pt,data:pt,props:pt,attrs:pt,slots:pt,refs:pt,setupState:pt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=Cp.bind(null,a),e.ce&&e.ce(a),a}let Xt=null;const al=()=>Xt||ln;let Ho,Rs;{const e=ci(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),a=>{o.length>1?o.forEach(c=>c(a)):o[0](a)}};Ho=t("__VUE_INSTANCE_SETTERS__",n=>Xt=n),Rs=t("__VUE_SSR_SETTERS__",n=>Ks=n)}const qs=e=>{const t=Xt;return Ho(e),e.scope.on(),()=>{e.scope.off(),Ho(t)}},vu=()=>{Xt&&Xt.scope.off(),Ho(null)};function Xc(e){return e.vnode.shapeFlag&4}let Ks=!1;function Gp(e,t=!1,n=!1){t&&Rs(t);const{props:s,children:o}=e.vnode,a=Xc(e);Pp(e,s,a,t),jp(e,o,n||t);const c=a?Yp(e,t):void 0;return t&&Rs(!1),c}function Yp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vp);const{setup:s}=n;if(s){An();const o=e.setupContext=s.length>1?Xp(e):null,a=qs(e),c=Bs(s,e,0,[e.props,o]),d=qu(c);if(Pn(),a(),(d||e.sp)&&!Ss(e)&&$c(e),d){if(c.then(vu,vu),t)return c.then(h=>{Rs(!0);try{mu(e,h,t)}finally{Rs(!1)}}).catch(h=>{di(h,e,0)});e.asyncDep=c}else mu(e,c)}else Qc(e)}function mu(e,t,n){ze(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:dt(t)&&(e.setupState=pc(t)),Qc(e)}function Qc(e,t,n){const s=e.type;e.render||(e.render=s.render||$n);{const o=qs(e);An();try{mp(e)}finally{Pn(),o()}}}const Jp={get(e,t){return Bt(e,"get",""),e[t]}};function Xp(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Jp),slots:e.slots,emit:e.emit,expose:t}}function gi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(pc(Kd(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Es)return Es[n](e)},has(t,n){return n in t||n in Es}})):e.proxy}function Qp(e){return ze(e)&&"__vccOpts"in e}const ut=(e,t)=>Ud(e,t,Ks);function Zp(e,t,n){try{Uo(-1);const s=arguments.length;return s===2?dt(t)&&!Re(t)?Ls(t)?Te(e,null,[t]):Te(e,t):Te(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Ls(n)&&(n=[n]),Te(e,t,n))}finally{Uo(1)}}const eh="3.5.44";/**
* @vue/runtime-dom v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Aa;const yu=typeof window<"u"&&window.trustedTypes;if(yu)try{Aa=yu.createPolicy("vue",{createHTML:e=>e})}catch{}const Zc=Aa?e=>Aa.createHTML(e):e=>e,th="http://www.w3.org/2000/svg",nh="http://www.w3.org/1998/Math/MathML",Dn=typeof document<"u"?document:null,gu=Dn&&Dn.createElement("template"),rh={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?Dn.createElementNS(th,e):t==="mathml"?Dn.createElementNS(nh,e):n?Dn.createElement(e,{is:n}):Dn.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>Dn.createTextNode(e),createComment:e=>Dn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Dn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,a){const c=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{gu.innerHTML=Zc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const d=gu.content;if(s==="svg"||s==="mathml"){const h=d.firstChild;for(;h.firstChild;)d.appendChild(h.firstChild);d.removeChild(h)}t.insertBefore(d,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Xn="transition",ys="animation",Zr=Symbol("_vtc"),ef={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},tf=$t({},Cc,ef),sh=e=>(e.displayName="Transition",e.props=tf,e),ss=sh((e,{slots:t})=>Zp(sp,nf(e),t)),Cr=(e,t=[])=>{Re(e)?e.forEach(n=>n(...t)):e&&e(...t)},bu=e=>e?Re(e)?e.some(t=>t.length>1):e.length>1:!1;function nf(e){const t={};for(const z in e)z in ef||(t[z]=e[z]);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:_=`${n}-leave-from`,leaveActiveClass:C=`${n}-leave-active`,leaveToClass:A=`${n}-leave-to`}=e,V=oh(o),Z=V&&V[0],te=V&&V[1],{onBeforeEnter:ue,onEnter:P,onEnterCancelled:R,onLeave:X,onLeaveCancelled:fe,onBeforeAppear:ie=ue,onAppear:ee=P,onAppearCancelled:M=R}=t,S=(z,xe,Le,rt)=>{z._enterCancelled=rt,Zn(z,xe?m:d),Zn(z,xe?y:c),Le&&Le()},oe=(z,xe)=>{z._isLeaving=!1,Zn(z,_),Zn(z,A),Zn(z,C),xe&&xe()},be=z=>(xe,Le)=>{const rt=z?ee:P,He=()=>S(xe,z,Le);Cr(rt,[xe,He]),wu(()=>{Zn(xe,z?h:a),_n(xe,z?m:d),bu(rt)||_u(xe,s,Z,He)})};return $t(t,{onBeforeEnter(z){Cr(ue,[z]),_n(z,a),_n(z,c)},onBeforeAppear(z){Cr(ie,[z]),_n(z,h),_n(z,y)},onEnter:be(!1),onAppear:be(!0),onLeave(z,xe){z._isLeaving=!0;const Le=()=>oe(z,xe);_n(z,_),z._enterCancelled?(_n(z,C),Pa(z)):(Pa(z),_n(z,C)),wu(()=>{z._isLeaving&&(Zn(z,_),_n(z,A),bu(X)||_u(z,s,te,Le))}),Cr(X,[z,Le])},onEnterCancelled(z){S(z,!1,void 0,!0),Cr(R,[z])},onAppearCancelled(z){S(z,!0,void 0,!0),Cr(M,[z])},onLeaveCancelled(z){oe(z),Cr(fe,[z])}})}function oh(e){if(e==null)return null;if(dt(e))return[ca(e.enter),ca(e.leave)];{const t=ca(e);return[t,t]}}function ca(e){return ud(e)}function _n(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Zr]||(e[Zr]=new Set)).add(t)}function Zn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Zr];n&&(n.delete(t),n.size||(e[Zr]=void 0))}function wu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ih=0;function _u(e,t,n,s){const o=e._endId=++ih,a=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(a,n);const{type:c,timeout:d,propCount:h}=rf(e,t);if(!c)return s();const y=c+"end";let m=0;const _=()=>{e.removeEventListener(y,C),a()},C=A=>{A.target===e&&++m>=h&&_()};setTimeout(()=>{m<h&&_()},d+1),e.addEventListener(y,C)}function rf(e,t){const n=window.getComputedStyle(e),s=V=>(n[V]||"").split(", "),o=s(`${Xn}Delay`),a=s(`${Xn}Duration`),c=ku(o,a),d=s(`${ys}Delay`),h=s(`${ys}Duration`),y=ku(d,h);let m=null,_=0,C=0;t===Xn?c>0&&(m=Xn,_=c,C=a.length):t===ys?y>0&&(m=ys,_=y,C=h.length):(_=Math.max(c,y),m=_>0?c>y?Xn:ys:null,C=m?m===Xn?a.length:h.length:0);const A=m===Xn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Xn}Property`).toString());return{type:m,timeout:_,propCount:C,hasTransform:A}}function ku(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>xu(n)+xu(e[s])))}function xu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Pa(e){return(e?e.ownerDocument:document).body.offsetHeight}function ah(e,t,n){const s=e[Zr];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Cu=Symbol("_vod"),sf=Symbol("_vsh"),lh=Symbol(""),uh=/(?:^|;)\s*display\s*:/;function ch(e,t,n){const s=e.style,o=wt(n);let a=!1;if(n&&!o){if(t)if(wt(t))for(const c of t.split(";")){const d=c.slice(0,c.indexOf(":")).trim();n[d]==null&&ws(s,d,"")}else for(const c in t)n[c]==null&&ws(s,c,"");for(const c in n){c==="display"&&(a=!0);const d=n[c];d!=null?dh(e,c,!wt(t)&&t?t[c]:void 0,d)||ws(s,c,d):ws(s,c,"")}}else if(o){if(t!==n){const c=s[lh];c&&(n+=";"+c),s.cssText=n,a=uh.test(n)}}else t&&e.removeAttribute("style");Cu in e&&((!o||t!==n)&&(e[Cu]=a?s.display:""),e[sf]&&(s.display="none"))}const Co=/\s*!important$/;function ws(e,t,n){if(Re(n))n.forEach(s=>ws(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))Co.test(n)?e.setProperty(t,n.replace(Co,""),"important"):e.setProperty(t,n);else{const s=fh(e,t);Co.test(n)?e.setProperty(cr(s),n.replace(Co,""),"important"):e[s]=n}}const Su=["Webkit","Moz","ms"],fa={};function fh(e,t){const n=fa[t];if(n)return n;let s=vn(t);if(s!=="filter"&&s in e)return fa[t]=s;s=zu(s);for(let o=0;o<Su.length;o++){const a=Su[o]+s;if(a in e)return fa[t]=a}return t}function dh(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&wt(s)&&n===s}const Eu="http://www.w3.org/1999/xlink";function $u(e,t,n,s,o,a=vd(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Eu,t.slice(6,t.length)):e.setAttributeNS(Eu,t,n):n==null||a&&!Yu(n)?e.removeAttribute(t):e.setAttribute(t,a?"":Tn(n)?String(n):n)}function Tu(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Zc(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const d=a==="OPTION"?e.getAttribute("value")||"":e.value,h=n==null?e.type==="checkbox"?"on":"":String(n);(d!==h||!("_value"in e))&&(e.value=h),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const d=typeof e[t];d==="boolean"?n=Yu(n):n==null&&d==="string"?(n="",c=!0):d==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(o||t)}function Tr(e,t,n,s){e.addEventListener(t,n,s)}function ph(e,t,n,s){e.removeEventListener(t,n,s)}const Au=Symbol("_vei");function hh(e,t,n,s,o=null){const a=e[Au]||(e[Au]={}),c=a[t];if(s&&c)c.value=s;else{const[d,h]=yh(t);if(s){const y=a[t]=wh(s,o);Tr(e,d,y,h)}else c&&(ph(e,d,c,h),a[t]=void 0)}}const vh=/(Once|Passive|Capture)$/,mh=/^on:?(?:Once|Passive|Capture)$/;function yh(e){let t,n;for(;(n=e.match(vh))&&!mh.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):cr(e.slice(2)),t]}let da=0;const gh=Promise.resolve(),bh=()=>da||(gh.then(()=>da=0),da=Date.now());function wh(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(Re(o)){const a=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{a.call(s),s._stopped=!0};const c=o.slice(),d=[s];for(let h=0;h<c.length&&!s._stopped;h++){const y=c[h];y&&fn(y,t,5,d)}}else fn(o,t,5,[s])};return n.value=e,n.attached=bh(),n}const Pu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,_h=(e,t,n,s,o,a)=>{const c=o==="svg";t==="class"?ah(e,s,c):t==="style"?ch(e,n,s):ii(t)?ai(t)||hh(e,t,n,s,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):kh(e,t,s,c))?(Tu(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&$u(e,t,s,c,a,t!=="value")):e._isVueCE&&(xh(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!wt(s)))?Tu(e,vn(t),s,a,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),$u(e,t,s,c))};function kh(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Pu(t)&&ze(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 Pu(t)&&wt(n)?!1:t in e}function xh(e,t){const n=e._def.props;if(!n)return!1;const s=vn(t);return Array.isArray(n)?n.some(o=>vn(o)===s):Object.keys(n).some(o=>vn(o)===s)}const of=new WeakMap,af=new WeakMap,Wo=Symbol("_moveCb"),Ou=Symbol("_enterCb"),Oa=new WeakMap,Ch=e=>(delete e.props.mode,e),Sh=Ch({name:"TransitionGroup",props:$t({},tf,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=al(),s=xc();let o,a,c,d;const h=()=>(d===void 0&&(d=o.length>0&&Ih(o[0].el,n.vnode.el,Mu(e))),d);return Ac(()=>{if(Oa.delete(n),!h()){o=[],c=void 0;return}const y=Mu(e);o.forEach($h);const m=c&&Mh(c,n.vnode.el);c=void 0,o.forEach(C=>Th(C,m));const _=o.filter(Ah);Pa(n.vnode.el),_.forEach(C=>{const A=C.el,V=A.style;_n(A,y),V.transform=V.webkitTransform=V.transitionDuration="";const Z=A[Wo]=te=>{te&&te.target!==A||(!te||te.propertyName.endsWith("transform"))&&(A.removeEventListener("transitionend",Z),A[Wo]=null,Zn(A,y))};A.addEventListener("transitionend",Z)}),o=[]}),()=>{const y=lt(e),m=nf(y);let _=y.tag||je;if(o=[],d=void 0,a)for(let C=0;C<a.length;C++){const A=a[C];A.el&&A.el instanceof Element&&!A.el[sf]&&(o.push(A),ar(A,Is(A,m,s,n)),of.set(A,bi(A.el)))}a=t.default?rl(t.default()):[];for(let C=0;C<a.length;C++){const A=a[C];A.key!=null&&ar(A,Is(A,m,s,n))}return o.length&&(c=Ph(n),Oa.set(n,h)),Te(_,null,a)}}}),Eh=Sh;function $h(e){const t=e.el;t[Wo]&&t[Wo](),t[Ou]&&t[Ou]()}function Mu(e){return e.moveClass||`${e.name||"v"}-move`}function Th(e,t){af.set(e,bi(e.el,t))}function Ah(e){const t=of.get(e),n=af.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const a=e.el,c=a.style,d=a.getBoundingClientRect();let h=1,y=1;return a.offsetWidth&&(h=d.width/a.offsetWidth),a.offsetHeight&&(y=d.height/a.offsetHeight),(!Number.isFinite(h)||h===0)&&(h=1),(!Number.isFinite(y)||y===0)&&(y=1),Math.abs(h-1)<.01&&(h=1),Math.abs(y-1)<.01&&(y=1),c.transform=c.webkitTransform=`translate(${s/h}px,${o/y}px)`,c.transitionDuration="0s",e}}function bi(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function Ph(e){let t;for(let n=e.parent;n;n=n.parent){const s=Oa.get(n);if(s){const o=Oh(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push($t(bi(o),{item:o,willMove:s}))}}return t}function Oh(e,t){const n=e.nodeType===1?e:e.parentNode;for(;t&&t.parentNode!==n;)t=t.parentNode;if(t&&t.nodeType===1)return t}function Mh(e,t){const n=e.find(s=>s.willMove()&&s.item.contains(t));return n&&bi(n.item,n)}function Ih(e,t,n){const s=e.cloneNode(),o=e[Zr];o&&o.forEach(d=>{d.split(/\s+/).forEach(h=>h&&s.classList.remove(h))}),n.split(/\s+/).forEach(d=>d&&s.classList.add(d)),s.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(s);const{hasTransform:c}=rf(s);return a.removeChild(s),c}const zo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Re(t)?n=>$o(t,n):t};function jh(e){e.target.composing=!0}function Iu(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Pr=Symbol("_assign"),So=Symbol("_initialValue");function pa(e,t,n){return t&&(e=e.trim()),n&&(e=ui(e)),e}const De={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[So]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[So]=e.defaultValue.replace(/\r\n?/g,`
`))),e[Pr]=zo(o);const a=s||o.props&&o.props.type==="number";Tr(e,t?"change":"input",c=>{c.target.composing||e[Pr](pa(e.value,n,a))}),(n||a)&&Tr(e,"change",()=>{e.value=pa(e.value,n,a)}),t||(Tr(e,"compositionstart",jh),Tr(e,"compositionend",Iu),Tr(e,"change",Iu))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",a=e[So];delete e[So],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[Pr](pa(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:a}},c){if(e[Pr]=zo(c),e.composing)return;const d=(a||e.type==="number")&&!/^0\d/.test(e.value)?ui(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)}},Nn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Tr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,h=>h.selected).map(h=>n?ui(Go(h)):Go(h)),a=e.multiple,c=a?Ir(e._modelValue)?new Set(o):o:o[0],d=e._pendingValue=[a,a?Re(c)?o.slice():o:c];try{e[Pr](c)}finally{rs(()=>{e._pendingValue===d&&(e._pendingValue=void 0)})}}),e[Pr]=zo(s)},mounted(e,{value:t}){ju(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Pr]=zo(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Dh(t,n[1],n[0]))&&ju(e,t)}};function Dh(e,t,n){if(!n||Re(e))return or(e,t);if(Ir(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function ju(e,t){const n=e.multiple,s=Re(t);if(!(n&&!s&&!Ir(t))){for(let o=0,a=e.options.length;o<a;o++){const c=e.options[o],d=Go(c);if(n)if(s){const h=typeof d;h==="string"||h==="number"?c.selected=t.some(y=>String(y)===String(d)):c.selected=gd(t,d)>-1}else c.selected=t.has(d);else if(or(Go(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Go(e){return"_value"in e?e._value:e.value}const Lh=["ctrl","shift","alt","meta"],Rh={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Lh.some(n=>e[`${n}Key`]&&!t.includes(n))},hn=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(o,...a)=>{for(let c=0;c<t.length;c++){const d=Rh[t[c]];if(d&&d(o,t))return}return e(o,...a)})},Kh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Mt=(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||Kh[c]===a))return e(o)})},Fh=$t({patchProp:_h},rh);let Du;function Nh(){return Du||(Du=Lp(Fh))}const Vh=(...e)=>{const t=Nh().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Uh(s);if(!o)return;const a=t._component;!ze(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,Bh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function Bh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Uh(e){return wt(e)?document.querySelector(e):e}function At(e){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">'+e+"</svg>"}const qh={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"/>'),more:At('<circle cx="5.4" cy="12" r="1.7"/><circle cx="12" cy="12" r="1.7"/><circle cx="18.6" cy="12" r="1.7"/>')},Hh=["innerHTML"],et=Ht({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=ut(()=>qh[t.name]||"");return(s,o)=>(O(),F("span",{class:"icon",style:rr({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,Hh))}}),Wh=["aria-label"],zh={class:"dialog-title"},Gh={class:"dialog-msg"},Yh={class:"dialog-btns"},Jh=Ht({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmText:{default:"确认"},cancelText:{default:"取消"},danger:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(e,{emit:t}){const n=e,s=t;function o(a){n.open&&a.key==="Escape"&&s("cancel")}return mt(()=>n.open,a=>{a?window.addEventListener("keydown",o):window.removeEventListener("keydown",o)}),dr(()=>window.removeEventListener("keydown",o)),(a,c)=>(O(),Lt(Us,{to:"body"},[Te(ss,{name:"modal"},{default:fr(()=>[e.open?(O(),F("div",{key:0,class:"mask",onClick:c[2]||(c[2]=hn(d=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",zh,ne(e.title),1),u("div",Gh,ne(e.message),1),u("div",Yh,[u("button",{class:"btn btn-sm",onClick:c[0]||(c[0]=d=>s("cancel"))},ne(e.cancelText),1),u("button",{class:Ze(["btn btn-sm",e.danger?"btn-danger-solid":"btn-primary"]),onClick:c[1]||(c[1]=d=>s("confirm"))},ne(e.confirmText),3)])],8,Wh)])):Ee("",!0)]),_:1})]))}}),Qt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},ur=Qt(Jh,[["__scopeId","data-v-f27041d4"]]);var Lu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lf={exports:{}};(function(e,t){((n,s)=>{e.exports=s()})(Lu,function(){var n=function(r,i){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(l,f){l.__proto__=f}:function(l,f){for(var p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}))(r,i)},s=function(){return(s=Object.assign||function(r){for(var i,l=1,f=arguments.length;l<f;l++)for(var p in i=arguments[l])Object.prototype.hasOwnProperty.call(i,p)&&(r[p]=i[p]);return r}).apply(this,arguments)};function o(r,i,l){for(var f,p=0,v=i.length;p<v;p++)!f&&p in i||((f=f||Array.prototype.slice.call(i,0,p))[p]=i[p]);return r.concat(f||Array.prototype.slice.call(i))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Lu,c=Object.keys,d=Array.isArray;function h(r,i){return typeof i=="object"&&c(i).forEach(function(l){r[l]=i[l]}),r}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var y=Object.getPrototypeOf,m={}.hasOwnProperty;function _(r,i){return m.call(r,i)}function C(r,i){typeof i=="function"&&(i=i(y(r))),(typeof Reflect>"u"?c:Reflect.ownKeys)(i).forEach(function(l){V(r,l,i[l])})}var A=Object.defineProperty;function V(r,i,l,f){A(r,i,h(l&&_(l,"get")&&typeof l.get=="function"?{get:l.get,set:l.set,configurable:!0}:{value:l,configurable:!0,writable:!0},f))}function Z(r){return{from:function(i){return r.prototype=Object.create(i.prototype),V(r.prototype,"constructor",r),{extend:C.bind(null,r.prototype)}}}}var te=Object.getOwnPropertyDescriptor,ue=[].slice;function P(r,i,l){return ue.call(r,i,l)}function R(r,i){return i(r)}function X(r){if(!r)throw new Error("Assertion Failed")}function fe(r){a.setImmediate?setImmediate(r):setTimeout(r,0)}function ie(r,i){if(typeof i=="string"&&_(r,i))return r[i];if(!i)return r;if(typeof i!="string"){for(var l=[],f=0,p=i.length;f<p;++f){var v=ie(r,i[f]);l.push(v)}return l}var g,w=i.indexOf(".");return w===-1||(g=r[i.substr(0,w)])==null?void 0:ie(g,i.substr(w+1))}function ee(r,i,l){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){X(typeof l!="string"&&"length"in l);for(var f=0,p=i.length;f<p;++f)ee(r,i[f],l[f])}else{var v=i.indexOf(".");if(v!==-1){var g=i.substr(0,v),v=i.substr(v+1);if(v==="")l===void 0?d(r)&&!isNaN(parseInt(g))?r.splice(g,1):delete r[g]:r[g]=l;else{var w=r[g];if(!w||!_(r,g)){if(l===void 0)return;w=r[g]={}}ee(w,v,l)}}else l===void 0?d(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=l}}function M(r){var i,l={};for(i in r)_(r,i)&&(l[i]=r[i]);return l}var S=[].concat;function oe(r){return S.apply([],r)}var Ce="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(oe([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return a[r]}),be=new Set(Ce.map(function(r){return a[r]})),z=null;function xe(r){return z=new WeakMap,r=function i(l){if(!l||typeof l!="object")return l;var f=z.get(l);if(f)return f;if(d(l)){f=[],z.set(l,f);for(var p=0,v=l.length;p<v;++p)f.push(i(l[p]))}else if(be.has(l.constructor))f=l;else{var g,w=y(l);for(g in f=w===Object.prototype?{}:Object.create(w),z.set(l,f),l)_(l,g)&&(f[g]=i(l[g]))}return f}(r),z=null,r}var Le={}.toString;function rt(r){return Le.call(r).slice(8,-1)}var He=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Ye=typeof He=="symbol"?function(r){var i;return r!=null&&(i=r[He])&&i.apply(r)}:function(){return null};function Ke(r,i){i=r.indexOf(i),0<=i&&r.splice(i,1)}var st={};function qe(r){var i,l,f,p;if(arguments.length===1){if(d(r))return r.slice();if(this===st&&typeof r=="string")return[r];if(p=Ye(r))for(l=[];!(f=p.next()).done;)l.push(f.value);else{if(r==null)return[r];if(typeof(i=r.length)!="number")return[r];for(l=new Array(i);i--;)l[i]=r[i]}}else for(i=arguments.length,l=new Array(i);i--;)l[i]=arguments[i];return l}var Qe=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Ce=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Je=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ce),J={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 Q(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 Fe(r,i,l,f){this.failures=i,this.failedKeys=f,this.successCount=l,this.message=ke(r,i)}function ct(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)}Z(Q).from(Error).extend({toString:function(){return this.name+": "+this.message}}),Z(Fe).from(Q),Z(ct).from(Q);var It=Je.reduce(function(r,i){return r[i]=i+"Error",r},{}),$e=Q,ce=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=J[i]||l,this.inner=null)}return Z(f).from($e),r[i]=f,r},{}),x=(ce.Syntax=SyntaxError,ce.Type=TypeError,ce.Range=RangeError,Ce.reduce(function(r,i){return r[i+"Error"]=ce[i],r},{}));Ce=Je.reduce(function(r,i){return["Syntax","Type","Range"].indexOf(i)===-1&&(r[i+"Error"]=ce[i]),r},{});function k(){}function b(r){return r}function W(r,i){return r==null||r===b?i:function(l){return i(r(l))}}function re(r,i){return function(){r.apply(this,arguments),i.apply(this,arguments)}}function le(r,i){return r===k?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?re(f,this.onsuccess):f),p&&(this.onerror=this.onerror?re(p,this.onerror):p),v!==void 0?v:l}}function ge(r,i){return r===k?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?re(l,this.onsuccess):l),f&&(this.onerror=this.onerror?re(f,this.onerror):f)}}function me(r,i){return r===k?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?re(f,this.onsuccess):f),p&&(this.onerror=this.onerror?re(p,this.onerror):p),l===void 0?v===void 0?void 0:v:h(l,v)}}function ae(r,i){return r===k?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function q(r,i){return r===k?i:function(){var l=r.apply(this,arguments);if(l&&typeof l.then=="function"){for(var f=this,p=arguments.length,v=new Array(p);p--;)v[p]=arguments[p];return l.then(function(){return i.apply(f,v)})}return i.apply(this,arguments)}}Ce.ModifyError=Fe,Ce.DexieError=Q,Ce.BulkError=ct;var H=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Y(r){H=r}var Pe={},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],Ur=Xe[1],Ur=Ur&&Ur.then,tt=Je&&Je.constructor,yt=!!Xe[2],xt=function(r,i){qn.push([r,i]),Wt&&(queueMicrotask(Df),Wt=!1)},Zt=!0,Wt=!0,en=[],hr=[],jt=b,Tt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:k,pgp:!1,env:{},finalize:k},Ie=Tt,qn=[],vr=0,Gs=[];function Se(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var i=this._PSD=Ie;if(typeof r!="function"){if(r!==Pe)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Si(this,this._value)}else this._state=null,this._value=null,++i.ref,function l(f,p){try{p(function(v){if(f._state===null){if(v===f)throw new TypeError("A promise cannot be resolved with itself.");var g=f._lib&&Rr();v&&typeof v.then=="function"?l(f,function(w,$){v instanceof Se?v._then(w,$):v.then(w,$)}):(f._state=!0,f._value=v,gl(f)),g&&Kr()}},Si.bind(null,f))}catch(v){Si(f,v)}}(this,r)}var Ci={get:function(){var r=Ie,i=Qs;function l(f,p){var v=this,g=!r.global&&(r!==Ie||i!==Qs),w=g&&!Wn(),$=new Se(function(B,I){Ei(v,new yl(wl(f,r,g,w),wl(p,r,g,w),B,I,r))});return this._consoleTask&&($._consoleTask=this._consoleTask),$}return l.prototype=Pe,l},set:function(r){V(this,"then",r&&r.prototype===Pe?Ci:{get:function(){return r},set:Ci.set})}};function yl(r,i,l,f,p){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof i=="function"?i:null,this.resolve=l,this.reject=f,this.psd=p}function Si(r,i){var l,f;hr.push(i),r._state===null&&(l=r._lib&&Rr(),i=jt(i),r._state=!1,r._value=i,f=r,en.some(function(p){return p._value===f._value})||en.push(f),gl(r),l)&&Kr()}function gl(r){var i=r._listeners;r._listeners=[];for(var l=0,f=i.length;l<f;++l)Ei(r,i[l]);var p=r._PSD;--p.ref||p.finalize(),vr===0&&(++vr,xt(function(){--vr==0&&$i()},[]))}function Ei(r,i){if(r._state===null)r._listeners.push(i);else{var l=r._state?i.onFulfilled:i.onRejected;if(l===null)return(r._state?i.resolve:i.reject)(r._value);++i.psd.ref,++vr,xt(jf,[l,r,i])}}function jf(r,i,l){try{var f,p=i._value;!i._state&&hr.length&&(hr=[]),f=H&&i._consoleTask?i._consoleTask.run(function(){return r(p)}):r(p),i._state||hr.indexOf(p)!==-1||(v=>{for(var g=en.length;g;)if(en[--g]._value===v._value)return en.splice(g,1)})(i),l.resolve(f)}catch(v){l.reject(v)}finally{--vr==0&&$i(),--l.psd.ref||l.psd.finalize()}}function Df(){mr(Tt,function(){Rr()&&Kr()})}function Rr(){var r=Zt;return Wt=Zt=!1,r}function Kr(){var r,i,l;do for(;0<qn.length;)for(r=qn,qn=[],l=r.length,i=0;i<l;++i){var f=r[i];f[0].apply(null,f[1])}while(0<qn.length);Wt=Zt=!0}function $i(){for(var r=en,i=(en=[],r.forEach(function(f){f._PSD.onunhandled.call(null,f._value,f)}),Gs.slice(0)),l=i.length;l;)i[--l]()}function Ys(r){return new Se(Pe,!1,r)}function gt(r,i){var l=Ie;return function(){var f=Rr(),p=Ie;try{return zn(l,!0),r.apply(this,arguments)}catch(v){i&&i(v)}finally{zn(p,!1),f&&Kr()}}}C(Se.prototype,{then:Ci,_then:function(r,i){Ei(this,new yl(null,null,r,i,Ie))},catch:function(r){var i,l;return arguments.length===1?this.then(null,r):(i=r,l=arguments[1],typeof i=="function"?this.then(null,function(f){return(f instanceof i?l:Ys)(f)}):this.then(null,function(f){return(f&&f.name===i?l:Ys)(f)}))},finally:function(r){return this.then(function(i){return Se.resolve(r()).then(function(){return i})},function(i){return Se.resolve(r()).then(function(){return Ys(i)})})},timeout:function(r,i){var l=this;return r<1/0?new Se(function(f,p){var v=setTimeout(function(){return p(new ce.Timeout(i))},r);l.then(f,p).finally(clearTimeout.bind(null,v))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&V(Se.prototype,Symbol.toStringTag,"Dexie.Promise"),Tt.env=bl(),C(Se,{all:function(){var r=qe.apply(null,arguments).map(Zs);return new Se(function(i,l){r.length===0&&i([]);var f=r.length;r.forEach(function(p,v){return Se.resolve(p).then(function(g){r[v]=g,--f||i(r)},l)})})},resolve:function(r){return r instanceof Se?r:r&&typeof r.then=="function"?new Se(function(i,l){r.then(i,l)}):new Se(Pe,!0,r)},reject:Ys,race:function(){var r=qe.apply(null,arguments).map(Zs);return new Se(function(i,l){r.map(function(f){return Se.resolve(f).then(i,l)})})},PSD:{get:function(){return Ie},set:function(r){return Ie=r}},totalEchoes:{get:function(){return Qs}},newPSD:Hn,usePSD:mr,scheduler:{get:function(){return xt},set:function(r){xt=r}},rejectionMapper:{get:function(){return jt},set:function(r){jt=r}},follow:function(r,i){return new Se(function(l,f){return Hn(function(p,v){var g=Ie;g.unhandleds=[],g.onunhandled=v,g.finalize=re(function(){var w,$=this;w=function(){$.unhandleds.length===0?p():v($.unhandleds[0])},Gs.push(function B(){w(),Gs.splice(Gs.indexOf(B),1)}),++vr,xt(function(){--vr==0&&$i()},[])},g.finalize),r()},i,l,f)})}}),tt&&(tt.allSettled&&V(Se,"allSettled",function(){var r=qe.apply(null,arguments).map(Zs);return new Se(function(i){r.length===0&&i([]);var l=r.length,f=new Array(l);r.forEach(function(p,v){return Se.resolve(p).then(function(g){return f[v]={status:"fulfilled",value:g}},function(g){return f[v]={status:"rejected",reason:g}}).then(function(){return--l||i(f)})})})}),tt.any&&typeof AggregateError<"u"&&V(Se,"any",function(){var r=qe.apply(null,arguments).map(Zs);return new Se(function(i,l){r.length===0&&l(new AggregateError([]));var f=r.length,p=new Array(f);r.forEach(function(v,g){return Se.resolve(v).then(function(w){return i(w)},function(w){p[g]=w,--f||l(new AggregateError(p))})})})}),tt.withResolvers)&&(Se.withResolvers=tt.withResolvers);var Pt={awaits:0,echoes:0,id:0},Lf=0,Js=[],Xs=0,Qs=0,Rf=0;function Hn(r,g,l,f){var p=Ie,v=Object.create(p),g=(v.parent=p,v.ref=0,v.global=!1,v.id=++Rf,Tt.env,v.env=yt?{Promise:Se,PromiseProp:{value:Se,configurable:!0,writable:!0},all:Se.all,race:Se.race,allSettled:Se.allSettled,any:Se.any,resolve:Se.resolve,reject:Se.reject}:{},g&&h(v,g),++p.ref,v.finalize=function(){--this.parent.ref||this.parent.finalize()},mr(v,r,l,f));return v.ref===0&&v.finalize(),g}function Fr(){return Pt.id||(Pt.id=++Lf),++Pt.awaits,Pt.echoes+=Ne,Pt.id}function Wn(){return!!Pt.awaits&&(--Pt.awaits==0&&(Pt.id=0),Pt.echoes=Pt.awaits*Ne,!0)}function Zs(r){return Pt.echoes&&r&&r.constructor===tt?(Fr(),r.then(function(i){return Wn(),i},function(i){return Wn(),St(i)})):r}function Kf(){var r=Js[Js.length-1];Js.pop(),zn(r,!1)}function zn(r,i){var l,f,p=Ie;(i?!Pt.echoes||Xs++&&r===Ie:!Xs||--Xs&&r===Ie)||queueMicrotask(i?(function(v){++Qs,Pt.echoes&&--Pt.echoes!=0||(Pt.echoes=Pt.awaits=Pt.id=0),Js.push(Ie),zn(v,!0)}).bind(null,r):Kf),r!==Ie&&(Ie=r,p===Tt&&(Tt.env=bl()),yt)&&(l=Tt.env.Promise,f=r.env,p.global||r.global)&&(Object.defineProperty(a,"Promise",f.PromiseProp),l.all=f.all,l.race=f.race,l.resolve=f.resolve,l.reject=f.reject,f.allSettled&&(l.allSettled=f.allSettled),f.any)&&(l.any=f.any)}function bl(){var r=a.Promise;return yt?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function mr(r,i,l,f,p){var v=Ie;try{return zn(r,!0),i(l,f,p)}finally{zn(v,!1)}}function wl(r,i,l,f){return typeof r!="function"?r:function(){var p=Ie;l&&Fr(),zn(i,!0);try{return r.apply(this,arguments)}finally{zn(p,!1),f&&queueMicrotask(Wn)}}}function Ti(r){Promise===tt&&Pt.echoes===0?Xs===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+Ur).indexOf("[native code]")===-1&&(Fr=Wn=k);var St=Se.reject,yr="￿",Mn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",_l="String expected.",eo="__dbnames",Ai="readonly",Pi="readwrite";function gr(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var kl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function to(r){return typeof r!="string"||/\./.test(r)?function(i){return i}:function(i){return i[r]===void 0&&r in i&&delete(i=xe(i))[r],i}}function xl(){throw ce.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ot(r,i){try{var l=Cl(r),f=Cl(i);if(l!==f)return l==="Array"?1:f==="Array"?-1:l==="binary"?1:f==="binary"?-1:l==="string"?1:f==="string"?-1:l==="Date"?1:f!=="Date"?NaN:-1;switch(l){case"number":case"Date":case"string":return i<r?1:r<i?-1:0;case"binary":for(var p=Sl(r),v=Sl(i),g=p.length,w=v.length,$=g<w?g:w,B=0;B<$;++B)if(p[B]!==v[B])return p[B]<v[B]?-1:1;return g===w?0:g<w?-1:1;case"Array":for(var I=r,E=i,T=I.length,K=E.length,D=T<K?T:K,j=0;j<D;++j){var L=ot(I[j],E[j]);if(L!==0)return L}return T===K?0:T<K?-1:1}}catch{}return NaN}function Cl(r){var i=typeof r;return i=="object"&&(ArrayBuffer.isView(r)||(i=rt(r))==="ArrayBuffer")?"binary":i}function Sl(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}function no(r,i,l){var f=r.schema.yProps;return f?(i&&0<l.numFailures&&(i=i.filter(function(p,v){return!l.failures[v]})),Promise.all(f.map(function(p){return p=p.updatesTable,i?r.db.table(p).where("k").anyOf(i).delete():r.db.table(p).clear()})).then(function(){return l})):l}El.prototype.execute=function(r){var i=this["@@propmod"];if(i.add!==void 0){var l=i.add;if(d(l))return o(o([],d(r)?r:[],!0),l).sort();if(typeof l=="number")return(Number(r)||0)+l;if(typeof l=="bigint")try{return BigInt(r)+l}catch{return BigInt(0)+l}throw new TypeError("Invalid term ".concat(l))}if(i.remove!==void 0){var f=i.remove;if(d(f))return d(r)?r.filter(function(p){return!f.includes(p)}).sort():[];if(typeof f=="number")return Number(r)-f;if(typeof f=="bigint")try{return BigInt(r)-f}catch{return BigInt(0)-f}throw new TypeError("Invalid subtrahend ".concat(f))}return l=(l=i.replacePrefix)==null?void 0:l[0],l&&typeof r=="string"&&r.startsWith(l)?i.replacePrefix[1]+r.substring(l.length):r};var is=El;function El(r){this["@@propmod"]=r}function $l(r,i){for(var l=c(i),f=l.length,p=!1,v=0;v<f;++v){var g=l[v],w=i[g],$=ie(r,g);w instanceof is?(ee(r,g,w.execute($)),p=!0):$!==w&&(ee(r,g,w),p=!0)}return p}ht.prototype._trans=function(r,i,l){var f=this._tx||Ie.trans,p=this.name,v=H&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function g(B,I,E){if(E.schema[p])return i(E.idbtrans,E);throw new ce.NotFound("Table "+p+" not part of transaction")}var w=Rr();try{var $=f&&f.db._novip===this.db._novip?f===Ie.trans?f._promise(r,g,l):Hn(function(){return f._promise(r,g,l)},{trans:f,transless:Ie.transless||Ie}):function B(I,E,T,K){if(I.idbdb&&(I._state.openComplete||Ie.letThrough||I._vip)){var D=I._createTransaction(E,T,I._dbSchema);try{D.create(),I._state.PR1398_maxLoop=3}catch(j){return j.name===It.InvalidState&&I.isOpen()&&0<--I._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),I.close({disableAutoOpen:!1}),I.open().then(function(){return B(I,E,T,K)})):St(j)}return D._promise(E,function(j,L){return Hn(function(){return Ie.trans=D,K(j,L,D)})}).then(function(j){if(E==="readwrite")try{D.idbtrans.commit()}catch{}return E==="readonly"?j:D._completion.then(function(){return j})})}if(I._state.openComplete)return St(new ce.DatabaseClosed(I._state.dbOpenError));if(!I._state.isBeingOpened){if(!I._state.autoOpen)return St(new ce.DatabaseClosed);I.open().catch(k)}return I._state.dbReadyPromise.then(function(){return B(I,E,T,K)})}(this.db,r,[this.name],g);return v&&($._consoleTask=v,$=$.catch(function(B){return console.trace(B),St(B)})),$}finally{w&&Kr()}},ht.prototype.get=function(r,i){var l=this;return r&&r.constructor===Object?this.where(r).first(i):r==null?St(new ce.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)},ht.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(w){if(w.compound&&i.every(function(B){return 0<=w.keyPath.indexOf(B)})){for(var $=0;$<i.length;++$)if(i.indexOf(w.keyPath[$])===-1)return!1;return!0}return!1}).sort(function(w,$){return w.keyPath.length-$.keyPath.length})[0];if(l&&this.db._maxKey!==yr)return g=l.keyPath.slice(0,i.length),this.where(g).equals(g.map(function(w){return r[w]}));!l&&H&&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(w,$){return ot(w,$)===0}var g=i.reduce(function(I,$){var B=I[0],I=I[1],E=f[$],T=r[$];return[B||E,B||!E?gr(I,E&&E.multi?function(K){return K=ie(K,$),d(K)&&K.some(function(D){return p(T,D)})}:function(K){return p(T,ie(K,$))}):I]},[null,null]),v=g[0],g=g[1];return v?this.where(v.name).equals(r[v.keyPath]).filter(g):l?this.filter(g):this.where(i).equals("")},ht.prototype.filter=function(r){return this.toCollection().and(r)},ht.prototype.count=function(r){return this.toCollection().count(r)},ht.prototype.offset=function(r){return this.toCollection().offset(r)},ht.prototype.limit=function(r){return this.toCollection().limit(r)},ht.prototype.each=function(r){return this.toCollection().each(r)},ht.prototype.toArray=function(r){return this.toCollection().toArray(r)},ht.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},ht.prototype.orderBy=function(r){return new this.db.Collection(new this.db.WhereClause(this,d(r)?"[".concat(r.join("+"),"]"):r))},ht.prototype.reverse=function(){return this.toCollection().reverse()},ht.prototype.mapToClass=function(r){for(var i=this.db,l=this.name,f=((this.schema.mappedClass=r).prototype instanceof xl&&(r=(g=>{var w=I,$=g;if(typeof $!="function"&&$!==null)throw new TypeError("Class extends value "+String($)+" is not a constructor or null");function B(){this.constructor=w}function I(){return g!==null&&g.apply(this,arguments)||this}return n(w,$),w.prototype=$===null?Object.create($):(B.prototype=$.prototype,new B),Object.defineProperty(I.prototype,"db",{get:function(){return i},enumerable:!1,configurable:!0}),I.prototype.table=function(){return l},I})(r)),new Set),p=r.prototype;p;p=y(p))Object.getOwnPropertyNames(p).forEach(function(g){return f.add(g)});function v(g){if(!g)return g;var w,$=Object.create(r.prototype);for(w in g)if(!f.has(w))try{$[w]=g[w]}catch{}return $}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=v,this.hook("reading",v),r},ht.prototype.defineClass=function(){return this.mapToClass(function(r){h(this,r)})},ht.prototype.add=function(r,i){var l=this,f=this.schema.primKey,p=f.auto,v=f.keyPath,g=r;return v&&p&&(g=to(v)(r)),this._trans("readwrite",function(w){return l.core.mutate({trans:w,type:"add",keys:i!=null?[i]:null,values:[g]})}).then(function(w){return w.numFailures?Se.reject(w.failures[0]):w.lastResult}).then(function(w){if(v)try{ee(r,v,w)}catch{}return w})},ht.prototype.upsert=function(r,i){var l=this,f=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return l.core.get({trans:p,key:r}).then(function(v){var g=v??{};return $l(g,i),f&&ee(g,f,r),l.core.mutate({trans:p,type:"put",values:[g],keys:[r],upsert:!0,updates:{keys:[r],changeSpecs:[i]}}).then(function(w){return w.numFailures?Se.reject(w.failures[0]):!!v})})})},ht.prototype.update=function(r,i){return typeof r!="object"||d(r)?this.where(":id").equals(r).modify(i):(r=ie(r,this.schema.primKey.keyPath))===void 0?St(new ce.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(i)},ht.prototype.put=function(r,i){var l=this,f=this.schema.primKey,p=f.auto,v=f.keyPath,g=r;return v&&p&&(g=to(v)(r)),this._trans("readwrite",function(w){return l.core.mutate({trans:w,type:"put",values:[g],keys:i!=null?[i]:null})}).then(function(w){return w.numFailures?Se.reject(w.failures[0]):w.lastResult}).then(function(w){if(v)try{ee(r,v,w)}catch{}return w})},ht.prototype.delete=function(r){var i=this;return this._trans("readwrite",function(l){return i.core.mutate({trans:l,type:"delete",keys:[r]}).then(function(f){return no(i,[r],f)}).then(function(f){return f.numFailures?Se.reject(f.failures[0]):void 0})})},ht.prototype.clear=function(){var r=this;return this._trans("readwrite",function(i){return r.core.mutate({trans:i,type:"deleteRange",range:kl}).then(function(l){return no(r,null,l)})}).then(function(i){return i.numFailures?Se.reject(i.failures[0]):void 0})},ht.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)})})})},ht.prototype.bulkAdd=function(r,i,l){var f=this,p=Array.isArray(i)?i:void 0,v=(l=l||(p?void 0:i))?l.allKeys:void 0;return this._trans("readwrite",function(g){var w=f.schema.primKey,B=w.auto,w=w.keyPath;if(w&&p)throw new ce.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new ce.InvalidArgument("Arguments objects and keys must have the same length");var $=r.length,B=w&&B?r.map(to(w)):r;return f.core.mutate({trans:g,type:"add",keys:p,values:B,wantResults:v}).then(function(I){var E=I.numFailures,T=I.failures;if(E===0)return v?I.results:I.lastResult;throw new ct("".concat(f.name,".bulkAdd(): ").concat(E," of ").concat($," operations failed"),T)})})},ht.prototype.bulkPut=function(r,i,l){var f=this,p=Array.isArray(i)?i:void 0,v=(l=l||(p?void 0:i))?l.allKeys:void 0;return this._trans("readwrite",function(g){var w=f.schema.primKey,B=w.auto,w=w.keyPath;if(w&&p)throw new ce.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new ce.InvalidArgument("Arguments objects and keys must have the same length");var $=r.length,B=w&&B?r.map(to(w)):r;return f.core.mutate({trans:g,type:"put",keys:p,values:B,wantResults:v}).then(function(I){var E=I.numFailures,T=I.failures;if(E===0)return v?I.results:I.lastResult;throw new ct("".concat(f.name,".bulkPut(): ").concat(E," of ").concat($," operations failed"),T)})})},ht.prototype.bulkUpdate=function(r){var i=this,l=this.core,f=r.map(function(g){return g.key}),p=r.map(function(g){return g.changes}),v=[];return this._trans("readwrite",function(g){return l.getMany({trans:g,keys:f,cache:"clone"}).then(function(w){var $=[],B=[],I=(r.forEach(function(E,T){var K=E.key,D=E.changes,j=w[T];if(j){for(var L=0,G=Object.keys(D);L<G.length;L++){var U=G[L],se=D[U];if(U===i.schema.primKey.keyPath){if(ot(se,K)!==0)throw new ce.Constraint("Cannot update primary key in bulkUpdate()")}else ee(j,U,se)}v.push(T),$.push(K),B.push(j)}}),$.length);return l.mutate({trans:g,type:"put",keys:$,values:B,updates:{keys:f,changeSpecs:p}}).then(function(E){var T=E.numFailures,K=E.failures;if(T===0)return I;for(var D=0,j=Object.keys(K);D<j.length;D++){var L,G=j[D],U=v[Number(G)];U!=null&&(L=K[G],delete K[G],K[U]=L)}throw new ct("".concat(i.name,".bulkUpdate(): ").concat(T," of ").concat(I," operations failed"),K)})})})},ht.prototype.bulkDelete=function(r){var i=this,l=r.length;return this._trans("readwrite",function(f){return i.core.mutate({trans:f,type:"delete",keys:r}).then(function(p){return no(i,r,p)})}).then(function(f){var p=f.numFailures,v=f.failures;if(p===0)return f.lastResult;throw new ct("".concat(i.name,".bulkDelete(): ").concat(p," of ").concat(l," operations failed"),v)})};var Tl=ht;function ht(){}function as(r){function i(g,w){if(w){for(var $=arguments.length,B=new Array($-1);--$;)B[$-1]=arguments[$];return l[g].subscribe.apply(null,B),r}if(typeof g=="string")return l[g]}var l={};i.addEventType=v;for(var f=1,p=arguments.length;f<p;++f)v(arguments[f]);return i;function v(g,w,$){var B,I;if(typeof g!="object")return w=w||ae,I={subscribers:[],fire:$=$||k,subscribe:function(E){I.subscribers.indexOf(E)===-1&&(I.subscribers.push(E),I.fire=w(I.fire,E))},unsubscribe:function(E){I.subscribers=I.subscribers.filter(function(T){return T!==E}),I.fire=I.subscribers.reduce(w,$)}},l[g]=i[g]=I;c(B=g).forEach(function(E){var T=B[E];if(d(T))v(E,B[E][0],B[E][1]);else{if(T!=="asap")throw new ce.InvalidArgument("Invalid event config");var K=v(E,b,function(){for(var D=arguments.length,j=new Array(D);D--;)j[D]=arguments[D];K.subscribers.forEach(function(L){fe(function(){L.apply(null,j)})})})}})}}function ls(r,i){return Z(i).from({prototype:r}),i}function Nr(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function Oi(r,i){r.filter=gr(r.filter,i)}function Mi(r,i,l){var f=r.replayFilter;r.replayFilter=f?function(){return gr(f(),i())}:i,r.justLimit=l&&!f}function ro(r,i){if(r.isPrimKey)return i.primaryKey;var l=i.getIndexByKeyPath(r.index);if(l)return l;throw new ce.Schema("KeyPath "+r.index+" on object store "+i.name+" is not indexed")}function Al(r,i,l){var f=ro(r,i.schema);return i.openCursor({trans:l,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:f,range:r.range}})}function so(r,i,l,f){var p,v,g=r.replayFilter?gr(r.filter,r.replayFilter()):r.filter;return r.or?(p={},v=function(w,$,B){var I,E;g&&!g($,B,function(T){return $.stop(T)},function(T){return $.fail(T)})||((E=""+(I=$.primaryKey))=="[object ArrayBuffer]"&&(E=""+new Uint8Array(I)),_(p,E))||(p[E]=!0,i(w,$,B))},Promise.all([r.or._iterate(v,l),Pl(Al(r,f,l),r.algorithm,v,!r.keysOnly&&r.valueMapper)])):Pl(Al(r,f,l),gr(r.algorithm,g),i,!r.keysOnly&&r.valueMapper)}function Pl(r,i,l,f){var p=gt(f?function(v,g,w){return l(f(v),g,w)}:l);return r.then(function(v){if(v)return v.start(function(){var g=function(){return v.continue()};i&&!i(v,function(w){return g=w},function(w){v.stop(w),g=k},function(w){v.fail(w),g=k})||p(v.value,v,function(w){return g=w}),g()})})}at.prototype._read=function(r,i){var l=this._ctx;return l.error?l.table._trans(null,St.bind(null,l.error)):l.table._trans("readonly",r).then(i)},at.prototype._write=function(r){var i=this._ctx;return i.error?i.table._trans(null,St.bind(null,i.error)):i.table._trans("readwrite",r,"locked")},at.prototype._addAlgorithm=function(r){var i=this._ctx;i.algorithm=gr(i.algorithm,r)},at.prototype._iterate=function(r,i){return so(this._ctx,r,i,this._ctx.table.core)},at.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},at.prototype.raw=function(){return this._ctx.valueMapper=null,this},at.prototype.each=function(r){var i=this._ctx;return this._read(function(l){return so(i,r,l,i.table.core)})},at.prototype.count=function(r){var i=this;return this._read(function(l){var f,p=i._ctx,v=p.table.core;return Nr(p,!0)?v.count({trans:l,query:{index:ro(p,v.schema),range:p.range}}).then(function(g){return Math.min(g,p.limit)}):(f=0,so(p,function(){return++f,!1},l,v).then(function(){return f}))}).then(r)},at.prototype.sortBy=function(r,i){var l=r.split(".").reverse(),f=l[0],p=l.length-1;function v($,B){return B?v($[l[B]],B-1):$[f]}var g=this._ctx.dir==="next"?1:-1;function w($,B){return ot(v($,p),v(B,p))*g}return this.toArray(function($){return $.slice().sort(w)}).then(i)},at.prototype.toArray=function(r){var i=this;return this._read(function(l){var f,p,v,g=i._ctx;return Nr(g,!0)&&0<g.limit?(f=g.valueMapper,p=ro(g,g.table.core.schema),g.table.core.query({trans:l,limit:g.limit,values:!0,direction:g.dir==="prev"?"prev":void 0,query:{index:p,range:g.range}}).then(function(w){return w=w.result,f?w.map(f):w})):(v=[],so(g,function(w){return v.push(w)},l,g.table.core).then(function(){return v}))},r)},at.prototype.offset=function(r){var i=this._ctx;return r<=0||(i.offset+=r,Nr(i)?Mi(i,function(){var l=r;return function(f,p){return l===0||(l===1?--l:p(function(){f.advance(l),l=0}),!1)}}):Mi(i,function(){var l=r;return function(){return--l<0}})),this},at.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),Mi(this._ctx,function(){var i=r;return function(l,f,p){return--i<=0&&f(p),0<=i}},!0),this},at.prototype.until=function(r,i){return Oi(this._ctx,function(l,f,p){return!r(l.value)||(f(p),i)}),this},at.prototype.first=function(r){return this.limit(1).toArray(function(i){return i[0]}).then(r)},at.prototype.last=function(r){return this.reverse().first(r)},at.prototype.filter=function(r){var i;return Oi(this._ctx,function(l){return r(l.value)}),(i=this._ctx).isMatch=gr(i.isMatch,r),this},at.prototype.and=function(r){return this.filter(r)},at.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},at.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},at.prototype.desc=function(){return this.reverse()},at.prototype.eachKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(l,f){r(f.key,f)})},at.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},at.prototype.eachPrimaryKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(l,f){r(f.primaryKey,f)})},at.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)},at.prototype.primaryKeys=function(r){var i=this._ctx;if(Nr(i,!0)&&0<i.limit)return this._read(function(f){var p=ro(i,i.table.core.schema);return i.table.core.query({trans:f,values:!1,limit:i.limit,direction:i.dir==="prev"?"prev":void 0,query:{index:p,range:i.range}})}).then(function(f){return f.result}).then(r);i.keysOnly=!i.isMatch;var l=[];return this.each(function(f,p){l.push(p.primaryKey)}).then(function(){return l}).then(r)},at.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},at.prototype.firstKey=function(r){return this.limit(1).keys(function(i){return i[0]}).then(r)},at.prototype.lastKey=function(r){return this.reverse().firstKey(r)},at.prototype.distinct=function(){var r,i=this._ctx,i=i.index&&i.table.schema.idxByName[i.index];return i&&i.multi&&(r={},Oi(this._ctx,function(f){var f=f.primaryKey.toString(),p=_(r,f);return r[f]=!0,!p})),this},at.prototype.modify=function(r){var i=this,l=this._ctx;return this._write(function(f){function p(j,L){var G=L.failures;T+=j-L.numFailures;for(var U=0,se=c(G);U<se.length;U++){var pe=se[U];E.push(G[pe])}}var v=typeof r=="function"?r:function(j){return $l(j,r)},g=l.table.core,I=g.schema.primaryKey,w=I.outbound,$=I.extractKey,B=200,I=i.db._options.modifyChunkSize,E=(I&&(B=typeof I=="object"?I[g.name]||I["*"]||200:I),[]),T=0,K=[],D=r===Ol;return i.clone().primaryKeys().then(function(j){function L(U){var se=Math.min(B,j.length-U),pe=j.slice(U,U+se);return(D?Promise.resolve([]):g.getMany({trans:f,keys:pe,cache:"immutable"})).then(function(ve){var _e=[],ye=[],Oe=w?[]:null,we=D?pe:[];if(!D)for(var Me=0;Me<se;++Me){var he=ve[Me],Be={value:xe(he),primKey:j[U+Me]};v.call(Be,Be.value,Be)!==!1&&(Be.value==null?we.push(j[U+Me]):w||ot($(he),$(Be.value))===0?(ye.push(Be.value),w&&Oe.push(j[U+Me])):(we.push(j[U+Me]),_e.push(Be.value)))}return Promise.resolve(0<_e.length&&g.mutate({trans:f,type:"add",values:_e}).then(function(Ue){for(var Ge in Ue.failures)we.splice(parseInt(Ge),1);p(_e.length,Ue)})).then(function(){return(0<ye.length||G&&typeof r=="object")&&g.mutate({trans:f,type:"put",keys:Oe,values:ye,criteria:G,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<U}).then(function(Ue){return p(ye.length,Ue)})}).then(function(){return(0<we.length||G&&D)&&g.mutate({trans:f,type:"delete",keys:we,criteria:G,isAdditionalChunk:0<U}).then(function(Ue){return no(l.table,we,Ue)}).then(function(Ue){return p(we.length,Ue)})}).then(function(){return j.length>U+se&&L(U+B)})})}var G=Nr(l)&&l.limit===1/0&&(typeof r!="function"||D)&&{index:l.index,range:l.range};return L(0).then(function(){if(0<E.length)throw new Fe("Error modifying one or more objects",E,T,K);return j.length})})})},at.prototype.delete=function(){var r=this._ctx,i=r.range;return!Nr(r)||r.table.schema.yProps||!r.isPrimKey&&i.type!==3?this.modify(Ol):this._write(function(l){var f=r.table.core.schema.primaryKey,p=i;return r.table.core.count({trans:l,query:{index:f,range:p}}).then(function(v){return r.table.core.mutate({trans:l,type:"deleteRange",range:p}).then(function($){var w=$.failures,$=$.numFailures;if($)throw new Fe("Could not delete some values",Object.keys(w).map(function(B){return w[B]}),v-$);return v-$})})})};var Ff=at;function at(){}var Ol=function(r,i){return i.value=null};function Nf(r,i){return r<i?-1:r===i?0:1}function Vf(r,i){return i<r?-1:r===i?0:1}function tn(r,i,l){return r=r instanceof Il?new r.Collection(r):r,r._ctx.error=new(l||TypeError)(i),r}function Vr(r){return new r.Collection(r,function(){return Ml("")}).limit(0)}function oo(K,i,l,f){var p,v,g,w,$,B,I,E=l.length;if(!l.every(function(j){return typeof j=="string"}))return tn(K,_l);function T(j){p=j==="next"?function(G){return G.toUpperCase()}:function(G){return G.toLowerCase()},v=j==="next"?function(G){return G.toLowerCase()}:function(G){return G.toUpperCase()},g=j==="next"?Nf:Vf;var L=l.map(function(G){return{lower:v(G),upper:p(G)}}).sort(function(G,U){return g(G.lower,U.lower)});w=L.map(function(G){return G.upper}),$=L.map(function(G){return G.lower}),I=(B=j)==="next"?"":f}T("next");var K=new K.Collection(K,function(){return Gn(w[0],$[E-1]+f)}),D=(K._ondirectionchange=function(j){T(j)},0);return K._addAlgorithm(function(j,L,G){var U=j.key;if(typeof U=="string"){var se=v(U);if(i(se,$,D))return!0;for(var pe=null,ve=D;ve<E;++ve){var _e=((ye,Oe,we,Me,he,Be)=>{for(var Ue=Math.min(ye.length,Me.length),Ge=-1,nt=0;nt<Ue;++nt){var nn=Oe[nt];if(nn!==Me[nt])return he(ye[nt],we[nt])<0?ye.substr(0,nt)+we[nt]+we.substr(nt+1):he(ye[nt],Me[nt])<0?ye.substr(0,nt)+Me[nt]+we.substr(nt+1):0<=Ge?ye.substr(0,Ge)+Oe[Ge]+we.substr(Ge+1):null;he(ye[nt],nn)<0&&(Ge=nt)}return Ue<Me.length&&Be==="next"?ye+we.substr(ye.length):Ue<ye.length&&Be==="prev"?ye.substr(0,we.length):Ge<0?null:ye.substr(0,Ge)+Me[Ge]+we.substr(Ge+1)})(U,se,w[ve],$[ve],g,B);_e===null&&pe===null?D=ve+1:(pe===null||0<g(pe,_e))&&(pe=_e)}L(pe!==null?function(){j.continue(pe+I)}:G)}return!1}),K}function Gn(r,i,l,f){return{type:2,lower:r,upper:i,lowerOpen:l,upperOpen:f}}function Ml(r){return{type:1,lower:r,upper:r}}Object.defineProperty(Ot.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Ot.prototype.between=function(r,i,l,f){l=l!==!1,f=f===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(l||f)&&(!l||!f)?Vr(this):new this.Collection(this,function(){return Gn(r,i,!l,!f)})}catch{return tn(this,Mn)}},Ot.prototype.equals=function(r){return r==null?tn(this,Mn):new this.Collection(this,function(){return Ml(r)})},Ot.prototype.above=function(r){return r==null?tn(this,Mn):new this.Collection(this,function(){return Gn(r,void 0,!0)})},Ot.prototype.aboveOrEqual=function(r){return r==null?tn(this,Mn):new this.Collection(this,function(){return Gn(r,void 0,!1)})},Ot.prototype.below=function(r){return r==null?tn(this,Mn):new this.Collection(this,function(){return Gn(void 0,r,!1,!0)})},Ot.prototype.belowOrEqual=function(r){return r==null?tn(this,Mn):new this.Collection(this,function(){return Gn(void 0,r)})},Ot.prototype.startsWith=function(r){return typeof r!="string"?tn(this,_l):this.between(r,r+yr,!0,!0)},Ot.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):oo(this,function(i,l){return i.indexOf(l[0])===0},[r],yr)},Ot.prototype.equalsIgnoreCase=function(r){return oo(this,function(i,l){return i===l[0]},[r],"")},Ot.prototype.anyOfIgnoreCase=function(){var r=qe.apply(st,arguments);return r.length===0?Vr(this):oo(this,function(i,l){return l.indexOf(i)!==-1},r,"")},Ot.prototype.startsWithAnyOfIgnoreCase=function(){var r=qe.apply(st,arguments);return r.length===0?Vr(this):oo(this,function(i,l){return l.some(function(f){return i.indexOf(f)===0})},r,yr)},Ot.prototype.anyOf=function(){var r,i,l=this,f=qe.apply(st,arguments),p=this._cmp;try{f.sort(p)}catch{return tn(this,Mn)}return f.length===0?Vr(this):((r=new this.Collection(this,function(){return Gn(f[0],f[f.length-1])}))._ondirectionchange=function(v){p=v==="next"?l._ascending:l._descending,f.sort(p)},i=0,r._addAlgorithm(function(v,g,w){for(var $=v.key;0<p($,f[i]);)if(++i===f.length)return g(w),!1;return p($,f[i])===0||(g(function(){v.continue(f[i])}),!1)}),r)},Ot.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Ot.prototype.noneOf=function(){var r=qe.apply(st,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return tn(this,Mn)}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})},Ot.prototype.inAnyRange=function(r,G){var l=this,f=this._cmp,p=this._ascending,v=this._descending,g=this._min,w=this._max;if(r.length===0)return Vr(this);if(!r.every(function(U){return U[0]!==void 0&&U[1]!==void 0&&p(U[0],U[1])<=0}))return tn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ce.InvalidArgument);var $=!G||G.includeLowers!==!1,B=G&&G.includeUppers===!0,I,E=p;function T(U,se){return E(U[0],se[0])}try{(I=r.reduce(function(U,se){for(var pe=0,ve=U.length;pe<ve;++pe){var _e=U[pe];if(f(se[0],_e[1])<0&&0<f(se[1],_e[0])){_e[0]=g(_e[0],se[0]),_e[1]=w(_e[1],se[1]);break}}return pe===ve&&U.push(se),U},[])).sort(T)}catch{return tn(this,Mn)}var K=0,D=B?function(U){return 0<p(U,I[K][1])}:function(U){return 0<=p(U,I[K][1])},j=$?function(U){return 0<v(U,I[K][0])}:function(U){return 0<=v(U,I[K][0])},L=D,G=new this.Collection(this,function(){return Gn(I[0][0],I[I.length-1][1],!$,!B)});return G._ondirectionchange=function(U){E=U==="next"?(L=D,p):(L=j,v),I.sort(T)},G._addAlgorithm(function(U,se,pe){for(var ve,_e=U.key;L(_e);)if(++K===I.length)return se(pe),!1;return!D(ve=_e)&&!j(ve)||(l._cmp(_e,I[K][1])===0||l._cmp(_e,I[K][0])===0||se(function(){E===p?U.continue(I[K][0]):U.continue(I[K][1])}),!1)}),G},Ot.prototype.startsWithAnyOf=function(){var r=qe.apply(st,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Vr(this):this.inAnyRange(r.map(function(i){return[i,i+yr]})):tn(this,"startsWithAnyOf() only works with strings")};var Il=Ot;function Ot(){}function dn(r){return gt(function(i){return us(i),r(i.target.error),!1})}function us(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var io="storagemutated",Ii="x-storagemutated-1",Yn=as(null,io),Bf=(bn.prototype._lock=function(){return X(!Ie.global),++this._reculock,this._reculock!==1||Ie.global||(Ie.lockOwnerFor=this),this},bn.prototype._unlock=function(){if(X(!Ie.global),--this._reculock==0)for(Ie.global||(Ie.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{mr(r[1],r[0])}catch{}}return this},bn.prototype._locked=function(){return this._reculock&&Ie.lockOwnerFor!==this},bn.prototype.create=function(r){var i=this;if(this.mode){var l=this.db.idbdb,f=this.db._state.dbOpenError;if(X(!this.idbtrans),!r&&!l)switch(f&&f.name){case"DatabaseClosedError":throw new ce.DatabaseClosed(f);case"MissingAPIError":throw new ce.MissingAPI(f.message,f);default:throw new ce.OpenFailed(f)}if(!this.active)throw new ce.TransactionInactive;X(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||l).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=gt(function(p){us(p),i._reject(r.error)}),r.onabort=gt(function(p){us(p),i.active&&i._reject(new ce.Abort(r.error)),i.active=!1,i.on("abort").fire(p)}),r.oncomplete=gt(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&Yn.storagemutated.fire(r.mutatedParts)})}return this},bn.prototype._promise=function(r,i,l){var f,p=this;return r==="readwrite"&&this.mode!=="readwrite"?St(new ce.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Se(function(v,g){p._blockedFuncs.push([function(){p._promise(r,i,l).then(v,g)},Ie])}):l?Hn(function(){var v=new Se(function(g,w){p._lock();var $=i(g,w,p);$&&$.then&&$.then(g,w)});return v.finally(function(){return p._unlock()}),v._lib=!0,v}):((f=new Se(function(v,g){var w=i(v,g,p);w&&w.then&&w.then(v,g)}))._lib=!0,f):St(new ce.TransactionInactive)},bn.prototype._root=function(){return this.parent?this.parent._root():this},bn.prototype.waitFor=function(r){var i,l=this._root(),f=Se.resolve(r),p=(l._waitingFor?l._waitingFor=l._waitingFor.then(function(){return f}):(l._waitingFor=f,l._waitingQueue=[],i=l.idbtrans.objectStore(l.storeNames[0]),function v(){for(++l._spinCount;l._waitingQueue.length;)l._waitingQueue.shift()();l._waitingFor&&(i.get(-1/0).onsuccess=v)}()),l._waitingFor);return new Se(function(v,g){f.then(function(w){return l._waitingQueue.push(gt(v.bind(null,w)))},function(w){return l._waitingQueue.push(gt(g.bind(null,w)))}).finally(function(){l._waitingFor===p&&(l._waitingFor=null)})})},bn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ce.Abort))},bn.prototype.table=function(r){var i=this._memoizedTables||(this._memoizedTables={});if(_(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 ce.NotFound("Table "+r+" not part of transaction")},bn);function bn(){}function ji(r,i,l,f,p,v,g,w){return{name:r,keyPath:i,unique:l,multi:f,auto:p,compound:v,src:(l&&!g?"&":"")+(f?"*":"")+(p?"++":"")+jl(i),type:w}}function jl(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function Di(r,i,l){return{name:r,primKey:i,indexes:l,mappedClass:null,idxByName:(f=function(p){return[p.name,p]},l.reduce(function(p,v,g){return v=f(v,g),v&&(p[v[0]]=v[1]),p},{}))};var f}var cs=function(r){try{return r.only([[]]),cs=function(){return[[]]},[[]]}catch{return cs=function(){return yr},yr}};function Li(r){return r==null?function(){}:typeof r=="string"?(i=r).split(".").length===1?function(l){return l[i]}:function(l){return ie(l,i)}:function(l){return ie(l,r)};var i}function Dl(r){return[].slice.call(r)}var Uf=0;function fs(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function qf(r,i,g){function f(L){if(L.type===3)return null;if(L.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var K=L.lower,D=L.upper,j=L.lowerOpen,L=L.upperOpen;return K===void 0?D===void 0?null:i.upperBound(D,!!L):D===void 0?i.lowerBound(K,!!j):i.bound(K,D,!!j,!!L)}function p(T){var K,D,j=T.name;return{name:j,schema:T,mutate:function(L){var G=L.trans,U=L.type,se=L.keys,pe=L.values,ve=L.range;return new Promise(function(_e,ye){_e=gt(_e);var Oe=G.objectStore(j),we=Oe.keyPath==null,Me=U==="put"||U==="add";if(!Me&&U!=="delete"&&U!=="deleteRange")throw new Error("Invalid operation type: "+U);var he,Be=(se||pe||{length:1}).length;if(se&&pe&&se.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(zt){++nn,us(zt)}var Ge=[],nt=[],nn=0;if(U==="deleteRange"){if(ve.type===4)return _e({numFailures:nn,failures:nt,results:[],lastResult:void 0});ve.type===3?Ge.push(he=Oe.clear()):Ge.push(he=Oe.delete(f(ve)))}else{var we=Me?we?[pe,se]:[pe,null]:[se,null],We=we[0],Nt=we[1];if(Me)for(var Vt=0;Vt<Be;++Vt)Ge.push(he=Nt&&Nt[Vt]!==void 0?Oe[U](We[Vt],Nt[Vt]):Oe[U](We[Vt])),he.onerror=Ue;else for(Vt=0;Vt<Be;++Vt)Ge.push(he=Oe[U](We[Vt])),he.onerror=Ue}function bo(zt){zt=zt.target.result,Ge.forEach(function(_r,ea){return _r.error!=null&&(nt[ea]=_r.error)}),_e({numFailures:nn,failures:nt,results:U==="delete"?se:Ge.map(function(_r){return _r.result}),lastResult:zt})}he.onerror=function(zt){Ue(zt),bo(zt)},he.onsuccess=bo})},getMany:function(L){var G=L.trans,U=L.keys;return new Promise(function(se,pe){se=gt(se);for(var ve,_e=G.objectStore(j),ye=U.length,Oe=new Array(ye),we=0,Me=0,he=function(Ge){Ge=Ge.target,Oe[Ge._pos]=Ge.result,++Me===we&&se(Oe)},Be=dn(pe),Ue=0;Ue<ye;++Ue)U[Ue]!=null&&((ve=_e.get(U[Ue]))._pos=Ue,ve.onsuccess=he,ve.onerror=Be,++we);we===0&&se(Oe)})},get:function(L){var G=L.trans,U=L.key;return new Promise(function(se,pe){se=gt(se);var ve=G.objectStore(j).get(U);ve.onsuccess=function(_e){return se(_e.target.result)},ve.onerror=dn(pe)})},query:(K=$,D=B,function(L){return new Promise(function(G,U){G=gt(G);var se,pe,ve,_e,Be=L.trans,ye=L.values,Oe=L.limit,he=L.query,we=(we=L.direction)!=null?we:"next",Me=Oe===1/0?void 0:Oe,Ue=he.index,he=he.range,Be=Be.objectStore(j),Be=Ue.isPrimaryKey?Be:Be.index(Ue.name),Ue=f(he);if(Oe===0)return G({result:[]});D?(he={query:Ue,count:Me,direction:we},(se=ye?Be.getAll(he):Be.getAllKeys(he)).onsuccess=function(Ge){return G({result:Ge.target.result})},se.onerror=dn(U)):K&&we==="next"?((se=ye?Be.getAll(Ue,Me):Be.getAllKeys(Ue,Me)).onsuccess=function(Ge){return G({result:Ge.target.result})},se.onerror=dn(U)):(pe=0,ve=!ye&&"openKeyCursor"in Be?Be.openKeyCursor(Ue,we):Be.openCursor(Ue,we),_e=[],ve.onsuccess=function(){var Ge=ve.result;return!Ge||(_e.push(ye?Ge.value:Ge.primaryKey),++pe===Oe)?G({result:_e}):void Ge.continue()},ve.onerror=dn(U))})}),openCursor:function(L){var G=L.trans,U=L.values,se=L.query,pe=L.reverse,ve=L.unique;return new Promise(function(_e,ye){_e=gt(_e);var Me=se.index,Oe=se.range,we=G.objectStore(j),we=Me.isPrimaryKey?we:we.index(Me.name),Me=pe?ve?"prevunique":"prev":ve?"nextunique":"next",he=!U&&"openKeyCursor"in we?we.openKeyCursor(f(Oe),Me):we.openCursor(f(Oe),Me);he.onerror=dn(ye),he.onsuccess=gt(function(Be){var Ue,Ge,nt,nn,We=he.result;We?(We.___id=++Uf,We.done=!1,Ue=We.continue.bind(We),Ge=(Ge=We.continuePrimaryKey)&&Ge.bind(We),nt=We.advance.bind(We),nn=function(){throw new Error("Cursor not stopped")},We.trans=G,We.stop=We.continue=We.continuePrimaryKey=We.advance=function(){throw new Error("Cursor not started")},We.fail=gt(ye),We.next=function(){var Nt=this,Vt=1;return this.start(function(){return Vt--?Nt.continue():Nt.stop()}).then(function(){return Nt})},We.start=function(Nt){function Vt(){if(he.result)try{Nt()}catch(zt){We.fail(zt)}else We.done=!0,We.start=function(){throw new Error("Cursor behind last entry")},We.stop()}var bo=new Promise(function(zt,_r){zt=gt(zt),he.onerror=dn(_r),We.fail=_r,We.stop=function(ea){We.stop=We.continue=We.continuePrimaryKey=We.advance=nn,zt(ea)}});return he.onsuccess=gt(function(zt){he.onsuccess=Vt,Vt()}),We.continue=Ue,We.continuePrimaryKey=Ge,We.advance=nt,Vt(),bo},_e(We)):_e(null)},ye)})},count:function(L){var G=L.query,U=L.trans,se=G.index,pe=G.range;return new Promise(function(ve,_e){var ye=U.objectStore(j),ye=se.isPrimaryKey?ye:ye.index(se.name),Oe=f(pe),Oe=Oe?ye.count(Oe):ye.count();Oe.onsuccess=gt(function(we){return ve(we.target.result)}),Oe.onerror=dn(_e)})}}}v=g,w=Dl((g=r).objectStoreNames),I=0<w.length?v.objectStore(w[0]):{};var v,g={schema:{name:g.name,tables:w.map(function(T){return v.objectStore(T)}).map(function(T){var K=T.keyPath,D=T.autoIncrement,L=d(K),j={},L={name:T.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:K==null,compound:L,keyPath:K,autoIncrement:D,unique:!0,extractKey:Li(K)},indexes:Dl(T.indexNames).map(function(G){return T.index(G)}).map(function(pe){var ve=pe.name,U=pe.unique,se=pe.multiEntry,pe=pe.keyPath,ve={name:ve,compound:d(pe),keyPath:pe,unique:U,multiEntry:se,extractKey:Li(pe)};return j[fs(pe)]=ve}),getIndexByKeyPath:function(G){return j[fs(G)]}};return j[":id"]=L.primaryKey,K!=null&&(j[fs(K)]=L.primaryKey),L})},hasGetAll:0<w.length&&"getAll"in I&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in I},w=g.schema,$=g.hasGetAll,B=g.hasIdb3Features,I=w.tables.map(p),E={};return I.forEach(function(T){return E[T.name]=T}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(T){if(E[T])return E[T];throw new Error("Table '".concat(T,"' not found"))},MIN_KEY:-1/0,MAX_KEY:cs(i),schema:w}}function Hf(r,i,l,f){return l=l.IDBKeyRange,i=qf(i,l,f),{dbcore:r.dbcore.reduce(function(p,v){return v=v.create,s(s({},p),v(p))},i)}}function ao(r,i){var l=i.db,l=Hf(r._middlewares,l,r._deps,i);r.core=l.dbcore,r.tables.forEach(function(f){var p=f.name;r.core.schema.tables.some(function(v){return v.name===p})&&(f.core=r.core.table(p),r[p]instanceof r.Table)&&(r[p].core=f.core)})}function lo(r,i,l,f){l.forEach(function(p){var v=f[p];i.forEach(function(g){var w=function $(B,I){return te(B,I)||(B=y(B))&&$(B,I)}(g,p);(!w||"value"in w&&w.value===void 0)&&(g===r.Transaction.prototype||g instanceof r.Transaction?V(g,p,{get:function(){return this.table(p)},set:function($){A(this,p,{value:$,writable:!0,configurable:!0,enumerable:!0})}}):g[p]=new r.Table(p,v))})})}function Ri(r,i){i.forEach(function(l){for(var f in l)l[f]instanceof r.Table&&delete l[f]})}function Wf(r,i){return r._cfg.version-i._cfg.version}function zf(r,i,l,f){var p=r._dbSchema,v=(l.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=Di("$meta",Rl("")[0],[]),r._storeNames.push("$meta")),r._createTransaction("readwrite",r._storeNames,p)),g=(v.create(l),v._completion.catch(f),v._reject.bind(v)),w=Ie.transless||Ie;Hn(function(){if(Ie.trans=v,Ie.transless=w,i!==0)return ao(r,l),B=i,(($=v).storeNames.includes("$meta")?$.table("$meta").get("version").then(function(I){return I??B}):Se.resolve(B)).then(function(L){var E=r,T=L,K=v,D=l,j=[],L=E._versions,G=E._dbSchema=co(0,E.idbdb,D);return(L=L.filter(function(U){return U._cfg.version>=T})).length===0?Se.resolve():(L.forEach(function(U){j.push(function(){var se,pe,ve,_e=G,ye=U._cfg.dbschema,Oe=(fo(E,_e,D),fo(E,ye,D),G=E._dbSchema=ye,Ki(_e,ye)),we=(Oe.add.forEach(function(Me){Fi(D,Me[0],Me[1].primKey,Me[1].indexes)}),Oe.change.forEach(function(Me){if(Me.recreate)throw new ce.Upgrade("Not yet support for changing primary key");var he=D.objectStore(Me.name);Me.add.forEach(function(Be){return uo(he,Be)}),Me.change.forEach(function(Be){he.deleteIndex(Be.name),uo(he,Be)}),Me.del.forEach(function(Be){return he.deleteIndex(Be)})}),U._cfg.contentUpgrade);if(we&&U._cfg.version>T)return ao(E,D),K._memoizedTables={},se=M(ye),Oe.del.forEach(function(Me){se[Me]=_e[Me]}),Ri(E,[E.Transaction.prototype]),lo(E,[E.Transaction.prototype],c(se),se),K.schema=se,(pe=Qe(we))&&Fr(),ye=Se.follow(function(){var Me;(ve=we(K))&&pe&&(Me=Wn.bind(null,null),ve.then(Me,Me))}),ve&&typeof ve.then=="function"?Se.resolve(ve):ye.then(function(){return ve})}),j.push(function(se){var pe,ve,_e=U._cfg.dbschema;pe=_e,ve=se,[].slice.call(ve.db.objectStoreNames).forEach(function(ye){return pe[ye]==null&&ve.db.deleteObjectStore(ye)}),Ri(E,[E.Transaction.prototype]),lo(E,[E.Transaction.prototype],E._storeNames,E._dbSchema),K.schema=E._dbSchema}),j.push(function(se){E.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(E.idbdb.version/10)===U._cfg.version?(E.idbdb.deleteObjectStore("$meta"),delete E._dbSchema.$meta,E._storeNames=E._storeNames.filter(function(pe){return pe!=="$meta"})):se.objectStore("$meta").put(U._cfg.version,"version"))})}),function U(){return j.length?Se.resolve(j.shift()(K.idbtrans)).then(U):Se.resolve()}().then(function(){Ll(G,D)}))}).catch(g);var $,B;c(p).forEach(function(I){Fi(l,I,p[I].primKey,p[I].indexes)}),ao(r,l),Se.follow(function(){return r.on.populate.fire(v)}).catch(g)})}function Gf(r,i){Ll(r._dbSchema,i),i.db.version%10!=0||i.objectStoreNames.contains("$meta")||i.db.createObjectStore("$meta").add(Math.ceil(i.db.version/10-1),"version");var l=co(0,r.idbdb,i);fo(r,r._dbSchema,i);for(var f=0,p=Ki(l,r._dbSchema).change;f<p.length;f++){var v=(g=>{if(g.change.length||g.recreate)return console.warn("Unable to patch indexes of table ".concat(g.name," because it has changes on the type of index or primary key.")),{value:void 0};var w=i.objectStore(g.name);g.add.forEach(function($){H&&console.debug("Dexie upgrade patch: Creating missing index ".concat(g.name,".").concat($.src)),uo(w,$)})})(p[f]);if(typeof v=="object")return v.value}}function Ki(r,i){var l,f={del:[],add:[],change:[]};for(l in r)i[l]||f.del.push(l);for(l in i){var p=r[l],v=i[l];if(p){var g={name:l,def:v,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(v.primKey.keyPath||"")||p.primKey.auto!==v.primKey.auto)g.recreate=!0,f.change.push(g);else{var w=p.idxByName,$=v.idxByName,B=void 0;for(B in w)$[B]||g.del.push(B);for(B in $){var I=w[B],E=$[B];I?I.src!==E.src&&g.change.push(E):g.add.push(E)}(0<g.del.length||0<g.add.length||0<g.change.length)&&f.change.push(g)}}else f.add.push([l,v])}return f}function Fi(r,i,l,f){var p=r.db.createObjectStore(i,l.keyPath?{keyPath:l.keyPath,autoIncrement:l.auto}:{autoIncrement:l.auto});f.forEach(function(v){return uo(p,v)})}function Ll(r,i){c(r).forEach(function(l){i.db.objectStoreNames.contains(l)||(H&&console.debug("Dexie: Creating missing table",l),Fi(i,l,r[l].primKey,r[l].indexes))})}function uo(r,i){r.createIndex(i.name,i.keyPath,{unique:i.unique,multiEntry:i.multi})}function co(r,i,l){var f={};return P(i.objectStoreNames,0).forEach(function(p){for(var v=l.objectStore(p),g=ji(jl(B=v.keyPath),B||"",!0,!1,!!v.autoIncrement,B&&typeof B!="string",!0),w=[],$=0;$<v.indexNames.length;++$){var I=v.index(v.indexNames[$]),B=I.keyPath,I=ji(I.name,B,!!I.unique,!!I.multiEntry,!1,B&&typeof B!="string",!1);w.push(I)}f[p]=Di(p,g,w)}),f}function fo(r,i,l){for(var f=l.db.objectStoreNames,p=0;p<f.length;++p){var v=f[p],g=l.objectStore(v);r._hasGetAll="getAll"in g;for(var w=0;w<g.indexNames.length;++w){var $,B=g.indexNames[w],I=g.index(B).keyPath,I=typeof I=="string"?I:"["+P(I).join("+")+"]";i[v]&&($=i[v].idxByName[I])&&($.name=B,delete i[v].idxByName[I],i[v].idxByName[B]=$)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function Rl(r){return r.split(",").map(function(i,l){var p=i.split(":"),f=(f=p[1])==null?void 0:f.trim(),p=(i=p[0].trim()).replace(/([&*]|\+\+)/g,""),v=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return ji(p,v||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),d(v),l===0,f)})}Br.prototype._createTableSchema=Di,Br.prototype._parseIndexSyntax=Rl,Br.prototype._parseStoresSpec=function(r,i){var l=this;c(r).forEach(function(f){if(r[f]!==null){var p=l._parseIndexSyntax(r[f]),v=p.shift();if(!v)throw new ce.Schema("Invalid schema for table "+f+": "+r[f]);if(v.unique=!0,v.multi)throw new ce.Schema("Primary key cannot be multiEntry*");p.forEach(function(g){if(g.auto)throw new ce.Schema("Only primary key can be marked as autoIncrement (++)");if(!g.keyPath)throw new ce.Schema("Index must have a name and cannot be an empty string")}),v=l._createTableSchema(f,v,p),i[f]=v}})},Br.prototype.stores=function(l){var i=this.db,l=(this._cfg.storesSource=this._cfg.storesSource?h(this._cfg.storesSource,l):l,i._versions),f={},p={};return l.forEach(function(v){h(f,v._cfg.storesSource),p=v._cfg.dbschema={},v._parseStoresSpec(f,p)}),i._dbSchema=p,Ri(i,[i._allTables,i,i.Transaction.prototype]),lo(i,[i._allTables,i,i.Transaction.prototype,this._cfg.tables],c(p),p),i._storeNames=c(p),this},Br.prototype.upgrade=function(r){return this._cfg.contentUpgrade=q(this._cfg.contentUpgrade||k,r),this};var Yf=Br;function Br(){}var ds=(()=>{var r,i,l;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(r=new Set,i=new FinalizationRegistry(function(f){r.delete(f)}),{toArray:function(){return Array.from(r).map(function(f){return f.deref()}).filter(function(f){return f!==void 0})},add:function(f){var p=new WeakRef(f._novip);r.add(p),i.register(f._novip,p,p),r.size>f._options.maxConnections&&(p=r.values().next().value,r.delete(p),i.unregister(p))},remove:function(f){if(f)for(var p=r.values(),v=p.next();!v.done;){var g=v.value;if(g.deref()===f._novip)return r.delete(g),void i.unregister(g);v=p.next()}}}):(l=[],{toArray:function(){return l},add:function(f){l.push(f._novip)},remove:function(f){f&&(f=l.indexOf(f._novip))!==-1&&l.splice(f,1)}})})();function Ni(r,i){var l=r._dbNamesDB;return l||(l=r._dbNamesDB=new In(eo,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),l.table("dbnames")}function Vi(r){return r&&typeof r.databases=="function"}function Bi(r){return Hn(function(){return Ie.letThrough=!0,r()})}function Ui(r){return!("from"in r)}var Ft=function(r,i){var l;if(!this)return l=new Ft,r&&"d"in r&&h(l,r),l;h(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function ps(r,i,l){var f=ot(i,l);if(!isNaN(f)){if(0<f)throw RangeError();if(Ui(r))return h(r,{from:i,to:l,d:1});var f=r.l,p=r.r;if(ot(l,r.from)<0)return f?ps(f,i,l):r.l={from:i,to:l,d:1,l:null,r:null},Fl(r);if(0<ot(i,r.to))return p?ps(p,i,l):r.r={from:i,to:l,d:1,l:null,r:null},Fl(r);ot(i,r.from)<0&&(r.from=i,r.l=null,r.d=p?p.d+1:1),0<ot(l,r.to)&&(r.to=l,r.r=null,r.d=r.l?r.l.d+1:1),i=!r.r,f&&!r.l&&hs(r,f),p&&i&&hs(r,p)}}function hs(r,i){Ui(i)||function l(f,p){var v=p.from,g=p.l,w=p.r;ps(f,v,p.to),g&&l(f,g),w&&l(f,w)}(r,i)}function Kl(r,i){var l=po(i),f=l.next();if(!f.done)for(var p=f.value,v=po(r),g=v.next(p.from),w=g.value;!f.done&&!g.done;){if(ot(w.from,p.to)<=0&&0<=ot(w.to,p.from))return!0;ot(p.from,w.from)<0?p=(f=l.next(w.from)).value:w=(g=v.next(p.from)).value}return!1}function po(r){var i=Ui(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&&ot(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||ot(l,i.n.to)<=0)return{value:i.n,done:!1};case 2:if(i.n.r){i.s=3,i={up:i,n:i.n.r,s:0};continue}case 3:i=i.up}return{done:!0}}}}function Fl(r){var i,l,f,p=(((p=r.r)==null?void 0:p.d)||0)-(((p=r.l)==null?void 0:p.d)||0),p=1<p?"r":p<-1?"l":"";p&&(i=p=="r"?"l":"r",l=s({},r),f=r[p],r.from=f.from,r.to=f.to,r[p]=f[p],l[p]=f[i],(r[i]=l).d=Nl(l)),r.d=Nl(r)}function Nl(l){var i=l.r,l=l.l;return(i?l?Math.max(i.d,l.d):i.d:l?l.d:0)+1}function ho(r,i){return c(i).forEach(function(l){r[l]?hs(r[l],i[l]):r[l]=function f(p){var v,g,w={};for(v in p)_(p,v)&&(g=p[v],w[v]=!g||typeof g!="object"||be.has(g.constructor)?g:f(g));return w}(i[l])}),r}function qi(r,i){return r.all||i.all||Object.keys(r).some(function(l){return i[l]&&Kl(i[l],r[l])})}C(Ft.prototype,((Je={add:function(r){return hs(this,r),this},addKey:function(r){return ps(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(l){return ps(i,l,l)}),this},hasKey:function(r){var i=po(this).next(r).value;return i&&ot(i.from,r)<=0&&0<=ot(i.to,r)}})[He]=function(){return po(this)},Je));var br={},Hi={},Wi=!1;function vo(r){ho(Hi,r),Wi||(Wi=!0,setTimeout(function(){Wi=!1,zi(Hi,!(Hi={}))},0))}function zi(r,i){i===void 0&&(i=!1);var l=new Set;if(r.all)for(var f=0,p=Object.values(br);f<p.length;f++)Vl(w=p[f],r,l,i);else for(var v in r){var g,w,v=/^idb\:\/\/(.*)\/(.*)\//.exec(v);v&&(g=v[1],v=v[2],w=br["idb://".concat(g,"/").concat(v)])&&Vl(w,r,l,i)}l.forEach(function($){return $()})}function Vl(r,i,l,f){for(var p=[],v=0,g=Object.entries(r.queries.query);v<g.length;v++){for(var w=g[v],$=w[0],B=[],I=0,E=w[1];I<E.length;I++){var T=E[I];qi(i,T.obsSet)?T.subscribers.forEach(function(L){return l.add(L)}):f&&B.push(T)}f&&p.push([$,B])}if(f)for(var K=0,D=p;K<D.length;K++){var j=D[K],$=j[0],B=j[1];r.queries.query[$]=B}}function Jf(r){var i=r._state,l=r._deps.indexedDB;if(i.isBeingOpened||r.idbdb)return i.dbReadyPromise.then(function(){return i.dbOpenError?St(i.dbOpenError):r});i.isBeingOpened=!0,i.dbOpenError=null,i.openComplete=!1;var f=i.openCanceller,p=Math.round(10*r.verno),v=!1;function g(){if(i.openCanceller!==f)throw new ce.DatabaseClosed("db.open() was cancelled")}function w(){return new Se(function(T,K){if(g(),!l)throw new ce.MissingAPI;var D=r.name,j=i.autoSchema||!p?l.open(D):l.open(D,p);if(!j)throw new ce.MissingAPI;j.onerror=dn(K),j.onblocked=gt(r._fireOnBlocked),j.onupgradeneeded=gt(function(L){var G;I=j.transaction,i.autoSchema&&!r._options.allowEmptyDB?(j.onerror=us,I.abort(),j.result.close(),(G=l.deleteDatabase(D)).onsuccess=G.onerror=gt(function(){K(new ce.NoSuchDatabase("Database ".concat(D," doesnt exist")))})):(I.onerror=dn(K),G=L.oldVersion>Math.pow(2,62)?0:L.oldVersion,E=G<1,r.idbdb=j.result,v&&Gf(r,I),zf(r,G/10,I,K))},K),j.onsuccess=gt(function(){I=null;var L,G,U,se,pe,ve,_e=r.idbdb=j.result,ye=P(_e.objectStoreNames);if(0<ye.length)try{var Oe=_e.transaction((pe=ye).length===1?pe[0]:pe,"readonly");if(i.autoSchema)ve=_e,se=Oe,(U=r).verno=ve.version/10,se=U._dbSchema=co(0,ve,se),U._storeNames=P(ve.objectStoreNames,0),lo(U,[U._allTables],c(se),se);else if(fo(r,r._dbSchema,Oe),G=Oe,((G=Ki(co(0,(L=r).idbdb,G),L._dbSchema)).add.length||G.change.some(function(we){return we.add.length||we.change.length}))&&!v)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),_e.close(),p=_e.version+1,v=!0,T(w());ao(r,Oe)}catch{}ds.add(r),_e.onversionchange=gt(function(we){i.vcFired=!0,r.on("versionchange").fire(we)}),_e.onclose=gt(function(){r.close({disableAutoOpen:!1})}),E&&(ye=r._deps,pe=D,Vi(ve=ye.indexedDB)||pe===eo||Ni(ve,ye.IDBKeyRange).put({name:pe}).catch(k)),T()},K)}).catch(function(T){switch(T==null?void 0:T.name){case"UnknownError":if(0<i.PR1398_maxLoop)return i.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),w();break;case"VersionError":if(0<p)return p=0,w()}return Se.reject(T)})}var $,B=i.dbReadyResolve,I=null,E=!1;return Se.race([f,(typeof navigator>"u"?Se.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(T){function K(){return indexedDB.databases().finally(T)}$=setInterval(K,100),K()}).finally(function(){return clearInterval($)}):Promise.resolve()).then(w)]).then(function(){return g(),i.onReadyBeingFired=[],Se.resolve(Bi(function(){return r.on.ready.fire(r.vip)})).then(function T(){var K;if(0<i.onReadyBeingFired.length)return K=i.onReadyBeingFired.reduce(q,k),i.onReadyBeingFired=[],Se.resolve(Bi(function(){return K(r.vip)})).then(T)})}).finally(function(){i.openCanceller===f&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(T){i.dbOpenError=T;try{I&&I.abort()}catch{}return f===i.openCanceller&&r._close(),St(T)}).finally(function(){i.openComplete=!0,B()}).then(function(){var T;return E&&(T={},r.tables.forEach(function(K){K.schema.indexes.forEach(function(D){D.name&&(T["idb://".concat(r.name,"/").concat(K.name,"/").concat(D.name)]=new Ft(-1/0,[[[]]]))}),T["idb://".concat(r.name,"/").concat(K.name,"/")]=T["idb://".concat(r.name,"/").concat(K.name,"/:dels")]=new Ft(-1/0,[[[]]])}),Yn(io).fire(T),zi(T,!0)),r})}function Gi(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(w){var w=v(w),$=w.value;return w.done?$:$&&typeof $.then=="function"?$.then(l,f):d($)?Promise.all($).then(l,f):l($)}}return p(i)()}function mo(r,i,l){for(var f=d(r)?r.slice():[r],p=0;p<l;++p)f.push(i);return f}var Xf={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return s(s({},r),{table:function(f){var l=r.table(f),f=l.schema,p=Object.create(null),v=[];function g(T,K,D){var U=fs(T),j=p[U]=p[U]||[],L=T==null?0:typeof T=="string"?1:T.length,G=0<K,U=s(s({},D),{name:G?"".concat(U,"(virtual-from:").concat(D.name,")"):D.name,lowLevelIndex:D,isVirtual:G,keyTail:K,keyLength:L,extractKey:Li(T),unique:!G&&D.unique});return j.push(U),U.isPrimaryKey||v.push(U),1<L&&g(L===2?T[0]:T.slice(0,L-1),K+1,D),j.sort(function(se,pe){return se.keyTail-pe.keyTail}),U}var w=g(f.primaryKey.keyPath,0,f.primaryKey);p[":id"]=[w];for(var $=0,B=f.indexes;$<B.length;$++){var I=B[$];g(I.keyPath,0,I)}function E(T){var K,D=T.query.index;return D.isVirtual?s(s({},T),{query:{index:D.lowLevelIndex,range:(K=T.query.range,D=D.keyTail,{type:K.type===1?2:K.type,lower:mo(K.lower,K.lowerOpen?r.MAX_KEY:r.MIN_KEY,D),lowerOpen:!0,upper:mo(K.upper,K.upperOpen?r.MIN_KEY:r.MAX_KEY,D),upperOpen:!0})}}):T}return s(s({},l),{schema:s(s({},f),{primaryKey:w,indexes:v,getIndexByKeyPath:function(T){return(T=p[fs(T)])&&T[0]}}),count:function(T){return l.count(E(T))},query:function(T){return l.query(E(T))},openCursor:function(T){var K=T.query.index,D=K.keyTail,j=K.keyLength;return K.isVirtual?l.openCursor(E(T)).then(function(G){return G&&L(G)}):l.openCursor(T);function L(G){return Object.create(G,{continue:{value:function(U){U!=null?G.continue(mo(U,T.reverse?r.MAX_KEY:r.MIN_KEY,D)):T.unique?G.continue(G.key.slice(0,j).concat(T.reverse?r.MIN_KEY:r.MAX_KEY,D)):G.continue()}},continuePrimaryKey:{value:function(U,se){G.continuePrimaryKey(mo(U,r.MAX_KEY,D),se)}},primaryKey:{get:function(){return G.primaryKey}},key:{get:function(){var U=G.key;return j===1?U[0]:U.slice(0,j)}},value:{get:function(){return G.value}}})}}})}})}};function Yi(r,i,l,f){return l=l||{},f=f||"",c(r).forEach(function(p){var v,g,w;_(i,p)?(v=r[p],g=i[p],typeof v=="object"&&typeof g=="object"&&v&&g?(w=rt(v))!==rt(g)?l[f+p]=i[p]:w==="Object"?Yi(v,g,l,f+p+"."):v!==g&&(l[f+p]=i[p]):v!==g&&(l[f+p]=i[p])):l[f+p]=void 0}),c(i).forEach(function(p){_(r,p)||(l[f+p]=i[p])}),l}function Ji(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var Qf={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return s(s({},r),{table:function(i){var l=r.table(i),f=l.schema.primaryKey;return s(s({},l),{mutate:function(p){var v=Ie.trans,g=v.table(i).hook,w=g.deleting,$=g.creating,B=g.updating;switch(p.type){case"add":if($.fire===k)break;return v._promise("readwrite",function(){return I(p)},!0);case"put":if($.fire===k&&B.fire===k)break;return v._promise("readwrite",function(){return I(p)},!0);case"delete":if(w.fire===k)break;return v._promise("readwrite",function(){return I(p)},!0);case"deleteRange":if(w.fire===k)break;return v._promise("readwrite",function(){return function E(T,K,D){return l.query({trans:T,values:!1,query:{index:f,range:K},limit:D}).then(function(j){var L=j.result;return I({type:"delete",keys:L,trans:T}).then(function(G){return 0<G.numFailures?Promise.reject(G.failures[0]):L.length<D?{failures:[],numFailures:0,lastResult:void 0}:E(T,s(s({},K),{lower:L[L.length-1],lowerOpen:!0}),D)})})}(p.trans,p.range,1e4)},!0)}return l.mutate(p);function I(E){var T,K,D,j=Ie.trans,L=E.keys||Ji(f,E);if(L)return(E=E.type==="add"||E.type==="put"?s(s({},E),{keys:L}):s({},E)).type!=="delete"&&(E.values=o([],E.values)),E.keys&&(E.keys=o([],E.keys)),T=l,D=L,((K=E).type==="add"?Promise.resolve([]):T.getMany({trans:K.trans,keys:D,cache:"immutable"})).then(function(G){var U=L.map(function(se,pe){var ve,_e,ye,Oe=G[pe],we={onerror:null,onsuccess:null};return E.type==="delete"?w.fire.call(we,se,Oe,j):E.type==="add"||Oe===void 0?(ve=$.fire.call(we,se,E.values[pe],j),se==null&&ve!=null&&(E.keys[pe]=se=ve,f.outbound||ee(E.values[pe],f.keyPath,se))):(ve=Yi(Oe,E.values[pe]),(_e=B.fire.call(we,ve,se,Oe,j))&&(ye=E.values[pe],Object.keys(_e).forEach(function(Me){_(ye,Me)?ye[Me]=_e[Me]:ee(ye,Me,_e[Me])}))),we});return l.mutate(E).then(function(se){for(var pe=se.failures,ve=se.results,_e=se.numFailures,se=se.lastResult,ye=0;ye<L.length;++ye){var Oe=(ve||L)[ye],we=U[ye];Oe==null?we.onerror&&we.onerror(pe[ye]):we.onsuccess&&we.onsuccess(E.type==="put"&&G[ye]?E.values[ye]:Oe)}return{failures:pe,results:ve,numFailures:_e,lastResult:se}}).catch(function(se){return U.forEach(function(pe){return pe.onerror&&pe.onerror(se)}),Promise.reject(se)})});throw new Error("Keys missing")}}})}})}};function Bl(r,i,l){try{if(!i||i.keys.length<r.length)return null;for(var f=[],p=0,v=0;p<i.keys.length&&v<r.length;++p)ot(i.keys[p],r[v])===0&&(f.push(l?xe(i.values[p]):i.values[p]),++v);return f.length===r.length?f:null}catch{return null}}var Zf={stack:"dbcore",level:-1,create:function(r){return{table:function(i){var l=r.table(i);return s(s({},l),{getMany:function(f){var p;return f.cache?(p=Bl(f.keys,f.trans._cache,f.cache==="clone"))?Se.resolve(p):l.getMany(f).then(function(v){return f.trans._cache={keys:f.keys,values:f.cache==="clone"?xe(v):v},v}):l.getMany(f)},mutate:function(f){return f.type!=="add"&&(f.trans._cache=null),l.mutate(f)}})}}}};function Ul(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function ql(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var ed={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,l=new Ft(r.MIN_KEY,r.MAX_KEY);return s(s({},r),{transaction:function(f,p,v){if(Ie.subscr&&p!=="readonly")throw new ce.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ie.querier));return r.transaction(f,p,v)},table:function(f){function p(L){var j,L=L.query;return[j=L.index,new Ft((j=(L=L.range).lower)!=null?j:r.MIN_KEY,(j=L.upper)!=null?j:r.MAX_KEY)]}var v=r.table(f),g=v.schema,w=g.primaryKey,$=g.indexes,B=w.extractKey,I=w.outbound,E=w.autoIncrement&&$.filter(function(D){return D.compound&&D.keyPath.includes(w.keyPath)}),T=s(s({},v),{mutate:function(D){function j(he){return he="idb://".concat(i,"/").concat(f,"/").concat(he),pe[he]||(pe[he]=new Ft)}var L,G,U,se=D.trans,pe=D.mutatedParts||(D.mutatedParts={}),ve=j(""),_e=j(":dels"),ye=D.type,we=D.type==="deleteRange"?[D.range]:D.type==="delete"?[D.keys]:D.values.length<50?[Ji(w,D).filter(function(he){return he}),D.values]:[],Oe=we[0],we=we[1],Me=D.trans._cache;return d(Oe)?(ve.addKeys(Oe),(ye=ye==="delete"||Oe.length===we.length?Bl(Oe,Me):null)||_e.addKeys(Oe),(ye||we)&&(L=j,G=ye,U=we,g.indexes.forEach(function(he){var Be=L(he.name||"");function Ue(nt){return nt!=null?he.extractKey(nt):null}function Ge(nt){he.multiEntry&&d(nt)?nt.forEach(function(nn){return Be.addKey(nn)}):Be.addKey(nt)}(G||U).forEach(function(nt,Nt){var We=G&&Ue(G[Nt]),Nt=U&&Ue(U[Nt]);ot(We,Nt)!==0&&(We!=null&&Ge(We),Nt!=null)&&Ge(Nt)})}))):Oe?(we={from:(Me=Oe.lower)!=null?Me:r.MIN_KEY,to:(ye=Oe.upper)!=null?ye:r.MAX_KEY},_e.add(we),ve.add(we)):(ve.add(l),_e.add(l),g.indexes.forEach(function(he){return j(he.name).add(l)})),v.mutate(D).then(function(he){return!Oe||D.type!=="add"&&D.type!=="put"||(ve.addKeys(he.results),E&&E.forEach(function(Be){for(var Ue=D.values.map(function(We){return Be.extractKey(We)}),Ge=Be.keyPath.findIndex(function(We){return We===w.keyPath}),nt=0,nn=he.results.length;nt<nn;++nt)Ue[nt][Ge]=he.results[nt];j(Be.name).addKeys(Ue)})),se.mutatedParts=ho(se.mutatedParts||{},pe),he})}}),K={get:function(D){return[w,new Ft(D.key)]},getMany:function(D){return[w,new Ft().addKeys(D.keys)]},count:p,query:p,openCursor:p};return c(K).forEach(function(D){T[D]=function(j){var L=Ie.subscr,G=!!L,U=Ul(Ie,v)&&ql(D,j)?j.obsSet={}:L;if(G){var se,L=function(we){return we="idb://".concat(i,"/").concat(f,"/").concat(we),U[we]||(U[we]=new Ft)},pe=L(""),ve=L(":dels"),G=K[D](j),_e=G[0],G=G[1];if((D==="query"&&_e.isPrimaryKey&&!j.values?ve:L(_e.name||"")).add(G),!_e.isPrimaryKey){if(D!=="count")return se=D==="query"&&I&&j.values&&v.query(s(s({},j),{values:!1})),v[D].apply(this,arguments).then(function(we){if(D==="query"){if(I&&j.values)return se.then(function(Ue){return Ue=Ue.result,pe.addKeys(Ue),we});var Me=j.values?we.result.map(B):we.result;(j.values?pe:ve).addKeys(Me)}else{var he,Be;if(D==="openCursor")return Be=j.values,(he=we)&&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 we});ve.add(l)}}return v[D].apply(this,arguments)}}),T}})}};function Hl(r,i,l){var f;return l.numFailures===0?i:i.type==="deleteRange"||(f=i.keys?i.keys.length:"values"in i&&i.values?i.values.length:1,l.numFailures===f)?null:(f=s({},i),d(f.keys)&&(f.keys=f.keys.filter(function(p,v){return!(v in l.failures)})),"values"in f&&d(f.values)&&(f.values=f.values.filter(function(p,v){return!(v in l.failures)})),f)}function Xi(r,i){return l=r,((f=i).lower===void 0||(f.lowerOpen?0<ot(l,f.lower):0<=ot(l,f.lower)))&&(l=r,(f=i).upper===void 0||(f.upperOpen?ot(l,f.upper)<0:ot(l,f.upper)<=0));var l,f}function Wl(r,i,l,f,p,v){var g,w,$,B,I,E,T;return!l||l.length===0||(g=i.query.index,w=g.multiEntry,$=i.query.range,B=f.schema.primaryKey.extractKey,I=g.extractKey,E=(g.lowLevelIndex||g).extractKey,(f=l.reduce(function(K,D){var j=K,L=[];if(D.type==="add"||D.type==="put")for(var G=new Ft,U=D.values.length-1;0<=U;--U){var se,pe=D.values[U],ve=B(pe);!G.hasKey(ve)&&(se=I(pe),w&&d(se)?se.some(function(Me){return Xi(Me,$)}):Xi(se,$))&&(G.addKey(ve),L.push(pe))}switch(D.type){case"add":var _e=new Ft().addKeys(i.values?K.map(function(he){return B(he)}):K),j=K.concat(i.values?L.filter(function(he){return he=B(he),!_e.hasKey(he)&&(_e.addKey(he),!0)}):L.map(function(he){return B(he)}).filter(function(he){return!_e.hasKey(he)&&(_e.addKey(he),!0)}));break;case"put":var ye=new Ft().addKeys(D.values.map(function(he){return B(he)}));j=K.filter(function(he){return!ye.hasKey(i.values?B(he):he)}).concat(i.values?L:L.map(function(he){return B(he)}));break;case"delete":var Oe=new Ft().addKeys(D.keys);j=K.filter(function(he){return!Oe.hasKey(i.values?B(he):he)});break;case"deleteRange":var we=D.range;j=K.filter(function(he){return!Xi(B(he),we)})}return j},r))===r)?r:(T=function(K,D){return ot(E(K),E(D))||ot(B(K),B(D))},f.sort(i.direction==="prev"||i.direction==="prevunique"?function(K,D){return T(D,K)}:T),i.limit&&i.limit<1/0&&(f.length>i.limit?f.length=i.limit:r.length===i.limit&&f.length<i.limit&&(p.dirty=!0)),v?Object.freeze(f):f)}function zl(r,i){return ot(r.lower,i.lower)===0&&ot(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function td(r,i){return((l,f,p,v)=>{if(l===void 0)return f!==void 0?-1:0;if(f===void 0)return 1;if((l=ot(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=ot(l,f))===0){if(p&&v)return 0;if(p)return-1;if(v)return 1}return l})(r.upper,i.upper,r.upperOpen,i.upperOpen)}function nd(r,i,l,f){r.subscribers.add(l),f.addEventListener("abort",function(){var p,v;r.subscribers.delete(l),r.subscribers.size===0&&(p=r,v=i,setTimeout(function(){p.subscribers.size===0&&Ke(v,p)},3e3))})}var rd={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return s(s({},r),{transaction:function(l,f,p){var v,g,w=r.transaction(l,f,p);return f==="readwrite"&&(p=(v=new AbortController).signal,w.addEventListener("abort",(g=function($){return function(){if(v.abort(),f==="readwrite"){for(var B=new Set,I=0,E=l;I<E.length;I++){var T=E[I],K=br["idb://".concat(i,"/").concat(T)];if(K){var D=r.table(T),j=K.optimisticOps.filter(function(he){return he.trans===w});if(w._explicit&&$&&w.mutatedParts)for(var L=0,G=Object.values(K.queries.query);L<G.length;L++)for(var U=0,se=(_e=G[L]).slice();U<se.length;U++)qi((ye=se[U]).obsSet,w.mutatedParts)&&(Ke(_e,ye),ye.subscribers.forEach(function(he){return B.add(he)}));else if(0<j.length){K.optimisticOps=K.optimisticOps.filter(function(he){return he.trans!==w});for(var pe=0,ve=Object.values(K.queries.query);pe<ve.length;pe++)for(var _e,ye,Oe,we=0,Me=(_e=ve[pe]).slice();we<Me.length;we++)(ye=Me[we]).res!=null&&w.mutatedParts&&($&&!ye.dirty?(Oe=Object.isFrozen(ye.res),Oe=Wl(ye.res,ye.req,j,D,ye,Oe),ye.dirty?(Ke(_e,ye),ye.subscribers.forEach(function(he){return B.add(he)})):Oe!==ye.res&&(ye.res=Oe,ye.promise=Se.resolve({result:Oe}))):(ye.dirty&&Ke(_e,ye),ye.subscribers.forEach(function(he){return B.add(he)})))}}}B.forEach(function(he){return he()})}}})(!1),{signal:p}),w.addEventListener("error",g(!1),{signal:p}),w.addEventListener("complete",g(!0),{signal:p})),w},table:function(l){var f=r.table(l),p=f.schema.primaryKey;return s(s({},f),{mutate:function(v){var g,w=Ie.trans;return!p.outbound&&w.db._options.cache!=="disabled"&&!w.explicit&&w.idbtrans.mode==="readwrite"&&(g=br["idb://".concat(i,"/").concat(l)])?(w=f.mutate(v),v.type!=="add"&&v.type!=="put"||!(50<=v.values.length||Ji(p,v).some(function($){return $==null}))?(g.optimisticOps.push(v),v.mutatedParts&&vo(v.mutatedParts),w.then(function($){0<$.numFailures&&(Ke(g.optimisticOps,v),($=Hl(0,v,$))&&g.optimisticOps.push($),v.mutatedParts)&&vo(v.mutatedParts)}),w.catch(function(){Ke(g.optimisticOps,v),v.mutatedParts&&vo(v.mutatedParts)})):w.then(function($){var B=Hl(0,s(s({},v),{values:v.values.map(function(I,E){var T;return $.failures[E]?I:(ee(T=(T=p.keyPath)!=null&&T.includes(".")?xe(I):s({},I),p.keyPath,$.results[E]),T)})}),$);g.optimisticOps.push(B),queueMicrotask(function(){return v.mutatedParts&&vo(v.mutatedParts)})}),w):f.mutate(v)},query:function(v){var g,w,$,B,I,E,T;return Ul(Ie,f)&&ql("query",v)?(g=(($=Ie.trans)==null?void 0:$.db._options.cache)==="immutable",w=($=Ie).requery,$=$.signal,E=((K,D,j,L)=>{var G=br["idb://".concat(K,"/").concat(D)];if(!G)return[];if(!(K=G.queries[j]))return[null,!1,G,null];var U=K[(L.query?L.query.index.name:null)||""];if(!U)return[null,!1,G,null];switch(j){case"query":var se=(pe=L.direction)!=null?pe:"next",pe=U.find(function(ve){var _e;return ve.req.limit===L.limit&&ve.req.values===L.values&&((_e=ve.req.direction)!=null?_e:"next")===se&&zl(ve.req.query.range,L.query.range)});return pe?[pe,!0,G,U]:[U.find(function(ve){var _e;return("limit"in ve.req?ve.req.limit:1/0)>=L.limit&&((_e=ve.req.direction)!=null?_e:"next")===se&&(!L.values||ve.req.values)&&td(ve.req.query.range,L.query.range)}),!1,G,U];case"count":return pe=U.find(function(ve){return zl(ve.req.query.range,L.query.range)}),[pe,!!pe,G,U]}})(i,l,"query",v),T=E[0],B=E[2],I=E[3],T&&E[1]?T.obsSet=v.obsSet:(E=f.query(v).then(function(K){var D=K.result;if(T&&(T.res=D),g){for(var j=0,L=D.length;j<L;++j)Object.freeze(D[j]);Object.freeze(D)}return K}).catch(function(K){return I&&T&&Ke(I,T),Promise.reject(K)}),T={obsSet:v.obsSet,promise:E,subscribers:new Set,type:"query",req:v,dirty:!1},I?I.push(T):(I=[T],(B=B||(br["idb://".concat(i,"/").concat(l)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[v.query.index.name||""]=I)),nd(T,I,w,$),T.promise.then(function(K){return K=Wl(K.result,v,B==null?void 0:B.optimisticOps,f,T,g),{result:g?K:xe(K)}})):f.query(v)}})}})}};function yo(r,i){return new Proxy(r,{get:function(l,f,p){return f==="db"?i:Reflect.get(l,f,p)}})}Et.prototype.version=function(r){if(isNaN(r)||r<.1)throw new ce.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new ce.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var i=this._versions,l=i.filter(function(f){return f._cfg.version===r})[0];return l||(l=new this.Version(r),i.push(l),i.sort(Wf),l.stores({}),this._state.autoSchema=!1),l},Et.prototype._whenReady=function(r){var i=this;return this.idbdb&&(this._state.openComplete||Ie.letThrough||this._vip)?r():new Se(function(l,f){if(i._state.openComplete)return f(new ce.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void f(new ce.DatabaseClosed);i.open().catch(k)}i._state.dbReadyPromise.then(l,f)}).then(r)},Et.prototype.use=function(p){var i=p.stack,l=p.create,f=p.level,p=p.name,v=(p&&this.unuse({stack:i,name:p}),this._middlewares[i]||(this._middlewares[i]=[]));return v.push({stack:i,create:l,level:f??10,name:p}),v.sort(function(g,w){return g.level-w.level}),this},Et.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},Et.prototype.open=function(){var r=this;return mr(Tt,function(){return Jf(r)})},Et.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var r=this._state;if(ds.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new Se(function(i){r.dbReadyResolve=i}),r.openCanceller=new Se(function(i,l){r.cancelOpen=l}))},Et.prototype.close=function(i){var i=(i===void 0?{disableAutoOpen:!0}:i).disableAutoOpen,l=this._state;i?(l.isBeingOpened&&l.cancelOpen(new ce.DatabaseClosed),this._close(),l.autoOpen=!1,l.dbOpenError=new ce.DatabaseClosed):(this._close(),l.autoOpen=this._options.autoOpen||l.isBeingOpened,l.openComplete=!1,l.dbOpenError=null)},Et.prototype.delete=function(r){var i=this,l=(r===void 0&&(r={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),f=this._state;return new Se(function(p,v){function g(){i.close(r);var w=i._deps.indexedDB.deleteDatabase(i.name);w.onsuccess=gt(function(){var $,B,I;$=i._deps,B=i.name,Vi(I=$.indexedDB)||B===eo||Ni(I,$.IDBKeyRange).delete(B).catch(k),p()}),w.onerror=dn(v),w.onblocked=i._fireOnBlocked}if(l)throw new ce.InvalidArgument("Invalid closeOptions argument to db.delete()");f.isBeingOpened?f.dbReadyPromise.then(g):g()})},Et.prototype.backendDB=function(){return this.idbdb},Et.prototype.isOpen=function(){return this.idbdb!==null},Et.prototype.hasBeenClosed=function(){var r=this._state.dbOpenError;return r&&r.name==="DatabaseClosed"},Et.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Et.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Et.prototype,"tables",{get:function(){var r=this;return c(this._allTables).map(function(i){return r._allTables[i]})},enumerable:!1,configurable:!0}),Et.prototype.transaction=function(){var r=(function(i,l,f){var p=arguments.length;if(p<2)throw new ce.InvalidArgument("Too few arguments");for(var v=new Array(p-1);--p;)v[p-1]=arguments[p];return f=v.pop(),[i,oe(v),f]}).apply(this,arguments);return this._transaction.apply(this,r)},Et.prototype._transaction=function(r,i,l){var f,p,v=this,g=Ie.trans,w=(g&&g.db===this&&r.indexOf("!")===-1||(g=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===Ai)f=Ai;else{if(r!="rw"&&r!=Pi)throw new ce.InvalidArgument("Invalid transaction mode: "+r);f=Pi}if(g){if(g.mode===Ai&&f===Pi){if(!w)throw new ce.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");g=null}g&&p.forEach(function(B){if(g&&g.storeNames.indexOf(B)===-1){if(!w)throw new ce.SubTransaction("Table "+B+" not included in parent transaction.");g=null}}),w&&g&&!g.active&&(g=null)}}catch(B){return g?g._promise(null,function(I,E){E(B)}):St(B)}var $=(function B(I,E,T,K,D){return Se.resolve().then(function(){var U=Ie.transless||Ie,j=I._createTransaction(E,T,I._dbSchema,K),U=(j.explicit=!0,{trans:j,transless:U});if(K)j.idbtrans=K.idbtrans;else try{j.create(),j.idbtrans._explicit=!0,I._state.PR1398_maxLoop=3}catch(se){return se.name===It.InvalidState&&I.isOpen()&&0<--I._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),I.close({disableAutoOpen:!1}),I.open().then(function(){return B(I,E,T,null,D)})):St(se)}var L,G=Qe(D),U=(G&&Fr(),Se.follow(function(){var se;(L=D.call(j,j))&&(G?(se=Wn.bind(null,null),L.then(se,se)):typeof L.next=="function"&&typeof L.throw=="function"&&(L=Gi(L)))},U));return(L&&typeof L.then=="function"?Se.resolve(L).then(function(se){return j.active?se:St(new ce.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):U.then(function(){return L})).then(function(se){return K&&j._resolve(),j._completion.then(function(){return se})}).catch(function(se){return j._reject(se),St(se)})})}).bind(null,this,f,p,g,l);return g?g._promise(f,$,"lock"):Ie.trans?mr(Ie.transless,function(){return v._whenReady($)}):this._whenReady($)},Et.prototype.table=function(r){if(_(this._allTables,r))return this._allTables[r];throw new ce.InvalidTable("Table ".concat(r," does not exist"))};var In=Et;function Et(r,i){var l,f,p,v,g,w=this,$=(this._middlewares={},this.verno=0,Et.dependencies),$=(this._options=i=s({addons:Et.addons,autoOpen:!0,indexedDB:$.indexedDB,IDBKeyRange:$.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:k,dbReadyPromise:null,cancelOpen:k,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:i.autoOpen}),I=(B.dbReadyPromise=new Se(function(E){B.dbReadyResolve=E}),B.openCanceller=new Se(function(E,T){B.cancelOpen=T}),this._state=B,this.name=r,this.on=as(this,"populate","blocked","versionchange","close",{ready:[q,k]}),this.once=function(E,T){var K=function(){for(var D=[],j=0;j<arguments.length;j++)D[j]=arguments[j];w.on(E).unsubscribe(K),T.apply(w,D)};return w.on(E,K)},this.on.ready.subscribe=R(this.on.ready.subscribe,function(E){return function(T,K){Et.vip(function(){var D,j=w._state;j.openComplete?(j.dbOpenError||Se.resolve().then(T),K&&E(T)):j.onReadyBeingFired?(j.onReadyBeingFired.push(T),K&&E(T)):(E(T),D=w,K||E(function L(){D.on.ready.unsubscribe(T),D.on.ready.unsubscribe(L)}))})}}),this.Collection=(l=this,ls(Ff.prototype,function(L,j){this.db=l;var K=kl,D=null;if(j)try{K=j()}catch(U){D=U}var j=L._ctx,L=j.table,G=L.hook.reading.fire;this._ctx={table:L,index:j.index,isPrimKey:!j.index||L.schema.primKey.keyPath&&j.index===L.schema.primKey.name,range:K,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:D,or:j.or,valueMapper:G!==b?G:null}})),this.Table=(f=this,ls(Tl.prototype,function(E,T,K){this.db=f,this._tx=K,this.name=E,this.schema=T,this.hook=f._allTables[E]?f._allTables[E].hook:as(null,{creating:[le,k],reading:[W,b],updating:[me,k],deleting:[ge,k]})})),this.Transaction=(p=this,ls(Bf.prototype,function(E,T,K,D,j){var L=this;E!=="readonly"&&T.forEach(function(G){G=(G=K[G])==null?void 0:G.yProps,G&&(T=T.concat(G.map(function(U){return U.updatesTable})))}),this.db=p,this.mode=E,this.storeNames=T,this.schema=K,this.chromeTransactionDurability=D,this.idbtrans=null,this.on=as(this,"complete","error","abort"),this.parent=j||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Se(function(G,U){L._resolve=G,L._reject=U}),this._completion.then(function(){L.active=!1,L.on.complete.fire()},function(G){var U=L.active;return L.active=!1,L.on.error.fire(G),L.parent?L.parent._reject(G):U&&L.idbtrans&&L.idbtrans.abort(),St(G)})})),this.Version=(v=this,ls(Yf.prototype,function(E){this.db=v,this._cfg={version:E,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(g=this,ls(Il.prototype,function(E,T,K){if(this.db=g,this._ctx={table:E,index:T===":id"?null:T,or:K},this._cmp=this._ascending=ot,this._descending=function(D,j){return ot(j,D)},this._max=function(D,j){return 0<ot(D,j)?D:j},this._min=function(D,j){return ot(D,j)<0?D:j},this._IDBKeyRange=g._deps.IDBKeyRange,!this._IDBKeyRange)throw new ce.MissingAPI})),this.on("versionchange",function(E){0<E.newVersion?console.warn("Another connection wants to upgrade database '".concat(w.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(w.name,"'. Closing db now to resume the delete request.")),w.close({disableAutoOpen:!1})}),this.on("blocked",function(E){!E.newVersion||E.newVersion<E.oldVersion?console.warn("Dexie.delete('".concat(w.name,"') was blocked")):console.warn("Upgrade '".concat(w.name,"' blocked by other connection holding version ").concat(E.oldVersion/10))}),this._maxKey=cs(i.IDBKeyRange),this._createTransaction=function(E,T,K,D){return new w.Transaction(E,T,K,w._options.chromeTransactionDurability,D)},this._fireOnBlocked=function(E){w.on("blocked").fire(E),ds.toArray().filter(function(T){return T.name===w.name&&T!==w&&!T._state.vcFired}).map(function(T){return T.on("versionchange").fire(E)})},this.use(Zf),this.use(rd),this.use(ed),this.use(Xf),this.use(Qf),new Proxy(this,{get:function(E,T,K){var D;return T==="_vip"||(T==="table"?function(j){return yo(w.table(j),I)}:(D=Reflect.get(E,T,K))instanceof Tl?yo(D,I):T==="tables"?D.map(function(j){return yo(j,I)}):T==="_createTransaction"?function(){return yo(D.apply(this,arguments),I)}:D)}}));this.vip=I,$.forEach(function(E){return E(w)})}var go,Ur=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",sd=(Qi.prototype.subscribe=function(r,i,l){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:l})},Qi.prototype[Ur]=function(){return this},Qi);function Qi(r){this._subscribe=r}try{go={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{go={indexedDB:null,IDBKeyRange:null}}function Gl(r){var i,l=!1,f=new sd(function(p){var v=Qe(r),g,w=!1,$={},B={},I={get closed(){return w},unsubscribe:function(){w||(w=!0,g&&g.abort(),E&&Yn.storagemutated.unsubscribe(D))}},E=(p.start&&p.start(I),!1),T=function(){return Ti(j)};function K(){return qi(B,$)}var D=function(L){ho($,L),K()&&T()},j=function(){var L,G,U;!w&&go.indexedDB&&($={},L={},g&&g.abort(),g=new AbortController,U=(se=>{var pe=Rr();try{v&&Fr();var ve=Hn(r,se);return ve=v?ve.finally(Wn):ve}finally{pe&&Kr()}})(G={subscr:L,signal:g.signal,requery:T,querier:r,trans:null}),E||(Yn.storagemutated.subscribe(D),E=!0),Promise.resolve(U).then(function(se){l=!0,i=se,w||G.signal.aborted||(K()||(B=L,K())?T():($={},Ti(function(){return!w&&p.next&&p.next(se)})))},function(se){l=!1,["DatabaseClosedError","AbortError"].includes(se==null?void 0:se.name)||w||Ti(function(){w||p.error&&p.error(se)})}))};return setTimeout(T,0),I});return f.hasValue=function(){return l},f.getValue=function(){return i},f}var wr=In;function Zi(r){var i=Jn;try{Jn=!0,Yn.storagemutated.fire(r),zi(r,!0)}finally{Jn=i}}C(wr,s(s({},Ce),{delete:function(r){return new wr(r,{addons:[]}).delete()},exists:function(r){return new wr(r,{addons:[]}).open().then(function(i){return i.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return i=wr.dependencies,l=i.indexedDB,i=i.IDBKeyRange,(Vi(l)?Promise.resolve(l.databases()).then(function(f){return f.map(function(p){return p.name}).filter(function(p){return p!==eo})}):Ni(l,i).toCollection().primaryKeys()).then(r)}catch{return St(new ce.MissingAPI)}var i,l},defineClass:function(){return function(r){h(this,r)}},ignoreTransaction:function(r){return Ie.trans?mr(Ie.transless||Tt,r):r()},vip:Bi,async:function(r){return function(){try{var i=Gi(r.apply(this,arguments));return i&&typeof i.then=="function"?i:Se.resolve(i)}catch(l){return St(l)}}},spawn:function(r,i,l){try{var f=Gi(r.apply(l,i||[]));return f&&typeof f.then=="function"?f:Se.resolve(f)}catch(p){return St(p)}},currentTransaction:{get:function(){return Ie.trans||null}},waitFor:function(r,i){return r=Se.resolve(typeof r=="function"?wr.ignoreTransaction(r):r).timeout(i||6e4),Ie.trans?Ie.trans.waitFor(r):r},Promise:Se,debug:{get:function(){return H},set:function(r){Y(r)}},derive:Z,extend:h,props:C,override:R,Events:as,on:Yn,liveQuery:Gl,extendObservabilitySet:ho,getByKeyPath:ie,setByKeyPath:ee,delByKeyPath:function(r,i){typeof i=="string"?ee(r,i,void 0):"length"in i&&[].map.call(i,function(l){ee(r,l,void 0)})},shallowClone:M,deepClone:xe,getObjectDiff:Yi,cmp:ot,asap:fe,minKey:-1/0,addons:[],connections:{get:ds.toArray},errnames:It,dependencies:go,cache:br,semVer:"4.4.6",version:"4.4.6".split(".").map(function(r){return parseInt(r)}).reduce(function(r,i,l){return r+i/Math.pow(10,2*l)})})),wr.maxKey=cs(wr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Yn(io,function(r){Jn||(r=new CustomEvent(Ii,{detail:r}),Jn=!0,dispatchEvent(r),Jn=!1)}),addEventListener(Ii,function(r){r=r.detail,Jn||Zi(r)}));var qr,Jn=!1,Yl=function(){};return typeof BroadcastChannel<"u"&&((Yl=function(){(qr=new BroadcastChannel(Ii)).onmessage=function(r){return r.data&&Zi(r.data)}})(),typeof qr.unref=="function"&&qr.unref(),Yn(io,function(r){Jn||qr.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!In.disableBfCache&&r.persisted){H&&console.debug("Dexie: handling persisted pagehide"),qr!=null&&qr.close();for(var i=0,l=ds.toArray();i<l.length;i++)l[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!In.disableBfCache&&r.persisted&&(H&&console.debug("Dexie: handling persisted pageshow"),Yl(),Zi({all:new Ft(-1/0,[[]])}))})),Se.rejectionMapper=function(r,i){return!r||r instanceof Q||r instanceof TypeError||r instanceof SyntaxError||!r.name||!x[r.name]?r:(i=new x[r.name](i||r.message,r),"stack"in r&&V(i,"stack",{get:function(){return this.inner.stack}}),i)},Y(H),s(In,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:In,Entity:xl,PropModification:is,RangeSet:Ft,add:function(r){return new is({add:r})},cmp:ot,default:In,liveQuery:Gl,mergeRanges:hs,rangesOverlap:Kl,remove:function(r){return new is({remove:r})},replacePrefix:function(r,i){return new is({replacePrefix:[r,i]})}}),{default:In}),In})})(lf);var Qh=lf.exports;const Ma=Xh(Qh),Ru=Symbol.for("Dexie"),Yo=globalThis[Ru]||(globalThis[Ru]=Ma);if(Ma.semVer!==Yo.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Ma.semVer} and ${Yo.semVer}`);const{liveQuery:Zh,mergeRanges:yk,rangesOverlap:gk,RangeSet:bk,cmp:wk,Entity:_k,PropModification:kk,replacePrefix:xk,add:Ck,remove:Sk,DexieYProvider:Ek}=Yo;class ev extends Yo{constructor(t="intern_worklog"){super(t),this.version(1).stores({project:"++id, &name, archived",work_log:"++id, &date",log_item:"++id, work_log_id, project_id, category",attendance:"++id, &date",weekly_note:"++id, &week_start",setting:"key"}),this.version(2).stores({memo:"++id, updated_at",credential:"++id, system, updated_at"}),this.version(3).stores({transaction:"++id, date, type, category"}),this.version(4).stores({sync_mirror:"++id, table, uuid",tombstone:"++id, table, uuid, deleted_at"})}}let de;function tv(e){de=e}function ll(){de&&de.close(),de=void 0}const nv=4,zr=["餐饮","交通","住房","通讯","学习","娱乐","其他"],Jo=["工资","报销","其他"],Ku=["公司","客户现场","出差","居家办公"],Hs=[{key:"dev",label:"开发"},{key:"bugfix",label:"BUG修复"},{key:"test",label:"测试"},{key:"learning",label:"学习成长"},{key:"meeting",label:"会议沟通"},{key:"doc",label:"文档输出"},{key:"other",label:"其他"}];function Xo(e){const t=Hs.find(n=>n.key===e);return t?t.label:"其他"}const rv={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},sv={class:"dialog-head"},ov={key:0,class:"muted dialog-sub"},iv={class:"dialog-body"},av={class:"form-grid"},lv={class:"field span2"},uv={key:0,class:"form-error"},cv={class:"field"},fv=["value"],dv={class:"field"},pv=["value"],hv={class:"field"},vv={class:"field"},mv={class:"field span2"},yv={class:"field"},gv={class:"field"},bv={class:"dialog-btns"},wv=Ht({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=N(""),a=N(null),c=N("dev"),d=N(null),h=N(""),y=N(""),m=N(0),_=N(0),C=N(""),A=N(null),V=ut(()=>{var R;const ue=n.projects.filter(X=>X.archived!==1),P=(R=n.item)==null?void 0:R.project_id;if(P&&!ue.some(X=>X.id===P)){const X=n.projects.find(ie=>ie.id===P),fe=ue.slice();return X&&fe.unshift({...X,name:X.name+"(已归档)"}),fe}return ue});function Z(ue){n.open&&ue.key==="Escape"&&s("cancel")}mt(()=>n.open,async ue=>{var P;if(ue){const R=n.item;o.value=(R==null?void 0:R.content)??"",a.value=(R==null?void 0:R.project_id)??null,c.value=(R==null?void 0:R.category)??"dev",d.value=(R==null?void 0:R.minutes)??null,h.value=(R==null?void 0:R.takeaway)??"",y.value=(R==null?void 0:R.remark)??"",m.value=(R==null?void 0:R.is_milestone)??0,_.value=(R==null?void 0:R.needs_followup)??0,C.value="",window.addEventListener("keydown",Z),await rs(),(P=A.value)==null||P.focus()}else window.removeEventListener("keydown",Z)}),dr(()=>window.removeEventListener("keydown",Z)),mt(o,()=>{C.value&&(C.value="")});function te(){const ue=o.value.trim();if(!ue){C.value="请填写工作内容";return}if(!n.item||!n.item.id){s("cancel");return}s("save",{id:n.item.id,content:ue,project_id:a.value,category:c.value,minutes:d.value&&d.value>0?d.value:null,takeaway:h.value.trim()||null,remark:y.value.trim()||null,is_milestone:m.value?1:0,needs_followup:_.value?1:0})}return(ue,P)=>(O(),Lt(Us,{to:"body"},[Te(ss,{name:"modal"},{default:fr(()=>[e.open?(O(),F("div",{key:0,class:"mask",onClick:P[10]||(P[10]=hn(R=>s("cancel"),["self"]))},[u("div",rv,[u("div",sv,[u("div",null,[P[11]||(P[11]=u("div",{class:"dialog-title"},"编辑工作记录",-1)),e.date?(O(),F("div",ov,ne(e.date),1)):Ee("",!0)]),u("button",{class:"icon-btn",title:"关闭",onClick:P[0]||(P[0]=R=>s("cancel"))},[Te(et,{name:"close",size:16})])]),u("div",iv,[u("div",av,[u("div",lv,[P[12]||(P[12]=u("label",null,"工作内容(必填)",-1)),Ae(u("input",{ref_key:"contentInput",ref:A,class:Ze(["input",{invalid:C.value}]),"onUpdate:modelValue":P[1]||(P[1]=R=>o.value=R),onKeydown:Mt(te,["enter"])},null,34),[[De,o.value]]),C.value?(O(),F("div",uv,ne(C.value),1)):Ee("",!0)]),u("div",cv,[P[14]||(P[14]=u("label",null,"所属项目",-1)),Ae(u("select",{class:"select","onUpdate:modelValue":P[2]||(P[2]=R=>a.value=R)},[P[13]||(P[13]=u("option",{value:null},"无项目",-1)),(O(!0),F(je,null,it(V.value,R=>(O(),F("option",{key:R.id,value:R.id},ne(R.name),9,fv))),128))],512),[[Nn,a.value]])]),u("div",dv,[P[15]||(P[15]=u("label",null,"工作分类",-1)),Ae(u("select",{class:"select","onUpdate:modelValue":P[3]||(P[3]=R=>c.value=R)},[(O(!0),F(je,null,it(Kt(Hs),R=>(O(),F("option",{key:R.key,value:R.key},ne(R.label),9,pv))),128))],512),[[Nn,c.value]])]),u("div",hv,[P[16]||(P[16]=u("label",null,"耗时(分钟)",-1)),Ae(u("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":P[4]||(P[4]=R=>d.value=R),placeholder:"选填"},null,512),[[De,d.value,void 0,{number:!0}]])]),u("div",vv,[P[17]||(P[17]=u("label",null,"主要收获",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":P[5]||(P[5]=R=>h.value=R),placeholder:"一句话:学到了什么"},null,512),[[De,h.value]])]),u("div",mv,[P[18]||(P[18]=u("label",null,"备注",-1)),Ae(u("textarea",{class:"textarea","onUpdate:modelValue":P[6]||(P[6]=R=>y.value=R),placeholder:"背景、链接、未决事项(选填)"},null,512),[[De,y.value]])]),u("div",yv,[P[19]||(P[19]=u("label",null,"成果标记",-1)),u("button",{class:Ze(["toggle-btn",{on:m.value===1}]),onClick:P[7]||(P[7]=R=>m.value=m.value===1?0:1)},ne(m.value===1?"已标记为成果":"未标记"),3)]),u("div",gv,[P[20]||(P[20]=u("label",null,"待跟进",-1)),u("button",{class:Ze(["toggle-btn",{onwarn:_.value===1}]),onClick:P[8]||(P[8]=R=>_.value=_.value===1?0:1)},ne(_.value===1?"需要跟进":"无需跟进"),3)])])]),u("div",bv,[u("button",{class:"btn btn-sm",onClick:P[9]||(P[9]=R=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:te},"保存修改")])])])):Ee("",!0)]),_:1})]))}}),_v=Qt(wv,[["__scopeId","data-v-63bc0b48"]]);function $s(e){return e<10?"0"+e:String(e)}function Vn(e){return e.getFullYear()+"-"+$s(e.getMonth()+1)+"-"+$s(e.getDate())}function Ct(){return Vn(new Date)}function _t(){const e=new Date;return Vn(e)+"T"+$s(e.getHours())+":"+$s(e.getMinutes())+":"+$s(e.getSeconds())}function Bn(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function os(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Fn(e,t){const n=os(e);return n.setDate(n.getDate()+t),Vn(n)}function Qo(e,t){const n=os(e),s=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(s,o)),Vn(n)}function Ts(e){const t=os(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Vn(t)}function kv(e){const t=os(e).getDay();return t===0||t===6}function xv(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function uf(e){const t=os(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}const Cv=15e4;function Ia(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 ja(e){const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}function Sv(){return Ia(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,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:ja(t),iterations:Cv,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function ei(e,t){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,new TextEncoder().encode(t));return Ia(n.buffer)+":"+Ia(s)}async function wi(e,t){const n=t.split(":");if(n.length!==2)throw new Error("密文格式错误");const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:ja(n[0])},e,ja(n[1]));return new TextDecoder().decode(s)}async function ul(){await kf()}const cf="intern-log-vault-verify",es="enc:v1:";let jr=null;function Ev(){return jr!==null}function ti(){jr=null}async function ff(){return await bt("pwd_salt","")!==""}async function $v(e){if(e.length<6)throw new Error("主密码至少 6 位");if(await ff())throw new Error("主密码已设置");const t=Sv(),n=await Zo(e,t),s=await ei(n,cf);await Rt("pwd_salt",t),await Rt("pwd_verifier",s),jr=n}async function Tv(e){const t=await bt("pwd_salt","");if(!t)throw new Error("主密码尚未设置");const n=await Zo(e,t),s=await bt("pwd_verifier","");try{await wi(n,s)}catch{throw new Error("主密码不正确")}jr=n}async function df(){if(!jr)throw new Error("密码库未解锁");return jr}async function Av(e){const t=await df();return es+await ei(t,e)}async function Pv(e){if(!e)return"";if(!e.startsWith(es))return e;const t=await df();return wi(t,e.slice(es.length))}async function Ov(){return de.credential.orderBy("system").toArray()}async function Mv(e,t){const n=await Av(e.password),s={system:e.system.trim(),account:e.account.trim(),password:n,remark:e.remark.trim()};t?await de.credential.update(t,{...s,updated_at:_t()}):await de.credential.add({...s,created_at:_t(),updated_at:_t()}),await ul()}async function Iv(e){await de.credential.delete(e),await ul()}async function ha(e){const t=await de.credential.get(e);if(!t)throw new Error("记录不存在");return Pv(t.password)}async function jv(e,t){if(!e)throw new Error("请输入旧主密码");if(t.length<6)throw new Error("新主密码至少 6 位");if(t===e)throw new Error("新主密码不能与旧主密码相同");const n=await bt("pwd_salt","");if(!n)throw new Error("密码库尚未初始化");const s=await Zo(e,n),o=await bt("pwd_verifier","");try{await wi(s,o)}catch{throw new Error("旧主密码不正确")}const a=await Zo(t,n),c=await de.credential.toArray();let d=0;for(const h of c){if(h.id==null)continue;const y=await Dv(h.password,s),m=es+await ei(a,y);await de.credential.update(h.id,{password:m}),d++}return await Rt("pwd_verifier",await ei(a,cf)),jr=a,await ul(),d}async function Dv(e,t){return e?e.startsWith(es)?wi(t,e.slice(es.length)):e:""}const pf="https://daywk.linyux.cn",Da="dsh_sync_base",La="dsh_sync_token";function hf(e){try{return localStorage.getItem(e)||""}catch{return""}}function vf(e,t){try{localStorage.setItem(e,t)}catch{}}function mf(e){try{localStorage.removeItem(e)}catch{}}async function Lr(){return hf(Da)||pf}async function Lv(e){const t=(e||"").trim().replace(/\/+$/,"");t&&t!==pf?vf(Da,t):mf(Da)}function cl(){const e=hf(La);if(!e)return"";try{return e}catch{return""}}function Ra(e){e?vf(La,e):mf(La)}const Rv="intern_worklog",fl="dsh_session_user";function _i(){try{const e=localStorage.getItem(fl);if(!e)return null;const t=JSON.parse(e);if(t&&t.userId&&t.username)return t}catch{}return null}function Kv(e){localStorage.setItem(fl,JSON.stringify(e))}function yf(){localStorage.removeItem(fl)}const dl="dsh_cloud_creds";function gf(e,t){localStorage.setItem(dl,JSON.stringify({username:e,password:t}))}function pr(){try{const e=localStorage.getItem(dl);if(!e)return null;const t=JSON.parse(e);if(t&&t.username&&t.password)return t}catch{}return null}function Fv(){localStorage.removeItem(dl)}let ni=null;function ri(e){ni===e&&de||(de&&ll(),tv(new ev(Rv+"_"+e)),ni=e)}async function Nv(e,t,n){const s=await Lr();let o;try{o=await fetch(s+"/api/auth/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.trim(),password:n})})}catch{throw new Error("无法连接同步服务器:请检查网络后重试")}const a=await o.json().catch(()=>({}));if(!o.ok){const c=a&&a.error||"服务返回 "+o.status;throw e==="register"&&o.status===409?new Error("云端已有同名账号且密码一致,直接登录即可"):new Error(String(c))}if(!a.userId||!a.username)throw new Error("登录响应异常");return{userId:String(a.userId),username:String(a.username)}}async function pl(e,t,n){const s=await Nv(n,e,t);ri(s.userId);const o={userId:s.userId,username:s.username};return Kv(o),gf(s.username,t),o}async function Vv(e,t){const n=(e||"").trim();if(!n||!t)throw new Error("请输入用户名与密码");return pl(n,t,"login")}async function Bv(e,t,n){const s=(e||"").trim();if(s.length<2||s.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");return pl(s,t,"register")}async function Uv(){const e=pr();if(!e)return null;try{return await pl(e.username,e.password,"login")}catch{return null}}async function qv(){ti(),ll(),ni=null,yf()}function Hv(){ti(),ll(),ni=null,yf(),Fv()}async function Wv(e,t){if(!_i())throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const s=pr();if(!s||s.password!==e)throw new Error("旧密码不正确");const o=await Lr();let a;try{a=await fetch(o+"/api/auth/password",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+bf()},body:JSON.stringify({oldPassword:e,newPassword:t})})}catch{throw new Error("无法连接同步服务器")}if(!a.ok){const c=await a.json().catch(()=>({}));throw new Error(c&&c.error||"修改失败 "+a.status)}gf(s.username,t)}async function zv(){if(!_i())throw new Error("未登录");const t=await Lr();let n;try{n=await fetch(t+"/api/auth/delete",{method:"POST",headers:{Authorization:"Bearer "+bf()}})}catch{throw new Error("无法连接同步服务器")}if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s&&s.error||"删除失败 "+n.status)}Hv()}function bf(){return cl()}const Ka=N(null),Fa=N(null),Ws=N(0);function tr(){Ws.value++}const Jr=N(""),Fs=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","transaction"],Gr=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]),Gv=Lr;function Oo(e){return JSON.stringify(e)}async function Yv(e){return de.table(e).toArray()}function Mo(e,t){return e==="setting"?t.key:t.id}async function Jv(){for(const e of Fs){const t=de.table(e),n=await t.toArray();for(const s of n){if(e==="setting"&&Gr.has(s.key))continue;const o={};s.uuid||(o.uuid=Xv()),!s.updated_at&&s.created_at&&(o.updated_at=s.created_at),Object.keys(o).length&&await t.update(Mo(e,s),o)}}}function Xv(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"u"+Date.now().toString(36)+Math.random().toString(36).slice(2,10)}async function Qv(){return pr()!=null}async function Zv(){try{return localStorage.getItem("dsh_last_sync")||""}catch{return""}}async function em(e){try{localStorage.setItem("dsh_last_sync",e)}catch{}}async function wf(e,t){const n=await fetch(e+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.username.trim(),password:t.password})});if(!n.ok)throw new Error("云端账号或密码不正确");const s=await n.json();if(!s||!s.token)throw new Error("云端登录异常");return String(s.token)}async function tm(e,t){let n=cl();return n||(n=await wf(e,t),Ra(n),n)}async function _f(){const e=pr();if(!e)throw new Error("未登录");const t=await Lr(),n=await fetch(t+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e.username,password:e.password})});if(!n.ok)throw new Error("云端账号校验失败:"+n.status)}async function Na(){const e=pr();if(!e)throw new Error("未登录,无法同步");return Sf({baseUrl:await Lr(),username:e.username,password:e.password})}async function kf(){try{await Na()}catch(e){Jr.value=e instanceof Error?e.message:String(e);try{await Na()}catch{}throw e}}function xf(e,t,n){const s={};for(const o of Object.keys(t))o!=="id"&&(s[o]=t[o]);if(e==="log_item"){delete s.work_log_id,delete s.project_id;const o=t.work_log_id?n.workLog.get(t.work_log_id):null;o&&o.uuid&&(s.wuuid=o.uuid);const a=t.project_id?n.project.get(t.project_id):null;a&&a.uuid&&(s.puuid=a.uuid)}return s}async function Cf(){const e=await de.work_log.toArray(),t=await de.project.toArray();return{workLog:new Map(e.map(n=>[n.id,n])),project:new Map(t.map(n=>[n.id,n]))}}let As=!1,Io=!1,Va=!1,Xr=null,kn=null,Ba="",Ua=!1,jo=null;async function Qr(){if(As){Io=!0;return}try{if(!await Qv())return;await Sf(await nm()),Jr.value=""}catch(e){Jr.value=e instanceof Error?e.message:String(e)}}async function nm(){const e=pr();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await Lr(),username:e.username,password:e.password}}function rm(){if(Ua)return;Ua=!0,jo=Zh(async()=>{const t={};for(const n of Fs)t[n]=await de.table(n).count();return t}).subscribe({next:()=>{Va||As||(Xr&&globalThis.clearTimeout(Xr),Xr=globalThis.setTimeout(()=>{Qr()},3e3))},error:()=>{}})}function sm(){jo&&(jo.unsubscribe(),jo=null),kn&&(kn.close(),kn=null,Ba=""),Xr&&(globalThis.clearTimeout(Xr),Xr=null),Ua=!1}function om(e,t){const n=e+"|"+t;if(!(kn&&Ba===n)){kn&&(kn.close(),kn=null);try{kn=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),Ba=n,kn.onmessage=()=>{Qr()}}catch{kn=null}}}async function Sf(e){if(As)return Io=!0,{pushed:0,pulled:0,removed:0,errors:0,at:""};As=!0,Va=!0;try{const t=await im(e);return Io&&(Io=!1,globalThis.setTimeout(()=>{Qr()},800)),t}finally{As=!1,Va=!1}}async function im(e){const t=e.baseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("请先配置同步服务地址");await Jv();const n=await Cf(),s=await de.sync_mirror.toArray(),o=new Map;for(const te of s)o.set(te.table+"|"+te.uuid,te);const a={},c=[];let d=0;for(const te of Fs){let ue=await Yv(te);te==="setting"&&(ue=ue.filter(R=>!Gr.has(R.key)));const P=new Map;for(const R of ue)P.set(R.uuid,R);for(const[R,X]of P){const fe=xf(te,X,n),ie=Oo(fe),ee=o.get(te+"|"+R);(!ee||ee.hash!==ie)&&(a[te]=a[te]||[],a[te].push(fe),d++)}for(const[R,X]of o)R.startsWith(te+"|")&&!P.has(X.uuid)&&c.push({table:te,uuid:X.uuid,deleted_at:_t()});a[te]=a[te]||[]}c.push(...fm());const h=await tm(t,e),y=te=>fetch(t+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+te},body:JSON.stringify({device:"client",tables:a,tombstones:c})});let m=await y(h);if(m.status===401){Ra("");const te=await wf(t,e);Ra(te),m=await y(te)}if(!m.ok)throw new Error("同步服务返回 "+m.status);const _=await m.json(),C=_.tables||{},A=_.tombstones||[],V=await um(C,A);om(t,cl()||h);const Z=_t();return await em(Z),(V.changed>0||V.removed>0||d>0)&&tr(),{pushed:d,pulled:V.changed,removed:V.removed,errors:0,at:Z}}function Ef(){var t;return"dsh_idmap_"+(((t=pr())==null?void 0:t.username)||"anon")}function am(){try{const e=localStorage.getItem(Ef());if(e)return JSON.parse(e)}catch{}return{}}function lm(e){try{localStorage.setItem(Ef(),JSON.stringify(e))}catch{}}async function um(e,t){const n=am(),s=new Set(t.map(C=>C.table+"|"+C.uuid)),o=new Map;for(const C of await de.sync_mirror.toArray())o.set(C.table+"|"+C.uuid,C);const a=new Set(Array.from(o.keys()).map(C=>C.split("|")[1]));let c=0,d=0;const h={},y={};for(const C of Fs){const A=de.table(C),V=await A.toArray(),Z=new Map(V.map(S=>[Mo(C,S),S])),te=new Map(V.filter(S=>S.uuid).map(S=>[S.uuid,S])),ue=(e[C]||[]).filter(S=>!s.has(C+"|"+S.uuid)),P=ue.filter(S=>!(C==="setting"&&Gr.has(S.key))),R=ue.filter(S=>C==="setting"&&Gr.has(S.key));for(const S of R)cm(C,S.uuid);const X=C==="setting"?[]:V.filter(S=>S.uuid&&!a.has(S.uuid)&&!s.has(C+"|"+S.uuid)),fe={v:Math.max(0,...V.map(S=>Number(S.id)||0))};P.length;const ie=[];for(const S of P){const oe={...S};if(C==="log_item"){const xe=oe.wuuid?h[oe.wuuid]:void 0;if(!xe)continue;oe.work_log_id=xe,delete oe.wuuid,oe.project_id=oe.puuid?y[oe.puuid]??null:null,delete oe.puuid}let be=Mo(C,S);if(C==="setting")be=S.key;else{const xe=n[C]&&n[C][S.uuid],Le=te.get(S.uuid);Le&&Le.id!=null?be=Le.id:typeof xe=="number"?be=xe:be=++fe.v}const z={...oe,id:be};C==="setting"&&Gr.has(z.key)||(ie.push(z),C==="work_log"&&(h[S.uuid]=be),C==="project"&&(y[S.uuid]=be))}const ee=ie.concat(X);for(const S of ee){const oe=Z.get(Mo(C,S));(!oe||Oo(oe)!==Oo(S))&&c++}d+=V.filter(S=>S.uuid&&!ie.some(oe=>oe.uuid===S.uuid)&&!s.has(C+"|"+S.uuid)).length,await A.clear(),ee.length&&await A.bulkPut(ee);const M={};for(const S of ee)S.uuid&&(M[S.uuid]=S.id);n[C]=M}lm(n);const m=await Cf(),_=[];for(const C of Fs){const A=await de.table(C).toArray();for(const V of A)C==="setting"&&Gr.has(V.key)||V.uuid&&_.push({table:C,uuid:V.uuid,hash:Oo(xf(C,V,m))})}return await de.sync_mirror.clear(),_.length&&await de.sync_mirror.bulkAdd(_.map(C=>({...C}))),await de.tombstone.clear(),{changed:c,removed:d+si.length}}const si=[];function cm(e,t){si.some(n=>n.table===e&&n.uuid===t)||si.push({table:e,uuid:t,deleted_at:_t()})}function fm(){return si.splice(0)}const dm=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);async function kt(){await kf()}async function bt(e,t){const n=await de.setting.get(e);return n?n.value:t}async function Rt(e,t){await de.setting.put({key:e,value:t}),dm.has(e)||await kt()}async function Dr(){const e=await Promise.all([bt("work_start","09:00"),bt("work_end","18:00"),bt("grace_minutes","10"),bt("lunch_minutes","60"),bt("remind_weekly","friday")]);return{work_start:e[0],work_end:e[1],grace_minutes:Number(e[2])||0,lunch_minutes:Number(e[3])||0,remind_weekly:e[4]}}async function pm(){const e=await bt("last_project",""),t=await bt("last_category","dev");return{project_id:e?Number(e):null,category:t||"dev"}}async function hm(){return bt("last_location","")}async function vm(e,t){const n=t.trim();await Rt("last_location",n),n&&await oi(n);let s=!1;const o=await gn(e);o&&o.id?(o.location||"")!==n&&(await de.attendance.update(o.id,{location:n||null}),s=!0):n&&(await de.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:_t()}),s=!0),s&&await kt()}async function hl(){const e=await bt("location_presets","");if(!e)return Ku.slice();try{const t=JSON.parse(e);if(Array.isArray(t))return t.filter(n=>typeof n=="string"&&n.trim()).map(n=>n.trim())}catch{}return Ku.slice()}async function $f(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await Rt("location_presets",JSON.stringify(t))}async function oi(e){const t=e.trim();if(!t)return;const n=await hl();n.includes(t)||await $f([...n,t])}async function Ns(e=!1){const t=await de.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function mm(e){await de.project.add({name:e.trim(),archived:0,created_at:_t()}),await kt()}async function ym(e,t){await de.project.update(e,{name:t.trim()}),await kt()}async function gm(e,t){await de.project.update(e,{archived:t?1:0}),await kt()}async function gn(e){return de.attendance.where("date").equals(e).first()}async function Tf(e,t){const n=((t===void 0?await bt("last_location",""):t)||"").trim();let s=!1;const o=await gn(e);if(o&&o.id){if(!o.clock_in_at){const a={clock_in_at:_t()};n&&(a.location=n),await de.attendance.update(o.id,a),s=!0}n&&(await bt("last_location","")!==n&&await Rt("last_location",n),await oi(n)),s&&await kt();return}await de.attendance.add({date:e,clock_in_at:_t(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:_t()}),n&&(await Rt("last_location",n),await oi(n)),await kt()}async function bm(e){const t=await gn(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&(await de.attendance.update(t.id,{clock_out_at:_t()}),await kt())}async function wm(){const e=new Date,t=Vn(e);let n="";if(e.getHours()<4){const s=await gn(Fn(t,-1));s&&s.id&&s.clock_in_at&&!s.clock_out_at&&(await de.attendance.update(s.id,{clock_out_at:_t()}),n=s.date)}if(!n){const s=await gn(t);s&&s.id&&s.clock_in_at&&!s.clock_out_at&&(await de.attendance.update(s.id,{clock_out_at:_t()}),n=s.date)}if(!n)throw new Error("没有进行中的打卡");return await kt(),n}async function _m(e,t,n,s,o){(o||"").trim()&&await oi(o);const a=await gn(e),c={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:s||null,location:(o||"").trim()||null,created_at:_t()};a&&a.id?await de.attendance.update(a.id,c):await de.attendance.add(c),await kt()}async function km(e,t,n){const s=(n||"").trim();if(!s)return;const o=await gn(e);o&&o.id&&(await de.attendance.update(o.id,{[t]:e+"T"+s+":00"}),await kt())}async function ki(e,t){return de.attendance.where("date").between(e,t,!0,!0).toArray()}async function xm(e,t){const n=await gn(e);if(t){const s={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:_t()};n&&n.id?await de.attendance.update(n.id,s):await de.attendance.add({...s,note:null,location:null})}else n&&n.id&&await de.attendance.update(n.id,{kind:"normal"});await kt()}async function Cm(e){const t=await de.work_log.where("date").equals(e).first();return t||{id:await de.work_log.add({date:e,created_at:_t()}),date:e,created_at:_t()}}async function Sm(e){return de.work_log.where("date").equals(e).first()}async function Em(e){const t=await Sm(e);return!t||!t.id?[]:(await de.log_item.where("work_log_id").equals(t.id).toArray()).sort((s,o)=>o.id-s.id)}async function $m(e,t){const n=await de.work_log.where("date").equals(e).first();let s;n&&n.id?s=n:s=await Cm(e),await de.table("log_item").add({work_log_id:s.id,content:t.content,project_id:t.project_id,category:t.category,minutes:t.minutes,is_milestone:0,needs_followup:0,takeaway:t.takeaway,remark:t.remark,sort_order:0,created_at:_t()});const o=t.project_id?String(t.project_id):"";await bt("last_project","")!==o&&await Rt("last_project",o),await bt("last_category","")!==t.category&&await Rt("last_category",t.category),await kt()}async function va(e,t){await de.table("log_item").update(e,t),await kt()}async function Tm(e){await de.table("log_item").delete(e),await kt()}async function xi(e,t){const n=await de.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 de.table("log_item").where("work_log_id").anyOf(n.map(a=>a.id)).toArray()).map(a=>({...a,date:s.get(a.work_log_id)||""})).sort((a,c)=>a.date===c.date?a.id-c.id:a.date<c.date?-1:1)}async function vl(e){return de.weekly_note.where("week_start").equals(e).first()}async function Am(e,t){const n=await vl(e);n&&n.id?await de.weekly_note.update(n.id,t):await de.weekly_note.add({week_start:e,highlights:t.highlights??null,challenges:t.challenges??null,plan_next:t.plan_next??null,created_at:_t()}),await kt()}async function Pm(e,t){return de.weekly_note.where("week_start").between(e,t,!0,!0).toArray()}async function Om(){return(await de.memo.toArray()).sort((t,n)=>t.updated_at<n.updated_at?1:-1)}async function Mm(e,t){const n=_t(),s=await de.memo.add({title:e.trim(),content:t,created_at:n,updated_at:n});return await kt(),{id:s,title:e.trim(),content:t,created_at:n,updated_at:n}}async function Im(e,t,n){await de.memo.update(e,{title:t.trim(),content:n,updated_at:_t()}),await kt()}async function jm(e){await de.memo.delete(e),await kt()}async function Dm(e,t=8){const n=e.trim().toLowerCase();if(!n)return[];const s=await de.work_log.toArray(),o=new Map(s.map(c=>[c.id,c.date]));return(await de.table("log_item").toArray()).filter(c=>((c.content||"")+" "+(c.takeaway||"")+" "+(c.remark||"")).toLowerCase().includes(n)).sort((c,d)=>d.id-c.id).slice(0,t).map(c=>({...c,date:o.get(c.work_log_id)||""}))}async function Lm(e,t=4){const n=e.trim().toLowerCase();return n?(await de.memo.toArray()).filter(o=>((o.title||"")+" "+(o.content||"")).toLowerCase().includes(n)).sort((o,a)=>o.updated_at<a.updated_at?1:-1).slice(0,t):[]}async function Rm(e,t){return de.table("transaction").where("date").between(e,t,!0,!0).toArray()}async function Km(e){await de.table("transaction").add({...e,created_at:_t()}),await kt()}async function Fm(e,t){await de.table("transaction").update(e,{...t}),await kt()}async function Nm(e){await de.table("transaction").delete(e),await kt()}async function Vm(e,t){await de.table("transaction").update(e,{reimbursed:1}),await kt()}async function Bm(){const e=await Promise.all([de.project.toArray(),de.work_log.toArray(),de.table("log_item").toArray(),de.attendance.toArray(),de.weekly_note.toArray(),de.setting.toArray(),de.memo.toArray(),de.credential.toArray(),de.table("transaction").toArray()]);return JSON.stringify({schema_version:nv,exported_at:_t(),data:{project:e[0],work_log:e[1],log_item:e[2],attendance:e[3],weekly_note:e[4],setting:e[5],memo:e[6],credential:e[7],transaction:e[8]}},null,2)}async function Um(e){let t=null;try{t=JSON.parse(e)}catch{throw new Error("不是有效的 JSON 文件")}if(!t||t.schema_version!==1&&t.schema_version!==2&&t.schema_version!==3||!t.data)throw new Error("文件格式或 schema 版本不匹配");const n=t.data,s=de.table("log_item"),o=de.table("transaction");await de.transaction("rw",[de.project,de.work_log,s,de.attendance,de.weekly_note,de.setting,de.memo,de.credential,o],async()=>{await Promise.all([de.project.clear(),de.work_log.clear(),s.clear(),de.attendance.clear(),de.weekly_note.clear(),de.setting.clear(),de.memo.clear(),de.credential.clear(),o.clear()]),n.project&&n.project.length&&await de.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await de.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await s.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await de.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await de.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await de.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await de.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await de.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await o.bulkAdd(n.transaction)}),await kt()}function Eo(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function zs(e,t,n,s){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(kv(t))return{status:"rest",label:"休息日",makeup:!1,workedMinutes:null};if(!e||!e.clock_in_at)return s?{status:"none",label:"未打卡",makeup:!1,workedMinutes:null}:{status:"absent",label:"缺勤",makeup:!!(e&&e.kind==="makeup"),workedMinutes:null};const o=e.kind==="makeup";if(!e.clock_out_at)return{status:"incomplete",label:s?"进行中":"未完成",makeup:o,workedMinutes:null};const a=Eo(Bn(e.clock_in_at)),c=Eo(Bn(e.clock_out_at)),d=Eo(n.work_start),h=Eo(n.work_end);let y="normal";!o&&a>d+n.grace_minutes?y="late":!o&&c<h&&(y="early");const m=xv(e.clock_in_at,e.clock_out_at),_=Math.max(0,m-n.lunch_minutes);return{status:y,label:o?"补卡":y==="late"?"迟到":y==="early"?"早退":"正常",makeup:o,workedMinutes:_}}const Do=N([]);let qm=0;function Ve(e){const t=++qm;Do.value.push({id:t,text:e}),setTimeout(()=>{Do.value=Do.value.filter(n=>n.id!==t)},2e3)}function Hm(){return Do}const Wm={class:"day-panel"},zm={class:"dp-head"},Gm={class:"dp-date"},Ym={class:"card sec"},Jm={class:"att-grid"},Xm={class:"att-cell"},Qm={key:0,class:"edit-row"},Zm={key:1,class:"att-val"},ey={class:"att-cell"},ty={key:0,class:"edit-row"},ny={key:1,class:"att-val"},ry={class:"att-cell"},sy=["list"],oy=["id"],iy=["value"],ay={class:"att-cell"},ly={class:"att-val status-val"},uy={key:0,class:"tag"},cy={key:1,class:"muted"},fy={key:0,class:"att-note muted"},dy={class:"att-actions"},py=["disabled"],hy=["disabled"],vy=["disabled"],my=["disabled"],yy={key:0,class:"card sec makeup"},gy={class:"form-grid"},by={class:"field"},wy={class:"field"},_y={class:"field span2"},ky=["list"],xy={class:"field span2"},Cy={key:0,class:"form-error"},Sy={class:"form-footer"},Ey={class:"card sec"},$y={class:"form-grid"},Ty={class:"field span2"},Ay={key:0,class:"form-error"},Py={class:"field"},Oy=["value"],My={class:"field"},Iy=["value"],jy={class:"field"},Dy={class:"field"},Ly={class:"field span2"},Ry={class:"form-footer"},Ky=["disabled"],Fy=["disabled"],Ny={class:"list-sec"},Vy={class:"sec-title"},By={key:0,class:"empty muted"},Uy={class:"item-main"},qy={class:"tag"},Hy=["onClick"],Wy={key:0,class:"muted item-meta"},zy={key:1,class:"muted num item-meta"},Gy=["onClick"],Yy=["onClick"],Jy=["onClick"],Xy=["onClick"],Qy={key:0,class:"item-sub"},Zy={key:0,class:"muted2"},eg={key:1,class:"muted"},tg={key:1,class:"dp-foot muted num"},ng=Ht({__name:"DayPanel",props:{date:{}},setup(e){const t=e,n=N(!0),s=N(null),o=N(void 0),a=N([]),c=N([]),d=N(""),h=N([]),y=ut(()=>"loc-list-"+t.date),m=ut(()=>t.date===Ct());async function _(){n.value=!0,s.value=await Dr(),o.value=await gn(t.date),a.value=await Em(t.date),c.value=await Ns(!0),h.value=await hl(),d.value=o.value&&o.value.location||await hm(),n.value=!1}yn(_),mt(()=>t.date,_),mt(Ws,()=>{_()});const C=ut(()=>c.value.filter(q=>q.archived!==1));function A(q){if(!q)return"";const H=c.value.find(Y=>Y.id===q);return H?H.name:"已删除项目"}const V=ut(()=>s.value?zs(o.value,t.date,s.value,m.value):null),Z=ut(()=>a.value.reduce((q,H)=>q+(H.minutes||0),0)),te=N(!1);async function ue(){te.value||(te.value=!0,await Tf(t.date,d.value),await _(),tr(),Ve("上班打卡成功"),te.value=!1)}async function P(){te.value||(te.value=!0,await bm(t.date),await _(),tr(),Ve("下班打卡成功"),te.value=!1)}async function R(){await vm(t.date,d.value),tr(),Ve("地点已更新")}const X=N(!1),fe=ut(()=>{var q;return((q=o.value)==null?void 0:q.kind)==="leave"});function ie(){if(o.value&&o.value.clock_in_at){X.value=!0;return}ee(!0)}async function ee(q){X.value=!1,await xm(t.date,q),await _(),tr(),Ve(q?"已标记为休假":"已取消休假")}const M=N(null),S=N(""),oe=N(null);mt(M,async q=>{var H;q&&(await rs(),(H=oe.value)==null||H.focus())});function be(q){var Y,Pe;const H=q==="in"?(Y=o.value)==null?void 0:Y.clock_in_at:(Pe=o.value)==null?void 0:Pe.clock_out_at;M.value=q,S.value=H?Bn(H):q==="in"?"09:00":"18:00"}function z(){M.value=null}async function xe(){const q=M.value;q&&(M.value=null,S.value&&(await km(t.date,q==="in"?"clock_in_at":"clock_out_at",S.value),await _(),tr(),Ve("打卡时间已修改")))}const Le=N(!1),rt=N("09:00"),He=N("18:00"),Ye=N(""),Ke=N(""),st=N("");function qe(){Ke.value=d.value,st.value="",Le.value=!Le.value}async function Qe(){if(!rt.value||!He.value){st.value="请填写上班与下班时间";return}await _m(t.date,t.date+"T"+rt.value+":00",t.date+"T"+He.value+":00",Ye.value.trim(),Ke.value),Le.value=!1,Ye.value="",st.value="",await _(),tr(),Ve("补卡已保存")}const Ce=N(""),J=N("");mt(Ce,()=>{J.value&&(J.value="")});const Q=N(null),ke=N("dev"),Fe=N(null),ct=N(""),It=N(""),$e=N(!1),ce=ut(()=>!!(Ce.value.trim()||Fe.value||ct.value.trim()||It.value.trim()));yn(async()=>{const q=await pm();Q.value=q.project_id,ke.value=q.category});function x(){Ce.value="",Fe.value=null,ct.value="",It.value="",J.value=""}async function k(){const q=Ce.value.trim();if(!q){J.value="请填写工作内容";return}$e.value||($e.value=!0,await $m(t.date,{content:q,project_id:Q.value,category:ke.value,minutes:Fe.value&&Fe.value>0?Fe.value:null,takeaway:ct.value.trim()||null,remark:It.value.trim()||null}),x(),await _(),Ve("记录已添加"),$e.value=!1)}const b=N(null);function W(q){b.value=q}async function re(q){const H=q.id,Y={content:q.content,project_id:q.project_id,category:q.category,minutes:q.minutes,takeaway:q.takeaway,remark:q.remark,is_milestone:q.is_milestone,needs_followup:q.needs_followup};await va(H,Y),b.value=null,await _(),Ve("修改已保存")}async function le(q){await va(q.id,{is_milestone:q.is_milestone?0:1}),await _()}async function ge(q){await va(q.id,{needs_followup:q.needs_followup?0:1}),await _()}const me=N(null);async function ae(){me.value&&me.value.id&&await Tm(me.value.id),me.value=null,await _(),Ve("记录已删除")}return(q,H)=>(O(),F("div",Wm,[u("div",zm,[u("div",Gm,ne(Kt(uf)(e.date)),1)]),u("div",Ym,[H[25]||(H[25]=u("div",{class:"sec-title"},"出勤信息",-1)),u("div",Jm,[u("div",Xm,[H[21]||(H[21]=u("label",null,"上班时间",-1)),M.value==="in"?(O(),F("div",Qm,[Ae(u("input",{ref_key:"timeInput",ref:oe,type:"time",class:"input time-input","onUpdate:modelValue":H[0]||(H[0]=Y=>S.value=Y),onKeydown:[Mt(xe,["enter"]),Mt(z,["esc"])]},null,544),[[De,S.value]]),u("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),u("button",{class:"btn btn-sm",onClick:z},"取消")])):(O(),F("div",Zm,[u("span",{class:Ze(["num",{"val-empty":!(o.value&&o.value.clock_in_at)}])},ne(o.value&&o.value.clock_in_at?Kt(Bn)(o.value.clock_in_at):"未打卡"),3),o.value&&o.value.id?(O(),F("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:H[1]||(H[1]=Y=>be("in"))},[Te(et,{name:"edit",size:13})])):Ee("",!0)]))]),u("div",ey,[H[22]||(H[22]=u("label",null,"下班时间",-1)),M.value==="out"?(O(),F("div",ty,[Ae(u("input",{ref_key:"timeInput",ref:oe,type:"time",class:"input time-input","onUpdate:modelValue":H[2]||(H[2]=Y=>S.value=Y),onKeydown:[Mt(xe,["enter"]),Mt(z,["esc"])]},null,544),[[De,S.value]]),u("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),u("button",{class:"btn btn-sm",onClick:z},"取消")])):(O(),F("div",ny,[u("span",{class:Ze(["num",{"val-empty":!(o.value&&o.value.clock_out_at)}])},ne(o.value&&o.value.clock_out_at?Kt(Bn)(o.value.clock_out_at):"未打卡"),3),o.value&&o.value.id?(O(),F("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:H[3]||(H[3]=Y=>be("out"))},[Te(et,{name:"edit",size:13})])):Ee("",!0)]))]),u("div",ry,[H[23]||(H[23]=u("label",null,"上班地点",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":H[4]||(H[4]=Y=>d.value=Y),list:y.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:R},null,40,sy),[[De,d.value]]),u("datalist",{id:y.value},[(O(!0),F(je,null,it(h.value,Y=>(O(),F("option",{key:Y,value:Y},null,8,iy))),128))],8,oy)]),u("div",ay,[H[24]||(H[24]=u("label",null,"考勤状态",-1)),u("div",ly,[V.value?(O(),F(je,{key:0},[u("span",{class:Ze(["dot",V.value.status])},null,2),u("span",null,ne(V.value.label),1),o.value&&o.value.kind==="makeup"?(O(),F("span",uy,"补卡")):Ee("",!0)],64)):(O(),F("span",cy,"--"))])])]),o.value&&o.value.note?(O(),F("div",fy,"补卡说明:"+ne(o.value.note),1)):Ee("",!0),u("div",dy,[m.value&&(!o.value||!o.value.clock_in_at)?(O(),F("button",{key:0,class:"btn btn-primary btn-sm",disabled:te.value,onClick:ue},"上班打卡",8,py)):m.value&&o.value&&o.value.clock_in_at&&!o.value.clock_out_at?(O(),F("button",{key:1,class:"btn btn-primary btn-sm",disabled:te.value,onClick:P},"下班打卡",8,hy)):Ee("",!0),!m.value&&(!o.value||!o.value.clock_in_at)?(O(),F("button",{key:2,class:"btn btn-sm",onClick:qe},"补卡")):Ee("",!0),fe.value?(O(),F("button",{key:4,class:"btn btn-sm",disabled:te.value,onClick:H[5]||(H[5]=Y=>ee(!1))},"取消休假",8,my)):(O(),F("button",{key:3,class:"btn btn-sm",disabled:te.value,onClick:ie},"标记休假",8,vy))])]),Le.value?(O(),F("div",yy,[H[30]||(H[30]=u("div",{class:"sec-title"},"补卡登记",-1)),u("div",gy,[u("div",by,[H[26]||(H[26]=u("label",null,"上班时间",-1)),Ae(u("input",{type:"time",class:"input","onUpdate:modelValue":H[6]||(H[6]=Y=>rt.value=Y)},null,512),[[De,rt.value]])]),u("div",wy,[H[27]||(H[27]=u("label",null,"下班时间",-1)),Ae(u("input",{type:"time",class:"input","onUpdate:modelValue":H[7]||(H[7]=Y=>He.value=Y)},null,512),[[De,He.value]])]),u("div",_y,[H[28]||(H[28]=u("label",null,"上班地点",-1)),Ae(u("input",{class:"input",list:y.value,"onUpdate:modelValue":H[8]||(H[8]=Y=>Ke.value=Y),placeholder:"可直接输入"},null,8,ky),[[De,Ke.value]])]),u("div",xy,[H[29]||(H[29]=u("label",null,"补卡原因",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":H[9]||(H[9]=Y=>Ye.value=Y),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[De,Ye.value]])])]),st.value?(O(),F("div",Cy,ne(st.value),1)):Ee("",!0),u("div",Sy,[u("button",{class:"btn btn-sm",onClick:H[10]||(H[10]=Y=>Le.value=!1)},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:Qe},"保存补卡")])])):Ee("",!0),u("div",Ey,[H[38]||(H[38]=u("div",{class:"sec-head"},[u("span",{class:"sec-title"},"新增工作记录"),u("span",{class:"muted form-hint"},"内容必填,其余选填")],-1)),u("div",$y,[u("div",Ty,[H[31]||(H[31]=u("label",null,"工作内容(必填)",-1)),Ae(u("input",{class:Ze(["input",{invalid:J.value}]),"onUpdate:modelValue":H[11]||(H[11]=Y=>Ce.value=Y),placeholder:"做了什么,一句话一条",onKeydown:Mt(k,["enter"])},null,34),[[De,Ce.value]]),J.value?(O(),F("div",Ay,ne(J.value),1)):Ee("",!0)]),u("div",Py,[H[33]||(H[33]=u("label",null,"所属项目",-1)),Ae(u("select",{class:"select","onUpdate:modelValue":H[12]||(H[12]=Y=>Q.value=Y)},[H[32]||(H[32]=u("option",{value:null},"无项目",-1)),(O(!0),F(je,null,it(C.value,Y=>(O(),F("option",{key:Y.id,value:Y.id},ne(Y.name),9,Oy))),128))],512),[[Nn,Q.value]])]),u("div",My,[H[34]||(H[34]=u("label",null,"工作分类",-1)),Ae(u("select",{class:"select","onUpdate:modelValue":H[13]||(H[13]=Y=>ke.value=Y)},[(O(!0),F(je,null,it(Kt(Hs),Y=>(O(),F("option",{key:Y.key,value:Y.key},ne(Y.label),9,Iy))),128))],512),[[Nn,ke.value]])]),u("div",jy,[H[35]||(H[35]=u("label",null,"耗时(分钟)",-1)),Ae(u("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":H[14]||(H[14]=Y=>Fe.value=Y),placeholder:"选填"},null,512),[[De,Fe.value,void 0,{number:!0}]])]),u("div",Dy,[H[36]||(H[36]=u("label",null,"主要收获",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":H[15]||(H[15]=Y=>ct.value=Y),placeholder:"一句话:学到了什么"},null,512),[[De,ct.value]])]),u("div",Ly,[H[37]||(H[37]=u("label",null,"备注",-1)),Ae(u("textarea",{class:"textarea","onUpdate:modelValue":H[16]||(H[16]=Y=>It.value=Y),placeholder:"背景、链接、未决事项(选填)"},null,512),[[De,It.value]])])]),u("div",Ry,[u("button",{class:"btn btn-sm",disabled:!ce.value,onClick:x},"重置",8,Ky),u("button",{class:"btn btn-primary btn-sm",disabled:$e.value,onClick:k},"添加记录",8,Fy)])]),u("div",Ny,[u("div",Vy,"工作记录("+ne(a.value.length)+")",1),!a.value.length&&!n.value?(O(),F("div",By,"暂无记录")):Ee("",!0),(O(!0),F(je,null,it(a.value,Y=>(O(),F("div",{key:Y.id,class:"item"},[u("div",Uy,[u("span",qy,ne(Kt(Xo)(Y.category)),1),u("span",{class:"item-content",title:"点击编辑",onClick:Pe=>W(Y)},ne(Y.content),9,Hy),Y.project_id?(O(),F("span",Wy,ne(A(Y.project_id)),1)):Ee("",!0),Y.minutes?(O(),F("span",zy,ne(Y.minutes)+" 分钟",1)):Ee("",!0),H[39]||(H[39]=u("span",{class:"flex1"},null,-1)),u("button",{class:"icon-btn",title:"编辑完整信息",onClick:Pe=>W(Y)},[Te(et,{name:"edit",size:14})],8,Gy),u("button",{class:Ze(["icon-btn",{active:Y.is_milestone===1}]),title:"成果标记",onClick:Pe=>le(Y)},[Te(et,{name:"star",size:14})],10,Yy),u("button",{class:Ze(["icon-btn",{"active-warn":Y.needs_followup===1}]),title:"待跟进",onClick:Pe=>ge(Y)},[Te(et,{name:"flag",size:14})],10,Jy),u("button",{class:"icon-btn",title:"删除",onClick:Pe=>me.value=Y},[Te(et,{name:"close",size:14})],8,Xy)]),Y.takeaway||Y.remark?(O(),F("div",Qy,[Y.takeaway?(O(),F("div",Zy,"收获:"+ne(Y.takeaway),1)):Ee("",!0),Y.remark?(O(),F("div",eg,"备注:"+ne(Y.remark),1)):Ee("",!0)])):Ee("",!0)]))),128)),a.value.length?(O(),F("div",tg,[rn(" 共 "+ne(a.value.length)+" 条事项 ",1),Z.value?(O(),F(je,{key:0},[rn(" · "+ne((Z.value/60).toFixed(1))+" 小时",1)],64)):Ee("",!0)])):Ee("",!0)]),Te(ur,{open:!!me.value,title:"删除确认",message:me.value?"将删除工作记录「"+me.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:H[17]||(H[17]=Y=>me.value=null),onConfirm:ae},null,8,["open","message"]),Te(ur,{open:X.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:H[18]||(H[18]=Y=>X.value=!1),onConfirm:H[19]||(H[19]=Y=>ee(!0))},null,8,["open"]),Te(_v,{open:!!b.value,item:b.value,projects:c.value,date:e.date,onCancel:H[20]||(H[20]=Y=>b.value=null),onSave:re},null,8,["open","item","projects","date"])]))}}),Af=Qt(ng,[["__scopeId","data-v-2e90c9d8"]]),rg={class:"cal-page"},sg={class:"cal-toolbar"},og={class:"cal-title num"},ig={class:"cal-head"},ag={class:"cal-grid"},lg=["title","onClick"],ug={class:"cal-marks"},cg={key:0,class:"drawer"},fg={class:"drawer-head"},dg={class:"drawer-body"},pg=Ht({__name:"CalendarView",setup(e){const t=N(Ct()),n=ut(()=>Number(t.value.slice(0,4))),s=ut(()=>Number(t.value.slice(5,7))-1),o=ut(()=>n.value+" 年 "+(s.value+1)+" 月"),a=["一","二","三","四","五","六","日"],c=ut(()=>{const X=(new Date(n.value,s.value,1).getDay()+6)%7,fe=new Date(n.value,s.value+1,0).getDate(),ie=[];for(let ee=0;ee<X;ee++)ie.push({date:"",inMonth:!1,weekend:!1});for(let ee=1;ee<=fe;ee++){const M=new Date(n.value,s.value,ee),S=M.getDay();ie.push({date:Vn(M),inMonth:!0,weekend:S===0||S===6})}return ie}),d=N(new Map),h=Ct();async function y(){var oe;const R=Vn(new Date(n.value,s.value,1)),X=Vn(new Date(n.value,s.value+1,0)),fe=await Promise.all([Dr(),ki(R,X),xi(R,X)]),ie=fe[0],ee=new Map(fe[1].map(be=>[be.date,be])),M=fe[2],S=new Map;for(const be of c.value){if(!be.inMonth)continue;const z=zs(ee.get(be.date),be.date,ie,be.date===h),xe=M.filter(Le=>Le.date===be.date);S.set(be.date,{status:z.status,label:z.label,location:((oe=ee.get(be.date))==null?void 0:oe.location)||"",hasLog:xe.length>0,hasMilestone:xe.some(Le=>Le.is_milestone===1)})}d.value=S}mt([n,s],y,{immediate:!0}),mt(Ws,()=>{y()});function m(R){var X;return((X=d.value.get(R))==null?void 0:X.status)??""}function _(R){const X=d.value.get(R);return X?R+" · "+X.label+(X.location?" · "+X.location:""):R}function C(R){var X;return!!((X=d.value.get(R))!=null&&X.hasLog)}function A(R){var X;return!!((X=d.value.get(R))!=null&&X.hasMilestone)}function V(){t.value=Qo(t.value,-1)}function Z(){t.value=Qo(t.value,1)}function te(){t.value=Ct()}const ue=N(null);function P(R,X){X&&(ue.value=R)}return mt(Ka,R=>{R&&(t.value=R,ue.value=R,Ka.value=null)},{immediate:!0}),(R,X)=>(O(),F("div",rg,[u("div",sg,[u("button",{class:"icon-btn",onClick:V},[Te(et,{name:"chevron-left",size:16})]),u("span",og,ne(o.value),1),u("button",{class:"icon-btn",onClick:Z},[Te(et,{name:"chevron-right",size:16})]),u("button",{class:"btn btn-sm",onClick:te},"回到今天")]),u("div",ig,[(O(),F(je,null,it(a,fe=>u("span",{key:fe,class:"cal-week muted"},ne(fe),1)),64))]),u("div",ag,[(O(!0),F(je,null,it(c.value,(fe,ie)=>(O(),F("button",{key:ie,class:Ze(["cal-cell",{blank:!fe.inMonth,weekend:fe.weekend,selected:ue.value===fe.date}]),title:fe.inMonth?_(fe.date):void 0,onClick:ee=>P(fe.date,fe.inMonth)},[fe.inMonth?(O(),F(je,{key:0},[u("span",{class:Ze(["daynum num",{today:fe.date===Kt(h)}])},ne(Number(fe.date.slice(8,10))),3),u("span",ug,[m(fe.date)?(O(),F("span",{key:0,class:Ze(["dot",m(fe.date)])},null,2)):Ee("",!0),C(fe.date)?(O(),Lt(et,{key:1,name:"check-circle",size:12,class:"mark-log"})):Ee("",!0),A(fe.date)?(O(),Lt(et,{key:2,name:"star",size:12,class:"mark-star"})):Ee("",!0)])],64)):Ee("",!0)],10,lg))),128))]),Te(ss,{name:"drawer"},{default:fr(()=>[ue.value?(O(),F("aside",cg,[u("div",fg,[X[1]||(X[1]=u("span",{class:"drawer-title"},"当日详情",-1)),u("button",{class:"icon-btn",onClick:X[0]||(X[0]=fe=>ue.value=null)},[Te(et,{name:"close",size:16})])]),u("div",dg,[Te(Af,{date:ue.value},null,8,["date"])])])):Ee("",!0)]),_:1})]))}}),hg=Qt(pg,[["__scopeId","data-v-2404dfbe"]]),vg={class:"detail-page"},mg={class:"detail-toolbar"},yg=["value"],gg=["disabled"],bg=Ht({__name:"TodayView",setup(e){const t=N(Ct()),n=ut(()=>t.value===Ct());function s(){t.value=Fn(t.value,-1)}function o(){t.value=Fn(t.value,1)}function a(){t.value=Ct()}function c(d){const h=d.target.value;h&&(t.value=h)}return(d,h)=>(O(),F("div",vg,[u("div",mg,[u("button",{class:"icon-btn",title:"前一天",onClick:s},[Te(et,{name:"chevron-left",size:16})]),u("span",{class:Ze(["date-title num",{"is-today":n.value}])},ne(Kt(uf)(t.value)),3),u("button",{class:"icon-btn",title:"后一天",onClick:o},[Te(et,{name:"chevron-right",size:16})]),u("input",{type:"date",class:"input w-date",value:t.value,onChange:c},null,40,yg),u("button",{class:"btn btn-sm",disabled:n.value,onClick:a},"回到今天",8,gg)]),Te(Af,{date:t.value},null,8,["date"])]))}}),wg=Qt(bg,[["__scopeId","data-v-76243d98"]]),_g={class:"stats"},kg={class:"cards"},xg={class:"card stat-card"},Cg={class:"stat-num num"},Sg={class:"card stat-card"},Eg={class:"stat-num num"},$g={class:"card stat-card"},Tg={class:"stat-num num"},Ag={class:"card stat-card"},Pg={class:"stat-num num"},Og={class:"card section"},Mg={class:"heat"},Ig=["title"],jg={class:"two-col"},Dg={class:"card section"},Lg={class:"bar-label"},Rg={class:"bar-track"},Kg={class:"muted num bar-num"},Fg={key:0,class:"muted"},Ng={class:"card section"},Vg={class:"bar-label"},Bg={class:"bar-track"},Ug={class:"muted num bar-num"},qg={key:0,class:"muted"},Hg={class:"card section"},Wg={class:"bar-label loc-label"},zg={class:"bar-track"},Gg={class:"muted num bar-num"},Yg={key:0,class:"muted"},Jg=Ht({__name:"StatsView",setup(e){const t=N({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=N([]),s=N([]),o=N([]),a=N([]);async function c(){const y=Ct(),m="2000-01-01",_=await Promise.all([Dr(),ki(m,y),xi(m,y),Ns(!0)]),C=_[0],A=_[1],V=_[2],Z=_[3],te=A.filter(z=>z.clock_in_at||z.kind==="makeup");let ue=0;for(const z of te){const xe=zs(z,z.date,C,z.date===y);ue+=xe.workedMinutes??0}const P=new Set(V.map(z=>z.date));let R=0,X=y;for(P.has(X)||(X=Fn(y,-1));P.has(X);)R++,X=Fn(X,-1);t.value={attendDays:te.length,totalHours:(ue/60).toFixed(1),itemCount:V.length,streak:R};const fe=new Map;for(const z of te){const xe=z.location||"未记录";fe.set(xe,(fe.get(xe)||0)+1)}a.value=Array.from(fe.entries()).map(z=>({name:z[0],count:z[1],percent:Math.round(z[1]/(te.length||1)*100)})).sort((z,xe)=>xe.count-z.count);const ie=V.length||1;s.value=Hs.map(z=>{const xe=V.filter(Le=>Le.category===z.key).length;return{key:z.key,label:z.label,count:xe,percent:Math.round(xe/ie*100)}}).filter(z=>z.count>0).sort((z,xe)=>xe.count-z.count);const ee=new Map(Z.map(z=>[z.id,z.name])),M=new Map;for(const z of V){const xe=z.project_id?ee.get(z.project_id)||"已删除项目":"无项目";M.set(xe,(M.get(xe)||0)+1)}o.value=Array.from(M.entries()).map(z=>({name:z[0],count:z[1],percent:Math.round(z[1]/ie*100)})).sort((z,xe)=>xe.count-z.count);const S=new Map;for(const z of V)S.set(z.date,(S.get(z.date)||0)+1);const oe=Ts(y),be=[];for(let z=11;z>=0;z--){const xe=Fn(oe,-7*z),Le=[];for(let rt=0;rt<7;rt++){const He=Fn(xe,rt);Le.push({date:He,count:S.get(He)||0})}be.push(Le)}n.value=be}yn(async()=>{await c()}),mt(Ws,()=>{c()});function d(y){return y===0?0:y===1?1:y<=3?2:y<=5?3:4}function h(y,m){return y+" · "+(m?m+" 条":"无记录")}return(y,m)=>(O(),F("div",_g,[u("div",kg,[u("div",xg,[m[0]||(m[0]=u("div",{class:"muted"},"出勤天数",-1)),u("div",Cg,ne(t.value.attendDays),1)]),u("div",Sg,[m[1]||(m[1]=u("div",{class:"muted"},"累计工时(小时)",-1)),u("div",Eg,ne(t.value.totalHours),1)]),u("div",$g,[m[2]||(m[2]=u("div",{class:"muted"},"记录条数",-1)),u("div",Tg,ne(t.value.itemCount),1)]),u("div",Ag,[m[3]||(m[3]=u("div",{class:"muted"},"连续记录(天)",-1)),u("div",Pg,ne(t.value.streak),1)])]),u("div",Og,[m[4]||(m[4]=u("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),u("div",Mg,[(O(!0),F(je,null,it(n.value,(_,C)=>(O(),F("div",{key:C,class:"heat-col"},[(O(!0),F(je,null,it(_,A=>(O(),F("span",{key:A.date,class:Ze(["heat-cell","lv"+d(A.count)]),title:h(A.date,A.count)},null,10,Ig))),128))]))),128))]),m[5]||(m[5]=Up('<div class="heat-legend muted" data-v-73e5ba49><span data-v-73e5ba49>少</span><span class="heat-cell lv0" data-v-73e5ba49></span><span class="heat-cell lv1" data-v-73e5ba49></span><span class="heat-cell lv2" data-v-73e5ba49></span><span class="heat-cell lv3" data-v-73e5ba49></span><span class="heat-cell lv4" data-v-73e5ba49></span><span data-v-73e5ba49>多</span></div>',1))]),u("div",jg,[u("div",Dg,[m[6]||(m[6]=u("div",{class:"section-title"},"分类分布",-1)),(O(!0),F(je,null,it(s.value,_=>(O(),F("div",{key:_.key,class:"bar-row"},[u("span",Lg,ne(_.label),1),u("span",Rg,[u("span",{class:"bar-fill",style:rr({width:_.percent+"%"})},null,4)]),u("span",Kg,ne(_.count)+" 条 · "+ne(_.percent)+"%",1)]))),128)),s.value.length?Ee("",!0):(O(),F("div",Fg,"暂无数据"))]),u("div",Ng,[m[7]||(m[7]=u("div",{class:"section-title"},"项目投入",-1)),(O(!0),F(je,null,it(o.value,_=>(O(),F("div",{key:_.name,class:"bar-row"},[u("span",Vg,ne(_.name),1),u("span",Bg,[u("span",{class:"bar-fill",style:rr({width:_.percent+"%"})},null,4)]),u("span",Ug,ne(_.count)+" 条 · "+ne(_.percent)+"%",1)]))),128)),o.value.length?Ee("",!0):(O(),F("div",qg,"暂无数据"))])]),u("div",Hg,[m[8]||(m[8]=u("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(O(!0),F(je,null,it(a.value,_=>(O(),F("div",{key:_.name,class:"bar-row"},[u("span",Wg,ne(_.name),1),u("span",zg,[u("span",{class:"bar-fill",style:rr({width:_.percent+"%"})},null,4)]),u("span",Gg,ne(_.count)+" 天 · "+ne(_.percent)+"%",1)]))),128)),a.value.length?Ee("",!0):(O(),F("div",Yg,"暂无数据"))])]))}}),Xg=Qt(Jg,[["__scopeId","data-v-73e5ba49"]]);async function Qg(e,t,n){const s=Ct(),o=await Promise.all([Dr(),ki(e,t),xi(e,t),Ns(!0),Pm(e,t)]),a=o[0],c=o[1],d=o[2],h=o[3],y=o[4];let m=0,_=0,C=0;for(const M of c){(M.clock_in_at||M.kind==="makeup")&&m++,M.kind==="makeup"&&C++;const S=zs(M,M.date,a,M.date===s);_+=S.workedMinutes??0}const A=new Map;for(const M of c){if(!(M.clock_in_at||M.kind==="makeup"))continue;const S=M.location||"未记录";A.set(S,(A.get(S)||0)+1)}const V=Array.from(A.entries()).map(M=>({name:M[0],count:M[1]})).sort((M,S)=>S.count-M.count),Z=d.length||1,te=Hs.map(M=>{const S=d.filter(oe=>oe.category===M.key).length;return{key:M.key,label:M.label,count:S,percent:Math.round(S/Z*100)}}).filter(M=>M.count>0).sort((M,S)=>S.count-M.count),ue=new Map(h.map(M=>[M.id,M.name])),P=new Map;for(const M of d){const S=M.project_id?ue.get(M.project_id)||"已删除项目":"无项目";P.set(S,(P.get(S)||0)+1)}const R=Array.from(P.entries()).map(M=>({name:M[0],count:M[1]})).sort((M,S)=>S.count-M.count),X=d.filter(M=>M.is_milestone===1).map(M=>({date:M.date,content:M.content})),fe=d.filter(M=>M.needs_followup===1).map(M=>({date:M.date,content:M.content,remark:M.remark||""})),ie=d.filter(M=>!!M.takeaway).map(M=>({date:M.date,text:M.takeaway})),ee=y.map(M=>({weekStart:M.week_start,highlights:M.highlights||"",challenges:M.challenges||"",plan_next:M.plan_next||""}));return{range:{start:e,end:t,label:n},attendDays:m,totalHours:(_/60).toFixed(1),makeupCount:C,leaveCount:c.filter(M=>M.kind==="leave").length,itemCount:d.length,categoryStats:te,projectStats:R,locationStats:V,milestones:X,followups:fe,takeaways:ie,weekNotes:ee}}function Zg(e){const t=[];t.push("# 实习工作总结("+e.range.start+" ~ "+e.range.end+")"),t.push(""),t.push("## 一、考勤概况"),t.push(""),t.push("出勤 "+e.attendDays+" 天,累计工时 "+e.totalHours+" 小时,补卡 "+e.makeupCount+" 次"+(e.leaveCount?",请假 "+e.leaveCount+" 天":""));const n=e.locationStats.filter(s=>s.name!=="未记录");n.length&&t.push("其中:"+n.map(s=>s.name+" "+s.count+" 天").join(",")),t.push(""),t.push("## 二、工作内容分布"),t.push(""),t.push(e.categoryStats.length?e.categoryStats.map(s=>s.label+" "+s.percent+"%("+s.count+" 条)").join(","):"(无记录)"),t.push(""),t.push("## 三、项目投入"),t.push(""),t.push(e.projectStats.length?e.projectStats.map(s=>s.name+" "+s.count+" 条").join(","):"(无记录)"),t.push(""),t.push("## 四、主要成果"),t.push(""),e.milestones.length?e.milestones.forEach((s,o)=>t.push(o+1+". 【成果】"+s.content+"("+s.date+")")):t.push("(无)"),t.push(""),t.push("## 五、待跟进事项"),t.push(""),e.followups.length?e.followups.forEach(s=>t.push("- 【待跟进】"+s.content+(s.remark?"("+s.date+" 备注:"+s.remark+")":"("+s.date+")"))):t.push("(无)"),t.push(""),t.push("## 六、学习与成长"),t.push(""),e.takeaways.length?e.takeaways.forEach(s=>t.push("- "+s.text+"("+s.date+")")):t.push("(无)");for(const s of e.weekNotes)t.push(""),t.push("### 周记("+s.weekStart+" 起)"),t.push(""),t.push("- 本周亮点:"+(s.highlights||"(无)")),t.push("- 踩的坑:"+(s.challenges||"(无)")),t.push("- 下周计划:"+(s.plan_next||"(无)"));return t.push(""),t.join(`
`)}const eb="modulepreload",tb=function(e,t){return new URL(e,t).href},Fu={},Pf=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=Promise.allSettled(n.map(y=>{if(y=tb(y,s),y in Fu)return;Fu[y]=!0;const m=y.endsWith(".css"),_=m?'[rel="stylesheet"]':"";if(!!s)for(let V=c.length-1;V>=0;V--){const Z=c[V];if(Z.href===y&&(!m||Z.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${_}`))return;const A=document.createElement("link");if(A.rel=m?"stylesheet":eb,m||(A.as="script"),A.crossOrigin="",A.href=y,h&&A.setAttribute("nonce",h),document.head.appendChild(A),m)return new Promise((V,Z)=>{A.addEventListener("load",V),A.addEventListener("error",()=>Z(new Error(`Unable to preload CSS for ${y}`)))})}))}function a(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return o.then(c=>{for(const d of c||[])d.status==="rejected"&&a(d.reason);return t().catch(a)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const nb=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},s=(a,c)=>{n.platforms.set(a,c)},o=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))};return n.addPlatform=s,n.setPlatform=o,n},rb=e=>e.CapacitorPlatforms=nb(e),Of=rb(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});Of.addPlatform;Of.setPlatform;var ts;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(ts||(ts={}));class ma extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const sb=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},ob=e=>{var t,n,s,o,a;const c=e.CapacitorCustomPlatform||null,d=e.Capacitor||{},h=d.Plugins=d.Plugins||{},y=e.CapacitorPlatforms,m=()=>c!==null?c.name:sb(e),_=((t=y==null?void 0:y.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||m,C=()=>_()!=="web",A=((n=y==null?void 0:y.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||C,V=ee=>{const M=X.get(ee);return!!(M!=null&&M.platforms.has(_())||ue(ee))},Z=((s=y==null?void 0:y.currentPlatform)===null||s===void 0?void 0:s.isPluginAvailable)||V,te=ee=>{var M;return(M=d.PluginHeaders)===null||M===void 0?void 0:M.find(S=>S.name===ee)},ue=((o=y==null?void 0:y.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||te,P=ee=>e.console.error(ee),R=(ee,M,S)=>Promise.reject(`${S} does not have an implementation of "${M}".`),X=new Map,fe=(ee,M={})=>{const S=X.get(ee);if(S)return console.warn(`Capacitor plugin "${ee}" already registered. Cannot register plugins twice.`),S.proxy;const oe=_(),be=ue(ee);let z;const xe=async()=>(!z&&oe in M?z=typeof M[oe]=="function"?z=await M[oe]():z=M[oe]:c!==null&&!z&&"web"in M&&(z=typeof M.web=="function"?z=await M.web():z=M.web),z),Le=(qe,Qe)=>{var Ce,J;if(be){const Q=be==null?void 0:be.methods.find(ke=>Qe===ke.name);if(Q)return Q.rtype==="promise"?ke=>d.nativePromise(ee,Qe.toString(),ke):(ke,Fe)=>d.nativeCallback(ee,Qe.toString(),ke,Fe);if(qe)return(Ce=qe[Qe])===null||Ce===void 0?void 0:Ce.bind(qe)}else{if(qe)return(J=qe[Qe])===null||J===void 0?void 0:J.bind(qe);throw new ma(`"${ee}" plugin is not implemented on ${oe}`,ts.Unimplemented)}},rt=qe=>{let Qe;const Ce=(...J)=>{const Q=xe().then(ke=>{const Fe=Le(ke,qe);if(Fe){const ct=Fe(...J);return Qe=ct==null?void 0:ct.remove,ct}else throw new ma(`"${ee}.${qe}()" is not implemented on ${oe}`,ts.Unimplemented)});return qe==="addListener"&&(Q.remove=async()=>Qe()),Q};return Ce.toString=()=>`${qe.toString()}() { [capacitor code] }`,Object.defineProperty(Ce,"name",{value:qe,writable:!1,configurable:!1}),Ce},He=rt("addListener"),Ye=rt("removeListener"),Ke=(qe,Qe)=>{const Ce=He({eventName:qe},Qe),J=async()=>{const ke=await Ce;Ye({eventName:qe,callbackId:ke},Qe)},Q=new Promise(ke=>Ce.then(()=>ke({remove:J})));return Q.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await J()},Q},st=new Proxy({},{get(qe,Qe){switch(Qe){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return be?Ke:He;case"removeListener":return Ye;default:return rt(Qe)}}});return h[ee]=st,X.set(ee,{name:ee,proxy:st,platforms:new Set([...Object.keys(M),...be?[oe]:[]])}),st},ie=((a=y==null?void 0:y.currentPlatform)===null||a===void 0?void 0:a.registerPlugin)||fe;return d.convertFileSrc||(d.convertFileSrc=ee=>ee),d.getPlatform=_,d.handleError=P,d.isNativePlatform=A,d.isPluginAvailable=Z,d.pluginMethodNoop=R,d.registerPlugin=ie,d.Exception=ma,d.DEBUG=!!d.DEBUG,d.isLoggingEnabled=!!d.isLoggingEnabled,d.platform=d.getPlatform(),d.isNative=d.isNativePlatform(),d},ib=e=>e.Capacitor=ob(e),ns=ib(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Mf=ns.registerPlugin;ns.Plugins;class If{constructor(t){this.listeners={},this.retainedEventArguments={},this.windowListeners={},t&&(console.warn(`Capacitor WebPlugin "${t.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=t)}addListener(t,n){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),s&&this.sendRetainedArgumentsForEvent(t);const c=async()=>this.removeListener(t,n);return Promise.resolve({remove:c})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,s){const o=this.listeners[t];if(!o){if(s){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}o.forEach(a=>a(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:s=>{this.notifyListeners(n,s)}}}unimplemented(t="not implemented"){return new ns.Exception(t,ts.Unimplemented)}unavailable(t="not available"){return new ns.Exception(t,ts.Unavailable)}async removeListener(t,n){const s=this.listeners[t];if(!s)return;const o=s.indexOf(n);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(s=>{this.notifyListeners(t,s)}))}}const Nu=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Vu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ab extends If{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[o,a]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=Vu(o).trim(),a=Vu(a).trim(),n[o]=a}),n}async setCookie(t){try{const n=Nu(t.key),s=Nu(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,a=(t.path||"/").replace("path=",""),c=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${s||""}${o}; path=${a}; ${c};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Mf("CapacitorCookies",{web:()=>new ab});const lb=async e=>new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const o=s.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},s.onerror=o=>n(o),s.readAsDataURL(e)}),ub=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,a,c)=>(o[a]=e[t[c]],o),{})},cb=(e,t=!0)=>e?Object.entries(e).reduce((s,o)=>{const[a,c]=o;let d,h;return Array.isArray(c)?(h="",c.forEach(y=>{d=t?encodeURIComponent(y):y,h+=`${a}=${d}&`}),h.slice(0,-1)):(d=t?encodeURIComponent(c):c,h=`${a}=${d}`),`${s}&${h}`},"").substr(1):null,fb=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=ub(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[c,d]of Object.entries(e.data||{}))a.set(c,d);n.body=a.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((d,h)=>{a.append(h,d)});else for(const d of Object.keys(e.data))a.append(d,e.data[d]);n.body=a;const c=new Headers(n.headers);c.delete("content-type"),n.headers=c}else(o.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class db extends If{async request(t){const n=fb(t,t.webFetchExtra),s=cb(t.params,t.shouldEncodeUrlParams),o=s?`${t.url}?${s}`:t.url,a=await fetch(o,n),c=a.headers.get("content-type")||"";let{responseType:d="text"}=a.ok?t:{};c.includes("application/json")&&(d="json");let h,y;switch(d){case"arraybuffer":case"blob":y=await a.blob(),h=await lb(y);break;case"json":h=await a.json();break;case"document":case"text":default:h=await a.text()}const m={};return a.headers.forEach((_,C)=>{m[C]=_}),{data:h,headers:m,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Mf("CapacitorHttp",{web:()=>new db});async function ml(e,t){const n=window;if(n.electronAPI&&n.electronAPI.saveFile){const c=await n.electronAPI.saveFile(e,t);return c&&c.saved?c.path:""}if(ns.isNativePlatform()){const{Filesystem:c,Directory:d,Encoding:h}=await Pf(async()=>{const{Filesystem:y,Directory:m,Encoding:_}=await import("./index-DPm5Ta-6.js");return{Filesystem:y,Directory:m,Encoding:_}},[],import.meta.url);try{return(await c.writeFile({path:e,data:t,directory:d.Documents,encoding:h.UTF8,recursive:!0})).uri}catch{return(await c.writeFile({path:e,data:t,directory:d.Cache,encoding:h.UTF8,recursive:!0})).uri}}const s=new Blob([t],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(s),a=document.createElement("a");return a.href=o,a.download=e,a.click(),window.setTimeout(()=>URL.revokeObjectURL(o),1e4),""}const pb=Object.freeze(Object.defineProperty({__proto__:null,downloadText:ml},Symbol.toStringTag,{value:"Module"}));async function qa(e){try{await navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}async function hb(e){const t=await Promise.all([bt("ai_base_url",""),bt("ai_api_key",""),bt("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),s=t[1].trim(),o=t[2].trim();if(!n||!o)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const a=n+"/chat/completions",c={"Content-Type":"application/json"};s&&(c.Authorization="Bearer "+s);const h=JSON.stringify({model:o,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let y;try{y=await fetch(a,{method:"POST",headers:c,body:h})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!y.ok){let C="接口返回 "+y.status;try{const A=await y.json();A&&A.error&&A.error.message&&(C+=":"+A.error.message)}catch{}throw new Error(C)}const m=await y.json(),_=m&&m.choices&&m.choices[0]&&m.choices[0].message&&m.choices[0].message.content;if(!_)throw new Error("接口未返回内容");return String(_)}const vb={class:"report"},mb={class:"report-toolbar"},yb={class:"seg"},gb=["onClick"],bb=["disabled"],wb=["disabled"],_b={key:0,class:"ai-error"},kb={class:"report-grid"},xb={class:"report-left"},Cb={class:"card section"},Sb={class:"section-title"},Eb={class:"muted note-saved"},$b={class:"card section"},Tb={class:"report-right"},Ab={key:0,class:"card section"},Pb={class:"sum-row"},Ob={class:"num"},Mb={class:"sum-row"},Ib={class:"num"},jb={class:"sum-row"},Db={class:"num"},Lb={class:"sum-row"},Rb={class:"num"},Kb={class:"sum-row"},Fb={class:"num"},Nb={class:"muted"},Vb={class:"num"},Bb={key:0,class:"muted sum-empty"},Ub={class:"muted"},qb={key:1,class:"muted sum-empty"},Hb={class:"muted"},Wb={key:2,class:"muted sum-empty"},zb={class:"muted"},Gb={key:3,class:"muted sum-empty"},Yb=Ht({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=N("week"),s=N(Ts(Ct())),o=N(Ct()),a=N(null),c=N(""),d=N(!1),h=N(!1),y=N(null),m=N(""),_=N(Ts(Ct())),C=N(""),A=N(""),V=N(""),Z=N(!1);async function te(){const M=await vl(_.value);C.value=(M==null?void 0:M.highlights)||"",A.value=(M==null?void 0:M.challenges)||"",V.value=(M==null?void 0:M.plan_next)||"",Z.value=!1}async function ue(){await Am(_.value,{highlights:C.value.trim()||null,challenges:A.value.trim()||null,plan_next:V.value.trim()||null}),Z.value=!0,await R()}function P(M){const S=Ct();if(M==="week"){const oe=Ts(S);return{start:oe,end:Fn(oe,6),label:"本周"}}if(M==="month"){const oe=S.slice(0,7);return{start:oe+"-01",end:S,label:oe+" 本月"}}return M==="all"?{start:"2000-01-01",end:S,label:"全部实习期"}:{start:s.value,end:o.value,label:s.value+" ~ "+o.value}}async function R(){d.value=!0;const M=P(n.value),S=await Qg(M.start,M.end,M.label);a.value=S,c.value=Zg(S),d.value=!1}mt(n,R),mt([s,o],()=>{n.value==="custom"&&R()}),yn(async()=>{await te(),await R()});async function X(){const M=Ct().replace(/-/g,""),S=await ml("实习工作总结_"+M+".md",c.value);Ve(S?"总结已导出到:"+S:"总结已导出到系统下载目录")}async function fe(){await qa(c.value),Ve("总结已复制到剪贴板")}async function ie(){if(h.value)return;m.value="";const M=c.value.trim();if(!M){m.value="当前草稿为空,无法润色";return}h.value=!0;try{y.value=c.value,c.value=await hb(M),Ve("AI 润色完成")}catch(S){y.value=null,m.value=S instanceof Error?S.message:"润色失败"}h.value=!1}function ee(){y.value!==null&&(c.value=y.value),y.value=null}return(M,S)=>(O(),F("div",vb,[u("div",mb,[u("div",yb,[(O(),F(je,null,it(t,oe=>u("button",{key:oe.key,class:Ze(["seg-btn",{active:n.value===oe.key}]),onClick:be=>n.value=oe.key},ne(oe.label),11,gb)),64))]),n.value==="custom"?(O(),F(je,{key:0},[Ae(u("input",{type:"date",class:"input w-date","onUpdate:modelValue":S[0]||(S[0]=oe=>s.value=oe)},null,512),[[De,s.value]]),S[6]||(S[6]=u("span",{class:"muted"},"至",-1)),Ae(u("input",{type:"date",class:"input w-date","onUpdate:modelValue":S[1]||(S[1]=oe=>o.value=oe)},null,512),[[De,o.value]])],64)):Ee("",!0),S[10]||(S[10]=u("span",{class:"flex1"},null,-1)),u("button",{class:"btn btn-sm",disabled:h.value,onClick:ie},[Te(et,{name:"edit",size:14}),S[7]||(S[7]=rn("AI 润色 ",-1))],8,bb),y.value!==null?(O(),F("button",{key:1,class:"btn btn-sm",onClick:ee},"还原润色前")):Ee("",!0),u("button",{class:"btn btn-sm",disabled:d.value,onClick:R},[Te(et,{name:"edit",size:14}),S[8]||(S[8]=rn("重新生成 ",-1))],8,wb),u("button",{class:"btn btn-sm",onClick:fe},"复制"),u("button",{class:"btn btn-primary btn-sm",onClick:X},[Te(et,{name:"export",size:14}),S[9]||(S[9]=rn("导出 Markdown ",-1))])]),m.value?(O(),F("div",_b,ne(m.value),1)):Ee("",!0),u("div",kb,[u("div",xb,[u("div",Cb,[u("div",Sb,"本周周记("+ne(_.value)+" 起)",1),S[11]||(S[11]=u("label",{class:"note-label muted"},"本周亮点",-1)),Ae(u("textarea",{class:"textarea","onUpdate:modelValue":S[2]||(S[2]=oe=>C.value=oe),placeholder:"本周最有价值的一件事",onBlur:ue},null,544),[[De,C.value]]),S[12]||(S[12]=u("label",{class:"note-label muted"},"踩的坑",-1)),Ae(u("textarea",{class:"textarea","onUpdate:modelValue":S[3]||(S[3]=oe=>A.value=oe),placeholder:"遇到的问题与教训",onBlur:ue},null,544),[[De,A.value]]),S[13]||(S[13]=u("label",{class:"note-label muted"},"下周计划",-1)),Ae(u("textarea",{class:"textarea","onUpdate:modelValue":S[4]||(S[4]=oe=>V.value=oe),placeholder:"下周准备做什么",onBlur:ue},null,544),[[De,V.value]]),u("div",Eb,ne(Z.value?"已保存":"失焦自动保存"),1)]),u("div",$b,[S[14]||(S[14]=u("div",{class:"section-title"},"总结草稿(可编辑)",-1)),Ae(u("textarea",{class:"textarea md-editor","onUpdate:modelValue":S[5]||(S[5]=oe=>c.value=oe),spellcheck:"false"},null,512),[[De,c.value]])])]),u("div",Tb,[a.value?(O(),F("div",Ab,[S[20]||(S[20]=u("div",{class:"section-title"},"数据摘要",-1)),u("div",Pb,[S[15]||(S[15]=u("span",{class:"muted"},"出勤",-1)),u("span",Ob,ne(a.value.attendDays)+" 天",1)]),u("div",Mb,[S[16]||(S[16]=u("span",{class:"muted"},"工时",-1)),u("span",Ib,ne(a.value.totalHours)+" 小时",1)]),u("div",jb,[S[17]||(S[17]=u("span",{class:"muted"},"补卡",-1)),u("span",Db,ne(a.value.makeupCount)+" 次",1)]),u("div",Lb,[S[18]||(S[18]=u("span",{class:"muted"},"请假",-1)),u("span",Rb,ne(a.value.leaveCount)+" 天",1)]),u("div",Kb,[S[19]||(S[19]=u("span",{class:"muted"},"记录",-1)),u("span",Fb,ne(a.value.itemCount)+" 条",1)]),S[21]||(S[21]=u("div",{class:"section-sub"},"分类分布",-1)),(O(!0),F(je,null,it(a.value.categoryStats,oe=>(O(),F("div",{key:oe.key,class:"sum-row"},[u("span",Nb,ne(oe.label),1),u("span",Vb,ne(oe.count)+" 条 · "+ne(oe.percent)+"%",1)]))),128)),a.value.categoryStats.length?Ee("",!0):(O(),F("div",Bb,"(无)")),S[22]||(S[22]=u("div",{class:"section-sub"},"主要成果",-1)),(O(!0),F(je,null,it(a.value.milestones,(oe,be)=>(O(),F("div",{key:"m"+be,class:"sum-item"},[rn(ne(oe.content),1),u("span",Ub,"("+ne(oe.date)+")",1)]))),128)),a.value.milestones.length?Ee("",!0):(O(),F("div",qb,"(无)")),S[23]||(S[23]=u("div",{class:"section-sub"},"待跟进",-1)),(O(!0),F(je,null,it(a.value.followups,(oe,be)=>(O(),F("div",{key:"f"+be,class:"sum-item"},[rn(ne(oe.content),1),u("span",Hb,"("+ne(oe.date)+")",1)]))),128)),a.value.followups.length?Ee("",!0):(O(),F("div",Wb,"(无)")),S[24]||(S[24]=u("div",{class:"section-sub"},"学习与成长",-1)),(O(!0),F(je,null,it(a.value.takeaways,(oe,be)=>(O(),F("div",{key:"t"+be,class:"sum-item"},[rn(ne(oe.text),1),u("span",zb,"("+ne(oe.date)+")",1)]))),128)),a.value.takeaways.length?Ee("",!0):(O(),F("div",Gb,"(无)"))])):Ee("",!0)])])]))}}),Jb=Qt(Yb,[["__scopeId","data-v-43f9c59b"]]),Xb=["aria-label"],Qb={class:"dialog-head"},Zb={class:"dialog-title"},ew={class:"dialog-body"},tw={class:"form-grid"},nw={class:"field span2"},rw={class:"seg"},sw={class:"field"},ow={class:"field"},iw={class:"field"},aw=["value"],lw={key:0,class:"field"},uw={class:"seg"},cw={class:"field span2"},fw={key:0,class:"form-error"},dw={class:"dialog-btns"},pw=Ht({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=N("expense"),a=N("餐饮"),c=N(""),d=N(""),h=N(""),y=N(!1),m=N(!1),_=N(""),C=N(null);function A(ue){n.open&&ue.key==="Escape"&&s("cancel")}mt(()=>n.open,async ue=>{var P;ue?(o.value=n.initial.type==="income"?"income":"expense",a.value=n.initial.category,c.value=n.initial.amountYuan,d.value=n.initial.date,h.value=n.initial.note,y.value=n.initial.reimbursable===1,m.value=n.initial.reimbursed===1,_.value="",window.addEventListener("keydown",A),await rs(),(P=C.value)==null||P.focus()):window.removeEventListener("keydown",A)}),dr(()=>window.removeEventListener("keydown",A)),mt(o,ue=>{a.value=ue==="expense"?zr[0]:Jo[0]});const V=ut(()=>o.value==="expense"?zr:Jo);function Z(){return a.value&&V.value.includes(a.value)?a.value:V.value[0]}function te(){const ue=String(c.value??"").trim(),P=Number(ue);if(!ue||!isFinite(P)||P<=0){_.value="请填写大于 0 的金额";return}if(!d.value){_.value="请选择日期";return}const R=o.value==="expense"&&y.value?1:0;s("save",{type:o.value,category:Z(),amount:Math.round(P*100),date:d.value,note:String(h.value??"").trim(),reimbursable:R,reimbursed:R&&m.value?1:0})}return(ue,P)=>(O(),Lt(Us,{to:"body"},[Te(ss,{name:"modal"},{default:fr(()=>[e.open?(O(),F("div",{key:0,class:"mask",onClick:P[11]||(P[11]=hn(R=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",Qb,[u("span",Zb,ne(e.title),1),u("button",{class:"icon-btn",title:"关闭",onClick:P[0]||(P[0]=R=>s("cancel"))},[Te(et,{name:"close",size:16})])]),u("div",ew,[u("div",tw,[u("div",nw,[P[12]||(P[12]=u("label",null,"类型",-1)),u("div",rw,[u("button",{class:Ze(["seg-btn",{active:o.value==="expense"}]),onClick:P[1]||(P[1]=R=>o.value="expense")},"支出",2),u("button",{class:Ze(["seg-btn",{active:o.value==="income"}]),onClick:P[2]||(P[2]=R=>o.value="income")},"收入",2)])]),u("div",sw,[P[13]||(P[13]=u("label",null,"金额(元,必填)",-1)),Ae(u("input",{ref_key:"amountInput",ref:C,class:Ze(["input",{invalid:_.value}]),"onUpdate:modelValue":P[3]||(P[3]=R=>c.value=R),type:"number",min:"0",step:"0.01",placeholder:"0.00"},null,2),[[De,c.value]])]),u("div",ow,[P[14]||(P[14]=u("label",null,"日期(必填)",-1)),Ae(u("input",{class:"input",type:"date","onUpdate:modelValue":P[4]||(P[4]=R=>d.value=R)},null,512),[[De,d.value]])]),u("div",iw,[P[15]||(P[15]=u("label",null,"分类",-1)),Ae(u("select",{class:"select","onUpdate:modelValue":P[5]||(P[5]=R=>a.value=R)},[(O(!0),F(je,null,it(V.value,R=>(O(),F("option",{key:R,value:R},ne(R),9,aw))),128))],512),[[Nn,a.value]])]),o.value==="expense"?(O(),F("div",lw,[P[16]||(P[16]=u("label",null,"报销状态",-1)),u("div",uw,[u("button",{class:Ze(["seg-btn",{active:!y.value}]),onClick:P[6]||(P[6]=R=>{y.value=!1,m.value=!1})},"无需报销",2),u("button",{class:Ze(["seg-btn",{active:y.value&&!m.value}]),onClick:P[7]||(P[7]=R=>{y.value=!0,m.value=!1})},"待报销",2),u("button",{class:Ze(["seg-btn",{active:y.value&&m.value}]),onClick:P[8]||(P[8]=R=>{y.value=!0,m.value=!0})},"已报销",2)])])):Ee("",!0),u("div",cw,[P[17]||(P[17]=u("label",null,"备注",-1)),Ae(u("textarea",{class:"textarea","onUpdate:modelValue":P[9]||(P[9]=R=>h.value=R),placeholder:"选填"},null,512),[[De,h.value]])])]),_.value?(O(),F("div",fw,ne(_.value),1)):Ee("",!0)]),u("div",dw,[u("button",{class:"btn btn-sm",onClick:P[10]||(P[10]=R=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:te},"保存")])],8,Xb)])):Ee("",!0)]),_:1})]))}}),hw=Qt(pw,[["__scopeId","data-v-edca3327"]]),vw={class:"ledger-page"},mw={class:"ledger-toolbar"},yw={class:"month-title num"},gw={class:"cards"},bw={class:"card stat-card"},ww={class:"stat-num num amt-income"},_w={class:"card stat-card"},kw={class:"stat-num num"},xw={class:"card stat-card"},Cw={class:"card stat-card"},Sw={class:"stat-num num amt-warn"},Ew={class:"card sec"},$w={class:"form-grid"},Tw={class:"field span2"},Aw={class:"seg"},Pw={class:"field"},Ow={class:"field"},Mw={class:"field"},Iw=["value"],jw={key:0,class:"field"},Dw={class:"field span2"},Lw={key:0,class:"form-error"},Rw={class:"form-footer"},Kw=["disabled"],Fw=["disabled"],Nw={key:0,class:"card sec"},Vw={class:"bar-label"},Bw={class:"bar-track"},Uw={class:"muted num bar-num"},qw={key:1,class:"card section"},Hw={class:"form-error"},Ww={class:"card table-card"},zw={class:"tx-table"},Gw={class:"num","data-label":"日期"},Yw={"data-label":"分类"},Jw={class:"tag"},Xw={class:"td-note","data-label":"备注"},Qw={"data-label":"报销"},Zw={key:0,class:"muted"},e_={key:1,class:"tx-done"},t_={key:2,class:"tx-pending"},n_={class:"ops-cell"},r_={class:"ops"},s_=["onClick"],o_=["onClick"],i_=["onClick"],a_={key:0},l_={class:"muted vault-note num"},u_=Ht({__name:"LedgerView",setup(e){const t=N(Ct()),n=N([]),s=N(!0),o=N("expense"),a=N(""),c=N(zr[0]),d=N(Ct()),h=N(""),y=N(!1),m=N(""),_=N(""),C=N(!1),A=N(!1),V=N(null),Z=N({type:"expense",category:zr[0],amountYuan:"",date:Ct(),note:"",reimbursable:0,reimbursed:0}),te=N(null),ue=ut(()=>t.value.slice(0,7)+"-01"),P=ut(()=>{const J=Number(t.value.slice(0,4)),Q=Number(t.value.slice(5,7))-1,ke=new Date(J,Q+1,0).getDate();return t.value.slice(0,7)+"-"+(ke<10?"0"+ke:String(ke))}),R=ut(()=>Number(t.value.slice(0,4))+" 年 "+Number(t.value.slice(5,7))+" 月");async function X(){s.value=!0;try{n.value=await Rm(ue.value,P.value),_.value=""}catch(J){_.value="账目加载失败:"+(J instanceof Error?J.stack||J.message:String(J)),Ve("账目加载失败")}s.value=!1}yn(X),mt(t,X),mt(o,J=>{c.value=J==="expense"?zr[0]:Jo[0]});const fe=ut(()=>n.value.slice().sort((J,Q)=>J.date===Q.date?Q.id-J.id:J.date<Q.date?1:-1)),ie=ut(()=>{let J=0,Q=0,ke=0;for(const Fe of n.value)Fe.type==="income"?J+=Fe.amount:(Q+=Fe.amount,Fe.reimbursable===1&&Fe.reimbursed!==1&&(ke+=Fe.amount));return{income:J,expense:Q,pending:ke,balance:J-Q}}),ee=N("all"),M=N("all"),S=ut(()=>fe.value.filter(J=>!(ee.value!=="all"&&J.type!==ee.value||M.value==="pending"&&!(J.type==="expense"&&J.reimbursable===1&&J.reimbursed!==1)||M.value==="done"&&!(J.reimbursable===1&&J.reimbursed===1)))),oe=ut(()=>{const J=new Map;let Q=0;for(const Fe of n.value)Fe.type==="expense"&&(J.set(Fe.category,(J.get(Fe.category)||0)+Fe.amount),Q+=Fe.amount);const ke=Q||1;return Array.from(J.entries()).map(Fe=>({name:Fe[0],amount:Fe[1],percent:Math.round(Fe[1]/ke*100)})).sort((Fe,ct)=>ct.amount-Fe.amount)});function be(J){return(J/100).toFixed(2)}function z(J){return(J.type==="income"?"+":"-")+be(J.amount)}function xe(){t.value=Qo(t.value,-1)}function Le(){t.value=Qo(t.value,1)}function rt(){t.value=Ct()}mt(a,()=>{m.value&&(m.value="")});async function He(){const J=String(a.value??"").trim(),Q=Number(J);if(!J||!isFinite(Q)||Q<=0){m.value="请填写大于 0 的金额";return}if(!d.value){m.value="请选择日期";return}if(!C.value){C.value=!0;try{await Km({type:o.value,category:c.value,amount:Math.round(Q*100),date:d.value,note:String(h.value??"").trim(),reimbursable:o.value==="expense"&&y.value?1:0,reimbursed:0})}catch(ke){Ve("添加失败:"+(ke instanceof Error?ke.message:String(ke))),C.value=!1;return}a.value="",h.value="",y.value=!1,m.value="",await X(),Ve("记账已添加"),C.value=!1}}const Ye=ut(()=>String(a.value??"").trim()!==""||String(h.value??"").trim()!=="");function Ke(){a.value="",h.value="",y.value=!1,m.value=""}async function st(J){await Vm(J.id),await X(),Ve("已标记为已报销")}function qe(J){V.value=J.id,Z.value={type:J.type,category:J.category,amountYuan:be(J.amount),date:J.date,note:J.note||"",reimbursable:J.reimbursable,reimbursed:J.reimbursed},A.value=!0}async function Qe(J){const Q=V.value;await Fm(Q,J),A.value=!1,await X(),Ve("账目已更新")}async function Ce(){te.value&&te.value.id&&await Nm(te.value.id),te.value=null,await X(),Ve("账目已删除")}return(J,Q)=>(O(),F("div",vw,[u("div",mw,[u("button",{class:"icon-btn",onClick:xe},[Te(et,{name:"chevron-left",size:16})]),u("span",yw,ne(R.value),1),u("button",{class:"icon-btn",onClick:Le},[Te(et,{name:"chevron-right",size:16})]),u("button",{class:"btn btn-sm",onClick:rt},"回到本月"),Q[13]||(Q[13]=u("span",{class:"flex1"},null,-1)),Ae(u("select",{class:"select w-filter","onUpdate:modelValue":Q[0]||(Q[0]=ke=>ee.value=ke)},[...Q[11]||(Q[11]=[u("option",{value:"all"},"全部类型",-1),u("option",{value:"expense"},"仅支出",-1),u("option",{value:"income"},"仅收入",-1)])],512),[[Nn,ee.value]]),Ae(u("select",{class:"select w-filter","onUpdate:modelValue":Q[1]||(Q[1]=ke=>M.value=ke)},[...Q[12]||(Q[12]=[u("option",{value:"all"},"全部报销",-1),u("option",{value:"pending"},"待报销",-1),u("option",{value:"done"},"已报销",-1)])],512),[[Nn,M.value]])]),u("div",gw,[u("div",bw,[Q[14]||(Q[14]=u("div",{class:"muted"},"本月收入(元)",-1)),u("div",ww,ne(be(ie.value.income)),1)]),u("div",_w,[Q[15]||(Q[15]=u("div",{class:"muted"},"本月支出(元)",-1)),u("div",kw,ne(be(ie.value.expense)),1)]),u("div",xw,[Q[16]||(Q[16]=u("div",{class:"muted"},"本月结余(元)",-1)),u("div",{class:Ze(["stat-num num",{"amt-income":ie.value.balance>=0,"amt-expense":ie.value.balance<0}])},ne(be(ie.value.balance)),3)]),u("div",Cw,[Q[17]||(Q[17]=u("div",{class:"muted"},"待报销(元)",-1)),u("div",Sw,ne(be(ie.value.pending)),1)])]),u("div",Ew,[Q[24]||(Q[24]=u("div",{class:"sec-head"},[u("span",{class:"sec-title"},"新增一笔"),u("span",{class:"muted form-hint"},"金额必填,回车快速添加")],-1)),u("div",$w,[u("div",Tw,[Q[18]||(Q[18]=u("label",null,"类型",-1)),u("div",Aw,[u("button",{class:Ze(["seg-btn",{active:o.value==="expense"}]),onClick:Q[2]||(Q[2]=ke=>o.value="expense")},"支出",2),u("button",{class:Ze(["seg-btn",{active:o.value==="income"}]),onClick:Q[3]||(Q[3]=ke=>o.value="income")},"收入",2)])]),u("div",Pw,[Q[19]||(Q[19]=u("label",null,"金额(元,必填)",-1)),Ae(u("input",{class:Ze(["input",{invalid:m.value}]),"onUpdate:modelValue":Q[4]||(Q[4]=ke=>a.value=ke),type:"number",min:"0",step:"0.01",placeholder:"0.00",onKeydown:Mt(He,["enter"])},null,34),[[De,a.value]])]),u("div",Ow,[Q[20]||(Q[20]=u("label",null,"日期",-1)),Ae(u("input",{class:"input",type:"date","onUpdate:modelValue":Q[5]||(Q[5]=ke=>d.value=ke)},null,512),[[De,d.value]])]),u("div",Mw,[Q[21]||(Q[21]=u("label",null,"分类",-1)),Ae(u("select",{class:"select","onUpdate:modelValue":Q[6]||(Q[6]=ke=>c.value=ke)},[(O(!0),F(je,null,it(o.value==="expense"?Kt(zr):Kt(Jo),ke=>(O(),F("option",{key:ke,value:ke},ne(ke),9,Iw))),128))],512),[[Nn,c.value]])]),o.value==="expense"?(O(),F("div",jw,[Q[22]||(Q[22]=u("label",null,"报销",-1)),u("button",{class:Ze(["toggle-btn",{on:y.value}]),onClick:Q[7]||(Q[7]=ke=>y.value=!y.value)},ne(y.value?"需要报销":"无需报销"),3)])):Ee("",!0),u("div",Dw,[Q[23]||(Q[23]=u("label",null,"备注",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":Q[8]||(Q[8]=ke=>h.value=ke),placeholder:"选填,如:客户现场午餐",onKeydown:Mt(He,["enter"])},null,544),[[De,h.value]])])]),m.value?(O(),F("div",Lw,ne(m.value),1)):Ee("",!0),u("div",Rw,[u("button",{class:"btn btn-sm",disabled:!Ye.value,onClick:Ke},"重置",8,Kw),u("button",{class:"btn btn-primary btn-sm",disabled:C.value,onClick:He},"添加记录",8,Fw)])]),oe.value.length?(O(),F("div",Nw,[Q[25]||(Q[25]=u("div",{class:"sec-title"},"本月支出分类",-1)),(O(!0),F(je,null,it(oe.value,ke=>(O(),F("div",{key:ke.name,class:"bar-row"},[u("span",Vw,ne(ke.name),1),u("span",Bw,[u("span",{class:"bar-fill",style:rr({width:ke.percent+"%"})},null,4)]),u("span",Uw,ne(be(ke.amount))+" 元 · "+ne(ke.percent)+"%",1)]))),128))])):Ee("",!0),_.value?(O(),F("div",qw,[u("div",Hw,ne(_.value),1),Q[26]||(Q[26]=u("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):Ee("",!0),u("div",Ww,[u("table",zw,[Q[28]||(Q[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,[(O(!0),F(je,null,it(S.value,ke=>(O(),F("tr",{key:ke.id},[u("td",Gw,ne(ke.date),1),u("td",Yw,[u("span",Jw,ne(ke.category),1)]),u("td",{class:Ze(["num",ke.type==="income"?"amt-income":"amt-expense"]),"data-label":"金额"},ne(z(ke)),3),u("td",Xw,ne(ke.note||"--"),1),u("td",Qw,[ke.type!=="expense"||ke.reimbursable!==1?(O(),F("span",Zw,"--")):ke.reimbursed===1?(O(),F("span",e_,"已报销")):(O(),F("span",t_,"待报销"))]),u("td",n_,[u("div",r_,[ke.type==="expense"&&ke.reimbursable===1&&ke.reimbursed!==1?(O(),F("button",{key:0,class:"btn btn-xs",onClick:Fe=>st(ke)},"标记已报销",8,s_)):Ee("",!0),u("button",{class:"btn btn-xs",onClick:Fe=>qe(ke)},"编辑",8,o_),u("button",{class:"btn btn-xs",onClick:Fe=>te.value=ke},"删除",8,i_)])])]))),128)),!S.value.length&&!s.value?(O(),F("tr",a_,[...Q[27]||(Q[27]=[u("td",{colspan:"6",class:"empty muted"},"本月暂无账目",-1)])])):Ee("",!0)])])]),u("div",l_,"筛选结果 "+ne(S.value.length)+" 条 / 本月共 "+ne(n.value.length)+" 条",1),Te(hw,{open:A.value,title:(V.value,"编辑账目"),initial:Z.value,onCancel:Q[9]||(Q[9]=ke=>A.value=!1),onSave:Qe},null,8,["open","title","initial"]),Te(ur,{open:!!te.value,title:"删除确认",message:te.value?"将删除 "+te.value.date+" 的账目("+te.value.category+" "+be(te.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Q[10]||(Q[10]=ke=>te.value=null),onConfirm:Ce},null,8,["open","message"])]))}}),c_=Qt(u_,[["__scopeId","data-v-0533e5f8"]]),f_={class:"memo-page"},d_={class:"card memo-list"},p_={class:"pane-head"},h_={class:"pane-title"},v_={class:"memo-scroll"},m_=["onClick"],y_={class:"memo-item-title"},g_={class:"muted memo-item-sub"},b_={class:"muted num memo-item-time"},w_={key:0,class:"muted empty"},__={class:"card memo-editor"},k_={class:"editor-foot"},x_={class:"muted foot-info"},C_=["disabled"],S_=["disabled"],E_={key:1,class:"empty muted editor-empty"},$_=Ht({__name:"MemoView",setup(e){const t=N([]),n=N(null),s=N(!1),o=N(""),a=N(""),c=N(null),d=N(null);async function h(){if(t.value=await Om(),n.value&&n.value.id){const ie=t.value.find(ee=>ee.id===n.value.id);ie&&(n.value=ie)}}yn(async()=>{await h(),t.value.length&&_(t.value[0]),window.addEventListener("keydown",y)}),dr(()=>window.removeEventListener("keydown",y)),mt(Fa,async ie=>{if(!ie)return;t.value.length||await h();const ee=t.value.find(M=>M.id===ie);Fa.value=null,ee&&C(ee)},{immediate:!0});function y(ie){(ie.ctrlKey||ie.metaKey)&&ie.key.toLowerCase()==="s"&&s.value&&m.value&&(ie.preventDefault(),te())}const m=ut(()=>{if(!s.value)return!1;const ie=n.value?n.value.title:"",ee=n.value?n.value.content:"";return o.value!==ie||a.value!==ee});function _(ie){n.value=ie,s.value=!0,o.value=ie.title,a.value=ie.content}function C(ie){if(!(s.value&&n.value&&n.value.id===ie.id)){if(m.value){d.value={type:"select",memo:ie};return}_(ie)}}function A(){if(m.value){d.value={type:"new"};return}V()}function V(){n.value=null,s.value=!0,o.value="",a.value=""}function Z(){n.value?_(n.value):V()}async function te(){if(!o.value.trim()&&!a.value.trim()){Ve("标题与内容不能都为空");return}if(n.value&&n.value.id)await Im(n.value.id,o.value,a.value),Ve("备忘已保存");else{const ie=await Mm(o.value,a.value);n.value=ie,o.value=ie.title,a.value=ie.content,Ve("备忘已创建")}await h()}function ue(){n.value&&n.value.id&&(c.value=n.value)}async function P(){c.value&&c.value.id&&(await jm(c.value.id),Ve("备忘已删除")),c.value=null,await h(),V()}function R(){const ie=d.value;d.value=null,ie&&(ie.type==="select"?_(ie.memo):V())}function X(ie){return(ie.content||"").replace(/\s+/g," ").slice(0,30)}function fe(ie){return ie.replace("T"," ").slice(0,16)}return(ie,ee)=>(O(),F("div",f_,[u("aside",d_,[u("div",p_,[u("span",h_,"备忘录("+ne(t.value.length)+")",1),u("button",{class:"btn btn-primary btn-sm",onClick:A},"新建")]),u("div",v_,[(O(!0),F(je,null,it(t.value,M=>(O(),F("div",{key:M.id,class:Ze(["memo-item",{active:s.value&&n.value&&n.value.id===M.id}]),onClick:S=>C(M)},[u("div",y_,ne(M.title||"无标题"),1),u("div",g_,ne(X(M)||"空"),1),u("div",b_,ne(fe(M.updated_at)),1)],10,m_))),128)),t.value.length?Ee("",!0):(O(),F("div",w_,"暂无备忘"))])]),u("section",__,[s.value?(O(),F(je,{key:0},[Ae(u("input",{class:"input title-input","onUpdate:modelValue":ee[0]||(ee[0]=M=>o.value=M),placeholder:"标题"},null,512),[[De,o.value]]),Ae(u("textarea",{class:"textarea content-textarea","onUpdate:modelValue":ee[1]||(ee[1]=M=>a.value=M),placeholder:"内容"},null,512),[[De,a.value]]),u("div",k_,[u("span",x_,[m.value?(O(),F(je,{key:0},[rn("有未保存修改")],64)):n.value&&n.value.id?(O(),F(je,{key:1},[rn("更新于 "+ne(fe(n.value.updated_at)),1)],64)):(O(),F(je,{key:2},[rn("新备忘")],64))]),ee[4]||(ee[4]=u("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(O(),F("button",{key:0,class:"btn btn-sm",onClick:ue},"删除")):Ee("",!0),u("button",{class:"btn btn-sm",disabled:!m.value,onClick:Z},"放弃修改",8,C_),u("button",{class:"btn btn-primary btn-sm",disabled:!m.value,onClick:te},"保存",8,S_)])],64)):(O(),F("div",E_,"选择左侧备忘,或点击右上角新建"))]),Te(ur,{open:!!c.value,title:"删除确认",message:c.value?"将删除备忘「"+(c.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:ee[2]||(ee[2]=M=>c.value=null),onConfirm:P},null,8,["open","message"]),Te(ur,{open:!!d.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:ee[3]||(ee[3]=M=>d.value=null),onConfirm:R},null,8,["open"])]))}}),T_=Qt($_,[["__scopeId","data-v-74d60dba"]]),A_=["aria-label"],P_={class:"dialog-head"},O_={class:"dialog-title"},M_={class:"dialog-body"},I_={class:"form-grid"},j_={class:"field span2"},D_={class:"field span2"},L_={class:"field span2"},R_={class:"pwd-row"},K_={class:"field span2"},F_={key:0,class:"form-error"},N_={class:"dialog-btns"},V_=Ht({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=N(""),a=N(""),c=N(""),d=N(""),h=N(""),y=N(null);function m(A){n.open&&A.key==="Escape"&&s("cancel")}mt(()=>n.open,async A=>{var V;A?(o.value=n.initial.system,a.value=n.initial.account,c.value=n.initial.password,d.value=n.initial.remark,h.value="",window.addEventListener("keydown",m),await rs(),(V=y.value)==null||V.focus()):window.removeEventListener("keydown",m)}),dr(()=>window.removeEventListener("keydown",m));function _(){const A="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",V="!@#$%^&*",Z=crypto.getRandomValues(new Uint8Array(14));let te="";for(let ue=0;ue<Z.length;ue++)te+=A[Z[ue]%A.length];te+=V[crypto.getRandomValues(new Uint8Array(1))[0]%V.length],c.value=te,h.value=""}function C(){if(!o.value.trim()||!a.value.trim()||!c.value){h.value="系统名称、账号、密码为必填项";return}s("save",{system:o.value.trim(),account:a.value.trim(),password:c.value,remark:d.value.trim()})}return(A,V)=>(O(),Lt(Us,{to:"body"},[Te(ss,{name:"modal"},{default:fr(()=>[e.open?(O(),F("div",{key:0,class:"mask",onClick:V[6]||(V[6]=hn(Z=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",P_,[u("span",O_,ne(e.title),1),u("button",{class:"icon-btn",title:"关闭",onClick:V[0]||(V[0]=Z=>s("cancel"))},[Te(et,{name:"close",size:16})])]),u("div",M_,[u("div",I_,[u("div",j_,[V[7]||(V[7]=u("label",null,"系统名称(必填)",-1)),Ae(u("input",{ref_key:"systemInput",ref:y,class:"input","onUpdate:modelValue":V[1]||(V[1]=Z=>o.value=Z),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[De,o.value]])]),u("div",D_,[V[8]||(V[8]=u("label",null,"账号(必填)",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":V[2]||(V[2]=Z=>a.value=Z),placeholder:"用户名、工号或邮箱"},null,512),[[De,a.value]])]),u("div",L_,[V[9]||(V[9]=u("label",null,"密码(必填)",-1)),u("div",R_,[Ae(u("input",{class:"input","onUpdate:modelValue":V[3]||(V[3]=Z=>c.value=Z),placeholder:"输入或点击生成"},null,512),[[De,c.value]]),u("button",{class:"btn btn-sm",onClick:_},"生成")])]),u("div",K_,[V[10]||(V[10]=u("label",null,"备注",-1)),Ae(u("textarea",{class:"textarea","onUpdate:modelValue":V[4]||(V[4]=Z=>d.value=Z),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[De,d.value]])])]),h.value?(O(),F("div",F_,ne(h.value),1)):Ee("",!0)]),u("div",N_,[u("button",{class:"btn btn-sm",onClick:V[5]||(V[5]=Z=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:C},"保存")])],8,A_)])):Ee("",!0)]),_:1})]))}}),B_=Qt(V_,[["__scopeId","data-v-f383b0a6"]]),U_={class:"vault-page"},q_={key:0,class:"empty muted"},H_={key:1,class:"card lock-card"},W_={class:"lock-badge"},z_={key:0,class:"form-error"},G_=["disabled"],Y_={key:0,class:"form-error"},J_=["disabled"],X_={class:"vault-toolbar"},Q_={class:"search-wrap"},Z_={class:"card table-card"},e1={class:"cred-table"},t1={class:"td-system"},n1=["onClick"],r1={class:"pwd-cell"},s1={class:"num pwd-text"},o1=["onClick"],i1=["onClick"],a1={class:"td-remark"},l1={class:"td-ops"},u1={class:"ops"},c1=["onClick"],f1=["onClick"],d1={key:0},p1={class:"muted vault-note num"},h1={class:"dialog pwd-dialog"},v1={class:"dialog-head"},m1={class:"dialog-body"},y1={class:"vp-field"},g1={class:"vp-field"},b1={class:"vp-field"},w1={key:0,class:"form-error"},_1={class:"dialog-btns"},k1=5*60*1e3,x1=Ht({__name:"VaultView",setup(e){const t=N(null),n=N(Ev()),s=N(!1),o=N(""),a=N(""),c=N(""),d=N(""),h=N(""),y=N([]),m=N(""),_=N({}),C=N(!1),A=N(null),V=N({system:"",account:"",password:"",remark:""}),Z=N(null),te=N(!1),ue=N(""),P=N(""),R=N(""),X=N("");async function fe(){y.value=await Ov(),_.value={}}let ie=null;function ee(){ie!==null&&window.clearTimeout(ie),ie=window.setTimeout(()=>{n.value&&(ti(),n.value=!1,y.value=[],_.value={},Ve("长时间未操作,密码库已自动锁定"))},k1)}function M(){n.value&&ee()}yn(async()=>{t.value=await ff(),window.addEventListener("click",M),window.addEventListener("keydown",M),n.value&&ee()}),dr(()=>{window.removeEventListener("click",M),window.removeEventListener("keydown",M),ie!==null&&window.clearTimeout(ie)});const S=ut(()=>{const Ce=m.value.trim().toLowerCase();return Ce?y.value.filter(J=>(J.system+" "+J.account+" "+(J.remark||"")).toLowerCase().includes(Ce)):y.value});async function oe(){if(!s.value){if(c.value="",!o.value){c.value="请输入主密码";return}if(o.value.length<6){c.value="主密码至少 6 位";return}if(o.value!==a.value){c.value="两次输入的主密码不一致";return}s.value=!0;try{await $v(o.value),o.value="",a.value="",n.value=!0,ee(),await fe(),Ve("主密码已设置,密码库已解锁")}catch(Ce){c.value=Ce instanceof Error?Ce.message:"设置失败"}s.value=!1}}async function be(){if(!s.value){if(h.value="",!d.value){h.value="请输入主密码";return}s.value=!0;try{await Tv(d.value),d.value="",n.value=!0,ee(),await fe()}catch(Ce){h.value=Ce instanceof Error?Ce.message:"解锁失败"}s.value=!1}}function z(){ti(),n.value=!1,y.value=[],_.value={},ie!==null&&window.clearTimeout(ie),Ve("密码库已锁定")}async function xe(Ce){const J=Ce.id;if(_.value[J]){_.value[J]=!1;return}try{Ce.passwordPlain=await ha(J),_.value[J]=!0}catch(Q){Ve(Q instanceof Error?Q.message:"解密失败")}}async function Le(Ce){try{const J=await ha(Ce.id);await qa(J),Ve("密码已复制")}catch(J){Ve(J instanceof Error?J.message:"复制失败")}}async function rt(Ce){await qa(Ce.account),Ve("账号已复制")}function He(){A.value=null,V.value={system:"",account:"",password:"",remark:""},C.value=!0}async function Ye(Ce){try{const J=await ha(Ce.id);A.value=Ce.id,V.value={system:Ce.system,account:Ce.account,password:J,remark:Ce.remark||""},C.value=!0}catch(J){Ve(J instanceof Error?J.message:"解密失败")}}async function Ke(Ce){const J=A.value??void 0;await Mv(Ce,J),C.value=!1,await fe(),Ve(J?"账号已更新":"账号已添加")}async function st(){Z.value&&Z.value.id&&(await Iv(Z.value.id),Ve("账号已删除")),Z.value=null,await fe()}function qe(){ue.value="",P.value="",R.value="",X.value="",te.value=!0}async function Qe(){X.value="";try{const Ce=await jv(ue.value,P.value);te.value=!1,ue.value="",P.value="",R.value="",Ve("主密码已修改,"+Ce+" 条账号密码已重新加密")}catch(Ce){X.value=Ce instanceof Error?Ce.message:"修改失败"}}return(Ce,J)=>(O(),F("div",U_,[t.value===null?(O(),F("div",q_,"加载中")):n.value?(O(),F(je,{key:2},[u("div",X_,[u("div",Q_,[Te(et,{name:"search",size:14,class:"search-icon"}),Ae(u("input",{class:"input","onUpdate:modelValue":J[3]||(J[3]=Q=>m.value=Q),placeholder:"搜索系统名称、账号或备注"},null,512),[[De,m.value]])]),J[16]||(J[16]=u("span",{class:"flex1"},null,-1)),u("button",{class:"btn btn-sm",onClick:qe},"修改主密码"),u("button",{class:"btn btn-sm",onClick:z},"锁定"),u("button",{class:"btn btn-primary btn-sm",onClick:He},"新增账号")]),u("div",Z_,[u("table",e1,[J[18]||(J[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,[(O(!0),F(je,null,it(S.value,Q=>(O(),F("tr",{key:Q.id},[u("td",t1,ne(Q.system),1),u("td",null,[u("span",{class:"copyable",title:"点击复制账号",onClick:ke=>rt(Q)},ne(Q.account),9,n1)]),u("td",null,[u("div",r1,[u("span",s1,ne(_.value[Q.id]?Q.passwordPlain:"........"),1),u("button",{class:"btn btn-xs",onClick:ke=>xe(Q)},ne(_.value[Q.id]?"隐藏":"显示"),9,o1),u("button",{class:"btn btn-xs",onClick:ke=>Le(Q)},"复制",8,i1)])]),u("td",a1,ne(Q.remark||"--"),1),u("td",l1,[u("div",u1,[u("button",{class:"btn btn-xs",onClick:ke=>Ye(Q)},"编辑",8,c1),u("button",{class:"btn btn-xs",onClick:ke=>Z.value=Q},"删除",8,f1)])])]))),128)),S.value.length?Ee("",!0):(O(),F("tr",d1,[...J[17]||(J[17]=[u("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),u("div",p1,"共 "+ne(y.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密,服务器仅存密文",1)],64)):(O(),F("div",H_,[u("div",W_,[Te(et,{name:"lock",size:26})]),t.value===!1?(O(),F(je,{key:0},[J[12]||(J[12]=u("div",{class:"lock-title"},"设置主密码",-1)),J[13]||(J[13]=u("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":J[0]||(J[0]=Q=>o.value=Q),placeholder:"设置主密码(至少 6 位)",onKeydown:Mt(oe,["enter"])},null,544),[[De,o.value]]),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":J[1]||(J[1]=Q=>a.value=Q),placeholder:"再次输入主密码",onKeydown:Mt(oe,["enter"])},null,544),[[De,a.value]]),c.value?(O(),F("div",z_,ne(c.value),1)):Ee("",!0),u("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:oe},"完成设置并解锁",8,G_)],64)):(O(),F(je,{key:1},[J[14]||(J[14]=u("div",{class:"lock-title"},"密码库已锁定",-1)),J[15]||(J[15]=u("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":J[2]||(J[2]=Q=>d.value=Q),placeholder:"主密码",onKeydown:Mt(be,["enter"])},null,544),[[De,d.value]]),h.value?(O(),F("div",Y_,ne(h.value),1)):Ee("",!0),u("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:be},"解锁",8,J_)],64))])),Te(B_,{open:C.value,title:A.value?"编辑账号":"新增账号",initial:V.value,onCancel:J[4]||(J[4]=Q=>C.value=!1),onSave:Ke},null,8,["open","title","initial"]),Te(ur,{open:!!Z.value,title:"删除确认",message:Z.value?"将删除系统「"+Z.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:J[5]||(J[5]=Q=>Z.value=null),onConfirm:st},null,8,["open","message"]),(O(),Lt(Us,{to:"body"},[Te(ss,{name:"modal"},{default:fr(()=>[te.value?(O(),F("div",{key:0,class:"mask",onClick:J[11]||(J[11]=hn(Q=>te.value=!1,["self"]))},[u("div",h1,[u("div",v1,[J[19]||(J[19]=u("span",{class:"dialog-title"},"修改主密码",-1)),u("button",{class:"icon-btn",title:"关闭",onClick:J[6]||(J[6]=Q=>te.value=!1)},[Te(et,{name:"close",size:16})])]),u("div",m1,[u("div",y1,[J[20]||(J[20]=u("label",null,"旧主密码",-1)),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":J[7]||(J[7]=Q=>ue.value=Q)},null,512),[[De,ue.value]])]),u("div",g1,[J[21]||(J[21]=u("label",null,"新主密码(至少 6 位)",-1)),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":J[8]||(J[8]=Q=>P.value=Q)},null,512),[[De,P.value]])]),u("div",b1,[J[22]||(J[22]=u("label",null,"确认新主密码",-1)),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":J[9]||(J[9]=Q=>R.value=Q)},null,512),[[De,R.value]])]),X.value?(O(),F("div",w1,ne(X.value),1)):Ee("",!0),J[23]||(J[23]=u("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),u("div",_1,[u("button",{class:"btn btn-sm",onClick:J[10]||(J[10]=Q=>te.value=!1)},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:Qe},"确认修改")])])])):Ee("",!0)]),_:1})]))]))}}),C1=Qt(x1,[["__scopeId","data-v-c2db283d"]]);function S1(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Bu(e,t){const s="\uFEFF"+t.map(d=>d.map(S1).join(",")).join(`\r
`);if(ns.isNativePlatform()){const{downloadText:d}=await Pf(async()=>{const{downloadText:h}=await Promise.resolve().then(()=>pb);return{downloadText:h}},void 0,import.meta.url);return d(e,s)}const o=new Blob([s],{type:"text/csv;charset=utf-8"}),a=URL.createObjectURL(o),c=document.createElement("a");return c.href=a,c.download=e,c.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e4),""}const E1={class:"settings"},$1={class:"card section"},T1={class:"muted acc-line"},A1={class:"ai-grid"},P1={class:"rule-item"},O1={class:"rule-item"},M1={class:"rule-item"},I1={key:0,class:"form-error"},j1={class:"rule-save"},D1={class:"card section"},L1={class:"rule-grid"},R1={class:"rule-item"},K1={class:"rule-item"},F1={class:"rule-item"},N1={class:"rule-item"},V1={class:"rule-item"},B1={class:"card section"},U1={class:"proj-add"},q1={key:0,class:"muted proj-tip"},H1=["onKeydown"],W1=["onClick"],z1=["onClick"],G1=["onClick"],Y1={key:1,class:"muted"},J1={class:"card section"},X1={class:"card section"},Q1={class:"muted acc-line"},Z1={class:"rule-item"},e0={class:"rule-save"},t0=["disabled"],n0={key:0,class:"muted acc-line"},r0={key:1,class:"form-error"},s0={key:2,class:"form-error"},o0={class:"card section"},i0={class:"ai-grid"},a0={class:"rule-item"},l0={class:"rule-item"},u0={class:"rule-item"},c0={class:"card section"},f0={class:"backup-row"},d0={key:0,class:"import-error"},p0=Ht({__name:"SettingsView",setup(e){var x;const t=N({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=N([]),s=N(""),o=N(""),a=N(""),c=N(""),d=N(""),h=N(""),y=N(null),m=N(""),_=N(null),C=N(null),A=N(""),V=N(((x=_i())==null?void 0:x.username)||""),Z=N(""),te=N(""),ue=N(""),P=N(""),R=N(!1),X="0.2.0",fe=N(""),ie=N(""),ee=N(""),M=N(""),S=N(""),oe=N(!1),be=N("");async function z(){var k;fe.value=await Gv(),ie.value=((k=pr())==null?void 0:k.username)||"",be.value=await Zv(),S.value=Jr.value}mt(Jr,k=>{S.value=k});async function xe(){await Lv(fe.value.trim()),Ve("同步地址已保存")}async function Le(){M.value="";try{await _f(),Ve("云端绑定已重建")}catch(k){M.value=k instanceof Error?k.message:"绑定失败"}}async function rt(){if(!oe.value){M.value="",S.value=Jr.value,oe.value=!0;try{await xe();const k=await Na();be.value=k.at,ee.value="推送 "+k.pushed+" 条 · 拉取 "+k.pulled+" 条 · 删除 "+k.removed+" 条",S.value="",Ve("同步完成")}catch(k){M.value=k instanceof Error?k.message:"同步失败"}oe.value=!1}}async function He(){if(P.value="",te.value!==ue.value){P.value="两次输入的新密码不一致";return}try{await Wv(Z.value,te.value),Z.value="",te.value="",ue.value="",Ve("登录密码已修改")}catch(k){P.value=k instanceof Error?k.message:"修改失败"}}async function Ye(){await zv(),window.location.reload()}async function Ke(){t.value=await Dr(),n.value=await Ns(!0),a.value=(await hl()).join(`
`),c.value=await bt("ai_base_url",""),d.value=await bt("ai_api_key",""),h.value=await bt("ai_model",""),await z()}async function st(){await Rt("ai_base_url",c.value.trim()),await Rt("ai_api_key",d.value.trim()),await Rt("ai_model",h.value.trim()),Ve("AI 配置已保存")}async function qe(){const k=Ct(),b=await Promise.all([xi("2000-01-01",k),Ns(!0)]),W=b[0],re=b[1],le=new Map(re.map(ae=>[ae.id,ae.name])),ge=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const ae of W)ge.push([ae.date,Xo(ae.category),ae.project_id&&le.get(ae.project_id)||"",ae.content,ae.minutes==null?"":ae.minutes,ae.is_milestone?"是":"",ae.needs_followup?"是":"",ae.takeaway||"",ae.remark||""]);const me=await Bu("工作记录_"+k.replace(/-/g,"")+".csv",ge);Ve(me?"CSV 已导出到:"+me:"CSV 已导出到系统下载目录")}async function Qe(){const k=Ct(),b=await Promise.all([Dr(),ki("2000-01-01",k)]),W=b[0],re=b[1],le=["周日","周一","周二","周三","周四","周五","周六"],ge=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const ae of re){const q=zs(ae,ae.date,W,ae.date===k);ge.push([ae.date,le[os(ae.date).getDay()],q.label,ae.clock_in_at?Bn(ae.clock_in_at):"",ae.clock_out_at?Bn(ae.clock_out_at):"",ae.location||"",ae.kind==="makeup"?"补卡":ae.kind==="leave"?"休假":"正常",ae.note||""])}const me=await Bu("考勤记录_"+k.replace(/-/g,"")+".csv",ge);Ve(me?"CSV 已导出到:"+me:"CSV 已导出到系统下载目录")}yn(Ke);async function Ce(){await Rt("work_start",t.value.work_start),await Rt("work_end",t.value.work_end),await Rt("grace_minutes",String(t.value.grace_minutes)),await Rt("lunch_minutes",String(t.value.lunch_minutes)),await Rt("remind_weekly",t.value.remind_weekly),Ve("打卡规则已保存")}async function J(){await $f(a.value.split(`
`)),Ve("常用地点已保存")}async function Q(){const k=s.value.trim();if(k){try{await mm(k),o.value="",s.value=""}catch{o.value="项目名已存在"}await Ke()}}function ke(k){y.value=k.id,m.value=k.name}async function Fe(k){const b=m.value.trim();if(b)try{await ym(k.id,b),o.value=""}catch{o.value="项目名已存在"}y.value=null,await Ke()}async function ct(k){await gm(k.id,k.archived!==1),await Ke()}async function It(){try{const k=await Bm(),b=await ml("实习日志备份_"+Ct().replace(/-/g,"")+".json",k);Ve(b?"备份已导出到:"+b:"备份已导出到系统下载目录")}catch(k){Ve("导出失败:"+(k instanceof Error?k.message:String(k)))}}function $e(k){const b=k.target,W=b.files&&b.files[0];if(A.value="",!W)return;const re=W.name;W.text().then(le=>{C.value={name:re,text:le}}),b.value=""}async function ce(){if(C.value)try{await Um(C.value.text),C.value=null,A.value="",await Ke(),Ve("数据导入完成")}catch(k){C.value=null,A.value=k instanceof Error?k.message:"导入失败"}}return(k,b)=>(O(),F("div",E1,[u("div",$1,[b[23]||(b[23]=u("div",{class:"section-title"},"账号与隐私",-1)),u("div",T1,"版本 v"+ne(Kt(X))+" · 当前用户:"+ne(V.value)+" · 每位用户独立数据库隔离存储于本机 · 登录密码仅保存 PBKDF2 哈希",1),u("div",A1,[u("div",P1,[b[20]||(b[20]=u("label",null,"旧登录密码",-1)),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":b[0]||(b[0]=W=>Z.value=W)},null,512),[[De,Z.value]])]),u("div",O1,[b[21]||(b[21]=u("label",null,"新登录密码(至少 6 位)",-1)),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":b[1]||(b[1]=W=>te.value=W)},null,512),[[De,te.value]])]),u("div",M1,[b[22]||(b[22]=u("label",null,"确认新登录密码",-1)),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":b[2]||(b[2]=W=>ue.value=W)},null,512),[[De,ue.value]])])]),P.value?(O(),F("div",I1,ne(P.value),1)):Ee("",!0),u("div",j1,[u("button",{class:"btn btn-primary btn-sm",onClick:He},"修改登录密码"),u("button",{class:"btn btn-sm btn-danger",onClick:b[3]||(b[3]=W=>R.value=!0)},"删除此用户及全部数据")])]),u("div",D1,[b[30]||(b[30]=u("div",{class:"section-title"},"打卡规则",-1)),u("div",L1,[u("div",R1,[b[24]||(b[24]=u("label",null,"上班时间",-1)),Ae(u("input",{type:"time",class:"input","onUpdate:modelValue":b[4]||(b[4]=W=>t.value.work_start=W)},null,512),[[De,t.value.work_start]])]),u("div",K1,[b[25]||(b[25]=u("label",null,"下班时间",-1)),Ae(u("input",{type:"time",class:"input","onUpdate:modelValue":b[5]||(b[5]=W=>t.value.work_end=W)},null,512),[[De,t.value.work_end]])]),u("div",F1,[b[26]||(b[26]=u("label",null,"迟到宽限(分钟)",-1)),Ae(u("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":b[6]||(b[6]=W=>t.value.grace_minutes=W)},null,512),[[De,t.value.grace_minutes,void 0,{number:!0}]])]),u("div",N1,[b[27]||(b[27]=u("label",null,"午休扣除(分钟)",-1)),Ae(u("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":b[7]||(b[7]=W=>t.value.lunch_minutes=W)},null,512),[[De,t.value.lunch_minutes,void 0,{number:!0}]])]),u("div",V1,[b[29]||(b[29]=u("label",null,"周记提醒",-1)),Ae(u("select",{class:"select","onUpdate:modelValue":b[8]||(b[8]=W=>t.value.remind_weekly=W)},[...b[28]||(b[28]=[u("option",{value:"friday"},"每周五提醒",-1),u("option",{value:"off"},"关闭",-1)])],512),[[Nn,t.value.remind_weekly]])])]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:Ce},"保存规则")])]),u("div",B1,[b[31]||(b[31]=u("div",{class:"section-title"},"项目管理",-1)),u("div",U1,[Ae(u("input",{class:"input","onUpdate:modelValue":b[9]||(b[9]=W=>s.value=W),placeholder:"新项目名称",onKeydown:Mt(Q,["enter"])},null,544),[[De,s.value]]),u("button",{class:"btn btn-sm",onClick:Q},"添加")]),o.value?(O(),F("div",q1,ne(o.value),1)):Ee("",!0),(O(!0),F(je,null,it(n.value,W=>(O(),F("div",{key:W.id,class:"proj-row"},[y.value===W.id?(O(),F(je,{key:0},[Ae(u("input",{class:"input","onUpdate:modelValue":b[10]||(b[10]=re=>m.value=re),onKeydown:Mt(re=>Fe(W),["enter"])},null,40,H1),[[De,m.value]]),u("button",{class:"btn btn-sm",onClick:re=>Fe(W)},"保存",8,W1),u("button",{class:"btn btn-sm",onClick:b[11]||(b[11]=re=>y.value=null)},"取消")],64)):(O(),F(je,{key:1},[u("span",{class:Ze(["proj-name",{archived:W.archived===1}])},ne(W.name),3),u("button",{class:"icon-btn",title:"重命名",onClick:re=>ke(W)},[Te(et,{name:"edit",size:14})],8,z1),u("button",{class:"btn btn-sm",onClick:re=>ct(W)},ne(W.archived===1?"恢复":"归档"),9,G1)],64))]))),128)),n.value.length?Ee("",!0):(O(),F("div",Y1,"暂无项目,先添加一个"))]),u("div",J1,[b[33]||(b[33]=u("div",{class:"section-title"},"常用地点",-1)),Ae(u("textarea",{class:"textarea","onUpdate:modelValue":b[12]||(b[12]=W=>a.value=W),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[De,a.value]]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:J},"保存地点"),b[32]||(b[32]=u("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),u("div",X1,[b[35]||(b[35]=u("div",{class:"section-title"},"多端数据同步",-1)),u("div",Q1,"云端账号:"+ne(ie.value||"未绑定")+" · 数据仅保存在服务器,本机只是实时缓存(变更 ~3 秒推上云端 + 其他端秒级自动刷新);密码库同步密文,主密码永不出本机",1),u("div",Z1,[b[34]||(b[34]=u("label",null,"同步服务地址(默认即可)",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":b[13]||(b[13]=W=>fe.value=W),placeholder:"https://daywk.linyux.cn"},null,512),[[De,fe.value]])]),u("div",e0,[u("button",{class:"btn btn-sm",onClick:xe},"保存地址"),u("button",{class:"btn btn-primary btn-sm",disabled:oe.value,onClick:rt},ne(oe.value?"同步中":"立即同步"),9,t0),u("button",{class:"btn btn-sm",onClick:Le},"重建云端绑定")]),ee.value?(O(),F("div",n0,"上次同步:"+ne(be.value||"--")+" · "+ne(ee.value),1)):Ee("",!0),M.value?(O(),F("div",r0,ne(M.value),1)):Ee("",!0),S.value?(O(),F("div",s0,"最近自动同步失败:"+ne(S.value)+"(可点「立即同步」重试)",1)):Ee("",!0)]),u("div",o0,[b[40]||(b[40]=u("div",{class:"section-title"},"AI 润色配置(可选)",-1)),u("div",i0,[u("div",a0,[b[36]||(b[36]=u("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":b[14]||(b[14]=W=>c.value=W),placeholder:"https://api.example.com/v1"},null,512),[[De,c.value]])]),u("div",l0,[b[37]||(b[37]=u("label",null,"API Key",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":b[15]||(b[15]=W=>d.value=W),placeholder:"sk-..."},null,512),[[De,d.value]])]),u("div",u0,[b[38]||(b[38]=u("label",null,"模型名称",-1)),Ae(u("input",{class:"input","onUpdate:modelValue":b[16]||(b[16]=W=>h.value=W),placeholder:"如:deepseek-chat"},null,512),[[De,h.value]])])]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:st},"保存 AI 配置"),b[39]||(b[39]=u("span",{class:"muted loc-note"},"配置仅保存在本机浏览器;总结页可用 AI 润色草稿,需服务端允许浏览器跨域",-1))])]),u("div",c0,[b[41]||(b[41]=u("div",{class:"section-title"},"数据备份",-1)),u("div",f0,[u("button",{class:"btn btn-sm",onClick:It},"导出 JSON 备份"),u("button",{class:"btn btn-sm",onClick:b[17]||(b[17]=W=>{var re;return(re=_.value)==null?void 0:re.click()})},"导入 JSON 备份"),u("button",{class:"btn btn-sm",onClick:qe},"导出工作记录 CSV"),u("button",{class:"btn btn-sm",onClick:Qe},"导出考勤 CSV"),u("input",{ref_key:"fileInput",ref:_,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:$e},null,544)]),A.value?(O(),F("div",d0,ne(A.value),1)):Ee("",!0),b[42]||(b[42]=u("div",{class:"muted backup-note"},"数据保存在浏览器 IndexedDB 中,建议定期导出 JSON 备份。",-1))]),Te(ur,{open:!!C.value,title:"导入确认",message:C.value?"将从文件「"+C.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:b[18]||(b[18]=W=>C.value=null),onConfirm:ce},null,8,["open","message"]),Te(ur,{open:R.value,title:"删除用户确认",message:"将永久删除云端账号「"+V.value+"」及其服务器上的全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,任何设备都无法再取回,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:b[19]||(b[19]=W=>R.value=!1),onConfirm:Ye},null,8,["open","message"])]))}}),h0=Qt(p0,[["__scopeId","data-v-cea34561"]]),v0={class:"login-page"},m0={class:"card login-card"},y0={class:"login-brand"},g0={class:"brand-icon"},b0={class:"seg"},w0=["placeholder"],_0={key:1,class:"form-error"},k0=["disabled"],x0=Ht({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,s=N("login"),o=N(""),a=N(""),c=N(""),d=N(""),h=N(!1);function y(_){s.value=_,d.value="",c.value=""}async function m(){if(!h.value){d.value="",h.value=!0;try{let _;if(s.value==="login")_=await Vv(o.value,a.value);else{if(a.value.length<6){d.value="登录密码至少 6 位",h.value=!1;return}if(a.value!==c.value){d.value="两次输入的密码不一致",h.value=!1;return}_=await Bv(o.value,a.value)}n("login",_)}catch(_){d.value=_ instanceof Error?_.message:"操作失败"}h.value=!1}}return(_,C)=>(O(),F("div",v0,[u("div",m0,[u("div",y0,[u("div",g0,[Te(et,{name:"calendar",size:22})]),C[5]||(C[5]=u("div",{class:"login-title"},"实习工作日志",-1)),C[6]||(C[6]=u("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),C[7]||(C[7]=u("div",{class:"muted login-sub"},"数据保存在云端服务器,所有设备登录同一账号即可实时同步",-1))]),u("div",b0,[u("button",{class:Ze(["seg-btn",{active:s.value==="login"}]),onClick:C[0]||(C[0]=A=>y("login"))},"登录",2),u("button",{class:Ze(["seg-btn",{active:s.value==="create"}]),onClick:C[1]||(C[1]=A=>y("create"))},"创建用户",2)]),Ae(u("input",{class:"input","onUpdate:modelValue":C[2]||(C[2]=A=>o.value=A),placeholder:"用户名(2 到 20 个字符)",onKeydown:Mt(m,["enter"])},null,544),[[De,o.value]]),Ae(u("input",{type:"password",class:"input","onUpdate:modelValue":C[3]||(C[3]=A=>a.value=A),placeholder:s.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:Mt(m,["enter"])},null,40,w0),[[De,a.value]]),s.value==="create"?Ae((O(),F("input",{key:0,type:"password",class:"input","onUpdate:modelValue":C[4]||(C[4]=A=>c.value=A),placeholder:"再次输入密码",onKeydown:Mt(m,["enter"])},null,544)),[[De,c.value]]):Ee("",!0),d.value?(O(),F("div",_0,ne(d.value),1)):Ee("",!0),u("button",{class:"btn btn-primary login-btn",disabled:h.value,onClick:m},ne(s.value==="login"?"登录":"创建并进入"),9,k0),C[8]||(C[8]=u("div",{class:"muted login-note"}," 登录密码仅服务器保存哈希;本机保存加密的自动登录凭据,登录后无需重复输入 ",-1))])]))}}),C0=Qt(x0,[["__scopeId","data-v-bf714afa"]]),S0={key:1,class:"app"},E0={class:"side"},$0=["data-tip","onClick"],T0={class:"main"},A0={class:"topbar"},P0={class:"title"},O0={class:"gsearch"},M0={key:0,class:"gs-panel"},I0={key:0,class:"gs-group muted"},j0=["onMousedown"],D0={class:"tag"},L0={class:"gs-text"},R0={class:"muted num gs-date"},K0={key:1,class:"gs-group muted"},F0=["onMousedown"],N0={class:"gs-text"},V0={class:"muted gs-sub"},B0={key:1,class:"gs-empty muted"},U0={class:"topbar-actions"},q0={class:"user-chip num mobile-hide"},H0=["disabled"],W0={class:"num"},z0={class:"content"},G0={class:"content-inner"},Y0={class:"tabbar"},J0=["onClick"],X0={class:"sheet-user num"},Q0=["onClick"],Z0={class:"sheet-name"},ek={class:"msw"},tk={class:"msw-bar"},nk={class:"msw-results"},rk={key:0,class:"gs-group muted"},sk=["onMousedown"],ok={class:"tag"},ik={class:"gs-text"},ak={class:"muted num gs-date"},lk={key:1,class:"gs-group muted"},uk=["onMousedown"],ck={class:"gs-text"},fk={class:"muted gs-sub"},dk={key:1,class:"gs-empty muted"},pk={class:"toast-wrap"},hk=Ht({__name:"App",setup(e){const t=Hm(),n=N(_i());async function s($e){n.value=$e,ri($e.userId),location.hash="#/calendar",fe.value="calendar",await Ce(),await It(),c();try{await _f(),await Qr()}catch{}Ve("欢迎,"+$e.username);const ce=sessionStorage.getItem("dsh_migrate_toast");ce&&(sessionStorage.removeItem("dsh_migrate_toast"),Ve("已迁移原有数据 "+ce+" 条"))}async function o(){Le.value=!1,z.value=!1,sm(),a!==null&&(window.clearInterval(a),a=null),await qv(),n.value=null,fe.value="calendar",location.hash="#/calendar",Ve("已退出登录")}let a=null;function c(){rm(),a!==null&&window.clearInterval(a),a=window.setInterval(()=>{Qr()},60*1e3),Qr()}const d=N(null),h=N(""),y=N(!1),m=N({logs:[],memos:[]});let _=null;const C=ut(()=>!!(m.value.logs.length||m.value.memos.length));function A(){_&&window.clearTimeout(_);const $e=h.value;_=window.setTimeout(async()=>{const ce=$e.trim();if(!ce){m.value={logs:[],memos:[]};return}const x=await Promise.all([Dm(ce,8),Lm(ce,4)]);m.value={logs:x[0],memos:x[1]}},200)}function V(){h.value="",m.value={logs:[],memos:[]},y.value=!1}function Z($e){Ka.value=$e.date,ie("calendar"),V()}function te($e){Fa.value=$e.id,ie("memo"),V()}function ue(){window.setTimeout(()=>{y.value=!1},150)}function P($e){var ce;($e.ctrlKey||$e.metaKey)&&$e.key.toLowerCase()==="k"&&($e.preventDefault(),(ce=d.value)==null||ce.focus())}const R=[{key:"calendar",name:"日历",icon:"calendar"},{key:"today",name:"详情",icon:"edit"},{key:"stats",name:"统计",icon:"chart"},{key:"report",name:"总结",icon:"export"},{key:"ledger",name:"记账",icon:"wallet"},{key:"memo",name:"备忘录",icon:"memo"},{key:"vault",name:"密码库",icon:"lock"},{key:"settings",name:"设置",icon:"settings"}];function X(){const $e=(location.hash||"").replace("#/","");return R.some(ce=>ce.key===$e)?$e:"calendar"}const fe=N(X());window.addEventListener("hashchange",()=>{fe.value=X()});function ie($e){location.hash="#/"+$e}const ee=ut(()=>R.find($e=>$e.key===fe.value)||R[0]),M=["calendar","today","ledger","memo"],S=R.filter($e=>M.includes($e.key)),oe=R.filter($e=>!M.includes($e.key)),be=ut(()=>oe.some($e=>$e.key===fe.value)),z=N(!1);function xe($e){z.value=!1,ie($e)}const Le=N(!1),rt=N(null);function He(){Le.value=!0,window.setTimeout(()=>{var $e;return($e=rt.value)==null?void 0:$e.focus()},60)}function Ye($e){Z($e),Le.value=!1}function Ke($e){te($e),Le.value=!1}const st=N(Ct()),qe=N(void 0),Qe=N(!1);async function Ce(){if(qe.value=await gn(st.value),Qe.value=!1,new Date().getHours()<4){const ce=await gn(Fn(st.value,-1));Qe.value=!!(ce&&ce.clock_in_at&&!ce.clock_out_at)}}const J=ut(()=>{const $e=qe.value;return $e&&$e.clock_in_at&&!$e.clock_out_at?!0:Qe.value&&!($e&&$e.clock_in_at)}),Q=ut(()=>{const $e=qe.value;return!!($e&&$e.clock_in_at&&$e.clock_out_at)}),ke=ut(()=>{const $e=qe.value;return J.value?"下班打卡":Q.value?"已打卡 "+Bn($e==null?void 0:$e.clock_in_at)+" - "+Bn($e==null?void 0:$e.clock_out_at):"上班打卡"});async function Fe(){if(J.value)try{await wm()}catch{}else await Tf(st.value);await Ce(),tr()}mt(Ws,()=>{n.value&&Ce()});const ct=N(!1);async function It(){if((await Dr()).remind_weekly==="off"){ct.value=!1;return}const ce=new Date().getDay();if(ce===5||ce===6||ce===0){const x=await vl(Ts(st.value));ct.value=!x||!x.highlights&&!x.challenges&&!x.plan_next}else ct.value=!1}return yn(async()=>{window.addEventListener("keydown",P),n.value&&(ri(n.value.userId),await Ce(),await It(),c())}),($e,ce)=>{var x,k;return n.value?(O(),F("div",S0,[u("nav",E0,[(O(),F(je,null,it(R,b=>u("button",{key:b.key,class:Ze(["nav-btn",{active:fe.value===b.key}]),"data-tip":b.name,onClick:W=>ie(b.key)},[Te(et,{name:b.icon,size:18},null,8,["name"])],10,$0)),64))]),u("div",T0,[u("header",A0,[u("span",P0,ne(ee.value.name),1),u("button",{class:"mob-search-btn",title:"搜索",onClick:He},[Te(et,{name:"search",size:16})]),u("div",O0,[Te(et,{name:"search",size:14,class:"gs-icon"}),Ae(u("input",{ref_key:"gsInput",ref:d,class:"input gs-input","onUpdate:modelValue":ce[0]||(ce[0]=b=>h.value=b),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:A,onFocus:ce[1]||(ce[1]=b=>y.value=!0),onBlur:ue,onKeydown:Mt(V,["esc"])},null,544),[[De,h.value]]),y.value&&h.value.trim()?(O(),F("div",M0,[C.value?(O(),F(je,{key:0},[m.value.logs.length?(O(),F("div",I0,"工作记录")):Ee("",!0),(O(!0),F(je,null,it(m.value.logs,b=>(O(),F("div",{key:"l"+b.id,class:"gs-item",onMousedown:hn(W=>Z(b),["prevent"])},[u("span",D0,ne(Kt(Xo)(b.category)),1),u("span",L0,ne(b.content),1),u("span",R0,ne(b.date),1)],40,j0))),128)),m.value.memos.length?(O(),F("div",K0,"备忘录")):Ee("",!0),(O(!0),F(je,null,it(m.value.memos,b=>(O(),F("div",{key:"m"+b.id,class:"gs-item",onMousedown:hn(W=>te(b),["prevent"])},[u("span",N0,ne(b.title||"无标题"),1),u("span",V0,ne(b.content),1)],40,F0))),128))],64)):(O(),F("div",B0,"无匹配结果"))])):Ee("",!0)]),ce[12]||(ce[12]=u("span",{class:"flex1"},null,-1)),u("div",U0,[ct.value?(O(),F("button",{key:0,class:"week-tip",onClick:ce[2]||(ce[2]=b=>ie("report"))},[...ce[11]||(ce[11]=[u("span",{class:"dot",style:{background:"var(--warn)"}},null,-1),rn(" 填写本周周记 ",-1)])])):Ee("",!0),u("span",q0,ne((x=n.value)==null?void 0:x.username),1),u("button",{class:"btn btn-sm mobile-hide",onClick:o},"退出"),u("button",{class:"btn btn-primary btn-sm",disabled:Q.value,onClick:Fe},[Te(et,{name:Q.value?"check-circle":"clock",size:14},null,8,["name"]),u("span",W0,ne(ke.value),1)],8,H0)])]),u("main",z0,[u("div",G0,[fe.value==="calendar"?(O(),Lt(hg,{key:0})):fe.value==="today"?(O(),Lt(wg,{key:1})):fe.value==="stats"?(O(),Lt(Xg,{key:2})):fe.value==="report"?(O(),Lt(Jb,{key:3})):fe.value==="ledger"?(O(),Lt(c_,{key:4})):fe.value==="memo"?(O(),Lt(T_,{key:5})):fe.value==="vault"?(O(),Lt(C1,{key:6})):(O(),Lt(h0,{key:7}))])]),u("nav",Y0,[(O(!0),F(je,null,it(Kt(S),b=>(O(),F("button",{key:b.key,class:Ze(["tab-btn",{active:fe.value===b.key}]),onClick:W=>ie(b.key)},[Te(et,{name:b.icon,size:20},null,8,["name"]),u("span",null,ne(b.name),1)],10,J0))),128)),u("button",{class:Ze(["tab-btn",{active:be.value}]),onClick:ce[3]||(ce[3]=b=>z.value=!0)},[Te(et,{name:"more",size:20}),ce[13]||(ce[13]=u("span",null,"更多",-1))],2)]),z.value?(O(),F("div",{key:0,class:"sheet-mask",onClick:ce[6]||(ce[6]=b=>z.value=!1)},[u("div",{class:"more-sheet",onClick:ce[5]||(ce[5]=hn(()=>{},["stop"]))},[u("div",X0,ne((k=n.value)==null?void 0:k.username),1),(O(!0),F(je,null,it(Kt(oe),b=>(O(),F("button",{key:b.key,class:"sheet-row",onClick:W=>xe(b.key)},[Te(et,{name:b.icon,size:18},null,8,["name"]),u("span",Z0,ne(b.name),1),Te(et,{name:"chevron-right",size:14,class:"sheet-go"})],8,Q0))),128)),ce[15]||(ce[15]=u("div",{class:"sheet-divider"},null,-1)),u("button",{class:"sheet-row sheet-danger",onClick:ce[4]||(ce[4]=b=>{z.value=!1,o()})},[Te(et,{name:"close",size:18}),ce[14]||(ce[14]=u("span",{class:"sheet-name"},"退出登录",-1))])])])):Ee("",!0),Le.value?(O(),F("div",{key:1,class:"msw-mask",onClick:ce[10]||(ce[10]=hn(b=>Le.value=!1,["self"]))},[u("div",ek,[u("div",tk,[Te(et,{name:"search",size:16,class:"msw-icon"}),Ae(u("input",{ref_key:"msInput",ref:rt,class:"msw-input","onUpdate:modelValue":ce[7]||(ce[7]=b=>h.value=b),placeholder:"搜索工作记录与备忘录",onInput:A,onKeydown:ce[8]||(ce[8]=Mt(b=>Le.value=!1,["esc"]))},null,544),[[De,h.value]]),u("button",{class:"icon-btn",onClick:ce[9]||(ce[9]=b=>{V(),Le.value=!1})},[Te(et,{name:"close",size:16})])]),u("div",nk,[C.value?(O(),F(je,{key:0},[m.value.logs.length?(O(),F("div",rk,"工作记录")):Ee("",!0),(O(!0),F(je,null,it(m.value.logs,b=>(O(),F("div",{key:"l"+b.id,class:"msw-item",onMousedown:hn(W=>Ye(b),["prevent"])},[u("span",ok,ne(Kt(Xo)(b.category)),1),u("span",ik,ne(b.content),1),u("span",ak,ne(b.date),1)],40,sk))),128)),m.value.memos.length?(O(),F("div",lk,"备忘录")):Ee("",!0),(O(!0),F(je,null,it(m.value.memos,b=>(O(),F("div",{key:"m"+b.id,class:"msw-item",onMousedown:hn(W=>Ke(b),["prevent"])},[u("span",ck,ne(b.title||"无标题"),1),u("span",fk,ne(b.content),1)],40,uk))),128))],64)):h.value.trim()?(O(),F("div",dk,"无匹配结果")):Ee("",!0)])])])):Ee("",!0)]),u("div",pk,[Te(Eh,{name:"toast"},{default:fr(()=>[(O(!0),F(je,null,it(Kt(t),b=>(O(),F("div",{key:b.id,class:"toast"},ne(b.text),1))),128))]),_:1})])])):(O(),Lt(C0,{key:0,onLogin:s}))}}}),vk=Qt(hk,[["__scopeId","data-v-aa357bfc"]]);function Lo(e,t){try{let n=document.getElementById("fatal-overlay");n||(n=document.createElement("div"),n.id="fatal-overlay",n.style.cssText="position:fixed;inset:0;z-index:99999;background:#FFFFFF;color:#1D2129;padding:20px;overflow:auto;font:13px/1.7 -apple-system,PingFang SC,Microsoft YaHei,sans-serif;",n.addEventListener("click",o=>{o.target===n&&n.parentElement&&n.parentElement.removeChild(n)}),document.body.appendChild(n));const s=document.createElement("div");s.style.cssText="border:1px solid #E5484D;border-radius:8px;padding:12px;margin-bottom:12px;word-break:break-all;white-space:pre-wrap;",s.textContent=e+`
`+t,n.appendChild(s)}catch{}}async function mk(){const e=await Uv();e&&ri(e.userId);const t=Vh(vk);t.config.errorHandler=(n,s,o)=>{const a=n;Lo("应用内部错误(点击空白处关闭,请将以下内容发送给开发者)",a&&(a.stack||a.message)||String(n)+`
触发位置: `+o)},window.addEventListener("unhandledrejection",n=>{const s=n.reason;Lo("未处理的异步错误(点击空白处关闭)",s&&(s.stack||s.message)||String(n.reason))}),window.addEventListener("error",n=>{n.message&&n.message!=="ResizeObserver loop limit exceeded"&&Lo("运行错误(点击空白处关闭)",n.message)}),t.mount("#app"),"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})})}mk().catch(e=>{Lo("无法启动:连接同步服务器失败",e&&(e.stack||e.message)||String(e))});export{If as W,Pf as _,fb as b,Mf as r};