27 lines
303 KiB
JavaScript
27 lines
303 KiB
JavaScript
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const 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 Ra(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ft={},Ar=[],Sn=()=>{},Vu=()=>!1,ti=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ni=e=>e.startsWith("onUpdate:"),St=Object.assign,La=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},nd=Object.prototype.hasOwnProperty,ot=(e,t)=>nd.call(e,t),Le=Array.isArray,sr=e=>Ns(e)==="[object Map]",Bn=e=>Ns(e)==="[object Set]",Ul=e=>Ns(e)==="[object Date]",Ge=e=>typeof e=="function",bt=e=>typeof e=="string",$n=e=>typeof e=="symbol",at=e=>e!==null&&typeof e=="object",Bu=e=>(at(e)||Ge(e))&&Ge(e.then)&&Ge(e.catch),Uu=Object.prototype.toString,Ns=e=>Uu.call(e),rd=e=>Ns(e).slice(8,-1),qu=e=>Ns(e)==="[object Object]",Ka=e=>bt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bs=Ra(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ri=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},sd=/-\w/g,hn=ri(e=>e.replace(sd,t=>t.slice(1).toUpperCase())),od=/\B([A-Z])/g,fr=ri(e=>e.replace(od,"-$1").toLowerCase()),Hu=ri(e=>e.charAt(0).toUpperCase()+e.slice(1)),Xi=ri(e=>e?`on${Hu(e)}`:""),Cn=(e,t)=>!Object.is(e,t),$o=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Wu=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},si=e=>{const t=parseFloat(e);return isNaN(t)?e:t},id=e=>{const t=bt(e)?Number(e):NaN;return isNaN(t)?e:t};let ql;const oi=()=>ql||(ql=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function or(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=bt(s)?cd(s):or(s);if(o)for(const a in o)t[a]=o[a]}return t}else if(bt(e)||at(e))return e}const ad=/;(?![^(]*\))/g,ld=/:([^]+)/,ud=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function cd(e){const t={};return e.replace(ud,n=>n.startsWith("/*")?"":n).split(ad).forEach(n=>{if(n){const s=n.split(ld);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function et(e){let t="";if(bt(e))t=e;else if(Le(e))for(let n=0;n<e.length;n++){const s=et(e[n]);s&&(t+=s+" ")}else if(at(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const fd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",dd=Ra(fd);function zu(e){return!!e||e===""}function pd(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=Un(e[o],t[o],n);return s}function Hl(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),o=new Uint8Array(s.length);for(const a of e){let c=-1;for(let d=0;d<s.length;d++)if(!o[d]&&Un(a,s[d],n)){c=d;break}if(c<0)return!1;o[c]=1}return!0}function hd(e,t,n){let s=sr(e),o=sr(t);if(s||o||(s=Bn(e),o=Bn(t),s||o))return s&&o?Hl(e,t,n):!1;const a=Object.keys(e).length,c=Object.keys(t).length;if(a!==c)return!1;for(const d in e){const h=e.hasOwnProperty(d),y=t.hasOwnProperty(d);if(h&&!y||!h&&y||!Un(e[d],t[d],n))return!1}return String(e)===String(t)}function Wl(e,t,n,s){n||(n=[new Map,new Map]);const[o,a]=n;if(o.has(e)||a.has(t))return o.get(e)===t&&a.get(t)===e;o.set(e,t),a.set(t,e);const c=s(e,t,n);return o.delete(e),a.delete(t),c}function Un(e,t,n){if(e===t)return!0;let s=Ul(e),o=Ul(t);return s||o?s&&o?e.getTime()===t.getTime():!1:(s=$n(e),o=$n(t),s||o?e===t:(s=Le(e),o=Le(t),s||o?s&&o?Wl(e,t,n,pd):!1:(s=at(e),o=at(t),s||o?!s||!o?!1:Wl(e,t,n,hd):String(e)===String(t))))}function Fa(e,t){return e.findIndex(n=>Un(n,t))}const Gu=e=>!!(e&&e.__v_isRef===!0),re=e=>bt(e)?e:e==null?"":Le(e)||at(e)&&(e.toString===Uu||!Ge(e.toString))?Gu(e)?re(e.value):JSON.stringify(e,Yu,2):String(e),Yu=(e,t)=>Gu(t)?Yu(e,t.value):sr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],a)=>(n[Qi(s,a)+" =>"]=o,n),{})}:Bn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Qi(n))}:$n(t)?Qi(t):at(t)&&!Le(t)&&!qu(t)?String(t):t,Qi=(e,t="")=>{var n;return $n(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
||
* @vue/reactivity v3.5.44
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let Mt;class vd{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Mt&&(Mt.active?(this.parent=Mt,this.index=(Mt.scopes||(Mt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=Mt;try{return Mt=this,t()}finally{Mt=n}}}on(){++this._on===1&&(this.prevScope=Mt,Mt=this)}off(){if(this._on>0&&--this._on===0){if(Mt===this)Mt=this.prevScope;else{let t=Mt;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function md(){return Mt}let pt;const Zi=new WeakSet;class Ju{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Mt&&(Mt.active?Mt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Zi.has(this)&&(Zi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Qu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,zl(this),Zu(this);const t=pt,n=vn;pt=this,vn=!0;try{return this.fn()}finally{ec(this),pt=t,vn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ba(t);this.deps=this.depsTail=void 0,zl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Zi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){pa(this)&&this.run()}get dirty(){return pa(this)}}let Xu=0,ws,_s;function Qu(e,t=!1){if(e.flags|=8,t){e.next=_s,_s=e;return}e.next=ws,ws=e}function Na(){Xu++}function Va(){if(--Xu>0)return;if(_s){let t=_s;for(_s=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ws;){let t=ws;for(ws=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Zu(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ec(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Ba(s),yd(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function pa(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(tc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function tc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===As)||(e.globalVersion=As,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!pa(e))))return;e.flags|=2;const t=e.dep,n=pt,s=vn;pt=e,vn=!0;try{Zu(e);const o=e.fn(e._value);(t.version===0||Cn(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{pt=n,vn=s,ec(e),e.flags&=-3}}function Ba(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)Ba(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function yd(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let vn=!0;const nc=[];function An(){nc.push(vn),vn=!1}function Pn(){const e=nc.pop();vn=e===void 0?!0:e}function zl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=pt;pt=void 0;try{t()}finally{pt=n}}}let As=0;class gd{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 Ua{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!pt||!vn||pt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pt)n=this.activeLink=new gd(pt,this),pt.deps?(n.prevDep=pt.depsTail,pt.depsTail.nextDep=n,pt.depsTail=n):pt.deps=pt.depsTail=n,rc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=pt.depsTail,n.nextDep=void 0,pt.depsTail.nextDep=n,pt.depsTail=n,pt.deps===n&&(pt.deps=s)}return n}trigger(t){this.version++,As++,this.notify(t)}notify(t){Na();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Va()}}}function rc(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)rc(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ha=new WeakMap,Pr=Symbol(""),va=Symbol(""),Ps=Symbol("");function Kt(e,t,n){if(vn&&pt){let s=ha.get(e);s||ha.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Ua),o.map=s,o.key=n),o.track()}}function Rn(e,t,n,s,o,a){const c=ha.get(e);if(!c){As++;return}const d=h=>{h&&h.trigger()};if(Na(),t==="clear")c.forEach(d);else{const h=Le(e),y=h&&Ka(n);if(h&&n==="length"){const m=Number(s);c.forEach((k,D)=>{(D==="length"||D===Ps||!$n(D)&&D>=m)&&d(k)})}else switch((n!==void 0||c.has(void 0))&&d(c.get(n)),y&&d(c.get(Ps)),t){case"add":h?y&&d(c.get("length")):(d(c.get(Pr)),sr(e)&&d(c.get(va)));break;case"delete":h||(d(c.get(Pr)),sr(e)&&d(c.get(va)));break;case"set":sr(e)&&d(c.get(Pr));break}}Va()}function qr(e){const t=st(e);return t===e||(Kt(t,"iterate",Ps),ln(e))?t:Tn(e)?ir(e)?t.map(n=>ar(un(n))):t.map(ar):t.map(un)}function ii(e){return Kt(e=st(e),"iterate",Ps),e}function _n(e,t){return Tn(e)?ar(ir(e)?un(t):t):un(t)}const bd={__proto__:null,[Symbol.iterator](){return ea(this,Symbol.iterator,e=>_n(this,e))},concat(...e){return qr(this).concat(...e.map(t=>Le(t)?qr(t):t))},entries(){return ea(this,"entries",e=>(e[1]=_n(this,e[1]),e))},every(e,t){return In(this,"every",e,t,void 0,arguments)},filter(e,t){return In(this,"filter",e,t,n=>n.map(s=>_n(this,s)),arguments)},find(e,t){return In(this,"find",e,t,n=>_n(this,n),arguments)},findIndex(e,t){return In(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return In(this,"findLast",e,t,n=>_n(this,n),arguments)},findLastIndex(e,t){return In(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return In(this,"forEach",e,t,void 0,arguments)},includes(...e){return ta(this,"includes",e)},indexOf(...e){return ta(this,"indexOf",e)},join(e){return qr(this).join(e)},lastIndexOf(...e){return ta(this,"lastIndexOf",e)},map(e,t){return In(this,"map",e,t,void 0,arguments)},pop(){return ps(this,"pop")},push(...e){return ps(this,"push",e)},reduce(e,...t){return Yl(this,"reduce",e,t)},reduceRight(e,...t){return Yl(this,"reduceRight",e,t)},shift(){return ps(this,"shift")},some(e,t){return In(this,"some",e,t,void 0,arguments)},splice(...e){return ps(this,"splice",e)},toReversed(){return qr(this).toReversed()},toSorted(e){return qr(this).toSorted(e)},toSpliced(...e){return qr(this).toSpliced(...e)},unshift(...e){return ps(this,"unshift",e)},values(){return ea(this,"values",e=>_n(this,e))}};function ea(e,t,n){const s=ii(e),o=s[t],a=o.call(s);if(s!==e&&!ln(e)){if(a[Symbol.toStringTag]==="Array Iterator"){const c=Object.create(Object.getPrototypeOf(a));return c.next=()=>Gl(a.next(),n),o!==sc[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=()=>Gl(a._next(),n)}return a}function Gl(e,t){return e.done||(e.value=t(e.value)),e}const sc=Array.prototype;function In(e,t,n,s,o,a){const c=ii(e),d=c!==e&&!ln(e),h=c[t];if(h!==sc[t]){const k=h.apply(e,a);return d?un(k):k}let y=n;c!==e&&(d?y=function(k,D){return n.call(this,_n(e,k),D,e)}:n.length>2&&(y=function(k,D){return n.call(this,k,D,e)}));const m=h.call(c,y,s);return d&&o?o(m):m}function Yl(e,t,n,s){const o=ii(e),a=o!==e&&!ln(e);let c=n,d=!1;o!==e&&(a?(d=s.length===0,c=function(y,m,k){return d&&(d=!1,y=_n(e,y)),n.call(this,y,_n(e,m),k,e)}):n.length>3&&(c=function(y,m,k){return n.call(this,y,m,k,e)}));const h=o[t](c,...s);return d?_n(e,h):h}function ta(e,t,n){const s=st(e);Kt(s,"iterate",Ps);const o=s[t](...n);return(o===-1||o===!1)&&za(n[0])?(n[0]=st(n[0]),s[t](...n)):o}function ps(e,t,n=[]){An(),Na();const s=st(e)[t].apply(e,n);return Va(),Pn(),s}const wd=Ra("__proto__,__v_isRef,__isVue"),oc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter($n));function _d(e){$n(e)||(e=String(e));const t=st(this);return Kt(t,"has",e),t.hasOwnProperty(e)}class ic{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?Od:cc:a?uc:lc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const c=Le(t);if(!o){let h;if(c&&(h=bd[n]))return h;if(n==="hasOwnProperty")return _d}const d=Reflect.get(t,n,Nt(t)?t:s);if(($n(n)?oc.has(n):wd(n))||(o||Kt(t,"get",n),a))return d;if(Nt(d)){const h=c&&Ka(n)?d:d.value;return o&&at(h)?ya(h):h}return at(d)?o?ya(d):Ha(d):d}}class ac extends ic{constructor(t=!1){super(!1,t)}set(t,n,s,o){let a=t[n];const c=Le(t)&&Ka(n);if(!this._isShallow){const y=Tn(a);if(!ln(s)&&!Tn(s)&&(a=st(a),s=st(s)),!c&&Nt(a)&&!Nt(s))return y||(a.value=s),!0}const d=c?Number(n)<t.length:ot(t,n),h=Reflect.set(t,n,s,Nt(t)?t:o);return t===st(o)&&h&&(d?Cn(s,a)&&Rn(t,"set",n,s):Rn(t,"add",n,s)),h}deleteProperty(t,n){const s=ot(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Rn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!$n(n)||!oc.has(n))&&Kt(t,"has",n),s}ownKeys(t){return Kt(t,"iterate",Le(t)?"length":Pr),Reflect.ownKeys(t)}}class kd extends ic{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const xd=new ac,Cd=new kd,Ed=new ac(!0);const ma=e=>e,wo=e=>Reflect.getPrototypeOf(e);function Sd(e,t,n){return function(...s){const o=this.__v_raw,a=st(o),c=sr(a),d=e==="entries"||e===Symbol.iterator&&c,h=e==="keys"&&c,y=o[e](...s),m=n?ma:t?ar:un;return!t&&Kt(a,"iterate",h?va:Pr),St(Object.create(y),{next(){const{value:k,done:D}=y.next();return D?{value:k,done:D}:{value:d?[m(k[0]),m(k[1])]:m(k),done:D}}})}}function _o(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function $d(e,t){const n={get(o){const a=this.__v_raw,c=st(a),d=st(o);e||(Cn(o,d)&&Kt(c,"get",o),Kt(c,"get",d));const{has:h}=wo(c),y=t?ma:e?ar:un;if(h.call(c,o))return y(a.get(o));if(h.call(c,d))return y(a.get(d));a!==c&&a.get(o)},get size(){const o=this.__v_raw;return!e&&Kt(st(o),"iterate",Pr),o.size},has(o){const a=this.__v_raw,c=st(a),d=st(o);return e||(Cn(o,d)&&Kt(c,"has",o),Kt(c,"has",d)),o===d?a.has(o):a.has(o)||a.has(d)},forEach(o,a){const c=this,d=c.__v_raw,h=st(d),y=t?ma:e?ar:un;return!e&&Kt(h,"iterate",Pr),d.forEach((m,k)=>o.call(a,y(m),y(k),c))}};return St(n,e?{add:_o("add"),set:_o("set"),delete:_o("delete"),clear:_o("clear")}:{add(o){const a=st(this),c=wo(a),d=st(o),h=!t&&!ln(o)&&!Tn(o)?d:o;return c.has.call(a,h)||Cn(o,h)&&c.has.call(a,o)||Cn(d,h)&&c.has.call(a,d)||(a.add(h),Rn(a,"add",h,h)),this},set(o,a){!t&&!ln(a)&&!Tn(a)&&(a=st(a));const c=st(this),{has:d,get:h}=wo(c);let y=d.call(c,o);y||(o=st(o),y=d.call(c,o));const m=h.call(c,o);return c.set(o,a),y?Cn(a,m)&&Rn(c,"set",o,a):Rn(c,"add",o,a),this},delete(o){const a=st(this),{has:c,get:d}=wo(a);let h=c.call(a,o);h||(o=st(o),h=c.call(a,o)),d&&d.call(a,o);const y=a.delete(o);return h&&Rn(a,"delete",o,void 0),y},clear(){const o=st(this),a=o.size!==0,c=o.clear();return a&&Rn(o,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Sd(o,e,t)}),n}function qa(e,t){const n=$d(e,t);return(s,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?s:Reflect.get(ot(n,o)&&o in s?n:s,o,a)}const Ad={get:qa(!1,!1)},Pd={get:qa(!1,!0)},Td={get:qa(!0,!1)};const lc=new WeakMap,uc=new WeakMap,cc=new WeakMap,Od=new WeakMap;function Md(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ha(e){return Tn(e)?e:Wa(e,!1,xd,Ad,lc)}function Id(e){return Wa(e,!1,Ed,Pd,uc)}function ya(e){return Wa(e,!0,Cd,Td,cc)}function Wa(e,t,n,s,o){if(!at(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const a=o.get(e);if(a)return a;const c=Md(rd(e));if(c===0)return e;const d=new Proxy(e,c===2?s:n);return o.set(e,d),d}function ir(e){return Tn(e)?ir(e.__v_raw):!!(e&&e.__v_isReactive)}function Tn(e){return!!(e&&e.__v_isReadonly)}function ln(e){return!!(e&&e.__v_isShallow)}function za(e){return e?!!e.__v_raw:!1}function st(e){const t=e&&e.__v_raw;return t?st(t):e}function jd(e){return!ot(e,"__v_skip")&&Object.isExtensible(e)&&Wu(e,"__v_skip",!0),e}const un=e=>at(e)?Ha(e):e,ar=e=>at(e)?ya(e):e;function Nt(e){return e?e.__v_isRef===!0:!1}function V(e){return Dd(e,!1)}function Dd(e,t){return Nt(e)?e:new Rd(e,t)}class Rd{constructor(t,n){this.dep=new Ua,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:st(t),this._value=n?t:un(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||ln(t)||Tn(t);t=s?t:st(t),Cn(t,n)&&(this._rawValue=t,this._value=s?t:un(t),this.dep.trigger())}}function Qt(e){return Nt(e)?e.value:e}const Ld={get:(e,t,n)=>t==="__v_raw"?e:Qt(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Nt(o)&&!Nt(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function fc(e){return ir(e)?e:new Proxy(e,Ld)}class Kd{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ua(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=As-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&pt!==this)return Qu(this,!0),!0}get value(){const t=this.dep.track();return tc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Fd(e,t,n=!1){let s,o;return Ge(e)?s=e:(s=e.get,o=e.set),new Kd(s,o,n)}const ko={},jo=new WeakMap;let Er;function Nd(e,t=!1,n=Er){if(n){let s=jo.get(n);s||jo.set(n,s=[]),s.push(e)}}function Vd(e,t,n=ft){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:d,call:h}=n,y=G=>o?G:ln(G)||o===!1||o===0?Ln(G,1):Ln(G);let m,k,D,T,L=!1,X=!1;if(Nt(e)?(k=()=>e.value,L=ln(e)):ir(e)?(k=()=>y(e),L=!0):Le(e)?(X=!0,L=e.some(G=>ir(G)||ln(G)),k=()=>e.map(G=>{if(Nt(G))return G.value;if(ir(G))return y(G);if(Ge(G))return h?h(G,2):G()})):Ge(e)?t?k=h?()=>h(e,2):e:k=()=>{if(D){An();try{D()}finally{Pn()}}const G=Er;Er=m;try{return h?h(e,3,[T]):e(T)}finally{Er=G}}:k=Sn,t&&o){const G=k,de=o===!0?1/0:o;k=()=>Ln(G(),de)}const ce=md(),Q=()=>{m.stop(),ce&&ce.active&&La(ce.effects,m)};if(a&&t){const G=t;t=(...de)=>{try{return G(...de)}finally{Q()}}}let S=X?new Array(e.length).fill(ko):ko;const N=G=>{if(!(!(m.flags&1)||!m.dirty&&!G))if(t){const de=m.run();if(G||o||L||(X?de.some((ae,Z)=>Cn(ae,S[Z])):Cn(de,S))){const ae=Er;An();try{D&&D(),Er=m;const Z=[de,S===ko?void 0:X&&S[0]===ko?[]:S,T];S=de,h?h(t,3,Z):t(...Z)}finally{Er=ae,Pn()}}}else m.run()};return d&&d(N),m=new Ju(k),m.scheduler=c?()=>c(N,!1):N,T=G=>Nd(G,!1,m),D=m.onStop=()=>{const G=jo.get(m);if(G){if(h)h(G,4);else for(const de of G)de();jo.delete(m)}},t?s?N(!0):S=m.run():c?c(N.bind(null,!0),!0):m.run(),Q.pause=m.pause.bind(m),Q.resume=m.resume.bind(m),Q.stop=Q,Q}function Ln(e,t=1/0,n){if(t<=0||!at(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Nt(e))Ln(e.value,t,n);else if(Le(e))for(let s=0;s<e.length;s++)Ln(e[s],t,n);else if(Bn(e)||sr(e))e.forEach(s=>{Ln(s,t,n)});else if(qu(e)){for(const s in e)Ln(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ln(e[s],t,n)}return e}/**
|
||
* @vue/runtime-core v3.5.44
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function Vs(e,t,n,s){try{return s?e(...s):e()}catch(o){ai(o,t,n)}}function cn(e,t,n,s){if(Ge(e)){const o=Vs(e,t,n,s);return o&&Bu(o)&&o.catch(a=>{ai(a,t,n)}),o}if(Le(e)){const o=[];for(let a=0;a<e.length;a++)o.push(cn(e[a],t,n,s));return o}}function ai(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||ft;if(t){let d=t.parent;const h=t.proxy,y=`https://vuejs.org/error-reference/#runtime-${n}`;for(;d;){const m=d.ec;if(m){for(let k=0;k<m.length;k++)if(m[k](e,h,y)===!1)return}d=d.parent}if(a){An(),Vs(a,null,10,[e,h,y]),Pn();return}}Bd(e,n,o,s,c)}function Bd(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Wt=[];let pn=-1;const kn=[];let tr=null,Hr=0;const dc=Promise.resolve();let Do=null;function ts(e){const t=Do||dc;return e?t.then(this?e.bind(this):e):t}function Ud(e){let t=pn+1,n=Wt.length;for(;t<n;){const s=t+n>>>1,o=Wt[s],a=Ts(o);a<e||a===e&&o.flags&2?t=s+1:n=s}return t}function Ga(e){if(!(e.flags&1)){const t=Ts(e),n=Wt[Wt.length-1];!n||!(e.flags&2)&&t>=Ts(n)?Wt.push(e):Wt.splice(Ud(t),0,e),e.flags|=1,pc()}}function pc(){Do||(Do=dc.then(mc))}function qd(e){if(!Le(e))tr&&e.id===-1?tr.splice(Hr+1,0,e):e.flags&1||(kn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)kn.push(e[t]);pc()}function hc(e,t,n,s=pn+1){for(;s<Wt.length;s++){const o=Wt[s];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;Wt.splice(s,1),s=e?s-1:pn,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function vc(e,t,n=0){if(kn.length){let s=kn,o=0;if(t){s=[];for(let c=0;c<kn.length;c++){const d=kn[c];(d.i!==void 0?!d.i||d.i.uid<n:t.has(d))?kn[o++]=d:s.push(d)}}const a=[...new Set(s)].sort((c,d)=>Ts(c)-Ts(d));if(kn.length=o,tr){for(let c=0;c<a.length;c++)tr.push(a[c]);return}for(tr=a,Hr=0;Hr<tr.length;Hr++){const c=tr[Hr];c.flags&4&&(c.flags&=-2),c.flags&8||c(),c.flags&=-2}tr=null,Hr=0}}let na=!1;function Hd(e,t){if(na){e();return}const n=t===void 0?void 0:new Set(kn);e(),na=!0;try{hc(void 0,t),vc(void 0,n,t)}finally{na=!1}}const Ts=e=>e.id==null?e.flags&2?-1:1/0:e.id;function mc(e){try{for(pn=0;pn<Wt.length;pn++){const t=Wt[pn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Vs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;pn<Wt.length;pn++){const t=Wt[pn];t&&(t.flags&=-2)}pn=-1,Wt.length=0,vc(),Do=null,(Wt.length||kn.length)&&mc()}}let an=null,yc=null;function Ro(e){const t=an;return an=e,yc=e&&e.type.__scopeId||null,t}function dr(e,t=an,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&No(-1);const a=Ro(t),c=Tr.length;let d;try{d=e(...o)}finally{for(let h=Tr.length;h>c;h--)Hc();Ro(a),s._d&&No(1)}return d};return s._n=!0,s._c=!0,s._d=!0,s}function Se(e,t){if(an===null)return e;const n=pi(an),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,c,d,h=ft]=t[o];a&&(Ge(a)&&(a={mounted:a,updated:a}),a.deep&&Ln(c),s.push({dir:a,instance:n,value:c,oldValue:void 0,arg:d,modifiers:h}))}return e}function 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(),cn(h,n,8,[e.el,d,e,t]),Pn())}}function Wd(e,t){if(zt){let n=zt.provides;const s=zt.parent&&zt.parent.provides;s===n&&(n=zt.provides=Object.create(s)),n[e]=t}}function Ao(e,t,n=!1){const s=Za();if(s||zr){let o=zr?zr._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&Ge(t)?t.call(s&&s.proxy):t}}const zd=Symbol.for("v-scx"),Gd=()=>Ao(zd);function gt(e,t,n){return gc(e,t,n)}function gc(e,t,n=ft){const{immediate:s,deep:o,flush:a,once:c}=n,d=St({},n),h=t&&s||!t&&a!=="post";let y;if(Rs){if(a==="sync"){const T=Gd();y=T.__watcherHandles||(T.__watcherHandles=[])}else if(!h){const T=()=>{};return T.stop=Sn,T.resume=Sn,T.pause=Sn,T}}const m=zt;d.call=(T,L,X)=>cn(T,m,L,X);let k=!1;a==="post"?d.scheduler=T=>{T.i=m,Ht(T,m&&m.suspense)}:a!=="sync"&&(k=!0,d.scheduler=(T,L)=>{L?T():Ga(T)}),d.augmentJob=T=>{t&&(T.flags|=4),k&&(T.flags|=2,m&&(T.id=m.uid,T.i=m))};const D=Vd(e,t,d);return Rs&&(y?y.push(D):h&&D()),D}function Yd(e,t,n){const s=this.proxy,o=bt(e)?e.includes(".")?bc(s,e):()=>s[e]:e.bind(s,s);let a;Ge(t)?a=t:(a=t.handler,n=t);const c=Us(this),d=gc(o,a.bind(s),n);return c(),d}function bc(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Zn=new WeakMap,wc=Symbol("_vte"),li=e=>e.__isTeleport,Sr=e=>e&&(e.disabled||e.disabled===""),Jd=e=>e&&(e.defer||e.defer===""),Jl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Xl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ga=(e,t)=>{const n=e&&e.to;return bt(n)?t?t(n):null:n},Xd={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,a,c,d,h,y){const{mc:m,pc:k,pbc:D,o:{insert:T,querySelector:L,createText:X,createComment:ce,parentNode:Q}}=y,S=Sr(t.props);let{dynamicChildren:N}=t;const G=(Z,$,x)=>{Z.shapeFlag&16&&m(Z.children,$,x,o,a,c,d,h)},de=(Z=t)=>{const $=Sr(Z.props),x=Z.target=ga(Z.props,L),le=ba(x,Z,X,T);x&&(c!=="svg"&&Jl(x)?c="svg":c!=="mathml"&&Xl(x)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(x),$||(G(Z,x,le),ms(Z,!1)))},ae=Z=>{const $=()=>{if(Zn.get(Z)===$){if(Zn.delete(Z),Sr(Z.props)){const x=Q(Z.el)||n;G(Z,x,Z.anchor),ms(Z,!0)}de(Z)}};Zn.set(Z,$),Ht($,a)};if(e==null){const Z=t.el=X(""),$=t.anchor=X("");if(T(Z,n,s),T($,n,s),Jd(t.props)||a&&a.pendingBranch){ae(t);return}S&&(G(t,n,$),ms(t,!0)),de()}else{t.el=e.el;const Z=t.anchor=e.anchor,$=Zn.get(e);if($){$.flags|=8,Zn.delete(e),ae(t);return}t.targetStart=e.targetStart;const x=t.target=e.target,le=t.targetAnchor=e.targetAnchor,ke=Sr(e.props),J=ke?n:x,xe=ke?Z:le;if(c==="svg"||Jl(x)?c="svg":(c==="mathml"||Xl(x))&&(c="mathml"),N?(D(e.dynamicChildren,N,J,o,a,c,d),Qa(e,t,!0)):h||k(e,t,J,xe,o,a,c,d,!1),S)ke?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):xo(t,n,Z,y,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Ve=ga(t.props,L);Ve&&(t.target=Ve,xo(t,Ve,null,y,0))}else ke&&xo(t,x,le,y,1);ms(t,S)}},remove(e,t,n,{um:s,o:{remove:o}},a){const{shapeFlag:c,children:d,anchor:h,targetStart:y,targetAnchor:m,target:k,props:D}=e,T=Sr(D),L=a||!T,X=Zn.get(e);if(X&&(X.flags|=8,Zn.delete(e)),k&&(o(y),o(m)),a&&o(h),!X&&(T||k)&&c&16)for(let ce=0;ce<d.length;ce++){const Q=d[ce];s(Q,t,n,L,!!Q.dynamicChildren)}},move:xo,hydrate:Qd};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,k=a===2;if(k&&s(c,t,n),!Zn.has(e)&&(!k||Sr(m))&&h&16)for(let D=0;D<y.length;D++)o(y[D],t,n,2);k&&s(d,t,n)}function Qd(e,t,n,s,o,a,{o:{nextSibling:c,parentNode:d,querySelector:h,insert:y,createText:m}},k){function D(ce,Q){let S=Q;for(;S;){if(S&&S.nodeType===8){if(S.data==="teleport start anchor")t.targetStart=S;else if(S.data==="teleport anchor"){t.targetAnchor=S,ce._lpa=t.targetAnchor&&c(t.targetAnchor);break}}S=c(S)}}function T(ce,Q){Q.anchor=k(c(ce),Q,d(ce),n,s,o,a)}const L=t.target=ga(t.props,h),X=Sr(t.props);if(L){const ce=L._lpa||L.firstChild;t.shapeFlag&16&&(X?(T(e,t),D(L,ce),t.targetAnchor||ba(L,t,m,y,d(e)===L?e:null)):(t.anchor=c(e),D(L,ce),t.targetAnchor||ba(L,t,m,y),k(ce&&c(ce),t,L,n,s,o,a))),ms(t,X)}else X&&t.shapeFlag&16&&(T(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const Bs=Xd;function ms(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function ba(e,t,n,s,o=null){const a=t.targetStart=n(""),c=t.targetAnchor=n("");return a[wc]=c,e&&(s(a,e,o),s(c,e,o)),c}const on=Symbol("_leaveCb"),hs=Symbol("_enterCb");function _c(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return fn(()=>{e.isMounted=!0}),Ac(()=>{e.isUnmounting=!0}),e}const sn=[Function,Array],kc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:sn,onEnter:sn,onAfterEnter:sn,onEnterCancelled:sn,onBeforeLeave:sn,onLeave:sn,onAfterLeave:sn,onLeaveCancelled:sn,onBeforeAppear:sn,onAppear:sn,onAfterAppear:sn,onAppearCancelled:sn},Zd={name:"BaseTransition",props:kc,setup(e,{slots:t}){const n=Za(),s=_c();return()=>{const o=t.default&&Ya(t.default(),!0),a=o&&o.length?xc(o):n.subTree?Ee():void 0;if(!a)return;const c=st(e),{mode:d}=c;if(s.isLeaving)return ra(a);const h=Lo(a);if(!h)return ra(a);let y=Os(h,c,s,n,k=>y=k);h.type!==Ft&&lr(h,y);let m=n.subTree&&Lo(n.subTree);if(m&&m.type!==Ft&&!$r(m,h)&&Ms(n.subTree)){let k=Os(m,c,s,n);if(lr(m,k),d==="out-in"&&h.type!==Ft)return s.isLeaving=!0,k.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete k.afterLeave,m=void 0},ra(a);d==="in-out"&&h.type!==Ft?k.delayLeave=(D,T,L)=>{const X=Cc(s,m);X[String(m.key)]=m,D[on]=()=>{T(),D[on]=void 0,delete y.delayedLeave,m=void 0},y.delayedLeave=()=>{L(),delete y.delayedLeave,m=void 0}}:m=void 0}else m&&(m=void 0);return a}}};function xc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ft){t=n;break}}return t}const ep=Zd;function Cc(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Os(e,t,n,s,o){const{appear:a,mode:c,persisted:d=!1,onBeforeEnter:h,onEnter:y,onAfterEnter:m,onEnterCancelled:k,onBeforeLeave:D,onLeave:T,onAfterLeave:L,onLeaveCancelled:X,onBeforeAppear:ce,onAppear:Q,onAfterAppear:S,onAppearCancelled:N}=t,G=String(e.key),de=Cc(n,e),ae=(x,le)=>{x&&cn(x,s,9,le)},Z=(x,le)=>{const ke=le[1];ae(x,le),Le(x)?x.every(J=>J.length<=1)&&ke():x.length<=1&&ke()},$={mode:c,persisted:d,beforeEnter(x){let le=h;if(!n.isMounted)if(a)le=ce||h;else return;x[on]&&x[on](!0);const ke=de[G];if(ke&&$r(e,ke)){let J=ke.el[on];if(!J){const xe=Ms(ke);J=xe&&xe.el[on]}J&&J()}ae(le,[x])},enter(x){if(de[G]===e)return;let le=y,ke=m,J=k;if(!n.isMounted)if(a)le=Q||y,ke=S||m,J=N||k;else return;let xe=!1;x[hs]=nt=>{xe||(xe=!0,nt?ae(J,[x]):ae(ke,[x]),$.delayedLeave&&$.delayedLeave(),x[hs]=void 0)};const Ve=x[hs].bind(null,!1);le?Z(le,[x,Ve]):Ve()},leave(x,le){const ke=String(e.key);if(x[hs]&&x[hs](!0),n.isUnmounting)return le();ae(D,[x]);let J=!1;x[on]=Ve=>{J||(J=!0,le(),Ve?ae(X,[x]):ae(L,[x]),x[on]=void 0,de[ke]===e&&delete de[ke])};const xe=x[on].bind(null,!1);de[ke]=e,T?Z(T,[x,xe]):xe()},clone(x){const le=Os(x,t,n,s,o);return o&&o(le),le}};return $}function ra(e){if(ui(e))return e=ur(e),e.children=null,e}function Lo(e){if(!ui(e))return li(e.type)&&e.children?xc(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ge(n.default))return n.default()}}function lr(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;lr(li(n.type)&&Lo(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===Re&&Le(e.children)){const n=Ic(e.children,!1);n&&lr(n,t)}}function Ya(e,t=!1,n){let s=[],o=0;for(let a=0;a<e.length;a++){let c=e[a];const d=n==null?c.key:String(n)+String(c.key!=null?c.key:a);c.type===Re?(c.patchFlag&128&&o++,s=s.concat(Ya(c.children,t,d))):(t||c.type!==Ft)&&s.push(d!=null?ur(c,{key:d}):c)}if(o>1)for(let a=0;a<s.length;a++)s[a].patchFlag=-2;return s}function Ms(e){if(e.component)return Ms(e.component.subTree);if(e.type===Re){const t=Le(e.children)&&Ic(e.children,!1);return t?Ms(t):void 0}if(e.type!==Ft)return e}function Vt(e,t){return Ge(e)?St({name:e.name},t,{setup:e}):e}function Ec(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ql(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ko=new WeakMap;function ks(e,t,n,s,o=!1){if(Le(e)){e.forEach((X,ce)=>ks(X,t&&(Le(t)?t[ce]:t),n,s,o));return}if(xs(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ks(e,t,n,s.component.subTree);return}const a=s.shapeFlag&4?pi(s.component):s.el,c=o?null:a,{i:d,r:h}=e,y=t&&t.r,m=d.refs===ft?d.refs={}:d.refs,k=d.setupState,D=st(k),T=k===ft?Vu:X=>Ql(m,X)?!1:ot(D,X),L=(X,ce)=>!(ce&&Ql(m,ce));if(y!=null&&y!==h){if(Zl(t),bt(y))m[y]=null,T(y)&&(k[y]=null);else if(Nt(y)){const X=t;L(y,X.k)&&(y.value=null),X.k&&(m[X.k]=null)}}if(Ge(h))Vs(h,d,12,[c,m]);else{const X=bt(h),ce=Nt(h);if(X||ce){const Q=()=>{if(e.f){const S=X?T(h)?k[h]:m[h]:L()||!e.k?h.value:m[e.k];if(o)Le(S)&&La(S,a);else if(Le(S))S.includes(a)||S.push(a);else if(X)m[h]=[a],T(h)&&(k[h]=m[h]);else{const N=[a];L(h,e.k)&&(h.value=N),e.k&&(m[e.k]=N)}}else X?(m[h]=c,T(h)&&(k[h]=c)):ce&&(L(h,e.k)&&(h.value=c),e.k&&(m[e.k]=c))};if(c){const S=()=>{Q(),Ko.delete(e)};S.id=-1,Ko.set(e,S),Ht(S,n)}else Zl(e),Q()}}}function Zl(e){const t=Ko.get(e);t&&(t.flags|=8,Ko.delete(e))}oi().requestIdleCallback;oi().cancelIdleCallback;const xs=e=>!!e.type.__asyncLoader,ui=e=>e.type.__isKeepAlive;function tp(e,t){Sc(e,"a",t)}function np(e,t){Sc(e,"da",t)}function Sc(e,t,n=zt){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ci(t,s,n),n){let o=n.parent;for(;o&&o.parent;)ui(o.parent.vnode)&&rp(s,t,n,o),o=o.parent}}function rp(e,t,n,s){const o=ci(t,e,s,!0);pr(()=>{La(s[t],o)},n)}function ci(e,t,n=zt,s=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...c)=>{An();const d=Us(n),h=cn(t,n,e,c);return d(),Pn(),h});return s?o.unshift(a):o.push(a),a}}const qn=e=>(t,n=zt)=>{(!Rs||e==="sp")&&ci(e,(...s)=>t(...s),n)},sp=qn("bm"),fn=qn("m"),op=qn("bu"),$c=qn("u"),Ac=qn("bum"),pr=qn("um"),ip=qn("sp"),ap=qn("rtg"),lp=qn("rtc");function up(e,t=zt){ci("ec",e,t)}const cp=Symbol.for("v-ndc");function ut(e,t,n,s){let o;const a=n,c=Le(e);if(c||bt(e)){const d=c&&ir(e);let h=!1,y=!1;d&&(h=!ln(e),y=Tn(e),e=ii(e)),o=new Array(e.length);for(let m=0,k=e.length;m<k;m++)o[m]=t(h?y?ar(un(e[m])):un(e[m]):e[m],m,void 0,a)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)o=[];else{o=new Array(e);for(let d=0;d<e;d++)o[d]=t(d+1,d,void 0,a)}else if(at(e))if(e[Symbol.iterator])o=Array.from(e,(d,h)=>t(d,h,void 0,a));else{const d=Object.keys(e);o=new Array(d.length);for(let h=0,y=d.length;h<y;h++){const m=d[h];o[h]=t(e[m],m,h,a)}}else o=[];return o}const wa=e=>e?Yc(e)?pi(e):wa(e.parent):null,Cs=St(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=>wa(e.parent),$root:e=>wa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Tc(e),$forceUpdate:e=>e.f||(e.f=()=>{Ga(e.update)}),$nextTick:e=>e.n||(e.n=ts.bind(e.proxy)),$watch:e=>Yd.bind(e)}),sa=(e,t)=>e!==ft&&!e.__isScriptSetup&&ot(e,t),fp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:c,type:d,appContext:h}=e;if(t[0]!=="$"){const D=c[t];if(D!==void 0)switch(D){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(sa(s,t))return c[t]=1,s[t];if(o!==ft&&ot(o,t))return c[t]=2,o[t];if(ot(a,t))return c[t]=3,a[t];if(n!==ft&&ot(n,t))return c[t]=4,n[t];_a&&(c[t]=0)}}const y=Cs[t];let m,k;if(y)return t==="$attrs"&&Kt(e.attrs,"get",""),y(e);if((m=d.__cssModules)&&(m=m[t]))return m;if(n!==ft&&ot(n,t))return c[t]=4,n[t];if(k=h.config.globalProperties,ot(k,t))return k[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:a}=e;return sa(o,t)?(o[t]=n,!0):s!==ft&&ot(s,t)?(s[t]=n,!0):ot(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:a,type:c}},d){let h;return!!(n[d]||e!==ft&&d[0]!=="$"&&ot(e,d)||sa(t,d)||ot(a,d)||ot(s,d)||ot(Cs,d)||ot(o.config.globalProperties,d)||(h=c.__cssModules)&&h[d])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ot(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function eu(e){return Le(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let _a=!0;function dp(e){const t=Tc(e),n=e.proxy,s=e.ctx;_a=!1,t.beforeCreate&&tu(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:c,watch:d,provide:h,inject:y,created:m,beforeMount:k,mounted:D,beforeUpdate:T,updated:L,activated:X,deactivated:ce,beforeDestroy:Q,beforeUnmount:S,destroyed:N,unmounted:G,render:de,renderTracked:ae,renderTriggered:Z,errorCaptured:$,serverPrefetch:x,expose:le,inheritAttrs:ke,components:J,directives:xe,filters:Ve}=t;if(y&&pp(y,s,null),c)for(const He in c){const ye=c[He];Ge(ye)&&(s[He]=ye.bind(n))}if(o){const He=o.call(n,n);at(He)&&(e.data=Ha(He))}if(_a=!0,a)for(const He in a){const ye=a[He],Oe=Ge(ye)?ye.bind(n,n):Ge(ye.get)?ye.get.bind(n,n):Sn,Fe=!Ge(ye)&&Ge(ye.set)?ye.set.bind(n):Sn,je=it({get:Oe,set:Fe});Object.defineProperty(s,He,{enumerable:!0,configurable:!0,get:()=>je.value,set:ne=>je.value=ne})}if(d)for(const He in d)Pc(d[He],s,n,He);if(h){const He=Ge(h)?h.call(n):h;Reflect.ownKeys(He).forEach(ye=>{Wd(ye,He[ye])})}m&&tu(m,e,"c");function qe(He,ye){Le(ye)?ye.forEach(Oe=>He(Oe.bind(n))):ye&&He(ye.bind(n))}if(qe(sp,k),qe(fn,D),qe(op,T),qe($c,L),qe(tp,X),qe(np,ce),qe(up,$),qe(lp,ae),qe(ap,Z),qe(Ac,S),qe(pr,G),qe(ip,x),Le(le))if(le.length){const He=e.exposed||(e.exposed={});le.forEach(ye=>{Object.defineProperty(He,ye,{get:()=>n[ye],set:Oe=>n[ye]=Oe,enumerable:!0})})}else e.exposed||(e.exposed={});de&&e.render===Sn&&(e.render=de),ke!=null&&(e.inheritAttrs=ke),J&&(e.components=J),xe&&(e.directives=xe),x&&Ec(e)}function pp(e,t,n=Sn){Le(e)&&(e=ka(e));for(const s in e){const o=e[s];let a;at(o)?"default"in o?a=Ao(o.from||s,o.default,!0):a=Ao(o.from||s):a=Ao(o),Nt(a)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:c=>a.value=c}):t[s]=a}}function tu(e,t,n){cn(Le(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Pc(e,t,n,s){let o=s.includes(".")?bc(n,s):()=>n[s];if(bt(e)){const a=t[e];Ge(a)&>(o,a)}else if(Ge(e))gt(o,e.bind(n));else if(at(e))if(Le(e))e.forEach(a=>Pc(a,t,n,s));else{const a=Ge(e.handler)?e.handler.bind(n):t[e.handler];Ge(a)&>(o,a,e)}}function Tc(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=>Fo(h,y,c,!0)),Fo(h,t,c)),at(t)&&a.set(t,h),h}function Fo(e,t,n,s=!1){const{mixins:o,extends:a}=t;a&&Fo(e,a,n,!0),o&&o.forEach(c=>Fo(e,c,n,!0));for(const c in t)if(!(s&&c==="expose")){const d=hp[c]||n&&n[c];e[c]=d?d(e[c],t[c]):t[c]}return e}const hp={data:nu,props:ru,emits:ru,methods:ys,computed:ys,beforeCreate:qt,created:qt,beforeMount:qt,mounted:qt,beforeUpdate:qt,updated:qt,beforeDestroy:qt,beforeUnmount:qt,destroyed:qt,unmounted:qt,activated:qt,deactivated:qt,errorCaptured:qt,serverPrefetch:qt,components:ys,directives:ys,watch:mp,provide:nu,inject:vp};function nu(e,t){return t?e?function(){return St(Ge(e)?e.call(this,this):e,Ge(t)?t.call(this,this):t)}:t:e}function vp(e,t){return ys(ka(e),ka(t))}function ka(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function qt(e,t){return e?[...new Set([].concat(e,t))]:t}function ys(e,t){return e?St(Object.create(null),e,t):t}function ru(e,t){return e?Le(e)&&Le(t)?[...new Set([...e,...t])]:St(Object.create(null),eu(e),eu(t??{})):t}function mp(e,t){if(!e)return t;if(!t)return e;const n=St(Object.create(null),e);for(const s in t)n[s]=qt(e[s],t[s]);return n}function Oc(){return{app:null,config:{isNativeTag:Vu,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 yp=0;function gp(e,t){return function(s,o=null){Ge(s)||(s=St({},s)),o!=null&&!at(o)&&(o=null);const a=Oc(),c=new WeakSet,d=[];let h=!1;const y=a.app={_uid:yp++,_component:s,_props:o,_container:null,_context:a,_instance:null,version:Jp,get config(){return a.config},set config(m){},use(m,...k){return c.has(m)||(m&&Ge(m.install)?(c.add(m),m.install(y,...k)):Ge(m)&&(c.add(m),m(y,...k))),y},mixin(m){return a.mixins.includes(m)||a.mixins.push(m),y},component(m,k){return k?(a.components[m]=k,y):a.components[m]},directive(m,k){return k?(a.directives[m]=k,y):a.directives[m]},mount(m,k,D){if(!h){const T=y._ceVNode||Te(s,o);return T.appContext=a,D===!0?D="svg":D===!1&&(D=void 0),e(T,m,D),h=!0,y._container=m,m.__vue_app__=y,pi(T.component)}},onUnmount(m){d.push(m)},unmount(){h&&(cn(d,y._instance,16),e(null,y._container),delete y._container.__vue_app__)},provide(m,k){return a.provides[m]=k,y},runWithContext(m){const k=zr;zr=y;try{return m()}finally{zr=k}}};return y}}let zr=null;const bp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${hn(t)}Modifiers`]||e[`${fr(t)}Modifiers`];function wp(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ft;let o=n;const a=t.startsWith("update:"),c=a&&bp(s,t.slice(7));c&&(c.trim&&(o=n.map(m=>bt(m)?m.trim():m)),c.number&&(o=o.map(si)));let d,h=s[d=Xi(t)]||s[d=Xi(hn(t))];!h&&a&&(h=s[d=Xi(fr(t))]),h&&cn(h,e,6,o);const y=s[d+"Once"];if(y){if(!e.emitted)e.emitted={};else if(e.emitted[d])return;e.emitted[d]=!0,cn(y,e,6,o)}}const _p=new WeakMap;function Mc(e,t,n=!1){const s=n?_p:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const a=e.emits;let c={},d=!1;if(!Ge(e)){const h=y=>{const m=Mc(y,t,!0);m&&(d=!0,St(c,m))};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}return!a&&!d?(at(e)&&s.set(e,null),null):(Le(a)?a.forEach(h=>c[h]=null):St(c,a),at(e)&&s.set(e,c),c)}function fi(e,t){return!e||!ti(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),ot(e,t[0].toLowerCase()+t.slice(1))||ot(e,fr(t))||ot(e,t))}function su(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[a],slots:c,attrs:d,emit:h,render:y,renderCache:m,props:k,data:D,setupState:T,ctx:L,inheritAttrs:X}=e,ce=Ro(e);let Q,S;try{if(n.shapeFlag&4){const G=o||s,de=G;Q=xn(y.call(de,G,m,k,T,D,L)),S=d}else{const G=t;Q=xn(G.length>1?G(k,{attrs:d,slots:c,emit:h}):G(k,null)),S=t.props?d:kp(d)}}catch(G){Tr.length=0,ai(G,e,1),Q=Te(Ft)}let N=Q;if(S&&X!==!1){const G=Object.keys(S),{shapeFlag:de}=N;G.length&&de&7&&(a&&G.some(ni)&&(S=xp(S,a)),N=ur(N,S,!1,!0))}if(n.dirs&&(N=ur(N,null,!1,!0),N.dirs=N.dirs?N.dirs.concat(n.dirs):n.dirs),n.transition){const G=li(N.type)&&Lo(N)||N;lr(G,n.transition)}return Q=N,Ro(ce),Q}function Ic(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(js(o)){if(o.type!==Ft||o.children==="v-if"){if(n)return;n=o}}else return}return n}const kp=e=>{let t;for(const n in e)(n==="class"||n==="style"||ti(n))&&((t||(t={}))[n]=e[n]);return t},xp=(e,t)=>{const n={};for(const s in e)(!ni(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Cp(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?ou(s,c,y):!!c;if(h&8){const m=t.dynamicProps;for(let k=0;k<m.length;k++){const D=m[k];if(jc(c,s,D)&&!fi(y,D))return!0}}}else return(o||d)&&(!d||!d.$stable)?!0:s===c?!1:s?c?ou(s,c,y):!0:!!c;return!1}function ou(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const a=s[o];if(!ot(e,a)||jc(t,e,a)&&!fi(n,a))return!0}return!1}function jc(e,t,n){const s=e[n],o=t[n];return n==="style"&&at(s)&&at(o)?!Un(s,o):s!==o}function Ep({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 Dc={},Rc=()=>Object.create(Dc),Lc=e=>Object.getPrototypeOf(e)===Dc;function Sp(e,t,n,s=!1){const o={},a=Rc();e.propsDefaults=Object.create(null),Kc(e,t,o,a);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=s?o:Id(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function $p(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:c}}=e,d=st(o),[h]=e.propsOptions;let y=!1;if((s||c>0)&&!(c&16)){if(c&8){const m=e.vnode.dynamicProps;for(let k=0;k<m.length;k++){let D=m[k];if(fi(e.emitsOptions,D))continue;const T=t[D];if(h)if(ot(a,D))T!==a[D]&&(a[D]=T,y=!0);else{const L=hn(D);o[L]=xa(h,d,L,T,e,!1)}else T!==a[D]&&(a[D]=T,y=!0)}}}else{Kc(e,t,o,a)&&(y=!0);let m;for(const k in d)(!t||!ot(t,k)&&((m=fr(k))===k||!ot(t,m)))&&(h?n&&(n[k]!==void 0||n[m]!==void 0)&&(o[k]=xa(h,d,k,void 0,e,!0)):delete o[k]);if(a!==d)for(const k in a)(!t||!ot(t,k))&&(delete a[k],y=!0)}y&&Rn(e.attrs,"set","")}function Kc(e,t,n,s){const[o,a]=e.propsOptions;let c=!1,d;if(t)for(let h in t){if(bs(h))continue;const y=t[h];let m;o&&ot(o,m=hn(h))?!a||!a.includes(m)?n[m]=y:(d||(d={}))[m]=y:fi(e.emitsOptions,h)||(!(h in s)||y!==s[h])&&(s[h]=y,c=!0)}if(a){const h=st(n),y=d||ft;for(let m=0;m<a.length;m++){const k=a[m];n[k]=xa(o,h,k,y[k],e,!ot(y,k))}}return c}function xa(e,t,n,s,o,a){const c=e[n];if(c!=null){const d=ot(c,"default");if(d&&s===void 0){const h=c.default;if(c.type!==Function&&!c.skipFactory&&Ge(h)){const{propsDefaults:y}=o;if(n in y)s=y[n];else{const m=Us(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===fr(n))&&(s=!0))}return s}const Ap=new WeakMap;function Fc(e,t,n=!1){const s=n?Ap:t.propsCache,o=s.get(e);if(o)return o;const a=e.props,c={},d=[];let h=!1;if(!Ge(e)){const m=k=>{h=!0;const[D,T]=Fc(k,t,!0);St(c,D),T&&d.push(...T)};!n&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}if(!a&&!h)return at(e)&&s.set(e,Ar),Ar;if(Le(a))for(let m=0;m<a.length;m++){const k=hn(a[m]);iu(k)&&(c[k]=ft)}else if(a)for(const m in a){const k=hn(m);if(iu(k)){const D=a[m],T=c[k]=Le(D)||Ge(D)?{type:D}:St({},D),L=T.type;let X=!1,ce=!0;if(Le(L))for(let Q=0;Q<L.length;++Q){const S=L[Q],N=Ge(S)&&S.name;if(N==="Boolean"){X=!0;break}else N==="String"&&(ce=!1)}else X=Ge(L)&&L.name==="Boolean";T[0]=X,T[1]=ce,(X||ot(T,"default"))&&d.push(k)}}const y=[c,d];return at(e)&&s.set(e,y),y}function iu(e){return e[0]!=="$"&&!bs(e)}const Ja=e=>e==="_"||e==="_ctx"||e==="$stable",Xa=e=>Le(e)?e.map(xn):[xn(e)],Pp=(e,t,n)=>{if(t._n)return t;const s=dr((...o)=>Xa(t(...o)),n);return s._c=!1,s},Nc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Ja(o))continue;const a=e[o];if(Ge(a))t[o]=Pp(o,a,s);else if(a!=null){const c=Xa(a);t[o]=()=>c}}},Vc=(e,t)=>{const n=Xa(t);e.slots.default=()=>n},Bc=(e,t,n)=>{for(const s in t)(n||!Ja(s))&&(e[s]=t[s])},Tp=(e,t,n)=>{const s=e.slots=Rc();if(e.vnode.shapeFlag&32){const o=t._;o?(Bc(s,t,n),n&&Wu(s,"_",o,!0)):Nc(t,s)}else t&&Vc(e,t)},Op=(e,t,n)=>{const{vnode:s,slots:o}=e;let a=!0,c=ft;if(s.shapeFlag&32){const d=t._;d?n&&d===1?a=!1:Bc(o,t,n):(a=!t.$stable,Nc(t,o)),c=t}else t&&(Vc(e,t),c={default:1});if(a)for(const d in o)!Ja(d)&&c[d]==null&&delete o[d]},Ht=Rp;function Mp(e){return Ip(e)}function Ip(e,t){const n=oi();n.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:c,createText:d,createComment:h,setText:y,setElementText:m,parentNode:k,nextSibling:D,setScopeId:T=Sn,insertStaticContent:L}=e,X=(w,g,P,ie=null,se=null,ue=null,ge=void 0,oe=null,we=!!g.dynamicChildren)=>{if(w===g)return;w&&!$r(w,g)&&(ie=ht(w),ne(w,se,ue,!0),w=null),g.patchFlag===-2&&(we=!1,g.dynamicChildren=null),g.dynamicChildren&&w&&w.dynamicChildren&&w.dynamicChildren.hasOnce&&(g.dynamicChildren===Ar&&(g.dynamicChildren=[]),g.dynamicChildren.hasOnce=!0);const{type:W,ref:q,shapeFlag:Y}=g;switch(W){case di:ce(w,g,P,ie);break;case Ft:Q(w,g,P,ie);break;case Po:w==null&&S(g,P,ie,ge);break;case Re:J(w,g,P,ie,se,ue,ge,oe,we);break;default:Y&1?de(w,g,P,ie,se,ue,ge,oe,we):Y&6?xe(w,g,P,ie,se,ue,ge,oe,we):(Y&64||Y&128)&&W.process(w,g,P,ie,se,ue,ge,oe,we,Jt)}q!=null&&se?ks(q,w&&w.ref,ue,g||w,!g):q==null&&w&&w.ref!=null&&ks(w.ref,null,ue,w,!0)},ce=(w,g,P,ie)=>{if(w==null)s(g.el=d(g.children),P,ie);else{const se=g.el=w.el;g.children!==w.children&&y(se,g.children)}},Q=(w,g,P,ie)=>{w==null?s(g.el=h(g.children||""),P,ie):g.el=w.el},S=(w,g,P,ie)=>{[w.el,w.anchor]=L(w.children,g,P,ie,w.el,w.anchor)},N=({el:w,anchor:g},P,ie)=>{let se;for(;w&&w!==g;)se=D(w),s(w,P,ie),w=se;s(g,P,ie)},G=({el:w,anchor:g})=>{let P;for(;w&&w!==g;)P=D(w),o(w),w=P;o(g)},de=(w,g,P,ie,se,ue,ge,oe,we)=>{if(g.type==="svg"?ge="svg":g.type==="math"&&(ge="mathml"),w==null)ae(g,P,ie,se,ue,ge,oe,we);else{const W=w.el&&w.el._isVueCE?w.el:null;try{W&&W._beginPatch(),x(w,g,se,ue,ge,oe,we)}finally{W&&W._endPatch()}}},ae=(w,g,P,ie,se,ue,ge,oe)=>{let we,W;const{props:q,shapeFlag:Y,transition:$e,dirs:Ne}=w;if(we=w.el=c(w.type,ue,q&&q.is,q),Y&8?m(we,w.children):Y&16&&$(w.children,we,null,ie,se,oa(w,ue),ge,oe),Ne&&kr(w,null,ie,"created"),Z(we,w,w.scopeId,ge,ie),q){for(const Je in q)Je!=="value"&&!bs(Je)&&a(we,Je,null,q[Je],ue,ie);"value"in q&&a(we,"value",null,q.value,ue),(W=q.onVnodeBeforeMount)&&gn(W,ie,w)}Ne&&kr(w,null,ie,"beforeMount");const Xe=jp(se,$e);Xe&&$e.beforeEnter(we),s(we,g,P),((W=q&&q.onVnodeMounted)||Xe||Ne)&&Ht(()=>{try{W&&gn(W,ie,w),Xe&&$e.enter(we),Ne&&kr(w,null,ie,"mounted")}finally{}},se)},Z=(w,g,P,ie,se)=>{if(P&&T(w,P),ie)for(let ue=0;ue<ie.length;ue++)T(w,ie[ue]);if(se){let ue=se.subTree;if(g===ue||qc(ue.type)&&(ue.ssContent===g||ue.ssFallback===g)){const ge=se.vnode;Z(w,ge,ge.scopeId,ge.slotScopeIds,se.parent)}}},$=(w,g,P,ie,se,ue,ge,oe,we=0)=>{for(let W=we;W<w.length;W++){const q=w[W]=oe?Dn(w[W]):xn(w[W]);X(null,q,g,P,ie,se,ue,ge,oe)}},x=(w,g,P,ie,se,ue,ge)=>{const oe=g.el=w.el;let{patchFlag:we,dynamicChildren:W,dirs:q}=g;we|=w.patchFlag&16;const Y=w.props||ft,$e=g.props||ft;let Ne;if(P&&xr(P,!1),(Ne=$e.onVnodeBeforeUpdate)&&gn(Ne,P,g,w),q&&kr(g,w,P,"beforeUpdate"),P&&xr(P,!0),W&&(!w.dynamicChildren||w.dynamicChildren.length!==W.length)&&(we=0,ge=!1,W=null),(Y.innerHTML&&$e.innerHTML==null||Y.textContent&&$e.textContent==null)&&m(oe,""),W?le(w.dynamicChildren,W,oe,P,ie,oa(g,se),ue):ge||ye(w,g,oe,null,P,ie,oa(g,se),ue,!1),we>0){if(we&16)ke(oe,Y,$e,P,se);else if(we&2&&Y.class!==$e.class&&a(oe,"class",null,$e.class,se),we&4&&a(oe,"style",Y.style,$e.style,se),we&8){const Xe=g.dynamicProps;for(let Je=0;Je<Xe.length;Je++){const Qe=Xe[Je],vt=Y[Qe],_t=$e[Qe];(_t!==vt||Qe==="value")&&a(oe,Qe,vt,_t,se,P)}}we&1&&w.children!==g.children&&m(oe,g.children)}else!ge&&W==null&&ke(oe,Y,$e,P,se);((Ne=$e.onVnodeUpdated)||q)&&Ht(()=>{Ne&&gn(Ne,P,g,w),q&&kr(g,w,P,"updated")},ie)},le=(w,g,P,ie,se,ue,ge)=>{for(let oe=0;oe<g.length;oe++){const we=w[oe],W=g[oe],q=we.el||Ca(we),Y=q&&(we.type===Re||!$r(we,W)||we.shapeFlag&198)?k(q):P;X(we,W,Y,null,ie,se,ue,ge,!0)}},ke=(w,g,P,ie,se)=>{if(g!==P){if(g!==ft)for(const ue in g)!bs(ue)&&!(ue in P)&&a(w,ue,g[ue],null,se,ie);for(const ue in P){if(bs(ue))continue;const ge=P[ue],oe=g[ue];ge!==oe&&ue!=="value"&&a(w,ue,oe,ge,se,ie)}"value"in P&&a(w,"value",g.value,P.value,se)}},J=(w,g,P,ie,se,ue,ge,oe,we)=>{const W=g.el=w?w.el:d(""),q=g.anchor=w?w.anchor:d("");let{patchFlag:Y,dynamicChildren:$e,slotScopeIds:Ne}=g;Ne&&(oe=oe?oe.concat(Ne):Ne),w==null?(s(W,P,ie),s(q,P,ie),$(g.children||[],P,q,se,ue,ge,oe,we)):Y>0&&Y&64&&$e&&w.dynamicChildren&&w.dynamicChildren.length===$e.length?(le(w.dynamicChildren,$e,P,se,ue,ge,oe),(g.key!=null||se&&g===se.subTree)&&Qa(w,g,!0)):ye(w,g,P,q,se,ue,ge,oe,we)},xe=(w,g,P,ie,se,ue,ge,oe,we)=>{g.slotScopeIds=oe,w==null?g.shapeFlag&512?se.ctx.activate(g,P,ie,ge,we):Ve(g,P,ie,se,ue,ge,we):nt(w,g,we)},Ve=(w,g,P,ie,se,ue,ge)=>{const oe=w.component=Up(w,ie,se);if(ui(w)&&(oe.ctx.renderer=Jt),qp(oe,!1,ge),oe.asyncDep){if(se&&se.registerDep(oe,qe,ge,ue),!w.el){const we=oe.subTree=Te(Ft);Q(null,we,g,P),w.placeholder=we.el}}else qe(oe,w,g,P,se,ue,ge)},nt=(w,g,P)=>{const ie=g.component=w.component;if(Cp(w,g,P))if(ie.asyncDep&&!ie.asyncResolved){g.el=w.el,g.placeholder=w.placeholder,He(ie,g,P);return}else ie.next=g,ie.update();else g.el=w.el,g.placeholder=w.placeholder,ie.vnode=g},qe=(w,g,P,ie,se,ue,ge)=>{const oe=()=>{if(w.isMounted){let{next:Y,bu:$e,u:Ne,parent:Xe,vnode:Je}=w;{const Bt=Uc(w);if(Bt){Y&&(Y.el=Je.el,He(w,Y,ge)),Bt.asyncDep.then(()=>{Ht(()=>{w.isUnmounted||W()},se)});return}}let Qe=Y,vt;xr(w,!1),Y?(Y.el=Je.el,He(w,Y,ge)):Y=Je,$e&&$o($e),(vt=Y.props&&Y.props.onVnodeBeforeUpdate)&&gn(vt,Xe,Y,Je),xr(w,!0);const _t=su(w),Xt=w.subTree;w.subTree=_t,X(Xt,_t,k(Xt.el),ht(Xt),w,se,ue),Y.el=_t.el,Qe===null&&Ep(w,_t.el),Ne&&Ht(Ne,se),(vt=Y.props&&Y.props.onVnodeUpdated)&&Ht(()=>gn(vt,Xe,Y,Je),se)}else{let Y;const{el:$e,props:Ne}=g,{bm:Xe,m:Je,parent:Qe,root:vt,type:_t}=w,Xt=xs(g);xr(w,!1),Xe&&$o(Xe),!Xt&&(Y=Ne&&Ne.onVnodeBeforeMount)&&gn(Y,Qe,g),xr(w,!0);{vt.ce&&vt.ce._hasShadowRoot()&&vt.ce._injectChildStyle(_t,w.parent?w.parent.type:void 0);const Bt=w.subTree=su(w);X(null,Bt,P,ie,w,se,ue),g.el=Bt.el}if(Je&&Ht(Je,se),!Xt&&(Y=Ne&&Ne.onVnodeMounted)){const Bt=g;Ht(()=>gn(Y,Qe,Bt),se)}(g.shapeFlag&256||Qe&&xs(Qe.vnode)&&Qe.vnode.shapeFlag&256)&&w.a&&Ht(w.a,se),w.isMounted=!0,g=P=ie=null}};w.scope.on();const we=w.effect=new Ju(oe);w.scope.off();const W=w.update=we.run.bind(we),q=w.job=we.runIfDirty.bind(we);q.i=w,q.id=w.uid,we.scheduler=()=>Ga(q),xr(w,!0),W()},He=(w,g,P)=>{g.component=w;const ie=w.vnode.props;w.vnode=g,w.next=null,$p(w,g.props,ie,P),Op(w,g.children,P),An(),hc(w),Pn()},ye=(w,g,P,ie,se,ue,ge,oe,we=!1)=>{const W=w&&w.children,q=w?w.shapeFlag:0,Y=g.children,{patchFlag:$e,shapeFlag:Ne}=g;if($e>0){if($e&128){Fe(W,Y,P,ie,se,ue,ge,oe,we);return}else if($e&256){Oe(W,Y,P,ie,se,ue,ge,oe,we);return}}Ne&8?(q&16&&ct(W,se,ue),Y!==W&&m(P,Y)):q&16?Ne&16?Fe(W,Y,P,ie,se,ue,ge,oe,we):ct(W,se,ue,!0):(q&8&&m(P,""),Ne&16&&$(Y,P,ie,se,ue,ge,oe,we))},Oe=(w,g,P,ie,se,ue,ge,oe,we)=>{w=w||Ar,g=g||Ar;const W=w.length,q=g.length,Y=Math.min(W,q);let $e;for($e=0;$e<Y;$e++){const Ne=g[$e]=we?Dn(g[$e]):xn(g[$e]);X(w[$e],Ne,P,null,se,ue,ge,oe,we)}W>q?ct(w,se,ue,!0,!1,Y):$(g,P,ie,se,ue,ge,oe,we,Y)},Fe=(w,g,P,ie,se,ue,ge,oe,we)=>{let W=0;const q=g.length;let Y=w.length-1,$e=q-1;for(;W<=Y&&W<=$e;){const Ne=w[W],Xe=g[W]=we?Dn(g[W]):xn(g[W]);if($r(Ne,Xe))X(Ne,Xe,P,null,se,ue,ge,oe,we);else break;W++}for(;W<=Y&&W<=$e;){const Ne=w[Y],Xe=g[$e]=we?Dn(g[$e]):xn(g[$e]);if($r(Ne,Xe))X(Ne,Xe,P,null,se,ue,ge,oe,we);else break;Y--,$e--}if(W>Y){if(W<=$e){const Ne=$e+1,Xe=Ne<q?g[Ne].el:ie;for(;W<=$e;)X(null,g[W]=we?Dn(g[W]):xn(g[W]),P,Xe,se,ue,ge,oe,we),W++}}else if(W>$e)for(;W<=Y;)ne(w[W],se,ue,!0),W++;else{const Ne=W,Xe=W,Je=new Map;for(W=Xe;W<=$e;W++){const Ot=g[W]=we?Dn(g[W]):xn(g[W]);Ot.key!=null&&Je.set(Ot.key,W)}let Qe,vt=0;const _t=$e-Xe+1;let Xt=!1,Bt=0;const Zt=new Array(_t);for(W=0;W<_t;W++)Zt[W]=0;for(W=Ne;W<=Y;W++){const Ot=w[W];if(vt>=_t){ne(Ot,se,ue,!0);continue}let $t;if(Ot.key!=null)$t=Je.get(Ot.key);else for(Qe=Xe;Qe<=$e;Qe++)if(Zt[Qe-Xe]===0&&$r(Ot,g[Qe])){$t=Qe;break}$t===void 0?ne(Ot,se,ue,!0):(Zt[$t-Xe]=W+1,$t>=Bt?Bt=$t:Xt=!0,X(Ot,g[$t],P,null,se,ue,ge,oe,we),vt++)}const hr=Xt?Dp(Zt):Ar;for(Qe=hr.length-1,W=_t-1;W>=0;W--){const Ot=Xe+W,$t=g[Ot],Me=g[Ot+1],Hn=Ot+1<q?Me.el||Ca(Me):ie;Zt[W]===0?X(null,$t,P,Hn,se,ue,ge,oe,we):Xt&&(Qe<0||W!==hr[Qe]?je($t,P,Hn,2):Qe--)}}},je=(w,g,P,ie,se=null)=>{const{el:ue,type:ge,transition:oe,children:we,shapeFlag:W}=w;if(W&6){je(w.component.subTree,g,P,ie);return}if(W&128){w.suspense.move(g,P,ie);return}if(W&64){ge.move(w,g,P,Jt);return}if(ge===Re){s(ue,g,P);for(let Y=0;Y<we.length;Y++)je(we[Y],g,P,ie);s(w.anchor,g,P);return}if(ge===Po){N(w,g,P);return}if(ie!==2&&W&1&&oe)if(ie===0)oe.persisted&&!ue[on]?s(ue,g,P):(oe.beforeEnter(ue),s(ue,g,P),Ht(()=>oe.enter(ue),se));else{const{leave:Y,delayLeave:$e,afterLeave:Ne}=oe,Xe=()=>{w.ctx.isUnmounted?o(ue):s(ue,g,P)},Je=()=>{const Qe=ue._isLeaving||!!ue[on];ue._isLeaving&&ue[on](!0),oe.persisted&&!Qe?Xe():Y(ue,()=>{Xe(),Ne&&Ne()})};$e?$e(ue,Xe,Je):Je()}else s(ue,g,P)},ne=(w,g,P,ie=!1,se=!1)=>{const{type:ue,props:ge,ref:oe,children:we,dynamicChildren:W,shapeFlag:q,patchFlag:Y,dirs:$e,cacheIndex:Ne,memo:Xe}=w;if((Y===-2||W&&W.hasOnce)&&(se=!1),oe!=null&&(An(),ks(oe,null,P,w,!0),Pn()),Ne!=null&&(!w.ctx||w.ctx===g)&&(g.renderCache[Ne]=void 0),q&256){g.ctx.deactivate(w);return}const Je=q&1&&$e,Qe=!xs(w);let vt;if(Qe&&(vt=ge&&ge.onVnodeBeforeUnmount)&&gn(vt,g,w),q&6)Ke(w.component,P,ie);else{if(q&128){w.suspense.unmount(P,ie);return}Je&&kr(w,null,g,"beforeUnmount"),q&64?w.type.remove(w,g,P,Jt,ie):W&&!W.hasOnce&&(ue!==Re||Y>0&&Y&64)?ct(W,g,P,!1,!0):(ue===Re&&Y&384||!se&&q&16)&&ct(we,g,P),ie&&F(w)}const _t=Xe!=null&&Ne==null;(Qe&&(vt=ge&&ge.onVnodeUnmounted)||Je||_t)&&Ht(()=>{vt&&gn(vt,g,w),Je&&kr(w,null,g,"unmounted"),_t&&(w.el=null)},P)},F=w=>{const{type:g,el:P,anchor:ie,transition:se}=w,ue=g===Re;if(ue&&!se){fe(P,ie);return}if(g===Po){G(w),se&&!se.persisted&&se.afterLeave&&se.afterLeave();return}const ge=ue?Ms(w):w,oe=()=>{ue?k(P)&&fe(P,ie):o(P),se&&!se.persisted&&se.afterLeave&&se.afterLeave()};if(ge&&ge.shapeFlag&1&&se&&!se.persisted){const{leave:we,delayLeave:W}=se,q=ge.el,Y=()=>we(q,oe);W?W(q,oe,Y):Y()}else oe()},fe=(w,g)=>{let P;for(;w!==g;)P=D(w),o(w),w=P;o(g)},Ke=(w,g,P)=>{const{bum:ie,scope:se,job:ue,subTree:ge,um:oe,m:we,a:W}=w;au(we),au(W),ie&&$o(ie),se.stop(),ue?(ue.flags|=8,ne(ge,w,g,P)):w.vnode.el&&ge&&(ge.transition=w.vnode.transition,ne(ge,w,g,P)),oe&&Ht(oe,g),Ht(()=>{w.isUnmounted=!0},g)},ct=(w,g,P,ie=!1,se=!1,ue=0)=>{for(let ge=ue;ge<w.length;ge++)ne(w[ge],g,P,ie,se)},ht=w=>{if(w.shapeFlag&6)return ht(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const g=D(w.anchor||w.el),P=g&&g[wc];return P?D(P):g},Yt=(w,g,P)=>{const ie=w&&g._vnode?void 0:w&&w.component?w.component.uid:Bp();Hd(()=>{w==null?g._vnode&&ne(g._vnode,null,null,!0):X(g._vnode||null,w,g,null,null,null,P),g._vnode=w},ie)},Jt={p:X,um:ne,m:je,r:F,mt:Ve,mc:$,pc:ye,pbc:le,n:ht,o:e};return{render:Yt,hydrate:void 0,createApp:gp(Yt)}}function oa({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 jp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Qa(e,t,n=!1){const s=e.children,o=t.children;if(Le(s)&&Le(o))for(let a=0;a<s.length;a++){const c=s[a];let d=o[a];d.shapeFlag&1&&!d.dynamicChildren&&((d.patchFlag<=0||d.patchFlag===32)&&(d=o[a]=Dn(o[a]),d.el=c.el),!n&&d.patchFlag!==-2&&Qa(c,d)),d.type===di&&(d.patchFlag===-1&&(d=o[a]=Dn(d)),d.el=c.el),d.type===Ft&&!d.el&&(d.el=c.el)}}function Dp(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 Uc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Uc(t)}function au(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ca(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Ca(t.subTree):null}const qc=e=>e.__isSuspense;function Rp(e,t){t&&t.pendingBranch?Le(e)?t.effects.push(...e):t.effects.push(e):qd(e)}const Re=Symbol.for("v-fgt"),di=Symbol.for("v-txt"),Ft=Symbol.for("v-cmt"),Po=Symbol.for("v-stc"),Tr=[];let rn=null;function K(e=!1){Tr.push(rn=e?null:[])}function Hc(){Tr.pop(),rn=Tr[Tr.length-1]||null}let Is=1;function No(e,t=!1){Is+=e,e<0&&rn&&t&&(rn.hasOnce=!0)}function Wc(e){return e.dynamicChildren=Is>0?rn||Ar:null,Hc(),Is>0&&rn&&rn.push(e),e}function H(e,t,n,s,o,a){return Wc(u(e,t,n,s,o,a,!0))}function It(e,t,n,s,o){return Wc(Te(e,t,n,s,o,!0))}function js(e){return e?e.__v_isVNode===!0:!1}function $r(e,t){return e.type===t.type&&e.key===t.key}const zc=({key:e})=>e??null,To=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bt(e)||Nt(e)||Ge(e)?{i:an,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,s=0,o=null,a=e===Re?0:1,c=!1,d=!1){const h={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&zc(t),ref:t&&To(t),scopeId:yc,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:an};return d?(Vo(h,n),a&128&&e.normalize(h)):n&&(h.shapeFlag|=bt(n)?8:16),Is>0&&!c&&rn&&(h.patchFlag>0||a&6)&&h.patchFlag!==32&&rn.push(h),h}const Te=Lp;function Lp(e,t=null,n=null,s=0,o=null,a=!1){if((!e||e===cp)&&(e=Ft),js(e)){const d=ur(e,t,!0);return n&&Vo(d,n),Is>0&&!a&&rn&&(d.shapeFlag&6?rn[rn.indexOf(e)]=d:rn.push(d)),d.patchFlag=-2,d}if(Gp(e)&&(e=e.__vccOpts),t){t=Kp(t);let{class:d,style:h}=t;d&&!bt(d)&&(t.class=et(d)),at(h)&&(za(h)&&!Le(h)&&(h=St({},h)),t.style=or(h))}const c=bt(e)?1:qc(e)?128:li(e)?64:at(e)?4:Ge(e)?2:0;return u(e,t,n,s,o,c,a,!0)}function Kp(e){return e?za(e)||Lc(e)?St({},e):e:null}function ur(e,t,n=!1,s=!1){const{props:o,ref:a,patchFlag:c,children:d,transition:h}=e,y=t?Np(o||{},t):o,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:y,key:y&&zc(y),ref:t&&t.ref?n&&a?Le(a)?a.concat(To(t)):[a,To(t)]:To(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:d,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Re?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:h,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ur(e.ssContent),ssFallback:e.ssFallback&&ur(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return h&&s&&lr(m,h.clone(m)),m}function nn(e=" ",t=0){return Te(di,null,e,t)}function Fp(e,t){const n=Te(Po,null,e);return n.staticCount=t,n}function Ee(e="",t=!1){return t?(K(),It(Ft,null,e)):Te(Ft,null,e)}function xn(e){return e==null||typeof e=="boolean"?Te(Ft):Le(e)?Te(Re,null,e.slice()):js(e)?Dn(e):Te(di,null,String(e))}function Dn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ur(e)}function Vo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Le(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Vo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Lc(t)?t._ctx=an:o===3&&an&&(an.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Ge(t)){if(s&65){Vo(e,{default:t});return}t={default:t,_ctx:an},n=32}else t=String(t),s&64?(n=16,t=[nn(t)]):n=8;e.children=t,e.shapeFlag|=n}function Np(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=et([t.class,s.class]));else if(o==="style")t.style=or([t.style,s.style]);else if(ti(o)){const a=t[o],c=s[o];c&&a!==c&&!(Le(a)&&a.includes(c))?t[o]=a?[].concat(a,c):c:c==null&&a==null&&!ni(o)&&(t[o]=c)}else o!==""&&(t[o]=s[o])}return t}function gn(e,t,n,s=null){cn(e,t,7,[n,s])}const Vp=Oc();let Gc=0;function Bp(){return Gc}function Up(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Vp,a={uid:Gc++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new vd(!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:Fc(s,o),emitsOptions:Mc(s,o),emit:null,emitted:null,propsDefaults:ft,inheritAttrs:s.inheritAttrs,ctx:ft,data:ft,props:ft,attrs:ft,slots:ft,refs:ft,setupState:ft,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=wp.bind(null,a),e.ce&&e.ce(a),a}let zt=null;const Za=()=>zt||an;let Bo,Ds;{const e=oi(),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)}};Bo=t("__VUE_INSTANCE_SETTERS__",n=>zt=n),Ds=t("__VUE_SSR_SETTERS__",n=>Rs=n)}const Us=e=>{const t=zt;return Bo(e),e.scope.on(),()=>{e.scope.off(),Bo(t)}},lu=()=>{zt&&zt.scope.off(),Bo(null)};function Yc(e){return e.vnode.shapeFlag&4}let Rs=!1;function qp(e,t=!1,n=!1){t&&Ds(t);const{props:s,children:o}=e.vnode,a=Yc(e);Sp(e,s,a,t),Tp(e,o,n||t);const c=a?Hp(e,t):void 0;return t&&Ds(!1),c}function Hp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,fp);const{setup:s}=n;if(s){An();const o=e.setupContext=s.length>1?zp(e):null,a=Us(e),c=Vs(s,e,0,[e.props,o]),d=Bu(c);if(Pn(),a(),(d||e.sp)&&!xs(e)&&Ec(e),d){if(c.then(lu,lu),t)return c.then(h=>{Ds(!0);try{uu(e,h,t)}finally{Ds(!1)}}).catch(h=>{ai(h,e,0)});e.asyncDep=c}else uu(e,c)}else Jc(e)}function uu(e,t,n){Ge(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:at(t)&&(e.setupState=fc(t)),Jc(e)}function Jc(e,t,n){const s=e.type;e.render||(e.render=s.render||Sn);{const o=Us(e);An();try{dp(e)}finally{Pn(),o()}}}const Wp={get(e,t){return Kt(e,"get",""),e[t]}};function zp(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Wp),slots:e.slots,emit:e.emit,expose:t}}function pi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(fc(jd(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Cs)return Cs[n](e)},has(t,n){return n in t||n in Cs}})):e.proxy}function Gp(e){return Ge(e)&&"__vccOpts"in e}const it=(e,t)=>Fd(e,t,Rs);function Yp(e,t,n){try{No(-1);const s=arguments.length;return s===2?at(t)&&!Le(t)?js(t)?Te(e,null,[t]):Te(e,t):Te(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&js(n)&&(n=[n]),Te(e,t,n))}finally{No(1)}}const Jp="3.5.44";/**
|
||
* @vue/runtime-dom v3.5.44
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let Ea;const cu=typeof window<"u"&&window.trustedTypes;if(cu)try{Ea=cu.createPolicy("vue",{createHTML:e=>e})}catch{}const Xc=Ea?e=>Ea.createHTML(e):e=>e,Xp="http://www.w3.org/2000/svg",Qp="http://www.w3.org/1998/Math/MathML",jn=typeof document<"u"?document:null,fu=jn&&jn.createElement("template"),Zp={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?jn.createElementNS(Xp,e):t==="mathml"?jn.createElementNS(Qp,e):n?jn.createElement(e,{is:n}):jn.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>jn.createTextNode(e),createComment:e=>jn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>jn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,a){const c=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{fu.innerHTML=Xc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const d=fu.content;if(s==="svg"||s==="mathml"){const h=d.firstChild;for(;h.firstChild;)d.appendChild(h.firstChild);d.removeChild(h)}t.insertBefore(d,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Qn="transition",vs="animation",Jr=Symbol("_vtc"),Qc={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},Zc=St({},kc,Qc),eh=e=>(e.displayName="Transition",e.props=Zc,e),ns=eh((e,{slots:t})=>Yp(ep,ef(e),t)),Cr=(e,t=[])=>{Le(e)?e.forEach(n=>n(...t)):e&&e(...t)},du=e=>e?Le(e)?e.some(t=>t.length>1):e.length>1:!1;function ef(e){const t={};for(const J in e)J in Qc||(t[J]=e[J]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:a=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:d=`${n}-enter-to`,appearFromClass:h=a,appearActiveClass:y=c,appearToClass:m=d,leaveFromClass:k=`${n}-leave-from`,leaveActiveClass:D=`${n}-leave-active`,leaveToClass:T=`${n}-leave-to`}=e,L=th(o),X=L&&L[0],ce=L&&L[1],{onBeforeEnter:Q,onEnter:S,onEnterCancelled:N,onLeave:G,onLeaveCancelled:de,onBeforeAppear:ae=Q,onAppear:Z=S,onAppearCancelled:$=N}=t,x=(J,xe,Ve,nt)=>{J._enterCancelled=nt,er(J,xe?m:d),er(J,xe?y:c),Ve&&Ve()},le=(J,xe)=>{J._isLeaving=!1,er(J,k),er(J,T),er(J,D),xe&&xe()},ke=J=>(xe,Ve)=>{const nt=J?Z:S,qe=()=>x(xe,J,Ve);Cr(nt,[xe,qe]),pu(()=>{er(xe,J?h:a),bn(xe,J?m:d),du(nt)||hu(xe,s,X,qe)})};return St(t,{onBeforeEnter(J){Cr(Q,[J]),bn(J,a),bn(J,c)},onBeforeAppear(J){Cr(ae,[J]),bn(J,h),bn(J,y)},onEnter:ke(!1),onAppear:ke(!0),onLeave(J,xe){J._isLeaving=!0;const Ve=()=>le(J,xe);bn(J,k),J._enterCancelled?(bn(J,D),Sa(J)):(Sa(J),bn(J,D)),pu(()=>{J._isLeaving&&(er(J,k),bn(J,T),du(G)||hu(J,s,ce,Ve))}),Cr(G,[J,Ve])},onEnterCancelled(J){x(J,!1,void 0,!0),Cr(N,[J])},onAppearCancelled(J){x(J,!0,void 0,!0),Cr($,[J])},onLeaveCancelled(J){le(J),Cr(de,[J])}})}function th(e){if(e==null)return null;if(at(e))return[ia(e.enter),ia(e.leave)];{const t=ia(e);return[t,t]}}function ia(e){return id(e)}function bn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Jr]||(e[Jr]=new Set)).add(t)}function er(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Jr];n&&(n.delete(t),n.size||(e[Jr]=void 0))}function pu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let nh=0;function hu(e,t,n,s){const o=e._endId=++nh,a=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(a,n);const{type:c,timeout:d,propCount:h}=tf(e,t);if(!c)return s();const y=c+"end";let m=0;const k=()=>{e.removeEventListener(y,D),a()},D=T=>{T.target===e&&++m>=h&&k()};setTimeout(()=>{m<h&&k()},d+1),e.addEventListener(y,D)}function tf(e,t){const n=window.getComputedStyle(e),s=L=>(n[L]||"").split(", "),o=s(`${Qn}Delay`),a=s(`${Qn}Duration`),c=vu(o,a),d=s(`${vs}Delay`),h=s(`${vs}Duration`),y=vu(d,h);let m=null,k=0,D=0;t===Qn?c>0&&(m=Qn,k=c,D=a.length):t===vs?y>0&&(m=vs,k=y,D=h.length):(k=Math.max(c,y),m=k>0?c>y?Qn:vs:null,D=m?m===Qn?a.length:h.length:0);const T=m===Qn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Qn}Property`).toString());return{type:m,timeout:k,propCount:D,hasTransform:T}}function vu(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>mu(n)+mu(e[s])))}function mu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Sa(e){return(e?e.ownerDocument:document).body.offsetHeight}function rh(e,t,n){const s=e[Jr];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const yu=Symbol("_vod"),nf=Symbol("_vsh"),sh=Symbol(""),oh=/(?:^|;)\s*display\s*:/;function ih(e,t,n){const s=e.style,o=bt(n);let a=!1;if(n&&!o){if(t)if(bt(t))for(const c of t.split(";")){const d=c.slice(0,c.indexOf(":")).trim();n[d]==null&&gs(s,d,"")}else for(const c in t)n[c]==null&&gs(s,c,"");for(const c in n){c==="display"&&(a=!0);const d=n[c];d!=null?lh(e,c,!bt(t)&&t?t[c]:void 0,d)||gs(s,c,d):gs(s,c,"")}}else if(o){if(t!==n){const c=s[sh];c&&(n+=";"+c),s.cssText=n,a=oh.test(n)}}else t&&e.removeAttribute("style");yu in e&&((!o||t!==n)&&(e[yu]=a?s.display:""),e[nf]&&(s.display="none"))}const Co=/\s*!important$/;function gs(e,t,n){if(Le(n))n.forEach(s=>gs(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=ah(e,t);Co.test(n)?e.setProperty(fr(s),n.replace(Co,""),"important"):e[s]=n}}const gu=["Webkit","Moz","ms"],aa={};function ah(e,t){const n=aa[t];if(n)return n;let s=hn(t);if(s!=="filter"&&s in e)return aa[t]=s;s=Hu(s);for(let o=0;o<gu.length;o++){const a=gu[o]+s;if(a in e)return aa[t]=a}return t}function lh(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bt(s)&&n===s}const bu="http://www.w3.org/1999/xlink";function wu(e,t,n,s,o,a=dd(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(bu,t.slice(6,t.length)):e.setAttributeNS(bu,t,n):n==null||a&&!zu(n)?e.removeAttribute(t):e.setAttribute(t,a?"":$n(n)?String(n):n)}function _u(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Xc(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=zu(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 rr(e,t,n,s){e.addEventListener(t,n,s)}function uh(e,t,n,s){e.removeEventListener(t,n,s)}const ku=Symbol("_vei");function ch(e,t,n,s,o=null){const a=e[ku]||(e[ku]={}),c=a[t];if(s&&c)c.value=s;else{const[d,h]=ph(t);if(s){const y=a[t]=mh(s,o);rr(e,d,y,h)}else c&&(uh(e,d,c,h),a[t]=void 0)}}const fh=/(Once|Passive|Capture)$/,dh=/^on:?(?:Once|Passive|Capture)$/;function ph(e){let t,n;for(;(n=e.match(fh))&&!dh.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):fr(e.slice(2)),t]}let la=0;const hh=Promise.resolve(),vh=()=>la||(hh.then(()=>la=0),la=Date.now());function mh(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(Le(o)){const a=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{a.call(s),s._stopped=!0};const c=o.slice(),d=[s];for(let h=0;h<c.length&&!s._stopped;h++){const y=c[h];y&&cn(y,t,5,d)}}else cn(o,t,5,[s])};return n.value=e,n.attached=vh(),n}const xu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,yh=(e,t,n,s,o,a)=>{const c=o==="svg";t==="class"?rh(e,s,c):t==="style"?ih(e,n,s):ti(t)?ni(t)||ch(e,t,n,s,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):gh(e,t,s,c))?(_u(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&wu(e,t,s,c,a,t!=="value")):e._isVueCE&&(bh(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bt(s)))?_u(e,hn(t),s,a,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),wu(e,t,s,c))};function gh(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&xu(t)&&Ge(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return xu(t)&&bt(n)?!1:t in e}function bh(e,t){const n=e._def.props;if(!n)return!1;const s=hn(t);return Array.isArray(n)?n.some(o=>hn(o)===s):Object.keys(n).some(o=>hn(o)===s)}const rf=new WeakMap,sf=new WeakMap,Uo=Symbol("_moveCb"),Cu=Symbol("_enterCb"),$a=new WeakMap,wh=e=>(delete e.props.mode,e),_h=wh({name:"TransitionGroup",props:St({},Zc,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Za(),s=_c();let o,a,c,d;const h=()=>(d===void 0&&(d=o.length>0&&Ph(o[0].el,n.vnode.el,Eu(e))),d);return $c(()=>{if($a.delete(n),!h()){o=[],c=void 0;return}const y=Eu(e);o.forEach(xh);const m=c&&Ah(c,n.vnode.el);c=void 0,o.forEach(D=>Ch(D,m));const k=o.filter(Eh);Sa(n.vnode.el),k.forEach(D=>{const T=D.el,L=T.style;bn(T,y),L.transform=L.webkitTransform=L.transitionDuration="";const X=T[Uo]=ce=>{ce&&ce.target!==T||(!ce||ce.propertyName.endsWith("transform"))&&(T.removeEventListener("transitionend",X),T[Uo]=null,er(T,y))};T.addEventListener("transitionend",X)}),o=[]}),()=>{const y=st(e),m=ef(y);let k=y.tag||Re;if(o=[],d=void 0,a)for(let D=0;D<a.length;D++){const T=a[D];T.el&&T.el instanceof Element&&!T.el[nf]&&(o.push(T),lr(T,Os(T,m,s,n)),rf.set(T,hi(T.el)))}a=t.default?Ya(t.default()):[];for(let D=0;D<a.length;D++){const T=a[D];T.key!=null&&lr(T,Os(T,m,s,n))}return o.length&&(c=Sh(n),$a.set(n,h)),Te(k,null,a)}}}),kh=_h;function xh(e){const t=e.el;t[Uo]&&t[Uo](),t[Cu]&&t[Cu]()}function Eu(e){return e.moveClass||`${e.name||"v"}-move`}function Ch(e,t){sf.set(e,hi(e.el,t))}function Eh(e){const t=rf.get(e),n=sf.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 hi(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function Sh(e){let t;for(let n=e.parent;n;n=n.parent){const s=$a.get(n);if(s){const o=$h(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push(St(hi(o),{item:o,willMove:s}))}}return t}function $h(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 Ah(e,t){const n=e.find(s=>s.willMove()&&s.item.contains(t));return n&&hi(n.item,n)}function Ph(e,t,n){const s=e.cloneNode(),o=e[Jr];o&&o.forEach(d=>{d.split(/\s+/).forEach(h=>h&&s.classList.remove(h))}),n.split(/\s+/).forEach(d=>d&&s.classList.add(d)),s.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(s);const{hasTransform:c}=tf(s);return a.removeChild(s),c}const Xr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Le(t)?n=>$o(t,n):t};function Th(e){e.target.composing=!0}function Su(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const En=Symbol("_assign"),Eo=Symbol("_initialValue");function ua(e,t,n){return t&&(e=e.trim()),n&&(e=si(e)),e}const De={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[Eo]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Eo]=e.defaultValue.replace(/\r\n?/g,`
|
||
`))),e[En]=Xr(o);const a=s||o.props&&o.props.type==="number";rr(e,t?"change":"input",c=>{c.target.composing||e[En](ua(e.value,n,a))}),(n||a)&&rr(e,"change",()=>{e.value=ua(e.value,n,a)}),t||(rr(e,"compositionstart",Th),rr(e,"compositionend",Su),rr(e,"change",Su))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",a=e[Eo];delete e[Eo],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[En](ua(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:a}},c){if(e[En]=Xr(c),e.composing)return;const d=(a||e.type==="number")&&!/^0\d/.test(e.value)?si(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)}},Oh={deep:!0,created(e,t,n){e[En]=Xr(n),rr(e,"change",()=>{const s=e._modelValue,o=Ls(e),a=e.checked,c=e[En];if(Le(s)){const d=Fa(s,o),h=d!==-1;if(a&&!h)c(s.concat(o));else if(!a&&h){const y=[...s];y.splice(d,1),c(y)}}else if(Bn(s)){const d=new Set(s);a?d.add(o):d.delete(o),c(d)}else c(of(e,a))})},mounted:$u,beforeUpdate(e,t,n){e[En]=Xr(n),$u(e,t,n)}};function $u(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(Le(t))o=Fa(t,s.props.value)>-1;else if(Bn(t))o=t.has(s.props.value);else{if(t===n)return;o=Un(t,of(e,!0))}e.checked!==o&&(e.checked=o)}const Fn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,rr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,h=>h.selected).map(h=>n?si(Ls(h)):Ls(h)),a=e.multiple,c=a?Bn(e._modelValue)?new Set(o):o:o[0],d=e._pendingValue=[a,a?Le(c)?o.slice():o:c];try{e[En](c)}finally{ts(()=>{e._pendingValue===d&&(e._pendingValue=void 0)})}}),e[En]=Xr(s)},mounted(e,{value:t}){Au(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[En]=Xr(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Mh(t,n[1],n[0]))&&Au(e,t)}};function Mh(e,t,n){if(!n||Le(e))return Un(e,t);if(Bn(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function Au(e,t){const n=e.multiple,s=Le(t);if(!(n&&!s&&!Bn(t))){for(let o=0,a=e.options.length;o<a;o++){const c=e.options[o],d=Ls(c);if(n)if(s){const h=typeof d;h==="string"||h==="number"?c.selected=t.some(y=>String(y)===String(d)):c.selected=Fa(t,d)>-1}else c.selected=t.has(d);else if(Un(Ls(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ls(e){return"_value"in e?e._value:e.value}function of(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ih=["ctrl","shift","alt","meta"],jh={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)=>Ih.some(n=>e[`${n}Key`]&&!t.includes(n))},Mr=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(o,...a)=>{for(let c=0;c<t.length;c++){const d=jh[t[c]];if(d&&d(o,t))return}return e(o,...a)})},Dh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},jt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=o=>{if(!("key"in o))return;const a=fr(o.key);if(t.some(c=>c===a||Dh[c]===a))return e(o)})},Rh=St({patchProp:yh},Zp);let Pu;function Lh(){return Pu||(Pu=Mp(Rh))}const Kh=(...e)=>{const t=Lh().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Nh(s);if(!o)return;const a=t._component;!Ge(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,Fh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function Fh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Nh(e){return bt(e)?document.querySelector(e):e}function At(e){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">'+e+"</svg>"}const Vh={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"/>')},Bh=["innerHTML"],lt=Vt({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=it(()=>Vh[t.name]||"");return(s,o)=>(K(),H("span",{class:"icon",style:or({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,Bh))}}),Uh=["aria-label"],qh={class:"dialog-title"},Hh={class:"dialog-msg"},Wh={class:"dialog-btns"},zh=Vt({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmText:{default:"确认"},cancelText:{default:"取消"},danger:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(e,{emit:t}){const n=e,s=t;function o(a){n.open&&a.key==="Escape"&&s("cancel")}return gt(()=>n.open,a=>{a?window.addEventListener("keydown",o):window.removeEventListener("keydown",o)}),pr(()=>window.removeEventListener("keydown",o)),(a,c)=>(K(),It(Bs,{to:"body"},[Te(ns,{name:"modal"},{default:dr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:c[2]||(c[2]=Mr(d=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",qh,re(e.title),1),u("div",Hh,re(e.message),1),u("div",Wh,[u("button",{class:"btn btn-sm",onClick:c[0]||(c[0]=d=>s("cancel"))},re(e.cancelText),1),u("button",{class:et(["btn btn-sm",e.danger?"btn-danger-solid":"btn-primary"]),onClick:c[1]||(c[1]=d=>s("confirm"))},re(e.confirmText),3)])],8,Uh)])):Ee("",!0)]),_:1})]))}}),Gt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},cr=Gt(zh,[["__scopeId","data-v-f27041d4"]]);var Tu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var af={exports:{}};(function(e,t){((n,s)=>{e.exports=s()})(Tu,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:Tu,c=Object.keys,d=Array.isArray;function h(r,i){return typeof i=="object"&&c(i).forEach(function(l){r[l]=i[l]}),r}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var y=Object.getPrototypeOf,m={}.hasOwnProperty;function k(r,i){return m.call(r,i)}function D(r,i){typeof i=="function"&&(i=i(y(r))),(typeof Reflect>"u"?c:Reflect.ownKeys)(i).forEach(function(l){L(r,l,i[l])})}var T=Object.defineProperty;function L(r,i,l,f){T(r,i,h(l&&k(l,"get")&&typeof l.get=="function"?{get:l.get,set:l.set,configurable:!0}:{value:l,configurable:!0,writable:!0},f))}function X(r){return{from:function(i){return r.prototype=Object.create(i.prototype),L(r.prototype,"constructor",r),{extend:D.bind(null,r.prototype)}}}}var ce=Object.getOwnPropertyDescriptor,Q=[].slice;function S(r,i,l){return Q.call(r,i,l)}function N(r,i){return i(r)}function G(r){if(!r)throw new Error("Assertion Failed")}function de(r){a.setImmediate?setImmediate(r):setTimeout(r,0)}function ae(r,i){if(typeof i=="string"&&k(r,i))return r[i];if(!i)return r;if(typeof i!="string"){for(var l=[],f=0,p=i.length;f<p;++f){var v=ae(r,i[f]);l.push(v)}return l}var b,_=i.indexOf(".");return _===-1||(b=r[i.substr(0,_)])==null?void 0:ae(b,i.substr(_+1))}function Z(r,i,l){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){G(typeof l!="string"&&"length"in l);for(var f=0,p=i.length;f<p;++f)Z(r,i[f],l[f])}else{var v=i.indexOf(".");if(v!==-1){var b=i.substr(0,v),v=i.substr(v+1);if(v==="")l===void 0?d(r)&&!isNaN(parseInt(b))?r.splice(b,1):delete r[b]:r[b]=l;else{var _=r[b];if(!_||!k(r,b)){if(l===void 0)return;_=r[b]={}}Z(_,v,l)}}else l===void 0?d(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=l}}function $(r){var i,l={};for(i in r)k(r,i)&&(l[i]=r[i]);return l}var x=[].concat;function le(r){return x.apply([],r)}var ne="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(le([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return a[r]}),ke=new Set(ne.map(function(r){return a[r]})),J=null;function xe(r){return J=new WeakMap,r=function i(l){if(!l||typeof l!="object")return l;var f=J.get(l);if(f)return f;if(d(l)){f=[],J.set(l,f);for(var p=0,v=l.length;p<v;++p)f.push(i(l[p]))}else if(ke.has(l.constructor))f=l;else{var b,_=y(l);for(b in f=_===Object.prototype?{}:Object.create(_),J.set(l,f),l)k(l,b)&&(f[b]=i(l[b]))}return f}(r),J=null,r}var Ve={}.toString;function nt(r){return Ve.call(r).slice(8,-1)}var qe=typeof Symbol<"u"?Symbol.iterator:"@@iterator",He=typeof qe=="symbol"?function(r){var i;return r!=null&&(i=r[qe])&&i.apply(r)}:function(){return null};function ye(r,i){i=r.indexOf(i),0<=i&&r.splice(i,1)}var Oe={};function Fe(r){var i,l,f,p;if(arguments.length===1){if(d(r))return r.slice();if(this===Oe&&typeof r=="string")return[r];if(p=He(r))for(l=[];!(f=p.next()).done;)l.push(f.value);else{if(r==null)return[r];if(typeof(i=r.length)!="number")return[r];for(l=new Array(i);i--;)l[i]=r[i]}}else for(i=arguments.length,l=new Array(i);i--;)l[i]=arguments[i];return l}var je=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},ne=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Je=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(ne),F={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function fe(r,i){this.name=r,this.message=i}function Ke(r,i){return r+". Errors: "+Object.keys(i).map(function(l){return i[l].toString()}).filter(function(l,f,p){return p.indexOf(l)===f}).join(`
|
||
`)}function ct(r,i,l,f){this.failures=i,this.failedKeys=f,this.successCount=l,this.message=Ke(r,i)}function ht(r,i){this.name="BulkError",this.failures=Object.keys(i).map(function(l){return i[l]}),this.failuresByPos=i,this.message=Ke(r,this.failures)}X(fe).from(Error).extend({toString:function(){return this.name+": "+this.message}}),X(ct).from(fe),X(ht).from(fe);var Yt=Je.reduce(function(r,i){return r[i]=i+"Error",r},{}),Jt=fe,Ie=Je.reduce(function(r,i){var l=i+"Error";function f(p,v){this.name=l,p?typeof p=="string"?(this.message="".concat(p).concat(v?`
|
||
`+v:""),this.inner=v||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=F[i]||l,this.inner=null)}return X(f).from(Jt),r[i]=f,r},{}),w=(Ie.Syntax=SyntaxError,Ie.Type=TypeError,Ie.Range=RangeError,ne.reduce(function(r,i){return r[i+"Error"]=Ie[i],r},{}));ne=Je.reduce(function(r,i){return["Syntax","Type","Range"].indexOf(i)===-1&&(r[i+"Error"]=Ie[i]),r},{});function g(){}function P(r){return r}function ie(r,i){return r==null||r===P?i:function(l){return i(r(l))}}function se(r,i){return function(){r.apply(this,arguments),i.apply(this,arguments)}}function ue(r,i){return r===g?i:function(){var l=r.apply(this,arguments),f=(l!==void 0&&(arguments[0]=l),this.onsuccess),p=this.onerror,v=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?se(f,this.onsuccess):f),p&&(this.onerror=this.onerror?se(p,this.onerror):p),v!==void 0?v:l}}function ge(r,i){return r===g?i:function(){r.apply(this,arguments);var l=this.onsuccess,f=this.onerror;this.onsuccess=this.onerror=null,i.apply(this,arguments),l&&(this.onsuccess=this.onsuccess?se(l,this.onsuccess):l),f&&(this.onerror=this.onerror?se(f,this.onerror):f)}}function oe(r,i){return r===g?i:function(){var l=r.apply(this,arguments),f=(h(arguments[0],l),this.onsuccess),p=this.onerror,v=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?se(f,this.onsuccess):f),p&&(this.onerror=this.onerror?se(p,this.onerror):p),l===void 0?v===void 0?void 0:v:h(l,v)}}function we(r,i){return r===g?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function W(r,i){return r===g?i:function(){var l=r.apply(this,arguments);if(l&&typeof l.then=="function"){for(var f=this,p=arguments.length,v=new Array(p);p--;)v[p]=arguments[p];return l.then(function(){return i.apply(f,v)})}return i.apply(this,arguments)}}ne.ModifyError=ct,ne.DexieError=fe,ne.BulkError=ht;var q=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Y(r){q=r}var $e={},Ne=100,Xe=typeof Promise>"u"?[]:(Je=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Xe=crypto.subtle.digest("SHA-512",new Uint8Array([0])),y(Xe),Je]:[Je,y(Je),Je]),Je=Xe[0],Br=Xe[1],Br=Br&&Br.then,Qe=Je&&Je.constructor,vt=!!Xe[2],_t=function(r,i){Hn.push([r,i]),Bt&&(queueMicrotask(Mf),Bt=!1)},Xt=!0,Bt=!0,Zt=[],hr=[],Ot=P,$t={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:g,pgp:!1,env:{},finalize:g},Me=$t,Hn=[],vr=0,Gs=[];function Ce(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var i=this._PSD=Me;if(typeof r!="function"){if(r!==$e)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&_i(this,this._value)}else this._state=null,this._value=null,++i.ref,function l(f,p){try{p(function(v){if(f._state===null){if(v===f)throw new TypeError("A promise cannot be resolved with itself.");var b=f._lib&&Rr();v&&typeof v.then=="function"?l(f,function(_,E){v instanceof Ce?v._then(_,E):v.then(_,E)}):(f._state=!0,f._value=v,fl(f)),b&&Lr()}},_i.bind(null,f))}catch(v){_i(f,v)}}(this,r)}var wi={get:function(){var r=Me,i=Qs;function l(f,p){var v=this,b=!r.global&&(r!==Me||i!==Qs),_=b&&!zn(),E=new Ce(function(B,O){ki(v,new cl(pl(f,r,b,_),pl(p,r,b,_),B,O,r))});return this._consoleTask&&(E._consoleTask=this._consoleTask),E}return l.prototype=$e,l},set:function(r){L(this,"then",r&&r.prototype===$e?wi:{get:function(){return r},set:wi.set})}};function cl(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 _i(r,i){var l,f;hr.push(i),r._state===null&&(l=r._lib&&Rr(),i=Ot(i),r._state=!1,r._value=i,f=r,Zt.some(function(p){return p._value===f._value})||Zt.push(f),fl(r),l)&&Lr()}function fl(r){var i=r._listeners;r._listeners=[];for(var l=0,f=i.length;l<f;++l)ki(r,i[l]);var p=r._PSD;--p.ref||p.finalize(),vr===0&&(++vr,_t(function(){--vr==0&&xi()},[]))}function ki(r,i){if(r._state===null)r._listeners.push(i);else{var l=r._state?i.onFulfilled:i.onRejected;if(l===null)return(r._state?i.resolve:i.reject)(r._value);++i.psd.ref,++vr,_t(Of,[l,r,i])}}function Of(r,i,l){try{var f,p=i._value;!i._state&&hr.length&&(hr=[]),f=q&&i._consoleTask?i._consoleTask.run(function(){return r(p)}):r(p),i._state||hr.indexOf(p)!==-1||(v=>{for(var b=Zt.length;b;)if(Zt[--b]._value===v._value)return Zt.splice(b,1)})(i),l.resolve(f)}catch(v){l.reject(v)}finally{--vr==0&&xi(),--l.psd.ref||l.psd.finalize()}}function Mf(){mr($t,function(){Rr()&&Lr()})}function Rr(){var r=Xt;return Bt=Xt=!1,r}function Lr(){var r,i,l;do for(;0<Hn.length;)for(r=Hn,Hn=[],l=r.length,i=0;i<l;++i){var f=r[i];f[0].apply(null,f[1])}while(0<Hn.length);Bt=Xt=!0}function xi(){for(var r=Zt,i=(Zt=[],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 Ce($e,!1,r)}function mt(r,i){var l=Me;return function(){var f=Rr(),p=Me;try{return Gn(l,!0),r.apply(this,arguments)}catch(v){i&&i(v)}finally{Gn(p,!1),f&&Lr()}}}D(Ce.prototype,{then:wi,_then:function(r,i){ki(this,new cl(null,null,r,i,Me))},catch:function(r){var i,l;return arguments.length===1?this.then(null,r):(i=r,l=arguments[1],typeof i=="function"?this.then(null,function(f){return(f instanceof i?l:Ys)(f)}):this.then(null,function(f){return(f&&f.name===i?l:Ys)(f)}))},finally:function(r){return this.then(function(i){return Ce.resolve(r()).then(function(){return i})},function(i){return Ce.resolve(r()).then(function(){return Ys(i)})})},timeout:function(r,i){var l=this;return r<1/0?new Ce(function(f,p){var v=setTimeout(function(){return p(new Ie.Timeout(i))},r);l.then(f,p).finally(clearTimeout.bind(null,v))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&L(Ce.prototype,Symbol.toStringTag,"Dexie.Promise"),$t.env=dl(),D(Ce,{all:function(){var r=Fe.apply(null,arguments).map(Zs);return new Ce(function(i,l){r.length===0&&i([]);var f=r.length;r.forEach(function(p,v){return Ce.resolve(p).then(function(b){r[v]=b,--f||i(r)},l)})})},resolve:function(r){return r instanceof Ce?r:r&&typeof r.then=="function"?new Ce(function(i,l){r.then(i,l)}):new Ce($e,!0,r)},reject:Ys,race:function(){var r=Fe.apply(null,arguments).map(Zs);return new Ce(function(i,l){r.map(function(f){return Ce.resolve(f).then(i,l)})})},PSD:{get:function(){return Me},set:function(r){return Me=r}},totalEchoes:{get:function(){return Qs}},newPSD:Wn,usePSD:mr,scheduler:{get:function(){return _t},set:function(r){_t=r}},rejectionMapper:{get:function(){return Ot},set:function(r){Ot=r}},follow:function(r,i){return new Ce(function(l,f){return Wn(function(p,v){var b=Me;b.unhandleds=[],b.onunhandled=v,b.finalize=se(function(){var _,E=this;_=function(){E.unhandleds.length===0?p():v(E.unhandleds[0])},Gs.push(function B(){_(),Gs.splice(Gs.indexOf(B),1)}),++vr,_t(function(){--vr==0&&xi()},[])},b.finalize),r()},i,l,f)})}}),Qe&&(Qe.allSettled&&L(Ce,"allSettled",function(){var r=Fe.apply(null,arguments).map(Zs);return new Ce(function(i){r.length===0&&i([]);var l=r.length,f=new Array(l);r.forEach(function(p,v){return Ce.resolve(p).then(function(b){return f[v]={status:"fulfilled",value:b}},function(b){return f[v]={status:"rejected",reason:b}}).then(function(){return--l||i(f)})})})}),Qe.any&&typeof AggregateError<"u"&&L(Ce,"any",function(){var r=Fe.apply(null,arguments).map(Zs);return new Ce(function(i,l){r.length===0&&l(new AggregateError([]));var f=r.length,p=new Array(f);r.forEach(function(v,b){return Ce.resolve(v).then(function(_){return i(_)},function(_){p[b]=_,--f||l(new AggregateError(p))})})})}),Qe.withResolvers)&&(Ce.withResolvers=Qe.withResolvers);var Pt={awaits:0,echoes:0,id:0},If=0,Js=[],Xs=0,Qs=0,jf=0;function Wn(r,b,l,f){var p=Me,v=Object.create(p),b=(v.parent=p,v.ref=0,v.global=!1,v.id=++jf,$t.env,v.env=vt?{Promise:Ce,PromiseProp:{value:Ce,configurable:!0,writable:!0},all:Ce.all,race:Ce.race,allSettled:Ce.allSettled,any:Ce.any,resolve:Ce.resolve,reject:Ce.reject}:{},b&&h(v,b),++p.ref,v.finalize=function(){--this.parent.ref||this.parent.finalize()},mr(v,r,l,f));return v.ref===0&&v.finalize(),b}function Kr(){return Pt.id||(Pt.id=++If),++Pt.awaits,Pt.echoes+=Ne,Pt.id}function zn(){return!!Pt.awaits&&(--Pt.awaits==0&&(Pt.id=0),Pt.echoes=Pt.awaits*Ne,!0)}function Zs(r){return Pt.echoes&&r&&r.constructor===Qe?(Kr(),r.then(function(i){return zn(),i},function(i){return zn(),Ct(i)})):r}function Df(){var r=Js[Js.length-1];Js.pop(),Gn(r,!1)}function Gn(r,i){var l,f,p=Me;(i?!Pt.echoes||Xs++&&r===Me:!Xs||--Xs&&r===Me)||queueMicrotask(i?(function(v){++Qs,Pt.echoes&&--Pt.echoes!=0||(Pt.echoes=Pt.awaits=Pt.id=0),Js.push(Me),Gn(v,!0)}).bind(null,r):Df),r!==Me&&(Me=r,p===$t&&($t.env=dl()),vt)&&(l=$t.env.Promise,f=r.env,p.global||r.global)&&(Object.defineProperty(a,"Promise",f.PromiseProp),l.all=f.all,l.race=f.race,l.resolve=f.resolve,l.reject=f.reject,f.allSettled&&(l.allSettled=f.allSettled),f.any)&&(l.any=f.any)}function dl(){var r=a.Promise;return vt?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function mr(r,i,l,f,p){var v=Me;try{return Gn(r,!0),i(l,f,p)}finally{Gn(v,!1)}}function pl(r,i,l,f){return typeof r!="function"?r:function(){var p=Me;l&&Kr(),Gn(i,!0);try{return r.apply(this,arguments)}finally{Gn(p,!1),f&&queueMicrotask(zn)}}}function Ci(r){Promise===Qe&&Pt.echoes===0?Xs===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+Br).indexOf("[native code]")===-1&&(Kr=zn=g);var Ct=Ce.reject,yr="",On="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",hl="String expected.",eo="__dbnames",Ei="readonly",Si="readwrite";function gr(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var vl={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 ml(){throw Ie.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function tt(r,i){try{var l=yl(r),f=yl(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=gl(r),v=gl(i),b=p.length,_=v.length,E=b<_?b:_,B=0;B<E;++B)if(p[B]!==v[B])return p[B]<v[B]?-1:1;return b===_?0:b<_?-1:1;case"Array":for(var O=r,C=i,A=O.length,R=C.length,I=A<R?A:R,M=0;M<I;++M){var j=tt(O[M],C[M]);if(j!==0)return j}return A===R?0:A<R?-1:1}}catch{}return NaN}function yl(r){var i=typeof r;return i=="object"&&(ArrayBuffer.isView(r)||(i=nt(r))==="ArrayBuffer")?"binary":i}function gl(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}bl.prototype.execute=function(r){var i=this["@@propmod"];if(i.add!==void 0){var l=i.add;if(d(l))return o(o([],d(r)?r:[],!0),l).sort();if(typeof l=="number")return(Number(r)||0)+l;if(typeof l=="bigint")try{return BigInt(r)+l}catch{return BigInt(0)+l}throw new TypeError("Invalid term ".concat(l))}if(i.remove!==void 0){var f=i.remove;if(d(f))return d(r)?r.filter(function(p){return!f.includes(p)}).sort():[];if(typeof f=="number")return Number(r)-f;if(typeof f=="bigint")try{return BigInt(r)-f}catch{return BigInt(0)-f}throw new TypeError("Invalid subtrahend ".concat(f))}return l=(l=i.replacePrefix)==null?void 0:l[0],l&&typeof r=="string"&&r.startsWith(l)?i.replacePrefix[1]+r.substring(l.length):r};var ss=bl;function bl(r){this["@@propmod"]=r}function wl(r,i){for(var l=c(i),f=l.length,p=!1,v=0;v<f;++v){var b=l[v],_=i[b],E=ae(r,b);_ instanceof ss?(Z(r,b,_.execute(E)),p=!0):E!==_&&(Z(r,b,_),p=!0)}return p}dt.prototype._trans=function(r,i,l){var f=this._tx||Me.trans,p=this.name,v=q&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function b(B,O,C){if(C.schema[p])return i(C.idbtrans,C);throw new Ie.NotFound("Table "+p+" not part of transaction")}var _=Rr();try{var E=f&&f.db._novip===this.db._novip?f===Me.trans?f._promise(r,b,l):Wn(function(){return f._promise(r,b,l)},{trans:f,transless:Me.transless||Me}):function B(O,C,A,R){if(O.idbdb&&(O._state.openComplete||Me.letThrough||O._vip)){var I=O._createTransaction(C,A,O._dbSchema);try{I.create(),O._state.PR1398_maxLoop=3}catch(M){return M.name===Yt.InvalidState&&O.isOpen()&&0<--O._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),O.close({disableAutoOpen:!1}),O.open().then(function(){return B(O,C,A,R)})):Ct(M)}return I._promise(C,function(M,j){return Wn(function(){return Me.trans=I,R(M,j,I)})}).then(function(M){if(C==="readwrite")try{I.idbtrans.commit()}catch{}return C==="readonly"?M:I._completion.then(function(){return M})})}if(O._state.openComplete)return Ct(new Ie.DatabaseClosed(O._state.dbOpenError));if(!O._state.isBeingOpened){if(!O._state.autoOpen)return Ct(new Ie.DatabaseClosed);O.open().catch(g)}return O._state.dbReadyPromise.then(function(){return B(O,C,A,R)})}(this.db,r,[this.name],b);return v&&(E._consoleTask=v,E=E.catch(function(B){return console.trace(B),Ct(B)})),E}finally{_&&Lr()}},dt.prototype.get=function(r,i){var l=this;return r&&r.constructor===Object?this.where(r).first(i):r==null?Ct(new Ie.Type("Invalid argument to Table.get()")):this._trans("readonly",function(f){return l.core.get({trans:f,key:r}).then(function(p){return l.hook.reading.fire(p)})}).then(i)},dt.prototype.where=function(r){if(typeof r=="string")return new this.db.WhereClause(this,r);if(d(r))return new this.db.WhereClause(this,"[".concat(r.join("+"),"]"));var i=c(r);if(i.length===1)return this.where(i[0]).equals(r[i[0]]);var l=this.schema.indexes.concat(this.schema.primKey).filter(function(_){if(_.compound&&i.every(function(B){return 0<=_.keyPath.indexOf(B)})){for(var E=0;E<i.length;++E)if(i.indexOf(_.keyPath[E])===-1)return!1;return!0}return!1}).sort(function(_,E){return _.keyPath.length-E.keyPath.length})[0];if(l&&this.db._maxKey!==yr)return b=l.keyPath.slice(0,i.length),this.where(b).equals(b.map(function(_){return r[_]}));!l&&q&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(i.join("+"),"]"));var f=this.schema.idxByName;function p(_,E){return tt(_,E)===0}var b=i.reduce(function(O,E){var B=O[0],O=O[1],C=f[E],A=r[E];return[B||C,B||!C?gr(O,C&&C.multi?function(R){return R=ae(R,E),d(R)&&R.some(function(I){return p(A,I)})}:function(R){return p(A,ae(R,E))}):O]},[null,null]),v=b[0],b=b[1];return v?this.where(v.name).equals(r[v.keyPath]).filter(b):l?this.filter(b):this.where(i).equals("")},dt.prototype.filter=function(r){return this.toCollection().and(r)},dt.prototype.count=function(r){return this.toCollection().count(r)},dt.prototype.offset=function(r){return this.toCollection().offset(r)},dt.prototype.limit=function(r){return this.toCollection().limit(r)},dt.prototype.each=function(r){return this.toCollection().each(r)},dt.prototype.toArray=function(r){return this.toCollection().toArray(r)},dt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},dt.prototype.orderBy=function(r){return new this.db.Collection(new this.db.WhereClause(this,d(r)?"[".concat(r.join("+"),"]"):r))},dt.prototype.reverse=function(){return this.toCollection().reverse()},dt.prototype.mapToClass=function(r){for(var i=this.db,l=this.name,f=((this.schema.mappedClass=r).prototype instanceof ml&&(r=(b=>{var _=O,E=b;if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function B(){this.constructor=_}function O(){return b!==null&&b.apply(this,arguments)||this}return n(_,E),_.prototype=E===null?Object.create(E):(B.prototype=E.prototype,new B),Object.defineProperty(O.prototype,"db",{get:function(){return i},enumerable:!1,configurable:!0}),O.prototype.table=function(){return l},O})(r)),new Set),p=r.prototype;p;p=y(p))Object.getOwnPropertyNames(p).forEach(function(b){return f.add(b)});function v(b){if(!b)return b;var _,E=Object.create(r.prototype);for(_ in b)if(!f.has(_))try{E[_]=b[_]}catch{}return E}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=v,this.hook("reading",v),r},dt.prototype.defineClass=function(){return this.mapToClass(function(r){h(this,r)})},dt.prototype.add=function(r,i){var l=this,f=this.schema.primKey,p=f.auto,v=f.keyPath,b=r;return v&&p&&(b=to(v)(r)),this._trans("readwrite",function(_){return l.core.mutate({trans:_,type:"add",keys:i!=null?[i]:null,values:[b]})}).then(function(_){return _.numFailures?Ce.reject(_.failures[0]):_.lastResult}).then(function(_){if(v)try{Z(r,v,_)}catch{}return _})},dt.prototype.upsert=function(r,i){var l=this,f=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return l.core.get({trans:p,key:r}).then(function(v){var b=v??{};return wl(b,i),f&&Z(b,f,r),l.core.mutate({trans:p,type:"put",values:[b],keys:[r],upsert:!0,updates:{keys:[r],changeSpecs:[i]}}).then(function(_){return _.numFailures?Ce.reject(_.failures[0]):!!v})})})},dt.prototype.update=function(r,i){return typeof r!="object"||d(r)?this.where(":id").equals(r).modify(i):(r=ae(r,this.schema.primKey.keyPath))===void 0?Ct(new Ie.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(i)},dt.prototype.put=function(r,i){var l=this,f=this.schema.primKey,p=f.auto,v=f.keyPath,b=r;return v&&p&&(b=to(v)(r)),this._trans("readwrite",function(_){return l.core.mutate({trans:_,type:"put",values:[b],keys:i!=null?[i]:null})}).then(function(_){return _.numFailures?Ce.reject(_.failures[0]):_.lastResult}).then(function(_){if(v)try{Z(r,v,_)}catch{}return _})},dt.prototype.delete=function(r){var i=this;return this._trans("readwrite",function(l){return i.core.mutate({trans:l,type:"delete",keys:[r]}).then(function(f){return no(i,[r],f)}).then(function(f){return f.numFailures?Ce.reject(f.failures[0]):void 0})})},dt.prototype.clear=function(){var r=this;return this._trans("readwrite",function(i){return r.core.mutate({trans:i,type:"deleteRange",range:vl}).then(function(l){return no(r,null,l)})}).then(function(i){return i.numFailures?Ce.reject(i.failures[0]):void 0})},dt.prototype.bulkGet=function(r){var i=this;return this._trans("readonly",function(l){return i.core.getMany({keys:r,trans:l}).then(function(f){return f.map(function(p){return i.hook.reading.fire(p)})})})},dt.prototype.bulkAdd=function(r,i,l){var f=this,p=Array.isArray(i)?i:void 0,v=(l=l||(p?void 0:i))?l.allKeys:void 0;return this._trans("readwrite",function(b){var _=f.schema.primKey,B=_.auto,_=_.keyPath;if(_&&p)throw new Ie.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new Ie.InvalidArgument("Arguments objects and keys must have the same length");var E=r.length,B=_&&B?r.map(to(_)):r;return f.core.mutate({trans:b,type:"add",keys:p,values:B,wantResults:v}).then(function(O){var C=O.numFailures,A=O.failures;if(C===0)return v?O.results:O.lastResult;throw new ht("".concat(f.name,".bulkAdd(): ").concat(C," of ").concat(E," operations failed"),A)})})},dt.prototype.bulkPut=function(r,i,l){var f=this,p=Array.isArray(i)?i:void 0,v=(l=l||(p?void 0:i))?l.allKeys:void 0;return this._trans("readwrite",function(b){var _=f.schema.primKey,B=_.auto,_=_.keyPath;if(_&&p)throw new Ie.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new Ie.InvalidArgument("Arguments objects and keys must have the same length");var E=r.length,B=_&&B?r.map(to(_)):r;return f.core.mutate({trans:b,type:"put",keys:p,values:B,wantResults:v}).then(function(O){var C=O.numFailures,A=O.failures;if(C===0)return v?O.results:O.lastResult;throw new ht("".concat(f.name,".bulkPut(): ").concat(C," of ").concat(E," operations failed"),A)})})},dt.prototype.bulkUpdate=function(r){var i=this,l=this.core,f=r.map(function(b){return b.key}),p=r.map(function(b){return b.changes}),v=[];return this._trans("readwrite",function(b){return l.getMany({trans:b,keys:f,cache:"clone"}).then(function(_){var E=[],B=[],O=(r.forEach(function(C,A){var R=C.key,I=C.changes,M=_[A];if(M){for(var j=0,z=Object.keys(I);j<z.length;j++){var U=z[j],ee=I[U];if(U===i.schema.primKey.keyPath){if(tt(ee,R)!==0)throw new Ie.Constraint("Cannot update primary key in bulkUpdate()")}else Z(M,U,ee)}v.push(A),E.push(R),B.push(M)}}),E.length);return l.mutate({trans:b,type:"put",keys:E,values:B,updates:{keys:f,changeSpecs:p}}).then(function(C){var A=C.numFailures,R=C.failures;if(A===0)return O;for(var I=0,M=Object.keys(R);I<M.length;I++){var j,z=M[I],U=v[Number(z)];U!=null&&(j=R[z],delete R[z],R[U]=j)}throw new ht("".concat(i.name,".bulkUpdate(): ").concat(A," of ").concat(O," operations failed"),R)})})})},dt.prototype.bulkDelete=function(r){var i=this,l=r.length;return this._trans("readwrite",function(f){return i.core.mutate({trans:f,type:"delete",keys:r}).then(function(p){return no(i,r,p)})}).then(function(f){var p=f.numFailures,v=f.failures;if(p===0)return f.lastResult;throw new ht("".concat(i.name,".bulkDelete(): ").concat(p," of ").concat(l," operations failed"),v)})};var _l=dt;function dt(){}function os(r){function i(b,_){if(_){for(var E=arguments.length,B=new Array(E-1);--E;)B[E-1]=arguments[E];return l[b].subscribe.apply(null,B),r}if(typeof b=="string")return l[b]}var l={};i.addEventType=v;for(var f=1,p=arguments.length;f<p;++f)v(arguments[f]);return i;function v(b,_,E){var B,O;if(typeof b!="object")return _=_||we,O={subscribers:[],fire:E=E||g,subscribe:function(C){O.subscribers.indexOf(C)===-1&&(O.subscribers.push(C),O.fire=_(O.fire,C))},unsubscribe:function(C){O.subscribers=O.subscribers.filter(function(A){return A!==C}),O.fire=O.subscribers.reduce(_,E)}},l[b]=i[b]=O;c(B=b).forEach(function(C){var A=B[C];if(d(A))v(C,B[C][0],B[C][1]);else{if(A!=="asap")throw new Ie.InvalidArgument("Invalid event config");var R=v(C,P,function(){for(var I=arguments.length,M=new Array(I);I--;)M[I]=arguments[I];R.subscribers.forEach(function(j){de(function(){j.apply(null,M)})})})}})}}function is(r,i){return X(i).from({prototype:r}),i}function Fr(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function $i(r,i){r.filter=gr(r.filter,i)}function Ai(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 Ie.Schema("KeyPath "+r.index+" on object store "+i.name+" is not indexed")}function kl(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,b=r.replayFilter?gr(r.filter,r.replayFilter()):r.filter;return r.or?(p={},v=function(_,E,B){var O,C;b&&!b(E,B,function(A){return E.stop(A)},function(A){return E.fail(A)})||((C=""+(O=E.primaryKey))=="[object ArrayBuffer]"&&(C=""+new Uint8Array(O)),k(p,C))||(p[C]=!0,i(_,E,B))},Promise.all([r.or._iterate(v,l),xl(kl(r,f,l),r.algorithm,v,!r.keysOnly&&r.valueMapper)])):xl(kl(r,f,l),gr(r.algorithm,b),i,!r.keysOnly&&r.valueMapper)}function xl(r,i,l,f){var p=mt(f?function(v,b,_){return l(f(v),b,_)}:l);return r.then(function(v){if(v)return v.start(function(){var b=function(){return v.continue()};i&&!i(v,function(_){return b=_},function(_){v.stop(_),b=g},function(_){v.fail(_),b=g})||p(v.value,v,function(_){return b=_}),b()})})}rt.prototype._read=function(r,i){var l=this._ctx;return l.error?l.table._trans(null,Ct.bind(null,l.error)):l.table._trans("readonly",r).then(i)},rt.prototype._write=function(r){var i=this._ctx;return i.error?i.table._trans(null,Ct.bind(null,i.error)):i.table._trans("readwrite",r,"locked")},rt.prototype._addAlgorithm=function(r){var i=this._ctx;i.algorithm=gr(i.algorithm,r)},rt.prototype._iterate=function(r,i){return so(this._ctx,r,i,this._ctx.table.core)},rt.prototype.clone=function(r){var i=Object.create(this.constructor.prototype),l=Object.create(this._ctx);return r&&h(l,r),i._ctx=l,i},rt.prototype.raw=function(){return this._ctx.valueMapper=null,this},rt.prototype.each=function(r){var i=this._ctx;return this._read(function(l){return so(i,r,l,i.table.core)})},rt.prototype.count=function(r){var i=this;return this._read(function(l){var f,p=i._ctx,v=p.table.core;return Fr(p,!0)?v.count({trans:l,query:{index:ro(p,v.schema),range:p.range}}).then(function(b){return Math.min(b,p.limit)}):(f=0,so(p,function(){return++f,!1},l,v).then(function(){return f}))}).then(r)},rt.prototype.sortBy=function(r,i){var l=r.split(".").reverse(),f=l[0],p=l.length-1;function v(E,B){return B?v(E[l[B]],B-1):E[f]}var b=this._ctx.dir==="next"?1:-1;function _(E,B){return tt(v(E,p),v(B,p))*b}return this.toArray(function(E){return E.slice().sort(_)}).then(i)},rt.prototype.toArray=function(r){var i=this;return this._read(function(l){var f,p,v,b=i._ctx;return Fr(b,!0)&&0<b.limit?(f=b.valueMapper,p=ro(b,b.table.core.schema),b.table.core.query({trans:l,limit:b.limit,values:!0,direction:b.dir==="prev"?"prev":void 0,query:{index:p,range:b.range}}).then(function(_){return _=_.result,f?_.map(f):_})):(v=[],so(b,function(_){return v.push(_)},l,b.table.core).then(function(){return v}))},r)},rt.prototype.offset=function(r){var i=this._ctx;return r<=0||(i.offset+=r,Fr(i)?Ai(i,function(){var l=r;return function(f,p){return l===0||(l===1?--l:p(function(){f.advance(l),l=0}),!1)}}):Ai(i,function(){var l=r;return function(){return--l<0}})),this},rt.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),Ai(this._ctx,function(){var i=r;return function(l,f,p){return--i<=0&&f(p),0<=i}},!0),this},rt.prototype.until=function(r,i){return $i(this._ctx,function(l,f,p){return!r(l.value)||(f(p),i)}),this},rt.prototype.first=function(r){return this.limit(1).toArray(function(i){return i[0]}).then(r)},rt.prototype.last=function(r){return this.reverse().first(r)},rt.prototype.filter=function(r){var i;return $i(this._ctx,function(l){return r(l.value)}),(i=this._ctx).isMatch=gr(i.isMatch,r),this},rt.prototype.and=function(r){return this.filter(r)},rt.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},rt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},rt.prototype.desc=function(){return this.reverse()},rt.prototype.eachKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(l,f){r(f.key,f)})},rt.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},rt.prototype.eachPrimaryKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(l,f){r(f.primaryKey,f)})},rt.prototype.keys=function(r){var i=this._ctx,l=(i.keysOnly=!i.isMatch,[]);return this.each(function(f,p){l.push(p.key)}).then(function(){return l}).then(r)},rt.prototype.primaryKeys=function(r){var i=this._ctx;if(Fr(i,!0)&&0<i.limit)return this._read(function(f){var p=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)},rt.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},rt.prototype.firstKey=function(r){return this.limit(1).keys(function(i){return i[0]}).then(r)},rt.prototype.lastKey=function(r){return this.reverse().firstKey(r)},rt.prototype.distinct=function(){var r,i=this._ctx,i=i.index&&i.table.schema.idxByName[i.index];return i&&i.multi&&(r={},$i(this._ctx,function(f){var f=f.primaryKey.toString(),p=k(r,f);return r[f]=!0,!p})),this},rt.prototype.modify=function(r){var i=this,l=this._ctx;return this._write(function(f){function p(M,j){var z=j.failures;A+=M-j.numFailures;for(var U=0,ee=c(z);U<ee.length;U++){var pe=ee[U];C.push(z[pe])}}var v=typeof r=="function"?r:function(M){return wl(M,r)},b=l.table.core,O=b.schema.primaryKey,_=O.outbound,E=O.extractKey,B=200,O=i.db._options.modifyChunkSize,C=(O&&(B=typeof O=="object"?O[b.name]||O["*"]||200:O),[]),A=0,R=[],I=r===Cl;return i.clone().primaryKeys().then(function(M){function j(U){var ee=Math.min(B,M.length-U),pe=M.slice(U,U+ee);return(I?Promise.resolve([]):b.getMany({trans:f,keys:pe,cache:"immutable"})).then(function(ve){var _e=[],me=[],Ae=_?[]:null,be=I?pe:[];if(!I)for(var Pe=0;Pe<ee;++Pe){var he=ve[Pe],Be={value:xe(he),primKey:M[U+Pe]};v.call(Be,Be.value,Be)!==!1&&(Be.value==null?be.push(M[U+Pe]):_||tt(E(he),E(Be.value))===0?(me.push(Be.value),_&&Ae.push(M[U+Pe])):(be.push(M[U+Pe]),_e.push(Be.value)))}return Promise.resolve(0<_e.length&&b.mutate({trans:f,type:"add",values:_e}).then(function(Ue){for(var Ye in Ue.failures)be.splice(parseInt(Ye),1);p(_e.length,Ue)})).then(function(){return(0<me.length||z&&typeof r=="object")&&b.mutate({trans:f,type:"put",keys:Ae,values:me,criteria:z,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<U}).then(function(Ue){return p(me.length,Ue)})}).then(function(){return(0<be.length||z&&I)&&b.mutate({trans:f,type:"delete",keys:be,criteria:z,isAdditionalChunk:0<U}).then(function(Ue){return no(l.table,be,Ue)}).then(function(Ue){return p(be.length,Ue)})}).then(function(){return M.length>U+ee&&j(U+B)})})}var z=Fr(l)&&l.limit===1/0&&(typeof r!="function"||I)&&{index:l.index,range:l.range};return j(0).then(function(){if(0<C.length)throw new ct("Error modifying one or more objects",C,A,R);return M.length})})})},rt.prototype.delete=function(){var r=this._ctx,i=r.range;return!Fr(r)||r.table.schema.yProps||!r.isPrimKey&&i.type!==3?this.modify(Cl):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(E){var _=E.failures,E=E.numFailures;if(E)throw new ct("Could not delete some values",Object.keys(_).map(function(B){return _[B]}),v-E);return v-E})})})};var Rf=rt;function rt(){}var Cl=function(r,i){return i.value=null};function Lf(r,i){return r<i?-1:r===i?0:1}function Kf(r,i){return i<r?-1:r===i?0:1}function en(r,i,l){return r=r instanceof Sl?new r.Collection(r):r,r._ctx.error=new(l||TypeError)(i),r}function Nr(r){return new r.Collection(r,function(){return El("")}).limit(0)}function oo(R,i,l,f){var p,v,b,_,E,B,O,C=l.length;if(!l.every(function(M){return typeof M=="string"}))return en(R,hl);function A(M){p=M==="next"?function(z){return z.toUpperCase()}:function(z){return z.toLowerCase()},v=M==="next"?function(z){return z.toLowerCase()}:function(z){return z.toUpperCase()},b=M==="next"?Lf:Kf;var j=l.map(function(z){return{lower:v(z),upper:p(z)}}).sort(function(z,U){return b(z.lower,U.lower)});_=j.map(function(z){return z.upper}),E=j.map(function(z){return z.lower}),O=(B=M)==="next"?"":f}A("next");var R=new R.Collection(R,function(){return Yn(_[0],E[C-1]+f)}),I=(R._ondirectionchange=function(M){A(M)},0);return R._addAlgorithm(function(M,j,z){var U=M.key;if(typeof U=="string"){var ee=v(U);if(i(ee,E,I))return!0;for(var pe=null,ve=I;ve<C;++ve){var _e=((me,Ae,be,Pe,he,Be)=>{for(var Ue=Math.min(me.length,Pe.length),Ye=-1,Ze=0;Ze<Ue;++Ze){var tn=Ae[Ze];if(tn!==Pe[Ze])return he(me[Ze],be[Ze])<0?me.substr(0,Ze)+be[Ze]+be.substr(Ze+1):he(me[Ze],Pe[Ze])<0?me.substr(0,Ze)+Pe[Ze]+be.substr(Ze+1):0<=Ye?me.substr(0,Ye)+Ae[Ye]+be.substr(Ye+1):null;he(me[Ze],tn)<0&&(Ye=Ze)}return Ue<Pe.length&&Be==="next"?me+be.substr(me.length):Ue<me.length&&Be==="prev"?me.substr(0,be.length):Ye<0?null:me.substr(0,Ye)+Pe[Ye]+be.substr(Ye+1)})(U,ee,_[ve],E[ve],b,B);_e===null&&pe===null?I=ve+1:(pe===null||0<b(pe,_e))&&(pe=_e)}j(pe!==null?function(){M.continue(pe+O)}:z)}return!1}),R}function Yn(r,i,l,f){return{type:2,lower:r,upper:i,lowerOpen:l,upperOpen:f}}function El(r){return{type:1,lower:r,upper:r}}Object.defineProperty(Tt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Tt.prototype.between=function(r,i,l,f){l=l!==!1,f=f===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(l||f)&&(!l||!f)?Nr(this):new this.Collection(this,function(){return Yn(r,i,!l,!f)})}catch{return en(this,On)}},Tt.prototype.equals=function(r){return r==null?en(this,On):new this.Collection(this,function(){return El(r)})},Tt.prototype.above=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(r,void 0,!0)})},Tt.prototype.aboveOrEqual=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(r,void 0,!1)})},Tt.prototype.below=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(void 0,r,!1,!0)})},Tt.prototype.belowOrEqual=function(r){return r==null?en(this,On):new this.Collection(this,function(){return Yn(void 0,r)})},Tt.prototype.startsWith=function(r){return typeof r!="string"?en(this,hl):this.between(r,r+yr,!0,!0)},Tt.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):oo(this,function(i,l){return i.indexOf(l[0])===0},[r],yr)},Tt.prototype.equalsIgnoreCase=function(r){return oo(this,function(i,l){return i===l[0]},[r],"")},Tt.prototype.anyOfIgnoreCase=function(){var r=Fe.apply(Oe,arguments);return r.length===0?Nr(this):oo(this,function(i,l){return l.indexOf(i)!==-1},r,"")},Tt.prototype.startsWithAnyOfIgnoreCase=function(){var r=Fe.apply(Oe,arguments);return r.length===0?Nr(this):oo(this,function(i,l){return l.some(function(f){return i.indexOf(f)===0})},r,yr)},Tt.prototype.anyOf=function(){var r,i,l=this,f=Fe.apply(Oe,arguments),p=this._cmp;try{f.sort(p)}catch{return en(this,On)}return f.length===0?Nr(this):((r=new this.Collection(this,function(){return Yn(f[0],f[f.length-1])}))._ondirectionchange=function(v){p=v==="next"?l._ascending:l._descending,f.sort(p)},i=0,r._addAlgorithm(function(v,b,_){for(var E=v.key;0<p(E,f[i]);)if(++i===f.length)return b(_),!1;return p(E,f[i])===0||(b(function(){v.continue(f[i])}),!1)}),r)},Tt.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Tt.prototype.noneOf=function(){var r=Fe.apply(Oe,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return en(this,On)}var i=r.reduce(function(l,f){return l?l.concat([[l[l.length-1][1],f]]):[[-1/0,f]]},null);return i.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(i,{includeLowers:!1,includeUppers:!1})},Tt.prototype.inAnyRange=function(r,z){var l=this,f=this._cmp,p=this._ascending,v=this._descending,b=this._min,_=this._max;if(r.length===0)return Nr(this);if(!r.every(function(U){return U[0]!==void 0&&U[1]!==void 0&&p(U[0],U[1])<=0}))return en(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ie.InvalidArgument);var E=!z||z.includeLowers!==!1,B=z&&z.includeUppers===!0,O,C=p;function A(U,ee){return C(U[0],ee[0])}try{(O=r.reduce(function(U,ee){for(var pe=0,ve=U.length;pe<ve;++pe){var _e=U[pe];if(f(ee[0],_e[1])<0&&0<f(ee[1],_e[0])){_e[0]=b(_e[0],ee[0]),_e[1]=_(_e[1],ee[1]);break}}return pe===ve&&U.push(ee),U},[])).sort(A)}catch{return en(this,On)}var R=0,I=B?function(U){return 0<p(U,O[R][1])}:function(U){return 0<=p(U,O[R][1])},M=E?function(U){return 0<v(U,O[R][0])}:function(U){return 0<=v(U,O[R][0])},j=I,z=new this.Collection(this,function(){return Yn(O[0][0],O[O.length-1][1],!E,!B)});return z._ondirectionchange=function(U){C=U==="next"?(j=I,p):(j=M,v),O.sort(A)},z._addAlgorithm(function(U,ee,pe){for(var ve,_e=U.key;j(_e);)if(++R===O.length)return ee(pe),!1;return!I(ve=_e)&&!M(ve)||(l._cmp(_e,O[R][1])===0||l._cmp(_e,O[R][0])===0||ee(function(){C===p?U.continue(O[R][0]):U.continue(O[R][1])}),!1)}),z},Tt.prototype.startsWithAnyOf=function(){var r=Fe.apply(Oe,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Nr(this):this.inAnyRange(r.map(function(i){return[i,i+yr]})):en(this,"startsWithAnyOf() only works with strings")};var Sl=Tt;function Tt(){}function dn(r){return mt(function(i){return as(i),r(i.target.error),!1})}function as(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var io="storagemutated",Pi="x-storagemutated-1",Jn=os(null,io),Ff=(yn.prototype._lock=function(){return G(!Me.global),++this._reculock,this._reculock!==1||Me.global||(Me.lockOwnerFor=this),this},yn.prototype._unlock=function(){if(G(!Me.global),--this._reculock==0)for(Me.global||(Me.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{mr(r[1],r[0])}catch{}}return this},yn.prototype._locked=function(){return this._reculock&&Me.lockOwnerFor!==this},yn.prototype.create=function(r){var i=this;if(this.mode){var l=this.db.idbdb,f=this.db._state.dbOpenError;if(G(!this.idbtrans),!r&&!l)switch(f&&f.name){case"DatabaseClosedError":throw new Ie.DatabaseClosed(f);case"MissingAPIError":throw new Ie.MissingAPI(f.message,f);default:throw new Ie.OpenFailed(f)}if(!this.active)throw new Ie.TransactionInactive;G(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||l).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=mt(function(p){as(p),i._reject(r.error)}),r.onabort=mt(function(p){as(p),i.active&&i._reject(new Ie.Abort(r.error)),i.active=!1,i.on("abort").fire(p)}),r.oncomplete=mt(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&Jn.storagemutated.fire(r.mutatedParts)})}return this},yn.prototype._promise=function(r,i,l){var f,p=this;return r==="readwrite"&&this.mode!=="readwrite"?Ct(new Ie.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Ce(function(v,b){p._blockedFuncs.push([function(){p._promise(r,i,l).then(v,b)},Me])}):l?Wn(function(){var v=new Ce(function(b,_){p._lock();var E=i(b,_,p);E&&E.then&&E.then(b,_)});return v.finally(function(){return p._unlock()}),v._lib=!0,v}):((f=new Ce(function(v,b){var _=i(v,b,p);_&&_.then&&_.then(v,b)}))._lib=!0,f):Ct(new Ie.TransactionInactive)},yn.prototype._root=function(){return this.parent?this.parent._root():this},yn.prototype.waitFor=function(r){var i,l=this._root(),f=Ce.resolve(r),p=(l._waitingFor?l._waitingFor=l._waitingFor.then(function(){return f}):(l._waitingFor=f,l._waitingQueue=[],i=l.idbtrans.objectStore(l.storeNames[0]),function v(){for(++l._spinCount;l._waitingQueue.length;)l._waitingQueue.shift()();l._waitingFor&&(i.get(-1/0).onsuccess=v)}()),l._waitingFor);return new Ce(function(v,b){f.then(function(_){return l._waitingQueue.push(mt(v.bind(null,_)))},function(_){return l._waitingQueue.push(mt(b.bind(null,_)))}).finally(function(){l._waitingFor===p&&(l._waitingFor=null)})})},yn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ie.Abort))},yn.prototype.table=function(r){var i=this._memoizedTables||(this._memoizedTables={});if(k(i,r))return i[r];var l=this.schema[r];if(l)return(l=new this.db.Table(r,l,this)).core=this.db.core.table(r),i[r]=l;throw new Ie.NotFound("Table "+r+" not part of transaction")},yn);function yn(){}function Ti(r,i,l,f,p,v,b,_){return{name:r,keyPath:i,unique:l,multi:f,auto:p,compound:v,src:(l&&!b?"&":"")+(f?"*":"")+(p?"++":"")+$l(i),type:_}}function $l(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function Oi(r,i,l){return{name:r,primKey:i,indexes:l,mappedClass:null,idxByName:(f=function(p){return[p.name,p]},l.reduce(function(p,v,b){return v=f(v,b),v&&(p[v[0]]=v[1]),p},{}))};var f}var ls=function(r){try{return r.only([[]]),ls=function(){return[[]]},[[]]}catch{return ls=function(){return yr},yr}};function Mi(r){return r==null?function(){}:typeof r=="string"?(i=r).split(".").length===1?function(l){return l[i]}:function(l){return ae(l,i)}:function(l){return ae(l,r)};var i}function Al(r){return[].slice.call(r)}var Nf=0;function us(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function Vf(r,i,b){function f(j){if(j.type===3)return null;if(j.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var R=j.lower,I=j.upper,M=j.lowerOpen,j=j.upperOpen;return R===void 0?I===void 0?null:i.upperBound(I,!!j):I===void 0?i.lowerBound(R,!!M):i.bound(R,I,!!M,!!j)}function p(A){var R,I,M=A.name;return{name:M,schema:A,mutate:function(j){var z=j.trans,U=j.type,ee=j.keys,pe=j.values,ve=j.range;return new Promise(function(_e,me){_e=mt(_e);var Ae=z.objectStore(M),be=Ae.keyPath==null,Pe=U==="put"||U==="add";if(!Pe&&U!=="delete"&&U!=="deleteRange")throw new Error("Invalid operation type: "+U);var he,Be=(ee||pe||{length:1}).length;if(ee&&pe&&ee.length!==pe.length)throw new Error("Given keys array must have same length as given values array.");if(Be===0)return _e({numFailures:0,failures:{},results:[],lastResult:void 0});function Ue(Ut){++tn,as(Ut)}var Ye=[],Ze=[],tn=0;if(U==="deleteRange"){if(ve.type===4)return _e({numFailures:tn,failures:Ze,results:[],lastResult:void 0});ve.type===3?Ye.push(he=Ae.clear()):Ye.push(he=Ae.delete(f(ve)))}else{var be=Pe?be?[pe,ee]:[pe,null]:[ee,null],ze=be[0],Rt=be[1];if(Pe)for(var Lt=0;Lt<Be;++Lt)Ye.push(he=Rt&&Rt[Lt]!==void 0?Ae[U](ze[Lt],Rt[Lt]):Ae[U](ze[Lt])),he.onerror=Ue;else for(Lt=0;Lt<Be;++Lt)Ye.push(he=Ae[U](ze[Lt])),he.onerror=Ue}function bo(Ut){Ut=Ut.target.result,Ye.forEach(function(_r,Ji){return _r.error!=null&&(Ze[Ji]=_r.error)}),_e({numFailures:tn,failures:Ze,results:U==="delete"?ee:Ye.map(function(_r){return _r.result}),lastResult:Ut})}he.onerror=function(Ut){Ue(Ut),bo(Ut)},he.onsuccess=bo})},getMany:function(j){var z=j.trans,U=j.keys;return new Promise(function(ee,pe){ee=mt(ee);for(var ve,_e=z.objectStore(M),me=U.length,Ae=new Array(me),be=0,Pe=0,he=function(Ye){Ye=Ye.target,Ae[Ye._pos]=Ye.result,++Pe===be&&ee(Ae)},Be=dn(pe),Ue=0;Ue<me;++Ue)U[Ue]!=null&&((ve=_e.get(U[Ue]))._pos=Ue,ve.onsuccess=he,ve.onerror=Be,++be);be===0&&ee(Ae)})},get:function(j){var z=j.trans,U=j.key;return new Promise(function(ee,pe){ee=mt(ee);var ve=z.objectStore(M).get(U);ve.onsuccess=function(_e){return ee(_e.target.result)},ve.onerror=dn(pe)})},query:(R=E,I=B,function(j){return new Promise(function(z,U){z=mt(z);var ee,pe,ve,_e,Be=j.trans,me=j.values,Ae=j.limit,he=j.query,be=(be=j.direction)!=null?be:"next",Pe=Ae===1/0?void 0:Ae,Ue=he.index,he=he.range,Be=Be.objectStore(M),Be=Ue.isPrimaryKey?Be:Be.index(Ue.name),Ue=f(he);if(Ae===0)return z({result:[]});I?(he={query:Ue,count:Pe,direction:be},(ee=me?Be.getAll(he):Be.getAllKeys(he)).onsuccess=function(Ye){return z({result:Ye.target.result})},ee.onerror=dn(U)):R&&be==="next"?((ee=me?Be.getAll(Ue,Pe):Be.getAllKeys(Ue,Pe)).onsuccess=function(Ye){return z({result:Ye.target.result})},ee.onerror=dn(U)):(pe=0,ve=!me&&"openKeyCursor"in Be?Be.openKeyCursor(Ue,be):Be.openCursor(Ue,be),_e=[],ve.onsuccess=function(){var Ye=ve.result;return!Ye||(_e.push(me?Ye.value:Ye.primaryKey),++pe===Ae)?z({result:_e}):void Ye.continue()},ve.onerror=dn(U))})}),openCursor:function(j){var z=j.trans,U=j.values,ee=j.query,pe=j.reverse,ve=j.unique;return new Promise(function(_e,me){_e=mt(_e);var Pe=ee.index,Ae=ee.range,be=z.objectStore(M),be=Pe.isPrimaryKey?be:be.index(Pe.name),Pe=pe?ve?"prevunique":"prev":ve?"nextunique":"next",he=!U&&"openKeyCursor"in be?be.openKeyCursor(f(Ae),Pe):be.openCursor(f(Ae),Pe);he.onerror=dn(me),he.onsuccess=mt(function(Be){var Ue,Ye,Ze,tn,ze=he.result;ze?(ze.___id=++Nf,ze.done=!1,Ue=ze.continue.bind(ze),Ye=(Ye=ze.continuePrimaryKey)&&Ye.bind(ze),Ze=ze.advance.bind(ze),tn=function(){throw new Error("Cursor not stopped")},ze.trans=z,ze.stop=ze.continue=ze.continuePrimaryKey=ze.advance=function(){throw new Error("Cursor not started")},ze.fail=mt(me),ze.next=function(){var Rt=this,Lt=1;return this.start(function(){return Lt--?Rt.continue():Rt.stop()}).then(function(){return Rt})},ze.start=function(Rt){function Lt(){if(he.result)try{Rt()}catch(Ut){ze.fail(Ut)}else ze.done=!0,ze.start=function(){throw new Error("Cursor behind last entry")},ze.stop()}var bo=new Promise(function(Ut,_r){Ut=mt(Ut),he.onerror=dn(_r),ze.fail=_r,ze.stop=function(Ji){ze.stop=ze.continue=ze.continuePrimaryKey=ze.advance=tn,Ut(Ji)}});return he.onsuccess=mt(function(Ut){he.onsuccess=Lt,Lt()}),ze.continue=Ue,ze.continuePrimaryKey=Ye,ze.advance=Ze,Lt(),bo},_e(ze)):_e(null)},me)})},count:function(j){var z=j.query,U=j.trans,ee=z.index,pe=z.range;return new Promise(function(ve,_e){var me=U.objectStore(M),me=ee.isPrimaryKey?me:me.index(ee.name),Ae=f(pe),Ae=Ae?me.count(Ae):me.count();Ae.onsuccess=mt(function(be){return ve(be.target.result)}),Ae.onerror=dn(_e)})}}}v=b,_=Al((b=r).objectStoreNames),O=0<_.length?v.objectStore(_[0]):{};var v,b={schema:{name:b.name,tables:_.map(function(A){return v.objectStore(A)}).map(function(A){var R=A.keyPath,I=A.autoIncrement,j=d(R),M={},j={name:A.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:R==null,compound:j,keyPath:R,autoIncrement:I,unique:!0,extractKey:Mi(R)},indexes:Al(A.indexNames).map(function(z){return A.index(z)}).map(function(pe){var ve=pe.name,U=pe.unique,ee=pe.multiEntry,pe=pe.keyPath,ve={name:ve,compound:d(pe),keyPath:pe,unique:U,multiEntry:ee,extractKey:Mi(pe)};return M[us(pe)]=ve}),getIndexByKeyPath:function(z){return M[us(z)]}};return M[":id"]=j.primaryKey,R!=null&&(M[us(R)]=j.primaryKey),j})},hasGetAll:0<_.length&&"getAll"in O&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in O},_=b.schema,E=b.hasGetAll,B=b.hasIdb3Features,O=_.tables.map(p),C={};return O.forEach(function(A){return C[A.name]=A}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(A){if(C[A])return C[A];throw new Error("Table '".concat(A,"' not found"))},MIN_KEY:-1/0,MAX_KEY:ls(i),schema:_}}function Bf(r,i,l,f){return l=l.IDBKeyRange,i=Vf(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=Bf(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(b){var _=function E(B,O){return ce(B,O)||(B=y(B))&&E(B,O)}(b,p);(!_||"value"in _&&_.value===void 0)&&(b===r.Transaction.prototype||b instanceof r.Transaction?L(b,p,{get:function(){return this.table(p)},set:function(E){T(this,p,{value:E,writable:!0,configurable:!0,enumerable:!0})}}):b[p]=new r.Table(p,v))})})}function Ii(r,i){i.forEach(function(l){for(var f in l)l[f]instanceof r.Table&&delete l[f]})}function Uf(r,i){return r._cfg.version-i._cfg.version}function qf(r,i,l,f){var p=r._dbSchema,v=(l.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=Oi("$meta",Tl("")[0],[]),r._storeNames.push("$meta")),r._createTransaction("readwrite",r._storeNames,p)),b=(v.create(l),v._completion.catch(f),v._reject.bind(v)),_=Me.transless||Me;Wn(function(){if(Me.trans=v,Me.transless=_,i!==0)return ao(r,l),B=i,((E=v).storeNames.includes("$meta")?E.table("$meta").get("version").then(function(O){return O??B}):Ce.resolve(B)).then(function(j){var C=r,A=j,R=v,I=l,M=[],j=C._versions,z=C._dbSchema=co(0,C.idbdb,I);return(j=j.filter(function(U){return U._cfg.version>=A})).length===0?Ce.resolve():(j.forEach(function(U){M.push(function(){var ee,pe,ve,_e=z,me=U._cfg.dbschema,Ae=(fo(C,_e,I),fo(C,me,I),z=C._dbSchema=me,ji(_e,me)),be=(Ae.add.forEach(function(Pe){Di(I,Pe[0],Pe[1].primKey,Pe[1].indexes)}),Ae.change.forEach(function(Pe){if(Pe.recreate)throw new Ie.Upgrade("Not yet support for changing primary key");var he=I.objectStore(Pe.name);Pe.add.forEach(function(Be){return uo(he,Be)}),Pe.change.forEach(function(Be){he.deleteIndex(Be.name),uo(he,Be)}),Pe.del.forEach(function(Be){return he.deleteIndex(Be)})}),U._cfg.contentUpgrade);if(be&&U._cfg.version>A)return ao(C,I),R._memoizedTables={},ee=$(me),Ae.del.forEach(function(Pe){ee[Pe]=_e[Pe]}),Ii(C,[C.Transaction.prototype]),lo(C,[C.Transaction.prototype],c(ee),ee),R.schema=ee,(pe=je(be))&&Kr(),me=Ce.follow(function(){var Pe;(ve=be(R))&&pe&&(Pe=zn.bind(null,null),ve.then(Pe,Pe))}),ve&&typeof ve.then=="function"?Ce.resolve(ve):me.then(function(){return ve})}),M.push(function(ee){var pe,ve,_e=U._cfg.dbschema;pe=_e,ve=ee,[].slice.call(ve.db.objectStoreNames).forEach(function(me){return pe[me]==null&&ve.db.deleteObjectStore(me)}),Ii(C,[C.Transaction.prototype]),lo(C,[C.Transaction.prototype],C._storeNames,C._dbSchema),R.schema=C._dbSchema}),M.push(function(ee){C.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(C.idbdb.version/10)===U._cfg.version?(C.idbdb.deleteObjectStore("$meta"),delete C._dbSchema.$meta,C._storeNames=C._storeNames.filter(function(pe){return pe!=="$meta"})):ee.objectStore("$meta").put(U._cfg.version,"version"))})}),function U(){return M.length?Ce.resolve(M.shift()(R.idbtrans)).then(U):Ce.resolve()}().then(function(){Pl(z,I)}))}).catch(b);var E,B;c(p).forEach(function(O){Di(l,O,p[O].primKey,p[O].indexes)}),ao(r,l),Ce.follow(function(){return r.on.populate.fire(v)}).catch(b)})}function Hf(r,i){Pl(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=ji(l,r._dbSchema).change;f<p.length;f++){var v=(b=>{if(b.change.length||b.recreate)return console.warn("Unable to patch indexes of table ".concat(b.name," because it has changes on the type of index or primary key.")),{value:void 0};var _=i.objectStore(b.name);b.add.forEach(function(E){q&&console.debug("Dexie upgrade patch: Creating missing index ".concat(b.name,".").concat(E.src)),uo(_,E)})})(p[f]);if(typeof v=="object")return v.value}}function ji(r,i){var l,f={del:[],add:[],change:[]};for(l in r)i[l]||f.del.push(l);for(l in i){var p=r[l],v=i[l];if(p){var b={name:l,def:v,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(v.primKey.keyPath||"")||p.primKey.auto!==v.primKey.auto)b.recreate=!0,f.change.push(b);else{var _=p.idxByName,E=v.idxByName,B=void 0;for(B in _)E[B]||b.del.push(B);for(B in E){var O=_[B],C=E[B];O?O.src!==C.src&&b.change.push(C):b.add.push(C)}(0<b.del.length||0<b.add.length||0<b.change.length)&&f.change.push(b)}}else f.add.push([l,v])}return f}function Di(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 Pl(r,i){c(r).forEach(function(l){i.db.objectStoreNames.contains(l)||(q&&console.debug("Dexie: Creating missing table",l),Di(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 S(i.objectStoreNames,0).forEach(function(p){for(var v=l.objectStore(p),b=Ti($l(B=v.keyPath),B||"",!0,!1,!!v.autoIncrement,B&&typeof B!="string",!0),_=[],E=0;E<v.indexNames.length;++E){var O=v.index(v.indexNames[E]),B=O.keyPath,O=Ti(O.name,B,!!O.unique,!!O.multiEntry,!1,B&&typeof B!="string",!1);_.push(O)}f[p]=Oi(p,b,_)}),f}function fo(r,i,l){for(var f=l.db.objectStoreNames,p=0;p<f.length;++p){var v=f[p],b=l.objectStore(v);r._hasGetAll="getAll"in b;for(var _=0;_<b.indexNames.length;++_){var E,B=b.indexNames[_],O=b.index(B).keyPath,O=typeof O=="string"?O:"["+S(O).join("+")+"]";i[v]&&(E=i[v].idxByName[O])&&(E.name=B,delete i[v].idxByName[O],i[v].idxByName[B]=E)}}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 Tl(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 Ti(p,v||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),d(v),l===0,f)})}Vr.prototype._createTableSchema=Oi,Vr.prototype._parseIndexSyntax=Tl,Vr.prototype._parseStoresSpec=function(r,i){var l=this;c(r).forEach(function(f){if(r[f]!==null){var p=l._parseIndexSyntax(r[f]),v=p.shift();if(!v)throw new Ie.Schema("Invalid schema for table "+f+": "+r[f]);if(v.unique=!0,v.multi)throw new Ie.Schema("Primary key cannot be multiEntry*");p.forEach(function(b){if(b.auto)throw new Ie.Schema("Only primary key can be marked as autoIncrement (++)");if(!b.keyPath)throw new Ie.Schema("Index must have a name and cannot be an empty string")}),v=l._createTableSchema(f,v,p),i[f]=v}})},Vr.prototype.stores=function(l){var i=this.db,l=(this._cfg.storesSource=this._cfg.storesSource?h(this._cfg.storesSource,l):l,i._versions),f={},p={};return l.forEach(function(v){h(f,v._cfg.storesSource),p=v._cfg.dbschema={},v._parseStoresSpec(f,p)}),i._dbSchema=p,Ii(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},Vr.prototype.upgrade=function(r){return this._cfg.contentUpgrade=W(this._cfg.contentUpgrade||g,r),this};var Wf=Vr;function Vr(){}var cs=(()=>{var r,i,l;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(r=new Set,i=new FinalizationRegistry(function(f){r.delete(f)}),{toArray:function(){return Array.from(r).map(function(f){return f.deref()}).filter(function(f){return f!==void 0})},add:function(f){var p=new WeakRef(f._novip);r.add(p),i.register(f._novip,p,p),r.size>f._options.maxConnections&&(p=r.values().next().value,r.delete(p),i.unregister(p))},remove:function(f){if(f)for(var p=r.values(),v=p.next();!v.done;){var b=v.value;if(b.deref()===f._novip)return r.delete(b),void i.unregister(b);v=p.next()}}}):(l=[],{toArray:function(){return l},add:function(f){l.push(f._novip)},remove:function(f){f&&(f=l.indexOf(f._novip))!==-1&&l.splice(f,1)}})})();function Ri(r,i){var l=r._dbNamesDB;return l||(l=r._dbNamesDB=new Mn(eo,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),l.table("dbnames")}function Li(r){return r&&typeof r.databases=="function"}function Ki(r){return Wn(function(){return Me.letThrough=!0,r()})}function Fi(r){return!("from"in r)}var Dt=function(r,i){var l;if(!this)return l=new Dt,r&&"d"in r&&h(l,r),l;h(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function fs(r,i,l){var f=tt(i,l);if(!isNaN(f)){if(0<f)throw RangeError();if(Fi(r))return h(r,{from:i,to:l,d:1});var f=r.l,p=r.r;if(tt(l,r.from)<0)return f?fs(f,i,l):r.l={from:i,to:l,d:1,l:null,r:null},Ml(r);if(0<tt(i,r.to))return p?fs(p,i,l):r.r={from:i,to:l,d:1,l:null,r:null},Ml(r);tt(i,r.from)<0&&(r.from=i,r.l=null,r.d=p?p.d+1:1),0<tt(l,r.to)&&(r.to=l,r.r=null,r.d=r.l?r.l.d+1:1),i=!r.r,f&&!r.l&&ds(r,f),p&&i&&ds(r,p)}}function ds(r,i){Fi(i)||function l(f,p){var v=p.from,b=p.l,_=p.r;fs(f,v,p.to),b&&l(f,b),_&&l(f,_)}(r,i)}function Ol(r,i){var l=po(i),f=l.next();if(!f.done)for(var p=f.value,v=po(r),b=v.next(p.from),_=b.value;!f.done&&!b.done;){if(tt(_.from,p.to)<=0&&0<=tt(_.to,p.from))return!0;tt(p.from,_.from)<0?p=(f=l.next(_.from)).value:_=(b=v.next(p.from)).value}return!1}function po(r){var i=Fi(r)?null:{s:0,n:r};return{next:function(l){for(var f=0<arguments.length;i;)switch(i.s){case 0:if(i.s=1,f)for(;i.n.l&&tt(l,i.n.from)<0;)i={up:i,n:i.n.l,s:1};else for(;i.n.l;)i={up:i,n:i.n.l,s:1};case 1:if(i.s=2,!f||tt(l,i.n.to)<=0)return{value:i.n,done:!1};case 2:if(i.n.r){i.s=3,i={up:i,n:i.n.r,s:0};continue}case 3:i=i.up}return{done:!0}}}}function Ml(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=Il(l)),r.d=Il(r)}function Il(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]?ds(r[l],i[l]):r[l]=function f(p){var v,b,_={};for(v in p)k(p,v)&&(b=p[v],_[v]=!b||typeof b!="object"||ke.has(b.constructor)?b:f(b));return _}(i[l])}),r}function Ni(r,i){return r.all||i.all||Object.keys(r).some(function(l){return i[l]&&Ol(i[l],r[l])})}D(Dt.prototype,((Je={add:function(r){return ds(this,r),this},addKey:function(r){return fs(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(l){return fs(i,l,l)}),this},hasKey:function(r){var i=po(this).next(r).value;return i&&tt(i.from,r)<=0&&0<=tt(i.to,r)}})[qe]=function(){return po(this)},Je));var br={},Vi={},Bi=!1;function vo(r){ho(Vi,r),Bi||(Bi=!0,setTimeout(function(){Bi=!1,Ui(Vi,!(Vi={}))},0))}function Ui(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++)jl(_=p[f],r,l,i);else for(var v in r){var b,_,v=/^idb\:\/\/(.*)\/(.*)\//.exec(v);v&&(b=v[1],v=v[2],_=br["idb://".concat(b,"/").concat(v)])&&jl(_,r,l,i)}l.forEach(function(E){return E()})}function jl(r,i,l,f){for(var p=[],v=0,b=Object.entries(r.queries.query);v<b.length;v++){for(var _=b[v],E=_[0],B=[],O=0,C=_[1];O<C.length;O++){var A=C[O];Ni(i,A.obsSet)?A.subscribers.forEach(function(j){return l.add(j)}):f&&B.push(A)}f&&p.push([E,B])}if(f)for(var R=0,I=p;R<I.length;R++){var M=I[R],E=M[0],B=M[1];r.queries.query[E]=B}}function zf(r){var i=r._state,l=r._deps.indexedDB;if(i.isBeingOpened||r.idbdb)return i.dbReadyPromise.then(function(){return i.dbOpenError?Ct(i.dbOpenError):r});i.isBeingOpened=!0,i.dbOpenError=null,i.openComplete=!1;var f=i.openCanceller,p=Math.round(10*r.verno),v=!1;function b(){if(i.openCanceller!==f)throw new Ie.DatabaseClosed("db.open() was cancelled")}function _(){return new Ce(function(A,R){if(b(),!l)throw new Ie.MissingAPI;var I=r.name,M=i.autoSchema||!p?l.open(I):l.open(I,p);if(!M)throw new Ie.MissingAPI;M.onerror=dn(R),M.onblocked=mt(r._fireOnBlocked),M.onupgradeneeded=mt(function(j){var z;O=M.transaction,i.autoSchema&&!r._options.allowEmptyDB?(M.onerror=as,O.abort(),M.result.close(),(z=l.deleteDatabase(I)).onsuccess=z.onerror=mt(function(){R(new Ie.NoSuchDatabase("Database ".concat(I," doesnt exist")))})):(O.onerror=dn(R),z=j.oldVersion>Math.pow(2,62)?0:j.oldVersion,C=z<1,r.idbdb=M.result,v&&Hf(r,O),qf(r,z/10,O,R))},R),M.onsuccess=mt(function(){O=null;var j,z,U,ee,pe,ve,_e=r.idbdb=M.result,me=S(_e.objectStoreNames);if(0<me.length)try{var Ae=_e.transaction((pe=me).length===1?pe[0]:pe,"readonly");if(i.autoSchema)ve=_e,ee=Ae,(U=r).verno=ve.version/10,ee=U._dbSchema=co(0,ve,ee),U._storeNames=S(ve.objectStoreNames,0),lo(U,[U._allTables],c(ee),ee);else if(fo(r,r._dbSchema,Ae),z=Ae,((z=ji(co(0,(j=r).idbdb,z),j._dbSchema)).add.length||z.change.some(function(be){return be.add.length||be.change.length}))&&!v)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),_e.close(),p=_e.version+1,v=!0,A(_());ao(r,Ae)}catch{}cs.add(r),_e.onversionchange=mt(function(be){i.vcFired=!0,r.on("versionchange").fire(be)}),_e.onclose=mt(function(){r.close({disableAutoOpen:!1})}),C&&(me=r._deps,pe=I,Li(ve=me.indexedDB)||pe===eo||Ri(ve,me.IDBKeyRange).put({name:pe}).catch(g)),A()},R)}).catch(function(A){switch(A==null?void 0:A.name){case"UnknownError":if(0<i.PR1398_maxLoop)return i.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),_();break;case"VersionError":if(0<p)return p=0,_()}return Ce.reject(A)})}var E,B=i.dbReadyResolve,O=null,C=!1;return Ce.race([f,(typeof navigator>"u"?Ce.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(A){function R(){return indexedDB.databases().finally(A)}E=setInterval(R,100),R()}).finally(function(){return clearInterval(E)}):Promise.resolve()).then(_)]).then(function(){return b(),i.onReadyBeingFired=[],Ce.resolve(Ki(function(){return r.on.ready.fire(r.vip)})).then(function A(){var R;if(0<i.onReadyBeingFired.length)return R=i.onReadyBeingFired.reduce(W,g),i.onReadyBeingFired=[],Ce.resolve(Ki(function(){return R(r.vip)})).then(A)})}).finally(function(){i.openCanceller===f&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(A){i.dbOpenError=A;try{O&&O.abort()}catch{}return f===i.openCanceller&&r._close(),Ct(A)}).finally(function(){i.openComplete=!0,B()}).then(function(){var A;return C&&(A={},r.tables.forEach(function(R){R.schema.indexes.forEach(function(I){I.name&&(A["idb://".concat(r.name,"/").concat(R.name,"/").concat(I.name)]=new Dt(-1/0,[[[]]]))}),A["idb://".concat(r.name,"/").concat(R.name,"/")]=A["idb://".concat(r.name,"/").concat(R.name,"/:dels")]=new Dt(-1/0,[[[]]])}),Jn(io).fire(A),Ui(A,!0)),r})}function qi(r){function i(v){return r.next(v)}var l=p(i),f=p(function(v){return r.throw(v)});function p(v){return function(_){var _=v(_),E=_.value;return _.done?E:E&&typeof E.then=="function"?E.then(l,f):d(E)?Promise.all(E).then(l,f):l(E)}}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 Gf={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return s(s({},r),{table:function(f){var l=r.table(f),f=l.schema,p=Object.create(null),v=[];function b(A,R,I){var U=us(A),M=p[U]=p[U]||[],j=A==null?0:typeof A=="string"?1:A.length,z=0<R,U=s(s({},I),{name:z?"".concat(U,"(virtual-from:").concat(I.name,")"):I.name,lowLevelIndex:I,isVirtual:z,keyTail:R,keyLength:j,extractKey:Mi(A),unique:!z&&I.unique});return M.push(U),U.isPrimaryKey||v.push(U),1<j&&b(j===2?A[0]:A.slice(0,j-1),R+1,I),M.sort(function(ee,pe){return ee.keyTail-pe.keyTail}),U}var _=b(f.primaryKey.keyPath,0,f.primaryKey);p[":id"]=[_];for(var E=0,B=f.indexes;E<B.length;E++){var O=B[E];b(O.keyPath,0,O)}function C(A){var R,I=A.query.index;return I.isVirtual?s(s({},A),{query:{index:I.lowLevelIndex,range:(R=A.query.range,I=I.keyTail,{type:R.type===1?2:R.type,lower:mo(R.lower,R.lowerOpen?r.MAX_KEY:r.MIN_KEY,I),lowerOpen:!0,upper:mo(R.upper,R.upperOpen?r.MIN_KEY:r.MAX_KEY,I),upperOpen:!0})}}):A}return s(s({},l),{schema:s(s({},f),{primaryKey:_,indexes:v,getIndexByKeyPath:function(A){return(A=p[us(A)])&&A[0]}}),count:function(A){return l.count(C(A))},query:function(A){return l.query(C(A))},openCursor:function(A){var R=A.query.index,I=R.keyTail,M=R.keyLength;return R.isVirtual?l.openCursor(C(A)).then(function(z){return z&&j(z)}):l.openCursor(A);function j(z){return Object.create(z,{continue:{value:function(U){U!=null?z.continue(mo(U,A.reverse?r.MAX_KEY:r.MIN_KEY,I)):A.unique?z.continue(z.key.slice(0,M).concat(A.reverse?r.MIN_KEY:r.MAX_KEY,I)):z.continue()}},continuePrimaryKey:{value:function(U,ee){z.continuePrimaryKey(mo(U,r.MAX_KEY,I),ee)}},primaryKey:{get:function(){return z.primaryKey}},key:{get:function(){var U=z.key;return M===1?U[0]:U.slice(0,M)}},value:{get:function(){return z.value}}})}}})}})}};function Hi(r,i,l,f){return l=l||{},f=f||"",c(r).forEach(function(p){var v,b,_;k(i,p)?(v=r[p],b=i[p],typeof v=="object"&&typeof b=="object"&&v&&b?(_=nt(v))!==nt(b)?l[f+p]=i[p]:_==="Object"?Hi(v,b,l,f+p+"."):v!==b&&(l[f+p]=i[p]):v!==b&&(l[f+p]=i[p])):l[f+p]=void 0}),c(i).forEach(function(p){k(r,p)||(l[f+p]=i[p])}),l}function Wi(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var Yf={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return s(s({},r),{table:function(i){var l=r.table(i),f=l.schema.primaryKey;return s(s({},l),{mutate:function(p){var v=Me.trans,b=v.table(i).hook,_=b.deleting,E=b.creating,B=b.updating;switch(p.type){case"add":if(E.fire===g)break;return v._promise("readwrite",function(){return O(p)},!0);case"put":if(E.fire===g&&B.fire===g)break;return v._promise("readwrite",function(){return O(p)},!0);case"delete":if(_.fire===g)break;return v._promise("readwrite",function(){return O(p)},!0);case"deleteRange":if(_.fire===g)break;return v._promise("readwrite",function(){return function C(A,R,I){return l.query({trans:A,values:!1,query:{index:f,range:R},limit:I}).then(function(M){var j=M.result;return O({type:"delete",keys:j,trans:A}).then(function(z){return 0<z.numFailures?Promise.reject(z.failures[0]):j.length<I?{failures:[],numFailures:0,lastResult:void 0}:C(A,s(s({},R),{lower:j[j.length-1],lowerOpen:!0}),I)})})}(p.trans,p.range,1e4)},!0)}return l.mutate(p);function O(C){var A,R,I,M=Me.trans,j=C.keys||Wi(f,C);if(j)return(C=C.type==="add"||C.type==="put"?s(s({},C),{keys:j}):s({},C)).type!=="delete"&&(C.values=o([],C.values)),C.keys&&(C.keys=o([],C.keys)),A=l,I=j,((R=C).type==="add"?Promise.resolve([]):A.getMany({trans:R.trans,keys:I,cache:"immutable"})).then(function(z){var U=j.map(function(ee,pe){var ve,_e,me,Ae=z[pe],be={onerror:null,onsuccess:null};return C.type==="delete"?_.fire.call(be,ee,Ae,M):C.type==="add"||Ae===void 0?(ve=E.fire.call(be,ee,C.values[pe],M),ee==null&&ve!=null&&(C.keys[pe]=ee=ve,f.outbound||Z(C.values[pe],f.keyPath,ee))):(ve=Hi(Ae,C.values[pe]),(_e=B.fire.call(be,ve,ee,Ae,M))&&(me=C.values[pe],Object.keys(_e).forEach(function(Pe){k(me,Pe)?me[Pe]=_e[Pe]:Z(me,Pe,_e[Pe])}))),be});return l.mutate(C).then(function(ee){for(var pe=ee.failures,ve=ee.results,_e=ee.numFailures,ee=ee.lastResult,me=0;me<j.length;++me){var Ae=(ve||j)[me],be=U[me];Ae==null?be.onerror&&be.onerror(pe[me]):be.onsuccess&&be.onsuccess(C.type==="put"&&z[me]?C.values[me]:Ae)}return{failures:pe,results:ve,numFailures:_e,lastResult:ee}}).catch(function(ee){return U.forEach(function(pe){return pe.onerror&&pe.onerror(ee)}),Promise.reject(ee)})});throw new Error("Keys missing")}}})}})}};function Dl(r,i,l){try{if(!i||i.keys.length<r.length)return null;for(var f=[],p=0,v=0;p<i.keys.length&&v<r.length;++p)tt(i.keys[p],r[v])===0&&(f.push(l?xe(i.values[p]):i.values[p]),++v);return f.length===r.length?f:null}catch{return null}}var Jf={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=Dl(f.keys,f.trans._cache,f.cache==="clone"))?Ce.resolve(p):l.getMany(f).then(function(v){return f.trans._cache={keys:f.keys,values:f.cache==="clone"?xe(v):v},v}):l.getMany(f)},mutate:function(f){return f.type!=="add"&&(f.trans._cache=null),l.mutate(f)}})}}}};function Rl(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function Ll(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Xf={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,l=new Dt(r.MIN_KEY,r.MAX_KEY);return s(s({},r),{transaction:function(f,p,v){if(Me.subscr&&p!=="readonly")throw new Ie.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Me.querier));return r.transaction(f,p,v)},table:function(f){function p(j){var M,j=j.query;return[M=j.index,new Dt((M=(j=j.range).lower)!=null?M:r.MIN_KEY,(M=j.upper)!=null?M:r.MAX_KEY)]}var v=r.table(f),b=v.schema,_=b.primaryKey,E=b.indexes,B=_.extractKey,O=_.outbound,C=_.autoIncrement&&E.filter(function(I){return I.compound&&I.keyPath.includes(_.keyPath)}),A=s(s({},v),{mutate:function(I){function M(he){return he="idb://".concat(i,"/").concat(f,"/").concat(he),pe[he]||(pe[he]=new Dt)}var j,z,U,ee=I.trans,pe=I.mutatedParts||(I.mutatedParts={}),ve=M(""),_e=M(":dels"),me=I.type,be=I.type==="deleteRange"?[I.range]:I.type==="delete"?[I.keys]:I.values.length<50?[Wi(_,I).filter(function(he){return he}),I.values]:[],Ae=be[0],be=be[1],Pe=I.trans._cache;return d(Ae)?(ve.addKeys(Ae),(me=me==="delete"||Ae.length===be.length?Dl(Ae,Pe):null)||_e.addKeys(Ae),(me||be)&&(j=M,z=me,U=be,b.indexes.forEach(function(he){var Be=j(he.name||"");function Ue(Ze){return Ze!=null?he.extractKey(Ze):null}function Ye(Ze){he.multiEntry&&d(Ze)?Ze.forEach(function(tn){return Be.addKey(tn)}):Be.addKey(Ze)}(z||U).forEach(function(Ze,Rt){var ze=z&&Ue(z[Rt]),Rt=U&&Ue(U[Rt]);tt(ze,Rt)!==0&&(ze!=null&&Ye(ze),Rt!=null)&&Ye(Rt)})}))):Ae?(be={from:(Pe=Ae.lower)!=null?Pe:r.MIN_KEY,to:(me=Ae.upper)!=null?me:r.MAX_KEY},_e.add(be),ve.add(be)):(ve.add(l),_e.add(l),b.indexes.forEach(function(he){return M(he.name).add(l)})),v.mutate(I).then(function(he){return!Ae||I.type!=="add"&&I.type!=="put"||(ve.addKeys(he.results),C&&C.forEach(function(Be){for(var Ue=I.values.map(function(ze){return Be.extractKey(ze)}),Ye=Be.keyPath.findIndex(function(ze){return ze===_.keyPath}),Ze=0,tn=he.results.length;Ze<tn;++Ze)Ue[Ze][Ye]=he.results[Ze];M(Be.name).addKeys(Ue)})),ee.mutatedParts=ho(ee.mutatedParts||{},pe),he})}}),R={get:function(I){return[_,new Dt(I.key)]},getMany:function(I){return[_,new Dt().addKeys(I.keys)]},count:p,query:p,openCursor:p};return c(R).forEach(function(I){A[I]=function(M){var j=Me.subscr,z=!!j,U=Rl(Me,v)&&Ll(I,M)?M.obsSet={}:j;if(z){var ee,j=function(be){return be="idb://".concat(i,"/").concat(f,"/").concat(be),U[be]||(U[be]=new Dt)},pe=j(""),ve=j(":dels"),z=R[I](M),_e=z[0],z=z[1];if((I==="query"&&_e.isPrimaryKey&&!M.values?ve:j(_e.name||"")).add(z),!_e.isPrimaryKey){if(I!=="count")return ee=I==="query"&&O&&M.values&&v.query(s(s({},M),{values:!1})),v[I].apply(this,arguments).then(function(be){if(I==="query"){if(O&&M.values)return ee.then(function(Ue){return Ue=Ue.result,pe.addKeys(Ue),be});var Pe=M.values?be.result.map(B):be.result;(M.values?pe:ve).addKeys(Pe)}else{var he,Be;if(I==="openCursor")return Be=M.values,(he=be)&&Object.create(he,{key:{get:function(){return ve.addKey(he.primaryKey),he.key}},primaryKey:{get:function(){var Ue=he.primaryKey;return ve.addKey(Ue),Ue}},value:{get:function(){return Be&&pe.addKey(he.primaryKey),he.value}}})}return be});ve.add(l)}}return v[I].apply(this,arguments)}}),A}})}};function Kl(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 zi(r,i){return l=r,((f=i).lower===void 0||(f.lowerOpen?0<tt(l,f.lower):0<=tt(l,f.lower)))&&(l=r,(f=i).upper===void 0||(f.upperOpen?tt(l,f.upper)<0:tt(l,f.upper)<=0));var l,f}function Fl(r,i,l,f,p,v){var b,_,E,B,O,C,A;return!l||l.length===0||(b=i.query.index,_=b.multiEntry,E=i.query.range,B=f.schema.primaryKey.extractKey,O=b.extractKey,C=(b.lowLevelIndex||b).extractKey,(f=l.reduce(function(R,I){var M=R,j=[];if(I.type==="add"||I.type==="put")for(var z=new Dt,U=I.values.length-1;0<=U;--U){var ee,pe=I.values[U],ve=B(pe);!z.hasKey(ve)&&(ee=O(pe),_&&d(ee)?ee.some(function(Pe){return zi(Pe,E)}):zi(ee,E))&&(z.addKey(ve),j.push(pe))}switch(I.type){case"add":var _e=new Dt().addKeys(i.values?R.map(function(he){return B(he)}):R),M=R.concat(i.values?j.filter(function(he){return he=B(he),!_e.hasKey(he)&&(_e.addKey(he),!0)}):j.map(function(he){return B(he)}).filter(function(he){return!_e.hasKey(he)&&(_e.addKey(he),!0)}));break;case"put":var me=new Dt().addKeys(I.values.map(function(he){return B(he)}));M=R.filter(function(he){return!me.hasKey(i.values?B(he):he)}).concat(i.values?j:j.map(function(he){return B(he)}));break;case"delete":var Ae=new Dt().addKeys(I.keys);M=R.filter(function(he){return!Ae.hasKey(i.values?B(he):he)});break;case"deleteRange":var be=I.range;M=R.filter(function(he){return!zi(B(he),be)})}return M},r))===r)?r:(A=function(R,I){return tt(C(R),C(I))||tt(B(R),B(I))},f.sort(i.direction==="prev"||i.direction==="prevunique"?function(R,I){return A(I,R)}:A),i.limit&&i.limit<1/0&&(f.length>i.limit?f.length=i.limit:r.length===i.limit&&f.length<i.limit&&(p.dirty=!0)),v?Object.freeze(f):f)}function Nl(r,i){return tt(r.lower,i.lower)===0&&tt(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function Qf(r,i){return((l,f,p,v)=>{if(l===void 0)return f!==void 0?-1:0;if(f===void 0)return 1;if((l=tt(l,f))===0){if(p&&v)return 0;if(p)return 1;if(v)return-1}return l})(r.lower,i.lower,r.lowerOpen,i.lowerOpen)<=0&&0<=((l,f,p,v)=>{if(l===void 0)return f!==void 0?1:0;if(f===void 0)return-1;if((l=tt(l,f))===0){if(p&&v)return 0;if(p)return-1;if(v)return 1}return l})(r.upper,i.upper,r.upperOpen,i.upperOpen)}function Zf(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&&ye(v,p)},3e3))})}var ed={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return s(s({},r),{transaction:function(l,f,p){var v,b,_=r.transaction(l,f,p);return f==="readwrite"&&(p=(v=new AbortController).signal,_.addEventListener("abort",(b=function(E){return function(){if(v.abort(),f==="readwrite"){for(var B=new Set,O=0,C=l;O<C.length;O++){var A=C[O],R=br["idb://".concat(i,"/").concat(A)];if(R){var I=r.table(A),M=R.optimisticOps.filter(function(he){return he.trans===_});if(_._explicit&&E&&_.mutatedParts)for(var j=0,z=Object.values(R.queries.query);j<z.length;j++)for(var U=0,ee=(_e=z[j]).slice();U<ee.length;U++)Ni((me=ee[U]).obsSet,_.mutatedParts)&&(ye(_e,me),me.subscribers.forEach(function(he){return B.add(he)}));else if(0<M.length){R.optimisticOps=R.optimisticOps.filter(function(he){return he.trans!==_});for(var pe=0,ve=Object.values(R.queries.query);pe<ve.length;pe++)for(var _e,me,Ae,be=0,Pe=(_e=ve[pe]).slice();be<Pe.length;be++)(me=Pe[be]).res!=null&&_.mutatedParts&&(E&&!me.dirty?(Ae=Object.isFrozen(me.res),Ae=Fl(me.res,me.req,M,I,me,Ae),me.dirty?(ye(_e,me),me.subscribers.forEach(function(he){return B.add(he)})):Ae!==me.res&&(me.res=Ae,me.promise=Ce.resolve({result:Ae}))):(me.dirty&&ye(_e,me),me.subscribers.forEach(function(he){return B.add(he)})))}}}B.forEach(function(he){return he()})}}})(!1),{signal:p}),_.addEventListener("error",b(!1),{signal:p}),_.addEventListener("complete",b(!0),{signal:p})),_},table:function(l){var f=r.table(l),p=f.schema.primaryKey;return s(s({},f),{mutate:function(v){var b,_=Me.trans;return!p.outbound&&_.db._options.cache!=="disabled"&&!_.explicit&&_.idbtrans.mode==="readwrite"&&(b=br["idb://".concat(i,"/").concat(l)])?(_=f.mutate(v),v.type!=="add"&&v.type!=="put"||!(50<=v.values.length||Wi(p,v).some(function(E){return E==null}))?(b.optimisticOps.push(v),v.mutatedParts&&vo(v.mutatedParts),_.then(function(E){0<E.numFailures&&(ye(b.optimisticOps,v),(E=Kl(0,v,E))&&b.optimisticOps.push(E),v.mutatedParts)&&vo(v.mutatedParts)}),_.catch(function(){ye(b.optimisticOps,v),v.mutatedParts&&vo(v.mutatedParts)})):_.then(function(E){var B=Kl(0,s(s({},v),{values:v.values.map(function(O,C){var A;return E.failures[C]?O:(Z(A=(A=p.keyPath)!=null&&A.includes(".")?xe(O):s({},O),p.keyPath,E.results[C]),A)})}),E);b.optimisticOps.push(B),queueMicrotask(function(){return v.mutatedParts&&vo(v.mutatedParts)})}),_):f.mutate(v)},query:function(v){var b,_,E,B,O,C,A;return Rl(Me,f)&&Ll("query",v)?(b=((E=Me.trans)==null?void 0:E.db._options.cache)==="immutable",_=(E=Me).requery,E=E.signal,C=((R,I,M,j)=>{var z=br["idb://".concat(R,"/").concat(I)];if(!z)return[];if(!(R=z.queries[M]))return[null,!1,z,null];var U=R[(j.query?j.query.index.name:null)||""];if(!U)return[null,!1,z,null];switch(M){case"query":var ee=(pe=j.direction)!=null?pe:"next",pe=U.find(function(ve){var _e;return ve.req.limit===j.limit&&ve.req.values===j.values&&((_e=ve.req.direction)!=null?_e:"next")===ee&&Nl(ve.req.query.range,j.query.range)});return pe?[pe,!0,z,U]:[U.find(function(ve){var _e;return("limit"in ve.req?ve.req.limit:1/0)>=j.limit&&((_e=ve.req.direction)!=null?_e:"next")===ee&&(!j.values||ve.req.values)&&Qf(ve.req.query.range,j.query.range)}),!1,z,U];case"count":return pe=U.find(function(ve){return Nl(ve.req.query.range,j.query.range)}),[pe,!!pe,z,U]}})(i,l,"query",v),A=C[0],B=C[2],O=C[3],A&&C[1]?A.obsSet=v.obsSet:(C=f.query(v).then(function(R){var I=R.result;if(A&&(A.res=I),b){for(var M=0,j=I.length;M<j;++M)Object.freeze(I[M]);Object.freeze(I)}return R}).catch(function(R){return O&&A&&ye(O,A),Promise.reject(R)}),A={obsSet:v.obsSet,promise:C,subscribers:new Set,type:"query",req:v,dirty:!1},O?O.push(A):(O=[A],(B=B||(br["idb://".concat(i,"/").concat(l)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[v.query.index.name||""]=O)),Zf(A,O,_,E),A.promise.then(function(R){return R=Fl(R.result,v,B==null?void 0:B.optimisticOps,f,A,b),{result:b?R:xe(R)}})):f.query(v)}})}})}};function yo(r,i){return new Proxy(r,{get:function(l,f,p){return f==="db"?i:Reflect.get(l,f,p)}})}Et.prototype.version=function(r){if(isNaN(r)||r<.1)throw new Ie.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new Ie.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var i=this._versions,l=i.filter(function(f){return f._cfg.version===r})[0];return l||(l=new this.Version(r),i.push(l),i.sort(Uf),l.stores({}),this._state.autoSchema=!1),l},Et.prototype._whenReady=function(r){var i=this;return this.idbdb&&(this._state.openComplete||Me.letThrough||this._vip)?r():new Ce(function(l,f){if(i._state.openComplete)return f(new Ie.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void f(new Ie.DatabaseClosed);i.open().catch(g)}i._state.dbReadyPromise.then(l,f)}).then(r)},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(b,_){return b.level-_.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($t,function(){return zf(r)})},Et.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var r=this._state;if(cs.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new Ce(function(i){r.dbReadyResolve=i}),r.openCanceller=new Ce(function(i,l){r.cancelOpen=l}))},Et.prototype.close=function(i){var i=(i===void 0?{disableAutoOpen:!0}:i).disableAutoOpen,l=this._state;i?(l.isBeingOpened&&l.cancelOpen(new Ie.DatabaseClosed),this._close(),l.autoOpen=!1,l.dbOpenError=new Ie.DatabaseClosed):(this._close(),l.autoOpen=this._options.autoOpen||l.isBeingOpened,l.openComplete=!1,l.dbOpenError=null)},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 Ce(function(p,v){function b(){i.close(r);var _=i._deps.indexedDB.deleteDatabase(i.name);_.onsuccess=mt(function(){var E,B,O;E=i._deps,B=i.name,Li(O=E.indexedDB)||B===eo||Ri(O,E.IDBKeyRange).delete(B).catch(g),p()}),_.onerror=dn(v),_.onblocked=i._fireOnBlocked}if(l)throw new Ie.InvalidArgument("Invalid closeOptions argument to db.delete()");f.isBeingOpened?f.dbReadyPromise.then(b):b()})},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 Ie.InvalidArgument("Too few arguments");for(var v=new Array(p-1);--p;)v[p-1]=arguments[p];return f=v.pop(),[i,le(v),f]}).apply(this,arguments);return this._transaction.apply(this,r)},Et.prototype._transaction=function(r,i,l){var f,p,v=this,b=Me.trans,_=(b&&b.db===this&&r.indexOf("!")===-1||(b=null),r.indexOf("?")!==-1);r=r.replace("!","").replace("?","");try{if(p=i.map(function(B){if(B=B instanceof v.Table?B.name:B,typeof B!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return B}),r=="r"||r===Ei)f=Ei;else{if(r!="rw"&&r!=Si)throw new Ie.InvalidArgument("Invalid transaction mode: "+r);f=Si}if(b){if(b.mode===Ei&&f===Si){if(!_)throw new Ie.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");b=null}b&&p.forEach(function(B){if(b&&b.storeNames.indexOf(B)===-1){if(!_)throw new Ie.SubTransaction("Table "+B+" not included in parent transaction.");b=null}}),_&&b&&!b.active&&(b=null)}}catch(B){return b?b._promise(null,function(O,C){C(B)}):Ct(B)}var E=(function B(O,C,A,R,I){return Ce.resolve().then(function(){var U=Me.transless||Me,M=O._createTransaction(C,A,O._dbSchema,R),U=(M.explicit=!0,{trans:M,transless:U});if(R)M.idbtrans=R.idbtrans;else try{M.create(),M.idbtrans._explicit=!0,O._state.PR1398_maxLoop=3}catch(ee){return ee.name===Yt.InvalidState&&O.isOpen()&&0<--O._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),O.close({disableAutoOpen:!1}),O.open().then(function(){return B(O,C,A,null,I)})):Ct(ee)}var j,z=je(I),U=(z&&Kr(),Ce.follow(function(){var ee;(j=I.call(M,M))&&(z?(ee=zn.bind(null,null),j.then(ee,ee)):typeof j.next=="function"&&typeof j.throw=="function"&&(j=qi(j)))},U));return(j&&typeof j.then=="function"?Ce.resolve(j).then(function(ee){return M.active?ee:Ct(new Ie.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):U.then(function(){return j})).then(function(ee){return R&&M._resolve(),M._completion.then(function(){return ee})}).catch(function(ee){return M._reject(ee),Ct(ee)})})}).bind(null,this,f,p,b,l);return b?b._promise(f,E,"lock"):Me.trans?mr(Me.transless,function(){return v._whenReady(E)}):this._whenReady(E)},Et.prototype.table=function(r){if(k(this._allTables,r))return this._allTables[r];throw new Ie.InvalidTable("Table ".concat(r," does not exist"))};var Mn=Et;function Et(r,i){var l,f,p,v,b,_=this,E=(this._middlewares={},this.verno=0,Et.dependencies),E=(this._options=i=s({addons:Et.addons,autoOpen:!0,indexedDB:E.indexedDB,IDBKeyRange:E.IDBKeyRange,cache:"cloned",maxConnections:1e3},i),this._deps={indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},i.addons),B=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:g,dbReadyPromise:null,cancelOpen:g,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:i.autoOpen}),O=(B.dbReadyPromise=new Ce(function(C){B.dbReadyResolve=C}),B.openCanceller=new Ce(function(C,A){B.cancelOpen=A}),this._state=B,this.name=r,this.on=os(this,"populate","blocked","versionchange","close",{ready:[W,g]}),this.once=function(C,A){var R=function(){for(var I=[],M=0;M<arguments.length;M++)I[M]=arguments[M];_.on(C).unsubscribe(R),A.apply(_,I)};return _.on(C,R)},this.on.ready.subscribe=N(this.on.ready.subscribe,function(C){return function(A,R){Et.vip(function(){var I,M=_._state;M.openComplete?(M.dbOpenError||Ce.resolve().then(A),R&&C(A)):M.onReadyBeingFired?(M.onReadyBeingFired.push(A),R&&C(A)):(C(A),I=_,R||C(function j(){I.on.ready.unsubscribe(A),I.on.ready.unsubscribe(j)}))})}}),this.Collection=(l=this,is(Rf.prototype,function(j,M){this.db=l;var R=vl,I=null;if(M)try{R=M()}catch(U){I=U}var M=j._ctx,j=M.table,z=j.hook.reading.fire;this._ctx={table:j,index:M.index,isPrimKey:!M.index||j.schema.primKey.keyPath&&M.index===j.schema.primKey.name,range:R,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:I,or:M.or,valueMapper:z!==P?z:null}})),this.Table=(f=this,is(_l.prototype,function(C,A,R){this.db=f,this._tx=R,this.name=C,this.schema=A,this.hook=f._allTables[C]?f._allTables[C].hook:os(null,{creating:[ue,g],reading:[ie,P],updating:[oe,g],deleting:[ge,g]})})),this.Transaction=(p=this,is(Ff.prototype,function(C,A,R,I,M){var j=this;C!=="readonly"&&A.forEach(function(z){z=(z=R[z])==null?void 0:z.yProps,z&&(A=A.concat(z.map(function(U){return U.updatesTable})))}),this.db=p,this.mode=C,this.storeNames=A,this.schema=R,this.chromeTransactionDurability=I,this.idbtrans=null,this.on=os(this,"complete","error","abort"),this.parent=M||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Ce(function(z,U){j._resolve=z,j._reject=U}),this._completion.then(function(){j.active=!1,j.on.complete.fire()},function(z){var U=j.active;return j.active=!1,j.on.error.fire(z),j.parent?j.parent._reject(z):U&&j.idbtrans&&j.idbtrans.abort(),Ct(z)})})),this.Version=(v=this,is(Wf.prototype,function(C){this.db=v,this._cfg={version:C,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(b=this,is(Sl.prototype,function(C,A,R){if(this.db=b,this._ctx={table:C,index:A===":id"?null:A,or:R},this._cmp=this._ascending=tt,this._descending=function(I,M){return tt(M,I)},this._max=function(I,M){return 0<tt(I,M)?I:M},this._min=function(I,M){return tt(I,M)<0?I:M},this._IDBKeyRange=b._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ie.MissingAPI})),this.on("versionchange",function(C){0<C.newVersion?console.warn("Another connection wants to upgrade database '".concat(_.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(_.name,"'. Closing db now to resume the delete request.")),_.close({disableAutoOpen:!1})}),this.on("blocked",function(C){!C.newVersion||C.newVersion<C.oldVersion?console.warn("Dexie.delete('".concat(_.name,"') was blocked")):console.warn("Upgrade '".concat(_.name,"' blocked by other connection holding version ").concat(C.oldVersion/10))}),this._maxKey=ls(i.IDBKeyRange),this._createTransaction=function(C,A,R,I){return new _.Transaction(C,A,R,_._options.chromeTransactionDurability,I)},this._fireOnBlocked=function(C){_.on("blocked").fire(C),cs.toArray().filter(function(A){return A.name===_.name&&A!==_&&!A._state.vcFired}).map(function(A){return A.on("versionchange").fire(C)})},this.use(Jf),this.use(ed),this.use(Xf),this.use(Gf),this.use(Yf),new Proxy(this,{get:function(C,A,R){var I;return A==="_vip"||(A==="table"?function(M){return yo(_.table(M),O)}:(I=Reflect.get(C,A,R))instanceof _l?yo(I,O):A==="tables"?I.map(function(M){return yo(M,O)}):A==="_createTransaction"?function(){return yo(I.apply(this,arguments),O)}:I)}}));this.vip=O,E.forEach(function(C){return C(_)})}var go,Br=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",td=(Gi.prototype.subscribe=function(r,i,l){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:l})},Gi.prototype[Br]=function(){return this},Gi);function Gi(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 Vl(r){var i,l=!1,f=new td(function(p){var v=je(r),b,_=!1,E={},B={},O={get closed(){return _},unsubscribe:function(){_||(_=!0,b&&b.abort(),C&&Jn.storagemutated.unsubscribe(I))}},C=(p.start&&p.start(O),!1),A=function(){return Ci(M)};function R(){return Ni(B,E)}var I=function(j){ho(E,j),R()&&A()},M=function(){var j,z,U;!_&&go.indexedDB&&(E={},j={},b&&b.abort(),b=new AbortController,U=(ee=>{var pe=Rr();try{v&&Kr();var ve=Wn(r,ee);return ve=v?ve.finally(zn):ve}finally{pe&&Lr()}})(z={subscr:j,signal:b.signal,requery:A,querier:r,trans:null}),C||(Jn.storagemutated.subscribe(I),C=!0),Promise.resolve(U).then(function(ee){l=!0,i=ee,_||z.signal.aborted||(R()||(B=j,R())?A():(E={},Ci(function(){return!_&&p.next&&p.next(ee)})))},function(ee){l=!1,["DatabaseClosedError","AbortError"].includes(ee==null?void 0:ee.name)||_||Ci(function(){_||p.error&&p.error(ee)})}))};return setTimeout(A,0),O});return f.hasValue=function(){return l},f.getValue=function(){return i},f}var wr=Mn;function Yi(r){var i=Xn;try{Xn=!0,Jn.storagemutated.fire(r),Ui(r,!0)}finally{Xn=i}}D(wr,s(s({},ne),{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,(Li(l)?Promise.resolve(l.databases()).then(function(f){return f.map(function(p){return p.name}).filter(function(p){return p!==eo})}):Ri(l,i).toCollection().primaryKeys()).then(r)}catch{return Ct(new Ie.MissingAPI)}var i,l},defineClass:function(){return function(r){h(this,r)}},ignoreTransaction:function(r){return Me.trans?mr(Me.transless||$t,r):r()},vip:Ki,async:function(r){return function(){try{var i=qi(r.apply(this,arguments));return i&&typeof i.then=="function"?i:Ce.resolve(i)}catch(l){return Ct(l)}}},spawn:function(r,i,l){try{var f=qi(r.apply(l,i||[]));return f&&typeof f.then=="function"?f:Ce.resolve(f)}catch(p){return Ct(p)}},currentTransaction:{get:function(){return Me.trans||null}},waitFor:function(r,i){return r=Ce.resolve(typeof r=="function"?wr.ignoreTransaction(r):r).timeout(i||6e4),Me.trans?Me.trans.waitFor(r):r},Promise:Ce,debug:{get:function(){return q},set:function(r){Y(r)}},derive:X,extend:h,props:D,override:N,Events:os,on:Jn,liveQuery:Vl,extendObservabilitySet:ho,getByKeyPath:ae,setByKeyPath:Z,delByKeyPath:function(r,i){typeof i=="string"?Z(r,i,void 0):"length"in i&&[].map.call(i,function(l){Z(r,l,void 0)})},shallowClone:$,deepClone:xe,getObjectDiff:Hi,cmp:tt,asap:de,minKey:-1/0,addons:[],connections:{get:cs.toArray},errnames:Yt,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=ls(wr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Jn(io,function(r){Xn||(r=new CustomEvent(Pi,{detail:r}),Xn=!0,dispatchEvent(r),Xn=!1)}),addEventListener(Pi,function(r){r=r.detail,Xn||Yi(r)}));var Ur,Xn=!1,Bl=function(){};return typeof BroadcastChannel<"u"&&((Bl=function(){(Ur=new BroadcastChannel(Pi)).onmessage=function(r){return r.data&&Yi(r.data)}})(),typeof Ur.unref=="function"&&Ur.unref(),Jn(io,function(r){Xn||Ur.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!Mn.disableBfCache&&r.persisted){q&&console.debug("Dexie: handling persisted pagehide"),Ur!=null&&Ur.close();for(var i=0,l=cs.toArray();i<l.length;i++)l[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!Mn.disableBfCache&&r.persisted&&(q&&console.debug("Dexie: handling persisted pageshow"),Bl(),Yi({all:new Dt(-1/0,[[]])}))})),Ce.rejectionMapper=function(r,i){return!r||r instanceof fe||r instanceof TypeError||r instanceof SyntaxError||!r.name||!w[r.name]?r:(i=new w[r.name](i||r.message,r),"stack"in r&&L(i,"stack",{get:function(){return this.inner.stack}}),i)},Y(q),s(Mn,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Mn,Entity:ml,PropModification:ss,RangeSet:Dt,add:function(r){return new ss({add:r})},cmp:tt,default:Mn,liveQuery:Vl,mergeRanges:ds,rangesOverlap:Ol,remove:function(r){return new ss({remove:r})},replacePrefix:function(r,i){return new ss({replacePrefix:[r,i]})}}),{default:Mn}),Mn})})(af);var Yh=af.exports;const Aa=Gh(Yh),Ou=Symbol.for("Dexie"),Ir=globalThis[Ou]||(globalThis[Ou]=Aa);if(Aa.semVer!==Ir.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Aa.semVer} and ${Ir.semVer}`);const{liveQuery:Jh,mergeRanges:O0,rangesOverlap:M0,RangeSet:I0,cmp:j0,Entity:D0,PropModification:R0,replacePrefix:L0,add:K0,remove:F0,DexieYProvider:N0}=Ir;class lf extends Ir{constructor(t="intern_worklog"){super(t),this.version(1).stores({project:"++id, &name, archived",work_log:"++id, &date",log_item:"++id, work_log_id, project_id, category",attendance:"++id, &date",weekly_note:"++id, &week_start",setting:"key"}),this.version(2).stores({memo:"++id, updated_at",credential:"++id, system, updated_at"}),this.version(3).stores({transaction:"++id, date, type, category"}),this.version(4).stores({sync_mirror:"++id, table, uuid",tombstone:"++id, table, uuid, deleted_at"})}}let te;function Xh(e){te=e}function el(){te&&te.close(),te=void 0}const Qh=4,Wr=["餐饮","交通","住房","通讯","学习","娱乐","其他"],qo=["工资","报销","其他"],Mu=["公司","客户现场","出差","居家办公"],qs=[{key:"dev",label:"开发"},{key:"bugfix",label:"BUG修复"},{key:"test",label:"测试"},{key:"learning",label:"学习成长"},{key:"meeting",label:"会议沟通"},{key:"doc",label:"文档输出"},{key:"other",label:"其他"}];function tl(e){const t=qs.find(n=>n.key===e);return t?t.label:"其他"}const Zh={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},ev={class:"dialog-head"},tv={key:0,class:"muted dialog-sub"},nv={class:"dialog-body"},rv={class:"form-grid"},sv={class:"field span2"},ov={key:0,class:"form-error"},iv={class:"field"},av=["value"],lv={class:"field"},uv=["value"],cv={class:"field"},fv={class:"field"},dv={class:"field span2"},pv={class:"field"},hv={class:"field"},vv={class:"dialog-btns"},mv=Vt({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=V(""),a=V(null),c=V("dev"),d=V(null),h=V(""),y=V(""),m=V(0),k=V(0),D=V(""),T=V(null),L=it(()=>{var N;const Q=n.projects.filter(G=>G.archived!==1),S=(N=n.item)==null?void 0:N.project_id;if(S&&!Q.some(G=>G.id===S)){const G=n.projects.find(ae=>ae.id===S),de=Q.slice();return G&&de.unshift({...G,name:G.name+"(已归档)"}),de}return Q});function X(Q){n.open&&Q.key==="Escape"&&s("cancel")}gt(()=>n.open,async Q=>{var S;if(Q){const N=n.item;o.value=(N==null?void 0:N.content)??"",a.value=(N==null?void 0:N.project_id)??null,c.value=(N==null?void 0:N.category)??"dev",d.value=(N==null?void 0:N.minutes)??null,h.value=(N==null?void 0:N.takeaway)??"",y.value=(N==null?void 0:N.remark)??"",m.value=(N==null?void 0:N.is_milestone)??0,k.value=(N==null?void 0:N.needs_followup)??0,D.value="",window.addEventListener("keydown",X),await ts(),(S=T.value)==null||S.focus()}else window.removeEventListener("keydown",X)}),pr(()=>window.removeEventListener("keydown",X)),gt(o,()=>{D.value&&(D.value="")});function ce(){const Q=o.value.trim();if(!Q){D.value="请填写工作内容";return}if(!n.item||!n.item.id){s("cancel");return}s("save",{id:n.item.id,content:Q,project_id:a.value,category:c.value,minutes:d.value&&d.value>0?d.value:null,takeaway:h.value.trim()||null,remark:y.value.trim()||null,is_milestone:m.value?1:0,needs_followup:k.value?1:0})}return(Q,S)=>(K(),It(Bs,{to:"body"},[Te(ns,{name:"modal"},{default:dr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:S[10]||(S[10]=Mr(N=>s("cancel"),["self"]))},[u("div",Zh,[u("div",ev,[u("div",null,[S[11]||(S[11]=u("div",{class:"dialog-title"},"编辑工作记录",-1)),e.date?(K(),H("div",tv,re(e.date),1)):Ee("",!0)]),u("button",{class:"icon-btn",title:"关闭",onClick:S[0]||(S[0]=N=>s("cancel"))},[Te(lt,{name:"close",size:16})])]),u("div",nv,[u("div",rv,[u("div",sv,[S[12]||(S[12]=u("label",null,"工作内容(必填)",-1)),Se(u("input",{ref_key:"contentInput",ref:T,class:et(["input",{invalid:D.value}]),"onUpdate:modelValue":S[1]||(S[1]=N=>o.value=N),onKeydown:jt(ce,["enter"])},null,34),[[De,o.value]]),D.value?(K(),H("div",ov,re(D.value),1)):Ee("",!0)]),u("div",iv,[S[14]||(S[14]=u("label",null,"所属项目",-1)),Se(u("select",{class:"select","onUpdate:modelValue":S[2]||(S[2]=N=>a.value=N)},[S[13]||(S[13]=u("option",{value:null},"无项目",-1)),(K(!0),H(Re,null,ut(L.value,N=>(K(),H("option",{key:N.id,value:N.id},re(N.name),9,av))),128))],512),[[Fn,a.value]])]),u("div",lv,[S[15]||(S[15]=u("label",null,"工作分类",-1)),Se(u("select",{class:"select","onUpdate:modelValue":S[3]||(S[3]=N=>c.value=N)},[(K(!0),H(Re,null,ut(Qt(qs),N=>(K(),H("option",{key:N.key,value:N.key},re(N.label),9,uv))),128))],512),[[Fn,c.value]])]),u("div",cv,[S[16]||(S[16]=u("label",null,"耗时(分钟)",-1)),Se(u("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":S[4]||(S[4]=N=>d.value=N),placeholder:"选填"},null,512),[[De,d.value,void 0,{number:!0}]])]),u("div",fv,[S[17]||(S[17]=u("label",null,"主要收获",-1)),Se(u("input",{class:"input","onUpdate:modelValue":S[5]||(S[5]=N=>h.value=N),placeholder:"一句话:学到了什么"},null,512),[[De,h.value]])]),u("div",dv,[S[18]||(S[18]=u("label",null,"备注",-1)),Se(u("textarea",{class:"textarea","onUpdate:modelValue":S[6]||(S[6]=N=>y.value=N),placeholder:"背景、链接、未决事项(选填)"},null,512),[[De,y.value]])]),u("div",pv,[S[19]||(S[19]=u("label",null,"成果标记",-1)),u("button",{class:et(["toggle-btn",{on:m.value===1}]),onClick:S[7]||(S[7]=N=>m.value=m.value===1?0:1)},re(m.value===1?"已标记为成果":"未标记"),3)]),u("div",hv,[S[20]||(S[20]=u("label",null,"待跟进",-1)),u("button",{class:et(["toggle-btn",{onwarn:k.value===1}]),onClick:S[8]||(S[8]=N=>k.value=k.value===1?0:1)},re(k.value===1?"需要跟进":"无需跟进"),3)])])]),u("div",vv,[u("button",{class:"btn btn-sm",onClick:S[9]||(S[9]=N=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:ce},"保存修改")])])])):Ee("",!0)]),_:1})]))}}),yv=Gt(mv,[["__scopeId","data-v-63bc0b48"]]);function Es(e){return e<10?"0"+e:String(e)}function Nn(e){return e.getFullYear()+"-"+Es(e.getMonth()+1)+"-"+Es(e.getDate())}function xt(){return Nn(new Date)}function wt(){const e=new Date;return Nn(e)+"T"+Es(e.getHours())+":"+Es(e.getMinutes())+":"+Es(e.getSeconds())}function Vn(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function rs(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Kn(e,t){const n=rs(e);return n.setDate(n.getDate()+t),Nn(n)}function Ho(e,t){const n=rs(e),s=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(s,o)),Nn(n)}function Ss(e){const t=rs(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Nn(t)}function gv(e){const t=rs(e).getDay();return t===0||t===6}function bv(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function uf(e){const t=rs(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}async function yt(e,t){const n=await te.setting.get(e);return n?n.value:t}async function kt(e,t){await te.setting.put({key:e,value:t})}async function jr(){const e=await Promise.all([yt("work_start","09:00"),yt("work_end","18:00"),yt("grace_minutes","10"),yt("lunch_minutes","60"),yt("remind_weekly","friday")]);return{work_start:e[0],work_end:e[1],grace_minutes:Number(e[2])||0,lunch_minutes:Number(e[3])||0,remind_weekly:e[4]}}async function wv(){const e=await yt("last_project",""),t=await yt("last_category","dev");return{project_id:e?Number(e):null,category:t||"dev"}}async function _v(){return yt("last_location","")}async function kv(e,t){const n=t.trim();await kt("last_location",n),n&&await Wo(n);const s=await mn(e);s&&s.id?await te.attendance.update(s.id,{location:n||null}):n&&await te.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:wt()})}async function nl(){const e=await yt("location_presets","");if(!e)return Mu.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 Mu.slice()}async function cf(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await kt("location_presets",JSON.stringify(t))}async function Wo(e){const t=e.trim();if(!t)return;const n=await nl();n.includes(t)||await cf([...n,t])}async function Ks(e=!1){const t=await te.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function xv(e){await te.project.add({name:e.trim(),archived:0,created_at:wt()})}async function Cv(e,t){await te.project.update(e,{name:t.trim()})}async function Ev(e,t){await te.project.update(e,{archived:t?1:0})}async function mn(e){return te.attendance.where("date").equals(e).first()}async function ff(e,t){const n=((t===void 0?await yt("last_location",""):t)||"").trim(),s=await mn(e);if(s&&s.id){if(!s.clock_in_at){const o={clock_in_at:wt()};n&&(o.location=n),await te.attendance.update(s.id,o)}n&&(await kt("last_location",n),await Wo(n));return}await te.attendance.add({date:e,clock_in_at:wt(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:wt()}),n&&(await kt("last_location",n),await Wo(n))}async function Sv(e){const t=await mn(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&await te.attendance.update(t.id,{clock_out_at:wt()})}async function $v(){const e=new Date,t=Nn(e);if(e.getHours()<4){const s=await mn(Kn(t,-1));if(s&&s.id&&s.clock_in_at&&!s.clock_out_at)return await te.attendance.update(s.id,{clock_out_at:wt()}),s.date}const n=await mn(t);if(n&&n.id&&n.clock_in_at&&!n.clock_out_at)return await te.attendance.update(n.id,{clock_out_at:wt()}),n.date;throw new Error("没有进行中的打卡")}async function Av(e,t,n,s,o){(o||"").trim()&&await Wo(o);const a=await mn(e),c={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:s||null,location:(o||"").trim()||null,created_at:wt()};a&&a.id?await te.attendance.update(a.id,c):await te.attendance.add(c)}async function Pv(e,t,n){const s=(n||"").trim();if(!s)return;const o=await mn(e);o&&o.id&&await te.attendance.update(o.id,{[t]:e+"T"+s+":00"})}async function vi(e,t){return te.attendance.where("date").between(e,t,!0,!0).toArray()}async function Tv(e,t){const n=await mn(e);if(t){const s={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:wt()};n&&n.id?await te.attendance.update(n.id,s):await te.attendance.add({...s,note:null,location:null})}else n&&n.id&&await te.attendance.update(n.id,{kind:"normal"})}async function Ov(e){const t=await te.work_log.where("date").equals(e).first();return t||{id:await te.work_log.add({date:e,created_at:wt()}),date:e,created_at:wt()}}async function Mv(e){return te.work_log.where("date").equals(e).first()}async function Iv(e){const t=await Mv(e);return!t||!t.id?[]:(await te.log_item.where("work_log_id").equals(t.id).toArray()).sort((s,o)=>o.id-s.id)}async function jv(e,t){const n=await Ov(e);await te.log_item.add({work_log_id:n.id,content:t.content,project_id:t.project_id,category:t.category,minutes:t.minutes,is_milestone:0,needs_followup:0,takeaway:t.takeaway,remark:t.remark,sort_order:0,created_at:wt()}),await kt("last_project",t.project_id?String(t.project_id):""),await kt("last_category",t.category)}async function ca(e,t){await te.log_item.update(e,t)}async function Dv(e){await te.log_item.delete(e)}async function mi(e,t){const n=await te.work_log.where("date").between(e,t,!0,!0).toArray();if(!n.length)return[];const s=new Map(n.map(a=>[a.id,a.date]));return(await te.log_item.where("work_log_id").anyOf(n.map(a=>a.id)).toArray()).map(a=>({...a,date:s.get(a.work_log_id)||""})).sort((a,c)=>a.date===c.date?a.id-c.id:a.date<c.date?-1:1)}async function rl(e){return te.weekly_note.where("week_start").equals(e).first()}async function Rv(e,t){const n=await rl(e);n&&n.id?await te.weekly_note.update(n.id,t):await te.weekly_note.add({week_start:e,highlights:t.highlights??null,challenges:t.challenges??null,plan_next:t.plan_next??null,created_at:wt()})}async function Lv(e,t){return te.weekly_note.where("week_start").between(e,t,!0,!0).toArray()}async function Kv(){return(await te.memo.toArray()).sort((t,n)=>t.updated_at<n.updated_at?1:-1)}async function Fv(e,t){const n=wt();return{id:await te.memo.add({title:e.trim(),content:t,created_at:n,updated_at:n}),title:e.trim(),content:t,created_at:n,updated_at:n}}async function Nv(e,t,n){await te.memo.update(e,{title:t.trim(),content:n,updated_at:wt()})}async function Vv(e){await te.memo.delete(e)}async function Bv(e,t=8){const n=e.trim().toLowerCase();if(!n)return[];const s=await te.work_log.toArray(),o=new Map(s.map(c=>[c.id,c.date]));return(await te.log_item.toArray()).filter(c=>((c.content||"")+" "+(c.takeaway||"")+" "+(c.remark||"")).toLowerCase().includes(n)).sort((c,d)=>d.id-c.id).slice(0,t).map(c=>({...c,date:o.get(c.work_log_id)||""}))}async function Uv(e,t=4){const n=e.trim().toLowerCase();return n?(await te.memo.toArray()).filter(o=>((o.title||"")+" "+(o.content||"")).toLowerCase().includes(n)).sort((o,a)=>o.updated_at<a.updated_at?1:-1).slice(0,t):[]}async function qv(e,t){return te.table("transaction").where("date").between(e,t,!0,!0).toArray()}async function Hv(e){await te.table("transaction").add({...e,created_at:wt()})}async function Wv(e,t){await te.table("transaction").update(e,{...t})}async function zv(e){await te.table("transaction").delete(e)}async function Gv(e,t){await te.table("transaction").update(e,{reimbursed:1})}async function Yv(){const e=await Promise.all([te.project.toArray(),te.work_log.toArray(),te.log_item.toArray(),te.attendance.toArray(),te.weekly_note.toArray(),te.setting.toArray(),te.memo.toArray(),te.credential.toArray(),te.table("transaction").toArray()]);return JSON.stringify({schema_version:Qh,exported_at:wt(),data:{project:e[0],work_log:e[1],log_item:e[2],attendance:e[3],weekly_note:e[4],setting:e[5],memo:e[6],credential:e[7],transaction:e[8]}},null,2)}async function Jv(e){let t=null;try{t=JSON.parse(e)}catch{throw new Error("不是有效的 JSON 文件")}if(!t||t.schema_version!==1&&t.schema_version!==2&&t.schema_version!==3||!t.data)throw new Error("文件格式或 schema 版本不匹配");const n=t.data;await te.transaction("rw",[te.project,te.work_log,te.log_item,te.attendance,te.weekly_note,te.setting,te.memo,te.credential,te.table("transaction")],async()=>{await Promise.all([te.project.clear(),te.work_log.clear(),te.log_item.clear(),te.attendance.clear(),te.weekly_note.clear(),te.setting.clear(),te.memo.clear(),te.credential.clear(),te.table("transaction").clear()]),n.project&&n.project.length&&await te.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await te.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await te.log_item.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await te.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await te.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await te.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await te.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await te.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await te.table("transaction").bulkAdd(n.transaction)})}function So(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function Hs(e,t,n,s){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(gv(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=So(Vn(e.clock_in_at)),c=So(Vn(e.clock_out_at)),d=So(n.work_start),h=So(n.work_end);let y="normal";!o&&a>d+n.grace_minutes?y="late":!o&&c<h&&(y="early");const m=bv(e.clock_in_at,e.clock_out_at),k=Math.max(0,m-n.lunch_minutes);return{status:y,label:o?"补卡":y==="late"?"迟到":y==="early"?"早退":"正常",makeup:o,workedMinutes:k}}const Oo=V([]);let Xv=0;function We(e){const t=++Xv;Oo.value.push({id:t,text:e}),setTimeout(()=>{Oo.value=Oo.value.filter(n=>n.id!==t)},2e3)}function Qv(){return Oo}const Pa=V(null),Ta=V(null),Ws=V(0);function nr(){Ws.value++}const Zv={class:"day-panel"},em={class:"dp-head"},tm={class:"dp-date"},nm={class:"card sec"},rm={class:"att-grid"},sm={class:"att-cell"},om={key:0,class:"edit-row"},im={key:1,class:"att-val"},am={class:"att-cell"},lm={key:0,class:"edit-row"},um={key:1,class:"att-val"},cm={class:"att-cell"},fm=["list"],dm=["id"],pm=["value"],hm={class:"att-cell"},vm={class:"att-val status-val"},mm={key:0,class:"tag"},ym={key:1,class:"muted"},gm={key:0,class:"att-note muted"},bm={class:"att-actions"},wm=["disabled"],_m=["disabled"],km=["disabled"],xm=["disabled"],Cm={key:0,class:"card sec makeup"},Em={class:"form-grid"},Sm={class:"field"},$m={class:"field"},Am={class:"field span2"},Pm=["list"],Tm={class:"field span2"},Om={key:0,class:"form-error"},Mm={class:"form-footer"},Im={class:"card sec"},jm={class:"form-grid"},Dm={class:"field span2"},Rm={key:0,class:"form-error"},Lm={class:"field"},Km=["value"],Fm={class:"field"},Nm=["value"],Vm={class:"field"},Bm={class:"field"},Um={class:"field span2"},qm={class:"form-footer"},Hm=["disabled"],Wm=["disabled"],zm={class:"list-sec"},Gm={class:"sec-title"},Ym={key:0,class:"empty muted"},Jm={class:"item-main"},Xm={class:"tag"},Qm=["onClick"],Zm={key:0,class:"muted item-meta"},ey={key:1,class:"muted num item-meta"},ty=["onClick"],ny=["onClick"],ry=["onClick"],sy=["onClick"],oy={key:0,class:"item-sub"},iy={key:0,class:"muted2"},ay={key:1,class:"muted"},ly={key:1,class:"dp-foot muted num"},uy=Vt({__name:"DayPanel",props:{date:{}},setup(e){const t=e,n=V(!0),s=V(null),o=V(void 0),a=V([]),c=V([]),d=V(""),h=V([]),y=it(()=>"loc-list-"+t.date),m=it(()=>t.date===xt());async function k(){n.value=!0,s.value=await jr(),o.value=await mn(t.date),a.value=await Iv(t.date),c.value=await Ks(!0),h.value=await nl(),d.value=o.value&&o.value.location||await _v(),n.value=!1}fn(k),gt(()=>t.date,k),gt(Ws,()=>{k()});const D=it(()=>c.value.filter(W=>W.archived!==1));function T(W){if(!W)return"";const q=c.value.find(Y=>Y.id===W);return q?q.name:"已删除项目"}const L=it(()=>s.value?Hs(o.value,t.date,s.value,m.value):null),X=it(()=>a.value.reduce((W,q)=>W+(q.minutes||0),0)),ce=V(!1);async function Q(){ce.value||(ce.value=!0,await ff(t.date,d.value),await k(),nr(),We("上班打卡成功"),ce.value=!1)}async function S(){ce.value||(ce.value=!0,await Sv(t.date),await k(),nr(),We("下班打卡成功"),ce.value=!1)}async function N(){await kv(t.date,d.value),nr(),We("地点已更新")}const G=V(!1),de=it(()=>{var W;return((W=o.value)==null?void 0:W.kind)==="leave"});function ae(){if(o.value&&o.value.clock_in_at){G.value=!0;return}Z(!0)}async function Z(W){G.value=!1,await Tv(t.date,W),await k(),nr(),We(W?"已标记为休假":"已取消休假")}const $=V(null),x=V(""),le=V(null);gt($,async W=>{var q;W&&(await ts(),(q=le.value)==null||q.focus())});function ke(W){var Y,$e;const q=W==="in"?(Y=o.value)==null?void 0:Y.clock_in_at:($e=o.value)==null?void 0:$e.clock_out_at;$.value=W,x.value=q?Vn(q):W==="in"?"09:00":"18:00"}function J(){$.value=null}async function xe(){const W=$.value;W&&($.value=null,x.value&&(await Pv(t.date,W==="in"?"clock_in_at":"clock_out_at",x.value),await k(),nr(),We("打卡时间已修改")))}const Ve=V(!1),nt=V("09:00"),qe=V("18:00"),He=V(""),ye=V(""),Oe=V("");function Fe(){ye.value=d.value,Oe.value="",Ve.value=!Ve.value}async function je(){if(!nt.value||!qe.value){Oe.value="请填写上班与下班时间";return}await Av(t.date,t.date+"T"+nt.value+":00",t.date+"T"+qe.value+":00",He.value.trim(),ye.value),Ve.value=!1,He.value="",Oe.value="",await k(),nr(),We("补卡已保存")}const ne=V(""),F=V("");gt(ne,()=>{F.value&&(F.value="")});const fe=V(null),Ke=V("dev"),ct=V(null),ht=V(""),Yt=V(""),Jt=V(!1),Ie=it(()=>!!(ne.value.trim()||ct.value||ht.value.trim()||Yt.value.trim()));fn(async()=>{const W=await wv();fe.value=W.project_id,Ke.value=W.category});function w(){ne.value="",ct.value=null,ht.value="",Yt.value="",F.value=""}async function g(){const W=ne.value.trim();if(!W){F.value="请填写工作内容";return}Jt.value||(Jt.value=!0,await jv(t.date,{content:W,project_id:fe.value,category:Ke.value,minutes:ct.value&&ct.value>0?ct.value:null,takeaway:ht.value.trim()||null,remark:Yt.value.trim()||null}),w(),await k(),We("记录已添加"),Jt.value=!1)}const P=V(null);function ie(W){P.value=W}async function se(W){const q=W.id,Y={content:W.content,project_id:W.project_id,category:W.category,minutes:W.minutes,takeaway:W.takeaway,remark:W.remark,is_milestone:W.is_milestone,needs_followup:W.needs_followup};await ca(q,Y),P.value=null,await k(),We("修改已保存")}async function ue(W){await ca(W.id,{is_milestone:W.is_milestone?0:1}),await k()}async function ge(W){await ca(W.id,{needs_followup:W.needs_followup?0:1}),await k()}const oe=V(null);async function we(){oe.value&&oe.value.id&&await Dv(oe.value.id),oe.value=null,await k(),We("记录已删除")}return(W,q)=>(K(),H("div",Zv,[u("div",em,[u("div",tm,re(Qt(uf)(e.date)),1)]),u("div",nm,[q[25]||(q[25]=u("div",{class:"sec-title"},"出勤信息",-1)),u("div",rm,[u("div",sm,[q[21]||(q[21]=u("label",null,"上班时间",-1)),$.value==="in"?(K(),H("div",om,[Se(u("input",{ref_key:"timeInput",ref:le,type:"time",class:"input time-input","onUpdate:modelValue":q[0]||(q[0]=Y=>x.value=Y),onKeydown:[jt(xe,["enter"]),jt(J,["esc"])]},null,544),[[De,x.value]]),u("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),u("button",{class:"btn btn-sm",onClick:J},"取消")])):(K(),H("div",im,[u("span",{class:et(["num",{"val-empty":!(o.value&&o.value.clock_in_at)}])},re(o.value&&o.value.clock_in_at?Qt(Vn)(o.value.clock_in_at):"未打卡"),3),o.value&&o.value.id?(K(),H("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:q[1]||(q[1]=Y=>ke("in"))},[Te(lt,{name:"edit",size:13})])):Ee("",!0)]))]),u("div",am,[q[22]||(q[22]=u("label",null,"下班时间",-1)),$.value==="out"?(K(),H("div",lm,[Se(u("input",{ref_key:"timeInput",ref:le,type:"time",class:"input time-input","onUpdate:modelValue":q[2]||(q[2]=Y=>x.value=Y),onKeydown:[jt(xe,["enter"]),jt(J,["esc"])]},null,544),[[De,x.value]]),u("button",{class:"btn btn-primary btn-sm",onClick:xe},"确认"),u("button",{class:"btn btn-sm",onClick:J},"取消")])):(K(),H("div",um,[u("span",{class:et(["num",{"val-empty":!(o.value&&o.value.clock_out_at)}])},re(o.value&&o.value.clock_out_at?Qt(Vn)(o.value.clock_out_at):"未打卡"),3),o.value&&o.value.id?(K(),H("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:q[3]||(q[3]=Y=>ke("out"))},[Te(lt,{name:"edit",size:13})])):Ee("",!0)]))]),u("div",cm,[q[23]||(q[23]=u("label",null,"上班地点",-1)),Se(u("input",{class:"input","onUpdate:modelValue":q[4]||(q[4]=Y=>d.value=Y),list:y.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:N},null,40,fm),[[De,d.value]]),u("datalist",{id:y.value},[(K(!0),H(Re,null,ut(h.value,Y=>(K(),H("option",{key:Y,value:Y},null,8,pm))),128))],8,dm)]),u("div",hm,[q[24]||(q[24]=u("label",null,"考勤状态",-1)),u("div",vm,[L.value?(K(),H(Re,{key:0},[u("span",{class:et(["dot",L.value.status])},null,2),u("span",null,re(L.value.label),1),o.value&&o.value.kind==="makeup"?(K(),H("span",mm,"补卡")):Ee("",!0)],64)):(K(),H("span",ym,"--"))])])]),o.value&&o.value.note?(K(),H("div",gm,"补卡说明:"+re(o.value.note),1)):Ee("",!0),u("div",bm,[m.value&&(!o.value||!o.value.clock_in_at)?(K(),H("button",{key:0,class:"btn btn-primary btn-sm",disabled:ce.value,onClick:Q},"上班打卡",8,wm)):m.value&&o.value&&o.value.clock_in_at&&!o.value.clock_out_at?(K(),H("button",{key:1,class:"btn btn-primary btn-sm",disabled:ce.value,onClick:S},"下班打卡",8,_m)):Ee("",!0),!m.value&&(!o.value||!o.value.clock_in_at)?(K(),H("button",{key:2,class:"btn btn-sm",onClick:Fe},"补卡")):Ee("",!0),de.value?(K(),H("button",{key:4,class:"btn btn-sm",disabled:ce.value,onClick:q[5]||(q[5]=Y=>Z(!1))},"取消休假",8,xm)):(K(),H("button",{key:3,class:"btn btn-sm",disabled:ce.value,onClick:ae},"标记休假",8,km))])]),Ve.value?(K(),H("div",Cm,[q[30]||(q[30]=u("div",{class:"sec-title"},"补卡登记",-1)),u("div",Em,[u("div",Sm,[q[26]||(q[26]=u("label",null,"上班时间",-1)),Se(u("input",{type:"time",class:"input","onUpdate:modelValue":q[6]||(q[6]=Y=>nt.value=Y)},null,512),[[De,nt.value]])]),u("div",$m,[q[27]||(q[27]=u("label",null,"下班时间",-1)),Se(u("input",{type:"time",class:"input","onUpdate:modelValue":q[7]||(q[7]=Y=>qe.value=Y)},null,512),[[De,qe.value]])]),u("div",Am,[q[28]||(q[28]=u("label",null,"上班地点",-1)),Se(u("input",{class:"input",list:y.value,"onUpdate:modelValue":q[8]||(q[8]=Y=>ye.value=Y),placeholder:"可直接输入"},null,8,Pm),[[De,ye.value]])]),u("div",Tm,[q[29]||(q[29]=u("label",null,"补卡原因",-1)),Se(u("input",{class:"input","onUpdate:modelValue":q[9]||(q[9]=Y=>He.value=Y),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[De,He.value]])])]),Oe.value?(K(),H("div",Om,re(Oe.value),1)):Ee("",!0),u("div",Mm,[u("button",{class:"btn btn-sm",onClick:q[10]||(q[10]=Y=>Ve.value=!1)},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:je},"保存补卡")])])):Ee("",!0),u("div",Im,[q[38]||(q[38]=u("div",{class:"sec-head"},[u("span",{class:"sec-title"},"新增工作记录"),u("span",{class:"muted form-hint"},"内容必填,其余选填")],-1)),u("div",jm,[u("div",Dm,[q[31]||(q[31]=u("label",null,"工作内容(必填)",-1)),Se(u("input",{class:et(["input",{invalid:F.value}]),"onUpdate:modelValue":q[11]||(q[11]=Y=>ne.value=Y),placeholder:"做了什么,一句话一条",onKeydown:jt(g,["enter"])},null,34),[[De,ne.value]]),F.value?(K(),H("div",Rm,re(F.value),1)):Ee("",!0)]),u("div",Lm,[q[33]||(q[33]=u("label",null,"所属项目",-1)),Se(u("select",{class:"select","onUpdate:modelValue":q[12]||(q[12]=Y=>fe.value=Y)},[q[32]||(q[32]=u("option",{value:null},"无项目",-1)),(K(!0),H(Re,null,ut(D.value,Y=>(K(),H("option",{key:Y.id,value:Y.id},re(Y.name),9,Km))),128))],512),[[Fn,fe.value]])]),u("div",Fm,[q[34]||(q[34]=u("label",null,"工作分类",-1)),Se(u("select",{class:"select","onUpdate:modelValue":q[13]||(q[13]=Y=>Ke.value=Y)},[(K(!0),H(Re,null,ut(Qt(qs),Y=>(K(),H("option",{key:Y.key,value:Y.key},re(Y.label),9,Nm))),128))],512),[[Fn,Ke.value]])]),u("div",Vm,[q[35]||(q[35]=u("label",null,"耗时(分钟)",-1)),Se(u("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":q[14]||(q[14]=Y=>ct.value=Y),placeholder:"选填"},null,512),[[De,ct.value,void 0,{number:!0}]])]),u("div",Bm,[q[36]||(q[36]=u("label",null,"主要收获",-1)),Se(u("input",{class:"input","onUpdate:modelValue":q[15]||(q[15]=Y=>ht.value=Y),placeholder:"一句话:学到了什么"},null,512),[[De,ht.value]])]),u("div",Um,[q[37]||(q[37]=u("label",null,"备注",-1)),Se(u("textarea",{class:"textarea","onUpdate:modelValue":q[16]||(q[16]=Y=>Yt.value=Y),placeholder:"背景、链接、未决事项(选填)"},null,512),[[De,Yt.value]])])]),u("div",qm,[u("button",{class:"btn btn-sm",disabled:!Ie.value,onClick:w},"重置",8,Hm),u("button",{class:"btn btn-primary btn-sm",disabled:Jt.value,onClick:g},"添加记录",8,Wm)])]),u("div",zm,[u("div",Gm,"工作记录("+re(a.value.length)+")",1),!a.value.length&&!n.value?(K(),H("div",Ym,"暂无记录")):Ee("",!0),(K(!0),H(Re,null,ut(a.value,Y=>(K(),H("div",{key:Y.id,class:"item"},[u("div",Jm,[u("span",Xm,re(Qt(tl)(Y.category)),1),u("span",{class:"item-content",title:"点击编辑",onClick:$e=>ie(Y)},re(Y.content),9,Qm),Y.project_id?(K(),H("span",Zm,re(T(Y.project_id)),1)):Ee("",!0),Y.minutes?(K(),H("span",ey,re(Y.minutes)+" 分钟",1)):Ee("",!0),q[39]||(q[39]=u("span",{class:"flex1"},null,-1)),u("button",{class:"icon-btn",title:"编辑完整信息",onClick:$e=>ie(Y)},[Te(lt,{name:"edit",size:14})],8,ty),u("button",{class:et(["icon-btn",{active:Y.is_milestone===1}]),title:"成果标记",onClick:$e=>ue(Y)},[Te(lt,{name:"star",size:14})],10,ny),u("button",{class:et(["icon-btn",{"active-warn":Y.needs_followup===1}]),title:"待跟进",onClick:$e=>ge(Y)},[Te(lt,{name:"flag",size:14})],10,ry),u("button",{class:"icon-btn",title:"删除",onClick:$e=>oe.value=Y},[Te(lt,{name:"close",size:14})],8,sy)]),Y.takeaway||Y.remark?(K(),H("div",oy,[Y.takeaway?(K(),H("div",iy,"收获:"+re(Y.takeaway),1)):Ee("",!0),Y.remark?(K(),H("div",ay,"备注:"+re(Y.remark),1)):Ee("",!0)])):Ee("",!0)]))),128)),a.value.length?(K(),H("div",ly,[nn(" 共 "+re(a.value.length)+" 条事项 ",1),X.value?(K(),H(Re,{key:0},[nn(" · "+re((X.value/60).toFixed(1))+" 小时",1)],64)):Ee("",!0)])):Ee("",!0)]),Te(cr,{open:!!oe.value,title:"删除确认",message:oe.value?"将删除工作记录「"+oe.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:q[17]||(q[17]=Y=>oe.value=null),onConfirm:we},null,8,["open","message"]),Te(cr,{open:G.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:q[18]||(q[18]=Y=>G.value=!1),onConfirm:q[19]||(q[19]=Y=>Z(!0))},null,8,["open"]),Te(yv,{open:!!P.value,item:P.value,projects:c.value,date:e.date,onCancel:q[20]||(q[20]=Y=>P.value=null),onSave:se},null,8,["open","item","projects","date"])]))}}),df=Gt(uy,[["__scopeId","data-v-2e90c9d8"]]),cy={class:"cal-page"},fy={class:"cal-toolbar"},dy={class:"cal-title num"},py={class:"cal-head"},hy={class:"cal-grid"},vy=["title","onClick"],my={class:"cal-marks"},yy={key:0,class:"drawer"},gy={class:"drawer-head"},by={class:"drawer-body"},wy=Vt({__name:"CalendarView",setup(e){const t=V(xt()),n=it(()=>Number(t.value.slice(0,4))),s=it(()=>Number(t.value.slice(5,7))-1),o=it(()=>n.value+" 年 "+(s.value+1)+" 月"),a=["一","二","三","四","五","六","日"],c=it(()=>{const G=(new Date(n.value,s.value,1).getDay()+6)%7,de=new Date(n.value,s.value+1,0).getDate(),ae=[];for(let Z=0;Z<G;Z++)ae.push({date:"",inMonth:!1,weekend:!1});for(let Z=1;Z<=de;Z++){const $=new Date(n.value,s.value,Z),x=$.getDay();ae.push({date:Nn($),inMonth:!0,weekend:x===0||x===6})}return ae}),d=V(new Map),h=xt();async function y(){var le;const N=Nn(new Date(n.value,s.value,1)),G=Nn(new Date(n.value,s.value+1,0)),de=await Promise.all([jr(),vi(N,G),mi(N,G)]),ae=de[0],Z=new Map(de[1].map(ke=>[ke.date,ke])),$=de[2],x=new Map;for(const ke of c.value){if(!ke.inMonth)continue;const J=Hs(Z.get(ke.date),ke.date,ae,ke.date===h),xe=$.filter(Ve=>Ve.date===ke.date);x.set(ke.date,{status:J.status,label:J.label,location:((le=Z.get(ke.date))==null?void 0:le.location)||"",hasLog:xe.length>0,hasMilestone:xe.some(Ve=>Ve.is_milestone===1)})}d.value=x}gt([n,s],y,{immediate:!0}),gt(Ws,()=>{y()});function m(N){var G;return((G=d.value.get(N))==null?void 0:G.status)??""}function k(N){const G=d.value.get(N);return G?N+" · "+G.label+(G.location?" · "+G.location:""):N}function D(N){var G;return!!((G=d.value.get(N))!=null&&G.hasLog)}function T(N){var G;return!!((G=d.value.get(N))!=null&&G.hasMilestone)}function L(){t.value=Ho(t.value,-1)}function X(){t.value=Ho(t.value,1)}function ce(){t.value=xt()}const Q=V(null);function S(N,G){G&&(Q.value=N)}return gt(Pa,N=>{N&&(t.value=N,Q.value=N,Pa.value=null)},{immediate:!0}),(N,G)=>(K(),H("div",cy,[u("div",fy,[u("button",{class:"icon-btn",onClick:L},[Te(lt,{name:"chevron-left",size:16})]),u("span",dy,re(o.value),1),u("button",{class:"icon-btn",onClick:X},[Te(lt,{name:"chevron-right",size:16})]),u("button",{class:"btn btn-sm",onClick:ce},"回到今天")]),u("div",py,[(K(),H(Re,null,ut(a,de=>u("span",{key:de,class:"cal-week muted"},re(de),1)),64))]),u("div",hy,[(K(!0),H(Re,null,ut(c.value,(de,ae)=>(K(),H("button",{key:ae,class:et(["cal-cell",{blank:!de.inMonth,weekend:de.weekend,selected:Q.value===de.date}]),title:de.inMonth?k(de.date):void 0,onClick:Z=>S(de.date,de.inMonth)},[de.inMonth?(K(),H(Re,{key:0},[u("span",{class:et(["daynum num",{today:de.date===Qt(h)}])},re(Number(de.date.slice(8,10))),3),u("span",my,[m(de.date)?(K(),H("span",{key:0,class:et(["dot",m(de.date)])},null,2)):Ee("",!0),D(de.date)?(K(),It(lt,{key:1,name:"check-circle",size:12,class:"mark-log"})):Ee("",!0),T(de.date)?(K(),It(lt,{key:2,name:"star",size:12,class:"mark-star"})):Ee("",!0)])],64)):Ee("",!0)],10,vy))),128))]),Te(ns,{name:"drawer"},{default:dr(()=>[Q.value?(K(),H("aside",yy,[u("div",gy,[G[1]||(G[1]=u("span",{class:"drawer-title"},"当日详情",-1)),u("button",{class:"icon-btn",onClick:G[0]||(G[0]=de=>Q.value=null)},[Te(lt,{name:"close",size:16})])]),u("div",by,[Te(df,{date:Q.value},null,8,["date"])])])):Ee("",!0)]),_:1})]))}}),_y=Gt(wy,[["__scopeId","data-v-2404dfbe"]]),ky={class:"detail-page"},xy={class:"detail-toolbar"},Cy=["value"],Ey=["disabled"],Sy=Vt({__name:"TodayView",setup(e){const t=V(xt()),n=it(()=>t.value===xt());function s(){t.value=Kn(t.value,-1)}function o(){t.value=Kn(t.value,1)}function a(){t.value=xt()}function c(d){const h=d.target.value;h&&(t.value=h)}return(d,h)=>(K(),H("div",ky,[u("div",xy,[u("button",{class:"icon-btn",title:"前一天",onClick:s},[Te(lt,{name:"chevron-left",size:16})]),u("span",{class:et(["date-title num",{"is-today":n.value}])},re(Qt(uf)(t.value)),3),u("button",{class:"icon-btn",title:"后一天",onClick:o},[Te(lt,{name:"chevron-right",size:16})]),u("input",{type:"date",class:"input w-date",value:t.value,onChange:c},null,40,Cy),u("button",{class:"btn btn-sm",disabled:n.value,onClick:a},"回到今天",8,Ey)]),Te(df,{date:t.value},null,8,["date"])]))}}),$y=Gt(Sy,[["__scopeId","data-v-76243d98"]]),Ay={class:"stats"},Py={class:"cards"},Ty={class:"card stat-card"},Oy={class:"stat-num num"},My={class:"card stat-card"},Iy={class:"stat-num num"},jy={class:"card stat-card"},Dy={class:"stat-num num"},Ry={class:"card stat-card"},Ly={class:"stat-num num"},Ky={class:"card section"},Fy={class:"heat"},Ny=["title"],Vy={class:"two-col"},By={class:"card section"},Uy={class:"bar-label"},qy={class:"bar-track"},Hy={class:"muted num bar-num"},Wy={key:0,class:"muted"},zy={class:"card section"},Gy={class:"bar-label"},Yy={class:"bar-track"},Jy={class:"muted num bar-num"},Xy={key:0,class:"muted"},Qy={class:"card section"},Zy={class:"bar-label loc-label"},eg={class:"bar-track"},tg={class:"muted num bar-num"},ng={key:0,class:"muted"},rg=Vt({__name:"StatsView",setup(e){const t=V({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=V([]),s=V([]),o=V([]),a=V([]);async function c(){const y=xt(),m="2000-01-01",k=await Promise.all([jr(),vi(m,y),mi(m,y),Ks(!0)]),D=k[0],T=k[1],L=k[2],X=k[3],ce=T.filter(J=>J.clock_in_at||J.kind==="makeup");let Q=0;for(const J of ce){const xe=Hs(J,J.date,D,J.date===y);Q+=xe.workedMinutes??0}const S=new Set(L.map(J=>J.date));let N=0,G=y;for(S.has(G)||(G=Kn(y,-1));S.has(G);)N++,G=Kn(G,-1);t.value={attendDays:ce.length,totalHours:(Q/60).toFixed(1),itemCount:L.length,streak:N};const de=new Map;for(const J of ce){const xe=J.location||"未记录";de.set(xe,(de.get(xe)||0)+1)}a.value=Array.from(de.entries()).map(J=>({name:J[0],count:J[1],percent:Math.round(J[1]/(ce.length||1)*100)})).sort((J,xe)=>xe.count-J.count);const ae=L.length||1;s.value=qs.map(J=>{const xe=L.filter(Ve=>Ve.category===J.key).length;return{key:J.key,label:J.label,count:xe,percent:Math.round(xe/ae*100)}}).filter(J=>J.count>0).sort((J,xe)=>xe.count-J.count);const Z=new Map(X.map(J=>[J.id,J.name])),$=new Map;for(const J of L){const xe=J.project_id?Z.get(J.project_id)||"已删除项目":"无项目";$.set(xe,($.get(xe)||0)+1)}o.value=Array.from($.entries()).map(J=>({name:J[0],count:J[1],percent:Math.round(J[1]/ae*100)})).sort((J,xe)=>xe.count-J.count);const x=new Map;for(const J of L)x.set(J.date,(x.get(J.date)||0)+1);const le=Ss(y),ke=[];for(let J=11;J>=0;J--){const xe=Kn(le,-7*J),Ve=[];for(let nt=0;nt<7;nt++){const qe=Kn(xe,nt);Ve.push({date:qe,count:x.get(qe)||0})}ke.push(Ve)}n.value=ke}fn(async()=>{await c()}),gt(Ws,()=>{c()});function d(y){return y===0?0:y===1?1:y<=3?2:y<=5?3:4}function h(y,m){return y+" · "+(m?m+" 条":"无记录")}return(y,m)=>(K(),H("div",Ay,[u("div",Py,[u("div",Ty,[m[0]||(m[0]=u("div",{class:"muted"},"出勤天数",-1)),u("div",Oy,re(t.value.attendDays),1)]),u("div",My,[m[1]||(m[1]=u("div",{class:"muted"},"累计工时(小时)",-1)),u("div",Iy,re(t.value.totalHours),1)]),u("div",jy,[m[2]||(m[2]=u("div",{class:"muted"},"记录条数",-1)),u("div",Dy,re(t.value.itemCount),1)]),u("div",Ry,[m[3]||(m[3]=u("div",{class:"muted"},"连续记录(天)",-1)),u("div",Ly,re(t.value.streak),1)])]),u("div",Ky,[m[4]||(m[4]=u("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),u("div",Fy,[(K(!0),H(Re,null,ut(n.value,(k,D)=>(K(),H("div",{key:D,class:"heat-col"},[(K(!0),H(Re,null,ut(k,T=>(K(),H("span",{key:T.date,class:et(["heat-cell","lv"+d(T.count)]),title:h(T.date,T.count)},null,10,Ny))),128))]))),128))]),m[5]||(m[5]=Fp('<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",Vy,[u("div",By,[m[6]||(m[6]=u("div",{class:"section-title"},"分类分布",-1)),(K(!0),H(Re,null,ut(s.value,k=>(K(),H("div",{key:k.key,class:"bar-row"},[u("span",Uy,re(k.label),1),u("span",qy,[u("span",{class:"bar-fill",style:or({width:k.percent+"%"})},null,4)]),u("span",Hy,re(k.count)+" 条 · "+re(k.percent)+"%",1)]))),128)),s.value.length?Ee("",!0):(K(),H("div",Wy,"暂无数据"))]),u("div",zy,[m[7]||(m[7]=u("div",{class:"section-title"},"项目投入",-1)),(K(!0),H(Re,null,ut(o.value,k=>(K(),H("div",{key:k.name,class:"bar-row"},[u("span",Gy,re(k.name),1),u("span",Yy,[u("span",{class:"bar-fill",style:or({width:k.percent+"%"})},null,4)]),u("span",Jy,re(k.count)+" 条 · "+re(k.percent)+"%",1)]))),128)),o.value.length?Ee("",!0):(K(),H("div",Xy,"暂无数据"))])]),u("div",Qy,[m[8]||(m[8]=u("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(K(!0),H(Re,null,ut(a.value,k=>(K(),H("div",{key:k.name,class:"bar-row"},[u("span",Zy,re(k.name),1),u("span",eg,[u("span",{class:"bar-fill",style:or({width:k.percent+"%"})},null,4)]),u("span",tg,re(k.count)+" 天 · "+re(k.percent)+"%",1)]))),128)),a.value.length?Ee("",!0):(K(),H("div",ng,"暂无数据"))])]))}}),sg=Gt(rg,[["__scopeId","data-v-73e5ba49"]]);async function og(e,t,n){const s=xt(),o=await Promise.all([jr(),vi(e,t),mi(e,t),Ks(!0),Lv(e,t)]),a=o[0],c=o[1],d=o[2],h=o[3],y=o[4];let m=0,k=0,D=0;for(const $ of c){($.clock_in_at||$.kind==="makeup")&&m++,$.kind==="makeup"&&D++;const x=Hs($,$.date,a,$.date===s);k+=x.workedMinutes??0}const T=new Map;for(const $ of c){if(!($.clock_in_at||$.kind==="makeup"))continue;const x=$.location||"未记录";T.set(x,(T.get(x)||0)+1)}const L=Array.from(T.entries()).map($=>({name:$[0],count:$[1]})).sort(($,x)=>x.count-$.count),X=d.length||1,ce=qs.map($=>{const x=d.filter(le=>le.category===$.key).length;return{key:$.key,label:$.label,count:x,percent:Math.round(x/X*100)}}).filter($=>$.count>0).sort(($,x)=>x.count-$.count),Q=new Map(h.map($=>[$.id,$.name])),S=new Map;for(const $ of d){const x=$.project_id?Q.get($.project_id)||"已删除项目":"无项目";S.set(x,(S.get(x)||0)+1)}const N=Array.from(S.entries()).map($=>({name:$[0],count:$[1]})).sort(($,x)=>x.count-$.count),G=d.filter($=>$.is_milestone===1).map($=>({date:$.date,content:$.content})),de=d.filter($=>$.needs_followup===1).map($=>({date:$.date,content:$.content,remark:$.remark||""})),ae=d.filter($=>!!$.takeaway).map($=>({date:$.date,text:$.takeaway})),Z=y.map($=>({weekStart:$.week_start,highlights:$.highlights||"",challenges:$.challenges||"",plan_next:$.plan_next||""}));return{range:{start:e,end:t,label:n},attendDays:m,totalHours:(k/60).toFixed(1),makeupCount:D,leaveCount:c.filter($=>$.kind==="leave").length,itemCount:d.length,categoryStats:ce,projectStats:N,locationStats:L,milestones:G,followups:de,takeaways:ae,weekNotes:Z}}function ig(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 ag="modulepreload",lg=function(e,t){return new URL(e,t).href},Iu={},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=lg(y,s),y in Iu)return;Iu[y]=!0;const m=y.endsWith(".css"),k=m?'[rel="stylesheet"]':"";if(!!s)for(let L=c.length-1;L>=0;L--){const X=c[L];if(X.href===y&&(!m||X.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${k}`))return;const T=document.createElement("link");if(T.rel=m?"stylesheet":ag,m||(T.as="script"),T.crossOrigin="",T.href=y,h&&T.setAttribute("nonce",h),document.head.appendChild(T),m)return new Promise((L,X)=>{T.addEventListener("load",L),T.addEventListener("error",()=>X(new Error(`Unable to preload CSS for ${y}`)))})}))}function a(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return o.then(c=>{for(const d of c||[])d.status==="rejected"&&a(d.reason);return t().catch(a)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const ug=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},cg=e=>e.CapacitorPlatforms=ug(e),hf=cg(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});hf.addPlatform;hf.setPlatform;var Qr;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Qr||(Qr={}));class fa extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const fg=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"},dg=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:fg(e),k=((t=y==null?void 0:y.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||m,D=()=>k()!=="web",T=((n=y==null?void 0:y.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||D,L=Z=>{const $=G.get(Z);return!!($!=null&&$.platforms.has(k())||Q(Z))},X=((s=y==null?void 0:y.currentPlatform)===null||s===void 0?void 0:s.isPluginAvailable)||L,ce=Z=>{var $;return($=d.PluginHeaders)===null||$===void 0?void 0:$.find(x=>x.name===Z)},Q=((o=y==null?void 0:y.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||ce,S=Z=>e.console.error(Z),N=(Z,$,x)=>Promise.reject(`${x} does not have an implementation of "${$}".`),G=new Map,de=(Z,$={})=>{const x=G.get(Z);if(x)return console.warn(`Capacitor plugin "${Z}" already registered. Cannot register plugins twice.`),x.proxy;const le=k(),ke=Q(Z);let J;const xe=async()=>(!J&&le in $?J=typeof $[le]=="function"?J=await $[le]():J=$[le]:c!==null&&!J&&"web"in $&&(J=typeof $.web=="function"?J=await $.web():J=$.web),J),Ve=(Fe,je)=>{var ne,F;if(ke){const fe=ke==null?void 0:ke.methods.find(Ke=>je===Ke.name);if(fe)return fe.rtype==="promise"?Ke=>d.nativePromise(Z,je.toString(),Ke):(Ke,ct)=>d.nativeCallback(Z,je.toString(),Ke,ct);if(Fe)return(ne=Fe[je])===null||ne===void 0?void 0:ne.bind(Fe)}else{if(Fe)return(F=Fe[je])===null||F===void 0?void 0:F.bind(Fe);throw new fa(`"${Z}" plugin is not implemented on ${le}`,Qr.Unimplemented)}},nt=Fe=>{let je;const ne=(...F)=>{const fe=xe().then(Ke=>{const ct=Ve(Ke,Fe);if(ct){const ht=ct(...F);return je=ht==null?void 0:ht.remove,ht}else throw new fa(`"${Z}.${Fe}()" is not implemented on ${le}`,Qr.Unimplemented)});return Fe==="addListener"&&(fe.remove=async()=>je()),fe};return ne.toString=()=>`${Fe.toString()}() { [capacitor code] }`,Object.defineProperty(ne,"name",{value:Fe,writable:!1,configurable:!1}),ne},qe=nt("addListener"),He=nt("removeListener"),ye=(Fe,je)=>{const ne=qe({eventName:Fe},je),F=async()=>{const Ke=await ne;He({eventName:Fe,callbackId:Ke},je)},fe=new Promise(Ke=>ne.then(()=>Ke({remove:F})));return fe.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await F()},fe},Oe=new Proxy({},{get(Fe,je){switch(je){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return ke?ye:qe;case"removeListener":return He;default:return nt(je)}}});return h[Z]=Oe,G.set(Z,{name:Z,proxy:Oe,platforms:new Set([...Object.keys($),...ke?[le]:[]])}),Oe},ae=((a=y==null?void 0:y.currentPlatform)===null||a===void 0?void 0:a.registerPlugin)||de;return d.convertFileSrc||(d.convertFileSrc=Z=>Z),d.getPlatform=k,d.handleError=S,d.isNativePlatform=T,d.isPluginAvailable=X,d.pluginMethodNoop=N,d.registerPlugin=ae,d.Exception=fa,d.DEBUG=!!d.DEBUG,d.isLoggingEnabled=!!d.isLoggingEnabled,d.platform=d.getPlatform(),d.isNative=d.isNativePlatform(),d},pg=e=>e.Capacitor=dg(e),Zr=pg(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),vf=Zr.registerPlugin;Zr.Plugins;class mf{constructor(t){this.listeners={},this.retainedEventArguments={},this.windowListeners={},t&&(console.warn(`Capacitor WebPlugin "${t.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=t)}addListener(t,n){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),s&&this.sendRetainedArgumentsForEvent(t);const c=async()=>this.removeListener(t,n);return Promise.resolve({remove:c})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,s){const o=this.listeners[t];if(!o){if(s){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}o.forEach(a=>a(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:s=>{this.notifyListeners(n,s)}}}unimplemented(t="not implemented"){return new Zr.Exception(t,Qr.Unimplemented)}unavailable(t="not available"){return new Zr.Exception(t,Qr.Unavailable)}async removeListener(t,n){const s=this.listeners[t];if(!s)return;const o=s.indexOf(n);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(s=>{this.notifyListeners(t,s)}))}}const ju=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Du=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class hg extends mf{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=Du(o).trim(),a=Du(a).trim(),n[o]=a}),n}async setCookie(t){try{const n=ju(t.key),s=ju(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)}}}vf("CapacitorCookies",{web:()=>new hg});const vg=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)}),mg=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,a,c)=>(o[a]=e[t[c]],o),{})},yg=(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,gg=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=mg(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 bg extends mf{async request(t){const n=gg(t,t.webFetchExtra),s=yg(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 vg(y);break;case"json":h=await a.json();break;case"document":case"text":default:h=await a.text()}const m={};return a.headers.forEach((k,D)=>{m[D]=k}),{data:h,headers:m,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}vf("CapacitorHttp",{web:()=>new bg});async function sl(e,t){const n=window;if(n.electronAPI&&n.electronAPI.saveFile){const c=await n.electronAPI.saveFile(e,t);return c&&c.saved?c.path:""}if(Zr.isNativePlatform()){const{Filesystem:c,Directory:d,Encoding:h}=await pf(async()=>{const{Filesystem:y,Directory:m,Encoding:k}=await import("./index-DfdFyY26.js");return{Filesystem:y,Directory:m,Encoding:k}},[],import.meta.url);try{return(await c.writeFile({path:e,data:t,directory:d.Documents,encoding:h.UTF8,recursive:!0})).uri}catch{return(await c.writeFile({path:e,data:t,directory:d.Cache,encoding:h.UTF8,recursive:!0})).uri}}const s=new Blob([t],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(s),a=document.createElement("a");return a.href=o,a.download=e,a.click(),window.setTimeout(()=>URL.revokeObjectURL(o),1e4),""}const wg=Object.freeze(Object.defineProperty({__proto__:null,downloadText:sl},Symbol.toStringTag,{value:"Module"}));async function Oa(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 _g(e){const t=await Promise.all([yt("ai_base_url",""),yt("ai_api_key",""),yt("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),s=t[1].trim(),o=t[2].trim();if(!n||!o)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const a=n+"/chat/completions",c={"Content-Type":"application/json"};s&&(c.Authorization="Bearer "+s);const h=JSON.stringify({model:o,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let y;try{y=await fetch(a,{method:"POST",headers:c,body:h})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!y.ok){let D="接口返回 "+y.status;try{const T=await y.json();T&&T.error&&T.error.message&&(D+=":"+T.error.message)}catch{}throw new Error(D)}const m=await y.json(),k=m&&m.choices&&m.choices[0]&&m.choices[0].message&&m.choices[0].message.content;if(!k)throw new Error("接口未返回内容");return String(k)}const kg={class:"report"},xg={class:"report-toolbar"},Cg={class:"seg"},Eg=["onClick"],Sg=["disabled"],$g=["disabled"],Ag={key:0,class:"ai-error"},Pg={class:"report-grid"},Tg={class:"report-left"},Og={class:"card section"},Mg={class:"section-title"},Ig={class:"muted note-saved"},jg={class:"card section"},Dg={class:"report-right"},Rg={key:0,class:"card section"},Lg={class:"sum-row"},Kg={class:"num"},Fg={class:"sum-row"},Ng={class:"num"},Vg={class:"sum-row"},Bg={class:"num"},Ug={class:"sum-row"},qg={class:"num"},Hg={class:"sum-row"},Wg={class:"num"},zg={class:"muted"},Gg={class:"num"},Yg={key:0,class:"muted sum-empty"},Jg={class:"muted"},Xg={key:1,class:"muted sum-empty"},Qg={class:"muted"},Zg={key:2,class:"muted sum-empty"},eb={class:"muted"},tb={key:3,class:"muted sum-empty"},nb=Vt({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=V("week"),s=V(Ss(xt())),o=V(xt()),a=V(null),c=V(""),d=V(!1),h=V(!1),y=V(null),m=V(""),k=V(Ss(xt())),D=V(""),T=V(""),L=V(""),X=V(!1);async function ce(){const $=await rl(k.value);D.value=($==null?void 0:$.highlights)||"",T.value=($==null?void 0:$.challenges)||"",L.value=($==null?void 0:$.plan_next)||"",X.value=!1}async function Q(){await Rv(k.value,{highlights:D.value.trim()||null,challenges:T.value.trim()||null,plan_next:L.value.trim()||null}),X.value=!0,await N()}function S($){const x=xt();if($==="week"){const le=Ss(x);return{start:le,end:Kn(le,6),label:"本周"}}if($==="month"){const le=x.slice(0,7);return{start:le+"-01",end:x,label:le+" 本月"}}return $==="all"?{start:"2000-01-01",end:x,label:"全部实习期"}:{start:s.value,end:o.value,label:s.value+" ~ "+o.value}}async function N(){d.value=!0;const $=S(n.value),x=await og($.start,$.end,$.label);a.value=x,c.value=ig(x),d.value=!1}gt(n,N),gt([s,o],()=>{n.value==="custom"&&N()}),fn(async()=>{await ce(),await N()});async function G(){const $=xt().replace(/-/g,""),x=await sl("实习工作总结_"+$+".md",c.value);We(x?"总结已导出到:"+x:"总结已导出到系统下载目录")}async function de(){await Oa(c.value),We("总结已复制到剪贴板")}async function ae(){if(h.value)return;m.value="";const $=c.value.trim();if(!$){m.value="当前草稿为空,无法润色";return}h.value=!0;try{y.value=c.value,c.value=await _g($),We("AI 润色完成")}catch(x){y.value=null,m.value=x instanceof Error?x.message:"润色失败"}h.value=!1}function Z(){y.value!==null&&(c.value=y.value),y.value=null}return($,x)=>(K(),H("div",kg,[u("div",xg,[u("div",Cg,[(K(),H(Re,null,ut(t,le=>u("button",{key:le.key,class:et(["seg-btn",{active:n.value===le.key}]),onClick:ke=>n.value=le.key},re(le.label),11,Eg)),64))]),n.value==="custom"?(K(),H(Re,{key:0},[Se(u("input",{type:"date",class:"input w-date","onUpdate:modelValue":x[0]||(x[0]=le=>s.value=le)},null,512),[[De,s.value]]),x[6]||(x[6]=u("span",{class:"muted"},"至",-1)),Se(u("input",{type:"date",class:"input w-date","onUpdate:modelValue":x[1]||(x[1]=le=>o.value=le)},null,512),[[De,o.value]])],64)):Ee("",!0),x[10]||(x[10]=u("span",{class:"flex1"},null,-1)),u("button",{class:"btn btn-sm",disabled:h.value,onClick:ae},[Te(lt,{name:"edit",size:14}),x[7]||(x[7]=nn("AI 润色 ",-1))],8,Sg),y.value!==null?(K(),H("button",{key:1,class:"btn btn-sm",onClick:Z},"还原润色前")):Ee("",!0),u("button",{class:"btn btn-sm",disabled:d.value,onClick:N},[Te(lt,{name:"edit",size:14}),x[8]||(x[8]=nn("重新生成 ",-1))],8,$g),u("button",{class:"btn btn-sm",onClick:de},"复制"),u("button",{class:"btn btn-primary btn-sm",onClick:G},[Te(lt,{name:"export",size:14}),x[9]||(x[9]=nn("导出 Markdown ",-1))])]),m.value?(K(),H("div",Ag,re(m.value),1)):Ee("",!0),u("div",Pg,[u("div",Tg,[u("div",Og,[u("div",Mg,"本周周记("+re(k.value)+" 起)",1),x[11]||(x[11]=u("label",{class:"note-label muted"},"本周亮点",-1)),Se(u("textarea",{class:"textarea","onUpdate:modelValue":x[2]||(x[2]=le=>D.value=le),placeholder:"本周最有价值的一件事",onBlur:Q},null,544),[[De,D.value]]),x[12]||(x[12]=u("label",{class:"note-label muted"},"踩的坑",-1)),Se(u("textarea",{class:"textarea","onUpdate:modelValue":x[3]||(x[3]=le=>T.value=le),placeholder:"遇到的问题与教训",onBlur:Q},null,544),[[De,T.value]]),x[13]||(x[13]=u("label",{class:"note-label muted"},"下周计划",-1)),Se(u("textarea",{class:"textarea","onUpdate:modelValue":x[4]||(x[4]=le=>L.value=le),placeholder:"下周准备做什么",onBlur:Q},null,544),[[De,L.value]]),u("div",Ig,re(X.value?"已保存":"失焦自动保存"),1)]),u("div",jg,[x[14]||(x[14]=u("div",{class:"section-title"},"总结草稿(可编辑)",-1)),Se(u("textarea",{class:"textarea md-editor","onUpdate:modelValue":x[5]||(x[5]=le=>c.value=le),spellcheck:"false"},null,512),[[De,c.value]])])]),u("div",Dg,[a.value?(K(),H("div",Rg,[x[20]||(x[20]=u("div",{class:"section-title"},"数据摘要",-1)),u("div",Lg,[x[15]||(x[15]=u("span",{class:"muted"},"出勤",-1)),u("span",Kg,re(a.value.attendDays)+" 天",1)]),u("div",Fg,[x[16]||(x[16]=u("span",{class:"muted"},"工时",-1)),u("span",Ng,re(a.value.totalHours)+" 小时",1)]),u("div",Vg,[x[17]||(x[17]=u("span",{class:"muted"},"补卡",-1)),u("span",Bg,re(a.value.makeupCount)+" 次",1)]),u("div",Ug,[x[18]||(x[18]=u("span",{class:"muted"},"请假",-1)),u("span",qg,re(a.value.leaveCount)+" 天",1)]),u("div",Hg,[x[19]||(x[19]=u("span",{class:"muted"},"记录",-1)),u("span",Wg,re(a.value.itemCount)+" 条",1)]),x[21]||(x[21]=u("div",{class:"section-sub"},"分类分布",-1)),(K(!0),H(Re,null,ut(a.value.categoryStats,le=>(K(),H("div",{key:le.key,class:"sum-row"},[u("span",zg,re(le.label),1),u("span",Gg,re(le.count)+" 条 · "+re(le.percent)+"%",1)]))),128)),a.value.categoryStats.length?Ee("",!0):(K(),H("div",Yg,"(无)")),x[22]||(x[22]=u("div",{class:"section-sub"},"主要成果",-1)),(K(!0),H(Re,null,ut(a.value.milestones,(le,ke)=>(K(),H("div",{key:"m"+ke,class:"sum-item"},[nn(re(le.content),1),u("span",Jg,"("+re(le.date)+")",1)]))),128)),a.value.milestones.length?Ee("",!0):(K(),H("div",Xg,"(无)")),x[23]||(x[23]=u("div",{class:"section-sub"},"待跟进",-1)),(K(!0),H(Re,null,ut(a.value.followups,(le,ke)=>(K(),H("div",{key:"f"+ke,class:"sum-item"},[nn(re(le.content),1),u("span",Qg,"("+re(le.date)+")",1)]))),128)),a.value.followups.length?Ee("",!0):(K(),H("div",Zg,"(无)")),x[24]||(x[24]=u("div",{class:"section-sub"},"学习与成长",-1)),(K(!0),H(Re,null,ut(a.value.takeaways,(le,ke)=>(K(),H("div",{key:"t"+ke,class:"sum-item"},[nn(re(le.text),1),u("span",eb,"("+re(le.date)+")",1)]))),128)),a.value.takeaways.length?Ee("",!0):(K(),H("div",tb,"(无)"))])):Ee("",!0)])])]))}}),rb=Gt(nb,[["__scopeId","data-v-43f9c59b"]]),sb=["aria-label"],ob={class:"dialog-head"},ib={class:"dialog-title"},ab={class:"dialog-body"},lb={class:"form-grid"},ub={class:"field span2"},cb={class:"seg"},fb={class:"field"},db={class:"field"},pb={class:"field"},hb=["value"],vb={key:0,class:"field"},mb={class:"seg"},yb={class:"field span2"},gb={key:0,class:"form-error"},bb={class:"dialog-btns"},wb=Vt({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=V("expense"),a=V("餐饮"),c=V(""),d=V(""),h=V(""),y=V(!1),m=V(!1),k=V(""),D=V(null);function T(Q){n.open&&Q.key==="Escape"&&s("cancel")}gt(()=>n.open,async Q=>{var S;Q?(o.value=n.initial.type==="income"?"income":"expense",a.value=n.initial.category,c.value=n.initial.amountYuan,d.value=n.initial.date,h.value=n.initial.note,y.value=n.initial.reimbursable===1,m.value=n.initial.reimbursed===1,k.value="",window.addEventListener("keydown",T),await ts(),(S=D.value)==null||S.focus()):window.removeEventListener("keydown",T)}),pr(()=>window.removeEventListener("keydown",T)),gt(o,Q=>{a.value=Q==="expense"?Wr[0]:qo[0]});const L=it(()=>o.value==="expense"?Wr:qo);function X(){return a.value&&L.value.includes(a.value)?a.value:L.value[0]}function ce(){const Q=Number(c.value);if(!c.value.trim()||!isFinite(Q)||Q<=0){k.value="请填写大于 0 的金额";return}if(!d.value){k.value="请选择日期";return}const S=o.value==="expense"&&y.value?1:0;s("save",{type:o.value,category:X(),amount:Math.round(Q*100),date:d.value,note:h.value.trim(),reimbursable:S,reimbursed:S&&m.value?1:0})}return(Q,S)=>(K(),It(Bs,{to:"body"},[Te(ns,{name:"modal"},{default:dr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:S[11]||(S[11]=Mr(N=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",ob,[u("span",ib,re(e.title),1),u("button",{class:"icon-btn",title:"关闭",onClick:S[0]||(S[0]=N=>s("cancel"))},[Te(lt,{name:"close",size:16})])]),u("div",ab,[u("div",lb,[u("div",ub,[S[12]||(S[12]=u("label",null,"类型",-1)),u("div",cb,[u("button",{class:et(["seg-btn",{active:o.value==="expense"}]),onClick:S[1]||(S[1]=N=>o.value="expense")},"支出",2),u("button",{class:et(["seg-btn",{active:o.value==="income"}]),onClick:S[2]||(S[2]=N=>o.value="income")},"收入",2)])]),u("div",fb,[S[13]||(S[13]=u("label",null,"金额(元,必填)",-1)),Se(u("input",{ref_key:"amountInput",ref:D,class:et(["input",{invalid:k.value}]),"onUpdate:modelValue":S[3]||(S[3]=N=>c.value=N),type:"number",min:"0",step:"0.01",placeholder:"0.00"},null,2),[[De,c.value]])]),u("div",db,[S[14]||(S[14]=u("label",null,"日期(必填)",-1)),Se(u("input",{class:"input",type:"date","onUpdate:modelValue":S[4]||(S[4]=N=>d.value=N)},null,512),[[De,d.value]])]),u("div",pb,[S[15]||(S[15]=u("label",null,"分类",-1)),Se(u("select",{class:"select","onUpdate:modelValue":S[5]||(S[5]=N=>a.value=N)},[(K(!0),H(Re,null,ut(L.value,N=>(K(),H("option",{key:N,value:N},re(N),9,hb))),128))],512),[[Fn,a.value]])]),o.value==="expense"?(K(),H("div",vb,[S[16]||(S[16]=u("label",null,"报销状态",-1)),u("div",mb,[u("button",{class:et(["seg-btn",{active:!y.value}]),onClick:S[6]||(S[6]=N=>{y.value=!1,m.value=!1})},"无需报销",2),u("button",{class:et(["seg-btn",{active:y.value&&!m.value}]),onClick:S[7]||(S[7]=N=>{y.value=!0,m.value=!1})},"待报销",2),u("button",{class:et(["seg-btn",{active:y.value&&m.value}]),onClick:S[8]||(S[8]=N=>{y.value=!0,m.value=!0})},"已报销",2)])])):Ee("",!0),u("div",yb,[S[17]||(S[17]=u("label",null,"备注",-1)),Se(u("textarea",{class:"textarea","onUpdate:modelValue":S[9]||(S[9]=N=>h.value=N),placeholder:"选填"},null,512),[[De,h.value]])])]),k.value?(K(),H("div",gb,re(k.value),1)):Ee("",!0)]),u("div",bb,[u("button",{class:"btn btn-sm",onClick:S[10]||(S[10]=N=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:ce},"保存")])],8,sb)])):Ee("",!0)]),_:1})]))}}),_b=Gt(wb,[["__scopeId","data-v-e3568c0d"]]),kb={class:"ledger-page"},xb={class:"ledger-toolbar"},Cb={class:"month-title num"},Eb={class:"cards"},Sb={class:"card stat-card"},$b={class:"stat-num num amt-income"},Ab={class:"card stat-card"},Pb={class:"stat-num num"},Tb={class:"card stat-card"},Ob={class:"card stat-card"},Mb={class:"stat-num num amt-warn"},Ib={class:"card sec"},jb={class:"form-grid"},Db={class:"field span2"},Rb={class:"seg"},Lb={class:"field"},Kb={class:"field"},Fb={class:"field"},Nb=["value"],Vb={key:0,class:"field"},Bb={class:"field span2"},Ub={key:0,class:"form-error"},qb={class:"form-footer"},Hb=["disabled"],Wb=["disabled"],zb={key:0,class:"card sec"},Gb={class:"bar-label"},Yb={class:"bar-track"},Jb={class:"muted num bar-num"},Xb={key:1,class:"card section"},Qb={class:"form-error"},Zb={class:"card table-card"},ew={class:"tx-table"},tw={class:"num"},nw={class:"tag"},rw={class:"td-note"},sw={key:0,class:"muted"},ow={key:1,class:"tx-done"},iw={key:2,class:"tx-pending"},aw={class:"ops"},lw=["onClick"],uw=["onClick"],cw=["onClick"],fw={key:0},dw={class:"muted vault-note num"},pw=Vt({__name:"LedgerView",setup(e){const t=V(xt()),n=V([]),s=V(!0),o=V("expense"),a=V(""),c=V(Wr[0]),d=V(xt()),h=V(""),y=V(!1),m=V(""),k=V(""),D=V(!1),T=V(!1),L=V(null),X=V({type:"expense",category:Wr[0],amountYuan:"",date:xt(),note:"",reimbursable:0,reimbursed:0}),ce=V(null),Q=it(()=>t.value.slice(0,7)+"-01"),S=it(()=>{const ne=Number(t.value.slice(0,4)),F=Number(t.value.slice(5,7))-1,fe=new Date(ne,F+1,0).getDate();return t.value.slice(0,7)+"-"+(fe<10?"0"+fe:String(fe))}),N=it(()=>Number(t.value.slice(0,4))+" 年 "+Number(t.value.slice(5,7))+" 月");async function G(){s.value=!0;try{n.value=await qv(Q.value,S.value),k.value=""}catch(ne){k.value="账目加载失败:"+(ne instanceof Error?ne.stack||ne.message:String(ne)),We("账目加载失败")}s.value=!1}fn(G),gt(t,G),gt(o,ne=>{c.value=ne==="expense"?Wr[0]:qo[0]});const de=it(()=>n.value.slice().sort((ne,F)=>ne.date===F.date?F.id-ne.id:ne.date<F.date?1:-1)),ae=it(()=>{let ne=0,F=0,fe=0;for(const Ke of n.value)Ke.type==="income"?ne+=Ke.amount:(F+=Ke.amount,Ke.reimbursable===1&&Ke.reimbursed!==1&&(fe+=Ke.amount));return{income:ne,expense:F,pending:fe,balance:ne-F}}),Z=V("all"),$=V("all"),x=it(()=>de.value.filter(ne=>!(Z.value!=="all"&&ne.type!==Z.value||$.value==="pending"&&!(ne.type==="expense"&&ne.reimbursable===1&&ne.reimbursed!==1)||$.value==="done"&&!(ne.reimbursable===1&&ne.reimbursed===1)))),le=it(()=>{const ne=new Map;let F=0;for(const Ke of n.value)Ke.type==="expense"&&(ne.set(Ke.category,(ne.get(Ke.category)||0)+Ke.amount),F+=Ke.amount);const fe=F||1;return Array.from(ne.entries()).map(Ke=>({name:Ke[0],amount:Ke[1],percent:Math.round(Ke[1]/fe*100)})).sort((Ke,ct)=>ct.amount-Ke.amount)});function ke(ne){return(ne/100).toFixed(2)}function J(ne){return(ne.type==="income"?"+":"-")+ke(ne.amount)}function xe(){t.value=Ho(t.value,-1)}function Ve(){t.value=Ho(t.value,1)}function nt(){t.value=xt()}gt(a,()=>{m.value&&(m.value="")});async function qe(){const ne=Number(a.value);if(!a.value.trim()||!isFinite(ne)||ne<=0){m.value="请填写大于 0 的金额";return}if(!d.value){m.value="请选择日期";return}if(!D.value){D.value=!0;try{await Hv({type:o.value,category:c.value,amount:Math.round(ne*100),date:d.value,note:h.value.trim(),reimbursable:o.value==="expense"&&y.value?1:0,reimbursed:0})}catch(F){We("添加失败:"+(F instanceof Error?F.message:String(F))),D.value=!1;return}a.value="",h.value="",y.value=!1,m.value="",await G(),We("记账已添加"),D.value=!1}}function He(){a.value="",h.value="",y.value=!1,m.value=""}async function ye(ne){await Gv(ne.id),await G(),We("已标记为已报销")}function Oe(ne){L.value=ne.id,X.value={type:ne.type,category:ne.category,amountYuan:ke(ne.amount),date:ne.date,note:ne.note||"",reimbursable:ne.reimbursable,reimbursed:ne.reimbursed},T.value=!0}async function Fe(ne){const F=L.value;await Wv(F,ne),T.value=!1,await G(),We("账目已更新")}async function je(){ce.value&&ce.value.id&&await zv(ce.value.id),ce.value=null,await G(),We("账目已删除")}return(ne,F)=>(K(),H("div",kb,[u("div",xb,[u("button",{class:"icon-btn",onClick:xe},[Te(lt,{name:"chevron-left",size:16})]),u("span",Cb,re(N.value),1),u("button",{class:"icon-btn",onClick:Ve},[Te(lt,{name:"chevron-right",size:16})]),u("button",{class:"btn btn-sm",onClick:nt},"回到本月"),F[13]||(F[13]=u("span",{class:"flex1"},null,-1)),Se(u("select",{class:"select w-filter","onUpdate:modelValue":F[0]||(F[0]=fe=>Z.value=fe)},[...F[11]||(F[11]=[u("option",{value:"all"},"全部类型",-1),u("option",{value:"expense"},"仅支出",-1),u("option",{value:"income"},"仅收入",-1)])],512),[[Fn,Z.value]]),Se(u("select",{class:"select w-filter","onUpdate:modelValue":F[1]||(F[1]=fe=>$.value=fe)},[...F[12]||(F[12]=[u("option",{value:"all"},"全部报销",-1),u("option",{value:"pending"},"待报销",-1),u("option",{value:"done"},"已报销",-1)])],512),[[Fn,$.value]])]),u("div",Eb,[u("div",Sb,[F[14]||(F[14]=u("div",{class:"muted"},"本月收入(元)",-1)),u("div",$b,re(ke(ae.value.income)),1)]),u("div",Ab,[F[15]||(F[15]=u("div",{class:"muted"},"本月支出(元)",-1)),u("div",Pb,re(ke(ae.value.expense)),1)]),u("div",Tb,[F[16]||(F[16]=u("div",{class:"muted"},"本月结余(元)",-1)),u("div",{class:et(["stat-num num",{"amt-income":ae.value.balance>=0,"amt-expense":ae.value.balance<0}])},re(ke(ae.value.balance)),3)]),u("div",Ob,[F[17]||(F[17]=u("div",{class:"muted"},"待报销(元)",-1)),u("div",Mb,re(ke(ae.value.pending)),1)])]),u("div",Ib,[F[24]||(F[24]=u("div",{class:"sec-head"},[u("span",{class:"sec-title"},"新增一笔"),u("span",{class:"muted form-hint"},"金额必填,回车快速添加")],-1)),u("div",jb,[u("div",Db,[F[18]||(F[18]=u("label",null,"类型",-1)),u("div",Rb,[u("button",{class:et(["seg-btn",{active:o.value==="expense"}]),onClick:F[2]||(F[2]=fe=>o.value="expense")},"支出",2),u("button",{class:et(["seg-btn",{active:o.value==="income"}]),onClick:F[3]||(F[3]=fe=>o.value="income")},"收入",2)])]),u("div",Lb,[F[19]||(F[19]=u("label",null,"金额(元,必填)",-1)),Se(u("input",{class:et(["input",{invalid:m.value}]),"onUpdate:modelValue":F[4]||(F[4]=fe=>a.value=fe),type:"number",min:"0",step:"0.01",placeholder:"0.00",onKeydown:jt(qe,["enter"])},null,34),[[De,a.value]])]),u("div",Kb,[F[20]||(F[20]=u("label",null,"日期",-1)),Se(u("input",{class:"input",type:"date","onUpdate:modelValue":F[5]||(F[5]=fe=>d.value=fe)},null,512),[[De,d.value]])]),u("div",Fb,[F[21]||(F[21]=u("label",null,"分类",-1)),Se(u("select",{class:"select","onUpdate:modelValue":F[6]||(F[6]=fe=>c.value=fe)},[(K(!0),H(Re,null,ut(o.value==="expense"?Qt(Wr):Qt(qo),fe=>(K(),H("option",{key:fe,value:fe},re(fe),9,Nb))),128))],512),[[Fn,c.value]])]),o.value==="expense"?(K(),H("div",Vb,[F[22]||(F[22]=u("label",null,"报销",-1)),u("button",{class:et(["toggle-btn",{on:y.value}]),onClick:F[7]||(F[7]=fe=>y.value=!y.value)},re(y.value?"需要报销":"无需报销"),3)])):Ee("",!0),u("div",Bb,[F[23]||(F[23]=u("label",null,"备注",-1)),Se(u("input",{class:"input","onUpdate:modelValue":F[8]||(F[8]=fe=>h.value=fe),placeholder:"选填,如:客户现场午餐",onKeydown:jt(qe,["enter"])},null,544),[[De,h.value]])])]),m.value?(K(),H("div",Ub,re(m.value),1)):Ee("",!0),u("div",qb,[u("button",{class:"btn btn-sm",disabled:!(a.value.trim()||h.value.trim()),onClick:He},"重置",8,Hb),u("button",{class:"btn btn-primary btn-sm",disabled:D.value,onClick:qe},"添加记录",8,Wb)])]),le.value.length?(K(),H("div",zb,[F[25]||(F[25]=u("div",{class:"sec-title"},"本月支出分类",-1)),(K(!0),H(Re,null,ut(le.value,fe=>(K(),H("div",{key:fe.name,class:"bar-row"},[u("span",Gb,re(fe.name),1),u("span",Yb,[u("span",{class:"bar-fill",style:or({width:fe.percent+"%"})},null,4)]),u("span",Jb,re(ke(fe.amount))+" 元 · "+re(fe.percent)+"%",1)]))),128))])):Ee("",!0),k.value?(K(),H("div",Xb,[u("div",Qb,re(k.value),1),F[26]||(F[26]=u("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):Ee("",!0),u("div",Zb,[u("table",ew,[F[28]||(F[28]=u("thead",null,[u("tr",null,[u("th",null,"日期"),u("th",null,"分类"),u("th",null,"金额(元)"),u("th",null,"备注"),u("th",null,"报销"),u("th",{class:"th-ops"},"操作")])],-1)),u("tbody",null,[(K(!0),H(Re,null,ut(x.value,fe=>(K(),H("tr",{key:fe.id},[u("td",tw,re(fe.date),1),u("td",null,[u("span",nw,re(fe.category),1)]),u("td",{class:et(["num",fe.type==="income"?"amt-income":"amt-expense"])},re(J(fe)),3),u("td",rw,re(fe.note||"--"),1),u("td",null,[fe.type!=="expense"||fe.reimbursable!==1?(K(),H("span",sw,"--")):fe.reimbursed===1?(K(),H("span",ow,"已报销")):(K(),H("span",iw,"待报销"))]),u("td",null,[u("div",aw,[fe.type==="expense"&&fe.reimbursable===1&&fe.reimbursed!==1?(K(),H("button",{key:0,class:"btn btn-xs",onClick:Ke=>ye(fe)},"标记已报销",8,lw)):Ee("",!0),u("button",{class:"btn btn-xs",onClick:Ke=>Oe(fe)},"编辑",8,uw),u("button",{class:"btn btn-xs",onClick:Ke=>ce.value=fe},"删除",8,cw)])])]))),128)),!x.value.length&&!s.value?(K(),H("tr",fw,[...F[27]||(F[27]=[u("td",{colspan:"6",class:"empty muted"},"本月暂无账目",-1)])])):Ee("",!0)])])]),u("div",dw,"筛选结果 "+re(x.value.length)+" 条 / 本月共 "+re(n.value.length)+" 条",1),Te(_b,{open:T.value,title:(L.value,"编辑账目"),initial:X.value,onCancel:F[9]||(F[9]=fe=>T.value=!1),onSave:Fe},null,8,["open","title","initial"]),Te(cr,{open:!!ce.value,title:"删除确认",message:ce.value?"将删除 "+ce.value.date+" 的账目("+ce.value.category+" "+ke(ce.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:F[10]||(F[10]=fe=>ce.value=null),onConfirm:je},null,8,["open","message"])]))}}),hw=Gt(pw,[["__scopeId","data-v-2b678001"]]),vw={class:"memo-page"},mw={class:"card memo-list"},yw={class:"pane-head"},gw={class:"pane-title"},bw={class:"memo-scroll"},ww=["onClick"],_w={class:"memo-item-title"},kw={class:"muted memo-item-sub"},xw={class:"muted num memo-item-time"},Cw={key:0,class:"muted empty"},Ew={class:"card memo-editor"},Sw={class:"editor-foot"},$w={class:"muted foot-info"},Aw=["disabled"],Pw=["disabled"],Tw={key:1,class:"empty muted editor-empty"},Ow=Vt({__name:"MemoView",setup(e){const t=V([]),n=V(null),s=V(!1),o=V(""),a=V(""),c=V(null),d=V(null);async function h(){if(t.value=await Kv(),n.value&&n.value.id){const ae=t.value.find(Z=>Z.id===n.value.id);ae&&(n.value=ae)}}fn(async()=>{await h(),t.value.length&&k(t.value[0]),window.addEventListener("keydown",y)}),pr(()=>window.removeEventListener("keydown",y)),gt(Ta,async ae=>{if(!ae)return;t.value.length||await h();const Z=t.value.find($=>$.id===ae);Ta.value=null,Z&&D(Z)},{immediate:!0});function y(ae){(ae.ctrlKey||ae.metaKey)&&ae.key.toLowerCase()==="s"&&s.value&&m.value&&(ae.preventDefault(),ce())}const m=it(()=>{if(!s.value)return!1;const ae=n.value?n.value.title:"",Z=n.value?n.value.content:"";return o.value!==ae||a.value!==Z});function k(ae){n.value=ae,s.value=!0,o.value=ae.title,a.value=ae.content}function D(ae){if(!(s.value&&n.value&&n.value.id===ae.id)){if(m.value){d.value={type:"select",memo:ae};return}k(ae)}}function T(){if(m.value){d.value={type:"new"};return}L()}function L(){n.value=null,s.value=!0,o.value="",a.value=""}function X(){n.value?k(n.value):L()}async function ce(){if(!o.value.trim()&&!a.value.trim()){We("标题与内容不能都为空");return}if(n.value&&n.value.id)await Nv(n.value.id,o.value,a.value),We("备忘已保存");else{const ae=await Fv(o.value,a.value);n.value=ae,o.value=ae.title,a.value=ae.content,We("备忘已创建")}await h()}function Q(){n.value&&n.value.id&&(c.value=n.value)}async function S(){c.value&&c.value.id&&(await Vv(c.value.id),We("备忘已删除")),c.value=null,await h(),L()}function N(){const ae=d.value;d.value=null,ae&&(ae.type==="select"?k(ae.memo):L())}function G(ae){return(ae.content||"").replace(/\s+/g," ").slice(0,30)}function de(ae){return ae.replace("T"," ").slice(0,16)}return(ae,Z)=>(K(),H("div",vw,[u("aside",mw,[u("div",yw,[u("span",gw,"备忘录("+re(t.value.length)+")",1),u("button",{class:"btn btn-primary btn-sm",onClick:T},"新建")]),u("div",bw,[(K(!0),H(Re,null,ut(t.value,$=>(K(),H("div",{key:$.id,class:et(["memo-item",{active:s.value&&n.value&&n.value.id===$.id}]),onClick:x=>D($)},[u("div",_w,re($.title||"无标题"),1),u("div",kw,re(G($)||"空"),1),u("div",xw,re(de($.updated_at)),1)],10,ww))),128)),t.value.length?Ee("",!0):(K(),H("div",Cw,"暂无备忘"))])]),u("section",Ew,[s.value?(K(),H(Re,{key:0},[Se(u("input",{class:"input title-input","onUpdate:modelValue":Z[0]||(Z[0]=$=>o.value=$),placeholder:"标题"},null,512),[[De,o.value]]),Se(u("textarea",{class:"textarea content-textarea","onUpdate:modelValue":Z[1]||(Z[1]=$=>a.value=$),placeholder:"内容"},null,512),[[De,a.value]]),u("div",Sw,[u("span",$w,[m.value?(K(),H(Re,{key:0},[nn("有未保存修改")],64)):n.value&&n.value.id?(K(),H(Re,{key:1},[nn("更新于 "+re(de(n.value.updated_at)),1)],64)):(K(),H(Re,{key:2},[nn("新备忘")],64))]),Z[4]||(Z[4]=u("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(K(),H("button",{key:0,class:"btn btn-sm",onClick:Q},"删除")):Ee("",!0),u("button",{class:"btn btn-sm",disabled:!m.value,onClick:X},"放弃修改",8,Aw),u("button",{class:"btn btn-primary btn-sm",disabled:!m.value,onClick:ce},"保存",8,Pw)])],64)):(K(),H("div",Tw,"选择左侧备忘,或点击右上角新建"))]),Te(cr,{open:!!c.value,title:"删除确认",message:c.value?"将删除备忘「"+(c.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Z[2]||(Z[2]=$=>c.value=null),onConfirm:S},null,8,["open","message"]),Te(cr,{open:!!d.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:Z[3]||(Z[3]=$=>d.value=null),onConfirm:N},null,8,["open"])]))}}),Mw=Gt(Ow,[["__scopeId","data-v-74d60dba"]]),Iw=["aria-label"],jw={class:"dialog-head"},Dw={class:"dialog-title"},Rw={class:"dialog-body"},Lw={class:"form-grid"},Kw={class:"field span2"},Fw={class:"field span2"},Nw={class:"field span2"},Vw={class:"pwd-row"},Bw={class:"field span2"},Uw={key:0,class:"form-error"},qw={class:"dialog-btns"},Hw=Vt({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=V(""),a=V(""),c=V(""),d=V(""),h=V(""),y=V(null);function m(T){n.open&&T.key==="Escape"&&s("cancel")}gt(()=>n.open,async T=>{var L;T?(o.value=n.initial.system,a.value=n.initial.account,c.value=n.initial.password,d.value=n.initial.remark,h.value="",window.addEventListener("keydown",m),await ts(),(L=y.value)==null||L.focus()):window.removeEventListener("keydown",m)}),pr(()=>window.removeEventListener("keydown",m));function k(){const T="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",L="!@#$%^&*",X=crypto.getRandomValues(new Uint8Array(14));let ce="";for(let Q=0;Q<X.length;Q++)ce+=T[X[Q]%T.length];ce+=L[crypto.getRandomValues(new Uint8Array(1))[0]%L.length],c.value=ce,h.value=""}function D(){if(!o.value.trim()||!a.value.trim()||!c.value){h.value="系统名称、账号、密码为必填项";return}s("save",{system:o.value.trim(),account:a.value.trim(),password:c.value,remark:d.value.trim()})}return(T,L)=>(K(),It(Bs,{to:"body"},[Te(ns,{name:"modal"},{default:dr(()=>[e.open?(K(),H("div",{key:0,class:"mask",onClick:L[6]||(L[6]=Mr(X=>s("cancel"),["self"]))},[u("div",{class:"dialog",role:"dialog","aria-label":e.title},[u("div",jw,[u("span",Dw,re(e.title),1),u("button",{class:"icon-btn",title:"关闭",onClick:L[0]||(L[0]=X=>s("cancel"))},[Te(lt,{name:"close",size:16})])]),u("div",Rw,[u("div",Lw,[u("div",Kw,[L[7]||(L[7]=u("label",null,"系统名称(必填)",-1)),Se(u("input",{ref_key:"systemInput",ref:y,class:"input","onUpdate:modelValue":L[1]||(L[1]=X=>o.value=X),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[De,o.value]])]),u("div",Fw,[L[8]||(L[8]=u("label",null,"账号(必填)",-1)),Se(u("input",{class:"input","onUpdate:modelValue":L[2]||(L[2]=X=>a.value=X),placeholder:"用户名、工号或邮箱"},null,512),[[De,a.value]])]),u("div",Nw,[L[9]||(L[9]=u("label",null,"密码(必填)",-1)),u("div",Vw,[Se(u("input",{class:"input","onUpdate:modelValue":L[3]||(L[3]=X=>c.value=X),placeholder:"输入或点击生成"},null,512),[[De,c.value]]),u("button",{class:"btn btn-sm",onClick:k},"生成")])]),u("div",Bw,[L[10]||(L[10]=u("label",null,"备注",-1)),Se(u("textarea",{class:"textarea","onUpdate:modelValue":L[4]||(L[4]=X=>d.value=X),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[De,d.value]])])]),h.value?(K(),H("div",Uw,re(h.value),1)):Ee("",!0)]),u("div",qw,[u("button",{class:"btn btn-sm",onClick:L[5]||(L[5]=X=>s("cancel"))},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:D},"保存")])],8,Iw)])):Ee("",!0)]),_:1})]))}}),Ww=Gt(Hw,[["__scopeId","data-v-f383b0a6"]]),yf=15e4;function zo(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 Go(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 ol(){return zo(crypto.getRandomValues(new Uint8Array(16)).buffer)}async function Yo(e,t){const n=new TextEncoder,s=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveBits"]),o=await crypto.subtle.deriveBits({name:"PBKDF2",salt:Go(t),iterations:yf,hash:"SHA-256"},s,256);return zo(o)}async function Jo(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:Go(t),iterations:yf,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Xo(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 zo(n.buffer)+":"+zo(s)}async function yi(e,t){const n=t.split(":");if(n.length!==2)throw new Error("密文格式错误");const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:Go(n[0])},e,Go(n[1]));return new TextDecoder().decode(s)}const gf="intern-log-vault-verify",es="enc:v1:";let Dr=null;function zw(){return Dr!==null}function Qo(){Dr=null}async function bf(){return await yt("pwd_salt","")!==""}async function Gw(e){if(e.length<6)throw new Error("主密码至少 6 位");if(await bf())throw new Error("主密码已设置");const t=ol(),n=await Jo(e,t),s=await Xo(n,gf);await kt("pwd_salt",t),await kt("pwd_verifier",s),Dr=n}async function Yw(e){const t=await yt("pwd_salt","");if(!t)throw new Error("主密码尚未设置");const n=await Jo(e,t),s=await yt("pwd_verifier","");try{await yi(n,s)}catch{throw new Error("主密码不正确")}Dr=n}async function wf(){if(!Dr)throw new Error("密码库未解锁");return Dr}async function Jw(e){const t=await wf();return es+await Xo(t,e)}async function Xw(e){if(!e)return"";if(!e.startsWith(es))return e;const t=await wf();return yi(t,e.slice(es.length))}async function Qw(){return te.credential.orderBy("system").toArray()}async function Zw(e,t){const n=await Jw(e.password),s={system:e.system.trim(),account:e.account.trim(),password:n,remark:e.remark.trim()};t?await te.credential.update(t,{...s,updated_at:wt()}):await te.credential.add({...s,created_at:wt(),updated_at:wt()})}async function e_(e){await te.credential.delete(e)}async function da(e){const t=await te.credential.get(e);if(!t)throw new Error("记录不存在");return Xw(t.password)}async function t_(e,t){if(!e)throw new Error("请输入旧主密码");if(t.length<6)throw new Error("新主密码至少 6 位");if(t===e)throw new Error("新主密码不能与旧主密码相同");const n=await yt("pwd_salt","");if(!n)throw new Error("密码库尚未初始化");const s=await Jo(e,n),o=await yt("pwd_verifier","");try{await yi(s,o)}catch{throw new Error("旧主密码不正确")}const a=await Jo(t,n),c=await te.credential.toArray();let d=0;for(const h of c){if(h.id==null)continue;const y=await n_(h.password,s),m=es+await Xo(a,y);await te.credential.update(h.id,{password:m}),d++}return await kt("pwd_verifier",await Xo(a,gf)),Dr=a,d}async function n_(e,t){return e?e.startsWith(es)?yi(t,e.slice(es.length)):e:""}const r_={class:"vault-page"},s_={key:0,class:"empty muted"},o_={key:1,class:"card lock-card"},i_={class:"lock-badge"},a_={key:0,class:"form-error"},l_=["disabled"],u_={key:0,class:"form-error"},c_=["disabled"],f_={class:"vault-toolbar"},d_={class:"search-wrap"},p_={class:"card table-card"},h_={class:"cred-table"},v_={class:"td-system"},m_=["onClick"],y_={class:"pwd-cell"},g_={class:"num pwd-text"},b_=["onClick"],w_=["onClick"],__={class:"td-remark"},k_={class:"ops"},x_=["onClick"],C_=["onClick"],E_={key:0},S_={class:"muted vault-note num"},$_={class:"dialog pwd-dialog"},A_={class:"dialog-head"},P_={class:"dialog-body"},T_={class:"vp-field"},O_={class:"vp-field"},M_={class:"vp-field"},I_={key:0,class:"form-error"},j_={class:"dialog-btns"},D_=5*60*1e3,R_=Vt({__name:"VaultView",setup(e){const t=V(null),n=V(zw()),s=V(!1),o=V(""),a=V(""),c=V(""),d=V(""),h=V(""),y=V([]),m=V(""),k=V({}),D=V(!1),T=V(null),L=V({system:"",account:"",password:"",remark:""}),X=V(null),ce=V(!1),Q=V(""),S=V(""),N=V(""),G=V("");async function de(){y.value=await Qw(),k.value={}}let ae=null;function Z(){ae!==null&&window.clearTimeout(ae),ae=window.setTimeout(()=>{n.value&&(Qo(),n.value=!1,y.value=[],k.value={},We("长时间未操作,密码库已自动锁定"))},D_)}function $(){n.value&&Z()}fn(async()=>{t.value=await bf(),window.addEventListener("click",$),window.addEventListener("keydown",$),n.value&&Z()}),pr(()=>{window.removeEventListener("click",$),window.removeEventListener("keydown",$),ae!==null&&window.clearTimeout(ae)});const x=it(()=>{const ne=m.value.trim().toLowerCase();return ne?y.value.filter(F=>(F.system+" "+F.account+" "+(F.remark||"")).toLowerCase().includes(ne)):y.value});async function le(){if(!s.value){if(c.value="",!o.value){c.value="请输入主密码";return}if(o.value.length<6){c.value="主密码至少 6 位";return}if(o.value!==a.value){c.value="两次输入的主密码不一致";return}s.value=!0;try{await Gw(o.value),o.value="",a.value="",n.value=!0,Z(),await de(),We("主密码已设置,密码库已解锁")}catch(ne){c.value=ne instanceof Error?ne.message:"设置失败"}s.value=!1}}async function ke(){if(!s.value){if(h.value="",!d.value){h.value="请输入主密码";return}s.value=!0;try{await Yw(d.value),d.value="",n.value=!0,Z(),await de()}catch(ne){h.value=ne instanceof Error?ne.message:"解锁失败"}s.value=!1}}function J(){Qo(),n.value=!1,y.value=[],k.value={},ae!==null&&window.clearTimeout(ae),We("密码库已锁定")}async function xe(ne){const F=ne.id;if(k.value[F]){k.value[F]=!1;return}try{ne.passwordPlain=await da(F),k.value[F]=!0}catch(fe){We(fe instanceof Error?fe.message:"解密失败")}}async function Ve(ne){try{const F=await da(ne.id);await Oa(F),We("密码已复制")}catch(F){We(F instanceof Error?F.message:"复制失败")}}async function nt(ne){await Oa(ne.account),We("账号已复制")}function qe(){T.value=null,L.value={system:"",account:"",password:"",remark:""},D.value=!0}async function He(ne){try{const F=await da(ne.id);T.value=ne.id,L.value={system:ne.system,account:ne.account,password:F,remark:ne.remark||""},D.value=!0}catch(F){We(F instanceof Error?F.message:"解密失败")}}async function ye(ne){const F=T.value??void 0;await Zw(ne,F),D.value=!1,await de(),We(F?"账号已更新":"账号已添加")}async function Oe(){X.value&&X.value.id&&(await e_(X.value.id),We("账号已删除")),X.value=null,await de()}function Fe(){Q.value="",S.value="",N.value="",G.value="",ce.value=!0}async function je(){G.value="";try{const ne=await t_(Q.value,S.value);ce.value=!1,Q.value="",S.value="",N.value="",We("主密码已修改,"+ne+" 条账号密码已重新加密")}catch(ne){G.value=ne instanceof Error?ne.message:"修改失败"}}return(ne,F)=>(K(),H("div",r_,[t.value===null?(K(),H("div",s_,"加载中")):n.value?(K(),H(Re,{key:2},[u("div",f_,[u("div",d_,[Te(lt,{name:"search",size:14,class:"search-icon"}),Se(u("input",{class:"input","onUpdate:modelValue":F[3]||(F[3]=fe=>m.value=fe),placeholder:"搜索系统名称、账号或备注"},null,512),[[De,m.value]])]),F[16]||(F[16]=u("span",{class:"flex1"},null,-1)),u("button",{class:"btn btn-sm",onClick:Fe},"修改主密码"),u("button",{class:"btn btn-sm",onClick:J},"锁定"),u("button",{class:"btn btn-primary btn-sm",onClick:qe},"新增账号")]),u("div",p_,[u("table",h_,[F[18]||(F[18]=u("thead",null,[u("tr",null,[u("th",null,"系统名称"),u("th",null,"账号"),u("th",null,"密码"),u("th",null,"备注"),u("th",{class:"th-ops"},"操作")])],-1)),u("tbody",null,[(K(!0),H(Re,null,ut(x.value,fe=>(K(),H("tr",{key:fe.id},[u("td",v_,re(fe.system),1),u("td",null,[u("span",{class:"copyable",title:"点击复制账号",onClick:Ke=>nt(fe)},re(fe.account),9,m_)]),u("td",null,[u("div",y_,[u("span",g_,re(k.value[fe.id]?fe.passwordPlain:"........"),1),u("button",{class:"btn btn-xs",onClick:Ke=>xe(fe)},re(k.value[fe.id]?"隐藏":"显示"),9,b_),u("button",{class:"btn btn-xs",onClick:Ke=>Ve(fe)},"复制",8,w_)])]),u("td",__,re(fe.remark||"--"),1),u("td",null,[u("div",k_,[u("button",{class:"btn btn-xs",onClick:Ke=>He(fe)},"编辑",8,x_),u("button",{class:"btn btn-xs",onClick:Ke=>X.value=fe},"删除",8,C_)])])]))),128)),x.value.length?Ee("",!0):(K(),H("tr",E_,[...F[17]||(F[17]=[u("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),u("div",S_,"共 "+re(y.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密存储于本机",1)],64)):(K(),H("div",o_,[u("div",i_,[Te(lt,{name:"lock",size:26})]),t.value===!1?(K(),H(Re,{key:0},[F[12]||(F[12]=u("div",{class:"lock-title"},"设置主密码",-1)),F[13]||(F[13]=u("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":F[0]||(F[0]=fe=>o.value=fe),placeholder:"设置主密码(至少 6 位)",onKeydown:jt(le,["enter"])},null,544),[[De,o.value]]),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":F[1]||(F[1]=fe=>a.value=fe),placeholder:"再次输入主密码",onKeydown:jt(le,["enter"])},null,544),[[De,a.value]]),c.value?(K(),H("div",a_,re(c.value),1)):Ee("",!0),u("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:le},"完成设置并解锁",8,l_)],64)):(K(),H(Re,{key:1},[F[14]||(F[14]=u("div",{class:"lock-title"},"密码库已锁定",-1)),F[15]||(F[15]=u("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":F[2]||(F[2]=fe=>d.value=fe),placeholder:"主密码",onKeydown:jt(ke,["enter"])},null,544),[[De,d.value]]),h.value?(K(),H("div",u_,re(h.value),1)):Ee("",!0),u("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:ke},"解锁",8,c_)],64))])),Te(Ww,{open:D.value,title:T.value?"编辑账号":"新增账号",initial:L.value,onCancel:F[4]||(F[4]=fe=>D.value=!1),onSave:ye},null,8,["open","title","initial"]),Te(cr,{open:!!X.value,title:"删除确认",message:X.value?"将删除系统「"+X.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:F[5]||(F[5]=fe=>X.value=null),onConfirm:Oe},null,8,["open","message"]),(K(),It(Bs,{to:"body"},[Te(ns,{name:"modal"},{default:dr(()=>[ce.value?(K(),H("div",{key:0,class:"mask",onClick:F[11]||(F[11]=Mr(fe=>ce.value=!1,["self"]))},[u("div",$_,[u("div",A_,[F[19]||(F[19]=u("span",{class:"dialog-title"},"修改主密码",-1)),u("button",{class:"icon-btn",title:"关闭",onClick:F[6]||(F[6]=fe=>ce.value=!1)},[Te(lt,{name:"close",size:16})])]),u("div",P_,[u("div",T_,[F[20]||(F[20]=u("label",null,"旧主密码",-1)),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":F[7]||(F[7]=fe=>Q.value=fe)},null,512),[[De,Q.value]])]),u("div",O_,[F[21]||(F[21]=u("label",null,"新主密码(至少 6 位)",-1)),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":F[8]||(F[8]=fe=>S.value=fe)},null,512),[[De,S.value]])]),u("div",M_,[F[22]||(F[22]=u("label",null,"确认新主密码",-1)),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":F[9]||(F[9]=fe=>N.value=fe)},null,512),[[De,N.value]])]),G.value?(K(),H("div",I_,re(G.value),1)):Ee("",!0),F[23]||(F[23]=u("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),u("div",j_,[u("button",{class:"btn btn-sm",onClick:F[10]||(F[10]=fe=>ce.value=!1)},"取消"),u("button",{class:"btn btn-primary btn-sm",onClick:je},"确认修改")])])])):Ee("",!0)]),_:1})]))]))}}),L_=Gt(R_,[["__scopeId","data-v-6820bc9c"]]);function K_(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Ru(e,t){const s="\uFEFF"+t.map(d=>d.map(K_).join(",")).join(`\r
|
||
`);if(Zr.isNativePlatform()){const{downloadText:d}=await pf(async()=>{const{downloadText:h}=await Promise.resolve().then(()=>wg);return{downloadText:h}},void 0,import.meta.url);return d(e,s)}const o=new Blob([s],{type:"text/csv;charset=utf-8"}),a=URL.createObjectURL(o),c=document.createElement("a");return c.href=a,c.download=e,c.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e4),""}class F_ extends Ir{constructor(){super("intern_worklog_users"),this.version(1).stores({user:"id, &username"})}}const Or=new F_,gi="intern_worklog",il="dsh_session_user";function zs(){try{const e=localStorage.getItem(il);if(!e)return null;const t=JSON.parse(e);if(t&&t.userId&&t.username)return t}catch{}return null}function _f(e){localStorage.setItem(il,JSON.stringify(e))}function kf(){localStorage.removeItem(il)}const al="dsh_cloud_creds";function xf(e,t){localStorage.setItem(al,JSON.stringify({username:e,password:t}))}function bi(){try{const e=localStorage.getItem(al);if(!e)return null;const t=JSON.parse(e);if(t&&t.username&&t.password)return t}catch{}return null}function Cf(){localStorage.removeItem(al)}let Zo=null;function Fs(e){Zo===e&&te||(te&&el(),Xh(new lf(gi+"_"+e)),Zo=e)}async function N_(e,t,n){const s=e.trim();if(s.length<2||s.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");if(await Or.user.where("username").equals(s).first())throw new Error("用户名已存在");const a=ol(),c=await Yo(t,a),d="u_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,6);await Or.user.add({id:d,username:s,pwd_hash:c,pwd_salt:a,created_at:new Date().toISOString()}),Fs(d);let h=0;n&&await Ef()&&(h=await H_(),await Or.user.update(d,{legacy_imported_at:new Date().toISOString()}));const y={userId:d,username:s};return _f(y),xf(y.username,t),h&&W_(h),y}async function V_(e,t){const n=e.trim(),s=await Or.user.where("username").equals(n).first();if(!s)throw new Error("用户不存在");if(await Yo(t,s.pwd_salt)!==s.pwd_hash)throw new Error("密码不正确");Fs(s.id);const a={userId:s.id,username:s.username};return _f(a),xf(a.username,t),a}async function B_(){Qo(),el(),Zo=null,kf(),Cf()}async function U_(e,t){const n=zs();if(!n)throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const s=await Or.user.get(n.userId);if(!s)throw new Error("用户不存在");if(await Yo(e,s.pwd_salt)!==s.pwd_hash)throw new Error("旧密码不正确");const a=ol(),c=await Yo(t,a);await Or.user.update(s.id,{pwd_hash:c,pwd_salt:a})}async function q_(){const e=zs();if(!e)throw new Error("未登录");Qo(),el(),Zo=null,await Ir.delete(gi+"_"+e.userId),await Or.user.delete(e.userId),kf(),Cf()}async function Ef(){return Ir.exists(gi)}async function H_(){if(!te)throw new Error("用户数据库未就绪");const e=new lf(gi),t=await Promise.all([e.project.toArray(),e.work_log.toArray(),e.log_item.toArray(),e.attendance.toArray(),e.weekly_note.toArray(),e.setting.toArray(),e.memo.toArray(),e.credential.toArray()]);await te.transaction("rw",[te.project,te.work_log,te.log_item,te.attendance,te.weekly_note,te.setting,te.memo,te.credential],async()=>{await Promise.all([te.project.clear(),te.work_log.clear(),te.log_item.clear(),te.attendance.clear(),te.weekly_note.clear(),te.setting.clear(),te.memo.clear(),te.credential.clear()]),t[0].length&&await te.project.bulkAdd(t[0]),t[1].length&&await te.work_log.bulkAdd(t[1]),t[2].length&&await te.log_item.bulkAdd(t[2]),t[3].length&&await te.attendance.bulkAdd(t[3]),t[4].length&&await te.weekly_note.bulkAdd(t[4]),t[5].length&&await te.setting.bulkAdd(t[5]),t[6].length&&await te.memo.bulkAdd(t[6]),t[7].length&&await te.credential.bulkAdd(t[7])});const n=t[0].length+t[1].length+t[2].length+t[3].length+t[4].length+t[6].length+t[7].length;return e.close(),n}function W_(e){try{sessionStorage.setItem("dsh_migrate_toast",String(e))}catch{}}const z_="https://daywk.linyux.cn",ei=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","transaction"],Ma=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);function G_(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Lu(e){const t={...e};return delete t.id,t}function Ku(e){return JSON.stringify(e)}async function Y_(e){return te.table(e).toArray()}function Ia(e,t){return e==="setting"?t.key:t.id}async function J_(){for(const e of ei){const t=te.table(e),n=await t.toArray();for(const s of n){if(e==="setting"&&Ma.has(s.key))continue;const o={};s.uuid||(o.uuid=G_()),s.updated_at||(o.updated_at=s.created_at||wt()),Object.keys(o).length&&await t.update(Ia(e,s),o)}}}async function ll(){return await yt("sync_base_url","")||z_}async function Sf(){const e=bi();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await ll(),username:e.username,password:e.password}}async function X_(){return Pf(await Sf())}async function $f(){const e=bi();if(!e)throw new Error("未登录");const t=await ll(),n={"Content-Type":"application/json"},s=JSON.stringify({username:e.username,password:e.password});let o=await fetch(t+"/api/auth/register",{method:"POST",headers:n,body:s});if(o.status===409){if(o=await fetch(t+"/api/auth/login",{method:"POST",headers:n,body:s}),!o.ok)throw new Error("云端已存在同名账号且密码不一致,请检查")}else if(!o.ok)throw new Error("云端绑定失败:"+o.status)}async function Q_(){return bi()!=null}async function Z_(){return yt("sync_last_time","")}async function Af(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 e1(e,t){let n=await yt("sync_token","");return n||(n=await Af(e,t),await kt("sync_token",n),n)}let $s=!1,Mo=!1,ja=!1,Gr=null,wn=null,Da="",Fu=!1,Io=null;async function Yr(){if($s){Mo=!0;return}try{if(!await Q_())return;await Pf(await Sf())}catch{}}function t1(){if(Fu)return;Fu=!0,Io=Jh(async()=>{const t={};for(const n of ei)t[n]=await te.table(n).count();return t}).subscribe({next:()=>{ja||$s||(Gr&&globalThis.clearTimeout(Gr),Gr=globalThis.setTimeout(()=>{Yr()},3e3))},error:()=>{}})}function n1(){Io&&(Io.unsubscribe(),Io=null),wn&&(wn.close(),wn=null,Da=""),Gr&&(globalThis.clearTimeout(Gr),Gr=null)}function r1(e,t){const n=e+"|"+t;if(!(wn&&Da===n)){wn&&(wn.close(),wn=null);try{wn=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),Da=n,wn.onmessage=()=>{Yr()}}catch{wn=null}}}async function Pf(e){if($s)return Mo=!0,{pushed:0,pulled:0,removed:0,at:""};$s=!0,ja=!0;try{const t=await s1(e);return Mo&&(Mo=!1,globalThis.setTimeout(()=>{Yr()},800)),t}finally{$s=!1,ja=!1}}async function s1(e){const t=e.baseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("请先配置同步服务地址");await J_();const n=await te.sync_mirror.toArray(),s=new Map;for(const Q of n)s.set(Q.table+"|"+Q.uuid,Q);const o={},a=[];let c=0;for(const Q of ei){let S=await Y_(Q);Q==="setting"&&(S=S.filter(G=>!Ma.has(G.key)));const N=new Map;for(const G of S)N.set(G.uuid,G);for(const[G,de]of N){const ae=Lu(de),Z=Ku(ae),$=s.get(Q+"|"+G);(!$||$.hash!==Z)&&(o[Q]=o[Q]||[],o[Q].push(ae),c++)}for(const[G,de]of s)G.startsWith(Q+"|")&&!N.has(de.uuid)&&a.push({table:Q,uuid:de.uuid,deleted_at:wt()});o[Q]=o[Q]||[]}const d=await e1(t,e),h=Q=>fetch(t+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Q},body:JSON.stringify({device:"client",tables:o,tombstones:a})});let y=await h(d);if(y.status===401){await kt("sync_token","");const Q=await Af(t,e);await kt("sync_token",Q),y=await h(Q)}if(!y.ok)throw new Error("同步服务返回 "+y.status);const m=await y.json(),k=m.tables||{},D=m.tombstones||[];let T=0,L=0;const X=[];for(const Q of ei){const S=te.table(Q),N=await S.toArray(),G=new Map;for(const x of N)G.set(x.uuid,x);const de=k[Q]||[],ae=new Map;for(const x of de)ae.set(x.uuid,x);const Z=new Set(D.filter(x=>x.table===Q).map(x=>x.uuid));for(const[x,le]of G)Z.has(x)&&(await S.delete(Ia(Q,le)),L++);for(const x of de){if(Z.has(x.uuid))continue;const le=G.get(x.uuid);if(!le)await S.add({...x}),T++;else{const ke=String(le.updated_at||"");if(String(x.updated_at||"")>ke){const xe={...x};Q==="setting"&&delete xe.key,await S.update(Ia(Q,le),xe),T++}}}const $=await S.toArray();for(const x of $)Q==="setting"&&Ma.has(x.key)||X.push({table:Q,uuid:x.uuid,hash:Ku(Lu(x))})}await te.sync_mirror.clear(),X.length&&await te.sync_mirror.bulkAdd(X.map(Q=>({...Q}))),r1(t,d);const ce=wt();return await kt("sync_last_time",ce),(T>0||L>0)&&nr(),{pushed:c,pulled:T,removed:L,at:ce}}const o1={class:"settings"},i1={class:"card section"},a1={class:"muted acc-line"},l1={class:"ai-grid"},u1={class:"rule-item"},c1={class:"rule-item"},f1={class:"rule-item"},d1={key:0,class:"form-error"},p1={class:"rule-save"},h1={class:"card section"},v1={class:"rule-grid"},m1={class:"rule-item"},y1={class:"rule-item"},g1={class:"rule-item"},b1={class:"rule-item"},w1={class:"rule-item"},_1={class:"card section"},k1={class:"proj-add"},x1={key:0,class:"muted proj-tip"},C1=["onKeydown"],E1=["onClick"],S1=["onClick"],$1=["onClick"],A1={key:1,class:"muted"},P1={class:"card section"},T1={class:"card section"},O1={class:"muted acc-line"},M1={class:"rule-item"},I1={class:"rule-save"},j1=["disabled"],D1={key:0,class:"muted acc-line"},R1={key:1,class:"form-error"},L1={class:"card section"},K1={class:"ai-grid"},F1={class:"rule-item"},N1={class:"rule-item"},V1={class:"rule-item"},B1={class:"card section"},U1={class:"backup-row"},q1={key:0,class:"import-error"},H1=Vt({__name:"SettingsView",setup(e){var Ie;const t=V({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=V([]),s=V(""),o=V(""),a=V(""),c=V(""),d=V(""),h=V(""),y=V(null),m=V(""),k=V(null),D=V(null),T=V(""),L=V(((Ie=zs())==null?void 0:Ie.username)||""),X=V(""),ce=V(""),Q=V(""),S=V(""),N=V(!1),G="0.2.0",de=V(""),ae=V(""),Z=V(""),$=V(""),x=V(!1),le=V("");async function ke(){var w;de.value=await ll(),ae.value=((w=bi())==null?void 0:w.username)||"",le.value=await Z_()}async function J(){await kt("sync_base_url",de.value.trim()),We("同步地址已保存")}async function xe(){$.value="";try{await $f(),We("云端绑定已重建")}catch(w){$.value=w instanceof Error?w.message:"绑定失败"}}async function Ve(){if(!x.value){$.value="",x.value=!0;try{await J();const w=await X_();le.value=w.at,Z.value="推送 "+w.pushed+" 条 · 拉取 "+w.pulled+" 条 · 删除 "+w.removed+" 条",We("同步完成")}catch(w){$.value=w instanceof Error?w.message:"同步失败"}x.value=!1}}async function nt(){if(S.value="",ce.value!==Q.value){S.value="两次输入的新密码不一致";return}try{await U_(X.value,ce.value),X.value="",ce.value="",Q.value="",We("登录密码已修改")}catch(w){S.value=w instanceof Error?w.message:"修改失败"}}async function qe(){await q_(),window.location.reload()}async function He(){t.value=await jr(),n.value=await Ks(!0),a.value=(await nl()).join(`
|
||
`),c.value=await yt("ai_base_url",""),d.value=await yt("ai_api_key",""),h.value=await yt("ai_model",""),await ke()}async function ye(){await kt("ai_base_url",c.value.trim()),await kt("ai_api_key",d.value.trim()),await kt("ai_model",h.value.trim()),We("AI 配置已保存")}async function Oe(){const w=xt(),g=await Promise.all([mi("2000-01-01",w),Ks(!0)]),P=g[0],ie=g[1],se=new Map(ie.map(oe=>[oe.id,oe.name])),ue=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const oe of P)ue.push([oe.date,tl(oe.category),oe.project_id&&se.get(oe.project_id)||"",oe.content,oe.minutes==null?"":oe.minutes,oe.is_milestone?"是":"",oe.needs_followup?"是":"",oe.takeaway||"",oe.remark||""]);const ge=await Ru("工作记录_"+w.replace(/-/g,"")+".csv",ue);We(ge?"CSV 已导出到:"+ge:"CSV 已导出到系统下载目录")}async function Fe(){const w=xt(),g=await Promise.all([jr(),vi("2000-01-01",w)]),P=g[0],ie=g[1],se=["周日","周一","周二","周三","周四","周五","周六"],ue=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const oe of ie){const we=Hs(oe,oe.date,P,oe.date===w);ue.push([oe.date,se[rs(oe.date).getDay()],we.label,oe.clock_in_at?Vn(oe.clock_in_at):"",oe.clock_out_at?Vn(oe.clock_out_at):"",oe.location||"",oe.kind==="makeup"?"补卡":oe.kind==="leave"?"休假":"正常",oe.note||""])}const ge=await Ru("考勤记录_"+w.replace(/-/g,"")+".csv",ue);We(ge?"CSV 已导出到:"+ge:"CSV 已导出到系统下载目录")}fn(He);async function je(){await kt("work_start",t.value.work_start),await kt("work_end",t.value.work_end),await kt("grace_minutes",String(t.value.grace_minutes)),await kt("lunch_minutes",String(t.value.lunch_minutes)),await kt("remind_weekly",t.value.remind_weekly),We("打卡规则已保存")}async function ne(){await cf(a.value.split(`
|
||
`)),We("常用地点已保存")}async function F(){const w=s.value.trim();if(w){try{await xv(w),o.value="",s.value=""}catch{o.value="项目名已存在"}await He()}}function fe(w){y.value=w.id,m.value=w.name}async function Ke(w){const g=m.value.trim();if(g)try{await Cv(w.id,g),o.value=""}catch{o.value="项目名已存在"}y.value=null,await He()}async function ct(w){await Ev(w.id,w.archived!==1),await He()}async function ht(){try{const w=await Yv(),g=await sl("实习日志备份_"+xt().replace(/-/g,"")+".json",w);We(g?"备份已导出到:"+g:"备份已导出到系统下载目录")}catch(w){We("导出失败:"+(w instanceof Error?w.message:String(w)))}}function Yt(w){const g=w.target,P=g.files&&g.files[0];if(T.value="",!P)return;const ie=P.name;P.text().then(se=>{D.value={name:ie,text:se}}),g.value=""}async function Jt(){if(D.value)try{await Jv(D.value.text),D.value=null,T.value="",await He(),We("数据导入完成")}catch(w){D.value=null,T.value=w instanceof Error?w.message:"导入失败"}}return(w,g)=>(K(),H("div",o1,[u("div",i1,[g[23]||(g[23]=u("div",{class:"section-title"},"账号与隐私",-1)),u("div",a1,"版本 v"+re(Qt(G))+" · 当前用户:"+re(L.value)+" · 每位用户独立数据库隔离存储于本机 · 登录密码仅保存 PBKDF2 哈希",1),u("div",l1,[u("div",u1,[g[20]||(g[20]=u("label",null,"旧登录密码",-1)),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":g[0]||(g[0]=P=>X.value=P)},null,512),[[De,X.value]])]),u("div",c1,[g[21]||(g[21]=u("label",null,"新登录密码(至少 6 位)",-1)),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":g[1]||(g[1]=P=>ce.value=P)},null,512),[[De,ce.value]])]),u("div",f1,[g[22]||(g[22]=u("label",null,"确认新登录密码",-1)),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":g[2]||(g[2]=P=>Q.value=P)},null,512),[[De,Q.value]])])]),S.value?(K(),H("div",d1,re(S.value),1)):Ee("",!0),u("div",p1,[u("button",{class:"btn btn-primary btn-sm",onClick:nt},"修改登录密码"),u("button",{class:"btn btn-sm btn-danger",onClick:g[3]||(g[3]=P=>N.value=!0)},"删除此用户及全部数据")])]),u("div",h1,[g[30]||(g[30]=u("div",{class:"section-title"},"打卡规则",-1)),u("div",v1,[u("div",m1,[g[24]||(g[24]=u("label",null,"上班时间",-1)),Se(u("input",{type:"time",class:"input","onUpdate:modelValue":g[4]||(g[4]=P=>t.value.work_start=P)},null,512),[[De,t.value.work_start]])]),u("div",y1,[g[25]||(g[25]=u("label",null,"下班时间",-1)),Se(u("input",{type:"time",class:"input","onUpdate:modelValue":g[5]||(g[5]=P=>t.value.work_end=P)},null,512),[[De,t.value.work_end]])]),u("div",g1,[g[26]||(g[26]=u("label",null,"迟到宽限(分钟)",-1)),Se(u("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":g[6]||(g[6]=P=>t.value.grace_minutes=P)},null,512),[[De,t.value.grace_minutes,void 0,{number:!0}]])]),u("div",b1,[g[27]||(g[27]=u("label",null,"午休扣除(分钟)",-1)),Se(u("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":g[7]||(g[7]=P=>t.value.lunch_minutes=P)},null,512),[[De,t.value.lunch_minutes,void 0,{number:!0}]])]),u("div",w1,[g[29]||(g[29]=u("label",null,"周记提醒",-1)),Se(u("select",{class:"select","onUpdate:modelValue":g[8]||(g[8]=P=>t.value.remind_weekly=P)},[...g[28]||(g[28]=[u("option",{value:"friday"},"每周五提醒",-1),u("option",{value:"off"},"关闭",-1)])],512),[[Fn,t.value.remind_weekly]])])]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:je},"保存规则")])]),u("div",_1,[g[31]||(g[31]=u("div",{class:"section-title"},"项目管理",-1)),u("div",k1,[Se(u("input",{class:"input","onUpdate:modelValue":g[9]||(g[9]=P=>s.value=P),placeholder:"新项目名称",onKeydown:jt(F,["enter"])},null,544),[[De,s.value]]),u("button",{class:"btn btn-sm",onClick:F},"添加")]),o.value?(K(),H("div",x1,re(o.value),1)):Ee("",!0),(K(!0),H(Re,null,ut(n.value,P=>(K(),H("div",{key:P.id,class:"proj-row"},[y.value===P.id?(K(),H(Re,{key:0},[Se(u("input",{class:"input","onUpdate:modelValue":g[10]||(g[10]=ie=>m.value=ie),onKeydown:jt(ie=>Ke(P),["enter"])},null,40,C1),[[De,m.value]]),u("button",{class:"btn btn-sm",onClick:ie=>Ke(P)},"保存",8,E1),u("button",{class:"btn btn-sm",onClick:g[11]||(g[11]=ie=>y.value=null)},"取消")],64)):(K(),H(Re,{key:1},[u("span",{class:et(["proj-name",{archived:P.archived===1}])},re(P.name),3),u("button",{class:"icon-btn",title:"重命名",onClick:ie=>fe(P)},[Te(lt,{name:"edit",size:14})],8,S1),u("button",{class:"btn btn-sm",onClick:ie=>ct(P)},re(P.archived===1?"恢复":"归档"),9,$1)],64))]))),128)),n.value.length?Ee("",!0):(K(),H("div",A1,"暂无项目,先添加一个"))]),u("div",P1,[g[33]||(g[33]=u("div",{class:"section-title"},"常用地点",-1)),Se(u("textarea",{class:"textarea","onUpdate:modelValue":g[12]||(g[12]=P=>a.value=P),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[De,a.value]]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:ne},"保存地点"),g[32]||(g[32]=u("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),u("div",T1,[g[35]||(g[35]=u("div",{class:"section-title"},"多端数据同步",-1)),u("div",O1,"云端账号:"+re(ae.value||"未绑定")+" · 登录即自动绑定并同步(变更实时推送 + 每 5 分钟兜底);密码库以密文同步,主密码永不出本机",1),u("div",M1,[g[34]||(g[34]=u("label",null,"同步服务地址(默认即可)",-1)),Se(u("input",{class:"input","onUpdate:modelValue":g[13]||(g[13]=P=>de.value=P),placeholder:"https://daywk.linyux.cn"},null,512),[[De,de.value]])]),u("div",I1,[u("button",{class:"btn btn-sm",onClick:J},"保存地址"),u("button",{class:"btn btn-primary btn-sm",disabled:x.value,onClick:Ve},re(x.value?"同步中":"立即同步"),9,j1),u("button",{class:"btn btn-sm",onClick:xe},"重建云端绑定")]),Z.value?(K(),H("div",D1,"上次同步:"+re(le.value||"--")+" · "+re(Z.value),1)):Ee("",!0),$.value?(K(),H("div",R1,re($.value),1)):Ee("",!0)]),u("div",L1,[g[40]||(g[40]=u("div",{class:"section-title"},"AI 润色配置(可选)",-1)),u("div",K1,[u("div",F1,[g[36]||(g[36]=u("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),Se(u("input",{class:"input","onUpdate:modelValue":g[14]||(g[14]=P=>c.value=P),placeholder:"https://api.example.com/v1"},null,512),[[De,c.value]])]),u("div",N1,[g[37]||(g[37]=u("label",null,"API Key",-1)),Se(u("input",{class:"input","onUpdate:modelValue":g[15]||(g[15]=P=>d.value=P),placeholder:"sk-..."},null,512),[[De,d.value]])]),u("div",V1,[g[38]||(g[38]=u("label",null,"模型名称",-1)),Se(u("input",{class:"input","onUpdate:modelValue":g[16]||(g[16]=P=>h.value=P),placeholder:"如:deepseek-chat"},null,512),[[De,h.value]])])]),u("div",{class:"rule-save"},[u("button",{class:"btn btn-primary btn-sm",onClick:ye},"保存 AI 配置"),g[39]||(g[39]=u("span",{class:"muted loc-note"},"配置仅保存在本机浏览器;总结页可用 AI 润色草稿,需服务端允许浏览器跨域",-1))])]),u("div",B1,[g[41]||(g[41]=u("div",{class:"section-title"},"数据备份",-1)),u("div",U1,[u("button",{class:"btn btn-sm",onClick:ht},"导出 JSON 备份"),u("button",{class:"btn btn-sm",onClick:g[17]||(g[17]=P=>{var ie;return(ie=k.value)==null?void 0:ie.click()})},"导入 JSON 备份"),u("button",{class:"btn btn-sm",onClick:Oe},"导出工作记录 CSV"),u("button",{class:"btn btn-sm",onClick:Fe},"导出考勤 CSV"),u("input",{ref_key:"fileInput",ref:k,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:Yt},null,544)]),T.value?(K(),H("div",q1,re(T.value),1)):Ee("",!0),g[42]||(g[42]=u("div",{class:"muted backup-note"},"数据保存在浏览器 IndexedDB 中,建议定期导出 JSON 备份。",-1))]),Te(cr,{open:!!D.value,title:"导入确认",message:D.value?"将从文件「"+D.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:g[18]||(g[18]=P=>D.value=null),onConfirm:Jt},null,8,["open","message"]),Te(cr,{open:N.value,title:"删除用户确认",message:"将永久删除用户「"+L.value+"」及其全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:g[19]||(g[19]=P=>N.value=!1),onConfirm:qe},null,8,["open","message"])]))}}),W1=Gt(H1,[["__scopeId","data-v-81598f02"]]),z1={class:"login-page"},G1={class:"card login-card"},Y1={class:"login-brand"},J1={class:"brand-icon"},X1={class:"seg"},Q1=["placeholder"],Z1={key:1,class:"mig-row"},e0={key:2,class:"form-error"},t0=["disabled"],n0=Vt({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,s=V("login"),o=V(""),a=V(""),c=V(""),d=V(!0),h=V(!1),y=V(""),m=V(!1);fn(async()=>{h.value=await Ef()});function k(T){s.value=T,y.value="",c.value=""}async function D(){if(!m.value){y.value="",m.value=!0;try{let T;if(s.value==="login")T=await V_(o.value,a.value);else{if(a.value.length<6){y.value="登录密码至少 6 位",m.value=!1;return}if(a.value!==c.value){y.value="两次输入的密码不一致",m.value=!1;return}T=await N_(o.value,a.value,d.value)}n("login",T)}catch(T){y.value=T instanceof Error?T.message:"操作失败"}m.value=!1}}return(T,L)=>(K(),H("div",z1,[u("div",G1,[u("div",Y1,[u("div",J1,[Te(lt,{name:"calendar",size:22})]),L[6]||(L[6]=u("div",{class:"login-title"},"实习工作日志",-1)),L[7]||(L[7]=u("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),L[8]||(L[8]=u("div",{class:"muted login-sub"},"每位用户独立数据库,数据彼此隔离并保存在本机",-1))]),u("div",X1,[u("button",{class:et(["seg-btn",{active:s.value==="login"}]),onClick:L[0]||(L[0]=X=>k("login"))},"登录",2),u("button",{class:et(["seg-btn",{active:s.value==="create"}]),onClick:L[1]||(L[1]=X=>k("create"))},"创建用户",2)]),Se(u("input",{class:"input","onUpdate:modelValue":L[2]||(L[2]=X=>o.value=X),placeholder:"用户名(2 到 20 个字符)",onKeydown:jt(D,["enter"])},null,544),[[De,o.value]]),Se(u("input",{type:"password",class:"input","onUpdate:modelValue":L[3]||(L[3]=X=>a.value=X),placeholder:s.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:jt(D,["enter"])},null,40,Q1),[[De,a.value]]),s.value==="create"?Se((K(),H("input",{key:0,type:"password",class:"input","onUpdate:modelValue":L[4]||(L[4]=X=>c.value=X),placeholder:"再次输入密码",onKeydown:jt(D,["enter"])},null,544)),[[De,c.value]]):Ee("",!0),s.value==="create"&&h.value?(K(),H("label",Z1,[Se(u("input",{type:"checkbox","onUpdate:modelValue":L[5]||(L[5]=X=>d.value=X)},null,512),[[Oh,d.value]]),L[9]||(L[9]=u("span",null,"导入本机原有工作日志数据到此用户(原数据保留不删除)",-1))])):Ee("",!0),y.value?(K(),H("div",e0,re(y.value),1)):Ee("",!0),u("button",{class:"btn btn-primary login-btn",disabled:m.value,onClick:D},re(s.value==="login"?"登录":"创建并进入"),9,t0),L[10]||(L[10]=u("div",{class:"muted login-note"}," 登录后自动开启云端同步(密码会保存在本机用于云同步);系统只保存密码哈希,忘记密码将无法访问该用户数据 ",-1))])]))}}),r0=Gt(n0,[["__scopeId","data-v-d3d6c8cb"]]),s0={key:1,class:"app"},o0={class:"side"},i0=["data-tip","onClick"],a0={class:"main"},l0={class:"topbar"},u0={class:"title"},c0={class:"gsearch"},f0={key:0,class:"gs-panel"},d0={key:0,class:"gs-group muted"},p0=["onMousedown"],h0={class:"tag"},v0={class:"gs-text"},m0={class:"muted num gs-date"},y0={key:1,class:"gs-group muted"},g0=["onMousedown"],b0={class:"gs-text"},w0={class:"muted gs-sub"},_0={key:1,class:"gs-empty muted"},k0={class:"topbar-actions"},x0={class:"user-chip num"},C0=["disabled"],E0={class:"num"},S0={class:"content"},$0={class:"content-inner"},A0={class:"toast-wrap"},P0=Vt({__name:"App",setup(e){const t=Qv(),n=V(zs());async function s(ye){n.value=ye,Fs(ye.userId),location.hash="#/calendar",de.value="calendar",await ke(),await He(),c();try{await $f(),await Yr()}catch{}showToast("欢迎,"+ye.username);const Oe=sessionStorage.getItem("dsh_migrate_toast");Oe&&(sessionStorage.removeItem("dsh_migrate_toast"),showToast("已迁移原有数据 "+Oe+" 条"))}async function o(){n1(),a!==null&&(window.clearInterval(a),a=null),await B_(),n.value=null,de.value="calendar",location.hash="#/calendar",showToast("已退出登录")}let a=null;function c(){t1(),a!==null&&window.clearInterval(a),a=window.setInterval(()=>{Yr()},60*1e3),Yr()}const d=V(null),h=V(""),y=V(!1),m=V({logs:[],memos:[]});let k=null;const D=it(()=>!!(m.value.logs.length||m.value.memos.length));function T(){k&&window.clearTimeout(k);const ye=h.value;k=window.setTimeout(async()=>{const Oe=ye.trim();if(!Oe){m.value={logs:[],memos:[]};return}const Fe=await Promise.all([Bv(Oe,8),Uv(Oe,4)]);m.value={logs:Fe[0],memos:Fe[1]}},200)}function L(){h.value="",m.value={logs:[],memos:[]},y.value=!1}function X(ye){Pa.value=ye.date,ae("calendar"),L()}function ce(ye){Ta.value=ye.id,ae("memo"),L()}function Q(){window.setTimeout(()=>{y.value=!1},150)}function S(ye){var Oe;(ye.ctrlKey||ye.metaKey)&&ye.key.toLowerCase()==="k"&&(ye.preventDefault(),(Oe=d.value)==null||Oe.focus())}const N=[{key:"calendar",name:"日历",icon:"calendar"},{key:"today",name:"详情",icon:"edit"},{key:"stats",name:"统计",icon:"chart"},{key:"report",name:"总结",icon:"export"},{key:"ledger",name:"记账",icon:"wallet"},{key:"memo",name:"备忘录",icon:"memo"},{key:"vault",name:"密码库",icon:"lock"},{key:"settings",name:"设置",icon:"settings"}];function G(){const ye=(location.hash||"").replace("#/","");return N.some(Oe=>Oe.key===ye)?ye:"calendar"}const de=V(G());window.addEventListener("hashchange",()=>{de.value=G()});function ae(ye){location.hash="#/"+ye}const Z=it(()=>N.find(ye=>ye.key===de.value)||N[0]),$=V(xt()),x=V(void 0),le=V(!1);async function ke(){if(x.value=await mn($.value),le.value=!1,new Date().getHours()<4){const Oe=await mn(Kn($.value,-1));le.value=!!(Oe&&Oe.clock_in_at&&!Oe.clock_out_at)}}const J=it(()=>{const ye=x.value;return ye&&ye.clock_in_at&&!ye.clock_out_at?!0:le.value&&!(ye&&ye.clock_in_at)}),xe=it(()=>{const ye=x.value;return!!(ye&&ye.clock_in_at&&ye.clock_out_at)}),Ve=it(()=>{const ye=x.value;return J.value?"下班打卡":xe.value?"已打卡 "+Vn(ye==null?void 0:ye.clock_in_at)+" - "+Vn(ye==null?void 0:ye.clock_out_at):"上班打卡"});async function nt(){if(J.value)try{await $v()}catch{}else await ff($.value);await ke(),nr()}gt(Ws,()=>{n.value&&ke()});const qe=V(!1);async function He(){if((await jr()).remind_weekly==="off"){qe.value=!1;return}const Oe=new Date().getDay();if(Oe===5||Oe===6||Oe===0){const Fe=await rl(Ss($.value));qe.value=!Fe||!Fe.highlights&&!Fe.challenges&&!Fe.plan_next}else qe.value=!1}return fn(async()=>{window.addEventListener("keydown",S),n.value&&(Fs(n.value.userId),await ke(),await He(),c())}),(ye,Oe)=>{var Fe;return n.value?(K(),H("div",s0,[u("nav",o0,[(K(),H(Re,null,ut(N,je=>u("button",{key:je.key,class:et(["nav-btn",{active:de.value===je.key}]),"data-tip":je.name,onClick:ne=>ae(je.key)},[Te(lt,{name:je.icon,size:18},null,8,["name"])],10,i0)),64))]),u("div",a0,[u("header",l0,[u("span",u0,re(Z.value.name),1),u("div",c0,[Te(lt,{name:"search",size:14,class:"gs-icon"}),Se(u("input",{ref_key:"gsInput",ref:d,class:"input gs-input","onUpdate:modelValue":Oe[0]||(Oe[0]=je=>h.value=je),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:T,onFocus:Oe[1]||(Oe[1]=je=>y.value=!0),onBlur:Q,onKeydown:jt(L,["esc"])},null,544),[[De,h.value]]),y.value&&h.value.trim()?(K(),H("div",f0,[D.value?(K(),H(Re,{key:0},[m.value.logs.length?(K(),H("div",d0,"工作记录")):Ee("",!0),(K(!0),H(Re,null,ut(m.value.logs,je=>(K(),H("div",{key:"l"+je.id,class:"gs-item",onMousedown:Mr(ne=>X(je),["prevent"])},[u("span",h0,re(Qt(tl)(je.category)),1),u("span",v0,re(je.content),1),u("span",m0,re(je.date),1)],40,p0))),128)),m.value.memos.length?(K(),H("div",y0,"备忘录")):Ee("",!0),(K(!0),H(Re,null,ut(m.value.memos,je=>(K(),H("div",{key:"m"+je.id,class:"gs-item",onMousedown:Mr(ne=>ce(je),["prevent"])},[u("span",b0,re(je.title||"无标题"),1),u("span",w0,re(je.content),1)],40,g0))),128))],64)):(K(),H("div",_0,"无匹配结果"))])):Ee("",!0)]),Oe[4]||(Oe[4]=u("span",{class:"flex1"},null,-1)),u("div",k0,[qe.value?(K(),H("button",{key:0,class:"week-tip",onClick:Oe[2]||(Oe[2]=je=>ae("report"))},[...Oe[3]||(Oe[3]=[u("span",{class:"dot",style:{background:"var(--warn)"}},null,-1),nn(" 填写本周周记 ",-1)])])):Ee("",!0),u("span",x0,re((Fe=n.value)==null?void 0:Fe.username),1),u("button",{class:"btn btn-sm",onClick:o},"退出"),u("button",{class:"btn btn-primary btn-sm",disabled:xe.value,onClick:nt},[Te(lt,{name:xe.value?"check-circle":"clock",size:14},null,8,["name"]),u("span",E0,re(Ve.value),1)],8,C0)])]),u("main",S0,[u("div",$0,[de.value==="calendar"?(K(),It(_y,{key:0})):de.value==="today"?(K(),It($y,{key:1})):de.value==="stats"?(K(),It(sg,{key:2})):de.value==="report"?(K(),It(rb,{key:3})):de.value==="ledger"?(K(),It(hw,{key:4})):de.value==="memo"?(K(),It(Mw,{key:5})):de.value==="vault"?(K(),It(L_,{key:6})):(K(),It(W1,{key:7}))])])]),u("div",A0,[Te(kh,{name:"toast"},{default:dr(()=>[(K(!0),H(Re,null,ut(Qt(t),je=>(K(),H("div",{key:je.id,class:"toast"},re(je.text),1))),128))]),_:1})])])):(K(),It(r0,{key:0,onLogin:s}))}}}),T0=Gt(P0,[["__scopeId","data-v-0d619789"]]);function ul(e,t){try{let n=document.getElementById("fatal-overlay");n||(n=document.createElement("div"),n.id="fatal-overlay",n.style.cssText="position:fixed;inset:0;z-index:99999;background:#FFFFFF;color:#1D2129;padding:20px;overflow:auto;font:13px/1.7 -apple-system,PingFang SC,Microsoft YaHei,sans-serif;",n.addEventListener("click",o=>{o.target===n&&n.parentElement&&n.parentElement.removeChild(n)}),document.body.appendChild(n));const s=document.createElement("div");s.style.cssText="border:1px solid #E5484D;border-radius:8px;padding:12px;margin-bottom:12px;word-break:break-all;white-space:pre-wrap;",s.textContent=e+`
|
||
`+t,n.appendChild(s)}catch{}}const Nu=zs();Nu&&Fs(Nu.userId);const Tf=Kh(T0);Tf.config.errorHandler=(e,t,n)=>{const s=e;ul("应用内部错误(点击空白处关闭,请将以下内容发送给开发者)",s&&(s.stack||s.message)||String(e)+`
|
||
触发位置: `+n)};window.addEventListener("unhandledrejection",e=>{const t=e.reason;ul("未处理的异步错误(点击空白处关闭)",t&&(t.stack||t.message)||String(e.reason))});window.addEventListener("error",e=>{e.message&&e.message!=="ResizeObserver loop limit exceeded"&&ul("运行错误(点击空白处关闭)",e.message)});Tf.mount("#app");"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})});export{mf as W,pf as _,gg as b,vf as r};
|