index-ada8cdd4.js 275 KB

12345678910111213141516171819202122232425262728293031
  1. (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(n){if(n.ep)return;n.ep=!0;const o=r(n);fetch(n.href,o)}})();/**
  2. * @vue/shared v3.5.33
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/function Yn(e){const t=Object.create(null);for(const r of e.split(","))t[r]=1;return r=>r in t}const it={},Le=[],Bt=()=>{},kr=()=>!1,Js=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Gs=e=>e.startsWith("onUpdate:"),_t=Object.assign,zn=(e,t)=>{const r=e.indexOf(t);r>-1&&e.splice(r,1)},zi=Object.prototype.hasOwnProperty,st=(e,t)=>zi.call(e,t),K=Array.isArray,Ne=e=>ys(e)==="[object Map]",Je=e=>ys(e)==="[object Set]",To=e=>ys(e)==="[object Date]",Y=e=>typeof e=="function",dt=e=>typeof e=="string",ee=e=>typeof e=="symbol",ot=e=>e!==null&&typeof e=="object",Cr=e=>(ot(e)||Y(e))&&Y(e.then)&&Y(e.catch),Tr=Object.prototype.toString,ys=e=>Tr.call(e),Xi=e=>ys(e).slice(8,-1),Er=e=>ys(e)==="[object Object]",Xn=e=>dt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,os=Yn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ys=e=>{const t=Object.create(null);return r=>t[r]||(t[r]=e(r))},Qi=/-\w/g,St=Ys(e=>e.replace(Qi,t=>t.slice(1).toUpperCase())),Zi=/\B([A-Z])/g,Se=Ys(e=>e.replace(Zi,"-$1").toLowerCase()),zs=Ys(e=>e.charAt(0).toUpperCase()+e.slice(1)),gn=Ys(e=>e?`on${zs(e)}`:""),ae=(e,t)=>!Object.is(e,t),As=(e,...t)=>{for(let r=0;r<e.length;r++)e[r](...t)},xr=(e,t,r,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:r})},Xs=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Eo;const Qs=()=>Eo||(Eo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Zs(e){if(K(e)){const t={};for(let r=0;r<e.length;r++){const i=e[r],n=dt(i)?sl(i):Zs(i);if(n)for(const o in n)t[o]=n[o]}return t}else if(dt(e)||ot(e))return e}const $i=/;(?![^(]*\))/g,tl=/:([^]+)/,el=/\/\*[^]*?\*\//g;function sl(e){const t={};return e.replace(el,"").split($i).forEach(r=>{if(r){const i=r.split(tl);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function O(e){let t="";if(dt(e))t=e;else if(K(e))for(let r=0;r<e.length;r++){const i=O(e[r]);i&&(t+=i+" ")}else if(ot(e))for(const r in e)e[r]&&(t+=r+" ");return t.trim()}const nl="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ol=Yn(nl);function Fr(e){return!!e||e===""}function rl(e,t){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Ge(e[i],t[i]);return r}function Ge(e,t){if(e===t)return!0;let r=To(e),i=To(t);if(r||i)return r&&i?e.getTime()===t.getTime():!1;if(r=ee(e),i=ee(t),r||i)return e===t;if(r=K(e),i=K(t),r||i)return r&&i?rl(e,t):!1;if(r=ot(e),i=ot(t),r||i){if(!r||!i)return!1;const n=Object.keys(e).length,o=Object.keys(t).length;if(n!==o)return!1;for(const l in e){const a=e.hasOwnProperty(l),d=t.hasOwnProperty(l);if(a&&!d||!a&&d||!Ge(e[l],t[l]))return!1}}return String(e)===String(t)}function Qn(e,t){return e.findIndex(r=>Ge(r,t))}const Sr=e=>!!(e&&e.__v_isRef===!0),u=e=>dt(e)?e:e==null?"":K(e)||ot(e)&&(e.toString===Tr||!Y(e.toString))?Sr(e)?u(e.value):JSON.stringify(e,Pr,2):String(e),Pr=(e,t)=>Sr(t)?Pr(e,t.value):Ne(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((r,[i,n],o)=>(r[yn(i,o)+" =>"]=n,r),{})}:Je(t)?{[`Set(${t.size})`]:[...t.values()].map(r=>yn(r))}:ee(t)?yn(t):ot(t)&&!K(t)&&!Er(t)?String(t):t,yn=(e,t="")=>{var r;return ee(e)?`Symbol(${(r=e.description)!=null?r:t})`:e};/**
  6. * @vue/reactivity v3.5.33
  7. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  8. * @license MIT
  9. **/let wt;class il{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=wt,!t&&wt&&(this.index=(wt.scopes||(wt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,r;if(this.scopes)for(t=0,r=this.scopes.length;t<r;t++)this.scopes[t].pause();for(t=0,r=this.effects.length;t<r;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,r;if(this.scopes)for(t=0,r=this.scopes.length;t<r;t++)this.scopes[t].resume();for(t=0,r=this.effects.length;t<r;t++)this.effects[t].resume()}}run(t){if(this._active){const r=wt;try{return wt=this,t()}finally{wt=r}}}on(){++this._on===1&&(this.prevScope=wt,wt=this)}off(){if(this._on>0&&--this._on===0){if(wt===this)wt=this.prevScope;else{let t=wt;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 r,i;for(r=0,i=this.effects.length;r<i;r++)this.effects[r].stop();for(this.effects.length=0,r=0,i=this.cleanups.length;r<i;r++)this.cleanups[r]();if(this.cleanups.length=0,this.scopes){for(r=0,i=this.scopes.length;r<i;r++)this.scopes[r].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const n=this.parent.scopes.pop();n&&n!==this&&(this.parent.scopes[this.index]=n,n.index=this.index)}this.parent=void 0}}}function ll(){return wt}let ct;const _n=new WeakSet;class Ar{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,wt&&wt.active&&wt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,_n.has(this)&&(_n.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Dr(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,xo(this),Rr(this);const t=ct,r=qt;ct=this,qt=!0;try{return this.fn()}finally{Ir(this),ct=t,qt=r,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)to(t);this.deps=this.depsTail=void 0,xo(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?_n.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Dn(this)&&this.run()}get dirty(){return Dn(this)}}let Mr=0,rs,is;function Dr(e,t=!1){if(e.flags|=8,t){e.next=is,is=e;return}e.next=rs,rs=e}function Zn(){Mr++}function $n(){if(--Mr>0)return;if(is){let t=is;for(is=void 0;t;){const r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;for(;rs;){let t=rs;for(rs=void 0;t;){const r=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=r}}if(e)throw e}function Rr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ir(e){let t,r=e.depsTail,i=r;for(;i;){const n=i.prevDep;i.version===-1?(i===r&&(r=n),to(i),al(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=n}e.deps=t,e.depsTail=r}function Dn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(jr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function jr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ds)||(e.globalVersion=ds,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Dn(e))))return;e.flags|=2;const t=e.dep,r=ct,i=qt;ct=e,qt=!0;try{Rr(e);const n=e.fn(e._value);(t.version===0||ae(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(n){throw t.version++,n}finally{ct=r,qt=i,Ir(e),e.flags&=-3}}function to(e,t=!1){const{dep:r,prevSub:i,nextSub:n}=e;if(i&&(i.nextSub=n,e.prevSub=void 0),n&&(n.prevSub=i,e.nextSub=void 0),r.subs===e&&(r.subs=i,!i&&r.computed)){r.computed.flags&=-5;for(let o=r.computed.deps;o;o=o.nextDep)to(o,!0)}!t&&!--r.sc&&r.map&&r.map.delete(r.key)}function al(e){const{prevDep:t,nextDep:r}=e;t&&(t.nextDep=r,e.prevDep=void 0),r&&(r.prevDep=t,e.nextDep=void 0)}let qt=!0;const Or=[];function fe(){Or.push(qt),qt=!1}function me(){const e=Or.pop();qt=e===void 0?!0:e}function xo(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const r=ct;ct=void 0;try{t()}finally{ct=r}}}let ds=0;class cl{constructor(t,r){this.sub=t,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ur{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(!ct||!qt||ct===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==ct)r=this.activeLink=new cl(ct,this),ct.deps?(r.prevDep=ct.depsTail,ct.depsTail.nextDep=r,ct.depsTail=r):ct.deps=ct.depsTail=r,Lr(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const i=r.nextDep;i.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=i),r.prevDep=ct.depsTail,r.nextDep=void 0,ct.depsTail.nextDep=r,ct.depsTail=r,ct.deps===r&&(ct.deps=i)}return r}trigger(t){this.version++,ds++,this.notify(t)}notify(t){Zn();try{for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{$n()}}}function Lr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)Lr(i)}const r=e.dep.subs;r!==e&&(e.prevSub=r,r&&(r.nextSub=e)),e.dep.subs=e}}const Rn=new WeakMap,Ee=Symbol(""),In=Symbol(""),fs=Symbol("");function kt(e,t,r){if(qt&&ct){let i=Rn.get(e);i||Rn.set(e,i=new Map);let n=i.get(r);n||(i.set(r,n=new Ur),n.map=i,n.key=r),n.track()}}function ce(e,t,r,i,n,o){const l=Rn.get(e);if(!l){ds++;return}const a=d=>{d&&d.trigger()};if(Zn(),t==="clear")l.forEach(a);else{const d=K(e),g=d&&Xn(r);if(d&&r==="length"){const f=Number(i);l.forEach((v,_)=>{(_==="length"||_===fs||!ee(_)&&_>=f)&&a(v)})}else switch((r!==void 0||l.has(void 0))&&a(l.get(r)),g&&a(l.get(fs)),t){case"add":d?g&&a(l.get("length")):(a(l.get(Ee)),Ne(e)&&a(l.get(In)));break;case"delete":d||(a(l.get(Ee)),Ne(e)&&a(l.get(In)));break;case"set":Ne(e)&&a(l.get(Ee));break}}$n()}function Ie(e){const t=nt(e);return t===e?t:(kt(t,"iterate",fs),Kt(e)?t:t.map(he))}function $s(e){return kt(e=nt(e),"iterate",fs),e}function $t(e,t){return ve(e)?Be(xe(e)?he(t):t):he(t)}const ul={__proto__:null,[Symbol.iterator](){return vn(this,Symbol.iterator,e=>$t(this,e))},concat(...e){return Ie(this).concat(...e.map(t=>K(t)?Ie(t):t))},entries(){return vn(this,"entries",e=>(e[1]=$t(this,e[1]),e))},every(e,t){return re(this,"every",e,t,void 0,arguments)},filter(e,t){return re(this,"filter",e,t,r=>r.map(i=>$t(this,i)),arguments)},find(e,t){return re(this,"find",e,t,r=>$t(this,r),arguments)},findIndex(e,t){return re(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return re(this,"findLast",e,t,r=>$t(this,r),arguments)},findLastIndex(e,t){return re(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return re(this,"forEach",e,t,void 0,arguments)},includes(...e){return bn(this,"includes",e)},indexOf(...e){return bn(this,"indexOf",e)},join(e){return Ie(this).join(e)},lastIndexOf(...e){return bn(this,"lastIndexOf",e)},map(e,t){return re(this,"map",e,t,void 0,arguments)},pop(){return $e(this,"pop")},push(...e){return $e(this,"push",e)},reduce(e,...t){return Fo(this,"reduce",e,t)},reduceRight(e,...t){return Fo(this,"reduceRight",e,t)},shift(){return $e(this,"shift")},some(e,t){return re(this,"some",e,t,void 0,arguments)},splice(...e){return $e(this,"splice",e)},toReversed(){return Ie(this).toReversed()},toSorted(e){return Ie(this).toSorted(e)},toSpliced(...e){return Ie(this).toSpliced(...e)},unshift(...e){return $e(this,"unshift",e)},values(){return vn(this,"values",e=>$t(this,e))}};function vn(e,t,r){const i=$s(e),n=i[t]();return i!==e&&!Kt(e)&&(n._next=n.next,n.next=()=>{const o=n._next();return o.done||(o.value=r(o.value)),o}),n}const dl=Array.prototype;function re(e,t,r,i,n,o){const l=$s(e),a=l!==e&&!Kt(e),d=l[t];if(d!==dl[t]){const v=d.apply(e,o);return a?he(v):v}let g=r;l!==e&&(a?g=function(v,_){return r.call(this,$t(e,v),_,e)}:r.length>2&&(g=function(v,_){return r.call(this,v,_,e)}));const f=d.call(l,g,i);return a&&n?n(f):f}function Fo(e,t,r,i){const n=$s(e),o=n!==e&&!Kt(e);let l=r,a=!1;n!==e&&(o?(a=i.length===0,l=function(g,f,v){return a&&(a=!1,g=$t(e,g)),r.call(this,g,$t(e,f),v,e)}):r.length>3&&(l=function(g,f,v){return r.call(this,g,f,v,e)}));const d=n[t](l,...i);return a?$t(e,d):d}function bn(e,t,r){const i=nt(e);kt(i,"iterate",fs);const n=i[t](...r);return(n===-1||n===!1)&&oo(r[0])?(r[0]=nt(r[0]),i[t](...r)):n}function $e(e,t,r=[]){fe(),Zn();const i=nt(e)[t].apply(e,r);return $n(),me(),i}const fl=Yn("__proto__,__v_isRef,__isVue"),Nr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ee));function ml(e){ee(e)||(e=String(e));const t=nt(this);return kt(t,"has",e),t.hasOwnProperty(e)}class Vr{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,i){if(r==="__v_skip")return t.__v_skip;const n=this._isReadonly,o=this._isShallow;if(r==="__v_isReactive")return!n;if(r==="__v_isReadonly")return n;if(r==="__v_isShallow")return o;if(r==="__v_raw")return i===(n?o?Cl:Kr:o?qr:Br).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const l=K(t);if(!n){let d;if(l&&(d=ul[r]))return d;if(r==="hasOwnProperty")return ml}const a=Reflect.get(t,r,Pt(t)?t:i);if((ee(r)?Nr.has(r):fl(r))||(n||kt(t,"get",r),o))return a;if(Pt(a)){const d=l&&Xn(r)?a:a.value;return n&&ot(d)?On(d):d}return ot(a)?n?On(a):so(a):a}}class Hr extends Vr{constructor(t=!1){super(!1,t)}set(t,r,i,n){let o=t[r];const l=K(t)&&Xn(r);if(!this._isShallow){const g=ve(o);if(!Kt(i)&&!ve(i)&&(o=nt(o),i=nt(i)),!l&&Pt(o)&&!Pt(i))return g||(o.value=i),!0}const a=l?Number(r)<t.length:st(t,r),d=Reflect.set(t,r,i,Pt(t)?t:n);return t===nt(n)&&(a?ae(i,o)&&ce(t,"set",r,i):ce(t,"add",r,i)),d}deleteProperty(t,r){const i=st(t,r);t[r];const n=Reflect.deleteProperty(t,r);return n&&i&&ce(t,"delete",r,void 0),n}has(t,r){const i=Reflect.has(t,r);return(!ee(r)||!Nr.has(r))&&kt(t,"has",r),i}ownKeys(t){return kt(t,"iterate",K(t)?"length":Ee),Reflect.ownKeys(t)}}class hl extends Vr{constructor(t=!1){super(!0,t)}set(t,r){return!0}deleteProperty(t,r){return!0}}const pl=new Hr,gl=new hl,yl=new Hr(!0);const jn=e=>e,xs=e=>Reflect.getPrototypeOf(e);function _l(e,t,r){return function(...i){const n=this.__v_raw,o=nt(n),l=Ne(o),a=e==="entries"||e===Symbol.iterator&&l,d=e==="keys"&&l,g=n[e](...i),f=r?jn:t?Be:he;return!t&&kt(o,"iterate",d?In:Ee),_t(Object.create(g),{next(){const{value:v,done:_}=g.next();return _?{value:v,done:_}:{value:a?[f(v[0]),f(v[1])]:f(v),done:_}}})}}function Fs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function vl(e,t){const r={get(n){const o=this.__v_raw,l=nt(o),a=nt(n);e||(ae(n,a)&&kt(l,"get",n),kt(l,"get",a));const{has:d}=xs(l),g=t?jn:e?Be:he;if(d.call(l,n))return g(o.get(n));if(d.call(l,a))return g(o.get(a));o!==l&&o.get(n)},get size(){const n=this.__v_raw;return!e&&kt(nt(n),"iterate",Ee),n.size},has(n){const o=this.__v_raw,l=nt(o),a=nt(n);return e||(ae(n,a)&&kt(l,"has",n),kt(l,"has",a)),n===a?o.has(n):o.has(n)||o.has(a)},forEach(n,o){const l=this,a=l.__v_raw,d=nt(a),g=t?jn:e?Be:he;return!e&&kt(d,"iterate",Ee),a.forEach((f,v)=>n.call(o,g(f),g(v),l))}};return _t(r,e?{add:Fs("add"),set:Fs("set"),delete:Fs("delete"),clear:Fs("clear")}:{add(n){const o=nt(this),l=xs(o),a=nt(n),d=!t&&!Kt(n)&&!ve(n)?a:n;return l.has.call(o,d)||ae(n,d)&&l.has.call(o,n)||ae(a,d)&&l.has.call(o,a)||(o.add(d),ce(o,"add",d,d)),this},set(n,o){!t&&!Kt(o)&&!ve(o)&&(o=nt(o));const l=nt(this),{has:a,get:d}=xs(l);let g=a.call(l,n);g||(n=nt(n),g=a.call(l,n));const f=d.call(l,n);return l.set(n,o),g?ae(o,f)&&ce(l,"set",n,o):ce(l,"add",n,o),this},delete(n){const o=nt(this),{has:l,get:a}=xs(o);let d=l.call(o,n);d||(n=nt(n),d=l.call(o,n)),a&&a.call(o,n);const g=o.delete(n);return d&&ce(o,"delete",n,void 0),g},clear(){const n=nt(this),o=n.size!==0,l=n.clear();return o&&ce(n,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(n=>{r[n]=_l(n,e,t)}),r}function eo(e,t){const r=vl(e,t);return(i,n,o)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?i:Reflect.get(st(r,n)&&n in i?r:i,n,o)}const bl={get:eo(!1,!1)},wl={get:eo(!1,!0)},kl={get:eo(!0,!1)};const Br=new WeakMap,qr=new WeakMap,Kr=new WeakMap,Cl=new WeakMap;function Tl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function El(e){return e.__v_skip||!Object.isExtensible(e)?0:Tl(Xi(e))}function so(e){return ve(e)?e:no(e,!1,pl,bl,Br)}function xl(e){return no(e,!1,yl,wl,qr)}function On(e){return no(e,!0,gl,kl,Kr)}function no(e,t,r,i,n){if(!ot(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=El(e);if(o===0)return e;const l=n.get(e);if(l)return l;const a=new Proxy(e,o===2?i:r);return n.set(e,a),a}function xe(e){return ve(e)?xe(e.__v_raw):!!(e&&e.__v_isReactive)}function ve(e){return!!(e&&e.__v_isReadonly)}function Kt(e){return!!(e&&e.__v_isShallow)}function oo(e){return e?!!e.__v_raw:!1}function nt(e){const t=e&&e.__v_raw;return t?nt(t):e}function Fl(e){return!st(e,"__v_skip")&&Object.isExtensible(e)&&xr(e,"__v_skip",!0),e}const he=e=>ot(e)?so(e):e,Be=e=>ot(e)?On(e):e;function Pt(e){return e?e.__v_isRef===!0:!1}function Sl(e){return Pt(e)?e.value:e}const Pl={get:(e,t,r)=>t==="__v_raw"?e:Sl(Reflect.get(e,t,r)),set:(e,t,r,i)=>{const n=e[t];return Pt(n)&&!Pt(r)?(n.value=r,!0):Reflect.set(e,t,r,i)}};function Wr(e){return xe(e)?e:new Proxy(e,Pl)}class Al{constructor(t,r,i){this.fn=t,this.setter=r,this._value=void 0,this.dep=new Ur(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ds-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&ct!==this)return Dr(this,!0),!0}get value(){const t=this.dep.track();return jr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ml(e,t,r=!1){let i,n;return Y(e)?i=e:(i=e.get,n=e.set),new Al(i,n,r)}const Ss={},Ls=new WeakMap;let Ce;function Dl(e,t=!1,r=Ce){if(r){let i=Ls.get(r);i||Ls.set(r,i=[]),i.push(e)}}function Rl(e,t,r=it){const{immediate:i,deep:n,once:o,scheduler:l,augmentJob:a,call:d}=r,g=N=>n?N:Kt(N)||n===!1||n===0?ue(N,1):ue(N);let f,v,_,P,S=!1,c=!1;if(Pt(e)?(v=()=>e.value,S=Kt(e)):xe(e)?(v=()=>g(e),S=!0):K(e)?(c=!0,S=e.some(N=>xe(N)||Kt(N)),v=()=>e.map(N=>{if(Pt(N))return N.value;if(xe(N))return g(N);if(Y(N))return d?d(N,2):N()})):Y(e)?t?v=d?()=>d(e,2):e:v=()=>{if(_){fe();try{_()}finally{me()}}const N=Ce;Ce=f;try{return d?d(e,3,[P]):e(P)}finally{Ce=N}}:v=Bt,t&&n){const N=v,Z=n===!0?1/0:n;v=()=>ue(N(),Z)}const k=ll(),q=()=>{f.stop(),k&&k.active&&zn(k.effects,f)};if(o&&t){const N=t;t=(...Z)=>{N(...Z),q()}}let G=c?new Array(e.length).fill(Ss):Ss;const J=N=>{if(!(!(f.flags&1)||!f.dirty&&!N))if(t){const Z=f.run();if(n||S||(c?Z.some((bt,ut)=>ae(bt,G[ut])):ae(Z,G))){_&&_();const bt=Ce;Ce=f;try{const ut=[Z,G===Ss?void 0:c&&G[0]===Ss?[]:G,P];G=Z,d?d(t,3,ut):t(...ut)}finally{Ce=bt}}}else f.run()};return a&&a(J),f=new Ar(v),f.scheduler=l?()=>l(J,!1):J,P=N=>Dl(N,!1,f),_=f.onStop=()=>{const N=Ls.get(f);if(N){if(d)d(N,4);else for(const Z of N)Z();Ls.delete(f)}},t?i?J(!0):G=f.run():l?l(J.bind(null,!0),!0):f.run(),q.pause=f.pause.bind(f),q.resume=f.resume.bind(f),q.stop=q,q}function ue(e,t=1/0,r){if(t<=0||!ot(e)||e.__v_skip||(r=r||new Map,(r.get(e)||0)>=t))return e;if(r.set(e,t),t--,Pt(e))ue(e.value,t,r);else if(K(e))for(let i=0;i<e.length;i++)ue(e[i],t,r);else if(Je(e)||Ne(e))e.forEach(i=>{ue(i,t,r)});else if(Er(e)){for(const i in e)ue(e[i],t,r);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&ue(e[i],t,r)}return e}/**
  10. * @vue/runtime-core v3.5.33
  11. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  12. * @license MIT
  13. **/function _s(e,t,r,i){try{return i?e(...i):e()}catch(n){tn(n,t,r)}}function se(e,t,r,i){if(Y(e)){const n=_s(e,t,r,i);return n&&Cr(n)&&n.catch(o=>{tn(o,t,r)}),n}if(K(e)){const n=[];for(let o=0;o<e.length;o++)n.push(se(e[o],t,r,i));return n}}function tn(e,t,r,i=!0){const n=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||it;if(t){let a=t.parent;const d=t.proxy,g=`https://vuejs.org/error-reference/#runtime-${r}`;for(;a;){const f=a.ec;if(f){for(let v=0;v<f.length;v++)if(f[v](e,d,g)===!1)return}a=a.parent}if(o){fe(),_s(o,null,10,[e,d,g]),me();return}}Il(e,r,n,i,l)}function Il(e,t,r,i=!0,n=!1){if(n)throw e;console.error(e)}const Ft=[];let Zt=-1;const Ve=[];let ye=null,Oe=0;const Jr=Promise.resolve();let Ns=null;function Gr(e){const t=Ns||Jr;return e?t.then(this?e.bind(this):e):t}function jl(e){let t=Zt+1,r=Ft.length;for(;t<r;){const i=t+r>>>1,n=Ft[i],o=ms(n);o<e||o===e&&n.flags&2?t=i+1:r=i}return t}function ro(e){if(!(e.flags&1)){const t=ms(e),r=Ft[Ft.length-1];!r||!(e.flags&2)&&t>=ms(r)?Ft.push(e):Ft.splice(jl(t),0,e),e.flags|=1,Yr()}}function Yr(){Ns||(Ns=Jr.then(Xr))}function Ol(e){K(e)?Ve.push(...e):ye&&e.id===-1?ye.splice(Oe+1,0,e):e.flags&1||(Ve.push(e),e.flags|=1),Yr()}function So(e,t,r=Zt+1){for(;r<Ft.length;r++){const i=Ft[r];if(i&&i.flags&2){if(e&&i.id!==e.uid)continue;Ft.splice(r,1),r--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function zr(e){if(Ve.length){const t=[...new Set(Ve)].sort((r,i)=>ms(r)-ms(i));if(Ve.length=0,ye){ye.push(...t);return}for(ye=t,Oe=0;Oe<ye.length;Oe++){const r=ye[Oe];r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2}ye=null,Oe=0}}const ms=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Xr(e){const t=Bt;try{for(Zt=0;Zt<Ft.length;Zt++){const r=Ft[Zt];r&&!(r.flags&8)&&(r.flags&4&&(r.flags&=-2),_s(r,r.i,r.i?15:14),r.flags&4||(r.flags&=-2))}}finally{for(;Zt<Ft.length;Zt++){const r=Ft[Zt];r&&(r.flags&=-2)}Zt=-1,Ft.length=0,zr(),Ns=null,(Ft.length||Ve.length)&&Xr()}}let jt=null,Qr=null;function Vs(e){const t=jt;return jt=e,Qr=e&&e.type.__scopeId||null,t}function Ul(e,t=jt,r){if(!t||e._n)return e;const i=(...n)=>{i._d&&No(-1);const o=Vs(t);let l;try{l=e(...n)}finally{Vs(o),i._d&&No(1)}return l};return i._n=!0,i._c=!0,i._d=!0,i}function C(e,t){if(jt===null)return e;const r=on(jt),i=e.dirs||(e.dirs=[]);for(let n=0;n<t.length;n++){let[o,l,a,d=it]=t[n];o&&(Y(o)&&(o={mounted:o,updated:o}),o.deep&&ue(l),i.push({dir:o,instance:r,value:l,oldValue:void 0,arg:a,modifiers:d}))}return e}function we(e,t,r,i){const n=e.dirs,o=t&&t.dirs;for(let l=0;l<n.length;l++){const a=n[l];o&&(a.oldValue=o[l].value);let d=a.dir[i];d&&(fe(),se(d,r,8,[e.el,a,e,t]),me())}}function Ll(e,t){if(Ct){let r=Ct.provides;const i=Ct.parent&&Ct.parent.provides;i===r&&(r=Ct.provides=Object.create(i)),r[e]=t}}function Ms(e,t,r=!1){const i=La();if(i||He){let n=He?He._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(n&&e in n)return n[e];if(arguments.length>1)return r&&Y(t)?t.call(i&&i.proxy):t}}const Nl=Symbol.for("v-scx"),Vl=()=>Ms(Nl);function wn(e,t,r){return Zr(e,t,r)}function Zr(e,t,r=it){const{immediate:i,deep:n,flush:o,once:l}=r,a=_t({},r),d=t&&i||!t&&o!=="post";let g;if(ps){if(o==="sync"){const P=Vl();g=P.__watcherHandles||(P.__watcherHandles=[])}else if(!d){const P=()=>{};return P.stop=Bt,P.resume=Bt,P.pause=Bt,P}}const f=Ct;a.call=(P,S,c)=>se(P,f,S,c);let v=!1;o==="post"?a.scheduler=P=>{Mt(P,f&&f.suspense)}:o!=="sync"&&(v=!0,a.scheduler=(P,S)=>{S?P():ro(P)}),a.augmentJob=P=>{t&&(P.flags|=4),v&&(P.flags|=2,f&&(P.id=f.uid,P.i=f))};const _=Rl(e,t,a);return ps&&(g?g.push(_):d&&_()),_}function Hl(e,t,r){const i=this.proxy,n=dt(e)?e.includes(".")?$r(i,e):()=>i[e]:e.bind(i,i);let o;Y(t)?o=t:(o=t.handler,r=t);const l=vs(this),a=Zr(n,o.bind(i),r);return l(),a}function $r(e,t){const r=t.split(".");return()=>{let i=e;for(let n=0;n<r.length&&i;n++)i=i[r[n]];return i}}const Bl=Symbol("_vte"),ql=e=>e.__isTeleport,Kl=Symbol("_leaveCb");function io(e,t){e.shapeFlag&6&&e.component?(e.transition=t,io(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ti(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Po(e,t){let r;return!!((r=Object.getOwnPropertyDescriptor(e,t))&&!r.configurable)}const Hs=new WeakMap;function ls(e,t,r,i,n=!1){if(K(e)){e.forEach((c,k)=>ls(c,t&&(K(t)?t[k]:t),r,i,n));return}if(as(i)&&!n){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&ls(e,t,r,i.component.subTree);return}const o=i.shapeFlag&4?on(i.component):i.el,l=n?null:o,{i:a,r:d}=e,g=t&&t.r,f=a.refs===it?a.refs={}:a.refs,v=a.setupState,_=nt(v),P=v===it?kr:c=>Po(f,c)?!1:st(_,c),S=(c,k)=>!(k&&Po(f,k));if(g!=null&&g!==d){if(Ao(t),dt(g))f[g]=null,P(g)&&(v[g]=null);else if(Pt(g)){const c=t;S(g,c.k)&&(g.value=null),c.k&&(f[c.k]=null)}}if(Y(d))_s(d,a,12,[l,f]);else{const c=dt(d),k=Pt(d);if(c||k){const q=()=>{if(e.f){const G=c?P(d)?v[d]:f[d]:S()||!e.k?d.value:f[e.k];if(n)K(G)&&zn(G,o);else if(K(G))G.includes(o)||G.push(o);else if(c)f[d]=[o],P(d)&&(v[d]=f[d]);else{const J=[o];S(d,e.k)&&(d.value=J),e.k&&(f[e.k]=J)}}else c?(f[d]=l,P(d)&&(v[d]=l)):k&&(S(d,e.k)&&(d.value=l),e.k&&(f[e.k]=l))};if(l){const G=()=>{q(),Hs.delete(e)};G.id=-1,Hs.set(e,G),Mt(G,r)}else Ao(e),q()}}}function Ao(e){const t=Hs.get(e);t&&(t.flags|=8,Hs.delete(e))}Qs().requestIdleCallback;Qs().cancelIdleCallback;const as=e=>!!e.type.__asyncLoader,ei=e=>e.type.__isKeepAlive;function Wl(e,t){si(e,"a",t)}function Jl(e,t){si(e,"da",t)}function si(e,t,r=Ct){const i=e.__wdc||(e.__wdc=()=>{let n=r;for(;n;){if(n.isDeactivated)return;n=n.parent}return e()});if(en(t,i,r),r){let n=r.parent;for(;n&&n.parent;)ei(n.parent.vnode)&&Gl(i,t,r,n),n=n.parent}}function Gl(e,t,r,i){const n=en(t,e,i,!0);ni(()=>{zn(i[t],n)},r)}function en(e,t,r=Ct,i=!1){if(r){const n=r[e]||(r[e]=[]),o=t.__weh||(t.__weh=(...l)=>{fe();const a=vs(r),d=se(t,r,e,l);return a(),me(),d});return i?n.unshift(o):n.push(o),o}}const pe=e=>(t,r=Ct)=>{(!ps||e==="sp")&&en(e,(...i)=>t(...i),r)},Yl=pe("bm"),zl=pe("m"),Xl=pe("bu"),Ql=pe("u"),Zl=pe("bum"),ni=pe("um"),$l=pe("sp"),ta=pe("rtg"),ea=pe("rtc");function sa(e,t=Ct){en("ec",e,t)}const oi="components";function Lt(e,t){return oa(oi,e,!0,t)||e}const na=Symbol.for("v-ndc");function oa(e,t,r=!0,i=!1){const n=jt||Ct;if(n){const o=n.type;if(e===oi){const a=qa(o,!1);if(a&&(a===t||a===St(t)||a===zs(St(t))))return o}const l=Mo(n[e]||o[e],t)||Mo(n.appContext[e],t);return!l&&i?o:l}}function Mo(e,t){return e&&(e[t]||e[St(t)]||e[zs(St(t))])}function z(e,t,r,i){let n;const o=r&&r[i],l=K(e);if(l||dt(e)){const a=l&&xe(e);let d=!1,g=!1;a&&(d=!Kt(e),g=ve(e),e=$s(e)),n=new Array(e.length);for(let f=0,v=e.length;f<v;f++)n[f]=t(d?g?Be(he(e[f])):he(e[f]):e[f],f,void 0,o&&o[f])}else if(typeof e=="number"){n=new Array(e);for(let a=0;a<e;a++)n[a]=t(a+1,a,void 0,o&&o[a])}else if(ot(e))if(e[Symbol.iterator])n=Array.from(e,(a,d)=>t(a,d,void 0,o&&o[d]));else{const a=Object.keys(e);n=new Array(a.length);for(let d=0,g=a.length;d<g;d++){const f=a[d];n[d]=t(e[f],f,d,o&&o[d])}}else n=[];return r&&(r[i]=n),n}const Un=e=>e?Ti(e)?on(e):Un(e.parent):null,cs=_t(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Un(e.parent),$root:e=>Un(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lo(e),$forceUpdate:e=>e.f||(e.f=()=>{ro(e.update)}),$nextTick:e=>e.n||(e.n=Gr.bind(e.proxy)),$watch:e=>Hl.bind(e)}),kn=(e,t)=>e!==it&&!e.__isScriptSetup&&st(e,t),ra={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:r,setupState:i,data:n,props:o,accessCache:l,type:a,appContext:d}=e;if(t[0]!=="$"){const _=l[t];if(_!==void 0)switch(_){case 1:return i[t];case 2:return n[t];case 4:return r[t];case 3:return o[t]}else{if(kn(i,t))return l[t]=1,i[t];if(n!==it&&st(n,t))return l[t]=2,n[t];if(st(o,t))return l[t]=3,o[t];if(r!==it&&st(r,t))return l[t]=4,r[t];Ln&&(l[t]=0)}}const g=cs[t];let f,v;if(g)return t==="$attrs"&&kt(e.attrs,"get",""),g(e);if((f=a.__cssModules)&&(f=f[t]))return f;if(r!==it&&st(r,t))return l[t]=4,r[t];if(v=d.config.globalProperties,st(v,t))return v[t]},set({_:e},t,r){const{data:i,setupState:n,ctx:o}=e;return kn(n,t)?(n[t]=r,!0):i!==it&&st(i,t)?(i[t]=r,!0):st(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:i,appContext:n,props:o,type:l}},a){let d;return!!(r[a]||e!==it&&a[0]!=="$"&&st(e,a)||kn(t,a)||st(o,a)||st(i,a)||st(cs,a)||st(n.config.globalProperties,a)||(d=l.__cssModules)&&d[a])},defineProperty(e,t,r){return r.get!=null?e._.accessCache[t]=0:st(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};function Do(e){return K(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}let Ln=!0;function ia(e){const t=lo(e),r=e.proxy,i=e.ctx;Ln=!1,t.beforeCreate&&Ro(t.beforeCreate,e,"bc");const{data:n,computed:o,methods:l,watch:a,provide:d,inject:g,created:f,beforeMount:v,mounted:_,beforeUpdate:P,updated:S,activated:c,deactivated:k,beforeDestroy:q,beforeUnmount:G,destroyed:J,unmounted:N,render:Z,renderTracked:bt,renderTriggered:ut,errorCaptured:At,serverPrefetch:ne,expose:Gt,inheritAttrs:ge,components:oe,directives:Yt,filters:Vt}=t;if(g&&la(g,i,null),l)for(const lt in l){const Q=l[lt];Y(Q)&&(i[lt]=Q.bind(r))}if(n){const lt=n.call(r,r);ot(lt)&&(e.data=so(lt))}if(Ln=!0,o)for(const lt in o){const Q=o[lt],zt=Y(Q)?Q.bind(r,r):Y(Q.get)?Q.get.bind(r,r):Bt,Ae=!Y(Q)&&Y(Q.set)?Q.set.bind(r):Bt,mt=Wa({get:zt,set:Ae});Object.defineProperty(i,lt,{enumerable:!0,configurable:!0,get:()=>mt.value,set:vt=>mt.value=vt})}if(a)for(const lt in a)ri(a[lt],i,r,lt);if(d){const lt=Y(d)?d.call(r):d;Reflect.ownKeys(lt).forEach(Q=>{Ll(Q,lt[Q])})}f&&Ro(f,e,"c");function et(lt,Q){K(Q)?Q.forEach(zt=>lt(zt.bind(r))):Q&&lt(Q.bind(r))}if(et(Yl,v),et(zl,_),et(Xl,P),et(Ql,S),et(Wl,c),et(Jl,k),et(sa,At),et(ea,bt),et(ta,ut),et(Zl,G),et(ni,N),et($l,ne),K(Gt))if(Gt.length){const lt=e.exposed||(e.exposed={});Gt.forEach(Q=>{Object.defineProperty(lt,Q,{get:()=>r[Q],set:zt=>r[Q]=zt,enumerable:!0})})}else e.exposed||(e.exposed={});Z&&e.render===Bt&&(e.render=Z),ge!=null&&(e.inheritAttrs=ge),oe&&(e.components=oe),Yt&&(e.directives=Yt),ne&&ti(e)}function la(e,t,r=Bt){K(e)&&(e=Nn(e));for(const i in e){const n=e[i];let o;ot(n)?"default"in n?o=Ms(n.from||i,n.default,!0):o=Ms(n.from||i):o=Ms(n),Pt(o)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:l=>o.value=l}):t[i]=o}}function Ro(e,t,r){se(K(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,r)}function ri(e,t,r,i){let n=i.includes(".")?$r(r,i):()=>r[i];if(dt(e)){const o=t[e];Y(o)&&wn(n,o)}else if(Y(e))wn(n,e.bind(r));else if(ot(e))if(K(e))e.forEach(o=>ri(o,t,r,i));else{const o=Y(e.handler)?e.handler.bind(r):t[e.handler];Y(o)&&wn(n,o,e)}}function lo(e){const t=e.type,{mixins:r,extends:i}=t,{mixins:n,optionsCache:o,config:{optionMergeStrategies:l}}=e.appContext,a=o.get(t);let d;return a?d=a:!n.length&&!r&&!i?d=t:(d={},n.length&&n.forEach(g=>Bs(d,g,l,!0)),Bs(d,t,l)),ot(t)&&o.set(t,d),d}function Bs(e,t,r,i=!1){const{mixins:n,extends:o}=t;o&&Bs(e,o,r,!0),n&&n.forEach(l=>Bs(e,l,r,!0));for(const l in t)if(!(i&&l==="expose")){const a=aa[l]||r&&r[l];e[l]=a?a(e[l],t[l]):t[l]}return e}const aa={data:Io,props:jo,emits:jo,methods:ss,computed:ss,beforeCreate:xt,created:xt,beforeMount:xt,mounted:xt,beforeUpdate:xt,updated:xt,beforeDestroy:xt,beforeUnmount:xt,destroyed:xt,unmounted:xt,activated:xt,deactivated:xt,errorCaptured:xt,serverPrefetch:xt,components:ss,directives:ss,watch:ua,provide:Io,inject:ca};function Io(e,t){return t?e?function(){return _t(Y(e)?e.call(this,this):e,Y(t)?t.call(this,this):t)}:t:e}function ca(e,t){return ss(Nn(e),Nn(t))}function Nn(e){if(K(e)){const t={};for(let r=0;r<e.length;r++)t[e[r]]=e[r];return t}return e}function xt(e,t){return e?[...new Set([].concat(e,t))]:t}function ss(e,t){return e?_t(Object.create(null),e,t):t}function jo(e,t){return e?K(e)&&K(t)?[...new Set([...e,...t])]:_t(Object.create(null),Do(e),Do(t??{})):t}function ua(e,t){if(!e)return t;if(!t)return e;const r=_t(Object.create(null),e);for(const i in t)r[i]=xt(e[i],t[i]);return r}function ii(){return{app:null,config:{isNativeTag:kr,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 da=0;function fa(e,t){return function(i,n=null){Y(i)||(i=_t({},i)),n!=null&&!ot(n)&&(n=null);const o=ii(),l=new WeakSet,a=[];let d=!1;const g=o.app={_uid:da++,_component:i,_props:n,_container:null,_context:o,_instance:null,version:Ja,get config(){return o.config},set config(f){},use(f,...v){return l.has(f)||(f&&Y(f.install)?(l.add(f),f.install(g,...v)):Y(f)&&(l.add(f),f(g,...v))),g},mixin(f){return o.mixins.includes(f)||o.mixins.push(f),g},component(f,v){return v?(o.components[f]=v,g):o.components[f]},directive(f,v){return v?(o.directives[f]=v,g):o.directives[f]},mount(f,v,_){if(!d){const P=g._ceVNode||yt(i,n);return P.appContext=o,_===!0?_="svg":_===!1&&(_=void 0),v&&t?t(P,f):e(P,f,_),d=!0,g._container=f,f.__vue_app__=g,on(P.component)}},onUnmount(f){a.push(f)},unmount(){d&&(se(a,g._instance,16),e(null,g._container),delete g._container.__vue_app__)},provide(f,v){return o.provides[f]=v,g},runWithContext(f){const v=He;He=g;try{return f()}finally{He=v}}};return g}}let He=null;const ma=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${St(t)}Modifiers`]||e[`${Se(t)}Modifiers`];function ha(e,t,...r){if(e.isUnmounted)return;const i=e.vnode.props||it;let n=r;const o=t.startsWith("update:"),l=o&&ma(i,t.slice(7));l&&(l.trim&&(n=r.map(f=>dt(f)?f.trim():f)),l.number&&(n=r.map(Xs)));let a,d=i[a=gn(t)]||i[a=gn(St(t))];!d&&o&&(d=i[a=gn(Se(t))]),d&&se(d,e,6,n);const g=i[a+"Once"];if(g){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,se(g,e,6,n)}}const pa=new WeakMap;function li(e,t,r=!1){const i=r?pa:t.emitsCache,n=i.get(e);if(n!==void 0)return n;const o=e.emits;let l={},a=!1;if(!Y(e)){const d=g=>{const f=li(g,t,!0);f&&(a=!0,_t(l,f))};!r&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!o&&!a?(ot(e)&&i.set(e,null),null):(K(o)?o.forEach(d=>l[d]=null):_t(l,o),ot(e)&&i.set(e,l),l)}function sn(e,t){return!e||!Js(t)?!1:(t=t.slice(2).replace(/Once$/,""),st(e,t[0].toLowerCase()+t.slice(1))||st(e,Se(t))||st(e,t))}function Cn(e){const{type:t,vnode:r,proxy:i,withProxy:n,propsOptions:[o],slots:l,attrs:a,emit:d,render:g,renderCache:f,props:v,data:_,setupState:P,ctx:S,inheritAttrs:c}=e,k=Vs(e);let q,G;try{if(r.shapeFlag&4){const N=n||i,Z=N;q=te(g.call(Z,N,f,v,P,_,S)),G=a}else{const N=t;q=te(N.length>1?N(v,{attrs:a,slots:l,emit:d}):N(v,null)),G=t.props?a:ga(a)}}catch(N){us.length=0,tn(N,e,1),q=yt(be)}let J=q;if(G&&c!==!1){const N=Object.keys(G),{shapeFlag:Z}=J;N.length&&Z&7&&(o&&N.some(Gs)&&(G=ya(G,o)),J=qe(J,G,!1,!0))}return r.dirs&&(J=qe(J,null,!1,!0),J.dirs=J.dirs?J.dirs.concat(r.dirs):r.dirs),r.transition&&io(J,r.transition),q=J,Vs(k),q}const ga=e=>{let t;for(const r in e)(r==="class"||r==="style"||Js(r))&&((t||(t={}))[r]=e[r]);return t},ya=(e,t)=>{const r={};for(const i in e)(!Gs(i)||!(i.slice(9)in t))&&(r[i]=e[i]);return r};function _a(e,t,r){const{props:i,children:n,component:o}=e,{props:l,children:a,patchFlag:d}=t,g=o.emitsOptions;if(t.dirs||t.transition)return!0;if(r&&d>=0){if(d&1024)return!0;if(d&16)return i?Oo(i,l,g):!!l;if(d&8){const f=t.dynamicProps;for(let v=0;v<f.length;v++){const _=f[v];if(ai(l,i,_)&&!sn(g,_))return!0}}}else return(n||a)&&(!a||!a.$stable)?!0:i===l?!1:i?l?Oo(i,l,g):!0:!!l;return!1}function Oo(e,t,r){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let n=0;n<i.length;n++){const o=i[n];if(ai(t,e,o)&&!sn(r,o))return!0}return!1}function ai(e,t,r){const i=e[r],n=t[r];return r==="style"&&ot(i)&&ot(n)?!Ge(i,n):i!==n}function va({vnode:e,parent:t,suspense:r},i){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=i,e=n),n===e)(e=t.vnode).el=i,t=t.parent;else break}r&&r.activeBranch===e&&(r.vnode.el=i)}const ci={},ui=()=>Object.create(ci),di=e=>Object.getPrototypeOf(e)===ci;function ba(e,t,r,i=!1){const n={},o=ui();e.propsDefaults=Object.create(null),fi(e,t,n,o);for(const l in e.propsOptions[0])l in n||(n[l]=void 0);r?e.props=i?n:xl(n):e.type.props?e.props=n:e.props=o,e.attrs=o}function wa(e,t,r,i){const{props:n,attrs:o,vnode:{patchFlag:l}}=e,a=nt(n),[d]=e.propsOptions;let g=!1;if((i||l>0)&&!(l&16)){if(l&8){const f=e.vnode.dynamicProps;for(let v=0;v<f.length;v++){let _=f[v];if(sn(e.emitsOptions,_))continue;const P=t[_];if(d)if(st(o,_))P!==o[_]&&(o[_]=P,g=!0);else{const S=St(_);n[S]=Vn(d,a,S,P,e,!1)}else P!==o[_]&&(o[_]=P,g=!0)}}}else{fi(e,t,n,o)&&(g=!0);let f;for(const v in a)(!t||!st(t,v)&&((f=Se(v))===v||!st(t,f)))&&(d?r&&(r[v]!==void 0||r[f]!==void 0)&&(n[v]=Vn(d,a,v,void 0,e,!0)):delete n[v]);if(o!==a)for(const v in o)(!t||!st(t,v))&&(delete o[v],g=!0)}g&&ce(e.attrs,"set","")}function fi(e,t,r,i){const[n,o]=e.propsOptions;let l=!1,a;if(t)for(let d in t){if(os(d))continue;const g=t[d];let f;n&&st(n,f=St(d))?!o||!o.includes(f)?r[f]=g:(a||(a={}))[f]=g:sn(e.emitsOptions,d)||(!(d in i)||g!==i[d])&&(i[d]=g,l=!0)}if(o){const d=nt(r),g=a||it;for(let f=0;f<o.length;f++){const v=o[f];r[v]=Vn(n,d,v,g[v],e,!st(g,v))}}return l}function Vn(e,t,r,i,n,o){const l=e[r];if(l!=null){const a=st(l,"default");if(a&&i===void 0){const d=l.default;if(l.type!==Function&&!l.skipFactory&&Y(d)){const{propsDefaults:g}=n;if(r in g)i=g[r];else{const f=vs(n);i=g[r]=d.call(null,t),f()}}else i=d;n.ce&&n.ce._setProp(r,i)}l[0]&&(o&&!a?i=!1:l[1]&&(i===""||i===Se(r))&&(i=!0))}return i}const ka=new WeakMap;function mi(e,t,r=!1){const i=r?ka:t.propsCache,n=i.get(e);if(n)return n;const o=e.props,l={},a=[];let d=!1;if(!Y(e)){const f=v=>{d=!0;const[_,P]=mi(v,t,!0);_t(l,_),P&&a.push(...P)};!r&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!o&&!d)return ot(e)&&i.set(e,Le),Le;if(K(o))for(let f=0;f<o.length;f++){const v=St(o[f]);Uo(v)&&(l[v]=it)}else if(o)for(const f in o){const v=St(f);if(Uo(v)){const _=o[f],P=l[v]=K(_)||Y(_)?{type:_}:_t({},_),S=P.type;let c=!1,k=!0;if(K(S))for(let q=0;q<S.length;++q){const G=S[q],J=Y(G)&&G.name;if(J==="Boolean"){c=!0;break}else J==="String"&&(k=!1)}else c=Y(S)&&S.name==="Boolean";P[0]=c,P[1]=k,(c||st(P,"default"))&&a.push(v)}}const g=[l,a];return ot(e)&&i.set(e,g),g}function Uo(e){return e[0]!=="$"&&!os(e)}const ao=e=>e==="_"||e==="_ctx"||e==="$stable",co=e=>K(e)?e.map(te):[te(e)],Ca=(e,t,r)=>{if(t._n)return t;const i=Ul((...n)=>co(t(...n)),r);return i._c=!1,i},hi=(e,t,r)=>{const i=e._ctx;for(const n in e){if(ao(n))continue;const o=e[n];if(Y(o))t[n]=Ca(n,o,i);else if(o!=null){const l=co(o);t[n]=()=>l}}},pi=(e,t)=>{const r=co(t);e.slots.default=()=>r},gi=(e,t,r)=>{for(const i in t)(r||!ao(i))&&(e[i]=t[i])},Ta=(e,t,r)=>{const i=e.slots=ui();if(e.vnode.shapeFlag&32){const n=t._;n?(gi(i,t,r),r&&xr(i,"_",n,!0)):hi(t,i)}else t&&pi(e,t)},Ea=(e,t,r)=>{const{vnode:i,slots:n}=e;let o=!0,l=it;if(i.shapeFlag&32){const a=t._;a?r&&a===1?o=!1:gi(n,t,r):(o=!t.$stable,hi(t,n)),l=t}else t&&(pi(e,t),l={default:1});if(o)for(const a in n)!ao(a)&&l[a]==null&&delete n[a]},Mt=Aa;function xa(e){return Fa(e)}function Fa(e,t){const r=Qs();r.__VUE__=!0;const{insert:i,remove:n,patchProp:o,createElement:l,createText:a,createComment:d,setText:g,setElementText:f,parentNode:v,nextSibling:_,setScopeId:P=Bt,insertStaticContent:S}=e,c=(p,y,w,F=null,T=null,E=null,U=void 0,I=null,D=!!y.dynamicChildren)=>{if(p===y)return;p&&!ts(p,y)&&(F=Es(p),vt(p,T,E,!0),p=null),y.patchFlag===-2&&(D=!1,y.dynamicChildren=null);const{type:x,ref:B,shapeFlag:L}=y;switch(x){case nn:k(p,y,w,F);break;case be:q(p,y,w,F);break;case Ds:p==null&&G(y,w,F,U);break;case H:oe(p,y,w,F,T,E,U,I,D);break;default:L&1?Z(p,y,w,F,T,E,U,I,D):L&6?Yt(p,y,w,F,T,E,U,I,D):(L&64||L&128)&&x.process(p,y,w,F,T,E,U,I,D,Re)}B!=null&&T?ls(B,p&&p.ref,E,y||p,!y):B==null&&p&&p.ref!=null&&ls(p.ref,null,E,p,!0)},k=(p,y,w,F)=>{if(p==null)i(y.el=a(y.children),w,F);else{const T=y.el=p.el;y.children!==p.children&&g(T,y.children)}},q=(p,y,w,F)=>{p==null?i(y.el=d(y.children||""),w,F):y.el=p.el},G=(p,y,w,F)=>{[p.el,p.anchor]=S(p.children,y,w,F,p.el,p.anchor)},J=({el:p,anchor:y},w,F)=>{let T;for(;p&&p!==y;)T=_(p),i(p,w,F),p=T;i(y,w,F)},N=({el:p,anchor:y})=>{let w;for(;p&&p!==y;)w=_(p),n(p),p=w;n(y)},Z=(p,y,w,F,T,E,U,I,D)=>{if(y.type==="svg"?U="svg":y.type==="math"&&(U="mathml"),p==null)bt(y,w,F,T,E,U,I,D);else{const x=p.el&&p.el._isVueCE?p.el:null;try{x&&x._beginPatch(),ne(p,y,T,E,U,I,D)}finally{x&&x._endPatch()}}},bt=(p,y,w,F,T,E,U,I)=>{let D,x;const{props:B,shapeFlag:L,transition:V,dirs:W}=p;if(D=p.el=l(p.type,E,B&&B.is,B),L&8?f(D,p.children):L&16&&At(p.children,D,null,F,T,Tn(p,E),U,I),W&&we(p,null,F,"created"),ut(D,p,p.scopeId,U,F),B){for(const rt in B)rt!=="value"&&!os(rt)&&o(D,rt,null,B[rt],E,F);"value"in B&&o(D,"value",null,B.value,E),(x=B.onVnodeBeforeMount)&&Qt(x,F,p)}W&&we(p,null,F,"beforeMount");const tt=Sa(T,V);tt&&V.beforeEnter(D),i(D,y,w),((x=B&&B.onVnodeMounted)||tt||W)&&Mt(()=>{try{x&&Qt(x,F,p),tt&&V.enter(D),W&&we(p,null,F,"mounted")}finally{}},T)},ut=(p,y,w,F,T)=>{if(w&&P(p,w),F)for(let E=0;E<F.length;E++)P(p,F[E]);if(T){let E=T.subTree;if(y===E||bi(E.type)&&(E.ssContent===y||E.ssFallback===y)){const U=T.vnode;ut(p,U,U.scopeId,U.slotScopeIds,T.parent)}}},At=(p,y,w,F,T,E,U,I,D=0)=>{for(let x=D;x<p.length;x++){const B=p[x]=I?le(p[x]):te(p[x]);c(null,B,y,w,F,T,E,U,I)}},ne=(p,y,w,F,T,E,U)=>{const I=y.el=p.el;let{patchFlag:D,dynamicChildren:x,dirs:B}=y;D|=p.patchFlag&16;const L=p.props||it,V=y.props||it;let W;if(w&&ke(w,!1),(W=V.onVnodeBeforeUpdate)&&Qt(W,w,y,p),B&&we(y,p,w,"beforeUpdate"),w&&ke(w,!0),(L.innerHTML&&V.innerHTML==null||L.textContent&&V.textContent==null)&&f(I,""),x?Gt(p.dynamicChildren,x,I,w,F,Tn(y,T),E):U||Q(p,y,I,null,w,F,Tn(y,T),E,!1),D>0){if(D&16)ge(I,L,V,w,T);else if(D&2&&L.class!==V.class&&o(I,"class",null,V.class,T),D&4&&o(I,"style",L.style,V.style,T),D&8){const tt=y.dynamicProps;for(let rt=0;rt<tt.length;rt++){const at=tt[rt],ht=L[at],gt=V[at];(gt!==ht||at==="value")&&o(I,at,ht,gt,T,w)}}D&1&&p.children!==y.children&&f(I,y.children)}else!U&&x==null&&ge(I,L,V,w,T);((W=V.onVnodeUpdated)||B)&&Mt(()=>{W&&Qt(W,w,y,p),B&&we(y,p,w,"updated")},F)},Gt=(p,y,w,F,T,E,U)=>{for(let I=0;I<y.length;I++){const D=p[I],x=y[I],B=D.el&&(D.type===H||!ts(D,x)||D.shapeFlag&198)?v(D.el):w;c(D,x,B,null,F,T,E,U,!0)}},ge=(p,y,w,F,T)=>{if(y!==w){if(y!==it)for(const E in y)!os(E)&&!(E in w)&&o(p,E,y[E],null,T,F);for(const E in w){if(os(E))continue;const U=w[E],I=y[E];U!==I&&E!=="value"&&o(p,E,I,U,T,F)}"value"in w&&o(p,"value",y.value,w.value,T)}},oe=(p,y,w,F,T,E,U,I,D)=>{const x=y.el=p?p.el:a(""),B=y.anchor=p?p.anchor:a("");let{patchFlag:L,dynamicChildren:V,slotScopeIds:W}=y;W&&(I=I?I.concat(W):W),p==null?(i(x,w,F),i(B,w,F),At(y.children||[],w,B,T,E,U,I,D)):L>0&&L&64&&V&&p.dynamicChildren&&p.dynamicChildren.length===V.length?(Gt(p.dynamicChildren,V,w,T,E,U,I),(y.key!=null||T&&y===T.subTree)&&yi(p,y,!0)):Q(p,y,w,B,T,E,U,I,D)},Yt=(p,y,w,F,T,E,U,I,D)=>{y.slotScopeIds=I,p==null?y.shapeFlag&512?T.ctx.activate(y,w,F,U,D):Vt(y,w,F,T,E,U,D):Xe(p,y,D)},Vt=(p,y,w,F,T,E,U)=>{const I=p.component=Ua(p,F,T);if(ei(p)&&(I.ctx.renderer=Re),Na(I,!1,U),I.asyncDep){if(T&&T.registerDep(I,et,U),!p.el){const D=I.subTree=yt(be);q(null,D,y,w),p.placeholder=D.el}}else et(I,p,y,w,T,E,U)},Xe=(p,y,w)=>{const F=y.component=p.component;if(_a(p,y,w))if(F.asyncDep&&!F.asyncResolved){lt(F,y,w);return}else F.next=y,F.update();else y.el=p.el,F.vnode=y},et=(p,y,w,F,T,E,U)=>{const I=()=>{if(p.isMounted){let{next:L,bu:V,u:W,parent:tt,vnode:rt}=p;{const Rt=_i(p);if(Rt){L&&(L.el=rt.el,lt(p,L,U)),Rt.asyncDep.then(()=>{Mt(()=>{p.isUnmounted||x()},T)});return}}let at=L,ht;ke(p,!1),L?(L.el=rt.el,lt(p,L,U)):L=rt,V&&As(V),(ht=L.props&&L.props.onVnodeBeforeUpdate)&&Qt(ht,tt,L,rt),ke(p,!0);const gt=Cn(p),Ht=p.subTree;p.subTree=gt,c(Ht,gt,v(Ht.el),Es(Ht),p,T,E),L.el=gt.el,at===null&&va(p,gt.el),W&&Mt(W,T),(ht=L.props&&L.props.onVnodeUpdated)&&Mt(()=>Qt(ht,tt,L,rt),T)}else{let L;const{el:V,props:W}=y,{bm:tt,m:rt,parent:at,root:ht,type:gt}=p,Ht=as(y);if(ke(p,!1),tt&&As(tt),!Ht&&(L=W&&W.onVnodeBeforeMount)&&Qt(L,at,y),ke(p,!0),V&&pn){const Rt=()=>{p.subTree=Cn(p),pn(V,p.subTree,p,T,null)};Ht&&gt.__asyncHydrate?gt.__asyncHydrate(V,p,Rt):Rt()}else{ht.ce&&ht.ce._hasShadowRoot()&&ht.ce._injectChildStyle(gt,p.parent?p.parent.type:void 0);const Rt=p.subTree=Cn(p);c(null,Rt,w,F,p,T,E),y.el=Rt.el}if(rt&&Mt(rt,T),!Ht&&(L=W&&W.onVnodeMounted)){const Rt=y;Mt(()=>Qt(L,at,Rt),T)}(y.shapeFlag&256||at&&as(at.vnode)&&at.vnode.shapeFlag&256)&&p.a&&Mt(p.a,T),p.isMounted=!0,y=w=F=null}};p.scope.on();const D=p.effect=new Ar(I);p.scope.off();const x=p.update=D.run.bind(D),B=p.job=D.runIfDirty.bind(D);B.i=p,B.id=p.uid,D.scheduler=()=>ro(B),ke(p,!0),x()},lt=(p,y,w)=>{y.component=p;const F=p.vnode.props;p.vnode=y,p.next=null,wa(p,y.props,F,w),Ea(p,y.children,w),fe(),So(p),me()},Q=(p,y,w,F,T,E,U,I,D=!1)=>{const x=p&&p.children,B=p?p.shapeFlag:0,L=y.children,{patchFlag:V,shapeFlag:W}=y;if(V>0){if(V&128){Ae(x,L,w,F,T,E,U,I,D);return}else if(V&256){zt(x,L,w,F,T,E,U,I,D);return}}W&8?(B&16&&Qe(x,T,E),L!==x&&f(w,L)):B&16?W&16?Ae(x,L,w,F,T,E,U,I,D):Qe(x,T,E,!0):(B&8&&f(w,""),W&16&&At(L,w,F,T,E,U,I,D))},zt=(p,y,w,F,T,E,U,I,D)=>{p=p||Le,y=y||Le;const x=p.length,B=y.length,L=Math.min(x,B);let V;for(V=0;V<L;V++){const W=y[V]=D?le(y[V]):te(y[V]);c(p[V],W,w,null,T,E,U,I,D)}x>B?Qe(p,T,E,!0,!1,L):At(y,w,F,T,E,U,I,D,L)},Ae=(p,y,w,F,T,E,U,I,D)=>{let x=0;const B=y.length;let L=p.length-1,V=B-1;for(;x<=L&&x<=V;){const W=p[x],tt=y[x]=D?le(y[x]):te(y[x]);if(ts(W,tt))c(W,tt,w,null,T,E,U,I,D);else break;x++}for(;x<=L&&x<=V;){const W=p[L],tt=y[V]=D?le(y[V]):te(y[V]);if(ts(W,tt))c(W,tt,w,null,T,E,U,I,D);else break;L--,V--}if(x>L){if(x<=V){const W=V+1,tt=W<B?y[W].el:F;for(;x<=V;)c(null,y[x]=D?le(y[x]):te(y[x]),w,tt,T,E,U,I,D),x++}}else if(x>V)for(;x<=L;)vt(p[x],T,E,!0),x++;else{const W=x,tt=x,rt=new Map;for(x=tt;x<=V;x++){const It=y[x]=D?le(y[x]):te(y[x]);It.key!=null&&rt.set(It.key,x)}let at,ht=0;const gt=V-tt+1;let Ht=!1,Rt=0;const Ze=new Array(gt);for(x=0;x<gt;x++)Ze[x]=0;for(x=W;x<=L;x++){const It=p[x];if(ht>=gt){vt(It,T,E,!0);continue}let Xt;if(It.key!=null)Xt=rt.get(It.key);else for(at=tt;at<=V;at++)if(Ze[at-tt]===0&&ts(It,y[at])){Xt=at;break}Xt===void 0?vt(It,T,E,!0):(Ze[Xt-tt]=x+1,Xt>=Rt?Rt=Xt:Ht=!0,c(It,y[Xt],w,null,T,E,U,I,D),ht++)}const wo=Ht?Pa(Ze):Le;for(at=wo.length-1,x=gt-1;x>=0;x--){const It=tt+x,Xt=y[It],ko=y[It+1],Co=It+1<B?ko.el||vi(ko):F;Ze[x]===0?c(null,Xt,w,Co,T,E,U,I,D):Ht&&(at<0||x!==wo[at]?mt(Xt,w,Co,2):at--)}}},mt=(p,y,w,F,T=null)=>{const{el:E,type:U,transition:I,children:D,shapeFlag:x}=p;if(x&6){mt(p.component.subTree,y,w,F);return}if(x&128){p.suspense.move(y,w,F);return}if(x&64){U.move(p,y,w,Re);return}if(U===H){i(E,y,w);for(let L=0;L<D.length;L++)mt(D[L],y,w,F);i(p.anchor,y,w);return}if(U===Ds){J(p,y,w);return}if(F!==2&&x&1&&I)if(F===0)I.beforeEnter(E),i(E,y,w),Mt(()=>I.enter(E),T);else{const{leave:L,delayLeave:V,afterLeave:W}=I,tt=()=>{p.ctx.isUnmounted?n(E):i(E,y,w)},rt=()=>{E._isLeaving&&E[Kl](!0),L(E,()=>{tt(),W&&W()})};V?V(E,tt,rt):rt()}else i(E,y,w)},vt=(p,y,w,F=!1,T=!1)=>{const{type:E,props:U,ref:I,children:D,dynamicChildren:x,shapeFlag:B,patchFlag:L,dirs:V,cacheIndex:W,memo:tt}=p;if(L===-2&&(T=!1),I!=null&&(fe(),ls(I,null,w,p,!0),me()),W!=null&&(y.renderCache[W]=void 0),B&256){y.ctx.deactivate(p);return}const rt=B&1&&V,at=!as(p);let ht;if(at&&(ht=U&&U.onVnodeBeforeUnmount)&&Qt(ht,y,p),B&6)Ts(p.component,w,F);else{if(B&128){p.suspense.unmount(w,F);return}rt&&we(p,null,y,"beforeUnmount"),B&64?p.type.remove(p,y,w,Re,F):x&&!x.hasOnce&&(E!==H||L>0&&L&64)?Qe(x,y,w,!1,!0):(E===H&&L&384||!T&&B&16)&&Qe(D,y,w),F&&Me(p)}const gt=tt!=null&&W==null;(at&&(ht=U&&U.onVnodeUnmounted)||rt||gt)&&Mt(()=>{ht&&Qt(ht,y,p),rt&&we(p,null,y,"unmounted"),gt&&(p.el=null)},w)},Me=p=>{const{type:y,el:w,anchor:F,transition:T}=p;if(y===H){De(w,F);return}if(y===Ds){N(p);return}const E=()=>{n(w),T&&!T.persisted&&T.afterLeave&&T.afterLeave()};if(p.shapeFlag&1&&T&&!T.persisted){const{leave:U,delayLeave:I}=T,D=()=>U(w,E);I?I(p.el,E,D):D()}else E()},De=(p,y)=>{let w;for(;p!==y;)w=_(p),n(p),p=w;n(y)},Ts=(p,y,w)=>{const{bum:F,scope:T,job:E,subTree:U,um:I,m:D,a:x}=p;Lo(D),Lo(x),F&&As(F),T.stop(),E&&(E.flags|=8,vt(U,p,y,w)),I&&Mt(I,y),Mt(()=>{p.isUnmounted=!0},y)},Qe=(p,y,w,F=!1,T=!1,E=0)=>{for(let U=E;U<p.length;U++)vt(p[U],y,w,F,T)},Es=p=>{if(p.shapeFlag&6)return Es(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const y=_(p.anchor||p.el),w=y&&y[Bl];return w?_(w):y};let mn=!1;const bo=(p,y,w)=>{let F;p==null?y._vnode&&(vt(y._vnode,null,null,!0),F=y._vnode.component):c(y._vnode||null,p,y,null,null,null,w),y._vnode=p,mn||(mn=!0,So(F),zr(),mn=!1)},Re={p:c,um:vt,m:mt,r:Me,mt:Vt,mc:At,pc:Q,pbc:Gt,n:Es,o:e};let hn,pn;return t&&([hn,pn]=t(Re)),{render:bo,hydrate:hn,createApp:fa(bo,hn)}}function Tn({type:e,props:t},r){return r==="svg"&&e==="foreignObject"||r==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:r}function ke({effect:e,job:t},r){r?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Sa(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function yi(e,t,r=!1){const i=e.children,n=t.children;if(K(i)&&K(n))for(let o=0;o<i.length;o++){const l=i[o];let a=n[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=n[o]=le(n[o]),a.el=l.el),!r&&a.patchFlag!==-2&&yi(l,a)),a.type===nn&&(a.patchFlag===-1&&(a=n[o]=le(a)),a.el=l.el),a.type===be&&!a.el&&(a.el=l.el)}}function Pa(e){const t=e.slice(),r=[0];let i,n,o,l,a;const d=e.length;for(i=0;i<d;i++){const g=e[i];if(g!==0){if(n=r[r.length-1],e[n]<g){t[i]=n,r.push(i);continue}for(o=0,l=r.length-1;o<l;)a=o+l>>1,e[r[a]]<g?o=a+1:l=a;g<e[r[o]]&&(o>0&&(t[i]=r[o-1]),r[o]=i)}}for(o=r.length,l=r[o-1];o-- >0;)r[o]=l,l=t[l];return r}function _i(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:_i(t)}function Lo(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function vi(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?vi(t.subTree):null}const bi=e=>e.__isSuspense;function Aa(e,t){t&&t.pendingBranch?K(e)?t.effects.push(...e):t.effects.push(e):Ol(e)}const H=Symbol.for("v-fgt"),nn=Symbol.for("v-txt"),be=Symbol.for("v-cmt"),Ds=Symbol.for("v-stc"),us=[];let Ot=null;function m(e=!1){us.push(Ot=e?null:[])}function Ma(){us.pop(),Ot=us[us.length-1]||null}let hs=1;function No(e,t=!1){hs+=e,e<0&&Ot&&t&&(Ot.hasOnce=!0)}function wi(e){return e.dynamicChildren=hs>0?Ot||Le:null,Ma(),hs>0&&Ot&&Ot.push(e),e}function h(e,t,r,i,n,o){return wi(s(e,t,r,i,n,o,!0))}function Ue(e,t,r,i,n){return wi(yt(e,t,r,i,n,!0))}function ki(e){return e?e.__v_isVNode===!0:!1}function ts(e,t){return e.type===t.type&&e.key===t.key}const Ci=({key:e})=>e??null,Rs=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?dt(e)||Pt(e)||Y(e)?{i:jt,r:e,k:t,f:!!r}:e:null);function s(e,t=null,r=null,i=0,n=null,o=e===H?0:1,l=!1,a=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ci(t),ref:t&&Rs(t),scopeId:Qr,slotScopeIds:null,children:r,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:o,patchFlag:i,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:jt};return a?(uo(d,r),o&128&&e.normalize(d)):r&&(d.shapeFlag|=dt(r)?8:16),hs>0&&!l&&Ot&&(d.patchFlag>0||o&6)&&d.patchFlag!==32&&Ot.push(d),d}const yt=Da;function Da(e,t=null,r=null,i=0,n=null,o=!1){if((!e||e===na)&&(e=be),ki(e)){const a=qe(e,t,!0);return r&&uo(a,r),hs>0&&!o&&Ot&&(a.shapeFlag&6?Ot[Ot.indexOf(e)]=a:Ot.push(a)),a.patchFlag=-2,a}if(Ka(e)&&(e=e.__vccOpts),t){t=Ra(t);let{class:a,style:d}=t;a&&!dt(a)&&(t.class=O(a)),ot(d)&&(oo(d)&&!K(d)&&(d=_t({},d)),t.style=Zs(d))}const l=dt(e)?1:bi(e)?128:ql(e)?64:ot(e)?4:Y(e)?2:0;return s(e,t,r,i,n,l,o,!0)}function Ra(e){return e?oo(e)||di(e)?_t({},e):e:null}function qe(e,t,r=!1,i=!1){const{props:n,ref:o,patchFlag:l,children:a,transition:d}=e,g=t?Ia(n||{},t):n,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:g,key:g&&Ci(g),ref:t&&t.ref?r&&o?K(o)?o.concat(Rs(t)):[o,Rs(t)]:Rs(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==H?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&qe(e.ssContent),ssFallback:e.ssFallback&&qe(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return d&&i&&io(f,d.clone(f)),f}function j(e=" ",t=0){return yt(nn,null,e,t)}function Hn(e,t){const r=yt(Ds,null,e);return r.staticCount=t,r}function A(e="",t=!1){return t?(m(),Ue(be,null,e)):yt(be,null,e)}function te(e){return e==null||typeof e=="boolean"?yt(be):K(e)?yt(H,null,e.slice()):ki(e)?le(e):yt(nn,null,String(e))}function le(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:qe(e)}function uo(e,t){let r=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(K(t))r=16;else if(typeof t=="object")if(i&65){const n=t.default;n&&(n._c&&(n._d=!1),uo(e,n()),n._c&&(n._d=!0));return}else{r=32;const n=t._;!n&&!di(t)?t._ctx=jt:n===3&&jt&&(jt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Y(t)?(t={default:t,_ctx:jt},r=32):(t=String(t),i&64?(r=16,t=[j(t)]):r=8);e.children=t,e.shapeFlag|=r}function Ia(...e){const t={};for(let r=0;r<e.length;r++){const i=e[r];for(const n in i)if(n==="class")t.class!==i.class&&(t.class=O([t.class,i.class]));else if(n==="style")t.style=Zs([t.style,i.style]);else if(Js(n)){const o=t[n],l=i[n];l&&o!==l&&!(K(o)&&o.includes(l))?t[n]=o?[].concat(o,l):l:l==null&&o==null&&!Gs(n)&&(t[n]=l)}else n!==""&&(t[n]=i[n])}return t}function Qt(e,t,r,i=null){se(e,t,7,[r,i])}const ja=ii();let Oa=0;function Ua(e,t,r){const i=e.type,n=(t?t.appContext:e.appContext)||ja,o={uid:Oa++,vnode:e,type:i,parent:t,appContext:n,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new il(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(n.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:mi(i,n),emitsOptions:li(i,n),emit:null,emitted:null,propsDefaults:it,inheritAttrs:i.inheritAttrs,ctx:it,data:it,props:it,attrs:it,slots:it,refs:it,setupState:it,setupContext:null,suspense:r,suspenseId:r?r.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 o.ctx={_:o},o.root=t?t.root:o,o.emit=ha.bind(null,o),e.ce&&e.ce(o),o}let Ct=null;const La=()=>Ct||jt;let qs,Bn;{const e=Qs(),t=(r,i)=>{let n;return(n=e[r])||(n=e[r]=[]),n.push(i),o=>{n.length>1?n.forEach(l=>l(o)):n[0](o)}};qs=t("__VUE_INSTANCE_SETTERS__",r=>Ct=r),Bn=t("__VUE_SSR_SETTERS__",r=>ps=r)}const vs=e=>{const t=Ct;return qs(e),e.scope.on(),()=>{e.scope.off(),qs(t)}},Vo=()=>{Ct&&Ct.scope.off(),qs(null)};function Ti(e){return e.vnode.shapeFlag&4}let ps=!1;function Na(e,t=!1,r=!1){t&&Bn(t);const{props:i,children:n}=e.vnode,o=Ti(e);ba(e,i,o,t),Ta(e,n,r||t);const l=o?Va(e,t):void 0;return t&&Bn(!1),l}function Va(e,t){const r=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ra);const{setup:i}=r;if(i){fe();const n=e.setupContext=i.length>1?Ba(e):null,o=vs(e),l=_s(i,e,0,[e.props,n]),a=Cr(l);if(me(),o(),(a||e.sp)&&!as(e)&&ti(e),a){if(l.then(Vo,Vo),t)return l.then(d=>{Ho(e,d,t)}).catch(d=>{tn(d,e,0)});e.asyncDep=l}else Ho(e,l,t)}else Ei(e,t)}function Ho(e,t,r){Y(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ot(t)&&(e.setupState=Wr(t)),Ei(e,r)}let Bo;function Ei(e,t,r){const i=e.type;if(!e.render){if(!t&&Bo&&!i.render){const n=i.template||lo(e).template;if(n){const{isCustomElement:o,compilerOptions:l}=e.appContext.config,{delimiters:a,compilerOptions:d}=i,g=_t(_t({isCustomElement:o,delimiters:a},l),d);i.render=Bo(n,g)}}e.render=i.render||Bt}{const n=vs(e);fe();try{ia(e)}finally{me(),n()}}}const Ha={get(e,t){return kt(e,"get",""),e[t]}};function Ba(e){const t=r=>{e.exposed=r||{}};return{attrs:new Proxy(e.attrs,Ha),slots:e.slots,emit:e.emit,expose:t}}function on(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Wr(Fl(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in cs)return cs[r](e)},has(t,r){return r in t||r in cs}})):e.proxy}function qa(e,t=!0){return Y(e)?e.displayName||e.name:e.name||t&&e.__name}function Ka(e){return Y(e)&&"__vccOpts"in e}const Wa=(e,t)=>Ml(e,t,ps),Ja="3.5.33";/**
  14. * @vue/runtime-dom v3.5.33
  15. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  16. * @license MIT
  17. **/let qn;const qo=typeof window<"u"&&window.trustedTypes;if(qo)try{qn=qo.createPolicy("vue",{createHTML:e=>e})}catch{}const xi=qn?e=>qn.createHTML(e):e=>e,Ga="http://www.w3.org/2000/svg",Ya="http://www.w3.org/1998/Math/MathML",ie=typeof document<"u"?document:null,Ko=ie&&ie.createElement("template"),za={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,i)=>{const n=t==="svg"?ie.createElementNS(Ga,e):t==="mathml"?ie.createElementNS(Ya,e):r?ie.createElement(e,{is:r}):ie.createElement(e);return e==="select"&&i&&i.multiple!=null&&n.setAttribute("multiple",i.multiple),n},createText:e=>ie.createTextNode(e),createComment:e=>ie.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ie.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,i,n,o){const l=r?r.previousSibling:t.lastChild;if(n&&(n===o||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),r),!(n===o||!(n=n.nextSibling)););else{Ko.innerHTML=xi(i==="svg"?`<svg>${e}</svg>`:i==="mathml"?`<math>${e}</math>`:e);const a=Ko.content;if(i==="svg"||i==="mathml"){const d=a.firstChild;for(;d.firstChild;)a.appendChild(d.firstChild);a.removeChild(d)}t.insertBefore(a,r)}return[l?l.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}},Xa=Symbol("_vtc");function Qa(e,t,r){const i=e[Xa];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}const Wo=Symbol("_vod"),Za=Symbol("_vsh"),$a=Symbol(""),tc=/(?:^|;)\s*display\s*:/;function ec(e,t,r){const i=e.style,n=dt(r);let o=!1;if(r&&!n){if(t)if(dt(t))for(const l of t.split(";")){const a=l.slice(0,l.indexOf(":")).trim();r[a]==null&&ns(i,a,"")}else for(const l in t)r[l]==null&&ns(i,l,"");for(const l in r){l==="display"&&(o=!0);const a=r[l];a!=null?nc(e,l,!dt(t)&&t?t[l]:void 0,a)||ns(i,l,a):ns(i,l,"")}}else if(n){if(t!==r){const l=i[$a];l&&(r+=";"+l),i.cssText=r,o=tc.test(r)}}else t&&e.removeAttribute("style");Wo in e&&(e[Wo]=o?i.display:"",e[Za]&&(i.display="none"))}const Jo=/\s*!important$/;function ns(e,t,r){if(K(r))r.forEach(i=>ns(e,t,i));else if(r==null&&(r=""),t.startsWith("--"))e.setProperty(t,r);else{const i=sc(e,t);Jo.test(r)?e.setProperty(Se(i),r.replace(Jo,""),"important"):e[i]=r}}const Go=["Webkit","Moz","ms"],En={};function sc(e,t){const r=En[t];if(r)return r;let i=St(t);if(i!=="filter"&&i in e)return En[t]=i;i=zs(i);for(let n=0;n<Go.length;n++){const o=Go[n]+i;if(o in e)return En[t]=o}return t}function nc(e,t,r,i){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&dt(i)&&r===i}const Yo="http://www.w3.org/1999/xlink";function zo(e,t,r,i,n,o=ol(t)){i&&t.startsWith("xlink:")?r==null?e.removeAttributeNS(Yo,t.slice(6,t.length)):e.setAttributeNS(Yo,t,r):r==null||o&&!Fr(r)?e.removeAttribute(t):e.setAttribute(t,o?"":ee(r)?String(r):r)}function Xo(e,t,r,i,n){if(t==="innerHTML"||t==="textContent"){r!=null&&(e[t]=t==="innerHTML"?xi(r):r);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,d=r==null?e.type==="checkbox"?"on":"":String(r);(a!==d||!("_value"in e))&&(e.value=d),r==null&&e.removeAttribute(t),e._value=r;return}let l=!1;if(r===""||r==null){const a=typeof e[t];a==="boolean"?r=Fr(r):r==null&&a==="string"?(r="",l=!0):a==="number"&&(r=0,l=!0)}try{e[t]=r}catch{}l&&e.removeAttribute(n||t)}function _e(e,t,r,i){e.addEventListener(t,r,i)}function oc(e,t,r,i){e.removeEventListener(t,r,i)}const Qo=Symbol("_vei");function rc(e,t,r,i,n=null){const o=e[Qo]||(e[Qo]={}),l=o[t];if(i&&l)l.value=i;else{const[a,d]=ic(t);if(i){const g=o[t]=cc(i,n);_e(e,a,g,d)}else l&&(oc(e,a,l,d),o[t]=void 0)}}const Zo=/(?:Once|Passive|Capture)$/;function ic(e){let t;if(Zo.test(e)){t={};let i;for(;i=e.match(Zo);)e=e.slice(0,e.length-i[0].length),t[i[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Se(e.slice(2)),t]}let xn=0;const lc=Promise.resolve(),ac=()=>xn||(lc.then(()=>xn=0),xn=Date.now());function cc(e,t){const r=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=r.attached)return;se(uc(i,r.value),t,5,[i])};return r.value=e,r.attached=ac(),r}function uc(e,t){if(K(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map(i=>n=>!n._stopped&&i&&i(n))}else return t}const $o=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,dc=(e,t,r,i,n,o)=>{const l=n==="svg";t==="class"?Qa(e,i,l):t==="style"?ec(e,r,i):Js(t)?Gs(t)||rc(e,t,r,i,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):fc(e,t,i,l))?(Xo(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&zo(e,t,i,l,o,t!=="value")):e._isVueCE&&(mc(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!dt(i)))?Xo(e,St(t),i,o,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),zo(e,t,i,l))};function fc(e,t,r,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&$o(t)&&Y(r));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 n=e.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return $o(t)&&dt(r)?!1:t in e}function mc(e,t){const r=e._def.props;if(!r)return!1;const i=St(t);return Array.isArray(r)?r.some(n=>St(n)===i):Object.keys(r).some(n=>St(n)===i)}const Ke=e=>{const t=e.props["onUpdate:modelValue"]||!1;return K(t)?r=>As(t,r):t};function hc(e){e.target.composing=!0}function tr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const de=Symbol("_assign");function er(e,t,r){return t&&(e=e.trim()),r&&(e=Xs(e)),e}const R={created(e,{modifiers:{lazy:t,trim:r,number:i}},n){e[de]=Ke(n);const o=i||n.props&&n.props.type==="number";_e(e,t?"change":"input",l=>{l.target.composing||e[de](er(e.value,r,o))}),(r||o)&&_e(e,"change",()=>{e.value=er(e.value,r,o)}),t||(_e(e,"compositionstart",hc),_e(e,"compositionend",tr),_e(e,"change",tr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:r,modifiers:{lazy:i,trim:n,number:o}},l){if(e[de]=Ke(l),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Xs(e.value):e.value,d=t??"";if(a===d)return;const g=e.getRootNode();(g instanceof Document||g instanceof ShadowRoot)&&g.activeElement===e&&e.type!=="range"&&(i&&t===r||n&&e.value.trim()===d)||(e.value=d)}},Fn={deep:!0,created(e,t,r){e[de]=Ke(r),_e(e,"change",()=>{const i=e._modelValue,n=gs(e),o=e.checked,l=e[de];if(K(i)){const a=Qn(i,n),d=a!==-1;if(o&&!d)l(i.concat(n));else if(!o&&d){const g=[...i];g.splice(a,1),l(g)}}else if(Je(i)){const a=new Set(i);o?a.add(n):a.delete(n),l(a)}else l(Fi(e,o))})},mounted:sr,beforeUpdate(e,t,r){e[de]=Ke(r),sr(e,t,r)}};function sr(e,{value:t,oldValue:r},i){e._modelValue=t;let n;if(K(t))n=Qn(t,i.props.value)>-1;else if(Je(t))n=t.has(i.props.value);else{if(t===r)return;n=Ge(t,Fi(e,!0))}e.checked!==n&&(e.checked=n)}const ft={deep:!0,created(e,{value:t,modifiers:{number:r}},i){const n=Je(t);_e(e,"change",()=>{const o=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>r?Xs(gs(l)):gs(l));e[de](e.multiple?n?new Set(o):o:o[0]),e._assigning=!0,Gr(()=>{e._assigning=!1})}),e[de]=Ke(i)},mounted(e,{value:t}){nr(e,t)},beforeUpdate(e,t,r){e[de]=Ke(r)},updated(e,{value:t}){e._assigning||nr(e,t)}};function nr(e,t){const r=e.multiple,i=K(t);if(!(r&&!i&&!Je(t))){for(let n=0,o=e.options.length;n<o;n++){const l=e.options[n],a=gs(l);if(r)if(i){const d=typeof a;d==="string"||d==="number"?l.selected=t.some(g=>String(g)===String(a)):l.selected=Qn(t,a)>-1}else l.selected=t.has(a);else if(Ge(gs(l),t)){e.selectedIndex!==n&&(e.selectedIndex=n);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function gs(e){return"_value"in e?e._value:e.value}function Fi(e,t){const r=t?"_trueValue":"_falseValue";return r in e?e[r]:t}const pc=["ctrl","shift","alt","meta"],gc={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)=>pc.some(r=>e[`${r}Key`]&&!t.includes(r))},$=(e,t)=>{if(!e)return e;const r=e._withMods||(e._withMods={}),i=t.join(".");return r[i]||(r[i]=(n,...o)=>{for(let l=0;l<t.length;l++){const a=gc[t[l]];if(a&&a(n,t))return}return e(n,...o)})},yc=_t({patchProp:dc},za);let or;function _c(){return or||(or=xa(yc))}const vc=(...e)=>{const t=_c().createApp(...e),{mount:r}=t;return t.mount=i=>{const n=wc(i);if(!n)return;const o=t._component;!Y(o)&&!o.render&&!o.template&&(o.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const l=r(n,!1,bc(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),l},t};function bc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function wc(e){return dt(e)?document.querySelector(e):e}function Si(e,t){return function(){return e.apply(t,arguments)}}const{toString:kc}=Object.prototype,{getPrototypeOf:rn}=Object,{iterator:ln,toStringTag:Pi}=Symbol,an=(e=>t=>{const r=kc.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Jt=e=>(e=e.toLowerCase(),t=>an(t)===e),cn=e=>t=>typeof t===e,{isArray:Ye}=Array,We=cn("undefined");function bs(e){return e!==null&&!We(e)&&e.constructor!==null&&!We(e.constructor)&&Dt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ai=Jt("ArrayBuffer");function Cc(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ai(e.buffer),t}const Tc=cn("string"),Dt=cn("function"),Mi=cn("number"),ws=e=>e!==null&&typeof e=="object",Ec=e=>e===!0||e===!1,Is=e=>{if(an(e)!=="object")return!1;const t=rn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Pi in e)&&!(ln in e)},xc=e=>{if(!ws(e)||bs(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Fc=Jt("Date"),Sc=Jt("File"),Pc=e=>!!(e&&typeof e.uri<"u"),Ac=e=>e&&typeof e.getParts<"u",Mc=Jt("Blob"),Dc=Jt("FileList"),Rc=e=>ws(e)&&Dt(e.pipe);function Ic(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const rr=Ic(),ir=typeof rr.FormData<"u"?rr.FormData:void 0,jc=e=>{if(!e)return!1;if(ir&&e instanceof ir)return!0;const t=rn(e);if(!t||t===Object.prototype||!Dt(e.append))return!1;const r=an(e);return r==="formdata"||r==="object"&&Dt(e.toString)&&e.toString()==="[object FormData]"},Oc=Jt("URLSearchParams"),[Uc,Lc,Nc,Vc]=["ReadableStream","Request","Response","Headers"].map(Jt),Hc=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ks(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),Ye(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{if(bs(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),l=o.length;let a;for(i=0;i<l;i++)a=o[i],t.call(null,e[a],a,e)}}function Di(e,t){if(bs(e))return null;t=t.toLowerCase();const r=Object.keys(e);let i=r.length,n;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const Te=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ri=e=>!We(e)&&e!==Te;function Kn(){const{caseless:e,skipUndefined:t}=Ri(this)&&this||{},r={},i=(n,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const l=e&&Di(r,o)||o;Is(r[l])&&Is(n)?r[l]=Kn(r[l],n):Is(n)?r[l]=Kn({},n):Ye(n)?r[l]=n.slice():(!t||!We(n))&&(r[l]=n)};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&ks(arguments[n],i);return r}const Bc=(e,t,r,{allOwnKeys:i}={})=>(ks(t,(n,o)=>{r&&Dt(n)?Object.defineProperty(e,o,{value:Si(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),qc=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Kc=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Wc=(e,t,r,i)=>{let n,o,l;const a={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),o=n.length;o-- >0;)l=n[o],(!i||i(l,e,t))&&!a[l]&&(t[l]=e[l],a[l]=!0);e=r!==!1&&rn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Jc=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const i=e.indexOf(t,r);return i!==-1&&i===r},Gc=e=>{if(!e)return null;if(Ye(e))return e;let t=e.length;if(!Mi(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Yc=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&rn(Uint8Array)),zc=(e,t)=>{const i=(e&&e[ln]).call(e);let n;for(;(n=i.next())&&!n.done;){const o=n.value;t.call(e,o[0],o[1])}},Xc=(e,t)=>{let r;const i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},Qc=Jt("HTMLFormElement"),Zc=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),lr=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$c=Jt("RegExp"),Ii=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),i={};ks(r,(n,o)=>{let l;(l=t(n,o,e))!==!1&&(i[o]=l||n)}),Object.defineProperties(e,i)},tu=e=>{Ii(e,(t,r)=>{if(Dt(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const i=e[r];if(Dt(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},eu=(e,t)=>{const r={},i=n=>{n.forEach(o=>{r[o]=!0})};return Ye(e)?i(e):i(String(e).split(t)),r},su=()=>{},nu=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ou(e){return!!(e&&Dt(e.append)&&e[Pi]==="FormData"&&e[ln])}const ru=e=>{const t=new Array(10),r=(i,n)=>{if(ws(i)){if(t.indexOf(i)>=0)return;if(bs(i))return i;if(!("toJSON"in i)){t[n]=i;const o=Ye(i)?[]:{};return ks(i,(l,a)=>{const d=r(l,n+1);!We(d)&&(o[a]=d)}),t[n]=void 0,o}}return i};return r(e,0)},iu=Jt("AsyncFunction"),lu=e=>e&&(ws(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),ji=((e,t)=>e?setImmediate:t?((r,i)=>(Te.addEventListener("message",({source:n,data:o})=>{n===Te&&o===r&&i.length&&i.shift()()},!1),n=>{i.push(n),Te.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Dt(Te.postMessage)),au=typeof queueMicrotask<"u"?queueMicrotask.bind(Te):typeof process<"u"&&process.nextTick||ji,cu=e=>e!=null&&Dt(e[ln]),b={isArray:Ye,isArrayBuffer:Ai,isBuffer:bs,isFormData:jc,isArrayBufferView:Cc,isString:Tc,isNumber:Mi,isBoolean:Ec,isObject:ws,isPlainObject:Is,isEmptyObject:xc,isReadableStream:Uc,isRequest:Lc,isResponse:Nc,isHeaders:Vc,isUndefined:We,isDate:Fc,isFile:Sc,isReactNativeBlob:Pc,isReactNative:Ac,isBlob:Mc,isRegExp:$c,isFunction:Dt,isStream:Rc,isURLSearchParams:Oc,isTypedArray:Yc,isFileList:Dc,forEach:ks,merge:Kn,extend:Bc,trim:Hc,stripBOM:qc,inherits:Kc,toFlatObject:Wc,kindOf:an,kindOfTest:Jt,endsWith:Jc,toArray:Gc,forEachEntry:zc,matchAll:Xc,isHTMLForm:Qc,hasOwnProperty:lr,hasOwnProp:lr,reduceDescriptors:Ii,freezeMethods:tu,toObjectSet:eu,toCamelCase:Zc,noop:su,toFiniteNumber:nu,findKey:Di,global:Te,isContextDefined:Ri,isSpecCompliantForm:ou,toJSONObject:ru,isAsyncFn:iu,isThenable:lu,setImmediate:ji,asap:au,isIterable:cu};class Et extends Error{static from(t,r,i,n,o,l){const a=new Et(t.message,r||t.code,i,n,o);return a.cause=t,a.name=t.name,t.status!=null&&a.status==null&&(a.status=t.status),l&&Object.assign(a,l),a}constructor(t,r,i,n,o){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),i&&(this.config=i),n&&(this.request=n),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:b.toJSONObject(this.config),code:this.code,status:this.status}}}Et.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Et.ERR_BAD_OPTION="ERR_BAD_OPTION";Et.ECONNABORTED="ECONNABORTED";Et.ETIMEDOUT="ETIMEDOUT";Et.ERR_NETWORK="ERR_NETWORK";Et.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Et.ERR_DEPRECATED="ERR_DEPRECATED";Et.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Et.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Et.ERR_CANCELED="ERR_CANCELED";Et.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Et.ERR_INVALID_URL="ERR_INVALID_URL";Et.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const X=Et,uu=null;function Wn(e){return b.isPlainObject(e)||b.isArray(e)}function Oi(e){return b.endsWith(e,"[]")?e.slice(0,-2):e}function Sn(e,t,r){return e?e.concat(t).map(function(n,o){return n=Oi(n),!r&&o?"["+n+"]":n}).join(r?".":""):t}function du(e){return b.isArray(e)&&!e.some(Wn)}const fu=b.toFlatObject(b,{},null,function(t){return/^is[A-Z]/.test(t)});function un(e,t,r){if(!b.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=b.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,q){return!b.isUndefined(q[k])});const i=r.metaTokens,n=r.visitor||v,o=r.dots,l=r.indexes,a=r.Blob||typeof Blob<"u"&&Blob,d=r.maxDepth===void 0?100:r.maxDepth,g=a&&b.isSpecCompliantForm(t);if(!b.isFunction(n))throw new TypeError("visitor must be a function");function f(c){if(c===null)return"";if(b.isDate(c))return c.toISOString();if(b.isBoolean(c))return c.toString();if(!g&&b.isBlob(c))throw new X("Blob is not supported. Use a Buffer instead.");return b.isArrayBuffer(c)||b.isTypedArray(c)?g&&typeof Blob=="function"?new Blob([c]):Buffer.from(c):c}function v(c,k,q){let G=c;if(b.isReactNative(t)&&b.isReactNativeBlob(c))return t.append(Sn(q,k,o),f(c)),!1;if(c&&!q&&typeof c=="object"){if(b.endsWith(k,"{}"))k=i?k:k.slice(0,-2),c=JSON.stringify(c);else if(b.isArray(c)&&du(c)||(b.isFileList(c)||b.endsWith(k,"[]"))&&(G=b.toArray(c)))return k=Oi(k),G.forEach(function(N,Z){!(b.isUndefined(N)||N===null)&&t.append(l===!0?Sn([k],Z,o):l===null?k:k+"[]",f(N))}),!1}return Wn(c)?!0:(t.append(Sn(q,k,o),f(c)),!1)}const _=[],P=Object.assign(fu,{defaultVisitor:v,convertValue:f,isVisitable:Wn});function S(c,k,q=0){if(!b.isUndefined(c)){if(q>d)throw new X("Object is too deeply nested ("+q+" levels). Max depth: "+d,X.ERR_FORM_DATA_DEPTH_EXCEEDED);if(_.indexOf(c)!==-1)throw Error("Circular reference detected in "+k.join("."));_.push(c),b.forEach(c,function(J,N){(!(b.isUndefined(J)||J===null)&&n.call(t,J,b.isString(N)?N.trim():N,k,P))===!0&&S(J,k?k.concat(N):[N],q+1)}),_.pop()}}if(!b.isObject(e))throw new TypeError("data must be an object");return S(e),t}function ar(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(i){return t[i]})}function fo(e,t){this._pairs=[],e&&un(e,this,t)}const Ui=fo.prototype;Ui.append=function(t,r){this._pairs.push([t,r])};Ui.toString=function(t){const r=t?function(i){return t.call(this,i,ar)}:ar;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};function mu(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Li(e,t,r){if(!t)return e;const i=r&&r.encode||mu,n=b.isFunction(r)?{serialize:r}:r,o=n&&n.serialize;let l;if(o?l=o(t,n):l=b.isURLSearchParams(t)?t.toString():new fo(t,n).toString(i),l){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class hu{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){b.forEach(this.handlers,function(i){i!==null&&t(i)})}}const cr=hu,mo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},pu=typeof URLSearchParams<"u"?URLSearchParams:fo,gu=typeof FormData<"u"?FormData:null,yu=typeof Blob<"u"?Blob:null,_u={isBrowser:!0,classes:{URLSearchParams:pu,FormData:gu,Blob:yu},protocols:["http","https","file","blob","url","data"]},ho=typeof window<"u"&&typeof document<"u",Jn=typeof navigator=="object"&&navigator||void 0,vu=ho&&(!Jn||["ReactNative","NativeScript","NS"].indexOf(Jn.product)<0),bu=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),wu=ho&&window.location.href||"http://localhost",ku=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ho,hasStandardBrowserEnv:vu,hasStandardBrowserWebWorkerEnv:bu,navigator:Jn,origin:wu},Symbol.toStringTag,{value:"Module"})),Tt={...ku,..._u};function Cu(e,t){return un(e,new Tt.classes.URLSearchParams,{visitor:function(r,i,n,o){return Tt.isNode&&b.isBuffer(r)?(this.append(i,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Tu(e){return b.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Eu(e){const t={},r=Object.keys(e);let i;const n=r.length;let o;for(i=0;i<n;i++)o=r[i],t[o]=e[o];return t}function Ni(e){function t(r,i,n,o){let l=r[o++];if(l==="__proto__")return!0;const a=Number.isFinite(+l),d=o>=r.length;return l=!l&&b.isArray(n)?n.length:l,d?(b.hasOwnProp(n,l)?n[l]=b.isArray(n[l])?n[l].concat(i):[n[l],i]:n[l]=i,!a):((!n[l]||!b.isObject(n[l]))&&(n[l]=[]),t(r,i,n[l],o)&&b.isArray(n[l])&&(n[l]=Eu(n[l])),!a)}if(b.isFormData(e)&&b.isFunction(e.entries)){const r={};return b.forEachEntry(e,(i,n)=>{t(Tu(i),n,r,0)}),r}return null}const je=(e,t)=>e!=null&&b.hasOwnProp(e,t)?e[t]:void 0;function xu(e,t,r){if(b.isString(e))try{return(t||JSON.parse)(e),b.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}const po={transitional:mo,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const i=r.getContentType()||"",n=i.indexOf("application/json")>-1,o=b.isObject(t);if(o&&b.isHTMLForm(t)&&(t=new FormData(t)),b.isFormData(t))return n?JSON.stringify(Ni(t)):t;if(b.isArrayBuffer(t)||b.isBuffer(t)||b.isStream(t)||b.isFile(t)||b.isBlob(t)||b.isReadableStream(t))return t;if(b.isArrayBufferView(t))return t.buffer;if(b.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){const d=je(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return Cu(t,d).toString();if((a=b.isFileList(t))||i.indexOf("multipart/form-data")>-1){const g=je(this,"env"),f=g&&g.FormData;return un(a?{"files[]":t}:t,f&&new f,d)}}return o||n?(r.setContentType("application/json",!1),xu(t)):t}],transformResponse:[function(t){const r=je(this,"transitional")||po.transitional,i=r&&r.forcedJSONParsing,n=je(this,"responseType"),o=n==="json";if(b.isResponse(t)||b.isReadableStream(t))return t;if(t&&b.isString(t)&&(i&&!n||o)){const a=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,je(this,"parseReviver"))}catch(d){if(a)throw d.name==="SyntaxError"?X.from(d,X.ERR_BAD_RESPONSE,this,null,je(this,"response")):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Tt.classes.FormData,Blob:Tt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};b.forEach(["delete","get","head","post","put","patch"],e=>{po.headers[e]={}});const go=po,Fu=b.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Su=e=>{const t={};let r,i,n;return e&&e.split(`
  18. `).forEach(function(l){n=l.indexOf(":"),r=l.substring(0,n).trim().toLowerCase(),i=l.substring(n+1).trim(),!(!r||t[r]&&Fu[r])&&(r==="set-cookie"?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t},ur=Symbol("internals"),Pu=/[^\x09\x20-\x7E\x80-\xFF]/g;function Au(e){let t=0,r=e.length;for(;t<r;){const i=e.charCodeAt(t);if(i!==9&&i!==32)break;t+=1}for(;r>t;){const i=e.charCodeAt(r-1);if(i!==9&&i!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function es(e){return e&&String(e).trim().toLowerCase()}function Mu(e){return Au(e.replace(Pu,""))}function js(e){return e===!1||e==null?e:b.isArray(e)?e.map(js):Mu(String(e))}function Du(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}const Ru=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Pn(e,t,r,i,n){if(b.isFunction(i))return i.call(this,t,r);if(n&&(t=r),!!b.isString(t)){if(b.isString(i))return t.indexOf(i)!==-1;if(b.isRegExp(i))return i.test(t)}}function Iu(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,i)=>r.toUpperCase()+i)}function ju(e,t){const r=b.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(n,o,l){return this[i].call(this,t,n,o,l)},configurable:!0})})}class dn{constructor(t){t&&this.set(t)}set(t,r,i){const n=this;function o(a,d,g){const f=es(d);if(!f)throw new Error("header name must be a non-empty string");const v=b.findKey(n,f);(!v||n[v]===void 0||g===!0||g===void 0&&n[v]!==!1)&&(n[v||d]=js(a))}const l=(a,d)=>b.forEach(a,(g,f)=>o(g,f,d));if(b.isPlainObject(t)||t instanceof this.constructor)l(t,r);else if(b.isString(t)&&(t=t.trim())&&!Ru(t))l(Su(t),r);else if(b.isObject(t)&&b.isIterable(t)){let a={},d,g;for(const f of t){if(!b.isArray(f))throw TypeError("Object iterator must return a key-value pair");a[g=f[0]]=(d=a[g])?b.isArray(d)?[...d,f[1]]:[d,f[1]]:f[1]}l(a,r)}else t!=null&&o(r,t,i);return this}get(t,r){if(t=es(t),t){const i=b.findKey(this,t);if(i){const n=this[i];if(!r)return n;if(r===!0)return Du(n);if(b.isFunction(r))return r.call(this,n,i);if(b.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=es(t),t){const i=b.findKey(this,t);return!!(i&&this[i]!==void 0&&(!r||Pn(this,this[i],i,r)))}return!1}delete(t,r){const i=this;let n=!1;function o(l){if(l=es(l),l){const a=b.findKey(i,l);a&&(!r||Pn(i,i[a],a,r))&&(delete i[a],n=!0)}}return b.isArray(t)?t.forEach(o):o(t),n}clear(t){const r=Object.keys(this);let i=r.length,n=!1;for(;i--;){const o=r[i];(!t||Pn(this,this[o],o,t,!0))&&(delete this[o],n=!0)}return n}normalize(t){const r=this,i={};return b.forEach(this,(n,o)=>{const l=b.findKey(i,o);if(l){r[l]=js(n),delete r[o];return}const a=t?Iu(o):String(o).trim();a!==o&&delete r[o],r[a]=js(n),i[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return b.forEach(this,(i,n)=>{i!=null&&i!==!1&&(r[n]=t&&b.isArray(i)?i.join(", "):i)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
  19. `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const i=new this(t);return r.forEach(n=>i.set(n)),i}static accessor(t){const i=(this[ur]=this[ur]={accessors:{}}).accessors,n=this.prototype;function o(l){const a=es(l);i[a]||(ju(n,l),i[a]=!0)}return b.isArray(t)?t.forEach(o):o(t),this}}dn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);b.reduceDescriptors(dn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[r]=i}}});b.freezeMethods(dn);const Wt=dn;function An(e,t){const r=this||go,i=t||r,n=Wt.from(i.headers);let o=i.data;return b.forEach(e,function(a){o=a.call(r,o,n.normalize(),t?t.status:void 0)}),n.normalize(),o}function Vi(e){return!!(e&&e.__CANCEL__)}class Ou extends X{constructor(t,r,i){super(t??"canceled",X.ERR_CANCELED,r,i),this.name="CanceledError",this.__CANCEL__=!0}}const Cs=Ou;function Hi(e,t,r){const i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new X("Request failed with status code "+r.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Uu(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Lu(e,t){e=e||10;const r=new Array(e),i=new Array(e);let n=0,o=0,l;return t=t!==void 0?t:1e3,function(d){const g=Date.now(),f=i[o];l||(l=g),r[n]=d,i[n]=g;let v=o,_=0;for(;v!==n;)_+=r[v++],v=v%e;if(n=(n+1)%e,n===o&&(o=(o+1)%e),g-l<t)return;const P=f&&g-f;return P?Math.round(_*1e3/P):void 0}}function Nu(e,t){let r=0,i=1e3/t,n,o;const l=(g,f=Date.now())=>{r=f,n=null,o&&(clearTimeout(o),o=null),e(...g)};return[(...g)=>{const f=Date.now(),v=f-r;v>=i?l(g,f):(n=g,o||(o=setTimeout(()=>{o=null,l(n)},i-v)))},()=>n&&l(n)]}const Ks=(e,t,r=3)=>{let i=0;const n=Lu(50,250);return Nu(o=>{const l=o.loaded,a=o.lengthComputable?o.total:void 0,d=a!=null?Math.min(l,a):l,g=Math.max(0,d-i),f=n(g);i=Math.max(i,d);const v={loaded:d,total:a,progress:a?d/a:void 0,bytes:g,rate:f||void 0,estimated:f&&a?(a-d)/f:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(v)},r)},dr=(e,t)=>{const r=e!=null;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},fr=e=>(...t)=>b.asap(()=>e(...t)),Vu=Tt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Tt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Tt.origin),Tt.navigator&&/(msie|trident)/i.test(Tt.navigator.userAgent)):()=>!0,Hu=Tt.hasStandardBrowserEnv?{write(e,t,r,i,n,o,l){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];b.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),b.isString(i)&&a.push(`path=${i}`),b.isString(n)&&a.push(`domain=${n}`),o===!0&&a.push("secure"),b.isString(l)&&a.push(`SameSite=${l}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Bu(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qu(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Bi(e,t,r){let i=!Bu(t);return e&&(i||r===!1)?qu(e,t):t}const mr=e=>e instanceof Wt?{...e}:e;function Fe(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(g,f,v,_){return b.isPlainObject(g)&&b.isPlainObject(f)?b.merge.call({caseless:_},g,f):b.isPlainObject(f)?b.merge({},f):b.isArray(f)?f.slice():f}function n(g,f,v,_){if(b.isUndefined(f)){if(!b.isUndefined(g))return i(void 0,g,v,_)}else return i(g,f,v,_)}function o(g,f){if(!b.isUndefined(f))return i(void 0,f)}function l(g,f){if(b.isUndefined(f)){if(!b.isUndefined(g))return i(void 0,g)}else return i(void 0,f)}function a(g,f,v){if(b.hasOwnProp(t,v))return i(g,f);if(b.hasOwnProp(e,v))return i(void 0,g)}const d={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,allowedSocketPaths:l,responseEncoding:l,validateStatus:a,headers:(g,f,v)=>n(mr(g),mr(f),v,!0)};return b.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const v=b.hasOwnProp(d,f)?d[f]:n,_=b.hasOwnProp(e,f)?e[f]:void 0,P=b.hasOwnProp(t,f)?t[f]:void 0,S=v(_,P,f);b.isUndefined(S)&&v!==a||(r[f]=S)}),r}const qi=e=>{const t=Fe({},e),r=_=>b.hasOwnProp(t,_)?t[_]:void 0,i=r("data");let n=r("withXSRFToken");const o=r("xsrfHeaderName"),l=r("xsrfCookieName");let a=r("headers");const d=r("auth"),g=r("baseURL"),f=r("allowAbsoluteUrls"),v=r("url");if(t.headers=a=Wt.from(a),t.url=Li(Bi(g,v,f),e.params,e.paramsSerializer),d&&a.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),b.isFormData(i)){if(Tt.hasStandardBrowserEnv||Tt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(b.isFunction(i.getHeaders)){const _=i.getHeaders(),P=["content-type","content-length"];Object.entries(_).forEach(([S,c])=>{P.includes(S.toLowerCase())&&a.set(S,c)})}}if(Tt.hasStandardBrowserEnv&&(b.isFunction(n)&&(n=n(t)),n===!0||n==null&&Vu(t.url))){const P=o&&l&&Hu.read(l);P&&a.set(o,P)}return t},Ku=typeof XMLHttpRequest<"u",Wu=Ku&&function(e){return new Promise(function(r,i){const n=qi(e);let o=n.data;const l=Wt.from(n.headers).normalize();let{responseType:a,onUploadProgress:d,onDownloadProgress:g}=n,f,v,_,P,S;function c(){P&&P(),S&&S(),n.cancelToken&&n.cancelToken.unsubscribe(f),n.signal&&n.signal.removeEventListener("abort",f)}let k=new XMLHttpRequest;k.open(n.method.toUpperCase(),n.url,!0),k.timeout=n.timeout;function q(){if(!k)return;const J=Wt.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),Z={data:!a||a==="text"||a==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:J,config:e,request:k};Hi(function(ut){r(ut),c()},function(ut){i(ut),c()},Z),k=null}"onloadend"in k?k.onloadend=q:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(q)},k.onabort=function(){k&&(i(new X("Request aborted",X.ECONNABORTED,e,k)),k=null)},k.onerror=function(N){const Z=N&&N.message?N.message:"Network Error",bt=new X(Z,X.ERR_NETWORK,e,k);bt.event=N||null,i(bt),k=null},k.ontimeout=function(){let N=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const Z=n.transitional||mo;n.timeoutErrorMessage&&(N=n.timeoutErrorMessage),i(new X(N,Z.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,e,k)),k=null},o===void 0&&l.setContentType(null),"setRequestHeader"in k&&b.forEach(l.toJSON(),function(N,Z){k.setRequestHeader(Z,N)}),b.isUndefined(n.withCredentials)||(k.withCredentials=!!n.withCredentials),a&&a!=="json"&&(k.responseType=n.responseType),g&&([_,S]=Ks(g,!0),k.addEventListener("progress",_)),d&&k.upload&&([v,P]=Ks(d),k.upload.addEventListener("progress",v),k.upload.addEventListener("loadend",P)),(n.cancelToken||n.signal)&&(f=J=>{k&&(i(!J||J.type?new Cs(null,e,k):J),k.abort(),k=null)},n.cancelToken&&n.cancelToken.subscribe(f),n.signal&&(n.signal.aborted?f():n.signal.addEventListener("abort",f)));const G=Uu(n.url);if(G&&Tt.protocols.indexOf(G)===-1){i(new X("Unsupported protocol "+G+":",X.ERR_BAD_REQUEST,e));return}k.send(o||null)})},Ju=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let i=new AbortController,n;const o=function(g){if(!n){n=!0,a();const f=g instanceof Error?g:this.reason;i.abort(f instanceof X?f:new Cs(f instanceof Error?f.message:f))}};let l=t&&setTimeout(()=>{l=null,o(new X(`timeout of ${t}ms exceeded`,X.ETIMEDOUT))},t);const a=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(g=>{g.unsubscribe?g.unsubscribe(o):g.removeEventListener("abort",o)}),e=null)};e.forEach(g=>g.addEventListener("abort",o));const{signal:d}=i;return d.unsubscribe=()=>b.asap(a),d}},Gu=Ju,Yu=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let i=0,n;for(;i<r;)n=i+t,yield e.slice(i,n),i=n},zu=async function*(e,t){for await(const r of Xu(e))yield*Yu(r,t)},Xu=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:i}=await t.read();if(r)break;yield i}}finally{await t.cancel()}},hr=(e,t,r,i)=>{const n=zu(e,t);let o=0,l,a=d=>{l||(l=!0,i&&i(d))};return new ReadableStream({async pull(d){try{const{done:g,value:f}=await n.next();if(g){a(),d.close();return}let v=f.byteLength;if(r){let _=o+=v;r(_)}d.enqueue(new Uint8Array(f))}catch(g){throw a(g),g}},cancel(d){return a(d),n.return()}},{highWaterMark:2})},pr=64*1024,{isFunction:Ps}=b,Qu=(({Request:e,Response:t})=>({Request:e,Response:t}))(b.global),{ReadableStream:gr,TextEncoder:yr}=b.global,_r=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Zu=e=>{e=b.merge.call({skipUndefined:!0},Qu,e);const{fetch:t,Request:r,Response:i}=e,n=t?Ps(t):typeof fetch=="function",o=Ps(r),l=Ps(i);if(!n)return!1;const a=n&&Ps(gr),d=n&&(typeof yr=="function"?(S=>c=>S.encode(c))(new yr):async S=>new Uint8Array(await new r(S).arrayBuffer())),g=o&&a&&_r(()=>{let S=!1;const c=new r(Tt.origin,{body:new gr,method:"POST",get duplex(){return S=!0,"half"}}),k=c.headers.has("Content-Type");return c.body!=null&&c.body.cancel(),S&&!k}),f=l&&a&&_r(()=>b.isReadableStream(new i("").body)),v={stream:f&&(S=>S.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!v[S]&&(v[S]=(c,k)=>{let q=c&&c[S];if(q)return q.call(c);throw new X(`Response type '${S}' is not supported`,X.ERR_NOT_SUPPORT,k)})});const _=async S=>{if(S==null)return 0;if(b.isBlob(S))return S.size;if(b.isSpecCompliantForm(S))return(await new r(Tt.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(b.isArrayBufferView(S)||b.isArrayBuffer(S))return S.byteLength;if(b.isURLSearchParams(S)&&(S=S+""),b.isString(S))return(await d(S)).byteLength},P=async(S,c)=>{const k=b.toFiniteNumber(S.getContentLength());return k??_(c)};return async S=>{let{url:c,method:k,data:q,signal:G,cancelToken:J,timeout:N,onDownloadProgress:Z,onUploadProgress:bt,responseType:ut,headers:At,withCredentials:ne="same-origin",fetchOptions:Gt}=qi(S),ge=t||fetch;ut=ut?(ut+"").toLowerCase():"text";let oe=Gu([G,J&&J.toAbortSignal()],N),Yt=null;const Vt=oe&&oe.unsubscribe&&(()=>{oe.unsubscribe()});let Xe;try{if(bt&&g&&k!=="get"&&k!=="head"&&(Xe=await P(At,q))!==0){let mt=new r(c,{method:"POST",body:q,duplex:"half"}),vt;if(b.isFormData(q)&&(vt=mt.headers.get("content-type"))&&At.setContentType(vt),mt.body){const[Me,De]=dr(Xe,Ks(fr(bt)));q=hr(mt.body,pr,Me,De)}}b.isString(ne)||(ne=ne?"include":"omit");const et=o&&"credentials"in r.prototype;if(b.isFormData(q)){const mt=At.getContentType();mt&&/^multipart\/form-data/i.test(mt)&&!/boundary=/i.test(mt)&&At.delete("content-type")}const lt={...Gt,signal:oe,method:k.toUpperCase(),headers:At.normalize().toJSON(),body:q,duplex:"half",credentials:et?ne:void 0};Yt=o&&new r(c,lt);let Q=await(o?ge(Yt,Gt):ge(c,lt));const zt=f&&(ut==="stream"||ut==="response");if(f&&(Z||zt&&Vt)){const mt={};["status","statusText","headers"].forEach(Ts=>{mt[Ts]=Q[Ts]});const vt=b.toFiniteNumber(Q.headers.get("content-length")),[Me,De]=Z&&dr(vt,Ks(fr(Z),!0))||[];Q=new i(hr(Q.body,pr,Me,()=>{De&&De(),Vt&&Vt()}),mt)}ut=ut||"text";let Ae=await v[b.findKey(v,ut)||"text"](Q,S);return!zt&&Vt&&Vt(),await new Promise((mt,vt)=>{Hi(mt,vt,{data:Ae,headers:Wt.from(Q.headers),status:Q.status,statusText:Q.statusText,config:S,request:Yt})})}catch(et){throw Vt&&Vt(),et&&et.name==="TypeError"&&/Load failed|fetch/i.test(et.message)?Object.assign(new X("Network Error",X.ERR_NETWORK,S,Yt,et&&et.response),{cause:et.cause||et}):X.from(et,et&&et.code,S,Yt,et&&et.response)}}},$u=new Map,Ki=e=>{let t=e&&e.env||{};const{fetch:r,Request:i,Response:n}=t,o=[i,n,r];let l=o.length,a=l,d,g,f=$u;for(;a--;)d=o[a],g=f.get(d),g===void 0&&f.set(d,g=a?new Map:Zu(t)),f=g;return g};Ki();const yo={http:uu,xhr:Wu,fetch:{get:Ki}};b.forEach(yo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const vr=e=>`- ${e}`,td=e=>b.isFunction(e)||e===null||e===!1;function ed(e,t){e=b.isArray(e)?e:[e];const{length:r}=e;let i,n;const o={};for(let l=0;l<r;l++){i=e[l];let a;if(n=i,!td(i)&&(n=yo[(a=String(i)).toLowerCase()],n===void 0))throw new X(`Unknown adapter '${a}'`);if(n&&(b.isFunction(n)||(n=n.get(t))))break;o[a||"#"+l]=n}if(!n){const l=Object.entries(o).map(([d,g])=>`adapter ${d} `+(g===!1?"is not supported by the environment":"is not available in the build"));let a=r?l.length>1?`since :
  20. `+l.map(vr).join(`
  21. `):" "+vr(l[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n}const Wi={getAdapter:ed,adapters:yo};function Mn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Cs(null,e)}function br(e){return Mn(e),e.headers=Wt.from(e.headers),e.data=An.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Wi.getAdapter(e.adapter||go.adapter,e)(e).then(function(i){return Mn(e),i.data=An.call(e,e.transformResponse,i),i.headers=Wt.from(i.headers),i},function(i){return Vi(i)||(Mn(e),i&&i.response&&(i.response.data=An.call(e,e.transformResponse,i.response),i.response.headers=Wt.from(i.response.headers))),Promise.reject(i)})}const Ji="1.15.2",fn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{fn[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const wr={};fn.transitional=function(t,r,i){function n(o,l){return"[Axios v"+Ji+"] Transitional option '"+o+"'"+l+(i?". "+i:"")}return(o,l,a)=>{if(t===!1)throw new X(n(l," has been removed"+(r?" in "+r:"")),X.ERR_DEPRECATED);return r&&!wr[l]&&(wr[l]=!0,console.warn(n(l," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,l,a):!0}};fn.spelling=function(t){return(r,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function sd(e,t,r){if(typeof e!="object")throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let n=i.length;for(;n-- >0;){const o=i[n],l=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(l){const a=e[o],d=a===void 0||l(a,o,e);if(d!==!0)throw new X("option "+o+" must be "+d,X.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new X("Unknown option "+o,X.ERR_BAD_OPTION)}}const Os={assertOptions:sd,validators:fn},Ut=Os.validators;class Ws{constructor(t){this.defaults=t||{},this.interceptors={request:new cr,response:new cr}}async request(t,r){try{return await this._request(t,r)}catch(i){if(i instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const o=(()=>{if(!n.stack)return"";const l=n.stack.indexOf(`
  22. `);return l===-1?"":n.stack.slice(l+1)})();try{if(!i.stack)i.stack=o;else if(o){const l=o.indexOf(`
  23. `),a=l===-1?-1:o.indexOf(`
  24. `,l+1),d=a===-1?"":o.slice(a+1);String(i.stack).endsWith(d)||(i.stack+=`
  25. `+o)}}catch{}}throw i}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Fe(this.defaults,r);const{transitional:i,paramsSerializer:n,headers:o}=r;i!==void 0&&Os.assertOptions(i,{silentJSONParsing:Ut.transitional(Ut.boolean),forcedJSONParsing:Ut.transitional(Ut.boolean),clarifyTimeoutError:Ut.transitional(Ut.boolean),legacyInterceptorReqResOrdering:Ut.transitional(Ut.boolean)},!1),n!=null&&(b.isFunction(n)?r.paramsSerializer={serialize:n}:Os.assertOptions(n,{encode:Ut.function,serialize:Ut.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Os.assertOptions(r,{baseUrl:Ut.spelling("baseURL"),withXsrfToken:Ut.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let l=o&&b.merge(o.common,o[r.method]);o&&b.forEach(["delete","get","head","post","put","patch","common"],S=>{delete o[S]}),r.headers=Wt.concat(l,o);const a=[];let d=!0;this.interceptors.request.forEach(function(c){if(typeof c.runWhen=="function"&&c.runWhen(r)===!1)return;d=d&&c.synchronous;const k=r.transitional||mo;k&&k.legacyInterceptorReqResOrdering?a.unshift(c.fulfilled,c.rejected):a.push(c.fulfilled,c.rejected)});const g=[];this.interceptors.response.forEach(function(c){g.push(c.fulfilled,c.rejected)});let f,v=0,_;if(!d){const S=[br.bind(this),void 0];for(S.unshift(...a),S.push(...g),_=S.length,f=Promise.resolve(r);v<_;)f=f.then(S[v++],S[v++]);return f}_=a.length;let P=r;for(;v<_;){const S=a[v++],c=a[v++];try{P=S(P)}catch(k){c.call(this,k);break}}try{f=br.call(this,P)}catch(S){return Promise.reject(S)}for(v=0,_=g.length;v<_;)f=f.then(g[v++],g[v++]);return f}getUri(t){t=Fe(this.defaults,t);const r=Bi(t.baseURL,t.url,t.allowAbsoluteUrls);return Li(r,t.params,t.paramsSerializer)}}b.forEach(["delete","get","head","options"],function(t){Ws.prototype[t]=function(r,i){return this.request(Fe(i||{},{method:t,url:r,data:(i||{}).data}))}});b.forEach(["post","put","patch"],function(t){function r(i){return function(o,l,a){return this.request(Fe(a||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:l}))}}Ws.prototype[t]=r(),Ws.prototype[t+"Form"]=r(!0)});const Us=Ws;class _o{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const i=this;this.promise.then(n=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o;const l=new Promise(a=>{i.subscribe(a),o=a}).then(n);return l.cancel=function(){i.unsubscribe(o)},l},t(function(o,l,a){i.reason||(i.reason=new Cs(o,l,a),r(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=i=>{t.abort(i)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new _o(function(n){t=n}),cancel:t}}}const nd=_o;function od(e){return function(r){return e.apply(null,r)}}function rd(e){return b.isObject(e)&&e.isAxiosError===!0}const Gn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Gn).forEach(([e,t])=>{Gn[t]=e});const id=Gn;function Gi(e){const t=new Us(e),r=Si(Us.prototype.request,t);return b.extend(r,Us.prototype,t,{allOwnKeys:!0}),b.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return Gi(Fe(e,n))},r}const pt=Gi(go);pt.Axios=Us;pt.CanceledError=Cs;pt.CancelToken=nd;pt.isCancel=Vi;pt.VERSION=Ji;pt.toFormData=un;pt.AxiosError=X;pt.Cancel=pt.CanceledError;pt.all=function(t){return Promise.all(t)};pt.spread=od;pt.isAxiosError=rd;pt.mergeConfig=Fe;pt.AxiosHeaders=Wt;pt.formToJSON=e=>Ni(b.isHTMLForm(e)?new FormData(e):e);pt.getAdapter=Wi.getAdapter;pt.HttpStatusCode=id;pt.default=pt;const ld=pt,M=ld.create({baseURL:{}.VUE_APP_API_URL||"/api",timeout:1e4,headers:{"Content-Type":"application/json"}});M.interceptors.response.use(e=>e,e=>(e.response&&e.response.status===401&&!e.config.url.includes("/auth.php?action=status")&&console.error("API Error:",e),e.response&&e.response.status===401&&(localStorage.removeItem("authToken"),sessionStorage.removeItem("currentUser"),window.dispatchEvent(new CustomEvent("auth-expired",{detail:{message:"Session expired. Please login again."}}))),Promise.reject(e)));const ze=e=>e?new Date(e).toLocaleDateString("fi-FI",{year:"numeric",month:"2-digit",day:"2-digit"}).replace(/\./g,"."):"-",vo=e=>e?new Date(e).toLocaleString("fi-FI",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).replace(/\./g,"."):"-",Pe=e=>{if(e==null)return"0,00 €";const t=parseFloat(e);return isNaN(t)?"0,00 €":new Intl.NumberFormat("fi-FI",{style:"currency",currency:"EUR",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)};const Nt=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},ad={name:"TimerManagement",data(){return{showModal:!1,showEditModal:!1,activeTab:"active",loading:!1,activeTimers:[],timerHistory:[],workHours:[],tasks:[],historyFilter:{date:"",task_id:""},workHoursFilter:{date:"",task_id:""},editForm:{id:null,description:"",task_id:""}}},mounted(){this.loadTasks()},methods:{showManagementModal(){this.showModal=!0,this.loadAllData()},closeModal(){this.showModal=!1},closeEditModal(){this.showEditModal=!1,this.editForm={id:null,description:"",task_id:""}},async loadAllData(){await Promise.all([this.loadActiveTimers(),this.loadTimerHistory(),this.loadWorkHours()])},async loadActiveTimers(){try{this.loading=!0;const e=await M.get("/api/timers.php?action=active");e.data.success&&(this.activeTimers=e.data.data||[])}catch(e){console.error("Error loading active timers:",e)}finally{this.loading=!1}},async loadTimerHistory(){try{this.loading=!0;const e=new URLSearchParams;this.historyFilter.date&&e.append("date",this.historyFilter.date),this.historyFilter.task_id&&e.append("task_id",this.historyFilter.task_id);const t=await M.get(`/api/timers.php?action=list&${e}`);t.data.success&&(this.timerHistory=t.data.data||[])}catch(e){console.error("Error loading timer history:",e)}finally{this.loading=!1}},async loadWorkHours(){try{this.loading=!0;const e=new URLSearchParams;this.workHoursFilter.date&&e.append("date",this.workHoursFilter.date),this.workHoursFilter.task_id&&e.append("task_id",this.workHoursFilter.task_id);const t=await M.get(`/api/work_hours.php?${e}`);t.data.success&&(this.workHours=t.data.data||[])}catch(e){console.error("Error loading work hours:",e)}finally{this.loading=!1}},async loadTasks(){try{const e=await M.get("/api/tasks.php");e.data.success&&(this.tasks=e.data.data||[])}catch(e){console.error("Error loading tasks:",e)}},async stopTimer(e){try{const t=await M.post("/api/timers.php",{action:"stop",id:e});t.data.success?this.loadAllData():console.error("Error stopping timer:",t.data.message)}catch(t){console.error("Error stopping timer:",t)}},editTimer(e){this.editForm={id:e.id,description:e.description||"",task_id:e.task_id},this.showEditModal=!0},async saveTimer(){try{const e=await M.post("/api/timers.php",{action:"update",id:this.editForm.id,description:this.editForm.description,task_id:this.editForm.task_id});e.data.success?(this.closeEditModal(),this.loadAllData()):console.error("Error updating timer:",e.data.message)}catch(e){console.error("Error updating timer:",e)}},async deleteTimer(e){if(confirm("Oletko varma että haluat poistaa tämän ajastimen?"))try{const t=await M.post("/api/timers.php",{action:"delete",id:e});t.data.success?this.loadAllData():console.error("Error deleting timer:",t.data.message)}catch(t){console.error("Error deleting timer:",t)}},viewTimerDetails(e){alert(`Ajastimen tiedot:
  26. Tehtävä: ${e.task_title}
  27. Kuvaus: ${e.description||"-"}
  28. Aloitusaika: ${this.formatDateTime(e.start_time)}
  29. Lopetusaika: ${this.formatDateTime(e.end_time)}
  30. Kesto: ${e.duration}`)},async deleteWorkHour(e){if(confirm("Oletko varma että haluat poistaa tämän työtunnin?"))try{const t=await M.delete(`/api/work_hours.php?id=${e}`);t.data.success?this.loadWorkHours():console.error("Error deleting work hour:",t.data.message)}catch(t){console.error("Error deleting work hour:",t)}},editWorkHour(e){console.log("Edit work hour:",e)},clearHistoryFilters(){this.historyFilter={date:"",task_id:""},this.loadTimerHistory()},clearWorkHoursFilters(){this.workHoursFilter={date:"",task_id:""},this.loadWorkHours()},formatTimerDuration(e){if(!e.start_time)return"00:00:00";const t=new Date(e.start_time),i=(e.end_time?new Date(e.end_time):new Date)-t,n=Math.floor(i/(1e3*60*60)),o=Math.floor(i%(1e3*60*60)/6e4),l=Math.floor(i%6e4/1e3);return`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},formatDateTime(e){return e?new Date(e).toLocaleString("fi-FI"):"-"},formatDate(e){return e?new Date(e).toLocaleDateString("fi-FI"):"-"},formatTime(e){return e?new Date(`1970-01-01T${e}`).toLocaleTimeString("fi-FI",{hour:"2-digit",minute:"2-digit"}):"-"}}},cd={class:"timer-management"},ud={class:"modal-content large"},dd={class:"modal-header"},fd={class:"modal-body"},md={class:"tabs"},hd={key:0,class:"tab-content"},pd={key:0,class:"loading"},gd={key:1,class:"no-data"},yd={key:2,class:"timer-list"},_d={class:"timer-info"},vd={class:"timer-header"},bd={class:"timer-details"},wd={class:"timer-description"},kd={class:"timer-meta"},Cd={class:"timer-duration"},Td={class:"timer-actions"},Ed=["onClick"],xd=["onClick"],Fd=["onClick"],Sd={key:1,class:"tab-content"},Pd={class:"filter-controls"},Ad=["value"],Md={key:0,class:"loading"},Dd={key:1,class:"no-data"},Rd={key:2,class:"timer-list"},Id={class:"timer-info"},jd={class:"timer-header"},Od={class:"timer-details"},Ud={class:"timer-description"},Ld={class:"timer-meta"},Nd={class:"timer-duration"},Vd={class:"timer-actions"},Hd=["onClick"],Bd=["onClick"],qd={key:2,class:"tab-content"},Kd={class:"filter-controls"},Wd=["value"],Jd={key:0,class:"loading"},Gd={key:1,class:"no-data"},Yd={key:2,class:"timer-list"},zd={class:"timer-info"},Xd={class:"timer-header"},Qd={class:"timer-details"},Zd={class:"timer-description"},$d={class:"timer-meta"},tf={class:"timer-duration"},ef={key:0,class:"timer-rate"},sf={class:"timer-actions"},nf=["onClick"],of=["onClick"],rf={class:"modal-footer"},lf={class:"modal-content"},af={class:"modal-header"},cf={class:"modal-body"},uf={class:"form-group"},df={class:"form-group"},ff=["value"],mf={class:"form-actions"};function hf(e,t,r,i,n,o){return m(),h("div",cd,[s("button",{onClick:t[0]||(t[0]=(...l)=>o.showManagementModal&&o.showManagementModal(...l)),class:"btn btn-info btn-sm",title:"Hallinnoi ajastimia"},[...t[23]||(t[23]=[s("i",{class:"fas fa-history"},null,-1),s("span",{class:"timer-text"},"Historia",-1)])]),n.showModal?(m(),h("div",{key:0,class:"modal",onClick:t[16]||(t[16]=$((...l)=>o.closeModal&&o.closeModal(...l),["self"]))},[s("div",ud,[s("div",dd,[t[24]||(t[24]=s("h3",null,"Ajastimien Hallinta",-1)),s("button",{onClick:t[1]||(t[1]=(...l)=>o.closeModal&&o.closeModal(...l)),class:"close-btn"},"×")]),s("div",fd,[s("div",md,[s("button",{class:O(["tab-btn",{active:n.activeTab==="active"}]),onClick:t[2]||(t[2]=l=>n.activeTab="active")}," Aktiiviset ("+u(n.activeTimers.length)+") ",3),s("button",{class:O(["tab-btn",{active:n.activeTab==="history"}]),onClick:t[3]||(t[3]=l=>n.activeTab="history")}," Historia ("+u(n.timerHistory.length)+") ",3),s("button",{class:O(["tab-btn",{active:n.activeTab==="workhours"}]),onClick:t[4]||(t[4]=l=>n.activeTab="workhours")}," Työtunnit ("+u(n.workHours.length)+") ",3)]),n.activeTab==="active"?(m(),h("div",hd,[n.loading?(m(),h("div",pd,"Ladataan ajastimia...")):n.activeTimers.length===0?(m(),h("div",gd,[...t[25]||(t[25]=[s("p",null,"Ei aktiivisia ajastimia",-1)])])):(m(),h("div",yd,[(m(!0),h(H,null,z(n.activeTimers,l=>(m(),h("div",{key:l.id,class:"timer-item active"},[s("div",_d,[s("div",vd,[s("h4",null,u(l.task_title||"Tehtävä tuntematon"),1),t[26]||(t[26]=s("span",{class:"timer-status running"},[s("i",{class:"fas fa-circle"}),j(" Ajastin käynnissä ")],-1))]),s("div",bd,[s("p",wd,u(l.description||"-"),1),s("div",kd,[s("span",null,[t[27]||(t[27]=s("i",{class:"fas fa-user"},null,-1)),j(" "+u(l.first_name)+" "+u(l.last_name),1)]),s("span",null,[t[28]||(t[28]=s("i",{class:"fas fa-clock"},null,-1)),j(" "+u(o.formatDateTime(l.start_time)),1)]),s("span",Cd,u(o.formatTimerDuration(l)),1)])])]),s("div",Td,[s("button",{onClick:a=>o.stopTimer(l.id),class:"btn btn-danger btn-sm"},[...t[29]||(t[29]=[s("i",{class:"fas fa-stop"},null,-1),j(" Pysäytä ",-1)])],8,Ed),s("button",{onClick:a=>o.editTimer(l),class:"btn btn-warning btn-sm"},[...t[30]||(t[30]=[s("i",{class:"fas fa-edit"},null,-1),j(" Muokkaa ",-1)])],8,xd),s("button",{onClick:a=>o.deleteTimer(l.id),class:"btn btn-danger btn-sm"},[...t[31]||(t[31]=[s("i",{class:"fas fa-trash"},null,-1),j(" Poista ",-1)])],8,Fd)])]))),128))]))])):A("",!0),n.activeTab==="history"?(m(),h("div",Sd,[s("div",Pd,[C(s("input",{type:"date","onUpdate:modelValue":t[5]||(t[5]=l=>n.historyFilter.date=l),onChange:t[6]||(t[6]=(...l)=>o.loadTimerHistory&&o.loadTimerHistory(...l)),class:"form-control",placeholder:"Päivämäärä"},null,544),[[R,n.historyFilter.date]]),C(s("select",{"onUpdate:modelValue":t[7]||(t[7]=l=>n.historyFilter.task_id=l),onChange:t[8]||(t[8]=(...l)=>o.loadTimerHistory&&o.loadTimerHistory(...l)),class:"form-control"},[t[32]||(t[32]=s("option",{value:""},"Kaikki tehtävät",-1)),(m(!0),h(H,null,z(n.tasks,l=>(m(),h("option",{key:l.id,value:l.id},u(l.title),9,Ad))),128))],544),[[ft,n.historyFilter.task_id]]),s("button",{onClick:t[9]||(t[9]=(...l)=>o.clearHistoryFilters&&o.clearHistoryFilters(...l)),class:"btn btn-secondary btn-sm"},[...t[33]||(t[33]=[s("i",{class:"fas fa-times"},null,-1),j(" Tyhjennä suodattimet ",-1)])])]),n.loading?(m(),h("div",Md,"Ladataan historiaa...")):n.timerHistory.length===0?(m(),h("div",Dd,[...t[34]||(t[34]=[s("p",null,"Ei ajastinhistoriaa",-1)])])):(m(),h("div",Rd,[(m(!0),h(H,null,z(n.timerHistory,l=>(m(),h("div",{key:l.id,class:"timer-item"},[s("div",Id,[s("div",jd,[s("h4",null,u(l.task_title||"Tehtävä tuntematon"),1),t[35]||(t[35]=s("span",{class:"timer-status stopped"},[s("i",{class:"fas fa-circle"}),j(" Pysäytetty ")],-1))]),s("div",Od,[s("p",Ud,u(l.description||"-"),1),s("div",Ld,[s("span",null,[t[36]||(t[36]=s("i",{class:"fas fa-user"},null,-1)),j(" "+u(l.first_name)+" "+u(l.last_name),1)]),s("span",null,[t[37]||(t[37]=s("i",{class:"fas fa-clock"},null,-1)),j(" "+u(o.formatDateTime(l.start_time))+" - "+u(o.formatDateTime(l.end_time)),1)]),s("span",Nd,u(l.duration||"00:00:00"),1)])])]),s("div",Vd,[s("button",{onClick:a=>o.viewTimerDetails(l),class:"btn btn-info btn-sm"},[...t[38]||(t[38]=[s("i",{class:"fas fa-eye"},null,-1),j(" Tiedot ",-1)])],8,Hd),s("button",{onClick:a=>o.deleteTimer(l.id),class:"btn btn-danger btn-sm"},[...t[39]||(t[39]=[s("i",{class:"fas fa-trash"},null,-1),j(" Poista ",-1)])],8,Bd)])]))),128))]))])):A("",!0),n.activeTab==="workhours"?(m(),h("div",qd,[s("div",Kd,[C(s("input",{type:"date","onUpdate:modelValue":t[10]||(t[10]=l=>n.workHoursFilter.date=l),onChange:t[11]||(t[11]=(...l)=>o.loadWorkHours&&o.loadWorkHours(...l)),class:"form-control",placeholder:"Päivämäärä"},null,544),[[R,n.workHoursFilter.date]]),C(s("select",{"onUpdate:modelValue":t[12]||(t[12]=l=>n.workHoursFilter.task_id=l),onChange:t[13]||(t[13]=(...l)=>o.loadWorkHours&&o.loadWorkHours(...l)),class:"form-control"},[t[40]||(t[40]=s("option",{value:""},"Kaikki tehtävät",-1)),(m(!0),h(H,null,z(n.tasks,l=>(m(),h("option",{key:l.id,value:l.id},u(l.title),9,Wd))),128))],544),[[ft,n.workHoursFilter.task_id]]),s("button",{onClick:t[14]||(t[14]=(...l)=>o.clearWorkHoursFilters&&o.clearWorkHoursFilters(...l)),class:"btn btn-secondary btn-sm"},[...t[41]||(t[41]=[s("i",{class:"fas fa-times"},null,-1),j(" Tyhjennä suodattimet ",-1)])])]),n.loading?(m(),h("div",Jd,"Ladataan tunteja...")):n.workHours.length===0?(m(),h("div",Gd,[...t[42]||(t[42]=[s("p",null,"Ei työtunteja",-1)])])):(m(),h("div",Yd,[(m(!0),h(H,null,z(n.workHours,l=>(m(),h("div",{key:l.id,class:"timer-item work-hour"},[s("div",zd,[s("div",Xd,[s("h4",null,u(l.task_title||"Tehtävä tuntematon"),1),t[43]||(t[43]=s("span",{class:"timer-status work-hour"},[s("i",{class:"fas fa-check-circle"}),j(" Työtunti ")],-1))]),s("div",Qd,[s("p",Zd,u(l.description||"-"),1),s("div",$d,[s("span",null,[t[44]||(t[44]=s("i",{class:"fas fa-calendar"},null,-1)),j(" "+u(o.formatDate(l.date)),1)]),s("span",null,[t[45]||(t[45]=s("i",{class:"fas fa-clock"},null,-1)),j(" "+u(o.formatTime(l.start_time))+" - "+u(o.formatTime(l.end_time)),1)]),s("span",tf,u(l.hours)+"h",1),l.rate?(m(),h("span",ef,"€"+u(l.rate)+"/h",1)):A("",!0)])])]),s("div",sf,[s("button",{onClick:a=>o.editWorkHour(l),class:"btn btn-warning btn-sm"},[...t[46]||(t[46]=[s("i",{class:"fas fa-edit"},null,-1),j(" Muokkaa ",-1)])],8,nf),s("button",{onClick:a=>o.deleteWorkHour(l.id),class:"btn btn-danger btn-sm"},[...t[47]||(t[47]=[s("i",{class:"fas fa-trash"},null,-1),j(" Poista ",-1)])],8,of)])]))),128))]))])):A("",!0)]),s("div",rf,[s("button",{onClick:t[15]||(t[15]=(...l)=>o.closeModal&&o.closeModal(...l)),class:"btn btn-secondary"},"Sulje")])])])):A("",!0),n.showEditModal?(m(),h("div",{key:1,class:"modal",onClick:t[22]||(t[22]=$((...l)=>o.closeEditModal&&o.closeEditModal(...l),["self"]))},[s("div",lf,[s("div",af,[t[48]||(t[48]=s("h3",null,"Muokkaa Ajastinta",-1)),s("button",{onClick:t[17]||(t[17]=(...l)=>o.closeEditModal&&o.closeEditModal(...l)),class:"close-btn"},"×")]),s("div",cf,[s("form",{onSubmit:t[21]||(t[21]=$((...l)=>o.saveTimer&&o.saveTimer(...l),["prevent"]))},[s("div",uf,[t[49]||(t[49]=s("label",{for:"editDescription"},"Kuvaus",-1)),C(s("textarea",{id:"editDescription","onUpdate:modelValue":t[18]||(t[18]=l=>n.editForm.description=l),rows:"3",class:"form-control",placeholder:"Kuvaile ajastimen tarkoitusta"},null,512),[[R,n.editForm.description]])]),s("div",df,[t[51]||(t[51]=s("label",{for:"editTask"},"Tehtävä",-1)),C(s("select",{id:"editTask","onUpdate:modelValue":t[19]||(t[19]=l=>n.editForm.task_id=l),class:"form-control"},[t[50]||(t[50]=s("option",{value:""},"Valitse tehtävä...",-1)),(m(!0),h(H,null,z(n.tasks,l=>(m(),h("option",{key:l.id,value:l.id},u(l.title),9,ff))),128))],512),[[ft,n.editForm.task_id]])]),s("div",mf,[s("button",{type:"button",onClick:t[20]||(t[20]=(...l)=>o.closeEditModal&&o.closeEditModal(...l)),class:"btn btn-secondary"},"Peruuta"),t[52]||(t[52]=s("button",{type:"submit",class:"btn btn-primary"},"Tallenna",-1))])],32)])])])):A("",!0)])}const pf=Nt(ad,[["render",hf],["__scopeId","data-v-54e3be02"]]);const gf={name:"HeaderTimer",components:{TimerManagement:pf},data(){return{showModal:!1,activeTimers:[],tasks:[],selectedTask:null,selectedTaskId:"",loading:!1}},computed:{isTimerRunning(){var e;return this.activeTimers.length>0&&((e=this.activeTimers[0])==null?void 0:e.end_time)===null},hasActiveTimer(){return this.activeTimers.some(e=>!e.end_time)}},mounted(){this.loadActiveTimers(),this.loadTasks(),this.timerInterval=setInterval(()=>{this.isTimerRunning&&this.$forceUpdate()},1e3)},beforeUnmount(){this.timerInterval&&clearInterval(this.timerInterval)},methods:{async loadActiveTimers(){try{const e=await M.get("/api/timers.php?action=active");e.data.success?this.activeTimers=e.data.data||[]:this.activeTimers=[]}catch(e){console.error("Error loading active timers:",e),this.activeTimers=[]}},async loadTasks(){try{const e=await M.get("/api/tasks.php");e.data.success&&(this.tasks=e.data.data||[])}catch(e){console.error("Error loading tasks:",e),this.tasks=[]}},showTimerModal(){this.showModal=!0,this.loadActiveTimers(),this.loadTasks()},closeModal(){this.showModal=!1,this.selectedTask=null,this.selectedTaskId=""},selectTask(){this.selectedTaskId?this.selectedTask=this.tasks.find(e=>e.id===parseInt(this.selectedTaskId)):this.selectedTask=null},async startTimerDirect(){try{const e=await M.post("/api/timers.php",{action:"start",task_id:null,user_id:1,description:"Timer started without task"});e.data.success?this.loadActiveTimers():console.error("Error starting timer:",e.data.message)}catch(e){console.error("Error starting timer:",e)}},async startTimer(){try{const e=this.selectedTask?`Timer started for ${this.selectedTask.title}`:"Timer started without task",t=await M.post("/api/timers.php",{action:"start",task_id:this.selectedTask?this.selectedTask.id:null,user_id:1,description:e});t.data.success?(this.loadActiveTimers(),this.closeModal()):console.error("Error starting timer:",t.data.message)}catch(e){console.error("Error starting timer:",e)}},async stopTimer(e){try{const t=await M.post("/api/timers.php",{action:"stop",id:e});t.data.success?(this.loadActiveTimers(),this.loadTasks()):console.error("Error stopping timer:",t.data.message)}catch(t){console.error("Error stopping timer:",t)}},formatTimerDuration(e){if(!e.start_time)return"00:00:00";const t=new Date(e.start_time),i=new Date-t,n=Math.floor(i/(1e3*60*60)),o=Math.floor(i%(1e3*60*60)/6e4),l=Math.floor(i%6e4/1e3);return`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`}}},yf={class:"header-timer"},_f={key:0,class:"timer-display"},vf={class:"timer-info"},bf={class:"timer-duration-large"},wf={class:"timer-controls"},kf={key:1,class:"no-timer"},Cf={class:"modal-content"},Tf={class:"modal-header"},Ef={class:"modal-body"},xf={key:0,class:"selected-task"},Ff={key:1,class:"task-selection"},Sf=["value"],Pf={key:2,class:"timer-display-large"},Af={class:"timer-info"},Mf={class:"timer-duration"},Df={class:"timer-controls-large"},Rf={key:3,class:"no-tasks-message"},If={class:"modal-footer"};function jf(e,t,r,i,n,o){const l=Lt("TimerManagement");return m(),h("div",yf,[n.activeTimers.length>0&&o.isTimerRunning?(m(),h("div",_f,[s("div",vf,[t[10]||(t[10]=s("div",{class:"timer-status running"},[s("i",{class:"fas fa-circle"}),j(" Ajastin käynnissä ")],-1)),s("div",bf,u(o.formatTimerDuration(n.activeTimers[0])),1)]),s("div",wf,[s("button",{onClick:t[0]||(t[0]=a=>{var d;return o.stopTimer((d=n.activeTimers[0])==null?void 0:d.id)}),class:"btn btn-sm btn-danger",title:"Pysäytä ajastin"},[...t[11]||(t[11]=[s("i",{class:"fas fa-stop"},null,-1),j(" Pysäytä ",-1)])]),yt(l)])])):(m(),h("div",kf,[s("button",{onClick:t[1]||(t[1]=(...a)=>o.startTimerDirect&&o.startTimerDirect(...a)),class:"btn btn-sm btn-success",title:"Käynnistä ajastin"},[...t[12]||(t[12]=[s("i",{class:"fas fa-stopwatch"},null,-1),s("span",{class:"timer-text"},"Käynnistä ajastin",-1)])]),yt(l)])),n.showModal?(m(),h("div",{key:2,class:"modal",onClick:t[9]||(t[9]=$((...a)=>o.closeModal&&o.closeModal(...a),["self"]))},[s("div",Cf,[s("div",Tf,[t[13]||(t[13]=s("h3",null,"Ajastin",-1)),s("button",{onClick:t[2]||(t[2]=(...a)=>o.closeModal&&o.closeModal(...a)),class:"close-btn"},"×")]),s("div",Ef,[n.selectedTask?(m(),h("div",xf,[s("h4",null,"Tehtävä: "+u(n.selectedTask.title),1)])):A("",!0),!n.selectedTask&&n.tasks.length>0?(m(),h("div",Ff,[t[15]||(t[15]=s("label",null,"Valitse tehtävä (valinnainen):",-1)),C(s("select",{"onUpdate:modelValue":t[3]||(t[3]=a=>n.selectedTaskId=a),onChange:t[4]||(t[4]=(...a)=>o.selectTask&&o.selectTask(...a)),class:"form-control"},[t[14]||(t[14]=s("option",{value:""},"Ajasta ilman tehtävää",-1)),(m(!0),h(H,null,z(n.tasks,a=>(m(),h("option",{key:a.id,value:a.id},u(a.title),9,Sf))),128))],544),[[ft,n.selectedTaskId]])])):A("",!0),n.activeTimers.length>0?(m(),h("div",Pf,[s("div",Af,[s("div",{class:O(["timer-status",{"timer-running":o.isTimerRunning}])},[t[16]||(t[16]=s("i",{class:"fas fa-circle"},null,-1)),j(" "+u(o.isTimerRunning?"Ajastin käynnissä":"Ajastin pysäytetty"),1)],2),s("div",Mf,u(o.formatTimerDuration(n.activeTimers[0])),1)])])):A("",!0),s("div",Df,[o.hasActiveTimer?A("",!0):(m(),h("button",{key:0,onClick:t[5]||(t[5]=(...a)=>o.startTimer&&o.startTimer(...a)),class:"btn btn-success"},[...t[17]||(t[17]=[s("i",{class:"fas fa-play"},null,-1),j(" Aloita ajastin ",-1)])])),o.isTimerRunning?(m(),h("button",{key:1,onClick:t[6]||(t[6]=a=>{var d;return o.stopTimer((d=n.activeTimers[0])==null?void 0:d.id)}),class:"btn btn-danger"},[...t[18]||(t[18]=[s("i",{class:"fas fa-stop"},null,-1),j(" Pysäytä ajastin ",-1)])])):A("",!0)]),n.tasks.length===0?(m(),h("div",Rf,[t[19]||(t[19]=s("p",null,"Ei tehtäviä löytynyt. Luo ensin tehtävä ennen ajastimen käyttöä.",-1)),s("button",{onClick:t[7]||(t[7]=a=>e.$emit("navigate-to-tasks")),class:"btn btn-primary"}," Siirry tehtäviin ")])):A("",!0)]),s("div",If,[s("button",{onClick:t[8]||(t[8]=(...a)=>o.closeModal&&o.closeModal(...a)),class:"btn btn-secondary"},"Sulje")])])])):A("",!0)])}const Of=Nt(gf,[["render",jf],["__scopeId","data-v-5f75d921"]]);const Uf={name:"NavigationTabs",components:{HeaderTimer:Of},props:{activeSection:{type:String,required:!0,validator:e=>["items","clients","projects","accounting","tuloslaskelma","alv-laskenta","tasks"].includes(e)}},emits:["section-change"],data(){return{dropdownOpen:!1}},computed:{isAccountingSection(){return["accounting","tuloslaskelma","alv-laskenta"].includes(this.activeSection)}},methods:{toggleDropdown(e){e.preventDefault(),e.stopPropagation(),this.dropdownOpen=!this.dropdownOpen,console.log("Dropdown toggled:",this.dropdownOpen)},closeDropdown(){this.dropdownOpen=!1}},mounted(){document.addEventListener("click",this.closeDropdown)},beforeUnmount(){document.removeEventListener("click",this.closeDropdown)}},Lf={class:"nav-tabs-container"},Nf={class:"nav-tabs"},Vf={key:0,class:"dropdown-menu"},Hf={class:"timer-section"};function Bf(e,t,r,i,n,o){const l=Lt("HeaderTimer");return m(),h("div",Lf,[s("div",Nf,[s("button",{class:O(["nav-tab",{active:r.activeSection==="items"}]),onClick:t[0]||(t[0]=a=>e.$emit("section-change","items"))}," Tuotteet ",2),s("button",{class:O(["nav-tab",{active:r.activeSection==="clients"}]),onClick:t[1]||(t[1]=a=>e.$emit("section-change","clients"))}," Asiakkaat ",2),s("button",{class:O(["nav-tab",{active:r.activeSection==="projects"}]),onClick:t[2]||(t[2]=a=>e.$emit("section-change","projects"))}," Projektit ",2),s("button",{class:O(["nav-tab",{active:r.activeSection==="tasks"}]),onClick:t[3]||(t[3]=a=>e.$emit("section-change","tasks"))}," Tehtävät ",2)]),s("div",{class:"nav-dropdown",onClick:t[7]||(t[7]=(...a)=>o.toggleDropdown&&o.toggleDropdown(...a))},[s("button",{class:O(["nav-tab",{active:o.isAccountingSection}])},[...t[9]||(t[9]=[j(" Talous ",-1),s("span",{class:"dropdown-arrow"},"▼",-1)])],2),n.dropdownOpen?(m(),h("div",Vf,[s("button",{class:O(["dropdown-item",{active:r.activeSection==="accounting"}]),onClick:t[4]||(t[4]=$(a=>e.$emit("section-change","accounting"),["stop"]))}," Yksinkertainen Kirjanpito ",2),s("button",{class:O(["dropdown-item",{active:r.activeSection==="tuloslaskelma"}]),onClick:t[5]||(t[5]=$(a=>e.$emit("section-change","tuloslaskelma"),["stop"]))}," Tuloslaskelma ",2),s("button",{class:O(["dropdown-item",{active:r.activeSection==="alv-laskenta"}]),onClick:t[6]||(t[6]=$(a=>e.$emit("section-change","alv-laskenta"),["stop"]))}," ALV-laskenta ",2)])):A("",!0)]),s("div",Hf,[yt(l,{onNavigateToTasks:t[8]||(t[8]=a=>e.$emit("section-change","tasks"))})])])}const qf=Nt(Uf,[["render",Bf],["__scopeId","data-v-3c96bb8e"]]);const Kf={name:"TaskManagementSection",data(){return{tasks:[],projects:[],loading:!1,showTaskModal:!1,isEditing:!1,taskForm:{id:null,title:"",description:"",status:"pending",priority:"medium",project_id:"",due_date:""},showWorkHoursModal:!1,showWorkHourModal:!1,isEditingWorkHour:!1,selectedTask:null,workHours:[],workHoursSummary:{total_hours:0,entries:0},workHourForm:{id:null,task_id:null,user_id:1,date:"",hours:"",rate:"",description:""},showTimerModal:!1,timerForm:{id:null,task_id:null,user_id:1,start_time:"",end_time:"",duration:"",description:""},activeTimers:[],timerDisplayProperties:{timerRunning:!1,timerDuration:""},timerModalProperties:{timerRunning:!1,timerDuration:""}}},mounted(){this.loadTasks(),this.loadProjects()},methods:{async loadTasks(){this.loading=!0;try{const e=await M.get("/api/tasks.php");e.data.success?(this.tasks=e.data.data,await this.loadTasksWorkHours()):console.error("Error loading tasks:",e.data.message)}catch(e){console.error("Error loading tasks:",e)}finally{this.loading=!1}},async loadTasksWorkHours(){for(const e of this.tasks)try{const t=await M.get(`/api/work_hours.php?task_id=${e.id}`);if(t.data.success){const r=t.data.data;e.total_hours=r.reduce((i,n)=>i+parseFloat(n.hours),0)}else e.total_hours=0}catch(t){console.error("Error loading work hours for Task:",e.id,t),e.total_hours=0}},async loadActiveTimers(){try{const e=await M.get("/api/timers.php?action=active");e.data.success?this.activeTimers=e.data.data:this.activeTimers=[]}catch(e){console.error("Error loading active timers:",e),this.activeTimers=[]}},async loadProjects(){try{const e=await M.get("/api/projects.php");this.projects=e.data.records||[]}catch(e){console.error("Error loading projects:",e)}},showAddTaskModal(){this.isEditing=!1,this.taskForm={id:null,title:"",description:"",status:"pending",priority:"medium",project_id:"",due_date:""},this.showTaskModal=!0},editTask(e){this.isEditing=!0,this.taskForm={...e},this.showTaskModal=!0},closeTaskModal(){this.showTaskModal=!1,this.isEditing=!1},async saveTask(){try{let e;this.isEditing?e=await M.put(`/api/tasks.php?id=${this.taskForm.id}`,this.taskForm):e=await M.post("/api/tasks.php",this.taskForm),e.data.success?(this.closeTaskModal(),this.loadTasks()):console.error("Error saving task:",e.data.message)}catch(e){console.error("Error saving task:",e)}},async deleteTask(e){if(confirm("Haluatko varmasti poistaa tämän tehtävän?"))try{await M.delete(`/api/tasks.php?id=${e}`),this.loadTasks()}catch(t){console.error("Error deleting task:",t)}},getTaskStatusClass(e){return{pending:"status-pending",in_progress:"status-progress",completed:"status-completed",on_hold:"status-hold",cancelled:"status-cancelled"}[e]||""},getStatusClass(e){return this.getTaskStatusClass(e)},getStatusText(e){return{pending:"Odottaa",in_progress:"Käynnissä",completed:"Valmis",on_hold:"Pidossa",cancelled:"Peruttu"}[e]||e},getPriorityClass(e){return{low:"priority-low",medium:"priority-medium",high:"priority-high"}[e]||""},getPriorityText(e){return{low:"Matala",medium:"Keskitaso",high:"Korkea"}[e]||e},formatDate(e){return e?new Date(e).toLocaleDateString("fi-FI"):""},showWorkHours(e){this.selectedTask=e,this.loadWorkHours(e.id),this.loadTaskClientInfo(e.id),this.showWorkHoursModal=!0},closeWorkHoursModal(){this.showWorkHoursModal=!1,this.selectedTask=null,this.workHours=[],this.workHoursSummary={total_hours:0,entries:0}},async loadWorkHours(e){try{const t=await M.get(`/api/work_hours.php?task_id=${e}`);t.data.success&&(this.workHours=t.data.data,this.workHoursSummary={total_hours:this.workHours.reduce((r,i)=>r+parseFloat(i.hours),0),entries:this.workHours.length})}catch(t){console.error("Error loading work hours:",t)}},showAddWorkHourModal(){this.isEditingWorkHour=!1,this.workHourForm={id:null,task_id:this.selectedTask.id,user_id:1,date:new Date().toISOString().split("T")[0],hours:"",rate:"",description:""},this.showWorkHourModal=!0},showTimer(e){this.selectedTask=e,this.loadActiveTimers(),this.showTimerModal=!0},closeTimerModal(){this.showTimerModal=!1,this.selectedTask=null,this.activeTimers=[]},async startTimer(){try{const e=await M.post("/api/timers.php",{action:"start",task_id:this.selectedTask.id,user_id:1,description:`Timer started for ${this.selectedTask.title}`});e.data.success?(this.loadActiveTimers(),this.closeTimerModal()):console.error("Error starting timer:",e.data.message)}catch(e){console.error("Error starting timer:",e)}},async stopTimer(e){try{const t=await M.post("/api/timers.php",{action:"stop",id:e});t.data.success?(this.loadActiveTimers(),this.loadTasks()):console.error("Error stopping timer:",t.data.message)}catch(t){console.error("Error stopping timer:",t)}},hasActiveTimer(e){return this.activeTimers.some(t=>t.task_id===parseInt(e)&&!t.end_time)},formatTimerDuration(e){if(!e.start_time)return"00:00:00";const t=new Date(e.start_time),i=new Date-t,n=Math.floor(i/(1e3*60*60)),o=Math.floor(i%(1e3*60*60)/6e4),l=Math.floor(i%6e4/1e3);return`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},editWorkHour(e){this.isEditingWorkHour=!0,this.workHourForm={...e},this.showWorkHourModal=!0},closeWorkHourModal(){this.showWorkHourModal=!1,this.isEditingWorkHour=!1,this.workHourForm={id:null,task_id:null,user_id:1,date:"",hours:"",rate:"",description:""}},async saveWorkHour(){try{let e;this.isEditingWorkHour?e=await M.put("/api/work_hours.php",{...this.workHourForm,id:this.workHourForm.id}):e=await M.post("/api/work_hours.php",this.workHourForm),e.data.success&&(this.closeWorkHourModal(),this.loadWorkHours(this.selectedTask.id),this.loadTasks())}catch(e){console.error("Error saving work hour:",e)}},async deleteWorkHour(e){if(confirm("Haluatko varmasti poistaa tämän työtunnin?"))try{(await M.delete(`/api/work_hours.php?id=${e}`)).data.success&&(this.loadWorkHours(this.selectedTask.id),this.loadTasks())}catch(t){console.error("Error deleting work hour:",t)}},async loadTaskClientInfo(e){try{const t=await M.get(`/api/work_hours.php?task_id=${e}`);if(t.data.success&&t.data.data.length>0){const r=t.data.data[0];this.selectedTask.client_hour_price=r.client_hour_price,this.selectedTask.client_name=r.client_name||`${r.client_first_name} ${r.client_last_name}`}}catch(t){console.error("Error loading client info:",t),this.selectedTask.client_hour_price=null}},useClientHourPrice(){var e;(e=this.selectedTask)!=null&&e.client_hour_price&&(this.workHourForm.rate=this.selectedTask.client_hour_price)}}},Wf={class:"task-management"},Jf={class:"task-controls"},Gf={class:"task-list"},Yf={key:0,class:"loading"},zf={key:1,class:"no-tasks"},Xf={key:2,class:"tasks-grid"},Qf={class:"task-header"},Zf={class:"task-details"},$f={key:0},tm={class:"task-meta"},em={class:"task-date"},sm={key:0,class:"task-hours"},nm={class:"task-actions"},om=["onClick"],rm=["onClick"],im=["onClick"],lm=["onClick"],am=["onClick"],cm={key:0,class:"modal"},um={class:"modal-content"},dm={class:"modal-header"},fm={class:"modal-body"},mm={class:"form-group"},hm={class:"form-group"},pm={class:"form-group"},gm={class:"form-group"},ym={class:"form-group"},_m=["value"],vm={class:"form-group"},bm={class:"modal-footer"},wm={key:1,class:"modal"},km={class:"modal-content work-hours-modal"},Cm={class:"modal-header"},Tm={class:"modal-body"},Em={class:"work-hours-summary"},xm={class:"summary-item"},Fm={class:"value"},Sm={class:"summary-item"},Pm={class:"value"},Am={class:"work-hours-list"},Mm={key:0,class:"no-work-hours"},Dm={key:1},Rm={class:"hour-info"},Im={class:"hour-date"},jm={class:"hour-user"},Om={class:"hour-hours"},Um={key:0,class:"hour-description"},Lm={class:"hour-actions"},Nm=["onClick"],Vm=["onClick"],Hm={class:"add-work-hour"},Bm={key:2,class:"modal"},qm={class:"modal-content"},Km={class:"modal-header"},Wm={class:"modal-body"},Jm={class:"form-group"},Gm={class:"form-group"},Ym={class:"form-group"},zm={class:"rate-input-group"},Xm={class:"form-group"},Qm={class:"modal-footer"},Zm={key:3,class:"modal"},$m={class:"modal-content"},th={class:"modal-header"},eh={class:"modal-body"},sh={key:0,class:"timer-display"},nh={class:"timer-info"},oh={class:"timer-duration"},rh={class:"timer-controls"};function ih(e,t,r,i,n,o){var l,a,d,g,f,v;return m(),h("div",Wf,[t[54]||(t[54]=s("h2",null,"Tehtävien Hallinta",-1)),s("div",Jf,[s("button",{onClick:t[0]||(t[0]=(..._)=>o.showAddTaskModal&&o.showAddTaskModal(..._)),class:"btn btn-primary"}," + Lisää uusi tehtävä ")]),s("div",Gf,[n.loading?(m(),h("div",Yf,"Ladataan tehtäviä...")):n.tasks.length===0?(m(),h("div",zf," Ei tehtäviä tallennettu ")):(m(),h("div",Xf,[(m(!0),h(H,null,z(n.tasks,_=>(m(),h("div",{key:_.id,class:O(["task-card",o.getTaskStatusClass(_.status)])},[s("div",Qf,[s("h3",null,u(_.title),1),s("span",{class:O(["task-status",o.getStatusClass(_.status)])},u(o.getStatusText(_.status)),3)]),s("div",Zf,[_.description?(m(),h("p",$f,u(_.description),1)):A("",!0),s("div",tm,[s("span",em,[t[25]||(t[25]=s("i",{class:"fas fa-calendar"},null,-1)),j(" "+u(o.formatDate(_.created_at)),1)]),s("span",{class:O(["task-priority",o.getPriorityClass(_.priority)])},[t[26]||(t[26]=s("i",{class:"fas fa-flag"},null,-1)),j(" "+u(o.getPriorityText(_.priority)),1)],2),_.total_hours?(m(),h("span",sm,[t[27]||(t[27]=s("i",{class:"fas fa-clock"},null,-1)),j(" "+u(_.total_hours)+"h ",1)])):A("",!0)])]),s("div",nm,[s("button",{onClick:P=>o.showWorkHours(_),class:"btn btn-small btn-info"},[...t[28]||(t[28]=[s("i",{class:"fas fa-clock"},null,-1),j(" Työtunnit ",-1)])],8,om),o.hasActiveTimer(_.id)?A("",!0):(m(),h("button",{key:0,onClick:P=>o.showTimer(_),class:"btn btn-small btn-success"},[...t[29]||(t[29]=[s("i",{class:"fas fa-stopwatch"},null,-1),j(" Ajastin ",-1)])],8,rm)),o.hasActiveTimer(_.id)?(m(),h("button",{key:1,onClick:P=>o.stopTimer(_.id),class:"btn btn-small btn-danger"},[...t[30]||(t[30]=[s("i",{class:"fas fa-stop"},null,-1),j(" Pysäytä ",-1)])],8,im)):A("",!0),s("button",{onClick:P=>o.editTask(_),class:"btn btn-small"},[...t[31]||(t[31]=[s("i",{class:"fas fa-edit"},null,-1),j(" Muokkaa ",-1)])],8,lm),s("button",{onClick:P=>o.deleteTask(_.id),class:"btn btn-small btn-danger"},[...t[32]||(t[32]=[s("i",{class:"fas fa-trash"},null,-1),j(" Poista ",-1)])],8,am)])],2))),128))]))]),n.showTaskModal?(m(),h("div",cm,[s("div",um,[s("div",dm,[s("h3",null,u(n.isEditing?"Muokkaa tehtävä":"Lisää uusi tehtävä"),1),s("button",{onClick:t[1]||(t[1]=(..._)=>o.closeTaskModal&&o.closeTaskModal(..._)),class:"close-btn"},"×")]),s("div",fm,[s("form",{onSubmit:t[8]||(t[8]=$((..._)=>o.saveTask&&o.saveTask(..._),["prevent"]))},[s("div",mm,[t[33]||(t[33]=s("label",{for:"taskTitle"},"Tehtävän nimi",-1)),C(s("input",{id:"taskTitle","onUpdate:modelValue":t[2]||(t[2]=_=>n.taskForm.title=_),type:"text",required:"",placeholder:"Syötä tehtävän nimi"},null,512),[[R,n.taskForm.title]])]),s("div",hm,[t[34]||(t[34]=s("label",{for:"taskDescription"},"Kuvaus",-1)),C(s("textarea",{id:"taskDescription","onUpdate:modelValue":t[3]||(t[3]=_=>n.taskForm.description=_),rows:"4",placeholder:"Kuvaile tehtävä tarkemmin"},null,512),[[R,n.taskForm.description]])]),s("div",pm,[t[36]||(t[36]=s("label",{for:"taskStatus"},"Tila",-1)),C(s("select",{id:"taskStatus","onUpdate:modelValue":t[4]||(t[4]=_=>n.taskForm.status=_),required:""},[...t[35]||(t[35]=[Hn('<option value="pending" data-v-e84c94f6>Odottaa</option><option value="in_progress" data-v-e84c94f6>Käynnissä</option><option value="completed" data-v-e84c94f6>Valmis</option><option value="on_hold" data-v-e84c94f6>Pidossa</option><option value="cancelled" data-v-e84c94f6>Peruttu</option>',5)])],512),[[ft,n.taskForm.status]])]),s("div",gm,[t[38]||(t[38]=s("label",{for:"taskPriority"},"Prioriteetti",-1)),C(s("select",{id:"taskPriority","onUpdate:modelValue":t[5]||(t[5]=_=>n.taskForm.priority=_),required:""},[...t[37]||(t[37]=[s("option",{value:"low"},"Matala",-1),s("option",{value:"medium"},"Keskitaso",-1),s("option",{value:"high"},"Korkea",-1)])],512),[[ft,n.taskForm.priority]])]),s("div",ym,[t[40]||(t[40]=s("label",{for:"taskProject"},"Projekti",-1)),C(s("select",{id:"taskProject","onUpdate:modelValue":t[6]||(t[6]=_=>n.taskForm.project_id=_)},[t[39]||(t[39]=s("option",{value:""},"Valitse projekti",-1)),(m(!0),h(H,null,z(n.projects,_=>(m(),h("option",{key:_.id,value:_.id},u(_.project_name),9,_m))),128))],512),[[ft,n.taskForm.project_id]])]),s("div",vm,[t[41]||(t[41]=s("label",{for:"taskDueDate"},"Määräpäivä",-1)),C(s("input",{id:"taskDueDate","onUpdate:modelValue":t[7]||(t[7]=_=>n.taskForm.due_date=_),type:"date"},null,512),[[R,n.taskForm.due_date]])])],32)]),s("div",bm,[s("button",{type:"submit",onClick:t[9]||(t[9]=(..._)=>o.saveTask&&o.saveTask(..._)),class:"btn btn-primary"},u(n.isEditing?"Tallenna muutokset":"Lisää tehtävä"),1),s("button",{onClick:t[10]||(t[10]=(..._)=>o.closeTaskModal&&o.closeTaskModal(..._)),class:"btn btn-secondary"}," Peruuta ")])])])):A("",!0),n.showWorkHoursModal?(m(),h("div",wm,[s("div",km,[s("div",Cm,[s("h3",null,"Työtunnit: "+u((l=n.selectedTask)==null?void 0:l.title),1),s("button",{onClick:t[11]||(t[11]=(..._)=>o.closeWorkHoursModal&&o.closeWorkHoursModal(..._)),class:"close-btn"},"×")]),s("div",Tm,[s("div",Em,[s("div",xm,[t[42]||(t[42]=s("span",{class:"label"},"Kokonaistunnit:",-1)),s("span",Fm,u(n.workHoursSummary.total_hours)+"h",1)]),s("div",Sm,[t[43]||(t[43]=s("span",{class:"label"},"Tapahtumat:",-1)),s("span",Pm,u(n.workHoursSummary.entries),1)])]),s("div",Am,[n.workHours.length===0?(m(),h("div",Mm," Ei työtunteja tallennettu ")):(m(),h("div",Dm,[(m(!0),h(H,null,z(n.workHours,_=>(m(),h("div",{key:_.id,class:"work-hour-item"},[s("div",Rm,[s("div",Im,u(o.formatDate(_.date)),1),s("div",jm,u(_.first_name)+" "+u(_.last_name),1),s("div",Om,u(_.hours)+"h",1)]),_.description?(m(),h("div",Um,u(_.description),1)):A("",!0),s("div",Lm,[s("button",{onClick:P=>o.editWorkHour(_),class:"btn btn-small"},[...t[44]||(t[44]=[s("i",{class:"fas fa-edit"},null,-1),j(" Muokkaa ",-1)])],8,Nm),s("button",{onClick:P=>o.deleteWorkHour(_.id),class:"btn btn-small btn-danger"},[...t[45]||(t[45]=[s("i",{class:"fas fa-trash"},null,-1),j(" Poista ",-1)])],8,Vm)])]))),128))]))]),s("div",Hm,[s("button",{onClick:t[12]||(t[12]=(..._)=>o.showAddWorkHourModal&&o.showAddWorkHourModal(..._)),class:"btn btn-primary"},[...t[46]||(t[46]=[s("i",{class:"fas fa-plus"},null,-1),j(" Lisää työtunti ",-1)])])])])])])):A("",!0),n.showWorkHourModal?(m(),h("div",Bm,[s("div",qm,[s("div",Km,[s("h3",null,u(n.isEditingWorkHour?"Muokkaa työtuntia":"Lisää työtunti"),1),s("button",{onClick:t[13]||(t[13]=(..._)=>o.closeWorkHourModal&&o.closeWorkHourModal(..._)),class:"close-btn"},"×")]),s("div",Wm,[s("form",{onSubmit:t[19]||(t[19]=$((..._)=>o.saveWorkHour&&o.saveWorkHour(..._),["prevent"]))},[s("div",Jm,[t[47]||(t[47]=s("label",{for:"workHourDate"},"Päivämäärä",-1)),C(s("input",{id:"workHourDate","onUpdate:modelValue":t[14]||(t[14]=_=>n.workHourForm.date=_),type:"date",required:""},null,512),[[R,n.workHourForm.date]])]),s("div",Gm,[t[48]||(t[48]=s("label",{for:"workHourHours"},"Tunnit",-1)),C(s("input",{id:"workHourHours","onUpdate:modelValue":t[15]||(t[15]=_=>n.workHourForm.hours=_),type:"number",step:"0.25",min:"0.25",max:"24",required:"",placeholder:"Syötä tunnit"},null,512),[[R,n.workHourForm.hours]])]),s("div",Ym,[t[49]||(t[49]=s("label",{for:"workHourRate"},"Tuntihinta (€)",-1)),s("div",zm,[C(s("input",{id:"workHourRate","onUpdate:modelValue":t[16]||(t[16]=_=>n.workHourForm.rate=_),type:"number",step:"0.01",min:"0",placeholder:"Syötä tuntihinta"},null,512),[[R,n.workHourForm.rate]]),(a=n.selectedTask)!=null&&a.client_hour_price?(m(),h("button",{key:0,onClick:t[17]||(t[17]=(..._)=>o.useClientHourPrice&&o.useClientHourPrice(..._)),class:"btn btn-small btn-info",type:"button"}," Käytä asiakkaan hintaa (€"+u(n.selectedTask.client_hour_price)+") ",1)):A("",!0)])]),s("div",Xm,[t[50]||(t[50]=s("label",{for:"workHourDescription"},"Kuvaus",-1)),C(s("textarea",{id:"workHourDescription","onUpdate:modelValue":t[18]||(t[18]=_=>n.workHourForm.description=_),rows:"3",placeholder:"Kuvaile työtä"},null,512),[[R,n.workHourForm.description]])])],32)]),s("div",Qm,[s("button",{type:"submit",onClick:t[20]||(t[20]=(..._)=>o.saveWorkHour&&o.saveWorkHour(..._)),class:"btn btn-primary"},u(n.isEditingWorkHour?"Tallenna muutokset":"Lisää työtunti"),1),s("button",{onClick:t[21]||(t[21]=(..._)=>o.closeWorkHourModal&&o.closeWorkHourModal(..._)),class:"btn btn-secondary"}," Peruuta ")])])])):A("",!0),n.showTimerModal?(m(),h("div",Zm,[s("div",$m,[s("div",th,[s("h3",null,"Ajastin: "+u((d=n.selectedTask)==null?void 0:d.title),1),s("button",{onClick:t[22]||(t[22]=(..._)=>o.closeTimerModal&&o.closeTimerModal(..._)),class:"close-btn"},"×")]),s("div",eh,[n.activeTimers.length>0?(m(),h("div",sh,[s("div",nh,[s("div",{class:O(["timer-status",{"timer-running":((g=n.activeTimers[0])==null?void 0:g.end_time)===null}])},[t[51]||(t[51]=s("i",{class:"fas fa-circle"},null,-1)),j(" "+u(((f=n.activeTimers[0])==null?void 0:f.end_time)===null?"Ajastin käynnissä":"Ajastin pysäytetty"),1)],2),s("div",oh,u(o.formatTimerDuration(n.activeTimers[0])),1)])])):A("",!0),s("div",rh,[s("button",{onClick:t[23]||(t[23]=(..._)=>o.startTimer&&o.startTimer(..._)),class:"btn btn-success"},[...t[52]||(t[52]=[s("i",{class:"fas fa-play"},null,-1),j(" Aloita ",-1)])]),((v=n.activeTimers[0])==null?void 0:v.end_time)===null?(m(),h("button",{key:0,onClick:t[24]||(t[24]=_=>{var P;return o.stopTimer((P=n.activeTimers[0])==null?void 0:P.id)}),class:"btn btn-danger"},[...t[53]||(t[53]=[s("i",{class:"fas fa-stop"},null,-1),j(" Pysäytä ",-1)])])):A("",!0)])])])])):A("",!0)])}const Yi=Nt(Kf,[["render",ih],["__scopeId","data-v-e84c94f6"]]);const lh={name:"ProjectsSection",components:{TaskManagementSection:Yi},props:{activeSection:{type:String,required:!0},projects:{type:Array,required:!0},projectsLoading:{type:Boolean,default:!1},projectSearch:{type:String,default:""}},emits:["add-project","view-project","edit-project","delete-project","search-projects","show-tasks"],methods:{formatDate:ze,formatCurrency:Pe,handleShowTasks(){this.$emit("show-tasks")}}},ah={key:0,class:"card"},ch={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-bottom":"20px"}},uh={style:{display:"flex",gap:"10px"}},dh=["value"],fh={key:0,class:"loading"},mh={key:1,class:"loading"},hh={key:3,class:"projects-grid"},ph={class:"project-header"},gh=["innerHTML"],yh={class:"project-info"},_h={class:"budget"},vh={key:0,class:"project-description"},bh={key:1,class:"project-progress"},wh={class:"progress-bar"},kh={class:"progress-text"},Ch={class:"project-actions"},Th=["onClick"],Eh=["onClick"],xh=["onClick"];function Fh(e,t,r,i,n,o){const l=Lt("TaskManagementSection");return r.activeSection==="projects"?(m(),h("div",ah,[s("div",ch,[t[3]||(t[3]=s("h2",null,"Projects",-1)),s("div",uh,[s("input",{type:"text",value:r.projectSearch,onInput:t[0]||(t[0]=a=>e.$emit("search-projects",a.target.value)),placeholder:"Search projects...",style:{padding:"8px",border:"1px solid #ddd","border-radius":"4px"}},null,40,dh),s("button",{class:"btn btn-primary",onClick:t[1]||(t[1]=a=>e.$emit("add-project"))},"Add New Project"),s("button",{class:"btn btn-secondary",onClick:t[2]||(t[2]=(...a)=>o.handleShowTasks&&o.handleShowTasks(...a))},"Tehtävät")])]),r.projectsLoading?(m(),h("div",fh," Loading projects... ")):r.projects.length===0?(m(),h("div",mh," No projects found. Create your first project! ")):A("",!0),r.activeSection==="tasks"?(m(),Ue(l,{key:2})):(m(),h("div",hh,[(m(!0),h(H,null,z(r.projects,a=>(m(),h("div",{key:a.id,class:"project-card"},[s("div",ph,[s("h3",null,u(a.project_name),1),s("span",{innerHTML:a.status_badge},null,8,gh)]),s("div",yh,[s("p",null,[t[4]||(t[4]=s("strong",null,"Client:",-1)),j(" "+u(a.customer_name||"N/A"),1)]),s("p",_h,"Budget: "+u(a.budget?o.formatCurrency(a.budget,"EUR"):"Not set"),1),s("p",null,[t[5]||(t[5]=s("strong",null,"Start Date:",-1)),j(" "+u(o.formatDate(a.start_date)),1)]),s("p",null,[t[6]||(t[6]=s("strong",null,"End Date:",-1)),j(" "+u(o.formatDate(a.end_date)),1)])]),a.description?(m(),h("div",vh,[s("p",null,u(a.description),1)])):A("",!0),a.progress?(m(),h("div",bh,[s("div",wh,[s("div",{class:"progress-fill",style:Zs({width:a.progress+"%"})},null,4)]),s("span",kh,u(a.progress)+"%",1)])):A("",!0),s("div",Ch,[s("button",{class:"btn btn-primary",onClick:d=>e.$emit("view-project",a)},"Details",8,Th),s("button",{class:"btn btn-warning",onClick:d=>e.$emit("edit-project",a)},"Edit",8,Eh),s("button",{class:"btn btn-danger",onClick:d=>e.$emit("delete-project",a.id)},"Delete",8,xh)])]))),128))]))])):A("",!0)}const Sh=Nt(lh,[["render",Fh],["__scopeId","data-v-50c78bee"]]);const Ph={name:"UsersSection",props:{activeSection:{type:String,required:!0},users:{type:Array,required:!0},usersLoading:{type:Boolean,default:!1},userSearch:{type:String,default:""}},emits:["add-user","view-user","edit-user","delete-user","search-users"],methods:{formatDateTime:vo}},Ah={class:"card"},Mh={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-bottom":"20px"}},Dh={style:{display:"flex",gap:"10px"}},Rh=["value"],Ih={key:0,class:"loading"},jh={key:1,class:"loading"},Oh={key:2},Uh={class:"table"},Lh={class:"actions"},Nh=["onClick"],Vh=["onClick"],Hh=["onClick"];function Bh(e,t,r,i,n,o){return m(),h("div",Ah,[s("div",Mh,[t[2]||(t[2]=s("h2",null,"Users",-1)),s("div",Dh,[s("input",{type:"text",value:r.userSearch,onInput:t[0]||(t[0]=l=>e.$emit("search-users",l.target.value)),placeholder:"Search users...",style:{padding:"8px",border:"1px solid #ddd","border-radius":"4px"}},null,40,Rh),s("button",{class:"btn btn-primary",onClick:t[1]||(t[1]=l=>e.$emit("add-user"))},"Add New User")])]),r.usersLoading?(m(),h("div",Ih," Loading users... ")):r.users.length===0?(m(),h("div",jh," No users found. Create your first user! ")):(m(),h("div",Oh,[s("table",Uh,[t[3]||(t[3]=s("thead",null,[s("tr",null,[s("th",null,"ID"),s("th",null,"Username"),s("th",null,"Name"),s("th",null,"Email"),s("th",null,"Role"),s("th",null,"Status"),s("th",null,"Last Login"),s("th",null,"Created"),s("th",null,"Actions")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(r.users,l=>(m(),h("tr",{key:l.id},[s("td",null,u(l.id),1),s("td",null,u(l.username),1),s("td",null,u(l.first_name)+" "+u(l.last_name),1),s("td",null,u(l.email),1),s("td",null,u(l.role||"-"),1),s("td",null,u(l.status||"-"),1),s("td",null,u(o.formatDateTime(l.last_login)||"-"),1),s("td",null,u(o.formatDateTime(l.created_at)||"-"),1),s("td",null,[s("div",Lh,[s("button",{class:"btn btn-primary",onClick:a=>e.$emit("view-user",l)},"View",8,Nh),s("button",{class:"btn btn-warning",onClick:a=>e.$emit("edit-user",l)},"Edit",8,Vh),s("button",{class:"btn btn-danger",onClick:a=>e.$emit("delete-user",l.id)},"Delete",8,Hh)])])]))),128))])])]))])}const qh=Nt(Ph,[["render",Bh],["__scopeId","data-v-b3d4d532"]]);const Kh={name:"ChartOfAccountsSection",props:{activeSection:{type:String,required:!0},accounts:{type:Array,required:!0},accountsLoading:{type:Boolean,default:!1},accountSearch:{type:String,default:""}},emits:["add-account","view-account","edit-account","delete-account","search-accounts"],computed:{totalAssets(){return this.accounts.filter(e=>e.account_type==="asset"&&e.is_active).reduce((e,t)=>e+parseFloat(t.current_balance||0),0)},totalLiabilities(){return this.accounts.filter(e=>e.account_type==="liability"&&e.is_active).reduce((e,t)=>e+parseFloat(t.current_balance||0),0)},totalEquity(){return this.accounts.filter(e=>e.account_type==="equity"&&e.is_active).reduce((e,t)=>e+parseFloat(t.current_balance||0),0)}},methods:{formatCurrency:Pe,formatDate:ze,formatVAT(e){return e==null||e===0?"-":`${parseFloat(e).toFixed(2)}%`},formatAccountType(e){return{asset:"Vasta-omaisuus",liability:"Velat",equity:"Oma pääoma",revenue:"Tuotot",expense:"Kulut"}[e]||e},getAccountCategory(e){return{asset:"1000-1999",liability:"2000-2999",equity:"3000-3999",revenue:"4000-4999",expense:"5000-5999"}[e]||e}}},Wh={key:0,class:"card"},Jh={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-bottom":"20px"}},Gh={style:{display:"flex",gap:"10px"}},Yh=["value"],zh={key:0,class:"loading"},Xh={key:1,class:"loading"},Qh={key:2},Zh={class:"account-summary"},$h={class:"summary-card"},tp={class:"amount"},ep={class:"summary-card"},sp={class:"amount"},np={class:"summary-card"},op={class:"amount"},rp={class:"table"},ip={class:"category"},lp={class:"currency"},ap={class:"currency"},cp={class:"vat-percentage"},up={class:"actions"},dp=["onClick"],fp=["onClick"],mp=["onClick"];function hp(e,t,r,i,n,o){return r.activeSection==="chart-of-accounts"?(m(),h("div",Wh,[s("div",Jh,[t[2]||(t[2]=s("h2",null,"Chart of Accounts",-1)),s("div",Gh,[s("input",{type:"text",value:r.accountSearch,onInput:t[0]||(t[0]=l=>e.$emit("search-accounts",l.target.value)),placeholder:"Search accounts...",style:{padding:"8px",border:"1px solid #ddd","border-radius":"4px"}},null,40,Yh),s("button",{class:"btn btn-primary",onClick:t[1]||(t[1]=l=>e.$emit("add-account"))},"Add New Account")])]),r.accountsLoading?(m(),h("div",zh," Loading accounts... ")):r.accounts.length===0?(m(),h("div",Xh," No accounts found. Create your first account! ")):(m(),h("div",Qh,[s("div",Zh,[s("div",$h,[t[3]||(t[3]=s("h3",null,"Total Assets",-1)),s("p",tp,u(o.formatCurrency(o.totalAssets)),1)]),s("div",ep,[t[4]||(t[4]=s("h3",null,"Total Liabilities",-1)),s("p",sp,u(o.formatCurrency(o.totalLiabilities)),1)]),s("div",np,[t[5]||(t[5]=s("h3",null,"Total Equity",-1)),s("p",op,u(o.formatCurrency(o.totalEquity)),1)])]),s("table",rp,[t[6]||(t[6]=s("thead",null,[s("tr",null,[s("th",null,"Account Number"),s("th",null,"Account Name"),s("th",null,"Type"),s("th",null,"Category"),s("th",null,"Description"),s("th",null,"Opening Balance"),s("th",null,"Current Balance"),s("th",null,"VAT %"),s("th",null,"Status"),s("th",null,"Actions")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(r.accounts,l=>(m(),h("tr",{key:l.id,class:O({inactive:!l.is_active})},[s("td",null,u(l.account_number),1),s("td",null,u(l.account_name),1),s("td",null,[s("span",{class:O(["account-type",l.account_type])},u(o.formatAccountType(l.account_type)),3)]),s("td",ip,u(o.getAccountCategory(l.account_type)),1),s("td",null,u(l.description||"-"),1),s("td",lp,u(o.formatCurrency(l.opening_balance,"EUR")),1),s("td",ap,u(o.formatCurrency(l.current_balance,"EUR")),1),s("td",cp,u(o.formatVAT(l.vat_percentage)),1),s("td",null,[s("span",{class:O(["status-badge",l.is_active?"active":"inactive"])},u(l.is_active?"Active":"Inactive"),3)]),s("td",null,[s("div",up,[s("button",{class:"btn btn-primary",onClick:a=>e.$emit("view-account",l)},"View",8,dp),s("button",{class:"btn btn-warning",onClick:a=>e.$emit("edit-account",l)},"Edit",8,fp),s("button",{class:"btn btn-danger",onClick:a=>e.$emit("delete-account",l.id)},"Delete",8,mp)])])],2))),128))])])]))])):A("",!0)}const pp=Nt(Kh,[["render",hp],["__scopeId","data-v-f6f5aa34"]]);const gp={name:"AccountingSection",props:{activeSection:{type:String,required:!0},invoices:{type:Array,required:!0},invoicesLoading:{type:Boolean,default:!1},journalEntries:{type:Array,required:!0},journalEntriesLoading:{type:Boolean,default:!1},transactions:{type:Array,required:!0},transactionsLoading:{type:Boolean,default:!1},searchTerm:{type:String,default:""}},emits:["add-invoice","view-invoice","edit-invoice","delete-invoice","search-invoices","add-journal-entry","view-journal-entry","edit-journal-entry","delete-journal-entry","search"],data(){return{activeTab:"journal"}},computed:{totalRevenue(){return this.transactions.filter(e=>e.credit_amount>0).reduce((e,t)=>e+parseFloat(t.credit_amount||0),0)},totalExpenses(){return this.transactions.filter(e=>e.debit_amount>0).reduce((e,t)=>e+parseFloat(t.debit_amount||0),0)},netIncome(){return this.totalRevenue-this.totalExpenses}},methods:{formatCurrency:Pe,formatDateTime:vo,formatVAT(e){return e==null||e===0?"-":`${parseFloat(e).toFixed(2)}%`},getEntryDebits(e){return e.transactions?e.transactions.filter(t=>t.debit_amount>0).reduce((t,r)=>t+parseFloat(r.debit_amount||0),0):0},getEntryCredits(e){return e.transactions?e.transactions.filter(t=>t.credit_amount>0).reduce((t,r)=>t+parseFloat(r.credit_amount||0),0):0},getEntryBalance(e){return this.getEntryCredits(e)-this.getEntryDebits(e)}}},yp={key:0,class:"card"},_p={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-bottom":"20px"}},vp={style:{display:"flex",gap:"10px"}},bp=["value"],wp={class:"accounting-dashboard"},kp={class:"dashboard-cards"},Cp={class:"dashboard-card"},Tp={class:"amount"},Ep={class:"dashboard-card"},xp={class:"amount"},Fp={class:"dashboard-card"},Sp={class:"dashboard-card"},Pp={class:"count"},Ap={class:"accounting-tabs"},Mp={key:0,class:"tab-content"},Dp={key:0,class:"loading"},Rp={key:1,class:"loading"},Ip={key:2,class:"table"},jp={class:"currency"},Op={class:"currency"},Up={class:"currency"},Lp={class:"actions"},Np=["onClick"],Vp=["onClick"],Hp=["onClick"],Bp={key:1,class:"tab-content"},qp={key:0,class:"loading"},Kp={key:1,class:"loading"},Wp={key:2,class:"table"},Jp={class:"currency"},Gp={class:"currency"},Yp={class:"vat-percentage"},zp={class:"currency"},Xp={key:2,class:"tab-content"},Qp={key:0,class:"loading"},Zp={key:1,class:"loading"},$p={key:2,class:"table"},tg=["innerHTML"],eg={class:"actions"},sg=["onClick"],ng=["onClick"],og=["onClick"];function rg(e,t,r,i,n,o){return r.activeSection==="accounting"?(m(),h("div",yp,[s("div",_p,[t[6]||(t[6]=s("h2",null,"Accounting",-1)),s("div",vp,[s("button",{class:"btn btn-primary",onClick:t[0]||(t[0]=l=>e.$emit("add-journal-entry"))},"New Journal Entry"),s("button",{class:"btn btn-success",onClick:t[1]||(t[1]=l=>e.$emit("add-invoice"))},"Create Invoice"),s("input",{type:"text",value:r.searchTerm,onInput:t[2]||(t[2]=l=>e.$emit("search",l.target.value)),placeholder:"Search...",style:{padding:"8px",border:"1px solid #ddd","border-radius":"4px"}},null,40,bp)])]),s("div",wp,[s("div",kp,[s("div",Cp,[t[7]||(t[7]=s("h3",null,"Total Revenue",-1)),s("p",Tp,u(o.formatCurrency(o.totalRevenue)),1)]),s("div",Ep,[t[8]||(t[8]=s("h3",null,"Total Expenses",-1)),s("p",xp,u(o.formatCurrency(o.totalExpenses)),1)]),s("div",Fp,[t[9]||(t[9]=s("h3",null,"Net Income",-1)),s("p",{class:O(["amount",{negative:o.netIncome<0}])},u(o.formatCurrency(o.netIncome)),3)]),s("div",Sp,[t[10]||(t[10]=s("h3",null,"Journal Entries",-1)),s("p",Pp,u(r.journalEntries.length),1)])])]),s("div",Ap,[s("button",{class:O(["tab-btn",{active:n.activeTab==="journal"}]),onClick:t[3]||(t[3]=l=>n.activeTab="journal")}," Journal Entries ",2),s("button",{class:O(["tab-btn",{active:n.activeTab==="transactions"}]),onClick:t[4]||(t[4]=l=>n.activeTab="transactions")}," Transactions ",2),s("button",{class:O(["tab-btn",{active:n.activeTab==="invoices"}]),onClick:t[5]||(t[5]=l=>n.activeTab="invoices")}," Invoices ",2)]),n.activeTab==="journal"?(m(),h("div",Mp,[r.journalEntriesLoading?(m(),h("div",Dp," Loading journal entries... ")):r.journalEntries.length===0?(m(),h("div",Rp," No journal entries found. Create your first journal entry! ")):(m(),h("table",Ip,[t[11]||(t[11]=s("thead",null,[s("tr",null,[s("th",null,"Entry #"),s("th",null,"Date"),s("th",null,"Description"),s("th",null,"Reference"),s("th",null,"Debits"),s("th",null,"Credits"),s("th",null,"Balance"),s("th",null,"Actions")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(r.journalEntries,l=>(m(),h("tr",{key:l.id},[s("td",null,u(l.entry_number),1),s("td",null,u(e.formatDate(l.entry_date)),1),s("td",null,u(l.description),1),s("td",null,u(l.reference_number||"-"),1),s("td",jp,u(o.formatCurrency(o.getEntryDebits(l))),1),s("td",Op,u(o.formatCurrency(o.getEntryCredits(l))),1),s("td",Up,u(o.formatCurrency(o.getEntryBalance(l))),1),s("td",null,[s("div",Lp,[s("button",{class:"btn btn-primary",onClick:a=>e.$emit("view-journal-entry",l)},"View",8,Np),s("button",{class:"btn btn-warning",onClick:a=>e.$emit("edit-journal-entry",l)},"Edit",8,Vp),s("button",{class:"btn btn-danger",onClick:a=>e.$emit("delete-journal-entry",l.id)},"Delete",8,Hp)])])]))),128))])]))])):A("",!0),n.activeTab==="transactions"?(m(),h("div",Bp,[r.transactionsLoading?(m(),h("div",qp," Loading transactions... ")):r.transactions.length===0?(m(),h("div",Kp," No transactions found. ")):(m(),h("table",Wp,[t[12]||(t[12]=s("thead",null,[s("tr",null,[s("th",null,"Date"),s("th",null,"Account"),s("th",null,"Description"),s("th",null,"Debit"),s("th",null,"Credit"),s("th",null,"VAT %"),s("th",null,"Balance")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(r.transactions,l=>(m(),h("tr",{key:l.id},[s("td",null,u(e.formatDate(l.created_at)),1),s("td",null,u(l.account_name||"Account #"+l.account_id),1),s("td",null,u(l.description),1),s("td",Jp,u(o.formatCurrency(l.debit_amount)),1),s("td",Gp,u(o.formatCurrency(l.credit_amount)),1),s("td",Yp,u(o.formatVAT(l.vat_percentage)),1),s("td",zp,u(o.formatCurrency(l.amount)),1)]))),128))])]))])):A("",!0),n.activeTab==="invoices"?(m(),h("div",Xp,[r.invoicesLoading?(m(),h("div",Qp," Loading invoices... ")):r.invoices.length===0?(m(),h("div",Zp," No invoices found. Create your first invoice! ")):(m(),h("table",$p,[t[13]||(t[13]=s("thead",null,[s("tr",null,[s("th",null,"Invoice #"),s("th",null,"Client"),s("th",null,"Issue Date"),s("th",null,"Due Date"),s("th",null,"Status"),s("th",null,"Total"),s("th",null,"Actions")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(r.invoices,l=>(m(),h("tr",{key:l.id},[s("td",null,u(l.invoice_number),1),s("td",null,u(l.client_name),1),s("td",null,u(o.formatDateTime(l.issue_date)),1),s("td",null,u(o.formatDateTime(l.due_date)),1),s("td",{innerHTML:l.getStatusBadge()},null,8,tg),s("td",null,u(o.formatCurrency(l.total_amount)),1),s("td",null,[s("div",eg,[s("button",{class:"btn btn-primary",onClick:a=>e.$emit("view-invoice",l)},"View",8,sg),s("button",{class:"btn btn-warning",onClick:a=>e.$emit("edit-invoice",l)},"Edit",8,ng),s("button",{class:"btn btn-danger",onClick:a=>e.$emit("delete-invoice",l.id)},"Delete",8,og)])])]))),128))])]))])):A("",!0)])):A("",!0)}const ig=Nt(gp,[["render",rg],["__scopeId","data-v-cb91f068"]]);const lg={name:"ExcelAccountingSection",emits:["add-entry","edit-entry","delete-entry"],data(){return{entries:[],loading:!1,showEntryModal:!1,isEditingEntry:!1,currentPage:1,itemsPerPage:50,categories:[],categoriesLoading:!1,filters:{date:"",type:"",category:""},entryForm:{id:null,entry_date:"",description:"",entry_type:"",category:"",tax_free_amount:0,vat_percentage:24,vat_25_5:0,vat_14:0,vat_10:0,total_amount:0,net_amount:0,vat_amount:0,reference_number:""}}},computed:{availableCategories(){return this.entryForm.entry_type?this.categories.filter(e=>e.type===this.entryForm.entry_type):[]},filteredEntries(){let e=this.entries;return this.filters.date&&(e=e.filter(t=>t.entry_date>=this.filters.date)),this.filters.type&&(e=e.filter(t=>t.entry_type===this.filters.type)),this.filters.category&&(e=e.filter(t=>t.category&&t.category.toLowerCase().includes(this.filters.category.toLowerCase()))),e},paginatedEntries(){const e=(this.currentPage-1)*this.itemsPerPage,t=e+this.itemsPerPage;return this.filteredEntries.slice(e,t)},totalPages(){return Math.ceil(this.filteredEntries.length/this.itemsPerPage)},totalIncome(){return this.entries.filter(e=>e.entry_type==="Tulo").reduce((e,t)=>e+parseFloat(t.total_amount||0),0)},totalExpenses(){return this.entries.filter(e=>e.entry_type==="Kulu").reduce((e,t)=>e+parseFloat(t.total_amount||0),0)},netBalance(){return this.totalIncome-this.totalExpenses}},methods:{formatCurrency:Pe,formatDate:ze,async fetchEntries(){this.loading=!0;try{const e=await M.get("/api/accounting_entries.php");this.entries=e.data.records||[]}catch(e){console.error("Error fetching entries:",e)}finally{this.loading=!1}},async fetchCategories(){this.categoriesLoading=!0;try{const e=await M.get("/api/accounting_categories.php");this.categories=e.data||[]}catch(e){console.error("Error fetching categories:",e)}finally{this.categoriesLoading=!1}},showAddEntryModal(){this.isEditingEntry=!1,this.entryForm={id:null,entry_date:new Date().toISOString().split("T")[0],description:"",entry_type:"",category:"",tax_free_amount:0,vat_percentage:24,vat_25_5:0,vat_14:0,vat_10:0,total_amount:0,net_amount:0,vat_amount:0,reference_number:""},this.showEntryModal=!0},onCategoryChange(){if(this.entryForm.category){const e=this.categories.find(t=>t.code===this.entryForm.category);e&&(this.entryForm.vat_percentage=parseFloat(e.vat_percentage)||0,this.calculateVAT())}},onEntryTypeChange(){this.entryForm.category=""},editEntry(e){this.isEditingEntry=!0,this.entryForm={...e},this.showEntryModal=!0},closeEntryModal(){this.showEntryModal=!1,this.entryForm={id:null,entry_date:"",description:"",entry_type:"",category:"",tax_free_amount:0,vat_percentage:24,vat_25_5:0,vat_14:0,vat_10:0,total_amount:0,net_amount:0,vat_amount:0,reference_number:""}},calculateVAT(){const e=parseFloat(this.entryForm.vat_percentage)||0,t=parseFloat(this.entryForm.total_amount)||0;e===25.5?(this.entryForm.vat_25_5=t*.255/1.255,this.entryForm.vat_14=0,this.entryForm.vat_10=0):e===14?(this.entryForm.vat_25_5=0,this.entryForm.vat_14=t*.14/1.14,this.entryForm.vat_10=0):e===10?(this.entryForm.vat_25_5=0,this.entryForm.vat_14=0,this.entryForm.vat_10=t*.1/1.1):(this.entryForm.vat_25_5=0,this.entryForm.vat_14=0,this.entryForm.vat_10=0),this.entryForm.vat_amount=this.entryForm.vat_25_5+this.entryForm.vat_14+this.entryForm.vat_10,this.entryForm.net_amount=t-this.entryForm.vat_amount,this.entryForm.yhteensa=this.entryForm.vat_amount},calculateTotals(){const e=parseFloat(this.entryForm.tax_free_amount)||0,t=parseFloat(this.entryForm.vat_percentage)||0;t===25.5?(this.entryForm.vat_25_5=Math.round(e*.255*100)/100,this.entryForm.vat_14=0,this.entryForm.vat_10=0):t===14?(this.entryForm.vat_25_5=0,this.entryForm.vat_14=Math.round(e*.14*100)/100,this.entryForm.vat_10=0):t===10?(this.entryForm.vat_25_5=0,this.entryForm.vat_14=0,this.entryForm.vat_10=Math.round(e*.1*100)/100):(this.entryForm.vat_25_5=0,this.entryForm.vat_14=0,this.entryForm.vat_10=0);const r=parseFloat(this.entryForm.vat_25_5)||0,i=parseFloat(this.entryForm.vat_14)||0,n=parseFloat(this.entryForm.vat_10)||0;this.entryForm.total_amount=Math.round((e+r+i+n)*100)/100,this.entryForm.vat_amount=Math.round((r+i+n)*100)/100,this.entryForm.net_amount=Math.round(e*100)/100},async saveEntry(){try{this.isEditingEntry?await M.put(`/api/accounting_entries.php?id=${this.entryForm.id}`,this.entryForm):await M.post("/api/accounting_entries.php",this.entryForm),this.closeEntryModal(),this.fetchEntries()}catch(e){console.error("Error saving entry:",e)}},async deleteEntry(e){if(confirm("Haluatko varmasti poistaa tämän tapahtuman?"))try{await M.delete(`/api/accounting_entries.php?id=${e}`),this.fetchEntries()}catch(t){console.error("Error deleting entry:",t)}},applyFilters(){this.currentPage=1},exportToExcel(){alert("Excel-vienti ominaisuus tulossa pian!")}},mounted(){this.fetchEntries(),this.fetchCategories()}},ag={class:"excel-accounting-section"},cg={class:"section-header"},ug={class:"header-actions"},dg={class:"filters"},fg={class:"filter-group"},mg={class:"filter-group"},hg={class:"filter-group"},pg={class:"summary-cards"},gg={class:"summary-card income"},yg={class:"amount"},_g={class:"summary-card expenses"},vg={class:"amount"},bg={class:"amount"},wg={class:"entries-section"},kg={key:0,class:"loading"},Cg={key:1,class:"no-data"},Tg={key:2,class:"table"},Eg={class:"currency"},xg={class:"percentage"},Fg={class:"currency"},Sg={class:"currency"},Pg={class:"currency"},Ag={class:"currency"},Mg={class:"currency"},Dg={class:"currency"},Rg={class:"actions"},Ig=["onClick"],jg=["onClick"],Og={key:3,class:"pagination"},Ug=["disabled"],Lg={class:"page-info"},Ng=["disabled"],Vg={class:"modal-content"},Hg={class:"form-row"},Bg={class:"form-group"},qg={class:"form-group"},Kg={class:"form-group"},Wg={class:"form-group"},Jg=["value"],Gg={class:"form-row"},Yg={class:"form-group"},zg={class:"form-group"},Xg={class:"form-row"},Qg={class:"form-group"},Zg={class:"form-group"},$g={class:"form-actions"},t1={type:"submit",class:"btn btn-success"};function e1(e,t,r,i,n,o){return m(),h("div",ag,[s("div",cg,[t[29]||(t[29]=s("h2",null,"Excel-pohjan Kirjanpito",-1)),s("div",ug,[s("button",{class:"btn btn-primary",onClick:t[0]||(t[0]=(...l)=>o.showAddEntryModal&&o.showAddEntryModal(...l))},[...t[27]||(t[27]=[s("i",{class:"fas fa-plus"},null,-1),j(" Lisää Tapahtuma ",-1)])]),s("button",{class:"btn btn-secondary",onClick:t[1]||(t[1]=(...l)=>o.exportToExcel&&o.exportToExcel(...l))},[...t[28]||(t[28]=[s("i",{class:"fas fa-download"},null,-1),j(" Vie Excel ",-1)])])])]),s("div",dg,[s("div",fg,[t[30]||(t[30]=s("label",{for:"dateFilter"},"Päivämäärä:",-1)),C(s("input",{type:"date",id:"dateFilter","onUpdate:modelValue":t[2]||(t[2]=l=>n.filters.date=l),onChange:t[3]||(t[3]=(...l)=>o.applyFilters&&o.applyFilters(...l))},null,544),[[R,n.filters.date]])]),s("div",mg,[t[32]||(t[32]=s("label",{for:"typeFilter"},"Tyyppi:",-1)),C(s("select",{id:"typeFilter","onUpdate:modelValue":t[4]||(t[4]=l=>n.filters.type=l),onChange:t[5]||(t[5]=(...l)=>o.applyFilters&&o.applyFilters(...l))},[...t[31]||(t[31]=[s("option",{value:""},"Kaikki",-1),s("option",{value:"Tulo"},"Tulo",-1),s("option",{value:"Kulu"},"Kulu",-1)])],544),[[ft,n.filters.type]])]),s("div",hg,[t[33]||(t[33]=s("label",{for:"categoryFilter"},"Luokka:",-1)),C(s("input",{type:"text",id:"categoryFilter","onUpdate:modelValue":t[6]||(t[6]=l=>n.filters.category=l),placeholder:"Hae luokasta...",onInput:t[7]||(t[7]=(...l)=>o.applyFilters&&o.applyFilters(...l))},null,544),[[R,n.filters.category]])])]),s("div",pg,[s("div",gg,[t[34]||(t[34]=s("h3",null,"Tulot",-1)),s("p",yg,u(o.formatCurrency(o.totalIncome)),1)]),s("div",_g,[t[35]||(t[35]=s("h3",null,"Kulut",-1)),s("p",vg,u(o.formatCurrency(o.totalExpenses)),1)]),s("div",{class:O(["summary-card balance",{positive:o.netBalance>=0,negative:o.netBalance<0}])},[t[36]||(t[36]=s("h3",null,"Saldo",-1)),s("p",bg,u(o.formatCurrency(o.netBalance)),1)],2)]),s("div",wg,[n.loading?(m(),h("div",kg," Ladataan tapahtumia... ")):o.filteredEntries.length===0?(m(),h("div",Cg," Ei tapahtumia löytynyt. ")):(m(),h("table",Tg,[t[37]||(t[37]=s("thead",null,[s("tr",null,[s("th",null,"Päivämäärä"),s("th",null,"Kuvaus"),s("th",null,"Tyyppi"),s("th",null,"Luokka"),s("th",null,"Veroton summa"),s("th",null,"ALV %"),s("th",null,"ALV 25,5%"),s("th",null,"ALV 14%"),s("th",null,"ALV 10%"),s("th",null,"Yhteensä"),s("th",null,"Netto"),s("th",null,"ALV"),s("th",null,"Viite"),s("th",null,"Toiminnot")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(o.paginatedEntries,l=>(m(),h("tr",{key:l.id,class:O({income:l.entry_type==="Tulo",expense:l.entry_type==="Kulu"})},[s("td",null,u(o.formatDate(l.entry_date)),1),s("td",null,u(l.description),1),s("td",null,[s("span",{class:O(["entry-type-badge",l.entry_type.toLowerCase()])},u(l.entry_type),3)]),s("td",null,u(l.category||"-"),1),s("td",Eg,u(o.formatCurrency(l.tax_free_amount)),1),s("td",xg,u(l.vat_percentage)+"%",1),s("td",Fg,u(o.formatCurrency(l.vat_25_5)),1),s("td",Sg,u(o.formatCurrency(l.vat_14)),1),s("td",Pg,u(o.formatCurrency(l.vat_10)),1),s("td",Ag,u(o.formatCurrency(l.total_amount)),1),s("td",Mg,u(o.formatCurrency(l.net_amount)),1),s("td",Dg,u(o.formatCurrency(l.vat_amount)),1),s("td",null,u(l.reference_number||"-"),1),s("td",null,[s("div",Rg,[s("button",{class:"btn btn-sm btn-primary",onClick:a=>o.editEntry(l)},"Muokkaa",8,Ig),s("button",{class:"btn btn-sm btn-danger",onClick:a=>o.deleteEntry(l.id)},"Poista",8,jg)])])],2))),128))])])),o.totalPages>1?(m(),h("div",Og,[s("button",{class:"btn btn-secondary",onClick:t[8]||(t[8]=l=>n.currentPage--),disabled:n.currentPage<=1}," Edellinen ",8,Ug),s("span",Lg,"Sivu "+u(n.currentPage)+" / "+u(o.totalPages),1),s("button",{class:"btn btn-secondary",onClick:t[9]||(t[9]=l=>n.currentPage++),disabled:n.currentPage>=o.totalPages}," Seuraava ",8,Ng)])):A("",!0)]),n.showEntryModal?(m(),h("div",{key:0,class:"modal",onClick:t[26]||(t[26]=$((...l)=>o.closeEntryModal&&o.closeEntryModal(...l),["self"]))},[s("div",Vg,[s("span",{class:"close",onClick:t[10]||(t[10]=(...l)=>o.closeEntryModal&&o.closeEntryModal(...l))},"×"),s("h2",null,u(n.isEditingEntry?"Muokkaa Tapahtumaa":"Lisää Tapahtuma"),1),s("form",{onSubmit:t[25]||(t[25]=$((...l)=>o.saveEntry&&o.saveEntry(...l),["prevent"]))},[s("div",Hg,[s("div",Bg,[t[38]||(t[38]=s("label",{for:"entry_date"},"Päivämäärä *",-1)),C(s("input",{type:"date",id:"entry_date","onUpdate:modelValue":t[11]||(t[11]=l=>n.entryForm.entry_date=l),required:""},null,512),[[R,n.entryForm.entry_date]])]),s("div",qg,[t[40]||(t[40]=s("label",{for:"entry_type"},"Tyyppi *",-1)),C(s("select",{id:"entry_type","onUpdate:modelValue":t[12]||(t[12]=l=>n.entryForm.entry_type=l),onChange:t[13]||(t[13]=(...l)=>o.onEntryTypeChange&&o.onEntryTypeChange(...l)),required:""},[...t[39]||(t[39]=[s("option",{value:""},"Valitse tyyppi",-1),s("option",{value:"Tulo"},"Tulo",-1),s("option",{value:"Kulu"},"Kulu",-1)])],544),[[ft,n.entryForm.entry_type]])])]),s("div",Kg,[t[41]||(t[41]=s("label",{for:"description"},"Kuvaus *",-1)),C(s("textarea",{id:"description","onUpdate:modelValue":t[14]||(t[14]=l=>n.entryForm.description=l),required:"",placeholder:"Syötä tapahtuman kuvaus..."},null,512),[[R,n.entryForm.description]])]),s("div",Wg,[t[43]||(t[43]=s("label",{for:"category"},"Luokka",-1)),C(s("select",{id:"category","onUpdate:modelValue":t[15]||(t[15]=l=>n.entryForm.category=l),onChange:t[16]||(t[16]=(...l)=>o.onCategoryChange&&o.onCategoryChange(...l))},[t[42]||(t[42]=s("option",{value:""},"Valitse luokka",-1)),(m(!0),h(H,null,z(o.availableCategories,l=>(m(),h("option",{key:l.code,value:l.code},u(l.name),9,Jg))),128))],544),[[ft,n.entryForm.category]])]),s("div",Gg,[s("div",Yg,[t[44]||(t[44]=s("label",{for:"tax_free_amount"},"Veroton summa",-1)),C(s("input",{type:"number",id:"tax_free_amount","onUpdate:modelValue":t[17]||(t[17]=l=>n.entryForm.tax_free_amount=l),step:"0.01",min:"0",onInput:t[18]||(t[18]=(...l)=>o.calculateTotals&&o.calculateTotals(...l))},null,544),[[R,n.entryForm.tax_free_amount]])]),s("div",zg,[t[46]||(t[46]=s("label",{for:"vat_percentage"},"ALV %",-1)),C(s("select",{id:"vat_percentage","onUpdate:modelValue":t[19]||(t[19]=l=>n.entryForm.vat_percentage=l),onChange:t[20]||(t[20]=(...l)=>o.calculateTotals&&o.calculateTotals(...l))},[...t[45]||(t[45]=[s("option",{value:"0"},"0%",-1),s("option",{value:"10"},"10%",-1),s("option",{value:"14"},"14%",-1),s("option",{value:"25.5"},"25.5%",-1)])],544),[[ft,n.entryForm.vat_percentage]])])]),s("div",Xg,[s("div",Qg,[t[47]||(t[47]=s("label",{for:"total_amount"},"Yhteensä *",-1)),C(s("input",{type:"number",id:"total_amount","onUpdate:modelValue":t[21]||(t[21]=l=>n.entryForm.total_amount=l),step:"0.01",required:"",onInput:t[22]||(t[22]=(...l)=>o.calculateVAT&&o.calculateVAT(...l))},null,544),[[R,n.entryForm.total_amount]])]),s("div",Zg,[t[48]||(t[48]=s("label",{for:"reference_number"},"Viitenumero",-1)),C(s("input",{type:"text",id:"reference_number","onUpdate:modelValue":t[23]||(t[23]=l=>n.entryForm.reference_number=l),placeholder:"Viitenumero..."},null,512),[[R,n.entryForm.reference_number]])])]),s("div",$g,[s("button",{type:"button",class:"btn",onClick:t[24]||(t[24]=(...l)=>o.closeEntryModal&&o.closeEntryModal(...l))},"Peruuta"),s("button",t1,u(n.isEditingEntry?"Päivitä":"Tallenna"),1)])],32)])])):A("",!0)])}const s1=Nt(lg,[["render",e1],["__scopeId","data-v-d1da1975"]]);const n1={name:"TuloslaskelmaSection",props:{activeSection:{type:String,required:!0}},data(){return{loading:!1,selectedPeriod:"current",selectedMonth:new Date().toISOString().slice(0,7),selectedYear:new Date().getFullYear(),companyName:"",companyYtunnus:"",tuloslaskelmaData:null,salesRevenue:[],otherRevenue:[],costOfGoods:[],personnelExpenses:[],otherExpenses:[],depreciation:[],taxExpenses:[]}},computed:{periodDescription(){switch(this.selectedPeriod){case"current":return"Nykyinen kausi";case"month":return`Kuukausi: ${this.formatMonth(this.selectedMonth)}`;case"quarter":return`Neljännes: ${this.selectedYear}`;case"year":return`Vuosi: ${this.selectedYear}`;default:return"Nykyinen kausi"}},salesRevenueTotal(){return this.calculateTotal(this.salesRevenue||[])},otherRevenueTotal(){return this.calculateTotal(this.otherRevenue||[])},totalRevenue(){return this.calculateTotal([...this.salesRevenue||[],...this.otherRevenue||[]])},costOfGoodsTotal(){return this.calculateTotal(this.costOfGoods||[])},personnelExpensesTotal(){return this.calculateTotal(this.personnelExpenses||[])},otherExpensesTotal(){return this.calculateTotal(this.otherExpenses||[])},depreciationTotal(){return this.calculateTotal(this.depreciation||[])},taxExpensesTotal(){return this.calculateTotal(this.taxExpenses||[])},totalExpenses(){return this.calculateTotal([...this.costOfGoods||[],...this.personnelExpenses||[],...this.otherExpenses||[],...this.depreciation||[]])},grossProfit(){const e=this.salesRevenueTotal,t=this.costOfGoodsTotal;return{previous:(e.previous||0)-(t.previous||0),current:(e.current||0)-(t.current||0)}},profitBeforeTax(){const e=this.totalRevenue,t=this.totalExpenses;return{previous:(e.previous||0)-(t.previous||0),current:(e.current||0)-(t.current||0)}},netProfit(){const e=this.profitBeforeTax,t=this.taxExpensesTotal;return{previous:(e.previous||0)-(t.previous||0),current:(e.current||0)-(t.current||0)}},grossMargin(){const e=this.totalRevenue.current||0,t=this.grossProfit.current||0;return e>0?t/e*100:0},grossMarginChange(){const e=this.grossMargin,t=this.totalRevenue.previous||0,r=this.grossProfit.previous||0,i=t>0?r/t*100:0;return e-i}},methods:{formatCurrency:Pe,formatDate:ze,async loadTuloslaskelma(){this.loading=!0;try{await this.loadCompanyDetails();const e=await M.get("/api/tuloslaskelma.php",{params:{period:this.selectedPeriod,month:this.selectedMonth,year:this.selectedYear}});e.data.success?(this.tuloslaskelmaData=e.data.data,this.updateDataFromAPI(e.data.data)):console.error("API error:",e.data.message)}catch(e){console.error("Error loading tuloslaskelma:",e)}finally{this.loading=!1}},async loadCompanyDetails(){try{const e=await M.get("/api/company.php");if(e.data.success){const t=e.data.data;this.companyName=t.name,this.companyYtunnus=t.y_tunnus}}catch(e){console.error("Error loading company details:",e)}},updateDataFromAPI(e){const t=e.current_period||{},r=e.comparison||{};this.salesRevenue=this.processGroupedData(t.sales_revenue||[],r.sales_revenue||[]),this.otherRevenue=this.processGroupedData(t.other_revenue||[],r.other_revenue||[]),this.costOfGoods=this.processGroupedData(t.cost_of_goods||[],r.cost_of_goods||[]),this.personnelExpenses=this.processGroupedData(t.personnel_expenses||[],r.personnel_expenses||[]),this.otherExpenses=this.processGroupedData(t.other_expenses||[],r.other_expenses||[]),this.depreciation=this.processGroupedData(t.depreciation||[],r.depreciation||[]),this.taxExpenses=this.processGroupedData(t.tax_expenses||[],r.tax_expenses||[])},processGroupedData(e,t){return e.map((r,i)=>{const n=t[i]||{};return{code:r.code,name:r.name,currentAmount:r.currentAmount||0,previousAmount:r.previousAmount||0,change:n.change||0,changePercent:n.changePercent||0,isGroup:r.isGroup||!1}})},calculateTotal(e){const t=e.reduce((r,i)=>(r.previous+=i.previousAmount,r.current+=i.currentAmount,r),{previous:0,current:0});return t.change=t.current-t.previous,t.changePercent=t.previous!==0?t.change/t.previous*100:0,t},getChangeClass(e){return e>0?"positive":e<0?"negative":"neutral"},formatPercent(e){return e==null||isNaN(e)?"0.0%":`${Number(e).toFixed(1)}%`},formatMonth(e){const[t,r]=e.split("-");return new Date(t,r-1).toLocaleDateString("fi-FI",{year:"numeric",month:"long"})},exportToPDF(){window.print()},printReport(){window.print()}},mounted(){this.loadTuloslaskelma()}},o1={class:"card"},r1={class:"section-header"},i1={class:"header-actions"},l1={key:0,class:"loading"},a1={key:1,class:"tuloslaskelma-container"},c1={class:"report-header"},u1={class:"company-info"},d1={class:"period-info"},f1={class:"tuloslaskelma-table"},m1={key:0,class:"group-header"},h1={colspan:"6",class:"account-group-name"},p1={class:"account-indent"},g1={class:"account-name"},y1={class:"amount"},_1={class:"amount"},v1={class:"subtotal-row"},b1={class:"amount subtotal"},w1={class:"amount subtotal"},k1={key:0,class:"group-header"},C1={colspan:"6",class:"account-group-name"},T1={class:"account-indent"},E1={class:"account-name"},x1={class:"amount"},F1={class:"amount"},S1={class:"subtotal-row"},P1={class:"amount subtotal"},A1={class:"amount subtotal"},M1={class:"total-row revenue"},D1={class:"amount total"},R1={class:"amount total"},I1={key:0,class:"group-header"},j1={colspan:"6",class:"account-group-name"},O1={class:"account-indent"},U1={class:"account-name"},L1={class:"amount"},N1={class:"amount"},V1={class:"subtotal-row"},H1={class:"amount subtotal"},B1={class:"amount subtotal"},q1={class:"total-row gross-profit"},K1={class:"amount total"},W1={class:"amount total"},J1={key:0,class:"group-header"},G1={colspan:"6",class:"account-group-name"},Y1={class:"account-indent"},z1={class:"account-name"},X1={class:"amount"},Q1={class:"amount"},Z1={class:"subtotal-row"},$1={class:"amount subtotal"},ty={class:"amount subtotal"},ey={key:0,class:"group-header"},sy={colspan:"6",class:"account-group-name"},ny={class:"account-indent"},oy={class:"account-name"},ry={class:"amount"},iy={class:"amount"},ly={class:"subtotal-row"},ay={class:"amount subtotal"},cy={class:"amount subtotal"},uy={key:0,class:"group-header"},dy={colspan:"6",class:"account-group-name"},fy={class:"account-indent"},my={class:"account-name"},hy={class:"amount"},py={class:"amount"},gy={class:"subtotal-row"},yy={class:"amount subtotal"},_y={class:"amount subtotal"},vy={class:"total-row expenses"},by={class:"amount total"},wy={class:"amount total"},ky={class:"total-row profit-before-tax"},Cy={class:"amount total"},Ty={class:"amount total"},Ey={key:0,class:"group-header"},xy={colspan:"6",class:"account-group-name"},Fy={class:"account-indent"},Sy={class:"account-name"},Py={class:"amount"},Ay={class:"amount"},My={class:"subtotal-row"},Dy={class:"amount subtotal"},Ry={class:"amount subtotal"},Iy={class:"total-row net-profit"},jy={class:"amount total"},Oy={class:"amount total"},Uy={class:"summary-cards"},Ly={class:"summary-card revenue"},Ny={class:"amount"},Vy={class:"summary-card expenses"},Hy={class:"amount"},By={class:"summary-card profit"},qy={class:"amount"},Ky={class:"summary-card margin"},Wy={class:"amount"};function Jy(e,t,r,i,n,o){return m(),h("div",o1,[s("div",r1,[t[9]||(t[9]=s("h2",null,"Tuloslaskelma",-1)),s("div",i1,[C(s("select",{"onUpdate:modelValue":t[0]||(t[0]=l=>n.selectedPeriod=l),onChange:t[1]||(t[1]=(...l)=>o.loadTuloslaskelma&&o.loadTuloslaskelma(...l)),class:"period-selector"},[...t[8]||(t[8]=[s("option",{value:"current"},"Nykyinen kausi",-1),s("option",{value:"month"},"Kuukausi",-1),s("option",{value:"quarter"},"Neljännes",-1),s("option",{value:"year"},"Vuosi",-1)])],544),[[ft,n.selectedPeriod]]),n.selectedPeriod==="month"?C((m(),h("input",{key:0,type:"month","onUpdate:modelValue":t[2]||(t[2]=l=>n.selectedMonth=l),onChange:t[3]||(t[3]=(...l)=>o.loadTuloslaskelma&&o.loadTuloslaskelma(...l)),class:"month-input"},null,544)),[[R,n.selectedMonth]]):A("",!0),n.selectedPeriod==="year"?C((m(),h("input",{key:1,type:"number","onUpdate:modelValue":t[4]||(t[4]=l=>n.selectedYear=l),onChange:t[5]||(t[5]=(...l)=>o.loadTuloslaskelma&&o.loadTuloslaskelma(...l)),placeholder:"Vuosi",min:"2020",max:"2030",class:"year-input"},null,544)),[[R,n.selectedYear]]):A("",!0),s("button",{class:"btn btn-primary",onClick:t[6]||(t[6]=(...l)=>o.exportToPDF&&o.exportToPDF(...l))},"Export PDF"),s("button",{class:"btn btn-secondary",onClick:t[7]||(t[7]=(...l)=>o.printReport&&o.printReport(...l))},"Tulosta")])]),n.loading?(m(),h("div",l1," Ladataan tuloslaskelmaa... ")):(m(),h("div",a1,[s("div",c1,[s("div",u1,[s("h3",null,u(n.companyName||"Yritys Oy"),1),s("p",null,"Y-tunnus: "+u(n.companyYtunnus||"1234567-8"),1)]),s("div",d1,[t[10]||(t[10]=s("h4",null,"Tuloslaskelma",-1)),s("p",null,u(o.periodDescription),1)])]),s("table",f1,[t[30]||(t[30]=s("thead",null,[s("tr",null,[s("th",null,"Tili"),s("th",null,"Kuvaus"),s("th",{class:"amount-column"},"Edellinen kausi"),s("th",{class:"amount-column"},"Nykyinen kausi"),s("th",{class:"amount-column"},"Muutos €"),s("th",{class:"amount-column"},"Muutos %")])],-1)),s("tbody",null,[t[23]||(t[23]=s("tr",{class:"category-header"},[s("td",{colspan:"6",class:"category-title"},"MYYNTITULOT")],-1)),(m(!0),h(H,null,z(n.salesRevenue,l=>(m(),h(H,{key:l.code},[l.isGroup?(m(),h("tr",m1,[s("td",h1,u(l.name),1)])):A("",!0),s("tr",null,[s("td",p1,u(l.code),1),s("td",g1,u(l.name),1),s("td",y1,u(o.formatCurrency(l.previousAmount||0)),1),s("td",_1,u(o.formatCurrency(l.currentAmount||0)),1),s("td",{class:O(["amount",o.getChangeClass(l.change)])},u(o.formatCurrency(l.change||0)),3),s("td",{class:O(["amount",o.getChangeClass(l.changePercent)])},u(o.formatPercent(l.changePercent||0)),3)])],64))),128)),s("tr",v1,[t[11]||(t[11]=s("td",{colspan:"2"},"Myyntitulot yhteensä",-1)),s("td",b1,u(o.formatCurrency(o.salesRevenueTotal.previous)),1),s("td",w1,u(o.formatCurrency(o.salesRevenueTotal.current)),1),s("td",{class:O(["amount subtotal",o.getChangeClass(o.salesRevenueTotal.change)])},u(o.formatCurrency(o.salesRevenueTotal.change)),3),s("td",{class:O(["amount subtotal",o.getChangeClass(o.salesRevenueTotal.changePercent)])},u(o.formatPercent(o.salesRevenueTotal.changePercent)),3)]),t[24]||(t[24]=s("tr",{class:"category-header"},[s("td",{colspan:"6",class:"category-title"},"MUUT TULOT")],-1)),(m(!0),h(H,null,z(n.otherRevenue,l=>(m(),h(H,{key:l.code},[l.isGroup?(m(),h("tr",k1,[s("td",C1,u(l.name),1)])):A("",!0),s("tr",null,[s("td",T1,u(l.code),1),s("td",E1,u(l.name),1),s("td",x1,u(o.formatCurrency(l.previousAmount||0)),1),s("td",F1,u(o.formatCurrency(l.currentAmount||0)),1),s("td",{class:O(["amount",o.getChangeClass(l.change)])},u(o.formatCurrency(l.change||0)),3),s("td",{class:O(["amount",o.getChangeClass(l.changePercent)])},u(o.formatPercent(l.changePercent||0)),3)])],64))),128)),s("tr",S1,[t[12]||(t[12]=s("td",{colspan:"2"},"Muut tuotot yhteensä",-1)),s("td",P1,u(o.formatCurrency(o.otherRevenueTotal.previous)),1),s("td",A1,u(o.formatCurrency(o.otherRevenueTotal.current)),1),s("td",{class:O(["amount subtotal",o.getChangeClass(o.otherRevenueTotal.change)])},u(o.formatCurrency(o.otherRevenueTotal.change)),3),s("td",{class:O(["amount subtotal",o.getChangeClass(o.otherRevenueTotal.changePercent)])},u(o.formatPercent(o.otherRevenueTotal.changePercent)),3)]),s("tr",M1,[t[13]||(t[13]=s("td",{colspan:"2"},"TULOT YHTEENSÄ",-1)),s("td",D1,u(o.formatCurrency(o.totalRevenue.previous)),1),s("td",R1,u(o.formatCurrency(o.totalRevenue.current)),1),s("td",{class:O(["amount total",o.getChangeClass(o.totalRevenue.change)])},u(o.formatCurrency(o.totalRevenue.change)),3),s("td",{class:O(["amount total",o.getChangeClass(o.totalRevenue.changePercent)])},u(o.formatPercent(o.totalRevenue.changePercent)),3)]),t[25]||(t[25]=s("tr",{class:"category-header"},[s("td",{colspan:"6",class:"category-title"},"ELINKEINOTOIMINNAN KULUT")],-1)),(m(!0),h(H,null,z(n.costOfGoods,l=>(m(),h(H,{key:l.code},[l.isGroup?(m(),h("tr",I1,[s("td",j1,u(l.name),1)])):A("",!0),s("tr",null,[s("td",O1,u(l.code),1),s("td",U1,u(l.name),1),s("td",L1,u(o.formatCurrency(l.previousAmount||0)),1),s("td",N1,u(o.formatCurrency(l.currentAmount||0)),1),s("td",{class:O(["amount",o.getChangeClass(l.change)])},u(o.formatCurrency(l.change||0)),3),s("td",{class:O(["amount",o.getChangeClass(l.changePercent)])},u(o.formatPercent(l.changePercent||0)),3)])],64))),128)),s("tr",V1,[t[14]||(t[14]=s("td",{colspan:"2"},"Ostot ja palvelut yhteensä",-1)),s("td",H1,u(o.formatCurrency(o.costOfGoodsTotal.previous)),1),s("td",B1,u(o.formatCurrency(o.costOfGoodsTotal.current)),1),s("td",{class:O(["amount subtotal",o.getChangeClass(o.costOfGoodsTotal.change)])},u(o.formatCurrency(o.costOfGoodsTotal.change)),3),s("td",{class:O(["amount subtotal",o.getChangeClass(o.costOfGoodsTotal.changePercent)])},u(o.formatPercent(o.costOfGoodsTotal.changePercent)),3)]),s("tr",q1,[t[15]||(t[15]=s("td",{colspan:"2"},"BRUTTOKATE",-1)),s("td",K1,u(o.formatCurrency(o.grossProfit.previous)),1),s("td",W1,u(o.formatCurrency(o.grossProfit.current)),1),s("td",{class:O(["amount total",o.getChangeClass(o.grossProfit.change)])},u(o.formatCurrency(o.grossProfit.change)),3),s("td",{class:O(["amount total",o.getChangeClass(o.grossProfit.changePercent)])},u(o.formatPercent(o.grossProfit.changePercent)),3)]),t[26]||(t[26]=s("tr",{class:"category-header"},[s("td",{colspan:"6",class:"category-title"},"HENKILÖSTÖKULUT")],-1)),(m(!0),h(H,null,z(n.personnelExpenses,l=>(m(),h(H,{key:l.code},[l.isGroup?(m(),h("tr",J1,[s("td",G1,u(l.name),1)])):A("",!0),s("tr",null,[s("td",Y1,u(l.code),1),s("td",z1,u(l.name),1),s("td",X1,u(o.formatCurrency(l.previousAmount||0)),1),s("td",Q1,u(o.formatCurrency(l.currentAmount||0)),1),s("td",{class:O(["amount",o.getChangeClass(l.change)])},u(o.formatCurrency(l.change||0)),3),s("td",{class:O(["amount",o.getChangeClass(l.changePercent)])},u(o.formatPercent(l.changePercent||0)),3)])],64))),128)),s("tr",Z1,[t[16]||(t[16]=s("td",{colspan:"2"},"Henkilöstökulut yhteensä",-1)),s("td",$1,u(o.formatCurrency(o.personnelExpensesTotal.previous)),1),s("td",ty,u(o.formatCurrency(o.personnelExpensesTotal.current)),1),s("td",{class:O(["amount subtotal",o.getChangeClass(o.personnelExpensesTotal.change)])},u(o.formatCurrency(o.personnelExpensesTotal.change)),3),s("td",{class:O(["amount subtotal",o.getChangeClass(o.personnelExpensesTotal.changePercent)])},u(o.formatPercent(o.personnelExpensesTotal.changePercent)),3)]),t[27]||(t[27]=s("tr",{class:"category-header"},[s("td",{colspan:"6",class:"category-title"},"MUUT MENOT")],-1)),(m(!0),h(H,null,z(n.otherExpenses,l=>(m(),h(H,{key:l.code},[l.isGroup?(m(),h("tr",ey,[s("td",sy,u(l.name),1)])):A("",!0),s("tr",null,[s("td",ny,u(l.code),1),s("td",oy,u(l.name),1),s("td",ry,u(o.formatCurrency(l.previousAmount||0)),1),s("td",iy,u(o.formatCurrency(l.currentAmount||0)),1),s("td",{class:O(["amount",o.getChangeClass(l.change)])},u(o.formatCurrency(l.change||0)),3),s("td",{class:O(["amount",o.getChangeClass(l.changePercent)])},u(o.formatPercent(l.changePercent||0)),3)])],64))),128)),s("tr",ly,[t[17]||(t[17]=s("td",{colspan:"2"},"Muut menot yhteensä",-1)),s("td",ay,u(o.formatCurrency(o.otherExpensesTotal.previous)),1),s("td",cy,u(o.formatCurrency(o.otherExpensesTotal.current)),1),s("td",{class:O(["amount subtotal",o.getChangeClass(o.otherExpensesTotal.change)])},u(o.formatCurrency(o.otherExpensesTotal.change)),3),s("td",{class:O(["amount subtotal",o.getChangeClass(o.otherExpensesTotal.changePercent)])},u(o.formatPercent(o.otherExpensesTotal.changePercent)),3)]),t[28]||(t[28]=s("tr",{class:"category-header"},[s("td",{colspan:"6",class:"category-title"},"POISTOT JA ALASKIRJAUKSET")],-1)),(m(!0),h(H,null,z(n.depreciation,l=>(m(),h(H,{key:l.code},[l.isGroup?(m(),h("tr",uy,[s("td",dy,u(l.name),1)])):A("",!0),s("tr",null,[s("td",fy,u(l.code),1),s("td",my,u(l.name),1),s("td",hy,u(o.formatCurrency(l.previousAmount||0)),1),s("td",py,u(o.formatCurrency(l.currentAmount||0)),1),s("td",{class:O(["amount",o.getChangeClass(l.change)])},u(o.formatCurrency(l.change||0)),3),s("td",{class:O(["amount",o.getChangeClass(l.changePercent)])},u(o.formatPercent(l.changePercent||0)),3)])],64))),128)),s("tr",gy,[t[18]||(t[18]=s("td",{colspan:"2"},"Poistot ja alaskirjaukset yhteensä",-1)),s("td",yy,u(o.formatCurrency(o.depreciationTotal.previous)),1),s("td",_y,u(o.formatCurrency(o.depreciationTotal.current)),1),s("td",{class:O(["amount subtotal",o.getChangeClass(o.depreciationTotal.change)])},u(o.formatCurrency(o.depreciationTotal.change)),3),s("td",{class:O(["amount subtotal",o.getChangeClass(o.depreciationTotal.changePercent)])},u(o.formatPercent(o.depreciationTotal.changePercent)),3)]),s("tr",vy,[t[19]||(t[19]=s("td",{colspan:"2"},"MENOT YHTEENSÄ",-1)),s("td",by,u(o.formatCurrency(o.totalExpenses.previous)),1),s("td",wy,u(o.formatCurrency(o.totalExpenses.current)),1),s("td",{class:O(["amount total",o.getChangeClass(o.totalExpenses.change)])},u(o.formatCurrency(o.totalExpenses.change)),3),s("td",{class:O(["amount total",o.getChangeClass(o.totalExpenses.changePercent)])},u(o.formatPercent(o.totalExpenses.changePercent)),3)]),s("tr",ky,[t[20]||(t[20]=s("td",{colspan:"2"},"TULOS ENNEN VEROJA",-1)),s("td",Cy,u(o.formatCurrency(o.profitBeforeTax.previous)),1),s("td",Ty,u(o.formatCurrency(o.profitBeforeTax.current)),1),s("td",{class:O(["amount total",o.getChangeClass(o.profitBeforeTax.change)])},u(o.formatCurrency(o.profitBeforeTax.change)),3),s("td",{class:O(["amount total",o.getChangeClass(o.profitBeforeTax.changePercent)])},u(o.formatPercent(o.profitBeforeTax.changePercent)),3)]),t[29]||(t[29]=s("tr",{class:"category-header"},[s("td",{colspan:"6",class:"category-title"},"TULOVEROT")],-1)),(m(!0),h(H,null,z(n.taxExpenses,l=>(m(),h(H,{key:l.code},[l.isGroup?(m(),h("tr",Ey,[s("td",xy,u(l.name),1)])):A("",!0),s("tr",null,[s("td",Fy,u(l.code),1),s("td",Sy,u(l.name),1),s("td",Py,u(o.formatCurrency(l.previousAmount||0)),1),s("td",Ay,u(o.formatCurrency(l.currentAmount||0)),1),s("td",{class:O(["amount",o.getChangeClass(l.change)])},u(o.formatCurrency(l.change||0)),3),s("td",{class:O(["amount",o.getChangeClass(l.changePercent)])},u(o.formatPercent(l.changePercent||0)),3)])],64))),128)),s("tr",My,[t[21]||(t[21]=s("td",{colspan:"2"},"Tuloverot yhteensä",-1)),s("td",Dy,u(o.formatCurrency(o.taxExpensesTotal.previous)),1),s("td",Ry,u(o.formatCurrency(o.taxExpensesTotal.current)),1),s("td",{class:O(["amount subtotal",o.getChangeClass(o.taxExpensesTotal.change)])},u(o.formatCurrency(o.taxExpensesTotal.change)),3),s("td",{class:O(["amount subtotal",o.getChangeClass(o.taxExpensesTotal.changePercent)])},u(o.formatPercent(o.taxExpensesTotal.changePercent)),3)]),s("tr",Iy,[t[22]||(t[22]=s("td",{colspan:"2"},"TILINPÄÄTÖSTULOS",-1)),s("td",jy,u(o.formatCurrency(o.netProfit.previous)),1),s("td",Oy,u(o.formatCurrency(o.netProfit.current)),1),s("td",{class:O(["amount total",o.getChangeClass(o.netProfit.change)])},u(o.formatCurrency(o.netProfit.change)),3),s("td",{class:O(["amount total",o.getChangeClass(o.netProfit.changePercent)])},u(o.formatPercent(o.netProfit.changePercent)),3)])])]),s("div",Uy,[s("div",Ly,[t[31]||(t[31]=s("h3",null,"Kokonaistuotto",-1)),s("p",Ny,u(o.formatCurrency(o.totalRevenue.current)),1),s("p",{class:O(["change",o.getChangeClass(o.totalRevenue.changePercent)])},u(o.formatPercent(o.totalRevenue.changePercent))+" edelliseen kauteen ",3)]),s("div",Vy,[t[32]||(t[32]=s("h3",null,"Kulut yhteensä",-1)),s("p",Hy,u(o.formatCurrency(o.totalExpenses.current)),1),s("p",{class:O(["change",o.getChangeClass(o.totalExpenses.changePercent)])},u(o.formatPercent(o.totalExpenses.changePercent))+" edelliseen kauteen ",3)]),s("div",By,[t[33]||(t[33]=s("h3",null,"Tilinpäätöstulos",-1)),s("p",qy,u(o.formatCurrency(o.netProfit.current)),1),s("p",{class:O(["change",o.getChangeClass(o.netProfit.changePercent)])},u(o.formatPercent(o.netProfit.changePercent))+" edelliseen kauteen ",3)]),s("div",Ky,[t[34]||(t[34]=s("h3",null,"Kate (%)",-1)),s("p",Wy,u(o.formatPercent(o.grossMargin)),1),s("p",{class:O(["change",o.getChangeClass(o.grossMarginChange)])},u(o.formatPercent(o.grossMarginChange))+" edelliseen kauteen ",3)])])]))])}const Gy=Nt(n1,[["render",Jy],["__scopeId","data-v-c97878db"]]);const Yy={name:"ALVLaskentaSection",props:{activeSection:{type:String,required:!0}},data(){return{loading:!1,selectedPeriod:"year",selectedMonth:new Date().toISOString().slice(0,7),selectedYear:2024,companyName:"",companyYtunnus:"",alvData:null,vatData:{0:{taxable_sales:0,taxable_purchases:0,payable_vat:0,deductible_vat:0,net_vat:0},10:{taxable_sales:0,taxable_purchases:0,payable_vat:0,deductible_vat:0,net_vat:0},14:{taxable_sales:0,taxable_purchases:0,payable_vat:0,deductible_vat:0,net_vat:0},24:{taxable_sales:0,taxable_purchases:0,payable_vat:0,deductible_vat:0,net_vat:0},"25.5":{taxable_sales:0,taxable_purchases:0,payable_vat:0,deductible_vat:0,net_vat:0}}}},computed:{periodDescription(){switch(this.selectedPeriod){case"current":return"Nykyinen kausi";case"month":return`Kuukausi: ${this.formatMonth(this.selectedMonth)}`;case"quarter":return`Neljännes: ${this.selectedYear}`;case"year":return`Vuosi: ${this.selectedYear}`;default:return"Nykyinen kausi"}},totals(){const e={taxable_sales:0,taxable_purchases:0,payable_vat:0,deductible_vat:0,net_vat:0};return Object.values(this.vatData).forEach(t=>{e.taxable_sales+=t.taxable_sales||0,e.taxable_purchases+=t.taxable_purchases||0,e.payable_vat+=t.payable_vat||0,e.deductible_vat+=t.deductible_vat||0,e.net_vat+=t.net_vat||0}),e}},methods:{formatCurrency:Pe,formatDate:ze,async loadALVLaskenta(){this.loading=!0;try{await this.loadCompanyDetails();const e=await M.get("/api/alv_laskenta.php",{params:{period:this.selectedPeriod,month:this.selectedMonth,year:this.selectedYear}});e.data.success?(this.alvData=e.data.data,this.updateDataFromAPI(e.data.data)):console.error("API error:",e.data.message)}catch(e){console.error("Error loading ALV-laskenta:",e)}finally{this.loading=!1}},async loadCompanyDetails(){try{const e=await M.get("/api/company.php");if(e.data.success){const t=e.data.data;this.companyName=t.name,this.companyYtunnus=t.y_tunnus}}catch(e){console.error("Error loading company details:",e)}},updateDataFromAPI(e){e.vat_breakdown&&(this.vatData={...this.vatData,...e.vat_breakdown})},formatVatRate(e){return e.toString().replace(".",",")},formatMonth(e){const[t,r]=e.split("-");return new Date(t,r-1).toLocaleDateString("fi-FI",{year:"numeric",month:"long"})},exportToPDF(){window.print()},printReport(){window.print()}},mounted(){this.loadALVLaskenta()}},zy={class:"card"},Xy={class:"section-header"},Qy={class:"header-actions"},Zy={key:0,class:"loading"},$y={key:1,class:"alv-container"},t_={class:"report-header"},e_={class:"company-info"},s_={class:"period-info"},n_={class:"alv-table"},o_={class:"amount"},r_={class:"amount"},i_={class:"amount"},l_={class:"amount"},a_={class:"amount net-vat"},c_={class:"amount"},u_={class:"amount"},d_={class:"amount"},f_={class:"amount"},m_={class:"amount net-vat"},h_={class:"amount"},p_={class:"amount"},g_={class:"amount"},y_={class:"amount"},__={class:"amount net-vat"},v_={class:"amount"},b_={class:"amount"},w_={class:"amount"},k_={class:"amount"},C_={class:"amount net-vat"},T_={class:"amount"},E_={class:"amount"},x_={class:"amount"},F_={class:"amount"},S_={class:"amount net-vat"},P_={class:"total-row"},A_={class:"amount total"},M_={class:"amount total"},D_={class:"amount total"},R_={class:"amount total"},I_={class:"amount total net-total"},j_={class:"summary-cards"},O_={class:"summary-card payable"},U_={class:"amount"},L_={class:"summary-card deductible"},N_={class:"amount"},V_={class:"summary-card net"},H_={class:"amount"},B_={class:"summary-card turnover"},q_={class:"amount"},K_={class:"detailed-breakdown"},W_={class:"breakdown-section"},J_={class:"breakdown-table"},G_={class:"amount"},Y_={class:"amount"},z_={class:"amount"},X_={class:"breakdown-section"},Q_={class:"breakdown-table"},Z_={class:"amount"},$_={class:"amount"},tv={class:"amount"};function ev(e,t,r,i,n,o){return m(),h("div",zy,[s("div",Xy,[t[9]||(t[9]=s("h2",null,"ALV-laskenta",-1)),s("div",Qy,[C(s("select",{"onUpdate:modelValue":t[0]||(t[0]=l=>n.selectedPeriod=l),onChange:t[1]||(t[1]=(...l)=>o.loadALVLaskenta&&o.loadALVLaskenta(...l)),class:"period-selector"},[...t[8]||(t[8]=[s("option",{value:"current"},"Nykyinen kausi",-1),s("option",{value:"month"},"Kuukausi",-1),s("option",{value:"quarter"},"Neljännes",-1),s("option",{value:"year"},"Vuosi",-1)])],544),[[ft,n.selectedPeriod]]),n.selectedPeriod==="month"?C((m(),h("input",{key:0,type:"month","onUpdate:modelValue":t[2]||(t[2]=l=>n.selectedMonth=l),onChange:t[3]||(t[3]=(...l)=>o.loadALVLaskenta&&o.loadALVLaskenta(...l)),class:"month-input"},null,544)),[[R,n.selectedMonth]]):A("",!0),n.selectedPeriod==="year"?C((m(),h("input",{key:1,type:"number","onUpdate:modelValue":t[4]||(t[4]=l=>n.selectedYear=l),onChange:t[5]||(t[5]=(...l)=>o.loadALVLaskenta&&o.loadALVLaskenta(...l)),placeholder:"Vuosi",min:"2020",max:"2030",class:"year-input"},null,544)),[[R,n.selectedYear]]):A("",!0),s("button",{class:"btn btn-primary",onClick:t[6]||(t[6]=(...l)=>o.exportToPDF&&o.exportToPDF(...l))},"Export PDF"),s("button",{class:"btn btn-secondary",onClick:t[7]||(t[7]=(...l)=>o.printReport&&o.printReport(...l))},"Tulosta")])]),n.loading?(m(),h("div",Zy," Ladataan ALV-laskentaa... ")):(m(),h("div",$y,[s("div",t_,[s("div",e_,[s("h3",null,u(n.companyName||"Yritys Oy"),1),s("p",null,"Y-tunnus: "+u(n.companyYtunnus||"1234567-8"),1)]),s("div",s_,[t[10]||(t[10]=s("h4",null,"ALV-laskenta",-1)),s("p",null,u(o.periodDescription),1)])]),s("table",n_,[t[17]||(t[17]=s("thead",null,[s("tr",null,[s("th",null,"ALV %"),s("th",null,"Verotettavat myynnit"),s("th",null,"Verolliset ostot"),s("th",null,"Maksettava ALV"),s("th",null,"Vähennettävä ALV"),s("th",null,"Netto ALV")])],-1)),s("tbody",null,[s("tr",null,[t[11]||(t[11]=s("td",{class:"vat-rate"},"0%",-1)),s("td",o_,u(o.formatCurrency(n.vatData[0].taxable_sales)),1),s("td",r_,u(o.formatCurrency(n.vatData[0].taxable_purchases)),1),s("td",i_,u(o.formatCurrency(n.vatData[0].payable_vat)),1),s("td",l_,u(o.formatCurrency(n.vatData[0].deductible_vat)),1),s("td",a_,u(o.formatCurrency(n.vatData[0].net_vat)),1)]),s("tr",null,[t[12]||(t[12]=s("td",{class:"vat-rate"},"10%",-1)),s("td",c_,u(o.formatCurrency(n.vatData[10].taxable_sales)),1),s("td",u_,u(o.formatCurrency(n.vatData[10].taxable_purchases)),1),s("td",d_,u(o.formatCurrency(n.vatData[10].payable_vat)),1),s("td",f_,u(o.formatCurrency(n.vatData[10].deductible_vat)),1),s("td",m_,u(o.formatCurrency(n.vatData[10].net_vat)),1)]),s("tr",null,[t[13]||(t[13]=s("td",{class:"vat-rate"},"14%",-1)),s("td",h_,u(o.formatCurrency(n.vatData[14].taxable_sales)),1),s("td",p_,u(o.formatCurrency(n.vatData[14].taxable_purchases)),1),s("td",g_,u(o.formatCurrency(n.vatData[14].payable_vat)),1),s("td",y_,u(o.formatCurrency(n.vatData[14].deductible_vat)),1),s("td",__,u(o.formatCurrency(n.vatData[14].net_vat)),1)]),s("tr",null,[t[14]||(t[14]=s("td",{class:"vat-rate"},"24%",-1)),s("td",v_,u(o.formatCurrency(n.vatData[24].taxable_sales)),1),s("td",b_,u(o.formatCurrency(n.vatData[24].taxable_purchases)),1),s("td",w_,u(o.formatCurrency(n.vatData[24].payable_vat)),1),s("td",k_,u(o.formatCurrency(n.vatData[24].deductible_vat)),1),s("td",C_,u(o.formatCurrency(n.vatData[24].net_vat)),1)]),s("tr",null,[t[15]||(t[15]=s("td",{class:"vat-rate"},"25,5%",-1)),s("td",T_,u(o.formatCurrency(n.vatData["25.5"].taxable_sales)),1),s("td",E_,u(o.formatCurrency(n.vatData["25.5"].taxable_purchases)),1),s("td",x_,u(o.formatCurrency(n.vatData["25.5"].payable_vat)),1),s("td",F_,u(o.formatCurrency(n.vatData["25.5"].deductible_vat)),1),s("td",S_,u(o.formatCurrency(n.vatData["25.5"].net_vat)),1)]),s("tr",P_,[t[16]||(t[16]=s("td",null,"Yhteensä",-1)),s("td",A_,u(o.formatCurrency(o.totals.taxable_sales)),1),s("td",M_,u(o.formatCurrency(o.totals.taxable_purchases)),1),s("td",D_,u(o.formatCurrency(o.totals.payable_vat)),1),s("td",R_,u(o.formatCurrency(o.totals.deductible_vat)),1),s("td",I_,u(o.formatCurrency(o.totals.net_vat)),1)])])]),s("div",j_,[s("div",O_,[t[18]||(t[18]=s("h3",null,"Maksettava ALV",-1)),s("p",U_,u(o.formatCurrency(o.totals.payable_vat)),1),t[19]||(t[19]=s("p",{class:"description"},"Kerättävä arvonlisävero",-1))]),s("div",L_,[t[20]||(t[20]=s("h3",null,"Vähennettävä ALV",-1)),s("p",N_,u(o.formatCurrency(o.totals.deductible_vat)),1),t[21]||(t[21]=s("p",{class:"description"},"Vähennettävä arvonlisävero",-1))]),s("div",V_,[t[22]||(t[22]=s("h3",null,"Netto ALV",-1)),s("p",H_,u(o.formatCurrency(o.totals.net_vat)),1),t[23]||(t[23]=s("p",{class:"description"},"Maksettava tai palautettava ALV",-1))]),s("div",B_,[t[24]||(t[24]=s("h3",null,"Verollinen liikevaihto",-1)),s("p",q_,u(o.formatCurrency(o.totals.taxable_sales)),1),t[25]||(t[25]=s("p",{class:"description"},"ALV:n alainen myynti",-1))])]),s("div",K_,[t[30]||(t[30]=s("h3",null,"ALV-laskelman erittely",-1)),s("div",W_,[t[27]||(t[27]=s("h4",null,"Myyntien ALV",-1)),s("table",J_,[t[26]||(t[26]=s("thead",null,[s("tr",null,[s("th",null,"ALV %"),s("th",null,"Veroton summa"),s("th",null,"ALV määrä"),s("th",null,"Verollinen summa")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(n.vatData,(l,a)=>(m(),h("tr",{key:a},[s("td",null,u(o.formatVatRate(a))+"%",1),s("td",G_,u(o.formatCurrency(l.taxable_sales)),1),s("td",Y_,u(o.formatCurrency(l.payable_vat)),1),s("td",z_,u(o.formatCurrency(l.taxable_sales+l.payable_vat)),1)]))),128))])])]),s("div",X_,[t[29]||(t[29]=s("h4",null,"Ostojen ALV",-1)),s("table",Q_,[t[28]||(t[28]=s("thead",null,[s("tr",null,[s("th",null,"ALV %"),s("th",null,"Veroton summa"),s("th",null,"ALV määrä"),s("th",null,"Verollinen summa")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(n.vatData,(l,a)=>(m(),h("tr",{key:a},[s("td",null,u(o.formatVatRate(a))+"%",1),s("td",Z_,u(o.formatCurrency(l.taxable_purchases)),1),s("td",$_,u(o.formatCurrency(l.deductible_vat)),1),s("td",tv,u(o.formatCurrency(l.taxable_purchases+l.deductible_vat)),1)]))),128))])])])])]))])}const sv=Nt(Yy,[["render",ev],["__scopeId","data-v-253e96d5"]]);const nv={name:"App",components:{NavigationTabs:qf,ProjectsSection:Sh,UsersSection:qh,ChartOfAccountsSection:pp,AccountingSection:ig,ExcelAccountingSection:s1,TuloslaskelmaSection:Gy,ALVLaskentaSection:sv,TaskManagementSection:Yi},data(){return{activeSection:"items",items:[],loading:!1,showModal:!1,isEditing:!1,message:"",messageType:"",formData:{id:null,name:"",description:"",serial_number:"",picture:"",quantity:0,price:0,date_of_purchase:""},showDetailsModal:!1,selectedItem:{},activeTab:"info",rentalPrices:[],attachments:[],showRentalModal:!1,rentalForm:{item_id:null,client_id:null,start_date:"",end_date:"",daily_price:0},showAttachmentModal:!1,attachmentForm:{item_id:null,file_type:"",file:null},clients:[],clientsLoading:!1,clientSearch:"",showClientModal:!1,isEditingClient:!1,clientForm:{id:null,y_tunnus:"",company_name:"",first_name:"",last_name:"",email:"",phone:"",address:"",city:"",state:"",postal_code:"",country:"",hour_price:"",notes:""},contactPersons:[],contactPersonsLoading:!1,contactPersonForm:{id:null,client_id:null,first_name:"",last_name:"",email:"",phone:"",position:"",is_primary:!1},showContactPersonModal:!1,isEditingContactPerson:!1,isLoggedIn:!1,currentUser:null,loginForm:{username:"",password:""},loginError:"",invoices:[],invoicesLoading:!1,invoiceSearch:"",showInvoiceModal:!1,isEditingInvoice:!1,selectedInvoice:{},invoiceForm:{id:null,client_id:null,invoice_number:"",issue_date:"",due_date:"",status:"draft",subtotal:0,tax_amount:0,total_amount:0,notes:""},showInvoiceItemsModal:!1,invoiceItems:[],invoiceItemsForm:{id:null,invoice_id:null,item_id:null,description:"",quantity:1,unit_price:0,line_total:0},projects:[],projectsLoading:!1,projectSearch:"",showProjectModal:!1,isEditingProject:!1,selectedProject:{},projectForm:{id:null,customer_id:null,project_name:"",description:"",status:"planning",start_date:"",end_date:"",budget:0},users:[],usersLoading:!1,userSearch:"",showUserModal:!1,isEditingUser:!1,selectedUser:{},userForm:{id:null,username:"",email:"",first_name:"",last_name:"",role:"user",is_active:!0,password:""},accounts:[],accountsLoading:!1,accountSearch:"",showAccountModal:!1,isEditingAccount:!1,selectedAccount:{},accountForm:{id:null,account_number:"",account_name:"",account_type:"asset",parent_id:null,description:"",opening_balance:0,is_active:!0},journalEntries:[],journalEntriesLoading:!1,transactions:[],transactionsLoading:!1,accountingSearch:"",selectedJournalEntry:{},showContactModal:!1,selectedCustomer:{},customerContacts:[],contactForm:{id:null,client_id:null,first_name:"",last_name:"",email:"",phone:"",position:"",department:"",is_primary:!1,notes:""}}},mounted(){this.checkAuthStatus(),window.addEventListener("auth-expired",this.handleSessionExpired)},beforeUnmount(){window.removeEventListener("auth-expired",this.handleSessionExpired)},methods:{formatDate:ze,formatCurrency:Pe,formatDateTime:vo,async fetchItems(){this.loading=!0;try{const e=await M.get("/api/items.php");this.items=e.data.records||[]}catch(e){this.showMessage("Error fetching items: "+e.message,"error")}finally{this.loading=!1}},async saveItem(){try{this.isEditing?(await M.put("/api/items.php",this.formData),this.showMessage("Item updated successfully!","success")):(await M.post("/api/items.php",this.formData),this.showMessage("Item added successfully!","success")),this.closeModal(),this.fetchItems()}catch(e){this.showMessage("Error saving item: "+e.message,"error")}},async deleteItem(e){if(confirm("Are you sure you want to delete this item?"))try{await M.delete(`/api/items.php?id=${e}`),this.showMessage("Item deleted successfully!","success"),this.fetchItems()}catch(t){this.showMessage("Error deleting item: "+t.message,"error")}},showAddModal(){this.isEditing=!1,this.formData={id:null,name:"",description:"",serial_number:"",picture:"",quantity:0,price:0,date_of_purchase:""},this.showModal=!0},editItem(e){this.isEditing=!0,this.formData={id:e.id,name:e.name,description:e.description||"",serial_number:e.serial_number||"",picture:e.picture||"",quantity:e.quantity,price:e.price,date_of_purchase:e.date_of_purchase||""},this.showModal=!0},closeModal(){this.showModal=!1,this.formData={id:null,name:"",description:"",serial_number:"",picture:"",quantity:0,price:0}},async handleFileUpload(e){const t=e.target.files[0];if(!t)return;const r=new FormData;r.append("picture",t);try{const i=await M.post("/api/upload.php",r,{headers:{"Content-Type":"multipart/form-data"}});this.formData.picture=i.data.url}catch(i){this.showMessage("Error uploading picture: "+i.message,"error")}},showMessage(e,t){this.message=e,this.messageType=t,setTimeout(()=>{this.message="",this.messageType=""},5e3)},formatDate(e){return new Date(e).toLocaleDateString()},async viewItemDetails(e){this.selectedItem=e,this.activeTab="info",this.showDetailsModal=!0,this.activeSection==="items"?await Promise.all([this.fetchRentalPrices(e.id),this.fetchAttachments(e.id)]):this.activeSection==="clients"&&await this.fetchContactPersons(e.id)},closeDetailsModal(){this.showDetailsModal=!1,this.selectedItem={},this.rentalPrices=[],this.attachments=[]},async fetchRentalPrices(e){try{const t=await M.get(`/api/rental_prices.php?item_id=${e}`);this.rentalPrices=t.data.records||[]}catch(t){this.showMessage("Error fetching rental prices: "+t.message,"error")}},async fetchAttachments(e){try{const t=await M.get(`/api/attachments.php?item_id=${e}`);this.attachments=t.data.records||[]}catch(t){this.showMessage("Error fetching attachments: "+t.message,"error")}},showAddRentalModal(){this.rentalForm={item_id:this.selectedItem.id,client_id:null,start_date:"",end_date:"",daily_price:0},this.showRentalModal=!0},closeRentalModal(){this.showRentalModal=!1,this.rentalForm={item_id:null,client_id:null,start_date:"",end_date:"",daily_price:0}},async saveRentalPrice(){try{await M.post("/api/rental_prices.php",this.rentalForm),this.showMessage("Rental price added successfully!","success"),this.closeRentalModal(),await this.fetchRentalPrices(this.selectedItem.id)}catch(e){this.showMessage("Error saving rental price: "+e.message,"error")}},async deleteRentalPrice(e){if(confirm("Are you sure you want to delete this rental price?"))try{await M.delete(`/api/rental_prices.php?id=${e}`),this.showMessage("Rental price deleted successfully!","success"),await this.fetchRentalPrices(this.selectedItem.id)}catch(t){this.showMessage("Error deleting rental price: "+t.message,"error")}},showAddAttachmentModal(){this.attachmentForm={item_id:this.selectedItem.id,file_type:"",file:null},this.showAttachmentModal=!0},closeAttachmentModal(){this.showAttachmentModal=!1,this.attachmentForm={item_id:null,file_type:"",file:null}},handleAttachmentUpload(e){this.attachmentForm.file=e.target.files[0]},async saveAttachment(){if(!this.attachmentForm.file){this.showMessage("Please select a file to upload","error");return}try{const e=new FormData;e.append("attachment",this.attachmentForm.file),e.append("item_id",this.attachmentForm.item_id),e.append("file_type",this.attachmentForm.file_type),await M.post("/api/attachments.php",e,{headers:{"Content-Type":"multipart/form-data"}}),this.showMessage("Attachment uploaded successfully!","success"),this.closeAttachmentModal(),await this.fetchAttachments(this.selectedItem.id)}catch(e){this.showMessage("Error uploading attachment: "+e.message,"error")}},async deleteAttachment(e){if(confirm("Are you sure you want to delete this attachment?"))try{await M.delete(`/api/attachments.php?id=${e}`),this.showMessage("Attachment deleted successfully!","success"),await this.fetchAttachments(this.selectedItem.id)}catch(t){this.showMessage("Error deleting attachment: "+t.message,"error")}},formatFileSize(e){if(e===0)return"0 Bytes";const t=1024,r=["Bytes","KB","MB","GB"],i=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,i)).toFixed(2))+" "+r[i]},getClientName(e){if(!e)return"Unassigned";const t=this.clients.find(r=>r.id===e);return t?t.company_name?`${t.company_name} - ${t.first_name} ${t.last_name}`:`${t.first_name} ${t.last_name}`:"Unknown Client"},async fetchClients(){this.clientsLoading=!0;try{const e=await M.get("/api/clients.php");this.clients=e.data.records||[]}catch(e){this.showMessage("Error fetching clients: "+e.message,"error")}finally{this.clientsLoading=!1}},async searchClients(){if(this.clientSearch.trim()===""){await this.fetchClients();return}this.clientsLoading=!0;try{const e=await M.get(`/api/clients.php?search=${this.clientSearch}`);this.clients=e.data.records||[]}catch(e){this.showMessage("Error searching clients: "+e.message,"error")}finally{this.clientsLoading=!1}},showAddClientModal(){this.isEditingClient=!1,this.clientForm={id:null,y_tunnus:"",company_name:"",first_name:"",last_name:"",email:"",phone:"",address:"",city:"",state:"",postal_code:"",country:"",hour_price:"",notes:""},this.showClientModal=!0},editClient(e){this.isEditingClient=!0,this.clientForm={id:e.id,y_tunnus:e.y_tunnus||"",company_name:e.company_name||"",first_name:e.first_name,last_name:e.last_name,email:e.email,phone:e.phone||"",address:e.address||"",city:e.city||"",state:e.state||"",postal_code:e.postal_code||"",country:e.country||"",hour_price:e.hour_price||"",notes:e.notes||""},this.showClientModal=!0},closeClientModal(){this.showClientModal=!1,this.clientForm={id:null,y_tunnus:"",company_name:"",first_name:"",last_name:"",email:"",phone:"",address:"",city:"",state:"",postal_code:"",country:"",hour_price:"",notes:""}},async saveClient(){try{this.isEditingClient?(await M.put("/api/clients.php",this.clientForm),this.showMessage("Client updated successfully!","success")):(await M.post("/api/clients.php",this.clientForm),this.showMessage("Client added successfully!","success")),this.closeClientModal(),await this.fetchClients()}catch(e){this.showMessage("Error saving client: "+e.message,"error")}},async deleteClient(e){if(confirm("Are you sure you want to delete this client?"))try{await M.delete(`/api/clients.php?id=${e}`),this.showMessage("Client deleted successfully!","success"),await this.fetchClients()}catch(t){this.showMessage("Error deleting client: "+t.message,"error")}},handleShowTasks(){this.activeSection="tasks"},async fetchContactPersons(e){this.contactPersonsLoading=!0;try{const t=await M.get(`/api/contact_persons.php?client_id=${e}`);this.contactPersons=t.data.records||[]}catch(t){this.showMessage("Error fetching contact persons: "+t.message,"error")}finally{this.contactPersonsLoading=!1}},showAddContactPersonModal(){this.isEditingContactPerson=!1,this.contactPersonForm={id:null,client_id:this.selectedClient?this.selectedClient.id:null,first_name:"",last_name:"",email:"",phone:"",position:"",is_primary:!1},this.showContactPersonModal=!0},editContactPerson(e){this.isEditingContactPerson=!0,this.contactPersonForm={id:e.id,client_id:e.client_id,first_name:e.first_name,last_name:e.last_name,email:e.email||"",phone:e.phone||"",position:e.position||"",is_primary:e.is_primary},this.showContactPersonModal=!0},closeContactPersonModal(){this.showContactPersonModal=!1,this.contactPersonForm={id:null,client_id:null,first_name:"",last_name:"",email:"",phone:"",position:"",is_primary:!1}},async saveContactPerson(){try{this.isEditingContactPerson?(await M.put("/api/contact_persons.php",this.contactPersonForm),this.showMessage("Contact person updated successfully!","success")):(await M.post("/api/contact_persons.php",this.contactPersonForm),this.showMessage("Contact person added successfully!","success")),this.closeContactPersonModal(),await this.fetchContactPersons(this.contactPersonForm.client_id)}catch(e){this.showMessage("Error saving contact person: "+e.message,"error")}},async deleteContactPerson(e){if(confirm("Are you sure you want to delete this contact person?"))try{await M.delete(`/api/contact_persons.php?id=${e}`),this.showMessage("Contact person deleted successfully!","success"),await this.fetchContactPersons(this.selectedClient?this.selectedClient.id:null)}catch(t){this.showMessage("Error deleting contact person: "+t.message,"error")}},async fetchInvoices(){this.invoicesLoading=!0;try{const e=await M.get("/api/invoices.php");this.invoices=e.data.records||[]}catch(e){this.showMessage("Error fetching invoices: "+e.message,"error")}finally{this.invoicesLoading=!1}},async searchInvoices(){if(this.invoiceSearch.trim()===""){await this.fetchInvoices();return}this.invoicesLoading=!0;try{const e=await M.get(`/api/invoices.php?search=${this.invoiceSearch}`);this.invoices=e.data.records||[]}catch(e){this.showMessage("Error searching invoices: "+e.message,"error")}finally{this.invoicesLoading=!1}},showAddInvoiceModal(){this.isEditingInvoice=!1,this.invoiceForm={id:null,client_id:null,invoice_number:"",issue_date:"",due_date:"",status:"draft",subtotal:0,tax_amount:0,total_amount:0,notes:""},this.showInvoiceModal=!0},editInvoice(e){this.isEditingInvoice=!0,this.invoiceForm={id:e.id,client_id:e.client_id,invoice_number:e.invoice_number,issue_date:e.issue_date,due_date:e.due_date,status:e.status,subtotal:e.subtotal,tax_amount:e.tax_amount,total_amount:e.total_amount,notes:e.notes},this.showInvoiceModal=!0},closeInvoiceModal(){this.showInvoiceModal=!1,this.invoiceForm={id:null,client_id:null,invoice_number:"",issue_date:"",due_date:"",status:"draft",subtotal:0,tax_amount:0,total_amount:0,notes:""}},async saveInvoice(){try{this.isEditingInvoice?(await M.put("/api/invoices.php",this.invoiceForm),this.showMessage("Invoice updated successfully!","success")):(await M.post("/api/invoices.php",this.invoiceForm),this.showMessage("Invoice created successfully!","success")),this.closeInvoiceModal(),await this.fetchInvoices()}catch(e){this.showMessage("Error saving invoice: "+e.message,"error")}},async deleteInvoice(e){if(confirm("Are you sure you want to delete this invoice?"))try{await M.delete(`/api/invoices.php?id=${e}`),this.showMessage("Invoice deleted successfully!","success"),await this.fetchInvoices()}catch(t){this.showMessage("Error deleting invoice: "+t.message,"error")}},viewInvoice(e){this.selectedInvoice=e,this.showInvoiceItemsModal=!0},closeInvoiceItemsModal(){this.showInvoiceItemsModal=!1,this.selectedInvoice={},this.invoiceItems=[]},async saveInvoiceItem(){try{this.invoiceItemsForm.id?(await M.put("/api/invoice_items.php",this.invoiceItemsForm),this.showMessage("Invoice item updated successfully!","success")):(await M.post("/api/invoice_items.php",this.invoiceItemsForm),this.showMessage("Invoice item added successfully!","success")),this.closeInvoiceItemsModal(),await this.viewInvoice(this.selectedInvoice)}catch(e){this.showMessage("Error saving invoice item: "+e.message,"error")}},async deleteInvoiceItem(e){if(confirm("Are you sure you want to delete this invoice item?"))try{await M.delete(`/api/invoice_items.php?id=${e}`),this.showMessage("Invoice item deleted successfully!","success"),await this.viewInvoice(this.selectedInvoice)}catch(t){this.showMessage("Error deleting invoice item: "+t.message,"error")}},async login(){this.loginError="";try{const e=await M.post("/api/auth.php",{action:"login",username:this.loginForm.username,password:this.loginForm.password});e.data.user?(this.isLoggedIn=!0,this.currentUser=e.data.user,this.loginForm={username:"",password:""},this.showMessage("Login successful!","success"),this.fetchInitialData(),this.$refs.loginUsername.value="",this.$refs.loginPassword.value=""):(this.loginError=e.data.message||"Login failed",this.showMessage("Login failed","error"))}catch(e){this.loginError="Network error. Please try again.",this.showMessage("Error during login: "+e.message,"error")}},logout(){this.isLoggedIn=!1,this.currentUser=null,this.showMessage("Logged out successfully!","success")},async checkAuthStatus(){try{const e=await M.get("/api/auth.php?action=status");e.status===200&&e.data.user?(this.isLoggedIn=!0,this.currentUser=e.data.user,this.fetchInitialData()):(this.isLoggedIn=!1,this.currentUser=null)}catch{this.isLoggedIn=!1,this.currentUser=null}},fetchInitialData(){this.fetchItems(),this.fetchClients(),this.fetchUsers(),this.fetchProjects(),this.fetchAccounts(),this.fetchJournalEntries(),this.fetchInvoices()},handleSessionExpired(e){var r;this.isLoggedIn=!1,this.currentUser=null;const t=((r=e.detail)==null?void 0:r.message)||"Session expired. Please login again.";this.showMessage(t,"warning"),localStorage.removeItem("authToken"),sessionStorage.removeItem("currentUser")},async fetchProjects(){this.projectsLoading=!0;try{const e=await M.get("/api/projects.php");this.projects=e.data.records||[]}catch(e){this.showMessage("Error fetching projects: "+e.message,"error")}finally{this.projectsLoading=!1}},async searchProjects(e){this.projectSearch=e,this.projectsLoading=!0;try{const t=await M.get(`/api/projects.php?search=${this.projectSearch}`);this.projects=t.data.records||[]}catch(t){this.showMessage("Error searching projects: "+t.message,"error")}finally{this.projectsLoading=!1}},showAddProjectModal(){this.isEditingProject=!1,this.projectForm={id:null,customer_id:null,project_name:"",description:"",status:"planning",start_date:"",end_date:"",budget:0},this.showProjectModal=!0},viewProject(e){this.selectedProject=e},editProject(e){this.isEditingProject=!0,this.projectForm={...e},this.showProjectModal=!0},async deleteProject(e){if(confirm("Are you sure you want to delete this project?"))try{await M.delete(`/api/projects.php?id=${e}`),this.showMessage("Project deleted successfully!","success"),this.fetchProjects()}catch(t){this.showMessage("Error deleting project: "+t.message,"error")}},async fetchUsers(){this.usersLoading=!0;try{const e=await M.get("/api/users.php");this.users=e.data.records||[]}catch(e){this.showMessage("Error fetching users: "+e.message,"error")}finally{this.usersLoading=!1}},async searchUsers(e){this.userSearch=e,this.usersLoading=!0;try{const t=await M.get(`/api/users.php?search=${this.userSearch}`);this.users=t.data.records||[]}catch(t){this.showMessage("Error searching users: "+t.message,"error")}finally{this.usersLoading=!1}},showAddUserModal(){this.isEditingUser=!1,this.userForm={id:null,username:"",email:"",first_name:"",last_name:"",role:"user",is_active:!0,password:""},this.showUserModal=!0},viewUser(e){this.selectedUser=e,this.isEditingUser=!1,this.userForm={...e,password:""},this.showUserModal=!0},editUser(e){this.isEditingUser=!0,this.userForm={...e,password:""},this.showUserModal=!0},async deleteUser(e){if(confirm("Are you sure you want to delete this user?"))try{await M.delete(`/api/users.php?id=${e}`),this.showMessage("User deleted successfully!","success"),this.fetchUsers()}catch(t){this.showMessage("Error deleting user: "+t.message,"error")}},closeUserModal(){this.showUserModal=!1,this.selectedUser={},this.userForm={id:null,username:"",first_name:"",last_name:"",email:"",role:"user",is_active:!0,password:""},this.isEditingUser=!1},async saveUser(){try{const e={username:this.userForm.username,first_name:this.userForm.first_name,last_name:this.userForm.last_name,email:this.userForm.email,role:this.userForm.role,is_active:this.userForm.is_active};this.userForm.password&&(e.password=this.userForm.password);let t;this.userForm.id?(t=await M.put(`/api/users.php?id=${this.userForm.id}`,e),this.showMessage("User updated successfully!","success")):(t=await M.post("/api/users.php",e),this.showMessage("User created successfully!","success")),this.closeUserModal(),this.fetchUsers()}catch(e){this.showMessage("Error saving user: "+e.message,"error")}},closeProjectModal(){this.showProjectModal=!1,this.selectedProject={},this.projectForm={id:null,customer_id:null,project_name:"",description:"",status:"planning",start_date:"",end_date:"",budget:0},this.isEditingProject=!1},async saveProject(){try{const e={customer_id:this.projectForm.customer_id,project_name:this.projectForm.project_name,description:this.projectForm.description,status:this.projectForm.status,start_date:this.projectForm.start_date,end_date:this.projectForm.end_date,budget:this.projectForm.budget};let t;this.projectForm.id?(t=await M.put(`/api/projects.php?id=${this.projectForm.id}`,e),this.showMessage("Project updated successfully!","success")):(t=await M.post("/api/projects.php",e),this.showMessage("Project created successfully!","success")),this.closeProjectModal(),this.fetchProjects()}catch(e){this.showMessage("Error saving project: "+e.message,"error")}},getCustomerName(e){if(!e)return null;const t=this.clients.find(r=>r.id===e);return t?t.company_name||`${t.first_name} ${t.last_name}`:null},async manageContacts(e){this.selectedCustomer=e,this.contactForm.client_id=e.id,await this.fetchCustomerContacts(e.id),this.showContactModal=!0},async fetchCustomerContacts(e){try{const t=await M.get(`/api/contact_persons.php?client_id=${e}`);this.customerContacts=t.data.records||[]}catch(t){this.showMessage("Error fetching contacts: "+t.message,"error")}},async addContact(){try{const e={client_id:this.contactForm.client_id,first_name:this.contactForm.first_name,last_name:this.contactForm.last_name,email:this.contactForm.email,phone:this.contactForm.phone,position:this.contactForm.position,department:this.contactForm.department,is_primary:this.contactForm.is_primary,notes:this.contactForm.notes};await M.post("/api/contact_persons.php",e),this.showMessage("Contact added successfully!","success"),this.resetContactForm(),await this.fetchCustomerContacts(this.selectedCustomer.id),await this.fetchClients()}catch(e){this.showMessage("Error adding contact: "+e.message,"error")}},editContact(e){this.contactForm={...e}},async updateContact(){try{const e={id:this.contactForm.id,client_id:this.contactForm.client_id,first_name:this.contactForm.first_name,last_name:this.contactForm.last_name,email:this.contactForm.email,phone:this.contactForm.phone,position:this.contactForm.position,department:this.contactForm.department,is_primary:this.contactForm.is_primary,notes:this.contactForm.notes};await M.put(`/api/contact_persons.php?id=${this.contactForm.id}`,e),this.showMessage("Contact updated successfully!","success"),this.resetContactForm(),await this.fetchCustomerContacts(this.selectedCustomer.id),await this.fetchClients()}catch(e){this.showMessage("Error updating contact: "+e.message,"error")}},async deleteContact(e){if(confirm("Are you sure you want to delete this contact?"))try{await M.delete(`/api/contact_persons.php?id=${e}`),this.showMessage("Contact deleted successfully!","success"),await this.fetchCustomerContacts(this.selectedCustomer.id),await this.fetchClients()}catch(t){this.showMessage("Error deleting contact: "+t.message,"error")}},resetContactForm(){this.contactForm={id:null,client_id:this.selectedCustomer.id,first_name:"",last_name:"",email:"",phone:"",position:"",department:"",is_primary:!1,notes:""}},closeContactModal(){this.showContactModal=!1,this.selectedCustomer={},this.customerContacts=[],this.resetContactForm()},async fetchAccounts(){this.accountsLoading=!0;try{const e=await M.get("/api/chart_of_accounts.php");this.accounts=e.data.records||[]}catch(e){this.showMessage("Error fetching accounts: "+e.message,"error")}finally{this.accountsLoading=!1}},async searchAccounts(e){this.accountSearch=e,this.accountsLoading=!0;try{const t=await M.get(`/api/chart_of_accounts.php?search=${this.accountSearch}`);this.accounts=t.data.records||[]}catch(t){this.showMessage("Error searching accounts: "+t.message,"error")}finally{this.accountsLoading=!1}},showAddAccountModal(){this.isEditingAccount=!1,this.accountForm={id:null,account_number:"",account_name:"",account_type:"asset",parent_id:null,description:"",opening_balance:0,is_active:!0},this.showAccountModal=!0},viewAccount(e){this.selectedAccount=e},editAccount(e){this.isEditingAccount=!0,this.accountForm={...e},this.showAccountModal=!0},async deleteAccount(e){if(confirm("Are you sure you want to delete this account?"))try{await M.delete(`/api/chart_of_accounts.php?id=${e}`),this.showMessage("Account deleted successfully!","success"),this.fetchAccounts()}catch(t){this.showMessage("Error deleting account: "+t.message,"error")}},async fetchJournalEntries(){this.journalEntriesLoading=!0;try{const e=await M.get("/api/journal_entries.php");this.journalEntries=e.data.records||[]}catch(e){this.showMessage("Error fetching journal entries: "+e.message,"error")}finally{this.journalEntriesLoading=!1}},async fetchTransactions(){this.transactionsLoading=!0;try{const e=await M.get("/api/account_transactions.php");this.transactions=e.data.records||[]}catch(e){this.showMessage("Error fetching transactions: "+e.message,"error")}finally{this.transactionsLoading=!1}},showAddJournalEntryModal(){this.showMessage("Journal entry modal not yet implemented","info")},viewJournalEntry(e){this.selectedJournalEntry=e,this.showMessage("Journal entry details not yet implemented","info")},editJournalEntry(e){this.selectedJournalEntry=e,this.showMessage("Journal entry editing not yet implemented","info")},async deleteJournalEntry(e){if(confirm("Are you sure you want to delete this journal entry?"))try{await M.delete(`/api/journal_entries.php?id=${e}`),this.showMessage("Journal entry deleted successfully!","success"),this.fetchJournalEntries()}catch(t){this.showMessage("Error deleting journal entry: "+t.message,"error")}},searchAccounting(e){this.accountingSearch=e,this.showMessage("Accounting search not yet implemented","info")}}},ov={class:"container"},rv={key:0,class:"login-container"},iv={class:"login-card"},lv={class:"form-group"},av={class:"form-group"},cv={key:0,class:"error-message"},uv={key:1},dv={key:0,class:"card"},fv={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-bottom":"20px"}},mv={key:0,class:"loading"},hv={key:1,class:"loading"},pv={key:2,class:"table"},gv=["src","alt"],yv={key:1},_v={class:"actions"},vv=["onClick"],bv=["onClick"],wv=["onClick"],kv={key:1,class:"card"},Cv={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-bottom":"20px"}},Tv={style:{display:"flex",gap:"10px"}},Ev={key:0,class:"loading"},xv={key:1,class:"loading"},Fv={key:2,class:"table"},Sv={class:"contact-persons"},Pv={key:0,class:"contact-list"},Av={key:0,class:"primary-badge"},Mv={key:0,class:"more-contacts"},Dv={key:1,class:"no-contacts"},Rv=["onClick"],Iv={class:"actions"},jv=["onClick"],Ov=["onClick"],Uv={key:2,class:"card"},Lv={key:3,class:"card"},Nv={key:4,class:"card"},Vv={class:"container"},Hv={class:"modal-content"},Bv={class:"form-group"},qv={class:"form-group"},Kv={class:"form-group"},Wv={class:"form-group"},Jv={key:0,style:{"margin-top":"10px"}},Gv=["src","alt"],Yv={class:"form-group"},zv={class:"form-group"},Xv={class:"form-group"},Qv={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},Zv={type:"submit",class:"btn btn-success"},$v={class:"modal-content",style:{"max-width":"800px"}},tb={class:"tabs"},eb={key:0,class:"tab-content"},sb={class:"item-info"},nb={class:"info-row"},ob={class:"info-row"},rb={class:"info-row"},ib={class:"info-row"},lb={class:"info-row"},ab={class:"info-row"},cb={class:"info-row"},ub={key:0,class:"info-row"},db=["src","alt"],fb={key:1,class:"tab-content"},mb={style:{"margin-bottom":"20px"}},hb={key:0,class:"loading"},pb={key:1,class:"table"},gb=["onClick"],yb={key:2,class:"tab-content"},_b={style:{"margin-bottom":"20px"}},vb={key:0,class:"loading"},bb={key:1,class:"contacts-list"},wb={class:"contact-person-info"},kb={key:0,class:"contact-position"},Cb={key:1,class:"contact-primary"},Tb={class:"contact-person-details"},Eb={key:0},xb={key:1},Fb={class:"contact-person-actions"},Sb=["onClick"],Pb=["onClick"],Ab={key:3,class:"tab-content"},Mb={style:{"margin-bottom":"20px"}},Db={key:0,class:"loading"},Rb={key:1,class:"attachments-list"},Ib={class:"attachment-info"},jb={class:"attachment-type"},Ob={class:"attachment-size"},Ub={class:"attachment-actions"},Lb=["href"],Nb=["onClick"],Vb={class:"modal-content"},Hb={class:"form-group"},Bb=["value"],qb={class:"form-group"},Kb={class:"form-group"},Wb={class:"form-group"},Jb={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},Gb={class:"modal-content"},Yb={class:"form-group"},zb={class:"form-group"},Xb={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},Qb={class:"modal-content"},Zb={class:"form-group"},$b={class:"form-group"},t0={class:"form-group"},e0={class:"form-group"},s0={class:"form-group"},n0={class:"form-group"},o0={class:"form-group"},r0={class:"form-group"},i0={class:"form-group"},l0={class:"form-group"},a0={class:"form-group"},c0={class:"form-group"},u0={class:"form-group"},d0={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},f0={type:"submit",class:"btn btn-success"},m0={class:"modal-content"},h0={class:"form-group"},p0={class:"form-group"},g0={class:"form-group"},y0={class:"form-group"},_0={class:"form-group"},v0={class:"form-group"},b0={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},w0={type:"submit",class:"btn btn-success"},k0={class:"modal-content"},C0={class:"form-group"},T0=["value"],E0={class:"form-group"},x0={class:"form-group"},F0={class:"form-group"},S0={class:"form-group"},P0={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},A0={type:"submit",class:"btn btn-success"},M0={class:"modal-content",style:{"max-width":"900px"}},D0={class:"form-group"},R0=["value"],I0={class:"form-group"},j0={class:"form-group"},O0={class:"form-group"},U0={class:"form-group"},L0={class:"form-group"},N0={class:"form-group"},V0={class:"form-group"},H0={class:"form-group"},B0={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},q0={type:"submit",class:"btn btn-success"},K0={key:0,style:{"margin-top":"20px"}},W0={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-bottom":"20px"}},J0={key:0,class:"loading"},G0={key:1,class:"table"},Y0={class:"actions"},z0=["onClick"],X0=["onClick"],Q0={class:"modal-content"},Z0={key:0},$0={class:"user-details"},tw={class:"detail-row"},ew={class:"detail-row"},sw={class:"detail-row"},nw={class:"detail-row"},ow={class:"detail-row"},rw={class:"detail-row"},iw={class:"detail-row"},lw={class:"detail-row"},aw={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},cw={class:"form-group"},uw={class:"form-group"},dw={class:"form-group"},fw={class:"form-group"},mw={class:"form-group"},hw={class:"form-group"},pw={class:"form-group"},gw={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},yw={type:"submit",class:"btn btn-success"},_w={class:"modal-content"},vw={key:0},bw={class:"project-details"},ww={class:"detail-row"},kw={class:"detail-row"},Cw={class:"detail-row"},Tw={class:"detail-row"},Ew={class:"detail-row"},xw={class:"detail-row"},Fw={class:"detail-row"},Sw={class:"detail-row"},Pw={class:"detail-row"},Aw={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},Mw={class:"form-group"},Dw={class:"form-group"},Rw=["value"],Iw={class:"form-group"},jw={class:"form-group"},Ow={class:"form-group"},Uw={class:"form-group"},Lw={class:"form-group"},Nw={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},Vw={type:"submit",class:"btn btn-success"},Hw={class:"modal-content"},Bw={class:"contacts-management"},qw={class:"add-contact-section"},Kw={class:"form-row"},Ww={class:"form-group"},Jw={class:"form-group"},Gw={class:"form-row"},Yw={class:"form-group"},zw={class:"form-group"},Xw={class:"form-row"},Qw={class:"form-group"},Zw={class:"form-group"},$w={class:"form-group"},t2={class:"form-group"},e2={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}},s2={class:"existing-contacts-section"},n2={key:0,class:"no-contacts"},o2={key:1,class:"contacts-list"},r2={class:"contact-info"},i2={class:"contact-details"},l2={key:0,class:"detail"},a2={key:1,class:"detail"},c2={key:2,class:"detail"},u2={key:3,class:"detail"},d2={key:4,class:"detail"},f2={class:"contact-badges"},m2={key:0,class:"badge badge-primary"},h2={class:"contact-actions"},p2=["onClick"],g2=["onClick"],y2={style:{display:"flex",gap:"10px","justify-content":"flex-end","margin-top":"20px"}};function _2(e,t,r,i,n,o){const l=Lt("NavigationTabs"),a=Lt("ProjectsSection"),d=Lt("UsersSection"),g=Lt("ChartOfAccountsSection"),f=Lt("ExcelAccountingSection"),v=Lt("TuloslaskelmaSection"),_=Lt("ALVLaskentaSection"),P=Lt("TaskManagementSection"),S=Lt("AccountingSection");return m(),h("div",null,[s("header",null,[s("div",ov,[n.isLoggedIn?A("",!0):(m(),h("div",rv,[s("div",iv,[t[134]||(t[134]=s("h2",null,"Login",-1)),s("form",{onSubmit:t[2]||(t[2]=$((...c)=>o.login&&o.login(...c),["prevent"]))},[s("div",lv,[t[131]||(t[131]=s("label",{for:"login_username"},"Username",-1)),C(s("input",{type:"text",id:"login_username","onUpdate:modelValue":t[0]||(t[0]=c=>n.loginForm.username=c),required:"",placeholder:"Enter username"},null,512),[[R,n.loginForm.username]])]),s("div",av,[t[132]||(t[132]=s("label",{for:"login_password"},"Password",-1)),C(s("input",{type:"password",id:"login_password","onUpdate:modelValue":t[1]||(t[1]=c=>n.loginForm.password=c),required:"",placeholder:"Enter password"},null,512),[[R,n.loginForm.password]])]),t[133]||(t[133]=s("button",{type:"submit",class:"btn btn-primary btn-block"},"Login",-1))],32),n.loginError?(m(),h("div",cv,u(n.loginError),1)):A("",!0)])])),n.isLoggedIn?(m(),h("div",uv,[yt(l,{"active-section":n.activeSection,onSectionChange:t[3]||(t[3]=c=>n.activeSection=c)},null,8,["active-section"]),n.activeSection==="items"?(m(),h("div",dv,[s("div",fv,[t[135]||(t[135]=s("h2",null,"Tuotteet",-1)),s("button",{class:"btn btn-primary",onClick:t[4]||(t[4]=(...c)=>o.showAddModal&&o.showAddModal(...c))},"Lisää uusi tuote")]),n.loading?(m(),h("div",mv," Ladataan tuotteita... ")):n.items.length===0?(m(),h("div",hv," Tuotteita ei löytynyt. Lisää ensimmäinen tuote! ")):(m(),h("table",pv,[t[136]||(t[136]=s("thead",null,[s("tr",null,[s("th",null,"Tunniste"),s("th",null,"Nimi"),s("th",null,"Kuvaus"),s("th",null,"Sarjanumero"),s("th",null,"Määrä"),s("th",null,"Hinta"),s("th",null,"Ostopäivä"),s("th",null,"Kuva"),s("th",null,"Luotu"),s("th",null,"Toiminnot")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(n.items,c=>(m(),h("tr",{key:c.id},[s("td",null,u(c.id),1),s("td",null,u(c.name),1),s("td",null,u(c.description||"-"),1),s("td",null,u(c.serial_number||"-"),1),s("td",null,u(c.quantity),1),s("td",null,u(o.formatCurrency(c.price)),1),s("td",null,u(o.formatDate(c.date_of_purchase)),1),s("td",null,[c.picture?(m(),h("img",{key:0,src:c.picture,alt:c.name,style:{width:"50px",height:"50px","object-fit":"cover","border-radius":"4px"}},null,8,gv)):(m(),h("span",yv,"-"))]),s("td",null,u(o.formatDate(c.created_at)),1),s("td",null,[s("div",_v,[s("button",{class:"btn btn-primary",onClick:k=>o.viewItemDetails(c)},"Tiedot",8,vv),s("button",{class:"btn btn-warning",onClick:k=>o.editItem(c)},"Muokkaa",8,bv),s("button",{class:"btn btn-danger",onClick:k=>o.deleteItem(c.id)},"Poista",8,wv)])])]))),128))])]))])):A("",!0),n.activeSection==="clients"?(m(),h("div",kv,[s("div",Cv,[t[137]||(t[137]=s("h2",null,"Asiakkaat",-1)),s("div",Tv,[C(s("input",{type:"text","onUpdate:modelValue":t[5]||(t[5]=c=>n.clientSearch=c),placeholder:"Etsi asiakkaita...",onInput:t[6]||(t[6]=(...c)=>o.searchClients&&o.searchClients(...c)),style:{padding:"8px",border:"1px solid #ddd","border-radius":"4px"}},null,544),[[R,n.clientSearch]]),s("button",{class:"btn btn-primary",onClick:t[7]||(t[7]=(...c)=>o.showAddClientModal&&o.showAddClientModal(...c))},"Lisää uusi asiakas")])]),n.clientsLoading?(m(),h("div",Ev," Ladataan asiakkaita... ")):n.clients.length===0?(m(),h("div",xv," Asiakkaita ei löytynyt. Lisää ensimmäinen asiakas! ")):(m(),h("table",Fv,[t[138]||(t[138]=s("thead",null,[s("tr",null,[s("th",null,"Tunniste"),s("th",null,"Nimi"),s("th",null,"Yritys"),s("th",null,"Sähköposti"),s("th",null,"Puhelin"),s("th",null,"Kaupunki"),s("th",null,"Tuntihinta"),s("th",null,"Yhteyshenkilöt"),s("th",null,"Toiminnot")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(n.clients,c=>(m(),h("tr",{key:c.id},[s("td",null,u(c.id),1),s("td",null,u(c.first_name)+" "+u(c.last_name),1),s("td",null,u(c.company_name||"-"),1),s("td",null,u(c.email),1),s("td",null,u(c.phone||"-"),1),s("td",null,u(c.city||"-"),1),s("td",null,u(c.hour_price?"€"+parseFloat(c.hour_price).toFixed(2):"-"),1),s("td",null,[s("div",Sv,[c.contact_persons&&c.contact_persons.length>0?(m(),h("div",Pv,[(m(!0),h(H,null,z(c.contact_persons.slice(0,2),k=>(m(),h("div",{key:k.id,class:"contact-item"},[j(u(k.first_name)+" "+u(k.last_name)+" ",1),k.is_primary?(m(),h("span",Av,"P")):A("",!0)]))),128)),c.contact_persons.length>2?(m(),h("span",Mv," +"+u(c.contact_persons.length-2)+" lisää ",1)):A("",!0)])):(m(),h("div",Dv," Ei yhteyshenkilöitä ")),s("button",{class:"btn btn-sm btn-primary",onClick:k=>o.manageContacts(c)}," Hallitse ",8,Rv)])]),s("td",null,[s("div",Iv,[s("button",{class:"btn btn-warning",onClick:k=>o.editClient(c)},"Muokkaa",8,jv),s("button",{class:"btn btn-danger",onClick:k=>o.deleteClient(c.id)},"Poista",8,Ov)])])]))),128))])]))])):A("",!0),n.activeSection==="projects"?(m(),h("div",Uv,[yt(a,{"active-section":n.activeSection,projects:n.projects,"projects-loading":n.projectsLoading,"project-search":n.projectSearch,onAddProject:o.showAddProjectModal,onViewProject:o.viewProject,onEditProject:o.editProject,onDeleteProject:o.deleteProject,onSearchProjects:o.searchProjects,onShowTasks:o.handleShowTasks},null,8,["active-section","projects","projects-loading","project-search","onAddProject","onViewProject","onEditProject","onDeleteProject","onSearchProjects","onShowTasks"])])):A("",!0),n.activeSection==="users"?(m(),h("div",Lv,[yt(d,{"active-section":n.activeSection,users:n.users,"users-loading":n.usersLoading,"user-search":n.userSearch,onAddUser:o.showAddUserModal,onViewUser:o.viewUser,onEditUser:o.editUser,onDeleteUser:o.deleteUser,onSearchUsers:o.searchUsers},null,8,["active-section","users","users-loading","user-search","onAddUser","onViewUser","onEditUser","onDeleteUser","onSearchUsers"])])):A("",!0),n.activeSection==="chart-of-accounts"?(m(),h("div",Nv,[yt(g,{"active-section":n.activeSection,accounts:n.accounts,"accounts-loading":n.accountsLoading,"account-search":n.accountSearch,onAddAccount:o.showAddAccountModal,onViewAccount:o.viewAccount,onEditAccount:o.editAccount,onDeleteAccount:o.deleteAccount,onSearchAccounts:o.searchAccounts},null,8,["active-section","accounts","accounts-loading","account-search","onAddAccount","onViewAccount","onEditAccount","onDeleteAccount","onSearchAccounts"])])):A("",!0),n.activeSection==="accounting"?(m(),Ue(f,{key:5,"active-section":n.activeSection},null,8,["active-section"])):A("",!0),n.activeSection==="tuloslaskelma"?(m(),Ue(v,{key:6,"active-section":n.activeSection},null,8,["active-section"])):A("",!0),n.activeSection==="alv-laskenta"?(m(),Ue(_,{key:7,"active-section":n.activeSection},null,8,["active-section"])):A("",!0),n.activeSection==="tasks"?(m(),Ue(P,{key:8,"active-section":n.activeSection},null,8,["active-section"])):A("",!0)])):A("",!0)])]),s("main",Vv,[n.showModal?(m(),h("div",{key:0,class:"modal",onClick:t[18]||(t[18]=$((...c)=>o.closeModal&&o.closeModal(...c),["self"]))},[s("div",Hv,[s("span",{class:"close",onClick:t[8]||(t[8]=(...c)=>o.closeModal&&o.closeModal(...c))},"×"),s("h2",null,u(n.isEditing?"Muokkaa tuotetta":"Lisää uusi tuote"),1),s("form",{onSubmit:t[17]||(t[17]=$((...c)=>o.saveItem&&o.saveItem(...c),["prevent"]))},[s("div",Bv,[t[139]||(t[139]=s("label",{for:"name"},"Nimi *",-1)),C(s("input",{type:"text",id:"name","onUpdate:modelValue":t[9]||(t[9]=c=>n.formData.name=c),required:"",placeholder:"Syötä tuotteen nimi"},null,512),[[R,n.formData.name]])]),s("div",qv,[t[140]||(t[140]=s("label",{for:"description"},"Kuvaus",-1)),C(s("textarea",{id:"description","onUpdate:modelValue":t[10]||(t[10]=c=>n.formData.description=c),placeholder:"Syötä tuotteen kuvaus"},null,512),[[R,n.formData.description]])]),s("div",Kv,[t[141]||(t[141]=s("label",{for:"serial_number"},"Sarjanumero",-1)),C(s("input",{type:"text",id:"serial_number","onUpdate:modelValue":t[11]||(t[11]=c=>n.formData.serial_number=c),placeholder:"Syötä sarjanumero"},null,512),[[R,n.formData.serial_number]])]),s("div",Wv,[t[142]||(t[142]=s("label",{for:"picture"},"Kuva",-1)),s("input",{type:"file",id:"picture",onChange:t[12]||(t[12]=(...c)=>o.handleFileUpload&&o.handleFileUpload(...c)),accept:"image/*"},null,32),n.formData.picture?(m(),h("div",Jv,[s("img",{src:n.formData.picture,alt:n.formData.name,style:{"max-width":"200px","max-height":"200px","border-radius":"4px"}},null,8,Gv)])):A("",!0)]),s("div",Yv,[t[143]||(t[143]=s("label",{for:"quantity"},"Quantity *",-1)),C(s("input",{type:"number",id:"quantity","onUpdate:modelValue":t[13]||(t[13]=c=>n.formData.quantity=c),required:"",min:"0",placeholder:"Enter quantity"},null,512),[[R,n.formData.quantity]])]),s("div",zv,[t[144]||(t[144]=s("label",{for:"price"},"Price *",-1)),C(s("input",{type:"number",id:"price","onUpdate:modelValue":t[14]||(t[14]=c=>n.formData.price=c),required:"",min:"0",step:"0.01",placeholder:"Enter price"},null,512),[[R,n.formData.price]])]),s("div",Xv,[t[145]||(t[145]=s("label",{for:"date_of_purchase"},"Date of Purchase",-1)),C(s("input",{type:"date",id:"date_of_purchase","onUpdate:modelValue":t[15]||(t[15]=c=>n.formData.date_of_purchase=c),placeholder:"Select date of purchase"},null,512),[[R,n.formData.date_of_purchase]])]),s("div",Qv,[s("button",{type:"button",class:"btn",onClick:t[16]||(t[16]=(...c)=>o.closeModal&&o.closeModal(...c))},"Peruuta"),s("button",Zv,u(n.isEditing?"Päivitä":"Lisää")+" tuote ",1)])],32)])])):A("",!0),n.showDetailsModal?(m(),h("div",{key:1,class:"modal",onClick:t[27]||(t[27]=$((...c)=>o.closeDetailsModal&&o.closeDetailsModal(...c),["self"]))},[s("div",$v,[s("span",{class:"close",onClick:t[19]||(t[19]=(...c)=>o.closeDetailsModal&&o.closeDetailsModal(...c))},"×"),s("h2",null,"Tuotteen tiedot: "+u(n.selectedItem.name),1),s("div",tb,[s("button",{class:O(["tab-btn",{active:n.activeTab==="info"}]),onClick:t[20]||(t[20]=c=>n.activeTab="info")}," Tiedot ",2),s("button",{class:O(["tab-btn",{active:n.activeTab==="rental"}]),onClick:t[21]||(t[21]=c=>n.activeTab="rental")}," Vuokrahinnat ",2),s("button",{class:O(["tab-btn",{active:n.activeTab==="attachments"}]),onClick:t[22]||(t[22]=c=>n.activeTab="attachments")}," Liitteet ",2),s("button",{class:O(["tab-btn",{active:n.activeTab==="contacts"}]),onClick:t[23]||(t[23]=c=>n.activeTab="contacts")}," Yhteyshenkilöt ",2)]),n.activeTab==="info"?(m(),h("div",eb,[s("div",sb,[s("div",nb,[t[146]||(t[146]=s("strong",null,"ID:",-1)),j(" "+u(n.selectedItem.id),1)]),s("div",ob,[t[147]||(t[147]=s("strong",null,"Name:",-1)),j(" "+u(n.selectedItem.name),1)]),s("div",rb,[t[148]||(t[148]=s("strong",null,"Description:",-1)),j(" "+u(n.selectedItem.description||"No description"),1)]),s("div",ib,[t[149]||(t[149]=s("strong",null,"Serial Number:",-1)),j(" "+u(n.selectedItem.serial_number||"No serial number"),1)]),s("div",lb,[t[150]||(t[150]=s("strong",null,"Quantity:",-1)),j(" "+u(n.selectedItem.quantity),1)]),s("div",ab,[t[151]||(t[151]=s("strong",null,"Price:",-1)),j(" $"+u(parseFloat(n.selectedItem.price).toFixed(2)),1)]),s("div",cb,[t[152]||(t[152]=s("strong",null,"Created:",-1)),j(" "+u(o.formatDate(n.selectedItem.created_at)),1)]),n.selectedItem.picture?(m(),h("div",ub,[t[153]||(t[153]=s("strong",null,"Picture:",-1)),t[154]||(t[154]=s("br",null,null,-1)),s("img",{src:n.selectedItem.picture,alt:n.selectedItem.name,style:{"max-width":"300px","border-radius":"4px","margin-top":"10px"}},null,8,db)])):A("",!0)])])):A("",!0),n.activeTab==="rental"?(m(),h("div",fb,[s("div",mb,[s("button",{class:"btn btn-primary",onClick:t[24]||(t[24]=(...c)=>o.showAddRentalModal&&o.showAddRentalModal(...c))},"Add Rental Price")]),n.rentalPrices.length===0?(m(),h("div",hb," No rental prices found. ")):(m(),h("table",pb,[t[155]||(t[155]=s("thead",null,[s("tr",null,[s("th",null,"Client"),s("th",null,"Start Date"),s("th",null,"End Date"),s("th",null,"Daily Price"),s("th",null,"Actions")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(n.rentalPrices,c=>(m(),h("tr",{key:c.id},[s("td",null,u(o.getClientName(c.client_id)),1),s("td",null,u(o.formatDate(c.start_date)),1),s("td",null,u(o.formatDate(c.end_date)),1),s("td",null,"$"+u(parseFloat(c.daily_price).toFixed(2)),1),s("td",null,[s("button",{class:"btn btn-danger",onClick:k=>o.deleteRentalPrice(c.id)},"Delete",8,gb)])]))),128))])]))])):A("",!0),n.activeTab==="contacts"?(m(),h("div",yb,[s("div",_b,[s("button",{class:"btn btn-primary",onClick:t[25]||(t[25]=(...c)=>o.showAddContactPersonModal&&o.showAddContactPersonModal(...c))},"Add Contact Person")]),n.contactPersons.length===0?(m(),h("div",vb," No contact persons found. ")):(m(),h("div",bb,[(m(!0),h(H,null,z(n.contactPersons,c=>(m(),h("div",{key:c.id,class:"contact-person-item"},[s("div",wb,[s("strong",null,u(c.first_name)+" "+u(c.last_name),1),c.position?(m(),h("span",kb,"- "+u(c.position),1)):A("",!0),c.is_primary?(m(),h("span",Cb,"(Primary)")):A("",!0)]),s("div",Tb,[c.email?(m(),h("div",Eb,"📧 "+u(c.email),1)):A("",!0),c.phone?(m(),h("div",xb,"📞 "+u(c.phone),1)):A("",!0)]),s("div",Fb,[s("button",{class:"btn btn-warning",onClick:k=>o.editContactPerson(c)},"Edit",8,Sb),s("button",{class:"btn btn-danger",onClick:k=>o.deleteContactPerson(c.id)},"Delete",8,Pb)])]))),128))]))])):A("",!0),n.activeTab==="attachments"?(m(),h("div",Ab,[s("div",Mb,[s("button",{class:"btn btn-primary",onClick:t[26]||(t[26]=(...c)=>o.showAddAttachmentModal&&o.showAddAttachmentModal(...c))},"Add Attachment")]),n.attachments.length===0?(m(),h("div",Db," No attachments found. ")):(m(),h("div",Rb,[(m(!0),h(H,null,z(n.attachments,c=>(m(),h("div",{key:c.id,class:"attachment-item"},[s("div",Ib,[s("strong",null,u(c.original_name),1),s("span",jb,u(c.file_type),1),s("span",Ob,"("+u(o.formatFileSize(c.file_size))+")",1)]),s("div",Ub,[s("a",{href:c.file_path,target:"_blank",class:"btn btn-primary"},"View",8,Lb),s("button",{class:"btn btn-danger",onClick:k=>o.deleteAttachment(c.id)},"Delete",8,Nb)])]))),128))]))])):A("",!0)])])):A("",!0),n.showRentalModal?(m(),h("div",{key:2,class:"modal",onClick:t[35]||(t[35]=$((...c)=>o.closeRentalModal&&o.closeRentalModal(...c),["self"]))},[s("div",Vb,[s("span",{class:"close",onClick:t[28]||(t[28]=(...c)=>o.closeRentalModal&&o.closeRentalModal(...c))},"×"),t[162]||(t[162]=s("h2",null,"Add Rental Price",-1)),s("form",{onSubmit:t[34]||(t[34]=$((...c)=>o.saveRentalPrice&&o.saveRentalPrice(...c),["prevent"]))},[s("div",Hb,[t[157]||(t[157]=s("label",{for:"client_id"},"Client",-1)),C(s("select",{id:"client_id","onUpdate:modelValue":t[29]||(t[29]=c=>n.rentalForm.client_id=c)},[t[156]||(t[156]=s("option",{value:""},"Select client (optional)",-1)),(m(!0),h(H,null,z(n.clients,c=>(m(),h("option",{key:c.id,value:c.id},u(c.company_name?c.company_name+" - ":"")+u(c.first_name)+" "+u(c.last_name),9,Bb))),128))],512),[[ft,n.rentalForm.client_id]])]),s("div",qb,[t[158]||(t[158]=s("label",{for:"start_date"},"Start Date *",-1)),C(s("input",{type:"date",id:"start_date","onUpdate:modelValue":t[30]||(t[30]=c=>n.rentalForm.start_date=c),required:""},null,512),[[R,n.rentalForm.start_date]])]),s("div",Kb,[t[159]||(t[159]=s("label",{for:"end_date"},"End Date *",-1)),C(s("input",{type:"date",id:"end_date","onUpdate:modelValue":t[31]||(t[31]=c=>n.rentalForm.end_date=c),required:""},null,512),[[R,n.rentalForm.end_date]])]),s("div",Wb,[t[160]||(t[160]=s("label",{for:"daily_price"},"Daily Price *",-1)),C(s("input",{type:"number",id:"daily_price","onUpdate:modelValue":t[32]||(t[32]=c=>n.rentalForm.daily_price=c),required:"",min:"0",step:"0.01",placeholder:"Enter daily price"},null,512),[[R,n.rentalForm.daily_price]])]),s("div",Jb,[s("button",{type:"button",class:"btn",onClick:t[33]||(t[33]=(...c)=>o.closeRentalModal&&o.closeRentalModal(...c))},"Cancel"),t[161]||(t[161]=s("button",{type:"submit",class:"btn btn-success"},"Add Rental Price",-1))])],32)])])):A("",!0),n.showAttachmentModal?(m(),h("div",{key:3,class:"modal",onClick:t[41]||(t[41]=$((...c)=>o.closeAttachmentModal&&o.closeAttachmentModal(...c),["self"]))},[s("div",Gb,[s("span",{class:"close",onClick:t[36]||(t[36]=(...c)=>o.closeAttachmentModal&&o.closeAttachmentModal(...c))},"×"),t[167]||(t[167]=s("h2",null,"Add Attachment",-1)),s("form",{onSubmit:t[40]||(t[40]=$((...c)=>o.saveAttachment&&o.saveAttachment(...c),["prevent"]))},[s("div",Yb,[t[164]||(t[164]=s("label",{for:"file_type"},"Document Type *",-1)),C(s("select",{id:"file_type","onUpdate:modelValue":t[37]||(t[37]=c=>n.attachmentForm.file_type=c),required:""},[...t[163]||(t[163]=[s("option",{value:""},"Select type",-1),s("option",{value:"receipt"},"Receipt",-1),s("option",{value:"warranty"},"Warranty",-1),s("option",{value:"other"},"Other",-1)])],512),[[ft,n.attachmentForm.file_type]])]),s("div",zb,[t[165]||(t[165]=s("label",{for:"attachment_file"},"File *",-1)),s("input",{type:"file",id:"attachment_file",onChange:t[38]||(t[38]=(...c)=>o.handleAttachmentUpload&&o.handleAttachmentUpload(...c)),required:"",accept:".pdf,.doc,.docx,.txt,.jpg,.jpeg,.png,.gif"},null,32)]),s("div",Xb,[s("button",{type:"button",class:"btn",onClick:t[39]||(t[39]=(...c)=>o.closeAttachmentModal&&o.closeAttachmentModal(...c))},"Cancel"),t[166]||(t[166]=s("button",{type:"submit",class:"btn btn-success"},"Add Attachment",-1))])],32)])])):A("",!0),yt(S,{"active-section":n.activeSection,invoices:n.invoices,"invoices-loading":n.invoicesLoading,"journal-entries":n.journalEntries,"journal-entries-loading":n.journalEntriesLoading,transactions:n.transactions,"transactions-loading":n.transactionsLoading,"search-term":n.accountingSearch,onAddInvoice:o.showAddInvoiceModal,onViewInvoice:o.viewInvoice,onEditInvoice:o.editInvoice,onDeleteInvoice:o.deleteInvoice,onSearchInvoices:o.searchInvoices,onAddJournalEntry:o.showAddJournalEntryModal,onViewJournalEntry:o.viewJournalEntry,onEditJournalEntry:o.editJournalEntry,onDeleteJournalEntry:o.deleteJournalEntry,onSearch:o.searchAccounting},null,8,["active-section","invoices","invoices-loading","journal-entries","journal-entries-loading","transactions","transactions-loading","search-term","onAddInvoice","onViewInvoice","onEditInvoice","onDeleteInvoice","onSearchInvoices","onAddJournalEntry","onViewJournalEntry","onEditJournalEntry","onDeleteJournalEntry","onSearch"]),n.showClientModal?(m(),h("div",{key:4,class:"modal",onClick:t[58]||(t[58]=$((...c)=>o.closeClientModal&&o.closeClientModal(...c),["self"]))},[s("div",Qb,[s("span",{class:"close",onClick:t[42]||(t[42]=(...c)=>o.closeClientModal&&o.closeClientModal(...c))},"×"),s("h2",null,u(n.isEditingClient?"Edit Client":"Add New Client"),1),s("form",{onSubmit:t[57]||(t[57]=$((...c)=>o.saveClient&&o.saveClient(...c),["prevent"]))},[s("div",Zb,[t[168]||(t[168]=s("label",{for:"y_tunnus"},"Y-Tunnus",-1)),C(s("input",{type:"text",id:"y_tunnus","onUpdate:modelValue":t[43]||(t[43]=c=>n.clientForm.y_tunnus=c),placeholder:"Enter Y-tunnus"},null,512),[[R,n.clientForm.y_tunnus]])]),s("div",$b,[t[169]||(t[169]=s("label",{for:"company_name"},"Company Name",-1)),C(s("input",{type:"text",id:"company_name","onUpdate:modelValue":t[44]||(t[44]=c=>n.clientForm.company_name=c),placeholder:"Enter company name"},null,512),[[R,n.clientForm.company_name]])]),s("div",t0,[t[170]||(t[170]=s("label",{for:"first_name"},"First Name *",-1)),C(s("input",{type:"text",id:"first_name","onUpdate:modelValue":t[45]||(t[45]=c=>n.clientForm.first_name=c),required:"",placeholder:"Enter first name"},null,512),[[R,n.clientForm.first_name]])]),s("div",e0,[t[171]||(t[171]=s("label",{for:"last_name"},"Last Name *",-1)),C(s("input",{type:"text",id:"last_name","onUpdate:modelValue":t[46]||(t[46]=c=>n.clientForm.last_name=c),required:"",placeholder:"Enter last name"},null,512),[[R,n.clientForm.last_name]])]),s("div",s0,[t[172]||(t[172]=s("label",{for:"email"},"Email *",-1)),C(s("input",{type:"email",id:"email","onUpdate:modelValue":t[47]||(t[47]=c=>n.clientForm.email=c),required:"",placeholder:"Enter email address"},null,512),[[R,n.clientForm.email]])]),s("div",n0,[t[173]||(t[173]=s("label",{for:"phone"},"Phone",-1)),C(s("input",{type:"tel",id:"phone","onUpdate:modelValue":t[48]||(t[48]=c=>n.clientForm.phone=c),placeholder:"Enter phone number"},null,512),[[R,n.clientForm.phone]])]),s("div",o0,[t[174]||(t[174]=s("label",{for:"address"},"Address",-1)),C(s("input",{type:"text",id:"address","onUpdate:modelValue":t[49]||(t[49]=c=>n.clientForm.address=c),placeholder:"Enter street address"},null,512),[[R,n.clientForm.address]])]),s("div",r0,[t[175]||(t[175]=s("label",{for:"city"},"City",-1)),C(s("input",{type:"text",id:"city","onUpdate:modelValue":t[50]||(t[50]=c=>n.clientForm.city=c),placeholder:"Enter city"},null,512),[[R,n.clientForm.city]])]),s("div",i0,[t[176]||(t[176]=s("label",{for:"state"},"State/Province",-1)),C(s("input",{type:"text",id:"state","onUpdate:modelValue":t[51]||(t[51]=c=>n.clientForm.state=c),placeholder:"Enter state or province"},null,512),[[R,n.clientForm.state]])]),s("div",l0,[t[177]||(t[177]=s("label",{for:"postal_code"},"Postal Code",-1)),C(s("input",{type:"text",id:"postal_code","onUpdate:modelValue":t[52]||(t[52]=c=>n.clientForm.postal_code=c),placeholder:"Enter postal code"},null,512),[[R,n.clientForm.postal_code]])]),s("div",a0,[t[178]||(t[178]=s("label",{for:"country"},"Country",-1)),C(s("input",{type:"text",id:"country","onUpdate:modelValue":t[53]||(t[53]=c=>n.clientForm.country=c),placeholder:"Enter country"},null,512),[[R,n.clientForm.country]])]),s("div",c0,[t[179]||(t[179]=s("label",{for:"hour_price"},"Hour Price (€)",-1)),C(s("input",{type:"number",id:"hour_price","onUpdate:modelValue":t[54]||(t[54]=c=>n.clientForm.hour_price=c),step:"0.01",min:"0",placeholder:"Enter hourly rate"},null,512),[[R,n.clientForm.hour_price]])]),s("div",u0,[t[180]||(t[180]=s("label",{for:"notes"},"Notes",-1)),C(s("textarea",{id:"notes","onUpdate:modelValue":t[55]||(t[55]=c=>n.clientForm.notes=c),placeholder:"Enter any additional notes",rows:"3"},null,512),[[R,n.clientForm.notes]])]),s("div",d0,[s("button",{type:"button",class:"btn",onClick:t[56]||(t[56]=(...c)=>o.closeClientModal&&o.closeClientModal(...c))},"Cancel"),s("button",f0,u(n.isEditingClient?"Update":"Add")+" Client ",1)])],32)])])):A("",!0),n.showContactPersonModal?(m(),h("div",{key:5,class:"modal",onClick:t[68]||(t[68]=$((...c)=>o.closeContactPersonModal&&o.closeContactPersonModal(...c),["self"]))},[s("div",m0,[s("span",{class:"close",onClick:t[59]||(t[59]=(...c)=>o.closeContactPersonModal&&o.closeContactPersonModal(...c))},"×"),s("h2",null,u(n.isEditingContactPerson?"Edit Contact Person":"Add Contact Person"),1),s("form",{onSubmit:t[67]||(t[67]=$((...c)=>o.saveContactPerson&&o.saveContactPerson(...c),["prevent"]))},[s("div",h0,[t[181]||(t[181]=s("label",{for:"contact_first_name"},"First Name *",-1)),C(s("input",{type:"text",id:"contact_first_name","onUpdate:modelValue":t[60]||(t[60]=c=>n.contactPersonForm.first_name=c),required:"",placeholder:"Enter first name"},null,512),[[R,n.contactPersonForm.first_name]])]),s("div",p0,[t[182]||(t[182]=s("label",{for:"contact_last_name"},"Last Name *",-1)),C(s("input",{type:"text",id:"contact_last_name","onUpdate:modelValue":t[61]||(t[61]=c=>n.contactPersonForm.last_name=c),required:"",placeholder:"Enter last name"},null,512),[[R,n.contactPersonForm.last_name]])]),s("div",g0,[t[183]||(t[183]=s("label",{for:"contact_email"},"Email",-1)),C(s("input",{type:"email",id:"contact_email","onUpdate:modelValue":t[62]||(t[62]=c=>n.contactPersonForm.email=c),placeholder:"Enter email address"},null,512),[[R,n.contactPersonForm.email]])]),s("div",y0,[t[184]||(t[184]=s("label",{for:"contact_phone"},"Phone",-1)),C(s("input",{type:"tel",id:"contact_phone","onUpdate:modelValue":t[63]||(t[63]=c=>n.contactPersonForm.phone=c),placeholder:"Enter phone number"},null,512),[[R,n.contactPersonForm.phone]])]),s("div",_0,[t[185]||(t[185]=s("label",{for:"contact_position"},"Position",-1)),C(s("input",{type:"text",id:"contact_position","onUpdate:modelValue":t[64]||(t[64]=c=>n.contactPersonForm.position=c),placeholder:"Enter position/title"},null,512),[[R,n.contactPersonForm.position]])]),s("div",v0,[s("label",null,[C(s("input",{type:"checkbox",id:"contact_is_primary","onUpdate:modelValue":t[65]||(t[65]=c=>n.contactPersonForm.is_primary=c)},null,512),[[Fn,n.contactPersonForm.is_primary]]),t[186]||(t[186]=j(" Primary Contact ",-1))])]),s("div",b0,[s("button",{type:"button",class:"btn",onClick:t[66]||(t[66]=(...c)=>o.closeContactPersonModal&&o.closeContactPersonModal(...c))},"Cancel"),s("button",w0,u(n.isEditingContactPerson?"Update":"Add")+" Contact Person ",1)])],32)])])):A("",!0),n.showInvoiceItemsModal?(m(),h("div",{key:6,class:"modal",onClick:t[77]||(t[77]=$((...c)=>o.closeInvoiceItemsModal&&o.closeInvoiceItemsModal(...c),["self"]))},[s("div",k0,[s("span",{class:"close",onClick:t[69]||(t[69]=(...c)=>o.closeInvoiceItemsModal&&o.closeInvoiceItemsModal(...c))},"×"),s("h2",null,u(n.invoiceItemsForm.id?"Edit Invoice Item":"Add Invoice Item"),1),s("form",{onSubmit:t[76]||(t[76]=$((...c)=>o.saveInvoiceItem&&o.saveInvoiceItem(...c),["prevent"]))},[s("div",C0,[t[188]||(t[188]=s("label",{for:"item_id"},"Item *",-1)),C(s("select",{id:"item_id","onUpdate:modelValue":t[70]||(t[70]=c=>n.invoiceItemsForm.item_id=c),required:""},[t[187]||(t[187]=s("option",{value:""},"Select item",-1)),(m(!0),h(H,null,z(n.items,c=>(m(),h("option",{key:c.id,value:c.id},u(c.name),9,T0))),128))],512),[[ft,n.invoiceItemsForm.item_id]])]),s("div",E0,[t[189]||(t[189]=s("label",{for:"item_description"},"Description",-1)),C(s("input",{type:"text",id:"item_description","onUpdate:modelValue":t[71]||(t[71]=c=>n.invoiceItemsForm.description=c),placeholder:"Enter item description"},null,512),[[R,n.invoiceItemsForm.description]])]),s("div",x0,[t[190]||(t[190]=s("label",{for:"item_quantity"},"Quantity *",-1)),C(s("input",{type:"number",id:"item_quantity","onUpdate:modelValue":t[72]||(t[72]=c=>n.invoiceItemsForm.quantity=c),required:"",min:"0.01",step:"0.01",placeholder:"Enter quantity"},null,512),[[R,n.invoiceItemsForm.quantity]])]),s("div",F0,[t[191]||(t[191]=s("label",{for:"item_unit_price"},"Unit Price *",-1)),C(s("input",{type:"number",id:"item_unit_price","onUpdate:modelValue":t[73]||(t[73]=c=>n.invoiceItemsForm.unit_price=c),required:"",min:"0.01",step:"0.01",placeholder:"Enter unit price"},null,512),[[R,n.invoiceItemsForm.unit_price]])]),s("div",S0,[t[192]||(t[192]=s("label",{for:"item_line_total"},"Line Total",-1)),C(s("input",{type:"number",id:"item_line_total","onUpdate:modelValue":t[74]||(t[74]=c=>n.invoiceItemsForm.line_total=c),required:"",min:"0.01",step:"0.01",placeholder:"Enter line total"},null,512),[[R,n.invoiceItemsForm.line_total]])]),s("div",P0,[s("button",{type:"button",class:"btn",onClick:t[75]||(t[75]=(...c)=>o.closeInvoiceItemsModal&&o.closeInvoiceItemsModal(...c))},"Cancel"),s("button",A0,u(n.invoiceItemsForm.id?"Update":"Add")+" Item ",1)])],32)])])):A("",!0),n.showInvoiceModal?(m(),h("div",{key:7,class:"modal",onClick:t[91]||(t[91]=$((...c)=>o.closeInvoiceModal&&o.closeInvoiceModal(...c),["self"]))},[s("div",M0,[s("span",{class:"close",onClick:t[78]||(t[78]=(...c)=>o.closeInvoiceModal&&o.closeInvoiceModal(...c))},"×"),s("h2",null,u(n.isEditingInvoice?"Edit Invoice":"Create Invoice"),1),s("form",{onSubmit:t[89]||(t[89]=$((...c)=>o.saveInvoice&&o.saveInvoice(...c),["prevent"]))},[s("div",D0,[t[194]||(t[194]=s("label",{for:"invoice_client_id"},"Client *",-1)),C(s("select",{id:"invoice_client_id","onUpdate:modelValue":t[79]||(t[79]=c=>n.invoiceForm.client_id=c),required:""},[t[193]||(t[193]=s("option",{value:""},"Select client",-1)),(m(!0),h(H,null,z(n.clients,c=>(m(),h("option",{key:c.id,value:c.id},u(c.first_name)+" "+u(c.last_name),9,R0))),128))],512),[[ft,n.invoiceForm.client_id]])]),s("div",I0,[t[195]||(t[195]=s("label",{for:"invoice_number"},"Invoice Number *",-1)),C(s("input",{type:"text",id:"invoice_number","onUpdate:modelValue":t[80]||(t[80]=c=>n.invoiceForm.invoice_number=c),required:"",placeholder:"Enter invoice number"},null,512),[[R,n.invoiceForm.invoice_number]])]),s("div",j0,[t[196]||(t[196]=s("label",{for:"issue_date"},"Issue Date *",-1)),C(s("input",{type:"date",id:"issue_date","onUpdate:modelValue":t[81]||(t[81]=c=>n.invoiceForm.issue_date=c),required:""},null,512),[[R,n.invoiceForm.issue_date]])]),s("div",O0,[t[197]||(t[197]=s("label",{for:"due_date"},"Due Date *",-1)),C(s("input",{type:"date",id:"due_date","onUpdate:modelValue":t[82]||(t[82]=c=>n.invoiceForm.due_date=c),required:""},null,512),[[R,n.invoiceForm.due_date]])]),s("div",U0,[t[199]||(t[199]=s("label",{for:"invoice_status"},"Status",-1)),C(s("select",{id:"invoice_status","onUpdate:modelValue":t[83]||(t[83]=c=>n.invoiceForm.status=c)},[...t[198]||(t[198]=[Hn('<option value="draft" data-v-d56b4a32>Draft</option><option value="sent" data-v-d56b4a32>Sent</option><option value="paid" data-v-d56b4a32>Paid</option><option value="overdue" data-v-d56b4a32>Overdue</option><option value="cancelled" data-v-d56b4a32>Cancelled</option>',5)])],512),[[ft,n.invoiceForm.status]])]),s("div",L0,[t[200]||(t[200]=s("label",{for:"invoice_subtotal"},"Subtotal",-1)),C(s("input",{type:"number",id:"invoice_subtotal","onUpdate:modelValue":t[84]||(t[84]=c=>n.invoiceForm.subtotal=c),min:"0.01",step:"0.01",placeholder:"Enter subtotal"},null,512),[[R,n.invoiceForm.subtotal]])]),s("div",N0,[t[201]||(t[201]=s("label",{for:"invoice_tax_amount"},"Tax Amount",-1)),C(s("input",{type:"number",id:"invoice_tax_amount","onUpdate:modelValue":t[85]||(t[85]=c=>n.invoiceForm.tax_amount=c),min:"0.01",step:"0.01",placeholder:"Enter tax amount"},null,512),[[R,n.invoiceForm.tax_amount]])]),s("div",V0,[t[202]||(t[202]=s("label",{for:"invoice_total_amount"},"Total Amount",-1)),C(s("input",{type:"number",id:"invoice_total_amount","onUpdate:modelValue":t[86]||(t[86]=c=>n.invoiceForm.total_amount=c),min:"0.01",step:"0.01",placeholder:"Enter total amount"},null,512),[[R,n.invoiceForm.total_amount]])]),s("div",H0,[t[203]||(t[203]=s("label",{for:"invoice_notes"},"Notes",-1)),C(s("textarea",{id:"invoice_notes","onUpdate:modelValue":t[87]||(t[87]=c=>n.invoiceForm.notes=c),placeholder:"Enter any notes",rows:"3"},null,512),[[R,n.invoiceForm.notes]])]),s("div",B0,[s("button",{type:"button",class:"btn",onClick:t[88]||(t[88]=(...c)=>o.closeInvoiceModal&&o.closeInvoiceModal(...c))},"Cancel"),s("button",q0,u(n.isEditingInvoice?"Update":"Create")+" Invoice ",1)])],32),n.selectedInvoice.id?(m(),h("div",K0,[s("div",W0,[t[204]||(t[204]=s("h3",null,"Invoice Items",-1)),s("button",{class:"btn btn-primary",onClick:t[90]||(t[90]=(...c)=>e.showAddInvoiceItemModal&&e.showAddInvoiceItemModal(...c))},"Add Item")]),n.invoiceItems.length===0?(m(),h("div",J0," No items found for this invoice. ")):(m(),h("table",G0,[t[205]||(t[205]=s("thead",null,[s("tr",null,[s("th",null,"Item"),s("th",null,"Description"),s("th",null,"Quantity"),s("th",null,"Unit Price"),s("th",null,"Line Total"),s("th",null,"Actions")])],-1)),s("tbody",null,[(m(!0),h(H,null,z(n.invoiceItems,c=>(m(),h("tr",{key:c.id},[s("td",null,u(c.item_name),1),s("td",null,u(c.description),1),s("td",null,u(c.quantity),1),s("td",null,"$"+u(parseFloat(c.unit_price).toFixed(2)),1),s("td",null,"$"+u(parseFloat(c.line_total).toFixed(2)),1),s("td",null,[s("div",Y0,[s("button",{class:"btn btn-warning",onClick:k=>e.editInvoiceItem(c)},"Edit",8,z0),s("button",{class:"btn btn-danger",onClick:k=>o.deleteInvoiceItem(c.id)},"Delete",8,X0)])])]))),128))])]))])):A("",!0)])])):A("",!0),n.showUserModal?(m(),h("div",{key:8,class:"modal",onClick:t[104]||(t[104]=$((...c)=>o.closeUserModal&&o.closeUserModal(...c),["self"]))},[s("div",Q0,[s("span",{class:"close",onClick:t[92]||(t[92]=(...c)=>o.closeUserModal&&o.closeUserModal(...c))},"×"),s("h2",null,u(n.isEditingUser?"Edit User":"User Details"),1),n.isEditingUser?(m(),h("form",{key:1,onSubmit:t[103]||(t[103]=$((...c)=>o.saveUser&&o.saveUser(...c),["prevent"]))},[s("div",cw,[t[214]||(t[214]=s("label",{for:"username"},"Username *",-1)),C(s("input",{type:"text",id:"username","onUpdate:modelValue":t[95]||(t[95]=c=>n.userForm.username=c),required:"",placeholder:"Enter username"},null,512),[[R,n.userForm.username]])]),s("div",uw,[t[215]||(t[215]=s("label",{for:"first_name"},"First Name *",-1)),C(s("input",{type:"text",id:"first_name","onUpdate:modelValue":t[96]||(t[96]=c=>n.userForm.first_name=c),required:"",placeholder:"Enter first name"},null,512),[[R,n.userForm.first_name]])]),s("div",dw,[t[216]||(t[216]=s("label",{for:"last_name"},"Last Name *",-1)),C(s("input",{type:"text",id:"last_name","onUpdate:modelValue":t[97]||(t[97]=c=>n.userForm.last_name=c),required:"",placeholder:"Enter last name"},null,512),[[R,n.userForm.last_name]])]),s("div",fw,[t[217]||(t[217]=s("label",{for:"email"},"Email *",-1)),C(s("input",{type:"email",id:"email","onUpdate:modelValue":t[98]||(t[98]=c=>n.userForm.email=c),required:"",placeholder:"Enter email"},null,512),[[R,n.userForm.email]])]),s("div",mw,[t[219]||(t[219]=s("label",{for:"role"},"Role",-1)),C(s("select",{id:"role","onUpdate:modelValue":t[99]||(t[99]=c=>n.userForm.role=c)},[...t[218]||(t[218]=[s("option",{value:"user"},"User",-1),s("option",{value:"admin"},"Admin",-1)])],512),[[ft,n.userForm.role]])]),s("div",hw,[t[220]||(t[220]=s("label",{for:"password"},"Password",-1)),C(s("input",{type:"password",id:"password","onUpdate:modelValue":t[100]||(t[100]=c=>n.userForm.password=c),placeholder:"Leave blank to keep current password"},null,512),[[R,n.userForm.password]])]),s("div",pw,[s("label",null,[C(s("input",{type:"checkbox","onUpdate:modelValue":t[101]||(t[101]=c=>n.userForm.is_active=c)},null,512),[[Fn,n.userForm.is_active]]),t[221]||(t[221]=j(" Active ",-1))])]),s("div",gw,[s("button",{type:"button",class:"btn",onClick:t[102]||(t[102]=(...c)=>o.closeUserModal&&o.closeUserModal(...c))},"Cancel"),s("button",yw,u(n.userForm.id?"Update":"Add")+" User ",1)])],32)):(m(),h("div",Z0,[s("div",$0,[s("div",tw,[t[206]||(t[206]=s("strong",null,"ID:",-1)),j(" "+u(n.selectedUser.id),1)]),s("div",ew,[t[207]||(t[207]=s("strong",null,"Username:",-1)),j(" "+u(n.selectedUser.username),1)]),s("div",sw,[t[208]||(t[208]=s("strong",null,"Name:",-1)),j(" "+u(n.selectedUser.first_name)+" "+u(n.selectedUser.last_name),1)]),s("div",nw,[t[209]||(t[209]=s("strong",null,"Email:",-1)),j(" "+u(n.selectedUser.email),1)]),s("div",ow,[t[210]||(t[210]=s("strong",null,"Role:",-1)),j(" "+u(n.selectedUser.role||"User"),1)]),s("div",rw,[t[211]||(t[211]=s("strong",null,"Status:",-1)),j(" "+u(n.selectedUser.is_active?"Active":"Inactive"),1)]),s("div",iw,[t[212]||(t[212]=s("strong",null,"Created:",-1)),j(" "+u(o.formatDateTime(n.selectedUser.created_at)),1)]),s("div",lw,[t[213]||(t[213]=s("strong",null,"Last Login:",-1)),j(" "+u(o.formatDateTime(n.selectedUser.last_login)||"Never"),1)])]),s("div",aw,[s("button",{type:"button",class:"btn btn-warning",onClick:t[93]||(t[93]=c=>o.editUser(n.selectedUser))},"Edit User"),s("button",{type:"button",class:"btn",onClick:t[94]||(t[94]=(...c)=>o.closeUserModal&&o.closeUserModal(...c))},"Close")])]))])])):A("",!0),n.showProjectModal?(m(),h("div",{key:9,class:"modal",onClick:t[117]||(t[117]=$((...c)=>o.closeProjectModal&&o.closeProjectModal(...c),["self"]))},[s("div",_w,[s("span",{class:"close",onClick:t[105]||(t[105]=(...c)=>o.closeProjectModal&&o.closeProjectModal(...c))},"×"),s("h2",null,u(n.isEditingProject?"Edit Project":"Add New Project"),1),!n.isEditingProject&&n.selectedProject.id?(m(),h("div",vw,[s("div",bw,[s("div",ww,[t[222]||(t[222]=s("strong",null,"ID:",-1)),j(" "+u(n.selectedProject.id),1)]),s("div",kw,[t[223]||(t[223]=s("strong",null,"Project Name:",-1)),j(" "+u(n.selectedProject.project_name),1)]),s("div",Cw,[t[224]||(t[224]=s("strong",null,"Customer:",-1)),j(" "+u(o.getCustomerName(n.selectedProject.customer_id)||"Not specified"),1)]),s("div",Tw,[t[225]||(t[225]=s("strong",null,"Description:",-1)),j(" "+u(n.selectedProject.description||"No description"),1)]),s("div",Ew,[t[226]||(t[226]=s("strong",null,"Status:",-1)),j(" "+u(n.selectedProject.status||"Unknown"),1)]),s("div",xw,[t[227]||(t[227]=s("strong",null,"Start Date:",-1)),j(" "+u(o.formatDate(n.selectedProject.start_date)||"Not set"),1)]),s("div",Fw,[t[228]||(t[228]=s("strong",null,"End Date:",-1)),j(" "+u(o.formatDate(n.selectedProject.end_date)||"Not set"),1)]),s("div",Sw,[t[229]||(t[229]=s("strong",null,"Budget:",-1)),j(" "+u(o.formatCurrency(n.selectedProject.budget)||"Not set"),1)]),s("div",Pw,[t[230]||(t[230]=s("strong",null,"Created:",-1)),j(" "+u(o.formatDateTime(n.selectedProject.created_at)),1)])]),s("div",Aw,[s("button",{type:"button",class:"btn btn-warning",onClick:t[106]||(t[106]=c=>o.editProject(n.selectedProject))},"Edit Project"),s("button",{type:"button",class:"btn",onClick:t[107]||(t[107]=(...c)=>o.closeProjectModal&&o.closeProjectModal(...c))},"Close")])])):(m(),h("form",{key:1,onSubmit:t[116]||(t[116]=$((...c)=>o.saveProject&&o.saveProject(...c),["prevent"]))},[s("div",Mw,[t[231]||(t[231]=s("label",{for:"project_name"},"Project Name *",-1)),C(s("input",{type:"text",id:"project_name","onUpdate:modelValue":t[108]||(t[108]=c=>n.projectForm.project_name=c),required:"",placeholder:"Enter project name"},null,512),[[R,n.projectForm.project_name]])]),s("div",Dw,[t[233]||(t[233]=s("label",{for:"customer_id"},"Customer *",-1)),C(s("select",{id:"customer_id","onUpdate:modelValue":t[109]||(t[109]=c=>n.projectForm.customer_id=c),required:""},[t[232]||(t[232]=s("option",{value:""},"Select a customer",-1)),(m(!0),h(H,null,z(n.clients,c=>(m(),h("option",{key:c.id,value:c.id},u(c.company_name||c.first_name+" "+c.last_name),9,Rw))),128))],512),[[ft,n.projectForm.customer_id]])]),s("div",Iw,[t[234]||(t[234]=s("label",{for:"description"},"Description",-1)),C(s("textarea",{id:"description","onUpdate:modelValue":t[110]||(t[110]=c=>n.projectForm.description=c),placeholder:"Enter project description",rows:"3"},null,512),[[R,n.projectForm.description]])]),s("div",jw,[t[236]||(t[236]=s("label",{for:"status"},"Status",-1)),C(s("select",{id:"status","onUpdate:modelValue":t[111]||(t[111]=c=>n.projectForm.status=c)},[...t[235]||(t[235]=[Hn('<option value="planning" data-v-d56b4a32>Planning</option><option value="in_progress" data-v-d56b4a32>In Progress</option><option value="completed" data-v-d56b4a32>Completed</option><option value="on_hold" data-v-d56b4a32>On Hold</option><option value="cancelled" data-v-d56b4a32>Cancelled</option>',5)])],512),[[ft,n.projectForm.status]])]),s("div",Ow,[t[237]||(t[237]=s("label",{for:"start_date"},"Start Date",-1)),C(s("input",{type:"date",id:"start_date","onUpdate:modelValue":t[112]||(t[112]=c=>n.projectForm.start_date=c)},null,512),[[R,n.projectForm.start_date]])]),s("div",Uw,[t[238]||(t[238]=s("label",{for:"end_date"},"End Date",-1)),C(s("input",{type:"date",id:"end_date","onUpdate:modelValue":t[113]||(t[113]=c=>n.projectForm.end_date=c)},null,512),[[R,n.projectForm.end_date]])]),s("div",Lw,[t[239]||(t[239]=s("label",{for:"budget"},"Budget",-1)),C(s("input",{type:"number",id:"budget","onUpdate:modelValue":t[114]||(t[114]=c=>n.projectForm.budget=c),step:"0.01",placeholder:"Enter project budget"},null,512),[[R,n.projectForm.budget]])]),s("div",Nw,[s("button",{type:"button",class:"btn",onClick:t[115]||(t[115]=(...c)=>o.closeProjectModal&&o.closeProjectModal(...c))},"Cancel"),s("button",Vw,u(n.projectForm.id?"Update":"Add")+" Project ",1)])],32))])])):A("",!0),n.showContactModal?(m(),h("div",{key:10,class:"modal",onClick:t[130]||(t[130]=$((...c)=>o.closeContactModal&&o.closeContactModal(...c),["self"]))},[s("div",Hw,[s("span",{class:"close",onClick:t[118]||(t[118]=(...c)=>o.closeContactModal&&o.closeContactModal(...c))},"×"),s("h2",null,"Manage Contacts - "+u(n.selectedCustomer.company_name||n.selectedCustomer.first_name+" "+n.selectedCustomer.last_name),1),s("div",Bw,[s("div",qw,[t[249]||(t[249]=s("h3",null,"Add New Contact",-1)),s("form",{onSubmit:t[128]||(t[128]=$((...c)=>o.addContact&&o.addContact(...c),["prevent"]))},[s("div",Kw,[s("div",Ww,[t[240]||(t[240]=s("label",{for:"contact_first_name"},"First Name *",-1)),C(s("input",{type:"text",id:"contact_first_name","onUpdate:modelValue":t[119]||(t[119]=c=>n.contactForm.first_name=c),required:"",placeholder:"Enter first name"},null,512),[[R,n.contactForm.first_name]])]),s("div",Jw,[t[241]||(t[241]=s("label",{for:"contact_last_name"},"Last Name *",-1)),C(s("input",{type:"text",id:"contact_last_name","onUpdate:modelValue":t[120]||(t[120]=c=>n.contactForm.last_name=c),required:"",placeholder:"Enter last name"},null,512),[[R,n.contactForm.last_name]])])]),s("div",Gw,[s("div",Yw,[t[242]||(t[242]=s("label",{for:"contact_email"},"Email",-1)),C(s("input",{type:"email",id:"contact_email","onUpdate:modelValue":t[121]||(t[121]=c=>n.contactForm.email=c),placeholder:"Enter email"},null,512),[[R,n.contactForm.email]])]),s("div",zw,[t[243]||(t[243]=s("label",{for:"contact_phone"},"Phone",-1)),C(s("input",{type:"text",id:"contact_phone","onUpdate:modelValue":t[122]||(t[122]=c=>n.contactForm.phone=c),placeholder:"Enter phone"},null,512),[[R,n.contactForm.phone]])])]),s("div",Xw,[s("div",Qw,[t[244]||(t[244]=s("label",{for:"contact_position"},"Position",-1)),C(s("input",{type:"text",id:"contact_position","onUpdate:modelValue":t[123]||(t[123]=c=>n.contactForm.position=c),placeholder:"Enter position"},null,512),[[R,n.contactForm.position]])]),s("div",Zw,[t[245]||(t[245]=s("label",{for:"contact_department"},"Department",-1)),C(s("input",{type:"text",id:"contact_department","onUpdate:modelValue":t[124]||(t[124]=c=>n.contactForm.department=c),placeholder:"Enter department"},null,512),[[R,n.contactForm.department]])])]),s("div",$w,[t[246]||(t[246]=s("label",{for:"contact_notes"},"Notes",-1)),C(s("textarea",{id:"contact_notes","onUpdate:modelValue":t[125]||(t[125]=c=>n.contactForm.notes=c),placeholder:"Enter notes",rows:"3"},null,512),[[R,n.contactForm.notes]])]),s("div",t2,[s("label",null,[C(s("input",{type:"checkbox","onUpdate:modelValue":t[126]||(t[126]=c=>n.contactForm.is_primary=c)},null,512),[[Fn,n.contactForm.is_primary]]),t[247]||(t[247]=j(" Primary Contact ",-1))])]),s("div",e2,[s("button",{type:"button",class:"btn",onClick:t[127]||(t[127]=(...c)=>o.resetContactForm&&o.resetContactForm(...c))},"Clear"),t[248]||(t[248]=s("button",{type:"submit",class:"btn btn-success"},"Add Contact",-1))])],32)]),s("div",s2,[t[255]||(t[255]=s("h3",null,"Existing Contacts",-1)),n.customerContacts.length===0?(m(),h("div",n2," No contacts found for this customer. ")):(m(),h("div",o2,[(m(!0),h(H,null,z(n.customerContacts,c=>(m(),h("div",{key:c.id,class:"contact-item"},[s("div",r2,[s("h4",null,u(c.first_name)+" "+u(c.last_name),1),s("div",i2,[c.position?(m(),h("div",l2,[t[250]||(t[250]=s("strong",null,"Position:",-1)),j(" "+u(c.position),1)])):A("",!0),c.department?(m(),h("div",a2,[t[251]||(t[251]=s("strong",null,"Department:",-1)),j(" "+u(c.department),1)])):A("",!0),c.email?(m(),h("div",c2,[t[252]||(t[252]=s("strong",null,"Email:",-1)),j(" "+u(c.email),1)])):A("",!0),c.phone?(m(),h("div",u2,[t[253]||(t[253]=s("strong",null,"Phone:",-1)),j(" "+u(c.phone),1)])):A("",!0),c.notes?(m(),h("div",d2,[t[254]||(t[254]=s("strong",null,"Notes:",-1)),j(" "+u(c.notes),1)])):A("",!0)]),s("div",f2,[c.is_primary?(m(),h("span",m2,"Primary")):A("",!0)])]),s("div",h2,[s("button",{class:"btn btn-sm btn-warning",onClick:k=>o.editContact(c)},"Edit",8,p2),s("button",{class:"btn btn-sm btn-danger",onClick:k=>o.deleteContact(c.id)},"Delete",8,g2)])]))),128))]))])]),s("div",y2,[s("button",{type:"button",class:"btn",onClick:t[129]||(t[129]=(...c)=>o.closeContactModal&&o.closeContactModal(...c))},"Close")])])])):A("",!0)])])}const v2=Nt(nv,[["render",_2],["__scopeId","data-v-d56b4a32"]]);vc(v2).mount("#app");