var ut=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function n5(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function i5(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}),e}function s5(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zh={exports:{}},o5={},a5=Object.freeze(Object.defineProperty({__proto__:null,default:o5},Symbol.toStringTag,{value:"Module"})),pw=i5(a5),zM=typeof process!="undefined"&&process.pid?process.pid.toString(36):"",HM="";if(typeof __webpack_require__!="function"&&typeof s5!="undefined"){var $y="",mI=pw;if(mI.networkInterfaces)var Fy=mI.networkInterfaces();if(Fy){e:for(let t in Fy){const e=Fy[t],r=e.length;for(var Oc=0;Oce?t:e+1}var vde=zh.exports;function u5(t){return!!(t&&typeof t.then=="function")}Promise.resolve(!1);Promise.resolve(!0);var Lu=Promise.resolve();function KM(t,e){return t||(t=0),new Promise(function(r){return setTimeout(function(){return r(e)},t)})}function c5(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function gw(){return Math.random().toString(36).substring(2)}var vI=0,Uy=0;function im(){var t=new Date().getTime();return t===vI?(Uy++,t*1e3+Uy):(vI=t,Uy=0,t*1e3)}var sm=Object.prototype.toString.call(typeof process!="undefined"?process:0)==="[object process]",l5=im,f5="native";function h5(t){var e={messagesCallback:null,bc:new BroadcastChannel(t),subFns:[]};return e.bc.onmessage=function(r){e.messagesCallback&&e.messagesCallback(r.data)},e}function d5(t){t.bc.close(),t.subFns=[]}function p5(t,e){try{return t.bc.postMessage(e,!1),Lu}catch(r){return Promise.reject(r)}}function g5(t,e){t.messagesCallback=e}function m5(){if(sm&&typeof window=="undefined")return!1;if(typeof BroadcastChannel=="function"){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}else return!1}function v5(){return 150}var y5={create:h5,close:d5,onMessage:g5,postMessage:p5,canBeUsed:m5,type:f5,averageResponseTime:v5,microSeconds:l5},GM=function(){function t(e){this.ttl=e,this.set=new Set,this.timeMap=new Map}return t.prototype.has=function(e){return this.set.has(e)},t.prototype.add=function(e){var r=this;this.timeMap.set(e,WM()),this.set.add(e),setTimeout(function(){_5(r)},0)},t.prototype.clear=function(){this.set.clear(),this.timeMap.clear()},t}();function _5(t){for(var e=WM()-t.ttl,r=t.set[Symbol.iterator]();;){var n=r.next().value;if(!n)return;var i=t.timeMap.get(n);if(i0&&arguments[0]!==void 0?arguments[0]:{},e=JSON.parse(JSON.stringify(t));return typeof e.webWorkerSupport=="undefined"&&(e.webWorkerSupport=!0),e.idb||(e.idb={}),e.idb.ttl||(e.idb.ttl=1e3*45),e.idb.fallbackInterval||(e.idb.fallbackInterval=150),t.idb&&typeof t.idb.onclose=="function"&&(e.idb.onclose=t.idb.onclose),e.localstorage||(e.localstorage={}),e.localstorage.removeTimeout||(e.localstorage.removeTimeout=1e3*60),t.methods&&(e.methods=t.methods),e.node||(e.node={}),e.node.ttl||(e.node.ttl=1e3*60*2),e.node.maxParallelWrites||(e.node.maxParallelWrites=2048),typeof e.node.useFastPath=="undefined"&&(e.node.useFastPath=!0),e}var b5=im,w5="pubkey.broadcast-channel-0-",Io="messages",om={durability:"relaxed"},E5="idb";function XM(){if(typeof indexedDB!="undefined")return indexedDB;if(typeof window!="undefined"){if(typeof window.mozIndexedDB!="undefined")return window.mozIndexedDB;if(typeof window.webkitIndexedDB!="undefined")return window.webkitIndexedDB;if(typeof window.msIndexedDB!="undefined")return window.msIndexedDB}return!1}function vw(t){t.commit&&t.commit()}function x5(t){var e=XM(),r=w5+t,n=e.open(r);n.onupgradeneeded=function(s){var o=s.target.result;o.createObjectStore(Io,{keyPath:"id",autoIncrement:!0})};var i=new Promise(function(s,o){n.onerror=function(a){return o(a)},n.onsuccess=function(){s(n.result)}});return i}function S5(t,e,r){var n=new Date().getTime(),i={uuid:e,time:n,data:r},s=t.transaction([Io],"readwrite",om);return new Promise(function(o,a){s.oncomplete=function(){return o()},s.onerror=function(c){return a(c)};var u=s.objectStore(Io);u.add(i),vw(s)})}function I5(t,e){var r=t.transaction(Io,"readonly",om),n=r.objectStore(Io),i=[],s=IDBKeyRange.bound(e+1,1/0);if(n.getAll){var o=n.getAll(s);return new Promise(function(u,c){o.onerror=function(l){return c(l)},o.onsuccess=function(l){u(l.target.result)}})}function a(){try{return s=IDBKeyRange.bound(e+1,1/0),n.openCursor(s)}catch{return n.openCursor()}}return new Promise(function(u,c){var l=a();l.onerror=function(h){return c(h)},l.onsuccess=function(h){var d=h.target.result;d?d.value.idt.lastCursorId&&(t.lastCursorId=n.id),n}).filter(function(n){return C5(n,t)}).sort(function(n,i){return n.time-i.time});return r.forEach(function(n){t.messagesCallback&&(t.eMIs.add(n.id),t.messagesCallback(n.data))}),Lu})}function R5(t){t.closed=!0,t.db.close()}function N5(t,e){return t.writeBlockPromise=t.writeBlockPromise.then(function(){return S5(t.db,t.uuid,e)}).then(function(){c5(0,10)===0&&k5(t.db,t.options.idb.ttl)}),t.writeBlockPromise}function O5(t,e,r){t.messagesCallbackTime=r,t.messagesCallback=e,JM(t)}function D5(){if(sm)return!1;var t=XM();return!!t}function P5(t){return t.idb.fallbackInterval*2}var L5={create:M5,close:R5,onMessage:O5,postMessage:N5,canBeUsed:D5,type:E5,averageResponseTime:P5,microSeconds:b5},B5=im,$5="pubkey.broadcastChannel-",F5="localstorage";function QM(){var t;if(typeof window=="undefined")return null;try{t=window.localStorage,t=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return t}function ZM(t){return $5+t}function U5(t,e){return new Promise(function(r){KM().then(function(){var n=ZM(t.channelName),i={token:gw(),time:new Date().getTime(),data:e,uuid:t.uuid},s=JSON.stringify(i);QM().setItem(n,s);var o=document.createEvent("Event");o.initEvent("storage",!0,!0),o.key=n,o.newValue=s,window.dispatchEvent(o),r()})})}function q5(t,e){var r=ZM(t),n=function(s){s.key===r&&e(JSON.parse(s.newValue))};return window.addEventListener("storage",n),n}function j5(t){window.removeEventListener("storage",t)}function V5(t,e){if(e=mw(e),!eC())throw new Error("BroadcastChannel: localstorage cannot be used");var r=gw(),n=new GM(e.localstorage.removeTimeout),i={channelName:t,uuid:r,eMIs:n};return i.listener=q5(t,function(s){!i.messagesCallback||s.uuid!==r&&(!s.token||n.has(s.token)||s.data.time&&s.data.time0||t._addEL.internal.length>0}function wI(t,e,r){t._addEL[e].push(r),oB(t)}function EI(t,e,r){t._addEL[e]=t._addEL[e].filter(function(n){return n!==r}),aB(t)}function oB(t){if(!t._iL&&nC(t)){var e=function(i){t._addEL[i.type].forEach(function(s){var o=1e5,a=s.time-o;i.time>=a&&s.fn(i.data)})},r=t.method.microSeconds();t._prepP?t._prepP.then(function(){t._iL=!0,t.method.onMessage(t._state,e,r)}):(t._iL=!0,t.method.onMessage(t._state,e,r))}}function aB(t){if(t._iL&&!nC(t)){t._iL=!1;var e=t.method.microSeconds();t.method.onMessage(t._state,null,e)}}var Up,uB=new Uint8Array(16);function iC(){if(!Up&&(Up=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Up))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Up(uB)}var cB=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function lB(t){return typeof t=="string"&&cB.test(t)}var Xr=[];for(var qy=0;qy<256;++qy)Xr.push((qy+256).toString(16).substr(1));function sC(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(Xr[t[e+0]]+Xr[t[e+1]]+Xr[t[e+2]]+Xr[t[e+3]]+"-"+Xr[t[e+4]]+Xr[t[e+5]]+"-"+Xr[t[e+6]]+Xr[t[e+7]]+"-"+Xr[t[e+8]]+Xr[t[e+9]]+"-"+Xr[t[e+10]]+Xr[t[e+11]]+Xr[t[e+12]]+Xr[t[e+13]]+Xr[t[e+14]]+Xr[t[e+15]]).toLowerCase();if(!lB(r))throw TypeError("Stringified UUID is invalid");return r}var xI,jy,Vy=0,zy=0;function yde(t,e,r){var n=e&&r||0,i=e||new Array(16);t=t||{};var s=t.node||xI,o=t.clockseq!==void 0?t.clockseq:jy;if(s==null||o==null){var a=t.random||(t.rng||iC)();s==null&&(s=xI=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=jy=(a[6]<<8|a[7])&16383)}var u=t.msecs!==void 0?t.msecs:Date.now(),c=t.nsecs!==void 0?t.nsecs:zy+1,l=u-Vy+(c-zy)/1e4;if(l<0&&t.clockseq===void 0&&(o=o+1&16383),(l<0||u>Vy)&&t.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Vy=u,zy=c,jy=o,u+=122192928e5;var h=((u&268435455)*1e4+c)%4294967296;i[n++]=h>>>24&255,i[n++]=h>>>16&255,i[n++]=h>>>8&255,i[n++]=h&255;var d=u/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=d&255,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=o>>>8|128,i[n++]=o&255;for(var _=0;_<6;++_)i[n+_]=s[_];return e||sC(i)}function _de(t,e,r){t=t||{};var n=t.random||(t.rng||iC)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return sC(n)}function rf(t,e){const r=Object.create(null),n=t.split(",");for(let i=0;i!!r[i.toLowerCase()]:i=>!!r[i]}const fB="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt",hB=rf(fB),dB="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",oC=rf(dB);function aC(t){return!!t||t===""}function si(t){if(Be(t)){const e={};for(let r=0;r{if(r){const n=r.split(gB);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function as(t){let e="";if(ur(t))e=t;else if(Be(t))for(let r=0;rTo(r,e))}const sa=t=>ur(t)?t:t==null?"":Be(t)||zt(t)&&(t.toString===cC||!Xe(t.toString))?JSON.stringify(t,uC,2):String(t),uC=(t,e)=>e&&e.__v_isRef?uC(t,e.value):Zc(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((r,[n,i])=>(r[`${n} =>`]=i,r),{})}:vc(e)?{[`Set(${e.size})`]:[...e.values()]}:zt(e)&&!Be(e)&&!Wg(e)?String(e):e,Gt={},Qc=[],Kn=()=>{},_B=()=>!1,bB=/^on[^a-z]/,qo=t=>bB.test(t),_w=t=>t.startsWith("onUpdate:"),wt=Object.assign,bw=(t,e)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)},wB=Object.prototype.hasOwnProperty,Rt=(t,e)=>wB.call(t,e),Be=Array.isArray,Zc=t=>um(t)==="[object Map]",vc=t=>um(t)==="[object Set]",SI=t=>t instanceof Date,Xe=t=>typeof t=="function",ur=t=>typeof t=="string",ww=t=>typeof t=="symbol",zt=t=>t!==null&&typeof t=="object",am=t=>zt(t)&&Xe(t.then)&&Xe(t.catch),cC=Object.prototype.toString,um=t=>cC.call(t),EB=t=>um(t).slice(8,-1),Wg=t=>um(t)==="[object Object]",Ew=t=>ur(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,el=rf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),cm=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},xB=/-(\w)/g,Xn=cm(t=>t.replace(xB,(e,r)=>r?r.toUpperCase():"")),SB=/\B([A-Z])/g,oi=cm(t=>t.replace(SB,"-$1").toLowerCase()),qd=cm(t=>t.charAt(0).toUpperCase()+t.slice(1)),tl=cm(t=>t?`on${qd(t)}`:""),Kh=(t,e)=>!Object.is(t,e),Ea=(t,e)=>{for(let r=0;r{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:r})},Ao=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let II;const IB=()=>II||(II=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let Ti;class xw{constructor(e=!1){this.active=!0,this.effects=[],this.cleanups=[],!e&&Ti&&(this.parent=Ti,this.index=(Ti.scopes||(Ti.scopes=[])).push(this)-1)}run(e){if(this.active)try{return Ti=this,e()}finally{Ti=this.parent}}on(){Ti=this}off(){Ti=this.parent}stop(e){if(this.active){let r,n;for(r=0,n=this.effects.length;r{const e=new Set(t);return e.w=0,e.n=0,e},fC=t=>(t.w&Na)>0,hC=t=>(t.n&Na)>0,MB=({deps:t})=>{if(t.length)for(let e=0;e{const{deps:e}=t;if(e.length){let r=0;for(let n=0;n{(c==="length"||c>=n)&&a.push(u)});else switch(r!==void 0&&a.push(o.get(r)),e){case"add":Be(t)?Ew(r)&&a.push(o.get("length")):(a.push(o.get(Bu)),Zc(t)&&a.push(o.get(Mb)));break;case"delete":Be(t)||(a.push(o.get(Bu)),Zc(t)&&a.push(o.get(Mb)));break;case"set":Zc(t)&&a.push(o.get(Bu));break}if(a.length===1)a[0]&&Cb(a[0]);else{const u=[];for(const c of a)c&&u.push(...c);Cb(Sw(u))}}function Cb(t,e){for(const r of Be(t)?t:[...t])(r!==Ns||r.allowRecurse)&&(r.scheduler?r.scheduler():r.run())}const OB=rf("__proto__,__v_isRef,__isVue"),gC=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(ww)),DB=lm(),PB=lm(!1,!0),LB=lm(!0),BB=lm(!0,!0),AI=$B();function $B(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...r){const n=It(this);for(let s=0,o=this.length;s{t[e]=function(...r){yc();const n=It(this)[e].apply(this,r);return _c(),n}}),t}function lm(t=!1,e=!1){return function(n,i,s){if(i==="__v_isReactive")return!t;if(i==="__v_isReadonly")return t;if(i==="__v_isShallow")return e;if(i==="__v_raw"&&s===(t?e?EC:wC:e?bC:_C).get(n))return n;const o=Be(n);if(!t&&o&&Rt(AI,i))return Reflect.get(AI,i,s);const a=Reflect.get(n,i,s);return(ww(i)?gC.has(i):OB(i))||(t||Yn(n,"get",i),e)?a:kr(a)?!o||!Ew(i)?a.value:a:zt(a)?t?Tw(a):js(a):a}}const FB=mC(),UB=mC(!0);function mC(t=!1){return function(r,n,i,s){let o=r[n];if(Al(o)&&kr(o)&&!kr(i))return!1;if(!t&&!Al(i)&&(Aw(i)||(i=It(i),o=It(o)),!Be(r)&&kr(o)&&!kr(i)))return o.value=i,!0;const a=Be(r)&&Ew(n)?Number(n)t,fm=t=>Reflect.getPrototypeOf(t);function qp(t,e,r=!1,n=!1){t=t.__v_raw;const i=It(t),s=It(e);e!==s&&!r&&Yn(i,"get",e),!r&&Yn(i,"get",s);const{has:o}=fm(i),a=n?Iw:r?Cw:Gh;if(o.call(i,e))return a(t.get(e));if(o.call(i,s))return a(t.get(s));t!==i&&t.get(e)}function jp(t,e=!1){const r=this.__v_raw,n=It(r),i=It(t);return t!==i&&!e&&Yn(n,"has",t),!e&&Yn(n,"has",i),t===i?r.has(t):r.has(t)||r.has(i)}function Vp(t,e=!1){return t=t.__v_raw,!e&&Yn(It(t),"iterate",Bu),Reflect.get(t,"size",t)}function kI(t){t=It(t);const e=It(this);return fm(e).has.call(e,t)||(e.add(t),qs(e,"add",t,t)),this}function MI(t,e){e=It(e);const r=It(this),{has:n,get:i}=fm(r);let s=n.call(r,t);s||(t=It(t),s=n.call(r,t));const o=i.call(r,t);return r.set(t,e),s?Kh(e,o)&&qs(r,"set",t,e):qs(r,"add",t,e),this}function CI(t){const e=It(this),{has:r,get:n}=fm(e);let i=r.call(e,t);i||(t=It(t),i=r.call(e,t)),n&&n.call(e,t);const s=e.delete(t);return i&&qs(e,"delete",t,void 0),s}function RI(){const t=It(this),e=t.size!==0,r=t.clear();return e&&qs(t,"clear",void 0,void 0),r}function zp(t,e){return function(n,i){const s=this,o=s.__v_raw,a=It(o),u=e?Iw:t?Cw:Gh;return!t&&Yn(a,"iterate",Bu),o.forEach((c,l)=>n.call(i,u(c),u(l),s))}}function Hp(t,e,r){return function(...n){const i=this.__v_raw,s=It(i),o=Zc(s),a=t==="entries"||t===Symbol.iterator&&o,u=t==="keys"&&o,c=i[t](...n),l=r?Iw:e?Cw:Gh;return!e&&Yn(s,"iterate",u?Mb:Bu),{next(){const{value:h,done:d}=c.next();return d?{value:h,done:d}:{value:a?[l(h[0]),l(h[1])]:l(h),done:d}},[Symbol.iterator](){return this}}}}function Xo(t){return function(...e){return t==="delete"?!1:this}}function KB(){const t={get(s){return qp(this,s)},get size(){return Vp(this)},has:jp,add:kI,set:MI,delete:CI,clear:RI,forEach:zp(!1,!1)},e={get(s){return qp(this,s,!1,!0)},get size(){return Vp(this)},has:jp,add:kI,set:MI,delete:CI,clear:RI,forEach:zp(!1,!0)},r={get(s){return qp(this,s,!0)},get size(){return Vp(this,!0)},has(s){return jp.call(this,s,!0)},add:Xo("add"),set:Xo("set"),delete:Xo("delete"),clear:Xo("clear"),forEach:zp(!0,!1)},n={get(s){return qp(this,s,!0,!0)},get size(){return Vp(this,!0)},has(s){return jp.call(this,s,!0)},add:Xo("add"),set:Xo("set"),delete:Xo("delete"),clear:Xo("clear"),forEach:zp(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=Hp(s,!1,!1),r[s]=Hp(s,!0,!1),e[s]=Hp(s,!1,!0),n[s]=Hp(s,!0,!0)}),[t,r,e,n]}const[GB,WB,XB,YB]=KB();function hm(t,e){const r=e?t?YB:XB:t?WB:GB;return(n,i,s)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?n:Reflect.get(Rt(r,i)&&i in n?r:n,i,s)}const JB={get:hm(!1,!1)},QB={get:hm(!1,!0)},ZB={get:hm(!0,!1)},e$={get:hm(!0,!0)},_C=new WeakMap,bC=new WeakMap,wC=new WeakMap,EC=new WeakMap;function t$(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function r$(t){return t.__v_skip||!Object.isExtensible(t)?0:t$(EB(t))}function js(t){return Al(t)?t:dm(t,!1,vC,JB,_C)}function xC(t){return dm(t,!1,zB,QB,bC)}function Tw(t){return dm(t,!0,yC,ZB,wC)}function n$(t){return dm(t,!0,HB,e$,EC)}function dm(t,e,r,n,i){if(!zt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=i.get(t);if(s)return s;const o=r$(t);if(o===0)return t;const a=new Proxy(t,o===2?n:r);return i.set(t,a),a}function wo(t){return Al(t)?wo(t.__v_raw):!!(t&&t.__v_isReactive)}function Al(t){return!!(t&&t.__v_isReadonly)}function Aw(t){return!!(t&&t.__v_isShallow)}function kw(t){return wo(t)||Al(t)}function It(t){const e=t&&t.__v_raw;return e?It(e):t}function Mw(t){return Xg(t,"__v_skip",!0),t}const Gh=t=>zt(t)?js(t):t,Cw=t=>zt(t)?Tw(t):t;function Rw(t){xa&&Ns&&(t=It(t),pC(t.dep||(t.dep=Sw())))}function pm(t,e){t=It(t),t.dep&&Cb(t.dep)}function kr(t){return!!(t&&t.__v_isRef===!0)}function rl(t){return IC(t,!1)}function SC(t){return IC(t,!0)}function IC(t,e){return kr(t)?t:new i$(t,e)}class i${constructor(e,r){this.__v_isShallow=r,this.dep=void 0,this.__v_isRef=!0,this._rawValue=r?e:It(e),this._value=r?e:Gh(e)}get value(){return Rw(this),this._value}set value(e){e=this.__v_isShallow?e:It(e),Kh(e,this._rawValue)&&(this._rawValue=e,this._value=this.__v_isShallow?e:Gh(e),pm(this))}}function s$(t){pm(t)}function nl(t){return kr(t)?t.value:t}const o$={get:(t,e,r)=>nl(Reflect.get(t,e,r)),set:(t,e,r,n)=>{const i=t[e];return kr(i)&&!kr(r)?(i.value=r,!0):Reflect.set(t,e,r,n)}};function Wh(t){return wo(t)?t:new Proxy(t,o$)}class a${constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:r,set:n}=e(()=>Rw(this),()=>pm(this));this._get=r,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function u$(t){return new a$(t)}function c$(t){const e=Be(t)?new Array(t.length):{};for(const r in t)e[r]=TC(t,r);return e}class l${constructor(e,r,n){this._object=e,this._key=r,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}}function TC(t,e,r){const n=t[e];return kr(n)?n:new l$(t,e,r)}class f${constructor(e,r,n,i){this._setter=r,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new jd(e,()=>{this._dirty||(this._dirty=!0,pm(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=n}get value(){const e=It(this);return Rw(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function h$(t,e,r=!1){let n,i;const s=Xe(t);return s?(n=t,i=Kn):(n=t.get,i=t.set),new f$(n,i,s||!i,r)}const bh=[];function AC(t,...e){yc();const r=bh.length?bh[bh.length-1].component:null,n=r&&r.appContext.config.warnHandler,i=d$();if(n)ss(n,r,11,[t+e.join(""),r&&r.proxy,i.map(({vnode:s})=>`at <${OR(r,s.type)}>`).join(` `),i]);else{const s=[`[Vue warn]: ${t}`,...e];i.length&&s.push(` `,...p$(i)),console.warn(...s)}_c()}function d$(){let t=bh[bh.length-1];if(!t)return[];const e=[];for(;t;){const r=e[0];r&&r.vnode===t?r.recurseCount++:e.push({vnode:t,recurseCount:0});const n=t.component&&t.component.parent;t=n&&n.vnode}return e}function p$(t){const e=[];return t.forEach((r,n)=>{e.push(...n===0?[]:[` `],...g$(r))}),e}function g$({vnode:t,recurseCount:e}){const r=e>0?`... (${e} recursive calls)`:"",n=t.component?t.component.parent==null:!1,i=` at <${OR(t.component,t.type,n)}`,s=">"+r;return t.props?[i,...m$(t.props),s]:[i+s]}function m$(t){const e=[],r=Object.keys(t);return r.slice(0,3).forEach(n=>{e.push(...kC(n,t[n]))}),r.length>3&&e.push(" ..."),e}function kC(t,e,r){return ur(e)?(e=JSON.stringify(e),r?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?r?e:[`${t}=${e}`]:kr(e)?(e=kC(t,It(e.value),!0),r?e:[`${t}=Ref<`,e,">"]):Xe(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=It(e),r?e:[`${t}=`,e])}function ss(t,e,r,n){let i;try{i=n?t(...n):t()}catch(s){bc(s,e,r)}return i}function Gn(t,e,r,n){if(Xe(t)){const s=ss(t,e,r,n);return s&&am(s)&&s.catch(o=>{bc(o,e,r)}),s}const i=[];for(let s=0;s>>1;Xh(ri[n])co&&ri.splice(e,1)}function RC(t,e,r,n){Be(t)?r.push(...t):(!e||!e.includes(t,t.allowRecurse?n+1:n))&&r.push(t),CC()}function b$(t){RC(t,ah,wh,jc)}function Dw(t){RC(t,ia,Eh,Vc)}function Pw(t,e=null){if(wh.length){for(Nb=e,ah=[...new Set(wh)],wh.length=0,jc=0;jcXh(r)-Xh(n)),Vc=0;Vct.id==null?1/0:t.id;function NC(t){Rb=!1,Yg=!0,Pw(t),ri.sort((r,n)=>Xh(r)-Xh(n));const e=Kn;try{for(co=0;cozc.emit(i,...s)),Kp=[]):typeof window!="undefined"&&window.HTMLElement&&!(!((n=(r=window.navigator)===null||r===void 0?void 0:r.userAgent)===null||n===void 0)&&n.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{OC(s,e)}),setTimeout(()=>{zc||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Kp=[])},3e3)):Kp=[]}function w$(t,e,...r){}const Lw={MODE:2};function E$(t){wt(Lw,t)}function NI(t,e){const r=e&&e.type.compatConfig;return r&&t in r?r[t]:Lw[t]}function Yt(t,e,r=!1){if(!r&&e&&e.type.__isBuiltIn)return!1;const n=NI("MODE",e)||2,i=NI(t,e);return(Xe(n)?n(e&&e.type):n)===2?i!==!1:i===!0||i==="suppress-warning"}function Qr(t,e,...r){if(!Yt(t,e))throw new Error(`${t} compat has been disabled.`)}function ko(t,e,...r){return Yt(t,e)}function gm(t,e,...r){return Yt(t,e)}const Ob=new WeakMap;function Bw(t){let e=Ob.get(t);return e||Ob.set(t,e=Object.create(null)),e}function $w(t,e,r){if(Be(e))e.forEach(n=>$w(t,n,r));else{e.startsWith("hook:")?Qr("INSTANCE_EVENT_HOOKS",t,e):Qr("INSTANCE_EVENT_EMITTER",t);const n=Bw(t);(n[e]||(n[e]=[])).push(r)}return t.proxy}function x$(t,e,r){const n=(...i)=>{Fw(t,e,n),r.call(t.proxy,...i)};return n.fn=r,$w(t,e,n),t.proxy}function Fw(t,e,r){Qr("INSTANCE_EVENT_EMITTER",t);const n=t.proxy;if(!e)return Ob.set(t,Object.create(null)),n;if(Be(e))return e.forEach(o=>Fw(t,o,r)),n;const i=Bw(t),s=i[e];return s?r?(i[e]=s.filter(o=>!(o===r||o.fn===r)),n):(i[e]=void 0,n):n}function S$(t,e,r){const n=Bw(t)[e];return n&&Gn(n.map(i=>i.bind(t.proxy)),t,6,r),t.proxy}const mm="onModelCompat:";function I$(t){const{type:e,shapeFlag:r,props:n,dynamicProps:i}=t,s=e;if(r&6&&n&&"modelValue"in n){if(!Yt("COMPONENT_V_MODEL",{type:e}))return;const o=s.model||{};DC(o,s.mixins);const{prop:a="value",event:u="input"}=o;a!=="modelValue"&&(n[a]=n.modelValue,delete n.modelValue),i&&(i[i.indexOf("modelValue")]=a),n[mm+u]=n["onUpdate:modelValue"],delete n["onUpdate:modelValue"]}}function DC(t,e){e&&e.forEach(r=>{r.model&&wt(t,r.model),r.mixins&&DC(t,r.mixins)})}function T$(t,e,r){if(!Yt("COMPONENT_V_MODEL",t))return;const n=t.vnode.props,i=n&&n[mm+e];i&&ss(i,t,6,r)}function A$(t,e,...r){const n=t.vnode.props||Gt;let i=r;const s=e.startsWith("update:"),o=s&&e.slice(7);if(o&&o in n){const l=`${o==="modelValue"?"model":o}Modifiers`,{number:h,trim:d}=n[l]||Gt;d?i=r.map(_=>_.trim()):h&&(i=r.map(Ao))}let a,u=n[a=tl(e)]||n[a=tl(Xn(e))];!u&&s&&(u=n[a=tl(oi(e))]),u&&Gn(u,t,6,i);const c=n[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,Gn(c,t,6,i)}return T$(t,e,i),S$(t,e,i)}function PC(t,e,r=!1){const n=e.emitsCache,i=n.get(t);if(i!==void 0)return i;const s=t.emits;let o={},a=!1;if(!Xe(t)){const u=c=>{const l=PC(c,e,!0);l&&(a=!0,wt(o,l))};!r&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}return!s&&!a?(n.set(t,null),null):(Be(s)?s.forEach(u=>o[u]=null):wt(o,s),n.set(t,o),o)}function Uw(t,e){return!t||!qo(e)?!1:e.startsWith(mm)?!0:(e=e.slice(2).replace(/Once$/,""),Rt(t,e[0].toLowerCase()+e.slice(1))||Rt(t,oi(e))||Rt(t,e))}let Zr=null,il=null;function Yh(t){const e=Zr;return Zr=t,il=t&&t.type.__scopeId||null,il||(il=t&&t.type._scopeId||null),e}function LC(t){il=t}function BC(){il=null}const k$=t=>Jh;function Jh(t,e=Zr,r){if(!e||t._n)return t;const n=(...i)=>{n._d&&$b(-1);const s=Yh(e),o=t(...i);return Yh(s),n._d&&$b(1),o};return n._n=!0,n._c=!0,n._d=!0,r&&(n._ns=!0),n}function Eg(t){const{type:e,vnode:r,proxy:n,withProxy:i,props:s,propsOptions:[o],slots:a,attrs:u,emit:c,render:l,renderCache:h,data:d,setupState:_,ctx:T,inheritAttrs:D}=t;let N,O;const L=Yh(t);try{if(r.shapeFlag&4){const q=i||n;N=ti(l.call(q,q,h,s,_,d,T)),O=u}else{const q=e;N=ti(q.length>1?q(s,{attrs:u,slots:a,emit:c}):q(s,null)),O=e.props?u:C$(u)}}catch(q){Ih.length=0,bc(q,t,1),N=Xt(Sn)}let J=N;if(O&&D!==!1){const q=Object.keys(O),{shapeFlag:z}=J;q.length&&z&7&&(o&&q.some(_w)&&(O=R$(O,o)),J=Mo(J,O))}if(Yt("INSTANCE_ATTRS_CLASS_STYLE",t)&&r.shapeFlag&4&&J.shapeFlag&7){const{class:q,style:z}=r.props||{};(q||z)&&(J=Mo(J,{class:q,style:z}))}return r.dirs&&(J.dirs=J.dirs?J.dirs.concat(r.dirs):r.dirs),r.transition&&(J.transition=r.transition),N=J,Yh(L),N}function M$(t){let e;for(let r=0;r{let e;for(const r in t)(r==="class"||r==="style"||qo(r))&&((e||(e={}))[r]=t[r]);return e},R$=(t,e)=>{const r={};for(const n in t)(!_w(n)||!(n.slice(9)in e))&&(r[n]=t[n]);return r};function N$(t,e,r){const{props:n,children:i,component:s}=t,{props:o,children:a,patchFlag:u}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(r&&u>=0){if(u&1024)return!0;if(u&16)return n?OI(n,o,c):!!o;if(u&8){const l=e.dynamicProps;for(let h=0;ht.__isSuspense,D$={name:"Suspense",__isSuspense:!0,process(t,e,r,n,i,s,o,a,u,c){t==null?L$(e,r,n,i,s,o,a,u,c):B$(t,e,r,n,i,o,a,u,c)},hydrate:$$,create:jw,normalize:F$},P$=D$;function Qh(t,e){const r=t.props&&t.props[e];Xe(r)&&r()}function L$(t,e,r,n,i,s,o,a,u){const{p:c,o:{createElement:l}}=u,h=l("div"),d=t.suspense=jw(t,i,n,e,h,r,s,o,a,u);c(null,d.pendingBranch=t.ssContent,h,null,n,d,s,o),d.deps>0?(Qh(t,"onPending"),Qh(t,"onFallback"),c(null,t.ssFallback,e,r,n,null,s,o),sl(d,t.ssFallback)):d.resolve()}function B$(t,e,r,n,i,s,o,a,{p:u,um:c,o:{createElement:l}}){const h=e.suspense=t.suspense;h.vnode=e,e.el=t.el;const d=e.ssContent,_=e.ssFallback,{activeBranch:T,pendingBranch:D,isInFallback:N,isHydrating:O}=h;if(D)h.pendingBranch=d,ks(d,D)?(u(D,d,h.hiddenContainer,null,i,h,s,o,a),h.deps<=0?h.resolve():N&&(u(T,_,r,n,i,null,s,o,a),sl(h,_))):(h.pendingId++,O?(h.isHydrating=!1,h.activeBranch=D):c(D,i,h),h.deps=0,h.effects.length=0,h.hiddenContainer=l("div"),N?(u(null,d,h.hiddenContainer,null,i,h,s,o,a),h.deps<=0?h.resolve():(u(T,_,r,n,i,null,s,o,a),sl(h,_))):T&&ks(d,T)?(u(T,d,r,n,i,h,s,o,a),h.resolve(!0)):(u(null,d,h.hiddenContainer,null,i,h,s,o,a),h.deps<=0&&h.resolve()));else if(T&&ks(d,T))u(T,d,r,n,i,h,s,o,a),sl(h,d);else if(Qh(e,"onPending"),h.pendingBranch=d,h.pendingId++,u(null,d,h.hiddenContainer,null,i,h,s,o,a),h.deps<=0)h.resolve();else{const{timeout:L,pendingId:J}=h;L>0?setTimeout(()=>{h.pendingId===J&&h.fallback(_)},L):L===0&&h.fallback(_)}}function jw(t,e,r,n,i,s,o,a,u,c,l=!1){const{p:h,m:d,um:_,n:T,o:{parentNode:D,remove:N}}=c,O=Ao(t.props&&t.props.timeout),L={vnode:t,parent:e,parentComponent:r,isSVG:o,container:n,hiddenContainer:i,anchor:s,deps:0,pendingId:0,timeout:typeof O=="number"?O:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:l,isUnmounted:!1,effects:[],resolve(J=!1){const{vnode:q,activeBranch:z,pendingBranch:ee,pendingId:G,effects:ne,parentComponent:ue,container:_e}=L;if(L.isHydrating)L.isHydrating=!1;else if(!J){const g=z&&ee.transition&&ee.transition.mode==="out-in";g&&(z.transition.afterLeave=()=>{G===L.pendingId&&d(ee,_e,f,0)});let{anchor:f}=L;z&&(f=T(z),_(z,ue,L,!0)),g||d(ee,_e,f,0)}sl(L,ee),L.pendingBranch=null,L.isInFallback=!1;let F=L.parent,m=!1;for(;F;){if(F.pendingBranch){F.effects.push(...ne),m=!0;break}F=F.parent}m||Dw(ne),L.effects=[],Qh(q,"onResolve")},fallback(J){if(!L.pendingBranch)return;const{vnode:q,activeBranch:z,parentComponent:ee,container:G,isSVG:ne}=L;Qh(q,"onFallback");const ue=T(z),_e=()=>{!L.isInFallback||(h(null,J,G,ue,ee,null,ne,a,u),sl(L,J))},F=J.transition&&J.transition.mode==="out-in";F&&(z.transition.afterLeave=_e),L.isInFallback=!0,_(z,ee,null,!0),F||_e()},move(J,q,z){L.activeBranch&&d(L.activeBranch,J,q,z),L.container=J},next(){return L.activeBranch&&T(L.activeBranch)},registerDep(J,q){const z=!!L.pendingBranch;z&&L.deps++;const ee=J.vnode.el;J.asyncDep.catch(G=>{bc(G,J,0)}).then(G=>{if(J.isUnmounted||L.isUnmounted||L.pendingId!==J.suspenseId)return;J.asyncResolved=!0;const{vnode:ne}=J;qb(J,G,!1),ee&&(ne.el=ee);const ue=!ee&&J.subTree.el;q(J,ne,D(ee||J.subTree.el),ee?null:T(J.subTree),L,o,u),ue&&N(ue),qw(J,ne.el),z&&--L.deps===0&&L.resolve()})},unmount(J,q){L.isUnmounted=!0,L.activeBranch&&_(L.activeBranch,r,J,q),L.pendingBranch&&_(L.pendingBranch,r,J,q)}};return L}function $$(t,e,r,n,i,s,o,a,u){const c=e.suspense=jw(e,n,r,t.parentNode,document.createElement("div"),null,i,s,o,a,!0),l=u(t,c.pendingBranch=e.ssContent,r,c,s,o);return c.deps===0&&c.resolve(),l}function F$(t){const{shapeFlag:e,children:r}=t,n=e&32;t.ssContent=DI(n?r.default:r),t.ssFallback=n?DI(r.fallback):Xt(Sn)}function DI(t){let e;if(Xe(t)){const r=Cl&&t._c;r&&(t._d=!1,Kt()),t=t(),r&&(t._d=!0,e=Ls,wR())}return Be(t)&&(t=M$(t)),t=ti(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(r=>r!==t)),t}function $C(t,e){e&&e.pendingBranch?Be(t)?e.effects.push(...t):e.effects.push(t):Dw(t)}function sl(t,e){t.activeBranch=e;const{vnode:r,parentComponent:n}=t,i=r.el=e.el;n&&n.subTree===r&&(n.vnode.el=i,qw(n,i))}function xh(t,e){if(Dr){let r=Dr.provides;const n=Dr.parent&&Dr.parent.provides;n===r&&(r=Dr.provides=Object.create(n)),r[t]=e}}function Wn(t,e,r=!1){const n=Dr||Zr;if(n){const i=n.parent==null?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides;if(i&&t in i)return i[t];if(arguments.length>1)return r&&Xe(e)?e.call(n.proxy):e}}function U$(t,e){return Vd(t,null,e)}function FC(t,e){return Vd(t,null,{flush:"post"})}function q$(t,e){return Vd(t,null,{flush:"sync"})}const PI={};function ol(t,e,r){return Vd(t,e,r)}function Vd(t,e,{immediate:r,deep:n,flush:i,onTrack:s,onTrigger:o}=Gt){const a=Dr;let u,c=!1,l=!1;if(kr(t)?(u=()=>t.value,c=Aw(t)):wo(t)?(u=()=>t,n=!0):Be(t)?(l=!0,c=t.some(wo),u=()=>t.map(O=>{if(kr(O))return O.value;if(wo(O))return va(O);if(Xe(O))return ss(O,a,2)})):Xe(t)?e?u=()=>ss(t,a,2):u=()=>{if(!(a&&a.isUnmounted))return h&&h(),Gn(t,a,3,[d])}:u=Kn,e&&!n){const O=u;u=()=>{const L=O();return Be(L)&&gm("WATCH_ARRAY",a)&&va(L),L}}if(e&&n){const O=u;u=()=>va(O())}let h,d=O=>{h=N.onStop=()=>{ss(O,a,4)}};if(Rl)return d=Kn,e?r&&Gn(e,a,3,[u(),l?[]:void 0,d]):u(),Kn;let _=l?[]:PI;const T=()=>{if(!!N.active)if(e){const O=N.run();(n||c||(l?O.some((L,J)=>Kh(L,_[J])):Kh(O,_))||Be(O)&&Yt("WATCH_ARRAY",a))&&(h&&h(),Gn(e,a,3,[O,_===PI?void 0:_,d]),_=O)}else N.run()};T.allowRecurse=!!e;let D;i==="sync"?D=T:i==="post"?D=()=>_r(T,a&&a.suspense):D=()=>{!a||a.isMounted?b$(T):T()};const N=new jd(u,D);return e?r?T():_=N.run():i==="post"?_r(N.run.bind(N),a&&a.suspense):N.run(),()=>{N.stop(),a&&a.scope&&bw(a.scope.effects,N)}}function j$(t,e,r){const n=this.proxy,i=ur(t)?t.includes(".")?UC(n,t):()=>n[t]:t.bind(n,n);let s;Xe(e)?s=e:(s=e.handler,r=e);const o=Dr;Oa(this);const a=Vd(i,s.bind(n),r);return o?Oa(o):Sa(),a}function UC(t,e){const r=e.split(".");return()=>{let n=t;for(let i=0;i{va(r,e)});else if(Wg(t))for(const r in t)va(t[r],e);return t}function Vw(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Kd(()=>{t.isMounted=!0}),ed(()=>{t.isUnmounting=!0}),t}const Ei=[Function,Array],qC={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ei,onEnter:Ei,onAfterEnter:Ei,onEnterCancelled:Ei,onBeforeLeave:Ei,onLeave:Ei,onAfterLeave:Ei,onLeaveCancelled:Ei,onBeforeAppear:Ei,onAppear:Ei,onAfterAppear:Ei,onAppearCancelled:Ei},setup(t,{slots:e}){const r=Qs(),n=Vw();let i;return()=>{const s=e.default&&vm(e.default(),!0);if(!s||!s.length)return;const o=It(t),{mode:a}=o,u=s[0];if(n.isLeaving)return Hy(u);const c=LI(u);if(!c)return Hy(u);const l=kl(c,o,n,r);Xu(c,l);const h=r.subTree,d=h&&LI(h);let _=!1;const{getTransitionKey:T}=c.type;if(T){const D=T();i===void 0?i=D:D!==i&&(i=D,_=!0)}if(d&&d.type!==Sn&&(!ks(c,d)||_)){const D=kl(d,o,n,r);if(Xu(d,D),a==="out-in")return n.isLeaving=!0,D.afterLeave=()=>{n.isLeaving=!1,r.update()},Hy(u);a==="in-out"&&c.type!==Sn&&(D.delayLeave=(N,O,L)=>{const J=jC(n,d);J[String(d.key)]=d,N._leaveCb=()=>{O(),N._leaveCb=void 0,delete l.delayedLeave},l.delayedLeave=L})}return u}}};qC.__isBuiltIn=!0;const zw=qC;function jC(t,e){const{leavingVNodes:r}=t;let n=r.get(e.type);return n||(n=Object.create(null),r.set(e.type,n)),n}function kl(t,e,r,n){const{appear:i,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:l,onBeforeLeave:h,onLeave:d,onAfterLeave:_,onLeaveCancelled:T,onBeforeAppear:D,onAppear:N,onAfterAppear:O,onAppearCancelled:L}=e,J=String(t.key),q=jC(r,t),z=(G,ne)=>{G&&Gn(G,n,9,ne)},ee={mode:s,persisted:o,beforeEnter(G){let ne=a;if(!r.isMounted)if(i)ne=D||a;else return;G._leaveCb&&G._leaveCb(!0);const ue=q[J];ue&&ks(t,ue)&&ue.el._leaveCb&&ue.el._leaveCb(),z(ne,[G])},enter(G){let ne=u,ue=c,_e=l;if(!r.isMounted)if(i)ne=N||u,ue=O||c,_e=L||l;else return;let F=!1;const m=G._enterCb=g=>{F||(F=!0,g?z(_e,[G]):z(ue,[G]),ee.delayedLeave&&ee.delayedLeave(),G._enterCb=void 0)};ne?(ne(G,m),ne.length<=1&&m()):m()},leave(G,ne){const ue=String(t.key);if(G._enterCb&&G._enterCb(!0),r.isUnmounting)return ne();z(h,[G]);let _e=!1;const F=G._leaveCb=m=>{_e||(_e=!0,ne(),m?z(T,[G]):z(_,[G]),G._leaveCb=void 0,q[ue]===t&&delete q[ue])};q[ue]=t,d?(d(G,F),d.length<=1&&F()):F()},clone(G){return kl(G,e,r,n)}};return ee}function Hy(t){if(Hd(t))return t=Mo(t),t.children=null,t}function LI(t){return Hd(t)?t.children?t.children[0]:void 0:t}function Xu(t,e){t.shapeFlag&6&&t.component?Xu(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 vm(t,e=!1){let r=[],n=0;for(let i=0;i1)for(let i=0;i!!t.type.__asyncLoader;function xg(t){Xe(t)&&(t={loader:t});const{loader:e,loadingComponent:r,errorComponent:n,delay:i=200,timeout:s,suspensible:o=!0,onError:a}=t;let u=null,c,l=0;const h=()=>(l++,u=null,d()),d=()=>{let _;return u||(_=u=e().catch(T=>{if(T=T instanceof Error?T:new Error(String(T)),a)return new Promise((D,N)=>{a(T,()=>D(h()),()=>N(T),l+1)});throw T}).then(T=>_!==u&&u?u:(T&&(T.__esModule||T[Symbol.toStringTag]==="Module")&&(T=T.default),c=T,T)))};return zd({name:"AsyncComponentWrapper",__asyncLoader:d,get __asyncResolved(){return c},setup(){const _=Dr;if(c)return()=>Ky(c,_);const T=L=>{u=null,bc(L,_,13,!n)};if(o&&_.suspense||Rl)return d().then(L=>()=>Ky(L,_)).catch(L=>(T(L),()=>n?Xt(n,{error:L}):null));const D=rl(!1),N=rl(),O=rl(!!i);return i&&setTimeout(()=>{O.value=!1},i),s!=null&&setTimeout(()=>{if(!D.value&&!N.value){const L=new Error(`Async component timed out after ${s}ms.`);T(L),N.value=L}},s),d().then(()=>{D.value=!0,_.parent&&Hd(_.parent.vnode)&&Ow(_.parent.update)}).catch(L=>{T(L),N.value=L}),()=>{if(D.value&&c)return Ky(c,_);if(N.value&&n)return Xt(n,{error:N.value});if(r&&!O.value)return Xt(r)}}})}function Ky(t,{vnode:{ref:e,props:r,children:n}}){const i=Xt(t,r,n);return i.ref=e,i}const Hd=t=>t.type.__isKeepAlive,VC={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const r=Qs(),n=r.ctx;if(!n.renderer)return e.default;const i=new Map,s=new Set;let o=null;const a=r.suspense,{renderer:{p:u,m:c,um:l,o:{createElement:h}}}=n,d=h("div");n.activate=(L,J,q,z,ee)=>{const G=L.component;c(L,J,q,0,a),u(G.vnode,L,J,q,G,a,z,L.slotScopeIds,ee),_r(()=>{G.isDeactivated=!1,G.a&&Ea(G.a);const ne=L.props&&L.props.onVnodeMounted;ne&&qn(ne,G.parent,L)},a)},n.deactivate=L=>{const J=L.component;c(L,d,null,1,a),_r(()=>{J.da&&Ea(J.da);const q=L.props&&L.props.onVnodeUnmounted;q&&qn(q,J.parent,L),J.isDeactivated=!0},a)};function _(L){Gy(L),l(L,r,a,!0)}function T(L){i.forEach((J,q)=>{const z=n0(J.type);z&&(!L||!L(z))&&D(q)})}function D(L){const J=i.get(L);!o||J.type!==o.type?_(J):o&&Gy(o),i.delete(L),s.delete(L)}ol(()=>[t.include,t.exclude],([L,J])=>{L&&T(q=>uh(L,q)),J&&T(q=>!uh(J,q))},{flush:"post",deep:!0});let N=null;const O=()=>{N!=null&&i.set(N,Wy(r.subTree))};return Kd(O),_m(O),ed(()=>{i.forEach(L=>{const{subTree:J,suspense:q}=r,z=Wy(J);if(L.type===z.type){Gy(z);const ee=z.component.da;ee&&_r(ee,q);return}_(L)})}),()=>{if(N=null,!e.default)return null;const L=e.default(),J=L[0];if(L.length>1)return o=null,L;if(!hi(J)||!(J.shapeFlag&4)&&!(J.shapeFlag&128))return o=null,J;let q=Wy(J);const z=q.type,ee=n0(Zh(q)?q.type.__asyncResolved||{}:z),{include:G,exclude:ne,max:ue}=t;if(G&&(!ee||!uh(G,ee))||ne&&ee&&uh(ne,ee))return o=q,J;const _e=q.key==null?z:q.key,F=i.get(_e);return q.el&&(q=Mo(q),J.shapeFlag&128&&(J.ssContent=q)),N=_e,F?(q.el=F.el,q.component=F.component,q.transition&&Xu(q,q.transition),q.shapeFlag|=512,s.delete(_e),s.add(_e)):(s.add(_e),ue&&s.size>parseInt(ue,10)&&D(s.values().next().value)),q.shapeFlag|=256,o=q,J}}};VC.__isBuildIn=!0;const zC=VC;function uh(t,e){return Be(t)?t.some(r=>uh(r,e)):ur(t)?t.split(",").includes(e):t.test?t.test(e):!1}function HC(t,e){GC(t,"a",e)}function KC(t,e){GC(t,"da",e)}function GC(t,e,r=Dr){const n=t.__wdc||(t.__wdc=()=>{let i=r;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(ym(e,n,r),r){let i=r.parent;for(;i&&i.parent;)Hd(i.parent.vnode)&&V$(n,e,r,i),i=i.parent}}function V$(t,e,r,n){const i=ym(e,t,n,!0);td(()=>{bw(n[e],i)},r)}function Gy(t){let e=t.shapeFlag;e&256&&(e-=256),e&512&&(e-=512),t.shapeFlag=e}function Wy(t){return t.shapeFlag&128?t.ssContent:t}function ym(t,e,r=Dr,n=!1){if(r){const i=r[t]||(r[t]=[]),s=e.__weh||(e.__weh=(...o)=>{if(r.isUnmounted)return;yc(),Oa(r);const a=Gn(e,r,t,o);return Sa(),_c(),a});return n?i.unshift(s):i.push(s),s}}const jo=t=>(e,r=Dr)=>(!Rl||t==="sp")&&ym(t,e,r),WC=jo("bm"),Kd=jo("m"),XC=jo("bu"),_m=jo("u"),ed=jo("bum"),td=jo("um"),YC=jo("sp"),JC=jo("rtg"),QC=jo("rtc");function ZC(t,e=Dr){ym("ec",t,e)}function eR(t,e){for(const r in e){const n=t[r],i=e[r];r in t&&Wg(n)&&Wg(i)?eR(n,i):t[r]=i}return t}let Db=!0;function z$(t){const e=bm(t),r=t.proxy,n=t.ctx;Db=!1,e.beforeCreate&&BI(e.beforeCreate,t,"bc");const{data:i,computed:s,methods:o,watch:a,provide:u,inject:c,created:l,beforeMount:h,mounted:d,beforeUpdate:_,updated:T,activated:D,deactivated:N,beforeDestroy:O,beforeUnmount:L,destroyed:J,unmounted:q,render:z,renderTracked:ee,renderTriggered:G,errorCaptured:ne,serverPrefetch:ue,expose:_e,inheritAttrs:F,components:m,directives:g,filters:f}=e;if(c&&tR(c,n,null,t.appContext.config.unwrapInjectedRef),o)for(const I in o){const M=o[I];Xe(M)&&(n[I]=M.bind(r))}if(i){const I=i.call(r,r);zt(I)&&(t.data=js(I))}if(Db=!0,s)for(const I in s){const M=s[I],A=Xe(M)?M.bind(r,r):Xe(M.get)?M.get.bind(r,r):Kn,v=!Xe(M)&&Xe(M.set)?M.set.bind(r):Kn,S=Mi({get:A,set:v});Object.defineProperty(n,I,{enumerable:!0,configurable:!0,get:()=>S.value,set:w=>S.value=w})}if(a)for(const I in a)rR(a[I],n,r,I);if(u){const I=Xe(u)?u.call(r):u;Reflect.ownKeys(I).forEach(M=>{xh(M,I[M])})}l&&BI(l,t,"c");function y(I,M){Be(M)?M.forEach(A=>I(A.bind(r))):M&&I(M.bind(r))}if(y(WC,h),y(Kd,d),y(XC,_),y(_m,T),y(HC,D),y(KC,N),y(ZC,ne),y(QC,ee),y(JC,G),y(ed,L),y(td,q),y(YC,ue),O&&ko("OPTIONS_BEFORE_DESTROY",t)&&y(ed,O),J&&ko("OPTIONS_DESTROYED",t)&&y(td,J),Be(_e))if(_e.length){const I=t.exposed||(t.exposed={});_e.forEach(M=>{Object.defineProperty(I,M,{get:()=>r[M],set:A=>r[M]=A})})}else t.exposed||(t.exposed={});z&&t.render===Kn&&(t.render=z),F!=null&&(t.inheritAttrs=F),m&&(t.components=m),g&&(t.directives=g),f&&Yt("FILTERS",t)&&(t.filters=f)}function tR(t,e,r=Kn,n=!1){Be(t)&&(t=Pb(t));for(const i in t){const s=t[i];let o;zt(s)?"default"in s?o=Wn(s.from||i,s.default,!0):o=Wn(s.from||i):o=Wn(s),kr(o)&&n?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):e[i]=o}}function BI(t,e,r){Gn(Be(t)?t.map(n=>n.bind(e.proxy)):t.bind(e.proxy),e,r)}function rR(t,e,r,n){const i=n.includes(".")?UC(r,n):()=>r[n];if(ur(t)){const s=e[t];Xe(s)&&ol(i,s)}else if(Xe(t))ol(i,t.bind(r));else if(zt(t))if(Be(t))t.forEach(s=>rR(s,e,r,n));else{const s=Xe(t.handler)?t.handler.bind(r):e[t.handler];Xe(s)&&ol(i,s,t)}}function bm(t){const e=t.type,{mixins:r,extends:n}=e,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let u;return a?u=a:!i.length&&!r&&!n?Yt("PRIVATE_APIS",t)?(u=wt({},e),u.parent=t.parent&&t.parent.proxy,u.propsData=t.vnode.props):u=e:(u={},i.length&&i.forEach(c=>$u(u,c,o,!0)),$u(u,e,o)),s.set(e,u),u}function $u(t,e,r,n=!1){Xe(e)&&(e=e.options);const{mixins:i,extends:s}=e;s&&$u(t,s,r,!0),i&&i.forEach(o=>$u(t,o,r,!0));for(const o in e)if(!(n&&o==="expose")){const a=Fu[o]||r&&r[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const Fu={data:$I,props:oa,emits:oa,methods:oa,computed:oa,beforeCreate:An,created:An,beforeMount:An,mounted:An,beforeUpdate:An,updated:An,beforeDestroy:An,beforeUnmount:An,destroyed:An,unmounted:An,activated:An,deactivated:An,errorCaptured:An,serverPrefetch:An,components:oa,directives:oa,watch:K$,provide:$I,inject:H$};Fu.filters=oa;function $I(t,e){return e?t?function(){return(Yt("OPTIONS_DATA_MERGE",null)?eR:wt)(Xe(t)?t.call(this,this):t,Xe(e)?e.call(this,this):e)}:e:t}function H$(t,e){return oa(Pb(t),Pb(e))}function Pb(t){if(Be(t)){const e={};for(let r=0;r0)&&!(o&16)){if(o&8){const l=t.vnode.dynamicProps;for(let h=0;h{Xe(h)&&(h=h.options),u=!0;const[d,_]=sR(h,e,!0);wt(o,d),_&&a.push(..._)};!r&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}if(!s&&!u)return n.set(t,Qc),Qc;if(Be(s))for(let l=0;l-1,_[1]=D<0||T-1||Rt(_,"default"))&&a.push(h)}}}const c=[o,a];return n.set(t,c),c}function FI(t){return t[0]!=="$"}function UI(t){const e=t&&t.toString().match(/^\s*function (\w+)/);return e?e[1]:t===null?"null":""}function qI(t,e){return UI(t)===UI(e)}function jI(t,e){return Be(e)?e.findIndex(r=>qI(r,t)):Xe(e)&&qI(e,t)?0:-1}const oR=t=>t[0]==="_"||t==="$stable",Hw=t=>Be(t)?t.map(ti):[ti(t)],Y$=(t,e,r)=>{const n=Jh((...i)=>Hw(e(...i)),r);return n._c=!1,n},aR=(t,e,r)=>{const n=t._ctx;for(const i in t){if(oR(i))continue;const s=t[i];if(Xe(s))e[i]=Y$(i,s,n);else if(s!=null){const o=Hw(s);e[i]=()=>o}}},uR=(t,e)=>{const r=Hw(e);t.slots.default=()=>r},J$=(t,e)=>{if(t.vnode.shapeFlag&32){const r=e._;r?(t.slots=It(e),Xg(e,"_",r)):aR(e,t.slots={})}else t.slots={},e&&uR(t,e);Xg(t.slots,Em,1)},Q$=(t,e,r)=>{const{vnode:n,slots:i}=t;let s=!0,o=Gt;if(n.shapeFlag&32){const a=e._;a?r&&a===1?s=!1:(wt(i,e),!r&&a===1&&delete i._):(s=!e.$stable,aR(e,i)),o=e}else e&&(uR(t,e),o={default:1});if(s)for(const a in i)!oR(a)&&!(a in o)&&delete i[a]},Z$={beforeMount:"bind",mounted:"inserted",updated:["update","componentUpdated"],unmounted:"unbind"};function eF(t,e,r){const n=Z$[t];if(n)if(Be(n)){const i=[];return n.forEach(s=>{const o=e[s];o&&(ko("CUSTOM_DIR",r,s,t),i.push(o))}),i.length?i:void 0}else return e[n]&&ko("CUSTOM_DIR",r,n,t),e[n]}function cR(t,e){const r=Zr;if(r===null)return t;const n=r.proxy,i=t.dirs||(t.dirs=[]);for(let s=0;sl);const h=t(u);c!==r&&lR(h,c);const d=h._createRoot(u);return u.el?d.$mount(u.el):d}r.version="2.6.14-compat:3.2.31",r.config=ei.config,r.use=(u,...c)=>(u&&Xe(u.install)?u.install(r,...c):Xe(u)&&u(r,...c),r),r.mixin=u=>(ei.mixin(u),r),r.component=(u,c)=>c?(ei.component(u,c),r):ei.component(u),r.directive=(u,c)=>c?(ei.directive(u,c),r):ei.directive(u),r.options={_base:r};let i=1;r.cid=i,r.nextTick=nf;const s=new WeakMap;function o(u={}){if(Qr("GLOBAL_EXTEND",null),Xe(u)&&(u=u.options),s.has(u))return s.get(u);const c=this;function l(d){return n(d?$u(wt({},l.options),d,Fu):l.options,l)}l.super=c,l.prototype=Object.create(r.prototype),l.prototype.constructor=l;const h={};for(const d in c.options){const _=c.options[d];h[d]=Be(_)?_.slice():zt(_)?wt(Object.create(null),_):_}return l.options=$u(h,u,Fu),l.options._base=l,l.extend=o.bind(l),l.mixin=c.mixin,l.use=c.use,l.cid=++i,s.set(u,l),l}r.extend=o.bind(r),r.set=(u,c,l)=>{Qr("GLOBAL_SET",null),u[c]=l},r.delete=(u,c)=>{Qr("GLOBAL_DELETE",null),delete u[c]},r.observable=u=>(Qr("GLOBAL_OBSERVABLE",null),js(u)),r.filter=(u,c)=>c?(ei.filter(u,c),r):ei.filter(u);const a={warn:Kn,extend:wt,mergeOptions:(u,c,l)=>$u(u,c,l?void 0:Fu),defineReactive:lF};return Object.defineProperty(r,"util",{get(){return Qr("GLOBAL_PRIVATE_UTIL",null),a}}),r.configureCompat=E$,r}function nF(t,e,r){iF(t,e),tF(t.config),ei&&(aF(t,e,r),sF(t),oF(t))}function iF(t,e){e.filters={},t.filter=(r,n)=>(Qr("FILTERS",null),n?(e.filters[r]=n,t):e.filters[r])}function sF(t){Object.defineProperties(t,{prototype:{get(){return t.config.globalProperties}},nextTick:{value:nf},extend:{value:vu.extend},set:{value:vu.set},delete:{value:vu.delete},observable:{value:vu.observable},util:{get(){return vu.util}}})}function oF(t){["mixins","components","directives","filters","deopt"].forEach(e=>{t._context[e]=ei._context[e]});for(const e in ei.config){if(e==="isNativeTag"||Vb()&&(e==="isCustomElement"||e==="compilerOptions"))continue;const r=ei.config[e];t.config[e]=r,e==="ignoredElements"&&Yt("CONFIG_IGNORED_ELEMENTS",null)&&!Vb()&&Be(r)&&(t.config.compilerOptions.isCustomElement=n=>r.some(i=>ur(i)?i===n:i.test(n)))}lR(t,vu)}function lR(t,e){const r=Yt("GLOBAL_PROTOTYPE",null);r&&(t.config.globalProperties=Object.create(e.prototype));const n=Object.getOwnPropertyDescriptors(e.prototype);for(const i in n)i!=="constructor"&&r&&Object.defineProperty(t.config.globalProperties,i,n[i])}function aF(t,e,r){let n=!1;t._createRoot=i=>{const s=t._component,o=Xt(s,i.propsData||null);o.appContext=e;const a=!Xe(s)&&!s.render&&!s.template,u=()=>{},c=Ww(o,null,null);return a&&(c.render=u),Xw(c),o.component=c,o.isCompatRoot=!0,c.ctx._compat_mount=l=>{if(n)return;let h;if(typeof l=="string"){const _=document.querySelector(l);if(!_)return;h=_}else h=l||document.createElement("div");const d=h instanceof SVGElement;return a&&c.render===u&&(c.render=null,s.template=h.innerHTML,Yw(c,!1,!0)),h.innerHTML="",r(o,h,d),h instanceof Element&&(h.removeAttribute("v-cloak"),h.setAttribute("data-v-app","")),n=!0,t._container=h,h.__vue_app__=t,c.proxy},c.ctx._compat_destroy=()=>{if(n)r(null,t._container),delete t._container.__vue_app__;else{const{bum:l,scope:h,um:d}=c;l&&Ea(l),Yt("INSTANCE_EVENT_HOOKS",c)&&c.emit("hook:beforeDestroy"),h&&h.stop(),d&&Ea(d),Yt("INSTANCE_EVENT_HOOKS",c)&&c.emit("hook:destroyed")}},c.proxy}}const uF=["push","pop","shift","unshift","splice","sort","reverse"],cF=new WeakSet;function lF(t,e,r){if(zt(r)&&!wo(r)&&!cF.has(r)){const i=js(r);Be(r)?uF.forEach(s=>{r[s]=(...o)=>{Array.prototype[s].call(i,...o)}}):Object.keys(r).forEach(s=>{try{Xy(r,s,r[s])}catch{}})}const n=t.$;n&&t===n.proxy?(Xy(n.ctx,e,r),n.accessCache=Object.create(null)):wo(t)?t[e]=r:Xy(t,e,r)}function Xy(t,e,r){r=zt(r)?js(r):r,Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get(){return Yn(t,"get",e),r},set(n){r=zt(n)?js(n):n,qs(t,"set",e,n)}})}function fR(){return{app:null,config:{isNativeTag:_B,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 fF=0;function hF(t,e){return function(n,i=null){i!=null&&!zt(i)&&(i=null);const s=fR(),o=new Set;let a=!1;const u=s.app={_uid:fF++,_component:n,_props:i,_container:null,_context:s,_instance:null,version:BR,get config(){return s.config},set config(c){},use(c,...l){return o.has(c)||(c&&Xe(c.install)?(o.add(c),c.install(u,...l)):Xe(c)&&(o.add(c),c(u,...l))),u},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),u},component(c,l){return l?(s.components[c]=l,u):s.components[c]},directive(c,l){return l?(s.directives[c]=l,u):s.directives[c]},mount(c,l,h){if(!a){const d=Xt(n,i);return d.appContext=s,l&&e?e(d,c):t(d,c,h),a=!0,u._container=c,c.__vue_app__=u,Jw(d.component)||d.component.proxy}},unmount(){a&&(t(null,u._container),delete u._container.__vue_app__)},provide(c,l){return s.provides[c]=l,u}};return nF(u,s,t),u}}function Qg(t,e,r,n,i=!1){if(Be(t)){t.forEach((d,_)=>Qg(d,e&&(Be(e)?e[_]:e),r,n,i));return}if(Zh(n)&&!i)return;const s=n.shapeFlag&4?Jw(n.component)||n.component.proxy:n.el,o=i?null:s,{i:a,r:u}=t,c=e&&e.r,l=a.refs===Gt?a.refs={}:a.refs,h=a.setupState;if(c!=null&&c!==u&&(ur(c)?(l[c]=null,Rt(h,c)&&(h[c]=null)):kr(c)&&(c.value=null)),Xe(u))ss(u,a,12,[o,l]);else{const d=ur(u),_=kr(u);if(d||_){const T=()=>{if(t.f){const D=d?l[u]:u.value;i?Be(D)&&bw(D,s):Be(D)?D.includes(s)||D.push(s):d?l[u]=[s]:(u.value=[s],t.k&&(l[t.k]=u.value))}else d?(l[u]=o,Rt(h,u)&&(h[u]=o)):kr(u)&&(u.value=o,t.k&&(l[t.k]=o))};o?(T.id=-1,_r(T,r)):T()}}}let Yo=!1;const Gp=t=>/svg/.test(t.namespaceURI)&&t.tagName!=="foreignObject",Yy=t=>t.nodeType===8;function dF(t){const{mt:e,p:r,o:{patchProp:n,nextSibling:i,parentNode:s,remove:o,insert:a,createComment:u}}=t,c=(N,O)=>{if(!O.hasChildNodes()){r(null,N,O),Jg();return}Yo=!1,l(O.firstChild,N,null,null,null),Jg(),Yo&&console.error("Hydration completed but contains mismatches.")},l=(N,O,L,J,q,z=!1)=>{const ee=Yy(N)&&N.data==="[",G=()=>T(N,O,L,J,q,ee),{type:ne,ref:ue,shapeFlag:_e}=O,F=N.nodeType;O.el=N;let m=null;switch(ne){case Ml:F!==3?m=G():(N.data!==O.children&&(Yo=!0,N.data=O.children),m=i(N));break;case Sn:F!==8||ee?m=G():m=i(N);break;case Uu:if(F!==1)m=G();else{m=N;const g=!O.children.length;for(let f=0;f{z=z||!!O.dynamicChildren;const{type:ee,props:G,patchFlag:ne,shapeFlag:ue,dirs:_e}=O,F=ee==="input"&&_e||ee==="option";if(F||ne!==-1){if(_e&&As(O,null,L,"created"),G)if(F||!z||ne&48)for(const g in G)(F&&g.endsWith("value")||qo(g)&&!el(g))&&n(N,g,null,G[g],!1,void 0,L);else G.onClick&&n(N,"onClick",null,G.onClick,!1,void 0,L);let m;if((m=G&&G.onVnodeBeforeMount)&&qn(m,L,O),_e&&As(O,null,L,"beforeMount"),((m=G&&G.onVnodeMounted)||_e)&&$C(()=>{m&&qn(m,L,O),_e&&As(O,null,L,"mounted")},J),ue&16&&!(G&&(G.innerHTML||G.textContent))){let g=d(N.firstChild,O,N,L,J,q,z);for(;g;){Yo=!0;const f=g;g=g.nextSibling,o(f)}}else ue&8&&N.textContent!==O.children&&(Yo=!0,N.textContent=O.children)}return N.nextSibling},d=(N,O,L,J,q,z,ee)=>{ee=ee||!!O.dynamicChildren;const G=O.children,ne=G.length;for(let ue=0;ue{const{slotScopeIds:ee}=O;ee&&(q=q?q.concat(ee):ee);const G=s(N),ne=d(i(N),O,G,L,J,q,z);return ne&&Yy(ne)&&ne.data==="]"?i(O.anchor=ne):(Yo=!0,a(O.anchor=u("]"),G,ne),ne)},T=(N,O,L,J,q,z)=>{if(Yo=!0,O.el=null,z){const ne=D(N);for(;;){const ue=i(N);if(ue&&ue!==ne)o(ue);else break}}const ee=i(N),G=s(N);return o(N),r(null,O,G,ee,L,J,Gp(G),q),ee},D=N=>{let O=0;for(;N;)if(N=i(N),N&&Yy(N)&&(N.data==="["&&O++,N.data==="]")){if(O===0)return i(N);O--}return N};return[c,l]}const _r=$C;function hR(t){return pR(t)}function dR(t){return pR(t,dF)}function pR(t,e){const r=IB();r.__VUE__=!0;const{insert:n,remove:i,patchProp:s,createElement:o,createText:a,createComment:u,setText:c,setElementText:l,parentNode:h,nextSibling:d,setScopeId:_=Kn,cloneNode:T,insertStaticContent:D}=t,N=($,V,Y,ce=null,ae=null,le=null,ve=!1,Ee=null,pe=!!V.dynamicChildren)=>{if($===V)return;$&&!ks($,V)&&(ce=j($),U($,ae,le,!0),$=null),V.patchFlag===-2&&(pe=!1,V.dynamicChildren=null);const{type:ge,ref:Oe,shapeFlag:Te}=V;switch(ge){case Ml:O($,V,Y,ce);break;case Sn:L($,V,Y,ce);break;case Uu:$==null&&J(V,Y,ce,ve);break;case Jt:g($,V,Y,ce,ae,le,ve,Ee,pe);break;default:Te&1?ee($,V,Y,ce,ae,le,ve,Ee,pe):Te&6?f($,V,Y,ce,ae,le,ve,Ee,pe):(Te&64||Te&128)&&ge.process($,V,Y,ce,ae,le,ve,Ee,pe,oe)}Oe!=null&&ae&&Qg(Oe,$&&$.ref,le,V||$,!V)},O=($,V,Y,ce)=>{if($==null)n(V.el=a(V.children),Y,ce);else{const ae=V.el=$.el;V.children!==$.children&&c(ae,V.children)}},L=($,V,Y,ce)=>{$==null?n(V.el=u(V.children||""),Y,ce):V.el=$.el},J=($,V,Y,ce)=>{[$.el,$.anchor]=D($.children,V,Y,ce,$.el,$.anchor)},q=({el:$,anchor:V},Y,ce)=>{let ae;for(;$&&$!==V;)ae=d($),n($,Y,ce),$=ae;n(V,Y,ce)},z=({el:$,anchor:V})=>{let Y;for(;$&&$!==V;)Y=d($),i($),$=Y;i(V)},ee=($,V,Y,ce,ae,le,ve,Ee,pe)=>{ve=ve||V.type==="svg",$==null?G(V,Y,ce,ae,le,ve,Ee,pe):_e($,V,ae,le,ve,Ee,pe)},G=($,V,Y,ce,ae,le,ve,Ee)=>{let pe,ge;const{type:Oe,props:Te,shapeFlag:Ce,transition:De,patchFlag:C,dirs:b}=$;if($.el&&T!==void 0&&C===-1)pe=$.el=T($.el);else{if(pe=$.el=o($.type,le,Te&&Te.is,Te),Ce&8?l(pe,$.children):Ce&16&&ue($.children,pe,null,ce,ae,le&&Oe!=="foreignObject",ve,Ee),b&&As($,null,ce,"created"),Te){for(const P in Te)P!=="value"&&!el(P)&&s(pe,P,null,Te[P],le,$.children,ce,ae,R);"value"in Te&&s(pe,"value",null,Te.value),(ge=Te.onVnodeBeforeMount)&&qn(ge,ce,$)}ne(pe,$,$.scopeId,ve,ce)}b&&As($,null,ce,"beforeMount");const E=(!ae||ae&&!ae.pendingBranch)&&De&&!De.persisted;E&&De.beforeEnter(pe),n(pe,V,Y),((ge=Te&&Te.onVnodeMounted)||E||b)&&_r(()=>{ge&&qn(ge,ce,$),E&&De.enter(pe),b&&As($,null,ce,"mounted")},ae)},ne=($,V,Y,ce,ae)=>{if(Y&&_($,Y),ce)for(let le=0;le{for(let ge=pe;ge<$.length;ge++){const Oe=$[ge]=Ee?aa($[ge]):ti($[ge]);N(null,Oe,V,Y,ce,ae,le,ve,Ee)}},_e=($,V,Y,ce,ae,le,ve)=>{const Ee=V.el=$.el;let{patchFlag:pe,dynamicChildren:ge,dirs:Oe}=V;pe|=$.patchFlag&16;const Te=$.props||Gt,Ce=V.props||Gt;let De;Y&&ou(Y,!1),(De=Ce.onVnodeBeforeUpdate)&&qn(De,Y,V,$),Oe&&As(V,$,Y,"beforeUpdate"),Y&&ou(Y,!0);const C=ae&&V.type!=="foreignObject";if(ge?F($.dynamicChildren,ge,Ee,Y,ce,C,le):ve||A($,V,Ee,null,Y,ce,C,le,!1),pe>0){if(pe&16)m(Ee,V,Te,Ce,Y,ce,ae);else if(pe&2&&Te.class!==Ce.class&&s(Ee,"class",null,Ce.class,ae),pe&4&&s(Ee,"style",Te.style,Ce.style,ae),pe&8){const b=V.dynamicProps;for(let E=0;E{De&&qn(De,Y,V,$),Oe&&As(V,$,Y,"updated")},ce)},F=($,V,Y,ce,ae,le,ve)=>{for(let Ee=0;Ee{if(Y!==ce){for(const Ee in ce){if(el(Ee))continue;const pe=ce[Ee],ge=Y[Ee];pe!==ge&&Ee!=="value"&&s($,Ee,ge,pe,ve,V.children,ae,le,R)}if(Y!==Gt)for(const Ee in Y)!el(Ee)&&!(Ee in ce)&&s($,Ee,Y[Ee],null,ve,V.children,ae,le,R);"value"in ce&&s($,"value",Y.value,ce.value)}},g=($,V,Y,ce,ae,le,ve,Ee,pe)=>{const ge=V.el=$?$.el:a(""),Oe=V.anchor=$?$.anchor:a("");let{patchFlag:Te,dynamicChildren:Ce,slotScopeIds:De}=V;De&&(Ee=Ee?Ee.concat(De):De),$==null?(n(ge,Y,ce),n(Oe,Y,ce),ue(V.children,Y,Oe,ae,le,ve,Ee,pe)):Te>0&&Te&64&&Ce&&$.dynamicChildren?(F($.dynamicChildren,Ce,Y,ae,le,ve,Ee),(V.key!=null||ae&&V===ae.subTree)&&Kw($,V,!0)):A($,V,Y,Oe,ae,le,ve,Ee,pe)},f=($,V,Y,ce,ae,le,ve,Ee,pe)=>{V.slotScopeIds=Ee,$==null?V.shapeFlag&512?ae.ctx.activate(V,Y,ce,ve,pe):p(V,Y,ce,ae,le,ve,pe):y($,V,pe)},p=($,V,Y,ce,ae,le,ve)=>{const Ee=$.isCompatRoot&&$.component,pe=Ee||($.component=Ww($,ce,ae));if(Hd($)&&(pe.ctx.renderer=oe),Ee||Xw(pe),pe.asyncDep){if(ae&&ae.registerDep(pe,I),!$.el){const ge=pe.subTree=Xt(Sn);L(null,ge,V,Y)}return}I(pe,$,V,Y,ae,le,ve)},y=($,V,Y)=>{const ce=V.component=$.component;if(N$($,V,Y))if(ce.asyncDep&&!ce.asyncResolved){M(ce,V,Y);return}else ce.next=V,_$(ce.update),ce.update();else V.component=$.component,V.el=$.el,ce.vnode=V},I=($,V,Y,ce,ae,le,ve)=>{const Ee=()=>{if($.isMounted){let{next:Oe,bu:Te,u:Ce,parent:De,vnode:C}=$,b=Oe,E;ou($,!1),Oe?(Oe.el=C.el,M($,Oe,ve)):Oe=C,Te&&Ea(Te),(E=Oe.props&&Oe.props.onVnodeBeforeUpdate)&&qn(E,De,Oe,C),Yt("INSTANCE_EVENT_HOOKS",$)&&$.emit("hook:beforeUpdate"),ou($,!0);const P=Eg($),W=$.subTree;$.subTree=P,N(W,P,h(W.el),j(W),$,ae,le),Oe.el=P.el,b===null&&qw($,P.el),Ce&&_r(Ce,ae),(E=Oe.props&&Oe.props.onVnodeUpdated)&&_r(()=>qn(E,De,Oe,C),ae),Yt("INSTANCE_EVENT_HOOKS",$)&&_r(()=>$.emit("hook:updated"),ae)}else{let Oe;const{el:Te,props:Ce}=V,{bm:De,m:C,parent:b}=$,E=Zh(V);if(ou($,!1),De&&Ea(De),!E&&(Oe=Ce&&Ce.onVnodeBeforeMount)&&qn(Oe,b,V),Yt("INSTANCE_EVENT_HOOKS",$)&&$.emit("hook:beforeMount"),ou($,!0),Te&&ie){const P=()=>{$.subTree=Eg($),ie(Te,$.subTree,$,ae,null)};E?V.type.__asyncLoader().then(()=>!$.isUnmounted&&P()):P()}else{const P=$.subTree=Eg($);N(null,P,Y,ce,$,ae,le),V.el=P.el}if(C&&_r(C,ae),!E&&(Oe=Ce&&Ce.onVnodeMounted)){const P=V;_r(()=>qn(Oe,b,P),ae)}Yt("INSTANCE_EVENT_HOOKS",$)&&_r(()=>$.emit("hook:mounted"),ae),V.shapeFlag&256&&($.a&&_r($.a,ae),Yt("INSTANCE_EVENT_HOOKS",$)&&_r(()=>$.emit("hook:activated"),ae)),$.isMounted=!0,V=Y=ce=null}},pe=$.effect=new jd(Ee,()=>Ow($.update),$.scope),ge=$.update=pe.run.bind(pe);ge.id=$.uid,ou($,!0),ge()},M=($,V,Y)=>{V.component=$;const ce=$.vnode.props;$.vnode=V,$.next=null,X$($,V.props,ce,Y),Q$($,V.children,Y),yc(),Pw(void 0,$.update),_c()},A=($,V,Y,ce,ae,le,ve,Ee,pe=!1)=>{const ge=$&&$.children,Oe=$?$.shapeFlag:0,Te=V.children,{patchFlag:Ce,shapeFlag:De}=V;if(Ce>0){if(Ce&128){S(ge,Te,Y,ce,ae,le,ve,Ee,pe);return}else if(Ce&256){v(ge,Te,Y,ce,ae,le,ve,Ee,pe);return}}De&8?(Oe&16&&R(ge,ae,le),Te!==ge&&l(Y,Te)):Oe&16?De&16?S(ge,Te,Y,ce,ae,le,ve,Ee,pe):R(ge,ae,le,!0):(Oe&8&&l(Y,""),De&16&&ue(Te,Y,ce,ae,le,ve,Ee,pe))},v=($,V,Y,ce,ae,le,ve,Ee,pe)=>{$=$||Qc,V=V||Qc;const ge=$.length,Oe=V.length,Te=Math.min(ge,Oe);let Ce;for(Ce=0;CeOe?R($,ae,le,!0,!1,Te):ue(V,Y,ce,ae,le,ve,Ee,pe,Te)},S=($,V,Y,ce,ae,le,ve,Ee,pe)=>{let ge=0;const Oe=V.length;let Te=$.length-1,Ce=Oe-1;for(;ge<=Te&&ge<=Ce;){const De=$[ge],C=V[ge]=pe?aa(V[ge]):ti(V[ge]);if(ks(De,C))N(De,C,Y,null,ae,le,ve,Ee,pe);else break;ge++}for(;ge<=Te&&ge<=Ce;){const De=$[Te],C=V[Ce]=pe?aa(V[Ce]):ti(V[Ce]);if(ks(De,C))N(De,C,Y,null,ae,le,ve,Ee,pe);else break;Te--,Ce--}if(ge>Te){if(ge<=Ce){const De=Ce+1,C=DeCe)for(;ge<=Te;)U($[ge],ae,le,!0),ge++;else{const De=ge,C=ge,b=new Map;for(ge=C;ge<=Ce;ge++){const Me=V[ge]=pe?aa(V[ge]):ti(V[ge]);Me.key!=null&&b.set(Me.key,ge)}let E,P=0;const W=Ce-C+1;let re=!1,te=0;const be=new Array(W);for(ge=0;ge=W){U(Me,ae,le,!0);continue}let Ue;if(Me.key!=null)Ue=b.get(Me.key);else for(E=C;E<=Ce;E++)if(be[E-C]===0&&ks(Me,V[E])){Ue=E;break}Ue===void 0?U(Me,ae,le,!0):(be[Ue-C]=ge+1,Ue>=te?te=Ue:re=!0,N(Me,V[Ue],Y,null,ae,le,ve,Ee,pe),P++)}const qe=re?pF(be):Qc;for(E=qe.length-1,ge=W-1;ge>=0;ge--){const Me=C+ge,Ue=V[Me],je=Me+1{const{el:le,type:ve,transition:Ee,children:pe,shapeFlag:ge}=$;if(ge&6){w($.component.subTree,V,Y,ce);return}if(ge&128){$.suspense.move(V,Y,ce);return}if(ge&64){ve.move($,V,Y,oe);return}if(ve===Jt){n(le,V,Y);for(let Te=0;TeEe.enter(le),ae);else{const{leave:Te,delayLeave:Ce,afterLeave:De}=Ee,C=()=>n(le,V,Y),b=()=>{Te(le,()=>{C(),De&&De()})};Ce?Ce(le,C,b):b()}else n(le,V,Y)},U=($,V,Y,ce=!1,ae=!1)=>{const{type:le,props:ve,ref:Ee,children:pe,dynamicChildren:ge,shapeFlag:Oe,patchFlag:Te,dirs:Ce}=$;if(Ee!=null&&Qg(Ee,null,Y,$,!0),Oe&256){V.ctx.deactivate($);return}const De=Oe&1&&Ce,C=!Zh($);let b;if(C&&(b=ve&&ve.onVnodeBeforeUnmount)&&qn(b,V,$),Oe&6)k($.component,Y,ce);else{if(Oe&128){$.suspense.unmount(Y,ce);return}De&&As($,null,V,"beforeUnmount"),Oe&64?$.type.remove($,V,Y,ae,oe,ce):ge&&(le!==Jt||Te>0&&Te&64)?R(ge,V,Y,!1,!0):(le===Jt&&Te&384||!ae&&Oe&16)&&R(pe,V,Y),ce&&me($)}(C&&(b=ve&&ve.onVnodeUnmounted)||De)&&_r(()=>{b&&qn(b,V,$),De&&As($,null,V,"unmounted")},Y)},me=$=>{const{type:V,el:Y,anchor:ce,transition:ae}=$;if(V===Jt){x(Y,ce);return}if(V===Uu){z($);return}const le=()=>{i(Y),ae&&!ae.persisted&&ae.afterLeave&&ae.afterLeave()};if($.shapeFlag&1&&ae&&!ae.persisted){const{leave:ve,delayLeave:Ee}=ae,pe=()=>ve(Y,le);Ee?Ee($.el,le,pe):pe()}else le()},x=($,V)=>{let Y;for(;$!==V;)Y=d($),i($),$=Y;i(V)},k=($,V,Y)=>{const{bum:ce,scope:ae,update:le,subTree:ve,um:Ee}=$;ce&&Ea(ce),Yt("INSTANCE_EVENT_HOOKS",$)&&$.emit("hook:beforeDestroy"),ae.stop(),le&&(le.active=!1,U(ve,$,V,Y)),Ee&&_r(Ee,V),Yt("INSTANCE_EVENT_HOOKS",$)&&_r(()=>$.emit("hook:destroyed"),V),_r(()=>{$.isUnmounted=!0},V),V&&V.pendingBranch&&!V.isUnmounted&&$.asyncDep&&!$.asyncResolved&&$.suspenseId===V.pendingId&&(V.deps--,V.deps===0&&V.resolve())},R=($,V,Y,ce=!1,ae=!1,le=0)=>{for(let ve=le;ve<$.length;ve++)U($[ve],V,Y,ce,ae)},j=$=>$.shapeFlag&6?j($.component.subTree):$.shapeFlag&128?$.suspense.next():d($.anchor||$.el),Q=($,V,Y)=>{$==null?V._vnode&&U(V._vnode,null,null,!0):N(V._vnode||null,$,V,null,null,null,Y),Jg(),V._vnode=$},oe={p:N,um:U,m:w,r:me,mt:p,mc:ue,pc:A,pbc:F,n:j,o:t};let fe,ie;return e&&([fe,ie]=e(oe)),{render:Q,hydrate:fe,createApp:hF(Q,fe)}}function ou({effect:t,update:e},r){t.allowRecurse=e.allowRecurse=r}function Kw(t,e,r=!1){const n=t.children,i=e.children;if(Be(n)&&Be(i))for(let s=0;s>1,t[r[a]]0&&(e[n]=r[s-1]),r[s]=n)}}for(s=r.length,o=r[s-1];s-- >0;)r[s]=o,o=e[o];return r}const gF=t=>t.__isTeleport,Sh=t=>t&&(t.disabled||t.disabled===""),VI=t=>typeof SVGElement!="undefined"&&t instanceof SVGElement,Bb=(t,e)=>{const r=t&&t.to;return ur(r)?e?e(r):null:r},mF={__isTeleport:!0,process(t,e,r,n,i,s,o,a,u,c){const{mc:l,pc:h,pbc:d,o:{insert:_,querySelector:T,createText:D,createComment:N}}=c,O=Sh(e.props);let{shapeFlag:L,children:J,dynamicChildren:q}=e;if(t==null){const z=e.el=D(""),ee=e.anchor=D("");_(z,r,n),_(ee,r,n);const G=e.target=Bb(e.props,T),ne=e.targetAnchor=D("");G&&(_(ne,G),o=o||VI(G));const ue=(_e,F)=>{L&16&&l(J,_e,F,i,s,o,a,u)};O?ue(r,ee):G&&ue(G,ne)}else{e.el=t.el;const z=e.anchor=t.anchor,ee=e.target=t.target,G=e.targetAnchor=t.targetAnchor,ne=Sh(t.props),ue=ne?r:ee,_e=ne?z:G;if(o=o||VI(ee),q?(d(t.dynamicChildren,q,ue,i,s,o,a),Kw(t,e,!0)):u||h(t,e,ue,_e,i,s,o,a,!1),O)ne||Wp(e,r,z,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const F=e.target=Bb(e.props,T);F&&Wp(e,F,null,c,0)}else ne&&Wp(e,ee,G,c,1)}},remove(t,e,r,n,{um:i,o:{remove:s}},o){const{shapeFlag:a,children:u,anchor:c,targetAnchor:l,target:h,props:d}=t;if(h&&s(l),(o||!Sh(d))&&(s(c),a&16))for(let _=0;_{e=o,r=a}),i=t(e,r);let s;return am(i)?s=xg(()=>i):zt(i)&&!hi(i)&&!Be(i)?s=xg({loader:()=>i.component,loadingComponent:i.loading,errorComponent:i.error,delay:i.delay,timeout:i.timeout}):i==null?s=xg(()=>n):s=t,Jy.set(t,s),s}function yR(t){Qr("INSTANCE_LISTENERS",t);const e={},r=t.vnode.props;if(!r)return e;for(const n in r)qo(n)&&(e[n[2].toLowerCase()+n.slice(3)]=r[n]);return e}function xF(t){const e=t.type,r=e.render;if(!(!r||r._rc||r._compatChecked||r._compatWrapped)){if(r.length>=2){r._compatChecked=!0;return}if(gm("RENDER_FUNCTION",t)){const n=e.render=function(){return r.call(this,e0)};n._compatWrapped=!0}}}function e0(t,e,r){if(t||(t=Sn),typeof t=="string"){const s=oi(t);(s==="transition"||s==="transition-group"||s==="keep-alive")&&(t=`__compat__${s}`),t=Zg(t)}const n=arguments.length,i=Be(e);return n===2||i?zt(e)&&!i?hi(e)?Xp(Xt(t,null,[e])):Xp(KI(Xt(t,HI(e,t)),e)):Xp(Xt(t,null,e)):(hi(r)&&(r=[r]),Xp(KI(Xt(t,HI(e,t),r),e)))}const SF=rf("staticStyle,staticClass,directives,model,hook");function HI(t,e){if(!t)return null;const r={};for(const n in t)if(n==="attrs"||n==="domProps"||n==="props")wt(r,t[n]);else if(n==="on"||n==="nativeOn"){const i=t[n];for(const s in i){let o=IF(s);n==="nativeOn"&&(o+="Native");const a=r[o],u=i[s];a!==u&&(a?r[o]=[].concat(a,u):r[o]=u)}}else SF(n)||(r[n]=t[n]);if(t.staticClass&&(r.class=as([t.staticClass,r.class])),t.staticStyle&&(r.style=si([t.staticStyle,r.style])),t.model&&zt(e)){const{prop:n="value",event:i="input"}=e.model||{};r[n]=t.model.value,r[mm+i]=t.model.callback}return r}function IF(t){return t[0]==="&"&&(t=t.slice(1)+"Passive"),t[0]==="~"&&(t=t.slice(1)+"Once"),t[0]==="!"&&(t=t.slice(1)+"Capture"),tl(t)}function KI(t,e){return e&&e.directives?cR(t,e.directives.map(({name:r,value:n,arg:i,modifiers:s})=>[mR(r),n,i,s])):t}function Xp(t){const{props:e,children:r}=t;let n;if(t.shapeFlag&6&&Be(r)){n={};for(let s=0;so,n[s]._ns=!0}}const i=e&&e.scopedSlots;return i&&(delete e.scopedSlots,n?wt(n,i):n=i),n&&xm(t,n),t}function _R(t){if(Yt("RENDER_FUNCTION",Zr,!0)&&Yt("PRIVATE_APIS",Zr,!0)){const e=Zr,r=()=>t.component&&t.component.proxy;let n;Object.defineProperties(t,{tag:{get:()=>t.type},data:{get:()=>t.props||{},set:i=>t.props=i},elm:{get:()=>t.el},componentInstance:{get:r},child:{get:r},text:{get:()=>ur(t.children)?t.children:null},context:{get:()=>e&&e.proxy},componentOptions:{get:()=>{if(t.shapeFlag&4)return n||(n={Ctor:t.type,propsData:t.props,children:t.children})}}})}}const Qy=new Map,bR={get(t,e){const r=t[e];return r&&r()}};function TF(t){if(Qy.has(t))return Qy.get(t);const e=t.render,r=(n,i)=>{const s=Qs(),o={props:n,children:s.vnode.children||[],data:s.vnode.props||{},scopedSlots:i.slots,parent:s.parent&&s.parent.proxy,slots(){return new Proxy(i.slots,bR)},get listeners(){return yR(s)},get injections(){if(t.inject){const a={};return tR(t.inject,a),a}return{}}};return e(e0,o)};return r.props=t.props,r.displayName=t.name,r.compatConfig=t.compatConfig,r.inheritAttrs=!1,Qy.set(t,r),r}function AF(t,e){return t.__isBuiltIn?t:(Xe(t)&&t.cid&&(t=t.options),Xe(t)&&gm("COMPONENT_ASYNC",e,t)?EF(t):zt(t)&&t.functional&&ko("COMPONENT_FUNCTIONAL",e,t)?TF(t):t)}const Jt=Symbol(void 0),Ml=Symbol(void 0),Sn=Symbol(void 0),Uu=Symbol(void 0),Ih=[];let Ls=null;function Kt(t=!1){Ih.push(Ls=t?null:[])}function wR(){Ih.pop(),Ls=Ih[Ih.length-1]||null}let Cl=1;function $b(t){Cl+=t}function ER(t){return t.dynamicChildren=Cl>0?Ls||Qc:null,wR(),Cl>0&&Ls&&Ls.push(t),t}function sr(t,e,r,n,i,s){return ER(Ir(t,e,r,n,i,s,!0))}function rd(t,e,r,n,i){return ER(Xt(t,e,r,n,i,!0))}function hi(t){return t?t.__v_isVNode===!0:!1}function ks(t,e){return t.type===e.type&&t.key===e.key}function kF(t){}const Em="__vInternal",xR=({key:t})=>t!=null?t:null,Sg=({ref:t,ref_key:e,ref_for:r})=>t!=null?ur(t)||kr(t)||Xe(t)?{i:Zr,r:t,k:e,f:!!r}:t:null;function Ir(t,e=null,r=null,n=0,i=null,s=t===Jt?0:1,o=!1,a=!1){const u={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&xR(e),ref:e&&Sg(e),scopeId:il,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:n,dynamicProps:i,dynamicChildren:null,appContext:null};return a?(xm(u,r),s&128&&t.normalize(u)):r&&(u.shapeFlag|=ur(r)?8:16),Cl>0&&!o&&Ls&&(u.patchFlag>0||s&6)&&u.patchFlag!==32&&Ls.push(u),I$(u),_R(u),u}const Xt=MF;function MF(t,e=null,r=null,n=0,i=null,s=!1){if((!t||t===gR)&&(t=Sn),hi(t)){const a=Mo(t,e,!0);return r&&xm(a,r),a}if(JF(t)&&(t=t.__vccOpts),t=AF(t,Zr),e){e=SR(e);let{class:a,style:u}=e;a&&!ur(a)&&(e.class=as(a)),zt(u)&&(kw(u)&&!Be(u)&&(u=wt({},u)),e.style=si(u))}const o=ur(t)?1:O$(t)?128:gF(t)?64:zt(t)?4:Xe(t)?2:0;return Ir(t,e,r,n,i,o,s,!0)}function SR(t){return t?kw(t)||Em in t?wt({},t):t:null}function Mo(t,e,r=!1){const{props:n,ref:i,patchFlag:s,children:o}=t,a=e?Sm(n||{},e):n,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:a,key:a&&xR(a),ref:e&&e.ref?r&&i?Be(i)?i.concat(Sg(e)):[i,Sg(e)]:Sg(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:o,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Jt?s===-1?16:s|16:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Mo(t.ssContent),ssFallback:t.ssFallback&&Mo(t.ssFallback),el:t.el,anchor:t.anchor};return _R(u),u}function po(t=" ",e=0){return Xt(Ml,null,t,e)}function CF(t,e){const r=Xt(Uu,null,t);return r.staticCount=e,r}function t0(t="",e=!1){return e?(Kt(),rd(Sn,null,t)):Xt(Sn,null,t)}function ti(t){return t==null||typeof t=="boolean"?Xt(Sn):Be(t)?Xt(Jt,null,t.slice()):typeof t=="object"?aa(t):Xt(Ml,null,String(t))}function aa(t){return t.el===null||t.memo?t:Mo(t)}function xm(t,e){let r=0;const{shapeFlag:n}=t;if(e==null)e=null;else if(Be(e))r=16;else if(typeof e=="object")if(n&65){const i=e.default;i&&(i._c&&(i._d=!1),xm(t,i()),i._c&&(i._d=!0));return}else{r=32;const i=e._;!i&&!(Em in e)?e._ctx=Zr:i===3&&Zr&&(Zr.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Xe(e)?(e={default:e,_ctx:Zr},r=32):(e=String(e),n&64?(r=16,e=[po(e)]):r=8);t.children=e,t.shapeFlag|=r}function Sm(...t){const e={};for(let r=0;re(o,a,void 0,s&&s[a]));else{const o=Object.keys(t);i=new Array(o.length);for(let a=0,u=o.length;ahi(e)?!(e.type===Sn||e.type===Jt&&!kR(e.children)):!0)?t:null}function MR(t){const e={};for(const r in t)e[tl(r)]=t[r];return e}function NF(t){const e={};for(let r=0;rr))}function LF(t,e,r){return TR(e||{$stable:!r},CR(t))}function CR(t){for(let e=0;e{n[i]=s},r=(n,i)=>{delete n[i]};wt(t,{$set:n=>(Qr("INSTANCE_SET",n),e),$delete:n=>(Qr("INSTANCE_DELETE",n),r),$mount:n=>(Qr("GLOBAL_MOUNT",null),n.ctx._compat_mount||Kn),$destroy:n=>(Qr("INSTANCE_DESTROY",n),n.ctx._compat_destroy||Kn),$slots:n=>Yt("RENDER_FUNCTION",n)&&n.render&&n.render._compatWrapped?new Proxy(n.slots,bR):n.slots,$scopedSlots:n=>{Qr("INSTANCE_SCOPED_SLOTS",n);const i={};for(const s in n.slots){const o=n.slots[s];o._ns||(i[s]=o)}return i},$on:n=>$w.bind(null,n),$once:n=>x$.bind(null,n),$off:n=>Fw.bind(null,n),$children:RF,$listeners:yR}),Yt("PRIVATE_APIS",null)&&wt(t,{$vnode:n=>n.vnode,$options:n=>{const i=wt({},bm(n));return i.parent=n.proxy.$parent,i.propsData=n.vnode.props,i},_self:n=>n.proxy,_uid:n=>n.uid,_data:n=>n.data,_isMounted:n=>n.isMounted,_isDestroyed:n=>n.isUnmounted,$createElement:()=>e0,_c:()=>e0,_o:()=>FF,_n:()=>Ao,_s:()=>sa,_l:()=>es,_t:n=>PF.bind(null,n),_q:()=>To,_i:()=>Ud,_m:n=>BF.bind(null,n),_f:()=>vR,_k:n=>$F.bind(null,n),_b:()=>OF,_v:()=>po,_e:()=>t0,_u:()=>LF,_g:()=>DF,_d:()=>UF,_p:()=>qF})}const Fb=t=>t?RR(t)?Jw(t)||t.proxy:Fb(t.parent):null,nd=wt(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=>Fb(t.parent),$root:t=>Fb(t.root),$emit:t=>t.emit,$options:t=>bm(t),$forceUpdate:t=>()=>Ow(t.update),$nextTick:t=>nf.bind(t.proxy),$watch:t=>j$.bind(t)});jF(nd);const Ub={get({_:t},e){const{ctx:r,setupState:n,data:i,props:s,accessCache:o,type:a,appContext:u}=t;let c;if(e[0]!=="$"){const _=o[e];if(_!==void 0)switch(_){case 1:return n[e];case 2:return i[e];case 4:return r[e];case 3:return s[e]}else{if(n!==Gt&&Rt(n,e))return o[e]=1,n[e];if(i!==Gt&&Rt(i,e))return o[e]=2,i[e];if((c=t.propsOptions[0])&&Rt(c,e))return o[e]=3,s[e];if(r!==Gt&&Rt(r,e))return o[e]=4,r[e];Db&&(o[e]=0)}}const l=nd[e];let h,d;if(l)return e==="$attrs"&&Yn(t,"get",e),l(t);if((h=a.__cssModules)&&(h=h[e]))return h;if(r!==Gt&&Rt(r,e))return o[e]=4,r[e];if(d=u.config.globalProperties,Rt(d,e)){const _=Object.getOwnPropertyDescriptor(d,e);if(_.get)return _.get.call(t.proxy);{const T=d[e];return Xe(T)?T.bind(t.proxy):T}}},set({_:t},e,r){const{data:n,setupState:i,ctx:s}=t;return i!==Gt&&Rt(i,e)?(i[e]=r,!0):n!==Gt&&Rt(n,e)?(n[e]=r,!0):Rt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=r,!0)},has({_:{data:t,setupState:e,accessCache:r,ctx:n,appContext:i,propsOptions:s}},o){let a;return!!r[o]||t!==Gt&&Rt(t,o)||e!==Gt&&Rt(e,o)||(a=s[0])&&Rt(a,o)||Rt(n,o)||Rt(nd,o)||Rt(i.config.globalProperties,o)},defineProperty(t,e,r){return r.get!=null?this.set(t,e,r.get(),null):r.value!=null&&this.set(t,e,r.value,null),Reflect.defineProperty(t,e,r)}},VF=wt({},Ub,{get(t,e){if(e!==Symbol.unscopables)return Ub.get(t,e,t)},has(t,e){return e[0]!=="_"&&!hB(e)}}),zF=fR();let HF=0;function Ww(t,e,r){const n=t.type,i=(e?e.appContext:t.appContext)||zF,s={uid:HF++,vnode:t,type:n,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new xw(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:sR(n,i),emitsOptions:PC(n,i),emit:null,emitted:null,propsDefaults:Gt,inheritAttrs:n.inheritAttrs,ctx:Gt,data:Gt,props:Gt,attrs:Gt,slots:Gt,refs:Gt,setupState:Gt,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=A$.bind(null,s),t.ce&&t.ce(s),s}let Dr=null;const Qs=()=>Dr||Zr,Oa=t=>{Dr=t,t.scope.on()},Sa=()=>{Dr&&Dr.scope.off(),Dr=null};function RR(t){return t.vnode.shapeFlag&4}let Rl=!1;function Xw(t,e=!1){Rl=e;const{props:r,children:n}=t.vnode,i=RR(t);W$(t,r,i,e),J$(t,n);const s=i?KF(t,e):void 0;return Rl=!1,s}function KF(t,e){const r=t.type;t.accessCache=Object.create(null),t.proxy=Mw(new Proxy(t.ctx,Ub));const{setup:n}=r;if(n){const i=t.setupContext=n.length>1?NR(t):null;Oa(t),yc();const s=ss(n,t,0,[t.props,i]);if(_c(),Sa(),am(s)){if(s.then(Sa,Sa),e)return s.then(o=>{qb(t,o,e)}).catch(o=>{bc(o,t,0)});t.asyncDep=s}else qb(t,s,e)}else Yw(t,e)}function qb(t,e,r){Xe(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:zt(e)&&(t.setupState=Wh(e)),Yw(t,r)}let r0,jb;function GF(t){r0=t,jb=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,VF))}}const Vb=()=>!r0;function Yw(t,e,r){const n=t.type;if(xF(t),!t.render){if(!e&&r0&&!n.render){const i=t.vnode.props&&t.vnode.props["inline-template"]||n.template;if(i){const{isCustomElement:s,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:u}=n,c=wt(wt({isCustomElement:s,delimiters:a},o),u);c.compatConfig=Object.create(Lw),n.compatConfig&&wt(c.compatConfig,n.compatConfig),n.render=r0(i,c)}}t.render=n.render||Kn,jb&&jb(t)}r||(Oa(t),yc(),z$(t),_c(),Sa())}function WF(t){return new Proxy(t.attrs,{get(e,r){return Yn(t,"get","$attrs"),e[r]}})}function NR(t){const e=n=>{t.exposed=n||{}};let r;return{get attrs(){return r||(r=WF(t))},slots:t.slots,emit:t.emit,expose:e}}function Jw(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(Wh(Mw(t.exposed)),{get(e,r){if(r in e)return e[r];if(r in nd)return nd[r](t)}}))}const XF=/(?:^|[-_])(\w)/g,YF=t=>t.replace(XF,e=>e.toUpperCase()).replace(/[-_]/g,"");function n0(t){return Xe(t)&&t.displayName||t.name}function OR(t,e,r=!1){let n=n0(e);if(!n&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(n=i[1])}if(!n&&t&&t.parent){const i=s=>{for(const o in s)if(s[o]===e)return o};n=i(t.components||t.parent.type.components)||i(t.appContext.components)}return n?YF(n):r?"App":"Anonymous"}function JF(t){return Xe(t)&&"__vccOpts"in t}const Mi=(t,e)=>h$(t,e,Rl);function QF(){return null}function ZF(){return null}function eU(t){}function tU(t,e){return null}function rU(){return DR().slots}function nU(){return DR().attrs}function DR(){const t=Qs();return t.setupContext||(t.setupContext=NR(t))}function iU(t,e){const r=Be(t)?t.reduce((n,i)=>(n[i]={},n),{}):t;for(const n in e){const i=r[n];i?Be(i)||Xe(i)?r[n]={type:i,default:e[n]}:i.default=e[n]:i===null&&(r[n]={default:e[n]})}return r}function sU(t,e){const r={};for(const n in t)e.includes(n)||Object.defineProperty(r,n,{enumerable:!0,get:()=>t[n]});return r}function oU(t){const e=Qs();let r=t();return Sa(),am(r)&&(r=r.catch(n=>{throw Oa(e),n})),[r,()=>Oa(e)]}function Im(t,e,r){const n=arguments.length;return n===2?zt(e)&&!Be(e)?hi(e)?Xt(t,null,[e]):Xt(t,e):Xt(t,null,e):(n>3?r=Array.prototype.slice.call(arguments,2):n===3&&hi(r)&&(r=[r]),Xt(t,e,r))}const PR=Symbol(""),aU=()=>{{const t=Wn(PR);return t||AC("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),t}};function uU(){}function cU(t,e,r,n){const i=r[n];if(i&&LR(i,t))return i;const s=e();return s.memo=t.slice(),r[n]=s}function LR(t,e){const r=t.memo;if(r.length!=e.length)return!1;for(let n=0;n0&&Ls&&Ls.push(t),!0}const BR="3.2.31",lU={createComponentInstance:Ww,setupComponent:Xw,renderComponentRoot:Eg,setCurrentRenderingInstance:Yh,isVNode:hi,normalizeVNode:ti},fU=lU,hU=vR,dU={warnDeprecation:w$,createCompatVue:rF,isCompatEnabled:Yt,checkCompatEnabled:gm,softAssertCompatEnabled:ko},Vs=dU,pU="http://www.w3.org/2000/svg",yu=typeof document!="undefined"?document:null,XI=yu&&yu.createElement("template"),gU={insert:(t,e,r)=>{e.insertBefore(t,r||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,r,n)=>{const i=e?yu.createElementNS(pU,t):yu.createElement(t,r?{is:r}:void 0);return t==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:t=>yu.createTextNode(t),createComment:t=>yu.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>yu.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},cloneNode(t){const e=t.cloneNode(!0);return"_value"in t&&(e._value=t._value),e},insertStaticContent(t,e,r,n,i,s){const o=r?r.previousSibling:e.lastChild;if(i&&(i===s||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),r),!(i===s||!(i=i.nextSibling)););else{XI.innerHTML=n?`${t}`:t;const a=XI.content;if(n){const u=a.firstChild;for(;u.firstChild;)a.appendChild(u.firstChild);a.removeChild(u)}e.insertBefore(a,r)}return[o?o.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}};function mU(t,e,r){const n=t._vtc;n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):r?t.setAttribute("class",e):t.className=e}function vU(t,e,r){const n=t.style,i=ur(r);if(r&&!i){for(const s in r)zb(n,s,r[s]);if(e&&!ur(e))for(const s in e)r[s]==null&&zb(n,s,"")}else{const s=n.display;i?e!==r&&(n.cssText=r):e&&t.removeAttribute("style"),"_vod"in t&&(n.display=s)}}const YI=/\s*!important$/;function zb(t,e,r){if(Be(r))r.forEach(n=>zb(t,e,n));else if(e.startsWith("--"))t.setProperty(e,r);else{const n=yU(t,e);YI.test(r)?t.setProperty(oi(n),r.replace(YI,""),"important"):t[n]=r}}const JI=["Webkit","Moz","ms"],Zy={};function yU(t,e){const r=Zy[e];if(r)return r;let n=Xn(e);if(n!=="filter"&&n in t)return Zy[e]=n;n=qd(n);for(let i=0;idocument.createEvent("Event").timeStamp&&(i0=()=>performance.now());const t=navigator.userAgent.match(/firefox\/(\d+)/i);$R=!!(t&&Number(t[1])<=53)}let Hb=0;const xU=Promise.resolve(),SU=()=>{Hb=0},IU=()=>Hb||(xU.then(SU),Hb=i0());function lo(t,e,r,n){t.addEventListener(e,r,n)}function TU(t,e,r,n){t.removeEventListener(e,r,n)}function AU(t,e,r,n,i=null){const s=t._vei||(t._vei={}),o=s[e];if(n&&o)o.value=n;else{const[a,u]=kU(e);if(n){const c=s[e]=MU(n,i);lo(t,a,c,u)}else o&&(TU(t,a,o,u),s[e]=void 0)}}const ZI=/(?:Once|Passive|Capture)$/;function kU(t){let e;if(ZI.test(t)){e={};let r;for(;r=t.match(ZI);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[oi(t.slice(2)),e]}function MU(t,e){const r=n=>{const i=n.timeStamp||i0();($R||i>=r.attached-1)&&Gn(CU(n,r.value),e,5,[n])};return r.value=t,r.attached=IU(),r}function CU(t,e){if(Be(e)){const r=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{r.call(t),t._stopped=!0},e.map(n=>i=>!i._stopped&&n&&n(i))}else return e}const e2=/^on[a-z]/,RU=(t,e,r,n,i=!1,s,o,a,u)=>{e==="class"?mU(t,n,i):e==="style"?vU(t,r,n):qo(e)?_w(e)||AU(t,e,r,n,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):NU(t,e,n,i))?EU(t,e,n,s,o,a,u):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),_U(t,e,n,i,o))};function NU(t,e,r,n){return n?!!(e==="innerHTML"||e==="textContent"||e in t&&e2.test(e)&&Xe(r)):e==="spellcheck"||e==="draggable"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA"||e2.test(e)&&ur(r)?!1:e in t}function FR(t,e){const r=zd(t);class n extends Tm{constructor(s){super(r,s,e)}}return n.def=r,n}const OU=t=>FR(t,e3),DU=typeof HTMLElement!="undefined"?HTMLElement:class{};class Tm extends DU{constructor(e,r={},n){super(),this._def=e,this._props=r,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):this.attachShadow({mode:"open"})}connectedCallback(){this._connected=!0,this._instance||this._resolveDef()}disconnectedCallback(){this._connected=!1,nf(()=>{this._connected||(Gb(null,this.shadowRoot),this._instance=null)})}_resolveDef(){if(this._resolved)return;this._resolved=!0;for(let n=0;n{for(const i of n)this._setAttr(i.attributeName)}).observe(this,{attributes:!0});const e=n=>{const{props:i,styles:s}=n,o=!Be(i),a=i?o?Object.keys(i):i:[];let u;if(o)for(const c in this._props){const l=i[c];(l===Number||l&&l.type===Number)&&(this._props[c]=Ao(this._props[c]),(u||(u=Object.create(null)))[c]=!0)}this._numberProps=u;for(const c of Object.keys(this))c[0]!=="_"&&this._setProp(c,this[c],!0,!1);for(const c of a.map(Xn))Object.defineProperty(this,c,{get(){return this._getProp(c)},set(l){this._setProp(c,l)}});this._applyStyles(s),this._update()},r=this._def.__asyncLoader;r?r().then(e):e(this._def)}_setAttr(e){let r=this.getAttribute(e);this._numberProps&&this._numberProps[e]&&(r=Ao(r)),this._setProp(Xn(e),r,!1)}_getProp(e){return this._props[e]}_setProp(e,r,n=!0,i=!0){r!==this._props[e]&&(this._props[e]=r,i&&this._instance&&this._update(),n&&(r===!0?this.setAttribute(oi(e),""):typeof r=="string"||typeof r=="number"?this.setAttribute(oi(e),r+""):r||this.removeAttribute(oi(e))))}_update(){Gb(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Xt(this._def,wt({},this._props));return this._instance||(e.ce=r=>{this._instance=r,r.isCE=!0,r.emit=(i,...s)=>{this.dispatchEvent(new CustomEvent(i,{detail:s}))};let n=this;for(;n=n&&(n.parentNode||n.host);)if(n instanceof Tm){r.parent=n._instance;break}}),e}_applyStyles(e){e&&e.forEach(r=>{const n=document.createElement("style");n.textContent=r,this.shadowRoot.appendChild(n)})}}function PU(t="$style"){{const e=Qs();if(!e)return Gt;const r=e.type.__cssModules;if(!r)return Gt;const n=r[t];return n||Gt}}function LU(t){const e=Qs();if(!e)return;const r=()=>Kb(e.subTree,t(e.proxy));FC(r),Kd(()=>{const n=new MutationObserver(r);n.observe(e.subTree.el.parentNode,{childList:!0}),td(()=>n.disconnect())})}function Kb(t,e){if(t.shapeFlag&128){const r=t.suspense;t=r.activeBranch,r.pendingBranch&&!r.isHydrating&&r.effects.push(()=>{Kb(r.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)t2(t.el,e);else if(t.type===Jt)t.children.forEach(r=>Kb(r,e));else if(t.type===Uu){let{el:r,anchor:n}=t;for(;r&&(t2(r,e),r!==n);)r=r.nextSibling}}function t2(t,e){if(t.nodeType===1){const r=t.style;for(const n in e)r.setProperty(`--${n}`,e[n])}}const Jo="transition",Df="animation",Gd=(t,{slots:e})=>Im(zw,qR(t),e);Gd.displayName="Transition";Gd.__isBuiltIn=!0;const UR={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},BU=Gd.props=wt({},zw.props,UR),au=(t,e=[])=>{Be(t)?t.forEach(r=>r(...e)):t&&t(...e)},r2=t=>t?Be(t)?t.some(e=>e.length>1):t.length>1:!1;function qR(t){const e={};for(const y in t)y in UR||(e[y]=t[y]);if(t.css===!1)return e;const{name:r="v",type:n,duration:i,enterFromClass:s=`${r}-enter-from`,enterActiveClass:o=`${r}-enter-active`,enterToClass:a=`${r}-enter-to`,appearFromClass:u=s,appearActiveClass:c=o,appearToClass:l=a,leaveFromClass:h=`${r}-leave-from`,leaveActiveClass:d=`${r}-leave-active`,leaveToClass:_=`${r}-leave-to`}=t,T=Vs.isCompatEnabled("TRANSITION_CLASSES",null);let D,N,O;if(T){const y=I=>I.replace(/-from$/,"");t.enterFromClass||(D=y(s)),t.appearFromClass||(N=y(u)),t.leaveFromClass||(O=y(h))}const L=$U(i),J=L&&L[0],q=L&&L[1],{onBeforeEnter:z,onEnter:ee,onEnterCancelled:G,onLeave:ne,onLeaveCancelled:ue,onBeforeAppear:_e=z,onAppear:F=ee,onAppearCancelled:m=G}=e,g=(y,I,M)=>{oo(y,I?l:a),oo(y,I?c:o),M&&M()},f=(y,I)=>{oo(y,_),oo(y,d),I&&I()},p=y=>(I,M)=>{const A=y?F:ee,v=()=>g(I,y,M);au(A,[I,v]),n2(()=>{oo(I,y?u:s),T&&oo(I,y?N:D),Si(I,y?l:a),r2(A)||i2(I,n,J,v)})};return wt(e,{onBeforeEnter(y){au(z,[y]),Si(y,s),T&&Si(y,D),Si(y,o)},onBeforeAppear(y){au(_e,[y]),Si(y,u),T&&Si(y,N),Si(y,c)},onEnter:p(!1),onAppear:p(!0),onLeave(y,I){const M=()=>f(y,I);Si(y,h),T&&Si(y,O),VR(),Si(y,d),n2(()=>{oo(y,h),T&&oo(y,O),Si(y,_),r2(ne)||i2(y,n,q,M)}),au(ne,[y,M])},onEnterCancelled(y){g(y,!1),au(G,[y])},onAppearCancelled(y){g(y,!0),au(m,[y])},onLeaveCancelled(y){f(y),au(ue,[y])}})}function $U(t){if(t==null)return null;if(zt(t))return[e_(t.enter),e_(t.leave)];{const e=e_(t);return[e,e]}}function e_(t){return Ao(t)}function Si(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.add(r)),(t._vtc||(t._vtc=new Set)).add(e)}function oo(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.remove(n));const{_vtc:r}=t;r&&(r.delete(e),r.size||(t._vtc=void 0))}function n2(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let FU=0;function i2(t,e,r,n){const i=t._endId=++FU,s=()=>{i===t._endId&&n()};if(r)return setTimeout(s,r);const{type:o,timeout:a,propCount:u}=jR(t,e);if(!o)return n();const c=o+"end";let l=0;const h=()=>{t.removeEventListener(c,d),s()},d=_=>{_.target===t&&++l>=u&&h()};setTimeout(()=>{l(r[T]||"").split(", "),i=n(Jo+"Delay"),s=n(Jo+"Duration"),o=s2(i,s),a=n(Df+"Delay"),u=n(Df+"Duration"),c=s2(a,u);let l=null,h=0,d=0;e===Jo?o>0&&(l=Jo,h=o,d=s.length):e===Df?c>0&&(l=Df,h=c,d=u.length):(h=Math.max(o,c),l=h>0?o>c?Jo:Df:null,d=l?l===Jo?s.length:u.length:0);const _=l===Jo&&/\b(transform|all)(,|$)/.test(r[Jo+"Property"]);return{type:l,timeout:h,propCount:d,hasTransform:_}}function s2(t,e){for(;t.lengtho2(r)+o2(t[n])))}function o2(t){return Number(t.slice(0,-1).replace(",","."))*1e3}function VR(){return document.body.offsetHeight}const zR=new WeakMap,HR=new WeakMap,KR={name:"TransitionGroup",props:wt({},BU,{tag:String,moveClass:String}),setup(t,{slots:e}){const r=Qs(),n=Vw();let i,s;return _m(()=>{if(!i.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!VU(i[0].el,r.vnode.el,o))return;i.forEach(UU),i.forEach(qU);const a=i.filter(jU);VR(),a.forEach(u=>{const c=u.el,l=c.style;Si(c,o),l.transform=l.webkitTransform=l.transitionDuration="";const h=c._moveCb=d=>{d&&d.target!==c||(!d||/transform$/.test(d.propertyName))&&(c.removeEventListener("transitionend",h),c._moveCb=null,oo(c,o))};c.addEventListener("transitionend",h)})}),()=>{const o=It(t),a=qR(o);let u=o.tag||Jt;!o.tag&&Vs.checkCompatEnabled("TRANSITION_GROUP_ROOT",r.parent)&&(u="span"),i=s,s=e.default?vm(e.default()):[];for(let c=0;c{o.split(/\s+/).forEach(a=>a&&n.classList.remove(a))}),r.split(/\s+/).forEach(o=>o&&n.classList.add(o)),n.style.display="none";const i=e.nodeType===1?e:e.parentNode;i.appendChild(n);const{hasTransform:s}=jR(n);return i.removeChild(n),s}const Da=t=>{const e=t.props["onUpdate:modelValue"];return Be(e)?r=>Ea(e,r):e};function zU(t){t.target.composing=!0}function a2(t){const e=t.target;e.composing&&(e.composing=!1,HU(e,"input"))}function HU(t,e){const r=document.createEvent("HTMLEvents");r.initEvent(e,!0,!0),t.dispatchEvent(r)}const s0={created(t,{modifiers:{lazy:e,trim:r,number:n}},i){t._assign=Da(i);const s=n||i.props&&i.props.type==="number";lo(t,e?"change":"input",o=>{if(o.target.composing)return;let a=t.value;r?a=a.trim():s&&(a=Ao(a)),t._assign(a)}),r&&lo(t,"change",()=>{t.value=t.value.trim()}),e||(lo(t,"compositionstart",zU),lo(t,"compositionend",a2),lo(t,"change",a2))},mounted(t,{value:e}){t.value=e==null?"":e},beforeUpdate(t,{value:e,modifiers:{lazy:r,trim:n,number:i}},s){if(t._assign=Da(s),t.composing||document.activeElement===t&&(r||n&&t.value.trim()===e||(i||t.type==="number")&&Ao(t.value)===e))return;const o=e==null?"":e;t.value!==o&&(t.value=o)}},Qw={deep:!0,created(t,e,r){t._assign=Da(r),lo(t,"change",()=>{const n=t._modelValue,i=Nl(t),s=t.checked,o=t._assign;if(Be(n)){const a=Ud(n,i),u=a!==-1;if(s&&!u)o(n.concat(i));else if(!s&&u){const c=[...n];c.splice(a,1),o(c)}}else if(vc(n)){const a=new Set(n);s?a.add(i):a.delete(i),o(a)}else o(XR(t,s))})},mounted:u2,beforeUpdate(t,e,r){t._assign=Da(r),u2(t,e,r)}};function u2(t,{value:e,oldValue:r},n){t._modelValue=e,Be(e)?t.checked=Ud(e,n.props.value)>-1:vc(e)?t.checked=e.has(n.props.value):e!==r&&(t.checked=To(e,XR(t,!0)))}const Zw={created(t,{value:e},r){t.checked=To(e,r.props.value),t._assign=Da(r),lo(t,"change",()=>{t._assign(Nl(t))})},beforeUpdate(t,{value:e,oldValue:r},n){t._assign=Da(n),e!==r&&(t.checked=To(e,n.props.value))}},WR={deep:!0,created(t,{value:e,modifiers:{number:r}},n){const i=vc(e);lo(t,"change",()=>{const s=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>r?Ao(Nl(o)):Nl(o));t._assign(t.multiple?i?new Set(s):s:s[0])}),t._assign=Da(n)},mounted(t,{value:e}){c2(t,e)},beforeUpdate(t,e,r){t._assign=Da(r)},updated(t,{value:e}){c2(t,e)}};function c2(t,e){const r=t.multiple;if(!(r&&!Be(e)&&!vc(e))){for(let n=0,i=t.options.length;n-1:s.selected=e.has(o);else if(To(Nl(s),e)){t.selectedIndex!==n&&(t.selectedIndex=n);return}}!r&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Nl(t){return"_value"in t?t._value:t.value}function XR(t,e){const r=e?"_trueValue":"_falseValue";return r in t?t[r]:e}const YR={created(t,e,r){Yp(t,e,r,null,"created")},mounted(t,e,r){Yp(t,e,r,null,"mounted")},beforeUpdate(t,e,r,n){Yp(t,e,r,n,"beforeUpdate")},updated(t,e,r,n){Yp(t,e,r,n,"updated")}};function Yp(t,e,r,n,i){let s;switch(t.tagName){case"SELECT":s=WR;break;case"TEXTAREA":s=s0;break;default:switch(r.props&&r.props.type){case"checkbox":s=Qw;break;case"radio":s=Zw;break;default:s=s0}}const o=s[i];o&&o(t,e,r,n)}function KU(){s0.getSSRProps=({value:t})=>({value:t}),Zw.getSSRProps=({value:t},e)=>{if(e.props&&To(e.props.value,t))return{checked:!0}},Qw.getSSRProps=({value:t},e)=>{if(Be(t)){if(e.props&&Ud(t,e.props.value)>-1)return{checked:!0}}else if(vc(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}}}const GU=["ctrl","shift","alt","meta"],WU={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)=>GU.some(r=>t[`${r}Key`]&&!e.includes(r))},XU=(t,e)=>(r,...n)=>{for(let i=0;i{let r,n=null;return n=Qs(),Vs.isCompatEnabled("CONFIG_KEY_CODES",n)&&n&&(r=n.appContext.config.keyCodes),i=>{if(!("key"in i))return;const s=oi(i.key);if(e.some(o=>o===s||YU[o]===s))return t(i);{const o=String(i.keyCode);if(Vs.isCompatEnabled("V_ON_KEYCODE_MODIFIER",n)&&e.some(a=>a==o))return t(i);if(r)for(const a of e){const u=r[a];if(u&&(Be(u)?u.some(l=>String(l)===o):String(u)===o))return t(i)}}}},eE={beforeMount(t,{value:e},{transition:r}){t._vod=t.style.display==="none"?"":t.style.display,r&&e?r.beforeEnter(t):Pf(t,e)},mounted(t,{value:e},{transition:r}){r&&e&&r.enter(t)},updated(t,{value:e,oldValue:r},{transition:n}){!e!=!r&&(n?e?(n.beforeEnter(t),Pf(t,!0),n.enter(t)):n.leave(t,()=>{Pf(t,!1)}):Pf(t,e))},beforeUnmount(t,{value:e}){Pf(t,e)}};function Pf(t,e){t.style.display=e?t._vod:"none"}function QU(){eE.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const JR=wt({patchProp:RU},gU);let Th,l2=!1;function QR(){return Th||(Th=hR(JR))}function ZR(){return Th=l2?Th:dR(JR),l2=!0,Th}const Gb=(...t)=>{QR().render(...t)},e3=(...t)=>{ZR().hydrate(...t)},tE=(...t)=>{const e=QR().createApp(...t),{mount:r}=e;return e.mount=n=>{const i=t3(n);if(!i)return;const s=e._component;!Xe(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.innerHTML="";const o=r(i,!1,i instanceof SVGElement);return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e},ZU=(...t)=>{const e=ZR().createApp(...t),{mount:r}=e;return e.mount=n=>{const i=t3(n);if(i)return r(i,!0,i instanceof SVGElement)},e};function t3(t){return ur(t)?document.querySelector(t):t}let f2=!1;const e7=()=>{f2||(f2=!0,KU(),QU())};var t7=Object.freeze({__proto__:null,render:Gb,hydrate:e3,createApp:tE,createSSRApp:ZU,initDirectivesForSSR:e7,defineCustomElement:FR,defineSSRCustomElement:OU,VueElement:Tm,useCssModule:PU,useCssVars:LU,Transition:Gd,TransitionGroup:GR,vModelText:s0,vModelCheckbox:Qw,vModelRadio:Zw,vModelSelect:WR,vModelDynamic:YR,withModifiers:XU,withKeys:JU,vShow:eE,reactive:js,ref:rl,readonly:Tw,unref:nl,proxyRefs:Wh,isRef:kr,toRef:TC,toRefs:c$,isProxy:kw,isReactive:wo,isReadonly:Al,isShallow:Aw,customRef:u$,triggerRef:s$,shallowRef:SC,shallowReactive:xC,shallowReadonly:n$,markRaw:Mw,toRaw:It,effect:RB,stop:NB,ReactiveEffect:jd,effectScope:TB,EffectScope:xw,getCurrentScope:AB,onScopeDispose:kB,computed:Mi,watch:ol,watchEffect:U$,watchPostEffect:FC,watchSyncEffect:q$,onBeforeMount:WC,onMounted:Kd,onBeforeUpdate:XC,onUpdated:_m,onBeforeUnmount:ed,onUnmounted:td,onActivated:HC,onDeactivated:KC,onRenderTracked:QC,onRenderTriggered:JC,onErrorCaptured:ZC,onServerPrefetch:YC,provide:xh,inject:Wn,nextTick:nf,defineComponent:zd,defineAsyncComponent:xg,useAttrs:nU,useSlots:rU,defineProps:QF,defineEmits:ZF,defineExpose:eU,withDefaults:tU,mergeDefaults:iU,createPropsRestProxy:sU,withAsyncContext:oU,getCurrentInstance:Qs,h:Im,createVNode:Xt,cloneVNode:Mo,mergeProps:Sm,isVNode:hi,Fragment:Jt,Text:Ml,Comment:Sn,Static:Uu,Teleport:yF,Suspense:P$,KeepAlive:zC,BaseTransition:zw,withDirectives:cR,useSSRContext:aU,ssrContextKey:PR,createRenderer:hR,createHydrationRenderer:dR,queuePostFlushCb:Dw,warn:AC,handleError:bc,callWithErrorHandling:ss,callWithAsyncErrorHandling:Gn,resolveComponent:wF,resolveDirective:mR,resolveDynamicComponent:Zg,registerRuntimeCompiler:GF,isRuntimeOnly:Vb,useTransitionState:Vw,resolveTransitionHooks:kl,setTransitionHooks:Xu,getTransitionRawChildren:vm,initCustomFormatter:uU,get devtools(){return zc},setDevtoolsHook:OC,withCtx:Jh,pushScopeId:LC,popScopeId:BC,withScopeId:k$,renderList:es,toHandlers:MR,renderSlot:AR,createSlots:TR,withMemo:cU,isMemoSame:LR,openBlock:Kt,createBlock:rd,setBlockTracking:$b,createTextVNode:po,createCommentVNode:t0,createStaticVNode:CF,createElementVNode:Ir,createElementBlock:sr,guardReactiveProps:SR,toDisplayString:sa,camelize:Xn,capitalize:qd,toHandlerKey:tl,normalizeProps:vB,normalizeClass:as,normalizeStyle:si,transformVNodeArgs:kF,version:BR,ssrUtils:fU,resolveFilter:hU,compatUtils:Vs});function r7(...t){const e=tE(...t);return Vs.isCompatEnabled("RENDER_FUNCTION",null)&&(e.component("__compat__transition",Gd),e.component("__compat__transition-group",GR),e.component("__compat__keep-alive",zC),e._context.directives.show=eE,e._context.directives.model=YR),e}function n7(){const t=Vs.createCompatVue(tE,r7);return wt(t,t7),t}const i7=n7();i7.compile=()=>{};var s7={exports:{}};/** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=ut:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,u=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",c="0123456789abcdef".split(""),l=[31,7936,2031616,520093696],h=[4,1024,262144,67108864],d=[1,256,65536,16777216],_=[6,1536,393216,100663296],T=[0,8,16,24],D=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],N=[224,256,384,512],O=[128,256],L=["hex","buffer","arrayBuffer","array","digest"],J={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(x){return Object.prototype.toString.call(x)==="[object Array]"}),u&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(x){return typeof x=="object"&&x.buffer&&x.buffer.constructor===ArrayBuffer});for(var q=function(x,k,R){return function(j){return new w(x,k,x).update(j)[R]()}},z=function(x,k,R){return function(j,Q){return new w(x,k,Q).update(j)[R]()}},ee=function(x,k,R){return function(j,Q,oe,fe){return f["cshake"+x].update(j,Q,oe,fe)[R]()}},G=function(x,k,R){return function(j,Q,oe,fe){return f["kmac"+x].update(j,Q,oe,fe)[R]()}},ne=function(x,k,R,j){for(var Q=0;Q>5,this.byteCount=this.blockCount<<2,this.outputBlocks=R>>5,this.extraBytes=(R&31)>>3;for(var j=0;j<50;++j)this.s[j]=0}w.prototype.update=function(x){if(this.finalized)throw new Error(r);var k,R=typeof x;if(R!=="string"){if(R==="object"){if(x===null)throw new Error(e);if(u&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!u||!ArrayBuffer.isView(x)))throw new Error(e)}else throw new Error(e);k=!0}for(var j=this.blocks,Q=this.byteCount,oe=x.length,fe=this.blockCount,ie=0,$=this.s,V,Y;ie>2]|=x[ie]<>2]|=Y<>2]|=(192|Y>>6)<>2]|=(128|Y&63)<=57344?(j[V>>2]|=(224|Y>>12)<>2]|=(128|Y>>6&63)<>2]|=(128|Y&63)<>2]|=(240|Y>>18)<>2]|=(128|Y>>12&63)<>2]|=(128|Y>>6&63)<>2]|=(128|Y&63)<=Q){for(this.start=V-Q,this.block=j[fe],V=0;V>8,R=x&255;R>0;)Q.unshift(R),x=x>>8,R=x&255,++j;return k?Q.push(j):Q.unshift(j),this.update(Q),Q.length},w.prototype.encodeString=function(x){var k,R=typeof x;if(R!=="string"){if(R==="object"){if(x===null)throw new Error(e);if(u&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!u||!ArrayBuffer.isView(x)))throw new Error(e)}else throw new Error(e);k=!0}var j=0,Q=x.length;if(k)j=Q;else for(var oe=0;oe=57344?j+=3:(fe=65536+((fe&1023)<<10|x.charCodeAt(++oe)&1023),j+=4)}return j+=this.encode(j*8),this.update(x),j},w.prototype.bytepad=function(x,k){for(var R=this.encode(k),j=0;j>2]|=this.padding[k&3],this.lastByteIndex===this.byteCount)for(x[0]=x[R],k=1;k>4&15]+c[ie&15]+c[ie>>12&15]+c[ie>>8&15]+c[ie>>20&15]+c[ie>>16&15]+c[ie>>28&15]+c[ie>>24&15];oe%x===0&&(me(k),Q=0)}return j&&(ie=k[Q],fe+=c[ie>>4&15]+c[ie&15],j>1&&(fe+=c[ie>>12&15]+c[ie>>8&15]),j>2&&(fe+=c[ie>>20&15]+c[ie>>16&15])),fe},w.prototype.arrayBuffer=function(){this.finalize();var x=this.blockCount,k=this.s,R=this.outputBlocks,j=this.extraBytes,Q=0,oe=0,fe=this.outputBits>>3,ie;j?ie=new ArrayBuffer(R+1<<2):ie=new ArrayBuffer(fe);for(var $=new Uint32Array(ie);oe>8&255,fe[ie+2]=$>>16&255,fe[ie+3]=$>>24&255;oe%x===0&&me(k)}return j&&(ie=oe<<2,$=k[Q],fe[ie]=$&255,j>1&&(fe[ie+1]=$>>8&255),j>2&&(fe[ie+2]=$>>16&255)),fe};function U(x,k,R){w.call(this,x,k,R)}U.prototype=new w,U.prototype.finalize=function(){return this.encode(this.outputBits,!0),w.prototype.finalize.call(this)};var me=function(x){var k,R,j,Q,oe,fe,ie,$,V,Y,ce,ae,le,ve,Ee,pe,ge,Oe,Te,Ce,De,C,b,E,P,W,re,te,be,qe,Me,Ue,je,Ze,xt,mt,Ye,At,Bt,nt,Ht,$t,Je,Nt,Ft,et,Ot,Dt,it,Ut,qt,tt,Ct,jt,st,Vt,St,Pt,In,Cr,Fn,Tn,un;for(j=0;j<48;j+=2)Q=x[0]^x[10]^x[20]^x[30]^x[40],oe=x[1]^x[11]^x[21]^x[31]^x[41],fe=x[2]^x[12]^x[22]^x[32]^x[42],ie=x[3]^x[13]^x[23]^x[33]^x[43],$=x[4]^x[14]^x[24]^x[34]^x[44],V=x[5]^x[15]^x[25]^x[35]^x[45],Y=x[6]^x[16]^x[26]^x[36]^x[46],ce=x[7]^x[17]^x[27]^x[37]^x[47],ae=x[8]^x[18]^x[28]^x[38]^x[48],le=x[9]^x[19]^x[29]^x[39]^x[49],k=ae^(fe<<1|ie>>>31),R=le^(ie<<1|fe>>>31),x[0]^=k,x[1]^=R,x[10]^=k,x[11]^=R,x[20]^=k,x[21]^=R,x[30]^=k,x[31]^=R,x[40]^=k,x[41]^=R,k=Q^($<<1|V>>>31),R=oe^(V<<1|$>>>31),x[2]^=k,x[3]^=R,x[12]^=k,x[13]^=R,x[22]^=k,x[23]^=R,x[32]^=k,x[33]^=R,x[42]^=k,x[43]^=R,k=fe^(Y<<1|ce>>>31),R=ie^(ce<<1|Y>>>31),x[4]^=k,x[5]^=R,x[14]^=k,x[15]^=R,x[24]^=k,x[25]^=R,x[34]^=k,x[35]^=R,x[44]^=k,x[45]^=R,k=$^(ae<<1|le>>>31),R=V^(le<<1|ae>>>31),x[6]^=k,x[7]^=R,x[16]^=k,x[17]^=R,x[26]^=k,x[27]^=R,x[36]^=k,x[37]^=R,x[46]^=k,x[47]^=R,k=Y^(Q<<1|oe>>>31),R=ce^(oe<<1|Q>>>31),x[8]^=k,x[9]^=R,x[18]^=k,x[19]^=R,x[28]^=k,x[29]^=R,x[38]^=k,x[39]^=R,x[48]^=k,x[49]^=R,ve=x[0],Ee=x[1],et=x[11]<<4|x[10]>>>28,Ot=x[10]<<4|x[11]>>>28,te=x[20]<<3|x[21]>>>29,be=x[21]<<3|x[20]>>>29,Cr=x[31]<<9|x[30]>>>23,Fn=x[30]<<9|x[31]>>>23,$t=x[40]<<18|x[41]>>>14,Je=x[41]<<18|x[40]>>>14,Ze=x[2]<<1|x[3]>>>31,xt=x[3]<<1|x[2]>>>31,pe=x[13]<<12|x[12]>>>20,ge=x[12]<<12|x[13]>>>20,Dt=x[22]<<10|x[23]>>>22,it=x[23]<<10|x[22]>>>22,qe=x[33]<<13|x[32]>>>19,Me=x[32]<<13|x[33]>>>19,Tn=x[42]<<2|x[43]>>>30,un=x[43]<<2|x[42]>>>30,jt=x[5]<<30|x[4]>>>2,st=x[4]<<30|x[5]>>>2,mt=x[14]<<6|x[15]>>>26,Ye=x[15]<<6|x[14]>>>26,Oe=x[25]<<11|x[24]>>>21,Te=x[24]<<11|x[25]>>>21,Ut=x[34]<<15|x[35]>>>17,qt=x[35]<<15|x[34]>>>17,Ue=x[45]<<29|x[44]>>>3,je=x[44]<<29|x[45]>>>3,E=x[6]<<28|x[7]>>>4,P=x[7]<<28|x[6]>>>4,Vt=x[17]<<23|x[16]>>>9,St=x[16]<<23|x[17]>>>9,At=x[26]<<25|x[27]>>>7,Bt=x[27]<<25|x[26]>>>7,Ce=x[36]<<21|x[37]>>>11,De=x[37]<<21|x[36]>>>11,tt=x[47]<<24|x[46]>>>8,Ct=x[46]<<24|x[47]>>>8,Nt=x[8]<<27|x[9]>>>5,Ft=x[9]<<27|x[8]>>>5,W=x[18]<<20|x[19]>>>12,re=x[19]<<20|x[18]>>>12,Pt=x[29]<<7|x[28]>>>25,In=x[28]<<7|x[29]>>>25,nt=x[38]<<8|x[39]>>>24,Ht=x[39]<<8|x[38]>>>24,C=x[48]<<14|x[49]>>>18,b=x[49]<<14|x[48]>>>18,x[0]=ve^~pe&Oe,x[1]=Ee^~ge&Te,x[10]=E^~W&te,x[11]=P^~re&be,x[20]=Ze^~mt&At,x[21]=xt^~Ye&Bt,x[30]=Nt^~et&Dt,x[31]=Ft^~Ot&it,x[40]=jt^~Vt&Pt,x[41]=st^~St&In,x[2]=pe^~Oe&Ce,x[3]=ge^~Te&De,x[12]=W^~te&qe,x[13]=re^~be&Me,x[22]=mt^~At&nt,x[23]=Ye^~Bt&Ht,x[32]=et^~Dt&Ut,x[33]=Ot^~it&qt,x[42]=Vt^~Pt&Cr,x[43]=St^~In&Fn,x[4]=Oe^~Ce&C,x[5]=Te^~De&b,x[14]=te^~qe&Ue,x[15]=be^~Me&je,x[24]=At^~nt&$t,x[25]=Bt^~Ht&Je,x[34]=Dt^~Ut&tt,x[35]=it^~qt&Ct,x[44]=Pt^~Cr&Tn,x[45]=In^~Fn&un,x[6]=Ce^~C&ve,x[7]=De^~b&Ee,x[16]=qe^~Ue&E,x[17]=Me^~je&P,x[26]=nt^~$t&Ze,x[27]=Ht^~Je&xt,x[36]=Ut^~tt&Nt,x[37]=qt^~Ct&Ft,x[46]=Cr^~Tn&jt,x[47]=Fn^~un&st,x[8]=C^~ve&pe,x[9]=b^~Ee&ge,x[18]=Ue^~E&W,x[19]=je^~P&re,x[28]=$t^~Ze&mt,x[29]=Je^~xt&Ye,x[38]=tt^~Nt&et,x[39]=Ct^~Ft&Ot,x[48]=Tn^~jt&Vt,x[49]=un^~st&St,x[0]^=D[j],x[1]^=D[j+1]};if(a)t.exports=f;else for(y=0;ym.parts.length&&(g.parts.length=m.parts.length)}else{var p=[];for(f=0;f component must be present on the page.")};k.prototype.$modal={show:function(ie){for(var $=arguments.length,V=new Array(1<$?$-1:0),Y=1;Y<$;Y++)V[Y-1]=arguments[Y];switch(S(ie)){case"string":return function(ce,ae){me.event.$emit("toggle",ce,!0,ae)}.apply(void 0,[ie].concat(V));case"object":case"function":return j.dynamic?fe.apply(void 0,[ie].concat(V)):console.warn("[vue-js-modal] $modal() received object as a first argument, but dynamic modals are switched off. https://github.com/euvl/vue-js-modal/#dynamic-modals");default:console.warn("[vue-js-modal] $modal() received an unsupported argument as a first argument.",ie)}},hide:function(ie,$){me.event.$emit("toggle",ie,!1,$)},toggle:function(ie,$){me.event.$emit("toggle",ie,void 0,$)}},k.component(Q,g),j.dialog&&k.component("VDialog",I),j.dynamic&&(k.component("ModalsContainer",v),k.mixin({beforeMount:function(){me.rootInstance===null&&(me.rootInstance=this.$root)}}))}}},x=o.default=me}],r.c=i,r.d=function(s,o,a){r.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:a})},r.r=function(s){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,o){if(1&o&&(s=r(s)),8&o||4&o&&typeof s=="object"&&s&&s.__esModule)return s;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:s}),2&o&&typeof s!="string")for(var u in s)r.d(a,u,function(c){return s[c]}.bind(null,u));return a},r.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(o,"a",o),o},r.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},r.p="/dist/",r(r.s=11);function r(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var n,i})})(r3);var bde=n5(r3.exports),Ia={DEBUG:!1,LIB_VERSION:"2.45.0"},_n;if(typeof window=="undefined"){var h2={hostname:""};_n={navigator:{userAgent:""},document:{location:h2,referrer:""},screen:{width:0,height:0},location:h2}}else _n=window;var Am=Array.prototype,o7=Function.prototype,n3=Object.prototype,ya=Am.slice,Wd=n3.toString,km=n3.hasOwnProperty,Er=_n.console,fo=_n.navigator,nr=_n.document,Lf=_n.opera,o0=_n.screen,ts=fo.userAgent,t_=o7.bind,d2=Am.forEach,p2=Am.indexOf,g2=Am.map,a7=Array.isArray,Wb={},B={trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},Qt={log:function(){if(Ia.DEBUG&&!B.isUndefined(Er)&&Er)try{Er.log.apply(Er,arguments)}catch{B.each(arguments,function(e){Er.log(e)})}},warn:function(){if(Ia.DEBUG&&!B.isUndefined(Er)&&Er){var t=["Mixpanel warning:"].concat(B.toArray(arguments));try{Er.warn.apply(Er,t)}catch{B.each(t,function(r){Er.warn(r)})}}},error:function(){if(Ia.DEBUG&&!B.isUndefined(Er)&&Er){var t=["Mixpanel error:"].concat(B.toArray(arguments));try{Er.error.apply(Er,t)}catch{B.each(t,function(r){Er.error(r)})}}},critical:function(){if(!B.isUndefined(Er)&&Er){var t=["Mixpanel error:"].concat(B.toArray(arguments));try{Er.error.apply(Er,t)}catch{B.each(t,function(r){Er.error(r)})}}}},r_=function(t,e){return function(){return arguments[0]="["+e+"] "+arguments[0],t.apply(Qt,arguments)}},rE=function(t){return{log:r_(Qt.log,t),error:r_(Qt.error,t),critical:r_(Qt.critical,t)}};B.bind=function(t,e){var r,n;if(t_&&t.bind===t_)return t_.apply(t,ya.call(arguments,1));if(!B.isFunction(t))throw new TypeError;return r=ya.call(arguments,2),n=function(){if(!(this instanceof n))return t.apply(e,r.concat(ya.call(arguments)));var i={};i.prototype=t.prototype;var s=new i;i.prototype=null;var o=t.apply(s,r.concat(ya.call(arguments)));return Object(o)===o?o:s},n};B.each=function(t,e,r){if(t!=null){if(d2&&t.forEach===d2)t.forEach(e,r);else if(t.length===+t.length){for(var n=0,i=t.length;n0&&(e[n]=r)}),e};B.truncate=function(t,e){var r;return typeof t=="string"?r=t.slice(0,e):B.isArray(t)?(r=[],B.each(t,function(n){r.push(B.truncate(n,e))})):B.isObject(t)?(r={},B.each(t,function(n,i){r[i]=B.truncate(n,e)})):r=t,r};B.JSONEncode=function(){return function(t){var e=t,r=function(i){var s=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return s.lastIndex=0,s.test(i)?'"'+i.replace(s,function(a){var u=o[a];return typeof u=="string"?u:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,s){var o="",a=" ",u=0,c="",l="",h=0,d=o,_=[],T=s[i];switch(T&&typeof T=="object"&&typeof T.toJSON=="function"&&(T=T.toJSON(i)),typeof T){case"string":return r(T);case"number":return isFinite(T)?String(T):"null";case"boolean":case"null":return String(T);case"object":if(!T)return"null";if(o+=a,_=[],Wd.apply(T)==="[object Array]"){for(h=T.length,u=0;u="0"&&e<="9";)T+=e,s();if(e===".")for(T+=".";s()&&e>="0"&&e<="9";)T+=e;if(e==="e"||e==="E")for(T+=e,s(),(e==="-"||e==="+")&&(T+=e,s());e>="0"&&e<="9";)T+=e,s();if(_=+T,!isFinite(_))i("Bad number");else return _},a=function(){var _,T,D="",N;if(e==='"')for(;s();){if(e==='"')return s(),D;if(e==="\\")if(s(),e==="u"){for(N=0,T=0;T<4&&(_=parseInt(s(),16),!!isFinite(_));T+=1)N=N*16+_;D+=String.fromCharCode(N)}else if(typeof r[e]=="string")D+=r[e];else break;else D+=e}i("Bad string")},u=function(){for(;e&&e<=" ";)s()},c=function(){switch(e){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}i('Unexpected "'+e+'"')},l,h=function(){var _=[];if(e==="["){if(s("["),u(),e==="]")return s("]"),_;for(;e;){if(_.push(l()),u(),e==="]")return s("]"),_;s(","),u()}}i("Bad array")},d=function(){var _,T={};if(e==="{"){if(s("{"),u(),e==="}")return s("}"),T;for(;e;){if(_=a(),u(),s(":"),Object.hasOwnProperty.call(T,_)&&i('Duplicate key "'+_+'"'),T[_]=l(),u(),e==="}")return s("}"),T;s(","),u()}}i("Bad object")};return l=function(){switch(u(),e){case"{":return d();case"[":return h();case'"':return a();case"-":return o();default:return e>="0"&&e<="9"?o():c()}},function(_){var T;return n=_,t=0,e=" ",T=l(),u(),e&&i("Syntax error"),T}}();B.base64Encode=function(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,n,i,s,o,a,u,c,l=0,h=0,d="",_=[];if(!t)return t;t=B.utf8Encode(t);do r=t.charCodeAt(l++),n=t.charCodeAt(l++),i=t.charCodeAt(l++),c=r<<16|n<<8|i,s=c>>18&63,o=c>>12&63,a=c>>6&63,u=c&63,_[h++]=e.charAt(s)+e.charAt(o)+e.charAt(a)+e.charAt(u);while(l127&&o<2048?a=String.fromCharCode(o>>6|192,o&63|128):a=String.fromCharCode(o>>12|224,o>>6&63|128,o&63|128),a!==null&&(n>r&&(e+=t.substring(r,n)),e+=a,r=n=s+1)}return n>r&&(e+=t.substring(r,t.length)),e};B.UUID=function(){var t=function(){for(var n=1*new Date,i=0;n==1*new Date;)i++;return n.toString(16)+i.toString(16)},e=function(){return Math.random().toString(16).replace(".","")},r=function(){var n=ts,i,s,o=[],a=0;function u(c,l){var h,d=0;for(h=0;h=4&&(a=u(a,o),o=[]);return o.length>0&&(a=u(a,o)),a.toString(16)};return function(){var n=(o0.height*o0.width).toString(16);return t()+"-"+e()+"-"+r()+"-"+n+"-"+t()}}();var m2=["ahrefsbot","baiduspider","bingbot","bingpreview","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];B.isBlockedUA=function(t){var e;for(t=t.toLowerCase(),e=0;e=0}function n(i){if(!nr.getElementsByTagName)return[];var s=i.split(" "),o,a,u,c,l,h,d,_,T,D,N=[nr];for(h=0;h-1){a=o.split("#"),u=a[0];var O=a[1],L=nr.getElementById(O);if(!L||u&&L.nodeName.toLowerCase()!=u)return[];N=[L];continue}if(o.indexOf(".")>-1){a=o.split("."),u=a[0];var J=a[1];for(u||(u="*"),c=[],l=0,d=0;d-1};break;default:ne=function(ue){return ue.getAttribute(z)}}for(N=[],D=0,d=0;d=3?e[2]:""},properties:function(){return B.extend(B.strip_empty_properties({$os:B.info.os(),$browser:B.info.browser(ts,fo.vendor,Lf),$referrer:nr.referrer,$referring_domain:B.info.referringDomain(nr.referrer),$device:B.info.device(ts)}),{$current_url:_n.location.href,$browser_version:B.info.browserVersion(ts,fo.vendor,Lf),$screen_height:o0.height,$screen_width:o0.width,mp_lib:"web",$lib_version:Ia.LIB_VERSION,$insert_id:nE(),time:B.timestamp()/1e3})},people_properties:function(){return B.extend(B.strip_empty_properties({$os:B.info.os(),$browser:B.info.browser(ts,fo.vendor,Lf)}),{$browser_version:B.info.browserVersion(ts,fo.vendor,Lf)})},pageviewInfo:function(t){return B.strip_empty_properties({mp_page:t,mp_referrer:nr.referrer,mp_browser:B.info.browser(ts,fo.vendor,Lf),mp_platform:B.info.os()})}};var nE=function(t){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return t?e.substring(0,t):e},c7=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,l7=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,v2=function(t){var e=l7,r=t.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(e=c7);var i=t.match(e);return i?i[0]:""},u0=null,c0=null;typeof JSON!="undefined"&&(u0=JSON.stringify,c0=JSON.parse);u0=u0||B.JSONEncode;c0=c0||B.JSONDecode;B.toArray=B.toArray;B.isObject=B.isObject;B.JSONEncode=B.JSONEncode;B.JSONDecode=B.JSONDecode;B.isBlockedUA=B.isBlockedUA;B.isEmptyObject=B.isEmptyObject;B.info=B.info;B.info.device=B.info.device;B.info.browser=B.info.browser;B.info.browserVersion=B.info.browserVersion;B.info.properties=B.info.properties;var Vo=function(){};Vo.prototype.create_properties=function(){};Vo.prototype.event_handler=function(){};Vo.prototype.after_track_handler=function(){};Vo.prototype.init=function(t){return this.mp=t,this};Vo.prototype.track=function(t,e,r,n){var i=this,s=B.dom_query(t);if(s.length===0){Qt.error("The DOM query ("+t+") returned 0 elements");return}return B.each(s,function(o){B.register_event(o,this.override_event,function(a){var u={},c=i.create_properties(r,this),l=i.mp.get_config("track_links_timeout");i.event_handler(a,this,u),window.setTimeout(i.track_callback(n,c,u,!0),l),i.mp.track(e,c,i.track_callback(n,c,u))})},this),!0};Vo.prototype.track_callback=function(t,e,r,n){n=n||!1;var i=this;return function(){r.callback_fired||(r.callback_fired=!0,!(t&&t(n,e)===!1)&&i.after_track_handler(e,r,n))}};Vo.prototype.create_properties=function(t,e){var r;return typeof t=="function"?r=t(e):r=B.extend({},t),r};var Ol=function(){this.override_event="click"};B.inherit(Ol,Vo);Ol.prototype.create_properties=function(t,e){var r=Ol.superclass.create_properties.apply(this,arguments);return e.href&&(r.url=e.href),r};Ol.prototype.event_handler=function(t,e,r){r.new_tab=t.which===2||t.metaKey||t.ctrlKey||e.target==="_blank",r.href=e.href,r.new_tab||t.preventDefault()};Ol.prototype.after_track_handler=function(t,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var Mm=function(){this.override_event="submit"};B.inherit(Mm,Vo);Mm.prototype.event_handler=function(t,e,r){r.element=e,t.preventDefault()};Mm.prototype.after_track_handler=function(t,e){setTimeout(function(){e.element.submit()},0)};var f7=rE("lock"),i3=function(t,e){e=e||{},this.storageKey=t,this.storage=e.storage||window.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3};i3.prototype.withLock=function(t,e,r){!r&&typeof e!="function"&&(r=e,e=null);var n=r||new Date().getTime()+"|"+Math.random(),i=new Date().getTime(),s=this.storageKey,o=this.pollIntervalMS,a=this.timeoutMS,u=this.storage,c=s+":X",l=s+":Y",h=s+":Z",d=function(L){e&&e(L)},_=function(L){if(new Date().getTime()-i>a){f7.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+n+"]"),u.removeItem(h),u.removeItem(l),N();return}setTimeout(function(){try{L()}catch(J){d(J)}},o*(Math.random()+.1))},T=function(L,J){L()?J():_(function(){T(L,J)})},D=function(){var L=u.getItem(l);if(L&&L!==n)return!1;if(u.setItem(l,n),u.getItem(l)===n)return!0;if(!a0(u,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},N=function(){u.setItem(c,n),T(D,function(){if(u.getItem(c)===n){O();return}_(function(){if(u.getItem(l)!==n){N();return}T(function(){return!u.getItem(h)},O)})})},O=function(){u.setItem(h,"1");try{t()}finally{u.removeItem(h),u.getItem(l)===n&&u.removeItem(l),u.getItem(c)===n&&u.removeItem(c)}};try{if(a0(u,!0))N();else throw new Error("localStorage support check failed")}catch(L){d(L)}};var y2=rE("batch"),Ka=function(t,e){e=e||{},this.storageKey=t,this.storage=e.storage||window.localStorage,this.reportError=e.errorReporter||B.bind(y2.error,y2),this.lock=new i3(t,{storage:this.storage}),this.pid=e.pid||null,this.memQueue=[]};Ka.prototype.enqueue=function(t,e,r){var n={id:nE(),flushAfter:new Date().getTime()+e*2,payload:t};this.lock.withLock(B.bind(function(){var s;try{var o=this.readFromStorage();o.push(n),s=this.saveToStorage(o),s&&this.memQueue.push(n)}catch{this.reportError("Error enqueueing item",t),s=!1}r&&r(s)},this),B.bind(function(s){this.reportError("Error acquiring storage lock",s),r&&r(!1)},this),this.pid)};Ka.prototype.fillBatch=function(t){var e=this.memQueue.slice(0,t);if(e.lengths.flushAfter&&!n[s.id]&&(s.orphaned=!0,e.push(s),e.length>=t))break}}}return e};var _2=function(t,e){var r=[];return B.each(t,function(n){n.id&&!e[n.id]&&r.push(n)}),r};Ka.prototype.removeItemsByID=function(t,e){var r={};B.each(t,function(i){r[i]=!0}),this.memQueue=_2(this.memQueue,r);var n=B.bind(function(){var i;try{var s=this.readFromStorage();if(s=_2(s,r),i=this.saveToStorage(s),i){s=this.readFromStorage();for(var o=0;o=e)this.reportError("Network timeout; retrying"),this.flush();else if(B.isObject(c)&&c.xhr_req&&(c.xhr_req.status>=500||c.xhr_req.status===429||c.error==="timeout")){var h=this.flushInterval*2,d=c.xhr_req.responseHeaders;if(d){var _=d["Retry-After"];_&&(h=parseInt(_,10)*1e3||h)}h=Math.min(h7,h),this.reportError("Error; retry in "+h+" ms"),this.scheduleFlush(h)}else if(B.isObject(c)&&c.xhr_req&&c.xhr_req.status===413)if(i.length>1){var T=Math.max(1,Math.floor(n/2));this.batchSize=Math.min(this.batchSize,T,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),l=!0;else l=!0;l&&this.queue.removeItemsByID(B.map(i,function(D){return D.id}),B.bind(function(D){D?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this))}catch(D){this.reportError("Error handling API response",D),this.resetFlush()}},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};t.unloading&&(u.transport="sendBeacon"),Ah.log("MIXPANEL REQUEST:",s),this.sendRequest(s,u,a)}catch(c){this.reportError("Error flushing request queue",c),this.resetFlush()}};Zs.prototype.reportError=function(t,e){if(Ah.error.apply(Ah.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(t)),this.errorReporter(t,e)}catch(r){Ah.error(r)}};var d7="__mp_opt_in_out_";function p7(t,e){a3(!0,t,e)}function g7(t,e){a3(!1,t,e)}function m7(t,e){return o3(t,e)==="1"}function s3(t,e){if(y7(e))return Qt.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=o3(t,e)==="0";return r&&Qt.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function Xd(t){return oE(t,function(e){return this.get_config(e)})}function Ga(t){return oE(t,function(e){return this._get_config(e)})}function sf(t){return oE(t,function(e){return this._get_config(e)})}function v7(t,e){e=e||{},iE(e).remove(sE(t,e),!!e.crossSubdomainCookie,e.cookieDomain)}function iE(t){return t=t||{},t.persistenceType==="localStorage"?B.localStorage:B.cookie}function sE(t,e){return e=e||{},(e.persistencePrefix||d7)+t}function o3(t,e){return iE(e).get(sE(t,e))}function y7(t){if(t&&t.ignoreDnt)return!1;var e=t&&t.window||_n,r=e.navigator||{},n=!1;return B.each([r.doNotTrack,r.msDoNotTrack,e.doNotTrack],function(i){B.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function a3(t,e,r){if(!B.isString(e)||!e.length){Qt.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token");return}r=r||{},iE(r).set(sE(e,r),t?1:0,B.isNumber(r.cookieExpiration)?r.cookieExpiration:null,!!r.crossSubdomainCookie,!!r.secureCookie,!!r.crossSiteCookie,r.cookieDomain),r.track&&t&&r.track(r.trackEventName||"$opt_in",r.trackProperties,{send_immediately:!0})}function oE(t,e){return function(){var r=!1;try{var n=e.call(this,"token"),i=e.call(this,"ignore_dnt"),s=e.call(this,"opt_out_tracking_persistence_type"),o=e.call(this,"opt_out_tracking_cookie_prefix"),a=e.call(this,"window");n&&(r=s3(n,{ignoreDnt:i,persistenceType:s,persistencePrefix:o,window:a}))}catch(c){Qt.error("Unexpected error when checking tracking opt-out status: "+c)}if(!r)return t.apply(this,arguments);var u=arguments[arguments.length-1];typeof u=="function"&&u(0)}}var Pa="$set",Dl="$set_once",rs="$unset",Yu="$add",Co="$append",Ju="$union",La="$remove",_7="$delete",u3={set_action:function(t,e){var r={},n={};return B.isObject(t)?B.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[Pa]=n,r},unset_action:function(t){var e={},r=[];return B.isArray(t)||(t=[t]),B.each(t,function(n){this._is_reserved_property(n)||r.push(n)},this),e[rs]=r,e},set_once_action:function(t,e){var r={},n={};return B.isObject(t)?B.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[Dl]=n,r},union_action:function(t,e){var r={},n={};return B.isObject(t)?B.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=B.isArray(i)?i:[i])},this):n[t]=B.isArray(e)?e:[e],r[Ju]=n,r},append_action:function(t,e){var r={},n={};return B.isObject(t)?B.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[Co]=n,r},remove_action:function(t,e){var r={},n={};return B.isObject(t)?B.each(t,function(i,s){this._is_reserved_property(s)||(n[s]=i)},this):n[t]=e,r[La]=n,r},delete_action:function(){var t={};return t[_7]="",t}},cr=function(){};B.extend(cr.prototype,u3);cr.prototype._init=function(t,e,r){this._mixpanel=t,this._group_key=e,this._group_id=r};cr.prototype.set=sf(function(t,e,r){var n=this.set_action(t,e);return B.isObject(t)&&(r=e),this._send_request(n,r)});cr.prototype.set_once=sf(function(t,e,r){var n=this.set_once_action(t,e);return B.isObject(t)&&(r=e),this._send_request(n,r)});cr.prototype.unset=sf(function(t,e){var r=this.unset_action(t);return this._send_request(r,e)});cr.prototype.union=sf(function(t,e,r){B.isObject(t)&&(r=e);var n=this.union_action(t,e);return this._send_request(n,r)});cr.prototype.delete=sf(function(t){var e=this.delete_action();return this._send_request(e,t)});cr.prototype.remove=sf(function(t,e,r){var n=this.remove_action(t,e);return this._send_request(n,r)});cr.prototype._send_request=function(t,e){t.$group_key=this._group_key,t.$group_id=this._group_id,t.$token=this._get_config("token");var r=B.encodeDates(t);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._get_config("api_host")+"/groups/",batcher:this._mixpanel.request_batchers.groups},e)};cr.prototype._is_reserved_property=function(t){return t==="$group_key"||t==="$group_id"};cr.prototype._get_config=function(t){return this._mixpanel.get_config(t)};cr.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id};cr.prototype.remove=cr.prototype.remove;cr.prototype.set=cr.prototype.set;cr.prototype.set_once=cr.prototype.set_once;cr.prototype.union=cr.prototype.union;cr.prototype.unset=cr.prototype.unset;cr.prototype.toString=cr.prototype.toString;var dt=function(){};B.extend(dt.prototype,u3);dt.prototype._init=function(t){this._mixpanel=t};dt.prototype.set=Ga(function(t,e,r){var n=this.set_action(t,e);return B.isObject(t)&&(r=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),n[Pa]=B.extend({},B.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),n[Pa]),this._send_request(n,r)});dt.prototype.set_once=Ga(function(t,e,r){var n=this.set_once_action(t,e);return B.isObject(t)&&(r=e),this._send_request(n,r)});dt.prototype.unset=Ga(function(t,e){var r=this.unset_action(t);return this._send_request(r,e)});dt.prototype.increment=Ga(function(t,e,r){var n={},i={};return B.isObject(t)?(B.each(t,function(s,o){if(!this._is_reserved_property(o))if(isNaN(parseFloat(s))){Qt.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[o]=s},this),r=e):(B.isUndefined(e)&&(e=1),i[t]=e),n[Yu]=i,this._send_request(n,r)});dt.prototype.append=Ga(function(t,e,r){B.isObject(t)&&(r=e);var n=this.append_action(t,e);return this._send_request(n,r)});dt.prototype.remove=Ga(function(t,e,r){B.isObject(t)&&(r=e);var n=this.remove_action(t,e);return this._send_request(n,r)});dt.prototype.union=Ga(function(t,e,r){B.isObject(t)&&(r=e);var n=this.union_action(t,e);return this._send_request(n,r)});dt.prototype.track_charge=Ga(function(t,e,r){if(!B.isNumber(t)&&(t=parseFloat(t),isNaN(t))){Qt.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",B.extend({$amount:t},e),r)});dt.prototype.clear_charges=function(t){return this.set("$transactions",[],t)};dt.prototype.delete_user=function(){if(!this._identify_called()){Qt.error("mixpanel.people.delete_user() requires you to call identify() first");return}var t={$delete:this._mixpanel.get_distinct_id()};return this._send_request(t)};dt.prototype.toString=function(){return this._mixpanel.toString()+".people"};dt.prototype._send_request=function(t,e){t.$token=this._get_config("token"),t.$distinct_id=this._mixpanel.get_distinct_id();var r=this._mixpanel.get_property("$device_id"),n=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");r&&(t.$device_id=r),n&&(t.$user_id=n),i&&(t.$had_persisted_distinct_id=i);var s=B.encodeDates(t);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:s,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(t),B.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),B.truncate(s,255))};dt.prototype._get_config=function(t){return this._mixpanel.get_config(t)};dt.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0};dt.prototype._enqueue=function(t){Pa in t?this._mixpanel.persistence._add_to_people_queue(Pa,t):Dl in t?this._mixpanel.persistence._add_to_people_queue(Dl,t):rs in t?this._mixpanel.persistence._add_to_people_queue(rs,t):Yu in t?this._mixpanel.persistence._add_to_people_queue(Yu,t):Co in t?this._mixpanel.persistence._add_to_people_queue(Co,t):La in t?this._mixpanel.persistence._add_to_people_queue(La,t):Ju in t?this._mixpanel.persistence._add_to_people_queue(Ju,t):Qt.error("Invalid call to _enqueue():",t)};dt.prototype._flush_one_queue=function(t,e,r,n){var i=this,s=B.extend({},this._mixpanel.persistence._get_queue(t)),o=s;!B.isUndefined(s)&&B.isObject(s)&&!B.isEmptyObject(s)&&(i._mixpanel.persistence._pop_from_people_queue(t,s),n&&(o=n(s)),e.call(i,o,function(a,u){a===0&&i._mixpanel.persistence._add_to_people_queue(t,s),B.isUndefined(r)||r(a,u)}))};dt.prototype._flush=function(t,e,r,n,i,s,o){var a=this,u=this._mixpanel.persistence._get_queue(Co),c=this._mixpanel.persistence._get_queue(La);if(this._flush_one_queue(Pa,this.set,t),this._flush_one_queue(Dl,this.set_once,n),this._flush_one_queue(rs,this.unset,s,function(N){return B.keys(N)}),this._flush_one_queue(Yu,this.increment,e),this._flush_one_queue(Ju,this.union,i),!B.isUndefined(u)&&B.isArray(u)&&u.length){for(var l,h=function(N,O){N===0&&a._mixpanel.persistence._add_to_people_queue(Co,l),B.isUndefined(r)||r(N,O)},d=u.length-1;d>=0;d--)l=u.pop(),B.isEmptyObject(l)||a.append(l,h);a._mixpanel.persistence.save()}if(!B.isUndefined(c)&&B.isArray(c)&&c.length){for(var _,T=function(N,O){N===0&&a._mixpanel.persistence._add_to_people_queue(La,_),B.isUndefined(o)||o(N,O)},D=c.length-1;D>=0;D--)_=c.pop(),B.isEmptyObject(_)||a.remove(_,T);a._mixpanel.persistence.save()}};dt.prototype._is_reserved_property=function(t){return t==="$distinct_id"||t==="$token"||t==="$device_id"||t==="$user_id"||t==="$had_persisted_distinct_id"};dt.prototype.set=dt.prototype.set;dt.prototype.set_once=dt.prototype.set_once;dt.prototype.unset=dt.prototype.unset;dt.prototype.increment=dt.prototype.increment;dt.prototype.append=dt.prototype.append;dt.prototype.remove=dt.prototype.remove;dt.prototype.union=dt.prototype.union;dt.prototype.track_charge=dt.prototype.track_charge;dt.prototype.clear_charges=dt.prototype.clear_charges;dt.prototype.delete_user=dt.prototype.delete_user;dt.prototype.toString=dt.prototype.toString;var aE="__mps",uE="__mpso",cE="__mpus",lE="__mpa",fE="__mpap",hE="__mpr",dE="__mpu",c3="$people_distinct_id",l0="__alias",id="__timers",b7=[aE,uE,cE,lE,fE,hE,dE,c3,l0,id],_t=function(t){this.props={},this.campaign_params_saved=!1,t.persistence_name?this.name="mp_"+t.persistence_name:this.name="mp_"+t.token+"_mixpanel";var e=t.persistence;e!=="cookie"&&e!=="localStorage"&&(Qt.critical("Unknown persistence type "+e+"; falling back to cookie"),e=t.persistence="cookie"),e==="localStorage"&&B.localStorage.is_supported()?this.storage=B.localStorage:this.storage=B.cookie,this.load(),this.update_config(t),this.upgrade(t),this.save()};_t.prototype.properties=function(){var t={};return B.each(this.props,function(e,r){B.include(b7,r)||(t[r]=e)}),t};_t.prototype.load=function(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=B.extend({},t))}};_t.prototype.upgrade=function(t){var e=t.upgrade,r,n;e&&(r="mp_super_properties",typeof e=="string"&&(r=e),n=this.storage.parse(r),this.storage.remove(r),this.storage.remove(r,!0),n&&(this.props=B.extend(this.props,n.all,n.events))),!t.cookie_name&&t.name!=="mixpanel"&&(r="mp_"+t.token+"_"+t.name,n=this.storage.parse(r),n&&(this.storage.remove(r),this.storage.remove(r,!0),this.register_once(n))),this.storage===B.localStorage&&(n=B.cookie.parse(this.name),B.cookie.remove(this.name),B.cookie.remove(this.name,!0),n&&this.register_once(n))};_t.prototype.save=function(){this.disabled||this.storage.set(this.name,B.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)};_t.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)};_t.prototype.clear=function(){this.remove(),this.props={}};_t.prototype.register_once=function(t,e,r){return B.isObject(t)?(typeof e=="undefined"&&(e="None"),this.expire_days=typeof r=="undefined"?this.default_expiry:r,B.each(t,function(n,i){(!this.props.hasOwnProperty(i)||this.props[i]===e)&&(this.props[i]=n)},this),this.save(),!0):!1};_t.prototype.register=function(t,e){return B.isObject(t)?(this.expire_days=typeof e=="undefined"?this.default_expiry:e,B.extend(this.props,t),this.save(),!0):!1};_t.prototype.unregister=function(t){t in this.props&&(delete this.props[t],this.save())};_t.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register_once(B.info.campaignParams()),this.campaign_params_saved=!0)};_t.prototype.update_search_keyword=function(t){this.register(B.info.searchInfo(t))};_t.prototype.update_referrer_info=function(t){this.register_once({$initial_referrer:t||"$direct",$initial_referring_domain:B.info.referringDomain(t)||"$direct"},"")};_t.prototype.get_referrer_info=function(){return B.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};_t.prototype.safe_merge=function(t){return B.each(this.props,function(e,r){r in t||(t[r]=e)}),t};_t.prototype.update_config=function(t){this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cookie_domain(t.cookie_domain),this.set_cross_site(t.cross_site_cookie),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie)};_t.prototype.set_disabled=function(t){this.disabled=t,this.disabled?this.remove():this.save()};_t.prototype.set_cookie_domain=function(t){t!==this.cookie_domain&&(this.remove(),this.cookie_domain=t,this.save())};_t.prototype.set_cross_site=function(t){t!==this.cross_site&&(this.cross_site=t,this.remove(),this.save())};_t.prototype.set_cross_subdomain=function(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())};_t.prototype.get_cross_subdomain=function(){return this.cross_subdomain};_t.prototype.set_secure=function(t){t!==this.secure&&(this.secure=!!t,this.remove(),this.save())};_t.prototype._add_to_people_queue=function(t,e){var r=this._get_queue_key(t),n=e[t],i=this._get_or_create_queue(Pa),s=this._get_or_create_queue(Dl),o=this._get_or_create_queue(rs),a=this._get_or_create_queue(Yu),u=this._get_or_create_queue(Ju),c=this._get_or_create_queue(La,[]),l=this._get_or_create_queue(Co,[]);r===aE?(B.extend(i,n),this._pop_from_people_queue(Yu,n),this._pop_from_people_queue(Ju,n),this._pop_from_people_queue(rs,n)):r===uE?(B.each(n,function(h,d){d in s||(s[d]=h)}),this._pop_from_people_queue(rs,n)):r===cE?B.each(n,function(h){B.each([i,s,a,u],function(d){h in d&&delete d[h]}),B.each(l,function(d){h in d&&delete d[h]}),o[h]=!0}):r===lE?(B.each(n,function(h,d){d in i?i[d]+=h:(d in a||(a[d]=0),a[d]+=h)},this),this._pop_from_people_queue(rs,n)):r===dE?(B.each(n,function(h,d){B.isArray(h)&&(d in u||(u[d]=[]),u[d]=u[d].concat(h))}),this._pop_from_people_queue(rs,n)):r===hE?(c.push(n),this._pop_from_people_queue(Co,n)):r===fE&&(l.push(n),this._pop_from_people_queue(rs,n)),Qt.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),Qt.log(e),this.save()};_t.prototype._pop_from_people_queue=function(t,e){var r=this._get_queue(t);B.isUndefined(r)||(B.each(e,function(n,i){t===Co||t===La?B.each(r,function(s){s[i]===n&&delete s[i]}):delete r[i]},this),this.save())};_t.prototype._get_queue_key=function(t){if(t===Pa)return aE;if(t===Dl)return uE;if(t===rs)return cE;if(t===Yu)return lE;if(t===Co)return fE;if(t===La)return hE;if(t===Ju)return dE;Qt.error("Invalid queue:",t)};_t.prototype._get_queue=function(t){return this.props[this._get_queue_key(t)]};_t.prototype._get_or_create_queue=function(t,e){var r=this._get_queue_key(t);return e=B.isUndefined(e)?{}:e,this.props[r]||(this.props[r]=e)};_t.prototype.set_event_timer=function(t,e){var r=this.props[id]||{};r[t]=e,this.props[id]=r,this.save()};_t.prototype.remove_event_timer=function(t){var e=this.props[id]||{},r=e[t];return B.isUndefined(r)||(delete this.props[id][t],this.save()),r};var pE,pn,l3=0,w7=1,E7=function(t){return t},sd=function(){},Ci="mixpanel",f3="base64",x7="json",al=_n.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,h3=!al&&ts.indexOf("MSIE")===-1&&ts.indexOf("Mozilla")===-1,f0=null;fo.sendBeacon&&(f0=function(){return fo.sendBeacon.apply(fo,arguments)});var w2={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:f3,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:sd,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:sd,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{}},d3=!1,Se=function(){},Xb=function(t,e,r){var n,i=r===Ci?pn:pn[r];if(i&&pE===l3)n=i;else{if(i&&!B.isArray(i)){Qt.error("You have already initialized "+r);return}n=new Se}return n._cached_groups={},n._init(t,e,r),n.people=new dt,n.people._init(n),Ia.DEBUG=Ia.DEBUG||n.get_config("debug"),!B.isUndefined(i)&&B.isArray(i)&&(n._execute_array.call(n.people,i.people),n._execute_array(i)),n};Se.prototype.init=function(t,e,r){if(B.isUndefined(r)){this.report_error("You must name your new library: init(token, config, name)");return}if(r===Ci){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var n=Xb(t,e,r);return pn[r]=n,n._loaded(),n};Se.prototype._init=function(t,e,r){e=e||{},this.__loaded=!0,this.config={};var n={};if(!("api_payload_format"in e)){var i=e.api_host||w2.api_host;i.match(/\.mixpanel\.com$/)&&(n.api_payload_format=x7)}if(this.set_config(B.extend({},w2,n,e,{name:r,token:t,callback_fn:(r===Ci?r:Ci+"."+r)+"._jsc"})),this._jsc=sd,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!B.localStorage.is_supported(!0)||!al)this._batch_requests=!1,Qt.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");else if(this.init_batchers(),f0&&_n.addEventListener){var s=B.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);_n.addEventListener("pagehide",function(a){a.persisted&&s()}),_n.addEventListener("visibilitychange",function(){nr.visibilityState==="hidden"&&s()})}}this.persistence=this.cookie=new _t(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=B.UUID();this.get_distinct_id()||this.register_once({distinct_id:o,$device_id:o},"")};Se.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()};Se.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(nr.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(nr.referrer)};Se.prototype._dom_loaded=function(){B.each(this.__dom_loaded_queue,function(t){this._track_dom.apply(this,t)},this),this.has_opted_out_tracking()||B.each(this.__request_queue,function(t){this._send_request.apply(this,t)},this),delete this.__dom_loaded_queue,delete this.__request_queue};Se.prototype._track_dom=function(t,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!d3)return this.__dom_loaded_queue.push([t,e]),!1;var r=new t().init(this);return r.track.apply(r,e)};Se.prototype._prepare_callback=function(t,e){if(B.isUndefined(t))return null;if(al){var r=function(o){t(o,e)};return r}else{var n=this._jsc,i=""+Math.floor(Math.random()*1e8),s=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(o){delete n[i],t(o,e)},s}};Se.prototype._send_request=function(t,e,r,n){var i=!0;if(h3)return this.__request_queue.push(arguments),i;var s={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},o=null;!n&&(B.isFunction(r)||typeof r=="string")&&(n=r,r=null),r=B.extend(s,r||{}),al||(r.method="GET");var a=r.method==="POST",u=f0&&a&&r.transport.toLowerCase()==="sendbeacon",c=r.verbose;e.verbose&&(c=!0),this.get_config("test")&&(e.test=1),c&&(e.verbose=1),this.get_config("img")&&(e.img=1),al||(n?e.callback=n:(c||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),a&&(o="data="+encodeURIComponent(e.data),delete e.data),t+="?"+B.HTTPBuildQuery(e);var l=this;if("img"in e){var h=nr.createElement("img");h.src=t,nr.body.appendChild(h)}else if(u){try{i=f0(t,o)}catch(O){l.report_error(O),i=!1}try{n&&n(i?1:0)}catch(O){l.report_error(O)}}else if(al)try{var d=new XMLHttpRequest;d.open(r.method,t,!0);var _=this.get_config("xhr_headers");if(a&&(_["Content-Type"]="application/x-www-form-urlencoded"),B.each(_,function(O,L){d.setRequestHeader(L,O)}),r.timeout_ms&&typeof d.timeout!="undefined"){d.timeout=r.timeout_ms;var T=new Date().getTime()}d.withCredentials=!0,d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200){if(n)if(c){var O;try{O=B.JSONDecode(d.responseText)}catch(J){if(l.report_error(J),r.ignore_json_errors)O=d.responseText;else return}n(O)}else n(Number(d.responseText))}else{var L;d.timeout&&!d.status&&new Date().getTime()-T>=d.timeout?L="timeout":L="Bad HTTP status: "+d.status+" "+d.statusText,l.report_error(L),n&&n(c?{status:0,error:L,xhr_req:d}:0)}},d.send(o)}catch(O){l.report_error(O),i=!1}else{var D=nr.createElement("script");D.type="text/javascript",D.async=!0,D.defer=!0,D.src=t;var N=nr.getElementsByTagName("script")[0];N.parentNode.insertBefore(D,N)}return i};Se.prototype._execute_array=function(t){var e,r=[],n=[],i=[];B.each(t,function(o){o&&(e=o[0],B.isArray(e)?i.push(o):typeof o=="function"?o.call(this):B.isArray(o)&&e==="alias"?r.push(o):B.isArray(o)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?i.push(o):n.push(o))},this);var s=function(o,a){B.each(o,function(u){if(B.isArray(u[0])){var c=a;B.each(u,function(l){c=c[l[0]].apply(c,l.slice(1))})}else this[u[0]].apply(this,u.slice(1))},a)};s(r,this),s(n,this),s(i,this)};Se.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events};Se.prototype.init_batchers=function(){var t=this.get_config("token");if(!this.are_batchers_initialized()){var e=B.bind(function(r){return new Zs("__mpq_"+t+r.queue_suffix,{libConfig:this.config,sendRequestFunc:B.bind(function(n,i,s){this._send_request(this.get_config("api_host")+r.endpoint,this._encode_data_for_request(n),i,this._prepare_callback(s,n))},this),beforeSendHook:B.bind(function(n){return this._run_hook("before_send_"+r.type,n)},this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:B.bind(this.stop_batch_senders,this)})},this);this.request_batchers={events:e({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:e({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:e({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()};Se.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,B.each(this.request_batchers,function(t){t.start()}))};Se.prototype.stop_batch_senders=function(){this._batch_requests=!1,B.each(this.request_batchers,function(t){t.stop(),t.clear()})};Se.prototype.push=function(t){this._execute_array([t])};Se.prototype.disable=function(t){typeof t=="undefined"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(t)};Se.prototype._encode_data_for_request=function(t){var e=B.JSONEncode(t);return this.get_config("api_payload_format")===f3&&(e=B.base64Encode(e)),{data:e}};Se.prototype._track_or_batch=function(t,e){var r=B.truncate(t.data,255),n=t.endpoint,i=t.batcher,s=t.should_send_immediately,o=t.send_request_options||{};e=e||sd;var a=!0,u=B.bind(function(){return o.skip_hooks||(r=this._run_hook("before_send_"+t.type,r)),r?(Qt.log("MIXPANEL REQUEST:"),Qt.log(r),this._send_request(n,this._encode_data_for_request(r),o,this._prepare_callback(e,r))):null},this);return this._batch_requests&&!s?i.enqueue(r,function(c){c?e(1,r):u()}):a=u(),a&&r};Se.prototype.track=Xd(function(t,e,r,n){!n&&typeof r=="function"&&(n=r,r=null),r=r||{};var i=r.transport;i&&(r.transport=i);var s=r.send_immediately;if(typeof n!="function"&&(n=sd),B.isUndefined(t)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(t)){n(0);return}e=e||{},e.token=this.get_config("token");var o=this.persistence.remove_event_timer(t);if(!B.isUndefined(o)){var a=new Date().getTime()-o;e.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops(),e=B.extend({},B.info.properties(),this.persistence.properties(),this.unpersisted_superprops,e);var u=this.get_config("property_blacklist");B.isArray(u)?B.each(u,function(h){delete e[h]}):this.report_error("Invalid value for property_blacklist config: "+u);var c={event:t,properties:e},l=this._track_or_batch({type:"events",data:c,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:r},n);return l});Se.prototype.set_group=Xd(function(t,e,r){B.isArray(e)||(e=[e]);var n={};return n[t]=e,this.register(n),this.people.set(t,e,r)});Se.prototype.add_group=Xd(function(t,e,r){var n=this.get_property(t);if(n===void 0){var i={};i[t]=[e],this.register(i)}else n.indexOf(e)===-1&&(n.push(e),this.register(i));return this.people.union(t,e,r)});Se.prototype.remove_group=Xd(function(t,e,r){var n=this.get_property(t);if(n!==void 0){var i=n.indexOf(e);i>-1&&(n.splice(i,1),this.register({group_key:n})),n.length===0&&this.unregister(t)}return this.people.remove(t,e,r)});Se.prototype.track_with_groups=Xd(function(t,e,r,n){var i=B.extend({},e||{});return B.each(r,function(s,o){s!=null&&(i[o]=s)}),this.track(t,i,n)});Se.prototype._create_map_key=function(t,e){return t+"_"+JSON.stringify(e)};Se.prototype._remove_group_from_cache=function(t,e){delete this._cached_groups[this._create_map_key(t,e)]};Se.prototype.get_group=function(t,e){var r=this._create_map_key(t,e),n=this._cached_groups[r];return(n===void 0||n._group_key!==t||n._group_id!==e)&&(n=new cr,n._init(this,t,e),this._cached_groups[r]=n),n};Se.prototype.track_pageview=function(t){B.isUndefined(t)&&(t=nr.location.href),this.track("mp_page_view",B.info.pageviewInfo(t))};Se.prototype.track_links=function(){return this._track_dom.call(this,Ol,arguments)};Se.prototype.track_forms=function(){return this._track_dom.call(this,Mm,arguments)};Se.prototype.time_event=function(t){if(B.isUndefined(t)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(t)||this.persistence.set_event_timer(t,new Date().getTime())};var S7={persistent:!0},gE=function(t){var e;return B.isObject(t)?e=t:B.isUndefined(t)?e={}:e={days:t},B.extend({},S7,e)};Se.prototype.register=function(t,e){var r=gE(e);r.persistent?this.persistence.register(t,r.days):B.extend(this.unpersisted_superprops,t)};Se.prototype.register_once=function(t,e,r){var n=gE(r);n.persistent?this.persistence.register_once(t,e,n.days):(typeof e=="undefined"&&(e="None"),B.each(t,function(i,s){(!this.unpersisted_superprops.hasOwnProperty(s)||this.unpersisted_superprops[s]===e)&&(this.unpersisted_superprops[s]=i)},this))};Se.prototype.unregister=function(t,e){e=gE(e),e.persistent?this.persistence.unregister(t):delete this.unpersisted_superprops[t]};Se.prototype._register_single=function(t,e){var r={};r[t]=e,this.register(r)};Se.prototype.identify=function(t,e,r,n,i,s,o,a){var u=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var c=u;this.register_once({$had_persisted_distinct_id:!0,$device_id:c},"")}t!==u&&t!==this.get_property(l0)&&(this.unregister(l0),this.register({distinct_id:t})),this._flags.identify_called=!0,this.people._flush(e,r,n,i,s,o,a),t!==u&&this.track("$identify",{distinct_id:t,$anon_distinct_id:u},{skip_hooks:!0})};Se.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var t=B.UUID();this.register_once({distinct_id:t,$device_id:t},"")};Se.prototype.get_distinct_id=function(){return this.get_property("distinct_id")};Se.prototype.alias=function(t,e){if(t===this.get_property(c3))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return B.isUndefined(e)&&(e=this.get_distinct_id()),t!==e?(this._register_single(l0,t),this.track("$create_alias",{alias:t,distinct_id:e},{skip_hooks:!0},function(){r.identify(t)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(t),-1)};Se.prototype.name_tag=function(t){this._register_single("mp_name_tag",t)};Se.prototype.set_config=function(t){if(B.isObject(t)){B.extend(this.config,t);var e=t.batch_size;e&&B.each(this.request_batchers,function(r){r.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Ia.DEBUG=Ia.DEBUG||this.get_config("debug")}};Se.prototype.get_config=function(t){return this.config[t]};Se.prototype._run_hook=function(t){var e=(this.config.hooks[t]||E7).apply(this,ya.call(arguments,1));return typeof e=="undefined"&&(this.report_error(t+" hook did not return a value"),e=null),e};Se.prototype.get_property=function(t){return this.persistence.props[t]};Se.prototype.toString=function(){var t=this.get_config("name");return t!==Ci&&(t=Ci+"."+t),t};Se.prototype._event_is_disabled=function(t){return B.isBlockedUA(ts)||this._flags.disable_all_events||B.include(this.__disabled_events,t)};Se.prototype._gdpr_init=function(){var t=this.get_config("opt_out_tracking_persistence_type")==="localStorage";t&&B.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||B.cookie.get("mp_optout"))&&(B.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))};Se.prototype._gdpr_update_persistence=function(t){var e;if(t&&t.clear_persistence)e=!0;else if(t&&t.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e&&B.each(this.request_batchers,function(r){r.clear()})};Se.prototype._gdpr_call_func=function(t,e){return e=B.extend({track:B.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),B.localStorage.is_supported()||(e.persistence_type="cookie"),t(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})};Se.prototype.opt_in_tracking=function(t){t=B.extend({enable_persistence:!0},t),this._gdpr_call_func(p7,t),this._gdpr_update_persistence(t)};Se.prototype.opt_out_tracking=function(t){t=B.extend({clear_persistence:!0,delete_user:!0},t),t.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(g7,t),this._gdpr_update_persistence(t)};Se.prototype.has_opted_in_tracking=function(t){return this._gdpr_call_func(m7,t)};Se.prototype.has_opted_out_tracking=function(t){return this._gdpr_call_func(s3,t)};Se.prototype.clear_opt_in_out_tracking=function(t){t=B.extend({enable_persistence:!0},t),this._gdpr_call_func(v7,t),this._gdpr_update_persistence(t)};Se.prototype.report_error=function(t,e){Qt.error.apply(Qt.error,arguments);try{!e&&!(t instanceof Error)&&(t=new Error(t)),this.get_config("error_reporter")(t,e)}catch(r){Qt.error(r)}};Se.prototype.init=Se.prototype.init;Se.prototype.reset=Se.prototype.reset;Se.prototype.disable=Se.prototype.disable;Se.prototype.time_event=Se.prototype.time_event;Se.prototype.track=Se.prototype.track;Se.prototype.track_links=Se.prototype.track_links;Se.prototype.track_forms=Se.prototype.track_forms;Se.prototype.track_pageview=Se.prototype.track_pageview;Se.prototype.register=Se.prototype.register;Se.prototype.register_once=Se.prototype.register_once;Se.prototype.unregister=Se.prototype.unregister;Se.prototype.identify=Se.prototype.identify;Se.prototype.alias=Se.prototype.alias;Se.prototype.name_tag=Se.prototype.name_tag;Se.prototype.set_config=Se.prototype.set_config;Se.prototype.get_config=Se.prototype.get_config;Se.prototype.get_property=Se.prototype.get_property;Se.prototype.get_distinct_id=Se.prototype.get_distinct_id;Se.prototype.toString=Se.prototype.toString;Se.prototype.opt_out_tracking=Se.prototype.opt_out_tracking;Se.prototype.opt_in_tracking=Se.prototype.opt_in_tracking;Se.prototype.has_opted_out_tracking=Se.prototype.has_opted_out_tracking;Se.prototype.has_opted_in_tracking=Se.prototype.has_opted_in_tracking;Se.prototype.clear_opt_in_out_tracking=Se.prototype.clear_opt_in_out_tracking;Se.prototype.get_group=Se.prototype.get_group;Se.prototype.set_group=Se.prototype.set_group;Se.prototype.add_group=Se.prototype.add_group;Se.prototype.remove_group=Se.prototype.remove_group;Se.prototype.track_with_groups=Se.prototype.track_with_groups;Se.prototype.start_batch_senders=Se.prototype.start_batch_senders;Se.prototype.stop_batch_senders=Se.prototype.stop_batch_senders;_t.prototype.properties=_t.prototype.properties;_t.prototype.update_search_keyword=_t.prototype.update_search_keyword;_t.prototype.update_referrer_info=_t.prototype.update_referrer_info;_t.prototype.get_cross_subdomain=_t.prototype.get_cross_subdomain;_t.prototype.clear=_t.prototype.clear;var Wc={},I7=function(){B.each(Wc,function(t,e){e!==Ci&&(pn[e]=t)}),pn._=B},T7=function(){pn.init=function(t,e,r){if(r)return pn[r]||(pn[r]=Wc[r]=Xb(t,e,r),pn[r]._loaded()),pn[r];var n=pn;Wc[Ci]?n=Wc[Ci]:t&&(n=Xb(t,e,Ci),n._loaded(),Wc[Ci]=n),pn=n,pE===w7&&(_n[Ci]=pn),I7()}},A7=function(){function t(){t.done||(t.done=!0,d3=!0,h3=!1,B.each(Wc,function(n){n._dom_loaded()}))}function e(){try{nr.documentElement.doScroll("left")}catch{setTimeout(e,1);return}t()}if(nr.addEventListener)nr.readyState==="complete"?t():nr.addEventListener("DOMContentLoaded",t,!1);else if(nr.attachEvent){nr.attachEvent("onreadystatechange",t);var r=!1;try{r=_n.frameElement===null}catch{}nr.documentElement.doScroll&&r&&e()}B.register_event(_n,"load",t,!0)};function k7(){return pE=l3,pn=new Se,T7(),pn.init(),A7(),pn}var M7=k7(),wde=M7,Yd=function(e){window.__fathomClientQueue=window.__fathomClientQueue||[],window.__fathomClientQueue.push(e)},C7=function(){window.__fathomClientQueue=window.__fathomClientQueue||[],window.__fathomClientQueue.forEach(function(e){switch(e.type){case"trackPageview":R7(e.opts);return;case"trackGoal":N7(e.code,e.cents);return;case"enableTrackingForMe":D7();return;case"blockTrackingForMe":O7();return;case"setSite":P7(e.id);return}}),window.__fathomClientQueue=[]},E2=function(e){var r=/(https?)(?=:|\/|$)/;e.forEach(function(n){r.exec(n)!==null&&console.warn("The include domain ".concat(n," might fail to work as intended as it begins with a transfer protocol (http://, https://). Consider removing the protocol portion of the string."))})},Ede=function(e,r){var n=document.createElement("script"),i=document.getElementsByTagName("script")[0]||document.querySelector("body");n.id="fathom-script",n.async=!0,n.setAttribute("data-site",e),n.src=r&&r.url?r.url:"https://cdn.usefathom.com/script.js",r&&(r.auto!==void 0&&n.setAttribute("data-auto","".concat(r.auto)),r.honorDNT!==void 0&&n.setAttribute("data-honor-dnt","".concat(r.honorDNT)),r.canonical!==void 0&&n.setAttribute("data-canonical","".concat(r.canonical)),r.includedDomains&&(E2(r.includedDomains),n.setAttribute("data-included-domains",r.includedDomains.join(","))),r.excludedDomains&&(E2(r.excludedDomains),n.setAttribute("data-excluded-domains",r.excludedDomains.join(","))),r.spa&&n.setAttribute("data-spa",r.spa)),n.onload=C7,i.parentNode.insertBefore(n,i)},R7=function(e){window.fathom?e?window.fathom.trackPageview(e):window.fathom.trackPageview():Yd({type:"trackPageview",opts:e})},N7=function(e,r){window.fathom?window.fathom.trackGoal(e,r):Yd({type:"trackGoal",code:e,cents:r})},O7=function(){window.fathom?window.fathom.blockTrackingForMe():Yd({type:"blockTrackingForMe"})},D7=function(){window.fathom?window.fathom.enableTrackingForMe():Yd({type:"enableTrackingForMe"})},P7=function(e){window.fathom?window.fathom.setSite(e):Yd({type:"setSite",id:e})};function Ts(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function x2(t,e){for(var r="",n=0,i=-1,s=0,o,a=0;a<=t.length;++a){if(a2){var u=r.lastIndexOf("/");if(u!==r.length-1){u===-1?(r="",n=0):(r=r.slice(0,u),n=r.length-1-r.lastIndexOf("/")),i=a,s=0;continue}}else if(r.length===2||r.length===1){r="",n=0,i=a,s=0;continue}}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+t.slice(i+1,a):r=t.slice(i+1,a),n=a-i-1;i=a,s=0}else o===46&&s!==-1?++s:s=-1}return r}function L7(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+t+n:n}var ul={resolve:function(){for(var e="",r=!1,n,i=arguments.length-1;i>=-1&&!r;i--){var s;i>=0?s=arguments[i]:(n===void 0&&(n=process.cwd()),s=n),Ts(s),s.length!==0&&(e=s+"/"+e,r=s.charCodeAt(0)===47)}return e=x2(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(Ts(e),e.length===0)return".";var r=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=x2(e,!r),e.length===0&&!r&&(e="."),e.length>0&&n&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return Ts(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r0&&(e===void 0?e=n:e+="/"+n)}return e===void 0?".":ul.normalize(e)},relative:function(e,r){if(Ts(e),Ts(r),e===r||(e=ul.resolve(e),r=ul.resolve(r),e===r))return"";for(var n=1;nc){if(r.charCodeAt(o+h)===47)return r.slice(o+h+1);if(h===0)return r.slice(o+h)}else s>c&&(e.charCodeAt(n+h)===47?l=h:h===0&&(l=0));break}var d=e.charCodeAt(n+h),_=r.charCodeAt(o+h);if(d!==_)break;d===47&&(l=h)}var T="";for(h=n+l+1;h<=i;++h)(h===i||e.charCodeAt(h)===47)&&(T.length===0?T+="..":T+="/..");return T.length>0?T+r.slice(o+l):(o+=l,r.charCodeAt(o)===47&&++o,r.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(Ts(e),e.length===0)return".";for(var r=e.charCodeAt(0),n=r===47,i=-1,s=!0,o=e.length-1;o>=1;--o)if(r=e.charCodeAt(o),r===47){if(!s){i=o;break}}else s=!1;return i===-1?n?"/":".":n&&i===1?"//":e.slice(0,i)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Ts(e);var n=0,i=-1,s=!0,o;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,u=-1;for(o=e.length-1;o>=0;--o){var c=e.charCodeAt(o);if(c===47){if(!s){n=o+1;break}}else u===-1&&(s=!1,u=o+1),a>=0&&(c===r.charCodeAt(a)?--a===-1&&(i=o):(a=-1,i=u))}return n===i?i=u:i===-1&&(i=e.length),e.slice(n,i)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!s){n=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":e.slice(n,i)}},extname:function(e){Ts(e);for(var r=-1,n=0,i=-1,s=!0,o=0,a=e.length-1;a>=0;--a){var u=e.charCodeAt(a);if(u===47){if(!s){n=a+1;break}continue}i===-1&&(s=!1,i=a+1),u===46?r===-1?r=a:o!==1&&(o=1):r!==-1&&(o=-1)}return r===-1||i===-1||o===0||o===1&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return L7("/",e)},parse:function(e){Ts(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var n=e.charCodeAt(0),i=n===47,s;i?(r.root="/",s=1):s=0;for(var o=-1,a=0,u=-1,c=!0,l=e.length-1,h=0;l>=s;--l){if(n=e.charCodeAt(l),n===47){if(!c){a=l+1;break}continue}u===-1&&(c=!1,u=l+1),n===46?o===-1?o=l:h!==1&&(h=1):o!==-1&&(h=-1)}return o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1?u!==-1&&(a===0&&i?r.base=r.name=e.slice(1,u):r.base=r.name=e.slice(a,u)):(a===0&&i?(r.name=e.slice(1,o),r.base=e.slice(1,u)):(r.name=e.slice(a,o),r.base=e.slice(a,u)),r.ext=e.slice(o,u)),a>0?r.dir=e.slice(0,a-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};ul.posix=ul;var xde=ul,B7=function(t,e){for(var r=[],n=0;n=0&&c>0){if(t===e)return[u,c];for(n=[],s=r.length;l>=0&&!a;)l==u?(n.push(l),u=r.indexOf(t,l+1)):n.length==1?a=[n.pop(),c]:(i=n.pop(),i=0?u:c;n.length&&(a=[s,o])}return a}var U7=B7,m3=F7,q7=z7,v3="\0SLASH"+Math.random()+"\0",y3="\0OPEN"+Math.random()+"\0",mE="\0CLOSE"+Math.random()+"\0",_3="\0COMMA"+Math.random()+"\0",b3="\0PERIOD"+Math.random()+"\0";function i_(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function j7(t){return t.split("\\\\").join(v3).split("\\{").join(y3).split("\\}").join(mE).split("\\,").join(_3).split("\\.").join(b3)}function V7(t){return t.split(v3).join("\\").split(y3).join("{").split(mE).join("}").split(_3).join(",").split(b3).join(".")}function w3(t){if(!t)return[""];var e=[],r=m3("{","}",t);if(!r)return t.split(",");var n=r.pre,i=r.body,s=r.post,o=n.split(",");o[o.length-1]+="{"+i+"}";var a=w3(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function z7(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),Hc(j7(t),!0).map(V7)):[]}function H7(t){return"{"+t+"}"}function K7(t){return/^-?0\d/.test(t)}function G7(t,e){return t<=e}function W7(t,e){return t>=e}function Hc(t,e){var r=[],n=m3("{","}",t);if(!n||/\$$/.test(n.pre))return[t];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),o=i||s,a=n.body.indexOf(",")>=0;if(!o&&!a)return n.post.match(/,.*\}/)?(t=n.pre+"{"+n.body+mE+n.post,Hc(t)):[t];var u;if(o)u=n.body.split(/\.\./);else if(u=w3(n.body),u.length===1&&(u=Hc(u[0],!1).map(H7),u.length===1)){var l=n.post.length?Hc(n.post,!1):[""];return l.map(function(F){return n.pre+u[0]+F})}var c=n.pre,l=n.post.length?Hc(n.post,!1):[""],h;if(o){var d=i_(u[0]),_=i_(u[1]),T=Math.max(u[0].length,u[1].length),D=u.length==3?Math.abs(i_(u[2])):1,N=G7,O=_0){var ee=new Array(z+1).join("0");J<0?q="-"+ee+q.slice(1):q=ee+q}}h.push(q)}}else h=U7(u,function(_e){return Hc(_e,!1)});for(var G=0;Gr9)throw new TypeError("pattern is too long")};nn.prototype.parse=n9;var Jp={};function n9(t,e){Cm(t);var r=this.options;if(t==="**")if(r.noglobstar)t="*";else return vE;if(t==="")return"";var n="",i=!!r.nocase,s=!1,o=[],a=[],u,c=!1,l=-1,h=-1,d=t.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",_=this;function T(){if(u){switch(u){case"*":n+=Jb,i=!0;break;case"?":n+=Yb,i=!0;break;default:n+="\\"+u;break}_.debug("clearStateChar %j %j",u,n),u=!1}}for(var D=0,N=t.length,O;D-1;ne--){var ue=a[ne],_e=n.slice(0,ue.reStart),F=n.slice(ue.reStart,ue.reEnd-8),m=n.slice(ue.reEnd-8,ue.reEnd),g=n.slice(ue.reEnd);m+=g;var f=_e.split("(").length-1,p=g;for(D=0;D=0&&(s=e[o],!s);o--);for(o=0;o>> no match, partial?`,t,l,e,h),l===o))}var _;if(typeof u=="string"?(_=c===u,this.debug("string match",u,c,_)):(_=c.match(u),this.debug("pattern match",u,c,_)),!_)return!1}if(i===o&&s===a)return!0;if(i===o)return r;if(s===a)return i===o-1&&t[i]==="";throw new Error("wtf?")};function s9(t){return t.replace(/\\(.)/g,"$1")}function o9(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const S3=function(t){const e=[];let r=0;for(let n=0;n>6|192,e[r++]=i&63|128):(i&64512)===55296&&n+1>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=i&63|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=i&63|128)}return e},a9=function(t){const e=[];let r=0,n=0;for(;r191&&i<224){const s=t[r++];e[n++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=t[r++],o=t[r++],a=t[r++],u=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[n++]=String.fromCharCode(55296+(u>>10)),e[n++]=String.fromCharCode(56320+(u&1023))}else{const s=t[r++],o=t[r++];e[n++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},I3={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 r=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let i=0;i>2,h=(s&3)<<4|a>>4;let d=(a&15)<<2|c>>6,_=c&63;u||(_=64,o||(d=64)),n.push(r[l],r[h],r[d],r[_])}return n.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(S3(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):a9(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const r=e?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let i=0;i>4;if(n.push(d),c!==64){const _=a<<4&240|c>>2;if(n.push(_),h!==64){const T=c<<6&192|h;n.push(T)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},u9=function(t){const e=S3(t);return I3.encodeByteArray(e,!0)},h0=function(t){return u9(t).replace(/\./g,"")},T3=function(t){try{return I3.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function c9(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:const r=e;return new Date(r.getTime());case Object:t===void 0&&(t={});break;case Array:t=[];break;default:return e}for(const r in e)!e.hasOwnProperty(r)||!l9(r)||(t[r]=c9(t[r],e[r]));return t}function l9(t){return t!=="__proto__"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Mr(){return typeof navigator!="undefined"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function f9(){return typeof window!="undefined"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Mr())}function h9(){try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function Ide(){return typeof self=="object"&&self.self===self}function d9(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function p9(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function g9(){const t=Mr();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function m9(){return!h9()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function yE(){return typeof indexedDB=="object"}function A3(){return new Promise((t,e)=>{try{let r=!0;const n="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(n);i.onsuccess=()=>{i.result.close(),r||self.indexedDB.deleteDatabase(n),t(!0)},i.onupgradeneeded=()=>{r=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(r){e(r)}})}function v9(){return!(typeof navigator=="undefined"||!navigator.cookieEnabled)}function y9(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("Unable to locate global object.")}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const _9=()=>y9().__FIREBASE_DEFAULTS__,b9=()=>{if(typeof process=="undefined"||typeof process.env=="undefined")return;const t={}.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},w9=()=>{if(typeof document=="undefined")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&T3(t[1]);return e&&JSON.parse(e)},_E=()=>{try{return _9()||b9()||w9()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},k3=t=>{var e,r;return(r=(e=_E())===null||e===void 0?void 0:e.emulatorHosts)===null||r===void 0?void 0:r[t]},M3=t=>{const e=k3(t);if(!e)return;const r=e.lastIndexOf(":");if(r<=0||r+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const n=parseInt(e.substring(r+1),10);return e[0]==="["?[e.substring(1,r-1),n]:[e.substring(0,r),n]},E9=()=>{var t;return(t=_E())===null||t===void 0?void 0:t.config},C3=t=>{var e;return(e=_E())===null||e===void 0?void 0:e[`_${t}`]};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class x9{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}wrapCallback(e){return(r,n)=>{r?this.reject(r):this.resolve(n),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(r):e(r,n))}}}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function S9(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 r={alg:"none",type:"JWT"},n=e||"demo-project",i=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},t),a="";return[h0(JSON.stringify(r)),h0(JSON.stringify(o)),a].join(".")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const I9="FirebaseError";class Fi extends Error{constructor(e,r,n){super(r),this.code=e,this.customData=n,this.name=I9,Object.setPrototypeOf(this,Fi.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,wc.prototype.create)}}class wc{constructor(e,r,n){this.service=e,this.serviceName=r,this.errors=n}create(e,...r){const n=r[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?T9(s,n):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new Fi(i,a,n)}}function T9(t,e){return t.replace(A9,(r,n)=>{const i=e[n];return i!=null?String(i):`<${n}?>`})}const A9=/\{\$([^}]+)}/g;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Tde(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function k9(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function d0(t,e){if(t===e)return!0;const r=Object.keys(t),n=Object.keys(e);for(const i of r){if(!n.includes(i))return!1;const s=t[i],o=e[i];if(A2(s)&&A2(o)){if(!d0(s,o))return!1}else if(s!==o)return!1}for(const i of n)if(!r.includes(i))return!1;return!0}function A2(t){return t!==null&&typeof t=="object"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function of(t){const e=[];for(const[r,n]of Object.entries(t))Array.isArray(n)?n.forEach(i=>{e.push(encodeURIComponent(r)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(r)+"="+encodeURIComponent(n));return e.length?"&"+e.join("&"):""}function ch(t){const e={};return t.replace(/^\?/,"").split("&").forEach(n=>{if(n){const[i,s]=n.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function lh(t){const e=t.indexOf("?");if(!e)return"";const r=t.indexOf("#",e);return t.substring(e,r>0?r:void 0)}function M9(t,e){const r=new C9(t,e);return r.subscribe.bind(r)}class C9{constructor(e,r){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=r,this.task.then(()=>{e(this)}).catch(n=>{this.error(n)})}next(e){this.forEachObserver(r=>{r.next(e)})}error(e){this.forEachObserver(r=>{r.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,r,n){let i;if(e===void 0&&r===void 0&&n===void 0)throw new Error("Missing Observer.");R9(e,["next","error","complete"])?i=e:i={next:e,error:r,complete:n},i.next===void 0&&(i.next=s_),i.error===void 0&&(i.error=s_),i.complete===void 0&&(i.complete=s_);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}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 r=0;r{if(this.observers!==void 0&&this.observers[e]!==void 0)try{r(this.observers[e])}catch(n){typeof console!="undefined"&&console.error&&console.error(n)}})}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 R9(t,e){if(typeof t!="object"||t===null)return!1;for(const r of e)if(r in t&&typeof t[r]=="function")return!0;return!1}function s_(){}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Qe(t){return t&&t._delegate?t._delegate:t}class us{constructor(e,r,n){this.name=e,this.instanceFactory=r,this.type=n,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}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const pu="[DEFAULT]";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class N9{constructor(e,r){this.name=e,this.container=r,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const r=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(r)){const n=new x9;if(this.instancesDeferred.set(r,n),this.isInitialized(r)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:r});i&&n.resolve(i)}catch{}}return this.instancesDeferred.get(r).promise}getImmediate(e){var r;const n=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(r=e==null?void 0:e.optional)!==null&&r!==void 0?r:!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(i)return null;throw s}else{if(i)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(D9(e))try{this.getOrInitializeService({instanceIdentifier:pu})}catch{}for(const[r,n]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(r);try{const s=this.getOrInitializeService({instanceIdentifier:i});n.resolve(s)}catch{}}}}clearInstance(e=pu){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(r=>"INTERNAL"in r).map(r=>r.INTERNAL.delete()),...e.filter(r=>"_delete"in r).map(r=>r._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=pu){return this.instances.has(e)}getOptions(e=pu){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:r={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:n,options:r});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);n===a&&o.resolve(i)}return i}onInit(e,r){var n;const i=this.normalizeInstanceIdentifier(r),s=(n=this.onInitCallbacks.get(i))!==null&&n!==void 0?n:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,r){const n=this.onInitCallbacks.get(r);if(!!n)for(const i of n)try{i(e,r)}catch{}}getOrInitializeService({instanceIdentifier:e,options:r={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:O9(e),options:r}),this.instances.set(e,n),this.instancesOptions.set(e,r),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}return n||null}normalizeInstanceIdentifier(e=pu){return this.component?this.component.multipleInstances?e:pu:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function O9(t){return t===pu?void 0:t}function D9(t){return t.instantiationMode==="EAGER"}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class P9{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const r=this.getProvider(e.name);if(r.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);r.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 r=new N9(e,this);return this.providers.set(e,r),r}getProviders(){return Array.from(this.providers.values())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const bE=[];var Mt;(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"})(Mt||(Mt={}));const R3={debug:Mt.DEBUG,verbose:Mt.VERBOSE,info:Mt.INFO,warn:Mt.WARN,error:Mt.ERROR,silent:Mt.SILENT},L9=Mt.INFO,B9={[Mt.DEBUG]:"log",[Mt.VERBOSE]:"log",[Mt.INFO]:"info",[Mt.WARN]:"warn",[Mt.ERROR]:"error"},$9=(t,e,...r)=>{if(e{e.setLogLevel(t)})}function U9(t,e){for(const r of bE){let n=null;e&&e.level&&(n=R3[e.level]),t===null?r.userLogHandler=null:r.userLogHandler=(i,s,...o)=>{const a=o.map(u=>{if(u==null)return null;if(typeof u=="string")return u;if(typeof u=="number"||typeof u=="boolean")return u.toString();if(u instanceof Error)return u.message;try{return JSON.stringify(u)}catch{return null}}).filter(u=>u).join(" ");s>=(n!=null?n:i.logLevel)&&t({level:Mt[s].toLowerCase(),message:a,args:o,type:i.name})}}}const q9=(t,e)=>e.some(r=>t instanceof r);let k2,M2;function j9(){return k2||(k2=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function V9(){return M2||(M2=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const N3=new WeakMap,Qb=new WeakMap,O3=new WeakMap,o_=new WeakMap,wE=new WeakMap;function z9(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(Ta(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&N3.set(r,t)}).catch(()=>{}),wE.set(e,t),e}function H9(t){if(Qb.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});Qb.set(t,e)}let Zb={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return Qb.get(t);if(e==="objectStoreNames")return t.objectStoreNames||O3.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Ta(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function K9(t){Zb=t(Zb)}function G9(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(a_(this),e,...r);return O3.set(n,e.sort?e.sort():[e]),Ta(n)}:V9().includes(t)?function(...e){return t.apply(a_(this),e),Ta(N3.get(this))}:function(...e){return Ta(t.apply(a_(this),e))}}function W9(t){return typeof t=="function"?G9(t):(t instanceof IDBTransaction&&H9(t),q9(t,j9())?new Proxy(t,Zb):t)}function Ta(t){if(t instanceof IDBRequest)return z9(t);if(o_.has(t))return o_.get(t);const e=W9(t);return e!==t&&(o_.set(t,e),wE.set(e,t)),e}const a_=t=>wE.get(t);function D3(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Ta(o);return n&&o.addEventListener("upgradeneeded",u=>{n(Ta(o.result),u.oldVersion,u.newVersion,Ta(o.transaction))}),r&&o.addEventListener("blocked",()=>r()),a.then(u=>{s&&u.addEventListener("close",()=>s()),i&&u.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}const X9=["get","getKey","getAll","getAllKeys","count"],Y9=["put","add","delete","clear"],u_=new Map;function C2(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(u_.get(e))return u_.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=Y9.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||X9.includes(r)))return;const s=async function(o,...a){const u=this.transaction(o,i?"readwrite":"readonly");let c=u.store;return n&&(c=c.index(a.shift())),(await Promise.all([c[r](...a),i&&u.done]))[0]};return u_.set(e,s),s}K9(t=>({...t,get:(e,r,n)=>C2(e,r)||t.get(e,r,n),has:(e,r)=>!!C2(e,r)||t.has(e,r)}));/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class J9{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(r=>{if(Q9(r)){const n=r.getImmediate();return`${n.library}/${n.version}`}else return null}).filter(r=>r).join(" ")}}function Q9(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const e1="@firebase/app",R2="0.8.4";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Qu=new Rm("@firebase/app"),Z9="@firebase/app-compat",eq="@firebase/analytics-compat",tq="@firebase/analytics",rq="@firebase/app-check-compat",nq="@firebase/app-check",iq="@firebase/auth",sq="@firebase/auth-compat",oq="@firebase/database",aq="@firebase/database-compat",uq="@firebase/functions",cq="@firebase/functions-compat",lq="@firebase/installations",fq="@firebase/installations-compat",hq="@firebase/messaging",dq="@firebase/messaging-compat",pq="@firebase/performance",gq="@firebase/performance-compat",mq="@firebase/remote-config",vq="@firebase/remote-config-compat",yq="@firebase/storage",_q="@firebase/storage-compat",bq="@firebase/firestore",wq="@firebase/firestore-compat",Eq="firebase",xq="9.14.0";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const ad="[DEFAULT]",Sq={[e1]:"fire-core",[Z9]:"fire-core-compat",[tq]:"fire-analytics",[eq]:"fire-analytics-compat",[nq]:"fire-app-check",[rq]:"fire-app-check-compat",[iq]:"fire-auth",[sq]:"fire-auth-compat",[oq]:"fire-rtdb",[aq]:"fire-rtdb-compat",[uq]:"fire-fn",[cq]:"fire-fn-compat",[lq]:"fire-iid",[fq]:"fire-iid-compat",[hq]:"fire-fcm",[dq]:"fire-fcm-compat",[pq]:"fire-perf",[gq]:"fire-perf-compat",[mq]:"fire-rc",[vq]:"fire-rc-compat",[yq]:"fire-gcs",[_q]:"fire-gcs-compat",[bq]:"fire-fst",[wq]:"fire-fst-compat","fire-js":"fire-js",[Eq]:"fire-js-all"};/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Ba=new Map,ud=new Map;function P3(t,e){try{t.container.addComponent(e)}catch(r){Qu.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,r)}}function Iq(t,e){t.container.addOrOverwriteComponent(e)}function cs(t){const e=t.name;if(ud.has(e))return Qu.debug(`There were multiple attempts to register component ${e}.`),!1;ud.set(e,t);for(const r of Ba.values())P3(r,t);return!0}function zo(t,e){const r=t.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),t.container.getProvider(e)}function Tq(t,e,r=ad){zo(t,e).clearInstance(r)}function Aq(){ud.clear()}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const kq={["no-app"]:"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",["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",["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.",["invalid-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}."},Eo=new wc("app","Firebase",kq);/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Mq{constructor(e,r,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},r),this._name=r.name,this._automaticDataCollectionEnabled=r.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new us("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 Eo.create("app-deleted",{appName:this._name})}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const af=xq;function L3(t,e={}){let r=t;typeof e!="object"&&(e={name:e});const n=Object.assign({name:ad,automaticDataCollectionEnabled:!1},e),i=n.name;if(typeof i!="string"||!i)throw Eo.create("bad-app-name",{appName:String(i)});if(r||(r=E9()),!r)throw Eo.create("no-options");const s=Ba.get(i);if(s){if(d0(r,s.options)&&d0(n,s.config))return s;throw Eo.create("duplicate-app",{appName:i})}const o=new P9(i);for(const u of ud.values())o.addComponent(u);const a=new Mq(r,n,o);return Ba.set(i,a),a}function Jd(t=ad){const e=Ba.get(t);if(!e&&t===ad)return L3();if(!e)throw Eo.create("no-app",{appName:t});return e}function Cq(){return Array.from(Ba.values())}async function Rq(t){const e=t.name;Ba.has(e)&&(Ba.delete(e),await Promise.all(t.container.getProviders().map(r=>r.delete())),t.isDeleted=!0)}function On(t,e,r){var n;let i=(n=Sq[t])!==null&&n!==void 0?n:t;r&&(i+=`-${r}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${e}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Qu.warn(a.join(" "));return}cs(new us(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}function Nq(t,e){if(t!==null&&typeof t!="function")throw Eo.create("invalid-log-argument");U9(t,e)}function Oq(t){F9(t)}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Dq="firebase-heartbeat-database",Pq=1,cd="firebase-heartbeat-store";let c_=null;function B3(){return c_||(c_=D3(Dq,Pq,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(cd)}}}).catch(t=>{throw Eo.create("idb-open",{originalErrorMessage:t.message})})),c_}async function Lq(t){var e;try{return(await B3()).transaction(cd).objectStore(cd).get($3(t))}catch(r){if(r instanceof Fi)Qu.warn(r.message);else{const n=Eo.create("idb-get",{originalErrorMessage:(e=r)===null||e===void 0?void 0:e.message});Qu.warn(n.message)}}}async function N2(t,e){var r;try{const i=(await B3()).transaction(cd,"readwrite");return await i.objectStore(cd).put(e,$3(t)),i.done}catch(n){if(n instanceof Fi)Qu.warn(n.message);else{const i=Eo.create("idb-set",{originalErrorMessage:(r=n)===null||r===void 0?void 0:r.message});Qu.warn(i.message)}}}function $3(t){return`${t.name}!${t.options.appId}`}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Bq=1024,$q=30*24*60*60*1e3;class Fq{constructor(e){this.container=e,this._heartbeatsCache=null;const r=this.container.getProvider("app").getImmediate();this._storage=new qq(r),this._heartbeatsCachePromise=this._storage.read().then(n=>(this._heartbeatsCache=n,n))}async triggerHeartbeat(){const r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),n=O2();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===n||this._heartbeatsCache.heartbeats.some(i=>i.date===n)))return this._heartbeatsCache.heartbeats.push({date:n,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(i=>{const s=new Date(i.date).valueOf();return Date.now()-s<=$q}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";const e=O2(),{heartbeatsToSend:r,unsentEntries:n}=Uq(this._heartbeatsCache.heartbeats),i=h0(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function O2(){return new Date().toISOString().substring(0,10)}function Uq(t,e=Bq){const r=[];let n=t.slice();for(const i of t){const s=r.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),D2(r)>e){s.dates.pop();break}}else if(r.push({agent:i.agent,dates:[i.date]}),D2(r)>e){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}class qq{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return yE()?A3().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await Lq(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var r;if(await this._canUseIndexedDBPromise){const i=await this.read();return N2(this.app,{lastSentHeartbeatDate:(r=e.lastSentHeartbeatDate)!==null&&r!==void 0?r:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var r;if(await this._canUseIndexedDBPromise){const i=await this.read();return N2(this.app,{lastSentHeartbeatDate:(r=e.lastSentHeartbeatDate)!==null&&r!==void 0?r:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function D2(t){return h0(JSON.stringify({version:2,heartbeats:t})).length}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function jq(t){cs(new us("platform-logger",e=>new J9(e),"PRIVATE")),cs(new us("heartbeat",e=>new Fq(e),"PRIVATE")),On(e1,R2,t),On(e1,R2,"esm2017"),On("fire-js","")}jq("");var Ade=Object.freeze(Object.defineProperty({__proto__:null,SDK_VERSION:af,_DEFAULT_ENTRY_NAME:ad,_addComponent:P3,_addOrOverwriteComponent:Iq,_apps:Ba,_clearComponents:Aq,_components:ud,_getProvider:zo,_registerComponent:cs,_removeServiceInstance:Tq,deleteApp:Rq,getApp:Jd,getApps:Cq,initializeApp:L3,onLog:Nq,registerVersion:On,setLogLevel:Oq,FirebaseError:Fi},Symbol.toStringTag,{value:"Module"}));/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function EE(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);ie,"Short delay should be less than long delay!"),this.isMobile=f9()||p9()}get(){return Gq()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function IE(t,e){Ro(t.emulator,"Emulator should always be set here");const{url:r}=t.emulator;return e?`${r}${e.startsWith("/")?e.slice(1):e}`:r}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class j3{static initialize(e,r,n){this.fetchImpl=e,r&&(this.headersImpl=r),n&&(this.responseImpl=n)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self!="undefined"&&"fetch"in self)return self.fetch;Os("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self!="undefined"&&"Headers"in self)return self.Headers;Os("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!="undefined"&&"Response"in self)return self.Response;Os("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Xq={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:"internal-error",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",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"};/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Yq=new Qd(3e4,6e4);function Pr(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function Kr(t,e,r,n,i={}){return V3(t,i,async()=>{let s={},o={};n&&(e==="GET"?o=n:s={body:JSON.stringify(n)});const a=of(Object.assign({key:t.config.apiKey},o)).slice(1),u=await t._getAdditionalHeaders();return u["Content-Type"]="application/json",t.languageCode&&(u["X-Firebase-Locale"]=t.languageCode),j3.fetch()(z3(t,t.config.apiHost,r,a),Object.assign({method:e,headers:u,referrerPolicy:"no-referrer"},s))})}async function V3(t,e,r){t._canInitEmulator=!1;const n=Object.assign(Object.assign({},Xq),e);try{const i=new Jq(t),s=await Promise.race([r(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw fh(t,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[u,c]=a.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw fh(t,"credential-already-in-use",o);if(u==="EMAIL_EXISTS")throw fh(t,"email-already-in-use",o);if(u==="USER_DISABLED")throw fh(t,"user-disabled",o);const l=n[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw q3(t,l,c);Jn(t,l)}}catch(i){if(i instanceof Fi)throw i;Jn(t,"network-request-failed")}}async function Ho(t,e,r,n,i={}){const s=await Kr(t,e,r,n,i);return"mfaPendingCredential"in s&&Jn(t,"multi-factor-auth-required",{_serverResponse:s}),s}function z3(t,e,r,n){const i=`${e}${r}?${n}`;return t.config.emulator?IE(t.config,i):`${t.config.apiScheme}://${i}`}class Jq{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((r,n)=>{this.timer=setTimeout(()=>n(ui(this.auth,"network-request-failed")),Yq.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function fh(t,e,r){const n={appName:t.name};r.email&&(n.email=r.email),r.phoneNumber&&(n.phoneNumber=r.phoneNumber);const i=ui(t,e,n);return i.customData._tokenResponse=r,i}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Qq(t,e){return Kr(t,"POST","/v1/accounts:delete",e)}async function Zq(t,e){return Kr(t,"POST","/v1/accounts:update",e)}async function ej(t,e){return Kr(t,"POST","/v1/accounts:lookup",e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function kh(t){if(!!t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function tj(t,e=!1){const r=Qe(t),n=await r.getIdToken(e),i=Nm(n);Pe(i&&i.exp&&i.auth_time&&i.iat,r.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:n,authTime:kh(l_(i.auth_time)),issuedAtTime:kh(l_(i.iat)),expirationTime:kh(l_(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function l_(t){return Number(t)*1e3}function Nm(t){var e;const[r,n,i]=t.split(".");if(r===void 0||n===void 0||i===void 0)return Ig("JWT malformed, contained fewer than 3 sections"),null;try{const s=T3(n);return s?JSON.parse(s):(Ig("Failed to decode base64 JWT payload"),null)}catch(s){return Ig("Caught error parsing JWT payload as JSON",(e=s)===null||e===void 0?void 0:e.toString()),null}}function rj(t){const e=Nm(t);return Pe(e,"internal-error"),Pe(typeof e.exp!="undefined","internal-error"),Pe(typeof e.iat!="undefined","internal-error"),Number(e.exp)-Number(e.iat)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function No(t,e,r=!1){if(r)return e;try{return await e}catch(n){throw n instanceof Fi&&nj(n)&&t.auth.currentUser===t&&await t.auth.signOut(),n}}function nj({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ij{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){var r;if(e){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const i=((r=this.user.stsTokenManager.expirationTime)!==null&&r!==void 0?r:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const r=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},r)}async iteration(){var e;try{await this.user.getIdToken(!0)}catch(r){((e=r)===null||e===void 0?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class H3{constructor(e,r){this.createdAt=e,this.lastLoginAt=r,this._initializeTime()}_initializeTime(){this.lastSignInTime=kh(this.lastLoginAt),this.creationTime=kh(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function fd(t){var e;const r=t.auth,n=await t.getIdToken(),i=await No(t,ej(r,{idToken:n}));Pe(i==null?void 0:i.users.length,r,"internal-error");const s=i.users[0];t._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?aj(s.providerUserInfo):[],a=oj(t.providerData,o),u=t.isAnonymous,c=!(t.email&&s.passwordHash)&&!(a!=null&&a.length),l=u?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:a,metadata:new H3(s.createdAt,s.lastLoginAt),isAnonymous:l};Object.assign(t,h)}async function sj(t){const e=Qe(t);await fd(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function oj(t,e){return[...t.filter(n=>!e.some(i=>i.providerId===n.providerId)),...e]}function aj(t){return t.map(e=>{var{providerId:r}=e,n=EE(e,["providerId"]);return{providerId:r,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function uj(t,e){const r=await V3(t,{},async()=>{const n=of({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,o=z3(t,i,"/v1/token",`key=${s}`),a=await t._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",j3.fetch()(o,{method:"POST",headers:a,body:n})});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hd{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Pe(e.idToken,"internal-error"),Pe(typeof e.idToken!="undefined","internal-error"),Pe(typeof e.refreshToken!="undefined","internal-error");const r="expiresIn"in e&&typeof e.expiresIn!="undefined"?Number(e.expiresIn):rj(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,r)}async getToken(e,r=!1){return Pe(!this.accessToken||this.refreshToken,e,"user-token-expired"),!r&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,r){const{accessToken:n,refreshToken:i,expiresIn:s}=await uj(e,r);this.updateTokensAndExpiration(n,i,Number(s))}updateTokensAndExpiration(e,r,n){this.refreshToken=r||null,this.accessToken=e||null,this.expirationTime=Date.now()+n*1e3}static fromJSON(e,r){const{refreshToken:n,accessToken:i,expirationTime:s}=r,o=new hd;return n&&(Pe(typeof n=="string","internal-error",{appName:e}),o.refreshToken=n),i&&(Pe(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(Pe(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),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 hd,this.toJSON())}_performRefresh(){return Os("not implemented")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Zo(t,e){Pe(typeof t=="string"||typeof t=="undefined","internal-error",{appName:e})}class qu{constructor(e){var{uid:r,auth:n,stsTokenManager:i}=e,s=EE(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ij(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=r,this.auth=n,this.stsTokenManager=i,this.accessToken=i.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 H3(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const r=await No(this,this.stsTokenManager.getToken(this.auth,e));return Pe(r,this.auth,"internal-error"),this.accessToken!==r&&(this.accessToken=r,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),r}getIdTokenResult(e){return tj(this,e)}reload(){return sj(this)}_assign(e){this!==e&&(Pe(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(r=>Object.assign({},r)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){return new qu(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}))}_onReload(e){Pe(!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,r=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),r&&await fd(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await No(this,Qq(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},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,r){var n,i,s,o,a,u,c,l;const h=(n=r.displayName)!==null&&n!==void 0?n:void 0,d=(i=r.email)!==null&&i!==void 0?i:void 0,_=(s=r.phoneNumber)!==null&&s!==void 0?s:void 0,T=(o=r.photoURL)!==null&&o!==void 0?o:void 0,D=(a=r.tenantId)!==null&&a!==void 0?a:void 0,N=(u=r._redirectEventId)!==null&&u!==void 0?u:void 0,O=(c=r.createdAt)!==null&&c!==void 0?c:void 0,L=(l=r.lastLoginAt)!==null&&l!==void 0?l:void 0,{uid:J,emailVerified:q,isAnonymous:z,providerData:ee,stsTokenManager:G}=r;Pe(J&&G,e,"internal-error");const ne=hd.fromJSON(this.name,G);Pe(typeof J=="string",e,"internal-error"),Zo(h,e.name),Zo(d,e.name),Pe(typeof q=="boolean",e,"internal-error"),Pe(typeof z=="boolean",e,"internal-error"),Zo(_,e.name),Zo(T,e.name),Zo(D,e.name),Zo(N,e.name),Zo(O,e.name),Zo(L,e.name);const ue=new qu({uid:J,auth:e,email:d,emailVerified:q,displayName:h,isAnonymous:z,photoURL:T,phoneNumber:_,tenantId:D,stsTokenManager:ne,createdAt:O,lastLoginAt:L});return ee&&Array.isArray(ee)&&(ue.providerData=ee.map(_e=>Object.assign({},_e))),N&&(ue._redirectEventId=N),ue}static async _fromIdTokenResponse(e,r,n=!1){const i=new hd;i.updateFromServerResponse(r);const s=new qu({uid:r.localId,auth:e,stsTokenManager:i,isAnonymous:n});return await fd(s),s}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class K3{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,r){this.storage[e]=r}async _get(e){const r=this.storage[e];return r===void 0?null:r}async _remove(e){delete this.storage[e]}_addListener(e,r){}_removeListener(e,r){}}K3.type="NONE";const $2=K3;/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Tg(t,e,r){return`firebase:${t}:${e}:${r}`}class cl{constructor(e,r,n){this.persistence=e,this.auth=r,this.userKey=n;const{config:i,name:s}=this.auth;this.fullUserKey=Tg(this.userKey,i.apiKey,s),this.fullPersistenceKey=Tg("persistence",i.apiKey,s),this.boundEventHandler=r._onStorageEvent.bind(r),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);return e?qu._fromJSON(this.auth,e):null}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 r=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,r)return this.setCurrentUser(r)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,r,n="authUser"){if(!r.length)return new cl(go($2),e,n);const i=(await Promise.all(r.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let s=i[0]||go($2);const o=Tg(n,e.config.apiKey,e.name);let a=null;for(const c of r)try{const l=await c._get(o);if(l){const h=qu._fromJSON(e,l);c!==s&&(a=h),s=c;break}}catch{}const u=i.filter(c=>c._shouldAllowMigration);return!s._shouldAllowMigration||!u.length?new cl(s,e,n):(s=u[0],a&&await s._set(o,a.toJSON()),await Promise.all(r.map(async c=>{if(c!==s)try{await c._remove(o)}catch{}})),new cl(s,e,n))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function F2(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(X3(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(G3(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(J3(e))return"Blackberry";if(Q3(e))return"Webos";if(TE(e))return"Safari";if((e.includes("chrome/")||W3(e))&&!e.includes("edge/"))return"Chrome";if(Y3(e))return"Android";{const r=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=t.match(r);if((n==null?void 0:n.length)===2)return n[1]}return"Other"}function G3(t=Mr()){return/firefox\//i.test(t)}function TE(t=Mr()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function W3(t=Mr()){return/crios\//i.test(t)}function X3(t=Mr()){return/iemobile/i.test(t)}function Y3(t=Mr()){return/android/i.test(t)}function J3(t=Mr()){return/blackberry/i.test(t)}function Q3(t=Mr()){return/webos/i.test(t)}function Om(t=Mr()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Rde(t=Mr()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(t)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(t)}function cj(t=Mr()){var e;return Om(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function lj(){return g9()&&document.documentMode===10}function Z3(t=Mr()){return Om(t)||Y3(t)||Q3(t)||J3(t)||/windows phone/i.test(t)||X3(t)}function fj(){try{return!!(window&&window!==window.top)}catch{return!1}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function e6(t,e=[]){let r;switch(t){case"Browser":r=F2(Mr());break;case"Worker":r=`${F2(Mr())}-${t}`;break;default:r=t}const n=e.length?e.join(","):"FirebaseCore-web";return`${r}/JsCore/${af}/${n}`}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hj{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,r){const n=s=>new Promise((o,a)=>{try{const u=e(s);o(u)}catch(u){a(u)}});n.onAbort=r,this.queue.push(n);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){var r;if(this.auth.currentUser===e)return;const n=[];try{for(const i of this.queue)await i(e),i.onAbort&&n.push(i.onAbort)}catch(i){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:(r=i)===null||r===void 0?void 0:r.message})}}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class dj{constructor(e,r,n){this.app=e,this.heartbeatServiceProvider=r,this.config=n,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new U2(this),this.idTokenSubscription=new U2(this),this.beforeStateQueue=new hj(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=U3,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=n.sdkClientVersion}_initializeWithPersistence(e,r){return r&&(this._popupRedirectResolver=go(r)),this._initializationPromise=this.queue(async()=>{var n,i;if(!this._deleted&&(this.persistenceManager=await cl.create(this,e),!this._deleted)){if(!((n=this._popupRedirectResolver)===null||n===void 0)&&n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(r),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.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 initializeCurrentUser(e){var r;const n=await this.assertedPersistence.getCurrentUser();let i=n,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId,a=i==null?void 0:i._redirectEventId,u=await this.tryRedirectSignIn(e);(!o||o===a)&&(u==null?void 0:u.user)&&(i=u.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return Pe(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let r=null;try{r=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return r}async reloadAndSetCurrentUserOrClear(e){var r;try{await fd(e)}catch(n){if(((r=n)===null||r===void 0?void 0:r.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Wq()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const r=e?Qe(e):null;return r&&Pe(r.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(r&&r._clone(this))}async _updateCurrentUser(e,r=!1){if(!this._deleted)return e&&Pe(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),r||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(go(e))})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new wc("auth","Firebase",e())}onAuthStateChanged(e,r,n){return this.registerStateListener(this.authStateSubscription,e,r,n)}beforeAuthStateChanged(e,r){return this.beforeStateQueue.pushCallback(e,r)}onIdTokenChanged(e,r,n){return this.registerStateListener(this.idTokenSubscription,e,r,n)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,r){const n=await this.getOrInitRedirectPersistenceManager(r);return e===null?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const r=e&&go(e)||this._popupRedirectResolver;Pe(r,this,"argument-error"),this.redirectPersistenceManager=await cl.create(this,[go(r._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var r,n;return this._isInitialized&&await this.queue(async()=>{}),((r=this._currentUser)===null||r===void 0?void 0:r._redirectEventId)===e?this._currentUser:((n=this.redirectUser)===null||n===void 0?void 0:n._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(){var e,r;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=(r=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&r!==void 0?r:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,r,n,i){if(this._deleted)return()=>{};const s=typeof r=="function"?r:r.next.bind(r),o=this._isInitialized?Promise.resolve():this._initializationPromise;return Pe(o,this,"internal-error"),o.then(()=>s(this.currentUser)),typeof r=="function"?e.addObserver(r,n,i):e.addObserver(r)}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 Pe(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=e6(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const r={["X-Client-Version"]:this.clientVersion};this.app.options.appId&&(r["X-Firebase-gmpid"]=this.app.options.appId);const n=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());return n&&(r["X-Firebase-Client"]=n),r}}function Bn(t){return Qe(t)}class U2{constructor(e){this.auth=e,this.observer=null,this.addObserver=M9(r=>this.observer=r)}get next(){return Pe(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function pj(t,e,r){const n=Bn(t);Pe(n._canInitEmulator,n,"emulator-config-failed"),Pe(/^https?:\/\//.test(e),n,"invalid-emulator-scheme");const i=!!(r!=null&&r.disableWarnings),s=t6(e),{host:o,port:a}=gj(e),u=a===null?"":`:${a}`;n.config.emulator={url:`${s}//${o}${u}/`},n.settings.appVerificationDisabledForTesting=!0,n.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||mj()}function t6(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function gj(t){const e=t6(t),r=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!r)return{host:"",port:null};const n=r[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(n);if(i){const s=i[1];return{host:s,port:q2(n.substr(s.length+1))}}else{const[s,o]=n.split(":");return{host:s,port:q2(o)}}}function q2(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function mj(){function t(){const e=document.createElement("p"),r=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",r.position="fixed",r.width="100%",r.backgroundColor="#ffffff",r.border=".1em solid #000000",r.color="#b50000",r.bottom="0px",r.left="0px",r.margin="0px",r.zIndex="10000",r.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console!="undefined"&&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!="undefined"&&typeof document!="undefined"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Zd{constructor(e,r){this.providerId=e,this.signInMethod=r}toJSON(){return Os("not implemented")}_getIdTokenResponse(e){return Os("not implemented")}_linkToIdToken(e,r){return Os("not implemented")}_getReauthenticationResolver(e){return Os("not implemented")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function r6(t,e){return Kr(t,"POST","/v1/accounts:resetPassword",Pr(t,e))}async function n6(t,e){return Kr(t,"POST","/v1/accounts:update",e)}async function vj(t,e){return Kr(t,"POST","/v1/accounts:update",Pr(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function yj(t,e){return Ho(t,"POST","/v1/accounts:signInWithPassword",Pr(t,e))}async function Dm(t,e){return Kr(t,"POST","/v1/accounts:sendOobCode",Pr(t,e))}async function _j(t,e){return Dm(t,e)}async function bj(t,e){return Dm(t,e)}async function wj(t,e){return Dm(t,e)}async function Ej(t,e){return Dm(t,e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function xj(t,e){return Ho(t,"POST","/v1/accounts:signInWithEmailLink",Pr(t,e))}async function Sj(t,e){return Ho(t,"POST","/v1/accounts:signInWithEmailLink",Pr(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class dd extends Zd{constructor(e,r,n,i=null){super("password",n),this._email=e,this._password=r,this._tenantId=i}static _fromEmailAndPassword(e,r){return new dd(e,r,"password")}static _fromEmailAndCode(e,r,n=null){return new dd(e,r,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const r=typeof e=="string"?JSON.parse(e):e;if((r==null?void 0:r.email)&&(r==null?void 0:r.password)){if(r.signInMethod==="password")return this._fromEmailAndPassword(r.email,r.password);if(r.signInMethod==="emailLink")return this._fromEmailAndCode(r.email,r.password,r.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return yj(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return xj(e,{email:this._email,oobCode:this._password});default:Jn(e,"internal-error")}}async _linkToIdToken(e,r){switch(this.signInMethod){case"password":return n6(e,{idToken:r,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return Sj(e,{idToken:r,email:this._email,oobCode:this._password});default:Jn(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function xo(t,e){return Ho(t,"POST","/v1/accounts:signInWithIdp",Pr(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Ij="http://localhost";class Oo extends Zd{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const r=new Oo(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(r.idToken=e.idToken),e.accessToken&&(r.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(r.nonce=e.nonce),e.pendingToken&&(r.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(r.accessToken=e.oauthToken,r.secret=e.oauthTokenSecret):Jn("argument-error"),r}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 r=typeof e=="string"?JSON.parse(e):e,{providerId:n,signInMethod:i}=r,s=EE(r,["providerId","signInMethod"]);if(!n||!i)return null;const o=new Oo(n,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const r=this.buildRequest();return xo(e,r)}_linkToIdToken(e,r){const n=this.buildRequest();return n.idToken=r,xo(e,n)}_getReauthenticationResolver(e){const r=this.buildRequest();return r.autoCreate=!1,xo(e,r)}buildRequest(){const e={requestUri:Ij,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const r={};this.idToken&&(r.id_token=this.idToken),this.accessToken&&(r.access_token=this.accessToken),this.secret&&(r.oauth_token_secret=this.secret),r.providerId=this.providerId,this.nonce&&!this.pendingToken&&(r.nonce=this.nonce),e.postBody=of(r)}return e}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Tj(t,e){return Kr(t,"POST","/v1/accounts:sendVerificationCode",Pr(t,e))}async function Aj(t,e){return Ho(t,"POST","/v1/accounts:signInWithPhoneNumber",Pr(t,e))}async function kj(t,e){const r=await Ho(t,"POST","/v1/accounts:signInWithPhoneNumber",Pr(t,e));if(r.temporaryProof)throw fh(t,"account-exists-with-different-credential",r);return r}const Mj={USER_NOT_FOUND:"user-not-found"};async function Cj(t,e){const r=Object.assign(Object.assign({},e),{operation:"REAUTH"});return Ho(t,"POST","/v1/accounts:signInWithPhoneNumber",Pr(t,r),Mj)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ju extends Zd{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,r){return new ju({verificationId:e,verificationCode:r})}static _fromTokenResponse(e,r){return new ju({phoneNumber:e,temporaryProof:r})}_getIdTokenResponse(e){return Aj(e,this._makeVerificationRequest())}_linkToIdToken(e,r){return kj(e,Object.assign({idToken:r},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return Cj(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:r,verificationId:n,verificationCode:i}=this.params;return e&&r?{temporaryProof:e,phoneNumber:r}:{sessionInfo:n,code:i}}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:r,verificationCode:n,phoneNumber:i,temporaryProof:s}=e;return!n&&!r&&!i&&!s?null:new ju({verificationId:r,verificationCode:n,phoneNumber:i,temporaryProof:s})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Rj(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 Nj(t){const e=ch(lh(t)).link,r=e?ch(lh(e)).deep_link_id:null,n=ch(lh(t)).deep_link_id;return(n?ch(lh(n)).link:null)||n||r||e||t}class Pm{constructor(e){var r,n,i,s,o,a;const u=ch(lh(e)),c=(r=u.apiKey)!==null&&r!==void 0?r:null,l=(n=u.oobCode)!==null&&n!==void 0?n:null,h=Rj((i=u.mode)!==null&&i!==void 0?i:null);Pe(c&&l&&h,"argument-error"),this.apiKey=c,this.operation=h,this.code=l,this.continueUrl=(s=u.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=u.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(a=u.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const r=Nj(e);try{return new Pm(r)}catch{return null}}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ec{constructor(){this.providerId=Ec.PROVIDER_ID}static credential(e,r){return dd._fromEmailAndPassword(e,r)}static credentialWithLink(e,r){const n=Pm.parseLink(r);return Pe(n,"argument-error"),dd._fromEmailAndCode(e,n.code,n.tenantId)}}Ec.PROVIDER_ID="password";Ec.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Ec.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ko{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}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class cf extends Ko{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Ag extends cf{static credentialFromJSON(e){const r=typeof e=="string"?JSON.parse(e):e;return Pe("providerId"in r&&"signInMethod"in r,"argument-error"),Oo._fromParams(r)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return Pe(e.idToken||e.accessToken,"argument-error"),Oo._fromParams(Object.assign(Object.assign({},e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return Ag.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return Ag.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:r,oauthAccessToken:n,oauthTokenSecret:i,pendingToken:s,nonce:o,providerId:a}=e;if(!n&&!i&&!r&&!s||!a)return null;try{return new Ag(a)._credential({idToken:r,accessToken:n,nonce:o,pendingToken:s})}catch{return null}}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ha extends cf{constructor(){super("facebook.com")}static credential(e){return Oo._fromParams({providerId:ha.PROVIDER_ID,signInMethod:ha.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ha.credentialFromTaggedObject(e)}static credentialFromError(e){return ha.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return ha.credential(e.oauthAccessToken)}catch{return null}}}ha.FACEBOOK_SIGN_IN_METHOD="facebook.com";ha.PROVIDER_ID="facebook.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class da extends cf{constructor(){super("google.com"),this.addScope("profile")}static credential(e,r){return Oo._fromParams({providerId:da.PROVIDER_ID,signInMethod:da.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:r})}static credentialFromResult(e){return da.credentialFromTaggedObject(e)}static credentialFromError(e){return da.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:r,oauthAccessToken:n}=e;if(!r&&!n)return null;try{return da.credential(r,n)}catch{return null}}}da.GOOGLE_SIGN_IN_METHOD="google.com";da.PROVIDER_ID="google.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class pa extends cf{constructor(){super("github.com")}static credential(e){return Oo._fromParams({providerId:pa.PROVIDER_ID,signInMethod:pa.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return pa.credentialFromTaggedObject(e)}static credentialFromError(e){return pa.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return pa.credential(e.oauthAccessToken)}catch{return null}}}pa.GITHUB_SIGN_IN_METHOD="github.com";pa.PROVIDER_ID="github.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Oj="http://localhost";class pd extends Zd{constructor(e,r){super(e,e),this.pendingToken=r}_getIdTokenResponse(e){const r=this.buildRequest();return xo(e,r)}_linkToIdToken(e,r){const n=this.buildRequest();return n.idToken=r,xo(e,n)}_getReauthenticationResolver(e){const r=this.buildRequest();return r.autoCreate=!1,xo(e,r)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){const r=typeof e=="string"?JSON.parse(e):e,{providerId:n,signInMethod:i,pendingToken:s}=r;return!n||!i||!s||n!==i?null:new pd(n,s)}static _create(e,r){return new pd(e,r)}buildRequest(){return{requestUri:Oj,returnSecureToken:!0,pendingToken:this.pendingToken}}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Dj="saml.";class t1 extends Ko{constructor(e){Pe(e.startsWith(Dj),"argument-error"),super(e)}static credentialFromResult(e){return t1.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return t1.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){const r=pd.fromJSON(e);return Pe(r,"argument-error"),r}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{pendingToken:r,providerId:n}=e;if(!r||!n)return null;try{return pd._create(n,r)}catch{return null}}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ga extends cf{constructor(){super("twitter.com")}static credential(e,r){return Oo._fromParams({providerId:ga.PROVIDER_ID,signInMethod:ga.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:r})}static credentialFromResult(e){return ga.credentialFromTaggedObject(e)}static credentialFromError(e){return ga.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:r,oauthTokenSecret:n}=e;if(!r||!n)return null;try{return ga.credential(r,n)}catch{return null}}}ga.TWITTER_SIGN_IN_METHOD="twitter.com";ga.PROVIDER_ID="twitter.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function i6(t,e){return Ho(t,"POST","/v1/accounts:signUp",Pr(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ni{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,r,n,i=!1){const s=await qu._fromIdTokenResponse(e,n,i),o=j2(n);return new Ni({user:s,providerId:o,_tokenResponse:n,operationType:r})}static async _forOperation(e,r,n){await e._updateTokensIfNecessary(n,!0);const i=j2(n);return new Ni({user:e,providerId:i,_tokenResponse:n,operationType:r})}}function j2(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Nde(t){var e;const r=Bn(t);if(await r._initializationPromise,!((e=r.currentUser)===null||e===void 0)&&e.isAnonymous)return new Ni({user:r.currentUser,providerId:null,operationType:"signIn"});const n=await i6(r,{returnSecureToken:!0}),i=await Ni._fromIdTokenResponse(r,"signIn",n,!0);return await r._updateCurrentUser(i.user),i}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class p0 extends Fi{constructor(e,r,n,i){var s;super(r.code,r.message),this.operationType=n,this.user=i,Object.setPrototypeOf(this,p0.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:r.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,r,n,i){return new p0(e,r,n,i)}}function s6(t,e,r,n){return(e==="reauthenticate"?r._getReauthenticationResolver(t):r._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?p0._fromErrorAndOperation(t,s,e,n):s})}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function o6(t){return new Set(t.map(({providerId:e})=>e).filter(e=>!!e))}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Ode(t,e){const r=Qe(t);await Lm(!0,r,e);const{providerUserInfo:n}=await Zq(r.auth,{idToken:await r.getIdToken(),deleteProvider:[e]}),i=o6(n||[]);return r.providerData=r.providerData.filter(s=>i.has(s.providerId)),i.has("phone")||(r.phoneNumber=null),await r.auth._persistUserIfCurrent(r),r}async function AE(t,e,r=!1){const n=await No(t,e._linkToIdToken(t.auth,await t.getIdToken()),r);return Ni._forOperation(t,"link",n)}async function Lm(t,e,r){await fd(e);const n=o6(e.providerData),i=t===!1?"provider-already-linked":"no-such-provider";Pe(n.has(r)===t,e.auth,i)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function a6(t,e,r=!1){var n;const{auth:i}=t,s="reauthenticate";try{const o=await No(t,s6(i,s,e,t),r);Pe(o.idToken,i,"internal-error");const a=Nm(o.idToken);Pe(a,i,"internal-error");const{sub:u}=a;return Pe(t.uid===u,i,"user-mismatch"),Ni._forOperation(t,s,o)}catch(o){throw((n=o)===null||n===void 0?void 0:n.code)==="auth/user-not-found"&&Jn(i,"user-mismatch"),o}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function u6(t,e,r=!1){const n="signIn",i=await s6(t,n,e),s=await Ni._fromIdTokenResponse(t,n,i);return r||await t._updateCurrentUser(s.user),s}async function kE(t,e){return u6(Bn(t),e)}async function Pj(t,e){const r=Qe(t);return await Lm(!1,r,e.providerId),AE(r,e)}async function Lj(t,e){return a6(Qe(t),e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Bj(t,e){return Ho(t,"POST","/v1/accounts:signInWithCustomToken",Pr(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Dde(t,e){const r=Bn(t),n=await Bj(r,{token:e,returnSecureToken:!0}),i=await Ni._fromIdTokenResponse(r,"signIn",n);return await r._updateCurrentUser(i.user),i}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Bm{constructor(e,r){this.factorId=e,this.uid=r.mfaEnrollmentId,this.enrollmentTime=new Date(r.enrolledAt).toUTCString(),this.displayName=r.displayName}static _fromServerResponse(e,r){return"phoneInfo"in r?ME._fromServerResponse(e,r):Jn(e,"internal-error")}}class ME extends Bm{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,r){return new ME(r)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function $m(t,e,r){var n;Pe(((n=r.url)===null||n===void 0?void 0:n.length)>0,t,"invalid-continue-uri"),Pe(typeof r.dynamicLinkDomain=="undefined"||r.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),e.continueUrl=r.url,e.dynamicLinkDomain=r.dynamicLinkDomain,e.canHandleCodeInApp=r.handleCodeInApp,r.iOS&&(Pe(r.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),e.iOSBundleId=r.iOS.bundleId),r.android&&(Pe(r.android.packageName.length>0,t,"missing-android-pkg-name"),e.androidInstallApp=r.android.installApp,e.androidMinimumVersionCode=r.android.minimumVersion,e.androidPackageName=r.android.packageName)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Pde(t,e,r){const n=Qe(t),i={requestType:"PASSWORD_RESET",email:e};r&&$m(n,i,r),await bj(n,i)}async function Lde(t,e,r){await r6(Qe(t),{oobCode:e,newPassword:r})}async function Bde(t,e){await vj(Qe(t),{oobCode:e})}async function $j(t,e){const r=Qe(t),n=await r6(r,{oobCode:e}),i=n.requestType;switch(Pe(i,r,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":Pe(n.newEmail,r,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":Pe(n.mfaInfo,r,"internal-error");default:Pe(n.email,r,"internal-error")}let s=null;return n.mfaInfo&&(s=Bm._fromServerResponse(Bn(r),n.mfaInfo)),{data:{email:(n.requestType==="VERIFY_AND_CHANGE_EMAIL"?n.newEmail:n.email)||null,previousEmail:(n.requestType==="VERIFY_AND_CHANGE_EMAIL"?n.email:n.newEmail)||null,multiFactorInfo:s},operation:i}}async function $de(t,e){const{data:r}=await $j(Qe(t),e);return r.email}async function Fde(t,e,r){const n=Bn(t),i=await i6(n,{returnSecureToken:!0,email:e,password:r}),s=await Ni._fromIdTokenResponse(n,"signIn",i);return await n._updateCurrentUser(s.user),s}function Ude(t,e,r){return kE(Qe(t),Ec.credential(e,r))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function qde(t,e,r){const n=Qe(t),i={requestType:"EMAIL_SIGNIN",email:e};Pe(r.handleCodeInApp,n,"argument-error"),r&&$m(n,i,r),await wj(n,i)}function jde(t,e){const r=Pm.parseLink(e);return(r==null?void 0:r.operation)==="EMAIL_SIGNIN"}async function Vde(t,e,r){const n=Qe(t),i=Ec.credentialWithLink(e,r||ld());return Pe(i._tenantId===(n.tenantId||null),n,"tenant-id-mismatch"),kE(n,i)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Fj(t,e){return Kr(t,"POST","/v1/accounts:createAuthUri",Pr(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function zde(t,e){const r=SE()?ld():"http://localhost",n={identifier:e,continueUri:r},{signinMethods:i}=await Fj(Qe(t),n);return i||[]}async function Hde(t,e){const r=Qe(t),n=await t.getIdToken(),i={requestType:"VERIFY_EMAIL",idToken:n};e&&$m(r.auth,i,e);const{email:s}=await _j(r.auth,i);s!==t.email&&await t.reload()}async function Kde(t,e,r){const n=Qe(t),i=await t.getIdToken(),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:i,newEmail:e};r&&$m(n.auth,s,r);const{email:o}=await Ej(n.auth,s);o!==t.email&&await t.reload()}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Uj(t,e){return Kr(t,"POST","/v1/accounts:update",e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Gde(t,{displayName:e,photoURL:r}){if(e===void 0&&r===void 0)return;const n=Qe(t),s={idToken:await n.getIdToken(),displayName:e,photoUrl:r,returnSecureToken:!0},o=await No(n,Uj(n.auth,s));n.displayName=o.displayName||null,n.photoURL=o.photoUrl||null;const a=n.providerData.find(({providerId:u})=>u==="password");a&&(a.displayName=n.displayName,a.photoURL=n.photoURL),await n._updateTokensIfNecessary(o)}function Wde(t,e){return c6(Qe(t),e,null)}function Xde(t,e){return c6(Qe(t),null,e)}async function c6(t,e,r){const{auth:n}=t,s={idToken:await t.getIdToken(),returnSecureToken:!0};e&&(s.email=e),r&&(s.password=r);const o=await No(t,n6(n,s));await t._updateTokensIfNecessary(o,!0)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function qj(t){var e,r;if(!t)return null;const{providerId:n}=t,i=t.rawUserInfo?JSON.parse(t.rawUserInfo):{},s=t.isNewUser||t.kind==="identitytoolkit#SignupNewUserResponse";if(!n&&(t==null?void 0:t.idToken)){const o=(r=(e=Nm(t.idToken))===null||e===void 0?void 0:e.firebase)===null||r===void 0?void 0:r.sign_in_provider;if(o){const a=o!=="anonymous"&&o!=="custom"?o:null;return new ll(s,a)}}if(!n)return null;switch(n){case"facebook.com":return new jj(s,i);case"github.com":return new Vj(s,i);case"google.com":return new zj(s,i);case"twitter.com":return new Hj(s,i,t.screenName||null);case"custom":case"anonymous":return new ll(s,null);default:return new ll(s,n,i)}}class ll{constructor(e,r,n={}){this.isNewUser=e,this.providerId=r,this.profile=n}}class l6 extends ll{constructor(e,r,n,i){super(e,r,n),this.username=i}}class jj extends ll{constructor(e,r){super(e,"facebook.com",r)}}class Vj extends l6{constructor(e,r){super(e,"github.com",r,typeof(r==null?void 0:r.login)=="string"?r==null?void 0:r.login:null)}}class zj extends ll{constructor(e,r){super(e,"google.com",r)}}class Hj extends l6{constructor(e,r,n){super(e,"twitter.com",r,n)}}function Yde(t){const{user:e,_tokenResponse:r}=t;return e.isAnonymous&&!r?{providerId:null,isNewUser:!1,profile:null}:qj(r)}function Kj(t,e,r,n){return Qe(t).onIdTokenChanged(e,r,n)}function Gj(t,e,r){return Qe(t).beforeAuthStateChanged(e,r)}function Jde(t){return Qe(t).signOut()}class Tu{constructor(e,r,n){this.type=e,this.credential=r,this.auth=n}static _fromIdtoken(e,r){return new Tu("enroll",e,r)}static _fromMfaPendingCredential(e){return new Tu("signin",e)}toJSON(){return{multiFactorSession:{[this.type==="enroll"?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var r,n;if(e!=null&&e.multiFactorSession){if(!((r=e.multiFactorSession)===null||r===void 0)&&r.pendingCredential)return Tu._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(!((n=e.multiFactorSession)===null||n===void 0)&&n.idToken)return Tu._fromIdtoken(e.multiFactorSession.idToken)}return null}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class CE{constructor(e,r,n){this.session=e,this.hints=r,this.signInResolver=n}static _fromError(e,r){const n=Bn(e),i=r.customData._serverResponse,s=(i.mfaInfo||[]).map(a=>Bm._fromServerResponse(n,a));Pe(i.mfaPendingCredential,n,"internal-error");const o=Tu._fromMfaPendingCredential(i.mfaPendingCredential);return new CE(o,s,async a=>{const u=await a._process(n,o);delete i.mfaInfo,delete i.mfaPendingCredential;const c=Object.assign(Object.assign({},i),{idToken:u.idToken,refreshToken:u.refreshToken});switch(r.operationType){case"signIn":const l=await Ni._fromIdTokenResponse(n,r.operationType,c);return await n._updateCurrentUser(l.user),l;case"reauthenticate":return Pe(r.user,n,"internal-error"),Ni._forOperation(r.user,r.operationType,c);default:Jn(n,"internal-error")}})}async resolveSignIn(e){const r=e;return this.signInResolver(r)}}function Qde(t,e){var r;const n=Qe(t),i=e;return Pe(e.customData.operationType,n,"argument-error"),Pe((r=i.customData._serverResponse)===null||r===void 0?void 0:r.mfaPendingCredential,n,"argument-error"),CE._fromError(n,i)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Wj(t,e){return Kr(t,"POST","/v2/accounts/mfaEnrollment:start",Pr(t,e))}function Xj(t,e){return Kr(t,"POST","/v2/accounts/mfaEnrollment:finalize",Pr(t,e))}function Yj(t,e){return Kr(t,"POST","/v2/accounts/mfaEnrollment:withdraw",Pr(t,e))}class RE{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(r=>{r.mfaInfo&&(this.enrolledFactors=r.mfaInfo.map(n=>Bm._fromServerResponse(e.auth,n)))})}static _fromUser(e){return new RE(e)}async getSession(){return Tu._fromIdtoken(await this.user.getIdToken(),this.user.auth)}async enroll(e,r){const n=e,i=await this.getSession(),s=await No(this.user,n._process(this.user.auth,i,r));return await this.user._updateTokensIfNecessary(s),this.user.reload()}async unenroll(e){var r;const n=typeof e=="string"?e:e.uid,i=await this.user.getIdToken(),s=await No(this.user,Yj(this.user.auth,{idToken:i,mfaEnrollmentId:n}));this.enrolledFactors=this.enrolledFactors.filter(({uid:o})=>o!==n),await this.user._updateTokensIfNecessary(s);try{await this.user.reload()}catch(o){if(((r=o)===null||r===void 0?void 0:r.code)!=="auth/user-token-expired")throw o}}}const f_=new WeakMap;function Zde(t){const e=Qe(t);return f_.has(e)||f_.set(e,RE._fromUser(e)),f_.get(e)}const g0="__sak";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class f6{constructor(e,r){this.storageRetriever=e,this.type=r}_isAvailable(){try{return this.storage?(this.storage.setItem(g0,"1"),this.storage.removeItem(g0),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,r){return this.storage.setItem(e,JSON.stringify(r)),Promise.resolve()}_get(e){const r=this.storage.getItem(e);return Promise.resolve(r?JSON.parse(r):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Jj(){const t=Mr();return TE(t)||Om(t)}const Qj=1e3,Zj=10;class h6 extends f6{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,r)=>this.onStorageEvent(e,r),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Jj()&&fj(),this.fallbackToPolling=Z3(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const r of Object.keys(this.listeners)){const n=this.storage.getItem(r),i=this.localCache[r];n!==i&&e(r,i,n)}}onStorageEvent(e,r=!1){if(!e.key){this.forAllChangedKeys((o,a,u)=>{this.notifyListeners(o,u)});return}const n=e.key;if(r?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(n);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(n,e.newValue):this.storage.removeItem(n);else if(this.localCache[n]===e.newValue&&!r)return}const i=()=>{const o=this.storage.getItem(n);!r&&this.localCache[n]===o||this.notifyListeners(n,o)},s=this.storage.getItem(n);lj()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Zj):i()}notifyListeners(e,r){this.localCache[e]=r;const n=this.listeners[e];if(n)for(const i of Array.from(n))i(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,r,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:r,newValue:n}),!0)})},Qj)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,r){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(r)}_removeListener(e,r){this.listeners[e]&&(this.listeners[e].delete(r),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,r){await super._set(e,r),this.localCache[e]=JSON.stringify(r)}async _get(e){const r=await super._get(e);return this.localCache[e]=JSON.stringify(r),r}async _remove(e){await super._remove(e),delete this.localCache[e]}}h6.type="LOCAL";const eV=h6;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class d6 extends f6{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,r){}_removeListener(e,r){}}d6.type="SESSION";const p6=d6;/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function tV(t){return Promise.all(t.map(async e=>{try{const r=await e;return{fulfilled:!0,value:r}}catch(r){return{fulfilled:!1,reason:r}}}))}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Fm{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const r=this.receivers.find(i=>i.isListeningto(e));if(r)return r;const n=new Fm(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const r=e,{eventId:n,eventType:i,data:s}=r.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;r.ports[0].postMessage({status:"ack",eventId:n,eventType:i});const a=Array.from(o).map(async c=>c(r.origin,s)),u=await tV(a);r.ports[0].postMessage({status:"done",eventId:n,eventType:i,response:u})}_subscribe(e,r){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(r)}_unsubscribe(e,r){this.handlersMap[e]&&r&&this.handlersMap[e].delete(r),(!r||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Fm.receivers=[];/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Um(t="",e=10){let r="";for(let n=0;n{const c=Um("",20);i.port1.start();const l=setTimeout(()=>{u(new Error("unsupported_event"))},n);o={messageChannel:i,onMessage(h){const d=h;if(d.data.eventId===c)switch(d.data.status){case"ack":clearTimeout(l),s=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(d.data.response);break;default:clearTimeout(l),clearTimeout(s),u(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:c,data:r},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Nr(){return window}function nV(t){Nr().location.href=t}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function NE(){return typeof Nr().WorkerGlobalScope!="undefined"&&typeof Nr().importScripts=="function"}async function iV(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function sV(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function oV(){return NE()?self:null}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const g6="firebaseLocalStorageDb",aV=1,m0="firebaseLocalStorage",m6="fbase_key";class ep{constructor(e){this.request=e}toPromise(){return new Promise((e,r)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{r(this.request.error)})})}}function qm(t,e){return t.transaction([m0],e?"readwrite":"readonly").objectStore(m0)}function uV(){const t=indexedDB.deleteDatabase(g6);return new ep(t).toPromise()}function r1(){const t=indexedDB.open(g6,aV);return new Promise((e,r)=>{t.addEventListener("error",()=>{r(t.error)}),t.addEventListener("upgradeneeded",()=>{const n=t.result;try{n.createObjectStore(m0,{keyPath:m6})}catch(i){r(i)}}),t.addEventListener("success",async()=>{const n=t.result;n.objectStoreNames.contains(m0)?e(n):(n.close(),await uV(),e(await r1()))})})}async function V2(t,e,r){const n=qm(t,!0).put({[m6]:e,value:r});return new ep(n).toPromise()}async function cV(t,e){const r=qm(t,!1).get(e),n=await new ep(r).toPromise();return n===void 0?null:n.value}function z2(t,e){const r=qm(t,!0).delete(e);return new ep(r).toPromise()}const lV=800,fV=3;class v6{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 r1(),this.db)}async _withRetries(e){let r=0;for(;;)try{const n=await this._openDb();return await e(n)}catch(n){if(r++>fV)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return NE()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Fm._getInstance(oV()),this.receiver._subscribe("keyChanged",async(e,r)=>({keyProcessed:(await this._poll()).includes(r.key)})),this.receiver._subscribe("ping",async(e,r)=>["keyChanged"])}async initializeSender(){var e,r;if(this.activeServiceWorker=await iV(),!this.activeServiceWorker)return;this.sender=new rV(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);!n||((e=n[0])===null||e===void 0?void 0:e.fulfilled)&&((r=n[0])===null||r===void 0?void 0:r.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||sV()!==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 r1();return await V2(e,g0,"1"),await z2(e,g0),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,r){return this._withPendingWrite(async()=>(await this._withRetries(n=>V2(n,e,r)),this.localCache[e]=r,this.notifyServiceWorker(e)))}async _get(e){const r=await this._withRetries(n=>cV(n,e));return this.localCache[e]=r,r}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(r=>z2(r,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=qm(i,!1).getAll();return new ep(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const r=[],n=new Set;for(const{fbase_key:i,value:s}of e)n.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),r.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!n.has(i)&&(this.notifyListeners(i,null),r.push(i));return r}notifyListeners(e,r){this.localCache[e]=r;const n=this.listeners[e];if(n)for(const i of Array.from(n))i(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),lV)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,r){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(r)}_removeListener(e,r){this.listeners[e]&&(this.listeners[e].delete(r),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}v6.type="LOCAL";const hV=v6;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function dV(t,e){return Kr(t,"POST","/v2/accounts/mfaSignIn:start",Pr(t,e))}function pV(t,e){return Kr(t,"POST","/v2/accounts/mfaSignIn:finalize",Pr(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function gV(t){return(await Kr(t,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function mV(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}function y6(t){return new Promise((e,r)=>{const n=document.createElement("script");n.setAttribute("src",t),n.onload=e,n.onerror=i=>{const s=ui("internal-error");s.customData=i,r(s)},n.type="text/javascript",n.charset="UTF-8",mV().appendChild(n)})}function _6(t){return`__${t}${Math.floor(Math.random()*1e6)}`}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const vV=500,yV=6e4,Qp=1e12;class _V{constructor(e){this.auth=e,this.counter=Qp,this._widgets=new Map}render(e,r){const n=this.counter;return this._widgets.set(n,new bV(e,this.auth.name,r||{})),this.counter++,n}reset(e){var r;const n=e||Qp;(r=this._widgets.get(n))===null||r===void 0||r.delete(),this._widgets.delete(n)}getResponse(e){var r;const n=e||Qp;return((r=this._widgets.get(n))===null||r===void 0?void 0:r.getResponse())||""}async execute(e){var r;const n=e||Qp;return(r=this._widgets.get(n))===null||r===void 0||r.execute(),""}}class bV{constructor(e,r,n){this.params=n,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const i=typeof e=="string"?document.getElementById(e):e;Pe(i,"argument-error",{appName:r}),this.container=i,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=wV(50);const{callback:e,"expired-callback":r}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,r)try{r()}catch{}this.isVisible&&this.execute()},yV)},vV))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}function wV(t){const e=[],r="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let n=0;n{const s=Nr().setTimeout(()=>{i(ui(e,"network-request-failed"))},EV.get());Nr()[h_]=()=>{Nr().clearTimeout(s),delete Nr()[h_];const a=Nr().grecaptcha;if(!a){i(ui(e,"internal-error"));return}const u=a.render;a.render=(c,l)=>{const h=u(c,l);return this.counter++,h},this.hostLanguage=r,n(a)};const o=`${xV}?${of({onload:h_,render:"explicit",hl:r})}`;y6(o).catch(()=>{clearTimeout(s),i(ui(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var r;return!!(!((r=Nr().grecaptcha)===null||r===void 0)&&r.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}function IV(t){return t.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(t)}class TV{async load(e){return new _V(e)}clearedOneInstance(){}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const b6="recaptcha",AV={theme:"light",type:"image"};class epe{constructor(e,r=Object.assign({},AV),n){this.parameters=r,this.type=b6,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=Bn(n),this.isInvisible=this.parameters.size==="invisible",Pe(typeof document!="undefined",this.auth,"operation-not-supported-in-this-environment");const i=typeof e=="string"?document.getElementById(e):e;Pe(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new TV:new SV,this.validateStartingState()}async verify(){this.assertNotDestroyed();const e=await this.render(),r=this.getAssertedRecaptcha(),n=r.getResponse(e);return n||new Promise(i=>{const s=o=>{!o||(this.tokenChangeListeners.delete(s),i(o))};this.tokenChangeListeners.add(s),this.isInvisible&&r.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(){Pe(!this.parameters.sitekey,this.auth,"argument-error"),Pe(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),Pe(typeof document!="undefined",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return r=>{if(this.tokenChangeListeners.forEach(n=>n(r)),typeof e=="function")e(r);else if(typeof e=="string"){const n=Nr()[e];typeof n=="function"&&n(r)}}}assertNotDestroyed(){Pe(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){const r=document.createElement("div");e.appendChild(r),e=r}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){Pe(SE()&&!NE(),this.auth,"internal-error"),await kV(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);const e=await gV(this.auth);Pe(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return Pe(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}function kV(){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})}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class OE{constructor(e,r){this.verificationId=e,this.onConfirmation=r}confirm(e){const r=ju._fromVerification(this.verificationId,e);return this.onConfirmation(r)}}async function tpe(t,e,r){const n=Bn(t),i=await jm(n,e,Qe(r));return new OE(i,s=>kE(n,s))}async function rpe(t,e,r){const n=Qe(t);await Lm(!1,n,"phone");const i=await jm(n.auth,e,Qe(r));return new OE(i,s=>Pj(n,s))}async function npe(t,e,r){const n=Qe(t),i=await jm(n.auth,e,Qe(r));return new OE(i,s=>Lj(n,s))}async function jm(t,e,r){var n;const i=await r.verify();try{Pe(typeof i=="string",t,"argument-error"),Pe(r.type===b6,t,"argument-error");let s;if(typeof e=="string"?s={phoneNumber:e}:s=e,"session"in s){const o=s.session;if("phoneNumber"in s)return Pe(o.type==="enroll",t,"internal-error"),(await Wj(t,{idToken:o.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,recaptchaToken:i}})).phoneSessionInfo.sessionInfo;{Pe(o.type==="signin",t,"internal-error");const a=((n=s.multiFactorHint)===null||n===void 0?void 0:n.uid)||s.multiFactorUid;return Pe(a,t,"missing-multi-factor-info"),(await dV(t,{mfaPendingCredential:o.credential,mfaEnrollmentId:a,phoneSignInInfo:{recaptchaToken:i}})).phoneResponseInfo.sessionInfo}}else{const{sessionInfo:o}=await Tj(t,{phoneNumber:s.phoneNumber,recaptchaToken:i});return o}}finally{r._reset()}}async function ipe(t,e){await AE(Qe(t),e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class fl{constructor(e){this.providerId=fl.PROVIDER_ID,this.auth=Bn(e)}verifyPhoneNumber(e,r){return jm(this.auth,e,Qe(r))}static credential(e,r){return ju._fromVerification(e,r)}static credentialFromResult(e){const r=e;return fl.credentialFromTaggedObject(r)}static credentialFromError(e){return fl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:r,temporaryProof:n}=e;return r&&n?ju._fromTokenResponse(r,n):null}}fl.PROVIDER_ID="phone";fl.PHONE_SIGN_IN_METHOD="phone";/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function xc(t,e){return e?go(e):(Pe(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class DE extends Zd{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return xo(e,this._buildIdpRequest())}_linkToIdToken(e,r){return xo(e,this._buildIdpRequest(r))}_getReauthenticationResolver(e){return xo(e,this._buildIdpRequest())}_buildIdpRequest(e){const r={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&&(r.idToken=e),r}}function MV(t){return u6(t.auth,new DE(t),t.bypassAuthState)}function CV(t){const{auth:e,user:r}=t;return Pe(r,e,"internal-error"),a6(r,new DE(t),t.bypassAuthState)}async function RV(t){const{auth:e,user:r}=t;return Pe(r,e,"internal-error"),AE(r,new DE(t),t.bypassAuthState)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class w6{constructor(e,r,n,i,s=!1){this.auth=e,this.resolver=n,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(r)?r:[r]}execute(){return new Promise(async(e,r)=>{this.pendingPromise={resolve:e,reject:r};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}})}async onAuthEvent(e){const{urlResponse:r,sessionId:n,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const u={auth:this.auth,requestUri:r,sessionId:n,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(u))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return MV;case"linkViaPopup":case"linkViaRedirect":return RV;case"reauthViaPopup":case"reauthViaRedirect":return CV;default:Jn(this.auth,"internal-error")}}resolve(e){Ro(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Ro(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()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const NV=new Qd(2e3,1e4);async function spe(t,e,r){const n=Bn(t);uf(t,e,Ko);const i=xc(n,r);return new mo(n,"signInViaPopup",e,i).executeNotNull()}async function ope(t,e,r){const n=Qe(t);uf(n.auth,e,Ko);const i=xc(n.auth,r);return new mo(n.auth,"reauthViaPopup",e,i,n).executeNotNull()}async function ape(t,e,r){const n=Qe(t);uf(n.auth,e,Ko);const i=xc(n.auth,r);return new mo(n.auth,"linkViaPopup",e,i,n).executeNotNull()}class mo extends w6{constructor(e,r,n,i,s){super(e,r,i,s),this.provider=n,this.authWindow=null,this.pollId=null,mo.currentPopupAction&&mo.currentPopupAction.cancel(),mo.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Pe(e,this.auth,"internal-error"),e}async onExecution(){Ro(this.filter.length===1,"Popup operations only handle one event");const e=Um();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(r=>{this.reject(r)}),this.resolver._isIframeWebStorageSupported(this.auth,r=>{r||this.reject(ui(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(ui(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,mo.currentPopupAction=null}pollUserCancellation(){const e=()=>{var r,n;if(!((n=(r=this.authWindow)===null||r===void 0?void 0:r.window)===null||n===void 0)&&n.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(ui(this.auth,"popup-closed-by-user"))},2e3);return}this.pollId=window.setTimeout(e,NV.get())};e()}}mo.currentPopupAction=null;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const OV="pendingRedirect",Mh=new Map;class DV extends w6{constructor(e,r,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],r,void 0,n),this.eventId=null}async execute(){let e=Mh.get(this.auth._key());if(!e){try{const n=await PV(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(n)}catch(r){e=()=>Promise.reject(r)}Mh.set(this.auth._key(),e)}return this.bypassAuthState||Mh.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const r=await this.auth._redirectUserForId(e.eventId);if(r)return this.user=r,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function PV(t,e){const r=x6(e),n=E6(t);if(!await n._isAvailable())return!1;const i=await n._get(r)==="true";return await n._remove(r),i}async function PE(t,e){return E6(t)._set(x6(e),"true")}function upe(){Mh.clear()}function LV(t,e){Mh.set(t._key(),e)}function E6(t){return go(t._redirectPersistence)}function x6(t){return Tg(OV,t.config.apiKey,t.name)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function cpe(t,e,r){return BV(t,e,r)}async function BV(t,e,r){const n=Bn(t);uf(t,e,Ko);const i=xc(n,r);return await PE(i,n),i._openRedirect(n,e,"signInViaRedirect")}function lpe(t,e,r){return $V(t,e,r)}async function $V(t,e,r){const n=Qe(t);uf(n.auth,e,Ko);const i=xc(n.auth,r);await PE(i,n.auth);const s=await I6(n);return i._openRedirect(n.auth,e,"reauthViaRedirect",s)}function fpe(t,e,r){return FV(t,e,r)}async function FV(t,e,r){const n=Qe(t);uf(n.auth,e,Ko);const i=xc(n.auth,r);await Lm(!1,n,e.providerId),await PE(i,n.auth);const s=await I6(n);return i._openRedirect(n.auth,e,"linkViaRedirect",s)}async function hpe(t,e){return await Bn(t)._initializationPromise,S6(t,e,!1)}async function S6(t,e,r=!1){const n=Bn(t),i=xc(n,e),o=await new DV(n,i,r).execute();return o&&!r&&(delete o.user._redirectEventId,await n._persistUserIfCurrent(o.user),await n._setRedirectUser(null,e)),o}async function I6(t){const e=Um(`${t.uid}:::`);return t._redirectEventId=e,await t.auth._setRedirectUser(t),await t.auth._persistUserIfCurrent(t),e}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const UV=10*60*1e3;class qV{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 r=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(r=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!jV(e)||(this.hasHandledPotentialRedirect=!0,r||(this.queuedRedirectEvent=e,r=!0)),r}sendToConsumer(e,r){var n;if(e.error&&!T6(e)){const i=((n=e.error.code)===null||n===void 0?void 0:n.split("auth/")[1])||"internal-error";r.onError(ui(this.auth,i))}else r.onAuthEvent(e)}isEventForConsumer(e,r){const n=r.eventId===null||!!e.eventId&&e.eventId===r.eventId;return r.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=UV&&this.cachedEventUids.clear(),this.cachedEventUids.has(H2(e))}saveEventToCache(e){this.cachedEventUids.add(H2(e)),this.lastProcessedEventTime=Date.now()}}function H2(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function T6({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function jV(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return T6(t);default:return!1}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function VV(t,e={}){return Kr(t,"GET","/v1/projects",e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const zV=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,HV=/^https?/;async function KV(t){if(t.config.emulator)return;const{authorizedDomains:e}=await VV(t);for(const r of e)try{if(GV(r))return}catch{}Jn(t,"unauthorized-domain")}function GV(t){const e=ld(),{protocol:r,hostname:n}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&n===""?r==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):r==="chrome-extension:"&&o.hostname===n}if(!HV.test(r))return!1;if(zV.test(t))return n===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(n)}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const WV=new Qd(3e4,6e4);function K2(){const t=Nr().___jsl;if(t!=null&&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 r=0;r{var n,i,s;function o(){K2(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{K2(),r(ui(t,"network-request-failed"))},timeout:WV.get()})}if(!((i=(n=Nr().gapi)===null||n===void 0?void 0:n.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=Nr().gapi)===null||s===void 0)&&s.load)o();else{const a=_6("iframefcb");return Nr()[a]=()=>{gapi.load?o():r(ui(t,"network-request-failed"))},y6(`https://apis.google.com/js/api.js?onload=${a}`).catch(u=>r(u))}}).catch(e=>{throw kg=null,e})}let kg=null;function YV(t){return kg=kg||XV(t),kg}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const JV=new Qd(5e3,15e3),QV="__/auth/iframe",ZV="emulator/auth/iframe",ez={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},tz=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function rz(t){const e=t.config;Pe(e.authDomain,t,"auth-domain-config-required");const r=e.emulator?IE(e,ZV):`https://${t.config.authDomain}/${QV}`,n={apiKey:e.apiKey,appName:t.name,v:af},i=tz.get(t.config.apiHost);i&&(n.eid=i);const s=t._getFrameworks();return s.length&&(n.fw=s.join(",")),`${r}?${of(n).slice(1)}`}async function nz(t){const e=await YV(t),r=Nr().gapi;return Pe(r,t,"internal-error"),e.open({where:document.body,url:rz(t),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:ez,dontclear:!0},n=>new Promise(async(i,s)=>{await n.restyle({setHideOnLeave:!1});const o=ui(t,"network-request-failed"),a=Nr().setTimeout(()=>{s(o)},JV.get());function u(){Nr().clearTimeout(a),i(n)}n.ping(u).then(u,()=>{s(o)})}))}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const iz={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},sz=500,oz=600,az="_blank",uz="http://localhost";class G2{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function cz(t,e,r,n=sz,i=oz){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-n)/2,0).toString();let a="";const u=Object.assign(Object.assign({},iz),{width:n.toString(),height:i.toString(),top:s,left:o}),c=Mr().toLowerCase();r&&(a=W3(c)?az:r),G3(c)&&(e=e||uz,u.scrollbars="yes");const l=Object.entries(u).reduce((d,[_,T])=>`${d}${_}=${T},`,"");if(cj(c)&&a!=="_self")return lz(e||"",a),new G2(null);const h=window.open(e||"",a,l);Pe(h,t,"popup-blocked");try{h.focus()}catch{}return new G2(h)}function lz(t,e){const r=document.createElement("a");r.href=t,r.target=e;const n=document.createEvent("MouseEvent");n.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),r.dispatchEvent(n)}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const fz="__/auth/handler",hz="emulator/auth/handler";function W2(t,e,r,n,i,s){Pe(t.config.authDomain,t,"auth-domain-config-required"),Pe(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:r,redirectUrl:n,v:af,eventId:i};if(e instanceof Ko){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",k9(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,c]of Object.entries(s||{}))o[u]=c}if(e instanceof cf){const u=e.getScopes().filter(c=>c!=="");u.length>0&&(o.scopes=u.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const u of Object.keys(a))a[u]===void 0&&delete a[u];return`${dz(t)}?${of(a).slice(1)}`}function dz({config:t}){return t.emulator?IE(t,hz):`https://${t.authDomain}/${fz}`}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const d_="webStorageSupport";class pz{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=p6,this._completeRedirectFn=S6,this._overrideRedirectResult=LV}async _openPopup(e,r,n,i){var s;Ro((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=W2(e,r,n,ld(),i);return cz(e,o,Um())}async _openRedirect(e,r,n,i){return await this._originValidation(e),nV(W2(e,r,n,ld(),i)),new Promise(()=>{})}_initialize(e){const r=e._key();if(this.eventManagers[r]){const{manager:i,promise:s}=this.eventManagers[r];return i?Promise.resolve(i):(Ro(s,"If manager is not set, promise should be"),s)}const n=this.initAndGetManager(e);return this.eventManagers[r]={promise:n},n.catch(()=>{delete this.eventManagers[r]}),n}async initAndGetManager(e){const r=await nz(e),n=new qV(e);return r.register("authEvent",i=>(Pe(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:n.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=r,n}_isIframeWebStorageSupported(e,r){this.iframes[e._key()].send(d_,{type:d_},i=>{var s;const o=(s=i==null?void 0:i[0])===null||s===void 0?void 0:s[d_];o!==void 0&&r(!!o),Jn(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const r=e._key();return this.originValidationPromises[r]||(this.originValidationPromises[r]=KV(e)),this.originValidationPromises[r]}get _shouldInitProactively(){return Z3()||TE()||Om()}}const gz=pz;class mz{constructor(e){this.factorId=e}_process(e,r,n){switch(r.type){case"enroll":return this._finalizeEnroll(e,r.credential,n);case"signin":return this._finalizeSignIn(e,r.credential);default:return Os("unexpected MultiFactorSessionType")}}}class LE extends mz{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new LE(e)}_finalizeEnroll(e,r,n){return Xj(e,{idToken:r,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,r){return pV(e,{mfaPendingCredential:r,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}class vz{constructor(){}static assertion(e){return LE._fromCredential(e)}}vz.FACTOR_ID="phone";var X2="@firebase/auth",Y2="0.20.11";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class yz{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.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 r=this.auth.onIdTokenChanged(n=>{var i;e(((i=n)===null||i===void 0?void 0:i.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,r),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const r=this.internalListeners.get(e);!r||(this.internalListeners.delete(e),r(),this.updateProactiveRefresh())}assertAuthConfigured(){Pe(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function _z(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function bz(t){cs(new us("auth",(e,{options:r})=>{const n=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),{apiKey:s,authDomain:o}=n.options;return((a,u)=>{Pe(s&&!s.includes(":"),"invalid-api-key",{appName:a.name}),Pe(!(o!=null&&o.includes(":")),"argument-error",{appName:a.name});const c={apiKey:s,authDomain:o,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:e6(t)},l=new dj(a,u,c);return Kq(l,r),l})(n,i)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,r,n)=>{e.getProvider("auth-internal").initialize()})),cs(new us("auth-internal",e=>{const r=Bn(e.getProvider("auth").getImmediate());return(n=>new yz(n))(r)},"PRIVATE").setInstantiationMode("EXPLICIT")),On(X2,Y2,_z(t)),On(X2,Y2,"esm2017")}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const wz=5*60,Ez=C3("authIdTokenMaxAge")||wz;let J2=null;const xz=t=>async e=>{const r=e&&await e.getIdTokenResult(),n=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(n&&n>Ez)return;const i=r==null?void 0:r.token;J2!==i&&(J2=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function dpe(t=Jd()){const e=zo(t,"auth");if(e.isInitialized())return e.getImmediate();const r=Hq(t,{popupRedirectResolver:gz,persistence:[hV,eV,p6]}),n=C3("authTokenSyncURL");if(n){const s=xz(n);Gj(r,s,()=>s(r.currentUser)),Kj(r,o=>s(o))}const i=k3("auth");return i&&pj(r,`http://${i}`),r}bz("Browser");var Sz=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Ke,BE=BE||{},ct=Sz||self;function v0(){}function Vm(t){var e=typeof t;return e=e!="object"?e:t?Array.isArray(t)?"array":e:"null",e=="array"||e=="object"&&typeof t.length=="number"}function tp(t){var e=typeof t;return e=="object"&&t!=null||e=="function"}function Iz(t){return Object.prototype.hasOwnProperty.call(t,p_)&&t[p_]||(t[p_]=++Tz)}var p_="closure_uid_"+(1e9*Math.random()>>>0),Tz=0;function Az(t,e,r){return t.call.apply(t.bind,arguments)}function kz(t,e,r){if(!t)throw Error();if(2e?1:0}function zm(){var t=ct.navigator;return t&&(t=t.userAgent)?t:""}function Ms(t){return zm().indexOf(t)!=-1}function FE(t){return FE[" "](t),t}FE[" "]=v0;function Rz(t){var e=Dz;return Object.prototype.hasOwnProperty.call(e,9)?e[9]:e[9]=t(9)}var Nz=Ms("Opera"),Pl=Ms("Trident")||Ms("MSIE"),k6=Ms("Edge"),n1=k6||Pl,M6=Ms("Gecko")&&!(zm().toLowerCase().indexOf("webkit")!=-1&&!Ms("Edge"))&&!(Ms("Trident")||Ms("MSIE"))&&!Ms("Edge"),Oz=zm().toLowerCase().indexOf("webkit")!=-1&&!Ms("Edge");function C6(){var t=ct.document;return t?t.documentMode:void 0}var _0;e:{var m_="",v_=function(){var t=zm();if(M6)return/rv:([^\);]+)(\)|;)/.exec(t);if(k6)return/Edge\/([\d\.]+)/.exec(t);if(Pl)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t);if(Oz)return/WebKit\/(\S+)/.exec(t);if(Nz)return/(?:Version)[ \/]?(\S+)/.exec(t)}();if(v_&&(m_=v_?v_[1]:""),Pl){var y_=C6();if(y_!=null&&y_>parseFloat(m_)){_0=String(y_);break e}}_0=m_}var Dz={};function Pz(){return Rz(function(){let t=0;const e=Z2(String(_0)).split("."),r=Z2("9").split("."),n=Math.max(e.length,r.length);for(let o=0;t==0&&o>>0);function zE(t){return typeof t=="function"?t:(t[b_]||(t[b_]=function(e){return t.handleEvent(e)}),t[b_])}function Vr(){Wa.call(this),this.i=new Km(this),this.P=this,this.I=null}on(Vr,Wa);Vr.prototype[rp]=!0;Vr.prototype.removeEventListener=function(t,e,r,n){L6(this,t,e,r,n)};function rn(t,e){var r,n=t.I;if(n)for(r=[];n;n=n.I)r.push(n);if(t=t.P,n=e.type||e,typeof e=="string")e=new wn(e,t);else if(e instanceof wn)e.target=e.target||t;else{var i=e;e=new wn(n,t),N6(e,i)}if(i=!0,r)for(var s=r.length-1;0<=s;s--){var o=e.g=r[s];i=eg(o,n,!0,e)&&i}if(o=e.g=t,i=eg(o,n,!0,e)&&i,i=eg(o,n,!1,e)&&i,r)for(s=0;snew zz,t=>t.reset());class zz{constructor(){this.next=this.g=this.h=null}set(e,r){this.h=e,this.g=r,this.next=null}reset(){this.next=this.g=this.h=null}}function Hz(t){ct.setTimeout(()=>{throw t},0)}function F6(t,e){a1||Kz(),u1||(a1(),u1=!0),U6.add(t,e)}var a1;function Kz(){var t=ct.Promise.resolve(void 0);a1=function(){t.then(Gz)}}var u1=!1,U6=new Vz;function Gz(){for(var t;t=jz();){try{t.h.call(t.g)}catch(r){Hz(r)}var e=$6;e.j(t),100>e.h&&(e.h++,t.next=e.g,e.g=t)}u1=!1}function Gm(t,e){Vr.call(this),this.h=t||1,this.g=e||ct,this.j=bn(this.lb,this),this.l=Date.now()}on(Gm,Vr);Ke=Gm.prototype;Ke.ca=!1;Ke.R=null;Ke.lb=function(){if(this.ca){var t=Date.now()-this.l;0{t.g=null,t.i&&(t.i=!1,q6(t))},t.j);const e=t.h;t.h=null,t.m.apply(null,e)}class Wz extends Wa{constructor(e,r){super(),this.m=e,this.j=r,this.h=null,this.i=!1,this.g=null}l(e){this.h=arguments,this.g?this.i=!0:q6(this)}M(){super.M(),this.g&&(ct.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function md(t){Wa.call(this),this.h=t,this.g={}}on(md,Wa);var rT=[];function j6(t,e,r,n){Array.isArray(r)||(r&&(rT[0]=r.toString()),r=rT);for(var i=0;in.length)){var i=n[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if(s!="noop"&&s!="stop"&&s!="close")for(var o=1;ol)&&(l!=3||n1||this.g&&(this.h.h||this.g.fa()||uT(this.g)))){this.I||l!=4||e==7||(e==8||0>=h?vd(3):vd(2)),Qm(this);var r=this.g.aa();this.Y=r;t:if(J6(this)){var n=uT(this.g);t="";var i=n.length,s=vo(this.g)==4;if(!this.h.i){if(typeof TextDecoder=="undefined"){Au(this),Ch(this);var o="";break t}this.h.i=new ct.TextDecoder}for(e=0;ee.length?b0:(e=e.substr(n,r),t.C=n+r,e)))}Ke.cancel=function(){this.I=!0,Au(this)};function op(t){t.V=Date.now()+t.O,Z6(t,t.O)}function Z6(t,e){if(t.B!=null)throw Error("WatchDog timer not null");t.B=np(bn(t.gb,t),e)}function Qm(t){t.B&&(ct.clearTimeout(t.B),t.B=null)}Ke.gb=function(){this.B=null;const t=Date.now();0<=t-this.V?(Jz(this.j,this.A),this.K!=2&&(vd(),Rn(17)),Au(this),this.o=2,Ch(this)):Z6(this,this.V-t)};function Ch(t){t.l.G==0||t.I||wN(t.l,t)}function Au(t){Qm(t);var e=t.L;e&&typeof e.na=="function"&&e.na(),t.L=null,KE(t.T),V6(t.S),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function h1(t,e){try{var r=t.l;if(r.G!=0&&(r.g==t||d1(r.h,t))){if(!t.J&&d1(r.h,t)&&r.G==3){try{var n=r.Fa.g.parse(e)}catch{n=null}if(Array.isArray(n)&&n.length==3){var i=n;if(i[0]==0){e:if(!r.u){if(r.g)if(r.g.F+3e3i[2]&&r.L&&r.A==0&&!r.v&&(r.v=np(bn(r.cb,r),6e3));if(1>=aN(r.h)&&r.ja){try{r.ja()}catch{}r.ja=void 0}}else ku(r,11)}else if((t.J||r.g==t)&&x0(r),!y0(e))for(i=r.Fa.g.parse(e),e=0;ee)throw Error("Bad port number "+e);t.m=e}else t.m=null}function sT(t,e,r){e instanceof yd?(t.i=e,cH(t.i,t.h)):(r||(e=dh(e,aH)),t.i=new yd(e,t.h))}function lr(t,e,r){t.i.set(e,r)}function Zm(t){return lr(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function hh(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function dh(t,e,r){return typeof t=="string"?(t=encodeURI(t).replace(e,iH),r&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function iH(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(t&15).toString(16)}var oT=/[#\/\?@]/g,sH=/[#\?:]/g,oH=/[#\?]/g,aH=/[#\?@]/g,uH=/#/g;function yd(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function Xa(t){t.g||(t.g=new Map,t.h=0,t.i&&nH(t.i,function(e,r){t.add(decodeURIComponent(e.replace(/\+/g," ")),r)}))}Ke=yd.prototype;Ke.add=function(t,e){Xa(this),this.i=null,t=lf(this,t);var r=this.g.get(t);return r||this.g.set(t,r=[]),r.push(e),this.h+=1,this};function rN(t,e){Xa(t),e=lf(t,e),t.g.has(e)&&(t.i=null,t.h-=t.g.get(e).length,t.g.delete(e))}function nN(t,e){return Xa(t),e=lf(t,e),t.g.has(e)}Ke.forEach=function(t,e){Xa(this),this.g.forEach(function(r,n){r.forEach(function(i){t.call(e,i,n,this)},this)},this)};Ke.oa=function(){Xa(this);const t=Array.from(this.g.values()),e=Array.from(this.g.keys()),r=[];for(let n=0;n=t.j:!1}function aN(t){return t.h?1:t.g?t.g.size:0}function d1(t,e){return t.h?t.h==e:t.g?t.g.has(e):!1}function JE(t,e){t.g?t.g.add(e):t.h=e}function uN(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}sN.prototype.cancel=function(){if(this.i=cN(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const t of this.g.values())t.cancel();this.g.clear()}};function cN(t){if(t.h!=null)return t.i.concat(t.h.D);if(t.g!=null&&t.g.size!==0){let e=t.i;for(const r of t.g.values())e=e.concat(r.D);return e}return $E(t.i)}function QE(){}QE.prototype.stringify=function(t){return ct.JSON.stringify(t,void 0)};QE.prototype.parse=function(t){return ct.JSON.parse(t,void 0)};function hH(){this.g=new QE}function dH(t,e,r){const n=r||"";try{eN(t,function(i,s){let o=i;tp(i)&&(o=HE(i)),e.push(n+s+"="+encodeURIComponent(o))})}catch(i){throw e.push(n+"type="+encodeURIComponent("_badmap")),i}}function pH(t,e){const r=new Wm;if(ct.Image){const n=new Image;n.onload=Zp(tg,r,n,"TestLoadImage: loaded",!0,e),n.onerror=Zp(tg,r,n,"TestLoadImage: error",!1,e),n.onabort=Zp(tg,r,n,"TestLoadImage: abort",!1,e),n.ontimeout=Zp(tg,r,n,"TestLoadImage: timeout",!1,e),ct.setTimeout(function(){n.ontimeout&&n.ontimeout()},1e4),n.src=t}else e(!1)}function tg(t,e,r,n,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(n)}catch{}}function ap(t){this.l=t.ac||null,this.j=t.jb||!1}on(ap,WE);ap.prototype.g=function(){return new ev(this.l,this.j)};ap.prototype.i=function(t){return function(){return t}}({});function ev(t,e){Vr.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=ZE,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}on(ev,Vr);var ZE=0;Ke=ev.prototype;Ke.open=function(t,e){if(this.readyState!=ZE)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,_d(this)};Ke.send=function(t){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||ct).fetch(new Request(this.B,e)).then(this.Wa.bind(this),this.ga.bind(this))};Ke.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,up(this)),this.readyState=ZE};Ke.Wa=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,_d(this)),this.g&&(this.readyState=3,_d(this),this.g)))if(this.responseType==="arraybuffer")t.arrayBuffer().then(this.Ua.bind(this),this.ga.bind(this));else if(typeof ct.ReadableStream!="undefined"&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;lN(this)}else t.text().then(this.Va.bind(this),this.ga.bind(this))};function lN(t){t.j.read().then(t.Ta.bind(t)).catch(t.ga.bind(t))}Ke.Ta=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?up(this):_d(this),this.readyState==3&&lN(this)}};Ke.Va=function(t){this.g&&(this.response=this.responseText=t,up(this))};Ke.Ua=function(t){this.g&&(this.response=t,up(this))};Ke.ga=function(){this.g&&up(this)};function up(t){t.readyState=4,t.l=null,t.j=null,t.A=null,_d(t)}Ke.setRequestHeader=function(t,e){this.v.append(t,e)};Ke.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""};Ke.getAllResponseHeaders=function(){if(!this.h)return"";const t=[],e=this.h.entries();for(var r=e.next();!r.done;)r=r.value,t.push(r[0]+": "+r[1]),r=e.next();return t.join(`\r `)};function _d(t){t.onreadystatechange&&t.onreadystatechange.call(t)}Object.defineProperty(ev.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(t){this.m=t?"include":"same-origin"}});var gH=ct.JSON.parse;function mr(t){Vr.call(this),this.headers=new Map,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=fN,this.K=this.L=!1}on(mr,Vr);var fN="",mH=/^https?$/i,vH=["POST","PUT"];Ke=mr.prototype;Ke.Ka=function(t){this.L=t};Ke.da=function(t,e,r,n){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+t);e=e?e.toUpperCase():"GET",this.H=t,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():c1.g(),this.C=this.u?iT(this.u):iT(c1),this.g.onreadystatechange=bn(this.Ha,this);try{this.F=!0,this.g.open(e,String(t),!0),this.F=!1}catch(s){aT(this,s);return}if(t=r||"",r=new Map(this.headers),n)if(Object.getPrototypeOf(n)===Object.prototype)for(var i in n)r.set(i,n[i]);else if(typeof n.keys=="function"&&typeof n.get=="function")for(const s of n.keys())r.set(s,n.get(s));else throw Error("Unknown input type for opt_headers: "+String(n));n=Array.from(r.keys()).find(s=>s.toLowerCase()=="content-type"),i=ct.FormData&&t instanceof ct.FormData,!(0<=A6(vH,e))||n||i||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[s,o]of r)this.g.setRequestHeader(s,o);this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{pN(this),0=t.h.j-(t.m?1:0)?!1:t.m?(t.i=e.D.concat(t.i),!0):t.G==1||t.G==2||t.C>=(t.Za?0:t.$a)?!1:(t.m=np(bn(t.Ja,t,e),EN(t,t.C)),t.C++,!0)}Ke.Ja=function(t){if(this.m)if(this.m=null,this.G==1){if(!t){this.U=Math.floor(1e5*Math.random()),t=this.U++;const i=new sp(this,this.j,t,void 0);let s=this.s;if(this.S&&(s?(s=R6(s),N6(s,this.S)):s=this.S),this.o!==null||this.N||(i.H=s,s=null),this.O)e:{for(var e=0,r=0;rc)s=Math.max(0,i[u].h-100),a=!1;else try{dH(l,o,"req"+c+"_")}catch{n&&n(l)}}if(a){n=o.join("&");break e}}}return t=t.i.splice(0,r),e.D=t,n}function _N(t){t.g||t.u||(t.Z=1,F6(t.Ia,t),t.A=0)}function rx(t){return t.g||t.u||3<=t.A?!1:(t.Z++,t.u=np(bn(t.Ia,t),EN(t,t.A)),t.A++,!0)}Ke.Ia=function(){if(this.u=null,bN(this),this.$&&!(this.K||this.g==null||0>=this.P)){var t=2*this.P;this.j.info("BP detection timer enabled: "+t),this.B=np(bn(this.eb,this),t)}};Ke.eb=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.L=!1,this.K=!0,Rn(10),rv(this),bN(this))};function nx(t){t.B!=null&&(ct.clearTimeout(t.B),t.B=null)}function bN(t){t.g=new sp(t,t.j,"rpc",t.Z),t.o===null&&(t.g.H=t.s),t.g.N=0;var e=Do(t.sa);lr(e,"RID","rpc"),lr(e,"SID",t.I),lr(e,"CI",t.L?"0":"1"),lr(e,"AID",t.T),lr(e,"TYPE","xmlhttp"),cp(t,e),t.o&&t.s&&ex(e,t.o,t.s),t.J&&t.g.setTimeout(t.J);var r=t.g;t=t.ka,r.K=1,r.v=Zm(Do(e)),r.s=null,r.P=!0,Y6(r,t)}Ke.cb=function(){this.v!=null&&(this.v=null,rv(this),rx(this),Rn(19))};function x0(t){t.v!=null&&(ct.clearTimeout(t.v),t.v=null)}function wN(t,e){var r=null;if(t.g==e){x0(t),nx(t),t.g=null;var n=2}else if(d1(t.h,e))r=e.D,uN(t.h,e),n=1;else return;if(t.G!=0){if(t.pa=e.Y,e.i)if(n==1){r=e.s?e.s.length:0,e=Date.now()-e.F;var i=t.C;n=Xm(),rn(n,new K6(n,r)),nv(t)}else _N(t);else if(i=e.o,i==3||i==0&&0`${this.name}: [code=${this.code}]: ${this.message}`}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class os{constructor(){this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class MN{constructor(e,r){this.user=r,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class TH{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,r){e.enqueueRetryable(()=>r(Ur.UNAUTHENTICATED))}shutdown(){}}class AH{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,r){this.changeListener=r,e.enqueueRetryable(()=>r(this.token.user))}shutdown(){this.changeListener=null}}class kH{constructor(e){this.t=e,this.currentUser=Ur.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,r){let n=this.i;const i=u=>this.i!==n?(n=this.i,r(u)):Promise.resolve();let s=new os;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new os,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const u=s;e.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},a=u=>{ke("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.auth.addAuthTokenListener(this.o),o()};this.t.onInit(u=>a(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?a(u):(ke("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new os)}},0),o()}getToken(){const e=this.i,r=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(r).then(n=>this.i!==e?(ke("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):n?(ft(typeof n.accessToken=="string"),new MN(n.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return ft(e===null||typeof e=="string"),new Ur(e)}}class MH{constructor(e,r,n,i){this.h=e,this.l=r,this.m=n,this.g=i,this.type="FirstParty",this.user=Ur.FIRST_PARTY,this.p=new Map}I(){return this.g?this.g():(ft(!(typeof this.h!="object"||this.h===null||!this.h.auth||!this.h.auth.getAuthHeaderValueForFirstParty)),this.h.auth.getAuthHeaderValueForFirstParty([]))}get headers(){this.p.set("X-Goog-AuthUser",this.l);const e=this.I();return e&&this.p.set("Authorization",e),this.m&&this.p.set("X-Goog-Iam-Authorization-Token",this.m),this.p}}class CH{constructor(e,r,n,i){this.h=e,this.l=r,this.m=n,this.g=i}getToken(){return Promise.resolve(new MH(this.h,this.l,this.m,this.g))}start(e,r){e.enqueueRetryable(()=>r(Ur.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class RH{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 NH{constructor(e){this.T=e,this.forceRefresh=!1,this.appCheck=null,this.A=null}start(e,r){const n=s=>{s.error!=null&&ke("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const o=s.token!==this.A;return this.A=s.token,ke("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?r(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>n(s))};const i=s=>{ke("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.appCheck.addTokenListener(this.o)};this.T.onInit(s=>i(s)),setTimeout(()=>{if(!this.appCheck){const s=this.T.getImmediate({optional:!0});s?i(s):ke("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(r=>r?(ft(typeof r.token=="string"),this.A=r.token,new RH(r.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function OH(t){const e=typeof self!="undefined"&&(self.crypto||self.msCrypto),r=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(r);else for(let n=0;ne?1:0}function Ll(t,e,r){return t.length===e.length&&t.every((n,i)=>r(n,e[i]))}function RN(t){return t+"\0"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class dr{constructor(e,r){if(this.seconds=e,this.nanoseconds=r,r<0)throw new Le(xe.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(r>=1e9)throw new Le(xe.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(e<-62135596800)throw new Le(xe.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Le(xe.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return dr.fromMillis(Date.now())}static fromDate(e){return dr.fromMillis(e.getTime())}static fromMillis(e){const r=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*r));return new dr(r,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?pt(this.nanoseconds,e.nanoseconds):pt(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{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class at{constructor(e){this.timestamp=e}static fromTimestamp(e){return new at(e)}static min(){return new at(new dr(0,0))}static max(){return new at(new dr(253402300799,999999999))}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}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class bd{constructor(e,r,n){r===void 0?r=0:r>e.length&&ze(),n===void 0?n=e.length-r:n>e.length-r&&ze(),this.segments=e,this.offset=r,this.len=n}get length(){return this.len}isEqual(e){return bd.comparator(this,e)===0}child(e){const r=this.segments.slice(this.offset,this.limit());return e instanceof bd?e.forEach(n=>{r.push(n)}):r.push(e),this.construct(r)}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.lengtho)return 1}return e.lengthr.length?1:0}}class Wt extends bd{construct(e,r,n){return new Wt(e,r,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...e){const r=[];for(const n of e){if(n.indexOf("//")>=0)throw new Le(xe.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);r.push(...n.split("/").filter(i=>i.length>0))}return new Wt(r)}static emptyPath(){return new Wt([])}}const DH=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Tr extends bd{construct(e,r,n){return new Tr(e,r,n)}static isValidIdentifier(e){return DH.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Tr.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new Tr(["__name__"])}static fromServerFormat(e){const r=[];let n="",i=0;const s=()=>{if(n.length===0)throw new Le(xe.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);r.push(n),n=""};let o=!1;for(;i=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&&Wt.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,r){return Wt.comparator(e.path,r.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new $e(new Wt(e.slice()))}}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class NN{constructor(e,r,n,i){this.indexId=e,this.collectionGroup=r,this.fields=n,this.indexState=i}}function g1(t){return t.fields.find(e=>e.kind===2)}function gu(t){return t.fields.filter(e=>e.kind!==2)}NN.UNKNOWN_ID=-1;class PH{constructor(e,r){this.fieldPath=e,this.kind=r}}class T0{constructor(e,r){this.sequenceNumber=e,this.offset=r}static empty(){return new T0(0,pi.min())}}function ON(t,e){const r=t.toTimestamp().seconds,n=t.toTimestamp().nanoseconds+1,i=at.fromTimestamp(n===1e9?new dr(r+1,0):new dr(r,n));return new pi(i,$e.empty(),e)}function DN(t){return new pi(t.readTime,t.key,-1)}class pi{constructor(e,r,n){this.readTime=e,this.documentKey=r,this.largestBatchId=n}static min(){return new pi(at.min(),$e.empty(),-1)}static max(){return new pi(at.max(),$e.empty(),-1)}}function sx(t,e){let r=t.readTime.compareTo(e.readTime);return r!==0?r:(r=$e.comparator(t.documentKey,e.documentKey),r!==0?r:pt(t.largestBatchId,e.largestBatchId))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const PN="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class LN{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Ya(t){if(t.code!==xe.FAILED_PRECONDITION||t.message!==PN)throw t;ke("LocalStore","Unexpectedly lost primary lease")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class he{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(r=>{this.isDone=!0,this.result=r,this.nextCallback&&this.nextCallback(r)},r=>{this.isDone=!0,this.error=r,this.catchCallback&&this.catchCallback(r)})}catch(e){return this.next(void 0,e)}next(e,r){return this.callbackAttached&&ze(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(r,this.error):this.wrapSuccess(e,this.result):new he((n,i)=>{this.nextCallback=s=>{this.wrapSuccess(e,s).next(n,i)},this.catchCallback=s=>{this.wrapFailure(r,s).next(n,i)}})}toPromise(){return new Promise((e,r)=>{this.next(e,r)})}wrapUserFunction(e){try{const r=e();return r instanceof he?r:he.resolve(r)}catch(r){return he.reject(r)}}wrapSuccess(e,r){return e?this.wrapUserFunction(()=>e(r)):he.resolve(r)}wrapFailure(e,r){return e?this.wrapUserFunction(()=>e(r)):he.reject(r)}static resolve(e){return new he((r,n)=>{r(e)})}static reject(e){return new he((r,n)=>{n(e)})}static waitFor(e){return new he((r,n)=>{let i=0,s=0,o=!1;e.forEach(a=>{++i,a.next(()=>{++s,o&&s===i&&r()},u=>n(u))}),o=!0,s===i&&r()})}static or(e){let r=he.resolve(!1);for(const n of e)r=r.next(i=>i?he.resolve(i):n());return r}static forEach(e,r){const n=[];return e.forEach((i,s)=>{n.push(r.call(this,i,s))}),this.waitFor(n)}static mapArray(e,r){return new he((n,i)=>{const s=e.length,o=new Array(s);let a=0;for(let u=0;u{o[c]=l,++a,a===s&&n(o)},l=>i(l))}})}static doWhile(e,r){return new he((n,i)=>{const s=()=>{e()===!0?r().next(()=>{s()},i):n()};s()})}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class iv{constructor(e,r){this.action=e,this.transaction=r,this.aborted=!1,this.P=new os,this.transaction.oncomplete=()=>{this.P.resolve()},this.transaction.onabort=()=>{r.error?this.P.reject(new Rh(e,r.error)):this.P.resolve()},this.transaction.onerror=n=>{const i=ox(n.target.error);this.P.reject(new Rh(e,i))}}static open(e,r,n,i){try{return new iv(r,e.transaction(i,n))}catch(s){throw new Rh(r,s)}}get v(){return this.P.promise}abort(e){e&&this.P.reject(e),this.aborted||(ke("SimpleDb","Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}V(){const e=this.transaction;this.aborted||typeof e.commit!="function"||e.commit()}store(e){const r=this.transaction.objectStore(e);return new BH(r)}}class yo{constructor(e,r,n){this.name=e,this.version=r,this.S=n,yo.D(Mr())===12.2&&br("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.")}static delete(e){return ke("SimpleDb","Removing database:",e),_u(window.indexedDB.deleteDatabase(e)).toPromise()}static C(){if(!yE())return!1;if(yo.N())return!0;const e=Mr(),r=yo.D(e),n=00||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||n||s)}static N(){var e;return typeof process!="undefined"&&((e=process.env)===null||e===void 0?void 0:e.O)==="YES"}static M(e,r){return e.store(r)}static D(e){const r=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=r?r[1].split("_").slice(0,2).join("."):"-1";return Number(n)}static k(e){const r=e.match(/Android ([\d.]+)/i),n=r?r[1].split(".").slice(0,2).join("."):"-1";return Number(n)}async F(e){return this.db||(ke("SimpleDb","Opening database:",this.name),this.db=await new Promise((r,n)=>{const i=indexedDB.open(this.name,this.version);i.onsuccess=s=>{const o=s.target.result;r(o)},i.onblocked=()=>{n(new Rh(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=s=>{const o=s.target.error;o.name==="VersionError"?n(new Le(xe.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"?n(new Le(xe.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)):n(new Rh(e,o))},i.onupgradeneeded=s=>{ke("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',s.oldVersion);const o=s.target.result;this.S.$(o,i.transaction,s.oldVersion,this.version).next(()=>{ke("SimpleDb","Database upgrade to version "+this.version+" complete")})}})),this.B&&(this.db.onversionchange=r=>this.B(r)),this.db}L(e){this.B=e,this.db&&(this.db.onversionchange=r=>e(r))}async runTransaction(e,r,n,i){const s=r==="readonly";let o=0;for(;;){++o;try{this.db=await this.F(e);const a=iv.open(this.db,e,s?"readonly":"readwrite",n),u=i(a).next(c=>(a.V(),c)).catch(c=>(a.abort(c),he.reject(c))).toPromise();return u.catch(()=>{}),await a.v,u}catch(a){const u=a,c=u.name!=="FirebaseError"&&o<3;if(ke("SimpleDb","Transaction failed with error:",u.message,"Retrying:",c),this.close(),!c)return Promise.reject(u)}}}close(){this.db&&this.db.close(),this.db=void 0}}class LH{constructor(e){this.U=e,this.q=!1,this.K=null}get isDone(){return this.q}get G(){return this.K}set cursor(e){this.U=e}done(){this.q=!0}j(e){this.K=e}delete(){return _u(this.U.delete())}}class Rh extends Le{constructor(e,r){super(xe.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${r}`),this.name="IndexedDbTransactionError"}}function Ja(t){return t.name==="IndexedDbTransactionError"}class BH{constructor(e){this.store=e}put(e,r){let n;return r!==void 0?(ke("SimpleDb","PUT",this.store.name,e,r),n=this.store.put(r,e)):(ke("SimpleDb","PUT",this.store.name,"",e),n=this.store.put(e)),_u(n)}add(e){return ke("SimpleDb","ADD",this.store.name,e,e),_u(this.store.add(e))}get(e){return _u(this.store.get(e)).next(r=>(r===void 0&&(r=null),ke("SimpleDb","GET",this.store.name,e,r),r))}delete(e){return ke("SimpleDb","DELETE",this.store.name,e),_u(this.store.delete(e))}count(){return ke("SimpleDb","COUNT",this.store.name),_u(this.store.count())}W(e,r){const n=this.options(e,r);if(n.index||typeof this.store.getAll!="function"){const i=this.cursor(n),s=[];return this.H(i,(o,a)=>{s.push(a)}).next(()=>s)}{const i=this.store.getAll(n.range);return new he((s,o)=>{i.onerror=a=>{o(a.target.error)},i.onsuccess=a=>{s(a.target.result)}})}}J(e,r){const n=this.store.getAll(e,r===null?void 0:r);return new he((i,s)=>{n.onerror=o=>{s(o.target.error)},n.onsuccess=o=>{i(o.target.result)}})}Y(e,r){ke("SimpleDb","DELETE ALL",this.store.name);const n=this.options(e,r);n.X=!1;const i=this.cursor(n);return this.H(i,(s,o,a)=>a.delete())}Z(e,r){let n;r?n=e:(n={},r=e);const i=this.cursor(n);return this.H(i,r)}tt(e){const r=this.cursor({});return new he((n,i)=>{r.onerror=s=>{const o=ox(s.target.error);i(o)},r.onsuccess=s=>{const o=s.target.result;o?e(o.primaryKey,o.value).next(a=>{a?o.continue():n()}):n()}})}H(e,r){const n=[];return new he((i,s)=>{e.onerror=o=>{s(o.target.error)},e.onsuccess=o=>{const a=o.target.result;if(!a)return void i();const u=new LH(a),c=r(a.primaryKey,a.value,u);if(c instanceof he){const l=c.catch(h=>(u.done(),he.reject(h)));n.push(l)}u.isDone?i():u.G===null?a.continue():a.continue(u.G)}}).next(()=>he.waitFor(n))}options(e,r){let n;return e!==void 0&&(typeof e=="string"?n=e:r=e),{index:n,range:r}}cursor(e){let r="next";if(e.reverse&&(r="prev"),e.index){const n=this.store.index(e.index);return e.X?n.openKeyCursor(e.range,r):n.openCursor(e.range,r)}return this.store.openCursor(e.range,r)}}function _u(t){return new he((e,r)=>{t.onsuccess=n=>{const i=n.target.result;e(i)},t.onerror=n=>{const i=ox(n.target.error);r(i)}})}let hT=!1;function ox(t){const e=yo.D(Mr());if(e>=12.2&&e<13){const r="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(r)>=0){const n=new Le("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${r}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return hT||(hT=!0,setTimeout(()=>{throw n},0)),n}}return t}class $H{constructor(e,r){this.asyncQueue=e,this.et=r,this.task=null}start(){this.nt(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return this.task!==null}nt(e){ke("IndexBackiller",`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,async()=>{this.task=null;try{ke("IndexBackiller",`Documents written: ${await this.et.st()}`)}catch(r){Ja(r)?ke("IndexBackiller","Ignoring IndexedDB error during index backfill: ",r):await Ya(r)}await this.nt(6e4)})}}class FH{constructor(e,r){this.localStore=e,this.persistence=r}async st(e=50){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",r=>this.it(r,e))}it(e,r){const n=new Set;let i=r,s=!0;return he.doWhile(()=>s===!0&&i>0,()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next(o=>{if(o!==null&&!n.has(o))return ke("IndexBackiller",`Processing collection: ${o}`),this.rt(e,o,i).next(a=>{i-=a,n.add(o)});s=!1})).next(()=>r-i)}rt(e,r,n){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,r).next(i=>this.localStore.localDocuments.getNextDocuments(e,r,i,n).next(s=>{const o=s.changes;return this.localStore.indexManager.updateIndexEntries(e,o).next(()=>this.ot(i,s)).next(a=>(ke("IndexBackiller",`Updating offset: ${a}`),this.localStore.indexManager.updateCollectionGroup(e,r,a))).next(()=>o.size)}))}ot(e,r){let n=e;return r.changes.forEach((i,s)=>{const o=DN(s);sx(o,n)>0&&(n=o)}),new pi(n.readTime,n.documentKey,Math.max(r.batchId,e.largestBatchId))}}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Hn{constructor(e,r){this.previousValue=e,r&&(r.sequenceNumberHandler=n=>this.ut(n),this.ct=n=>r.writeSequenceNumber(n))}ut(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ct&&this.ct(e),e}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function dT(t){let e=0;for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function Ic(t,e){for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&e(r,t[r])}function BN(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */Hn.at=-1;class vr{constructor(e,r){this.comparator=e,this.root=r||Jr.EMPTY}insert(e,r){return new vr(this.comparator,this.root.insert(e,r,this.comparator).copy(null,null,Jr.BLACK,null,null))}remove(e){return new vr(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Jr.BLACK,null,null))}get(e){let r=this.root;for(;!r.isEmpty();){const n=this.comparator(e,r.key);if(n===0)return r.value;n<0?r=r.left:n>0&&(r=r.right)}return null}indexOf(e){let r=0,n=this.root;for(;!n.isEmpty();){const i=this.comparator(e,n.key);if(i===0)return r+n.left.size;i<0?n=n.left:(r+=n.left.size+1,n=n.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((r,n)=>(e(r,n),!1))}toString(){const e=[];return this.inorderTraversal((r,n)=>(e.push(`${r}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new ng(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new ng(this.root,e,this.comparator,!1)}getReverseIterator(){return new ng(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new ng(this.root,e,this.comparator,!0)}}class ng{constructor(e,r,n,i){this.isReverse=i,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=r?n(e.key,r):1,r&&i&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const r={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 r}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 Jr{constructor(e,r,n,i,s){this.key=e,this.value=r,this.color=n!=null?n:Jr.RED,this.left=i!=null?i:Jr.EMPTY,this.right=s!=null?s:Jr.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,r,n,i,s){return new Jr(e!=null?e:this.key,r!=null?r:this.value,n!=null?n:this.color,i!=null?i:this.left,s!=null?s: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,r,n){let i=this;const s=n(e,i.key);return i=s<0?i.copy(null,null,null,i.left.insert(e,r,n),null):s===0?i.copy(null,r,null,null,null):i.copy(null,null,null,null,i.right.insert(e,r,n)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Jr.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,r){let n,i=this;if(r(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,r),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),r(e,i.key)===0){if(i.right.isEmpty())return Jr.EMPTY;n=i.right.min(),i=i.copy(n.key,n.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,r))}return i.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,Jr.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Jr.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),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,r)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw ze();const e=this.left.check();if(e!==this.right.check())throw ze();return e+(this.isRed()?0:1)}}Jr.EMPTY=null,Jr.RED=!0,Jr.BLACK=!1;Jr.EMPTY=new class{constructor(){this.size=0}get key(){throw ze()}get value(){throw ze()}get color(){throw ze()}get left(){throw ze()}get right(){throw ze()}copy(t,e,r,n,i){return this}insert(t,e,r){return new Jr(t,e)}remove(t,e){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Zt{constructor(e){this.comparator=e,this.data=new vr(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((r,n)=>(e(r),!1))}forEachInRange(e,r){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const i=n.getNext();if(this.comparator(i.key,e[1])>=0)return;r(i.key)}}forEachWhile(e,r){let n;for(n=r!==void 0?this.data.getIteratorFrom(r):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const r=this.data.getIteratorFrom(e);return r.hasNext()?r.getNext().key:null}getIterator(){return new pT(this.data.getIterator())}getIteratorFrom(e){return new pT(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 r=this;return r.size{r=r.add(n)}),r}isEqual(e){if(!(e instanceof Zt)||this.size!==e.size)return!1;const r=this.data.getIterator(),n=e.data.getIterator();for(;r.hasNext();){const i=r.getNext().key,s=n.getNext().key;if(this.comparator(i,s)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(r=>{e.push(r)}),e}toString(){const e=[];return this.forEach(r=>e.push(r)),"SortedSet("+e.toString()+")"}copy(e){const r=new Zt(this.comparator);return r.data=e,r}}class pT{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function Dc(t){return t.hasNext()?t.getNext():void 0}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ci{constructor(e){this.fields=e,e.sort(Tr.comparator)}static empty(){return new ci([])}unionWith(e){let r=new Zt(Tr.comparator);for(const n of this.fields)r=r.add(n);for(const n of e)r=r.add(n);return new ci(r.toArray())}covers(e){for(const r of this.fields)if(r.isPrefixOf(e))return!0;return!1}isEqual(e){return Ll(this.fields,e.fields,(r,n)=>r.isEqual(n))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class zr{constructor(e){this.binaryString=e}static fromBase64String(e){const r=atob(e);return new zr(r)}static fromUint8Array(e){const r=function(n){let i="";for(let s=0;se=Number.MIN_SAFE_INTEGER}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const _a={mapValue:{fields:{__type__:{stringValue:"__max__"}}}},Mg={nullValue:"NULL_VALUE"};function rc(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?$N(t)?4:qN(t)?9007199254740991:10:ze()}function zs(t,e){if(t===e)return!0;const r=rc(t);if(r!==rc(e))return!1;switch(r){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return wd(t).isEqual(wd(e));case 3:return function(n,i){if(typeof n.timestampValue=="string"&&typeof i.timestampValue=="string"&&n.timestampValue.length===i.timestampValue.length)return n.timestampValue===i.timestampValue;const s=$a(n.timestampValue),o=$a(i.timestampValue);return s.seconds===o.seconds&&s.nanos===o.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(n,i){return ec(n.bytesValue).isEqual(ec(i.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(n,i){return pr(n.geoPointValue.latitude)===pr(i.geoPointValue.latitude)&&pr(n.geoPointValue.longitude)===pr(i.geoPointValue.longitude)}(t,e);case 2:return function(n,i){if("integerValue"in n&&"integerValue"in i)return pr(n.integerValue)===pr(i.integerValue);if("doubleValue"in n&&"doubleValue"in i){const s=pr(n.doubleValue),o=pr(i.doubleValue);return s===o?Ed(s)===Ed(o):isNaN(s)&&isNaN(o)}return!1}(t,e);case 9:return Ll(t.arrayValue.values||[],e.arrayValue.values||[],zs);case 10:return function(n,i){const s=n.mapValue.fields||{},o=i.mapValue.fields||{};if(dT(s)!==dT(o))return!1;for(const a in s)if(s.hasOwnProperty(a)&&(o[a]===void 0||!zs(s[a],o[a])))return!1;return!0}(t,e);default:return ze()}}function xd(t,e){return(t.values||[]).find(r=>zs(r,e))!==void 0}function Fa(t,e){if(t===e)return 0;const r=rc(t),n=rc(e);if(r!==n)return pt(r,n);switch(r){case 0:case 9007199254740991:return 0;case 1:return pt(t.booleanValue,e.booleanValue);case 2:return function(i,s){const o=pr(i.integerValue||i.doubleValue),a=pr(s.integerValue||s.doubleValue);return oa?1:o===a?0:isNaN(o)?isNaN(a)?0:-1:1}(t,e);case 3:return gT(t.timestampValue,e.timestampValue);case 4:return gT(wd(t),wd(e));case 5:return pt(t.stringValue,e.stringValue);case 6:return function(i,s){const o=ec(i),a=ec(s);return o.compareTo(a)}(t.bytesValue,e.bytesValue);case 7:return function(i,s){const o=i.split("/"),a=s.split("/");for(let u=0;ue.mapValue.fields[r]=Nh(n)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let r=0;r<(t.arrayValue.values||[]).length;++r)e.arrayValue.values[r]=Nh(t.arrayValue.values[r]);return e}return Object.assign({},t)}function qN(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}function jH(t){return"nullValue"in t?Mg:"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?Sd(tc.empty(),$e.empty()):"geoPointValue"in t?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in t?{arrayValue:{}}:"mapValue"in t?{mapValue:{}}:ze()}function VH(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?Sd(tc.empty(),$e.empty()):"referenceValue"in t?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in t?{arrayValue:{}}:"arrayValue"in t?{mapValue:{}}:"mapValue"in t?_a:ze()}function yT(t,e){const r=Fa(t.value,e.value);return r!==0?r:t.inclusive&&!e.inclusive?-1:!t.inclusive&&e.inclusive?1:0}function _T(t,e){const r=Fa(t.value,e.value);return r!==0?r:t.inclusive&&!e.inclusive?1:!t.inclusive&&e.inclusive?-1:0}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class vn{constructor(e){this.value=e}static empty(){return new vn({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let r=this.value;for(let n=0;n{if(!r.isImmediateParentOf(a)){const u=this.getFieldsMap(r);this.applyChanges(u,n,i),n={},i=[],r=a.popLast()}o?n[a.lastSegment()]=Nh(o):i.push(a.lastSegment())});const s=this.getFieldsMap(r);this.applyChanges(s,n,i)}delete(e){const r=this.field(e.popLast());Cg(r)&&r.mapValue.fields&&delete r.mapValue.fields[e.lastSegment()]}isEqual(e){return zs(this.value,e.value)}getFieldsMap(e){let r=this.value;r.mapValue.fields||(r.mapValue={fields:{}});for(let n=0;ne[i]=s);for(const i of n)delete e[i]}clone(){return new vn(Nh(this.value))}}function jN(t){const e=[];return Ic(t.fields,(r,n)=>{const i=new Tr([r]);if(Cg(n)){const s=jN(n.mapValue).fields;if(s.length===0)e.push(i);else for(const o of s)e.push(i.child(o))}else e.push(i)}),new ci(e)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class fr{constructor(e,r,n,i,s,o){this.key=e,this.documentType=r,this.version=n,this.readTime=i,this.data=s,this.documentState=o}static newInvalidDocument(e){return new fr(e,0,at.min(),at.min(),vn.empty(),0)}static newFoundDocument(e,r,n){return new fr(e,1,r,at.min(),n,0)}static newNoDocument(e,r){return new fr(e,2,r,at.min(),vn.empty(),0)}static newUnknownDocument(e,r){return new fr(e,3,r,at.min(),vn.empty(),2)}convertToFoundDocument(e,r){return this.version=e,this.documentType=1,this.data=r,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=vn.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=vn.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=at.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 fr&&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 fr(this.key,this.documentType,this.version,this.readTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class zH{constructor(e,r=null,n=[],i=[],s=null,o=null,a=null){this.path=e,this.collectionGroup=r,this.orderBy=n,this.filters=i,this.limit=s,this.startAt=o,this.endAt=a,this.ht=null}}function bT(t,e=null,r=[],n=[],i=null,s=null,o=null){return new zH(t,e,r,n,i,s,o)}function nc(t){const e=He(t);if(e.ht===null){let r=e.path.canonicalString();e.collectionGroup!==null&&(r+="|cg:"+e.collectionGroup),r+="|f:",r+=e.filters.map(n=>{return(i=n).field.canonicalString()+i.op.toString()+hl(i.value);var i}).join(","),r+="|ob:",r+=e.orderBy.map(n=>function(i){return i.field.canonicalString()+i.dir}(n)).join(","),sv(e.limit)||(r+="|l:",r+=e.limit),e.startAt&&(r+="|lb:",r+=e.startAt.inclusive?"b:":"a:",r+=e.startAt.position.map(n=>hl(n)).join(",")),e.endAt&&(r+="|ub:",r+=e.endAt.inclusive?"a:":"b:",r+=e.endAt.position.map(n=>hl(n)).join(",")),e.ht=r}return e.ht}function HH(t){let e=t.path.canonicalString();return t.collectionGroup!==null&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=`, filters: [${t.filters.map(r=>{return`${(n=r).field.canonicalString()} ${n.op} ${hl(n.value)}`;var n}).join(", ")}]`),sv(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=`, orderBy: [${t.orderBy.map(r=>function(n){return`${n.field.canonicalString()} (${n.dir})`}(r)).join(", ")}]`),t.startAt&&(e+=", startAt: ",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(r=>hl(r)).join(",")),t.endAt&&(e+=", endAt: ",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(r=>hl(r)).join(",")),`Target(${e})`}function lp(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let i=0;ir instanceof en&&r.field.isEqual(e))}function wT(t,e,r){let n=Mg,i=!0;for(const s of k0(t,e)){let o=Mg,a=!0;switch(s.op){case"<":case"<=":o=jH(s.value);break;case"==":case"in":case">=":o=s.value;break;case">":o=s.value,a=!1;break;case"!=":case"not-in":o=Mg}yT({value:n,inclusive:i},{value:o,inclusive:a})<0&&(n=o,i=a)}if(r!==null){for(let s=0;s=":case">":o=VH(s.value),a=!1;break;case"==":case"in":case"<=":o=s.value;break;case"<":o=s.value,a=!1;break;case"!=":case"not-in":o=_a}_T({value:n,inclusive:i},{value:o,inclusive:a})>0&&(n=o,i=a)}if(r!==null){for(let s=0;s0&&(n=o,i=r.inclusive);break}}return{value:n,inclusive:i}}class en extends class{}{constructor(e,r,n){super(),this.field=e,this.op=r,this.value=n}static create(e,r,n){return e.isKeyField()?r==="in"||r==="not-in"?this.lt(e,r,n):new KH(e,r,n):r==="array-contains"?new XH(e,n):r==="in"?new YH(e,n):r==="not-in"?new JH(e,n):r==="array-contains-any"?new QH(e,n):new en(e,r,n)}static lt(e,r,n){return r==="in"?new GH(e,n):new WH(e,n)}matches(e){const r=e.data.field(this.field);return this.op==="!="?r!==null&&this.ft(Fa(r,this.value)):r!==null&&rc(this.value)===rc(r)&&this.ft(Fa(r,this.value))}ft(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 ze()}}dt(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}}class KH extends en{constructor(e,r,n){super(e,r,n),this.key=$e.fromName(n.referenceValue)}matches(e){const r=$e.comparator(e.key,this.key);return this.ft(r)}}class GH extends en{constructor(e,r){super(e,"in",r),this.keys=VN("in",r)}matches(e){return this.keys.some(r=>r.isEqual(e.key))}}class WH extends en{constructor(e,r){super(e,"not-in",r),this.keys=VN("not-in",r)}matches(e){return!this.keys.some(r=>r.isEqual(e.key))}}function VN(t,e){var r;return(((r=e.arrayValue)===null||r===void 0?void 0:r.values)||[]).map(n=>$e.fromName(n.referenceValue))}class XH extends en{constructor(e,r){super(e,"array-contains",r)}matches(e){const r=e.data.field(this.field);return Id(r)&&xd(r.arrayValue,this.value)}}class YH extends en{constructor(e,r){super(e,"in",r)}matches(e){const r=e.data.field(this.field);return r!==null&&xd(this.value.arrayValue,r)}}class JH extends en{constructor(e,r){super(e,"not-in",r)}matches(e){if(xd(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const r=e.data.field(this.field);return r!==null&&!xd(this.value.arrayValue,r)}}class QH extends en{constructor(e,r){super(e,"array-contains-any",r)}matches(e){const r=e.data.field(this.field);return!(!Id(r)||!r.arrayValue.values)&&r.arrayValue.values.some(n=>xd(this.value.arrayValue,n))}}class Bl{constructor(e,r){this.position=e,this.inclusive=r}}class dl{constructor(e,r="asc"){this.field=e,this.dir=r}}function ZH(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function xT(t,e,r){let n=0;for(let i=0;i0?t.explicitOrderBy[0].field:null}function ux(t){for(const e of t.filters)if(e.dt())return e.field;return null}function HN(t){return t.collectionGroup!==null}function Td(t){const e=He(t);if(e._t===null){e._t=[];const r=ux(e),n=ax(e);if(r!==null&&n===null)r.isKeyField()||e._t.push(new dl(r)),e._t.push(new dl(Tr.keyField(),"asc"));else{let i=!1;for(const s of e.explicitOrderBy)e._t.push(s),s.field.isKeyField()&&(i=!0);if(!i){const s=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e._t.push(new dl(Tr.keyField(),s))}}}return e._t}function Oi(t){const e=He(t);if(!e.wt)if(e.limitType==="F")e.wt=bT(e.path,e.collectionGroup,Td(e),e.filters,e.limit,e.startAt,e.endAt);else{const r=[];for(const s of Td(e)){const o=s.dir==="desc"?"asc":"desc";r.push(new dl(s.field,o))}const n=e.endAt?new Bl(e.endAt.position,e.endAt.inclusive):null,i=e.startAt?new Bl(e.startAt.position,e.startAt.inclusive):null;e.wt=bT(e.path,e.collectionGroup,r,e.filters,e.limit,n,i)}return e.wt}function M0(t,e,r){return new df(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,r,t.startAt,t.endAt)}function ov(t,e){return lp(Oi(t),Oi(e))&&t.limitType===e.limitType}function KN(t){return`${nc(Oi(t))}|lt:${t.limitType}`}function y1(t){return`Query(target=${HH(Oi(t))}; limitType=${t.limitType})`}function cx(t,e){return e.isFoundDocument()&&function(r,n){const i=n.key.path;return r.collectionGroup!==null?n.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(i):$e.isDocumentKey(r.path)?r.path.isEqual(i):r.path.isImmediateParentOf(i)}(t,e)&&function(r,n){for(const i of r.explicitOrderBy)if(!i.field.isKeyField()&&n.data.field(i.field)===null)return!1;return!0}(t,e)&&function(r,n){for(const i of r.filters)if(!i.matches(n))return!1;return!0}(t,e)&&function(r,n){return!(r.startAt&&!function(i,s,o){const a=xT(i,s,o);return i.inclusive?a<=0:a<0}(r.startAt,Td(r),n)||r.endAt&&!function(i,s,o){const a=xT(i,s,o);return i.inclusive?a>=0:a>0}(r.endAt,Td(r),n))}(t,e)}function GN(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function WN(t){return(e,r)=>{let n=!1;for(const i of Td(t)){const s=eK(i,e,r);if(s!==0)return s;n=n||i.field.isKeyField()}return 0}}function eK(t,e,r){const n=t.field.isKeyField()?$e.comparator(e.key,r.key):function(i,s,o){const a=s.data.field(i),u=o.data.field(i);return a!==null&&u!==null?Fa(a,u):ze()}(t.field,e,r);switch(t.dir){case"asc":return n;case"desc":return-1*n;default:return ze()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function XN(t,e){if(t.gt){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Ed(e)?"-0":e}}function YN(t){return{integerValue:""+t}}function JN(t,e){return UN(e)?YN(e):XN(t,e)}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class av{constructor(){this._=void 0}}function tK(t,e,r){return t instanceof Ad?function(n,i){const s={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:n.seconds,nanos:n.nanoseconds}}}};return i&&(s.fields.__previous_value__=i),{mapValue:s}}(r,e):t instanceof ic?ZN(t,e):t instanceof sc?eO(t,e):function(n,i){const s=QN(n,i),o=TT(s)+TT(n.yt);return v1(s)&&v1(n.yt)?YN(o):XN(n.It,o)}(t,e)}function rK(t,e,r){return t instanceof ic?ZN(t,e):t instanceof sc?eO(t,e):r}function QN(t,e){return t instanceof $l?v1(r=e)||function(n){return!!n&&"doubleValue"in n}(r)?e:{integerValue:0}:null;var r}class Ad extends av{}class ic extends av{constructor(e){super(),this.elements=e}}function ZN(t,e){const r=tO(e);for(const n of t.elements)r.some(i=>zs(i,n))||r.push(n);return{arrayValue:{values:r}}}class sc extends av{constructor(e){super(),this.elements=e}}function eO(t,e){let r=tO(e);for(const n of t.elements)r=r.filter(i=>!zs(i,n));return{arrayValue:{values:r}}}class $l extends av{constructor(e,r){super(),this.It=e,this.yt=r}}function TT(t){return pr(t.integerValue||t.doubleValue)}function tO(t){return Id(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class uv{constructor(e,r){this.field=e,this.transform=r}}function nK(t,e){return t.field.isEqual(e.field)&&function(r,n){return r instanceof ic&&n instanceof ic||r instanceof sc&&n instanceof sc?Ll(r.elements,n.elements,zs):r instanceof $l&&n instanceof $l?zs(r.yt,n.yt):r instanceof Ad&&n instanceof Ad}(t.transform,e.transform)}class iK{constructor(e,r){this.version=e,this.transformResults=r}}class yn{constructor(e,r){this.updateTime=e,this.exists=r}static none(){return new yn}static exists(e){return new yn(void 0,e)}static updateTime(e){return new yn(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 Rg(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class cv{}function rO(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new lv(t.key,yn.none()):new pf(t.key,t.data,yn.none());{const r=t.data,n=vn.empty();let i=new Zt(Tr.comparator);for(let s of e.fields)if(!i.has(s)){let o=r.field(s);o===null&&s.length>1&&(s=s.popLast(),o=r.field(s)),o===null?n.delete(s):n.set(s,o),i=i.add(s)}return new Go(t.key,n,new ci(i.toArray()),yn.none())}}function sK(t,e,r){t instanceof pf?function(n,i,s){const o=n.value.clone(),a=kT(n.fieldTransforms,i,s.transformResults);o.setAll(a),i.convertToFoundDocument(s.version,o).setHasCommittedMutations()}(t,e,r):t instanceof Go?function(n,i,s){if(!Rg(n.precondition,i))return void i.convertToUnknownDocument(s.version);const o=kT(n.fieldTransforms,i,s.transformResults),a=i.data;a.setAll(nO(n)),a.setAll(o),i.convertToFoundDocument(s.version,a).setHasCommittedMutations()}(t,e,r):function(n,i,s){i.convertToNoDocument(s.version).setHasCommittedMutations()}(0,e,r)}function Oh(t,e,r,n){return t instanceof pf?function(i,s,o,a){if(!Rg(i.precondition,s))return o;const u=i.value.clone(),c=MT(i.fieldTransforms,a,s);return u.setAll(c),s.convertToFoundDocument(s.version,u).setHasLocalMutations(),null}(t,e,r,n):t instanceof Go?function(i,s,o,a){if(!Rg(i.precondition,s))return o;const u=MT(i.fieldTransforms,a,s),c=s.data;return c.setAll(nO(i)),c.setAll(u),s.convertToFoundDocument(s.version,c).setHasLocalMutations(),o===null?null:o.unionWith(i.fieldMask.fields).unionWith(i.fieldTransforms.map(l=>l.field))}(t,e,r,n):function(i,s,o){return Rg(i.precondition,s)?(s.convertToNoDocument(s.version).setHasLocalMutations(),null):o}(t,e,r)}function oK(t,e){let r=null;for(const n of t.fieldTransforms){const i=e.data.field(n.field),s=QN(n.transform,i||null);s!=null&&(r===null&&(r=vn.empty()),r.set(n.field,s))}return r||null}function AT(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,n){return r===void 0&&n===void 0||!(!r||!n)&&Ll(r,n,(i,s)=>nK(i,s))}(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 pf extends cv{constructor(e,r,n,i=[]){super(),this.key=e,this.value=r,this.precondition=n,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Go extends cv{constructor(e,r,n,i,s=[]){super(),this.key=e,this.data=r,this.fieldMask=n,this.precondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function nO(t){const e=new Map;return t.fieldMask.fields.forEach(r=>{if(!r.isEmpty()){const n=t.data.field(r);e.set(r,n)}}),e}function kT(t,e,r){const n=new Map;ft(t.length===r.length);for(let i=0;i{for(const[i,s]of n)e(i,s)})}isEmpty(){return BN(this.inner)}size(){return this.innerSize}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const cK=new vr($e.comparator);function ni(){return cK}const oO=new vr($e.comparator);function ph(...t){let e=oO;for(const r of t)e=e.insert(r.key,r);return e}function aO(t){let e=oO;return t.forEach((r,n)=>e=e.insert(r,n.overlayedDocument)),e}function Ds(){return Dh()}function uO(){return Dh()}function Dh(){return new Qa(t=>t.toString(),(t,e)=>t.isEqual(e))}const lK=new vr($e.comparator),fK=new Zt($e.comparator);function yt(...t){let e=fK;for(const r of t)e=e.add(r);return e}const hK=new Zt(pt);function fv(){return hK}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hp{constructor(e,r,n,i,s){this.snapshotVersion=e,this.targetChanges=r,this.targetMismatches=n,this.documentUpdates=i,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,r,n){const i=new Map;return i.set(e,dp.createSynthesizedTargetChangeForCurrentChange(e,r,n)),new hp(at.min(),i,fv(),ni(),yt())}}class dp{constructor(e,r,n,i,s){this.resumeToken=e,this.current=r,this.addedDocuments=n,this.modifiedDocuments=i,this.removedDocuments=s}static createSynthesizedTargetChangeForCurrentChange(e,r,n){return new dp(n,r,yt(),yt(),yt())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ng{constructor(e,r,n,i){this.Tt=e,this.removedTargetIds=r,this.key=n,this.Et=i}}class cO{constructor(e,r){this.targetId=e,this.At=r}}class lO{constructor(e,r,n=zr.EMPTY_BYTE_STRING,i=null){this.state=e,this.targetIds=r,this.resumeToken=n,this.cause=i}}class CT{constructor(){this.Rt=0,this.bt=NT(),this.Pt=zr.EMPTY_BYTE_STRING,this.vt=!1,this.Vt=!0}get current(){return this.vt}get resumeToken(){return this.Pt}get St(){return this.Rt!==0}get Dt(){return this.Vt}Ct(e){e.approximateByteSize()>0&&(this.Vt=!0,this.Pt=e)}xt(){let e=yt(),r=yt(),n=yt();return this.bt.forEach((i,s)=>{switch(s){case 0:e=e.add(i);break;case 2:r=r.add(i);break;case 1:n=n.add(i);break;default:ze()}}),new dp(this.Pt,this.vt,e,r,n)}Nt(){this.Vt=!1,this.bt=NT()}kt(e,r){this.Vt=!0,this.bt=this.bt.insert(e,r)}Ot(e){this.Vt=!0,this.bt=this.bt.remove(e)}Mt(){this.Rt+=1}Ft(){this.Rt-=1}$t(){this.Vt=!0,this.vt=!0}}class dK{constructor(e){this.Bt=e,this.Lt=new Map,this.Ut=ni(),this.qt=RT(),this.Kt=new Zt(pt)}Gt(e){for(const r of e.Tt)e.Et&&e.Et.isFoundDocument()?this.Qt(r,e.Et):this.jt(r,e.key,e.Et);for(const r of e.removedTargetIds)this.jt(r,e.key,e.Et)}Wt(e){this.forEachTarget(e,r=>{const n=this.zt(r);switch(e.state){case 0:this.Ht(r)&&n.Ct(e.resumeToken);break;case 1:n.Ft(),n.St||n.Nt(),n.Ct(e.resumeToken);break;case 2:n.Ft(),n.St||this.removeTarget(r);break;case 3:this.Ht(r)&&(n.$t(),n.Ct(e.resumeToken));break;case 4:this.Ht(r)&&(this.Jt(r),n.Ct(e.resumeToken));break;default:ze()}})}forEachTarget(e,r){e.targetIds.length>0?e.targetIds.forEach(r):this.Lt.forEach((n,i)=>{this.Ht(i)&&r(i)})}Yt(e){const r=e.targetId,n=e.At.count,i=this.Xt(r);if(i){const s=i.target;if(A0(s))if(n===0){const o=new $e(s.path);this.jt(r,o,fr.newNoDocument(o,at.min()))}else ft(n===1);else this.Zt(r)!==n&&(this.Jt(r),this.Kt=this.Kt.add(r))}}te(e){const r=new Map;this.Lt.forEach((s,o)=>{const a=this.Xt(o);if(a){if(s.current&&A0(a.target)){const u=new $e(a.target.path);this.Ut.get(u)!==null||this.ee(o,u)||this.jt(o,u,fr.newNoDocument(u,e))}s.Dt&&(r.set(o,s.xt()),s.Nt())}});let n=yt();this.qt.forEach((s,o)=>{let a=!0;o.forEachWhile(u=>{const c=this.Xt(u);return!c||c.purpose===2||(a=!1,!1)}),a&&(n=n.add(s))}),this.Ut.forEach((s,o)=>o.setReadTime(e));const i=new hp(e,r,this.Kt,this.Ut,n);return this.Ut=ni(),this.qt=RT(),this.Kt=new Zt(pt),i}Qt(e,r){if(!this.Ht(e))return;const n=this.ee(e,r.key)?2:0;this.zt(e).kt(r.key,n),this.Ut=this.Ut.insert(r.key,r),this.qt=this.qt.insert(r.key,this.ne(r.key).add(e))}jt(e,r,n){if(!this.Ht(e))return;const i=this.zt(e);this.ee(e,r)?i.kt(r,1):i.Ot(r),this.qt=this.qt.insert(r,this.ne(r).delete(e)),n&&(this.Ut=this.Ut.insert(r,n))}removeTarget(e){this.Lt.delete(e)}Zt(e){const r=this.zt(e).xt();return this.Bt.getRemoteKeysForTarget(e).size+r.addedDocuments.size-r.removedDocuments.size}Mt(e){this.zt(e).Mt()}zt(e){let r=this.Lt.get(e);return r||(r=new CT,this.Lt.set(e,r)),r}ne(e){let r=this.qt.get(e);return r||(r=new Zt(pt),this.qt=this.qt.insert(e,r)),r}Ht(e){const r=this.Xt(e)!==null;return r||ke("WatchChangeAggregator","Detected inactive target",e),r}Xt(e){const r=this.Lt.get(e);return r&&r.St?null:this.Bt.se(e)}Jt(e){this.Lt.set(e,new CT),this.Bt.getRemoteKeysForTarget(e).forEach(r=>{this.jt(e,r,null)})}ee(e,r){return this.Bt.getRemoteKeysForTarget(e).has(r)}}function RT(){return new vr($e.comparator)}function NT(){return new vr($e.comparator)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const pK=(()=>({asc:"ASCENDING",desc:"DESCENDING"}))(),gK=(()=>({"<":"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"}))();class mK{constructor(e,r){this.databaseId=e,this.gt=r}}function kd(t,e){return t.gt?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function fO(t,e){return t.gt?e.toBase64():e.toUint8Array()}function vK(t,e){return kd(t,e.toTimestamp())}function li(t){return ft(!!t),at.fromTimestamp(function(e){const r=$a(e);return new dr(r.seconds,r.nanos)}(t))}function lx(t,e){return function(r){return new Wt(["projects",r.projectId,"databases",r.database])}(t).child("documents").child(e).canonicalString()}function hO(t){const e=Wt.fromString(t);return ft(_O(e)),e}function C0(t,e){return lx(t.databaseId,e.path)}function zu(t,e){const r=hO(e);if(r.get(1)!==t.databaseId.projectId)throw new Le(xe.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+r.get(1)+" vs "+t.databaseId.projectId);if(r.get(3)!==t.databaseId.database)throw new Le(xe.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+r.get(3)+" vs "+t.databaseId.database);return new $e(pO(r))}function _1(t,e){return lx(t.databaseId,e)}function dO(t){const e=hO(t);return e.length===4?Wt.emptyPath():pO(e)}function b1(t){return new Wt(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function pO(t){return ft(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function OT(t,e,r){return{name:C0(t,e),fields:r.value.mapValue.fields}}function yK(t,e,r){const n=zu(t,e.name),i=li(e.updateTime),s=new vn({mapValue:{fields:e.fields}}),o=fr.newFoundDocument(n,i,s);return r&&o.setHasCommittedMutations(),r?o.setHasCommittedMutations():o}function _K(t,e){let r;if("targetChange"in e){e.targetChange;const n=function(u){return u==="NO_CHANGE"?0:u==="ADD"?1:u==="REMOVE"?2:u==="CURRENT"?3:u==="RESET"?4:ze()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],s=function(u,c){return u.gt?(ft(c===void 0||typeof c=="string"),zr.fromBase64String(c||"")):(ft(c===void 0||c instanceof Uint8Array),zr.fromUint8Array(c||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(u){const c=u.code===void 0?xe.UNKNOWN:sO(u.code);return new Le(c,u.message||"")}(o);r=new lO(n,i,s,a||null)}else if("documentChange"in e){e.documentChange;const n=e.documentChange;n.document,n.document.name,n.document.updateTime;const i=zu(t,n.document.name),s=li(n.document.updateTime),o=new vn({mapValue:{fields:n.document.fields}}),a=fr.newFoundDocument(i,s,o),u=n.targetIds||[],c=n.removedTargetIds||[];r=new Ng(u,c,a.key,a)}else if("documentDelete"in e){e.documentDelete;const n=e.documentDelete;n.document;const i=zu(t,n.document),s=n.readTime?li(n.readTime):at.min(),o=fr.newNoDocument(i,s),a=n.removedTargetIds||[];r=new Ng([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const n=e.documentRemove;n.document;const i=zu(t,n.document),s=n.removedTargetIds||[];r=new Ng([],s,i,null)}else{if(!("filter"in e))return ze();{e.filter;const n=e.filter;n.targetId;const i=n.count||0,s=new aK(i),o=n.targetId;r=new cO(o,s)}}return r}function R0(t,e){let r;if(e instanceof pf)r={update:OT(t,e.key,e.value)};else if(e instanceof lv)r={delete:C0(t,e.key)};else if(e instanceof Go)r={update:OT(t,e.key,e.data),updateMask:TK(e.fieldMask)};else{if(!(e instanceof iO))return ze();r={verify:C0(t,e.key)}}return e.fieldTransforms.length>0&&(r.updateTransforms=e.fieldTransforms.map(n=>function(i,s){const o=s.transform;if(o instanceof Ad)return{fieldPath:s.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(o instanceof ic)return{fieldPath:s.field.canonicalString(),appendMissingElements:{values:o.elements}};if(o instanceof sc)return{fieldPath:s.field.canonicalString(),removeAllFromArray:{values:o.elements}};if(o instanceof $l)return{fieldPath:s.field.canonicalString(),increment:o.yt};throw ze()}(0,n))),e.precondition.isNone||(r.currentDocument=function(n,i){return i.updateTime!==void 0?{updateTime:vK(n,i.updateTime)}:i.exists!==void 0?{exists:i.exists}:ze()}(t,e.precondition)),r}function w1(t,e){const r=e.currentDocument?function(i){return i.updateTime!==void 0?yn.updateTime(li(i.updateTime)):i.exists!==void 0?yn.exists(i.exists):yn.none()}(e.currentDocument):yn.none(),n=e.updateTransforms?e.updateTransforms.map(i=>function(s,o){let a=null;if("setToServerValue"in o)ft(o.setToServerValue==="REQUEST_TIME"),a=new Ad;else if("appendMissingElements"in o){const c=o.appendMissingElements.values||[];a=new ic(c)}else if("removeAllFromArray"in o){const c=o.removeAllFromArray.values||[];a=new sc(c)}else"increment"in o?a=new $l(s,o.increment):ze();const u=Tr.fromServerFormat(o.fieldPath);return new uv(u,a)}(t,i)):[];if(e.update){e.update.name;const i=zu(t,e.update.name),s=new vn({mapValue:{fields:e.update.fields}});if(e.updateMask){const o=function(a){const u=a.fieldPaths||[];return new ci(u.map(c=>Tr.fromServerFormat(c)))}(e.updateMask);return new Go(i,s,o,r,n)}return new pf(i,s,r,n)}if(e.delete){const i=zu(t,e.delete);return new lv(i,r)}if(e.verify){const i=zu(t,e.verify);return new iO(i,r)}return ze()}function bK(t,e){return t&&t.length>0?(ft(e!==void 0),t.map(r=>function(n,i){let s=n.updateTime?li(n.updateTime):li(i);return s.isEqual(at.min())&&(s=li(i)),new iK(s,n.transformResults||[])}(r,e))):[]}function gO(t,e){return{documents:[_1(t,e.path)]}}function mO(t,e){const r={structuredQuery:{}},n=e.path;e.collectionGroup!==null?(r.parent=_1(t,n),r.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(r.parent=_1(t,n.popLast()),r.structuredQuery.from=[{collectionId:n.lastSegment()}]);const i=function(u){if(u.length===0)return;const c=u.map(l=>function(h){if(h.op==="=="){if(vT(h.value))return{unaryFilter:{field:Pc(h.field),op:"IS_NAN"}};if(mT(h.value))return{unaryFilter:{field:Pc(h.field),op:"IS_NULL"}}}else if(h.op==="!="){if(vT(h.value))return{unaryFilter:{field:Pc(h.field),op:"IS_NOT_NAN"}};if(mT(h.value))return{unaryFilter:{field:Pc(h.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Pc(h.field),op:xK(h.op),value:h.value}}}(l));return c.length===1?c[0]:{compositeFilter:{op:"AND",filters:c}}}(e.filters);i&&(r.structuredQuery.where=i);const s=function(u){if(u.length!==0)return u.map(c=>function(l){return{field:Pc(l.field),direction:EK(l.dir)}}(c))}(e.orderBy);s&&(r.structuredQuery.orderBy=s);const o=function(u,c){return u.gt||sv(c)?c:{value:c}}(t,e.limit);var a;return o!==null&&(r.structuredQuery.limit=o),e.startAt&&(r.structuredQuery.startAt={before:(a=e.startAt).inclusive,values:a.position}),e.endAt&&(r.structuredQuery.endAt=function(u){return{before:!u.inclusive,values:u.position}}(e.endAt)),r}function vO(t){let e=dO(t.parent);const r=t.structuredQuery,n=r.from?r.from.length:0;let i=null;if(n>0){ft(n===1);const l=r.from[0];l.allDescendants?i=l.collectionId:e=e.child(l.collectionId)}let s=[];r.where&&(s=yO(r.where));let o=[];r.orderBy&&(o=r.orderBy.map(l=>function(h){return new dl(Yc(h.field),function(d){switch(d){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(h.direction))}(l)));let a=null;r.limit&&(a=function(l){let h;return h=typeof l=="object"?l.value:l,sv(h)?null:h}(r.limit));let u=null;r.startAt&&(u=function(l){const h=!!l.before,d=l.values||[];return new Bl(d,h)}(r.startAt));let c=null;return r.endAt&&(c=function(l){const h=!l.before,d=l.values||[];return new Bl(d,h)}(r.endAt)),zN(e,i,o,s,a,"F",u,c)}function wK(t,e){const r=function(n,i){switch(i){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return ze()}}(0,e.purpose);return r==null?null:{"goog-listen-tags":r}}function yO(t){return t?t.unaryFilter!==void 0?[IK(t)]:t.fieldFilter!==void 0?[SK(t)]:t.compositeFilter!==void 0?t.compositeFilter.filters.map(e=>yO(e)).reduce((e,r)=>e.concat(r)):ze():[]}function EK(t){return pK[t]}function xK(t){return gK[t]}function Pc(t){return{fieldPath:t.canonicalString()}}function Yc(t){return Tr.fromServerFormat(t.fieldPath)}function SK(t){return en.create(Yc(t.fieldFilter.field),function(e){switch(e){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";default:return ze()}}(t.fieldFilter.op),t.fieldFilter.value)}function IK(t){switch(t.unaryFilter.op){case"IS_NAN":const e=Yc(t.unaryFilter.field);return en.create(e,"==",{doubleValue:NaN});case"IS_NULL":const r=Yc(t.unaryFilter.field);return en.create(r,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const n=Yc(t.unaryFilter.field);return en.create(n,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=Yc(t.unaryFilter.field);return en.create(i,"!=",{nullValue:"NULL_VALUE"});default:return ze()}}function TK(t){const e=[];return t.fields.forEach(r=>e.push(r.canonicalString())),{fieldPaths:e}}function _O(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Dn(t){let e="";for(let r=0;r0&&(e=DT(e)),e=AK(t.get(r),e);return DT(e)}function AK(t,e){let r=e;const n=t.length;for(let i=0;i=2),e===2)return ft(t.charAt(0)===""&&t.charAt(1)===""),Wt.emptyPath();const r=e-2,n=[];let i="";for(let s=0;sr)&&ze(),t.charAt(o+1)){case"":const a=t.substring(s,o);let u;i.length===0?u=a:(i+=a,u=i,i=""),n.push(u);break;case"":i+=t.substring(s,o),i+="\0";break;case"":i+=t.substring(s,o+1);break;default:ze()}s=o+2}return new Wt(n)}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const PT=["userId","batchId"];/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Og(t,e){return[t,Dn(e)]}function bO(t,e,r){return[t,Dn(e),r]}const kK={},MK=["prefixPath","collectionGroup","readTime","documentId"],CK=["prefixPath","collectionGroup","documentId"],RK=["collectionGroup","readTime","prefixPath","documentId"],NK=["canonicalId","targetId"],OK=["targetId","path"],DK=["path","targetId"],PK=["collectionId","parent"],LK=["indexId","uid"],BK=["uid","sequenceNumber"],$K=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],FK=["indexId","uid","orderedDocumentKey"],UK=["userId","collectionPath","documentId"],qK=["userId","collectionPath","largestBatchId"],jK=["userId","collectionGroup","largestBatchId"],wO=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries"],VK=[...wO,"documentOverlays"],EO=["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"],xO=EO,zK=[...xO,"indexConfiguration","indexState","indexEntries"];/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class E1 extends LN{constructor(e,r){super(),this.ie=e,this.currentSequenceNumber=r}}function Gr(t,e){const r=He(t);return yo.M(r.ie,e)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class fx{constructor(e,r,n,i){this.batchId=e,this.localWriteTime=r,this.baseMutations=n,this.mutations=i}applyToRemoteDocument(e,r){const n=r.mutationResults;for(let i=0;i{const s=e.get(i.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=r.has(i.key)?null:a;const u=rO(o,a);u!==null&&n.set(i.key,u),o.isValidDocument()||o.convertToNoDocument(at.min())}),n}keys(){return this.mutations.reduce((e,r)=>e.add(r.key),yt())}isEqual(e){return this.batchId===e.batchId&&Ll(this.mutations,e.mutations,(r,n)=>AT(r,n))&&Ll(this.baseMutations,e.baseMutations,(r,n)=>AT(r,n))}}class hx{constructor(e,r,n,i){this.batch=e,this.commitVersion=r,this.mutationResults=n,this.docVersions=i}static from(e,r,n){ft(e.mutations.length===n.length);let i=lK;const s=e.mutations;for(let o=0;ow1(t.re,s));for(let s=0;sw1(t.re,s)),i=dr.fromMillis(e.localWriteTimeMs);return new fx(e.batchId,i,r,n)}function gh(t){const e=ac(t.readTime),r=t.lastLimboFreeSnapshotVersion!==void 0?ac(t.lastLimboFreeSnapshotVersion):at.min();let n;var i;return t.query.documents!==void 0?(ft((i=t.query).documents.length===1),n=Oi(fp(dO(i.documents[0])))):n=function(s){return Oi(vO(s))}(t.query),new Aa(n,t.targetId,0,t.lastListenSequenceNumber,e,r,zr.fromBase64String(t.resumeToken))}function IO(t,e){const r=oc(e.snapshotVersion),n=oc(e.lastLimboFreeSnapshotVersion);let i;i=A0(e.target)?gO(t.re,e.target):mO(t.re,e.target);const s=e.resumeToken.toBase64();return{targetId:e.targetId,canonicalId:nc(e.target),readTime:r,resumeToken:s,lastListenSequenceNumber:e.sequenceNumber,lastLimboFreeSnapshotVersion:n,query:i}}function TO(t){const e=vO({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?M0(e,e.limit,"L"):e}function E_(t,e){return new dx(e.largestBatchId,w1(t.re,e.overlayMutation))}function BT(t,e){const r=e.path.lastSegment();return[t,Dn(e.path.popLast()),r]}function $T(t,e,r,n){return{indexId:t,uid:e.uid||"",sequenceNumber:r,readTime:oc(n.readTime),documentKey:Dn(n.documentKey.path),largestBatchId:n.largestBatchId}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class KK{getBundleMetadata(e,r){return FT(e).get(r).next(n=>{if(n)return{id:(i=n).bundleId,createTime:ac(i.createTime),version:i.version};var i})}saveBundleMetadata(e,r){return FT(e).put({bundleId:(n=r).id,createTime:oc(li(n.createTime)),version:n.version});var n}getNamedQuery(e,r){return UT(e).get(r).next(n=>{if(n)return{name:(i=n).name,query:TO(i.bundledQuery),readTime:ac(i.readTime)};var i})}saveNamedQuery(e,r){return UT(e).put(function(n){return{name:n.name,readTime:oc(li(n.readTime)),bundledQuery:n.bundledQuery}}(r))}}function FT(t){return Gr(t,"bundles")}function UT(t){return Gr(t,"namedQueries")}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hv{constructor(e,r){this.It=e,this.userId=r}static oe(e,r){const n=r.uid||"";return new hv(e,n)}getOverlay(e,r){return $f(e).get(BT(this.userId,r)).next(n=>n?E_(this.It,n):null)}getOverlays(e,r){const n=Ds();return he.forEach(r,i=>this.getOverlay(e,i).next(s=>{s!==null&&n.set(i,s)})).next(()=>n)}saveOverlays(e,r,n){const i=[];return n.forEach((s,o)=>{const a=new dx(r,o);i.push(this.ue(e,a))}),he.waitFor(i)}removeOverlaysForBatchId(e,r,n){const i=new Set;r.forEach(o=>i.add(Dn(o.getCollectionPath())));const s=[];return i.forEach(o=>{const a=IDBKeyRange.bound([this.userId,o,n],[this.userId,o,n+1],!1,!0);s.push($f(e).Y("collectionPathOverlayIndex",a))}),he.waitFor(s)}getOverlaysForCollection(e,r,n){const i=Ds(),s=Dn(r),o=IDBKeyRange.bound([this.userId,s,n],[this.userId,s,Number.POSITIVE_INFINITY],!0);return $f(e).W("collectionPathOverlayIndex",o).next(a=>{for(const u of a){const c=E_(this.It,u);i.set(c.getKey(),c)}return i})}getOverlaysForCollectionGroup(e,r,n,i){const s=Ds();let o;const a=IDBKeyRange.bound([this.userId,r,n],[this.userId,r,Number.POSITIVE_INFINITY],!0);return $f(e).Z({index:"collectionGroupOverlayIndex",range:a},(u,c,l)=>{const h=E_(this.It,c);s.size()s)}ue(e,r){return $f(e).put(function(n,i,s){const[o,a,u]=BT(i,s.mutation.key);return{userId:i,collectionPath:a,documentId:u,collectionGroup:s.mutation.key.getCollectionGroup(),largestBatchId:s.largestBatchId,overlayMutation:R0(n.re,s.mutation)}}(this.It,this.userId,r))}}function $f(t){return Gr(t,"documentOverlays")}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class wu{constructor(){}ce(e,r){this.ae(e,r),r.he()}ae(e,r){if("nullValue"in e)this.le(r,5);else if("booleanValue"in e)this.le(r,10),r.fe(e.booleanValue?1:0);else if("integerValue"in e)this.le(r,15),r.fe(pr(e.integerValue));else if("doubleValue"in e){const n=pr(e.doubleValue);isNaN(n)?this.le(r,13):(this.le(r,15),Ed(n)?r.fe(0):r.fe(n))}else if("timestampValue"in e){const n=e.timestampValue;this.le(r,20),typeof n=="string"?r.de(n):(r.de(`${n.seconds||""}`),r.fe(n.nanos||0))}else if("stringValue"in e)this._e(e.stringValue,r),this.we(r);else if("bytesValue"in e)this.le(r,30),r.me(ec(e.bytesValue)),this.we(r);else if("referenceValue"in e)this.ge(e.referenceValue,r);else if("geoPointValue"in e){const n=e.geoPointValue;this.le(r,45),r.fe(n.latitude||0),r.fe(n.longitude||0)}else"mapValue"in e?qN(e)?this.le(r,Number.MAX_SAFE_INTEGER):(this.ye(e.mapValue,r),this.we(r)):"arrayValue"in e?(this.pe(e.arrayValue,r),this.we(r)):ze()}_e(e,r){this.le(r,25),this.Ie(e,r)}Ie(e,r){r.de(e)}ye(e,r){const n=e.fields||{};this.le(r,55);for(const i of Object.keys(n))this._e(i,r),this.ae(n[i],r)}pe(e,r){const n=e.values||[];this.le(r,50);for(const i of n)this.ae(i,r)}ge(e,r){this.le(r,37),$e.fromName(e).path.forEach(n=>{this.le(r,60),this.Ie(n,r)})}le(e,r){e.fe(r)}we(e){e.fe(2)}}wu.Te=new wu;function GK(t){if(t===0)return 8;let e=0;return t>>4==0&&(e+=4,t<<=4),t>>6==0&&(e+=2,t<<=2),t>>7==0&&(e+=1),e}function qT(t){const e=64-function(r){let n=0;for(let i=0;i<8;++i){const s=GK(255&r[i]);if(n+=s,s!==8)break}return n}(t);return Math.ceil(e/8)}class WK{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Ee(e){const r=e[Symbol.iterator]();let n=r.next();for(;!n.done;)this.Ae(n.value),n=r.next();this.Re()}be(e){const r=e[Symbol.iterator]();let n=r.next();for(;!n.done;)this.Pe(n.value),n=r.next();this.ve()}Ve(e){for(const r of e){const n=r.charCodeAt(0);if(n<128)this.Ae(n);else if(n<2048)this.Ae(960|n>>>6),this.Ae(128|63&n);else if(r<"\uD800"||"\uDBFF">>12),this.Ae(128|63&n>>>6),this.Ae(128|63&n);else{const i=r.codePointAt(0);this.Ae(240|i>>>18),this.Ae(128|63&i>>>12),this.Ae(128|63&i>>>6),this.Ae(128|63&i)}}this.Re()}Se(e){for(const r of e){const n=r.charCodeAt(0);if(n<128)this.Pe(n);else if(n<2048)this.Pe(960|n>>>6),this.Pe(128|63&n);else if(r<"\uD800"||"\uDBFF">>12),this.Pe(128|63&n>>>6),this.Pe(128|63&n);else{const i=r.codePointAt(0);this.Pe(240|i>>>18),this.Pe(128|63&i>>>12),this.Pe(128|63&i>>>6),this.Pe(128|63&i)}}this.ve()}De(e){const r=this.Ce(e),n=qT(r);this.xe(1+n),this.buffer[this.position++]=255&n;for(let i=r.length-n;i=this.Ge.length||!this.Je(this.Ge[s++],o))return!1}return!0}ze(e){for(const r of this.Qe)if(this.He(r,e))return!0;return!1}He(e,r){if(e===void 0||!e.field.isEqual(r.fieldPath))return!1;const n=e.op==="array-contains"||e.op==="array-contains-any";return r.kind===2===n}Je(e,r){return!!e.field.isEqual(r.fieldPath)&&(r.kind===0&&e.dir==="asc"||r.kind===1&&e.dir==="desc")}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class QK{constructor(){this.Ye=new px}addToCollectionParentIndex(e,r){return this.Ye.add(r),he.resolve()}getCollectionParents(e,r){return he.resolve(this.Ye.getEntries(r))}addFieldIndex(e,r){return he.resolve()}deleteFieldIndex(e,r){return he.resolve()}getDocumentsMatchingTarget(e,r){return he.resolve(null)}getIndexType(e,r){return he.resolve(0)}getFieldIndexes(e,r){return he.resolve([])}getNextCollectionGroupToUpdate(e){return he.resolve(null)}getMinOffset(e,r){return he.resolve(pi.min())}getMinOffsetFromCollectionGroup(e,r){return he.resolve(pi.min())}updateCollectionGroup(e,r,n){return he.resolve()}updateIndexEntries(e,r){return he.resolve()}}class px{constructor(){this.index={}}add(e){const r=e.lastSegment(),n=e.popLast(),i=this.index[r]||new Zt(Wt.comparator),s=!i.has(n);return this.index[r]=i.add(n),s}has(e){const r=e.lastSegment(),n=e.popLast(),i=this.index[r];return i&&i.has(n)}getEntries(e){return(this.index[e]||new Zt(Wt.comparator)).toArray()}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const ig=new Uint8Array(0);class ZK{constructor(e,r){this.user=e,this.databaseId=r,this.Xe=new px,this.Ze=new Qa(n=>nc(n),(n,i)=>lp(n,i)),this.uid=e.uid||""}addToCollectionParentIndex(e,r){if(!this.Xe.has(r)){const n=r.lastSegment(),i=r.popLast();e.addOnCommittedListener(()=>{this.Xe.add(r)});const s={collectionId:n,parent:Dn(i)};return VT(e).put(s)}return he.resolve()}getCollectionParents(e,r){const n=[],i=IDBKeyRange.bound([r,""],[RN(r),""],!1,!0);return VT(e).W(i).next(s=>{for(const o of s){if(o.collectionId!==r)break;n.push(Ps(o.parent))}return n})}addFieldIndex(e,r){const n=sg(e),i=function(o){return{indexId:o.indexId,collectionGroup:o.collectionGroup,fields:o.fields.map(a=>[a.fieldPath.canonicalString(),a.kind])}}(r);delete i.indexId;const s=n.add(i);if(r.indexState){const o=qf(e);return s.next(a=>{o.put($T(a,this.user,r.indexState.sequenceNumber,r.indexState.offset))})}return s.next()}deleteFieldIndex(e,r){const n=sg(e),i=qf(e),s=Uf(e);return n.delete(r.indexId).next(()=>i.delete(IDBKeyRange.bound([r.indexId],[r.indexId+1],!1,!0))).next(()=>s.delete(IDBKeyRange.bound([r.indexId],[r.indexId+1],!1,!0)))}getDocumentsMatchingTarget(e,r){const n=Uf(e);let i=!0;const s=new Map;return he.forEach(this.tn(r),o=>this.en(e,o).next(a=>{i&&(i=!!a),s.set(o,a)})).next(()=>{if(i){let o=yt();const a=[];return he.forEach(s,(u,c)=>{var l;ke("IndexedDbIndexManager",`Using index ${l=u,`id=${l.indexId}|cg=${l.collectionGroup}|f=${l.fields.map(J=>`${J.fieldPath}:${J.kind}`).join(",")}`} to execute ${nc(r)}`);const h=function(J,q){const z=g1(q);if(z===void 0)return null;for(const ee of k0(J,z.fieldPath))switch(ee.op){case"array-contains-any":return ee.value.arrayValue.values||[];case"array-contains":return[ee.value]}return null}(c,u),d=function(J,q){const z=new Map;for(const ee of gu(q))for(const G of k0(J,ee.fieldPath))switch(G.op){case"==":case"in":z.set(ee.fieldPath.canonicalString(),G.value);break;case"not-in":case"!=":return z.set(ee.fieldPath.canonicalString(),G.value),Array.from(z.values())}return null}(c,u),_=function(J,q){const z=[];let ee=!0;for(const G of gu(q)){const ne=G.kind===0?wT(J,G.fieldPath,J.startAt):ET(J,G.fieldPath,J.startAt);z.push(ne.value),ee&&(ee=ne.inclusive)}return new Bl(z,ee)}(c,u),T=function(J,q){const z=[];let ee=!0;for(const G of gu(q)){const ne=G.kind===0?ET(J,G.fieldPath,J.endAt):wT(J,G.fieldPath,J.endAt);z.push(ne.value),ee&&(ee=ne.inclusive)}return new Bl(z,ee)}(c,u),D=this.nn(u,c,_),N=this.nn(u,c,T),O=this.sn(u,c,d),L=this.rn(u.indexId,h,D,_.inclusive,N,T.inclusive,O);return he.forEach(L,J=>n.J(J,r.limit).next(q=>{q.forEach(z=>{const ee=$e.fromSegments(z.documentKey);o.has(ee)||(o=o.add(ee),a.push(ee))})}))}).next(()=>a)}return he.resolve(null)})}tn(e){let r=this.Ze.get(e);return r||(r=[e],this.Ze.set(e,r),r)}rn(e,r,n,i,s,o,a){const u=(r!=null?r.length:1)*Math.max(n.length,s.length),c=u/(r!=null?r.length:1),l=[];for(let h=0;hthis.un(e,d,N,!0));l.push(...this.createRange(_,T,D))}return l}un(e,r,n,i){const s=new Eu(e,$e.empty(),r,n);return i?s:s.Ke()}cn(e,r,n,i){const s=new Eu(e,$e.empty(),r,n);return i?s.Ke():s}en(e,r){const n=new JK(r),i=r.collectionGroup!=null?r.collectionGroup:r.path.lastSegment();return this.getFieldIndexes(e,i).next(s=>{let o=null;for(const a of s)n.We(a)&&(!o||a.fields.length>o.fields.length)&&(o=a);return o})}getIndexType(e,r){let n=2;return he.forEach(this.tn(r),i=>this.en(e,i).next(s=>{s?n!==0&&s.fields.lengthn)}an(e,r){const n=new Ff;for(const i of gu(e)){const s=r.data.field(i.fieldPath);if(s==null)return null;const o=n.qe(i.kind);wu.Te.ce(s,o)}return n.$e()}on(e){const r=new Ff;return wu.Te.ce(e,r.qe(0)),r.$e()}hn(e,r){const n=new Ff;return wu.Te.ce(Sd(this.databaseId,r),n.qe(function(i){const s=gu(i);return s.length===0?0:s[s.length-1].kind}(e))),n.$e()}sn(e,r,n){if(n===null)return[];let i=[];i.push(new Ff);let s=0;for(const o of gu(e)){const a=n[s++];for(const u of i)if(this.ln(r,o.fieldPath)&&Id(a))i=this.fn(i,o,a);else{const c=u.qe(o.kind);wu.Te.ce(a,c)}}return this.dn(i)}nn(e,r,n){return this.sn(e,r,n.position)}dn(e){const r=[];for(let n=0;nn instanceof en&&n.field.isEqual(r)&&(n.op==="in"||n.op==="not-in"))}getFieldIndexes(e,r){const n=sg(e),i=qf(e);return(r?n.W("collectionGroupIndex",IDBKeyRange.bound(r,r)):n.W()).next(s=>{const o=[];return he.forEach(s,a=>i.get([a.indexId,this.uid]).next(u=>{o.push(function(c,l){const h=l?new T0(l.sequenceNumber,new pi(ac(l.readTime),new $e(Ps(l.documentKey)),l.largestBatchId)):T0.empty(),d=c.fields.map(([_,T])=>new PH(Tr.fromServerFormat(_),T));return new NN(c.indexId,c.collectionGroup,d,h)}(a,u))})).next(()=>o)})}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next(r=>r.length===0?null:(r.sort((n,i)=>{const s=n.indexState.sequenceNumber-i.indexState.sequenceNumber;return s!==0?s:pt(n.collectionGroup,i.collectionGroup)}),r[0].collectionGroup))}updateCollectionGroup(e,r,n){const i=sg(e),s=qf(e);return this._n(e).next(o=>i.W("collectionGroupIndex",IDBKeyRange.bound(r,r)).next(a=>he.forEach(a,u=>s.put($T(u.indexId,this.user,o,n)))))}updateIndexEntries(e,r){const n=new Map;return he.forEach(r,(i,s)=>{const o=n.get(i.collectionGroup);return(o?he.resolve(o):this.getFieldIndexes(e,i.collectionGroup)).next(a=>(n.set(i.collectionGroup,a),he.forEach(a,u=>this.wn(e,i,u).next(c=>{const l=this.mn(s,u);return c.isEqual(l)?he.resolve():this.gn(e,s,u,c,l)}))))})}yn(e,r,n,i){return Uf(e).put({indexId:i.indexId,uid:this.uid,arrayValue:i.arrayValue,directionalValue:i.directionalValue,orderedDocumentKey:this.hn(n,r.key),documentKey:r.key.path.toArray()})}pn(e,r,n,i){return Uf(e).delete([i.indexId,this.uid,i.arrayValue,i.directionalValue,this.hn(n,r.key),r.key.path.toArray()])}wn(e,r,n){const i=Uf(e);let s=new Zt(uu);return i.Z({index:"documentKeyIndex",range:IDBKeyRange.only([n.indexId,this.uid,this.hn(n,r)])},(o,a)=>{s=s.add(new Eu(n.indexId,r,a.arrayValue,a.directionalValue))}).next(()=>s)}mn(e,r){let n=new Zt(uu);const i=this.an(r,e);if(i==null)return n;const s=g1(r);if(s!=null){const o=e.data.field(s.fieldPath);if(Id(o))for(const a of o.arrayValue.values||[])n=n.add(new Eu(r.indexId,e.key,this.on(a),i))}else n=n.add(new Eu(r.indexId,e.key,ig,i));return n}gn(e,r,n,i,s){ke("IndexedDbIndexManager","Updating index entries for document '%s'",r.key);const o=[];return function(a,u,c,l,h){const d=a.getIterator(),_=u.getIterator();let T=Dc(d),D=Dc(_);for(;T||D;){let N=!1,O=!1;if(T&&D){const L=c(T,D);L<0?O=!0:L>0&&(N=!0)}else T!=null?O=!0:N=!0;N?(l(D),D=Dc(_)):O?(h(T),T=Dc(d)):(T=Dc(d),D=Dc(_))}}(i,s,uu,a=>{o.push(this.yn(e,r,n,a))},a=>{o.push(this.pn(e,r,n,a))}),he.waitFor(o)}_n(e){let r=1;return qf(e).Z({index:"sequenceNumberIndex",reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},(n,i,s)=>{s.done(),r=i.sequenceNumber+1}).next(()=>r)}createRange(e,r,n){n=n.sort((o,a)=>uu(o,a)).filter((o,a,u)=>!a||uu(o,u[a-1])!==0);const i=[];i.push(e);for(const o of n){const a=uu(o,e),u=uu(o,r);if(a===0)i[0]=e.Ke();else if(a>0&&u<0)i.push(o),i.push(o.Ke());else if(u>0)break}i.push(r);const s=[];for(let o=0;othis.en(e,n).next(i=>i||ze())).next(zT)}}function VT(t){return Gr(t,"collectionParents")}function Uf(t){return Gr(t,"indexEntries")}function sg(t){return Gr(t,"indexConfiguration")}function qf(t){return Gr(t,"indexState")}function zT(t){ft(t.length!==0);let e=t[0].indexState.offset,r=e.largestBatchId;for(let n=1;n(a++,d.delete()));s.push(u.next(()=>{ft(a===1)}));const c=[];for(const l of r.mutations){const h=bO(e,l.key.path,r.batchId);s.push(i.delete(h)),c.push(l.key)}return he.waitFor(s).next(()=>c)}function O0(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 ze();e=t.noDocument}return JSON.stringify(e).length}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */jn.DEFAULT_COLLECTION_PERCENTILE=10,jn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,jn.DEFAULT=new jn(41943040,jn.DEFAULT_COLLECTION_PERCENTILE,jn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),jn.DISABLED=new jn(-1,0,0);class dv{constructor(e,r,n,i){this.userId=e,this.It=r,this.indexManager=n,this.referenceDelegate=i,this.In={}}static oe(e,r,n,i){ft(e.uid!=="");const s=e.isAuthenticated()?e.uid:"";return new dv(s,r,n,i)}checkEmpty(e){let r=!0;const n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return ea(e).Z({index:"userMutationsIndex",range:n},(i,s,o)=>{r=!1,o.done()}).next(()=>r)}addMutationBatch(e,r,n,i){const s=Kc(e),o=ea(e);return o.add({}).next(a=>{ft(typeof a=="number");const u=new fx(a,r,n,i),c=function(d,_,T){const D=T.baseMutations.map(O=>R0(d.re,O)),N=T.mutations.map(O=>R0(d.re,O));return{userId:_,batchId:T.batchId,localWriteTimeMs:T.localWriteTime.toMillis(),baseMutations:D,mutations:N}}(this.It,this.userId,u),l=[];let h=new Zt((d,_)=>pt(d.canonicalString(),_.canonicalString()));for(const d of i){const _=bO(this.userId,d.key.path,a);h=h.add(d.key.path.popLast()),l.push(o.put(c)),l.push(s.put(_,kK))}return h.forEach(d=>{l.push(this.indexManager.addToCollectionParentIndex(e,d))}),e.addOnCommittedListener(()=>{this.In[a]=u.keys()}),he.waitFor(l).next(()=>u)})}lookupMutationBatch(e,r){return ea(e).get(r).next(n=>n?(ft(n.userId===this.userId),bu(this.It,n)):null)}Tn(e,r){return this.In[r]?he.resolve(this.In[r]):this.lookupMutationBatch(e,r).next(n=>{if(n){const i=n.keys();return this.In[r]=i,i}return null})}getNextMutationBatchAfterBatchId(e,r){const n=r+1,i=IDBKeyRange.lowerBound([this.userId,n]);let s=null;return ea(e).Z({index:"userMutationsIndex",range:i},(o,a,u)=>{a.userId===this.userId&&(ft(a.batchId>=n),s=bu(this.It,a)),u.done()}).next(()=>s)}getHighestUnacknowledgedBatchId(e){const r=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let n=-1;return ea(e).Z({index:"userMutationsIndex",range:r,reverse:!0},(i,s,o)=>{n=s.batchId,o.done()}).next(()=>n)}getAllMutationBatches(e){const r=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return ea(e).W("userMutationsIndex",r).next(n=>n.map(i=>bu(this.It,i)))}getAllMutationBatchesAffectingDocumentKey(e,r){const n=Og(this.userId,r.path),i=IDBKeyRange.lowerBound(n),s=[];return Kc(e).Z({range:i},(o,a,u)=>{const[c,l,h]=o,d=Ps(l);if(c===this.userId&&r.path.isEqual(d))return ea(e).get(h).next(_=>{if(!_)throw ze();ft(_.userId===this.userId),s.push(bu(this.It,_))});u.done()}).next(()=>s)}getAllMutationBatchesAffectingDocumentKeys(e,r){let n=new Zt(pt);const i=[];return r.forEach(s=>{const o=Og(this.userId,s.path),a=IDBKeyRange.lowerBound(o),u=Kc(e).Z({range:a},(c,l,h)=>{const[d,_,T]=c,D=Ps(_);d===this.userId&&s.path.isEqual(D)?n=n.add(T):h.done()});i.push(u)}),he.waitFor(i).next(()=>this.En(e,n))}getAllMutationBatchesAffectingQuery(e,r){const n=r.path,i=n.length+1,s=Og(this.userId,n),o=IDBKeyRange.lowerBound(s);let a=new Zt(pt);return Kc(e).Z({range:o},(u,c,l)=>{const[h,d,_]=u,T=Ps(d);h===this.userId&&n.isPrefixOf(T)?T.length===i&&(a=a.add(_)):l.done()}).next(()=>this.En(e,a))}En(e,r){const n=[],i=[];return r.forEach(s=>{i.push(ea(e).get(s).next(o=>{if(o===null)throw ze();ft(o.userId===this.userId),n.push(bu(this.It,o))}))}),he.waitFor(i).next(()=>n)}removeMutationBatch(e,r){return AO(e.ie,this.userId,r).next(n=>(e.addOnCommittedListener(()=>{this.An(r.batchId)}),he.forEach(n,i=>this.referenceDelegate.markPotentiallyOrphaned(e,i))))}An(e){delete this.In[e]}performConsistencyCheck(e){return this.checkEmpty(e).next(r=>{if(!r)return he.resolve();const n=IDBKeyRange.lowerBound([this.userId]),i=[];return Kc(e).Z({range:n},(s,o,a)=>{if(s[0]===this.userId){const u=Ps(s[1]);i.push(u)}else a.done()}).next(()=>{ft(i.length===0)})})}containsKey(e,r){return kO(e,this.userId,r)}Rn(e){return MO(e).get(this.userId).next(r=>r||{userId:this.userId,lastAcknowledgedBatchId:-1,lastStreamToken:""})}}function kO(t,e,r){const n=Og(e,r.path),i=n[1],s=IDBKeyRange.lowerBound(n);let o=!1;return Kc(t).Z({range:s,X:!0},(a,u,c)=>{const[l,h,d]=a;l===e&&h===i&&(o=!0),c.done()}).next(()=>o)}function ea(t){return Gr(t,"mutations")}function Kc(t){return Gr(t,"documentMutations")}function MO(t){return Gr(t,"mutationQueues")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class uc{constructor(e){this.bn=e}next(){return this.bn+=2,this.bn}static Pn(){return new uc(0)}static vn(){return new uc(-1)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class eG{constructor(e,r){this.referenceDelegate=e,this.It=r}allocateTargetId(e){return this.Vn(e).next(r=>{const n=new uc(r.highestTargetId);return r.highestTargetId=n.next(),this.Sn(e,r).next(()=>r.highestTargetId)})}getLastRemoteSnapshotVersion(e){return this.Vn(e).next(r=>at.fromTimestamp(new dr(r.lastRemoteSnapshotVersion.seconds,r.lastRemoteSnapshotVersion.nanoseconds)))}getHighestSequenceNumber(e){return this.Vn(e).next(r=>r.highestListenSequenceNumber)}setTargetsMetadata(e,r,n){return this.Vn(e).next(i=>(i.highestListenSequenceNumber=r,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),r>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=r),this.Sn(e,i)))}addTargetData(e,r){return this.Dn(e,r).next(()=>this.Vn(e).next(n=>(n.targetCount+=1,this.Cn(r,n),this.Sn(e,n))))}updateTargetData(e,r){return this.Dn(e,r)}removeTargetData(e,r){return this.removeMatchingKeysForTargetId(e,r.targetId).next(()=>Lc(e).delete(r.targetId)).next(()=>this.Vn(e)).next(n=>(ft(n.targetCount>0),n.targetCount-=1,this.Sn(e,n)))}removeTargets(e,r,n){let i=0;const s=[];return Lc(e).Z((o,a)=>{const u=gh(a);u.sequenceNumber<=r&&n.get(u.targetId)===null&&(i++,s.push(this.removeTargetData(e,u)))}).next(()=>he.waitFor(s)).next(()=>i)}forEachTarget(e,r){return Lc(e).Z((n,i)=>{const s=gh(i);r(s)})}Vn(e){return KT(e).get("targetGlobalKey").next(r=>(ft(r!==null),r))}Sn(e,r){return KT(e).put("targetGlobalKey",r)}Dn(e,r){return Lc(e).put(IO(this.It,r))}Cn(e,r){let n=!1;return e.targetId>r.highestTargetId&&(r.highestTargetId=e.targetId,n=!0),e.sequenceNumber>r.highestListenSequenceNumber&&(r.highestListenSequenceNumber=e.sequenceNumber,n=!0),n}getTargetCount(e){return this.Vn(e).next(r=>r.targetCount)}getTargetData(e,r){const n=nc(r),i=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]);let s=null;return Lc(e).Z({range:i,index:"queryTargetsIndex"},(o,a,u)=>{const c=gh(a);lp(r,c.target)&&(s=c,u.done())}).next(()=>s)}addMatchingKeys(e,r,n){const i=[],s=ma(e);return r.forEach(o=>{const a=Dn(o.path);i.push(s.put({targetId:n,path:a})),i.push(this.referenceDelegate.addReference(e,n,o))}),he.waitFor(i)}removeMatchingKeys(e,r,n){const i=ma(e);return he.forEach(r,s=>{const o=Dn(s.path);return he.waitFor([i.delete([n,o]),this.referenceDelegate.removeReference(e,n,s)])})}removeMatchingKeysForTargetId(e,r){const n=ma(e),i=IDBKeyRange.bound([r],[r+1],!1,!0);return n.delete(i)}getMatchingKeysForTargetId(e,r){const n=IDBKeyRange.bound([r],[r+1],!1,!0),i=ma(e);let s=yt();return i.Z({range:n,X:!0},(o,a,u)=>{const c=Ps(o[1]),l=new $e(c);s=s.add(l)}).next(()=>s)}containsKey(e,r){const n=Dn(r.path),i=IDBKeyRange.bound([n],[RN(n)],!1,!0);let s=0;return ma(e).Z({index:"documentTargetsIndex",X:!0,range:i},([o,a],u,c)=>{o!==0&&(s++,c.done())}).next(()=>s>0)}se(e,r){return Lc(e).get(r).next(n=>n?gh(n):null)}}function Lc(t){return Gr(t,"targets")}function KT(t){return Gr(t,"targetGlobal")}function ma(t){return Gr(t,"targetDocuments")}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function GT([t,e],[r,n]){const i=pt(t,r);return i===0?pt(e,n):i}class tG{constructor(e){this.xn=e,this.buffer=new Zt(GT),this.Nn=0}kn(){return++this.Nn}On(e){const r=[e,this.kn()];if(this.buffer.size{this.Mn=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(r){Ja(r)?ke("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",r):await Ya(r)}await this.Fn(3e5)})}}class nG{constructor(e,r){this.$n=e,this.params=r}calculateTargetCount(e,r){return this.$n.Bn(e).next(n=>Math.floor(r/100*n))}nthSequenceNumber(e,r){if(r===0)return he.resolve(Hn.at);const n=new tG(r);return this.$n.forEachTarget(e,i=>n.On(i.sequenceNumber)).next(()=>this.$n.Ln(e,i=>n.On(i))).next(()=>n.maxValue)}removeTargets(e,r,n){return this.$n.removeTargets(e,r,n)}removeOrphanedDocuments(e,r){return this.$n.removeOrphanedDocuments(e,r)}collect(e,r){return this.params.cacheSizeCollectionThreshold===-1?(ke("LruGarbageCollector","Garbage collection skipped; disabled"),he.resolve(HT)):this.getCacheSize(e).next(n=>n(h>this.params.maximumSequenceNumbersToCollect?(ke("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${h}`),i=this.params.maximumSequenceNumbersToCollect):i=h,o=Date.now(),this.nthSequenceNumber(e,i))).next(h=>(n=h,a=Date.now(),this.removeTargets(e,n,r))).next(h=>(s=h,u=Date.now(),this.removeOrphanedDocuments(e,n))).next(h=>(c=Date.now(),p1()<=Mt.DEBUG&&ke("LruGarbageCollector",`LRU Garbage Collection Counted targets in ${o-l}ms Determined least recently used ${i} in `+(a-o)+`ms Removed ${s} targets in `+(u-a)+`ms Removed ${h} documents in `+(c-u)+`ms Total Duration: ${c-l}ms`),he.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:s,documentsRemoved:h})))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class iG{constructor(e,r){this.db=e,this.garbageCollector=function(n,i){return new nG(n,i)}(this,r)}Bn(e){const r=this.qn(e);return this.db.getTargetCache().getTargetCount(e).next(n=>r.next(i=>n+i))}qn(e){let r=0;return this.Ln(e,n=>{r++}).next(()=>r)}forEachTarget(e,r){return this.db.getTargetCache().forEachTarget(e,r)}Ln(e,r){return this.Kn(e,(n,i)=>r(i))}addReference(e,r,n){return og(e,n)}removeReference(e,r,n){return og(e,n)}removeTargets(e,r,n){return this.db.getTargetCache().removeTargets(e,r,n)}markPotentiallyOrphaned(e,r){return og(e,r)}Gn(e,r){return function(n,i){let s=!1;return MO(n).tt(o=>kO(n,o,i).next(a=>(a&&(s=!0),he.resolve(!a)))).next(()=>s)}(e,r)}removeOrphanedDocuments(e,r){const n=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[];let s=0;return this.Kn(e,(o,a)=>{if(a<=r){const u=this.Gn(e,o).next(c=>{if(!c)return s++,n.getEntry(e,o).next(()=>(n.removeEntry(o,at.min()),ma(e).delete([0,Dn(o.path)])))});i.push(u)}}).next(()=>he.waitFor(i)).next(()=>n.apply(e)).next(()=>s)}removeTarget(e,r){const n=r.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,n)}updateLimboDocument(e,r){return og(e,r)}Kn(e,r){const n=ma(e);let i,s=Hn.at;return n.Z({index:"documentTargetsIndex"},([o,a],{path:u,sequenceNumber:c})=>{o===0?(s!==Hn.at&&r(new $e(Ps(i)),s),s=c,i=u):s=Hn.at}).next(()=>{s!==Hn.at&&r(new $e(Ps(i)),s)})}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function og(t,e){return ma(t).put(function(r,n){return{targetId:0,path:Dn(r.path),sequenceNumber:n}}(e,t.currentSequenceNumber))}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class CO{constructor(){this.changes=new Qa(e=>e.toString(),(e,r)=>e.isEqual(r)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,r){this.assertNotApplied(),this.changes.set(e,fr.newInvalidDocument(e).setReadTime(r))}getEntry(e,r){this.assertNotApplied();const n=this.changes.get(r);return n!==void 0?he.resolve(n):this.getFromCache(e,r)}getEntries(e,r){return this.getAllFromCache(e,r)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class sG{constructor(e){this.It=e}setIndexManager(e){this.indexManager=e}addEntry(e,r,n){return cu(e).put(n)}removeEntry(e,r,n){return cu(e).delete(function(i,s){const o=i.path.toArray();return[o.slice(0,o.length-2),o[o.length-2],N0(s),o[o.length-1]]}(r,n))}updateMetadata(e,r){return this.getMetadata(e).next(n=>(n.byteSize+=r,this.Qn(e,n)))}getEntry(e,r){let n=fr.newInvalidDocument(r);return cu(e).Z({index:"documentKeyIndex",range:IDBKeyRange.only(jf(r))},(i,s)=>{n=this.jn(r,s)}).next(()=>n)}Wn(e,r){let n={size:0,document:fr.newInvalidDocument(r)};return cu(e).Z({index:"documentKeyIndex",range:IDBKeyRange.only(jf(r))},(i,s)=>{n={document:this.jn(r,s),size:O0(s)}}).next(()=>n)}getEntries(e,r){let n=ni();return this.zn(e,r,(i,s)=>{const o=this.jn(i,s);n=n.insert(i,o)}).next(()=>n)}Hn(e,r){let n=ni(),i=new vr($e.comparator);return this.zn(e,r,(s,o)=>{const a=this.jn(s,o);n=n.insert(s,a),i=i.insert(s,O0(o))}).next(()=>({documents:n,Jn:i}))}zn(e,r,n){if(r.isEmpty())return he.resolve();let i=new Zt(YT);r.forEach(u=>i=i.add(u));const s=IDBKeyRange.bound(jf(i.first()),jf(i.last())),o=i.getIterator();let a=o.getNext();return cu(e).Z({index:"documentKeyIndex",range:s},(u,c,l)=>{const h=$e.fromSegments([...c.prefixPath,c.collectionGroup,c.documentId]);for(;a&&YT(a,h)<0;)n(a,null),a=o.getNext();a&&a.isEqual(h)&&(n(a,c),a=o.hasNext()?o.getNext():null),a?l.j(jf(a)):l.done()}).next(()=>{for(;a;)n(a,null),a=o.hasNext()?o.getNext():null})}getAllFromCollection(e,r,n){const i=[r.popLast().toArray(),r.lastSegment(),N0(n.readTime),n.documentKey.path.isEmpty()?"":n.documentKey.path.lastSegment()],s=[r.popLast().toArray(),r.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return cu(e).W(IDBKeyRange.bound(i,s,!0)).next(o=>{let a=ni();for(const u of o){const c=this.jn($e.fromSegments(u.prefixPath.concat(u.collectionGroup,u.documentId)),u);a=a.insert(c.key,c)}return a})}getAllFromCollectionGroup(e,r,n,i){let s=ni();const o=XT(r,n),a=XT(r,pi.max());return cu(e).Z({index:"collectionGroupIndex",range:IDBKeyRange.bound(o,a,!0)},(u,c,l)=>{const h=this.jn($e.fromSegments(c.prefixPath.concat(c.collectionGroup,c.documentId)),c);s=s.insert(h.key,h),s.size===i&&l.done()}).next(()=>s)}newChangeBuffer(e){return new oG(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next(r=>r.byteSize)}getMetadata(e){return WT(e).get("remoteDocumentGlobalKey").next(r=>(ft(!!r),r))}Qn(e,r){return WT(e).put("remoteDocumentGlobalKey",r)}jn(e,r){if(r){const n=HK(this.It,r);if(!(n.isNoDocument()&&n.version.isEqual(at.min())))return n}return fr.newInvalidDocument(e)}}function RO(t){return new sG(t)}class oG extends CO{constructor(e,r){super(),this.Yn=e,this.trackRemovals=r,this.Xn=new Qa(n=>n.toString(),(n,i)=>n.isEqual(i))}applyChanges(e){const r=[];let n=0,i=new Zt((s,o)=>pt(s.canonicalString(),o.canonicalString()));return this.changes.forEach((s,o)=>{const a=this.Xn.get(s);if(r.push(this.Yn.removeEntry(e,s,a.readTime)),o.isValidDocument()){const u=LT(this.Yn.It,o);i=i.add(s.path.popLast()),n+=O0(u)-a.size,r.push(this.Yn.addEntry(e,s,u))}else if(n-=a.size,this.trackRemovals){const u=LT(this.Yn.It,o.convertToNoDocument(at.min()));r.push(this.Yn.addEntry(e,s,u))}}),i.forEach(s=>{r.push(this.Yn.indexManager.addToCollectionParentIndex(e,s))}),r.push(this.Yn.updateMetadata(e,n)),he.waitFor(r)}getFromCache(e,r){return this.Yn.Wn(e,r).next(n=>(this.Xn.set(r,{size:n.size,readTime:n.document.readTime}),n.document))}getAllFromCache(e,r){return this.Yn.Hn(e,r).next(({documents:n,Jn:i})=>(i.forEach((s,o)=>{this.Xn.set(s,{size:o,readTime:n.get(s).readTime})}),n))}}function WT(t){return Gr(t,"remoteDocumentGlobal")}function cu(t){return Gr(t,"remoteDocumentsV14")}function jf(t){const e=t.path.toArray();return[e.slice(0,e.length-2),e[e.length-2],e[e.length-1]]}function XT(t,e){const r=e.documentKey.path.toArray();return[t,N0(e.readTime),r.slice(0,r.length-2),r.length>0?r[r.length-1]:""]}function YT(t,e){const r=t.path.toArray(),n=e.path.toArray();let i=0;for(let s=0;s(n=i,this.getBaseDocument(e,r,n))).next(i=>(n!==null&&Oh(n.mutation,i,ci.empty(),dr.now()),i))}getDocuments(e,r){return this.remoteDocumentCache.getEntries(e,r).next(n=>this.getLocalViewOfDocuments(e,n,yt()).next(()=>n))}getLocalViewOfDocuments(e,r,n=yt()){const i=Ds();return this.populateOverlays(e,i,r).next(()=>this.computeViews(e,r,i,n).next(s=>{let o=ph();return s.forEach((a,u)=>{o=o.insert(a,u.overlayedDocument)}),o}))}getOverlayedDocuments(e,r){const n=Ds();return this.populateOverlays(e,n,r).next(()=>this.computeViews(e,r,n,yt()))}populateOverlays(e,r,n){const i=[];return n.forEach(s=>{r.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(e,i).next(s=>{s.forEach((o,a)=>{r.set(o,a)})})}computeViews(e,r,n,i){let s=ni();const o=Dh(),a=Dh();return r.forEach((u,c)=>{const l=n.get(c.key);i.has(c.key)&&(l===void 0||l.mutation instanceof Go)?s=s.insert(c.key,c):l!==void 0&&(o.set(c.key,l.mutation.getFieldMask()),Oh(l.mutation,c,l.mutation.getFieldMask(),dr.now()))}),this.recalculateAndSaveOverlays(e,s).next(u=>(u.forEach((c,l)=>o.set(c,l)),r.forEach((c,l)=>{var h;return a.set(c,new aG(l,(h=o.get(c))!==null&&h!==void 0?h:null))}),a))}recalculateAndSaveOverlays(e,r){const n=Dh();let i=new vr((o,a)=>o-a),s=yt();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,r).next(o=>{for(const a of o)a.keys().forEach(u=>{const c=r.get(u);if(c===null)return;let l=n.get(u)||ci.empty();l=a.applyToLocalView(c,l),n.set(u,l);const h=(i.get(a.batchId)||yt()).add(u);i=i.insert(a.batchId,h)})}).next(()=>{const o=[],a=i.getReverseIterator();for(;a.hasNext();){const u=a.getNext(),c=u.key,l=u.value,h=uO();l.forEach(d=>{if(!s.has(d)){const _=rO(r.get(d),n.get(d));_!==null&&h.set(d,_),s=s.add(d)}}),o.push(this.documentOverlayCache.saveOverlays(e,c,h))}return he.waitFor(o)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,r){return this.remoteDocumentCache.getEntries(e,r).next(n=>this.recalculateAndSaveOverlays(e,n))}getDocumentsMatchingQuery(e,r,n){return function(i){return $e.isDocumentKey(i.path)&&i.collectionGroup===null&&i.filters.length===0}(r)?this.getDocumentsMatchingDocumentQuery(e,r.path):HN(r)?this.getDocumentsMatchingCollectionGroupQuery(e,r,n):this.getDocumentsMatchingCollectionQuery(e,r,n)}getNextDocuments(e,r,n,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,r,n,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,r,n.largestBatchId,i-s.size):he.resolve(Ds());let a=-1,u=s;return o.next(c=>he.forEach(c,(l,h)=>(a{u=u.insert(l,d)}))).next(()=>this.populateOverlays(e,c,s)).next(()=>this.computeViews(e,u,c,yt())).next(l=>({batchId:a,changes:aO(l)})))})}getDocumentsMatchingDocumentQuery(e,r){return this.getDocument(e,new $e(r)).next(n=>{let i=ph();return n.isFoundDocument()&&(i=i.insert(n.key,n)),i})}getDocumentsMatchingCollectionGroupQuery(e,r,n){const i=r.collectionGroup;let s=ph();return this.indexManager.getCollectionParents(e,i).next(o=>he.forEach(o,a=>{const u=function(c,l){return new df(l,null,c.explicitOrderBy.slice(),c.filters.slice(),c.limit,c.limitType,c.startAt,c.endAt)}(r,a.child(i));return this.getDocumentsMatchingCollectionQuery(e,u,n).next(c=>{c.forEach((l,h)=>{s=s.insert(l,h)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,r,n){let i;return this.remoteDocumentCache.getAllFromCollection(e,r.path,n).next(s=>(i=s,this.documentOverlayCache.getOverlaysForCollection(e,r.path,n.largestBatchId))).next(s=>{s.forEach((a,u)=>{const c=u.getKey();i.get(c)===null&&(i=i.insert(c,fr.newInvalidDocument(c)))});let o=ph();return i.forEach((a,u)=>{const c=s.get(a);c!==void 0&&Oh(c.mutation,u,ci.empty(),dr.now()),cx(r,u)&&(o=o.insert(a,u))}),o})}getBaseDocument(e,r,n){return n===null||n.mutation.type===1?this.remoteDocumentCache.getEntry(e,r):he.resolve(fr.newInvalidDocument(r))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class uG{constructor(e){this.It=e,this.Zn=new Map,this.ts=new Map}getBundleMetadata(e,r){return he.resolve(this.Zn.get(r))}saveBundleMetadata(e,r){var n;return this.Zn.set(r.id,{id:(n=r).id,version:n.version,createTime:li(n.createTime)}),he.resolve()}getNamedQuery(e,r){return he.resolve(this.ts.get(r))}saveNamedQuery(e,r){return this.ts.set(r.name,function(n){return{name:n.name,query:TO(n.bundledQuery),readTime:li(n.readTime)}}(r)),he.resolve()}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class cG{constructor(){this.overlays=new vr($e.comparator),this.es=new Map}getOverlay(e,r){return he.resolve(this.overlays.get(r))}getOverlays(e,r){const n=Ds();return he.forEach(r,i=>this.getOverlay(e,i).next(s=>{s!==null&&n.set(i,s)})).next(()=>n)}saveOverlays(e,r,n){return n.forEach((i,s)=>{this.ue(e,r,s)}),he.resolve()}removeOverlaysForBatchId(e,r,n){const i=this.es.get(n);return i!==void 0&&(i.forEach(s=>this.overlays=this.overlays.remove(s)),this.es.delete(n)),he.resolve()}getOverlaysForCollection(e,r,n){const i=Ds(),s=r.length+1,o=new $e(r.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const u=a.getNext().value,c=u.getKey();if(!r.isPrefixOf(c.path))break;c.path.length===s&&u.largestBatchId>n&&i.set(u.getKey(),u)}return he.resolve(i)}getOverlaysForCollectionGroup(e,r,n,i){let s=new vr((c,l)=>c-l);const o=this.overlays.getIterator();for(;o.hasNext();){const c=o.getNext().value;if(c.getKey().getCollectionGroup()===r&&c.largestBatchId>n){let l=s.get(c.largestBatchId);l===null&&(l=Ds(),s=s.insert(c.largestBatchId,l)),l.set(c.getKey(),c)}}const a=Ds(),u=s.getIterator();for(;u.hasNext()&&(u.getNext().value.forEach((c,l)=>a.set(c,l)),!(a.size()>=i)););return he.resolve(a)}ue(e,r,n){const i=this.overlays.get(n.key);if(i!==null){const o=this.es.get(i.largestBatchId).delete(n.key);this.es.set(i.largestBatchId,o)}this.overlays=this.overlays.insert(n.key,new dx(r,n));let s=this.es.get(r);s===void 0&&(s=yt(),this.es.set(r,s)),this.es.set(r,s.add(n.key))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class gx{constructor(){this.ns=new Zt(Fr.ss),this.rs=new Zt(Fr.os)}isEmpty(){return this.ns.isEmpty()}addReference(e,r){const n=new Fr(e,r);this.ns=this.ns.add(n),this.rs=this.rs.add(n)}us(e,r){e.forEach(n=>this.addReference(n,r))}removeReference(e,r){this.cs(new Fr(e,r))}hs(e,r){e.forEach(n=>this.removeReference(n,r))}ls(e){const r=new $e(new Wt([])),n=new Fr(r,e),i=new Fr(r,e+1),s=[];return this.rs.forEachInRange([n,i],o=>{this.cs(o),s.push(o.key)}),s}fs(){this.ns.forEach(e=>this.cs(e))}cs(e){this.ns=this.ns.delete(e),this.rs=this.rs.delete(e)}ds(e){const r=new $e(new Wt([])),n=new Fr(r,e),i=new Fr(r,e+1);let s=yt();return this.rs.forEachInRange([n,i],o=>{s=s.add(o.key)}),s}containsKey(e){const r=new Fr(e,0),n=this.ns.firstAfterOrEqual(r);return n!==null&&e.isEqual(n.key)}}class Fr{constructor(e,r){this.key=e,this._s=r}static ss(e,r){return $e.comparator(e.key,r.key)||pt(e._s,r._s)}static os(e,r){return pt(e._s,r._s)||$e.comparator(e.key,r.key)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class lG{constructor(e,r){this.indexManager=e,this.referenceDelegate=r,this.mutationQueue=[],this.ws=1,this.gs=new Zt(Fr.ss)}checkEmpty(e){return he.resolve(this.mutationQueue.length===0)}addMutationBatch(e,r,n,i){const s=this.ws;this.ws++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new fx(s,r,n,i);this.mutationQueue.push(o);for(const a of i)this.gs=this.gs.add(new Fr(a.key,s)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return he.resolve(o)}lookupMutationBatch(e,r){return he.resolve(this.ys(r))}getNextMutationBatchAfterBatchId(e,r){const n=r+1,i=this.ps(n),s=i<0?0:i;return he.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return he.resolve(this.mutationQueue.length===0?-1:this.ws-1)}getAllMutationBatches(e){return he.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,r){const n=new Fr(r,0),i=new Fr(r,Number.POSITIVE_INFINITY),s=[];return this.gs.forEachInRange([n,i],o=>{const a=this.ys(o._s);s.push(a)}),he.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,r){let n=new Zt(pt);return r.forEach(i=>{const s=new Fr(i,0),o=new Fr(i,Number.POSITIVE_INFINITY);this.gs.forEachInRange([s,o],a=>{n=n.add(a._s)})}),he.resolve(this.Is(n))}getAllMutationBatchesAffectingQuery(e,r){const n=r.path,i=n.length+1;let s=n;$e.isDocumentKey(s)||(s=s.child(""));const o=new Fr(new $e(s),0);let a=new Zt(pt);return this.gs.forEachWhile(u=>{const c=u.key.path;return!!n.isPrefixOf(c)&&(c.length===i&&(a=a.add(u._s)),!0)},o),he.resolve(this.Is(a))}Is(e){const r=[];return e.forEach(n=>{const i=this.ys(n);i!==null&&r.push(i)}),r}removeMutationBatch(e,r){ft(this.Ts(r.batchId,"removed")===0),this.mutationQueue.shift();let n=this.gs;return he.forEach(r.mutations,i=>{const s=new Fr(i.key,r.batchId);return n=n.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.gs=n})}An(e){}containsKey(e,r){const n=new Fr(r,0),i=this.gs.firstAfterOrEqual(n);return he.resolve(r.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,he.resolve()}Ts(e,r){return this.ps(e)}ps(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}ys(e){const r=this.ps(e);return r<0||r>=this.mutationQueue.length?null:this.mutationQueue[r]}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class fG{constructor(e){this.Es=e,this.docs=new vr($e.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,r){const n=r.key,i=this.docs.get(n),s=i?i.size:0,o=this.Es(r);return this.docs=this.docs.insert(n,{document:r.mutableCopy(),size:o}),this.size+=o-s,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const r=this.docs.get(e);r&&(this.docs=this.docs.remove(e),this.size-=r.size)}getEntry(e,r){const n=this.docs.get(r);return he.resolve(n?n.document.mutableCopy():fr.newInvalidDocument(r))}getEntries(e,r){let n=ni();return r.forEach(i=>{const s=this.docs.get(i);n=n.insert(i,s?s.document.mutableCopy():fr.newInvalidDocument(i))}),he.resolve(n)}getAllFromCollection(e,r,n){let i=ni();const s=new $e(r.child("")),o=this.docs.getIteratorFrom(s);for(;o.hasNext();){const{key:a,value:{document:u}}=o.getNext();if(!r.isPrefixOf(a.path))break;a.path.length>r.length+1||sx(DN(u),n)<=0||(i=i.insert(u.key,u.mutableCopy()))}return he.resolve(i)}getAllFromCollectionGroup(e,r,n,i){ze()}As(e,r){return he.forEach(this.docs,n=>r(n))}newChangeBuffer(e){return new hG(this)}getSize(e){return he.resolve(this.size)}}class hG extends CO{constructor(e){super(),this.Yn=e}applyChanges(e){const r=[];return this.changes.forEach((n,i)=>{i.isValidDocument()?r.push(this.Yn.addEntry(e,i)):this.Yn.removeEntry(n)}),he.waitFor(r)}getFromCache(e,r){return this.Yn.getEntry(e,r)}getAllFromCache(e,r){return this.Yn.getEntries(e,r)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class dG{constructor(e){this.persistence=e,this.Rs=new Qa(r=>nc(r),lp),this.lastRemoteSnapshotVersion=at.min(),this.highestTargetId=0,this.bs=0,this.Ps=new gx,this.targetCount=0,this.vs=uc.Pn()}forEachTarget(e,r){return this.Rs.forEach((n,i)=>r(i)),he.resolve()}getLastRemoteSnapshotVersion(e){return he.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return he.resolve(this.bs)}allocateTargetId(e){return this.highestTargetId=this.vs.next(),he.resolve(this.highestTargetId)}setTargetsMetadata(e,r,n){return n&&(this.lastRemoteSnapshotVersion=n),r>this.bs&&(this.bs=r),he.resolve()}Dn(e){this.Rs.set(e.target,e);const r=e.targetId;r>this.highestTargetId&&(this.vs=new uc(r),this.highestTargetId=r),e.sequenceNumber>this.bs&&(this.bs=e.sequenceNumber)}addTargetData(e,r){return this.Dn(r),this.targetCount+=1,he.resolve()}updateTargetData(e,r){return this.Dn(r),he.resolve()}removeTargetData(e,r){return this.Rs.delete(r.target),this.Ps.ls(r.targetId),this.targetCount-=1,he.resolve()}removeTargets(e,r,n){let i=0;const s=[];return this.Rs.forEach((o,a)=>{a.sequenceNumber<=r&&n.get(a.targetId)===null&&(this.Rs.delete(o),s.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),he.waitFor(s).next(()=>i)}getTargetCount(e){return he.resolve(this.targetCount)}getTargetData(e,r){const n=this.Rs.get(r)||null;return he.resolve(n)}addMatchingKeys(e,r,n){return this.Ps.us(r,n),he.resolve()}removeMatchingKeys(e,r,n){this.Ps.hs(r,n);const i=this.persistence.referenceDelegate,s=[];return i&&r.forEach(o=>{s.push(i.markPotentiallyOrphaned(e,o))}),he.waitFor(s)}removeMatchingKeysForTargetId(e,r){return this.Ps.ls(r),he.resolve()}getMatchingKeysForTargetId(e,r){const n=this.Ps.ds(r);return he.resolve(n)}containsKey(e,r){return he.resolve(this.Ps.containsKey(r))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class OO{constructor(e,r){this.Vs={},this.overlays={},this.Ss=new Hn(0),this.Ds=!1,this.Ds=!0,this.referenceDelegate=e(this),this.Cs=new dG(this),this.indexManager=new QK,this.remoteDocumentCache=function(n){return new fG(n)}(n=>this.referenceDelegate.xs(n)),this.It=new SO(r),this.Ns=new uG(this.It)}start(){return Promise.resolve()}shutdown(){return this.Ds=!1,Promise.resolve()}get started(){return this.Ds}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let r=this.overlays[e.toKey()];return r||(r=new cG,this.overlays[e.toKey()]=r),r}getMutationQueue(e,r){let n=this.Vs[e.toKey()];return n||(n=new lG(r,this.referenceDelegate),this.Vs[e.toKey()]=n),n}getTargetCache(){return this.Cs}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ns}runTransaction(e,r,n){ke("MemoryPersistence","Starting transaction:",e);const i=new pG(this.Ss.next());return this.referenceDelegate.ks(),n(i).next(s=>this.referenceDelegate.Os(i).next(()=>s)).toPromise().then(s=>(i.raiseOnCommittedEvent(),s))}Ms(e,r){return he.or(Object.values(this.Vs).map(n=>()=>n.containsKey(e,r)))}}class pG extends LN{constructor(e){super(),this.currentSequenceNumber=e}}class pv{constructor(e){this.persistence=e,this.Fs=new gx,this.$s=null}static Bs(e){return new pv(e)}get Ls(){if(this.$s)return this.$s;throw ze()}addReference(e,r,n){return this.Fs.addReference(n,r),this.Ls.delete(n.toString()),he.resolve()}removeReference(e,r,n){return this.Fs.removeReference(n,r),this.Ls.add(n.toString()),he.resolve()}markPotentiallyOrphaned(e,r){return this.Ls.add(r.toString()),he.resolve()}removeTarget(e,r){this.Fs.ls(r.targetId).forEach(i=>this.Ls.add(i.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,r.targetId).next(i=>{i.forEach(s=>this.Ls.add(s.toString()))}).next(()=>n.removeTargetData(e,r))}ks(){this.$s=new Set}Os(e){const r=this.persistence.getRemoteDocumentCache().newChangeBuffer();return he.forEach(this.Ls,n=>{const i=$e.fromPath(n);return this.Us(e,i).next(s=>{s||r.removeEntry(i,at.min())})}).next(()=>(this.$s=null,r.apply(e)))}updateLimboDocument(e,r){return this.Us(e,r).next(n=>{n?this.Ls.delete(r.toString()):this.Ls.add(r.toString())})}xs(e){return 0}Us(e,r){return he.or([()=>he.resolve(this.Fs.containsKey(r)),()=>this.persistence.getTargetCache().containsKey(e,r),()=>this.persistence.Ms(e,r)])}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class gG{constructor(e){this.It=e}$(e,r,n,i){const s=new iv("createOrUpgrade",r);n<1&&i>=1&&(function(a){a.createObjectStore("owner")}(e),function(a){a.createObjectStore("mutationQueues",{keyPath:"userId"}),a.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",PT,{unique:!0}),a.createObjectStore("documentMutations")}(e),JT(e),function(a){a.createObjectStore("remoteDocuments")}(e));let o=he.resolve();return n<3&&i>=3&&(n!==0&&(function(a){a.deleteObjectStore("targetDocuments"),a.deleteObjectStore("targets"),a.deleteObjectStore("targetGlobal")}(e),JT(e)),o=o.next(()=>function(a){const u=a.store("targetGlobal"),c={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:at.min().toTimestamp(),targetCount:0};return u.put("targetGlobalKey",c)}(s))),n<4&&i>=4&&(n!==0&&(o=o.next(()=>function(a,u){return u.store("mutations").W().next(c=>{a.deleteObjectStore("mutations"),a.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",PT,{unique:!0});const l=u.store("mutations"),h=c.map(d=>l.put(d));return he.waitFor(h)})}(e,s))),o=o.next(()=>{(function(a){a.createObjectStore("clientMetadata",{keyPath:"clientId"})})(e)})),n<5&&i>=5&&(o=o.next(()=>this.qs(s))),n<6&&i>=6&&(o=o.next(()=>(function(a){a.createObjectStore("remoteDocumentGlobal")}(e),this.Ks(s)))),n<7&&i>=7&&(o=o.next(()=>this.Gs(s))),n<8&&i>=8&&(o=o.next(()=>this.Qs(e,s))),n<9&&i>=9&&(o=o.next(()=>{(function(a){a.objectStoreNames.contains("remoteDocumentChanges")&&a.deleteObjectStore("remoteDocumentChanges")})(e)})),n<10&&i>=10&&(o=o.next(()=>this.js(s))),n<11&&i>=11&&(o=o.next(()=>{(function(a){a.createObjectStore("bundles",{keyPath:"bundleId"})})(e),function(a){a.createObjectStore("namedQueries",{keyPath:"name"})}(e)})),n<12&&i>=12&&(o=o.next(()=>{(function(a){const u=a.createObjectStore("documentOverlays",{keyPath:UK});u.createIndex("collectionPathOverlayIndex",qK,{unique:!1}),u.createIndex("collectionGroupOverlayIndex",jK,{unique:!1})})(e)})),n<13&&i>=13&&(o=o.next(()=>function(a){const u=a.createObjectStore("remoteDocumentsV14",{keyPath:MK});u.createIndex("documentKeyIndex",CK),u.createIndex("collectionGroupIndex",RK)}(e)).next(()=>this.Ws(e,s)).next(()=>e.deleteObjectStore("remoteDocuments"))),n<14&&i>=14&&(o=o.next(()=>this.zs(e,s))),n<15&&i>=15&&(o=o.next(()=>function(a){a.createObjectStore("indexConfiguration",{keyPath:"indexId",autoIncrement:!0}).createIndex("collectionGroupIndex","collectionGroup",{unique:!1}),a.createObjectStore("indexState",{keyPath:LK}).createIndex("sequenceNumberIndex",BK,{unique:!1}),a.createObjectStore("indexEntries",{keyPath:$K}).createIndex("documentKeyIndex",FK,{unique:!1})}(e))),o}Ks(e){let r=0;return e.store("remoteDocuments").Z((n,i)=>{r+=O0(i)}).next(()=>{const n={byteSize:r};return e.store("remoteDocumentGlobal").put("remoteDocumentGlobalKey",n)})}qs(e){const r=e.store("mutationQueues"),n=e.store("mutations");return r.W().next(i=>he.forEach(i,s=>{const o=IDBKeyRange.bound([s.userId,-1],[s.userId,s.lastAcknowledgedBatchId]);return n.W("userMutationsIndex",o).next(a=>he.forEach(a,u=>{ft(u.userId===s.userId);const c=bu(this.It,u);return AO(e,s.userId,c).next(()=>{})}))}))}Gs(e){const r=e.store("targetDocuments"),n=e.store("remoteDocuments");return e.store("targetGlobal").get("targetGlobalKey").next(i=>{const s=[];return n.Z((o,a)=>{const u=new Wt(o),c=function(l){return[0,Dn(l)]}(u);s.push(r.get(c).next(l=>l?he.resolve():(h=>r.put({targetId:0,path:Dn(h),sequenceNumber:i.highestListenSequenceNumber}))(u)))}).next(()=>he.waitFor(s))})}Qs(e,r){e.createObjectStore("collectionParents",{keyPath:PK});const n=r.store("collectionParents"),i=new px,s=o=>{if(i.add(o)){const a=o.lastSegment(),u=o.popLast();return n.put({collectionId:a,parent:Dn(u)})}};return r.store("remoteDocuments").Z({X:!0},(o,a)=>{const u=new Wt(o);return s(u.popLast())}).next(()=>r.store("documentMutations").Z({X:!0},([o,a,u],c)=>{const l=Ps(a);return s(l.popLast())}))}js(e){const r=e.store("targets");return r.Z((n,i)=>{const s=gh(i),o=IO(this.It,s);return r.put(o)})}Ws(e,r){const n=r.store("remoteDocuments"),i=[];return n.Z((s,o)=>{const a=r.store("remoteDocumentsV14"),u=(c=o,c.document?new $e(Wt.fromString(c.document.name).popFirst(5)):c.noDocument?$e.fromSegments(c.noDocument.path):c.unknownDocument?$e.fromSegments(c.unknownDocument.path):ze()).path.toArray();var c;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const l={prefixPath:u.slice(0,u.length-2),collectionGroup:u[u.length-2],documentId:u[u.length-1],readTime:o.readTime||[0,0],unknownDocument:o.unknownDocument,noDocument:o.noDocument,document:o.document,hasCommittedMutations:!!o.hasCommittedMutations};i.push(a.put(l))}).next(()=>he.waitFor(i))}zs(e,r){const n=r.store("mutations"),i=RO(this.It),s=new OO(pv.Bs,this.It.re);return n.W().next(o=>{const a=new Map;return o.forEach(u=>{var c;let l=(c=a.get(u.userId))!==null&&c!==void 0?c:yt();bu(this.It,u).keys().forEach(h=>l=l.add(h)),a.set(u.userId,l)}),he.forEach(a,(u,c)=>{const l=new Ur(c),h=hv.oe(this.It,l),d=s.getIndexManager(l),_=dv.oe(l,this.It,d,s.referenceDelegate);return new NO(i,_,h,d).recalculateAndSaveOverlaysForDocumentKeys(new E1(r,Hn.at),u).next()})})}}function JT(t){t.createObjectStore("targetDocuments",{keyPath:OK}).createIndex("documentTargetsIndex",DK,{unique:!0}),t.createObjectStore("targets",{keyPath:"targetId"}).createIndex("queryTargetsIndex",NK,{unique:!0}),t.createObjectStore("targetGlobal")}const x_="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.";class mx{constructor(e,r,n,i,s,o,a,u,c,l,h=15){if(this.allowTabSynchronization=e,this.persistenceKey=r,this.clientId=n,this.Hs=s,this.window=o,this.document=a,this.Js=c,this.Ys=l,this.Xs=h,this.Ss=null,this.Ds=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Zs=null,this.inForeground=!1,this.ti=null,this.ei=null,this.ni=Number.NEGATIVE_INFINITY,this.si=d=>Promise.resolve(),!mx.C())throw new Le(xe.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new iG(this,i),this.ii=r+"main",this.It=new SO(u),this.ri=new yo(this.ii,this.Xs,new gG(this.It)),this.Cs=new eG(this.referenceDelegate,this.It),this.remoteDocumentCache=RO(this.It),this.Ns=new KK,this.window&&this.window.localStorage?this.oi=this.window.localStorage:(this.oi=null,l===!1&&br("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.ui().then(()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new Le(xe.FAILED_PRECONDITION,x_);return this.ci(),this.ai(),this.hi(),this.runTransaction("getHighestListenSequenceNumber","readonly",e=>this.Cs.getHighestSequenceNumber(e))}).then(e=>{this.Ss=new Hn(e,this.Js)}).then(()=>{this.Ds=!0}).catch(e=>(this.ri&&this.ri.close(),Promise.reject(e)))}li(e){return this.si=async r=>{if(this.started)return e(r)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.ri.L(async r=>{r.newVersion===null&&await e()})}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.Hs.enqueueAndForget(async()=>{this.started&&await this.ui()}))}ui(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",e=>ag(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next(()=>{if(this.isPrimary)return this.fi(e).next(r=>{r||(this.isPrimary=!1,this.Hs.enqueueRetryable(()=>this.si(!1)))})}).next(()=>this.di(e)).next(r=>this.isPrimary&&!r?this._i(e).next(()=>!1):!!r&&this.wi(e).next(()=>!0))).catch(e=>{if(Ja(e))return ke("IndexedDbPersistence","Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return ke("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1}).then(e=>{this.isPrimary!==e&&this.Hs.enqueueRetryable(()=>this.si(e)),this.isPrimary=e})}fi(e){return Vf(e).get("owner").next(r=>he.resolve(this.mi(r)))}gi(e){return ag(e).delete(this.clientId)}async yi(){if(this.isPrimary&&!this.pi(this.ni,18e5)){this.ni=Date.now();const e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",r=>{const n=Gr(r,"clientMetadata");return n.W().next(i=>{const s=this.Ii(i,18e5),o=i.filter(a=>s.indexOf(a)===-1);return he.forEach(o,a=>n.delete(a.clientId)).next(()=>o)})}).catch(()=>[]);if(this.oi)for(const r of e)this.oi.removeItem(this.Ti(r.clientId))}}hi(){this.ei=this.Hs.enqueueAfterDelay("client_metadata_refresh",4e3,()=>this.ui().then(()=>this.yi()).then(()=>this.hi()))}mi(e){return!!e&&e.ownerId===this.clientId}di(e){return this.Ys?he.resolve(!0):Vf(e).get("owner").next(r=>{if(r!==null&&this.pi(r.leaseTimestampMs,5e3)&&!this.Ei(r.ownerId)){if(this.mi(r)&&this.networkEnabled)return!0;if(!this.mi(r)){if(!r.allowTabSynchronization)throw new Le(xe.FAILED_PRECONDITION,x_);return!1}}return!(!this.networkEnabled||!this.inForeground)||ag(e).W().next(n=>this.Ii(n,5e3).find(i=>{if(this.clientId!==i.clientId){const s=!this.networkEnabled&&i.networkEnabled,o=!this.inForeground&&i.inForeground,a=this.networkEnabled===i.networkEnabled;if(s||o&&a)return!0}return!1})===void 0)}).next(r=>(this.isPrimary!==r&&ke("IndexedDbPersistence",`Client ${r?"is":"is not"} eligible for a primary lease.`),r))}async shutdown(){this.Ds=!1,this.Ai(),this.ei&&(this.ei.cancel(),this.ei=null),this.Ri(),this.bi(),await this.ri.runTransaction("shutdown","readwrite",["owner","clientMetadata"],e=>{const r=new E1(e,Hn.at);return this._i(r).next(()=>this.gi(r))}),this.ri.close(),this.Pi()}Ii(e,r){return e.filter(n=>this.pi(n.updateTimeMs,r)&&!this.Ei(n.clientId))}vi(){return this.runTransaction("getActiveClients","readonly",e=>ag(e).W().next(r=>this.Ii(r,18e5).map(n=>n.clientId)))}get started(){return this.Ds}getMutationQueue(e,r){return dv.oe(e,this.It,r,this.referenceDelegate)}getTargetCache(){return this.Cs}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new ZK(e,this.It.re.databaseId)}getDocumentOverlayCache(e){return hv.oe(this.It,e)}getBundleCache(){return this.Ns}runTransaction(e,r,n){ke("IndexedDbPersistence","Starting transaction:",e);const i=r==="readonly"?"readonly":"readwrite",s=(o=this.Xs)===15?zK:o===14?xO:o===13?EO:o===12?VK:o===11?wO:void ze();var o;let a;return this.ri.runTransaction(e,i,s,u=>(a=new E1(u,this.Ss?this.Ss.next():Hn.at),r==="readwrite-primary"?this.fi(a).next(c=>!!c||this.di(a)).next(c=>{if(!c)throw br(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Hs.enqueueRetryable(()=>this.si(!1)),new Le(xe.FAILED_PRECONDITION,PN);return n(a)}).next(c=>this.wi(a).next(()=>c)):this.Vi(a).next(()=>n(a)))).then(u=>(a.raiseOnCommittedEvent(),u))}Vi(e){return Vf(e).get("owner").next(r=>{if(r!==null&&this.pi(r.leaseTimestampMs,5e3)&&!this.Ei(r.ownerId)&&!this.mi(r)&&!(this.Ys||this.allowTabSynchronization&&r.allowTabSynchronization))throw new Le(xe.FAILED_PRECONDITION,x_)})}wi(e){const r={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return Vf(e).put("owner",r)}static C(){return yo.C()}_i(e){const r=Vf(e);return r.get("owner").next(n=>this.mi(n)?(ke("IndexedDbPersistence","Releasing primary lease."),r.delete("owner")):he.resolve())}pi(e,r){const n=Date.now();return!(en)||(br(`Detected an update time that is in the future: ${e} > ${n}`),!1))}ci(){this.document!==null&&typeof this.document.addEventListener=="function"&&(this.ti=()=>{this.Hs.enqueueAndForget(()=>(this.inForeground=this.document.visibilityState==="visible",this.ui()))},this.document.addEventListener("visibilitychange",this.ti),this.inForeground=this.document.visibilityState==="visible")}Ri(){this.ti&&(this.document.removeEventListener("visibilitychange",this.ti),this.ti=null)}ai(){var e;typeof((e=this.window)===null||e===void 0?void 0:e.addEventListener)=="function"&&(this.Zs=()=>{this.Ai(),m9()&&navigator.appVersion.match(/Version\/1[45]/)&&this.Hs.enterRestrictedMode(!0),this.Hs.enqueueAndForget(()=>this.shutdown())},this.window.addEventListener("pagehide",this.Zs))}bi(){this.Zs&&(this.window.removeEventListener("pagehide",this.Zs),this.Zs=null)}Ei(e){var r;try{const n=((r=this.oi)===null||r===void 0?void 0:r.getItem(this.Ti(e)))!==null;return ke("IndexedDbPersistence",`Client '${e}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(n){return br("IndexedDbPersistence","Failed to get zombied client id.",n),!1}}Ai(){if(this.oi)try{this.oi.setItem(this.Ti(this.clientId),String(Date.now()))}catch(e){br("Failed to set zombie client id.",e)}}Pi(){if(this.oi)try{this.oi.removeItem(this.Ti(this.clientId))}catch{}}Ti(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function Vf(t){return Gr(t,"owner")}function ag(t){return Gr(t,"clientMetadata")}function DO(t,e){let r=t.projectId;return t.isDefaultDatabase||(r+="."+t.database),"firestore/"+e+"/"+r+"/"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class vx{constructor(e,r,n,i){this.targetId=e,this.fromCache=r,this.Si=n,this.Di=i}static Ci(e,r){let n=yt(),i=yt();for(const s of r.docChanges)switch(s.type){case 0:n=n.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}return new vx(e,r.fromCache,n,i)}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class PO{constructor(){this.xi=!1}initialize(e,r){this.Ni=e,this.indexManager=r,this.xi=!0}getDocumentsMatchingQuery(e,r,n,i){return this.ki(e,r).next(s=>s||this.Oi(e,r,i,n)).next(s=>s||this.Mi(e,r))}ki(e,r){if(IT(r))return he.resolve(null);let n=Oi(r);return this.indexManager.getIndexType(e,n).next(i=>i===0?null:(r.limit!==null&&i===1&&(r=M0(r,null,"F"),n=Oi(r)),this.indexManager.getDocumentsMatchingTarget(e,n).next(s=>{const o=yt(...s);return this.Ni.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,n).next(u=>{const c=this.Fi(r,a);return this.$i(r,c,o,u.readTime)?this.ki(e,M0(r,null,"F")):this.Bi(e,c,r,u)}))})))}Oi(e,r,n,i){return IT(r)||i.isEqual(at.min())?this.Mi(e,r):this.Ni.getDocuments(e,n).next(s=>{const o=this.Fi(r,s);return this.$i(r,o,n,i)?this.Mi(e,r):(p1()<=Mt.DEBUG&&ke("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),y1(r)),this.Bi(e,o,r,ON(i,-1)))})}Fi(e,r){let n=new Zt(WN(e));return r.forEach((i,s)=>{cx(e,s)&&(n=n.add(s))}),n}$i(e,r,n,i){if(e.limit===null)return!1;if(n.size!==r.size)return!0;const s=e.limitType==="F"?r.last():r.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}Mi(e,r){return p1()<=Mt.DEBUG&&ke("QueryEngine","Using full collection scan to execute query:",y1(r)),this.Ni.getDocumentsMatchingQuery(e,r,pi.min())}Bi(e,r,n,i){return this.Ni.getDocumentsMatchingQuery(e,n,i).next(s=>(r.forEach(o=>{s=s.insert(o.key,o)}),s))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class mG{constructor(e,r,n,i){this.persistence=e,this.Li=r,this.It=i,this.Ui=new vr(pt),this.qi=new Qa(s=>nc(s),lp),this.Ki=new Map,this.Gi=e.getRemoteDocumentCache(),this.Cs=e.getTargetCache(),this.Ns=e.getBundleCache(),this.Qi(n)}Qi(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new NO(this.Gi,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Gi.setIndexManager(this.indexManager),this.Li.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",r=>e.collect(r,this.Ui))}}function LO(t,e,r,n){return new mG(t,e,r,n)}async function BO(t,e){const r=He(t);return await r.persistence.runTransaction("Handle user change","readonly",n=>{let i;return r.mutationQueue.getAllMutationBatches(n).next(s=>(i=s,r.Qi(e),r.mutationQueue.getAllMutationBatches(n))).next(s=>{const o=[],a=[];let u=yt();for(const c of i){o.push(c.batchId);for(const l of c.mutations)u=u.add(l.key)}for(const c of s){a.push(c.batchId);for(const l of c.mutations)u=u.add(l.key)}return r.localDocuments.getDocuments(n,u).next(c=>({ji:c,removedBatchIds:o,addedBatchIds:a}))})})}function vG(t,e){const r=He(t);return r.persistence.runTransaction("Acknowledge batch","readwrite-primary",n=>{const i=e.batch.keys(),s=r.Gi.newChangeBuffer({trackRemovals:!0});return function(o,a,u,c){const l=u.batch,h=l.keys();let d=he.resolve();return h.forEach(_=>{d=d.next(()=>c.getEntry(a,_)).next(T=>{const D=u.docVersions.get(_);ft(D!==null),T.version.compareTo(D)<0&&(l.applyToRemoteDocument(T,u),T.isValidDocument()&&(T.setReadTime(u.commitVersion),c.addEntry(T)))})}),d.next(()=>o.mutationQueue.removeMutationBatch(a,l))}(r,n,e,s).next(()=>s.apply(n)).next(()=>r.mutationQueue.performConsistencyCheck(n)).next(()=>r.documentOverlayCache.removeOverlaysForBatchId(n,i,e.batch.batchId)).next(()=>r.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(n,function(o){let a=yt();for(let u=0;u0&&(a=a.add(o.batch.mutations[u].key));return a}(e))).next(()=>r.localDocuments.getDocuments(n,i))})}function $O(t){const e=He(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",r=>e.Cs.getLastRemoteSnapshotVersion(r))}function yG(t,e){const r=He(t),n=e.snapshotVersion;let i=r.Ui;return r.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=r.Gi.newChangeBuffer({trackRemovals:!0});i=r.Ui;const a=[];e.targetChanges.forEach((l,h)=>{const d=i.get(h);if(!d)return;a.push(r.Cs.removeMatchingKeys(s,l.removedDocuments,h).next(()=>r.Cs.addMatchingKeys(s,l.addedDocuments,h)));let _=d.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.has(h)?_=_.withResumeToken(zr.EMPTY_BYTE_STRING,at.min()).withLastLimboFreeSnapshotVersion(at.min()):l.resumeToken.approximateByteSize()>0&&(_=_.withResumeToken(l.resumeToken,n)),i=i.insert(h,_),function(T,D,N){return T.resumeToken.approximateByteSize()===0||D.snapshotVersion.toMicroseconds()-T.snapshotVersion.toMicroseconds()>=3e8?!0:N.addedDocuments.size+N.modifiedDocuments.size+N.removedDocuments.size>0}(d,_,l)&&a.push(r.Cs.updateTargetData(s,_))});let u=ni(),c=yt();if(e.documentUpdates.forEach(l=>{e.resolvedLimboDocuments.has(l)&&a.push(r.persistence.referenceDelegate.updateLimboDocument(s,l))}),a.push(_G(s,o,e.documentUpdates).next(l=>{u=l.Wi,c=l.zi})),!n.isEqual(at.min())){const l=r.Cs.getLastRemoteSnapshotVersion(s).next(h=>r.Cs.setTargetsMetadata(s,s.currentSequenceNumber,n));a.push(l)}return he.waitFor(a).next(()=>o.apply(s)).next(()=>r.localDocuments.getLocalViewOfDocuments(s,u,c)).next(()=>u)}).then(s=>(r.Ui=i,s))}function _G(t,e,r){let n=yt(),i=yt();return r.forEach(s=>n=n.add(s)),e.getEntries(t,n).next(s=>{let o=ni();return r.forEach((a,u)=>{const c=s.get(a);u.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(a)),u.isNoDocument()&&u.version.isEqual(at.min())?(e.removeEntry(a,u.readTime),o=o.insert(a,u)):!c.isValidDocument()||u.version.compareTo(c.version)>0||u.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(u),o=o.insert(a,u)):ke("LocalStore","Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",u.version)}),{Wi:o,zi:i}})}function bG(t,e){const r=He(t);return r.persistence.runTransaction("Get next mutation batch","readonly",n=>(e===void 0&&(e=-1),r.mutationQueue.getNextMutationBatchAfterBatchId(n,e)))}function D0(t,e){const r=He(t);return r.persistence.runTransaction("Allocate target","readwrite",n=>{let i;return r.Cs.getTargetData(n,e).next(s=>s?(i=s,he.resolve(i)):r.Cs.allocateTargetId(n).next(o=>(i=new Aa(e,o,0,n.currentSequenceNumber),r.Cs.addTargetData(n,i).next(()=>i))))}).then(n=>{const i=r.Ui.get(n.targetId);return(i===null||n.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(r.Ui=r.Ui.insert(n.targetId,n),r.qi.set(e,n.targetId)),n})}async function Fl(t,e,r){const n=He(t),i=n.Ui.get(e),s=r?"readwrite":"readwrite-primary";try{r||await n.persistence.runTransaction("Release target",s,o=>n.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!Ja(o))throw o;ke("LocalStore",`Failed to update sequence numbers for target ${e}: ${o}`)}n.Ui=n.Ui.remove(e),n.qi.delete(i.target)}function x1(t,e,r){const n=He(t);let i=at.min(),s=yt();return n.persistence.runTransaction("Execute query","readonly",o=>function(a,u,c){const l=He(a),h=l.qi.get(c);return h!==void 0?he.resolve(l.Ui.get(h)):l.Cs.getTargetData(u,c)}(n,o,Oi(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,n.Cs.getMatchingKeysForTargetId(o,a.targetId).next(u=>{s=u})}).next(()=>n.Li.getDocumentsMatchingQuery(o,e,r?i:at.min(),r?s:yt())).next(a=>(qO(n,GN(e),a),{documents:a,Hi:s})))}function FO(t,e){const r=He(t),n=He(r.Cs),i=r.Ui.get(e);return i?Promise.resolve(i.target):r.persistence.runTransaction("Get target data","readonly",s=>n.se(s,e).next(o=>o?o.target:null))}function UO(t,e){const r=He(t),n=r.Ki.get(e)||at.min();return r.persistence.runTransaction("Get new document changes","readonly",i=>r.Gi.getAllFromCollectionGroup(i,e,ON(n,-1),Number.MAX_SAFE_INTEGER)).then(i=>(qO(r,e,i),i))}function qO(t,e,r){let n=t.Ki.get(e)||at.min();r.forEach((i,s)=>{s.readTime.compareTo(n)>0&&(n=s.readTime)}),t.Ki.set(e,n)}function QT(t,e){return`firestore_clients_${t}_${e}`}function ZT(t,e,r){let n=`firestore_mutations_${t}_${r}`;return e.isAuthenticated()&&(n+=`_${e.uid}`),n}function S_(t,e){return`firestore_targets_${t}_${e}`}class P0{constructor(e,r,n,i){this.user=e,this.batchId=r,this.state=n,this.error=i}static Zi(e,r,n){const i=JSON.parse(n);let s,o=typeof i=="object"&&["pending","acknowledged","rejected"].indexOf(i.state)!==-1&&(i.error===void 0||typeof i.error=="object");return o&&i.error&&(o=typeof i.error.message=="string"&&typeof i.error.code=="string",o&&(s=new Le(i.error.code,i.error.message))),o?new P0(e,r,i.state,s):(br("SharedClientState",`Failed to parse mutation state for ID '${r}': ${n}`),null)}tr(){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 Ph{constructor(e,r,n){this.targetId=e,this.state=r,this.error=n}static Zi(e,r){const n=JSON.parse(r);let i,s=typeof n=="object"&&["not-current","current","rejected"].indexOf(n.state)!==-1&&(n.error===void 0||typeof n.error=="object");return s&&n.error&&(s=typeof n.error.message=="string"&&typeof n.error.code=="string",s&&(i=new Le(n.error.code,n.error.message))),s?new Ph(e,n.state,i):(br("SharedClientState",`Failed to parse target state for ID '${e}': ${r}`),null)}tr(){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 L0{constructor(e,r){this.clientId=e,this.activeTargetIds=r}static Zi(e,r){const n=JSON.parse(r);let i=typeof n=="object"&&n.activeTargetIds instanceof Array,s=fv();for(let o=0;i&&othis.shutdown()),this.started=!0}writeSequenceNumber(e){this.setItem(this.hr,JSON.stringify(e))}getAllActiveQueryTargets(){return this.Ir(this.ur)}isActiveQueryTarget(e){let r=!1;return this.ur.forEach((n,i)=>{i.activeTargetIds.has(e)&&(r=!0)}),r}addPendingMutation(e){this.Tr(e,"pending")}updateMutationState(e,r,n){this.Tr(e,r,n),this.Er(e)}addLocalQueryTarget(e){let r="not-current";if(this.isActiveQueryTarget(e)){const n=this.storage.getItem(S_(this.persistenceKey,e));if(n){const i=Ph.Zi(e,n);i&&(r=i.state)}}return this.Ar.er(e),this.gr(),r}removeLocalQueryTarget(e){this.Ar.nr(e),this.gr()}isLocalQueryTarget(e){return this.Ar.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(S_(this.persistenceKey,e))}updateQueryState(e,r,n){this.Rr(e,r,n)}handleUserChange(e,r,n){r.forEach(i=>{this.Er(i)}),this.currentUser=e,n.forEach(i=>{this.addPendingMutation(i)})}setOnlineState(e){this.br(e)}notifyBundleLoaded(e){this.Pr(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this.ir),this.removeItem(this.ar),this.started=!1)}getItem(e){const r=this.storage.getItem(e);return ke("SharedClientState","READ",e,r),r}setItem(e,r){ke("SharedClientState","SET",e,r),this.storage.setItem(e,r)}removeItem(e){ke("SharedClientState","REMOVE",e),this.storage.removeItem(e)}rr(e){const r=e;if(r.storageArea===this.storage){if(ke("SharedClientState","EVENT",r.key,r.newValue),r.key===this.ar)return void br("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Hs.enqueueRetryable(async()=>{if(this.started){if(r.key!==null){if(this.lr.test(r.key)){if(r.newValue==null){const n=this.vr(r.key);return this.Vr(n,null)}{const n=this.Sr(r.key,r.newValue);if(n)return this.Vr(n.clientId,n)}}else if(this.dr.test(r.key)){if(r.newValue!==null){const n=this.Dr(r.key,r.newValue);if(n)return this.Cr(n)}}else if(this._r.test(r.key)){if(r.newValue!==null){const n=this.Nr(r.key,r.newValue);if(n)return this.kr(n)}}else if(r.key===this.wr){if(r.newValue!==null){const n=this.yr(r.newValue);if(n)return this.pr(n)}}else if(r.key===this.hr){const n=function(i){let s=Hn.at;if(i!=null)try{const o=JSON.parse(i);ft(typeof o=="number"),s=o}catch(o){br("SharedClientState","Failed to read sequence number from WebStorage",o)}return s}(r.newValue);n!==Hn.at&&this.sequenceNumberHandler(n)}else if(r.key===this.mr){const n=this.Or(r.newValue);await Promise.all(n.map(i=>this.syncEngine.Mr(i)))}}}else this.cr.push(r)})}}get Ar(){return this.ur.get(this.sr)}gr(){this.setItem(this.ar,this.Ar.tr())}Tr(e,r,n){const i=new P0(this.currentUser,e,r,n),s=ZT(this.persistenceKey,this.currentUser,e);this.setItem(s,i.tr())}Er(e){const r=ZT(this.persistenceKey,this.currentUser,e);this.removeItem(r)}br(e){const r={clientId:this.sr,onlineState:e};this.storage.setItem(this.wr,JSON.stringify(r))}Rr(e,r,n){const i=S_(this.persistenceKey,e),s=new Ph(e,r,n);this.setItem(i,s.tr())}Pr(e){const r=JSON.stringify(Array.from(e));this.setItem(this.mr,r)}vr(e){const r=this.lr.exec(e);return r?r[1]:null}Sr(e,r){const n=this.vr(e);return L0.Zi(n,r)}Dr(e,r){const n=this.dr.exec(e),i=Number(n[1]),s=n[2]!==void 0?n[2]:null;return P0.Zi(new Ur(s),i,r)}Nr(e,r){const n=this._r.exec(e),i=Number(n[1]);return Ph.Zi(i,r)}yr(e){return yx.Zi(e)}Or(e){return JSON.parse(e)}async Cr(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.Fr(e.batchId,e.state,e.error);ke("SharedClientState",`Ignoring mutation for non-active user ${e.user.uid}`)}kr(e){return this.syncEngine.$r(e.targetId,e.state,e.error)}Vr(e,r){const n=r?this.ur.insert(e,r):this.ur.remove(e),i=this.Ir(this.ur),s=this.Ir(n),o=[],a=[];return s.forEach(u=>{i.has(u)||o.push(u)}),i.forEach(u=>{s.has(u)||a.push(u)}),this.syncEngine.Br(o,a).then(()=>{this.ur=n})}pr(e){this.ur.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}Ir(e){let r=fv();return e.forEach((n,i)=>{r=r.unionWith(i.activeTargetIds)}),r}}class jO{constructor(){this.Lr=new S1,this.Ur={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,r,n){}addLocalQueryTarget(e){return this.Lr.er(e),this.Ur[e]||"not-current"}updateQueryState(e,r,n){this.Ur[e]=r}removeLocalQueryTarget(e){this.Lr.nr(e)}isLocalQueryTarget(e){return this.Lr.activeTargetIds.has(e)}clearQueryState(e){delete this.Ur[e]}getAllActiveQueryTargets(){return this.Lr.activeTargetIds}isActiveQueryTarget(e){return this.Lr.activeTargetIds.has(e)}start(){return this.Lr=new S1,Promise.resolve()}handleUserChange(e,r,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class wG{qr(e){}shutdown(){}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class eA{constructor(){this.Kr=()=>this.Gr(),this.Qr=()=>this.jr(),this.Wr=[],this.zr()}qr(e){this.Wr.push(e)}shutdown(){window.removeEventListener("online",this.Kr),window.removeEventListener("offline",this.Qr)}zr(){window.addEventListener("online",this.Kr),window.addEventListener("offline",this.Qr)}Gr(){ke("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.Wr)e(0)}jr(){ke("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.Wr)e(1)}static C(){return typeof window!="undefined"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const EG={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class xG{constructor(e){this.Hr=e.Hr,this.Jr=e.Jr}Yr(e){this.Xr=e}Zr(e){this.eo=e}onMessage(e){this.no=e}close(){this.Jr()}send(e){this.Hr(e)}so(){this.Xr()}io(e){this.eo(e)}ro(e){this.no(e)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class SG extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const r=e.ssl?"https":"http";this.oo=r+"://"+e.host,this.uo="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}get co(){return!1}ao(e,r,n,i,s){const o=this.ho(e,r);ke("RestConnection","Sending: ",o,n);const a={};return this.lo(a,i,s),this.fo(e,o,a,n).then(u=>(ke("RestConnection","Received: ",u),u),u=>{throw I0("RestConnection",`${e} failed with error: `,u,"url: ",o,"request:",n),u})}_o(e,r,n,i,s,o){return this.ao(e,r,n,i,s)}lo(e,r,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+hf,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),r&&r.headers.forEach((i,s)=>e[s]=i),n&&n.headers.forEach((i,s)=>e[s]=i)}ho(e,r){const n=EG[e];return`${this.oo}/v1/${r}:${n}`}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams}fo(e,r,n,i){return new Promise((s,o)=>{const a=new IH;a.setWithCredentials(!0),a.listenOnce(EH.COMPLETE,()=>{var c;try{switch(a.getLastErrorCode()){case w_.NO_ERROR:const l=a.getResponseJson();ke("Connection","XHR received:",JSON.stringify(l)),s(l);break;case w_.TIMEOUT:ke("Connection",'RPC "'+e+'" timed out'),o(new Le(xe.DEADLINE_EXCEEDED,"Request time out"));break;case w_.HTTP_ERROR:const h=a.getStatus();if(ke("Connection",'RPC "'+e+'" failed with status:',h,"response text:",a.getResponseText()),h>0){let d=a.getResponseJson();Array.isArray(d)&&(d=d[0]);const _=(c=d)===null||c===void 0?void 0:c.error;if(_&&_.status&&_.message){const T=function(D){const N=D.toLowerCase().replace(/_/g,"-");return Object.values(xe).indexOf(N)>=0?N:xe.UNKNOWN}(_.status);o(new Le(T,_.message))}else o(new Le(xe.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new Le(xe.UNAVAILABLE,"Connection failed."));break;default:ze()}}finally{ke("Connection",'RPC "'+e+'" completed.')}});const u=JSON.stringify(i);a.send(r,"POST",u,n,15)})}wo(e,r,n){const i=[this.oo,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=bH(),o=wH(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(a.xmlHttpFactory=new SH({})),this.lo(a.initMessageHeaders,r,n),a.encodeInitMessageHeaders=!0;const u=i.join("");ke("Connection","Creating WebChannel: "+u,a);const c=s.createWebChannel(u,a);let l=!1,h=!1;const d=new xG({Hr:T=>{h?ke("Connection","Not sending because WebChannel is closed:",T):(l||(ke("Connection","Opening WebChannel transport."),c.open(),l=!0),ke("Connection","WebChannel sending:",T),c.send(T))},Jr:()=>c.close()}),_=(T,D,N)=>{T.listen(D,O=>{try{N(O)}catch(L){setTimeout(()=>{throw L},0)}})};return _(c,rg.EventType.OPEN,()=>{h||ke("Connection","WebChannel transport opened.")}),_(c,rg.EventType.CLOSE,()=>{h||(h=!0,ke("Connection","WebChannel transport closed"),d.io())}),_(c,rg.EventType.ERROR,T=>{h||(h=!0,I0("Connection","WebChannel transport errored:",T),d.io(new Le(xe.UNAVAILABLE,"The operation could not be completed")))}),_(c,rg.EventType.MESSAGE,T=>{var D;if(!h){const N=T.data[0];ft(!!N);const O=N,L=O.error||((D=O[0])===null||D===void 0?void 0:D.error);if(L){ke("Connection","WebChannel received error:",L);const J=L.status;let q=function(ee){const G=xr[ee];if(G!==void 0)return sO(G)}(J),z=L.message;q===void 0&&(q=xe.INTERNAL,z="Unknown error status: "+J+" with message "+L.message),h=!0,d.io(new Le(q,z)),c.close()}else ke("Connection","WebChannel received:",N),d.ro(N)}}),_(o,xH.STAT_EVENT,T=>{T.stat===lT.PROXY?ke("Connection","Detected buffering proxy"):T.stat===lT.NOPROXY&&ke("Connection","Detected no buffering proxy")}),setTimeout(()=>{d.so()},0),d}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function VO(){return typeof window!="undefined"?window:null}function Dg(){return typeof document!="undefined"?document:null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function gv(t){return new mK(t,!0)}class zO{constructor(e,r,n=1e3,i=1.5,s=6e4){this.Hs=e,this.timerId=r,this.mo=n,this.yo=i,this.po=s,this.Io=0,this.To=null,this.Eo=Date.now(),this.reset()}reset(){this.Io=0}Ao(){this.Io=this.po}Ro(e){this.cancel();const r=Math.floor(this.Io+this.bo()),n=Math.max(0,Date.now()-this.Eo),i=Math.max(0,r-n);i>0&&ke("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.Io} ms, delay with jitter: ${r} ms, last attempt: ${n} ms ago)`),this.To=this.Hs.enqueueAfterDelay(this.timerId,i,()=>(this.Eo=Date.now(),e())),this.Io*=this.yo,this.Iothis.po&&(this.Io=this.po)}Po(){this.To!==null&&(this.To.skipDelay(),this.To=null)}cancel(){this.To!==null&&(this.To.cancel(),this.To=null)}bo(){return(Math.random()-.5)*this.Io}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class HO{constructor(e,r,n,i,s,o,a,u){this.Hs=e,this.vo=n,this.Vo=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=u,this.state=0,this.So=0,this.Do=null,this.Co=null,this.stream=null,this.xo=new zO(e,r)}No(){return this.state===1||this.state===5||this.ko()}ko(){return this.state===2||this.state===3}start(){this.state!==4?this.auth():this.Oo()}async stop(){this.No()&&await this.close(0)}Mo(){this.state=0,this.xo.reset()}Fo(){this.ko()&&this.Do===null&&(this.Do=this.Hs.enqueueAfterDelay(this.vo,6e4,()=>this.$o()))}Bo(e){this.Lo(),this.stream.send(e)}async $o(){if(this.ko())return this.close(0)}Lo(){this.Do&&(this.Do.cancel(),this.Do=null)}Uo(){this.Co&&(this.Co.cancel(),this.Co=null)}async close(e,r){this.Lo(),this.Uo(),this.xo.cancel(),this.So++,e!==4?this.xo.reset():r&&r.code===xe.RESOURCE_EXHAUSTED?(br(r.toString()),br("Using maximum backoff delay to prevent overloading the backend."),this.xo.Ao()):r&&r.code===xe.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.qo(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Zr(r)}qo(){}auth(){this.state=1;const e=this.Ko(this.So),r=this.So;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([n,i])=>{this.So===r&&this.Go(n,i)},n=>{e(()=>{const i=new Le(xe.UNKNOWN,"Fetching auth token failed: "+n.message);return this.Qo(i)})})}Go(e,r){const n=this.Ko(this.So);this.stream=this.jo(e,r),this.stream.Yr(()=>{n(()=>(this.state=2,this.Co=this.Hs.enqueueAfterDelay(this.Vo,1e4,()=>(this.ko()&&(this.state=3),Promise.resolve())),this.listener.Yr()))}),this.stream.Zr(i=>{n(()=>this.Qo(i))}),this.stream.onMessage(i=>{n(()=>this.onMessage(i))})}Oo(){this.state=5,this.xo.Ro(async()=>{this.state=0,this.start()})}Qo(e){return ke("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}Ko(e){return r=>{this.Hs.enqueueAndForget(()=>this.So===e?r():(ke("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class IG extends HO{constructor(e,r,n,i,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",r,n,i,o),this.It=s}jo(e,r){return this.connection.wo("Listen",e,r)}onMessage(e){this.xo.reset();const r=_K(this.It,e),n=function(i){if(!("targetChange"in i))return at.min();const s=i.targetChange;return s.targetIds&&s.targetIds.length?at.min():s.readTime?li(s.readTime):at.min()}(e);return this.listener.Wo(r,n)}zo(e){const r={};r.database=b1(this.It),r.addTarget=function(i,s){let o;const a=s.target;return o=A0(a)?{documents:gO(i,a)}:{query:mO(i,a)},o.targetId=s.targetId,s.resumeToken.approximateByteSize()>0?o.resumeToken=fO(i,s.resumeToken):s.snapshotVersion.compareTo(at.min())>0&&(o.readTime=kd(i,s.snapshotVersion.toTimestamp())),o}(this.It,e);const n=wK(this.It,e);n&&(r.labels=n),this.Bo(r)}Ho(e){const r={};r.database=b1(this.It),r.removeTarget=e,this.Bo(r)}}class TG extends HO{constructor(e,r,n,i,s,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",r,n,i,o),this.It=s,this.Jo=!1}get Yo(){return this.Jo}start(){this.Jo=!1,this.lastStreamToken=void 0,super.start()}qo(){this.Jo&&this.Xo([])}jo(e,r){return this.connection.wo("Write",e,r)}onMessage(e){if(ft(!!e.streamToken),this.lastStreamToken=e.streamToken,this.Jo){this.xo.reset();const r=bK(e.writeResults,e.commitTime),n=li(e.commitTime);return this.listener.Zo(n,r)}return ft(!e.writeResults||e.writeResults.length===0),this.Jo=!0,this.listener.tu()}eu(){const e={};e.database=b1(this.It),this.Bo(e)}Xo(e){const r={streamToken:this.lastStreamToken,writes:e.map(n=>R0(this.It,n))};this.Bo(r)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class AG extends class{}{constructor(e,r,n,i){super(),this.authCredentials=e,this.appCheckCredentials=r,this.connection=n,this.It=i,this.nu=!1}su(){if(this.nu)throw new Le(xe.FAILED_PRECONDITION,"The client has already been terminated.")}ao(e,r,n){return this.su(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,s])=>this.connection.ao(e,r,n,i,s)).catch(i=>{throw i.name==="FirebaseError"?(i.code===xe.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),i):new Le(xe.UNKNOWN,i.toString())})}_o(e,r,n,i){return this.su(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection._o(e,r,n,s,o,i)).catch(s=>{throw s.name==="FirebaseError"?(s.code===xe.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new Le(xe.UNKNOWN,s.toString())})}terminate(){this.nu=!0}}class kG{constructor(e,r){this.asyncQueue=e,this.onlineStateHandler=r,this.state="Unknown",this.iu=0,this.ru=null,this.ou=!0}uu(){this.iu===0&&(this.cu("Unknown"),this.ru=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.ru=null,this.au("Backend didn't respond within 10 seconds."),this.cu("Offline"),Promise.resolve())))}hu(e){this.state==="Online"?this.cu("Unknown"):(this.iu++,this.iu>=1&&(this.lu(),this.au(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.cu("Offline")))}set(e){this.lu(),this.iu=0,e==="Online"&&(this.ou=!1),this.cu(e)}cu(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}au(e){const r=`Could not reach Cloud Firestore backend. ${e} This 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.ou?(br(r),this.ou=!1):ke("OnlineStateTracker",r)}lu(){this.ru!==null&&(this.ru.cancel(),this.ru=null)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class MG{constructor(e,r,n,i,s){this.localStore=e,this.datastore=r,this.asyncQueue=n,this.remoteSyncer={},this.fu=[],this.du=new Map,this._u=new Set,this.wu=[],this.mu=s,this.mu.qr(o=>{n.enqueueAndForget(async()=>{Tc(this)&&(ke("RemoteStore","Restarting streams for network reachability change."),await async function(a){const u=He(a);u._u.add(4),await pp(u),u.gu.set("Unknown"),u._u.delete(4),await mv(u)}(this))})}),this.gu=new kG(n,i)}}async function mv(t){if(Tc(t))for(const e of t.wu)await e(!0)}async function pp(t){for(const e of t.wu)await e(!1)}function vv(t,e){const r=He(t);r.du.has(e.targetId)||(r.du.set(e.targetId,e),wx(r)?bx(r):mf(r).ko()&&_x(r,e))}function Md(t,e){const r=He(t),n=mf(r);r.du.delete(e),n.ko()&&KO(r,e),r.du.size===0&&(n.ko()?n.Fo():Tc(r)&&r.gu.set("Unknown"))}function _x(t,e){t.yu.Mt(e.targetId),mf(t).zo(e)}function KO(t,e){t.yu.Mt(e),mf(t).Ho(e)}function bx(t){t.yu=new dK({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),se:e=>t.du.get(e)||null}),mf(t).start(),t.gu.uu()}function wx(t){return Tc(t)&&!mf(t).No()&&t.du.size>0}function Tc(t){return He(t)._u.size===0}function GO(t){t.yu=void 0}async function CG(t){t.du.forEach((e,r)=>{_x(t,e)})}async function RG(t,e){GO(t),wx(t)?(t.gu.hu(e),bx(t)):t.gu.set("Unknown")}async function NG(t,e,r){if(t.gu.set("Online"),e instanceof lO&&e.state===2&&e.cause)try{await async function(n,i){const s=i.cause;for(const o of i.targetIds)n.du.has(o)&&(await n.remoteSyncer.rejectListen(o,s),n.du.delete(o),n.yu.removeTarget(o))}(t,e)}catch(n){ke("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),await B0(t,n)}else if(e instanceof Ng?t.yu.Gt(e):e instanceof cO?t.yu.Yt(e):t.yu.Wt(e),!r.isEqual(at.min()))try{const n=await $O(t.localStore);r.compareTo(n)>=0&&await function(i,s){const o=i.yu.te(s);return o.targetChanges.forEach((a,u)=>{if(a.resumeToken.approximateByteSize()>0){const c=i.du.get(u);c&&i.du.set(u,c.withResumeToken(a.resumeToken,s))}}),o.targetMismatches.forEach(a=>{const u=i.du.get(a);if(!u)return;i.du.set(a,u.withResumeToken(zr.EMPTY_BYTE_STRING,u.snapshotVersion)),KO(i,a);const c=new Aa(u.target,a,1,u.sequenceNumber);_x(i,c)}),i.remoteSyncer.applyRemoteEvent(o)}(t,r)}catch(n){ke("RemoteStore","Failed to raise snapshot:",n),await B0(t,n)}}async function B0(t,e,r){if(!Ja(e))throw e;t._u.add(1),await pp(t),t.gu.set("Offline"),r||(r=()=>$O(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{ke("RemoteStore","Retrying IndexedDB access"),await r(),t._u.delete(1),await mv(t)})}function WO(t,e){return e().catch(r=>B0(t,r,e))}async function gf(t){const e=He(t),r=Ua(e);let n=e.fu.length>0?e.fu[e.fu.length-1].batchId:-1;for(;OG(e);)try{const i=await bG(e.localStore,n);if(i===null){e.fu.length===0&&r.Fo();break}n=i.batchId,DG(e,i)}catch(i){await B0(e,i)}XO(e)&&YO(e)}function OG(t){return Tc(t)&&t.fu.length<10}function DG(t,e){t.fu.push(e);const r=Ua(t);r.ko()&&r.Yo&&r.Xo(e.mutations)}function XO(t){return Tc(t)&&!Ua(t).No()&&t.fu.length>0}function YO(t){Ua(t).start()}async function PG(t){Ua(t).eu()}async function LG(t){const e=Ua(t);for(const r of t.fu)e.Xo(r.mutations)}async function BG(t,e,r){const n=t.fu.shift(),i=hx.from(n,e,r);await WO(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),await gf(t)}async function $G(t,e){e&&Ua(t).Yo&&await async function(r,n){if(i=n.code,uK(i)&&i!==xe.ABORTED){const s=r.fu.shift();Ua(r).Mo(),await WO(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,n)),await gf(r)}var i}(t,e),XO(t)&&YO(t)}async function tA(t,e){const r=He(t);r.asyncQueue.verifyOperationInProgress(),ke("RemoteStore","RemoteStore received new credentials");const n=Tc(r);r._u.add(3),await pp(r),n&&r.gu.set("Unknown"),await r.remoteSyncer.handleCredentialChange(e),r._u.delete(3),await mv(r)}async function I1(t,e){const r=He(t);e?(r._u.delete(2),await mv(r)):e||(r._u.add(2),await pp(r),r.gu.set("Unknown"))}function mf(t){return t.pu||(t.pu=function(e,r,n){const i=He(e);return i.su(),new IG(r,i.connection,i.authCredentials,i.appCheckCredentials,i.It,n)}(t.datastore,t.asyncQueue,{Yr:CG.bind(null,t),Zr:RG.bind(null,t),Wo:NG.bind(null,t)}),t.wu.push(async e=>{e?(t.pu.Mo(),wx(t)?bx(t):t.gu.set("Unknown")):(await t.pu.stop(),GO(t))})),t.pu}function Ua(t){return t.Iu||(t.Iu=function(e,r,n){const i=He(e);return i.su(),new TG(r,i.connection,i.authCredentials,i.appCheckCredentials,i.It,n)}(t.datastore,t.asyncQueue,{Yr:PG.bind(null,t),Zr:$G.bind(null,t),tu:LG.bind(null,t),Zo:BG.bind(null,t)}),t.wu.push(async e=>{e?(t.Iu.Mo(),await gf(t)):(await t.Iu.stop(),t.fu.length>0&&(ke("RemoteStore",`Stopping write stream with ${t.fu.length} pending writes`),t.fu=[]))})),t.Iu}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ex{constructor(e,r,n,i,s){this.asyncQueue=e,this.timerId=r,this.targetTimeMs=n,this.op=i,this.removalCallback=s,this.deferred=new os,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}static createAndSchedule(e,r,n,i,s){const o=Date.now()+n,a=new Ex(e,r,o,i,s);return a.start(n),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Le(xe.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 xx(t,e){if(br("AsyncQueue",`${e}: ${t}`),Ja(t))return new Le(xe.UNAVAILABLE,`${e}: ${t}`);throw t}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class pl{constructor(e){this.comparator=e?(r,n)=>e(r,n)||$e.comparator(r.key,n.key):(r,n)=>$e.comparator(r.key,n.key),this.keyedMap=ph(),this.sortedSet=new vr(this.comparator)}static emptySet(e){return new pl(e.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 r=this.keyedMap.get(e);return r?this.sortedSet.indexOf(r):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((r,n)=>(e(r),!1))}add(e){const r=this.delete(e.key);return r.copy(r.keyedMap.insert(e.key,e),r.sortedSet.insert(e,null))}delete(e){const r=this.get(e);return r?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(r)):this}isEqual(e){if(!(e instanceof pl)||this.size!==e.size)return!1;const r=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;r.hasNext();){const i=r.getNext().key,s=n.getNext().key;if(!i.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(r=>{e.push(r.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( `+e.join(` `)+` )`}copy(e,r){const n=new pl;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=r,n}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class rA{constructor(){this.Tu=new vr($e.comparator)}track(e){const r=e.doc.key,n=this.Tu.get(r);n?e.type!==0&&n.type===3?this.Tu=this.Tu.insert(r,e):e.type===3&&n.type!==1?this.Tu=this.Tu.insert(r,{type:n.type,doc:e.doc}):e.type===2&&n.type===2?this.Tu=this.Tu.insert(r,{type:2,doc:e.doc}):e.type===2&&n.type===0?this.Tu=this.Tu.insert(r,{type:0,doc:e.doc}):e.type===1&&n.type===0?this.Tu=this.Tu.remove(r):e.type===1&&n.type===2?this.Tu=this.Tu.insert(r,{type:1,doc:n.doc}):e.type===0&&n.type===1?this.Tu=this.Tu.insert(r,{type:2,doc:e.doc}):ze():this.Tu=this.Tu.insert(r,e)}Eu(){const e=[];return this.Tu.inorderTraversal((r,n)=>{e.push(n)}),e}}class Ul{constructor(e,r,n,i,s,o,a,u,c){this.query=e,this.docs=r,this.oldDocs=n,this.docChanges=i,this.mutatedKeys=s,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=u,this.hasCachedResults=c}static fromInitialDocuments(e,r,n,i,s){const o=[];return r.forEach(a=>{o.push({type:0,doc:a})}),new Ul(e,r,pl.emptySet(r),o,n,i,!0,!1,s)}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)&&ov(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const r=this.docChanges,n=e.docChanges;if(r.length!==n.length)return!1;for(let i=0;iKN(e),ov),this.onlineState="Unknown",this.Ru=new Set}}async function Sx(t,e){const r=He(t),n=e.query;let i=!1,s=r.queries.get(n);if(s||(i=!0,s=new FG),i)try{s.Au=await r.onListen(n)}catch(o){const a=xx(o,`Initialization of query '${y1(e.query)}' failed`);return void e.onError(a)}r.queries.set(n,s),s.listeners.push(e),e.bu(r.onlineState),s.Au&&e.Pu(s.Au)&&Tx(r)}async function Ix(t,e){const r=He(t),n=e.query;let i=!1;const s=r.queries.get(n);if(s){const o=s.listeners.indexOf(e);o>=0&&(s.listeners.splice(o,1),i=s.listeners.length===0)}if(i)return r.queries.delete(n),r.onUnlisten(n)}function qG(t,e){const r=He(t);let n=!1;for(const i of e){const s=i.query,o=r.queries.get(s);if(o){for(const a of o.listeners)a.Pu(i)&&(n=!0);o.Au=i}}n&&Tx(r)}function jG(t,e,r){const n=He(t),i=n.queries.get(e);if(i)for(const s of i.listeners)s.onError(r);n.queries.delete(e)}function Tx(t){t.Ru.forEach(e=>{e.next()})}class Ax{constructor(e,r,n){this.query=e,this.vu=r,this.Vu=!1,this.Su=null,this.onlineState="Unknown",this.options=n||{}}Pu(e){if(!this.options.includeMetadataChanges){const n=[];for(const i of e.docChanges)i.type!==3&&n.push(i);e=new Ul(e.query,e.docs,e.oldDocs,n,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let r=!1;return this.Vu?this.Du(e)&&(this.vu.next(e),r=!0):this.Cu(e,this.onlineState)&&(this.xu(e),r=!0),this.Su=e,r}onError(e){this.vu.error(e)}bu(e){this.onlineState=e;let r=!1;return this.Su&&!this.Vu&&this.Cu(this.Su,e)&&(this.xu(this.Su),r=!0),r}Cu(e,r){if(!e.fromCache)return!0;const n=r!=="Offline";return(!this.options.Nu||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||r==="Offline")}Du(e){if(e.docChanges.length>0)return!0;const r=this.Su&&this.Su.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!r)&&this.options.includeMetadataChanges===!0}xu(e){e=Ul.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Vu=!0,this.vu.next(e)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class JO{constructor(e){this.key=e}}class QO{constructor(e){this.key=e}}class VG{constructor(e,r){this.query=e,this.Uu=r,this.qu=null,this.hasCachedResults=!1,this.current=!1,this.Ku=yt(),this.mutatedKeys=yt(),this.Gu=WN(e),this.Qu=new pl(this.Gu)}get ju(){return this.Uu}Wu(e,r){const n=r?r.zu:new rA,i=r?r.Qu:this.Qu;let s=r?r.mutatedKeys:this.mutatedKeys,o=i,a=!1;const u=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,c=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((l,h)=>{const d=i.get(l),_=cx(this.query,h)?h:null,T=!!d&&this.mutatedKeys.has(d.key),D=!!_&&(_.hasLocalMutations||this.mutatedKeys.has(_.key)&&_.hasCommittedMutations);let N=!1;d&&_?d.data.isEqual(_.data)?T!==D&&(n.track({type:3,doc:_}),N=!0):this.Hu(d,_)||(n.track({type:2,doc:_}),N=!0,(u&&this.Gu(_,u)>0||c&&this.Gu(_,c)<0)&&(a=!0)):!d&&_?(n.track({type:0,doc:_}),N=!0):d&&!_&&(n.track({type:1,doc:d}),N=!0,(u||c)&&(a=!0)),N&&(_?(o=o.add(_),s=D?s.add(l):s.delete(l)):(o=o.delete(l),s=s.delete(l)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const l=this.query.limitType==="F"?o.last():o.first();o=o.delete(l.key),s=s.delete(l.key),n.track({type:1,doc:l})}return{Qu:o,zu:n,$i:a,mutatedKeys:s}}Hu(e,r){return e.hasLocalMutations&&r.hasCommittedMutations&&!r.hasLocalMutations}applyChanges(e,r,n){const i=this.Qu;this.Qu=e.Qu,this.mutatedKeys=e.mutatedKeys;const s=e.zu.Eu();s.sort((c,l)=>function(h,d){const _=T=>{switch(T){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ze()}};return _(h)-_(d)}(c.type,l.type)||this.Gu(c.doc,l.doc)),this.Ju(n);const o=r?this.Yu():[],a=this.Ku.size===0&&this.current?1:0,u=a!==this.qu;return this.qu=a,s.length!==0||u?{snapshot:new Ul(this.query,e.Qu,i,s,e.mutatedKeys,a===0,u,!1,!!n&&n.resumeToken.approximateByteSize()>0),Xu:o}:{Xu:o}}bu(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Qu:this.Qu,zu:new rA,mutatedKeys:this.mutatedKeys,$i:!1},!1)):{Xu:[]}}Zu(e){return!this.Uu.has(e)&&!!this.Qu.has(e)&&!this.Qu.get(e).hasLocalMutations}Ju(e){e&&(e.addedDocuments.forEach(r=>this.Uu=this.Uu.add(r)),e.modifiedDocuments.forEach(r=>{}),e.removedDocuments.forEach(r=>this.Uu=this.Uu.delete(r)),this.current=e.current)}Yu(){if(!this.current)return[];const e=this.Ku;this.Ku=yt(),this.Qu.forEach(n=>{this.Zu(n.key)&&(this.Ku=this.Ku.add(n.key))});const r=[];return e.forEach(n=>{this.Ku.has(n)||r.push(new QO(n))}),this.Ku.forEach(n=>{e.has(n)||r.push(new JO(n))}),r}tc(e){this.Uu=e.Hi,this.Ku=yt();const r=this.Wu(e.documents);return this.applyChanges(r,!0)}ec(){return Ul.fromInitialDocuments(this.query,this.Qu,this.mutatedKeys,this.qu===0,this.hasCachedResults)}}class zG{constructor(e,r,n){this.query=e,this.targetId=r,this.view=n}}class HG{constructor(e){this.key=e,this.nc=!1}}class KG{constructor(e,r,n,i,s,o){this.localStore=e,this.remoteStore=r,this.eventManager=n,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.sc={},this.ic=new Qa(a=>KN(a),ov),this.rc=new Map,this.oc=new Set,this.uc=new vr($e.comparator),this.cc=new Map,this.ac=new gx,this.hc={},this.lc=new Map,this.fc=uc.vn(),this.onlineState="Unknown",this.dc=void 0}get isPrimaryClient(){return this.dc===!0}}async function GG(t,e){const r=Nx(t);let n,i;const s=r.ic.get(e);if(s)n=s.targetId,r.sharedClientState.addLocalQueryTarget(n),i=s.view.ec();else{const o=await D0(r.localStore,Oi(e));r.isPrimaryClient&&vv(r.remoteStore,o);const a=r.sharedClientState.addLocalQueryTarget(o.targetId);n=o.targetId,i=await kx(r,e,n,a==="current",o.resumeToken)}return i}async function kx(t,e,r,n,i){t._c=(h,d,_)=>async function(T,D,N,O){let L=D.view.Wu(N);L.$i&&(L=await x1(T.localStore,D.query,!1).then(({documents:z})=>D.view.Wu(z,L)));const J=O&&O.targetChanges.get(D.targetId),q=D.view.applyChanges(L,T.isPrimaryClient,J);return T1(T,D.targetId,q.Xu),q.snapshot}(t,h,d,_);const s=await x1(t.localStore,e,!0),o=new VG(e,s.Hi),a=o.Wu(s.documents),u=dp.createSynthesizedTargetChangeForCurrentChange(r,n&&t.onlineState!=="Offline",i),c=o.applyChanges(a,t.isPrimaryClient,u);T1(t,r,c.Xu);const l=new zG(e,r,o);return t.ic.set(e,l),t.rc.has(r)?t.rc.get(r).push(e):t.rc.set(r,[e]),c.snapshot}async function WG(t,e){const r=He(t),n=r.ic.get(e),i=r.rc.get(n.targetId);if(i.length>1)return r.rc.set(n.targetId,i.filter(s=>!ov(s,e))),void r.ic.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(n.targetId),r.sharedClientState.isActiveQueryTarget(n.targetId)||await Fl(r.localStore,n.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(n.targetId),Md(r.remoteStore,n.targetId),ql(r,n.targetId)}).catch(Ya)):(ql(r,n.targetId),await Fl(r.localStore,n.targetId,!0))}async function XG(t,e,r){const n=Ox(t);try{const i=await function(s,o){const a=He(s),u=dr.now(),c=o.reduce((d,_)=>d.add(_.key),yt());let l,h;return a.persistence.runTransaction("Locally write mutations","readwrite",d=>{let _=ni(),T=yt();return a.Gi.getEntries(d,c).next(D=>{_=D,_.forEach((N,O)=>{O.isValidDocument()||(T=T.add(N))})}).next(()=>a.localDocuments.getOverlayedDocuments(d,_)).next(D=>{l=D;const N=[];for(const O of o){const L=oK(O,l.get(O.key).overlayedDocument);L!=null&&N.push(new Go(O.key,L,jN(L.value.mapValue),yn.exists(!0)))}return a.mutationQueue.addMutationBatch(d,u,N,o)}).next(D=>{h=D;const N=D.applyToLocalDocumentSet(l,T);return a.documentOverlayCache.saveOverlays(d,D.batchId,N)})}).then(()=>({batchId:h.batchId,changes:aO(l)}))}(n.localStore,e);n.sharedClientState.addPendingMutation(i.batchId),function(s,o,a){let u=s.hc[s.currentUser.toKey()];u||(u=new vr(pt)),u=u.insert(o,a),s.hc[s.currentUser.toKey()]=u}(n,i.batchId,r),await Za(n,i.changes),await gf(n.remoteStore)}catch(i){const s=xx(i,"Failed to persist write");r.reject(s)}}async function ZO(t,e){const r=He(t);try{const n=await yG(r.localStore,e);e.targetChanges.forEach((i,s)=>{const o=r.cc.get(s);o&&(ft(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1),i.addedDocuments.size>0?o.nc=!0:i.modifiedDocuments.size>0?ft(o.nc):i.removedDocuments.size>0&&(ft(o.nc),o.nc=!1))}),await Za(r,n,e)}catch(n){await Ya(n)}}function nA(t,e,r){const n=He(t);if(n.isPrimaryClient&&r===0||!n.isPrimaryClient&&r===1){const i=[];n.ic.forEach((s,o)=>{const a=o.view.bu(e);a.snapshot&&i.push(a.snapshot)}),function(s,o){const a=He(s);a.onlineState=o;let u=!1;a.queries.forEach((c,l)=>{for(const h of l.listeners)h.bu(o)&&(u=!0)}),u&&Tx(a)}(n.eventManager,e),i.length&&n.sc.Wo(i),n.onlineState=e,n.isPrimaryClient&&n.sharedClientState.setOnlineState(e)}}async function YG(t,e,r){const n=He(t);n.sharedClientState.updateQueryState(e,"rejected",r);const i=n.cc.get(e),s=i&&i.key;if(s){let o=new vr($e.comparator);o=o.insert(s,fr.newNoDocument(s,at.min()));const a=yt().add(s),u=new hp(at.min(),new Map,new Zt(pt),o,a);await ZO(n,u),n.uc=n.uc.remove(s),n.cc.delete(e),Rx(n)}else await Fl(n.localStore,e,!1).then(()=>ql(n,e,r)).catch(Ya)}async function JG(t,e){const r=He(t),n=e.batch.batchId;try{const i=await vG(r.localStore,e);Cx(r,n,null),Mx(r,n),r.sharedClientState.updateMutationState(n,"acknowledged"),await Za(r,i)}catch(i){await Ya(i)}}async function QG(t,e,r){const n=He(t);try{const i=await function(s,o){const a=He(s);return a.persistence.runTransaction("Reject batch","readwrite-primary",u=>{let c;return a.mutationQueue.lookupMutationBatch(u,o).next(l=>(ft(l!==null),c=l.keys(),a.mutationQueue.removeMutationBatch(u,l))).next(()=>a.mutationQueue.performConsistencyCheck(u)).next(()=>a.documentOverlayCache.removeOverlaysForBatchId(u,c,o)).next(()=>a.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(u,c)).next(()=>a.localDocuments.getDocuments(u,c))})}(n.localStore,e);Cx(n,e,r),Mx(n,e),n.sharedClientState.updateMutationState(e,"rejected",r),await Za(n,i)}catch(i){await Ya(i)}}function Mx(t,e){(t.lc.get(e)||[]).forEach(r=>{r.resolve()}),t.lc.delete(e)}function Cx(t,e,r){const n=He(t);let i=n.hc[n.currentUser.toKey()];if(i){const s=i.get(e);s&&(r?s.reject(r):s.resolve(),i=i.remove(e)),n.hc[n.currentUser.toKey()]=i}}function ql(t,e,r=null){t.sharedClientState.removeLocalQueryTarget(e);for(const n of t.rc.get(e))t.ic.delete(n),r&&t.sc.wc(n,r);t.rc.delete(e),t.isPrimaryClient&&t.ac.ls(e).forEach(n=>{t.ac.containsKey(n)||eD(t,n)})}function eD(t,e){t.oc.delete(e.path.canonicalString());const r=t.uc.get(e);r!==null&&(Md(t.remoteStore,r),t.uc=t.uc.remove(e),t.cc.delete(r),Rx(t))}function T1(t,e,r){for(const n of r)n instanceof JO?(t.ac.addReference(n.key,e),ZG(t,n)):n instanceof QO?(ke("SyncEngine","Document no longer in limbo: "+n.key),t.ac.removeReference(n.key,e),t.ac.containsKey(n.key)||eD(t,n.key)):ze()}function ZG(t,e){const r=e.key,n=r.path.canonicalString();t.uc.get(r)||t.oc.has(n)||(ke("SyncEngine","New document in limbo: "+r),t.oc.add(n),Rx(t))}function Rx(t){for(;t.oc.size>0&&t.uc.size{o.push(n._c(u,e,r).then(c=>{if((c||r)&&n.isPrimaryClient&&n.sharedClientState.updateQueryState(u.targetId,c!=null&&c.fromCache?"not-current":"current"),c){i.push(c);const l=vx.Ci(u.targetId,c);s.push(l)}}))}),await Promise.all(o),n.sc.Wo(i),await async function(a,u){const c=He(a);try{await c.persistence.runTransaction("notifyLocalViewChanges","readwrite",l=>he.forEach(u,h=>he.forEach(h.Si,d=>c.persistence.referenceDelegate.addReference(l,h.targetId,d)).next(()=>he.forEach(h.Di,d=>c.persistence.referenceDelegate.removeReference(l,h.targetId,d)))))}catch(l){if(!Ja(l))throw l;ke("LocalStore","Failed to update sequence numbers: "+l)}for(const l of u){const h=l.targetId;if(!l.fromCache){const d=c.Ui.get(h),_=d.snapshotVersion,T=d.withLastLimboFreeSnapshotVersion(_);c.Ui=c.Ui.insert(h,T)}}}(n.localStore,s))}async function eW(t,e){const r=He(t);if(!r.currentUser.isEqual(e)){ke("SyncEngine","User change. New user:",e.toKey());const n=await BO(r.localStore,e);r.currentUser=e,function(i,s){i.lc.forEach(o=>{o.forEach(a=>{a.reject(new Le(xe.CANCELLED,s))})}),i.lc.clear()}(r,"'waitForPendingWrites' promise is rejected due to a user change."),r.sharedClientState.handleUserChange(e,n.removedBatchIds,n.addedBatchIds),await Za(r,n.ji)}}function tW(t,e){const r=He(t),n=r.cc.get(e);if(n&&n.nc)return yt().add(n.key);{let i=yt();const s=r.rc.get(e);if(!s)return i;for(const o of s){const a=r.ic.get(o);i=i.unionWith(a.view.ju)}return i}}async function rW(t,e){const r=He(t),n=await x1(r.localStore,e.query,!0),i=e.view.tc(n);return r.isPrimaryClient&&T1(r,e.targetId,i.Xu),i}async function nW(t,e){const r=He(t);return UO(r.localStore,e).then(n=>Za(r,n))}async function iW(t,e,r,n){const i=He(t),s=await function(o,a){const u=He(o),c=He(u.mutationQueue);return u.persistence.runTransaction("Lookup mutation documents","readonly",l=>c.Tn(l,a).next(h=>h?u.localDocuments.getDocuments(l,h):he.resolve(null)))}(i.localStore,e);s!==null?(r==="pending"?await gf(i.remoteStore):r==="acknowledged"||r==="rejected"?(Cx(i,e,n||null),Mx(i,e),function(o,a){He(He(o).mutationQueue).An(a)}(i.localStore,e)):ze(),await Za(i,s)):ke("SyncEngine","Cannot apply mutation batch with id: "+e)}async function sW(t,e){const r=He(t);if(Nx(r),Ox(r),e===!0&&r.dc!==!0){const n=r.sharedClientState.getAllActiveQueryTargets(),i=await iA(r,n.toArray());r.dc=!0,await I1(r.remoteStore,!0);for(const s of i)vv(r.remoteStore,s)}else if(e===!1&&r.dc!==!1){const n=[];let i=Promise.resolve();r.rc.forEach((s,o)=>{r.sharedClientState.isLocalQueryTarget(o)?n.push(o):i=i.then(()=>(ql(r,o),Fl(r.localStore,o,!0))),Md(r.remoteStore,o)}),await i,await iA(r,n),function(s){const o=He(s);o.cc.forEach((a,u)=>{Md(o.remoteStore,u)}),o.ac.fs(),o.cc=new Map,o.uc=new vr($e.comparator)}(r),r.dc=!1,await I1(r.remoteStore,!1)}}async function iA(t,e,r){const n=He(t),i=[],s=[];for(const o of e){let a;const u=n.rc.get(o);if(u&&u.length!==0){a=await D0(n.localStore,Oi(u[0]));for(const c of u){const l=n.ic.get(c),h=await rW(n,l);h.snapshot&&s.push(h.snapshot)}}else{const c=await FO(n.localStore,o);a=await D0(n.localStore,c),await kx(n,tD(c),o,!1,a.resumeToken)}i.push(a)}return n.sc.Wo(s),i}function tD(t){return zN(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function oW(t){const e=He(t);return He(He(e.localStore).persistence).vi()}async function aW(t,e,r,n){const i=He(t);if(i.dc)return void ke("SyncEngine","Ignoring unexpected query state notification.");const s=i.rc.get(e);if(s&&s.length>0)switch(r){case"current":case"not-current":{const o=await UO(i.localStore,GN(s[0])),a=hp.createSynthesizedRemoteEventForCurrentChange(e,r==="current",zr.EMPTY_BYTE_STRING);await Za(i,o,a);break}case"rejected":await Fl(i.localStore,e,!0),ql(i,e,n);break;default:ze()}}async function uW(t,e,r){const n=Nx(t);if(n.dc){for(const i of e){if(n.rc.has(i)){ke("SyncEngine","Adding an already active target "+i);continue}const s=await FO(n.localStore,i),o=await D0(n.localStore,s);await kx(n,tD(s),o.targetId,!1,o.resumeToken),vv(n.remoteStore,o)}for(const i of r)n.rc.has(i)&&await Fl(n.localStore,i,!1).then(()=>{Md(n.remoteStore,i),ql(n,i)}).catch(Ya)}}function Nx(t){const e=He(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=ZO.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=tW.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=YG.bind(null,e),e.sc.Wo=qG.bind(null,e.eventManager),e.sc.wc=jG.bind(null,e.eventManager),e}function Ox(t){const e=He(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=JG.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=QG.bind(null,e),e}class rD{constructor(){this.synchronizeTabs=!1}async initialize(e){this.It=gv(e.databaseInfo.databaseId),this.sharedClientState=this.gc(e),this.persistence=this.yc(e),await this.persistence.start(),this.localStore=this.Ic(e),this.gcScheduler=this.Tc(e,this.localStore),this.indexBackfillerScheduler=this.Ec(e,this.localStore)}Tc(e,r){return null}Ec(e,r){return null}Ic(e){return LO(this.persistence,new PO,e.initialUser,this.It)}yc(e){return new OO(pv.Bs,this.It)}gc(e){return new jO}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class cW extends rD{constructor(e,r,n){super(),this.Ac=e,this.cacheSizeBytes=r,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await this.Ac.initialize(this,e),await Ox(this.Ac.syncEngine),await gf(this.Ac.remoteStore),await this.persistence.li(()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve()))}Ic(e){return LO(this.persistence,new PO,e.initialUser,this.It)}Tc(e,r){const n=this.persistence.referenceDelegate.garbageCollector;return new rG(n,e.asyncQueue,r)}Ec(e,r){const n=new FH(r,this.persistence);return new $H(e.asyncQueue,n)}yc(e){const r=DO(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),n=this.cacheSizeBytes!==void 0?jn.withCacheSize(this.cacheSizeBytes):jn.DEFAULT;return new mx(this.synchronizeTabs,r,e.clientId,n,e.asyncQueue,VO(),Dg(),this.It,this.sharedClientState,!!this.forceOwnership)}gc(e){return new jO}}class lW extends cW{constructor(e,r){super(e,r,!1),this.Ac=e,this.cacheSizeBytes=r,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);const r=this.Ac.syncEngine;this.sharedClientState instanceof I_&&(this.sharedClientState.syncEngine={Fr:iW.bind(null,r),$r:aW.bind(null,r),Br:uW.bind(null,r),vi:oW.bind(null,r),Mr:nW.bind(null,r)},await this.sharedClientState.start()),await this.persistence.li(async n=>{await sW(this.Ac.syncEngine,n),this.gcScheduler&&(n&&!this.gcScheduler.started?this.gcScheduler.start():n||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(n&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():n||this.indexBackfillerScheduler.stop())})}gc(e){const r=VO();if(!I_.C(r))throw new Le(xe.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const n=DO(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new I_(r,e.asyncQueue,n,e.clientId,e.initialUser)}}class nD{async initialize(e,r){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(r),this.remoteStore=this.createRemoteStore(r),this.eventManager=this.createEventManager(r),this.syncEngine=this.createSyncEngine(r,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=n=>nA(this.syncEngine,n,1),this.remoteStore.remoteSyncer.handleCredentialChange=eW.bind(null,this.syncEngine),await I1(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new UG}createDatastore(e){const r=gv(e.databaseInfo.databaseId),n=(i=e.databaseInfo,new SG(i));var i;return function(s,o,a,u){return new AG(s,o,a,u)}(e.authCredentials,e.appCheckCredentials,n,r)}createRemoteStore(e){return r=this.localStore,n=this.datastore,i=e.asyncQueue,s=a=>nA(this.syncEngine,a,0),o=eA.C()?new eA:new wG,new MG(r,n,i,s,o);var r,n,i,s,o}createSyncEngine(e,r){return function(n,i,s,o,a,u,c){const l=new KG(n,i,s,o,a,u);return c&&(l.dc=!0),l}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,r)}terminate(){return async function(e){const r=He(e);ke("RemoteStore","RemoteStore shutting down."),r._u.add(5),await pp(r),r.mu.shutdown(),r.gu.set("Unknown")}(this.remoteStore)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function iD(t,e,r){if(!r)throw new Le(xe.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function fW(t,e,r,n){if(e===!0&&n===!0)throw new Le(xe.INVALID_ARGUMENT,`${t} and ${r} cannot be used together.`)}function sA(t){if(!$e.isDocumentKey(t))throw new Le(xe.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function oA(t){if($e.isDocumentKey(t))throw new Le(xe.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function yv(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":ze()}function Pn(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Le(xe.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const r=yv(t);throw new Le(xe.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${r}`)}}return t}function hW(t,e){if(e<=0)throw new Le(xe.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const aA=new Map;class uA{constructor(e){var r;if(e.host===void 0){if(e.ssl!==void 0)throw new Le(xe.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(r=e.ssl)===null||r===void 0||r;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new Le(xe.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.useFetchStreams=!!e.useFetchStreams,fW("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling)}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&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class _v{constructor(e,r,n,i){this._authCredentials=e,this._appCheckCredentials=r,this._databaseId=n,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new uA({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new Le(xe.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!==void 0}_setSettings(e){if(this._settingsFrozen)throw new Le(xe.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 uA(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new TH;switch(r.type){case"gapi":const n=r.client;return new CH(n,r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new Le(xe.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const r=aA.get(e);r&&(ke("ComponentProvider","Removing Datastore"),aA.delete(e),r.terminate())}(this),Promise.resolve()}}function dW(t,e,r,n={}){var i;const s=(t=Pn(t,_v))._getSettings();if(s.host!=="firestore.googleapis.com"&&s.host!==e&&I0("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},s),{host:`${e}:${r}`,ssl:!1})),n.mockUserToken){let o,a;if(typeof n.mockUserToken=="string")o=n.mockUserToken,a=Ur.MOCK_USER;else{o=S9(n.mockUserToken,(i=t._app)===null||i===void 0?void 0:i.options.projectId);const u=n.mockUserToken.sub||n.mockUserToken.user_id;if(!u)throw new Le(xe.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");a=new Ur(u)}t._authCredentials=new AH(new MN(o,a))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class En{constructor(e,r,n){this.converter=r,this._key=n,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 ka(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new En(this.firestore,e,this._key)}}class eu{constructor(e,r,n){this.converter=r,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new eu(this.firestore,e,this._query)}}class ka extends eu{constructor(e,r,n){super(e,r,fp(n)),this._path=n,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 En(this.firestore,null,new $e(e))}withConverter(e){return new ka(this.firestore,e,this._path)}}function ppe(t,e,...r){if(t=Qe(t),iD("collection","path",e),t instanceof _v){const n=Wt.fromString(e,...r);return oA(n),new ka(t,null,n)}{if(!(t instanceof En||t instanceof ka))throw new Le(xe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=t._path.child(Wt.fromString(e,...r));return oA(n),new ka(t.firestore,null,n)}}function pW(t,e,...r){if(t=Qe(t),arguments.length===1&&(e=CN.R()),iD("doc","path",e),t instanceof _v){const n=Wt.fromString(e,...r);return sA(n),new En(t,null,new $e(n))}{if(!(t instanceof En||t instanceof ka))throw new Le(xe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=t._path.child(Wt.fromString(e,...r));return sA(n),new En(t.firestore,t instanceof ka?t.converter:null,new $e(n))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Dx{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.Rc(this.observer.next,e)}error(e){this.observer.error?this.Rc(this.observer.error,e):br("Uncaught Error in snapshot listener:",e.toString())}bc(){this.muted=!0}Rc(e,r){this.muted||setTimeout(()=>{this.muted||e(r)},0)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class gW{constructor(e,r,n,i){this.authCredentials=e,this.appCheckCredentials=r,this.asyncQueue=n,this.databaseInfo=i,this.user=Ur.UNAUTHENTICATED,this.clientId=CN.R(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(n,async s=>{ke("FirestoreClient","Received user=",s.uid),await this.authCredentialListener(s),this.user=s}),this.appCheckCredentials.start(n,s=>(ke("FirestoreClient","Received new app check token=",s),this.appCheckCredentialListener(s,this.user)))}async getConfiguration(){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}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new Le(xe.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new os;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(r){const n=xx(r,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function sD(t,e){t.asyncQueue.verifyOperationInProgress(),ke("FirestoreClient","Initializing OfflineComponentProvider");const r=await t.getConfiguration();await e.initialize(r);let n=r.initialUser;t.setCredentialChangeListener(async i=>{n.isEqual(i)||(await BO(e.localStore,i),n=i)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t.offlineComponents=e}async function oD(t,e){t.asyncQueue.verifyOperationInProgress();const r=await mW(t);ke("FirestoreClient","Initializing OnlineComponentProvider");const n=await t.getConfiguration();await e.initialize(r,n),t.setCredentialChangeListener(i=>tA(e.remoteStore,i)),t.setAppCheckTokenChangeListener((i,s)=>tA(e.remoteStore,s)),t.onlineComponents=e}async function mW(t){return t.offlineComponents||(ke("FirestoreClient","Using default OfflineComponentProvider"),await sD(t,new rD)),t.offlineComponents}async function aD(t){return t.onlineComponents||(ke("FirestoreClient","Using default OnlineComponentProvider"),await oD(t,new nD)),t.onlineComponents}function vW(t){return aD(t).then(e=>e.syncEngine)}async function $0(t){const e=await aD(t),r=e.eventManager;return r.onListen=GG.bind(null,e.syncEngine),r.onUnlisten=WG.bind(null,e.syncEngine),r}function yW(t,e,r={}){const n=new os;return t.asyncQueue.enqueueAndForget(async()=>function(i,s,o,a,u){const c=new Dx({next:h=>{s.enqueueAndForget(()=>Ix(i,l));const d=h.docs.has(o);!d&&h.fromCache?u.reject(new Le(xe.UNAVAILABLE,"Failed to get document because the client is offline.")):d&&h.fromCache&&a&&a.source==="server"?u.reject(new Le(xe.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.)')):u.resolve(h)},error:h=>u.reject(h)}),l=new Ax(fp(o.path),c,{includeMetadataChanges:!0,Nu:!0});return Sx(i,l)}(await $0(t),t.asyncQueue,e,r,n)),n.promise}function _W(t,e,r={}){const n=new os;return t.asyncQueue.enqueueAndForget(async()=>function(i,s,o,a,u){const c=new Dx({next:h=>{s.enqueueAndForget(()=>Ix(i,l)),h.fromCache&&a.source==="server"?u.reject(new Le(xe.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.)')):u.resolve(h)},error:h=>u.reject(h)}),l=new Ax(o,c,{includeMetadataChanges:!0,Nu:!0});return Sx(i,l)}(await $0(t),t.asyncQueue,e,r,n)),n.promise}class bW{constructor(){this.Bc=Promise.resolve(),this.Lc=[],this.Uc=!1,this.qc=[],this.Kc=null,this.Gc=!1,this.Qc=!1,this.jc=[],this.xo=new zO(this,"async_queue_retry"),this.Wc=()=>{const r=Dg();r&&ke("AsyncQueue","Visibility state changed to "+r.visibilityState),this.xo.Po()};const e=Dg();e&&typeof e.addEventListener=="function"&&e.addEventListener("visibilitychange",this.Wc)}get isShuttingDown(){return this.Uc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.zc(),this.Hc(e)}enterRestrictedMode(e){if(!this.Uc){this.Uc=!0,this.Qc=e||!1;const r=Dg();r&&typeof r.removeEventListener=="function"&&r.removeEventListener("visibilitychange",this.Wc)}}enqueue(e){if(this.zc(),this.Uc)return new Promise(()=>{});const r=new os;return this.Hc(()=>this.Uc&&this.Qc?Promise.resolve():(e().then(r.resolve,r.reject),r.promise)).then(()=>r.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Lc.push(e),this.Jc()))}async Jc(){if(this.Lc.length!==0){try{await this.Lc[0](),this.Lc.shift(),this.xo.reset()}catch(e){if(!Ja(e))throw e;ke("AsyncQueue","Operation failed with retryable error: "+e)}this.Lc.length>0&&this.xo.Ro(()=>this.Jc())}}Hc(e){const r=this.Bc.then(()=>(this.Gc=!0,e().catch(n=>{this.Kc=n,this.Gc=!1;const i=function(s){let o=s.message||"";return s.stack&&(o=s.stack.includes(s.message)?s.stack:s.message+` `+s.stack),o}(n);throw br("INTERNAL UNHANDLED ERROR: ",i),n}).then(n=>(this.Gc=!1,n))));return this.Bc=r,r}enqueueAfterDelay(e,r,n){this.zc(),this.jc.indexOf(e)>-1&&(r=0);const i=Ex.createAndSchedule(this,e,r,n,s=>this.Yc(s));return this.qc.push(i),i}zc(){this.Kc&&ze()}verifyOperationInProgress(){}async Xc(){let e;do e=this.Bc,await e;while(e!==this.Bc)}Zc(e){for(const r of this.qc)if(r.timerId===e)return!0;return!1}ta(e){return this.Xc().then(()=>{this.qc.sort((r,n)=>r.targetTimeMs-n.targetTimeMs);for(const r of this.qc)if(r.skipDelay(),e!=="all"&&r.timerId===e)break;return this.Xc()})}ea(e){this.jc.push(e)}Yc(e){const r=this.qc.indexOf(e);this.qc.splice(r,1)}}function cA(t){return function(e,r){if(typeof e!="object"||e===null)return!1;const n=e;for(const i of r)if(i in n&&typeof n[i]=="function")return!0;return!1}(t,["next","error","complete"])}class Hs extends _v{constructor(e,r,n,i){super(e,r,n,i),this.type="firestore",this._queue=new bW,this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||uD(this),this._firestoreClient.terminate()}}function gpe(t,e){const r=typeof t=="object"?t:Jd(),n=typeof t=="string"?t:e||"(default)",i=zo(r,"firestore").getImmediate({identifier:n});if(!i._initialized){const s=M3("firestore");s&&dW(i,...s)}return i}function gp(t){return t._firestoreClient||uD(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function uD(t){var e;const r=t._freezeSettings(),n=function(i,s,o,a){return new qH(i,s,o,a.host,a.ssl,a.experimentalForceLongPolling,a.experimentalAutoDetectLongPolling,a.useFetchStreams)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,r);t._firestoreClient=new gW(t._authCredentials,t._appCheckCredentials,t._queue,n)}function mpe(t){EW(t=Pn(t,Hs));const e=gp(t),r=t._freezeSettings(),n=new nD;return wW(e,n,new lW(n,r.cacheSizeBytes))}function wW(t,e,r){const n=new os;return t.asyncQueue.enqueue(async()=>{try{await sD(t,r),await oD(t,e),n.resolve()}catch(i){const s=i;if(!function(o){return o.name==="FirebaseError"?o.code===xe.FAILED_PRECONDITION||o.code===xe.UNIMPLEMENTED:typeof DOMException!="undefined"&&o instanceof DOMException?o.code===22||o.code===20||o.code===11:!0}(s))throw s;I0("Error enabling offline persistence. Falling back to persistence disabled: "+s),n.reject(s)}}).then(()=>n.promise)}function EW(t){if(t._initialized||t._terminated)throw new Le(xe.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.")}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class jl{constructor(e){this._byteString=e}static fromBase64String(e){try{return new jl(zr.fromBase64String(e))}catch(r){throw new Le(xe.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+r)}}static fromUint8Array(e){return new jl(zr.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)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class bv{constructor(...e){for(let r=0;r90)throw new Le(xe.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(r)||r<-180||r>180)throw new Le(xe.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+r);this._lat=e,this._long=r}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return pt(this._lat,e._lat)||pt(this._long,e._long)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const xW=/^__.*__$/;class SW{constructor(e,r,n){this.data=e,this.fieldMask=r,this.fieldTransforms=n}toMutation(e,r){return this.fieldMask!==null?new Go(e,this.data,this.fieldMask,r,this.fieldTransforms):new pf(e,this.data,r,this.fieldTransforms)}}class cD{constructor(e,r,n){this.data=e,this.fieldMask=r,this.fieldTransforms=n}toMutation(e,r){return new Go(e,this.data,this.fieldMask,r,this.fieldTransforms)}}function lD(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ze()}}class wv{constructor(e,r,n,i,s,o){this.settings=e,this.databaseId=r,this.It=n,this.ignoreUndefinedProperties=i,s===void 0&&this.na(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get sa(){return this.settings.sa}ia(e){return new wv(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.It,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}ra(e){var r;const n=(r=this.path)===null||r===void 0?void 0:r.child(e),i=this.ia({path:n,oa:!1});return i.ua(e),i}ca(e){var r;const n=(r=this.path)===null||r===void 0?void 0:r.child(e),i=this.ia({path:n,oa:!1});return i.na(),i}aa(e){return this.ia({path:void 0,oa:!0})}ha(e){return F0(e,this.settings.methodName,this.settings.la||!1,this.path,this.settings.fa)}contains(e){return this.fieldMask.find(r=>e.isPrefixOf(r))!==void 0||this.fieldTransforms.find(r=>e.isPrefixOf(r.field))!==void 0}na(){if(this.path)for(let e=0;eu.covers(h.field))}else u=null,c=o.fieldTransforms;return new SW(new vn(a),u,c)}class mp extends vf{_toFieldTransform(e){if(e.sa!==2)throw e.sa===1?e.ha(`${this._methodName}() can only appear at the top level of your update data`):e.ha(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof mp}}function hD(t,e,r){return new wv({sa:3,fa:e.settings.fa,methodName:t._methodName,oa:r},e.databaseId,e.It,e.ignoreUndefinedProperties)}class TW extends vf{constructor(e,r){super(e),this._a=r}_toFieldTransform(e){const r=hD(this,e,!0),n=this._a.map(s=>Ac(s,r)),i=new ic(n);return new uv(e.path,i)}isEqual(e){return this===e}}class AW extends vf{constructor(e,r){super(e),this._a=r}_toFieldTransform(e){const r=hD(this,e,!0),n=this._a.map(s=>Ac(s,r)),i=new sc(n);return new uv(e.path,i)}isEqual(e){return this===e}}class kW extends vf{constructor(e,r){super(e),this.wa=r}_toFieldTransform(e){const r=new $l(e.It,JN(e.It,this.wa));return new uv(e.path,r)}isEqual(e){return this===e}}function MW(t,e,r,n){const i=t.da(1,e,r);Lx("Data must be an object, but it was:",i,n);const s=[],o=vn.empty();Ic(n,(u,c)=>{const l=Bx(e,u,r);c=Qe(c);const h=i.ca(l);if(c instanceof mp)s.push(l);else{const d=Ac(c,h);d!=null&&(s.push(l),o.set(l,d))}});const a=new ci(s);return new cD(o,a,i.fieldTransforms)}function CW(t,e,r,n,i,s){const o=t.da(1,e,r),a=[A1(e,n,r)],u=[i];if(s.length%2!=0)throw new Le(xe.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let d=0;d=0;--d)if(!gD(c,a[d])){const _=a[d];let T=u[d];T=Qe(T);const D=o.ca(_);if(T instanceof mp)c.push(_);else{const N=Ac(T,D);N!=null&&(c.push(_),l.set(_,N))}}const h=new ci(c);return new cD(l,h,o.fieldTransforms)}function RW(t,e,r,n=!1){return Ac(r,t.da(n?4:3,e))}function Ac(t,e){if(pD(t=Qe(t)))return Lx("Unsupported field value:",e,t),dD(t,e);if(t instanceof vf)return function(r,n){if(!lD(n.sa))throw n.ha(`${r._methodName}() can only be used with update() and set()`);if(!n.path)throw n.ha(`${r._methodName}() is not currently supported inside arrays`);const i=r._toFieldTransform(n);i&&n.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.oa&&e.sa!==4)throw e.ha("Nested arrays are not supported");return function(r,n){const i=[];let s=0;for(const o of r){let a=Ac(o,n.aa(s));a==null&&(a={nullValue:"NULL_VALUE"}),i.push(a),s++}return{arrayValue:{values:i}}}(t,e)}return function(r,n){if((r=Qe(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return JN(n.It,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const i=dr.fromDate(r);return{timestampValue:kd(n.It,i)}}if(r instanceof dr){const i=new dr(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:kd(n.It,i)}}if(r instanceof Px)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof jl)return{bytesValue:fO(n.It,r._byteString)};if(r instanceof En){const i=n.databaseId,s=r.firestore._databaseId;if(!s.isEqual(i))throw n.ha(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${i.projectId}/${i.database}`);return{referenceValue:lx(r.firestore._databaseId||n.databaseId,r._key.path)}}throw n.ha(`Unsupported field value: ${yv(r)}`)}(t,e)}function dD(t,e){const r={};return BN(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Ic(t,(n,i)=>{const s=Ac(i,e.ra(n));s!=null&&(r[n]=s)}),{mapValue:{fields:r}}}function pD(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof dr||t instanceof Px||t instanceof jl||t instanceof En||t instanceof vf)}function Lx(t,e,r){if(!pD(r)||!function(n){return typeof n=="object"&&n!==null&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null)}(r)){const n=yv(r);throw n==="an object"?e.ha(t+" a custom object"):e.ha(t+" "+n)}}function A1(t,e,r){if((e=Qe(e))instanceof bv)return e._internalPath;if(typeof e=="string")return Bx(t,e);throw F0("Field path arguments must be of type string or ",t,!1,void 0,r)}const NW=new RegExp("[~\\*/\\[\\]]");function Bx(t,e,r){if(e.search(NW)>=0)throw F0(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,r);try{return new bv(...e.split("."))._internalPath}catch{throw F0(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,r)}}function F0(t,e,r,n,i){const s=n&&!n.isEmpty(),o=i!==void 0;let a=`Function ${e}() called with invalid data`;r&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(s||o)&&(u+=" (found",s&&(u+=` in field ${n}`),o&&(u+=` in document ${i}`),u+=")"),new Le(xe.INVALID_ARGUMENT,a+t+u)}function gD(t,e){return t.some(r=>r.isEqual(e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class mD{constructor(e,r,n,i,s){this._firestore=e,this._userDataWriter=r,this._key=n,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new En(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new OW(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 r=this._document.data.field(xv("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r)}}}class OW extends mD{data(){return super.data()}}function xv(t,e){return typeof e=="string"?Bx(t,e):e instanceof bv?e._internalPath:e._delegate._internalPath}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function vD(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new Le(xe.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class $x{}function vpe(t,...e){for(const r of e)t=r._apply(t);return t}class DW extends $x{constructor(e,r,n){super(),this.ma=e,this.ga=r,this.ya=n,this.type="where"}_apply(e){const r=Ev(e.firestore),n=function(i,s,o,a,u,c,l){let h;if(u.isKeyField()){if(c==="array-contains"||c==="array-contains-any")throw new Le(xe.INVALID_ARGUMENT,`Invalid Query. You can't perform '${c}' queries on documentId().`);if(c==="in"||c==="not-in"){fA(l,c);const _=[];for(const T of l)_.push(lA(a,i,T));h={arrayValue:{values:_}}}else h=lA(a,i,l)}else c!=="in"&&c!=="not-in"&&c!=="array-contains-any"||fA(l,c),h=RW(o,s,l,c==="in"||c==="not-in");const d=en.create(u,c,h);return function(_,T){if(T.dt()){const N=ux(_);if(N!==null&&!N.isEqual(T.field))throw new Le(xe.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${N.toString()}' and '${T.field.toString()}'`);const O=ax(_);O!==null&&yD(_,T.field,O)}const D=function(N,O){for(const L of N.filters)if(O.indexOf(L.op)>=0)return L.op;return null}(_,function(N){switch(N){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(T.op));if(D!==null)throw D===T.op?new Le(xe.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${T.op.toString()}' filter.`):new Le(xe.INVALID_ARGUMENT,`Invalid query. You cannot use '${T.op.toString()}' filters with '${D.toString()}' filters.`)}(i,d),d}(e._query,"where",r,e.firestore._databaseId,this.ma,this.ga,this.ya);return new eu(e.firestore,e.converter,function(i,s){const o=i.filters.concat([s]);return new df(i.path,i.collectionGroup,i.explicitOrderBy.slice(),o,i.limit,i.limitType,i.startAt,i.endAt)}(e._query,n))}}function ype(t,e,r){const n=e,i=xv("where",t);return new DW(i,n,r)}class PW extends $x{constructor(e,r){super(),this.ma=e,this.pa=r,this.type="orderBy"}_apply(e){const r=function(n,i,s){if(n.startAt!==null)throw new Le(xe.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(n.endAt!==null)throw new Le(xe.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");const o=new dl(i,s);return function(a,u){if(ax(a)===null){const c=ux(a);c!==null&&yD(a,c,u.field)}}(n,o),o}(e._query,this.ma,this.pa);return new eu(e.firestore,e.converter,function(n,i){const s=n.explicitOrderBy.concat([i]);return new df(n.path,n.collectionGroup,s,n.filters.slice(),n.limit,n.limitType,n.startAt,n.endAt)}(e._query,r))}}function _pe(t,e="asc"){const r=e,n=xv("orderBy",t);return new PW(n,r)}class LW extends $x{constructor(e,r,n){super(),this.type=e,this.Ia=r,this.Ta=n}_apply(e){return new eu(e.firestore,e.converter,M0(e._query,this.Ia,this.Ta))}}function bpe(t){return hW("limit",t),new LW("limit",t,"F")}function lA(t,e,r){if(typeof(r=Qe(r))=="string"){if(r==="")throw new Le(xe.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!HN(e)&&r.indexOf("/")!==-1)throw new Le(xe.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);const n=e.path.child(Wt.fromString(r));if(!$e.isDocumentKey(n))throw new Le(xe.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);return Sd(t,new $e(n))}if(r instanceof En)return Sd(t,r._key);throw new Le(xe.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${yv(r)}.`)}function fA(t,e){if(!Array.isArray(t)||t.length===0)throw new Le(xe.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);if(t.length>10)throw new Le(xe.INVALID_ARGUMENT,`Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`)}function yD(t,e,r){if(!r.isEqual(e))throw new Le(xe.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${r.toString()}' instead.`)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class BW{convertValue(e,r="none"){switch(rc(e)){case 0:return null;case 1:return e.booleanValue;case 2:return pr(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,r);case 5:return e.stringValue;case 6:return this.convertBytes(ec(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,r);case 10:return this.convertObject(e.mapValue,r);default:throw ze()}}convertObject(e,r){const n={};return Ic(e.fields,(i,s)=>{n[i]=this.convertValue(s,r)}),n}convertGeoPoint(e){return new Px(pr(e.latitude),pr(e.longitude))}convertArray(e,r){return(e.values||[]).map(n=>this.convertValue(n,r))}convertServerTimestamp(e,r){switch(r){case"previous":const n=FN(e);return n==null?null:this.convertValue(n,r);case"estimate":return this.convertTimestamp(wd(e));default:return null}}convertTimestamp(e){const r=$a(e);return new dr(r.seconds,r.nanos)}convertDocumentKey(e,r){const n=Wt.fromString(e);ft(_O(n));const i=new tc(n.get(1),n.get(3)),s=new $e(n.popFirst(5));return i.isEqual(r)||br(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${r.projectId}/${r.database}) instead.`),s}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function _D(t,e,r){let n;return n=t?r&&(r.merge||r.mergeFields)?t.toFirestore(e,r):t.toFirestore(e):e,n}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class mh{constructor(e,r){this.hasPendingWrites=e,this.fromCache=r}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class bD extends mD{constructor(e,r,n,i,s,o){super(e,r,n,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const r=new Pg(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(r,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,r={}){if(this._document){const n=this._document.data.field(xv("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n,r.serverTimestamps)}}}class Pg extends bD{data(e={}){return super.data(e)}}class wD{constructor(e,r,n,i){this._firestore=e,this._userDataWriter=r,this._snapshot=i,this.metadata=new mh(i.hasPendingWrites,i.fromCache),this.query=n}get docs(){const e=[];return this.forEach(r=>e.push(r)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,r){this._snapshot.docs.forEach(n=>{e.call(r,new Pg(this._firestore,this._userDataWriter,n.key,n,new mh(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const r=!!e.includeMetadataChanges;if(r&&this._snapshot.excludesMetadataChanges)throw new Le(xe.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===r||(this._cachedChanges=function(n,i){if(n._snapshot.oldDocs.isEmpty()){let s=0;return n._snapshot.docChanges.map(o=>{const a=new Pg(n._firestore,n._userDataWriter,o.doc.key,o.doc,new mh(n._snapshot.mutatedKeys.has(o.doc.key),n._snapshot.fromCache),n.query.converter);return o.doc,{type:"added",doc:a,oldIndex:-1,newIndex:s++}})}{let s=n._snapshot.oldDocs;return n._snapshot.docChanges.filter(o=>i||o.type!==3).map(o=>{const a=new Pg(n._firestore,n._userDataWriter,o.doc.key,o.doc,new mh(n._snapshot.mutatedKeys.has(o.doc.key),n._snapshot.fromCache),n.query.converter);let u=-1,c=-1;return o.type!==0&&(u=s.indexOf(o.doc.key),s=s.delete(o.doc.key)),o.type!==1&&(s=s.add(o.doc),c=s.indexOf(o.doc.key)),{type:$W(o.type),doc:a,oldIndex:u,newIndex:c}})}}(this,r),this._cachedChangesIncludeMetadataChanges=r),this._cachedChanges}}function $W(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ze()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function wpe(t){t=Pn(t,En);const e=Pn(t.firestore,Hs);return yW(gp(e),t._key).then(r=>ED(e,t,r))}class Fx extends BW{constructor(e){super(),this.firestore=e}convertBytes(e){return new jl(e)}convertReference(e){const r=this.convertDocumentKey(e,this.firestore._databaseId);return new En(this.firestore,null,r)}}function Epe(t){t=Pn(t,eu);const e=Pn(t.firestore,Hs),r=gp(e),n=new Fx(e);return vD(t._query),_W(r,t._query).then(i=>new wD(e,n,t,i))}function xpe(t,e,r){t=Pn(t,En);const n=Pn(t.firestore,Hs),i=_D(t.converter,e,r);return Sv(n,[fD(Ev(n),"setDoc",t._key,i,t.converter!==null,r).toMutation(t._key,yn.none())])}function Spe(t,e,r,...n){t=Pn(t,En);const i=Pn(t.firestore,Hs),s=Ev(i);let o;return o=typeof(e=Qe(e))=="string"||e instanceof bv?CW(s,"updateDoc",t._key,e,r,n):MW(s,"updateDoc",t._key,e),Sv(i,[o.toMutation(t._key,yn.exists(!0))])}function Ipe(t){return Sv(Pn(t.firestore,Hs),[new lv(t._key,yn.none())])}function Tpe(t,e){const r=Pn(t.firestore,Hs),n=pW(t),i=_D(t.converter,e);return Sv(r,[fD(Ev(t.firestore),"addDoc",n._key,i,t.converter!==null,{}).toMutation(n._key,yn.exists(!1))]).then(()=>n)}function Ape(t,...e){var r,n,i;t=Qe(t);let s={includeMetadataChanges:!1},o=0;typeof e[o]!="object"||cA(e[o])||(s=e[o],o++);const a={includeMetadataChanges:s.includeMetadataChanges};if(cA(e[o])){const h=e[o];e[o]=(r=h.next)===null||r===void 0?void 0:r.bind(h),e[o+1]=(n=h.error)===null||n===void 0?void 0:n.bind(h),e[o+2]=(i=h.complete)===null||i===void 0?void 0:i.bind(h)}let u,c,l;if(t instanceof En)c=Pn(t.firestore,Hs),l=fp(t._key.path),u={next:h=>{e[o]&&e[o](ED(c,t,h))},error:e[o+1],complete:e[o+2]};else{const h=Pn(t,eu);c=Pn(h.firestore,Hs),l=h._query;const d=new Fx(c);u={next:_=>{e[o]&&e[o](new wD(c,d,h,_))},error:e[o+1],complete:e[o+2]},vD(t._query)}return function(h,d,_,T){const D=new Dx(T),N=new Ax(d,D,_);return h.asyncQueue.enqueueAndForget(async()=>Sx(await $0(h),N)),()=>{D.bc(),h.asyncQueue.enqueueAndForget(async()=>Ix(await $0(h),N))}}(gp(c),l,a,u)}function Sv(t,e){return function(r,n){const i=new os;return r.asyncQueue.enqueueAndForget(async()=>XG(await vW(r),n,i)),i.promise}(gp(t),e)}function ED(t,e,r){const n=r.docs.get(e._key),i=new Fx(t);return new bD(t,i,e._key,n,new mh(r.hasPendingWrites,r.fromCache),e.converter)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function kpe(){return new mp("deleteField")}function Mpe(...t){return new TW("arrayUnion",t)}function Cpe(...t){return new AW("arrayRemove",t)}function Rpe(t){return new kW("increment",t)}(function(t,e=!0){(function(r){hf=r})(af),cs(new us("firestore",(r,{instanceIdentifier:n,options:i})=>{const s=r.getProvider("app").getImmediate(),o=new Hs(new kH(r.getProvider("auth-internal")),new NH(r.getProvider("app-check-internal")),function(a,u){if(!Object.prototype.hasOwnProperty.apply(a.options,["projectId"]))throw new Le(xe.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new tc(a.options.projectId,u)}(s,n),s);return i=Object.assign({useFetchStreams:e},i),o._setSettings(i),o},"PUBLIC").setMultipleInstances(!0)),On(fT,"3.7.3",t),On(fT,"3.7.3","esm2017")})();const FW="2.0.0",UW=256,qW=Number.MAX_SAFE_INTEGER||9007199254740991,jW=16;var Iv={SEMVER_SPEC_VERSION:FW,MAX_LENGTH:UW,MAX_SAFE_INTEGER:qW,MAX_SAFE_COMPONENT_LENGTH:jW},qa={exports:{}};const VW=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Tv=VW;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r}=Iv,n=Tv;e=t.exports={};const i=e.re=[],s=e.src=[],o=e.t={};let a=0;const u=(c,l,h)=>{const d=a++;n(c,d,l),o[c]=d,s[d]=l,i[d]=new RegExp(l,h?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${s[o.NUMERICIDENTIFIER]}|${s[o.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${s[o.NUMERICIDENTIFIERLOOSE]}|${s[o.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${s[o.PRERELEASEIDENTIFIER]}(?:\\.${s[o.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${s[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[o.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${s[o.BUILDIDENTIFIER]}(?:\\.${s[o.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${s[o.MAINVERSION]}${s[o.PRERELEASE]}?${s[o.BUILD]}?`),u("FULL",`^${s[o.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${s[o.MAINVERSIONLOOSE]}${s[o.PRERELEASELOOSE]}?${s[o.BUILD]}?`),u("LOOSE",`^${s[o.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${s[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${s[o.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:${s[o.PRERELEASE]})?${s[o.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:${s[o.PRERELEASELOOSE]})?${s[o.BUILD]}?)?)?`),u("XRANGE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),u("COERCERTL",s[o.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${s[o.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",u("TILDE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${s[o.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",u("CARET",`^${s[o.LONECARET]}${s[o.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${s[o.LONECARET]}${s[o.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${s[o.GTLT]}\\s*(${s[o.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]}|${s[o.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${s[o.XRANGEPLAIN]})\\s+-\\s+(${s[o.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${s[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[o.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(qa,qa.exports);const zW=["includePrerelease","loose","rtl"],HW=t=>t?typeof t!="object"?{loose:!0}:zW.filter(e=>t[e]).reduce((e,r)=>(e[r]=!0,e),{}):{};var Av=HW;const hA=/^[0-9]+$/,xD=(t,e)=>{const r=hA.test(t),n=hA.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:txD(e,t);var SD={compareIdentifiers:xD,rcompareIdentifiers:KW};const ug=Tv,{MAX_LENGTH:dA,MAX_SAFE_INTEGER:cg}=Iv,{re:pA,t:gA}=qa.exports,GW=Av,{compareIdentifiers:Bc}=SD;class Qi{constructor(e,r){if(r=GW(r),e instanceof Qi){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>dA)throw new TypeError(`version is longer than ${dA} characters`);ug("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?pA[gA.LOOSE]:pA[gA.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>cg||this.major<0)throw new TypeError("Invalid major version");if(this.minor>cg||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>cg||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}r&&(Bc(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}var $n=Qi;const{MAX_LENGTH:WW}=Iv,{re:mA,t:vA}=qa.exports,yA=$n,XW=Av,YW=(t,e)=>{if(e=XW(e),t instanceof yA)return t;if(typeof t!="string"||t.length>WW||!(e.loose?mA[vA.LOOSE]:mA[vA.FULL]).test(t))return null;try{return new yA(t,e)}catch{return null}};var yf=YW;const JW=yf,QW=(t,e)=>{const r=JW(t,e);return r?r.version:null};var ZW=QW;const eX=yf,tX=(t,e)=>{const r=eX(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var rX=tX;const _A=$n,nX=(t,e,r,n)=>{typeof r=="string"&&(n=r,r=void 0);try{return new _A(t instanceof _A?t.version:t,r).inc(e,n).version}catch{return null}};var iX=nX;const bA=$n,sX=(t,e,r)=>new bA(t,r).compare(new bA(e,r));var hs=sX;const oX=hs,aX=(t,e,r)=>oX(t,e,r)===0;var Ux=aX;const wA=yf,uX=Ux,cX=(t,e)=>{if(uX(t,e))return null;{const r=wA(t),n=wA(e),i=r.prerelease.length||n.prerelease.length,s=i?"pre":"",o=i?"prerelease":"";for(const a in r)if((a==="major"||a==="minor"||a==="patch")&&r[a]!==n[a])return s+a;return o}};var lX=cX;const fX=$n,hX=(t,e)=>new fX(t,e).major;var dX=hX;const pX=$n,gX=(t,e)=>new pX(t,e).minor;var mX=gX;const vX=$n,yX=(t,e)=>new vX(t,e).patch;var _X=yX;const bX=yf,wX=(t,e)=>{const r=bX(t,e);return r&&r.prerelease.length?r.prerelease:null};var EX=wX;const xX=hs,SX=(t,e,r)=>xX(e,t,r);var IX=SX;const TX=hs,AX=(t,e)=>TX(t,e,!0);var kX=AX;const EA=$n,MX=(t,e,r)=>{const n=new EA(t,r),i=new EA(e,r);return n.compare(i)||n.compareBuild(i)};var qx=MX;const CX=qx,RX=(t,e)=>t.sort((r,n)=>CX(r,n,e));var NX=RX;const OX=qx,DX=(t,e)=>t.sort((r,n)=>OX(n,r,e));var PX=DX;const LX=hs,BX=(t,e,r)=>LX(t,e,r)>0;var kv=BX;const $X=hs,FX=(t,e,r)=>$X(t,e,r)<0;var jx=FX;const UX=hs,qX=(t,e,r)=>UX(t,e,r)!==0;var ID=qX;const jX=hs,VX=(t,e,r)=>jX(t,e,r)>=0;var Vx=VX;const zX=hs,HX=(t,e,r)=>zX(t,e,r)<=0;var zx=HX;const KX=Ux,GX=ID,WX=kv,XX=Vx,YX=jx,JX=zx,QX=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return KX(t,r,n);case"!=":return GX(t,r,n);case">":return WX(t,r,n);case">=":return XX(t,r,n);case"<":return YX(t,r,n);case"<=":return JX(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var TD=QX;const ZX=$n,eY=yf,{re:lg,t:fg}=qa.exports,tY=(t,e)=>{if(t instanceof ZX)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(lg[fg.COERCE]);else{let n;for(;(n=lg[fg.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),lg[fg.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;lg[fg.COERCERTL].lastIndex=-1}return r===null?null:eY(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var rY=tY,nY=Lt;Lt.Node=cc;Lt.create=Lt;function Lt(t){var e=this;if(e instanceof Lt||(e=new Lt),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};Lt.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};Lt.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};Lt.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};Lt.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Lt;if(ethis.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&nthis.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};Lt.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n1;class uY{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[xu]=e.max||1/0;const r=e.length||T_;if(this[$c]=typeof r!="function"?T_:r,this[Lh]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Mu]=e.maxAge||0,this[ao]=e.dispose,this[xA]=e.noDisposeOnSet||!1,this[AD]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[xu]=e||1/0,zf(this)}get max(){return this[xu]}set allowStale(e){this[Lh]=!!e}get allowStale(){return this[Lh]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Mu]=e,zf(this)}get maxAge(){return this[Mu]}set lengthCalculator(e){typeof e!="function"&&(e=T_),e!==this[$c]&&(this[$c]=e,this[uo]=0,this[$r].forEach(r=>{r.length=this[$c](r.value,r.key),this[uo]+=r.length})),zf(this)}get lengthCalculator(){return this[$c]}get length(){return this[uo]}get itemCount(){return this[$r].length}rforEach(e,r){r=r||this;for(let n=this[$r].tail;n!==null;){const i=n.prev;SA(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[$r].head;n!==null;){const i=n.next;SA(this,e,n,r),n=i}}keys(){return this[$r].toArray().map(e=>e.key)}values(){return this[$r].toArray().map(e=>e.value)}reset(){this[ao]&&this[$r]&&this[$r].length&&this[$r].forEach(e=>this[ao](e.key,e.value)),this[Zi]=new Map,this[$r]=new aY,this[uo]=0}dump(){return this[$r].map(e=>U0(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[$r]}set(e,r,n){if(n=n||this[Mu],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[$c](r,e);if(this[Zi].has(e)){if(s>this[xu])return gl(this,this[Zi].get(e)),!1;const u=this[Zi].get(e).value;return this[ao]&&(this[xA]||this[ao](e,u.value)),u.now=i,u.maxAge=n,u.value=r,this[uo]+=s-u.length,u.length=s,this.get(e),zf(this),!0}const o=new cY(e,r,s,i,n);return o.length>this[xu]?(this[ao]&&this[ao](e,r),!1):(this[uo]+=o.length,this[$r].unshift(o),this[Zi].set(e,this[$r].head),zf(this),!0)}has(e){if(!this[Zi].has(e))return!1;const r=this[Zi].get(e).value;return!U0(this,r)}get(e){return A_(this,e,!0)}peek(e){return A_(this,e,!1)}pop(){const e=this[$r].tail;return e?(gl(this,e),e.value):null}del(e){gl(this,this[Zi].get(e))}load(e){this.reset();const r=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Zi].forEach((e,r)=>A_(this,r,!1))}}const A_=(t,e,r)=>{const n=t[Zi].get(e);if(n){const i=n.value;if(U0(t,i)){if(gl(t,n),!t[Lh])return}else r&&(t[AD]&&(n.value.now=Date.now()),t[$r].unshiftNode(n));return i.value}},U0=(t,e)=>{if(!e||!e.maxAge&&!t[Mu])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[Mu]&&r>t[Mu]},zf=t=>{if(t[uo]>t[xu])for(let e=t[$r].tail;t[uo]>t[xu]&&e!==null;){const r=e.prev;gl(t,e),e=r}},gl=(t,e)=>{if(e){const r=e.value;t[ao]&&t[ao](r.key,r.value),t[uo]-=r.length,t[Zi].delete(r.key),t[$r].removeNode(e)}};class cY{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const SA=(t,e,r,n)=>{let i=r.value;U0(t,i)&&(gl(t,r),t[Lh]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var lY=uY;class Bh{constructor(e,r){if(r=hY(r),e instanceof Bh)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new Bh(e.raw,r);if(e instanceof k1)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e,this.set=e.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){const n=this.set[0];if(this.set=this.set.filter(i=>!TA(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(const i of this.set)if(i.length===1&&vY(i[0])){this.set=[i];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const n=`parseRange:${Object.keys(this.options).join(",")}:${e}`,i=IA.get(n);if(i)return i;const s=this.options.loose,o=s?zn[Mn.HYPHENRANGELOOSE]:zn[Mn.HYPHENRANGE];e=e.replace(o,AY(this.options.includePrerelease)),hr("hyphen replace",e),e=e.replace(zn[Mn.COMPARATORTRIM],pY),hr("comparator trim",e),e=e.replace(zn[Mn.TILDETRIM],gY),e=e.replace(zn[Mn.CARETTRIM],mY),e=e.split(/\s+/).join(" ");let a=e.split(" ").map(h=>yY(h,this.options)).join(" ").split(/\s+/).map(h=>TY(h,this.options));s&&(a=a.filter(h=>(hr("loose invalid filter",h,this.options),!!h.match(zn[Mn.COMPARATORLOOSE])))),hr("range list",a);const u=new Map,c=a.map(h=>new k1(h,this.options));for(const h of c){if(TA(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");const l=[...u.values()];return IA.set(n,l),l}intersects(e,r){if(!(e instanceof Bh))throw new TypeError("a Range is required");return this.set.some(n=>AA(n,r)&&e.set.some(i=>AA(i,r)&&n.every(s=>i.every(o=>s.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new dY(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0",vY=t=>t.value==="",AA=(t,e)=>{let r=!0;const n=t.slice();let i=n.pop();for(;r&&n.length;)r=n.every(s=>i.intersects(s,e)),i=n.pop();return r},yY=(t,e)=>(hr("comp",t,e),t=wY(t,e),hr("caret",t),t=_Y(t,e),hr("tildes",t),t=xY(t,e),hr("xrange",t),t=IY(t,e),hr("stars",t),t),Cn=t=>!t||t.toLowerCase()==="x"||t==="*",_Y=(t,e)=>t.trim().split(/\s+/).map(r=>bY(r,e)).join(" "),bY=(t,e)=>{const r=e.loose?zn[Mn.TILDELOOSE]:zn[Mn.TILDE];return t.replace(r,(n,i,s,o,a)=>{hr("tilde",t,n,i,s,o,a);let u;return Cn(i)?u="":Cn(s)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:Cn(o)?u=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?(hr("replaceTilde pr",a),u=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):u=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,hr("tilde return",u),u})},wY=(t,e)=>t.trim().split(/\s+/).map(r=>EY(r,e)).join(" "),EY=(t,e)=>{hr("caret",t,e);const r=e.loose?zn[Mn.CARETLOOSE]:zn[Mn.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,s,o,a,u)=>{hr("caret",t,i,s,o,a,u);let c;return Cn(s)?c="":Cn(o)?c=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Cn(a)?s==="0"?c=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(hr("replaceCaret pr",u),s==="0"?o==="0"?c=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(hr("no pr"),s==="0"?o==="0"?c=`>=${s}.${o}.${a}${n} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}${n} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),hr("caret return",c),c})},xY=(t,e)=>(hr("replaceXRanges",t,e),t.split(/\s+/).map(r=>SY(r,e)).join(" ")),SY=(t,e)=>{t=t.trim();const r=e.loose?zn[Mn.XRANGELOOSE]:zn[Mn.XRANGE];return t.replace(r,(n,i,s,o,a,u)=>{hr("xRange",t,n,i,s,o,a,u);const c=Cn(s),l=c||Cn(o),h=l||Cn(a),d=h;return i==="="&&d&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&d?(l&&(o=0),a=0,i===">"?(i=">=",l?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",l?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${a}${u}`):l?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),hr("xRange return",n),n})},IY=(t,e)=>(hr("replaceStars",t,e),t.trim().replace(zn[Mn.STAR],"")),TY=(t,e)=>(hr("replaceGTE0",t,e),t.trim().replace(zn[e.includePrerelease?Mn.GTE0PRE:Mn.GTE0],"")),AY=t=>(e,r,n,i,s,o,a,u,c,l,h,d,_)=>(Cn(n)?r="":Cn(i)?r=`>=${n}.0.0${t?"-0":""}`:Cn(s)?r=`>=${n}.${i}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Cn(c)?u="":Cn(l)?u=`<${+c+1}.0.0-0`:Cn(h)?u=`<${c}.${+l+1}.0-0`:d?u=`<=${c}.${l}.${h}-${d}`:t?u=`<${c}.${l}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),kY=(t,e,r)=>{for(let n=0;n0){const i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0},Hf=Symbol("SemVer ANY");class q0{static get ANY(){return Hf}constructor(e,r){if(r=MY(r),e instanceof q0){if(e.loose===!!r.loose)return e;e=e.value}M_("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Hf?this.value="":this.value=this.operator+this.semver.version,M_("comp",this)}parse(e){const r=this.options.loose?kA[MA.COMPARATORLOOSE]:kA[MA.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new CA(n[2],this.options.loose):this.semver=Hf}toString(){return this.value}test(e){if(M_("Comparator.test",e,this.options.loose),this.semver===Hf||e===Hf)return!0;if(typeof e=="string")try{e=new CA(e,this.options)}catch{return!1}return k_(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof q0))throw new TypeError("a Comparator is required");if((!r||typeof r!="object")&&(r={loose:!!r,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new RA(e.value,r).test(this.value);if(e.operator==="")return e.value===""?!0:new RA(this.value,r).test(e.semver);const n=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),i=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),s=this.semver.version===e.semver.version,o=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),a=k_(this.semver,"<",e.semver,r)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),u=k_(this.semver,">",e.semver,r)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||i||s&&o||a||u}}var Mv=q0;const MY=Av,{re:kA,t:MA}=qa.exports,k_=TD,M_=Tv,CA=$n,RA=ds,CY=ds,RY=(t,e,r)=>{try{e=new CY(e,r)}catch{return!1}return e.test(t)};var Cv=RY;const NY=ds,OY=(t,e)=>new NY(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var DY=OY;const PY=$n,LY=ds,BY=(t,e,r)=>{let n=null,i=null,s=null;try{s=new LY(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new PY(n,r))}),n};var $Y=BY;const FY=$n,UY=ds,qY=(t,e,r)=>{let n=null,i=null,s=null;try{s=new UY(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new FY(n,r))}),n};var jY=qY;const C_=$n,VY=ds,NA=kv,zY=(t,e)=>{t=new VY(t,e);let r=new C_("0.0.0");if(t.test(r)||(r=new C_("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const a=new C_(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||NA(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||NA(r,s))&&(r=s)}return r&&t.test(r)?r:null};var HY=zY;const KY=ds,GY=(t,e)=>{try{return new KY(t,e).range||"*"}catch{return null}};var WY=GY;const XY=$n,kD=Mv,{ANY:YY}=kD,JY=ds,QY=Cv,OA=kv,DA=jx,ZY=zx,eJ=Vx,tJ=(t,e,r,n)=>{t=new XY(t,n),e=new JY(e,n);let i,s,o,a,u;switch(r){case">":i=OA,s=ZY,o=DA,a=">",u=">=";break;case"<":i=DA,s=eJ,o=OA,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(QY(t,e,n))return!1;for(let c=0;c{_.semver===YY&&(_=new kD(">=0.0.0")),h=h||_,d=d||_,i(_.semver,h.semver,n)?h=_:o(_.semver,d.semver,n)&&(d=_)}),h.operator===a||h.operator===u||(!d.operator||d.operator===a)&&s(t,d.semver))return!1;if(d.operator===u&&o(t,d.semver))return!1}return!0};var Hx=tJ;const rJ=Hx,nJ=(t,e,r)=>rJ(t,e,">",r);var iJ=nJ;const sJ=Hx,oJ=(t,e,r)=>sJ(t,e,"<",r);var aJ=oJ;const PA=ds,uJ=(t,e,r)=>(t=new PA(t,r),e=new PA(e,r),t.intersects(e));var cJ=uJ;const lJ=Cv,fJ=hs;var hJ=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((l,h)=>fJ(l,h,r));for(const l of o)lJ(l,e,r)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[l,h]of n)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);const u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length{if(t===e)return!0;t=new LA(t,r),e=new LA(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=pJ(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},pJ=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===R_){if(e.length===1&&e[0].semver===R_)return!0;r.includePrerelease?t=[new Lg(">=0.0.0-0")]:t=[new Lg(">=0.0.0")]}if(e.length===1&&e[0].semver===R_){if(r.includePrerelease)return!0;e=[new Lg(">=0.0.0")]}const n=new Set;let i,s;for(const _ of t)_.operator===">"||_.operator===">="?i=BA(i,_,r):_.operator==="<"||_.operator==="<="?s=$A(s,_,r):n.add(_.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Kx(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const _ of n){if(i&&!Kf(_,String(i),r)||s&&!Kf(_,String(s),r))return null;for(const T of e)if(!Kf(_,String(T),r))return!1;return!0}let a,u,c,l,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const _ of e){if(l=l||_.operator===">"||_.operator===">=",c=c||_.operator==="<"||_.operator==="<=",i){if(d&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===d.major&&_.semver.minor===d.minor&&_.semver.patch===d.patch&&(d=!1),_.operator===">"||_.operator===">="){if(a=BA(i,_,r),a===_&&a!==i)return!1}else if(i.operator===">="&&!Kf(i.semver,String(_),r))return!1}if(s){if(h&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===h.major&&_.semver.minor===h.minor&&_.semver.patch===h.patch&&(h=!1),_.operator==="<"||_.operator==="<="){if(u=$A(s,_,r),u===_&&u!==s)return!1}else if(s.operator==="<="&&!Kf(s.semver,String(_),r))return!1}if(!_.operator&&(s||i)&&o!==0)return!1}return!(i&&c&&!s&&o!==0||s&&l&&!i&&o!==0||d||h)},BA=(t,e,r)=>{if(!t)return e;const n=Kx(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},$A=(t,e,r)=>{if(!t)return e;const n=Kx(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var gJ=dJ;const N_=qa.exports,mJ=Iv,vJ=$n,FA=SD,yJ=yf,_J=ZW,bJ=rX,wJ=iX,EJ=lX,xJ=dX,SJ=mX,IJ=_X,TJ=EX,AJ=hs,kJ=IX,MJ=kX,CJ=qx,RJ=NX,NJ=PX,OJ=kv,DJ=jx,PJ=Ux,LJ=ID,BJ=Vx,$J=zx,FJ=TD,UJ=rY,qJ=Mv,jJ=ds,VJ=Cv,zJ=DY,HJ=$Y,KJ=jY,GJ=HY,WJ=WY,XJ=Hx,YJ=iJ,JJ=aJ,QJ=cJ,ZJ=hJ,eQ=gJ;var Npe={parse:yJ,valid:_J,clean:bJ,inc:wJ,diff:EJ,major:xJ,minor:SJ,patch:IJ,prerelease:TJ,compare:AJ,rcompare:kJ,compareLoose:MJ,compareBuild:CJ,sort:RJ,rsort:NJ,gt:OJ,lt:DJ,eq:PJ,neq:LJ,gte:BJ,lte:$J,cmp:FJ,coerce:UJ,Comparator:qJ,Range:jJ,satisfies:VJ,toComparators:zJ,maxSatisfying:HJ,minSatisfying:KJ,minVersion:GJ,validRange:WJ,outside:XJ,gtr:YJ,ltr:JJ,intersects:QJ,simplifyRange:ZJ,subset:eQ,SemVer:vJ,re:N_.re,src:N_.src,tokens:N_.t,SEMVER_SPEC_VERSION:mJ.SEMVER_SPEC_VERSION,compareIdentifiers:FA.compareIdentifiers,rcompareIdentifiers:FA.rcompareIdentifiers};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const tQ="type.googleapis.com/google.protobuf.Int64Value",rQ="type.googleapis.com/google.protobuf.UInt64Value";function MD(t,e){const r={};for(const n in t)t.hasOwnProperty(n)&&(r[n]=e(t[n]));return r}function M1(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=>M1(e));if(typeof t=="function"||typeof t=="object")return MD(t,e=>M1(e));throw new Error("Data cannot be encoded in JSON: "+t)}function j0(t){if(t==null)return t;if(t["@type"])switch(t["@type"]){case tQ:case rQ:{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=>j0(e)):typeof t=="function"||typeof t=="object"?MD(t,e=>j0(e)):t}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Gx="functions";/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const UA={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 ml extends Fi{constructor(e,r,n){super(`${Gx}/${e}`,r||""),this.details=n}}function nQ(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 iQ(t,e){let r=nQ(t),n=r,i;try{const s=e&&e.error;if(s){const o=s.status;if(typeof o=="string"){if(!UA[o])return new ml("internal","internal");r=UA[o],n=o}const a=s.message;typeof a=="string"&&(n=a),i=s.details,i!==void 0&&(i=j0(i))}}catch{}return r==="ok"?null:new ml(r,n,i)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class sQ{constructor(e,r,n){this.auth=null,this.messaging=null,this.appCheck=null,this.auth=e.getImmediate({optional:!0}),this.messaging=r.getImmediate({optional:!0}),this.auth||e.get().then(i=>this.auth=i,()=>{}),this.messaging||r.get().then(i=>this.messaging=i,()=>{}),this.appCheck||n.get().then(i=>this.appCheck=i,()=>{})}async getAuthToken(){if(!!this.auth)try{const e=await this.auth.getToken();return e==null?void 0:e.accessToken}catch{return}}async getMessagingToken(){if(!(!this.messaging||!("Notification"in self)||Notification.permission!=="granted"))try{return await this.messaging.getToken()}catch{return}}async getAppCheckToken(){if(this.appCheck){const e=await this.appCheck.getToken();return e.error?null:e.token}return null}async getContext(){const e=await this.getAuthToken(),r=await this.getMessagingToken(),n=await this.getAppCheckToken();return{authToken:e,messagingToken:r,appCheckToken:n}}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const C1="us-central1";function oQ(t){let e=null;return{promise:new Promise((r,n)=>{e=setTimeout(()=>{n(new ml("deadline-exceeded","deadline-exceeded"))},t)}),cancel:()=>{e&&clearTimeout(e)}}}class aQ{constructor(e,r,n,i,s=C1,o){this.app=e,this.fetchImpl=o,this.emulatorOrigin=null,this.contextProvider=new sQ(r,n,i),this.cancelAllRequests=new Promise(a=>{this.deleteService=()=>Promise.resolve(a())});try{const a=new URL(s);this.customDomain=a.origin,this.region=C1}catch{this.customDomain=null,this.region=s}}_delete(){return this.deleteService()}_url(e){const r=this.app.options.projectId;return this.emulatorOrigin!==null?`${this.emulatorOrigin}/${r}/${this.region}/${e}`:this.customDomain!==null?`${this.customDomain}/${e}`:`https://${this.region}-${r}.cloudfunctions.net/${e}`}}function uQ(t,e,r){t.emulatorOrigin=`http://${e}:${r}`}function cQ(t,e,r){return n=>fQ(t,e,n,r||{})}async function lQ(t,e,r,n){r["Content-Type"]="application/json";let i;try{i=await n(t,{method:"POST",body:JSON.stringify(e),headers:r})}catch{return{status:0,json:null}}let s=null;try{s=await i.json()}catch{}return{status:i.status,json:s}}function fQ(t,e,r,n){const i=t._url(e);return hQ(t,i,r,n)}async function hQ(t,e,r,n){r=M1(r);const i={data:r},s={},o=await t.contextProvider.getContext();o.authToken&&(s.Authorization="Bearer "+o.authToken),o.messagingToken&&(s["Firebase-Instance-ID-Token"]=o.messagingToken),o.appCheckToken!==null&&(s["X-Firebase-AppCheck"]=o.appCheckToken);const a=n.timeout||7e4,u=oQ(a),c=await Promise.race([lQ(e,i,s,t.fetchImpl),u.promise,t.cancelAllRequests]);if(u.cancel(),!c)throw new ml("cancelled","Firebase Functions instance was deleted.");const l=iQ(c.status,c.json);if(l)throw l;if(!c.json)throw new ml("internal","Response is not valid JSON object.");let h=c.json.data;if(typeof h=="undefined"&&(h=c.json.result),typeof h=="undefined")throw new ml("internal","Response is missing data field.");return{data:j0(h)}}const qA="@firebase/functions",jA="0.8.8";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const dQ="auth-internal",pQ="app-check-internal",gQ="messaging-internal";function mQ(t,e){const r=(n,{instanceIdentifier:i})=>{const s=n.getProvider("app").getImmediate(),o=n.getProvider(dQ),a=n.getProvider(gQ),u=n.getProvider(pQ);return new aQ(s,o,a,u,i,t)};cs(new us(Gx,r,"PUBLIC").setMultipleInstances(!0)),On(qA,jA,e),On(qA,jA,"esm2017")}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Ope(t=Jd(),e=C1){const n=zo(Qe(t),Gx).getImmediate({identifier:e}),i=M3("functions");return i&&vQ(n,...i),n}function vQ(t,e,r){uQ(Qe(t),e,r)}function Dpe(t,e,r){return cQ(Qe(t),e,r)}mQ(fetch.bind(self));var wr=Uint8Array,Nn=Uint16Array,Cd=Uint32Array,Rv=new wr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Nv=new wr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),R1=new wr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),CD=function(t,e){for(var r=new Nn(31),n=0;n<31;++n)r[n]=e+=1<>>1|(or&21845)<<1;ta=(ta&52428)>>>2|(ta&13107)<<2,ta=(ta&61680)>>>4|(ta&3855)<<4,O1[or]=((ta&65280)>>>8|(ta&255)<<8)>>>1}var Bs=function(t,e,r){for(var n=t.length,i=0,s=new Nn(e);i>>u]=c}else for(a=new Nn(n),i=0;i>>15-t[i]);return a},ja=new wr(288);for(var or=0;or<144;++or)ja[or]=8;for(var or=144;or<256;++or)ja[or]=9;for(var or=256;or<280;++or)ja[or]=7;for(var or=280;or<288;++or)ja[or]=8;var Rd=new wr(32);for(var or=0;or<32;++or)Rd[or]=5;var _Q=Bs(ja,9,0),bQ=Bs(ja,9,1),wQ=Bs(Rd,5,0),EQ=Bs(Rd,5,1),O_=function(t){for(var e=t[0],r=1;re&&(e=t[r]);return e},Xi=function(t,e,r){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&r},D_=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},Wx=function(t){return(t/8|0)+(t&7&&1)},vp=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var n=new(t instanceof Nn?Nn:t instanceof Cd?Cd:wr)(r-e);return n.set(t.subarray(e,r)),n},xQ=function(t,e,r){var n=t.length;if(!n||r&&!r.l&&n<5)return e||new wr(0);var i=!e||r,s=!r||r.i;r||(r={}),e||(e=new wr(n*3));var o=function(k){var R=e.length;if(k>R){var j=new wr(Math.max(R*2,k));j.set(e),e=j}},a=r.f||0,u=r.p||0,c=r.b||0,l=r.l,h=r.d,d=r.m,_=r.n,T=n*8;do{if(!l){r.f=a=Xi(t,u,1);var D=Xi(t,u+1,3);if(u+=3,D)if(D==1)l=bQ,h=EQ,d=9,_=5;else if(D==2){var J=Xi(t,u,31)+257,q=Xi(t,u+10,15)+4,z=J+Xi(t,u+5,31)+1;u+=14;for(var ee=new wr(z),G=new wr(19),ne=0;ne>>4;if(N<16)ee[ne++]=N;else{var g=0,f=0;for(N==16?(f=3+Xi(t,u,3),u+=2,g=ee[ne-1]):N==17?(f=3+Xi(t,u,7),u+=3):N==18&&(f=11+Xi(t,u,127),u+=7);f--;)ee[ne++]=g}}var p=ee.subarray(0,J),y=ee.subarray(J);d=O_(p),_=O_(y),l=Bs(p,d,1),h=Bs(y,_,1)}else throw"invalid block type";else{var N=Wx(u)+4,O=t[N-4]|t[N-3]<<8,L=N+O;if(L>n){if(s)throw"unexpected EOF";break}i&&o(c+O),e.set(t.subarray(N,L),c),r.b=c+=O,r.p=u=L*8;continue}if(u>T){if(s)throw"unexpected EOF";break}}i&&o(c+131072);for(var I=(1<>>4;if(u+=g&15,u>T){if(s)throw"unexpected EOF";break}if(!g)throw"invalid length/literal";if(v<256)e[c++]=v;else if(v==256){A=u,l=null;break}else{var S=v-254;if(v>264){var ne=v-257,w=Rv[ne];S=Xi(t,u,(1<>>4;if(!U)throw"invalid distance";u+=U&15;var y=yQ[me];if(me>3){var w=Nv[me];y+=D_(t,u)&(1<T){if(s)throw"unexpected EOF";break}i&&o(c+131072);for(var x=c+S;c>>8},Gf=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},P_=function(t,e){for(var r=[],n=0;nd&&(d=s[n].s);var _=new Nn(d+1),T=D1(r[l-1],_,0);if(T>e){var n=0,D=0,N=T-e,O=1<e)D+=O-(1<>>=N;D>0;){var J=s[n].s;_[J]=0&&D;--n){var q=s[n].s;_[q]==e&&(--_[q],++D)}T=e}return[new wr(_),T]},D1=function(t,e,r){return t.s==-1?Math.max(D1(t.l,e,r+1),D1(t.r,e,r+1)):e[t.s]=r},zA=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Nn(++e),n=0,i=t[0],s=1,o=function(u){r[n++]=u},a=1;a<=e;++a)if(t[a]==i&&a!=e)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=t[a]}return[r.subarray(0,n),e]},Wf=function(t,e){for(var r=0,n=0;n>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var s=0;s4&&!_e[R1[m-1]];--m);var g=c+5<<3,f=Wf(i,ja)+Wf(s,Rd)+o,p=Wf(i,d)+Wf(s,D)+o+14+3*m+Wf(G,_e)+(2*G[16]+3*G[17]+7*G[18]);if(g<=f&&g<=p)return Bg(e,l,t.subarray(u,u+c));var y,I,M,A;if(io(e,l,1+(p15&&(io(e,l,U[ne]>>>5&127),l+=U[ne]>>>12)}}else y=_Q,I=ja,M=wQ,A=Rd;for(var ne=0;ne255){var me=n[ne]>>>18&31;Gf(e,l,y[me+257]),l+=I[me+257],me>7&&(io(e,l,n[ne]>>>23&31),l+=Rv[me]);var x=n[ne]&31;Gf(e,l,M[x]),l+=A[x],x>3&&(Gf(e,l,n[ne]>>>5&8191),l+=Nv[x])}else Gf(e,l,y[n[ne]]),l+=I[n[ne]];return Gf(e,l,y[256]),l+I[256]},SQ=new Cd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Xx=new wr(0),IQ=function(t,e,r,n,i,s){var o=t.length,a=new wr(n+o+5*(1+Math.ceil(o/7e3))+i),u=a.subarray(n,a.length-i),c=0;if(!e||o<8)for(var l=0;l<=o;l+=65535){var h=l+65535;h>>13,T=d&8191,D=(1<7e3||_e>24576)&&y>423){c=HA(t,u,0,z,ee,G,ue,_e,m,l-m,c),_e=ne=ue=0,m=l;for(var I=0;I<286;++I)ee[I]=0;for(var I=0;I<30;++I)G[I]=0}var M=2,A=0,v=T,S=f-p&32767;if(y>2&&g==q(l-S))for(var w=Math.min(_,y)-1,U=Math.min(32767,l),me=Math.min(258,y);S<=U&&--v&&f!=p;){if(t[l+M]==t[l+M-S]){for(var x=0;xM){if(M=x,A=S,x>w)break;for(var k=Math.min(S,x-2),R=0,I=0;IR&&(R=oe,p=j)}}}f=p,p=N[f],S+=f-p+32768&32767}if(A){z[_e++]=268435456|N1[M]<<18|VA[A];var fe=N1[M]&31,ie=VA[A]&31;ue+=Rv[fe]+Nv[ie],++ee[257+fe],++G[ie],F=l+M,++ne}else z[_e++]=t[l],++ee[t[l]]}}c=HA(t,u,s,z,ee,G,ue,_e,m,l-m,c),!s&&c&7&&(c=Bg(u,c+1,Xx))}return vp(a,0,n+Wx(c)+i)},TQ=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(r&1&&-306674912)^r>>>1;t[e]=r}return t}(),AQ=function(){var t=-1;return{p:function(e){for(var r=t,n=0;n>>8;t=r},d:function(){return~t}}},kQ=function(t,e,r,n,i){return IQ(t,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):12+e.mem,r,n,!i)},DD=function(t,e){var r={};for(var n in t)r[n]=t[n];for(var n in e)r[n]=e[n];return r},Cs=function(t,e){return t[e]|t[e+1]<<8},ns=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},L_=function(t,e){return ns(t,e)+ns(t,e+4)*4294967296},Yr=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function MQ(t,e){return kQ(t,e||{},0,0)}function CQ(t,e){return xQ(t,e)}var PD=function(t,e,r,n){for(var i in t){var s=t[i],o=e+i;s instanceof wr?r[o]=[s,n]:Array.isArray(s)?r[o]=[s[0],DD(n,s[1])]:PD(s,o+"/",r,n)}},KA=typeof TextEncoder!="undefined"&&new TextEncoder,P1=typeof TextDecoder!="undefined"&&new TextDecoder,RQ=0;try{P1.decode(Xx,{stream:!0}),RQ=1}catch{}var NQ=function(t){for(var e="",r=0;;){var n=t[r++],i=(n>127)+(n>223)+(n>239);if(r+i>t.length)return[e,vp(t,r-1)];i?i==3?(n=((n&15)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?e+=String.fromCharCode((n&31)<<6|t[r++]&63):e+=String.fromCharCode((n&15)<<12|(t[r++]&63)<<6|t[r++]&63):e+=String.fromCharCode(n)}};function GA(t,e){if(e){for(var r=new wr(t.length),n=0;n>1)),o=0,a=function(l){s[o++]=l},n=0;ns.length){var u=new wr(o+8+(i-n<<1));u.set(s),s=u}var c=t.charCodeAt(n);c<128||e?a(c):c<2048?(a(192|c>>6),a(128|c&63)):c>55295&&c<57344?(c=65536+(c&1023<<10)|t.charCodeAt(++n)&1023,a(240|c>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|c&63)):(a(224|c>>12),a(128|c>>6&63),a(128|c&63))}return vp(s,0,o)}function OQ(t,e){if(e){for(var r="",n=0;n65535)throw"extra field too long";e+=n+4}return e},WA=function(t,e,r,n,i,s,o,a){var u=n.length,c=r.extra,l=a&&a.length,h=L1(c);Yr(t,e,o!=null?33639248:67324752),e+=4,o!=null&&(t[e++]=20,t[e++]=r.os),t[e]=20,e+=2,t[e++]=r.flag<<1|(s==null&&8),t[e++]=i&&8,t[e++]=r.compression&255,t[e++]=r.compression>>8;var d=new Date(r.mtime==null?Date.now():r.mtime),_=d.getFullYear()-1980;if(_<0||_>119)throw"date not in range 1980-2099";if(Yr(t,e,_<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),e+=4,s!=null&&(Yr(t,e,r.crc),Yr(t,e+4,s),Yr(t,e+8,r.size)),Yr(t,e+12,u),Yr(t,e+14,h),e+=16,o!=null&&(Yr(t,e,l),Yr(t,e+6,r.attrs),Yr(t,e+10,o),e+=14),t.set(n,e),e+=u,h)for(var T in c){var D=c[T],N=D.length;Yr(t,e,+T),Yr(t,e+2,N),t.set(D,e+4),e+=4+N}return l&&(t.set(a,e),e+=l),e},BQ=function(t,e,r,n,i){Yr(t,e,101010256),Yr(t,e+8,r),Yr(t,e+10,r),Yr(t,e+12,n),Yr(t,e+16,i)};function Ppe(t,e){e||(e={});var r={},n=[];PD(t,"",r,e);var i=0,s=0;for(var o in r){var a=r[o],u=a[0],c=a[1],l=c.level==0?0:8,h=GA(o),d=h.length,_=c.comment,T=_&&GA(_),D=T&&T.length,N=L1(c.extra);if(d>65535)throw"filename too long";var O=l?MQ(u,c):u,L=O.length,J=AQ();J.p(u),n.push(DD(c,{size:u.length,crc:J.d(),c:O,f:h,m:T,u:d!=o.length||T&&_.length!=D,o:i,compression:l})),i+=30+d+N+L,s+=76+2*(d+N)+(D||0)+L}for(var q=new wr(s+22),z=i,ee=s-i,G=0;G65558)throw"invalid zip file";var n=Cs(t,r+8);if(!n)return{};var i=ns(t,r+16),s=i==4294967295;if(s){if(r=ns(t,r-12),ns(t,r)!=101075792)throw"invalid zip file";n=ns(t,r+32),i=ns(t,r+48)}for(var o=0;oObject.defineProperty(t,e,{value:r}),HQ=/([0-z])-([0-z])/g,$D=()=>!1,KQ=t=>t.replace(HQ,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:LD),GQ=t=>{const{length:e}=t;return t.slice(0,e-e%2)},WQ=[[/\\?\s+$/,t=>t.indexOf("\\")===0?YA:LD],[/\\\s/g,()=>YA],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6{const n=r.replace(/\\\*/g,"[^\\/]*");return e+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>B_],[/\\\\/g,()=>B_],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===B_?`\\[${r}${GQ(n)}${i}`:i==="]"&&n.length%2===0?`[${KQ(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],QA=Object.create(null),XQ=(t,e)=>{let r=QA[t];return r||(r=WQ.reduce((n,i)=>n.replace(i[0],i[1].bind(t)),t),QA[t]=r),e?new RegExp(r,"i"):new RegExp(r)},Yx=t=>typeof t=="string",YQ=t=>t&&Yx(t)&&!$Q.test(t)&&!FQ.test(t)&&t.indexOf("#")!==0,JQ=t=>t.split(jQ);class QQ{constructor(e,r,n,i){this.origin=e,this.pattern=r,this.negative=n,this.regex=i}}const ZQ=(t,e)=>{const r=t;let n=!1;t.indexOf("!")===0&&(n=!0,t=t.substr(1)),t=t.replace(UQ,"!").replace(qQ,"#");const i=XQ(t,e);return new QQ(r,t,n,i)},eZ=(t,e)=>{throw new e(t)},Po=(t,e,r)=>Yx(t)?t?Po.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),FD=t=>VQ.test(t);Po.isNotRelative=FD;Po.convert=t=>t;class tZ{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){zQ(this,JA,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[JA]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(YQ(e)){const r=ZQ(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,XA(Yx(e)?JQ(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let n=!1,i=!1;return this._rules.forEach(s=>{const{negative:o}=s;if(i===o&&n!==i||o&&!n&&!i&&!r)return;s.regex.test(e)&&(n=!o,i=o)}),{ignored:n,unignored:i}}_test(e,r,n,i){const s=e&&Po.convert(e);return Po(s,e,this._allowRelativePaths?$D:eZ),this._t(s,r,n,i)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split($_)),i.pop(),!i.length)return r[e]=this._testOne(e,n);const s=this._t(i.join($_)+$_,r,n,i);return r[e]=s.ignored?s:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return XA(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}const B1=t=>new tZ(t),rZ=t=>Po(t&&Po.convert(t),t,$D);B1.isPathValid=rZ;B1.default=B1;if(typeof process!="undefined"&&(process.env&&{}.IGNORE_TEST_WIN32||process.platform==="win32")){const t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Po.convert=t;const e=/^[a-z]:\//i;Po.isNotRelative=r=>e.test(r)||FD(r)}/*! * vue-router v4.0.12 * (c) 2021 Eduardo San Martin Morote * @license MIT */const UD=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",_f=t=>UD?Symbol(t):"_vr_"+t,nZ=_f("rvlm"),ZA=_f("rvd"),Jx=_f("r"),Qx=_f("rl"),$1=_f("rvl"),Gc=typeof window!="undefined";function iZ(t){return t.__esModule||UD&&t[Symbol.toStringTag]==="Module"}const rr=Object.assign;function F_(t,e){const r={};for(const n in e){const i=e[n];r[n]=Array.isArray(i)?i.map(t):t(i)}return r}const $h=()=>{},sZ=/\/$/,oZ=t=>t.replace(sZ,"");function U_(t,e,r="/"){let n,i={},s="",o="";const a=e.indexOf("?"),u=e.indexOf("#",a>-1?a:0);return a>-1&&(n=e.slice(0,a),s=e.slice(a+1,u>-1?u:e.length),i=t(s)),u>-1&&(n=n||e.slice(0,u),o=e.slice(u,e.length)),n=lZ(n!=null?n:e,r),{fullPath:n+(s&&"?")+s+o,path:n,query:i,hash:o}}function aZ(t,e){const r=e.query?t(e.query):"";return e.path+(r&&"?")+r+(e.hash||"")}function ek(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function uZ(t,e,r){const n=e.matched.length-1,i=r.matched.length-1;return n>-1&&n===i&&Vl(e.matched[n],r.matched[i])&&qD(e.params,r.params)&&t(e.query)===t(r.query)&&e.hash===r.hash}function Vl(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function qD(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(!cZ(t[r],e[r]))return!1;return!0}function cZ(t,e){return Array.isArray(t)?tk(t,e):Array.isArray(e)?tk(e,t):t===e}function tk(t,e){return Array.isArray(e)?t.length===e.length&&t.every((r,n)=>r===e[n]):t.length===1&&t[0]===e}function lZ(t,e){if(t.startsWith("/"))return t;if(!t)return e;const r=e.split("/"),n=t.split("/");let i=r.length-1,s,o;for(s=0;s({left:window.pageXOffset,top:window.pageYOffset});function gZ(t){let e;if("el"in t){const r=t.el,n=typeof r=="string"&&r.startsWith("#"),i=typeof r=="string"?n?document.getElementById(r.slice(1)):document.querySelector(r):r;if(!i)return;e=pZ(i,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.pageXOffset,e.top!=null?e.top:window.pageYOffset)}function rk(t,e){return(history.state?history.state.position-e:-1)+t}const F1=new Map;function mZ(t,e){F1.set(t,e)}function vZ(t){const e=F1.get(t);return F1.delete(t),e}let yZ=()=>location.protocol+"//"+location.host;function jD(t,e){const{pathname:r,search:n,hash:i}=e,s=t.indexOf("#");if(s>-1){let a=i.includes(t.slice(s))?t.slice(s).length:1,u=i.slice(a);return u[0]!=="/"&&(u="/"+u),ek(u,"")}return ek(r,t)+n+i}function _Z(t,e,r,n){let i=[],s=[],o=null;const a=({state:d})=>{const _=jD(t,location),T=r.value,D=e.value;let N=0;if(d){if(r.value=_,e.value=d,o&&o===T){o=null;return}N=D?d.position-D.position:0}else n(_);i.forEach(O=>{O(r.value,T,{delta:N,type:Nd.pop,direction:N?N>0?Fh.forward:Fh.back:Fh.unknown})})};function u(){o=r.value}function c(d){i.push(d);const _=()=>{const T=i.indexOf(d);T>-1&&i.splice(T,1)};return s.push(_),_}function l(){const{history:d}=window;!d.state||d.replaceState(rr({},d.state,{scroll:Ov()}),"")}function h(){for(const d of s)d();s=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",l)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",l),{pauseListeners:u,listen:c,destroy:h}}function nk(t,e,r,n=!1,i=!1){return{back:t,current:e,forward:r,replaced:n,position:window.history.length,scroll:i?Ov():null}}function bZ(t){const{history:e,location:r}=window,n={value:jD(t,r)},i={value:e.state};i.value||s(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(u,c,l){const h=t.indexOf("#"),d=h>-1?(r.host&&document.querySelector("base")?t:t.slice(h))+u:yZ()+t+u;try{e[l?"replaceState":"pushState"](c,"",d),i.value=c}catch(_){console.error(_),r[l?"replace":"assign"](d)}}function o(u,c){const l=rr({},e.state,nk(i.value.back,u,i.value.forward,!0),c,{position:i.value.position});s(u,l,!0),n.value=u}function a(u,c){const l=rr({},i.value,e.state,{forward:u,scroll:Ov()});s(l.current,l,!0);const h=rr({},nk(n.value,u,null),{position:l.position+1},c);s(u,h,!1),n.value=u}return{location:n,state:i,push:a,replace:o}}function Bpe(t){t=fZ(t);const e=bZ(t),r=_Z(t,e.state,e.location,e.replace);function n(s,o=!0){o||r.pauseListeners(),history.go(s)}const i=rr({location:"",base:t,go:n,createHref:dZ.bind(null,t)},e,r);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>e.state.value}),i}function wZ(t){return typeof t=="string"||t&&typeof t=="object"}function VD(t){return typeof t=="string"||typeof t=="symbol"}const ra={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},zD=_f("nf");var ik;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(ik||(ik={}));function zl(t,e){return rr(new Error,{type:t,[zD]:!0},e)}function lu(t,e){return t instanceof Error&&zD in t&&(e==null||!!(t.type&e))}const sk="[^/]+?",EZ={sensitive:!1,strict:!1,start:!0,end:!0},xZ=/[.+*?^${}()[\]/\\]/g;function SZ(t,e){const r=rr({},EZ,e),n=[];let i=r.start?"^":"";const s=[];for(const c of t){const l=c.length?[]:[90];r.strict&&!c.length&&(i+="/");for(let h=0;he.length?e.length===1&&e[0]===40+40?1:-1:0}function TZ(t,e){let r=0;const n=t.score,i=e.score;for(;r1&&(u==="*"||u==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:c,regexp:l,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):e("Invalid state to consume buffer"),c="")}function d(){c+=u}for(;a{o(L)}:$h}function o(l){if(VD(l)){const h=n.get(l);h&&(n.delete(l),r.splice(r.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=r.indexOf(l);h>-1&&(r.splice(h,1),l.record.name&&n.delete(l.record.name),l.children.forEach(o),l.alias.forEach(o))}}function a(){return r}function u(l){let h=0;for(;h=0;)h++;r.splice(h,0,l),l.record.name&&!ok(l)&&n.set(l.record.name,l)}function c(l,h){let d,_={},T,D;if("name"in l&&l.name){if(d=n.get(l.name),!d)throw zl(1,{location:l});D=d.record.name,_=rr(NZ(h.params,d.keys.filter(L=>!L.optional).map(L=>L.name)),l.params),T=d.stringify(_)}else if("path"in l)T=l.path,d=r.find(L=>L.re.test(T)),d&&(_=d.parse(T),D=d.record.name);else{if(d=h.name?n.get(h.name):r.find(L=>L.re.test(h.path)),!d)throw zl(1,{location:l,currentLocation:h});D=d.record.name,_=rr({},h.params,l.params),T=d.stringify(_)}const N=[];let O=d;for(;O;)N.unshift(O.record),O=O.parent;return{name:D,path:T,params:_,matched:N,meta:PZ(N)}}return t.forEach(l=>s(l)),{addRoute:s,resolve:c,removeRoute:o,getRoutes:a,getRecordMatcher:i}}function NZ(t,e){const r={};for(const n of e)n in t&&(r[n]=t[n]);return r}function OZ(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:DZ(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||{}:{default:t.component}}}function DZ(t){const e={},r=t.props||!1;if("component"in t)e.default=r;else for(const n in t.components)e[n]=typeof r=="boolean"?r:r[n];return e}function ok(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function PZ(t){return t.reduce((e,r)=>rr(e,r.meta),{})}function ak(t,e){const r={};for(const n in t)r[n]=n in e?e[n]:t[n];return r}const HD=/#/g,LZ=/&/g,BZ=/\//g,$Z=/=/g,FZ=/\?/g,KD=/\+/g,UZ=/%5B/g,qZ=/%5D/g,GD=/%5E/g,jZ=/%60/g,WD=/%7B/g,VZ=/%7C/g,XD=/%7D/g,zZ=/%20/g;function Zx(t){return encodeURI(""+t).replace(VZ,"|").replace(UZ,"[").replace(qZ,"]")}function HZ(t){return Zx(t).replace(WD,"{").replace(XD,"}").replace(GD,"^")}function U1(t){return Zx(t).replace(KD,"%2B").replace(zZ,"+").replace(HD,"%23").replace(LZ,"%26").replace(jZ,"`").replace(WD,"{").replace(XD,"}").replace(GD,"^")}function KZ(t){return U1(t).replace($Z,"%3D")}function GZ(t){return Zx(t).replace(HD,"%23").replace(FZ,"%3F")}function WZ(t){return t==null?"":GZ(t).replace(BZ,"%2F")}function V0(t){try{return decodeURIComponent(""+t)}catch{}return""+t}function XZ(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let i=0;is&&U1(s)):[n&&U1(n)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+r,s!=null&&(e+="="+s))})}return e}function YZ(t){const e={};for(const r in t){const n=t[r];n!==void 0&&(e[r]=Array.isArray(n)?n.map(i=>i==null?null:""+i):n==null?n:""+n)}return e}function Xf(){let t=[];function e(n){return t.push(n),()=>{const i=t.indexOf(n);i>-1&&t.splice(i,1)}}function r(){t=[]}return{add:e,list:()=>t,reset:r}}function ua(t,e,r,n,i){const s=n&&(n.enterCallbacks[i]=n.enterCallbacks[i]||[]);return()=>new Promise((o,a)=>{const u=h=>{h===!1?a(zl(4,{from:r,to:e})):h instanceof Error?a(h):wZ(h)?a(zl(2,{from:e,to:h})):(s&&n.enterCallbacks[i]===s&&typeof h=="function"&&s.push(h),o())},c=t.call(n&&n.instances[i],e,r,u);let l=Promise.resolve(c);t.length<3&&(l=l.then(u)),l.catch(h=>a(h))})}function q_(t,e,r,n){const i=[];for(const s of t)for(const o in s.components){let a=s.components[o];if(!(e!=="beforeRouteEnter"&&!s.instances[o]))if(JZ(a)){const c=(a.__vccOpts||a)[e];c&&i.push(ua(c,r,n,s,o))}else{let u=a();i.push(()=>u.then(c=>{if(!c)return Promise.reject(new Error(`Couldn't resolve component "${o}" at "${s.path}"`));const l=iZ(c)?c.default:c;s.components[o]=l;const d=(l.__vccOpts||l)[e];return d&&ua(d,r,n,s,o)()}))}}return i}function JZ(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function ck(t){const e=Wn(Jx),r=Wn(Qx),n=Mi(()=>e.resolve(nl(t.to))),i=Mi(()=>{const{matched:u}=n.value,{length:c}=u,l=u[c-1],h=r.matched;if(!l||!h.length)return-1;const d=h.findIndex(Vl.bind(null,l));if(d>-1)return d;const _=lk(u[c-2]);return c>1&&lk(l)===_&&h[h.length-1].path!==_?h.findIndex(Vl.bind(null,u[c-2])):d}),s=Mi(()=>i.value>-1&&tee(r.params,n.value.params)),o=Mi(()=>i.value>-1&&i.value===r.matched.length-1&&qD(r.params,n.value.params));function a(u={}){return eee(u)?e[nl(t.replace)?"replace":"push"](nl(t.to)).catch($h):Promise.resolve()}return{route:n,href:Mi(()=>n.value.href),isActive:s,isExactActive:o,navigate:a}}const QZ=zd({name:"RouterLink",props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:ck,setup(t,{slots:e}){const r=js(ck(t)),{options:n}=Wn(Jx),i=Mi(()=>({[fk(t.activeClass,n.linkActiveClass,"router-link-active")]:r.isActive,[fk(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive}));return()=>{const s=e.default&&e.default(r);return t.custom?s:Im("a",{"aria-current":r.isExactActive?t.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:i.value},s)}}}),ZZ=QZ;function eee(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 tee(t,e){for(const r in e){const n=e[r],i=t[r];if(typeof n=="string"){if(n!==i)return!1}else if(!Array.isArray(i)||i.length!==n.length||n.some((s,o)=>s!==i[o]))return!1}return!0}function lk(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const fk=(t,e,r)=>t!=null?t:e!=null?e:r,ree=zd({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},setup(t,{attrs:e,slots:r}){const n=Wn($1),i=Mi(()=>t.route||n.value),s=Wn(ZA,0),o=Mi(()=>i.value.matched[s]);xh(ZA,s+1),xh(nZ,o),xh($1,i);const a=rl();return ol(()=>[a.value,o.value,t.name],([u,c,l],[h,d,_])=>{c&&(c.instances[l]=u,d&&d!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=d.leaveGuards),c.updateGuards.size||(c.updateGuards=d.updateGuards))),u&&c&&(!d||!Vl(c,d)||!h)&&(c.enterCallbacks[l]||[]).forEach(T=>T(u))},{flush:"post"}),()=>{const u=i.value,c=o.value,l=c&&c.components[t.name],h=t.name;if(!l)return hk(r.default,{Component:l,route:u});const d=c.props[t.name],_=d?d===!0?u.params:typeof d=="function"?d(u):d:null,D=Im(l,rr({},_,e,{onVnodeUnmounted:N=>{N.component.isUnmounted&&(c.instances[h]=null)},ref:a}));return hk(r.default,{Component:D,route:u})||D}}});function hk(t,e){if(!t)return null;const r=t(e);return r.length===1?r[0]:r}const nee=ree;function $pe(t){const e=RZ(t.routes,t),r=t.parseQuery||XZ,n=t.stringifyQuery||uk,i=t.history,s=Xf(),o=Xf(),a=Xf(),u=SC(ra);let c=ra;Gc&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const l=F_.bind(null,x=>""+x),h=F_.bind(null,WZ),d=F_.bind(null,V0);function _(x,k){let R,j;return VD(x)?(R=e.getRecordMatcher(x),j=k):j=x,e.addRoute(j,R)}function T(x){const k=e.getRecordMatcher(x);k&&e.removeRoute(k)}function D(){return e.getRoutes().map(x=>x.record)}function N(x){return!!e.getRecordMatcher(x)}function O(x,k){if(k=rr({},k||u.value),typeof x=="string"){const ie=U_(r,x,k.path),$=e.resolve({path:ie.path},k),V=i.createHref(ie.fullPath);return rr(ie,$,{params:d($.params),hash:V0(ie.hash),redirectedFrom:void 0,href:V})}let R;if("path"in x)R=rr({},x,{path:U_(r,x.path,k.path).path});else{const ie=rr({},x.params);for(const $ in ie)ie[$]==null&&delete ie[$];R=rr({},x,{params:h(x.params)}),k.params=h(k.params)}const j=e.resolve(R,k),Q=x.hash||"";j.params=l(d(j.params));const oe=aZ(n,rr({},x,{hash:HZ(Q),path:j.path})),fe=i.createHref(oe);return rr({fullPath:oe,hash:Q,query:n===uk?YZ(x.query):x.query||{}},j,{redirectedFrom:void 0,href:fe})}function L(x){return typeof x=="string"?U_(r,x,u.value.path):rr({},x)}function J(x,k){if(c!==x)return zl(8,{from:k,to:x})}function q(x){return G(x)}function z(x){return q(rr(L(x),{replace:!0}))}function ee(x){const k=x.matched[x.matched.length-1];if(k&&k.redirect){const{redirect:R}=k;let j=typeof R=="function"?R(x):R;return typeof j=="string"&&(j=j.includes("?")||j.includes("#")?j=L(j):{path:j},j.params={}),rr({query:x.query,hash:x.hash,params:x.params},j)}}function G(x,k){const R=c=O(x),j=u.value,Q=x.state,oe=x.force,fe=x.replace===!0,ie=ee(R);if(ie)return G(rr(L(ie),{state:Q,force:oe,replace:fe}),k||R);const $=R;$.redirectedFrom=k;let V;return!oe&&uZ(n,j,R)&&(V=zl(16,{to:$,from:j}),v(j,j,!0,!1)),(V?Promise.resolve(V):ue($,j)).catch(Y=>lu(Y)?Y:I(Y,$,j)).then(Y=>{if(Y){if(lu(Y,2))return G(rr(L(Y.to),{state:Q,force:oe,replace:fe}),k||$)}else Y=F($,j,!0,fe,Q);return _e($,j,Y),Y})}function ne(x,k){const R=J(x,k);return R?Promise.reject(R):Promise.resolve()}function ue(x,k){let R;const[j,Q,oe]=iee(x,k);R=q_(j.reverse(),"beforeRouteLeave",x,k);for(const ie of j)ie.leaveGuards.forEach($=>{R.push(ua($,x,k))});const fe=ne.bind(null,x,k);return R.push(fe),Fc(R).then(()=>{R=[];for(const ie of s.list())R.push(ua(ie,x,k));return R.push(fe),Fc(R)}).then(()=>{R=q_(Q,"beforeRouteUpdate",x,k);for(const ie of Q)ie.updateGuards.forEach($=>{R.push(ua($,x,k))});return R.push(fe),Fc(R)}).then(()=>{R=[];for(const ie of x.matched)if(ie.beforeEnter&&!k.matched.includes(ie))if(Array.isArray(ie.beforeEnter))for(const $ of ie.beforeEnter)R.push(ua($,x,k));else R.push(ua(ie.beforeEnter,x,k));return R.push(fe),Fc(R)}).then(()=>(x.matched.forEach(ie=>ie.enterCallbacks={}),R=q_(oe,"beforeRouteEnter",x,k),R.push(fe),Fc(R))).then(()=>{R=[];for(const ie of o.list())R.push(ua(ie,x,k));return R.push(fe),Fc(R)}).catch(ie=>lu(ie,8)?ie:Promise.reject(ie))}function _e(x,k,R){for(const j of a.list())j(x,k,R)}function F(x,k,R,j,Q){const oe=J(x,k);if(oe)return oe;const fe=k===ra,ie=Gc?history.state:{};R&&(j||fe?i.replace(x.fullPath,rr({scroll:fe&&ie&&ie.scroll},Q)):i.push(x.fullPath,Q)),u.value=x,v(x,k,R,fe),A()}let m;function g(){m=i.listen((x,k,R)=>{const j=O(x),Q=ee(j);if(Q){G(rr(Q,{replace:!0}),j).catch($h);return}c=j;const oe=u.value;Gc&&mZ(rk(oe.fullPath,R.delta),Ov()),ue(j,oe).catch(fe=>lu(fe,12)?fe:lu(fe,2)?(G(fe.to,j).then(ie=>{lu(ie,20)&&!R.delta&&R.type===Nd.pop&&i.go(-1,!1)}).catch($h),Promise.reject()):(R.delta&&i.go(-R.delta,!1),I(fe,j,oe))).then(fe=>{fe=fe||F(j,oe,!1),fe&&(R.delta?i.go(-R.delta,!1):R.type===Nd.pop&&lu(fe,20)&&i.go(-1,!1)),_e(j,oe,fe)}).catch($h)})}let f=Xf(),p=Xf(),y;function I(x,k,R){A(x);const j=p.list();return j.length?j.forEach(Q=>Q(x,k,R)):console.error(x),Promise.reject(x)}function M(){return y&&u.value!==ra?Promise.resolve():new Promise((x,k)=>{f.add([x,k])})}function A(x){y||(y=!0,g(),f.list().forEach(([k,R])=>x?R(x):k()),f.reset())}function v(x,k,R,j){const{scrollBehavior:Q}=t;if(!Gc||!Q)return Promise.resolve();const oe=!R&&vZ(rk(x.fullPath,0))||(j||!R)&&history.state&&history.state.scroll||null;return nf().then(()=>Q(x,k,oe)).then(fe=>fe&&gZ(fe)).catch(fe=>I(fe,x,k))}const S=x=>i.go(x);let w;const U=new Set;return{currentRoute:u,addRoute:_,removeRoute:T,hasRoute:N,getRoutes:D,resolve:O,options:t,push:q,replace:z,go:S,back:()=>S(-1),forward:()=>S(1),beforeEach:s.add,beforeResolve:o.add,afterEach:a.add,onError:p.add,isReady:M,install(x){const k=this;x.component("RouterLink",ZZ),x.component("RouterView",nee),x.config.globalProperties.$router=k,Object.defineProperty(x.config.globalProperties,"$route",{enumerable:!0,get:()=>nl(u)}),Gc&&!w&&u.value===ra&&(w=!0,q(i.location).catch(Q=>{}));const R={};for(const Q in ra)R[Q]=Mi(()=>u.value[Q]);x.provide(Jx,k),x.provide(Qx,js(R)),x.provide($1,u);const j=x.unmount;U.add(x),x.unmount=function(){U.delete(x),U.size<1&&(c=ra,m&&m(),u.value=ra,w=!1,y=!1),j()}}}}function Fc(t){return t.reduce((e,r)=>e.then(()=>r()),Promise.resolve())}function iee(t,e){const r=[],n=[],i=[],s=Math.max(e.matched.length,t.matched.length);for(let o=0;oVl(c,a))?n.push(a):r.push(a));const u=t.matched[o];u&&(e.matched.find(c=>Vl(c,u))||i.push(u))}return[r,n,i]}function Fpe(){return Wn(Qx)}var see="firebase",oee="9.14.0";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */On(see,oee,"app");const YD="@firebase/installations",eS="0.5.16";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const JD=1e4,QD=`w:${eS}`,ZD="FIS_v2",aee="https://firebaseinstallations.googleapis.com/v1",uee=60*60*1e3,cee="installations",lee="Installations";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const fee={["missing-app-config-values"]:'Missing App configuration value: "{$valueName}"',["not-registered"]:"Firebase Installation is not registered.",["installation-not-found"]:"Firebase Installation not found.",["request-failed"]:'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',["app-offline"]:"Could not process request. Application offline.",["delete-pending-registration"]:"Can't delete installation while there is a pending registration request."},lc=new wc(cee,lee,fee);function e4(t){return t instanceof Fi&&t.code.includes("request-failed")}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function t4({projectId:t}){return`${aee}/projects/${t}/installations`}function r4(t){return{token:t.token,requestStatus:2,expiresIn:dee(t.expiresIn),creationTime:Date.now()}}async function n4(t,e){const n=(await e.json()).error;return lc.create("request-failed",{requestName:t,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function i4({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function hee(t,{refreshToken:e}){const r=i4(t);return r.append("Authorization",pee(e)),r}async function s4(t){const e=await t();return e.status>=500&&e.status<600?t():e}function dee(t){return Number(t.replace("s","000"))}function pee(t){return`${ZD} ${t}`}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function gee({appConfig:t,heartbeatServiceProvider:e},{fid:r}){const n=t4(t),i=i4(t),s=e.getImmediate({optional:!0});if(s){const c=await s.getHeartbeatsHeader();c&&i.append("x-firebase-client",c)}const o={fid:r,authVersion:ZD,appId:t.appId,sdkVersion:QD},a={method:"POST",headers:i,body:JSON.stringify(o)},u=await s4(()=>fetch(n,a));if(u.ok){const c=await u.json();return{fid:c.fid||r,registrationStatus:2,refreshToken:c.refreshToken,authToken:r4(c.authToken)}}else throw await n4("Create Installation",u)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function o4(t){return new Promise(e=>{setTimeout(e,t)})}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function mee(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const vee=/^[cdef][\w-]{21}$/,q1="";function yee(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const r=_ee(t);return vee.test(r)?r:q1}catch{return q1}}function _ee(t){return mee(t).substr(0,22)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Dv(t){return`${t.appName}!${t.appId}`}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const a4=new Map;function u4(t,e){const r=Dv(t);c4(r,e),bee(r,e)}function c4(t,e){const r=a4.get(t);if(!!r)for(const n of r)n(e)}function bee(t,e){const r=wee();r&&r.postMessage({key:t,fid:e}),Eee()}let Cu=null;function wee(){return!Cu&&"BroadcastChannel"in self&&(Cu=new BroadcastChannel("[Firebase] FID Change"),Cu.onmessage=t=>{c4(t.data.key,t.data.fid)}),Cu}function Eee(){a4.size===0&&Cu&&(Cu.close(),Cu=null)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const xee="firebase-installations-database",See=1,fc="firebase-installations-store";let j_=null;function tS(){return j_||(j_=D3(xee,See,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(fc)}}})),j_}async function z0(t,e){const r=Dv(t),i=(await tS()).transaction(fc,"readwrite"),s=i.objectStore(fc),o=await s.get(r);return await s.put(e,r),await i.done,(!o||o.fid!==e.fid)&&u4(t,e.fid),e}async function l4(t){const e=Dv(t),n=(await tS()).transaction(fc,"readwrite");await n.objectStore(fc).delete(e),await n.done}async function Pv(t,e){const r=Dv(t),i=(await tS()).transaction(fc,"readwrite"),s=i.objectStore(fc),o=await s.get(r),a=e(o);return a===void 0?await s.delete(r):await s.put(a,r),await i.done,a&&(!o||o.fid!==a.fid)&&u4(t,a.fid),a}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function rS(t){let e;const r=await Pv(t.appConfig,n=>{const i=Iee(n),s=Tee(t,i);return e=s.registrationPromise,s.installationEntry});return r.fid===q1?{installationEntry:await e}:{installationEntry:r,registrationPromise:e}}function Iee(t){const e=t||{fid:yee(),registrationStatus:0};return f4(e)}function Tee(t,e){if(e.registrationStatus===0){if(!navigator.onLine){const i=Promise.reject(lc.create("app-offline"));return{installationEntry:e,registrationPromise:i}}const r={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},n=Aee(t,r);return{installationEntry:r,registrationPromise:n}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:kee(t)}:{installationEntry:e}}async function Aee(t,e){try{const r=await gee(t,e);return z0(t.appConfig,r)}catch(r){throw e4(r)&&r.customData.serverCode===409?await l4(t.appConfig):await z0(t.appConfig,{fid:e.fid,registrationStatus:0}),r}}async function kee(t){let e=await dk(t.appConfig);for(;e.registrationStatus===1;)await o4(100),e=await dk(t.appConfig);if(e.registrationStatus===0){const{installationEntry:r,registrationPromise:n}=await rS(t);return n||r}return e}function dk(t){return Pv(t,e=>{if(!e)throw lc.create("installation-not-found");return f4(e)})}function f4(t){return Mee(t)?{fid:t.fid,registrationStatus:0}:t}function Mee(t){return t.registrationStatus===1&&t.registrationTime+JDfetch(n,a));if(u.ok){const c=await u.json();return r4(c)}else throw await n4("Generate Auth Token",u)}function Ree(t,{fid:e}){return`${t4(t)}/${e}/authTokens:generate`}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function nS(t,e=!1){let r;const n=await Pv(t.appConfig,s=>{if(!h4(s))throw lc.create("not-registered");const o=s.authToken;if(!e&&Dee(o))return s;if(o.requestStatus===1)return r=Nee(t,e),s;{if(!navigator.onLine)throw lc.create("app-offline");const a=Lee(s);return r=Oee(t,a),a}});return r?await r:n.authToken}async function Nee(t,e){let r=await pk(t.appConfig);for(;r.authToken.requestStatus===1;)await o4(100),r=await pk(t.appConfig);const n=r.authToken;return n.requestStatus===0?nS(t,e):n}function pk(t){return Pv(t,e=>{if(!h4(e))throw lc.create("not-registered");const r=e.authToken;return Bee(r)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function Oee(t,e){try{const r=await Cee(t,e),n=Object.assign(Object.assign({},e),{authToken:r});return await z0(t.appConfig,n),r}catch(r){if(e4(r)&&(r.customData.serverCode===401||r.customData.serverCode===404))await l4(t.appConfig);else{const n=Object.assign(Object.assign({},e),{authToken:{requestStatus:0}});await z0(t.appConfig,n)}throw r}}function h4(t){return t!==void 0&&t.registrationStatus===2}function Dee(t){return t.requestStatus===2&&!Pee(t)}function Pee(t){const e=Date.now();return e{const e=t.getProvider("app").getImmediate(),r=qee(e),n=zo(e,"heartbeat");return{app:e,appConfig:r,heartbeatServiceProvider:n,_delete:()=>Promise.resolve()}},zee=t=>{const e=t.getProvider("app").getImmediate(),r=zo(e,d4).getImmediate();return{getId:()=>$ee(r),getToken:i=>Fee(r,i)}};function Hee(){cs(new us(d4,Vee,"PUBLIC")),cs(new us(jee,zee,"PRIVATE"))}Hee();On(YD,eS);On(YD,eS,"esm2017");const gk="@firebase/performance",j1="0.5.17";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const p4=j1,Kee="FB-PERF-TRACE-START",Gee="FB-PERF-TRACE-STOP",V1="FB-PERF-TRACE-MEASURE",g4="_wt_",m4="_fp",v4="_fcp",y4="_fid",_4="@firebase/performance/config",b4="@firebase/performance/configexpire",Wee="performance",w4="Performance";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Xee={["trace started"]:"Trace {$traceName} was started before.",["trace stopped"]:"Trace {$traceName} is not running.",["nonpositive trace startTime"]:"Trace {$traceName} startTime should be positive.",["nonpositive trace duration"]:"Trace {$traceName} duration should be positive.",["no window"]:"Window is not available.",["no app id"]:"App id is not available.",["no project id"]:"Project id is not available.",["no api key"]:"Api key is not available.",["invalid cc log"]:"Attempted to queue invalid cc event",["FB not default"]:"Performance can only start when Firebase app instance is the default one.",["RC response not ok"]:"RC response is not ok",["invalid attribute name"]:"Attribute name {$attributeName} is invalid.",["invalid attribute value"]:"Attribute value {$attributeValue} is invalid.",["invalid custom metric name"]:"Custom metric name {$customMetricName} is invalid",["invalid String merger input"]:"Input for String merger is invalid, contact support team to resolve.",["already initialized"]:"initializePerformance() has already been called with different options. To avoid this error, call initializePerformance() with the same options as when it was originally called, or call getPerformance() to return the already initialized instance."},gn=new wc(Wee,w4,Xee);/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Ks=new Rm(w4);Ks.logLevel=Mt.INFO;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let z_,E4;class qr{constructor(e){if(this.window=e,!e)throw gn.create("no window");this.performance=e.performance,this.PerformanceObserver=e.PerformanceObserver,this.windowLocation=e.location,this.navigator=e.navigator,this.document=e.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=e.localStorage),e.perfMetrics&&e.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=e.perfMetrics.onFirstInputDelay)}getUrl(){return this.windowLocation.href.split("?")[0]}mark(e){!this.performance||!this.performance.mark||this.performance.mark(e)}measure(e,r,n){!this.performance||!this.performance.measure||this.performance.measure(e,r,n)}getEntriesByType(e){return!this.performance||!this.performance.getEntriesByType?[]:this.performance.getEntriesByType(e)}getEntriesByName(e){return!this.performance||!this.performance.getEntriesByName?[]:this.performance.getEntriesByName(e)}getTimeOrigin(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)}requiredApisAvailable(){return!fetch||!Promise||!v9()?(Ks.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1):yE()?!0:(Ks.info("IndexedDB is not supported by current browswer"),!1)}setupObserver(e,r){if(!this.PerformanceObserver)return;new this.PerformanceObserver(i=>{for(const s of i.getEntries())r(s)}).observe({entryTypes:[e]})}static getInstance(){return z_===void 0&&(z_=new qr(E4)),z_}}function Yee(t){E4=t}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let x4;function Jee(t){const e=t.getId();return e.then(r=>{x4=r}),e}function iS(){return x4}function Qee(t){const e=t.getToken();return e.then(r=>{}),e}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function mk(t,e){const r=t.length-e.length;if(r<0||r>1)throw gn.create("invalid String merger input");const n=[];for(let i=0;ii&&n.push(e.charAt(i));return n.join("")}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let H_;class ii{constructor(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=mk("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=mk("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}getFlTransportFullUrl(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)}static getInstance(){return H_===void 0&&(H_=new ii),H_}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var vl;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.VISIBLE=1]="VISIBLE",t[t.HIDDEN=2]="HIDDEN"})(vl||(vl={}));const Zee=["firebase_","google_","ga_"],ete=new RegExp("^[a-zA-Z]\\w*$"),tte=40,rte=100;function nte(){const t=qr.getInstance().navigator;return t!=null&&t.serviceWorker?t.serviceWorker.controller?2:3:1}function S4(){switch(qr.getInstance().document.visibilityState){case"visible":return vl.VISIBLE;case"hidden":return vl.HIDDEN;default:return vl.UNKNOWN}}function ite(){const e=qr.getInstance().navigator.connection;switch(e&&e.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}function ste(t){return t.length===0||t.length>tte?!1:!Zee.some(r=>t.startsWith(r))&&!!t.match(ete)}function ote(t){return t.length!==0&&t.length<=rte}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function I4(t){var e;const r=(e=t.options)===null||e===void 0?void 0:e.appId;if(!r)throw gn.create("no app id");return r}function ate(t){var e;const r=(e=t.options)===null||e===void 0?void 0:e.projectId;if(!r)throw gn.create("no project id");return r}function ute(t){var e;const r=(e=t.options)===null||e===void 0?void 0:e.apiKey;if(!r)throw gn.create("no api key");return r}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const cte="0.0.1",Yi={loggingEnabled:!0},lte="FIREBASE_INSTALLATIONS_AUTH";function fte(t,e){const r=hte();return r?(vk(r),Promise.resolve()):gte(t,e).then(vk).then(n=>dte(n),()=>{})}function hte(){const t=qr.getInstance().localStorage;if(!t)return;const e=t.getItem(b4);if(!e||!mte(e))return;const r=t.getItem(_4);if(!!r)try{return JSON.parse(r)}catch{return}}function dte(t){const e=qr.getInstance().localStorage;!t||!e||(e.setItem(_4,JSON.stringify(t)),e.setItem(b4,String(Date.now()+ii.getInstance().configTimeToLive*60*60*1e3)))}const pte="Could not fetch config, will use default configs";function gte(t,e){return Qee(t.installations).then(r=>{const n=ate(t.app),i=ute(t.app),s=`https://firebaseremoteconfig.googleapis.com/v1/projects/${n}/namespaces/fireperf:fetch?key=${i}`,o=new Request(s,{method:"POST",headers:{Authorization:`${lte} ${r}`},body:JSON.stringify({app_instance_id:e,app_instance_id_token:r,app_id:I4(t.app),app_version:p4,sdk_version:cte})});return fetch(o).then(a=>{if(a.ok)return a.json();throw gn.create("RC response not ok")})}).catch(()=>{Ks.info(pte)})}function vk(t){if(!t)return t;const e=ii.getInstance(),r=t.entries||{};return r.fpr_enabled!==void 0?e.loggingEnabled=String(r.fpr_enabled)==="true":e.loggingEnabled=Yi.loggingEnabled,r.fpr_log_source?e.logSource=Number(r.fpr_log_source):Yi.logSource&&(e.logSource=Yi.logSource),r.fpr_log_endpoint_url?e.logEndPointUrl=r.fpr_log_endpoint_url:Yi.logEndPointUrl&&(e.logEndPointUrl=Yi.logEndPointUrl),r.fpr_log_transport_key?e.transportKey=r.fpr_log_transport_key:Yi.transportKey&&(e.transportKey=Yi.transportKey),r.fpr_vc_network_request_sampling_rate!==void 0?e.networkRequestsSamplingRate=Number(r.fpr_vc_network_request_sampling_rate):Yi.networkRequestsSamplingRate!==void 0&&(e.networkRequestsSamplingRate=Yi.networkRequestsSamplingRate),r.fpr_vc_trace_sampling_rate!==void 0?e.tracesSamplingRate=Number(r.fpr_vc_trace_sampling_rate):Yi.tracesSamplingRate!==void 0&&(e.tracesSamplingRate=Yi.tracesSamplingRate),e.logTraceAfterSampling=yk(e.tracesSamplingRate),e.logNetworkAfterSampling=yk(e.networkRequestsSamplingRate),t}function mte(t){return Number(t)>Date.now()}function yk(t){return Math.random()<=t}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let sS=1,K_;function T4(t){return sS=2,K_=K_||yte(t),K_}function vte(){return sS===3}function yte(t){return _te().then(()=>Jee(t.installations)).then(e=>fte(t,e)).then(()=>_k(),()=>_k())}function _te(){const t=qr.getInstance().document;return new Promise(e=>{if(t&&t.readyState!=="complete"){const r=()=>{t.readyState==="complete"&&(t.removeEventListener("readystatechange",r),e())};t.addEventListener("readystatechange",r)}else e()})}function _k(){sS=3}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const oS=10*1e3,bte=5.5*1e3,A4=3,wte=1e3;let H0=A4,Ma=[],bk=!1;function Ete(){bk||(Lv(bte),bk=!0)}function Lv(t){setTimeout(()=>{if(H0!==0){if(!Ma.length)return Lv(oS);xte()}},t)}function xte(){const t=Ma.splice(0,wte),e=t.map(n=>({source_extension_json_proto3:n.message,event_time_ms:String(n.eventTime)})),r={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:ii.getInstance().logSource,log_event:e};Ste(r,t).catch(()=>{Ma=[...t,...Ma],H0--,Ks.info(`Tries left: ${H0}.`),Lv(oS)})}function Ste(t,e){return Ite(t).then(r=>(r.ok||Ks.info("Call to Firebase backend failed."),r.json())).then(r=>{const n=Number(r.nextRequestWaitMillis);let i=oS;isNaN(n)||(i=Math.max(n,i));const s=r.logResponseDetails;Array.isArray(s)&&s.length>0&&s[0].responseAction==="RETRY_REQUEST_LATER"&&(Ma=[...e,...Ma],Ks.info("Retry transport request later.")),H0=A4,Lv(i)})}function Ite(t){const e=ii.getInstance().getFlTransportFullUrl();return fetch(e,{method:"POST",body:JSON.stringify(t)})}function Tte(t){if(!t.eventTime||!t.message)throw gn.create("invalid cc log");Ma=[...Ma,t]}function Ate(t){return(...e)=>{const r=t(...e);Tte({message:r,eventTime:Date.now()})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let G_;function k4(t,e){G_||(G_=Ate(Mte)),G_(t,e)}function hg(t){const e=ii.getInstance();!e.instrumentationEnabled&&t.isAuto||!e.dataCollectionEnabled&&!t.isAuto||!qr.getInstance().requiredApisAvailable()||t.isAuto&&S4()!==vl.VISIBLE||(vte()?W_(t):T4(t.performanceController).then(()=>W_(t),()=>W_(t)))}function W_(t){if(!iS())return;const e=ii.getInstance();!e.loggingEnabled||!e.logTraceAfterSampling||setTimeout(()=>k4(t,1),0)}function kte(t){const e=ii.getInstance();if(!e.instrumentationEnabled)return;const r=t.url,n=e.logEndPointUrl.split("?")[0],i=e.flTransportEndpointUrl.split("?")[0];r===n||r===i||!e.loggingEnabled||!e.logNetworkAfterSampling||setTimeout(()=>k4(t,0),0)}function Mte(t,e){return e===0?Cte(t):Rte(t)}function Cte(t){const e={url:t.url,http_method:t.httpMethod||0,http_response_code:200,response_payload_bytes:t.responsePayloadBytes,client_start_time_us:t.startTimeUs,time_to_response_initiated_us:t.timeToResponseInitiatedUs,time_to_response_completed_us:t.timeToResponseCompletedUs},r={application_info:M4(t.performanceController.app),network_request_metric:e};return JSON.stringify(r)}function Rte(t){const e={name:t.name,is_auto:t.isAuto,client_start_time_us:t.startTimeUs,duration_us:t.durationUs};Object.keys(t.counters).length!==0&&(e.counters=t.counters);const r=t.getAttributes();Object.keys(r).length!==0&&(e.custom_attributes=r);const n={application_info:M4(t.performanceController.app),trace_metric:e};return JSON.stringify(n)}function M4(t){return{google_app_id:I4(t),app_instance_id:iS(),web_app_info:{sdk_version:p4,page_url:qr.getInstance().getUrl(),service_worker_status:nte(),visibility_state:S4(),effective_connection_type:ite()},application_process_state:0}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Nte=100,Ote="_",Dte=[m4,v4,y4];function Pte(t,e){return t.length===0||t.length>Nte?!1:e&&e.startsWith(g4)&&Dte.indexOf(t)>-1||!t.startsWith(Ote)}function Lte(t){const e=Math.floor(t);return ed.name===u);l&&l.startTime&&o.putMetric(m4,Math.floor(l.startTime*1e3));const h=n.find(d=>d.name===c);h&&h.startTime&&o.putMetric(v4,Math.floor(h.startTime*1e3)),i&&o.putMetric(y4,Math.floor(i*1e3))}hg(o)}static createUserTimingTrace(e,r){const n=new Ca(e,r,!1,r);hg(n)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function wk(t,e){const r=e;if(!r||r.responseStart===void 0)return;const n=qr.getInstance().getTimeOrigin(),i=Math.floor((r.startTime+n)*1e3),s=r.responseStart?Math.floor((r.responseStart-r.startTime)*1e3):void 0,o=Math.floor((r.responseEnd-r.startTime)*1e3),a=r.name&&r.name.split("?")[0],u={performanceController:t,url:a,responsePayloadBytes:r.transferSize,startTimeUs:i,timeToResponseInitiatedUs:s,timeToResponseCompletedUs:o};kte(u)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Bte=5e3;function Ek(t){!iS()||(setTimeout(()=>Fte(t),0),setTimeout(()=>$te(t),0),setTimeout(()=>Ute(t),0))}function $te(t){const e=qr.getInstance(),r=e.getEntriesByType("resource");for(const n of r)wk(t,n);e.setupObserver("resource",n=>wk(t,n))}function Fte(t){const e=qr.getInstance(),r=e.getEntriesByType("navigation"),n=e.getEntriesByType("paint");if(e.onFirstInputDelay){let i=setTimeout(()=>{Ca.createOobTrace(t,r,n),i=void 0},Bte);e.onFirstInputDelay(s=>{i&&(clearTimeout(i),Ca.createOobTrace(t,r,n,s))})}else Ca.createOobTrace(t,r,n)}function Ute(t){const e=qr.getInstance(),r=e.getEntriesByType("measure");for(const n of r)xk(t,n);e.setupObserver("measure",n=>xk(t,n))}function xk(t,e){const r=e.name;r.substring(0,V1.length)!==V1&&Ca.createUserTimingTrace(t,r)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class qte{constructor(e,r){this.app=e,this.installations=r,this.initialized=!1}_init(e){this.initialized||((e==null?void 0:e.dataCollectionEnabled)!==void 0&&(this.dataCollectionEnabled=e.dataCollectionEnabled),(e==null?void 0:e.instrumentationEnabled)!==void 0&&(this.instrumentationEnabled=e.instrumentationEnabled),qr.getInstance().requiredApisAvailable()?A3().then(r=>{r&&(Ete(),T4(this).then(()=>Ek(this),()=>Ek(this)),this.initialized=!0)}).catch(r=>{Ks.info(`Environment doesn't support IndexedDB: ${r}`)}):Ks.info('Firebase Performance cannot start if the browser does not support "Fetch" and "Promise", or cookies are disabled.'))}set instrumentationEnabled(e){ii.getInstance().instrumentationEnabled=e}get instrumentationEnabled(){return ii.getInstance().instrumentationEnabled}set dataCollectionEnabled(e){ii.getInstance().dataCollectionEnabled=e}get dataCollectionEnabled(){return ii.getInstance().dataCollectionEnabled}}const jte="[DEFAULT]";function Upe(t=Jd()){return t=Qe(t),zo(t,"performance").getImmediate()}function qpe(t,e){return t=Qe(t),new Ca(t,e)}const Vte=(t,{options:e})=>{const r=t.getProvider("app").getImmediate(),n=t.getProvider("installations-internal").getImmediate();if(r.name!==jte)throw gn.create("FB not default");if(typeof window=="undefined")throw gn.create("no window");Yee(window);const i=new qte(r,n);return i._init(e),i};function zte(){cs(new us("performance",Vte,"PUBLIC")),On(gk,j1),On(gk,j1,"esm2017")}zte();/** * vue-class-component v8.0.0-rc.1 * (c) 2015-present Evan You * @license MIT */function Sk(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ik(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r-1){i[l]=a[l];return}var h=Object.getOwnPropertyDescriptor(a,l);if(typeof h.value=="function"){i.methods[l]=h.value;return}if(h.get||h.set){i.computed[l]={get:h.get,set:h.set};return}}}),i.setup=function(l,h){var d,_=new r(l,h),T=Object.keys(_),D={},N=null;return T.forEach(function(O){_[O]===void 0||_[O]&&_[O].__s||(D[O]=rl(_[O]),nre(_,O,D))}),T.forEach(function(O){if(_[O]&&_[O].__s){var L=_[O].__s();L instanceof Promise?(N||(N=Promise.resolve(D)),N=N.then(function(){return L.then(function(J){return D[O]=Wh(J),D})})):D[O]=Wh(L)}}),(d=N)!==null&&d!==void 0?d:D};var u=pg(r,"__d");u&&u.forEach(function(l){return l(i)});var c=["render","ssrRender","__file","__cssModules","__scopeId","__hmrId"];return c.forEach(function(l){r[l]&&(i[l]=r[l])}),i}}]),t}();C4.__h=["data","beforeCreate","created","beforeMount","mounted","beforeUnmount","unmounted","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];var sre=C4;function jpe(t){return function(e){return e.__o=t,e}}function yp(t){return function(e,r,n){var i=typeof e=="function"?e:e.constructor;i.__d||(i.__d=[]),typeof n!="number"&&(n=void 0),i.__d.push(function(s){return t(s,r,n)})}}const ore=/\B([A-Z])/g,are=t=>t.replace(ore,"-$1").toLowerCase();function Vpe(t){return yp((e,r)=>{const n=t||are(r);e.emits||(e.emits=[]),e.emits.push(n);const i=e.methods[r];e.methods[r]=function(...o){const a=c=>{c===void 0?o.length===0?this.$emit(n):o.length===1?this.$emit(n,o[0]):this.$emit(n,...o):(o.unshift(c),this.$emit(n,...o))},u=i.apply(this,o);return ure(u)?u.then(a):a(u),u}})}function ure(t){return t instanceof Promise||t&&typeof t.then=="function"}function zpe(t=Object.create(null)){return yp((e,r)=>{const n=e.setup;e.setup=(i,s)=>{const o=n==null?void 0:n(i,s),a=Wn(t.from||r,t.default);return Object.assign(Object.assign({},o),{[r]:a})}})}function Hpe(t){return yp((e,r)=>{e.props||(e.props=Object.create(null)),e.props[r]=t})}function Kpe(t){return yp((e,r)=>{const n=e.provide;e.provide=function(){const i=typeof n=="function"?n.call(this):n;return Object.assign(Object.assign({},i),{[(t==null?void 0:t.to)||r]:t!=null&&t.reactive?Mi(()=>this[r]):this[r]})}})}function Gpe(t,e){return yp((r,n)=>{r.watch||(r.watch=Object.create(null));const i=r.watch;typeof i[t]=="object"&&!Array.isArray(i[t])?i[t]=[i[t]]:typeof i[t]=="undefined"&&(i[t]=[]),i[t].push(Object.assign({handler:n},e))})}var Bv=(t,e)=>{const r=t.__vccOpts||t;for(const[n,i]of e)r[n]=i;return r},aS=JSON.parse('{"adjectives":["aback","abaft","abandoned","abashed","aberrant","abhorrent","abiding","abject","ablaze","able","abnormal","aboard","aboriginal","abortive","abounding","abrasive","abrupt","absent","absorbed","absorbing","abstracted","absurd","abundant","abusive","acceptable","accessible","accidental","accurate","acid","acidic","acoustic","acrid","actual","actually","adamant","adaptable","addicted","additional","adhesive","adhoc","adjoining","administrative","adorable","adventurous","afraid","aggressive","agonizing","agreeable","ahead","ajar","alcoholic","alert","alike","alive","alleged","alluring","aloof","amazing","ambiguous","ambitious","american","amuck","amused","amusing","ancient","angry","animated","annoyed","annoying","anxious","apathetic","aquatic","aromatic","arrogant","ashamed","asleep","aspiring","assorted","astonishing","attractive","auspicious","automatic","available","average","awake","aware","awesome","awful","axiomatic","bad","barbarous","bashful","basic","bawdy","beautiful","befitting","belligerent","beneficial","bent","berserk","best","better","bewildered","big","billowy","bitesized","bitter","bizarre","black","bloody","blue","blueeyed","blushing","boiling","boorish","bored","boring","bouncy","boundless","brainy","brash","brave","brawny","breakable","breezy","brief","bright","broad","broken","brown","bumpy","burly","bustling","busy","cagey","calculating","callous","calm","capable","capricious","careful","careless","caring","cautious","ceaseless","central","certain","changeable","charming","cheap","cheerful","chemical","chief","childlike","chilly","chivalrous","chubby","chunky","civil","clammy","classy","clean","clear","clever","cloistered","close","closed","cloudy","clumsy","cluttered","coherent","cold","colorful","colossal","combative","comfortable","common","competitive","complete","complex","comprehensive","concerned","condemned","confident","confused","conscious","consistent","cooing","cool","cooperative","coordinated","courageous","cowardly","crabby","craven","crazy","creepy","critical","crooked","crowded","cruel","cuddly","cultural","cultured","cumbersome","curious","curly","current","curved","curvy","cut","cute","cynical","daffy","daily","damaged","damaging","damp","dangerous","dapper","dark","dashing","dazzling","dead","deadpan","deafening","dear","debonair","decent","decisive","decorous","deep","deeply","defeated","defective","defiant","delicate","delicious","delightful","delirious","democratic","demonic","dependent","depressed","deranged","descriptive","deserted","desperate","detailed","determined","devilish","didactic","different","difficult","diligent","direful","dirty","disagreeable","disastrous","discreet","disgusted","disgusting","disillusioned","dispensable","distinct","disturbed","divergent","dizzy","domineering","doubtful","drab","draconian","dramatic","dreary","drunk","dry","dull","dusty","dynamic","dysfunctional","eager","early","earsplitting","earthy","eastern","easy","eatable","economic","educated","educational","efficacious","efficient","eight","elastic","elated","elderly","electric","electrical","electronic","elegant","elfin","elite","embarrassed","eminent","emotional","empty","enchanted","enchanting","encouraging","endurable","energetic","enormous","entertaining","enthusiastic","entire","envious","environmental","equable","equal","erect","erratic","ethereal","evanescent","evasive","even","every","excellent","excited","exciting","exclusive","existing","exotic","expensive","exuberant","exultant","fabulous","faded","faint","fair","faithful","fallacious","false","familiar","famous","fanatical","fancy","fantastic","far","farflung","fascinated","fast","fat","faulty","fearful","fearless","federal","feeble","feigned","female","fertile","festive","few","fierce","filthy","final","financial","fine","finicky","first","five","fixed","flagrant","flaky","flashy","flat","flawless","flimsy","flippant","flowery","fluffy","fluttering","foamy","foolish","foregoing","foreign","forgetful","former","fortunate","four","fragile","frail","frantic","free","freezing","frequent","fresh","fretful","friendly","frightened","frightening","full","fumbling","functional","funny","furry","furtive","future","futuristic","fuzzy","gabby","gainful","gamy","gaping","garrulous","gaudy","general","gentle","giant","giddy","gifted","gigantic","glamorous","gleaming","glib","glistening","global","glorious","glossy","godly","good","goofy","gorgeous","graceful","grandiose","grateful","gratis","gray","greasy","great","greedy","green","grey","grieving","groovy","grotesque","grouchy","grubby","gruesome","grumpy","guarded","guiltless","guilty","gullible","gusty","guttural","habitual","half","hallowed","halting","handsome","handsomely","handy","hanging","hapless","happy","hard","harmonious","harsh","hateful","heady","healthy","heartbreaking","heavenly","heavy","hellish","helpful","helpless","hesitant","hideous","high","highfalutin","highpitched","hilarious","hissing","historical","holistic","hollow","homeless","homely","honorable","horrible","hospitable","hot","huge","hulking","human","humdrum","humorous","hungry","hurried","hurt","hushed","husky","hypnotic","hysterical","icky","icy","idiotic","ignorant","ill","illegal","illfated","illinformed","illustrious","imaginary","immediate","immense","imminent","impartial","imperfect","impolite","important","imported","impossible","impressive","incandescent","incompetent","inconclusive","incredible","industrious","inexpensive","infamous","informal","innate","inner","innocent","inquisitive","insidious","instinctive","intelligent","interesting","internal","international","invincible","irate","irritating","itchy","jaded","jagged","jazzy","jealous","jittery","jobless","jolly","joyous","judicious","juicy","jumbled","jumpy","juvenile","kaput","keen","kind","kindhearted","kindly","knotty","knowing","knowledgeable","known","labored","lackadaisical","lacking","lame","lamentable","languid","large","last","late","latter","laughable","lavish","lazy","lean","learned","left","legal","lethal","level","lewd","light","like","likeable","likely","limping","literate","little","lively","living","local","logical","lonely","long","longing","longterm","loose","lopsided","loud","loutish","lovely","loving","low","lowly","lucky","ludicrous","lumpy","lush","luxuriant","lying","lyrical","macabre","macho","mad","maddening","madly","magenta","magical","magnificent","main","majestic","major","makeshift","male","malicious","mammoth","maniacal","many","marked","married","marvelous","massive","material","materialistic","mature","mean","measly","meaty","medical","meek","mellow","melodic","melted","mental","merciful","mere","messy","mighty","military","milky","mindless","miniature","minor","miscreant","misty","mixed","moaning","modern","moldy","momentous","motionless","mountainous","muddled","mundane","murky","mushy","mute","mysterious","naive","nappy","narrow","nasty","national","natural","naughty","nauseating","near","neat","nebulous","necessary","needless","needy","neighborly","nervous","new","next","nice","nifty","nimble","nine","nippy","noiseless","noisy","nonchalant","nondescript","nonstop","normal","nostalgic","nosy","noxious","null","numberless","numerous","nutritious","nutty","oafish","obedient","obeisant","obese","obnoxious","obscene","obsequious","observant","obsolete","obtainable","obvious","oceanic","odd","offbeat","old","oldfashioned","omniscient","one","onerous","only","open","opposite","optimal","orange","ordinary","organic","ossified","other","outgoing","outrageous","outstanding","oval","overconfident","overjoyed","overrated","overt","overwrought","painful","painstaking","pale","paltry","panicky","panoramic","parallel","parched","parsimonious","past","pastoral","pathetic","peaceful","penitent","perfect","periodic","permissible","perpetual","personal","petite","phobic","physical","picayune","pink","piquant","placid","plain","plant","plastic","plausible","pleasant","plucky","pointless","poised","polite","political","poor","popular","possessive","possible","powerful","practical","precious","pregnant","premium","present","pretty","previous","pricey","prickly","private","probable","productive","profuse","protective","proud","psychedelic","psychological","psychotic","public","puffy","pumped","puny","pure","purple","purring","pushy","puzzled","puzzling","quack","quaint","quarrelsome","questionable","quick","quickest","quiet","quirky","quixotic","quizzical","rabid","racial","ragged","rainy","rambunctious","rampant","rapid","rare","raspy","ratty","ready","real","realistic","reasonable","rebel","recent","receptive","recondite","red","redundant","reflective","regular","relevant","relieved","religious","remarkable","reminiscent","repulsive","resolute","resonant","responsible","rhetorical","rich","right","righteous","rightful","rigid","ripe","ritzy","roasted","robust","romantic","roomy","rotten","rough","round","royal","ruddy","rude","rural","rustic","ruthless","sable","sad","safe","salty","same","sassy","satisfying","savory","scandalous","scarce","scared","scary","scattered","scientific","scintillating","scrawny","screeching","second","secondhand","secret","secretive","sedate","seemly","selective","selfish","separate","serious","several","severe","sexual","shaggy","shaky","shallow","sharp","shiny","shivering","shocking","short","shrill","shut","shy","sick","significant","silent","silky","silly","similar","simple","simplistic","sincere","single","six","skillful","skinny","sleepy","slim","slimy","slippery","sloppy","slow","small","smart","smelly","smiling","smoggy","smooth","sneaky","snobbish","snotty","social","soft","soggy","solid","somber","sophisticated","sordid","sore","sorry","sour","southern","sparkling","special","spectacular","spicy","spiffy","spiky","spiritual","spiteful","splendid","spooky","spotless","spotted","spotty","spurious","squalid","square","squealing","squeamish","staking","stale","standing","statuesque","steadfast","steady","steep","stereotyped","sticky","stiff","stimulating","stingy","stormy","straight","strange","strict","striped","strong","stupendous","stupid","sturdy","subdued","subsequent","substantial","successful","succinct","sudden","sufficient","suitable","sulky","super","superb","superficial","supreme","sure","suspicious","swanky","sweet","sweltering","swift","symptomatic","synonymous","taboo","tacit","tacky","talented","tall","tame","tan","tangible","tangy","tart","tasteful","tasteless","tasty","tawdry","tearful","technical","tedious","teeny","telling","temporary","ten","tender","tense","tenuous","terrible","terrific","tested","testy","thankful","therapeutic","thick","thin","thinkable","third","thirsty","thoughtful","thoughtless","threatening","three","thundering","tidy","tight","tightfisted","tiny","tired","tiresome","toothsome","torpid","tough","towering","traditional","tranquil","trashy","tremendous","tricky","trite","troubled","truculent","true","truthful","two","typical","ubiquitous","ugliest","ugly","ultra","unable","unaccountable","unadvised","unarmed","unbecoming","unbiased","uncovered","understood","undesirable","unequal","unequaled","uneven","unfair","unhappy","unhealthy","uninterested","unique","united","unkempt","unknown","unlikely","unnatural","unruly","unsightly","unsuitable","untidy","unused","unusual","unwieldy","unwritten","upbeat","uppity","upset","uptight","used","useful","useless","utopian","utter","uttermost","vacuous","vagabond","vague","valuable","various","vast","vengeful","venomous","verdant","versed","victorious","vigorous","violent","violet","visible","vivacious","voiceless","volatile","voracious","vulgar","wacky","waggish","waiting","wakeful","wandering","wanting","warlike","warm","wary","wasteful","watery","weak","wealthy","weary","wellgroomed","wellmade","welloff","wet","whimsical","whispering","white","whole","wholesale","wicked","wide","wiggly","wild","willing","windy","wiry","wise","wistful","witty","woebegone","womanly","wonderful","wooden","woozy","workable","worried","worthless","wrathful","wretched","wrong","wry","yellow","yielding","young","youthful","yummy","zany","zealous","zesty","zippy","zonked"],"nouns":["ability","able","accident","account","achieve","acoustics","act","action","activity","actor","ad","addition","adjustment","administration","advertisement","advertising","advice","affair","aftermath","afternoon","afterthought","agency","agreement","air","airplane","airport","alarm","alcohol","alley","ambition","amount","amusement","analysis","analyst","anger","angle","animal","answer","ant","ants","anxiety","apartment","apparatus","apparel","appearance","apple","apples","appliance","application","appointment","approval","arch","area","argument","arithmetic","arm","army","arrival","art","article","aspect","assignment","assistance","assistant","association","assumption","atmosphere","attack","attempt","attention","attitude","attraction","audience","aunt","authority","awareness","babies","baby","back","badge","bag","bait","balance","ball","balloon","balls","banana","band","base","baseball","basin","basis","basket","basketball","bat","bath","bathroom","battle","bead","beam","bean","bear","bears","beast","bed","bedroom","beds","bee","beef","beer","beetle","beggar","beginner","behavior","belief","believe","bell","bells","berry","bike","bikes","bird","birds","birth","birthday","bit","bite","blade","blood","blow","board","boat","boats","body","bomb","bone","bonus","book","books","boot","border","bottle","boundary","box","boy","boyfriend","boys","brain","brake","branch","brass","bread","breakfast","breath","brick","bridge","brother","brothers","brush","bubble","bucket","building","bulb","bun","burn","burst","bushes","business","butter","button","buyer","cabbage","cabinet","cable","cactus","cake","cakes","calculator","calendar","camera","camp","can","cancer","candidate","cannon","canvas","cap","caption","car","card","care","carpenter","carriage","cars","cart","cast","cat","category","cats","cattle","cause","cave","celebration","celery","cell","cellar","cemetery","cent","chain","chair","chairs","chalk","championship","chance","change","channel","chapter","charity","cheek","cheese","chemistry","cherries","cherry","chess","chest","chicken","chickens","child","childhood","children","chin","chocolate","church","cigarette","circle","city","clam","class","classroom","client","climate","clock","clocks","cloth","clothes","cloud","clouds","clover","club","coach","coal","coast","coat","cobweb","coffee","coil","collar","collection","college","color","comb","combination","comfort","committee","communication","community","company","comparison","competition","complaint","computer","concept","conclusion","condition","confusion","connection","consequence","construction","context","contract","contribution","control","conversation","cook","cookie","copper","copy","cord","cork","corn","cough","country","county","courage","cousin","cover","cow","cows","crack","cracker","crate","crayon","cream","creator","creature","credit","crib","crime","criticism","crook","crow","crowd","crown","crush","cry","cub","cup","currency","current","curtain","curve","cushion","customer","dad","data","database","daughter","day","dealer","death","debt","decision","deer","definition","degree","delivery","department","departure","depression","depth","description","design","desire","desk","destruction","detail","development","device","diamond","difference","difficulty","digestion","dime","dinner","dinosaurs","direction","director","dirt","disaster","discovery","discussion","disease","disgust","disk","distance","distribution","division","dock","doctor","dog","dogs","doll","dolls","donkey","door","downtown","drain","drama","drawer","drawing","dress","drink","driver","driving","drop","drug","drum","duck","ducks","dust","ear","earth","earthquake","economics","edge","editor","education","effect","efficiency","effort","egg","eggnog","eggs","elbow","election","elevator","emotion","emphasis","employee","employer","employment","end","energy","engine","engineering","entertainment","enthusiasm","entry","environment","equipment","error","establishment","estate","event","exam","examination","example","exchange","excitement","existence","expansion","experience","expert","explanation","expression","extent","eye","eyes","face","fact","failure","fairies","fall","family","fan","fang","farm","farmer","father","faucet","fear","feast","feather","feedback","feeling","feet","fiction","field","fifth","fight","finding","finger","fire","fireman","fish","fishing","flag","flame","flavor","flesh","flight","flock","floor","flower","flowers","fly","fog","fold","food","foot","football","force","fork","form","fortune","foundation","fowl","frame","freedom","friction","friend","friends","friendship","frog","frogs","front","fruit","fuel","funeral","furniture","game","garbage","garden","gate","geese","gene","ghost","giants","giraffe","girl","girlfriend","girls","glass","glove","glue","goal","goat","gold","goldfish","goodbye","goose","government","governor","grade","grain","grandfather","grandmother","grape","grass","grip","grocery","ground","group","growth","guest","guidance","guide","guitar","gun","hair","haircut","hall","hammer","hand","hands","harbor","harmony","hat","hate","head","health","hearing","heart","heat","height","help","hen","highway","hill","historian","history","hobbies","hole","holiday","home","homework","honey","hook","hope","horn","horse","horses","hose","hospital","hot","hotel","hour","house","houses","housing","humor","hydrant","ice","icicle","idea","imagination","importance","impression","improvement","impulse","income","increase","independence","indication","industry","inflation","information","initiative","injury","ink","insect","inspection","inspector","instance","instruction","instrument","insurance","intention","interaction","interest","internet","introduction","invention","investment","iron","island","jail","jam","jar","jeans","jelly","jellyfish","jewel","join","joke","journey","judge","judgment","juice","jump","kettle","key","kick","king","kiss","kite","kitten","kittens","kitty","knee","knife","knot","knowledge","lab","laborer","lace","ladder","lady","ladybug","lake","lamp","land","language","laugh","law","lawyer","lead","leader","leadership","leaf","learning","leather","leg","legs","length","letter","letters","lettuce","level","library","lift","light","limit","line","linen","lip","liquid","list","literature","lizards","loaf","location","lock","locket","look","loss","love","low","lumber","lunch","lunchroom","machine","magazine","magic","maid","mailbox","maintenance","mall","man","management","manager","manufacturer","map","marble","mark","market","marketing","marriage","mask","mass","match","math","meal","meaning","measure","measurement","meat","media","medicine","meeting","member","membership","memory","men","menu","message","metal","method","mice","middle","midnight","milk","mind","mine","minister","mint","minute","mist","mitten","mixture","mode","mom","moment","money","monkey","month","mood","moon","morning","mother","motion","mountain","mouth","move","movie","mud","muscle","music","nail","name","nation","nature","neck","need","needle","negotiation","nerve","nest","net","news","newspaper","night","noise","north","nose","note","notebook","number","nut","oatmeal","obligation","observation","ocean","offer","office","oil","operation","opinion","opportunity","orange","oranges","order","organization","ornament","outcome","oven","owl","owner","page","pail","pain","paint","painting","pan","pancake","paper","parcel","parent","park","part","partner","party","passenger","passion","paste","patch","patience","payment","peace","pear","pen","penalty","pencil","people","percentage","perception","performance","permission","person","personality","perspective","pest","pet","pets","philosophy","phone","photo","physics","piano","pickle","picture","pie","pies","pig","pigs","pin","pipe","pizza","pizzas","place","plane","planes","plant","plantation","plants","plastic","plate","platform","play","player","playground","pleasure","plot","plough","pocket","poem","poet","poetry","point","poison","police","policy","polish","politics","pollution","popcorn","population","porter","position","possession","possibility","pot","potato","powder","power","preference","preparation","presence","presentation","president","price","print","priority","prison","problem","procedure","process","produce","product","profession","professor","profit","promotion","property","proposal","prose","protection","protest","psychology","pull","pump","punishment","purpose","push","quality","quantity","quarter","quartz","queen","question","quicksand","quiet","quill","quilt","quince","quiver","rabbit","rabbits","rail","railway","rain","rainstorm","rake","range","rat","rate","ratio","ray","reaction","reading","reality","reason","receipt","reception","recess","recipe","recognition","recommendation","record","recording","reflection","refrigerator","region","regret","relation","relationship","religion","replacement","representative","republic","reputation","request","requirement","resolution","resource","respect","response","responsibility","rest","restaurant","revenue","revolution","reward","rhythm","rice","riddle","rifle","ring","rings","river","road","robin","rock","rod","role","roll","roof","room","root","rose","route","rub","rule","run","sack","safety","sail","salad","salt","sample","sand","satisfaction","scale","scarecrow","scarf","scene","scent","school","science","scissors","screw","sea","seashore","seat","secretary","sector","security","seed","selection","self","sense","series","servant","session","setting","shade","shake","shame","shape","sheep","sheet","shelf","ship","shirt","shock","shoe","shoes","shop","shopping","show","side","sidewalk","sign","signature","significance","silk","silver","singer","sink","sir","sister","sisters","situation","size","skate","skill","skin","skirt","sky","slave","sleep","sleet","slip","slope","smash","smell","smile","smoke","snail","snails","snake","snakes","sneeze","snow","soap","society","sock","soda","sofa","software","solution","son","song","songs","sort","sound","soup","space","spade","spark","speaker","speech","spiders","sponge","spoon","spot","spring","spy","square","squirrel","stage","stamp","star","start","statement","station","steak","steam","steel","stem","step","stew","stick","sticks","stitch","stocking","stomach","stone","stop","storage","store","story","stove","stranger","strategy","straw","stream","street","stretch","string","structure","student","studio","substance","success","sugar","suggestion","suit","summer","sun","supermarket","support","surgery","surprise","sweater","swim","swing","sympathy","system","table","tail","tale","talk","tank","taste","tax","tea","teacher","teaching","team","technology","teeth","television","temper","temperature","tendency","tennis","tension","tent","territory","test","texture","thanks","theory","thing","things","thought","thread","thrill","throat","throne","thumb","thunder","ticket","tiger","time","tin","title","toad","toe","toes","tomatoes","tongue","tooth","toothbrush","toothpaste","top","topic","touch","town","toy","toys","trade","tradition","trail","train","trainer","trains","tramp","transport","transportation","tray","treatment","tree","trees","trick","trip","trouble","trousers","truck","trucks","truth","tub","turkey","turn","twig","twist","two","umbrella","uncle","understanding","underwear","union","unit","university","use","user","vacation","value","van","variation","variety","vase","vegetable","vehicle","veil","vein","verse","version","vessel","vest","video","view","village","virus","visitor","voice","volcano","volleyball","volume","voyage","walk","wall","war","warning","wash","waste","watch","water","wave","waves","wax","way","weakness","wealth","weather","wedding","week","weight","wheel","whip","whistle","wife","wilderness","wind","window","wine","wing","winner","winter","wire","wish","woman","women","wood","wool","word","work","worker","world","worm","wound","wren","wrench","wrist","writer","writing","yak","yam","yard","yarn","year","yoke","youth","zebra","zephyr","zinc","zipper","zoo"],"verbs":["abide","accelerate","accept","accomplish","accuse","achieve","acquire","acted","activate","adapt","add","address","adjust","administer","admire","admit","adopt","advise","afford","agree","alert","alight","allow","altered","amuse","analyze","announce","annoy","answer","anticipate","apologize","appear","applaud","applied","apply","appoint","appraise","appreciate","approach","approve","arbitrate","are","argue","arise","arrange","arrest","arrive","ascertain","ask","assemble","assess","assist","assume","assure","attach","attack","attain","attempt","attend","attract","audited","avoid","awake","back","bake","balance","ban","bang","bare","bat","bathe","battle","be","beam","bear","beat","become","beg","begin","behave","behold","believe","belong","bend","beset","bet","bid","bind","bite","bleach","bleed","bless","blind","blink","blot","blow","blush","boast","boil","bolt","bomb","book","bore","borrow","bounce","bow","box","brake","branch","break","breathe","breed","brief","bring","broadcast","bruise","brush","bubble","budget","build","bump","burn","burst","bury","bust","buy","buzz","calculate","call","camp","care","carry","carve","cast","catalog","catch","cause","celebrate","challenge","change","charge","chart","chase","cheat","check","cheer","chew","choke","choose","chop","claim","clap","clarify","classify","clean","clear","cling","clip","close","clothe","coach","coil","collect","color","comb","come","command","commit","communicate","compare","compete","compile","complain","complete","compose","compute","conceive","concentrate","conceptualize","concern","conclude","conduct","confess","confirm","confront","confuse","connect","conserve","consider","consist","consolidate","construct","consult","contain","continue","contract","control","convert","convince","coordinate","copy","correct","correlate","cost","cough","counsel","count","cover","crack","crash","crawl","create","creep","criticize","critique","cross","crush","cry","cure","curl","curve","cut","cycle","dam","damage","dance","dare","deal","decay","deceive","decide","decorate","define","delay","delegate","delight","deliver","demonstrate","depend","describe","desert","deserve","design","destroy","detail","detect","determine","develop","devise","diagnose","differ","dig","direct","disagree","disappear","disapprove","disarm","discover","discuss","dislike","dispense","display","disprove","dissect","distribute","dive","divert","divide","do","does","double","doubt","draft","drag","drain","dramatize","draw","dream","dress","drink","drip","drive","drop","drown","drum","dry","dust","dwell","earn","eat","edited","educate","eliminate","embarrass","emphasize","employ","empty","enable","enacted","encourage","encouraging","end","endure","enforce","engage","engineer","enhance","enjoy","enlist","ensure","enter","entertain","escape","establish","estimate","evaluate","examine","exceed","excite","excuse","execute","exercise","exhibit","exist","expand","expect","expedite","experiment","explain","explode","explore","express","extend","extract","face","facilitate","fade","fail","fancy","fasten","fax","fear","feed","feel","fence","fetch","fight","file","fill","film","finalize","finance","find","fire","fit","fix","flap","flash","flee","fling","float","flood","flow","flower","fly","fold","follow","fool","forbid","force","forecast","forego","foresee","foretell","forget","forgive","form","formulate","forsake","frame","freeze","frighten","fry","gather","gaze","generate","get","give","glow","glue","go","govern","grab","graduate","grate","grease","greet","grin","grind","grip","groan","grow","guarantee","guard","guess","guide","hammer","hand","handle","handwrite","hang","happen","harass","harm","has","hate","haunt","head","heal","heap","hear","heat","help","hesitate","hide","hit","hold","hook","hop","hope","hover","hug","hum","hunt","hurry","hurt","hypothesize","identify","ignore","illustrate","imagine","implement","imply","impress","improve","improvise","include","incorporate","increase","indicate","induce","influence","inform","initiate","inject","injure","inlay","innovate","input","insist","inspect","inspire","install","institute","instruct","insure","integrate","intend","intensify","interest","interfere","interlay","interpret","interrupt","interview","introduce","invent","inventory","invest","investigate","invite","involve","irritate","is","itch","jail","jam","jog","join","joke","judge","juggle","jump","justify","keep","kept","kick","kill","kiss","kneel","knit","knock","knot","know","label","land","last","laugh","launch","lay","lead","lean","leap","learn","leave","lecture","led","lend","let","level","license","lick","lie","lifted","light","lighten","like","list","listen","live","load","locate","lock","log","long","look","lose","love","maintain","make","man","manage","manipulate","manufacture","manufacturing","map","march","mark","market","marry","match","mate","matter","mean","measure","meddle","mediate","meet","melt","memorize","mend","mentor","milk","mine","mislead","miss","misspell","mistake","misunderstand","mix","moan","model","modify","monitor","moor","motivate","mourn","move","mow","muddle","mug","multiply","murder","nail","name","navigate","need","negotiate","nest","nod","nominate","normalize","note","notice","number","obey","object","observe","obtain","occur","offend","offer","officiate","open","operate","order","organize","oriented","originate","ought","overcome","overdo","overdraw","overflow","overhear","overtake","overthrow","owe","own","pack","paddle","paint","park","part","participate","pass","paste","pat","pause","pay","peck","pedal","peel","peep","perceive","perfect","perform","permit","persuade","phone","photograph","pick","pilot","pinch","pine","pinpoint","pioneer","place","plan","plant","play","plead","please","plug","point","poke","polish","pop","possess","post","pour","practice","praised","pray","preach","precede","predict","prefer","prepare","prescribe","present","preserve","preset","preside","press","pretend","prevent","prick","print","process","procure","produce","profess","program","progress","project","promise","promote","proofread","propose","protect","prove","provide","publicize","pull","pump","punch","puncture","punish","purchase","pursue","push","put","qualify","question","queue","quit","race","radiate","rain","raise","rank","rate","reach","react","read","realign","realize","reason","receive","recognize","recommend","reconcile","record","recruit","reduce","refer","reflect","refuse","regret","regulate","rehabilitate","reign","reinforce","reject","rejoice","relate","relax","release","relieve","rely","remain","remaining","remember","remind","remove","render","reorganize","repair","repeat","replace","reply","report","represent","reproduce","request","require","rescue","research","resolve","respond","restored","restructure","retain","retire","retrieve","return","review","revise","rhyme","rid","ride","ring","rinse","rise","risk","rob","rock","roll","rot","rub","ruin","rule","run","rush","sack","sail","satisfy","save","saw","say","scare","scatter","schedule","scold","scorch","scrape","scratch","scream","screw","scribble","scrub","seal","search","secure","see","seek","seem","select","sell","send","sense","separate","serve","service","set","settle","sew","shade","shake","shall","shape","share","shave","shear","shed","shelter","shine","shiver","shock","shoe","shoot","shop","show","shrink","shrug","shut","sigh","sign","signal","simplify","sin","sing","sink","sip","sit","sketch","ski","skip","slap","slay","sleep","slide","sling","slink","slip","slit","slow","smash","smell","smile","smite","smoke","snatch","sneak","sneeze","sniff","snore","snow","soak","solve","soothe","soothsay","sort","sound","sow","spare","spark","sparkle","speak","specify","speed","spell","spend","spill","spin","spit","split","spoil","spot","spray","spread","spring","sprout","squash","squeak","squeal","squeeze","stain","stamp","stand","stare","start","stay","steal","steer","step","stick","stimulate","sting","stink","stir","stitch","stop","store","strap","streamline","strengthen","stretch","stride","strike","string","strip","strive","stroke","structure","study","stuff","sublet","submit","subtract","succeed","suck","suffer","suggest","suit","summarize","supervise","supply","support","suppose","surprise","surround","survive","suspect","suspend","swear","sweat","sweep","swell","swim","swing","switch","symbolize","synthesize","systemize","tabulate","take","talk","tame","tap","target","taste","teach","tear","tease","telephone","tell","tempt","tend","terrify","test","thank","thaw","think","thrive","throw","thrust","tick","tickle","tie","time","tip","tire","touch","tour","tow","trace","trade","train","transcribe","transfer","transform","translate","transport","trap","travel","tread","treat","tremble","trick","trip","trot","trouble","troubleshoot","trust","try","tug","tumble","turn","tutor","twist","type","undergo","understand","undertake","undress","unfasten","unify","unite","unlock","unpack","untidy","update","upgrade","uphold","upset","use","utilize","vanish","vary","verbalize","verify","vex","visit","wail","wait","wake","walk","wander","want","warm","warn","wash","waste","watch","water","wave","wear","weave","wed","weep","weigh","welcome","wend","wet","whine","whip","whirl","whisper","whistle","win","wind","wink","wipe","wish","withdraw","withhold","withstand","wobble","wonder","work","worry","would","wrap","wreck","wrestle","wriggle","wring","write","xray","yawn","yell","zip","zoom"],"reserved":["about","abuse","access","account","accounts","ad","add","address","adm","admanager","admin","admindashboard","administration","administrator","ads","adsense","advertising","adwords","affiliate","affiliates","ajax","alias","analytics","android","anon","anonymous","api","app","apps","archive","asset","assets","assets1","assets2","assets3","auth","authenticate","authentication","auto","avatar","backup","backups","banner","banners","beta","billing","bin","blog","blogs","board","bot","bots","business","buy","cache","calendar","camo","campaign","careers","cdn","cgi","chat","child","cli","client","cliente","clients","cms","code","comercial","community","company","compare","conditions","config","connect","contact","contest","copyright","cp","cpanel","create","css","css1","css2","css3","dashboard","data","db","delete","demo","design","dev","develop","developer","developers","development","dir","directory","dns","doc","docs","documentation","domain","donate","download","downloads","ecommerce","edit","editor","email","faq","favorite","features","feed","feedback","feeds","file","files","follow","forum","forums","free","ftp","games","gettingstarted","git","global","graph","graphs","group","groups","guest","help","home","homepage","host","hosting","hostname","html","http","httpd","https","id","image","images","imap","img","img1","img2","img3","index","info","information","intranet","investors","invite","invoice","invoices","ios","ipad","iphone","irc","java","javascript","job","jobs","join","js","js1","js2","js3","knowledgebase","lab","list","lists","log","login","logout","logs","m","mail","mail1","mail2","mail3","mailer","mailing","mailto","manage","manager","marketing","master","me","media","message","messenger","mob","mobile","movie","movies","mp3","msg","msn","music","mx","my","mysql","name","named","net","network","networks","new","news","newsite","newsletter","notes","ns","ns1","ns2","ns3","old","online","openings","operator","order","orders","page","pages","panel","partner","partnerpage","partners","password","payment","payments","perl","photo","photos","php","pic","pics","plugin","plugins","pop","pop3","popular","post","postfix","postmaster","posts","privacy","prod","production","profile","project","projects","promo","pub","public","python","random","redirect","register","registration","resolver","root","rss","ruby","sale","sales","sample","samples","sandbox","script","scripts","search","secure","security","send","server","servers","service","setting","settings","setup","shop","signin","signup","site","sitemap","sites","sms","smtp","sorry","sql","ssh","ssl","stage","staging","start","stat","static","stats","status","storage","store","stores","subdomain","subscribe","support","survey","surveys","svn","system","tablet","tablets","talk","task","tasks","tech","telnet","terms","test","test1","test2","test3","teste","testing","tests","theme","themes","tmp","todo","tools","trac","tracking","translate","tv","update","upload","uploads","url","us","usage","user","username","users","validation","validations","video","videos","visitor","web","webdisk","webmail","webmaster","website","websites","whois","wiki","win","workshop","ww","wws","www","www1","www2","www3","wwws","wwww","xpg","you","yourdomain","yourname","yoursite","yourusername"],"manly":{"adjectives":["abandoned","almighty","avenged","bad","badass","ballistic","bareback","bearded","blackened","blazing","bloodied","bloody","bold","brave","brawny","bulged","bulging","burly","burnt","butch","caged","carnal","chiseled","courageous","dangerous","daring","deep","downtrodden","dry","elite","excessive","exploding","explosive","fallen","fearful","fearless","ferocious","fierce","fiery","flexing","flinty","forged","furious","gallant","gigantic","glorious","gnarly","golden","grandeur","greasy","grizzled","grizzly","gutsy","hanging","hardened","heavy","heroic","highpowered","hostile","howling","huge","hunky","impossible","inglorious","intense","iron","jackboot","kicking","legendary","macho","magnificent","mannish","max","maximum","mighty","monstrous","muscular","musky","nuclear","potent","powerful","premium","primal","pummeled","pure","rabid","raging","relentless","righteous","robust","rugged","ruthless","sauced","savage","sharp","sharpened","shaving","smoldering","stampeding","sterling","stormy","strapping","strong","stubbled","suave","super","supreme","swanson","sweaty","tame","techno","transcendent","turbo","tyrannosaurus","ultimate","unrelenting","vehicular","vicious","vigorous","violent","virile","viscous","weak","weathered","wild","zealous"],"nouns":["aggression","armageddon","attack","auger","avenger","bacon","badass","ballistic","balls","banner","bar","barbecue","barfight","baron","barrage","barrel","battle","battleaxe","bear","beard","bearskin","beef","beer","bicep","blaster","blood","bomb","bourbon","box","brawn","brimstone","bronco","bruise","buck","bull","bullet","burn","bushwak","buzzsaw","cage","camp","cannon","cannons","caution","chainsaw","challenge","chest","chop","cigar","claw","clip","cobra","coil","competition","corvette","courage","cure","cutlass","czar","damage","danger","darkness","death","deathgrip","deck","delay","demon","den","denim","desert","desire","dinosaur","dog","dogs","dominance","dragon","drain","drill","drone","dropkick","dust","eagle","eagles","earth","echo","emperor","empire","endurance","enemies","enemy","engine","explode","eye","face","falcon","fangs","fear","feast","fence","ferrari","fight","fightmaster","fire","fireball","fish","fist","flag","flames","flint","flood","fool","force","forge","fortress","frame","fume","gate","gates","glory","glue","grease","greatness","grill","guard","guts","hammer","harley","hawk","head","heap","heat","hell","hellfire","hero","heroes","hill","hills","hook","horsepower","hound","hounds","hulk","hurricane","ice","infinity","iron","jail","jaw","jaws","jerky","jet","jetblast","king","knees","knuckles","kraken","land","leather","legend","lightning","lion","lock","log","love","lumberjack","machete","magnificence","meat","meatslab","mercy","metal","mettle","might","mincemeat","missile","monster","mortal","motor","motorcycle","mount","mountain","mug","muscle","mustache","mustang","nail","nap","night","nunchuck","nunchuk","oak","oil","opponent","overdrive","pack","paint","panther","panzer","passion","peak","peg","phoenix","pine","pistol","piston","plane","power","predator","raptor","revolution","rex","ride","rifle","rock","rodeo","rope","rulership","saber","sauce","saw","scar","scorpion","scotch","seal","sergeant","shade","shark","shelter","shotgun","shrapnel","smoke","spark","spit","spoils","stain","stallion","stampede","stash","steak","stitch","storm","stranglehold","strap","stratosphere","streetfight","stunt","sun","swagger","swanson","sword","talon","tent","thunder","tiger","tire","titanium","toast","tomahawk","tomcat","tornado","torpedo","truck","turbo","turkeyleg","typhoon","uppercut","urge","valhalla","valley","vengeance","victory","vigor","viking","viper","war","warrior","warthog","weakness","whiskey","wizard","wolf","wolves"],"verbs":["alert","allege","annihilate","answer","arrest","attack","awake","balk","ban","bandage","bang","barbecue","bark","barter","bask","baste","battle","bellow","bend","besiege","bestow","bite","bleed","boast","boil","bolt","bomb","breach","break","breed","broil","bruise","build","bulge","burn","bury","camp","carve","chant","chase","chew","choke","chomp","chop","chug","claim","climb","clip","coach","command","conquer","cough","crack","crash","crush","cry","cure","curl","cut","damage","dare","decay","deceive","defeat","deliver","demand","destroy","dethrone","dictate","die","dig","dislike","dive","divide","divulge","dominate","drag","drain","dread","drill","drink","drip","dump","eat","encode","engulf","escape","evacuate","explode","explore","fade","fail","fall","fasten","feast","feed","fight","fix","flex","fly","force","fry","gaze","gnaw","gorge","grab","grill","grip","growl","grumble","grunt","guard","gurgle","handle","hang","harass","harm","hate","haunt","hibernate","hide","hijack","hinder","hiss","hit","hoist","howl","hunt","hurt","impose","infect","infuse","itch","jam","jolt","jump","kick","kill","knock","knot","land","launch","lift","manhandle","marvel","mate","measure","melt","mend","merge","mount","mow","murder","park","plow","polish","preserve","protect","pry","pull","pummel","pump","punch","puncture","punish","pursue","push","race","rave","reign","repair","report","reprimand","request","rescue","ride","rip","risk","roar","rock","roll","rot","run","rush","sack","sail","saw","scale","scold","scorch","scrape","scratch","scream","screech","seal","search","seize","sever","shade","shave","shock","shoot","shout","shriek","signal","sin","singe","ski","slap","sleep","smash","smoke","snore","soak","soar","spark","squash","squeeze","stab","stain","stamp","stare","steer","stitch","stoke","storm","strengthen","stretch","strike","strut","stuff","stun","submerge","surround","tackle","tame","taunt","tear","tempt","terrify","test","thaw","threaten","thrust","tie","tow","track","trade","transcend","trap","traverse","trim","triumph","trust","tug","unite","uppercut","vanquish","watch","weigh","whip","win","wipe","work","wreck","wrestle","yield"]}}'),R4={},ht={},Va={exports:{}},lt={},$v={};$v.byteLength=fre;$v.toByteArray=dre;$v.fromByteArray=mre;var Rs=[],Ii=[],cre=typeof Uint8Array!="undefined"?Uint8Array:Array,Y_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Uc=0,lre=Y_.length;Uc0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function fre(t){var e=N4(t),r=e[0],n=e[1];return(r+n)*3/4-n}function hre(t,e,r){return(e+r)*3/4-r}function dre(t){var e,r=N4(t),n=r[0],i=r[1],s=new cre(hre(t,n,i)),o=0,a=i>0?n-4:n,u;for(u=0;u>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Ii[t.charCodeAt(u)]<<2|Ii[t.charCodeAt(u+1)]>>4,s[o++]=e&255),i===1&&(e=Ii[t.charCodeAt(u)]<<10|Ii[t.charCodeAt(u+1)]<<4|Ii[t.charCodeAt(u+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function pre(t){return Rs[t>>18&63]+Rs[t>>12&63]+Rs[t>>6&63]+Rs[t&63]}function gre(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(Rs[e>>2]+Rs[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Rs[e>>10]+Rs[e>>4&63]+Rs[e<<2&63]+"=")),i.join("")}var uS={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */uS.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,u=(1<>1,l=-7,h=r?i-1:0,d=r?-1:1,_=t[e+h];for(h+=d,s=_&(1<<-l)-1,_>>=-l,l+=a;l>0;s=s*256+t[e+h],h+=d,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=o*256+t[e+h],h+=d,l-=8);if(s===0)s=1-c;else{if(s===u)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-c}return(_?-1:1)*o*Math.pow(2,s-n)};uS.write=function(t,e,r,n,i,s){var o,a,u,c=s*8-i-1,l=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:s-1,T=n?1:-1,D=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?e+=d/u:e+=d*Math.pow(2,1-h),e*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(e*u-1)*Math.pow(2,i),o=o+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+_]=a&255,_+=T,a/=256,i-=8);for(o=o<0;t[r+_]=o&255,_+=T,o/=256,c-=8);t[r+_-T]|=D*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */(function(t){const e=$v,r=uS,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const C=new Uint8Array(1),b={foo:function(){return 42}};return Object.setPrototypeOf(b,Uint8Array.prototype),Object.setPrototypeOf(C,b),C.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function o(C){if(C>i)throw new RangeError('The value "'+C+'" is invalid for option "size"');const b=new Uint8Array(C);return Object.setPrototypeOf(b,a.prototype),b}function a(C,b,E){if(typeof C=="number"){if(typeof b=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(C)}return u(C,b,E)}a.poolSize=8192;function u(C,b,E){if(typeof C=="string")return d(C,b);if(ArrayBuffer.isView(C))return T(C);if(C==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C);if(ge(C,ArrayBuffer)||C&&ge(C.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ge(C,SharedArrayBuffer)||C&&ge(C.buffer,SharedArrayBuffer)))return D(C,b,E);if(typeof C=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const P=C.valueOf&&C.valueOf();if(P!=null&&P!==C)return a.from(P,b,E);const W=N(C);if(W)return W;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof C[Symbol.toPrimitive]=="function")return a.from(C[Symbol.toPrimitive]("string"),b,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C)}a.from=function(C,b,E){return u(C,b,E)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(C){if(typeof C!="number")throw new TypeError('"size" argument must be of type number');if(C<0)throw new RangeError('The value "'+C+'" is invalid for option "size"')}function l(C,b,E){return c(C),C<=0?o(C):b!==void 0?typeof E=="string"?o(C).fill(b,E):o(C).fill(b):o(C)}a.alloc=function(C,b,E){return l(C,b,E)};function h(C){return c(C),o(C<0?0:O(C)|0)}a.allocUnsafe=function(C){return h(C)},a.allocUnsafeSlow=function(C){return h(C)};function d(C,b){if((typeof b!="string"||b==="")&&(b="utf8"),!a.isEncoding(b))throw new TypeError("Unknown encoding: "+b);const E=J(C,b)|0;let P=o(E);const W=P.write(C,b);return W!==E&&(P=P.slice(0,W)),P}function _(C){const b=C.length<0?0:O(C.length)|0,E=o(b);for(let P=0;P=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return C|0}function L(C){return+C!=C&&(C=0),a.alloc(+C)}a.isBuffer=function(b){return b!=null&&b._isBuffer===!0&&b!==a.prototype},a.compare=function(b,E){if(ge(b,Uint8Array)&&(b=a.from(b,b.offset,b.byteLength)),ge(E,Uint8Array)&&(E=a.from(E,E.offset,E.byteLength)),!a.isBuffer(b)||!a.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(b===E)return 0;let P=b.length,W=E.length;for(let re=0,te=Math.min(P,W);reW.length?(a.isBuffer(te)||(te=a.from(te)),te.copy(W,re)):Uint8Array.prototype.set.call(W,te,re);else if(a.isBuffer(te))te.copy(W,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=te.length}return W};function J(C,b){if(a.isBuffer(C))return C.length;if(ArrayBuffer.isView(C)||ge(C,ArrayBuffer))return C.byteLength;if(typeof C!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof C);const E=C.length,P=arguments.length>2&&arguments[2]===!0;if(!P&&E===0)return 0;let W=!1;for(;;)switch(b){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return ae(C).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return Ee(C).length;default:if(W)return P?-1:ae(C).length;b=(""+b).toLowerCase(),W=!0}}a.byteLength=J;function q(C,b,E){let P=!1;if((b===void 0||b<0)&&(b=0),b>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,b>>>=0,E<=b))return"";for(C||(C="utf8");;)switch(C){case"hex":return A(this,b,E);case"utf8":case"utf-8":return f(this,b,E);case"ascii":return I(this,b,E);case"latin1":case"binary":return M(this,b,E);case"base64":return g(this,b,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,b,E);default:if(P)throw new TypeError("Unknown encoding: "+C);C=(C+"").toLowerCase(),P=!0}}a.prototype._isBuffer=!0;function z(C,b,E){const P=C[b];C[b]=C[E],C[E]=P}a.prototype.swap16=function(){const b=this.length;if(b%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let E=0;EE&&(b+=" ... "),""},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(b,E,P,W,re){if(ge(b,Uint8Array)&&(b=a.from(b,b.offset,b.byteLength)),!a.isBuffer(b))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof b);if(E===void 0&&(E=0),P===void 0&&(P=b?b.length:0),W===void 0&&(W=0),re===void 0&&(re=this.length),E<0||P>b.length||W<0||re>this.length)throw new RangeError("out of range index");if(W>=re&&E>=P)return 0;if(W>=re)return-1;if(E>=P)return 1;if(E>>>=0,P>>>=0,W>>>=0,re>>>=0,this===b)return 0;let te=re-W,be=P-E;const qe=Math.min(te,be),Me=this.slice(W,re),Ue=b.slice(E,P);for(let je=0;je2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,Oe(E)&&(E=W?0:C.length-1),E<0&&(E=C.length+E),E>=C.length){if(W)return-1;E=C.length-1}else if(E<0)if(W)E=0;else return-1;if(typeof b=="string"&&(b=a.from(b,P)),a.isBuffer(b))return b.length===0?-1:G(C,b,E,P,W);if(typeof b=="number")return b=b&255,typeof Uint8Array.prototype.indexOf=="function"?W?Uint8Array.prototype.indexOf.call(C,b,E):Uint8Array.prototype.lastIndexOf.call(C,b,E):G(C,[b],E,P,W);throw new TypeError("val must be string, number or Buffer")}function G(C,b,E,P,W){let re=1,te=C.length,be=b.length;if(P!==void 0&&(P=String(P).toLowerCase(),P==="ucs2"||P==="ucs-2"||P==="utf16le"||P==="utf-16le")){if(C.length<2||b.length<2)return-1;re=2,te/=2,be/=2,E/=2}function qe(Ue,je){return re===1?Ue[je]:Ue.readUInt16BE(je*re)}let Me;if(W){let Ue=-1;for(Me=E;Mete&&(E=te-be),Me=E;Me>=0;Me--){let Ue=!0;for(let je=0;jeW&&(P=W)):P=W;const re=b.length;P>re/2&&(P=re/2);let te;for(te=0;te>>0,isFinite(P)?(P=P>>>0,W===void 0&&(W="utf8")):(W=P,P=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const re=this.length-E;if((P===void 0||P>re)&&(P=re),b.length>0&&(P<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");let te=!1;for(;;)switch(W){case"hex":return ne(this,b,E,P);case"utf8":case"utf-8":return ue(this,b,E,P);case"ascii":case"latin1":case"binary":return _e(this,b,E,P);case"base64":return F(this,b,E,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,b,E,P);default:if(te)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),te=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function g(C,b,E){return b===0&&E===C.length?e.fromByteArray(C):e.fromByteArray(C.slice(b,E))}function f(C,b,E){E=Math.min(C.length,E);const P=[];let W=b;for(;W239?4:re>223?3:re>191?2:1;if(W+be<=E){let qe,Me,Ue,je;switch(be){case 1:re<128&&(te=re);break;case 2:qe=C[W+1],(qe&192)===128&&(je=(re&31)<<6|qe&63,je>127&&(te=je));break;case 3:qe=C[W+1],Me=C[W+2],(qe&192)===128&&(Me&192)===128&&(je=(re&15)<<12|(qe&63)<<6|Me&63,je>2047&&(je<55296||je>57343)&&(te=je));break;case 4:qe=C[W+1],Me=C[W+2],Ue=C[W+3],(qe&192)===128&&(Me&192)===128&&(Ue&192)===128&&(je=(re&15)<<18|(qe&63)<<12|(Me&63)<<6|Ue&63,je>65535&&je<1114112&&(te=je))}}te===null?(te=65533,be=1):te>65535&&(te-=65536,P.push(te>>>10&1023|55296),te=56320|te&1023),P.push(te),W+=be}return y(P)}const p=4096;function y(C){const b=C.length;if(b<=p)return String.fromCharCode.apply(String,C);let E="",P=0;for(;PP)&&(E=P);let W="";for(let re=b;reP&&(b=P),E<0?(E+=P,E<0&&(E=0)):E>P&&(E=P),EE)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(b,E,P){b=b>>>0,E=E>>>0,P||S(b,E,this.length);let W=this[b],re=1,te=0;for(;++te>>0,E=E>>>0,P||S(b,E,this.length);let W=this[b+--E],re=1;for(;E>0&&(re*=256);)W+=this[b+--E]*re;return W},a.prototype.readUint8=a.prototype.readUInt8=function(b,E){return b=b>>>0,E||S(b,1,this.length),this[b]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(b,E){return b=b>>>0,E||S(b,2,this.length),this[b]|this[b+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(b,E){return b=b>>>0,E||S(b,2,this.length),this[b]<<8|this[b+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(b,E){return b=b>>>0,E||S(b,4,this.length),(this[b]|this[b+1]<<8|this[b+2]<<16)+this[b+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(b,E){return b=b>>>0,E||S(b,4,this.length),this[b]*16777216+(this[b+1]<<16|this[b+2]<<8|this[b+3])},a.prototype.readBigUInt64LE=Ce(function(b){b=b>>>0,$(b,"offset");const E=this[b],P=this[b+7];(E===void 0||P===void 0)&&V(b,this.length-8);const W=E+this[++b]*2**8+this[++b]*2**16+this[++b]*2**24,re=this[++b]+this[++b]*2**8+this[++b]*2**16+P*2**24;return BigInt(W)+(BigInt(re)<>>0,$(b,"offset");const E=this[b],P=this[b+7];(E===void 0||P===void 0)&&V(b,this.length-8);const W=E*2**24+this[++b]*2**16+this[++b]*2**8+this[++b],re=this[++b]*2**24+this[++b]*2**16+this[++b]*2**8+P;return(BigInt(W)<>>0,E=E>>>0,P||S(b,E,this.length);let W=this[b],re=1,te=0;for(;++te=re&&(W-=Math.pow(2,8*E)),W},a.prototype.readIntBE=function(b,E,P){b=b>>>0,E=E>>>0,P||S(b,E,this.length);let W=E,re=1,te=this[b+--W];for(;W>0&&(re*=256);)te+=this[b+--W]*re;return re*=128,te>=re&&(te-=Math.pow(2,8*E)),te},a.prototype.readInt8=function(b,E){return b=b>>>0,E||S(b,1,this.length),this[b]&128?(255-this[b]+1)*-1:this[b]},a.prototype.readInt16LE=function(b,E){b=b>>>0,E||S(b,2,this.length);const P=this[b]|this[b+1]<<8;return P&32768?P|4294901760:P},a.prototype.readInt16BE=function(b,E){b=b>>>0,E||S(b,2,this.length);const P=this[b+1]|this[b]<<8;return P&32768?P|4294901760:P},a.prototype.readInt32LE=function(b,E){return b=b>>>0,E||S(b,4,this.length),this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24},a.prototype.readInt32BE=function(b,E){return b=b>>>0,E||S(b,4,this.length),this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]},a.prototype.readBigInt64LE=Ce(function(b){b=b>>>0,$(b,"offset");const E=this[b],P=this[b+7];(E===void 0||P===void 0)&&V(b,this.length-8);const W=this[b+4]+this[b+5]*2**8+this[b+6]*2**16+(P<<24);return(BigInt(W)<>>0,$(b,"offset");const E=this[b],P=this[b+7];(E===void 0||P===void 0)&&V(b,this.length-8);const W=(E<<24)+this[++b]*2**16+this[++b]*2**8+this[++b];return(BigInt(W)<>>0,E||S(b,4,this.length),r.read(this,b,!0,23,4)},a.prototype.readFloatBE=function(b,E){return b=b>>>0,E||S(b,4,this.length),r.read(this,b,!1,23,4)},a.prototype.readDoubleLE=function(b,E){return b=b>>>0,E||S(b,8,this.length),r.read(this,b,!0,52,8)},a.prototype.readDoubleBE=function(b,E){return b=b>>>0,E||S(b,8,this.length),r.read(this,b,!1,52,8)};function w(C,b,E,P,W,re){if(!a.isBuffer(C))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>W||bC.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(b,E,P,W){if(b=+b,E=E>>>0,P=P>>>0,!W){const be=Math.pow(2,8*P)-1;w(this,b,E,P,be,0)}let re=1,te=0;for(this[E]=b&255;++te>>0,P=P>>>0,!W){const be=Math.pow(2,8*P)-1;w(this,b,E,P,be,0)}let re=P-1,te=1;for(this[E+re]=b&255;--re>=0&&(te*=256);)this[E+re]=b/te&255;return E+P},a.prototype.writeUint8=a.prototype.writeUInt8=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,1,255,0),this[E]=b&255,E+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,2,65535,0),this[E]=b&255,this[E+1]=b>>>8,E+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,2,65535,0),this[E]=b>>>8,this[E+1]=b&255,E+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,4,4294967295,0),this[E+3]=b>>>24,this[E+2]=b>>>16,this[E+1]=b>>>8,this[E]=b&255,E+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,4,4294967295,0),this[E]=b>>>24,this[E+1]=b>>>16,this[E+2]=b>>>8,this[E+3]=b&255,E+4};function U(C,b,E,P,W){ie(b,P,W,C,E,7);let re=Number(b&BigInt(4294967295));C[E++]=re,re=re>>8,C[E++]=re,re=re>>8,C[E++]=re,re=re>>8,C[E++]=re;let te=Number(b>>BigInt(32)&BigInt(4294967295));return C[E++]=te,te=te>>8,C[E++]=te,te=te>>8,C[E++]=te,te=te>>8,C[E++]=te,E}function me(C,b,E,P,W){ie(b,P,W,C,E,7);let re=Number(b&BigInt(4294967295));C[E+7]=re,re=re>>8,C[E+6]=re,re=re>>8,C[E+5]=re,re=re>>8,C[E+4]=re;let te=Number(b>>BigInt(32)&BigInt(4294967295));return C[E+3]=te,te=te>>8,C[E+2]=te,te=te>>8,C[E+1]=te,te=te>>8,C[E]=te,E+8}a.prototype.writeBigUInt64LE=Ce(function(b,E=0){return U(this,b,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Ce(function(b,E=0){return me(this,b,E,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(b,E,P,W){if(b=+b,E=E>>>0,!W){const qe=Math.pow(2,8*P-1);w(this,b,E,P,qe-1,-qe)}let re=0,te=1,be=0;for(this[E]=b&255;++re>0)-be&255;return E+P},a.prototype.writeIntBE=function(b,E,P,W){if(b=+b,E=E>>>0,!W){const qe=Math.pow(2,8*P-1);w(this,b,E,P,qe-1,-qe)}let re=P-1,te=1,be=0;for(this[E+re]=b&255;--re>=0&&(te*=256);)b<0&&be===0&&this[E+re+1]!==0&&(be=1),this[E+re]=(b/te>>0)-be&255;return E+P},a.prototype.writeInt8=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,1,127,-128),b<0&&(b=255+b+1),this[E]=b&255,E+1},a.prototype.writeInt16LE=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,2,32767,-32768),this[E]=b&255,this[E+1]=b>>>8,E+2},a.prototype.writeInt16BE=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,2,32767,-32768),this[E]=b>>>8,this[E+1]=b&255,E+2},a.prototype.writeInt32LE=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,4,2147483647,-2147483648),this[E]=b&255,this[E+1]=b>>>8,this[E+2]=b>>>16,this[E+3]=b>>>24,E+4},a.prototype.writeInt32BE=function(b,E,P){return b=+b,E=E>>>0,P||w(this,b,E,4,2147483647,-2147483648),b<0&&(b=4294967295+b+1),this[E]=b>>>24,this[E+1]=b>>>16,this[E+2]=b>>>8,this[E+3]=b&255,E+4},a.prototype.writeBigInt64LE=Ce(function(b,E=0){return U(this,b,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Ce(function(b,E=0){return me(this,b,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function x(C,b,E,P,W,re){if(E+P>C.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function k(C,b,E,P,W){return b=+b,E=E>>>0,W||x(C,b,E,4),r.write(C,b,E,P,23,4),E+4}a.prototype.writeFloatLE=function(b,E,P){return k(this,b,E,!0,P)},a.prototype.writeFloatBE=function(b,E,P){return k(this,b,E,!1,P)};function R(C,b,E,P,W){return b=+b,E=E>>>0,W||x(C,b,E,8),r.write(C,b,E,P,52,8),E+8}a.prototype.writeDoubleLE=function(b,E,P){return R(this,b,E,!0,P)},a.prototype.writeDoubleBE=function(b,E,P){return R(this,b,E,!1,P)},a.prototype.copy=function(b,E,P,W){if(!a.isBuffer(b))throw new TypeError("argument should be a Buffer");if(P||(P=0),!W&&W!==0&&(W=this.length),E>=b.length&&(E=b.length),E||(E=0),W>0&&W=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),b.length-E>>0,P=P===void 0?this.length:P>>>0,b||(b=0);let re;if(typeof b=="number")for(re=E;re2**32?W=oe(String(E)):typeof E=="bigint"&&(W=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(W=oe(W)),W+="n"),P+=` It must be ${b}. Received ${W}`,P},RangeError);function oe(C){let b="",E=C.length;const P=C[0]==="-"?1:0;for(;E>=P+4;E-=3)b=`_${C.slice(E-3,E)}${b}`;return`${C.slice(0,E)}${b}`}function fe(C,b,E){$(b,"offset"),(C[b]===void 0||C[b+E]===void 0)&&V(b,C.length-(E+1))}function ie(C,b,E,P,W,re){if(C>E||C3?b===0||b===BigInt(0)?be=`>= 0${te} and < 2${te} ** ${(re+1)*8}${te}`:be=`>= -(2${te} ** ${(re+1)*8-1}${te}) and < 2 ** ${(re+1)*8-1}${te}`:be=`>= ${b}${te} and <= ${E}${te}`,new j.ERR_OUT_OF_RANGE("value",be,C)}fe(P,W,re)}function $(C,b){if(typeof C!="number")throw new j.ERR_INVALID_ARG_TYPE(b,"number",C)}function V(C,b,E){throw Math.floor(C)!==C?($(C,E),new j.ERR_OUT_OF_RANGE(E||"offset","an integer",C)):b<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE(E||"offset",`>= ${E?1:0} and <= ${b}`,C)}const Y=/[^+/0-9A-Za-z-_]/g;function ce(C){if(C=C.split("=")[0],C=C.trim().replace(Y,""),C.length<2)return"";for(;C.length%4!==0;)C=C+"=";return C}function ae(C,b){b=b||1/0;let E;const P=C.length;let W=null;const re=[];for(let te=0;te55295&&E<57344){if(!W){if(E>56319){(b-=3)>-1&&re.push(239,191,189);continue}else if(te+1===P){(b-=3)>-1&&re.push(239,191,189);continue}W=E;continue}if(E<56320){(b-=3)>-1&&re.push(239,191,189),W=E;continue}E=(W-55296<<10|E-56320)+65536}else W&&(b-=3)>-1&&re.push(239,191,189);if(W=null,E<128){if((b-=1)<0)break;re.push(E)}else if(E<2048){if((b-=2)<0)break;re.push(E>>6|192,E&63|128)}else if(E<65536){if((b-=3)<0)break;re.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((b-=4)<0)break;re.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return re}function le(C){const b=[];for(let E=0;E>8,W=E%256,re.push(W),re.push(P);return re}function Ee(C){return e.toByteArray(ce(C))}function pe(C,b,E,P){let W;for(W=0;W=b.length||W>=C.length);++W)b[W+E]=C[W];return W}function ge(C,b){return C instanceof b||C!=null&&C.constructor!=null&&C.constructor.name!=null&&C.constructor.name===b.name}function Oe(C){return C!==C}const Te=function(){const C="0123456789abcdef",b=new Array(256);for(let E=0;E<16;++E){const P=E*16;for(let W=0;W<16;++W)b[P+W]=C[E]+C[W]}return b}();function Ce(C){return typeof BigInt=="undefined"?De:C}function De(){throw new Error("BigInt not supported")}})(lt);var J_=65536,vre=4294967295;function yre(){throw new Error(`Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11`)}var _re=lt.Buffer,G0=ut.crypto||ut.msCrypto;G0&&G0.getRandomValues?Va.exports=bre:Va.exports=yre;function bre(t,e){if(t>vre)throw new RangeError("requested too many random bytes");var r=_re.allocUnsafe(t);if(t>0)if(t>J_)for(var n=0;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(u===void 0)return!1;if(typeof u=="function")Ak(u,this,r);else for(var c=u.length,l=F4(u,c),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,wre(a)}return t}er.prototype.addListener=function(e,r){return P4(this,e,r,!1)};er.prototype.on=er.prototype.addListener;er.prototype.prependListener=function(e,r){return P4(this,e,r,!0)};function Ere(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function L4(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Ere.bind(n);return i.listener=r,n.wrapFn=i,i}er.prototype.once=function(e,r){return Uv(r),this.on(e,L4(this,e,r)),this};er.prototype.prependOnceListener=function(e,r){return Uv(r),this.prependListener(e,L4(this,e,r)),this};er.prototype.removeListener=function(e,r){var n,i,s,o,a;if(Uv(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():xre(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};er.prototype.off=er.prototype.removeListener;er.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function B4(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Sre(i):F4(i,i.length)}er.prototype.listeners=function(e){return B4(this,e,!0)};er.prototype.rawListeners=function(e){return B4(this,e,!1)};er.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):$4.call(t,e)};er.prototype.listenerCount=$4;function $4(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}er.prototype.eventNames=function(){return this._eventsCount>0?$g(this._events):[]};function F4(t,e){for(var r=new Array(e),n=0;n0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return Fg.alloc(0);for(var n=Fg.allocUnsafe(r>>>0),i=this.head,s=0;i;)Dre(i.data,n,s),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return ro.length?o.length:r;if(a===o.length?s+=o:s+=o.slice(0,r),r-=a,r===0){a===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++i}return this.length-=i,s}},{key:"_getBuffer",value:function(r){var n=Fg.allocUnsafe(r),i=this.head,s=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,a=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,a),r-=a,r===0){a===o.length?(++s,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++s}return this.length-=s,n}},{key:Ore,value:function(r,n){return K1(this,Are({},n,{depth:0,customInspect:!1}))}}]),t}();function Lre(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(G1,this,t)):process.nextTick(G1,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Ug,r):(r._writableState.errorEmitted=!0,process.nextTick(Rk,r,s)):process.nextTick(Rk,r,s):e?(process.nextTick(Ug,r),e(s)):process.nextTick(Ug,r)}),this)}function Rk(t,e){G1(t,e),Ug(t)}function Ug(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Bre(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function G1(t,e){t.emit("error",e)}function $re(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var j4={destroy:Lre,undestroy:Bre,errorOrDestroy:$re},kc={};function Fre(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var V4={};function Ui(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){Fre(o,s);function o(a,u,c){return s.call(this,n(a,u,c))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,V4[t]=i}function Nk(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function Ure(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function qre(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function jre(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Ui("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Ui("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&Ure(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(qre(t," argument"))i="The ".concat(t," ").concat(n," ").concat(Nk(e,"type"));else{var s=jre(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(Nk(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Ui("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ui("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Ui("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ui("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Ui("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ui("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ui("ERR_STREAM_WRITE_AFTER_END","write after end");Ui("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ui("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Ui("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");kc.codes=V4;var Vre=kc.codes.ERR_INVALID_OPT_VALUE;function zre(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Hre(t,e,r,n){var i=zre(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Vre(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var z4={getHighWaterMark:Hre},qv={},cS=lt.Buffer,Ok=cS.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Kre(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function Gre(t){var e=Kre(t);if(typeof e!="string"&&(cS.isEncoding===Ok||!Ok(t)))throw new Error("Unknown encoding: "+t);return e||t}qv.StringDecoder=_p;function _p(t){this.encoding=Gre(t);var e;switch(this.encoding){case"utf16le":this.text=Zre,this.end=ene,e=4;break;case"utf8":this.fillLast=Yre,e=4;break;case"base64":this.text=tne,this.end=rne,e=3;break;default:this.write=nne,this.end=ine;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=cS.allocUnsafe(e)}_p.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Wre(t,e,r){var n=e.length-1;if(n=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function Xre(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function Yre(t){var e=this.lastTotal-this.lastNeed,r=Xre(this,t);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function Jre(t,e){var r=Wre(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function Qre(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Zre(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function ene(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function tne(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function rne(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function nne(t){return t.toString(this.encoding)}function ine(t){return t&&t.length?this.write(t):""}var Dk=kc.codes.ERR_STREAM_PREMATURE_CLOSE;function sne(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==Vv.prototype&&(e=yne(e)),n)s.endEmitted?qh(t,new Tne):nb(t,s,e,!0);else if(s.ended)qh(t,new Sne);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?nb(t,s,e,!1):W1(t,s)):nb(t,s,e,!1)}else n||(s.reading=!1,W1(t,s))}return!s.ended&&(s.length=Pk?t=Pk:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Lk(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Mne(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Tt.prototype.read=function(t){bt("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return bt("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ib(this):Hv(this),null;if(t=Lk(t,e),t===0&&e.ended)return e.length===0&&ib(this),null;var n=e.needReadable;bt("need readable",n),(e.length===0||e.length-t0?i=J4(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&ib(this)),i!==null&&this.emit("data",i),i};function Cne(t,e){if(bt("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Hv(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,X4(t)))}}function Hv(t){var e=t._readableState;bt("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(bt("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(X4,t))}function X4(t){var e=t._readableState;bt("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,dS(t)}function W1(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(Rne,t,e))}function Rne(t,e){for(;!e.reading&&!e.ended&&(e.length1&&Q4(n.pipes,t)!==-1)&&!c&&(bt("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(N){bt("onerror",N),D(),t.removeListener("error",d),K4(t,"error")===0&&qh(t,N)}Ane(t,"error",d);function _(){t.removeListener("finish",T),D()}t.once("close",_);function T(){bt("onfinish"),t.removeListener("close",_),D()}t.once("finish",T);function D(){bt("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(bt("pipe resume"),r.resume()),t};function Nne(t){return function(){var r=t._readableState;bt("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&K4(t,"data")&&(r.flowing=!0,dS(t))}}Tt.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,bt("on readable",n.length,n.reading),n.length?Hv(this):n.reading||process.nextTick(One,this)),r};Tt.prototype.addListener=Tt.prototype.on;Tt.prototype.removeListener=function(t,e){var r=bp.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Y4,this),r};Tt.prototype.removeAllListeners=function(t){var e=bp.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Y4,this),e};function Y4(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function One(t){bt("readable nexttick read 0"),t.read(0)}Tt.prototype.resume=function(){var t=this._readableState;return t.flowing||(bt("resume"),t.flowing=!t.readableListening,Dne(this,t)),t.paused=!1,this};function Dne(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(Pne,t,e))}function Pne(t,e){bt("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),dS(t),e.flowing&&!e.reading&&t.read(0)}Tt.prototype.pause=function(){return bt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(bt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function dS(t){var e=t._readableState;for(bt("flow",e.flowing);e.flowing&&t.read()!==null;);}Tt.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(bt("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&e.push(o)}e.push(null)}),t.on("data",function(o){if(bt("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var a=e.push(o);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var s=0;s=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function ib(t){var e=t._readableState;bt("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(Lne,e,t))}function Lne(t,e){if(bt("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Tt.from=function(t,e){return tb===void 0&&(tb=mne),tb(Tt,t,e)});function Q4(t,e){for(var r=0,n=t.length;r-1))throw new Qne(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(yr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function rie(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Kv.from(e,r)),e}Object.defineProperty(yr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function nie(t,e,r,n,i,s){if(!r){var o=rie(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length0;return Tie(o,u,c,function(l){i||(i=l),l&&s.forEach(qk),!u&&(s.forEach(qk),n(i))})});return e.reduce(Aie)}var Cie=Mie;(function(t,e){e=t.exports=jv,e.Stream=e,e.Readable=e,e.Writable=Z4,e.Duplex=iP,e.Transform=oP,e.PassThrough=wie,e.finished=lS,e.pipeline=Cie})(Od,Od.exports);var X0=lt.Buffer,cP=Od.exports.Transform,Rie=vt.exports;function Nie(t,e){if(!X0.isBuffer(t)&&typeof t!="string")throw new TypeError(e+" must be a string or a buffer")}function ru(t){cP.call(this),this._block=X0.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}Rie(ru,cP);ru.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(i){n=i}r(n)};ru.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)};ru.prototype.update=function(t,e){if(Nie(t,"Data"),this._finalized)throw new Error("Digest already called");X0.isBuffer(t)||(t=X0.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var i=this._blockOffset;i0;++s)this._length[s]+=o,o=this._length[s]/4294967296|0,o>0&&(this._length[s]-=4294967296*o);return this};ru.prototype._update=function(){throw new Error("_update is not implemented")};ru.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();t!==void 0&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e};ru.prototype._digest=function(){throw new Error("_digest is not implemented")};var lP=ru,Oie=vt.exports,fP=lP,Die=lt.Buffer,Pie=new Array(16);function Xv(){fP.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}Oie(Xv,fP);Xv.prototype._update=function(){for(var t=Pie,e=0;e<16;++e)t[e]=this._block.readInt32LE(e*4);var r=this._a,n=this._b,i=this._c,s=this._d;r=ln(r,n,i,s,t[0],3614090360,7),s=ln(s,r,n,i,t[1],3905402710,12),i=ln(i,s,r,n,t[2],606105819,17),n=ln(n,i,s,r,t[3],3250441966,22),r=ln(r,n,i,s,t[4],4118548399,7),s=ln(s,r,n,i,t[5],1200080426,12),i=ln(i,s,r,n,t[6],2821735955,17),n=ln(n,i,s,r,t[7],4249261313,22),r=ln(r,n,i,s,t[8],1770035416,7),s=ln(s,r,n,i,t[9],2336552879,12),i=ln(i,s,r,n,t[10],4294925233,17),n=ln(n,i,s,r,t[11],2304563134,22),r=ln(r,n,i,s,t[12],1804603682,7),s=ln(s,r,n,i,t[13],4254626195,12),i=ln(i,s,r,n,t[14],2792965006,17),n=ln(n,i,s,r,t[15],1236535329,22),r=fn(r,n,i,s,t[1],4129170786,5),s=fn(s,r,n,i,t[6],3225465664,9),i=fn(i,s,r,n,t[11],643717713,14),n=fn(n,i,s,r,t[0],3921069994,20),r=fn(r,n,i,s,t[5],3593408605,5),s=fn(s,r,n,i,t[10],38016083,9),i=fn(i,s,r,n,t[15],3634488961,14),n=fn(n,i,s,r,t[4],3889429448,20),r=fn(r,n,i,s,t[9],568446438,5),s=fn(s,r,n,i,t[14],3275163606,9),i=fn(i,s,r,n,t[3],4107603335,14),n=fn(n,i,s,r,t[8],1163531501,20),r=fn(r,n,i,s,t[13],2850285829,5),s=fn(s,r,n,i,t[2],4243563512,9),i=fn(i,s,r,n,t[7],1735328473,14),n=fn(n,i,s,r,t[12],2368359562,20),r=hn(r,n,i,s,t[5],4294588738,4),s=hn(s,r,n,i,t[8],2272392833,11),i=hn(i,s,r,n,t[11],1839030562,16),n=hn(n,i,s,r,t[14],4259657740,23),r=hn(r,n,i,s,t[1],2763975236,4),s=hn(s,r,n,i,t[4],1272893353,11),i=hn(i,s,r,n,t[7],4139469664,16),n=hn(n,i,s,r,t[10],3200236656,23),r=hn(r,n,i,s,t[13],681279174,4),s=hn(s,r,n,i,t[0],3936430074,11),i=hn(i,s,r,n,t[3],3572445317,16),n=hn(n,i,s,r,t[6],76029189,23),r=hn(r,n,i,s,t[9],3654602809,4),s=hn(s,r,n,i,t[12],3873151461,11),i=hn(i,s,r,n,t[15],530742520,16),n=hn(n,i,s,r,t[2],3299628645,23),r=dn(r,n,i,s,t[0],4096336452,6),s=dn(s,r,n,i,t[7],1126891415,10),i=dn(i,s,r,n,t[14],2878612391,15),n=dn(n,i,s,r,t[5],4237533241,21),r=dn(r,n,i,s,t[12],1700485571,6),s=dn(s,r,n,i,t[3],2399980690,10),i=dn(i,s,r,n,t[10],4293915773,15),n=dn(n,i,s,r,t[1],2240044497,21),r=dn(r,n,i,s,t[8],1873313359,6),s=dn(s,r,n,i,t[15],4264355552,10),i=dn(i,s,r,n,t[6],2734768916,15),n=dn(n,i,s,r,t[13],1309151649,21),r=dn(r,n,i,s,t[4],4149444226,6),s=dn(s,r,n,i,t[11],3174756917,10),i=dn(i,s,r,n,t[2],718787259,15),n=dn(n,i,s,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+s|0};Xv.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=Die.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t};function Yv(t,e){return t<>>32-e}function ln(t,e,r,n,i,s,o){return Yv(t+(e&r|~e&n)+i+s|0,o)+e|0}function fn(t,e,r,n,i,s,o){return Yv(t+(e&n|r&~n)+i+s|0,o)+e|0}function hn(t,e,r,n,i,s,o){return Yv(t+(e^r^n)+i+s|0,o)+e|0}function dn(t,e,r,n,i,s,o){return Yv(t+(r^(e|~n))+i+s|0,o)+e|0}var gS=Xv,cb=lt.Buffer,Lie=vt.exports,hP=lP,Bie=new Array(16),Yf=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Jf=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Qf=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Zf=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],eh=[0,1518500249,1859775393,2400959708,2840853838],th=[1352829926,1548603684,1836072691,2053994217,0];function Jv(){hP.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}Lie(Jv,hP);Jv.prototype._update=function(){for(var t=Bie,e=0;e<16;++e)t[e]=this._block.readInt32LE(e*4);for(var r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._a|0,u=this._b|0,c=this._c|0,l=this._d|0,h=this._e|0,d=0;d<80;d+=1){var _,T;d<16?(_=jk(r,n,i,s,o,t[Yf[d]],eh[0],Qf[d]),T=Kk(a,u,c,l,h,t[Jf[d]],th[0],Zf[d])):d<32?(_=Vk(r,n,i,s,o,t[Yf[d]],eh[1],Qf[d]),T=Hk(a,u,c,l,h,t[Jf[d]],th[1],Zf[d])):d<48?(_=zk(r,n,i,s,o,t[Yf[d]],eh[2],Qf[d]),T=zk(a,u,c,l,h,t[Jf[d]],th[2],Zf[d])):d<64?(_=Hk(r,n,i,s,o,t[Yf[d]],eh[3],Qf[d]),T=Vk(a,u,c,l,h,t[Jf[d]],th[3],Zf[d])):(_=Kk(r,n,i,s,o,t[Yf[d]],eh[4],Qf[d]),T=jk(a,u,c,l,h,t[Jf[d]],th[4],Zf[d])),r=o,o=s,s=hc(i,10),i=n,n=_,a=h,h=l,l=hc(c,10),c=u,u=T}var D=this._b+i+l|0;this._b=this._c+s+h|0,this._c=this._d+o+a|0,this._d=this._e+r+u|0,this._e=this._a+n+c|0,this._a=D};Jv.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=cb.alloc?cb.alloc(20):new cb(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t};function hc(t,e){return t<>>32-e}function jk(t,e,r,n,i,s,o,a){return hc(t+(e^r^n)+s+o|0,a)+i|0}function Vk(t,e,r,n,i,s,o,a){return hc(t+(e&r|~e&n)+s+o|0,a)+i|0}function zk(t,e,r,n,i,s,o,a){return hc(t+((e|~r)^n)+s+o|0,a)+i|0}function Hk(t,e,r,n,i,s,o,a){return hc(t+(e&n|r&~n)+s+o|0,a)+i|0}function Kk(t,e,r,n,i,s,o,a){return hc(t+(e^(r|~n))+s+o|0,a)+i|0}var mS=Jv,Qv={exports:{}},dP=lt.Buffer;function Zv(t,e){this._block=dP.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Zv.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=dP.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};Zv.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var bf=Zv,$ie=vt.exports,pP=bf,Fie=lt.Buffer,Uie=[1518500249,1859775393,-1894007588,-899497514],qie=new Array(80);function Ep(){this.init(),this._w=qie,pP.call(this,64,56)}$ie(Ep,pP);Ep.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function jie(t){return t<<5|t>>>27}function Vie(t){return t<<30|t>>>2}function zie(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Ep.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var u=0;u<80;++u){var c=~~(u/20),l=jie(r)+zie(c,n,i,s)+o+e[u]+Uie[c]|0;o=s,s=i,i=Vie(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Ep.prototype._hash=function(){var t=Fie.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var Hie=Ep,Kie=vt.exports,gP=bf,Gie=lt.Buffer,Wie=[1518500249,1859775393,-1894007588,-899497514],Xie=new Array(80);function xp(){this.init(),this._w=Xie,gP.call(this,64,56)}Kie(xp,gP);xp.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Yie(t){return t<<1|t>>>31}function Jie(t){return t<<5|t>>>27}function Qie(t){return t<<30|t>>>2}function Zie(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}xp.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=Yie(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var u=0;u<80;++u){var c=~~(u/20),l=Jie(r)+Zie(c,n,i,s)+o+e[u]+Wie[c]|0;o=s,s=i,i=Qie(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};xp.prototype._hash=function(){var t=Gie.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var ese=xp,tse=vt.exports,mP=bf,rse=lt.Buffer,nse=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ise=new Array(64);function Sp(){this.init(),this._w=ise,mP.call(this,64,56)}tse(Sp,mP);Sp.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function sse(t,e,r){return r^t&(e^r)}function ose(t,e,r){return t&e|r&(t|e)}function ase(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function use(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function cse(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function lse(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}Sp.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,u=this._g|0,c=this._h|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<64;++l)e[l]=lse(e[l-2])+e[l-7]+cse(e[l-15])+e[l-16]|0;for(var h=0;h<64;++h){var d=c+use(o)+sse(o,a,u)+nse[h]+e[h]|0,_=ase(r)+ose(r,n,i)|0;c=u,u=a,a=o,o=s+d|0,s=i,i=n,n=r,r=d+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0};Sp.prototype._hash=function(){var t=rse.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var vP=Sp,fse=vt.exports,hse=vP,dse=bf,pse=lt.Buffer,gse=new Array(64);function ey(){this.init(),this._w=gse,dse.call(this,64,56)}fse(ey,hse);ey.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};ey.prototype._hash=function(){var t=pse.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var mse=ey,vse=vt.exports,yP=bf,yse=lt.Buffer,Gk=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],_se=new Array(160);function Ip(){this.init(),this._w=_se,yP.call(this,128,112)}vse(Ip,yP);Ip.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Wk(t,e,r){return r^t&(e^r)}function Xk(t,e,r){return t&e|r&(t|e)}function Yk(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Jk(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function bse(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function wse(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function Ese(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function xse(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Br(t,e){return t>>>0>>0?1:0}Ip.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,u=this._gh|0,c=this._hh|0,l=this._al|0,h=this._bl|0,d=this._cl|0,_=this._dl|0,T=this._el|0,D=this._fl|0,N=this._gl|0,O=this._hl|0,L=0;L<32;L+=2)e[L]=t.readInt32BE(L*4),e[L+1]=t.readInt32BE(L*4+4);for(;L<160;L+=2){var J=e[L-30],q=e[L-15*2+1],z=bse(J,q),ee=wse(q,J);J=e[L-2*2],q=e[L-2*2+1];var G=Ese(J,q),ne=xse(q,J),ue=e[L-7*2],_e=e[L-7*2+1],F=e[L-16*2],m=e[L-16*2+1],g=ee+_e|0,f=z+ue+Br(g,ee)|0;g=g+ne|0,f=f+G+Br(g,ne)|0,g=g+m|0,f=f+F+Br(g,m)|0,e[L]=f,e[L+1]=g}for(var p=0;p<160;p+=2){f=e[p],g=e[p+1];var y=Xk(r,n,i),I=Xk(l,h,d),M=Yk(r,l),A=Yk(l,r),v=Jk(o,T),S=Jk(T,o),w=Gk[p],U=Gk[p+1],me=Wk(o,a,u),x=Wk(T,D,N),k=O+S|0,R=c+v+Br(k,O)|0;k=k+x|0,R=R+me+Br(k,x)|0,k=k+U|0,R=R+w+Br(k,U)|0,k=k+g|0,R=R+f+Br(k,g)|0;var j=A+I|0,Q=M+y+Br(j,A)|0;c=u,O=N,u=a,N=D,a=o,D=T,T=_+k|0,o=s+R+Br(T,_)|0,s=i,_=d,i=n,d=h,n=r,h=l,l=k+j|0,r=R+Q+Br(l,k)|0}this._al=this._al+l|0,this._bl=this._bl+h|0,this._cl=this._cl+d|0,this._dl=this._dl+_|0,this._el=this._el+T|0,this._fl=this._fl+D|0,this._gl=this._gl+N|0,this._hl=this._hl+O|0,this._ah=this._ah+r+Br(this._al,l)|0,this._bh=this._bh+n+Br(this._bl,h)|0,this._ch=this._ch+i+Br(this._cl,d)|0,this._dh=this._dh+s+Br(this._dl,_)|0,this._eh=this._eh+o+Br(this._el,T)|0,this._fh=this._fh+a+Br(this._fl,D)|0,this._gh=this._gh+u+Br(this._gl,N)|0,this._hh=this._hh+c+Br(this._hl,O)|0};Ip.prototype._hash=function(){var t=yse.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var _P=Ip,Sse=vt.exports,Ise=_P,Tse=bf,Ase=lt.Buffer,kse=new Array(160);function ty(){this.init(),this._w=kse,Tse.call(this,128,112)}Sse(ty,Ise);ty.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};ty.prototype._hash=function(){var t=Ase.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var Mse=ty,Mc=Qv.exports=function(e){e=e.toLowerCase();var r=Mc[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};Mc.sha=Hie;Mc.sha1=ese;Mc.sha224=mse;Mc.sha256=vP;Mc.sha384=Mse;Mc.sha512=_P;var bP=lt.Buffer,wP=Od.exports.Transform,Cse=qv.StringDecoder,Rse=vt.exports;function ps(t){wP.call(this),this.hashMode=typeof t=="string",this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}Rse(ps,wP);ps.prototype.update=function(t,e,r){typeof t=="string"&&(t=bP.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)};ps.prototype.setAutoPadding=function(){};ps.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};ps.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};ps.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};ps.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{r(n)}};ps.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)};ps.prototype._finalOrDigest=function(t){var e=this.__final()||bP.alloc(0);return t&&(e=this._toString(e,t,!0)),e};ps.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new Cse(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n};var nu=ps,Nse=vt.exports,Ose=gS,Dse=mS,Pse=Qv.exports,EP=nu;function ry(t){EP.call(this,"digest"),this._hash=t}Nse(ry,EP);ry.prototype._update=function(t){this._hash.update(t)};ry.prototype._final=function(){return this._hash.digest()};var Tp=function(e){return e=e.toLowerCase(),e==="md5"?new Ose:e==="rmd160"||e==="ripemd160"?new Dse:new ry(Pse(e))},Lse=vt.exports,Ou=lt.Buffer,xP=nu,Bse=Ou.alloc(128),qc=64;function ny(t,e){xP.call(this,"digest"),typeof e=="string"&&(e=Ou.from(e)),this._alg=t,this._key=e,e.length>qc?e=t(e):e.lengthr){var n=t==="rmd160"?new J1:Q1(t);e=n.update(e).digest()}else e.lengthroe||e!==e)throw new TypeError("Bad key length")},jg;if(ut.process&&ut.process.browser)jg="utf-8";else if(ut.process&&ut.process.version){var noe=parseInt(process.version.split(".")[0].slice(1),10);jg=noe>=6?"utf-8":"binary"}else jg="utf-8";var MP=jg,lb=lt.Buffer,CP=function(t,e,r){if(lb.isBuffer(t))return t;if(typeof t=="string")return lb.from(t,e);if(ArrayBuffer.isView(t))return lb.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")},ioe=SP,soe=mS,ooe=Qv.exports,Du=lt.Buffer,aoe=kP,Qk=MP,Zk=CP,uoe=Du.alloc(128),Vg={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function RP(t,e,r){var n=coe(t),i=t==="sha512"||t==="sha384"?128:64;e.length>i?e=n(e):e.length>>0};mi.writeUInt32BE=function(e,r,n){e[0+n]=r>>>24,e[1+n]=r>>>16&255,e[2+n]=r>>>8&255,e[3+n]=r&255};mi.ip=function(e,r,n,i){for(var s=0,o=0,a=6;a>=0;a-=2){for(var u=0;u<=24;u+=8)s<<=1,s|=r>>>u+a&1;for(var u=0;u<=24;u+=8)s<<=1,s|=e>>>u+a&1}for(var a=6;a>=0;a-=2){for(var u=1;u<=25;u+=8)o<<=1,o|=r>>>u+a&1;for(var u=1;u<=25;u+=8)o<<=1,o|=e>>>u+a&1}n[i+0]=s>>>0,n[i+1]=o>>>0};mi.rip=function(e,r,n,i){for(var s=0,o=0,a=0;a<4;a++)for(var u=24;u>=0;u-=8)s<<=1,s|=r>>>u+a&1,s<<=1,s|=e>>>u+a&1;for(var a=4;a<8;a++)for(var u=24;u>=0;u-=8)o<<=1,o|=r>>>u+a&1,o<<=1,o|=e>>>u+a&1;n[i+0]=s>>>0,n[i+1]=o>>>0};mi.pc1=function(e,r,n,i){for(var s=0,o=0,a=7;a>=5;a--){for(var u=0;u<=24;u+=8)s<<=1,s|=r>>u+a&1;for(var u=0;u<=24;u+=8)s<<=1,s|=e>>u+a&1}for(var u=0;u<=24;u+=8)s<<=1,s|=r>>u+a&1;for(var a=1;a<=3;a++){for(var u=0;u<=24;u+=8)o<<=1,o|=r>>u+a&1;for(var u=0;u<=24;u+=8)o<<=1,o|=e>>u+a&1}for(var u=0;u<=24;u+=8)o<<=1,o|=e>>u+a&1;n[i+0]=s>>>0,n[i+1]=o>>>0};mi.r28shl=function(e,r){return e<>>28-r};var vg=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];mi.pc2=function(e,r,n,i){for(var s=0,o=0,a=vg.length>>>1,u=0;u>>vg[u]&1;for(var u=a;u>>vg[u]&1;n[i+0]=s>>>0,n[i+1]=o>>>0};mi.expand=function(e,r,n){var i=0,s=0;i=(e&1)<<5|e>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=e>>>o&63;for(var o=11;o>=3;o-=4)s|=e>>>o&63,s<<=6;s|=(e&31)<<1|e>>>31,r[n+0]=i>>>0,r[n+1]=s>>>0};var nM=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];mi.substitute=function(e,r){for(var n=0,i=0;i<4;i++){var s=e>>>18-i*6&63,o=nM[i*64+s];n<<=4,n|=o}for(var i=0;i<4;i++){var s=r>>>18-i*6&63,o=nM[4*64+i*64+s];n<<=4,n|=o}return n>>>0};var iM=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];mi.permute=function(e){for(var r=0,n=0;n>>iM[n]&1;return r>>>0};mi.padSplit=function(e,r,n){for(var i=e.toString(2);i.length0;i--)r+=this._buffer(e,r),n+=this._flushBuffer(s,n);return r+=this._buffer(e,r),s};ji.prototype.final=function(e){var r;e&&(r=this.update(e));var n;return this.type==="encrypt"?n=this._finalEncrypt():n=this._finalDecrypt(),r?r.concat(n):n};ji.prototype._pad=function(e,r){if(r===0)return!1;for(;r>>1];n=Or.r28shl(n,o),i=Or.r28shl(i,o),Or.pc2(n,i,e.keys,s)}};Ws.prototype._update=function(e,r,n,i){var s=this._desState,o=Or.readUInt32BE(e,r),a=Or.readUInt32BE(e,r+4);Or.ip(o,a,s.tmp,0),o=s.tmp[0],a=s.tmp[1],this.type==="encrypt"?this._encrypt(s,o,a,s.tmp,0):this._decrypt(s,o,a,s.tmp,0),o=s.tmp[0],a=s.tmp[1],Or.writeUInt32BE(n,o,i),Or.writeUInt32BE(n,a,i+4)};Ws.prototype._pad=function(e,r){for(var n=e.length-r,i=r;i>>0,o=_}Or.rip(a,o,i,s)};Ws.prototype._decrypt=function(e,r,n,i,s){for(var o=n,a=r,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],l=e.keys[u+1];Or.expand(o,e.tmp,0),c^=e.tmp[0],l^=e.tmp[1];var h=Or.substitute(c,l),d=Or.permute(h),_=o;o=(a^d)>>>0,a=_}Or.rip(o,a,i,s)};var FP={},boe=qi,woe=vt.exports,Y0={};function Eoe(t){boe.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e>i%8,t._prev=Ooe(t._prev,r?a:u);return o}function Ooe(t,e){var r=t.length,n=-1,i=zg.allocUnsafe(t.length);for(t=zg.concat([t,zg.from([e])]);++n>7;return i}HP.encrypt=function(t,e,r){for(var n=e.length,i=zg.allocUnsafe(n),s=-1;++s>>24]^o[l>>>16&255]^a[h>>>8&255]^u[d&255]^e[O++],T=s[l>>>24]^o[h>>>16&255]^a[d>>>8&255]^u[c&255]^e[O++],D=s[h>>>24]^o[d>>>16&255]^a[c>>>8&255]^u[l&255]^e[O++],N=s[d>>>24]^o[c>>>16&255]^a[l>>>8&255]^u[h&255]^e[O++],c=_,l=T,h=D,d=N;return _=(n[c>>>24]<<24|n[l>>>16&255]<<16|n[h>>>8&255]<<8|n[d&255])^e[O++],T=(n[l>>>24]<<24|n[h>>>16&255]<<16|n[d>>>8&255]<<8|n[c&255])^e[O++],D=(n[h>>>24]<<24|n[d>>>16&255]<<16|n[c>>>8&255]<<8|n[l&255])^e[O++],N=(n[d>>>24]<<24|n[c>>>16&255]<<16|n[l>>>8&255]<<8|n[h&255])^e[O++],_=_>>>0,T=T>>>0,D=D>>>0,N=N>>>0,[_,T,D,N]}var zoe=[0,1,2,4,8,16,32,64,128,27,54],Sr=function(){for(var t=new Array(256),e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],s=[[],[],[],[]],o=0,a=0,u=0;u<256;++u){var c=a^a<<1^a<<2^a<<3^a<<4;c=c>>>8^c&255^99,r[o]=c,n[c]=o;var l=t[o],h=t[l],d=t[h],_=t[c]*257^c*16843008;i[0][o]=_<<24|_>>>8,i[1][o]=_<<16|_>>>16,i[2][o]=_<<8|_>>>24,i[3][o]=_,_=d*16843009^h*65537^l*257^o*16843008,s[0][c]=_<<24|_>>>8,s[1][c]=_<<16|_>>>16,s[2][c]=_<<8|_>>>24,s[3][c]=_,o===0?o=a=1:(o=l^t[t[t[d^l]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:s}}();function Di(t){this._key=ES(t),this._reset()}Di.blockSize=4*4;Di.keySize=256/8;Di.prototype.blockSize=Di.blockSize;Di.prototype.keySize=Di.keySize;Di.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=(r+1)*4,i=[],s=0;s>>24,o=Sr.SBOX[o>>>24]<<24|Sr.SBOX[o>>>16&255]<<16|Sr.SBOX[o>>>8&255]<<8|Sr.SBOX[o&255],o^=zoe[s/e|0]<<24):e>6&&s%e===4&&(o=Sr.SBOX[o>>>24]<<24|Sr.SBOX[o>>>16&255]<<16|Sr.SBOX[o>>>8&255]<<8|Sr.SBOX[o&255]),i[s]=i[s-e]^o}for(var a=[],u=0;u>>24]]^Sr.INV_SUB_MIX[1][Sr.SBOX[l>>>16&255]]^Sr.INV_SUB_MIX[2][Sr.SBOX[l>>>8&255]]^Sr.INV_SUB_MIX[3][Sr.SBOX[l&255]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=a};Di.prototype.encryptBlockRaw=function(t){return t=ES(t),XP(t,this._keySchedule,Sr.SUB_MIX,Sr.SBOX,this._nRounds)};Di.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=J0.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r};Di.prototype.decryptBlock=function(t){t=ES(t);var e=t[1];t[1]=t[3],t[3]=e;var r=XP(t,this._invKeySchedule,Sr.INV_SUB_MIX,Sr.INV_SBOX,this._nRounds),n=J0.allocUnsafe(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[3],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[1],12),n};Di.prototype.scrub=function(){db(this._keySchedule),db(this._invKeySchedule),db(this._key)};kp.AES=Di;var Kl=lt.Buffer,Hoe=Kl.alloc(16,0);function Koe(t){return[t.readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)]}function YP(t){var e=Kl.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function Mp(t){this.h=t,this.state=Kl.alloc(16,0),this.cache=Kl.allocUnsafe(0)}Mp.prototype.ghash=function(t){for(var e=-1;++e0;r--)t[r]=t[r]>>>1|(t[r-1]&1)<<31;t[0]=t[0]>>>1,i&&(t[0]=t[0]^225<<24)}this.state=YP(e)};Mp.prototype.update=function(t){this.cache=Kl.concat([this.cache,t]);for(var e;this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)};Mp.prototype.final=function(t,e){return this.cache.length&&this.ghash(Kl.concat([this.cache,Hoe],16)),this.ghash(YP([0,t,0,e])),this.state};var Goe=Mp,Woe=kp,Vn=lt.Buffer,JP=nu,Xoe=vt.exports,QP=Goe,Yoe=Ap,Joe=GP;function Qoe(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i0||n>0;){var u=new rae;u.update(a),u.update(t),e&&u.update(e),a=u.digest();var c=0;if(i>0){var l=s.length-i;c=Math.min(i,a.length),a.copy(s,l,0,c),i-=c}if(c0){var h=o.length-n,d=Math.min(n,a.length-c);a.copy(o,h,c,c+d),n-=d}}return a.fill(0),{key:s,iv:o}}var ay=nae,rL=wS,iae=ZP,Bo=lt.Buffer,sae=tL,nL=nu,oae=kp,aae=ay,uae=vt.exports;function Cp(t,e,r){nL.call(this),this._cache=new uy,this._cipher=new oae.AES(e),this._prev=Bo.from(r),this._mode=t,this._autopadding=!0}uae(Cp,nL);Cp.prototype._update=function(t){this._cache.add(t);for(var e,r,n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return Bo.concat(n)};var cae=Bo.alloc(16,16);Cp.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(cae))throw this._cipher.scrub(),new Error("data not multiple of block length")};Cp.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this};function uy(){this.cache=Bo.allocUnsafe(0)}uy.prototype.add=function(t){this.cache=Bo.concat([this.cache,t])};uy.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null};uy.prototype.flush=function(){for(var t=16-this.cache.length,e=Bo.allocUnsafe(t),r=-1;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null};cy.prototype.flush=function(){if(this.cache.length)return this.cache};function mae(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r0?m:g},s.min=function(m,g){return m.cmp(g)<0?m:g},s.prototype._init=function(m,g,f){if(typeof m=="number")return this._initNumber(m,g,f);if(typeof m=="object")return this._initArray(m,g,f);g==="hex"&&(g=16),n(g===(g|0)&&g>=2&&g<=36),m=m.toString().replace(/\s+/g,"");var p=0;m[0]==="-"&&(p++,this.negative=1),p=0;p-=3)I=m[p]|m[p-1]<<8|m[p-2]<<16,this.words[y]|=I<>>26-M&67108863,M+=24,M>=26&&(M-=26,y++);else if(f==="le")for(p=0,y=0;p>>26-M&67108863,M+=24,M>=26&&(M-=26,y++);return this.strip()};function a(F,m){var g=F.charCodeAt(m);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function u(F,m,g){var f=a(F,g);return g-1>=m&&(f|=a(F,g-1)<<4),f}s.prototype._parseHex=function(m,g,f){this.length=Math.ceil((m.length-g)/6),this.words=new Array(this.length);for(var p=0;p=g;p-=2)M=u(m,g,p)<=18?(y-=18,I+=1,this.words[I]|=M>>>26):y+=8;else{var A=m.length-g;for(p=A%2===0?g+1:g;p=18?(y-=18,I+=1,this.words[I]|=M>>>26):y+=8}this.strip()};function c(F,m,g,f){for(var p=0,y=Math.min(F.length,g),I=m;I=49?p+=M-49+10:M>=17?p+=M-17+10:p+=M}return p}s.prototype._parseBase=function(m,g,f){this.words=[0],this.length=1;for(var p=0,y=1;y<=67108863;y*=g)p++;p--,y=y/g|0;for(var I=m.length-f,M=I%p,A=Math.min(I,I-M)+f,v=0,S=f;S1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(m,g){m=m||10,g=g|0||1;var f;if(m===16||m==="hex"){f="";for(var p=0,y=0,I=0;I>>24-p&16777215,y!==0||I!==this.length-1?f=l[6-A.length]+A+f:f=A+f,p+=2,p>=26&&(p-=26,I--)}for(y!==0&&(f=y.toString(16)+f);f.length%g!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}if(m===(m|0)&&m>=2&&m<=36){var v=h[m],S=d[m];f="";var w=this.clone();for(w.negative=0;!w.isZero();){var U=w.modn(S).toString(m);w=w.idivn(S),w.isZero()?f=U+f:f=l[v-U.length]+U+f}for(this.isZero()&&(f="0"+f);f.length%g!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var m=this.words[0];return this.length===2?m+=this.words[1]*67108864:this.length===3&&this.words[2]===1?m+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(m,g){return n(typeof o!="undefined"),this.toArrayLike(o,m,g)},s.prototype.toArray=function(m,g){return this.toArrayLike(Array,m,g)},s.prototype.toArrayLike=function(m,g,f){var p=this.byteLength(),y=f||Math.max(1,p);n(p<=y,"byte array longer than desired length"),n(y>0,"Requested array length <= 0"),this.strip();var I=g==="le",M=new m(y),A,v,S=this.clone();if(I){for(v=0;!S.isZero();v++)A=S.andln(255),S.iushrn(8),M[v]=A;for(;v=4096&&(f+=13,g>>>=13),g>=64&&(f+=7,g>>>=7),g>=8&&(f+=4,g>>>=4),g>=2&&(f+=2,g>>>=2),f+g},s.prototype._zeroBits=function(m){if(m===0)return 26;var g=m,f=0;return(g&8191)===0&&(f+=13,g>>>=13),(g&127)===0&&(f+=7,g>>>=7),(g&15)===0&&(f+=4,g>>>=4),(g&3)===0&&(f+=2,g>>>=2),(g&1)===0&&f++,f},s.prototype.bitLength=function(){var m=this.words[this.length-1],g=this._countBits(m);return(this.length-1)*26+g};function _(F){for(var m=new Array(F.bitLength()),g=0;g>>p}return m}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,g=0;gm.length?this.clone().ior(m):m.clone().ior(this)},s.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},s.prototype.iuand=function(m){var g;this.length>m.length?g=m:g=this;for(var f=0;fm.length?this.clone().iand(m):m.clone().iand(this)},s.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},s.prototype.iuxor=function(m){var g,f;this.length>m.length?(g=this,f=m):(g=m,f=this);for(var p=0;pm.length?this.clone().ixor(m):m.clone().ixor(this)},s.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},s.prototype.inotn=function(m){n(typeof m=="number"&&m>=0);var g=Math.ceil(m/26)|0,f=m%26;this._expand(g),f>0&&g--;for(var p=0;p0&&(this.words[p]=~this.words[p]&67108863>>26-f),this.strip()},s.prototype.notn=function(m){return this.clone().inotn(m)},s.prototype.setn=function(m,g){n(typeof m=="number"&&m>=0);var f=m/26|0,p=m%26;return this._expand(f+1),g?this.words[f]=this.words[f]|1<m.length?(f=this,p=m):(f=m,p=this);for(var y=0,I=0;I>>26;for(;y!==0&&I>>26;if(this.length=f.length,y!==0)this.words[this.length]=y,this.length++;else if(f!==this)for(;Im.length?this.clone().iadd(m):m.clone().iadd(this)},s.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var g=this.iadd(m);return m.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var f=this.cmp(m);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,y;f>0?(p=this,y=m):(p=m,y=this);for(var I=0,M=0;M>26,this.words[M]=g&67108863;for(;I!==0&&M>26,this.words[M]=g&67108863;if(I===0&&M>>26,w=A&67108863,U=Math.min(v,m.length-1),me=Math.max(0,v-F.length+1);me<=U;me++){var x=v-me|0;p=F.words[x]|0,y=m.words[me]|0,I=p*y+w,S+=I/67108864|0,w=I&67108863}g.words[v]=w|0,A=S|0}return A!==0?g.words[v]=A|0:g.length--,g.strip()}var D=function(m,g,f){var p=m.words,y=g.words,I=f.words,M=0,A,v,S,w=p[0]|0,U=w&8191,me=w>>>13,x=p[1]|0,k=x&8191,R=x>>>13,j=p[2]|0,Q=j&8191,oe=j>>>13,fe=p[3]|0,ie=fe&8191,$=fe>>>13,V=p[4]|0,Y=V&8191,ce=V>>>13,ae=p[5]|0,le=ae&8191,ve=ae>>>13,Ee=p[6]|0,pe=Ee&8191,ge=Ee>>>13,Oe=p[7]|0,Te=Oe&8191,Ce=Oe>>>13,De=p[8]|0,C=De&8191,b=De>>>13,E=p[9]|0,P=E&8191,W=E>>>13,re=y[0]|0,te=re&8191,be=re>>>13,qe=y[1]|0,Me=qe&8191,Ue=qe>>>13,je=y[2]|0,Ze=je&8191,xt=je>>>13,mt=y[3]|0,Ye=mt&8191,At=mt>>>13,Bt=y[4]|0,nt=Bt&8191,Ht=Bt>>>13,$t=y[5]|0,Je=$t&8191,Nt=$t>>>13,Ft=y[6]|0,et=Ft&8191,Ot=Ft>>>13,Dt=y[7]|0,it=Dt&8191,Ut=Dt>>>13,qt=y[8]|0,tt=qt&8191,Ct=qt>>>13,jt=y[9]|0,st=jt&8191,Vt=jt>>>13;f.negative=m.negative^g.negative,f.length=19,A=Math.imul(U,te),v=Math.imul(U,be),v=v+Math.imul(me,te)|0,S=Math.imul(me,be);var St=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(St>>>26)|0,St&=67108863,A=Math.imul(k,te),v=Math.imul(k,be),v=v+Math.imul(R,te)|0,S=Math.imul(R,be),A=A+Math.imul(U,Me)|0,v=v+Math.imul(U,Ue)|0,v=v+Math.imul(me,Me)|0,S=S+Math.imul(me,Ue)|0;var Pt=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,A=Math.imul(Q,te),v=Math.imul(Q,be),v=v+Math.imul(oe,te)|0,S=Math.imul(oe,be),A=A+Math.imul(k,Me)|0,v=v+Math.imul(k,Ue)|0,v=v+Math.imul(R,Me)|0,S=S+Math.imul(R,Ue)|0,A=A+Math.imul(U,Ze)|0,v=v+Math.imul(U,xt)|0,v=v+Math.imul(me,Ze)|0,S=S+Math.imul(me,xt)|0;var In=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(In>>>26)|0,In&=67108863,A=Math.imul(ie,te),v=Math.imul(ie,be),v=v+Math.imul($,te)|0,S=Math.imul($,be),A=A+Math.imul(Q,Me)|0,v=v+Math.imul(Q,Ue)|0,v=v+Math.imul(oe,Me)|0,S=S+Math.imul(oe,Ue)|0,A=A+Math.imul(k,Ze)|0,v=v+Math.imul(k,xt)|0,v=v+Math.imul(R,Ze)|0,S=S+Math.imul(R,xt)|0,A=A+Math.imul(U,Ye)|0,v=v+Math.imul(U,At)|0,v=v+Math.imul(me,Ye)|0,S=S+Math.imul(me,At)|0;var Cr=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,A=Math.imul(Y,te),v=Math.imul(Y,be),v=v+Math.imul(ce,te)|0,S=Math.imul(ce,be),A=A+Math.imul(ie,Me)|0,v=v+Math.imul(ie,Ue)|0,v=v+Math.imul($,Me)|0,S=S+Math.imul($,Ue)|0,A=A+Math.imul(Q,Ze)|0,v=v+Math.imul(Q,xt)|0,v=v+Math.imul(oe,Ze)|0,S=S+Math.imul(oe,xt)|0,A=A+Math.imul(k,Ye)|0,v=v+Math.imul(k,At)|0,v=v+Math.imul(R,Ye)|0,S=S+Math.imul(R,At)|0,A=A+Math.imul(U,nt)|0,v=v+Math.imul(U,Ht)|0,v=v+Math.imul(me,nt)|0,S=S+Math.imul(me,Ht)|0;var Fn=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,A=Math.imul(le,te),v=Math.imul(le,be),v=v+Math.imul(ve,te)|0,S=Math.imul(ve,be),A=A+Math.imul(Y,Me)|0,v=v+Math.imul(Y,Ue)|0,v=v+Math.imul(ce,Me)|0,S=S+Math.imul(ce,Ue)|0,A=A+Math.imul(ie,Ze)|0,v=v+Math.imul(ie,xt)|0,v=v+Math.imul($,Ze)|0,S=S+Math.imul($,xt)|0,A=A+Math.imul(Q,Ye)|0,v=v+Math.imul(Q,At)|0,v=v+Math.imul(oe,Ye)|0,S=S+Math.imul(oe,At)|0,A=A+Math.imul(k,nt)|0,v=v+Math.imul(k,Ht)|0,v=v+Math.imul(R,nt)|0,S=S+Math.imul(R,Ht)|0,A=A+Math.imul(U,Je)|0,v=v+Math.imul(U,Nt)|0,v=v+Math.imul(me,Je)|0,S=S+Math.imul(me,Nt)|0;var Tn=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,A=Math.imul(pe,te),v=Math.imul(pe,be),v=v+Math.imul(ge,te)|0,S=Math.imul(ge,be),A=A+Math.imul(le,Me)|0,v=v+Math.imul(le,Ue)|0,v=v+Math.imul(ve,Me)|0,S=S+Math.imul(ve,Ue)|0,A=A+Math.imul(Y,Ze)|0,v=v+Math.imul(Y,xt)|0,v=v+Math.imul(ce,Ze)|0,S=S+Math.imul(ce,xt)|0,A=A+Math.imul(ie,Ye)|0,v=v+Math.imul(ie,At)|0,v=v+Math.imul($,Ye)|0,S=S+Math.imul($,At)|0,A=A+Math.imul(Q,nt)|0,v=v+Math.imul(Q,Ht)|0,v=v+Math.imul(oe,nt)|0,S=S+Math.imul(oe,Ht)|0,A=A+Math.imul(k,Je)|0,v=v+Math.imul(k,Nt)|0,v=v+Math.imul(R,Je)|0,S=S+Math.imul(R,Nt)|0,A=A+Math.imul(U,et)|0,v=v+Math.imul(U,Ot)|0,v=v+Math.imul(me,et)|0,S=S+Math.imul(me,Ot)|0;var un=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(un>>>26)|0,un&=67108863,A=Math.imul(Te,te),v=Math.imul(Te,be),v=v+Math.imul(Ce,te)|0,S=Math.imul(Ce,be),A=A+Math.imul(pe,Me)|0,v=v+Math.imul(pe,Ue)|0,v=v+Math.imul(ge,Me)|0,S=S+Math.imul(ge,Ue)|0,A=A+Math.imul(le,Ze)|0,v=v+Math.imul(le,xt)|0,v=v+Math.imul(ve,Ze)|0,S=S+Math.imul(ve,xt)|0,A=A+Math.imul(Y,Ye)|0,v=v+Math.imul(Y,At)|0,v=v+Math.imul(ce,Ye)|0,S=S+Math.imul(ce,At)|0,A=A+Math.imul(ie,nt)|0,v=v+Math.imul(ie,Ht)|0,v=v+Math.imul($,nt)|0,S=S+Math.imul($,Ht)|0,A=A+Math.imul(Q,Je)|0,v=v+Math.imul(Q,Nt)|0,v=v+Math.imul(oe,Je)|0,S=S+Math.imul(oe,Nt)|0,A=A+Math.imul(k,et)|0,v=v+Math.imul(k,Ot)|0,v=v+Math.imul(R,et)|0,S=S+Math.imul(R,Ot)|0,A=A+Math.imul(U,it)|0,v=v+Math.imul(U,Ut)|0,v=v+Math.imul(me,it)|0,S=S+Math.imul(me,Ut)|0;var _i=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(_i>>>26)|0,_i&=67108863,A=Math.imul(C,te),v=Math.imul(C,be),v=v+Math.imul(b,te)|0,S=Math.imul(b,be),A=A+Math.imul(Te,Me)|0,v=v+Math.imul(Te,Ue)|0,v=v+Math.imul(Ce,Me)|0,S=S+Math.imul(Ce,Ue)|0,A=A+Math.imul(pe,Ze)|0,v=v+Math.imul(pe,xt)|0,v=v+Math.imul(ge,Ze)|0,S=S+Math.imul(ge,xt)|0,A=A+Math.imul(le,Ye)|0,v=v+Math.imul(le,At)|0,v=v+Math.imul(ve,Ye)|0,S=S+Math.imul(ve,At)|0,A=A+Math.imul(Y,nt)|0,v=v+Math.imul(Y,Ht)|0,v=v+Math.imul(ce,nt)|0,S=S+Math.imul(ce,Ht)|0,A=A+Math.imul(ie,Je)|0,v=v+Math.imul(ie,Nt)|0,v=v+Math.imul($,Je)|0,S=S+Math.imul($,Nt)|0,A=A+Math.imul(Q,et)|0,v=v+Math.imul(Q,Ot)|0,v=v+Math.imul(oe,et)|0,S=S+Math.imul(oe,Ot)|0,A=A+Math.imul(k,it)|0,v=v+Math.imul(k,Ut)|0,v=v+Math.imul(R,it)|0,S=S+Math.imul(R,Ut)|0,A=A+Math.imul(U,tt)|0,v=v+Math.imul(U,Ct)|0,v=v+Math.imul(me,tt)|0,S=S+Math.imul(me,Ct)|0;var bs=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(bs>>>26)|0,bs&=67108863,A=Math.imul(P,te),v=Math.imul(P,be),v=v+Math.imul(W,te)|0,S=Math.imul(W,be),A=A+Math.imul(C,Me)|0,v=v+Math.imul(C,Ue)|0,v=v+Math.imul(b,Me)|0,S=S+Math.imul(b,Ue)|0,A=A+Math.imul(Te,Ze)|0,v=v+Math.imul(Te,xt)|0,v=v+Math.imul(Ce,Ze)|0,S=S+Math.imul(Ce,xt)|0,A=A+Math.imul(pe,Ye)|0,v=v+Math.imul(pe,At)|0,v=v+Math.imul(ge,Ye)|0,S=S+Math.imul(ge,At)|0,A=A+Math.imul(le,nt)|0,v=v+Math.imul(le,Ht)|0,v=v+Math.imul(ve,nt)|0,S=S+Math.imul(ve,Ht)|0,A=A+Math.imul(Y,Je)|0,v=v+Math.imul(Y,Nt)|0,v=v+Math.imul(ce,Je)|0,S=S+Math.imul(ce,Nt)|0,A=A+Math.imul(ie,et)|0,v=v+Math.imul(ie,Ot)|0,v=v+Math.imul($,et)|0,S=S+Math.imul($,Ot)|0,A=A+Math.imul(Q,it)|0,v=v+Math.imul(Q,Ut)|0,v=v+Math.imul(oe,it)|0,S=S+Math.imul(oe,Ut)|0,A=A+Math.imul(k,tt)|0,v=v+Math.imul(k,Ct)|0,v=v+Math.imul(R,tt)|0,S=S+Math.imul(R,Ct)|0,A=A+Math.imul(U,st)|0,v=v+Math.imul(U,Vt)|0,v=v+Math.imul(me,st)|0,S=S+Math.imul(me,Vt)|0;var Ki=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(Ki>>>26)|0,Ki&=67108863,A=Math.imul(P,Me),v=Math.imul(P,Ue),v=v+Math.imul(W,Me)|0,S=Math.imul(W,Ue),A=A+Math.imul(C,Ze)|0,v=v+Math.imul(C,xt)|0,v=v+Math.imul(b,Ze)|0,S=S+Math.imul(b,xt)|0,A=A+Math.imul(Te,Ye)|0,v=v+Math.imul(Te,At)|0,v=v+Math.imul(Ce,Ye)|0,S=S+Math.imul(Ce,At)|0,A=A+Math.imul(pe,nt)|0,v=v+Math.imul(pe,Ht)|0,v=v+Math.imul(ge,nt)|0,S=S+Math.imul(ge,Ht)|0,A=A+Math.imul(le,Je)|0,v=v+Math.imul(le,Nt)|0,v=v+Math.imul(ve,Je)|0,S=S+Math.imul(ve,Nt)|0,A=A+Math.imul(Y,et)|0,v=v+Math.imul(Y,Ot)|0,v=v+Math.imul(ce,et)|0,S=S+Math.imul(ce,Ot)|0,A=A+Math.imul(ie,it)|0,v=v+Math.imul(ie,Ut)|0,v=v+Math.imul($,it)|0,S=S+Math.imul($,Ut)|0,A=A+Math.imul(Q,tt)|0,v=v+Math.imul(Q,Ct)|0,v=v+Math.imul(oe,tt)|0,S=S+Math.imul(oe,Ct)|0,A=A+Math.imul(k,st)|0,v=v+Math.imul(k,Vt)|0,v=v+Math.imul(R,st)|0,S=S+Math.imul(R,Vt)|0;var Gi=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,A=Math.imul(P,Ze),v=Math.imul(P,xt),v=v+Math.imul(W,Ze)|0,S=Math.imul(W,xt),A=A+Math.imul(C,Ye)|0,v=v+Math.imul(C,At)|0,v=v+Math.imul(b,Ye)|0,S=S+Math.imul(b,At)|0,A=A+Math.imul(Te,nt)|0,v=v+Math.imul(Te,Ht)|0,v=v+Math.imul(Ce,nt)|0,S=S+Math.imul(Ce,Ht)|0,A=A+Math.imul(pe,Je)|0,v=v+Math.imul(pe,Nt)|0,v=v+Math.imul(ge,Je)|0,S=S+Math.imul(ge,Nt)|0,A=A+Math.imul(le,et)|0,v=v+Math.imul(le,Ot)|0,v=v+Math.imul(ve,et)|0,S=S+Math.imul(ve,Ot)|0,A=A+Math.imul(Y,it)|0,v=v+Math.imul(Y,Ut)|0,v=v+Math.imul(ce,it)|0,S=S+Math.imul(ce,Ut)|0,A=A+Math.imul(ie,tt)|0,v=v+Math.imul(ie,Ct)|0,v=v+Math.imul($,tt)|0,S=S+Math.imul($,Ct)|0,A=A+Math.imul(Q,st)|0,v=v+Math.imul(Q,Vt)|0,v=v+Math.imul(oe,st)|0,S=S+Math.imul(oe,Vt)|0;var ws=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(ws>>>26)|0,ws&=67108863,A=Math.imul(P,Ye),v=Math.imul(P,At),v=v+Math.imul(W,Ye)|0,S=Math.imul(W,At),A=A+Math.imul(C,nt)|0,v=v+Math.imul(C,Ht)|0,v=v+Math.imul(b,nt)|0,S=S+Math.imul(b,Ht)|0,A=A+Math.imul(Te,Je)|0,v=v+Math.imul(Te,Nt)|0,v=v+Math.imul(Ce,Je)|0,S=S+Math.imul(Ce,Nt)|0,A=A+Math.imul(pe,et)|0,v=v+Math.imul(pe,Ot)|0,v=v+Math.imul(ge,et)|0,S=S+Math.imul(ge,Ot)|0,A=A+Math.imul(le,it)|0,v=v+Math.imul(le,Ut)|0,v=v+Math.imul(ve,it)|0,S=S+Math.imul(ve,Ut)|0,A=A+Math.imul(Y,tt)|0,v=v+Math.imul(Y,Ct)|0,v=v+Math.imul(ce,tt)|0,S=S+Math.imul(ce,Ct)|0,A=A+Math.imul(ie,st)|0,v=v+Math.imul(ie,Vt)|0,v=v+Math.imul($,st)|0,S=S+Math.imul($,Vt)|0;var Es=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(Es>>>26)|0,Es&=67108863,A=Math.imul(P,nt),v=Math.imul(P,Ht),v=v+Math.imul(W,nt)|0,S=Math.imul(W,Ht),A=A+Math.imul(C,Je)|0,v=v+Math.imul(C,Nt)|0,v=v+Math.imul(b,Je)|0,S=S+Math.imul(b,Nt)|0,A=A+Math.imul(Te,et)|0,v=v+Math.imul(Te,Ot)|0,v=v+Math.imul(Ce,et)|0,S=S+Math.imul(Ce,Ot)|0,A=A+Math.imul(pe,it)|0,v=v+Math.imul(pe,Ut)|0,v=v+Math.imul(ge,it)|0,S=S+Math.imul(ge,Ut)|0,A=A+Math.imul(le,tt)|0,v=v+Math.imul(le,Ct)|0,v=v+Math.imul(ve,tt)|0,S=S+Math.imul(ve,Ct)|0,A=A+Math.imul(Y,st)|0,v=v+Math.imul(Y,Vt)|0,v=v+Math.imul(ce,st)|0,S=S+Math.imul(ce,Vt)|0;var bi=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(bi>>>26)|0,bi&=67108863,A=Math.imul(P,Je),v=Math.imul(P,Nt),v=v+Math.imul(W,Je)|0,S=Math.imul(W,Nt),A=A+Math.imul(C,et)|0,v=v+Math.imul(C,Ot)|0,v=v+Math.imul(b,et)|0,S=S+Math.imul(b,Ot)|0,A=A+Math.imul(Te,it)|0,v=v+Math.imul(Te,Ut)|0,v=v+Math.imul(Ce,it)|0,S=S+Math.imul(Ce,Ut)|0,A=A+Math.imul(pe,tt)|0,v=v+Math.imul(pe,Ct)|0,v=v+Math.imul(ge,tt)|0,S=S+Math.imul(ge,Ct)|0,A=A+Math.imul(le,st)|0,v=v+Math.imul(le,Vt)|0,v=v+Math.imul(ve,st)|0,S=S+Math.imul(ve,Vt)|0;var Wi=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,A=Math.imul(P,et),v=Math.imul(P,Ot),v=v+Math.imul(W,et)|0,S=Math.imul(W,Ot),A=A+Math.imul(C,it)|0,v=v+Math.imul(C,Ut)|0,v=v+Math.imul(b,it)|0,S=S+Math.imul(b,Ut)|0,A=A+Math.imul(Te,tt)|0,v=v+Math.imul(Te,Ct)|0,v=v+Math.imul(Ce,tt)|0,S=S+Math.imul(Ce,Ct)|0,A=A+Math.imul(pe,st)|0,v=v+Math.imul(pe,Vt)|0,v=v+Math.imul(ge,st)|0,S=S+Math.imul(ge,Vt)|0;var no=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(no>>>26)|0,no&=67108863,A=Math.imul(P,it),v=Math.imul(P,Ut),v=v+Math.imul(W,it)|0,S=Math.imul(W,Ut),A=A+Math.imul(C,tt)|0,v=v+Math.imul(C,Ct)|0,v=v+Math.imul(b,tt)|0,S=S+Math.imul(b,Ct)|0,A=A+Math.imul(Te,st)|0,v=v+Math.imul(Te,Vt)|0,v=v+Math.imul(Ce,st)|0,S=S+Math.imul(Ce,Vt)|0;var wi=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(wi>>>26)|0,wi&=67108863,A=Math.imul(P,tt),v=Math.imul(P,Ct),v=v+Math.imul(W,tt)|0,S=Math.imul(W,Ct),A=A+Math.imul(C,st)|0,v=v+Math.imul(C,Vt)|0,v=v+Math.imul(b,st)|0,S=S+Math.imul(b,Vt)|0;var xs=(M+A|0)+((v&8191)<<13)|0;M=(S+(v>>>13)|0)+(xs>>>26)|0,xs&=67108863,A=Math.imul(P,st),v=Math.imul(P,Vt),v=v+Math.imul(W,st)|0,S=Math.imul(W,Vt);var Ss=(M+A|0)+((v&8191)<<13)|0;return M=(S+(v>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,I[0]=St,I[1]=Pt,I[2]=In,I[3]=Cr,I[4]=Fn,I[5]=Tn,I[6]=un,I[7]=_i,I[8]=bs,I[9]=Ki,I[10]=Gi,I[11]=ws,I[12]=Es,I[13]=bi,I[14]=Wi,I[15]=no,I[16]=wi,I[17]=xs,I[18]=Ss,M!==0&&(I[19]=M,f.length++),f};Math.imul||(D=T);function N(F,m,g){g.negative=m.negative^F.negative,g.length=F.length+m.length;for(var f=0,p=0,y=0;y>>26)|0,p+=I>>>26,I&=67108863}g.words[y]=M,f=I,I=p}return f!==0?g.words[y]=f:g.length--,g.strip()}function O(F,m,g){var f=new L;return f.mulp(F,m,g)}s.prototype.mulTo=function(m,g){var f,p=this.length+m.length;return this.length===10&&m.length===10?f=D(this,m,g):p<63?f=T(this,m,g):p<1024?f=N(this,m,g):f=O(this,m,g),f};function L(F,m){this.x=F,this.y=m}L.prototype.makeRBT=function(m){for(var g=new Array(m),f=s.prototype._countBits(m)-1,p=0;p>=1;return p},L.prototype.permute=function(m,g,f,p,y,I){for(var M=0;M>>1)y++;return 1<>>13,f[2*I+1]=y&8191,y=y>>>13;for(I=2*g;I>=26,g+=p/67108864|0,g+=y>>>26,this.words[f]=y&67108863}return g!==0&&(this.words[f]=g,this.length++),this},s.prototype.muln=function(m){return this.clone().imuln(m)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(m){var g=_(m);if(g.length===0)return new s(1);for(var f=this,p=0;p=0);var g=m%26,f=(m-g)/26,p=67108863>>>26-g<<26-g,y;if(g!==0){var I=0;for(y=0;y>>26-g}I&&(this.words[y]=I,this.length++)}if(f!==0){for(y=this.length-1;y>=0;y--)this.words[y+f]=this.words[y];for(y=0;y=0);var p;g?p=(g-g%26)/26:p=0;var y=m%26,I=Math.min((m-y)/26,this.length),M=67108863^67108863>>>y<I)for(this.length-=I,v=0;v=0&&(S!==0||v>=p);v--){var w=this.words[v]|0;this.words[v]=S<<26-y|w>>>y,S=w&M}return A&&S!==0&&(A.words[A.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(m,g,f){return n(this.negative===0),this.iushrn(m,g,f)},s.prototype.shln=function(m){return this.clone().ishln(m)},s.prototype.ushln=function(m){return this.clone().iushln(m)},s.prototype.shrn=function(m){return this.clone().ishrn(m)},s.prototype.ushrn=function(m){return this.clone().iushrn(m)},s.prototype.testn=function(m){n(typeof m=="number"&&m>=0);var g=m%26,f=(m-g)/26,p=1<=0);var g=m%26,f=(m-g)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(g!==0&&f++,this.length=Math.min(f,this.length),g!==0){var p=67108863^67108863>>>g<=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},s.prototype.isubn=function(m){if(n(typeof m=="number"),n(m<67108864),m<0)return this.iaddn(-m);if(this.negative!==0)return this.negative=0,this.iaddn(m),this.negative=1,this;if(this.words[0]-=m,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g>26)-(A/67108864|0),this.words[y+f]=I&67108863}for(;y>26,this.words[y+f]=I&67108863;if(M===0)return this.strip();for(n(M===-1),M=0,y=0;y>26,this.words[y]=I&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(m,g){var f=this.length-m.length,p=this.clone(),y=m,I=y.words[y.length-1]|0,M=this._countBits(I);f=26-M,f!==0&&(y=y.ushln(f),p.iushln(f),I=y.words[y.length-1]|0);var A=p.length-y.length,v;if(g!=="mod"){v=new s(null),v.length=A+1,v.words=new Array(v.length);for(var S=0;S=0;U--){var me=(p.words[y.length+U]|0)*67108864+(p.words[y.length+U-1]|0);for(me=Math.min(me/I|0,67108863),p._ishlnsubmul(y,me,U);p.negative!==0;)me--,p.negative=0,p._ishlnsubmul(y,1,U),p.isZero()||(p.negative^=1);v&&(v.words[U]=me)}return v&&v.strip(),p.strip(),g!=="div"&&f!==0&&p.iushrn(f),{div:v||null,mod:p}},s.prototype.divmod=function(m,g,f){if(n(!m.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var p,y,I;return this.negative!==0&&m.negative===0?(I=this.neg().divmod(m,g),g!=="mod"&&(p=I.div.neg()),g!=="div"&&(y=I.mod.neg(),f&&y.negative!==0&&y.iadd(m)),{div:p,mod:y}):this.negative===0&&m.negative!==0?(I=this.divmod(m.neg(),g),g!=="mod"&&(p=I.div.neg()),{div:p,mod:I.mod}):(this.negative&m.negative)!==0?(I=this.neg().divmod(m.neg(),g),g!=="div"&&(y=I.mod.neg(),f&&y.negative!==0&&y.isub(m)),{div:I.div,mod:y}):m.length>this.length||this.cmp(m)<0?{div:new s(0),mod:this}:m.length===1?g==="div"?{div:this.divn(m.words[0]),mod:null}:g==="mod"?{div:null,mod:new s(this.modn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new s(this.modn(m.words[0]))}:this._wordDiv(m,g)},s.prototype.div=function(m){return this.divmod(m,"div",!1).div},s.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},s.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},s.prototype.divRound=function(m){var g=this.divmod(m);if(g.mod.isZero())return g.div;var f=g.div.negative!==0?g.mod.isub(m):g.mod,p=m.ushrn(1),y=m.andln(1),I=f.cmp(p);return I<0||y===1&&I===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},s.prototype.modn=function(m){n(m<=67108863);for(var g=(1<<26)%m,f=0,p=this.length-1;p>=0;p--)f=(g*f+(this.words[p]|0))%m;return f},s.prototype.idivn=function(m){n(m<=67108863);for(var g=0,f=this.length-1;f>=0;f--){var p=(this.words[f]|0)+g*67108864;this.words[f]=p/m|0,g=p%m}return this.strip()},s.prototype.divn=function(m){return this.clone().idivn(m)},s.prototype.egcd=function(m){n(m.negative===0),n(!m.isZero());var g=this,f=m.clone();g.negative!==0?g=g.umod(m):g=g.clone();for(var p=new s(1),y=new s(0),I=new s(0),M=new s(1),A=0;g.isEven()&&f.isEven();)g.iushrn(1),f.iushrn(1),++A;for(var v=f.clone(),S=g.clone();!g.isZero();){for(var w=0,U=1;(g.words[0]&U)===0&&w<26;++w,U<<=1);if(w>0)for(g.iushrn(w);w-- >0;)(p.isOdd()||y.isOdd())&&(p.iadd(v),y.isub(S)),p.iushrn(1),y.iushrn(1);for(var me=0,x=1;(f.words[0]&x)===0&&me<26;++me,x<<=1);if(me>0)for(f.iushrn(me);me-- >0;)(I.isOdd()||M.isOdd())&&(I.iadd(v),M.isub(S)),I.iushrn(1),M.iushrn(1);g.cmp(f)>=0?(g.isub(f),p.isub(I),y.isub(M)):(f.isub(g),I.isub(p),M.isub(y))}return{a:I,b:M,gcd:f.iushln(A)}},s.prototype._invmp=function(m){n(m.negative===0),n(!m.isZero());var g=this,f=m.clone();g.negative!==0?g=g.umod(m):g=g.clone();for(var p=new s(1),y=new s(0),I=f.clone();g.cmpn(1)>0&&f.cmpn(1)>0;){for(var M=0,A=1;(g.words[0]&A)===0&&M<26;++M,A<<=1);if(M>0)for(g.iushrn(M);M-- >0;)p.isOdd()&&p.iadd(I),p.iushrn(1);for(var v=0,S=1;(f.words[0]&S)===0&&v<26;++v,S<<=1);if(v>0)for(f.iushrn(v);v-- >0;)y.isOdd()&&y.iadd(I),y.iushrn(1);g.cmp(f)>=0?(g.isub(f),p.isub(y)):(f.isub(g),y.isub(p))}var w;return g.cmpn(1)===0?w=p:w=y,w.cmpn(0)<0&&w.iadd(m),w},s.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var g=this.clone(),f=m.clone();g.negative=0,f.negative=0;for(var p=0;g.isEven()&&f.isEven();p++)g.iushrn(1),f.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;f.isEven();)f.iushrn(1);var y=g.cmp(f);if(y<0){var I=g;g=f,f=I}else if(y===0||f.cmpn(1)===0)break;g.isub(f)}while(!0);return f.iushln(p)},s.prototype.invm=function(m){return this.egcd(m).a.umod(m)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(m){return this.words[0]&m},s.prototype.bincn=function(m){n(typeof m=="number");var g=m%26,f=(m-g)/26,p=1<>>26,M&=67108863,this.words[I]=M}return y!==0&&(this.words[I]=y,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(m){var g=m<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var f;if(this.length>1)f=1;else{g&&(m=-m),n(m<=67108863,"Number is too big");var p=this.words[0]|0;f=p===m?0:pm.length)return 1;if(this.length=0;f--){var p=this.words[f]|0,y=m.words[f]|0;if(p!==y){py&&(g=1);break}}return g},s.prototype.gtn=function(m){return this.cmpn(m)===1},s.prototype.gt=function(m){return this.cmp(m)===1},s.prototype.gten=function(m){return this.cmpn(m)>=0},s.prototype.gte=function(m){return this.cmp(m)>=0},s.prototype.ltn=function(m){return this.cmpn(m)===-1},s.prototype.lt=function(m){return this.cmp(m)===-1},s.prototype.lten=function(m){return this.cmpn(m)<=0},s.prototype.lte=function(m){return this.cmp(m)<=0},s.prototype.eqn=function(m){return this.cmpn(m)===0},s.prototype.eq=function(m){return this.cmp(m)===0},s.red=function(m){return new ue(m)},s.prototype.toRed=function(m){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(m){return this.red=m,this},s.prototype.forceRed=function(m){return n(!this.red,"Already a number in reduction context"),this._forceRed(m)},s.prototype.redAdd=function(m){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},s.prototype.redIAdd=function(m){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},s.prototype.redSub=function(m){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},s.prototype.redISub=function(m){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},s.prototype.redShl=function(m){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},s.prototype.redMul=function(m){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},s.prototype.redIMul=function(m){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(m){return n(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var J={k256:null,p224:null,p192:null,p25519:null};function q(F,m){this.name=F,this.p=new s(m,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var m=new s(null);return m.words=new Array(Math.ceil(this.n/13)),m},q.prototype.ireduce=function(m){var g=m,f;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),f=g.bitLength();while(f>this.n);var p=f0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},q.prototype.split=function(m,g){m.iushrn(this.n,0,g)},q.prototype.imulK=function(m){return m.imul(this.k)};function z(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(z,q),z.prototype.split=function(m,g){for(var f=4194303,p=Math.min(m.length,9),y=0;y>>22,I=M}I>>>=22,m.words[y-10]=I,I===0&&m.length>10?m.length-=10:m.length-=9},z.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var g=0,f=0;f>>=26,m.words[f]=y,g=p}return g!==0&&(m.words[m.length++]=g),m},s._prime=function(m){if(J[m])return J[m];var g;if(m==="k256")g=new z;else if(m==="p224")g=new ee;else if(m==="p192")g=new G;else if(m==="p25519")g=new ne;else throw new Error("Unknown prime "+m);return J[m]=g,g};function ue(F){if(typeof F=="string"){var m=s._prime(F);this.m=m.p,this.prime=m}else n(F.gtn(1),"modulus must be greater than 1"),this.m=F,this.prime=null}ue.prototype._verify1=function(m){n(m.negative===0,"red works only with positives"),n(m.red,"red works only with red numbers")},ue.prototype._verify2=function(m,g){n((m.negative|g.negative)===0,"red works only with positives"),n(m.red&&m.red===g.red,"red works only with red numbers")},ue.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):m.umod(this.m)._forceRed(this)},ue.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},ue.prototype.add=function(m,g){this._verify2(m,g);var f=m.add(g);return f.cmp(this.m)>=0&&f.isub(this.m),f._forceRed(this)},ue.prototype.iadd=function(m,g){this._verify2(m,g);var f=m.iadd(g);return f.cmp(this.m)>=0&&f.isub(this.m),f},ue.prototype.sub=function(m,g){this._verify2(m,g);var f=m.sub(g);return f.cmpn(0)<0&&f.iadd(this.m),f._forceRed(this)},ue.prototype.isub=function(m,g){this._verify2(m,g);var f=m.isub(g);return f.cmpn(0)<0&&f.iadd(this.m),f},ue.prototype.shl=function(m,g){return this._verify1(m),this.imod(m.ushln(g))},ue.prototype.imul=function(m,g){return this._verify2(m,g),this.imod(m.imul(g))},ue.prototype.mul=function(m,g){return this._verify2(m,g),this.imod(m.mul(g))},ue.prototype.isqr=function(m){return this.imul(m,m.clone())},ue.prototype.sqr=function(m){return this.mul(m,m)},ue.prototype.sqrt=function(m){if(m.isZero())return m.clone();var g=this.m.andln(3);if(n(g%2===1),g===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(m,f)}for(var p=this.m.subn(1),y=0;!p.isZero()&&p.andln(1)===0;)y++,p.iushrn(1);n(!p.isZero());var I=new s(1).toRed(this),M=I.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new s(2*v*v).toRed(this);this.pow(v,A).cmp(M)!==0;)v.redIAdd(M);for(var S=this.pow(v,p),w=this.pow(m,p.addn(1).iushrn(1)),U=this.pow(m,p),me=y;U.cmp(I)!==0;){for(var x=U,k=0;x.cmp(I)!==0;k++)x=x.redSqr();n(k=0;y--){for(var S=g.words[y],w=v-1;w>=0;w--){var U=S>>w&1;if(I!==p[0]&&(I=this.sqr(I)),U===0&&M===0){A=0;continue}M<<=1,M|=U,A++,!(A!==f&&(y!==0||w!==0))&&(I=this.mul(I,p[M]),A=0,M=0)}v=26}return I},ue.prototype.convertTo=function(m){var g=m.umod(this.m);return g===m?g.clone():g},ue.prototype.convertFrom=function(m){var g=m.clone();return g.red=null,g},s.mont=function(m){return new _e(m)};function _e(F){ue.call(this,F),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(_e,ue),_e.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},_e.prototype.convertFrom=function(m){var g=this.imod(m.mul(this.rinv));return g.red=null,g},_e.prototype.imul=function(m,g){if(m.isZero()||g.isZero())return m.words[0]=0,m.length=1,m;var f=m.imul(g),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=f.isub(p).iushrn(this.shift),I=y;return y.cmp(this.m)>=0?I=y.isub(this.m):y.cmpn(0)<0&&(I=y.iadd(this.m)),I._forceRed(this)},_e.prototype.mul=function(m,g){if(m.isZero()||g.isZero())return new s(0)._forceRed(this);var f=m.mul(g),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=f.isub(p).iushrn(this.shift),I=y;return y.cmp(this.m)>=0?I=y.isub(this.m):y.cmpn(0)<0&&(I=y.iadd(this.m)),I._forceRed(this)},_e.prototype.invm=function(m){var g=this.imod(m._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(t,ut)})(Lr);var Np={exports:{}},gb;Np.exports=function(e){return gb||(gb=new wa(null)),gb.generate(e)};function wa(t){this.rand=t}Np.exports.Rand=wa;wa.prototype.generate=function(e){return this._rand(e)};wa.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n=0);return i};pc.prototype._randrange=function(e,r){var n=r.sub(e);return e.add(this._randbelow(n))};pc.prototype.test=function(e,r,n){var i=e.bitLength(),s=Hu.mont(e),o=new Hu(1).toRed(s);r||(r=Math.max(1,i/48|0));for(var a=e.subn(1),u=0;!a.testn(u);u++);for(var c=e.shrn(u),l=a.toRed(s),h=!0;r>0;r--){var d=this._randrange(new Hu(2),a);n&&n(d);var _=d.toRed(s).redPow(c);if(!(_.cmp(o)===0||_.cmp(l)===0)){for(var T=1;T0;r--){var l=this._randrange(new Hu(2),o),h=e.gcd(l);if(h.cmpn(1)!==0)return h;var d=l.toRed(i).redPow(u);if(!(d.cmp(s)===0||d.cmp(c)===0)){for(var _=1;_t;)r.ishrn(1);if(r.isEven()&&r.iadd(Aae),r.testn(1)||r.iadd(rw),e.cmp(rw)){if(!e.cmp(kae))for(;r.mod(Mae).cmp(Cae);)r.iadd(lM)}else for(;r.mod(Iae).cmp(Rae);)r.iadd(lM);if(n=r.shrn(1),nw(n)&&nw(r)&&iw(n)&&iw(r)&&cM.test(n)&&cM.test(r))return r}}const Oae={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},Dae={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},Pae={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},Lae={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},Bae={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},$ae={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},Fae={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},Uae={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"};var qae={modp1:Oae,modp2:Dae,modp5:Pae,modp14:Lae,modp15:Bae,modp16:$ae,modp17:Fae,modp18:Uae},Pi=Lr.exports,jae=gL,fM=new jae,Vae=new Pi(24),zae=new Pi(11),Hae=new Pi(10),Kae=new Pi(3),Gae=new Pi(7),hM=mL,Wae=Va.exports,Xae=Wo;function Yae(t,e){return e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e)),this._pub=new Pi(t),this}function Jae(t,e){return e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e)),this._priv=new Pi(t),this}var yg={};function Qae(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in yg)return yg[n];var i=0;if(t.isEven()||!hM.simpleSieve||!hM.fermatTest(t)||!fM.test(t))return i+=1,r==="02"||r==="05"?i+=8:i+=4,yg[n]=i,i;fM.test(t.shrn(1))||(i+=2);var s;switch(r){case"02":t.mod(Vae).cmp(zae)&&(i+=8);break;case"05":s=t.mod(Hae),s.cmp(Kae)&&s.cmp(Gae)&&(i+=8);break;default:i+=4}return yg[n]=i,i}function Wo(t,e,r){this.setGenerator(e),this.__prime=new Pi(t),this._prime=Pi.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=Yae,this.setPrivateKey=Jae):this._primeCode=8}Object.defineProperty(Wo.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=Qae(this.__prime,this.__gen)),this._primeCode}});Wo.prototype.generateKeys=function(){return this._priv||(this._priv=new Pi(Wae(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()};Wo.prototype.computeSecret=function(t){t=new Pi(t),t=t.toRed(this._prime);var e=t.redPow(this._priv).fromRed(),r=new Buffer(e.toArray()),n=this.getPrime();if(r.length0?f:p},s.min=function(f,p){return f.cmp(p)<0?f:p},s.prototype._init=function(f,p,y){if(typeof f=="number")return this._initNumber(f,p,y);if(typeof f=="object")return this._initArray(f,p,y);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),f=f.toString().replace(/\s+/g,"");var I=0;f[0]==="-"&&(I++,this.negative=1),I=0;I-=3)A=f[I]|f[I-1]<<8|f[I-2]<<16,this.words[M]|=A<>>26-v&67108863,v+=24,v>=26&&(v-=26,M++);else if(y==="le")for(I=0,M=0;I>>26-v&67108863,v+=24,v>=26&&(v-=26,M++);return this._strip()};function a(g,f){var p=g.charCodeAt(f);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;n(!1,"Invalid character in "+g)}function u(g,f,p){var y=a(g,p);return p-1>=f&&(y|=a(g,p-1)<<4),y}s.prototype._parseHex=function(f,p,y){this.length=Math.ceil((f.length-p)/6),this.words=new Array(this.length);for(var I=0;I=p;I-=2)v=u(f,p,I)<=18?(M-=18,A+=1,this.words[A]|=v>>>26):M+=8;else{var S=f.length-p;for(I=S%2===0?p+1:p;I=18?(M-=18,A+=1,this.words[A]|=v>>>26):M+=8}this._strip()};function c(g,f,p,y){for(var I=0,M=0,A=Math.min(g.length,p),v=f;v=49?M=S-49+10:S>=17?M=S-17+10:M=S,n(S>=0&&M1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{s.prototype.inspect=h}else s.prototype.inspect=h;function h(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],T=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(f,p){f=f||10,p=p|0||1;var y;if(f===16||f==="hex"){y="";for(var I=0,M=0,A=0;A>>24-I&16777215,I+=2,I>=26&&(I-=26,A--),M!==0||A!==this.length-1?y=d[6-S.length]+S+y:y=S+y}for(M!==0&&(y=M.toString(16)+y);y.length%p!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(f===(f|0)&&f>=2&&f<=36){var w=_[f],U=T[f];y="";var me=this.clone();for(me.negative=0;!me.isZero();){var x=me.modrn(U).toString(f);me=me.idivn(U),me.isZero()?y=x+y:y=d[w-x.length]+x+y}for(this.isZero()&&(y="0"+y);y.length%p!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(f,p){return this.toArrayLike(o,f,p)}),s.prototype.toArray=function(f,p){return this.toArrayLike(Array,f,p)};var D=function(f,p){return f.allocUnsafe?f.allocUnsafe(p):new f(p)};s.prototype.toArrayLike=function(f,p,y){this._strip();var I=this.byteLength(),M=y||Math.max(1,I);n(I<=M,"byte array longer than desired length"),n(M>0,"Requested array length <= 0");var A=D(f,M),v=p==="le"?"LE":"BE";return this["_toArrayLike"+v](A,I),A},s.prototype._toArrayLikeLE=function(f,p){for(var y=0,I=0,M=0,A=0;M>8&255),y>16&255),A===6?(y>24&255),I=0,A=0):(I=v>>>24,A+=2)}if(y=0&&(f[y--]=v>>8&255),y>=0&&(f[y--]=v>>16&255),A===6?(y>=0&&(f[y--]=v>>24&255),I=0,A=0):(I=v>>>24,A+=2)}if(y>=0)for(f[y--]=I;y>=0;)f[y--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var p=f,y=0;return p>=4096&&(y+=13,p>>>=13),p>=64&&(y+=7,p>>>=7),p>=8&&(y+=4,p>>>=4),p>=2&&(y+=2,p>>>=2),y+p},s.prototype._zeroBits=function(f){if(f===0)return 26;var p=f,y=0;return(p&8191)===0&&(y+=13,p>>>=13),(p&127)===0&&(y+=7,p>>>=7),(p&15)===0&&(y+=4,p>>>=4),(p&3)===0&&(y+=2,p>>>=2),(p&1)===0&&y++,y},s.prototype.bitLength=function(){var f=this.words[this.length-1],p=this._countBits(f);return(this.length-1)*26+p};function N(g){for(var f=new Array(g.bitLength()),p=0;p>>I&1}return f}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,p=0;pf.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var p;this.length>f.length?p=f:p=this;for(var y=0;yf.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var p,y;this.length>f.length?(p=this,y=f):(p=f,y=this);for(var I=0;If.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){n(typeof f=="number"&&f>=0);var p=Math.ceil(f/26)|0,y=f%26;this._expand(p),y>0&&p--;for(var I=0;I0&&(this.words[I]=~this.words[I]&67108863>>26-y),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,p){n(typeof f=="number"&&f>=0);var y=f/26|0,I=f%26;return this._expand(y+1),p?this.words[y]=this.words[y]|1<f.length?(y=this,I=f):(y=f,I=this);for(var M=0,A=0;A>>26;for(;M!==0&&A>>26;if(this.length=y.length,M!==0)this.words[this.length]=M,this.length++;else if(y!==this)for(;Af.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var p=this.iadd(f);return f.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var y=this.cmp(f);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,M;y>0?(I=this,M=f):(I=f,M=this);for(var A=0,v=0;v>26,this.words[v]=p&67108863;for(;A!==0&&v>26,this.words[v]=p&67108863;if(A===0&&v>>26,me=S&67108863,x=Math.min(w,f.length-1),k=Math.max(0,w-g.length+1);k<=x;k++){var R=w-k|0;I=g.words[R]|0,M=f.words[k]|0,A=I*M+me,U+=A/67108864|0,me=A&67108863}p.words[w]=me|0,S=U|0}return S!==0?p.words[w]=S|0:p.length--,p._strip()}var L=function(f,p,y){var I=f.words,M=p.words,A=y.words,v=0,S,w,U,me=I[0]|0,x=me&8191,k=me>>>13,R=I[1]|0,j=R&8191,Q=R>>>13,oe=I[2]|0,fe=oe&8191,ie=oe>>>13,$=I[3]|0,V=$&8191,Y=$>>>13,ce=I[4]|0,ae=ce&8191,le=ce>>>13,ve=I[5]|0,Ee=ve&8191,pe=ve>>>13,ge=I[6]|0,Oe=ge&8191,Te=ge>>>13,Ce=I[7]|0,De=Ce&8191,C=Ce>>>13,b=I[8]|0,E=b&8191,P=b>>>13,W=I[9]|0,re=W&8191,te=W>>>13,be=M[0]|0,qe=be&8191,Me=be>>>13,Ue=M[1]|0,je=Ue&8191,Ze=Ue>>>13,xt=M[2]|0,mt=xt&8191,Ye=xt>>>13,At=M[3]|0,Bt=At&8191,nt=At>>>13,Ht=M[4]|0,$t=Ht&8191,Je=Ht>>>13,Nt=M[5]|0,Ft=Nt&8191,et=Nt>>>13,Ot=M[6]|0,Dt=Ot&8191,it=Ot>>>13,Ut=M[7]|0,qt=Ut&8191,tt=Ut>>>13,Ct=M[8]|0,jt=Ct&8191,st=Ct>>>13,Vt=M[9]|0,St=Vt&8191,Pt=Vt>>>13;y.negative=f.negative^p.negative,y.length=19,S=Math.imul(x,qe),w=Math.imul(x,Me),w=w+Math.imul(k,qe)|0,U=Math.imul(k,Me);var In=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(In>>>26)|0,In&=67108863,S=Math.imul(j,qe),w=Math.imul(j,Me),w=w+Math.imul(Q,qe)|0,U=Math.imul(Q,Me),S=S+Math.imul(x,je)|0,w=w+Math.imul(x,Ze)|0,w=w+Math.imul(k,je)|0,U=U+Math.imul(k,Ze)|0;var Cr=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,S=Math.imul(fe,qe),w=Math.imul(fe,Me),w=w+Math.imul(ie,qe)|0,U=Math.imul(ie,Me),S=S+Math.imul(j,je)|0,w=w+Math.imul(j,Ze)|0,w=w+Math.imul(Q,je)|0,U=U+Math.imul(Q,Ze)|0,S=S+Math.imul(x,mt)|0,w=w+Math.imul(x,Ye)|0,w=w+Math.imul(k,mt)|0,U=U+Math.imul(k,Ye)|0;var Fn=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,S=Math.imul(V,qe),w=Math.imul(V,Me),w=w+Math.imul(Y,qe)|0,U=Math.imul(Y,Me),S=S+Math.imul(fe,je)|0,w=w+Math.imul(fe,Ze)|0,w=w+Math.imul(ie,je)|0,U=U+Math.imul(ie,Ze)|0,S=S+Math.imul(j,mt)|0,w=w+Math.imul(j,Ye)|0,w=w+Math.imul(Q,mt)|0,U=U+Math.imul(Q,Ye)|0,S=S+Math.imul(x,Bt)|0,w=w+Math.imul(x,nt)|0,w=w+Math.imul(k,Bt)|0,U=U+Math.imul(k,nt)|0;var Tn=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,S=Math.imul(ae,qe),w=Math.imul(ae,Me),w=w+Math.imul(le,qe)|0,U=Math.imul(le,Me),S=S+Math.imul(V,je)|0,w=w+Math.imul(V,Ze)|0,w=w+Math.imul(Y,je)|0,U=U+Math.imul(Y,Ze)|0,S=S+Math.imul(fe,mt)|0,w=w+Math.imul(fe,Ye)|0,w=w+Math.imul(ie,mt)|0,U=U+Math.imul(ie,Ye)|0,S=S+Math.imul(j,Bt)|0,w=w+Math.imul(j,nt)|0,w=w+Math.imul(Q,Bt)|0,U=U+Math.imul(Q,nt)|0,S=S+Math.imul(x,$t)|0,w=w+Math.imul(x,Je)|0,w=w+Math.imul(k,$t)|0,U=U+Math.imul(k,Je)|0;var un=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(un>>>26)|0,un&=67108863,S=Math.imul(Ee,qe),w=Math.imul(Ee,Me),w=w+Math.imul(pe,qe)|0,U=Math.imul(pe,Me),S=S+Math.imul(ae,je)|0,w=w+Math.imul(ae,Ze)|0,w=w+Math.imul(le,je)|0,U=U+Math.imul(le,Ze)|0,S=S+Math.imul(V,mt)|0,w=w+Math.imul(V,Ye)|0,w=w+Math.imul(Y,mt)|0,U=U+Math.imul(Y,Ye)|0,S=S+Math.imul(fe,Bt)|0,w=w+Math.imul(fe,nt)|0,w=w+Math.imul(ie,Bt)|0,U=U+Math.imul(ie,nt)|0,S=S+Math.imul(j,$t)|0,w=w+Math.imul(j,Je)|0,w=w+Math.imul(Q,$t)|0,U=U+Math.imul(Q,Je)|0,S=S+Math.imul(x,Ft)|0,w=w+Math.imul(x,et)|0,w=w+Math.imul(k,Ft)|0,U=U+Math.imul(k,et)|0;var _i=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(_i>>>26)|0,_i&=67108863,S=Math.imul(Oe,qe),w=Math.imul(Oe,Me),w=w+Math.imul(Te,qe)|0,U=Math.imul(Te,Me),S=S+Math.imul(Ee,je)|0,w=w+Math.imul(Ee,Ze)|0,w=w+Math.imul(pe,je)|0,U=U+Math.imul(pe,Ze)|0,S=S+Math.imul(ae,mt)|0,w=w+Math.imul(ae,Ye)|0,w=w+Math.imul(le,mt)|0,U=U+Math.imul(le,Ye)|0,S=S+Math.imul(V,Bt)|0,w=w+Math.imul(V,nt)|0,w=w+Math.imul(Y,Bt)|0,U=U+Math.imul(Y,nt)|0,S=S+Math.imul(fe,$t)|0,w=w+Math.imul(fe,Je)|0,w=w+Math.imul(ie,$t)|0,U=U+Math.imul(ie,Je)|0,S=S+Math.imul(j,Ft)|0,w=w+Math.imul(j,et)|0,w=w+Math.imul(Q,Ft)|0,U=U+Math.imul(Q,et)|0,S=S+Math.imul(x,Dt)|0,w=w+Math.imul(x,it)|0,w=w+Math.imul(k,Dt)|0,U=U+Math.imul(k,it)|0;var bs=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(bs>>>26)|0,bs&=67108863,S=Math.imul(De,qe),w=Math.imul(De,Me),w=w+Math.imul(C,qe)|0,U=Math.imul(C,Me),S=S+Math.imul(Oe,je)|0,w=w+Math.imul(Oe,Ze)|0,w=w+Math.imul(Te,je)|0,U=U+Math.imul(Te,Ze)|0,S=S+Math.imul(Ee,mt)|0,w=w+Math.imul(Ee,Ye)|0,w=w+Math.imul(pe,mt)|0,U=U+Math.imul(pe,Ye)|0,S=S+Math.imul(ae,Bt)|0,w=w+Math.imul(ae,nt)|0,w=w+Math.imul(le,Bt)|0,U=U+Math.imul(le,nt)|0,S=S+Math.imul(V,$t)|0,w=w+Math.imul(V,Je)|0,w=w+Math.imul(Y,$t)|0,U=U+Math.imul(Y,Je)|0,S=S+Math.imul(fe,Ft)|0,w=w+Math.imul(fe,et)|0,w=w+Math.imul(ie,Ft)|0,U=U+Math.imul(ie,et)|0,S=S+Math.imul(j,Dt)|0,w=w+Math.imul(j,it)|0,w=w+Math.imul(Q,Dt)|0,U=U+Math.imul(Q,it)|0,S=S+Math.imul(x,qt)|0,w=w+Math.imul(x,tt)|0,w=w+Math.imul(k,qt)|0,U=U+Math.imul(k,tt)|0;var Ki=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(Ki>>>26)|0,Ki&=67108863,S=Math.imul(E,qe),w=Math.imul(E,Me),w=w+Math.imul(P,qe)|0,U=Math.imul(P,Me),S=S+Math.imul(De,je)|0,w=w+Math.imul(De,Ze)|0,w=w+Math.imul(C,je)|0,U=U+Math.imul(C,Ze)|0,S=S+Math.imul(Oe,mt)|0,w=w+Math.imul(Oe,Ye)|0,w=w+Math.imul(Te,mt)|0,U=U+Math.imul(Te,Ye)|0,S=S+Math.imul(Ee,Bt)|0,w=w+Math.imul(Ee,nt)|0,w=w+Math.imul(pe,Bt)|0,U=U+Math.imul(pe,nt)|0,S=S+Math.imul(ae,$t)|0,w=w+Math.imul(ae,Je)|0,w=w+Math.imul(le,$t)|0,U=U+Math.imul(le,Je)|0,S=S+Math.imul(V,Ft)|0,w=w+Math.imul(V,et)|0,w=w+Math.imul(Y,Ft)|0,U=U+Math.imul(Y,et)|0,S=S+Math.imul(fe,Dt)|0,w=w+Math.imul(fe,it)|0,w=w+Math.imul(ie,Dt)|0,U=U+Math.imul(ie,it)|0,S=S+Math.imul(j,qt)|0,w=w+Math.imul(j,tt)|0,w=w+Math.imul(Q,qt)|0,U=U+Math.imul(Q,tt)|0,S=S+Math.imul(x,jt)|0,w=w+Math.imul(x,st)|0,w=w+Math.imul(k,jt)|0,U=U+Math.imul(k,st)|0;var Gi=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,S=Math.imul(re,qe),w=Math.imul(re,Me),w=w+Math.imul(te,qe)|0,U=Math.imul(te,Me),S=S+Math.imul(E,je)|0,w=w+Math.imul(E,Ze)|0,w=w+Math.imul(P,je)|0,U=U+Math.imul(P,Ze)|0,S=S+Math.imul(De,mt)|0,w=w+Math.imul(De,Ye)|0,w=w+Math.imul(C,mt)|0,U=U+Math.imul(C,Ye)|0,S=S+Math.imul(Oe,Bt)|0,w=w+Math.imul(Oe,nt)|0,w=w+Math.imul(Te,Bt)|0,U=U+Math.imul(Te,nt)|0,S=S+Math.imul(Ee,$t)|0,w=w+Math.imul(Ee,Je)|0,w=w+Math.imul(pe,$t)|0,U=U+Math.imul(pe,Je)|0,S=S+Math.imul(ae,Ft)|0,w=w+Math.imul(ae,et)|0,w=w+Math.imul(le,Ft)|0,U=U+Math.imul(le,et)|0,S=S+Math.imul(V,Dt)|0,w=w+Math.imul(V,it)|0,w=w+Math.imul(Y,Dt)|0,U=U+Math.imul(Y,it)|0,S=S+Math.imul(fe,qt)|0,w=w+Math.imul(fe,tt)|0,w=w+Math.imul(ie,qt)|0,U=U+Math.imul(ie,tt)|0,S=S+Math.imul(j,jt)|0,w=w+Math.imul(j,st)|0,w=w+Math.imul(Q,jt)|0,U=U+Math.imul(Q,st)|0,S=S+Math.imul(x,St)|0,w=w+Math.imul(x,Pt)|0,w=w+Math.imul(k,St)|0,U=U+Math.imul(k,Pt)|0;var ws=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(ws>>>26)|0,ws&=67108863,S=Math.imul(re,je),w=Math.imul(re,Ze),w=w+Math.imul(te,je)|0,U=Math.imul(te,Ze),S=S+Math.imul(E,mt)|0,w=w+Math.imul(E,Ye)|0,w=w+Math.imul(P,mt)|0,U=U+Math.imul(P,Ye)|0,S=S+Math.imul(De,Bt)|0,w=w+Math.imul(De,nt)|0,w=w+Math.imul(C,Bt)|0,U=U+Math.imul(C,nt)|0,S=S+Math.imul(Oe,$t)|0,w=w+Math.imul(Oe,Je)|0,w=w+Math.imul(Te,$t)|0,U=U+Math.imul(Te,Je)|0,S=S+Math.imul(Ee,Ft)|0,w=w+Math.imul(Ee,et)|0,w=w+Math.imul(pe,Ft)|0,U=U+Math.imul(pe,et)|0,S=S+Math.imul(ae,Dt)|0,w=w+Math.imul(ae,it)|0,w=w+Math.imul(le,Dt)|0,U=U+Math.imul(le,it)|0,S=S+Math.imul(V,qt)|0,w=w+Math.imul(V,tt)|0,w=w+Math.imul(Y,qt)|0,U=U+Math.imul(Y,tt)|0,S=S+Math.imul(fe,jt)|0,w=w+Math.imul(fe,st)|0,w=w+Math.imul(ie,jt)|0,U=U+Math.imul(ie,st)|0,S=S+Math.imul(j,St)|0,w=w+Math.imul(j,Pt)|0,w=w+Math.imul(Q,St)|0,U=U+Math.imul(Q,Pt)|0;var Es=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(Es>>>26)|0,Es&=67108863,S=Math.imul(re,mt),w=Math.imul(re,Ye),w=w+Math.imul(te,mt)|0,U=Math.imul(te,Ye),S=S+Math.imul(E,Bt)|0,w=w+Math.imul(E,nt)|0,w=w+Math.imul(P,Bt)|0,U=U+Math.imul(P,nt)|0,S=S+Math.imul(De,$t)|0,w=w+Math.imul(De,Je)|0,w=w+Math.imul(C,$t)|0,U=U+Math.imul(C,Je)|0,S=S+Math.imul(Oe,Ft)|0,w=w+Math.imul(Oe,et)|0,w=w+Math.imul(Te,Ft)|0,U=U+Math.imul(Te,et)|0,S=S+Math.imul(Ee,Dt)|0,w=w+Math.imul(Ee,it)|0,w=w+Math.imul(pe,Dt)|0,U=U+Math.imul(pe,it)|0,S=S+Math.imul(ae,qt)|0,w=w+Math.imul(ae,tt)|0,w=w+Math.imul(le,qt)|0,U=U+Math.imul(le,tt)|0,S=S+Math.imul(V,jt)|0,w=w+Math.imul(V,st)|0,w=w+Math.imul(Y,jt)|0,U=U+Math.imul(Y,st)|0,S=S+Math.imul(fe,St)|0,w=w+Math.imul(fe,Pt)|0,w=w+Math.imul(ie,St)|0,U=U+Math.imul(ie,Pt)|0;var bi=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(bi>>>26)|0,bi&=67108863,S=Math.imul(re,Bt),w=Math.imul(re,nt),w=w+Math.imul(te,Bt)|0,U=Math.imul(te,nt),S=S+Math.imul(E,$t)|0,w=w+Math.imul(E,Je)|0,w=w+Math.imul(P,$t)|0,U=U+Math.imul(P,Je)|0,S=S+Math.imul(De,Ft)|0,w=w+Math.imul(De,et)|0,w=w+Math.imul(C,Ft)|0,U=U+Math.imul(C,et)|0,S=S+Math.imul(Oe,Dt)|0,w=w+Math.imul(Oe,it)|0,w=w+Math.imul(Te,Dt)|0,U=U+Math.imul(Te,it)|0,S=S+Math.imul(Ee,qt)|0,w=w+Math.imul(Ee,tt)|0,w=w+Math.imul(pe,qt)|0,U=U+Math.imul(pe,tt)|0,S=S+Math.imul(ae,jt)|0,w=w+Math.imul(ae,st)|0,w=w+Math.imul(le,jt)|0,U=U+Math.imul(le,st)|0,S=S+Math.imul(V,St)|0,w=w+Math.imul(V,Pt)|0,w=w+Math.imul(Y,St)|0,U=U+Math.imul(Y,Pt)|0;var Wi=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,S=Math.imul(re,$t),w=Math.imul(re,Je),w=w+Math.imul(te,$t)|0,U=Math.imul(te,Je),S=S+Math.imul(E,Ft)|0,w=w+Math.imul(E,et)|0,w=w+Math.imul(P,Ft)|0,U=U+Math.imul(P,et)|0,S=S+Math.imul(De,Dt)|0,w=w+Math.imul(De,it)|0,w=w+Math.imul(C,Dt)|0,U=U+Math.imul(C,it)|0,S=S+Math.imul(Oe,qt)|0,w=w+Math.imul(Oe,tt)|0,w=w+Math.imul(Te,qt)|0,U=U+Math.imul(Te,tt)|0,S=S+Math.imul(Ee,jt)|0,w=w+Math.imul(Ee,st)|0,w=w+Math.imul(pe,jt)|0,U=U+Math.imul(pe,st)|0,S=S+Math.imul(ae,St)|0,w=w+Math.imul(ae,Pt)|0,w=w+Math.imul(le,St)|0,U=U+Math.imul(le,Pt)|0;var no=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(no>>>26)|0,no&=67108863,S=Math.imul(re,Ft),w=Math.imul(re,et),w=w+Math.imul(te,Ft)|0,U=Math.imul(te,et),S=S+Math.imul(E,Dt)|0,w=w+Math.imul(E,it)|0,w=w+Math.imul(P,Dt)|0,U=U+Math.imul(P,it)|0,S=S+Math.imul(De,qt)|0,w=w+Math.imul(De,tt)|0,w=w+Math.imul(C,qt)|0,U=U+Math.imul(C,tt)|0,S=S+Math.imul(Oe,jt)|0,w=w+Math.imul(Oe,st)|0,w=w+Math.imul(Te,jt)|0,U=U+Math.imul(Te,st)|0,S=S+Math.imul(Ee,St)|0,w=w+Math.imul(Ee,Pt)|0,w=w+Math.imul(pe,St)|0,U=U+Math.imul(pe,Pt)|0;var wi=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(wi>>>26)|0,wi&=67108863,S=Math.imul(re,Dt),w=Math.imul(re,it),w=w+Math.imul(te,Dt)|0,U=Math.imul(te,it),S=S+Math.imul(E,qt)|0,w=w+Math.imul(E,tt)|0,w=w+Math.imul(P,qt)|0,U=U+Math.imul(P,tt)|0,S=S+Math.imul(De,jt)|0,w=w+Math.imul(De,st)|0,w=w+Math.imul(C,jt)|0,U=U+Math.imul(C,st)|0,S=S+Math.imul(Oe,St)|0,w=w+Math.imul(Oe,Pt)|0,w=w+Math.imul(Te,St)|0,U=U+Math.imul(Te,Pt)|0;var xs=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(xs>>>26)|0,xs&=67108863,S=Math.imul(re,qt),w=Math.imul(re,tt),w=w+Math.imul(te,qt)|0,U=Math.imul(te,tt),S=S+Math.imul(E,jt)|0,w=w+Math.imul(E,st)|0,w=w+Math.imul(P,jt)|0,U=U+Math.imul(P,st)|0,S=S+Math.imul(De,St)|0,w=w+Math.imul(De,Pt)|0,w=w+Math.imul(C,St)|0,U=U+Math.imul(C,Pt)|0;var Ss=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(Ss>>>26)|0,Ss&=67108863,S=Math.imul(re,jt),w=Math.imul(re,st),w=w+Math.imul(te,jt)|0,U=Math.imul(te,st),S=S+Math.imul(E,St)|0,w=w+Math.imul(E,Pt)|0,w=w+Math.imul(P,St)|0,U=U+Math.imul(P,Pt)|0;var Cf=(v+S|0)+((w&8191)<<13)|0;v=(U+(w>>>13)|0)+(Cf>>>26)|0,Cf&=67108863,S=Math.imul(re,St),w=Math.imul(re,Pt),w=w+Math.imul(te,St)|0,U=Math.imul(te,Pt);var Rf=(v+S|0)+((w&8191)<<13)|0;return v=(U+(w>>>13)|0)+(Rf>>>26)|0,Rf&=67108863,A[0]=In,A[1]=Cr,A[2]=Fn,A[3]=Tn,A[4]=un,A[5]=_i,A[6]=bs,A[7]=Ki,A[8]=Gi,A[9]=ws,A[10]=Es,A[11]=bi,A[12]=Wi,A[13]=no,A[14]=wi,A[15]=xs,A[16]=Ss,A[17]=Cf,A[18]=Rf,v!==0&&(A[19]=v,y.length++),y};Math.imul||(L=O);function J(g,f,p){p.negative=f.negative^g.negative,p.length=g.length+f.length;for(var y=0,I=0,M=0;M>>26)|0,I+=A>>>26,A&=67108863}p.words[M]=v,y=A,A=I}return y!==0?p.words[M]=y:p.length--,p._strip()}function q(g,f,p){return J(g,f,p)}s.prototype.mulTo=function(f,p){var y,I=this.length+f.length;return this.length===10&&f.length===10?y=L(this,f,p):I<63?y=O(this,f,p):I<1024?y=J(this,f,p):y=q(this,f,p),y},s.prototype.mul=function(f){var p=new s(null);return p.words=new Array(this.length+f.length),this.mulTo(f,p)},s.prototype.mulf=function(f){var p=new s(null);return p.words=new Array(this.length+f.length),q(this,f,p)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var p=f<0;p&&(f=-f),n(typeof f=="number"),n(f<67108864);for(var y=0,I=0;I>=26,y+=M/67108864|0,y+=A>>>26,this.words[I]=A&67108863}return y!==0&&(this.words[I]=y,this.length++),p?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var p=N(f);if(p.length===0)return new s(1);for(var y=this,I=0;I=0);var p=f%26,y=(f-p)/26,I=67108863>>>26-p<<26-p,M;if(p!==0){var A=0;for(M=0;M>>26-p}A&&(this.words[M]=A,this.length++)}if(y!==0){for(M=this.length-1;M>=0;M--)this.words[M+y]=this.words[M];for(M=0;M=0);var I;p?I=(p-p%26)/26:I=0;var M=f%26,A=Math.min((f-M)/26,this.length),v=67108863^67108863>>>M<A)for(this.length-=A,w=0;w=0&&(U!==0||w>=I);w--){var me=this.words[w]|0;this.words[w]=U<<26-M|me>>>M,U=me&v}return S&&U!==0&&(S.words[S.length++]=U),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,p,y){return n(this.negative===0),this.iushrn(f,p,y)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){n(typeof f=="number"&&f>=0);var p=f%26,y=(f-p)/26,I=1<=0);var p=f%26,y=(f-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(p!==0&&y++,this.length=Math.min(y,this.length),p!==0){var I=67108863^67108863>>>p<=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},s.prototype.isubn=function(f){if(n(typeof f=="number"),n(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(S/67108864|0),this.words[M+y]=A&67108863}for(;M>26,this.words[M+y]=A&67108863;if(v===0)return this._strip();for(n(v===-1),v=0,M=0;M>26,this.words[M]=A&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,p){var y=this.length-f.length,I=this.clone(),M=f,A=M.words[M.length-1]|0,v=this._countBits(A);y=26-v,y!==0&&(M=M.ushln(y),I.iushln(y),A=M.words[M.length-1]|0);var S=I.length-M.length,w;if(p!=="mod"){w=new s(null),w.length=S+1,w.words=new Array(w.length);for(var U=0;U=0;x--){var k=(I.words[M.length+x]|0)*67108864+(I.words[M.length+x-1]|0);for(k=Math.min(k/A|0,67108863),I._ishlnsubmul(M,k,x);I.negative!==0;)k--,I.negative=0,I._ishlnsubmul(M,1,x),I.isZero()||(I.negative^=1);w&&(w.words[x]=k)}return w&&w._strip(),I._strip(),p!=="div"&&y!==0&&I.iushrn(y),{div:w||null,mod:I}},s.prototype.divmod=function(f,p,y){if(n(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var I,M,A;return this.negative!==0&&f.negative===0?(A=this.neg().divmod(f,p),p!=="mod"&&(I=A.div.neg()),p!=="div"&&(M=A.mod.neg(),y&&M.negative!==0&&M.iadd(f)),{div:I,mod:M}):this.negative===0&&f.negative!==0?(A=this.divmod(f.neg(),p),p!=="mod"&&(I=A.div.neg()),{div:I,mod:A.mod}):(this.negative&f.negative)!==0?(A=this.neg().divmod(f.neg(),p),p!=="div"&&(M=A.mod.neg(),y&&M.negative!==0&&M.isub(f)),{div:A.div,mod:M}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?p==="div"?{div:this.divn(f.words[0]),mod:null}:p==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,p)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var p=this.divmod(f);if(p.mod.isZero())return p.div;var y=p.div.negative!==0?p.mod.isub(f):p.mod,I=f.ushrn(1),M=f.andln(1),A=y.cmp(I);return A<0||M===1&&A===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},s.prototype.modrn=function(f){var p=f<0;p&&(f=-f),n(f<=67108863);for(var y=(1<<26)%f,I=0,M=this.length-1;M>=0;M--)I=(y*I+(this.words[M]|0))%f;return p?-I:I},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var p=f<0;p&&(f=-f),n(f<=67108863);for(var y=0,I=this.length-1;I>=0;I--){var M=(this.words[I]|0)+y*67108864;this.words[I]=M/f|0,y=M%f}return this._strip(),p?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){n(f.negative===0),n(!f.isZero());var p=this,y=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var I=new s(1),M=new s(0),A=new s(0),v=new s(1),S=0;p.isEven()&&y.isEven();)p.iushrn(1),y.iushrn(1),++S;for(var w=y.clone(),U=p.clone();!p.isZero();){for(var me=0,x=1;(p.words[0]&x)===0&&me<26;++me,x<<=1);if(me>0)for(p.iushrn(me);me-- >0;)(I.isOdd()||M.isOdd())&&(I.iadd(w),M.isub(U)),I.iushrn(1),M.iushrn(1);for(var k=0,R=1;(y.words[0]&R)===0&&k<26;++k,R<<=1);if(k>0)for(y.iushrn(k);k-- >0;)(A.isOdd()||v.isOdd())&&(A.iadd(w),v.isub(U)),A.iushrn(1),v.iushrn(1);p.cmp(y)>=0?(p.isub(y),I.isub(A),M.isub(v)):(y.isub(p),A.isub(I),v.isub(M))}return{a:A,b:v,gcd:y.iushln(S)}},s.prototype._invmp=function(f){n(f.negative===0),n(!f.isZero());var p=this,y=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var I=new s(1),M=new s(0),A=y.clone();p.cmpn(1)>0&&y.cmpn(1)>0;){for(var v=0,S=1;(p.words[0]&S)===0&&v<26;++v,S<<=1);if(v>0)for(p.iushrn(v);v-- >0;)I.isOdd()&&I.iadd(A),I.iushrn(1);for(var w=0,U=1;(y.words[0]&U)===0&&w<26;++w,U<<=1);if(w>0)for(y.iushrn(w);w-- >0;)M.isOdd()&&M.iadd(A),M.iushrn(1);p.cmp(y)>=0?(p.isub(y),I.isub(M)):(y.isub(p),M.isub(I))}var me;return p.cmpn(1)===0?me=I:me=M,me.cmpn(0)<0&&me.iadd(f),me},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var p=this.clone(),y=f.clone();p.negative=0,y.negative=0;for(var I=0;p.isEven()&&y.isEven();I++)p.iushrn(1),y.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;y.isEven();)y.iushrn(1);var M=p.cmp(y);if(M<0){var A=p;p=y,y=A}else if(M===0||y.cmpn(1)===0)break;p.isub(y)}while(!0);return y.iushln(I)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){n(typeof f=="number");var p=f%26,y=(f-p)/26,I=1<>>26,v&=67108863,this.words[A]=v}return M!==0&&(this.words[A]=M,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var p=f<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var y;if(this.length>1)y=1;else{p&&(f=-f),n(f<=67108863,"Number is too big");var I=this.words[0]|0;y=I===f?0:If.length)return 1;if(this.length=0;y--){var I=this.words[y]|0,M=f.words[y]|0;if(I!==M){IM&&(p=1);break}}return p},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new F(f)},s.prototype.toRed=function(f){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return n(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return n(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var z={k256:null,p224:null,p192:null,p25519:null};function ee(g,f){this.name=g,this.p=new s(f,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}ee.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},ee.prototype.ireduce=function(f){var p=f,y;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),y=p.bitLength();while(y>this.n);var I=y0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},ee.prototype.split=function(f,p){f.iushrn(this.n,0,p)},ee.prototype.imulK=function(f){return f.imul(this.k)};function G(){ee.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(G,ee),G.prototype.split=function(f,p){for(var y=4194303,I=Math.min(f.length,9),M=0;M>>22,A=v}A>>>=22,f.words[M-10]=A,A===0&&f.length>10?f.length-=10:f.length-=9},G.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var p=0,y=0;y>>=26,f.words[y]=M,p=I}return p!==0&&(f.words[f.length++]=p),f},s._prime=function(f){if(z[f])return z[f];var p;if(f==="k256")p=new G;else if(f==="p224")p=new ne;else if(f==="p192")p=new ue;else if(f==="p25519")p=new _e;else throw new Error("Unknown prime "+f);return z[f]=p,p};function F(g){if(typeof g=="string"){var f=s._prime(g);this.m=f.p,this.prime=f}else n(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}F.prototype._verify1=function(f){n(f.negative===0,"red works only with positives"),n(f.red,"red works only with red numbers")},F.prototype._verify2=function(f,p){n((f.negative|p.negative)===0,"red works only with positives"),n(f.red&&f.red===p.red,"red works only with red numbers")},F.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(l(f,f.umod(this.m)._forceRed(this)),f)},F.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},F.prototype.add=function(f,p){this._verify2(f,p);var y=f.add(p);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},F.prototype.iadd=function(f,p){this._verify2(f,p);var y=f.iadd(p);return y.cmp(this.m)>=0&&y.isub(this.m),y},F.prototype.sub=function(f,p){this._verify2(f,p);var y=f.sub(p);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},F.prototype.isub=function(f,p){this._verify2(f,p);var y=f.isub(p);return y.cmpn(0)<0&&y.iadd(this.m),y},F.prototype.shl=function(f,p){return this._verify1(f),this.imod(f.ushln(p))},F.prototype.imul=function(f,p){return this._verify2(f,p),this.imod(f.imul(p))},F.prototype.mul=function(f,p){return this._verify2(f,p),this.imod(f.mul(p))},F.prototype.isqr=function(f){return this.imul(f,f.clone())},F.prototype.sqr=function(f){return this.mul(f,f)},F.prototype.sqrt=function(f){if(f.isZero())return f.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var y=this.m.add(new s(1)).iushrn(2);return this.pow(f,y)}for(var I=this.m.subn(1),M=0;!I.isZero()&&I.andln(1)===0;)M++,I.iushrn(1);n(!I.isZero());var A=new s(1).toRed(this),v=A.redNeg(),S=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new s(2*w*w).toRed(this);this.pow(w,S).cmp(v)!==0;)w.redIAdd(v);for(var U=this.pow(w,I),me=this.pow(f,I.addn(1).iushrn(1)),x=this.pow(f,I),k=M;x.cmp(A)!==0;){for(var R=x,j=0;R.cmp(A)!==0;j++)R=R.redSqr();n(j=0;M--){for(var U=p.words[M],me=w-1;me>=0;me--){var x=U>>me&1;if(A!==I[0]&&(A=this.sqr(A)),x===0&&v===0){S=0;continue}v<<=1,v|=x,S++,!(S!==y&&(M!==0||me!==0))&&(A=this.mul(A,I[v]),S=0,v=0)}w=26}return A},F.prototype.convertTo=function(f){var p=f.umod(this.m);return p===f?p.clone():p},F.prototype.convertFrom=function(f){var p=f.clone();return p.red=null,p},s.mont=function(f){return new m(f)};function m(g){F.call(this,g),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(m,F),m.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},m.prototype.convertFrom=function(f){var p=this.imod(f.mul(this.rinv));return p.red=null,p},m.prototype.imul=function(f,p){if(f.isZero()||p.isZero())return f.words[0]=0,f.length=1,f;var y=f.imul(p),I=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=y.isub(I).iushrn(this.shift),A=M;return M.cmp(this.m)>=0?A=M.isub(this.m):M.cmpn(0)<0&&(A=M.iadd(this.m)),A._forceRed(this)},m.prototype.mul=function(f,p){if(f.isZero()||p.isZero())return new s(0)._forceRed(this);var y=f.mul(p),I=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=y.isub(I).iushrn(this.shift),A=M;return M.cmp(this.m)>=0?A=M.isub(this.m):M.cmpn(0)<0&&(A=M.iadd(this.m)),A._forceRed(this)},m.prototype.invm=function(f){var p=this.imod(f._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(t,ut)})(hy);var xl=hy.exports,rue=Va.exports;function nue(t){var e=yL(t),r=e.toRed(xl.mont(t.modulus)).redPow(new xl(t.publicExponent)).fromRed();return{blinder:r,unblinder:e.invm(t.modulus)}}function yL(t){var e=t.modulus.byteLength(),r;do r=new xl(rue(e));while(r.cmp(t.modulus)>=0||!r.umod(t.prime1)||!r.umod(t.prime2));return r}function _L(t,e){var r=nue(e),n=e.modulus.byteLength(),i=new xl(t).mul(r.blinder).umod(e.modulus),s=i.toRed(xl.mont(e.prime1)),o=i.toRed(xl.mont(e.prime2)),a=e.coefficient,u=e.prime1,c=e.prime2,l=s.redPow(e.exponent1).fromRed(),h=o.redPow(e.exponent2).fromRed(),d=l.isub(h).imul(a).umod(u).imul(c);return h.iadd(d).imul(r.unblinder).umod(e.modulus).toArrayLike(Buffer,"be",n)}_L.getr=yL;var TS=_L,dy={};const iue="elliptic",sue="6.5.4",oue="EC cryptography",aue="lib/elliptic.js",uue=["lib"],cue={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},lue={type:"git",url:"git@github.com:indutny/elliptic"},fue=["EC","Elliptic","curve","Cryptography"],hue="Fedor Indutny ",due="MIT",pue={url:"https://github.com/indutny/elliptic/issues"},gue="https://github.com/indutny/elliptic",mue={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},vue={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"};var yue={name:iue,version:sue,description:oue,main:aue,files:uue,scripts:cue,repository:lue,keywords:fue,author:hue,license:due,bugs:pue,homepage:gue,devDependencies:mue,dependencies:vue},vi={},AS={};(function(t){var e=t;function r(s,o){if(Array.isArray(s))return s.slice();if(!s)return[];var a=[];if(typeof s!="string"){for(var u=0;u>8,h=c&255;l?a.push(l,h):a.push(h)}return a}e.toArray=r;function n(s){return s.length===1?"0"+s:s}e.zero2=n;function i(s){for(var o="",a=0;a(T>>1)-1?O=(T>>1)-L:O=L,D.isubn(O)):O=0,_[N]=O,D.iushrn(1)}return _}e.getNAF=s;function o(l,h){var d=[[],[]];l=l.clone(),h=h.clone();for(var _=0,T=0,D;l.cmpn(-_)>0||h.cmpn(-T)>0;){var N=l.andln(3)+_&3,O=h.andln(3)+T&3;N===3&&(N=-1),O===3&&(O=-1);var L;(N&1)===0?L=0:(D=l.andln(7)+_&7,(D===3||D===5)&&O===2?L=-N:L=N),d[0].push(L);var J;(O&1)===0?J=0:(D=h.andln(7)+T&7,(D===3||D===5)&&N===2?J=-O:J=O),d[1].push(J),2*_===L+1&&(_=1-_),2*T===J+1&&(T=1-T),l.iushrn(1),h.iushrn(1)}return d}e.getJSF=o;function a(l,h,d){var _="_"+h;l.prototype[h]=function(){return this[_]!==void 0?this[_]:this[_]=d.call(this)}}e.cachedProperty=a;function u(l){return typeof l=="string"?e.toArray(l,"hex"):l}e.parseBytes=u;function c(l){return new r(l,"hex","le")}e.intFromLE=c})(vi);var kS={},du=Lr.exports,Op=vi,Q0=Op.getNAF,_ue=Op.getJSF,Z0=Op.assert;function iu(t,e){this.type=t,this.p=new du(e.p,16),this.red=e.prime?du.red(e.prime):du.mont(this.p),this.zero=new du(0).toRed(this.red),this.one=new du(1).toRed(this.red),this.two=new du(2).toRed(this.red),this.n=e.n&&new du(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var py=iu;iu.prototype.point=function(){throw new Error("Not implemented")};iu.prototype.validate=function(){throw new Error("Not implemented")};iu.prototype._fixedNafMul=function(e,r){Z0(e.precomputed);var n=e._getDoubles(),i=Q0(r,1,this._bitLength),s=(1<=a;c--)u=(u<<1)+i[c];o.push(u)}for(var l=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a=0;u--){for(var c=0;u>=0&&o[u]===0;u--)c++;if(u>=0&&c++,a=a.dblp(c),u<0)break;var l=o[u];Z0(l!==0),e.type==="affine"?l>0?a=a.mixedAdd(s[l-1>>1]):a=a.mixedAdd(s[-l-1>>1].neg()):l>0?a=a.add(s[l-1>>1]):a=a.add(s[-l-1>>1].neg())}return e.type==="affine"?a.toP():a};iu.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,u=this._wnafT3,c=0,l,h,d;for(l=0;l=1;l-=2){var T=l-1,D=l;if(o[T]!==1||o[D]!==1){u[T]=Q0(n[T],o[T],this._bitLength),u[D]=Q0(n[D],o[D],this._bitLength),c=Math.max(u[T].length,c),c=Math.max(u[D].length,c);continue}var N=[r[T],null,null,r[D]];r[T].y.cmp(r[D].y)===0?(N[1]=r[T].add(r[D]),N[2]=r[T].toJ().mixedAdd(r[D].neg())):r[T].y.cmp(r[D].y.redNeg())===0?(N[1]=r[T].toJ().mixedAdd(r[D]),N[2]=r[T].add(r[D].neg())):(N[1]=r[T].toJ().mixedAdd(r[D]),N[2]=r[T].toJ().mixedAdd(r[D].neg()));var O=[-3,-1,-5,-7,0,7,5,1,3],L=_ue(n[T],n[D]);for(c=Math.max(L[0].length,c),u[T]=new Array(c),u[D]=new Array(c),h=0;h=0;l--){for(var G=0;l>=0;){var ne=!0;for(h=0;h=0&&G++,z=z.dblp(G),l<0)break;for(h=0;h0?d=a[h][ue-1>>1]:ue<0&&(d=a[h][-ue-1>>1].neg()),d.type==="affine"?z=z.mixedAdd(d):z=z.add(d))}}for(l=0;l=Math.ceil((e.bitLength()+1)/r.step):!1};Vi.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(_=c,T=l),h.negative&&(h=h.neg(),d=d.neg()),_.negative&&(_=_.neg(),T=T.neg()),[{a:h,b:d},{a:_,b:T}]};zi.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),u=o.mul(i.a),c=s.mul(n.b),l=o.mul(i.b),h=e.sub(a).sub(u),d=c.add(l).neg();return{k1:h,k2:d}};zi.prototype.pointFromX=function(e,r){e=new gr(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};zi.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};zi.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Wr.prototype.isInfinity=function(){return this.inf};Wr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Wr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Wr.prototype.getX=function(){return this.x.fromRed()};Wr.prototype.getY=function(){return this.y.fromRed()};Wr.prototype.mul=function(e){return e=new gr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Wr.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Wr.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Wr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Wr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Wr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function an(t,e,r,n){Ef.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new gr(0)):(this.x=new gr(e,16),this.y=new gr(r,16),this.z=new gr(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}MS(an,Ef.BasePoint);zi.prototype.jpoint=function(e,r,n){return new an(this,e,r,n)};an.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};an.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};an.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),u=i.redSub(s),c=o.redSub(a);if(u.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=u.redSqr(),h=l.redMul(u),d=i.redMul(l),_=c.redSqr().redIAdd(h).redISub(d).redISub(d),T=c.redMul(d.redISub(_)).redISub(o.redMul(h)),D=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(_,T,D)};an.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),u=s.redSub(o);if(a.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),h=n.redMul(c),d=u.redSqr().redIAdd(l).redISub(h).redISub(h),_=u.redMul(h.redISub(d)).redISub(s.redMul(l)),T=this.z.redMul(a);return this.curve.jpoint(d,_,T)};an.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};an.prototype.inspect=function(){return this.isInfinity()?"":""};an.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Jc=Lr.exports,bL=vt.exports,gy=py,xue=vi;function xf(t){gy.call(this,"mont",t),this.a=new Jc(t.a,16).toRed(this.red),this.b=new Jc(t.b,16).toRed(this.red),this.i4=new Jc(4).toRed(this.red).redInvm(),this.two=new Jc(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}bL(xf,gy);var Sue=xf;xf.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),s=i.redSqrt();return s.redSqr().cmp(i)===0};function Hr(t,e,r){gy.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Jc(e,16),this.z=new Jc(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}bL(Hr,gy.BasePoint);xf.prototype.decodePoint=function(e,r){return this.point(xue.toArray(e,r),1)};xf.prototype.point=function(e,r){return new Hr(this,e,r)};xf.prototype.pointFromJSON=function(e){return Hr.fromJSON(this,e)};Hr.prototype.precompute=function(){};Hr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Hr.fromJSON=function(e,r){return new Hr(e,r[0],r[1]||e.one)};Hr.prototype.inspect=function(){return this.isInfinity()?"":""};Hr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Hr.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=r.redSub(i),o=r.redMul(i),a=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(o,a)};Hr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Hr.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),o=e.x.redSub(e.z),a=o.redMul(n),u=s.redMul(i),c=r.z.redMul(a.redAdd(u).redSqr()),l=r.x.redMul(a.redISub(u).redSqr());return this.curve.point(c,l)};Hr.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),s=this,o=[];r.cmpn(0)!==0;r.iushrn(1))o.push(r.andln(1));for(var a=o.length-1;a>=0;a--)o[a]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i};Hr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Hr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Hr.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};Hr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Hr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Iue=vi,_o=Lr.exports,wL=vt.exports,my=py,Tue=Iue.assert;function eo(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,my.call(this,"edwards",t),this.a=new _o(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new _o(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new _o(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Tue(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}wL(eo,my);var Aue=eo;eo.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};eo.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};eo.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};eo.prototype.pointFromX=function(e,r){e=new _o(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var u=a.fromRed().isOdd();return(r&&!u||!r&&u)&&(a=a.redNeg()),this.point(e,a)};eo.prototype.pointFromY=function(e,r){e=new _o(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(o.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)};eo.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(s)===0};function ir(t,e,r,n,i){my.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new _o(e,16),this.y=new _o(r,16),this.z=n?new _o(n,16):this.curve.one,this.t=i&&new _o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}wL(ir,my.BasePoint);eo.prototype.pointFromJSON=function(e){return ir.fromJSON(this,e)};eo.prototype.point=function(e,r,n,i){return new ir(this,e,r,n,i)};ir.fromJSON=function(e,r){return new ir(e,r[0],r[1],r[2])};ir.prototype.inspect=function(){return this.isInfinity()?"":""};ir.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};ir.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),o=i.redAdd(r),a=o.redSub(n),u=i.redSub(r),c=s.redMul(a),l=o.redMul(u),h=s.redMul(u),d=a.redMul(o);return this.curve.point(c,l,d,h)};ir.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,s,o,a,u,c;if(this.curve.twisted){a=this.curve._mulA(r);var l=a.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(l.redSub(this.curve.two)),s=l.redMul(a.redSub(n)),o=l.redSqr().redSub(l).redSub(l)):(u=this.z.redSqr(),c=l.redSub(u).redISub(u),i=e.redSub(r).redISub(n).redMul(c),s=l.redMul(a.redSub(n)),o=l.redMul(c))}else a=r.redAdd(n),u=this.curve._mulC(this.z).redSqr(),c=a.redSub(u).redSub(u),i=this.curve._mulC(e.redISub(a)).redMul(c),s=this.curve._mulC(a).redMul(r.redISub(n)),o=a.redMul(c);return this.curve.point(i,s,o)};ir.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};ir.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(r),a=s.redSub(i),u=s.redAdd(i),c=n.redAdd(r),l=o.redMul(a),h=u.redMul(c),d=o.redMul(c),_=a.redMul(u);return this.curve.point(l,h,_,d)};ir.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(i).redMul(s),a=n.redSub(o),u=n.redAdd(o),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),l=r.redMul(a).redMul(c),h,d;return this.curve.twisted?(h=r.redMul(u).redMul(s.redSub(this.curve._mulA(i))),d=a.redMul(u)):(h=r.redMul(u).redMul(s.redSub(i)),d=this.curve._mulC(a).redMul(u)),this.curve.point(l,h,d)};ir.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};ir.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};ir.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};ir.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};ir.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};ir.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};ir.prototype.getX=function(){return this.normalize(),this.x.fromRed()};ir.prototype.getY=function(){return this.normalize(),this.y.fromRed()};ir.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};ir.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};ir.prototype.toP=ir.prototype.normalize;ir.prototype.mixedAdd=ir.prototype.add;(function(t){var e=t;e.base=py,e.short=Eue,e.mont=Sue,e.edwards=Aue})(kS);var vy={},yy={},Et={},kue=qi,Mue=vt.exports;Et.inherits=Mue;function Cue(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function Rue(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):Cue(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Et.htonl=EL;function Oue(t,e){for(var r="",n=0;n>>0}return s}Et.join32=Due;function Pue(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}Et.split32=Pue;function Lue(t,e){return t>>>e|t<<32-e}Et.rotr32=Lue;function Bue(t,e){return t<>>32-e}Et.rotl32=Bue;function $ue(t,e){return t+e>>>0}Et.sum32=$ue;function Fue(t,e,r){return t+e+r>>>0}Et.sum32_3=Fue;function Uue(t,e,r,n){return t+e+r+n>>>0}Et.sum32_4=Uue;function que(t,e,r,n,i){return t+e+r+n+i>>>0}Et.sum32_5=que;function jue(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Et.sum64=jue;function Vue(t,e,r,n){var i=e+n>>>0,s=(i>>0}Et.sum64_hi=Vue;function zue(t,e,r,n){var i=e+n;return i>>>0}Et.sum64_lo=zue;function Hue(t,e,r,n,i,s,o,a){var u=0,c=e;c=c+n>>>0,u+=c>>0,u+=c>>0,u+=c>>0}Et.sum64_4_hi=Hue;function Kue(t,e,r,n,i,s,o,a){var u=e+n+s+a;return u>>>0}Et.sum64_4_lo=Kue;function Gue(t,e,r,n,i,s,o,a,u,c){var l=0,h=e;h=h+n>>>0,l+=h>>0,l+=h>>0,l+=h>>0,l+=h>>0}Et.sum64_5_hi=Gue;function Wue(t,e,r,n,i,s,o,a,u,c){var l=e+n+s+a+c;return l>>>0}Et.sum64_5_lo=Wue;function Xue(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Et.rotr64_hi=Xue;function Yue(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Et.rotr64_lo=Yue;function Jue(t,e,r){return t>>>r}Et.shr64_hi=Jue;function Que(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Et.shr64_lo=Que;var Sf={},pM=Et,Zue=qi;function _y(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Sf.BlockHash=_y;_y.prototype.update=function(e,r){if(e=pM.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=pM.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}to.g0_256=ice;function sce(t){return $s(t,17)^$s(t,19)^t>>>10}to.g1_256=sce;var Wl=Et,oce=Sf,ace=to,vb=Wl.rotl32,rh=Wl.sum32,uce=Wl.sum32_5,cce=ace.ft_1,kL=oce.BlockHash,lce=[1518500249,1859775393,2400959708,3395469782];function Xs(){if(!(this instanceof Xs))return new Xs;kL.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Wl.inherits(Xs,kL);var fce=Xs;Xs.blockSize=512;Xs.outSize=160;Xs.hmacStrength=80;Xs.padLength=64;Xs.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),Qce(e.length<=this.blockSize);for(var r=e.length;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var tle=za;za.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};za.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Ku.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var em=Lr.exports,CS=vi,sle=CS.assert;function by(t,e){if(t instanceof by)return t;this._importDER(t,e)||(sle(t.r&&t.s,"Signature without r or s"),this.r=new em(t.r,16),this.s=new em(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var ole=by;function ale(){this.place=0}function bb(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function yM(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}by.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=yM(r),n=yM(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];wb(i,r.length),i=i.concat(r),i.push(2),wb(i,n.length);var s=i.concat(n),o=[48];return wb(o,s.length),o=o.concat(s),CS.encode(o,e)};var Gu=Lr.exports,UL=tle,ule=vi,Eb=vy,cle=Np.exports,qL=ule.assert,RS=ile,wy=ole;function Li(t){if(!(this instanceof Li))return new Li(t);typeof t=="string"&&(qL(Object.prototype.hasOwnProperty.call(Eb,t),"Unknown curve "+t),t=Eb[t]),t instanceof Eb.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var lle=Li;Li.prototype.keyPair=function(e){return new RS(this,e)};Li.prototype.keyFromPrivate=function(e,r){return RS.fromPrivate(this,e,r)};Li.prototype.keyFromPublic=function(e,r){return RS.fromPublic(this,e,r)};Li.prototype.genKeyPair=function(e){e||(e={});for(var r=new UL({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||cle(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Gu(2));;){var s=new Gu(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Li.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Li.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new Gu(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),u=new UL({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new Gu(1)),l=0;;l++){var h=i.k?i.k(l):new Gu(u.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(c)>=0)){var d=this.g.mul(h);if(!d.isInfinity()){var _=d.getX(),T=_.umod(this.n);if(T.cmpn(0)!==0){var D=h.invm(this.n).mul(T.mul(r.getPrivate()).iadd(e));if(D=D.umod(this.n),D.cmpn(0)!==0){var N=(d.getY().isOdd()?1:0)|(_.cmp(T)!==0?2:0);return i.canonical&&D.cmp(this.nh)>0&&(D=this.n.sub(D),N^=1),new wy({r:T,s:D,recoveryParam:N})}}}}}};Li.prototype.verify=function(e,r,n,i){e=this._truncateToN(new Gu(e,16)),n=this.keyFromPublic(n,i),r=new wy(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),u=a.mul(e).umod(this.n),c=a.mul(s).umod(this.n),l;return this.curve._maxwellTrick?(l=this.g.jmulAdd(u,n.getPublic(),c),l.isInfinity()?!1:l.eqXToP(s)):(l=this.g.mulAdd(u,n.getPublic(),c),l.isInfinity()?!1:l.getX().umod(this.n).cmp(s)===0)};Li.prototype.recoverPubKey=function(t,e,r,n){qL((3&r)===r,"The recovery param is more than two bits"),e=new wy(e,n);var i=this.n,s=new Gu(t),o=e.r,a=e.s,u=r&1,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?o=this.curve.pointFromX(o.add(this.curve.n),u):o=this.curve.pointFromX(o,u);var l=e.r.invm(i),h=i.sub(s).mul(l).umod(i),d=a.mul(l).umod(i);return this.g.mulAdd(h,o,d)};Li.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new wy(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Dp=vi,jL=Dp.assert,_M=Dp.parseBytes,Af=Dp.cachedProperty;function jr(t,e){this.eddsa=t,this._secret=_M(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=_M(e.pub)}jr.fromPublic=function(e,r){return r instanceof jr?r:new jr(e,{pub:r})};jr.fromSecret=function(e,r){return r instanceof jr?r:new jr(e,{secret:r})};jr.prototype.secret=function(){return this._secret};Af(jr,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Af(jr,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Af(jr,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});Af(jr,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Af(jr,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Af(jr,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});jr.prototype.sign=function(e){return jL(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};jr.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};jr.prototype.getSecret=function(e){return jL(this._secret,"KeyPair is public only"),Dp.encode(this.secret(),e)};jr.prototype.getPublic=function(e){return Dp.encode(this.pubBytes(),e)};var fle=jr,hle=Lr.exports,Ey=vi,dle=Ey.assert,xy=Ey.cachedProperty,ple=Ey.parseBytes;function Rc(t,e){this.eddsa=t,typeof e!="object"&&(e=ple(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),dle(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof hle&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}xy(Rc,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});xy(Rc,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});xy(Rc,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});xy(Rc,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Rc.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Rc.prototype.toHex=function(){return Ey.encode(this.toBytes(),"hex").toUpperCase()};var gle=Rc,mle=yy,vle=vy,Jl=vi,yle=Jl.assert,VL=Jl.parseBytes,zL=fle,bM=gle;function Zn(t){if(yle(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Zn))return new Zn(t);t=vle[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=mle.sha512}var _le=Zn;Zn.prototype.sign=function(e,r){e=VL(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),o=this.encodePoint(s),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),u=i.add(a).umod(this.curve.n);return this.makeSignature({R:s,S:u,Rencoded:o})};Zn.prototype.verify=function(e,r,n){e=VL(e),r=this.makeSignature(r);var i=this.keyFromPublic(n),s=this.hashInt(r.Rencoded(),i.pubBytes(),e),o=this.g.mul(r.S()),a=r.R().add(i.pub().mul(s));return a.eq(o)};Zn.prototype.hashInt=function(){for(var e=this.hash(),r=0;r=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=Sl(t);return!e||e.length===0?n.fill(0):typeof r=="string"?n.fill(e,r):n.fill(e),n});if(!Ai.kStringMaxLength)try{Ai.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}Ai.constants||(Ai.constants={MAX_LENGTH:Ai.kMaxLength},Ai.kStringMaxLength&&(Ai.constants.MAX_STRING_LENGTH=Ai.kStringMaxLength));var DS=Ai,Sy={};const ble=vt.exports;function Hi(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}Sy.Reporter=Hi;Hi.prototype.isError=function(e){return e instanceof Ql};Hi.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Hi.prototype.restore=function(e){const r=this._reporterState;r.obj=e.obj,r.path=r.path.slice(0,e.pathLen)};Hi.prototype.enterKey=function(e){return this._reporterState.path.push(e)};Hi.prototype.exitKey=function(e){const r=this._reporterState;r.path=r.path.slice(0,e-1)};Hi.prototype.leaveKey=function(e,r,n){const i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[r]=n)};Hi.prototype.path=function(){return this._reporterState.path.join("/")};Hi.prototype.enterObject=function(){const e=this._reporterState,r=e.obj;return e.obj={},r};Hi.prototype.leaveObject=function(e){const r=this._reporterState,n=r.obj;return r.obj=e,n};Hi.prototype.error=function(e){let r;const n=this._reporterState,i=e instanceof Ql;if(i?r=e:r=new Ql(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw r;return i||n.errors.push(r),r};Hi.prototype.wrapResult=function(e){const r=this._reporterState;return r.options.partial?{result:this.isError(e)?null:e,errors:r.errors}:e};function Ql(t,e){this.path=t,this.rethrow(e)}ble(Ql,Error);Ql.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Ql),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this};var mc={};const wle=vt.exports,Iy=Sy.Reporter,Zl=DS.Buffer;function Bi(t,e){if(Iy.call(this,e),!Zl.isBuffer(t)){this.error("Input not Buffer");return}this.base=t,this.offset=0,this.length=t.length}wle(Bi,Iy);mc.DecoderBuffer=Bi;Bi.isDecoderBuffer=function(e){return e instanceof Bi?!0:typeof e=="object"&&Zl.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};Bi.prototype.save=function(){return{offset:this.offset,reporter:Iy.prototype.save.call(this)}};Bi.prototype.restore=function(e){const r=new Bi(this.base);return r.offset=e.offset,r.length=this.offset,this.offset=e.offset,Iy.prototype.restore.call(this,e.reporter),r};Bi.prototype.isEmpty=function(){return this.offset===this.length};Bi.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};Bi.prototype.skip=function(e,r){if(!(this.offset+e<=this.length))return this.error(r||"DecoderBuffer overrun");const n=new Bi(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};Bi.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function ef(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(r){return ef.isEncoderBuffer(r)||(r=new ef(r,e)),this.length+=r.length,r},this);else if(typeof t=="number"){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if(typeof t=="string")this.value=t,this.length=Zl.byteLength(t);else if(Zl.isBuffer(t))this.value=t,this.length=t.length;else return e.error("Unsupported type: "+typeof t)}mc.EncoderBuffer=ef;ef.isEncoderBuffer=function(e){return e instanceof ef?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};ef.prototype.join=function(e,r){return e||(e=Zl.alloc(this.length)),r||(r=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,r),r+=n.length}):(typeof this.value=="number"?e[r]=this.value:typeof this.value=="string"?e.write(this.value,r):Zl.isBuffer(this.value)&&this.value.copy(e,r),r+=this.length)),e};const Ele=Sy.Reporter,xle=mc.EncoderBuffer,Sle=mc.DecoderBuffer,Ln=qi,KL=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],Ile=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(KL),Tle=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function tr(t,e,r){const n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}var PS=tr;const Ale=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];tr.prototype.clone=function(){const e=this._baseState,r={};Ale.forEach(function(i){r[i]=e[i]});const n=new this.constructor(r.parent);return n._baseState=r,n};tr.prototype._wrap=function(){const e=this._baseState;Ile.forEach(function(r){this[r]=function(){const i=new this.constructor(this);return e.children.push(i),i[r].apply(i,arguments)}},this)};tr.prototype._init=function(e){const r=this._baseState;Ln(r.parent===null),e.call(this),r.children=r.children.filter(function(n){return n._baseState.parent===this},this),Ln.equal(r.children.length,1,"Root node can have only one child")};tr.prototype._useArgs=function(e){const r=this._baseState,n=e.filter(function(i){return i instanceof this.constructor},this);e=e.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(Ln(r.children===null),r.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(Ln(r.args===null),r.args=e,r.reverseArgs=e.map(function(i){if(typeof i!="object"||i.constructor!==Object)return i;const s={};return Object.keys(i).forEach(function(o){o==(o|0)&&(o|=0);const a=i[o];s[a]=o}),s}))};Tle.forEach(function(t){tr.prototype[t]=function(){const r=this._baseState;throw new Error(t+" not implemented for encoding: "+r.enc)}});KL.forEach(function(t){tr.prototype[t]=function(){const r=this._baseState,n=Array.prototype.slice.call(arguments);return Ln(r.tag===null),r.tag=t,this._useArgs(n),this}});tr.prototype.use=function(e){Ln(e);const r=this._baseState;return Ln(r.use===null),r.use=e,this};tr.prototype.optional=function(){const e=this._baseState;return e.optional=!0,this};tr.prototype.def=function(e){const r=this._baseState;return Ln(r.default===null),r.default=e,r.optional=!0,this};tr.prototype.explicit=function(e){const r=this._baseState;return Ln(r.explicit===null&&r.implicit===null),r.explicit=e,this};tr.prototype.implicit=function(e){const r=this._baseState;return Ln(r.explicit===null&&r.implicit===null),r.implicit=e,this};tr.prototype.obj=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return e.obj=!0,r.length!==0&&this._useArgs(r),this};tr.prototype.key=function(e){const r=this._baseState;return Ln(r.key===null),r.key=e,this};tr.prototype.any=function(){const e=this._baseState;return e.any=!0,this};tr.prototype.choice=function(e){const r=this._baseState;return Ln(r.choice===null),r.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};tr.prototype.contains=function(e){const r=this._baseState;return Ln(r.use===null),r.contains=e,this};tr.prototype._decode=function(e,r){const n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,r));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let u=null;if(n.explicit!==null?u=n.explicit:n.implicit!==null?u=n.implicit:n.tag!==null&&(u=n.tag),u===null&&!n.any){const c=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,r):this._decodeChoice(e,r),s=!0}catch{s=!1}e.restore(c)}else if(s=this._peekTag(e,u,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){const c=this._decodeTag(e,n.explicit);if(e.isError(c))return c;e=c}const u=e.offset;if(n.use===null&&n.choice===null){let c;n.any&&(c=e.save());const l=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(l))return l;n.any?i=e.raw(c):e=l}if(r&&r.track&&n.tag!==null&&r.track(e.path(),u,e.length,"tagged"),r&&r.track&&n.tag!==null&&r.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,r):i=this._decodeChoice(e,r)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(l){l._decode(e,r)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){const c=new Sle(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(c,r)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};tr.prototype._decodeGeneric=function(e,r,n){const i=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(r,e,i.args[0],n):/str$/.test(e)?this._decodeStr(r,e,n):e==="objid"&&i.args?this._decodeObjid(r,i.args[0],i.args[1],n):e==="objid"?this._decodeObjid(r,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(r,e,n):e==="null_"?this._decodeNull(r,n):e==="bool"?this._decodeBool(r,n):e==="objDesc"?this._decodeStr(r,e,n):e==="int"||e==="enum"?this._decodeInt(r,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,r._reporterState.obj)._decode(r,n):r.error("unknown tag: "+e)};tr.prototype._getUse=function(e,r){const n=this._baseState;return n.useDecoder=this._use(e,r),Ln(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};tr.prototype._decodeChoice=function(e,r){const n=this._baseState;let i=null,s=!1;return Object.keys(n.choice).some(function(o){const a=e.save(),u=n.choice[o];try{const c=u._decode(e,r);if(e.isError(c))return!1;i={type:o,value:c},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};tr.prototype._createEncoderBuffer=function(e){return new xle(e,this.reporter)};tr.prototype._encode=function(e,r,n){const i=this._baseState;if(i.default!==null&&i.default===e)return;const s=this._encodeValue(e,r,n);if(s!==void 0&&!this._skipDefault(s,r,n))return s};tr.prototype._encodeValue=function(e,r,n){const i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,r||new Ele);let s=null;if(this.reporter=r,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,r);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,r),a=!0;else if(i.children)o=i.children.map(function(u){if(u._baseState.tag==="null_")return u._encode(null,r,e);if(u._baseState.key===null)return r.error("Child should have a key");const c=r.enterKey(u._baseState.key);if(typeof e!="object")return r.error("Child expected, but input is not object");const l=u._encode(e[u._baseState.key],r,e);return r.leaveKey(c),l},this).filter(function(u){return u}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return r.error("Too many args for : "+i.tag);if(!Array.isArray(e))return r.error("seqof/setof, but data is not Array");const u=this.clone();u._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(c){const l=this._baseState;return this._getUse(l.args[0],e)._encode(c,r)},u))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,r):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){const u=i.implicit!==null?i.implicit:i.tag,c=i.implicit===null?"universal":"context";u===null?i.use===null&&r.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(u,a,c,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};tr.prototype._encodeChoice=function(e,r){const n=this._baseState,i=n.choice[e.type];return i||Ln(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,r)};tr.prototype._encodePrimitive=function(e,r){const n=this._baseState;if(/str$/.test(e))return this._encodeStr(r,e);if(e==="objid"&&n.args)return this._encodeObjid(r,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(r,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(r,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(r,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(r);if(e==="objDesc")return this._encodeStr(r,e);throw new Error("Unsupported tag: "+e)};tr.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};tr.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)};var Ty={};(function(t){function e(r){const n={};return Object.keys(r).forEach(function(i){(i|0)==i&&(i=i|0);const s=r[i];n[s]=i}),n}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=e(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=e(t.tag)})(Ty);const kle=vt.exports,ho=DS.Buffer,GL=PS,xb=Ty;function WL(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new ms,this.tree._init(t.body)}var XL=WL;WL.prototype.encode=function(e,r){return this.tree._encode(e,r).join()};function ms(t){GL.call(this,"der",t)}kle(ms,GL);ms.prototype._encodeComposite=function(e,r,n,i){const s=Mle(e,r,n,this.reporter);if(i.length<128){const u=ho.alloc(2);return u[0]=s,u[1]=i.length,this._createEncoderBuffer([u,i])}let o=1;for(let u=i.length;u>=256;u>>=8)o++;const a=ho.alloc(1+1+o);a[0]=s,a[1]=128|o;for(let u=1+o,c=i.length;c>0;u--,c>>=8)a[u]=c&255;return this._createEncoderBuffer([a,i])};ms.prototype._encodeStr=function(e,r){if(r==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(r==="bmpstr"){const n=ho.alloc(e.length*2);for(let i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let i=0;for(let a=0;a=128;u>>=7)i++}const s=ho.alloc(i);let o=s.length-1;for(let a=e.length-1;a>=0;a--){let u=e[a];for(s[o--]=u&127;(u>>=7)>0;)s[o--]=128|u&127}return this._createEncoderBuffer(s)};function xi(t){return t<10?"0"+t:t}ms.prototype._encodeTime=function(e,r){let n;const i=new Date(e);return r==="gentime"?n=[xi(i.getUTCFullYear()),xi(i.getUTCMonth()+1),xi(i.getUTCDate()),xi(i.getUTCHours()),xi(i.getUTCMinutes()),xi(i.getUTCSeconds()),"Z"].join(""):r==="utctime"?n=[xi(i.getUTCFullYear()%100),xi(i.getUTCMonth()+1),xi(i.getUTCDate()),xi(i.getUTCHours()),xi(i.getUTCMinutes()),xi(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(n,"octstr")};ms.prototype._encodeNull=function(){return this._createEncoderBuffer("")};ms.prototype._encodeInt=function(e,r){if(typeof e=="string"){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if(typeof e!="number"&&!ho.isBuffer(e)){const s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=ho.from(s)}if(ho.isBuffer(e)){let s=e.length;e.length===0&&s++;const o=ho.alloc(s);return e.copy(o),e.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let s=e;s>=256;s>>=8)n++;const i=new Array(n);for(let s=i.length-1;s>=0;s--)i[s]=e&255,e>>=8;return i[0]&128&&i.unshift(0),this._createEncoderBuffer(ho.from(i))};ms.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};ms.prototype._use=function(e,r){return typeof e=="function"&&(e=e(r)),e._getEncoder("der").tree};ms.prototype._skipDefault=function(e,r,n){const i=this._baseState;let s;if(i.default===null)return!1;const o=e.join();if(i.defaultBuffer===void 0&&(i.defaultBuffer=this._encodeValue(i.default,r,n).join()),o.length!==i.defaultBuffer.length)return!1;for(s=0;s=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=xb.tagClassByName[r||"universal"]<<6,i)}const Cle=vt.exports,LS=XL;function BS(t){LS.call(this,t),this.enc="pem"}Cle(BS,LS);var Rle=BS;BS.prototype.encode=function(e,r){const i=LS.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+r.label+"-----"];for(let o=0;o>6],i=(r&32)===0;if((r&31)===31){let o=r;for(r=0;(o&128)===128;){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=o&127}}else r&=31;const s=EM.tag[r];return{cls:n,primitive:i,tag:r,tagStr:s}}function ZL(t,e,r){let n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;const i=n&127;if(i>4)return t.error("length octect is too long");n=0;for(let s=0;s0&&r.ishrn(n),r}function bfe(t,e){t=VS(t,e),t=t.mod(e);var r=mn.from(t.toArray());if(r.length=e)throw new Error("invalid sig")}var Afe=Sfe,ky=lt.Buffer,u8=Tp,My=Od.exports,c8=vt.exports,kfe=fy.exports,Mfe=Afe,Iu=AP;Object.keys(Iu).forEach(function(t){Iu[t].id=ky.from(Iu[t].id,"hex"),Iu[t.toLowerCase()]=Iu[t]});function Pp(t){My.Writable.call(this);var e=Iu[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=u8(e.hash),this._tag=e.id,this._signType=e.sign}c8(Pp,My.Writable);Pp.prototype._write=function(e,r,n){this._hash.update(e),n()};Pp.prototype.update=function(e,r){return typeof e=="string"&&(e=ky.from(e,r)),this._hash.update(e),this};Pp.prototype.sign=function(e,r){this.end();var n=this._hash.digest(),i=kfe(n,e,this._hashType,this._signType,this._tag);return r?i.toString(r):i};function Lp(t){My.Writable.call(this);var e=Iu[t];if(!e)throw new Error("Unknown message digest");this._hash=u8(e.hash),this._tag=e.id,this._signType=e.sign}c8(Lp,My.Writable);Lp.prototype._write=function(e,r,n){this._hash.update(e),n()};Lp.prototype.update=function(e,r){return typeof e=="string"&&(e=ky.from(e,r)),this._hash.update(e),this};Lp.prototype.verify=function(e,r,n){typeof r=="string"&&(r=ky.from(r,n)),this.end();var i=this._hash.digest();return Mfe(r,i,e,this._signType,this._tag)};function TM(t){return new Pp(t)}function AM(t){return new Lp(t)}var Cfe={Sign:TM,Verify:AM,createSign:TM,createVerify:AM},Rfe=dy,Nfe=Lr.exports,Ofe=function(e){return new Nc(e)},fi={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};fi.p224=fi.secp224r1;fi.p256=fi.secp256r1=fi.prime256v1;fi.p192=fi.secp192r1=fi.prime192v1;fi.p384=fi.secp384r1;fi.p521=fi.secp521r1;function Nc(t){this.curveType=fi[t],this.curveType||(this.curveType={name:t}),this.curve=new Rfe.ec(this.curveType.name),this.keys=void 0}Nc.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)};Nc.prototype.computeSecret=function(t,e,r){e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e));var n=this.curve.keyFromPublic(t).getPublic(),i=n.mul(this.keys.getPrivate()).getX();return zS(i,r,this.curveType.byteLength)};Nc.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic(e==="compressed",!0);return e==="hybrid"&&(r[r.length-1]%2?r[0]=7:r[0]=6),zS(r,t)};Nc.prototype.getPrivateKey=function(t){return zS(this.keys.getPrivate(),t)};Nc.prototype.setPublicKey=function(t,e){return e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e)),this.keys._importPublic(t),this};Nc.prototype.setPrivateKey=function(t,e){e=e||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,e));var r=new Nfe(t);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this};function zS(t,e,r){Array.isArray(t)||(t=t.toArray());var n=new Buffer(t);if(r&&n.length=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return n?qfe(o,s):Ufe(o,s)};function Vfe(t,e){var r=t.modulus.byteLength(),n=e.length,i=Ffe("sha1").update(is.alloc(0)).digest(),s=i.length,o=2*s;if(n>r-o-2)throw new Error("message too long");var a=is.alloc(r-n-o-2),u=r-s-1,c=fw(s),l=CM(is.concat([i,a,is.alloc(1,1),e],u),MM(c,u)),h=CM(c,MM(l,s));return new HS(is.concat([is.alloc(1),h,l],r))}function zfe(t,e,r){var n=e.length,i=t.modulus.byteLength();if(n>i-11)throw new Error("message too long");var s;return r?s=is.alloc(i-n-3,255):s=Hfe(i-n-3),new HS(is.concat([is.from([0,r?1:2]),s,is.alloc(1),e],i))}function Hfe(t){for(var e=is.allocUnsafe(t),r=0,n=fw(t*2),i=0,s;ro||new OM(r).cmp(s.modulus)>=0)throw new Error("decryption error");var a;n?a=Xfe(new OM(r),s):a=Gfe(r,s);var u=$d.alloc(o-a.length);if(a=$d.concat([u,a],o),i===4)return Jfe(s,a);if(i===1)return Qfe(s,a,n);if(i===3)return a;throw new Error("unknown padding")};function Jfe(t,e){var r=t.modulus.byteLength(),n=Wfe("sha1").update($d.alloc(0)).digest(),i=n.length;if(e[0]!==0)throw new Error("decryption error");var s=e.slice(1,i+1),o=e.slice(i+1),a=NM(s,RM(o,i)),u=NM(o,RM(a,r-i-1));if(Zfe(n,u.slice(0,i)))throw new Error("decryption error");for(var c=i;u[c]===0;)c++;if(u[c++]!==1)throw new Error("decryption error");return u.slice(c)}function Qfe(t,e,r){for(var n=e.slice(0,2),i=2,s=0;e[i++]!==0;)if(i>=e.length){s++;break}var o=e.slice(2,i-1);if((n.toString("hex")!=="0002"&&!r||n.toString("hex")!=="0001"&&r)&&s++,o.length<8&&s++,s)throw new Error("decryption error");return e.slice(i)}function Zfe(t,e){t=$d.from(t),e=$d.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));for(var i=-1;++iv8||t<0)throw new TypeError("offset must be a uint32");if(t>m8||t>e)throw new RangeError("offset out of range")}function _8(t,e,r){if(typeof t!="number"||t!==t)throw new TypeError("size must be a number");if(t>v8||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>m8)throw new RangeError("buffer too small")}hw&&hw.getRandomValues||!process.browser?(_h.randomFill=ehe,_h.randomFillSync=the):(_h.randomFill=DM,_h.randomFillSync=DM);function ehe(t,e,r,n){if(!g8.isBuffer(t)&&!(t instanceof ut.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof e=="function")n=e,e=0,r=t.length;else if(typeof r=="function")n=r,r=t.length-e;else if(typeof n!="function")throw new TypeError('"cb" argument must be a function');return y8(e,t.length),_8(r,e,t.length),b8(t,e,r,n)}function b8(t,e,r,n){if(process.browser){var i=t.buffer,s=new Uint8Array(i,e,r);if(hw.getRandomValues(s),n){process.nextTick(function(){n(null,t)});return}return t}if(n){PM(r,function(a,u){if(a)return n(a);u.copy(t,e),n(null,t)});return}var o=PM(r);return o.copy(t,e),t}function the(t,e,r){if(typeof e=="undefined"&&(e=0),!g8.isBuffer(t)&&!(t instanceof ut.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return y8(e,t.length),r===void 0&&(r=t.length-e),_8(r,e,t.length),b8(t,e,r)}ht.randomBytes=ht.rng=ht.pseudoRandomBytes=ht.prng=Va.exports;ht.createHash=ht.Hash=Tp;ht.createHmac=ht.Hmac=TP;var rhe=toe,nhe=Object.keys(rhe),ihe=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(nhe);ht.getHashes=function(){return ihe};var w8=iy;ht.pbkdf2=w8.pbkdf2;ht.pbkdf2Sync=w8.pbkdf2Sync;var ro=ls;ht.Cipher=ro.Cipher;ht.createCipher=ro.createCipher;ht.Cipheriv=ro.Cipheriv;ht.createCipheriv=ro.createCipheriv;ht.Decipher=ro.Decipher;ht.createDecipher=ro.createDecipher;ht.Decipheriv=ro.Decipheriv;ht.createDecipheriv=ro.createDecipheriv;ht.getCiphers=ro.getCiphers;ht.listCiphers=ro.listCiphers;var Bp=El;ht.DiffieHellmanGroup=Bp.DiffieHellmanGroup;ht.createDiffieHellmanGroup=Bp.createDiffieHellmanGroup;ht.getDiffieHellman=Bp.getDiffieHellman;ht.createDiffieHellman=Bp.createDiffieHellman;ht.DiffieHellman=Bp.DiffieHellman;var Cy=Cfe;ht.createSign=Cy.createSign;ht.Sign=Cy.Sign;ht.createVerify=Cy.createVerify;ht.Verify=Cy.Verify;ht.createECDH=Ofe;var Ry=l8;ht.publicEncrypt=Ry.publicEncrypt;ht.privateEncrypt=Ry.privateEncrypt;ht.publicDecrypt=Ry.publicDecrypt;ht.privateDecrypt=Ry.privateDecrypt;var E8=_h;ht.randomFill=E8.randomFill;ht.randomFillSync=E8.randomFillSync;ht.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` `))};ht.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6};var KS={},Ny={};Ny.__esModule=!0;function she(t){return typeof t=="object"?JSON.stringify(t):String(t)}Ny.stringify=she;var ohe=ut&&ut.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};KS.__esModule=!0;var ahe=ohe(ht),uhe=Ny;function che(t,e){e===void 0&&(e={});for(var r=uhe.stringify(t),n=e.algorithm||"sha256",i=e.rounds||1,s=""+r+(e.salt||""),o=0;oe-1||t.max<1||t.max>e)throw new Error("Limits must be between 0 and "+e);var r=GS.randomBytes(16).toString("hex"),n=parseInt(r,16),i=n/3402823669209385e23;return Math.floor(i*(t.max-t.min+1)+t.min)}$p.randomNumber=mhe;function vhe(t){if(t===void 0&&(t=64),t<2||t%2!==0)throw new TypeError("Length must be an even number above 0");return GS.randomBytes(t/2).toString("hex")}$p.randomKey=vhe;var yhe=ut&&ut.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},WS=ut&&ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e},_he=yhe(ht),bhe=WS(KS),LM=WS(Oy),ih=WS($p);function whe(t){console.log("crypto-extra: "+t)}var Ehe=Object.assign(_he.default,{hash:bhe.hash,encrypt:LM.encrypt,decrypt:LM.decrypt,randomString:ih.randomString,randomNumber:ih.randomNumber,randomKey:ih.randomKey,generateKey:function(){for(var t=[],e=0;e4))throw new TypeError("Word count must be between 1-4");c.separator=c.separator||"-",c.words=Number(c.words!==void 0?c.words:2),c.saltType=c.saltType||"mixed",c.saltLength=Number(c.saltLength!==void 0?c.saltLength:5);var l=c.subset?n.default[c.subset]:n.default,h=c.saltLength>0?a(c.saltType,c.saltLength):null,d=o(c.words).map(function(_){return s(l[_])}).concat([h]).filter(Boolean).join(c.separator);if(d.length>63)throw new TypeError("Subdomains cannot be longer than 63 characters! Try shortening your trailing salt.");return d}t.default=u})(R4);var T8={};(function(t){var e=ut&&ut.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};t.__esModule=!0;var r=e(aS);function n(i,s){s===void 0&&(s={});var o=/^[\w](?:[\w-]{0,63}[\w])?$/.test(i);return s.reserved?o&&r.default.reserved.indexOf(i)===-1:o}t.default=n})(T8);var XS=ut&&ut.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},xhe=XS(aS),She=XS(R4),BM=XS(T8),Xpe={generate:She.default,validate:BM.default,rawData:xhe.default,isValid:function(t,e){return console.log("namor: `isValid` has been renamed to `validate`"),BM.default(t,e)}};const Ihe={name:"HollowDotsSpinner",props:{animationDuration:{type:Number,default:1e3},dotSize:{type:Number,default:15},dotsNum:{type:Number,default:3},color:{type:String,default:"#fff"}},computed:{horizontalMargin(){return this.dotSize/2},spinnerStyle(){return{height:`${this.dotSize}px`,width:`${(this.dotSize+this.horizontalMargin*2)*this.dotsNum}px`}},dotStyle(){return{animationDuration:`${this.animationDuration}ms`,width:`${this.dotSize}px`,height:`${this.dotSize}px`,margin:`0 ${this.horizontalMargin}px`,borderWidth:`${this.dotSize/5}px`,borderColor:this.color}},dotsStyles(){const t=[];for(let n=1;n<=this.dotsNum;n++){const i=Object.assign({animationDelay:`${1e3*n*.3}ms`},this.dotStyle);t.push(i)}return t}}};function The(t,e,r,n,i,s){return Kt(),sr("div",{class:"hollow-dots-spinner",style:si(s.spinnerStyle)},[(Kt(!0),sr(Jt,null,es(s.dotsStyles,(o,a)=>(Kt(),sr("div",{class:"dot",style:si(o),key:a},null,4))),128))],4)}var Ype=Bv(Ihe,[["render",The],["__scopeId","data-v-223c0075"]]);const Ahe={name:"SelfBuildingSquareSpinner",props:{animationDuration:{type:Number,default:6e3},size:{type:Number,default:40},color:{type:String,default:"#fff"}},data(){return{squaresNum:9}},computed:{squareSize(){return this.size/4},initialTopPosition(){return-this.squareSize*2/3},spinnerStyle(){return{top:`${-this.initialTopPosition}px`,height:`${this.size}px`,width:`${this.size}px`}},squareStyle(){return{height:`${this.squareSize}px`,width:`${this.squareSize}px`,top:`${this.initialTopPosition}px`,marginRight:`${this.squareSize/3}px`,marginTop:`${this.squareSize/3}px`,animationDuration:`${this.animationDuration}ms`,background:this.color}},squaresStyles(){const t=[],e=[6,7,8,3,4,5,0,1,2],r=this.animationDuration*.05;for(let n=0;n(Kt(),sr("div",{class:as(["square",{clear:a&&a%3===0}]),key:a,style:si(o)},null,6))),128))],4)}var Jpe=Bv(Ahe,[["render",khe],["__scopeId","data-v-df0f7f9e"]]);const Mhe={name:"HalfCircleSpinner",props:{animationDuration:{type:Number,default:1e3},size:{type:Number,default:60},color:{type:String,default:"#fff"}},computed:{spinnerStyle(){return{height:`${this.size}px`,width:`${this.size}px`}},circleStyle(){return{borderWidth:`${this.size/10}px`,animationDuration:`${this.animationDuration}ms`}},circle1Style(){return Object.assign({borderTopColor:this.color},this.circleStyle)},circle2Style(){return Object.assign({borderBottomColor:this.color},this.circleStyle)}}};function Che(t,e,r,n,i,s){return Kt(),sr("div",{class:"half-circle-spinner",style:si(s.spinnerStyle)},[Ir("div",{class:"circle circle-1",style:si(s.circle1Style)},null,4),Ir("div",{class:"circle circle-2",style:si(s.circle2Style)},null,4)],4)}var Qpe=Bv(Mhe,[["render",Che],["__scopeId","data-v-1fcf55b4"]]);var A8={},Dy={},YS={},$M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");YS.encode=function(t){if(0<=t&&t<$M.length)return $M[t];throw new TypeError("Must be between 0 and 63: "+t)};YS.decode=function(t){var e=65,r=90,n=97,i=122,s=48,o=57,a=43,u=47,c=26,l=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+c:s<=t&&t<=o?t-s+l:t==a?62:t==u?63:-1};var k8=YS,JS=5,M8=1<>1;return e?-r:r}Dy.encode=function(e){var r="",n,i=Rhe(e);do n=i&C8,i>>>=JS,i>0&&(n|=R8),r+=k8.encode(n);while(i>0);return r};Dy.decode=function(e,r,n){var i=e.length,s=0,o=0,a,u;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(u=k8.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(u&R8),u&=C8,s=s+(u<=0;F--)ue=ne[F],ue==="."?ne.splice(F,1):ue===".."?_e++:_e>0&&(ue===""?(ne.splice(F+1,_e),_e=0):(ne.splice(F,2),_e--));return z=ne.join("/"),z===""&&(z=G?"/":"."),ee?(ee.path=z,s(ee)):z}t.normalize=o;function a(q,z){q===""&&(q="."),z===""&&(z=".");var ee=i(z),G=i(q);if(G&&(q=G.path||"/"),ee&&!ee.scheme)return G&&(ee.scheme=G.scheme),s(ee);if(ee||z.match(n))return z;if(G&&!G.host&&!G.path)return G.host=z,s(G);var ne=z.charAt(0)==="/"?z:o(q.replace(/\/+$/,"")+"/"+z);return G?(G.path=ne,s(G)):ne}t.join=a,t.isAbsolute=function(q){return q.charAt(0)==="/"||r.test(q)};function u(q,z){q===""&&(q="."),q=q.replace(/\/$/,"");for(var ee=0;z.indexOf(q+"/")!==0;){var G=q.lastIndexOf("/");if(G<0||(q=q.slice(0,G),q.match(/^([^\/]+:\/)?\/*$/)))return z;++ee}return Array(ee+1).join("../")+z.substr(q.length+1)}t.relative=u;var c=function(){var q=Object.create(null);return!("__proto__"in q)}();function l(q){return q}function h(q){return _(q)?"$"+q:q}t.toSetString=c?l:h;function d(q){return _(q)?q.slice(1):q}t.fromSetString=c?l:d;function _(q){if(!q)return!1;var z=q.length;if(z<9||q.charCodeAt(z-1)!==95||q.charCodeAt(z-2)!==95||q.charCodeAt(z-3)!==111||q.charCodeAt(z-4)!==116||q.charCodeAt(z-5)!==111||q.charCodeAt(z-6)!==114||q.charCodeAt(z-7)!==112||q.charCodeAt(z-8)!==95||q.charCodeAt(z-9)!==95)return!1;for(var ee=z-10;ee>=0;ee--)if(q.charCodeAt(ee)!==36)return!1;return!0}function T(q,z,ee){var G=N(q.source,z.source);return G!==0||(G=q.originalLine-z.originalLine,G!==0)||(G=q.originalColumn-z.originalColumn,G!==0||ee)||(G=q.generatedColumn-z.generatedColumn,G!==0)||(G=q.generatedLine-z.generatedLine,G!==0)?G:N(q.name,z.name)}t.compareByOriginalPositions=T;function D(q,z,ee){var G=q.generatedLine-z.generatedLine;return G!==0||(G=q.generatedColumn-z.generatedColumn,G!==0||ee)||(G=N(q.source,z.source),G!==0)||(G=q.originalLine-z.originalLine,G!==0)||(G=q.originalColumn-z.originalColumn,G!==0)?G:N(q.name,z.name)}t.compareByGeneratedPositionsDeflated=D;function N(q,z){return q===z?0:q===null?1:z===null?-1:q>z?1:-1}function O(q,z){var ee=q.generatedLine-z.generatedLine;return ee!==0||(ee=q.generatedColumn-z.generatedColumn,ee!==0)||(ee=N(q.source,z.source),ee!==0)||(ee=q.originalLine-z.originalLine,ee!==0)||(ee=q.originalColumn-z.originalColumn,ee!==0)?ee:N(q.name,z.name)}t.compareByGeneratedPositionsInflated=O;function L(q){return JSON.parse(q.replace(/^\)]}'[^\n]*\n/,""))}t.parseSourceMapInput=L;function J(q,z,ee){if(z=z||"",q&&(q[q.length-1]!=="/"&&z[0]!=="/"&&(q+="/"),z=q+z),ee){var G=i(ee);if(!G)throw new Error("sourceMapURL could not be parsed");if(G.path){var ne=G.path.lastIndexOf("/");ne>=0&&(G.path=G.path.substring(0,ne+1))}z=a(s(G),z)}return o(z)}t.computeSourceURL=J})(kf);var QS={},ZS=kf,eI=Object.prototype.hasOwnProperty,Wu=typeof Map!="undefined";function Uo(){this._array=[],this._set=Wu?new Map:Object.create(null)}Uo.fromArray=function(e,r){for(var n=new Uo,i=0,s=e.length;i=0)return r}else{var n=ZS.toSetString(e);if(eI.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};Uo.prototype.at=function(e){if(e>=0&&er||n==r&&s>=i||O8.compareByGeneratedPositionsInflated(t,e)<=0}function Py(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Py.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};Py.prototype.add=function(e){Ohe(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};Py.prototype.toArray=function(){return this._sorted||(this._array.sort(O8.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};N8.MappingList=Py;var sh=Dy,Ar=kf,rm=QS.ArraySet,Dhe=N8.MappingList;function $i(t){t||(t={}),this._file=Ar.getArg(t,"file",null),this._sourceRoot=Ar.getArg(t,"sourceRoot",null),this._skipValidation=Ar.getArg(t,"skipValidation",!1),this._sources=new rm,this._names=new rm,this._mappings=new Dhe,this._sourcesContents=null}$i.prototype._version=3;$i.fromSourceMap=function(e){var r=e.sourceRoot,n=new $i({file:e.file,sourceRoot:r});return e.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,r!=null&&(s.source=Ar.relative(r,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),n.addMapping(s)}),e.sources.forEach(function(i){var s=i;r!==null&&(s=Ar.relative(r,i)),n._sources.has(s)||n._sources.add(s);var o=e.sourceContentFor(i);o!=null&&n.setSourceContent(i,o)}),n};$i.prototype.addMapping=function(e){var r=Ar.getArg(e,"generated"),n=Ar.getArg(e,"original",null),i=Ar.getArg(e,"source",null),s=Ar.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,i,s),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s})};$i.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=Ar.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Ar.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Ar.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};$i.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var s=this._sourceRoot;s!=null&&(i=Ar.relative(s,i));var o=new rm,a=new rm;this._mappings.unsortedForEach(function(u){if(u.source===i&&u.originalLine!=null){var c=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});c.source!=null&&(u.source=c.source,n!=null&&(u.source=Ar.join(n,u.source)),s!=null&&(u.source=Ar.relative(s,u.source)),u.originalLine=c.line,u.originalColumn=c.column,c.name!=null&&(u.name=c.name))}var l=u.source;l!=null&&!o.has(l)&&o.add(l);var h=u.name;h!=null&&!a.has(h)&&a.add(h)},this),this._sources=o,this._names=a,e.sources.forEach(function(u){var c=e.sourceContentFor(u);c!=null&&(n!=null&&(u=Ar.join(n,u)),s!=null&&(u=Ar.relative(s,u)),this.setSourceContent(u,c))},this)};$i.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i}))}};$i.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,s=0,o=0,a="",u,c,l,h,d=this._mappings.toArray(),_=0,T=d.length;_0){if(!Ar.compareByGeneratedPositionsInflated(c,d[_-1]))continue;u+=","}u+=sh.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(h=this._sources.indexOf(c.source),u+=sh.encode(h-o),o=h,u+=sh.encode(c.originalLine-1-i),i=c.originalLine-1,u+=sh.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(l=this._names.indexOf(c.name),u+=sh.encode(l-s),s=l)),a+=u}return a};$i.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Ar.relative(r,n));var i=Ar.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};$i.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};$i.prototype.toString=function(){return JSON.stringify(this.toJSON())};A8.SourceMapGenerator=$i;var Ly={},D8={};(function(t){t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2;function e(r,n,i,s,o,a){var u=Math.floor((n-r)/2)+r,c=o(i,s[u],!0);return c===0?u:c>0?n-u>1?e(u,n,i,s,o,a):a==t.LEAST_UPPER_BOUND?n1?e(r,u,i,s,o,a):a==t.LEAST_UPPER_BOUND?u:r<0?-1:r}t.search=function(n,i,s,o){if(i.length===0)return-1;var a=e(-1,i.length,n,i,s,o||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&s(i[a],i[a-1],!0)===0;)--a;return a}})(D8);var P8={};function Ib(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Phe(t,e){return Math.round(t+Math.random()*(e-t))}function dw(t,e,r,n){if(r=0){var o=this._originalMappings[s];if(e.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)i.push({line:Ve.getArg(o,"generatedLine",null),column:Ve.getArg(o,"generatedColumn",null),lastColumn:Ve.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var u=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==u;)i.push({line:Ve.getArg(o,"generatedLine",null),column:Ve.getArg(o,"generatedColumn",null),lastColumn:Ve.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return i};Ly.SourceMapConsumer=ar;function sn(t,e){var r=t;typeof t=="string"&&(r=Ve.parseSourceMapInput(t));var n=Ve.getArg(r,"version"),i=Ve.getArg(r,"sources"),s=Ve.getArg(r,"names",[]),o=Ve.getArg(r,"sourceRoot",null),a=Ve.getArg(r,"sourcesContent",null),u=Ve.getArg(r,"mappings"),c=Ve.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=Ve.normalize(o)),i=i.map(String).map(Ve.normalize).map(function(l){return o&&Ve.isAbsolute(o)&&Ve.isAbsolute(l)?Ve.relative(o,l):l}),this._names=tf.fromArray(s.map(String),!0),this._sources=tf.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(l){return Ve.computeSourceURL(o,l,e)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=u,this._sourceMapURL=e,this.file=c}sn.prototype=Object.create(ar.prototype);sn.prototype.consumer=ar;sn.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Ve.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(D.source=a+O[1],a+=O[1],D.originalLine=s+O[2],s=D.originalLine,D.originalLine+=1,D.originalColumn=o+O[3],o=D.originalColumn,O.length>4&&(D.name=u+O[4],u+=O[4])),T.push(D),typeof D.originalLine=="number"&&_.push(D)}Fd(T,Ve.compareByGeneratedPositionsDeflated),this.__generatedMappings=T,Fd(_,Ve.compareByOriginalPositions),this.__originalMappings=_};sn.prototype._findMapping=function(e,r,n,i,s,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return tI.search(e,r,s,o)};sn.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var s=Ve.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=Ve.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=Ve.getArg(i,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:Ve.getArg(i,"originalLine",null),column:Ve.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};sn.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};sn.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=Ve.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=Ve.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};sn.prototype.generatedPositionFor=function(e){var r=Ve.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Ve.getArg(e,"line"),originalColumn:Ve.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ve.compareByOriginalPositions,Ve.getArg(e,"bias",ar.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:Ve.getArg(s,"generatedLine",null),column:Ve.getArg(s,"generatedColumn",null),lastColumn:Ve.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Ly.BasicSourceMapConsumer=sn;function _s(t,e){var r=t;typeof t=="string"&&(r=Ve.parseSourceMapInput(t));var n=Ve.getArg(r,"version"),i=Ve.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new tf,this._names=new tf;var s={line:-1,column:0};this._sections=i.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=Ve.getArg(o,"offset"),u=Ve.getArg(a,"line"),c=Ve.getArg(a,"column");if(u=0;r--)this.prepend(e[r]);else if(e[Mf]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Ri.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n0){for(r=[],n=0;nt,bo.serviceIds.set(t,e),e}const rge={ctrlCmd:!1,alt:!1};var FM;(function(t){t[t.Blur=1]="Blur",t[t.Gesture=2]="Gesture",t[t.Other=3]="Other"})(FM||(FM={}));var UM;(function(t){t[t.NONE=0]="NONE",t[t.FIRST=1]="FIRST",t[t.SECOND=2]="SECOND",t[t.LAST=3]="LAST"})(UM||(UM={}));const nge=B8("quickInputService");var rI={};Object.defineProperty(rI,"__esModule",{value:!0});function Gg(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Gg=function(e){return typeof e}:Gg=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gg(t)}var $8="https://js.stripe.com/v3",qhe=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,qM="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",jhe=function(){for(var e=document.querySelectorAll('script[src^="'.concat($8,'"]')),r=0;r element.");return i.appendChild(n),n},zhe=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"1.23.0",startTime:r})},wg=null,Hhe=function(e){return wg!==null||(wg=new Promise(function(r,n){if(typeof window=="undefined"){r(null);return}if(window.Stripe&&e&&console.warn(qM),window.Stripe){r(window.Stripe);return}try{var i=jhe();i&&e?console.warn(qM):i||(i=Vhe(e)),i.addEventListener("load",function(){window.Stripe?r(window.Stripe):n(new Error("Stripe.js not available"))}),i.addEventListener("error",function(){n(new Error("Failed to load Stripe.js"))})}catch(s){n(s);return}})),wg},Khe=function(e,r,n){if(e===null)return null;var i=e.apply(void 0,r);return zhe(i,n),i},Ghe=function(e){var r=`invalid load parameters; expected object of shape {advancedFraudSignals: boolean} but received `.concat(JSON.stringify(e),` `);if(e===null||Gg(e)!=="object")throw new Error(r);if(Object.keys(e).length===1&&typeof e.advancedFraudSignals=="boolean")return e;throw new Error(r)},F8,U8=!1,q8=function(){for(var e=arguments.length,r=new Array(e),n=0;n@backlight-dev"},publish_custom_scope:{group:kn.package_registry,label:"Publish to any scope"},publish_custom_registry:{group:kn.package_registry,label:"Publish to any registry"},publish_private:{group:kn.package_registry,label:"Publish private packages"},support_community:{group:kn.support,label:`Community support on Discord`},support_email:{group:kn.support,label:"Email support"},support_premiumemail:{group:kn.support,label:"Email support with SLA"}},j8={title:"Starter",legend:"Discover Backlight",price:{value:"Free",currency:"EUR",symbol:"\u20AC"},additionalFeatures:[{restriction:"Unlimited",...Rr.users,highlight:!0},{restriction:"Up to 2",...Rr.projects,highlight:!0},Rr.editor,Rr.share,Rr.git,Rr.pr,{...Rr.visual_regressions,restriction:"100"},Rr.publish_public,Rr.support_community],action:{label:"Get started",url:"/get-started",type:"outline"}},V8={title:"Pro",legend:"Take it to the next level",price:{value:"149",symbol:"$",currency:"USD"},inherits:j8,additionalFeatures:[{restriction:"Up to 5",...Rr.projects,highlight:!0},{...Rr.visual_regressions,restriction:"1000"},Rr.publish_custom_registry,Rr.publish_custom_scope,Rr.publish_private,Rr.support_email],action:{label:"Subscribe",url:"/signup/PRO",type:"primary"}},Whe={title:"Enterprise",legend:"Cover all your needs",price:{value:"499",symbol:"$",currency:"USD"},inherits:V8,additionalFeatures:[{restriction:"Unlimited",...Rr.projects,highlight:!0},{...Rr.visual_regressions,restriction:"\u221E"},Rr.support_premiumemail],action:{label:"Contact us",url:"mailto:hello@backlight.dev",type:"outline"}};var sge=Object.freeze(Object.defineProperty({__proto__:null,groups:kn,features:Rr,Free:j8,Pro:V8,Enterprise:Whe},Symbol.toStringTag,{value:"Module"}));const Xhe={props:["plans","features","groups","colSelectClass","colSelectIdx"],methods:{findFeature(t,e){const r=t.additionalFeatures.find(n=>n.label===e.label);return r?r.restriction||'':t.inherits?this.findFeature(t.inherits,e):""}}},nI=t=>(LC("data-v-4f6b53bb"),t=t(),BC(),t),Yhe={class:"w-full text-white relative"},Jhe=nI(()=>Ir("col",null,null,-1)),Qhe=nI(()=>Ir("th",{scope:"col",class:"text-3xl text-left"},[po(" All our "),Ir("span",{class:"text-primary"},"features")],-1)),Zhe={class:"inline-flex flex-col text-left"},ede={class:"text-xl"},tde={class:"font-normal"},rde={class:"border-gray-light border-t-1"},nde=["innerHTML"],ide=["innerHTML"],sde=["innerHTML"],ode={class:"border-gray-light border-t-1"},ade=nI(()=>Ir("td",null,null,-1));function ude(t,e,r,n,i,s){return Kt(),sr("table",Yhe,[Ir("colgroup",null,[Jhe,(Kt(!0),sr(Jt,null,es(r.plans.length,o=>(Kt(),sr("col",{class:as(`${o===r.colSelectIdx?r.colSelectClass:""}`)},null,2))),256))]),Ir("thead",null,[Ir("tr",null,[Qhe,(Kt(!0),sr(Jt,null,es(r.plans,(o,a)=>(Kt(),sr("th",{scope:"col",key:a,class:"p-4 align-text-top"},[Ir("span",Zhe,[Ir("span",ede,sa(o.title),1),Ir("span",tde,[o.price.symbol?(Kt(),sr(Jt,{key:0},[po(sa(o.price.symbol)+sa(o.price.value)+" / mo ",1)],64)):(Kt(),sr(Jt,{key:1},[po(sa(o.price.value),1)],64))]),o.action&&o.action.label?(Kt(),rd(Zg(o.action.url?"a":"span"),{key:0,class:"btn-primary",href:o.action.url},{default:Jh(()=>[po(sa(o.action.label),1)]),_:2},1032,["href"])):t0("",!0)])]))),128))])]),(Kt(!0),sr(Jt,null,es(Object.entries(r.groups),([,o],a)=>(Kt(),sr("tbody",{key:a},[Ir("tr",rde,[Ir("th",{class:as(`text-xl text-left pt-8 pb-6 ${a%3===0?"text-orange":a%3===1?"text-blue":"text-green"}`),innerHTML:o},null,10,nde),(Kt(!0),sr(Jt,null,es(r.plans,(u,c)=>(Kt(),sr("td",{key:c}))),128))]),(Kt(!0),sr(Jt,null,es(Object.entries(r.features).filter(([u,c])=>c.group===o),([u,c])=>(Kt(),sr("tr",{key:u},[Ir("th",{scope:"row",class:"text-left font-normal",innerHTML:c.label},null,8,ide),(Kt(!0),sr(Jt,null,es(r.plans,(l,h)=>(Kt(),sr("td",{align:"center",class:"p-4",key:h,innerHTML:s.findFeature(l,c)},null,8,sde))),128))]))),128))]))),128)),Ir("tfoot",null,[Ir("tr",ode,[ade,(Kt(!0),sr(Jt,null,es(r.plans,(o,a)=>(Kt(),sr("td",{scope:"col",key:a,class:"py-8 align-text-top text-center"},[o.action&&o.action.label?(Kt(),rd(Zg(o.action.url?"a":"span"),{key:0,class:"btn-primary",href:o.action.url},{default:Jh(()=>[po(sa(o.action.label),1)]),_:2},1032,["href"])):t0("",!0)]))),128))])])])}var oge=Bv(Xhe,[["render",ude],["__scopeId","data-v-4f6b53bb"]]),cde=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],n=0;nH.clientWidth:H.scrollHeight>H.clientHeight},M=function(H,K){var X=H,Z=K||p(H);for(X=H.parentElement;X;)I(X,"x")&&y(X,"x")&&(Z=F(Z,X.getBoundingClientRect(),"x")),I(X,"y")&&y(X,"y")&&(Z=F(Z,X.getBoundingClientRect(),"y")),X=X.parentElement;return Z},A=function(H,K){for(var X=H;X;){if(X[s]){var Z=function(){var se=X[s];if(K.some(function(ye){return ye===se}))return{v:se}}();if(ne(Z)==="object")return Z.v}X=X.parentElement}return null},v=function(H,K){for(var X=H;X;){if(X.matches(K))return X;X=X.parentElement}return null},S=function(H,K){return-1=H.children.length?H.appendChild(K):H.insertBefore(K,H.children[X])},k=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():window.document.selection&&window.document.selection.empty()},R=function(H){if(H){var K=window.getComputedStyle(H);if(K)return K.cursor}return null};function j(H){return!(H.bottom<=H.top||H.right<=H.left)}function Q(H){var K=H.element,X=H.draggables;return function(Z,se){var ye=Z,Ae=ye.removedIndex,Ie=ye.addedIndex,Ne=ye.droppedElement,de=null;if(Ae!==null&&(de=me(K,Ae),X.splice(Ae,1)),Ie!==null){var we=window.document.createElement("div");we.className="".concat(o),we.appendChild(de&&de.firstElementChild?de.firstElementChild:Ne),x(K,we,Ie),Ie>=X.length?X.push(we):X.splice(Ie,0,we)}se&&se(Z)}}var oe=Object.freeze({domDropHandler:Q,reactDropHandler:function(){return{handler:function(){return function(H,K){K&&K(H)}}}}}),fe={size:"offsetWidth",distanceToParent:"offsetLeft",translate:"transform",begin:"left",end:"right",dragPosition:"x",scrollSize:"scrollWidth",offsetSize:"offsetWidth",scrollValue:"scrollLeft",scale:"scaleX",setSize:"width",setters:{translate:function(H){return"translate3d(".concat(H,"px, 0, 0)")}}},ie={size:"offsetHeight",distanceToParent:"offsetTop",translate:"transform",begin:"top",end:"bottom",dragPosition:"y",scrollSize:"scrollHeight",offsetSize:"offsetHeight",scrollValue:"scrollTop",scale:"scaleY",setSize:"height",setters:{translate:function(H){return"translate3d(0,".concat(H,"px, 0)")}}};function $(H,K,X){H[d]=0;var Z=function(de){return{get:function(we,Re){return we[de[Re]||Re]},set:function(we,Re,Fe){we[de[Re]]=de.setters[Re]?de.setters[Re](Fe):Fe}}}(K==="horizontal"?fe:ie),se={translation:0};function ye(){Ae(H),function(de){var we=de.getBoundingClientRect();se.scaleX=de.offsetWidth?(we.right-we.left)/de.offsetWidth:1,se.scaleY=de.offsetHeight?(we.bottom-we.top)/de.offsetHeight:1}(H)}function Ae(de){se.rect=p(de);var we=M(de,se.rect);j(we)&&(se.lastVisibleRect=se.visibleRect),se.visibleRect=we}function Ie(de){var we=de;if(we.tagName){var Re=we.getBoundingClientRect();return K==="vertical"?Re.bottom-Re.top:Re.right-Re.left}return Z.get(de,"size")*Z.get(se,"scale")}function Ne(de){return Z.get(de,"dragPosition")}return window.addEventListener("resize",function(){Ae(H)}),setTimeout(function(){ye()},10),{getSize:Ie,getContainerRectangles:function(){return{rect:se.rect,visibleRect:se.visibleRect,lastVisibleRect:se.lastVisibleRect}},getBeginEndOfDOMRect:function(de){return{begin:Z.get(de,"begin"),end:Z.get(de,"end")}},getBeginEndOfContainer:function(){return{begin:Z.get(se.rect,"begin")+se.translation,end:Z.get(se.rect,"end")+se.translation}},getBeginEndOfContainerVisibleRect:function(){return{begin:Z.get(se.visibleRect,"begin")+se.translation,end:Z.get(se.visibleRect,"end")+se.translation}},getBeginEnd:function(de){var we=function(Re){return(Z.get(Re,"distanceToParent")+(Re[u]||0))*Z.get(se,"scale")}(de)+(Z.get(se.rect,"begin")+se.translation)-Z.get(H,"scrollValue");return{begin:we,end:we+Ie(de)*Z.get(se,"scale")}},getAxisValue:Ne,setTranslation:function(de,we){we?Z.set(de.style,"translate",we):de.style.removeProperty("transform"),de[u]=we},getTranslation:function(de){return de[u]},setVisibility:function(de,we){de[c]!==void 0&&de[c]===we||(we?de.style.removeProperty("visibility"):de.style.visibility="hidden",de[c]=we)},isVisible:function(de){return de[c]===void 0||de[c]},isInVisibleRect:function(de,we){var Re=se.visibleRect,Fe=Re.left,Ge=Re.top,We=Re.right,gt=Re.bottom;gt-Ge<2&&(gt=Ge+30);var rt=se.rect;return K==="vertical"?de>rt.left&&dert.top&&we>>0,Z=2<=arguments.length?arguments[1]:void 0,se=0;se .").concat(_),{display:"inline-block"}),ue(ve,".".concat(h,".horizontal > .").concat(o),ge),ue(ve,".".concat(h,".vertical > .").concat(o),pe),ue(ve,".".concat(o),{"box-sizing":"border-box"}),ue(ve,".".concat(o,".horizontal"),ge),ue(ve,".".concat(o,".vertical"),pe),ue(ve,".".concat(o,".animated"),{transition:"transform ease"}),ue(ve,".".concat(l),{"box-sizing":"border-box"}),ue(ve,".".concat(l,".animated"),{transition:"all ease-in-out"}),ue(ve,".".concat(l," *"),{"pointer-events":"none"}),ue(ve,".".concat(D," *"),{"touch-action":"none","-ms-touch-action":"none"}),ue(ve,".".concat(N),{"-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}),ue(ve,".".concat(J),{flex:"1"}),ue(ve,".".concat(h,".horizontal > .").concat(q),{height:"100%",overflow:"hidden",display:"table-cell","vertical-align":"top"}),ue(ve,".".concat(h,".vertical > .").concat(q),{overflow:"hidden",display:"block",width:"100%"}),ue(ve,".".concat(z),{width:"100%",height:"100%",display:"flex","justify-content":"stretch","align-items":"stretch"}),ue(ve,".".concat(L),{"background-color":"rgba(150, 150, 150, 0.1)",border:"1px solid #ccc"}),ve);function Te(H){return Object.keys(H).reduce(function(K,X){var Z=H[X];return ne(Z)==="object"?"".concat(K).concat(X,"{").concat(Te(Z),"}"):"".concat(K).concat(X,":").concat(Z,";")},"")}function Ce(H){if(H&&typeof window!="undefined"){var K=window.document.head||window.document.getElementsByTagName("head")[0],X=window.document.createElement("style"),Z=Te({"body *":{cursor:"".concat(H," !important")}});return X.type="text/css",X.styleSheet?X.styleSheet.cssText=Z:X.appendChild(window.document.createTextNode(Z)),K.appendChild(X),X}return null}var De,C,b=["mousedown","touchstart"],E=["mousemove","touchmove"],P=["mouseup","touchend"],W=null,re=null,te=null,be=null,qe=[],Me=!1,Ue=!1,je=!1,Ze=!1,xt=null,mt=null,Ye=null,At=null,Bt=(De=null,C=!1,{start:function(){C||(C=!0,function H(){De=requestAnimationFrame(function(){W.forEach(function(K){return K.layout.invalidateRects()}),setTimeout(function(){De!==null&&H()},50)})}())},stop:function(){De!==null&&(cancelAnimationFrame(De),De=null),C=!1}}),nt=typeof window!="undefined"&&!!(window.navigator.userAgent.match(/Android/i)||window.navigator.userAgent.match(/webOS/i)||window.navigator.userAgent.match(/iPhone/i)||window.navigator.userAgent.match(/iPad/i)||window.navigator.userAgent.match(/iPod/i)||window.navigator.userAgent.match(/BlackBerry/i)||window.navigator.userAgent.match(/Windows Phone/i));function Ht(){typeof window!="undefined"&&b.forEach(function(H){window.document.addEventListener(H,st,{passive:!1})})}function $t(){return be&&be.ghostParent?be.ghostParent:re&&re.parentElement||window.document.body}var Je,Nt,Ft,et,Ot,Dt,it=(et=null,Ot=1,Dt=5,function(H,K,X){Je=_i(H),Ft=X,(Nt=typeof K=="number"?K:nt?200:0)&&(et=setTimeout(jt,Nt)),E.forEach(function(Z){return window.document.addEventListener(Z,Ut)},{passive:!1}),P.forEach(function(Z){return window.document.addEventListener(Z,qt)},{passive:!1}),window.document.addEventListener("drag",tt,{passive:!1})});function Ut(H){var K=_i(H),X=K.clientX,Z=K.clientY;if(Nt)(Math.abs(Je.clientX-X)>Dt||Math.abs(Je.clientY-Z)>Dt)&&Ct();else if(Math.abs(Je.clientX-X)>Ot||Math.abs(Je.clientY-Z)>Ot)return jt()}function qt(){Ct()}function tt(){Ct()}function Ct(){clearTimeout(et),E.forEach(function(H){return window.document.removeEventListener(H,Ut)},{passive:!1}),P.forEach(function(H){return window.document.removeEventListener(H,qt)},{passive:!1}),window.document.removeEventListener("drag",tt,{passive:!1})}function jt(){clearTimeout(et),Ct(),Ft()}function st(H){var K=_i(H);if(!Me&&(K.button===void 0||K.button===0)&&(re=v(K.target,"."+o))){var X=v(re,"."+h),Z=qe.filter(function(Ie){return Ie.element===X})[0],se=Z.getOptions().dragHandleSelector,ye=Z.getOptions().nonDragAreaSelector,Ae=!0;se&&!v(K.target,se)&&(Ae=!1),ye&&v(K.target,ye)&&(Ae=!1),Ae&&(Z.layout.invalidate(),w(window.document.body,D),w(window.document.body,N),window.document.addEventListener("mouseup",function Ie(){U(window.document.body,D),U(window.document.body,N),window.document.removeEventListener("mouseup",Ie)})),Ae&&it(K,Z.getOptions().dragBeginDelay,function(){k(),Es(K,R(H.target)),E.forEach(function(Ie){window.document.addEventListener(Ie,Vt,{passive:!1})}),P.forEach(function(Ie){window.document.addEventListener(Ie,un,{passive:!1})})})}}function Vt(H){H.preventDefault();var K=_i(H);if(be){var X=be.container.getOptions();X.behaviour==="contain"?function(Z){var se,ye,Ae,Ie,Ne=Z.clientX,de=Z.clientY,we=1Re.end-Ie/2&&(be.position[ye]=Re.end-2)}(K,X.orientation):Ye?Ye==="y"?(te.topLeft.y=K.clientY+te.positionDelta.top,be.position.y=K.clientY+te.centerDelta.y,be.mousePosition.y=K.clientY):Ye==="x"&&(te.topLeft.x=K.clientX+te.positionDelta.left,be.position.x=K.clientX+te.centerDelta.x,be.mousePosition.x=K.clientX):(te.topLeft.x=K.clientX+te.positionDelta.left,te.topLeft.y=K.clientY+te.positionDelta.top,be.position.x=K.clientX+te.centerDelta.x,be.position.y=K.clientY+te.centerDelta.y,be.mousePosition.x=K.clientX,be.mousePosition.y=K.clientY),Wi(),(Ze=!xt(be))&&Fn()}else Es(K,R(H.target))}var St,Pt,In,Cr,Fn=(St=Tn,In=!(Pt=20),Cr=null,function(){for(var H=arguments.length,K=new Array(H),X=0;X=Ne?null:NeIe.end?se(Z,Ne)+1:Z.length;var de=se(Z,Ne,!0);return de!==null?de:Z.length}}(H);return function(X){var Z=X.dragResult,se=null;return Z.pos!==null&&(se=K({dragResult:Z}))===null&&(se=Z.addedIndex),{addedIndex:se}}}function J8(){var H=null;return function(K){var X=K.dragResult,Z=X.addedIndex,se=X.shadowBeginEnd;Z!==H&&H!==null&&se&&(se.beginAdjustment=0),H=Z}}function Q8(H){var K=H.element,X=H.draggables,Z=H.layout,se=H.getOptions,ye=null;return function(Ae){var Ie=Ae.dragResult,Ne=Ie.addedIndex,de=Ie.removedIndex,we=Ie.elementSize;if(de===null){if(Ne!==null){if(!ye){var Re=Z.getBeginEndOfContainer();Re.end=Re.begin+Z.getSize(K);var Fe=Z.getScrollSize(K)>Z.getSize(K)?Re.begin+Z.getScrollSize(K)-Z.getScrollValue(K):Re.end,Ge=0