PageSourceSearch

https://repuestos-d6c3d.firebaseapp.com/_nuxt/ZFkPT2K8.js

js repuestos-d6c3d.firebaseapp.com collected 2026-10-03 08:13:37 UTC 752,036 bytes, 42 lines download raw bytes

vendor: 52,677 bytes, lines 1-3
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BcDkGKiF.js","./DtVRw9o8.js","./WWy_r-EY.js","./BsqTxom4.js","./GyODDOTC.js","./DZLnY1P3.js","./BSiYPcrU.js","./pAYh3yWb.js","./DAxyty-7.js","./DiAwE3HV.js","./2b48V30p.js","./Dfz_eyMs.js","./CplXa_zl.js","./DOH6MfcC.js","./CaVVEZRR.js","./D-GNixRz.js","./C0aY1EV-.js","./DJIOdC8_.js","./Cf2FRSNB.js","./CHLzf2Aj.js","./D8Ey7-J_.js","./_GZdBgYp.js","./CuIfEg9z.js","./CUJxL1M_.js","./IM-2RIYO.js","./CZJk-sjK.js","./COuDId2h.js","./DHwOP2XV.js","./CfAS_I0L.js","./BZmphdHO.js","./DmVMs07n.js","./BHIYQ2gg.js","./DkmfVfWn.js","./CDv6GZau.js","./JNLkghik.js","./DGHqE1U_.js","./QgBq2kVJ.js","./5MERy-2y.js","./xRJ2Nuxc.js","./DLKPqP_9.js","./DRq45blS.js","./q3U5rlDj.js","./nDhKAmaK.js","./B-jTRGN7.js","./9bFhY9cP.js","./Dzu_2NrH.js","./Bnl4CYzO.js","./UdKP_XCG.js","./sM5-ZMpm.js","./CoNBnXUx.js","./4_PiVCO4.js","./XcIPA_rB.js","./7-Nkv_Pi.js","./NklLGULG.js","./BHHr7dSf.js","./CYyRCJBz.js","./10ZhaK9H.js","./Yaj7M04L.js","./DmGOLtgk.js","./BXLB-GdA.js","./YdqVaeeB.js","./j4ZjxLf1.js","./BtwaD_vo.js","./C9aTROxJ.js","./CLsaqf77.js","./yswYLqmH.js","./ufxNFHnW.js","./DGXxf51z.js","./D-FiP20x.js","./DmZ6bcSd.js","./COqk9SJC.js","./7Bkgx2YQ.js","./CQiEuksp.js","./Bnd2nbds.js","./BtQpOmGA.js","./CR7vZoVG.js","./DJnSA2PW.js","./RepuestoCard.cT244W8Q.css","./DDVWw4Yy.js","./_repuesto_.CBvd4vsh.css","./CSiOu5K4.js","./0fIRCc5h.js","./RAQLQywF.js","./BAde26bY.js","./BMotTzJj.js","./CLCsarrn.js","./znbaUako.js","./C2tcIQN0.js","./DaPKg6P-.js"])))=>i.map(i=>d[i]);
2import{_ as ie}from"./BsqTxom4.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function am(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const ze={},vo=[],sr=()=>{},JT=()=>!1,du=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),cm=t=>t.startsWith("onUpdate:"),Lt=Object.assign,um=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},vC=Object.prototype.hasOwnProperty,Me=(t,e)=>vC.call(t,e),pe=Array.isArray,bo=t=>ha(t)==="[object Map]",la=t=>ha(t)==="[object Set]",uy=t=>ha(t)==="[object Date]",bC=t=>ha(t)==="[object RegExp]",ye=t=>typeof t=="function",it=t=>typeof t=="string",jn=t=>typeof t=="symbol",qe=t=>t!==null&&typeof t=="object",lm=t=>(qe(t)||ye(t))&&ye(t.then)&&ye(t.catch),YT=Object.prototype.toString,ha=t=>YT.call(t),AC=t=>ha(t).slice(8,-1),XT=t=>ha(t)==="[object Object]",hm=t=>it(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ao=am(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Vh=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},RC=/-\w/g,kn=Vh(t=>t.replace(RC,e=>e.slice(1).toUpperCase())),SC=/\B([A-Z])/g,Hi=Vh(t=>t.replace(SC,"-$1").toLowerCase()),Lh=Vh(t=>t.charAt(0).toUpperCase()+t.slice(1)),zd=Vh(t=>t?`on${Lh(t)}`:""),ws=(t,e)=>!Object.is(t,e),Ro=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},ZT=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},jl=t=>{const e=parseFloat(t);return isNaN(e)?t:e},ew=t=>{const e=it(t)?Number(t):NaN;return isNaN(e)?t:e};let ly;const Mh=()=>ly||(ly=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function dm(t){if(pe(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],s=it(r)?NC(r):dm(r);if(s)for(const i in s)e[i]=s[i]}return e}else if(it(t)||qe(t))return t}const PC=/;(?![^(]*\))/g,CC=/:([^]+)/,kC=/\/\*[^]*?\*\//g;function NC(t){const e={};return t.replace(kC,"").split(PC).forEach(n=>{if(n){const r=n.split(CC);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function fm(t){let e="";if(it(t))e=t;else if(pe(t))for(let n=0;n<t.length;n++){const r=fm(t[n]);r&&(e+=r+" ")}else if(qe(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const DC="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",OC=am(DC);function tw(t){return!!t||t===""}function xC(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=fu(t[r],e[r]);return n}function fu(t,e){if(t===e)return!0;let n=uy(t),r=uy(e);if(n||r)return n&&r?t.getTime()===e.getTime():!1;if(n=jn(t),r=jn(e),n||r)return t===e;if(n=pe(t),r=pe(e),n||r)return n&&r?xC(t,e):!1;if(n=qe(t),r=qe(e),n||r){if(!n||!r)return!1;const s=Object.keys(t).length,i=Object.keys(e).length;if(s!==i)return!1;for(const o in t){const a=t.hasOwnProperty(o),c=e.hasOwnProperty(o);if(a&&!c||!a&&c||!fu(t[o],e[o]))return!1}}return String(t)===String(e)}function pm(t,e){return t.findIndex(n=>fu(n,e))}const nw=t=>!!(t&&t.__v_isRef===!0),yl=t=>it(t)?t:t==null?"":pe(t)||qe(t)&&(t.toString===YT||!ye(t.toString))?nw(t)?yl(t.value):JSON.stringify(t,rw,2):String(t),rw=(t,e)=>nw(e)?rw(t,e.value):bo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,s],i)=>(n[Qd(r,i)+" =>"]=s,n),{})}:la(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Qd(n))}:jn(e)?Qd(e):qe(e)&&!pe(e)&&!XT(e)?String(e):e,Qd=(t,e="")=>{var n;return jn(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};let Wt;class sw{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Wt,!e&&Wt&&(this.index=(Wt.scopes||(Wt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=Wt;try{return Wt=this,e()}finally{Wt=n}}}on(){++this._on===1&&(this.prevScope=Wt,Wt=this)}off(){this._on>0&&--this._on===0&&(Wt=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function mm(t){return new sw(t)}function gm(){return Wt}function VC(t,e=!1){Wt&&Wt.cleanups.push(t)}let Qe;const Jd=new WeakSet;class iw{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Wt&&Wt.active&&Wt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Jd.has(this)&&(Jd.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||aw(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,hy(this),cw(this);const e=Qe,n=Fn;Qe=this,Fn=!0;try{return this.fn()}finally{uw(this),Qe=e,Fn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Em(e);this.deps=this.depsTail=void 0,hy(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Jd.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Bf(this)&&this.run()}get dirty(){return Bf(this)}}let ow=0,mc,gc;function aw(t,e=!1){if(t.flags|=8,e){t.next=gc,gc=t;return}t.next=mc,mc=t}function _m(){ow++}function ym(){if(--ow>0)return;if(gc){let e=gc;for(gc=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;mc;){let e=mc;for(mc=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function cw(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function uw(t){let e,n=t.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Em(r),LC(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}t.deps=e,t.depsTail=n}function Bf(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(lw(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function lw(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Fc)||(t.globalVersion=Fc,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Bf(t))))return;t.flags|=2;const e=t.dep,n=Qe,r=Fn;Qe=t,Fn=!0;try{cw(t);const s=t.fn(t._value);(e.version===0||ws(s,t._value))&&(t.flags|=128,t._value=s,e.version++)}catch(s){throw e.version++,s}finally{Qe=n,Fn=r,uw(t),t.flags&=-3}}function Em(t,e=!1){const{dep:n,prevSub:r,nextSub:s}=t;if(r&&(r.nextSub=s,t.prevSub=void 0),s&&(s.prevSub=r,t.nextSub=void 0),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Em(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function LC(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let Fn=!0;const hw=[];function Or(){hw.push(Fn),Fn=!1}function xr(){const t=hw.pop();Fn=t===void 0?!0:t}function hy(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Qe;Qe=void 0;try{e()}finally{Qe=n}}}let Fc=0;class MC{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Im{constructor(e){this.computed=e,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(e){if(!Qe||!Fn||Qe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Qe)n=this.activeLink=new MC(Qe,this),Qe.deps?(n.prevDep=Qe.depsTail,Qe.depsTail.nextDep=n,Qe.depsTail=n):Qe.deps=Qe.depsTail=n,dw(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Qe.depsTail,n.nextDep=void 0,Qe.depsTail.nextDep=n,Qe.depsTail=n,Qe.deps===n&&(Qe.deps=r)}return n}trigger(e){this.version++,Fc++,this.notify(e)}notify(e){_m();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ym()}}}function dw(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)dw(r)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const $l=new WeakMap,Ti=Symbol(""),jf=Symbol(""),Uc=Symbol("");function zt(t,e,n){if(Fn&&Qe){let r=$l.get(t);r||$l.set(t,r=new Map);let s=r.get(n);s||(r.set(n,s=new Im),s.map=r,s.key=n),s.track()}}function Er(t,e,n,r,s,i){const o=$l.get(t);if(!o){Fc++;return}const a=c=>{c&&c.trigger()};if(_m(),e==="clear")o.forEach(a);else{const c=pe(t),l=c&&hm(n);if(c&&n==="length"){const h=Number(r);o.forEach((d,f)=>{(f==="length"||f===Uc||!jn(f)&&f>=h)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),l&&a(o.get(Uc)),e){case"add":c?l&&a(o.get("length")):(a(o.get(Ti)),bo(t)&&a(o.get(jf)));break;case"delete":c||(a(o.get(Ti)),bo(t)&&a(o.get(jf)));break;case"set":bo(t)&&a(o.get(Ti));break}}ym()}function FC(t,e){const n=$l.get(t);return n&&n.get(e)}function so(t){const e=Ne(t);return e===t?e:(zt(e,"iterate",Uc),Sn(t)?e:e.map(Ut))}function Fh(t){return zt(t=Ne(t),"iterate",Uc),t}const UC={__proto__:null,[Symbol.iterator](){return Yd(this,Symbol.iterator,Ut)},concat(...t){return so(this).concat(...t.map(e=>pe(e)?so(e):e))},entries(){return Yd(this,"entries",t=>(t[1]=Ut(t[1]),t))},every(t,e){return pr(this,"every",t,e,void 0,arguments)},filter(t,e){return pr(this,"filter",t,e,n=>n.map(Ut),arguments)},find(t,e){return pr(this,"find",t,e,Ut,arguments)},findIndex(t,e){return pr(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return pr(this,"findLast",t,e,Ut,arguments)},findLastIndex(t,e){return pr(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return pr(this,"forEach",t,e,void 0,arguments)},includes(...t){return Xd(this,"includes",t)},indexOf(...t){return Xd(this,"indexOf",t)},join(t){return so(this).join(t)},lastIndexOf(...t){return Xd(this,"lastIndexOf",t)},map(t,e){return pr(this,"map",t,e,void 0,arguments)},pop(){return Qa(this,"pop")},push(...t){return Qa(this,"push",t)},reduce(t,...e){return dy(this,"reduce",t,e)},reduceRight(t,...e){return dy(this,"reduceRight",t,e)},shift(){return Qa(this,"shift")},some(t,e){return pr(this,"some",t,e,void 0,arguments)},splice(...t){return Qa(this,"splice",t)},toReversed(){return so(this).toReversed()},toSorted(t){return so(this).toSorted(t)},toSpliced(...t){return so(this).toSpliced(...t)},unshift(...t){return Qa(this,"unshift",t)},values(){return Yd(this,"values",Ut)}};function Yd(t,e,n){const r=Fh(t),s=r[e]();return r!==t&&!Sn(t)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const BC=Array.prototype;function pr(t,e,n,r,s,i){const o=Fh(t),a=o!==t&&!Sn(t),c=o[e];if(c!==BC[e]){const d=c.apply(t,i);return a?Ut(d):d}let l=n;o!==t&&(a?l=function(d,f){return n.call(this,Ut(d),f,t)}:n.length>2&&(l=function(d,f){return n.call(this,d,f,t)}));const h=c.call(o,l,r);return a&&s?s(h):h}function dy(t,e,n,r){const s=Fh(t);let i=n;return s!==t&&(Sn(t)?n.length>3&&(i=function(o,a,c){return n.call(this,o,a,c,t)}):i=function(o,a,c){return n.call(this,o,Ut(a),c,t)}),s[e](i,...r)}function Xd(t,e,n){const r=Ne(t);zt(r,"iterate",Uc);const s=r[e](...n);return(s===-1||s===!1)&&vm(n[0])?(n[0]=Ne(n[0]),r[e](...n)):s}function Qa(t,e,n=[]){Or(),_m();const r=Ne(t)[e].apply(t,n);return ym(),xr(),r}const jC=am("__proto__,__v_isRef,__isVue"),fw=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(jn));function $C(t){jn(t)||(t=String(t));const e=Ne(this);return zt(e,"has",t),e.hasOwnProperty(t)}class pw{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,r){if(n==="__v_skip")return e.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(s?i?XC:yw:i?_w:gw).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const o=pe(e);if(!s){let c;if(o&&(c=UC[n]))return c;if(n==="hasOwnProperty")return $C}const a=Reflect.get(e,n,at(e)?e:r);if((jn(n)?fw.has(n):jC(n))||(s||zt(e,"get",n),i))return a;if(at(a)){const c=o&&hm(n)?a:a.value;return s&&qe(c)?Bc(c):c}return qe(a)?s?Bc(a):qr(a):a}}class mw extends pw{constructor(e=!1){super(!1,e)}set(e,n,r,s){let i=e[n];if(!this._isShallow){const c=Vr(i);if(!Sn(r)&&!Vr(r)&&(i=Ne(i),r=Ne(r)),!pe(e)&&at(i)&&!at(r))return c||(i.value=r),!0}const o=pe(e)&&hm(n)?Number(n)<e.length:Me(e,n),a=Reflect.set(e,n,r,at(e)?e:s);return e===Ne(s)&&(o?ws(r,i)&&Er(e,"set",n,r):Er(e,"add",n,r)),a}deleteProperty(e,n){const r=Me(e,n);e[n];const s=Reflect.deleteProperty(e,n);return s&&r&&Er(e,"delete",n,void 0),s}has(e,n){const r=Reflect.has(e,n);return(!jn(n)||!fw.has(n))&&zt(e,"has",n),r}ownKeys(e){return zt(e,"iterate",pe(e)?"length":Ti),Reflect.ownKeys(e)}}class qC extends pw{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const HC=new mw,GC=new qC,WC=new mw(!0);const $f=t=>t,Qu=t=>Reflect.getPrototypeOf(t);function KC(t,e,n){return function(...r){const s=this.__v_raw,i=Ne(s),o=bo(i),a=t==="entries"||t===Symbol.iterator&&o,c=t==="keys"&&o,l=s[t](...r),h=n?$f:e?ql:Ut;return!e&&zt(i,"iterate",c?jf:Ti),{next(){const{value:d,done:f}=l.next();return f?{value:d,done:f}:{value:a?[h(d[0]),h(d[1])]:h(d),done:f}},[Symbol.iterator](){return this}}}}function Ju(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function zC(t,e){const n={get(s){const i=this.__v_raw,o=Ne(i),a=Ne(s);t||(ws(s,a)&&zt(o,"get",s),zt(o,"get",a));const{has:c}=Qu(o),l=e?$f:t?ql:Ut;if(c.call(o,s))return l(i.get(s));if(c.call(o,a))return l(i.get(a));i!==o&&i.get(s)},get size(){const s=this.__v_raw;return!t&&zt(Ne(s),"iterate",Ti),s.size},has(s){const i=this.__v_raw,o=Ne(i),a=Ne(s);return t||(ws(s,a)&&zt(o,"has",s),zt(o,"has",a)),s===a?i.has(s):i.has(s)||i.has(a)},forEach(s,i){const o=this,a=o.__v_raw,c=Ne(a),l=e?$f:t?ql:Ut;return!t&&zt(c,"iterate",Ti),a.forEach((h,d)=>s.call(i,l(h),l(d),o))}};return Lt(n,t?{add:Ju("add"),set:Ju("set"),delete:Ju("delete"),clear:Ju("clear")}:{add(s){!e&&!Sn(s)&&!Vr(s)&&(s=Ne(s));const i=Ne(this);return Qu(i).has.call(i,s)||(i.add(s),Er(i,"add",s,s)),this},set(s,i){!e&&!Sn(i)&&!Vr(i)&&(i=Ne(i));const o=Ne(this),{has:a,get:c}=Qu(o);let l=a.call(o,s);l||(s=Ne(s),l=a.call(o,s));const h=c.call(o,s);return o.set(s,i),l?ws(i,h)&&Er(o,"set",s,i):Er(o,"add",s,i),this},delete(s){const i=Ne(this),{has:o,get:a}=Qu(i);let c=o.call(i,s);c||(s=Ne(s),c=o.call(i,s)),a&&a.call(i,s);const l=i.delete(s);return c&&Er(i,"delete",s,void 0),l},clear(){const s=Ne(this),i=s.size!==0,o=s.clear();return i&&Er(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=KC(s,t,e)}),n}function Tm(t,e){const n=zC(t,e);return(r,s,i)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?r:Reflect.get(Me(n,s)&&s in r?n:r,s,i)}const QC={get:Tm(!1,!1)},JC={get:Tm(!1,!0)},YC={get:Tm(!0,!1)};const gw=new WeakMap,_w=new WeakMap,yw=new WeakMap,XC=new WeakMap;function ZC(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function e0(t){return t.__v_skip||!Object.isExtensible(t)?0:ZC(AC(t))}function qr(t){return Vr(t)?t:wm(t,!1,HC,QC,gw)}function er(t){return wm(t,!1,WC,JC,_w)}function Bc(t){return wm(t,!0,GC,YC,yw)}function wm(t,e,n,r,s){if(!qe(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=e0(t);if(i===0)return t;const o=s.get(t);if(o)return o;const a=new Proxy(t,i===2?r:n);return s.set(t,a),a}function kr(t){return Vr(t)?kr(t.__v_raw):!!(t&&t.__v_isReactive)}function Vr(t){return!!(t&&t.__v_isReadonly)}function Sn(t){return!!(t&&t.__v_isShallow)}function vm(t){return t?!!t.__v_raw:!1}function Ne(t){const e=t&&t.__v_raw;return e?Ne(e):t}function bm(t){return!Me(t,"__v_skip")&&Object.isExtensible(t)&&ZT(t,"__v_skip",!0),t}const Ut=t=>qe(t)?qr(t):t,ql=t=>qe(t)?Bc(t):t;function at(t){return t?t.__v_isRef===!0:!1}function pn(t){return Ew(t,!1)}function ki(t){return Ew(t,!0)}function Ew(t,e){return at(t)?t:new t0(t,e)}class t0{constructor(e,n){this.dep=new Im,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Ne(e),this._value=n?e:Ut(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,r=this.__v_isShallow||Sn(e)||Vr(e);e=r?e:Ne(e),ws(e,n)&&(this._rawValue=e,this._value=r?e:Ut(e),this.dep.trigger())}}function gt(t){return at(t)?t.value:t}function n0(t){return ye(t)?t():gt(t)}const r0={get:(t,e,n)=>e==="__v_raw"?t:gt(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const s=t[e];return at(s)&&!at(n)?(s.value=n,!0):Reflect.set(t,e,n,r)}};function Iw(t){return kr(t)?t:new Proxy(t,r0)}function s0(t){const e=pe(t)?new Array(t.length):{};for(const n in t)e[n]=Tw(t,n);return e}class i0{constructor(e,n,r){this._object=e,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return FC(Ne(this._object),this._key)}}class o0{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function a0(t,e,n){return at(t)?t:ye(t)?new o0(t):qe(t)&&arguments.length>1?Tw(t,e,n):pn(t)}function Tw(t,e,n){const r=t[e];return at(r)?r:new i0(t,e,n)}class c0{constructor(e,n,r){this.fn=e,this.setter=n,this._value=void 0,this.dep=new Im(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Fc-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Qe!==this)return aw(this,!0),!0}get value(){const e=this.dep.track();return lw(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function u0(t,e,n=!1){let r,s;return ye(t)?r=t:(r=t.get,s=t.set),new c0(r,s,n)}const Yu={},Hl=new WeakMap;let ai;function l0(t,e=!1,n=ai){if(n){let r=Hl.get(n);r||Hl.set(n,r=[]),r.push(t)}}function h0(t,e,n=ze){const{immediate:r,deep:s,once:i,scheduler:o,augmentJob:a,call:c}=n,l=S=>s?S:Sn(S)||s===!1||s===0?Ir(S,1):Ir(S);let h,d,f,m,_=!1,E=!1;if(at(t)?(d=()=>t.value,_=Sn(t)):kr(t)?(d=()=>l(t),_=!0):pe(t)?(E=!0,_=t.some(S=>kr(S)||Sn(S)),d=()=>t.map(S=>{if(at(S))return S.value;if(kr(S))return l(S);if(ye(S))return c?c(S,2):S()})):ye(t)?e?d=c?()=>c(t,2):t:d=()=>{if(f){Or();try{f()}finally{xr()}}const S=ai;ai=h;try{return c?c(t,3,[m]):t(m)}finally{ai=S}}:d=sr,e&&s){const S=d,D=s===!0?1/0:s;d=()=>Ir(S(),D)}const v=gm(),O=()=>{h.stop(),v&&v.active&&um(v.effects,h)};if(i&&e){const S=e;e=(...D)=>{S(...D),O()}}let N=E?new Array(t.length).fill(Yu):Yu;const y=S=>{if(!(!(h.flags&1)||!h.dirty&&!S))if(e){const D=h.run();if(s||_||(E?D.some((M,b)=>ws(M,N[b])):ws(D,N))){f&&f();const M=ai;ai=h;try{const b=[D,N===Yu?void 0:E&&N[0]===Yu?[]:N,m];N=D,c?c(e,3,b):e(...b)}finally{ai=M}}}else h.run()};return a&&a(y),h=new iw(d),h.scheduler=o?()=>o(y,!1):y,m=S=>l0(S,!1,h),f=h.onStop=()=>{const S=Hl.get(h);if(S){if(c)c(S,4);else for(const D of S)D();Hl.delete(h)}},e?r?y(!0):N=h.run():o?o(y.bind(null,!0),!0):h.run(),O.pause=h.pause.bind(h),O.resume=h.resume.bind(h),O.stop=O,O}function Ir(t,e=1/0,n){if(e<=0||!qe(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,at(t))Ir(t.value,e,n);else if(pe(t))for(let r=0;r<t.length;r++)Ir(t[r],e,n);else if(la(t)||bo(t))t.forEach(r=>{Ir(r,e,n)});else if(XT(t)){for(const r in t)Ir(t[r],e,n);for(const r of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,r)&&Ir(t[r],e,n)}return t}function pu(t,e,n,r){try{return r?t(...r):t()}catch(s){da(s,e,n)}}function $n(t,e,n,r){if(ye(t)){const s=pu(t,e,n,r);return s&&lm(s)&&s.catch(i=>{da(i,e,n)}),s}if(pe(t)){const s=[];for(let i=0;i<t.length;i++)s.push($n(t[i],e,n,r));return s}}function da(t,e,n,r=!0){const s=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||ze;if(e){let a=e.parent;const c=e.proxy,l=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const h=a.ec;if(h){for(let d=0;d<h.length;d++)if(h[d](t,c,l)===!1)return}a=a.parent}if(i){Or(),pu(i,null,10,[t,c,l]),xr();return}}d0(t,n,s,r,o)}function d0(t,e,n,r=!0,s=!1){if(s)throw t;console.error(t)}const tn=[];let Qn=-1;const So=[];let ds=null,mo=0;const ww=Promise.resolve();let Gl=null;function Ds(t){const e=Gl||ww;return t?e.then(this?t.bind(this):t):e}function f0(t){let e=Qn+1,n=tn.length;for(;e<n;){const r=e+n>>>1,s=tn[r],i=jc(s);i<t||i===t&&s.flags&2?e=r+1:n=r}return e}function Am(t){if(!(t.flags&1)){const e=jc(t),n=tn[tn.length-1];!n||!(t.flags&2)&&e>=jc(n)?tn.push(t):tn.splice(f0(e),0,t),t.flags|=1,vw()}}function vw(){Gl||(Gl=ww.then(bw))}function qf(t){pe(t)?So.push(...t):ds&&t.id===-1?ds.splice(mo+1,0,t):t.flags&1||(So.push(t),t.flags|=1),vw()}function fy(t,e,n=Qn+1){for(;n<tn.length;n++){const r=tn[n];if(r&&r.flags&2){if(t&&r.id!==t.uid)continue;tn.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Wl(t){if(So.length){const e=[...new Set(So)].sort((n,r)=>jc(n)-jc(r));if(So.length=0,ds){ds.push(...e);return}for(ds=e,mo=0;mo<ds.length;mo++){const n=ds[mo];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}ds=null,mo=0}}const jc=t=>t.id==null?t.flags&2?-1:1/0:t.id;function bw(t){try{for(Qn=0;Qn<tn.length;Qn++){const e=tn[Qn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),pu(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Qn<tn.length;Qn++){const e=tn[Qn];e&&(e.flags&=-2)}Qn=-1,tn.length=0,Wl(),Gl=null,(tn.length||So.length)&&bw()}}let $t=null,Aw=null;function Kl(t){const e=$t;return $t=t,Aw=t&&t.type.__scopeId||null,e}function Jn(t,e=$t,n){if(!e||t._n)return t;const r=(...s)=>{r._d&&Xl(-1);const i=Kl(e);let o;try{o=t(...s)}finally{Kl(i),r._d&&Xl(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Tq(t,e){if($t===null)return t;const n=qh($t),r=t.dirs||(t.dirs=[]);for(let s=0;s<e.length;s++){let[i,o,a,c=ze]=e[s];i&&(ye(i)&&(i={mounted:i,updated:i}),i.deep&&Ir(o),r.push({dir:i,instance:n,value:o,oldValue:void 0,arg:a,modifiers:c}))}return t}function Yn(t,e,n,r){const s=t.dirs,i=e&&e.dirs;for(let o=0;o<s.length;o++){const a=s[o];i&&(a.oldValue=i[o].value);let c=a.dir[r];c&&(Or(),$n(c,n,8,[t.el,a,t,e]),xr())}}const Rw=Symbol("_vte"),Sw=t=>t.__isTeleport,_c=t=>t&&(t.disabled||t.disabled===""),py=t=>t&&(t.defer||t.defer===""),my=t=>typeof SVGElement<"u"&&t instanceof SVGElement,gy=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Hf=(t,e)=>{const n=t&&t.to;return it(n)?e?e(n):null:n},Pw={name:"Teleport",__isTeleport:!0,process(t,e,n,r,s,i,o,a,c,l){const{mc:h,pc:d,pbc:f,o:{insert:m,querySelector:_,createText:E,createComment:v}}=l,O=_c(e.props);let{shapeFlag:N,children:y,dynamicChildren:S}=e;if(t==null){const D=e.el=E(""),M=e.anchor=E("");m(D,n,r),m(M,n,r);const b=(I,A)=>{N&16&&h(y,I,A,s,i,o,a,c)},T=()=>{const I=e.target=Hf(e.props,_),A=Cw(I,e,E,m);I&&(o!=="svg"&&my(I)?o="svg":o!=="mathml"&&gy(I)&&(o="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(I),O||(b(I,A),El(e,!1)))};O&&(b(n,M),El(e,!0)),py(e.props)?(e.el.__isMounted=!1,bt(()=>{T(),delete e.el.__isMounted},i)):T()}else{if(py(e.props)&&t.el.__isMounted===!1){bt(()=>{Pw.process(t,e,n,r,s,i,o,a,c,l)},i);return}e.el=t.el,e.targetStart=t.targetStart;const D=e.anchor=t.anchor,M=e.target=t.target,b=e.targetAnchor=t.targetAnchor,T=_c(t.props),I=T?n:M,A=T?D:b;if(o==="svg"||my(M)?o="svg":(o==="mathml"||gy(M))&&(o="mathml"),S?(f(t.dynamicChildren,S,I,s,i,o,a),Cm(t,e,!0)):c||d(t,e,I,A,s,i,o,a,!1),O)T?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Xu(e,n,D,l,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const C=e.target=Hf(e.props,_);C&&Xu(e,C,null,l,0)}else T&&Xu(e,M,b,l,1);El(e,O)}},remove(t,e,n,{um:r,o:{remove:s}},i){const{shapeFlag:o,children:a,anchor:c,targetStart:l,targetAnchor:h,target:d,props:f}=t;if(d&&(s(l),s(h)),i&&s(c),o&16){const m=i||!_c(f);for(let _=0;_<a.length;_++){const E=a[_];r(E,e,n,m,!!E.dynamicChildren)}}},move:Xu,hydrate:p0};function Xu(t,e,n,{o:{insert:r},m:s},i=2){i===0&&r(t.targetAnchor,e,n);const{el:o,anchor:a,shapeFlag:c,children:l,props:h}=t,d=i===2;if(d&&r(o,e,n),(!d||_c(h))&&c&16)for(let f=0;f<l.length;f++)s(l[f],e,n,2);d&&r(a,e,n)}function p0(t,e,n,r,s,i,{o:{nextSibling:o,parentNode:a,querySelector:c,insert:l,createText:h}},d){function f(E,v,O,N){v.anchor=d(o(E),v,a(E),n,r,s,i),v.targetStart=O,v.targetAnchor=N}const m=e.target=Hf(e.props,c),_=_c(e.props);if(m){const E=m._lpa||m.firstChild;if(e.shapeFlag&16)if(_)f(t,e,E,E&&o(E));else{e.anchor=o(t);let v=E;for(;v;){if(v&&v.nodeType===8){if(v.data==="teleport start anchor")e.targetStart=v;else if(v.data==="teleport anchor"){e.targetAnchor=v,m._lpa=e.targetAnchor&&o(e.targetAnchor);break}}v=o(v)}e.targetAnchor||Cw(m,e,h,l),d(E&&o(E),e,m,n,r,s,i)}El(e,_)}else _&&e.shapeFlag&16&&f(t,e,t,o(t));return e.anchor&&o(e.anchor)}const wq=Pw;function El(t,e){const n=t.ctx;if(n&&n.ut){let r,s;for(e?(r=t.el,s=t.anchor):(r=t.targetStart,s=t.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Cw(t,e,n,r){const s=e.targetStart=n(""),i=e.targetAnchor=n("");return s[Rw]=i,t&&(r(s,t),r(i,t)),i}const yr=Symbol("_leaveCb"),Zu=Symbol("_enterCb");function m0(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Bh(()=>{t.isMounted=!0}),fa(()=>{t.isUnmounting=!0}),t}const An=[Function,Array],kw={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:An,onEnter:An,onAfterEnter:An,onEnterCancelled:An,onBeforeLeave:An,onLeave:An,onAfterLeave:An,onLeaveCancelled:An,onBeforeAppear:An,onAppear:An,onAfterAppear:An,onAppearCancelled:An},Nw=t=>{const e=t.subTree;return e.component?Nw(e.component):e},g0={name:"BaseTransition",props:kw,setup(t,{slots:e}){const n=Gi(),r=m0();return()=>{const s=e.default&&xw(e.default(),!0);if(!s||!s.length)return;const i=Dw(s),o=Ne(t),{mode:a}=o;if(r.isLeaving)return Zd(i);const c=_y(i);if(!c)return Zd(i);let l=Gf(c,o,r,n,d=>l=d);c.type!==yt&&Vo(c,l);let h=n.subTree&&_y(n.subTree);if(h&&h.type!==yt&&!Vn(h,c)&&Nw(n).type!==yt){let d=Gf(h,o,r,n);if(Vo(h,d),a==="out-in"&&c.type!==yt)return r.isLeaving=!0,d.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,h=void 0},Zd(i);a==="in-out"&&c.type!==yt?d.delayLeave=(f,m,_)=>{const E=Ow(r,h);E[String(h.key)]=h,f[yr]=()=>{m(),f[yr]=void 0,delete l.delayedLeave,h=void 0},l.delayedLeave=()=>{_(),delete l.delayedLeave,h=void 0}}:h=void 0}else h&&(h=void 0);return i}}};function Dw(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==yt){e=n;break}}return e}const _0=g0;function Ow(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function Gf(t,e,n,r,s){const{appear:i,mode:o,persisted:a=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:h,onEnterCancelled:d,onBeforeLeave:f,onLeave:m,onAfterLeave:_,onLeaveCancelled:E,onBeforeAppear:v,onAppear:O,onAfterAppear:N,onAppearCancelled:y}=e,S=String(t.key),D=Ow(n,t),M=(I,A)=>{I&&$n(I,r,9,A)},b=(I,A)=>{const C=A[1];M(I,A),pe(I)?I.every(k=>k.length<=1)&&C():I.length<=1&&C()},T={mode:o,persisted:a,beforeEnter(I){let A=c;if(!n.isMounted)if(i)A=v||c;else return;I[yr]&&I[yr](!0);const C=D[S];C&&Vn(t,C)&&C.el[yr]&&C.el[yr](),M(A,[I])},enter(I){let A=l,C=h,k=d;if(!n.isMounted)if(i)A=O||l,C=N||h,k=y||d;else return;let R=!1;const ge=I[Zu]=Te=>{R||(R=!0,Te?M(k,[I]):M(C,[I]),T.delayedLeave&&T.delayedLeave(),I[Zu]=void 0)};A?b(A,[I,ge]):ge()},leave(I,A){const C=String(t.key);if(I[Zu]&&I[Zu](!0),n.isUnmounting)return A();M(f,[I]);let k=!1;const R=I[yr]=ge=>{k||(k=!0,A(),ge?M(E,[I]):M(_,[I]),I[yr]=void 0,D[C]===t&&delete D[C])};D[C]=t,m?b(m,[I,R]):R()},clone(I){const A=Gf(I,e,n,r,s);return s&&s(A),A}};return T}function Zd(t){if(mu(t))return t=Lr(t),t.children=null,t}function _y(t){if(!mu(t))return Sw(t.type)&&t.children?Dw(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&ye(n.default))return n.default()}}function Vo(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Vo(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function xw(t,e=!1,n){let r=[],s=0;for(let i=0;i<t.length;i++){let o=t[i];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:i);o.type===Qt?(o.patchFlag&128&&s++,r=r.concat(xw(o.children,e,a))):(e||o.type!==yt)&&r.push(a!=null?Lr(o,{key:a}):o)}if(s>1)for(let i=0;i<r.length;i++)r[i].patchFlag=-2;return r}function Hr(t,e){return ye(t)?Lt({name:t.name},e,{setup:t}):t}function Rm(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}const zl=new WeakMap;function Po(t,e,n,r,s=!1){if(pe(t)){t.forEach((_,E)=>Po(_,e&&(pe(e)?e[E]:e),n,r,s));return}if(vs(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Po(t,e,n,r.component.subTree);return}const i=r.shapeFlag&4?qh(r.component):r.el,o=s?null:i,{i:a,r:c}=t,l=e&&e.r,h=a.refs===ze?a.refs={}:a.refs,d=a.setupState,f=Ne(d),m=d===ze?JT:_=>Me(f,_);if(l!=null&&l!==c){if(yy(e),it(l))h[l]=null,m(l)&&(d[l]=null);else if(at(l)){l.value=null;const _=e;_.k&&(h[_.k]=null)}}if(ye(c))pu(c,a,12,[o,h]);else{const _=it(c),E=at(c);if(_||E){const v=()=>{if(t.f){const O=_?m(c)?d[c]:h[c]:c.value;if(s)pe(O)&&um(O,i);else if(pe(O))O.includes(i)||O.push(i);else if(_)h[c]=[i],m(c)&&(d[c]=h[c]);else{const N=[i];c.value=N,t.k&&(h[t.k]=N)}}else _?(h[c]=o,m(c)&&(d[c]=o)):E&&(c.value=o,t.k&&(h[t.k]=o))};if(o){const O=()=>{v(),zl.delete(t)};O.id=-1,zl.set(t,O),bt(O,n)}else yy(t),v()}}}function yy(t){const e=zl.get(t);e&&(e.flags|=8,zl.delete(t))}let Ey=!1;const io=()=>{Ey||(console.error("Hydration completed but contains mismatches."),Ey=!0)},y0=t=>t.namespaceURI.includes("svg")&&t.tagName!=="foreignObject",E0=t=>t.namespaceURI.includes("MathML"),el=t=>{if(t.nodeType===1){if(y0(t))return"svg";if(E0(t))return"mathml"}},To=t=>t.nodeType===8;function I0(t){const{mt:e,p:n,o:{patchProp:r,createText:s,nextSibling:i,parentNode:o,remove:a,insert:c,createComment:l}}=t,h=(y,S)=>{if(!S.hasChildNodes()){n(null,y,S),Wl(),S._vnode=y;return}d(S.firstChild,y,null,null,null),Wl(),S._vnode=y},d=(y,S,D,M,b,T=!1)=>{T=T||!!S.dynamicChildren;const I=To(y)&&y.data==="[",A=()=>E(y,S,D,M,b,I),{type:C,ref:k,shapeFlag:R,patchFlag:ge}=S;let Te=y.nodeType;S.el=y,ge===-2&&(T=!1,S.dynamicChildren=null);let se=null;switch(C){case bi:Te!==3?S.children===""?(c(S.el=s(""),o(y),y),se=y):se=A():(y.data!==S.children&&(io(),y.data=S.children),se=i(y));break;case yt:N(y)?(se=i(y),O(S.el=y.content.firstChild,y,D)):Te!==8||I?se=A():se=i(y);break;case Ec:if(I&&(y=i(y),Te=y.nodeType),Te===1||Te===3){se=y;const de=!S.children.length;for(let ae=0;ae<S.staticCount;ae++)de&&(S.children+=se.nodeType===1?se.outerHTML:se.data),ae===S.staticCount-1&&(S.anchor=se),se=i(se);return I?i(se):se}else A();break;case Qt:I?se=_(y,S,D,M,b,T):se=A();break;default:if(R&1)(Te!==1||S.type.toLowerCase()!==y.tagName.toLowerCase())&&!N(y)?se=A():se=f(y,S,D,M,b,T);else if(R&6){S.slotScopeIds=b;const de=o(y);if(I?se=v(y):To(y)&&y.data==="teleport start"?se=v(y,y.data,"teleport end"):se=i(y),e(S,de,null,D,M,el(de),T),vs(S)&&!S.type.__asyncResolved){let ae;I?(ae=Oe(Qt),ae.anchor=se?se.previousSibling:de.lastChild):ae=y.nodeType===3?di(""):Oe("div"),ae.el=y,S.component.subTree=ae}}else R&64?Te!==8?se=A():se=S.type.hydrate(y,S,D,M,b,T,t,m):R&128&&(se=S.type.hydrate(y,S,D,M,el(o(y)),b,T,t,d))}return k!=null&&Po(k,null,M,S),se},f=(y,S,D,M,b,T)=>{T=T||!!S.dynamicChildren;const{type:I,props:A,patchFlag:C,shapeFlag:k,dirs:R,transition:ge}=S,Te=I==="input"||I==="option";if(Te||C!==-1){R&&Yn(S,null,D,"created");let se=!1;if(N(y)){se=rv(null,ge)&&D&&D.vnode.props&&D.vnode.props.appear;const ae=y.content.firstChild;if(se){const Ge=ae.getAttribute("class");Ge&&(ae.$cls=Ge),ge.beforeEnter(ae)}O(ae,y,D),S.el=y=ae}if(k&16&&!(A&&(A.innerHTML||A.textContent))){let ae=m(y.firstChild,S,y,D,M,b,T);for(;ae;){tl(y,1)||io();const Ge=ae;ae=ae.nextSibling,a(Ge)}}else if(k&8){let ae=S.children;ae[0]===`
3`&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&(ae=ae.slice(1)),y.textContent!==ae&&(tl(y,0)||io(),y.textContent=S.children)}if(A){if(Te||!T||C&48){const ae=y.tagName.includes("-");for(const Ge in A)(Te&&(Ge.endsWith("value")||Ge==="indeterminate")||du(Ge)&&!Ao(Ge)||Ge[0]==="."||ae)&&r(y,Ge,null,A[Ge],void 0,D)}else if(A.onClick)r(y,"onClick",null,A.onClick,void 0,D);else if(C&4&&kr(A.style))for(const ae in A.style)A.style[ae]}let de;(de=A&&A.onVnodeBeforeMount)&&cn(de,D,S),R&&Yn(S,null,D,"beforeMount"),((de=A&&A.onVnodeMounted)||R||se)&&cv(()=>{de&&cn(de,D,S),se&&ge.enter(y),R&&Yn(S,null,D,"mounted")},M)}return y.nextSibling},m=(y,S,D,M,b,T,I)=>{I=I||!!S.dynamicChildren;const A=S.children,C=A.length;for(let k=0;k<C;k++){const R=I?A[k]:A[k]=wn(A[k]),ge=R.type===bi;y?(ge&&!I&&k+1<C&&wn(A[k+1]).type===bi&&(c(s(y.data.slice(R.children.length)),D,i(y)),y.data=R.children),y=d(y,R,M,b,T,I)):ge&&!R.children?c(R.el=s(""),D):(tl(D,1)||io(),n(null,R,D,null,M,b,el(D),T))}return y},_=(y,S,D,M,b,T)=>{const{slotScopeIds:I}=S;I&&(b=b?b.concat(I):I);const A=o(y),C=m(i(y),S,A,D,M,b,T);return C&&To(C)&&C.data==="]"?i(S.anchor=C):(io(),c(S.anchor=l("]"),A,C),C)},E=(y,S,D,M,b,T)=>{if(tl(y.parentElement,1)||io(),S.el=null,T){const C=v(y);for(;;){const k=i(y);if(k&&k!==C)a(k);else break}}const I=i(y),A=o(y);return a(y),n(null,S,A,I,D,M,el(A),b),D&&(D.vnode.el=S.el,$h(D,S.el)),I},v=(y,S="[",D="]")=>{let M=0;for(;y;)if(y=i(y),y&&To(y)&&(y.data===S&&M++,y.data===D)){if(M===0)return i(y);M--}return y},O=(y,S,D)=>{const M=S.parentNode;M&&M.replaceChild(y,S);let b=D;for(;b;)b.vnode.el===S&&(b.vnode.el=b.subTree.el=y),b=b.parent},N=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[h,d]}const Iy="data-allow-mismatch",T0={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function tl(t,e){if(e===0||e===1)for(;t&&!t.hasAttribute(Iy);)t=t.parentElement;const n=t&&t.getAttribute(Iy);if(n==null)return!1;if(n==="")return!0;{const r=n.split(",");return e===0&&r.includes("children")?!0:r.includes(T0[e])}}Mh().requestIdleCallback;Mh().cancelIdleCallback;function w0(t,e){if(To(t)&&t.data==="["){let n=1,r=t.nextSibling;for(;r;){if(r.nodeType===1){if(e(r)===!1)break}else if(To(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else e(t)}const vs=t=>!!t.type.__asyncLoader;function oo(t){ye(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:r,delay:s=200,hydrate:i,timeout:o,suspensible:a=!0,onError:c}=t;let l=null,h,d=0;const f=()=>(d++,l=null,m()),m=()=>{let _;return l||(_=l=e().catch(E=>{if(E=E instanceof Error?E:new Error(String(E)),c)return new Promise((v,O)=>{c(E,()=>v(f()),()=>O(E),d+1)});throw E}).then(E=>_!==l&&l?l:(E&&(E.__esModule||E[Symbol.toStringTag]==="Module")&&(E=E.default),h=E,E)))};return Hr({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(_,E,v){let O=!1;(E.bu||(E.bu=[])).push(()=>O=!0);const N=()=>{O||v()},y=i?()=>{const S=i(N,D=>w0(_,D));S&&(E.bum||(E.bum=[])).push(S)}:N;h?y():m().then(()=>!E.isUnmounted&&y())},get __asyncResolved(){return h},setup(){const _=Bt;if(Rm(_),h)return()=>ef(h,_);const E=y=>{l=null,da(y,_,13,!r)};if(a&&_.suspense||Mo)return m().then(y=>()=>ef(y,_)).catch(y=>(E(y),()=>r?Oe(r,{error:y}):null));const v=pn(!1),O=pn(),N=pn(!!s);return s&&setTimeout(()=>{N.value=!1},s),o!=null&&setTimeout(()=>{if(!v.value&&!O.value){const y=new Error(`Async component timed out after ${o}ms.`);E(y),O.value=y}},o),m().then(()=>{v.value=!0,_.parent&&mu(_.parent.vnode)&&_.parent.update()}).catch(y=>{E(y),O.value=y}),()=>{if(v.value&&h)return ef(h,_);if(O.value&&r)return Oe(r,{error:O.value});if(n&&!N.value)return Oe(n)}}})}function ef(t,e){const{ref:n,props:r,children:s,ce:i}=e.vnode,o=Oe(t,r,s);return o.ref=n,o.ce=i,delete e.vnode.ce,o}const mu=t=>t.type.__isKeepAlive,v0={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const n=Gi(),r=n.ctx;if(!r.renderer)return()=>{const N=e.default&&e.default();return N&&N.length===1?N[0]:N};const s=new Map,i=new Set;let o=null;const a=n.suspense,{renderer:{p:c,m:l,um:h,o:{createElement:d}}}=r,f=d("div");r.activate=(N,y,S,D,M)=>{const b=N.component;l(N,y,S,0,a),c(b.vnode,N,y,S,b,a,D,N.slotScopeIds,M),bt(()=>{b.isDeactivated=!1,b.a&&Ro(b.a);const T=N.props&&N.props.onVnodeMounted;T&&cn(T,b.parent,N)},a)},r.deactivate=N=>{const y=N.component;Jl(y.m),Jl(y.a),l(N,f,null,1,a),bt(()=>{y.da&&Ro(y.da);const S=N.props&&N.props.onVnodeUnmounted;S&&cn(S,y.parent,N),y.isDeactivated=!0},a)};function m(N){tf(N),h(N,n,a,!0)}function _(N){s.forEach((y,S)=>{const D=ep(y.type);D&&!N(D)&&E(S)})}function E(N){const y=s.get(N);y&&(!o||!Vn(y,o))?m(y):o&&tf(o),s.delete(N),i.delete(N)}vi(()=>[t.include,t.exclude],([N,y])=>{N&&_(S=>oc(N,S)),y&&_(S=>!oc(y,S))},{flush:"post",deep:!0});let v=null;const O=()=>{v!=null&&(Yl(n.subTree.type)?bt(()=>{s.set(v,nl(n.subTree))},n.subTree.suspense):s.set(v,nl(n.subTree)))};return Bh(O),Fw(O),fa(()=>{s.forEach(N=>{const{subTree:y,suspense:S}=n,D=nl(y);if(N.type===D.type&&N.key===D.key){tf(D);const M=D.component.da;M&&bt(M,S);return}m(N)})}),()=>{if(v=null,!e.default)return o=null;const N=e.default(),y=N[0];if(N.length>1)return o=null,N;if(!Ni(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return o=null,y;let S=nl(y);if(S.type===yt)return o=null,S;const D=S.type,M=ep(vs(S)?S.type.__asyncResolved||{}:D),{include:b,exclude:T,max:I}=t;if(b&&(!M||!oc(b,M))||T&&M&&oc(T,M))return S.shapeFlag&=-257,o=S,y;const A=S.key==null?D:S.key,C=s.get(A);return S.el&&(S=Lr(S),y.shapeFlag&128&&(y.ssContent=S)),v=A,C?(S.el=C.el,S.component=C.component,S.transition&&Vo(S,S.transition),S.shapeFlag|=512,i.delete(A),i.add(A)):(i.add(A),I&&i.size>parseInt(I,10)&&E(i.values().next().value)),S.shapeFlag|=256,o=S,Yl(y.type)?y:S}}},b0=v0;function oc(t,e){return pe(t)?t.some(n=>oc(n,e)):it(t)?t.split(",").includes(e):bC(t)?(t.lastIndex=0,t.test(e)):!1}function Vw(t,e){Mw(t,"a",e)}function Lw(t,e){Mw(t,"da",e)}function Mw(t,e,n=Bt){const r=t.__wdc||(t.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return t()});if(Uh(e,r,n),n){let s=n.parent;for(;s&&s.parent;)mu(s.parent.vnode)&&A0(r,e,n,s),s=s.parent}}function A0(t,e,n,r){const s=Uh(e,t,r,!0);Uw(()=>{um(r[e],s)},n)}function tf(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function nl(t){return t.shapeFlag&128?t.ssContent:t}function Uh(t,e,n=Bt,r=!1){if(n){const s=n[t]||(n[t]=[]),i=e.__weh||(e.__weh=(...o)=>{Or();const a=Di(n),c=$n(e,n,t,o);return a(),xr(),c});return r?s.unshift(i):s.push(i),i}}const Gr=t=>(e,n=Bt)=>{(!Mo||t==="sp")&&Uh(t,(...r)=>e(...r),n)},R0=Gr("bm"),Bh=Gr("m"),S0=Gr("bu"),Fw=Gr("u"),fa=Gr("bum"),Uw=Gr("um"),P0=Gr("sp"),C0=Gr("rtg"),k0=Gr("rtc");function Bw(t,e=Bt){Uh("ec",t,e)}const jw="components";function Ty(t,e){return qw(jw,t,!0,e)||t}const $w=Symbol.for("v-ndc");function N0(t){return it(t)?qw(jw,t,!1)||t:t||$w}function qw(t,e,n=!0,r=!1){const s=$t||Bt;if(s){const i=s.type;{const a=ep(i,!1);if(a&&(a===e||a===kn(e)||a===Lh(kn(e))))return i}const o=wy(s[t]||i[t],e)||wy(s.appContext[t],e);return!o&&r?i:o}}function wy(t,e){return t&&(t[e]||t[kn(e)]||t[Lh(kn(e))])}function vq(t,e,n,r){let s;const i=n,o=pe(t);if(o||it(t)){const a=o&&kr(t);let c=!1,l=!1;a&&(c=!Sn(t),l=Vr(t),t=Fh(t)),s=new Array(t.length);for(let h=0,d=t.length;h<d;h++)s[h]=e(c?l?ql(Ut(t[h])):Ut(t[h]):t[h],h,void 0,i)}else if(typeof t=="number"){s=new Array(t);for(let a=0;a<t;a++)s[a]=e(a+1,a,void 0,i)}else if(qe(t))if(t[Symbol.iterator])s=Array.from(t,(a,c)=>e(a,c,void 0,i));else{const a=Object.keys(t);s=new Array(a.length);for(let c=0,l=a.length;c<l;c++){const h=a[c];s[c]=e(t[h],h,c,i)}}else s=[];return s}function bq(t,e,n={},r,s){if($t.ce||$t.parent&&vs($t.parent)&&$t.parent.ce){const l=Object.keys(n).length>0;return nn(),ms(Qt,null,[Oe("slot",n,r)],l?-2:64)}let i=t[e];i&&i._c&&(i._d=!1),nn();const o=i&&Hw(i(n)),a=n.key||o&&o.key,c=ms(Qt,{key:(a&&!jn(a)?a:`_${e}`)+(!o&&r?"_fb":"")},o||[],o&&t._===1?64:-2);return c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),i&&i._c&&(i._d=!0),c}function Hw(t){return t.some(e=>Ni(e)?!(e.type===yt||e.type===Qt&&!Hw(e.children)):!0)?t:null}const Wf=t=>t?fv(t)?qh(t):Wf(t.parent):null,yc=Lt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Wf(t.parent),$root:t=>Wf(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Ww(t),$forceUpdate:t=>t.f||(t.f=()=>{Am(t.update)}),$nextTick:t=>t.n||(t.n=Ds.bind(t.proxy)),$watch:t=>X0.bind(t)}),nf=(t,e)=>t!==ze&&!t.__isScriptSetup&&Me(t,e),D0={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:i,accessCache:o,type:a,appContext:c}=t;let l;if(e[0]!=="$"){const m=o[e];if(m!==void 0)switch(m){case 1:return r[e];case 2:return s[e];case 4:return n[e];case 3:return i[e]}else{if(nf(r,e))return o[e]=1,r[e];if(s!==ze&&Me(s,e))return o[e]=2,s[e];if((l=t.propsOptions[0])&&Me(l,e))return o[e]=3,i[e];if(n!==ze&&Me(n,e))return o[e]=4,n[e];Kf&&(o[e]=0)}}const h=yc[e];let d,f;if(h)return e==="$attrs"&&zt(t.attrs,"get",""),h(t);if((d=a.__cssModules)&&(d=d[e]))return d;if(n!==ze&&Me(n,e))return o[e]=4,n[e];if(f=c.config.globalProperties,Me(f,e))return f[e]},set({_:t},e,n){const{data:r,setupState:s,ctx:i}=t;return nf(s,e)?(s[e]=n,!0):r!==ze&&Me(r,e)?(r[e]=n,!0):Me(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(i[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:s,propsOptions:i,type:o}},a){let c,l;return!!(n[a]||t!==ze&&a[0]!=="$"&&Me(t,a)||nf(e,a)||(c=i[0])&&Me(c,a)||Me(r,a)||Me(yc,a)||Me(s.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Me(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function vy(t){return pe(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function Aq(t){const e=Gi();let n=t();return Xf(),lm(n)&&(n=n.catch(r=>{throw Di(e),r})),[n,()=>Di(e)]}let Kf=!0;function O0(t){const e=Ww(t),n=t.proxy,r=t.ctx;Kf=!1,e.beforeCreate&&by(e.beforeCreate,t,"bc");const{data:s,computed:i,methods:o,watch:a,provide:c,inject:l,created:h,beforeMount:d,mounted:f,beforeUpdate:m,updated:_,activated:E,deactivated:v,beforeDestroy:O,beforeUnmount:N,destroyed:y,unmounted:S,render:D,renderTracked:M,renderTriggered:b,errorCaptured:T,serverPrefetch:I,expose:A,inheritAttrs:C,components:k,directives:R,filters:ge}=e;if(l&&x0(l,r,null),o)for(const de in o){const ae=o[de];ye(ae)&&(r[de]=ae.bind(n))}if(s){const de=s.call(n,n);qe(de)&&(t.data=qr(de))}if(Kf=!0,i)for(const de in i){const ae=i[de],Ge=ye(ae)?ae.bind(n,n):ye(ae.get)?ae.get.bind(n,n):sr,Wn=!ye(ae)&&ye(ae.set)?ae.set.bind(n):sr,yn=Ue({get:Ge,set:Wn});Object.defineProperty(r,de,{enumerable:!0,configurable:!0,get:()=>yn.value,set:Mt=>yn.value=Mt})}if(a)for(const de in a)Gw(a[de],r,n,de);if(c){const de=ye(c)?c.call(n):c;Reflect.ownKeys(de).forEach(ae=>{bs(ae,de[ae])})}h&&by(h,t,"c");function se(de,ae){pe(ae)?ae.forEach(Ge=>de(Ge.bind(n))):ae&&de(ae.bind(n))}if(se(R0,d),se(Bh,f),se(S0,m),se(Fw,_),se(Vw,E),se(Lw,v),se(Bw,T),se(k0,M),se(C0,b),se(fa,N),se(Uw,S),se(P0,I),pe(A))if(A.length){const de=t.exposed||(t.exposed={});A.forEach(ae=>{Object.defineProperty(de,ae,{get:()=>n[ae],set:Ge=>n[ae]=Ge,enumerable:!0})})}else t.exposed||(t.exposed={});D&&t.render===sr&&(t.render=D),C!=null&&(t.inheritAttrs=C),k&&(t.components=k),R&&(t.directives=R),I&&Rm(t)}function x0(t,e,n=sr){pe(t)&&(t=zf(t));for(const r in t){const s=t[r];let i;qe(s)?"default"in s?i=Ot(s.from||r,s.default,!0):i=Ot(s.from||r):i=Ot(s),at(i)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):e[r]=i}}function by(t,e,n){$n(pe(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function Gw(t,e,n,r){let s=r.includes(".")?iv(n,r):()=>n[r];if(it(t)){const i=e[t];ye(i)&&vi(s,i)}else if(ye(t))vi(s,t.bind(n));else if(qe(t))if(pe(t))t.forEach(i=>Gw(i,e,n,r));else{const i=ye(t.handler)?t.handler.bind(n):e[t.handler];ye(i)&&vi(s,i,t)}}function Ww(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:s,optionsCache:i,config:{optionMergeStrategies:o}}=t.appContext,a=i.get(e);let c;return a?c=a:!s.length&&!n&&!r?c=e:(c={},s.length&&s.forEach(l=>Ql(c,l,o,!0)),Ql(c,e,o)),qe(e)&&i.set(e,c),c}function Ql(t,e,n,r=!1){const{mixins:s,extends:i}=e;i&&Ql(t,i,n,!0),s&&s.forEach(o=>Ql(t,o,n,!0));for(const o in e)if(!(r&&o==="expose")){const a=V0[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const V0={data:Ay,props:Ry,emits:Ry,methods:ac,computed:ac,beforeCreate:Zt,created:Zt,beforeMount:Zt,mounted:Zt,beforeUpdate:Zt,updated:Zt,beforeDestroy:Zt,beforeUnmount:Zt,destroyed:Zt,unmounted:Zt,activated:Zt,deactivated:Zt,errorCaptured:Zt,serverPrefetch:Zt,components:ac,directives:ac,watch:M0,provide:Ay,inject:L0};function Ay(t,e){return e?t?function(){return Lt(ye(t)?t.call(this,this):t,ye(e)?e.call(this,this):e)}:e:t}function L0(t,e){return ac(zf(t),zf(e))}function zf(t){if(pe(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Zt(t,e){return t?[...new Set([].concat(t,e))]:e}function ac(t,e){return t?Lt(Object.create(null),t,e):e}function Ry(t,e){return t?pe(t)&&pe(e)?[...new Set([...t,...e])]:Lt(Object.create(null),vy(t),vy(e??{})):e}function M0(t,e){if(!t)return e;if(!e)return t;const n=Lt(Object.create(null),t);for(const r in e)n[r]=Zt(t[r],e[r]);return n}function Kw(){return{app:null,config:{isNativeTag:JT,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let F0=0;function U0(t,e){return function(r,s=null){ye(r)||(r=Lt({},r)),s!=null&&!qe(s)&&(s=null);const i=Kw(),o=new WeakSet,a=[];let c=!1;const l=i.app={_uid:F0++,_component:r,_props:s,_container:null,_context:i,_instance:null,version:wk,get config(){return i.config},set config(h){},use(h,...d){return o.has(h)||(h&&ye(h.install)?(o.add(h),h.install(l,...d)):ye(h)&&(o.add(h),h(l,...d))),l},mixin(h){return i.mixins.includes(h)||i.mixins.push(h),l},component(h,d){return d?(i.components[h]=d,l):i.components[h]},directive(h,d){return d?(i.directives[h]=d,l):i.directives[h]},mount(h,d,f){if(!c){const m=l._ceVNode||Oe(r,s);return m.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&e?e(m,h):t(m,h,f),c=!0,l._container=h,h.__vue_app__=l,qh(m.component)}},onUnmount(h){a.push(h)},unmount(){c&&($n(a,l._instance,16),t(null,l._container),delete l._container.__vue_app__)},provide(h,d){return i.provides[h]=d,l},runWithContext(h){const d=wi;wi=l;try{return h()}finally{wi=d}}};return l}}let wi=null;function bs(t,e){if(Bt){let n=Bt.provides;const r=Bt.parent&&Bt.parent.provides;r===n&&(n=Bt.provides=Object.create(r)),n[t]=e}}function Ot(t,e,n=!1){const r=Gi();if(r||wi){let s=wi?wi._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&t in s)return s[t];if(arguments.length>1)return n&&ye(e)?e.call(r&&r.proxy):e}}function gu(){return!!(Gi()||wi)}const zw={},Qw=()=>Object.create(zw),Jw=t=>Object.getPrototypeOf(t)===zw;function B0(t,e,n,r=!1){const s={},i=Qw();t.propsDefaults=Object.create(null),Yw(t,e,s,i);for(const o in t.propsOptions[0])o in s||(s[o]=void 0);n?t.props=r?s:er(s):t.type.props?t.props=s:t.props=i,t.attrs=i}function j0(t,e,n,r){const{props:s,attrs:i,vnode:{patchFlag:o}}=t,a=Ne(s),[c]=t.propsOptions;let l=!1;if((r||o>0)&&!(o&16)){if(o&8){const h=t.vnode.dynamicProps;for(let d=0;d<h.length;d++){let f=h[d];if(jh(t.emitsOptions,f))continue;const m=e[f];if(c)if(Me(i,f))m!==i[f]&&(i[f]=m,l=!0);else{const _=kn(f);s[_]=Qf(c,a,_,m,t,!1)}else m!==i[f]&&(i[f]=m,l=!0)}}}else{Yw(t,e,s,i)&&(l=!0);let h;for(const d in a)(!e||!Me(e,d)&&((h=Hi(d))===d||!Me(e,h)))&&(c?n&&(n[d]!==void 0||n[h]!==void 0)&&(s[d]=Qf(c,a,d,void 0,t,!0)):delete s[d]);if(i!==a)for(const d in i)(!e||!Me(e,d))&&(delete i[d],l=!0)}l&&Er(t.attrs,"set","")}function Yw(t,e,n,r){const[s,i]=t.propsOptions;let o=!1,a;if(e)for(let c in e){if(Ao(c))continue;const l=e[c];let h;s&&Me(s,h=kn(c))?!i||!i.includes(h)?n[h]=l:(a||(a={}))[h]=l:jh(t.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(i){const c=Ne(n),l=a||ze;for(let h=0;h<i.length;h++){const d=i[h];n[d]=Qf(s,c,d,l[d],t,!Me(l,d))}}return o}function Qf(t,e,n,r,s,i){const o=t[n];if(o!=null){const a=Me(o,"default");if(a&&r===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&ye(c)){const{propsDefaults:l}=s;if(n in l)r=l[n];else{const h=Di(s);r=l[n]=c.call(null,e),h()}}else r=c;s.ce&&s.ce._setProp(n,r)}o[0]&&(i&&!a?r=!1:o[1]&&(r===""||r===Hi(n))&&(r=!0))}return r}const $0=new WeakMap;function Xw(t,e,n=!1){const r=n?$0:e.propsCache,s=r.get(t);if(s)return s;const i=t.props,o={},a=[];let c=!1;if(!ye(t)){const h=d=>{c=!0;const[f,m]=Xw(d,e,!0);Lt(o,f),m&&a.push(...m)};!n&&e.mixins.length&&e.mixins.forEach(h),t.extends&&h(t.extends),t.mixins&&t.mixins.forEach(h)}if(!i&&!c)return qe(t)&&r.set(t,vo),vo;if(pe(i))for(let h=0;h<i.length;h++){const d=kn(i[h]);Sy(d)&&(o[d]=ze)}else if(i)for(const h in i){const d=kn(h);if(Sy(d)){const f=i[h],m=o[d]=pe(f)||ye(f)?{type:f}:Lt({},f),_=m.type;let E=!1,v=!0;if(pe(_))for(let O=0;O<_.length;++O){const N=_[O],y=ye(N)&&N.name;if(y==="Boolean"){E=!0;break}else y==="String"&&(v=!1)}else E=ye(_)&&_.name==="Boolean";m[0]=E,m[1]=v,(E||Me(m,"default"))&&a.push(d)}}const l=[o,a];return qe(t)&&r.set(t,l),l}function Sy(t){return t[0]!=="$"&&!Ao(t)}const Sm=t=>t==="_"||t==="_ctx"||t==="$stable",Pm=t=>pe(t)?t.map(wn):[wn(t)],q0=(t,e,n)=>{if(e._n)return e;const r=Jn((...s)=>Pm(e(...s)),n);return r._c=!1,r},Zw=(t,e,n)=>{const r=t._ctx;for(const s in t){if(Sm(s))continue;const i=t[s];if(ye(i))e[s]=q0(s,i,r);else if(i!=null){const o=Pm(i);e[s]=()=>o}}},ev=(t,e)=>{const n=Pm(e);t.slots.default=()=>n},tv=(t,e,n)=>{for(const r in e)(n||!Sm(r))&&(t[r]=e[r])},H0=(t,e,n)=>{const r=t.slots=Qw();if(t.vnode.shapeFlag&32){const s=e._;s?(tv(r,e,n),n&&ZT(r,"_",s,!0)):Zw(e,r)}else e&&ev(t,e)},G0=(t,e,n)=>
vendor: 3,674 bytes, line 3
3{const{vnode:r,slots:s}=t;let i=!0,o=ze;if(r.shapeFlag&32){const a=e._;a?n&&a===1?i=!1:tv(s,e,n):(i=!e.$stable,Zw(e,s)),o=e}else e&&(ev(t,e),o={default:1});if(i)for(const a in s)!Sm(a)&&o[a]==null&&delete s[a]},bt=cv;function W0(t){return nv(t)}function K0(t){return nv(t,I0)}function nv(t,e){const n=Mh();n.__VUE__=!0;const{insert:r,remove:s,patchProp:i,createElement:o,createText:a,createComment:c,setText:l,setElementText:h,parentNode:d,nextSibling:f,setScopeId:m=sr,insertStaticContent:_}=t,E=(P,x,U,G=null,j=null,W=null,J=void 0,K=null,Y=!!x.dynamicChildren)=>{if(P===x)return;P&&!Vn(P,x)&&(G=q(P),Mt(P,j,W,!0),P=null),x.patchFlag===-2&&(Y=!1,x.dynamicChildren=null);const{type:z,ref:me,shapeFlag:ne}=x;switch(z){case bi:v(P,x,U,G);break;case yt:O(P,x,U,G);break;case Ec:P==null&&N(x,U,G,J);break;case Qt:k(P,x,U,G,j,W,J,K,Y);break;default:ne&1?D(P,x,U,G,j,W,J,K,Y):ne&6?R(P,x,U,G,j,W,J,K,Y):(ne&64||ne&128)&&z.process(P,x,U,G,j,W,J,K,Y,fe)}me!=null&&j?Po(me,P&&P.ref,W,x||P,!x):me==null&&P&&P.ref!=null&&Po(P.ref,null,W,P,!0)},v=(P,x,U,G)=>{if(P==null)r(x.el=a(x.children),U,G);else{const j=x.el=P.el;x.children!==P.children&&l(j,x.children)}},O=(P,x,U,G)=>{P==null?r(x.el=c(x.children||""),U,G):x.el=P.el},N=(P,x,U,G)=>{[P.el,P.anchor]=_(P.children,x,U,G,P.el,P.anchor)},y=({el:P,anchor:x},U,G)=>{let j;for(;P&&P!==x;)j=f(P),r(P,U,G),P=j;r(x,U,G)},S=({el:P,anchor:x})=>{let U;for(;P&&P!==x;)U=f(P),s(P),P=U;s(x)},D=(P,x,U,G,j,W,J,K,Y)=>{x.type==="svg"?J="svg":x.type==="math"&&(J="mathml"),P==null?M(x,U,G,j,W,J,K,Y):I(P,x,j,W,J,K,Y)},M=(P,x,U,G,j,W,J,K)=>{let Y,z;const{props:me,shapeFlag:ne,transition:le,dirs:Ee}=P;if(Y=P.el=o(P.type,W,me&&me.is,me),ne&8?h(Y,P.children):ne&16&&T(P.children,Y,null,G,j,rf(P,W),J,K),Ee&&Yn(P,null,G,"created"),b(Y,P,P.scopeId,J,G),me){for(const Ve in me)Ve!=="value"&&!Ao(Ve)&&i(Y,Ve,null,me[Ve],W,G);"value"in me&&i(Y,"value",null,me.value,W),(z=me.onVnodeBeforeMount)&&cn(z,G,P)}Ee&&Yn(P,null,G,"beforeMount");const Re=rv(j,le);Re&&le.beforeEnter(Y),r(Y,x,U),((z=me&&me.onVnodeMounted)||Re||Ee)&&bt(()=>{z&&cn(z,G,P),Re&&le.enter(Y),Ee&&Yn(P,null,G,"mounted")},j)},b=(P,x,U,G,j)=>{if(U&&m(P,U),G)for(let W=0;W<G.length;W++)m(P,G[W]);if(j){let W=j.subTree;if(x===W||Yl(W.type)&&(W.ssContent===x||W.ssFallback===x)){const J=j.vnode;b(P,J,J.scopeId,J.slotScopeIds,j.parent)}}},T=(P,x,U,G,j,W,J,K,Y=0)=>{for(let z=Y;z<P.length;z++){const me=P[z]=K?fs(P[z]):wn(P[z]);E(null,me,x,U,G,j,W,J,K)}},I=(P,x,U,G,j,W,J)=>{const K=x.el=P.el;let{patchFlag:Y,dynamicChildren:z,dirs:me}=x;Y|=P.patchFlag&16;const ne=P.props||ze,le=x.props||ze;let Ee;if(U&&ni(U,!1),(Ee=le.onVnodeBeforeUpdate)&&cn(Ee,U,x,P),me&&Yn(x,P,U,"beforeUpdate"),U&&ni(U,!0),(ne.innerHTML&&le.innerHTML==null||ne.textContent&&le.textContent==null)&&h(K,""),z?A(P.dynamicChildren,z,K,U,G,rf(x,j),W):J||ae(P,x,K,null,U,G,rf(x,j),W,!1),Y>0){if(Y&16)C(K,ne,le,U,j);else if(Y&2&&ne.class!==le.class&&i(K,"class",null,le.class,j),Y&4&&i(K,"style",ne.style,le.style,j),Y&8){const Re=x.dynamicProps;for(let Ve=0;Ve<Re.length;Ve++){const De=Re[Ve],Ht=ne[De],It=le[De];(It!==Ht||De==="value")&&i(K,De,Ht,It,j,U)}}Y&1&&P.children!==x.children&&h(K,x.children)}else!J&&z==null&&C(K,ne,le,U,j);((Ee=le.onVnodeUpdated)||me)&&bt(()=>{Ee&&cn(Ee,U,x,P),me&&Yn(x,P,U,"updated")},G)},A=(P,x,U,G,j,W,J)=>{for(let K=0;K<x.length;K++){const Y=P[K],z=x[K],me=Y.el&&(Y.type===Qt||!Vn(Y,z)||Y.shapeFlag&198)?d(Y.el):U;E(Y,z,me,null,G,j,W,J,!0)}},C=(P,x,U,G,j)=>{if(x!==U){if(x!==ze)for(const W in x)!Ao(W)&&!(W in U)&&i(P,W,x[W],null,j,G);for(const W in U){if(Ao(W))continue;const J=U[W],K=x[W];J!==K&&W!=="value"&&i(P,W,K,J,j,G)}"value"in U&&i(P,"value",x.value,U.value,j)}},k=(P,x,U,G,j,W,J,K,Y)=>
vendor: 10,020 bytes, line 3
3{const z=x.el=P?P.el:a(""),me=x.anchor=P?P.anchor:a("");let{patchFlag:ne,dynamicChildren:le,slotScopeIds:Ee}=x;Ee&&(K=K?K.concat(Ee):Ee),P==null?(r(z,U,G),r(me,U,G),T(x.children||[],U,me,j,W,J,K,Y)):ne>0&&ne&64&&le&&P.dynamicChildren?(A(P.dynamicChildren,le,U,j,W,J,K),(x.key!=null||j&&x===j.subTree)&&Cm(P,x,!0)):ae(P,x,U,me,j,W,J,K,Y)},R=(P,x,U,G,j,W,J,K,Y)=>{x.slotScopeIds=K,P==null?x.shapeFlag&512?j.ctx.activate(x,U,G,J,Y):ge(x,U,G,j,W,J,Y):Te(P,x,Y)},ge=(P,x,U,G,j,W,J)=>{const K=P.component=gk(P,G,j);if(mu(P)&&(K.ctx.renderer=fe),_k(K,!1,J),K.asyncDep){if(j&&j.registerDep(K,se,J),!P.el){const Y=K.subTree=Oe(yt);O(null,Y,x,U),P.placeholder=Y.el}}else se(K,P,x,U,j,W,J)},Te=(P,x,U)=>{const G=x.component=P.component;if(ik(P,x,U))if(G.asyncDep&&!G.asyncResolved){de(G,x,U);return}else G.next=x,G.update();else x.el=P.el,G.vnode=x},se=(P,x,U,G,j,W,J)=>{const K=()=>{if(P.isMounted){let{next:ne,bu:le,u:Ee,parent:Re,vnode:Ve}=P;{const Tt=sv(P);if(Tt){ne&&(ne.el=Ve.el,de(P,ne,J)),Tt.asyncDep.then(()=>{P.isUnmounted||K()});return}}let De=ne,Ht;ni(P,!1),ne?(ne.el=Ve.el,de(P,ne,J)):ne=Ve,le&&Ro(le),(Ht=ne.props&&ne.props.onVnodeBeforeUpdate)&&cn(Ht,Re,ne,Ve),ni(P,!0);const It=sf(P),an=P.subTree;P.subTree=It,E(an,It,d(an.el),q(an),P,j,W),ne.el=It.el,De===null&&$h(P,It.el),Ee&&bt(Ee,j),(Ht=ne.props&&ne.props.onVnodeUpdated)&&bt(()=>cn(Ht,Re,ne,Ve),j)}else{let ne;const{el:le,props:Ee}=x,{bm:Re,m:Ve,parent:De,root:Ht,type:It}=P,an=vs(x);if(ni(P,!1),Re&&Ro(Re),!an&&(ne=Ee&&Ee.onVnodeBeforeMount)&&cn(ne,De,x),ni(P,!0),le&&We){const Tt=()=>{P.subTree=sf(P),We(le,P.subTree,P,j,null)};an&&It.__asyncHydrate?It.__asyncHydrate(le,P,Tt):Tt()}else{Ht.ce&&Ht.ce._def.shadowRoot!==!1&&Ht.ce._injectChildStyle(It);const Tt=P.subTree=sf(P);E(null,Tt,U,G,P,j,W),x.el=Tt.el}if(Ve&&bt(Ve,j),!an&&(ne=Ee&&Ee.onVnodeMounted)){const Tt=x;bt(()=>cn(ne,De,Tt),j)}(x.shapeFlag&256||De&&vs(De.vnode)&&De.vnode.shapeFlag&256)&&P.a&&bt(P.a,j),P.isMounted=!0,x=U=G=null}};P.scope.on();const Y=P.effect=new iw(K);P.scope.off();const z=P.update=Y.run.bind(Y),me=P.job=Y.runIfDirty.bind(Y);me.i=P,me.id=P.uid,Y.scheduler=()=>Am(me),ni(P,!0),z()},de=(P,x,U)=>{x.component=P;const G=P.vnode.props;P.vnode=x,P.next=null,j0(P,x.props,G,U),G0(P,x.children,U),Or(),fy(P),xr()},ae=(P,x,U,G,j,W,J,K,Y=!1)=>{const z=P&&P.children,me=P?P.shapeFlag:0,ne=x.children,{patchFlag:le,shapeFlag:Ee}=x;if(le>0){if(le&128){Wn(z,ne,U,G,j,W,J,K,Y);return}else if(le&256){Ge(z,ne,U,G,j,W,J,K,Y);return}}Ee&8?(me&16&&qt(z,j,W),ne!==z&&h(U,ne)):me&16?Ee&16?Wn(z,ne,U,G,j,W,J,K,Y):qt(z,j,W,!0):(me&8&&h(U,""),Ee&16&&T(ne,U,G,j,W,J,K,Y))},Ge=(P,x,U,G,j,W,J,K,Y)=>{P=P||vo,x=x||vo;const z=P.length,me=x.length,ne=Math.min(z,me);let le;for(le=0;le<ne;le++){const Ee=x[le]=Y?fs(x[le]):wn(x[le]);E(P[le],Ee,U,null,j,W,J,K,Y)}z>me?qt(P,j,W,!0,!1,ne):T(x,U,G,j,W,J,K,Y,ne)},Wn=(P,x,U,G,j,W,J,K,Y)=>{let z=0;const me=x.length;let ne=P.length-1,le=me-1;for(;z<=ne&&z<=le;){const Ee=P[z],Re=x[z]=Y?fs(x[z]):wn(x[z]);if(Vn(Ee,Re))E(Ee,Re,U,null,j,W,J,K,Y);else break;z++}for(;z<=ne&&z<=le;){const Ee=P[ne],Re=x[le]=Y?fs(x[le]):wn(x[le]);if(Vn(Ee,Re))E(Ee,Re,U,null,j,W,J,K,Y);else break;ne--,le--}if(z>ne){if(z<=le){const Ee=le+1,Re=Ee<me?x[Ee].el:G;for(;z<=le;)E(null,x[z]=Y?fs(x[z]):wn(x[z]),U,Re,j,W,J,K,Y),z++}}else if(z>le)for(;z<=ne;)Mt(P[z],j,W,!0),z++;else{const Ee=z,Re=z,Ve=new Map;for(z=Re;z<=le;z++){const dt=x[z]=Y?fs(x[z]):wn(x[z]);dt.key!=null&&Ve.set(dt.key,z)}let De,Ht=0;const It=le-Re+1;let an=!1,Tt=0;const fr=new Array(It);for(z=0;z<It;z++)fr[z]=0;for(z=Ee;z<=ne;z++){const dt=P[z];if(Ht>=It){Mt(dt,j,W,!0);continue}let En;if(dt.key!=null)En=Ve.get(dt.key);else for(De=Re;De<=le;De++)if(fr[De-Re]===0&&Vn(dt,x[De])){En=De;break}En===void 0?Mt(dt,j,W,!0):(fr[En-Re]=z+1,En>=Tt?Tt=En:an=!0,E(dt,x[En],U,null,j,W,J,K,Y),Ht++)}const eo=an?z0(fr):vo;for(De=eo.length-1,z=It-1;z>=0;z--){const dt=Re+z,En=x[dt],Ys=x[dt+1],xa=dt+1<me?Ys.el||Ys.placeholder:G;fr[z]===0?E(null,En,U,xa,j,W,J,K,Y):an&&(De<0||z!==eo[De]?yn(En,U,xa,2):De--)}}},yn=(P,x,U,G,j=null)=>{const{el:W,type:J,transition:K,children:Y,shapeFlag:z}=P;if(z&6){yn(P.component.subTree,x,U,G);return}if(z&128){P.suspense.move(x,U,G);return}if(z&64){J.move(P,x,U,fe);return}if(J===Qt){r(W,x,U);for(let ne=0;ne<Y.length;ne++)yn(Y[ne],x,U,G);r(P.anchor,x,U);return}if(J===Ec){y(P,x,U);return}if(G!==2&&z&1&&K)if(G===0)K.beforeEnter(W),r(W,x,U),bt(()=>K.enter(W),j);else{const{leave:ne,delayLeave:le,afterLeave:Ee}=K,Re=()=>{P.ctx.isUnmounted?s(W):r(W,x,U)},Ve=()=>{W._isLeaving&&W[yr](!0),ne(W,()=>{Re(),Ee&&Ee()})};le?le(W,Re,Ve):Ve()}else r(W,x,U)},Mt=(P,x,U,G=!1,j=!1)=>{const{type:W,props:J,ref:K,children:Y,dynamicChildren:z,shapeFlag:me,patchFlag:ne,dirs:le,cacheIndex:Ee}=P;if(ne===-2&&(j=!1),K!=null&&(Or(),Po(K,null,U,P,!0),xr()),Ee!=null&&(x.renderCache[Ee]=void 0),me&256){x.ctx.deactivate(P);return}const Re=me&1&&le,Ve=!vs(P);let De;if(Ve&&(De=J&&J.onVnodeBeforeUnmount)&&cn(De,x,P),me&6)On(P.component,U,G);else{if(me&128){P.suspense.unmount(U,G);return}Re&&Yn(P,null,x,"beforeUnmount"),me&64?P.type.remove(P,x,U,fe,G):z&&!z.hasOnce&&(W!==Qt||ne>0&&ne&64)?qt(z,x,U,!1,!0):(W===Qt&&ne&384||!j&&me&16)&&qt(Y,x,U),G&&dr(P)}(Ve&&(De=J&&J.onVnodeUnmounted)||Re)&&bt(()=>{De&&cn(De,x,P),Re&&Yn(P,null,x,"unmounted")},U)},dr=P=>{const{type:x,el:U,anchor:G,transition:j}=P;if(x===Qt){Dn(U,G);return}if(x===Ec){S(P);return}const W=()=>{s(U),j&&!j.persisted&&j.afterLeave&&j.afterLeave()};if(P.shapeFlag&1&&j&&!j.persisted){const{leave:J,delayLeave:K}=j,Y=()=>J(U,W);K?K(P.el,W,Y):Y()}else W()},Dn=(P,x)=>{let U;for(;P!==x;)U=f(P),s(P),P=U;s(x)},On=(P,x,U)=>{const{bum:G,scope:j,job:W,subTree:J,um:K,m:Y,a:z}=P;Jl(Y),Jl(z),G&&Ro(G),j.stop(),W&&(W.flags|=8,Mt(J,P,x,U)),K&&bt(K,x),bt(()=>{P.isUnmounted=!0},x)},qt=(P,x,U,G=!1,j=!1,W=0)=>{for(let J=W;J<P.length;J++)Mt(P[J],x,U,G,j)},q=P=>{if(P.shapeFlag&6)return q(P.component.subTree);if(P.shapeFlag&128)return P.suspense.next();const x=f(P.anchor||P.el),U=x&&x[Rw];return U?f(U):x};let oe=!1;const te=(P,x,U)=>{P==null?x._vnode&&Mt(x._vnode,null,null,!0):E(x._vnode||null,P,x,null,null,null,U),x._vnode=P,oe||(oe=!0,fy(),Wl(),oe=!1)},fe={p:E,um:Mt,m:yn,r:dr,mt:ge,mc:T,pc:ae,pbc:A,n:q,o:t};let ve,We;return e&&([ve,We]=e(fe)),{render:te,hydrate:ve,createApp:U0(te,ve)}}function rf({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function ni({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function rv(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Cm(t,e,n=!1){const r=t.children,s=e.children;if(pe(r)&&pe(s))for(let i=0;i<r.length;i++){const o=r[i];let a=s[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[i]=fs(s[i]),a.el=o.el),!n&&a.patchFlag!==-2&&Cm(o,a)),a.type===bi&&a.patchFlag!==-1&&(a.el=o.el),a.type===yt&&!a.el&&(a.el=o.el)}}function z0(t){const e=t.slice(),n=[0];let r,s,i,o,a;const c=t.length;for(r=0;r<c;r++){const l=t[r];if(l!==0){if(s=n[n.length-1],t[s]<l){e[r]=s,n.push(r);continue}for(i=0,o=n.length-1;i<o;)a=i+o>>1,t[n[a]]<l?i=a+1:o=a;l<t[n[i]]&&(i>0&&(e[r]=n[i-1]),n[i]=r)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=e[o];return n}function sv(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:sv(e)}function Jl(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}const Q0=Symbol.for("v-scx"),J0=()=>Ot(Q0);function Y0(t,e){return km(t,null,e)}function vi(t,e,n){return km(t,e,n)}function km(t,e,n=ze){const{immediate:r,deep:s,flush:i,once:o}=n,a=Lt({},n),c=e&&r||!e&&i!=="post";let l;if(Mo){if(i==="sync"){const m=J0();l=m.__watcherHandles||(m.__watcherHandles=[])}else if(!c){const m=()=>{};return m.stop=sr,m.resume=sr,m.pause=sr,m}}const h=Bt;a.call=(m,_,E)=>$n(m,h,_,E);let d=!1;i==="post"?a.scheduler=m=>{bt(m,h&&h.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(m,_)=>{_?m():Am(m)}),a.augmentJob=m=>{e&&(m.flags|=4),d&&(m.flags|=2,h&&(m.id=h.uid,m.i=h))};const f=h0(t,e,a);return Mo&&(l?l.push(f):c&&f()),f}function X0(t,e,n){const r=this.proxy,s=it(t)?t.includes(".")?iv(r,t):()=>r[t]:t.bind(r,r);let i;ye(e)?i=e:(i=e.handler,n=e);const o=Di(this),a=km(s,i.bind(r),n);return o(),a}function iv(t,e){const n=e.split(".");return()=>{let r=t;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Z0=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${kn(e)}Modifiers`]||t[`${Hi(e)}Modifiers`];function ek(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||ze;let s=n;const i=e.startsWith("update:"),o=i&&Z0(r,e.slice(7));o&&(o.trim&&(s=n.map(h=>it(h)?h.trim():h)),o.number&&(s=n.map(jl)));let a,c=r[a=zd(e)]||r[a=zd(kn(e))];!c&&i&&(c=r[a=zd(Hi(e))]),c&&$n(c,t,6,s);const l=r[a+"Once"];if(l){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,$n(l,t,6,s)}}const tk=new WeakMap;function ov(t,e,n=!1){const r=n?tk:e.emitsCache,s=r.get(t);if(s!==void 0)return s;const i=t.emits;let o={},a=!1;if(!ye(t)){const c=l=>{const h=ov(l,e,!0);h&&(a=!0,Lt(o,h))};!n&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}return!i&&!a?(qe(t)&&r.set(t,null),null):(pe(i)?i.forEach(c=>o[c]=null):Lt(o,i),qe(t)&&r.set(t,o),o)}function jh(t,e){return!t||!du(e)?!1:(e=e.slice(2).replace(/Once$/,""),Me(t,e[0].toLowerCase()+e.slice(1))||Me(t,Hi(e))||Me(t,e))}function sf(t){const{type:e,vnode:n,proxy:r,withProxy:s,propsOptions:[i],slots:o,attrs:a,emit:c,render:l,renderCache:h,props:d,data:f,setupState:m,ctx:_,inheritAttrs:E}=t,v=Kl(t);let O,N;try{if(n.shapeFlag&4){const S=s||r,D=S;O=wn(l.call(D,S,h,d,m,f,_)),N=a}else{const S=e;O=wn(S.length>1?S(d,{attrs:a,slots:o,emit:c}):S(d,null)),N=e.props?a:rk(a)}}catch(S){Ic.length=0,da(S,t,1),O=Oe(yt)}let y=O;if(N&&E!==!1){const S=Object.keys(N),{shapeFlag:D}=y;S.length&&D&7&&(i&&S.some(cm)&&(N=sk(N,i)),y=Lr(y,N,!1,!0))}return n.dirs&&(y=Lr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Vo(y,n.transition),O=y,Kl(v),O}function nk(t,e=!0){let n;for(let r=0;r<t.length;r++){const s=t[r];
vendor: 4,246 bytes, line 3
3if(Ni(s)){if(s.type!==yt||s.children==="v-if"){if(n)return;n=s}}else return}return n}const rk=t=>{let e;for(const n in t)(n==="class"||n==="style"||du(n))&&((e||(e={}))[n]=t[n]);return e},sk=(t,e)=>{const n={};for(const r in t)(!cm(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function ik(t,e,n){const{props:r,children:s,component:i}=t,{props:o,children:a,patchFlag:c}=e,l=i.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Py(r,o,l):!!o;if(c&8){const h=e.dynamicProps;for(let d=0;d<h.length;d++){const f=h[d];if(o[f]!==r[f]&&!jh(l,f))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?Py(r,o,l):!0:!!o;return!1}function Py(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let s=0;s<r.length;s++){const i=r[s];if(e[i]!==t[i]&&!jh(n,i))return!0}return!1}function $h({vnode:t,parent:e},n){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===t&&(r.el=t.el),r===t)(t=e.vnode).el=n,e=e.parent;else break}}const Yl=t=>t.__isSuspense;let Jf=0;const ok={name:"Suspense",__isSuspense:!0,process(t,e,n,r,s,i,o,a,c,l){if(t==null)ak(e,n,r,s,i,o,a,c,l);else{if(i&&i.deps>0&&!t.suspense.isInFallback){e.suspense=t.suspense,e.suspense.vnode=e,e.el=t.el;return}ck(t,e,n,r,s,o,a,c,l)}},hydrate:uk,normalize:lk},Nm=ok;function $c(t,e){const n=t.props&&t.props[e];ye(n)&&n()}function ak(t,e,n,r,s,i,o,a,c){const{p:l,o:{createElement:h}}=c,d=h("div"),f=t.suspense=av(t,s,r,e,d,n,i,o,a,c);l(null,f.pendingBranch=t.ssContent,d,null,r,f,i,o),f.deps>0?($c(t,"onPending"),$c(t,"onFallback"),l(null,t.ssFallback,e,n,r,null,i,o),Co(f,t.ssFallback)):f.resolve(!1,!0)}function ck(t,e,n,r,s,i,o,a,{p:c,um:l,o:{createElement:h}}){const d=e.suspense=t.suspense;d.vnode=e,e.el=t.el;const f=e.ssContent,m=e.ssFallback,{activeBranch:_,pendingBranch:E,isInFallback:v,isHydrating:O}=d;if(E)d.pendingBranch=f,Vn(E,f)?(c(E,f,d.hiddenContainer,null,s,d,i,o,a),d.deps<=0?d.resolve():v&&(O||(c(_,m,n,r,s,null,i,o,a),Co(d,m)))):(d.pendingId=Jf++,O?(d.isHydrating=!1,d.activeBranch=E):l(E,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=h("div"),v?(c(null,f,d.hiddenContainer,null,s,d,i,o,a),d.deps<=0?d.resolve():(c(_,m,n,r,s,null,i,o,a),Co(d,m))):_&&Vn(_,f)?(c(_,f,n,r,s,d,i,o,a),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,s,d,i,o,a),d.deps<=0&&d.resolve()));else if(_&&Vn(_,f))c(_,f,n,r,s,d,i,o,a),Co(d,f);else if($c(e,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Jf++,c(null,f,d.hiddenContainer,null,s,d,i,o,a),d.deps<=0)d.resolve();else{const{timeout:N,pendingId:y}=d;N>0?setTimeout(()=>{d.pendingId===y&&d.fallback(m)},N):N===0&&d.fallback(m)}}function av(t,e,n,r,s,i,o,a,c,l,h=!1){const{p:d,m:f,um:m,n:_,o:{parentNode:E,remove:v}}=l;let O;const N=hk(t);N&&e&&e.pendingBranch&&(O=e.pendingId,e.deps++);const y=t.props?ew(t.props.timeout):void 0,S=i,D={vnode:t,parent:e,parentComponent:n,namespace:o,container:r,hiddenContainer:s,deps:0,pendingId:Jf++,timeout:typeof y=="number"?y:-1,activeBranch:null,pendingBranch:null,isInFallback:!h,isHydrating:h,isUnmounted:!1,effects:[],resolve(M=!1,b=!1){const{vnode:T,activeBranch:I,pendingBranch:A,pendingId:C,effects:k,parentComponent:R,container:ge}=D;let Te=!1;D.isHydrating?D.isHydrating=!1:M||(Te=I&&A.transition&&A.transition.mode==="out-in",Te&&(I.transition.afterLeave=()=>{C===D.pendingId&&(f(A,ge,i===S?_(I):i,0),qf(k))}),I&&(E(I.el)===ge&&(i=_(I)),m(I,R,D,!0)),Te||f(A,ge,i,0)),Co(D,A),D.pendingBranch=null,D.isInFallback=!1;let se=D.parent,de=!1;for(;se;){if(se.pendingBranch){se.effects.push(...k),de=!0;break}se=se.parent}!de&&!Te&&qf(k),D.effects=[],N&&e&&e.pendingBranch&&O===e.pendingId&&(e.deps--,e.deps===0&&!b&&e.resolve()),$c(T,"onResolve")},fallback(M){if(!D.pendingBranch)return;const{vnode:b,activeBranch:T,parentComponent:I,container:A,namespace:C}=D;$c(b,"onFallback");const k=_(T),R=()=>{D.isInFallback&&(d(null,M,A,k,I,null,C,a,c),Co(D,M))},ge=M.transition&&M.transition.mode==="out-in";ge&&(T.transition.afterLeave=R),D.isInFallback=!0,m(T,I,null,!0),ge||R()},move(M,b,T){D.activeBranch&&f(D.activeBranch,M,b,T),D.container=M},next(){return D.activeBranch&&_(D.activeBranch)},registerDep(M,b,T){const I=!!D.pendingBranch;I&&D.deps++;const A=M.vnode.el;
vendor: 16,856 bytes, line 3
3M.asyncDep.catch(C=>{da(C,M,0)}).then(C=>{if(M.isUnmounted||D.isUnmounted||D.pendingId!==M.suspenseId)return;M.asyncResolved=!0;const{vnode:k}=M;Zf(M,C),A&&(k.el=A);const R=!A&&M.subTree.el;b(M,k,E(A||M.subTree.el),A?null:_(M.subTree),D,o,T),R&&v(R),$h(M,k.el),I&&--D.deps===0&&D.resolve()})},unmount(M,b){D.isUnmounted=!0,D.activeBranch&&m(D.activeBranch,n,M,b),D.pendingBranch&&m(D.pendingBranch,n,M,b)}};return D}function uk(t,e,n,r,s,i,o,a,c){const l=e.suspense=av(e,r,n,t.parentNode,document.createElement("div"),null,s,i,o,a,!0),h=c(t,l.pendingBranch=e.ssContent,n,l,i,o);return l.deps===0&&l.resolve(!1,!0),h}function lk(t){const{shapeFlag:e,children:n}=t,r=e&32;t.ssContent=Cy(r?n.default:n),t.ssFallback=r?Cy(n.fallback):Oe(yt)}function Cy(t){let e;if(ye(t)){const n=Lo&&t._c;n&&(t._d=!1,nn()),t=t(),n&&(t._d=!0,e=ln,uv())}return pe(t)&&(t=nk(t)),t=wn(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(n=>n!==t)),t}function cv(t,e){e&&e.pendingBranch?pe(t)?e.effects.push(...t):e.effects.push(t):qf(t)}function Co(t,e){t.activeBranch=e;const{vnode:n,parentComponent:r}=t;let s=e.el;for(;!s&&e.component;)e=e.component.subTree,s=e.el;n.el=s,r&&r.subTree===n&&(r.vnode.el=s,$h(r,s))}function hk(t){const e=t.props&&t.props.suspensible;return e!=null&&e!==!1}const Qt=Symbol.for("v-fgt"),bi=Symbol.for("v-txt"),yt=Symbol.for("v-cmt"),Ec=Symbol.for("v-stc"),Ic=[];let ln=null;function nn(t=!1){Ic.push(ln=t?null:[])}function uv(){Ic.pop(),ln=Ic[Ic.length-1]||null}let Lo=1;function Xl(t,e=!1){Lo+=t,t<0&&ln&&e&&(ln.hasOnce=!0)}function lv(t){return t.dynamicChildren=Lo>0?ln||vo:null,uv(),Lo>0&&ln&&ln.push(t),t}function wo(t,e,n,r,s,i){return lv(ke(t,e,n,r,s,i,!0))}function ms(t,e,n,r,s){return lv(Oe(t,e,n,r,s,!0))}function Ni(t){return t?t.__v_isVNode===!0:!1}function Vn(t,e){return t.type===e.type&&t.key===e.key}const hv=({key:t})=>t??null,Il=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?it(t)||at(t)||ye(t)?{i:$t,r:t,k:e,f:!!n}:t:null);function ke(t,e=null,n=null,r=0,s=null,i=t===Qt?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&hv(e),ref:e&&Il(e),scopeId:Aw,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:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:$t};return a?(Dm(c,n),i&128&&t.normalize(c)):n&&(c.shapeFlag|=it(n)?8:16),Lo>0&&!o&&ln&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&ln.push(c),c}const Oe=dk;function dk(t,e=null,n=null,r=0,s=null,i=!1){if((!t||t===$w)&&(t=yt),Ni(t)){const a=Lr(t,e,!0);return n&&Dm(a,n),Lo>0&&!i&&ln&&(a.shapeFlag&6?ln[ln.indexOf(t)]=a:ln.push(a)),a.patchFlag=-2,a}if(Tk(t)&&(t=t.__vccOpts),e){e=fk(e);let{class:a,style:c}=e;a&&!it(a)&&(e.class=fm(a)),qe(c)&&(vm(c)&&!pe(c)&&(c=Lt({},c)),e.style=dm(c))}const o=it(t)?1:Yl(t)?128:Sw(t)?64:qe(t)?4:ye(t)?2:0;return ke(t,e,n,r,s,o,i,!0)}function fk(t){return t?vm(t)||Jw(t)?Lt({},t):t:null}function Lr(t,e,n=!1,r=!1){const{props:s,ref:i,patchFlag:o,children:a,transition:c}=t,l=e?dv(s||{},e):s,h={__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&hv(l),ref:e&&e.ref?n&&i?pe(i)?i.concat(Il(e)):[i,Il(e)]:Il(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Qt?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Lr(t.ssContent),ssFallback:t.ssFallback&&Lr(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&r&&Vo(h,c.clone(h)),h}function di(t=" ",e=0){return Oe(bi,null,t,e)}function Rq(t,e){const n=Oe(Ec,null,t);return n.staticCount=e,n}function Sq(t="",e=!1){return e?(nn(),ms(yt,null,t)):Oe(yt,null,t)}function wn(t){return t==null||typeof t=="boolean"?Oe(yt):pe(t)?Oe(Qt,null,t.slice()):Ni(t)?fs(t):Oe(bi,null,String(t))}function fs(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Lr(t)}function Dm(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(pe(e))n=16;else if(typeof e=="object")if(r&65){const s=e.default;s&&(s._c&&(s._d=!1),Dm(t,s()),s._c&&(s._d=!0));return}else{n=32;const s=e._;!s&&!Jw(e)?e._ctx=$t:s===3&&$t&&($t.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ye(e)?(e={default:e,_ctx:$t},n=32):(e=String(e),r&64?(n=16,e=[di(e)]):n=8);t.children=e,t.shapeFlag|=n}function dv(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const s in r)if(s==="class")e.class!==r.class&&(e.class=fm([e.class,r.class]));else if(s==="style")e.style=dm([e.style,r.style]);else if(du(s)){const i=e[s],o=r[s];o&&i!==o&&!(pe(i)&&i.includes(o))&&(e[s]=i?[].concat(i,o):o)}else s!==""&&(e[s]=r[s])}return e}function cn(t,e,n,r=null){$n(t,e,7,[n,r])}const pk=Kw();let mk=0;function gk(t,e,n){const r=t.type,s=(e?e.appContext:t.appContext)||pk,i={uid:mk++,vnode:t,type:r,parent:e,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new sw(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(s.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Xw(r,s),emitsOptions:ov(r,s),emit:null,emitted:null,propsDefaults:ze,inheritAttrs:r.inheritAttrs,ctx:ze,data:ze,props:ze,attrs:ze,slots:ze,refs:ze,setupState:ze,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=e?e.root:i,i.emit=ek.bind(null,i),t.ce&&t.ce(i),i}let Bt=null;const Gi=()=>Bt||$t;let Zl,Yf;{const t=Mh(),e=(n,r)=>{let s;return(s=t[n])||(s=t[n]=[]),s.push(r),i=>{s.length>1?s.forEach(o=>o(i)):s[0](i)}};Zl=e("__VUE_INSTANCE_SETTERS__",n=>Bt=n),Yf=e("__VUE_SSR_SETTERS__",n=>Mo=n)}const Di=t=>{const e=Bt;return Zl(t),t.scope.on(),()=>{t.scope.off(),Zl(e)}},Xf=()=>{Bt&&Bt.scope.off(),Zl(null)};function fv(t){return t.vnode.shapeFlag&4}let Mo=!1;function _k(t,e=!1,n=!1){e&&Yf(e);const{props:r,children:s}=t.vnode,i=fv(t);B0(t,r,i,e),H0(t,s,n||e);const o=i?yk(t,e):void 0;return e&&Yf(!1),o}function yk(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,D0);const{setup:r}=n;if(r){Or();const s=t.setupContext=r.length>1?Ik(t):null,i=Di(t),o=pu(r,t,0,[t.props,s]),a=lm(o);if(xr(),i(),(a||t.sp)&&!vs(t)&&Rm(t),a){if(o.then(Xf,Xf),e)return o.then(c=>{Zf(t,c)}).catch(c=>{da(c,t,0)});t.asyncDep=o}else Zf(t,o)}else pv(t)}function Zf(t,e,n){ye(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:qe(e)&&(t.setupState=Iw(e)),pv(t)}function pv(t,e,n){const r=t.type;t.render||(t.render=r.render||sr);{const s=Di(t);Or();try{O0(t)}finally{xr(),s()}}}const Ek={get(t,e){return zt(t,"get",""),t[e]}};function Ik(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,Ek),slots:t.slots,emit:t.emit,expose:e}}function qh(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Iw(bm(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in yc)return yc[n](t)},has(e,n){return n in e||n in yc}})):t.proxy}function ep(t,e=!0){return ye(t)?t.displayName||t.name:t.name||e&&t.__name}function Tk(t){return ye(t)&&"__vccOpts"in t}const Ue=(t,e)=>u0(t,e,Mo);function Dt(t,e,n){try{Xl(-1);const r=arguments.length;return r===2?qe(e)&&!pe(e)?Ni(e)?Oe(t,null,[e]):Oe(t,e):Oe(t,null,e):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ni(n)&&(n=[n]),Oe(t,e,n))}finally{Xl(1)}}const wk="3.5.22";let tp;const ky=typeof window<"u"&&window.trustedTypes;if(ky)try{tp=ky.createPolicy("vue",{createHTML:t=>t})}catch{}const mv=tp?t=>tp.createHTML(t):t=>t,vk="http://www.w3.org/2000/svg",bk="http://www.w3.org/1998/Math/MathML",_r=typeof document<"u"?document:null,Ny=_r&&_r.createElement("template"),Ak={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const s=e==="svg"?_r.createElementNS(vk,t):e==="mathml"?_r.createElementNS(bk,t):n?_r.createElement(t,{is:n}):_r.createElement(t);return t==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:t=>_r.createTextNode(t),createComment:t=>_r.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>_r.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,s,i){const o=n?n.previousSibling:e.lastChild;if(s&&(s===i||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{Ny.innerHTML=mv(r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t);const a=Ny.content;if(r==="svg"||r==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},is="transition",Ja="animation",qc=Symbol("_vtc"),gv={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},Rk=Lt({},kw,gv),Sk=t=>(t.displayName="Transition",t.props=Rk,t),Pk=Sk((t,{slots:e})=>Dt(_0,Ck(t),e)),ri=(t,e=[])=>{pe(t)?t.forEach(n=>n(...e)):t&&t(...e)},Dy=t=>t?pe(t)?t.some(e=>e.length>1):t.length>1:!1;function Ck(t){const e={};for(const k in t)k in gv||(e[k]=t[k]);if(t.css===!1)return e;const{name:n="v",type:r,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:l=o,appearToClass:h=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=t,_=kk(s),E=_&&_[0],v=_&&_[1],{onBeforeEnter:O,onEnter:N,onEnterCancelled:y,onLeave:S,onLeaveCancelled:D,onBeforeAppear:M=O,onAppear:b=N,onAppearCancelled:T=y}=e,I=(k,R,ge,Te)=>{k._enterCancelled=Te,si(k,R?h:a),si(k,R?l:o),ge&&ge()},A=(k,R)=>{k._isLeaving=!1,si(k,d),si(k,m),si(k,f),R&&R()},C=k=>(R,ge)=>{const Te=k?b:N,se=()=>I(R,k,ge);ri(Te,[R,se]),Oy(()=>{si(R,k?c:i),mr(R,k?h:a),Dy(Te)||xy(R,r,E,se)})};return Lt(e,{onBeforeEnter(k){ri(O,[k]),mr(k,i),mr(k,o)},onBeforeAppear(k){ri(M,[k]),mr(k,c),mr(k,l)},onEnter:C(!1),onAppear:C(!0),onLeave(k,R){k._isLeaving=!0;const ge=()=>A(k,R);mr(k,d),k._enterCancelled?(mr(k,f),My(k)):(My(k),mr(k,f)),Oy(()=>{k._isLeaving&&(si(k,d),mr(k,m),Dy(S)||xy(k,r,v,ge))}),ri(S,[k,ge])},onEnterCancelled(k){I(k,!1,void 0,!0),ri(y,[k])},onAppearCancelled(k){I(k,!0,void 0,!0),ri(T,[k])},onLeaveCancelled(k){A(k),ri(D,[k])}})}function kk(t){if(t==null)return null;if(qe(t))return[of(t.enter),of(t.leave)];{const e=of(t);return[e,e]}}function of(t){return ew(t)}function mr(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[qc]||(t[qc]=new Set)).add(e)}function si(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const n=t[qc];n&&(n.delete(e),n.size||(t[qc]=void 0))}function Oy(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let Nk=0;function xy(t,e,n,r){const s=t._endId=++Nk,i=()=>{s===t._endId&&r()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:c}=Dk(t,e);if(!o)return r();const l=o+"end";let h=0;const d=()=>{t.removeEventListener(l,f),i()},f=m=>{m.target===t&&++h>=c&&d()};setTimeout(()=>{h<c&&d()},a+1),t.addEventListener(l,f)}function Dk(t,e){const n=window.getComputedStyle(t),r=_=>(n[_]||"").split(", "),s=r(`${is}Delay`),i=r(`${is}Duration`),o=Vy(s,i),a=r(`${Ja}Delay`),c=r(`${Ja}Duration`),l=Vy(a,c);let h=null,d=0,f=0;e===is?o>0&&(h=is,d=o,f=i.length):e===Ja?l>0&&(h=Ja,d=l,f=c.length):(d=Math.max(o,l),h=d>0?o>l?is:Ja:null,f=h?h===is?i.length:c.length:0);const m=h===is&&/\b(?:transform|all)(?:,|$)/.test(r(`${is}Property`).toString());return{type:h,timeout:d,propCount:f,hasTransform:m}}function Vy(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,r)=>Ly(n)+Ly(t[r])))}function Ly(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function My(t){return(t?t.ownerDocument:document).body.offsetHeight}function Ok(t,e,n){const r=t[qc];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const eh=Symbol("_vod"),_v=Symbol("_vsh"),Pq={name:"show",beforeMount(t,{value:e},{transition:n}){t[eh]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Ya(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),Ya(t,!0),r.enter(t)):r.leave(t,()=>{Ya(t,!1)}):Ya(t,e))},beforeUnmount(t,{value:e}){Ya(t,e)}};function Ya(t,e){t.style.display=e?t[eh]:"none",t[_v]=!e}const xk=Symbol(""),Vk=/(?:^|;)\s*display\s*:/;function Lk(t,e,n){const r=t.style,s=it(n);let i=!1;if(n&&!s){if(e)if(it(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Tl(r,a,"")}else for(const o in e)n[o]==null&&Tl(r,o,"");for(const o in n)o==="display"&&(i=!0),Tl(r,o,n[o])}else if(s){if(e!==n){const o=r[xk];o&&(n+=";"+o),r.cssText=n,i=Vk.test(n)}}else e&&t.removeAttribute("style");eh in t&&(t[eh]=i?r.display:"",t[_v]&&(r.display="none"))}const Fy=/\s*!important$/;function Tl(t,e,n){if(pe(n))n.forEach(r=>Tl(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=Mk(t,e);Fy.test(n)?t.setProperty(Hi(r),n.replace(Fy,""),"important"):t[r]=n}}const Uy=["Webkit","Moz","ms"],af={};function Mk(t,e){const n=af[e];if(n)return n;let r=kn(e);if(r!=="filter"&&r in t)return af[e]=r;r=Lh(r);for(let s=0;s<Uy.length;s++){const i=Uy[s]+r;if(i in t)return af[e]=i}return e}const By="http://www.w3.org/1999/xlink";function jy(t,e,n,r,s,i=OC(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(By,e.slice(6,e.length)):t.setAttributeNS(By,e,n):n==null||i&&!tw(n)?t.removeAttribute(e):t.setAttribute(e,i?"":jn(n)?String(n):n)}function $y(t,e,n,r,s){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?mv(n):n);return}const i=t.tagName;if(e==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?t.getAttribute("value")||"":t.value,c=n==null?t.type==="checkbox"?"on":"":String(n);(a!==c||!("_value"in t))&&(t.value=c),n==null&&t.removeAttribute(e),t._value=n;return}let o=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=tw(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{t[e]=n}catch{}o&&t.removeAttribute(s||e)}function gs(t,e,n,r){t.addEventListener(e,n,r)}function Fk(t,e,n,r){t.removeEventListener(e,n,r)}const qy=Symbol("_vei");function Uk(t,e,n,r,s=null){const i=t[qy]||(t[qy]={}),o=i[e];if(r&&o)o.value=r;else{const[a,c]=Bk(e);if(r){const l=i[e]=qk(r,s);gs(t,a,l,c)}else o&&(Fk(t,a,o,c),i[e]=void 0)}}const Hy=/(?:Once|Passive|Capture)$/;function Bk(t){let e;if(Hy.test(t)){e={};let r;for(;r=t.match(Hy);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Hi(t.slice(2)),e]}let cf=0;const jk=Promise.resolve(),$k=()=>cf||(jk.then(()=>cf=0),cf=Date.now());function qk(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;$n(Hk(r,n.value),e,5,[r])};return n.value=t,n.attached=$k(),n}function Hk(t,e){if(pe(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>s=>!s._stopped&&r&&r(s))}else return e}const Gy=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Gk=(t,e,n,r,s,i)=>{const o=s==="svg";e==="class"?Ok(t,r,o):e==="style"?Lk(t,n,r):du(e)?cm(e)||Uk(t,e,n,r,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Wk(t,e,r,o))?($y(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&jy(t,e,r,o,i,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!it(r))?$y(t,kn(e),r,i,e):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),jy(t,e,r,o))};function Wk(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&Gy(e)&&ye(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=t.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Gy(e)&&it(n)?!1:e in t}const Fo=t=>{const e=t.props["onUpdate:modelValue"]||!1;return pe(e)?n=>Ro(e,n):e};function Kk(t){t.target.composing=!0}function Wy(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Nr=Symbol("_assign"),Cq={created(t,{modifiers:{lazy:e,trim:n,number:r}}
3,s){t[Nr]=Fo(s);const i=r||s.props&&s.props.type==="number";gs(t,e?"change":"input",o=>{if(o.target.composing)return;let a=t.value;n&&(a=a.trim()),i&&(a=jl(a)),t[Nr](a)}),n&&gs(t,"change",()=>{t.value=t.value.trim()}),e||(gs(t,"compositionstart",Kk),gs(t,"compositionend",Wy),gs(t,"change",Wy))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:r,trim:s,number:i}},o){if(t[Nr]=Fo(o),t.composing)return;const a=(i||t.type==="number")&&!/^0\d/.test(t.value)?jl(t.value):t.value,c=e??"";a!==c&&(document.activeElement===t&&t.type!=="range"&&(r&&e===n||s&&t.value.trim()===c)||(t.value=c))}},kq={deep:!0,created(t,e,n){t[Nr]=Fo(n),gs(t,"change",()=>{const r=t._modelValue,s=Hc(t),i=t.checked,o=t[Nr];if(pe(r)){const a=pm(r,s),c=a!==-1;if(i&&!c)o(r.concat(s));else if(!i&&c){const l=[...r];l.splice(a,1),o(l)}}else if(la(r)){const a=new Set(r);i?a.add(s):a.delete(s),o(a)}else o(yv(t,i))})},mounted:Ky,beforeUpdate(t,e,n){t[Nr]=Fo(n),Ky(t,e,n)}};function Ky(t,{value:e,oldValue:n},r){t._modelValue=e;let s;if(pe(e))s=pm(e,r.props.value)>-1;else if(la(e))s=e.has(r.props.value);else{if(e===n)return;s=fu(e,yv(t,!0))}t.checked!==s&&(t.checked=s)}const Nq={deep:!0,created(t,{value:e,modifiers:{number:n}},r){const s=la(e);gs(t,"change",()=>{const i=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?jl(Hc(o)):Hc(o));t[Nr](t.multiple?s?new Set(i):i:i[0]),t._assigning=!0,Ds(()=>{t._assigning=!1})}),t[Nr]=Fo(r)},mounted(t,{value:e}){zy(t,e)},beforeUpdate(t,e,n){t[Nr]=Fo(n)},updated(t,{value:e}){t._assigning||zy(t,e)}};function zy(t,e){const n=t.multiple,r=pe(e);if(!(n&&!r&&!la(e))){for(let s=0,i=t.options.length;s<i;s++){const o=t.options[s],a=Hc(o);if(n)if(r){const c=typeof a;c==="string"||c==="number"?o.selected=e.some(l=>String(l)===String(a)):o.selected=pm(e,a)>-1}else o.selected=e.has(a);else if(fu(Hc(o),e)){t.selectedIndex!==s&&(t.selectedIndex=s);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Hc(t){return"_value"in t?t._value:t.value}function yv(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const zk=["ctrl","shift","alt","meta"],Qk={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>zk.some(n=>t[`${n}Key`]&&!e.includes(n))},Dq=(t,e)=>{const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=((s,...i)=>{for(let o=0;o<e.length;o++){const a=Qk[e[o]];if(a&&a(s,e))return}return t(s,...i)}))},Ev=Lt({patchProp:Gk},Ak);let Tc,Qy=!1;function Jk(){return Tc||(Tc=W0(Ev))}function Yk(){return Tc=Qy?Tc:K0(Ev),Qy=!0,Tc}const Xk=((...t)=>{const e=Jk().createApp(...t),{mount:n}=e;return e.mount=r=>{const s=Tv(r);if(!s)return;const i=e._component;!ye(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=n(s,!1,Iv(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e}),Zk=((...t)=>{const e=Yk().createApp(...t),{mount:n}=e;return e.mount=r=>{const s=Tv(r);if(s)return n(s,!0,Iv(s))},e});function Iv(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Tv(t){return it(t)?document.querySelector(t):t}const eN=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,tN=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,nN=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function rN(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){sN(t);return}return e}function sN(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function th(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const n=t.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!nN.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(eN.test(t)||tN.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,rN)}return JSON.parse(t)}catch(r){if(e.strict)throw r;return t}}const iN=/#/g,oN=/&/g,aN=/\//g,cN=/=/g,Om=/\+/g,uN=/%5e/gi,lN=/%60/gi,hN=/%7c/gi,dN=/%20/gi;function fN(t){return encodeURI(""+t).replace(hN,"|")}function np(t){return fN(typeof t=="string"?t:JSON.stringify(t)).replace(Om,"%2B").replace(dN,"+").replace(iN,"%23").replace(oN,"%26").replace(lN,"`").replace(uN,"^").replace(aN,"%2F")}function uf(t){return np(t).replace(cN,"%3D")}function nh(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function pN(t){return nh(t.replace(Om," "))}function mN(t){return nh(t.replace(Om," "))}function xm(t=""){const e=Object.create(null);t[0]==="?"&&(t=t.slice(1));for(const n of t.split("&")){const r=n.match(/([^=]+)=?(.*)/)||[];if(r.length<2)continue;const s=pN(r[1]);if(s==="__proto__"||s==="constructor")continue;const i=mN(r[2]||"");e[s]===void 0?e[s]=i:Array.isArray(e[s])?e[s].push(i):e[s]=[e[s],i]}return e}function gN(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(n=>`${uf(t)}=${np(n)}`).join("&"):`${uf(t)}=${np(e)}`:uf(t)}function _N(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>
3gN(e,t[e])).filter(Boolean).join("&")}const yN=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,EN=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,IN=/^([/\\]\s*){2,}[^/\\]/,TN=/^[\s\0]*(blob|data|javascript|vbscript):$/i,wN=/\/$|\/\?|\/#/,vN=/^\.?\//;function Wr(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?yN.test(t):EN.test(t)||(e.acceptRelative?IN.test(t):!1)}function bN(t){return!!t&&TN.test(t)}function rp(t="",e){return e?wN.test(t):t.endsWith("/")}function Gc(t="",e){if(!e)return(rp(t)?t.slice(0,-1):t)||"/";if(!rp(t,!0))return t||"/";let n=t,r="";const s=t.indexOf("#");s!==-1&&(n=t.slice(0,s),r=t.slice(s));const[i,...o]=n.split("?");return((i.endsWith("/")?i.slice(0,-1):i)||"/")+(o.length>0?`?${o.join("?")}`:"")+r}function wv(t="",e){if(!e)return t.endsWith("/")?t:t+"/";if(rp(t,!0))return t||"/";let n=t,r="";const s=t.indexOf("#");if(s!==-1&&(n=t.slice(0,s),r=t.slice(s),!n))return r;const[i,...o]=n.split("?");return i+"/"+(o.length>0?`?${o.join("?")}`:"")+r}function AN(t,e){if(bv(e)||Wr(t))return t;const n=Gc(e);if(t.startsWith(n)){const r=t[n.length];if(!r||r==="/"||r==="?")return t}return Hh(n,t)}function Jy(t,e){if(bv(e))return t;const n=Gc(e);if(!t.startsWith(n))return t;const r=t[n.length];if(r&&r!=="/"&&r!=="?")return t;const s=t.slice(n.length);return s[0]==="/"?s:"/"+s}function vv(t,e){const n=Sv(t),r={...xm(n.search),...e};return n.search=_N(r),PN(n)}function bv(t){return!t||t==="/"}function RN(t){return t&&t!=="/"}function Hh(t,...e){let n=t||"";for(const r of e.filter(s=>RN(s)))if(n){const s=r.replace(vN,"");n=wv(n)+s}else n=r;return n}function Av(...t){const e=/\/(?!\/)/,n=t.filter(Boolean),r=[];let s=0;for(const o of n)if(!(!o||o==="/")){for(const[a,c]of o.split(e).entries())if(!(!c||c===".")){if(c===".."){if(r.length===1&&Wr(r[0]))continue;r.pop(),s--;continue}if(a===1&&r[r.length-1]?.endsWith(":/")){r[r.length-1]+="/"+c;continue}r.push(c),s++}}let i=r.join("/");return s>=0?n[0]?.startsWith("/")&&!i.startsWith("/")?i="/"+i:n[0]?.startsWith("./")&&!i.startsWith("./")&&(i="./"+i):i="../".repeat(-1*s)+i,n[n.length-1]?.endsWith("/")&&!i.endsWith("/")&&(i+="/"),i}function SN(t,e){return nh(Gc(t))===nh(Gc(e))}const Rv=Symbol.for("ufo:protocolRelative");function Sv(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,d,f=""]=n;return{protocol:d.toLowerCase(),pathname:f,href:d+f,auth:"",host:"",search:"",hash:""}}if(!Wr(t,{acceptRelative:!0}))return Yy(t);const[,r="",s,i=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,o="",a=""]=i.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:c,search:l,hash:h}=Yy(a);return{protocol:r.toLowerCase(),auth:s?s.slice(0,Math.max(0,s.length-1)):"",host:o,pathname:c,search:l,hash:h,[Rv]:!r}}function Yy(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}function PN(t){const e=t.pathname||"",n=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",r=t.hash||"",s=t.auth?t.auth+"@":"",i=t.host||"";return(t.protocol||t[Rv]?(t.protocol||"")+"//":"")+s+i+e+n+r}
3class CN extends Error{constructor(e,n){super(e,n),this.name="FetchError",n?.cause&&!this.cause&&(this.cause=n.cause)}}function kN(t){const e=t.error?.message||t.error?.toString()||"",n=t.request?.method||t.options?.method||"GET",r=t.request?.url||String(t.request)||"/",s=`[${n}] ${JSON.stringify(r)}`,i=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",o=`${s}: ${i}${e?` ${e}`:""}`,a=new CN(o,t.error?{cause:t.error}:void 0);for(const c of["request","options","response"])Object.defineProperty(a,c,{get(){return t[c]}});for(const[c,l]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,c,{get(){return t.response&&t.response[l]}});return a}const NN=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function Xy(t="GET"){return NN.has(t.toUpperCase())}function DN(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer||t instanceof FormData||t instanceof URLSearchParams?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const ON=new Set(["image/svg","application/xml","application/xhtml","application/html"]),xN=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function VN(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return xN.test(e)?"json":e==="text/event-stream"?"stream":ON.has(e)||e.startsWith("text/")?"text":"blob"}function LN(t,e,n,r){const s=MN(e?.headers??t?.headers,n?.headers,r);let i;return(n?.query||n?.params||e?.params||e?.query)&&(i={...n?.params,...n?.query,...e?.params,...e?.query}),{...n,...e,query:i,params:i,headers:s}}function MN(t,e,n){if(!e)return new n(t);const r=new n(e);if(t)for(const[s,i]of Symbol.iterator in t||Array.isArray(t)?t:new n(t))r.set(s,i);return r}async function rl(t,e){if(e)if(Array.isArray(e))for(const n of e)await n(t);else await e(t)}const FN=new Set([408,409,425,429,500,502,503,504]),UN=new Set([101,204,205,304]);function Pv(t={}){const{fetch:e=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=t;async function s(a){const c=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!c){let h;typeof a.options.retry=="number"?h=a.options.retry:h=Xy(a.options.method)?0:1;const d=a.response&&a.response.status||500;if(h>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(d):FN.has(d))){const f=typeof a.options.retryDelay=="function"?a.options.retryDelay(a):a.options.retryDelay||0;return f>0&&await new Promise(m=>setTimeout(m,f)),i(a.request,{...a.options,retry:h-1})}}const l=kN(a);throw Error.captureStackTrace&&Error.captureStackTrace(l,i),l}const i=async function(c,l={}){const h={request:c,options:LN(c,l,t.defaults,n),response:void 0,error:void 0};if(h.options.method&&(h.options.method=h.options.method.toUpperCase()),h.options.onRequest&&(await rl(h,h.options.onRequest),h.options.headers instanceof n||(h.options.headers=new n(h.options.headers||{}))),typeof h.request=="string"&&(h.options.baseURL&&(h.request=AN(h.request,h.options.baseURL)),h.options.query&&(h.request=vv(h.request,h.options.query),delete h.options.query),"query"in h.options&&delete h.options.query,"params"in h.options&&delete h.options.params),h.options.body&&Xy(h.options.method))if(DN(h.options.body)){const m=h.options.headers.get("content-type");typeof h.options.body!="string"&&(h.options.body=m==="application/x-www-form-urlencoded"?new URLSearchParams(h.options.body).toString():JSON.stringify(h.options.body)),m||h.options.headers.set("content-type","application/json"),h.options.headers.has("accept")||h.options.headers.set("accept","application/json")}else("pipeTo"in h.options.body&&typeof h.options.body.pipeTo=="function"||typeof h.options.body.pipe=="function")&&("duplex"in h.options||(h.options.duplex="half"));let d;if(!h.options.signal&&h.options.timeout){const m=new r;d=setTimeout(()=>{const _=new Error("[TimeoutError]: The operation was aborted due to timeout");_.name="TimeoutError",_.code=23,m.abort(_)},h.options.timeout),h.options.signal=m.signal}try{h.response=await e(h.request,h.options)}catch(m){return h.error=m,h.options.onRequestError&&await rl(h,h.options.onRequestError),await s(h)}finally{d&&clearTimeout(d)}if((h.response.body||h.response._bodyInit)&&!UN.has(h.response.status)&&h.options.method!=="HEAD"){const m=(h.options.parseResponse?"json":h.options.responseType)||VN(h.response.headers.get("content-type")||"");switch(m){case"json":{const _=await h.response.text(),E=h.options.parseResponse||th;h.response._data=E(_);break}case"stream":{h.response._data=h.response.body||h.response._bodyInit;break}default:h.response._data=await h.response[m]()}}return h.options.onResponse&&await rl(h,h.options.onResponse),!h.options.ignoreResponseError&&h.response.status>=400&&h.response.status<600?(h.options.onResponseError&&await rl(h,h.options.onResponseError),await s(h)):h.response},o=async function(c,l){return(await i(c,l))._data};return o.raw=i,o.native=(...a)=>e(...a),o.create=(a={},c={})=>Pv({...t,...c,defaults:{...t.defaults,...c.defaults,...a}}),o}const rh=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),BN=rh.fetch?(...t)=>rh.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),jN=rh.Headers,$N=rh.AbortController,qN=Pv({fetch:BN,Headers:jN,AbortController:$N}),HN=qN,GN=()=>window?.__NUXT__?.config||window?.useNuxtApp?.().payload?.config,Vm=()=>GN().app,WN=()=>Vm().baseURL,KN=()=>Vm().buildAssetsDir,Lm=(...t)=>Av(Cv(),KN(),...t),Cv=(...t)=>{const e=Vm(),n=e.cdnURL||e.baseURL;return t.length?Av(n,...t):n};globalThis.__buildAssetsURL=Lm,globalThis.__publicAssetsURL=Cv;globalThis.$fetch||(globalThis.$fetch=HN.create({baseURL:WN()}));"global"in globalThis||(globalThis.global=globalThis);function sp(t,e={},n){for(const r in t){const s=t[r],i=n?`${n}:${r}`:r;typeof s=="object"&&s!==null?sp(s,e,i):typeof s=="function"&&(e[i]=s)}return e}const zN={run:t=>t()},QN=()=>zN,kv=typeof console.createTask<"u"?console.createTask:QN;function JN(t,e){const n=e.shift(),r=kv(n);return t.reduce((s,i)=>s.then(()=>r.run(()=>i(...e))),Promise.resolve())}function YN(t,e){const n=e.shift(),r=kv(n);return Promise.all(t.map(s=>r.run(()=>s(...e))))}function lf(t,e){for(const n of[...t])n(e)}class XN{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,n,r={}){if(!e||typeof n!="function")return()=>{};const s=e;let i;for(;this._deprecatedHooks[e];)i=this._deprecatedHooks[e],e=i.to;if(i&&!r.allowDeprecated){let o=i.message;o||(o=`${s} hook has been deprecated`+(i.to?`, please use ${i.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(o)||
3(console.warn(o),this._deprecatedMessages.add(o))}if(!n.name)try{Object.defineProperty(n,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(n),()=>{n&&(this.removeHook(e,n),n=void 0)}}hookOnce(e,n){let r,s=(...i)=>(typeof r=="function"&&r(),r=void 0,s=void 0,n(...i));return r=this.hook(e,s),r}removeHook(e,n){if(this._hooks[e]){const r=this._hooks[e].indexOf(n);r!==-1&&this._hooks[e].splice(r,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,n){this._deprecatedHooks[e]=typeof n=="string"?{to:n}:n;const r=this._hooks[e]||[];delete this._hooks[e];for(const s of r)this.hook(e,s)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(const n in e)this.deprecateHook(n,e[n])}addHooks(e){const n=sp(e),r=Object.keys(n).map(s=>this.hook(s,n[s]));return()=>{for(const s of r.splice(0,r.length))s()}}removeHooks(e){const n=sp(e);for(const r in n)this.removeHook(r,n[r])}removeAllHooks(){for(const e in this._hooks)delete this._hooks[e]}callHook(e,...n){return n.unshift(e),this.callHookWith(JN,e,...n)}callHookParallel(e,...n){return n.unshift(e),this.callHookWith(YN,e,...n)}callHookWith(e,n,...r){const s=this._before||this._after?{name:n,args:r,context:{}}:void 0;this._before&&lf(this._before,s);const i=e(n in this._hooks?[...this._hooks[n]]:[],r);return i instanceof Promise?i.finally(()=>{this._after&&s&&lf(this._after,s)}):(this._after&&s&&lf(this._after,s),i)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const n=this._before.indexOf(e);n!==-1&&this._before.splice(n,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const n=this._after.indexOf(e);n!==-1&&this._after.splice(n,1)}}}}function Nv(){return new XN}function ZN(t={}){let e,n=!1;const r=o=>{if(e&&e!==o)throw new Error("Context conflict")};let s;if(t.asyncContext){const o=t.AsyncLocalStorage||globalThis.AsyncLocalStorage;o?s=new o:console.warn("[unctx] `AsyncLocalStorage` is not provided.")}const i=()=>{if(s){const o=s.getStore();if(o!==void 0)return o}return e};return{use:()=>{const o=i();if(o===void 0)throw new Error("Context is not available");return o},tryUse:()=>i(),set:(o,a)=>{a||r(o),e=o,n=!0},unset:()=>{e=void 0,n=!1},call:(o,a)=>{r(o),e=o;try{return s?s.run(o,a):a()}finally{n||(e=void 0)}},async callAsync(o,a){e=o;const c=()=>{e=o},l=()=>e===o?c:void 0;ip.add(l);try{const h=s?s.run(o,a):a();return n||(e=void 0),await h}finally{ip.delete(l)}}}}function eD(t={}){const e={};return{get(n,r={}){return e[n]||(e[n]=ZN({...t,...r})),e[n]}}}const sh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:typeof window<"u"?window:{},Zy="__unctx__",tD=sh[Zy]||(sh[Zy]=eD()),nD=(t,e={})=>tD.get(t,e),eE="__unctx_async_handlers__",ip=sh[eE]||(sh[eE]=new Set);function As(t){const e=[];for(const s of ip){const i=s();i&&e.push(i)}const n=()=>{for(const s of e)s()};let r=t();return r&&typeof r=="object"&&"catch"in r&&(r=r.catch(s=>{throw n(),s})),[r,n]}const rD=!1,tE=!1,sD=!1,nE={id:"__nuxt-loader"},iD={componentName:"NuxtLink",prefetch:!0,prefetchOn:{visibility:!0}},Oq={deep:!1},oD="#__nuxt",Dv="nuxt-app",rE=36e5,aD="vite:preloadError";function Ov(t=Dv){return nD(t,{asyncContext:!1})}const cD="__nuxt_plugin";function uD(t){let e=0;const n={_id:t.id||Dv||"nuxt-app",_scope:mm(),provide:void 0,versions:{get nuxt(){return"4.2.0"},get vue(){return n.vueApp.version}},payload:er({...t.ssrContext?.payload||{},data:er({}),state:qr({}),once:new Set,_errors:er({})}),static:{data:{}},runWithContext(s){return n._scope.active&&!gm()?n._scope.run(()=>sE(n,s)):sE(n,s)},isHydrating:!0,deferHydration(){if(!n.isHydrating)return()=>{};e++;let s=!1;return()=>{if(!s&&(s=!0,e--,e===0))return n.isHydrating=!1,n.callHook("app:suspense:resolve")}},_asyncDataPromises:{},_asyncData:er({}),_payloadRevivers:{},...t};{const s=window.__NUXT__;if(s)for(const i in s)switch(i){case"data":case"state":case"_errors":Object.assign(n.payload[i],s[i]);break;default:n.payload[i]=s[i]}}n.hooks=Nv(),n.hook=n.hooks.hook,n.callHook=n.hooks.callHook,n.provide=(s,i)=>{const o="$"+s;sl(n,o,i),sl(n.vueApp.config.globalProperties,o,i)},sl(n.vueApp,"$nuxt",n),sl(n.vueApp.config.globalProperties,"$nuxt",n);{window.addEventListener(aD,i=>{n.callHook("app:chunkError",{error:i.payload}),i.payload.message.includes("Unable to preload CSS")&&i.preventDefault()}),window.useNuxtApp||=xe;const s=n.hook("app:error",(...i)=>{console.error("[nuxt] error caught during app initialization",...i)});n.hook("app:mounted",s)}const r=n.payload.config;return n.provide("config",r),n}function lD(t,e){e.hooks&&t.hooks.addHooks(e.hooks)}async function hD(t,e){if(typeof e=="function"){const{provide:n}=await t.runWithContext(()=>e(t))||{};if(n&&typeof n=="object")for(const r in n)t.provide(r,n[r])}}async function dD(t,e){const n=new Set,r=[],s=[];let i,o=0;async function a(c){const l=c.dependsOn?.filter(h=>e.some(d=>d._name===h)&&!n.has(h))??[];if(l.length>0)r.push([new Set(l),c]);else{const h=hD(t,c).then(async()=>{c._name&&(n.add(c._name),await Promise.all(r.map(async([d,f])=>{d.has(c._name)&&(d.delete(c._name),d.size===0&&(o++,await a(f)))})))}).catch(d=>{if(!c.parallel&&!t.payload.error)throw d;i||=d});c.parallel?s.push(h):await h}}for(const c of e)lD(t,c);for(const c of e)await a(c);if(await Promise.all(s),o)for(let c=0;c<o;c++)await Promise.all(s);if(i)throw t.payload.error||i}function St(t){if(typeof t=="function")return t;const e=t._name||t.name;return delete t.name,Object.assign(t.setup||(()=>{}),t,{[cD]:!0,_name:e})}const fD=St;function sE(t,e,n){const r=()=>e();return Ov(t._id).set(t),t.vueApp.runWithContext(r)}function pD(t){let e;return gu()&&(e=Gi()?.appContext.app.$nuxt),e||=Ov(t).tryUse(),e||null}function xe(t){const e=pD(t);if(!e)throw new Error("[nuxt] instance unavailable");return e}function pa(t){return xe().$config}function sl(t,e,n){Object.defineProperty(t,e,{get:()=>n})}function mD(t,e){return{ctx:{table:t},matchAll:n=>Vv(n,t)}}function xv(t){const e={};for(const n in t)e[n]=n==="dynamic"?new Map(Object.entries(t[n]).map(([r,s])=>
3[r,xv(s)])):new Map(Object.entries(t[n]));return e}function gD(t){return mD(xv(t))}function Vv(t,e,n){t.endsWith("/")&&(t=t.slice(0,-1)||"/");const r=[];for(const[i,o]of iE(e.wildcard))(t===i||t.startsWith(i+"/"))&&r.push(o);for(const[i,o]of iE(e.dynamic))if(t.startsWith(i+"/")){const a="/"+t.slice(i.length).split("/").splice(2).join("/");r.push(...Vv(a,o))}const s=e.static.get(t);return s&&r.push(s),r.filter(Boolean)}function iE(t){return[...t.entries()].sort((e,n)=>e[0].length-n[0].length)}function hf(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function op(t,e,n=".",r){if(!hf(e))return op(t,{},n,r);const s=Object.assign({},e);for(const i in t){if(i==="__proto__"||i==="constructor")continue;const o=t[i];o!=null&&(r&&r(s,i,o,n)||(Array.isArray(o)&&Array.isArray(s[i])?s[i]=[...o,...s[i]]:hf(o)&&hf(s[i])?s[i]=op(o,s[i],(n?`${n}.`:"")+i.toString(),r):s[i]=o))}return s}function _D(t){return(...e)=>e.reduce((n,r)=>op(n,r,"",t),{})}const Lv=_D();function yD(t,e){try{return e in t}catch{return!1}}class oE extends Error{static __h3_error__=!0;statusCode=500;fatal=!1;unhandled=!1;statusMessage;data;cause;constructor(e,n={}){super(e,n),n.cause&&!this.cause&&(this.cause=n.cause)}toJSON(){const e={message:this.message,statusCode:ap(this.statusCode,500)};return this.statusMessage&&(e.statusMessage=Mv(this.statusMessage)),this.data!==void 0&&(e.data=this.data),e}}function ED(t){if(typeof t=="string")return new oE(t);if(ID(t))return t;const e=new oE(t.message??t.statusMessage??"",{cause:t.cause||t});if(yD(t,"stack"))try{Object.defineProperty(e,"stack",{get(){return t.stack}})}catch{try{e.stack=t.stack}catch{}}if(t.data&&(e.data=t.data),t.statusCode?e.statusCode=ap(t.statusCode,e.statusCode):t.status&&(e.statusCode=ap(t.status,e.statusCode)),t.statusMessage?e.statusMessage=t.statusMessage:t.statusText&&(e.statusMessage=t.statusText),e.statusMessage){const n=e.statusMessage;Mv(e.statusMessage)!==n&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return t.fatal!==void 0&&(e.fatal=t.fatal),t.unhandled!==void 0&&(e.unhandled=t.unhandled),e}function ID(t){return t?.constructor?.__h3_error__===!0}const TD=/[^\u0009\u0020-\u007E]/g;function Mv(t=""){return t.replace(TD,"")}function ap(t,e=200){return!t||(typeof t=="string"&&(t=Number.parseInt(t,10)),t<100||t>999)?e:t}const Fv=Symbol("layout-meta"),Oi=Symbol("route");import.meta.url.replace(/\/app\/.*$/,"/");const on=()=>xe()?.$router,ma=()=>gu()?Ot(Oi,xe()._route):xe()._route;function xq(t){return t}const wD=()=>{try{if(xe()._processingMiddleware)return!0}catch{return!1}return!1},xi=(t,e)=>{t||="/";const n=typeof t=="string"?t:"path"in t?cp(t):on().resolve(t).href;if(e?.open){const{target:c="_blank",windowFeatures:l={}}=e.open,h=[];for(const[d,f]of Object.entries(l))f!==void 0&&h.push(`${d.toLowerCase()}=${f}`);return open(n,c,h.join(", ")),Promise.resolve()}const r=Wr(n,{acceptRelative:!0}),s=e?.external||r;if(s){if(!e?.external)throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");const{protocol:c}=new URL(n,window.location.href);if(c&&bN(c))throw new Error(`Cannot navigate to a URL with '${c}' protocol.`)}const i=wD();if(!s&&i){if(e?.replace){if(typeof t=="string"){const{pathname:c,search:l,hash:h}=Sv(t);return{path:c,...l&&{query:xm(l)},...h&&{hash:h},replace:!0}}return{...t,replace:!0}}return t}const o=on(),a=xe();return s?(a._scope.stop(),e?.replace?location.replace(n):location.href=n,i?a.isHydrating?new Promise(()=>{}):!1:Promise.resolve()):e?.replace?o.replace(t):o.push(t)};function cp(t){return vv(t.path||"",t.query||{})+(t.hash||"")}const Uv="__nuxt_error",Gh=()=>a0(xe().payload,"error"),ci=t=>{const e=Ai(t);try{const n=Gh();xe().hooks.callHook("app:error",e),n.value||=e}catch{throw e}return e},vD=async(t={})=>{const e=xe(),n=Gh();e.callHook("app:error:cleared",t),t.redirect&&await on().replace(t.redirect),n.value=void 0},Bv=t=>!!t&&typeof t=="object"&&Uv in t,Ai=t=>{const e=ED(t);return Object.defineProperty(e,Uv,{value:!0,configurable:!1,writable:!1}),e};let jv;const _u=t=>jv=t,$v=Symbol();function up(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var wc;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(wc||(wc={}));function bD(){const t=mm(!0),e=t.run(()=>pn({}));let n=[],r=[];const s=bm({install(i){_u(s),s._a=i,i.provide($v,s),i.config.globalProperties.$pinia=s,r.forEach(o=>n.push(o)),r=[]},use(i){return this._a?n.push(i):r.push(i),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return s}const qv=()=>{};function aE(t,e,n,r=qv){t.push(e);const s=()=>{const i=t.indexOf(e);i>-1&&(t.splice(i,1),r())};return!n&&gm()&&VC(s),s}
3function ao(t,...e){t.slice().forEach(n=>{n(...e)})}const AD=t=>t(),cE=Symbol(),df=Symbol();function lp(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,r)=>t.set(r,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],s=t[n];up(s)&&up(r)&&t.hasOwnProperty(n)&&!at(r)&&!kr(r)?t[n]=lp(s,r):t[n]=r}return t}const RD=Symbol();function SD(t){return!up(t)||!Object.prototype.hasOwnProperty.call(t,RD)}const{assign:hs}=Object;function PD(t){return!!(at(t)&&t.effect)}function CD(t,e,n,r){const{state:s,actions:i,getters:o}=e,a=n.state.value[t];let c;function l(){a||(n.state.value[t]=s?s():{});const h=s0(n.state.value[t]);return hs(h,i,Object.keys(o||{}).reduce((d,f)=>(d[f]=bm(Ue(()=>{_u(n);const m=n._s.get(t);return o[f].call(m,m)})),d),{}))}return c=Hv(t,l,e,n,r,!0),c}function Hv(t,e,n={},r,s,i){let o;const a=hs({actions:{}},n),c={deep:!0};let l,h,d=[],f=[],m;const _=r.state.value[t];!i&&!_&&(r.state.value[t]={}),pn({});let E;function v(T){let I;l=h=!1,typeof T=="function"?(T(r.state.value[t]),I={type:wc.patchFunction,storeId:t,events:m}):(lp(r.state.value[t],T),I={type:wc.patchObject,payload:T,storeId:t,events:m});const A=E=Symbol();Ds().then(()=>{E===A&&(l=!0)}),h=!0,ao(d,I,r.state.value[t])}const O=i?function(){const{state:I}=n,A=I?I():{};this.$patch(C=>{hs(C,A)})}:qv;function N(){o.stop(),d=[],f=[],r._s.delete(t)}const y=(T,I="")=>{if(cE in T)return T[df]=I,T;const A=function(){_u(r);const C=Array.from(arguments),k=[],R=[];function ge(de){k.push(de)}function Te(de){R.push(de)}ao(f,{args:C,name:A[df],store:D,after:ge,onError:Te});let se;try{se=T.apply(this&&this.$id===t?this:D,C)}catch(de){throw ao(R,de),de}return se instanceof Promise?se.then(de=>(ao(k,de),de)).catch(de=>(ao(R,de),Promise.reject(de))):(ao(k,se),se)};return A[cE]=!0,A[df]=I,A},S={_p:r,$id:t,$onAction:aE.bind(null,f),$patch:v,$reset:O,$subscribe(T,I={}){const A=aE(d,T,I.detached,()=>C()),C=o.run(()=>vi(()=>r.state.value[t],k=>{(I.flush==="sync"?h:l)&&T({storeId:t,type:wc.direct,events:m},k)},hs({},c,I)));return A},$dispose:N},D=qr(S);r._s.set(t,D);const b=(r._a&&r._a.runWithContext||AD)(()=>r._e.run(()=>(o=mm()).run(()=>e({action:y}))));for(const T in b){const I=b[T];if(at(I)&&!PD(I)||kr(I))i||(_&&SD(I)&&(at(I)?I.value=_[T]:lp(I,_[T])),r.state.value[t][T]=I);else if(typeof I=="function"){const A=y(I,T);b[T]=A,a.actions[T]=I}}return hs(D,b),hs(Ne(D),b),Object.defineProperty(D,"$state",{get:()=>r.state.value[t],set:T=>{v(I=>{hs(I,T)})}}),r._p.forEach(T=>{hs(D,o.run(()=>T({store:D,app:r._a,pinia:r,options:a})))}),_&&i&&n.hydrate&&n.hydrate(D.$state,_),l=!0,h=!0,D}function kD(t,e,n){let r;const s=typeof e=="function";r=s?n:e;function i(o,a){const c=gu();return o=o||(c?Ot($v,null):null),o&&_u(o),o=jv,o._s.has(t)||(s?Hv(t,e,r,o):CD(t,r,o)),o._s.get(t)}return i.$id=t,i}function ND(t){const e=OD(t),n=new ArrayBuffer(e.length),r=new DataView(n);for(let s=0;s<n.byteLength;s++)r.setUint8(s,e.charCodeAt(s));return n}const DD="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function OD(t){t.length%4===0&&(t=t.replace(/==?$/,""));let e="",n=0,r=0;for(let s=0;s<t.length;s++)n<<=6,n|=DD.indexOf(t[s]),r+=6,r===24&&(e+=String.fromCharCode((n&16711680)>>16),e+=String.fromCharCode((n&65280)>>8),e+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,e+=String.fromCharCode(n)):r===18&&(n>>=2,e+=String.fromCharCode((n&65280)>>8),e+=String.fromCharCode(n&255)),e}const xD=-1,VD=-2,LD=-3,MD=-4,FD=-5,UD=-6;function BD(t,e){return jD(JSON.parse(t),e)}function jD(t,e){if(typeof t=="number")return i(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const n=t,r=Array(n.length);let s=null;function i(o,a=!1){if(o===xD)return;if(o===LD)return NaN;if(o===MD)return 1/0;if(o===FD)return-1/0;if(o===UD)return-0;if(a||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const c=n[o];if(!c||typeof c!="object")r[o]=c;else if(Array.isArray(c))if(typeof c[0]=="string"){const l=c[0],h=e&&Object.hasOwn(e,l)?e[l]:void 0;if(h){let d=c[1];if(typeof d!="number"&&(d=n.push(c[1])-1),s??=new Set,s.has(d))throw new Error("Invalid circular reference");
3return s.add(d),r[o]=h(i(d)),s.delete(d),r[o]}switch(l){case"Date":r[o]=new Date(c[1]);break;case"Set":const d=new Set;r[o]=d;for(let _=1;_<c.length;_+=1)d.add(i(c[_]));break;case"Map":const f=new Map;r[o]=f;for(let _=1;_<c.length;_+=2)f.set(i(c[_]),i(c[_+1]));break;case"RegExp":r[o]=new RegExp(c[1],c[2]);break;case"Object":r[o]=Object(c[1]);break;case"BigInt":r[o]=BigInt(c[1]);break;case"null":const m=Object.create(null);r[o]=m;for(let _=1;_<c.length;_+=2)m[c[_]]=i(c[_+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{if(n[c[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const _=globalThis[l],E=i(c[1]),v=new _(E);r[o]=c[2]!==void 0?v.subarray(c[2],c[3]):v;break}case"ArrayBuffer":{const _=c[1];if(typeof _!="string")throw new Error("Invalid ArrayBuffer encoding");const E=ND(_);r[o]=E;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const _=l.slice(9);r[o]=Temporal[_].from(c[1]);break}case"URL":{const _=new URL(c[1]);r[o]=_;break}case"URLSearchParams":{const _=new URLSearchParams(c[1]);r[o]=_;break}default:throw new Error(`Unknown type ${l}`)}}else{const l=new Array(c.length);r[o]=l;for(let h=0;h<c.length;h+=1){const d=c[h];d!==VD&&(l[h]=i(d))}}else{const l={};r[o]=l;for(const h in c){if(h==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=c[h];l[h]=i(d)}}return r[o]}return i(0)}const $D=new Set(["link","style","script","noscript"]),qD=new Set(["title","titleTemplate","script","style","noscript"]),uE=new Set(["base","meta","link","style","script","noscript"]),HD=new Set(["title","base","htmlAttrs","bodyAttrs","meta","link","style","script","noscript"]),GD=new Set(["base","title","titleTemplate","bodyAttrs","htmlAttrs","templateParams"]),WD=new Set(["key","tagPosition","tagPriority","tagDuplicateStrategy","innerHTML","textContent","processTemplateParams"]),KD=new Set(["templateParams","htmlAttrs","bodyAttrs"]),Mm=new Set(["theme-color","google-site-verification","og","article","book","profile","twitter","author"]),Wc={META:new Set(["twitter"]),OG:new Set(["og","book","article","profile","fb"]),MEDIA:new Set(["ogImage","ogVideo","ogAudio","twitterImage"]),HTTP_EQUIV:new Set(["contentType","defaultStyle","xUaCompatible"])},zD={articleExpirationTime:"article:expiration_time",articleModifiedTime:"article:modified_time",articlePublishedTime:"article:published_time",bookReleaseDate:"book:release_date",fbAppId:"fb:app_id",ogAudioSecureUrl:"og:audio:secure_url",ogAudioUrl:"og:audio",ogImageSecureUrl:"og:image:secure_url",ogImageUrl:"og:image",ogSiteName:"og:site_name",ogVideoSecureUrl:"og:video:secure_url",ogVideoUrl:"og:video",profileFirstName:"profile:first_name",profileLastName:"profile:last_name",profileUsername:"profile:username",msapplicationConfig:"msapplication-Config",msapplicationTileColor:"msapplication-TileColor",msapplicationTileImage:"msapplication-TileImage"},Gv={appleItunesApp:{unpack:{entrySeparator:", ",resolve:({key:t,value:e})=>`${Ar(t)}=${e}`}},refresh:{metaKey:"http-equiv",unpack:{entrySeparator:";",resolve:({key:t,value:e})=>t==="seconds"?`${e}`:void 0}},robots:{unpack:{entrySeparator:", ",resolve:({key:t,value:e})=>typeof e=="boolean"?Ar(t):`${Ar(t)}:${e}`}},contentSecurityPolicy:{metaKey:"http-equiv",unpack:{entrySeparator:"; ",resolve:({key:t,value:e})=>`${Ar(t)} ${e}`}},charset:{}};function Ar(t){const e=t.replace(/([A-Z])/g,"-$1").toLowerCase(),n=e.indexOf("-");return n===-1?e:Wc.META.has(e.slice(0,n))||Wc.OG.has(e.slice(0,n))?t.replace(/([A-Z])/g,":$1").toLowerCase():e}function Wv(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>String(n)!=="false"&&e))}function hp(t){return Array.isArray(t)?t.map(hp):!t||typeof t!="object"?t:Object.fromEntries(Object.entries(t).map(([e,n])=>[Ar(e),hp(n)]))}function Kv(t,e={}){const{entrySeparator:n="",keyValueSeparator:r="",wrapValue:s,resolve:i}=e;return Object.entries(t).map(([o,a])=>{if(i){const l=i({key:o,value:a});if(l!==void 0)return l}const c=typeof a=="object"?Kv(a,e):typeof a=="number"?a.toString():typeof a=="str
3ing"&&s?`${s}${a.replace(new RegExp(s,"g"),`\\${s}`)}${s}`:a;return`${o}${r}${c}`}).join(n)}function lE(t,e){const n=Wv(e),r=Ar(t),s=zv(r);if(!Mm.has(r))return[{[s]:r,...n}];const i=Object.fromEntries(Object.entries(n).map(([o,a])=>[`${t}${o==="url"?"":`${o[0].toUpperCase()}${o.slice(1)}`}`,a]));return ih(i||{}).sort((o,a)=>(o[s]?.length||0)-(a[s]?.length||0))}function zv(t){if(Gv[t]?.metaKey==="http-equiv"||Wc.HTTP_EQUIV.has(t))return"http-equiv";const e=Ar(t),n=e.indexOf(":");return n===-1?"name":Wc.OG.has(e.slice(0,n))?"property":"name"}function QD(t){return zD[t]||Ar(t)}function JD(t,e){return e==="refresh"?`${t.seconds};url=${t.url}`:Kv(hp(t),{keyValueSeparator:"=",entrySeparator:", ",resolve:({value:n,key:r})=>n===null?"":typeof n=="boolean"?r:void 0,...Gv[e]?.unpack})}function ih(t){const e=[],n={};for(const[s,i]of Object.entries(t)){if(Array.isArray(i)){if(s==="themeColor"){i.forEach(o=>{typeof o=="object"&&o!==null&&e.push({name:"theme-color",...o})});continue}for(const o of i)if(typeof o=="object"&&o!==null){const a=[],c=[];for(const[l,h]of Object.entries(o)){const d=`${s}${l==="url"?"":`:${l}`}`,f=ih({[d]:h});(l==="url"?a:c).push(...f)}e.push(...a,...c)}else e.push(...typeof o=="string"?ih({[s]:o}):lE(s,o));continue}if(typeof i=="object"&&i)if(Wc.MEDIA.has(s)){const o=s.startsWith("twitter")?"twitter":"og",a=s.replace(/^(og|twitter)/,"").toLowerCase(),c=o==="twitter"?"name":"property";i.url&&e.push({[c]:`${o}:${a}`,content:i.url}),i.secureUrl&&e.push({[c]:`${o}:${a}:secure_url`,content:i.secureUrl});for(const[l,h]of Object.entries(i))l!=="url"&&l!=="secureUrl"&&e.push({[c]:`${o}:${a}:${l}`,content:h})}else Mm.has(Ar(s))?e.push(...lE(s,i)):n[s]=Wv(i);else n[s]=i}const r=Object.entries(n).map(([s,i])=>{if(s==="charset")return{charset:i===null?"_null":i};const o=zv(s),a=QD(s),c=i===null?"_null":typeof i=="object"?JD(i,s):typeof i=="number"?i.toString():i;return o==="http-equiv"?{"http-equiv":a,content:c}:{[o]:a,content:c}});return[...e,...r].map(s=>"content"in s&&s.content==="_null"?{...s,content:null}:s)}const YD={key:"flatMeta",hooks:{"entries:normalize":t=>{const e=[];t.tags=t.tags.map(n=>n.tag!=="_flatMeta"?n:(e.push(ih(n.props).map(r=>({...n,tag:"meta",props:r}))),!1)).filter(Boolean).concat(...e)}}},XD=["name","property","http-equiv"],ZD=new Set(["viewport","description","keywords","robots"]);function Qv(t){const e=t.split(":");return e.length?Mm.has(e[1]):!1}function dp(t){const{props:e,tag:n}=t;if(GD.has(n))return n;if(n==="link"&&e.rel==="canonical")return"canonical";if(e.charset)return"charset";if(t.tag==="meta"){for(const r of XD)if(e[r]!==void 0){const s=e[r],i=s.includes(":"),o=ZD.has(s),c=!(i||o)&&t.key?`:key:${t.key}`:"";return`${n}:${s}${c}`}}if(t.key)return`${n}:key:${t.key}`;if(e.id)return`${n}:id:${e.id}`;if(qD.has(n)){const r=t.textContent||t.innerHTML;if(r)return`${n}:content:${r}`}}function hE(t){const e=t._h||t._d;if(e)return e;const n=t.textContent||t.innerHTML;return n||`${t.tag}:${Object.entries(t.props).map(([r,s])=>`${r}:${String(s)}`).join(",")}`}function oh(t,e,n){typeof t==="function"&&(!n||n!=="titleTemplate"&&!(n[0]==="o"&&n[1]==="n"))&&(t=t());let s;if(e&&(s=e(n,t)),Array.isArray(s))return s.map(i=>oh(i,e));if(s?.constructor===Object){const i={};for(const o of Object.keys(s))i[o]=oh(s[o],e,o);return i}return s}function eO(t,e){const n=t==="style"?new Map:new Set;function r(s){const i=s.trim();if(i)if(t==="style"){const[o,...a]=i.split(":").map(c=>c.trim());o&&a.length&&n.set(o,a.join(":"))}else i.split(" ").filter(Boolean).forEach(o=>n.add(o))}return typeof e=="string"?t==="style"?e.split(";").forEach(r):r(e):Array.isArray(e)?e.forEach(s=>r(s)):e&&typeof e=="object"&&Object.entries(e).forEach(([s,i])=>{i&&i!=="false"&&(t==="style"?n.set(s.trim(),i):r(s))}),n}function Jv(t,e){return t.props=t.props||{},e?t.tag==="templateParams"?(t.props=e,t):(Object.entries(e).forEach(([n,r])=>{if(r===null){t.props[n]=null;return}if(n==="class"||n==="style"){t.props[n]=eO(n,r);return}if(WD.has(n)){if(["textContent","innerHTML"].includes(n)&&typeof r=="object"){let o=e.type;if(e.type||(o="application/json"),!o?.endsWith("json")&&o!=="speculationrules")return;e.type=o,t.props.type=o,t[n]=JSON.stringify(r)}else t[n]=r;return}const s=String(r),i=n.startsWith("data-");s==="true"||s===""?t.props[n]=i?s:!0:!r&&i&&s==="false"?t.props[n]="false":r!==void 0&&(t.props[n]=r)}),t):t}function tO(t,e){const n=typeof e=="object"&&typeof e!="function"?e:{[t==="script"||t==="noscript"||t==="style"?"innerHTML":"textContent"]:e},r=Jv({tag:t,props:{}},n);return r.key&&$D.has(r.tag)&&(r.props["data-hid"]=r._h=r.key),r.tag==="script"&&typeof r.innerHTML=="object"&&(r.innerHTML=JSON.stringify(r.innerHTML),r.props.type=r.props.type||"application/json"),Array.isArray(r.props.content)?r.props.content.map(s=>({...r,props:{...r.props,content:s}})):r}function nO(t,e){if(!t)return[];typeof t=="function"&&(t=t());const n=(s,i)=>{for(let o=0;o<e.length;o++)i=e[o](s,i);return i};t=n(void 0,t);const r=[];return t=oh(t,n),Object.entries(t||{}
3).forEach(([s,i])=>{if(i!==void 0)for(const o of Array.isArray(i)?i:[i])r.push(tO(s,o))}),r.flat()}const dE=(t,e)=>t._w===e._w?t._p-e._p:t._w-e._w,fE={base:-10,title:10},rO={critical:-8,high:-1,low:2},pE={meta:{"content-security-policy":-30,charset:-20,viewport:-15},link:{preconnect:20,stylesheet:60,preload:70,modulepreload:70,prefetch:90,"dns-prefetch":90,prerender:90},script:{async:30,defer:80,sync:50},style:{imported:40,sync:60}},sO=/@import/,Xa=t=>t===""||t===!0;function iO(t,e){if(typeof e.tagPriority=="number")return e.tagPriority;let n=100;const r=rO[e.tagPriority]||0,s=t.resolvedOptions.disableCapoSorting?{link:{},script:{},style:{}}:pE;if(e.tag in fE)n=fE[e.tag];else if(e.tag==="meta"){const i=e.props["http-equiv"]==="content-security-policy"?"content-security-policy":e.props.charset?"charset":e.props.name==="viewport"?"viewport":null;i&&(n=pE.meta[i])}else e.tag==="link"&&e.props.rel?n=s.link[e.props.rel]:e.tag==="script"?Xa(e.props.async)?n=s.script.async:e.props.src&&!Xa(e.props.defer)&&!Xa(e.props.async)&&e.props.type!=="module"&&!e.props.type?.endsWith("json")?n=s.script.sync:Xa(e.props.defer)&&e.props.src&&!Xa(e.props.async)&&(n=s.script.defer):e.tag==="style"&&(n=e.innerHTML&&sO.test(e.innerHTML)?s.style.imported:s.style.sync);return(n||100)+r}function mE(t,e){const n=typeof e=="function"?e(t):e,r=n.key||String(t.plugins.size+1);t.plugins.get(r)||(t.plugins.set(r,n),t.hooks.addHooks(n.hooks||{}))}function oO(t={}){const e=Nv();e.addHooks(t.hooks||{});const n=!t.document,r=new Map,s=new Map,i=new Set,o={_entryCount:1,plugins:s,dirty:!1,resolvedOptions:t,hooks:e,ssr:n,entries:r,headEntries(){return[...r.values()]},use:a=>mE(o,a),push(a,c){const l={...c||{}};delete l.head;const h=l._index??o._entryCount++,d={_i:h,input:a,options:l},f={_poll(m=!1){o.dirty=!0,!m&&i.add(h),e.callHook("entries:updated",o)},dispose(){r.delete(h)&&o.invalidate()},patch(m){(!l.mode||l.mode==="server"&&n||l.mode==="client"&&!n)&&(d.input=m,r.set(h,d),f._poll())}};return f.patch(a),f},async resolveTags(){const a={tagMap:new Map,tags:[],entries:[...o.entries.values()]};for(await e.callHook("entries:resolve",a);i.size;){const f=i.values().next().value;i.delete(f);const m=r.get(f);if(m){const _={tags:nO(m.input,t.propResolvers||[]).map(E=>Object.assign(E,m.options)),entry:m};await e.callHook("entries:normalize",_),m._tags=_.tags.map((E,v)=>(E._w=iO(o,E),E._p=(m._i<<10)+v,E._d=dp(E),E))}}let c=!1;a.entries.flatMap(f=>(f._tags||[]).map(m=>({...m,props:{...m.props}}))).sort(dE).reduce((f,m)=>{const _=String(m._d||m._p);if(!f.has(_))return f.set(_,m);const E=f.get(_);if((m?.tagDuplicateStrategy||(KD.has(m.tag)?"merge":null)||(m.key&&m.key===E.key?"merge":null))==="merge"){const O={...E.props};Object.entries(m.props).forEach(([N,y])=>O[N]=N==="style"?new Map([...E.props.style||new Map,...y]):N==="class"?new Set([...E.props.class||new Set,...y]):y),f.set(_,{...m,props:O})}else m._p>>10===E._p>>10&&m.tag==="meta"&&Qv(_)?(f.set(_,Object.assign([...Array.isArray(E)?E:[E],m],m)),c=!0):(m._w===E._w?m._p>E._p:m?._w<E?._w)&&f.set(_,m);return f},a.tagMap);const l=a.tagMap.get("title"),h=a.tagMap.get("titleTemplate");if(o._title=l?.textContent,h){const f=h?.textContent;if(o._titleTemplate=f,f){let m=typeof f=="function"?f(l?.textContent):f;typeof m=="string"&&!o.plugins.has("template-params")&&(m=m.replace("%s",l?.textContent||"")),l?m===null?a.tagMap.delete("title"):a.tagMap.set("title",{...l,textContent:m}):(h.tag="title",h.textContent=m)}}a.tags=Array.from(a.tagMap.values()),c&&(a.tags=a.tags.flat().sort(dE)),await e.callHook("tags:beforeResolve",a),await e.callHook("tags:resolve",a),await e.callHook("tags:afterResolve",a);const d=[];for(const f of a.tags){const{innerHTML:m,tag:_,props:E}=f;if(HD.has(_)&&!(Object.keys(E).length===0&&!f.innerHTML&&!f.textContent)&&!(_==="meta"&&!E.content&&!E["http-equiv"]&&!E.charset)){if(_==="script"&&m){if(E.type?.endsWith("json")){const v=typeof m=="string"?m:JSON.stringify(m);f.innerHTML=v.replace(/</g,"\\u003C")}else typeof m=="string"&&(f.innerHTML=m.replace(new RegExp(`</${_}`,"g"),`<\\/${_}`));f._d=dp(f)}d.push(f)}}return d},invalidate(){for(const a of r.values())i.add(a._i);o.dirty=!0,e.callHook("entries:updated",o)}};
3return(t?.plugins||[]).forEach(a=>mE(o,a)),o.hooks.callHook("init",o),t.init?.forEach(a=>a&&o.push(a)),o}const aO=(t,e)=>at(e)?n0(e):e,Fm="usehead";function cO(t){return{install(n){n.config.globalProperties.$unhead=t,n.config.globalProperties.$head=t,n.provide(Fm,t)}}.install}function Yv(){if(gu()){const t=Ot(Fm);if(!t)throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");return t}throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.")}function Xv(t,e={}){const n=e.head||Yv();return n.ssr?n.push(t||{},e):uO(n,t,e)}function uO(t,e,n={}){const r=pn(!1);let s;return Y0(()=>{const o=r.value?{}:oh(e,aO);s?s.patch(o):s=t.push(o,n)}),Gi()&&(fa(()=>{s.dispose()}),Lw(()=>{r.value=!0}),Vw(()=>{r.value=!1})),s}function lO(t={},e={}){(e.head||Yv()).use(YD);const{title:r,titleTemplate:s,...i}=t;return Xv({title:r,titleTemplate:s,_flatMeta:i},e)}function Zv(t){const e=t||xe();return e.ssrContext?.head||e.runWithContext(()=>{if(gu()){const n=Ot(Fm);if(!n)throw new Error("[nuxt] [unhead] Missing Unhead instance.");return n}})}function eb(t,e={}){const n=e.head||Zv(e.nuxt);return Xv(t,{head:n,...e})}function hO(t,e={}){const n=e.head||Zv(e.nuxt);return lO(t,{head:n,...e})}let wl,vl;function dO(){return wl=$fetch(Lm(`builds/meta/${pa().app.buildId}.json`),{responseType:"json"}),wl.then(t=>{vl=gD(t.matcher)}).catch(t=>{console.error("[nuxt] Error fetching app manifest.",t)}),wl}function Wh(){return wl||dO()}async function Um(t){const e=typeof t=="string"?t:t.path;if(await Wh(),!vl)return console.error("[nuxt] Error creating app manifest matcher.",vl),{};try{return Lv({},...vl.matchAll(e).reverse())}catch(n){return console.error("[nuxt] Error matching route rules.",n),{}}}async function gE(t,e={}){if(!await nb(t))return null;const r=await pO(t,e);return await tb(r)||null}const fO="_payload.json";async function pO(t,e={}){const n=new URL(t,"http://localhost");if(n.host!=="localhost"||Wr(n.pathname,{acceptRelative:!0}))throw new Error("Payload URL must not include hostname: "+t);const r=pa(),s=e.hash||(e.fresh?Date.now():r.app.buildId),i=r.app.cdnURL,o=i&&await nb(t)?i:r.app.baseURL;return Hh(o,n.pathname,fO+(s?`?${s}`:""))}async function tb(t){const e=fetch(t,{cache:"force-cache"}).then(n=>n.text().then(rb));try{return await e}catch(n){console.warn("[nuxt] Cannot load payload ",t,n)}return null}async function nb(t=ma().path){const e=xe();return t=t==="/"?t:t.replace(/\/$/,""),(await Wh()).prerendered.includes(t)?!0:e.runWithContext(async()=>{const r=await Um({path:t});return!!r.prerender&&!r.redirect})}let ii=null;async function mO(){if(ii)return ii;const t=document.getElementById("__NUXT_DATA__");if(!t)return{};const e=await rb(t.textContent||""),n=t.dataset.src?await tb(t.dataset.src):void 0;return ii={...e,...n,...window.__NUXT__},ii.config?.public&&(ii.config.public=qr(ii.config.public)),ii}async function rb(t){return await BD(t,xe()._payloadRevivers)}function sb(t,e){xe()._payloadRevivers[t]=e}const gO=fD(()=>{sb("skipHydrate",t=>{})}),_O=[["NuxtError",t=>Ai(t)],["EmptyShallowRef",t=>ki(t==="_"?void 0:t==="0n"?BigInt(0):th(t))],["EmptyRef",t=>pn(t==="_"?void 0:t==="0n"?BigInt(0):th(t))],["ShallowRef",t=>ki(t)],["ShallowReactive",t=>er(t)],["Ref",t=>pn(t)],["Reactive",t=>qr(t)]],yO=St({name:"nuxt:revive-payload:client",order:-30,async setup(t){let e,n;for(const[r,s]of _O)sb(r,s);Object.assign(t.payload,([e,n]=As(()=>t.runWithContext(mO)),e=await e,n(),e)),delete window.__NUXT__}});async function Bm(t,e={}){const n=e.document||t.resolvedOptions.document;if(!n||!t.dirty)return;const r={shouldRender:!0,tags:[]};if(await t.hooks.callHook("dom:beforeRender",r),!!r.shouldRender)return t._domUpdatePromise||(t._domUpdatePromise=new Promise(async s=>{const i=new Map,o=new Promise(m=>{t.resolveTags().then(_=>{m(_.map(E=>{const v=i.get(E._d)||0,O={tag:E,id:(v?`${E._d}:${v}`:E._d)||hE(E),shouldRender:!0};return E._d&&Qv(E._d)&&i.set(E._d,v+1),O}))})});let a=t._dom;if(!a){a={title:n.title,elMap:new Map().set("htmlAttrs",n.documentElement).set("bodyAttrs",n.body)};for(const m of["body","head"]){const _=n[m]?.children;for(const E of _){const v=E.tagName.toLowerCase();if(!uE.has(v))continue;const O=Jv({tag:v,props:{}},{innerHTML:E.innerHTML,...E.getAttributeNames().reduce((N,y)=>(N[y]=E.getAttribute(y),N),{})||{}});if(O.key=E.getAttribute("data-hid")||void 0,O._d=dp(O)||hE(O),a.elMap.has(O._d)){let N=1,y=O._d;for(;a.elMap.has(y);)y=`${O._d}:${N++}`;a.elMap.set(y,E)}else a.elMap.set(O._d,E)}}}a.pendingSideEffects={...a.sideEffects},a.sideEffects={};function c(m,_,E){const v=`${m}:${_}`;a.sideEffects[v]=E,delete a.pendingSideEffects[v]}
3function l({id:m,$el:_,tag:E}){const v=E.tag.endsWith("Attrs");a.elMap.set(m,_),v||(E.textContent&&E.textContent!==_.textContent&&(_.textContent=E.textContent),E.innerHTML&&E.innerHTML!==_.innerHTML&&(_.innerHTML=E.innerHTML),c(m,"el",()=>{_?.remove(),a.elMap.delete(m)}));for(const O in E.props){if(!Object.prototype.hasOwnProperty.call(E.props,O))continue;const N=E.props[O];if(O.startsWith("on")&&typeof N=="function"){const S=_?.dataset;if(S&&S[`${O}fired`]){const D=O.slice(0,-5);N.call(_,new Event(D.substring(2)))}_.getAttribute(`data-${O}`)!==""&&((E.tag==="bodyAttrs"?n.defaultView:_).addEventListener(O.substring(2),N.bind(_)),_.setAttribute(`data-${O}`,""));continue}const y=`attr:${O}`;if(O==="class"){if(!N)continue;for(const S of N)v&&c(m,`${y}:${S}`,()=>_.classList.remove(S)),!_.classList.contains(S)&&_.classList.add(S)}else if(O==="style"){if(!N)continue;for(const[S,D]of N)c(m,`${y}:${S}`,()=>{_.style.removeProperty(S)}),_.style.setProperty(S,D)}else N!==!1&&N!==null&&(_.getAttribute(O)!==N&&_.setAttribute(O,N===!0?"":String(N)),v&&c(m,y,()=>_.removeAttribute(O)))}}const h=[],d={bodyClose:void 0,bodyOpen:void 0,head:void 0},f=await o;for(const m of f){const{tag:_,shouldRender:E,id:v}=m;if(E){if(_.tag==="title"){n.title=_.textContent,c("title","",()=>n.title=a.title);continue}m.$el=m.$el||a.elMap.get(v),m.$el?l(m):uE.has(_.tag)&&h.push(m)}}for(const m of h){const _=m.tag.tagPosition||"head";m.$el=n.createElement(m.tag.tag),l(m),d[_]=d[_]||n.createDocumentFragment(),d[_].appendChild(m.$el)}for(const m of f)await t.hooks.callHook("dom:renderTag",m,n,c);d.head&&n.head.appendChild(d.head),d.bodyOpen&&n.body.insertBefore(d.bodyOpen,n.body.firstChild),d.bodyClose&&n.body.appendChild(d.bodyClose);for(const m in a.pendingSideEffects)a.pendingSideEffects[m]();t._dom=a,await t.hooks.callHook("dom:rendered",{renders:f}),s()}).finally(()=>{t._domUpdatePromise=void 0,t.dirty=!1})),t._domUpdatePromise}function EO(t={}){const e=t.domOptions?.render||Bm;t.document=t.document||(typeof window<"u"?document:void 0);const n=t.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML||!1;return oO({...t,plugins:[...t.plugins||[],{key:"client",hooks:{"entries:updated":e}}],init:[n?JSON.parse(n):!1,...t.init||[]]})}function IO(t,e){let n=0;return()=>{const r=++n;e(()=>{n===r&&t()})}}function TO(t={}){const e=EO({domOptions:{render:IO(()=>Bm(e),n=>setTimeout(n,0))},...t});return e.install=cO(e),e}const wO={disableDefaults:!0},vO=St({name:"nuxt:head",enforce:"pre",setup(t){const e=TO(wO);t.vueApp.use(e);{let n=!0;const r=async()=>{n=!1,await Bm(e)};e.hooks.hook("dom:beforeRender",s=>{s.shouldRender=!n}),t.hooks.hook("page:start",()=>{n=!0}),t.hooks.hook("page:finish",()=>{t.isHydrating||r()}),t.hooks.hook("app:error",r),t.hooks.hook("app:suspense:resolve",r)}}});const go=typeof document<"u";function ib(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function bO(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&ib(t.default)}const Le=Object.assign;function ff(t,e){const n={};for(const r in e){const s=e[r];n[r]=qn(s)?s.map(t):t(s)}return n}const vc=()=>{},qn=Array.isArray;function _E(t,e){const n={};for(const r in t)n[r]=r in e?e[r]:t[r];return n}const ob=/#/g,AO=/&/g,RO=/\//g,SO=/=/g,PO=/\?/g,ab=/\+/g,CO=/%5B/g,kO=/%5D/g,cb=/%5E/g,NO=/%60/g,ub=/%7B/g,DO=/%7C/g,lb=/%7D/g,OO=/%20/g;function jm(t){return t==null?"":encodeURI(""+t).replace(DO,"|").replace(CO,"[").replace(kO,"]")}function xO(t){return jm(t).replace(ub,"{").replace(lb,"}").replace(cb,"^")}function fp(t){return jm(t).replace(ab,"%2B").replace(OO,"+").replace(ob,"%23").replace(AO,"%26").replace(NO,"`").replace(ub,"{").replace(lb,"}").replace(cb,"^")}function VO(t){return fp(t).replace(SO,"%3D")}function LO(t){return jm(t).replace(ob,"%23").replace(PO,"%3F")}function MO(t){return LO(t).replace(RO,"%2F")}function Kc(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const FO=/\/$/,UO=t=>t.replace(FO,"");function pf(t,e,n="/"){let r,s={},i="",o="";const a=e.indexOf("#");let c=e.indexOf("?");return c=a>=0&&c>a?-1:c,c>=0&&(r=e.slice(0,c),i=e.slice(c,a>0?a:e.length),s=t(i.slice(1))),a>=0&&(r=r||e.slice(0,a),o=e.slice(a,e.length)),r=qO(r??e,n),{fullPath:r+i+o,path:r,query:s,hash:Kc(o)}}function BO(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function yE(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function jO(t,e,n){const r=e.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Uo(e.matched[r],n.matched[s])&&hb(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Uo(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function hb(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!$O(t[n],e[n]))return!1;return!0}function $O(t,e){return qn(t)?EE(t,e):qn(e)?EE(e,t):t===e}function EE(t,e){return qn(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t.length===1&&t[0]===e}function qO(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),r=t.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,o,a;for(o=0;o<r.length;o++)if(a=r[o],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(o).join("/")}const Rn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let pp=(function(t){return t.pop="pop",t.push="push",t})({}),mf=(function(t){return t.back="back",t.forward="forward",t.unknown="",t})({});function HO(t){if(!t)if(go){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),UO(t)}const GO=/^[^#]+#/;function WO(t,e){return t.replace(GO,"#")+e}function KO(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{behavior:e.behavior,left:r.left-n.left-(e.left||0),top:r.top-n.top-(e.top||0)}}const Kh=()=>({left:window.scrollX,top:window.scrollY});function zO(t){let e;if("el"in t){const n=t.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;e=KO(s,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}
vendor: 20,964 bytes, line 3
3function IE(t,e){return(history.state?history.state.position-e:-1)+t}const mp=new Map;function QO(t,e){mp.set(t,e)}function JO(t){const e=mp.get(t);return mp.delete(t),e}function YO(t){return typeof t=="string"||t&&typeof t=="object"}function db(t){return typeof t=="string"||typeof t=="symbol"}let lt=(function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t})({});const fb=Symbol("");lt.MATCHER_NOT_FOUND+"",lt.NAVIGATION_GUARD_REDIRECT+"",lt.NAVIGATION_ABORTED+"",lt.NAVIGATION_CANCELLED+"",lt.NAVIGATION_DUPLICATED+"";function Bo(t,e){return Le(new Error,{type:t,[fb]:!0},e)}function gr(t,e){return t instanceof Error&&fb in t&&(e==null||!!(t.type&e))}const XO=["params","query","hash"];function ZO(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of XO)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}function ex(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(ab," "),i=s.indexOf("="),o=Kc(i<0?s:s.slice(0,i)),a=i<0?null:Kc(s.slice(i+1));if(o in e){let c=e[o];qn(c)||(c=e[o]=[c]),c.push(a)}else e[o]=a}return e}function TE(t){let e="";for(let n in t){const r=t[n];if(n=VO(n),r==null){r!==void 0&&(e+=(e.length?"&":"")+n);continue}(qn(r)?r.map(s=>s&&fp(s)):[r&&fp(r)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+n,s!=null&&(e+="="+s))})}return e}function tx(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=qn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return e}const nx=Symbol(""),wE=Symbol(""),$m=Symbol(""),qm=Symbol(""),gp=Symbol("");function Za(){let t=[];function e(r){return t.push(r),()=>{const s=t.indexOf(r);s>-1&&t.splice(s,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function ps(t,e,n,r,s,i=o=>o()){const o=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,c)=>{const l=f=>{f===!1?c(Bo(lt.NAVIGATION_ABORTED,{from:n,to:e})):f instanceof Error?c(f):YO(f)?c(Bo(lt.NAVIGATION_GUARD_REDIRECT,{from:e,to:f})):(o&&r.enterCallbacks[s]===o&&typeof f=="function"&&o.push(f),a())},h=i(()=>t.call(r&&r.instances[s],e,n,l));let d=Promise.resolve(h);t.length<3&&(d=d.then(l)),d.catch(f=>c(f))})}function gf(t,e,n,r,s=i=>i()){const i=[];for(const o of t)for(const a in o.components){let c=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(ib(c)){const l=(c.__vccOpts||c)[e];l&&i.push(ps(l,n,r,o,a,s))}else{let l=c();i.push(()=>l.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const d=bO(h)?h.default:h;o.mods[a]=h,o.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&ps(f,n,r,o,a,s)()}))}}return i}function rx(t,e){const n=[],r=[],s=[],i=Math.max(e.matched.length,t.matched.length);for(let o=0;o<i;o++){const a=e.matched[o];a&&(t.matched.find(l=>Uo(l,a))?r.push(a):n.push(a));const c=t.matched[o];c&&(e.matched.find(l=>Uo(l,c))||s.push(c))}return[n,r,s]}let sx=()=>location.protocol+"//"+location.host;function pb(t,e){const{pathname:n,search:r,hash:s}=e,i=t.indexOf("#");if(i>-1){let o=s.includes(t.slice(i))?t.slice(i).length:1,a=s.slice(o);return a[0]!=="/"&&(a="/"+a),yE(a,"")}return yE(n,t)+r+s}function ix(t,e,n,r){let s=[],i=[],o=null;const a=({state:f})=>{const m=pb(t,location),_=n.value,E=e.value;let v=0;if(f){if(n.value=m,e.value=f,o&&o===_){o=null;return}v=E?f.position-E.position:0}else r(m);s.forEach(O=>{O(n.value,_,{delta:v,type:pp.pop,direction:v?v>0?mf.forward:mf.back:mf.unknown})})};function c(){o=n.value}function l(f){s.push(f);const m=()=>{const _=s.indexOf(f);_>-1&&s.splice(_,1)};return i.push(m),m}function h(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(Le({},f.state,{scroll:Kh()}),"")}}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",h),document.addEventListener("visibilitychange",h),{pauseListeners:c,listen:l,destroy:d}}function vE(t,e,n,r=!1,s=!1){return{back:t,current:e,forward:n,replaced:r,position:window.history.length,scroll:s?Kh():null}}function ox(t){const{history:e,location:n}=window,r={value:pb(t,n)},s={value:e.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function i(c,l,h){const d=t.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+c:sx()+t+c;try{e[h?"replaceState":"pushState"](l,"",f),s.value=l}catch(m){console.error(m),n[h?"replace":"assign"](f)}}function o(c,l){i(c,Le({},e.state,vE(s.value.back,c,s.value.forward,!0),l,{position:s.value.position}),!0),r.value=c}function a(c,l){const h=Le({},s.value,e.state,{forward:c,scroll:Kh()});i(h.current,h,!0),i(c,Le({},vE(r.value,c,null),{position:h.position+1},l),!1),r.value=c}return{location:r,state:s,push:a,replace:o}}function mb(t){t=HO(t);const e=ox(t),n=ix(t,e.state,e.location,e.replace);function r(i,o=!0){o||n.pauseListeners(),history.go(i)}const s=Le({location:"",base:t,go:r,createHref:WO.bind(null,t)},e,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function ax(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),mb(t)}let yi=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t})({});var vt=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t})(vt||{});const cx={type:yi.Static,value:""},ux=/[a-zA-Z0-9_]/;function lx(t){if(!t)return[[]];if(t==="/")return[[cx]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(m){throw new Error(`ERR (${n})/"${l}": ${m}`)}let n=vt.Static,r=n;const s=[];let i;function o(){i&&s.push(i),i=[]}let a=0,c,l="",h="";function d(){l&&(n===vt.Static?i.push({type:yi.Static,value:l}):n===vt.Param||n===vt.ParamRegExp||n===vt.ParamRegExpEnd?(i.length>1&&(c==="*"||c==="+")&&e(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),i.push({type:yi.Param,value:l,regexp:h,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):e("Invalid state to consume buffer"),l="")}function f(){l+=c}for(;a<t.length;){if(c=t[a++],c==="\\"&&n!==vt.ParamRegExp){r=n,n=vt.EscapeNext;continue}switch(n){case vt.Static:c==="/"?(l&&d(),o()):c===":"?(d(),n=vt.Param):f();break;case vt.EscapeNext:f(),n=r;break;case vt.Param:c==="("?n=vt.ParamRegExp:ux.test(c)?f():(d(),n=vt.Static,c!=="*"&&c!=="?"&&c!=="+"&&a--);break;case vt.ParamRegExp:c===")"?h[h.length-1]=="\\"?h=h.slice(0,-1)+c:n=vt.ParamRegExpEnd:h+=c;break;case vt.ParamRegExpEnd:d(),n=vt.Static,c!=="*"&&c!=="?"&&c!=="+"&&a--,h="";break;default:e("Unknown state");break}}return n===vt.ParamRegExp&&e(`Unfinished custom RegExp for param "${l}"`),d(),o(),s}const bE="[^/]+?",hx={sensitive:!1,strict:!1,start:!0,end:!0};var en=(function(t){return t[t._multiplier=10]="_multiplier",t[t.Root=90]="Root",t[t.Segment=40]="Segment",t[t.SubSegment=30]="SubSegment",t[t.Static=40]="Static",t[t.Dynamic=20]="Dynamic",t[t.BonusCustomRegExp=10]="BonusCustomRegExp",t[t.BonusWildcard=-50]="BonusWildcard",t[t.BonusRepeatable=-20]="BonusRepeatable",t[t.BonusOptional=-8]="BonusOptional",t[t.BonusStrict=.7000000000000001]="BonusStrict",t[t.BonusCaseSensitive=.25]="BonusCaseSensitive",t})(en||{});const dx=/[.+*?^${}()[\]/\\]/g;function fx(t,e){const n=Le({},hx,e),r=[];let s=n.start?"^":"";const i=[];for(const l of t){const h=l.length?[]:[en.Root];n.strict&&!l.length&&(s+="/");for(let d=0;d<l.length;d++){const f=l[d];let m=en.Segment+(n.sensitive?en.BonusCaseSensitive:0);if(f.type===yi.Static)d||(s+="/"),s+=f.value.replace(dx,"\\$&"),m+=en.Static;else if(f.type===yi.Param){const{value:_,repeatable:E,optional:v,regexp:O}=f;i.push({name:_,repeatable:E,optional:v});const N=O||bE;if(N!==bE){m+=en.BonusCustomRegExp;try{`${N}`}catch(S){throw new Error(`Invalid custom RegExp for param "${_}" (${N}): `+S.message)}}let y=E?`((?:${N})(?:/(?:${N}))*)`:`(${N})`;d||(y=v&&l.length<2?`(?:/${y})`:"/"+y),v&&(y+="?"),s+=y,m+=en.Dynamic,v&&(m+=en.BonusOptional),E&&(m+=en.BonusRepeatable),N===".*"&&(m+=en.BonusWildcard)}h.push(m)}r.push(h)}if(n.strict&&n.end){const l=r.length-1;r[l][r[l].length-1]+=en.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const o=new RegExp(s,n.sensitive?"":"i");function a(l){const h=l.match(o),d={};if(!h)return null;for(let f=1;f<h.length;f++){const m=h[f]||"",_=i[f-1];d[_.name]=m&&_.repeatable?m.split("/"):m}return d}function c(l){let h="",d=!1;for(const f of t){(!d||!h.endsWith("/"))&&(h+="/"),d=!1;for(const m of f)if(m.type===yi.Static)h+=m.value;else if(m.type===yi.Param){const{value:_,repeatable:E,optional:v}=m,O=_ in l?l[_]:"";if(qn(O)&&!E)throw new Error(`Provided param "${_}" is an array but it is not repeatable (* or + modifiers)`);const N=qn(O)?O.join("/"):O;if(!N)if(v)f.length<2&&(h.endsWith("/")?h=h.slice(0,-1):d=!0);else throw new Error(`Missing required param "${_}"`);h+=N}}return h||"/"}return{re:o,score:r,keys:i,parse:a,stringify:c}}function px(t,e){let n=0;for(;n<t.length&&n<e.length;){const r=e[n]-t[n];if(r)return r;n++}return t.length<e.length?t.length===1&&t[0]===en.Static+en.Segment?-1:1:t.length>e.length?e.length===1&&e[0]===en.Static+en.Segment?1:-1:0}function gb(t,e){let n=0;const r=t.score,s=e.score;for(;n<r.length&&n<s.length;){const i=px(r[n],s[n]);if(i)return i;n++}if(Math.abs(s.length-r.length)===1){if(AE(r))return 1;if(AE(s))return-1}return s.length-r.length}function AE(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const mx={strict:!1,end:!0,sensitive:!1};function gx(t,e,n){const r=fx(lx(t.path),n),s=Le(r,{record:t,parent:e,children:[],alias:[]});return e&&!s.record.aliasOf==!e.record.aliasOf&&e.children.push(s),s}function _x(t,e){const n=[],r=new Map;e=_E(mx,e);function s(d){return r.get(d)}function i(d,f,m){const _=!m,E=SE(d);E.aliasOf=m&&m.record;const v=_E(e,d),O=[E];if("alias"in d){const S=typeof d.alias=="string"?[d.alias]:d.alias;for(const D of S)O.push(SE(Le({},E,{components:m?m.record.components:E.components,path:D,aliasOf:m?m.record:E})))}let N,y;for(const S of O){const{path:D}=S;if(f&&D[0]!=="/"){const M=f.record.path,b=M[M.length-1]==="/"?"":"/";S.path=f.record.path+(D&&b+D)}if(N=gx(S,f,v),m?m.alias.push(N):(y=y||N,y!==N&&y.alias.push(N),_&&d.name&&!PE(N)&&o(d.name)),_b(N)&&c(N),E.children){const M=E.children;for(let b=0;b<M.length;b++)i(M[b],N,m&&m.children[b])}m=m||N}return y?()=>{o(y)}:vc}function o(d){if(db(d)){const f=r.get(d);f&&(r.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(o),f.alias.forEach(o))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&r.delete(d.record.name),d.children.forEach(o),d.alias.forEach(o))}}function a(){return n}function c(d){const f=Ix(d,n);n.splice(f,0,d),d.record.name&&!PE(d)&&r.set(d.record.name,d)}function l(d,f){let m,_={},E,v;if("name"in d&&d.name){if(m=r.get(d.name),!m)throw Bo(lt.MATCHER_NOT_FOUND,{location:d});v=m.record.name,_=Le(RE(f.params,m.keys.filter(y=>!y.optional).concat(m.parent?m.parent.keys.filter(y=>y.optional):[]).map(y=>y.name)),d.params&&RE(d.params,m.keys.map(y=>y.name))),E=m.stringify(_)}else if(d.path!=null)E=d.path,m=n.find(y=>y.re.test(E)),m&&(_=m.parse(E),v=m.record.name);else{if(m=f.name?r.get(f.name):n.find(y=>y.re.test(f.path)),!m)throw Bo(lt.MATCHER_NOT_FOUND,{location:d,currentLocation:f});v=m.record.name,_=Le({},f.params,d.params),E=m.stringify(_)}const O=[];let N=m;for(;N;)O.unshift(N.record),N=N.parent;return{name:v,path:E,params:_,matched:O,meta:Ex(O)}}t.forEach(d=>i(d));function h(){n.length=0,r.clear()}return{addRoute:i,resolve:l,removeRoute:o,clearRoutes:h,getRoutes:a,getRecordMatcher:s}}function RE(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function SE(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:yx(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function yx(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const r in t.components)e[r]=typeof n=="object"?n[r]:n;return e}function PE(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function Ex(t){return t.reduce((e,n)=>Le(e,n.meta),{})}function Ix(t,e){let n=0,r=e.length;for(;n!==r;){const i=n+r>>1;gb(t,e[i])<0?r=i:n=i+1}const s=Tx(t);return s&&(r=e.lastIndexOf(s,r-1)),r}function Tx(t){let e=t;for(;e=e.parent;)if(_b(e)&&gb(t,e)===0)return e}function _b({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function CE(t){const e=Ot($m),n=Ot(qm),r=Ue(()=>{const c=gt(t.to);return e.resolve(c)}),s=Ue(()=>{const{matched:c}=r.value,{length:l}=c,h=c[l-1],d=n.matched;if(!h||!d.length)return-1;const f=d.findIndex(Uo.bind(null,h));if(f>-1)return f;const m=kE(c[l-2]);return l>1&&kE(h)===m&&d[d.length-1].path!==m?d.findIndex(Uo.bind(null,c[l-2])):f}),i=Ue(()=>s.value>-1&&Rx(n.params,r.value.params)),o=Ue(()=>s.value>-1&&s.value===n.matched.length-1&&hb(n.params,r.value.params));function a(c={}){if(Ax(c)){const l=e[gt(t.replace)?"replace":"push"](gt(t.to)).catch(vc);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>l),l}return Promise.resolve()}return{route:r,href:Ue(()=>r.value.href),isActive:i,isExactActive:o,navigate:a}}function wx(t){return t.length===1?t[0]:t}const vx=Hr({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:CE,setup(t,{slots:e}){const n=qr(CE(t)),{options:r}=Ot($m),s=Ue(()=>({[NE(t.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[NE(t.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=e.default&&wx(e.default(n));return t.custom?i:Dt("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},i)}}}),bx=vx;function Ax(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function Rx(t,e){for(const n in e){const r=e[n],s=t[n];if(typeof r=="string"){if(r!==s)return!1}else if(!qn(s)||s.length!==r.length||r.some((i,o)=>i!==s[o]))return!1}return!0}function kE(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const NE=(t,e,n)=>t??e??n,Sx=Hr({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const r=Ot(gp),s=Ue(()=>t.route||r.value),i=Ot(wE,0),o=Ue(()=>{let l=gt(i);const{matched:h}=s.value;let d;for(;(d=h[l])&&!d.components;)l++;return l}),a=Ue(()=>s.value.matched[o.value]);bs(wE,Ue(()=>o.value+1)),bs(nx,a),bs(gp,s);const c=pn();return vi(()=>[c.value,a.value,t.name],([l,h,d],[f,m,_])=>{h&&(h.instances[d]=l,m&&m!==h&&l&&l===f&&(h.leaveGuards.size||(h.leaveGuards=m.leaveGuards),h.updateGuards.size||(h.updateGuards=m.updateGuards))),l&&h&&(!m||!Uo(h,m)||!f)&&(h.enterCallbacks[d]||[]).forEach(E=>E(l))},{flush:"post"}),()=>{const l=s.value,h=t.name,d=a.value,f=d&&d.components[h];if(!f)return DE(n.default,{Component:f,route:l});const m=d.props[h],_=m?m===!0?l.params:typeof m=="function"?m(l):m:null,v=Dt(f,Le({},_,e,{onVnodeUnmounted:O=>{O.component.isUnmounted&&(d.instances[h]=null)},ref:c}));return DE(n.default,{Component:v,route:l})||v}}});function DE(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const yb=Sx;function Px(t){const e=_x(t.routes,t),n=t.parseQuery||ex,r=t.stringifyQuery||TE,s=t.history,i=Za(),o=Za(),a=Za(),c=ki(Rn);let l=Rn;go&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const h=ff.bind(null,q=>""+q),d=ff.bind(null,MO),f=ff.bind(null,Kc);function m(q,oe){let te,fe;return db(q)?(te=e.getRecordMatcher(q),fe=oe):fe=q,e.addRoute(fe,te)}function _(q){const oe=e.getRecordMatcher(q);oe&&e.removeRoute(oe)}function E(){return e.getRoutes().map(q=>q.record)}function v(q){return!!e.getRecordMatcher(q)}function O(q,oe){if(oe=Le({},oe||c.value),typeof q=="string"){const x=pf(n,q,oe.path),U=e.resolve({path:x.path},oe),G=s.createHref(x.fullPath);return Le(x,U,{params:f(U.params),hash:Kc(x.hash),redirectedFrom:void 0,href:G})}let te;if(q.path!=null)te=Le({},q,{path:pf(n,q.path,oe.path).path});else{const x=Le({},q.params);for(const U in x)x[U]==null&&delete x[U];te=Le({},q,{params:d(x)}),oe.params=d(oe.params)}const fe=e.resolve(te,oe),ve=q.hash||"";fe.params=h(f(fe.params));const We=BO(r,Le({},q,{hash:xO(ve),path:fe.path})),P=s.createHref(We);return Le({fullPath:We,hash:ve,query:r===TE?tx(q.query):q.query||{}},fe,{redirectedFrom:void 0,href:P})}function N(q){return typeof q=="string"?pf(n,q,c.value.path):Le({},q)}function y(q,oe){if(l!==q)return Bo(lt.NAVIGATION_CANCELLED,{from:oe,to:q})}function S(q){return b(q)}function D(q){return S(Le(N(q),{replace:!0}))}function M(q,oe){const te=q.matched[q.matched.length-1];if(te&&te.redirect){const{redirect:fe}=te;let ve=typeof fe=="function"?fe(q,oe):fe;return typeof ve=="string"&&(ve=ve.includes("?")||ve.includes("#")?ve=N(ve):{path:ve},ve.params={}),Le({query:q.query,hash:q.hash,params:ve.path!=null?{}:q.params},ve)}}function b(q,oe){const te=l=O(q),fe=c.value,ve=q.state,We=q.force,P=q.replace===!0,x=M(te,fe);if(x)return b(Le(N(x),{state:typeof x=="object"?Le({},ve,x.state):ve,force:We,replace:P}),oe||te);const U=te;U.redirectedFrom=oe;let G;return!We&&jO(r,fe,te)&&(G=Bo(lt.NAVIGATION_DUPLICATED,{to:U,from:fe}),yn(fe,fe,!0,!1)),(G?Promise.resolve(G):A(U,fe)).catch(j=>gr(j)?gr(j,lt.NAVIGATION_GUARD_REDIRECT)?j:Wn(j):ae(j,U,fe)).then(j=>{if(j){if(gr(j,lt.NAVIGATION_GUARD_REDIRECT))return b(Le({replace:P},N(j.to),{state:typeof j.to=="object"?Le({},ve,j.to.state):ve,force:We}),oe||U)}else j=k(U,fe,!0,P,ve);return C(U,fe,j),j})}function T(q,oe){const te=y(q,oe);return te?Promise.reject(te):Promise.resolve()}function I(q){const oe=Dn.values().next().value;return oe&&typeof oe.runWithContext=="function"?oe.runWithContext(q):q()}function A(q,oe){let te;const[fe,ve,We]=rx(q,oe);te=gf(fe.reverse(),"beforeRouteLeave",q,oe);for(const x of fe)x.leaveGuards.forEach(U=>{te.push(ps(U,q,oe))});const P=T.bind(null,q,oe);return te.push(P),qt(te).then(()=>{te=[];for(const x of i.list())te.push(ps(x,q,oe));return te.push(P),qt(te)}).then(()=>{te=gf(ve,"beforeRouteUpdate",q,oe);for(const x of ve)x.updateGuards.forEach(U=>{te.push(ps(U,q,oe))});return te.push(P),qt(te)}).then(()=>{te=[];for(const x of We)if(x.beforeEnter)if(qn(x.beforeEnter))for(const U of x.beforeEnter)te.push(ps(U,q,oe));else te.push(ps(x.beforeEnter,q,oe));return te.push(P),qt(te)}).then(()=>(q.matched.forEach(x=>x.enterCallbacks={}),te=gf(We,"beforeRouteEnter",q,oe,I),te.push(P),qt(te))).then(()=>{te=[];for(const x of o.list())te.push(ps(x,q,oe));return te.push(P),qt(te)}).catch(x=>gr(x,lt.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function C(q,oe,te){a.list().forEach(fe=>I(()=>fe(q,oe,te)))}function k(q,oe,te,fe,ve){const We=y(q,oe);if(We)return We;const P=oe===Rn,x=go?history.state:{};te&&(fe||P?s.replace(q.fullPath,Le({scroll:P&&x&&x.scroll},ve)):s.push(q.fullPath,ve)),c.value=q,yn(q,oe,te,P),Wn()}let R;function ge(){R||(R=s.listen((q,oe,te)=>{if(!On.listening)return;const fe=O(q),ve=M(fe,On.currentRoute.value);if(ve){b(Le(ve,{replace:!0,force:!0}),fe).catch(vc);return}l=fe;const We=c.value;go&&QO(IE(We.fullPath,te.delta),Kh()),A(fe,We).catch(P=>gr(P,lt.NAVIGATION_ABORTED|lt.NAVIGATION_CANCELLED)?P:gr(P,lt.NAVIGATION_GUARD_REDIRECT)?(b(Le(N(P.to),{force:!0}),fe).then(x=>{gr(x,lt.NAVIGATION_ABORTED|lt.NAVIGATION_DUPLICATED)&&!te.delta&&te.type===pp.pop&&s.go(-1,!1)}).catch(vc),Promise.reject()):(te.delta&&s.go(-te.delta,!1),ae(P,fe,We))).then(P=>{P=P||k(fe,We,!1),P&&(te.delta&&!gr(P,lt.NAVIGATION_CANCELLED)?s.go(-te.delta,!1):te.type===pp.pop&&gr(P,lt.NAVIGATION_ABORTED|lt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),C(fe,We,P)}).catch(vc)}))}let Te=Za(),se=Za(),de;function ae(q,oe,te){Wn(q);const fe=se.list();return fe.length?fe.forEach(ve=>ve(q,oe,te)):console.error(q),Promise.reject(q)}function Ge(){return de&&c.value!==Rn?Promise.resolve():new Promise((q,oe)=>{Te.add([q,oe])})}
3function Wn(q){return de||(de=!q,ge(),Te.list().forEach(([oe,te])=>q?te(q):oe()),Te.reset()),q}function yn(q,oe,te,fe){const{scrollBehavior:ve}=t;if(!go||!ve)return Promise.resolve();const We=!te&&JO(IE(q.fullPath,0))||(fe||!te)&&history.state&&history.state.scroll||null;return Ds().then(()=>ve(q,oe,We)).then(P=>P&&zO(P)).catch(P=>ae(P,q,oe))}const Mt=q=>s.go(q);let dr;const Dn=new Set,On={currentRoute:c,listening:!0,addRoute:m,removeRoute:_,clearRoutes:e.clearRoutes,hasRoute:v,getRoutes:E,resolve:O,options:t,push:S,replace:D,go:Mt,back:()=>Mt(-1),forward:()=>Mt(1),beforeEach:i.add,beforeResolve:o.add,afterEach:a.add,onError:se.add,isReady:Ge,install(q){q.component("RouterLink",bx),q.component("RouterView",yb),q.config.globalProperties.$router=On,Object.defineProperty(q.config.globalProperties,"$route",{enumerable:!0,get:()=>gt(c)}),go&&!dr&&c.value===Rn&&(dr=!0,S(s.location).catch(fe=>{}));const oe={};for(const fe in Rn)Object.defineProperty(oe,fe,{get:()=>c.value[fe],enumerable:!0});q.provide($m,On),q.provide(qm,er(oe)),q.provide(gp,c);const te=q.unmount;Dn.add(q),q.unmount=function(){Dn.delete(q),Dn.size<1&&(l=Rn,R&&R(),R=null,c.value=Rn,dr=!1,de=!1),te()}}};function qt(q){return q.reduce((oe,te)=>oe.then(()=>I(te)),Promise.resolve())}return On}function Eb(t){return Ot(qm)}const Cx=/(:\w+)\([^)]+\)/g,kx=/(:\w+)[?+*]/g,Nx=/:\w+/g,Dx=(t,e)=>e.path.replace(Cx,"$1").replace(kx,"$1").replace(Nx,n=>t.params[n.slice(1)]?.toString()||""),_p=(t,e)=>{const n=t.route.matched.find(s=>s.components?.default===t.Component.type),r=e??n?.meta.key??(n&&Dx(t.route,n));return typeof r=="function"?r(t.route):r},Ox=(t,e)=>({default:()=>t?Dt(b0,t===!0?{}:t,e):e});function Hm(t){return Array.isArray(t)?t:[t]}const xx={layout:"dashboard-professional"},Vx={layout:"dashboard-professional"},Lx={layout:"dashboard"},Mx={layout:"dashboard-professional"},Fx={layout:"dashboard-professional"},Ux={layout:"dashboard-professional"},Bx={layout:"dashboard-professional"},jx={layout:"dashboard-professional"},$x={layout:"dashboard-professional"},qx={layout:"dashboard-professional"},Hx={layout:"dashboard-professional"},Gx={layout:"dashboard-professional"},Wx={layout:"dashboard-professional"},Kx={layout:"dashboard-professional"},zx={layout:"dashboard-professional"},Qx={layout:"dashboard-professional"},Jx={layout:"dashboard-professional"},Yx={layout:"dashboard-professional"},Xx={layout:"dashboard-professional"},Vq="aceite-motor",Ib=[{slug:"10w40",label:"10W-40",descripcion:"Aceite de motor 10W-40 para uso mixto y motores con kilometraje."},{slug:"5w30",label:"5W-30",descripcion:"Aceite para auto 5W-30, ideal para motores modernos y climas variables."},{slug:"20w50",label:"20W-50",descripcion:"Aceite de motor 20W-50 para motores de alto rendimiento o clima cálido."}];function Zx(t){return Ib.some(e=>e.slug===t.toLowerCase())}function Gm(t){return Ib.find(e=>e.slug===t.toLowerCase())}function Lq(t){return String(t||"").toLowerCase().replace(/\s+/g,"").replace(/w-/g,"w")}function Mq(t,e){const n=["Aceite de Motor"];if(t&&n.push(String(t)),e){const r=Gm(e);n.push(r?.label||e.toUpperCase())}return n.push("Chile"),`${n.join(" ")} | AutoPiezas360`}function Fq(t,e){const n=["Aceite de motor"];if(t&&n.push(String(t)),e){const r=Gm(e);n.push(r?.label||e)}return n.push("Chile"),n.join(" ")}function Uq(t,e){let n="Compra aceite para auto con importación directa, stock y envío a todo Chile.";return e&&(n=`Aceite de motor ${Gm(e)?.label||e} disponible en Chile. ${n}`),t&&(n=`Aceite de motor ${t} en Chile. ${n}`),n}const eV={validate:t=>Zx(String(t.params.viscosidad||""))},tV=[{id:"aceite-motor",nombre:"Aceite de Motor",slug:"aceite-motor",icono:"beaker",descripcion:"Aceite para auto por viscosidad: 10W-40, 5W-30, 20W-50 y más",activa:!0,orden:0,subcategorias:["10w40","5w30","20w50"]},{id:"calefaccion-aire-acondicionado",nombre:"Calefacción y Aire Acondicionado",slug:"calefaccion-aire-acondicionado",icono:"sparkles",descripcion:"Sistema de calefacción y aire acondicionado",activa:!0,orden:1,subcategorias:["compresor-aire-acondicionado","condensador","evaporador","filtro-cabina","motor-ventilador","termostato","radiador-calefaccion"]},{id:"carroceria-ensamblaje-lampara",nombre:"Carrocería y Ensamblaje de Lámpara",slug:"carroceria-ensamblaje-lampara",icono:"truck",descripcion:"Piezas de carrocería y ensamblajes de lámparas",activa:!0,orden:2,subcategorias:["parachoques","guardafangos","puertas","capot","maletero","faros","luces-traseras","espejos"]},{id:"combustible-aire",nombre:"Combustible y Aire",slug:"combustible-aire",icono:"fire",descripcion:"Sistema de combustible y aire",activa:!0,orden:3,subcategorias:["filtro-aire","filtro-combustible","bomba-combustible","inyectores","carburador","sensor-oxigeno","sonda-lambda"]},{id:"direccion",nombre:"Dirección",slug:"direccion",icono:"cursor-arrow-rays",descripcion:"Sistema de dirección",activa:!0,orden:4,subcategorias:["cremallera-direccion","bomba-direccion","terminales-direccion","mangueras-direccion","liquido-direccion","columna-direccion"]},{id:"electrico",nombre:"Eléctrico",slug:"electrico",icono:"bolt",descripcion:"Sistema eléctrico general",activa:!0,orden:5,subcategorias:["alternador","motor-arranque","bateria","cables","fusibles","relays","sensor-abs"]},{id:"electrico-bombilla-casquillo",nombre:"Eléctrico-Bombilla y Casquillo",slug:"electrico-bombilla-casquillo",icono:"light-bulb",descripcion:"Bombillas y casquillos eléctricos",activa:!0,orden:6,subcategorias:["bombillas-faros","bombillas-intermitentes","bombillas-traseras","bombillas-interior","casquillos","portabombillas"]},{id:"electrico-interruptor-rele",nombre:"Eléctrico-Interruptor y Relé",slug:"electrico-interruptor-rele",icono:"cpu-chip",descripcion:"Interruptores y relés eléctricos",activa:!0,orden:7,subcategorias:["interruptor-encendido","interruptor-luces","interruptor-frenos","reles","fusibles","caja-fusibles"]},{id:"encendido",nombre:"Encendido",slug:"encendido",icono:"fire",descripcion:"Sistema de encendido",activa:!0,orden:8,subcategorias:["bujias","cables-bujias","distribuidor","bobina-encendido","sensor-posicion-arbol","modulo-encendido"]},{id:"escapes-emisiones",nombre:"Escapes y Emisiones",slug:"escapes-emisiones",icono:"cloud",descripcion:"Sistema de escape y control de emisiones",activa:!0,orden:9,subcategorias:["catalizador","silenciador","tubo-escape","sensor-oxigeno","sonda-lambda","valvula-egr","canister"]},{id:"freno-maza-rueda",nombre:"Freno y Maza de Rueda",slug:"freno-maza-rueda",icono:"stop-circle",descripcion:"Sistema de frenos y mazas de rueda",activa:!0,orden:10,subcategorias:["pastillas-freno","discos-freno","tambores","liquido-freno","mangueras-freno","cilindros-freno","zapatas","maza-rueda"]},{id:"limpiaparabrisas",nombre:"Limpiaparabrisas",slug:"limpiaparabrisas",icono:"cloud",descripcion:"Sistema de limpiaparabrisas",activa:!0,orden:11,subcategorias:["brazos-limpiaparabrisas","hojas-limpiaparabrisas","motor-limpiaparabrisas","bomba-agua-lavaparabrisas","mangueras-lavaparabrisas"]},{id:"motor",nombre:"Motor",slug:"motor",icono:"wrench-screwdriver",descripcion:"Componentes del motor",activa:!0,orden:12,subcategorias:["cigueñal","pistones","valvulas","juntas","anillos","bielas","culata","bloque-motor","arbol-levas"]},{id:"sistema-enfriamiento",nombre:"Sistema de Enfriamiento",slug:"sistema-enfriamiento",icono:"sun",descripcion:"Sistema de refrigeración del motor",activa:!0,orden:13,subcategorias:["radiador","termostato","bomba-agua","mangueras-refrigeracion","anticongelante","ventilador","sensor-temperatura"]},{id:"suspension",nombre:"Suspensión",slug:"suspension",icono:"arrows-up-down",descripcion:"Sistema de suspensión",activa:!0,orden:14,subcategorias:["amortiguadores","muelles","rotulas","terminales","bujes","brazos-suspension","estabilizadores","soporte-motor"]},{id:"transmision-automatica",nombre:"Transmisión-Automática",slug:"transmision-automatica",icono:"cog-6-tooth",descripcion:"Transmisión automática",activa:!0,orden:15,subcategorias:["caja-cambios-automatica","aceite-transmision","filtro-transmision","convert
3idor-par","solenoides","sensor-velocidad"]},{id:"tren-transmision",nombre:"Tren de Transmisión",slug:"tren-transmision",icono:"link",descripcion:"Tren de transmisión y tracción",activa:!0,orden:16,subcategorias:["embrague","caja-cambios-manual","diferencial","crucetas","juntas-homocineticas","cardan","soporte-motor"]}],OE="https://autopiezas360.cl",nV=["/carrito","/login","/registro","/guias","/test-firebase","/repuestos-listado"],rV=["/admin","/cliente","/dashboard","/pago","/compra"];function ga(t){if(!t||t==="/")return"/";let e=t.startsWith("/")?t:`/${t}`;return e.length>1&&e.endsWith("/")&&(e=e.replace(/\/+$/,"")||"/"),e}function Tb(t,e){const[n,r]=t.split("?"),s=ga(n),i=s==="/"?OE:`${OE}${s}`,o=new URLSearchParams;if(r){const l=new URLSearchParams(r).get("ano");l&&o.set("ano",l)}if(e){const c=aV(e);c!=null&&o.set("ano",String(c))}const a=o.toString();return a?`${i}?${a}`:i}function sV(t){const e=ga(t);return nV.includes(e)?!0:rV.some(n=>e===n||e.startsWith(`${n}/`))}function Bq(t,e){return Tb(t,e)}const iV=/^\d{4}$/;function bl(t){return iV.test(t)}function jq(t,e,n){const r=`/repuestos/${t}/${e}`;return n!=null&&String(n)!==""?`${r}?ano=${n}`:r}function $q(t,e,n,r){const s=`/repuestos/${t}/${e}/${n}`;return r!=null&&String(r)!==""?`${s}?ano=${r}`:s}function Al(t){return String(t).toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Rl(t){return String(t).split("?")[0].split("#")[0].trim()}function wb(t){return String(t).toLowerCase().split("-").filter(e=>e&&e!=="y"&&e!=="de").join("-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function xE(t){return wb(Al(t))}function yp(t){if(!t)return"";const e=tV,n=Rl(t).toLowerCase(),r=wb(n),s=xE(t);for(const i of e){const o=xE(i.nombre);if(i.slug===n||i.slug===r||i.slug===s||i.nombre.toLowerCase()===n||o===s||o===r)return i.slug}return s||r||n}function qq(t,e){return!t||!e?!1:yp(t)===yp(e)}function oV(t){const e=Al(Rl(t.marca)),n=Al(Rl(t.modelo)),r=yp(t.categoria);let s=Rl(t.slug||"").trim();!s&&t.nombre&&(s=Al(t.nombre)),s||(s="producto");const i=`/repuestos/${e}/${n}/${r}/${s}`,o=t.anio;return o!=null&&Number.isFinite(Number(o))?`${i}?ano=${o}`:i}function Hq(t,e="https://autopiezas360.cl"){return`${e.replace(/\/+$/,"")}${oV(t)}`}function aV(t){const e=t.ano??t.año;if(e==null)return null;const n=parseInt(String(Array.isArray(e)?e[0]:e),10);return Number.isFinite(n)&&n>=1900&&n<=2100?n:null}function Gq(t){const e=ga(t).split("/").filter(Boolean);return e[0]==="repuestos"&&e.length>=2&&e.length<=3}const cV={validate:t=>!bl(String(t.params.categoria||""))},_f=[{name:"index",path:"/",component:()=>ie(()=>import("./BcDkGKiF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)},{name:"login",path:"/login",component:()=>ie(()=>import("./CplXa_zl.js"),__vite__mapDeps([12,3,13,7,14,15,4,16]),import.meta.url)},{name:"buscar",path:"/buscar",component:()=>ie(()=>import("./DJIOdC8_.js"),__vite__mapDeps([17,11,7,3]),import.meta.url)},{name:"carrito",path:"/carrito",component:()=>ie(()=>import("./Cf2FRSNB.js"),__vite__mapDeps([18,2,1,15,3,16]),import.meta.url)},{name:"empresa",path:"/empresa",component:()=>ie(()=>import("./CHLzf2Aj.js"),__vite__mapDeps([19,8,9,10,11,7,3]),import.meta.url)},{name:"contacto",path:"/contacto",component:()=>ie(()=>import("./D8Ey7-J_.js"),__vite__mapDeps([20,2,9,10,7,11,3]),import.meta.url)},{name:"registro",path:"/registro",component:()=>ie(()=>import("./_GZdBgYp.js"),__vite__mapDeps([21,3,13,7,14,15,4,16]),import.meta.url)},{name:"dashboard",path:"/dashboard",meta:{middleware:"auth"},component:()=>ie(()=>import("./CuIfEg9z.js"),__vite__mapDeps([22,3]),import.meta.url)},{name:"admin",path:"/admin",meta:{...xx||{},middleware:"admin"},component:()=>ie(()=>import("./CUJxL1M_.js"),__vite__mapDeps([23,3]),import.meta.url)},{name:"compra-id",path:"/compra/:id()",component:()=>ie(()=>import("./IM-2RIYO.js"),__vite__mapDeps([24,3,2]),import.meta.url)},{name:"guias",path:"/guias",component:()=>ie(()=>import("./CZJk-sjK.js"),__vite__mapDeps([25,2,11,7,3]),import.meta.url)},{name:"admin-ventas",path:"/admin/ventas",meta:{...Vx||{},middleware:"admin"},component:()=>ie(()=>import("./COuDId2h.js"),__vite__mapDeps([26,3,2,27]),import.meta.url)},{name:"cliente-test",path:"/cliente/test",meta:Lx||{},component:()=>ie(()=>import("./CfAS_I0L.js"),__vite__mapDeps([28,3]),import.meta.url)},{name:"pago-failure",path:"/pago/failure",component:()=>ie(()=>import("./BZmphdHO.js"),__vite__mapDeps([29,3,2]),import.meta.url)},{name:"pago-pending",path:"/pago/pending",component:()=>ie(()=>import("./DmVMs07n.js"),__vite__mapDeps([30,3,2]),import.meta.url)},{name:"pago-success",path:"/pago/success",component:()=>ie(()=>import("./BHIYQ2gg.js"),__vite__mapDeps([31,3,2,15]),import.meta.url)},{name:"admin-pedidos",path:"/admin/pedidos",meta:{...Mx||{},middleware:"admin"},component:()=>ie(()=>import("./DkmfVfWn.js"),__vite__mapDeps([32,3,27]),import.meta.url)},{name:"cliente",path:"/cliente",meta:Fx||{},component:()=>ie(()=>import("./CDv6GZau.js"),__vite__mapDeps([33,3]),import.meta.url)},{name:"cliente-pagos",path:"/cliente/pagos",meta:Ux||{},component:()=>ie(()=>import("./JNLkghik.js"),__vite__mapDeps([34,3]),import.meta.url)},{name:"test-firebase",path:"/test-firebase",component:()=>ie(()=>import("./DGHqE1U_.js"),__vite__mapDeps([35,2,3]),import.meta.url)},{name:"admin-reportes",path:"/admin/reportes",meta:{...Bx||{},middleware:"admin"},component:()=>ie(()=>import("./QgBq2kVJ.js"),__vite__mapDeps([36,3]),import.meta.url)},{name:"admin-usuarios",path:"/admin/usuarios",meta:{...jx||{},middleware:"admin"},component:()=>ie(()=>import("./5MERy-2y.js"),__vite__mapDeps([37,3]),import.meta.url)}
3,{name:"cliente-perfil",path:"/cliente/perfil",meta:$x||{},component:()=>ie(()=>import("./xRJ2Nuxc.js"),__vite__mapDeps([38,3]),import.meta.url)},{name:"admin-productos",path:"/admin/productos",meta:{...qx||{},middleware:"admin"},component:()=>ie(()=>import("./DLKPqP_9.js"),__vite__mapDeps([39,40,14,41,42,43,3]),import.meta.url)},{name:"cliente-compras",path:"/cliente/compras",meta:Hx||{},component:()=>ie(()=>import("./9bFhY9cP.js"),__vite__mapDeps([44,3]),import.meta.url)},{name:"cliente-soporte",path:"/cliente/soporte",meta:Gx||{},component:()=>ie(()=>import("./Dzu_2NrH.js"),__vite__mapDeps([45,3]),import.meta.url)},{name:"repuestos",path:"/repuestos",component:()=>ie(()=>import("./Bnl4CYzO.js"),__vite__mapDeps([46,2,9,47,48,11,7,4,3]),import.meta.url)},{name:"admin-inventario",path:"/admin/inventario",meta:{...Wx||{},middleware:"admin"},component:()=>ie(()=>import("./CoNBnXUx.js"),__vite__mapDeps([49,2,47,41,43,42,40,14,4,3]),import.meta.url)},{name:"categorias",path:"/categorias",component:()=>ie(()=>import("./4_PiVCO4.js"),__vite__mapDeps([50,2,4,3,11,7]),import.meta.url)},{name:"productos-slug",path:"/productos/:slug()",component:()=>ie(()=>import("./XcIPA_rB.js"),__vite__mapDeps([51,3]),import.meta.url)},{name:"admin-calculadora",path:"/admin/calculadora",meta:{...Kx||{},middleware:"admin"},component:()=>ie(()=>import("./7-Nkv_Pi.js"),__vite__mapDeps([52,3]),import.meta.url)},{name:"categorias-slug",path:"/categorias/:slug()",component:()=>ie(()=>import("./NklLGULG.js"),__vite__mapDeps([53,2,4,3,11,7]),import.meta.url)},{name:"cliente-historial",path:"/cliente/historial",meta:zx||{},component:()=>ie(()=>import("./BHHr7dSf.js"),__vite__mapDeps([54,3]),import.meta.url)},{name:"repuestos-listado",path:"/repuestos-listado",component:()=>ie(()=>import("./CYyRCJBz.js"),__vite__mapDeps([55,3]),import.meta.url)},{name:"aceite-motor",path:"/aceite-motor",component:()=>ie(()=>import("./10ZhaK9H.js"),__vite__mapDeps([56,57,2,58,43,11,7,3]),import.meta.url)},{name:"admin-cotizaciones",path:"/admin/cotizaciones",meta:{...Qx||{},middleware:"admin"},component:()=>ie(()=>import("./BXLB-GdA.js"),__vite__mapDeps([59,3,60]),import.meta.url)},{name:"cliente-solicitudes",path:"/cliente/solicitudes",meta:Jx||{},component:()=>ie(()=>import("./j4ZjxLf1.js"),__vite__mapDeps([61,3,27]),import.meta.url)},{name:"cliente-cotizaciones",path:"/cliente/cotizaciones",meta:Xx||{},component:()=>ie(()=>import("./BtwaD_vo.js"),__vite__mapDeps([62,60,3]),import.meta.url),children:[{name:"cliente-cotizaciones-id",path:":id()",meta:Yx||{},component:()=>ie(()=>import("./C9aTROxJ.js"),__vite__mapDeps([63,60,3]),import.meta.url)}]},{name:"accesorios-autos",path:"/accesorios-autos",component:()=>ie(()=>import("./CLsaqf77.js"),__vite__mapDeps([64,65,14,66,40,43,11,7,3]),import.meta.url)},{name:"repuestos-marca",path:"/repuestos/:marca()",component:()=>ie(()=>import("./DGXxf51z.js"),__vite__mapDeps([67,9,7,48,47,11,4,3,68]),import.meta.url)},{name:"aceite-motor-viscosidad",path:"/aceite-motor/:viscosidad()",meta:eV||{},component:()=>ie(()=>import("./DmZ6bcSd.js"),__vite__mapDeps([69,57,2,58,43,11,7,3]),import.meta.url)},{name:"accesorios-autos-categoria",path:"/accesorios-autos/:categoria()",component:()=>ie(()=>import("./COqk9SJC.js"),__vite__mapDeps([70,65,14,66,40,43,11,7,3]),import.meta.url)},{name:"aceite-motor-producto-slug",path:"/aceite-motor/producto/:slug()",component:()=>ie(()=>import("./7Bkgx2YQ.js"),__vite__mapDeps([71,2,58,43,15,3,11,7]),import.meta.url)},{name:"repuestos-camionetas-americanas",path:"/repuestos/camionetas-americanas",component:()=>ie(()=>import("./CQiEuksp.js"),__vite__mapDeps([72,5,11,7,68,3]),import.meta.url)},{name:"accesorios-autos-producto-slug",path:"/accesorios-autos/producto/:slug()",component:()=>ie(()=>import("./Bnd2nbds.js"),__vite__mapDeps([73,14,40,7,66,43,15,3,11]),import.meta.url)},{name:"repuestos-marca-modelo",path:"/repuestos/:marca()/:modelo()",component:()=>ie(()=>import("./BtQpOmGA.js"),__vite__mapDeps([74,2,9,5,48,47,11,7,4,3,68]),import.meta.url)},{name:"repuestos-marca-modelo-categoria",path:"/repuestos/:marca()/:modelo()/:categoria()",meta:cV||{},component:()=>ie(()=>import("./CR7vZoVG.js"),__vite__mapDeps([75,2,76,43,15,3,77,9,48,47,11,7,4,68]),import.meta.url)},{name:"repuestos-marca-modelo-categoria-repuesto",path:"/repuestos/:marca()/:modelo()/:categoria()/:repuesto()",component:()=>ie(()=>import("./DDVWw4Yy.js"),__vite__mapDeps([78,2,1,76,43,15,3,77,41,4,11,7,68,79]),import.meta.url)},{name:"repuestos-listado-marca-modelo-ano-categoria",path:"/repuestos/listado/:marca()-:modelo()-:ano()-:categoria()",component:()=>ie(()=>import("./CSiOu5K4.js"),__vite__mapDeps([80,3]),import.meta.url)}],vb=(t,e)=>({default:()=>t?Dt(Pk,t===!0?{}:t,e):e.default?.()}),uV=/(:\w+)\([^)]+\)/g,lV=/(:\w+)[?+*]/g,hV=/:\w+/g;function VE(t){const e=t?.meta.key??t.path.replace(uV,"$1").replace(lV,"$1").replace(hV,n=>t.params[n.slice(1)]?.toString()||"");return typeof e=="function"?e(t):e}function dV(t,e){return t===e||e===Rn?!1:VE(t)!==VE(e)?!0:!t.matched.every((r,s)=>r.components&&r.components.default===e.matched[s]?.components?.default)}const fV={scrollBehavior(t,e,n){const r=xe(),s=on().options?.scrollBehaviorType??"auto";if(t.path.replace(/\/$/,"")===e.path.replace(/\/$/,""))return e.hash&&!t.hash?{left:0,top:0}:t.hash?{el:t.hash,top:bb(t.hash),behavior:s}:!1;if((typeof t.meta.scrollToTop=="function"?t.meta.scrollToTop(t,e):t.meta.scrollToTop)===!1)return!1;const o=r._runningTransition?"page:transition:finish":"page:loading:end";return new Promise(a=>{if(e===Rn){a(LE(t,e,n,s));return}r.hooks.hookOnce(o,()=>{requestAnimationFrame(()=>a(LE(t,e,n,s)))})})}};function bb(t){try{const e=document.querySelector(t);if(e)return(Number.parseFloat(getComputedStyle(e).scrollMarginTop)||0)+(Number.parseFloat(getComputedStyle(document.documentElement).scrollPaddingTop)||0)}catch{}return 0}function LE(t,e,n,r){if(n)return n;const s=dV(t,e);return t.hash?{el:t.hash,top:bb(t.hash),behavior:s?r:"instant"}:{left:0,top:0}}const Ab={scrollBehavior(){return{top:0}}},pV={strict:!1,hashMode:!1,scrollBehaviorType:"auto"},Ep=Ab.hashMode??!1,os={...pV,...fV,...Ab},mV=async(t,e)=>{let n,r;if(!t.meta?.validate)return;const s=([n,r]=As(()=>Promise.resolve(t.meta.validate(t))),n=await n,r(),n);if(s===!0)return;const i=Ai({fatal:!0,statusCode:s&&s.statusCode||404,statusMessage:s&&s.statusMessage||`Page Not Found: ${t.fullPath}`,data:{path:t.fullPath}});return typeof window<"u"&&window.history.pushState({},"",e.fullPath),i},gV=t=>
3{const e=t.path.split("/").filter(Boolean);if(e[0]!=="repuestos"||e.length<4)return;const[,n,r,s,i]=e;if(!s||!bl(s))return;const o=s;if(e.length===4)return xi({path:`/repuestos/${n}/${r}`,query:{...t.query,ano:o}},{replace:!0});if(i&&!bl(i)){const a=e[5],c=a&&!bl(a)?`/repuestos/${n}/${r}/${i}/${a}`:`/repuestos/${n}/${r}/${i}`;return xi({path:c,query:{...t.query,ano:o}},{replace:!0})}},_V=t=>{const e=t.path;if(e.length>1&&e.endsWith("/")){const n=ga(e);return xi({path:n,query:t.query,hash:t.hash},{})}},yV=async t=>{let e,n;const r=([e,n]=As(()=>Um({path:t.path})),e=await e,n(),e);if(r.redirect){const s=r.redirect.includes("#")?r.redirect:r.redirect+t.hash;return Wr(s,{acceptRelative:!0})?(window.location.href=s,!1):s}},EV=[mV,gV,_V,yV],Ip={admin:()=>ie(()=>import("./0fIRCc5h.js"),__vite__mapDeps([81,3]),import.meta.url),auth:()=>ie(()=>import("./RAQLQywF.js"),__vite__mapDeps([82,3]),import.meta.url)};function IV(t,e,n){const{pathname:r,search:s,hash:i}=e,o=t.indexOf("#");if(o>-1){const l=i.includes(t.slice(o))?t.slice(o).length:1;let h=i.slice(l);return h[0]!=="/"&&(h="/"+h),Jy(h,"")}const a=Jy(r,t),c=!n||SN(a,n)?a:n;return c+(c.includes("?")?"":s)+i}const TV=St({name:"nuxt:router",enforce:"pre",async setup(t){let e,n,r=pa().app.baseURL;Ep&&!r.includes("#")&&(r+="#");const s=os.history?.(r)??(Ep?ax(r):mb(r)),i=os.routes?([e,n]=As(()=>os.routes(_f)),e=await e,n(),e??_f):_f;let o;const a=Px({...os,scrollBehavior:(v,O,N)=>{if(O===Rn){o=N;return}if(os.scrollBehavior){if(a.options.scrollBehavior=os.scrollBehavior,"scrollRestoration"in window.history){const y=a.beforeEach(()=>{y(),window.history.scrollRestoration="manual"})}return os.scrollBehavior(v,Rn,o||N)}},history:s,routes:i});"scrollRestoration"in window.history&&(window.history.scrollRestoration="auto"),t.vueApp.use(a);const c=ki(a.currentRoute.value);a.afterEach((v,O)=>{c.value=O}),Object.defineProperty(t.vueApp.config.globalProperties,"previousRoute",{get:()=>c.value});const l=IV(r,window.location,t.payload.path),h=ki(a.currentRoute.value),d=()=>{h.value=a.currentRoute.value};t.hook("page:finish",d),a.afterEach((v,O)=>{v.matched[v.matched.length-1]?.components?.default===O.matched[O.matched.length-1]?.components?.default&&d()});const f={};for(const v in h.value)Object.defineProperty(f,v,{get:()=>h.value[v],enumerable:!0});t._route=er(f),t._middleware||={global:[],named:{}};const m=Gh();a.afterEach(async(v,O,N)=>{delete t._processingMiddleware,!t.isHydrating&&m.value&&await t.runWithContext(vD),N&&await t.callHook("page:loading:end")});try{[e,n]=As(()=>a.isReady()),await e,n()}catch(v){[e,n]=As(()=>t.runWithContext(()=>ci(v))),await e,n()}const _=l!==a.currentRoute.value.fullPath?a.resolve(l):a.currentRoute.value;d();const E=t.payload.state._layout;return a.beforeEach(async(v,O)=>{await t.callHook("page:loading:start"),v.meta=qr(v.meta),t.isHydrating&&E&&!Vr(v.meta.layout)&&(v.meta.layout=E),t._processingMiddleware=!0;{const N=new Set([...EV,...t._middleware.global]);for(const y of v.matched){const S=y.meta.middleware;if(S)for(const D of Hm(S))N.add(D)}{const y=await t.runWithContext(()=>Um({path:v.path}));if(y.appMiddleware)for(const S in y.appMiddleware)y.appMiddleware[S]?N.add(S):N.delete(S)}for(const y of N){const S=typeof y=="string"?t._middleware.named[y]||await Ip[y]?.().then(D=>D.default||D):y;if(!S)throw new Error(`Unknown route middleware: '${y}'.`);try{const D=await t.runWithContext(()=>S(v,O));if(!t.payload.serverRendered&&t.isHydrating&&(D===!1||D instanceof Error)){const M=D||Ai({statusCode:404,statusMessage:`Page Not Found: ${l}`});return await t.runWithContext(()=>ci(M)),!1}if(D===!0)continue;if(D===!1)return D;if(D)return Bv(D)&&D.fatal&&await t.runWithContext(()=>ci(D)),D}catch(D){const M=Ai(D);return M.fatal&&await t.runWithContext(()=>ci(M)),M}}}}),a.onError(async()=>{delete t._processingMiddleware,await t.callHook("page:loading:end")}),a.afterEach(v=>{if(v.matched.length===0)return t.runWithContext(()=>ci(Ai({statusCode:404,fatal:!1,statusMessage:`Page not found: ${v.fullPath}`,data:{path:v.fullPath}})))}),t.hooks.hookOnce("app:created",async()=>{try{"name"in _&&(_.name=void 0),await a.replace({..._,force:!0}),a.options.scrollBehavior=os.scrollBehavior}catch(v){await t.runWithContext(()=>ci(v))}}),{provide:{router:a}}}}),wV=St({name:"spa-deep-link-restore",enforce:"pre",setup(t){const e=window.location.pathname+window.location.search+window.location.hash;e.startsWith("/repuestos/")&&t.hook("app:created",()=>{if(ma().path==="/"&&e!=="/")return xi(e,{replace:!0})})}}),Tp=globalThis.requestIdleCallback||(t=>{const e=Date.now(),n={didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-e))};return setTimeout(()=>{t(n)}
3,1)}),vV=globalThis.cancelIdleCallback||(t=>{clearTimeout(t)}),zh=t=>{const e=xe();e.isHydrating?e.hooks.hookOnce("app:suspense:resolve",()=>{Tp(()=>t())}):Tp(()=>t())},bV=St({name:"nuxt:payload",setup(t){const e=new Set;on().beforeResolve(async(n,r)=>{if(n.path===r.path)return;const s=await gE(n.path);if(s){for(const i of e)delete t.static.data[i];for(const i in s.data)i in t.static.data||e.add(i),t.static.data[i]=s.data[i]}}),zh(()=>{t.hooks.hook("link:prefetch",async n=>{const{hostname:r}=new URL(n,window.location.href);r===window.location.hostname&&await gE(n).catch(()=>{console.warn("[nuxt] Error preloading payload for",n)})}),navigator.connection?.effectiveType!=="slow-2g"&&setTimeout(Wh,1e3)})}}),AV=St(()=>{const t=on();zh(()=>{t.beforeResolve(async()=>{await new Promise(e=>{setTimeout(e,100),requestAnimationFrame(()=>{setTimeout(e,0)})})})})}),RV=St(t=>{let e;async function n(){let r;try{r=await Wh()}catch(s){const i=s;if(!("status"in i&&(i.status===404||i.status===403)))throw i}e&&clearTimeout(e),e=setTimeout(n,rE);try{const s=await $fetch(Lm("builds/latest.json")+`?${Date.now()}`);s.id!==r?.id&&(t.hooks.callHook("app:manifest:update",s),e&&clearTimeout(e))}catch{}}zh(()=>{e=setTimeout(n,rE)})});function SV(t={}){const e=t.path||window.location.pathname;let n={};try{n=th(sessionStorage.getItem("nuxt:reload")||"{}")}catch{}if(t.force||n?.path!==e||n?.expires<Date.now()){try{sessionStorage.setItem("nuxt:reload",JSON.stringify({path:e,expires:Date.now()+(t.ttl??1e4)}))}catch{}if(t.persistState)try{sessionStorage.setItem("nuxt:reload:state",JSON.stringify({state:xe().payload.state}))}catch{}window.location.pathname!==e?window.location.href=e:window.location.reload()}}const PV=St({name:"nuxt:chunk-reload",setup(t){const e=on(),n=pa(),r=new Set;e.beforeEach(()=>{r.clear()}),t.hook("app:chunkError",({error:i})=>{r.add(i)});function s(i){const o=Hh(n.app.baseURL,i.fullPath);SV({path:o,persistState:!0})}t.hook("app:manifest:update",()=>{e.beforeResolve(s)}),e.onError((i,o)=>{r.has(i)&&s(o)})}});function CV(t){if(t?.__asyncLoader&&!t.__asyncResolved)return t.__asyncLoader()}async function Rb(t,e=on()){const{path:n,matched:r}=e.resolve(t);if(!r.length||(e._routePreloaded||=new Set,e._routePreloaded.has(n)))return;const s=e._preloadPromises||=[];if(s.length>4)return Promise.all(s).then(()=>Rb(t,e));e._routePreloaded.add(n);for(const i of r){const o=i.components?.default;if(typeof o!="function")continue;const a=Promise.resolve(o()).catch(()=>{}).finally(()=>s.splice(s.indexOf(a)));s.push(a)}await Promise.all(s)}const kV=(...t)=>t.find(e=>e!==void 0);function NV(t){const e=t.componentName||"NuxtLink";function n(i){return!Ep&&typeof i=="string"&&i.startsWith("#")}function r(i,o,a){const c=a??t.trailingSlash;if(!i||c!=="append"&&c!=="remove")return i;if(typeof i=="string")return il(i,c);const l="path"in i&&i.path!==void 0?i.path:o(i).path;return{...i,name:void 0,path:il(l,c)}}function s(i){const o=on(),a=pa(),c=Ue(()=>!!i.target&&i.target!=="_self"),l=Ue(()=>{const v=i.to||i.href||"";return typeof v=="string"&&Wr(v,{acceptRelative:!0})}),h=Ty("RouterLink"),d=typeof h!="string"?h.useLink:void 0,f=Ue(()=>{if(i.external)return!0;const v=i.to||i.href||"";return typeof v=="object"?!1:v===""||l.value}),m=Ue(()=>{const v=i.to||i.href||"";return f.value?v:r(v,o.resolve,i.trailingSlash)}),_=f.value?void 0:d?.({...i,to:m}),E=Ue(()=>{const v=i.trailingSlash??t.trailingSlash;if(!m.value||l.value||n(m.value))return m.value;if(f.value){const O=typeof m.value=="object"&&"path"in m.value?cp(m.value):m.value,N=typeof O=="object"?o.resolve(O).href:O;return il(N,v)}return typeof m.value=="object"?o.resolve(m.value)?.href??null:il(Hh(a.app.baseURL,m.value),v)});return{to:m,hasTarget:c,isAbsoluteUrl:l,isExternal:f,href:E,isActive:_?.isActive??Ue(()=>m.value===o.currentRoute.value.path),isExactActive:_?.isExactActive??Ue(()=>m.value===o.currentRoute.value.path),route:_?.route??Ue(()=>o.resolve(m.value)),async navigate(v){await xi(E.value,{replace:i.replace,external:f.value||c.value})}}}return Hr({name:e,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:s,setup(i,{slots:o}){const a=on(),{to:c,href:l,navigate:h,isExternal:d,hasTarget:f,isAbsoluteUrl:m}=s(i),_=ki(!1),E=pn(null),v=y=>{E.value=i.custom?y?.$el?.nextElementSibling:y?.$el};function O(y){return!_.value&&(typeof i.prefetchOn=="string"?i.prefetchOn===y:i.prefetchOn?.[y]??t.prefetchOn?.[y])&&(i.prefetch??t.prefetch)!==!1&&i.noPrefetch!==!0&&i.target!=="_blank"&&!VV()}async function N(y=xe()){if(_.value)return;_.value=!0;const S=typeof c.value=="string"?c.value:d.value?cp(c.value):a.resolve(c.value).fullPath,D=d.value?new URL(S,window.location.href).href:S;await Promise.all([y.hooks.callHook("link:prefetch",D).catch(()=>{}),!d.value&&!f.value&&Rb(c.value,a).catch(()=>{})])}if(O("visibility")){const y=xe();let S,D=null;Bh(()=>{const M=OV();zh(()=>{S=Tp(()=>{E?.value?.tagName&&(D=M.observe(E.value,async()=>{D?.(),D=null,await N(y)}))})})}),fa(()=>{S&&vV(S),D?.(),D=null})}return()=>{if(!d.value&&!f.value&&!n(c.value)){const D={ref:v,to:c.value,activeClass:i.activeClass||t.activeClass,exactActiveClass:i.exactActiveClass||t.exactActiveClass,replace:i.replace,ariaCurrentValue:i.ariaCurrentValue,custom:i.custom};
3return i.custom||(O("interaction")&&(D.onPointerenter=N.bind(null,void 0),D.onFocus=N.bind(null,void 0)),_.value&&(D.class=i.prefetchedClass||t.prefetchedClass),D.rel=i.rel||void 0),Dt(Ty("RouterLink"),D,o.default)}const y=i.target||null,S=kV(i.noRel?"":i.rel,t.externalRelAttribute,m.value||f.value?"noopener noreferrer":"")||null;return i.custom?o.default?o.default({href:l.value,navigate:h,prefetch:N,get route(){if(!l.value)return;const D=new URL(l.value,window.location.href);return{path:D.pathname,fullPath:D.pathname,get query(){return xm(D.search)},hash:D.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:l.value}},rel:S,target:y,isExternal:d.value||f.value,isActive:!1,isExactActive:!1}):null:Dt("a",{ref:E,href:l.value||null,rel:S,target:y,onClick:D=>{if(!(d.value||f.value))return D.preventDefault(),i.replace?a.replace(l.value):a.push(l.value)}},o.default?.())}}})}const DV=NV(iD);function il(t,e){const n=e==="append"?wv:Gc;return Wr(t)&&!t.startsWith("http")?t:n(t,!0)}function OV(){const t=xe();if(t._observer)return t._observer;let e=null;const n=new Map,r=(i,o)=>(e||=new IntersectionObserver(a=>{for(const c of a){const l=n.get(c.target);(c.isIntersecting||c.intersectionRatio>0)&&l&&l()}}),n.set(i,o),e.observe(i),()=>{n.delete(i),e?.unobserve(i),n.size===0&&(e?.disconnect(),e=null)});return t._observer={observe:r}}const xV=/2g/;function VV(){const t=navigator.connection;return!!(t&&(t.saveData||xV.test(t.effectiveType)))}const LV=St({name:"pinia",setup(t){const e=bD();return t.vueApp.use(e),_u(e),t.payload&&t.payload.pinia&&(e.state.value=t.payload.pinia),{provide:{pinia:e}}}}),MV=St({name:"nuxt:global-components"}),Es={"dashboard-debug":oo(()=>ie(()=>import("./BAde26bY.js"),__vite__mapDeps([83,3]),import.meta.url).then(t=>t.default||t)),"dashboard-professional":oo(()=>ie(()=>import("./BMotTzJj.js"),__vite__mapDeps([84,3]),import.meta.url).then(t=>t.default||t)),"dashboard-simple-fixed":oo(()=>ie(()=>import("./CLCsarrn.js"),__vite__mapDeps([85,3]),import.meta.url).then(t=>t.default||t)),"dashboard-simple":oo(()=>ie(()=>import("./znbaUako.js"),__vite__mapDeps([86,3]),import.meta.url).then(t=>t.default||t)),dashboard:oo(()=>ie(()=>import("./C2tcIQN0.js"),__vite__mapDeps([87,3]),import.meta.url).then(t=>t.default||t)),default:oo(()=>ie(()=>import("./DaPKg6P-.js"),__vite__mapDeps([88,13,7,14,15,3,4,16,6,2]),import.meta.url).then(t=>t.default||t))},FV=St({name:"nuxt:prefetch",setup(t){const e=on();t.hooks.hook("app:mounted",()=>{e.beforeEach(async n=>{const r=n?.meta?.layout;r&&typeof Es[r]=="function"&&await Es[r]()})}),t.hooks.hook("link:prefetch",n=>{if(Wr(n))return;const r=e.resolve(n);if(!r)return;const s=r.meta.layout;let i=Hm(r.meta.middleware);i=i.filter(o=>typeof o=="string");for(const o of i)typeof Ip[o]=="function"&&Ip[o]();typeof s=="string"&&s in Es&&CV(Es[s])})}}),UV=kD("auth",()=>{const t=pn(null),e=Ue(()=>!!t.value),n=Ue(()=>t.value?.role||"cliente"),r=pn(!1),s=()=>{{const _=navigator.userAgent;return{isChrome:/Chrome/.test(_)&&!/Edge/.test(_),isFirefox:/Firefox/.test(_),version:_.match(/Chrome\/(\d+)/)?.[1]||"0"}}},i=async(_,E=3,v=1e3)=>{for(let O=0;O<E;O++)try{return await _()}catch(N){if(O===E-1)throw N;const y=v*Math.pow(2,O);console.log(`🔄 Reintentando en ${y}ms (intento ${O+1}/${E})`),await new Promise(S=>setTimeout(S,y))}},o=_=>{t.value=_},a=_=>{r.value=_},c=async(_,E)=>{try{a(!0);const v=s(),O=async()=>{const{$firebaseAuth:N,$ensureFirebaseAuth:y}=xe(),S=N||(typeof y=="function"?await y():null);if(!S)throw new Error("Firebase Auth no disponible");const{signInWithEmailAndPassword:D}=await ie(async()=>{const{signInWithEmailAndPassword:b}=await Promise.resolve().then(()=>_i);return{signInWithEmailAndPassword:b}},void 0,import.meta.url),M=await D(S,_,E);return await d(M.user.uid),M.user};return v.isChrome?(console.log("🚀 Aplicando retry logic para Chrome..."),await i(O,3,1500)):await O()}catch(v){if(console.error("Error en login:",v),s().isChrome&&(console.warn("🚨 Error específico de Chrome detectado, aplicando soluciones..."),v.code==="auth/network-request-failed")){console.log("🧹 Limpiando asistencia de Chrome...");try{localStorage.removeItem("firebase:authUser"),sessionStorage.clear(),Object.keys(localStorage).filter(y=>y.includes("firebase")||y.includes("quic")||y.includes("chrome")).forEac
3h(y=>localStorage.removeItem(y)),console.log("✅ Limpieza específica de Chrome completada")}catch(N){console.warn("No se pudo limpiar caché:",N)}console.log("🔄 Intentando método alternativo para Chrome...");try{await new Promise(b=>setTimeout(b,2e3));const{$firebaseAuth:N,$ensureFirebaseAuth:y}=xe(),S=N||(typeof y=="function"?await y():null);if(!S)throw new Error("Firebase Auth no disponible");const{signInWithEmailAndPassword:D}=await ie(async()=>{const{signInWithEmailAndPassword:b}=await Promise.resolve().then(()=>_i);return{signInWithEmailAndPassword:b}},void 0,import.meta.url),M=await D(S,_,E);return await d(M.user.uid),console.log("✅ Login alternativo para Chrome exitoso"),M.user}catch(N){console.error("❌ Login alternativo para Chrome falló:",N)}}throw v}finally{a(!1)}},l=async()=>{try{a(!0);const{$firebaseAuth:_,$ensureFirebaseAuth:E}=xe(),v=_||(typeof E=="function"?await E():null);if(!v)throw new Error("Firebase Auth no disponible");const{signInWithPopup:O,GoogleAuthProvider:N}=await ie(async()=>{const{signInWithPopup:D,GoogleAuthProvider:M}=await Promise.resolve().then(()=>_i);return{signInWithPopup:D,GoogleAuthProvider:M}},void 0,import.meta.url),y=new N;y.setCustomParameters({prompt:"select_account"});const S=await O(v,y);return await d(S.user.uid),S.user}catch(_){throw console.error("Error en login con Google:",_),_}finally{a(!1)}},h=async(_,E,v,O)=>{try{a(!0);const{$firebaseAuth:N,$ensureFirebaseAuth:y,$firestore:S}=xe(),D=N||(typeof y=="function"?await y():null);if(!D)throw new Error("Firebase Auth no disponible");const{createUserWithEmailAndPassword:M,updateProfile:b}=await ie(async()=>{const{createUserWithEmailAndPassword:C,updateProfile:k}=await Promise.resolve().then(()=>_i);return{createUserWithEmailAndPassword:C,updateProfile:k}},void 0,import.meta.url),{doc:T,setDoc:I}=await ie(async()=>{const{doc:C,setDoc:k}=await Promise.resolve().then(()=>pl);return{doc:C,setDoc:k}},void 0,import.meta.url),A=await M(D,_,E);return await b(A.user,{displayName:v}),await I(T(S,"users",A.user.uid),{email:A.user.email,displayName:v,phone:O||"",role:"cliente",createdAt:new Date,lastLogin:new Date}),await d(A.user.uid),A.user}catch(N){throw console.error("Error en registro:",N),N}finally{a(!1)}},d=async _=>{try{const{$firestore:E}=xe(),{doc:v,getDoc:O}=await ie(async()=>{const{doc:y,getDoc:S}=await Promise.resolve().then(()=>pl);return{doc:y,getDoc:S}},void 0,import.meta.url),N=await O(v(E,"users",_));if(N.exists()){const y=N.data();o({uid:_,email:y.email,displayName:y.displayName,role:y.role||"cliente",createdAt:y.createdAt?.toDate(),lastLogin:y.lastLogin?.toDate()});const{setDoc:S}=await ie(async()=>{const{setDoc:D}=await Promise.resolve().then(()=>pl);return{setDoc:D}},void 0,import.meta.url);await S(v(E,"users",_),{...y,lastLogin:new Date},{merge:!0})}else{const{setDoc:y}=await ie(async()=>{const{setDoc:S}=await Promise.resolve().then(()=>pl);return{setDoc:S}},void 0,import.meta.url);await y(v(E,"users",_),{email:null,displayName:null,role:"cliente",createdAt:new Date,lastLogin:new Date}),o({uid:_,email:null,displayName:null,role:"cliente"})}}catch(E){console.error("Error cargando datos del usuario:",E),o({uid:_,email:null,displayName:null,role:"cliente"})}},f=async()=>{try{const{$firebaseAuth:_,$ensureFirebaseAuth:E}=xe(),v=_||(typeof E=="function"?await E():null);if(!v){o(null),await xi("/login");return}const{signOut:O}=await ie(async()=>{const{signOut:N}=await Promise.resolve().then(()=>_i);return{signOut:N}},void 0,import.meta.url);await O(v),o(null),await xi("/login")}catch(_){throw console.error("Error en logout:",_),_}},m=async()=>{try{const{$firebaseAuth:_}=xe();_?.currentUser?await d(_.currentUser.uid):o(null)}catch(_){console.error("Error verificando estado de autenticación:",_),o(null)}};return{user:Bc(t),isAuthenticated:e,userRole:n,isLoading:Bc(r),setUser:o,setLoading:a,login:c,loginWithGoogle:l,register:h,logout:f,checkAuthState:m,loadUserData:d}}),BV=St(async()=>{let t,e;const{$firebaseAuth:n}=xe(),r=UV();if(!n)return;const{onAuthStateChanged:s}=([t,e]=As(()=>ie(()=>Promise.resolve().then(()=>_i),void 0,import.meta.url)),t=await t,e(),t);
3s(n,async i=>{i?await r.loadUserData(i.uid):r.setUser(null)})}),jV=St(()=>{/Chrome/.test(navigator.userAgent)&&(console.log("🔍 Modo debug Chrome activado"),window.chromeDebug={version:navigator.userAgent.match(/Chrome\/(\d+)/)?.[1],userAgent:navigator.userAgent,timestamp:new Date().toISOString(),localStorage:{clear:()=>{localStorage.clear(),console.log("🧹 localStorage limpiado")},getFirebaseData:()=>Object.keys(localStorage).filter(e=>e.includes("firebase")).reduce((e,n)=>(e[n]=localStorage.getItem(n),e),{}),clearFirebaseData:()=>{const t=Object.keys(localStorage).filter(e=>e.includes("firebase")||e.includes("quic")||e.includes("chrome"));t.forEach(e=>localStorage.removeItem(e)),console.log("🧹 Datos de Firebase limpiados:",t)}},sessionStorage:{clear:()=>{sessionStorage.clear(),console.log("🧹 sessionStorage limpiado")}},quic:{disable:()=>{console.log("🔧 Intentando deshabilitar QUIC..."),console.log("ℹ️ Para deshabilitar QUIC permanentemente, ve a chrome://flags/#enable-quic y desactívalo")},testConnection:async()=>{try{const t=await fetch("https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({test:!0})});return console.log("✅ Conexión de prueba exitosa"),!0}catch(t){return console.error("❌ Error de conexión:",t),!1}}}},console.log("🛠️ Chrome debug tools disponibles en window.chromeDebug"))}),$V=St(()=>{if(/Chrome/.test(navigator.userAgent)){console.log("🔧 Configurando Firebase específicamente para Chrome..."),window.navigator&&window.navigator.serviceWorker&&console.log("🔧 Configurando service worker para Chrome...");const t=window.setTimeout;window.setTimeout=function(s,i,...o){return i<5e3&&s.toString().includes("firebase")&&(i=Math.max(i*2,5e3),console.log("⏰ Aumentando timeout para Firebase en Chrome:",i+"ms")),t.call(this,s,i,...o)};const e=localStorage.setItem;localStorage.setItem=function(s,i){try{return e.call(this,s,i)}catch{console.warn("⚠️ Error en localStorage, limpiando datos antiguos...");try{return localStorage.clear(),e.call(this,s,i)}catch{return console.error("❌ No se puede usar localStorage en Chrome"),!1}}};const n=sessionStorage.setItem;if(sessionStorage.setItem=function(s,i){try{return n.call(this,s,i)}catch{console.warn("⚠️ Error en sessionStorage, limpiando datos antiguos...");try{return sessionStorage.clear(),n.call(this,s,i)}catch{return console.error("❌ No se puede usar sessionStorage en Chrome"),!1}}},window.indexedDB){const s=indexedDB.open;indexedDB.open=function(i,o){try{return s.call(this,i,o)}catch{return console.warn("⚠️ Error en IndexedDB, intentando con configuración alternativa..."),s.call(this,i+"_chrome_fix",o)}}}const r=window.WebSocket;window.WebSocket=function(s,i){try{return new r(s,i)}catch{return console.warn("⚠️ Error en WebSocket, usando configuración alternativa..."),new r(s)}},console.log("✅ Configuración específica para Chrome completada")}}),qV=St(()=>{if(/Chrome/.test(navigator.userAgent)){console.log("🔧 Configurando optimizaciones para Chrome...");const t=/Chrome/.test(navigator.userAgent),e=navigator.userAgent.match(/Chrome\/(\d+)/)?.[1];if(t&&parseInt(e)>=100){console.log("🔧 Chrome versión moderna detectada, aplicando configuración optimizada...");const r=navigator.userAgent.replace(/Chrome\/\d+\.\d+\.\d+\.\d+/,"Chrome/91.0.4472.124");Object.defineProperty(navigator,"userAgent",{get:function(){return r},configurable:!0}),console.log("✅ User-Agent optimizado para Chrome:",r)}console.log("✅ Optimizaciones para Chrome configuradas")}}),HV=()=>{};var ME={};const Sb=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);s<128?e[n++]=s:s<2048?(e[n++]=s>>6|192,e[n++]=s&63|128):(s&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=s>>18|240,e[n++]=s>>12&63|128,e[n++]=s>>6&63|128,e[n++]=s&63|128):(e[n++]=s>>12|224,e[n++]=s>>6&63|128,e[n++]=s&63|128)}return e},GV=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n++];if(s<128)e[r++]=String.fromCharCode(s);else if(s>191&&s<224){const i=t[n++];e[r++]=String.fromCharCode((s&31)<<6|i&63)}else if(s>239&&s<365){const i=t[n++],o=t[n++],a=t[n++],c=((s&7)<<18|(i&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const i=t[n++],o=t[n++];e[r++]=String.fromCharCode((s&15)<<12|(i&63)<<6|o&63)}}return e.join("")},Pb={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<t.length;s+=3){const i=t[s],o=s+1<t.length,a=o?t[s+1]:0,c=s+2<t.length,l=c?t[s+2]:0,h=i>>2,d=(i&3)<<4|a>>4;let f=(a&15)<<2|l>>6,m=l&63;c||(m=64,o||(f=64)),r.push(n[h],n[d],n[f],n[m])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Sb(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):GV(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<t.length;){const i=n[t.charAt(s++)],a=s<t.length?n[t.charAt(s)]:0;++s;const l=s<t.length?n[t.charAt(s)]:64;++s;const d=s<t.length?n[t.charAt(s)]:64;if(++s,i==null||a==null||l==null||d==null)throw new WV;const f=i<<2|a>>4;if(r.push(f),l!==64){const m=a<<4&240|l>>2;if(r.push(m),d!==64){const _=l<<6&192|d;r.push(_)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};
3class WV extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const KV=function(t){const e=Sb(t);return Pb.encodeByteArray(e,!0)},ah=function(t){return KV(t).replace(/\./g,"")},Cb=function(t){try{return Pb.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function kb(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}const zV=()=>kb().__FIREBASE_DEFAULTS__,QV=()=>{if(typeof process>"u"||typeof ME>"u")return;const t=ME.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},JV=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&Cb(t[1]);return e&&JSON.parse(e)},Qh=()=>{try{return HV()||zV()||QV()||JV()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},Nb=t=>Qh()?.emulatorHosts?.[t],Wm=t=>{const e=Nb(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},Db=()=>Qh()?.config,Ob=t=>Qh()?.[`_${t}`];class YV{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}function lr(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function yu(t){return(await fetch(t,{credentials:"include"})).ok}function xb(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",s=t.iat||0,i=t.sub||t.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o={iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}},...t};return[ah(JSON.stringify(n)),ah(JSON.stringify(o)),""].join(".")}const bc={};function XV(){const t={prod:[],emulator:[]};for(const e of Object.keys(bc))bc[e]?t.emulator.push(e):t.prod.push(e);return t}function ZV(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let FE=!1;function Jh(t,e){if(typeof window>"u"||typeof document>"u"||!lr(window.location.host)||bc[t]===e||bc[t]||FE)return;bc[t]=e;function n(f){return`__firebase__banner__${f}`}const r="__firebase__banner",i=XV().prod.length>0;function o(){const f=document.getElementById(r);f&&f.remove()}function a(f){f.style.display="flex",f.style.background="#7faaf0",f.style.position="fixed",f.style.bottom="5px",f.style.left="5px",f.style.padding=".5em",f.style.borderRadius="5px",f.style.alignItems="center"}function c(f,m){f.setAttribute("width","24"),f.setAttribute("id",m),f.setAttribute("height","24"),f.setAttribute("viewBox","0 0 24 24"),f.setAttribute("fill","none"),f.style.marginLeft="-6px"}function l(){const f=document.createElement("span");return f.style.cursor="pointer",f.style.marginLeft="16px",f.style.fontSize="24px",f.innerHTML=" &times;",f.onclick=()=>{FE=!0,o()},f}function h(f,m){f.setAttribute("id",m),f.innerText="Learn more",f.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",f.setAttribute("target","__blank"),f.style.paddingLeft="5px",f.style.textDecoration="underline"}function d(){const f=ZV(r),m=n("text"),_=document.getElementById(m)||document.createElement("span"),E=n("learnmore"),v=document.getElementById(E)||document.createElement("a"),O=n("preprendIcon"),N=document.getElementById(O)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.created){const y=f.element;a(y),h(v,E);const S=l();c(N,O),y.append(N,_,v,S),document.body.appendChild(y)}i?(_.innerText="Preview backend disconnected.",N.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
4<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
5</g>
6<defs>
7<clipPath id="clip0_6013_33858">
8<rect width="24" height="24" fill="white"/>
9</clipPath>
10</defs>`):(N.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
11<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 
1112.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
12</g>
13<defs>
14<clipPath id="clip0_6083_34804">
15<rect width="24" height="24" fill="white"/>
16</clipPath>
17</defs>`,_.innerText="Preview backend running in this workspace."),_.setAttribute("id",m)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",d):d()}function At(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function e1(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(At())}function Vb(){const t=Qh()?.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function t1(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function n1(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function r1(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function s1(){const t=At();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function Lb(){return!Vb()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Mb(){return!Vb()&&!!navigator.userAgent&&(navigator.userAgent.includes("Safari")||navigator.userAgent.includes("WebKit"))&&!navigator.userAgent.includes("Chrome")}function Fb(){try{return typeof indexedDB=="object"}catch{return!1}}function i1(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{e(s.error?.message||"")}}catch(n){e(n)}})}const o1="FirebaseError";class Gn extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=o1,Object.setPrototypeOf(this,Gn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Eu.prototype.create)}}class Eu{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},s=`${this.service}/${e}`,i=this.errors[e],o=i?a1(i,r):"Error",a=`${this.serviceName}: ${o} (${s}).`;return new Gn(s,a,r)}}function a1(t,e){return t.replace(c1,(n,r)=>{const s=e[r];return s!=null?String(s):`<${r}?>`})}const c1=/\{\$([^}]+)}/g;function u1(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Hn(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const s of n){if(!r.includes(s))return!1;const i=t[s],o=e[s];if(UE(i)&&UE(o)){if(!Hn(i,o))return!1}else if(i!==o)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function UE(t){return t!==null&&typeof t=="object"}function _a(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(s=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function cc(t){const e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[s,i]=r.split("=");e[decodeURIComponent(s)]=decodeURIComponent(i)}}),e}function uc(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function l1(t,e){const n=new h1(t,e);return n.subscribe.bind(n)}class h1{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
17ise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let s;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");d1(e,["next","error","complete"])?s=e:s={next:e,error:n,complete:r},s.next===void 0&&(s.next=yf),s.error===void 0&&(s.error=yf),s.complete===void 0&&(s.complete=yf);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),i}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function d1(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function yf(){}function ue(t){return t&&t._delegate?t._delegate:t}class Mr{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const ui="[DEFAULT]";class f1{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new YV;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){const n=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(m1(e))try{this.getOrInitializeService({instanceIdentifier:ui})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(n);try{const i=this.getOrInitializeService({instanceIdentifier:s});r.resolve(i)}catch{}}}}clearInstance(e=ui){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=ui){return this.instances.has(e)}getOptions(e=ui){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[i,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(i);r===a&&o.resolve(s)}return s}onInit(e,n){const r=this.normalizeInstanceIdentifier(n),s=this.onInitCallbacks.get(r)??new Set;s.add(e),this.onInitCallbacks.set(r,s);const i=this.instances.get(r);return i&&e(i,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const s of r)try{s(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:p1(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=ui){return this.component?this.component.multipleInstances?e:ui:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function p1(t){return t===ui?void 0:t}function m1(t){return t.instantiationMode==="EAGER"}class g1{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new f1(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}var Se;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Se||(Se={}));const _1={debug:Se.DEBUG,verbose:Se.VERBOSE,info:Se.INFO,warn:Se.WARN,error:Se.ERROR,silent:Se.SILENT},y1=Se.INFO,E1={[Se.DEBUG]:"log",[Se.VERBOSE]:"log",[Se.INFO]:"info",[Se.WARN]:"warn",[Se.ERROR]:"error"},I1=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),s=E1[e];if(s)console[s](`[${r}]  ${t.name}:`,...n);
17else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Km{constructor(e){this.name=e,this._logLevel=y1,this._logHandler=I1,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Se))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?_1[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Se.DEBUG,...e),this._logHandler(this,Se.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Se.VERBOSE,...e),this._logHandler(this,Se.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Se.INFO,...e),this._logHandler(this,Se.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Se.WARN,...e),this._logHandler(this,Se.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Se.ERROR,...e),this._logHandler(this,Se.ERROR,...e)}}const T1=(t,e)=>e.some(n=>t instanceof n);let BE,jE;function w1(){return BE||(BE=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function v1(){return jE||(jE=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ub=new WeakMap,wp=new WeakMap,Bb=new WeakMap,Ef=new WeakMap,zm=new WeakMap;function b1(t){const e=new Promise((n,r)=>{const s=()=>{t.removeEventListener("success",i),t.removeEventListener("error",o)},i=()=>{n(Rs(t.result)),s()},o=()=>{r(t.error),s()};t.addEventListener("success",i),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&Ub.set(n,t)}).catch(()=>{}),zm.set(e,t),e}function A1(t){if(wp.has(t))return;const e=new Promise((n,r)=>{const s=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",o),t.removeEventListener("abort",o)},i=()=>{n(),s()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),s()};t.addEventListener("complete",i),t.addEventListener("error",o),t.addEventListener("abort",o)});wp.set(t,e)}let vp={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return wp.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Bb.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Rs(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function R1(t){vp=t(vp)}function S1(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(If(this),e,...n);return Bb.set(r,e.sort?e.sort():[e]),Rs(r)}:v1().includes(t)?function(...e){return t.apply(If(this),e),Rs(Ub.get(this))}:function(...e){return Rs(t.apply(If(this),e))}}function P1(t){return typeof t=="function"?S1(t):(t instanceof IDBTransaction&&A1(t),T1(t,w1())?new Proxy(t,vp):t)}function Rs(t){if(t instanceof IDBRequest)return b1(t);if(Ef.has(t))return Ef.get(t);const e=P1(t);return e!==t&&(Ef.set(t,e),zm.set(e,t)),e}const If=t=>zm.get(t);function C1(t,e,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(t,e),a=Rs(o);return r&&o.addEventListener("upgradeneeded",c=>{r(Rs(o.result),c.oldVersion,c.newVersion,Rs(o.transaction),c)}),n&&o.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),a.then(c=>{i&&c.addEventListener("close",()=>i()),s&&c.addEventListener("versionchange",l=>s(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const k1=["get","getKey","getAll","getAllKeys","count"],N1=["put","add","delete","clear"],Tf=new Map;function $E(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Tf.get(e))return Tf.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,s=N1.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||k1.includes(n)))return;const i=async function(o,...a){const c=this.transaction(o,s?"readwrite":"readonly");let l=c.store;
17return r&&(l=l.index(a.shift())),(await Promise.all([l[n](...a),s&&c.done]))[0]};return Tf.set(e,i),i}R1(t=>({...t,get:(e,n,r)=>$E(e,n)||t.get(e,n,r),has:(e,n)=>!!$E(e,n)||t.has(e,n)}));class D1{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(O1(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function O1(t){return t.getComponent()?.type==="VERSION"}const bp="@firebase/app",qE="0.14.5";const Fr=new Km("@firebase/app"),x1="@firebase/app-compat",V1="@firebase/analytics-compat",L1="@firebase/analytics",M1="@firebase/app-check-compat",F1="@firebase/app-check",U1="@firebase/auth",B1="@firebase/auth-compat",j1="@firebase/database",$1="@firebase/data-connect",q1="@firebase/database-compat",H1="@firebase/functions",G1="@firebase/functions-compat",W1="@firebase/installations",K1="@firebase/installations-compat",z1="@firebase/messaging",Q1="@firebase/messaging-compat",J1="@firebase/performance",Y1="@firebase/performance-compat",X1="@firebase/remote-config",Z1="@firebase/remote-config-compat",eL="@firebase/storage",tL="@firebase/storage-compat",nL="@firebase/firestore",rL="@firebase/ai",sL="@firebase/firestore-compat",iL="firebase",oL="12.5.0";const ch="[DEFAULT]",aL={[bp]:"fire-core",[x1]:"fire-core-compat",[L1]:"fire-analytics",[V1]:"fire-analytics-compat",[F1]:"fire-app-check",[M1]:"fire-app-check-compat",[U1]:"fire-auth",[B1]:"fire-auth-compat",[j1]:"fire-rtdb",[$1]:"fire-data-connect",[q1]:"fire-rtdb-compat",[H1]:"fire-fn",[G1]:"fire-fn-compat",[W1]:"fire-iid",[K1]:"fire-iid-compat",[z1]:"fire-fcm",[Q1]:"fire-fcm-compat",[J1]:"fire-perf",[Y1]:"fire-perf-compat",[X1]:"fire-rc",[Z1]:"fire-rc-compat",[eL]:"fire-gcs",[tL]:"fire-gcs-compat",[nL]:"fire-fst",[sL]:"fire-fst-compat",[rL]:"fire-vertex","fire-js":"fire-js",[iL]:"fire-js-all"};const uh=new Map,cL=new Map,Ap=new Map;function HE(t,e){try{t.container.addComponent(e)}catch(n){Fr.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Os(t){const e=t.name;if(Ap.has(e))return Fr.debug(`There were multiple attempts to register component ${e}.`),!1;Ap.set(e,t);for(const n of uh.values())HE(n,t);for(const n of cL.values())HE(n,t);return!0}function Wi(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function uL(t,e,n=ch){Wi(t,e).clearInstance(n)}function Ze(t){return t==null?!1:t.settings!==void 0}const lL={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
17d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Ss=new Eu("app","Firebase",lL);class hL{constructor(e,n,r){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Mr("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Ss.create("app-deleted",{appName:this._name})}}const Ki=oL;function Rp(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r={name:ch,automaticDataCollectionEnabled:!0,...e},s=r.name;if(typeof s!="string"||!s)throw Ss.create("bad-app-name",{appName:String(s)});if(n||(n=Db()),!n)throw Ss.create("no-options");const i=uh.get(s);if(i){if(Hn(n,i.options)&&Hn(r,i.config))return i;throw Ss.create("duplicate-app",{appName:s})}const o=new g1(s);for(const c of Ap.values())o.addComponent(c);const a=new hL(n,r,o);return uh.set(s,a),a}function Iu(t=ch){const e=uh.get(t);if(!e&&t===ch&&Db())return Rp();if(!e)throw Ss.create("no-app",{appName:t});return e}function Pn(t,e,n){let r=aL[t]??t;n&&(r+=`-${n}`);const s=r.match(/\s|\//),i=e.match(/\s|\//);if(s||i){const o=[`Unable to register library "${r}" with version "${e}":`];s&&o.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&i&&o.push("and"),i&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Fr.warn(o.join(" "));return}Os(new Mr(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}const dL="firebase-heartbeat-database",fL=1,zc="firebase-heartbeat-store";let wf=null;function jb(){return wf||(wf=C1(dL,fL,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(zc)}catch(n){console.warn(n)}}}}).catch(t=>{throw Ss.create("idb-open",{originalErrorMessage:t.message})})),wf}async function pL(t){try{const n=(await jb()).transaction(zc),r=await n.objectStore(zc).get($b(t));return await n.done,r}catch(e){if(e instanceof Gn)Fr.warn(e.message);else{const n=Ss.create("idb-get",{originalErrorMessage:e?.message});Fr.warn(n.message)}}}async function GE(t,e){try{const r=(await jb()).transaction(zc,"readwrite");await r.objectStore(zc).put(e,$b(t)),await r.done}catch(n){if(n instanceof Gn)Fr.warn(n.message);else{const r=Ss.create("idb-set",{originalErrorMessage:n?.message});Fr.warn(r.message)}}}function $b(t){return`${t.name}!${t.options.appId}`}const mL=1024,gL=30;class _L{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new EL(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=WE();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(s=>s.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats.length>gL){const s=IL(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){Fr.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";const e=WE(),{heartbeatsToSend:n,unsentEntries:r}=yL(this._heartbeatsCache.heartbeats),s=ah(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(e){return Fr.warn(e),""}}}function WE(){return new Date().toISOString().substring(0,10)}function yL(t,e=mL){const n=[];let r=t.slice();for(const s of t){const i=n.find(o=>o.agent===s.agent);if(i){if(i.dates.push(s.date),KE(n)>e){i.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),KE(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class EL{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Fb()?i1().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await pL(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return GE(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return GE(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function KE(t){return ah(JSON.stringify({version:2,heartbeats:t})).length}function IL(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}function TL(t){Os(new Mr("platform-logger",e=>new D1(e),"PRIVATE")),Os(new Mr("heartbeat",e=>new _L(e),"PRIVATE")),Pn(bp,qE,t),Pn(bp,qE,"esm2020"),Pn("fire-js","")}TL("");var wL="firebase",vL="12.5.0";Pn(wL,vL,"app");var zE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};var Ps,qb;(function(){var t;function e(b,T){function I(){}I.prototype=T.prototype,b.F=T.prototype,b.prototype=new I,b.prototype.constructor=b,b.D=function(A,C,k){for(var R=Array(arguments.length-2),ge=2;ge<arguments.length;ge++)R[ge-2]=arguments[ge];return T.prototype[C].apply(A,R)}}function n(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}e(r,n),r.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function s(b,T,I){I||(I=0);const A=Array(16);if(typeof T=="string")for(var C=0;C<16;++C)A[C]=T.charCodeAt(I++)|T.charCodeAt(I++)<<8|T.charCodeAt(I++)<<16|T.charCodeAt(I++)<<24;else for(C=0;C<16;++C)A[C]=T[I++]|T[I++]<<8|T[I++]<<16|T[I++]<<24;T=b.g[0],I=b.g[1],C=b.g[2];let k=b.g[3],R;
17R=T+(k^I&(C^k))+A[0]+3614090360&4294967295,T=I+(R<<7&4294967295|R>>>25),R=k+(C^T&(I^C))+A[1]+3905402710&4294967295,k=T+(R<<12&4294967295|R>>>20),R=C+(I^k&(T^I))+A[2]+606105819&4294967295,C=k+(R<<17&4294967295|R>>>15),R=I+(T^C&(k^T))+A[3]+3250441966&4294967295,I=C+(R<<22&4294967295|R>>>10),R=T+(k^I&(C^k))+A[4]+4118548399&4294967295,T=I+(R<<7&4294967295|R>>>25),R=k+(C^T&(I^C))+A[5]+1200080426&4294967295,k=T+(R<<12&4294967295|R>>>20),R=C+(I^k&(T^I))+A[6]+2821735955&4294967295,C=k+(R<<17&4294967295|R>>>15),R=I+(T^C&(k^T))+A[7]+4249261313&4294967295,I=C+(R<<22&4294967295|R>>>10),R=T+(k^I&(C^k))+A[8]+1770035416&4294967295,T=I+(R<<7&4294967295|R>>>25),R=k+(C^T&(I^C))+A[9]+2336552879&4294967295,k=T+(R<<12&4294967295|R>>>20),R=C+(I^k&(T^I))+A[10]+4294925233&4294967295,C=k+(R<<17&4294967295|R>>>15),R=I+(T^C&(k^T))+A[11]+2304563134&4294967295,I=C+(R<<22&4294967295|R>>>10),R=T+(k^I&(C^k))+A[12]+1804603682&4294967295,T=I+(R<<7&4294967295|R>>>25),R=k+(C^T&(I^C))+A[13]+4254626195&4294967295,k=T+(R<<12&4294967295|R>>>20),R=C+(I^k&(T^I))+A[14]+2792965006&4294967295,C=k+(R<<17&4294967295|R>>>15),R=I+(T^C&(k^T))+A[15]+1236535329&4294967295,I=C+(R<<22&4294967295|R>>>10),R=T+(C^k&(I^C))+A[1]+4129170786&4294967295,T=I+(R<<5&4294967295|R>>>27),R=k+(I^C&(T^I))+A[6]+3225465664&4294967295,k=T+(R<<9&4294967295|R>>>23),R=C+(T^I&(k^T))+A[11]+643717713&4294967295,C=k+(R<<14&4294967295|R>>>18),R=I+(k^T&(C^k))+A[0]+3921069994&4294967295,I=C+(R<<20&4294967295|R>>>12),R=T+(C^k&(I^C))+A[5]+3593408605&4294967295,T=I+(R<<5&4294967295|R>>>27),R=k+(I^C&(T^I))+A[10]+38016083&4294967295,k=T+(R<<9&4294967295|R>>>23),R=C+(T^I&(k^T))+A[15]+3634488961&4294967295,C=k+(R<<14&4294967295|R>>>18),R=I+(k^T&(C^k))+A[4]+3889429448&4294967295,I=C+(R<<20&4294967295|R>>>12),R=T+(C^k&(I^C))+A[9]+568446438&4294967295,T=I+(R<<5&4294967295|R>>>27),R=k+(I^C&(T^I))+A[14]+3275163606&4294967295,k=T+(R<<9&4294967295|R>>>23),R=C+(T^I&(k^T))+A[3]+4107603335&4294967295,C=k+(R<<14&4294967295|R>>>18),R=I+(k^T&(C^k))+A[8]+1163531501&4294967295,I=C+(R<<20&4294967295|R>>>12),R=T+(C^k&(I^C))+A[13]+2850285829&4294967295,T=I+(R<<5&4294967295|R>>>27),R=k+(I^C&(T^I))+A[2]+4243563512&4294967295,k=T+(R<<9&4294967295|R>>>23),R=C+(T^I&(k^T))+A[7]+1735328473&4294967295,C=k+(R<<14&4294967295|R>>>18),R=I+(k^T&(C^k))+A[12]+2368359562&4294967295,I=C+(R<<20&4294967295|R>>>12),R=T+(I^C^k)+A[5]+4294588738&4294967295,T=I+(R<<4&4294967295|R>>>28),R=k+(T^I^C)+A[8]+2272392833&4294967295,k=T+(R<<11&4294967295|R>>>21),R=C+(k^T^I)+A[11]+1839030562&4294967295,C=k+(R<<16&4294967295|R>>>16),R=I+(C^k^T)+A[14]+4259657740&4294967295,I=C+(R<<23&4294967295|R>>>9),R=T+(I^C^k)+A[1]+2763975236&4294967295,T=I+(R<<4&4294967295|R>>>28),R=k+(T^I^C)+A[4]+1272893353&4294967295,k=T+(R<<11&4294967295|R>>>21),R=C+(k^T^I)+A[7]+4139469664&4294967295,C=k+(R<<16&4294967295|R>>>16),R=I+(C^k^T)+A[10]+3200236656&4294967295,I=C+(R<<23&4294967295|R>>>9),R=T+(I^C^k)+A[13]+681279174&4294967295,T=I+(R<<4&4294967295|R>>>28),R=k+(T^I^C)+A[0]+3936430074&4294967295,k=T+(R<<11&4294967295|R>>>21),R=C+(k^T^I)+A[3]+3572445317&4294967295,C=k+(R<<16&4294967295|R>>>16),R=I+(C^k^T)+A[6]+76029189&4294967295,I=C+(R<<23&4294967295|R>>>9),R=T+(I^C^k)+A[9]+3654602809&4294967295,T=I+(R<<4&4294967295|R>>>28),R=k+(T^I^C)+A[12]+3873151461&4294967295,k=T+(R<<11&4294967295|R>>>21),R=C+(k^T^I)+A[15]+530742520&4294967295,C=k+(R<<16&4294967295|R>>>16),R=I+(C^k^T)+A[2]+3299628645&4294967295,I=C+(R<<23&4294967295|R>>>9),R=T+(C^(I|~k))+A[0]+4096336452&4294967295,T=I+(R<<6&4294967295|R>>>26),R=k+(I^(T|~C))+A[7]+1126891415&4294967295,k=T+(R<<10&4294967295|R>>>22),R=C+(T^(k|~I))+A[14]+2878612391&4294967295,C=k+(R<<15&4294967295|R>>>17),R=I+(k^(C|~T))+A[5]+4237533241&4294967295,I=C+(R<<21&4294967295|R>>>11),R=T+(C^(I|~k))+A[12]+1700485571&4294967295,T=I+(R<<6&4294967295|R>>>26),R=k+(I^(T|~C))+A[3]+2399980690&4294967295,k=T+(R<<10&4294967295|R>>>22),R=C+(T^(k|~I))+A[10]+4293915773&4294967295,C=k+(R<<15&4294967295|R>>>17),R=I+(k^(C|~T))+A[1]+2240044497&4294967295,I=C+(R<<21&4294967295|R>>>11),R=T+(C^(I|~k))+A[8]+1873313359&4294967295,T=I+(R<<6&4294967295|R>>>26),R=k+(I^(T|~C))+A[15]+4264355552&4294967295,k=T+(R<<10&4294967295|R>>>22),R=C+(T^(k|~I))+A[6]+2734768916&4294967295,C=k+(R<<15&4294967295|R>>>17),R=I+(k^(C|~T))+A[13]+1309151649&4294967295,I=C+(R<<21&4294967295|R>>>11),R=T+(C^(I|~k))+A[4]+4149444226&4294967295,T=I+(R<<6&4294967295|R>>>26),R=k+(I^(T|~C))+A[11]+3174756917&4294967295,k=T+(R<<10&4294967295|R>>>22),R=C+(T^(k|~I))+A[2]+718787259&4294967295,C=k+(R<<15&4294967295|R>>>17),R=I+(k^(C|~T))+A[9]+3951481745&4294967295,b.g[0]=b.g[0]+T&4294967295,b.g[1]=b.g[1]+(C+(R<<21&4294967295|R>>>11))&4294967295,b.g[2]=b.g[2]+C&4294967295,b.g[3]=b.g[3]+k&4294967295}r.prototype.v=function(b,T){T===void 0&&(T=b.length);const I=T-this.blockSize,A=this.C;let C=this.h,k=0;for(;k<T;){if(C==0)for(;k<=I;)s(this,b,k),k+=this.blockSize;if(typeof b=="string"){for(;k<T;)if(A[C++]=b.charCodeAt(k++),C==this.blockSize){s(this,A),C=0;break}}else for(;k<T;)if(A[C++]=b[k++],C==this.blockSize){s(this,A),C=0;break}}this.h=C,this.o+=T},r.prototype.A=function(){var b=Array((this.h<56?this.blockSize:this.blockSize*2)-this.h);b[0]=128;for(var T=1;T<b.length-8;++T)b[T]=0;T=this.o*8;for(var I=b.length-8;I<b.length;++I)b[I]=T&255,T/=256;for(this.v(b),b=Array(16),T=0,I=0;I<4;++I)for(let A=0;A<32;A+=8)b[T++]=this.g[I]>>>A&255;return b};function i(b,T){var I=a;return Object.prototype.hasOwnProperty.call(I,b)?I[b]:I[b]=T(b)}function o(b,T){this.h=T;const I=[];let A=!0;for(let C=b.length-1;C>=0;C--){const k=b[C]|0;A&&k==T||(I[C]=k,A=!1)}this.g=I}var a={};function c(b){return-128<=b&&b<128?i(b,function(T){return new o([T|0],T<0?-1:0)}):new o([b|0],b<0?-1:0)}function l(b){if(isNaN(b)||!isFinite(b))return d;if(b<0)return v(l(-b));const T=[];let I=1;for(let A=0;b>=I;A++)T[A]=b/I|0,I*=4294967296;return new o(T,0)}function h(b,T){if(b.length==0)throw Error("number format error: empty string");if(T=T||10,T<2||36<T)throw Error("radix out of range: "+T);if(b.charAt(0)=="-")return v(h(b.substring(1),T));if(b.indexOf("-")>=0)throw Error('number format error: interior "-" character');const I=l(Math.pow(T,8));let A=d;for(let k=0;k<b.length;
17k+=8){var C=Math.min(8,b.length-k);const R=parseInt(b.substring(k,k+C),T);C<8?(C=l(Math.pow(T,C)),A=A.j(C).add(l(R))):(A=A.j(I),A=A.add(l(R)))}return A}var d=c(0),f=c(1),m=c(16777216);t=o.prototype,t.m=function(){if(E(this))return-v(this).m();let b=0,T=1;for(let I=0;I<this.g.length;I++){const A=this.i(I);b+=(A>=0?A:4294967296+A)*T,T*=4294967296}return b},t.toString=function(b){if(b=b||10,b<2||36<b)throw Error("radix out of range: "+b);if(_(this))return"0";if(E(this))return"-"+v(this).toString(b);const T=l(Math.pow(b,6));var I=this;let A="";for(;;){const C=S(I,T).g;I=O(I,C.j(T));let k=((I.g.length>0?I.g[0]:I.h)>>>0).toString(b);if(I=C,_(I))return k+A;for(;k.length<6;)k="0"+k;A=k+A}},t.i=function(b){return b<0?0:b<this.g.length?this.g[b]:this.h};function _(b){if(b.h!=0)return!1;for(let T=0;T<b.g.length;T++)if(b.g[T]!=0)return!1;return!0}function E(b){return b.h==-1}t.l=function(b){return b=O(this,b),E(b)?-1:_(b)?0:1};function v(b){const T=b.g.length,I=[];for(let A=0;A<T;A++)I[A]=~b.g[A];return new o(I,~b.h).add(f)}t.abs=function(){return E(this)?v(this):this},t.add=function(b){const T=Math.max(this.g.length,b.g.length),I=[];let A=0;for(let C=0;C<=T;C++){let k=A+(this.i(C)&65535)+(b.i(C)&65535),R=(k>>>16)+(this.i(C)>>>16)+(b.i(C)>>>16);A=R>>>16,k&=65535,R&=65535,I[C]=R<<16|k}return new o(I,I[I.length-1]&-2147483648?-1:0)};function O(b,T){return b.add(v(T))}t.j=function(b){if(_(this)||_(b))return d;if(E(this))return E(b)?v(this).j(v(b)):v(v(this).j(b));if(E(b))return v(this.j(v(b)));if(this.l(m)<0&&b.l(m)<0)return l(this.m()*b.m());const T=this.g.length+b.g.length,I=[];for(var A=0;A<2*T;A++)I[A]=0;for(A=0;A<this.g.length;A++)for(let C=0;C<b.g.length;C++){const k=this.i(A)>>>16,R=this.i(A)&65535,ge=b.i(C)>>>16,Te=b.i(C)&65535;I[2*A+2*C]+=R*Te,N(I,2*A+2*C),I[2*A+2*C+1]+=k*Te,N(I,2*A+2*C+1),I[2*A+2*C+1]+=R*ge,N(I,2*A+2*C+1),I[2*A+2*C+2]+=k*ge,N(I,2*A+2*C+2)}for(b=0;b<T;b++)I[b]=I[2*b+1]<<16|I[2*b];for(b=T;b<2*T;b++)I[b]=0;return new o(I,0)};function N(b,T){for(;(b[T]&65535)!=b[T];)b[T+1]+=b[T]>>>16,b[T]&=65535,T++}function y(b,T){this.g=b,this.h=T}function S(b,T){if(_(T))throw Error("division by zero");if(_(b))return new y(d,d);if(E(b))return T=S(v(b),T),new y(v(T.g),v(T.h));if(E(T))return T=S(b,v(T)),new y(v(T.g),T.h);if(b.g.length>30){if(E(b)||E(T))throw Error("slowDivide_ only works with positive integers.");for(var I=f,A=T;A.l(b)<=0;)I=D(I),A=D(A);var C=M(I,1),k=M(A,1);for(A=M(A,2),I=M(I,2);!_(A);){var R=k.add(A);R.l(b)<=0&&(C=C.add(I),k=R),A=M(A,1),I=M(I,1)}return T=O(b,C.j(T)),new y(C,T)}for(C=d;b.l(T)>=0;){for(I=Math.max(1,Math.floor(b.m()/T.m())),A=Math.ceil(Math.log(I)/Math.LN2),A=A<=48?1:Math.pow(2,A-48),k=l(I),R=k.j(T);E(R)||R.l(b)>0;)I-=A,k=l(I),R=k.j(T);_(k)&&(k=f),C=C.add(k),b=O(b,R)}return new y(C,b)}t.B=function(b){return S(this,b).h},t.and=function(b){const T=Math.max(this.g.length,b.g.length),I=[];for(let A=0;A<T;A++)I[A]=this.i(A)&b.i(A);return new o(I,this.h&b.h)},t.or=function(b){const T=Math.max(this.g.length,b.g.length),I=[];for(let A=0;A<T;A++)I[A]=this.i(A)|b.i(A);return new o(I,this.h|b.h)},t.xor=function(b){const T=Math.max(this.g.length,b.g.length),I=[];for(let A=0;A<T;A++)I[A]=this.i(A)^b.i(A);return new o(I,this.h^b.h)};function D(b){const T=b.g.length+1,I=[];for(let A=0;A<T;A++)I[A]=b.i(A)<<1|b.i(A-1)>>>31;return new o(I,b.h)}function M(b,T){const I=T>>5;T%=32;const A=b.g.length-I,C=[];for(let k=0;k<A;k++)C[k]=T>0?b.i(k+I)>>>T|b.i(k+I+1)<<32-T:b.i(k+I);return new o(C,b.h)}r.prototype.digest=r.prototype.A,r.prototype.reset=r.prototype.u,r.prototype.update=r.prototype.v,qb=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.B,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=l,o.fromString=h,Ps=o}).apply(typeof zE<"u"?zE:typeof self<"u"?self:typeof window<"u"?window:{});var ol=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};var Hb,lc,Gb,Sl,Sp,Wb,Kb,zb;(function(){var t,e=Object.defineProperty;function n(u){u=[typeof globalThis=="object"&&globalThis,u,typeof window=="object"&&window,typeof self=="object"&&self,typeof ol=="object"&&ol];for(var p=0;p<u.length;++p){var g=u[p];if(g&&g.Math==Math)return g}throw Error("Cannot find global object")}var r=n(this);function s(u,p){if(p)e:{var g=r;u=u.split(".");for(var w=0;w<u.length-1;w++){var L=u[w];if(!(L in g))break e;g=g[L]}u=u[u.length-1],w=g[u],p=p(w),p!=w&&p!=null&&e(g,u,{configurable:!0,writable:!0,value:p})}}s("Symbol.dispose",function(u){return u||Symbol("Symbol.dispose")}),s("Array.prototype.values",function(u){return u||function(){return this[Symbol.iterator]()}}),s("Object.entries",function(u){return u||function(p){var g=[],w;for(w in p)Object.prototype.hasOwnProperty.call(p,w)&&g.push([w,p[w]]);return g}});var i=i||{},o=this||self;function a(u){var p=typeof u;return p=="object"&&u!=null||p=="function"}function c(u,p,g){return u.call.apply(u.bind,arguments)}function l(u,p,g){return l=c,l.apply(null,arguments)}
17function h(u,p){var g=Array.prototype.slice.call(arguments,1);return function(){var w=g.slice();return w.push.apply(w,arguments),u.apply(this,w)}}function d(u,p){function g(){}g.prototype=p.prototype,u.Z=p.prototype,u.prototype=new g,u.prototype.constructor=u,u.Ob=function(w,L,B){for(var ee=Array(arguments.length-2),we=2;we<arguments.length;we++)ee[we-2]=arguments[we];return p.prototype[L].apply(w,ee)}}var f=typeof AsyncContext<"u"&&typeof AsyncContext.Snapshot=="function"?u=>u&&AsyncContext.Snapshot.wrap(u):u=>u;function m(u){const p=u.length;if(p>0){const g=Array(p);for(let w=0;w<p;w++)g[w]=u[w];return g}return[]}function _(u,p){for(let w=1;w<arguments.length;w++){const L=arguments[w];var g=typeof L;if(g=g!="object"?g:L?Array.isArray(L)?"array":g:"null",g=="array"||g=="object"&&typeof L.length=="number"){g=u.length||0;const B=L.length||0;u.length=g+B;for(let ee=0;ee<B;ee++)u[g+ee]=L[ee]}else u.push(L)}}class E{constructor(p,g){this.i=p,this.j=g,this.h=0,this.g=null}get(){let p;return this.h>0?(this.h--,p=this.g,this.g=p.next,p.next=null):p=this.i(),p}}function v(u){o.setTimeout(()=>{throw u},0)}function O(){var u=b;let p=null;return u.g&&(p=u.g,u.g=u.g.next,u.g||(u.h=null),p.next=null),p}class N{constructor(){this.h=this.g=null}add(p,g){const w=y.get();w.set(p,g),this.h?this.h.next=w:this.g=w,this.h=w}}var y=new E(()=>new S,u=>u.reset());class S{constructor(){this.next=this.g=this.h=null}set(p,g){this.h=p,this.g=g,this.next=null}reset(){this.next=this.g=this.h=null}}let D,M=!1,b=new N,T=()=>{const u=Promise.resolve(void 0);D=()=>{u.then(I)}};function I(){for(var u;u=O();){try{u.h.call(u.g)}catch(g){v(g)}var p=y;p.j(u),p.h<100&&(p.h++,u.next=p.g,p.g=u)}M=!1}function A(){this.u=this.u,this.C=this.C}A.prototype.u=!1,A.prototype.dispose=function(){this.u||(this.u=!0,this.N())},A.prototype[Symbol.dispose]=function(){this.dispose()},A.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function C(u,p){this.type=u,this.g=this.target=p,this.defaultPrevented=!1}C.prototype.h=function(){this.defaultPrevented=!0};var k=(function(){if(!o.addEventListener||!Object.defineProperty)return!1;var u=!1,p=Object.defineProperty({},"passive",{get:function(){u=!0}});try{const g=()=>{};o.addEventListener("test",g,p),o.removeEventListener("test",g,p)}catch{}return u})();function R(u){return/^[\s\xa0]*$/.test(u)}function ge(u,p){C.call(this,u?u.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,u&&this.init(u,p)}d(ge,C),ge.prototype.init=function(u,p){const g=this.type=u.type,w=u.changedTouches&&u.changedTouches.length?u.changedTouches[0]:null;this.target=u.target||u.srcElement,this.g=p,p=u.relatedTarget,p||(g=="mouseover"?p=u.fromElement:g=="mouseout"&&(p=u.toElement)),this.relatedTarget=p,w?(this.clientX=w.clientX!==void 0?w.clientX:w.pageX,this.clientY=w.clientY!==void 0?w.clientY:w.pageY,this.screenX=w.screenX||0,this.screenY=w.screenY||0):(this.clientX=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0),this.button=u.button,this.key=u.key||"",this.ctrlKey=u.ctrlKey,this.altKey=u.altKey,this.shiftKey=u.shiftKey,this.metaKey=u.metaKey,this.pointerId=u.pointerId||0,this.pointerType=u.pointerType,this.state=u.state,this.i=u,u.defaultPrevented&&ge.Z.h.call(this)},ge.prototype.h=function(){ge.Z.h.call(this);const u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var Te="closure_listenable_"+(Math.random()*1e6|0),se=0;function de(u,p,g,w,L){this.listener=u,this.proxy=null,this.src=p,this.type=g,this.capture=!!w,this.ha=L,this.key=++se,this.da=this.fa=!1}function ae(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function Ge(u,p,g){for(const w in u)p.call(g,u[w],w,u)}function Wn(u,p){for(const g in u)p.call(void 0,u[g],g,u)}function yn(u){const p={};for(const g in u)p[g]=u[g];return p}const Mt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
17ing toString valueOf".split(" ");function dr(u,p){let g,w;for(let L=1;L<arguments.length;L++){w=arguments[L];for(g in w)u[g]=w[g];for(let B=0;B<Mt.length;B++)g=Mt[B],Object.prototype.hasOwnProperty.call(w,g)&&(u[g]=w[g])}}function Dn(u){this.src=u,this.g={},this.h=0}Dn.prototype.add=function(u,p,g,w,L){const B=u.toString();u=this.g[B],u||(u=this.g[B]=[],this.h++);const ee=qt(u,p,w,L);return ee>-1?(p=u[ee],g||(p.fa=!1)):(p=new de(p,this.src,B,!!w,L),p.fa=g,u.push(p)),p};function On(u,p){const g=p.type;if(g in u.g){var w=u.g[g],L=Array.prototype.indexOf.call(w,p,void 0),B;(B=L>=0)&&Array.prototype.splice.call(w,L,1),B&&(ae(p),u.g[g].length==0&&(delete u.g[g],u.h--))}}function qt(u,p,g,w){for(let L=0;L<u.length;++L){const B=u[L];if(!B.da&&B.listener==p&&B.capture==!!g&&B.ha==w)return L}return-1}var q="closure_lm_"+(Math.random()*1e6|0),oe={};function te(u,p,g,w,L){if(Array.isArray(p)){for(let B=0;B<p.length;B++)te(u,p[B],g,w,L);return null}return g=W(g),u&&u[Te]?u.J(p,g,a(w)?!!w.capture:!1,L):fe(u,p,g,!1,w,L)}function fe(u,p,g,w,L,B){if(!p)throw Error("Invalid event type");const ee=a(L)?!!L.capture:!!L;let we=G(u);if(we||(u[q]=we=new Dn(u)),g=we.add(p,g,w,ee,B),g.proxy)return g;if(w=ve(),g.proxy=w,w.src=u,w.listener=g,u.addEventListener)k||(L=ee),L===void 0&&(L=!1),u.addEventListener(p.toString(),w,L);else if(u.attachEvent)u.attachEvent(x(p.toString()),w);else if(u.addListener&&u.removeListener)u.addListener(w);else throw Error("addEventListener and attachEvent are unavailable.");return g}function ve(){function u(g){return p.call(u.src,u.listener,g)}const p=U;return u}function We(u,p,g,w,L){if(Array.isArray(p))for(var B=0;B<p.length;B++)We(u,p[B],g,w,L);else w=a(w)?!!w.capture:!!w,g=W(g),u&&u[Te]?(u=u.i,B=String(p).toString(),B in u.g&&(p=u.g[B],g=qt(p,g,w,L),g>-1&&(ae(p[g]),Array.prototype.splice.call(p,g,1),p.length==0&&(delete u.g[B],u.h--)))):u&&(u=G(u))&&(p=u.g[p.toString()],u=-1,p&&(u=qt(p,g,w,L)),(g=u>-1?p[u]:null)&&P(g))}function P(u){if(typeof u!="number"&&u&&!u.da){var p=u.src;if(p&&p[Te])On(p.i,u);else{var g=u.type,w=u.proxy;p.removeEventListener?p.removeEventListener(g,w,u.capture):p.detachEvent?p.detachEvent(x(g),w):p.addListener&&p.removeListener&&p.removeListener(w),(g=G(p))?(On(g,u),g.h==0&&(g.src=null,p[q]=null)):ae(u)}}}function x(u){return u in oe?oe[u]:oe[u]="on"+u}function U(u,p){if(u.da)u=!0;else{p=new ge(p,this);const g=u.listener,w=u.ha||u.src;u.fa&&P(u),u=g.call(w,p)}return u}function G(u){return u=u[q],u instanceof Dn?u:null}var j="__closure_events_fn_"+(Math.random()*1e9>>>0);function W(u){return typeof u=="function"?u:(u[j]||(u[j]=function(p){return u.handleEvent(p)}),u[j])}function J(){A.call(this),this.i=new Dn(this),this.M=this,this.G=null}d(J,A),J.prototype[Te]=!0,J.prototype.removeEventListener=function(u,p,g,w){We(this,u,p,g,w)};function K(u,p){var g,w=u.G;if(w)for(g=[];w;w=w.G)g.push(w);if(u=u.M,w=p.type||p,typeof p=="string")p=new C(p,u);else if(p instanceof C)p.target=p.target||u;else{var L=p;p=new C(w,u),dr(p,L)}L=!0;let B,ee;if(g)for(ee=g.length-1;ee>=0;ee--)B=p.g=g[ee],L=Y(B,w,!0,p)&&L;if(B=p.g=u,L=Y(B,w,!0,p)&&L,L=Y(B,w,!1,p)&&L,g)for(ee=0;ee<g.length;ee++)B=p.g=g[ee],L=Y(B,w,!1,p)&&L}J.prototype.N=function(){if(J.Z.N.call(this),this.i){var u=this.i;for(const p in u.g){const g=u.g[p];for(let w=0;w<g.length;w++)ae(g[w]);delete u.g[p],u.h--}}this.G=null},J.prototype.J=function(u,p,g,w){return this.i.add(String(u),p,!1,g,w)},J.prototype.K=function(u,p,g,w){return this.i.add(String(u),p,!0,g,w)};function Y(u,p,g,w){if(p=u.i.g[String(p)],!p)return!0;p=p.concat();let L=!0;for(let B=0;B<p.length;++B){const ee=p[B];if(ee&&!ee.da&&ee.capture==g){const we=ee.listener,wt=ee.ha||ee.src;ee.fa&&On(u.i,ee),L=we.call(wt,w)!==!1&&L}}return L&&!w.defaultPrevented}function z(u,p){if(typeof u!="function")if(u&&typeof u.handleEvent=="function")u=l(u.handleEvent,u);else throw Error("Invalid listener argument");return Number(p)>2147483647?-1:o.setTimeout(u,p||0)}function me(u){u.g=z(()=>{u.g=null,u.i&&(u.i=!1,me(u))},u.l);const p=u.h;u.h=null,u.m.apply(null,p)}class ne extends A{constructor(p,g){super(),this.m=p,this.l=g,this.h=null,this.i=!1,this.g=null}j(p){this.h=arguments,this.g?this.i=!0:me(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function le(u){A.call(this),this.h=u,this.g={}}d(le,A);var Ee=[];function Re(u){Ge(u.g,function(p,g){this.g.hasOwnProperty(g)&&P(p)},u),u.g={}}le.prototype.N=function(){le.Z.N.call(this),Re(this)},le.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Ve=o.JSON.stringify,De=o.JSON.parse,Ht=class{stringify(u){return o.JSON.stringify(u,void 0)}parse(u){return o.JSON.parse(u,void 0)}};function It(){}function an(){}var Tt={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function fr(){C.call(this,"d")}d(fr,C);function eo(){C.call(this,"c")}d(eo,C);var dt={},En=null;function Ys(){return En=En||new J}dt.Ia="serverreachability";function xa(u){C.call(this,dt.Ia,u)}d(xa,C);function Va(u){const p=Ys();K(p,new xa(p))}dt.STAT_EVENT="statevent";function w_(u,p){C.call(this,dt.STAT_EVENT,u),this.stat=p}d(w_,C);function Xt(u){const p=Ys();K(p,new w_(p,u))}dt.Ja="timingevent";function v_(u,p){C.call(this,dt.Ja,u),this.size=p}d(v_,C);function La(u,p){if(typeof u!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){u()},p)}function Ma(){this.g=!0}Ma.prototype.ua=function(){this.g=!1};function tC(u,p,g,w,L,B){u.info(function(){if(u.g)if(B){var ee="",we=B.split("&");for(let Ke=0;Ke<we.length;Ke++){var wt=we[Ke].split("=");if(wt.length>1){const Ct=wt[0];wt=wt[1];const zn=Ct.split("_");ee=zn.length>=2&&zn[1]=="type"?ee+(Ct+"="+wt+"&"):ee+(Ct+"=redacted&")}}}else ee=null;else ee=B;return"XMLHTTP REQ ("+w+") [attempt "+L+"]: "+p+`
18`+g+`
19`+ee})}function nC(u,p,g,w,L,B,ee){u.info(function(){return"XMLHTTP RESP ("+w+") [ attempt "+L+"]: "+p+`
20`+g+`
21`+B+" "+ee})}function to(u,p,g,w){u.info(function(){return"XMLHTTP TEXT ("+p+"): "+sC(u,g)+(w?" "+w:"")})}function rC(u,p){u.info(function(){return"TIMEOUT: "+p})}Ma.prototype.info=function(){};function sC(u,p){if(!u.g)return p;if(!p)return null;try{const B=JSON.parse(p);if(B){for(u=0;
21u<B.length;u++)if(Array.isArray(B[u])){var g=B[u];if(!(g.length<2)){var w=g[1];if(Array.isArray(w)&&!(w.length<1)){var L=w[0];if(L!="noop"&&L!="stop"&&L!="close")for(let ee=1;ee<w.length;ee++)w[ee]=""}}}}return Ve(B)}catch{return p}}var Uu={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},b_={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"},A_;function xd(){}d(xd,It),xd.prototype.g=function(){return new XMLHttpRequest},A_=new xd;function Fa(u){return encodeURIComponent(String(u))}function iC(u){var p=1;u=u.split(":");const g=[];for(;p>0&&u.length;)g.push(u.shift()),p--;return u.length&&g.push(u.join(":")),g}function Zr(u,p,g,w){this.j=u,this.i=p,this.l=g,this.S=w||1,this.V=new le(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new R_}function R_(){this.i=null,this.g="",this.h=!1}var S_={},Vd={};function Ld(u,p,g){u.M=1,u.A=ju(Kn(p)),u.u=g,u.R=!0,P_(u,null)}function P_(u,p){u.F=Date.now(),Bu(u),u.B=Kn(u.A);var g=u.B,w=u.S;Array.isArray(w)||(w=[String(w)]),j_(g.i,"t",w),u.C=0,g=u.j.L,u.h=new R_,u.g=iy(u.j,g?p:null,!u.u),u.P>0&&(u.O=new ne(l(u.Y,u,u.g),u.P)),p=u.V,g=u.g,w=u.ba;var L="readystatechange";Array.isArray(L)||(L&&(Ee[0]=L.toString()),L=Ee);for(let B=0;B<L.length;B++){const ee=te(g,L[B],w||p.handleEvent,!1,p.h||p);if(!ee)break;p.g[ee.key]=ee}p=u.J?yn(u.J):{},u.u?(u.v||(u.v="POST"),p["Content-Type"]="application/x-www-form-urlencoded",u.g.ea(u.B,u.v,u.u,p)):(u.v="GET",u.g.ea(u.B,u.v,null,p)),Va(),tC(u.i,u.v,u.B,u.l,u.S,u.u)}Zr.prototype.ba=function(u){u=u.target;const p=this.O;p&&ns(u)==3?p.j():this.Y(u)},Zr.prototype.Y=function(u){try{if(u==this.g)e:{const we=ns(this.g),wt=this.g.ya(),Ke=this.g.ca();if(!(we<3)&&(we!=3||this.g&&(this.h.h||this.g.la()||z_(this.g)))){this.K||we!=4||wt==7||(wt==8||Ke<=0?Va(3):Va(2)),Md(this);var p=this.g.ca();this.X=p;var g=oC(this);if(this.o=p==200,nC(this.i,this.v,this.B,this.l,this.S,we,p),this.o){if(this.U&&!this.L){t:{if(this.g){var w,L=this.g;if((w=L.g?L.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!R(w)){var B=w;break t}}B=null}if(u=B)to(this.i,this.l,u,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,Fd(this,u);else{this.o=!1,this.m=3,Xt(12),Xs(this),Ua(this);break e}}if(this.R){u=!0;let Ct;for(;!this.K&&this.C<g.length;)if(Ct=aC(this,g),Ct==Vd){we==4&&(this.m=4,Xt(14),u=!1),to(this.i,this.l,null,"[Incomplete Response]");break}else if(Ct==S_){this.m=4,Xt(15),to(this.i,this.l,g,"[Invalid Chunk]"),u=!1;break}else to(this.i,this.l,Ct,null),Fd(this,Ct);if(C_(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),we!=4||g.length!=0||this.h.h||(this.m=1,Xt(16),u=!1),this.o=this.o&&u,!u)to(this.i,this.l,g,"[Invalid Chunked Response]"),Xs(this),Ua(this);else if(g.length>0&&!this.W){this.W=!0;var ee=this.j;ee.g==this&&ee.aa&&!ee.P&&(ee.j.info("Great, no buffering proxy detected. Bytes received: "+g.length),Wd(ee),ee.P=!0,Xt(11))}}else to(this.i,this.l,g,null),Fd(this,g);we==4&&Xs(this),this.o&&!this.K&&(we==4?ty(this.j,this):(this.o=!1,Bu(this)))}else TC(this.g),p==400&&g.indexOf("Unknown SID")>0?(this.m=3,Xt(12)):(this.m=0,Xt(13)),Xs(this),Ua(this)}}}catch{}finally{}};function oC(u){if(!C_(u))return u.g.la();const p=z_(u.g);if(p==="")return"";let g="";const w=p.length,L=ns(u.g)==4;if(!u.h.i){if(typeof TextDecoder>"u")return Xs(u),Ua(u),"";u.h.i=new o.TextDecoder}for(let B=0;B<w;B++)u.h.h=!0,g+=u.h.i.decode(p[B],{stream:!(L&&B==w-1)});return p.length=0,u.h.g+=g,u.C=0,u.h.g}function C_(u){return u.g?u.v=="GET"&&u.M!=2&&u.j.Aa:!1}function aC(u,p){var g=u.C,w=p.indexOf(`
22`,g);return w==-1?Vd:(g=Number(p.substring(g,w)),isNaN(g)?S_:(w+=1,w+g>p.length?Vd:(p=p.slice(w,w+g),u.C=w+g,p)))}Zr.prototype.cancel=function(){this.K=!0,Xs(this)};function Bu(u){u.T=Date.now()+u.H,k_(u,u.H)}function k_(u,p){if(u.D!=null)throw Error("WatchDog timer not null");u.D=La(l(u.aa,u),p)}function Md(u){u.D&&(o.clearTimeout(u.D),u.D=null)}Zr.prototype.aa=function(){this.D=null;const u=Date.now();u-this.T>=0?(rC(this.i,this.B),this.M!=2&&(Va(),Xt(17)),Xs(this),this.m=2,Ua(this)):k_(this,this.T-u)};function Ua(u){u.j.I==0||u.K||ty(u.j,u)}function Xs(u){Md(u);var p=u.O;p&&typeof p.dispose=="function"&&p.dispose(),u.O=null,Re(u.V),u.g&&(p=u.g,u.g=null,p.abort(),p.dispose())}function Fd(u,p){try{var g=u.j;if(g.I!=0&&(g.g==u||Ud(g.h,u))){if(!u.L&&Ud(g.h,u)&&g.I==3){try{var w=g.Ba.g.parse(p)}catch{w=null}if(Array.isArray(w)&&w.length==3){var L=w;if(L[0]==0){e:if(!g.v){if(g.g)if(g.g.F+3e3<u.F)Wu(g),Hu(g);else break e;Gd(g),Xt(18)}}else g.xa=L[1],0<g.xa-g.K&&L[2]<37500&&g.F&&g.A==0&&!g.C&&(g.C=La(l(g.Va,g),6e3));O_(g.h)<=1&&g.ta&&(g.ta=void 0)}else ei(g,11)}
22else if((u.L||g.g==u)&&Wu(g),!R(p))for(L=g.Ba.g.parse(p),p=0;p<L.length;p++){let Ke=L[p];const Ct=Ke[0];if(!(Ct<=g.K))if(g.K=Ct,Ke=Ke[1],g.I==2)if(Ke[0]=="c"){g.M=Ke[1],g.ba=Ke[2];const zn=Ke[3];zn!=null&&(g.ka=zn,g.j.info("VER="+g.ka));const ti=Ke[4];ti!=null&&(g.za=ti,g.j.info("SVER="+g.za));const rs=Ke[5];rs!=null&&typeof rs=="number"&&rs>0&&(w=1.5*rs,g.O=w,g.j.info("backChannelRequestTimeoutMs_="+w)),w=g;const ss=u.g;if(ss){const zu=ss.g?ss.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(zu){var B=w.h;B.g||zu.indexOf("spdy")==-1&&zu.indexOf("quic")==-1&&zu.indexOf("h2")==-1||(B.j=B.l,B.g=new Set,B.h&&(Bd(B,B.h),B.h=null))}if(w.G){const Kd=ss.g?ss.g.getResponseHeader("X-HTTP-Session-Id"):null;Kd&&(w.wa=Kd,Ye(w.J,w.G,Kd))}}g.I=3,g.l&&g.l.ra(),g.aa&&(g.T=Date.now()-u.F,g.j.info("Handshake RTT: "+g.T+"ms")),w=g;var ee=u;if(w.na=sy(w,w.L?w.ba:null,w.W),ee.L){x_(w.h,ee);var we=ee,wt=w.O;wt&&(we.H=wt),we.D&&(Md(we),Bu(we)),w.g=ee}else Z_(w);g.i.length>0&&Gu(g)}else Ke[0]!="stop"&&Ke[0]!="close"||ei(g,7);else g.I==3&&(Ke[0]=="stop"||Ke[0]=="close"?Ke[0]=="stop"?ei(g,7):Hd(g):Ke[0]!="noop"&&g.l&&g.l.qa(Ke),g.A=0)}}Va(4)}catch{}}var cC=class{constructor(u,p){this.g=u,this.map=p}};function N_(u){this.l=u||10,o.PerformanceNavigationTiming?(u=o.performance.getEntriesByType("navigation"),u=u.length>0&&(u[0].nextHopProtocol=="hq"||u[0].nextHopProtocol=="h2")):u=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=u?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function D_(u){return u.h?!0:u.g?u.g.size>=u.j:!1}function O_(u){return u.h?1:u.g?u.g.size:0}function Ud(u,p){return u.h?u.h==p:u.g?u.g.has(p):!1}function Bd(u,p){u.g?u.g.add(p):u.h=p}function x_(u,p){u.h&&u.h==p?u.h=null:u.g&&u.g.has(p)&&u.g.delete(p)}N_.prototype.cancel=function(){if(this.i=V_(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const u of this.g.values())u.cancel();this.g.clear()}};function V_(u){if(u.h!=null)return u.i.concat(u.h.G);if(u.g!=null&&u.g.size!==0){let p=u.i;for(const g of u.g.values())p=p.concat(g.G);return p}return m(u.i)}var L_=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function uC(u,p){if(u){u=u.split("&");for(let g=0;g<u.length;g++){const w=u[g].indexOf("=");let L,B=null;w>=0?(L=u[g].substring(0,w),B=u[g].substring(w+1)):L=u[g],p(L,B?decodeURIComponent(B.replace(/\+/g," ")):"")}}}function es(u){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let p;u instanceof es?(this.l=u.l,Ba(this,u.j),this.o=u.o,this.g=u.g,ja(this,u.u),this.h=u.h,jd(this,$_(u.i)),this.m=u.m):u&&(p=String(u).match(L_))?(this.l=!1,Ba(this,p[1]||"",!0),this.o=$a(p[2]||""),this.g=$a(p[3]||"",!0),ja(this,p[4]),this.h=$a(p[5]||"",!0),jd(this,p[6]||"",!0),this.m=$a(p[7]||"")):(this.l=!1,this.i=new Ha(null,this.l))}es.prototype.toString=function(){const u=[];var p=this.j;p&&u.push(qa(p,M_,!0),":");var g=this.g;return(g||p=="file")&&(u.push("//"),(p=this.o)&&u.push(qa(p,M_,!0),"@"),u.push(Fa(g).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),g=this.u,g!=null&&u.push(":",String(g))),(g=this.h)&&(this.g&&g.charAt(0)!="/"&&u.push("/"),u.push(qa(g,g.charAt(0)=="/"?dC:hC,!0))),(g=this.i.toString())&&u.push("?",g),(g=this.m)&&u.push("#",qa(g,pC)),u.join("")},es.prototype.resolve=function(u){const p=Kn(this);let g=!!u.j;g?Ba(p,u.j):g=!!u.o,g?p.o=u.o:g=!!u.g,g?p.g=u.g:g=u.u!=null;var w=u.h;if(g)ja(p,u.u);else if(g=!!u.h){if(w.charAt(0)!="/")if(this.g&&!this.h)w="/"+w;else{var L=p.h.lastIndexOf("/");L!=-1&&(w=p.h.slice(0,L+1)+w)}if(L=w,L==".."||L==".")w="";else if(L.indexOf("./")!=-1||L.indexOf("/.")!=-1){w=L.lastIndexOf("/",0)==0,L=L.split("/");const B=[];for(let ee=0;ee<L.length;){const we=L[ee++];we=="."?w&&ee==L.length&&B.push(""):we==".."?((B.length>1||B.length==1&&B[0]!="")&&B.pop(),w&&ee==L.length&&B.push("")):(B.push(we),w=!0)}w=B.join("/")}else w=L}return g?p.h=w:g=u.i.toString()!=="",g?jd(p,$_(u.i)):g=!!u.m,g&&(p.m=u.m),p};function Kn(u){return new es(u)}function Ba(u,p,g){u.j=g?$a(p,!0):p,u.j&&(u.j=u.j.replace(/:$/,""))}function ja(u,p){if(p){if(p=Number(p),isNaN(p)||p<0)throw Error("Bad port number "+p);u.u=p}else u.u=null}
22function jd(u,p,g){p instanceof Ha?(u.i=p,mC(u.i,u.l)):(g||(p=qa(p,fC)),u.i=new Ha(p,u.l))}function Ye(u,p,g){u.i.set(p,g)}function ju(u){return Ye(u,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),u}function $a(u,p){return u?p?decodeURI(u.replace(/%25/g,"%2525")):decodeURIComponent(u):""}function qa(u,p,g){return typeof u=="string"?(u=encodeURI(u).replace(p,lC),g&&(u=u.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),u):null}function lC(u){return u=u.charCodeAt(0),"%"+(u>>4&15).toString(16)+(u&15).toString(16)}var M_=/[#\/\?@]/g,hC=/[#\?:]/g,dC=/[#\?]/g,fC=/[#\?@]/g,pC=/#/g;function Ha(u,p){this.h=this.g=null,this.i=u||null,this.j=!!p}function Zs(u){u.g||(u.g=new Map,u.h=0,u.i&&uC(u.i,function(p,g){u.add(decodeURIComponent(p.replace(/\+/g," ")),g)}))}t=Ha.prototype,t.add=function(u,p){Zs(this),this.i=null,u=no(this,u);let g=this.g.get(u);return g||this.g.set(u,g=[]),g.push(p),this.h+=1,this};function F_(u,p){Zs(u),p=no(u,p),u.g.has(p)&&(u.i=null,u.h-=u.g.get(p).length,u.g.delete(p))}function U_(u,p){return Zs(u),p=no(u,p),u.g.has(p)}t.forEach=function(u,p){Zs(this),this.g.forEach(function(g,w){g.forEach(function(L){u.call(p,L,w,this)},this)},this)};function B_(u,p){Zs(u);let g=[];if(typeof p=="string")U_(u,p)&&(g=g.concat(u.g.get(no(u,p))));else for(u=Array.from(u.g.values()),p=0;p<u.length;p++)g=g.concat(u[p]);return g}t.set=function(u,p){return Zs(this),this.i=null,u=no(this,u),U_(this,u)&&(this.h-=this.g.get(u).length),this.g.set(u,[p]),this.h+=1,this},t.get=function(u,p){return u?(u=B_(this,u),u.length>0?String(u[0]):p):p};function j_(u,p,g){F_(u,p),g.length>0&&(u.i=null,u.g.set(no(u,p),m(g)),u.h+=g.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const u=[],p=Array.from(this.g.keys());for(let w=0;w<p.length;w++){var g=p[w];const L=Fa(g);g=B_(this,g);for(let B=0;B<g.length;B++){let ee=L;g[B]!==""&&(ee+="="+Fa(g[B])),u.push(ee)}}return this.i=u.join("&")};function $_(u){const p=new Ha;return p.i=u.i,u.g&&(p.g=new Map(u.g),p.h=u.h),p}function no(u,p){return p=String(p),u.j&&(p=p.toLowerCase()),p}function mC(u,p){p&&!u.j&&(Zs(u),u.i=null,u.g.forEach(function(g,w){const L=w.toLowerCase();w!=L&&(F_(this,w),j_(this,L,g))},u)),u.j=p}function gC(u,p){const g=new Ma;if(o.Image){const w=new Image;w.onload=h(ts,g,"TestLoadImage: loaded",!0,p,w),w.onerror=h(ts,g,"TestLoadImage: error",!1,p,w),w.onabort=h(ts,g,"TestLoadImage: abort",!1,p,w),w.ontimeout=h(ts,g,"TestLoadImage: timeout",!1,p,w),o.setTimeout(function(){w.ontimeout&&w.ontimeout()},1e4),w.src=u}else p(!1)}function _C(u,p){const g=new Ma,w=new AbortController,L=setTimeout(()=>{w.abort(),ts(g,"TestPingServer: timeout",!1,p)},1e4);fetch(u,{signal:w.signal}).then(B=>{clearTimeout(L),B.ok?ts(g,"TestPingServer: ok",!0,p):ts(g,"TestPingServer: server error",!1,p)}).catch(()=>{clearTimeout(L),ts(g,"TestPingServer: error",!1,p)})}function ts(u,p,g,w,L){try{L&&(L.onload=null,L.onerror=null,L.onabort=null,L.ontimeout=null),w(g)}catch{}}function yC(){this.g=new Ht}function $d(u){this.i=u.Sb||null,this.h=u.ab||!1}d($d,It),$d.prototype.g=function(){return new $u(this.i,this.h)};function $u(u,p){J.call(this),this.H=u,this.o=p,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}d($u,J),t=$u.prototype,t.open=function(u,p){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=u,this.D=p,this.readyState=1,Wa(this)},t.send=function(u){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const p={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};u&&(p.body=u),(this.H||o).fetch(new Request(this.D,p)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,Ga(this)),this.readyState=0},t.Pa=function(u){if(this.g&&(this.l=u,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=u.headers,this.readyState=2,Wa(this)),this.g&&(this.readyState=3,Wa(this),this.g)))if(this.responseType==="arraybuffer")u.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in u){if(this.j=u.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;q_(this)}else u.text().then(this.Oa.bind(this),this.ga.bind(this))};function q_(u){u.j.read().then(u.Ma.bind(u)).catch(u.ga.bind(u))}t.Ma=function(u){if(this.g){if(this.o&&u.value)this.response.push(u.value);else if(!this.o){var p=u.value?u.value:new Uint8Array(0);(p=this.B.decode(p,{stream:!u.done}))&&(this.response=this.responseText+=p)}u.done?Ga(this):Wa(this),this.readyState==3&&q_(this)}},t.Oa=function(u){this.g&&(this.response=this.responseText=u,Ga(this))},t.Na=function(u){this.g&&(this.response=u,Ga(this))},t.ga=function(){this.g&&Ga(this)};function Ga(u){u.readyState=4,u.l=null,u.j=null,u.B=null,Wa(u)}t.setRequestHeader=function(u,p){this.A.append(u,p)},t.getResponseHeader=function(u){return this.h&&this.h.get(u.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const u=[],p=this.h.entries();for(var g=p.next();!g.done;)g=g.value,u.push(g[0]+": "+g[1]),g=p.next();return u.join(`\r
23`)};function Wa(u){u.onreadystatechange&&u.onreadystatechange.call(u)}Object.defineProperty($u.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(u){this.m=u?"include":"same-origin"}});function H_(u){let p="";return Ge(u,function(g,w){p+=w,p+=":",p+=g,p+=`\r
24`}),p}function qd(u,p,g){e:{for(w in g){var w=!1;break e}w=!0}w||(g=H_(g),typeof u=="string"?g!=null&&Fa(g):Ye(u,p,g))}function ut(u){J.call(this),this.headers=new Map,this.L=u||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}d(ut,J);var EC=/^https?$/i,IC=["POST","PUT"];t=ut.prototype,t.Fa=function(u){this.H=u},t.ea=function(u,p,g,w){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+u);p=p?p.toUpperCase():"GET",this.D=u,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():A_.g(),this.g.onreadystatechange=f(l(this.Ca,this));try{this.B=!0,this.g.open(p,String(u),!0),this.B=!1}catch(B){G_(this,B);return}if(u=g||"",g=new Map(this.headers),w)if(Object.getPrototypeOf(w)===Object.prototype)for(var L in w)g.set(L,w[L]);else if(typeof w.keys=="function"&&typeof w.get=="function")for(const B of w.keys())g.set(B,w.get(B));else throw Error("Unknown input type for opt_headers: "+String(w));w=Array.from(g.keys()).find(B=>B.toLowerCase()=="content-type"),L=o.FormData&&u instanceof o.FormData,!(Array.prototype.indexOf.call(IC,p,void 0)>=0)||w||L||g.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[B,ee]of g)this.g.setRequestHeader(B,ee);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(u),this.v=!1}catch(B){G_(this,B)}};function G_(u,p){u.h=!1,u.g&&(u.j=!0,u.g.abort(),u.j=!1),u.l=p,u.o=5,W_(u),qu(u)}function W_(u){u.A||(u.A=!0,K(u,"complete"),K(u,"error"))}t.abort=function(u){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=u||7,K(this,"complete"),K(this,"abort"),qu(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),qu(this,!0)),ut.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?K_(this):this.Xa())},t.Xa=function(){K_(this)};function K_(u){if(u.h&&typeof i<"u"){if(u.v&&ns(u)==4)setTimeout(u.Ca.bind(u),0);else if(K(u,"readystatechange"),ns(u)==4){u.h=!1;try{const B=u.ca();e:switch(B){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var p=!0;break e;default:p=!1}var g;if(!(g=p)){var w;if(w=B===0){let ee=String(u.D).match(L_)[1]||null;!ee&&o.self&&o.self.location&&(ee=o.self.location.protocol.slice(0,-1)),w=!EC.test(ee?ee.toLowerCase():"")}g=w}if(g)K(u,"complete"),K(u,"success");else{u.o=6;try{var L=ns(u)>2?u.g.statusText:""}catch{L=""}u.l=L+" ["+u.ca()+"]",W_(u)}}finally{qu(u)}}}}function qu(u,p){if(u.g){u.m&&(clearTimeout(u.m),u.m=null);const g=u.g;u.g=null,p||K(u,"ready");try{g.onreadystatechange=null}catch{}}}t.isActive=function(){return!!this.g};function ns(u){return u.g?u.g.readyState:0}t.ca=function(){try{return ns(this)>2?this.g.status:-1}catch{return-1}},t.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.La=function(u){if(this.g){var p=this.g.responseText;return u&&p.indexOf(u)==0&&(p=p.substring(u.length)),De(p)}};function z_(u){try{if(!u.g)return null;if("response"in u.g)return u.g.response;switch(u.F){case"":case"text":return u.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in u.g)return u.g.mozResponseArrayBuffer}return null}catch{return null}}function TC(u){const p={};u=(u.g&&ns(u)>=2&&u.g.getAllResponseHeaders()||"").split(`\r
25`);for(let w=0;w<u.length;w++){if(R(u[w]))continue;var g=iC(u[w]);const L=g[0];if(g=g[1],typeof g!="string")continue;g=g.trim();const B=p[L]||[];p[L]=B,B.push(g)}Wn(p,function(w){return w.join(", ")})}t.ya=function(){return this.o},t.Ha=function(){return typeof this.l=="string"?this.l:String(this.l)};
25function Ka(u,p,g){return g&&g.internalChannelParams&&g.internalChannelParams[u]||p}function Q_(u){this.za=0,this.i=[],this.j=new Ma,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=Ka("failFast",!1,u),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=Ka("baseRetryDelayMs",5e3,u),this.Za=Ka("retryDelaySeedMs",1e4,u),this.Ta=Ka("forwardChannelMaxRetries",2,u),this.va=Ka("forwardChannelRequestTimeoutMs",2e4,u),this.ma=u&&u.xmlHttpFactory||void 0,this.Ua=u&&u.Rb||void 0,this.Aa=u&&u.useFetchStreams||!1,this.O=void 0,this.L=u&&u.supportsCrossDomainXhr||!1,this.M="",this.h=new N_(u&&u.concurrentRequestLimit),this.Ba=new yC,this.S=u&&u.fastHandshake||!1,this.R=u&&u.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=u&&u.Pb||!1,u&&u.ua&&this.j.ua(),u&&u.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&u&&u.detectBufferingProxy||!1,this.ia=void 0,u&&u.longPollingTimeout&&u.longPollingTimeout>0&&(this.ia=u.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}t=Q_.prototype,t.ka=8,t.I=1,t.connect=function(u,p,g,w){Xt(0),this.W=u,this.H=p||{},g&&w!==void 0&&(this.H.OSID=g,this.H.OAID=w),this.F=this.X,this.J=sy(this,null,this.W),Gu(this)};function Hd(u){if(J_(u),u.I==3){var p=u.V++,g=Kn(u.J);if(Ye(g,"SID",u.M),Ye(g,"RID",p),Ye(g,"TYPE","terminate"),za(u,g),p=new Zr(u,u.j,p),p.M=2,p.A=ju(Kn(g)),g=!1,o.navigator&&o.navigator.sendBeacon)try{g=o.navigator.sendBeacon(p.A.toString(),"")}catch{}!g&&o.Image&&(new Image().src=p.A,g=!0),g||(p.g=iy(p.j,null),p.g.ea(p.A)),p.F=Date.now(),Bu(p)}ry(u)}function Hu(u){u.g&&(Wd(u),u.g.cancel(),u.g=null)}function J_(u){Hu(u),u.v&&(o.clearTimeout(u.v),u.v=null),Wu(u),u.h.cancel(),u.m&&(typeof u.m=="number"&&o.clearTimeout(u.m),u.m=null)}function Gu(u){if(!D_(u.h)&&!u.m){u.m=!0;var p=u.Ea;D||T(),M||(D(),M=!0),b.add(p,u),u.D=0}}function wC(u,p){return O_(u.h)>=u.h.j-(u.m?1:0)?!1:u.m?(u.i=p.G.concat(u.i),!0):u.I==1||u.I==2||u.D>=(u.Sa?0:u.Ta)?!1:(u.m=La(l(u.Ea,u,p),ny(u,u.D)),u.D++,!0)}t.Ea=function(u){if(this.m)if(this.m=null,this.I==1){if(!u){this.V=Math.floor(Math.random()*1e5),u=this.V++;const L=new Zr(this,this.j,u);let B=this.o;if(this.U&&(B?(B=yn(B),dr(B,this.U)):B=this.U),this.u!==null||this.R||(L.J=B,B=null),this.S)e:{for(var p=0,g=0;g<this.i.length;g++){t:{var w=this.i[g];if("__data__"in w.map&&(w=w.map.__data__,typeof w=="string")){w=w.length;break t}w=void 0}if(w===void 0)break;if(p+=w,p>4096){p=g;break e}if(p===4096||g===this.i.length-1){p=g+1;break e}}p=1e3}else p=1e3;p=X_(this,L,p),g=Kn(this.J),Ye(g,"RID",u),Ye(g,"CVER",22),this.G&&Ye(g,"X-HTTP-Session-Id",this.G),za(this,g),B&&(this.R?p="headers="+Fa(H_(B))+"&"+p:this.u&&qd(g,this.u,B)),Bd(this.h,L),this.Ra&&Ye(g,"TYPE","init"),this.S?(Ye(g,"$req",p),Ye(g,"SID","null"),L.U=!0,Ld(L,g,null)):Ld(L,g,p),this.I=2}}else this.I==3&&(u?Y_(this,u):this.i.length==0||D_(this.h)||Y_(this))};function Y_(u,p){var g;p?g=p.l:g=u.V++;const w=Kn(u.J);Ye(w,"SID",u.M),Ye(w,"RID",g),Ye(w,"AID",u.K),za(u,w),u.u&&u.o&&qd(w,u.u,u.o),g=new Zr(u,u.j,g,u.D+1),u.u===null&&(g.J=u.o),p&&(u.i=p.G.concat(u.i)),p=X_(u,g,1e3),g.H=Math.round(u.va*.5)+Math.round(u.va*.5*Math.random()),Bd(u.h,g),Ld(g,w,p)}function za(u,p){u.H&&Ge(u.H,function(g,w){Ye(p,w,g)}),u.l&&Ge({},function(g,w){Ye(p,w,g)})}function X_(u,p,g){g=Math.min(u.i.length,g);const w=u.l?l(u.l.Ka,u.l,u):null;e:{var L=u.i;let we=-1;for(;;){const wt=["count="+g];we==-1?g>0?(we=L[0].g,wt.push("ofs="+we)):we=0:wt.push("ofs="+we);let Ke=!0;for(let Ct=0;Ct<g;Ct++){var B=L[Ct].g;const zn=L[Ct].map;if(B-=we,B<0)we=Math.max(0,L[Ct].g-100),Ke=!1;else try{B="req"+B+"_"||"";try{var ee=zn instanceof Map?zn:Object.entries(zn);for(const[ti,rs]of ee){let ss=rs;a(rs)&&(ss=Ve(rs)),wt.push(B+ti+"="+encodeURIComponent(ss))}}catch(ti){throw wt.push(B+"type="+encodeURIComponent("_badmap")),ti}}catch{w&&w(zn)}}if(Ke){ee=wt.join("&");break e}}ee=void 0}return u=u.i.splice(0,g),p.G=u,ee}function Z_(u){if(!u.g&&!u.v){u.Y=1;var p=u.Da;D||T(),M||(D(),M=!0),b.add(p,u),u.A=0}}function Gd(u){return u.g||u.v||u.A>=3?!1:(u.Y++,u.v=La(l(u.Da,u),ny(u,u.A)),u.A++,!0)}
vendor: 5,879 bytes, line 25
25t.Da=function(){if(this.v=null,ey(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var u=4*this.T;this.j.info("BP detection timer enabled: "+u),this.B=La(l(this.Wa,this),u)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,Xt(10),Hu(this),ey(this))};function Wd(u){u.B!=null&&(o.clearTimeout(u.B),u.B=null)}function ey(u){u.g=new Zr(u,u.j,"rpc",u.Y),u.u===null&&(u.g.J=u.o),u.g.P=0;var p=Kn(u.na);Ye(p,"RID","rpc"),Ye(p,"SID",u.M),Ye(p,"AID",u.K),Ye(p,"CI",u.F?"0":"1"),!u.F&&u.ia&&Ye(p,"TO",u.ia),Ye(p,"TYPE","xmlhttp"),za(u,p),u.u&&u.o&&qd(p,u.u,u.o),u.O&&(u.g.H=u.O);var g=u.g;u=u.ba,g.M=1,g.A=ju(Kn(p)),g.u=null,g.R=!0,P_(g,u)}t.Va=function(){this.C!=null&&(this.C=null,Hu(this),Gd(this),Xt(19))};function Wu(u){u.C!=null&&(o.clearTimeout(u.C),u.C=null)}function ty(u,p){var g=null;if(u.g==p){Wu(u),Wd(u),u.g=null;var w=2}else if(Ud(u.h,p))g=p.G,x_(u.h,p),w=1;else return;if(u.I!=0){if(p.o)if(w==1){g=p.u?p.u.length:0,p=Date.now()-p.F;var L=u.D;w=Ys(),K(w,new v_(w,g)),Gu(u)}else Z_(u);else if(L=p.m,L==3||L==0&&p.X>0||!(w==1&&wC(u,p)||w==2&&Gd(u)))switch(g&&g.length>0&&(p=u.h,p.i=p.i.concat(g)),L){case 1:ei(u,5);break;case 4:ei(u,10);break;case 3:ei(u,6);break;default:ei(u,2)}}}function ny(u,p){let g=u.Qa+Math.floor(Math.random()*u.Za);return u.isActive()||(g*=2),g*p}function ei(u,p){if(u.j.info("Error code "+p),p==2){var g=l(u.bb,u),w=u.Ua;const L=!w;w=new es(w||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||Ba(w,"https"),ju(w),L?gC(w.toString(),g):_C(w.toString(),g)}else Xt(2);u.I=0,u.l&&u.l.pa(p),ry(u),J_(u)}t.bb=function(u){u?(this.j.info("Successfully pinged google.com"),Xt(2)):(this.j.info("Failed to ping google.com"),Xt(1))};function ry(u){if(u.I=0,u.ja=[],u.l){const p=V_(u.h);(p.length!=0||u.i.length!=0)&&(_(u.ja,p),_(u.ja,u.i),u.h.i.length=0,m(u.i),u.i.length=0),u.l.oa()}}function sy(u,p,g){var w=g instanceof es?Kn(g):new es(g);if(w.g!="")p&&(w.g=p+"."+w.g),ja(w,w.u);else{var L=o.location;w=L.protocol,p=p?p+"."+L.hostname:L.hostname,L=+L.port;const B=new es(null);w&&Ba(B,w),p&&(B.g=p),L&&ja(B,L),g&&(B.h=g),w=B}return g=u.G,p=u.wa,g&&p&&Ye(w,g,p),Ye(w,"VER",u.ka),za(u,w),w}function iy(u,p,g){if(p&&!u.L)throw Error("Can't create secondary domain capable XhrIo object.");return p=u.Aa&&!u.ma?new ut(new $d({ab:g})):new ut(u.ma),p.Fa(u.L),p}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function oy(){}t=oy.prototype,t.ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){};function Ku(){}Ku.prototype.g=function(u,p){return new In(u,p)};function In(u,p){J.call(this),this.g=new Q_(p),this.l=u,this.h=p&&p.messageUrlParams||null,u=p&&p.messageHeaders||null,p&&p.clientProtocolHeaderRequired&&(u?u["X-Client-Protocol"]="webchannel":u={"X-Client-Protocol":"webchannel"}),this.g.o=u,u=p&&p.initMessageHeaders||null,p&&p.messageContentType&&(u?u["X-WebChannel-Content-Type"]=p.messageContentType:u={"X-WebChannel-Content-Type":p.messageContentType}),p&&p.sa&&(u?u["X-WebChannel-Client-Profile"]=p.sa:u={"X-WebChannel-Client-Profile":p.sa}),this.g.U=u,(u=p&&p.Qb)&&!R(u)&&(this.g.u=u),this.A=p&&p.supportsCrossDomainXhr||!1,this.v=p&&p.sendRawJson||!1,(p=p&&p.httpSessionIdParam)&&!R(p)&&(this.g.G=p,u=this.h,u!==null&&p in u&&(u=this.h,p in u&&delete u[p])),this.j=new ro(this)}d(In,J),In.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},In.prototype.close=function(){Hd(this.g)},In.prototype.o=function(u){var p=this.g;if(typeof u=="string"){var g={};g.__data__=u,u=g}else this.v&&(g={},g.__data__=Ve(u),u=g);p.i.push(new cC(p.Ya++,u)),p.I==3&&Gu(p)},In.prototype.N=function(){this.g.l=null,delete this.j,Hd(this.g),delete this.g,In.Z.N.call(this)};function ay(u){fr.call(this),u.__headers__&&(this.headers=u.__headers__,this.statusCode=u.__status__,delete u.__headers__,delete u.__status__);var p=u.__sm__;if(p){e:{for(const g in p){u=g;break e}u=void 0}(this.i=u)&&(u=this.i,p=p!==null&&u in p?p[u]:void 0),this.data=p}else this.data=u}d(ay,fr);function cy(){eo.call(this),this.status=1}d(cy,eo);function ro(u){this.g=u}d(ro,oy),ro.prototype.ra=function(){K(this.g,"a")},ro.prototype.qa=function(u){K(this.g,new ay(u))},ro.prototype.pa=function(u){K(this.g,new cy)},ro.prototype.oa=function(){K(this.g,"b")},Ku.prototype.createWebChannel=Ku.prototype.g,In.prototype.send=In.prototype.o,In.prototype.open=In.prototype.m,In.prototype.close=In.prototype.close,zb=function(){return new Ku},Kb=function(){return Ys()},Wb=dt,Sp={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Uu.NO_ERROR=0,Uu.TIMEOUT=8,Uu.HTTP_ERROR=6,Sl=Uu,b_.COMPLETE="complete",Gb=b_,an.EventType=Tt,Tt.OPEN="a",Tt.CLOSE="b",Tt.ERROR="c",Tt.MESSAGE="d",J.prototype.listen=J.prototype.J,lc=an,ut.prototype.listenOnce=ut.prototype.K,ut.prototype.getLastError=ut.prototype.Ha,ut.prototype.getLastErrorCode=ut.prototype.ya,ut.prototype.getStatus=ut.prototype.ca,ut.prototype.getResponseJson=ut.prototype.La,ut.prototype.getResponseText=ut.prototype.la,ut.prototype.send=ut.prototype.ea,ut.prototype.setWithCredentials=ut.prototype.Fa,Hb=ut}).apply(typeof ol<"u"?ol:typeof self<"u"?self:typeof window<"u"?window:{});const QE="@firebase/firestore",JE="4.9.2";class Nt{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Nt.UNAUTHENTICATED=new Nt(null),Nt.GOOGLE_CREDENTIALS=new Nt("google-credentials-uid"),Nt.FIRST_PARTY=new Nt("first-party-uid"),Nt.MOCK_USER=new Nt("mock-user");let ya="12.3.0";const xs=new Km("@firebase/firestore");function _o(){return xs.logLevel}function bL(t){xs.setLogLevel(t)}
25function H(t,...e){if(xs.logLevel<=Se.DEBUG){const n=e.map(Qm);xs.debug(`Firestore (${ya}): ${t}`,...n)}}function ft(t,...e){if(xs.logLevel<=Se.ERROR){const n=e.map(Qm);xs.error(`Firestore (${ya}): ${t}`,...n)}}function vn(t,...e){if(xs.logLevel<=Se.WARN){const n=e.map(Qm);xs.warn(`Firestore (${ya}): ${t}`,...n)}}function Qm(t){if(typeof t=="string")return t;try{return(function(n){return JSON.stringify(n)})(t)}catch{return t}}function re(t,e,n){let r="Unexpected state";typeof e=="string"?r=e:n=e,Qb(t,r,n)}function Qb(t,e,n){let r=`FIRESTORE (${ya}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(n!==void 0)try{r+=" CONTEXT: "+JSON.stringify(n)}catch{r+=" CONTEXT: "+n}throw ft(r),new Error(r)}function ce(t,e,n,r){let s="Unexpected state";typeof n=="string"?s=n:r=n,t||Qb(e,s,r)}function AL(t,e){t||re(57014,e)}function Z(t,e){return t}const F={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class $ extends Gn{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class xt{constructor(){this.promise=new Promise(((e,n)=>{this.resolve=e,this.reject=n}))}}class Jb{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Yb{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable((()=>n(Nt.UNAUTHENTICATED)))}shutdown(){}}class RL{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable((()=>n(this.token.user)))}shutdown(){this.changeListener=null}}class SL{constructor(e){this.t=e,this.currentUser=Nt.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){ce(this.o===void 0,42304);let r=this.i;const s=c=>this.i!==r?(r=this.i,n(c)):Promise.resolve();let i=new xt;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new xt,e.enqueueRetryable((()=>s(this.currentUser)))};const o=()=>{const c=i;e.enqueueRetryable((async()=>{await c.promise,await s(this.currentUser)}))},a=c=>{H("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit((c=>a(c))),setTimeout((()=>{if(!this.auth){const c=this.t.getImmediate({optional:!0});c?a(c):(H("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new xt)}}),0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((r=>this.i!==e?(H("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(ce(typeof r.accessToken=="string",31837,{l:r}),new Jb(r.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return ce(e===null||typeof e=="string",2055,{h:e}),new Nt(e)}}class PL{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=Nt.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class CL{constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new PL(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable((()=>n(Nt.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class Pp{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class kL{constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,Ze(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){ce(this.o===void 0,3512);const r=i=>{i.error!=null&&H("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${i.error.message}`);const o=i.token!==this.m;return this.m=i.token,H("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(i.token):Promise.resolve()};this.o=i=>{e.enqueueRetryable((()=>r(i)))};const s=i=>{H("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=i,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit((i=>s(i))),setTimeout((()=>
25{if(!this.appCheck){const i=this.V.getImmediate({optional:!0});i?s(i):H("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){if(this.p)return Promise.resolve(new Pp(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then((n=>n?(ce(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new Pp(n.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}class NL{getToken(){return Promise.resolve(new Pp(""))}invalidateToken(){}start(e,n){}shutdown(){}}function DL(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}class Yh{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=62*Math.floor(4.129032258064516);let r="";for(;r.length<20;){const s=DL(40);for(let i=0;i<s.length;++i)r.length<20&&s[i]<n&&(r+=e.charAt(s[i]%62))}return r}}function _e(t,e){return t<e?-1:t>e?1:0}function Cp(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++){const s=t.charAt(r),i=e.charAt(r);if(s!==i)return vf(s)===vf(i)?_e(s,i):vf(s)?1:-1}return _e(t.length,e.length)}const OL=55296,xL=57343;function vf(t){const e=t.charCodeAt(0);return e>=OL&&e<=xL}function jo(t,e,n){return t.length===e.length&&t.every(((r,s)=>n(r,e[s])))}function Xb(t){return t+"\0"}const kp="__name__";class Xn{constructor(e,n,r){n===void 0?n=0:n>e.length&&re(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&re(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return Xn.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof Xn?e.forEach((r=>{n.push(r)})):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}forEach(e){for(let n=this.offset,r=this.limit();n<r;n++)e(this.segments[n])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,n){const r=Math.min(e.length,n.length);for(let s=0;s<r;s++){const i=Xn.compareSegments(e.get(s),n.get(s));if(i!==0)return i}return _e(e.length,n.length)}static compareSegments(e,n){const r=Xn.isNumericId(e),s=Xn.isNumericId(n);return r&&!s?-1:!r&&s?1:r&&s?Xn.extractNumericId(e).compare(Xn.extractNumericId(n)):Cp(e,n)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Ps.fromString(e.substring(4,e.length-2))}}class be extends Xn{construct(e,n,r){return new be(e,n,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const n=[];for(const r of e){if(r.indexOf("//")>=0)throw new $(F.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter((s=>s.length>0)))}return new be(n)}static emptyPath(){return new be([])}}const VL=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class et extends Xn{construct(e,n,r){return new et(e,n,r)}static isValidIdentifier(e){return VL.test(e)}canonicalString(){return this.toArray().map((e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),et.isValidIdentifier(e)||(e="`"+e+"`"),e))).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===kp}static keyField(){return new et([kp])}static fromServerFormat(e){const n=[];let r="",s=0;const i=()=>
25{if(r.length===0)throw new $(F.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;s<e.length;){const a=e[s];if(a==="\\"){if(s+1===e.length)throw new $(F.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const c=e[s+1];if(c!=="\\"&&c!=="."&&c!=="`")throw new $(F.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=c,s+=2}else a==="`"?(o=!o,s++):a!=="."||o?(r+=a,s++):(i(),s++)}if(i(),o)throw new $(F.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new et(n)}static emptyPath(){return new et([])}}class X{constructor(e){this.path=e}static fromPath(e){return new X(be.fromString(e))}static fromName(e){return new X(be.fromString(e).popFirst(5))}static empty(){return new X(be.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&be.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return be.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new X(new be(e.slice()))}}function Jm(t,e,n){if(!n)throw new $(F.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function Zb(t,e,n,r){if(e===!0&&r===!0)throw new $(F.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function YE(t){if(!X.isDocumentKey(t))throw new $(F.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function XE(t){if(X.isDocumentKey(t))throw new $(F.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function eA(t){return typeof t=="object"&&t!==null&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function Xh(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=(function(r){return r.constructor?r.constructor.name:null})(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":re(12329,{type:typeof t})}function Ae(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new $(F.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Xh(t);throw new $(F.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function tA(t,e){if(e<=0)throw new $(F.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)}function Et(t,e){const n={typeString:t};return e&&(n.value=e),n}function zi(t,e){if(!eA(t))throw new $(F.INVALID_ARGUMENT,"JSON must be an object");let n;for(const r in e)if(e[r]){const s=e[r].typeString,i="value"in e[r]?{value:e[r].value}:void 0;if(!(r in t)){n=`JSON missing required field: '${r}'`;break}const o=t[r];if(s&&typeof o!==s){n=`JSON field '${r}' must be a ${s}.`;break}if(i!==void 0&&o!==i.value){n=`Expected '${r}' field to equal '${i.value}'`;break}}if(n)throw new $(F.INVALID_ARGUMENT,n);return!0}const ZE=-62135596800,eI=1e6;class Fe{static now(){return Fe.fromMillis(Date.now())}static fromDate(e){return Fe.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*eI);return new Fe(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new $(F.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new $(F.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e<ZE)throw new $(F.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new $(F.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/eI}_compareTo(e){return this.seconds===e.seconds?_e(this.nanoseconds,e.nanoseconds):_e(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Fe._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(zi(e,Fe._jsonSchema))return new Fe(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-ZE;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
25}Fe._jsonSchemaVersion="firestore/timestamp/1.0",Fe._jsonSchema={type:Et("string",Fe._jsonSchemaVersion),seconds:Et("number"),nanoseconds:Et("number")};class he{static fromTimestamp(e){return new he(e)}static min(){return new he(new Fe(0,0))}static max(){return new he(new Fe(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}const $o=-1;class qo{constructor(e,n,r,s){this.indexId=e,this.collectionGroup=n,this.fields=r,this.indexState=s}}function Np(t){return t.fields.find((e=>e.kind===2))}function li(t){return t.fields.filter((e=>e.kind!==2))}function LL(t,e){let n=_e(t.collectionGroup,e.collectionGroup);if(n!==0)return n;for(let r=0;r<Math.min(t.fields.length,e.fields.length);++r)if(n=ML(t.fields[r],e.fields[r]),n!==0)return n;return _e(t.fields.length,e.fields.length)}qo.UNKNOWN_ID=-1;class Ri{constructor(e,n){this.fieldPath=e,this.kind=n}}function ML(t,e){const n=et.comparator(t.fieldPath,e.fieldPath);return n!==0?n:_e(t.kind,e.kind)}class Ho{constructor(e,n){this.sequenceNumber=e,this.offset=n}static empty(){return new Ho(0,bn.min())}}function nA(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,s=he.fromTimestamp(r===1e9?new Fe(n+1,0):new Fe(n,r));return new bn(s,X.empty(),e)}function rA(t){return new bn(t.readTime,t.key,$o)}class bn{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new bn(he.min(),X.empty(),$o)}static max(){return new bn(he.max(),X.empty(),$o)}}function Ym(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=X.comparator(t.documentKey,e.documentKey),n!==0?n:_e(t.largestBatchId,e.largestBatchId))}const sA="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class iA{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}async function $s(t){if(t.code!==F.FAILED_PRECONDITION||t.message!==sA)throw t;H("LocalStore","Unexpectedly lost primary lease")}class V{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)}),(n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)}))}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&re(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new V(((r,s)=>{this.nextCallback=i=>{this.wrapSuccess(e,i).next(r,s)},this.catchCallback=i=>{this.wrapFailure(n,i).next(r,s)}}))}toPromise(){return new Promise(((e,n)=>{this.next(e,n)}))}wrapUserFunction(e){try{const n=e();return n instanceof V?n:V.resolve(n)}catch(n){return V.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction((()=>e(n))):V.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction((()=>e(n))):V.reject(n)}static resolve(e){return new V(((n,r)=>{n(e)}))}static reject(e){return new V(((n,r)=>{r(e)}))}static waitFor(e){return new V(((n,r)=>{let s=0,i=0,o=!1;e.forEach((a=>{++s,a.next((()=>{++i,o&&i===s&&n()}),(c=>r(c)))})),o=!0,i===s&&n()}))}static or(e){let n=V.resolve(!1);for(const r of e)n=n.next((s=>s?V.resolve(s):r()));return n}static forEach(e,n){const r=[];return e.forEach(((s,i)=>{r.push(n.call(this,s,i))})),this.waitFor(r)}static mapArray(e,n){return new V(((r,s)=>{const i=e.length,o=new Array(i);let a=0;for(let c=0;c<i;c++){const l=c;n(e[l]).next((h=>{o[l]=h,++a,a===i&&r(o)}),(h=>s(h)))}}))}static doWhile(e,n){return new V(((r,s)=>{const i=()=>{e()===!0?n().next((()=>{i()}),s):r()};i()}))}}const Tn="SimpleDb";class Zh{static open(e,n,r,s){try{return new Zh(n,e.transaction(s,r))}catch(i){throw new Ac(n,i)}}constructor(e,n){this.action=e,this.transaction=n,this.aborted=!1,this.S=new xt,this.transaction.oncomplete=()=>{this.S.resolve()},this.transaction.onabort=()=>{n.error?this.S.reject(new Ac(e,n.error)):this.S.resolve()},this.transaction.onerror=r=>{const s=Xm(r.target.error);
25this.S.reject(new Ac(e,s))}}get D(){return this.S.promise}abort(e){e&&this.S.reject(e),this.aborted||(H(Tn,"Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}C(){const e=this.transaction;this.aborted||typeof e.commit!="function"||e.commit()}store(e){const n=this.transaction.objectStore(e);return new UL(n)}}class ir{static delete(e){return H(Tn,"Removing database:",e),fi(kb().indexedDB.deleteDatabase(e)).toPromise()}static v(){if(!Fb())return!1;if(ir.F())return!0;const e=At(),n=ir.M(e),r=0<n&&n<10,s=oA(e),i=0<s&&s<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||i)}static F(){return typeof process<"u"&&process.__PRIVATE_env?.__PRIVATE_USE_MOCK_PERSISTENCE==="YES"}static O(e,n){return e.store(n)}static M(e){const n=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),r=n?n[1].split("_").slice(0,2).join("."):"-1";return Number(r)}constructor(e,n,r){this.name=e,this.version=n,this.N=r,this.B=null,ir.M(At())===12.2&&ft("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}async L(e){return this.db||(H(Tn,"Opening database:",this.name),this.db=await new Promise(((n,r)=>{const s=indexedDB.open(this.name,this.version);s.onsuccess=i=>{const o=i.target.result;n(o)},s.onblocked=()=>{r(new Ac(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},s.onerror=i=>{const o=i.target.error;o.name==="VersionError"?r(new $(F.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):o.name==="InvalidStateError"?r(new $(F.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+o)):r(new Ac(e,o))},s.onupgradeneeded=i=>{H(Tn,'Database "'+this.name+'" requires upgrade from version:',i.oldVersion);const o=i.target.result;this.N.k(o,s.transaction,i.oldVersion,this.version).next((()=>{H(Tn,"Database upgrade to version "+this.version+" complete")}))}}))),this.q&&(this.db.onversionchange=n=>this.q(n)),this.db}$(e){this.q=e,this.db&&(this.db.onversionchange=n=>e(n))}async runTransaction(e,n,r,s){const i=n==="readonly";let o=0;for(;;){++o;try{this.db=await this.L(e);const a=Zh.open(this.db,e,i?"readonly":"readwrite",r),c=s(a).next((l=>(a.C(),l))).catch((l=>(a.abort(l),V.reject(l)))).toPromise();return c.catch((()=>{})),await a.D,c}catch(a){const c=a,l=c.name!=="FirebaseError"&&o<3;if(H(Tn,"Transaction failed with error:",c.message,"Retrying:",l),this.close(),!l)return Promise.reject(c)}}}close(){this.db&&this.db.close(),this.db=void 0}}function oA(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}class FL{constructor(e){this.U=e,this.K=!1,this.W=null}get isDone(){return this.K}get G(){return this.W}set cursor(e){this.U=e}done(){this.K=!0}j(e){this.W=e}delete(){return fi(this.U.delete())}}class Ac extends ${constructor(e,n){super(F.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${n}`),this.name="IndexedDbTransactionError"}}function qs(t){return t.name==="IndexedDbTransactionError"}class UL{constructor(e){this.store=e}put(e,n){let r;return n!==void 0?(H(Tn,"PUT",this.store.name,e,n),r=this.store.put(n,e)):(H(Tn,"PUT",this.store.name,"<auto-key>",e),r=this.store.put(e)),fi(r)}add(e){return H(Tn,"ADD",this.store.name,e,e),fi(this.store.add(e))}get(e){return fi(this.store.get(e)).next((n=>(n===void 0&&(n=null),H(Tn,"GET",this.store.name,e,n),n)))}delete(e){return H(Tn,"DELETE",this.store.name,e),fi(this.store.delete(e))}count(){return H(Tn,"COUNT",this.store.name),fi(this.store.count())}J(e,n){const r=this.options(e,n),s=r.index?this.store.index(r.index):this.store;if(typeof s.getAll=="function"){const i=s.getAll(r.range);return new V(((o,a)=>{i.onerror=c=>{a(c.target.error)},i.onsuccess=c=>{o(c.target.result)}}))}{const i=this.cursor(r),o=[];return this.H(i,((a,c)=>{o.push(c)})).next((()=>o))}}Y(e,n){const r=this.store.getAll(e,n===null?void 0:n);return new V(((s,i)=>{r.onerror=o=>{i(o.target.error)},r.onsuccess=o=>{s(o.target.result)}}))}
25Z(e,n){H(Tn,"DELETE ALL",this.store.name);const r=this.options(e,n);r.X=!1;const s=this.cursor(r);return this.H(s,((i,o,a)=>a.delete()))}ee(e,n){let r;n?r=e:(r={},n=e);const s=this.cursor(r);return this.H(s,n)}te(e){const n=this.cursor({});return new V(((r,s)=>{n.onerror=i=>{const o=Xm(i.target.error);s(o)},n.onsuccess=i=>{const o=i.target.result;o?e(o.primaryKey,o.value).next((a=>{a?o.continue():r()})):r()}}))}H(e,n){const r=[];return new V(((s,i)=>{e.onerror=o=>{i(o.target.error)},e.onsuccess=o=>{const a=o.target.result;if(!a)return void s();const c=new FL(a),l=n(a.primaryKey,a.value,c);if(l instanceof V){const h=l.catch((d=>(c.done(),V.reject(d))));r.push(h)}c.isDone?s():c.G===null?a.continue():a.continue(c.G)}})).next((()=>V.waitFor(r)))}options(e,n){let r;return e!==void 0&&(typeof e=="string"?r=e:n=e),{index:r,range:n}}cursor(e){let n="next";if(e.reverse&&(n="prev"),e.index){const r=this.store.index(e.index);return e.X?r.openKeyCursor(e.range,n):r.openCursor(e.range,n)}return this.store.openCursor(e.range,n)}}function fi(t){return new V(((e,n)=>{t.onsuccess=r=>{const s=r.target.result;e(s)},t.onerror=r=>{const s=Xm(r.target.error);n(s)}}))}let tI=!1;function Xm(t){const e=ir.M(At());if(e>=12.2&&e<13){const n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){const r=new $("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${n}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return tI||(tI=!0,setTimeout((()=>{throw r}),0)),r}}return t}const Rc="IndexBackfiller";class BL{constructor(e,n){this.asyncQueue=e,this.ne=n,this.task=null}start(){this.re(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return this.task!==null}re(e){H(Rc,`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,(async()=>{this.task=null;try{const n=await this.ne.ie();H(Rc,`Documents written: ${n}`)}catch(n){qs(n)?H(Rc,"Ignoring IndexedDB error during index backfill: ",n):await $s(n)}await this.re(6e4)}))}}class jL{constructor(e,n){this.localStore=e,this.persistence=n}async ie(e=50){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",(n=>this.se(n,e)))}se(e,n){const r=new Set;let s=n,i=!0;return V.doWhile((()=>i===!0&&s>0),(()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next((o=>{if(o!==null&&!r.has(o))return H(Rc,`Processing collection: ${o}`),this.oe(e,o,s).next((a=>{s-=a,r.add(o)}));i=!1})))).next((()=>n-s))}oe(e,n,r){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,n).next((s=>this.localStore.localDocuments.getNextDocuments(e,n,s,r).next((i=>{const o=i.changes;return this.localStore.indexManager.updateIndexEntries(e,o).next((()=>this._e(s,i))).next((a=>(H(Rc,`Updating offset: ${a}`),this.localStore.indexManager.updateCollectionGroup(e,n,a)))).next((()=>o.size))}))))}_e(e,n){let r=e;
vendor: 8,318 bytes, line 25
25return n.changes.forEach(((s,i)=>{const o=rA(i);Ym(o,r)>0&&(r=o)})),new bn(r.readTime,r.documentKey,Math.max(n.batchId,e.largestBatchId))}}class hn{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ae(r),this.ue=r=>n.writeSequenceNumber(r))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}hn.ce=-1;const Cs=-1;function Tu(t){return t==null}function Qc(t){return t===0&&1/t==-1/0}function aA(t){return typeof t=="number"&&Number.isInteger(t)&&!Qc(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}const lh="�";function Jt(t){let e="";for(let n=0;n<t.length;n++)e.length>0&&(e=nI(e)),e=$L(t.get(n),e);return nI(e)}function $L(t,e){let n=e;const r=t.length;for(let s=0;s<r;s++){const i=t.charAt(s);switch(i){case"\0":n+="��";break;case lh:n+="��";break;default:n+=i}}return n}function nI(t){return t+lh+"�"}function tr(t){const e=t.length;if(ce(e>=2,64408,{path:t}),e===2)return ce(t.charAt(0)===lh&&t.charAt(1)==="�",56145,{path:t}),be.emptyPath();const n=e-2,r=[];let s="";for(let i=0;i<e;){const o=t.indexOf(lh,i);switch((o<0||o>n)&&re(50515,{path:t}),t.charAt(o+1)){case"�":const a=t.substring(i,o);let c;s.length===0?c=a:(s+=a,c=s,s=""),r.push(c);break;case"�":s+=t.substring(i,o),s+="\0";break;case"�":s+=t.substring(i,o+1);break;default:re(61167,{path:t})}i=o+2}return new be(r)}const hi="remoteDocuments",wu="owner",co="owner",Jc="mutationQueues",qL="userId",xn="mutations",rI="batchId",Ei="userMutationsIndex",sI=["userId","batchId"];function Pl(t,e){return[t,Jt(e)]}function cA(t,e,n){return[t,Jt(e),n]}const HL={},Go="documentMutations",hh="remoteDocumentsV14",GL=["prefixPath","collectionGroup","readTime","documentId"],Cl="documentKeyIndex",WL=["prefixPath","collectionGroup","documentId"],uA="collectionGroupIndex",KL=["collectionGroup","readTime","prefixPath","documentId"],Yc="remoteDocumentGlobal",Dp="remoteDocumentGlobalKey",Wo="targets",lA="queryTargetsIndex",zL=["canonicalId","targetId"],Ko="targetDocuments",QL=["targetId","path"],Zm="documentTargetsIndex",JL=["path","targetId"],dh="targetGlobalKey",Si="targetGlobal",Xc="collectionParents",YL=["collectionId","parent"],zo="clientMetadata",XL="clientId",ed="bundles",ZL="bundleId",td="namedQueries",eM="name",eg="indexConfiguration",tM="indexId",Op="collectionGroupIndex",nM="collectionGroup",Sc="indexState",rM=["indexId","uid"],hA="sequenceNumberIndex",sM=["uid","sequenceNumber"],Pc="indexEntries",iM=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],dA="documentKeyIndex",oM=["indexId","uid","orderedDocumentKey"],nd="documentOverlays",aM=["userId","collectionPath","documentId"],xp="collectionPathOverlayIndex",cM=["userId","collectionPath","largestBatchId"],fA="collectionGroupOverlayIndex",uM=["userId","collectionGroup","largestBatchId"],tg="globals",lM="name",pA=[Jc,xn,Go,hi,Wo,wu,Si,Ko,zo,Yc,Xc,ed,td],hM=[...pA,nd],mA=[Jc,xn,Go,hh,Wo,wu,Si,Ko,zo,Yc,Xc,ed,td,nd],gA=mA,ng=[...gA,eg,Sc,Pc],dM=ng,_A=[...ng,tg],fM=_A;class Vp extends iA{constructor(e,n){super(),this.le=e,this.currentSequenceNumber=n}}function Pt(t,e){const n=Z(t);return ir.O(n.le,e)}function iI(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Hs(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function yA(t,e){const n=[];for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.push(e(t[r],r,t));return n}function EA(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}class Je{constructor(e,n){this.comparator=e,this.root=n||Ft.EMPTY}insert(e,n){return new Je(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,Ft.BLACK,null,null))}remove(e){return new Je(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Ft.BLACK,null,null))}get(e){let n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(r===0)return n.value;r<0?n=n.left:r>0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const s=this.comparator(e,r.key);if(s===0)return n+r.left.size;s<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal(((n,r)=>(e(n,r),!1)))}toString(){const e=[];return this.inorderTraversal(((n,r)=>(e.push(`${n}:${r}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new al(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new al(this.root,e,this.comparator,!1)}getReverseIterator(){return new al(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new al(this.root,e,this.comparator,!0)}}class al{constructor(e,n,r,s){this.isReverse=s,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=n?r(e.key,n):1,n&&s&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(i===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Ft{constructor(e,n,r,s,i){this.key=e,this.value=n,this.color=r??Ft.RED,this.left=s??Ft.EMPTY,this.right=i??Ft.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,s,i){return new Ft(e??this.key,n??this.value,r??this.color,s??this.left,i??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let s=this;const i=r(e,s.key);return s=i<0?s.copy(null,null,null,s.left.insert(e,n,r),null):i===0?s.copy(null,n,null,null,null):s.copy(null,null,null,null,s.right.insert(e,n,r)),s.fixUp()}removeMin(){if(this.left.isEmpty())return Ft.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,s=this;if(n(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,n),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),n(e,s.key)===0){if(s.right.isEmpty())return Ft.EMPTY;r=s.right.min(),s=s.copy(r.key,r.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,n))}return s.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Ft.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Ft.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw re(43730,{key:this.key,value:this.value});if(this.right.isRed())throw re(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw re(27949);return e+(this.isRed()?0:1)}}Ft.EMPTY=null,Ft.RED=!0,Ft.BLACK=!1;
25Ft.EMPTY=new class{constructor(){this.size=0}get key(){throw re(57766)}get value(){throw re(16141)}get color(){throw re(16727)}get left(){throw re(29726)}get right(){throw re(36894)}copy(e,n,r,s,i){return this}insert(e,n,r){return new Ft(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class $e{constructor(e){this.comparator=e,this.data=new Je(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal(((n,r)=>(e(n),!1)))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const s=r.getNext();if(this.comparator(s.key,e[1])>=0)return;n(s.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new oI(this.data.getIterator())}getIteratorFrom(e){return new oI(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size<e.size&&(n=e,e=this),e.forEach((r=>{n=n.add(r)})),n}isEqual(e){if(!(e instanceof $e)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const s=n.getNext().key,i=r.getNext().key;if(this.comparator(s,i)!==0)return!1}return!0}toArray(){const e=[];return this.forEach((n=>{e.push(n)})),e}toString(){const e=[];return this.forEach((n=>e.push(n))),"SortedSet("+e.toString()+")"}copy(e){const n=new $e(this.comparator);return n.data=e,n}}class oI{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function uo(t){return t.hasNext()?t.getNext():void 0}class dn{constructor(e){this.fields=e,e.sort(et.comparator)}static empty(){return new dn([])}unionWith(e){let n=new $e(et.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new dn(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return jo(this.fields,e.fields,((n,r)=>n.isEqual(r)))}}class IA extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}function pM(){return typeof atob<"u"}class ct{constructor(e){this.binaryString=e}static fromBase64String(e){const n=(function(s){try{return atob(s)}catch(i){throw typeof DOMException<"u"&&i instanceof DOMException?new IA("Invalid base64 string: "+i):i}})(e);return new ct(n)}static fromUint8Array(e){const n=(function(s){let i="";for(let o=0;o<s.length;++o)i+=String.fromCharCode(s[o]);return i})(e);return new ct(n)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return(function(n){return btoa(n)})(this.binaryString)}toUint8Array(){return(function(n){const r=new Uint8Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r})(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return _e(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}ct.EMPTY_BYTE_STRING=new ct("");const mM=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Ur(t){if(ce(!!t,39018),typeof t=="string"){let e=0;const n=mM.exec(t);if(ce(!!n,46558,{timestamp:t}),n[1]){let s=n[1];s=(s+"000000000").substr(0,9),e=Number(s)}const r=new Date(t);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:rt(t.seconds),nanos:rt(t.nanos)}}function rt(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function Br(t){return typeof t=="string"?ct.fromBase64String(t):ct.fromUint8Array(t)}const TA="server_timestamp",wA="__type__",vA="__previous_value__",bA="__local_write_time__";function rd(t){return(t?.mapValue?.fields||{})[wA]?.stringValue===TA}function sd(t){const e=t.mapValue.fields[vA];
25return rd(e)?sd(e):e}function Zc(t){const e=Ur(t.mapValue.fields[bA].timestampValue);return new Fe(e.seconds,e.nanos)}class gM{constructor(e,n,r,s,i,o,a,c,l,h){this.databaseId=e,this.appId=n,this.persistenceKey=r,this.host=s,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.longPollingOptions=c,this.useFetchStreams=l,this.isUsingEmulator=h}}const eu="(default)";class Vs{constructor(e,n){this.projectId=e,this.database=n||eu}static empty(){return new Vs("","")}get isDefaultDatabase(){return this.database===eu}isEqual(e){return e instanceof Vs&&e.projectId===this.projectId&&e.database===this.database}}const rg="__type__",AA="__max__",Is={mapValue:{fields:{__type__:{stringValue:AA}}}},sg="__vector__",Qo="value",kl={nullValue:"NULL_VALUE"};function Ls(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?rd(t)?4:RA(t)?9007199254740991:id(t)?10:11:re(28295,{value:t})}function ar(t,e){if(t===e)return!0;const n=Ls(t);if(n!==Ls(e))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return Zc(t).isEqual(Zc(e));case 3:return(function(s,i){if(typeof s.timestampValue=="string"&&typeof i.timestampValue=="string"&&s.timestampValue.length===i.timestampValue.length)return s.timestampValue===i.timestampValue;const o=Ur(s.timestampValue),a=Ur(i.timestampValue);return o.seconds===a.seconds&&o.nanos===a.nanos})(t,e);case 5:return t.stringValue===e.stringValue;case 6:return(function(s,i){return Br(s.bytesValue).isEqual(Br(i.bytesValue))})(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return(function(s,i){return rt(s.geoPointValue.latitude)===rt(i.geoPointValue.latitude)&&rt(s.geoPointValue.longitude)===rt(i.geoPointValue.longitude)})(t,e);case 2:return(function(s,i){if("integerValue"in s&&"integerValue"in i)return rt(s.integerValue)===rt(i.integerValue);if("doubleValue"in s&&"doubleValue"in i){const o=rt(s.doubleValue),a=rt(i.doubleValue);return o===a?Qc(o)===Qc(a):isNaN(o)&&isNaN(a)}return!1})(t,e);case 9:return jo(t.arrayValue.values||[],e.arrayValue.values||[],ar);case 10:case 11:return(function(s,i){const o=s.mapValue.fields||{},a=i.mapValue.fields||{};if(iI(o)!==iI(a))return!1;for(const c in o)if(o.hasOwnProperty(c)&&(a[c]===void 0||!ar(o[c],a[c])))return!1;return!0})(t,e);default:return re(52216,{left:t})}}function tu(t,e){return(t.values||[]).find((n=>ar(n,e)))!==void 0}function Ms(t,e){if(t===e)return 0;const n=Ls(t),r=Ls(e);if(n!==r)return _e(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return _e(t.booleanValue,e.booleanValue);case 2:return(function(i,o){const a=rt(i.integerValue||i.doubleValue),c=rt(o.integerValue||o.doubleValue);return a<c?-1:a>c?1:a===c?0:isNaN(a)?isNaN(c)?0:-1:1})(t,e);case 3:return aI(t.timestampValue,e.timestampValue);case 4:return aI(Zc(t),Zc(e));case 5:return Cp(t.stringValue,e.stringValue);case 6:return(function(i,o){const a=Br(i),c=Br(o);return a.compareTo(c)})(t.bytesValue,e.bytesValue);case 7:return(function(i,o){const a=i.split("/"),c=o.split("/");for(let l=0;l<a.length&&l<c.length;l++){const h=_e(a[l],c[l]);if(h!==0)return h}return _e(a.length,c.length)})(t.referenceValue,e.referenceValue);case 8:return(function(i,o){const a=_e(rt(i.latitude),rt(o.latitude));return a!==0?a:_e(rt(i.longitude),rt(o.longitude))})(t.geoPointValue,e.geoPointValue);case 9:return cI(t.arrayValue,e.arrayValue);case 10:return(function(i,o){const a=i.fields||{},c=o.fields||{},l=a[Qo]?.arrayValue,h=c[Qo]?.arrayValue,d=_e(l?.values?.length||0,h?.values?.length||0);return d!==0?d:cI(l,h)})(t.mapValue,e.mapValue);case 11:return(function(i,o){if(i===Is.mapValue&&o===Is.mapValue)return 0;if(i===Is.mapValue)return 1;if(o===Is.mapValue)return-1;const a=i.fields||{},c=Object.keys(a),l=o.fields||{},h=Object.keys(l);c.sort(),h.sort();for(let d=0;d<c.length&&d<h.length;++d){const f=Cp(c[d],h[d]);if(f!==0)return f;const m=Ms(a[c[d]],l[h[d]]);if(m!==0)return m}return _e(c.length,h.length)})(t.mapValue,e.mapValue);default:throw re(23264,{he:n})}}function aI(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return _e(t,e);const n=Ur(t),r=Ur(e),s=_e(n.seconds,r.seconds);return s!==0?s:_e(n.nanos,r.nanos)}function cI(t,e){const n=t.values||[],r=e.values||[];for(let s=0;s<n.length&&s<r.length;++s){const i=Ms(n[s],r[s]);if(i)return i}return _e(n.length,r.length)}function Jo(t){return Lp(t)}function Lp(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?(function(n){const r=Ur(n);return`time(${r.seconds},${r.nanos})`})(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?(function(n){return Br(n).toBase64()})(t.bytesValue):"referenceValue"in t?(function(n){return X.fromName(n).toString()})(t.referenceValue):"geoPointValue"in t?(function(n){return`geo(${n.latitude},${n.longitude})`})(t.geoPointValue):"arrayValue"in t?(function(n){let r="[",s=!0;for(const i of n.values||[])s?s=!1:r+=",",r+=Lp(i);return r+"]"})(t.arrayValue):"mapValue"in t?(function(n){const r=Object.keys(n.fields||{}).sort();let s="{",i=!0;for(const o of r)i?i=!1:s+=",",s+=`${o}:${Lp(n.fields[o])}`;return s+"}"})(t.mapValue):re(61005,{value:t})}function Nl(t){switch(Ls(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=sd(t);return e?16+Nl(e):16;case 5:return 2*t.stringValue.length;case 6:return Br(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return(function(r){return(r.values||[]).reduce(((s,i)=>s+Nl(i)),0)})(t.arrayValue);case 10:case 11:return(function(r){let s=0;return Hs(r.fields,((i,o)=>{s+=i.length+Nl(o)})),s})(t.mapValue);
vendor: 3,539 bytes, line 25
25default:throw re(13486,{value:t})}}function Vi(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function Mp(t){return!!t&&"integerValue"in t}function nu(t){return!!t&&"arrayValue"in t}function uI(t){return!!t&&"nullValue"in t}function lI(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Dl(t){return!!t&&"mapValue"in t}function id(t){return(t?.mapValue?.fields||{})[rg]?.stringValue===sg}function Cc(t){if(t.geoPointValue)return{geoPointValue:{...t.geoPointValue}};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:{...t.timestampValue}};if(t.mapValue){const e={mapValue:{fields:{}}};return Hs(t.mapValue.fields,((n,r)=>e.mapValue.fields[n]=Cc(r))),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Cc(t.arrayValue.values[n]);return e}return{...t}}function RA(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===AA}const SA={mapValue:{fields:{[rg]:{stringValue:sg},[Qo]:{arrayValue:{}}}}};function _M(t){return"nullValue"in t?kl:"booleanValue"in t?{booleanValue:!1}:"integerValue"in t||"doubleValue"in t?{doubleValue:NaN}:"timestampValue"in t?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in t?{stringValue:""}:"bytesValue"in t?{bytesValue:""}:"referenceValue"in t?Vi(Vs.empty(),X.empty()):"geoPointValue"in t?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in t?{arrayValue:{}}:"mapValue"in t?id(t)?SA:{mapValue:{}}:re(35942,{value:t})}function yM(t){return"nullValue"in t?{booleanValue:!1}:"booleanValue"in t?{doubleValue:NaN}:"integerValue"in t||"doubleValue"in t?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in t?{stringValue:""}:"stringValue"in t?{bytesValue:""}:"bytesValue"in t?Vi(Vs.empty(),X.empty()):"referenceValue"in t?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in t?{arrayValue:{}}:"arrayValue"in t?SA:"mapValue"in t?id(t)?{mapValue:{}}:Is:re(61959,{value:t})}function hI(t,e){const n=Ms(t.value,e.value);return n!==0?n:t.inclusive&&!e.inclusive?-1:!t.inclusive&&e.inclusive?1:0}function dI(t,e){const n=Ms(t.value,e.value);return n!==0?n:t.inclusive&&!e.inclusive?1:!t.inclusive&&e.inclusive?-1:0}class jt{constructor(e){this.value=e}static empty(){return new jt({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r<e.length-1;++r)if(n=(n.mapValue.fields||{})[e.get(r)],!Dl(n))return null;return n=(n.mapValue.fields||{})[e.lastSegment()],n||null}}set(e,n){this.getFieldsMap(e.popLast())[e.lastSegment()]=Cc(n)}setAll(e){let n=et.emptyPath(),r={},s=[];e.forEach(((o,a)=>{if(!n.isImmediateParentOf(a)){const c=this.getFieldsMap(n);this.applyChanges(c,r,s),r={},s=[],n=a.popLast()}o?r[a.lastSegment()]=Cc(o):s.push(a.lastSegment())}));const i=this.getFieldsMap(n);this.applyChanges(i,r,s)}delete(e){const n=this.field(e.popLast());Dl(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return ar(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;r<e.length;++r){let s=n.mapValue.fields[e.get(r)];Dl(s)&&s.mapValue.fields||(s={mapValue:{fields:{}}},n.mapValue.fields[e.get(r)]=s),n=s}return n.mapValue.fields}applyChanges(e,n,r){Hs(n,((s,i)=>e[s]=i));for(const s of r)delete e[s]}clone(){return new jt(Cc(this.value))}}function PA(t){const e=[];return Hs(t.fields,((n,r)=>{const s=new et([n]);if(Dl(r)){const i=PA(r.mapValue).fields;
25if(i.length===0)e.push(s);else for(const o of i)e.push(s.child(o))}else e.push(s)})),new dn(e)}class Xe{constructor(e,n,r,s,i,o,a){this.key=e,this.documentType=n,this.version=r,this.readTime=s,this.createTime=i,this.data=o,this.documentState=a}static newInvalidDocument(e){return new Xe(e,0,he.min(),he.min(),he.min(),jt.empty(),0)}static newFoundDocument(e,n,r,s){return new Xe(e,1,n,he.min(),r,s,0)}static newNoDocument(e,n){return new Xe(e,2,n,he.min(),he.min(),jt.empty(),0)}static newUnknownDocument(e,n){return new Xe(e,3,n,he.min(),he.min(),jt.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(he.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=jt.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=jt.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=he.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof Xe&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new Xe(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class Fs{constructor(e,n){this.position=e,this.inclusive=n}}function fI(t,e,n){let r=0;for(let s=0;s<t.position.length;s++){const i=e[s],o=t.position[s];if(i.field.isKeyField()?r=X.comparator(X.fromName(o.referenceValue),n.key):r=Ms(o,n.data.field(i.field)),i.dir==="desc"&&(r*=-1),r!==0)break}return r}function pI(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!ar(t.position[n],e.position[n]))return!1;return!0}class ru{constructor(e,n="asc"){this.field=e,this.dir=n}}function EM(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}class CA{}class Pe extends CA{constructor(e,n,r){super(),this.field=e,this.op=n,this.value=r}static create(e,n,r){return e.isKeyField()?n==="in"||n==="not-in"?this.createKeyFieldInFilter(e,n,r):new IM(e,n,r):n==="array-contains"?new vM(e,r):n==="in"?new VA(e,r):n==="not-in"?new bM(e,r):n==="array-contains-any"?new AM(e,r):new Pe(e,n,r)}static createKeyFieldInFilter(e,n,r){return n==="in"?new TM(e,r):new wM(e,r)}matches(e){const n=e.data.field(this.field);return this.op==="!="?n!==null&&n.nullValue===void 0&&this.matchesComparison(Ms(n,this.value)):n!==null&&Ls(this.value)===Ls(n)&&this.matchesComparison(Ms(n,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return re(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Be extends CA{constructor(e,n){super(),this.filters=e,this.op=n,this.Pe=null}static create(e,n){return new Be(e,n)}matches(e){return Yo(this)?this.filters.find((n=>!n.matches(e)))===void 0:this.filters.find((n=>n.matches(e)))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce(((e,n)=>e.concat(n.getFlattenedFilters())),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function Yo(t){return t.op==="and"}function Fp(t){return t.op==="or"}function ig(t){return kA(t)&&Yo(t)}function kA(t){for(const e of t.filters)if(e instanceof Be)return!1;return!0}function Up(t){if(t instanceof Pe)return t.field.canonicalString()+t.op.toString()+Jo(t.value);if(ig(t))return t.filters.map((e=>Up(e))).join(",");{const e=t.filters.map((n=>Up(n))).join(",");return`${t.op}(${e})`}}function NA(t,e){return t instanceof Pe?(function(r,s){return s instanceof Pe&&r.op===s.op&&r.field.isEqual(s.field)&&ar(r.value,s.value)})(t,e):t instanceof Be?(function(r,s){return s instanceof Be&&r.op===s.op&&r.filters.length===s.filters.length?r.filters.reduce(((i,o,a)=>i&&NA(o,s.filters[a])),!0):!1})(t,e):void re(19439)}function DA(t,e){const n=t.filters.concat(e);return Be.create(n,t.op)}function OA(t){return t instanceof Pe?(function(n){return`${n.field.canonicalString()} ${n.op} ${Jo(n.value)}`})(t):t instanceof Be?(function(n){return n.op.toString()+" {"+n.getFilters().map(OA).join(" ,")+"}"})(t):"Filter"}class IM extends Pe{constructor(e,n,r){super(e,n,r),this.key=X.fromName(r.referenceValue)}matches(e){const n=X.comparator(e.key,this.key);return this.matchesComparison(n)}}class TM extends Pe{constructor(e,n){super(e,"in",n),this.keys=xA("in",n)}matches(e){return this.keys.some((n=>n.isEqual(e.key)))}}class wM extends Pe{constructor(e,n){super(e,"not-in",n),this.keys=xA("not-in",n)}matches(e){return!this.keys.some((n=>n.isEqual(e.key)))}}function xA(t,e){return(e.arrayValue?.values||[]).map((n=>
25X.fromName(n.referenceValue)))}class vM extends Pe{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return nu(n)&&tu(n.arrayValue,this.value)}}class VA extends Pe{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&tu(this.value.arrayValue,n)}}class bM extends Pe{constructor(e,n){super(e,"not-in",n)}matches(e){if(tu(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!tu(this.value.arrayValue,n)}}class AM extends Pe{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!nu(n)||!n.arrayValue.values)&&n.arrayValue.values.some((r=>tu(this.value.arrayValue,r)))}}class RM{constructor(e,n=null,r=[],s=[],i=null,o=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=s,this.limit=i,this.startAt=o,this.endAt=a,this.Te=null}}function Bp(t,e=null,n=[],r=[],s=null,i=null,o=null){return new RM(t,e,n,r,s,i,o)}function Li(t){const e=Z(t);if(e.Te===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map((r=>Up(r))).join(","),n+="|ob:",n+=e.orderBy.map((r=>(function(i){return i.field.canonicalString()+i.dir})(r))).join(","),Tu(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map((r=>Jo(r))).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map((r=>Jo(r))).join(",")),e.Te=n}return e.Te}function vu(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!EM(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!NA(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!pI(t.startAt,e.startAt)&&pI(t.endAt,e.endAt)}function fh(t){return X.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===0}function ph(t,e){return t.filters.filter((n=>n instanceof Pe&&n.field.isEqual(e)))}function mI(t,e,n){let r=kl,s=!0;for(const i of ph(t,e)){let o=kl,a=!0;switch(i.op){case"<":case"<=":o=_M(i.value);break;case"==":case"in":case">=":o=i.value;break;case">":o=i.value,a=!1;break;case"!=":case"not-in":o=kl}hI({value:r,inclusive:s},{value:o,inclusive:a})<0&&(r=o,s=a)}if(n!==null){for(let i=0;i<t.orderBy.length;++i)if(t.orderBy[i].field.isEqual(e)){const o=n.position[i];hI({value:r,inclusive:s},{value:o,inclusive:n.inclusive})<0&&(r=o,s=n.inclusive);break}}return{value:r,inclusive:s}}function gI(t,e,n){let r=Is,s=!0;for(const i of ph(t,e)){let o=Is,a=!0;switch(i.op){case">=":case">":o=yM(i.value),a=!1;break;case"==":case"in":case"<=":o=i.value;break;case"<":o=i.value,a=!1;break;case"!=":case"not-in":o=Is}dI({value:r,inclusive:s},{value:o,inclusive:a})>0&&(r=o,s=a)}if(n!==null){for(let i=0;i<t.orderBy.length;++i)if(t.orderBy[i].field.isEqual(e)){const o=n.position[i];dI({value:r,inclusive:s},{value:o,inclusive:n.inclusive})>0&&(r=o,s=n.inclusive);break}}return{value:r,inclusive:s}}class Kr{constructor(e,n=null,r=[],s=[],i=null,o="F",a=null,c=null){this.path=e,this.collectionGroup=n,this.explicitOrderBy=r,this.filters=s,this.limit=i,this.limitType=o,this.startAt=a,this.endAt=c,this.Ie=null,this.Ee=null,this.de=null,this.startAt,this.endAt}}function LA(t,e,n,r,s,i,o,a){return new Kr(t,e,n,r,s,i,o,a)}function Ea(t){return new Kr(t)}function _I(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function og(t){return t.collectionGroup!==null}function ko(t){const e=Z(t);if(e.Ie===null){e.Ie=[];const n=new Set;for(const i of e.explicitOrderBy)e.Ie.push(i),n.add(i.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new $e(et.comparator);return o.filters.forEach((c=>
25{c.getFlattenedFilters().forEach((l=>{l.isInequality()&&(a=a.add(l.field))}))})),a})(e).forEach((i=>{n.has(i.canonicalString())||i.isKeyField()||e.Ie.push(new ru(i,r))})),n.has(et.keyField().canonicalString())||e.Ie.push(new ru(et.keyField(),r))}return e.Ie}function Yt(t){const e=Z(t);return e.Ee||(e.Ee=FA(e,ko(t))),e.Ee}function MA(t){const e=Z(t);return e.de||(e.de=FA(e,t.explicitOrderBy)),e.de}function FA(t,e){if(t.limitType==="F")return Bp(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map((s=>{const i=s.dir==="desc"?"asc":"desc";return new ru(s.field,i)}));const n=t.endAt?new Fs(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new Fs(t.startAt.position,t.startAt.inclusive):null;return Bp(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function jp(t,e){const n=t.filters.concat([e]);return new Kr(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function mh(t,e,n){return new Kr(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function bu(t,e){return vu(Yt(t),Yt(e))&&t.limitType===e.limitType}function UA(t){return`${Li(Yt(t))}|lt:${t.limitType}`}function yo(t){return`Query(target=${(function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map((s=>OA(s))).join(", ")}]`),Tu(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map((s=>(function(o){return`${o.field.canonicalString()} (${o.dir})`})(s))).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map((s=>Jo(s))).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map((s=>Jo(s))).join(",")),`Target(${r})`})(Yt(t))}; limitType=${t.limitType})`}function Au(t,e){return e.isFoundDocument()&&(function(r,s){const i=s.key.path;return r.collectionGroup!==null?s.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(i):X.isDocumentKey(r.path)?r.path.isEqual(i):r.path.isImmediateParentOf(i)})(t,e)&&(function(r,s){for(const i of ko(r))if(!i.field.isKeyField()&&s.data.field(i.field)===null)return!1;return!0})(t,e)&&(function(r,s){for(const i of r.filters)if(!i.matches(s))return!1;return!0})(t,e)&&(function(r,s){return!(r.startAt&&!(function(o,a,c){const l=fI(o,a,c);return o.inclusive?l<=0:l<0})(r.startAt,ko(r),s)||r.endAt&&!(function(o,a,c){const l=fI(o,a,c);return o.inclusive?l>=0:l>0})(r.endAt,ko(r),s))})(t,e)}function BA(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function jA(t){return(e,n)=>{let r=!1;for(const s of ko(t)){const i=SM(s,e,n);if(i!==0)return i;r=r||s.field.isKeyField()}return 0}}function SM(t,e,n){const r=t.field.isKeyField()?X.comparator(e.key,n.key):(function(i,o,a){const c=o.data.field(i),l=a.data.field(i);return c!==null&&l!==null?Ms(c,l):re(42886)})(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return re(19790,{direction:t.dir})}}class zr{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[s,i]of r)if(this.equalsFn(s,e))return i}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),s=this.inner[r];if(s===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let i=0;i<s.length;i++)if(this.equalsFn(s[i][0],e))return void(s[i]=[e,n]);s.push([e,n]),this.innerSize++}delete(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r===void 0)return!1;for(let s=0;s<r.length;s++)if(this.equalsFn(r[s][0],e))return r.length===1?delete this.inner[n]:r.splice(s,1),this.innerSize--,!0;return!1}forEach(e){Hs(this.inner,((n,r)=>{for(const[s,i]of r)e(s,i)}))}isEmpty(){return EA(this.inner)}size(){return this.innerSize}}const PM=new Je(X.comparator);function fn(){return PM}const $A=new Je(X.comparator);function hc(...t){let e=$A;for(const n of t)e=e.insert(n.key,n);return e}function qA(t){let e=$A;return t.forEach(((n,r)=>e=e.insert(n,r.overlayedDocument))),e}function nr(){return kc()}function HA(){return kc()}function kc(){return new zr((t=>t.toString()),((t,e)=>t.isEqual(e)))}const CM=new Je(X.comparator),kM=new $e(X.comparator);function Ie(...t){let e=kM;for(const n of t)e=e.add(n);return e}const NM=new $e(_e);function ag(){return NM}function cg(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Qc(e)?"-0":e}}function GA(t){return{integerValue:""+t}}function WA(t,e){return aA(e)?GA(e):cg(t,e)}class od{constructor(){this._=void 0}}function DM(t,e,n){return t instanceof Xo?(function(s,i){const o={fields:{[wA]:{stringValue:TA},[bA]:{timestampValue:{seconds:s.seconds,nanos:s.nanoseconds}}}};return i&&rd(i)&&(i=sd(i)),i&&(o.fields[vA]=i),{mapValue:o}})(n,e):t instanceof Mi?zA(t,e):t instanceof Fi?QA(t,e):(function(s,i){const o=KA(s,i),a=yI(o)+yI(s.Ae);
25return Mp(o)&&Mp(s.Ae)?GA(a):cg(s.serializer,a)})(t,e)}function OM(t,e,n){return t instanceof Mi?zA(t,e):t instanceof Fi?QA(t,e):n}function KA(t,e){return t instanceof Zo?(function(r){return Mp(r)||(function(i){return!!i&&"doubleValue"in i})(r)})(e)?e:{integerValue:0}:null}class Xo extends od{}class Mi extends od{constructor(e){super(),this.elements=e}}function zA(t,e){const n=JA(e);for(const r of t.elements)n.some((s=>ar(s,r)))||n.push(r);return{arrayValue:{values:n}}}class Fi extends od{constructor(e){super(),this.elements=e}}function QA(t,e){let n=JA(e);for(const r of t.elements)n=n.filter((s=>!ar(s,r)));return{arrayValue:{values:n}}}class Zo extends od{constructor(e,n){super(),this.serializer=e,this.Ae=n}}function yI(t){return rt(t.integerValue||t.doubleValue)}function JA(t){return nu(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}class Ru{constructor(e,n){this.field=e,this.transform=n}}function xM(t,e){return t.field.isEqual(e.field)&&(function(r,s){return r instanceof Mi&&s instanceof Mi||r instanceof Fi&&s instanceof Fi?jo(r.elements,s.elements,ar):r instanceof Zo&&s instanceof Zo?ar(r.Ae,s.Ae):r instanceof Xo&&s instanceof Xo})(t.transform,e.transform)}class VM{constructor(e,n){this.version=e,this.transformResults=n}}class st{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new st}static exists(e){return new st(void 0,e)}static updateTime(e){return new st(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Ol(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class ad{}function YA(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new Ta(t.key,st.none()):new Ia(t.key,t.data,st.none());{const n=t.data,r=jt.empty();let s=new $e(et.comparator);for(let i of e.fields)if(!s.has(i)){let o=n.field(i);o===null&&i.length>1&&(i=i.popLast(),o=n.field(i)),o===null?r.delete(i):r.set(i,o),s=s.add(i)}return new Qr(t.key,r,new dn(s.toArray()),st.none())}}function LM(t,e,n){t instanceof Ia?(function(s,i,o){const a=s.value.clone(),c=II(s.fieldTransforms,i,o.transformResults);a.setAll(c),i.convertToFoundDocument(o.version,a).setHasCommittedMutations()})(t,e,n):t instanceof Qr?(function(s,i,o){if(!Ol(s.precondition,i))return void i.convertToUnknownDocument(o.version);const a=II(s.fieldTransforms,i,o.transformResults),c=i.data;c.setAll(XA(s)),c.setAll(a),i.convertToFoundDocument(o.version,c).setHasCommittedMutations()})(t,e,n):(function(s,i,o){i.convertToNoDocument(o.version).setHasCommittedMutations()})(0,e,n)}function Nc(t,e,n,r){return t instanceof Ia?(function(i,o,a,c){if(!Ol(i.precondition,o))return a;const l=i.value.clone(),h=TI(i.fieldTransforms,c,o);return l.setAll(h),o.convertToFoundDocument(o.version,l).setHasLocalMutations(),null})(t,e,n,r):t instanceof Qr?(function(i,o,a,c){if(!Ol(i.precondition,o))return a;const l=TI(i.fieldTransforms,c,o),h=o.data;return h.setAll(XA(i)),h.setAll(l),o.convertToFoundDocument(o.version,h).setHasLocalMutations(),a===null?null:a.unionWith(i.fieldMask.fields).unionWith(i.fieldTransforms.map((d=>d.field)))})(t,e,n,r):(function(i,o,a){return Ol(i.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a})(t,e,n)}function MM(t,e){let n=null;for(const r of t.fieldTransforms){const s=e.data.field(r.field),i=KA(r.transform,s||null);i!=null&&(n===null&&(n=jt.empty()),n.set(r.field,i))}return n||null}function EI(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!(function(r,s){return r===void 0&&s===void 0||!(!r||!s)&&jo(r,s,((i,o)=>xM(i,o)))})(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Ia extends ad{constructor(e,n,r,s=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class Qr extends ad{constructor(e,n,r,s,i=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.prec
vendor: 4,379 bytes, lines 25-28
25ondition=s,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function XA(t){const e=new Map;return t.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}})),e}function II(t,e,n){const r=new Map;ce(t.length===n.length,32656,{Re:n.length,Ve:t.length});for(let s=0;s<n.length;s++){const i=t[s],o=i.transform,a=e.data.field(i.field);r.set(i.field,OM(o,a,n[s]))}return r}function TI(t,e,n){const r=new Map;for(const s of t){const i=s.transform,o=n.data.field(s.field);r.set(s.field,DM(i,o,e))}return r}class Ta extends ad{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class ug extends ad{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class lg{constructor(e,n,r,s){this.batchId=e,this.localWriteTime=n,this.baseMutations=r,this.mutations=s}applyToRemoteDocument(e,n){const r=n.mutationResults;for(let s=0;s<this.mutations.length;s++){const i=this.mutations[s];i.key.isEqual(e.key)&&LM(i,e,r[s])}}applyToLocalView(e,n){for(const r of this.baseMutations)r.key.isEqual(e.key)&&(n=Nc(r,e,n,this.localWriteTime));for(const r of this.mutations)r.key.isEqual(e.key)&&(n=Nc(r,e,n,this.localWriteTime));return n}applyToLocalDocumentSet(e,n){const r=HA();return this.mutations.forEach((s=>{const i=e.get(s.key),o=i.overlayedDocument;let a=this.applyToLocalView(o,i.mutatedFields);a=n.has(s.key)?null:a;const c=YA(o,a);c!==null&&r.set(s.key,c),o.isValidDocument()||o.convertToNoDocument(he.min())})),r}keys(){return this.mutations.reduce(((e,n)=>e.add(n.key)),Ie())}isEqual(e){return this.batchId===e.batchId&&jo(this.mutations,e.mutations,((n,r)=>EI(n,r)))&&jo(this.baseMutations,e.baseMutations,((n,r)=>EI(n,r)))}}class hg{constructor(e,n,r,s){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=s}static from(e,n,r){ce(e.mutations.length===r.length,58842,{me:e.mutations.length,fe:r.length});let s=(function(){return CM})();const i=e.mutations;for(let o=0;o<i.length;o++)s=s.insert(i[o].key,r[o].version);return new hg(e,n,r,s)}}class dg{constructor(e,n){this.largestBatchId=e,this.mutation=n}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
26      largestBatchId: ${this.largestBatchId},
27      mutation: ${this.mutation.toString()}
28    }`}}class ZA{constructor(e,n,r){this.alias=e,this.aggregateType=n,this.fieldPath=r}}class FM{constructor(e,n){this.count=e,this.unchangedNames=n}}var mt,Ce;function eR(t){switch(t){case F.OK:return re(64938);case F.CANCELLED:case F.UNKNOWN:case F.DEADLINE_EXCEEDED:case F.RESOURCE_EXHAUSTED:case F.INTERNAL:case F.UNAVAILABLE:case F.UNAUTHENTICATED:return!1;case F.INVALID_ARGUMENT:case F.NOT_FOUND:case F.ALREADY_EXISTS:case F.PERMISSION_DENIED:case F.FAILED_PRECONDITION:case F.ABORTED:case F.OUT_OF_RANGE:case F.UNIMPLEMENTED:case F.DATA_LOSS:return!0;default:return re(15467,{code:t})}}function tR(t){if(t===void 0)return ft("GRPC error has no .code"),F.UNKNOWN;switch(t){case mt.OK:return F.OK;case mt.CANCELLED:return F.CANCELLED;case mt.UNKNOWN:return F.UNKNOWN;case mt.DEADLINE_EXCEEDED:return F.DEADLINE_EXCEEDED;case mt.RESOURCE_EXHAUSTED:return F.RESOURCE_EXHAUSTED;case mt.INTERNAL:return F.INTERNAL;case mt.UNAVAILABLE:return F.UNAVAILABLE;case mt.UNAUTHENTICATED:return F.UNAUTHENTICATED;case mt.INVALID_ARGUMENT:return F.INVALID_ARGUMENT;case mt.NOT_FOUND:return F.NOT_FOUND;case mt.ALREADY_EXISTS:return F.ALREADY_EXISTS;case mt.PERMISSION_DENIED:return F.PERMISSION_DENIED;case mt.FAILED_PRECONDITION:return F.FAILED_PRECONDITION;case mt.ABORTED:return F.ABORTED;case mt.OUT_OF_RANGE:return F.OUT_OF_RANGE;case mt.UNIMPLEMENTED:return F.UNIMPLEMENTED;case mt.DATA_LOSS:return F.DATA_LOSS;default:return re(39323,{code:t})}}(Ce=mt||(mt={}))[Ce.OK=0]="OK",Ce[Ce.CANCELLED=1]="CANCELLED",Ce[Ce.UNKNOWN=2]="UNKNOWN",Ce[Ce.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Ce[Ce.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Ce[Ce.NOT_FOUND=5]="NOT_FOUND",Ce[Ce.ALREADY_EXISTS=6]="ALREADY_EXISTS",Ce[Ce.PERMISSION_DENIED=7]="PERMISSION_DENIED",Ce[Ce.UNAUTHENTICATED=16]="UNAUTHENTICATED",Ce[Ce.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Ce[Ce.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Ce[Ce.ABORTED=10]="ABORTED",Ce[Ce.OUT_OF_RANGE=11]="OUT_OF_RANGE",Ce[Ce.UNIMPLEMENT
28ED=12]="UNIMPLEMENTED",Ce[Ce.INTERNAL=13]="INTERNAL",Ce[Ce.UNAVAILABLE=14]="UNAVAILABLE",Ce[Ce.DATA_LOSS=15]="DATA_LOSS";let $p=null;function nR(){return new TextEncoder}const UM=new Ps([4294967295,4294967295],0);function wI(t){const e=nR().encode(t),n=new qb;return n.update(e),new Uint8Array(n.digest())}function vI(t){const e=new DataView(t.buffer),n=e.getUint32(0,!0),r=e.getUint32(4,!0),s=e.getUint32(8,!0),i=e.getUint32(12,!0);return[new Ps([n,r],0),new Ps([s,i],0)]}class fg{constructor(e,n,r){if(this.bitmap=e,this.padding=n,this.hashCount=r,n<0||n>=8)throw new dc(`Invalid padding: ${n}`);if(r<0)throw new dc(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new dc(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new dc(`Invalid padding when bitmap length is 0: ${n}`);this.ge=8*e.length-n,this.pe=Ps.fromNumber(this.ge)}ye(e,n,r){let s=e.add(n.multiply(Ps.fromNumber(r)));return s.compare(UM)===1&&(s=new Ps([s.getBits(0),s.getBits(1)],0)),s.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.ge===0)return!1;const n=wI(e),[r,s]=vI(n);for(let i=0;i<this.hashCount;i++){const o=this.ye(r,s,i);if(!this.we(o))return!1}return!0}static create(e,n,r){const s=e%8==0?0:8-e%8,i=new Uint8Array(Math.ceil(e/8)),o=new fg(i,s,n);return r.forEach((a=>o.insert(a))),o}insert(e){if(this.ge===0)return;const n=wI(e),[r,s]=vI(n);for(let i=0;i<this.hashCount;i++){const o=this.ye(r,s,i);this.Se(o)}}Se(e){const n=Math.floor(e/8),r=e%8;this.bitmap[n]|=1<<r}}class dc extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class Su{constructor(e,n,r,s,i){this.snapshotVersion=e,this.targetChanges=n,this.targetMismatches=r,this.documentUpdates=s,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(e,n,r){const s=new Map;return s.set(e,Pu.createSynthesizedTargetChangeForCurrentChange(e,n,r)),new Su(he.min(),s,new Je(_e),fn(),Ie())}}class Pu{constructor(e,n,r,s,i){this.resumeToken=e,this.current=n,this.addedDocuments=r,this.modifiedDocuments=s,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(e,n,r){return new Pu(r,n,Ie(),Ie(),Ie())}}class xl{constructor(e,n,r,s){this.be=e,this.removedTargetIds=n,this.key=r,this.De=s}}class rR{constructor(e,n){this.targetId=e,this.Ce=n}}class sR{constructor(e,n,r=ct.EMPTY_BYTE_STRING,s=null){this.state=e,this.targetIds=n,this.resumeToken=r,this.cause=s}}class bI{constructor(){this.ve=0,this.Fe=AI(),this.Me=ct.EMPTY_BYTE_STRING,this.xe=!1,this.Oe=!0}get current(){return this.xe}get resumeToken(){return this.Me}get Ne(){return this.ve!==0}get Be(){return this.Oe}Le(e){e.approximateByteSize()>0&&(this.Oe=!0,this.Me=e)}ke(){let e=Ie(),n=Ie(),r=Ie();return this.Fe.forEach(((s,i)=>{switch(i){case 0:e=e.add(s);break;case 2:n=n.add(s);break;case 1:r=r.add(s);break;default:re(38017,{changeType:i})}})),new Pu(this.Me,this.xe,e,n,r)}qe(){this.Oe=!1,this.Fe=AI()}Qe(e,n){this.Oe=!0,this.Fe=this.Fe.insert(e,n)}$e(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}Ue(){this.ve+=1}Ke(){this.ve-=1,ce(this.ve>=0,3241,{ve:this.ve})}We(){this.Oe=!0,this.xe=!0}}class BM{constructor(e){this.Ge=e,this.ze=new Map,this.je=fn(),this.Je=cl(),this.He=cl(),this.Ye=new Je(_e)}Ze(e){for(const n of e.be)e.De&&e.De.isFoundDocument()?this.Xe(n,e.De):this.et(n,e.key,e.De);for(const n of e.removedTargetIds)this.et(n,e.key,e.De)}tt(e){this.forEachTarget(e,(n=>{const r=this.nt(n);switch(e.state){case 0:this.rt(n)&&r.Le(e.resumeToken);break;case 1:r.Ke(),r.Ne||r.qe(),r.Le(e.resumeToken);break;case 2:r.Ke(),r.Ne||this.removeTarget(n);break;case 3:this.rt(n)&&(r.We(),r.Le(e.resumeToken));break;case 4:this.rt(n)&&(this.it(n),r.Le(e.resumeToken));break;default:re(56790,{state:e.state})}}))}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.ze.forEach(((r,s)=>{this.rt(s)&&n(s)}))}st(e){const n=e.targetId,r=e.Ce.count,s=this.ot(n);if(s){const i=s.target;if(fh(i))if(r===0){const o=new X(i.path);this.et(n,o,Xe.newNoDocument(o,he.min()))}else ce(r===1,20013,{expectedCount:r});else{const o=this._t(n);if(o!==r){const a=this.ut(e),c=a?this.ct(a,e,o):1;if(c!==0){this.it(n);const l=c===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ye=this.Ye.insert(n,l)}$p?.lt((function(h,d,f,m,_){const E={localCacheCount:h,existenceFilterCount:d.count,databaseId:f.database,projectId:f.projectId},v=d.unchangedNames;return v&&(E.bloomFilter={applied:_===0,hashCount:v?.hashCount??0,bitmapLength:v?.bits?.bitmap?.length??0,padding:v?.bits?.padding??0,mightContain:O=>m?.mightContain(O)??!1}),E})(o,e.Ce,this.Ge.ht(),a,c))}}}}ut(e){const n=e.Ce.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:s=0},hashCount:i=0}=n;let o,a;try{o=Br(r).toUint8Array()}catch(c){if(c instanceof IA)return vn("Decoding the base64 bloom filter in existence filter failed ("+c.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw c}try{a=new fg(o,s,i)}catch(c){return vn(c instanceof dc?"BloomFilter error: ":"Applying bloom filter failed: ",c),null}return a.ge===0?null:a}ct(e,n,r){return n.Ce.count===r-this.Pt(e,n.targetId)?0:2}Pt(e,n){const r=this.Ge.getRemoteKeysForTarget(n);let s=0;return r.forEach((i=>{const o=this.Ge.ht(),a=`projects/${o.projectId}/databases/${o.database}/documents/${i.path.canonicalString()}`;e.mightContain(a)||(this.et(n,i,null),s++)})),s}Tt(e){const n=new Map;this.ze.forEach(((i,o)=>{const a=this.ot(o);if(a){if(i.current&&fh(a.target)){const c=new X(a.target.path);this.It(c).has(o)||this.Et(o,c)||this.et(o,c,Xe.newNoDocument(c,e))}i.Be&&(n.set(o,i.ke()),i.qe())}}));let r=Ie();this.He.forEach(((i,o)=>{let a=!0;o.forEachWhile((c=>{const l=this.ot(c);return!l||l.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)})),a&&(r=r.add(i))})),this.je.forEach(((i,o)=>o.setReadTime(e)));const s=new Su(e,n,this.Ye,this.je,r);return this.je=fn(),this.Je=cl(),this.He=cl(),this.Ye=new Je(_e),s}Xe(e,n){if(!this.rt(e))return;const r=this.Et(e,n.key)?2:0;this.nt(e).Qe(n.key,r),this.je=this.je.insert(n.key,n),this.Je=this.Je.insert(n.key,this.It(n.key).add(e)),this.He=this.He.insert(n.key,this.dt(n.key).add(e))}et(e,n,r){if(!this.rt(e))return;const s=this.nt(e);this.Et(e,n)?s.Qe(n,1):s.$e(n),this.He=this.He.insert(n,this.dt(n).delete(e)),this.He=this.He.insert(n,this.dt(n).add(e)),r&&(this.je=this.je.insert(n,r))}removeTarget(e){this.ze.delete(e)}_t(e){const n=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}Ue(e){this.nt(e).Ue()}nt(e){let n=this.ze.get(e);return n||(n=new bI,this.ze.set(e,n)),n}dt(e){let n=this.He.get(e);return n||(n=new $e(_e),this.He=this.He.insert(e,n)),n}It(e){let n=this.Je.get(e);return n||(n=new $e(_e),this.Je=this.Je.insert(e,n)),n}rt(e){const n=this.ot(e)!==null;return n||H("WatchChangeAggregator","Detected inactive target",e),n}ot(e){const n=this.ze.get(e);return n&&n.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new bI),this.Ge.getRemoteKeysForTarget(e).forEach((n=>{this.et(e,n,null)}))}Et(e,n){return this.Ge.getRemoteKeysForTarget(e).has(n)}}function cl(){return new Je(X.comparator)}function AI(){return new Je(X.comparator)}const jM={asc:"ASCENDING",desc:"DESCENDING"},$M={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},qM={and:"AND",or:"OR"};class HM{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function qp(t,e){return t.useProto3Json||Tu(e)?e:{value:e}}function ea(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function iR(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function GM(t,e){return ea(t,e.toTimestamp())}function pt(t){return ce(!!t,49232),he.fromTimestamp((function(n){const r=Ur(n);return new Fe(r.seconds,r.nanos)})(t))}function pg(t,e){return Hp(t,e).canonicalString()}function Hp(t,e){const n=(function(s){return new be(["projects",s.projectId,"databases",s.database])})(t).child("documents");return e===void 0?n:n.child(e)}function oR(t){const e=be.fromString(t);return ce(mR(e),10190,{key:e.toString()}),e}function su(t,e){return pg(t.databaseId,e.path)}function or(t,e){const n=oR(e);if(n.get(1)!==t.databaseId.projectId)throw new $(F.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new $(F.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new X(uR(n))}function aR(t,e){return pg(t.databaseId,e)}function cR(t){const e=oR(t);return e.length===4?be.emptyPath():uR(e)}function Gp(t){return new be(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function uR(t){return ce(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function RI(t,e,n){return{name:su(t,e),fields:n.value.mapValue.fields}}function cd(t,e,n){const r=or(t,e.name),s=pt(e.updateTime),i=e.createTime?pt(e.createTime):he.min(),o=new jt({mapValue:{fields:e.fields}}),a=Xe.newFoundDocument(r,s,i,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function WM(t,e){return"found"in e?(function(r,s){ce(!!s.found,43571),s.found.name,s.found.updateTime;const i=or(r,s.found.name),o=pt(s.found.updateTime),a=s.found.createTime?pt(s.found.createTime):he.min(),c=new jt({mapValue:{fields:s.found.fields}});return Xe.newFoundDocument(i,o,a,c)})(t,e):"missing"in e?(function(r,s){ce(!!s.missing,3894),ce(!!s.readTime,22933);const i=or(r,s.missing),o=pt(s.readTime);return Xe.newNoDocument(i,o)})(t,e):re(7234,{result:e})}function KM(t,e){let n;if("targetChange"in e){e.targetChange;const r=(function(l){return l==="NO_CHANGE"?0:l==="ADD"?1:l==="REMOVE"?2:l==="CURRENT"?3:l==="RESET"?4:re(39313,{state:l})})(e.targetChange.targetChangeType||"NO_CHANGE"),s=e.targetChange.targetIds||[],i=(function(l,h){return l.useProto3Json?(ce(h===void 0||typeof h=="string",58123),ct.fromBase64String(h||"")):(ce(h===void 0||h instanceof Buffer||h instanceof Uint8Array,16193),ct.fromUint8Array(h||new Uint8Array))})(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&(function(l){const h=l.code===void 0?F.UNKNOWN:tR(l.code);return new $(h,l.message||"")})(o);n=new sR(r,s,i,a||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const s=or(t,r.document.name),i=pt(r.document.updateTime),o=r.document.createTime?pt(r.document.createTime):he.min(),a=new jt({mapValue:{fields:r.document.fields}}),c=Xe.newFoundDocument(s,i,o,a),l=r.targetIds||[],h=r.removedTargetIds||[];
28n=new xl(l,h,c.key,c)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const s=or(t,r.document),i=r.readTime?pt(r.readTime):he.min(),o=Xe.newNoDocument(s,i),a=r.removedTargetIds||[];n=new xl([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const s=or(t,r.document),i=r.removedTargetIds||[];n=new xl([],i,s,null)}else{if(!("filter"in e))return re(11601,{Rt:e});{e.filter;const r=e.filter;r.targetId;const{count:s=0,unchangedNames:i}=r,o=new FM(s,i),a=r.targetId;n=new rR(a,o)}}return n}function iu(t,e){let n;if(e instanceof Ia)n={update:RI(t,e.key,e.value)};else if(e instanceof Ta)n={delete:su(t,e.key)};else if(e instanceof Qr)n={update:RI(t,e.key,e.data),updateMask:ZM(e.fieldMask)};else{if(!(e instanceof ug))return re(16599,{Vt:e.type});n={verify:su(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((r=>(function(i,o){const a=o.transform;if(a instanceof Xo)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof Mi)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof Fi)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof Zo)return{fieldPath:o.field.canonicalString(),increment:a.Ae};throw re(20930,{transform:o.transform})})(0,r)))),e.precondition.isNone||(n.currentDocument=(function(s,i){return i.updateTime!==void 0?{updateTime:GM(s,i.updateTime)}:i.exists!==void 0?{exists:i.exists}:re(27497)})(t,e.precondition)),n}function Wp(t,e){const n=e.currentDocument?(function(i){return i.updateTime!==void 0?st.updateTime(pt(i.updateTime)):i.exists!==void 0?st.exists(i.exists):st.none()})(e.currentDocument):st.none(),r=e.updateTransforms?e.updateTransforms.map((s=>(function(o,a){let c=null;if("setToServerValue"in a)ce(a.setToServerValue==="REQUEST_TIME",16630,{proto:a}),c=new Xo;else if("appendMissingElements"in a){const h=a.appendMissingElements.values||[];c=new Mi(h)}else if("removeAllFromArray"in a){const h=a.removeAllFromArray.values||[];c=new Fi(h)}else"increment"in a?c=new Zo(o,a.increment):re(16584,{proto:a});const l=et.fromServerFormat(a.fieldPath);return new Ru(l,c)})(t,s))):[];if(e.update){e.update.name;const s=or(t,e.update.name),i=new jt({mapValue:{fields:e.update.fields}});if(e.updateMask){const o=(function(c){const l=c.fieldPaths||[];return new dn(l.map((h=>et.fromServerFormat(h))))})(e.updateMask);return new Qr(s,i,o,n,r)}return new Ia(s,i,n,r)}if(e.delete){const s=or(t,e.delete);return new Ta(s,n)}if(e.verify){const s=or(t,e.verify);return new ug(s,n)}return re(1463,{proto:e})}function zM(t,e){return t&&t.length>0?(ce(e!==void 0,14353),t.map((n=>(function(s,i){let o=s.updateTime?pt(s.updateTime):pt(i);return o.isEqual(he.min())&&(o=pt(i)),new VM(o,s.transformResults||[])})(n,e)))):[]}function lR(t,e){return{documents:[aR(t,e.path)]}}function ud(t,e){const n={structuredQuery:{}},r=e.path;let s;e.collectionGroup!==null?(s=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(s=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=aR(t,s);const i=(function(l){if(l.length!==0)return pR(Be.create(l,"and"))})(e.filters);i&&(n.structuredQuery.where=i);const o=(function(l){if(l.length!==0)return l.map((h=>(function(f){return{field:_s(f.field),direction:JM(f.dir)}})(h)))})(e.orderBy);o&&(n.structuredQuery.orderBy=o);const a=qp(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=(function(l){return{before:l.inclusive,values:l.position}})(e.startAt)),e.endAt&&(n.structuredQuery.endAt=(function(l){return{before:!l.inclusive,values:l.position}})(e.endAt)),{ft:n,parent:s}}function hR(t,e,n,r){const{ft:s,parent:i}=ud(t,e),o={},a=[];let c=0;return n.forEach((l=>{const h=r?l.alias:"aggregate_"+c++;o[h]=l.alias,l.aggregateType==="count"?a.push({alias:h,count:{}}):l.aggregateType==="avg"?a.push({alias:h,avg:{field:_s(l.fieldPath)}}):l.aggregateType==="sum"&&a.push({alias:h,sum:{field:_s(l.fieldPath)}})}
28)),{request:{structuredAggregationQuery:{aggregations:a,structuredQuery:s.structuredQuery},parent:s.parent},gt:o,parent:i}}function dR(t){let e=cR(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let s=null;if(r>0){ce(r===1,65062);const h=n.from[0];h.allDescendants?s=h.collectionId:e=e.child(h.collectionId)}let i=[];n.where&&(i=(function(d){const f=fR(d);return f instanceof Be&&ig(f)?f.getFilters():[f]})(n.where));let o=[];n.orderBy&&(o=(function(d){return d.map((f=>(function(_){return new ru(Eo(_.field),(function(v){switch(v){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(_.direction))})(f)))})(n.orderBy));let a=null;n.limit&&(a=(function(d){let f;return f=typeof d=="object"?d.value:d,Tu(f)?null:f})(n.limit));let c=null;n.startAt&&(c=(function(d){const f=!!d.before,m=d.values||[];return new Fs(m,f)})(n.startAt));let l=null;return n.endAt&&(l=(function(d){const f=!d.before,m=d.values||[];return new Fs(m,f)})(n.endAt)),LA(e,s,o,i,a,"F",c,l)}function QM(t,e){const n=(function(s){switch(s){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return re(28987,{purpose:s})}})(e.purpose);return n==null?null:{"goog-listen-tags":n}}function fR(t){return t.unaryFilter!==void 0?(function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=Eo(n.unaryFilter.field);return Pe.create(r,"==",{doubleValue:NaN});case"IS_NULL":const s=Eo(n.unaryFilter.field);return Pe.create(s,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const i=Eo(n.unaryFilter.field);return Pe.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Eo(n.unaryFilter.field);return Pe.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return re(61313);default:return re(60726)}})(t):t.fieldFilter!==void 0?(function(n){return Pe.create(Eo(n.fieldFilter.field),(function(s){switch(s){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return re(58110);default:return re(50506)}})(n.fieldFilter.op),n.fieldFilter.value)})(t):t.compositeFilter!==void 0?(function(n){return Be.create(n.compositeFilter.filters.map((r=>fR(r))),(function(s){switch(s){case"AND":return"and";case"OR":return"or";default:return re(1026)}})(n.compositeFilter.op))})(t):re(30097,{filter:t})}function JM(t){return jM[t]}function YM(t){return $M[t]}function XM(t){return qM[t]}function _s(t){return{fieldPath:t.canonicalString()}}function Eo(t){return et.fromServerFormat(t.fieldPath)}function pR(t){return t instanceof Pe?(function(n){if(n.op==="=="){if(lI(n.value))return{unaryFilter:{field:_s(n.field),op:"IS_NAN"}};if(uI(n.value))return{unaryFilter:{field:_s(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(lI(n.value))return{unaryFilter:{field:_s(n.field),op:"IS_NOT_NAN"}};if(uI(n.value))return{unaryFilter:{field:_s(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:_s(n.field),op:YM(n.op),value:n.value}}})(t):t instanceof Be?(function(n){const r=n.getFilters().map((s=>pR(s)));return r.length===1?r[0]:{compositeFilter:{op:XM(n.op),filters:r}}})(t):re(54877,{filter:t})}function ZM(t){const e=[];return t.fields.forEach((n=>e.push(n.canonicalString()))),{fieldPaths:e}}function mR(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}class Rr{constructor(e,n,r,s,i=he.min(),o=he.min(),a=ct.EMPTY_BYTE_STRING,c=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=s,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a,this.expectedCount=c}withSequenceNumber(e){return new Rr(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new Rr(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Rr(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Rr(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class gR{constructor(e){this.yt=e}}function eF(t,e){let n;if(e.document)n=cd(t.yt,e.document,!!e.hasCommittedMutations);else if(e.noDocument){const r=X.fromSegments(e.noDocument.path),s=Bi(e.noDocument.readTime);n=Xe.newNoDocument(r,s),e.hasCommittedMutations&&n.setHasCommittedMutations()}else{if(!e.unknownDocument)return re(56709);{const r=X.fromSegments(e.unknownDocument.path),s=Bi(e.unknownDocument.version);n=Xe.newUnknownDocument(r,s)}}return e.readTime&&n.setReadTime((function(s){const i=new Fe(s[0],s[1]);return he.fromTimestamp(i)})(e.readTime)),n}function SI(t,e){const n=e.key,r={prefixPath:n.getCollectionPath().popLast().toArray(),collectionGroup:n.collectionGroup,documentId:n.path.lastSegment(),readTime:gh(e.readTime),hasCommittedMutations:e.hasCommittedMutations};if(e.isFoundDocument())r.document=(function(i,o){return{name:su(i,o.key),fields:o.data.value.mapValue.fields,updateTime:ea(i,o.version.toTimestamp()),createTime:ea(i,o.createTime.toTimestamp())}})(t.yt,e);else if(e.isNoDocument())r.noDocument={path:n.path.toArray(),readTime:Ui(e.version)};else{if(!e.isUnknownDocument())return re(57904,{document:e});r.unknownDocument={path:n.path.toArray(),version:Ui(e.version)}}return r}function gh(t){const e=t.toTimestamp();return[e.seconds,e.nanoseconds]}function Ui(t){const e=t.toTimestamp();return{seconds:e.seconds,nanoseconds:e.nanoseconds}}function Bi(t){const e=new Fe(t.seconds,t.nanoseconds);return he.fromTimestamp(e)}function pi(t,e){const n=(e.baseMutations||[]).map((i=>Wp(t.yt,i)));for(let i=0;i<e.mutations.length-1;++i){const o=e.mutations[i];if(i+1<e.mutations.length&&e.mutations[i+1].transform!==void 0){const a=e.mutations[i+1];o.updateTransforms=a.transform.fieldTransforms,e.mutations.splice(i+1,1),++i}}const r=e.mutations.map((i=>Wp(t.yt,i))),s=Fe.fromMillis(e.localWriteTimeMs);return new lg(e.batchId,s,n,r)}function fc(t){const e=Bi(t.readTime),n=t.lastLimboFreeSnapshotVersion!==void 0?Bi(t.lastLimboFreeSnapshotVersion):he.min();let r;return r=(function(i){return i.documents!==void 0})(t.query)?(function(i){const o=i.documents.length;return ce(o===1,1966,{count:o}),Yt(Ea(cR(i.documents[0])))})(t.query):(function(i){return Yt(dR(i))}
28)(t.query),new Rr(r,t.targetId,"TargetPurposeListen",t.lastListenSequenceNumber,e,n,ct.fromBase64String(t.resumeToken))}function _R(t,e){const n=Ui(e.snapshotVersion),r=Ui(e.lastLimboFreeSnapshotVersion);let s;s=fh(e.target)?lR(t.yt,e.target):ud(t.yt,e.target).ft;const i=e.resumeToken.toBase64();return{targetId:e.targetId,canonicalId:Li(e.target),readTime:n,resumeToken:i,lastListenSequenceNumber:e.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:s}}function ld(t){const e=dR({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?mh(e,e.limit,"L"):e}function bf(t,e){return new dg(e.largestBatchId,Wp(t.yt,e.overlayMutation))}function PI(t,e){const n=e.path.lastSegment();return[t,Jt(e.path.popLast()),n]}function CI(t,e,n,r){return{indexId:t,uid:e,sequenceNumber:n,readTime:Ui(r.readTime),documentKey:Jt(r.documentKey.path),largestBatchId:r.largestBatchId}}class tF{getBundleMetadata(e,n){return kI(e).get(n).next((r=>{if(r)return(function(i){return{id:i.bundleId,createTime:Bi(i.createTime),version:i.version}})(r)}))}saveBundleMetadata(e,n){return kI(e).put((function(s){return{bundleId:s.id,createTime:Ui(pt(s.createTime)),version:s.version}})(n))}getNamedQuery(e,n){return NI(e).get(n).next((r=>{if(r)return(function(i){return{name:i.name,query:ld(i.bundledQuery),readTime:Bi(i.readTime)}})(r)}))}saveNamedQuery(e,n){return NI(e).put((function(s){return{name:s.name,readTime:Ui(pt(s.readTime)),bundledQuery:s.bundledQuery}})(n))}}function kI(t){return Pt(t,ed)}function NI(t){return Pt(t,td)}class hd{constructor(e,n){this.serializer=e,this.userId=n}static wt(e,n){const r=n.uid||"";return new hd(e,r)}getOverlay(e,n){return ec(e).get(PI(this.userId,n)).next((r=>r?bf(this.serializer,r):null))}getOverlays(e,n){const r=nr();return V.forEach(n,(s=>this.getOverlay(e,s).next((i=>{i!==null&&r.set(s,i)})))).next((()=>r))}saveOverlays(e,n,r){const s=[];return r.forEach(((i,o)=>{const a=new dg(n,o);s.push(this.St(e,a))})),V.waitFor(s)}removeOverlaysForBatchId(e,n,r){const s=new Set;n.forEach((o=>s.add(Jt(o.getCollectionPath()))));const i=[];return s.forEach((o=>{const a=IDBKeyRange.bound([this.userId,o,r],[this.userId,o,r+1],!1,!0);i.push(ec(e).Z(xp,a))})),V.waitFor(i)}getOverlaysForCollection(e,n,r){const s=nr(),i=Jt(n),o=IDBKeyRange.bound([this.userId,i,r],[this.userId,i,Number.POSITIVE_INFINITY],!0);return ec(e).J(xp,o).next((a=>{for(const c of a){const l=bf(this.serializer,c);s.set(l.getKey(),l)}return s}))}getOverlaysForCollectionGroup(e,n,r,s){const i=nr();let o;const a=IDBKeyRange.bound([this.userId,n,r],[this.userId,n,Number.POSITIVE_INFINITY],!0);return ec(e).ee({index:fA,range:a},((c,l,h)=>{const d=bf(this.serializer,l);i.size()<s||d.largestBatchId===o?(i.set(d.getKey(),d),o=d.largestBatchId):h.done()})).next((()=>i))}St(e,n){return ec(e).put((function(s,i,o){const[a,c,l]=PI(i,o.mutation.key);return{userId:i,collectionPath:c,documentId:l,collectionGroup:o.mutation.key.getCollectionGroup(),largestBatchId:o.largestBatchId,overlayMutation:iu(s.yt,o.mutation)}})(this.serializer,this.userId,n))}}function ec(t){return Pt(t,nd)}class nF{bt(e){return Pt(e,tg)}getSessionToken(e){return this.bt(e).get("sessionToken").next((n=>{const r=n?.value;return r?ct.fromUint8Array(r):ct.EMPTY_BYTE_STRING}))}setSessionToken(e,n){return this.bt(e).put({name:"sessionToken",value:n.toUint8Array()})}}class mi{constructor(){}Dt(e,n){this.Ct(e,n),n.vt()}Ct(e,n){if("nullValue"in e)this.Ft(n,5);else if("booleanValue"in e)this.Ft(n,10),n.Mt(e.booleanValue?1:0);else if("integerValue"in e)this.Ft(n,15),n.Mt(rt(e.integerValue));else if("doubleValue"in e){const r=rt(e.doubleValue);isNaN(r)?this.Ft(n,13):(this.Ft(n,15),Qc(r)?n.Mt(0):n.Mt(r))}else if("timestampValue"in e){let r=e.timestampValue;this.Ft(n,20),typeof r=="string"&&(r=Ur(r)),n.xt(`${r.seconds||""}`),n.Mt(r.nanos||0)}else if("stringValue"in e)this.Ot(e.stringValue,n),this.Nt(n);else if("bytesValue"in e)this.Ft(n,30),n.Bt(Br(e.bytesValue)),this.Nt(n);else if("referenceValue"in e)this.Lt(e.referenceValue,n);else if("geoPointValue"in e){const r=e.geoPointValue;this.Ft(n,45),n.Mt(r.latitude||0),n.Mt(r.longitude||0)}else"mapValue"in e?RA(e)?this.Ft(n,Number.MAX_SAFE_INTEGER):id(e)?this.kt(e.mapValue,n):(this.qt(e.mapValue,n),this.Nt(n)):"arrayValue"in e?(this.Qt(e.arrayValue,n),this.Nt(n)):re(19022,{$t:e})}Ot(e,n){this.Ft(n,25),this.Ut(e,n)}Ut(e,n){n.xt(e)}qt(e,n){const r=e.fields||{};this.Ft(n,55);for(const s of Object.keys(r))this.Ot(s,n),this.Ct(r[s],n)}kt(e,n){const r=e.fields||{};this.Ft(n,53);const s=Qo,i=r[s].arrayValue?.values?.length||0;this.Ft(n,15),n.Mt(rt(i)),this.Ot(s,n),this.Ct(r[s],n)}Qt(e,n){const r=e.values||[];this.Ft(n,50);for(const s of r)this.Ct(s,n)}Lt(e,n){this.Ft(n,37),X.fromName(e).path.forEach((r=>{this.Ft(n,60),this.Ut(r,n)}))}Ft(e,n){e.Mt(n)}Nt(e){e.Mt(2)}}
28mi.Kt=new mi;const lo=255;function rF(t){if(t===0)return 8;let e=0;return t>>4||(e+=4,t<<=4),t>>6||(e+=2,t<<=2),t>>7||(e+=1),e}function DI(t){const e=64-(function(r){let s=0;for(let i=0;i<8;++i){const o=rF(255&r[i]);if(s+=o,o!==8)break}return s})(t);return Math.ceil(e/8)}class sF{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Wt(e){const n=e[Symbol.iterator]();let r=n.next();for(;!r.done;)this.Gt(r.value),r=n.next();this.zt()}jt(e){const n=e[Symbol.iterator]();let r=n.next();for(;!r.done;)this.Jt(r.value),r=n.next();this.Ht()}Yt(e){for(const n of e){const r=n.charCodeAt(0);if(r<128)this.Gt(r);else if(r<2048)this.Gt(960|r>>>6),this.Gt(128|63&r);else if(n<"\uD800"||"\uDBFF"<n)this.Gt(480|r>>>12),this.Gt(128|63&r>>>6),this.Gt(128|63&r);else{const s=n.codePointAt(0);this.Gt(240|s>>>18),this.Gt(128|63&s>>>12),this.Gt(128|63&s>>>6),this.Gt(128|63&s)}}this.zt()}Zt(e){for(const n of e){const r=n.charCodeAt(0);if(r<128)this.Jt(r);else if(r<2048)this.Jt(960|r>>>6),this.Jt(128|63&r);else if(n<"\uD800"||"\uDBFF"<n)this.Jt(480|r>>>12),this.Jt(128|63&r>>>6),this.Jt(128|63&r);else{const s=n.codePointAt(0);this.Jt(240|s>>>18),this.Jt(128|63&s>>>12),this.Jt(128|63&s>>>6),this.Jt(128|63&s)}}this.Ht()}Xt(e){const n=this.en(e),r=DI(n);this.tn(1+r),this.buffer[this.position++]=255&r;for(let s=n.length-r;s<n.length;++s)this.buffer[this.position++]=255&n[s]}nn(e){const n=this.en(e),r=DI(n);this.tn(1+r),this.buffer[this.position++]=~(255&r);for(let s=n.length-r;s<n.length;++s)this.buffer[this.position++]=~(255&n[s])}rn(){this.sn(lo),this.sn(255)}_n(){this.an(lo),this.an(255)}reset(){this.position=0}seed(e){this.tn(e.length),this.buffer.set(e,this.position),this.position+=e.length}un(){return this.buffer.slice(0,this.position)}en(e){const n=(function(i){const o=new DataView(new ArrayBuffer(8));return o.setFloat64(0,i,!1),new Uint8Array(o.buffer)})(e),r=!!(128&n[0]);n[0]^=r?255:128;for(let s=1;s<n.length;++s)n[s]^=r?255:0;return n}Gt(e){const n=255&e;n===0?(this.sn(0),this.sn(255)):n===lo?(this.sn(lo),this.sn(0)):this.sn(n)}Jt(e){const n=255&e;n===0?(this.an(0),this.an(255)):n===lo?(this.an(lo),this.an(0)):this.an(e)}zt(){this.sn(0),this.sn(1)}Ht(){this.an(0),this.an(1)}sn(e){this.tn(1),this.buffer[this.position++]=e}an(e){this.tn(1),this.buffer[this.position++]=~e}tn(e){const n=e+this.position;if(n<=this.buffer.length)return;let r=2*this.buffer.length;r<n&&(r=n);const s=new Uint8Array(r);s.set(this.buffer),this.buffer=s}}class iF{constructor(e){this.cn=e}Bt(e){this.cn.Wt(e)}xt(e){this.cn.Yt(e)}Mt(e){this.cn.Xt(e)}vt(){this.cn.rn()}}class oF{constructor(e){this.cn=e}Bt(e){this.cn.jt(e)}xt(e){this.cn.Zt(e)}Mt(e){this.cn.nn(e)}vt(){this.cn._n()}}class tc{constructor(){this.cn=new sF,this.ln=new iF(this.cn),this.hn=new oF(this.cn)}seed(e){this.cn.seed(e)}Pn(e){return e===0?this.ln:this.hn}un(){return this.cn.un()}reset(){this.cn.reset()}}class gi{constructor(e,n,r,s){this.Tn=e,this.In=n,this.En=r,this.dn=s}An(){const e=this.dn.length,n=e===0||this.dn[e-1]===255?e+1:e,r=new Uint8Array(n);return r.set(this.dn,0),n!==e?r.set([0],this.dn.length):++r[r.length-1],new gi(this.Tn,this.In,this.En,r)}Rn(e,n,r){return{indexId:this.Tn,uid:e,arrayValue:Vl(this.En),directionalValue:Vl(this.dn),orderedDocumentKey:Vl(n),documentKey:r.path.toArray()}}Vn(e,n,r){const s=this.Rn(e,n,r);return[s.indexId,s.uid,s.arrayValue,s.directionalValue,s.orderedDocumentKey,s.documentKey]}}function as(t,e){let n=t.Tn-e.Tn;return n!==0?n:(n=OI(t.En,e.En),n!==0?n:(n=OI(t.dn,e.dn),n!==0?n:X.comparator(t.In,e.In)))}function OI(t,e){for(let n=0;n<t.length&&n<e.length;++n){const r=t[n]-e[n];if(r!==0)return r}return t.length-e.length}function Vl(t){return Mb()?(function(n){let r="";for(let s=0;s<n.length;s++)r+=String.fromCharCode(n[s]);return r})(t):t}function xI(t){return typeof t!="string"?t:(function(n){const r=new Uint8Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r})(t)}class VI{constructor(e){this.mn=new $e(((n,r)=>et.comparator(n.field,r.field))),this.collectionId=e.collectionGroup!=null?e.collectionGroup:e.path.lastSegment(),this.fn=e.orderBy,this.gn=[];for(const n of e.filters){const r=n;r.isInequality()?this.mn=this.mn.add(r):this.gn.push(r)}}get pn(){return this.mn.size>1}yn(e){if(ce(e.collectionGroup===this.collectionId,49279),this.pn)return!1;const n=Np(e);if(n!==void 0&&!this.wn(n))return!1;const r=li(e);let s=new Set,i=0,o=0;for(;i<r.length&&this.wn(r[i]);++i)s=s.add(r[i].fieldPath.canonicalString());if(i===r.length)return!0;
28if(this.mn.size>0){const a=this.mn.getIterator().getNext();if(!s.has(a.field.canonicalString())){const c=r[i];if(!this.Sn(a,c)||!this.bn(this.fn[o++],c))return!1}++i}for(;i<r.length;++i){const a=r[i];if(o>=this.fn.length||!this.bn(this.fn[o++],a))return!1}return!0}Dn(){if(this.pn)return null;let e=new $e(et.comparator);const n=[];for(const r of this.gn)if(!r.field.isKeyField())if(r.op==="array-contains"||r.op==="array-contains-any")n.push(new Ri(r.field,2));else{if(e.has(r.field))continue;e=e.add(r.field),n.push(new Ri(r.field,0))}for(const r of this.fn)r.field.isKeyField()||e.has(r.field)||(e=e.add(r.field),n.push(new Ri(r.field,r.dir==="asc"?0:1)));return new qo(qo.UNKNOWN_ID,this.collectionId,n,Ho.empty())}wn(e){for(const n of this.gn)if(this.Sn(n,e))return!0;return!1}Sn(e,n){if(e===void 0||!e.field.isEqual(n.fieldPath))return!1;const r=e.op==="array-contains"||e.op==="array-contains-any";return n.kind===2===r}bn(e,n){return!!e.field.isEqual(n.fieldPath)&&(n.kind===0&&e.dir==="asc"||n.kind===1&&e.dir==="desc")}}function yR(t){if(ce(t instanceof Pe||t instanceof Be,20012),t instanceof Pe){if(t instanceof VA){const n=t.value.arrayValue?.values?.map((r=>Pe.create(t.field,"==",r)))||[];return Be.create(n,"or")}return t}const e=t.filters.map((n=>yR(n)));return Be.create(e,t.op)}function aF(t){if(t.getFilters().length===0)return[];const e=Qp(yR(t));return ce(ER(e),7391),Kp(e)||zp(e)?[e]:e.getFilters()}function Kp(t){return t instanceof Pe}function zp(t){return t instanceof Be&&ig(t)}function ER(t){return Kp(t)||zp(t)||(function(n){if(n instanceof Be&&Fp(n)){for(const r of n.getFilters())if(!Kp(r)&&!zp(r))return!1;return!0}return!1})(t)}function Qp(t){if(ce(t instanceof Pe||t instanceof Be,34018),t instanceof Pe)return t;if(t.filters.length===1)return Qp(t.filters[0]);const e=t.filters.map((r=>Qp(r)));let n=Be.create(e,t.op);return n=_h(n),ER(n)?n:(ce(n instanceof Be,64498),ce(Yo(n),40251),ce(n.filters.length>1,57927),n.filters.reduce(((r,s)=>mg(r,s))))}function mg(t,e){let n;return ce(t instanceof Pe||t instanceof Be,38388),ce(e instanceof Pe||e instanceof Be,25473),n=t instanceof Pe?e instanceof Pe?(function(s,i){return Be.create([s,i],"and")})(t,e):LI(t,e):e instanceof Pe?LI(e,t):(function(s,i){if(ce(s.filters.length>0&&i.filters.length>0,48005),Yo(s)&&Yo(i))return DA(s,i.getFilters());const o=Fp(s)?s:i,a=Fp(s)?i:s,c=o.filters.map((l=>mg(l,a)));return Be.create(c,"or")})(t,e),_h(n)}function LI(t,e){if(Yo(e))return DA(e,t.getFilters());{const n=e.filters.map((r=>mg(t,r)));return Be.create(n,"or")}}function _h(t){if(ce(t instanceof Pe||t instanceof Be,11850),t instanceof Pe)return t;const e=t.getFilters();if(e.length===1)return _h(e[0]);if(kA(t))return t;const n=e.map((s=>_h(s))),r=[];return n.forEach((s=>{s instanceof Pe?r.push(s):s instanceof Be&&(s.op===t.op?r.push(...s.filters):r.push(s))})),r.length===1?r[0]:Be.create(r,t.op)}class cF{constructor(){this.Cn=new gg}addToCollectionParentIndex(e,n){return this.Cn.add(n),V.resolve()}getCollectionParents(e,n){return V.resolve(this.Cn.getEntries(n))}addFieldIndex(e,n){return V.resolve()}deleteFieldIndex(e,n){return V.resolve()}deleteAllFieldIndexes(e){return V.resolve()}createTargetIndexes(e,n){return V.resolve()}getDocumentsMatchingTarget(e,n){return V.resolve(null)}getIndexType(e,n){return V.resolve(0)}getFieldIndexes(e,n){return V.resolve([])}getNextCollectionGroupToUpdate(e){return V.resolve(null)}getMinOffset(e,n){return V.resolve(bn.min())}getMinOffsetFromCollectionGroup(e,n){return V.resolve(bn.min())}updateCollectionGroup(e,n,r){return V.resolve()}updateIndexEntries(e,n){return V.resolve()}}class gg{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),s=this.index[n]||new $e(be.comparator),i=!s.has(r);return this.index[n]=s.add(r),i}has(e){const n=e.lastSegment(),r=e.popLast(),s=this.index[n];return s&&s.has(r)}getEntries(e){return(this.index[e]||new $e(be.comparator)).toArray()}}const MI="IndexedDbIndexManager",ul=new Uint8Array(0);class uF{constructor(e,n){this.databaseId=n,this.vn=new gg,this.Fn=new zr((r=>Li(r)),((r,s)=>vu(r,s))),this.uid=e.uid||""}addToCollectionParentIndex(e,n){if(!this.vn.has(n)){const r=n.lastSegment(),s=n.popLast();e.addOnCommittedListener((()=>{this.vn.add(n)}));const i={collectionId:r,parent:Jt(s)};return FI(e).put(i)}return V.resolve()}getCollectionParents(e,n){const r=[],s=IDBKeyRange.bound([n,""],[Xb(n),""],!1,!0);return FI(e).J(s).next((i=>{for(const o of i){if(o.collectionId!==n)break;r.push(tr(o.parent))}return r}))}addFieldIndex(e,n){const r=nc(e),s=(function(a){return{indexId:a.indexId,collectionGroup:a.collectionGroup,fields:a.fields.map((c=>[c.fieldPath.canonicalString(),c.kind]))}})(n);delete s.indexId;const i=r.add(s);if(n.indexState){const o=fo(e);return i.next((a=>{o.put(CI(a,this.uid,n.indexState.sequenceNumber,n.indexState.offset))}))}return i.next()}deleteFieldIndex(e,n){const r=nc(e),s=fo(e),i=ho(e);return r.delete(n.indexId).next((()=>s.delete(IDBKeyRange.bound([n.indexId],[n.indexId+1],!1,!0)))).next((()=>i.delete(IDBKeyRange.bound([n.indexId],[n.indexId+1],!1,!0))))}deleteAllFieldIndexes(e){const n=nc(e),r=ho(e),s=fo(e);return n.Z().next((()=>r.Z())).next((()=>s.Z()))}
28createTargetIndexes(e,n){return V.forEach(this.Mn(n),(r=>this.getIndexType(e,r).next((s=>{if(s===0||s===1){const i=new VI(r).Dn();if(i!=null)return this.addFieldIndex(e,i)}}))))}getDocumentsMatchingTarget(e,n){const r=ho(e);let s=!0;const i=new Map;return V.forEach(this.Mn(n),(o=>this.xn(e,o).next((a=>{s&&(s=!!a),i.set(o,a)})))).next((()=>{if(s){let o=Ie();const a=[];return V.forEach(i,((c,l)=>{H(MI,`Using index ${(function(y){return`id=${y.indexId}|cg=${y.collectionGroup}|f=${y.fields.map((S=>`${S.fieldPath}:${S.kind}`)).join(",")}`})(c)} to execute ${Li(n)}`);const h=(function(y,S){const D=Np(S);if(D===void 0)return null;for(const M of ph(y,D.fieldPath))switch(M.op){case"array-contains-any":return M.value.arrayValue.values||[];case"array-contains":return[M.value]}return null})(l,c),d=(function(y,S){const D=new Map;for(const M of li(S))for(const b of ph(y,M.fieldPath))switch(b.op){case"==":case"in":D.set(M.fieldPath.canonicalString(),b.value);break;case"not-in":case"!=":return D.set(M.fieldPath.canonicalString(),b.value),Array.from(D.values())}return null})(l,c),f=(function(y,S){const D=[];let M=!0;for(const b of li(S)){const T=b.kind===0?mI(y,b.fieldPath,y.startAt):gI(y,b.fieldPath,y.startAt);D.push(T.value),M&&(M=T.inclusive)}return new Fs(D,M)})(l,c),m=(function(y,S){const D=[];let M=!0;for(const b of li(S)){const T=b.kind===0?gI(y,b.fieldPath,y.endAt):mI(y,b.fieldPath,y.endAt);D.push(T.value),M&&(M=T.inclusive)}return new Fs(D,M)})(l,c),_=this.On(c,l,f),E=this.On(c,l,m),v=this.Nn(c,l,d),O=this.Bn(c.indexId,h,_,f.inclusive,E,m.inclusive,v);return V.forEach(O,(N=>r.Y(N,n.limit).next((y=>{y.forEach((S=>{const D=X.fromSegments(S.documentKey);o.has(D)||(o=o.add(D),a.push(D))}))}))))})).next((()=>a))}return V.resolve(null)}))}Mn(e){let n=this.Fn.get(e);return n||(e.filters.length===0?n=[e]:n=aF(Be.create(e.filters,"and")).map((r=>Bp(e.path,e.collectionGroup,e.orderBy,r.getFilters(),e.limit,e.startAt,e.endAt))),this.Fn.set(e,n),n)}Bn(e,n,r,s,i,o,a){const c=(n!=null?n.length:1)*Math.max(r.length,i.length),l=c/(n!=null?n.length:1),h=[];for(let d=0;d<c;++d){const f=n?this.Ln(n[d/l]):ul,m=this.kn(e,f,r[d%l],s),_=this.qn(e,f,i[d%l],o),E=a.map((v=>this.kn(e,f,v,!0)));h.push(...this.createRange(m,_,E))}return h}kn(e,n,r,s){const i=new gi(e,X.empty(),n,r);return s?i:i.An()}qn(e,n,r,s){const i=new gi(e,X.empty(),n,r);return s?i.An():i}xn(e,n){const r=new VI(n),s=n.collectionGroup!=null?n.collectionGroup:n.path.lastSegment();return this.getFieldIndexes(e,s).next((i=>{let o=null;for(const a of i)r.yn(a)&&(!o||a.fields.length>o.fields.length)&&(o=a);return o}))}getIndexType(e,n){let r=2;const s=this.Mn(n);return V.forEach(s,(i=>this.xn(e,i).next((o=>{o?r!==0&&o.fields.length<(function(c){let l=new $e(et.comparator),h=!1;for(const d of c.filters)for(const f of d.getFlattenedFilters())f.field.isKeyField()||(f.op==="array-contains"||f.op==="array-contains-any"?h=!0:l=l.add(f.field));for(const d of c.orderBy)d.field.isKeyField()||(l=l.add(d.field));return l.size+(h?1:0)})(i)&&(r=1):r=0})))).next((()=>(function(o){return o.limit!==null})(n)&&s.length>1&&r===2?1:r))}Qn(e,n){const r=new tc;for(const s of li(e)){const i=n.data.field(s.fieldPath);if(i==null)return null;const o=r.Pn(s.kind);mi.Kt.Dt(i,o)}return r.un()}Ln(e){const n=new tc;return mi.Kt.Dt(e,n.Pn(0)),n.un()}$n(e,n){const r=new tc;return mi.Kt.Dt(Vi(this.databaseId,n),r.Pn((function(i){const o=li(i);return o.length===0?0:o[o.length-1].kind})(e))),r.un()}Nn(e,n,r){if(r===null)return[];let s=[];s.push(new tc);let i=0;for(const o of li(e)){const a=r[i++];for(const c of s)if(this.Un(n,o.fieldPath)&&nu(a))s=this.Kn(s,o,a);else{const l=c.Pn(o.kind);mi.Kt.Dt(a,l)}}return this.Wn(s)}On(e,n,r){return this.Nn(e,n,r.position)}Wn(e){const n=[];for(let r=0;r<e.length;++r)n[r]=e[r].un();return n}Kn(e,n,r){const s=[...e],i=[];for(const o of r.arrayValue.values||[])for(const a of s){const c=new tc;c.seed(a.un()),mi.Kt.Dt(o,c.Pn(n.kind)),i.push(c)}return i}Un(e,n){return!!e.filters.find((r=>r instanceof Pe&&r.field.isEqual(n)&&(r.op==="in"||r.op==="not-in")))}getFieldIndexes(e,n){const r=nc(e),s=fo(e);return(n?r.J(Op,IDBKeyRange.bound(n,n)):r.J()).next((i=>{const o=[];
28return V.forEach(i,(a=>s.get([a.indexId,this.uid]).next((c=>{o.push((function(h,d){const f=d?new Ho(d.sequenceNumber,new bn(Bi(d.readTime),new X(tr(d.documentKey)),d.largestBatchId)):Ho.empty(),m=h.fields.map((([_,E])=>new Ri(et.fromServerFormat(_),E)));return new qo(h.indexId,h.collectionGroup,m,f)})(a,c))})))).next((()=>o))}))}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next((n=>n.length===0?null:(n.sort(((r,s)=>{const i=r.indexState.sequenceNumber-s.indexState.sequenceNumber;return i!==0?i:_e(r.collectionGroup,s.collectionGroup)})),n[0].collectionGroup)))}updateCollectionGroup(e,n,r){const s=nc(e),i=fo(e);return this.Gn(e).next((o=>s.J(Op,IDBKeyRange.bound(n,n)).next((a=>V.forEach(a,(c=>i.put(CI(c.indexId,this.uid,o,r))))))))}updateIndexEntries(e,n){const r=new Map;return V.forEach(n,((s,i)=>{const o=r.get(s.collectionGroup);return(o?V.resolve(o):this.getFieldIndexes(e,s.collectionGroup)).next((a=>(r.set(s.collectionGroup,a),V.forEach(a,(c=>this.zn(e,s,c).next((l=>{const h=this.jn(i,c);return l.isEqual(h)?V.resolve():this.Jn(e,i,c,l,h)})))))))}))}
28Hn(e,n,r,s){return ho(e).put(s.Rn(this.uid,this.$n(r,n.key),n.key))}Yn(e,n,r,s){return ho(e).delete(s.Vn(this.uid,this.$n(r,n.key),n.key))}zn(e,n,r){const s=ho(e);let i=new $e(as);return s.ee({index:dA,range:IDBKeyRange.only([r.indexId,this.uid,Vl(this.$n(r,n))])},((o,a)=>{i=i.add(new gi(r.indexId,n,xI(a.arrayValue),xI(a.directionalValue)))})).next((()=>i))}jn(e,n){let r=new $e(as);const s=this.Qn(n,e);if(s==null)return r;const i=Np(n);if(i!=null){const o=e.data.field(i.fieldPath);if(nu(o))for(const a of o.arrayValue.values||[])r=r.add(new gi(n.indexId,e.key,this.Ln(a),s))}else r=r.add(new gi(n.indexId,e.key,ul,s));return r}Jn(e,n,r,s,i){H(MI,"Updating index entries for document '%s'",n.key);const o=[];return(function(c,l,h,d,f){const m=c.getIterator(),_=l.getIterator();let E=uo(m),v=uo(_);for(;E||v;){let O=!1,N=!1;if(E&&v){const y=h(E,v);y<0?N=!0:y>0&&(O=!0)}else E!=null?N=!0:O=!0;O?(d(v),v=uo(_)):N?(f(E),E=uo(m)):(E=uo(m),v=uo(_))}})(s,i,as,(a=>{o.push(this.Hn(e,n,r,a))}),(a=>{o.push(this.Yn(e,n,r,a))})),V.waitFor(o)}Gn(e){let n=1;return fo(e).ee({index:hA,reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},((r,s,i)=>{i.done(),n=s.sequenceNumber+1})).next((()=>n))}createRange(e,n,r){r=r.sort(((o,a)=>as(o,a))).filter(((o,a,c)=>!a||as(o,c[a-1])!==0));const s=[];
28s.push(e);for(const o of r){const a=as(o,e),c=as(o,n);if(a===0)s[0]=e.An();else if(a>0&&c<0)s.push(o),s.push(o.An());else if(c>0)break}s.push(n);const i=[];for(let o=0;o<s.length;o+=2){if(this.Zn(s[o],s[o+1]))return[];const a=s[o].Vn(this.uid,ul,X.empty()),c=s[o+1].Vn(this.uid,ul,X.empty());i.push(IDBKeyRange.bound(a,c))}return i}Zn(e,n){return as(e,n)>0}getMinOffsetFromCollectionGroup(e,n){return this.getFieldIndexes(e,n).next(UI)}getMinOffset(e,n){return V.mapArray(this.Mn(n),(r=>this.xn(e,r).next((s=>s||re(44426))))).next(UI)}}function FI(t){return Pt(t,Xc)}function ho(t){return Pt(t,Pc)}function nc(t){return Pt(t,eg)}function fo(t){return Pt(t,Sc)}function UI(t){ce(t.length!==0,28825);let e=t[0].indexState.offset,n=e.largestBatchId;for(let r=1;r<t.length;r++){const s=t[r].indexState.offset;Ym(s,e)<0&&(e=s),n<s.largestBatchId&&(n=s.largestBatchId)}return new bn(e.readTime,e.documentKey,n)}const BI={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},IR=41943040;class Kt{static withCacheSize(e){return new Kt(e,Kt.DEFAULT_COLLECTION_PERCENTILE,Kt.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}}function TR(t,e,n){const r=t.store(xn),s=t.store(Go),i=[],o=IDBKeyRange.only(n.batchId);let a=0;const c=r.ee({range:o},((h,d,f)=>(a++,f.delete())));i.push(c.next((()=>{ce(a===1,47070,{batchId:n.batchId})})));const l=[];for(const h of n.mutations){const d=cA(e,h.key.path,n.batchId);i.push(s.delete(d)),l.push(h.key)}return V.waitFor(i).next((()=>l))}function yh(t){if(!t)return 0;let e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw re(14731);e=t.noDocument}return JSON.stringify(e).length}Kt.DEFAULT_COLLECTION_PERCENTILE=10,Kt.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Kt.DEFAULT=new Kt(IR,Kt.DEFAULT_COLLECTION_PERCENTILE,Kt.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Kt.DISABLED=new Kt(-1,0,0);class dd{constructor(e,n,r,s){this.userId=e,this.serializer=n,this.indexManager=r,this.referenceDelegate=s,this.Xn={}}static wt(e,n,r,s){ce(e.uid!=="",64387);const i=e.isAuthenticated()?e.uid:"";return new dd(i,n,r,s)}checkEmpty(e){let n=!0;const r=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return cs(e).ee({index:Ei,range:r},((s,i,o)=>{n=!1,o.done()})).next((()=>n))}addMutationBatch(e,n,r,s){const i=Io(e),o=cs(e);return o.add({}).next((a=>{ce(typeof a=="number",49019);const c=new lg(a,n,r,s),l=(function(m,_,E){const v=E.baseMutations.map((N=>
vendor: 4,123 bytes, line 28
28iu(m.yt,N))),O=E.mutations.map((N=>iu(m.yt,N)));return{userId:_,batchId:E.batchId,localWriteTimeMs:E.localWriteTime.toMillis(),baseMutations:v,mutations:O}})(this.serializer,this.userId,c),h=[];let d=new $e(((f,m)=>_e(f.canonicalString(),m.canonicalString())));for(const f of s){const m=cA(this.userId,f.key.path,a);d=d.add(f.key.path.popLast()),h.push(o.put(l)),h.push(i.put(m,HL))}return d.forEach((f=>{h.push(this.indexManager.addToCollectionParentIndex(e,f))})),e.addOnCommittedListener((()=>{this.Xn[a]=c.keys()})),V.waitFor(h).next((()=>c))}))}lookupMutationBatch(e,n){return cs(e).get(n).next((r=>r?(ce(r.userId===this.userId,48,"Unexpected user for mutation batch",{userId:r.userId,batchId:n}),pi(this.serializer,r)):null))}er(e,n){return this.Xn[n]?V.resolve(this.Xn[n]):this.lookupMutationBatch(e,n).next((r=>{if(r){const s=r.keys();return this.Xn[n]=s,s}return null}))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,s=IDBKeyRange.lowerBound([this.userId,r]);let i=null;return cs(e).ee({index:Ei,range:s},((o,a,c)=>{a.userId===this.userId&&(ce(a.batchId>=r,47524,{tr:r}),i=pi(this.serializer,a)),c.done()})).next((()=>i))}getHighestUnacknowledgedBatchId(e){const n=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let r=Cs;return cs(e).ee({index:Ei,range:n,reverse:!0},((s,i,o)=>{r=i.batchId,o.done()})).next((()=>r))}getAllMutationBatches(e){const n=IDBKeyRange.bound([this.userId,Cs],[this.userId,Number.POSITIVE_INFINITY]);return cs(e).J(Ei,n).next((r=>r.map((s=>pi(this.serializer,s)))))}getAllMutationBatchesAffectingDocumentKey(e,n){const r=Pl(this.userId,n.path),s=IDBKeyRange.lowerBound(r),i=[];return Io(e).ee({range:s},((o,a,c)=>{const[l,h,d]=o,f=tr(h);if(l===this.userId&&n.path.isEqual(f))return cs(e).get(d).next((m=>{if(!m)throw re(61480,{nr:o,batchId:d});ce(m.userId===this.userId,10503,"Unexpected user for mutation batch",{userId:m.userId,batchId:d}),i.push(pi(this.serializer,m))}));c.done()})).next((()=>i))}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new $e(_e);const s=[];return n.forEach((i=>{const o=Pl(this.userId,i.path),a=IDBKeyRange.lowerBound(o),c=Io(e).ee({range:a},((l,h,d)=>{const[f,m,_]=l,E=tr(m);f===this.userId&&i.path.isEqual(E)?r=r.add(_):d.done()}));s.push(c)})),V.waitFor(s).next((()=>this.rr(e,r)))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,s=r.length+1,i=Pl(this.userId,r),o=IDBKeyRange.lowerBound(i);let a=new $e(_e);return Io(e).ee({range:o},((c,l,h)=>{const[d,f,m]=c,_=tr(f);d===this.userId&&r.isPrefixOf(_)?_.length===s&&(a=a.add(m)):h.done()})).next((()=>this.rr(e,a)))}rr(e,n){const r=[],s=[];return n.forEach((i=>{s.push(cs(e).get(i).next((o=>{if(o===null)throw re(35274,{batchId:i});ce(o.userId===this.userId,9748,"Unexpected user for mutation batch",{userId:o.userId,batchId:i}),r.push(pi(this.serializer,o))})))})),V.waitFor(s).next((()=>r))}removeMutationBatch(e,n){return TR(e.le,this.userId,n).next((r=>(e.addOnCommittedListener((()=>{this.ir(n.batchId)})),V.forEach(r,(s=>this.referenceDelegate.markPotentiallyOrphaned(e,s))))))}ir(e){delete this.Xn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next((n=>{if(!n)return V.resolve();const r=IDBKeyRange.lowerBound((function(o){return[o]})(this.userId)),s=[];return Io(e).ee({range:r},((i,o,a)=>{if(i[0]===this.userId){const c=tr(i[1]);s.push(c)}else a.done()})).next((()=>{ce(s.length===0,56720,{sr:s.map((i=>i.canonicalString()))})}))}))}containsKey(e,n){return wR(e,this.userId,n)}_r(e){return vR(e).get(this.userId).next((n=>n||{userId:this.userId,lastAcknowledgedBatchId:Cs,lastStreamToken:""}))}}function wR(t,e,n){const r=Pl(e,n.path),s=r[1],i=IDBKeyRange.lowerBound(r);let o=!1;return Io(t).ee({range:i,X:!0},((a,c,l)=>{const[h,d,f]=a;h===e&&d===s&&(o=!0),l.done()})).next((()=>o))}function cs(t){return Pt(t,xn)}function Io(t){return Pt(t,Go)}function vR(t){return Pt(t,Jc)}class ji{constructor(e){this.ar=e}next(){return this.ar+=2,this.ar}static ur(){return new ji(0)}static cr(){return new ji(-1)}}class lF{constructor(e,n){this.referenceDelegate=e,this.serializer=n}allocateTargetId(e){return this.lr(e).next((n=>{const r=new ji(n.highestTargetId);
28return n.highestTargetId=r.next(),this.hr(e,n).next((()=>n.highestTargetId))}))}getLastRemoteSnapshotVersion(e){return this.lr(e).next((n=>he.fromTimestamp(new Fe(n.lastRemoteSnapshotVersion.seconds,n.lastRemoteSnapshotVersion.nanoseconds))))}getHighestSequenceNumber(e){return this.lr(e).next((n=>n.highestListenSequenceNumber))}setTargetsMetadata(e,n,r){return this.lr(e).next((s=>(s.highestListenSequenceNumber=n,r&&(s.lastRemoteSnapshotVersion=r.toTimestamp()),n>s.highestListenSequenceNumber&&(s.highestListenSequenceNumber=n),this.hr(e,s))))}addTargetData(e,n){return this.Pr(e,n).next((()=>this.lr(e).next((r=>(r.targetCount+=1,this.Tr(n,r),this.hr(e,r))))))}updateTargetData(e,n){return this.Pr(e,n)}removeTargetData(e,n){return this.removeMatchingKeysForTargetId(e,n.targetId).next((()=>po(e).delete(n.targetId))).next((()=>this.lr(e))).next((r=>(ce(r.targetCount>0,8065),r.targetCount-=1,this.hr(e,r))))}removeTargets(e,n,r){let s=0;const i=[];return po(e).ee(((o,a)=>{const c=fc(a);c.sequenceNumber<=n&&r.get(c.targetId)===null&&(s++,i.push(this.removeTargetData(e,c)))})).next((()=>V.waitFor(i))).next((()=>s))}forEachTarget(e,n){return po(e).ee(((r,s)=>{const i=fc(s);n(i)}))}lr(e){return jI(e).get(dh).next((n=>(ce(n!==null,2888),n)))}hr(e,n){return jI(e).put(dh,n)}Pr(e,n){return po(e).put(_R(this.serializer,n))}Tr(e,n){let r=!1;return e.targetId>n.highestTargetId&&(n.highestTargetId=e.targetId,r=!0),e.sequenceNumber>n.highestListenSequenceNumber&&(n.highestListenSequenceNumber=e.sequenceNumber,r=!0),r}getTargetCount(e){return this.lr(e).next((n=>n.targetCount))}getTargetData(e,n){const r=Li(n),s=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]);let i=null;return po(e).ee({range:s,index:lA},((o,a,c)=>{const l=fc(a);vu(n,l.target)&&(i=l,c.done())})).next((()=>i))}addMatchingKeys(e,n,r){const s=[],i=ys(e);return n.forEach((o=>{const a=Jt(o.path);s.push(i.put({targetId:r,path:a})),s.push(this.referenceDelegate.addReference(e,r,o))})),V.waitFor(s)}removeMatchingKeys(e,n,r){const s=ys(e);return V.forEach(n,(i=>{const o=Jt(i.path);return V.waitFor([s.delete([r,o]),this.referenceDelegate.removeReference(e,r,i)])}))}removeMatchingKeysForTargetId(e,n){const r=ys(e),s=IDBKeyRange.bound([n],[n+1],!1,!0);return r.delete(s)}getMatchingKeysForTargetId(e,n){const r=IDBKeyRange.bound([n],[n+1],!1,!0),s=ys(e);let i=Ie();return s.ee({range:r,X:!0},((o,a,c)=>{const l=tr(o[1]),h=new X(l);i=i.add(h)})).next((()=>i))}containsKey(e,n){const r=Jt(n.path),s=IDBKeyRange.bound([r],[Xb(r)],!1,!0);let i=0;return ys(e).ee({index:Zm,X:!0,range:s},(([o,a],c,l)=>{o!==0&&(i++,l.done())})).next((()=>i>0))}At(e,n){return po(e).get(n).next((r=>r?fc(r):null))}}function po(t){return Pt(t,Wo)}function jI(t){return Pt(t,Si)}function ys(t){return Pt(t,Ko)}const $I="LruGarbageCollector",bR=1048576;function qI([t,e],[n,r]){const s=_e(t,n);return s===0?_e(e,r):s}class hF{constructor(e){this.Ir=e,this.buffer=new $e(qI),this.Er=0}dr(){return++this.Er}Ar(e){const n=[e,this.dr()];if(this.buffer.size<this.Ir)this.buffer=this.buffer.add(n);else{const r=this.buffer.last();qI(n,r)<0&&(this.buffer=this.buffer.delete(r).add(n))}}get maxValue(){return this.buffer.last()[0]}}class AR{constructor(e,n,r){this.garbageCollector=e,this.asyncQueue=n,this.localStore=r,this.Rr=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.Vr(6e4)}stop(){this.Rr&&(this.Rr.cancel(),this.Rr=null)}get started(){return this.Rr!==null}Vr(e){H($I,`Garbage collection scheduled in ${e}ms`),this.Rr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,(async()=>{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(n){qs(n)?H($I,"Ignoring IndexedDB error during garbage collection: ",n):await $s(n)}await this.Vr(3e5)}))}}class dF{constructor(e,n){this.mr=e,this.params=n}calculateTargetCount(e,n){return this.mr.gr(e).next((r=>Math.floor(n/100*r)))}nthSequenceNumber(e,n){if(n===0)return V.resolve(hn.ce);const r=new hF(n);return this.mr.forEachTarget(e,(s=>r.Ar(s.sequenceNumber))).next((()=>this.mr.pr(e,(s=>r.Ar(s))))).next((()=>r.maxValue))}removeTargets(e,n,r){return this.mr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.mr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(H("LruGarbageCollector","Garbage collection skipped; disabled"),V.resolve(BI)):this.getCacheSize(e).next((r=>r<this.params.cacheSizeCollectionThreshold?(H("LruGarbageCollector",`Garbage collection skipped; Cache size ${r} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),BI):this.yr(e,n)))}getCacheSize(e){return this.mr.getCacheSize(e)}yr(e,n){let r,s,i,o,a,c,l;const h=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next((d=>(d>this.params.maximumSequenceNumbersToCollect?(H("LruGarbageCollector",`C
28apping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${d}`),s=this.params.maximumSequenceNumbersToCollect):s=d,o=Date.now(),this.nthSequenceNumber(e,s)))).next((d=>(r=d,a=Date.now(),this.removeTargets(e,r,n)))).next((d=>(i=d,c=Date.now(),this.removeOrphanedDocuments(e,r)))).next((d=>(l=Date.now(),_o()<=Se.DEBUG&&H("LruGarbageCollector",`LRU Garbage Collection
29	Counted targets in ${o-h}ms
30	Determined least recently used ${s} in `+(a-o)+`ms
31	Removed ${i} targets in `+(c-a)+`ms
32	Removed ${d} documents in `+(l-c)+`ms
33Total Duration: ${l-h}ms`),V.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:i,documentsRemoved:d}))))}}function RR(t,e){return new dF(t,e)}class fF{constructor(e,n){this.db=e,this.garbageCollector=RR(this,n)}gr(e){const n=this.wr(e);return this.db.getTargetCache().getTargetCount(e).next((r=>n.next((s=>r+s))))}wr(e){let n=0;return this.pr(e,(r=>{n++})).next((()=>n))}forEachTarget(e,n){return this.db.getTargetCache().forEachTarget(e,n)}pr(e,n){return this.Sr(e,((r,s)=>n(s)))}addReference(e,n,r){return ll(e,r)}removeReference(e,n,r){return ll(e,r)}removeTargets(e,n,r){return this.db.getTargetCache().removeTargets(e,n,r)}markPotentiallyOrphaned(e,n){return ll(e,n)}br(e,n){return(function(s,i){let o=!1;return vR(s).te((a=>wR(s,a,i).next((c=>(c&&(o=!0),V.resolve(!c)))))).next((()=>o))})(e,n)}removeOrphanedDocuments(e,n){const r=this.db.getRemoteDocumentCache().newChangeBuffer(),s=[];let i=0;return this.Sr(e,((o,a)=>{if(a<=n){const c=this.br(e,o).next((l=>{if(!l)return i++,r.getEntry(e,o).next((()=>(r.removeEntry(o,he.min()),ys(e).delete((function(d){return[0,Jt(d.path)]})(o)))))}));s.push(c)}})).next((()=>V.waitFor(s))).next((()=>r.apply(e))).next((()=>i))}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,r)}updateLimboDocument(e,n){return ll(e,n)}Sr(e,n){const r=ys(e);let s,i=hn.ce;return r.ee({index:Zm},(([o,a],{path:c,sequenceNumber:l})=>{o===0?(i!==hn.ce&&n(new X(tr(s)),i),i=l,s=c):i=hn.ce})).next((()=>{i!==hn.ce&&n(new X(tr(s)),i)}))}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function ll(t,e){return ys(t).put((function(r,s){return{targetId:0,path:Jt(r.path),sequenceNumber:s}})(e,t.currentSequenceNumber))}class SR{constructor(){this.changes=new zr((e=>e.toString()),((e,n)=>e.isEqual(n))),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,Xe.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?V.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class pF{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,n,r){return oi(e).put(r)}removeEntry(e,n,r){return oi(e).delete((function(i,o){const a=i.path.toArray();return[a.slice(0,a.length-2),a[a.length-2],gh(o),a[a.length-1]]})(n,r))}updateMetadata(e,n){return this.getMetadata(e).next((r=>(r.byteSize+=n,this.Dr(e,r))))}getEntry(e,n){let r=Xe.newInvalidDocument(n);return oi(e).ee({index:Cl,range:IDBKeyRange.only(rc(n))},((s,i)=>{r=this.Cr(n,i)})).next((()=>r))}vr(e,n){let r={size:0,document:Xe.newInvalidDocument(n)};return oi(e).ee({index:Cl,range:IDBKeyRange.only(rc(n))},((s,i)=>{r={document:this.Cr(n,i),size:yh(i)}})).next((()=>r))}getEntries(e,n){let r=fn();return this.Fr(e,n,((s,i)=>{const o=this.Cr(s,i);r=r.insert(s,o)})).next((()=>r))}Mr(e,n){let r=fn(),s=new Je(X.comparator);return this.Fr(e,n,((i,o)=>{const a=this.Cr(i,o);r=r.insert(i,a),s=s.insert(i,yh(o))})).next((()=>({documents:r,Or:s})))}Fr(e,n,r){if(n.isEmpty())return V.resolve();let s=new $e(WI);n.forEach((c=>s=s.add(c)));const i=IDBKeyRange.bound(rc(s.first()),rc(s.last())),o=s.getIterator();let a=o.getNext();return oi(e).ee({index:Cl,range:i},((c,l,h)=>{const d=X.fromSegments([...l.prefixPath,l.collectionGroup,l.documentId]);for(;a&&WI(a,d)<0;)r(a,null),a=o.getNext();a&&a.isEqual(d)&&(r(a,l),a=o.hasNext()?o.getNext():null),a?h.j(rc(a)):h.done()})).next((()=>{for(;a;)r(a,null),a=o.hasNext()?o.getNext():null}))}getDocumentsMatchingQuery(e,n,r,s,i){const o=n.path,a=[o.popLast().toArray(),o.lastSegment(),gh(r.readTime),r.documentKey.path.isEmpty()?"":r.documentKey.path.lastSegment()],c=[o.popLast().toArray(),o.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return oi(e).J(IDBKeyRange.bound(a,c,!0)).next((l=>{i?.incrementDocumentReadCount(l.length);let h=fn();for(const d of l){const f=this.Cr(X.fromSegments(d.prefixPath.concat(d.collectionGroup,d.documentId)),d);
vendor: 4,374 bytes, line 33
33f.isFoundDocument()&&(Au(n,f)||s.has(f.key))&&(h=h.insert(f.key,f))}return h}))}getAllFromCollectionGroup(e,n,r,s){let i=fn();const o=GI(n,r),a=GI(n,bn.max());return oi(e).ee({index:uA,range:IDBKeyRange.bound(o,a,!0)},((c,l,h)=>{const d=this.Cr(X.fromSegments(l.prefixPath.concat(l.collectionGroup,l.documentId)),l);i=i.insert(d.key,d),i.size===s&&h.done()})).next((()=>i))}newChangeBuffer(e){return new mF(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next((n=>n.byteSize))}getMetadata(e){return HI(e).get(Dp).next((n=>(ce(!!n,20021),n)))}Dr(e,n){return HI(e).put(Dp,n)}Cr(e,n){if(n){const r=eF(this.serializer,n);if(!(r.isNoDocument()&&r.version.isEqual(he.min())))return r}return Xe.newInvalidDocument(e)}}function PR(t){return new pF(t)}class mF extends SR{constructor(e,n){super(),this.Nr=e,this.trackRemovals=n,this.Br=new zr((r=>r.toString()),((r,s)=>r.isEqual(s)))}applyChanges(e){const n=[];let r=0,s=new $e(((i,o)=>_e(i.canonicalString(),o.canonicalString())));return this.changes.forEach(((i,o)=>{const a=this.Br.get(i);if(n.push(this.Nr.removeEntry(e,i,a.readTime)),o.isValidDocument()){const c=SI(this.Nr.serializer,o);s=s.add(i.path.popLast());const l=yh(c);r+=l-a.size,n.push(this.Nr.addEntry(e,i,c))}else if(r-=a.size,this.trackRemovals){const c=SI(this.Nr.serializer,o.convertToNoDocument(he.min()));n.push(this.Nr.addEntry(e,i,c))}})),s.forEach((i=>{n.push(this.Nr.indexManager.addToCollectionParentIndex(e,i))})),n.push(this.Nr.updateMetadata(e,r)),V.waitFor(n)}getFromCache(e,n){return this.Nr.vr(e,n).next((r=>(this.Br.set(n,{size:r.size,readTime:r.document.readTime}),r.document)))}getAllFromCache(e,n){return this.Nr.Mr(e,n).next((({documents:r,Or:s})=>(s.forEach(((i,o)=>{this.Br.set(i,{size:o,readTime:r.get(i).readTime})})),r)))}}function HI(t){return Pt(t,Yc)}function oi(t){return Pt(t,hh)}function rc(t){const e=t.path.toArray();return[e.slice(0,e.length-2),e[e.length-2],e[e.length-1]]}function GI(t,e){const n=e.documentKey.path.toArray();return[t,gh(e.readTime),n.slice(0,n.length-2),n.length>0?n[n.length-1]:""]}function WI(t,e){const n=t.path.toArray(),r=e.path.toArray();let s=0;for(let i=0;i<n.length-2&&i<r.length-2;++i)if(s=_e(n[i],r[i]),s)return s;return s=_e(n.length,r.length),s||(s=_e(n[n.length-2],r[r.length-2]),s||_e(n[n.length-1],r[r.length-1]))}class gF{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}class CR{constructor(e,n,r,s){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=s}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next((s=>(r=s,this.remoteDocumentCache.getEntry(e,n)))).next((s=>(r!==null&&Nc(r.mutation,s,dn.empty(),Fe.now()),s)))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next((r=>this.getLocalViewOfDocuments(e,r,Ie()).next((()=>r))))}getLocalViewOfDocuments(e,n,r=Ie()){const s=nr();return this.populateOverlays(e,s,n).next((()=>this.computeViews(e,n,s,r).next((i=>{let o=hc();return i.forEach(((a,c)=>{o=o.insert(a,c.overlayedDocument)})),o}))))}getOverlayedDocuments(e,n){const r=nr();return this.populateOverlays(e,r,n).next((()=>this.computeViews(e,n,r,Ie())))}populateOverlays(e,n,r){const s=[];return r.forEach((i=>{n.has(i)||s.push(i)})),this.documentOverlayCache.getOverlays(e,s).next((i=>{i.forEach(((o,a)=>{n.set(o,a)}))}))}computeViews(e,n,r,s){let i=fn();const o=kc(),a=(function(){return kc()})();return n.forEach(((c,l)=>{const h=r.get(l.key);s.has(l.key)&&(h===void 0||h.mutation instanceof Qr)?i=i.insert(l.key,l):h!==void 0?(o.set(l.key,h.mutation.getFieldMask()),Nc(h.mutation,l,h.mutation.getFieldMask(),Fe.now())):o.set(l.key,dn.empty())})),this.recalculateAndSaveOverlays(e,i).next((c=>(c.forEach(((l,h)=>o.set(l,h))),n.forEach(((l,h)=>a.set(l,new gF(h,o.get(l)??null)))),a)))}recalculateAndSaveOverlays(e,n){const r=kc();let s=new Je(((o,a)=>o-a)),i=Ie();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next((o=>{for(const a of o)a.keys().forEach((c=>{const l=n.get(c);if(l===null)return;let h=r.get(c)||dn.empty();h=a.applyToLocalView(l,h),r.set(c,h);const d=(s.get(a.batchId)||Ie()).add(c);s=s.insert(a.batchId,d)}))})).next((()=>{const o=[],a=s.getReverseIterator();for(;a.hasNext();){const c=a.getNext(),l=c.key,h=c.value,d=HA();h.forEach((f=>{if(!i.has(f)){const m=YA(n.get(f),r.get(f));m!==null&&d.set(f,m),i=i.add(f)}}
33)),o.push(this.documentOverlayCache.saveOverlays(e,l,d))}return V.waitFor(o)})).next((()=>r))}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next((r=>this.recalculateAndSaveOverlays(e,r)))}getDocumentsMatchingQuery(e,n,r,s){return(function(o){return X.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0})(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):og(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,s):this.getDocumentsMatchingCollectionQuery(e,n,r,s)}getNextDocuments(e,n,r,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,s).next((i=>{const o=s-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,s-i.size):V.resolve(nr());let a=$o,c=i;return o.next((l=>V.forEach(l,((h,d)=>(a<d.largestBatchId&&(a=d.largestBatchId),i.get(h)?V.resolve():this.remoteDocumentCache.getEntry(e,h).next((f=>{c=c.insert(h,f)}))))).next((()=>this.populateOverlays(e,l,i))).next((()=>this.computeViews(e,c,l,Ie()))).next((h=>({batchId:a,changes:qA(h)})))))}))}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new X(n)).next((r=>{let s=hc();return r.isFoundDocument()&&(s=s.insert(r.key,r)),s}))}getDocumentsMatchingCollectionGroupQuery(e,n,r,s){const i=n.collectionGroup;let o=hc();return this.indexManager.getCollectionParents(e,i).next((a=>V.forEach(a,(c=>{const l=(function(d,f){return new Kr(f,null,d.explicitOrderBy.slice(),d.filters.slice(),d.limit,d.limitType,d.startAt,d.endAt)})(n,c.child(i));return this.getDocumentsMatchingCollectionQuery(e,l,r,s).next((h=>{h.forEach(((d,f)=>{o=o.insert(d,f)}))}))})).next((()=>o))))}getDocumentsMatchingCollectionQuery(e,n,r,s){let i;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next((o=>(i=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,i,s)))).next((o=>{i.forEach(((c,l)=>{const h=l.getKey();o.get(h)===null&&(o=o.insert(h,Xe.newInvalidDocument(h)))}));let a=hc();return o.forEach(((c,l)=>{const h=i.get(c);h!==void 0&&Nc(h.mutation,l,dn.empty(),Fe.now()),Au(n,l)&&(a=a.insert(c,l))})),a}))}}class _F{constructor(e){this.serializer=e,this.Lr=new Map,this.kr=new Map}getBundleMetadata(e,n){return V.resolve(this.Lr.get(n))}saveBundleMetadata(e,n){return this.Lr.set(n.id,(function(s){return{id:s.id,version:s.version,createTime:pt(s.createTime)}})(n)),V.resolve()}getNamedQuery(e,n){return V.resolve(this.kr.get(n))}saveNamedQuery(e,n){return this.kr.set(n.name,(function(s){return{name:s.name,query:ld(s.bundledQuery),readTime:pt(s.readTime)}})(n)),V.resolve()}}class yF{constructor(){this.overlays=new Je(X.comparator),this.qr=new Map}getOverlay(e,n){return V.resolve(this.overlays.get(n))}getOverlays(e,n){const r=nr();return V.forEach(n,(s=>this.getOverlay(e,s).next((i=>{i!==null&&r.set(s,i)})))).next((()=>r))}saveOverlays(e,n,r){return r.forEach(((s,i)=>{this.St(e,n,i)})),V.resolve()}removeOverlaysForBatchId(e,n,r){const s=this.qr.get(r);return s!==void 0&&(s.forEach((i=>this.overlays=this.overlays.remove(i))),this.qr.delete(r)),V.resolve()}getOverlaysForCollection(e,n,r){const s=nr(),i=n.length+1,o=new X(n.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const c=a.getNext().value,l=c.getKey();if(!n.isPrefixOf(l.path))break;l.path.length===i&&c.largestBatchId>r&&s.set(c.getKey(),c)}return V.resolve(s)}getOverlaysForCollectionGroup(e,n,r,s){let i=new Je(((l,h)=>l-h));const o=this.overlays.getIterator();for(;o.hasNext();){const l=o.getNext().value;if(l.getKey().getCollectionGroup()===n&&l.largestBatchId>r){let h=i.get(l.largestBatchId);h===null&&(h=nr(),i=i.insert(l.largestBatchId,h)),h.set(l.getKey(),l)}}const a=nr(),c=i.getIterator();for(;c.hasNext()&&(c.getNext().value.forEach(((l,h)=>a.set(l,h))),!(a.size()>=s)););return V.resolve(a)}St(e,n,r){const s=this.overlays.get(r.key);if(s!==null){const o=this.qr.get(s.largestBatchId).delete(r.key);this.qr.set(s.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new dg(n,r));let i=this.qr.get(n);i===void 0&&(i=Ie(),this.qr.set(n,i)),this.qr.set(n,i.add(r.key))}}class EF{constructor(){this.sessionToken=ct.EMPTY_BYTE_STRING}getSessionToken(e){return V.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,V.resolve()}}class _g{constructor(){this.Qr=new $e(kt.$r),this.Ur=new $e(kt.Kr)}isEmpty(){return this.Qr.isEmpty()}addReference(e,n){const r=new kt(e,n);this.Qr=this.Qr.add(r),this.Ur=this.Ur.add(r)}Wr(e,n){e.forEach((r=>this.addReference(r,n)))}removeReference(e,n){this.Gr(new kt(e,n))}zr(e,n){e.forEach((r=>this.removeReference(r,n)))}jr(e){const n=new X(new be([])),r=new kt(n,e),s=new kt(n,e+1),i=[];return this.Ur.forEachInRange([r,s],(o=>{this.Gr(o),i.push(o.key)})),i}Jr(){this.Qr.forEach((e=>this.Gr(e)))}Gr(e){this.Qr=this.Qr.delete(e),this.Ur=this.Ur.delete(e)}Hr(e){const n=new X(new be([])),r=new kt(n,e),s=new kt(n,e+1);let i=Ie();return this.Ur.forEachInRange([r,s],(o=>{i=i.add(o.key)})),i}containsKey(e){const n=new kt(e,0),r=this.Qr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class kt{constructor(e,n){this.key=e,this.Yr=n}
33static $r(e,n){return X.comparator(e.key,n.key)||_e(e.Yr,n.Yr)}static Kr(e,n){return _e(e.Yr,n.Yr)||X.comparator(e.key,n.key)}}class IF{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.tr=1,this.Zr=new $e(kt.$r)}checkEmpty(e){return V.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,s){const i=this.tr;this.tr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new lg(i,n,r,s);this.mutationQueue.push(o);for(const a of s)this.Zr=this.Zr.add(new kt(a.key,i)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return V.resolve(o)}lookupMutationBatch(e,n){return V.resolve(this.Xr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,s=this.ei(r),i=s<0?0:s;return V.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return V.resolve(this.mutationQueue.length===0?Cs:this.tr-1)}getAllMutationBatches(e){return V.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new kt(n,0),s=new kt(n,Number.POSITIVE_INFINITY),i=[];return this.Zr.forEachInRange([r,s],(o=>{const a=this.Xr(o.Yr);i.push(a)})),V.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new $e(_e);return n.forEach((s=>{const i=new kt(s,0),o=new kt(s,Number.POSITIVE_INFINITY);this.Zr.forEachInRange([i,o],(a=>{r=r.add(a.Yr)}))})),V.resolve(this.ti(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,s=r.length+1;let i=r;X.isDocumentKey(i)||(i=i.child(""));const o=new kt(new X(i),0);let a=new $e(_e);return this.Zr.forEachWhile((c=>{const l=c.key.path;return!!r.isPrefixOf(l)&&(l.length===s&&(a=a.add(c.Yr)),!0)}),o),V.resolve(this.ti(a))}ti(e){const n=[];return e.forEach((r=>{const s=this.Xr(r);s!==null&&n.push(s)})),n}removeMutationBatch(e,n){ce(this.ni(n.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Zr;return V.forEach(n.mutations,(s=>{const i=new kt(s.key,n.batchId);return r=r.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)})).next((()=>{this.Zr=r}))}ir(e){}containsKey(e,n){const r=new kt(n,0),s=this.Zr.firstAfterOrEqual(r);return V.resolve(n.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,V.resolve()}ni(e,n){return this.ei(e)}ei(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Xr(e){const n=this.ei(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}class TF{constructor(e){this.ri=e,this.docs=(function(){return new Je(X.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,s=this.docs.get(r),i=s?s.size:0,o=this.ri(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-i,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return V.resolve(r?r.document.mutableCopy():Xe.newInvalidDocument(n))}getEntries(e,n){let r=fn();return n.forEach((s=>{const i=this.docs.get(s);r=r.insert(s,i?i.document.mutableCopy():Xe.newInvalidDocument(s))})),V.resolve(r)}getDocumentsMatchingQuery(e,n,r,s){let i=fn();const o=n.path,a=new X(o.child("__id-9223372036854775808__")),c=this.docs.getIteratorFrom(a);for(;c.hasNext();){const{key:l,value:{document:h}}=c.getNext();if(!o.isPrefixOf(l.path))break;l.path.length>o.length+1||Ym(rA(h),r)<=0||(s.has(h.key)||Au(n,h))&&(i=i.insert(h.key,h.mutableCopy()))}return V.resolve(i)}getAllFromCollectionGroup(e,n,r,s){re(9500)}ii(e,n){return V.forEach(this.docs,(r=>n(r)))}newChangeBuffer(e){return new wF(this)}getSize(e){return V.resolve(this.size)}}class wF extends SR{constructor(e){super(),this.Nr=e}applyChanges(e){const n=[];
vendor: 4,101 bytes, line 33
33return this.changes.forEach(((r,s)=>{s.isValidDocument()?n.push(this.Nr.addEntry(e,s)):this.Nr.removeEntry(r)})),V.waitFor(n)}getFromCache(e,n){return this.Nr.getEntry(e,n)}getAllFromCache(e,n){return this.Nr.getEntries(e,n)}}class vF{constructor(e){this.persistence=e,this.si=new zr((n=>Li(n)),vu),this.lastRemoteSnapshotVersion=he.min(),this.highestTargetId=0,this.oi=0,this._i=new _g,this.targetCount=0,this.ai=ji.ur()}forEachTarget(e,n){return this.si.forEach(((r,s)=>n(s))),V.resolve()}getLastRemoteSnapshotVersion(e){return V.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return V.resolve(this.oi)}allocateTargetId(e){return this.highestTargetId=this.ai.next(),V.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.oi&&(this.oi=n),V.resolve()}Pr(e){this.si.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.ai=new ji(n),this.highestTargetId=n),e.sequenceNumber>this.oi&&(this.oi=e.sequenceNumber)}addTargetData(e,n){return this.Pr(n),this.targetCount+=1,V.resolve()}updateTargetData(e,n){return this.Pr(n),V.resolve()}removeTargetData(e,n){return this.si.delete(n.target),this._i.jr(n.targetId),this.targetCount-=1,V.resolve()}removeTargets(e,n,r){let s=0;const i=[];return this.si.forEach(((o,a)=>{a.sequenceNumber<=n&&r.get(a.targetId)===null&&(this.si.delete(o),i.push(this.removeMatchingKeysForTargetId(e,a.targetId)),s++)})),V.waitFor(i).next((()=>s))}getTargetCount(e){return V.resolve(this.targetCount)}getTargetData(e,n){const r=this.si.get(n)||null;return V.resolve(r)}addMatchingKeys(e,n,r){return this._i.Wr(n,r),V.resolve()}removeMatchingKeys(e,n,r){this._i.zr(n,r);const s=this.persistence.referenceDelegate,i=[];return s&&n.forEach((o=>{i.push(s.markPotentiallyOrphaned(e,o))})),V.waitFor(i)}removeMatchingKeysForTargetId(e,n){return this._i.jr(n),V.resolve()}getMatchingKeysForTargetId(e,n){const r=this._i.Hr(n);return V.resolve(r)}containsKey(e,n){return V.resolve(this._i.containsKey(n))}}class yg{constructor(e,n){this.ui={},this.overlays={},this.ci=new hn(0),this.li=!1,this.li=!0,this.hi=new EF,this.referenceDelegate=e(this),this.Pi=new vF(this),this.indexManager=new cF,this.remoteDocumentCache=(function(s){return new TF(s)})((r=>this.referenceDelegate.Ti(r))),this.serializer=new gR(n),this.Ii=new _F(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.li=!1,Promise.resolve()}get started(){return this.li}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new yF,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ui[e.toKey()];return r||(r=new IF(n,this.referenceDelegate),this.ui[e.toKey()]=r),r}getGlobalsCache(){return this.hi}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ii}runTransaction(e,n,r){H("MemoryPersistence","Starting transaction:",e);const s=new bF(this.ci.next());return this.referenceDelegate.Ei(),r(s).next((i=>this.referenceDelegate.di(s).next((()=>i)))).toPromise().then((i=>(s.raiseOnCommittedEvent(),i)))}Ai(e,n){return V.or(Object.values(this.ui).map((r=>()=>r.containsKey(e,n))))}}class bF extends iA{constructor(e){super(),this.currentSequenceNumber=e}}class fd{constructor(e){this.persistence=e,this.Ri=new _g,this.Vi=null}static mi(e){return new fd(e)}get fi(){if(this.Vi)return this.Vi;throw re(60996)}addReference(e,n,r){return this.Ri.addReference(r,n),this.fi.delete(r.toString()),V.resolve()}removeReference(e,n,r){return this.Ri.removeReference(r,n),this.fi.add(r.toString()),V.resolve()}markPotentiallyOrphaned(e,n){return this.fi.add(n.toString()),V.resolve()}removeTarget(e,n){this.Ri.jr(n.targetId).forEach((s=>this.fi.add(s.toString())));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next((s=>{s.forEach((i=>this.fi.add(i.toString())))})).next((()=>r.removeTargetData(e,n)))}Ei(){this.Vi=new Set}di(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();
33return V.forEach(this.fi,(r=>{const s=X.fromPath(r);return this.gi(e,s).next((i=>{i||n.removeEntry(s,he.min())}))})).next((()=>(this.Vi=null,n.apply(e))))}updateLimboDocument(e,n){return this.gi(e,n).next((r=>{r?this.fi.delete(n.toString()):this.fi.add(n.toString())}))}Ti(e){return 0}gi(e,n){return V.or([()=>V.resolve(this.Ri.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ai(e,n)])}}class Eh{constructor(e,n){this.persistence=e,this.pi=new zr((r=>Jt(r.path)),((r,s)=>r.isEqual(s))),this.garbageCollector=RR(this,n)}static mi(e,n){return new Eh(e,n)}Ei(){}di(e){return V.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}gr(e){const n=this.wr(e);return this.persistence.getTargetCache().getTargetCount(e).next((r=>n.next((s=>r+s))))}wr(e){let n=0;return this.pr(e,(r=>{n++})).next((()=>n))}pr(e,n){return V.forEach(this.pi,((r,s)=>this.br(e,r,s).next((i=>i?V.resolve():n(s)))))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0;const s=this.persistence.getRemoteDocumentCache(),i=s.newChangeBuffer();return s.ii(e,(o=>this.br(e,o,n).next((a=>{a||(r++,i.removeEntry(o,he.min()))})))).next((()=>i.apply(e))).next((()=>r))}markPotentiallyOrphaned(e,n){return this.pi.set(n,e.currentSequenceNumber),V.resolve()}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),V.resolve()}removeReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),V.resolve()}updateLimboDocument(e,n){return this.pi.set(n,e.currentSequenceNumber),V.resolve()}Ti(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=Nl(e.data.value)),n}br(e,n,r){return V.or([()=>this.persistence.Ai(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{const s=this.pi.get(n);return V.resolve(s!==void 0&&s>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class AF{constructor(e){this.serializer=e}k(e,n,r,s){const i=new Zh("createOrUpgrade",n);r<1&&s>=1&&((function(c){c.createObjectStore(wu)})(e),(function(c){c.createObjectStore(Jc,{keyPath:qL}),c.createObjectStore(xn,{keyPath:rI,autoIncrement:!0}).createIndex(Ei,sI,{unique:!0}),c.createObjectStore(Go)})(e),KI(e),(function(c){c.createObjectStore(hi)})(e));let o=V.resolve();return r<3&&s>=3&&(r!==0&&((function(c){c.deleteObjectStore(Ko),c.deleteObjectStore(Wo),c.deleteObjectStore(Si)})(e),KI(e)),o=o.next((()=>(function(c){const l=c.store(Si),h={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:he.min().toTimestamp(),targetCount:0};return l.put(dh,h)})(i)))),r<4&&s>=4&&(r!==0&&(o=o.next((()=>(function(c,l){return l.store(xn).J().next((d=>{c.deleteObjectStore(xn),c.createObjectStore(xn,{keyPath:rI,autoIncrement:!0}).createIndex(Ei,sI,{unique:!0});const f=l.store(xn),m=d.map((_=>f.put(_)));return V.waitFor(m)}))})(e,i)))),o=o.next((()=>{(function(c){c.createObjectStore(zo,{keyPath:XL})})(e)}))),r<5&&s>=5&&(o=o.next((()=>this.yi(i)))),r<6&&s>=6&&(o=o.next((()=>((function(c){c.createObjectStore(Yc)})(e),this.wi(i))))),r<7&&s>=7&&(o=o.next((()=>this.Si(i)))),r<8&&s>=8&&(o=o.next((()=>this.bi(e,i)))),r<9&&s>=9&&(o=o.next((()=>{(function(c){c.objectStoreNames.contains("remoteDocumentChanges")&&c.deleteObjectStore("remoteDocumentChanges")})(e)}))),r<10&&s>=10&&(o=o.next((()=>this.Di(i)))),r<11&&s>=11&&(o=o.next((()=>{(function(c){c.createObjectStore(ed,{keyPath:ZL})})(e),(function(c){c.createObjectStore(td,{keyPath:eM})})(e)}))),r<12&&s>=12&&(o=o.next((()=>{(function(c){const l=c.createObjectStore(nd,{keyPath:aM});l.createIndex(xp,cM,{unique:!1}),l.createIndex(fA,uM,{unique:!1})})(e)}))),r<13&&s>=13&&(o=o.next((()=>(function(c){const l=c.createObjectStore(hh,{keyPath:GL});l.createIndex(Cl,WL),l.createIndex(uA,KL)})(e))).next((()=>this.Ci(e,i))).next((()=>e.deleteObjectStore(hi)))),r<14&&s>=14&&(o=o.next((()=>this.Fi(e,i)))),r<15&&s>=15&&(o=o.next((()=>(function(c){c.createObjectStore(eg,{keyPath:tM,autoIncrement:!0}).createIndex(Op,nM,{unique:!1}),c.createObjectStore(Sc,{keyPath:rM}).createIndex(hA,sM,{unique:!1}),c.createObjectStore(Pc,{keyPath:iM}).createIndex(dA,oM,{unique:!1})})(e)))),r<16&&s>=16&&(o=o.next((()=>{n.objectStore(Sc).clear()}
vendor: 4,186 bytes, line 33
33)).next((()=>{n.objectStore(Pc).clear()}))),r<17&&s>=17&&(o=o.next((()=>{(function(c){c.createObjectStore(tg,{keyPath:lM})})(e)}))),r<18&&s>=18&&Mb()&&(o=o.next((()=>{n.objectStore(Sc).clear()})).next((()=>{n.objectStore(Pc).clear()}))),o}wi(e){let n=0;return e.store(hi).ee(((r,s)=>{n+=yh(s)})).next((()=>{const r={byteSize:n};return e.store(Yc).put(Dp,r)}))}yi(e){const n=e.store(Jc),r=e.store(xn);return n.J().next((s=>V.forEach(s,(i=>{const o=IDBKeyRange.bound([i.userId,Cs],[i.userId,i.lastAcknowledgedBatchId]);return r.J(Ei,o).next((a=>V.forEach(a,(c=>{ce(c.userId===i.userId,18650,"Cannot process batch from unexpected user",{batchId:c.batchId});const l=pi(this.serializer,c);return TR(e,i.userId,l).next((()=>{}))}))))}))))}Si(e){const n=e.store(Ko),r=e.store(hi);return e.store(Si).get(dh).next((s=>{const i=[];return r.ee(((o,a)=>{const c=new be(o),l=(function(d){return[0,Jt(d)]})(c);i.push(n.get(l).next((h=>h?V.resolve():(d=>n.put({targetId:0,path:Jt(d),sequenceNumber:s.highestListenSequenceNumber}))(c))))})).next((()=>V.waitFor(i)))}))}bi(e,n){e.createObjectStore(Xc,{keyPath:YL});const r=n.store(Xc),s=new gg,i=o=>{if(s.add(o)){const a=o.lastSegment(),c=o.popLast();return r.put({collectionId:a,parent:Jt(c)})}};return n.store(hi).ee({X:!0},((o,a)=>{const c=new be(o);return i(c.popLast())})).next((()=>n.store(Go).ee({X:!0},(([o,a,c],l)=>{const h=tr(a);return i(h.popLast())}))))}Di(e){const n=e.store(Wo);return n.ee(((r,s)=>{const i=fc(s),o=_R(this.serializer,i);return n.put(o)}))}Ci(e,n){const r=n.store(hi),s=[];return r.ee(((i,o)=>{const a=n.store(hh),c=(function(d){return d.document?new X(be.fromString(d.document.name).popFirst(5)):d.noDocument?X.fromSegments(d.noDocument.path):d.unknownDocument?X.fromSegments(d.unknownDocument.path):re(36783)})(o).path.toArray(),l={prefixPath:c.slice(0,c.length-2),collectionGroup:c[c.length-2],documentId:c[c.length-1],readTime:o.readTime||[0,0],unknownDocument:o.unknownDocument,noDocument:o.noDocument,document:o.document,hasCommittedMutations:!!o.hasCommittedMutations};s.push(a.put(l))})).next((()=>V.waitFor(s)))}Fi(e,n){const r=n.store(xn),s=PR(this.serializer),i=new yg(fd.mi,this.serializer.yt);return r.J().next((o=>{const a=new Map;return o.forEach((c=>{let l=a.get(c.userId)??Ie();pi(this.serializer,c).keys().forEach((h=>l=l.add(h))),a.set(c.userId,l)})),V.forEach(a,((c,l)=>{const h=new Nt(l),d=hd.wt(this.serializer,h),f=i.getIndexManager(h),m=dd.wt(h,this.serializer,f,i.referenceDelegate);return new CR(s,m,d,f).recalculateAndSaveOverlaysForDocumentKeys(new Vp(n,hn.ce),c).next()}))}))}}function KI(t){t.createObjectStore(Ko,{keyPath:QL}).createIndex(Zm,JL,{unique:!0}),t.createObjectStore(Wo,{keyPath:"targetId"}).createIndex(lA,zL,{unique:!0}),t.createObjectStore(Si)}const us="IndexedDbPersistence",Af=18e5,Rf=5e3,Sf="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",kR="main";class Eg{constructor(e,n,r,s,i,o,a,c,l,h,d=18){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Mi=i,this.window=o,this.document=a,this.xi=l,this.Oi=h,this.Ni=d,this.ci=null,this.li=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Bi=null,this.inForeground=!1,this.Li=null,this.ki=null,this.qi=Number.NEGATIVE_INFINITY,this.Qi=f=>Promise.resolve(),!Eg.v())throw new $(F.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new fF(this,s),this.$i=n+kR,this.serializer=new gR(c),this.Ui=new ir(this.$i,this.Ni,new AF(this.serializer)),this.hi=new nF,this.Pi=new lF(this.referenceDelegate,this.serializer),this.remoteDocumentCache=PR(this.serializer),this.Ii=new tF,this.window&&this.window.localStorage?this.Ki=this.window.localStorage:(this.Ki=null,h===!1&&ft(us,"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.Wi().then((()=>
33{if(!this.isPrimary&&!this.allowTabSynchronization)throw new $(F.FAILED_PRECONDITION,Sf);return this.Gi(),this.zi(),this.ji(),this.runTransaction("getHighestListenSequenceNumber","readonly",(e=>this.Pi.getHighestSequenceNumber(e)))})).then((e=>{this.ci=new hn(e,this.xi)})).then((()=>{this.li=!0})).catch((e=>(this.Ui&&this.Ui.close(),Promise.reject(e))))}Ji(e){return this.Qi=async n=>{if(this.started)return e(n)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.Ui.$((async n=>{n.newVersion===null&&await e()}))}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.Mi.enqueueAndForget((async()=>{this.started&&await this.Wi()})))}Wi(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(e=>hl(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next((()=>{if(this.isPrimary)return this.Hi(e).next((n=>{n||(this.isPrimary=!1,this.Mi.enqueueRetryable((()=>this.Qi(!1))))}))})).next((()=>this.Yi(e))).next((n=>this.isPrimary&&!n?this.Zi(e).next((()=>!1)):!!n&&this.Xi(e).next((()=>!0)))))).catch((e=>{if(qs(e))return H(us,"Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return H(us,"Releasing owner lease after error during lease refresh",e),!1})).then((e=>{this.isPrimary!==e&&this.Mi.enqueueRetryable((()=>this.Qi(e))),this.isPrimary=e}))}Hi(e){return sc(e).get(co).next((n=>V.resolve(this.es(n))))}ts(e){return hl(e).delete(this.clientId)}async ns(){if(this.isPrimary&&!this.rs(this.qi,Af)){this.qi=Date.now();const e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(n=>{const r=Pt(n,zo);return r.J().next((s=>{const i=this.ss(s,Af),o=s.filter((a=>i.indexOf(a)===-1));return V.forEach(o,(a=>r.delete(a.clientId))).next((()=>o))}))})).catch((()=>[]));if(this.Ki)for(const n of e)this.Ki.removeItem(this._s(n.clientId))}}ji(){this.ki=this.Mi.enqueueAfterDelay("client_metadata_refresh",4e3,(()=>this.Wi().then((()=>this.ns())).then((()=>this.ji()))))}es(e){return!!e&&e.ownerId===this.clientId}Yi(e){return this.Oi?V.resolve(!0):sc(e).get(co).next((n=>{if(n!==null&&this.rs(n.leaseTimestampMs,Rf)&&!this.us(n.ownerId)){if(this.es(n)&&this.networkEnabled)return!0;if(!this.es(n)){if(!n.allowTabSynchronization)throw new $(F.FAILED_PRECONDITION,Sf);return!1}}return!(!this.networkEnabled||!this.inForeground)||hl(e).J().next((r=>this.ss(r,Rf).find((s=>{if(this.clientId!==s.clientId){const i=!this.networkEnabled&&s.networkEnabled,o=!this.inForeground&&s.inForeground,a=this.networkEnabled===s.networkEnabled;if(i||o&&a)return!0}return!1}))===void 0))})).next((n=>(this.isPrimary!==n&&H(us,`Client ${n?"is":"is not"} eligible for a primary lease.`),n)))}async shutdown(){this.li=!1,this.cs(),this.ki&&(this.ki.cancel(),this.ki=null),this.ls(),this.hs(),await this.Ui.runTransaction("shutdown","readwrite",[wu,zo],(e=>{const n=new Vp(e,hn.ce);return this.Zi(n).next((()=>this.ts(n)))})),this.Ui.close(),this.Ps()}ss(e,n){return e.filter((r=>this.rs(r.updateTimeMs,n)&&!this.us(r.clientId)))}Ts(){return this.runTransaction("getActiveClients","readonly",(e=>hl(e).J().next((n=>this.ss(n,Af).map((r=>r.clientId))))))}get started(){return this.li}getGlobalsCache(){return this.hi}getMutationQueue(e,n){return dd.wt(e,this.serializer,n,this.referenceDelegate)}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new uF(e,this.serializer.yt.databaseId)}getDocumentOverlayCache(e){return hd.wt(this.serializer,e)}getBundleCache(){return this.Ii}runTransaction(e,n,r){H(us,"Starting transaction:",e);const s=n==="readonly"?"readonly":"readwrite",i=(function(c){return c===18?fM:c===17?_A:c===16?dM:c===15?ng:c===14?gA:c===13?mA:c===12?hM:c===11?pA:void re(60245)})(this.Ni);let o;return this.Ui.runTransaction(e,s,i,(a=>(o=new Vp(a,this.ci?this.ci.next():hn.ce),n==="readwrite-primary"?this.Hi(o).next((c=>!!c||this.Yi(o))).next((c=>{if(!c)throw ft(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Mi.enqueueRetryable((()=>this.Qi(!1))),new $(F.FAILED_PRECONDITION,sA);return r(o)})).next((c=>this.Xi(o).next((()=>c)))):this.Is(o).next((()=>r(o)))))).then((a=>(o.raiseOnCommittedEvent(),a)))}Is(e){return sc(e).get(co).next((n=>{if(n!==null&&this.rs(n.leaseTimestampMs,Rf)&&!this.us(n.ownerId)&&!this.es(n)&&!(this.Oi||this.allowTabSynchronization&&n.allowTabSynchronization))throw new $(F.FAILED_PRECONDITION,Sf)}))}Xi(e){const n={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return sc(e).put(co,n)}static v(){return ir.v()}Zi(e){const n=sc(e);return n.get(co).next((r=>this.es(r)?(H(us,"Releasing primary lease."),n.delete(co)):V.resolve()))}rs(e,n){const r=Date.now();return!(e<r-n)&&(!(e>r)||(ft(`Detected an update time that is in the future: ${e} > ${r}`),!1))}Gi(){this.document!==null&&typeof this.document.addEventListener=="function"&&(this.Li=()=>{this.Mi.enqueueAndForget((()=>(this.inForeground=this.document.visibilityState==="visible",this.Wi())))},this.document.addEventListener("visibilitychange",this.Li),this.inForeground=this.document.visibilityState==="visible")}ls(){this.Li&&(this.document.removeEventListener("visibilitychange",this.Li),this.Li=null)}zi(){typeof this.window?.addEventListener=="function"&&(this.Bi=()=>{this.cs();const e=/(?:Version|Mobile)\/1[456]/;Lb()&&(navigator.appVersion.match(e)||navigator.userAgent.match(e))&&this.Mi.enterRestrictedMode(!0),this.Mi.enqueueAndForget((()=>this.shutdown()))},this.window.addEventListener("pagehide",this.Bi))}hs(){this.Bi&&(this.window.removeEventListener("pagehide",this.Bi),this.Bi=null)}us(e){try{const n=this.Ki?.getItem(this._s(e))!==null;return H(us,`Client '${e}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(n){return ft(us,"Failed to get zombied client id.",n),!1}}cs(){if(this.Ki)try{this.Ki.setItem(this._s(this.clientId),String(Date.now()))}catch(e){ft("Failed to set zombie client id.",e)}}Ps(){if(this.Ki)try{this.Ki.removeItem(this._s(this.clientId))}catch{}}_s(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function sc(t){return Pt(t,wu)}function hl(t){return Pt(t,zo)}function Ig(t,e){let n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}class Tg{constructor(e,n,r,s){this.targetId=e,this.fromCache=n,this.Es=r,this.ds=s}static As(e,n){let r=Ie(),s=Ie();for(const i of n.docChanges)switch(i.type){case 0:r=r.add(i.doc.key);break;case 1:s=s.add(i.doc.key)}return new Tg(e,n.fromCache,r,s)}}class RF{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class NR{constructor(){this.Rs=!1,this.Vs=!1,this.fs=100,this.gs=(function(){return Lb()?8:oA(At()
33)>0?6:4})()}initialize(e,n){this.ps=e,this.indexManager=n,this.Rs=!0}getDocumentsMatchingQuery(e,n,r,s){const i={result:null};return this.ys(e,n).next((o=>{i.result=o})).next((()=>{if(!i.result)return this.ws(e,n,s,r).next((o=>{i.result=o}))})).next((()=>{if(i.result)return;const o=new RF;return this.Ss(e,n,o).next((a=>{if(i.result=a,this.Vs)return this.bs(e,n,o,a.size)}))})).next((()=>i.result))}bs(e,n,r,s){return r.documentReadCount<this.fs?(_o()<=Se.DEBUG&&H("QueryEngine","SDK will not create cache indexes for query:",yo(n),"since it only creates cache indexes for collection contains","more than or equal to",this.fs,"documents"),V.resolve()):(_o()<=Se.DEBUG&&H("QueryEngine","Query:",yo(n),"scans",r.documentReadCount,"local documents and returns",s,"documents as results."),r.documentReadCount>this.gs*s?(_o()<=Se.DEBUG&&H("QueryEngine","The SDK decides to create cache indexes for query:",yo(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Yt(n))):V.resolve())}ys(e,n){if(_I(n))return V.resolve(null);let r=Yt(n);return this.indexManager.getIndexType(e,r).next((s=>s===0?null:(n.limit!==null&&s===1&&(n=mh(n,null,"F"),r=Yt(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next((i=>{const o=Ie(...i);return this.ps.getDocuments(e,o).next((a=>this.indexManager.getMinOffset(e,r).next((c=>{const l=this.Ds(n,a);return this.Cs(n,l,o,c.readTime)?this.ys(e,mh(n,null,"F")):this.vs(e,l,n,c)}))))})))))}ws(e,n,r,s){return _I(n)||s.isEqual(he.min())?V.resolve(null):this.ps.getDocuments(e,r).next((i=>{const o=this.Ds(n,i);return this.Cs(n,o,r,s)?V.resolve(null):(_o()<=Se.DEBUG&&H("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),yo(n)),this.vs(e,o,n,nA(s,$o)).next((a=>a)))}))}Ds(e,n){let r=new $e(jA(e));return n.forEach(((s,i)=>{Au(e,i)&&(r=r.add(i))})),r}Cs(e,n,r,s){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const i=e.limitType==="F"?n.last():n.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(s)>0)}Ss(e,n,r){return _o()<=Se.DEBUG&&H("QueryEngine","Using full collection scan to execute query:",yo(n)),this.ps.getDocumentsMatchingQuery(e,n,bn.min(),r)}vs(e,n,r,s){return this.ps.getDocumentsMatchingQuery(e,r,s).next((i=>(n.forEach((o=>{i=i.insert(o.key,o)})),i)))}}const wg="LocalStore",SF=3e8;class PF{constructor(e,n,r,s){this.persistence=e,this.Fs=n,this.serializer=s,this.Ms=new Je(_e),this.xs=new zr((i=>Li(i)),vu),this.Os=new Map,this.Ns=e.getRemoteDocumentCache(),this.Pi=e.getTargetCache(),this.Ii=e.getBundleCache(),this.Bs(r)}Bs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new CR(this.Ns,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ns.setIndexManager(this.indexManager),this.Fs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(n=>e.collect(n,this.Ms)))}}function DR(t,e,n,r){return new PF(t,e,n,r)}async function OR(t,e){const n=Z(t);return await n.persistence.runTransaction("Handle user change","readonly",(r=>{let s;
33return n.mutationQueue.getAllMutationBatches(r).next((i=>(s=i,n.Bs(e),n.mutationQueue.getAllMutationBatches(r)))).next((i=>{const o=[],a=[];let c=Ie();for(const l of s){o.push(l.batchId);for(const h of l.mutations)c=c.add(h.key)}for(const l of i){a.push(l.batchId);for(const h of l.mutations)c=c.add(h.key)}return n.localDocuments.getDocuments(r,c).next((l=>({Ls:l,removedBatchIds:o,addedBatchIds:a})))}))}))}function CF(t,e){const n=Z(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(r=>{const s=e.batch.keys(),i=n.Ns.newChangeBuffer({trackRemovals:!0});return(function(a,c,l,h){const d=l.batch,f=d.keys();let m=V.resolve();return f.forEach((_=>{m=m.next((()=>h.getEntry(c,_))).next((E=>{const v=l.docVersions.get(_);ce(v!==null,48541),E.version.compareTo(v)<0&&(d.applyToRemoteDocument(E,l),E.isValidDocument()&&(E.setReadTime(l.commitVersion),h.addEntry(E)))}))})),m.next((()=>a.mutationQueue.removeMutationBatch(c,d)))})(n,r,e,i).next((()=>i.apply(r))).next((()=>n.mutationQueue.performConsistencyCheck(r))).next((()=>n.documentOverlayCache.removeOverlaysForBatchId(r,s,e.batch.batchId))).next((()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,(function(a){let c=Ie();for(let l=0;l<a.mutationResults.length;++l)a.mutationResults[l].transformResults.length>0&&(c=c.add(a.batch.mutations[l].key));return c})(e)))).next((()=>n.localDocuments.getDocuments(r,s)))}))}function xR(t){const e=Z(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(n=>e.Pi.getLastRemoteSnapshotVersion(n)))}function kF(t,e){const n=Z(t),r=e.snapshotVersion;let s=n.Ms;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(i=>{const o=n.Ns.newChangeBuffer({trackRemovals:!0});s=n.Ms;const a=[];
33e.targetChanges.forEach(((h,d)=>{const f=s.get(d);if(!f)return;a.push(n.Pi.removeMatchingKeys(i,h.removedDocuments,d).next((()=>n.Pi.addMatchingKeys(i,h.addedDocuments,d))));let m=f.withSequenceNumber(i.currentSequenceNumber);e.targetMismatches.get(d)!==null?m=m.withResumeToken(ct.EMPTY_BYTE_STRING,he.min()).withLastLimboFreeSnapshotVersion(he.min()):h.resumeToken.approximateByteSize()>0&&(m=m.withResumeToken(h.resumeToken,r)),s=s.insert(d,m),(function(E,v,O){return E.resumeToken.approximateByteSize()===0||v.snapshotVersion.toMicroseconds()-E.snapshotVersion.toMicroseconds()>=SF?!0:O.addedDocuments.size+O.modifiedDocuments.size+O.removedDocuments.size>0})(f,m,h)&&a.push(n.Pi.updateTargetData(i,m))}));let c=fn(),l=Ie();if(e.documentUpdates.forEach((h=>{e.resolvedLimboDocuments.has(h)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(i,h))})),a.push(VR(i,o,e.documentUpdates).next((h=>{c=h.ks,l=h.qs}))),!r.isEqual(he.min())){const h=n.Pi.getLastRemoteSnapshotVersion(i).next((d=>n.Pi.setTargetsMetadata(i,i.currentSequenceNumber,r)));a.push(h)}return V.waitFor(a).next((()=>o.apply(i))).next((()=>n.localDocuments.getLocalViewOfDocuments(i,c,l))).next((()=>c))})).then((i=>(n.Ms=s,i)))}function VR(t,e,n){let r=Ie(),s=Ie();return n.forEach((i=>r=r.add(i))),e.getEntries(t,r).next((i=>{let o=fn();return n.forEach(((a,c)=>{const l=i.get(a);c.isFoundDocument()!==l.isFoundDocument()&&(s=s.add(a)),c.isNoDocument()&&c.version.isEqual(he.min())?(e.removeEntry(a,c.readTime),o=o.insert(a,c)):!l.isValidDocument()||c.version.compareTo(l.version)>0||c.version.compareTo(l.version)===0&&l.hasPendingWrites?(e.addEntry(c),o=o.insert(a,c)):H(wg,"Ignoring outdated watch update for ",a,". Current version:",l.version," Watch version:",c.version)})),{ks:o,qs:s}}))}function NF(t,e){const n=Z(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(r=>(e===void 0&&(e=Cs),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e))))}function ta(t,e){const n=Z(t);return n.persistence.runTransaction("Allocate target","readwrite",(r=>{let s;return n.Pi.getTargetData(r,e).next((i=>i?(s=i,V.resolve(s)):n.Pi.allocateTargetId(r).next((o=>(s=new Rr(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.Pi.addTargetData(r,s).next((()=>s)))))))})).then((r=>{const s=n.Ms.get(r.targetId);return(s===null||r.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(n.Ms=n.Ms.insert(r.targetId,r),n.xs.set(e,r.targetId)),r}))}async function na(t,e,n){const r=Z(t),s=r.Ms.get(e),i=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",i,(o=>r.persistence.referenceDelegate.removeTarget(o,s)))}catch(o){if(!qs(o))throw o;H(wg,`Failed to update sequence numbers for target ${e}: ${o}`)}r.Ms=r.Ms.remove(e),r.xs.delete(s.target)}function Ih(t,e,n){const r=Z(t);let s=he.min(),i=Ie();return r.persistence.runTransaction("Execute query","readwrite",(o=>(function(c,l,h){const d=Z(c),f=d.xs.get(h);return f!==void 0?V.resolve(d.Ms.get(f)):d.Pi.getTargetData(l,h)})(r,o,Yt(e)).next((a=>{if(a)return s=a.lastLimboFreeSnapshotVersion,r.Pi.getMatchingKeysForTargetId(o,a.targetId).next((c=>{i=c}))})).next((()=>r.Fs.getDocumentsMatchingQuery(o,e,n?s:he.min(),n?i:Ie()))).next((a=>(FR(r,BA(e),a),{documents:a,Qs:i})))))}function LR(t,e){const n=Z(t),r=Z(n.Pi),s=n.Ms.get(e);return s?Promise.resolve(s.target):n.persistence.runTransaction("Get target data","readonly",(i=>r.At(i,e).next((o=>o?o.target:null))))}function MR(t,e){const n=Z(t),r=n.Os.get(e)||he.min();return n.persistence.runTransaction("Get new document changes","readonly",(s=>n.Ns.getAllFromCollectionGroup(s,e,nA(r,$o),Number.MAX_SAFE_INTEGER))).then((s=>(FR(n,e,s),s)))}function FR(t,e,n){let r=t.Os.get(e)||he.min();n.forEach(((s,i)=>{i.readTime.compareTo(r)>0&&(r=i.readTime)})),t.Os.set(e,r)}async function DF(t,e,n,r){const s=Z(t);let i=Ie(),o=fn();for(const l of n){const h=e.$s(l.metadata.name);l.document&&(i=i.add(h));const d=e.Us(l);d.setReadTime(e.Ks(l.metadata.readTime)),o=o.insert(h,d)}const a=s.Ns.newChangeBuffer({trackRemovals:!0}),c=await ta(s,(function(h){return Yt(Ea(be.fromString(`__bundle__/docs/${h}`)))})(r));return s.persistence.runTransaction("Apply bundle documents","readwrite",(l=>VR(l,a,o).next((h=>(a.apply(l),h))).next((h=>s.Pi.removeMatchingKeysForTargetId(l,c.targetId).next((()=>s.Pi.addMatchingKeys(l,i,c.targetId))).next((()=>s.localDocuments.getLocalViewOfDocuments(l,h.ks,h.qs))).next((()=>h.ks))))))}async function OF(t,e,n=Ie()){const r=await ta(t,Yt(ld(e.bundledQuery))),s=Z(t);return s.persistence.runTransaction("Save named query","readwrite",(i=>{const o=pt(e.readTime);if(r.snapshotVersion.compareTo(o)>=0)return s.Ii.saveNamedQuery(i,e);const a=r.withResumeToken(ct.EMPTY_BYTE_STRING,o);return s.Ms=s.Ms.insert(a.targetId,a),s.Pi.updateTargetData(i,a).next((()=>s.Pi.removeMatchingKeysForTargetId(i,r.targetId))).next((()=>s.Pi.addMatchingKeys(i,n,r.targetId))).next((()=>s.Ii.saveNamedQuery(i,e)))}))}const UR="firestore_clients";function zI(t,e){return`${UR}_${t}_${e}`}const BR="firestore_mutations";function QI(t,e,n){let r=`${BR}_${t}_${n}`;return e.isAuthenticated()&&(r+=`_${e.uid}`),r}const jR="firestore_targets";function Pf(t,e){return`${jR}_${t}_${e}`}
33const Zn="SharedClientState";class Th{constructor(e,n,r,s){this.user=e,this.batchId=n,this.state=r,this.error=s}static Ws(e,n,r){const s=JSON.parse(r);let i,o=typeof s=="object"&&["pending","acknowledged","rejected"].indexOf(s.state)!==-1&&(s.error===void 0||typeof s.error=="object");return o&&s.error&&(o=typeof s.error.message=="string"&&typeof s.error.code=="string",o&&(i=new $(s.error.code,s.error.message))),o?new Th(e,n,s.state,i):(ft(Zn,`Failed to parse mutation state for ID '${n}': ${r}`),null)}Gs(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class Dc{constructor(e,n,r){this.targetId=e,this.state=n,this.error=r}static Ws(e,n){const r=JSON.parse(n);let s,i=typeof r=="object"&&["not-current","current","rejected"].indexOf(r.state)!==-1&&(r.error===void 0||typeof r.error=="object");return i&&r.error&&(i=typeof r.error.message=="string"&&typeof r.error.code=="string",i&&(s=new $(r.error.code,r.error.message))),i?new Dc(e,r.state,s):(ft(Zn,`Failed to parse target state for ID '${e}': ${n}`),null)}Gs(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class wh{constructor(e,n){this.clientId=e,this.activeTargetIds=n}static Ws(e,n){const r=JSON.parse(n);let s=typeof r=="object"&&r.activeTargetIds instanceof Array,i=ag();for(let o=0;s&&o<r.activeTargetIds.length;++o)s=aA(r.activeTargetIds[o]),i=i.add(r.activeTargetIds[o]);return s?new wh(e,i):(ft(Zn,`Failed to parse client data for instance '${e}': ${n}`),null)}}class vg{constructor(e,n){this.clientId=e,this.onlineState=n}static Ws(e){const n=JSON.parse(e);return typeof n=="object"&&["Unknown","Online","Offline"].indexOf(n.onlineState)!==-1&&typeof n.clientId=="string"?new vg(n.clientId,n.onlineState):(ft(Zn,`Failed to parse online state: ${e}`),null)}}class Jp{constructor(){this.activeTargetIds=ag()}zs(e){this.activeTargetIds=this.activeTargetIds.add(e)}js(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Gs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Cf{constructor(e,n,r,s,i){this.window=e,this.Mi=n,this.persistenceKey=r,this.Js=s,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.Hs=this.Ys.bind(this),this.Zs=new Je(_e),this.started=!1,this.Xs=[];const o=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.eo=zI(this.persistenceKey,this.Js),this.no=(function(c){return`firestore_sequence_number_${c}`})(this.persistenceKey),this.Zs=this.Zs.insert(this.Js,new Jp),this.ro=new RegExp(`^${UR}_${o}_([^_]*)$`),this.io=new RegExp(`^${BR}_${o}_(\\d+)(?:_(.*))?$`),this.so=new RegExp(`^${jR}_${o}_(\\d+)$`),this.oo=(function(c){return`firestore_online_state_${c}`})(this.persistenceKey),this._o=(function(c){return`firestore_bundle_loaded_v2_${c}`})(this.persistenceKey),this.window.addEventListener("storage",this.Hs)}static v(e){return!(!e||!e.localStorage)}async start(){const e=await this.syncEngine.Ts();for(const r of e){if(r===this.Js)continue;const s=this.getItem(zI(this.persistenceKey,r));if(s){const i=wh.Ws(r,s);i&&(this.Zs=this.Zs.insert(i.clientId,i))}}this.ao();const n=this.storage.getItem(this.oo);if(n){const r=this.uo(n);r&&this.co(r)}for(const r of this.Xs)this.Ys(r);this.Xs=[],this.window.addEventListener("pagehide",(()=>this.shutdown())),this.started=!0}writeSequenceNumber(e){this.setItem(this.no,JSON.stringify(e))}getAllActiveQueryTargets(){return this.lo(this.Zs)}isActiveQueryTarget(e){let n=!1;return this.Zs.forEach(((r,s)=>{s.activeTargetIds.has(e)&&(n=!0)})),n}addPendingMutation(e){this.ho(e,"pending")}updateMutationState(e,n,r){this.ho(e,n,r),this.Po(e)}addLocalQueryTarget(e,n=!0){let r="not-current";if(this.isActiveQueryTarget(e)){const s=this.storage.getItem(Pf(this.persistenceKey,e));if(s){const i=Dc.Ws(e,s);i&&(r=i.state)}}return n&&this.To.zs(e),this.ao(),r}removeLocalQueryTarget(e){this.To.js(e),this.ao()}isLocalQueryTarget(e){return this.To.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(Pf(this.persistenceKey,e))}updateQueryState(e,n,r){this.Io(e,n,r)}
33handleUserChange(e,n,r){n.forEach((s=>{this.Po(s)})),this.currentUser=e,r.forEach((s=>{this.addPendingMutation(s)}))}setOnlineState(e){this.Eo(e)}notifyBundleLoaded(e){this.Ao(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this.Hs),this.removeItem(this.eo),this.started=!1)}getItem(e){const n=this.storage.getItem(e);return H(Zn,"READ",e,n),n}setItem(e,n){H(Zn,"SET",e,n),this.storage.setItem(e,n)}removeItem(e){H(Zn,"REMOVE",e),this.storage.removeItem(e)}Ys(e){const n=e;if(n.storageArea===this.storage){if(H(Zn,"EVENT",n.key,n.newValue),n.key===this.eo)return void ft("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Mi.enqueueRetryable((async()=>{if(this.started){if(n.key!==null){if(this.ro.test(n.key)){if(n.newValue==null){const r=this.Ro(n.key);return this.Vo(r,null)}{const r=this.mo(n.key,n.newValue);if(r)return this.Vo(r.clientId,r)}}else if(this.io.test(n.key)){if(n.newValue!==null){const r=this.fo(n.key,n.newValue);if(r)return this.po(r)}}else if(this.so.test(n.key)){if(n.newValue!==null){const r=this.yo(n.key,n.newValue);if(r)return this.wo(r)}}else if(n.key===this.oo){if(n.newValue!==null){const r=this.uo(n.newValue);if(r)return this.co(r)}}else if(n.key===this.no){const r=(function(i){let o=hn.ce;if(i!=null)try{const a=JSON.parse(i);ce(typeof a=="number",30636,{So:i}),o=a}catch(a){ft(Zn,"Failed to read sequence number from WebStorage",a)}return o})(n.newValue);r!==hn.ce&&this.sequenceNumberHandler(r)}else if(n.key===this._o){const r=this.bo(n.newValue);await Promise.all(r.map((s=>this.syncEngine.Do(s))))}}}else this.Xs.push(n)}))}}get To(){return this.Zs.get(this.Js)}ao(){this.setItem(this.eo,this.To.Gs())}ho(e,n,r){const s=new Th(this.currentUser,e,n,r),i=QI(this.persistenceKey,this.currentUser,e);this.setItem(i,s.Gs())}Po(e){const n=QI(this.persistenceKey,this.currentUser,e);this.removeItem(n)}Eo(e){const n={clientId:this.Js,onlineState:e};this.storage.setItem(this.oo,JSON.stringify(n))}Io(e,n,r){const s=Pf(this.persistenceKey,e),i=new Dc(e,n,r);this.setItem(s,i.Gs())}Ao(e){const n=JSON.stringify(Array.from(e));this.setItem(this._o,n)}Ro(e){const n=this.ro.exec(e);return n?n[1]:null}mo(e,n){const r=this.Ro(e);return wh.Ws(r,n)}fo(e,n){const r=this.io.exec(e),s=Number(r[1]),i=r[2]!==void 0?r[2]:null;return Th.Ws(new Nt(i),s,n)}yo(e,n){const r=this.so.exec(e),s=Number(r[1]);return Dc.Ws(s,n)}uo(e){return vg.Ws(e)}bo(e){return JSON.parse(e)}async po(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.Co(e.batchId,e.state,e.error);H(Zn,`Ignoring mutation for non-active user ${e.user.uid}`)}wo(e){return this.syncEngine.vo(e.targetId,e.state,e.error)}
33Vo(e,n){const r=n?this.Zs.insert(e,n):this.Zs.remove(e),s=this.lo(this.Zs),i=this.lo(r),o=[],a=[];return i.forEach((c=>{s.has(c)||o.push(c)})),s.forEach((c=>{i.has(c)||a.push(c)})),this.syncEngine.Fo(o,a).then((()=>{this.Zs=r}))}co(e){this.Zs.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}lo(e){let n=ag();return e.forEach(((r,s)=>{n=n.unionWith(s.activeTargetIds)})),n}}class $R{constructor(){this.Mo=new Jp,this.xo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.Mo.zs(e),this.xo[e]||"not-current"}updateQueryState(e,n,r){this.xo[e]=n}removeLocalQueryTarget(e){this.Mo.js(e)}isLocalQueryTarget(e){return this.Mo.activeTargetIds.has(e)}clearQueryState(e){delete this.xo[e]}getAllActiveQueryTargets(){return this.Mo.activeTargetIds}isActiveQueryTarget(e){return this.Mo.activeTargetIds.has(e)}start(){return this.Mo=new Jp,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class xF{Oo(e){}shutdown(){}}const JI="ConnectivityMonitor";class YI{constructor(){this.No=()=>this.Bo(),this.Lo=()=>this.ko(),this.qo=[],this.Qo()}Oo(e){this.qo.push(e)}shutdown(){window.removeEventListener("online",this.No),window.removeEventListener("offline",this.Lo)}Qo(){window.addEventListener("online",this.No),window.addEventListener("offline",this.Lo)}Bo(){H(JI,"Network connectivity changed: AVAILABLE");for(const e of this.qo)e(0)}ko(){H(JI,"Network connectivity changed: UNAVAILABLE");for(const e of this.qo)e(1)}static v(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}let dl=null;function Yp(){return dl===null?dl=(function(){return 268435456+Math.round(2147483648*Math.random())})():dl++,"0x"+dl.toString(16)}const kf="RestConnection",VF={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class LF{get $o(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Uo=n+"://"+e.host,this.Ko=`projects/${r}/databases/${s}`,this.Wo=this.databaseId.database===eu?`project_id=${r}`:`project_id=${r}&database_id=${s}`}Go(e,n,r,s,i){const o=Yp(),a=this.zo(e,n.toUriEncodedString());H(kf,`Sending RPC '${e}' ${o}:`,a,r);const c={"google-cloud-resource-prefix":this.Ko,"x-goog-request-params":this.Wo};this.jo(c,s,i);const{host:l}=new URL(a),h=lr(l);return this.Jo(e,a,c,r,h).then((d=>(H(kf,`Received RPC '${e}' ${o}: `,d),d)),(d=>{throw vn(kf,`RPC '${e}' ${o} failed with error: `,d,"url: ",a,"request:",r),d}))}Ho(e,n,r,s,i,o){return this.Go(e,n,r,s,i)}jo(e,n,r){e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+ya})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach(((s,i)=>e[i]=s)),r&&r.headers.forEach(((s,i)=>e[i]=s))}zo(e,n){const r=VF[e];return`${this.Uo}/v1/${n}:${r}`}terminate(){}}class MF{constructor(e){this.Yo=e.Yo,this.Zo=e.Zo}Xo(e){this.e_=e}t_(e){this.n_=e}r_(e){this.i_=e}onMessage(e){this.s_=e}close(){this.Zo()}send(e){this.Yo(e)}o_(){this.e_()}__(){this.n_()}a_(e){this.i_(e)}u_(e){this.s_(e)}}const Gt="WebChannelConnection";class FF extends LF{constructor(e){super(e),this.c_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,n,r,s,i){const o=Yp();return new Promise(((a,c)=>{const l=new Hb;l.setWithCredentials(!0),l.listenOnce(Gb.COMPLETE,(()=>{try{switch(l.getLastErrorCode()){case Sl.NO_ERROR:const d=l.getResponseJson();H(Gt,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(d)),a(d);break;case Sl.TIMEOUT:H(Gt,`RPC '${e}' ${o} timed out`),c(new $(F.DEADLINE_EXCEEDED,"Request time out"));break;case Sl.HTTP_ERROR:const f=l.getStatus();if(H(Gt,`RPC '${e}' ${o} failed with status:`,f,"response text:",l.getResponseText()),f>0){let m=l.getResponseJson();Array.isArray(m)&&(m=m[0]);const _=m?.error;if(_&&_.status&&_.message){const E=(function(O){const N=O.toLowerCase().replace(/_/g,"-");return Object.values(F).indexOf(N)>=0?N:F.UNKNOWN})(_.status);c(new $(E,_.message))}else c(new $(F.UNKNOWN,"Server responded with status "+l.getStatus()))}else c(new $(F.UNAVAILABLE,"Connection failed."));break;default:re(9055,{l_:e,streamId:o,h_:l.getLastErrorCode(),P_:l.getLastError()})}}finally{H(Gt,`RPC '${e}' ${o} completed.`)}}));const h=JSON.stringify(s);H(Gt,`RPC '${e}' ${o} sending request:`,s),l.send(n,"POST",h,r,15)}))}T_(e,n,r){const s=Yp(),i=[this.Uo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=zb(),a=Kb(),c={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`}
33,sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(c.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(c.useFetchStreams=!0),this.jo(c.initMessageHeaders,n,r),c.encodeInitMessageHeaders=!0;const h=i.join("");H(Gt,`Creating RPC '${e}' stream ${s}: ${h}`,c);const d=o.createWebChannel(h,c);this.I_(d);let f=!1,m=!1;const _=new MF({Yo:v=>{m?H(Gt,`Not sending because RPC '${e}' stream ${s} is closed:`,v):(f||(H(Gt,`Opening RPC '${e}' stream ${s} transport.`),d.open(),f=!0),H(Gt,`RPC '${e}' stream ${s} sending:`,v),d.send(v))},Zo:()=>d.close()}),E=(v,O,N)=>{v.listen(O,(y=>{try{N(y)}catch(S){setTimeout((()=>{throw S}),0)}}))};return E(d,lc.EventType.OPEN,(()=>{m||(H(Gt,`RPC '${e}' stream ${s} transport opened.`),_.o_())})),E(d,lc.EventType.CLOSE,(()=>{m||(m=!0,H(Gt,`RPC '${e}' stream ${s} transport closed`),_.a_(),this.E_(d))})),E(d,lc.EventType.ERROR,(v=>{m||(m=!0,vn(Gt,`RPC '${e}' stream ${s} transport errored. Name:`,v.name,"Message:",v.message),_.a_(new $(F.UNAVAILABLE,"The operation could not be completed")))})),E(d,lc.EventType.MESSAGE,(v=>{if(!m){const O=v.data[0];ce(!!O,16349);const N=O,y=N?.error||N[0]?.error;if(y){H(Gt,`RPC '${e}' stream ${s} received error:`,y);const S=y.status;let D=(function(T){const I=mt[T];if(I!==void 0)return tR(I)})(S),M=y.message;D===void 0&&(D=F.INTERNAL,M="Unknown error status: "+S+" with message "+y.message),m=!0,_.a_(new $(D,M)),d.close()}else H(Gt,`RPC '${e}' stream ${s} received:`,O),_.u_(O)}})),E(a,Wb.STAT_EVENT,(v=>{v.stat===Sp.PROXY?H(Gt,`RPC '${e}' stream ${s} detected buffering proxy`):v.stat===Sp.NOPROXY&&H(Gt,`RPC '${e}' stream ${s} detected no buffering proxy`)})),setTimeout((()=>{_.__()}),0),_}terminate(){this.c_.forEach((e=>e.close())),this.c_=[]}I_(e){this.c_.push(e)}E_(e){this.c_=this.c_.filter((n=>n===e))}}function qR(){return typeof window<"u"?window:null}function Ll(){return typeof document<"u"?document:null}function Qi(t){return new HM(t,!0)}class bg{constructor(e,n,r=1e3,s=1.5,i=6e4){this.Mi=e,this.timerId=n,this.d_=r,this.A_=s,this.R_=i,this.V_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.V_=0}g_(){this.V_=this.R_}p_(e){this.cancel();const n=Math.floor(this.V_+this.y_()),r=Math.max(0,Date.now()-this.f_),s=Math.max(0,n-r);s>0&&H("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.V_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.m_=this.Mi.enqueueAfterDelay(this.timerId,s,(()=>(this.f_=Date.now(),e()))),this.V_*=this.A_,this.V_<this.d_&&(this.V_=this.d_),this.V_>this.R_&&(this.V_=this.R_)}w_(){this.m_!==null&&(this.m_.skipDelay(),this.m_=null)}cancel(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.V_}}const XI="PersistentStream";class HR{constructor(e,n,r,s,i,o,a,c){this.Mi=e,this.S_=r,this.b_=s,this.connection=i,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=c,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new bg(e,n)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Mi.enqueueAfterDelay(this.S_,6e4,(()=>this.k_())))}q_(e){this.Q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}Q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,n){this.Q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():n&&n.code===F.RESOURCE_EXHAUSTED?(ft(n.toString()),ft("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):n&&n.code===F.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.K_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.r_(n)}K_(){}auth(){this.state=1;const e=this.W_(this.D_),n=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([r,s])=>{this.D_===n&&this.G_(r,s)}),(r=>{e((()=>{const s=new $(F.UNKNOWN,"Fetching auth token failed: "+r.message);return this.z_(s)}))}))}G_(e,n){const r=this.W_(this.D_);this.stream=this.j_(e,n),this.stream.Xo((()=>{r((()=>this.listener.Xo()))}
33)),this.stream.t_((()=>{r((()=>(this.state=2,this.v_=this.Mi.enqueueAfterDelay(this.b_,1e4,(()=>(this.O_()&&(this.state=3),Promise.resolve()))),this.listener.t_())))})),this.stream.r_((s=>{r((()=>this.z_(s)))})),this.stream.onMessage((s=>{r((()=>++this.F_==1?this.J_(s):this.onNext(s)))}))}N_(){this.state=5,this.M_.p_((async()=>{this.state=0,this.start()}))}z_(e){return H(XI,`close with error: ${e}`),this.stream=null,this.close(4,e)}W_(e){return n=>{this.Mi.enqueueAndForget((()=>this.D_===e?n():(H(XI,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class UF extends HR{constructor(e,n,r,s,i,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,s,o),this.serializer=i}j_(e,n){return this.connection.T_("Listen",e,n)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();const n=KM(this.serializer,e),r=(function(i){if(!("targetChange"in i))return he.min();const o=i.targetChange;return o.targetIds&&o.targetIds.length?he.min():o.readTime?pt(o.readTime):he.min()})(e);return this.listener.H_(n,r)}Y_(e){const n={};n.database=Gp(this.serializer),n.addTarget=(function(i,o){let a;const c=o.target;if(a=fh(c)?{documents:lR(i,c)}:{query:ud(i,c).ft},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=iR(i,o.resumeToken);const l=qp(i,o.expectedCount);l!==null&&(a.expectedCount=l)}else if(o.snapshotVersion.compareTo(he.min())>0){a.readTime=ea(i,o.snapshotVersion.toTimestamp());const l=qp(i,o.expectedCount);l!==null&&(a.expectedCount=l)}return a})(this.serializer,e);const r=QM(this.serializer,e);r&&(n.labels=r),this.q_(n)}Z_(e){const n={};n.database=Gp(this.serializer),n.removeTarget=e,this.q_(n)}}class BF extends HR{constructor(e,n,r,s,i,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,s,o),this.serializer=i}get X_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}K_(){this.X_&&this.ea([])}j_(e,n){return this.connection.T_("Write",e,n)}J_(e){return ce(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,ce(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){ce(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const n=zM(e.writeResults,e.commitTime),r=pt(e.commitTime);return this.listener.na(r,n)}ra(){const e={};e.database=Gp(this.serializer),this.q_(e)}ea(e){const n={streamToken:this.lastStreamToken,writes:e.map((r=>iu(this.serializer,r)))};this.q_(n)}}class jF{}class $F extends jF{constructor(e,n,r,s){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=s,this.ia=!1}sa(){if(this.ia)throw new $(F.FAILED_PRECONDITION,"The client has already been terminated.")}Go(e,n,r,s){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([i,o])=>this.connection.Go(e,Hp(n,r),s,i,o))).catch((i=>{throw i.name==="FirebaseError"?(i.code===F.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),i):new $(F.UNKNOWN,i.toString())}))}Ho(e,n,r,s,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([o,a])=>this.connection.Ho(e,Hp(n,r),s,o,a,i))).catch((o=>{throw o.name==="FirebaseError"?(o.code===F.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new $(F.UNKNOWN,o.toString())}))}terminate(){this.ia=!0,this.connection.terminate()}}class qF{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){this.oa===0&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve()))))}ha(e){this.state==="Online"?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,e==="Online"&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const n=`Could not reach Cloud Firestore backend. ${e}
34This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.aa?(ft(n),this.aa=!1):H("OnlineStateTracker",n)}Pa(){this._a!==null&&(this._a.cancel(),this._a=null)}}const $i="RemoteStore";class HF{constructor(e,n,r,s,i){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.da=[],this.Aa=i,this.Aa.Oo((o=>{r.enqueueAndForget((async()=>
34{Gs(this)&&(H($i,"Restarting streams for network reachability change."),await(async function(c){const l=Z(c);l.Ea.add(4),await wa(l),l.Ra.set("Unknown"),l.Ea.delete(4),await Cu(l)})(this))}))})),this.Ra=new qF(r,s)}}async function Cu(t){if(Gs(t))for(const e of t.da)await e(!0)}async function wa(t){for(const e of t.da)await e(!1)}function pd(t,e){const n=Z(t);n.Ia.has(e.targetId)||(n.Ia.set(e.targetId,e),Sg(n)?Rg(n):ba(n).O_()&&Ag(n,e))}function ra(t,e){const n=Z(t),r=ba(n);n.Ia.delete(e),r.O_()&&GR(n,e),n.Ia.size===0&&(r.O_()?r.L_():Gs(n)&&n.Ra.set("Unknown"))}function Ag(t,e){if(t.Va.Ue(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(he.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}ba(t).Y_(e)}function GR(t,e){t.Va.Ue(e),ba(t).Z_(e)}function Rg(t){t.Va=new BM({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),At:e=>t.Ia.get(e)||null,ht:()=>t.datastore.serializer.databaseId}),ba(t).start(),t.Ra.ua()}function Sg(t){return Gs(t)&&!ba(t).x_()&&t.Ia.size>0}function Gs(t){return Z(t).Ea.size===0}function WR(t){t.Va=void 0}async function GF(t){t.Ra.set("Online")}async function WF(t){t.Ia.forEach(((e,n)=>{Ag(t,e)}))}async function KF(t,e){WR(t),Sg(t)?(t.Ra.ha(e),Rg(t)):t.Ra.set("Unknown")}async function zF(t,e,n){if(t.Ra.set("Online"),e instanceof sR&&e.state===2&&e.cause)try{await(async function(s,i){const o=i.cause;for(const a of i.targetIds)s.Ia.has(a)&&(await s.remoteSyncer.rejectListen(a,o),s.Ia.delete(a),s.Va.removeTarget(a))})(t,e)}catch(r){H($i,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await vh(t,r)}else if(e instanceof xl?t.Va.Ze(e):e instanceof rR?t.Va.st(e):t.Va.tt(e),!n.isEqual(he.min()))try{const r=await xR(t.localStore);n.compareTo(r)>=0&&await(function(i,o){const a=i.Va.Tt(o);
34return a.targetChanges.forEach(((c,l)=>{if(c.resumeToken.approximateByteSize()>0){const h=i.Ia.get(l);h&&i.Ia.set(l,h.withResumeToken(c.resumeToken,o))}})),a.targetMismatches.forEach(((c,l)=>{const h=i.Ia.get(c);if(!h)return;i.Ia.set(c,h.withResumeToken(ct.EMPTY_BYTE_STRING,h.snapshotVersion)),GR(i,c);const d=new Rr(h.target,c,l,h.sequenceNumber);Ag(i,d)})),i.remoteSyncer.applyRemoteEvent(a)})(t,n)}catch(r){H($i,"Failed to raise snapshot:",r),await vh(t,r)}}async function vh(t,e,n){if(!qs(e))throw e;t.Ea.add(1),await wa(t),t.Ra.set("Offline"),n||(n=()=>xR(t.localStore)),t.asyncQueue.enqueueRetryable((async()=>{H($i,"Retrying IndexedDB access"),await n(),t.Ea.delete(1),await Cu(t)}))}function KR(t,e){return e().catch((n=>vh(t,n,e)))}async function va(t){const e=Z(t),n=Us(e);let r=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:Cs;for(;QF(e);)try{const s=await NF(e.localStore,r);if(s===null){e.Ta.length===0&&n.L_();break}r=s.batchId,JF(e,s)}catch(s){await vh(e,s)}zR(e)&&QR(e)}function QF(t){return Gs(t)&&t.Ta.length<10}function JF(t,e){t.Ta.push(e);const n=Us(t);n.O_()&&n.X_&&n.ea(e.mutations)}function zR(t){return Gs(t)&&!Us(t).x_()&&t.Ta.length>0}function QR(t){Us(t).start()}async function YF(t){Us(t).ra()}async function XF(t){const e=Us(t);for(const n of t.Ta)e.ea(n.mutations)}async function ZF(t,e,n){const r=t.Ta.shift(),s=hg.from(r,e,n);await KR(t,(()=>t.remoteSyncer.applySuccessfulWrite(s))),await va(t)}async function eU(t,e){e&&Us(t).X_&&await(async function(r,s){if((function(o){return eR(o)&&o!==F.ABORTED})(s.code)){const i=r.Ta.shift();Us(r).B_(),await KR(r,(()=>r.remoteSyncer.rejectFailedWrite(i.batchId,s))),await va(r)}})(t,e),zR(t)&&QR(t)}async function ZI(t,e){const n=Z(t);n.asyncQueue.verifyOperationInProgress(),H($i,"RemoteStore received new credentials");const r=Gs(n);n.Ea.add(3),await wa(n),r&&n.Ra.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Ea.delete(3),await Cu(n)}async function Xp(t,e){const n=Z(t);e?(n.Ea.delete(2),await Cu(n)):e||(n.Ea.add(2),await wa(n),n.Ra.set("Unknown"))}function ba(t){return t.ma||(t.ma=(function(n,r,s){const i=Z(n);return i.sa(),new UF(r,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)})(t.datastore,t.asyncQueue,{Xo:GF.bind(null,t),t_:WF.bind(null,t),r_:KF.bind(null,t),H_:zF.bind(null,t)}),t.da.push((async e=>{e?(t.ma.B_(),Sg(t)?Rg(t):t.Ra.set("Unknown")):(await t.ma.stop(),WR(t))}))),t.ma}function Us(t){return t.fa||(t.fa=(function(n,r,s){const i=Z(n);return i.sa(),new BF(r,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)})(t.datastore,t.asyncQueue,{Xo:()=>Promise.resolve(),t_:YF.bind(null,t),r_:eU.bind(null,t),ta:XF.bind(null,t),na:ZF.bind(null,t)}),t.da.push((async e=>{e?(t.fa.B_(),await va(t)):(await t.fa.stop(),t.Ta.length>0&&(H($i,`Stopping write stream with ${t.Ta.length} pending writes`),t.Ta=[]))}))),t.fa}class Pg{constructor(e,n,r,s,i){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=s,this.removalCallback=i,this.deferred=new xt,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((o=>{}))}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,s,i){const o=Date.now()+r,a=new Pg(e,n,o,s,i);return a.start(r),a}start(e){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new $(F.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then((e=>this.deferred.resolve(e)))):Promise.resolve()))}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function Aa(t,e){if(ft("AsyncQueue",`${e}: ${t}`),qs(t))return new $(F.UNAVAILABLE,`${e}: ${t}`);throw t}class Pi{static emptySet(e){return new Pi(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||X.comparator(n.key,r.key):(n,r)=>X.comparator(n.key,r.key),this.keyedMap=hc(),this.sortedSet=new Je(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal(((n,r)=>(e(n),!1)))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof Pi)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const s=n.getNext().key,i=r.getNext().key;if(!s.isEqual(i))return!1}return!0}toString(){const e=[];return this.forEach((n=>{e.push(n.toString())})),e.length===0?"DocumentSet ()":`DocumentSet (
35  `+e.join(`  
36`)+`
37)`}copy(e,n){const r=new Pi;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}class eT{constructor(){this.ga=new Je(X.comparator)}track(e){const n=e.doc.key,r=this.ga.get(n);r?e.type!==0&&r.type===3?this.ga=this.ga.insert(n,e):e.type===3&&r.type!==1?this.ga=this.ga.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.ga=this.ga.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.ga=this.ga.remove(n):e.type===1&&r.type===2?this.ga=this.ga.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):re(63341,{Rt:e,pa:r}):this.ga=this.ga.insert(n,e)}ya(){const e=[];return this.ga.inorderTraversal(((n,r)=>{e.push(r)})),e}}class qi{constructor(e,n,r,s,i,o,a,c,l){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=s,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=c,this.hasCachedResults=l}static fromInitialDocuments(e,n,r,s,i){const o=[];
37return n.forEach((a=>{o.push({type:0,doc:a})})),new qi(e,n,Pi.emptySet(n),o,r,s,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&bu(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(n[s].type!==r[s].type||!n[s].doc.isEqual(r[s].doc))return!1;return!0}}class tU{constructor(){this.wa=void 0,this.Sa=[]}ba(){return this.Sa.some((e=>e.Da()))}}class nU{constructor(){this.queries=tT(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(n,r){const s=Z(n),i=s.queries;s.queries=tT(),i.forEach(((o,a)=>{for(const c of a.Sa)c.onError(r)}))})(this,new $(F.ABORTED,"Firestore shutting down"))}}function tT(){return new zr((t=>UA(t)),bu)}async function Cg(t,e){const n=Z(t);let r=3;const s=e.query;let i=n.queries.get(s);i?!i.ba()&&e.Da()&&(r=2):(i=new tU,r=e.Da()?0:1);try{switch(r){case 0:i.wa=await n.onListen(s,!0);break;case 1:i.wa=await n.onListen(s,!1);break;case 2:await n.onFirstRemoteStoreListen(s)}}catch(o){const a=Aa(o,`Initialization of query '${yo(e.query)}' failed`);return void e.onError(a)}n.queries.set(s,i),i.Sa.push(e),e.va(n.onlineState),i.wa&&e.Fa(i.wa)&&Ng(n)}async function kg(t,e){const n=Z(t),r=e.query;let s=3;const i=n.queries.get(r);if(i){const o=i.Sa.indexOf(e);o>=0&&(i.Sa.splice(o,1),i.Sa.length===0?s=e.Da()?0:1:!i.ba()&&e.Da()&&(s=2))}switch(s){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function rU(t,e){const n=Z(t);let r=!1;for(const s of e){const i=s.query,o=n.queries.get(i);if(o){for(const a of o.Sa)a.Fa(s)&&(r=!0);o.wa=s}}r&&Ng(n)}function sU(t,e,n){const r=Z(t),s=r.queries.get(e);if(s)for(const i of s.Sa)i.onError(n);r.queries.delete(e)}function Ng(t){t.Ca.forEach((e=>{e.next()}))}var Zp,nT;(nT=Zp||(Zp={})).Ma="default",nT.Cache="cache";class Dg{constructor(e,n,r){this.query=e,this.xa=n,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=r||{}}Fa(e){if(!this.options.includeMetadataChanges){const r=[];for(const s of e.docChanges)s.type!==3&&r.push(s);e=new qi(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),n=!0):this.La(e,this.onlineState)&&(this.ka(e),n=!0),this.Na=e,n}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let n=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),n=!0),n}La(e,n){if(!e.fromCache||!this.Da())return!0;const r=n!=="Offline";return(!this.options.qa||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const n=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}ka(e){e=qi.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==Zp.Cache}}class JR{constructor(e,n){this.Qa=e,this.byteLength=n}$a(){return"metadata"in this.Qa}}class rT{constructor(e){this.serializer=e}$s(e){return or(this.serializer,e)}Us(e){return e.metadata.exists?cd(this.serializer,e.document,!1):Xe.newNoDocument(this.$s(e.metadata.name),this.Ks(e.metadata.readTime))}Ks(e){return pt(e)}}class Og{constructor(e,n){this.Ua=e,this.serializer=n,this.Ka=[],this.Wa=[],this.collectionGroups=new Set,this.progress=YR(e)}get queries(){return this.Ka}get documents(){return this.Wa}Ga(e){this.progress.bytesLoaded+=e.byteLength;let n=this.progress.documentsLoaded;if(e.Qa.namedQuery)this.Ka.push(e.Qa.namedQuery);else if(e.Qa.documentMetadata){this.Wa.push({metadata:e.Qa.documentMetadata}),e.Qa.documentMetadata.exists||++n;const r=be.fromString(e.Qa.documentMetadata.name);this.collectionGroups.add(r.get(r.length-2))}else e.Qa.document&&(this.Wa[this.Wa.length-1].document=e.Qa.document,++n);return n!==this.progress.documentsLoaded?(this.progress.documentsLoaded=n,{...this.progress}):null}za(e){const n=new Map,r=new rT(this.serializer);for(const s of e)if(s.metadata.queries){const i=r.$s(s.metadata.name);for(const o of s.metadata.queries){const a=(n.get(o)||Ie()).add(i);n.set(o,a)}}return n}async ja(e){const n=await DF(e,new rT(this.serializer),this.Wa,this.Ua.id),r=this.za(this.documents);for(const s of this.Ka)await OF(e,s,r.get(s.name));return this.progress.taskState="Success",{progress:this.progress,Ja:this.collectionGroups,Ha:n}}}function YR(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}class XR{constructor(e){this.key=e}}class ZR{constructor(e){this.key=e}}class eS{constructor(e,n){this.query=e,this.Ya=n,this.Za=null,this.hasCachedResults=!1,this.current=!1,this.Xa=Ie(),this.mutatedKeys=Ie(),this.eu=jA(e),this.tu=new Pi(this.eu)}get nu(){return this.Ya}ru(e,n){const r=n?n.iu:new eT,s=n?n.tu:this.tu;let i=n?n.mutatedKeys:this.mutatedKeys,o=s,a=!1;const c=this.query.limitType==="F"&&s.size===this.query.limit?s.last(
37):null,l=this.query.limitType==="L"&&s.size===this.query.limit?s.first():null;if(e.inorderTraversal(((h,d)=>{const f=s.get(h),m=Au(this.query,d)?d:null,_=!!f&&this.mutatedKeys.has(f.key),E=!!m&&(m.hasLocalMutations||this.mutatedKeys.has(m.key)&&m.hasCommittedMutations);let v=!1;f&&m?f.data.isEqual(m.data)?_!==E&&(r.track({type:3,doc:m}),v=!0):this.su(f,m)||(r.track({type:2,doc:m}),v=!0,(c&&this.eu(m,c)>0||l&&this.eu(m,l)<0)&&(a=!0)):!f&&m?(r.track({type:0,doc:m}),v=!0):f&&!m&&(r.track({type:1,doc:f}),v=!0,(c||l)&&(a=!0)),v&&(m?(o=o.add(m),i=E?i.add(h):i.delete(h)):(o=o.delete(h),i=i.delete(h)))})),this.query.limit!==null)for(;o.size>this.query.limit;){const h=this.query.limitType==="F"?o.last():o.first();o=o.delete(h.key),i=i.delete(h.key),r.track({type:1,doc:h})}return{tu:o,iu:r,Cs:a,mutatedKeys:i}}su(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,s){const i=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const o=e.iu.ya();o.sort(((h,d)=>(function(m,_){const E=v=>{switch(v){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return re(20277,{Rt:v})}};return E(m)-E(_)})(h.type,d.type)||this.eu(h.doc,d.doc))),this.ou(r),s=s??!1;const a=n&&!s?this._u():[],c=this.Xa.size===0&&this.current&&!s?1:0,l=c!==this.Za;return this.Za=c,o.length!==0||l?{snapshot:new qi(this.query,e.tu,i,o,e.mutatedKeys,c===0,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),au:a}:{au:a}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new eT,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{au:[]}}uu(e){return!this.Ya.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach((n=>this.Ya=this.Ya.add(n))),e.modifiedDocuments.forEach((n=>{})),e.removedDocuments.forEach((n=>this.Ya=this.Ya.delete(n))),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Xa;this.Xa=Ie(),this.tu.forEach((r=>{this.uu(r.key)&&(this.Xa=this.Xa.add(r.key))}));const n=[];return e.forEach((r=>{this.Xa.has(r)||n.push(new ZR(r))})),this.Xa.forEach((r=>{e.has(r)||n.push(new XR(r))})),n}cu(e){this.Ya=e.Qs,this.Xa=Ie();const n=this.ru(e.documents);return this.applyChanges(n,!0)}lu(){return qi.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Za===0,this.hasCachedResults)}}const Ws="SyncEngine";class iU{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class oU{constructor(e){this.key=e,this.hu=!1}}class aU{constructor(e,n,r,s,i,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=s,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.Pu={},this.Tu=new zr((a=>UA(a)),bu),this.Iu=new Map,this.Eu=new Set,this.du=new Je(X.comparator),this.Au=new Map,this.Ru=new _g,this.Vu={},this.mu=new Map,this.fu=ji.cr(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function cU(t,e,n=!0){const r=md(t);let s;const i=r.Tu.get(e);return i?(r.sharedClientState.addLocalQueryTarget(i.targetId),s=i.view.lu()):s=await tS(r,e,n,!0),s}async function uU(t,e){const n=md(t);await tS(n,e,!0,!1)}async function tS(t,e,n,r){const s=await ta(t.localStore,Yt(e)),i=s.targetId,o=t.sharedClientState.addLocalQueryTarget(i,n);let a;return r&&(a=await xg(t,e,i,o==="current",s.resumeToken)),t.isPrimaryClient&&n&&pd(t.remoteStore,s),a}async function xg(t,e,n,r,s){t.pu=(d,f,m)=>(async function(E,v,O,N){let y=v.view.ru(O);y.Cs&&(y=await Ih(E.localStore,v.query,!1).then((({documents:b})=>v.view.ru(b,y))));const S=N&&N.targetChanges.get(v.targetId),D=N&&N.targetMismatches.get(v.targetId)!=null,M=v.view.applyChanges(y,E.isPrimaryClient,S,D);return em(E,v.targetId,M.au),M.snapshot})(t,d,f,m);const i=await Ih(t.localStore,e,!0),o=new eS(e,i.Qs),a=o.ru(i.documents),c=Pu.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",s),l=o.applyChanges(a,t.isPrimaryClient,c);em(t,n,l.au);const h=new iU(e,n,o);return t.Tu.set(e,h),t.Iu.has(n)?t.Iu.get(n).push(e):t.Iu.set(n,[e]),l.snapshot}async function lU(t,e,n){const r=Z(t),s=r.Tu.get(e),i=r.Iu.get(s.targetId);if(i.length>1)return r.Iu.set(s.targetId,i.filter((o=>!bu(o,e)))),void r.Tu.delete(e);
37r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(s.targetId),r.sharedClientState.isActiveQueryTarget(s.targetId)||await na(r.localStore,s.targetId,!1).then((()=>{r.sharedClientState.clearQueryState(s.targetId),n&&ra(r.remoteStore,s.targetId),sa(r,s.targetId)})).catch($s)):(sa(r,s.targetId),await na(r.localStore,s.targetId,!0))}async function hU(t,e){const n=Z(t),r=n.Tu.get(e),s=n.Iu.get(r.targetId);n.isPrimaryClient&&s.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),ra(n.remoteStore,r.targetId))}async function dU(t,e,n){const r=Fg(t);try{const s=await(function(o,a){const c=Z(o),l=Fe.now(),h=a.reduce(((m,_)=>m.add(_.key)),Ie());let d,f;return c.persistence.runTransaction("Locally write mutations","readwrite",(m=>{let _=fn(),E=Ie();return c.Ns.getEntries(m,h).next((v=>{_=v,_.forEach(((O,N)=>{N.isValidDocument()||(E=E.add(O))}))})).next((()=>c.localDocuments.getOverlayedDocuments(m,_))).next((v=>{d=v;const O=[];for(const N of a){const y=MM(N,d.get(N.key).overlayedDocument);y!=null&&O.push(new Qr(N.key,y,PA(y.value.mapValue),st.exists(!0)))}return c.mutationQueue.addMutationBatch(m,l,O,a)})).next((v=>{f=v;const O=v.applyToLocalDocumentSet(d,E);return c.documentOverlayCache.saveOverlays(m,v.batchId,O)}))})).then((()=>({batchId:f.batchId,changes:qA(d)})))})(r.localStore,e);r.sharedClientState.addPendingMutation(s.batchId),(function(o,a,c){let l=o.Vu[o.currentUser.toKey()];l||(l=new Je(_e)),l=l.insert(a,c),o.Vu[o.currentUser.toKey()]=l})(r,s.batchId,n),await Jr(r,s.changes),await va(r.remoteStore)}catch(s){const i=Aa(s,"Failed to persist write");n.reject(i)}}async function nS(t,e){const n=Z(t);try{const r=await kF(n.localStore,e);
37e.targetChanges.forEach(((s,i)=>{const o=n.Au.get(i);o&&(ce(s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size<=1,22616),s.addedDocuments.size>0?o.hu=!0:s.modifiedDocuments.size>0?ce(o.hu,14607):s.removedDocuments.size>0&&(ce(o.hu,42227),o.hu=!1))})),await Jr(n,r,e)}catch(r){await $s(r)}}function sT(t,e,n){const r=Z(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const s=[];r.Tu.forEach(((i,o)=>{const a=o.view.va(e);a.snapshot&&s.push(a.snapshot)})),(function(o,a){const c=Z(o);c.onlineState=a;let l=!1;c.queries.forEach(((h,d)=>{for(const f of d.Sa)f.va(a)&&(l=!0)})),l&&Ng(c)})(r.eventManager,e),s.length&&r.Pu.H_(s),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function fU(t,e,n){const r=Z(t);r.sharedClientState.updateQueryState(e,"rejected",n);const s=r.Au.get(e),i=s&&s.key;if(i){let o=new Je(X.comparator);o=o.insert(i,Xe.newNoDocument(i,he.min()));const a=Ie().add(i),c=new Su(he.min(),new Map,new Je(_e),o,a);await nS(r,c),r.du=r.du.remove(i),r.Au.delete(e),Mg(r)}else await na(r.localStore,e,!1).then((()=>sa(r,e,n))).catch($s)}async function pU(t,e){const n=Z(t),r=e.batch.batchId;try{const s=await CF(n.localStore,e);Lg(n,r,null),Vg(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await Jr(n,s)}catch(s){await $s(s)}}async function mU(t,e,n){const r=Z(t);try{const s=await(function(o,a){const c=Z(o);return c.persistence.runTransaction("Reject batch","readwrite-primary",(l=>{let h;return c.mutationQueue.lookupMutationBatch(l,a).next((d=>
37(ce(d!==null,37113),h=d.keys(),c.mutationQueue.removeMutationBatch(l,d)))).next((()=>c.mutationQueue.performConsistencyCheck(l))).next((()=>c.documentOverlayCache.removeOverlaysForBatchId(l,h,a))).next((()=>c.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(l,h))).next((()=>c.localDocuments.getDocuments(l,h)))}))})(r.localStore,e);Lg(r,e,n),Vg(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await Jr(r,s)}catch(s){await $s(s)}}async function gU(t,e){const n=Z(t);Gs(n.remoteStore)||H(Ws,"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{const r=await(function(o){const a=Z(o);return a.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(c=>a.mutationQueue.getHighestUnacknowledgedBatchId(c)))})(n.localStore);if(r===Cs)return void e.resolve();const s=n.mu.get(r)||[];s.push(e),n.mu.set(r,s)}catch(r){const s=Aa(r,"Initialization of waitForPendingWrites() operation failed");e.reject(s)}}function Vg(t,e){(t.mu.get(e)||[]).forEach((n=>{n.resolve()})),t.mu.delete(e)}function Lg(t,e,n){const r=Z(t);let s=r.Vu[r.currentUser.toKey()];if(s){const i=s.get(e);i&&(n?i.reject(n):i.resolve(),s=s.remove(e)),r.Vu[r.currentUser.toKey()]=s}}
vendor: 1,253 bytes, line 37
37function sa(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Iu.get(e))t.Tu.delete(r),n&&t.Pu.yu(r,n);t.Iu.delete(e),t.isPrimaryClient&&t.Ru.jr(e).forEach((r=>{t.Ru.containsKey(r)||rS(t,r)}))}function rS(t,e){t.Eu.delete(e.path.canonicalString());const n=t.du.get(e);n!==null&&(ra(t.remoteStore,n),t.du=t.du.remove(e),t.Au.delete(n),Mg(t))}function em(t,e,n){for(const r of n)r instanceof XR?(t.Ru.addReference(r.key,e),_U(t,r)):r instanceof ZR?(H(Ws,"Document no longer in limbo: "+r.key),t.Ru.removeReference(r.key,e),t.Ru.containsKey(r.key)||rS(t,r.key)):re(19791,{wu:r})}function _U(t,e){const n=e.key,r=n.path.canonicalString();t.du.get(n)||t.Eu.has(r)||(H(Ws,"New document in limbo: "+n),t.Eu.add(r),Mg(t))}function Mg(t){for(;t.Eu.size>0&&t.du.size<t.maxConcurrentLimboResolutions;){const e=t.Eu.values().next().value;t.Eu.delete(e);const n=new X(be.fromString(e)),r=t.fu.next();t.Au.set(r,new oU(n)),t.du=t.du.insert(n,r),pd(t.remoteStore,new Rr(Yt(Ea(n.path)),r,"TargetPurposeLimboResolution",hn.ce))}}async function Jr(t,e,n){const r=Z(t),s=[],i=[],o=[];r.Tu.isEmpty()||(r.Tu.forEach(((a,c)=>{o.push(r.pu(c,e,n).then((l=>{if((l||n)&&r.isPrimaryClient){const h=l?!l.fromCache:n?.targetChanges.get(c.targetId)?.current;
37r.sharedClientState.updateQueryState(c.targetId,h?"current":"not-current")}if(l){s.push(l);const h=Tg.As(c.targetId,l);i.push(h)}})))})),await Promise.all(o),r.Pu.H_(s),await(async function(c,l){const h=Z(c);try{await h.persistence.runTransaction("notifyLocalViewChanges","readwrite",(d=>V.forEach(l,(f=>V.forEach(f.Es,(m=>h.persistence.referenceDelegate.addReference(d,f.targetId,m))).next((()=>V.forEach(f.ds,(m=>h.persistence.referenceDelegate.removeReference(d,f.targetId,m)))))))))}catch(d){if(!qs(d))throw d;H(wg,"Failed to update sequence numbers: "+d)}for(const d of l){const f=d.targetId;if(!d.fromCache){const m=h.Ms.get(f),_=m.snapshotVersion,E=m.withLastLimboFreeSnapshotVersion(_);h.Ms=h.Ms.insert(f,E)}}})(r.localStore,i))}async function yU(t,e){const n=Z(t);if(!n.currentUser.isEqual(e)){H(Ws,"User change. New user:",e.toKey());const r=await OR(n.localStore,e);n.currentUser=e,(function(i,o){i.mu.forEach((a=>{a.forEach((c=>{c.reject(new $(F.CANCELLED,o))}))})),i.mu.clear()})(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await Jr(n,r.Ls)}}function EU(t,e){const n=Z(t),r=n.Au.get(e);if(r&&r.hu)return Ie().add(r.key);{let s=Ie();const i=n.Iu.get(e);if(!i)return s;for(const o of i){const a=n.Tu.get(o);s=s.unionWith(a.view.nu)}return s}}async function IU(t,e){const n=Z(t),r=await Ih(n.localStore,e.query,!0),s=e.view.cu(r);return n.isPrimaryClient&&em(n,e.targetId,s.au),s}async function TU(t,e){const n=Z(t);return MR(n.localStore,e).then((r=>Jr(n,r)))}async function wU(t,e,n,r){const s=Z(t),i=await(function(a,c){const l=Z(a),h=Z(l.mutationQueue);return l.persistence.runTransaction("Lookup mutation documents","readonly",(d=>h.er(d,c).next((f=>f?l.localDocuments.getDocuments(d,f):V.resolve(null)))))})(s.localStore,e);i!==null?(n==="pending"?await va(s.remoteStore):n==="acknowledged"||n==="rejected"?(Lg(s,e,r||null),Vg(s,e),(function(a,c){Z(Z(a).mutation
37Queue).ir(c)})(s.localStore,e)):re(6720,"Unknown batchState",{Su:n}),await Jr(s,i)):H(Ws,"Cannot apply mutation batch with id: "+e)}async function vU(t,e){const n=Z(t);if(md(n),Fg(n),e===!0&&n.gu!==!0){const r=n.sharedClientState.getAllActiveQueryTargets(),s=await iT(n,r.toArray());n.gu=!0,await Xp(n.remoteStore,!0);for(const i of s)pd(n.remoteStore,i)}else if(e===!1&&n.gu!==!1){const r=[];let s=Promise.resolve();n.Iu.forEach(((i,o)=>{n.sharedClientState.isLocalQueryTarget(o)?r.push(o):s=s.then((()=>(sa(n,o),na(n.localStore,o,!0)))),ra(n.remoteStore,o)})),await s,await iT(n,r),(function(o){const a=Z(o);a.Au.forEach(((c,l)=>{ra(a.remoteStore,l)})),a.Ru.Jr(),a.Au=new Map,a.du=new Je(X.comparator)})(n),n.gu=!1,await Xp(n.remoteStore,!1)}}async function iT(t,e,n){const r=Z(t),s=[],i=[];for(const o of e){let a;const c=r.Iu.get(o);if(c&&c.length!==0){a=await ta(r.localStore,Yt(c[0]));for(const l of c){const h=r.Tu.get(l),d=await IU(r,h);d.snapshot&&i.push(d.snapshot)}}else{const l=await LR(r.localStore,o);a=await ta(r.localStore,l),await xg(r,sS(l),o,!1,a.resumeToken)}s.push(a)}return r.Pu.H_(i),s}function sS(t){return LA(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function bU(t){return(function(n){return Z(Z(n).persistence).Ts()})(Z(t).localStore)}async function AU(t,e,n,r){const s=Z(t);if(s.gu)return void H(Ws,"Ignoring unexpected query state notification.");const i=s.Iu.get(e);if(i&&i.length>0)switch(n){case"current":case"not-current":{const o=await MR(s.localStore,BA(i[0])),a=Su.createSynthesizedRemoteEventForCurrentChange(e,n==="current",ct.EMPTY_BYTE_STRING);await Jr(s,o,a);break}case"rejected":await na(s.localStore,e,!0),sa(s,e,r);break;default:re(64155,n)}}async function RU(t,e,n){const r=md(t);if(r.gu){for(const s of e){if(r.Iu.has(s)&&r.sharedClientState.isActiveQueryTarget(s)){H(Ws,"Adding an already active target "+s);continue}const i=await LR(r.localStore,s),o=await ta(r.localStore,i);await xg(r,sS(i),o.targetId,!1,o.resumeToken),pd(r.remoteStore,o)}for(const s of n)r.Iu.has(s)&&await na(r.localStore,s,!1).then((()=>{ra(r.remoteStore,s),sa(r,s)})).catch($s)}}function md(t){const e=Z(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=nS.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=EU.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=fU.bind(null,e),e.Pu.H_=rU.bind(null,e.eventManager),e.Pu.yu=sU.bind(null,e.eventManager),e}function Fg(t){const e=Z(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=pU.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=mU.bind(null,e),e}function SU(t,e,n){const r=Z(t);(async function(i,o,a){try{const c=await o.getMetadata();
vendor: 4,229 bytes, line 37
37if(await(function(m,_){const E=Z(m),v=pt(_.createTime);return E.persistence.runTransaction("hasNewerBundle","readonly",(O=>E.Ii.getBundleMetadata(O,_.id))).then((O=>!!O&&O.createTime.compareTo(v)>=0))})(i.localStore,c))return await o.close(),a._completeWith((function(m){return{taskState:"Success",documentsLoaded:m.totalDocuments,bytesLoaded:m.totalBytes,totalDocuments:m.totalDocuments,totalBytes:m.totalBytes}})(c)),Promise.resolve(new Set);a._updateProgress(YR(c));const l=new Og(c,o.serializer);let h=await o.bu();for(;h;){const f=await l.Ga(h);f&&a._updateProgress(f),h=await o.bu()}const d=await l.ja(i.localStore);return await Jr(i,d.Ha,void 0),await(function(m,_){const E=Z(m);return E.persistence.runTransaction("Save bundle","readwrite",(v=>E.Ii.saveBundleMetadata(v,_)))})(i.localStore,c),a._completeWith(d.progress),Promise.resolve(d.Ja)}catch(c){return vn(Ws,`Loading bundle failed with ${c}`),a._failWith(c),Promise.resolve(new Set)}})(r,e,n).then((s=>{r.sharedClientState.notifyBundleLoaded(s)}))}class ia{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Qi(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,n){return null}Mu(e,n){return null}vu(e){return DR(this.persistence,new NR,e.initialUser,this.serializer)}Cu(e){return new yg(fd.mi,this.serializer)}Du(e){return new $R}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}ia.provider={build:()=>new ia};class Ug extends ia{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,n){ce(this.persistence.referenceDelegate instanceof Eh,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new AR(r,e.asyncQueue,n)}Cu(e){const n=this.cacheSizeBytes!==void 0?Kt.withCacheSize(this.cacheSizeBytes):Kt.DEFAULT;return new yg((r=>Eh.mi(r,n)),this.serializer)}}class Bg extends ia{constructor(e,n,r){super(),this.xu=e,this.cacheSizeBytes=n,this.forceOwnership=r,this.kind="persistent",this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await this.xu.initialize(this,e),await Fg(this.xu.syncEngine),await va(this.xu.remoteStore),await this.persistence.Ji((()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve())))}vu(e){return DR(this.persistence,new NR,e.initialUser,this.serializer)}Fu(e,n){const r=this.persistence.referenceDelegate.garbageCollector;return new AR(r,e.asyncQueue,n)}Mu(e,n){const r=new jL(n,this.persistence);return new BL(e.asyncQueue,r)}Cu(e){const n=Ig(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=this.cacheSizeBytes!==void 0?Kt.withCacheSize(this.cacheSizeBytes):Kt.DEFAULT;return new Eg(this.synchronizeTabs,n,e.clientId,r,e.asyncQueue,qR(),Ll(),this.serializer,this.sharedClientState,!!this.forceOwnership)}Du(e){return new $R}}class iS extends Bg{constructor(e,n){super(e,n,!1),this.xu=e,this.cacheSizeBytes=n,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);const n=this.xu.syncEngine;this.sharedClientState instanceof Cf&&(this.sharedClientState.syncEngine={Co:wU.bind(null,n),vo:AU.bind(null,n),Fo:RU.bind(null,n),Ts:bU.bind(null,n),Do:TU.bind(null,n)},await this.sharedClientState.start()),await this.persistence.Ji((async r=>{await vU(this.xu.syncEngine,r),this.gcScheduler&&(r&&!this.gcScheduler.started?this.gcScheduler.start():r||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(r&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():r||this.indexBackfillerScheduler.stop())}))}Du(e){const n=qR();if(!Cf.v(n))throw new $(F.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const r=Ig(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new Cf(n,e.asyncQueue,r,e.clientId,e.initialUser)}}class Bs{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedCl
37ientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>sT(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=yU.bind(null,this.syncEngine),await Xp(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return(function(){return new nU})()}createDatastore(e){const n=Qi(e.databaseInfo.databaseId),r=(function(i){return new FF(i)})(e.databaseInfo);return(function(i,o,a,c){return new $F(i,o,a,c)})(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return(function(r,s,i,o,a){return new HF(r,s,i,o,a)})(this.localStore,this.datastore,e.asyncQueue,(n=>sT(this.syncEngine,n,0)),(function(){return YI.v()?new YI:new xF})())}createSyncEngine(e,n){return(function(s,i,o,a,c,l,h){const d=new aU(s,i,o,a,c,l);return h&&(d.gu=!0),d})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){await(async function(n){const r=Z(n);H($i,"RemoteStore shutting down."),r.Ea.add(5),await wa(r),r.Aa.shutdown(),r.Ra.set("Unknown")})(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}Bs.provider={build:()=>new Bs};function oT(t,e=10240){let n=0;return{async read(){if(n<t.byteLength){const r={value:t.slice(n,n+e),done:!1};return n+=e,r}return{done:!0}},async cancel(){},releaseLock(){},closed:Promise.resolve()}}class gd{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):ft("Uncaught Error in snapshot listener:",e.toString()))}Nu(){this.muted=!0}Ou(e,n){setTimeout((()=>{this.muted||e(n)}),0)}}class PU{constructor(e,n){this.Bu=e,this.serializer=n,this.metadata=new xt,this.buffer=new Uint8Array,this.Lu=(function(){return new TextDecoder("utf-8")})(),this.ku().then((r=>{r&&r.$a()?this.metadata.resolve(r.Qa.metadata):this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is
38             ${JSON.stringify(r?.Qa)}`))}),(r=>this.metadata.reject(r)))}close(){return this.Bu.cancel()}async getMetadata(){return this.metadata.promise}async bu(){return await this.getMetadata(),this.ku()}async ku(){const e=await this.qu();if(e===null)return null;const n=this.Lu.decode(e),r=Number(n);isNaN(r)&&this.Qu(`length string (${n}) is not valid number`);const s=await this.$u(r);return new JR(JSON.parse(s),e.length+r)}Uu(){return this.buffer.findIndex((e=>e===123))}async qu(){for(;this.Uu()<0&&!await this.Ku(););if(this.buffer.length===0)return null;const e=this.Uu();e<0&&this.Qu("Reached the end of bundle when a length string is expected.");const n=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),n}async $u(e){for(;this.buffer.length<e;)await this.Ku()&&this.Qu("Reached the end of bundle when more is expected.");const n=this.Lu.decode(this.buffer.slice(0,e));return this.buffer=this.buffer.slice(e),n}Qu(e){throw this.Bu.cancel(),new Error(`Invalid bundle format: ${e}`)}async Ku(){const e=await this.Bu.read();if(!e.done){const n=new Uint8Array(this.buffer.length+e.value.length);n.set(this.buffer),n.set(e.value,this.buffer.length),this.buffer=n}return e.done}}class CU{constructor(e,n){this.bundleData=e,this.serializer=n,this.cursor=0,this.elements=[];let r=this.bu();if(!r||!r.$a())throw new Error(`The first element of the bundle is not a metadata object, it is
39         ${JSON.stringify(r?.Qa)}`);this.metadata=r;do r=this.bu(),r!==null&&this.elements.push(r);while(r!==null)}getMetadata(){return this.metadata}Wu(){return this.elements}bu(){if(this.cursor===this.bundleData.length)return null;const e=this.qu(),n=this.$u(e);return new JR(JSON.parse(n),e)}$u(e){if(this.cursor+e>this.bundleData.length)throw new $(F.INTERNAL,"Reached the end of bundle when more is expected.");return this.bundleData.slice(this.cursor,this.cursor+=e)}qu(){const e=this.cursor;let n=this.cursor;for(;n<this.bundleData.length;){if(this.bundleData[n]==="{"){if(n===e)throw new Error("First character is a bracket and not a number");return this.cursor=n,Number(this.bundleData.slice(e,n))}n++}throw new Error("Reached the end of bundle when more is expected.")}}class kU{constructor(e){this.datastore=e,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastTransactionError=null,this.writtenDocs=new Set}async lookup(e){if(this.ensureCommitNotCalled(),this.mutations.length>
vendor: 5,530 bytes, line 39
390)throw this.lastTransactionError=new $(F.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes."),this.lastTransactionError;const n=await(async function(s,i){const o=Z(s),a={documents:i.map((d=>su(o.serializer,d)))},c=await o.Ho("BatchGetDocuments",o.serializer.databaseId,be.emptyPath(),a,i.length),l=new Map;c.forEach((d=>{const f=WM(o.serializer,d);l.set(f.key.toString(),f)}));const h=[];return i.forEach((d=>{const f=l.get(d.toString());ce(!!f,55234,{key:d}),h.push(f)})),h})(this.datastore,e);return n.forEach((r=>this.recordVersion(r))),n}set(e,n){this.write(n.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,n){try{this.write(n.toMutation(e,this.preconditionForUpdate(e)))}catch(r){this.lastTransactionError=r}this.writtenDocs.add(e.toString())}delete(e){this.write(new Ta(e,this.precondition(e))),this.writtenDocs.add(e.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastTransactionError)throw this.lastTransactionError;const e=this.readVersions;this.mutations.forEach((n=>{e.delete(n.key.toString())})),e.forEach(((n,r)=>{const s=X.fromPath(r);this.mutations.push(new ug(s,this.precondition(s)))})),await(async function(r,s){const i=Z(r),o={writes:s.map((a=>iu(i.serializer,a)))};await i.Go("Commit",i.serializer.databaseId,be.emptyPath(),o)})(this.datastore,this.mutations),this.committed=!0}recordVersion(e){let n;if(e.isFoundDocument())n=e.version;else{if(!e.isNoDocument())throw re(50498,{Gu:e.constructor.name});n=he.min()}const r=this.readVersions.get(e.key.toString());if(r){if(!n.isEqual(r))throw new $(F.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),n)}precondition(e){const n=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&n?n.isEqual(he.min())?st.exists(!1):st.updateTime(n):st.none()}preconditionForUpdate(e){const n=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&n){if(n.isEqual(he.min()))throw new $(F.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return st.updateTime(n)}return st.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}}class NU{constructor(e,n,r,s,i){this.asyncQueue=e,this.datastore=n,this.options=r,this.updateFunction=s,this.deferred=i,this.zu=r.maxAttempts,this.M_=new bg(this.asyncQueue,"transaction_retry")}ju(){this.zu-=1,this.Ju()}Ju(){this.M_.p_((async()=>{const e=new kU(this.datastore),n=this.Hu(e);n&&n.then((r=>{this.asyncQueue.enqueueAndForget((()=>e.commit().then((()=>{this.deferred.resolve(r)})).catch((s=>{this.Yu(s)}))))})).catch((r=>{this.Yu(r)}))}))}Hu(e){try{const n=this.updateFunction(e);return!Tu(n)&&n.catch&&n.then?n:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(n){return this.deferred.reject(n),null}}Yu(e){this.zu>0&&this.Zu(e)?(this.zu-=1,this.asyncQueue.enqueueAndForget((()=>(this.Ju(),Promise.resolve())))):this.deferred.reject(e)}Zu(e){if(e?.name==="FirebaseError"){const n=e.code;return n==="aborted"||n==="failed-precondition"||n==="already-exists"||!eR(n)}return!1}}const js="FirestoreClient";class DU{constructor(e,n,r,s,i){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=s,this.user=Nt.UNAUTHENTICATED,this.clientId=Yh.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=i,this.authCredentials.start(r,(async o=>{H(js,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o})),this.appCheckCredentials.start(r,(o=>(H(js,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user))))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new xt;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=Aa(n,"Failed to shutdown persistence");e.reject(r)}})),e.promise}}async function Nf(t,e){t.asyncQueue.verifyOperationInProgress(),H(js,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener((async s=>{r.isEqual(s)||(await OR(e.localStore,s),r=s)})),e.persistence.setDatabaseDeletedListener((()=>t.terminate())),t._offlineComponents=e}async function aT(t,e){t.asyncQueue.verifyOperationInProgress();const n=await jg(t);H(js,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener((r=>ZI(e.remoteStore,r))),t.setAppCheckTokenChangeListener(((r,s)=>ZI(e.remoteStore,s))),t._onlineComponents=e}async function jg(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){H(js,"Using user provided OfflineComponentProvider");try{await Nf(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!(function(s){return s.name==="FirebaseError"?s.code===F.FAILED_PRECONDITION||s.code===F.UNIMPLEMENT
39ED:!(typeof DOMException<"u"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11})(n))throw n;vn("Error using user provided cache. Falling back to memory cache: "+n),await Nf(t,new ia)}}else H(js,"Using default OfflineComponentProvider"),await Nf(t,new Ug(void 0));return t._offlineComponents}async function _d(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(H(js,"Using user provided OnlineComponentProvider"),await aT(t,t._uninitializedComponentsProvider._online)):(H(js,"Using default OnlineComponentProvider"),await aT(t,new Bs))),t._onlineComponents}function oS(t){return jg(t).then((e=>e.persistence))}function Ra(t){return jg(t).then((e=>e.localStore))}function aS(t){return _d(t).then((e=>e.remoteStore))}function $g(t){return _d(t).then((e=>e.syncEngine))}function cS(t){return _d(t).then((e=>e.datastore))}async function oa(t){const e=await _d(t),n=e.eventManager;return n.onListen=cU.bind(null,e.syncEngine),n.onUnlisten=lU.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=uU.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=hU.bind(null,e.syncEngine),n}function OU(t){return t.asyncQueue.enqueue((async()=>{const e=await oS(t),n=await aS(t);return e.setNetworkEnabled(!0),(function(s){const i=Z(s);return i.Ea.delete(0),Cu(i)})(n)}))}function xU(t){return t.asyncQueue.enqueue((async()=>{const e=await oS(t),n=await aS(t);return e.setNetworkEnabled(!1),(async function(s){const i=Z(s);i.Ea.add(0),await wa(i),i.Ra.set("Offline")})(n)}))}function VU(t,e){const n=new xt;return t.asyncQueue.enqueueAndForget((async()=>(async function(s,i,o){try{const a=await(function(l,h){const d=Z(l);return d.persistence.runTransaction("read document","readonly",(f=>d.localDocuments.getDocument(f,h)))})(s,i);a.isFoundDocument()?o.resolve(a):a.isNoDocument()?o.resolve(null):o.reject(new $(F.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(a){const c=Aa(a,`Failed to get document '${i} from cache`);o.reject(c)}})(await Ra(t),e,n))),n.promise}function uS(t,e,n={}){const r=new xt;return t.asyncQueue.enqueueAndForget((async()=>(function(i,o,a,c,l){const h=new gd({next:f=>{h.Nu(),o.enqueueAndForget((()=>kg(i,d)));const m=f.docs.has(a);!m&&f.fromCache?l.reject(new $(F.UNAVAILABLE,"Failed to get document because the client is offline.")):m&&f.fromCache&&c&&c.source==="server"?l.reject(new $(F.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):l.resolve(f)},error:f=>l.reject(f)}),d=new Dg(Ea(a.path),h,{includeMetadataChanges:!0,qa:!0});return Cg(i,d)})(await oa(t),t.asyncQueue,e,n,r))),r.promise}function LU(t,e){const n=new xt;return t.asyncQueue.enqueueAndForget((async()=>(async function(s,i,o){try{const a=await Ih(s,i,!0),c=new eS(i,a.Qs),l=c.ru(a.documents),h=c.applyChanges(l,!1);o.resolve(h.snapshot)}catch(a){const c=Aa(a,`Failed to execute query '${i} against cache`);o.reject(c)}})(await Ra(t),e,n))),n.promise}function lS(t,e,n={}){const r=new xt;return t.asyncQueue.enqueueAndForget((async()=>(function(i,o,a,c,l){const h=new gd({next:f=>{h.Nu(),o.enqueueAndForget((()=>kg(i,d))),f.fromCache&&c.source==="server"?l.reject(new $(F.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):l.resolve(f)},error:f=>l.reject(f)}),d=new Dg(a,h,{includeMetadataChanges:!0,qa:!0});return Cg(i,d)})(await oa(t),t.asyncQueue,e,n,r))),r.promise}function MU(t,e,n){const r=new xt;return t.asyncQueue.enqueueAndForget((async()=>{try{const s=await cS(t);r.resolve((async function(o,a,c){const l=Z(o),{request:h,gt:d,parent:f}=hR(l.serializer,MA(a),c);l.connection.$o||delete h.parent;const m=(await l.Ho("RunAggregationQuery",l.serializer.databaseId,f,h,1)).filter((E=>!!E.result));ce(m.length===1,64727);const _=m[0].result?.aggregateFields;return Object.keys(_).reduce(((E,v)=>(E[d[v]]=_[v],E)),{})})(s,e,n))}catch(s){r.reject(s)}})),r.promise}function FU(t,e){const n=new gd(e);return t.asyncQueue.enqueueAndForget((async()=>(function(s,i){Z(s).Ca.add(i),i.next()})(await oa(t),n))),()=>{n.Nu(),t.asyncQueue.enqueueAndForget((async()=>(function(s,i){Z(s).Ca.delete(i)})(await oa(t),n)))}}function UU(t,e,n,r){const s=(function(o,a){let c;
39return c=typeof o=="string"?nR().encode(o):o,(function(h,d){return new PU(h,d)})((function(h,d){if(h instanceof Uint8Array)return oT(h,d);if(h instanceof ArrayBuffer)return oT(new Uint8Array(h),d);if(h instanceof ReadableStream)return h.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")})(c),a)})(n,Qi(e));t.asyncQueue.enqueueAndForget((async()=>{SU(await $g(t),s,r)}))}function BU(t,e){return t.asyncQueue.enqueue((async()=>(function(r,s){const i=Z(r);return i.persistence.runTransaction("Get named query","readonly",(o=>i.Ii.getNamedQuery(o,s)))})(await Ra(t),e)))}function hS(t,e){return(function(r,s){return new CU(r,s)})(t,e)}function jU(t,e){return t.asyncQueue.enqueue((async()=>(async function(r,s){const i=Z(r),o=i.indexManager,a=[];return i.persistence.runTransaction("Configure indexes","readwrite",(c=>o.getFieldIndexes(c).next((l=>(function(d,f,m,_,E){d=[...d],f=[...f],d.sort(m),f.sort(m);const v=d.length,O=f.length;let N=0,y=0;for(;N<O&&y<v;){const S=m(d[y],f[N]);S<0?E(d[y++]):S>0?_(f[N++]):(N++,y++)}for(;N<O;)_(f[N++]);for(;y<v;)E(d[y++])})(l,s,LL,(h=>{a.push(o.addFieldIndex(c,h))}),(h=>{a.push(o.deleteFieldIndex(c,h))})))).next((()=>V.waitFor(a)))))})(await Ra(t),e)))}function $U(t,e){return t.asyncQueue.enqueue((async()=>(function(r,s){Z(r).Fs.Vs=s})(await Ra(t),e)))}function qU(t){return t.asyncQueue.enqueue((async()=>(function(n){const r=Z(n),s=r.indexManager;return r.persistence.runTransaction("Delete All Indexes","readwrite",(i=>s.deleteAllFieldIndexes(i)))})(await Ra(t))))}function dS(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}const cT=new Map;const fS="firestore.googleapis.com",uT=!0;class lT{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new $(F.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=fS,this.ssl=uT}else this.host=e.host,this.ssl=e.ssl??uT;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=IR;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<bR)throw new $(F.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}Zb("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=dS(e.experimentalLongPollingOptions??{}),(function(r){if(r.timeoutSeconds!==void 0){if(isNaN(r.timeoutSeconds))throw new $(F.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (must not be NaN)`);if(r.timeoutSeconds<5)throw new $(F.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (minimum allowed value is 5)`);if(r.timeoutSeconds>30)throw new $(F.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (maximum allowed value is 30)`)}})(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(function(r,s){return r.timeoutSeconds===s.timeoutSeconds})(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class ku{constructor(e,n,r,s){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new lT({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new $(F.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new $(F.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new lT(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(r){if(!r)return new Yb;switch(r.type){case"firstParty":return new CL(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new $(F.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
39d credential type")}})(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return(function(n){const r=cT.get(n);r&&(H("ComponentProvider","Removing Datastore"),cT.delete(n),r.terminate())})(this),Promise.resolve()}}function pS(t,e,n,r={}){t=Ae(t,ku);const s=lr(e),i=t._getSettings(),o={...i,emulatorOptions:t._getEmulatorOptions()},a=`${e}:${n}`;s&&(yu(`https://${a}`),Jh("Firestore",!0)),i.host!==fS&&i.host!==a&&vn("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const c={...i,host:a,ssl:s,emulatorOptions:r};if(!Hn(c,o)&&(t._setSettings(c),r.mockUserToken)){let l,h;if(typeof r.mockUserToken=="string")l=r.mockUserToken,h=Nt.MOCK_USER;else{l=xb(r.mockUserToken,t._app?.options.projectId);const d=r.mockUserToken.sub||r.mockUserToken.user_id;if(!d)throw new $(F.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");h=new Nt(d)}t._authCredentials=new RL(new Jb(l,h))}}class Rt{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new Rt(this.firestore,e,this._query)}}class je{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Un(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new je(this.firestore,e,this._key)}toJSON(){return{type:je._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,n,r){if(zi(n,je._jsonSchema))return new je(e,r||null,new X(be.fromString(n.referencePath)))}}je._jsonSchemaVersion="firestore/documentReference/1.0",je._jsonSchema={type:Et("string",je._jsonSchemaVersion),referencePath:Et("string")};class Un extends Rt{constructor(e,n,r){super(e,n,Ea(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new je(this.firestore,null,new X(e))}withConverter(e){return new Un(this.firestore,e,this._path)}}function HU(t,e,...n){if(t=ue(t),Jm("collection","path",e),t instanceof ku){const r=be.fromString(e,...n);return XE(r),new Un(t,null,r)}{if(!(t instanceof je||t instanceof Un))throw new $(F.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(be.fromString(e,...n));return XE(r),new Un(t.firestore,null,r)}}function GU(t,e){if(t=Ae(t,ku),Jm("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new $(F.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new Rt(t,null,(function(r){return new Kr(be.emptyPath(),r)})(e))}function mS(t,e,...n){if(t=ue(t),arguments.length===1&&(e=Yh.newId()),Jm("doc","path",e),t instanceof ku){const r=be.fromString(e,...n);return YE(r),new je(t,null,new X(r))}{if(!(t instanceof je||t instanceof Un))throw new $(F.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(be.fromString(e,...n));return YE(r),new je(t.firestore,t instanceof Un?t.converter:null,new X(r))}}function WU(t,e){return t=ue(t),e=ue(e),(t instanceof je||t instanceof Un)&&(e instanceof je||e instanceof Un)&&t.firestore===e.firestore&&t.path===e.path&&t.converter===e.converter}function qg(t,e){return t=ue(t),e=ue(e),t instanceof Rt&&e instanceof Rt&&t.firestore===e.firestore&&bu(t._query,e._query)&&t.converter===e.converter}const hT="AsyncQueue";class dT{constructor(e=Promise.resolve()){this.Xu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new bg(this,"async_queue_retry"),this._c=()=>{const r=Ll();r&&H(hT,"Visibility state changed to "+r.visibilityState),this.M_.w_()},this.ac=e;const n=Ll();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const n=Ll();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise((()=>{}));const n=new xt;return this.cc((()=>this.ec&&this.sc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise))).then((()=>n.promise))}enqueueRetryable(e){this.enqueueAndForget((()=>(this.Xu.push(e),this.lc())))}async lc(){if(this.Xu.length!==0){try{await this.Xu[0](),this.Xu.shift(),this.M_.reset()}catch(e){if(!qs(e))throw e;H(hT,"Operation failed with retryable error: "+e)}this.Xu.length>0&&this.M_.p_((()=>this.lc()))}}cc(e){const n=this.ac.then((()=>(this.rc=!0,e().catch((r=>{throw this.nc=r,this.rc=!1,ft("INTERNAL UNHANDLED ERROR: ",fT(r)),r})).then((r=>(this.rc=!1,r))))));return this.ac=n,n}enqueueAfterDelay(e,n,r){this.uc(),this.oc.indexOf(e)>-1&&(n=0);const s=Pg.createAndSchedule(this,e,n,r,(i=>this.hc(i)));return this.tc.push(s),s}uc(){this.nc&&re(47125,{Pc:fT(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(const n of this.tc)if(n.timerId===e)return!0;return!1}Ec(e){return this.Tc().then((()=>{this.tc.sort(((n,r)=>n.targetTimeMs-r.targetTimeMs));for(const n of this.tc)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.Tc()}))}dc(e){this.oc.push(e)}hc(e){const n=this.tc.indexOf(e);this.tc.splice(n,1)}}function fT(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+`
40`+t.stack),e}function No(t){return(function(n,r){if(typeof n!="object"||n===null)return!1;const s=n;for(const i of r)if(i in s&&typeof s[i]=="function")return!0;return!1})(t,["next","error","complete"])}class gS{constructor(){this._progressObserver={},this._taskCompletionResolver=new xt,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(e,n,r){this._progressObserver={next:e,error:n,complete:r}}catch(e){return this._taskCompletionResolver.promise.catch(e)}then(e,n){return this._taskCompletionResolver.promise.then(e,n)}_completeWith(e){this._updateProgress(e),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(e)}_failWith(e){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(e),this._taskCompletionResolver.reject(e)}_updateProgress(e){this._lastProgress=e,this._progressObserver.next&&this._progressObserver.next(e)}}const KU=-1;class He extends ku{constructor(e,n,r,s){super(e,n,r,s),this.type="firestore",this._queue=new dT,this._persistenceKey=s?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new dT(e),this._firestoreClient=void 0,await e}}}function _S(t,e,n){n||(n=eu);const r=Wi(t,"firestore");if(r.isInitialized(n)){const s=r.getImmediate({identifier:n}),i=r.getOptions(n);if(Hn(i,e))return s;throw new $(F.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(e.cacheSizeBytes!==void 0&&e.localCache!==void 0)throw new $(F.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");
40if(e.cacheSizeBytes!==void 0&&e.cacheSizeBytes!==-1&&e.cacheSizeBytes<bR)throw new $(F.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return e.host&&lr(e.host)&&yu(e.host),r.initialize({options:e,instanceIdentifier:n})}function zU(t,e){const n=typeof t=="object"?t:Iu(),r=typeof t=="string"?t:e||eu,s=Wi(n,"firestore").getImmediate({identifier:r});if(!s._initialized){const i=Wm("firestore");i&&pS(s,...i)}return s}function ot(t){if(t._terminated)throw new $(F.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||yS(t),t._firestoreClient}function yS(t){const e=t._freezeSettings(),n=(function(s,i,o,a){return new gM(s,i,o,a.host,a.ssl,a.experimentalForceLongPolling,a.experimentalAutoDetectLongPolling,dS(a.experimentalLongPollingOptions),a.useFetchStreams,a.isUsingEmulator)})(t._databaseId,t._app?.options.appId||"",t._persistenceKey,e);t._componentsProvider||e.localCache?._offlineComponentProvider&&e.localCache?._onlineComponentProvider&&(t._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),t._firestoreClient=new DU(t._authCredentials,t._appCheckCredentials,t._queue,n,t._componentsProvider&&(function(s){const i=s?._online.build();return{_offline:s?._offline.build(i),_online:i}})(t._componentsProvider))}function QU(t,e){vn("enableIndexedDbPersistence() will be deprecated 
40in the future, you can use `FirestoreSettings.cache` instead.");const n=t._freezeSettings();return ES(t,Bs.provider,{build:r=>new Bg(r,n.cacheSizeBytes,e?.forceOwnership)}),Promise.resolve()}async function JU(t){vn("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");const e=t._freezeSettings();ES(t,Bs.provider,{build:n=>new iS(n,e.cacheSizeBytes)})}function ES(t,e,n){if((t=Ae(t,He))._firestoreClient||t._terminated)throw new $(F.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");if(t._componentsProvider||t._getSettings().localCache)throw new $(F.FAILED_PRECONDITION,"SDK cache is already specified.");t._componentsProvider={_online:e,_offline:n},yS(t)}function YU(t){if(t._initialized&&!t._terminated)throw new $(F.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");const e=new xt;return t._queue.enqueueAndForgetEvenWhileRestricted((async()=>{try{await(async function(r){if(!ir.v())return Promise.resolve();const s=r+kR;await ir.delete(s)})(Ig(t._databaseId,t._persistenceKey)),e.resolve()}catch(n){e.reject(n)}})),e.promise}function XU(t){return(function(n){const r=new xt;return n.asyncQueue.enqueueAndForget((async()=>gU(await $g(n),r))),r.promise})(ot(t=Ae(t,He)))}function ZU(t){return OU(ot(t=Ae(t,He)))}function e2(t){return xU(ot(t=Ae(t,He)))}function t2(t){return uL(t.app,"firestore",t._databaseId.database),t._delete()}function tm(t,e){const n=ot(t=Ae(t,He)),r=new gS;return UU(n,t._databaseId,e,r),r}function IS(t,e){return BU(ot(t=Ae(t,He)),e).then((n=>n?new Rt(t,null,n.query):null))}class aa{constructor(e="count",n){this._internalFieldPath=n,this.type="AggregateField",this.aggregateType=e}}class TS{constructor(e,n,r){this._userDataWriter=n,this._data=r,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}}class un{constructor(e){this._byteString=e}static fromBase64String(e){try{return new un(ct.fromBase64String(e))}catch(n){throw new $(F.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new un(ct.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:un._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(zi(e,un._jsonSchema))return un.fromBase64String(e.bytes)}}un._jsonSchemaVersion="firestore/bytes/1.0",un._jsonSchema={type:Et("string",un._jsonSchemaVersion),bytes:Et("string")};class Ks{constructor(...e){for(let n=0;n<e.length;++n)if(e[n].length===0)throw new $(F.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new et(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}function n2(){return new Ks(kp)}class zs{constructor(e){this._methodName=e}}class Bn{constructor(e,n){if(!isFinite(e)||e<-90||e>90)throw new $(F.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new $(F.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return _e(this._lat,e._lat)||_e(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Bn._jsonSchemaVersion}}static fromJSON(e){if(zi(e,Bn._jsonSchema))return new Bn(e.latitude,e.longitude)}}Bn._jsonSchemaVersion="firestore/geoPoint/1.0",Bn._jsonSchema={type:Et("string",Bn._jsonSchemaVersion),latitude:Et("number"),longitude:Et("number")};class Cn{constructor(e){this._values=(e||[]).map((n=>n))}toArray(){return this._values.map((e=>e))}isEqual(e){return(function(r,s){if(r.length!==s.length)return!1;for(let i=0;i<r.length;++i)if(r[i]!==s[i])return!1;return!0})(this._values,e._values)}toJSON(){return{type:Cn._jsonSchemaVersion,vectorValues:this._values}}
40static fromJSON(e){if(zi(e,Cn._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every((n=>typeof n=="number")))return new Cn(e.vectorValues);throw new $(F.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}Cn._jsonSchemaVersion="firestore/vectorValue/1.0",Cn._jsonSchema={type:Et("string",Cn._jsonSchemaVersion),vectorValues:Et("object")};const r2=/^__.*__$/;class s2{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new Qr(e,this.data,this.fieldMask,n,this.fieldTransforms):new Ia(e,this.data,n,this.fieldTransforms)}}class wS{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new Qr(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function vS(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw re(40011,{Ac:t})}}class yd{constructor(e,n,r,s,i,o){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=s,i===void 0&&this.Rc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Ac(){return this.settings.Ac}Vc(e){return new yd({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}mc(e){const n=this.path?.child(e),r=this.Vc({path:n,fc:!1});return r.gc(e),r}yc(e){const n=this.path?.child(e),r=this.Vc({path:n,fc:!1});return r.Rc(),r}wc(e){return this.Vc({path:void 0,fc:!0})}Sc(e){return bh(e,this.settings.methodName,this.settings.bc||!1,this.path,this.settings.Dc)}contains(e){return this.fieldMask.find((n=>e.isPrefixOf(n)))!==void 0||this.fieldTransforms.find((n=>e.isPrefixOf(n.field)))!==void 0}Rc(){if(this.path)for(let e=0;e<this.path.length;e++)this.gc(this.path.get(e))}gc(e){if(e.length===0)throw this.Sc("Document fields must not be empty");if(vS(this.Ac)&&r2.test(e))throw this.Sc('Document fields cannot begin and end with "__"')}}class i2{constructor(e,n,r){this.databaseId=e,this.ignoreUndefinedProperties=n,this.serializer=r||Qi(e)}Cc(e,n,r,s=!1){return new yd({Ac:e,methodName:n,Dc:r,path:et.emptyPath(),fc:!1,bc:s},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Ji(t){const e=t._freezeSettings(),n=Qi(t._databaseId);return new i2(t._databaseId,!!e.ignoreUndefinedProperties,n)}function Ed(t,e,n,r,s,i={}){const o=t.Cc(i.merge||i.mergeFields?2:0,e,n,s);Jg("Data must be an object, but it was:",o,r);const a=RS(r,o);let c,l;if(i.merge)c=new dn(o.fieldMask),l=o.fieldTransforms;else if(i.mergeFields){const h=[];for(const d of i.mergeFields){const f=ou(e,d,n);if(!o.contains(f))throw new $(F.INVALID_ARGUMENT,`Field '${f}' is specified in your field mask but missing from your input data.`);PS(h,f)||h.push(f)}c=new dn(h),l=o.fieldTransforms.filter((d=>c.covers(d.field)))}else c=null,l=o.fieldTransforms;return new s2(new jt(a),c,l)}class Nu extends zs{_toFieldTransform(e){if(e.Ac!==2)throw e.Ac===1?e.Sc(`${this._methodName}() can only appear at the top level of your update data`):e.Sc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Nu}}function bS(t,e,n){return new yd({Ac:3,Dc:e.settings.Dc,methodName:t._methodName,fc:n},e.databaseId,e.serializer,e.ignoreUndefinedProperties)}class Hg extends zs{_toFieldTransform(e){return new Ru(e.path,new Xo)}isEqual(e){return e instanceof Hg}}class Gg extends zs{constructor(e,n){super(e),this.vc=n}_toFieldTransform(e){const n=bS(this,e,!0),r=this.vc.map((i=>Yi(i,n))),s=new Mi(r);return new Ru(e.path,s)}isEqual(e){return e instanceof Gg&&Hn(this.vc,e.vc)}}class Wg extends zs{constructor(e,n){super(e),this.vc=n}_toFieldTransform(e){const n=bS(this,e,!0),r=this.vc.map((i=>Yi(i,n))),s=new Fi(r);return new Ru(e.path,s)}isEqual(e){return e instanceof Wg&&Hn(this.vc,e.vc)}}class Kg extends zs{constructor(e,n){super(e),this.Fc=n}_toFieldTransform(e){const n=new Zo(e.serializer,WA(e.serializer,this.Fc));return new Ru(e.path,n)}isEqual(e){return e instanceof Kg&&this.Fc===e.Fc}}function zg(t,e,n,r){const s=t.Cc(1,e,n);Jg("Data must be an object, but it was:",s,r);const i=[],o=jt.empty();Hs(r,((c,l)=>{const h=Id(e,c,n);l=ue(l);const d=s.yc(h);if(l instanceof Nu)i.push(h);else{const f=Yi(l,d);f!=null&&(i.push(h),o.set(h,f))}}));const a=new dn(i);return new wS(o,a,s.fieldTransforms)}function Qg(t,e,n,r,s,i){const o=t.Cc(1,e,n),a=[ou(e,r,n)],c=[s];if(i.length%2!=0)throw new $(F.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let f=0;f<i.length;f+=2)a.push(ou(e,i[f])),c.push(i[f+1]);const l=[],h=jt.empty();for(let f=a.length-1;f>=0;--f)if(!PS(l,a[f])){const m=a[f];let _=c[f];_=ue(_);const E=o.yc(m);if(_ instanceof Nu)l.push(m);else{const v=Yi(_,E);v!=null&&(l.push(m),h.set(m,v))}}const d=new dn(l);return new wS(h,d,o.fieldTransforms)}function AS(t,e,n,r=!1){return Yi(n,t.Cc(r?4:3,e))}function Yi(t,e){if(SS(t=ue(t)))return Jg("Unsupported field value:",e,t),RS(t,e);if(t instanceof zs)return(function(r,s){if(!vS(s.Ac))throw s.Sc(`${r._methodName}
40() can only be used with update() and set()`);if(!s.path)throw s.Sc(`${r._methodName}() is not currently supported inside arrays`);const i=r._toFieldTransform(s);i&&s.fieldTransforms.push(i)})(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.fc&&e.Ac!==4)throw e.Sc("Nested arrays are not supported");return(function(r,s){const i=[];let o=0;for(const a of r){let c=Yi(a,s.wc(o));c==null&&(c={nullValue:"NULL_VALUE"}),i.push(c),o++}return{arrayValue:{values:i}}})(t,e)}return(function(r,s){if((r=ue(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return WA(s.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const i=Fe.fromDate(r);return{timestampValue:ea(s.serializer,i)}}if(r instanceof Fe){const i=new Fe(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:ea(s.serializer,i)}}if(r instanceof Bn)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof un)return{bytesValue:iR(s.serializer,r._byteString)};if(r instanceof je){const i=s.databaseId,o=r.firestore._databaseId;if(!o.isEqual(i))throw s.Sc(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${i.projectId}/${i.database}`);return{referenceValue:pg(r.firestore._databaseId||s.databaseId,r._key.path)}}if(r instanceof Cn)return(function(o,a){return{mapValue:{fields:{[rg]:{stringValue:sg},[Qo]:{arrayValue:{values:o.toArray().map((l=>{if(typeof l!="number")throw a.Sc("VectorValues must only contain numeric values.");return cg(a.serializer,l)}))}}}}}})(r,s);throw s.Sc(`Unsupported field value: ${Xh(r)}`)})(t,e)}function RS(t,e){const n={};return EA(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Hs(t,((r,s)=>{const i=Yi(s,e.mc(r));i!=null&&(n[r]=i)})),{mapValue:{fields:n}}}function SS(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof Fe||t instanceof Bn||t instanceof un||t instanceof je||t instanceof zs||t instanceof Cn)}function Jg(t,e,n){if(!SS(n)||!eA(n)){const r=Xh(n);throw r==="an object"?e.Sc(t+" a custom object"):e.Sc(t+" "+r)}}function ou(t,e,n){if((e=ue(e))instanceof Ks)return e._internalPath;if(typeof e=="string")return Id(t,e);throw bh("Field path arguments must be of type string or ",t,!1,void 0,n)}const o2=new RegExp("[~\\*/\\[\\]]");function Id(t,e,n){if(e.search(o2)>=0)throw bh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Ks(...e.split("."))._internalPath}catch{throw bh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function bh(t,e,n,r,s){const i=r&&!r.isEmpty(),o=s!==void 0;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(i||o)&&(c+=" (found",i&&(c+=` in field ${r}`),o&&(c+=` in document ${s}`),c+=")"),new $(F.INVALID_ARGUMENT,a+t+c)}function PS(t,e){return t.some((n=>n.isEqual(e)))}class au{constructor(e,n,r,s,i){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=s,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new je(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new a2(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(Td("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class a2 extends au{data(){return super.data()}}function Td(t,e){return typeof e=="string"?Id(t,e):e instanceof Ks?e._internalPath:e._delegate._internalPath}function CS(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new $(F.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Yg{}class Sa extends Yg{}function c2(t,e,...n){let r=[];e instanceof Yg&&r.push(e),r=r.concat(n),(function(i){const o=i.filter((c=>c instanceof Xi)).length,a=i.filter((c=>c instanceof Pa)).length;if(o>1||o>0&&a>0)throw new $(F.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")})(r);for(const s of r)t=s._apply(t);return t}class Pa extends Sa{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new Pa(e,n,r)}_apply(e){const n=this._parse(e);return NS(e._query,n),new Rt(e.firestore,e.converter,jp(e._query,n))}_parse(e){const n=Ji(e.firestore);return(function(i,o,a,c,l,h,d){let f;
40if(l.isKeyField()){if(h==="array-contains"||h==="array-contains-any")throw new $(F.INVALID_ARGUMENT,`Invalid Query. You can't perform '${h}' queries on documentId().`);if(h==="in"||h==="not-in"){mT(d,h);const _=[];for(const E of d)_.push(pT(c,i,E));f={arrayValue:{values:_}}}else f=pT(c,i,d)}else h!=="in"&&h!=="not-in"&&h!=="array-contains-any"||mT(d,h),f=AS(a,o,d,h==="in"||h==="not-in");return Pe.create(l,h,f)})(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}function u2(t,e,n){const r=e,s=Td("where",t);return Pa._create(s,r,n)}class Xi extends Yg{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new Xi(e,n)}_parse(e){const n=this._queryConstraints.map((r=>r._parse(e))).filter((r=>r.getFilters().length>0));return n.length===1?n[0]:Be.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:((function(s,i){let o=s;const a=i.getFlattenedFilters();for(const c of a)NS(o,c),o=jp(o,c)})(e._query,n),new Rt(e.firestore,e.converter,jp(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}function l2(...t){return t.forEach((e=>DS("or",e))),Xi._create("or",t)}function h2(...t){return t.forEach((e=>DS("and",e))),Xi._create("and",t)}class wd extends Sa{constructor(e,n){super(),this._field=e,this._direction=n,this.type="orderBy"}static _create(e,n){return new wd(e,n)}_apply(e){const n=(function(s,i,o){if(s.startAt!==null)throw new $(F.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(s.endAt!==null)throw new $(F.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new ru(i,o)})(e._query,this._field,this._direction);return new Rt(e.firestore,e.converter,(function(s,i){const o=s.explicitOrderBy.concat([i]);return new Kr(s.path,s.collectionGroup,o,s.filters.slice(),s.limit,s.limitType,s.startAt,s.endAt)})(e._query,n))}}function d2(t,e="asc"){const n=e,r=Td("orderBy",t);return wd._create(r,n)}class Du extends Sa{constructor(e,n,r){super(),this.type=e,this._limit=n,this._limitType=r}static _create(e,n,r){return new Du(e,n,r)}_apply(e){return new Rt(e.firestore,e.converter,mh(e._query,this._limit,this._limitType))}}function f2(t){return tA("limit",t),Du._create("limit",t,"F")}function p2(t){return tA("limitToLast",t),Du._create("limitToLast",t,"L")}class Ou extends Sa{constructor(e,n,r){super(),this.type=e,this._docOrFields=n,this._inclusive=r}static _create(e,n,r){return new Ou(e,n,r)}_apply(e){const n=kS(e,this.type,this._docOrFields,this._inclusive);return new Rt(e.firestore,e.converter,(function(s,i){return new Kr(s.path,s.collectionGroup,s.explicitOrderBy.slice(),s.filters.slice(),s.limit,s.limitType,i,s.endAt)})(e._query,n))}}function m2(...t){return Ou._create("startAt",t,!0)}function g2(...t){return Ou._create("startAfter",t,!1)}class xu extends Sa{constructor(e,n,r){super(),this.type=e,this._docOrFields=n,this._inclusive=r}static _create(e,n,r){return new xu(e,n,r)}_apply(e){const n=kS(e,this.type,this._docOrFields,this._inclusive);return new Rt(e.firestore,e.converter,(function(s,i){return new Kr(s.path,s.collectionGroup,s.explicitOrderBy.slice(),s.filters.slice(),s.limit,s.limitType,s.startAt,i)})(e._query,n))}}function _2(...t){return xu._create("endBefore",t,!1)}function y2(...t){return xu._create("endAt",t,!0)}function kS(t,e,n,r){if(n[0]=ue(n[0]),n[0]instanceof au)return(function(i,o,a,c,l){if(!c)throw new $(F.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${a}().`);const h=[];for(const d of ko(i))if(d.field.isKeyField())h.push(Vi(o,c.key));else{const f=c.data.field(d.field);if(rd(f))throw new $(F.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+d.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(f===null){const m=d.field.canonicalString();throw new $(F.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${m}' (used as the orderBy) does not exist.`)}h.push(f)}return new Fs(h,l)})(t._query,t.firestore._databaseId,e,n[0]._document,r);{const s=Ji(t.firestore);return(function(o,a,c,l,h,d){const f=o.explicitOrderBy;if(h.length>f.length)throw new $(F.INVALID_ARGUMENT,`Too many arguments provided to ${l}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const m=[];for(let _=0;_<h.length;_++){const E=h[_];
40if(f[_].field.isKeyField()){if(typeof E!="string")throw new $(F.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${l}(), but got a ${typeof E}`);if(!og(o)&&E.indexOf("/")!==-1)throw new $(F.INVALID_ARGUMENT,`Invalid query. When querying a collection and ordering by documentId(), the value passed to ${l}() must be a plain document ID, but '${E}' contains a slash.`);const v=o.path.child(be.fromString(E));if(!X.isDocumentKey(v))throw new $(F.INVALID_ARGUMENT,`Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${l}() must result in a valid document path, but '${v}' is not because it contains an odd number of segments.`);const O=new X(v);m.push(Vi(a,O))}else{const v=AS(c,l,E);m.push(v)}}return new Fs(m,d)})(t._query,t.firestore._databaseId,s,e,n,r)}}function pT(t,e,n){if(typeof(n=ue(n))=="string"){if(n==="")throw new $(F.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!og(e)&&n.indexOf("/")!==-1)throw new $(F.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=e.path.child(be.fromString(n));if(!X.isDocumentKey(r))throw new $(F.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return Vi(t,new X(r))}if(n instanceof je)return Vi(t,n._key);throw new $(F.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Xh(n)}.`)}function mT(t,e){if(!Array.isArray(t)||t.length===0)throw new $(F.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function NS(t,e){const n=(function(s,i){for(const o of s)for(const a of o.getFlattenedFilters())if(i.indexOf(a.op)>=0)return a.op;return null})(t.filters,(function(s){switch(s){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}})(e.op));if(n!==null)throw n===e.op?new $(F.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new $(F.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}function DS(t,e){if(!(e instanceof Pa||e instanceof Xi))throw new $(F.INVALID_ARGUMENT,`Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}class Xg{convertValue(e,n="none"){switch(Ls(e)){case 0:return null;case 1:return e.booleanValue;case 2:return rt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(Br(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw re(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return Hs(e,((s,i)=>{r[s]=this.convertValue(i,n)})),r}convertVectorValue(e){const n=e.fields?.[Qo].arrayValue?.values?.map((r=>rt(r.doubleValue)));return new Cn(n)}convertGeoPoint(e){return new Bn(rt(e.latitude),rt(e.longitude))}convertArray(e,n){return(e.values||[]).map((r=>this.convertValue(r,n)))}convertServerTimestamp(e,n){switch(n){case"previous":const r=sd(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(Zc(e));default:return null}}convertTimestamp(e){const n=Ur(e);return new Fe(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=be.fromString(e);ce(mR(r),9688,{name:e});const s=new Vs(r.get(1),r.get(3)),i=new X(r.popFirst(5));return s.isEqual(n)||ft(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),i}}function vd(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}class Zg extends Xg{constructor(e){super(),this.firestore=e}convertBytes(e){return new un(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);
40return new je(this.firestore,null,n)}}function E2(t){return new aa("sum",ou("sum",t))}function I2(t){return new aa("avg",ou("average",t))}function OS(){return new aa("count")}function T2(t,e){return t instanceof aa&&e instanceof aa&&t.aggregateType===e.aggregateType&&t._internalFieldPath?.canonicalString()===e._internalFieldPath?.canonicalString()}function w2(t,e){return qg(t.query,e.query)&&Hn(t.data(),e.data())}const xS="NOT SUPPORTED";class Sr{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class mn extends au{constructor(e,n,r,s,i,o){super(e,n,r,s,o),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new Oc(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(Td("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new $(F.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,n={};return n.type=mn._jsonSchemaVersion,n.bundle="",n.bundleSource="DocumentSnapshot",n.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?n:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),n.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),n)}}function v2(t,e,n){if(zi(e,mn._jsonSchema)){if(e.bundle===xS)throw new $(F.INVALID_ARGUMENT,"The provided JSON object was created in a client environment, which is not supported.");const r=Qi(t._databaseId),s=hS(e.bundle,r),i=s.Wu(),o=new Og(s.getMetadata(),r);for(const h of i)o.Ga(h);const a=o.documents;if(a.length!==1)throw new $(F.INVALID_ARGUMENT,`Expected bundle data to contain 1 document, but it contains ${a.length} documents.`);const c=cd(r,a[0].document),l=new X(be.fromString(e.bundleName));return new mn(t,new Zg(t),l,c,new Sr(!1,!1),n||null)}}mn._jsonSchemaVersion="firestore/documentSnapshot/1.0",mn._jsonSchema={type:Et("string",mn._jsonSchemaVersion),bundleSource:Et("string","DocumentSnapshot"),bundleName:Et("string"),bundle:Et("string")};class Oc extends mn{data(e={}){return super.data(e)}}class gn{constructor(e,n,r,s){this._firestore=e,this._userDataWriter=n,this._snapshot=s,this.metadata=new Sr(s.hasPendingWrites,s.fromCache),this.query=r}get docs(){const e=[];return this.forEach((n=>e.push(n))),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach((r=>{e.call(n,new Oc(this._firestore,this._userDataWriter,r.key,r,new Sr(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new $(F.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=(function(s,i){if(s._snapshot.oldDocs.isEmpty()){let o=0;return s._snapshot.docChanges.map((a=>{const c=new Oc(s._firestore,s._userDataWriter,a.doc.key,a.doc,new Sr(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);return a.doc,{type:"added",doc:c,oldIndex:-1,newIndex:o++}}))}{let o=s._snapshot.oldDocs;return s._snapshot.docChanges.filter((a=>i||a.type!==3)).map((a=>{const c=new Oc(s._firestore,s._userDataWriter,a.doc.key,a.doc,new Sr(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);let l=-1,h=-1;return a.type!==0&&(l=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),h=o.indexOf(a.doc.key)),{type:A2(a.type),doc:c,oldIndex:l,newIndex:h}}))}})(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new $(F.FAILED_PRECONDITION,"QuerySnapsh
40ot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=gn._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=Yh.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const n=[],r=[],s=[];return this.docs.forEach((i=>{i._document!==null&&(n.push(i._document),r.push(this._userDataWriter.convertObjectMap(i._document.data.value.mapValue.fields,"previous")),s.push(i.ref.path))})),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function b2(t,e,n){if(zi(e,gn._jsonSchema)){if(e.bundle===xS)throw new $(F.INVALID_ARGUMENT,"The provided JSON object was created in a client environment, which is not supported.");const r=Qi(t._databaseId),s=hS(e.bundle,r),i=s.Wu(),o=new Og(s.getMetadata(),r);for(const f of i)o.Ga(f);if(o.queries.length!==1)throw new $(F.INVALID_ARGUMENT,`Snapshot data expected 1 query but found ${o.queries.length} queries.`);const a=ld(o.queries[0].bundledQuery),c=o.documents;let l=new Pi;c.map((f=>{const m=cd(r,f.document);l=l.add(m)}));const h=qi.fromInitialDocuments(a,l,Ie(),!1,!1),d=new Rt(t,n||null,a);return new gn(t,new Zg(t),d,h)}}function A2(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return re(61501,{type:t})}}function R2(t,e){return t instanceof mn&&e instanceof mn?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(t._document===null?e._document===null:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof gn&&e instanceof gn&&t._firestore===e._firestore&&qg(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)}function S2(t){t=Ae(t,je);const e=Ae(t.firestore,He);return uS(ot(e),t._key).then((n=>e_(e,t,n)))}gn._jsonSchemaVersion="firestore/querySnapshot/1.0",gn._jsonSchema={type:Et("string",gn._jsonSchemaVersion),bundleSource:Et("string","QuerySnapshot"),bundleName:Et("string"),bundle:Et("string")};class Qs extends Xg{constructor(e){super(),this.firestore=e}convertBytes(e){return new un(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new je(this.firestore,null,n)}}function P2(t){t=Ae(t,je);const e=Ae(t.firestore,He),n=ot(e),r=new Qs(e);return VU(n,t._key).then((s=>new mn(e,r,t._key,s,new Sr(s!==null&&s.hasLocalMutations,!0),t.converter)))}function C2(t){t=Ae(t,je);const e=Ae(t.firestore,He);return uS(ot(e),t._key,{source:"server"}).then((n=>e_(e,t,n)))}function k2(t){t=Ae(t,Rt);const e=Ae(t.firestore,He),n=ot(e),r=new Qs(e);return CS(t._query),lS(n,t._query).then((s=>new gn(e,r,t,s)))}function N2(t){t=Ae(t,Rt);const e=Ae(t.firestore,He),n=ot(e),r=new Qs(e);return LU(n,t._query).then((s=>new gn(e,r,t,s)))}function D2(t){t=Ae(t,Rt);const e=Ae(t.firestore,He),n=ot(e),r=new Qs(e);return lS(n,t._query,{source:"server"}).then((s=>new gn(e,r,t,s)))}function O2(t,e,n){t=Ae(t,je);const r=Ae(t.firestore,He),s=vd(t.converter,e,n);return Ca(r,[Ed(Ji(r),"setDoc",t._key,s,t.converter!==null,n).toMutation(t._key,st.none())])}function x2(t,e,n,...r){t=Ae(t,je);const s=Ae(t.firestore,He),i=Ji(s);let o;return o=typeof(e=ue(e))=="string"||e instanceof Ks?Qg(i,"updateDoc",t._key,e,n,r):zg(i,"updateDoc",t._key,e),Ca(s,[o.toMutation(t._key,st.exists(!0))])}function V2(t){return Ca(Ae(t.firestore,He),[new Ta(t._key,st.none())])}function L2(t,e){const n=Ae(t.firestore,He),r=mS(t),s=vd(t.converter,e);return Ca(n,[Ed(Ji(t.firestore),"addDoc",r._key,s,t.converter!==null,{}).toMutation(r._key,st.exists(!1))]).then((()=>r))}function nm(t,...e){t=ue(t);let n={includeMetadataChanges:!1,source:"default"},r=0;typeof e[r]!="object"||No(e[r])||(n=e[r++]);const s={includeMetadataChanges:n.includeMetadataChanges,source:n.source};if(No(e[r])){const c=e[r];e[r]=c.next?.bind(c),e[r+1]=c.error?.bind(c),e[r+2]=c.complete?.bind(c)}let i,o,a;if(t instanceof je)o=Ae(t.firestore,He),a=Ea(t._key.path),i={next:c=>{e[r]&&e[r](e_(o,t,c))},error:e[r+1],complete:e[r+2]};else{const c=Ae(t,Rt);o=Ae(c.firestore,He),a=c._query;const l=new Qs(o);i={next:h=>{e[r]&&e[r](new gn(o,l,c,h))},error:e[r+1],complete:e[r+2]},CS(t._query)}return(function(l,h,d,f){const m=new gd(f),_=new Dg(h,m,d);return l.asyncQueue.enqueueAndForget((async()=>Cg(await oa(l),_))),()=>{m.Nu(),l.asyncQueue.enqueueAndForget((async()=>kg(await oa(l),_)))}})(ot(o),a,s,i)}function M2(t,e,...n){const r=ue(t),s=(function(c){const l={bundle:"",bundleName:"",bundleSource:""},h=["bundle","bundleName","bundleSource"];
40for(const d of h){if(!(d in c)){l.error=`snapshotJson missing required field: ${d}`;break}const f=c[d];if(typeof f!="string"){l.error=`snapshotJson field '${d}' must be a string.`;break}if(f.length===0){l.error=`snapshotJson field '${d}' cannot be an empty string.`;break}d==="bundle"?l.bundle=f:d==="bundleName"?l.bundleName=f:d==="bundleSource"&&(l.bundleSource=f)}return l})(e);if(s.error)throw new $(F.INVALID_ARGUMENT,s.error);let i,o=0;if(typeof n[o]!="object"||No(n[o])||(i=n[o++]),s.bundleSource==="QuerySnapshot"){let a=null;if(typeof n[o]=="object"&&No(n[o])){const c=n[o++];a={next:c.next,error:c.error,complete:c.complete}}else a={next:n[o++],error:n[o++],complete:n[o++]};return(function(l,h,d,f,m){let _,E=!1;return tm(l,h.bundle).then((()=>IS(l,h.bundleName))).then((O=>{O&&!E&&(m&&O.withConverter(m),_=nm(O,d||{},f))})).catch((O=>(f.error&&f.error(O),()=>{}))),()=>{E||(E=!0,_&&_())}})(r,s,i,a,n[o])}if(s.bundleSource==="DocumentSnapshot"){let a=null;if(typeof n[o]=="object"&&No(n[o])){const c=n[o++];a={next:c.next,error:c.error,complete:c.complete}}else a={next:n[o++],error:n[o++],complete:n[o++]};return(function(l,h,d,f,m){let _,E=!1;return tm(l,h.bundle).then((()=>
40{if(!E){const O=new je(l,m||null,X.fromPath(h.bundleName));_=nm(O,d||{},f)}})).catch((O=>(f.error&&f.error(O),()=>{}))),()=>{E||(E=!0,_&&_())}})(r,s,i,a,n[o])}throw new $(F.INVALID_ARGUMENT,`unsupported bundle source: ${s.bundleSource}`)}function F2(t,e){return FU(ot(t=Ae(t,He)),No(e)?e:{next:e})}function Ca(t,e){return(function(r,s){const i=new xt;return r.asyncQueue.enqueueAndForget((async()=>dU(await $g(r),s,i))),i.promise})(ot(t),e)}function e_(t,e,n){const r=n.docs.get(e._key),s=new Qs(t);return new mn(t,s,e._key,r,new Sr(n.hasPendingWrites,n.fromCache),e.converter)}function U2(t){return VS(t,{count:OS()})}function VS(t,e){const n=Ae(t.firestore,He),r=ot(n),s=yA(e,((i,o)=>new ZA(o,i.aggregateType,i._internalFieldPath)));return MU(r,t._query,s).then((i=>(function(a,c,l){const h=new Qs(a);return new TS(c,h,l)})(n,t,i)))}class B2{constructor(e){this.kind="memory",this._onlineComponentProvider=Bs.provider,this._offlineComponentProvider=e?.garbageCollector?e.garbageCollector._offlineComponentProvider:{build:()=>new Ug(void 0)}}toJSON(){return{kind:this.kind}}}class j2{constructor(e){let n;this.kind="persistent",e?.tabManager?(e.tabManager._initialize(e),n=e.tabManager):(n=LS(void 0),n._initialize(e)),this._onlineComponentProvider=n._onlineComponentProvider,this._offlineComponentProvider=n._offlineComponentProvider}toJSON(){return{kind:this.kind}}}class $2{constructor(){this.kind="memoryEager",this._offlineComponentProvider=ia.provider}toJSON(){return{kind:this.kind}}}class q2{constructor(e){this.kind="memoryLru",this._offlineComponentProvider={build:()=>new Ug(e)}}toJSON(){return{kind:this.kind}}}function H2(){return new $2}function G2(t){return new q2(t?.cacheSizeBytes)}function W2(t){return new B2(t)}function K2(t){return new j2(t)}class z2{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=Bs.provider,this._offlineComponentProvider={build:n=>new Bg(n,e?.cacheSizeBytes,this.forceOwnership)}}}class Q2{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=Bs.provider,this._offlineComponentProvider={build:n=>new iS(n,e?.cacheSizeBytes)}}}function LS(t){return new z2(t?.forceOwnership)}function J2(){return new Q2}const Y2={maxAttempts:5};class MS{constructor(e,n){this._firestore=e,this._commitHandler=n,this._mutations=[],this._committed=!1,this._dataReader=Ji(e)}set(e,n,r){this._verifyNotCommitted();const s=Ts(e,this._firestore),i=vd(s.converter,n,r),o=Ed(this._dataReader,"WriteBatch.set",s._key,i,s.converter!==null,r);return this._mutations.push(o.toMutation(s._key,st.none())),this}update(e,n,r,...s){this._verifyNotCommitted();const i=Ts(e,this._firestore);let o;return o=typeof(n=ue(n))=="string"||n instanceof Ks?Qg(this._dataReader,"WriteBatch.update",i._key,n,r,s):zg(this._dataReader,"WriteBatch.update",i._key,n),this._mutations.push(o.toMutation(i._key,st.exists(!0))),this}delete(e){this._verifyNotCommitted();const n=Ts(e,this._firestore);return this._mutations=this._mutations.concat(new Ta(n._key,st.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new $(F.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function Ts(t,e){if((t=ue(t)).firestore!==e)throw new $(F.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}class X2{constructor(e,n){this._firestore=e,this._transaction=n,this._dataReader=Ji(e)}get(e){const n=Ts(e,this._firestore),r=new Zg(this._firestore);return this._transaction.lookup([n._key]).then((s=>{if(!s||s.length!==1)return re(24041);const i=s[0];if(i.isFoundDocument())return new au(this._firestore,r,i.key,i,n.converter);if(i.isNoDocument())return new au(this._firestore,r,n._key,null,n.converter);throw re(18433,{doc:i})}))}set(e,n,r){const s=Ts(e,this._firestore),i=vd(s.converter,n,r),o=Ed(this._dataReader,"Transaction.set",s._key,i,s.converter!==null,r);return this._transaction.set(s._key,o),this}update(e,n,r,...s){const i=Ts(e,this._firestore);let o;return o=typeof(n=ue(n))=="string"||n instanceof Ks?Qg(this._dataReader,"Transaction.update",i._key,n,r,s):zg(this._dataReader,"Transaction.update",i._key,n),this._transaction.update(i._key,o),this}delete(e){const n=Ts(e,this._firestore);return this._transaction.delete(n._key),this}}class FS extends X2{constructor(e,n){super(e,n),this._firestore=e}get(e){const n=Ts(e,this._firestore),r=new Qs(this._firestore);return super.get(e).then((s=>new mn(this._firestore,r,n._key,s._document,new Sr(!1,!1),n.converter)))}}function Z2(t,e,n){t=Ae(t,He);const r={...Y2,...n};return(function(i){if(i.maxAttempts<1)throw new $(F.INVALID_ARGUMENT,"Max attempts must be at least 1")})(r),(function(i,o,a){const c=new xt;return i.asyncQueue.enqueueAndForget((async()=>{const l=await cS(i);
40new NU(i.asyncQueue,l,a,o,c).ju()})),c.promise})(ot(t),(s=>e(new FS(t,s))),r)}function eB(){return new Nu("deleteField")}function tB(){return new Hg("serverTimestamp")}function nB(...t){return new Gg("arrayUnion",t)}function rB(...t){return new Wg("arrayRemove",t)}function sB(t){return new Kg("increment",t)}function iB(t){return new Cn(t)}function oB(t){return ot(t=Ae(t,He)),new MS(t,(e=>Ca(t,e)))}function aB(t,e){const n=ot(t=Ae(t,He));if(!n._uninitializedComponentsProvider||n._uninitializedComponentsProvider._offline.kind==="memory")return vn("Cannot enable indexes when persistence is disabled"),Promise.resolve();const r=(function(i){const o=typeof i=="string"?(function(l){try{return JSON.parse(l)}catch(h){throw new $(F.INVALID_ARGUMENT,"Failed to parse JSON: "+h?.message)}})(i):i,a=[];if(Array.isArray(o.indexes))for(const c of o.indexes){const l=gT(c,"collectionGroup"),h=[];if(Array.isArray(c.fields))for(const d of c.fields){const f=Id("setIndexConfiguration",gT(d,"fieldPath"));d.arrayConfig==="CONTAINS"?h.push(new Ri(f,2)):d.order==="ASCENDING"?h.push(new Ri(f,0)):d.order==="DESCENDING"&&h.push(new Ri(f,1))}a.push(new qo(qo.UNKNOWN_ID,l,h,Ho.empty()))}return a})(e);return jU(n,r)}function gT(t,e){if(typeof t[e]!="string")throw new $(F.INVALID_ARGUMENT,"Missing string value for: "+e);return t[e]}class US{constructor(e){this._firestore=e,this.type="PersistentCacheIndexManager"}}function cB(t){t=Ae(t,He);const e=_T.get(t);if(e)return e;if(ot(t)._uninitializedComponentsProvider?._offline.kind!=="persistent")return null;const r=new US(t);return _T.set(t,r),r}function uB(t){BS(t,!0)}function lB(t){BS(t,!1)}function hB(t){qU(ot(t._firestore)).then((e=>H("deleting all persistent cache indexes succeeded"))).catch((e=>vn("deleting all persistent cache indexes failed",e)))}function BS(t,e){$U(ot(t._firestore),e).then((n=>H(`setting persistent cache index auto creation isEnabled=${e} succeeded`))).catch((n=>vn(`setting persistent cache index auto creation isEnabled=${e} failed`,n)))}const _T=new WeakMap;function dB(t){const e=ot(Ae(t.firestore,He)),n=e._onlineComponents?.datastore.serializer;return n===void 0?null:ud(n,Yt(t._query)).ft}function fB(t,e){const n=yA(e,((i,o)=>new ZA(o,i.aggregateType,i._internalFieldPath))),r=ot(Ae(t.firestore,He)),s=r._onlineComponents?.datastore.serializer;return s===void 0?null:hR(s,MA(t._query),n,!0).request}class pB{constructor(){throw new Error("instances of this class should not be created")}static onExistenceFilterMismatch(e){return t_.instance.onExistenceFilterMismatch(e)}}class t_{constructor(){this.Mc=new Map}static get instance(){return fl||(fl=new t_,(function(n){if($p)throw new Error("a TestingHooksSpi instance is already set");$p=n})(fl)),fl}lt(e){this.Mc.forEach((n=>n(e)))}onExistenceFilterMismatch(e){const n=Symbol(),r=this.Mc;return r.set(n,e),()=>r.delete(n)}}let fl=null;(function(e,n=!0){(function(s){ya=s})(Ki),Os(new Mr("firestore",((r,{instanceIdentifier:s,options:i})=>{const o=r.getProvider("app").getImmediate(),a=new He(new SL(r.getProvider("auth-internal")),new kL(o,r.getProvider("app-check-internal")),(function(l,h){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new $(F.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Vs(l.options.projectId,h)})(o,s),o);return i={useFetchStreams:n,...i},a._setSettings(i),a}),"PUBLIC").setMultipleInstances(!0)),Pn(QE,JE,e),Pn(QE,JE,"esm2020")})();const pl=Object.freeze(Object.defineProperty({__proto__:null,AbstractUserDataWriter:Xg,AggregateField:aa,AggregateQuerySnapshot:TS,Bytes:un,CACHE_SIZE_UNLIMITED:KU,CollectionReference:Un,DocumentReference:je,DocumentSnapshot:mn,FieldPath:Ks,FieldValue:zs,Firestore:He,FirestoreError:$,GeoPoint:Bn,LoadBundleTask:gS,PersistentCacheIndexManager:US,Query:Rt,QueryCompositeFilterConstraint:Xi,QueryConstraint:Sa,QueryDocumentSnapshot:Oc,QueryEndAtConstraint:xu,QueryFieldFilterConstraint:Pa,QueryLimitConstraint:Du,QueryOrderByConstraint:wd,QuerySnapshot:gn,QueryStartAtConstraint:Ou,SnapshotMetadata:Sr,Timestamp:Fe,Transaction:FS,VectorValue:Cn,WriteBatch:MS,_AutoId:Yh,_ByteString:ct,_DatabaseId:Vs,_DocumentKey:X,_EmptyAppCheckTokenProvider:NL,_EmptyAuthCredentialsProvider:Yb,_FieldPath:et,_TestingHooks:pB,_cast:Ae,_debugAssert:AL,_internalAggregation
40QueryToProtoRunAggregationQueryRequest:fB,_internalQueryToProtoQueryTarget:dB,_isBase64Available:pM,_logWarn:vn,_validateIsNotUsedTogether:Zb,addDoc:L2,aggregateFieldEqual:T2,aggregateQuerySnapshotEqual:w2,and:h2,arrayRemove:rB,arrayUnion:nB,average:I2,clearIndexedDbPersistence:YU,collection:HU,collectionGroup:GU,connectFirestoreEmulator:pS,count:OS,deleteAllPersistentCacheIndexes:hB,deleteDoc:V2,deleteField:eB,disableNetwork:e2,disablePersistentCacheIndexAutoCreation:lB,doc:mS,documentId:n2,documentSnapshotFromJSON:v2,enableIndexedDbPersistence:QU,enableMultiTabIndexedDbPersistence:JU,enableNetwork:ZU,enablePersistentCacheIndexAutoCreation:uB,endAt:y2,endBefore:_2,ensureFirestoreConfigured:ot,executeWrite:Ca,getAggregateFromServer:VS,getCountFromServer:U2,getDoc:S2,getDocFromCache:P2,getDocFromServer:C2,getDocs:k2,getDocsFromCache:N2,getDocsFromServer:D2,getFirestore:zU,getPersistentCacheIndexManager:cB,increment:sB,initializeFirestore:_S,limit:f2,limitToLast:p2,loadBundle:tm,memoryEagerGarbageCollector:H2,memoryLocalCache:W2,memoryLruGarbageCollector:G2,namedQuery:IS,onSnapshot:nm,onSnapshotResume:M2,onSnapshotsInSync:F2,or:l2,orderBy:d2,persistentLocalCache:K2,persistentMultipleTabManager:J2,persistentSingleTabManager:LS,query:c2,queryEqual:qg,querySnapshotFromJSON:b2,refEqual:WU,runTransaction:Z2,serverTimestamp:tB,setDoc:O2,setIndexConfiguration:aB,setLogLevel:bL,snapshotEqual:R2,startAfter:g2,startAt:m2,sum:E2,terminate:t2,updateDoc:x2,vector:iB,waitForPendingWrites:XU,where:u2,writeBatch:oB},Symbol.toStringTag,{value:"Module"}));const mB={PHONE:"phone",TOTP:"totp"},gB={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},_B={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},yB={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},EB={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"};function IB
vendor: 12,061 bytes, line 40
40(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements.","invalid-hosting-link-domain":"The provided Hosting link domain is not configured in Firebase Hosting or is not owned by the current project. This cannot be a default Hosting domain (`web.app` or `firebaseapp.com`)."}}
40function jS(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const TB=IB,$S=jS,qS=new Eu("auth","Firebase",jS()),wB={ADMIN_ONLY_OPERATION:"auth/admin-restricted-operation",ARGUMENT_ERROR:"auth/argument-error",APP_NOT_AUTHORIZED:"auth/app-not-authorized",APP_NOT_INSTALLED:"auth/app-not-installed",CAPTCHA_CHECK_FAILED:"auth/captcha-check-failed",CODE_EXPIRED:"auth/code-expired",CORDOVA_NOT_READY:"auth/cordova-not-ready",CORS_UNSUPPORTED:"auth/cors-unsupported",CREDENTIAL_ALREADY_IN_USE:"auth/credential-already-in-use",CREDENTIAL_MISMATCH:"auth/custom-token-mismatch",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"auth/requires-recent-login",DEPENDENT_SDK_INIT_BEFORE_AUTH:"auth/dependent-sdk-initialized-before-auth",DYNAMIC_LINK_NOT_ACTIVATED:"auth/dynamic-link-not-activated",EMAIL_CHANGE_NEEDS_VERIFICATION:"auth/email-change-needs-verification",EMAIL_EXISTS:"auth/email-already-in-use",EMULATOR_CONFIG_FAILED:"auth/emulator-config-failed",EXPIRED_OOB_CODE:"auth/expired-action-code",EXPIRED_POPUP_REQUEST:"auth/cancelled-popup-request",INTERNAL_ERROR:"auth/internal-error",INVALID_API_KEY:"auth/invalid-api-key",INVALID_APP_CREDENTIAL:"auth/invalid-app-credential",INVALID_APP_ID:"auth/invalid-app-id",INVALID_AUTH:"auth/invalid-user-token",INVALID_AUTH_EVENT:"auth/invalid-auth-event",INVALID_CERT_HASH:"auth/invalid-cert-hash",INVALID_CODE:"auth/invalid-verification-code",INVALID_CONTINUE_URI:"auth/invalid-continue-uri",INVALID_CORDOVA_CONFIGURATION:"auth/invalid-cordova-configuration",INVALID_CUSTOM_TOKEN:"auth/invalid-custom-token",INVALID_DYNAMIC_LINK_DOMAIN:"auth/invalid-dynamic-link-domain",INVALID_EMAIL:"auth/invalid-email",INVALID_EMULATOR_SCHEME:"auth/invalid-emulator-scheme",INVALID_IDP_RESPONSE:"auth/invalid-credential",INVALID_LOGIN_CREDENTIALS:"auth/invalid-credential",INVALID_MESSAGE_PAYLOAD:"auth/invalid-message-payload",INVALID_MFA_SESSION:"auth/invalid-multi-factor-session",INVALID_OAUTH_CLIENT_ID:"auth/invalid-oauth-client-id",INVALID_OAUTH_PROVIDER:"auth/invalid-oauth-provider",INVALID_OOB_CODE:"auth/invalid-action-code",INVALID_ORIGIN:"auth/unauthorized-domain",INVALID_PASSWORD:"auth/wrong-password",INVALID_PERSISTENCE:"auth/invalid-persistence-type",INVALID_PHONE_NUMBER:"auth/invalid-phone-number",INVALID_PROVIDER_ID:"auth/invalid-provider-id",INVALID_RECIPIENT_EMAIL:"auth/invalid-recipient-email",INVALID_SENDER:"auth/invalid-sender",INVALID_SESSION_INFO:"auth/invalid-verification-id",INVALID_TENANT_ID:"auth/invalid-tenant-id",MFA_INFO_NOT_FOUND:"auth/multi-factor-info-not-found",MFA_REQUIRED:"auth/multi-factor-auth-required",MISSING_ANDROID_PACKAGE_NAME:"auth/missing-android-pkg-name",MISSING_APP_CREDENTIAL:"auth/missing-app-credential",MISSING_AUTH_DOMAIN:"auth/auth-domain-config-required",MISSING_CODE:"auth/missing-verification-code",MISSING_CONTINUE_URI:"auth/missing-continue-uri",MISSING_IFRAME_START:"auth/missing-iframe-start",MISSING_IOS_BUNDLE_ID:"auth/missing-ios-bundle-id",MISSING_OR_INVALID_
40NONCE:"auth/missing-or-invalid-nonce",MISSING_MFA_INFO:"auth/missing-multi-factor-info",MISSING_MFA_SESSION:"auth/missing-multi-factor-session",MISSING_PHONE_NUMBER:"auth/missing-phone-number",MISSING_PASSWORD:"auth/missing-password",MISSING_SESSION_INFO:"auth/missing-verification-id",MODULE_DESTROYED:"auth/app-deleted",NEED_CONFIRMATION:"auth/account-exists-with-different-credential",NETWORK_REQUEST_FAILED:"auth/network-request-failed",NULL_USER:"auth/null-user",NO_AUTH_EVENT:"auth/no-auth-event",NO_SUCH_PROVIDER:"auth/no-such-provider",OPERATION_NOT_ALLOWED:"auth/operation-not-allowed",OPERATION_NOT_SUPPORTED:"auth/operation-not-supported-in-this-environment",POPUP_BLOCKED:"auth/popup-blocked",POPUP_CLOSED_BY_USER:"auth/popup-closed-by-user",PROVIDER_ALREADY_LINKED:"auth/provider-already-linked",QUOTA_EXCEEDED:"auth/quota-exceeded",REDIRECT_CANCELLED_BY_USER:"auth/redirect-cancelled-by-user",REDIRECT_OPERATION_PENDING:"auth/redirect-operation-pending",REJECTED_CREDENTIAL:"auth/rejected-credential",SECOND_FACTOR_ALREADY_ENROLLED:"auth/second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"auth/maximum-second-factor-count-exceeded",TENANT_ID_MISMATCH:"auth/tenant-id-mismatch",TIMEOUT:"auth/timeout",TOKEN_EXPIRED:"auth/user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"auth/too-many-requests",UNAUTHORIZED_DOMAIN:"auth/unauthorized-continue-uri",UNSUPPORTED_FIRST_FACTOR:"auth/unsupported-first-factor",UNSUPPORTED_PERSISTENCE:"auth/unsupported-persistence-type",UNSUPPORTED_TENANT_OPERATION:"auth/unsupported-tenant-operation",UNVERIFIED_EMAIL:"auth/unverified-email",USER_CANCELLED:"auth/user-cancelled",USER_DELETED:"auth/user-not-found",USER_DISABLED:"auth/user-disabled",USER_MISMATCH:"auth/user-mismatch",USER_SIGNED_OUT:"auth/user-signed-out",WEAK_PASSWORD:"auth/weak-password",WEB_STORAGE_UNSUPPORTED:"auth/web-storage-unsupported",ALREADY_INITIALIZED:"auth/already-initialized",RECAPTCHA_NOT_ENABLED:"auth/recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"auth/missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"auth/invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"auth/invalid-recaptcha-action",MISSING_CLIENT_TYPE:"auth/missing-client-type",MISSING_RECAPTCHA_VERSION:"auth/missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"auth/invalid-recaptcha-version",INVALID_REQ_TYPE:"auth/invalid-req-type",INVALID_HOSTING_LINK_DOMAIN:"auth/invalid-hosting-link-domain"};const Ah=new Km("@firebase/auth");function vB(t,...e){Ah.logLevel<=Se.WARN&&Ah.warn(`Auth (${Ki}): ${t}`,...e)}function Ml(t,...e){Ah.logLevel<=Se.ERROR&&Ah.error(`Auth (${Ki}): ${t}`,...e)}function _n(t,...e){throw r_(t,...e)}function sn(t,...e){return r_(t,...e)}function n_(t,e,n){const r={...$S(),[e]:n};return new Eu("auth","Firebase",r).create(e,{appName:t.name})}function Vt(t){return n_(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function ka(t,e,n){const r=n;if(!(e instanceof r))throw r.name!==e.constructor.name&&_n(t,"argument-error"),n_(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function r_(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return qS.create(t,...e)}function Q(t,e,...n){if(!t)throw r_(e,...n)}function rr(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Ml(e),new Error(e)}function jr(t,e){t||rr(e)}function cu(){return typeof self<"u"&&self.location?.href||""}function s_(){return yT()==="http:"||yT()==="https:"}function yT(){return typeof self<"u"&&self.location?.protocol||null}function bB(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(s_()||n1()||"connection"in navigator)?navigator.onLine:!0}function AB(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}class Vu{constructor(e,n){this.shortDelay=e,this.longDelay=n,jr(n>e,"Short delay should be less than long delay!"),this.isMobile=e1()||r1()}get(){return bB()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function i_(t,e){jr(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}class HS{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;rr("Could not find fetch implementation, make sure you call FetchProvi
40der.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;rr("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;rr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const RB={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};const SB=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],PB=new Vu(3e4,6e4);function tt(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function nt(t,e,n,r,s={}){return GS(t,s,async()=>{let i={},o={};r&&(e==="GET"?o=r:i={body:JSON.stringify(r)});const a=_a({key:t.config.apiKey,...o}).slice(1),c=await t._getAdditionalHeaders();c["Content-Type"]="application/json",t.languageCode&&(c["X-Firebase-Locale"]=t.languageCode);const l={method:e,headers:c,...i};return t1()||(l.referrerPolicy="no-referrer"),t.emulatorConfig&&lr(t.emulatorConfig.host)&&(l.credentials="include"),HS.fetch()(await WS(t,t.config.apiHost,n,a),l)})}async function GS(t,e,n){t._canInitEmulator=!1;const r={...RB,...e};try{const s=new kB(t),i=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const o=await i.json();if("needConfirmation"in o)throw pc(t,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{const a=i.ok?o.errorMessage:o.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw pc(t,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw pc(t,"email-already-in-use",o);if(c==="USER_DISABLED")throw pc(t,"user-disabled",o);const h=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw n_(t,h,l);_n(t,h)}}catch(s){if(s instanceof Gn)throw s;_n(t,"network-request-failed",{message:String(s)})}}async function Yr(t,e,n,r,s={}){const i=await nt(t,e,n,r,s);return"mfaPendingCredential"in i&&_n(t,"multi-factor-auth-required",{_serverResponse:i}),i}async function WS(t,e,n,r){const s=`${e}${n}?${r}`,i=t,o=i.config.emulator?i_(t.config,s):`${t.config.apiScheme}://${s}`;return SB.includes(n)&&(await i._persistenceManagerAvailable,i._getPersistenceType()==="COOKIE")?
40i._getPersistence()._getFinalTarget(o).toString():o}function CB(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class kB{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(sn(this.auth,"network-request-failed")),PB.get())})}}function pc(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=sn(t,e,r);return s.customData._tokenResponse=n,s}function ET(t){return t!==void 0&&t.getResponse!==void 0}function IT(t){return t!==void 0&&t.enterprise!==void 0}class KS{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return CB(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function NB(t){return(await nt(t,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}async function zS(t,e){return nt(t,"GET","/v2/recaptchaConfig",tt(t,e))}async function DB(t,e){return nt(t,"POST","/v1/accounts:delete",e)}async function OB(t,e){return nt(t,"POST","/v1/accounts:update",e)}async function Rh(t,e){return nt(t,"POST","/v1/accounts:lookup",e)}function xc(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function xB(t,e=!1){return ue(t).getIdToken(e)}async function QS(t,e=!1){const n=ue(t),r=await n.getIdToken(e),s=bd(r);Q(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const i=typeof s.firebase=="object"?s.firebase:void 0,o=i?.sign_in_provider;return{claims:s,token:r,authTime:xc(Df(s.auth_time)),issuedAtTime:xc(Df(s.iat)),expirationTime:xc(Df(s.exp)),signInProvider:o||null,signInSecondFactor:i?.sign_in_second_factor||null}}function Df(t){return Number(t)*1e3}function bd(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Ml("JWT malformed, contained fewer than 3 sections"),null;try{const s=Cb(n);return s?JSON.parse(s):(Ml("Failed to decode base64 JWT payload"),null)}catch(s){return Ml("Caught error parsing JWT payload as JSON",s?.toString()),null}}function TT(t){const e=bd(t);return Q(e,"internal-error"),Q(typeof e.exp<"u","internal-error"),Q(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}async function $r(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof Gn&&VB(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function VB({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}class LB{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}class rm{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=xc(this.lastLoginAt),this.creationTime=xc(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function uu(t){const e=t.auth,n=await t.getIdToken(),r=await $r(t,Rh(e,{idToken:n}));Q(r?.users.length,e,"internal-error");const s=r.users[0];t._notifyReloadListener(s);const i=s.providerUserInfo?.length?YS(s.providerUserInfo):[],o=MB(t.providerData,i),a=t.isAnonymous,c=!(t.email&&s.passwordHash)&&!o?.length,l=a?c:!1,h={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new rm(s.createdAt,s.lastLoginAt),isAnonymous:l};Object.assign(t,h)}async function JS(t){const e=ue(t);await uu(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function MB(t,e){return[...t.filter(r=>!e.some(s=>s.providerId===r.providerId)),...e]}function YS(t){return t.map(({providerId:e,...n})=>
40({providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}async function FB(t,e){const n=await GS(t,{},async()=>{const r=_a({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:i}=t.config,o=await WS(t,s,"/v1/token",`key=${i}`),a=await t._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const c={method:"POST",headers:a,body:r};return t.emulatorConfig&&lr(t.emulatorConfig.host)&&(c.credentials="include"),HS.fetch()(o,c)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function UB(t,e){return nt(t,"POST","/v2/accounts:revokeToken",tt(t,e))}class Do{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Q(e.idToken,"internal-error"),Q(typeof e.idToken<"u","internal-error"),Q(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):TT(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){Q(e.length!==0,"internal-error");const n=TT(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Q(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:s,expiresIn:i}=await FB(e,n);this.updateTokensAndExpiration(r,s,Number(i))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:s,expirationTime:i}=n,o=new Do;return r&&(Q(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),s&&(Q(typeof s=="string","internal-error",{appName:e}),o.accessToken=s),i&&(Q(typeof i=="number","internal-error",{appName:e}),o.expirationTime=i),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Do,this.toJSON())}_performRefresh(){return rr("not implemented")}}function ls(t,e){Q(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class Ln{constructor({uid:e,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new LB(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new rm(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const n=await $r(this,this.stsTokenManager.getToken(this.auth,e));return Q(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return QS(this,e)}reload(){return JS(this)}_assign(e){this!==e&&(Q(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>({...n})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new Ln({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(e){Q(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await uu(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ze(this.auth.app))return Promise.reject(Vt(this.auth));const e=await this.getIdToken();return await $r(this,DB(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
40nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){const r=n.displayName??void 0,s=n.email??void 0,i=n.phoneNumber??void 0,o=n.photoURL??void 0,a=n.tenantId??void 0,c=n._redirectEventId??void 0,l=n.createdAt??void 0,h=n.lastLoginAt??void 0,{uid:d,emailVerified:f,isAnonymous:m,providerData:_,stsTokenManager:E}=n;Q(d&&E,e,"internal-error");const v=Do.fromJSON(this.name,E);Q(typeof d=="string",e,"internal-error"),ls(r,e.name),ls(s,e.name),Q(typeof f=="boolean",e,"internal-error"),Q(typeof m=="boolean",e,"internal-error"),ls(i,e.name),ls(o,e.name),ls(a,e.name),ls(c,e.name),ls(l,e.name),ls(h,e.name);const O=new Ln({uid:d,auth:e,email:s,emailVerified:f,displayName:r,isAnonymous:m,photoURL:o,phoneNumber:i,tenantId:a,stsTokenManager:v,createdAt:l,lastLoginAt:h});return _&&Array.isArray(_)&&(O.providerData=_.map(N=>({...N}))),c&&(O._redirectEventId=c),O}static async _fromIdTokenResponse(e,n,r=!1){const s=new Do;s.updateFromServerResponse(n);const i=new Ln({uid:n.localId,auth:e,stsTokenManager:s,isAnonymous:r});return await uu(i),i}static async _fromGetAccountInfoResponse(e,n,r){const s=n.users[0];Q(s.localId!==void 0,"internal-error");const i=s.providerUserInfo!==void 0?YS(s.providerUserInfo):[],o=!(s.email&&s.passwordHash)&&!i?.length,a=new Do;a.updateFromIdToken(r);const c=new Ln({uid:s.localId,auth:e,stsTokenManager:a,isAnonymous:o}),l={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:i,metadata:new rm(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!i?.length};return Object.assign(c,l),c}}const wT=new Map;function Pr(t){jr(t instanceof Function,"Expected a class definition");let e=wT.get(t);return e?(jr(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,wT.set(t,e),e)}class XS{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}XS.type="NONE";const sm=XS;function Fl(t,e,n){return`firebase:${t}:${e}:${n}`}class Oo{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:s,name:i}=this.auth;this.fullUserKey=Fl(this.userKey,s.apiKey,i),this.fullPersistenceKey=Fl("persistence",s.apiKey,i),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const n=await Rh(this.auth,{idToken:e}).catch(()=>{});return n?Ln._fromGetAccountInfoResponse(this.auth,n,e):null}return Ln._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new Oo(Pr(sm),e,r);const s=(await Promise.all(n.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let i=s[0]||Pr(sm);const o=Fl(r,e.config.apiKey,e.name);let a=null;for(const l of n)try{const h=await l._get(o);if(h){let d;if(typeof h=="string"){const f=await Rh(e,{idToken:h}).catch(()=>{});if(!f)break;d=await Ln._fromGetAccountInfoResponse(e,f,h)}else d=Ln._fromJSON(e,h);l!==i&&(a=d),i=l;break}}catch{}const c=s.filter(l=>l._shouldAllowMigration);return!i._shouldAllowMigration||!c.length?new Oo(i,e,r):(i=c[0],a&&await i._set(o,a.toJSON()),await Promise.all(n.map(async l=>{if(l!==i)try{await l._remove(o)}catch{}})),new Oo(i,e,r))}}function vT(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(nP(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(ZS(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(sP(e))return"Blackberry";if(iP(e))return"Webos";if(eP(e))return"Safari";if((e.includes("chrome/")||tP(e))&&!e.includes("edge/"))return"Chrome";if(rP(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if(r?.length===2)return r[1]}return"Other"}function ZS(t=At()){return/firefox\//i.test(t)}function eP(t=At()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function tP(t=At()){return/crios\//i.test(t)}
40function nP(t=At()){return/iemobile/i.test(t)}function rP(t=At()){return/android/i.test(t)}function sP(t=At()){return/blackberry/i.test(t)}function iP(t=At()){return/webos/i.test(t)}function o_(t=At()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function BB(t=At()){return o_(t)&&!!window.navigator?.standalone}function jB(){return s1()&&document.documentMode===10}function oP(t=At()){return o_(t)||rP(t)||iP(t)||sP(t)||/windows phone/i.test(t)||nP(t)}function aP(t,e=[]){let n;switch(t){case"Browser":n=vT(At());break;case"Worker":n=`${vT(At())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Ki}/${r}`}class $B{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=i=>new Promise((o,a)=>{try{const c=e(i);o(c)}catch(c){a(c)}});r.onAbort=n,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}}async function qB(t,e={}){return nt(t,"GET","/v2/passwordPolicy",tt(t,e))}const HB=6;class GB{constructor(e){const n=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??HB,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,n),this.validatePasswordCharacterOptions(e,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),s&&(n.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,
40!1,!1,!1);let r;for(let s=0;s<e.length;s++)r=e.charAt(s),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,s,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}class WB{constructor(e,n,r,s){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new bT(this),this.idTokenSubscription=new bT(this),this.beforeStateQueue=new $B(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=qS,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(i=>this._resolvePersistenceManagerAvailable=i)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Pr(n)),this._initializationPromise=this.queue(async()=>{if(!this._deleted&&(this.persistenceManager=await Oo.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=this.currentUser?.uid||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await Rh(this,{idToken:e}),r=await Ln._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(Ze(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(o=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(o,o))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=this.redirectUser?._redirectEventId,o=r?._redirectEventId,a=await this.tryRedirectSignIn(e);(!i||i===o)&&a?.user&&(r=a.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Q(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await uu(e)}catch(n){if(n?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=AB()}async _delete(){this._deleted=!0}
40async updateCurrentUser(e){if(Ze(this.app))return Promise.reject(Vt(this));const n=e?ue(e):null;return n&&Q(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&Q(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Ze(this.app)?Promise.reject(Vt(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Ze(this.app)?Promise.reject(Vt(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Pr(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await qB(this),n=new GB(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new Eu("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await UB(this,r)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Pr(e)||this._popupRedirectResolver;Q(n,this,"argument-error"),this.redirectPersistenceManager=await Oo.create(this,[Pr(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,s){if(this._deleted)return()=>{};const i=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Q(a,this,"internal-error"),a.then(()=>{o||i(this.currentUser)}),typeof n=="function"){const c=e.addObserver(n,r,s);return()=>{o=!0,c()}}else{const c=e.addObserver(n);return()=>{o=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Q(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=aP(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const n=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();n&&(e["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if(Ze(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&vB(`Error while retrieving App Check token: ${e.error}`),e?.token}}function ht(t){return ue(t)}class bT{constructor(e){this.auth=e,this.observer=null,this.addObserver=l1(n=>this.observer=n)}get next(){return Q(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let Lu={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function KB(t){Lu=t}function a_(t){return Lu.loadJS(t)}function zB(){return Lu.recaptchaV2Script}function QB(){return Lu.recaptchaEnterpriseScript}function JB(){return Lu.gapiScript}function cP(t){return`__${t}${Math.floor(Math.random()*1e6)}`}const YB=500,XB=6e4,ml=1e12;class ZB{constructor(e){this.auth=e,this.counter=ml,this._widgets=new Map}render(e,n){const r=this.counter;return this._widgets.set(r,new n4(e,this.auth.name,n||{})),this.counter++,r}reset(e){const n=e||ml;this._widgets.get(n)?.delete(),this._widgets.delete(n)}getResponse(e){const n=e||ml;return this._widgets.get(n)?.getResponse()||""}async execute(e){const n=e||ml;return this._widgets.get(n)?.execute(),""}}class e4{constructor(){this.enterprise=new t4}ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}class t4{ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}class n4{constructor(e,n,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const s=typeof e=="string"?document.getElementById(e):e;Q(s,"argument-error",{appName:n}),this.container=s,this.isVisible=this.params.size!=="invisible",this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),!this.timerId&&(this.timerId=window.setTimeout(()=>{this.responseToken=r4(50);const{callback:e,"expired-callback":n}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,n)try{n()}catch{}this.isVisible&&this.execute()},XB)},YB))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}function r4(t){const e=[],n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<t;r++)e.push(n.charAt(Math.floor(Math.random()*n.length)));return e.join("")}const s4="recaptcha-enterprise",Vc="NO_RECAPTCHA";class uP{constructor(e){this.type=s4,this.auth=ht(e)}
40async verify(e="verify",n=!1){async function r(i){if(!n){if(i.tenantId==null&&i._agentRecaptchaConfig!=null)return i._agentRecaptchaConfig.siteKey;if(i.tenantId!=null&&i._tenantRecaptchaConfigs[i.tenantId]!==void 0)return i._tenantRecaptchaConfigs[i.tenantId].siteKey}return new Promise(async(o,a)=>{zS(i,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const l=new KS(c);return i.tenantId==null?i._agentRecaptchaConfig=l:i._tenantRecaptchaConfigs[i.tenantId]=l,o(l.siteKey)}}).catch(c=>{a(c)})})}function s(i,o,a){const c=window.grecaptcha;IT(c)?c.enterprise.ready(()=>{c.enterprise.execute(i,{action:e}).then(l=>{o(l)}).catch(()=>{o(Vc)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new e4().execute("siteKey",{action:"verify"}):new Promise((i,o)=>{r(this.auth).then(a=>{if(!n&&IT(window.grecaptcha))s(a,i,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let c=QB();c.length!==0&&(c+=a),a_(c).then(()=>{s(a,i,o)}).catch(l=>{o(l)})}}).catch(a=>{o(a)})})}}async function ic(t,e,n,r=!1,s=!1){const i=new uP(t);let o;if(s)o=Vc;else try{o=await i.verify(n)}catch{o=await i.verify(n,!0)}const a={...e};if(n==="mfaSmsEnrollment"||n==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in a){const c=a.phoneEnrollmentInfo.phoneNumber,l=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:c,recaptchaToken:l,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const c=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:c,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function ks(t,e,n,r,s){if(s==="EMAIL_PASSWORD_PROVIDER")if(t._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const i=await ic(t,e,n,n==="getOobCode");return r(t,i)}else return r(t,e).catch(async i=>{if(i.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await ic(t,e,n,n==="getOobCode");return r(t,o)}else return Promise.reject(i)});else if(s==="PHONE_PROVIDER")if(t._getRecaptchaConfig()?.isProviderEnabled("PHONE_PROVIDER")){const i=await ic(t,e,n);return r(t,i).catch(async o=>{if(t._getRecaptchaConfig()?.getProviderEnforcementState("PHONE_PROVIDER")==="AUDIT"&&(o.code==="auth/missing-recaptcha-token"||o.code==="auth/invalid-app-credential")){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${n} flow.`);const a=await ic(t,e,n,!1,!0);return r(t,a)}return Promise.reject(o)})}else{const i=await ic(t,e,n,!1,!0);return r(t,i)}else return Promise.reject(s+" provider is not supported.")}async function lP(t){const e=ht(t),n=await zS(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new KS(n);e.tenantId==null?e._agentRecaptchaConfig=r:e._tenantRecaptchaConfigs[e.tenantId]=r,r.isAnyProviderEnabled()&&new uP(e).verify()}function hP(t,e){const n=Wi(t,"auth");if(n.isInitialized()){const s=n.getImmediate(),i=n.getOptions();if(Hn(i,e??{}))return s;_n(s,"already-initialized")}return n.initialize({options:e})}function i4(t,e){const n=e?.persistence||[],r=(Array.isArray(n)?n:[n]).map(Pr);e?.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e?.popupRedirectResolver)}function dP(t,e,n){const r=ht(t);
40Q(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const s=!!n?.disableWarnings,i=fP(e),{host:o,port:a}=o4(e),c=a===null?"":`:${a}`,l={url:`${i}//${o}${c}/`},h=Object.freeze({host:o,port:a,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Q(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Q(Hn(l,r.config.emulator)&&Hn(h,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=l,r.emulatorConfig=h,r.settings.appVerificationDisabledForTesting=!0,lr(o)?(yu(`${i}//${o}${c}`),Jh("Auth",!0)):s||a4()}function fP(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function o4(t){const e=fP(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const i=s[1];return{host:i,port:AT(r.substr(i.length+1))}}else{const[i,o]=r.split(":");return{host:i,port:AT(o)}}}function AT(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function a4(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}class Na{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return rr("not implemented")}_getIdTokenResponse(e){return rr("not implemented")}_linkToIdToken(e,n){return rr("not implemented")}_getReauthenticationResolver(e){return rr("not implemented")}}async function pP(t,e){return nt(t,"POST","/v1/accounts:resetPassword",tt(t,e))}async function c4(t,e){return nt(t,"POST","/v1/accounts:update",e)}async function u4(t,e){return nt(t,"POST","/v1/accounts:signUp",e)}async function l4(t,e){return nt(t,"POST","/v1/accounts:update",tt(t,e))}async function h4(t,e){return Yr(t,"POST","/v1/accounts:signInWithPassword",tt(t,e))}async function Ad(t,e){return nt(t,"POST","/v1/accounts:sendOobCode",tt(t,e))}async function d4(t,e){return Ad(t,e)}async function f4(t,e){return Ad(t,e)}async function p4(t,e){return Ad(t,e)}async function m4(t,e){return Ad(t,e)}async function g4(t,e){return Yr(t,"POST","/v1/accounts:signInWithEmailLink",tt(t,e))}async function _4(t,e){return Yr(t,"POST","/v1/accounts:signInWithEmailLink",tt(t,e))}class ca extends Na{constructor(e,n,r,s=null){super("password",r),this._email=e,this._password=n,this._tenantId=s}static _fromEmailAndPassword(e,n){return new ca(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new ca(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;if(n?.email&&n?.password){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return ks(e,n,"signInWithPassword",h4,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return g4(e,{email:this._email,oobCode:this._password});default:_n(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":const r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return ks(e,r,"signUpPassword",u4,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return _4(e,{idToken:n,email:this._email,oobCode:this._password});default:_n(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Dr(t,e){return Yr(t,"POST","/v1/accounts:signInWithIdp",tt(t,e))}const y4="http://localhost";class cr extends Na{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new cr(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&
40(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):_n("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:s,...i}=n;if(!r||!s)return null;const o=new cr(r,s);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return Dr(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,Dr(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,Dr(e,n)}buildRequest(){const e={requestUri:y4,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=_a(n)}return e}}async function RT(t,e){return nt(t,"POST","/v1/accounts:sendVerificationCode",tt(t,e))}async function E4(t,e){return Yr(t,"POST","/v1/accounts:signInWithPhoneNumber",tt(t,e))}async function I4(t,e){const n=await Yr(t,"POST","/v1/accounts:signInWithPhoneNumber",tt(t,e));if(n.temporaryProof)throw pc(t,"account-exists-with-different-credential",n);return n}const T4={USER_NOT_FOUND:"user-not-found"};async function w4(t,e){const n={...e,operation:"REAUTH"};return Yr(t,"POST","/v1/accounts:signInWithPhoneNumber",tt(t,n),T4)}class Ns extends Na{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,n){return new Ns({verificationId:e,verificationCode:n})}static _fromTokenResponse(e,n){return new Ns({phoneNumber:e,temporaryProof:n})}_getIdTokenResponse(e){return E4(e,this._makeVerificationRequest())}_linkToIdToken(e,n){return I4(e,{idToken:n,...this._makeVerificationRequest()})}_getReauthenticationResolver(e){return w4(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:n,verificationId:r,verificationCode:s}=this.params;return e&&n?{temporaryProof:e,phoneNumber:n}:{sessionInfo:r,code:s}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){typeof e=="string"&&(e=JSON.parse(e));const{verificationId:n,verificationCode:r,phoneNumber:s,temporaryProof:i}=e;return!r&&!n&&!s&&!i?null:new Ns({verificationId:n,verificationCode:r,phoneNumber:s,temporaryProof:i})}}function v4(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function b4(t){const e=cc(uc(t)).link,n=e?cc(uc(e)).deep_link_id:null,r=cc(uc(t)).deep_link_id;return(r?cc(uc(r)).link:null)||r||n||e||t}class Da{constructor(e){const n=cc(uc(e)),r=n.apiKey??null,s=n.oobCode??null,i=v4(n.mode??null);Q(r&&s&&i,"argument-error"),this.apiKey=r,this.operation=i,this.code=s,this.continueUrl=n.continueUrl??null,this.languageCode=n.lang??null,this.tenantId=n.tenantId??null}static parseLink(e){const n=b4(e);try{return new Da(n)}catch{return null}}}function A4(t){return Da.parseLink(t)}class Js{constructor(){this.providerId=Js.PROVIDER_ID}static credential(e,n){return ca._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){const r=Da.parseLink(n);return Q(r,"argument-error"),ca._fromEmailAndCode(e,r.code,r.tenantId)}}Js.PROVIDER_ID="password";Js.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Js.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class Xr{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class Oa extends Xr{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Lc extends Oa{static credentialFromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;return Q("providerId"in n&&"signInMethod"in n,"argument-error"),cr._fromParams(n)}credential(e){return this._credential({...e,nonce:e.rawNonce})}_credential(e){return Q(e.idToken||e.accessToken,"argument-error"),cr._fromParams({...e,providerId:this.providerId,sign
40InMethod:this.providerId})}static credentialFromResult(e){return Lc.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return Lc.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r,oauthTokenSecret:s,pendingToken:i,nonce:o,providerId:a}=e;if(!r&&!s&&!n&&!i||!a)return null;try{return new Lc(a)._credential({idToken:n,accessToken:r,nonce:o,pendingToken:i})}catch{return null}}}class Tr extends Oa{constructor(){super("facebook.com")}static credential(e){return cr._fromParams({providerId:Tr.PROVIDER_ID,signInMethod:Tr.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Tr.credentialFromTaggedObject(e)}static credentialFromError(e){return Tr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Tr.credential(e.oauthAccessToken)}catch{return null}}}Tr.FACEBOOK_SIGN_IN_METHOD="facebook.com";Tr.PROVIDER_ID="facebook.com";class wr extends Oa{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return cr._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return wr.credentialFromTaggedObject(e)}static credentialFromError(e){return wr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return wr.credential(n,r)}catch{return null}}}wr.GOOGLE_SIGN_IN_METHOD="google.com";wr.PROVIDER_ID="google.com";class vr extends Oa{constructor(){super("github.com")}static credential(e){return cr._fromParams({providerId:vr.PROVIDER_ID,signInMethod:vr.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return vr.credentialFromTaggedObject(e)}static credentialFromError(e){return vr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return vr.credential(e.oauthAccessToken)}catch{return null}}}vr.GITHUB_SIGN_IN_METHOD="github.com";vr.PROVIDER_ID="github.com";const R4="http://localhost";class lu extends Na{constructor(e,n){super(e,e),this.pendingToken=n}_getIdTokenResponse(e){const n=this.buildRequest();return Dr(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,Dr(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,Dr(e,n)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:s,pendingToken:i}=n;return!r||!s||!i||r!==s?null:new lu(r,i)}static _create(e,n){return new lu(e,n)}buildRequest(){return{requestUri:R4,returnSecureToken:!0,pendingToken:this.pendingToken}}}const S4="saml.";class Sh extends Xr{constructor(e){Q(e.startsWith(S4),"argument-error"),super(e)}static credentialFromResult(e){return Sh.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return Sh.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){const n=lu.fromJSON(e);return Q(n,"argument-error"),n}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{pendingToken:n,providerId:r}=e;if(!n||!r)return null;try{return lu._create(r,n)}catch{return null}}}class br extends Oa{constructor(){super("twitter.com")}static credential(e,n){return cr._fromParams({providerId:br.PROVIDER_ID,signInMethod:br.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return br.credentialFromTaggedObject(e)}static credentialFromError(e){return br.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return br.credential(n,r)}catch{return null}}}br.TWITTER_SIGN_IN_METHOD="twitter.com";br.PROVIDER_ID="twitter.com";async function mP(t,e){return Yr(t,"POST","/v1/accounts:signUp",tt(t,e))}class Nn{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,s=!1){const i=await Ln._fromIdTokenResponse(e,r,s),o=ST(r);return new Nn({user:i,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const s=ST(r);return new Nn({user:e,providerId:s,_tokenResponse:r,operationType:n})}}function ST(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}async function P4(t){if(Ze(t.app))return Promise.reject(Vt(t));const e=ht(t);if(await e._initializationPromise,e.currentUser?.isAnonymous)return new Nn({user:e.currentUser,providerId:null,operationType:"signIn"});const n=await mP(e,{returnSecureToken:!0}),r=await Nn._fromIdTokenResponse(e,"signIn",n,!0);return await e._updateCurrentUser(r.user),r}class Ph extends Gn{constructor(e,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Ph.prototype),this.customData={appName:e.n
40ame,tenantId:e.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,s){return new Ph(e,n,r,s)}}function gP(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(i=>{throw i.code==="auth/multi-factor-auth-required"?Ph._fromErrorAndOperation(t,i,e,r):i})}function _P(t){return new Set(t.map(({providerId:e})=>e).filter(e=>!!e))}async function C4(t,e){const n=ue(t);await Rd(!0,n,e);const{providerUserInfo:r}=await OB(n.auth,{idToken:await n.getIdToken(),deleteProvider:[e]}),s=_P(r||[]);return n.providerData=n.providerData.filter(i=>s.has(i.providerId)),s.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}async function c_(t,e,n=!1){const r=await $r(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Nn._forOperation(t,"link",r)}async function Rd(t,e,n){await uu(e);const r=_P(e.providerData),s=t===!1?"provider-already-linked":"no-such-provider";Q(r.has(n)===t,e.auth,s)}async function yP(t,e,n=!1){const{auth:r}=t;if(Ze(r.app))return Promise.reject(Vt(r));const s="reauthenticate";try{const i=await $r(t,gP(r,s,e,t),n);Q(i.idToken,r,"internal-error");const o=bd(i.idToken);Q(o,r,"internal-error");const{sub:a}=o;return Q(t.uid===a,r,"user-mismatch"),Nn._forOperation(t,s,i)}catch(i){throw i?.code==="auth/user-not-found"&&_n(r,"user-mismatch"),i}}async function EP(t,e,n=!1){if(Ze(t.app))return Promise.reject(Vt(t));const r="signIn",s=await gP(t,r,e),i=await Nn._fromIdTokenResponse(t,r,s);return n||await t._updateCurrentUser(i.user),i}async function Sd(t,e){return EP(ht(t),e)}async function IP(t,e){const n=ue(t);return await Rd(!1,n,e.providerId),c_(n,e)}async function TP(t,e){return yP(ue(t),e)}async function k4(t,e){return Yr(t,"POST","/v1/accounts:signInWithCustomToken",tt(t,e))}async function N4(t,e){if(Ze(t.app))return Promise.reject(Vt(t));const n=ht(t),r=await k4(n,{token:e,returnSecureToken:!0}),s=await Nn._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(s.user),s}class Mu{constructor(e,n){this.factorId=e,this.uid=n.mfaEnrollmentId,this.enrollmentTime=new Date(n.enrolledAt).toUTCString(),this.displayName=n.displayName}static _fromServerResponse(e,n){return"phoneInfo"in n?u_._fromServerResponse(e,n):"totpInfo"in n?l_._fromServerResponse(e,n):_n(e,"internal-error")}}class u_ extends Mu{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,n){return new u_(n)}}class l_ extends Mu{constructor(e){super("totp",e)}static _fromServerResponse(e,n){return new l_(n)}}function Pd(t,e,n){Q(n.url?.length>0,t,"invalid-continue-uri"),Q(typeof n.dynamicLinkDomain>"u"||n.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),Q(typeof n.linkDomain>"u"||n.linkDomain.length>0,t,"invalid-hosting-link-domain"),e.continueUrl=n.url,e.dynamicLinkDomain=n.dynamicLinkDomain,e.linkDomain=n.linkDomain,e.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(Q(n.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),e.iOSBundleId=n.iOS.bundleId),n.android&&(Q(n.android.packageName.length>0,t,"missing-android-pkg-name"),e.androidInstallApp=n.android.installApp,e.androidMinimumVersionCode=n.android.minimumVersion,e.androidPackageName=n.android.packageName)}async function h_(t){const e=ht(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function D4(t,e,n){const r=ht(t),s={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};n&&Pd(r,s,n),await ks(r,s,"getOobCode",f4,"EMAIL_PASSWORD_PROVIDER")}async function O4(t,e,n){await pP(ue(t),{oobCode:e,newPassword:n}).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&h_(t),r})}async function x4(t,e){await l4(ue(t),{oobCode:e})}async function wP(t,e){const n=ue(t),r=await pP(n,{oobCode:e}),s=r.requestType;switch(Q(s,n,"internal-error"),s){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":Q(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":Q(r.mfaInfo,n,"internal-error");default:Q(r.email,n,"internal-error")}let i=null;return r.mfaInfo&&(i=Mu._fromServerResponse(ht(n),r.mfaInfo)),{data:{email:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.newEmail:r.email)||null,previousEmail:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.email:r.newEmail)||null,multiFactorInfo:i},operation:s}}async function V4(t,e){const{data:n}=await wP(ue(t),e);return n.email}async function L4(t,e,n){if(Ze(t.app))return Promise.reject(Vt(t));const r=ht(t),o=await ks(r,{returnSecureToken:!0,email:e,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",mP,"EMAIL_PASSWORD_PROVIDER").catch(c=>{throw c.code==="auth/password-does-not-meet-requirements"&&h_(t),c}),a=await Nn._fromIdTokenResponse(r,"signIn",o);return await r._updateCurrentUser(a.user),a}function M4(t,e,n){return Ze(t.app)?Promise.reject(Vt(t)):Sd(ue(t),Js.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&h_(t),r})}
40async function F4(t,e,n){const r=ht(t),s={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function i(o,a){Q(a.handleCodeInApp,r,"argument-error"),a&&Pd(r,o,a)}i(s,n),await ks(r,s,"getOobCode",p4,"EMAIL_PASSWORD_PROVIDER")}function U4(t,e){return Da.parseLink(e)?.operation==="EMAIL_SIGNIN"}async function B4(t,e,n){if(Ze(t.app))return Promise.reject(Vt(t));const r=ue(t),s=Js.credentialWithLink(e,n||cu());return Q(s._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Sd(r,s)}async function j4(t,e){return nt(t,"POST","/v1/accounts:createAuthUri",tt(t,e))}async function $4(t,e){const n=s_()?cu():"http://localhost",r={identifier:e,continueUri:n},{signinMethods:s}=await j4(ue(t),r);return s||[]}async function q4(t,e){const n=ue(t),s={requestType:"VERIFY_EMAIL",idToken:await t.getIdToken()};e&&Pd(n.auth,s,e);const{email:i}=await d4(n.auth,s);i!==t.email&&await t.reload()}async function H4(t,e,n){const r=ue(t),i={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await t.getIdToken(),newEmail:e};n&&Pd(r.auth,i,n);const{email:o}=await m4(r.auth,i);o!==t.email&&await t.reload()}async function G4(t,e){return nt(t,"POST","/v1/accounts:update",e)}async function W4(t,{displayName:e,photoURL:n}){if(e===void 0&&n===void 0)return;const r=ue(t),i={idToken:await r.getIdToken(),displayName:e,photoUrl:n,returnSecureToken:!0},o=await $r(r,G4(r.auth,i));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const a=r.providerData.find(({providerId:c})=>c==="password");a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(o)}function K4(t,e){const n=ue(t);return Ze(n.auth.app)?Promise.reject(Vt(n.auth)):vP(n,e,null)}function z4(t,e){return vP(ue(t),null,e)}async function vP(t,e,n){const{auth:r}=t,i={idToken:await t.getIdToken(),returnSecureToken:!0};e&&(i.email=e),n&&(i.password=n);const o=await $r(t,c4(r,i));await t._updateTokensIfNecessary(o,!0)}function Q4(t){if(!t)return null;const{providerId:e}=t,n=t.rawUserInfo?JSON.parse(t.rawUserInfo):{},r=t.isNewUser||t.kind==="identitytoolkit#SignupNewUserResponse";if(!e&&t?.idToken){const s=bd(t.idToken)?.firebase?.sign_in_provider;if(s){const i=s!=="anonymous"&&s!=="custom"?s:null;return new xo(r,i)}}if(!e)return null;switch(e){case"facebook.com":return new J4(r,n);case"github.com":return new Y4(r,n);case"google.com":return new X4(r,n);case"twitter.com":return new Z4(r,n,t.screenName||null);case"custom":case"anonymous":return new xo(r,null);default:return new xo(r,e,n)}}class xo{constructor(e,n,r={}){this.isNewUser=e,this.providerId=n,this.profile=r}}class bP extends xo{constructor(e,n,r,s){super(e,n,r),this.username=s}}class J4 extends xo{constructor(e,n){super(e,"facebook.com",n)}}class Y4 extends bP{constructor(e,n){super(e,"github.com",n,typeof n?.login=="string"?n?.login:null)}}class X4 extends xo{constructor(e,n){super(e,"google.com",n)}}class Z4 extends bP{constructor(e,n,r){super(e,"twitter.com",n,r)}}function ej(t){const{user:e,_tokenResponse:n}=t;return e.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:Q4(n)}function tj(t,e){return ue(t).setPersistence(e)}function nj(t){return lP(t)}async function rj(t,e){return ht(t).validatePassword(e)}function AP(t,e,n,r){return ue(t).onIdTokenChanged(e,n,r)}function RP(t,e,n){return ue(t).beforeAuthStateChanged(e,n)}function sj(t,e,n,r){return ue(t).onAuthStateChanged(e,n,r)}function ij(t){ue(t).useDeviceLanguage()}function oj(t,e){return ue(t).updateCurrentUser(e)}function aj(t){return ue(t).signOut()}function cj(t,e){return ht(t).revokeAccessToken(e)}async function uj(t){return ue(t).delete()}class Ii{constructor(e,n,r){this.type=e,this.credential=n,this.user=r}static _fromIdtoken(e,n){return new Ii("enroll",e,n)}static _fromMfaPendingCredential(e){return new Ii("signin",e)}toJSON(){return{multiFactorSession:{[this.type==="enroll"?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){if(e?.multiFactorSession){if(e.multiFactorSession?.pendingCredential)return Ii._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(e.multiFactorSession?.idToken)return Ii._fromIdtoken(e.multiFactorSession.idToken)}return null}}class d_{constructor(e,n,r){this.session=e,this.hints=n,this.signInResolver=r}static _fromError(e,n){const r=ht(e),s=n.customData._serverResponse,i=(s.mfaInfo||[]).map(a=>Mu._fromServerResponse(r,a));Q(s.mfaPendingCredential,r,"internal-error");const o=Ii._fromMfaPendingCredential(s.mfaPendingCredential);return new d_(o,i,async a=>{const c=await a._process(r,o);delete s.mfaInfo,delete s.mfaPendingCredential;const l={...s,idToken:c.idToken,refreshToken:c.refreshToken};switch(n.operationType){case"signIn":const h=await Nn._fromIdTokenResponse(r,n.operationType,l);return await r._updateCurrentUser(h.user),h;case"reauthenticate":return Q(n.user,r,"internal-error"),Nn._forOperation(n.user,n.operationType,l);default:_n(r,"internal-error")}})}async resolveSignIn(e){const n=e;return this.signInResolver(n)}}
40function lj(t,e){const n=ue(t),r=e;return Q(e.customData.operationType,n,"argument-error"),Q(r.customData._serverResponse?.mfaPendingCredential,n,"argument-error"),d_._fromError(n,r)}function PT(t,e){return nt(t,"POST","/v2/accounts/mfaEnrollment:start",tt(t,e))}function hj(t,e){return nt(t,"POST","/v2/accounts/mfaEnrollment:finalize",tt(t,e))}function dj(t,e){return nt(t,"POST","/v2/accounts/mfaEnrollment:start",tt(t,e))}function fj(t,e){return nt(t,"POST","/v2/accounts/mfaEnrollment:finalize",tt(t,e))}function pj(t,e){return nt(t,"POST","/v2/accounts/mfaEnrollment:withdraw",tt(t,e))}class f_{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(n=>{n.mfaInfo&&(this.enrolledFactors=n.mfaInfo.map(r=>Mu._fromServerResponse(e.auth,r)))})}static _fromUser(e){return new f_(e)}async getSession(){return Ii._fromIdtoken(await this.user.getIdToken(),this.user)}async enroll(e,n){const r=e,s=await this.getSession(),i=await $r(this.user,r._process(this.user.auth,s,n));return await this.user._updateTokensIfNecessary(i),this.user.reload()}async unenroll(e){const n=typeof e=="string"?e:e.uid,r=await this.user.getIdToken();try{const s=await $r(this.user,pj(this.user.auth,{idToken:r,mfaEnrollmentId:n}));this.enrolledFactors=this.enrolledFactors.filter(({uid:i})=>i!==n),await this.user._updateTokensIfNecessary(s),await this.user.reload()}catch(s){throw s}}}const Of=new WeakMap;function mj(t){const e=ue(t);return Of.has(e)||Of.set(e,f_._fromUser(e)),Of.get(e)}const Ch="__sak";class SP{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Ch,"1"),this.storage.removeItem(Ch),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}const gj=1e3,_j=10;class PP extends SP{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=oP(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&e(n,s,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const r=e.key;n?this.detachListener():this.stopPolling();const s=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},i=this.storage.getItem(r);jB()&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,_j):s()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},gj)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
40ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}PP.type="LOCAL";const CP=PP;const yj=1e3;function xf(t){const e=t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),n=RegExp(`${e}=([^;]+)`);return document.cookie.match(n)?.[1]??null}function Vf(t){return`${window.location.protocol==="http:"?"__dev_":"__HOST-"}FIREBASE_${t.split(":")[3]}`}class kP{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){if(typeof window===void 0)return e;const n=new URL(`${window.location.origin}/__cookies__`);return n.searchParams.set("finalTarget",e),n}async _isAvailable(){return typeof isSecureContext=="boolean"&&!isSecureContext||typeof navigator>"u"||typeof document>"u"?!1:navigator.cookieEnabled??!0}async _set(e,n){}async _get(e){if(!this._isAvailable())return null;const n=Vf(e);return window.cookieStore?(await window.cookieStore.get(n))?.value:xf(n)}async _remove(e){if(!this._isAvailable()||!await this._get(e))return;const r=Vf(e);document.cookie=`${r}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`,await fetch("/__cookies__",{method:"DELETE"}).catch(()=>{})}_addListener(e,n){if(!this._isAvailable())return;const r=Vf(e);if(window.cookieStore){const a=(l=>{const h=l.changed.find(f=>f.name===r);h&&n(h.value),l.deleted.find(f=>f.name===r)&&n(null)}),c=()=>window.cookieStore.removeEventListener("change",a);return this.listenerUnsubscribes.set(n,c),window.cookieStore.addEventListener("change",a)}let s=xf(r);const i=setInterval(()=>{const a=xf(r);a!==s&&(n(a),s=a)},yj),o=()=>clearInterval(i);this.listenerUnsubscribes.set(n,o)}_removeListener(e,n){const r=this.listenerUnsubscribes.get(n);r&&(r(),this.listenerUnsubscribes.delete(n))}}kP.type="COOKIE";const Ej=kP;class NP extends SP{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}NP.type="SESSION";const p_=NP;function Ij(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}class Cd{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(s=>s.isListeningto(e));if(n)return n;const r=new Cd(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:s,data:i}=n.data,o=this.handlersMap[s];if(!o?.size)return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const a=Array.from(o).map(async l=>l(n.origin,i)),c=await Ij(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:c})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Cd.receivers=[];function kd(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}class Tj{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let i,o;return new Promise((a,c)=>{const l=kd("",20);s.port1.start();const h=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:s,onMessage(d){const f=d;if(f.data.eventId===l)switch(f.data.status){case"ack":clearTimeout(h),i=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),a(f.data.response);break;default:clearTimeout(h),clearTimeout(i),c(new Error("invalid_response"));break}}},this.handlers.add(o),s.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:n},[s.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}function _t(){return window}
40function wj(t){_t().location.href=t}function m_(){return typeof _t().WorkerGlobalScope<"u"&&typeof _t().importScripts=="function"}async function vj(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function bj(){return navigator?.serviceWorker?.controller||null}function Aj(){return m_()?self:null}const DP="firebaseLocalStorageDb",Rj=1,kh="firebaseLocalStorage",OP="fbase_key";class Fu{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function Nd(t,e){return t.transaction([kh],e?"readwrite":"readonly").objectStore(kh)}function Sj(){const t=indexedDB.deleteDatabase(DP);return new Fu(t).toPromise()}function im(){const t=indexedDB.open(DP,Rj);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(kh,{keyPath:OP})}catch(s){n(s)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(kh)?e(r):(r.close(),await Sj(),e(await im()))})})}async function CT(t,e,n){const r=Nd(t,!0).put({[OP]:e,value:n});return new Fu(r).toPromise()}async function Pj(t,e){const n=Nd(t,!1).get(e),r=await new Fu(n).toPromise();return r===void 0?null:r.value}function kT(t,e){const n=Nd(t,!0).delete(e);return new Fu(n).toPromise()}const Cj=800,kj=3;class xP{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await im(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>kj)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return m_()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Cd._getInstance(Aj()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)}
40)),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await vj(),!this.activeServiceWorker)return;this.sender=new Tj(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||bj()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await im();return await CT(e,Ch,"1"),await kT(e,Ch),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>CT(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>Pj(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>kT(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(s=>{const i=Nd(s,!1).getAll();return new Fu(i).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:s,value:i}of e)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(i)&&(this.notifyListeners(s,i),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Cj)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
40ject.keys(this.listeners).length===0&&this.stopPolling()}}xP.type="LOCAL";const VP=xP;function NT(t,e){return nt(t,"POST","/v2/accounts/mfaSignIn:start",tt(t,e))}function Nj(t,e){return nt(t,"POST","/v2/accounts/mfaSignIn:finalize",tt(t,e))}function Dj(t,e){return nt(t,"POST","/v2/accounts/mfaSignIn:finalize",tt(t,e))}const Lf=cP("rcb"),Oj=new Vu(3e4,6e4);class xj{constructor(){this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!_t().grecaptcha?.render}load(e,n=""){return Q(Vj(n),e,"argument-error"),this.shouldResolveImmediately(n)&&ET(_t().grecaptcha)?Promise.resolve(_t().grecaptcha):new Promise((r,s)=>{const i=_t().setTimeout(()=>{s(sn(e,"network-request-failed"))},Oj.get());_t()[Lf]=()=>{_t().clearTimeout(i),delete _t()[Lf];const a=_t().grecaptcha;if(!a||!ET(a)){s(sn(e,"internal-error"));return}const c=a.render;a.render=(l,h)=>{const d=c(l,h);return this.counter++,d},this.hostLanguage=n,r(a)};const o=`${zB()}?${_a({onload:Lf,render:"explicit",hl:n})}`;a_(o).catch(()=>{clearTimeout(i),s(sn(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){return!!_t().grecaptcha?.render&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}function Vj(t){return t.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(t)}class Lj{async load(e){return new ZB(e)}clearedOneInstance(){}}const Mc="recaptcha",Mj={theme:"light",type:"image"};class Fj{constructor(e,n,r={...Mj}){this.parameters=r,this.type=Mc,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=ht(e),this.isInvisible=this.parameters.size==="invisible",Q(typeof document<"u",this.auth,"operation-not-supported-in-this-environment");const s=typeof n=="string"?document.getElementById(n):n;Q(s,this.auth,"argument-error"),this.container=s,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new Lj:new xj,this.validateStartingState()}async verify(){this.assertNotDestroyed();const e=await this.render(),n=this.getAssertedRecaptcha(),r=n.getResponse(e);return r||new Promise(s=>{const i=o=>{o&&(this.tokenChangeListeners.delete(i),s(o))};this.tokenChangeListeners.add(i),this.isInvisible&&n.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise?this.renderPromise:(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e}),this.renderPromise)}_reset(){this.assertNotDestroyed(),this.widgetId!==null&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(e=>{this.container.removeChild(e)})}validateStartingState(){Q(!this.parameters.sitekey,this.auth,"argument-error"),Q(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),Q(typeof document<"u",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return n=>{if(this.tokenChangeListeners.forEach(r=>r(n)),typeof e=="function")e(n);else if(typeof e=="string"){const r=_t()[e];typeof r=="function"&&r(n)}}}assertNotDestroyed(){Q(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){const n=document.createElement("div");e.appendChild(n),e=n}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}
40async init(){Q(s_()&&!m_(),this.auth,"internal-error"),await Uj(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);const e=await NB(this.auth);Q(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return Q(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}function Uj(){let t=null;return new Promise(e=>{if(document.readyState==="complete"){e();return}t=()=>e(),window.addEventListener("load",t)}).catch(e=>{throw t&&window.removeEventListener("load",t),e})}class g_{constructor(e,n){this.verificationId=e,this.onConfirmation=n}confirm(e){const n=Ns._fromVerification(this.verificationId,e);return this.onConfirmation(n)}}async function Bj(t,e,n){if(Ze(t.app))return Promise.reject(Vt(t));const r=ht(t),s=await Dd(r,e,ue(n));return new g_(s,i=>Sd(r,i))}async function jj(t,e,n){const r=ue(t);await Rd(!1,r,"phone");const s=await Dd(r.auth,e,ue(n));return new g_(s,i=>IP(r,i))}async function $j(t,e,n){const r=ue(t);if(Ze(r.auth.app))return Promise.reject(Vt(r.auth));const s=await Dd(r.auth,e,ue(n));return new g_(s,i=>TP(r,i))}async function Dd(t,e,n){if(!t._getRecaptchaConfig())try{await lP(t)}catch{console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let r;if(typeof e=="string"?r={phoneNumber:e}:r=e,"session"in r){const s=r.session;if("phoneNumber"in r){Q(s.type==="enroll",t,"internal-error");const i={idToken:s.credential,phoneEnrollmentInfo:{phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"}};return(await ks(t,i,"mfaSmsEnrollment",async(l,h)=>{if(h.phoneEnrollmentInfo.captchaResponse===Vc){Q(n?.type===Mc,l,"argument-error");const d=await Mf(l,h,n);return PT(l,d)}return PT(l,h)},"PHONE_PROVIDER").catch(l=>Promise.reject(l))).phoneSessionInfo.sessionInfo}else{Q(s.type==="signin",t,"internal-error");const i=r.multiFactorHint?.uid||r.multiFactorUid;Q(i,t,"missing-multi-factor-info");const o={mfaPendingCredential:s.credential,mfaEnrollmentId:i,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}};return(await ks(t,o,"mfaSmsSignIn",async(h,d)=>{if(d.phoneSignInInfo.captchaResponse===Vc){Q(n?.type===Mc,h,"argument-error");const f=await Mf(h,d,n);return NT(h,f)}return NT(h,d)},"PHONE_PROVIDER").catch(h=>Promise.reject(h))).phoneResponseInfo.sessionInfo}}else{const s={phoneNumber:r.phoneNumber,clientType:"CLIENT_TYPE_WEB"};return(await ks(t,s,"sendVerificationCode",async(c,l)=>{if(l.captchaResponse===Vc){Q(n?.type===Mc,c,"argument-error");const h=await Mf(c,l,n);return RT(c,h)}return RT(c,l)},"PHONE_PROVIDER").catch(c=>Promise.reject(c))).sessionInfo}}finally{n?._reset()}}async function qj(t,e){const n=ue(t);if(Ze(n.auth.app))return Promise.reject(Vt(n.auth));await c_(n,e)}async function Mf(t,e,n){Q(n.type===Mc,t,"argument-error");const r=await n.verify();Q(typeof r=="string",t,"argument-error");const s={...e};if("phoneEnrollmentInfo"in s){const i=s.phoneEnrollmentInfo.phoneNumber,o=s.phoneEnrollmentInfo.captchaResponse,a=s.phoneEnrollmentInfo.clientType,c=s.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(s,{phoneEnrollmentInfo:{phoneNumber:i,recaptchaToken:r,captchaResponse:o,clientType:a,recaptchaVersion:c}}),s}else if("phoneSignInInfo"in s){const i=s.phoneSignInInfo.captchaResponse,o=s.phoneSignInInfo.clientType,a=s.phoneSignInInfo.recaptchaVersion;return Object.assign(s,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:i,clientType:o,recaptchaVersion:a}}),s}else return Object.assign(s,{recaptchaToken:r}),s}class Ci{constructor(e){this.providerId=Ci.PROVIDER_ID,this.auth=ht(e)}verifyPhoneNumber(e,n){return Dd(this.auth,e,ue(n))}static credential(e,n){return Ns._fromVerification(e,n)}static credentialFromResult(e){const n=e;return Ci.credentialFromTaggedObject(n)}static credentialFromError(e){return Ci.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:n,temporaryProof:r}=e;return n&&r?Ns._fromTokenResponse(n,r):null}}Ci.PROVIDER_ID="phone";Ci.PHONE_SIGN_IN_METHOD="phone";function Zi(t,e){return e?Pr(e):(Q(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}class __ extends Na{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Dr(e,this._buildIdpRequest())}_linkToIdToken(e,n){return Dr(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return Dr(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function Hj(t){return EP(t.auth,new __(t),t.bypassAuthState)}function Gj(t){const{auth:e,user:n}=t;return Q(n,e,"internal-error"),yP(n,new __(t),t.bypassAuthState)}async function Wj(t){const{auth:e,user:n}=t;return Q(n,e,"internal-error"),c_(n,new __(t),t.bypassAuthState)}class LP{constructor(e,n,r,s,i=!1){this.auth=e,this.resolver=r,this.user=s,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:s,tenantId:i,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:n,sessionId:r,tenantId:i||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Hj;case"linkViaPopup":case"linkViaRedirect":return Wj;case"reauthViaPopup":case"reauthViaRedirect":return Gj;default:_n(this.auth,"internal-error")}}resolve(e){jr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){jr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const Kj=new Vu(2e3,1e4);async function zj(t,e,n){if(Ze(t.app))return Promise.reject(sn(t,"operation-not-supported-in-this-environment"));const r=ht(t);ka(t,e,Xr);const s=Zi(r,n);return new Cr(r,"signInViaPopup",e,s).executeNotNull()}async function Qj(t,e,n){const r=ue(t);if(Ze(r.auth.app))return Promise.reject(sn(r.auth,"operation-not-supported-in-this-environment"));ka(r.auth,e,Xr);const s=Zi(r.auth,n);return new Cr(r.auth,"reauthViaPopup",e,s,r).executeNotNull()}async function Jj(t,e,n){const r=ue(t);ka(r.auth,e,Xr);const s=Zi(r.auth,n);return new Cr(r.auth,"linkViaPopup",e,s,r).executeNotNull()}class Cr extends LP{constructor(e,n,r,s,i){super(e,n,s,i),this.provider=r,this.authWindow=null,this.pollId=null,Cr.currentPopupAction&&Cr.currentPopupAction.cancel(),Cr.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Q(e,this.auth,"internal-error"),e}async onExecution(){jr(this.filter.length===1,"Popup operations only handle one event");const e=kd();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(sn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(sn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Cr.currentPopupAction=null}pollUserCancellation(){const e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(sn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Kj.get())};e()}}Cr.currentPopupAction=null;const Yj="pendingRedirect",Ul=new Map;class Xj extends LP{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Ul.get(this.auth._key());if(!e){try{const r=await Zj(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Ul.set(this.auth._key(),e)}return this.bypassAuthState||Ul.set(this.auth._key(),()=>Promise.resolve(null)),e()}
40async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function Zj(t,e){const n=FP(e),r=MP(t);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}async function y_(t,e){return MP(t)._set(FP(e),"true")}function e6(t,e){Ul.set(t._key(),e)}function MP(t){return Pr(t._redirectPersistence)}function FP(t){return Fl(Yj,t.config.apiKey,t.name)}function t6(t,e,n){return n6(t,e,n)}async function n6(t,e,n){if(Ze(t.app))return Promise.reject(Vt(t));const r=ht(t);ka(t,e,Xr),await r._initializationPromise;const s=Zi(r,n);return await y_(s,r),s._openRedirect(r,e,"signInViaRedirect")}function r6(t,e,n){return s6(t,e,n)}async function s6(t,e,n){const r=ue(t);if(ka(r.auth,e,Xr),Ze(r.auth.app))return Promise.reject(Vt(r.auth));await r.auth._initializationPromise;const s=Zi(r.auth,n);await y_(s,r.auth);const i=await BP(r);return s._openRedirect(r.auth,e,"reauthViaRedirect",i)}function i6(t,e,n){return o6(t,e,n)}async function o6(t,e,n){const r=ue(t);ka(r.auth,e,Xr),await r.auth._initializationPromise;const s=Zi(r.auth,n);await Rd(!1,r,e.providerId),await y_(s,r.auth);const i=await BP(r);return s._openRedirect(r.auth,e,"linkViaRedirect",i)}async function a6(t,e){return await ht(t)._initializationPromise,UP(t,e,!1)}async function UP(t,e,n=!1){if(Ze(t.app))return Promise.reject(Vt(t));const r=ht(t),s=Zi(r,e),o=await new Xj(r,s,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}async function BP(t){const e=kd(`${t.uid}:::`);return t._redirectEventId=e,await t.auth._setRedirectUser(t),await t.auth._persistUserIfCurrent(t),e}const c6=600*1e3;class u6{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!l6(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){if(e.error&&!jP(e)){const r=e.error.code?.split("auth/")[1]||"internal-error";n.onError(sn(this.auth,r))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=c6&&this.cachedEventUids.clear(),this.cachedEventUids.has(DT(e))}saveEventToCache(e){this.cachedEventUids.add(DT(e)),this.lastProcessedEventTime=Date.now()}}function DT(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function jP({type:t,error:e}){return t==="unknown"&&e?.code==="auth/no-auth-event"}function l6(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return jP(t);default:return!1}}async function h6(t,e={}){return nt(t,"GET","/v1/projects",e)}const d6=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,f6=/^https?/;async function p6(t){if(t.config.emulator)return;const{authorizedDomains:e}=await h6(t);for(const n of e)try{if(m6(n))return}catch{}_n(t,"unauthorized-domain")}function m6(t){const e=cu(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!f6.test(n))return!1;if(d6.test(t))return r===t;const s=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}const g6=new Vu(3e4,6e4);function OT(){const t=_t().___jsl;if(t?.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}
40function _6(t){return new Promise((e,n)=>{function r(){OT(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{OT(),n(sn(t,"network-request-failed"))},timeout:g6.get()})}if(_t().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else if(_t().gapi?.load)r();else{const s=cP("iframefcb");return _t()[s]=()=>{gapi.load?r():n(sn(t,"network-request-failed"))},a_(`${JB()}?onload=${s}`).catch(i=>n(i))}}).catch(e=>{throw Bl=null,e})}let Bl=null;function y6(t){return Bl=Bl||_6(t),Bl}const E6=new Vu(5e3,15e3),I6="__/auth/iframe",T6="emulator/auth/iframe",w6={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},v6=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function b6(t){const e=t.config;Q(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?i_(e,T6):`https://${t.config.authDomain}/${I6}`,r={apiKey:e.apiKey,appName:t.name,v:Ki},s=v6.get(t.config.apiHost);s&&(r.eid=s);const i=t._getFrameworks();return i.length&&(r.fw=i.join(",")),`${n}?${_a(r).slice(1)}`}async function A6(t){const e=await y6(t),n=_t().gapi;return Q(n,t,"internal-error"),e.open({where:document.body,url:b6(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:w6,dontclear:!0},r=>new Promise(async(s,i)=>{await r.restyle({setHideOnLeave:!1});const o=sn(t,"network-request-failed"),a=_t().setTimeout(()=>{i(o)},E6.get());function c(){_t().clearTimeout(a),s(r)}r.ping(c).then(c,()=>{i(o)})}))}const R6={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},S6=500,P6=600,C6="_blank",k6="http://localhost";class xT{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function N6(t,e,n,r=S6,s=P6){const i=Math.max((window.screen.availHeight-s)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const c={...R6,width:r.toString(),height:s.toString(),top:i,left:o},l=At().toLowerCase();n&&(a=tP(l)?C6:n),ZS(l)&&(e=e||k6,c.scrollbars="yes");const h=Object.entries(c).reduce((f,[m,_])=>`${f}${m}=${_},`,"");if(BB(l)&&a!=="_self")return D6(e||"",a),new xT(null);const d=window.open(e||"",a,h);Q(d,t,"popup-blocked");try{d.focus()}catch{}return new xT(d)}function D6(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}const O6="__/auth/handler",x6="emulator/auth/handler",V6=encodeURIComponent("fac");async function VT(t,e,n,r,s,i){Q(t.config.authDomain,t,"auth-domain-config-required"),Q(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:Ki,eventId:s};if(e instanceof Xr){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",u1(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[h,d]of Object.entries({}))o[h]=d}if(e instanceof Oa){const h=e.getScopes().filter(d=>d!=="");h.length>0&&(o.scopes=h.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const h of Object.keys(a))a[h]===void 0&&delete a[h];const c=await t._getAppCheckToken(),l=c?`#${V6}=${encodeURIComponent(c)}`:"";return`${L6(t)}?${_a(a).slice(1)}${l}`}function L6({config:t}){return t.emulator?i_(t,x6):`https://${t.authDomain}/${O6}`}const Ff="webStorageSupport";class M6{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=p_,this._completeRedirectFn=UP,this._overrideRedirectResult=e6}
40async _openPopup(e,n,r,s){jr(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");const i=await VT(e,n,r,cu(),s);return N6(e,i,kd())}async _openRedirect(e,n,r,s){await this._originValidation(e);const i=await VT(e,n,r,cu(),s);return wj(i),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:s,promise:i}=this.eventManagers[n];return s?Promise.resolve(s):(jr(i,"If manager is not set, promise should be"),i)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await A6(e),r=new u6(e);return n.register("authEvent",s=>(Q(s?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(Ff,{type:Ff},s=>{const i=s?.[0]?.[Ff];i!==void 0&&n(!!i),_n(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=p6(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return oP()||eP()||o_()}}const $P=M6;class qP{constructor(e){this.factorId=e}_process(e,n,r){switch(n.type){case"enroll":return this._finalizeEnroll(e,n.credential,r);case"signin":return this._finalizeSignIn(e,n.credential);default:return rr("unexpected MultiFactorSessionType")}}}class E_ extends qP{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new E_(e)}_finalizeEnroll(e,n,r){return hj(e,{idToken:n,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,n){return Nj(e,{mfaPendingCredential:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}class HP{constructor(){}static assertion(e){return E_._fromCredential(e)}}HP.FACTOR_ID="phone";class GP{static assertionForEnrollment(e,n){return hu._fromSecret(e,n)}static assertionForSignIn(e,n){return hu._fromEnrollmentId(e,n)}static async generateSecret(e){const n=e;Q(typeof n.user?.auth<"u","internal-error");const r=await dj(n.user.auth,{idToken:n.credential,totpEnrollmentInfo:{}});return Od._fromStartTotpMfaEnrollmentResponse(r,n.user.auth)}}GP.FACTOR_ID="totp";class hu extends qP{constructor(e,n,r){super("totp"),this.otp=e,this.enrollmentId=n,this.secret=r}static _fromSecret(e,n){return new hu(n,void 0,e)}static _fromEnrollmentId(e,n){return new hu(n,e)}async _finalizeEnroll(e,n,r){return Q(typeof this.secret<"u",e,"argument-error"),fj(e,{idToken:n,displayName:r,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)})}async _finalizeSignIn(e,n){Q(this.enrollmentId!==void 0&&this.otp!==void 0,e,"argument-error");const r={verificationCode:this.otp};return Dj(e,{mfaPendingCredential:n,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:r})}}class Od{constructor(e,n,r,s,i,o,a){this.sessionInfo=o,this.auth=a,this.secretKey=e,this.hashingAlgorithm=n,this.codeLength=r,this.codeIntervalSeconds=s,this.enrollmentCompletionDeadline=i}static _fromStartTotpMfaEnrollmentResponse(e,n){return new Od(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,n)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,n){let r=!1;return(gl(e)||gl(n))&&(r=!0),r&&(gl(e)&&(e=this.auth.currentUser?.email||"unknownuser"),gl(n)&&(n=this.auth.name)),`otpauth://totp/${n}:${e}?secret=${this.secretKey}&issuer=${n}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}}function gl(t){return typeof t>"u"||t?.length===0}var LT="@firebase/auth",MT="1.11.1";class F6{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Q(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}function U6(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function B6(t){Os(new Mr("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;
40Q(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const c={apiKey:o,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:aP(t)},l=new WB(r,s,i,c);return i4(l,n),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),Os(new Mr("auth-internal",e=>{const n=ht(e.getProvider("auth").getImmediate());return(r=>new F6(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Pn(LT,MT,U6(t)),Pn(LT,MT,"esm2020")}const j6=300,$6=Ob("authIdTokenMaxAge")||j6;let FT=null;const q6=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>$6)return;const s=n?.token;FT!==s&&(FT=s,await fetch(t,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function WP(t=Iu()){const e=Wi(t,"auth");if(e.isInitialized())return e.getImmediate();const n=hP(t,{popupRedirectResolver:$P,persistence:[VP,CP,p_]}),r=Ob("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const i=new URL(r,location.origin);if(location.origin===i.origin){const o=q6(i.toString());RP(n,o,()=>o(n.currentUser)),AP(n,a=>o(a))}}const s=Nb("auth");return s&&dP(n,`http://${s}`),n}function H6(){return document.getElementsByTagName("head")?.[0]??document}KB({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=s=>{const i=sn("internal-error");i.customData=s,n(i)},r.type="text/javascript",r.charset="UTF-8",H6().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});B6("Browser");const _i=Object.freeze(Object.defineProperty({__proto__:null,ActionCodeOperation:EB,ActionCodeURL:Da,AuthCredential:Na,AuthErrorCodes:wB,EmailAuthCredential:ca,EmailAuthProvider:Js,FacebookAuthProvider:Tr,FactorId:mB,GithubAuthProvider:vr,GoogleAuthProvider:wr,OAuthCredential:cr,OAuthProvider:Lc,OperationType:yB,PhoneAuthCredential:Ns,PhoneAuthProvider:Ci,PhoneMultiFactorGenerator:HP,ProviderId:gB,RecaptchaVerifier:Fj,SAMLAuthProvider:Sh,SignInMethod:_B,TotpMultiFactorGenerator:GP,TotpSecret:Od,TwitterAuthProvider:br,applyActionCode:x4,beforeAuthStateChanged:RP,browserCookiePersistence:Ej,browserLocalPersistence:CP,browserPopupRedirectResolver:$P,browserSessionPersistence:p_,checkActionCode:wP,confirmPasswordReset:O4,connectAuthEmulator:dP,createUserWithEmailAndPassword:L4,debugErrorMap:TB,deleteUser:uj,fetchSignInMethodsForEmail:$4,getAdditionalUserInfo:ej,getAuth:WP,getIdToken:xB,getIdTokenResult:QS,getMultiFactorResolver:lj,getRedirectResult:a6,inMemoryPersistence:sm,indexedDBLocalPersistence:VP,initializeAuth:hP,initializeRecaptchaConfig:nj,isSignInWithEmailLink:U4,linkWithCredential:IP,linkWithPhoneNumber:jj,linkWithPopup:Jj,linkWithRedirect:i6,multiFactor:mj,onAuthStateChanged:sj,onIdTokenChanged:AP,parseActionCodeURL:A4,prodErrorMap:$S,reauthenticateWithCredential:TP,reauthenticateWithPhoneNumber:$j,reauthenticateWithPopup:Qj,reauthenticateWithRedirect:r6,reload:JS,revokeAccessToken:cj,sendEmailVerification:q4,sendPasswordResetEmail:D4,sendSignInLinkToEmail:F4,setPersistence:tj,signInAnonymously:P4,signInWithCredential:Sd,signInWithCustomToken:N4,signInWithEmailAndPassword:M4,signInWithEmailLink:B4,signInWithPhoneNumber:Bj,signInWithPopup:zj,signInWithRedirect:t6,signOut:aj,unlink:C4,updateCurrentUser:oj,updateEmail:K4,updatePassword:z4,updatePhoneNumber:qj,updateProfile:W4,useDeviceLanguage:ij,validatePassword:rj,verifyBeforeUpdateEmail:H4,verifyPasswordResetCode:V4},Symbol.toStringTag,{value:"Module"}));const KP="firebasestorage.googleapis.com",G6="storageBucket",W6=120*1e3,K6=600*1e3;class hr extends Gn{constructor(e,n,r=0){super(Uf(e),`Firebase Storage: ${n} (${Uf(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,hr.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return Uf(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
41${this.customData.serverResponse}`:this.message=this._baseMessage}}var ur;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVA
41LID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(ur||(ur={}));function Uf(t){return"storage/"+t}function z6(){const t="An unknown error occurred, please check the error payload for server response.";return new hr(ur.UNKNOWN,t)}function Q6(){return new hr(ur.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function J6(){return new hr(ur.CANCELED,"User canceled the upload/download.")}function Y6(t){return new hr(ur.INVALID_URL,"Invalid URL '"+t+"'.")}function X6(t){return new hr(ur.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function UT(t){return new hr(ur.INVALID_ARGUMENT,t)}function zP(){return new hr(ur.APP_DELETED,"The Firebase app was deleted.")}function Z6(t){return new hr(ur.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}class Mn{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let r;try{r=Mn.makeFromUrl(e,n)}catch{return new Mn(e,"")}if(r.path==="")return r;throw X6(e)}static makeFromUrl(e,n){let r=null;const s="([A-Za-z0-9.\\-_]+)";function i(S){S.path.charAt(S.path.length-1)==="/"&&(S.path_=S.path_.slice(0,-1))}const o="(/(.*))?$",a=new RegExp("^gs://"+s+o,"i"),c={bucket:1,path:3};function l(S){S.path_=decodeURIComponent(S.path)}const h="v[A-Za-z0-9_]+",d=n.replace(/[.]/g,"\\."),f="(/([^?#]*).*)?$",m=new RegExp(`^https?://${d}/${h}/b/${s}/o${f}`,"i"),_={bucket:1,path:3},E=n===KP?"(?:storage.googleapis.com|storage.cloud.google.com)":n,v="([^?#]*)",O=new RegExp(`^https?://${E}/${s}/${v}`,"i"),y=[{regex:a,indices:c,postModify:i},{regex:m,indices:_,postModify:l},{regex:O,indices:{bucket:1,path:2},postModify:l}];for(let S=0;S<y.length;S++){const D=y[S],M=D.regex.exec(e);if(M){const b=M[D.indices.bucket];let T=M[D.indices.path];T||(T=""),r=new Mn(b,T),D.postModify(r);break}}if(r==null)throw Y6(e);return r}}class e${constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function t$(t,e,n){let r=1,s=null,i=null,o=!1,a=0;function c(){return a===2}let l=!1;function h(...v){l||(l=!0,e.apply(null,v))}function d(v){s=setTimeout(()=>{s=null,t(m,c())},v)}function f(){i&&clearTimeout(i)}function m(v,...O){if(l){f();return}if(v){f(),h.call(null,v,...O);return}if(c()||o){f(),h.call(null,v,...O);return}r<64&&(r*=2);let y;a===1?(a=2,y=0):y=(r+Math.random())*1e3,d(y)}let _=!1;function E(v){_||(_=!0,f(),!l&&(s!==null?(v||(a=2),clearTimeout(s),d(0)):v||(a=1)))}return d(0),i=setTimeout(()=>{o=!0,E(!0)},n),E}function n$(t){t(!1)}function r$(t){return t!==void 0}function BT(t,e,n,r){if(r<e)throw UT(`Invalid value for '${t}'. Expected ${e} or greater.`);if(r>n)throw UT(`Invalid value for '${t}'. Expected ${n} or less.`)}function s$(t){const e=encodeURIComponent;let n="?";for(const r in t)if(t.hasOwnProperty(r)){const s=e(r)+"="+e(t[r]);n=n+s+"&"}return n=n.slice(0,-1),n}var Nh;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(Nh||(Nh={}));function i$(t,e){const n=t>=500&&t<600,s=[408,429].indexOf(t)!==-1,i=e.indexOf(t)!==-1;return n||s||i}class o${constructor(e,n,r,s,i,o,a,c,l,h,d,f=!0,m=!1){this.url_=e,this.method_=n,this.headers_=r,this.body_=s,this.successCodes_=i,this.additionalRetryCodes_=o,this.callback_=a,this.errorCallback_=c,this.timeout_=l,this.progressCallback_=h,this.connectionFactory_=d,this.retry=f,this.isUsingEmulator=m,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((_,E)=>{this.resolve_=_,this.reject_=E,this.start_()})}start_(){const e=(r,s)=>{if(s){r(!1,new _l(!1,null,!0));return}const i=this.connectionFactory_();this.pendingConnection_=i;const o=a=>{const c=a.loaded,l=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(c,l)};this.progressCallback_!==null&&i.addUploadProgressListener(o),i.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&i.removeUploadProgressListener(o),this.pendingConnection_=null;const a=i.getErrorCode()===Nh.NO_ERROR,c=i.getStatus();if(!a||i$(c,this.additionalRetryCodes_)&&this.retry){const h=i.getErrorCode()===Nh.ABORT;r(!1,new _l(!1,null,h));return}const l=this.successCodes_.indexOf(c)!==-1;r(!0,new _l(l,i))})},n=(r,s)=>{const i=this.resolve_,o=this.reject_,a=s.connection;if(s.wasSuccessCode)try{const c=this.callback_(a,a.getResponse());r$(c)?i(c):i()}catch(c){o(c)}else if(a!==null){const c=z6();c.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,c)):o(c)}else if(s.canceled){const c=this.appDelete_?zP():J6();o(c)}else{const c=Q6();o(c)}};this.canceled_?n(!1,new _l(!1,null,!0)):this.backoffId_=t$(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&n$(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class _l{constructor(e,n,r){this.wasSuccessCode=e,this.connection=n,this.canceled=!!r}}function a$(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function c$(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function u$(t,e){e&&(t["X-Firebase-GMPID"]=e)}function l$(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}
41function h$(t,e,n,r,s,i,o=!0,a=!1){const c=s$(t.urlParams),l=t.url+c,h=Object.assign({},t.headers);return u$(h,e),a$(h,n),c$(h,i),l$(h,r),new o$(l,t.method,h,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,s,o,a)}function d$(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function f$(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}class Dh{constructor(e,n){this._service=e,n instanceof Mn?this._location=n:this._location=Mn.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new Dh(e,n)}get root(){const e=new Mn(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return f$(this._location.path)}get storage(){return this._service}get parent(){const e=d$(this._location.path);if(e===null)return null;const n=new Mn(this._location.bucket,e);return new Dh(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw Z6(e)}}function jT(t,e){const n=e?.[G6];return n==null?null:Mn.makeFromBucketSpec(n,t)}function p$(t,e,n,r={}){t.host=`${e}:${n}`;const s=lr(e);s&&(yu(`https://${t.host}/b`),Jh("Storage",!0)),t._isUsingEmulator=!0,t._protocol=s?"https":"http";const{mockUserToken:i}=r;i&&(t._overrideAuthToken=typeof i=="string"?i:xb(i,t.app.options.projectId))}class m${constructor(e,n,r,s,i,o=!1){this.app=e,this._authProvider=n,this._appCheckProvider=r,this._url=s,this._firebaseVersion=i,this._isUsingEmulator=o,this._bucket=null,this._host=KP,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=W6,this._maxUploadRetryTime=K6,this._requests=new Set,s!=null?this._bucket=Mn.makeFromBucketSpec(s,this._host):this._bucket=jT(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=Mn.makeFromBucketSpec(this._url,e):this._bucket=jT(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){BT("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){BT("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(Ze(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Dh(this,e)}_makeRequest(e,n,r,s,i=!0){if(this._deleted)return new e$(zP());{const o=h$(e,this._appId,r,s,n,this._firebaseVersion,i,this._isUsingEmulator);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,n){const[r,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,r,s).getPromise()}}const $T="@firebase/storage",qT="0.14.0";const QP="storage";function g$(t=Iu(),e){t=ue(t);const r=Wi(t,QP).getImmediate({identifier:e}),s=Wm("storage");return s&&_$(r,...s),r}function _$(t,e,n,r={}){p$(t,e,n,r)}function y$(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),s=t.getProvider("app-check-internal");return new m$(n,r,s,e,Ki)}function E$(){Os(new Mr(QP,y$,"PUBLIC").setMultipleInstances(!0)),Pn($T,qT,""),Pn($T,qT,"esm2020")}E$();const I$="type.googleapis.com/google.protobuf.Int64Value",T$="type.googleapis.com/google.protobuf.UInt64Value";function JP(t,e){const n={};for(const r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}function Oh(t){if(t==null)return null;if(t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&isFinite(t)||t===!0||t===!1||Object.prototype.toString.call(t)==="[object String]")return t;if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map(e=>Oh(e));if(typeof t=="function"||typeof t=="object")return JP(t,e=>Oh(e));throw new Error("Data cannot be encoded in JSON: "+t)}function ua(t){if(t==null)return t;if(t["@type"])switch(t["@type"]){case I$:case T$:{const e=Number(t.value);if(isNaN(e))throw new Error("Data cannot be decoded from JSON: "+t);return e}default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map(e=>ua(e)):typeof t=="function"||typeof t=="object"?JP(t,e=>ua(e)):t}const I_="functions";const HT={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENT
41ED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class rn extends Gn{constructor(e,n,r){super(`${I_}/${e}`,n||""),this.details=r,Object.setPrototypeOf(this,rn.prototype)}}function w$(t){if(t>=200&&t<300)return"ok";switch(t){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}function xh(t,e){let n=w$(t),r=n,s;try{const i=e&&e.error;if(i){const o=i.status;if(typeof o=="string"){if(!HT[o])return new rn("internal","internal");n=HT[o],r=o}const a=i.message;typeof a=="string"&&(r=a),s=i.details,s!==void 0&&(s=ua(s))}}catch{}return n==="ok"?null:new rn(n,r,s)}class v${constructor(e,n,r,s){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,Ze(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=n.getImmediate({optional:!0}),this.messaging=r.getImmediate({optional:!0}),this.auth||n.get().then(i=>this.auth=i,()=>{}),this.messaging||r.get().then(i=>this.messaging=i,()=>{}),this.appCheck||s?.get().then(i=>this.appCheck=i,()=>{})}async getAuthToken(){if(this.auth)try{return(await this.auth.getToken())?.accessToken}catch{return}}async getMessagingToken(){if(!(!this.messaging||!("Notification"in self)||Notification.permission!=="granted"))try{return await this.messaging.getToken()}catch{return}}async getAppCheckToken(e){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){const n=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return n.error?null:n.token}return null}async getContext(e){const n=await this.getAuthToken(),r=await this.getMessagingToken(),s=await this.getAppCheckToken(e);return{authToken:n,messagingToken:r,appCheckToken:s}}}const om="us-central1",b$=/^data: (.*?)(?:\n|$)/;function A$(t){let e=null;return{promise:new Promise((n,r)=>{e=setTimeout(()=>{r(new rn("deadline-exceeded","deadline-exceeded"))},t)}),cancel:()=>{e&&clearTimeout(e)}}}class R${constructor(e,n,r,s,i=om,o=(...a)=>fetch(...a)){this.app=e,this.fetchImpl=o,this.emulatorOrigin=null,this.contextProvider=new v$(e,n,r,s),this.cancelAllRequests=new Promise(a=>{this.deleteService=()=>Promise.resolve(a())});try{const a=new URL(i);this.customDomain=a.origin+(a.pathname==="/"?"":a.pathname),this.region=om}catch{this.customDomain=null,this.region=i}}_delete(){return this.deleteService()}_url(e){const n=this.app.options.projectId;return this.emulatorOrigin!==null?`${this.emulatorOrigin}/${n}/${this.region}/${e}`:this.customDomain!==null?`${this.customDomain}/${e}`:`https://${this.region}-${n}.cloudfunctions.net/${e}`}}function S$(t,e,n){const r=lr(e);t.emulatorOrigin=`http${r?"s":""}://${e}:${n}`,r&&(yu(t.emulatorOrigin+"/backends"),Jh("Functions",!0))}function P$(t,e,n){const r=s=>k$(t,e,s,n||{});return r.stream=(s,i)=>D$(t,e,s,i),r}function YP(t){return t.emulatorOrigin&&lr(t.emulatorOrigin)?"include":void 0}async function C$(t,e,n,r,s){n["Content-Type"]="application/json";let i;try{i=await r(t,{method:"POST",body:JSON.stringify(e),headers:n,credentials:YP(s)})}catch{return{status:0,json:null}}let o=null;try{o=await i.json()}catch{}return{status:i.status,json:o}}async function XP(t,e){const n={},r=await t.contextProvider.getContext(e.limitedUseAppCheckTokens);return r.authToken&&(n.Authorization="Bearer "+r.authToken),r.messagingToken&&(n["Firebase-Instance-ID-Token"]=r.messagingToken),r.appCheckToken!==null&&(n["X-Firebase-AppCheck"]=r.appCheckToken),n}function k$(t,e,n,r){const s=t._url(e);return N$(t,s,n,r)}async function N$(t,e,n,r){n=Oh(n);const s={data:n},i=await XP(t,r),o=r.timeout||7e4,a=A$(o),c=await Promise.race([C$(e,s,i,t.fetchImpl,t),a.promise,t.cancelAllRequests]);if(a.cancel(),!c)throw new rn("cancelled","Firebase Functions instance was deleted.");const l=xh(c.status,c.json);if(l)throw l;
41if(!c.json)throw new rn("internal","Response is not valid JSON object.");let h=c.json.data;if(typeof h>"u"&&(h=c.json.result),typeof h>"u")throw new rn("internal","Response is missing data field.");return{data:ua(h)}}function D$(t,e,n,r){const s=t._url(e);return O$(t,s,n,r||{})}async function O$(t,e,n,r){n=Oh(n);const s={data:n},i=await XP(t,r);i["Content-Type"]="application/json",i.Accept="text/event-stream";let o;try{o=await t.fetchImpl(e,{method:"POST",body:JSON.stringify(s),headers:i,signal:r?.signal,credentials:YP(t)})}catch(f){if(f instanceof Error&&f.name==="AbortError"){const _=new rn("cancelled","Request was cancelled.");return{data:Promise.reject(_),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(_)}}}}}}const m=xh(0,null);return{data:Promise.reject(m),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(m)}}}}}}let a,c;const l=new Promise((f,m)=>{a=f,c=m});r?.signal?.addEventListener("abort",()=>{const f=new rn("cancelled","Request was cancelled.");c(f)});const h=o.body.getReader(),d=x$(h,a,c,r?.signal);return{stream:{[Symbol.asyncIterator](){const f=d.getReader();return{async next(){const{value:m,done:_}=await f.read();return{value:m,done:_}},async return(){return await f.cancel(),{done:!0,value:void 0}}}}},data:l}}function x$(t,e,n,r){const s=(o,a)=>{const c=o.match(b$);if(!c)return;const l=c[1];try{const h=JSON.parse(l);if("result"in h){e(ua(h.result));return}if("message"in h){a.enqueue(ua(h.message));return}if("error"in h){const d=xh(0,h);a.error(d),n(d);return}}catch(h){if(h instanceof rn){a.error(h),n(h);return}}},i=new TextDecoder;return new ReadableStream({start(o){let a="";return c();async function c(){if(r?.aborted){const l=new rn("cancelled","Request was cancelled");return o.error(l),n(l),Promise.resolve()}try{const{value:l,done:h}=await t.read();if(h){a.trim()&&s(a.trim(),o),o.close();return}if(r?.aborted){const f=new rn("cancelled","Request was cancelled");o.error(f),n(f),await t.cancel();return}a+=i.decode(l,{stream:!0});const d=a.split(`
42`);a=d.pop()||"";for(const f of d)f.trim()&&s(f.trim(),o);return c()}catch(l){const h=l instanceof rn?l:xh(0,null);o.error(h),n(h)}}},cancel(){return t.cancel()}})}const GT="@firebase/functions",WT="0.13.1";const V$="auth-internal",L$="app-check-internal",M$="messaging-internal";function F$(t){const e=(n,{instanceIdentifier:r})=>{const s=n.getProvider("app").getImmediate(),i=n.getProvider(V$),o=n.getProvider(M$),a=n.getProvider(L$);return new R$(s,i,o,a,r)};Os(new Mr(I_,e,"PUBLIC").setMultipleInstances(!0)),Pn(GT,WT,t),Pn(GT,WT,"esm2020")}function ZP(t=Iu(),e=om){const r=Wi(ue(t),I_).getImmediate({identifier:e}),s=Wm("functions");return s&&T_(r,...s),r}function T_(t,e,n){S$(ue(t),e,n)}function U$(t,e,n){return P$(ue(t),e,n)}F$();const Kq=Object.freeze(Object.defineProperty({__proto__:null,FunctionsError:rn,connectFunctionsEmulator:T_,getFunctions:ZP,httpsCallable:U$},Symbol.toStringTag,{value:"Module"})),B$=St(async()=>{let t,e;const n=pa();["firebaseApiKey","firebaseAuthDomain","firebaseProjectId"].filter(c=>!n.public[c]).length>0&&console.error("Error: Configuraciones de Firebase faltantes. Verifica las variables de entorno.");const i=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),o=!!n.public.useFirebaseEmulators&&i,a={apiKey:n.public.firebaseApiKey,authDomain:n.public.firebaseAuthDomain,projectId:n.public.firebaseProjectId,storageBucket:n.public.firebaseStorageBucket,messagingSenderId:n.public.firebaseMessagingSenderId,appId:n.public.firebaseAppId};try{const c=Rp(a),l=_S(c,{experimentalForceLongPolling:!0,useFetchStreams:!1,ignoreUndefinedProperties:!0}),h=WP(c);if(o){const{connectAuthEmulator:_}=([t,e]=As(()=>ie(()=>Promise.resolve().then(()=>_i),void 0,import.meta.url)),t=await t,e(),t);_(h,"http://127.0.0.1:9099",{disableWarnings:!0})}const d=g$(c);let f=c;if(o){const _={...a,projectId:"demo-no-project"};try{f=Rp(_,"functions-emulator-app")}catch{f=Iu("functions-emulator-app")}}const m=ZP(f);return o&&T_(m,"127.0.0.1",5e3),{provide:{firebase:c,firestore:l,firebaseAuth:h,ensureFirebaseAuth:async()=>h,firebaseStorage:d,firebaseFunctions:m}}}catch(c){throw console.error("Error inicializando Firebase:",c),c}}),j$=St(()=>{});
42function $$(t){const e=ga(t).split("/").filter(Boolean);return e[0]==="repuestos"&&e.length>=2}const q$=St(()=>{const t=ma(),e=Ue(()=>Tb(ga(t.path))),n=Ue(()=>sV(t.path)),r=Ue(()=>$$(t.path));eb({link:Ue(()=>n.value||r.value?[]:[{rel:"canonical",key:"canonical",href:e.value}])}),hO({robots:Ue(()=>{if(!r.value)return n.value?"noindex, nofollow":"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),ogUrl:Ue(()=>n.value||r.value?void 0:e.value)})}),H$=[gO,yO,vO,TV,wV,bV,AV,RV,PV,LV,MV,FV,BV,jV,$V,qV,B$,j$,q$],eC=(t="RouteProvider")=>Hr({name:t,props:{route:{type:Object,required:!0},vnode:Object,vnodeRef:Object,renderKey:String,trackRootNodes:Boolean},setup(e){const n=e.renderKey,r=e.route,s={};for(const i in e.route)Object.defineProperty(s,i,{get:()=>n===e.renderKey?e.route[i]:r[i],enumerable:!0});return bs(Oi,er(s)),()=>e.vnode?Dt(e.vnode,{ref:e.vnodeRef}):e.vnode}}),G$=eC(),KT=new WeakMap,W$=Hr({name:"NuxtPage",inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(t,{attrs:e,slots:n,expose:r}){const s=xe(),i=pn(),o=Ot(Oi,null);let a;r({pageRef:i});const c=Ot(Fv,null);let l;const h=s.deferHydration();if(s.isHydrating){const f=s.hooks.hookOnce("app:error",h);on().beforeEach(f)}t.pageKey&&vi(()=>t.pageKey,(f,m)=>{f!==m&&s.callHook("page:loading:start")});let d=!1;{const f=on().beforeResolve(()=>{d=!1});fa(()=>{f()})}return()=>Dt(yb,{name:t.name,route:t.route,...e},{default:f=>{const m=z$(o,f.route,f.Component),_=o&&o.matched.length===f.route.matched.length;if(!f.Component){if(l&&!_)return l;h();return}if(l&&c&&!c.isCurrent(f.route))return l;if(m&&o&&(!c||c?.isCurrent(o)))return _?l:null;const E=_p(f,t.pageKey),v=Q$(o,f.route,f.Component);!s.isHydrating&&a===E&&!v&&Ds(()=>{d=!0,s.callHook("page:loading:end")}),a=E;const O=!!(t.transition??f.route.meta.pageTransition??tE),N=O&&K$([t.transition,f.route.meta.pageTransition,tE,{onAfterLeave(){delete s._runningTransition,s.callHook("page:transition:finish",f.Component)}}]),y=t.keepalive??f.route.meta.keepalive??sD;return l=vb(O&&N,Ox(y,Dt(Nm,{suspensible:!0,onPending:()=>{O&&(s._runningTransition=!0),s.callHook("page:start",f.Component)}
42,onResolve:()=>{Ds(()=>s.callHook("page:finish",f.Component).then(()=>{if(delete s._runningTransition,!d&&!v)return d=!0,s.callHook("page:loading:end")}).finally(h))}},{default:()=>{const S={key:E||void 0,vnode:n.default?J$(n.default,f):f.Component,route:f.route,renderKey:E||void 0,trackRootNodes:O,vnodeRef:i};if(!y)return Dt(G$,S);const D=f.Component.type,M=D;let b=KT.get(M);return b||(b=eC(D.name||D.__name),KT.set(M,b)),Dt(b,S)}}))).default(),l}})}});function K$(t){const e=[];for(const n of t)n&&e.push({...n,onAfterLeave:n.onAfterLeave?Hm(n.onAfterLeave):void 0});return Lv(...e)}function z$(t,e,n){if(!t)return!1;const r=e.matched.findIndex(s=>s.components?.default===n?.type);return!r||r===-1?!1:e.matched.slice(0,r).some((s,i)=>s.components?.default!==t.matched[i]?.components?.default)||n&&_p({route:e,Component:n})!==_p({route:t,Component:n})}function Q$(t,e,n){return t?e.matched.findIndex(s=>s.components?.default===n?.type)<e.matched.length-1:!1}function J$(t,e){const n=t(e);return n.length===1?Dt(n[0]):Dt(Qt,void 0,n)}const Y$=Hr({name:"LayoutLoader",inheritAttrs:!1,props:{name:String,layoutProps:Object},setup(t,e){return()=>Dt(Es[t.name],t.layoutProps,e.slots)}}),X$={name:{type:[String,Boolean,Object],default:null},fallback:{type:[String,Object],default:null}},Z$=Hr({name:"NuxtLayout",inheritAttrs:!1,props:X$,setup(t,e){const n=xe(),r=Ot(Oi),i=!r||r===ma()?Eb():r,o=Ue(()=>{let h=gt(t.name)??i?.meta.layout??"default";return h&&!(h in Es)&&t.fallback&&(h=gt(t.fallback)),h}),a=ki();e.expose({layoutRef:a});const c=n.deferHydration();if(n.isHydrating){const h=n.hooks.hookOnce("app:error",c);on().beforeEach(h)}let l;return()=>{const h=o.value&&o.value in Es,d=i?.meta.layoutTransition??rD,f=l;return l=o.value,vb(h&&d,{default:()=>Dt(Nm,{suspensible:!0,onResolve:()=>{Ds(c)}},{default:()=>Dt(eq,{layoutProps:dv(e.attrs,{ref:a}),key:o.value||void 0,name:o.value,shouldProvide:!t.name,isRenderingNewLayout:m=>m!==f&&m===o.value,hasTransition:!!d},e.slots)})}).default()}}}),eq=Hr({name:"NuxtLayoutProvider",inheritAttrs:!1,props:{name:{type:[String,Boolean]},layoutProps:{type:Object},hasTransition:{type:Boolean},shouldProvide:{type:Boolean},isRenderingNewLayout:{type:Function,required:!0}},setup(t,e){const n=t.name;t.shouldProvide&&bs(Fv,{isCurrent:i=>n===(i.meta.layout??"default")});const r=Ot(Oi);if(r&&r===ma()){const i=Eb(),o={};for(const a in i){const c=a;Object.defineProperty(o,c,{enumerable:!0,get:()=>t.isRenderingNewLayout(t.name)?i[c]:r[c]})}bs(Oi,er(o))}return()=>!n||typeof n=="string"&&!(n in Es)?e.slots.default?.():Dt(Y$,{key:n,layoutProps:t.layoutProps,name:n},e.slots)}}),tq=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},nq={};function rq(t,e){const n=W$,r=Z$;return nn(),wo("div",null,[Oe(r,null,{default:Jn(()=>[Oe(n)]),_:1})])}const sq=tq(nq,[["render",rq]]),iq={class:"min-h-screen bg-gray-50 flex items-center justify-center px-4"},oq={class:"max-w-lg w-full text-center"},aq={key:0,class:"space-y-6"},cq={class:"bg-white rounded-lg shadow p-6 space-y-4"},uq={class:"grid gap-3"},lq={class:"bg-white rounded-lg shadow p-6"},hq={class:"grid grid-cols-2 gap-2"},dq={key:1,class:"space-y-6"},fq={key:2,class:"space-y-6"},pq={class:"text-6xl font-bold text-orange-600"},mq={class:"text-3xl font-bold text-gray-800"},gq={class:"text-gray-600"},_q={class:"mt-8"},yq={__name:"error",props:["error"],setup(t){const e=t,n=()=>{window.location.reload()};return eb({title:`Error ${e.error.statusCode} - AutoPiezas360 Chile`,meta:[{name:"robots",content:"noindex, nofollow"}]}),(r,s)=>{const i=DV;return nn(),wo("div",iq,[ke("div",oq,[t.error.statusCode===404?(nn(),wo("div",aq,[s[8]||(s[8]=ke("div",{class:"text-6xl font-bold text-blue-600"},"404",-1)),s[9]||(s[9]=ke("h1",{class:"text-3xl font-bold text-gray-800"},"Página no encontrada",-1)),s[10]||(s[10]=ke("p",{class:"text-gray-600"}," La página que buscas no existe o ha sido movida. ¿Buscabas un repuesto específico? ",-1)),ke("div",cq,[s[2]||(s[2]=ke("h2",{class:"text-xl font-semibold text-gray-800"},"¿Qué puedes hacer?",-1)),ke("div",uq,[Oe(i,{to:"/repuestos",class:"flex items-center p-3 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"},{default:Jn(()=>[...s[0]||(s[0]=[ke("svg",{class:"w-5 h-5 text-blue-600 mr-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[ke("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})],-1),ke("div",{class:"text-left"},[ke("div",{class:"font-medium text-gray-800"},"Ver todas las marcas"),ke("div",{class:"text-sm text-gray-600"},"Encuentra repuestos por marca")],-1)])]),_:1}),Oe(i,{to:"/contacto",class:"flex items-center p-3 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"},{default:Jn(()=>[...s[1]||(s[1]=[ke("svg",{class:"w-5 h-5 text-green-600 mr-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[ke("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.25
425-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),ke("div",{class:"text-left"},[ke("div",{class:"font-medium text-gray-800"},"¿No encuentras tu repuesto?"),ke("div",{class:"text-sm text-gray-600"},"Lo importamos por ti")],-1)])]),_:1})])]),ke("div",lq,[s[7]||(s[7]=ke("h3",{class:"text-lg font-semibold text-gray-800 mb-4"},"Marcas más buscadas",-1)),ke("div",hq,[Oe(i,{to:"/repuestos/toyota",class:"text-blue-600 hover:text-blue-800 text-sm py-2 px-3 bg-blue-50 rounded hover:bg-blue-100 transition-colors"},{default:Jn(()=>[...s[3]||(s[3]=[di("Toyota",-1)])]),_:1}),Oe(i,{to:"/repuestos/nissan",class:"text-blue-600 hover:text-blue-800 text-sm py-2 px-3 bg-blue-50 rounded hover:bg-blue-100 transition-colors"},{default:Jn(()=>[...s[4]||(s[4]=[di("Nissan",-1)])]),_:1}),Oe(i,{to:"/repuestos/chevrolet",class:"text-blue-600 hover:text-blue-800 text-sm py-2 px-3 bg-blue-50 rounded hover:bg-blue-100 transition-colors"},{default:Jn(()=>[...s[5]||(s[5]=[di("Chevrolet",-1)])]),_:1}),Oe(i,{to:"/repuestos/bmw",class:"text-blue-600 hover:text-blue-800 text-sm py-2 px-3 bg-blue-50 rounded hover:bg-blue-100 transition-colors"},{default:Jn(()=>[...s[6]||(s[6]=[di("BMW",-1)])]),_:1})])])])):t.error.statusCode===500?(nn(),wo("div",dq,[s[11]||(s[11]=ke("div",{class:"text-6xl font-bold text-red-600"},"500",-1)),s[12]||(s[12]=ke("h1",{class:"text-3xl font-bold text-gray-800"},"Error interno del servidor",-1)),s[13]||(s[13]=ke("p",{class:"text-gray-600"}," Algo salió mal en nuestro servidor. Por favor, intenta de nuevo en unos minutos. ",-1)),ke("div",{class:"bg-white rounded-lg shadow p-6"},[ke("button",{onClick:n,class:"w-full bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg transition-colors"}," Intentar de nuevo ")])])):(nn(),wo("div",fq,[ke("div",pq,yl(t.error.statusCode),1),ke("h1",mq,yl(t.error.statusMessage||"Error"),1),ke("p",gq,yl(t.error.message||"Ha ocurrido un error inesperado"),1)])),ke("div",_q,[Oe(i,{to:"/",class:"inline-flex items-center bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg transition-colors"},{default:Jn(()=>[...s[14]||(s[14]=[ke("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[ke("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 19l-7-7m0 0l7-7m-7 7h18"})],-1),di(" Volver al inicio ",-1)])]),_:1})])])])}}},Eq={key:0},zT={__name:"nuxt-root",setup(t){const e=()=>null,n=xe(),r=n.deferHydration();if(n.isHydrating){const l=n.hooks.hookOnce("app:error",r);on().beforeEach(l)}const s=!1;bs(Oi,ma()),n.hooks.callHookWith(l=>l.map(h=>h()),"vue:setup");const i=Gh(),o=!1,a=/bot\b|chrome-lighthouse|facebookexternalhit|google\b/i;Bw((l,h,d)=>
42{if(n.hooks.callHook("vue:error",l,h,d).catch(f=>console.error("[nuxt] Error in `vue:error` hook",f)),a.test(navigator.userAgent))return n.hooks.callHook("app:error",l),console.error(`[nuxt] Not rendering error page for bot with user agent \`${navigator.userAgent}\`:`,l),!1;if(Bv(l)&&(l.fatal||l.unhandled))return n.runWithContext(()=>ci(l)),!1});const c=!1;return(l,h)=>(nn(),ms(Nm,{onResolve:gt(r)},{default:Jn(()=>[gt(o)?(nn(),wo("div",Eq)):gt(i)?(nn(),ms(gt(yq),{key:1,error:gt(i)},null,8,["error"])):gt(c)?(nn(),ms(gt(e),{key:2,context:gt(c)},null,8,["context"])):gt(s)?(nn(),ms(N0(gt(s)),{key:3})):(nn(),ms(gt(sq),{key:4}))]),_:1},8,["onResolve"]))}};let QT;{let t;QT=async function(){if(t)return t;const n=!!(window.__NUXT__?.serverRendered??document.getElementById("__NUXT_DATA__")?.dataset.ssr==="true"),r=n?Zk(zT):Xk(zT),s=uD({vueApp:r});async function i(o){await s.callHook("app:error",o),s.payload.error||=Ai(o)}r.config.errorHandler=i,s.hook("app:suspense:resolve",()=>{r.config.errorHandler===i&&(r.config.errorHandler=void 0)}),!n&&nE.id&&s.hook("app:suspense:resolve",()=>{document.getElementById(nE.id)?.remove()});try{await dD(s,H$)}catch(o){i(o)}try{await s.hooks.callHook("app:created",r),await s.hooks.callHook("app:beforeMount",r),r.mount(oD),await s.hooks.callHook("app:mounted",r),await Ds()}catch(o){i(o)}return r},t=QT().catch(e=>{throw console.error("Error while mounting app:",e),e})}export{hO as $,dm as A,vi as B,HU as C,k2 as D,c2 as E,Qt as F,d2 as G,Hq as H,yp as I,xE as J,Al as K,Ds as L,qq as M,ms as N,Aq as O,Uw as P,tV as Q,Ai as R,OE as S,Pk as T,Tb as U,Fq as V,Mq as W,Uq as X,qr as Y,Gq as Z,DV as _,Oe as a,Bq as a0,Gm as a1,Lq as a2,on as a3,aV as a4,$q as a5,xq as a6,As as a7,bq as a8,Hr as a9,Y0 as aA,Ib as aB,pl as aC,_i as aD,Kq as aE,N0 as aa,Pq as ab,tq as ac,wq as ad,jq as ae,oV as af,Cv as ag,pa as ah,V2 as ai,mS as aj,x2 as ak,L2 as al,u2 as am,f2 as an,S2 as ao,Vq as ap,n0 as aq,Oq as ar,Gi as as,R0 as at,Ot as au,VC as av,gm as aw,ki as ax,a0 as ay,qf as az,ke as b,wo as c,Rq as d,Sq as e,Tq as f,kq as g,Jn as h,di as i,xe as j,ma as k,Ue as l,gt as m,xi as n,nn as o,fm as p,Bh as q,pn as r,UV as s,yl as t,eb as u,Cq as v,Dq as w,vq as x,at as y,Nq as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.