(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function eo(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const xe={},Hn=[],Ot=()=>{},ml=()=>!1,Mr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),to=e=>e.startsWith("onUpdate:"),Le=Object.assign,no=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Iu=Object.prototype.hasOwnProperty,ye=(e,t)=>Iu.call(e,t),ee=Array.isArray,Wn=e=>Ms(e)==="[object Map]",rs=e=>Ms(e)==="[object Set]",Bo=e=>Ms(e)==="[object Date]",le=e=>typeof e=="function",Ee=e=>typeof e=="string",yt=e=>typeof e=="symbol",ve=e=>e!==null&&typeof e=="object",gl=e=>(ve(e)||le(e))&&le(e.then)&&le(e.catch),yl=Object.prototype.toString,Ms=e=>yl.call(e),Ou=e=>Ms(e).slice(8,-1),bl=e=>Ms(e)==="[object Object]",Fr=e=>Ee(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,gs=eo(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Br=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Lu=/-\w/g,ut=Br(e=>e.replace(Lu,t=>t.slice(1).toUpperCase())),Pu=/\B([A-Z])/g,Mn=Br(e=>e.replace(Pu,"-$1").toLowerCase()),Dr=Br(e=>e.charAt(0).toUpperCase()+e.slice(1)),ei=Br(e=>e?`on${Dr(e)}`:""),mn=(e,t)=>!Object.is(e,t),ir=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},qr=e=>{const t=parseFloat(e);return isNaN(t)?e:t},$u=e=>{const t=Ee(e)?Number(e):NaN;return isNaN(t)?e:t};let Do;const jr=()=>Do||(Do=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function gn(e){if(ee(e)){const t={};for(let n=0;n{if(n){const s=n.split(Mu);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Oe(e){let t="";if(Ee(e))t=e;else if(ee(e))for(let n=0;nFs(n,t))}const xl=e=>!!(e&&e.__v_isRef===!0),we=e=>Ee(e)?e:e==null?"":ee(e)||ve(e)&&(e.toString===yl||!le(e.toString))?xl(e)?we(e.value):JSON.stringify(e,Sl,2):String(e),Sl=(e,t)=>xl(t)?Sl(e,t.value):Wn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[ti(s,i)+" =>"]=r,n),{})}:rs(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ti(n))}:yt(t)?ti(t):ve(t)&&!ee(t)&&!bl(t)?String(t):t,ti=(e,t="")=>{var n;return yt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let De;class _l{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=De,!t&&De&&(this.index=(De.scopes||(De.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(De=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n0)return;if(bs){let t=bs;for(bs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ys;){let t=ys;for(ys=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Nl(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Al(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),ao(s),Vu(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Ti(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Il(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Il(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ts)||(e.globalVersion=Ts,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ti(e))))return;e.flags|=2;const t=e.dep,n=_e,s=pt;_e=e,pt=!0;try{Nl(e);const r=e.fn(e._value);(t.version===0||mn(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{_e=n,pt=s,Al(e),e.flags&=-3}}function ao(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)ao(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Vu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pt=!0;const Ol=[];function Ht(){Ol.push(pt),pt=!1}function Wt(){const e=Ol.pop();pt=e===void 0?!0:e}function jo(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=_e;_e=void 0;try{t()}finally{_e=n}}}let Ts=0;class zu{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Qr{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(!_e||!pt||_e===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==_e)n=this.activeLink=new zu(_e,this),_e.deps?(n.prevDep=_e.depsTail,_e.depsTail.nextDep=n,_e.depsTail=n):_e.deps=_e.depsTail=n,Ll(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=_e.depsTail,n.nextDep=void 0,_e.depsTail.nextDep=n,_e.depsTail=n,_e.deps===n&&(_e.deps=s)}return n}trigger(t){this.version++,Ts++,this.notify(t)}notify(t){io();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{oo()}}}function Ll(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Ll(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const pr=new WeakMap,On=Symbol(""),Ei=Symbol(""),Es=Symbol("");function qe(e,t,n){if(pt&&_e){let s=pr.get(e);s||pr.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Qr),r.map=s,r.key=n),r.track()}}function jt(e,t,n,s,r,i){const o=pr.get(e);if(!o){Ts++;return}const a=l=>{l&&l.trigger()};if(io(),t==="clear")o.forEach(a);else{const l=ee(e),u=l&&Fr(n);if(l&&n==="length"){const c=Number(s);o.forEach((f,h)=>{(h==="length"||h===Es||!yt(h)&&h>=c)&&a(f)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),u&&a(o.get(Es)),t){case"add":l?u&&a(o.get("length")):(a(o.get(On)),Wn(e)&&a(o.get(Ei)));break;case"delete":l||(a(o.get(On)),Wn(e)&&a(o.get(Ei)));break;case"set":Wn(e)&&a(o.get(On));break}}oo()}function Ku(e,t){const n=pr.get(e);return n&&n.get(t)}function Dn(e){const t=me(e);return t===e?t:(qe(t,"iterate",Es),ot(e)?t:t.map(bt))}function Vr(e){return qe(e=me(e),"iterate",Es),e}function on(e,t){return Gt(e)?Xn(zt(e)?bt(t):t):bt(t)}const Uu={__proto__:null,[Symbol.iterator](){return si(this,Symbol.iterator,e=>on(this,e))},concat(...e){return Dn(this).concat(...e.map(t=>ee(t)?Dn(t):t))},entries(){return si(this,"entries",e=>(e[1]=on(this,e[1]),e))},every(e,t){return kt(this,"every",e,t,void 0,arguments)},filter(e,t){return kt(this,"filter",e,t,n=>n.map(s=>on(this,s)),arguments)},find(e,t){return kt(this,"find",e,t,n=>on(this,n),arguments)},findIndex(e,t){return kt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return kt(this,"findLast",e,t,n=>on(this,n),arguments)},findLastIndex(e,t){return kt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return kt(this,"forEach",e,t,void 0,arguments)},includes(...e){return ri(this,"includes",e)},indexOf(...e){return ri(this,"indexOf",e)},join(e){return Dn(this).join(e)},lastIndexOf(...e){return ri(this,"lastIndexOf",e)},map(e,t){return kt(this,"map",e,t,void 0,arguments)},pop(){return ls(this,"pop")},push(...e){return ls(this,"push",e)},reduce(e,...t){return Qo(this,"reduce",e,t)},reduceRight(e,...t){return Qo(this,"reduceRight",e,t)},shift(){return ls(this,"shift")},some(e,t){return kt(this,"some",e,t,void 0,arguments)},splice(...e){return ls(this,"splice",e)},toReversed(){return Dn(this).toReversed()},toSorted(e){return Dn(this).toSorted(e)},toSpliced(...e){return Dn(this).toSpliced(...e)},unshift(...e){return ls(this,"unshift",e)},values(){return si(this,"values",e=>on(this,e))}};function si(e,t,n){const s=Vr(e),r=s[t]();return s!==e&&!ot(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const Hu=Array.prototype;function kt(e,t,n,s,r,i){const o=Vr(e),a=o!==e&&!ot(e),l=o[t];if(l!==Hu[t]){const f=l.apply(e,i);return a?bt(f):f}let u=n;o!==e&&(a?u=function(f,h){return n.call(this,on(e,f),h,e)}:n.length>2&&(u=function(f,h){return n.call(this,f,h,e)}));const c=l.call(o,u,s);return a&&r?r(c):c}function Qo(e,t,n,s){const r=Vr(e);let i=n;return r!==e&&(ot(e)?n.length>3&&(i=function(o,a,l){return n.call(this,o,a,l,e)}):i=function(o,a,l){return n.call(this,o,on(e,a),l,e)}),r[t](i,...s)}function ri(e,t,n){const s=me(e);qe(s,"iterate",Es);const r=s[t](...n);return(r===-1||r===!1)&&zr(n[0])?(n[0]=me(n[0]),s[t](...n)):r}function ls(e,t,n=[]){Ht(),io();const s=me(e)[t].apply(e,n);return oo(),Wt(),s}const Wu=eo("__proto__,__v_isRef,__isVue"),Pl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(yt));function Gu(e){yt(e)||(e=String(e));const t=me(this);return qe(t,"has",e),t.hasOwnProperty(e)}class $l{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?of:Bl:i?Fl:Ml).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=ee(t);if(!r){let l;if(o&&(l=Uu[n]))return l;if(n==="hasOwnProperty")return Gu}const a=Reflect.get(t,n,Te(t)?t:s);if((yt(n)?Pl.has(n):Wu(n))||(r||qe(t,"get",n),i))return a;if(Te(a)){const l=o&&Fr(n)?a:a.value;return r&&ve(l)?Rs(l):l}return ve(a)?r?Rs(a):is(a):a}}class kl extends $l{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];const o=ee(t)&&Fr(n);if(!this._isShallow){const u=Gt(i);if(!ot(s)&&!Gt(s)&&(i=me(i),s=me(s)),!o&&Te(i)&&!Te(s))return u||(i.value=s),!0}const a=o?Number(n)e,Us=e=>Reflect.getPrototypeOf(e);function ef(e,t,n){return function(...s){const r=this.__v_raw,i=me(r),o=Wn(i),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,u=r[e](...s),c=n?Ri:t?Xn:bt;return!t&&qe(i,"iterate",l?Ei:On),Le(Object.create(u),{next(){const{value:f,done:h}=u.next();return h?{value:f,done:h}:{value:a?[c(f[0]),c(f[1])]:c(f),done:h}}})}}function Hs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function tf(e,t){const n={get(r){const i=this.__v_raw,o=me(i),a=me(r);e||(mn(r,a)&&qe(o,"get",r),qe(o,"get",a));const{has:l}=Us(o),u=t?Ri:e?Xn:bt;if(l.call(o,r))return u(i.get(r));if(l.call(o,a))return u(i.get(a));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&qe(me(r),"iterate",On),r.size},has(r){const i=this.__v_raw,o=me(i),a=me(r);return e||(mn(r,a)&&qe(o,"has",r),qe(o,"has",a)),r===a?i.has(r):i.has(r)||i.has(a)},forEach(r,i){const o=this,a=o.__v_raw,l=me(a),u=t?Ri:e?Xn:bt;return!e&&qe(l,"iterate",On),a.forEach((c,f)=>r.call(i,u(c),u(f),o))}};return Le(n,e?{add:Hs("add"),set:Hs("set"),delete:Hs("delete"),clear:Hs("clear")}:{add(r){!t&&!ot(r)&&!Gt(r)&&(r=me(r));const i=me(this);return Us(i).has.call(i,r)||(i.add(r),jt(i,"add",r,r)),this},set(r,i){!t&&!ot(i)&&!Gt(i)&&(i=me(i));const o=me(this),{has:a,get:l}=Us(o);let u=a.call(o,r);u||(r=me(r),u=a.call(o,r));const c=l.call(o,r);return o.set(r,i),u?mn(i,c)&&jt(o,"set",r,i):jt(o,"add",r,i),this},delete(r){const i=me(this),{has:o,get:a}=Us(i);let l=o.call(i,r);l||(r=me(r),l=o.call(i,r)),a&&a.call(i,r);const u=i.delete(r);return l&&jt(i,"delete",r,void 0),u},clear(){const r=me(this),i=r.size!==0,o=r.clear();return i&&jt(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=ef(r,e,t)}),n}function lo(e,t){const n=tf(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(ye(n,r)&&r in s?n:s,r,i)}const nf={get:lo(!1,!1)},sf={get:lo(!1,!0)},rf={get:lo(!0,!1)};const Ml=new WeakMap,Fl=new WeakMap,Bl=new WeakMap,of=new WeakMap;function af(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function lf(e){return e.__v_skip||!Object.isExtensible(e)?0:af(Ou(e))}function is(e){return Gt(e)?e:co(e,!1,Xu,nf,Ml)}function Dl(e){return co(e,!1,Zu,sf,Fl)}function Rs(e){return co(e,!0,Yu,rf,Bl)}function co(e,t,n,s,r){if(!ve(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=lf(e);if(i===0)return e;const o=r.get(e);if(o)return o;const a=new Proxy(e,i===2?s:n);return r.set(e,a),a}function zt(e){return Gt(e)?zt(e.__v_raw):!!(e&&e.__v_isReactive)}function Gt(e){return!!(e&&e.__v_isReadonly)}function ot(e){return!!(e&&e.__v_isShallow)}function zr(e){return e?!!e.__v_raw:!1}function me(e){const t=e&&e.__v_raw;return t?me(t):e}function uo(e){return!ye(e,"__v_skip")&&Object.isExtensible(e)&&vl(e,"__v_skip",!0),e}const bt=e=>ve(e)?is(e):e,Xn=e=>ve(e)?Rs(e):e;function Te(e){return e?e.__v_isRef===!0:!1}function ae(e){return ql(e,!1)}function Ln(e){return ql(e,!0)}function ql(e,t){return Te(e)?e:new cf(e,t)}class cf{constructor(t,n){this.dep=new Qr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:me(t),this._value=n?t:bt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||ot(t)||Gt(t);t=s?t:me(t),mn(t,n)&&(this._rawValue=t,this._value=s?t:bt(t),this.dep.trigger())}}function H(e){return Te(e)?e.value:e}function Lt(e){return le(e)?e():H(e)}const uf={get:(e,t,n)=>t==="__v_raw"?e:H(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return Te(r)&&!Te(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function jl(e){return zt(e)?e:new Proxy(e,uf)}class ff{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Qr,{get:s,set:r}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=r}get value(){return this._value=this._get()}set value(t){this._set(t)}}function df(e){return new ff(e)}function hf(e){const t=ee(e)?new Array(e.length):{};for(const n in e)t[n]=Ql(e,n);return t}class pf{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=me(t);let r=!0,i=t;if(!ee(t)||!Fr(String(n)))do r=!zr(i)||ot(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=H(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Te(this._raw[this._key])){const n=this._object[this._key];if(Te(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Ku(this._raw,this._key)}}class mf{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function gf(e,t,n){return Te(e)?e:le(e)?new mf(e):ve(e)&&arguments.length>1?Ql(e,t,n):ae(e)}function Ql(e,t,n){return new pf(e,t,n)}class yf{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Qr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ts-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&_e!==this)return Rl(this,!0),!0}get value(){const t=this.dep.track();return Il(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function bf(e,t,n=!1){let s,r;return le(e)?s=e:(s=e.get,r=e.set),new yf(s,r,n)}const Ws={},mr=new WeakMap;let Tn;function vf(e,t=!1,n=Tn){if(n){let s=mr.get(n);s||mr.set(n,s=[]),s.push(e)}}function wf(e,t,n=xe){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:a,call:l}=n,u=S=>r?S:ot(S)||r===!1||r===0?Qt(S,1):Qt(S);let c,f,h,d,m=!1,b=!1;if(Te(e)?(f=()=>e.value,m=ot(e)):zt(e)?(f=()=>u(e),m=!0):ee(e)?(b=!0,m=e.some(S=>zt(S)||ot(S)),f=()=>e.map(S=>{if(Te(S))return S.value;if(zt(S))return u(S);if(le(S))return l?l(S,2):S()})):le(e)?t?f=l?()=>l(e,2):e:f=()=>{if(h){Ht();try{h()}finally{Wt()}}const S=Tn;Tn=c;try{return l?l(e,3,[d]):e(d)}finally{Tn=S}}:f=Ot,t&&r){const S=f,F=r===!0?1/0:r;f=()=>Qt(S(),F)}const E=ro(),C=()=>{c.stop(),E&&E.active&&no(E.effects,c)};if(i&&t){const S=t;t=(...F)=>{S(...F),C()}}let A=b?new Array(e.length).fill(Ws):Ws;const I=S=>{if(!(!(c.flags&1)||!c.dirty&&!S))if(t){const F=c.run();if(r||m||(b?F.some((j,_)=>mn(j,A[_])):mn(F,A))){h&&h();const j=Tn;Tn=c;try{const _=[F,A===Ws?void 0:b&&A[0]===Ws?[]:A,d];A=F,l?l(t,3,_):t(..._)}finally{Tn=j}}}else c.run()};return a&&a(I),c=new Tl(f),c.scheduler=o?()=>o(I,!1):I,d=S=>vf(S,!1,c),h=c.onStop=()=>{const S=mr.get(c);if(S){if(l)l(S,4);else for(const F of S)F();mr.delete(c)}},t?s?I(!0):A=c.run():o?o(I.bind(null,!0),!0):c.run(),C.pause=c.pause.bind(c),C.resume=c.resume.bind(c),C.stop=C,C}function Qt(e,t=1/0,n){if(t<=0||!ve(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Te(e))Qt(e.value,t,n);else if(ee(e))for(let s=0;s{Qt(s,t,n)});else if(bl(e)){for(const s in e)Qt(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Qt(e[s],t,n)}return e}function Bs(e,t,n,s){try{return s?e(...s):e()}catch(r){Ds(r,t,n)}}function vt(e,t,n,s){if(le(e)){const r=Bs(e,t,n,s);return r&&gl(r)&&r.catch(i=>{Ds(i,t,n)}),r}if(ee(e)){const r=[];for(let i=0;i>>1,r=Ue[s],i=Ns(r);i=Ns(n)?Ue.push(e):Ue.splice(Sf(t),0,e),e.flags|=1,zl()}}function zl(){gr||(gr=Vl.then(Ul))}function _f(e){ee(e)?Gn.push(...e):an&&e.id===-1?an.splice(jn+1,0,e):e.flags&1||(Gn.push(e),e.flags|=1),zl()}function Vo(e,t,n=Et+1){for(;nNs(n)-Ns(s));if(Gn.length=0,an){an.push(...t);return}for(an=t,jn=0;jne.id==null?e.flags&2?-1:1/0:e.id;function Ul(e){try{for(Et=0;Et{s._d&&xr(-1);const i=yr(t);let o;try{o=e(...r)}finally{yr(i),s._d&&xr(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function ft(e,t){if(Be===null)return e;const n=Wr(Be),s=e.dirs||(e.dirs=[]);for(let r=0;r1)return n&&le(t)?t.call(s&&s.proxy):t}}function ho(){return!!(Fn()||Pn)}const Cf=Symbol.for("v-scx"),Tf=()=>mt(Cf);function Nt(e,t){return po(e,null,t)}function gt(e,t,n){return po(e,t,n)}function po(e,t,n=xe){const{immediate:s,deep:r,flush:i,once:o}=n,a=Le({},n),l=t&&s||!t&&i!=="post";let u;if(Zn){if(i==="sync"){const d=Tf();u=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=Ot,d.resume=Ot,d.pause=Ot,d}}const c=Fe;a.call=(d,m,b)=>vt(d,c,m,b);let f=!1;i==="post"?a.scheduler=d=>{nt(d,c&&c.suspense)}:i!=="sync"&&(f=!0,a.scheduler=(d,m)=>{m?d():fo(d)}),a.augmentJob=d=>{t&&(d.flags|=4),f&&(d.flags|=2,c&&(d.id=c.uid,d.i=c))};const h=wf(e,t,a);return Zn&&(u?u.push(h):l&&h()),h}function Ef(e,t,n){const s=this.proxy,r=Ee(e)?e.includes(".")?Wl(s,e):()=>s[e]:e.bind(s,s);let i;le(t)?i=t:(i=t.handler,n=t);const o=Qs(this),a=po(r,i.bind(s),n);return o(),a}function Wl(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;re.__isTeleport,qt=Symbol("_leaveCb"),Gs=Symbol("_enterCb");function Nf(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Pt(()=>{e.isMounted=!0}),go(()=>{e.isUnmounting=!0}),e}const ct=[Function,Array],Jl={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ct,onEnter:ct,onAfterEnter:ct,onEnterCancelled:ct,onBeforeLeave:ct,onLeave:ct,onAfterLeave:ct,onLeaveCancelled:ct,onBeforeAppear:ct,onAppear:ct,onAfterAppear:ct,onAppearCancelled:ct},Xl=e=>{const t=e.subTree;return t.component?Xl(t.component):t},Af={name:"BaseTransition",props:Jl,setup(e,{slots:t}){const n=Fn(),s=Nf();return()=>{const r=t.default&&ec(t.default(),!0);if(!r||!r.length)return;const i=Yl(r),o=me(e),{mode:a}=o;if(s.isLeaving)return ii(i);const l=zo(i);if(!l)return ii(i);let u=Ni(l,o,s,n,f=>u=f);l.type!==je&&As(l,u);let c=n.subTree&&zo(n.subTree);if(c&&c.type!==je&&!Rn(c,l)&&Xl(n).type!==je){let f=Ni(c,o,s,n);if(As(c,f),a==="out-in"&&l.type!==je)return s.isLeaving=!0,f.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},ii(i);a==="in-out"&&l.type!==je?f.delayLeave=(h,d,m)=>{const b=Zl(s,c);b[String(c.key)]=c,h[qt]=()=>{d(),h[qt]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{m(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return i}}};function Yl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==je){t=n;break}}return t}const If=Af;function Zl(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Ni(e,t,n,s,r){const{appear:i,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:h,onLeave:d,onAfterLeave:m,onLeaveCancelled:b,onBeforeAppear:E,onAppear:C,onAfterAppear:A,onAppearCancelled:I}=t,S=String(e.key),F=Zl(n,e),j=(O,x)=>{O&&vt(O,s,9,x)},_=(O,x)=>{const $=x[1];j(O,x),ee(O)?O.every(N=>N.length<=1)&&$():O.length<=1&&$()},T={mode:o,persisted:a,beforeEnter(O){let x=l;if(!n.isMounted)if(i)x=E||l;else return;O[qt]&&O[qt](!0);const $=F[S];$&&Rn(e,$)&&$.el[qt]&&$.el[qt](),j(x,[O])},enter(O){let x=u,$=c,N=f;if(!n.isMounted)if(i)x=C||u,$=A||c,N=I||f;else return;let V=!1;const z=O[Gs]=fe=>{V||(V=!0,fe?j(N,[O]):j($,[O]),T.delayedLeave&&T.delayedLeave(),O[Gs]=void 0)};x?_(x,[O,z]):z()},leave(O,x){const $=String(e.key);if(O[Gs]&&O[Gs](!0),n.isUnmounting)return x();j(h,[O]);let N=!1;const V=O[qt]=z=>{N||(N=!0,x(),z?j(b,[O]):j(m,[O]),O[qt]=void 0,F[$]===e&&delete F[$])};F[$]=e,d?_(d,[O,V]):V()},clone(O){const x=Ni(O,t,n,s,r);return r&&r(x),x}};return T}function ii(e){if(qs(e))return e=bn(e),e.children=null,e}function zo(e){if(!qs(e))return Gl(e.type)&&e.children?Yl(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&le(n.default))return n.default()}}function As(e,t){e.shapeFlag&6&&e.component?(e.transition=t,As(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 ec(e,t=!1,n){let s=[],r=0;for(let i=0;i1)for(let i=0;ivs(m,t&&(ee(t)?t[b]:t),n,s,r));return}if(Jn(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&vs(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Wr(s.component):s.el,o=r?null:i,{i:a,r:l}=e,u=t&&t.r,c=a.refs===xe?a.refs={}:a.refs,f=a.setupState,h=me(f),d=f===xe?ml:m=>ye(h,m);if(u!=null&&u!==l){if(Ko(t),Ee(u))c[u]=null,d(u)&&(f[u]=null);else if(Te(u)){u.value=null;const m=t;m.k&&(c[m.k]=null)}}if(le(l))Bs(l,a,12,[o,c]);else{const m=Ee(l),b=Te(l);if(m||b){const E=()=>{if(e.f){const C=m?d(l)?f[l]:c[l]:l.value;if(r)ee(C)&&no(C,i);else if(ee(C))C.includes(i)||C.push(i);else if(m)c[l]=[i],d(l)&&(f[l]=c[l]);else{const A=[i];l.value=A,e.k&&(c[e.k]=A)}}else m?(c[l]=o,d(l)&&(f[l]=o)):b&&(l.value=o,e.k&&(c[e.k]=o))};if(o){const C=()=>{E(),br.delete(e)};C.id=-1,br.set(e,C),nt(C,n)}else Ko(e),E()}}}function Ko(e){const t=br.get(e);t&&(t.flags|=8,br.delete(e))}const Uo=e=>e.nodeType===8;jr().requestIdleCallback;jr().cancelIdleCallback;function Of(e,t){if(Uo(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Uo(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const Jn=e=>!!e.type.__asyncLoader;function Zt(e){le(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:r=200,hydrate:i,timeout:o,suspensible:a=!0,onError:l}=e;let u=null,c,f=0;const h=()=>(f++,u=null,d()),d=()=>{let m;return u||(m=u=t().catch(b=>{if(b=b instanceof Error?b:new Error(String(b)),l)return new Promise((E,C)=>{l(b,()=>E(h()),()=>C(b),f+1)});throw b}).then(b=>m!==u&&u?u:(b&&(b.__esModule||b[Symbol.toStringTag]==="Module")&&(b=b.default),c=b,b)))};return et({name:"AsyncComponentWrapper",__asyncLoader:d,__asyncHydrate(m,b,E){let C=!1;(b.bu||(b.bu=[])).push(()=>C=!0);const A=()=>{C||E()},I=i?()=>{const S=i(A,F=>Of(m,F));S&&(b.bum||(b.bum=[])).push(S)}:A;c?I():d().then(()=>!b.isUnmounted&&I())},get __asyncResolved(){return c},setup(){const m=Fe;if(mo(m),c)return()=>Js(c,m);const b=I=>{u=null,Ds(I,m,13,!s)};if(a&&m.suspense||Zn)return d().then(I=>()=>Js(I,m)).catch(I=>(b(I),()=>s?pe(s,{error:I}):null));const E=ae(!1),C=ae(),A=ae(!!r);return r&&setTimeout(()=>{A.value=!1},r),o!=null&&setTimeout(()=>{if(!E.value&&!C.value){const I=new Error(`Async component timed out after ${o}ms.`);b(I),C.value=I}},o),d().then(()=>{E.value=!0,m.parent&&qs(m.parent.vnode)&&m.parent.update()}).catch(I=>{b(I),C.value=I}),()=>{if(E.value&&c)return Js(c,m);if(C.value&&s)return pe(s,{error:C.value});if(n&&!A.value)return Js(n,m)}}})}function Js(e,t){const{ref:n,props:s,children:r,ce:i}=t.vnode,o=pe(e,s,r);return o.ref=n,o.ce=i,delete t.vnode.ce,o}const qs=e=>e.type.__isKeepAlive;function Lf(e,t){tc(e,"a",t)}function Pf(e,t){tc(e,"da",t)}function tc(e,t,n=Fe){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Kr(t,s,n),n){let r=n.parent;for(;r&&r.parent;)qs(r.parent.vnode)&&$f(s,t,n,r),r=r.parent}}function $f(e,t,n,s){const r=Kr(t,e,s,!0);js(()=>{no(s[t],r)},n)}function Kr(e,t,n=Fe,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Ht();const a=Qs(n),l=vt(t,n,e,o);return a(),Wt(),l});return s?r.unshift(i):r.push(i),i}}const Jt=e=>(t,n=Fe)=>{(!Zn||e==="sp")&&Kr(e,(...s)=>t(...s),n)},kf=Jt("bm"),Pt=Jt("m"),Mf=Jt("bu"),Ff=Jt("u"),go=Jt("bum"),js=Jt("um"),Bf=Jt("sp"),Df=Jt("rtg"),qf=Jt("rtc");function jf(e,t=Fe){Kr("ec",e,t)}const nc="components";function vr(e,t){return rc(nc,e,!0,t)||e}const sc=Symbol.for("v-ndc");function cs(e){return Ee(e)?rc(nc,e,!1)||e:e||sc}function rc(e,t,n=!0,s=!1){const r=Be||Fe;if(r){const i=r.type;{const a=Td(i,!1);if(a&&(a===t||a===ut(t)||a===Dr(ut(t))))return i}const o=Ho(r[e]||i[e],t)||Ho(r.appContext[e],t);return!o&&s?i:o}}function Ho(e,t){return e&&(e[t]||e[ut(t)]||e[Dr(ut(t))])}function Yn(e,t,n,s){let r;const i=n,o=ee(e);if(o||Ee(e)){const a=o&&zt(e);let l=!1,u=!1;a&&(l=!ot(e),u=Gt(e),e=Vr(e)),r=new Array(e.length);for(let c=0,f=e.length;ct(a,l,void 0,i));else{const a=Object.keys(e);r=new Array(a.length);for(let l=0,u=a.length;l0;return t!=="default"&&(n.name=t),Y(),Vt(Ce,null,[pe("slot",n,s&&s())],u?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),Y();const o=i&&ic(i(n)),a=n.key||o&&o.key,l=Vt(Ce,{key:(a&&!yt(a)?a:`_${t}`)+(!o&&s?"_fb":"")},o||(s?s():[]),o&&e._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),i&&i._c&&(i._d=!0),l}function ic(e){return e.some(t=>It(t)?!(t.type===je||t.type===Ce&&!ic(t.children)):!0)?e:null}const Ai=e=>e?Cc(e)?Wr(e):Ai(e.parent):null,ws=Le(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=>Ai(e.parent),$root:e=>Ai(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ac(e),$forceUpdate:e=>e.f||(e.f=()=>{fo(e.update)}),$nextTick:e=>e.n||(e.n=wn.bind(e.proxy)),$watch:e=>Ef.bind(e)}),oi=(e,t)=>e!==xe&&!e.__isScriptSetup&&ye(e,t),Qf={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const h=o[t];if(h!==void 0)switch(h){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(oi(s,t))return o[t]=1,s[t];if(r!==xe&&ye(r,t))return o[t]=2,r[t];if(ye(i,t))return o[t]=3,i[t];if(n!==xe&&ye(n,t))return o[t]=4,n[t];Ii&&(o[t]=0)}}const u=ws[t];let c,f;if(u)return t==="$attrs"&&qe(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==xe&&ye(n,t))return o[t]=4,n[t];if(f=l.config.globalProperties,ye(f,t))return f[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return oi(r,t)?(r[t]=n,!0):s!==xe&&ye(s,t)?(s[t]=n,!0):ye(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,props:i,type:o}},a){let l;return!!(n[a]||e!==xe&&a[0]!=="$"&&ye(e,a)||oi(t,a)||ye(i,a)||ye(s,a)||ye(ws,a)||ye(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ye(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Vf(){return zf().attrs}function zf(e){const t=Fn();return t.setupContext||(t.setupContext=Ec(t))}function Wo(e){return ee(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ii=!0;function Kf(e){const t=ac(e),n=e.proxy,s=e.ctx;Ii=!1,t.beforeCreate&&Go(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:h,beforeUpdate:d,updated:m,activated:b,deactivated:E,beforeDestroy:C,beforeUnmount:A,destroyed:I,unmounted:S,render:F,renderTracked:j,renderTriggered:_,errorCaptured:T,serverPrefetch:O,expose:x,inheritAttrs:$,components:N,directives:V,filters:z}=t;if(u&&Uf(u,s,null),o)for(const ce in o){const de=o[ce];le(de)&&(s[ce]=de.bind(n))}if(r){const ce=r.call(n,n);ve(ce)&&(e.data=is(ce))}if(Ii=!0,i)for(const ce in i){const de=i[ce],at=le(de)?de.bind(n,n):le(de.get)?de.get.bind(n,n):Ot,lt=!le(de)&&le(de.set)?de.set.bind(n):Ot,$e=se({get:at,set:lt});Object.defineProperty(s,ce,{enumerable:!0,configurable:!0,get:()=>$e.value,set:ke=>$e.value=ke})}if(a)for(const ce in a)oc(a[ce],s,n,ce);if(l){const ce=le(l)?l.call(n):l;Reflect.ownKeys(ce).forEach(de=>{or(de,ce[de])})}c&&Go(c,e,"c");function re(ce,de){ee(de)?de.forEach(at=>ce(at.bind(n))):de&&ce(de.bind(n))}if(re(kf,f),re(Pt,h),re(Mf,d),re(Ff,m),re(Lf,b),re(Pf,E),re(jf,T),re(qf,j),re(Df,_),re(go,A),re(js,S),re(Bf,O),ee(x))if(x.length){const ce=e.exposed||(e.exposed={});x.forEach(de=>{Object.defineProperty(ce,de,{get:()=>n[de],set:at=>n[de]=at,enumerable:!0})})}else e.exposed||(e.exposed={});F&&e.render===Ot&&(e.render=F),$!=null&&(e.inheritAttrs=$),N&&(e.components=N),V&&(e.directives=V),O&&mo(e)}function Uf(e,t,n=Ot){ee(e)&&(e=Oi(e));for(const s in e){const r=e[s];let i;ve(r)?"default"in r?i=mt(r.from||s,r.default,!0):i=mt(r.from||s):i=mt(r),Te(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function Go(e,t,n){vt(ee(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function oc(e,t,n,s){let r=s.includes(".")?Wl(n,s):()=>n[s];if(Ee(e)){const i=t[e];le(i)&>(r,i)}else if(le(e))gt(r,e.bind(n));else if(ve(e))if(ee(e))e.forEach(i=>oc(i,t,n,s));else{const i=le(e.handler)?e.handler.bind(n):t[e.handler];le(i)&>(r,i,e)}}function ac(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,a=i.get(t);let l;return a?l=a:!r.length&&!n&&!s?l=t:(l={},r.length&&r.forEach(u=>wr(l,u,o,!0)),wr(l,t,o)),ve(t)&&i.set(t,l),l}function wr(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&wr(e,i,n,!0),r&&r.forEach(o=>wr(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const a=Hf[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Hf={data:Jo,props:Xo,emits:Xo,methods:hs,computed:hs,beforeCreate:Ve,created:Ve,beforeMount:Ve,mounted:Ve,beforeUpdate:Ve,updated:Ve,beforeDestroy:Ve,beforeUnmount:Ve,destroyed:Ve,unmounted:Ve,activated:Ve,deactivated:Ve,errorCaptured:Ve,serverPrefetch:Ve,components:hs,directives:hs,watch:Gf,provide:Jo,inject:Wf};function Jo(e,t){return t?e?function(){return Le(le(e)?e.call(this,this):e,le(t)?t.call(this,this):t)}:t:e}function Wf(e,t){return hs(Oi(e),Oi(t))}function Oi(e){if(ee(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ut(t)}Modifiers`]||e[`${Mn(t)}Modifiers`];function Zf(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||xe;let r=n;const i=t.startsWith("update:"),o=i&&Yf(s,t.slice(7));o&&(o.trim&&(r=n.map(c=>Ee(c)?c.trim():c)),o.number&&(r=n.map(qr)));let a,l=s[a=ei(t)]||s[a=ei(ut(t))];!l&&i&&(l=s[a=ei(Mn(t))]),l&&vt(l,e,6,r);const u=s[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,vt(u,e,6,r)}}const ed=new WeakMap;function cc(e,t,n=!1){const s=n?ed:t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},a=!1;if(!le(e)){const l=u=>{const c=cc(u,t,!0);c&&(a=!0,Le(o,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!i&&!a?(ve(e)&&s.set(e,null),null):(ee(i)?i.forEach(l=>o[l]=null):Le(o,i),ve(e)&&s.set(e,o),o)}function Ur(e,t){return!e||!Mr(t)?!1:(t=t.slice(2).replace(/Once$/,""),ye(e,t[0].toLowerCase()+t.slice(1))||ye(e,Mn(t))||ye(e,t))}function Yo(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:a,emit:l,render:u,renderCache:c,props:f,data:h,setupState:d,ctx:m,inheritAttrs:b}=e,E=yr(e);let C,A;try{if(n.shapeFlag&4){const S=r||s,F=S;C=At(u.call(F,S,c,f,d,h,m)),A=a}else{const S=t;C=At(S.length>1?S(f,{attrs:a,slots:o,emit:l}):S(f,null)),A=t.props?a:td(a)}}catch(S){xs.length=0,Ds(S,e,1),C=pe(je)}let I=C;if(A&&b!==!1){const S=Object.keys(A),{shapeFlag:F}=I;S.length&&F&7&&(i&&S.some(to)&&(A=nd(A,i)),I=bn(I,A,!1,!0))}return n.dirs&&(I=bn(I,null,!1,!0),I.dirs=I.dirs?I.dirs.concat(n.dirs):n.dirs),n.transition&&As(I,n.transition),C=I,yr(E),C}const td=e=>{let t;for(const n in e)(n==="class"||n==="style"||Mr(n))&&((t||(t={}))[n]=e[n]);return t},nd=(e,t)=>{const n={};for(const s in e)(!to(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function sd(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:a,patchFlag:l}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return s?Zo(s,o,u):!!o;if(l&8){const c=t.dynamicProps;for(let f=0;fObject.create(uc),dc=e=>Object.getPrototypeOf(e)===uc;function id(e,t,n,s=!1){const r={},i=fc();e.propsDefaults=Object.create(null),hc(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:Dl(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function od(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,a=me(r),[l]=e.propsOptions;let u=!1;if((s||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let f=0;f{l=!0;const[h,d]=pc(f,t,!0);Le(o,h),d&&a.push(...d)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!i&&!l)return ve(e)&&s.set(e,Hn),Hn;if(ee(i))for(let c=0;ce==="_"||e==="_ctx"||e==="$stable",bo=e=>ee(e)?e.map(At):[At(e)],ld=(e,t,n)=>{if(t._n)return t;const s=dt((...r)=>bo(t(...r)),n);return s._c=!1,s},mc=(e,t,n)=>{const s=e._ctx;for(const r in e){if(yo(r))continue;const i=e[r];if(le(i))t[r]=ld(r,i,s);else if(i!=null){const o=bo(i);t[r]=()=>o}}},gc=(e,t)=>{const n=bo(t);e.slots.default=()=>n},yc=(e,t,n)=>{for(const s in t)(n||!yo(s))&&(e[s]=t[s])},cd=(e,t,n)=>{const s=e.slots=fc();if(e.vnode.shapeFlag&32){const r=t._;r?(yc(s,t,n),n&&vl(s,"_",r,!0)):mc(t,s)}else t&&gc(e,t)},ud=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=xe;if(s.shapeFlag&32){const a=t._;a?n&&a===1?i=!1:yc(r,t,n):(i=!t.$stable,mc(t,r)),o=t}else t&&(gc(e,t),o={default:1});if(i)for(const a in r)!yo(a)&&o[a]==null&&delete r[a]},nt=md;function fd(e){return dd(e)}function dd(e,t){const n=jr();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:h,setScopeId:d=Ot,insertStaticContent:m}=e,b=(p,y,w,L=null,k=null,P=null,G=void 0,U=null,K=!!y.dynamicChildren)=>{if(p===y)return;p&&!Rn(p,y)&&(L=g(p),ke(p,k,P,!0),p=null),y.patchFlag===-2&&(K=!1,y.dynamicChildren=null);const{type:D,ref:ie,shapeFlag:J}=y;switch(D){case Hr:E(p,y,w,L);break;case je:C(p,y,w,L);break;case ar:p==null&&A(y,w,L,G);break;case Ce:N(p,y,w,L,k,P,G,U,K);break;default:J&1?F(p,y,w,L,k,P,G,U,K):J&6?V(p,y,w,L,k,P,G,U,K):(J&64||J&128)&&D.process(p,y,w,L,k,P,G,U,K,W)}ie!=null&&k?vs(ie,p&&p.ref,P,y||p,!y):ie==null&&p&&p.ref!=null&&vs(p.ref,null,P,p,!0)},E=(p,y,w,L)=>{if(p==null)s(y.el=a(y.children),w,L);else{const k=y.el=p.el;y.children!==p.children&&u(k,y.children)}},C=(p,y,w,L)=>{p==null?s(y.el=l(y.children||""),w,L):y.el=p.el},A=(p,y,w,L)=>{[p.el,p.anchor]=m(p.children,y,w,L,p.el,p.anchor)},I=({el:p,anchor:y},w,L)=>{let k;for(;p&&p!==y;)k=h(p),s(p,w,L),p=k;s(y,w,L)},S=({el:p,anchor:y})=>{let w;for(;p&&p!==y;)w=h(p),r(p),p=w;r(y)},F=(p,y,w,L,k,P,G,U,K)=>{if(y.type==="svg"?G="svg":y.type==="math"&&(G="mathml"),p==null)j(y,w,L,k,P,G,U,K);else{const D=p.el&&p.el._isVueCE?p.el:null;try{D&&D._beginPatch(),O(p,y,k,P,G,U,K)}finally{D&&D._endPatch()}}},j=(p,y,w,L,k,P,G,U)=>{let K,D;const{props:ie,shapeFlag:J,transition:te,dirs:ue}=p;if(K=p.el=o(p.type,P,ie&&ie.is,ie),J&8?c(K,p.children):J&16&&T(p.children,K,null,L,k,ai(p,P),G,U),ue&&xn(p,null,L,"created"),_(K,p,p.scopeId,G,L),ie){for(const Se in ie)Se!=="value"&&!gs(Se)&&i(K,Se,null,ie[Se],P,L);"value"in ie&&i(K,"value",null,ie.value,P),(D=ie.onVnodeBeforeMount)&&Tt(D,L,p)}ue&&xn(p,null,L,"beforeMount");const he=hd(k,te);he&&te.beforeEnter(K),s(K,y,w),((D=ie&&ie.onVnodeMounted)||he||ue)&&nt(()=>{D&&Tt(D,L,p),he&&te.enter(K),ue&&xn(p,null,L,"mounted")},k)},_=(p,y,w,L,k)=>{if(w&&d(p,w),L)for(let P=0;P{for(let D=K;D{const U=y.el=p.el;let{patchFlag:K,dynamicChildren:D,dirs:ie}=y;K|=p.patchFlag&16;const J=p.props||xe,te=y.props||xe;let ue;if(w&&Sn(w,!1),(ue=te.onVnodeBeforeUpdate)&&Tt(ue,w,y,p),ie&&xn(y,p,w,"beforeUpdate"),w&&Sn(w,!0),(J.innerHTML&&te.innerHTML==null||J.textContent&&te.textContent==null)&&c(U,""),D?x(p.dynamicChildren,D,U,w,L,ai(y,k),P):G||de(p,y,U,null,w,L,ai(y,k),P,!1),K>0){if(K&16)$(U,J,te,w,k);else if(K&2&&J.class!==te.class&&i(U,"class",null,te.class,k),K&4&&i(U,"style",J.style,te.style,k),K&8){const he=y.dynamicProps;for(let Se=0;Se{ue&&Tt(ue,w,y,p),ie&&xn(y,p,w,"updated")},L)},x=(p,y,w,L,k,P,G)=>{for(let U=0;U{if(y!==w){if(y!==xe)for(const P in y)!gs(P)&&!(P in w)&&i(p,P,y[P],null,k,L);for(const P in w){if(gs(P))continue;const G=w[P],U=y[P];G!==U&&P!=="value"&&i(p,P,U,G,k,L)}"value"in w&&i(p,"value",y.value,w.value,k)}},N=(p,y,w,L,k,P,G,U,K)=>{const D=y.el=p?p.el:a(""),ie=y.anchor=p?p.anchor:a("");let{patchFlag:J,dynamicChildren:te,slotScopeIds:ue}=y;ue&&(U=U?U.concat(ue):ue),p==null?(s(D,w,L),s(ie,w,L),T(y.children||[],w,ie,k,P,G,U,K)):J>0&&J&64&&te&&p.dynamicChildren&&p.dynamicChildren.length===te.length?(x(p.dynamicChildren,te,w,k,P,G,U),(y.key!=null||k&&y===k.subTree)&&bc(p,y,!0)):de(p,y,w,ie,k,P,G,U,K)},V=(p,y,w,L,k,P,G,U,K)=>{y.slotScopeIds=U,p==null?y.shapeFlag&512?k.ctx.activate(y,w,L,G,K):z(y,w,L,k,P,G,K):fe(p,y,K)},z=(p,y,w,L,k,P,G)=>{const U=p.component=xd(p,L,k);if(qs(p)&&(U.ctx.renderer=W),Sd(U,!1,G),U.asyncDep){if(k&&k.registerDep(U,re,G),!p.el){const K=U.subTree=pe(je);C(null,K,y,w),p.placeholder=K.el}}else re(U,p,y,w,k,P,G)},fe=(p,y,w)=>{const L=y.component=p.component;if(sd(p,y,w))if(L.asyncDep&&!L.asyncResolved){ce(L,y,w);return}else L.next=y,L.update();else y.el=p.el,L.vnode=y},re=(p,y,w,L,k,P,G)=>{const U=()=>{if(p.isMounted){let{next:J,bu:te,u:ue,parent:he,vnode:Se}=p;{const _t=vc(p);if(_t){J&&(J.el=Se.el,ce(p,J,G)),_t.asyncDep.then(()=>{p.isUnmounted||U()});return}}let be=J,Ge;Sn(p,!1),J?(J.el=Se.el,ce(p,J,G)):J=Se,te&&ir(te),(Ge=J.props&&J.props.onVnodeBeforeUpdate)&&Tt(Ge,he,J,Se),Sn(p,!0);const Je=Yo(p),St=p.subTree;p.subTree=Je,b(St,Je,f(St.el),g(St),p,k,P),J.el=Je.el,be===null&&rd(p,Je.el),ue&&nt(ue,k),(Ge=J.props&&J.props.onVnodeUpdated)&&nt(()=>Tt(Ge,he,J,Se),k)}else{let J;const{el:te,props:ue}=y,{bm:he,m:Se,parent:be,root:Ge,type:Je}=p,St=Jn(y);Sn(p,!1),he&&ir(he),!St&&(J=ue&&ue.onVnodeBeforeMount)&&Tt(J,be,y),Sn(p,!0);{Ge.ce&&Ge.ce._def.shadowRoot!==!1&&Ge.ce._injectChildStyle(Je);const _t=p.subTree=Yo(p);b(null,_t,w,L,p,k,P),y.el=_t.el}if(Se&&nt(Se,k),!St&&(J=ue&&ue.onVnodeMounted)){const _t=y;nt(()=>Tt(J,be,_t),k)}(y.shapeFlag&256||be&&Jn(be.vnode)&&be.vnode.shapeFlag&256)&&p.a&&nt(p.a,k),p.isMounted=!0,y=w=L=null}};p.scope.on();const K=p.effect=new Tl(U);p.scope.off();const D=p.update=K.run.bind(K),ie=p.job=K.runIfDirty.bind(K);ie.i=p,ie.id=p.uid,K.scheduler=()=>fo(ie),Sn(p,!0),D()},ce=(p,y,w)=>{y.component=p;const L=p.vnode.props;p.vnode=y,p.next=null,od(p,y.props,L,w),ud(p,y.children,w),Ht(),Vo(p),Wt()},de=(p,y,w,L,k,P,G,U,K=!1)=>{const D=p&&p.children,ie=p?p.shapeFlag:0,J=y.children,{patchFlag:te,shapeFlag:ue}=y;if(te>0){if(te&128){lt(D,J,w,L,k,P,G,U,K);return}else if(te&256){at(D,J,w,L,k,P,G,U,K);return}}ue&8?(ie&16&&We(D,k,P),J!==D&&c(w,J)):ie&16?ue&16?lt(D,J,w,L,k,P,G,U,K):We(D,k,P,!0):(ie&8&&c(w,""),ue&16&&T(J,w,L,k,P,G,U,K))},at=(p,y,w,L,k,P,G,U,K)=>{p=p||Hn,y=y||Hn;const D=p.length,ie=y.length,J=Math.min(D,ie);let te;for(te=0;teie?We(p,k,P,!0,!1,J):T(y,w,L,k,P,G,U,K,J)},lt=(p,y,w,L,k,P,G,U,K)=>{let D=0;const ie=y.length;let J=p.length-1,te=ie-1;for(;D<=J&&D<=te;){const ue=p[D],he=y[D]=K?ln(y[D]):At(y[D]);if(Rn(ue,he))b(ue,he,w,null,k,P,G,U,K);else break;D++}for(;D<=J&&D<=te;){const ue=p[J],he=y[te]=K?ln(y[te]):At(y[te]);if(Rn(ue,he))b(ue,he,w,null,k,P,G,U,K);else break;J--,te--}if(D>J){if(D<=te){const ue=te+1,he=uete)for(;D<=J;)ke(p[D],k,P,!0),D++;else{const ue=D,he=D,Se=new Map;for(D=he;D<=te;D++){const tt=y[D]=K?ln(y[D]):At(y[D]);tt.key!=null&&Se.set(tt.key,D)}let be,Ge=0;const Je=te-he+1;let St=!1,_t=0;const as=new Array(Je);for(D=0;D=Je){ke(tt,k,P,!0);continue}let Ct;if(tt.key!=null)Ct=Se.get(tt.key);else for(be=he;be<=te;be++)if(as[be-he]===0&&Rn(tt,y[be])){Ct=be;break}Ct===void 0?ke(tt,k,P,!0):(as[Ct-he]=D+1,Ct>=_t?_t=Ct:St=!0,b(tt,y[Ct],w,null,k,P,G,U,K),Ge++)}const ko=St?pd(as):Hn;for(be=ko.length-1,D=Je-1;D>=0;D--){const tt=he+D,Ct=y[tt],Mo=y[tt+1],Fo=tt+1{const{el:P,type:G,transition:U,children:K,shapeFlag:D}=p;if(D&6){$e(p.component.subTree,y,w,L);return}if(D&128){p.suspense.move(y,w,L);return}if(D&64){G.move(p,y,w,W);return}if(G===Ce){s(P,y,w);for(let J=0;JU.enter(P),k);else{const{leave:J,delayLeave:te,afterLeave:ue}=U,he=()=>{p.ctx.isUnmounted?r(P):s(P,y,w)},Se=()=>{P._isLeaving&&P[qt](!0),J(P,()=>{he(),ue&&ue()})};te?te(P,he,Se):Se()}else s(P,y,w)},ke=(p,y,w,L=!1,k=!1)=>{const{type:P,props:G,ref:U,children:K,dynamicChildren:D,shapeFlag:ie,patchFlag:J,dirs:te,cacheIndex:ue}=p;if(J===-2&&(k=!1),U!=null&&(Ht(),vs(U,null,w,p,!0),Wt()),ue!=null&&(y.renderCache[ue]=void 0),ie&256){y.ctx.deactivate(p);return}const he=ie&1&&te,Se=!Jn(p);let be;if(Se&&(be=G&&G.onVnodeBeforeUnmount)&&Tt(be,y,p),ie&6)$t(p.component,w,L);else{if(ie&128){p.suspense.unmount(w,L);return}he&&xn(p,null,y,"beforeUnmount"),ie&64?p.type.remove(p,y,w,W,L):D&&!D.hasOnce&&(P!==Ce||J>0&&J&64)?We(D,y,w,!1,!0):(P===Ce&&J&384||!k&&ie&16)&&We(K,y,w),L&&Xt(p)}(Se&&(be=G&&G.onVnodeUnmounted)||he)&&nt(()=>{be&&Tt(be,y,p),he&&xn(p,null,y,"unmounted")},w)},Xt=p=>{const{type:y,el:w,anchor:L,transition:k}=p;if(y===Ce){Yt(w,L);return}if(y===ar){S(p);return}const P=()=>{r(w),k&&!k.persisted&&k.afterLeave&&k.afterLeave()};if(p.shapeFlag&1&&k&&!k.persisted){const{leave:G,delayLeave:U}=k,K=()=>G(w,P);U?U(p.el,P,K):K()}else P()},Yt=(p,y)=>{let w;for(;p!==y;)w=h(p),r(p),p=w;r(y)},$t=(p,y,w)=>{const{bum:L,scope:k,job:P,subTree:G,um:U,m:K,a:D}=p;ta(K),ta(D),L&&ir(L),k.stop(),P&&(P.flags|=8,ke(G,p,y,w)),U&&nt(U,y),nt(()=>{p.isUnmounted=!0},y)},We=(p,y,w,L=!1,k=!1,P=0)=>{for(let G=P;G{if(p.shapeFlag&6)return g(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const y=h(p.anchor||p.el),w=y&&y[Rf];return w?h(w):y};let Q=!1;const B=(p,y,w)=>{let L;p==null?y._vnode&&(ke(y._vnode,null,null,!0),L=y._vnode.component):b(y._vnode||null,p,y,null,null,null,w),y._vnode=p,Q||(Q=!0,Vo(L),Kl(),Q=!1)},W={p:b,um:ke,m:$e,r:Xt,mt:z,mc:T,pc:de,pbc:x,n:g,o:e};return{render:B,hydrate:void 0,createApp:Xf(B)}}function ai({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Sn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function hd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function bc(e,t,n=!1){const s=e.children,r=t.children;if(ee(s)&&ee(r))for(let i=0;i>1,e[n[a]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function vc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:vc(t)}function ta(e){if(e)for(let t=0;te.__isSuspense;function md(e,t){t&&t.pendingBranch?ee(e)?t.effects.push(...e):t.effects.push(e):_f(e)}const Ce=Symbol.for("v-fgt"),Hr=Symbol.for("v-txt"),je=Symbol.for("v-cmt"),ar=Symbol.for("v-stc"),xs=[];let it=null;function Y(e=!1){xs.push(it=e?null:[])}function gd(){xs.pop(),it=xs[xs.length-1]||null}let Is=1;function xr(e,t=!1){Is+=e,e<0&&it&&t&&(it.hasOnce=!0)}function Sc(e){return e.dynamicChildren=Is>0?it||Hn:null,gd(),Is>0&&it&&it.push(e),e}function ne(e,t,n,s,r,i){return Sc(R(e,t,n,s,r,i,!0))}function Vt(e,t,n,s,r){return Sc(pe(e,t,n,s,r,!0))}function It(e){return e?e.__v_isVNode===!0:!1}function Rn(e,t){return e.type===t.type&&e.key===t.key}const _c=({key:e})=>e??null,lr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ee(e)||Te(e)||le(e)?{i:Be,r:e,k:t,f:!!n}:e:null);function R(e,t=null,n=null,s=0,r=null,i=e===Ce?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&_c(t),ref:t&&lr(t),scopeId:Hl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Be};return a?(wo(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=Ee(n)?8:16),Is>0&&!o&&it&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&it.push(l),l}const pe=yd;function yd(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===sc)&&(e=je),It(e)){const a=bn(e,t,!0);return n&&wo(a,n),Is>0&&!i&&it&&(a.shapeFlag&6?it[it.indexOf(e)]=a:it.push(a)),a.patchFlag=-2,a}if(Ed(e)&&(e=e.__vccOpts),t){t=bd(t);let{class:a,style:l}=t;a&&!Ee(a)&&(t.class=Oe(a)),ve(l)&&(zr(l)&&!ee(l)&&(l=Le({},l)),t.style=gn(l))}const o=Ee(e)?1:xc(e)?128:Gl(e)?64:ve(e)?4:le(e)?2:0;return R(e,t,n,s,r,o,i,!0)}function bd(e){return e?zr(e)||dc(e)?Le({},e):e:null}function bn(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:a,transition:l}=e,u=t?Ss(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&_c(u),ref:t&&t.ref?n&&i?ee(i)?i.concat(lr(t)):[i,lr(t)]:lr(t):i,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!==Ce?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&bn(e.ssContent),ssFallback:e.ssFallback&&bn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&As(c,l.clone(c)),c}function rt(e=" ",t=0){return pe(Hr,null,e,t)}function vo(e,t){const n=pe(ar,null,e);return n.staticCount=t,n}function Pe(e="",t=!1){return t?(Y(),Vt(je,null,e)):pe(je,null,e)}function At(e){return e==null||typeof e=="boolean"?pe(je):ee(e)?pe(Ce,null,e.slice()):It(e)?ln(e):pe(Hr,null,String(e))}function ln(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:bn(e)}function wo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(ee(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),wo(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!dc(t)?t._ctx=Be:r===3&&Be&&(Be.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else le(t)?(t={default:t,_ctx:Be},n=32):(t=String(t),s&64?(n=16,t=[rt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ss(...e){const t={};for(let n=0;nFe||Be;let Sr,Pi;{const e=jr(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};Sr=t("__VUE_INSTANCE_SETTERS__",n=>Fe=n),Pi=t("__VUE_SSR_SETTERS__",n=>Zn=n)}const Qs=e=>{const t=Fe;return Sr(e),e.scope.on(),()=>{e.scope.off(),Sr(t)}},na=()=>{Fe&&Fe.scope.off(),Sr(null)};function Cc(e){return e.vnode.shapeFlag&4}let Zn=!1;function Sd(e,t=!1,n=!1){t&&Pi(t);const{props:s,children:r}=e.vnode,i=Cc(e);id(e,s,i,t),cd(e,r,n||t);const o=i?_d(e,t):void 0;return t&&Pi(!1),o}function _d(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Qf);const{setup:s}=n;if(s){Ht();const r=e.setupContext=s.length>1?Ec(e):null,i=Qs(e),o=Bs(s,e,0,[e.props,r]),a=gl(o);if(Wt(),i(),(a||e.sp)&&!Jn(e)&&mo(e),a){if(o.then(na,na),t)return o.then(l=>{sa(e,l)}).catch(l=>{Ds(l,e,0)});e.asyncDep=o}else sa(e,o)}else Tc(e)}function sa(e,t,n){le(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ve(t)&&(e.setupState=jl(t)),Tc(e)}function Tc(e,t,n){const s=e.type;e.render||(e.render=s.render||Ot);{const r=Qs(e);Ht();try{Kf(e)}finally{Wt(),r()}}}const Cd={get(e,t){return qe(e,"get",""),e[t]}};function Ec(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Cd),slots:e.slots,emit:e.emit,expose:t}}function Wr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(jl(uo(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ws)return ws[n](e)},has(t,n){return n in t||n in ws}})):e.proxy}function Td(e,t=!0){return le(e)?e.displayName||e.name:e.name||t&&e.__name}function Ed(e){return le(e)&&"__vccOpts"in e}const se=(e,t)=>bf(e,t,Zn);function xo(e,t,n){try{xr(-1);const s=arguments.length;return s===2?ve(t)&&!ee(t)?It(t)?pe(e,null,[t]):pe(e,t):pe(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&It(n)&&(n=[n]),pe(e,t,n))}finally{xr(1)}}const Rd="3.5.27";let $i;const ra=typeof window<"u"&&window.trustedTypes;if(ra)try{$i=ra.createPolicy("vue",{createHTML:e=>e})}catch{}const Rc=$i?e=>$i.createHTML(e):e=>e,Nd="http://www.w3.org/2000/svg",Ad="http://www.w3.org/1998/Math/MathML",Dt=typeof document<"u"?document:null,ia=Dt&&Dt.createElement("template"),Id={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Dt.createElementNS(Nd,e):t==="mathml"?Dt.createElementNS(Ad,e):n?Dt.createElement(e,{is:n}):Dt.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Dt.createTextNode(e),createComment:e=>Dt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Dt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{ia.innerHTML=Rc(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const a=ia.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},en="transition",us="animation",Os=Symbol("_vtc"),Nc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Od=Le({},Jl,Nc),Ld=e=>(e.displayName="Transition",e.props=Od,e),Pd=Ld((e,{slots:t})=>xo(If,$d(e),t)),_n=(e,t=[])=>{ee(e)?e.forEach(n=>n(...t)):e&&e(...t)},oa=e=>e?ee(e)?e.some(t=>t.length>1):e.length>1:!1;function $d(e){const t={};for(const N in e)N in Nc||(t[N]=e[N]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:u=o,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,m=kd(r),b=m&&m[0],E=m&&m[1],{onBeforeEnter:C,onEnter:A,onEnterCancelled:I,onLeave:S,onLeaveCancelled:F,onBeforeAppear:j=C,onAppear:_=A,onAppearCancelled:T=I}=t,O=(N,V,z,fe)=>{N._enterCancelled=fe,Cn(N,V?c:a),Cn(N,V?u:o),z&&z()},x=(N,V)=>{N._isLeaving=!1,Cn(N,f),Cn(N,d),Cn(N,h),V&&V()},$=N=>(V,z)=>{const fe=N?_:A,re=()=>O(V,N,z);_n(fe,[V,re]),aa(()=>{Cn(V,N?l:i),Mt(V,N?c:a),oa(fe)||la(V,s,b,re)})};return Le(t,{onBeforeEnter(N){_n(C,[N]),Mt(N,i),Mt(N,o)},onBeforeAppear(N){_n(j,[N]),Mt(N,l),Mt(N,u)},onEnter:$(!1),onAppear:$(!0),onLeave(N,V){N._isLeaving=!0;const z=()=>x(N,V);Mt(N,f),N._enterCancelled?(Mt(N,h),fa(N)):(fa(N),Mt(N,h)),aa(()=>{N._isLeaving&&(Cn(N,f),Mt(N,d),oa(S)||la(N,s,E,z))}),_n(S,[N,z])},onEnterCancelled(N){O(N,!1,void 0,!0),_n(I,[N])},onAppearCancelled(N){O(N,!0,void 0,!0),_n(T,[N])},onLeaveCancelled(N){x(N),_n(F,[N])}})}function kd(e){if(e==null)return null;if(ve(e))return[li(e.enter),li(e.leave)];{const t=li(e);return[t,t]}}function li(e){return $u(e)}function Mt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Os]||(e[Os]=new Set)).add(t)}function Cn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Os];n&&(n.delete(t),n.size||(e[Os]=void 0))}function aa(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Md=0;function la(e,t,n,s){const r=e._endId=++Md,i=()=>{r===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:l}=Fd(e,t);if(!o)return s();const u=o+"end";let c=0;const f=()=>{e.removeEventListener(u,h),i()},h=d=>{d.target===e&&++c>=l&&f()};setTimeout(()=>{c(n[m]||"").split(", "),r=s(`${en}Delay`),i=s(`${en}Duration`),o=ca(r,i),a=s(`${us}Delay`),l=s(`${us}Duration`),u=ca(a,l);let c=null,f=0,h=0;t===en?o>0&&(c=en,f=o,h=i.length):t===us?u>0&&(c=us,f=u,h=l.length):(f=Math.max(o,u),c=f>0?o>u?en:us:null,h=c?c===en?i.length:l.length:0);const d=c===en&&/\b(?:transform|all)(?:,|$)/.test(s(`${en}Property`).toString());return{type:c,timeout:f,propCount:h,hasTransform:d}}function ca(e,t){for(;e.lengthua(n)+ua(e[s])))}function ua(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function fa(e){return(e?e.ownerDocument:document).body.offsetHeight}function Bd(e,t,n){const s=e[Os];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const _r=Symbol("_vod"),Ac=Symbol("_vsh"),Dd={name:"show",beforeMount(e,{value:t},{transition:n}){e[_r]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):fs(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),fs(e,!0),s.enter(e)):s.leave(e,()=>{fs(e,!1)}):fs(e,t))},beforeUnmount(e,{value:t}){fs(e,t)}};function fs(e,t){e.style.display=t?e[_r]:"none",e[Ac]=!t}const qd=Symbol(""),jd=/(?:^|;)\s*display\s*:/;function Qd(e,t,n){const s=e.style,r=Ee(n);let i=!1;if(n&&!r){if(t)if(Ee(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&cr(s,a,"")}else for(const o in t)n[o]==null&&cr(s,o,"");for(const o in n)o==="display"&&(i=!0),cr(s,o,n[o])}else if(r){if(t!==n){const o=s[qd];o&&(n+=";"+o),s.cssText=n,i=jd.test(n)}}else t&&e.removeAttribute("style");_r in e&&(e[_r]=i?s.display:"",e[Ac]&&(s.display="none"))}const da=/\s*!important$/;function cr(e,t,n){if(ee(n))n.forEach(s=>cr(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Vd(e,t);da.test(n)?e.setProperty(Mn(s),n.replace(da,""),"important"):e[s]=n}}const ha=["Webkit","Moz","ms"],ci={};function Vd(e,t){const n=ci[t];if(n)return n;let s=ut(t);if(s!=="filter"&&s in e)return ci[t]=s;s=Dr(s);for(let r=0;rui||(Hd.then(()=>ui=0),ui=Date.now());function Gd(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;vt(Jd(s,n.value),t,5,[s])};return n.value=e,n.attached=Wd(),n}function Jd(e,t){if(ee(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const va=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Xd=(e,t,n,s,r,i)=>{const o=r==="svg";t==="class"?Bd(e,s,o):t==="style"?Qd(e,n,s):Mr(t)?to(t)||Kd(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Yd(e,t,s,o))?(ga(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ma(e,t,s,o,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Ee(s))?ga(e,ut(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),ma(e,t,s,o))};function Yd(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&va(t)&&le(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return va(t)&&Ee(n)?!1:t in e}const es=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ee(t)?n=>ir(t,n):t};function Zd(e){e.target.composing=!0}function wa(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Kt=Symbol("_assign");function xa(e,t,n){return t&&(e=e.trim()),n&&(e=qr(e)),e}const En={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[Kt]=es(r);const i=s||r.props&&r.props.type==="number";fn(e,t?"change":"input",o=>{o.target.composing||e[Kt](xa(e.value,n,i))}),(n||i)&&fn(e,"change",()=>{e.value=xa(e.value,n,i)}),t||(fn(e,"compositionstart",Zd),fn(e,"compositionend",wa),fn(e,"change",wa))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[Kt]=es(o),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?qr(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===l)||(e.value=l))}},eh={deep:!0,created(e,t,n){e[Kt]=es(n),fn(e,"change",()=>{const s=e._modelValue,r=Ls(e),i=e.checked,o=e[Kt];if(ee(s)){const a=so(s,r),l=a!==-1;if(i&&!l)o(s.concat(r));else if(!i&&l){const u=[...s];u.splice(a,1),o(u)}}else if(rs(s)){const a=new Set(s);i?a.add(r):a.delete(r),o(a)}else o(Ic(e,i))})},mounted:Sa,beforeUpdate(e,t,n){e[Kt]=es(n),Sa(e,t,n)}};function Sa(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(ee(t))r=so(t,s.props.value)>-1;else if(rs(t))r=t.has(s.props.value);else{if(t===n)return;r=Fs(t,Ic(e,!0))}e.checked!==r&&(e.checked=r)}const _a={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=rs(t);fn(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?qr(Ls(o)):Ls(o));e[Kt](e.multiple?r?new Set(i):i:i[0]),e._assigning=!0,wn(()=>{e._assigning=!1})}),e[Kt]=es(s)},mounted(e,{value:t}){Ca(e,t)},beforeUpdate(e,t,n){e[Kt]=es(n)},updated(e,{value:t}){e._assigning||Ca(e,t)}};function Ca(e,t){const n=e.multiple,s=ee(t);if(!(n&&!s&&!rs(t))){for(let r=0,i=e.options.length;rString(u)===String(a)):o.selected=so(t,a)>-1}else o.selected=t.has(a);else if(Fs(Ls(o),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ls(e){return"_value"in e?e._value:e.value}function Ic(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const th=["ctrl","shift","alt","meta"],nh={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)=>th.some(n=>e[`${n}Key`]&&!t.includes(n))},ur=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((r,...i)=>{for(let o=0;o{const t=rh().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=ah(s);if(!r)return;const i=t._component;!le(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,oh(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function oh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ah(e){return Ee(e)?document.querySelector(e):e}let Oc;const Gr=e=>Oc=e,Lc=Symbol();function ki(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var _s;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(_s||(_s={}));function lh(){const e=Cl(!0),t=e.run(()=>ae({}));let n=[],s=[];const r=uo({install(i){Gr(r),r._a=i,i.provide(Lc,r),i.config.globalProperties.$pinia=r,s.forEach(o=>n.push(o)),s=[]},use(i){return this._a?n.push(i):s.push(i),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}const Pc=()=>{};function Ea(e,t,n,s=Pc){e.add(t);const r=()=>{e.delete(t)&&s()};return!n&&ro()&&Qu(r),r}function qn(e,...t){e.forEach(n=>{n(...t)})}const ch=e=>e(),Ra=Symbol(),fi=Symbol();function Mi(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],r=e[n];ki(r)&&ki(s)&&e.hasOwnProperty(n)&&!Te(s)&&!zt(s)?e[n]=Mi(r,s):e[n]=s}return e}const uh=Symbol();function fh(e){return!ki(e)||!Object.prototype.hasOwnProperty.call(e,uh)}const{assign:sn}=Object;function dh(e){return!!(Te(e)&&e.effect)}function hh(e,t,n,s){const{state:r,actions:i,getters:o}=t,a=n.state.value[e];let l;function u(){a||(n.state.value[e]=r?r():{});const c=hf(n.state.value[e]);return sn(c,i,Object.keys(o||{}).reduce((f,h)=>(f[h]=uo(se(()=>{Gr(n);const d=n._s.get(e);return o[h].call(d,d)})),f),{}))}return l=$c(e,u,t,n,s,!0),l}function $c(e,t,n={},s,r,i){let o;const a=sn({actions:{}},n),l={deep:!0};let u,c,f=new Set,h=new Set,d;const m=s.state.value[e];!i&&!m&&(s.state.value[e]={});let b;function E(T){let O;u=c=!1,typeof T=="function"?(T(s.state.value[e]),O={type:_s.patchFunction,storeId:e,events:d}):(Mi(s.state.value[e],T),O={type:_s.patchObject,payload:T,storeId:e,events:d});const x=b=Symbol();wn().then(()=>{b===x&&(u=!0)}),c=!0,qn(f,O,s.state.value[e])}const C=i?function(){const{state:O}=n,x=O?O():{};this.$patch($=>{sn($,x)})}:Pc;function A(){o.stop(),f.clear(),h.clear(),s._s.delete(e)}const I=(T,O="")=>{if(Ra in T)return T[fi]=O,T;const x=function(){Gr(s);const $=Array.from(arguments),N=new Set,V=new Set;function z(ce){N.add(ce)}function fe(ce){V.add(ce)}qn(h,{args:$,name:x[fi],store:F,after:z,onError:fe});let re;try{re=T.apply(this&&this.$id===e?this:F,$)}catch(ce){throw qn(V,ce),ce}return re instanceof Promise?re.then(ce=>(qn(N,ce),ce)).catch(ce=>(qn(V,ce),Promise.reject(ce))):(qn(N,re),re)};return x[Ra]=!0,x[fi]=O,x},S={_p:s,$id:e,$onAction:Ea.bind(null,h),$patch:E,$reset:C,$subscribe(T,O={}){const x=Ea(f,T,O.detached,()=>$()),$=o.run(()=>gt(()=>s.state.value[e],N=>{(O.flush==="sync"?c:u)&&T({storeId:e,type:_s.direct,events:d},N)},sn({},l,O)));return x},$dispose:A},F=is(S);s._s.set(e,F);const _=(s._a&&s._a.runWithContext||ch)(()=>s._e.run(()=>(o=Cl()).run(()=>t({action:I}))));for(const T in _){const O=_[T];if(Te(O)&&!dh(O)||zt(O))i||(m&&fh(O)&&(Te(O)?O.value=m[T]:Mi(O,m[T])),s.state.value[e][T]=O);else if(typeof O=="function"){const x=I(O,T);_[T]=x,a.actions[T]=O}}return sn(F,_),sn(me(F),_),Object.defineProperty(F,"$state",{get:()=>s.state.value[e],set:T=>{E(O=>{sn(O,T)})}}),s._p.forEach(T=>{sn(F,o.run(()=>T({store:F,app:s._a,pinia:s,options:a})))}),m&&i&&n.hydrate&&n.hydrate(F.$state,m),u=!0,c=!0,F}function ph(e,t,n){let s;const r=typeof t=="function";s=r?n:t;function i(o,a){const l=ho();return o=o||(l?mt(Lc,null):null),o&&Gr(o),o=Oc,o._s.has(e)||(r?$c(e,t,s,o):hh(e,s,o)),o._s.get(e)}return i.$id=e,i}let Fi=1;var mh=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{const{message:t,...n}=e,s=typeof e.id=="number"||e.id&&e.id?.length>0?e.id:Fi++,r=this.toasts.find(o=>o.id===s),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),r?this.toasts=this.toasts.map(o=>o.id===s?(this.publish({...o,...e,id:s,title:t}),{...o,...e,id:s,dismissible:i,title:t}):o):this.addToast({title:t,...n,dismissible:i,id:s}),s};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:"default"});error=(e,t)=>this.create({...t,type:"error",message:e});success=(e,t)=>this.create({...t,type:"success",message:e});info=(e,t)=>this.create({...t,type:"info",message:e});warning=(e,t)=>this.create({...t,type:"warning",message:e});loading=(e,t)=>this.create({...t,type:"loading",message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let r=n!==void 0,i;const o=s.then(async l=>{if(i=["resolve",l],It(l))r=!1,this.create({id:n,type:"default",message:l});else if(yh(l)&&!l.ok){r=!1;const c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description,d=typeof c=="object"&&!It(c)?c:{message:c||"",id:n||""};this.create({id:n,type:"error",description:f,...d})}else if(l instanceof Error){r=!1;const c=typeof t.error=="function"?await t.error(l):t.error,f=typeof t.description=="function"?await t.description(l):t.description,d=typeof c=="object"&&!It(c)?c:{message:c||"",id:n||""};this.create({id:n,type:"error",description:f,...d})}else if(t.success!==void 0){r=!1;const c=typeof t.success=="function"?await t.success(l):t.success,f=typeof t.description=="function"?await t.description(l):t.description,d=typeof c=="object"&&!It(c)?c:{message:c||"",id:n||""};this.create({id:n,type:"success",description:f,...d})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){r=!1;const u=typeof t.error=="function"?await t.error(l):t.error,c=typeof t.description=="function"?await t.description(l):t.description,h=typeof u=="object"&&!It(u)?u:{message:u||"",id:n||""};this.create({id:n,type:"error",description:c,...h})}}).finally(()=>{r&&(this.dismiss(n),n=void 0),t.finally?.()}),a=()=>new Promise((l,u)=>o.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})};custom=(e,t)=>{const n=t?.id||Fi++,s=this.toasts.find(i=>i.id===n),r=t?.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),s?this.toasts=this.toasts.map(i=>i.id===n?(this.publish({...i,component:e,dismissible:r,id:n,...t}),{...i,component:e,dismissible:r,id:n,...t}):i):this.addToast({component:e,dismissible:r,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};const Xe=new mh;function gh(e,t){const n=t?.id||Fi++;return Xe.create({message:e,id:n,type:"default",...t}),n}const yh=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",bh=gh,vh=()=>Xe.toasts,wh=()=>Xe.getActiveToasts(),ps=Object.assign(bh,{success:Xe.success,info:Xe.info,warning:Xe.warning,error:Xe.error,custom:Xe.custom,message:Xe.message,promise:Xe.promise,dismiss:Xe.dismiss,loading:Xe.loading},{getHistory:vh,getToasts:wh});function Xs(e){return e.label!==void 0}const xh=3,kc="24px",Mc="16px",Na=4e3,Sh=356,_h=14,Ch=45,Fc=200;function Th(){const e=ae(!1);return Nt(()=>{const t=()=>{e.value=document.hidden};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)}),{isDocumentHidden:e}}function tn(...e){return e.filter(Boolean).join(" ")}function Eh(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}function Rh(e,t){const n={};return[e,t].forEach((s,r)=>{const i=r===1,o=i?"--mobile-offset":"--offset",a=i?Mc:kc;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof s=="number"||typeof s=="string"?l(s):typeof s=="object"?["top","right","bottom","left"].forEach(u=>{s[u]===void 0?n[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof s[u]=="number"?`${s[u]}px`:s[u]}):l(a)}),n}const Nh=["data-rich-colors","data-styled","data-mounted","data-promise","data-swiped","data-removed","data-visible","data-y-position","data-x-position","data-index","data-front","data-swiping","data-dismissible","data-type","data-invert","data-swipe-out","data-swipe-direction","data-expanded","data-testid"],Ah=["aria-label","data-disabled","data-close-button-position"];var Ih=et({__name:"Toast",props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:["update:heights","update:height","removeToast"],setup(e,{emit:t}){const n=e,s=t,r=ae(null),i=ae(null),o=ae(!1),a=ae(!1),l=ae(!1),u=ae(!1),c=ae(!1),f=ae(0),h=ae(0),d=ae(n.toast.duration||n.duration||Na),m=ae(null),b=ae(null),E=se(()=>n.index===0),C=se(()=>n.index+1<=n.visibleToasts),A=se(()=>n.toast.type),I=se(()=>n.toast.dismissible!==!1),S=se(()=>n.toast.class||""),F=se(()=>n.descriptionClass||""),j=se(()=>{const g=n.toast.position||n.position,B=n.heights.filter(W=>W.position===g).findIndex(W=>W.toastId===n.toast.id);return B>=0?B:0}),_=se(()=>{const g=n.toast.position||n.position;return n.heights.filter(B=>B.position===g).reduce((B,W,oe)=>oe>=j.value?B:B+W.height,0)}),T=se(()=>j.value*n.gap+_.value||0),O=se(()=>n.toast.closeButton??n.closeButton),x=se(()=>n.toast.duration||n.duration||Na),$=ae(0),N=ae(0),V=ae(null),z=se(()=>n.position.split("-")),fe=se(()=>z.value[0]),re=se(()=>z.value[1]),ce=se(()=>typeof n.toast.title!="string"),de=se(()=>typeof n.toast.description!="string"),{isDocumentHidden:at}=Th(),lt=se(()=>A.value&&A.value==="loading");Pt(()=>{o.value=!0,d.value=x.value}),Nt(async()=>{if(!o.value||!b.value)return;await wn();const g=b.value,Q=g.style.height;g.style.height="auto";const B=g.getBoundingClientRect().height;g.style.height=Q,h.value=B,s("update:height",{toastId:n.toast.id,height:B,position:n.toast.position||n.position})});function $e(){a.value=!0,f.value=T.value,setTimeout(()=>{s("removeToast",n.toast)},Fc)}function ke(){if(lt.value||!I.value)return{};$e(),n.toast.onDismiss?.(n.toast)}function Xt(g){g.button!==2&&(lt.value||!I.value||(m.value=new Date,f.value=T.value,g.target.setPointerCapture(g.pointerId),g.target.tagName!=="BUTTON"&&(l.value=!0,V.value={x:g.clientX,y:g.clientY})))}function Yt(){if(u.value||!I.value)return;V.value=null;const g=Number(b.value?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),Q=Number(b.value?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),B=new Date().getTime()-(m.value?.getTime()||0),W=r.value==="x"?g:Q,oe=Math.abs(W)/B;if(Math.abs(W)>=Ch||oe>.11){f.value=T.value,n.toast.onDismiss?.(n.toast),r.value==="x"?i.value=g>0?"right":"left":i.value=Q>0?"down":"up",$e(),u.value=!0;return}else b.value?.style.setProperty("--swipe-amount-x","0px"),b.value?.style.setProperty("--swipe-amount-y","0px");c.value=!1,l.value=!1,r.value=null}function $t(g){if(!V.value||!I.value||(window?.getSelection()?.toString()?.length??!1))return;const B=g.clientY-V.value.y,W=g.clientX-V.value.x,oe=n.swipeDirections??Eh(n.position);!r.value&&(Math.abs(W)>1||Math.abs(B)>1)&&(r.value=Math.abs(W)>Math.abs(B)?"x":"y");let p={x:0,y:0};const y=w=>1/(1.5+Math.abs(w)/20);if(r.value==="y"){if(oe.includes("top")||oe.includes("bottom"))if(oe.includes("top")&&B<0||oe.includes("bottom")&&B>0)p.y=B;else{const w=B*y(B);p.y=Math.abs(w)0)p.x=W;else{const w=W*y(W);p.x=Math.abs(w)0||Math.abs(p.y)>0)&&(c.value=!0),b.value?.style.setProperty("--swipe-amount-x",`${p.x}px`),b.value?.style.setProperty("--swipe-amount-y",`${p.y}px`)}Pt(()=>{if(o.value=!0,!b.value)return;const g=b.value.getBoundingClientRect().height;h.value=g;const Q=[{toastId:n.toast.id,height:g,position:n.toast.position},...n.heights];s("update:heights",Q)}),go(()=>{b.value&&s("removeToast",n.toast)}),Nt(g=>{if(n.toast.promise&&A.value==="loading"||n.toast.duration===1/0||n.toast.type==="loading")return;let Q;const B=()=>{if(N.value<$.value){const oe=new Date().getTime()-$.value;d.value=d.value-oe}N.value=new Date().getTime()},W=()=>{d.value!==1/0&&($.value=new Date().getTime(),Q=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),$e()},d.value))};n.expanded||n.interacting||at.value?B():W(),g(()=>{clearTimeout(Q)})}),gt(()=>n.toast.delete,g=>{g!==void 0&&g&&($e(),n.toast.onDismiss?.(n.toast))},{deep:!0});function We(){l.value=!1,r.value=null,V.value=null}return(g,Q)=>(Y(),ne("li",{tabindex:"0",ref_key:"toastRef",ref:b,class:Oe(H(tn)(n.class,S.value,g.classes?.toast,g.toast.classes?.toast,g.classes?.[A.value],g.toast?.classes?.[A.value])),"data-sonner-toast":"","data-rich-colors":g.toast.richColors??g.defaultRichColors,"data-styled":!(g.toast.component||g.toast?.unstyled||g.unstyled),"data-mounted":o.value,"data-promise":!!g.toast.promise,"data-swiped":c.value,"data-removed":a.value,"data-visible":C.value,"data-y-position":fe.value,"data-x-position":re.value,"data-index":g.index,"data-front":E.value,"data-swiping":l.value,"data-dismissible":I.value,"data-type":A.value,"data-invert":g.toast.invert||g.invert,"data-swipe-out":u.value,"data-swipe-direction":i.value,"data-expanded":!!(g.expanded||g.expandByDefault&&o.value),"data-testid":g.toast.testId,style:gn({"--index":g.index,"--toasts-before":g.index,"--z-index":g.toasts.length-g.index,"--offset":`${a.value?f.value:T.value}px`,"--initial-height":g.expandByDefault?"auto":`${h.value}px`,...g.style,...n.toast.style}),onDragend:We,onPointerdown:Xt,onPointerup:Yt,onPointermove:$t},[O.value&&!g.toast.component&&A.value!=="loading"?(Y(),ne("button",{key:0,"aria-label":g.closeButtonAriaLabel||"Close toast","data-disabled":lt.value,"data-close-button":"true","data-close-button-position":g.closeButtonPosition,class:Oe(H(tn)(g.classes?.closeButton,g.toast?.classes?.closeButton)),onClick:ke},[g.icons?.close?(Y(),Vt(cs(g.icons?.close),{key:0})):st(g.$slots,"close-icon",{key:1})],10,Ah)):Pe("v-if",!0),g.toast.component?(Y(),Vt(cs(g.toast.component),Ss({key:1},g.toast.componentProps,{onCloseToast:ke,isPaused:g.$props.expanded||g.$props.interacting||H(at)}),null,16,["isPaused"])):(Y(),ne(Ce,{key:2},[A.value!=="default"||g.toast.icon||g.toast.promise?(Y(),ne("div",{key:0,"data-icon":"",class:Oe(H(tn)(g.classes?.icon,g.toast?.classes?.icon))},[g.toast.icon?(Y(),Vt(cs(g.toast.icon),{key:0})):(Y(),ne(Ce,{key:1},[A.value==="loading"?st(g.$slots,"loading-icon",{key:0}):A.value==="success"?st(g.$slots,"success-icon",{key:1}):A.value==="error"?st(g.$slots,"error-icon",{key:2}):A.value==="warning"?st(g.$slots,"warning-icon",{key:3}):A.value==="info"?st(g.$slots,"info-icon",{key:4}):Pe("v-if",!0)],64))],2)):Pe("v-if",!0),R("div",{"data-content":"",class:Oe(H(tn)(g.classes?.content,g.toast?.classes?.content))},[R("div",{"data-title":"",class:Oe(H(tn)(g.classes?.title,g.toast.classes?.title))},[ce.value?(Y(),Vt(cs(g.toast.title),qo(Ss({key:0},g.toast.componentProps)),null,16)):(Y(),ne(Ce,{key:1},[rt(we(g.toast.title),1)],64))],2),g.toast.description?(Y(),ne("div",{key:0,"data-description":"",class:Oe(H(tn)(g.descriptionClass,F.value,g.classes?.description,g.toast.classes?.description))},[de.value?(Y(),Vt(cs(g.toast.description),qo(Ss({key:0},g.toast.componentProps)),null,16)):(Y(),ne(Ce,{key:1},[rt(we(g.toast.description),1)],64))],2)):Pe("v-if",!0)],2),g.toast.cancel?(Y(),ne("button",{key:1,style:gn(g.toast.cancelButtonStyle||g.cancelButtonStyle),class:Oe(H(tn)(g.classes?.cancelButton,g.toast.classes?.cancelButton)),"data-button":"","data-cancel":"",onClick:Q[0]||(Q[0]=B=>{H(Xs)(g.toast.cancel)&&I.value&&(g.toast.cancel.onClick?.(B),$e())})},we(H(Xs)(g.toast.cancel)?g.toast.cancel?.label:g.toast.cancel),7)):Pe("v-if",!0),g.toast.action?(Y(),ne("button",{key:2,style:gn(g.toast.actionButtonStyle||g.actionButtonStyle),class:Oe(H(tn)(g.classes?.actionButton,g.toast.classes?.actionButton)),"data-button":"","data-action":"",onClick:Q[1]||(Q[1]=B=>{H(Xs)(g.toast.action)&&(g.toast.action.onClick?.(B),!B.defaultPrevented&&$e())})},we(H(Xs)(g.toast.action)?g.toast.action?.label:g.toast.action),7)):Pe("v-if",!0)],64))],46,Nh))}}),Oh=Ih,Vs=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n};const Lh={},Ph={xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stoke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function $h(e,t){return Y(),ne("svg",Ph,t[0]||(t[0]=[R("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),R("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)]))}var kh=Vs(Lh,[["render",$h]]);const Mh=["data-visible"],Fh={class:"sonner-spinner"};var Bh=et({__name:"Loader",props:{visible:{type:Boolean}},setup(e){const t=Array(12).fill(0);return(n,s)=>(Y(),ne("div",{class:"sonner-loading-wrapper","data-visible":n.visible},[R("div",Fh,[(Y(!0),ne(Ce,null,Yn(H(t),r=>(Y(),ne("div",{key:`spinner-bar-${r}`,class:"sonner-loading-bar"}))),128))])],8,Mh))}}),Dh=Bh;const qh={},jh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function Qh(e,t){return Y(),ne("svg",jh,t[0]||(t[0]=[R("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)]))}var Vh=Vs(qh,[["render",Qh]]);const zh={},Kh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function Uh(e,t){return Y(),ne("svg",Kh,t[0]||(t[0]=[R("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)]))}var Hh=Vs(zh,[["render",Uh]]);const Wh={},Gh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"};function Jh(e,t){return Y(),ne("svg",Gh,t[0]||(t[0]=[R("path",{"fill-rule":"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z","clip-rule":"evenodd"},null,-1)]))}var Xh=Vs(Wh,[["render",Jh]]);const Yh={},Zh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function ep(e,t){return Y(),ne("svg",Zh,t[0]||(t[0]=[R("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)]))}var tp=Vs(Yh,[["render",ep]]);const np=["aria-label"],sp=["data-sonner-theme","dir","data-theme","data-rich-colors","data-y-position","data-x-position"],rp=typeof window<"u"&&typeof document<"u";function ip(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var op=et({name:"Toaster",inheritAttrs:!1,__name:"Toaster",props:{id:{},invert:{type:Boolean,default:!1},theme:{default:"light"},position:{default:"bottom-right"},closeButtonPosition:{default:"top-left"},hotkey:{default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:_h},visibleToasts:{default:xh},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:""},style:{},offset:{default:kc},mobileOffset:{default:Mc},dir:{default:"auto"},swipeDirections:{},icons:{},containerAriaLabel:{default:"Notifications"}},setup(e){const t=e,n=Vf(),s=ae([]),r=se(()=>t.id?s.value.filter(x=>x.toasterId===t.id):s.value.filter(x=>!x.toasterId));function i(x,$){return r.value.filter(N=>!N.position&&$===0||N.position===x)}const o=se(()=>{const x=r.value.filter($=>$.position).map($=>$.position);return x.length>0?Array.from(new Set([t.position].concat(x))):[t.position]}),a=se(()=>{const x={};return o.value.forEach($=>{x[$]=s.value.filter(N=>N.position===$)}),x}),l=ae([]),u=ae({}),c=ae(!1);Nt(()=>{o.value.forEach(x=>{x in u.value||(u.value[x]=!1)})});const f=ae(t.theme!=="system"?t.theme:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),h=ae(null),d=ae(null),m=ae(!1),b=t.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,"");function E(x){s.value.find($=>$.id===x.id)?.delete||Xe.dismiss(x.id),s.value=s.value.filter(({id:$})=>$!==x.id),setTimeout(()=>{s.value.find($=>$.id===x.id)||(l.value=l.value.filter($=>$.toastId!==x.id))},Fc+50)}function C(x){m.value&&!x.currentTarget?.contains?.(x.relatedTarget)&&(m.value=!1,d.value&&(d.value.focus({preventScroll:!0}),d.value=null))}function A(x){x.target instanceof HTMLElement&&x.target.dataset.dismissible==="false"||m.value||(m.value=!0,d.value=x.relatedTarget)}function I(x){x.target&&x.target instanceof HTMLElement&&x.target.dataset.dismissible==="false"||(c.value=!0)}Nt(x=>{const $=Xe.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{s.value=s.value.map(V=>V.id===N.id?{...V,delete:!0}:V)});return}wn(()=>{const V=s.value.findIndex(z=>z.id===N.id);V!==-1?s.value=[...s.value.slice(0,V),{...s.value[V],...N},...s.value.slice(V+1)]:s.value=[N,...s.value]})});x($)}),Nt(x=>{if(typeof window>"u")return;if(t.theme!=="system"){f.value=t.theme;return}const $=window.matchMedia("(prefers-color-scheme: dark)"),N=z=>{f.value=z?"dark":"light"};N($.matches);const V=z=>{N(z.matches)};try{$.addEventListener("change",V)}catch{$.addListener(V)}x(()=>{try{$.removeEventListener("change",V)}catch{$.removeListener(V)}})}),Nt(()=>{h.value&&d.value&&(d.value.focus({preventScroll:!0}),d.value=null,m.value=!1)}),Nt(()=>{s.value.length<=1&&Object.keys(u.value).forEach(x=>{u.value[x]=!1})}),Nt(x=>{function $(N){const V=t.hotkey.every(re=>N[re]||N.code===re),z=Array.isArray(h.value)?h.value[0]:h.value;V&&(o.value.forEach(re=>{u.value[re]=!0}),z?.focus());const fe=document.activeElement===h.value||z?.contains(document.activeElement);N.code==="Escape"&&fe&&o.value.forEach(re=>{u.value[re]=!1})}rp&&(document.addEventListener("keydown",$),x(()=>{document.removeEventListener("keydown",$)}))});function S(x){const $=x.currentTarget,N=$.getAttribute("data-y-position")+"-"+$.getAttribute("data-x-position");u.value[N]=!0}function F(x){if(!c.value){const $=x.currentTarget,N=$.getAttribute("data-y-position")+"-"+$.getAttribute("data-x-position");u.value[N]=!1}}function j(){Object.keys(u.value).forEach(x=>{u.value[x]=!1})}function _(){c.value=!1}function T(x){l.value=x}function O(x){const $=l.value.findIndex(N=>N.toastId===x.toastId);if($!==-1)l.value[$]=x;else{const N=l.value.findIndex(V=>V.position===x.position);N!==-1?l.value.splice(N,0,x):l.value.unshift(x)}}return(x,$)=>(Y(),ne(Ce,null,[Pe(" Remove item from normal navigation flow, only available via hotkey "),R("section",{"aria-label":`${x.containerAriaLabel} ${H(b)}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},[(Y(!0),ne(Ce,null,Yn(o.value,(N,V)=>(Y(),ne("ol",Ss({key:N,ref_for:!0,ref_key:"listRef",ref:h,"data-sonner-toaster":"","data-sonner-theme":f.value,class:t.class,dir:x.dir==="auto"?ip():x.dir,tabIndex:-1,"data-theme":x.theme,"data-rich-colors":x.richColors,"data-y-position":N.split("-")[0],"data-x-position":N.split("-")[1],style:{"--front-toast-height":`${l.value[0]?.height||0}px`,"--width":`${H(Sh)}px`,"--gap":`${x.gap}px`,...x.style,...H(n).style,...H(Rh)(x.offset,x.mobileOffset)}},{ref_for:!0},x.$attrs,{onBlur:C,onFocus:A,onMouseenter:S,onMousemove:S,onMouseleave:F,onDragend:j,onPointerdown:I,onPointerup:_}),[(Y(!0),ne(Ce,null,Yn(i(N,V),(z,fe)=>(Y(),Vt(Oh,{key:z.id,heights:l.value,icons:x.icons,index:fe,toast:z,defaultRichColors:x.richColors,duration:x.toastOptions?.duration??x.duration,class:Oe(x.toastOptions?.class??""),descriptionClass:x.toastOptions?.descriptionClass,invert:x.invert,visibleToasts:x.visibleToasts,closeButton:x.toastOptions?.closeButton??x.closeButton,interacting:c.value,position:N,closeButtonPosition:x.toastOptions?.closeButtonPosition??x.closeButtonPosition,style:gn(x.toastOptions?.style),unstyled:x.toastOptions?.unstyled,classes:x.toastOptions?.classes,cancelButtonStyle:x.toastOptions?.cancelButtonStyle,actionButtonStyle:x.toastOptions?.actionButtonStyle,"close-button-aria-label":x.toastOptions?.closeButtonAriaLabel,toasts:a.value[N],expandByDefault:x.expand,gap:x.gap,expanded:u.value[N]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":T,"onUpdate:height":O,onRemoveToast:E},{"close-icon":dt(()=>[st(x.$slots,"close-icon",{},()=>[pe(kh)])]),"loading-icon":dt(()=>[st(x.$slots,"loading-icon",{},()=>[pe(Dh,{visible:z.type==="loading"},null,8,["visible"])])]),"success-icon":dt(()=>[st(x.$slots,"success-icon",{},()=>[pe(Vh)])]),"error-icon":dt(()=>[st(x.$slots,"error-icon",{},()=>[pe(tp)])]),"warning-icon":dt(()=>[st(x.$slots,"warning-icon",{},()=>[pe(Xh)])]),"info-icon":dt(()=>[st(x.$slots,"info-icon",{},()=>[pe(Hh)])]),_:2},1032,["heights","icons","index","toast","defaultRichColors","duration","class","descriptionClass","invert","visibleToasts","closeButton","interacting","position","closeButtonPosition","style","unstyled","classes","cancelButtonStyle","actionButtonStyle","close-button-aria-label","toasts","expandByDefault","gap","expanded","swipeDirections"]))),128))],16,sp))),128))],8,np)],2112))}}),ap=op;const di=new WeakMap,lp=(...e)=>{var t;const n=e[0],s=(t=Fn())===null||t===void 0?void 0:t.proxy,r=s??ro();if(r==null&&!ho())throw new Error("injectLocal must be called in setup");return r&&di.has(r)&&n in di.get(r)?di.get(r)[n]:mt(...e)},cp=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const up=Object.prototype.toString,fp=e=>up.call(e)==="[object Object]",dp=()=>{};function Bc(...e){if(e.length!==1)return gf(...e);const t=e[0];return typeof t=="function"?Rs(df(()=>({get:t,set:dp}))):ae(t)}function hp(e,t){function n(...s){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(r).catch(i)})}return n}const Dc=e=>e();function pp(e=Dc,t={}){const{initialState:n="active"}=t,s=Bc(n==="active");function r(){s.value=!1}function i(){s.value=!0}return{isActive:Rs(s),pause:r,resume:i,eventFilter:(...a)=>{s.value&&e(...a)}}}function Aa(e){return e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e)}function hi(e){return Array.isArray(e)?e:[e]}function mp(e){return Fn()}function gp(e,t,n={}){const{eventFilter:s=Dc,...r}=n;return gt(e,hp(s,t),r)}function yp(e,t,n={}){const{eventFilter:s,initialState:r="active",...i}=n,{eventFilter:o,pause:a,resume:l,isActive:u}=pp(s,{initialState:r});return{stop:gp(e,t,{...i,eventFilter:o}),pause:a,resume:l,isActive:u}}const bp=yp;function qc(e,t=!0,n){mp()?Pt(e,n):t?e():wn(e)}function vp(e=!1,t={}){const{truthyValue:n=!0,falsyValue:s=!1}=t,r=Te(e),i=Ln(e);function o(a){if(arguments.length)return i.value=a,i.value;{const l=Lt(n);return i.value=i.value===l?Lt(s):l,i.value}}return r?o:[i,o]}function wp(e,t,n){return gt(e,t,{...n,immediate:!0})}const dn=cp?window:void 0;function jc(e){var t;const n=Lt(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function Bi(...e){const t=(s,r,i,o)=>(s.addEventListener(r,i,o),()=>s.removeEventListener(r,i,o)),n=se(()=>{const s=hi(Lt(e[0])).filter(r=>r!=null);return s.every(r=>typeof r!="string")?s:void 0});return wp(()=>{var s,r;return[(s=(r=n.value)===null||r===void 0?void 0:r.map(i=>jc(i)))!==null&&s!==void 0?s:[dn].filter(i=>i!=null),hi(Lt(n.value?e[1]:e[0])),hi(H(n.value?e[2]:e[1])),Lt(n.value?e[3]:e[2])]},([s,r,i,o],a,l)=>{if(!s?.length||!r?.length||!i?.length)return;const u=fp(o)?{...o}:o,c=s.flatMap(f=>r.flatMap(h=>i.map(d=>t(f,h,d,u))));l(()=>{c.forEach(f=>f())})},{flush:"post"})}function xp(){const e=Ln(!1),t=Fn();return t&&Pt(()=>{e.value=!0},t),e}function Sp(e){const t=xp();return se(()=>(t.value,!!e()))}const _p=Symbol("vueuse-ssr-width");function Cp(){const e=ho()?lp(_p,null):null;return typeof e=="number"?e:void 0}function Tp(e,t={}){const{window:n=dn,ssrWidth:s=Cp()}=t,r=Sp(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),i=Ln(typeof s=="number"),o=Ln(),a=Ln(!1),l=u=>{a.value=u.matches};return Nt(()=>{if(i.value){i.value=!r.value,a.value=Lt(e).split(",").some(u=>{const c=u.includes("not all"),f=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let d=!!(f||h);return f&&d&&(d=s>=Aa(f[1])),h&&d&&(d=s<=Aa(h[1])),c?!d:d});return}r.value&&(o.value=n.matchMedia(Lt(e)),a.value=o.value.matches)}),Bi(o,"change",l,{passive:!0}),se(()=>a.value)}const Ys=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Zs="__vueuse_ssr_handlers__",Ep=Rp();function Rp(){return Zs in Ys||(Ys[Zs]=Ys[Zs]||{}),Ys[Zs]}function Qc(e,t){return Ep[e]||t}function Np(e){return Tp("(prefers-color-scheme: dark)",e)}function Ap(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Ip={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Ia="vueuse-storage";function Vc(e,t,n,s={}){var r;const{flush:i="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:l=!0,mergeDefaults:u=!1,shallow:c,window:f=dn,eventFilter:h,onError:d=z=>{console.error(z)},initOnMounted:m}=s,b=(c?Ln:ae)(typeof t=="function"?t():t),E=se(()=>Lt(e));if(!n)try{n=Qc("getDefaultStorage",()=>dn?.localStorage)()}catch(z){d(z)}if(!n)return b;const C=Lt(t),A=Ap(C),I=(r=s.serializer)!==null&&r!==void 0?r:Ip[A],{pause:S,resume:F}=bp(b,z=>x(z),{flush:i,deep:o,eventFilter:h});gt(E,()=>N(),{flush:i});let j=!1;const _=z=>{m&&!j||N(z)},T=z=>{m&&!j||V(z)};f&&a&&(n instanceof Storage?Bi(f,"storage",_,{passive:!0}):Bi(f,Ia,T)),m?qc(()=>{j=!0,N()}):N();function O(z,fe){if(f){const re={key:E.value,oldValue:z,newValue:fe,storageArea:n};f.dispatchEvent(n instanceof Storage?new StorageEvent("storage",re):new CustomEvent(Ia,{detail:re}))}}function x(z){try{const fe=n.getItem(E.value);if(z==null)O(fe,null),n.removeItem(E.value);else{const re=I.write(z);fe!==re&&(n.setItem(E.value,re),O(fe,re))}}catch(fe){d(fe)}}function $(z){const fe=z?z.newValue:n.getItem(E.value);if(fe==null)return l&&C!=null&&n.setItem(E.value,I.write(C)),C;if(!z&&u){const re=I.read(fe);return typeof u=="function"?u(re,C):A==="object"&&!Array.isArray(re)?{...C,...re}:re}else return typeof fe!="string"?fe:I.read(fe)}function N(z){if(!(z&&z.storageArea!==n)){if(z&&z.key==null){b.value=C;return}if(!(z&&z.key!==E.value)){S();try{const fe=I.write(b.value);(z===void 0||z?.newValue!==fe)&&(b.value=$(z))}catch(fe){d(fe)}finally{z?wn(F):F()}}}}function V(z){N(z.detail)}return b}const Op="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Lp(e={}){const{selector:t="html",attribute:n="class",initialValue:s="auto",window:r=dn,storage:i,storageKey:o="vueuse-color-scheme",listenToStorageChanges:a=!0,storageRef:l,emitAuto:u,disableTransition:c=!0}=e,f={auto:"",light:"light",dark:"dark",...e.modes||{}},h=Np({window:r}),d=se(()=>h.value?"dark":"light"),m=l||(o==null?Bc(s):Vc(o,s,i,{window:r,listenToStorageChanges:a})),b=se(()=>m.value==="auto"?d.value:m.value),E=Qc("updateHTMLAttrs",(S,F,j)=>{const _=typeof S=="string"?r?.document.querySelector(S):jc(S);if(!_)return;const T=new Set,O=new Set;let x=null;if(F==="class"){const N=j.split(/\s/g);Object.values(f).flatMap(V=>(V||"").split(/\s/g)).filter(Boolean).forEach(V=>{N.includes(V)?T.add(V):O.add(V)})}else x={key:F,value:j};if(T.size===0&&O.size===0&&x===null)return;let $;c&&($=r.document.createElement("style"),$.appendChild(document.createTextNode(Op)),r.document.head.appendChild($));for(const N of T)_.classList.add(N);for(const N of O)_.classList.remove(N);x&&_.setAttribute(x.key,x.value),c&&(r.getComputedStyle($).opacity,document.head.removeChild($))});function C(S){var F;E(t,n,(F=f[S])!==null&&F!==void 0?F:S)}function A(S){e.onChanged?e.onChanged(S,C):C(S)}gt(b,A,{flush:"post",immediate:!0}),qc(()=>A(b.value));const I=se({get(){return u?m.value:b.value},set(S){m.value=S}});return Object.assign(I,{store:m,system:d,state:b})}function zc(e={}){const{valueDark:t="dark",valueLight:n=""}=e,s=Lp({...e,onChanged:(i,o)=>{var a;e.onChanged?(a=e.onChanged)===null||a===void 0||a.call(e,i==="dark",o,i):o(i)},modes:{dark:t,light:n}}),r=se(()=>s.system.value);return se({get(){return s.value==="dark"},set(i){const o=i?"dark":"light";r.value===o?s.value="auto":s.value=o}})}function Di(e,t,n={}){const{window:s=dn}=n;return Vc(e,t,s?.localStorage,n)}const Pp=et({__name:"App",setup(e){const t=zc();return(n,s)=>{vr("router-link");const r=vr("router-view");return Y(),ne("div",{class:Oe(["min-h-screen bg-background",{dark:H(t)}])},[pe(H(ap),{position:"top-center"}),Pe("",!0),pe(r)],2)}}}),$p="modulepreload",kp=function(e){return"/"+e},Oa={},Rt=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let l=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");r=l(n.map(u=>{if(u=kp(u),u in Oa)return;Oa[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="proxy.php?url=https%3A%2F%2Fcontext-replace.ctxinf.com%2F%24%7Bu%7D"]${f}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":$p,c||(h.as="script"),h.crossOrigin="",h.href=u,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((d,m)=>{h.addEventListener("load",d),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};const Qn=typeof document<"u";function Kc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Mp(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Kc(e.default)}const ge=Object.assign;function pi(e,t){const n={};for(const s in t){const r=t[s];n[s]=wt(r)?r.map(e):e(r)}return n}const Cs=()=>{},wt=Array.isArray;function La(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Uc=/#/g,Fp=/&/g,Bp=/\//g,Dp=/=/g,qp=/\?/g,Hc=/\+/g,jp=/%5B/g,Qp=/%5D/g,Wc=/%5E/g,Vp=/%60/g,Gc=/%7B/g,zp=/%7C/g,Jc=/%7D/g,Kp=/%20/g;function So(e){return e==null?"":encodeURI(""+e).replace(zp,"|").replace(jp,"[").replace(Qp,"]")}function Up(e){return So(e).replace(Gc,"{").replace(Jc,"}").replace(Wc,"^")}function qi(e){return So(e).replace(Hc,"%2B").replace(Kp,"+").replace(Uc,"%23").replace(Fp,"%26").replace(Vp,"`").replace(Gc,"{").replace(Jc,"}").replace(Wc,"^")}function Hp(e){return qi(e).replace(Dp,"%3D")}function Wp(e){return So(e).replace(Uc,"%23").replace(qp,"%3F")}function Gp(e){return Wp(e).replace(Bp,"%2F")}function Ps(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Jp=/\/$/,Xp=e=>e.replace(Jp,"");function mi(e,t,n="/"){let s,r={},i="",o="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(s=t.slice(0,l),i=t.slice(l,a>0?a:t.length),r=e(i.slice(1))),a>=0&&(s=s||t.slice(0,a),o=t.slice(a,t.length)),s=tm(s??t,n),{fullPath:s+i+o,path:s,query:r,hash:Ps(o)}}function Yp(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Pa(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Zp(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&ts(t.matched[s],n.matched[r])&&Xc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ts(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Xc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!em(e[n],t[n]))return!1;return!0}function em(e,t){return wt(e)?$a(e,t):wt(t)?$a(t,e):e?.valueOf()===t?.valueOf()}function $a(e,t){return wt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function tm(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let i=n.length-1,o,a;for(o=0;o1&&i--;else break;return n.slice(0,i).join("/")+"/"+s.slice(o).join("/")}const nn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let ji=(function(e){return e.pop="pop",e.push="push",e})({}),gi=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function nm(e){if(!e)if(Qn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Xp(e)}const sm=/^[^#]+#/;function rm(e,t){return e.replace(sm,"#")+t}function im(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Jr=()=>({left:window.scrollX,top:window.scrollY});function om(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=im(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function ka(e,t){return(history.state?history.state.position-t:-1)+e}const Qi=new Map;function am(e,t){Qi.set(e,t)}function lm(e){const t=Qi.get(e);return Qi.delete(e),t}function cm(e){return typeof e=="string"||e&&typeof e=="object"}function Yc(e){return typeof e=="string"||typeof e=="symbol"}let Re=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Zc=Symbol("");Re.MATCHER_NOT_FOUND+"",Re.NAVIGATION_GUARD_REDIRECT+"",Re.NAVIGATION_ABORTED+"",Re.NAVIGATION_CANCELLED+"",Re.NAVIGATION_DUPLICATED+"";function ns(e,t){return ge(new Error,{type:e,[Zc]:!0},t)}function Ft(e,t){return e instanceof Error&&Zc in e&&(t==null||!!(e.type&t))}const um=["params","query","hash"];function fm(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of um)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function dm(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;sr&&qi(r)):[s&&qi(s)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function hm(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=wt(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const pm=Symbol(""),Fa=Symbol(""),_o=Symbol(""),eu=Symbol(""),Vi=Symbol("");function ds(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function cn(e,t,n,s,r,i=o=>o()){const o=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((a,l)=>{const u=h=>{h===!1?l(ns(Re.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?l(h):cm(h)?l(ns(Re.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(o&&s.enterCallbacks[r]===o&&typeof h=="function"&&o.push(h),a())},c=i(()=>e.call(s&&s.instances[r],t,n,u));let f=Promise.resolve(c);e.length<3&&(f=f.then(u)),f.catch(h=>l(h))})}function yi(e,t,n,s,r=i=>i()){const i=[];for(const o of e)for(const a in o.components){let l=o.components[a];if(!(t!=="beforeRouteEnter"&&!o.instances[a]))if(Kc(l)){const u=(l.__vccOpts||l)[t];u&&i.push(cn(u,n,s,o,a,r))}else{let u=l();i.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=Mp(c)?c.default:c;o.mods[a]=c,o.components[a]=f;const h=(f.__vccOpts||f)[t];return h&&cn(h,n,s,o,a,r)()}))}}return i}function mm(e,t){const n=[],s=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let o=0;ots(u,a))?s.push(a):n.push(a));const l=e.matched[o];l&&(t.matched.find(u=>ts(u,l))||r.push(l))}return[n,s,r]}let gm=()=>location.protocol+"//"+location.host;function tu(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let o=r.includes(e.slice(i))?e.slice(i).length:1,a=r.slice(o);return a[0]!=="/"&&(a="/"+a),Pa(a,"")}return Pa(n,e)+s+r}function ym(e,t,n,s){let r=[],i=[],o=null;const a=({state:h})=>{const d=tu(e,location),m=n.value,b=t.value;let E=0;if(h){if(n.value=d,t.value=h,o&&o===m){o=null;return}E=b?h.position-b.position:0}else s(d);r.forEach(C=>{C(n.value,m,{delta:E,type:ji.pop,direction:E?E>0?gi.forward:gi.back:gi.unknown})})};function l(){o=n.value}function u(h){r.push(h);const d=()=>{const m=r.indexOf(h);m>-1&&r.splice(m,1)};return i.push(d),d}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(ge({},h.state,{scroll:Jr()}),"")}}function f(){for(const h of i)h();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:f}}function Ba(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Jr():null}}function bm(e){const{history:t,location:n}=window,s={value:tu(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(l,u,c){const f=e.indexOf("#"),h=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:gm()+e+l;try{t[c?"replaceState":"pushState"](u,"",h),r.value=u}catch(d){console.error(d),n[c?"replace":"assign"](h)}}function o(l,u){i(l,ge({},t.state,Ba(r.value.back,l,r.value.forward,!0),u,{position:r.value.position}),!0),s.value=l}function a(l,u){const c=ge({},r.value,t.state,{forward:l,scroll:Jr()});i(c.current,c,!0),i(l,ge({},Ba(s.value,l,null),{position:c.position+1},u),!1),s.value=l}return{location:s,state:r,push:a,replace:o}}function vm(e){e=nm(e);const t=bm(e),n=ym(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=ge({location:"",base:e,go:s,createHref:rm.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let An=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ie=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Ie||{});const wm={type:An.Static,value:""},xm=/[a-zA-Z0-9_]/;function Sm(e){if(!e)return[[]];if(e==="/")return[[wm]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(d){throw new Error(`ERR (${n})/"${u}": ${d}`)}let n=Ie.Static,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let a=0,l,u="",c="";function f(){u&&(n===Ie.Static?i.push({type:An.Static,value:u}):n===Ie.Param||n===Ie.ParamRegExp||n===Ie.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),i.push({type:An.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function h(){u+=l}for(;at.length?t.length===1&&t[0]===ze.Static+ze.Segment?1:-1:0}function nu(e,t){let n=0;const s=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Rm={strict:!1,end:!0,sensitive:!1};function Nm(e,t,n){const s=Tm(Sm(e.path),n),r=ge(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Am(e,t){const n=[],s=new Map;t=La(Rm,t);function r(f){return s.get(f)}function i(f,h,d){const m=!d,b=Qa(f);b.aliasOf=d&&d.record;const E=La(t,f),C=[b];if("alias"in f){const S=typeof f.alias=="string"?[f.alias]:f.alias;for(const F of S)C.push(Qa(ge({},b,{components:d?d.record.components:b.components,path:F,aliasOf:d?d.record:b})))}let A,I;for(const S of C){const{path:F}=S;if(h&&F[0]!=="/"){const j=h.record.path,_=j[j.length-1]==="/"?"":"/";S.path=h.record.path+(F&&_+F)}if(A=Nm(S,h,E),d?d.alias.push(A):(I=I||A,I!==A&&I.alias.push(A),m&&f.name&&!Va(A)&&o(f.name)),su(A)&&l(A),b.children){const j=b.children;for(let _=0;_{o(I)}:Cs}function o(f){if(Yc(f)){const h=s.get(f);h&&(s.delete(f),n.splice(n.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=n.indexOf(f);h>-1&&(n.splice(h,1),f.record.name&&s.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return n}function l(f){const h=Lm(f,n);n.splice(h,0,f),f.record.name&&!Va(f)&&s.set(f.record.name,f)}function u(f,h){let d,m={},b,E;if("name"in f&&f.name){if(d=s.get(f.name),!d)throw ns(Re.MATCHER_NOT_FOUND,{location:f});E=d.record.name,m=ge(ja(h.params,d.keys.filter(I=>!I.optional).concat(d.parent?d.parent.keys.filter(I=>I.optional):[]).map(I=>I.name)),f.params&&ja(f.params,d.keys.map(I=>I.name))),b=d.stringify(m)}else if(f.path!=null)b=f.path,d=n.find(I=>I.re.test(b)),d&&(m=d.parse(b),E=d.record.name);else{if(d=h.name?s.get(h.name):n.find(I=>I.re.test(h.path)),!d)throw ns(Re.MATCHER_NOT_FOUND,{location:f,currentLocation:h});E=d.record.name,m=ge({},h.params,f.params),b=d.stringify(m)}const C=[];let A=d;for(;A;)C.unshift(A.record),A=A.parent;return{name:E,path:b,params:m,matched:C,meta:Om(C)}}e.forEach(f=>i(f));function c(){n.length=0,s.clear()}return{addRoute:i,resolve:u,removeRoute:o,clearRoutes:c,getRoutes:a,getRecordMatcher:r}}function ja(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Qa(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Im(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Im(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Va(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Om(e){return e.reduce((t,n)=>ge(t,n.meta),{})}function Lm(e,t){let n=0,s=t.length;for(;n!==s;){const i=n+s>>1;nu(e,t[i])<0?s=i:n=i+1}const r=Pm(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function Pm(e){let t=e;for(;t=t.parent;)if(su(t)&&nu(e,t)===0)return t}function su({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function za(e){const t=mt(_o),n=mt(eu),s=se(()=>{const l=H(e.to);return t.resolve(l)}),r=se(()=>{const{matched:l}=s.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const h=f.findIndex(ts.bind(null,c));if(h>-1)return h;const d=Ka(l[u-2]);return u>1&&Ka(c)===d&&f[f.length-1].path!==d?f.findIndex(ts.bind(null,l[u-2])):h}),i=se(()=>r.value>-1&&Bm(n.params,s.value.params)),o=se(()=>r.value>-1&&r.value===n.matched.length-1&&Xc(n.params,s.value.params));function a(l={}){if(Fm(l)){const u=t[H(e.replace)?"replace":"push"](H(e.to)).catch(Cs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:s,href:se(()=>s.value.href),isActive:i,isExactActive:o,navigate:a}}function $m(e){return e.length===1?e[0]:e}const km=et({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:za,setup(e,{slots:t}){const n=is(za(e)),{options:s}=mt(_o),r=se(()=>({[Ua(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Ua(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&$m(t.default(n));return e.custom?i:xo("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Mm=km;function Fm(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Bm(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!wt(r)||r.length!==s.length||s.some((i,o)=>i.valueOf()!==r[o].valueOf()))return!1}return!0}function Ka(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ua=(e,t,n)=>e??t??n,Dm=et({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=mt(Vi),r=se(()=>e.route||s.value),i=mt(Fa,0),o=se(()=>{let u=H(i);const{matched:c}=r.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=se(()=>r.value.matched[o.value]);or(Fa,se(()=>o.value+1)),or(pm,a),or(Vi,r);const l=ae();return gt(()=>[l.value,a.value,e.name],([u,c,f],[h,d,m])=>{c&&(c.instances[f]=u,d&&d!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=d.leaveGuards),c.updateGuards.size||(c.updateGuards=d.updateGuards))),u&&c&&(!d||!ts(c,d)||!h)&&(c.enterCallbacks[f]||[]).forEach(b=>b(u))},{flush:"post"}),()=>{const u=r.value,c=e.name,f=a.value,h=f&&f.components[c];if(!h)return Ha(n.default,{Component:h,route:u});const d=f.props[c],m=d?d===!0?u.params:typeof d=="function"?d(u):d:null,E=xo(h,ge({},m,t,{onVnodeUnmounted:C=>{C.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return Ha(n.default,{Component:E,route:u})||E}}});function Ha(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const qm=Dm;function jm(e){const t=Am(e.routes,e),n=e.parseQuery||dm,s=e.stringifyQuery||Ma,r=e.history,i=ds(),o=ds(),a=ds(),l=Ln(nn);let u=nn;Qn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=pi.bind(null,g=>""+g),f=pi.bind(null,Gp),h=pi.bind(null,Ps);function d(g,Q){let B,W;return Yc(g)?(B=t.getRecordMatcher(g),W=Q):W=g,t.addRoute(W,B)}function m(g){const Q=t.getRecordMatcher(g);Q&&t.removeRoute(Q)}function b(){return t.getRoutes().map(g=>g.record)}function E(g){return!!t.getRecordMatcher(g)}function C(g,Q){if(Q=ge({},Q||l.value),typeof g=="string"){const w=mi(n,g,Q.path),L=t.resolve({path:w.path},Q),k=r.createHref(w.fullPath);return ge(w,L,{params:h(L.params),hash:Ps(w.hash),redirectedFrom:void 0,href:k})}let B;if(g.path!=null)B=ge({},g,{path:mi(n,g.path,Q.path).path});else{const w=ge({},g.params);for(const L in w)w[L]==null&&delete w[L];B=ge({},g,{params:f(w)}),Q.params=f(Q.params)}const W=t.resolve(B,Q),oe=g.hash||"";W.params=c(h(W.params));const p=Yp(s,ge({},g,{hash:Up(oe),path:W.path})),y=r.createHref(p);return ge({fullPath:p,hash:oe,query:s===Ma?hm(g.query):g.query||{}},W,{redirectedFrom:void 0,href:y})}function A(g){return typeof g=="string"?mi(n,g,l.value.path):ge({},g)}function I(g,Q){if(u!==g)return ns(Re.NAVIGATION_CANCELLED,{from:Q,to:g})}function S(g){return _(g)}function F(g){return S(ge(A(g),{replace:!0}))}function j(g,Q){const B=g.matched[g.matched.length-1];if(B&&B.redirect){const{redirect:W}=B;let oe=typeof W=="function"?W(g,Q):W;return typeof oe=="string"&&(oe=oe.includes("?")||oe.includes("#")?oe=A(oe):{path:oe},oe.params={}),ge({query:g.query,hash:g.hash,params:oe.path!=null?{}:g.params},oe)}}function _(g,Q){const B=u=C(g),W=l.value,oe=g.state,p=g.force,y=g.replace===!0,w=j(B,W);if(w)return _(ge(A(w),{state:typeof w=="object"?ge({},oe,w.state):oe,force:p,replace:y}),Q||B);const L=B;L.redirectedFrom=Q;let k;return!p&&Zp(s,W,B)&&(k=ns(Re.NAVIGATION_DUPLICATED,{to:L,from:W}),$e(W,W,!0,!1)),(k?Promise.resolve(k):x(L,W)).catch(P=>Ft(P)?Ft(P,Re.NAVIGATION_GUARD_REDIRECT)?P:lt(P):de(P,L,W)).then(P=>{if(P){if(Ft(P,Re.NAVIGATION_GUARD_REDIRECT))return _(ge({replace:y},A(P.to),{state:typeof P.to=="object"?ge({},oe,P.to.state):oe,force:p}),Q||L)}else P=N(L,W,!0,y,oe);return $(L,W,P),P})}function T(g,Q){const B=I(g,Q);return B?Promise.reject(B):Promise.resolve()}function O(g){const Q=Yt.values().next().value;return Q&&typeof Q.runWithContext=="function"?Q.runWithContext(g):g()}function x(g,Q){let B;const[W,oe,p]=mm(g,Q);B=yi(W.reverse(),"beforeRouteLeave",g,Q);for(const w of W)w.leaveGuards.forEach(L=>{B.push(cn(L,g,Q))});const y=T.bind(null,g,Q);return B.push(y),We(B).then(()=>{B=[];for(const w of i.list())B.push(cn(w,g,Q));return B.push(y),We(B)}).then(()=>{B=yi(oe,"beforeRouteUpdate",g,Q);for(const w of oe)w.updateGuards.forEach(L=>{B.push(cn(L,g,Q))});return B.push(y),We(B)}).then(()=>{B=[];for(const w of p)if(w.beforeEnter)if(wt(w.beforeEnter))for(const L of w.beforeEnter)B.push(cn(L,g,Q));else B.push(cn(w.beforeEnter,g,Q));return B.push(y),We(B)}).then(()=>(g.matched.forEach(w=>w.enterCallbacks={}),B=yi(p,"beforeRouteEnter",g,Q,O),B.push(y),We(B))).then(()=>{B=[];for(const w of o.list())B.push(cn(w,g,Q));return B.push(y),We(B)}).catch(w=>Ft(w,Re.NAVIGATION_CANCELLED)?w:Promise.reject(w))}function $(g,Q,B){a.list().forEach(W=>O(()=>W(g,Q,B)))}function N(g,Q,B,W,oe){const p=I(g,Q);if(p)return p;const y=Q===nn,w=Qn?history.state:{};B&&(W||y?r.replace(g.fullPath,ge({scroll:y&&w&&w.scroll},oe)):r.push(g.fullPath,oe)),l.value=g,$e(g,Q,B,y),lt()}let V;function z(){V||(V=r.listen((g,Q,B)=>{if(!$t.listening)return;const W=C(g),oe=j(W,$t.currentRoute.value);if(oe){_(ge(oe,{replace:!0,force:!0}),W).catch(Cs);return}u=W;const p=l.value;Qn&&am(ka(p.fullPath,B.delta),Jr()),x(W,p).catch(y=>Ft(y,Re.NAVIGATION_ABORTED|Re.NAVIGATION_CANCELLED)?y:Ft(y,Re.NAVIGATION_GUARD_REDIRECT)?(_(ge(A(y.to),{force:!0}),W).then(w=>{Ft(w,Re.NAVIGATION_ABORTED|Re.NAVIGATION_DUPLICATED)&&!B.delta&&B.type===ji.pop&&r.go(-1,!1)}).catch(Cs),Promise.reject()):(B.delta&&r.go(-B.delta,!1),de(y,W,p))).then(y=>{y=y||N(W,p,!1),y&&(B.delta&&!Ft(y,Re.NAVIGATION_CANCELLED)?r.go(-B.delta,!1):B.type===ji.pop&&Ft(y,Re.NAVIGATION_ABORTED|Re.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),$(W,p,y)}).catch(Cs)}))}let fe=ds(),re=ds(),ce;function de(g,Q,B){lt(g);const W=re.list();return W.length?W.forEach(oe=>oe(g,Q,B)):console.error(g),Promise.reject(g)}function at(){return ce&&l.value!==nn?Promise.resolve():new Promise((g,Q)=>{fe.add([g,Q])})}function lt(g){return ce||(ce=!g,z(),fe.list().forEach(([Q,B])=>g?B(g):Q()),fe.reset()),g}function $e(g,Q,B,W){const{scrollBehavior:oe}=e;if(!Qn||!oe)return Promise.resolve();const p=!B&&lm(ka(g.fullPath,0))||(W||!B)&&history.state&&history.state.scroll||null;return wn().then(()=>oe(g,Q,p)).then(y=>y&&om(y)).catch(y=>de(y,g,Q))}const ke=g=>r.go(g);let Xt;const Yt=new Set,$t={currentRoute:l,listening:!0,addRoute:d,removeRoute:m,clearRoutes:t.clearRoutes,hasRoute:E,getRoutes:b,resolve:C,options:e,push:S,replace:F,go:ke,back:()=>ke(-1),forward:()=>ke(1),beforeEach:i.add,beforeResolve:o.add,afterEach:a.add,onError:re.add,isReady:at,install(g){g.component("RouterLink",Mm),g.component("RouterView",qm),g.config.globalProperties.$router=$t,Object.defineProperty(g.config.globalProperties,"$route",{enumerable:!0,get:()=>H(l)}),Qn&&!Xt&&l.value===nn&&(Xt=!0,S(r.location).catch(W=>{}));const Q={};for(const W in nn)Object.defineProperty(Q,W,{get:()=>l.value[W],enumerable:!0});g.provide(_o,$t),g.provide(eu,Dl(Q)),g.provide(Vi,l);const B=g.unmount;Yt.add(g),g.unmount=function(){Yt.delete(g),Yt.size<1&&(u=nn,V&&V(),V=null,l.value=nn,Xt=!1,ce=!1),B()}}};function We(g){return g.reduce((Q,B)=>Q.then(()=>O(B)),Promise.resolve())}return $t}const Qm="/offline.png",q=Symbol.for("drizzle:entityKind");function M(e,t){if(!e||typeof e!="object")return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,q))throw new Error(`Class "${t.name??""}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(q in n&&n[q]===t[q])return!0;n=Object.getPrototypeOf(n)}return!1}class Vm{static[q]="ConsoleLogWriter";write(t){console.log(t)}}class zm{static[q]="DefaultLogger";writer;constructor(t){this.writer=t?.writer??new Vm}logQuery(t,n){const s=n.map(i=>{try{return JSON.stringify(i)}catch{return String(i)}}),r=s.length?` -- params: [${s.join(", ")}]`:"";this.writer.write(`Query: ${t}${r}`)}}class Km{static[q]="NoopLogger";logQuery(){}}const yn=Symbol.for("drizzle:Name"),fr=Symbol.for("drizzle:Schema"),zi=Symbol.for("drizzle:Columns"),Wa=Symbol.for("drizzle:ExtraConfigColumns"),bi=Symbol.for("drizzle:OriginalName"),vi=Symbol.for("drizzle:BaseName"),Cr=Symbol.for("drizzle:IsAlias"),Ga=Symbol.for("drizzle:ExtraConfigBuilder"),Um=Symbol.for("drizzle:IsDrizzleTable");class X{static[q]="Table";static Symbol={Name:yn,Schema:fr,OriginalName:bi,Columns:zi,ExtraConfigColumns:Wa,BaseName:vi,IsAlias:Cr,ExtraConfigBuilder:Ga};[yn];[bi];[fr];[zi];[Wa];[vi];[Cr]=!1;[Um]=!0;[Ga]=void 0;constructor(t,n,s){this[yn]=this[bi]=t,this[fr]=n,this[vi]=s}}function Vn(e){return e[yn]}function $s(e){return`${e[fr]??"public"}.${e[yn]}`}class Ae{constructor(t,n){this.table=t,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}static[q]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class Hm{static[q]="ColumnBuilder";config;constructor(t,n,s){this.config={name:t,keyAsName:t==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:s,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(t){return this.config.default=t,this.config.hasDefault=!0,this}$defaultFn(t){return this.config.defaultFn=t,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(t){return this.config.onUpdateFn=t,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(t){this.config.name===""&&(this.config.name=t)}}const Ja=Symbol.for("drizzle:isPgEnum");function Wm(e){return!!e&&typeof e=="function"&&Ja in e&&e[Ja]===!0}class He{static[q]="Subquery";constructor(t,n,s,r=!1,i=[]){this._={brand:"Subquery",sql:t,selectedFields:n,alias:s,isWith:r,usedTables:i}}}class ru extends He{static[q]="WithSubquery"}const Gm={startActiveSpan(e,t){return t()}},Qe=Symbol.for("drizzle:ViewBaseConfig");function iu(e){return e!=null&&typeof e.getSQL=="function"}function Jm(e){const t={sql:"",params:[]};for(const n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}class Me{static[q]="StringChunk";value;constructor(t){this.value=Array.isArray(t)?t:[t]}getSQL(){return new Z([this])}}class Z{constructor(t){this.queryChunks=t;for(const n of t)if(M(n,X)){const s=n[X.Symbol.Schema];this.usedTables.push(s===void 0?n[X.Symbol.Name]:s+"."+n[X.Symbol.Name])}}static[q]="SQL";decoder=ou;shouldInlineParams=!1;usedTables=[];append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Gm.startActiveSpan("drizzle.buildSQL",n=>{const s=this.buildQueryFromSourceParams(this.queryChunks,t);return n?.setAttributes({"drizzle.query.text":s.sql,"drizzle.query.params":JSON.stringify(s.params)}),s})}buildQueryFromSourceParams(t,n){const s=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:r,escapeName:i,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=s;return Jm(t.map(c=>{if(M(c,Me))return{sql:c.value.join(""),params:[]};if(M(c,Ki))return{sql:i(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const f=[new Me("(")];for(const[h,d]of c.entries())f.push(d),he},au={mapToDriverValue:e=>e};({...ou,...au});class vn{constructor(t,n=au){this.value=t,this.encoder=n}static[q]="Param";brand;getSQL(){return new Z([this])}}function v(e,...t){const n=[];(t.length>0||e.length>0&&e[0]!=="")&&n.push(new Me(e[0]));for(const[s,r]of t.entries())n.push(r,new Me(e[s+1]));return new Z(n)}(e=>{function t(){return new Z([])}e.empty=t;function n(l){return new Z(l)}e.fromList=n;function s(l){return new Z([new Me(l)])}e.raw=s;function r(l,u){const c=[];for(const[f,h]of l.entries())f>0&&u!==void 0&&c.push(u),c.push(h);return new Z(c)}e.join=r;function i(l){return new Ki(l)}e.identifier=i;function o(l){return new ss(l)}e.placeholder=o;function a(l,u){return new vn(l,u)}e.param=a})(v||(v={}));(e=>{class t{constructor(s,r){this.sql=s,this.fieldAlias=r}static[q]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(Z||(Z={}));class ss{constructor(t){this.name=t}static[q]="Placeholder";getSQL(){return new Z([this])}}function er(e,t){return e.map(n=>{if(M(n,ss)){if(!(n.name in t))throw new Error(`No value for placeholder "${n.name}" was provided`);return t[n.name]}if(M(n,vn)&&M(n.value,ss)){if(!(n.value.name in t))throw new Error(`No value for placeholder "${n.value.name}" was provided`);return n.encoder.mapToDriverValue(t[n.value.name])}return n})}const Ym=Symbol.for("drizzle:IsDrizzleView");class os{static[q]="View";[Qe];[Ym]=!0;constructor({name:t,schema:n,selectedFields:s,query:r}){this[Qe]={name:t,originalName:t,schema:n,selectedFields:s,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new Z([this])}}Ae.prototype.getSQL=function(){return new Z([this])};X.prototype.getSQL=function(){return new Z([this])};He.prototype.getSQL=function(){return new Z([this])};function Xa(e,t,n){const s={},r=e.reduce((i,{path:o,field:a},l)=>{let u;M(a,Ae)?u=a:M(a,Z)?u=a.decoder:M(a,He)?u=a._.sql.decoder:u=a.sql.decoder;let c=i;for(const[f,h]of o.entries())if(f0)for(const[i,o]of Object.entries(s))typeof o=="string"&&!n[o]&&(r[i]=null);return r}function $n(e,t){return Object.entries(e).reduce((n,[s,r])=>{if(typeof s!="string")return n;const i=t?[...t,s]:[s];return M(r,Ae)||M(r,Z)||M(r,Z.Aliased)||M(r,He)?n.push({path:i,field:r}):M(r,X)?n.push(...$n(r[X.Symbol.Columns],i)):n.push(...$n(r,i)),n},[])}function Co(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const[r,i]of n.entries())if(i!==s[r])return!1;return!0}function lu(e,t){const n=Object.entries(t).filter(([,s])=>s!==void 0).map(([s,r])=>M(r,Z)||M(r,Ae)?[s,r]:[s,new vn(r,e[X.Symbol.Columns][s])]);if(n.length===0)throw new Error("No values to set");return Object.fromEntries(n)}function Zm(e,t){for(const n of t)for(const s of Object.getOwnPropertyNames(n.prototype))s!=="constructor"&&Object.defineProperty(e.prototype,s,Object.getOwnPropertyDescriptor(n.prototype,s)||Object.create(null))}function eg(e){return e[X.Symbol.Columns]}function Ui(e){return M(e,He)?e._.alias:M(e,os)?e[Qe].name:M(e,Z)?void 0:e[X.Symbol.IsAlias]?e[X.Symbol.Name]:e[X.Symbol.BaseName]}function zs(e,t){return{name:typeof e=="string"&&e.length>0?e:"",config:typeof e=="object"?e:t}}const cu=typeof TextDecoder>"u"?null:new TextDecoder,Ya=Symbol.for("drizzle:PgInlineForeignKeys"),Za=Symbol.for("drizzle:EnableRLS");class tg extends X{static[q]="PgTable";static Symbol=Object.assign({},X.Symbol,{InlineForeignKeys:Ya,EnableRLS:Za});[Ya]=[];[Za]=!1;[X.Symbol.ExtraConfigBuilder]=void 0;[X.Symbol.ExtraConfigColumns]={}}class ng{static[q]="PgPrimaryKeyBuilder";columns;name;constructor(t,n){this.columns=t,this.name=n}build(t){return new sg(t,this.columns,this.name)}}class sg{constructor(t,n,s){this.table=t,this.columns=n,this.name=s}static[q]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[tg.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}function Ze(e,t){return Xm(t)&&!iu(e)&&!M(e,vn)&&!M(e,ss)&&!M(e,Ae)&&!M(e,X)&&!M(e,os)?new vn(e,t):e}const Tr=(e,t)=>v`${e} = ${Ze(t,e)}`,rg=(e,t)=>v`${e} <> ${Ze(t,e)}`;function Hi(...e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?new Z(t):new Z([new Me("("),v.join(t,new Me(" and ")),new Me(")")])}function ig(...e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?new Z(t):new Z([new Me("("),v.join(t,new Me(" or ")),new Me(")")])}function og(e){return v`not ${e}`}const ag=(e,t)=>v`${e} > ${Ze(t,e)}`,lg=(e,t)=>v`${e} >= ${Ze(t,e)}`,cg=(e,t)=>v`${e} < ${Ze(t,e)}`,ug=(e,t)=>v`${e} <= ${Ze(t,e)}`;function fg(e,t){return Array.isArray(t)?t.length===0?v`false`:v`${e} in ${t.map(n=>Ze(n,e))}`:v`${e} in ${Ze(t,e)}`}function dg(e,t){return Array.isArray(t)?t.length===0?v`true`:v`${e} not in ${t.map(n=>Ze(n,e))}`:v`${e} not in ${Ze(t,e)}`}function hg(e){return v`${e} is null`}function pg(e){return v`${e} is not null`}function mg(e){return v`exists ${e}`}function gg(e){return v`not exists ${e}`}function yg(e,t,n){return v`${e} between ${Ze(t,e)} and ${Ze(n,e)}`}function bg(e,t,n){return v`${e} not between ${Ze(t,e)} and ${Ze(n,e)}`}function vg(e,t){return v`${e} like ${t}`}function wg(e,t){return v`${e} not like ${t}`}function xg(e,t){return v`${e} ilike ${t}`}function Sg(e,t){return v`${e} not ilike ${t}`}function _g(e){return v`${e} asc`}function uu(e){return v`${e} desc`}class fu{constructor(t,n,s){this.sourceTable=t,this.referencedTable=n,this.relationName=s,this.referencedTableName=n[X.Symbol.Name]}static[q]="Relation";referencedTableName;fieldName}class du{constructor(t,n){this.table=t,this.config=n}static[q]="Relations"}class kn extends fu{constructor(t,n,s,r){super(t,n,s?.relationName),this.config=s,this.isNullable=r}static[q]="One";withFieldName(t){const n=new kn(this.sourceTable,this.referencedTable,this.config,this.isNullable);return n.fieldName=t,n}}class Xr extends fu{constructor(t,n,s){super(t,n,s?.relationName),this.config=s}static[q]="Many";withFieldName(t){const n=new Xr(this.sourceTable,this.referencedTable,this.config);return n.fieldName=t,n}}function Cg(){return{and:Hi,between:yg,eq:Tr,exists:mg,gt:ag,gte:lg,ilike:xg,inArray:fg,isNull:hg,isNotNull:pg,like:vg,lt:cg,lte:ug,ne:rg,not:og,notBetween:bg,notExists:gg,notLike:wg,notIlike:Sg,notInArray:dg,or:ig,sql:v}}function Tg(){return{sql:v,asc:_g,desc:uu}}function Eg(e,t){Object.keys(e).length===1&&"default"in e&&!M(e.default,X)&&(e=e.default);const n={},s={},r={};for(const[i,o]of Object.entries(e))if(M(o,X)){const a=$s(o),l=s[a];n[a]=i,r[i]={tsName:i,dbName:o[X.Symbol.Name],schema:o[X.Symbol.Schema],columns:o[X.Symbol.Columns],relations:l?.relations??{},primaryKey:l?.primaryKey??[]};for(const c of Object.values(o[X.Symbol.Columns]))c.primary&&r[i].primaryKey.push(c);const u=o[X.Symbol.ExtraConfigBuilder]?.(o[X.Symbol.ExtraConfigColumns]);if(u)for(const c of Object.values(u))M(c,ng)&&r[i].primaryKey.push(...c.columns)}else if(M(o,du)){const a=$s(o.table),l=n[a],u=o.config(t(o.table));let c;for(const[f,h]of Object.entries(u))if(l){const d=r[l];d.relations[f]=h}else a in s||(s[a]={relations:{},primaryKey:c}),s[a].relations[f]=h}return{tables:r,tableNamesMap:n}}function hu(e,t){return new du(e,n=>Object.fromEntries(Object.entries(t(n)).map(([s,r])=>[s,r.withFieldName(s)])))}function Rg(e){return function(n,s){return new kn(e,n,s,s?.fields.reduce((r,i)=>r&&i.notNull,!0)??!1)}}function Ng(e){return function(n,s){return new Xr(e,n,s)}}function Ag(e,t,n){if(M(n,kn)&&n.config)return{fields:n.config.fields,references:n.config.references};const s=t[$s(n.referencedTable)];if(!s)throw new Error(`Table "${n.referencedTable[X.Symbol.Name]}" not found in schema`);const r=e[s];if(!r)throw new Error(`Table "${s}" not found in schema`);const i=n.sourceTable,o=t[$s(i)];if(!o)throw new Error(`Table "${i[X.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(r.relations))(n.relationName&&n!==l&&l.relationName===n.relationName||!n.relationName&&l.referencedTable===n.sourceTable)&&a.push(l);if(a.length>1)throw n.relationName?new Error(`There are multiple relations with name "${n.relationName}" in table "${s}"`):new Error(`There are multiple relations between "${s}" and "${n.sourceTable[X.Symbol.Name]}". Please specify relation name`);if(a[0]&&M(a[0],kn)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${o}.${n.fieldName}"`)}function Ig(e){return{one:Rg(e),many:Ng(e)}}function Wi(e,t,n,s,r=i=>i){const i={};for(const[o,a]of s.entries())if(a.isJson){const l=t.relations[a.tsKey],u=n[o],c=typeof u=="string"?JSON.parse(u):u;i[a.tsKey]=M(l,kn)?c&&Wi(e,e[a.relationTableTsKey],c,a.selection,r):c.map(f=>Wi(e,e[a.relationTableTsKey],f,a.selection,r))}else{const l=r(n[o]),u=a.field;let c;M(u,Ae)?c=u:M(u,Z)?c=u.decoder:c=u.sql.decoder,i[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return i}class Er{constructor(t){this.table=t}static[q]="ColumnAliasProxyHandler";get(t,n){return n==="table"?this.table:t[n]}}class To{constructor(t,n){this.alias=t,this.replaceOriginalName=n}static[q]="TableAliasProxyHandler";get(t,n){if(n===X.Symbol.IsAlias)return!0;if(n===X.Symbol.Name)return this.alias;if(this.replaceOriginalName&&n===X.Symbol.OriginalName)return this.alias;if(n===Qe)return{...t[Qe],name:this.alias,isAlias:!0};if(n===X.Symbol.Columns){const r=t[X.Symbol.Columns];if(!r)return r;const i={};return Object.keys(r).map(o=>{i[o]=new Proxy(r[o],new Er(new Proxy(t,this)))}),i}const s=t[n];return M(s,Ae)?new Proxy(s,new Er(new Proxy(t,this))):s}}function wi(e,t){return new Proxy(e,new To(t,!1))}function Bt(e,t){return new Proxy(e,new Er(new Proxy(e.table,new To(t,!1))))}function pu(e,t){return new Z.Aliased(Rr(e.sql,t),e.fieldAlias)}function Rr(e,t){return v.join(e.queryChunks.map(n=>M(n,Ae)?Bt(n,t):M(n,Z)?Rr(n,t):M(n,Z.Aliased)?pu(n,t):n))}class Ke{static[q]="SelectionProxyHandler";config;constructor(t){this.config={...t}}get(t,n){if(n==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(n===Qe)return{...t[Qe],selectedFields:new Proxy(t[Qe].selectedFields,this)};if(typeof n=="symbol")return t[n];const r=(M(t,He)?t._.selectedFields:M(t,os)?t[Qe].selectedFields:t)[n];if(M(r,Z.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!r.isSelectionField)return r.sql;const i=r.clone();return i.isSelectionField=!0,i}if(M(r,Z)){if(this.config.sqlBehavior==="sql")return r;throw new Error(`You tried to reference "${n}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return M(r,Ae)?this.config.alias?new Proxy(r,new Er(new Proxy(r.table,new To(this.config.alias,this.config.replaceOriginalName??!1)))):r:typeof r!="object"||r===null?r:new Proxy(r,new Ke(this.config))}}class Bn{static[q]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(t){return this.then(void 0,t)}finally(t){return this.then(n=>(t?.(),n),n=>{throw t?.(),n})}then(t,n){return this.execute().then(t,n)}}class Og{static[q]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(t,n){this.reference=()=>{const{name:s,columns:r,foreignColumns:i}=t();return{name:s,columns:r,foreignTable:i[0].table,foreignColumns:i}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(t){return this._onUpdate=t,this}onDelete(t){return this._onDelete=t,this}build(t){return new Lg(t,this)}}class Lg{constructor(t,n){this.table=t,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}static[q]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){const{name:t,columns:n,foreignColumns:s}=this.reference(),r=n.map(a=>a.name),i=s.map(a=>a.name),o=[this.table[yn],...r,s[0].table[yn],...i];return t??`${o.join("_")}_fk`}}function Pg(e,t){return`${e[yn]}_${t.join("_")}_unique`}class xt extends Hm{static[q]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(t,n={}){return this.foreignKeyConfigs.push({ref:t,actions:n}),this}unique(t){return this.config.isUnique=!0,this.config.uniqueName=t,this}generatedAlwaysAs(t,n){return this.config.generated={as:t,type:"always",mode:n?.mode??"virtual"},this}buildForeignKeys(t,n){return this.foreignKeyConfigs.map(({ref:s,actions:r})=>((i,o)=>{const a=new Og(()=>{const l=i();return{columns:[t],foreignColumns:[l]}});return o.onUpdate&&a.onUpdate(o.onUpdate),o.onDelete&&a.onDelete(o.onDelete),a.build(n)})(s,r))}}class Ye extends Ae{constructor(t,n){n.uniqueName||(n.uniqueName=Pg(t,[n.name])),super(t,n),this.table=t}static[q]="SQLiteColumn"}class $g extends xt{static[q]="SQLiteBigIntBuilder";constructor(t){super(t,"bigint","SQLiteBigInt")}build(t){return new kg(t,this.config)}}class kg extends Ye{static[q]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(t){if(typeof Buffer<"u"&&Buffer.from){const n=Buffer.isBuffer(t)?t:t instanceof ArrayBuffer?Buffer.from(t):t.buffer?Buffer.from(t.buffer,t.byteOffset,t.byteLength):Buffer.from(t);return BigInt(n.toString("utf8"))}return BigInt(cu.decode(t))}mapToDriverValue(t){return Buffer.from(t.toString())}}class Mg extends xt{static[q]="SQLiteBlobJsonBuilder";constructor(t){super(t,"json","SQLiteBlobJson")}build(t){return new Fg(t,this.config)}}class Fg extends Ye{static[q]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(t){if(typeof Buffer<"u"&&Buffer.from){const n=Buffer.isBuffer(t)?t:t instanceof ArrayBuffer?Buffer.from(t):t.buffer?Buffer.from(t.buffer,t.byteOffset,t.byteLength):Buffer.from(t);return JSON.parse(n.toString("utf8"))}return JSON.parse(cu.decode(t))}mapToDriverValue(t){return Buffer.from(JSON.stringify(t))}}class Bg extends xt{static[q]="SQLiteBlobBufferBuilder";constructor(t){super(t,"buffer","SQLiteBlobBuffer")}build(t){return new Dg(t,this.config)}}class Dg extends Ye{static[q]="SQLiteBlobBuffer";mapFromDriverValue(t){return Buffer.isBuffer(t)?t:Buffer.from(t)}getSQLType(){return"blob"}}function qg(e,t){const{name:n,config:s}=zs(e,t);return s?.mode==="json"?new Mg(n):s?.mode==="bigint"?new $g(n):new Bg(n)}class jg extends xt{static[q]="SQLiteCustomColumnBuilder";constructor(t,n,s){super(t,"custom","SQLiteCustomColumn"),this.config.fieldConfig=n,this.config.customTypeParams=s}build(t){return new Qg(t,this.config)}}class Qg extends Ye{static[q]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(t,n){super(t,n),this.sqlName=n.customTypeParams.dataType(n.fieldConfig),this.mapTo=n.customTypeParams.toDriver,this.mapFrom=n.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(t){return typeof this.mapFrom=="function"?this.mapFrom(t):t}mapToDriverValue(t){return typeof this.mapTo=="function"?this.mapTo(t):t}}function Vg(e){return(t,n)=>{const{name:s,config:r}=zs(t,n);return new jg(s,r,e)}}class Eo extends xt{static[q]="SQLiteBaseIntegerBuilder";constructor(t,n,s){super(t,n,s),this.config.autoIncrement=!1}primaryKey(t){return t?.autoIncrement&&(this.config.autoIncrement=!0),this.config.hasDefault=!0,super.primaryKey()}}class Ro extends Ye{static[q]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class zg extends Eo{static[q]="SQLiteIntegerBuilder";constructor(t){super(t,"number","SQLiteInteger")}build(t){return new Kg(t,this.config)}}class Kg extends Ro{static[q]="SQLiteInteger"}class Ug extends Eo{static[q]="SQLiteTimestampBuilder";constructor(t,n){super(t,"date","SQLiteTimestamp"),this.config.mode=n}defaultNow(){return this.default(v`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(t){return new Hg(t,this.config)}}class Hg extends Ro{static[q]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(t){return this.config.mode==="timestamp"?new Date(t*1e3):new Date(t)}mapToDriverValue(t){const n=t.getTime();return this.config.mode==="timestamp"?Math.floor(n/1e3):n}}class Wg extends Eo{static[q]="SQLiteBooleanBuilder";constructor(t,n){super(t,"boolean","SQLiteBoolean"),this.config.mode=n}build(t){return new Gg(t,this.config)}}class Gg extends Ro{static[q]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(t){return Number(t)===1}mapToDriverValue(t){return t?1:0}}function Ut(e,t){const{name:n,config:s}=zs(e,t);return s?.mode==="timestamp"||s?.mode==="timestamp_ms"?new Ug(n,s.mode):s?.mode==="boolean"?new Wg(n,s.mode):new zg(n)}class Jg extends xt{static[q]="SQLiteNumericBuilder";constructor(t){super(t,"string","SQLiteNumeric")}build(t){return new Xg(t,this.config)}}class Xg extends Ye{static[q]="SQLiteNumeric";mapFromDriverValue(t){return typeof t=="string"?t:String(t)}getSQLType(){return"numeric"}}class Yg extends xt{static[q]="SQLiteNumericNumberBuilder";constructor(t){super(t,"number","SQLiteNumericNumber")}build(t){return new Zg(t,this.config)}}class Zg extends Ye{static[q]="SQLiteNumericNumber";mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}mapToDriverValue=String;getSQLType(){return"numeric"}}class ey extends xt{static[q]="SQLiteNumericBigIntBuilder";constructor(t){super(t,"bigint","SQLiteNumericBigInt")}build(t){return new ty(t,this.config)}}class ty extends Ye{static[q]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function ny(e,t){const{name:n,config:s}=zs(e,t),r=s?.mode;return r==="number"?new Yg(n):r==="bigint"?new ey(n):new Jg(n)}class sy extends xt{static[q]="SQLiteRealBuilder";constructor(t){super(t,"number","SQLiteReal")}build(t){return new ry(t,this.config)}}class ry extends Ye{static[q]="SQLiteReal";getSQLType(){return"real"}}function iy(e){return new sy(e??"")}class oy extends xt{static[q]="SQLiteTextBuilder";constructor(t,n){super(t,"string","SQLiteText"),this.config.enumValues=n.enum,this.config.length=n.length}build(t){return new ay(t,this.config)}}class ay extends Ye{static[q]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(t,n){super(t,n)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class ly extends xt{static[q]="SQLiteTextJsonBuilder";constructor(t){super(t,"json","SQLiteTextJson")}build(t){return new cy(t,this.config)}}class cy extends Ye{static[q]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(t){return JSON.parse(t)}mapToDriverValue(t){return JSON.stringify(t)}}function Ne(e,t={}){const{name:n,config:s}=zs(e,t);return s.mode==="json"?new ly(n):new oy(n,s)}function uy(){return{blob:qg,customType:Vg,integer:Ut,numeric:ny,real:iy,text:Ne}}const Gi=Symbol.for("drizzle:SQLiteInlineForeignKeys");class ht extends X{static[q]="SQLiteTable";static Symbol=Object.assign({},X.Symbol,{InlineForeignKeys:Gi});[X.Symbol.Columns];[Gi]=[];[X.Symbol.ExtraConfigBuilder]=void 0}function fy(e,t,n,s,r=e){const i=new ht(e,s,r),o=typeof t=="function"?t(uy()):t,a=Object.fromEntries(Object.entries(o).map(([u,c])=>{const f=c;f.setName(u);const h=f.build(i);return i[Gi].push(...f.buildForeignKeys(h,i)),[u,h]})),l=Object.assign(i,a);return l[X.Symbol.Columns]=a,l[X.Symbol.ExtraConfigColumns]=a,l}const Ks=(e,t,n)=>fy(e,t);function In(e){return M(e,ht)?[`${e[X.Symbol.BaseName]}`]:M(e,He)?e._.usedTables??[]:M(e,Z)?e.usedTables??[]:[]}class el extends Bn{constructor(t,n,s,r){super(),this.table=t,this.session=n,this.dialect=s,this.config={table:t,withList:r}}static[q]="SQLiteDelete";config;where(t){return this.config.where=t,this}orderBy(...t){if(typeof t[0]=="function"){const n=t[0](new Proxy(this.config.table[X.Symbol.Columns],new Ke({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),s=Array.isArray(n)?n:[n];this.config.orderBy=s}else{const n=t;this.config.orderBy=n}return this}limit(t){return this.config.limit=t,this}returning(t=this.table[ht.Symbol.Columns]){return this.config.returning=$n(t),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:t,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(t=!0){return this.session[t?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"delete",tables:In(this.config.table)})}prepare(){return this._prepare(!1)}run=t=>this._prepare().run(t);all=t=>this._prepare().all(t);get=t=>this._prepare().get(t);values=t=>this._prepare().values(t);async execute(t){return this._prepare().execute(t)}$dynamic(){return this}}function dy(e){return(e.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(n=>n.toLowerCase()).join("_")}function hy(e){return(e.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((n,s,r)=>{const i=r===0?s.toLowerCase():`${s[0].toUpperCase()}${s.slice(1)}`;return n+i},"")}function py(e){return e}class my{static[q]="CasingCache";cache={};cachedTables={};convert;constructor(t){this.convert=t==="snake_case"?dy:t==="camelCase"?hy:py}getColumnCasing(t){if(!t.keyAsName)return t.name;const n=t.table[X.Symbol.Schema]??"public",s=t.table[X.Symbol.OriginalName],r=`${n}.${s}.${t.name}`;return this.cache[r]||this.cacheTable(t.table),this.cache[r]}cacheTable(t){const n=t[X.Symbol.Schema]??"public",s=t[X.Symbol.OriginalName],r=`${n}.${s}`;if(!this.cachedTables[r]){for(const i of Object.values(t[X.Symbol.Columns])){const o=`${r}.${i.name}`;this.cache[o]=this.convert(i.name)}this.cachedTables[r]=!0}}clearCache(){this.cache={},this.cachedTables={}}}class No extends Error{static[q]="DrizzleError";constructor({message:t,cause:n}){super(t),this.name="DrizzleError",this.cause=n}}class un extends Error{constructor(t,n,s){super(`Failed query: ${t} params: ${n}`),this.query=t,this.params=n,this.cause=s,Error.captureStackTrace(this,un),s&&(this.cause=s)}}class gy extends No{static[q]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}class Ao extends os{static[q]="SQLiteViewBase"}class Nr{static[q]="SQLiteDialect";casing;constructor(t){this.casing=new my(t?.casing)}escapeName(t){return`"${t}"`}escapeParam(t){return"?"}escapeString(t){return`'${t.replace(/'/g,"''")}'`}buildWithCTE(t){if(!t?.length)return;const n=[v`with `];for(const[s,r]of t.entries())n.push(v`${v.identifier(r._.alias)} as (${r._.sql})`),sn[o]!==void 0||s[o]?.onUpdateFn!==void 0),i=r.length;return v.join(r.flatMap((o,a)=>{const l=s[o],u=l.onUpdateFn?.(),c=n[o]??(M(u,Z)?u:v.param(u,l)),f=v`${v.identifier(this.casing.getColumnCasing(l))} = ${c}`;return a{const a=[];if(M(i,Z.Aliased)&&i.isSelectionField)a.push(v.identifier(i.fieldAlias));else if(M(i,Z.Aliased)||M(i,Z)){const l=M(i,Z.Aliased)?i.sql:i;n?a.push(new Z(l.queryChunks.map(u=>M(u,Ae)?v.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),M(i,Z.Aliased)&&a.push(v` as ${v.identifier(i.fieldAlias)}`)}else if(M(i,Ae)){const l=i.table[X.Symbol.Name];i.columnType==="SQLiteNumericBigInt"?n?a.push(v`cast(${v.identifier(this.casing.getColumnCasing(i))} as text)`):a.push(v`cast(${v.identifier(l)}.${v.identifier(this.casing.getColumnCasing(i))} as text)`):n?a.push(v.identifier(this.casing.getColumnCasing(i))):a.push(v`${v.identifier(l)}.${v.identifier(this.casing.getColumnCasing(i))}`)}else if(M(i,He)){const l=Object.entries(i._.selectedFields);if(l.length===1){const u=l[0][1],c=M(u,Z)?u.decoder:M(u,Ae)?{mapFromDriverValue:f=>u.mapFromDriverValue(f)}:u.sql.decoder;c&&(i._.sql.decoder=c)}a.push(i)}return o=0?v` limit ${t}`:void 0}buildOrderBy(t){const n=[];if(t)for(const[s,r]of t.entries())n.push(r),s0?v` order by ${v.join(n)}`:void 0}buildFromTable(t){return M(t,X)&&t[X.Symbol.IsAlias]?v`${v`${v.identifier(t[X.Symbol.Schema]??"")}.`.if(t[X.Symbol.Schema])}${v.identifier(t[X.Symbol.OriginalName])} ${v.identifier(t[X.Symbol.Name])}`:t}buildSelectQuery({withList:t,fields:n,fieldsFlat:s,where:r,having:i,table:o,joins:a,orderBy:l,groupBy:u,limit:c,offset:f,distinct:h,setOperators:d}){const m=s??$n(n);for(const V of m)if(M(V.field,Ae)&&Vn(V.field.table)!==(M(o,He)?o._.alias:M(o,Ao)?o[Qe].name:M(o,Z)?void 0:Vn(o))&&!(z=>a?.some(({alias:fe})=>fe===(z[X.Symbol.IsAlias]?Vn(z):z[X.Symbol.BaseName])))(V.field.table)){const z=Vn(V.field.table);throw new Error(`Your "${V.path.join("->")}" field references a column "${z}"."${V.field.name}", but the table "${z}" is not part of the query! Did you forget to join it?`)}const b=!a||a.length===0,E=this.buildWithCTE(t),C=h?v` distinct`:void 0,A=this.buildSelection(m,{isSingleTable:b}),I=this.buildFromTable(o),S=this.buildJoins(a),F=r?v` where ${r}`:void 0,j=i?v` having ${i}`:void 0,_=[];if(u)for(const[V,z]of u.entries())_.push(z),V0?v` group by ${v.join(_)}`:void 0,O=this.buildOrderBy(l),x=this.buildLimit(c),$=f?v` offset ${f}`:void 0,N=v`${E}select${C} ${A} from ${I}${S}${F}${T}${j}${O}${x}${$}`;return d.length>0?this.buildSetOperations(N,d):N}buildSetOperations(t,n){const[s,...r]=n;if(!s)throw new Error("Cannot pass undefined values to any set operator");return r.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:s}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:s}),r)}buildSetOperationQuery({leftSelect:t,setOperator:{type:n,isAll:s,rightSelect:r,limit:i,orderBy:o,offset:a}}){const l=v`${t.getSQL()} `,u=v`${r.getSQL()}`;let c;if(o&&o.length>0){const m=[];for(const b of o)if(M(b,Ye))m.push(v.identifier(b.name));else if(M(b,Z)){for(let E=0;E=0?v` limit ${i}`:void 0,h=v.raw(`${n} ${s?"all ":""}`),d=a?v` offset ${a}`:void 0;return v`${l}${h}${u}${c}${f}${d}`}buildInsertQuery({table:t,values:n,onConflict:s,returning:r,withList:i,select:o}){const a=[],l=t[X.Symbol.Columns],u=Object.entries(l).filter(([b,E])=>!E.shouldDisableInsert()),c=u.map(([,b])=>v.identifier(this.casing.getColumnCasing(b)));if(o){const b=n;M(b,Z)?a.push(b):a.push(b.getSQL())}else{const b=n;a.push(v.raw("values "));for(const[E,C]of b.entries()){const A=[];for(const[I,S]of u){const F=C[I];if(F===void 0||M(F,vn)&&F.value===void 0){let j;if(S.default!==null&&S.default!==void 0)j=M(S.default,Z)?S.default:v.param(S.default,S);else if(S.defaultFn!==void 0){const _=S.defaultFn();j=M(_,Z)?_:v.param(_,S)}else if(!S.default&&S.onUpdateFn!==void 0){const _=S.onUpdateFn();j=M(_,Z)?_:v.param(_,S)}else j=v`null`;A.push(j)}else A.push(F)}a.push(A),E({dbKey:I.name,tsKey:A,field:Bt(I,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const C=Object.fromEntries(Object.entries(i.columns).map(([_,T])=>[_,Bt(T,a)]));if(o.where){const _=typeof o.where=="function"?o.where(C,Cg()):o.where;m=_&&Rr(_,a)}const A=[];let I=[];if(o.columns){let _=!1;for(const[T,O]of Object.entries(o.columns))O!==void 0&&T in i.columns&&(!_&&O===!0&&(_=!0),I.push(T));I.length>0&&(I=_?I.filter(T=>o.columns?.[T]===!0):Object.keys(i.columns).filter(T=>!I.includes(T)))}else I=Object.keys(i.columns);for(const _ of I){const T=i.columns[_];A.push({tsKey:_,value:T})}let S=[];o.with&&(S=Object.entries(o.with).filter(_=>!!_[1]).map(([_,T])=>({tsKey:_,queryConfig:T,relation:i.relations[_]})));let F;if(o.extras){F=typeof o.extras=="function"?o.extras(C,{sql:v}):o.extras;for(const[_,T]of Object.entries(F))A.push({tsKey:_,value:pu(T,a)})}for(const{tsKey:_,value:T}of A)c.push({dbKey:M(T,Z.Aliased)?T.fieldAlias:i.columns[_].name,tsKey:_,field:M(T,Ae)?Bt(T,a):T,relationTableTsKey:void 0,isJson:!1,selection:[]});let j=typeof o.orderBy=="function"?o.orderBy(C,Tg()):o.orderBy??[];Array.isArray(j)||(j=[j]),d=j.map(_=>M(_,Ae)?Bt(_,a):Rr(_,a)),f=o.limit,h=o.offset;for(const{tsKey:_,queryConfig:T,relation:O}of S){const x=Ag(n,s,O),$=$s(O.referencedTable),N=s[$],V=`${a}_${_}`,z=Hi(...x.fields.map((ce,de)=>Tr(Bt(x.references[de],V),Bt(ce,a)))),fe=this.buildRelationalQuery({fullSchema:t,schema:n,tableNamesMap:s,table:t[N],tableConfig:n[N],queryConfig:M(O,kn)?T===!0?{limit:1}:{...T,limit:1}:T,tableAlias:V,joinOn:z,nestedQueryRelation:O}),re=v`(${fe.sql})`.as(_);c.push({dbKey:_,tsKey:_,field:re,relationTableTsKey:N,isJson:!0,selection:fe.selection})}}if(c.length===0)throw new No({message:`No fields selected for table "${i.tsName}" ("${a}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`});let E;if(m=Hi(u,m),l){let C=v`json_array(${v.join(c.map(({field:S})=>M(S,Ye)?v.identifier(this.casing.getColumnCasing(S)):M(S,Z.Aliased)?S.sql:S),v`, `)})`;M(l,Xr)&&(C=v`coalesce(json_group_array(${C}), json_array())`);const A=[{dbKey:"data",tsKey:"data",field:C.as("data"),isJson:!0,relationTableTsKey:i.tsName,selection:c}];f!==void 0||h!==void 0||d.length>0?(E=this.buildSelectQuery({table:wi(r,a),fields:{},fieldsFlat:[{path:[],field:v.raw("*")}],where:m,limit:f,offset:h,orderBy:d,setOperators:[]}),m=void 0,f=void 0,h=void 0,d=void 0):E=wi(r,a),E=this.buildSelectQuery({table:M(E,ht)?E:new He(E,{},a),fields:{},fieldsFlat:A.map(({field:S})=>({path:[],field:M(S,Ae)?Bt(S,a):S})),joins:b,where:m,limit:f,offset:h,orderBy:d,setOperators:[]})}else E=this.buildSelectQuery({table:wi(r,a),fields:{},fieldsFlat:c.map(({field:C})=>({path:[],field:M(C,Ae)?Bt(C,a):C})),joins:b,where:m,limit:f,offset:h,orderBy:d,setOperators:[]});return{tableTsKey:i.tsName,sql:E,selection:c}}}class yy extends Nr{static[q]="SQLiteSyncDialect";migrate(t,n,s){const r=s===void 0||typeof s=="string"?"__drizzle_migrations":s.migrationsTable??"__drizzle_migrations",i=v` CREATE TABLE IF NOT EXISTS ${v.identifier(r)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric ) `;n.run(i);const a=n.values(v`SELECT id, hash, created_at FROM ${v.identifier(r)} ORDER BY created_at DESC LIMIT 1`)[0]??void 0;n.run(v`BEGIN`);try{for(const l of t)if(!a||Number(a[2]){for(const u of t)if(!a||Number(a[2])[r,t[r]])):M(t,Ao)?s=t[Qe].selectedFields:M(t,Z)?s={}:s=eg(t),new mu({table:t,fields:s,isPartialSelect:n,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}}class wy extends vy{static[q]="SQLiteSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:t,fields:n,isPartialSelect:s,session:r,dialect:i,withList:o,distinct:a}){super(),this.config={withList:o,table:t,fields:{...n},distinct:a,setOperators:[]},this.isPartialSelect=s,this.session=r,this.dialect=i,this._={selectedFields:n,config:this.config},this.tableName=Ui(t),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{};for(const l of In(t))this.usedTables.add(l)}getUsedTables(){return[...this.usedTables]}createJoin(t){return(n,s)=>{const r=this.tableName,i=Ui(n);for(const o of In(n))this.usedTables.add(o);if(typeof i=="string"&&this.config.joins?.some(o=>o.alias===i))throw new Error(`Alias "${i}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof r=="string"&&(this.config.fields={[r]:this.config.fields}),typeof i=="string"&&!M(n,Z))){const o=M(n,He)?n._.selectedFields:M(n,os)?n[Qe].selectedFields:n[X.Symbol.Columns];this.config.fields[i]=o}if(typeof s=="function"&&(s=s(new Proxy(this.config.fields,new Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:s,table:n,joinType:t,alias:i}),typeof i=="string")switch(t){case"left":{this.joinsNotNullableMap[i]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[i]=!0;break}case"cross":case"inner":{this.joinsNotNullableMap[i]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[i]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");crossJoin=this.createJoin("cross");createSetOperator(t,n){return s=>{const r=typeof s=="function"?s(xy()):s;if(!Co(this.getSelectedFields(),r.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:t,isAll:n,rightSelect:r}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);except=this.createSetOperator("except",!1);addSetOperators(t){return this.config.setOperators.push(...t),this}where(t){return typeof t=="function"&&(t=t(new Proxy(this.config.fields,new Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=t,this}having(t){return typeof t=="function"&&(t=t(new Proxy(this.config.fields,new Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=t,this}groupBy(...t){if(typeof t[0]=="function"){const n=t[0](new Proxy(this.config.fields,new Ke({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(n)?n:[n]}else this.config.groupBy=t;return this}orderBy(...t){if(typeof t[0]=="function"){const n=t[0](new Proxy(this.config.fields,new Ke({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),s=Array.isArray(n)?n:[n];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=s:this.config.orderBy=s}else{const n=t;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}return this}limit(t){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=t:this.config.limit=t,this}offset(t){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=t:this.config.offset=t,this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:t,...n}=this.dialect.sqlToQuery(this.getSQL());return n}as(t){const n=[];if(n.push(...In(this.config.table)),this.config.joins)for(const s of this.config.joins)n.push(...In(s.table));return new Proxy(new He(this.getSQL(),this.config.fields,t,!1,[...new Set(n)]),new Ke({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Ke({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class mu extends wy{static[q]="SQLiteSelect";_prepare(t=!0){if(!this.session)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");const n=$n(this.config.fields),s=this.session[t?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),n,"all",!0,void 0,{type:"select",tables:[...this.usedTables]},this.cacheConfig);return s.joinsNotNullableMap=this.joinsNotNullableMap,s}$withCache(t){return this.cacheConfig=t===void 0?{config:{},enable:!0,autoInvalidate:!0}:t===!1?{enable:!1}:{enable:!0,autoInvalidate:!0,...t},this}prepare(){return this._prepare(!1)}run=t=>this._prepare().run(t);all=t=>this._prepare().all(t);get=t=>this._prepare().get(t);values=t=>this._prepare().values(t);async execute(){return this.all()}}Zm(mu,[Bn]);function Yr(e,t){return(n,s,...r)=>{const i=[s,...r].map(o=>({type:e,isAll:t,rightSelect:o}));for(const o of i)if(!Co(n.getSelectedFields(),o.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return n.addSetOperators(i)}}const xy=()=>({union:Sy,unionAll:_y,intersect:Cy,except:Ty}),Sy=Yr("union",!1),_y=Yr("union",!0),Cy=Yr("intersect",!1),Ty=Yr("except",!1);class gu{static[q]="SQLiteQueryBuilder";dialect;dialectConfig;constructor(t){this.dialect=M(t,Nr)?t:void 0,this.dialectConfig=M(t,Nr)?void 0:t}$with=(t,n)=>{const s=this;return{as:i=>(typeof i=="function"&&(i=i(s)),new Proxy(new ru(i.getSQL(),n??("getSelectedFields"in i?i.getSelectedFields()??{}:{}),t,!0),new Ke({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}};with(...t){const n=this;function s(i){return new hn({fields:i??void 0,session:void 0,dialect:n.getDialect(),withList:t})}function r(i){return new hn({fields:i??void 0,session:void 0,dialect:n.getDialect(),withList:t,distinct:!0})}return{select:s,selectDistinct:r}}select(t){return new hn({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new hn({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}getDialect(){return this.dialect||(this.dialect=new yy(this.dialectConfig)),this.dialect}}class tl{constructor(t,n,s,r){this.table=t,this.session=n,this.dialect=s,this.withList=r}static[q]="SQLiteInsertBuilder";values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const n=t.map(s=>{const r={},i=this.table[X.Symbol.Columns];for(const o of Object.keys(s)){const a=s[o];r[o]=M(a,Z)?a:new vn(a,i[o])}return r});return new nl(this.table,n,this.session,this.dialect,this.withList)}select(t){const n=typeof t=="function"?t(new gu):t;if(!M(n,Z)&&!Co(this.table[zi],n._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new nl(this.table,n,this.session,this.dialect,this.withList,!0)}}class nl extends Bn{constructor(t,n,s,r,i,o){super(),this.session=s,this.dialect=r,this.config={table:t,values:n,withList:i,select:o}}static[q]="SQLiteInsert";config;returning(t=this.config.table[ht.Symbol.Columns]){return this.config.returning=$n(t),this}onConflictDoNothing(t={}){if(this.config.onConflict||(this.config.onConflict=[]),t.target===void 0)this.config.onConflict.push(v` on conflict do nothing`);else{const n=Array.isArray(t.target)?v`${t.target}`:v`${[t.target]}`,s=t.where?v` where ${t.where}`:v``;this.config.onConflict.push(v` on conflict ${n} do nothing${s}`)}return this}onConflictDoUpdate(t){if(t.where&&(t.targetWhere||t.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');this.config.onConflict||(this.config.onConflict=[]);const n=t.where?v` where ${t.where}`:void 0,s=t.targetWhere?v` where ${t.targetWhere}`:void 0,r=t.setWhere?v` where ${t.setWhere}`:void 0,i=Array.isArray(t.target)?v`${t.target}`:v`${[t.target]}`,o=this.dialect.buildUpdateSet(this.config.table,lu(this.config.table,t.set));return this.config.onConflict.push(v` on conflict ${i}${s} do update set ${o}${n}${r}`),this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:t,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(t=!0){return this.session[t?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:In(this.config.table)})}prepare(){return this._prepare(!1)}run=t=>this._prepare().run(t);all=t=>this._prepare().all(t);get=t=>this._prepare().get(t);values=t=>this._prepare().values(t);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}class sl{constructor(t,n,s,r){this.table=t,this.session=n,this.dialect=s,this.withList=r}static[q]="SQLiteUpdateBuilder";set(t){return new Ey(this.table,lu(this.table,t),this.session,this.dialect,this.withList)}}class Ey extends Bn{constructor(t,n,s,r,i){super(),this.session=s,this.dialect=r,this.config={set:n,table:t,withList:i,joins:[]}}static[q]="SQLiteUpdate";config;from(t){return this.config.from=t,this}createJoin(t){return(n,s)=>{const r=Ui(n);if(typeof r=="string"&&this.config.joins.some(i=>i.alias===r))throw new Error(`Alias "${r}" is already used in this query`);if(typeof s=="function"){const i=this.config.from?M(n,ht)?n[X.Symbol.Columns]:M(n,He)?n._.selectedFields:M(n,Ao)?n[Qe].selectedFields:void 0:void 0;s=s(new Proxy(this.config.table[X.Symbol.Columns],new Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),i&&new Proxy(i,new Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}return this.config.joins.push({on:s,table:n,joinType:t,alias:r}),this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(t){return this.config.where=t,this}orderBy(...t){if(typeof t[0]=="function"){const n=t[0](new Proxy(this.config.table[X.Symbol.Columns],new Ke({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),s=Array.isArray(n)?n:[n];this.config.orderBy=s}else{const n=t;this.config.orderBy=n}return this}limit(t){return this.config.limit=t,this}returning(t=this.config.table[ht.Symbol.Columns]){return this.config.returning=$n(t),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:t,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(t=!0){return this.session[t?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:In(this.config.table)})}prepare(){return this._prepare(!1)}run=t=>this._prepare().run(t);all=t=>this._prepare().all(t);get=t=>this._prepare().get(t);values=t=>this._prepare().values(t);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}class Ar extends Z{constructor(t){super(Ar.buildEmbeddedCount(t.source,t.filters).queryChunks),this.params=t,this.session=t.session,this.sql=Ar.buildCount(t.source,t.filters)}sql;static[q]="SQLiteCountBuilderAsync";[Symbol.toStringTag]="SQLiteCountBuilderAsync";session;static buildEmbeddedCount(t,n){return v`(select count(*) from ${t}${v.raw(" where ").if(n)}${n})`}static buildCount(t,n){return v`select count(*) from ${t}${v.raw(" where ").if(n)}${n}`}then(t,n){return Promise.resolve(this.session.count(this.sql)).then(t,n)}catch(t){return this.then(void 0,t)}finally(t){return this.then(n=>(t?.(),n),n=>{throw t?.(),n})}}class Ry{constructor(t,n,s,r,i,o,a,l){this.mode=t,this.fullSchema=n,this.schema=s,this.tableNamesMap=r,this.table=i,this.tableConfig=o,this.dialect=a,this.session=l}static[q]="SQLiteAsyncRelationalQueryBuilder";findMany(t){return this.mode==="sync"?new rl(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many"):new Ji(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return this.mode==="sync"?new rl(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first"):new Ji(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}class Ji extends Bn{constructor(t,n,s,r,i,o,a,l,u){super(),this.fullSchema=t,this.schema=n,this.tableNamesMap=s,this.table=r,this.tableConfig=i,this.dialect=o,this.session=a,this.config=l,this.mode=u}static[q]="SQLiteAsyncRelationalQuery";mode;getSQL(){return this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}).sql}_prepare(t=!1){const{query:n,builtQuery:s}=this._toSQL();return this.session[t?"prepareOneTimeQuery":"prepareQuery"](s,void 0,this.mode==="first"?"get":"all",!0,(r,i)=>{const o=r.map(a=>Wi(this.schema,this.tableConfig,a,n.selection,i));return this.mode==="first"?o[0]:o})}prepare(){return this._prepare(!1)}_toSQL(){const t=this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}),n=this.dialect.sqlToQuery(t.sql);return{query:t,builtQuery:n}}toSQL(){return this._toSQL().builtQuery}executeRaw(){return this.mode==="first"?this._prepare(!1).get():this._prepare(!1).all()}async execute(){return this.executeRaw()}}class rl extends Ji{static[q]="SQLiteSyncRelationalQuery";sync(){return this.executeRaw()}}class tr extends Bn{constructor(t,n,s,r,i){super(),this.execute=t,this.getSQL=n,this.dialect=r,this.mapBatchResult=i,this.config={action:s}}static[q]="SQLiteRaw";config;getQuery(){return{...this.dialect.sqlToQuery(this.getSQL()),method:this.config.action}}mapResult(t,n){return n?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}class yu{constructor(t,n,s,r){this.resultKind=t,this.dialect=n,this.session=s,this._=r?{schema:r.schema,fullSchema:r.fullSchema,tableNamesMap:r.tableNamesMap}:{schema:void 0,fullSchema:{},tableNamesMap:{}},this.query={};const i=this.query;if(this._.schema)for(const[o,a]of Object.entries(this._.schema))i[o]=new Ry(t,r.fullSchema,this._.schema,this._.tableNamesMap,r.fullSchema[o],a,n,s);this.$cache={invalidate:async o=>{}}}static[q]="BaseSQLiteDatabase";query;$with=(t,n)=>{const s=this;return{as:i=>(typeof i=="function"&&(i=i(new gu(s.dialect))),new Proxy(new ru(i.getSQL(),n??("getSelectedFields"in i?i.getSelectedFields()??{}:{}),t,!0),new Ke({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}};$count(t,n){return new Ar({source:t,filters:n,session:this.session})}with(...t){const n=this;function s(l){return new hn({fields:l??void 0,session:n.session,dialect:n.dialect,withList:t})}function r(l){return new hn({fields:l??void 0,session:n.session,dialect:n.dialect,withList:t,distinct:!0})}function i(l){return new sl(l,n.session,n.dialect,t)}function o(l){return new tl(l,n.session,n.dialect,t)}function a(l){return new el(l,n.session,n.dialect,t)}return{select:s,selectDistinct:r,update:i,insert:o,delete:a}}select(t){return new hn({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new hn({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}update(t){return new sl(t,this.session,this.dialect)}$cache;insert(t){return new tl(t,this.session,this.dialect)}delete(t){return new el(t,this.session,this.dialect)}run(t){const n=typeof t=="string"?v.raw(t):t.getSQL();return this.resultKind==="async"?new tr(async()=>this.session.run(n),()=>n,"run",this.dialect,this.session.extractRawRunValueFromBatchResult.bind(this.session)):this.session.run(n)}all(t){const n=typeof t=="string"?v.raw(t):t.getSQL();return this.resultKind==="async"?new tr(async()=>this.session.all(n),()=>n,"all",this.dialect,this.session.extractRawAllValueFromBatchResult.bind(this.session)):this.session.all(n)}get(t){const n=typeof t=="string"?v.raw(t):t.getSQL();return this.resultKind==="async"?new tr(async()=>this.session.get(n),()=>n,"get",this.dialect,this.session.extractRawGetValueFromBatchResult.bind(this.session)):this.session.get(n)}values(t){const n=typeof t=="string"?v.raw(t):t.getSQL();return this.resultKind==="async"?new tr(async()=>this.session.values(n),()=>n,"values",this.dialect,this.session.extractRawValuesValueFromBatchResult.bind(this.session)):this.session.values(n)}transaction(t,n){return this.session.transaction(t,n)}}class Ny{static[q]="Cache"}class bu extends Ny{strategy(){return"all"}static[q]="NoopCache";async get(t){}async put(t,n,s,r){}async onMutate(t){}}async function il(e,t){const n=`${e}-${JSON.stringify(t)}`,r=new TextEncoder().encode(n),i=await crypto.subtle.digest("SHA-256",r);return[...new Uint8Array(i)].map(l=>l.toString(16).padStart(2,"0")).join("")}class Ay extends Bn{constructor(t){super(),this.resultCb=t}static[q]="ExecuteResultSync";async execute(){return this.resultCb()}sync(){return this.resultCb()}}class Iy{constructor(t,n,s,r,i,o){this.mode=t,this.executeMethod=n,this.query=s,this.cache=r,this.queryMetadata=i,this.cacheConfig=o,r&&r.strategy()==="all"&&o===void 0&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),this.cacheConfig?.enable||(this.cacheConfig=void 0)}static[q]="PreparedQuery";joinsNotNullableMap;async queryWithCache(t,n,s){if(this.cache===void 0||M(this.cache,bu)||this.queryMetadata===void 0)try{return await s()}catch(r){throw new un(t,n,r)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await s()}catch(r){throw new un(t,n,r)}if((this.queryMetadata.type==="insert"||this.queryMetadata.type==="update"||this.queryMetadata.type==="delete")&&this.queryMetadata.tables.length>0)try{const[r]=await Promise.all([s(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return r}catch(r){throw new un(t,n,r)}if(!this.cacheConfig)try{return await s()}catch(r){throw new un(t,n,r)}if(this.queryMetadata.type==="select"){const r=await this.cache.get(this.cacheConfig.tag??await il(t,n),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(r===void 0){let i;try{i=await s()}catch(o){throw new un(t,n,o)}return await this.cache.put(this.cacheConfig.tag??await il(t,n),i,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),i}return r}try{return await s()}catch(r){throw new un(t,n,r)}}getQuery(){return this.query}mapRunResult(t,n){return t}mapAllResult(t,n){throw new Error("Not implemented")}mapGetResult(t,n){throw new Error("Not implemented")}execute(t){return this.mode==="async"?this[this.executeMethod](t):new Ay(()=>this[this.executeMethod](t))}mapResult(t,n){switch(this.executeMethod){case"run":return this.mapRunResult(t,n);case"all":return this.mapAllResult(t,n);case"get":return this.mapGetResult(t,n)}}}class Oy{constructor(t){this.dialect=t}static[q]="SQLiteSession";prepareOneTimeQuery(t,n,s,r,i,o,a){return this.prepareQuery(t,n,s,r,i,o,a)}run(t){const n=this.dialect.sqlToQuery(t);try{return this.prepareOneTimeQuery(n,void 0,"run",!1).run()}catch(s){throw new No({cause:s,message:`Failed to run the query '${n.sql}'`})}}extractRawRunValueFromBatchResult(t){return t}all(t){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(t),void 0,"run",!1).all()}extractRawAllValueFromBatchResult(t){throw new Error("Not implemented")}get(t){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(t),void 0,"run",!1).get()}extractRawGetValueFromBatchResult(t){throw new Error("Not implemented")}values(t){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(t),void 0,"run",!1).values()}async count(t){return(await this.values(t))[0][0]}extractRawValuesValueFromBatchResult(t){throw new Error("Not implemented")}}class Ly extends yu{constructor(t,n,s,r,i=0){super(t,n,s,r),this.schema=r,this.nestedIndex=i}static[q]="SQLiteTransaction";rollback(){throw new gy}}class Py extends Oy{constructor(t,n,s,r,i={}){super(n),this.client=t,this.schema=s,this.batchCLient=r,this.logger=i.logger??new Km,this.cache=i.cache??new bu}static[q]="SQLiteRemoteSession";logger;cache;prepareQuery(t,n,s,r,i,o,a){return new $y(this.client,t,this.logger,this.cache,o,a,n,s,r,i)}async batch(t){const n=[],s=[];for(const i of t){const o=i._prepare(),a=o.getQuery();n.push(o),s.push({sql:a.sql,params:a.params,method:a.method})}return(await this.batchCLient(s)).map((i,o)=>n[o].mapResult(i,!0))}async transaction(t,n){const s=new Io("async",this.dialect,this,this.schema);await this.run(v.raw(`begin${n?.behavior?" "+n.behavior:""}`));try{const r=await t(s);return await this.run(v`commit`),r}catch(r){throw await this.run(v`rollback`),r}}extractRawAllValueFromBatchResult(t){return t.rows}extractRawGetValueFromBatchResult(t){return t.rows[0]}extractRawValuesValueFromBatchResult(t){return t.rows}}class Io extends Ly{static[q]="SQLiteProxyTransaction";async transaction(t){const n=`sp${this.nestedIndex}`,s=new Io("async",this.dialect,this.session,this.schema,this.nestedIndex+1);await this.session.run(v.raw(`savepoint ${n}`));try{const r=await t(s);return await this.session.run(v.raw(`release savepoint ${n}`)),r}catch(r){throw await this.session.run(v.raw(`rollback to savepoint ${n}`)),r}}}class $y extends Iy{constructor(t,n,s,r,i,o,a,l,u,c){super("async",l,n,r,i,o),this.client=t,this.logger=s,this.fields=a,this._isResponseInArrayMode=u,this.customResultMapper=c,this.customResultMapper=c,this.method=l}static[q]="SQLiteProxyPreparedQuery";method;getQuery(){return{...this.query,method:this.method}}async run(t){const n=er(this.query.params,t??{});return this.logger.logQuery(this.query.sql,n),await this.queryWithCache(this.query.sql,n,async()=>await this.client(this.query.sql,n,"run"))}mapAllResult(t,n){return n&&(t=t.rows),!this.fields&&!this.customResultMapper?t:this.customResultMapper?this.customResultMapper(t):t.map(s=>Xa(this.fields,s,this.joinsNotNullableMap))}async all(t){const{query:n,logger:s,client:r}=this,i=er(n.params,t??{});s.logQuery(n.sql,i);const{rows:o}=await this.queryWithCache(n.sql,i,async()=>await r(n.sql,i,"all"));return this.mapAllResult(o)}async get(t){const{query:n,logger:s,client:r}=this,i=er(n.params,t??{});s.logQuery(n.sql,i);const o=await this.queryWithCache(n.sql,i,async()=>await r(n.sql,i,"get"));return this.mapGetResult(o.rows)}mapGetResult(t,n){n&&(t=t.rows);const s=t;if(!this.fields&&!this.customResultMapper)return s;if(s)return this.customResultMapper?this.customResultMapper([t]):Xa(this.fields,s,this.joinsNotNullableMap)}async values(t){const n=er(this.query.params,t??{});return this.logger.logQuery(this.query.sql,n),(await this.queryWithCache(this.query.sql,n,async()=>await this.client(this.query.sql,n,"values"))).rows}isResponseInArrayMode(){return this._isResponseInArrayMode}}class ky extends yu{static[q]="SqliteRemoteDatabase";async batch(t){return this.session.batch(t)}}function My(e,t,n){const s=new by({casing:n?.casing});let r,i,o,a={};t&&(typeof t=="function"?(o=t,a={}):(o=void 0,a=t),a.logger===!0?r=new zm:a.logger!==!1&&(r=a.logger,i=a.cache));let l;if(a.schema){const f=Eg(a.schema,Ig);l={fullSchema:a.schema,schema:f.tables,tableNamesMap:f.tableNamesMap}}const u=new Py(e,s,l,o,{logger:r,cache:i}),c=new ky("async",s,u,l);return c.$cache=i,c.$cache&&(c.$cache.invalidate=i?.onMutate),c}const ol="function",zn="64e10b34-2bf7-4616-9668-f99de5aa046e",Fy="get",By="has",Dy="set",{isArray:dr}=Array;let{SharedArrayBuffer:Ir,window:qy}=globalThis,{notify:vu,wait:wu,waitAsync:Or}=Atomics,xu=null;Or||(Or=e=>({value:new Promise(t=>{let n=new Worker("data:application/javascript,onmessage%3D(%7Bdata%3Ab%7D)%3D%3E(Atomics.wait(b%2C0)%2CpostMessage(0))");n.onmessage=t,n.postMessage(e)})}));try{new Ir(4)}catch{Ir=ArrayBuffer;const t=new WeakMap;if(qy){const n=new Map,{prototype:{postMessage:s}}=Worker,r=i=>{const o=i.data?.[zn];if(!dr(o)){i.stopImmediatePropagation();const{id:a,sb:l}=o;n.get(a)(l)}};xu=function(i,...o){const a=i?.[zn];if(dr(a)){const[l,u]=a;t.set(u,l),this.addEventListener("message",r)}return s.call(this,i,...o)},Or=i=>({value:new Promise(o=>{n.set(t.get(i),o)}).then(o=>{n.delete(t.get(i)),t.delete(i);for(let a=0;a({[zn]:{id:s,sb:r}});vu=s=>{postMessage(n(t.get(s),s))},addEventListener("message",s=>{const r=s.data?.[zn];if(dr(r)){const[i,o]=r;t.set(o,i)}})}}const{Int32Array:Xi,Map:al,Uint16Array:Yi}=globalThis,{BYTES_PER_ELEMENT:ll}=Xi,{BYTES_PER_ELEMENT:jy}=Yi,Qy=(e,t,n)=>{for(;wu(e,0,0,t)==="timed-out";)n()},Zi=new WeakSet,xi=new WeakMap,Vy={value:{then:e=>e()}};let zy=0;const Oo=(e,{parse:t=JSON.parse,stringify:n=JSON.stringify,transform:s,interrupt:r}=JSON)=>{if(!xi.has(e)){const i=xu||e.postMessage,o=(h,...d)=>i.call(e,{[zn]:d},{transfer:h}),a=typeof r===ol?r:r?.handler,l=r?.delay||42,u=new TextDecoder("utf-16"),c=(h,d)=>h?Or(d,0):(a?Qy(d,l,a):wu(d,0),Vy);let f=!1;xi.set(e,new Proxy(new al,{[By]:(h,d)=>typeof d=="string"&&!d.startsWith("_"),[Fy]:(h,d)=>d==="then"?null:((...m)=>{const b=zy++;let E=new Xi(new Ir(ll*2)),C=[];Zi.has(m.at(-1)||C)&&Zi.delete(C=m.pop()),o(C,b,E,d,s?m.map(s):m);const A=e!==globalThis;let I=0;return f&&A&&(I=setTimeout(console.warn,1e3,`💀🔒 - Possible deadlock if proxy.${d}(...args) is awaited`)),c(A,E).value.then(()=>{clearTimeout(I);const S=E[1];if(!S)return;const F=jy*S;return E=new Xi(new Ir(F+F%ll)),o([],b,E),c(A,E).value.then(()=>t(u.decode(new Yi(E.buffer).slice(0,S))))})}),[Dy](h,d,m){const b=typeof m;if(b!==ol)throw new Error(`Unable to assign ${d} as ${b}`);if(!h.size){const E=new al;e.addEventListener("message",async C=>{const A=C.data?.[zn];if(dr(A)){C.stopImmediatePropagation();const[I,S,...F]=A;let j;if(F.length){const[_,T]=F;if(h.has(_)){f=!0;try{const O=await h.get(_)(...T);if(O!==void 0){const x=n(s?s(O):O);E.set(I,x),S[1]=x.length}}catch(O){j=O}finally{f=!1}}else j=new Error(`Unsupported action: ${_}`);S[0]=1}else{const _=E.get(I);E.delete(I);for(let T=new Yi(S.buffer),O=0;O<_.length;O++)T[O]=_.charCodeAt(O)}if(vu(S,0),j)throw j}})}return!!h.set(d,m)}}))}return xi.get(e)};Oo.transfer=(...e)=>(Zi.add(e),e);function cl(){let e,t;return{lock:async()=>{for(;e;)await e;e=new Promise(r=>{t=r})},unlock:async()=>{const r=t;e=void 0,t=void 0,r?.()}}}async function Su(e,t){let n;if(e instanceof Blob?n=e.stream():n=e,n instanceof ReadableStream&&t){const r=n.getReader();switch(t){case"callback":return async()=>(await r.read()).value;case"buffer":const i=[];let o=!1;for(;!o;){const c=await r.read();c.value&&i.push(c.value),o=c.done}const a=i.reduce((c,f)=>c+f.length,0),l=new Uint8Array(a);let u=0;return i.forEach(c=>{l.set(c,u),u+=c.length}),l.buffer}}else return n}class Lr{constructor(t){Object.defineProperty(this,"sqlite3InitModule",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"sqlite3",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"db",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"writeCallbacks",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"storageType",{enumerable:!0,configurable:!0,writable:!0,value:"memory"})}async init(t){const{databasePath:n}=t,s=this.getFlags(t);if(!this.sqlite3InitModule){const{default:r}=await Rt(async()=>{const{default:i}=await import("./index-yH03Qhxy.js");return{default:i}},[]);this.sqlite3InitModule=r}this.sqlite3||(this.sqlite3=await this.sqlite3InitModule()),this.db&&await this.destroy(),this.db=new this.sqlite3.oo1.DB(n,s),this.config=t,this.initWriteHook()}onWrite(t){return this.writeCallbacks.add(t),()=>{this.writeCallbacks.delete(t)}}async exec(t){if(!this.db)throw new Error("Driver not initialized");return this.execOnDb(this.db,t)}async execBatch(t){if(!this.db)throw new Error("Driver not initialized");const n=[];return this.db.transaction(s=>{const r=new Map;try{for(let i of t){let o=r.get(i.sql);if(!o){const u=s.prepare(i.sql);r.set(i.sql,u),o=u}i.params?.length&&o.bind(i.params);let a=[],l=[];for(;o.step();)a=o.getColumnNames([]),l.push(o.get([]));n.push({columns:a,rows:l}),o.reset()}}finally{r.forEach(i=>{i.finalize()})}}),n}async isDatabasePersisted(){return!1}async getDatabaseSizeBytes(){const n=(await this.exec({sql:`SELECT page_count * page_size AS size FROM pragma_page_count(), pragma_page_size()`,method:"get"}))?.rows?.[0];if(typeof n!="number")throw new Error("Failed to query database size");return n}async createFunction(t){if(!this.db)throw new Error("Driver not initialized");switch(t.type){case"callback":case"scalar":this.db.createFunction({name:t.name,xFunc:(n,...s)=>t.func(...s),arity:-1});break;case"aggregate":this.db.createFunction({name:t.name,xStep:(n,...s)=>t.func.step(...s),xFinal:(n,...s)=>t.func.final(...s),arity:-1});break}}async import(t){if(!this.sqlite3||!this.db||!this.config)throw new Error("Driver not initialized");const n=await Su(t,"buffer"),s=this.sqlite3.wasm.allocFromTypedArray(n);this.pointers.push(s);const r=this.sqlite3.capi.sqlite3_deserialize(this.db,"main",s,n.byteLength,n.byteLength,this.config.readOnly?this.sqlite3.capi.SQLITE_DESERIALIZE_READONLY:this.sqlite3.capi.SQLITE_DESERIALIZE_RESIZEABLE);this.db.checkRc(r)}async export(){if(!this.sqlite3||!this.db)throw new Error("Driver not initialized");return{name:"database.sqlite3",data:this.sqlite3.capi.sqlite3_js_db_export(this.db)}}async clear(){}async destroy(){this.closeDb(),this.pointers.forEach(t=>this.sqlite3?.wasm.dealloc(t)),this.pointers=[],this.writeCallbacks.clear()}getFlags(t){const{readOnly:n,verbose:s}=t;return[n===!0?"r":"cw",s===!0?"t":""].join("")}execOnDb(t,n){const s={rows:[],columns:[]},r=t.exec({sql:n.sql,bind:n.params,returnValue:"resultRows",rowMode:"array",columnNames:s.columns});switch(n.method){case"run":break;case"get":s.rows=r[0]??[];break;default:s.rows=r;break}return s}initWriteHook(){if(!this.config?.reactive)return;if(!this.sqlite3||!this.db)throw new Error("Driver not initialized");const t={[this.sqlite3.capi.SQLITE_INSERT]:"insert",[this.sqlite3.capi.SQLITE_UPDATE]:"update",[this.sqlite3.capi.SQLITE_DELETE]:"delete"};this.sqlite3.capi.sqlite3_update_hook(this.db,(n,s,r,i,o)=>{this.writeCallbacks.forEach(a=>{a({table:i,rowid:o,operation:t[s]})})},0)}closeDb(){this.db&&(this.db.close(),this.db=void 0)}}function Ky(e,t,n){let s,r,i,o,a,l,u=0,c=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError("Expected a function");t=Number(t)||0,typeof n=="object"&&n!==null&&(c=!!n.leading,f="maxWait"in n,i=f?Math.max(Number(n.maxWait)||0,t):0,h="trailing"in n?!!n.trailing:h);function d(j){const _=s,T=r;return s=r=void 0,u=j,o=e.apply(T,_),o}function m(j){return u=j,a=setTimeout(C,t),c?d(j):o}function b(j){const _=j-(l??0),T=j-u,O=t-_;return f?Math.min(O,i-T):O}function E(j){const _=j-(l??0),T=j-u;return l===void 0||_>=t||_<0||f&&T>=i}function C(){const j=Date.now();if(E(j))return A(j);a=setTimeout(C,b(j))}function A(j){return a=void 0,h&&s?d(j):(s=r=void 0,o)}function I(){a!==void 0&&clearTimeout(a),u=0,s=l=r=a=void 0}function S(){return a===void 0?o:A(Date.now())}function F(){const j=Date.now(),_=E(j);if(s=arguments,r=this,l=j,_){if(a===void 0)return m(l);if(f)return a=setTimeout(C,t),d(l)}return a===void 0&&(a=setTimeout(C,t)),o}return F.cancel=I,F.flush=S,F}function hr(){return crypto.randomUUID()}function _u(e,t){switch(e){case"session":case":sessionStorage:":let n=sessionStorage._sqlocal_session_key;return n||(n=hr(),sessionStorage._sqlocal_session_key=n),`session:${n}`;case"local":case":localStorage:":return"local";case":memory:":return`memory:${t}`;default:return`path:${e}`}}class nr{constructor(t){Object.defineProperty(this,"driver",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"userFunctions",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"initMutex",{enumerable:!0,configurable:!0,writable:!0,value:cl()}),Object.defineProperty(this,"transactionMutex",{enumerable:!0,configurable:!0,writable:!0,value:cl()}),Object.defineProperty(this,"transactionKey",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"proxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirtyTables",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"effectsChannel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reinitChannel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onmessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"init",{enumerable:!0,configurable:!0,writable:!0,value:async r=>{if(!(!this.config.databasePath||!this.config.clientKey)){await this.initMutex.lock();try{try{await this.driver.init(this.config)}catch{console.warn(`Persistence failed, so ${this.config.databasePath} will not be saved. For origin private file system persistence, make sure your web server is configured to use the correct HTTP response headers (See https://sqlocal.dev/guide/setup#cross-origin-isolation).`),this.config.databasePath=":memory:",this.driver=new Lr,await this.driver.init(this.config)}const i=_u(this.config.databasePath,this.config.clientKey);this.reinitChannel=new BroadcastChannel(`_sqlocal_reinit_(${i})`),this.reinitChannel.onmessage=o=>{const a=o.data;if(this.config.clientKey!==a.clientKey)switch(a.type){case"reinit":this.init(a.reason);break;case"close":this.driver.destroy();break}},this.config.reactive&&(this.effectsChannel=new BroadcastChannel(`_sqlocal_effects_(${i})`),this.driver.onWrite(async o=>{this.dirtyTables.add(o.table),await this.transactionMutex.lock(),this.emitEffectsDebounced(),await this.transactionMutex.unlock()})),await Promise.all(Array.from(this.userFunctions.values()).map(o=>this.initUserFunction(o))),await this.execInitStatements(),this.emitMessage({type:"event",event:"connect",reason:r})}catch(i){this.emitMessage({type:"error",error:i,queryKey:null}),await this.destroy()}finally{await this.initMutex.unlock()}}}}),Object.defineProperty(this,"postMessage",{enumerable:!0,configurable:!0,writable:!0,value:async(r,i)=>{const o=r instanceof MessageEvent?r.data:r;switch(await this.initMutex.lock(),o.type){case"config":this.editConfig(o);break;case"query":case"batch":case"transaction":this.exec(o);break;case"function":this.createUserFunction(o);break;case"getinfo":this.getDatabaseInfo(o);break;case"import":this.importDb(o);break;case"export":this.exportDb(o);break;case"delete":this.deleteDb(o);break;case"destroy":this.destroy(o);break}await this.initMutex.unlock()}}),Object.defineProperty(this,"emitMessage",{enumerable:!0,configurable:!0,writable:!0,value:(r,i=[])=>{this.onmessage&&this.onmessage(r,i)}}),Object.defineProperty(this,"emitEffects",{enumerable:!0,configurable:!0,writable:!0,value:()=>{!this.effectsChannel||this.dirtyTables.size===0||(this.effectsChannel.postMessage({type:"effects",tables:[...this.dirtyTables]}),this.dirtyTables.clear())}}),Object.defineProperty(this,"emitEffectsDebounced",{enumerable:!0,configurable:!0,writable:!0,value:Ky(()=>this.emitEffects(),32,{maxWait:180})}),Object.defineProperty(this,"editConfig",{enumerable:!0,configurable:!0,writable:!0,value:r=>{this.config=r.config,this.init("initial")}}),Object.defineProperty(this,"exec",{enumerable:!0,configurable:!0,writable:!0,value:async r=>{try{const i={type:"data",queryKey:r.queryKey,data:[]};switch(r.type){case"query":const o=this.transactionKey!==null&&this.transactionKey===r.transactionKey;try{o||await this.transactionMutex.lock();const a=await this.driver.exec(r);i.data.push(a)}finally{o||await this.transactionMutex.unlock()}break;case"batch":try{await this.transactionMutex.lock();const a=await this.driver.execBatch(r.statements);i.data.push(...a)}finally{await this.transactionMutex.unlock()}break;case"transaction":if(r.action==="begin"&&(await this.transactionMutex.lock(),this.transactionKey=r.transactionKey,await this.driver.exec({sql:"BEGIN"})),(r.action==="commit"||r.action==="rollback")&&this.transactionKey!==null&&this.transactionKey===r.transactionKey){const a=r.action==="commit"?"COMMIT":"ROLLBACK";await this.driver.exec({sql:a}),this.transactionKey=null,await this.transactionMutex.unlock()}break}this.emitMessage(i)}catch(i){this.emitMessage({type:"error",error:i,queryKey:r.queryKey})}}}),Object.defineProperty(this,"execInitStatements",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{if(this.config.onInitStatements)for(let r of this.config.onInitStatements)await this.driver.exec(r)}}),Object.defineProperty(this,"getDatabaseInfo",{enumerable:!0,configurable:!0,writable:!0,value:async r=>{try{this.emitMessage({type:"info",queryKey:r.queryKey,info:{databasePath:this.config.databasePath,storageType:this.driver.storageType,databaseSizeBytes:await this.driver.getDatabaseSizeBytes(),persisted:await this.driver.isDatabasePersisted()}})}catch(i){this.emitMessage({type:"error",queryKey:r.queryKey,error:i})}}}),Object.defineProperty(this,"createUserFunction",{enumerable:!0,configurable:!0,writable:!0,value:async r=>{const{functionName:i,functionType:o,queryKey:a}=r;let l;if(this.userFunctions.has(i)){this.emitMessage({type:"error",error:new Error(`A user-defined function with the name "${i}" has already been created for this SQLocal instance.`),queryKey:a});return}switch(o){case"callback":l={type:o,name:i,func:(...u)=>{this.emitMessage({type:"callback",name:i,args:u})}};break;case"scalar":l={type:o,name:i,func:this.proxy[`_sqlocal_func_${i}`]};break;case"aggregate":l={type:o,name:i,func:{step:this.proxy[`_sqlocal_func_${i}_step`],final:this.proxy[`_sqlocal_func_${i}_final`]}};break}try{await this.initUserFunction(l),this.emitMessage({type:"success",queryKey:a})}catch(u){this.emitMessage({type:"error",error:u,queryKey:a})}}}),Object.defineProperty(this,"initUserFunction",{enumerable:!0,configurable:!0,writable:!0,value:async r=>{await this.driver.createFunction(r),this.userFunctions.set(r.name,r)}}),Object.defineProperty(this,"importDb",{enumerable:!0,configurable:!0,writable:!0,value:async r=>{const{queryKey:i,database:o}=r;let a=!1;try{await this.driver.import(o),this.driver.storageType==="memory"&&await this.execInitStatements()}catch(l){this.emitMessage({type:"error",error:l,queryKey:i}),a=!0}finally{this.driver.storageType!=="memory"&&await this.init("overwrite")}a||this.emitMessage({type:"success",queryKey:i})}}),Object.defineProperty(this,"exportDb",{enumerable:!0,configurable:!0,writable:!0,value:async r=>{const{queryKey:i}=r;try{const{name:o,data:a}=await this.driver.export();this.emitMessage({type:"buffer",queryKey:i,bufferName:o,buffer:a},[a])}catch(o){this.emitMessage({type:"error",error:o,queryKey:i})}}}),Object.defineProperty(this,"deleteDb",{enumerable:!0,configurable:!0,writable:!0,value:async r=>{const{queryKey:i}=r;let o=!1;try{await this.driver.clear()}catch(a){this.emitMessage({type:"error",error:a,queryKey:i}),o=!0}finally{await this.init("delete")}o||this.emitMessage({type:"success",queryKey:i})}}),Object.defineProperty(this,"destroy",{enumerable:!0,configurable:!0,writable:!0,value:async r=>{await this.driver.exec({sql:"PRAGMA optimize"}),await this.driver.destroy(),this.effectsChannel&&(this.emitEffectsDebounced.flush(),this.effectsChannel.close(),this.effectsChannel=void 0),this.reinitChannel&&(this.reinitChannel.close(),this.reinitChannel=void 0),r&&this.emitMessage({type:"success",queryKey:r.queryKey})}});const s=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope?Oo(globalThis):globalThis;this.proxy=s,this.driver=t}}function Pr(e,...t){return{sql:e.join("?"),params:t}}function Uy(e){return!e.some(t=>!Array.isArray(t))}function Si(e,t){let n;return Uy(e)?n=e:n=[e],n.map(s=>{const r={};return t.forEach((i,o)=>{r[i]=s[o]}),r})}function Hy(e){return typeof e=="object"&&e!==null&&"getSQL"in e&&typeof e.getSQL=="function"}function Wy(e){return typeof e=="object"&&e!==null&&"sql"in e&&typeof e.sql=="string"&&"params"in e}function ul(e){if(typeof e=="function"&&(e=e(Pr)),Hy(e))try{if(!("toSQL"in e&&typeof e.toSQL=="function"))throw 1;const s=e.toSQL();if(!Wy(s))throw 2;const r="all"in e&&typeof e.all=="function"?e.all:void 0;return{...s,exec:r?()=>r():void 0}}catch{throw new Error("The passed statement could not be parsed.")}const t=e.sql;let n=[];return"params"in e?n=e.params:"parameters"in e&&(n=e.parameters),{sql:t,params:n}}function fl(e,t){let n;return typeof e=="string"?n={sql:e,params:t}:n=Pr(e,...t),n}async function sr(e,t,n,s){return!t&&"locks"in navigator?navigator.locks.request(`_sqlocal_mutation_(${n.databasePath})`,{mode:e},s):s()}class dl extends Lr{constructor(t,n){super(n),Object.defineProperty(this,"storageType",{enumerable:!0,configurable:!0,writable:!0,value:t})}async init(t){const n=this.getFlags(t);if(t.readOnly)throw new Error(`SQLite storage type "${this.storageType}" does not support read-only mode.`);if(!this.sqlite3InitModule){const{default:s}=await Rt(async()=>{const{default:r}=await import("./index-yH03Qhxy.js");return{default:r}},[]);this.sqlite3InitModule=s}this.sqlite3||(this.sqlite3=await this.sqlite3InitModule()),this.db&&await this.destroy(),this.db=new this.sqlite3.oo1.JsStorageDb({filename:this.storageType,flags:n}),this.config=t,this.initWriteHook()}async isDatabasePersisted(){return navigator.storage?.persisted()}async getDatabaseSizeBytes(){if(!this.db)throw new Error("Driver not initialized");return this.db.storageSize()}async import(t){const n=new Lr;await n.init({}),await n.import(t),await this.clear(),await n.exec({sql:`VACUUM INTO 'file:${this.storageType}?vfs=kvvfs'`}),await n.destroy()}async clear(){if(!this.db)throw new Error("Driver not initialized");this.db.clearStorage()}async destroy(){this.closeDb(),this.writeCallbacks.clear()}}var Cu,Tu;class Gy{constructor(t){Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isDestroyed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"bypassMutationLock",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"transactionQueryKeyQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"userCallbacks",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"queriesInProgress",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"proxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reinitChannel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"effectsChannel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"processMessageEvent",{enumerable:!0,configurable:!0,writable:!0,value:u=>{const c=u instanceof MessageEvent?u.data:u,f=this.queriesInProgress;switch(c.type){case"success":case"data":case"buffer":case"info":case"error":if(c.queryKey&&f.has(c.queryKey)){const[d,m]=f.get(c.queryKey);c.type==="error"?m(c.error):d(c),f.delete(c.queryKey)}else if(c.type==="error")throw c.error;break;case"callback":const h=this.userCallbacks.get(c.name);h&&h(...c.args??[]);break;case"event":this.config.onConnect?.(c.reason);break}}}),Object.defineProperty(this,"createQuery",{enumerable:!0,configurable:!0,writable:!0,value:async u=>sr("shared",this.bypassMutationLock||u.type==="import"||u.type==="delete",this.config,async()=>{if(this.isDestroyed===!0)throw new Error("This SQLocal client has been destroyed. You will need to initialize a new client in order to make further queries.");const c=hr();return u.type==="import"?this.processor.postMessage({...u,queryKey:c},[u.database]):this.processor.postMessage({...u,queryKey:c}),new Promise((f,h)=>{this.queriesInProgress.set(c,[f,h])})})}),Object.defineProperty(this,"broadcast",{enumerable:!0,configurable:!0,writable:!0,value:u=>{this.reinitChannel.postMessage(u)}}),Object.defineProperty(this,"exec",{enumerable:!0,configurable:!0,writable:!0,value:async(u,c,f="all",h)=>{const d=await this.createQuery({type:"query",transactionKey:h,sql:u,params:c,method:f}),m={rows:[],columns:[]};return d.type==="data"&&(m.rows=d.data[0]?.rows??[],m.columns=d.data[0]?.columns??[]),m}}),Object.defineProperty(this,"execBatch",{enumerable:!0,configurable:!0,writable:!0,value:async u=>{const c=await this.createQuery({type:"batch",statements:u}),f=new Array(u.length).fill({rows:[],columns:[]});return c.type==="data"&&c.data.forEach((h,d)=>{f[d]=h}),f}}),Object.defineProperty(this,"sql",{enumerable:!0,configurable:!0,writable:!0,value:async(u,...c)=>{const f=fl(u,c),{rows:h,columns:d}=await this.exec(f.sql,f.params,"all");return Si(h,d)}}),Object.defineProperty(this,"batch",{enumerable:!0,configurable:!0,writable:!0,value:async u=>{const c=u(Pr);return(await this.execBatch(c)).map(({rows:h,columns:d})=>Si(h,d))}}),Object.defineProperty(this,"beginTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{const u=hr();await this.createQuery({type:"transaction",transactionKey:u,action:"begin"});const c=async m=>{const b=ul(m);if(b.exec)return this.transactionQueryKeyQueue.push(u),b.exec();const{rows:E,columns:C}=await this.exec(b.sql,b.params,"all",u);return Si(E,C)};return{query:c,sql:async(m,...b)=>{const E=fl(m,b);return await c(E)},commit:async()=>{await this.createQuery({type:"transaction",transactionKey:u,action:"commit"})},rollback:async()=>{await this.createQuery({type:"transaction",transactionKey:u,action:"rollback"})}}}}),Object.defineProperty(this,"transaction",{enumerable:!0,configurable:!0,writable:!0,value:async u=>sr("exclusive",!1,this.config,async()=>{let c;this.bypassMutationLock=!0;try{c=await this.beginTransaction();const f=await u({sql:c.sql,query:c.query});return await c.commit(),f}catch(f){throw await c?.rollback(),f}finally{this.bypassMutationLock=!1}})}),Object.defineProperty(this,"reactiveQuery",{enumerable:!0,configurable:!0,writable:!0,value:u=>{let c=[],f=!1,h=!1,d=0;const m=ul(u),b=new Set,E=new Set,C=new Set,A=async()=>{try{const S=++d;if(b.size===0){const j=await this.sql("SELECT name, wr FROM tables_used(?) WHERE type = 'table'",m.sql),_=new Set,T=new Set;if(j.forEach(O=>{typeof O.name=="string"&&(O.wr?T.add(O.name):_.add(O.name))}),_.size===0)throw new Error("The passed SQL does not read any tables.");if(Array.from(T).some(O=>_.has(O)))throw new Error("The passed SQL would mutate one or more of the tables that it reads. Doing this in a reactive query would create an infinite loop.");_.forEach(O=>b.add(O))}const F=m.exec?await m.exec():await this.sql(m.sql,...m.params);S===d&&(c=F,f=!0,E.forEach(j=>j(c)))}catch(S){C.forEach(F=>{F(S instanceof Error?S:new Error(String(S)))})}},I=S=>{S.data.tables.some(F=>b.has(F))&&A()};return{get value(){return c},subscribe:(S,F)=>{if(!this.effectsChannel)throw new Error('This SQLocal instance is not configured for reactive queries. Set the "reactive" option to enable them.');return F||(F=j=>{throw j}),E.add(S),C.add(F),h?f&&S(c):(this.effectsChannel.addEventListener("message",I),h=!0,A()),{unsubscribe:()=>{E.delete(S),C.delete(F),E.size===0&&(this.effectsChannel?.removeEventListener("message",I),h=!1)}}}}}}),Object.defineProperty(this,"createCallbackFunction",{enumerable:!0,configurable:!0,writable:!0,value:async(u,c)=>{await this.createQuery({type:"function",functionName:u,functionType:"callback"}),this.userCallbacks.set(u,c)}}),Object.defineProperty(this,"createScalarFunction",{enumerable:!0,configurable:!0,writable:!0,value:async(u,c)=>{const f=`_sqlocal_func_${u}`,h=()=>{this.proxy[f]=c};this.proxy===globalThis&&h(),await this.createQuery({type:"function",functionName:u,functionType:"scalar"}),this.proxy!==globalThis&&h()}}),Object.defineProperty(this,"createAggregateFunction",{enumerable:!0,configurable:!0,writable:!0,value:async(u,c)=>{const f=`_sqlocal_func_${u}`,h=()=>{this.proxy[`${f}_step`]=c.step,this.proxy[`${f}_final`]=c.final};this.proxy===globalThis&&h(),await this.createQuery({type:"function",functionName:u,functionType:"aggregate"}),this.proxy!==globalThis&&h()}}),Object.defineProperty(this,"getDatabaseInfo",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{const u=await this.createQuery({type:"getinfo"});if(u.type==="info")return u.info;throw new Error("The database failed to return valid information.")}}),Object.defineProperty(this,"getDatabaseFile",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{const u=await this.createQuery({type:"export"});if(u.type==="buffer")return new File([u.buffer],u.bufferName,{type:"application/x-sqlite3"});throw new Error("The database failed to export.")}}),Object.defineProperty(this,"overwriteDatabaseFile",{enumerable:!0,configurable:!0,writable:!0,value:async(u,c)=>{await sr("exclusive",!1,this.config,async()=>{try{this.broadcast({type:"close",clientKey:this.clientKey});const f=await Su(u,"buffer");await this.createQuery({type:"import",database:f}),typeof c=="function"&&(this.bypassMutationLock=!0,await c()),this.broadcast({type:"reinit",clientKey:this.clientKey,reason:"overwrite"})}finally{this.bypassMutationLock=!1}})}}),Object.defineProperty(this,"deleteDatabaseFile",{enumerable:!0,configurable:!0,writable:!0,value:async u=>{await sr("exclusive",!1,this.config,async()=>{try{this.broadcast({type:"close",clientKey:this.clientKey}),await this.createQuery({type:"delete"}),typeof u=="function"&&(this.bypassMutationLock=!0,await u()),this.broadcast({type:"reinit",clientKey:this.clientKey,reason:"delete"})}finally{this.bypassMutationLock=!1}})}}),Object.defineProperty(this,"destroy",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{await this.createQuery({type:"destroy"}),typeof globalThis.Worker<"u"&&this.processor instanceof Worker&&(this.processor.removeEventListener("message",this.processMessageEvent),this.processor.terminate()),this.queriesInProgress.clear(),this.userCallbacks.clear(),this.reinitChannel.close(),this.effectsChannel?.close(),this.isDestroyed=!0}}),Object.defineProperty(this,Cu,{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.destroy()}}),Object.defineProperty(this,Tu,{enumerable:!0,configurable:!0,writable:!0,value:async()=>{await this.destroy()}});const n=typeof t=="string"?{databasePath:t}:t,{onInit:s,onConnect:r,processor:i,...o}=n,{databasePath:a}=o;this.config=n,this.clientKey=hr();const l=_u(a,this.clientKey);if(this.reinitChannel=new BroadcastChannel(`_sqlocal_reinit_(${l})`),o.reactive&&(this.effectsChannel=new BroadcastChannel(`_sqlocal_effects_(${l})`)),typeof i<"u")this.processor=i;else if(a==="local"||a===":localStorage:"){const u=new dl("local");this.processor=new nr(u)}else if(a==="session"||a===":sessionStorage:"){const u=new dl("session");this.processor=new nr(u)}else if(typeof globalThis.Worker<"u"&&a!==":memory:")this.processor=new Worker(new URL("/assets/worker-uqNA2GAB.js",import.meta.url),{type:"module"});else{const u=new Lr;this.processor=new nr(u)}this.processor instanceof nr?(this.processor.onmessage=u=>this.processMessageEvent(u),this.proxy=globalThis):(this.processor.addEventListener("message",this.processMessageEvent),this.proxy=Oo(this.processor)),this.processor.postMessage({type:"config",config:{...o,clientKey:this.clientKey,onInitStatements:s?.(Pr)??[]}})}}Cu=Symbol.dispose,Tu=Symbol.asyncDispose;class Jy extends Gy{constructor(){super(...arguments),Object.defineProperty(this,"driver",{enumerable:!0,configurable:!0,writable:!0,value:async(t,n,s)=>{/^begin\b/i.test(t)&&typeof globalThis.sessionStorage<"u"&&!sessionStorage._sqlocal_sent_drizzle_transaction_warning&&(console.warn("Drizzle's transaction method cannot isolate transactions from outside queries. It is recommended to use the transaction method of SQLocalDrizzle instead (See https://sqlocal.dev/api/transaction#drizzle)."),sessionStorage._sqlocal_sent_drizzle_transaction_warning="1");const r=this.transactionQueryKeyQueue.shift();return this.exec(t,n,s,r)}}),Object.defineProperty(this,"batchDriver",{enumerable:!0,configurable:!0,writable:!0,value:async t=>this.execBatch(t)})}}const $r=Ks("debug_users",{id:Ut("id").primaryKey({autoIncrement:!0}),name:Ne("name").notNull(),email:Ne("email").notNull().unique(),createdAt:Ne("created_at").notNull()}),kr=Ks("debug_tasks",{id:Ut("id").primaryKey({autoIncrement:!0}),title:Ne("title").notNull(),description:Ne("description"),completed:Ut("completed").notNull().default(0),userId:Ut("user_id").notNull(),createdAt:Ne("created_at").notNull()}),Xy=Ks("debug_contexts",{id:Ut("id").primaryKey({autoIncrement:!0}),name:Ne("name").notNull(),description:Ne("description"),content:Ne("content").notNull(),createdAt:Ne("created_at").notNull()}),Yy=Ks("debug_replace_history",{id:Ut("id").primaryKey({autoIncrement:!0}),taskId:Ne("task_id").notNull(),originalMatch:Ne("original_match").notNull(),originalMatchType:Ne("original_match_type").notNull(),replacedWith:Ne("replaced_with").notNull(),replacedWithType:Ne("replaced_with_type").notNull(),ruleId:Ut("rule_id").notNull(),createdAt:Ne("created_at").notNull()}),rn=Ks("replace_rules",{id:Ut("id").primaryKey({autoIncrement:!0}),note:Ne("note"),matchType:Ne("match_type").notNull(),matchValue:Ne("match_value").notNull(),targetValue:Ne("target_value").notNull(),createdAt:Ne("created_at").notNull()}),Zy=hu($r,({many:e})=>({tasks:e(kr)})),eb=hu(kr,({one:e})=>({user:e($r,{fields:[kr.userId],references:[$r.id]})})),tb=Object.freeze(Object.defineProperty({__proto__:null,debugContexts:Xy,debugReplaceHistory:Yy,debugTasks:kr,debugTasksRelations:eb,debugUsers:$r,debugUsersRelations:Zy,replaceRules:rn},Symbol.toStringTag,{value:"Module"})),nb="context-replace.sqlite3";let pn=null,Nn=null,ks=!1,Lo=!1;async function Po(){if(ks&&pn)return console.log("Database already initialized"),pn;try{console.log("🔄 Initializing database..."),Nn=new Jy(nb);let e=0;const t=20;for(;esetTimeout(r,1500))):await new Promise(r=>setTimeout(r,500)),e>=t)throw console.error("❌ 初始化超时"),new Error("数据库初始化超时,请刷新页面重试")}return await Nn.sql`PRAGMA journal_mode = WAL`,await Nn.sql`PRAGMA synchronous = NORMAL`,pn=My(Nn.driver,{schema:tb}),ks=!0,console.log("✅ Database initialized successfully"),pn}catch(e){throw console.error("❌ Failed to initialize database:",e),e}}async function Kn(){return pn||await Po()}async function Eu(){try{console.log("Running migrations...");const e=await Kn();if(!e)throw new Error("Database not initialized");await e.run(v` CREATE TABLE IF NOT EXISTS debug_users ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT NOT NULL UNIQUE, created_at TEXT NOT NULL ) `),await e.run(v` CREATE TABLE IF NOT EXISTS debug_tasks ( id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT NOT NULL, description TEXT, completed INTEGER NOT NULL DEFAULT 0, user_id INTEGER NOT NULL, created_at TEXT NOT NULL, FOREIGN KEY (user_id) REFERENCES debug_users (id) ) `),await e.run(v` CREATE TABLE IF NOT EXISTS debug_contexts ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, description TEXT, content TEXT NOT NULL, created_at TEXT NOT NULL ) `),await e.run(v`CREATE INDEX IF NOT EXISTS idx_debug_tasks_user_id ON debug_tasks(user_id)`),await e.run(v`CREATE INDEX IF NOT EXISTS idx_debug_contexts_created_at ON debug_contexts(created_at)`),await e.run(v` CREATE TABLE IF NOT EXISTS debug_replace_history ( id INTEGER PRIMARY KEY AUTOINCREMENT, task_id TEXT NOT NULL, original_match TEXT NOT NULL, original_match_type TEXT NOT NULL, replaced_with TEXT NOT NULL, replaced_with_type TEXT NOT NULL, rule_id INTEGER NOT NULL, created_at TEXT NOT NULL ) `),await e.run(v` CREATE TABLE IF NOT EXISTS replace_rules ( id INTEGER PRIMARY KEY AUTOINCREMENT, note TEXT, match_type TEXT NOT NULL, match_value TEXT NOT NULL, target_value TEXT NOT NULL, created_at TEXT NOT NULL ) `),console.log("Migrations completed successfully with Drizzle"),Lo=!0}catch(e){throw console.error("Failed to run migrations:",e),e}}async function Yv(){try{const e=await Kn();if(!e)throw new Error("Database not initialized");await e.run(v`DROP TABLE IF EXISTS debug_replace_history`),await e.run(v`DROP TABLE IF EXISTS debug_contexts`),await e.run(v`DROP TABLE IF EXISTS debug_tasks`),await e.run(v`DROP TABLE IF EXISTS debug_users`),console.log("Database reset completed with Drizzle"),ks=!1}catch(e){throw console.error("Failed to reset database:",e),e}}function hl(){try{Nn&&(Nn=null,pn=null,ks=!1,Lo=!1,console.log("✅ Database connection closed"))}catch(e){console.error("Failed to close database:",e)}}function sb(){return ks&&Lo&&pn!==null}typeof window<"u"&&(window.addEventListener("beforeunload",()=>{hl()}),window.addEventListener("pagehide",()=>{hl()}));const Ru=ph("rules",()=>{const e=ae([]),t=ae(!1),n=async()=>{t.value=!0;try{sb()||(console.warn("Database not ready, waiting for initialization..."),await new Promise(u=>setTimeout(u,100)));const a=await Kn();if(!a)return;const l=await a.select().from(rn).orderBy(uu(rn.createdAt));e.value=l.map(u=>({id:u.id,note:u.note||void 0,matchType:u.matchType,matchValue:u.matchValue,targetValue:u.targetValue,createdAt:u.createdAt}))}catch(a){console.error("Failed to load rules:",a)}finally{t.value=!1}},s=async a=>{try{const l=await Kn();if(!l)return;const u={...a,createdAt:new Date().toISOString()},c=await l.insert(rn).values(u).returning();if(c.length>0)return await n(),c[0]}catch(l){throw console.error("Failed to add rule:",l),l}};return{rules:e,isLoading:t,loadRules:n,addRule:s,updateRule:async(a,l)=>{try{const u=await Kn();if(!u)return;await u.update(rn).set(l).where(Tr(rn.id,a)),await n()}catch(u){throw console.error("Failed to update rule:",u),u}},deleteRule:async a=>{try{const l=await Kn();if(!l)return;await l.delete(rn).where(Tr(rn.id,a)),await n()}catch(l){throw console.error("Failed to delete rule:",l),l}},initializeDefaultRules:async()=>{if(localStorage.getItem("ruleConfigFirstUse")===null){const l=[{note:"eg. Windows user path",matchType:"fixed",matchValue:"C:\\Users\\you\\",targetValue:"C:\\Users\\samaltman\\"},{note:"eg. Linux user path",matchType:"fixed",matchValue:"/home/you/",targetValue:"/home/samaltman/"},{note:"eg. SSN",matchType:"regex",matchValue:"\\d{3}-\\d{2}-\\d{4}",targetValue:"***-**-****"}];for(const u of l)await s(u)}}}}),ms=["en-US","zh-CN","ja-JP","zh-TW","ko-KR","es-ES","de-DE","fr-FR","ru-RU","ar-SA","pt-PT"],rb={"en-US":"English","zh-CN":"简体中文","ja-JP":"日本語","zh-TW":"繁體中文","ko-KR":"한국어","es-ES":"Español","de-DE":"Deutsch","fr-FR":"Français","ru-RU":"Русский","ar-SA":"العربية","pt-PT":"Português"},ib={"en-US":{welcome:"Welcome",hello:"Hello",replace:"Replace",rawInput:"Raw Input",clear:"Clear",pasteCodePlaceholder:"Paste your context here...",processedResult:"Result",replacements:e=>`${e} replacements`,autoCopy:"Auto copy",copy:"Copy",waitingForInput:"Waiting for input...",configImported:"Configuration imported!",invalidConfig:"Invalid configuration format",importFailed:"Import configuration failed",replaceCompleted:e=>`Replacement completed, ${e} changes`,copiedToClipboard:"Copied to clipboard!",copyFailed:"Copy failed, please copy manually",initFailed:"System initialization failed, please refresh the page",ruleConfig:"Rule Configuration",import:"Import",export:"Export",text:"Text",regex:"Regex",matchValue:"Match value",replaceWith:"Replace with",note:"Note",addRule:"Add rule",noRules:"No rules yet, please add above",edit:"Edit",delete:"Delete",match:"Match",save:"Save",cancel:"Cancel",configRulesFirst:"Please configure rules first",confirmDeleteRule:"Are you sure to delete this rule?",noRulesToExport:"No rules to export",configCopied:"Configuration copied to clipboard!",copyFailedManual:"Failed to write to clipboard, please copy manually.",pasteConfigCode:"Cannot read clipboard directly, please paste configuration code:",clipboardNotConfig:"Clipboard content does not seem to be configuration code, please paste manually:",importCompleted:(e,t)=>`Import completed. Successfully added: ${e} entries Skipped existing: ${t} entries`,importFailedFormat:"Import failed: incorrect content format.",readClipboardImport:"Read clipboard content and import",exportConfigClipboard:"Export configuration to clipboard",matchType:"Match type",empty:"(Empty)",offlineFunction:"Offline function",offlineTooltip:"All features on this page work entirely offline.",shortcutReplace:"Shortcut: Ctrl+Enter",previousItem:"Previous (Ctrl+↑)",nextItem:"Next (Ctrl+↓)",collapse:"Collapse",expand:"Expand"},"zh-CN":{welcome:"欢迎",hello:"你好",replace:"替换",rawInput:"原始输入",clear:"清空",pasteCodePlaceholder:"在此粘贴...",processedResult:"替换结果",replacements:e=>`${e} 处替换`,autoCopy:"自动复制",copy:"复制",waitingForInput:"等待输入...",configImported:"配置已导入!",invalidConfig:"无效的配置格式",importFailed:"导入配置失败",replaceCompleted:e=>`替换完成,共 ${e} 处变更`,copiedToClipboard:"已复制到剪贴板!",copyFailed:"复制失败,请手动复制",initFailed:"系统初始化失败,请刷新页面",ruleConfig:"规则配置",import:"导入",export:"导出",text:"文本",regex:"正则",matchValue:"匹配值",replaceWith:"替换为",note:"备注",addRule:"添加规则",noRules:"暂无规则,请在上方添加",edit:"编辑",delete:"删除",match:"匹配",save:"保存",cancel:"取消",configRulesFirst:"请先配置规则吧",confirmDeleteRule:"确定删除此规则?",noRulesToExport:"当前没有规则可导出",configCopied:"配置已复制到剪切板!",copyFailedManual:"写入剪切板失败,请手动复制。",pasteConfigCode:"无法直接读取剪切板,请粘贴配置代码:",clipboardNotConfig:"剪切板内容似乎不是配置代码,请手动粘贴:",importCompleted:(e,t)=>`导入完成。 成功添加:${e} 条 已存在跳过:${t} 条`,importFailedFormat:"导入失败:内容格式不正确。",readClipboardImport:"读取剪切板内容并导入",exportConfigClipboard:"导出配置到剪切板",matchType:"匹配类型",empty:"(空)",offlineFunction:"离线功能",offlineTooltip:"本页面功能完全不联网",shortcutReplace:"快捷键: Ctrl+Enter",previousItem:"上一个 (Ctrl+↑)",nextItem:"下一个 (Ctrl+↓)",collapse:"收起",expand:"展开"},"ja-JP":{welcome:"ようこそ",hello:"こんにちは",replace:"置き換える",rawInput:"生の入力",clear:"クリア",pasteCodePlaceholder:"ここにコードを貼り付...",processedResult:"処理結果",replacements:e=>`${e} 個の置換`,autoCopy:"自動コピー",copy:"コピー",waitingForInput:"入力を待っています...",configImported:"設定がインポートされました!",invalidConfig:"無効な設定形式",importFailed:"設定のインポートに失敗しました",replaceCompleted:e=>`置換完了、${e} 個の変更`,copiedToClipboard:"クリップボードにコピーしました!",copyFailed:"コピーに失敗しました、手動でコピーしてください",initFailed:"システム初期化に失敗しました、ページを更新してください",ruleConfig:"ルール設定",import:"インポート",export:"エクスポート",text:"テキスト",regex:"正規表現",matchValue:"一致値",replaceWith:"置き換え先",note:"メモ",addRule:"ルールを追加",noRules:"ルールがありません、上記で追加してください",edit:"編集",delete:"削除",match:"一致",save:"保存",cancel:"キャンセル",configRulesFirst:"まずルールを設定してください",confirmDeleteRule:"このルールを削除してもよろしいですか?",noRulesToExport:"エクスポートするルールがありません",configCopied:"設定がクリップボードにコピーされました!",copyFailedManual:"クリップボードへの書き込みに失敗しました、手動でコピーしてください。",pasteConfigCode:"クリップボードを直接読み取れません、設定コードを貼り付けてください:",clipboardNotConfig:"クリップボードの内容が設定コードではないようです、手動で貼り付けてください:",importCompleted:(e,t)=>`インポート完了。 正常に追加: ${e} 件 既存をスキップ: ${t} 件`,importFailedFormat:"インポート失敗: 内容形式が正しくありません。",readClipboardImport:"クリップボードの内容を読み取ってインポート",exportConfigClipboard:"設定をクリップボードにエクスポート",matchType:"一致タイプ",empty:"(空)",offlineFunction:"オフライン機能",offlineTooltip:"完全にオフラインの機能",shortcutReplace:"ショートカット: Ctrl+Enter",previousItem:"前へ (Ctrl+↑)",nextItem:"次へ (Ctrl+↓)",collapse:"折りたたむ",expand:"展開する"},"zh-TW":{welcome:"歡迎",hello:"你好",replace:"替換",rawInput:"原始輸入",clear:"清空",pasteCodePlaceholder:"在此貼上...",processedResult:"替換結果",replacements:e=>`${e} 處替換`,autoCopy:"自動複製",copy:"複製",waitingForInput:"等待輸入...",configImported:"配置已匯入!",invalidConfig:"無效的配置格式",importFailed:"匯入配置失敗",replaceCompleted:e=>`替換完成,共 ${e} 處變更`,copiedToClipboard:"已複製到剪貼簿!",copyFailed:"複製失敗,請手動複製",initFailed:"系統初始化失敗,請重新整理頁面",ruleConfig:"規則配置",import:"匯入",export:"匯出",text:"文字",regex:"正則",matchValue:"匹配值",replaceWith:"替換為",note:"備註",addRule:"新增規則",noRules:"暫無規則,請在上方新增",edit:"編輯",delete:"刪除",match:"匹配",save:"儲存",cancel:"取消",configRulesFirst:"請先配置規則吧",confirmDeleteRule:"確定刪除此規則?",noRulesToExport:"目前沒有規則可匯出",configCopied:"配置已複製到剪貼簿!",copyFailedManual:"寫入剪貼簿失敗,請手動複製。",pasteConfigCode:"無法直接讀取剪貼簿,請貼上配置代碼:",clipboardNotConfig:"剪貼簿內容似乎不是配置代碼,請手動貼上:",importCompleted:(e,t)=>`匯入完成。 成功新增:${e} 條 已存在跳過:${t} 條`,importFailedFormat:"匯入失敗:內容格式不正確。",readClipboardImport:"讀取剪貼簿內容並匯入",exportConfigClipboard:"匯出配置到剪貼簿",matchType:"匹配類型",empty:"(空)",offlineFunction:"離線功能",offlineTooltip:"本頁面功能完全不連網",shortcutReplace:"快捷鍵: Ctrl+Enter",previousItem:"上一個 (Ctrl+↑)",nextItem:"下一個 (Ctrl+↓)",collapse:"收起",expand:"展開"},"ko-KR":{welcome:"환영합니다",hello:"안녕하세요",replace:"교체",rawInput:"원본 입력",clear:"지우기",pasteCodePlaceholder:"여기에 코드를 붙여넣으세요...",processedResult:"처리 결과",replacements:e=>`${e}개 교체`,autoCopy:"자동 복사",copy:"복사",waitingForInput:"입력을 기다리는 중...",configImported:"설정이 가져오기되었습니다!",invalidConfig:"잘못된 설정 형식",importFailed:"설정 가져오기 실패",replaceCompleted:e=>`교체 완료, ${e}개 변경`,copiedToClipboard:"클립보드에 복사되었습니다!",copyFailed:"복사 실패, 수동으로 복사해주세요",initFailed:"시스템 초기화 실패, 페이지를 새로고침해주세요",ruleConfig:"규칙 설정",import:"가져오기",export:"내보내기",text:"텍스트",regex:"정규식",matchValue:"일치 값",replaceWith:"교체 대상",note:"메모",addRule:"규칙 추가",noRules:"규칙이 없습니다, 위에서 추가해주세요",edit:"편집",delete:"삭제",match:"일치",save:"저장",cancel:"취소",configRulesFirst:"먼저 규칙을 설정해주세요",confirmDeleteRule:"이 규칙을 삭제하시겠습니까?",noRulesToExport:"내보낼 규칙이 없습니다",configCopied:"설정이 클립보드에 복사되었습니다!",copyFailedManual:"클립보드 쓰기 실패, 수동으로 복사해주세요.",pasteConfigCode:"클립보드를 직접 읽을 수 없습니다, 설정 코드를 붙여넣으세요:",clipboardNotConfig:"클립보드 내용이 설정 코드가 아닌 것 같습니다, 수동으로 붙여넣으세요:",importCompleted:(e,t)=>`가져오기 완료. 성공적으로 추가: ${e}개 기존 항목 건너뛰기: ${t}개`,importFailedFormat:"가져오기 실패: 내용 형식이 올바르지 않습니다.",readClipboardImport:"클립보드 내용을 읽어서 가져오기",exportConfigClipboard:"설정을 클립보드로 내보내기",matchType:"일치 유형",empty:"(비어있음)",offlineFunction:"오프라인 기능",offlineTooltip:"이 페이지의 모든 기능은 완전히 오프라인으로 작동합니다.",shortcutReplace:"단축키: Ctrl+Enter",previousItem:"이전 (Ctrl+↑)",nextItem:"다음 (Ctrl+↓)",collapse:"접기",expand:"펼치기"},"es-ES":{welcome:"Bienvenido",hello:"Hola",replace:"Reemplazar",rawInput:"Entrada original",clear:"Limpiar",pasteCodePlaceholder:"Pega tu contexto aquí...",processedResult:"Resultado",replacements:e=>`${e} reemplazos`,autoCopy:"Copiar automáticamente",copy:"Copiar",waitingForInput:"Esperando entrada...",configImported:"¡Configuración importada!",invalidConfig:"Formato de configuración inválido",importFailed:"Falló la importación de configuración",replaceCompleted:e=>`Reemplazo completado, ${e} cambios`,copiedToClipboard:"¡Copiado al portapapeles!",copyFailed:"Falló la copia, por favor copia manualmente",initFailed:"Falló la inicialización del sistema, por favor recarga la página",ruleConfig:"Configuración de reglas",import:"Importar",export:"Exportar",text:"Texto",regex:"Expresión regular",matchValue:"Valor de coincidencia",replaceWith:"Reemplazar con",note:"Nota",addRule:"Añadir regla",noRules:"Sin reglas aún, por favor añade arriba",edit:"Editar",delete:"Eliminar",match:"Coincidencia",save:"Guardar",cancel:"Cancelar",configRulesFirst:"Por favor configura las reglas primero",confirmDeleteRule:"¿Estás seguro de eliminar esta regla?",noRulesToExport:"No hay reglas para exportar",configCopied:"¡Configuración copiada al portapapeles!",copyFailedManual:"Falló escribir al portapapeles, por favor copia manualmente.",pasteConfigCode:"No se puede leer el portapapeles directamente, por favor pega el código de configuración:",clipboardNotConfig:"El contenido del portapapeles no parece ser código de configuración, por favor pega manualmente:",importCompleted:(e,t)=>`Importación completada. Añadidos exitosamente: ${e} entradas Existentes omitidos: ${t} entradas`,importFailedFormat:"Falló la importación: formato de contenido incorrecto.",readClipboardImport:"Leer contenido del portapapeles e importar",exportConfigClipboard:"Exportar configuración al portapapeles",matchType:"Tipo de coincidencia",empty:"(Vacío)",offlineFunction:"Función sin conexión",offlineTooltip:"Todas las funciones de esta página funcionan completamente sin conexión.",shortcutReplace:"Atajo: Ctrl+Enter",previousItem:"Anterior (Ctrl+↑)",nextItem:"Siguiente (Ctrl+↓)",collapse:"Contraer",expand:"Expandir"},"de-DE":{welcome:"Willkommen",hello:"Hallo",replace:"Ersetzen",rawInput:"Originaleingabe",clear:"Löschen",pasteCodePlaceholder:"Fügen Sie Ihren Kontext hier ein...",processedResult:"Ergebnis",replacements:e=>`${e} Ersetzungen`,autoCopy:"Automatisch kopieren",copy:"Kopieren",waitingForInput:"Warte auf Eingabe...",configImported:"Konfiguration importiert!",invalidConfig:"Ungültiges Konfigurationsformat",importFailed:"Konfigurationsimport fehlgeschlagen",replaceCompleted:e=>`Ersetzung abgeschlossen, ${e} Änderungen`,copiedToClipboard:"In die Zwischenablage kopiert!",copyFailed:"Kopieren fehlgeschlagen, bitte manuell kopieren",initFailed:"Systeminitialisierung fehlgeschlagen, bitte Seite neu laden",ruleConfig:"Regelkonfiguration",import:"Importieren",export:"Exportieren",text:"Text",regex:"Regulärer Ausdruck",matchValue:"Übereinstimmungswert",replaceWith:"Ersetzen mit",note:"Notiz",addRule:"Regel hinzufügen",noRules:"Keine Regeln vorhanden, bitte oben hinzufügen",edit:"Bearbeiten",delete:"Löschen",match:"Übereinstimmung",save:"Speichern",cancel:"Abbrechen",configRulesFirst:"Bitte konfigurieren Sie zuerst die Regeln",confirmDeleteRule:"Sind Sie sicher, dass Sie diese Regel löschen möchten?",noRulesToExport:"Keine Regeln zum Exportieren vorhanden",configCopied:"Konfiguration in die Zwischenablage kopiert!",copyFailedManual:"Schreiben in die Zwischenablage fehlgeschlagen, bitte manuell kopieren.",pasteConfigCode:"Kann die Zwischenablage nicht direkt lesen, bitte Konfigurationscode einfügen:",clipboardNotConfig:"Zwischenablageninhalt scheint kein Konfigurationscode zu sein, bitte manuell einfügen:",importCompleted:(e,t)=>`Import abgeschlossen. Erfolgreich hinzugefügt: ${e} Einträge Vorhandene übersprungen: ${t} Einträge`,importFailedFormat:"Import fehlgeschlagen: falsches Inhaltsformat.",readClipboardImport:"Zwischenablageninhalt lesen und importieren",exportConfigClipboard:"Konfiguration in die Zwischenablage exportieren",matchType:"Übereinstimmungstyp",empty:"(Leer)",offlineFunction:"Offline-Funktion",offlineTooltip:"Alle Funktionen auf dieser Seite arbeiten vollständig offline.",shortcutReplace:"Verknüpfung: Ctrl+Enter",previousItem:"Vorherige (Ctrl+↑)",nextItem:"Nächste (Ctrl+↓)",collapse:"Einklappen",expand:"Ausklappen"},"fr-FR":{welcome:"Bienvenue",hello:"Bonjour",replace:"Remplacer",rawInput:"Entrée brute",clear:"Effacer",pasteCodePlaceholder:"Collez votre contexte ici...",processedResult:"Résultat",replacements:e=>`${e} remplacements`,autoCopy:"Copie automatique",copy:"Copier",waitingForInput:"En attente d'entrée...",configImported:"Configuration importée !",invalidConfig:"Format de configuration invalide",importFailed:"Échec de l'importation de la configuration",replaceCompleted:e=>`Remplacement terminé, ${e} modifications`,copiedToClipboard:"Copié dans le presse-papiers !",copyFailed:"Échec de la copie, veuillez copier manuellement",initFailed:"Échec de l'initialisation du système, veuillez recharger la page",ruleConfig:"Configuration des règles",import:"Importer",export:"Exporter",text:"Texte",regex:"Expression régulière",matchValue:"Valeur de correspondance",replaceWith:"Remplacer par",note:"Note",addRule:"Ajouter une règle",noRules:"Aucune règle pour le moment, veuillez en ajouter ci-dessus",edit:"Modifier",delete:"Supprimer",match:"Correspondance",save:"Enregistrer",cancel:"Annuler",configRulesFirst:"Veuillez configurer les règles d'abord",confirmDeleteRule:"Êtes-vous sûr de supprimer cette règle ?",noRulesToExport:"Aucune règle à exporter",configCopied:"Configuration copiée dans le presse-papiers !",copyFailedManual:"Échec de l'écriture dans le presse-papiers, veuillez copier manuellement.",pasteConfigCode:"Impossible de lire le presse-papiers directement, veuillez coller le code de configuration :",clipboardNotConfig:"Le contenu du presse-papiers ne semble pas être du code de configuration, veuillez coller manuellement :",importCompleted:(e,t)=>`Importation terminée. Ajoutés avec succès : ${e} entrées Existants ignorés : ${t} entrées`,importFailedFormat:"Échec de l'importation : format de contenu incorrect.",readClipboardImport:"Lire le contenu du presse-papiers et importer",exportConfigClipboard:"Exporter la configuration vers le presse-papiers",matchType:"Type de correspondance",empty:"(Vide)",offlineFunction:"Fonction hors ligne",offlineTooltip:"Toutes les fonctionnalités de cette page fonctionnent entièrement hors ligne.",shortcutReplace:"Raccourci : Ctrl+Entrée",previousItem:"Précédent (Ctrl+↑)",nextItem:"Suivant (Ctrl+↓)",collapse:"Réduire",expand:"Développer"},"ru-RU":{welcome:"Добро пожаловать",hello:"Привет",replace:"Заменить",rawInput:"Исходный ввод",clear:"Очистить",pasteCodePlaceholder:"Вставьте ваш контекст сюда...",processedResult:"Результат",replacements:e=>`${e} замен`,autoCopy:"Автоматическое копирование",copy:"Копировать",waitingForInput:"Ожидание ввода...",configImported:"Конфигурация импортирована!",invalidConfig:"Неверный формат конфигурации",importFailed:"Не удалось импортировать конфигурацию",replaceCompleted:e=>`Замена завершена, ${e} изменений`,copiedToClipboard:"Скопировано в буфер обмена!",copyFailed:"Не удалось скопировать, пожалуйста, скопируйте вручную",initFailed:"Не удалось инициализировать систему, пожалуйста, обновите страницу",ruleConfig:"Настройка правил",import:"Импорт",export:"Экспорт",text:"Текст",regex:"Регулярное выражение",matchValue:"Значение совпадения",replaceWith:"Заменить на",note:"Примечание",addRule:"Добавить правило",noRules:"Правил пока нет, пожалуйста, добавьте выше",edit:"Редактировать",delete:"Удалить",match:"Совпадение",save:"Сохранить",cancel:"Отмена",configRulesFirst:"Пожалуйста, сначала настройте правила",confirmDeleteRule:"Вы уверены, что хотите удалить это правило?",noRulesToExport:"Нет правил для экспорта",configCopied:"Конфигурация скопирована в буфер обмена!",copyFailedManual:"Не удалось записать в буфер обмена, пожалуйста, скопируйте вручную.",pasteConfigCode:"Невозможно прочитать буфер обмена напрямую, пожалуйста, вставьте код конфигурации:",clipboardNotConfig:"Содержимое буфера обмена не похоже на код конфигурации, пожалуйста, вставьте вручную:",importCompleted:(e,t)=>`Импорт завершен. Успешно добавлено: ${e} записей Существующие пропущены: ${t} записей`,importFailedFormat:"Не удалось импортировать: неверный формат содержимого.",readClipboardImport:"Прочитать содержимое буфера обмена и импортировать",exportConfigClipboard:"Экспортировать конфигурацию в буфер обмена",matchType:"Тип совпадения",empty:"(Пусто)",offlineFunction:"Офлайн-функция",offlineTooltip:"Все функции на этой странице работают полностью офлайн.",shortcutReplace:"Горячая клавиша: Ctrl+Enter",previousItem:"Предыдущий (Ctrl+↑)",nextItem:"Следующий (Ctrl+↓)",collapse:"Свернуть",expand:"Развернуть"},"ar-SA":{welcome:"مرحباً",hello:"أهلاً",replace:"استبدال",rawInput:"الإدخال الأصلي",clear:"مسح",pasteCodePlaceholder:"الصق سياقك هنا...",processedResult:"النتيجة",replacements:e=>`${e} استبدالات`,autoCopy:"نسخ تلقائي",copy:"نسخ",waitingForInput:"في انتظار الإدخال...",configImported:"تم استيراد التكوين!",invalidConfig:"تنسيق تكوين غير صالح",importFailed:"فشل استيراد التكوين",replaceCompleted:e=>`اكتمل الاستبدال، ${e} تغييرات`,copiedToClipboard:"تم النسخ إلى الحافظة!",copyFailed:"فشل النسخ، يرجى النسخ يدوياً",initFailed:"فشل تهيئة النظام، يرجى تحديث الصفحة",ruleConfig:"تكوين القواعد",import:"استيراد",export:"تصدير",text:"نص",regex:"تعبير نمطي",matchValue:"قيمة المطابقة",replaceWith:"استبدال بـ",note:"ملاحظة",addRule:"إضافة قاعدة",noRules:"لا توجد قواعد بعد، يرجى الإضافة أعلاه",edit:"تحرير",delete:"حذف",match:"مطابقة",save:"حفظ",cancel:"إلغاء",configRulesFirst:"يرجى تكوين القواعد أولاً",confirmDeleteRule:"هل أنت متأكد من حذف هذه القاعدة؟",noRulesToExport:"لا توجد قواعد للتصدير",configCopied:"تم نسخ التكوين إلى الحافظة!",copyFailedManual:"فشل الكتابة إلى الحافظة، يرجى النسخ يدوياً.",pasteConfigCode:"لا يمكن قراءة الحافظة مباشرة، يرجى لصق رمز التكوين:",clipboardNotConfig:"محتوى الحافظة لا يبدو أنه رمز تكوين، يرجى اللصق يدوياً:",importCompleted:(e,t)=>`اكتمل الاستيراد. تمت الإضافة بنجاح: ${e} إدخالات تم تخطي الموجود: ${t} إدخالات`,importFailedFormat:"فشل الاستيراد: تنسيق المحتوى غير صحيح.",readClipboardImport:"قراءة محتوى الحافظة واستيراده",exportConfigClipboard:"تصدير التكوين إلى الحافظة",matchType:"نوع المطابقة",empty:"(فارغ)",offlineFunction:"وظيفة غير متصلة",offlineTooltip:"جميع الوظائف في هذه الصفحة تعمل بشكل كامل غير متصل بالإنترنت.",shortcutReplace:"اختصار: Ctrl+Enter",previousItem:"السابق (Ctrl+↑)",nextItem:"التالي (Ctrl+↓)"},"pt-PT":{welcome:"Bem-vindo",hello:"Olá",replace:"Substituir",rawInput:"Entrada original",clear:"Limpar",pasteCodePlaceholder:"Cole seu contexto aqui...",processedResult:"Resultado",replacements:e=>`${e} substituições`,autoCopy:"Copiar automaticamente",copy:"Copiar",waitingForInput:"Aguardando entrada...",configImported:"Configuração importada!",invalidConfig:"Formato de configuração inválido",importFailed:"Falha na importação da configuração",replaceCompleted:e=>`Substituição concluída, ${e} alterações`,copiedToClipboard:"Copiado para a área de transferência!",copyFailed:"Falha na cópia, por favor copie manualmente",initFailed:"Falha na inicialização do sistema, por favor recarregue a página",ruleConfig:"Configuração de regras",import:"Importar",export:"Exportar",text:"Texto",regex:"Expressão regular",matchValue:"Valor de correspondência",replaceWith:"Substituir por",note:"Nota",addRule:"Adicionar regra",noRules:"Nenhuma regra ainda, por favor adicione acima",edit:"Editar",delete:"Excluir",match:"Correspondência",save:"Salvar",cancel:"Cancelar",configRulesFirst:"Por favor configure as regras primeiro",confirmDeleteRule:"Tem certeza de que deseja excluir esta regra?",noRulesToExport:"Nenhuma regra para exportar",configCopied:"Configuração copiada para a área de transferência!",copyFailedManual:"Falha ao escrever na área de transferência, por favor copie manualmente.",pasteConfigCode:"Não é possível ler a área de transferência diretamente, por favor cole o código de configuração:",clipboardNotConfig:"O conteúdo da área de transferência não parece ser código de configuração, por favor cole manualmente:",importCompleted:(e,t)=>`Importação concluída. Adicionados com sucesso: ${e} entradas Existentes ignorados: ${t} entradas`,importFailedFormat:"Falha na importação: formato de conteúdo incorreto.",readClipboardImport:"Ler conteúdo da área de transferência e importar",exportConfigClipboard:"Exportar configuração para a área de transferência",matchType:"Tipo de correspondência",empty:"(Vazio)",offlineFunction:"Função offline",offlineTooltip:"Todas as funcionalidades desta página funcionam completamente offline.",shortcutReplace:"Atalho: Ctrl+Enter",previousItem:"Anterior (Ctrl+↑)",nextItem:"Próximo (Ctrl+↓)",collapse:"Recolher",expand:"Expandir"}},Nu="app-locale";function ob(){const e=navigator.languages||[navigator.language];for(const t of e){const n=t.toLowerCase(),s=ms.find(o=>o.toLowerCase()===n);if(s)return s;const r=n.split("-")[0],i=ms.find(o=>o.toLowerCase().startsWith(r||""));return i||ms[0]}return ms[0]}const _i=ae(localStorage.getItem(Nu)||ob());function $o(){const e=se(()=>_i.value),t=se(()=>new Proxy({},{get:(r,i)=>{const o=ib?.[_i.value]?.[i];return o||console.debug(`i18n: ${i} is not exist.`),o||i}})),n=r=>{_i.value=r,localStorage.setItem(Nu,r),document.documentElement.lang=r},s=se(()=>ms.map(r=>({code:r,name:rb[r]})));return{locale:e,t,setLocale:n,availableLocales:s}}const ab=["open"],lb={class:"list-none flex items-center justify-between cursor-pointer select-none p-1"},cb={class:"flex items-center gap-2 text-lg font-semibold text-foreground"},ub=["title"],fb=["title"],db={class:"space-y-2 p-2"},hb={class:"border border-green-200 rounded p-1 dark:bg-gray-300/30"},pb=["title"],mb={value:"fixed"},gb={value:"regex"},yb={class:"flex-1 relative"},bb=["placeholder"],vb={class:"flex-1 relative"},wb=["placeholder"],xb=["placeholder"],Sb=["disabled","title"],_b={class:"space-y-1"},Cb={key:0,class:"text-center text-foreground-secondary text-sm py-2"},Tb={key:0,class:"flex justify-start items-center gap-2 py-0.5 pl-2"},Eb=["title"],Rb={class:"truncate text-sm font-mono bg-pink-200/36 dark:bg-pink-300/60 rounded px-1"},Nb=["title"],Ab={class:"truncate text-sm font-mono bg-green-300/33 dark:bg-green-600/30 rounded px-1"},Ib=["title"],Ob={class:"flex gap-1 shrink-0 opacity-0 group-hover/item:opacity-100 transition-opacity"},Lb=["onClick","title"],Pb=["onClick","title"],$b=["onSubmit"],kb=["onUpdate:modelValue"],Mb=["onUpdate:modelValue","placeholder"],Fb=["onUpdate:modelValue","placeholder"],Bb=["onUpdate:modelValue","placeholder"],Db=["title"],qb=["onClick","title"],jb=et({__name:"RuleConfig",setup(e){const t=Di("context-replace-rule-config-open",!1),n=Ru(),s=ae(!1),{t:r}=$o(),i=is({note:"",matchType:"fixed",matchValue:"",targetValue:""});Pt(async()=>{await n.loadRules(),localStorage.getItem("ruleConfigFirstUse")===null&&(await n.initializeDefaultRules(),t.value=!0,localStorage.setItem("ruleConfigFirstUse","used"),ps(r.configRulesFirst))});const o=async()=>{if(i.matchValue.trim()){s.value=!0;try{await n.addRule({note:i.note||void 0,matchType:i.matchType,matchValue:i.matchValue,targetValue:i.targetValue}),i.note="",i.matchValue="",i.targetValue=""}catch(d){console.error("Failed to add rule:",d)}finally{s.value=!1}}},a=d=>{d.isEditing=!0,d.editNote=d.note||"",d.editMatchType=d.matchType,d.editMatchValue=d.matchValue,d.editTargetValue=d.targetValue},l=d=>{d.isEditing=!1},u=async d=>{if(d.editMatchValue?.trim()){d.isUpdating=!0;try{await n.updateRule(d.id,{note:d.editNote||void 0,matchType:d.editMatchType,matchValue:d.editMatchValue,targetValue:d.editTargetValue}),d.isEditing=!1}finally{d.isUpdating=!1}}},c=async d=>{await n.deleteRule(d)},f=async()=>{const d=n.rules;if(d.length===0){alert("no rules to export.");return}const m={version:1,rules:d.map(C=>({note:C.note,matchType:C.matchType,matchValue:C.matchValue,targetValue:C.targetValue}))},E=`context-replace://import/${JSON.stringify(m)}`;try{await navigator.clipboard.writeText(E),alert("copied to clipboard suc!")}catch(C){console.error("Failed to copy:",C),alert(`❌ copy failed! `+C)}},h=async()=>{let d="";try{d=await navigator.clipboard.readText()}catch{}if(d){if(!d.includes("context-replace")){const m=prompt("the input text is not a valid config","");if(m)d=m;else return}}else{const m=prompt("please input the import config text.");m&&(d=m)}if(d)try{const m="context-replace://import/";let b=d.trim();b.startsWith(m)&&(b=b.slice(m.length));const E=JSON.parse(b);if(!E||!Array.isArray(E.rules))throw new Error("Invalid format");const C=E.rules,A=n.rules;let I=0,S=0;for(const F of C){if(A.some(_=>_.matchType===(F.matchType||"fixed")&&_.matchValue===F.matchValue&&_.targetValue===(F.targetValue||""))){S++;continue}F.matchValue&&(await n.addRule({note:F.note,matchType:F.matchType==="regex"?"regex":"fixed",matchValue:F.matchValue,targetValue:F.targetValue||""}),I++)}alert(`import from clipboard suc! added: ${I}, skipped: ${S}`)}catch(m){console.error("Import failed:",m),alert("import failed "+m)}};return(d,m)=>(Y(),ne("details",{class:"bg-background rounded-lg p-0 mb-0 group border border-border",open:H(t),onToggle:m[5]||(m[5]=b=>{t.value=(b?.target).open})},[R("summary",lb,[R("div",cb,[m[6]||(m[6]=R("svg",{class:"size-6 text-foreground-secondary transition-transform duration-200 transform group-open:rotate-90",viewBox:"0 0 24 24",fill:"currentColor"},[R("path",{d:"M8 5v14l11-7z"})],-1)),rt(" "+we(H(r).ruleConfig),1)]),H(t)?(Y(),ne("div",{key:0,class:"flex gap-2",onClick:m[0]||(m[0]=ur(()=>{},["stop"]))},[R("button",{onClick:h,class:"flex items-center gap-1 px-2 py-1 text-xs bg-background-secondary border border-border rounded text-foreground-secondary hover:text-blue-600 hover:border-blue-400 hover:bg-background transition",title:H(r).readClipboardImport},[m[7]||(m[7]=R("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})],-1)),rt(" "+we(H(r).import),1)],8,ub),R("button",{onClick:f,class:"flex items-center gap-1 px-2 py-1 text-xs bg-background-secondary border border-border rounded text-foreground-secondary hover:text-blue-600 hover:border-blue-400 hover:bg-background transition",title:H(r).exportConfigClipboard},[m[8]||(m[8]=R("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})],-1)),rt(" "+we(H(r).export),1)],8,fb)])):Pe("",!0)]),R("div",db,[R("div",hb,[R("form",{onSubmit:ur(o,["prevent"]),class:"flex items-center gap-1"},[ft(R("select",{"onUpdate:modelValue":m[1]||(m[1]=b=>i.matchType=b),class:"w-16 p-1 text-xs border border-border rounded focus:ring-1 focus:ring-green-500 bg-background",title:H(r).matchType},[R("option",mb,we(H(r).text),1),R("option",gb,we(H(r).regex),1)],8,pb),[[_a,i.matchType]]),R("div",yb,[ft(R("textarea",{"onUpdate:modelValue":m[2]||(m[2]=b=>i.matchValue=b),rows:"1",required:"",class:"w-full p-1 text-sm border border-border rounded focus:ring-1 focus:ring-green-500 min-h-7.5 resize-y align-middle leading-5",placeholder:H(r).matchValue},null,8,bb),[[En,i.matchValue]])]),m[10]||(m[10]=R("div",{class:"text-foreground-secondary shrink-0"},[R("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 8l4 4m0 0l-4 4m4-4H3"})])],-1)),R("div",vb,[ft(R("textarea",{"onUpdate:modelValue":m[3]||(m[3]=b=>i.targetValue=b),rows:"1",class:"w-full p-1 text-sm border border-border rounded focus:ring-1 focus:ring-green-500 min-h-7.5 resize-y align-middle leading-5",placeholder:H(r).replaceWith},null,8,wb),[[En,i.targetValue]])]),ft(R("input",{"onUpdate:modelValue":m[4]||(m[4]=b=>i.note=b),type:"text",class:"flex-1 min-w-[7ch] p-1 text-xs border border-border rounded focus:ring-1 focus:ring-green-500",placeholder:H(r).note},null,8,xb),[[En,i.note]]),R("button",{type:"submit",disabled:s.value,class:"p-1.5 bg-green-600 text-white rounded hover:bg-green-700 disabled:opacity-50 shrink-0",title:H(r).addRule},[...m[9]||(m[9]=[R("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[R("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z","clip-rule":"evenodd"})],-1)])],8,Sb)],32)]),R("div",_b,[H(n).rules.length===0?(Y(),ne("div",Cb,we(H(r).noRules),1)):Pe("",!0),(Y(!0),ne(Ce,null,Yn(H(n).rules,b=>(Y(),ne("div",{key:b.id,class:"group/item bg-background border border-border rounded hover:border-blue-300 transition-colors"},[b.isEditing?(Y(),ne("form",{key:1,onSubmit:ur(E=>u(b),["prevent"]),class:"flex items-center gap-1 p-1 rounded dark:bg-gray-300/30"},[ft(R("select",{"onUpdate:modelValue":E=>b.editMatchType=E,class:"w-14 p-1 text-xs border border-blue-200 rounded bg-background"},[...m[14]||(m[14]=[R("option",{value:"fixed"},"Txt",-1),R("option",{value:"regex"},"Reg",-1)])],8,kb),[[_a,b.editMatchType]]),ft(R("textarea",{"onUpdate:modelValue":E=>b.editMatchValue=E,rows:"1",class:"flex-1 min-w-0 p-1 text-sm border border-blue-200 rounded min-h-7 resize-y align-middle",placeholder:H(r).match},null,8,Mb),[[En,b.editMatchValue]]),m[17]||(m[17]=R("span",{class:"text-blue-300"},"➜",-1)),ft(R("textarea",{"onUpdate:modelValue":E=>b.editTargetValue=E,rows:"1",class:"flex-1 min-w-0 p-1 text-sm border border-blue-200 rounded min-h-7 resize-y align-middle",placeholder:H(r).replace},null,8,Fb),[[En,b.editTargetValue]]),ft(R("input",{"onUpdate:modelValue":E=>b.editNote=E,class:"flex-1 min-w-[7ch] p-1 text-xs border border-blue-200 rounded",placeholder:H(r).note},null,8,Bb),[[En,b.editNote]]),R("button",{type:"submit",class:"text-green-600 hover:bg-green-100 rounded p-1",title:H(r).save},[...m[15]||(m[15]=[R("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)])],8,Db),R("button",{type:"button",onClick:E=>l(b),class:"text-gray-500 hover:bg-gray-200 rounded p-1",title:H(r).cancel},[...m[16]||(m[16]=[R("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,qb)],40,$b)):(Y(),ne("div",Tb,[R("span",{class:Oe(["shrink-0 px-1 rounded text-[10px] font-mono border",b.matchType==="regex"?"bg-badge-reg-bg text-badge-reg-fg border-badge-reg-bg":"bg-badge-txt-bg text-badge-txt-fg border-badge-txt-bg"])},we(b.matchType==="regex"?"Reg":"Txt"),3),R("div",{class:"flex-1 min-w-0",title:b.matchValue},[R("div",Rb,we(b.matchValue),1)],8,Eb),m[13]||(m[13]=R("span",{class:"shrink-0 font-extrabold"},"→",-1)),R("div",{class:"flex-1 min-w-0",title:b.targetValue},[R("div",Ab,we(b.targetValue||H(r).empty),1)],8,Nb),R("div",{class:"w-32 text-foreground-secondary truncate text-left shrink-0",title:b.note},we(b.note),9,Ib),R("div",Ob,[R("button",{onClick:E=>a(b),class:"text-blue-500 hover:text-blue-700 p-0.5",title:H(r).edit},[...m[11]||(m[11]=[R("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})],-1)])],8,Lb),R("button",{onClick:E=>c(b.id),class:"text-red-500 hover:text-red-700 p-0.5",title:H(r).delete},[...m[12]||(m[12]=[R("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])],8,Pb)])]))]))),128))])])],40,ab))}}),Zr=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Qb=Zr(jb,[["__scopeId","data-v-4069b0e4"]]),Vb=["title"],zb=et({__name:"HoverInfo",props:{tooltip:{},placement:{default:"top"}},setup(e){const t=e,n=ae(!1),s=ae(null),r=()=>{n.value=!n.value},i=l=>{s.value&&!s.value.contains(l.target)&&(n.value=!1)};Pt(()=>{document.addEventListener("click",i)}),js(()=>{document.removeEventListener("click",i)});const o=se(()=>{switch(t.placement){case"top":return"bottom-full left-1/2 -translate-x-1/2 mb-2";case"top-start":return"bottom-full left-0 mb-2";case"top-end":return"bottom-full right-0 mb-2";case"bottom":return"top-full left-1/2 -translate-x-1/2 mt-2";case"bottom-start":return"top-full left-0 mt-2";case"bottom-end":return"top-full right-0 mt-2";default:return"bottom-full left-1/2 -translate-x-1/2 mb-2"}}),a=se(()=>{const l="border-t-gray-800 top-full",u="border-b-gray-800 bottom-full";switch(t.placement){case"top":return`${l} left-1/2 -translate-x-1/2`;case"top-start":return`${l} left-2`;case"top-end":return`${l} right-2`;case"bottom":return`${u} left-1/2 -translate-x-1/2`;case"bottom-start":return`${u} left-2`;case"bottom-end":return`${u} right-2`;default:return`${l} left-1/2 -translate-x-1/2`}});return(l,u)=>(Y(),ne("div",{class:"relative inline-block",ref_key:"containerRef",ref:s,title:e.tooltip},[R("div",{onClick:r,class:"cursor-pointer"},[st(l.$slots,"default",{},void 0,!0)]),pe(Pd,{name:"fade"},{default:dt(()=>[n.value?(Y(),ne("div",{key:0,class:Oe(["absolute z-50 px-2 py-1 bg-gray-800 text-white text-xs rounded shadow-lg whitespace-nowrap",o.value])},[rt(we(e.tooltip)+" ",1),R("div",{class:Oe(["absolute w-0 h-0 border-4 border-transparent",a.value])},null,2)],2)):Pe("",!0)]),_:1})],8,Vb))}}),Kb=Zr(zb,[["__scopeId","data-v-bffca376"]]);function Ub(e,t){console.log(`Starting replace process with input: "${e}"`),console.log(`Number of rules: ${t.length}`);let n=rr(e);const s=[],r=[];return t.forEach((i,o)=>{const{match:a,target:l}=i;console.log(`Processing rule ${i.id}: match "${a.value}" (${a.type}) -> target "${l.value}"`);let u;a.type==="regex"?u=new RegExp(a.value,"g"):u=new RegExp(pl(rr(a.value)),"g"),console.log(`Generated regex: ${u}`);const c=`__REPLACE_${o}__`;let f=0;n=n.replace(u,h=>{f++;const d=`${c}_${s.length}`;return console.log(`Match ${f} for rule ${i.id}: "${h}" -> placeholder "${d}"`),s.push({id:d,target:rr(l.value),ruleId:i.id,originalMatch:Ci(h),originalMatchType:a.type}),d}),console.log(`Rule ${i.id} processed, matches found: ${f}`)}),console.log(`Collecting history from ${s.length} placeholders`),s.forEach(({originalMatch:i,originalMatchType:o,target:a,ruleId:l})=>{console.log(`History entry: "${i}" (${o}) -> "${Ci(a)}" (rule ${l})`),r.push({originalMatch:i,originalMatchType:o,replacedWith:Ci(a),replacedWithType:"fixed",ruleId:l})}),console.log(`Replacing ${s.length} placeholders with highlighted HTML`),s.forEach(({id:i,target:o,ruleId:a})=>{const l=a*49%360,u=`hsl(${l}, 85%, 95%)`,c=`hsl(${l}, 70%, 70%)`,f=`${rr(o)}`;console.log(`Replacing placeholder "${i}" with highlighted HTML for rule ${a}: "${o}"`),n=n.replace(new RegExp(pl(i),"g"),f)}),console.log(`Replace process completed. Final result length: ${n.length}, history entries: ${r.length}`),{result:n,history:r}}function pl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rr(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ci(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}const Hb=[{id:1,match:{type:"fixed",value:"hello"},target:{type:"fixed",value:"hi"}},{id:2,match:{type:"regex",value:"\\bworld\\b"},target:{type:"fixed",value:"earth"}},{id:3,match:{type:"fixed",value:"test"},target:{type:"fixed",value:"example"}},{id:4,match:{type:"regex",value:"\\bvar\\b"},target:{type:"fixed",value:"let"}},{id:5,match:{type:"regex",value:"\\blet\\b"},target:{type:"fixed",value:"const"}},{id:6,match:{type:"regex",value:"/src/"},target:{type:"fixed",value:"/dist/"}},{id:7,match:{type:"regex",value:"\\.js$"},target:{type:"fixed",value:".ts"}},{id:8,match:{type:"fixed",value:"你好"},target:{type:"fixed",value:"您好"}},{id:9,match:{type:"fixed",value:"世界"},target:{type:"fixed",value:"地球"}},{id:10,match:{type:"regex",value:"的"},target:{type:"fixed",value:"之"}}],Un="replace-";function Au(){const e=parseInt(localStorage.getItem(`${Un}count`)||"0"),t=[];for(let n=1;n<=e;n++){const s=localStorage.getItem(`${Un}rules-${n}`);if(s)try{t.push(JSON.parse(s))}catch(r){console.warn(`Failed to parse rule ${n}:`,r)}}return t}function Wb(e){const t=parseInt(localStorage.getItem(`${Un}count`)||"0");for(let n=1;n<=t;n++)localStorage.removeItem(`${Un}rules-${n}`);localStorage.setItem(`${Un}count`,e.length.toString()),e.forEach((n,s)=>{localStorage.setItem(`${Un}rules-${s+1}`,JSON.stringify(n))})}function Zv(){const e=Au();return e.length>0?Math.max(...e.map(t=>t.id))+1:1}function ew(){const t=[...Au()];return Hb.forEach(n=>{const s=t.findIndex(r=>r.id===n.id);s>=0?t[s]={...n}:t.push({...n})}),Wb(t),t}const Gb=[{key:"Enter",ctrlKey:!0,action:"replace",description:"Ctrl+Enter"}];function Jb(e,t){const n=Gb.find(s=>s.key===e.key&&(s.ctrlKey===void 0||s.ctrlKey===e.ctrlKey));n&&(e.preventDefault(),t[n.action]?.())}const Xb=e=>new Promise(t=>setTimeout(t,e)),Yb="/lang-switch.png",Zb={key:0,class:"absolute right-0 top-full mt-2 w-24 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-50"},ev=["onClick"],tv=et({__name:"LanguageSwitcher",setup(e){const{locale:t,setLocale:n,availableLocales:s}=$o(),r=ae(!1),i=ae(null),o=()=>r.value=!r.value,a=u=>{n(u),r.value=!1},l=u=>{r.value&&i.value&&!i.value.contains(u.target)&&(r.value=!1)};return Pt(()=>window.addEventListener("click",l)),js(()=>window.removeEventListener("click",l)),(u,c)=>(Y(),ne("div",{ref_key:"containerRef",ref:i,class:"relative"},[R("button",{type:"button",onClick:ur(o,["stop"]),class:"flex size-full items-center justify-center rounded-md transition-colors",title:"Switch Language"},[...c[0]||(c[0]=[R("img",{src:Yb,alt:"lang switch",class:"size-5"},null,-1)])]),r.value?(Y(),ne("div",Zb,[(Y(!0),ne(Ce,null,Yn(H(s),f=>(Y(),ne("button",{key:f.code,onClick:h=>a(f.code),class:Oe(["block w-full px-4 py-2 text-left text-xs text-gray-700 hover:bg-gray-100 hover:text-blue-600",{"font-bold text-blue-600 bg-blue-50":H(t)===f.code}])},we(f.name),11,ev))),128))])):Pe("",!0)],512))}}),nv={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},sv={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},rv=et({__name:"DarkModeToggle",setup(e){const t=zc(),n=vp(t);return(s,r)=>(Y(),ne("button",{type:"button",onClick:r[0]||(r[0]=i=>H(n)()),class:"size-7 p-1 bg-button-bg hover:bg-button-bg text-foreground-secondary hover:text-foreground rounded-md flex items-center justify-center transition-colors",title:"Toggle Dark Mode"},[H(t)?(Y(),ne("svg",nv,[...r[1]||(r[1]=[R("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"},null,-1)])])):(Y(),ne("svg",sv,[...r[2]||(r[2]=[vo('',9)])]))]))}}),iv={key:0,class:"bg-background-secondary border-border px-4 py-2 mt-auto"},ov={class:"flex justify-between items-center text-sm"},av={key:0,class:"text-foreground-secondary"},lv={class:"font-medium"},cv={key:1},uv={key:2,class:"flex items-center gap-6"},fv=["href","title"],dv=et({__name:"AppFooter",setup(e){const t=se(()=>n.value||r.value),n=se(()=>!1),s=se(()=>{}),r=se(()=>i.value.length>0),i=se(()=>[]);return(o,a)=>t.value?(Y(),ne("footer",iv,[R("div",ov,[n.value?(Y(),ne("div",av,[R("span",lv,"Powered by "+we(s.value),1)])):(Y(),ne("div",cv)),r.value?(Y(),ne("nav",uv,[(Y(!0),ne(Ce,null,Yn(i.value,l=>(Y(),ne("a",{key:l.url,href:l.url,title:l.description,target:"_blank",rel:"noopener noreferrer",class:"text-foreground-secondary hover:text-foreground transition-colors duration-200 text-xs font-medium hover:underline"},we(l.label),9,fv))),128))])):Pe("",!0)])])):Pe("",!0)}}),hv=Zr(dv,[["__scopeId","data-v-724904c4"]]),pv={class:"min-h-screen bg-background text-foreground font-sans flex flex-col"},mv={class:"z-50 bg-background-secondary border-b border-border px-4 py-3 shadow-sm flex-none"},gv={class:"w-full flex items-start gap-4"},yv={class:"flex items-center gap-2 mt-3"},bv=["alt"],vv={class:"flex-1 grid grid-cols-1 lg:grid-cols-2 gap-2 p-2 min-h-0"},wv={class:"flex flex-col h-full"},xv={class:"flex items-center justify-between px-1 mb-2"},Sv={class:"text-sm font-bold text-foreground-secondary flex items-center gap-2"},_v={class:"flex gap-2"},Cv=["disabled","title"],Tv={class:"flex-1 bg-background rounded-xl shadow-sm border border-border overflow-hidden relative group hover:border-blue-300 transition-colors"},Ev=["placeholder"],Rv={class:"flex flex-col relative"},Nv={class:"flex items-center justify-between px-1 mb-2"},Av={class:"flex items-center gap-4"},Iv={class:"text-sm font-bold text-foreground-secondary flex items-center gap-2"},Ov={key:0,class:"text-xs font-medium px-2 py-0.5 bg-blue-50 text-blue-700 rounded-md border border-blue-100"},Lv={class:"flex items-center gap-3 ml-2 border-l pl-4 border-border"},Pv={class:"flex items-center gap-1.5 cursor-pointer select-none"},$v={class:"text-xs text-foreground-secondary hover:text-foreground"},kv=["disabled"],Mv={class:"flex-1 bg-background rounded-xl shadow-sm border border-border overflow-hidden relative hover:border-green-300 transition-colors"},Fv={key:0,class:"fixed right-6 top-1/2 -translate-y-1/2 flex flex-col gap-3 z-30"},Bv=["title"],Dv=["title"],qv=["innerHTML"],jv={key:1},Qv=et({__name:"Home",setup(e){const t=Ru(),{t:n}=$o(),s=ae(""),r=ae(""),i=ae(),o=Di("context-replace-auto-copy",!1),a=Di("context-replace-header-expanded",!0),l=ae(0),u=ae(-1),c=ae([]),f=ae(""),h=ae(!1),d=ae(""),m=_=>_.map(T=>({id:T.id,match:{type:T.matchType,value:T.matchValue},target:{type:"fixed",value:T.targetValue}})),b=_=>{if(!i.value)return;const T=i.value.querySelectorAll('span[style*="background-color"]');T.length!==0&&T.forEach((O,x)=>{const $=O;x===_?($.style.transition="all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",$.style.outline="3px solid #ef4444",$.style.outlineOffset="2px",$.style.borderRadius="2px",$.style.transform="scale(1.15)",$.style.zIndex="20",$.style.position="relative",$.style.boxShadow="0 4px 12px rgba(239, 68, 68, 0.4)",$.scrollIntoView({behavior:"smooth",block:"center"})):($.style.outline="",$.style.outlineOffset="",$.style.borderRadius="",$.style.transform="",$.style.zIndex="",$.style.position="",$.style.boxShadow="")})},E=async()=>{if(!s.value.trim())return;const _=m(t.rules),T=Ub(s.value,_);r.value=T.result,d.value=T.result.replace(/<[^>]*>/g,""),l.value=T.history.length,u.value=-1,c.value=T.history,f.value=s.value,h.value=T.history.length>0,i.value&&(i.value.scrollTop=0),ps.success(`Replacement ${l.value} successfully`),o.value&&await C()},C=async()=>{if(r.value)try{const _=r.value.replace(/<[^>]*>/g,"").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&");await navigator.clipboard.writeText(_),await Xb(500),ps.success("Copied to clipboard",{duration:1500})}catch(_){console.error("Failed to copy:",_),ps.error("Failed to copy")}},A=()=>{s.value="",r.value="",l.value=0,u.value=-1,h.value=!1,c.value=[],f.value="",d.value=""},I=_=>{setTimeout(()=>{E()},150)},S=()=>{if(!i.value||l.value===0)return;const _=i.value.querySelectorAll('span[style*="background-color"]');_.length!==0&&(u.value=(u.value+1)%_.length,b(u.value))},F=()=>{if(!i.value||l.value===0)return;const _=i.value.querySelectorAll('span[style*="background-color"]');_.length!==0&&(u.value=u.value<=0?_.length-1:u.value-1,b(u.value))},j=_=>{Jb(_,{replace:E,copy:C}),_.ctrlKey&&(_.key==="ArrowUp"&&(_.preventDefault(),F()),_.key==="ArrowDown"&&(_.preventDefault(),S()))};return gt(s,_=>{f.value&&_!==f.value&&(h.value=!1)}),Pt(async()=>{try{await Po(),await Eu(),await t.loadRules(),t.rules.length===0&&await t.initializeDefaultRules(),window.addEventListener("keydown",j)}catch(_){console.error("Initialization failed:",_),ps.error("Initialization failed")}}),js(()=>{window.removeEventListener("keydown",j)}),(_,T)=>{const O=vr("router-link");return Y(),ne("div",pv,[H(a)?Pe("",!0):(Y(),ne("div",{key:0,onClick:T[0]||(T[0]=x=>a.value=!0),class:"w-full h-6 flex items-center justify-center bg-background-secondary border-b border-border cursor-pointer hover:bg-blue-50 dark:hover:bg-gray-800 transition-colors group z-50 flex-none",title:"Show Header"},[...T[4]||(T[4]=[R("svg",{class:"w-4 h-4 text-foreground-secondary group-hover:text-blue-500 transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1)])])),ft(R("header",mv,[R("div",gv,[T[8]||(T[8]=vo('

Context Replace

An offline tool to replace sensitive text in your context
',1)),R("div",yv,[pe(Kb,{class:"p-1.5 rounded border bg-orange-100 border-orange-200 opacity-80",tooltip:H(n).offlineTooltip,placement:"bottom"},{default:dt(()=>[R("img",{src:Qm,alt:H(n).offlineFunction,class:"size-4"},null,8,bv)]),_:1},8,["tooltip"]),T[7]||(T[7]=R("a",{href:"https://github.com/ctxinf/context-replace",target:"_blank",class:"size-7 p-1 bg-button-bg hover:bg-button-bg text-foreground-secondary hover:text-foreground rounded-md flex items-center justify-center text-sm font-bold transition-colors",title:"View on GitHub"},[R("svg",{class:"size-6",fill:"currentColor",viewBox:"0 0 24 24"},[R("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})])],-1)),pe(tv,{class:"size-7 p-1 bg-button-bg hover:bg-button-bg text-foreground-secondary hover:text-foreground rounded-md"}),pe(rv),pe(O,{to:"/help",class:"size-7 bg-button-bg hover:bg-button-bg text-foreground-secondary hover:text-foreground rounded-md flex items-center justify-center text-sm font-bold transition-colors",title:"Help"},{default:dt(()=>[...T[5]||(T[5]=[rt(" ? ",-1)])]),_:1}),R("button",{onClick:T[1]||(T[1]=x=>a.value=!1),class:"size-7 bg-button-bg hover:bg-button-bg text-foreground-secondary hover:text-foreground rounded-md flex items-center justify-center transition-colors",title:"Collapse Header (Focus Mode)"},[...T[6]||(T[6]=[R("svg",{class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 15l7-7 7 7"})],-1)])])]),T[9]||(T[9]=R("div",{class:"flex-1"},null,-1)),pe(Qb)])],512),[[Dd,H(a)]]),R("main",vv,[R("div",wv,[R("div",xv,[R("h2",Sv,[T[10]||(T[10]=R("span",{class:"w-2 h-2 rounded-full bg-blue-500"},null,-1)),rt(" "+we(H(n).rawInput),1)]),R("div",_v,[s.value?(Y(),ne("button",{key:0,onClick:A,class:"px-3 py-1 text-xs font-medium text-foreground-secondary hover:text-red-600 hover:bg-red-50 rounded-md transition-colors"},we(H(n).clear),1)):Pe("",!0),R("button",{onClick:E,disabled:!s.value.trim(),class:"flex items-center gap-1.5 px-4 py-1.5 bg-blue-600 text-white text-xs font-bold uppercase tracking-wider rounded-full shadow-sm hover:bg-blue-700 hover:shadow-md active:scale-95 transition-all disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none",title:H(n).shortcutReplace},[T[11]||(T[11]=R("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1)),rt(" "+we(H(n).replace),1)],8,Cv)])]),R("div",Tv,[ft(R("textarea",{"onUpdate:modelValue":T[2]||(T[2]=x=>s.value=x),ref:"inputTextarea",class:"w-full h-full p-4 bg-transparent border-none resize-none focus:ring-0 text-sm font-mono leading-relaxed text-foreground placeholder-foreground-secondary",placeholder:H(n).pasteCodePlaceholder,onPaste:I},null,40,Ev),[[En,s.value]])])]),R("div",Rv,[R("div",Nv,[R("div",Av,[R("h2",Iv,[T[12]||(T[12]=R("span",{class:"w-2 h-2 rounded-full bg-green-500"},null,-1)),rt(" "+we(H(n).processedResult),1)]),l.value>0?(Y(),ne("div",Ov,we(H(n).replacements(l.value.toString())),1)):Pe("",!0),R("div",Lv,[R("label",Pv,[ft(R("input",{"onUpdate:modelValue":T[3]||(T[3]=x=>Te(o)?o.value=x:null),type:"checkbox",class:"w-3.5 h-3.5 text-blue-600 rounded focus:ring-blue-500 border-border"},null,512),[[eh,H(o)]]),R("span",$v,we(H(n).autoCopy),1)]),R("button",{onClick:C,disabled:!r.value,class:"flex items-center gap-1.5 px-3 py-1 bg-background-secondary text-foreground-secondary text-xs font-bold rounded shadow-sm hover:bg-background-dark hover:text-foreground active:scale-95 transition-all disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-background-secondary disabled:text-foreground-secondary",title:"copy"},[T[13]||(T[13]=R("svg",{class:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})],-1)),rt(" "+we(H(n).copy),1)],8,kv)])])]),R("div",Mv,[l.value>0?(Y(),ne("div",Fv,[R("button",{onClick:F,class:"w-10 h-10 flex items-center justify-center bg-search-button-bg text-foreground-secondary rounded-full shadow-lg border border-search-button-border hover:bg-blue-600 hover:text-white hover:scale-110 active:scale-95 transition-all duration-200 group",title:H(n).previousItem},[...T[14]||(T[14]=[R("svg",{class:"w-6 h-6 transform group-hover:-translate-y-0.5 transition-transform",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M5 15l7-7 7 7"})],-1)])],8,Bv),R("button",{onClick:S,class:"w-10 h-10 flex items-center justify-center bg-search-button-bg text-foreground-secondary rounded-full shadow-lg border border-search-button-border hover:bg-blue-600 hover:text-white hover:scale-110 active:scale-95 transition-all duration-200 group",title:H(n).nextItem},[...T[15]||(T[15]=[R("svg",{class:"w-6 h-6 transform group-hover:translate-y-0.5 transition-transform",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[R("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M19 9l-7 7-7-7"})],-1)])],8,Dv)])):Pe("",!0),R("div",{ref_key:"outputContainer",ref:i,class:Oe(["w-full h-full p-4 overflow-auto font-mono text-sm whitespace-pre-wrap leading-relaxed selection:bg-green-100 selection:text-green-900 pb-20",{"text-foreground-secondary italic flex items-center justify-center":!r.value}])},[r.value?(Y(),ne("div",{key:0,innerHTML:r.value},null,8,qv)):(Y(),ne("span",jv,we(H(n).waitingForInput),1))],2)])])]),pe(hv)])}}}),Vv=Zr(Qv,[["__scopeId","data-v-0bb18800"]]),zv={class:"relative min-h-screen w-full overflow-hidden bg-[#0B0C10] text-slate-200 selection:bg-indigo-500/30"},Kv={class:"relative z-10 flex flex-col items-center"},Uv={class:"w-full p-6"},Hv="/usage.webm",Wv="/usage-video-first.png",Gv=et({__name:"Help",setup(e){return(t,n)=>{const s=vr("router-link");return Y(),ne("div",zv,[n[3]||(n[3]=R("div",{class:"absolute inset-0 z-0"},[R("div",{class:"absolute inset-0 h-full w-full",style:{"background-size":"50px 50px","background-image":`linear-gradient( to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px ), linear-gradient( to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px )`,"mask-image":`radial-gradient( ellipse 80% 80% at 50% 10%, black 40%, transparent 100% )`,"-webkit-mask-image":`radial-gradient( ellipse 80% 80% at 50% 10%, black 40%, transparent 100% )`}}),R("div",{class:"absolute -top-24 left-1/2 -translate-x-1/2 w-[800px] h-[300px] bg-indigo-500/20 blur-[100px] rounded-full mix-blend-screen pointer-events-none"}),R("div",{class:"absolute -top-40 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-blue-500/10 blur-[80px] rounded-full mix-blend-screen pointer-events-none"})],-1)),R("div",Kv,[R("div",Uv,[pe(s,{to:"/",class:"inline-flex items-center text-sm text-gray-400 hover:text-white transition-colors duration-200"},{default:dt(()=>[...n[0]||(n[0]=[R("span",{class:"mr-1"},"←",-1),rt(" Back ",-1)])]),_:1})]),n[2]||(n[2]=vo('
Privacy First

Context Replace

Setting rules to redact sensitive information in your context before sending it to LLM.

',1)),R("div",{class:"relative group mx-auto w-fit mb-10"},[n[1]||(n[1]=R("div",{class:"absolute -inset-1 bg-linear-to-r from-indigo-500 to-blue-500 rounded-2xl blur opacity-20 group-hover:opacity-40 transition duration-1000 group-hover:duration-200"},null,-1)),R("div",{class:"relative rounded-xl bg-gray-900/50 p-1 ring-1 ring-white/10 backdrop-blur-sm"},[R("video",{src:Hv,autoplay:"",playsinline:"",loop:"",muted:"",preload:"auto",poster:Wv,class:"object-cover max-w-[90vw] rounded-lg max-h-[70vh] w-full",style:{"clip-path":"inset(0.5px)"}}," Your browser does not support the video tag. ")])])])])}}}),Jv=jm({history:vm("/"),routes:[{path:"/",name:"home",component:Vv},{path:"/help",name:"help",component:Gv},{path:"/debug",name:"debug",component:Zt(()=>Rt(()=>import("./Debug-BkrKvnWB.js"),[]))},{path:"/debug/database",name:"database-test",component:Zt(()=>Rt(()=>import("./DatabaseTest-MIAh21eU.js"),[]))},{path:"/debug/drizzle-orm",name:"drizzle-orm-test",component:Zt(()=>Rt(()=>import("./DrizzleOrmTest-JJycqYnf.js"),[]))},{path:"/debug/environment",name:"environment-info",component:Zt(()=>Rt(()=>import("./EnvironmentInfo-BXWZUK_V.js"),[]))},{path:"/debug/opfs-viewer",name:"opfs-viewer",component:Zt(()=>Rt(()=>import("./OpfsViewer-BW0Jyqrr.js"),[]))},{path:"/debug/replace",name:"replace",component:Zt(()=>Rt(()=>import("./Replace-aX3QMhPY.js"),[]))},{path:"/debug/toast",name:"toast-debug",component:Zt(()=>Rt(()=>import("./ToastDebug-Dg9HJ_C2.js"),[]))},{path:"/debug/color-test",name:"color-test",component:Zt(()=>Rt(()=>import("./ColorTest-C1hdepWt.js"),[]))}]});async function Xv(){try{console.log("🚀 Initializing application..."),console.log("📊 Setting up database connection..."),await Po(),console.log("🔄 Running database migrations..."),await Eu(),console.log("✅ Database ready, mounting Vue application...");const e=ih(Pp);e.use(lh()),e.use(Jv),e.mount("#app"),console.log("🎉 Application started successfully!")}catch(e){console.error("❌ Failed to initialize application:",e);const t=document.createElement("div");t.style.cssText=` position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fee; border: 1px solid #fcc; border-radius: 8px; padding: 20px; max-width: 500px; text-align: center; font-family: system-ui, sans-serif; `,t.innerHTML=`

Application Error

Failed to initialize the application database.

`,document.body.appendChild(t)}}Xv();export{ur as A,_a as B,Ub as C,Yy as D,pl as E,Ce as F,ew as G,Zv as H,Wb as I,ps as J,vo as K,Y as a,R as b,ne as c,et as d,pe as e,rt as f,Pe as g,ae as h,Yn as i,Po as j,Eu as k,Kn as l,$r as m,Oe as n,Pt as o,kr as p,Xy as q,vr as r,Yv as s,we as t,Tr as u,uu as v,dt as w,Au as x,ft as y,En as z};