1var xf=function(e,t){return xf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},xf(e,t)};function $(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xf(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Xt=function(){return Xt=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(t[u]=n[u])}return t},Xt.apply(this,arguments)};function A(e,t,n,i){function o(u){return u instanceof n?u:new n(function(c){c(u)})}return new(n||(n=Promise))(function(u,c){function l(g){try{d(i.next(g))}catch(y){c(y)}}function f(g){try{d(i.throw(g))}catch(y){c(y)}}function d(g){g.done?u(g.value):o(g.value).then(l,f)}d((i=i.apply(e,t||[])).next())})}function S(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},i,o,u,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=l(0),c.throw=l(1),c.return=l(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(g){return f([d,g])}}function f(d){if(i)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(n=0)),n;)try{if(i=1,o&&(u=d[0]&2?o.return:d[0]?o.throw||((u=o.return)&&u.call(o),0):o.next)&&!(u=u.call(o,d[1])).done)return u;switch(o=0,u&&(d=[d[0]&2,u.value]),d[0]){case 0:case 1:u=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,o=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!u||d[1]>u[0]&&d[1]<u[3])){n.label=d[1];break}if(d[0]===6&&n.label<u[1]){n.label=u[1],u=d;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(d);break}u[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(e,n)}catch(g){d=[6,g],o=0}finally{i=u=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function ns(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Zo(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,u=[],c;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)u.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(c)throw c.error}}return u}function dt(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,u;i<o;i++)(u||!(i in t))&&(u||(u=Array.prototype.slice.call(t,0,i)),u[i]=t[i]);return e.concat(u||Array.prototype.slice.call(t))}var db=function(e){for(var t=[],n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=o&63|128):(o&64512)===55296&&i+1<e.length&&(e.charCodeAt(i+1)&64512)===56320?(o=65536+((o&1023)<<10)+(e.charCodeAt(++i)&1023),t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=o&63|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=o&63|128)}return t},QA=function(e){for(var t=[],n=0,i=0;n<e.length;){var o=e[n++];if(o<128)t[i++]=String.fromCharCode(o);else if(o>191&&o<224){var u=e[n++];t[i++]=String.fromCharCode((o&31)<<6|u&63)}else if(o>239&&o<365){var u=e[n++],c=e[n++],l=e[n++],f=((o&7)<<18|(u&63)<<12|(c&63)<<6|l&63)-65536;t[i++]=String.fromCharCode(55296+(f>>10)),t[i++]=String.fromCharCode(56320+(f&1023))}else{var u=e[n++],c=e[n++];t[i++]=String.fromCharCode((o&15)<<12|(u&63)<<6|c&63)}}return t.join("")},YA={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:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[],o=0;o<e.length;o+=3){var u=e[o],c=o+1<e.length,l=c?e[o+1]:0,f=o+2<e.length,d=f?e[o+2]:0,g=u>>2,y=(u&3)<<4|l>>4,w=(l&15)<<2|d>>6,I=d&63;f||(I=64,c||(w=64)),i.push(n[g],n[y],n[w],n[I])}return i.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(db(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):QA(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,i=[],o=0;o<e.length;){var u=n[e.charAt(o++)],c=o<e.length,l=c?n[e.charAt(o)]:0;++o;var f=o<e.length,d=f?n[e.charAt(o)]:64;++o;var g=o<e.length,y=g?n[e.charAt(o)]:64;if(++o,u==null||l==null||d==null||y==null)throw Error();var w=u<<2|l>>4;if(i.push(w),d!==64){var I=l<<4&240|d>>2;if(i.push(I),y!==64){var T=d<<6&192|y;i.push(T)}}}return i},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},JA=function(e){var t=db(e);return YA.encodeByteArray(t,!0)},Ry=function(e){return JA(e).replace(/\./g,"")};function ZA(e){return cs(void 0,e)}function cs(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:var n=t;return new Date(n.getTime());case Object:e===void 0&&(e={});break;case Array:e=[];break;default:return t}for(var i in t)!t.hasOwnProperty(i)||!tk(i)||(e[i]=cs(e[i],t[i]));return e}function tk(e){return e!=="__proto__"}var ek=(function(){function e(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise(function(n,i){t.resolve=n,t.reject=i})}return e.prototype.wrapCallback=function(t){var n=this;return function(i,o){i?n.reject(i):n.resolve(o),typeof t=="function"&&(n.promise.catch(function(){}),t.length===1?t(i):t(i,o))}},e})();function vb(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n={alg:"none",type:"JWT"},i=t||"demo-project",o=e.iat||0,u=e.sub||e.user_id;if(!u)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var c=Xt({iss:"https://securetoken.google.com/"+i,aud:i,iat:o,exp:o+3600,auth_time:o,sub:u,user_id:u,firebase:{sign_in_provider:"custom",identities:{}}},e),l="";return[Ry(JSON.stringify(n)),Ry(JSON.stringify(c)),l].join(".")}function Mr(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function nk(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Mr())}function gb(){try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function rk(){return typeof self=="object"&&self.self===self}function ik(){var e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function ok(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function sk(){return Mr().indexOf("Electron/")>=0}function uk(){var e=Mr();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function ak(){return Mr().indexOf("MSAppHost/")>=0}function ck(){return!gb()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}var hk="FirebaseError",Ns=(function(e){$(t,e);function t(n,i,o){var u=e.call(this,i)||this;return u.code=n,u.customData=o,u.name=hk,Object.setPrototypeOf(u,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(u,Cs.prototype.create),u}return t})(Error),Cs=(function(){function e(t,n,i){this.service=t,this.serviceName=n,this.errors=i}return e.prototype.create=function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=n[0]||{},u=this.service+"/"+t,c=this.errors[t],l=c?lk(c,o):"Error",f=this.serviceName+": "+l+" ("+u+").",d=new Ns(u,f,o);return d},e})();function lk(e,t){return e.replace(fk,function(n,i){var o=t[i];return o!=null?String(o):"<"+i+"?>"})}var fk=/\{\$([^}]+)}/g;function Dy(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function pk(e,t){var n=new dk(e,t);return n.subscribe.bind(n)}var dk=(function(){function e(t,n){var i=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
1ise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(function(){t(i)}).catch(function(o){i.error(o)})}return e.prototype.next=function(t){this.forEachObserver(function(n){n.next(t)})},e.prototype.error=function(t){this.forEachObserver(function(n){n.error(t)}),this.close(t)},e.prototype.complete=function(){this.forEachObserver(function(t){t.complete()}),this.close()},e.prototype.subscribe=function(t,n,i){var o=this,u;if(t===void 0&&n===void 0&&i===void 0)throw new Error("Missing Observer.");vk(t,["next","error","complete"])?u=t:u={next:t,error:n,complete:i},u.next===void 0&&(u.next=df),u.error===void 0&&(u.error=df),u.complete===void 0&&(u.complete=df);var c=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{o.finalError?u.error(o.finalError):u.complete()}catch{}}),this.observers.push(u),c},e.prototype.unsubscribeOne=function(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))},e.prototype.forEachObserver=function(t){if(!this.finalized)for(var n=0;n<this.observers.length;n++)this.sendOne(n,t)},e.prototype.sendOne=function(t,n){var i=this;this.task.then(function(){if(i.observers!==void 0&&i.observers[t]!==void 0)try{n(i.observers[t])}catch(o){typeof console<"u"&&console.error&&console.error(o)}})},e.prototype.close=function(t){var n=this;this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(function(){n.observers=void 0,n.onNoObservers=void 0}))},e})();function vk(e,t){if(typeof e!="object"||e===null)return!1;for(var n=0,i=t;n<i.length;n++){var o=i[n];if(o in e&&typeof e[o]=="function")return!0}return!1}function df(){}var gk=1e3,mk=2,yk=14400*1e3,wk=.5;function bk(e,t,n){t===void 0&&(t=gk),n===void 0&&(n=mk);var i=t*Math.pow(n,e),o=Math.round(wk*i*(Math.random()-.5)*2);return Math.min(yk,i+o)}function ht(e){return e&&e._delegate?e._delegate:e}var Hr=(function(){function e(t,n,i){this.name=t,this.instanceFactory=n,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return e.prototype.setInstantiationMode=function(t){return this.instantiationMode=t,this},e.prototype.setMultipleInstances=function(t){return this.multipleInstances=t,this},e.prototype.setServiceProps=function(t){return this.serviceProps=t,this},e.prototype.setInstanceCreatedCallback=function(t){return this.onInstanceCreated=t,this},e})();var Er="[DEFAULT]";var Ik=(function(){function e(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}return e.prototype.get=function(t){var n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){var i=new ek;if(this.instancesDeferred.set(n,i),this.isInitialized(n)||this.shouldAutoInitialize())try{var o=this.getOrInitializeService({instanceIdentifier:n});o&&i.resolve(o)}catch{}}return this.instancesDeferred.get(n).promise},e.prototype.getImmediate=function(t){var n,i=this.normalizeInstanceIdentifier(t?.identifier),o=(n=t?.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(u){if(o)return null;throw u}else{if(o)return null;throw Error("Service "+this.name+" is not available")}},e.prototype.getComponent=function(){return this.component},e.prototype.setComponent=function(t){var n,i;if(t.name!==this.name)throw Error("Mismatching Component "+t.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=t,!!this.shouldAutoInitialize()){if(_k(t))try{this.getOrInitializeService({instanceIdentifier:Er})}catch{}try{for(var o=ns(this.instancesDeferred.entries()),u=o.next();!u.done;u=o.next()){var c=Zo(u.value,2),l=c[0],f=c[1],d=this.normalizeInstanceIdentifier(l);try{var g=this.getOrInitializeService({instanceIdentifier:d});f.resolve(g)}catch{}}}catch(y){n={error:y}}finally{try{u&&!u.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}},e.prototype.clearInstance=function(t){t===void 0&&(t=Er),this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)},e.prototype.delete=function(){return A(this,void 0,void 0,function(){var t;return S(this,function(n){switch(n.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(dt(dt([],Zo(t.filter(function(i){return"INTERNAL"in i}).map(function(i){return i.INTERNAL.delete()}))),Zo(t.filter(function(i){return"_delete"in i}).map(function(i){return i._delete()}))))];case 1:return n.sent(),[2]}})})},e.prototype.isComponentSet=function(){return this.component!=null},e.prototype.isInitialized=function(t){return t===void 0&&(t=Er),this.instances.has(t)},e.prototype.getOptions=function(t){return t===void 0&&(t=Er),this.instancesOptions.get(t)||{}},e.prototype.initialize=function(t){var n,i;
1t===void 0&&(t={});var o=t.options,u=o===void 0?{}:o,c=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(c))throw Error(this.name+"("+c+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var l=this.getOrInitializeService({instanceIdentifier:c,options:u});try{for(var f=ns(this.instancesDeferred.entries()),d=f.next();!d.done;d=f.next()){var g=Zo(d.value,2),y=g[0],w=g[1],I=this.normalizeInstanceIdentifier(y);c===I&&w.resolve(l)}}catch(T){n={error:T}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return l},e.prototype.onInit=function(t,n){var i,o=this.normalizeInstanceIdentifier(n),u=(i=this.onInitCallbacks.get(o))!==null&&i!==void 0?i:new Set;u.add(t),this.onInitCallbacks.set(o,u);var c=this.instances.get(o);return c&&t(c,o),function(){u.delete(t)}},e.prototype.invokeOnInitCallbacks=function(t,n){var i,o,u=this.onInitCallbacks.get(n);if(u)try{for(var c=ns(u),l=c.next();!l.done;l=c.next()){var f=l.value;try{f(t,n)}catch{}}}catch(d){i={error:d}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}},e.prototype.getOrInitializeService=function(t){var n=t.instanceIdentifier,i=t.options,o=i===void 0?{}:i,u=this.instances.get(n);if(!u&&this.component&&(u=this.component.instanceFactory(this.container,{instanceIdentifier:Tk(n),options:o}),this.instances.set(n,u),this.instancesOptions.set(n,o),this.invokeOnInitCallbacks(u,n),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,n,u)}catch{}return u||null},e.prototype.normalizeInstanceIdentifier=function(t){return t===void 0&&(t=Er),this.component?this.component.multipleInstances?t:Er:t},e.prototype.shouldAutoInitialize=function(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"},e})();function Tk(e){return e===Er?void 0:e}function _k(e){return e.instantiationMode==="EAGER"}var Ek=(function(){function e(t){this.name=t,this.providers=new Map}return e.prototype.addComponent=function(t){var n=this.getProvider(t.name);if(n.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);n.setComponent(t)},e.prototype.addOrOverwriteComponent=function(t){var n=this.getProvider(t.name);n.isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},e.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var n=new Ik(t,this);return this.providers.set(t,n),n},e.prototype.getProviders=function(){return Array.from(this.providers.values())},e})();function ze(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),o=0,t=0;t<n;t++)for(var u=arguments[t],c=0,l=u.length;c<l;c++,o++)i[o]=u[c];return i}var _r,fp=[],nt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(nt||(nt={}));var mb={debug:nt.DEBUG,verbose:nt.VERBOSE,info:nt.INFO,warn:nt.WARN,error:nt.ERROR,silent:nt.SILENT},Sk=nt.INFO,Ak=(_r={},_r[nt.DEBUG]="log",_r[nt.VERBOSE]="log",_r[nt.INFO]="info",_r[nt.WARN]="warn",_r[nt.ERROR]="error",_r),kk=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(t<e.logLevel)){var o=new Date().toISOString(),u=Ak[t];if(u)console[u].apply(console,ze(["["+o+"] "+e.name+":"],n));else throw new Error("Attempted to log a message with an invalid logType (value: "+t+")")}},pp=(function(){function e(t){this.name=t,this._logLevel=Sk,this._logHandler=kk,this._userLogHandler=null,fp.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in nt))throw new TypeError('Invalid value "'+t+'" assigned to `logLevel`');this._logLevel=t},enumerable:!1,configurable:!0}),e.prototype.setLogLevel=function(t){this._logLevel=typeof t=="string"?mb[t]:t},Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!1,configurable:!0}),e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,ze([this,nt.DEBUG],t)),this._logHandler.apply(this,ze([this,nt.DEBUG],t))},e.prototype.log=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,ze([this,nt.VERBOSE],t)),this._logHandler.apply(this,ze([this,nt.VERBOSE],t))},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,ze([this,nt.INFO],t)),this._logHandler.apply(this,ze([this,nt.INFO],t))},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,ze([this,nt.WARN],t)),this._logHandler.apply(this,ze([this,nt.WARN],t))},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,ze([this,nt.ERROR],t)),this._logHandler.apply(this,ze([this,nt.ERROR],t))},e})();function Nk(e){fp.forEach(function(t){t.setLogLevel(e)})}function Ck(e,t){for(var n=function(c){var l=null;t&&t.level&&(l=mb[t.level]),e===null?c.userLogHandler=null:c.userLogHandler=function(f,d){for(var g=[],y=2;y<arguments.length;y++)g[y-2]=arguments[y];var w=g.map(function(I){if(I==null)return null;if(typeof I=="string")return I;if(typeof I=="number"||typeof I=="boolean")return I.toString();if(I instanceof Error)return I.message;try{return JSON.stringify(I)}catch{return null}}).filter(function(I){return I}).join(" ");d>=(l??f.logLevel)&&e({level:nt[d].toLowerCase(),message:w,args:g,type:f.name})}},i=0,o=fp;i<o.length;i++){var u=o[i];n(u)}}var Fn,Rk=(Fn={},Fn["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",Fn["bad-app-name"]="Illegal App name: '{$appName}",Fn["duplicate-app"]="Firebase App named '{$appName}' already exists",Fn["app-deleted"]="Firebase App named '{$appName}' already deleted",Fn["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",Fn["invalid-log-argument"]="First argument to `onLog` must be null or a function.",Fn),Ci=new Cs("app","Firebase",Rk),yb="@firebase/app",Dk="0.6.30",Ok="@firebase/analytics",Pk="@firebase/app-check",xk="@firebase/auth",Lk="@firebase/database",Mk="@firebase/functions",Fk="@firebase/installations",Uk="@firebase/messaging",jk="@firebase/performance",Vk="@firebase/remote-config",qk="@firebase/storage",Bk="@firebase/firestore",Kk="firebase-wrapper";var zt,wa="[DEFAULT]",Hk=(zt={},zt[yb]="fire-core",zt[Ok]="fire-analytics",zt[Pk]="fire-app-check",zt[xk]="fire-auth",zt[Lk]="fire-rtdb",zt[Mk]="fire-fn",zt[Fk]="fire-iid",zt[Uk]="fire-fcm",zt[jk]="fire-perf",zt[Vk]="fire-rc",zt[qk]="fire-gcs",zt[Bk]="fire-fst",zt["fire-js"]="fire-js",zt[Kk]="fire-js-all",zt);var Mi=new pp("@firebase/app");var la=(function(){function e(t,n,i){var o=this;this.firebase_=i,this.isDeleted_=!1,this.name_=n.name,this.automaticDataCollectionEnabled_=n.automaticDataCollectionEnabled||!1,this.options_=ZA(t),this.container=new Ek(n.name),this._addComponent(new Hr("app",function(){return o},"PUBLIC")),this.firebase_.INTERNAL.components.forEach(function(u){return o._addComponent(u)})}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),e.prototype.delete=function(){var t=this;return new Promise(function(n){t.checkDestroyed_(),n()}).then(function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map(function(n){return n.delete()}))}).then(function(){t.isDeleted_=!0})},e.prototype._getService=function(t,n){var i;n===void 0&&(n=wa),this.checkDestroyed_();var o=this.container.getProvider(t);return!o.isInitialized()&&((i=o.getComponent())===null||i===void 0?void 0:i.instantiationMode)==="EXPLICIT"&&o.initialize(),o.getImmediate({identifier:n})},e.prototype._removeServiceInstance=function(t,n){n===void 0&&(n=wa),this.container.getProvider(t).clearInstance(n)},e.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(n){Mi.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,n)}},e.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},e.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},e.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw Ci.create("app-deleted",{appName:this.name_})},e})();la.prototype.name&&la.prototype.options||la.prototype.delete;var Gk="8.10.0";function zk(e){var t={},n=new Map,i={__esModule:!0,initializeApp:c,app:u,registerVersion:d,set
1LogLevel:Nk,onLog:g,apps:null,SDK_VERSION:Gk,INTERNAL:{registerComponent:f,removeApp:o,components:n,useAsService:y}};i.default=i,Object.defineProperty(i,"apps",{get:l});function o(w){delete t[w]}function u(w){if(w=w||wa,!Dy(t,w))throw Ci.create("no-app",{appName:w});return t[w]}u.App=e;function c(w,I){if(I===void 0&&(I={}),typeof I!="object"||I===null){var T=I;I={name:T}}var E=I;E.name===void 0&&(E.name=wa);var N=E.name;if(typeof N!="string"||!N)throw Ci.create("bad-app-name",{appName:String(N)});if(Dy(t,N))throw Ci.create("duplicate-app",{appName:N});var D=new e(w,E,i);return t[N]=D,D}function l(){return Object.keys(t).map(function(w){return t[w]})}function f(w){var I=w.name;if(n.has(I))return Mi.debug("There were multiple attempts to register component "+I+"."),w.type==="PUBLIC"?i[I]:null;if(n.set(I,w),w.type==="PUBLIC"){var T=function(F){if(F===void 0&&(F=u()),typeof F[I]!="function")throw Ci.create("invalid-app-argument",{appName:I});return F[I]()};w.serviceProps!==void 0&&cs(T,w.serviceProps),i[I]=T,e.prototype[I]=function(){for(var F=[],C=0;C<arguments.length;C++)F[C]=arguments[C];var B=this._getService.bind(this,I);return B.apply(this,w.multipleInstances?F:[])}}for(var E=0,N=Object.keys(t);E<N.length;E++){var D=N[E];t[D]._addComponent(w)}return w.type==="PUBLIC"?i[I]:null}function d(w,I,T){var E,N=(E=Hk[w])!==null&&E!==void 0?E:w;T&&(N+="-"+T);var D=N.match(/\s|\//),F=I.match(/\s|\//);if(D||F){var C=['Unable to register library "'+N+'" with version "'+I+'":'];D&&C.push('library name "'+N+'" contains illegal characters (whitespace or "/")'),D&&F&&C.push("and"),F&&C.push('version name "'+I+'" contains illegal characters (whitespace or "/")'),Mi.warn(C.join(" "));return}f(new Hr(N+"-version",function(){return{library:N,version:I}},"VERSION"))}function g(w,I){if(w!==null&&typeof w!="function")throw Ci.create("invalid-log-argument");Ck(w,I)}function y(w,I){if(I==="serverAuth")return null;var T=I;return T}return i}function wb(){var e=zk(la);e.INTERNAL=Xt(Xt({},e.INTERNAL),{createFirebaseNamespace:wb,extendNamespace:t,createSubscribe:pk,ErrorFactory:Cs,deepExtend:cs});function t(n){cs(e,n)}return e}var dp=wb();var $k=(function(){function e(t){this.container=t}return e.prototype.getPlatformInfoString=function(){var t=this.container.getProviders();return t.map(function(n){if(Wk(n)){var i=n.getImmediate();return i.library+"/"+i.version}else return null}).filter(function(n){return n}).join(" ")},e})();function Wk(e){var t=e.getComponent();return t?.type==="VERSION"}function Xk(e,t){e.INTERNAL.registerComponent(new Hr("platform-logger",function(n){return new $k(n)},"PRIVATE")),e.registerVersion(yb,Dk,t),e.registerVersion("fire-js","")}if(rk()&&self.firebase!==void 0){Mi.warn(` 2 Warning: Firebase is already defined in the global scope. Please make sure 3 Firebase library is only loaded once. 4 `);var Oy=self.firebase.SDK_VERSION;Oy&&Oy.indexOf("LITE")>=0&&Mi.warn(` 5 Warning: You are trying to load Firebase while using Firebase Performance standalone script. 6 You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code. 7 `)}var Qk=dp.initializeApp;dp.initializeApp=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return gb()&&Mi.warn(` 8 Warning: This is a browser-targeted Firebase bundle but it appears it is being 9 run in a Node environment. If running in a Node environment, make sure you 10 are using the bundle specified by the "main" field in package.json. 11 12 If you are using Webpack, you can specify "main" as the first item in 13 "resolve.mainFields": 14 https://webpack.js.org/configuration/resolve/#resolvemainfields 15 16 If using Rollup, use the @rollup/plugin-node-resolve plugin and specify "main" 17 as the first item in "mainFields", e.g. ['main', 'module']. 18 https://github.com/rollup/@rollup/plugin-node-resolve 19 `),Qk.apply(void 0,e)};var H=dp;Xk(H);(function(){var e,t=typeof Object.defineProperties=="function"?Object.defineProperty:function(r,s,a){r!=Array.prototype&&r!=Object.prototype&&(r[s]=a.value)};function n(r){r=[typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global,r];for(var s=0;s<r.length;++s){var a=r[s];if(a&&a.Math==Math)return a}return globalThis}var i=n(this);function o(r,s){if(s){var a=i;r=r.split(".");for(var h=0;h<r.length-1;h++){var p=r[h];p in a||(a[p]={}),a=a[p]}
19r=r[r.length-1],h=a[r],s=s(h),s!=h&&s!=null&&t(a,r,{configurable:!0,writable:!0,value:s})}}function u(r){var s=0;return function(){return s<r.length?{done:!1,value:r[s++]}:{done:!0}}}function c(r){var s=typeof Symbol<"u"&&Symbol.iterator&&r[Symbol.iterator];return s?s.call(r):{next:u(r)}}o("Promise",function(r){function s(m){this.b=0,this.c=void 0,this.a=[];var b=this.f();try{m(b.resolve,b.reject)}catch(R){b.reject(R)}}function a(){this.a=null}function h(m){return m instanceof s?m:new s(function(b){b(m)})}if(r)return r;a.prototype.b=function(m){if(this.a==null){this.a=[];var b=this;this.c(function(){b.g()})}this.a.push(m)};var p=i.setTimeout;a.prototype.c=function(m){p(m,0)},a.prototype.g=function(){for(;this.a&&this.a.length;){var m=this.a;this.a=[];for(var b=0;b<m.length;++b){var R=m[b];m[b]=null;try{R()}catch(O){this.f(O)}}}this.a=null},a.prototype.f=function(m){this.c(function(){throw m})},s.prototype.f=function(){function m(O){return function(X){R||(R=!0,O.call(b,X))}}var b=this,R=!1;return{resolve:m(this.m),reject:m(this.g)}},s.prototype.m=function(m){if(m===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(m instanceof s)this.s(m);else{t:switch(typeof m){case"object":var b=m!=null;break t;case"function":b=!0;break t;default:b=!1}b?this.v(m):this.h(m)}},s.prototype.v=function(m){var b=void 0;try{b=m.then}catch(R){this.g(R);return}typeof b=="function"?this.u(b,m):this.h(m)},s.prototype.g=function(m){this.i(2,m)},s.prototype.h=function(m){this.i(1,m)},s.prototype.i=function(m,b){if(this.b!=0)throw Error("Cannot settle("+m+", "+b+"): Promise already settled in state"+this.b);this.b=m,this.c=b,this.l()},s.prototype.l=function(){if(this.a!=null){for(var m=0;m<this.a.length;++m)v.b(this.a[m]);this.a=null}};var v=new a;return s.prototype.s=function(m){var b=this.f();m.Ra(b.resolve,b.reject)},s.prototype.u=function(m,b){var R=this.f();try{m.call(b,R.resolve,R.reject)}catch(O){R.reject(O)}},s.prototype.then=function(m,b){function R(ot,Ft){return typeof ot=="function"?function(yn){try{O(ot(yn))}catch(pf){X(pf)}}:Ft}var O,X,at=new s(function(ot,Ft){O=ot,X=Ft});return this.Ra(R(m,O),R(b,X)),at},s.prototype.catch=function(m){return this.then(void 0,m)},s.prototype.Ra=function(m,b){function R(){switch(O.b){case 1:m(O.c);break;case 2:b(O.c);break;default:throw Error("Unexpected state: "+O.b)}}var O=this;this.a==null?v.b(R):this.a.push(R)},s.resolve=h,s.reject=function(m){return new s(function(b,R){R(m)})},s.race=function(m){return new s(function(b,R){for(var O=c(m),X=O.next();!X.done;X=O.next())h(X.value).Ra(b,R)})},s.all=function(m){var b=c(m),R=b.next();return R.done?h([]):new s(function(O,X){function at(yn){return function(pf){ot[yn]=pf,Ft--,Ft==0&&O(ot)}}var ot=[],Ft=0;do ot.push(void 0),Ft++,h(R.value).Ra(at(ot.length-1),X),R=b.next();while(!R.done)})},s});var l=l||{},f=this||self,d=/^[\w+/_-]+[=]{0,2}$/,g=null;function y(r){return(r=r.querySelector&&r.querySelector("script[nonce]"))&&(r=r.nonce||r.getAttribute("nonce"))&&d.test(r)?r:""}function w(){}function I(r){var s=typeof r;return s!="object"?s:r?Array.isArray(r)?"array":s:"null"}function T(r){var s=I(r);return s=="array"||s=="object"&&typeof r.length=="number"}function E(r){return I(r)=="function"}function N(r){var s=typeof r;return s=="object"&&r!=null||s=="function"}function D(r,s,a){return r.call.apply(r.bind,arguments)}function F(r,s,a){if(!r)throw Error();if(2<arguments.length){var h=Array.prototype.slice.call(arguments,2);return function(){var p=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(p,h),r.apply(s,p)}}return function(){return r.apply(s,arguments)}}function C(r,s,a){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?C=D:C=F,C.apply(null,arguments)}function B(r,s){var a=Array.prototype.slice.call(arguments,1);return function(){var h=a.slice();return h.push.apply(h,arguments),r.apply(this,h)}}function x(r,s){function a(){}a.prototype=s.prototype,r.bb=s.prototype,r.prototype=new a,r.prototype.constructor=r}function Y(r){return r}function _(r,s,a){this.code=yt+r,this.message=s||Xs[r]||"",this.a=a||null}x(_,Error),_.prototype.w=function(){var r={code:this.code,message:this.message};return this.a&&(r.serverResponse=this.a),r},_.prototype.toJSON=function(){return this.w()};function te(r){var s=r&&r.code;return s?new _(s.substring(yt.length),r.message,r.serverResponse):null}var yt="auth/",Xs={"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must al
19ways have a verified email.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invali
19d-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."},ti={ld:{Ua:"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",$a:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Xa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"b"},sd:{Ua:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",$a:"https://securetoken.googleapis.com/v1/token",Xa:"https://identitytoolkit.googleapis.com/v2/",id:"p"},ud:{Ua:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",$a:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Xa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"s"},vd:{Ua:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",$a:"https://test-securetoken.sandbox.googleapis.com/v1/token",Xa:"https://test-identitytoolkit.sandbox.googleapis.com/v2/",id:"t"}};function fo(r){for(var s in ti)if(ti[s].id===r)return r=ti[s],{firebaseEndpoint:r.Ua,secureTokenEndpoint:r.$a,identityPlatformEndpoint:r.Xa};return null}var po;po=fo("__EID__")?"__EID__":void 0;
19function jd(r){if(!r)return!1;try{return!!r.$goog_Thenable}catch{return!1}}function Ie(r){if(Error.captureStackTrace)Error.captureStackTrace(this,Ie);else{var s=Error().stack;s&&(this.stack=s)}r&&(this.message=String(r))}x(Ie,Error),Ie.prototype.name="CustomError";function xc(r,s){r=r.split("%s");for(var a="",h=r.length-1,p=0;p<h;p++)a+=r[p]+(p<s.length?s[p]:"%s");Ie.call(this,a+r[h])}x(xc,Ie),xc.prototype.name="AssertionError";function ei(r,s){throw new xc("Failure"+(r?": "+r:""),Array.prototype.slice.call(arguments,1))}function Lc(r,s){this.c=r,this.f=s,this.b=0,this.a=null}Lc.prototype.get=function(){if(0<this.b){this.b--;var r=this.a;this.a=r.next,r.next=null}else r=this.c();return r};function Vd(r,s){r.f(s),100>r.b&&(r.b++,s.next=r.a,r.a=s)}function qd(){this.b=this.a=null}var Bd=new Lc(function(){return new Mc},function(r){r.reset()});qd.prototype.add=function(r,s){var a=Bd.get();a.set(r,s),this.b?this.b.next=a:this.a=a,this.b=a};function zT(){var r=vv,s=null;return r.a&&(s=r.a,r.a=r.a.next,r.a||(r.b=null),s.next=null),s}function Mc(){this.next=this.b=this.a=null}Mc.prototype.set=function(r,s){this.a=r,this.b=s,this.next=null},Mc.prototype.reset=function(){this.next=this.b=this.a=null};var Kd=Array.prototype.indexOf?function(r,s){return Array.prototype.indexOf.call(r,s,void 0)}:function(r,s){if(typeof r=="string")return typeof s!="string"||s.length!=1?-1:r.indexOf(s,0);for(var a=0;a<r.length;a++)if(a in r&&r[a]===s)return a;return-1},wt=Array.prototype.forEach?function(r,s,a){Array.prototype.forEach.call(r,s,a)}:function(r,s,a){for(var h=r.length,p=typeof r=="string"?r.split(""):r,v=0;v<h;v++)v in p&&s.call(a,p[v],v,r)};function $T(r,s){for(var a=typeof r=="string"?r.split(""):r,h=r.length-1;0<=h;--h)h in a&&s.call(void 0,a[h],h,r)}var WT=Array.prototype.filter?function(r,s){return Array.prototype.filter.call(r,s,void 0)}:function(r,s){for(var a=r.length,h=[],p=0,v=typeof r=="string"?r.split(""):r,m=0;m<a;m++)if(m in v){var b=v[m];s.call(void 0,b,m,r)&&(h[p++]=b)}return h},Qs=Array.prototype.map?function(r,s){return Array.prototype.map.call(r,s,void 0)}:function(r,s){for(var a=r.length,h=Array(a),p=typeof r=="string"?r.split(""):r,v=0;v<a;v++)v in p&&(h[v]=s.call(void 0,p[v],v,r));return h},XT=Array.prototype.some?function(r,s){return Array.prototype.some.call(r,s,void 0)}:function(r,s){for(var a=r.length,h=typeof r=="string"?r.split(""):r,p=0;p<a;p++)if(p in h&&s.call(void 0,h[p],p,r))return!0;return!1};function QT(r){t:{for(var s=CE,a=r.length,h=typeof r=="string"?r.split(""):r,p=0;p<a;p++)if(p in h&&s.call(void 0,h[p],p,r)){s=p;break t}s=-1}return 0>s?null:typeof r=="string"?r.charAt(s):r[s]}function pn(r,s){return 0<=Kd(r,s)}function Ys(r,s){s=Kd(r,s);var a;return(a=0<=s)&&Array.prototype.splice.call(r,s,1),a}function je(r,s){var a=0;$T(r,function(h,p){s.call(void 0,h,p,r)&&Array.prototype.splice.call(r,p,1).length==1&&a++})}function Fc(r){return Array.prototype.concat.apply([],arguments)}function nr(r){var s=r.length;if(0<s){for(var a=Array(s),h=0;h<s;h++)a[h]=r[h];return a}return[]}var Hd=String.prototype.trim?function(r){return r.trim()}:function(r){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(r)[1]},YT=/&/g,JT=/</g,ZT=/>/g,t_=/"/g,e_=/'/g,n_=/\x00/g,r_=/[\x00&<>"']/;function lt(r,s){return r.indexOf(s)!=-1}function Uc(r,s){return r<s?-1:r>s?1:0}var ni;t:{var Gd=f.navigator;if(Gd){var zd=Gd.userAgent;if(zd){ni=zd;break t}}ni=""}function Pt(r){return lt(ni,r)}function $d(r,s){for(var a in r)s.call(void 0,r[a],a,r)}function rr(r){for(var s in r)return!1;return!0}function Nn(r){var s={},a;for(a in r)s[a]=r[a];return s}var Wd="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function le(r,s){for(var a,h,p=1;p<arguments.length;p++){h=arguments[p];for(a in h)r[a]=h[a];for(var v=0;v<Wd.length;v++)a=Wd[v],Object.prototype.hasOwnProperty.call(h,a)&&(r[a]=h[a])}}function Xd(r,s){t:{try{var a=r&&r.ownerDocument,h=a&&(a.defaultView||a.parentWindow);if(h=h||f,h.Element&&h.Location){var p=h;break t}}catch{}p=null}if(p&&typeof p[s]<"u"&&(!r||!(r instanceof p[s])&&(r instanceof p.Location||r instanceof p.Element))){if
19(N(r))try{var v=r.constructor.displayName||r.constructor.name||Object.prototype.toString.call(r)}catch{v="<object could not be stringified>"}else v=r===void 0?"undefined":r===null?"null":typeof r;ei("Argument is not a %s (or a non-Element, non-Location mock); got: %s",s,v)}}function Ye(r,s){this.a=r===Js&&s||"",this.b=Qd}Ye.prototype.ta=!0,Ye.prototype.sa=function(){return this.a},Ye.prototype.toString=function(){return"Const{"+this.a+"}"};function jc(r){return r instanceof Ye&&r.constructor===Ye&&r.b===Qd?r.a:(ei("expected object of type Const, got '"+r+"'"),"type_error:Const")}var Qd={},Js={},Zs;function Yd(){if(Zs===void 0){var r=null,s=f.trustedTypes;if(s&&s.createPolicy){try{r=s.createPolicy("goog#html",{createHTML:Y,createScript:Y,createScriptURL:Y})}catch(a){f.console&&f.console.error(a.message)}Zs=r}else Zs=r}return Zs}function ri(r,s){this.a=s===Zd?r:""}ri.prototype.ta=!0,ri.prototype.sa=function(){return this.a.toString()},ri.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};function Jd(r){return r instanceof ri&&r.constructor===ri?r.a:(ei("expected object of type TrustedResourceUrl, got '"+r+"' of type "+I(r)),"type_error:TrustedResourceUrl")}function Vc(r,s){var a=jc(r);if(!o_.test(a))throw Error("Invalid TrustedResourceUrl format: "+a);return r=a.replace(i_,function(h,p){if(!Object.prototype.hasOwnProperty.call(s,p))throw Error('Found marker, "'+p+'", in format string, "'+a+'", but no valid label mapping found in args: '+JSON.stringify(s));return h=s[p],h instanceof Ye?jc(h):encodeURIComponent(String(h))}),s_(r)}var i_=/%{(\w+)}/g,o_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Zd={};function s_(r){var s=Yd();return r=s?s.createScriptURL(r):r,new ri(r,Zd)}function fe(r,s){this.a=s===vo?r:""}fe.prototype.ta=!0,fe.prototype.sa=function(){return this.a.toString()},fe.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};function tu(r){return r instanceof fe&&r.constructor===fe?r.a:(ei("expected object of type SafeUrl, got '"+r+"' of type "+I(r)),"type_error:SafeUrl")}var u_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|font\/\w+|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i,a_=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,tv=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function ev(r){if(r instanceof fe)return r;if(r=typeof r=="object"&&r.ta?r.sa():String(r),tv.test(r))r=new fe(r,vo);else{r=String(r),r=r.replace(/(%0A|%0D)/g,"");var s=r.match(a_);r=s&&u_.test(s[1])?new fe(r,vo):null}return r}function nv(r){return r instanceof fe?r:(r=typeof r=="object"&&r.ta?r.sa():String(r),tv.test(r)||(r="about:invalid#zClosurez"),new fe(r,vo))}var vo={}
19,rv=new fe("about:invalid#zClosurez",vo);function ii(r,s,a){this.a=a===iv?r:""}ii.prototype.ta=!0,ii.prototype.sa=function(){return this.a.toString()},ii.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};function c_(r){return r instanceof ii&&r.constructor===ii?r.a:(ei("expected object of type SafeHtml, got '"+r+"' of type "+I(r)),"type_error:SafeHtml")}var iv={};function h_(r,s){Xd(r,"HTMLScriptElement"),r.src=Jd(s),(s=r.ownerDocument&&r.ownerDocument.defaultView)&&s!=f?s=y(s.document):(g===null&&(g=y(f.document)),s=g),s&&r.setAttribute("nonce",s)}function ov(r,s,a,h){return r=r instanceof fe?r:nv(r),s=s||f,a=a instanceof Ye?jc(a):a||"",s.open(tu(r),a,h,void 0)}function sv(r,s){for(var a=r.split("%s"),h="",p=Array.prototype.slice.call(arguments,1);p.length&&1<a.length;)h+=a.shift()+p.shift();return h+a.join("%s")}function qc(r){return r_.test(r)&&(r.indexOf("&")!=-1&&(r=r.replace(YT,"&")),r.indexOf("<")!=-1&&(r=r.replace(JT,"<")),r.indexOf(">")!=-1&&(r=r.replace(ZT,">")),r.indexOf('"')!=-1&&(r=r.replace(t_,""")),r.indexOf("'")!=-1&&(r=r.replace(e_,"'")),r.indexOf("\0")!=-1&&(r=r.replace(n_,"�"))),r}function Bc(r){return Bc[" "](r),r}Bc[" "]=w;function l_(r,s){var a=v_;return Object.prototype.hasOwnProperty.call(a,r)?a[r]:a[r]=s(r)}var f_=Pt("Opera"),Ve=Pt("Trident")||Pt("MSIE"),uv=Pt("Edge"),p_=uv||Ve,av=Pt("Gecko")&&!(lt(ni.toLowerCase(),"webkit")&&!Pt("Edge"))&&!(Pt("Trident")||Pt("MSIE"))&&!Pt("Edge"),d_=lt(ni.toLowerCase(),"webkit")&&!Pt("Edge");function cv(){var r=f.document;return r?r.documentMode:void 0}var eu;t:{var Kc="",Hc=(function(){var r=ni;if(av)return/rv:([^\);]+)(\)|;)/.exec(r);if(uv)return/Edge\/([\d\.]+)/.exec(r);if(Ve)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(r);if(d_)return/WebKit\/(\S+)/.exec(r);if(f_)return/(?:Version)[ \/]?(\S+)/.exec(r)})();if(Hc&&(Kc=Hc?Hc[1]:""),Ve){var Gc=cv();if(Gc!=null&&Gc>parseFloat(Kc)){eu=String(Gc);break t}}eu=Kc}var v_={};function hv(r){return l_(r,function(){for(var s=0,a=Hd(String(eu)).split("."),h=H
19d(String(r)).split("."),p=Math.max(a.length,h.length),v=0;s==0&&v<p;v++){var m=a[v]||"",b=h[v]||"";do{if(m=/(\d*)(\D*)(.*)/.exec(m)||["","","",""],b=/(\d*)(\D*)(.*)/.exec(b)||["","","",""],m[0].length==0&&b[0].length==0)break;s=Uc(m[1].length==0?0:parseInt(m[1],10),b[1].length==0?0:parseInt(b[1],10))||Uc(m[2].length==0,b[2].length==0)||Uc(m[2],b[2]),m=m[3],b=b[3]}while(s==0)}return 0<=s})}var zc;if(f.document&&Ve){var lv=cv();zc=lv||parseInt(eu,10)||void 0}else zc=void 0;var Cn=zc;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch{}var g_=!Ve||9<=Number(Cn);function go(r){var s=document;return typeof r=="string"?s.getElementById(r):r}function fv(r,s){$d(s,function(a,h){a&&typeof a=="object"&&a.ta&&(a=a.sa()),h=="style"?r.style.cssText=a:h=="class"?r.className=a:h=="for"?r.htmlFor=a:pv.hasOwnProperty(h)?r.setAttribute(pv[h],a):h.lastIndexOf("aria-",0)==0||h.lastIndexOf("data-",0)==0?r.setAttribute(h,a):r[h]=a})}var pv={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function m_(r,s,a){var h=arguments,p=document,v=String(h[0]),m=h[1];if(!g_&&m&&(m.name||m.type)){if(v=["<",v],m.name&&v.push(' name="',qc(m.name),'"'),m.type){v.push(' type="',qc(m.type),'"');var b={};le(b,m),delete b.type,m=b}v.push(">"),v=v.join("")}return v=nu(p,v),m&&(typeof m=="string"?v.className=m:Array.isArray(m)?v.className=m.join(" "):fv(v,m)),2<h.length&&y_(p,v,h),v}function y_(r,s,a){function h(b){b&&s.appendChild(typeof b=="string"?r.createTextNode(b):b)}for(var p=2;p<a.length;p++){var v=a[p];if(!T(v)||N(v)&&0<v.nodeType)h(v);else{t:{if(v&&typeof v.length=="number"){if(N(v)){var m=typeof v.item=="function"||typeof v.item=="string";break t}if(E(v)){m=typeof v.item=="function";break t}}m=!1}wt(m?nr(v):v,h)}}}function nu(r,s){return s=String(s),r.contentType==="application/xhtml+xml"&&(s=s.toLowerCase()),r.createElement(s)}function dv(r){f.setTimeout(function(){throw r},0)}var $c;function w_(){var r=f.MessageChannel;if(typeof r>"u"&&typeof window<"u"&&window.postMessage&&window.addEventListener&&!Pt("Presto")&&(r=function(){var p=nu(document,"IFRAME");p.style.display="none",document.documentElement.appendChild(p);var v=p.contentWindow;p=v.document,p.open(),p.close();var m="callImmediate"+Math.random(),b=v.location.protocol=="file:"?"*":v.location.protocol+"//"+v.location.host;p=C(function(R){(b=="*"||R.origin==b)&&R.data==m&&this.port1.onmessage()},this),v.addEventListener("message",p,!1),this.port1={},this.port2={postMessage:function(){v.postMessage(m,b)}}}),typeof r<"u"&&!Pt("Trident")&&!Pt("MSIE")){var s=new r,a={},h=a;return s.port1.onmessage=function(){if(a.next!==void 0){a=a.next;var p=a.Hb;a.Hb=null,p()}},function(p){h.next={Hb:p},h=h.next,s.port2.postMessage(0)}}return function(p){f.setTimeout(p,0)}}function ru(r,s){iu||b_(),Wc||(iu(),Wc=!0),vv.add(r,s)}var iu;function b_(){if(f.Promise&&f.Promise.resolve){var r=f.Promise.resolve(void 0);iu=function(){r.then(gv)}}else iu=function(){var s=gv;!E(f.setImmediate)||f.Window&&f.Window.prototype&&!Pt("Edge")&&f.Window.prototype.setImmediate==f.setImmediate?($c||($c=w_()),$c(s)):f.setImmediate(s)}}var Wc=!1,vv=new qd;function gv(){for(var r;r=zT();){try{r.a.call(r.b)}catch(s){dv(s)}Vd(Bd,r)}Wc=!1}function tt(r,s){if(this.a=ir,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,r!=w)try{var a=this;r.call(s,function(h){or(a,mo,h)},function(h){if(!(h instanceof oi))try{throw h instanceof Error?h:Error("Promise rejected.")}catch{}or(a,dn,h)})}catch(h){or(this,dn,h)}}var ir=0,mo=2,dn=3;function mv(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}mv.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var yv=new Lc(function(){return new mv},function(r){r.reset()});function Xc(r,s,a){var h=yv.get();return h.g=r,h.b=s,h.f=a,h}function z(r){if(r instanceof tt)return r;var s=new tt(w);return or(s,mo,r),s}function vt(r){return new tt(function(s,a){a(r)})}function wv(r,s,a){_v(r,s,a,null)||ru(B(s,r))}function I_(r){return new tt(function(s,a){var h=r.length,p=[];if(h)for(var v=function(O,X){h--,p[O]=X,h==0&&s(p)},m=function(O){a(O)},b=0,R;b<r.length;b++)R=r[b],wv(R,B(v,b),m);else s(p)})}function bv(r){return new tt(function(s){var a=r.length,h=[];if(a)for(var p=function(b,R,O){a--,h[b]=R?{Qb:!0,value:O}:{Qb:!1,reason:O},a==0&&s(h)},v=0,m;v<r.length;v++)m=r[v],wv(m,B(p,v,!0),B(p,v,!1));else s(h)})}tt.prototype.then=function(r,s,a){return Tv(this,E(r)?r:null,E(s)?s:null,a)}
19,tt.prototype.$goog_Thenable=!0,e=tt.prototype,e.oa=function(r,s){return r=Xc(r,r,s),r.c=!0,Qc(this,r),this},e.o=function(r,s){return Tv(this,null,r,s)},e.cancel=function(r){if(this.a==ir){var s=new oi(r);ru(function(){Iv(this,s)},this)}};function Iv(r,s){if(r.a==ir)if(r.c){var a=r.c;if(a.b){for(var h=0,p=null,v=null,m=a.b;m&&(m.c||(h++,m.a==r&&(p=m),!(p&&1<h)));m=m.next)p||(v=m);p&&(a.a==ir&&h==1?Iv(a,s):(v?(h=v,h.next==a.f&&(a.f=h),h.next=h.next.next):Sv(a),Av(a,p,dn,s)))}r.c=null}else or(r,dn,s)}function Qc(r,s){r.b||r.a!=mo&&r.a!=dn||Ev(r),r.f?r.f.next=s:r.b=s,r.f=s}function Tv(r,s,a,h){var p=Xc(null,null,null);return p.a=new tt(function(v,m){p.g=s?function(b){try{var R=s.call(h,b);v(R)}catch(O){m(O)}}:v,p.b=a?function(b){try{var R=a.call(h,b);R===void 0&&b instanceof oi?m(b):v(R)}catch(O){m(O)}}:m}),p.a.c=r,Qc(r,p),p.a}e.$c=function(r){this.a=ir,or(this,mo,r)},e.ad=function(r){this.a=ir,or(this,dn,r)};function or(r,s,a){r.a==ir&&(r===a&&(s=dn,a=new TypeError("Promise cannot resolve to itself")),r.a=1,_v(a,r.$c,r.ad,r)||(r.i=a,r.a=s,r.c=null,Ev(r),s!=dn||a instanceof oi||__(r,a)))}function _v(r,s,a,h){if(r instanceof tt)return Qc(r,Xc(s||w,a||null,h)),!0;if(jd(r))return r.then(s,a,h),!0;if(N(r))try{var p=r.then;if(E(p))return T_(r,p,s,a,h),!0}catch(v){return a.call(h,v),!0}return!1}function T_(r,s,a,h,p){function v(R){b||(b=!0,h.call(p,R))}function m(R){b||(b=!0,a.call(p,R))}var b=!1;try{s.call(r,m,v)}catch(R){v(R)}}function Ev(r){r.h||(r.h=!0,ru(r.gc,r))}function Sv(r){var s=null;return r.b&&(s=r.b,r.b=s.next,s.next=null),r.b||(r.f=null),s}e.gc=function(){for(var r;r=Sv(this);)Av(this,r,this.a,this.i);this.h=!1};function Av(r,s,a,h){if(a==dn&&s.b&&!s.c)for(;r&&r.g;r=r.c)r.g=!1;if(s.a)s.a.c=null,kv(s,a,h);else try{s.c?s.g.call(s.f):kv(s,a,h)}catch(p){Nv.call(null,p)}Vd(yv,s)}function kv(r,s,a){s==mo?r.g.call(r.f,a):r.b&&r.b.call(r.f,a)}function __(r,s){r.g=!0,ru(function(){r.g&&Nv.call(null,s)})}var Nv=dv;function oi(r){Ie.call(this,r)}x(oi,Ie),oi.prototype.name="cancel";function ou(){this.ya=this.ya,this.pa=this.pa}var E_=0;ou.prototype.ya=!1;function Cv(r){!r.ya&&(r.ya=!0,r.Da(),E_!=0)}ou.prototype.Da=function(){if(this.pa)for(;this.pa.length;)this.pa.shift()()};var S_=Object.freeze||function(r){return r},Rv=!Ve||9<=Number(Cn),A_=Ve&&!hv("9"),k_=(function(){if(!f.addEventListener||!Object.defineProperty)return!1;var r=!1,s=Object.defineProperty({},"passive",{get:function(){r=!0}});try{f.addEventListener("test",w,s),f.removeEventListener("test",w,s)}catch{}return r})();function pe(r,s){this.type=r,this.b=this.target=s,this.defaultPrevented=!1}pe.prototype.preventDefault=function(){this.defaultPrevented=!0};function sr(r,s){if(pe.call(this,r?r.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,r){var a=this.type=r.type,h=r.changedTouches&&r.changedTouches.length?r.changedTouches[0]:null;if(this.target=r.target||r.srcElement,this.b=s,s=r.relatedTarget){if(av){t:{try{Bc(s.nodeName);var p=!0;break t}catch{}p=!1}p||(s=null)}}else a=="mouseover"?s=r.fromElement:a=="mouseout"&&(s=r.toElement);this.relatedTarget=s,h?(this.clientX=h.clientX!==void 0?h.clientX:h.pageX,this.clientY=h.clientY!==void 0?h.clientY:h.pageY,this.screenX=h.screenX||0,this.screenY=h.screenY||0):(this.clientX=r.clientX!==void 0?r.clientX:r.pageX,this.clientY=r.clientY!==void 0?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0),this.button=r.button,this.key=r.key||"",this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.pointerId=r.pointerId||0,this.pointerType=typeof r.pointerType=="string"?r.pointerType:N_[r.pointerType]||"",this.a=r,r.defaultPrevented&&this.preventDefault()}}x(sr,pe);var N_=S_({2:"touch",3:"pen",4:"mouse"});sr.prototype.preventDefault=function(){sr.bb.preventDefault.call(this);var r=this.a;if(r.preventDefault)r.preventDefault();else if(r.returnValue=!1,A_)try{(r.ctrlKey||112<=r.keyCode&&123>=r.keyCode)&&(r.keyCode=-1)}catch{}},sr.prototype.g=function(){return this.a};var yo="closure_listenable_"+(1e6*Math.random()|0),C_=0;function R_(r,s,a,h,p){this.listener=r,this.proxy=null,this.src=s,this.type=a,this.capture=!!h,this.Wa=p,this.key=++C_,this.wa=this.Qa=!1}function su(r){r.wa=!0,r.listener=null,r.proxy=null,r.src=null,r.Wa=null}function uu(r){this.src=r,this.a={},this.b=0}uu.prototype.add=function(r,s,a,h,p){var v=r.toString();r=this.a[v],r||(r=this.a[v]=[],this.b++);var m=Jc(r,s,h,p);
19return-1<m?(s=r[m],a||(s.Qa=!1)):(s=new R_(s,this.src,v,!!h,p),s.Qa=a,r.push(s)),s};function Yc(r,s){var a=s.type;a in r.a&&Ys(r.a[a],s)&&(su(s),r.a[a].length==0&&(delete r.a[a],r.b--))}function Jc(r,s,a,h){for(var p=0;p<r.length;++p){var v=r[p];if(!v.wa&&v.listener==s&&v.capture==!!a&&v.Wa==h)return p}return-1}var Zc="closure_lm_"+(1e6*Math.random()|0),th={};function Oe(r,s,a,h,p){if(h&&h.once)eh(r,s,a,h,p);else if(Array.isArray(s))for(var v=0;v<s.length;v++)Oe(r,s[v],a,h,p);else a=rh(a),r&&r[yo]?Mv(r,s,a,N(h)?!!h.capture:!!h,p):Dv(r,s,a,!1,h,p)}function Dv(r,s,a,h,p,v){if(!s)throw Error("Invalid event type");var m=N(p)?!!p.capture:!!p,b=au(r);if(b||(r[Zc]=b=new uu(r)),a=b.add(s,a,h,m,v),!a.proxy)if(h=D_(),a.proxy=h,h.src=r,h.listener=a,r.addEventListener)k_||(p=m),p===void 0&&(p=!1),r.addEventListener(s.toString(),h,p);else if(r.attachEvent)r.attachEvent(Pv(s.toString()),h);else if(r.addListener&&r.removeListener)r.addListener(h);else throw Error("addEventListener and attachEvent are unavailable.")}function D_(){var r=O_,s=Rv?function(a){return r.call(s.src,s.listener,a)}:function(a){if(a=r.call(s.src,s.listener,a),!a)return a};return s}function eh(r,s,a,h,p){if(Array.isArray(s))for(var v=0;v<s.length;v++)eh(r,s[v],a,h,p);else a=rh(a),r&&r[yo]?ih(r,s,a,N(h)?!!h.capture:!!h,p):Dv(r,s,a,!0,h,p)}function Te(r,s,a,h,p){if(Array.isArray(s))for(var v=0;v<s.length;v++)Te(r,s[v],a,h,p);else h=N(h)?!!h.capture:!!h,a=rh(a),r&&r[yo]?(r=r.v,s=String(s).toString(),s in r.a&&(v=r.a[s],a=Jc(v,a,h,p),-1<a&&(su(v[a]),Array.prototype.splice.call(v,a,1),v.length==0&&(delete r.a[s],r.b--)))):r&&(r=au(r))&&(s=r.a[s.toString()],r=-1,s&&(r=Jc(s,a,h,p)),(a=-1<r?s[r]:null)&&Ov(a))}function Ov(r){if(typeof r!="number"&&r&&!r.wa){var s=r.src;if(s&&s[yo])Yc(s.v,r);else{var a=r.type,h=r.proxy;s.removeEventListener?s.removeEventListener(a,h,r.capture):s.detachEvent?s.detachEvent(Pv(
19a),h):s.addListener&&s.removeListener&&s.removeListener(h),(a=au(s))?(Yc(a,r),a.b==0&&(a.src=null,s[Zc]=null)):su(r)}}}function Pv(r){return r in th?th[r]:th[r]="on"+r}function xv(r,s,a,h){var p=!0;if((r=au(r))&&(s=r.a[s.toString()]))for(s=s.concat(),r=0;r<s.length;r++){var v=s[r];v&&v.capture==a&&!v.wa&&(v=Lv(v,h),p=p&&v!==!1)}return p}function Lv(r,s){var a=r.listener,h=r.Wa||r.src;return r.Qa&&Ov(r),a.call(h,s)}function O_(r,s){if(r.wa)return!0;if(!Rv){if(!s)t:{s=["window","event"];for(var a=f,h=0;h<s.length;h++)if(a=a[s[h]],a==null){s=null;break t}s=a}if(h=s,s=new sr(h,this),a=!0,!(0>h.keyCode||h.returnValue!=null)){t:{var p=!1;if(h.keyCode==0)try{h.keyCode=-1;break t}catch{p=!0}(p||h.returnValue==null)&&(h.returnValue=!0)}for(h=[],p=s.b;p;p=p.parentNode)h.push(p);for(r=r.type,p=h.length-1;0<=p;p--){s.b=h[p];var v=xv(h[p],r,!0,s);a=a&&v}for(p=0;p<h.length;p++)s.b=h[p],v=xv(h[p],r,!1,s),a=a&&v}return a}return Lv(r,new sr(s,this))}function au(r){return r=r[Zc],r instanceof uu?r:null}var nh="__closure_events_fn_"+(1e9*Math.random()>>>0);function rh(r){return E(r)?r:(r[nh]||(r[nh]=function(s){return r.handleEvent(s)}),r[nh])}function ee(){ou.call(this),this.v=new uu(this),this.bc=this,this.hb=null}x(ee,ou),ee.prototype[yo]=!0,ee.prototype.addEventListener=function(r,s,a,h){Oe(this,r,s,a,h)},ee.prototype.removeEventListener=function(r,s,a,h){Te(this,r,s,a,h)},ee.prototype.dispatchEvent=function(r){var s,a=this.hb;if(a)for(s=[];a;a=a.hb)s.push(a);a=this.bc;var h=r.type||r;if(typeof r=="string")r=new pe(r,a);else if(r instanceof pe)r.target=r.target||a;else{var p=r;r=new pe(h,a),le(r,p)}if(p=!0,s)for(var v=s.length-1;0<=v;v--){var m=r.b=s[v];p=cu(m,h,!0,r)&&p}if(m=r.b=a,p=cu(m,h,!0,r)&&p,p=cu(m,h,!1,r)&&p,s)for(v=0;v<s.length;v++)m=r.b=s[v],p=cu(m,h,!1,r)&&p;return p},ee.prototype.Da=function(){if(ee.bb.Da.call(this),this.v){var r=this.v,s;for(s in r.a){for(var a=r.a[s],h=0;h<a.length;h++)su(a[h]);delete r.a[s],r.b--}}this.hb=null};function Mv(r,s,a,h,p){r.v.add(String(s),a,!1,h,p)}function ih(r,s,a,h,p){r.v.add(String(s),a,!0,h,p)}function cu(r,s,a,h){if(s=r.v.a[String(s)],!s)return!0;s=s.concat();for(var p=!0,v=0;v<s.length;++v){var m=s[v];if(m&&!m.wa&&m.capture==a){var b=m.listener,R=m.Wa||m.src;m.Qa&&Yc(r.v,m),p=b.call(R,h)!==!1&&p}}return p&&!h.defaultPrevented}function oh(r,s,a){if(E(r))a&&(r=C(r,a));else if(r&&typeof r.handleEvent=="function")r=C(r.handleEvent,r);else throw Error("Invalid listener argument");return 2147483647<Number(s)?-1:f.setTimeout(r,s||0)}function si(r){var s=null;return new tt(function(a,h){s=oh(function(){a(void 0)},r),s==-1&&h(Error("Failed to schedule timer."))}).o(function(a){throw f.clearTimeout(s),a})}function Fv(r){if(r.X&&typeof r.X=="function")return r.X();if(typeof r=="string")return r.split("");if(T(r)){for(var s=[],a=r.length,h=0;h<a;h++)s.push(r[h]);return s}s=[],a=0;for(h in r)s[a++]=r[h];return s}function Uv(r){if(r.Y&&typeof r.Y=="function")return r.Y();if(!r.X||typeof r.X!="function"){if(T(r)||typeof r=="string"){var s=[];r=r.length;for(var a=0;a<r;a++)s.push(a);return s}s=[],a=0;for(var h in r)s[a++]=h;return s}}function P_(r,s){if(r.forEach&&typeof r.forEach=="function")r.forEach(s,void 0);else if(T(r)||typeof r=="string")wt(r,s,void 0);else for(var a=Uv(r),h=Fv(r),p=h.length,v=0;v<p;v++)s.call(void 0,h[v],a&&a[v],r)}function ui(r,s){this.b={},this.a=[],this.c=0;var a=arguments.length;if(1<a){if(a%2)throw Error("Uneven number of arguments");for(var h=0;h<a;h+=2)this.set(arguments[h],arguments[h+1])}else if(r)if(r instanceof ui)for(a=r.Y(),h=0;h<a.length;h++)this.set(a[h],r.get(a[h]));else for(h in r)this.set(h,r[h])}e=ui.prototype,e.X=function(){sh(this);for(var r=[],s=0;s<this.a.length;s++)r.push(this.b[this.a[s]]);return r},e.Y=function(){return sh(this),this.a.concat()},e.clear=function(){this.b={},this.c=this.a.length=0};function sh(r){if(r.c!=r.a.length){for(var s=0,a=0;s<r.a.length;){var h=r.a[s];ur(r.b,h)&&(r.a[a++]=h),s++}r.a.length=a}if(r.c!=r.a.length){var p={};for(a=s=0;s<r.a.length;)h=r.a[s],ur(p,h)||(r.a[a++]=h,p[h]=1),s++;r.a.length=a}}e.get=function(r,s){return ur(this.b,r)?this.b[r]:s},e.set=function(r,s){ur(this.b,r)||(this.c++,this.a.push(r)),this.b[r]=s},e.forEach=function(r,s){for(var a=this.Y(),h=0;h<a.length;h++){var p=a[h],v=this.get(p);r.call(s,v,p,this)}};function ur(r,s){return Object.prototype.hasOwnProperty.call(r,s)}var jv=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function x_(r,s){if(r){r=r.split("&");for(var a=0;a<r.length;a++){var h=r[a].indexOf("="),p=null;if(0<=h){var v=r[a].substring(0,h);p=r[a].substring(h+1)}else v=r[a];
19s(v,p?decodeURIComponent(p.replace(/\+/g," ")):"")}}}function Rn(r,s){this.a=this.l=this.c="",this.g=null,this.h=this.f="",this.i=!1;var a;r instanceof Rn?(this.i=s!==void 0?s:r.i,wo(this,r.c),this.l=r.l,this.a=r.a,bo(this,r.g),this.f=r.f,uh(this,Kv(r.b)),this.h=r.h):r&&(a=String(r).match(jv))?(this.i=!!s,wo(this,a[1]||"",!0),this.l=Io(a[2]||""),this.a=Io(a[3]||"",!0),bo(this,a[4]),this.f=Io(a[5]||"",!0),uh(this,a[6]||"",!0),this.h=Io(a[7]||"")):(this.i=!!s,this.b=new ar(null,this.i))}Rn.prototype.toString=function(){var r=[],s=this.c;s&&r.push(To(s,Vv,!0),":");var a=this.a;return(a||s=="file")&&(r.push("//"),(s=this.l)&&r.push(To(s,Vv,!0),"@"),r.push(encodeURIComponent(String(a)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a=this.g,a!=null&&r.push(":",String(a))),(a=this.f)&&(this.a&&a.charAt(0)!="/"&&r.push("/"),r.push(To(a,a.charAt(0)=="/"?F_:M_,!0))),(a=this.b.toString())&&r.push("?",a),(a=this.h)&&r.push("#",To(a,j_)),r.join("")},Rn.prototype.resolve=function(r){var s=new Rn(this),a=!!r.c;a?wo(s,r.c):a=!!r.l,a?s.l=r.l:a=!!r.a,a?s.a=r.a:a=r.g!=null;var h=r.f;if(a)bo(s,r.g);else if(a=!!r.f){if(h.charAt(0)!="/")if(this.a&&!this.f)h="/"+h;else{var p=s.f.lastIndexOf("/");p!=-1&&(h=s.f.substr(0,p+1)+h)}if(p=h,p==".."||p==".")h="";else if(lt(p,"./")||lt(p,"/.")){h=p.lastIndexOf("/",0)==0,p=p.split("/");for(var v=[],m=0;m<p.length;){var b=p[m++];b=="."?h&&m==p.length&&v.push(""):b==".."?((1<v.length||v.length==1&&v[0]!="")&&v.pop(),h&&m==p.length&&v.push("")):(v.push(b),h=!0)}h=v.join("/")}else h=p}return a?s.f=h:a=r.b.toString()!=="",a?uh(s,Kv(r.b)):a=!!r.h,a&&(s.h=r.h),s};function wo(r,s,a){r.c=a?Io(s,!0):s,r.c&&(r.c=r.c.replace(/:$/,""))}function bo(r,s){if(s){if(s=Number(s),isNaN(s)||0>s)throw Error("Bad port number "+s);r.g=s}else r.g=null}function uh(r,s,a){s instanceof ar?(r.b=s,V_(r.b,r.i)):(a||(s=To(s,U_)),r.b=new ar(s,r.i))}function Et(r,s,a){r.b.set(s,a)}function Pe(r,s){return r.b.get(s)}function de(r){return r instanceof Rn?new Rn(r):new Rn(r,void 0)}function hu(r,s,a,h){var p=new Rn(null,void 0);return r&&wo(p,r),s&&(p.a=s),a&&bo(p,a),h&&(p.f=h),p}function Io(r,s){return r?s?decodeURI(r.replace(/%25/g,"%2525")):decodeURIComponent(r):""}function To(r,s,a){return typeof r=="string"?(r=encodeURI(r).replace(s,L_),a&&(r=r.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),r):null}function L_(r){return r=r.charCodeAt(0),"%"+(r>>4&15).toString(16)+(r&15).toString(16)}var Vv=/[#\/\?@]/g,M_=/[#\?:]/g,F_=/[#\?]/g,U_=/[#\?@]/g,j_=/#/g;function ar(r,s){this.b=this.a=null,this.c=r||null,this.f=!!s}function Dn(r){r.a||(r.a=new ui,r.b=0,r.c&&x_(r.c,function(s,a){r.add(decodeURIComponent(s.replace(/\+/g," ")),a)}))}function qv(r){var s=Uv(r);if(typeof s>"u")throw Error("Keys are undefined");var a=new ar(null,void 0);r=Fv(r);for(var h=0;h<s.length;h++){var p=s[h],v=r[h];Array.isArray(v)?Bv(a,p,v):a.add(p,v)}return a}e=ar.prototype,e.add=function(r,s){Dn(this),this.c=null,r=ai(this,r);var a=this.a.get(r);return a||this.a.set(r,a=[]),a.push(s),this.b+=1,this};function Je(r,s){Dn(r),s=ai(r,s),ur(r.a.b,s)&&(r.c=null,r.b-=r.a.get(s).length,r=r.a,ur(r.b,s)&&(delete r.b[s],r.c--,r.a.length>2*r.c&&sh(r)))}e.clear=function(){this.a=this.c=null,this.b=0};function ah(r,s){return Dn(r),s=ai(r,s),ur(r.a.b,s)}e.forEach=function(r,s){Dn(this),this.a.forEach(function(a,h){wt(a,function(p){r.call(s,p,h,this)},this)},this)},e.Y=function(){Dn(this);for(var r=this.a.X(),s=this.a.Y(),a=[],h=0;h<s.length;h++)for(var p=r[h],v=0;v<p.length;v++)a.push(s[h]);return a},e.X=function(r){Dn(this);var s=[];if(typeof r=="string")ah(this,r)&&(s=Fc(s,this.a.get(ai(this,r))));else{r=this.a.X();for(var a=0;a<r.length;a++)s=Fc(s,r[a])}return s},e.set=function(r,s){return Dn(this),this.c=null,r=ai(this,r),ah(this,r)&&(this.b-=this.a.get(r).length),this.a.set(r,[s]),this.b+=1,this},e.get=function(r,s){return r?(r=this.X(r),0<r.length?String(r[0]):s):s};function Bv(r,s,a){Je(r,s),0<a.length&&(r.c=null,r.a.set(ai(r,s),nr(a)),r.b+=a.length)}e.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var r=[],s=this.a.Y(),a=0;a<s.length;a++){var h=s[a],p=encodeURIComponent(String(h));h=this.X(h);for(var v=0;v<h.length;v++){var m=p;h[v]!==""&&(m+="="+encodeURIComponent(String(h[v]))),r.push(m)}}return this.c=r.join("&")};function Kv(r){var s=new ar;return s.c=r.c,r.a&&(s.a=new ui(r.a),s.b=r.b),s}function ai(r,s){return s=String(s),r.f&&(s=s.toLowerCase()),s}function V_(r,s){s&&!r.f&&(Dn(r),r.c=null,r.a.forEach(function(a,h){var p=h.toLowerCase();h!=p&&(Je(this,h),Bv(this,p,a))},r)),r.f=s}function Hv(r){var s=[];return ch(new q_,r,s),s.join("")}function q_(){}function ch(r,s,a){if(s==null)a.push("null");else{if(typeof s=="object"){if(Array.isArray(s)){var h=s;s=h.length,a.push("[");for(var p="",v=0;v<s;v++)a.push(p),ch(r,h[v],a),p=",";a.push("]");return}if(s instanceof String||s instanceof Number||s instanceof Boolean)s=s.valueOf();else{a.push("{"),p="";for(h in s)Object.prototype.hasOwnProperty.call(s,h)&&(v=s[h],typeof v!="function"&&(a.push(p),zv(h,a),a.push(":"),ch(r,v,a),p=","));a.push("}");return}}switch(typeof s){case"string":zv(s,a);break;case"number":a.push(isFinite(s)&&!isNaN(s)?String(s):"null");break;case"boolean":a.push(String(s));break;case"function":a.push("null");break;default:throw Error("Unknown type: "+typeof s)}}}var Gv={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\u000b"},B_=/\uffff/.test("ï¿¿")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function zv(r,s){s.push('"',r.replace(B_,function(a){var h=Gv[a];
19return h||(h="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Gv[a]=h),h}),'"')}function hh(){var r=Vt();return Ve&&!!Cn&&Cn==11||/Edge\/\d+/.test(r)}function _o(){return f.window&&f.window.location.href||self&&self.location&&self.location.href||""}function $v(r,s){s=s||f.window;var a="about:blank";r&&(a=tu(ev(r)||rv)),s.location.href=a}function Wv(r,s){var a=[],h;for(h in r)h in s?typeof r[h]!=typeof s[h]?a.push(h):typeof r[h]=="object"&&r[h]!=null&&s[h]!=null?0<Wv(r[h],s[h]).length&&a.push(h):r[h]!==s[h]&&a.push(h):a.push(h);for(h in s)h in r||a.push(h);return a}function K_(){var r=Vt();return r=ci(r)!=Jv?null:(r=r.match(/\sChrome\/(\d+)/i))&&r.length==2?parseInt(r[1],10):null,r&&30>r?!1:!Ve||!Cn||9<Cn}function Xv(r){return r=(r||Vt()).toLowerCase(),!!(r.match(/android/)||r.match(/webos/)||r.match(/iphone|ipad|ipod/)||r.match(/blackberry/)||r.match(/windows phone/)||r.match(/iemobile/))}function cr(r){r=r||f.window;try{r.close()}catch{}}function Qv(r,s,a){var h=Math.floor(1e9*Math.random()).toString();s=s||500,a=a||600;var p=(window.screen.availHeight-a)/2,v=(window.screen.availWidth-s)/2;s={width:s,height:a,top:0<p?p:0,left:0<v?v:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},a=Vt().toLowerCase(),h&&(s.target=h,lt(a,"crios/")&&(s.target="_blank")),ci(Vt())==ph&&(r=r||"http://localhost",s.scrollbars=!0),a=r||"",(r=s)||(r={}),h=window,s=a instanceof fe?a:ev(typeof a.href<"u"?a.href:String(a))||rv,a=r.target||a.target,p=[];for(m in r)switch(m){case"width":case"height":case"top":case"left":p.push(m+"="+r[m]);break;case"target":case"noopener":case"noreferrer":break;default:p.push(m+"="+(r[m]?1:0))}var m=p.join(",");if((Pt("iPhone")&&!Pt("iPod")&&!Pt("iPad")||Pt("iPad")||Pt("iPod"))&&h.navigator&&h.navigator.standalone&&a&&a!="_self"?(m=nu(document,"A"),Xd(m,"HTMLAnchorElement"),s=s instanceof fe?s:nv(s),m.href=tu(s),m.setAttribute("target",a),r.noreferrer&&m.setAttribute("rel","noreferrer"),r=document.createEvent("MouseEvent"),r.initMouseEvent("click",!0,!0,h,1),m.dispatchEvent(r),m={}):r.noreferrer?(m=ov("",h,a,m),r=tu(s),m&&(p_&<(r,";")&&(r="'"+r.replace(/'/g,"%27")+"'"),m.opener=null,r='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+qc(r)+'">',r=(h=Yd())?h.createHTML(r):r,r=new ii(r,null,iv),h=m.document)&&(h.write(c_(r)),h.close())):(m=ov(s,h,a,m))&&r.noopener&&(m.opener=null),m)try{m.focus()}catch{}return m}function H_(r){return new tt(function(s){function a(){si(2e3).then(function(){if(!r||r.closed)s();else return a()})}return a()})}var G_=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,z_=/^[^@]+@[^@]+$/;function lu(){var r=null;return new tt(function(s){f.document.readyState=="complete"?s():(r=function(){s()},eh(window,"load",r))}).o(function(s){throw Te(window,"load",r),s})}function $_(){return lh(void 0)?lu().then(function(){return new tt(function(r,s){var a=f.document,h=setTimeout(function(){s(Error("Cordova framework is not ready."))},1e3);a.addEventListener("deviceready",function(){clearTimeout(h),r()},!1)})}):vt(Error("Cordova must run in an Android or iOS file scheme."))}function lh(r){return r=r||Vt(),!(li()!=="file:"&&li()!=="ionic:"||!r.toLowerCase().match(/iphone|ipad|ipod|android/))}function fh(){var r=f.window;try{return!(!r||r==r.top)}catch{return!1}}function qe(){return typeof f.WorkerGlobalScope<"u"&&typeof f.importScripts=="function"}function Ze(){return H.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":H.INTERNAL.hasOwnProperty("node")?"Node":qe()?"Worker":"Browser"}function Yv(){var r=Ze();return r==="ReactNative"||r==="Node"}function W_(){for(var r=50,s=[];0<r;)s.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),r--;return s.join("")}var ph="Firefox",Jv="Chrome";function ci(r){var s=r.toLowerCase();if(lt(s,"opera/")||lt(s,"opr/")||lt(s,"opios/"))return"Opera";if(lt(s,"iemobile"))return"IEMobile";if(lt(s,"msie")||lt(s,"trident/"))return"IE";if(lt(s,"edge/"))return"Edge";if(lt(s,"firefox/"))return ph;if(lt(s,"silk/"))return"Silk";if(lt(s,"blackberry"))return"Blackberry";if(lt(s,"webos"))return"Webos";if(!lt(s,"safari/")||lt(s,"chrome/")||lt(s,"crios/")||lt(s,"android"))if(!lt(s,"chrome/")&&!lt(s,"crios/")||lt(s,"edge/")){if(lt(s,"android"))return"Android";if((r=r.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&r.length==2)return r[1]}else return Jv;else return"Safari";return"Other"}var Zv={md:"FirebaseCore-web",od:"FirebaseUI-web"};
19function hi(r,s){s=s||[];var a=[],h={},p;for(p in Zv)h[Zv[p]]=!0;for(p=0;p<s.length;p++)typeof h[s[p]]<"u"&&(delete h[s[p]],a.push(s[p]));return a.sort(),s=a,s.length||(s=["FirebaseCore-web"]),a=Ze(),a==="Browser"?(h=Vt(),a=ci(h)):a==="Worker"&&(h=Vt(),a=ci(h)+"-"+a),a+"/JsCore/"+r+"/"+s.join(",")}function Vt(){return f.navigator&&f.navigator.userAgent||""}function gt(r,s){r=r.split("."),s=s||f;for(var a=0;a<r.length&&typeof s=="object"&&s!=null;a++)s=s[r[a]];return a!=r.length&&(s=void 0),s}function dh(){try{var r=f.localStorage,s=lr();if(r)return r.setItem(s,"1"),r.removeItem(s),hh()?!!f.indexedDB:!0}catch{return qe()&&!!f.indexedDB}return!1}function hr(){return(fu()||li()==="chrome-extension:"||lh())&&!Yv()&&dh()&&!qe()}function fu(){return li()==="http:"||li()==="https:"}function li(){return f.location&&f.location.protocol||null}function Eo(r){return r=r||Vt(),!(Xv(r)||ci(r)==ph)}function So(r){return typeof r>"u"?null:Hv(r)}function tg(r){var s={},a;for(a in r)r.hasOwnProperty(a)&&r[a]!==null&&r[a]!==void 0&&(s[a]=r[a]);return s}function fi(r){if(r!==null)return JSON.parse(r)}function lr(r){return r||Math.floor(1e9*Math.random()).toString()}function eg(r){return r=r||Vt(),!(ci(r)=="Safari"||r.toLowerCase().match(/iphone|ipad|ipod/))}function ng(){var r=f.___jsl;if(r&&r.H){for(var s in r.H)if(r.H[s].r=r.H[s].r||[],r.H[s].L=r.H[s].L||[],r.H[s].r=r.H[s].L.concat(),r.CP)for(var a=0;a<r.CP.length;a++)r.CP[a]=null}}function On(r,s){if(r>s)throw Error("Short delay should be less than long delay!");this.a=r,this.c=s,r=Vt(),s=Ze(),this.b=Xv(r)||s==="ReactNative"}On.prototype.get=function(){var r=f.navigator;return!(r&&typeof r.onLine=="boolean"&&(fu()||li()==="chrome-extension:"||typeof r.connection<"u"))||r.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};function vh(){var r=f.document;return r&&typeof r.visibilityState<"u"?r.visibilityState=="visible":!0}function X_(){var r=f.document,s=null;return vh()||!r?z():new tt(function(a){s=function(){vh()&&(r.removeEventListener("visibilitychange",s,!1),a())},r.addEventListener("visibilitychange",s,!1)}).o(function(a){throw r.removeEventListener("visibilitychange",s,!1),a})}function Ao(r){try{var s=new Date(parseInt(r,10));if(!isNaN(s.getTime())&&!/[^0-9]/.test(r))return s.toUTCString()}catch{}return null}function rg(){return!(!gt("fireauth.oauthhelper",f)&&!gt("fireauth.iframe",f))}function Q_(){var r=f.navigator;return r&&r.serviceWorker&&r.serviceWorker.controller||null}function Y_(){var r=f.navigator;return r&&r.serviceWorker?z().then(function(){return r.serviceWorker.ready}).then(function(s){return s.active||null}).o(function(){return null}):z(null)}var ig={};function gh(r){ig[r]||(ig[r]=!0,typeof console<"u"&&typeof console.warn=="function"&&console.warn(r))}var mh;try{var yh={};Object.defineProperty(yh,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(yh,"abcd",{configurable:!0,enumerable:!0,value:2}),mh=yh.abcd==2}catch{mh=!1}function q(r,s,a){mh?Object.defineProperty(r,s,{configurable:!0,enumerable:!0,value:a}):r[s]=a}function ne(r,s){if(s)for(var a in s)s.hasOwnProperty(a)&&q(r,a,s[a])}function tn(r){var s={};return ne(s,r),s}function J_(r){var s={},a;for(a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);return s}function Z_(r,s){if(!s||!s.length)return!0;if(!r)return!1;for(var a=0;a<s.length;a++){var h=r[s[a]];if(h==null||h==="")return!1}return!0}function wh(r){var s=r;if(typeof r=="object"&&r!=null){s="length"in r?[]:{};for(var a in r)q(s,a,wh(r[a]))}return s}function bh(r){var s=r&&(r[Eh]?"phone":null);if(s&&r&&r[_h]){q(this,"uid",r[_h]),q(this,"displayName",r[og]||null);var a=null;r[Th]&&(a=new Date(r[Th]).toUTCString()),q(this,"enrollmentTime",a),q(this,"factorId",s)}else throw new _("internal-error","Internal assert: invalid MultiFactorInfo object")}bh.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};function Ih(r){try{var s=new ko(r)}catch{s=null}return s}var og="displayName",Th="enrolledAt",_h="mfaEnrollmentId",Eh="phoneInfo";function ko(r){bh.call(this,r),q(this,"phoneNumber",r[Eh])}x(ko,bh),ko.prototype.w=function(){var r=ko.bb.w.call(this);return r.phoneNumber=this.phoneNumber,r};function tE(r){var s={},a=r[eE],h=r[rE],p=r[iE];if(r=Ih(r[nE]),!p||p!=pu&&p!=No&&!a||p==No&&!h||p==Sh&&!r)throw Error("Invalid checkActionCode response!");p==No?(s[ug]=a||null,s[ag]=a||null,s[sg]=h):(s[ug]=h||null,s[ag]=h||null,s[sg]=a||null),s[oE]=r||null,q(this,uE,p),q(this,sE,wh(s))}var Sh="REVERT_SECOND_FACTOR_ADDITION",pu="EMAIL_SIGNIN",No="VERIFY_AND_CHANGE_EMAIL",eE="email",nE="mfaInfo",rE="newEmail",iE="requestType",sg="email",ug="fromEmail",oE="multiFactorInfo",ag="previousEmail",sE="data",uE="operation";function Ah(r){r=de(r);var s=Pe(r,cg)||null,a=Pe(r,hg)||null,h=Pe(r,lg)||null;if(h=h&&lE[h]||null,!s||!a||!h)throw new _("argument-error",cg+", "+hg+"and "+lg+" are required in a valid action code URL.");ne(this,{apiKey:s,operation:h,code:a,continueUrl:Pe(r,aE)||null,languageCode:Pe(r,cE)||null,tenantId:Pe(r,hE)||null})}var cg="apiKey",hg="oobCode",aE="continueUrl",cE="languageCode",lg="mode",hE="tenantId",lE={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:Sh,signIn:pu,verifyAndChangeEmail:No,verifyEmail:"VERIFY_EMAIL"};function fg(r){try{return new Ah(r)}catch{return null}}function du(r){var s=r[fE];if(typeof s>"u")throw new _("missing-continue-uri");
19if(typeof s!="string"||typeof s=="string"&&!s.length)throw new _("invalid-continue-uri");this.h=s,this.b=this.a=null,this.g=!1;var a=r[pg];if(a&&typeof a=="object"){s=a[yg];var h=a[gg];if(a=a[mg],typeof s=="string"&&s.length){if(this.a=s,typeof h<"u"&&typeof h!="boolean")throw new _("argument-error",gg+" property must be a boolean when specified.");if(this.g=!!h,typeof a<"u"&&(typeof a!="string"||typeof a=="string"&&!a.length))throw new _("argument-error",mg+" property must be a non empty string when specified.");this.b=a||null}else{if(typeof s<"u")throw new _("argument-error",yg+" property must be a non empty string when specified.");if(typeof h<"u"||typeof a<"u")throw new _("missing-android-pkg-name")}}else if(typeof a<"u")throw new _("argument-error",pg+" property must be a non null object when specified.");if(this.f=null,(s=r[vg])&&typeof s=="object"){if(s=s[wg],typeof s=="string"&&s.length)this.f=s;else if(typeof s<"u")throw new _("argument-error",wg+" property must be a non empty string when specified.")}else if(typeof s<"u")throw new _("argument-error",vg+" property must be a non null object when specified.");if(s=r[kh],typeof s<"u"&&typeof s!="boolean")throw new _("argument-error",kh+" property must be a boolean when specified.");if(this.c=!!s,r=r[dg],typeof r<"u"&&(typeof r!="string"||typeof r=="string"&&!r.length))throw new _("argument-error",dg+" property must be a non empty string when specified.");this.i=r||null}var pg="android",dg="dynamicLinkDomain",kh="handleCodeInApp",vg="iOS",fE="url",gg="installApp",mg="minimumVersion",yg="packageName",wg="bundleId";function vu(r){var s={};s.continueUrl=r.h,s.canHandleCodeInApp=r.c,(s.androidPackageName=r.a)&&(s.androidMinimumVersion=r.b,s.androidInstallApp=r.g),s.iOSBundleId=r.f,s.dynamicLinkDomain=r.i;for(var a in s)s[a]===null&&delete s[a];return s}function pE(r){return Qs(r,function(s){return s=s.toString(16),1<s.length?s:"0"+s}).join("")}var Co=null;function dE(r){var s=[];return vE(r,function(a){s.push(a)}),s}function vE(r,s){function a(R){for(;h<r.length;){var O=r.charAt(h++),X=Co[O];if(X!=null)return X;if(!/^[\s\xa0]*$/.test(O))throw Error("Unknown base64 encoding at char: "+O)}return R}gE();for(var h=0;;){var p=a(-1),v=a(0),m=a(64),b=a(64);if(b===64&&p===-1)break;s(p<<2|v>>4),m!=64&&(s(v<<4&240|m>>2),b!=64&&s(m<<6&192|b))}}function gE(){if(!Co){Co={};for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),s=["+/=","+/","-_=","-_.","-_"],a=0;5>a;a++)for(var h=r.concat(s[a].split("")),p=0;p<h.length;p++){var v=h[p];Co[v]===void 0&&(Co[v]=p)}}}function gu(r){var s=bg(r);if(!(s&&s.sub&&s.iss&&s.aud&&s.exp))throw Error("Invalid JWT");this.h=r,this.a=s.exp,this.i=s.sub,r=Date.now()/1e3,this.g=s.iat||(r>this.a?this.a:r),this.b=s.provider_id||s.firebase&&s.firebase.sign_in_provider||null,this.f=s.firebase&&s.firebase.tenant||null,this.c=!!s.is_anonymous||this.b=="anonymous"}gu.prototype.T=function(){return this.f},gu.prototype.l=function(){return this.c},gu.prototype.toString=function(){return this.h};function mu(r){try{return new gu(r)}catch{return null}}function bg(r){if(!r||(r=r.split("."),r.length!=3))return null;r=r[1];for(var s=(4-r.length%4)%4,a=0;a<s;a++)r+=".";try{var h=dE(r);for(r=[],a=s=0;s<h.length;){var p=h[s++];if(128>p)r[a++]=String.fromCharCode(p);else if(191<p&&224>p){var v=h[s++];r[a++]=String.fromCharCode((p&31)<<6|v&63)}else if(239<p&&365>p){v=h[s++];var m=h[s++],b=h[s++],R=((p&7)<<18|(v&63)<<12|(m&63)<<6|b&63)-65536;r[a++]=String.fromCharCode(55296+(R>>10)),r[a++]=String.fromCharCode(56320+(R&1023))}else v=h[s++],m=h[s++],r[a++]=String.fromCharCode((p&15)<<12|(v&63)<<6|m&63)}return JSON.parse(r.join(""))}catch{}return null}var Ig="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),yu=["client_id","response_type","scope","redirect_uri","state"],Nh={nd:{Ja:"locale",va:700,ua:600,fa:"facebook.com",Ya:yu},pd:{Ja:null,va:500,ua:750,fa:"github.com",Ya:yu},qd:{Ja:"hl",va:515,ua:680,fa:"google.com",Ya:yu},wd:{Ja:"lang",va:485,ua:705,fa:"twitter.com",Ya:Ig},kd:{Ja:"locale",va:640,ua:600,fa:"apple.com",Ya:[]}};function Ch(r){for(var s in Nh)if(Nh[s].fa==r)return Nh[s];return null}function Tg(r){var s={};s["facebook.com"]=Eg,s["google.com"]=Ag,s["github.com"]=Sg,s["twitter.com"]=kg;var a=r&&r[_g];try{if(a)return s[a]?new s[a](r):new en(r);if(typeof r[Rh]<"u")return new Dh(r)}catch{}return null}var Rh="idToken",_g="providerId";function Dh(r){var s=r[_g];if(!s&&r[Rh]){var a=mu(r[Rh]);a&&a.b&&(s=a.b)}if(!s)throw Error("Invalid additional user info!");(s=="anonymous"||s=="custom")&&(s=null),a=!1,typeof r.isNewUser<"u"?a=!!r.isNewUser:r.kind==="identitytoolkit#SignupNewUserResponse"&&(a=!0),q(this,"providerId",s),q(this,"isNewUser",a)}
19function en(r){Dh.call(this,r),r=fi(r.rawUserInfo||"{}"),q(this,"profile",wh(r||{}))}x(en,Dh);function Eg(r){if(en.call(this,r),this.providerId!="facebook.com")throw Error("Invalid provider ID!")}x(Eg,en);function Sg(r){if(en.call(this,r),this.providerId!="github.com")throw Error("Invalid provider ID!");q(this,"username",this.profile&&this.profile.login||null)}x(Sg,en);function Ag(r){if(en.call(this,r),this.providerId!="google.com")throw Error("Invalid provider ID!")}x(Ag,en);function kg(r){if(en.call(this,r),this.providerId!="twitter.com")throw Error("Invalid provider ID!");q(this,"username",r.screenName||null)}x(kg,en);function Ng(r){var s=de(r),a=Pe(s,"link"),h=Pe(de(a),"link");return s=Pe(s,"deep_link_id"),Pe(de(s),"link")||s||h||a||r}function wu(r,s){if(!r&&!s)throw new _("internal-error","Internal assert: no raw session string available");if(r&&s)throw new _("internal-error","Internal assert: unable to determine the session type");this.a=r||null,this.b=s||null,this.type=this.a?Ro:bu}var Ro="enroll",bu="signin";wu.prototype.Ha=function(){return this.a?z(this.a):z(this.b)},wu.prototype.w=function(){return this.type==Ro?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}};function pi(){}pi.prototype.ka=function(){},pi.prototype.b=function(){},pi.prototype.c=function(){},pi.prototype.w=function(){};function di(r,s){return r.then(function(a){if(a[He]){var h=mu(a[He]);if(!h||s!=h.i)throw new _("user-mismatch");return a}throw new _("user-mismatch")}).o(function(a){throw a&&a.code&&a.code==yt+"user-not-found"?new _("user-mismatch"):a})}function fr(r,s){if(s)this.a=s;else throw new _("internal-error","failed to construct a credential");q(this,"providerId",r),q(this,"signInMethod",r)}fr.prototype.ka=function(r){return el(r,Oh(this))},fr.prototype.b=function(r,s){var a=Oh(this);return a.idToken=s,nl(r,a)},fr.prototype.c=function(r,s){return di(rl(r,Oh(this)),s)};function Oh(r){return{pendingToken:r.a,requestUri:"http://localhost"}}fr.prototype.w=function(){return{providerId:this.providerId,sign
19InMethod:this.signInMethod,pendingToken:this.a}};function mE(r){if(r&&r.providerId&&r.signInMethod&&r.providerId.indexOf("saml.")==0&&r.pendingToken)try{return new fr(r.providerId,r.pendingToken)}catch{}return null}function vn(r,s,a){if(this.a=null,s.idToken||s.accessToken)s.idToken&&q(this,"idToken",s.idToken),s.accessToken&&q(this,"accessToken",s.accessToken),s.nonce&&!s.pendingToken&&q(this,"nonce",s.nonce),s.pendingToken&&(this.a=s.pendingToken);else if(s.oauthToken&&s.oauthTokenSecret)q(this,"accessToken",s.oauthToken),q(this,"secret",s.oauthTokenSecret);else throw new _("internal-error","failed to construct a credential");q(this,"providerId",r),q(this,"signInMethod",a)}vn.prototype.ka=function(r){return el(r,Ph(this))},vn.prototype.b=function(r,s){var a=Ph(this);return a.idToken=s,nl(r,a)},vn.prototype.c=function(r,s){var a=Ph(this);return di(rl(r,a),s)};function Ph(r){var s={};return r.idToken&&(s.id_token=r.idToken),r.accessToken&&(s.access_token=r.accessToken),r.secret&&(s.oauth_token_secret=r.secret),s.providerId=r.providerId,r.nonce&&!r.a&&(s.nonce=r.nonce),s={postBody:qv(s).toString(),requestUri:"http://localhost"},r.a&&(delete s.postBody,s.pendingToken=r.a),s}vn.prototype.w=function(){var r={providerId:this.providerId,sign
19InMethod:this.signInMethod};return this.idToken&&(r.oauthIdToken=this.idToken),this.accessToken&&(r.oauthAccessToken=this.accessToken),this.secret&&(r.oauthTokenSecret=this.secret),this.nonce&&(r.nonce=this.nonce),this.a&&(r.pendingToken=this.a),r};function yE(r){if(r&&r.providerId&&r.signInMethod){var s={idToken:r.oauthIdToken,accessToken:r.oauthTokenSecret?null:r.oauthAccessToken,oauthTokenSecret:r.oauthTokenSecret,oauthToken:r.oauthTokenSecret&&r.oauthAccessToken,nonce:r.nonce,pendingToken:r.pendingToken};try{return new vn(r.providerId,s,r.signInMethod)}catch{}}return null}function pr(r,s){this.Qc=s||[],ne(this,{providerId:r,isOAuthProvider:!0}),this.Jb={},this.qb=(Ch(r)||{}).Ja||null,this.pb=null}pr.prototype.Ka=function(r){return this.Jb=Nn(r),this};function Cg(r){if(typeof r!="string"||r.indexOf("saml.")!=0)throw new _("argument-error",'SAML provider IDs must be prefixed with "saml."');pr.call(this,r,[])}x(Cg,pr);function _e(r){pr.call(this,r,yu),this.a=[]}x(_e,pr),_e.prototype.Ca=function(r){return pn(this.a,r)||this.a.push(r),this},_e.prototype.Rb=function(){return nr(this.a)},_e.prototype.credential=function(r,s){var a;if(N(r)?a={idToken:r.idToken||null,accessToken:r.accessToken||null,nonce:r.rawNonce||null}:a={idToken:r||null,accessToken:s||null},!a.idToken&&!a.accessToken)throw new _("argument-error","credential failed: must provide the ID token and/or the access token.");return new vn(this.providerId,a,this.providerId)};function dr(){_e.call(this,"facebook.com")}x(dr,_e),q(dr,"PROVIDER_ID","facebook.com"),q(dr,"FACEBOOK_SIGN_IN_METHOD","facebook.com");function Rg(r){if(!r)throw new _("argument-error","credential failed: expected 1 argument (the OAuth access token).");var s=r;return N(r)&&(s=r.accessToken),new dr().credential({accessToken:s})}function vr(){_e.call(this,"github.com")}x(vr,_e),q(vr,"PROVIDER_ID","github.com"),q(vr,"GITHUB_SIGN_IN_METHOD","github.com");function Dg(r){if(!r)throw new _("argument-error","credential failed: expected 1 argument (the OAuth access token).");var s=r;return N(r)&&(s=r.accessToken),new vr().credential({accessToken:s})}function gr(){_e.call(this,"google.com"),this.Ca("profile")}x(gr,_e),q(gr,"PROVIDER_ID","google.com"),q(gr,"GOOGLE_SIGN_IN_METHOD","google.com");function Og(r,s){var a=r;return N(r)&&(a=r.idToken,s=r.accessToken),new gr().credential({idToken:a,accessToken:s})}function vi(){pr.call(this,"twitter.com",Ig)}x(vi,pr),q(vi,"PROVIDER_ID","twitter.com"),q(vi,"TWITTER_SIGN_IN_METHOD","twitter.com");function Pg(r,s){var a=r;if(N(a)||(a={oauthToken:r,oauthTokenSecret:s}),!a.oauthToken||!a.oauthTokenSecret)throw new _("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new vn("twitter.com",a,"twitter.com")}function Pn(r,s,a){this.a=r,this.f=s,q(this,"providerId","password"),q(this,"signInMethod",a===xe.EMAIL_LINK_SIGN_IN_METHOD?xe.EMAIL_LINK_SIGN_IN_METHOD:xe.EMAIL_PASSWORD_SIGN_IN_METHOD)}Pn.prototype.ka=function(r){return this.signInMethod==xe.EMAIL_LINK_SIGN_IN_METHOD?et(r,nS,{email:this.a,oobCode:this.f}):et(r,um,{email:this.a,password:this.f})},Pn.prototype.b=function(r,s){return this.signInMethod==xe.EMAIL_LINK_SIGN_IN_METHOD?et(r,rS,{idToken:s,email:this.a,oobCode:this.f}):et(r,sm,{idToken:s,email:this.a,password:this.f})},Pn.prototype.c=function(r,s){return di(this.ka(r),s)},Pn.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}};function wE(r){return r&&r.email&&r.password?new Pn(r.email,r.password,r.signInMethod):null}function xe(){ne(this,{providerId:"password",isOAuthProvider:!1})}function xg(r,s){if(s=xh(s),!s)throw new _("argument-error","Invalid email link!");return new Pn(r,s.code,xe.EMAIL_LINK_SIGN_IN_METHOD)}function xh(r){return r=Ng(r),(r=fg(r))&&r.operation===pu?r:null}ne(xe,{PROVIDER_ID:"password"}),ne(xe,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),ne(xe,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"});function xn(r){if(!(r.fb&&r.eb||r.La&&r.ea))throw new _("internal-error");this.a=r,q(this,"providerId","phone"),this.fa="phone",q(this,"signInMethod","phone")}xn.prototype.ka=function(r){return r.gb(Do(this))},xn.prototype.b=function(r,s){var a=Do(this);return a.idToken=s,et(r,_S,a)},xn.prototype.c=function(r,s){var a=Do(this);return a.operation="REAUTH",r=et(r,ES,a),di(r,s)},xn.prototype.w=function(){var r={providerId:"phone"};return this.a.fb&&(r.verificationId=this.a.fb),this.a.eb&&(r.verificationCode=this.a.eb),this.a.La&&(r.temporaryProof=this.a.La),this.a.ea&&(r.phoneNumber=this.a.ea),r};function bE(r){if(r&&r.providerId==="phone"&&(r.verificationId&&r.verificationCode||r.temporaryProof&&r.phoneNumber)){var s={};return wt(["verificationId","verificationCode","temporaryProof","phoneNumber"],function(a){r[a]&&(s[a]=r[a])}),new xn(s)}return null}function Do(r){return r.a.La&&r.a.ea?{temporaryProof:r.a.La,phoneNumber:r.a.ea}:{sessionInfo:r.a.fb,code:r.a.eb}}function gn(r){try{this.a=r||H.auth()}catch{throw new _("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}ne(this,{providerId:"phone",isOAuthProvider:!1})}gn.prototype.gb=function(r,s){var a=this.a.a;return z(s.verify()).then(function(h){if(typeof h!="string")throw new _("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");if(s.type==="recaptcha"){var p=N(r)?r.session:null,v=N(r)?r.phoneNumber:r,m;return p&&p.type==Ro?m=p.Ha().then(function(b){return $E(a,{idToken:b,phoneEnrollmentInfo:{phoneNumber:v,recaptchaToken:h}})}):p&&p.type==bu?m=p.Ha().then(function(b){return WE(a,{mfaPendingCredential:b,mfaEnrollmentId:r.multiFactorHint&&r.multiFactorHint.uid||r.multiFactorUid,phoneSignInInfo:{recaptchaToken:h}})}):m=zE(a,{phoneNumber:v,recaptchaToken:h}),m.then(function(b){return typeof s.reset=="function"&&s.reset(),b},function(b){throw typeof s.reset=="function"&&s.reset(),b})}else throw new _("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')})};function Lg(r,s){if(!r)throw new _("missing-verification-id");if(!s)throw new _("missing-verification-code");return new xn({fb:r,eb:s})}ne(gn,{PROVIDER_ID:"phone"}
19),ne(gn,{PHONE_SIGN_IN_METHOD:"phone"});function Lh(r){if(r.temporaryProof&&r.phoneNumber)return new xn({La:r.temporaryProof,ea:r.phoneNumber});var s=r&&r.providerId;if(!s||s==="password")return null;var a=r&&r.oauthAccessToken,h=r&&r.oauthTokenSecret,p=r&&r.nonce,v=r&&r.oauthIdToken,m=r&&r.pendingToken;try{switch(s){case"google.com":return Og(v,a);case"facebook.com":return Rg(a);case"github.com":return Dg(a);case"twitter.com":return Pg(a,h);default:return a||h||v||m?m?s.indexOf("saml.")==0?new fr(s,m):new vn(s,{pendingToken:m,idToken:r.oauthIdToken,accessToken:r.oauthAccessToken},s):new _e(s).credential({idToken:v,accessToken:a,rawNonce:p}):null}}catch{return null}}function Mh(r){if(!r.isOAuthProvider)throw new _("invalid-oauth-provider")}function Be(r,s,a,h,p,v,m){if(this.c=r,this.b=s||null,this.g=a||null,this.f=h||null,this.i=v||null,this.h=m||null,this.a=p||null,this.g||this.a){if(this.g&&this.a)throw new _("invalid-auth-event");if(this.g&&!this.f)throw new _("invalid-auth-event")}else throw new _("invalid-auth-event")}Be.prototype.getUid=function(){var r=[];return r.push(this.c),this.b&&r.push(this.b),this.f&&r.push(this.f),this.h&&r.push(this.h),r.join("-")},Be.prototype.T=function(){return this.h},Be.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};function Mg(r){return r=r||{},r.type?new Be(r.type,r.eventId,r.urlResponse,r.sessionId,r.error&&te(r.error),r.postBody,r.tenantId):null}function IE(){this.b=null,this.a=[]}var Fh=null;function TE(r){var s=Fh;s.a.push(r),s.b||(s.b=function(a){for(var h=0;h<s.a.length;h++)s.a[h](a)},r=gt("universalLinks.subscribe",f),typeof r=="function"&&r(null,s.b))}function Uh(r){var s="unauthorized-domain",a=void 0,h=de(r);r=h.a,h=h.c,h=="chrome-extension"?a=sv("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",r):h=="http"||h=="https"?a=sv("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",r):s="operation-not-supported-in-this-environment",_.call(this,s,a)}x(Uh,_);function Oo(r,s,a){_.call(this,r,a),r=s||{},r.Kb&&q(this,"email",r.Kb),r.ea&&q(this,"phoneNumber",r.ea),r.credential&&q(this,"credential",r.credential),r.$b&&q(this,"tenantId",r.$b)}x(Oo,_),Oo.prototype.w=function(){var r={code:this.code,message:this.message};this.email&&(r.email=this.email),this.phoneNumber&&(r.phoneNumber=this.phoneNumber),this.tenantId&&(r.tenantId=this.tenantId);var s=this.credential&&this.credential.w();return s&&le(r,s),r},Oo.prototype.toJSON=function(){return this.w()};function Iu(r){if(r.code){var s=r.code||"";s.indexOf(yt)==0&&(s=s.substring(yt.length));var a={credential:Lh(r),$b:r.tenantId};if(r.email)a.Kb=r.email;else if(r.phoneNumber)a.ea=r.phoneNumber;else if(!a.credential)return new _(s,r.message||void 0);return new Oo(s,a,r.message)}return null}function Po(){}Po.prototype.c=null;function Fg(r){return r.c||(r.c=r.b())}var jh;function Tu(){}x(Tu,Po),Tu.prototype.a=function(){var r=Ug(this);return r?new ActiveXObject(r):new XMLHttpRequest},Tu.prototype.b=function(){var r={};return Ug(this)&&(r[0]=!0,r[1]=!0),r};function Ug(r){if(!r.f&&typeof XMLHttpRequest>"u"&&typeof ActiveXObject<"u"){for(var s=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],a=0;a<s.length;a++){var h=s[a];try{return new ActiveXObject(h),r.f=h}catch{}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return r.f}jh=new Tu;function _u(){}x(_u,Po),_u.prototype.a=function(){var r=new XMLHttpRequest;if("withCredentials"in r)return r;if(typeof XDomainRequest<"u")return new jg;throw Error("Unsupported browser")},_u.prototype.b=function(){return{}};function jg(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseType=this.responseText=this.response="",this.status=-1,this.statusText="",this.a.onload=C(this.qc,this),this.a.onerror=C(this.Tb,this),this.a.onprogress=C(this.rc,this),this.a.ontimeout=C(this.vc,this)}e=jg.prototype,e.open=function(r,s,a){if(a!=null&&!a)throw Error("Only async requests are supported.");this.a.open(r,s)},e.send=function(r){if(r)if(typeof r=="string")this.a.send(r);else throw Error("Only string data is supported");else this.a.send()},e.abort=function(){this.a.abort()},e.setRequestHeader=function(){},e.getResponseHeader=function(r){return r.toLowerCase()=="content-type"?this.a.contentType:""},e.qc=function(){this.status=200,this.response=this.responseText=this.a.responseText,Vh(this,4)},e.Tb=function(){this.status=500,this.response=this.responseText="",Vh(this,4)},e.vc=function(){this.Tb()},e.rc=function(){this.status=200,Vh(this,1)};function Vh(r,s){r.readyState=s,r.onreadystatechange&&r.onreadystatechange()}e.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType};function qh(r,s,a){this.reset(r,s,a,void 0,void 0)}qh.prototype.a=null,qh.prototype.reset=function(r,s,a,h,p){delete this.a};function Bh(r){this.f=r,this.b=this.c=this.a=null}function xo(r,s){this.name=r,this.value=s}xo.prototype.toString=function(){return this.name};var Vg=new xo("SEVERE",1e3),Kh=new xo("WARNING",900),_E=new xo("CONFIG",700),EE=new xo("FINE",500);function qg(r){return r.c?r.c:r.a?qg(r.a):(ei("Root logger has no level set."),null)}Bh.prototype.log=function(r,s,a){if(r.value>=qg(this).value)for(E(s)&&(s=s()),r=new qh(r,String(s),this.f),a&&(r.a=a),a=this;a;)a=a.a};var Hh={},Eu=null;function Gh(r){Eu||(Eu=new Bh(""),Hh[""]=Eu,Eu.c=_E);var s;if(!(s=Hh[r])){s=new Bh(r);var a=r.lastIndexOf("."),h=r.substr(a+1);a=Gh(r.substr(0,a)),a.b||(a.b={}),a.b[h]=s,s.a=a,Hh[r]=s}return s}function Le(r,s){r&&r.log(EE,s,void 0)}function Su(r){this.f=r}x(Su,Po),Su.prototype.a=function(){return new Au(this.f)},Su.prototype.b=(function(r){return function(){return r}})({});function Au(r){ee.call(this),this.u=r,this.h=void 0,this.readyState=zh,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.l=new Headers,this.b=null,this.s="GET",this.f="",this.a=!1,this.i=Gh("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}x(Au,ee);var zh=0;e=Au.prototype,e.open=function(r,s){if(this.readyState!=zh)throw this.abort(),Error("Error reopening a connection");this.s=r,this.f=s,this.readyState=1,Mo(this)},e.send=function(r){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.a=!0;var s={headers:this.l,method:this.s,credentials:this.h,cache:void 0};
19r&&(s.body=r),this.u.fetch(new Request(this.f,s)).then(this.uc.bind(this),this.Va.bind(this))},e.abort=function(){this.response=this.responseText="",this.l=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&this.readyState!=4&&(this.a=!1,Lo(this)),this.readyState=zh},e.uc=function(r){this.a&&(this.g=r,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=r.headers,this.readyState=2,Mo(this)),this.a&&(this.readyState=3,Mo(this),this.a&&(this.responseType==="arraybuffer"?r.arrayBuffer().then(this.sc.bind(this),this.Va.bind(this)):typeof f.ReadableStream<"u"&&"body"in r?(this.response=this.responseText="",this.c=r.body.getReader(),this.m=new TextDecoder,Bg(this)):r.text().then(this.tc.bind(this),this.Va.bind(this)))))};function Bg(r){r.c.read().then(r.pc.bind(r)).catch(r.Va.bind(r))}e.pc=function(r){if(this.a){var s=this.m.decode(r.value?r.value:new Uint8Array(0),{stream:!r.done});s&&(this.response=this.responseText+=s),r.done?Lo(this):Mo(this),this.readyState==3&&Bg(this)}},e.tc=function(r){this.a&&(this.response=this.responseText=r,Lo(this))},e.sc=function(r){this.a&&(this.response=r,Lo(this))},e.Va=function(r){var s=this.i;s&&s.log(Kh,"Failed to fetch url "+this.f,r instanceof Error?r:Error(r)),this.a&&Lo(this)};function Lo(r){r.readyState=4,r.g=null,r.c=null,r.m=null,Mo(r)}e.setRequestHeader=function(r,s){this.l.append(r,s)},e.getResponseHeader=function(r){return this.b?this.b.get(r.toLowerCase())||"":((r=this.i)&&r.log(Kh,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")},e.getAllResponseHeaders=function(){if(!this.b){var r=this.i;return r&&r.log(Kh,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),""}r=[];for(var s=this.b.entries(),a=s.next();!a.done;)a=a.value,r.push(a[0]+": "+a[1]),a=s.next();return r.join(`\r 20`)};function Mo(r){r.onreadystatechange&&r.onreadystatechange.call(r)}Object.defineProperty(Au.prototype,"withCredentials",{get:function(){return this.h==="include"},set:function(r){this.h=r?"include":"same-origin"}});function Fo(r){ee.call(this),this.headers=new ui,this.D=r||null,this.c=!1,this.C=this.a=null,this.h=this.P=this.l="",this.f=this.N=this.i=this.J=!1,this.g=0,this.s=null,this.m=Kg,this.u=this.S=!1}x(Fo,ee);var Kg="";Fo.prototype.b=Gh("goog.net.XhrIo");var SE=/^https?$/i,AE=["POST","PUT"];function kE(r,s,a,h,p){if(r.a)throw Error("[goog.net.XhrIo] Object is active with another request="+r.l+"; newUri="+s);a=a?a.toUpperCase():"GET",r.l=s,r.h="",r.P=a,r.J=!1,r.c=!0,r.a=r.D?r.D.a():jh.a(),r.C=r.D?Fg(r.D):Fg(jh),r.a.onreadystatechange=C(r.Wb,r);try{Le(r.b,mn(r,"Opening Xhr")),r.N=!0,r.a.open(a,String(s),!0),r.N=!1}catch(m){Le(r.b,mn(r,"Error opening Xhr: "+m.message)),Hg(r,m);return}s=h||"";var v=new ui(r.headers);p&&P_(p,function(m,b){v.set(b,m)}),p=QT(v.Y()),h=f.FormData&&s instanceof f.FormData,!pn(AE,a)||p||h||v.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),v.forEach(function(m,b){this.a.setRequestHeader(b,m)},r),r.m&&(r.a.responseType=r.m),"withCredentials"in r.a&&r.a.withCredentials!==r.S&&(r.a.withCredentials=r.S);try{$g(r),0<r.g&&(r.u=NE(r.a),Le(r.b,mn(r,"Will abort after "+r.g+"ms if incomplete, xhr2 "+r.u)),r.u?(r.a.timeout=r.g,r.a.ontimeout=C(r.Ma,r)):r.s=oh(r.Ma,r.g,r)),Le(r.b,mn(r,"Sending request")),r.i=!0,r.a.send(s),r.i=!1}catch(m){Le(r.b,mn(r,"Send error: "+m.message)),Hg(r,m)}}function NE(r){return Ve&&hv(9)&&typeof r.timeout=="number"&&r.ontimeout!==void 0}function CE(r){return r.toLowerCase()=="content-type"}e=Fo.prototype,e.Ma=function(){typeof l<"u"&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",Le(this.b,mn(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))};function Hg(r,s){r.c=!1,r.a&&(r.f=!0,r.a.abort(),r.f=!1),r.h=s,Gg(r),ku(r)}function Gg(r){r.J||(r.J=!0,r.dispatchEvent("complete"),r.dispatchEvent("error"))}e.abort=function(){this.a&&this.c&&(Le(this.b,mn(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),ku(this))},e.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),ku(this,!0)),Fo.bb.Da.call(this)},e.Wb=function(){this.ya||(this.N||this.i||this.f?zg(this):this.Jc())},e.Jc=function(){zg(this)};function zg(r){if(r.c&&typeof l<"u"){if(r.C[1]&&Uo(r)==4&&Nu(r)==2)Le(r.b,mn(r,"Local request error detected and ignored"));else if(r.i&&Uo(r)==4)oh(r.Wb,0,r);else if(r.dispatchEvent("readystatechange"),Uo(r)==4){Le(r.b,mn(r,"Request complete")),r.c=!1;try{var s=Nu(r);t:switch(s){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var a=!0;break t;default:a=!1}var h;if(!(h=a)){var p;if(p=s===0){var v=String(r.l).match(jv)[1]||null;if(!v&&f.self&&f.self.location){var m=f.self.location.protocol;v=m.substr(0,m.length-1)}p=!SE.test(v?v.toLowerCase():"")}h=p}if(h)r.dispatchEvent("complete"),r.dispatchEvent("success");else{try{var b=2<Uo(r)?r.a.statusText:""}catch(R){Le(r.b,"Can not get status: "+R.message),b=""}r.h=b+" ["+Nu(r)+"]",Gg(r)}}finally{ku(r)}}}}function ku(r,s){if(r.a){$g(r);var a=r.a,h=r.C[0]?w:null;r.a=null,r.C=null,s||r.dispatchEvent("ready");try{a.onreadystatechange=h}catch(p){(r=r.b)&&r.log(Vg,"Problem encountered resetting onreadystatechange: "+p.message,void 0)}}}function $g(r){r.a&&r.u&&(r.a.ontimeout=null),r.s&&(f.clearTimeout(r.s),r.s=null)}function Uo(r){return r.a?r.a.readyState:0}function Nu(r){try{return 2<Uo(r)?r.a.status:-1}catch{return-1}}function RE(r){try{return r.a?r.a.responseText:""}catch(s){return Le(r.b,"Can not get responseText: "+s.message),""}}e.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case Kg:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var r=this.b;return r&&r.log(Vg,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(s){return Le(this.b,"Can not get response: "+s.message),null}};function mn(r,s){return s+" ["+r.P+" "+r.l+" "+Nu(r)+"]"}function mr(r){var s=PE;this.g=[],this.u=s,this.s=r||null,this.f=this.a=!1,this.c=void 0,this.v=this.C=this.i=!1,this.h=0,this.b=null,this.l=0}mr.prototype.cancel=function(r){if(this.a)this.c instanceof mr&&this.c.cancel();else{if(this.b){var s=this.b;delete this.b,r?s.cancel(r):(s.l--,0>=s.l&&s.cancel())}this.u?this.u.call(this.s,this):this.v=!0,this.a||(r=new Vo,Cu(this),jo(this,!1,r))}},mr.prototype.m=function(r,s){this.i=!1,jo(this,r,s)};function jo(r,s,a){r.a=!0,r.c=a,r.f=!s,Xg(r)}function Cu(r){if(r.a){if(!r.v)throw new Ru;r.v=!1}}function DE(r,s){$h(r,null,s,void 0)}
20function $h(r,s,a,h){r.g.push([s,a,h]),r.a&&Xg(r)}mr.prototype.then=function(r,s,a){var h,p,v=new tt(function(m,b){h=m,p=b});return $h(this,h,function(m){m instanceof Vo?v.cancel():p(m)}),v.then(r,s,a)},mr.prototype.$goog_Thenable=!0;function Wg(r){return XT(r.g,function(s){return E(s[1])})}function Xg(r){if(r.h&&r.a&&Wg(r)){var s=r.h,a=Du[s];a&&(f.clearTimeout(a.a),delete Du[s]),r.h=0}r.b&&(r.b.l--,delete r.b),s=r.c;for(var h=a=!1;r.g.length&&!r.i;){var p=r.g.shift(),v=p[0],m=p[1];if(p=p[2],v=r.f?m:v)try{var b=v.call(p||r.s,s);b!==void 0&&(r.f=r.f&&(b==s||b instanceof Error),r.c=s=b),(jd(s)||typeof f.Promise=="function"&&s instanceof f.Promise)&&(h=!0,r.i=!0)}catch(R){s=R,r.f=!0,Wg(r)||(a=!0)}}r.c=s,h&&(b=C(r.m,r,!0),h=C(r.m,r,!1),s instanceof mr?($h(s,b,h),s.C=!0):s.then(b,h)),a&&(s=new Qg(s),Du[s.a]=s,r.h=s.a)}function Ru(){Ie.call(this)}x(Ru,Ie),Ru.prototype.message="Deferred has already fired",Ru.prototype.name="AlreadyCalledError";function Vo(){Ie.call(this)}x(Vo,Ie),Vo.prototype.message="Deferred was canceled",Vo.prototype.name="CanceledError";function Qg(r){this.a=f.setTimeout(C(this.c,this),0),this.b=r}Qg.prototype.c=function(){throw delete Du[this.a],this.b};var Du={};function Wh(r){var s={},a=s.document||document,h=Jd(r).toString(),p=nu(document,"SCRIPT"),v={Xb:p,Ma:void 0},m=new mr(v),b=null,R=s.timeout!=null?s.timeout:5e3;return 0<R&&(b=window.setTimeout(function(){Ou(p,!0);var O=new Xh(LE,"Timeout reached for loading script "+h);Cu(m),jo(m,!1,O)},R),v.Ma=b),p.onload=p.onreadystatechange=function(){p.readyState&&p.readyState!="loaded"&&p.readyState!="complete"||(Ou(p,s.xd||!1,b),Cu(m),jo(m,!0,null))},p.onerror=function(){Ou(p,!0,b);var O=new Xh(xE,"Error while loading script "+h);Cu(m),jo(m,!1,O)},v=s.attributes||{},le(v,{type:"text/javascript",charset:"UTF-8"}),fv(p,v),h_(p,r),OE(a).appendChild(p),m}function OE(r){var s;return(s=(r||document).getElementsByTagName("HEAD"))&&s.length!=0?s[0]:r.documentElement}function PE(){if(this&&this.Xb){var r=this.Xb;r&&r.tagName=="SCRIPT"&&Ou(r,!0,this.Ma)}}function Ou(r,s,a){a!=null&&f.clearTimeout(a),r.onload=w,r.onerror=w,r.onreadystatechange=w,s&&window.setTimeout(function(){r&&r.parentNode&&r.parentNode.removeChild(r)},0)}var xE=0,LE=1;function Xh(r,s){var a="Jsloader error (code #"+r+")";s&&(a+=": "+s),Ie.call(this,a),this.code=r}x(Xh,Ie);function Pu(r){this.f=r}x(Pu,Po),Pu.prototype.a=function(){return new this.f},Pu.prototype.b=function(){return{}};function Ke(r,s,a){if(this.c=r,r=s||{},this.l=r.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=r.secureTokenTimeout||ME,this.g=Nn(r.secureTokenHeaders||FE),this.h=r.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.i=r.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.v=r.firebaseTimeout||UE,this.a=Nn(r.firebaseHeaders||jE),a&&(this.a["X-Client-Version"]=a,this.g["X-Client-Version"]=a),a=Ze()=="Node",a=f.XMLHttpRequest||a&&H.INTERNAL.node&&H.INTERNAL.node.XMLHttpRequest,!a&&!qe())throw new _("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,qe()?this.f=new Su(self):Yv()?this.f=new Pu(a):this.f=new _u,this.b=null}var Qh,He="idToken",ME=new On(3e4,6e4),FE={"Content-Type":"application/x-www-form-urlencoded"},UE=new On(3e4,6e4),jE={"Content-Type":"application/json"};function Yg(r,s){s?r.a["X-Firebase-Locale"]=s:delete r.a["X-Firebase-Locale"]}function xu(r,s){s&&(r.l=Yh("https://securetoken.googleapis.com/v1/token",s),r.h=Yh("https://www.googleapis.com/identitytoolkit/v3/relyingparty/",s),r.i=Yh("https://identitytoolkit.googleapis.com/v2/",s))}function Yh(r,s){return r=de(r),s=de(s.url),r.f=r.a+r.f,wo(r,s.c),r.a=s.a,bo(r,s.g),r.toString()}function Jg(r,s){s?(r.a["X-Client-Version"]=s,r.g["X-Client-Version"]=s):(delete r.a["X-Client-Version"],delete r.g["X-Client-Version"])}Ke.prototype.T=function(){return this.b};function Zg(r,s,a,h,p,v,m){K_()||qe()?r=C(r.u,r):(Qh||(Qh=new tt(function(b,R){qE(b,R)})),r=C(r.s,r)),r(s,a,h,p,v,m)}Ke.prototype.u=function(r,s,a,h,p,v){if(qe()&&(typeof f.fetch>"u"||typeof f.Headers>"u"||typeof f.Request>"u"))throw new _("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to supp
20ort HTTP requests from a Worker environment.");var m=new Fo(this.f);if(v){m.g=Math.max(0,v);var b=setTimeout(function(){m.dispatchEvent("timeout")},v)}Mv(m,"complete",function(){b&&clearTimeout(b);var R=null;try{R=JSON.parse(RE(this))||null}catch{R=null}s&&s(R)}),ih(m,"ready",function(){b&&clearTimeout(b),Cv(this)}),ih(m,"timeout",function(){b&&clearTimeout(b),Cv(this),s&&s(null)}),kE(m,r,a,h,p)};var VE=new Ye(Js,"https://apis.google.com/js/client.js?onload=%{onload}"),tm="__fcb"+Math.floor(1e6*Math.random()).toString();function qE(r,s){if(((window.gapi||{}).client||{}).request)r();else{f[tm]=function(){((window.gapi||{}).client||{}).request?r():s(Error("CORS_UNSUPPORTED"))};var a=Vc(VE,{onload:tm});DE(Wh(a),function(){s(Error("CORS_UNSUPPORTED"))})}}Ke.prototype.s=function(r,s,a,h,p){var v=this;Qh.then(function(){window.gapi.client.setApiKey(v.c);var m=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:r,method:a,body:h,headers:p,authType:"none",callback:function(b){window.gapi.auth.setToken(m),s&&s(b)}})}).o(function(m){s&&s({error:{message:m&&m.message||"CORS_UNSUPPORTED"}})})};function BE(r,s){return new tt(function(a,h){s.grant_type=="refresh_token"&&s.refresh_token||s.grant_type=="authorization_code"&&s.code?Zg(r,r.l+"?key="+encodeURIComponent(r.c),function(p){p?p.error?h(ol(p)):p.access_token&&p.refresh_token?a(p):h(new _("internal-error")):h(new _("network-request-failed"))},"POST",qv(s).toString(),r.g,r.m.get()):h(new _("internal-error"))})}function em(r,s,a,h,p,v,m){var b=de(s+a);Et(b,"key",r.c),m&&Et(b,"cb",Date.now().toString());var R=h=="GET";if(R)for(var O in p)p.hasOwnProperty(O)&&Et(b,O,p[O]);return new tt(function(X,at){Zg(r,b.toString(),function(ot){ot?ot.error?at(ol(ot,v||{})):X(ot):at(new _("network-request-failed"))},h,R?void 0:Hv(tg(p)),r.a,r.v.get())})}function yr(r){if(r=r.email,typeof r!="string"||!z_.test(r))throw new _("invalid-email")}function nm(r){"email"in r&&yr(r)}function KE(r,s){return et(r,ZE,{identifier:s,continueUri:fu()?_o():"http://localhost"}).then(function(a){return a.signinMethods||[]})}function HE(r){return et(r,lS,{}).then(function(s){return s.authorizedDomains||[]})}function ve(r){if(!r[He])throw r.mfaPendingCredential?new _("multi-factor-auth-required",null,Nn(r)):new _("internal-error")}function Jh(r){if(r.phoneNumber||r.temporaryProof){if(!r.phoneNumber||!r.temporaryProof)throw new _("internal-error")}else{if(!r.sessionInfo)throw new _("missing-verification-id");if(!r.code)throw new _("missing-verification-code")}}Ke.prototype.Ab=function(){return et(this,vS,{})},Ke.prototype.Cb=function(r,s){return et(this,om,{idToken:r,email:s})},Ke.prototype.Db=function(r,s){return et(this,sm,{idToken:r,password:s})};var GE={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};e=Ke.prototype,e.Eb=function(r,s){var a={idToken:r},h=[];return $d(GE,function(p,v){var m=s[v];m===null?h.push(p):v in s&&(a[v]=m)}),h.length&&(a.deleteAttribute=h),et(this,om,a)}
20,e.wb=function(r,s){return r={requestType:"PASSWORD_RESET",email:r},le(r,s),et(this,hS,r)},e.xb=function(r,s){return r={requestType:"EMAIL_SIGNIN",email:r},le(r,s),et(this,uS,r)},e.vb=function(r,s){return r={requestType:"VERIFY_EMAIL",idToken:r},le(r,s),et(this,aS,r)},e.Fb=function(r,s,a){return r={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:r,newEmail:s},le(r,a),et(this,cS,r)};function zE(r,s){return et(r,dS,s)}e.gb=function(r){return et(this,TS,r)};function $E(r,s){return et(r,gS,s).then(function(a){return a.phoneSessionInfo.sessionInfo})}function rm(r){if(!r.phoneVerificationInfo)throw new _("internal-error");if(!r.phoneVerificationInfo.sessionInfo)throw new _("missing-verification-id");if(!r.phoneVerificationInfo.code)throw new _("missing-verification-code")}function WE(r,s){return et(r,mS,s).then(function(a){return a.phoneResponseInfo.sessionInfo})}function XE(r,s,a){return et(r,eS,{idToken:s,deleteProvider:a})}function Zh(r){if(!r.requestUri||!r.sessionId&&!r.postBody&&!r.pendingToken)throw new _("internal-error")}function tl(r,s){return s.oauthIdToken&&s.providerId&&s.providerId.indexOf("oidc.")==0&&!s.pendingToken&&(r.sessionId?s.nonce=r.sessionId:r.postBody&&(r=new ar(r.postBody),ah(r,"nonce")&&(s.nonce=r.get("nonce")))),s}function im(r){var s=null;if(r.needConfirmation?(r.code="account-exists-with-different-credential",s=Iu(r)):r.errorMessage=="FEDERATED_USER_ID_ALREADY_LINKED"?(r.code="credential-already-in-use",s=Iu(r)):r.errorMessage=="EMAIL_EXISTS"?(r.code="email-already-in-use",s=Iu(r)):r.errorMessage&&(s=am(r.errorMessage)),s)throw s;ve(r)}function el(r,s){return s.returnIdpCredential=!0,et(r,yS,s)}function nl(r,s){return s.returnIdpCredential=!0,et(r,bS,s)}function rl(r,s){return s.returnIdpCredential=!0,s.autoCreate=!1,et(r,wS,s)}function il(r){if(!r.oobCode)throw new _("invalid-action-code")}e.ob=function(r,s){return et(this,pS,{oobCode:r,newPassword:s})},e.Sa=function(r){return et(this,YE,{oobCode:r})},e.kb=function(r){return et(this,QE,{oobCode:r})};var QE={endpoint:"setAccountInfo",A:il,Z:"email",B:!0},YE={endpoint:"resetPassword",A:il,G:function(r){var s=r.requestType;if(!s||!r.email&&s!="EMAIL_SIGNIN"&&s!="VERIFY_AND_CHANGE_EMAIL")throw new _("internal-error")},B:!0},JE={endpoint:"signupNewUser",A:function(r){if(yr(r),!r.password)throw new _("weak-password")},G:ve,V:!0,B:!0},ZE={endpoint:"createAuthUri",B:!0},tS={endpoint:"deleteAccount",O:["idToken"]},eS={endpoint:"setAccountInfo",O:["idToken","deleteProvider"],A:function(r){if(!Array.isArray(r.deleteProvider))throw new _("internal-error")}},nS={endpoint:"emailLinkSignin",O:["email","oobCode"],A:yr,G:ve,V:!0,B:!0},rS={endpoint:"emailLinkSignin",O:["idToken","email","oobCode"],A:yr,G:ve,V:!0},iS={endpoint:"accounts/mfaEnrollment:finalize",O:["idToken","phoneVerificationInfo"],A:rm,G:ve,B:!0,Na:!0},oS={endpoint:"accounts/mfaSignIn:finalize",O:["mfaPendingCredential","phoneVerificationInfo"],A:rm,G:ve,B:!0,Na:!0},sS={endpoint:"getAccountInfo"},uS={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(r){if(r.requestType!="EMAIL_SIGNIN")throw new _("internal-error");yr(r)},Z:"email",B:!0},aS={endpoint:"getOobConfirmationCode",O:["idToken","requestType"],A:function(r){if(r.requestType!="VERIFY_EMAIL")throw new _("internal-error")},Z:"email",B:!0},cS={endpoint:"getOobConfirmationCode",O:["idToken","newEmail","requestType"],A:function(r){if(r.requestType!="VERIFY_AND_CHANGE_EMAIL")throw new _("internal-error")},Z:"email",B:!0},hS={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(r){if(r.requestType!="PASSWORD_RESET")throw new _("internal-error");yr(r)},Z:"email",B:!0},lS={mb:!0,endpoint:"getProjectConfig",Vb:"GET"},fS={mb:!0,endpoint:"getRecaptchaParam",Vb:"GET",G:function(r){if(!r.recaptchaSiteKey)throw new _("internal-error")}},pS={endpoint:"resetPassword",A:il,Z:"email",B:!0},dS={endpoint:"sendVerificationCode",O:["phoneNumber","recaptchaToken"],Z:"sessionInfo",B:!0},om={endpoint:"setAccountInfo",O:["idToken"],A:nm,V:!0},sm={endpoint:"setAccountInfo",O:["idToken"],A:function(r){if(nm(r),!r.password)throw new _("weak-password")},G:ve,V:!0},vS={endpoint:"signupNewUser",G:ve,V:!0,B:!0},gS={endpoint:"accounts/mfaEnrollment:start",O:["idToken","phoneEnrollmentInfo"],A:function(r){if(!r.phoneEnrollmentInfo)throw new _("internal-error");
20if(!r.phoneEnrollmentInfo.phoneNumber)throw new _("missing-phone-number");if(!r.phoneEnrollmentInfo.recaptchaToken)throw new _("missing-app-credential")},G:function(r){if(!r.phoneSessionInfo||!r.phoneSessionInfo.sessionInfo)throw new _("internal-error")},B:!0,Na:!0},mS={endpoint:"accounts/mfaSignIn:start",O:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(r){if(!r.phoneSignInInfo||!r.phoneSignInInfo.recaptchaToken)throw new _("missing-app-credential")},G:function(r){if(!r.phoneResponseInfo||!r.phoneResponseInfo.sessionInfo)throw new _("internal-error")},B:!0,Na:!0},yS={endpoint:"verifyAssertion",A:Zh,Za:tl,G:im,V:!0,B:!0},wS={endpoint:"verifyAssertion",A:Zh,Za:tl,G:function(r){if(r.errorMessage&&r.errorMessage=="USER_NOT_FOUND")throw new _("user-not-found");if(r.errorMessage)throw am(r.errorMessage);ve(r)},V:!0,B:!0},bS={endpoint:"verifyAssertion",A:function(r){if(Zh(r),!r.idToken)throw new _("internal-error")},Za:tl,G:im,V:!0},IS={endpoint:"verifyCustomToken",A:function(r){if(!r.token)throw new _("invalid-custom-token")},G:ve,V:!0,B:!0},um={endpoint:"verifyPassword",A:function(r){if(yr(r),!r.password)throw new _("wrong-password")},G:ve,V:!0,B:!0},TS={endpoint:"verifyPhoneNumber",A:Jh,G:ve,B:!0},_S={endpoint:"verifyPhoneNumber",A:function(r){if(!r.idToken)throw new _("internal-error");Jh(r)},G:function(r){if(r.temporaryProof)throw r.code="credential-already-in-use",Iu(r);ve(r)}},ES={Ib:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:Jh,G:ve,B:!0},SS={endpoint:"accounts/mfaEnrollment:withdraw",O:["idToken","mfaEnrollmentId"],G:function(r){if(!!r[He]^!!r.refreshToken)throw new _("internal-error")},B:!0,Na:!0};function et(r,s,a){if(!Z_(a,s.O))return vt(new _("internal-error"));var h=!!s.Na,p=s.Vb||"POST",v;return z(a).then(s.A).then(function(){return s.V&&(a.returnSecureToken=!0),s.B&&r.b&&typeof a.tenantId>"u"&&(a.tenantId=r.b),h?em(r,r.i,s.endpoint,p,a,s.Ib,s.mb||!1):em(r,r.h,s.endpoint,p,a,s.Ib,s.mb||!1)}).then(function(m){return v=m,s.Za?s.Za(a,v):v}).then(s.G).then(function(){if(!s.Z)return v;if(!(s.Z in v))throw new _("internal-error");return v[s.Z]})}function am(r){return ol({error:{errors:[{message:r}],code:400,message:r}})}function ol(r,s){var a=(r.error&&r.error.errors&&r.error.errors[0]||{}).reason||"",h={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(a=h[a]?new _(h[a]):null)return a;a=r.error&&r.error.message||"",h={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",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_OR_INVALID_
20NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",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",INVALID_PROVIDER_ID:"invalid-provider-id",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",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash",UNSUPPORTED_TENANT_OPERATION:"unsupported-tenant-operation",INVALID_TENANT_ID:"invalid-tenant-id",TENANT_ID_MISMATCH:"tenant-id-mismatch",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_PENDING_CREDENTIAL:"missing-multi-factor-session",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",EMAIL_CHANGE_NEEDS_VERIFICATION:"email-change-needs-verification",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",UNSUPPORTED_FIRST_FACTOR:"unsupported-first-factor",UNVERIFIED_EMAIL:"unverified-email"},le(h,s||{}),s=(s=a.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1<s.length?s[1]:void 0;for(var p in h)if(a.indexOf(p)===0)return new _(h[p],s);return!s&&r&&(s=So(r)),new _("internal-error",s)}function AS(r){this.b=r,this.a=null,this.sb=kS(this)}function kS(r){return PS().then(function(){return new tt(function(s,a){gt("gapi.iframes.getContext")().open({where:document.body,url:r.b,messageHandlersFilter:gt("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},function(h){function p(){clearTimeout(v),s()}r.a=h,r.a.restyle({setHideOnLeave:!1});var v=setTimeout(function(){a(Error("Network Error"))},OS.get());h.ping(p).then(p,function(){a(Error("Network Error"))})})})})}function NS(r,s){return r.sb.then(function(){return new tt(function(a){r.a.send(s.type,s,a,gt("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})}function CS(r,s){r.sb.then(function(){r.a.register("authEvent",s,gt("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}var RS=new Ye(Js,"https://apis.google.com/js/api.js?onload=%{onload}"),DS=new On(3e4,6e4),OS=new On(5e3,15e3),Lu=null;function PS(){return Lu||(Lu=new tt(function(r,s){function a(){ng(),gt("gapi.load")("gapi.iframes",{callback:r,ontimeout:function(){ng(),s(Error("Network Error"))},timeout:DS.get()})}if(gt("gapi.iframes.Iframe"))r();else if(gt("gapi.load"))a();else{var h="__iframefcb"+Math.floor(1e6*Math.random()).toString();f[h]=function(){gt("gapi.load")?a():s(Error("Network Error"))},h=Vc(RS,{onload:h}),z(Wh(h)).o(function(){s(Error("Network Error"))})}}).o(function(r){throw Lu=null,r}))}function cm(r,s,a,h){this.l=r,this.h=s,this.i=a,this.g=h,this.f=null,this.g?(r=de(this.g.url),r=hu(r.c,r.a,r.g,"/emulator/auth/iframe")):r=hu("https",this.l,null,"/__/auth/iframe"),this.a=r,Et(this.a,"apiKey",this.h),Et(this.a,"appName",this.i),this.b=null,this.c=[]}cm.prototype.toString=function(){return this.f?Et(this.a,"v",this.f):Je(this.a.b,"v"),this.b?Et(this.a,"eid",this.b):Je(this.a.b,"eid"),this.c.length?Et(this.a,"fw",this.c.join(",")):Je(this.a.b,"fw"),this.a.toString()};function sl(r,s,a,h,p,v){this.u=r,this.s=s,this.c=a,this.m=h,this.v=v,this.i=this.g=this.l=null,this.a=p,this.h=this.f=null}sl.prototype.zb=function(r){return this.h=r,this},sl.prototype.toString=function(){if(this.v){var r=de(this.v.url);r=hu(r.c,r.a,r.g,"/emulator/auth/handler")}else r=hu("https",this.u,null,"/__/auth/handler");
20if(Et(r,"apiKey",this.s),Et(r,"appName",this.c),Et(r,"authType",this.m),this.a.isOAuthProvider){var s=this.a;try{var a=H.app(this.c).auth().la()}catch{a=null}s.pb=a,Et(r,"providerId",this.a.providerId),a=this.a,s=tg(a.Jb);for(var h in s)s[h]=s[h].toString();h=a.Qc,s=Nn(s);for(var p=0;p<h.length;p++){var v=h[p];v in s&&delete s[v]}a.qb&&a.pb&&!s[a.qb]&&(s[a.qb]=a.pb),rr(s)||Et(r,"customParameters",So(s))}if(typeof this.a.Rb=="function"&&(a=this.a.Rb(),a.length&&Et(r,"scopes",a.join(","))),this.l?Et(r,"redirectUrl",this.l):Je(r.b,"redirectUrl"),this.g?Et(r,"eventId",this.g):Je(r.b,"eventId"),this.i?Et(r,"v",this.i):Je(r.b,"v"),this.b)for(var m in this.b)this.b.hasOwnProperty(m)&&!Pe(r,m)&&Et(r,m,this.b[m]);return this.h?Et(r,"tid",this.h):Je(r.b,"tid"),this.f?Et(r,"eid",this.f):Je(r.b,"eid"),m=ul(this.c),m.length&&Et(r,"fw",m.join(",")),r.toString()};function ul(r){try{return H.app(r).auth().Ga()}catch{return[]}}function hm(r,s,a,h,p,v){this.s=r,this.g=s,this.b=a,this.f=v,this.c=h||null,this.i=p||null,this.l=this.u=this.C=null,this.h=[],this.m=this.a=null}function lm(r){var s=_o();return HE(r).then(function(a){t:{var h=de(s),p=h.c;h=h.a;for(var v=0;v<a.length;v++){var m=a[v],b=h,R=p;if(m.indexOf("chrome-extension://")==0?b=de(m).a==b&&R=="chrome-extension":R!="http"&&R!="https"?b=!1:G_.test(m)?b=b==m:(m=m.split(".").join("\\."),b=new RegExp("^(.+\\."+m+"|"+m+")$","i").test(b)),b){a=!0;break t}}a=!1}if(!a)throw new Uh(_o())})}function fm(r){return r.m||(r.m=lu().then(function(){if(!r.u){var s=r.c,a=r.i,h=ul(r.b),p=new cm(r.s,r.g,r.b,r.f);p.f=s,p.b=a,p.c=nr(h||[]),r.u=p.toString()}r.v=new AS(r.u),xS(r)})),r.m}e=hm.prototype,e.Pb=function(r,s,a){var h=new _("popup-closed-by-user"),p=new _("web-storage-unsupported"),v=this,m=!1;return this.ma().then(function(){LS(v).then(function(b){b||(r&&cr(r),s(p),m=!0)})}).o(function(){}).then(function(){if(!m)return H_(r)}).then(function(){if(!m)return si(a).then(function(){s(h)})})},e.Yb=function(){var r=Vt();return!Eo(r)&&!eg(r)},e.Ub=function(){return!1},e.Nb=function(r,s,a,h,p,v,m,b){if(!r)return vt(new _("popup-blocked"));if(m&&!Eo())return this.ma().o(function(O){cr(r),p(O)}),h(),z();this.a||(this.a=lm(pm(this)));var R=this;return this.a.then(function(){var O=R.ma().o(function(X){throw cr(r),p(X),X});return h(),O}).then(function(){if(Mh(a),!m){var O=qo(R.s,R.g,R.b,s,a,null,v,R.c,void 0,R.i,b,R.f);$v(O,r)}}).o(function(O){throw O.code=="auth/network-request-failed"&&(R.a=null),O})};function pm(r){return r.l||(r.C=r.c?hi(r.c,ul(r.b)):null,r.l=new Ke(r.g,fo(r.i),r.C),r.f&&xu(r.l,r.f)),r.l}e.Ob=function(r,s,a,h){this.a||(this.a=lm(pm(this)));var p=this;return this.a.then(function(){Mh(s);var v=qo(p.s,p.g,p.b,r,s,_o(),a,p.c,void 0,p.i,h,p.f);$v(v)}).o(function(v){throw v.code=="auth/network-request-failed"&&(p.a=null),v})},e.ma=function(){var r=this;return fm(this).then(function(){return r.v.sb}).o(function(){throw r.a=null,new _("network-request-failed")})},e.ac=function(){return!0};function qo(r,s,a,h,p,v,m,b,R,O,X,at){return r=new sl(r,s,a,h,p,at),r.l=v,r.g=m,r.i=b,r.b=Nn(R||null),r.f=O,r.zb(X).toString()}function xS(r){if(!r.v)throw Error("IfcHandler must be initialized!");CS(r.v,function(s){var a={};if(s&&s.authEvent){var h=!1;for(s=Mg(s.authEvent),a=0;a<r.h.length;a++)h=r.h[a](s)||h;return a={},a.status=h?"ACK":"ERROR",z(a)}return a.status="ERROR",z(a)})}function LS(r){var s={type:"webStorageSupport"};return fm(r).then(function(){return NS(r.v,s)}).then(function(a){if(a&&a.length&&typeof a[0].webStorageSupport<"u")return a[0].webStorageSupport;throw Error()})}e.Ea=function(r){this.h.push(r)},e.Ta=function(r){je(this.h,function(s){return s==r})};function dm(r){if(this.a=r||H.INTERNAL.reactNative&&H.INTERNAL.reactNative.AsyncStorage,!this.a)throw new _("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}e=dm.prototype,e.get=function(r){return z(this.a.getItem(r)).then(function(s){return s&&fi(s)})},e.set=function(r,s){return z(this.a.setItem(r,So(s)))},e.U=function(r){return z(this.a.removeItem(r))},e.ca=function(){},e.ia=function(){};function vm(r){this.b=r,this.a={},this.f=C(this.c,this)}var gm=[];function MS(){var r=qe()?self:null;if(wt(gm,function(a){a.b==r&&(s=a)}),!s){var s=new vm(r);gm.push(s)}return s}vm.prototype.c=function(r){var s=r.data.eventType,a=r.data.eventId,h=this.a[s];if(h&&0<h.length){r.ports[0].postMessage({status:"ack",eventId:a,eventType:s,response:null});var p=[];wt(h,function(v){p.push(z().then(function(){return v(r.origin,r.data.data)}))}),bv(p).then(function(v){var m=[];wt(v,function(b){m.push({fulfilled:b.Qb,value:b.value,reason:b.reason?b.reason.message:void 0})}),wt(m,function(b){for(var R in b)typeof b[R]>"u"&&delete b[R]}),r.ports[0].postMessage({status:"done",eventId:a,eventType:s,response:m})})}};function mm(r,s,a){rr(r.a)&&r.b.addEventListener("message",r.f),typeof r.a[s]>"u"&&(r.a[s]=[]),r.a[s].push(a)}function ym(r){this.a=r}ym.prototype.postMessage=function(r,s){this.a.postMessage(r,s)};function wm(r){this.c=r,this.b=!1,this.a=[]}function bm(r,s,a,h){var p,v=a||{},m,b,R,O=null;if(r.b)return vt(Error("connection_unavailable"));var X=h?800:50,at=typeof MessageChannel<"u"?new MessageChannel:null;return new tt(function(ot,Ft){at?(p=Math.floor(Math.random()*Math.pow(10,20)).toString(),at.port1.start(),b=setTimeout(function(){Ft(Error("unsupported_event"))},X),m=function(yn){yn.data.eventId===p&&(yn.data.status==="ack"?(clearTimeout(b),R=setTimeout(function(){Ft(Error("timeout"))},3e3)):yn.data.status==="done"?(clearTimeout(R),typeof yn.data.response<"u"?ot(yn.data.response):Ft(Error("unknown_error"))):(clearTimeout(b),clearTimeout(R),Ft(Error("invalid_response"))))},O={messageChannel:at,onMessage:m},r.a.push(O),at.port1.addEventListener("message",m),r.c.postMessage({eventType:s,eventId:p,data:v},[at.port2])):Ft(Error("connection_unavailable"))}).then(function(ot){return al(r,O),ot}).o(function(ot){throw al(r,O),ot})}function al(r,s){if(s){var a=s.messageChannel,h=s.onMessage;a&&(a.port1.removeEventListener("message",h),a.port1.close()),je(r.a,function(p){return p==s})}}wm.prototype.close=function(){for(;0<this.a.length;)al(this,this.a[0]);this.b=!0};function Im(){if(!ll())throw new _("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=f.indexedDB,this.type="indexedDB",this.g=this.v=this.f=this.l=null,this.s=!1,this.h=null;var r=this;qe()&&self?(this.v=MS(),mm(this.v,"keyChanged",function(s,a){return Em(r).then(function(h){return 0<h.length&&wt(r.a,function(p){p(h)}),{keyProcessed:pn(h,a.key)}})}),mm(this.v,"ping",function(){return z(["keyChanged"])})):Y_().then(function(s){(r.h=s)&&(r.g=new wm(new ym(s)),bm(r.g,"ping",null,!0).then(function(a){a[0].fulfilled&&pn(a[0].value,"keyChanged")&&(r.s=!0)}).o(function(){}))})}var cl;function FS(r){return new tt(function(s,a){var h=r.m.deleteDatabase("firebaseLocalStorageDb");h.onsuccess=function(){s()},h.onerror=function(p){a(Error(p.target.error))}})}function Tm(r){return new tt(function(s,a){var h=r.m.open("firebaseLocalStorageDb",1);h.onerror=function(p){try{p.preventDefault()}catch{}a(Error(p.target.error))},h.onupgradeneeded=function(p){p=p.target.result;try{p.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(v){a(v)}},h.onsuccess=function(p){p=p.target.result,p.objectStoreNames.contains("firebaseLocalStorage")?s(p):FS(r).then(function(){return Tm(r)}).then(function(v){s(v)}).o(function(v){a(v)})}})}function hl(r){return r.i||(r.i=Tm(r)),r.i}function Mu(r,s){function a(p,v){hl(r).then(s).then(p).o(function(m){if(3<++h)v(m);else return hl(r).then(function(b){return b.close(),r.i=void 0,a(p,v)}).o(function(b){v(b)})})}var h=0;return new tt(a)}function ll(){try{return!!f.indexedDB}catch{return!1}}function Bo(r){return r.objectStore("firebaseLocalStorage")}function Ko(r,s){return r.transaction(["firebaseLocalStorage"],s?"readwrite":"readonly")}function gi(r){return new tt(function(s,a){r.onsuccess=function(h){h&&h.target?s(h.target.result):s()},r.onerror=function(h){a(h.target.error)}})}e=Im.prototype,e.set=function(r,s){var a=this,h=!1;return Mu(this,function(p){return p=Bo(Ko(p,!0)),gi(p.get(r))}).then(function(p){return Mu(a,function(v){if(v=Bo(Ko(v,!0)),p)return p.value=s,gi(v.put(p));a.b++,h=!0;var m={};return m.fbase_key=r,m.value=s,gi(v.add(m))})}).then(function(){return a.c[r]=s,_m(a,r)}).oa(function(){h&&a.b--})};function _m(r,s){return r.g&&r.h&&Q_()===r.h?bm(r.g,"keyChanged",{key:s},r.s).then(function(){}).o(function(){}):z()}e.get=function(r){return Mu(this,function(s){return gi(Bo(Ko(s,!1)).get(r))}).then(function(s){return s&&s.value})},e.U=function(r){var s=this,a=!1;return Mu(this,function(h){return a=!0,s.b++,gi(Bo(Ko(h,!0)).delete(r))}).then(function(){return delete s.c[r],_m(s,r)}).oa(function(){a&&s.b--})};function Em(r){return hl(r).then(function(s){var a=Bo(Ko(s,!1));return a.getAll?gi(a.getAll()):new tt(function(h,p){var v=[],m=a.openCursor();m.onsuccess=function(b){(b=b.target.result)?(v.push(b.value),b.continue()):h(v)},m.onerror=function(b){p(b.target.error)}})}).then(function(s){var a={},h=[];if(r.b==0){for(h=0;h<s.length;h++)a[s[h].fbase_key]=s[h].value;h=Wv(r.c,a),r.c=a}return h})}e.ca=function(r){this.a.length==0&&US(this),this.a.push(r)},e.ia=function(r){je(this.a,function(s){return s==r}),this.a.length==0&&Sm(this)};function US(r){function s(){r.f=setTimeout(function(){r.l=Em(r).then(function(a){0<a.length&&wt(r.a,function(h){h(a)})}).then(function(){s()}).o(function(a){a.message!="STOP_EVENT"&&s()})},800)}Sm(r),s()}function Sm(r){r.l&&r.l.cancel("STOP_EVENT"),r.f&&(clearTimeout(r.f),r.f=null)}function Am(r){var s=this,a=null;this.a=[],this.type="indexedDB",this.c=r,this.b=z().then(function(){if(ll()){var h=lr(),p="__sak"+h;return cl||(cl=new Im),a=cl,a.set(p,h).then(function(){return a.get(p)}).then(function(v){if(v!==h)throw Error("indexedDB not supported!");return a.U(p)}).then(function(){return a}).o(function(){return s.c})}return s.c}).then(function(h){return s.type=h.type,h.ca(function(p){wt(s.a,function(v){v(p)})}),h})}e=Am.prototype,e.get=function(r){return this.b.then(function(s){return s.get(r)})},e.set=function(r,s){return this.b.then(function(a){return a.set(r,s)})},e.U=function(r){return this.b.then(function(s){return s.U(r)})},e.ca=function(r){this.a.push(r)},e.ia=function(r){je(this.a,function(s){return s==r})};function Ho(){this.a={},this.type="inMemory"}e=Ho.prototype,e.get=function(r){return z(this.a[r])},e.set=function(r,s){return this.a[r]=s,z()},e.U=function(r){return delete this.a[r],z()},e.ca=function(){},e.ia=function(){};function Fu(){if(!jS())throw Ze()=="Node"?new _("internal-error","The LocalStorage compatibility library was not found."):new _("web-storage-unsupported");this.a=km()||H.INTERNAL.node.localStorage,this.type="localStorage"}function km(){try{var r=f.localStorage,s=lr();return r&&(r.setItem(s,"1"),r.removeItem(s)),r}catch{return null}}function jS(){var r=Ze()=="Node";if(r=km()||r&&H.INTERNAL.node&&H.INTERNAL.node.localStorage,!r)return!1;try{return r.setItem("__sak","1"),r.removeItem("__sak"),!0}catch{return!1}}e=Fu.prototype,e.get=function(r){var s=this;return z().then(function(){var a=s.a.getItem(r);return fi(a)})},e.set=function(r,s){var a=this;return z().then(function(){var h=So(s);h===null?a.U(r):a.a.setItem(r,h)})},e.U=function(r){var s=this;return z().then(function(){s.a.removeItem(r)})},e.ca=function(r){f.window&&Oe(f.window,"storage",r)},e.ia=function(r){f.window&&Te(f.window,"storage",r)};function fl(){this.type="nullStorage"}e=fl.prototype,e.get=function(){return z(null)},e.set=function(){return z()},e.U=function(){return z()},e.ca=function(){},e.ia=function(){};function pl(){if(!VS())throw Ze()=="Node"?new _("internal-error","The SessionStorage compatibility library was not found."):new _("web-storage-unsupported");this.a=Nm()||H.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Nm(){try{var r=f.sessionStorage,s=lr();return r&&(r.setItem(s,"1"),r.removeItem(s)),r}catch{return null}}function VS(){var r=Ze()=="Node";if(r=Nm()||r&&H.INTERNAL.node&&H.INTERNAL.node.sessionStorage,!r)return!1;try{return r.setItem("__sak","1"),r.removeItem("__sak"),!0}catch{return!1}}e=pl.prototype,e.get=function(r){var s=this;return z().then(function(){var a=s.a.getItem(r);return fi(a)})},e.set=function(r,s){var a=this;return z().then(function(){var h=So(s);h===null?a.U(r):a.a.setItem(r,h)})},e.U=function(r){var s=this;return z().then(function(){s.a.removeItem(r)})},e.ca=function(){},e.ia=function(){};function qS(){var r={};r.Browser=BS,r.Node=KS,r.ReactNative=HS,r.Worker=GS,this.a=r[Ze()]}var dl,BS={F:Fu,cb:pl},KS={F:Fu,cb:pl},HS={F:dm,cb:fl},GS={F:Fu,cb:fl},mi={rd:"local",NONE:"none",td:"session"};function zS(r){var s=new _("invalid-persistence-type"),a=new _("unsupported-persistence-type");t:{for(h in mi)if(mi[h]==r){var h=!0;break t}h=!1}if(!h||typeof r!="string")throw s;switch(Ze()){case"ReactNative":if(r==="session")throw a;break;case"Node":if(r!=="none")throw a;break;case"Worker":if(r==="session"||!ll()&&r!=="none")throw a;break;default:if(!dh()&&r!=="none")throw a}}function Cm(){var r=!!(!eg(Vt())&&fh()),s=Eo(),a=dh();this.m=r,this.h=s,this.l=a,this.a={}
20,dl||(dl=new qS),r=dl;try{this.g=!hh()&&rg()||!f.indexedDB?new r.a.F:new Am(qe()?new Ho:new r.a.F)}catch{this.g=new Ho,this.h=!0}try{this.i=new r.a.cb}catch{this.i=new Ho}this.v=new Ho,this.f=C(this.Zb,this),this.b={}}var vl;function Go(){return vl||(vl=new Cm),vl}function wr(r,s){switch(s){case"session":return r.i;case"none":return r.v;default:return r.g}}function yi(r,s){return"firebase:"+r.name+(s?":"+s:"")}function $S(r,s,a){var h=yi(s,a),p=wr(r,s.F);return r.get(s,a).then(function(v){var m=null;try{m=fi(f.localStorage.getItem(h))}catch{}if(m&&!v)return f.localStorage.removeItem(h),r.set(s,m,a);m&&v&&p.type!="localStorage"&&f.localStorage.removeItem(h)})}e=Cm.prototype,e.get=function(r,s){return wr(this,r.F).get(yi(r,s))};function wi(r,s,a){return a=yi(s,a),s.F=="local"&&(r.b[a]=null),wr(r,s.F).U(a)}e.set=function(r,s,a){var h=yi(r,a),p=this,v=wr(this,r.F);return v.set(h,s).then(function(){return v.get(h)}).then(function(m){r.F=="local"&&(p.b[h]=m)})},e.addListener=function(r,s,a){r=yi(r,s),this.l&&(this.b[r]=f.localStorage.getItem(r)),rr(this.a)&&(wr(this,"local").ca(this.f),this.h||(hh()||!rg())&&f.indexedDB||!this.l||WS(this)),this.a[r]||(this.a[r]=[]),this.a[r].push(a)},e.removeListener=function(r,s,a){r=yi(r,s),this.a[r]&&(je(this.a[r],function(h){return h==a}),this.a[r].length==0&&delete this.a[r]),rr(this.a)&&(wr(this,"local").ia(this.f),gl(this))};function WS(r){gl(r),r.c=setInterval(function(){for(var s in r.a){var a=f.localStorage.getItem(s),h=r.b[s];a!=h&&(r.b[s]=a,a=new sr({type:"storage",key:s,target:window,oldValue:h,newValue:a,a:!0}),r.Zb(a))}},1e3)}function gl(r){r.c&&(clearInterval(r.c),r.c=null)}e.Zb=function(r){if(r&&r.g){var s=r.a.key;if(s==null)for(var a in this.a){var h=this.b[a];typeof h>"u"&&(h=null);var p=f.localStorage.getItem(a);p!==h&&(this.b[a]=p,this.nb(a))}else if(s.indexOf("firebase:")==0&&this.a[s]){if(typeof r.a.a<"u"?wr(this,"local").ia(this.f):gl(this),this.m){if(a=f.localStorage.getItem(s),h=r.a.newValue,h!==a)h!==null?f.localStorage.setItem(s,h):f.localStorage.removeItem(s);else if(this.b[s]===h&&typeof r.a.a>"u")return}var v=this;a=function(){(typeof r.a.a<"u"||v.b[s]!==f.localStorage.getItem(s))&&(v.b[s]=f.localStorage.getItem(s),v.nb(s))},Ve&&Cn&&Cn==10&&f.localStorage.getItem(s)!==r.a.newValue&&r.a.newValue!==r.a.oldValue?setTimeout(a,10):a()}}else wt(r,C(this.nb,this))},e.nb=function(r){this.a[r]&&wt(this.a[r],function(s){s()})};function XS(r){this.a=r,this.b=Go()}var ml={name:"authEvent",F:"local"};function QS(r){return r.b.get(ml,r.a).then(function(s){return Mg(s)})}function YS(){this.a=Go()}function JS(){this.b=-1}function Uu(r,s){this.b=Rm,this.f=f.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=r,this.h=s,this.l=f.Int32Array?new Int32Array(64):Array(64),ju===void 0&&(f.Int32Array?ju=new Int32Array(Pm):ju=Pm),this.reset()}var ju;x(Uu,JS);for(var Rm=64,ZS=Rm-1,Dm=[],yl=0;yl<ZS;yl++)Dm[yl]=0;var Om=Fc(128,Dm);Uu.prototype.reset=function(){this.g=this.c=0,this.a=f.Int32Array?new Int32Array(this.h):nr(this.h)};function wl(r){for(var s=r.f,a=r.l,h=0,p=0;p<s.length;)a[h++]=s[p]<<24|s[p+1]<<16|s[p+2]<<8|s[p+3],p=4*h;for(s=16;64>s;s++){p=a[s-15]|0,h=a[s-2]|0;var v=(a[s-16]|0)+((p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3)|0,m=(a[s-7]|0)+((h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10)|0;a[s]=v+m|0}h=r.a[0]|0,p=r.a[1]|0;var b=r.a[2]|0,R=r.a[3]|0,O=r.a[4]|0,X=r.a[5]|0,at=r.a[6]|0;for(v=r.a[7]|0,s=0;64>s;s++){var ot=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&p^h&b^p&b)|0;m=O&X^~O&at,v=v+((O>>>6|O<<26)^(O>>>11|O<<21)^(O>>>25|O<<7))|0,m=m+(ju[s]|0)|0,m=v+(m+(a[s]|0)|0)|0,v=at,at=X,X=O,O=R+m|0,R=b,b=p,p=h,h=m+ot|0}r.a[0]=r.a[0]+h|0,r.a[1]=r.a[1]+p|0,r.a[2]=r.a[2]+b|0,r.a[3]=r.a[3]+R|0,r.a[4]=r.a[4]+O|0,r.a[5]=r.a[5]+X|0,r.a[6]=r.a[6]+at|0,r.a[7]=r.a[7]+v|0}function bl(r,s,a){a===void 0&&(a=s.length);var h=0,p=r.c;if(typeof s=="string")for(;h<a;)r.f[p++]=s.charCodeAt(h++),p==r.b&&(wl(r),p=0);else if(T(s))for(;h<a;){var v=s[h++];if(!(typeof v=="number"&&0<=v&&255>=v&&v==(v|0)))throw Error("message must be a byte array");r.f[p++]=v,p==r.b&&(wl(r),p=0)}else throw Error("message must be string or array");r.c=p,r.g+=a}var Pm=[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,2756
20734187,3204031479,3329325298];function xm(){Uu.call(this,8,tA)}x(xm,Uu);var tA=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function Lm(r,s,a,h,p,v){this.v=r,this.i=s,this.l=a,this.m=h||null,this.u=p||null,this.s=v,this.h=s+":"+a,this.C=new YS,this.g=new XS(this.h),this.f=null,this.b=[],this.a=this.c=null}function Vu(r){return new _("invalid-cordova-configuration",r)}e=Lm.prototype,e.ma=function(){return this.Ia?this.Ia:this.Ia=$_().then(function(){if(typeof gt("universalLinks.subscribe",f)!="function")throw Vu("cordova-universal-links-plugin-fix is not installed");if(typeof gt("BuildInfo.packageName",f)>"u")throw Vu("cordova-plugin-buildinfo is not installed");if(typeof gt("cordova.plugins.browsertab.openUrl",f)!="function")throw Vu("cordova-plugin-browsertab is not installed");if(typeof gt("cordova.InAppBrowser.open",f)!="function")throw Vu("cordova-plugin-inappbrowser is not installed")},function(){throw new _("cordova-not-ready")})};function eA(){for(var r=20,s=[];0<r;)s.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),r--;return s.join("")}function nA(r){var s=new xm;bl(s,r),r=[];var a=8*s.g;56>s.c?bl(s,Om,56-s.c):bl(s,Om,s.b-(s.c-56));for(var h=63;56<=h;h--)s.f[h]=a&255,a/=256;for(wl(s),h=a=0;h<s.i;h++)for(var p=24;0<=p;p-=8)r[a++]=s.a[h]>>p&255;return pE(r)}e.Pb=function(r,s){return s(new _("operation-not-supported-in-this-environment")),z()},e.Nb=function(){return vt(new _("operation-not-supported-in-this-environment"))},e.ac=function(){return!1},e.Yb=function(){return!0},e.Ub=function(){return!0},e.Ob=function(r,s,a,h){if(this.c)return vt(new _("redirect-operation-pending"));var p=this,v=f.document,m=null,b=null,R=null,O=null;return this.c=z().then(function(){return Mh(s),Fm(p)}).then(function(){return rA(p,r,s,a,h)}).then(function(){return new tt(function(X,at){b=function(){var ot=gt("cordova.plugins.browsertab.close",f);return X(),typeof ot=="function"&&ot(),p.a&&typeof p.a.close=="function"&&(p.a.close(),p.a=null),!1},p.Ea(b),R=function(){m||(m=si(2e3).then(function(){at(new _("redirect-cancelled-by-user"))}))},O=function(){vh()&&R()},v.addEventListener("resume",R,!1),Vt().toLowerCase().match(/android/)||v.addEventListener("visibilitychange",O,!1)}).o(function(X){return Il(p).then(function(){throw X})})}).oa(function(){R&&v.removeEventListener("resume",R,!1),O&&v.removeEventListener("visibilitychange",O,!1),m&&m.cancel(),b&&p.Ta(b),p.c=null})};function rA(r,s,a,h,p){var v=eA(),m=new Be(s,h,null,v,new _("no-auth-event"),null,p),b=gt("BuildInfo.packageName",f);if(typeof b!="string")throw new _("invalid-cordova-configuration");var R=gt("BuildInfo.displayName",f),O={};if(Vt().toLowerCase().match(/iphone|ipad|ipod/))O.ibi=b;else if(Vt().toLowerCase().match(/android/))O.apn=b;else return vt(new _("operation-not-supported-in-this-environment"));R&&(O.appDisplayName=R),v=nA(v),O.sessionId=v;var X=qo(r.v,r.i,r.l,s,a,null,h,r.m,O,r.u,p,r.s);return r.ma().then(function(){var at=r.h;return r.C.a.set(ml,m.w(),at)}).then(function(){var at=gt("cordova.plugins.browsertab.isAvailable",f);if(typeof at!="function")throw new _("invalid-cordova-configuration");var ot=null;at(function(Ft){if(Ft){if(ot=gt("cordova.plugins.browsertab.openUrl",f),typeof ot!="function")throw new _("invalid-cordova-configuration");ot(X)}else{if(ot=gt("cordova.InAppBrowser.open",f),typeof ot!="function")throw new _("invalid-cordova-configuration");Ft=Vt(),r.a=ot(X,Ft.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||Ft.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}})})}function Mm(r,s){for(var a=0;a<r.b.length;a++)try{r.b[a](s)}catch{}}function Fm(r){return r.f||(r.f=r.ma().then(function(){return new tt(function(s){function a(h){return s(h),r.Ta(a),!1}r.Ea(a),iA(r)})})),r.f}function Il(r){var s=null;return QS(r.g).then(function(a){return s=a,a=r.g,wi(a.b,ml,a.a)}).then(function(){return s})}function iA(r){function s(m){h=!0,p&&p.cancel(),Il(r).then(function(b){var R=a;if(b&&m&&m.url){var O=null;R=Ng(m.url),R.indexOf("/__/auth/callback")!=-1&&(O=de(R),O=fi(Pe(O,"firebaseError")||null),O=(O=typeof O=="object"?te(O):null)?new Be(b.c,b.b,null,null,O,null,b.T()):new Be(b.c,b.b,R,b.f,null,null,b.T())),R=O||a}Mm(r,R)})}var a=new Be("unknown",null,null,null,new _("no-auth-event")),h=!1,p=si(500).then(function(){return Il(r).then(function(){h||Mm(r,a)})}),v=f.handleOpenURL;f.handleOpenURL=function(m){if(m.toLowerCase().indexOf(gt("BuildInfo.packageName",f).toLowerCase()+"://")==0&&s({url:m}),typeof v=="function")try{v(m)}catch(b){console.error(b)}},Fh||(Fh=new IE),TE(s)}e.Ea=function(r){this.b.push(r),Fm(this).o(function(s){s.code==="auth/invalid-cordova-configuration"&&(s=new Be("unknown",null,null,null,new _("no-auth-event")),r(s))})},e.Ta=function(r){je(this.b,function(s){return s==r})};function oA(r){this.a=r,this.b=Go()}var Tl={name:"pendingRedirect",F:"session"};
20function sA(r){return r.b.set(Tl,"pending",r.a)}function _l(r){return wi(r.b,Tl,r.a)}function uA(r){return r.b.get(Tl,r.a).then(function(s){return s=="pending"})}function qu(r,s,a,h){this.i={},this.u=0,this.D=r,this.v=s,this.m=a,this.J=h,this.h=[],this.f=!1,this.l=C(this.s,this),this.b=new Ku,this.C=new $m,this.g=new oA(Hm(this.v,this.m)),this.c={},this.c.unknown=this.b,this.c.signInViaRedirect=this.b,this.c.linkViaRedirect=this.b,this.c.reauthViaRedirect=this.b,this.c.signInViaPopup=this.C,this.c.linkViaPopup=this.C,this.c.reauthViaPopup=this.C,this.a=Um(this.D,this.v,this.m,po,this.J)}function Um(r,s,a,h,p){var v=H.SDK_VERSION||null;return lh()?new Lm(r,s,a,v,h,p):new hm(r,s,a,v,h,p)}qu.prototype.reset=function(){this.f=!1,this.a.Ta(this.l),this.a=Um(this.D,this.v,this.m,null,this.J),this.i={}};function jm(r){r.f||(r.f=!0,r.a.Ea(r.l));var s=r.a;return r.a.ma().o(function(a){throw r.a==s&&r.reset(),a})}function Vm(r){r.a.Yb()&&jm(r).o(function(s){var a=new Be("unknown",null,null,null,new _("operation-not-supported-in-this-environment"));Sl(s)&&r.s(a)}),r.a.Ub()||Gm(r.b)}function Bu(r,s){pn(r.h,s)||r.h.push(s),r.f||uA(r.g).then(function(a){a?_l(r.g).then(function(){jm(r).o(function(h){var p=new Be("unknown",null,null,null,new _("operation-not-supported-in-this-environment"));Sl(h)&&r.s(p)})}):Vm(r)}).o(function(){Vm(r)})}function El(r,s){je(r.h,function(a){return a==s})}qu.prototype.s=function(r){if(!r)throw new _("invalid-auth-event");if(6e5<=Date.now()-this.u&&(this.i={},this.u=0),r&&r.getUid()&&this.i.hasOwnProperty(r.getUid()))return!1;for(var s=!1,a=0;a<this.h.length;a++){var h=this.h[a];if(h.Gb(r.c,r.b)){(s=this.c[r.c])&&(s.h(r,h),r&&(r.f||r.b)&&(this.i[r.getUid()]=!0,this.u=Date.now())),s=!0;break}}return Gm(this.b),s};var aA=new On(2e3,1e4),cA=new On(3e4,6e4);qu.prototype.ra=function(){return this.b.ra()};function qm(r,s,a,h,p,v,m){return r.a.Nb(s,a,h,function(){r.f||(r.f=!0,r.a.Ea(r.l))},function(){r.reset()},p,v,m)}function Sl(r){return!!(r&&r.code=="auth/cordova-not-ready")}function Bm(r,s,a,h,p){var v;return sA(r.g).then(function(){return r.a.Ob(s,a,h,p).o(function(m){if(Sl(m))throw new _("operation-not-supported-in-this-environment");return v=m,_l(r.g).then(function(){throw v})}).then(function(){return r.a.ac()?new tt(function(){}):_l(r.g).then(function(){return r.ra()}).then(function(){}).o(function(){})})})}function Km(r,s,a,h,p){return r.a.Pb(h,function(v){s.na(a,null,v,p)},aA.get())}var Al={};function Hm(r,s,a){return r=r+":"+s,a&&(r=r+":"+a.url),r}function kl(r,s,a,h){var p=Hm(s,a,h);return Al[p]||(Al[p]=new qu(r,s,a,h)),Al[p]}function Ku(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}Ku.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Ku.prototype.h=function(r,s){if(r){this.reset(),this.g=!0;var a=r.c,h=r.b,p=r.a&&r.a.code=="auth/web-storage-unsupported",v=r.a&&r.a.code=="auth/operation-not-supported-in-this-environment";this.i=!(!p&&!v),a!="unknown"||p||v?r.a?(br(this,!0,null,r.a),z()):s.Fa(a,h)?hA(this,r,s):vt(new _("invalid-auth-event")):(br(this,!1,null,null),z())}else vt(new _("invalid-auth-event"))};function Gm(r){r.g||(r.g=!0,br(r,!1,null,null))}function Hu(r){r.g&&!r.i&&br(r,!1,null,null)}function hA(r,s,a){a=a.Fa(s.c,s.b);var h=s.g,p=s.f,v=s.i,m=s.T(),b=!!s.c.match(/Redirect$/);a(h,p,m,v).then(function(R){br(r,b,R,null)}).o(function(R){br(r,b,null,R)})}function lA(r,s){if(r.b=function(){return vt(s)},r.c.length)for(var a=0;a<r.c.length;a++)r.c[a](s)}function zm(r,s){if(r.b=function(){return z(s)},r.f.length)for(var a=0;a<r.f.length;a++)r.f[a](s)}function br(r,s,a,h){s?h?lA(r,h):zm(r,a):zm(r,{user:null}),r.f=[],r.c=[]}Ku.prototype.ra=function(){var r=this;return new tt(function(s,a){r.b?r.b().then(s,a):(r.f.push(s),r.c.push(a),fA(r))})};function fA(r){var s=new _("timeout");r.a&&r.a.cancel(),r.a=si(cA.get()).then(function(){r.b||(r.g=!0,br(r,!0,null,s))})}function $m(){}$m.prototype.h=function(r,s){if(r){var a=r.c,h=r.b;r.a?(s.na(r.c,null,r.a,r.b),z()):s.Fa(a,h)?pA(r,s):vt(new _("invalid-auth-event"))}else vt(new _("invalid-auth-event"))};function pA(r,s){var a=r.b,h=r.c;s.Fa(h,a)(r.g,r.f,r.T(),r.i).then(function(p){s.na(h,p,null,a)}).o(function(p){s.na(h,null,p,a)})}function Wm(){this.jb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.jb},set:function(r){this.jb=r},enumerable:!1})}function Nl(r,s){this.a=s,q(this,"verificationId",r)}Nl.prototype.confirm=function(r){return r=Lg(this.verificationId,r),this.a(r)}
20;function Cl(r,s,a,h){return new gn(r).gb(s,a).then(function(p){return new Nl(p,h)})}function dA(r){var s=bg(r);if(!(s&&s.exp&&s.auth_time&&s.iat))throw new _("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");ne(this,{token:r,expirationTime:Ao(1e3*s.exp),authTime:Ao(1e3*s.auth_time),issuedAtTime:Ao(1e3*s.iat),signInProvider:s.firebase&&s.firebase.sign_in_provider?s.firebase.sign_in_provider:null,signInSecondFactor:s.firebase&&s.firebase.sign_in_second_factor?s.firebase.sign_in_second_factor:null,claims:s})}function Rl(r,s,a){var h=s&&s[Qm];if(!h)throw new _("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=r,this.f=Nn(s),this.g=a,this.c=new wu(null,h),this.b=[];var p=this;wt(s[Xm]||[],function(v){(v=Ih(v))&&p.b.push(v)}),q(this,"auth",this.a),q(this,"session",this.c),q(this,"hints",this.b)}var Xm="mfaInfo",Qm="mfaPendingCredential";Rl.prototype.Rc=function(r){var s=this;return r.tb(this.a.a,this.c).then(function(a){var h=Nn(s.f);return delete h[Xm],delete h[Qm],le(h,a),s.g(h)})};function Dl(r,s,a,h){_.call(this,"multi-factor-auth-required",h,s),this.b=new Rl(r,s,a),q(this,"resolver",this.b)}x(Dl,_);function Ym(r,s,a){if(r&&N(r.serverResponse)&&r.code==="auth/multi-factor-auth-required")try{return new Dl(s,r.serverResponse,a,r.message)}catch{}return null}function Jm(){}Jm.prototype.tb=function(r,s,a){return s.type==Ro?vA(this,r,s,a):gA(this,r,s)};function vA(r,s,a,h){return a.Ha().then(function(p){return p={idToken:p},typeof h<"u"&&(p.displayName=h),le(p,{phoneVerificationInfo:Do(r.a)}),et(s,iS,p)})}function gA(r,s,a){return a.Ha().then(function(h){return h={mfaPendingCredential:h},le(h,{phoneVerificationInfo:Do(r.a)}),et(s,oS,h)})}function Ol(r){q(this,"factorId",r.fa),this.a=r}x(Ol,Jm);function Zm(r){if(Ol.call(this,r),this.a.fa!=gn.PROVIDER_ID)throw new _("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential")}x(Zm,Ol);function bi(r,s){pe.call(this,r);for(var a in s)this[a]=s[a]}x(bi,pe);function Pl(r,s){this.a=r,this.b=[],this.c=C(this.yc,this),Oe(this.a,"userReloaded",this.c);var a=[];s&&s.multiFactor&&s.multiFactor.enrolledFactors&&wt(s.multiFactor.enrolledFactors,function(h){var p=null,v={};if(h){h.uid&&(v[_h]=h.uid),h.displayName&&(v[og]=h.displayName),h.enrollmentTime&&(v[Th]=new Date(h.enrollmentTime).toISOString()),h.phoneNumber&&(v[Eh]=h.phoneNumber);try{p=new ko(v)}catch{}h=p}else h=null;h&&a.push(h)}),Gu(this,a)}function mA(r){var s=[];return wt(r.mfaInfo||[],function(a){(a=Ih(a))&&s.push(a)}),s}e=Pl.prototype,e.yc=function(r){Gu(this,mA(r.hd))};function Gu(r,s){r.b=s,q(r,"enrolledFactors",s)}e.Sb=function(){return this.a.I().then(function(r){return new wu(r,null)})},e.fc=function(r,s){var a=this,h=this.a.a;return this.Sb().then(function(p){return r.tb(h,p,s)}).then(function(p){return nn(a.a,p),a.a.reload()})},e.bd=function(r){var s=this,a=typeof r=="string"?r:r.uid,h=this.a.a;return this.a.I().then(function(p){return et(h,SS,{idToken:p,mfaEnrollmentId:a})}).then(function(p){var v=WT(s.b,function(m){return m.uid!=a});return Gu(s,v),nn(s.a,p),s.a.reload().o(function(m){if(m.code!="auth/user-token-expired")throw m})})},e.w=function(){return{multiFactor:{enrolledFactors:Qs(this.b,function(r){return r.w()})}}};function xl(r,s,a){if(this.h=r,this.i=s,this.g=a,this.c=3e4,this.f=96e4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}xl.prototype.start=function(){this.a=this.c,Ll(this,!0)};function yA(r,s){return s?(r.a=r.c,r.g()):(s=r.a,r.a*=2,r.a>r.f&&(r.a=r.f),s)}function Ll(r,s){r.stop(),r.b=si(yA(r,s)).then(function(){return X_()}).then(function(){return r.h()}).then(function(){Ll(r,!0)}).o(function(a){r.i(a)&&Ll(r,!1)})}xl.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)};function Ml(r){this.f=r,this.b=this.a=null,this.c=Date.now()}Ml.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}};function ty(r,s){typeof s>"u"&&(r.b?(s=r.b,s=s.a-s.g):s=0),r.c=Date.now()+1e3*s}function ey(r,s){r.b=mu(s[He]||""),r.a=s.refreshToken,s=s.expiresIn,ty(r,typeof s<"u"?Number(s):void 0)}function wA(r,s){r.b=s.b,r.a=s.a,r.c=s.c}
20function bA(r,s){return BE(r.f,s).then(function(a){return r.b=mu(a.access_token),r.a=a.refresh_token,ty(r,a.expires_in),{accessToken:r.b.toString(),refreshToken:r.a}}).o(function(a){throw a.code=="auth/user-token-expired"&&(r.a=null),a})}Ml.prototype.getToken=function(r){return r=!!r,this.b&&!this.a?vt(new _("user-token-expired")):r||!this.b||Date.now()>this.c-3e4?this.a?bA(this,{grant_type:"refresh_token",refresh_token:this.a}):z(null):z({accessToken:this.b.toString(),refreshToken:this.a})};function zu(r,s){this.a=r||null,this.b=s||null,ne(this,{lastSignInTime:Ao(s||null),creationTime:Ao(r||null)})}function IA(r){return new zu(r.a,r.b)}zu.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}};function TA(r,s,a,h,p,v){ne(this,{uid:r,displayName:h||null,photoURL:p||null,email:a||null,phoneNumber:v||null,providerId:s})}function Ee(r,s,a){this.N=[],this.l=r.apiKey,this.m=r.appName,this.s=r.authDomain||null;var h=H.SDK_VERSION?hi(H.SDK_VERSION):null;this.a=new Ke(this.l,fo(po),h),(this.u=r.emulatorConfig||null)&&xu(this.a,this.u),this.h=new Ml(this.a),Kl(this,s[He]),ey(this.h,s),q(this,"refreshToken",this.h.a),ry(this,a||{}),ee.call(this),this.P=!1,this.s&&hr()&&(this.b=kl(this.s,this.l,this.m,this.u)),this.W=[],this.i=null,this.D=_A(this),this.ba=C(this.ib,this);var p=this;this.za=null,this.Pa=function(v){p.xa(v.h)},this.qa=null,this.Ba=function(v){Fl(p,v.c)},this.$=null,this.aa=[],this.Oa=function(v){zo(p,v.f)},this.ja=null,this.S=new Pl(this,a),q(this,"multiFactor",this.S)}x(Ee,ee),Ee.prototype.xa=function(r){this.za=r,Yg(this.a,r)};function Fl(r,s){r.u=s,xu(r.a,s),r.b&&(s=r.b,r.b=kl(r.s,r.l,r.m,r.u),r.P&&(El(s,r),Bu(r.b,r)))}Ee.prototype.la=function(){return this.za};function Ul(r,s){r.qa&&Te(r.qa,"languageCodeChanged",r.Pa),(r.qa=s)&&Oe(s,"languageCodeChanged",r.Pa)}function jl(r,s){r.$&&Te(r.$,"emulatorConfigChanged",r.Ba),(r.$=s)&&Oe(s,"emulatorConfigChanged",r.Ba)}function zo(r,s){r.aa=s,Jg(r.a,H.SDK_VERSION?hi(H.SDK_VERSION,r.aa):null)}Ee.prototype.Ga=function(){return nr(this.aa)};function Vl(r,s){r.ja&&Te(r.ja,"frameworkChanged",r.Oa),(r.ja=s)&&Oe(s,"frameworkChanged",r.Oa)}Ee.prototype.ib=function(){this.D.b&&(this.D.stop(),this.D.start())};function ql(r){try{return H.app(r.m).auth()}catch{throw new _("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+r.m+"'!")}}function _A(r){return new xl(function(){return r.I(!0)},function(s){return!!(s&&s.code=="auth/network-request-failed")},function(){var s=r.h.c-Date.now()-3e5;return 0<s?s:0})}function ny(r){r.J||r.D.b||(r.D.start(),Te(r,"tokenChanged",r.ba),Oe(r,"tokenChanged",r.ba))}function Bl(r){Te(r,"tokenChanged",r.ba),r.D.stop()}function Kl(r,s){r.Aa=s,q(r,"_lat",s)}function EA(r,s){je(r.W,function(a){return a==s})}function Ir(r){for(var s=[],a=0;a<r.W.length;a++)s.push(r.W[a](r));return bv(s).then(function(){return r})}function $o(r){r.b&&!r.P&&(r.P=!0,Bu(r.b,r))}function ry(r,s){ne(r,{uid:s.uid,displayName:s.displayName||null,photoURL:s.photoURL||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,isAnonymous:s.isAnonymous||!1,tenantId:s.tenantId||null,metadata:new zu(s.createdAt,s.lastLoginAt),providerData:[]}),r.a.b=r.tenantId}q(Ee.prototype,"providerId","firebase");function iy(){}function Hl(r){return z().then(function(){if(r.J)throw new _("app-deleted")})}function Gl(r){return Qs(r.providerData,function(s){return s.providerId})}function zl(r,s){s&&(oy(r,s.providerId),r.providerData.push(s))}function oy(r,s){je(r.providerData,function(a){return a.providerId==s})}function Ln(r,s,a){(s!="uid"||a)&&r.hasOwnProperty(s)&&q(r,s,a)}function $u(r,s){r!=s&&(ne(r,{uid:s.uid,displayName:s.displayName,photoURL:s.photoURL,email:s.email,emailVerified:s.emailVerified,phoneNumber:s.phoneNumber,isAnonymous:s.isAnonymous,tenantId:s.tenantId,providerData:[]}),s.metadata?q(r,"metadata",IA(s.metadata)):q(r,"metadata",new zu),wt(s.providerData,function(a){zl(r,a)}),wA(r.h,s.h),q(r,"refreshToken",r.h.a),Gu(r.S,s.S.b))}e=Ee.prototype,e.reload=function(){var r=this;
20return xt(this,Hl(this).then(function(){return $l(r).then(function(){return Ir(r)}).then(iy)}))};function $l(r){return r.I().then(function(s){var a=r.isAnonymous;return SA(r,s).then(function(){return a||Ln(r,"isAnonymous",!1),s})})}e.oc=function(r){return this.I(r).then(function(s){return new dA(s)})},e.I=function(r){var s=this;return xt(this,Hl(this).then(function(){return s.h.getToken(r)}).then(function(a){if(!a)throw new _("internal-error");return a.accessToken!=s.Aa&&(Kl(s,a.accessToken),s.dispatchEvent(new bi("tokenChanged"))),Ln(s,"refreshToken",a.refreshToken),a.accessToken}))};function nn(r,s){s[He]&&r.Aa!=s[He]&&(ey(r.h,s),r.dispatchEvent(new bi("tokenChanged")),Kl(r,s[He]),Ln(r,"refreshToken",r.h.a))}function SA(r,s){return et(r.a,sS,{idToken:s}).then(C(r.Kc,r))}e.Kc=function(r){if(r=r.users,!r||!r.length)throw new _("internal-error");r=r[0],ry(this,{uid:r.localId,displayName:r.displayName,photoURL:r.photoUrl,email:r.email,emailVerified:!!r.emailVerified,phoneNumber:r.phoneNumber,lastLoginAt:r.lastLoginAt,createdAt:r.createdAt,tenantId:r.tenantId});for(var s=AA(r),a=0;a<s.length;a++)zl(this,s[a]);Ln(this,"isAnonymous",!(this.email&&r.passwordHash)&&!(this.providerData&&this.providerData.length)),this.dispatchEvent(new bi("userReloaded",{hd:r}))};function AA(r){return(r=r.providerUserInfo)&&r.length?Qs(r,function(s){return new TA(s.rawId,s.providerId,s.email,s.displayName,s.photoUrl,s.phoneNumber)}):[]}e.Lc=function(r){return gh("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.ub(r)},e.ub=function(r){var s=this,a=null;return xt(this,r.c(this.a,this.uid).then(function(h){return nn(s,h),a=Wo(s,h,"reauthenticate"),s.i=null,s.reload()}).then(function(){return a}),!0)};function Wu(r,s){return $l(r).then(function(){if(pn(Gl(r),s))return Ir(r).then(function(){throw new _("provider-already-linked")})})}e.Cc=function(r){return gh("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.rb(r)},e.rb=function(r){var s=this,a=null;return xt(this,Wu(this,r.providerId).then(function(){return s.I()}).then(function(h){return r.b(s.a,h)}).then(function(h){return a=Wo(s,h,"link"),sy(s,h)}).then(function(){return a}))},e.Dc=function(r,s){var a=this;return xt(this,Wu(this,"phone").then(function(){return Cl(ql(a),r,s,C(a.rb,a))}))},e.Mc=function(r,s){var a=this;return xt(this,z().then(function(){return Cl(ql(a),r,s,C(a.ub,a))}),!0)};function Wo(r,s,a){var h=Lh(s);return s=Tg(s),tn({user:r,credential:h,additionalUserInfo:s,operationType:a})}function sy(r,s){return nn(r,s),r.reload().then(function(){return r})}e.Cb=function(r){var s=this;return xt(this,this.I().then(function(a){return s.a.Cb(a,r)}).then(function(a){return nn(s,a),s.reload()}))},e.ed=function(r){var s=this;return xt(this,this.I().then(function(a){return r.b(s.a,a)}).then(function(a){return nn(s,a),s.reload()}))},e.Db=function(r){var s=this;return xt(this,this.I().then(function(a){return s.a.Db(a,r)}).then(function(a){return nn(s,a),s.reload()}))},e.Eb=function(r){if(r.displayName===void 0&&r.photoURL===void 0)return Hl(this);var s=this;return xt(this,this.I().then(function(a){return s.a.Eb(a,{displayName:r.displayName,photoUrl:r.photoURL})}).then(function(a){return nn(s,a),Ln(s,"displayName",a.displayName||null),Ln(s,"photoURL",a.photoUrl||null),wt(s.providerData,function(h){h.providerId==="password"&&(q(h,"displayName",s.displayName),q(h,"photoURL",s.photoURL))}),Ir(s)}).then(iy))},e.cd=function(r){var s=this;return xt(this,$l(this).then(function(a){return pn(Gl(s),r)?XE(s.a,a,[r]).then(function(h){var p={};return wt(h.providerUserInfo||[],function(v){p[v.providerId]=!0}),wt(Gl(s),function(v){p[v]||oy(s,v)}),p[gn.PROVIDER_ID]||q(s,"phoneNumber",null),Ir(s)}):Ir(s).then(function(){throw new _("no-such-provider")})}))},e.delete=function(){var r=this;return xt(this,this.I().then(function(s){return et(r.a,tS,{idToken:s})}).then(function(){r.dispatchEvent(new bi("userDeleted"))})).then(function(){for(var s=0;s<r.N.length;s++)r.N[s].cancel("app-deleted");Ul(r,null),jl(r,null),Vl(r,null),r.N=[],r.J=!0,Bl(r),q(r,"refreshToken",null),r.b&&El(r.b,r)})},e.Gb=function(r,s){return!!(r=="linkViaPopup"&&(this.g||null)==s&&this.f||r=="reauthViaPopup"&&(this.g||null)==s&&this.f||r=="linkViaRedirect"&&(this.ga||null)==s||r=="reauthViaRedirect"&&(this.ga||null)==s)},e.na=function(r,s,a,h){r!="linkViaPopup"&&r!="reauthViaPopup"||h!=(this.g||null)||(a&&this.C?this.C(a):s&&!a&&this.f&&this.f(s),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},e.Fa=function(r,s){return r=="linkViaPopup"&&s==(this.g||null)?C(this.Lb,this):r=="reauthViaPopup"&&s==(this.g||null)?C(this.Mb,this):r=="linkViaRedirect"&&(this.ga||null)==s?C(this.Lb,this):r=="reauthViaRedirect"&&(this.ga||null)==s?C(this.Mb,this):null},e.Ec=function(r){var s=this;return uy(this,"linkViaPopup",r,function(){return Wu(s,r.providerId).then(function(){return Ir(s)})},!1)},e.Nc=function(r){return uy(this,"reauthViaPopup",r,function(){return z()},!0)};
20function uy(r,s,a,h,p){if(!hr())return vt(new _("operation-not-supported-in-this-environment"));if(r.i&&!p)return vt(r.i);var v=Ch(a.providerId),m=lr(r.uid+":::"),b=null;(!Eo()||fh())&&r.s&&a.isOAuthProvider&&(b=qo(r.s,r.l,r.m,s,a,null,m,H.SDK_VERSION||null,null,null,r.tenantId,r.u));var R=Qv(b,v&&v.va,v&&v.ua);return h=h().then(function(){if(cy(r),!p)return r.I().then(function(){})}).then(function(){return qm(r.b,R,s,a,m,!!b,r.tenantId)}).then(function(){return new tt(function(O,X){r.na(s,null,new _("cancelled-popup-request"),r.g||null),r.f=O,r.C=X,r.g=m,r.c=Km(r.b,r,s,R,m)})}).then(function(O){return R&&cr(R),O?tn(O):null}).o(function(O){throw R&&cr(R),O}),xt(r,h,p)}e.Fc=function(r){var s=this;return ay(this,"linkViaRedirect",r,function(){return Wu(s,r.providerId)},!1)},e.Oc=function(r){return ay(this,"reauthViaRedirect",r,function(){return z()},!0)};function ay(r,s,a,h,p){if(!hr())return vt(new _("operation-not-supported-in-this-environment"));if(r.i&&!p)return vt(r.i);var v=null,m=lr(r.uid+":::");return h=h().then(function(){if(cy(r),!p)return r.I().then(function(){})}).then(function(){return r.ga=m,Ir(r)}).then(function(b){return r.ha&&(b=r.ha,b=b.b.set(Wl,r.w(),b.a)),b}).then(function(){return Bm(r.b,s,a,m,r.tenantId)}).o(function(b){if(v=b,r.ha)return ly(r.ha);throw v}).then(function(){if(v)throw v}),xt(r,h,p)}function cy(r){if(!r.b||!r.P)throw r.b&&!r.P?new _("internal-error"):new _("auth-domain-config-required")}e.Lb=function(r,s,a,h){var p=this;this.c&&(this.c.cancel(),this.c=null);var v=null;return a=this.I().then(function(m){return nl(p.a,{requestUri:r,postBody:h,sessionId:s,idToken:m})}).then(function(m){return v=Wo(p,m,"link"),sy(p,m)}).then(function(){return v}),xt(this,a)},e.Mb=function(r,s,a,h){var p=this;this.c&&(this.c.cancel(),this.c=null);var v=null,m=z().then(function(){return di(rl(p.a,{requestUri:r,sessionId:s,postBody:h,tenantId:a}),p.uid)}).then(function(b){return v=Wo(p,b,"reauthenticate"),nn(p,b),p.i=null,p.reload()}).then(function(){return v});return xt(this,m,!0)},e.vb=function(r){var s=this,a=null;return xt(this,this.I().then(function(h){return a=h,typeof r>"u"||rr(r)?{}:vu(new du(r))}).then(function(h){return s.a.vb(a,h)}).then(function(h){if(s.email!=h)return s.reload()}).then(function(){}))},e.Fb=function(r,s){var a=this,h=null;return xt(this,this.I().then(function(p){return h=p,typeof s>"u"||rr(s)?{}:vu(new du(s))}).then(function(p){return a.a.Fb(h,r,p)}).then(function(p){if(a.email!=p)return a.reload()}).then(function(){}))};function xt(r,s,a){var h=kA(r,s,a);return r.N.push(h),h.oa(function(){Ys(r.N,h)}),h.o(function(p){var v=null;throw p&&p.code==="auth/multi-factor-auth-required"&&(v=Ym(p.w(),ql(r),C(r.jc,r))),v||p})}e.jc=function(r){var s=null,a=this;return r=di(z(r),a.uid).then(function(h){return s=Wo(a,h,"reauthenticate"),nn(a,h),a.i=null,a.reload()}).then(function(){return s}),xt(this,r,!0)};function kA(r,s,a){return r.i&&!a?(s.cancel(),vt(r.i)):s.o(function(h){throw!h||h.code!="auth/user-disabled"&&h.code!="auth/user-token-expired"||(r.i||r.dispatchEvent(new bi("userInvalidated")),r.i=h),h})}e.toJSON=function(){return this.w()},e.w=function(){var r={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.s,stsTokenManager:this.h.w(),redirectEventId:this.ga||null};return this.metadata&&le(r,this.metadata.w()),wt(this.providerData,function(s){r.providerData.push(J_(s))}),le(r,this.S.w()),r};function hy(r){if(!r.apiKey)return null;var s={apiKey:r.apiKey,authDomain:r.authDomain,appName:r.appName,emulatorConfig:r.emulatorConfig},a={};if(r.stsTokenManager&&r.stsTokenManager.accessToken){a[He]=r.stsTokenManager.accessToken,a.refreshToken=r.stsTokenManager.refreshToken||null;var h=r.stsTokenManager.expirationTime;h&&(a.expiresIn=(h-Date.now())/1e3)}else return null;var p=new Ee(s,a,r);return r.providerData&&wt(r.providerData,function(v){v&&zl(p,tn(v))}),r.redirectEventId&&(p.ga=r.redirectEventId),p}function NA(r,s,a,h){var p=new Ee(r,s);return a&&(p.ha=a),h&&zo(p,h),p.reload().then(function(){return p})}function CA(r,s,a,h){var p=r.h,v={};return v[He]=p.b&&p.b.toString(),v.refreshToken=p.a,s=new Ee(s||{apiKey:r.l,authDomain:r.
20s,appName:r.m},v),a&&(s.ha=a),h&&zo(s,h),$u(s,r),s}function RA(r){this.a=r,this.b=Go()}var Wl={name:"redirectUser",F:"session"};function ly(r){return wi(r.b,Wl,r.a)}function DA(r,s){return r.b.get(Wl,r.a).then(function(a){return a&&s&&(a.authDomain=s),hy(a||{})})}function Xl(r){this.a=r,this.b=Go(),this.c=null,this.f=OA(this),this.b.addListener(rn("local"),this.a,C(this.g,this))}Xl.prototype.g=function(){var r=this,s=rn("local");Ii(this,function(){return z().then(function(){return r.c&&r.c.F!="local"?r.b.get(s,r.a):null}).then(function(a){if(a)return Ql(r,"local").then(function(){r.c=s})})})};function Ql(r,s){var a=[],h;for(h in mi)mi[h]!==s&&a.push(wi(r.b,rn(mi[h]),r.a));return a.push(wi(r.b,Yl,r.a)),I_(a)}function OA(r){var s=rn("local"),a=rn("session"),h=rn("none");return $S(r.b,s,r.a).then(function(){return r.b.get(a,r.a)}).then(function(p){return p?a:r.b.get(h,r.a).then(function(v){return v?h:r.b.get(s,r.a).then(function(m){return m?s:r.b.get(Yl,r.a).then(function(b){return b?rn(b):s})})})}).then(function(p){return r.c=p,Ql(r,p.F)}).o(function(){r.c||(r.c=s)})}var Yl={name:"persistence",F:"session"};function rn(r){return{name:"authUser",F:r}}Xl.prototype.yb=function(r){var s=null,a=this;return zS(r),Ii(this,function(){return r!=a.c.F?a.b.get(a.c,a.a).then(function(h){return s=h,Ql(a,r)}).then(function(){if(a.c=rn(r),s)return a.b.set(a.c,s,a.a)}):z()})};function PA(r){return Ii(r,function(){return r.b.set(Yl,r.c.F,r.a)})}function fy(r,s){return Ii(r,function(){return r.b.set(r.c,s.w(),r.a)})}function py(r){return Ii(r,function(){return wi(r.b,r.c,r.a)})}function dy(r,s,a){return Ii(r,function(){return r.b.get(r.c,r.a).then(function(h){return h&&s&&(h.authDomain=s),h&&a&&(h.emulatorConfig=a),hy(h||{})})})}function Ii(r,s){return r.f=r.f.then(s,s),r.f}function Ge(r){if(this.l=!1,q(this,"settings",new Wm),q(this,"app",r),ct(this).options&&ct(this).options.apiKey)r=H.SDK_VERSION?hi(H.SDK_VERSION):null,this.a=new Ke(ct(this).options&&ct(this).options.apiKey,fo(po),r);else throw new _("invalid-api-key");this.P=[],this.s=[],this.N=[],this.Pa=H.INTERNAL.createSubscribe(C(this.zc,this)),this.W=void 0,this.ib=H.INTERNAL.createSubscribe(C(this.Ac,this)),Ti(this,null),this.i=new Xl(ct(this).options.apiKey+":"+ct(this).name),this.D=new RA(ct(this).options.apiKey+":"+ct(this).name),this.$=Tt(this,jA(this)),this.h=Tt(this,VA(this)),this.ba=!1,this.ja=C(this.Zc,this),this.Ba=C(this.da,this),this.qa=C(this.mc,this),this.za=C(this.wc,this),this.Aa=C(this.xc,this),this.b=null,MA(this),this.INTERNAL={},this.INTERNAL.delete=C(this.delete,this),this.INTERNAL.logFramework=C(this.Gc,this),this.u=0,ee.call(this),LA(this),this.J=[],this.R=null}x(Ge,ee);function vy(r){pe.call(this,"languageCodeChanged"),this.h=r}x(vy,pe);function gy(r){pe.call(this,"emulatorConfigChanged"),this.c=r}x(gy,pe);function my(r){pe.call(this,"frameworkChanged"),this.f=r}x(my,pe),e=Ge.prototype,e.yb=function(r){return r=this.i.yb(r),Tt(this,r)},e.xa=function(r){this.aa===r||this.l||(this.aa=r,Yg(this.a,this.aa),this.dispatchEvent(new vy(this.la())))},e.la=function(){return this.aa},e.fd=function(){var r=f.navigator;this.xa(r&&(r.languages&&r.languages[0]||r.language||r.userLanguage)||null)},e.gd=function(r,s){if(!this.R){if(!/^https?:\/\//.test(r))throw new _("argument-error","Emulator URL must start with a valid scheme (http:// or https://).");s=s?!!s.disableWarnings:!1,xA(s),this.R={url:r,ec:s},this.settings.jb=!0,xu(this.a,this.R),this.dispatchEvent(new gy(this.R))}};function xA(r){typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),f.document&&!r&&lu().then(function(){var s=f.document.createElement("div");s.innerText="Running in emulator mode. Do not use with production credentials.",s.style.position="fixed",s.style.width="100%",s.style.backgroundColor="#ffffff",s.style.border=".1em solid #000000",s.style.color="#b50000",s.style.bottom="0px",s.style.left="0px",s.style.margin="0px",s.style.zIndex=1e4,s.style.textAlign="center",s.classList.add("firebase-emulator-warning"),f.document.body.appendChild(s)})}e.Gc=function(r){this.J.push(r),Jg(this.a,H.SDK_VERSION?hi(H.SDK_VERSION,this.J):null),this.dispatchEvent(new my(this.J))},e.Ga=function(){return nr(this.J)},e.zb=function(r){this.S===r||this.l||(this.S=r,this.a.b=this.S)},e.T=function(){return this.S};function LA(r){Object.defineProperty(r,"lc",{get:function(){return this.la()},set:function(s){this.xa(s)},enumerable:!1}),r.aa=null,Object.defineProperty(r,"ti",{get:function(){return this.T()},set:function(s){this.zb(s)},enumerable:!1}),r.S=null,Object.defineProperty(r,"emulatorConfig",{get:function(){if(this.R){var s=de(this.R.url);s=tn({protocol:s.c,host:s.a,port:s.g,options:tn({disableWarnings:this.R.ec})})}else s=null;return s},enumerable:!1})}e.toJSON=function(){return{apiKey:ct(this).options.apiKey,authDomain:ct(this).options.authDomain,appName:ct(this).name,currentUser:J(this)&&J(this).w()}};
20function Jl(r){return r.Oa||vt(new _("auth-domain-config-required"))}function MA(r){var s=ct(r).options.authDomain,a=ct(r).options.apiKey;s&&hr()&&(r.Oa=r.$.then(function(){if(!r.l){if(r.b=kl(s,a,ct(r).name,r.R),Bu(r.b,r),J(r)&&$o(J(r)),r.m){$o(r.m);var h=r.m;h.xa(r.la()),Ul(h,r),h=r.m,zo(h,r.J),Vl(h,r),h=r.m,Fl(h,r.R),jl(h,r),r.m=null}return r.b}}))}e.Gb=function(r,s){switch(r){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==s&&!!this.f;default:return!1}},e.na=function(r,s,a,h){r=="signInViaPopup"&&this.g==h&&(a&&this.C?this.C(a):s&&!a&&this.f&&this.f(s),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},e.Fa=function(r,s){return r=="signInViaRedirect"||r=="signInViaPopup"&&this.g==s&&this.f?C(this.ic,this):null},e.ic=function(r,s,a,h){var p=this,v={requestUri:r,postBody:h,sessionId:s,tenantId:a};return this.c&&(this.c.cancel(),this.c=null),p.$.then(function(){return Tr(p,el(p.a,v))})},e.Xc=function(r){if(!hr())return vt(new _("operation-not-supported-in-this-environment"));var s=this,a=Ch(r.providerId),h=lr(),p=null;(!Eo()||fh())&&ct(this).options.authDomain&&r.isOAuthProvider&&(p=qo(ct(this).options.authDomain,ct(this).options.apiKey,ct(this).name,"signInViaPopup",r,null,h,H.SDK_VERSION||null,null,null,this.T(),this.R));var v=Qv(p,a&&a.va,a&&a.ua);return a=Jl(this).then(function(m){return qm(m,v,"signInViaPopup",r,h,!!p,s.T())}).then(function(){return new tt(function(m,b){s.na("signInViaPopup",null,new _("cancelled-popup-request"),s.g),s.f=m,s.C=b,s.g=h,s.c=Km(s.b,s,"signInViaPopup",v,h)})}).then(function(m){return v&&cr(v),m?tn(m):null}).o(function(m){throw v&&cr(v),m}),Tt(this,a)},e.Yc=function(r){if(!hr())return vt(new _("operation-not-supported-in-this-environment"));var s=this,a=Jl(this).then(function(){return PA(s.i)}).then(function(){return Bm(s.b,"signInViaRedirect",r,void 0,s.T())});return Tt(this,a)};function yy(r){if(!hr())return vt(new _("operation-not-supported-in-this-environment"));var s=Jl(r).then(function(){return r.b.ra()}).then(function(a){return a?tn(a):null});return Tt(r,s)}e.ra=function(){var r=this;return yy(this).then(function(s){return r.b&&Hu(r.b.b),s}).o(function(s){throw r.b&&Hu(r.b.b),s})},e.dd=function(r){if(!r)return vt(new _("null-user"));if(this.S!=r.tenantId)return vt(new _("tenant-id-mismatch"));var s=this,a={};a.apiKey=ct(this).options.apiKey,a.authDomain=ct(this).options.authDomain,a.appName=ct(this).name;var h=CA(r,a,s.D,s.Ga());return Tt(this,this.h.then(function(){if(ct(s).options.apiKey!=r.l)return h.reload()}).then(function(){return J(s)&&r.uid==J(s).uid?($u(J(s),r),s.da(r)):(Ti(s,h),$o(h),s.da(h))}).then(function(){Xo(s)}))};function FA(r,s){var a={};return a.apiKey=ct(r).options.apiKey,a.authDomain=ct(r).options.authDomain,a.appName=ct(r).name,r.R&&(a.emulatorConfig=r.R),r.$.then(function(){return NA(a,s,r.D,r.Ga())}).then(function(h){return J(r)&&h.uid==J(r).uid?($u(J(r),h),r.da(h)):(Ti(r,h),$o(h),r.da(h))}).then(function(){Xo(r)})}function Ti(r,s){J(r)&&(EA(J(r),r.Ba),Te(J(r),"tokenChanged",r.qa),Te(J(r),"userDeleted",r.za),Te(J(r),"userInvalidated",r.Aa),Bl(J(r))),s&&(s.W.push(r.Ba),Oe(s,"tokenChanged",r.qa),Oe(s,"userDeleted",r.za),Oe(s,"userInvalidated",r.Aa),0<r.u&&ny(s)),q(r,"currentUser",s),s&&(s.xa(r.la()),Ul(s,r),zo(s,r.J),Vl(s,r),Fl(s,r.R),jl(s,r))}e.Bb=function(){var r=this,s=this.h.then(function(){return r.b&&Hu(r.b.b),J(r)?(Ti(r,null),py(r.i).then(function(){Xo(r)})):z()});return Tt(this,s)};function UA(r){var s=DA(r.D,ct(r).options.authDomain).then(function(a){return(r.m=a)&&(a.ha=r.D),ly(r.D)});return Tt(r,s)}function jA(r){var s=ct(r).options.authDomain,a=UA(r).then(function(){return dy(r.i,s,r.R)}).then(function(h){return h?(h.ha=r.D,r.m&&(r.m.ga||null)==(h.ga||null)?h:h.reload().then(function(){return fy(r.i,h).then(function(){return h})}).o(function(p){return p.code=="auth/network-request-failed"?h:py(r.i)})):null}).then(function(h){Ti(r,h||null)});return Tt(r,a)}function VA(r){return r.$.then(function(){return yy(r)}).o(function(){}).then(function(){if(!r.l)return r.ja()}).o(function(){}).then(function(){if(!r.l){r.ba=!0;var s=r.i;s.b.addListener(rn("local"),s.a,r.ja)}})}e.Zc=function(){var r=this;return dy(this.i,ct(this).options.authDomain).then(function(s){if(!r.l){var a;if(a=J(r)&&s){a=J(r).uid;var h=s.uid;a=a==null||a===""||h===void 0||h===null||h===""?!1:a==h}if(a)return $u(J(r),s),J(r).I();(J(r)||s)&&(Ti(r,s),s&&($o(s),s.ha=r.D),r.b&&Bu(r.b,r),Xo(r))}})},e.da=function(r){return fy(this.i,r)},e.mc=function(){Xo(this),this.da(J(this))},e.wc=function(){this.Bb()},e.xc=function(){this.Bb()};function Tr(r,s){var a=null,h=null;
20return Tt(r,s.then(function(p){return a=Lh(p),h=Tg(p),FA(r,p)},function(p){var v=null;throw p&&p.code==="auth/multi-factor-auth-required"&&(v=Ym(p.w(),r,C(r.kc,r))),v||p}).then(function(){return tn({user:J(r),credential:a,additionalUserInfo:h,operationType:"signIn"})}))}e.kc=function(r){var s=this;return this.h.then(function(){return Tr(s,z(r))})},e.zc=function(r){var s=this;this.addAuthTokenListener(function(){r.next(J(s))})},e.Ac=function(r){var s=this;qA(this,function(){r.next(J(s))})},e.Ic=function(r,s,a){var h=this;return this.ba&&Promise.resolve().then(function(){typeof r=="function"?r(J(h)):typeof r.next=="function"&&r.next(J(h))}),this.Pa(r,s,a)},e.Hc=function(r,s,a){var h=this;return this.ba&&Promise.resolve().then(function(){h.W=h.getUid(),typeof r=="function"?r(J(h)):typeof r.next=="function"&&r.next(J(h))}),this.ib(r,s,a)},e.nc=function(r){var s=this,a=this.h.then(function(){return J(s)?J(s).I(r).then(function(h){return{accessToken:h}}):null});return Tt(this,a)},e.Tc=function(r){var s=this;return this.h.then(function(){return Tr(s,et(s.a,IS,{token:r}))}).then(function(a){var h=a.user;return Ln(h,"isAnonymous",!1),s.da(h),a})},e.Uc=function(r,s){var a=this;return this.h.then(function(){return Tr(a,et(a.a,um,{email:r,password:s}))})},e.dc=function(r,s){var a=this;return this.h.then(function(){return Tr(a,et(a.a,JE,{email:r,password:s}))})},e.ab=function(r){var s=this;return this.h.then(function(){return Tr(s,r.ka(s.a))})},e.Sc=function(r){return gh("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.ab(r)},e.Ab=function(){var r=this;return this.h.then(function(){var s=J(r);if(s&&s.isAnonymous){var a=tn({providerId:null,isNewUser:!1});return tn({user:s,credential:null,additionalUserInfo:a,operationType:"signIn"})}return Tr(r,r.a.Ab()).then(function(h){var p=h.user;return Ln(p,"isAnonymous",!0),r.da(p),h})})};function ct(r){return r.app}function J(r){return r.currentUser}e.getUid=function(){return J(this)&&J(this).uid||null};function Xu(r){return J(r)&&J(r)._lat||null}function Xo(r){if(r.ba){for(var s=0;s<r.s.length;s++)r.s[s]&&r.s[s](Xu(r));if(r.W!==r.getUid()&&r.N.length)for(r.W=r.getUid(),s=0;s<r.N.length;s++)r.N[s]&&r.N[s](Xu(r))}}e.cc=function(r){this.addAuthTokenListener(r),this.u++,0<this.u&&J(this)&&ny(J(this))},e.Pc=function(r){var s=this;wt(this.s,function(a){a==r&&s.u--}),0>this.u&&(this.u=0),this.u==0&&J(this)&&Bl(J(this)),this.removeAuthTokenListener(r)},e.addAuthTokenListener=function(r){var s=this;this.s.push(r),Tt(this,this.h.then(function(){s.l||pn(s.s,r)&&r(Xu(s))}))},e.removeAuthTokenListener=function(r){je(this.s,function(s){return s==r})};function qA(r,s){r.N.push(s),Tt(r,r.h.then(function(){!r.l&&pn(r.N,s)&&r.W!==r.getUid()&&(r.W=r.getUid(),s(Xu(r)))}))}e.delete=function(){this.l=!0;for(var r=0;r<this.P.length;r++)this.P[r].cancel("app-deleted");return this.P=[],this.i&&(r=this.i,r.b.removeListener(rn("local"),r.a,this.ja)),this.b&&(El(this.b,this),Hu(this.b.b)),Promise.resolve()};function Tt(r,s){return r.P.push(s),s.oa(function(){Ys(r.P,s)}),s}e.hc=function(r){return Tt(this,KE(this.a,r))},e.Bc=function(r){return!!xh(r)},e.xb=function(r,s){var a=this;return Tt(this,z().then(function(){var h=new du(s);if(!h.c)throw new _("argument-error",kh+" must be true when sending sign in link to email");return vu(h)}).then(function(h){return a.a.xb(r,h)}).then(function(){}))},e.jd=function(r){return this.Sa(r).then(function(s){return s.data.email})},e.ob=function(r,s){return Tt(this,this.a.ob(r,s).then(function(){}))},e.Sa=function(r){return Tt(this,this.a.Sa(r).then(function(s){return new tE(s)}))},e.kb=function(r){return Tt(this,this.a.kb(r).then(function(){}))},e.wb=function(r,s){var a=this;return Tt(this,z().then(function(){return typeof s>"u"||rr(s)?{}:vu(new du(s))}).then(function(h){return a.a.wb(r,h)}).then(function(){}))},e.Wc=function(r,s){return Tt(this,Cl(this,r,s,C(this.ab,this)))},e.Vc=function(r,s){var a=this;return Tt(this,z().then(function(){var h=s||_o(),p=xg(r,h);if(h=xh(h),!h)throw new _("argument-error","Invalid email link!");if(h.tenantId!==a.T())throw new _("tenant-id-mismatch");return a.ab(p)}))};function Qo(){}Qo.prototype.render=function(){},Qo.prototype.reset=function(){},Qo.prototype.getResponse=function(){},Qo.prototype.execute=function(){};function _i(){this.a={},this.b=1e12}var Zl=null;_i.prototype.render=function(r,s){return this.a[this.b.toString()]=new Qu(r,s),this.b++},_i.prototype.reset=function(r){var s=tf(this,r);r=wy(r),s&&r&&(s.delete(),delete this.a[r])},_i.prototype.getResponse=function(r){return(r=tf(this,r))?r.getResponse():null},_i.prototype.execute=function(r){(r=tf(this,r))&&r.execute()};function tf(r,s){return(s=wy(s))&&r.a[s]||null}function wy(r){return(r=typeof r>"u"?1e12:r)?r.toString():null}function Qu(r,s){this.g=!1,this.c=s,this.a=this.b=null,this.h=this.c.size!=="invisible",this.f=go(r);var a=this;this.i=function(){a.execute()},this.h?this.execute():Oe(this.f,"click",this.i)}Qu.prototype.getResponse=function(){return ef(this),this.b},Qu.prototype.execute=function(){ef(this);var r=this;this.a||(this.a=setTimeout(function(){r.b=W_();var s=r.c.callback,a=r.c["expired-callback"];if(s)try{s(r.b)}catch{}r.a=setTimeout(function(){if(r.a=null,r.b=null,a)try{a()}catch{}r.h&&r.execute()},6e4)},500))},Qu.prototype.delete=function(){ef(this),this.g=!0,clearTimeout(this.a),this.a=null,Te(this.f,"click",this.i)};function ef(r){if(r.g)throw Error("reCAPTCHA mock was already deleted!")}function nf(){}q(nf,"FACTOR_ID","phone");function rf(){}rf.prototype.g=function(){return Zl||(Zl=new _i),z(Zl)},rf.prototype.c=function(){};var of=null;function sf(){this.b=f.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var BA=new Ye(Js,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),KA=new On(3e4,6e4);sf.prototype.g=function(r){var s=this;return new tt(function(a,h){var p=setTimeout(function(){h(new _("network-request-failed"))},KA.get());if(!f.grecaptcha||r!==s.f&&!s.b){f[s.a]=function(){if(f.grecaptcha){s.f=r;var m=f.grecaptcha.render;f.grecaptcha.render=function(b,R){return b=m(b,R),s.b++,b},clearTimeout(p),a(f.grecaptcha)}else clearTimeout(p),h(new _("internal-error"));delete f[s.a]};var v=Vc(BA,{onload:s.a,hl:r||""});z(Wh(v)).o(function(){clearTimeout(p),h(new _("internal-error","Unable to load external reCAPTCHA dependencies!"))})}else clearTimeout(p),a(f.grecaptcha)})},sf.prototype.c=function(){this.b--};var uf=null;function af(r,s,a,h,p,v,m){if(q(this,"type","recaptcha"),this.c=this.f=null,this.J=!1,this.v=s,this.g=null,m?(of||(of=new rf),m=of):(uf||(uf=new sf),m=uf),this.m=m,this.a=a||{theme:"light",type:"image"},this.h=[],this.a[Ty])throw new _("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i=this.a[HA]==="invisible",!f.document)throw new _("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!go(s)||!this.i&&go(s).hasChildNodes())throw new _("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new Ke(r,v||null,p||null),this.u=h||function(){return null};var b=this;this.l=[];var R=this.a[by];this.a[by]=function(X){if(_y(b,X),typeof R=="function")R(X);
20else if(typeof R=="string"){var at=gt(R,f);typeof at=="function"&&at(X)}};var O=this.a[Iy];this.a[Iy]=function(){if(_y(b,null),typeof O=="function")O();else if(typeof O=="string"){var X=gt(O,f);typeof X=="function"&&X()}}}var by="callback",Iy="expired-callback",Ty="sitekey",HA="size";function _y(r,s){for(var a=0;a<r.l.length;a++)try{r.l[a](s)}catch{}}function GA(r,s){je(r.l,function(a){return a==s})}function cf(r,s){return r.h.push(s),s.oa(function(){Ys(r.h,s)}),s}e=af.prototype,e.Ia=function(){var r=this;return this.f?this.f:this.f=cf(this,z().then(function(){if(fu()&&!qe())return lu();throw new _("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")}).then(function(){return r.m.g(r.u())}).then(function(s){return r.g=s,et(r.s,fS,{})}).then(function(s){r.a[Ty]=s.recaptchaSiteKey}).o(function(s){throw r.f=null,s}))},e.render=function(){Yu(this);var r=this;return cf(this,this.Ia().then(function(){if(r.c===null){var s=r.v;if(!r.i){var a=go(s);s=m_("DIV"),a.appendChild(s)}r.c=r.g.render(s,r.a)}return r.c}))},e.verify=function(){Yu(this);var r=this;return cf(this,this.render().then(function(s){return new tt(function(a){var h=r.g.getResponse(s);if(h)a(h);else{var p=function(v){v&&(GA(r,p),a(v))};r.l.push(p),r.i&&r.g.execute(r.c)}})}))},e.reset=function(){Yu(this),this.c!==null&&this.g.reset(this.c)};function Yu(r){if(r.J)throw new _("internal-error","RecaptchaVerifier instance has been destroyed.")}e.clear=function(){Yu(this),this.J=!0,this.m.c();for(var r=0;r<this.h.length;r++)this.h[r].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){r=go(this.v);for(var s;s=r.firstChild;)r.removeChild(s)}};function hf(r,s,a){var h=!1;try{this.b=a||H.app()}catch{throw new _("argument-error","No firebase.app.App instance is currently initialized.")}if(this.b.options&&this.b.options.apiKey)a=this.b.options.apiKey;else throw new _("invalid-api-key");var p=this,v=null;try{v=this.b.auth().Ga()}catch{}try{h=this.b.auth().settings.appVerificationDisabledForTesting}catch{}v=H.SDK_VERSION?hi(H.SDK_VERSION,v):null,af.call(this,a,r,s,function(){try{var m=p.b.auth().la()}catch{m=null}return m},v,fo(po),h)}x(hf,af);function Ey(r,s,a,h){t:{a=Array.prototype.slice.call(a);for(var p=0,v=!1,m=0;m<s.length;m++)if(s[m].optional)v=!0;else{if(v)throw new _("internal-error","Argument validator encountered a required argument after an optional argument.");p++}if(v=s.length,a.length<p||v<a.length)h="Expected "+(p==v?p==1?"1 argument":p+" arguments":p+"-"+v+" arguments")+" but got "+a.length+".";else{for(p=0;p<a.length;p++)if(v=s[p].optional&&a[p]===void 0,!s[p].M(a[p])&&!v){if(s=s[p],0>p||p>=Sy.length)throw new _("internal-error","Argument validator received an unsupported number of arguments.");a=Sy[p],h=(h?"":a+" argument ")+(s.name?'"'+s.name+'" ':"")+"must be "+s.K+".";break t}h=null}}if(h)throw new _("argument-error",r+" failed: "+h)}var Sy="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function V(r,s){return{name:r||"",K:"a valid string",optional:!!s,M:function(a){return typeof a=="string"}}}function lf(r,s){return{name:r||"",K:"a boolean",optional:!!s,M:function(a){return typeof a=="boolean"}}}function kt(r,s){return{name:r||"",K:"a valid object",optional:!!s,M:N}}function Ei(r,s){return{name:r||"",K:"a function",optional:!!s,M:function(a){return typeof a=="function"}}}function on(r,s){return{name:r||"",K:"null",optional:!!s,M:function(a){return a===null}}}function zA(){return{name:"",K:"an HTML element",optional:!1,M:function(r){return!!(r&&r instanceof Element)}}}function $A(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(r){return!!(r&&r instanceof Ge)}}}function WA(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(r){return!!(r&&r instanceof H.app.App)}}}function Mn(r){return{name:r?r+"Credential":"credential",K:r?"a valid "+r+" credential":"a valid credential",optional:!1,M:function(s){if(!s)return!1;var a=!r||s.providerId===r;return!(!s.ka||!a)}}}function Ay(){return{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(r){return r?!!r.tb:!1}}}function Si(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(r){return!!(r&&r.providerId&&r.hasOwnProperty&&r.hasOwnProperty("isOAuthProvider"))}}}function ff(r,s){return N(r)&&typeof r.type=="string"&&r.type===s&&typeof r.Ha=="function"}function ky(r){return N(r)&&typeof r.uid=="string"}function Ju(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(r){return!(!r||typeof r.type!="string"||typeof r.verify!="function")}}}function St(r,s,a,h){return{name:a||"",K:r.K+" or "+s.K,optional:!!h,M:function(p){return r.M(p)||s.M(p)}}}function bt(r,s){for(var a in s){var h=s[a].name;r[h]=Cy(h,r[a],s[a].j)}}function Ny(r,s){for(var a in s){var h=s[a].name;h!==a&&Object.defineProperty(r,h,{get:B(function(p){return this[p]},a),set:B(function(p,v,m,b){Ey(p,[m],[b],!0),this[v]=b},h,a,s[a].lb),enumerable:!0})}}function At(r,s,a,h){r[s]=Cy(s,a,h)}function Cy(r,s,a){function h(){var m=Array.prototype.slice.call(arguments);return Ey(p,a,m),s.apply(this,m)}if(!a)return s;var p=XA(r),v;for(v in s)h[v]=s[v];for(v in s.prototype)h.prototype[v]=s.prototype[v];return h}function XA(r){return r=r.split("."),r[r.length-1]}bt(Ge.prototype,{kb:{name:"applyActionCode",j:[V("code")]},Sa:{name:"checkActionCode",j:[V("code")]},ob:{name:"confirmPasswordReset",j:[V("code"),V("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[V("email"),V("password")]},hc:{name:"fetchSignInMethodsForEmail",j:[V("email")]},ra:{name:"getRedirectResult",j:[]},Bc:{name:"isSignInWithEmailLink",j:[V("emailLink")]},Hc:{name:"onAuthStateChanged",j:[St(kt(),Ei(),"nextOrObserver"),Ei("opt_error",!0),Ei("opt_completed",!0)]},Ic:{name:"onIdTokenChanged",j:[St(kt(),Ei(),"nextOrObserver"),Ei("opt_error",!0),Ei("opt_completed",!0)]},wb:{name:"sendPasswordResetEmail",j:[V("email"),St(kt("opt_actionCodeSettings",!0),on(null,!0),"opt_actionCodeSettings",!0)]},xb:{name:"sendSignInLinkToEmail",j:[V("email"),kt("actionCodeSettings")]},yb:{name:"setPersistence",j:[V("persistence")]},Sc:{name:"signInAndRetrieveDataWithCredential",j:[Mn()]},Ab:{name:"signInAnonymously",j:[]},ab:{name:"signInWithCredential",j:[Mn()]},Tc:{name:"signInWithCustomToken",j:[V("token")]},Uc:{name:"signInWithEmailAndPassword",j:[V("email"),V("password")]},Vc:{name:"signInWithEmailLink",j:[V("email"),V("emailLink",!0)]}
20,Wc:{name:"signInWithPhoneNumber",j:[V("phoneNumber"),Ju()]},Xc:{name:"signInWithPopup",j:[Si()]},Yc:{name:"signInWithRedirect",j:[Si()]},dd:{name:"updateCurrentUser",j:[St((function(r){return{name:"user",K:"an instance of Firebase User",optional:!1,M:function(s){return!!(s&&s instanceof Ee)}}})(),on(),"user")]},Bb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[V(null,!0)]},fd:{name:"useDeviceLanguage",j:[]},gd:{name:"useEmulator",j:[V("url"),kt("options",!0)]},jd:{name:"verifyPasswordResetCode",j:[V("code")]}}),Ny(Ge.prototype,{lc:{name:"languageCode",lb:St(V(),on(),"languageCode")},ti:{name:"tenantId",lb:St(V(),on(),"tenantId")}}),Ge.Persistence=mi,Ge.Persistence.LOCAL="local",Ge.Persistence.SESSION="session",Ge.Persistence.NONE="none",bt(Ee.prototype,{delete:{name:"delete",j:[]},oc:{name:"getIdTokenResult",j:[lf("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[lf("opt_forceRefresh",!0)]},Cc:{name:"linkAndRetrieveDataWithCredential",j:[Mn()]},rb:{name:"linkWithCredential",j:[Mn()]},Dc:{name:"linkWithPhoneNumber",j:[V("phoneNumber"),Ju()]},Ec:{name:"linkWithPopup",j:[Si()]},Fc:{name:"linkWithRedirect",j:[Si()]},Lc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[Mn()]},ub:{name:"reauthenticateWithCredential",j:[Mn()]},Mc:{name:"reauthenticateWithPhoneNumber",j:[V("phoneNumber"),Ju()]},Nc:{name:"reauthenticateWithPopup",j:[Si()]},Oc:{name:"reauthenticateWithRedirect",j:[Si()]},reload:{name:"reload",j:[]},vb:{name:"sendEmailVerification",j:[St(kt("opt_actionCodeSettings",!0),on(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[V(null,!0)]},cd:{name:"unlink",j:[V("provider")]},Cb:{name:"updateEmail",j:[V("email")]},Db:{name:"updatePassword",j:[V("password")]},ed:{name:"updatePhoneNumber",j:[Mn("phone")]},Eb:{name:"updateProfile",j:[kt("profile")]},Fb:{name:"verifyBeforeUpdateEmail",j:[V("email"),St(kt("opt_actionCodeSettings",!0),on(null,!0),"opt_actionCodeSettings",!0)]}}),bt(_i.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),bt(Qo.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),bt(tt.prototype,{oa:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),Ny(Wm.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",lb:lf("appVerificationDisabledForTesting")}}),bt(Nl.prototype,{confirm:{name:"confirm",j:[V("verificationCode")]}}),At(pi,"fromJSON",function(r){r=typeof r=="string"?JSON.parse(r):r;for(var s,a=[yE,wE,bE,mE],h=0;h<a.length;h++)if(s=a[h](r))return s;return null},[St(V(),kt(),"json")]),At(xe,"credential",function(r,s){return new Pn(r,s)},[V("email"),V("password")]),bt(Pn.prototype,{w:{name:"toJSON",j:[V(null,!0)]}}),bt(dr.prototype,{Ca:{name:"addScope",j:[V("scope")]},Ka:{name:"setCustomParameters",j:[kt("customOAuthParameters")]}}),At(dr,"credential",Rg,[St(V(),kt(),"token")]),At(xe,"credentialWithLink",xg,[V("email"),V("emailLink")]),bt(vr.prototype,{Ca:{name:"addScope",j:[V("scope")]},Ka:{name:"setCustomParameters",j:[kt("customOAuthParameters")]}}),At(vr,"credential",Dg,[St(V(),kt(),"token")]),bt(gr.prototype,{Ca:{name:"addScope",j:[V("scope")]},Ka:{name:"setCustomParameters",j:[kt("customOAuthParameters")]}}),At(gr,"credential",Og,[St(V(),St(kt(),on()),"idToken"),St(V(),on(),"accessToken",!0)]),bt(vi.prototype,{Ka:{name:"setCustomParameters",j:[kt("customOAuthParameters")]}}),At(vi,"credential",Pg,[St(V(),kt(),"token"),V("secret",!0)]),bt(_e.prototype,{Ca:{name:"addScope",j:[V("scope")]},credential:{name:"credential",j:[St(V(),St(kt(),on()),"optionsOrIdToken"),St(V(),on(),"accessToken",!0)]},Ka:{name:"setCustomParameters",j:[kt("customOAuthParameters")]}}),bt(vn.prototype,{w:{name:"toJSON",j:[V(null,!0)]}}),bt(fr.prototype,{w:{name:"toJSON",j:[V(null,!0)]}}),At(gn,"credential",Lg,[V("verificationId"),V("verificationCode")]),bt(gn.prototype,{gb:{name:"verifyPhoneNumber",j:[St(V(),(function(r,s){return{name:r||"phoneInfoOptions",K:"valid phone info options",optional:!1,M:function(a){return a?a.session&&a.phoneNumber?ff(a.session,Ro)&&typeof a.phoneNumber=="string":a.session&&a.multiFactorHint?ff(a.session,bu)&&ky(a.multiFactorHint):a.session&&a.multiFactorUid?ff(a.session,bu)&&typeof a.multiFactorUid=="string":a.phoneNumber?typeof a.phoneNumber=="string":!1:!1}}})(),"phoneInfoOptions"),Ju()]}}),bt(xn.prototype,{w:{name:"toJSON",j:[V(null,!0)]}}),bt(_.prototype,{toJSON:{name:"toJSON",j:[V(null,!0)]}}),bt(Oo.prototype,{toJSON:{name:"toJSON",j:[V(null,!0)]}}),bt(Uh.prototype,{toJSON:{name:"toJSON",j:[V(null,!0)]}}),bt(Dl.prototype,{toJSON:{name:"toJSON",j:[V(null,!0)]}}),bt(Rl.prototype,{Rc:{name:"resolveSignIn",j:[Ay()]}}),bt(Pl.prototype,{Sb:{name:"getSession",j:[]},fc:{name:"enroll",j:[Ay(),V("displayName",!0)]},bd:{name:"unenroll",j:[St({name:"multiFactorInfo",K:"a valid multiFactorInfo",optional:!1,M:ky},V(),"multiFactorInfoIdentifier")]}}),bt(hf.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),At(Ah,"parseLink",fg,[V("link")]),At(nf,"assertion",function(r){return new Zm(r)},[Mn("phone")]),(function(){if(typeof H<"u"&&H.INTERNAL&&H.INTERNAL.registerComponent){var r={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:pu,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:Sh,VERIFY_AND_CHANGE_EMAIL:No,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:Ge,AuthCredential:pi,Error:_};At(r,"EmailAuthProvider",xe,[]),At(r,"FacebookAuthProvider",dr,[]),At(r,"GithubAuthProvider",vr,[]),At(r,"GoogleAuthProvider",gr,[]),At(r,"TwitterAuthProvider",vi,[]),At(r,"OAuthProvider",_e,[V("providerId")]),At(r,"SAMLAuthProvider",Cg,[V("providerId")]),At(r,"PhoneAuthProvider",gn,[$A()]),At(r,"RecaptchaVerifier",hf,[St(V(),zA(),"recaptchaContainer"),kt("recaptchaParameters",!0),WA()]),At(r,"ActionCodeURL",Ah,[]),At(r,"PhoneMultiFactorGenerator",nf,[]),H.INTERNAL.registerComponent({name:"auth",instanceFactory:function(s){return s=s.getProvider("app").getImmediate(),new Ge(s)},multipleInstances:!1,serviceProps:r,instantiationMode:"LAZY",type:"PUBLIC",onInstanceCreated:function(s){s.getProvider("auth-internal").initialize()}}),H.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(s){return s=s.getProvider("auth").getImmediate(),{getUid:C(s.getUid,s),getToken:C(s.nc,s),addAuthTokenListener:C(s.cc,s),removeAuthTokenListener:C(s.Pc,s)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"}),H.registerVersion("@firebase/auth","0.16.8"),H.INTERNAL.extendNamespace({User:Ee})}else throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.")})()}).apply(typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{});var Lf=function(e,t){return Lf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},Lf(e,t)};function Yk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Lf(e,t);function n(){this.constructor=e}
20e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function bb(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var Jk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j,vp=vp||{},Q=Jk||self;function ba(){}function Mf(e){var t=typeof e;return t=t!="object"?t:e?Array.isArray(e)?"array":t:"null",t=="array"||t=="object"&&typeof e.length=="number"}function Wa(e){var t=typeof e;return t=="object"&&e!=null||t=="function"}function Zk(e,t,n){return e.call.apply(e.bind,arguments)}function tN(e,t,n){if(!e)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var o=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(o,i),e.apply(t,o)}}return function(){return e.apply(t,arguments)}}function Kt(e,t,n){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?Kt=Zk:Kt=tN,Kt.apply(null,arguments)}function Zu(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var i=n.slice();return i.push.apply(i,arguments),e.apply(this,i)}}function Gt(e,t){function n(){}n.prototype=t.prototype,e.Z=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Vb=function(i,o,u){for(var c=Array(arguments.length-2),l=2;l<arguments.length;l++)c[l-2]=arguments[l];return t.prototype[o].apply(i,c)}}function Qn(){this.s=this.s,this.o=this.o}var eN=0;Qn.prototype.s=!1;Qn.prototype.na=function(){!this.s&&(this.s=!0,this.M(),eN!=0)};Qn.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()()};var Ib=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if(typeof e=="string")return typeof t!="string"||t.length!=1?-1:e.indexOf(t,0);for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},Tb=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var i=e.length,o=typeof e=="string"?e.split(""):e,u=0;u<i;u++)u in o&&t.call(n,o[u],u,e)};function nN(e){t:{for(var t=WN,n=e.length,i=typeof e=="string"?e.split(""):e,o=0;o<n;o++)if(o in i&&t.call(void 0,i[o],o,e)){t=o;break t}t=-1}return 0>t?null:typeof e=="string"?e.charAt(t):e[t]}function Py(e){return Array.prototype.concat.apply([],arguments)}function gp(e){var t=e.length;if(0<t){for(var n=Array(t),i=0;i<t;i++)n[i]=e[i];return n}return[]}function Ia(e){return/^[\s\xa0]*$/.test(e)}var xy=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function ue(e,t){return e.indexOf(t)!=-1}function vf(e,t){return e<t?-1:e>t?1:0}var ae;t:{var Ly=Q.navigator;if(Ly){var My=Ly.userAgent;if(My){ae=My;break t}}ae=""}function mp(e,t,n){for(var i in e)t.call(n,e[i],i,e)}function _b(e){var t={};for(var n in e)t[n]=e[n];return t}var Fy="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Eb(e,t){for(var n,i,o=1;o<arguments.length;o++){i=arguments[o];for(n in i)e[n]=i[n];for(var u=0;u<Fy.length;u++)n=Fy[u],Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}}function yp(e){return yp[" "](e),e}yp[" "]=ba;function rN(e){var t=sN;return Object.prototype.hasOwnProperty.call(t,9)?t[9]:t[9]=e(9)}var iN=ue(ae,"Opera"),Fi=ue(ae,"Trident")||ue(ae,"MSIE"),Sb=ue(ae,"Edge"),Ff=Sb||Fi,Ab=ue(ae,"Gecko")&&!(ue(ae.toLowerCase(),"webkit")&&!ue(ae,"Edge"))&&!(ue(ae,"Trident")||ue(ae,"MSIE"))&&!ue(ae,"Edge"),oN=ue(ae.toLowerCase(),"webkit")&&!ue(ae,"Edge");function kb(){var e=Q.document;return e?e.documentMode:void 0}var Ta;t:{var gf="",mf=(function(){var e=ae;if(Ab)return/rv:([^\);]+)(\)|;)/.exec(e);if(Sb)return/Edge\/([\d\.]+)/.exec(e);if(Fi)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e);if(oN)return/WebKit\/(\S+)/.exec(e);if(iN)return/(?:Version)[ \/]?(\S+)/.exec(e)})();if(mf&&(gf=mf?mf[1]:""),Fi){var yf=kb();if(yf!=null&&yf>parseFloat(gf)){Ta=String(yf);break t}}Ta=gf}var sN={};function uN(){return rN(function(){for(var e=0,t=xy(String(Ta)).split("."),n=xy("9").split("."),i=Math.max(t.length,n.length),o=0;e==0&&o<i;o++){var u=t[o]||"",c=n[o]||"";do{if(u=/(\d*)(\D*)(.*)/.exec(u)||["","","",""],c=/(\d*)(\D*)(.*)/.exec(c)||["","","",""],u[0].length==0&&c[0].length==0)break;e=vf(u[1].length==0?0:parseInt(u[1],10),c[1].length==0?0:parseInt(c[1],10))||vf(u[2].length==0,c[2].length==0)||vf(u[2],c[2]),u=u[3],c=c[3]}while(e==0)}return 0<=e})}var Uf;if(Q.document&&Fi){var Uy=kb();Uf=Uy||parseInt(Ta,10)||void 0}else Uf=void 0;var aN=Uf,cN=(function(){if(!Q.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{Q.addEventListener("test",ba,t),Q.removeEventListener("test",ba,t)}catch{}return e})();function Yt(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}Yt.prototype.h=function(){this.defaultPrevented=!0};function hs(e,t){if(Yt.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,i=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(Ab){t:{try{yp(t.nodeName);var o=!0;break t}catch{}o=!1}o||(t=null)}}else n=="mouseover"?t=e.fromElement:n=="mouseout"&&(t=e.toElement);this.relatedTarget=t,i?(this.clientX=i.clientX!==void 0?i.clientX:i.pageX,this.clientY=i.clientY!==void 0?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0):(this.clientX=e.clientX!==void 0?e.clientX:e.pageX,this.clientY=e.clientY!==void 0?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=typeof e.pointerType=="string"?e.pointerType:hN[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&hs.Z.h.call(this)}}Gt(hs,Yt);var hN={2:"touch",3:"pen",4:"mouse"};hs.prototype.h=function(){hs.Z.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var Xa="closure_listenable_"+(1e6*Math.random()|0),lN=0;function fN(e,t,n,i,o){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!i,this.ia=o,this.key=++lN,this.ca=this.fa=!1}function Qa(e){e.ca=!0,e.listener=null,e.proxy=null,e.src=null,e.ia=null}function Ya(e){this.src=e,this.g={},this.h=0}Ya.prototype.add=function(e,t,n,i,o){var u=e.toString();e=this.g[u],e||(e=this.g[u]=[],this.h++);var c=Vf(e,t,i,o);return-1<c?(t=e[c],n||(t.fa=!1)):(t=new fN(t,this.src,u,!!i,o),t.fa=n,e.push(t)),t};function jf(e,t){var n=t.type;if(n in e.g){var i=e.g[n],o=Ib(i,t),u;(u=0<=o)&&Array.prototype.splice.call(i,o,1),u&&(Qa(t),e.g[n].length==0&&(delete e.g[n],e.h--))}}function Vf(e,t,n,i){for(var o=0;o<e.length;++o){var u=e[o];if(!u.ca&&u.listener==t&&u.capture==!!n&&u.ia==i)return o}return-1}var wp="closure_lm_"+(1e6*Math.random()|0),wf={};function Nb(e,t,n,i,o){if(Array.isArray(t)){for(var u=0;u<t.length;u++)Nb(e,t[u],n,i,o);return null}return n=Db(n),e&&e[Xa]?e.N(t,n,Wa(i)?!!i.capture:!1,o):pN(e,t,n,!1,i,o)}function pN(e,t,n,i,o,u){if(!t)throw Error("Invalid event type");var c=Wa(o)?!!o.capture:!!o,l=Ip(e);if(l||(e[wp]=l=new Ya(e)),n=l.add(t,n,i,c,u),n.proxy)return n;if(i=dN(),n.proxy=i,i.src=e,i.listener=n,e.addEventListener)cN||(o=c),o===void 0&&(o=!1),e.addEventListener(t.toString(),i,o);else if(e.attachEvent)e.attachEvent(Rb(t.toString()),i);else if(e.addListener&&e.removeListener)e.addListener(i);else throw Error("addEventListener and attachEvent are unavailable.");return n}function dN(){function e(n){return t.call(e.src,e.listener,n)}var t=vN;return e}function Cb(e,t,n,i,o){if(Array.isArray(t))for(var u=0;u<t.length;u++)Cb(e,t[u],n,i,o);else i=Wa(i)?!!i.capture:!!i,n=Db(n),e&&e[Xa]?(e=e.i,t=String(t).toString(),t in e.g&&(u=e.g[t],n=Vf(u,n,i,o),-1<n&&(Qa(u[n]),Array.prototype.splice.call(u,n,1),u.length==0&&(delete e.g[t],e.h--))
20)):e&&(e=Ip(e))&&(t=e.g[t.toString()],e=-1,t&&(e=Vf(t,n,i,o)),(n=-1<e?t[e]:null)&&bp(n))}function bp(e){if(typeof e!="number"&&e&&!e.ca){var t=e.src;if(t&&t[Xa])jf(t.i,e);else{var n=e.type,i=e.proxy;t.removeEventListener?t.removeEventListener(n,i,e.capture):t.detachEvent?t.detachEvent(Rb(n),i):t.addListener&&t.removeListener&&t.removeListener(i),(n=Ip(t))?(jf(n,e),n.h==0&&(n.src=null,t[wp]=null)):Qa(e)}}}function Rb(e){return e in wf?wf[e]:wf[e]="on"+e}function vN(e,t){if(e.ca)e=!0;else{t=new hs(t,this);var n=e.listener,i=e.ia||e.src;e.fa&&bp(e),e=n.call(i,t)}return e}function Ip(e){return e=e[wp],e instanceof Ya?e:null}var bf="__closure_events_fn_"+(1e9*Math.random()>>>0);function Db(e){return typeof e=="function"?e:(e[bf]||(e[bf]=function(t){return e.handleEvent(t)}),e[bf])}function jt(){Qn.call(this),this.i=new Ya(this),this.P=this,this.I=null}Gt(jt,Qn);jt.prototype[Xa]=!0;jt.prototype.removeEventListener=function(e,t,n,i){Cb(this,e,t,n,i)};function Ht(e,t){var n,i=e.I;if(i)for(n=[];i;i=i.I)n.push(i);if(e=e.P,i=t.type||t,typeof t=="string")t=new Yt(t,e);else if(t instanceof Yt)t.target=t.target||e;else{var o=t;t=new Yt(i,e),Eb(t,o)}if(o=!0,n)for(var u=n.length-1;0<=u;u--){var c=t.g=n[u];o=ta(c,i,!0,t)&&o}if(c=t.g=e,o=ta(c,i,!0,t)&&o,o=ta(c,i,!1,t)&&o,n)for(u=0;u<n.length;u++)c=t.g=n[u],o=ta(c,i,!1,t)&&o}jt.prototype.M=function(){if(jt.Z.M.call(this),this.i){var e=this.i,t;for(t in e.g){for(var n=e.g[t],i=0;i<n.length;i++)Qa(n[i]);delete e.g[t],e.h--}}this.I=null};jt.prototype.N=function(e,t,n,i){return this.i.add(String(e),t,!1,n,i)};jt.prototype.O=function(e,t,n,i){return this.i.add(String(e),t,!0,n,i)};function ta(e,t,n,i){if(t=e.i.g[String(t)],!t)return!0;t=t.concat();for(var o=!0,u=0;u<t.length;++u){var c=t[u];if(c&&!c.ca&&c.capture==n){var l=c.listener,f=c.ia||c.src;c.fa&&jf(e.i,c),o=l.call(f,i)!==!1&&o}}return o&&!i.defaultPrevented}var Tp=Q.JSON.stringify;function gN(){var e=Pb,t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var mN=(function(){function e(){this.h=this.g=null}return e.prototype.add=function(t,n){var i=Ob.get();i.set(t,n),this.h?this.h.next=i:this.g=i,this.h=i},e})(),Ob=new((function(){function e(t,n){this.i=t,this.j=n,this.h=0,this.g=null}return e.prototype.get=function(){var t;return 0<this.h?(this.h--,t=this.g,this.g=t.next,t.next=null):t=this.i(),t},e})())(function(){return new yN},function(e){return e.reset()}),yN=(function(){function e(){this.next=this.g=this.h=null}return e.prototype.set=function(t,n){this.h=t,this.g=n,this.next=null},e.prototype.reset=function(){this.next=this.g=this.h=null},e})();function wN(e){Q.setTimeout(function(){throw e},0)}function _p(e,t){qf||bN(),Bf||(qf(),Bf=!0),Pb.add(e,t)}var qf;function bN(){var e=Q.Promise.resolve(void 0);qf=function(){e.then(IN)}}var Bf=!1,Pb=new mN;function IN(){for(var e;e=gN();){try{e.h.call(e.g)}catch(n){wN(n)}var t=Ob;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}Bf=!1}function Ja(e,t){jt.call(this),this.h=e||1,this.g=t||Q,this.j=Kt(this.kb,this),this.l=Date.now()}Gt(Ja,jt);j=Ja.prototype;j.da=!1;j.S=null;j.kb=function(){if(this.da){var e=Date.now()-this.l;0<e&&e<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-e):(this.S&&(this.g.clearTimeout(this.S),this.S=null),Ht(this,"tick"),this.da&&(Ep(this),this.start()))}};j.start=function(){this.da=!0,this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now())};function Ep(e){e.da=!1,e.S&&(e.g.clearTimeout(e.S),e.S=null)}j.M=function(){Ja.Z.M.call(this),Ep(this),delete this.g};function Sp(e,t,n){if(typeof e=="function")n&&(e=Kt(e,n));else if(e&&typeof e.handleEvent=="function")e=Kt(e.handleEvent,e);else throw Error("Invalid listener argument");return 2147483647<Number(t)?-1:Q.setTimeout(e,t||0)}function xb(e){e.g=Sp(function(){e.g=null,e.i&&(e.i=!1,xb(e))},e.j);var t=e.h;e.h=null,e.m.apply(null,t)}var TN=(function(e){Yk(t,e);function t(n,i){var o=e.call(this)||this;return o.m=n,o.j=i,o.h=null,o.i=!1,o.g=null,o}return t.prototype.l=function(n){this.h=arguments,this.g?this.i=!0:xb(this)},t.prototype.M=function(){e.prototype.M.call(this),this.g&&(Q.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)},t})(Qn);function ls(e){Qn.call(this),this.h=e,this.g={}}Gt(ls,Qn);var jy=[];
20function Lb(e,t,n,i){Array.isArray(n)||(n&&(jy[0]=n.toString()),n=jy);for(var o=0;o<n.length;o++){var u=Nb(t,n[o],i||e.handleEvent,!1,e.h||e);if(!u)break;e.g[u.key]=u}}function Mb(e){mp(e.g,function(t,n){this.g.hasOwnProperty(n)&&bp(t)},e),e.g={}}ls.prototype.M=function(){ls.Z.M.call(this),Mb(this)};ls.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};function Za(){this.g=!0}Za.prototype.Aa=function(){this.g=!1};function _N(e,t,n,i,o,u){e.info(function(){if(e.g)if(u)for(var c="",l=u.split("&"),f=0;f<l.length;f++){var d=l[f].split("=");if(1<d.length){var g=d[0];d=d[1];var y=g.split("_");c=2<=y.length&&y[1]=="type"?c+(g+"="+d+"&"):c+(g+"=redacted&")}}else c=null;else c=u;return"XMLHTTP REQ ("+i+") [attempt "+o+"]: "+t+` 21`+n+` 22`+c})}function EN(e,t,n,i,o,u,c){e.info(function(){return"XMLHTTP RESP ("+i+") [ attempt "+o+"]: "+t+` 23`+n+` 24`+u+" "+c})}function Oi(e,t,n,i){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+AN(e,n)+(i?" "+i:"")})}function SN(e,t){e.info(function(){return"TIMEOUT: "+t})}Za.prototype.info=function(){};function AN(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n){for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var i=n[e];if(!(2>i.length)){var o=i[1];if(Array.isArray(o)&&!(1>o.length)){var u=o[0];if(u!="noop"&&u!="stop"&&u!="close")for(var c=1;c<o.length;c++)o[c]=""}}}}return Tp(n)}catch{return t}}var Gr={},Vy=null;function tc(){return Vy=Vy||new jt}Gr.Ma="serverreachability";function Fb(e){Yt.call(this,Gr.Ma,e)}Gt(Fb,Yt);function fs(e){var t=tc();Ht(t,new Fb(t))}Gr.STAT_EVENT="statevent";function Ub(e,t){Yt.call(this,Gr.STAT_EVENT,e),this.stat=t}Gt(Ub,Yt);function ce(e){var t=tc();Ht(t,new Ub(t,e))}Gr.Na="timingevent";function jb(e,t){Yt.call(this,Gr.Na,e),this.size=t}Gt(jb,Yt);function Rs(e,t){if(typeof e!="function")throw Error("Fn must not be null and must be a function");return Q.setTimeout(function(){e()},t)}var ec={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9},Vb={};function Ap(){}Ap.prototype.h=null;function qy(e){return e.h||(e.h=e.i())}function qb(){}var Ds={OPEN:"a",pb:"b",Ka:"c",Bb:"d"};function kp(){Yt.call(this,"d")}Gt(kp,Yt);function Np(){Yt.call(this,"c")}Gt(Np,Yt);var Kf;function nc(){}Gt(nc,Ap);nc.prototype.g=function(){return new XMLHttpRequest};nc.prototype.i=function(){return{}};Kf=new nc;function Os(e,t,n,i){this.l=e,this.j=t,this.m=n,this.X=i||1,this.V=new ls(this),this.P=kN,e=Ff?125:void 0,this.W=new Ja(e),this.H=null,this.i=!1,this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null,this.D=[],this.g=null,this.C=0,this.o=this.u=null,this.N=-1,this.I=!1,this.O=0,this.L=null,this.aa=this.J=this.$=this.U=!1,this.h=new Bb}function Bb(){this.i=null,this.g="",this.h=!1}var kN=45e3,Hf={},_a={};j=Os.prototype;j.setTimeout=function(e){this.P=e};function Gf(e,t,n){e.K=1,e.v=ic(En(t)),e.s=n,e.U=!0,Kb(e,null)}function Kb(e,t){e.F=Date.now(),Ps(e),e.A=En(e.v);var n=e.A,i=e.X;Array.isArray(i)||(i=[String(i)]),Qb(n.h,"t",i),e.C=0,n=e.l.H,e.h=new Bb,e.g=g0(e.l,n?t:null,!e.s),0<e.O&&(e.L=new TN(Kt(e.Ia,e,e.g),e.O)),Lb(e.V,e.g,"readystatechange",e.gb),t=e.H?_b(e.H):{},e.s?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.A,e.u,e.s,t)):(e.u="GET",e.g.ea(e.A,e.u,null,t)),fs(),_N(e.j,e.u,e.A,e.m,e.X,e.s)}j.gb=function(e){e=e.target;var t=this.L;t&&wn(e)==3?t.l():this.Ia(e)};j.Ia=function(e){try{if(e==this.g)t:{var t=wn(this.g),n=this.g.Da(),i=this.g.ba();if(!(3>t)&&(t!=3||Ff||this.g&&(this.h.h||this.g.ga()||Gy(this.g)))){this.I||t!=4||n==7||(n==8||0>=i?fs(3):fs(2)),rc(this);var o=this.g.ba();this.N=o;e:if(Hb(this)){var u=Gy(this.g);e="";var c=u.length,l=wn(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){kr(this),rs(this);var f="";break e}this.h.i=new Q.TextDecoder}for(n=0;n<c;n++)this.h.h=!0,e+=this.h.i.decode(u[n],{stream:l&&n==c-1});u.splice(0,c),this.h.g+=e,this.C=0,f=this.h.g}else f=this.g.ga();if(this.i=o==200,EN(this.j,this.u,this.A,this.m,this.X,t,o),this.i){if(this.$&&!this.J){e:{if(this.g){var d,g=this.g;if((d=g.g?g.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!Ia(d)){var y=d;break e}}y=null}if(o=y)Oi(this.j,this.m,o,"Initial handshake response via X-HTTP-Initial-Response"),this.J=!0,zf(this,o);else{this.i=!1,this.o=3,ce(12),kr(this),rs(this);break t}}this.U?(Gb(this,t,f),Ff&&this.i&&t==3&&(Lb(this.V,this.W,"tick",this.fb),this.W.start())):(Oi(this.j,this.m,f,null),zf(this,f)),t==4&&kr(this),this.i&&!this.I&&(t==4?f0(this.l,this):(this.i=!1,Ps(this)))}else o==400&&0<f.indexOf("Unknown SID")?(this.o=3,ce(12)):(this.o=0,ce(13)),kr(this),rs(this)}}}catch{}};function Hb(e){return e.g?e.u=="GET"&&e.K!=2&&e.l.Ba:!1}function Gb(e,t,n){for(var i=!0,o;!e.I&&e.C<n.length;)if(o=NN(e,n),o==_a){t==4&&(e.o=4,ce(14),i=!1),Oi(e.j,e.m,null,"[Incomplete Response]");break}else if(o==Hf){e.o=4,ce(15),Oi(e.j,e.m,n,"[Invalid Chunk]"),i=!1;break}
24else Oi(e.j,e.m,o,null),zf(e,o);Hb(e)&&o!=_a&&o!=Hf&&(e.h.g="",e.C=0),t!=4||n.length!=0||e.h.h||(e.o=1,ce(16),i=!1),e.i=e.i&&i,i?0<n.length&&!e.aa&&(e.aa=!0,t=e.l,t.g==e&&t.$&&!t.L&&(t.h.info("Great, no buffering proxy detected. Bytes received: "+n.length),Fp(t),t.L=!0,ce(11))):(Oi(e.j,e.m,n,"[Invalid Chunked Response]"),kr(e),rs(e))}j.fb=function(){if(this.g){var e=wn(this.g),t=this.g.ga();this.C<t.length&&(rc(this),Gb(this,e,t),this.i&&e!=4&&Ps(this))}};function NN(e,t){var n=e.C,i=t.indexOf(` 25`,n);return i==-1?_a:(n=Number(t.substring(n,i)),isNaN(n)?Hf:(i+=1,i+n>t.length?_a:(t=t.substr(i,n),e.C=i+n,t)))}j.cancel=function(){this.I=!0,kr(this)};function Ps(e){e.Y=Date.now()+e.P,zb(e,e.P)}function zb(e,t){if(e.B!=null)throw Error("WatchDog timer not null");e.B=Rs(Kt(e.eb,e),t)}function rc(e){e.B&&(Q.clearTimeout(e.B),e.B=null)}j.eb=function(){this.B=null;var e=Date.now();0<=e-this.Y?(SN(this.j,this.A),this.K!=2&&(fs(),ce(17)),kr(this),this.o=2,rs(this)):zb(this,this.Y-e)};function rs(e){e.l.G==0||e.I||f0(e.l,e)}function kr(e){rc(e);var t=e.L;t&&typeof t.na=="function"&&t.na(),e.L=null,Ep(e.W),Mb(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.na())}function zf(e,t){try{var n=e.l;if(n.G!=0&&(n.g==e||$f(n.i,e))){if(n.I=e.N,!e.J&&$f(n.i,e)&&n.G==3){try{var i=n.Ca.g.parse(t)}catch{i=null}if(Array.isArray(i)&&i.length==3){var o=i;if(o[0]==0){t:if(!n.u){if(n.g)if(n.g.F+3e3<e.F)ka(n),uc(n);else break t;Mp(n),ce(18)}}else n.ta=o[1],0<n.ta-n.U&&37500>o[2]&&n.N&&n.A==0&&!n.v&&(n.v=Rs(Kt(n.ab,n),6e3));if(1>=Zb(n.i)&&n.ka){try{n.ka()}catch{}n.ka=void 0}}else Nr(n,11)}else if((e.J||n.g==e)&&ka(n),!Ia(t))for(o=n.Ca.g.parse(t),t=0;t<o.length;t++){var u=o[t];if(n.U=u[0],u=u[1],n.G==2)if(u[0]=="c"){n.J=u[1],n.la=u[2];var c=u[3];c!=null&&(n.ma=c,n.h.info("VER="+n.ma));var l=u[4];l!=null&&(n.za=l,n.h.info("SVER="+n.za));var f=u[5];f!=null&&typeof f=="number"&&0<f&&(i=1.5*f,n.K=i,n.h.info("backChannelRequestTimeoutMs_="+i)),i=n;var d=e.g;if(d){var g=d.g?d.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(g){var y=i.i;!y.g&&(ue(g,"spdy")||ue(g,"quic")||ue(g,"h2"))&&(y.j=y.l,y.g=new Set,y.h&&(Dp(y,y.h),y.h=null))}if(i.D){var w=d.g?d.g.getResponseHeader("X-HTTP-Session-Id"):null;w&&(i.sa=w,mt(i.F,i.D,w))}}n.G=3,n.j&&n.j.xa(),n.$&&(n.O=Date.now()-e.F,n.h.info("Handshake RTT: "+n.O+"ms")),i=n;var I=e;if(i.oa=v0(i,i.H?i.la:null,i.W),I.J){t0(i.i,I);var T=I,E=i.K;E&&T.setTimeout(E),T.B&&(rc(T),Ps(T)),i.g=I}else h0(i);0<n.l.length&&ac(n)}else u[0]!="stop"&&u[0]!="close"||Nr(n,7);else n.G==3&&(u[0]=="stop"||u[0]=="close"?u[0]=="stop"?Nr(n,7):Lp(n):u[0]!="noop"&&n.j&&n.j.wa(u),n.A=0)}}fs(4)}catch{}}function CN(e){if(e.R&&typeof e.R=="function")return e.R();if(typeof e=="string")return e.split("");if(Mf(e)){for(var t=[],n=e.length,i=0;i<n;i++)t.push(e[i]);return t}t=[],n=0;for(i in e)t[n++]=e[i];return t}function Cp(e,t){if(e.forEach&&typeof e.forEach=="function")e.forEach(t,void 0);else if(Mf(e)||typeof e=="string")Tb(e,t,void 0);else{if(e.T&&typeof e.T=="function")var n=e.T();else if(e.R&&typeof e.R=="function")n=void 0;else if(Mf(e)||typeof e=="string"){n=[];for(var i=e.length,o=0;o<i;o++)n.push(o)}else for(o in n=[],i=0,e)n[i++]=o;i=CN(e),o=i.length;for(var u=0;u<o;u++)t.call(void 0,i[u],n&&n[u],e)}}function eo(e,t){this.h={},this.g=[],this.i=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var i=0;i<n;i+=2)this.set(arguments[i],arguments[i+1])}else if(e)if(e instanceof eo)for(n=e.T(),i=0;i<n.length;i++)this.set(n[i],e.get(n[i]));else for(i in e)this.set(i,e[i])}j=eo.prototype;j.R=function(){Rp(this);for(var e=[],t=0;t<this.g.length;t++)e.push(this.h[this.g[t]]);return e};j.T=function(){return Rp(this),this.g.concat()};function Rp(e){if(e.i!=e.g.length){for(var t=0,n=0;t<e.g.length;){var i=e.g[t];Fr(e.h,i)&&(e.g[n++]=i),t++}e.g.length=n}if(e.i!=e.g.length){var o={};for(n=t=0;t<e.g.length;)i=e.g[t],Fr(o,i)||(e.g[n++]=i,o[i]=1),t++;e.g.length=n}}j.get=function(e,t){return Fr(this.h,e)?this.h[e]:t};j.set=function(e,t){Fr(this.h,e)||(this.i++,this.g.push(e)),this.h[e]=t};j.forEach=function(e,t){for(var n=this.T(),i=0;i<n.length;i++){var o=n[i],u=this.get(o);e.call(t,u,o,this)}};function Fr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var $b=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function RN(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var i=e[n].indexOf("="),o=null;if(0<=i){var u=e[n].substring(0,i);o=e[n].substring(i+1)}else u=e[n];
25t(u,o?decodeURIComponent(o.replace(/\+/g," ")):"")}}}function Ur(e,t){if(this.i=this.s=this.j="",this.m=null,this.o=this.l="",this.g=!1,e instanceof Ur){this.g=t!==void 0?t:e.g,Ea(this,e.j),this.s=e.s,Sa(this,e.i),Aa(this,e.m),this.l=e.l,t=e.h;var n=new ps;n.i=t.i,t.g&&(n.g=new eo(t.g),n.h=t.h),By(this,n),this.o=e.o}else e&&(n=String(e).match($b))?(this.g=!!t,Ea(this,n[1]||"",!0),this.s=is(n[2]||""),Sa(this,n[3]||"",!0),Aa(this,n[4]),this.l=is(n[5]||"",!0),By(this,n[6]||"",!0),this.o=is(n[7]||"")):(this.g=!!t,this.h=new ps(null,this.g))}Ur.prototype.toString=function(){var e=[],t=this.j;t&&e.push(ts(t,Ky,!0),":");var n=this.i;return(n||t=="file")&&(e.push("//"),(t=this.s)&&e.push(ts(t,Ky,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n=this.m,n!=null&&e.push(":",String(n))),(n=this.l)&&(this.i&&n.charAt(0)!="/"&&e.push("/"),e.push(ts(n,n.charAt(0)=="/"?LN:xN,!0))),(n=this.h.toString())&&e.push("?",n),(n=this.o)&&e.push("#",ts(n,FN)),e.join("")};function En(e){return new Ur(e)}function Ea(e,t,n){e.j=n?is(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function Sa(e,t,n){e.i=n?is(t,!0):t}function Aa(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.m=t}else e.m=null}function By(e,t,n){t instanceof ps?(e.h=t,UN(e.h,e.g)):(n||(t=ts(t,MN)),e.h=new ps(t,e.g))}function mt(e,t,n){e.h.set(t,n)}function ic(e){return mt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function DN(e){return e instanceof Ur?En(e):new Ur(e,void 0)}function ON(e,t,n,i){var o=new Ur(null,void 0);return e&&Ea(o,e),t&&Sa(o,t),n&&Aa(o,n),i&&(o.l=i),o}function is(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function ts(e,t,n){return typeof e=="string"?(e=encodeURI(e).replace(t,PN),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function PN(e){return e=e.charCodeAt(0),"%"+(e>>4&15).toString(16)+(e&15).toString(16)}var Ky=/[#\/\?@]/g,xN=/[#\?:]/g,LN=/[#\?]/g,MN=/[#\?@]/g,FN=/#/g;function ps(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Yn(e){e.g||(e.g=new eo,e.h=0,e.i&&RN(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}j=ps.prototype;j.add=function(e,t){Yn(this),this.i=null,e=no(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this};function Wb(e,t){Yn(e),t=no(e,t),Fr(e.g.h,t)&&(e.i=null,e.h-=e.g.get(t).length,e=e.g,Fr(e.h,t)&&(delete e.h[t],e.i--,e.g.length>2*e.i&&Rp(e)))}function Xb(e,t){return Yn(e),t=no(e,t),Fr(e.g.h,t)}j.forEach=function(e,t){Yn(this),this.g.forEach(function(n,i){Tb(n,function(o){e.call(t,o,i,this)},this)},this)};j.T=function(){Yn(this);for(var e=this.g.R(),t=this.g.T(),n=[],i=0;i<t.length;i++)for(var o=e[i],u=0;u<o.length;u++)n.push(t[i]);return n};j.R=function(e){Yn(this);var t=[];if(typeof e=="string")Xb(this,e)&&(t=Py(t,this.g.get(no(this,e))));else{e=this.g.R();for(var n=0;n<e.length;n++)t=Py(t,e[n])}return t};j.set=function(e,t){return Yn(this),this.i=null,e=no(this,e),Xb(this,e)&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this};j.get=function(e,t){return e?(e=this.R(e),0<e.length?String(e[0]):t):t};function Qb(e,t,n){Wb(e,t),0<n.length&&(e.i=null,e.g.set(no(e,t),gp(n)),e.h+=n.length)}j.toString=function(){if(this.i)return this.i;if(!this.g)return"";for(var e=[],t=this.g.T(),n=0;n<t.length;n++){var i=t[n],o=encodeURIComponent(String(i));i=this.R(i);for(var u=0;u<i.length;u++){var c=o;i[u]!==""&&(c+="="+encodeURIComponent(String(i[u]))),e.push(c)}}return this.i=e.join("&")};function no(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function UN(e,t){t&&!e.j&&(Yn(e),e.i=null,e.g.forEach(function(n,i){var o=i.toLowerCase();i!=o&&(Wb(this,i),Qb(this,o,n))},e)),e.j=t}var jN=(function(){function e(t,n){this.h=t,this.g=n}return e})();function Yb(e){this.l=e||VN,Q.PerformanceNavigationTiming?(e=Q.performance.getEntriesByType("navigation"),e=0<e.length&&(e[0].nextHopProtocol=="hq"||e[0].nextHopProtocol=="h2")):e=!!(Q.g&&Q.g.Ea&&Q.g.Ea()&&Q.g.Ea().Zb),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var VN=10;function Jb(e){return e.h?!0:e.g?e.g.size>=e.j:!1}function Zb(e){return e.h?1:e.g?e.g.size:0}function $f(e,t){return e.h?e.h==t:e.g?e.g.has(t):!1}function Dp(e,t){e.g?e.g.add(t):e.h=t}function t0(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}Yb.prototype.cancel=function(){var e,t;if(this.i=e0(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){try{for(var n=bb(this.g.values()),i=n.next();!i.done;i=n.next()){var o=i.value;o.cancel()}}catch(u){e={error:u}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.g.clear()}};function e0(e){var t,n;if(e.h!=null)return e.i.concat(e.h.D);if(e.g!=null&&e.g.size!==0){var i=e.i;try{for(var o=bb(e.g.values()),u=o.next();!u.done;u=o.next()){var c=u.value;i=i.concat(c.D)}}
25catch(l){t={error:l}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}return gp(e.i)}function Op(){}Op.prototype.stringify=function(e){return Q.JSON.stringify(e,void 0)};Op.prototype.parse=function(e){return Q.JSON.parse(e,void 0)};function qN(){this.g=new Op}function BN(e,t,n){var i=n||"";try{Cp(e,function(o,u){var c=o;Wa(o)&&(c=Tp(o)),t.push(i+u+"="+encodeURIComponent(c))})}catch(o){throw t.push(i+"type="+encodeURIComponent("_badmap")),o}}function KN(e,t){var n=new Za;if(Q.Image){var i=new Image;i.onload=Zu(ea,n,i,"TestLoadImage: loaded",!0,t),i.onerror=Zu(ea,n,i,"TestLoadImage: error",!1,t),i.onabort=Zu(ea,n,i,"TestLoadImage: abort",!1,t),i.ontimeout=Zu(ea,n,i,"TestLoadImage: timeout",!1,t),Q.setTimeout(function(){i.ontimeout&&i.ontimeout()},1e4),i.src=e}else t(!1)}function ea(e,t,n,i,o){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,o(i)}catch{}}function xs(e){this.l=e.$b||null,this.j=e.ib||!1}Gt(xs,Ap);xs.prototype.g=function(){return new oc(this.l,this.j)};xs.prototype.i=(function(e){return function(){return e}})({});function oc(e,t){jt.call(this),this.D=e,this.u=t,this.m=void 0,this.readyState=Pp,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}Gt(oc,jt);var Pp=0;j=oc.prototype;j.open=function(e,t){if(this.readyState!=Pp)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,ds(this)};j.send=function(e){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;var t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.D||Q).fetch(new Request(this.B,t)).then(this.Va.bind(this),this.ha.bind(this))};j.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Ls(this)),this.readyState=Pp};j.Va=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,ds(this)),this.g&&(this.readyState=3,ds(this),this.g)))if(this.responseType==="arraybuffer")e.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(typeof Q.ReadableStream<"u"&&"body"in e){if(this.j=e.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;n0(this)}else e.text().then(this.Ua.bind(this),this.ha.bind(this))};function n0(e){e.j.read().then(e.Sa.bind(e)).catch(e.ha.bind(e))}j.Sa=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?Ls(this):ds(this),this.readyState==3&&n0(this)}};j.Ua=function(e){this.g&&(this.response=this.responseText=e,Ls(this))};j.Ta=function(e){this.g&&(this.response=e,Ls(this))};j.ha=function(){this.g&&Ls(this)};function Ls(e){e.readyState=4,e.l=null,e.j=null,e.A=null,ds(e)}j.setRequestHeader=function(e,t){this.v.append(e,t)};j.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""};j.getAllResponseHeaders=function(){if(!this.h)return"";for(var e=[],t=this.h.entries(),n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join(`\r 26`)};function ds(e){e.onreadystatechange&&e.onreadystatechange.call(e)}Object.defineProperty(oc.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(e){this.m=e?"include":"same-origin"}});var HN=Q.JSON.parse;function Dt(e){jt.call(this),this.headers=new eo,this.u=e||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=r0,this.K=this.L=!1}Gt(Dt,jt);var r0="",GN=/^https?$/i,zN=["POST","PUT"];j=Dt.prototype;j.ea=function(e,t,n,i){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+e);t=t?t.toUpperCase():"GET",this.H=e,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():Kf.g(),this.C=this.u?qy(this.u):qy(Kf),this.g.onreadystatechange=Kt(this.Fa,this);try{this.F=!0,this.g.open(t,String(e),!0),this.F=!1}catch(u){Hy(this,u);return}e=n||"";var o=new eo(this.headers);i&&Cp(i,function(u,c){o.set(c,u)}),i=nN(o.T()),n=Q.FormData&&e instanceof Q.FormData,!(0<=Ib(zN,t))||i||n||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach(function(u,c){this.g.setRequestHeader(c,u)},this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{s0(this),0<this.B&&((this.K=$N(this.g))?(this.g.timeout=this.B,this.g.ontimeout=Kt(this.pa,this)):this.A=Sp(this.pa,this.B,this)),this.v=!0,this.g.send(e),this.v=!1}catch(u){Hy(this,u)}};function $N(e){return Fi&&uN()&&typeof e.timeout=="number"&&e.ontimeout!==void 0}function WN(e){return e.toLowerCase()=="content-type"}j.pa=function(){typeof vp<"u"&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,Ht(this,"timeout"),this.abort(8))};function Hy(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,i0(e),sc(e)}function i0(e){e.D||(e.D=!0,Ht(e,"complete"),Ht(e,"error"))}j.abort=function(e){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=e||7,Ht(this,"complete"),Ht(this,"abort"),sc(this))};j.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),sc(this,!0)),Dt.Z.M.call(this)};j.Fa=function(){this.s||(this.F||this.v||this.l?o0(this):this.cb())};j.cb=function(){o0(this)};function o0(e){if(e.h&&typeof vp<"u"&&(!e.C[1]||wn(e)!=4||e.ba()!=2)){if(e.v&&wn(e)==4)Sp(e.Fa,0,e);else if(Ht(e,"readystatechange"),wn(e)==4){e.h=!1;try{var t=e.ba();t:switch(t){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var n=!0;break t;default:n=!1}var i;if(!(i=n)){var o;if(o=t===0){var u=String(e.H).match($b)[1]||null;if(!u&&Q.self&&Q.self.location){var c=Q.self.location.protocol;u=c.substr(0,c.length-1)}o=!GN.test(u?u.toLowerCase():"")}i=o}if(i)Ht(e,"complete"),Ht(e,"success");else{e.m=6;try{var l=2<wn(e)?e.g.statusText:""}catch{l=""}e.j=l+" ["+e.ba()+"]",i0(e)}}finally{sc(e)}}}}function sc(e,t){if(e.g){s0(e);var n=e.g,i=e.C[0]?ba:null;e.g=null,e.C=null,t||Ht(e,"ready");try{n.onreadystatechange=i}catch{}}}function s0(e){e.g&&e.K&&(e.g.ontimeout=null),e.A&&(Q.clearTimeout(e.A),e.A=null)}function wn(e){return e.g?e.g.readyState:0}j.ba=function(){try{return 2<wn(this)?this.g.status:-1}catch{return-1}};j.ga=function(){try{return this.g?this.g.responseText:""}catch{return""}};j.Qa=function(e){if(this.g){var t=this.g.responseText;
26return e&&t.indexOf(e)==0&&(t=t.substring(e.length)),HN(t)}};function Gy(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.J){case r0:case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch{return null}}j.Da=function(){return this.m};j.La=function(){return typeof this.j=="string"?this.j:String(this.j)};function XN(e){var t="";return mp(e,function(n,i){t+=i,t+=":",t+=n,t+=`\r 27`}),t}function xp(e,t,n){t:{for(i in n){var i=!1;break t}i=!0}i||(n=XN(n),typeof e=="string"?n!=null&&encodeURIComponent(String(n)):mt(e,t,n))}function Yo(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function u0(e){this.za=0,this.l=[],this.h=new Za,this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null,this.Za=this.V=0,this.Xa=Yo("failFast",!1,e),this.N=this.v=this.u=this.m=this.j=null,this.X=!0,this.I=this.ta=this.U=-1,this.Y=this.A=this.C=0,this.Pa=Yo("baseRetryDelayMs",5e3,e),this.$a=Yo("retryDelaySeedMs",1e4,e),this.Ya=Yo("forwardChannelMaxRetries",2,e),this.ra=Yo("forwardChannelRequestTimeoutMs",2e4,e),this.qa=e&&e.xmlHttpFactory||void 0,this.Ba=e&&e.Yb||!1,this.K=void 0,this.H=e&&e.supportsCrossDomainXhr||!1,this.J="",this.i=new Yb(e&&e.concurrentRequestLimit),this.Ca=new qN,this.ja=e&&e.fastHandshake||!1,this.Ra=e&&e.Wb||!1,e&&e.Aa&&this.h.Aa(),e&&e.forceLongPolling&&(this.X=!1),this.$=!this.ja&&this.X&&e&&e.detectBufferingProxy||!1,this.ka=void 0,this.O=0,this.L=!1,this.B=null,this.Wa=!e||e.Xb!==!1}j=u0.prototype;j.ma=8;j.G=1;function Lp(e){if(a0(e),e.G==3){var t=e.V++,n=En(e.F);mt(n,"SID",e.J),mt(n,"RID",t),mt(n,"TYPE","terminate"),Ms(e,n),t=new Os(e,e.h,t,void 0),t.K=2,t.v=ic(En(n)),n=!1,Q.navigator&&Q.navigator.sendBeacon&&(n=Q.navigator.sendBeacon(t.v.toString(),"")),!n&&Q.Image&&(new Image().src=t.v,n=!0),n||(t.g=g0(t.l,null),t.g.ea(t.v)),t.F=Date.now(),Ps(t)}d0(e)}j.hb=function(e){try{this.h.info("Origin Trials invoked: "+e)}catch{}};function uc(e){e.g&&(Fp(e),e.g.cancel(),e.g=null)}function a0(e){uc(e),e.u&&(Q.clearTimeout(e.u),e.u=null),ka(e),e.i.cancel(),e.m&&(typeof e.m=="number"&&Q.clearTimeout(e.m),e.m=null)}function If(e,t){e.l.push(new jN(e.Za++,t)),e.G==3&&ac(e)}function ac(e){Jb(e.i)||e.m||(e.m=!0,_p(e.Ha,e),e.C=0)}function QN(e,t){return Zb(e.i)>=e.i.j-(e.m?1:0)?!1:e.m?(e.l=t.D.concat(e.l),!0):e.G==1||e.G==2||e.C>=(e.Xa?0:e.Ya)?!1:(e.m=Rs(Kt(e.Ha,e,t),p0(e,e.C)),e.C++,!0)}j.Ha=function(e){if(this.m)if(this.m=null,this.G==1){if(!e){this.V=Math.floor(1e5*Math.random()),e=this.V++;var t=new Os(this,this.h,e,void 0),n=this.s;if(this.P&&(n?(n=_b(n),Eb(n,this.P)):n=this.P),this.o===null&&(t.H=n),this.ja)t:{for(var i=0,o=0;o<this.l.length;o++){e:{var u=this.l[o];if("__data__"in u.g&&(u=u.g.__data__,typeof u=="string")){u=u.length;break e}u=void 0}if(u===void 0)break;if(i+=u,4096<i){i=o;break t}if(i===4096||o===this.l.length-1){i=o+1;break t}}i=1e3}else i=1e3;i=c0(this,t,i),o=En(this.F),mt(o,"RID",e),mt(o,"CVER",22),this.D&&mt(o,"X-HTTP-Session-Id",this.D),Ms(this,o),this.o&&n&&xp(o,this.o,n),Dp(this.i,t),this.Ra&&mt(o,"TYPE","init"),this.ja?(mt(o,"$req",i),mt(o,"SID","null"),t.$=!0,Gf(t,o,null)):Gf(t,o,i),this.G=2}}else this.G==3&&(e?zy(this,e):this.l.length==0||Jb(this.i)||zy(this))};function zy(e,t){var n;t?n=t.m:n=e.V++;var i=En(e.F);mt(i,"SID",e.J),mt(i,"RID",n),mt(i,"AID",e.U),Ms(e,i),e.o&&e.s&&xp(i,e.o,e.s),n=new Os(e,e.h,n,e.C+1),e.o===null&&(n.H=e.s),t&&(e.l=t.D.concat(e.l)),t=c0(e,n,1e3),n.setTimeout(Math.round(.5*e.ra)+Math.round(.5*e.ra*Math.random())),Dp(e.i,n),Gf(n,i,t)}function Ms(e,t){e.j&&Cp({},function(n,i){mt(t,i,n)})}function c0(e,t,n){n=Math.min(e.l.length,n);var i=e.j?Kt(e.j.Oa,e.j,e):null;t:for(var o=e.l,u=-1;;){var c=["count="+n];u==-1?0<n?(u=o[0].h,c.push("ofs="+u)):u=0:c.push("ofs="+u);for(var l=!0,f=0;f<n;f++){var d=o[f].h,g=o[f].g;if(d-=u,0>d)u=Math.max(0,o[f].h-100),l=!1;else try{BN(g,c,"req"+d+"_")}catch{i&&i(g)}}if(l){i=c.join("&");break t}}return e=e.l.splice(0,n),t.D=e,i}function h0(e){e.g||e.u||(e.Y=1,_p(e.Ga,e),e.A=0)}function Mp(e){return e.g||e.u||3<=e.A?!1:(e.Y++,e.u=Rs(Kt(e.Ga,e),p0(e,e.A)),e.A++,!0)}j.Ga=function(){if(this.u=null,l0(this),this.$&&!(this.L||this.g==null||0>=this.O)){var e=2*this.O;this.h.info("BP detection timer enabled: "+e),this.B=Rs(Kt(this.bb,this),e)}};j.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,ce(10),uc(this),l0(this))};function Fp(e){e.B!=null&&(Q.clearTimeout(e.B),e.B=null)}function l0(e){e.g=new Os(e,e.h,"rpc",e.Y),e.o===null&&(e.g.H=e.s),e.g.O=0;var t=En(e.oa);mt(t,"RID","rpc"),mt(t,"SID",e.J),mt(t,"CI",e.N?"0":"1"),mt(t,"AID",e.U),Ms(e,t),mt(t,"TYPE","xmlhttp"),e.o&&e.s&&xp(t,e.o,e.s),e.K&&e.g.setTimeout(e.K);var n=e.g;e=e.la,n.K=1,n.v=ic(En(t)),n.s=null,n.U=!0,Kb(n,e)}
27j.ab=function(){this.v!=null&&(this.v=null,uc(this),Mp(this),ce(19))};function ka(e){e.v!=null&&(Q.clearTimeout(e.v),e.v=null)}function f0(e,t){var n=null;if(e.g==t){ka(e),Fp(e),e.g=null;var i=2}else if($f(e.i,t))n=t.D,t0(e.i,t),i=1;else return;if(e.I=t.N,e.G!=0){if(t.i)if(i==1){n=t.s?t.s.length:0,t=Date.now()-t.F;var o=e.C;i=tc(),Ht(i,new jb(i,n)),ac(e)}else h0(e);else if(o=t.o,o==3||o==0&&0<e.I||!(i==1&&QN(e,t)||i==2&&Mp(e)))switch(n&&0<n.length&&(t=e.i,t.i=t.i.concat(n)),o){case 1:Nr(e,5);break;case 4:Nr(e,10);break;case 3:Nr(e,6);break;default:Nr(e,2)}}}function p0(e,t){var n=e.Pa+Math.floor(Math.random()*e.$a);return e.j||(n*=2),n*t}function Nr(e,t){if(e.h.info("Error code "+t),t==2){var n=null;e.j&&(n=null);var i=Kt(e.jb,e);n||(n=new Ur("//www.google.com/images/cleardot.gif"),Q.location&&Q.location.protocol=="http"||Ea(n,"https"),ic(n)),KN(n.toString(),i)}else ce(2);e.G=0,e.j&&e.j.va(t),d0(e),a0(e)}j.jb=function(e){e?(this.h.info("Successfully pinged google.com"),ce(2)):(this.h.info("Failed to ping google.com"),ce(1))};function d0(e){e.G=0,e.I=-1,e.j&&((e0(e.i).length!=0||e.l.length!=0)&&(e.i.i.length=0,gp(e.l),e.l.length=0),e.j.ua())}function v0(e,t,n){var i=DN(n);if(i.i!="")t&&Sa(i,t+"."+i.i),Aa(i,i.m);else{var o=Q.location;i=ON(o.protocol,t?t+"."+o.hostname:o.hostname,+o.port,n)}return e.aa&&mp(e.aa,function(u,c){mt(i,c,u)}),t=e.D,n=e.sa,t&&n&&mt(i,t,n),mt(i,"VER",e.ma),Ms(e,i),i}function g0(e,t,n){if(t&&!e.H)throw Error("Can't create secondary domain capable XhrIo object.");return t=n&&e.Ba&&!e.qa?new Dt(new xs({ib:!0})):new Dt(e.qa),t.L=e.H,t}function m0(){}j=m0.prototype;j.xa=function(){};j.wa=function(){};j.va=function(){};j.ua=function(){};j.Oa=function(){};function Na(){if(Fi&&!(10<=Number(aN)))throw Error("Environmental error: no available transport.")}Na.prototype.g=function(e,t){return new De(e,t)};function De(e,t){jt.call(this),this.g=new u0(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.s=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.ya&&(e?e["X-WebChannel-Client-Profile"]=t.ya:e={"X-WebChannel-Client-Profile":t.ya}),this.g.P=e,(e=t&&t.httpHeadersOverwriteParam)&&!Ia(e)&&(this.g.o=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!Ia(t)&&(this.g.D=t,e=this.h,e!==null&&t in e&&(e=this.h,t in e&&delete e[t])),this.j=new ro(this)}Gt(De,jt);De.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var e=this.g,t=this.l,n=this.h||void 0;e.Wa&&(e.h.info("Origin Trials enabled."),_p(Kt(e.hb,e,t))),ce(0),e.W=t,e.aa=n||{},e.N=e.X,e.F=v0(e,null,e.W),ac(e)};De.prototype.close=function(){Lp(this.g)};De.prototype.u=function(e){if(typeof e=="string"){var t={};t.__data__=e,If(this.g,t)}else this.v?(t={},t.__data__=Tp(e),If(this.g,t)):If(this.g,e)};De.prototype.M=function(){this.g.j=null,delete this.j,Lp(this.g),delete this.g,De.Z.M.call(this)};function y0(e){kp.call(this);var t=e.__sm__;if(t){t:{for(var n in t){e=n;break t}e=void 0}(this.i=e)&&(e=this.i,t=t!==null&&e in t?t[e]:void 0),this.data=t}else this.data=e}Gt(y0,kp);function w0(){Np.call(this),this.status=1}Gt(w0,Np);function ro(e){this.g=e}Gt(ro,m0);ro.prototype.xa=function(){Ht(this.g,"a")};ro.prototype.wa=function(e){Ht(this.g,new y0(e))};ro.prototype.va=function(e){Ht(this.g,new w0)};ro.prototype.ua=function(){Ht(this.g,"b")};Na.prototype.createWebChannel=Na.prototype.g;De.prototype.send=De.prototype.u;De.prototype.open=De.prototype.m;De.prototype.close=De.prototype.close;ec.NO_ERROR=0;ec.TIMEOUT=8;ec.HTTP_ERROR=6;Vb.COMPLETE="complete";qb.EventType=Ds;Ds.OPEN="a";Ds.CLOSE="b";Ds.ERROR="c";Ds.MESSAGE="d";jt.prototype.listen=jt.prototype.N;Dt.prototype.listenOnce=Dt.prototype.O;Dt.prototype.getLastError=Dt.prototype.La;Dt.prototype.getLastErrorCode=Dt.prototype.Da;Dt.prototype.getStatus=Dt.prototype.ba;Dt.prototype.getResponseJson=Dt.prototype.Qa;Dt.prototype.getResponseText=Dt.prototype.ga;Dt.prototype.send=Dt.prototype.ea;var YN=function(){return new Na},JN=function(){return tc()},Tf=ec,ZN=Vb,tC=Gr,$y={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20},eC=xs,na=qb,nC=Dt,rC={};var Ne=(function(){function e(t,n){var i=this;
27this.previousValue=t,n&&(n.sequenceNumberHandler=function(o){return i.t(o)},this.i=function(o){return n.writeSequenceNumber(o)})}return e.prototype.t=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},e.prototype.next=function(){var t=++this.previousValue;return this.i&&this.i(t),t},e})();Ne.o=-1;var k={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"},P=(function(e){function t(n,i){var o=this;return(o=e.call(this,i)||this).code=n,o.message=i,o.name="FirebaseError",o.toString=function(){return o.name+": [code="+o.code+"]: "+o.message},o}return $(t,e),t})(Error),$e=new pp("@firebase/firestore");function Wf(){return $e.logLevel}function M(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if($e.logLevel<=nt.DEBUG){var i=t.map(Up);$e.debug.apply($e,dt(["Firestore (8.10.1): "+e],i))}}function Rt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if($e.logLevel<=nt.ERROR){var i=t.map(Up);$e.error.apply($e,dt(["Firestore (8.10.1): "+e],i))}}function Ca(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if($e.logLevel<=nt.WARN){var i=t.map(Up);$e.warn.apply($e,dt(["Firestore (8.10.1): "+e],i))}}function Up(e){if(typeof e=="string")return e;try{return t=e,JSON.stringify(t)}catch{return e}var t}function K(e){e===void 0&&(e="Unexpected state");var t="FIRESTORE (8.10.1) INTERNAL ASSERTION FAILED: "+e;throw Rt(t),new Error(t)}function W(e,t){e||K()}function U(e,t){return e}function iC(e){var t=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&typeof t.getRandomValues=="function")t.getRandomValues(n);else for(var i=0;i<e;i++)n[i]=Math.floor(256*Math.random());return n}var b0=(function(){function e(){}return e.u=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=Math.floor(256/t.length)*t.length,i="";i.length<20;)for(var o=iC(40),u=0;u<o.length;++u)i.length<20&&o[u]<n&&(i+=t.charAt(o[u]%t.length));return i},e})();function rt(e,t){return e<t?-1:e>t?1:0}function Ui(e,t,n){return e.length===t.length&&e.every((function(i,o){return n(i,t[o])}
27))}function I0(e){return e+"\0"}var me=(function(){function e(t,n){if(this.seconds=t,this.nanoseconds=n,n<0)throw new P(k.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new P(k.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(t<-62135596800)throw new P(k.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new P(k.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}return e.now=function(){return e.fromMillis(Date.now())},e.fromDate=function(t){return e.fromMillis(t.getTime())},e.fromMillis=function(t){var n=Math.floor(t/1e3);return new e(n,Math.floor(1e6*(t-1e3*n)))},e.prototype.toDate=function(){return new Date(this.toMillis())},e.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},e.prototype._compareTo=function(t){return this.seconds===t.seconds?rt(this.nanoseconds,t.nanoseconds):rt(this.seconds,t.seconds)},e.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds},e.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},e.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},e.prototype.valueOf=function(){var t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},e})(),Z=(function(){function e(t){this.timestamp=t}return e.fromTimestamp=function(t){return new e(t)},e.min=function(){return new e(new me(0,0))},e.prototype.compareTo=function(t){return this.timestamp._compareTo(t.timestamp)},e.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},e.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},e.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},e.prototype.toTimestamp=function(){return this.timestamp},e})();function Wy(e){var t=0;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function zr(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function T0(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var _0=(function(){function e(t,n,i){n===void 0?n=0:n>t.length&&K(),i===void 0?i=t.length-n:i>t.length-n&&K(),this.segments=t,this.offset=n,this.len=i}return Object.defineProperty(e.prototype,"length",{get:function(){return this.len},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return e.comparator(this,t)===0},e.prototype.child=function(t){var n=this.segments.slice(this.offset,this.limit());return t instanceof e?t.forEach((function(i){n.push(i)})):n.push(t),this.construct(n)},e.prototype.limit=function(){return this.offset+this.length},e.prototype.popFirst=function(t){return t=t===void 0?1:t,this.construct(this.segments,this.offset+t,this.length-t)},e.prototype.popLast=function(){return this.construct(this.segments,this.offset,this.length-1)},e.prototype.firstSegment=function(){return this.segments[this.offset]},e.prototype.lastSegment=function(){return this.get(this.length-1)},e.prototype.get=function(t){return this.segments[this.offset+t]},e.prototype.isEmpty=function(){return this.length===0},e.prototype.isPrefixOf=function(t){if(t.length<this.length)return!1;for(var n=0;n<this.length;n++)if(this.get(n)!==t.get(n))return!1;return!0},e.prototype.isImmediateParentOf=function(t){if(this.length+1!==t.length)return!1;for(var n=0;n<this.length;n++)if(this.get(n)!==t.get(n))return!1;return!0},e.prototype.forEach=function(t){for(var n=this.offset,i=this.limit();n<i;n++)t(this.segments[n])},e.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},e.comparator=function(t,n){for(var i=Math.min(t.length,n.length),o=0;o<i;o++){var u=t.get(o),c=n.get(o);if(u<c)return-1;if(u>c)return 1}return t.length<n.length?-1:t.length>n.length?1:0},e})(),st=(function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return $(t,e),t.prototype.construct=function(n,i,o){return new t(n,i,o)},t.prototype.canonicalString=function(){return this.toArray().join("/")},t.prototype.toString=function(){return this.canonicalString()},t.fromString=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=[],u=0,c=n;u<c.length;u++){var l=c[u];if(l.indexOf("//")>=0)throw new P(k.INVALID_ARGUMENT,"Invalid segment ("+l+"). Paths must not contain // in them.");o.push.apply(o,l.split("/").filter((function(f){return f.length>0})))}return new t(o)},t.emptyPath=function(){return new t([])},t})(_0),oC=/^[_a-zA-Z][_a-zA-Z0-9]*$/,Qe=(function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return $(t,e),t.prototype.construct=function(n,i,o){return new t(n,i,o)},t.isValidIdentifier=function(n){return oC.test(n)},t.prototype.canonicalString=function(){return this.toArray().map((function(n){return n=n.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),t.isValidIdentifier(n)||(n="`"+n+"`"),n})).join(".")},t.prototype.toString=function(){return this.canonicalString()},t.prototype.isKeyField=function(){return this.length===1&&this.get(0)==="__name__"},t.keyField=function(){return new t(["__name__"])},t.fromServerFormat=function(n){for(var i=[],o="",u=0,c=function(){if(o.length===0)throw new P(k.INVALID_ARGUMENT,"Invalid field path ("+n+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");i.push(o),o=""},l=!1;u<n.length;){var f=n[u];if(f==="\\"){if(u+1===n.length)throw new P(k.INVALID_ARGUMENT,"Path has trailing escape character: "+n);var d=n[u+1];if(d!=="\\"&&d!=="."&&d!=="`")throw new P(k.INVALID_ARGUMENT,"Path has invali
27d escape sequence: "+n);o+=d,u+=2}else f==="`"?(l=!l,u++):f!=="."||l?(o+=f,u++):(c(),u++)}if(c(),l)throw new P(k.INVALID_ARGUMENT,"Unterminated ` in path: "+n);return new t(i)},t.emptyPath=function(){return new t([])},t})(_0),ji=(function(){function e(t){this.fields=t,t.sort(Qe.comparator)}return e.prototype.covers=function(t){for(var n=0,i=this.fields;n<i.length;n++)if(i[n].isPrefixOf(t))return!0;return!1},e.prototype.isEqual=function(t){return Ui(this.fields,t.fields,(function(n,i){return n.isEqual(i)}))},e})(),ye=(function(){function e(t){this.binaryString=t}return e.fromBase64String=function(t){return new e(atob(t))},e.fromUint8Array=function(t){return new e((function(n){for(var i="",o=0;o<n.length;++o)i+=String.fromCharCode(n[o]);return i})(t))},e.prototype.toBase64=function(){return t=this.binaryString,btoa(t);var t},e.prototype.toUint8Array=function(){return(function(t){for(var n=new Uint8Array(t.length),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n})(this.binaryString)},e.prototype.approximateByteSize=function(){return 2*this.binaryString.length},e.prototype.compareTo=function(t){return rt(this.binaryString,t.binaryString)},e.prototype.isEqual=function(t){return this.binaryString===t.binaryString},e})();ye.EMPTY_BYTE_STRING=new ye("");var sC=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Wn(e){if(W(!!e),typeof e=="string"){var t=0,n=sC.exec(e);if(W(!!n),n[1]){var i=n[1];i=(i+"000000000").substr(0,9),t=Number(i)}var o=new Date(e);return{seconds:Math.floor(o.getTime()/1e3),nanos:t}}return{seconds:Ct(e.seconds),nanos:Ct(e.nanos)}}function Ct(e){return typeof e=="number"?e:typeof e=="string"?Number(e):0}function Vi(e){return typeof e=="string"?ye.fromBase64String(e):ye.fromUint8Array(e)}function jp(e){var t,n;return((n=(((t=e?.mapValue)===null||t===void 0?void 0:t.fields)||{}).__type__)===null||n===void 0?void 0:n.stringValue)==="server_timestamp"}function E0(e){var t=e.mapValue.fields.__previous_value__;return jp(t)?E0(t):t}function vs(e){var t=Wn(e.mapValue.fields.__local_write_time__.timestampValue);return new me(t.seconds,t.nanos)}function $r(e){return e==null}function Ra(e){return e===0&&1/e==-1/0}function S0(e){return typeof e=="number"&&Number.isInteger(e)&&!Ra(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}var G=(function(){function e(t){this.path=t}return e.fromPath=function(t){return new e(st.fromString(t))},e.fromName=function(t){return new e(st.fromString(t).popFirst(5))},e.prototype.hasCollectionId=function(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t},e.prototype.isEqual=function(t){return t!==null&&st.comparator(this.path,t.path)===0},e.prototype.toString=function(){return this.path.toString()},e.comparator=function(t,n){return st.comparator(t.path,n.path)},e.isDocumentKey=function(t){return t.length%2==0},e.fromSegments=function(t){return new e(new st(t.slice()))},e})();function jr(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?jp(e)?4:10:K()}function hn(e,t){var n=jr(e);if(n!==jr(t))return!1;switch(n){case 0:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return vs(e).isEqual(vs(t));case 3:return(function(i,o){if(typeof i.timestampValue=="string"&&typeof o.timestampValue=="string"&&i.timestampValue.length===o.timestampValue.length)return i.timestampValue===o.timestampValue;var u=Wn(i.timestampValue),c=Wn(o.timestampValue);return u.seconds===c.seconds&&u.nanos===c.nanos})(e,t);case 5:return e.stringValue===t.stringValue;case 6:return(function(i,o){return Vi(i.bytesValue).isEqual(Vi(o.bytesValue))})(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return(function(i,o){return Ct(i.geoPointValue.latitude)===Ct(o.geoPointValue.latitude)&&Ct(i.geoPointValue.longitude)===Ct(o.geoPointValue.longitude)})(e,t);case 2:return(function(i,o){if("integerValue"in i&&"integerValue"in o)return Ct(i.integerValue)===Ct(o.integerValue);if("doubleValue"in i&&"doubleValue"in o){var u=Ct(i.doubleValue),c=Ct(o.doubleValue);return u===c?Ra(u)===Ra(c):isNaN(u)&&isNaN(c)}return!1})(e,t);case 9:return Ui(e.arrayValue.values||[],t.arrayValue.values||[],hn);case 10:return(function(i,o){var u=i.mapValue.fields||{},c=o.mapValue.fields||{};if(Wy(u)!==Wy(c))return!1;for(var l in u)if(u.hasOwnProperty(l)&&(c[l]===void 0||!hn(u[l],c[l])))return!1;return!0})(e,t);default:return K()}}function gs(e,t){return(e.values||[]).find((function(n){return hn(n,t)}))!==void 0}function qi(e,t){var n=jr(e),i=jr(t);if(n!==i)return rt(n,i);switch(n){case 0:return 0;case 1:return rt(e.booleanValue,t.booleanValue);case 2:return(function(o,u){var c=Ct(o.integerValue||o.doubleValue),l=Ct(u.integerValue||u.doubleValue);return c<l?-1:c>l?1:c===l?0:isNaN(c)?isNaN(l)?0:-1:1})(e,t);case 3:return Xy(e.timestampValue,t.timestampValue);case 4:return Xy(vs(e),vs(t));case 5:return rt(e.stringValue,t.stringValue);case 6:return(function(o,u){var c=Vi(o),l=Vi(u);return c.compareTo(l)})(e.bytesValue,t.bytesValue);case 7:return(function(o,u){for(var c=o.split("/"),l=u.split("/"),f=0;f<c.length&&f<l.length;f++){var d=rt(c[f],l[f]);if(d!==0)return d}return rt(c.length,l.length)})(e.referenceValue,t.referenceValue);case 8:return(function(o,u){var c=rt(Ct(o.latitude),Ct(u.latitude));return c!==0?c:rt(Ct(o.longitude),Ct(u.longitude))})(e.geoPointValue,t.geoPointValue);case 9:return(function(o,u){for(var c=o.values||[],l=u.values||[],f=0;f<c.length&&f<l.length;++f){var d=qi(c[f],l[f]);if(d)return d}return rt(c.length,l.length)})(e.arrayValue,t.arrayValue);case 10:return(function(o,u){var c=o.fields||{},l=Object.keys(c),f=u.fields||{},d=Object.keys(f);l.sort(),d.sort();for(var g=0;g<l.length&&g<d.length;++g){var y=rt(l[g],d[g]);if(y!==0)return y;var w=qi(c[l[g]],f[d[g]]);if(w!==0)return w}return rt(l.length,d.length)})(e.mapValue,t.mapValue);default:throw K()}}function Xy(e,t){if(typeof e=="string"&&typeof t=="string"&&e.length===t.length)return rt(e,t);var n=Wn(e),i=Wn(t),o=rt(n.seconds,i.seconds);return o!==0?o:rt(n.nanos,i.nanos)}function Vp(e){return Xf(e)}function Xf(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?(function(i){var o=Wn(i);return"time("+o.seconds+","+o.nanos+")"})(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?Vi(e.bytesValue).toBase64():"referenceValue"in e?(n=e.referenceValue,G.fromName(n).toString()):"geoPointValue"in e?"geo("+(t=e.geoPointValue).latitude+","+t.longitude+")":"arrayValue"in e?(function(i){for(var o="[",u=!0,
27c=0,l=i.values||[];c<l.length;c++)u?u=!1:o+=",",o+=Xf(l[c]);return o+"]"})(e.arrayValue):"mapValue"in e?(function(i){for(var o="{",u=!0,c=0,l=Object.keys(i.fields||{}).sort();c<l.length;c++){var f=l[c];u?u=!1:o+=",",o+=f+":"+Xf(i.fields[f])}return o+"}"})(e.mapValue):K();var t,n}function Da(e,t){return{referenceValue:"projects/"+e.projectId+"/databases/"+e.database+"/documents/"+t.path.canonicalString()}}function Qf(e){return!!e&&"integerValue"in e}function qp(e){return!!e&&"arrayValue"in e}function Qy(e){return!!e&&"nullValue"in e}function Yy(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function fa(e){return!!e&&"mapValue"in e}function os(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&typeof e.timestampValue=="object")return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){var t={mapValue:{fields:{}}};return zr(e.mapValue.fields,(function(o,u){return t.mapValue.fields[o]=os(u)})),t}if(e.arrayValue){for(var n={arrayValue:{values:[]}},i=0;i<(e.arrayValue.values||[]).length;++i)n.arrayValue.values[i]=os(e.arrayValue.values[i]);return n}return Object.assign({},e)}var ke=(function(){function e(t){this.value=t}return e.empty=function(){return new e({mapValue:{}})},e.prototype.field=function(t){if(t.isEmpty())return this.value;for(var n=this.value,i=0;i<t.length-1;++i)if(!fa(n=(n.mapValue.fields||{})[t.get(i)]))return null;return(n=(n.mapValue.fields||{})[t.lastSegment()])||null},e.prototype.set=function(t,n){this.getFieldsMap(t.popLast())[t.lastSegment()]=os(n)},e.prototype.setAll=function(t){var n=this,i=Qe.emptyPath(),o={},u=[];t.forEach((function(l,f){if(!i.isImmediateParentOf(f)){var d=n.getFieldsMap(i);n.applyChanges(d,o,u),o={},u=[],i=f.popLast()}l?o[f.lastSegment()]=os(l):u.push(f.lastSegment())}));var c=this.getFieldsMap(i);this.applyChanges(c,o,u)},e.prototype.delete=function(t){var n=this.field(t.popLast());fa(n)&&n.mapValue.fields&&delete n.mapValue.fields[t.lastSegment()]},e.prototype.isEqual=function(t){return hn(this.value,t.value)},e.prototype.getFieldsMap=function(t){var n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(var i=0;i<t.length;++i){var o=n.mapValue.fields[t.get(i)];fa(o)&&o.mapValue.fields||(o={mapValue:{fields:{}}},n.mapValue.fields[t.get(i)]=o),n=o}return n.mapValue.fields},e.prototype.applyChanges=function(t,n,i){zr(n,(function(l,f){return t[l]=f}));for(var o=0,u=i;o<u.length;o++){var c=u[o];delete t[c]}},e.prototype.clone=function(){return new e(os(this.value))},e})();function A0(e){var t=[];return zr(e.fields,(function(n,i){var o=new Qe([n]);if(fa(i)){var u=A0(i.mapValue).fields;if(u.length===0)t.push(o);else for(var c=0,l=u;c<l.length;c++){var f=l[c];t.push(o.child(f))}}else t.push(o)})),new ji(t)}var Jt=(function(){function e(t,n,i,o,u){this.key=t,this.documentType=n,this.version=i,this.data=o,this.documentState=u}return e.newInvalidDocument=function(t){return new e(t,0,Z.min(),ke.empty(),0)},e.newFoundDocument=function(t,n,i){return new e(t,1,n,i,0)},e.newNoDocument=function(t,n){return new e(t,2,n,ke.empty(),0)},e.newUnknownDocument=function(t,n){return new e(t,3,n,ke.empty(),2)},e.prototype.convertToFoundDocument=function(t,n){return this.version=t,this.documentType=1,this.data=n,this.documentState=0,this},e.prototype.convertToNoDocument=function(t){return this.version=t,this.documentType=2,this.data=ke.empty(),this.documentState=0,this},e.prototype.convertToUnknownDocument=function(t){return this.version=t,this.documentType=3,this.data=ke.empty(),this.documentState=2,this},e.prototype.setHasCommittedMutations=function(){return this.documentState=2,this},e.prototype.setHasLocalMutations=function(){return this.documentState=1,this},Object.defineProperty(e.prototype,"hasLocalMutations",{get:function(){return this.documentState===1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasCommittedMutations",{get:function(){return this.documentState===2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations}
27,enumerable:!1,configurable:!0}),e.prototype.isValidDocument=function(){return this.documentType!==0},e.prototype.isFoundDocument=function(){return this.documentType===1},e.prototype.isNoDocument=function(){return this.documentType===2},e.prototype.isUnknownDocument=function(){return this.documentType===3},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)},e.prototype.clone=function(){return new e(this.key,this.documentType,this.version,this.data.clone(),this.documentState)},e.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+JSON.stringify(this.data.value)+", {documentType: "+this.documentType+"}), {documentState: "+this.documentState+"})"},e})(),uC=function(e,t,n,i,o,u,c){t===void 0&&(t=null),n===void 0&&(n=[]),i===void 0&&(i=[]),o===void 0&&(o=null),u===void 0&&(u=null),c===void 0&&(c=null),this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=i,this.limit=o,this.startAt=u,this.endAt=c,this.h=null};function Jy(e,t,n,i,o,u,c){return t===void 0&&(t=null),n===void 0&&(n=[]),i===void 0&&(i=[]),o===void 0&&(o=null),u===void 0&&(u=null),c===void 0&&(c=null),new uC(e,t,n,i,o,u,c)}function Fs(e){var t=U(e);if(t.h===null){var n=t.path.canonicalString();t.collectionGroup!==null&&(n+="|cg:"+t.collectionGroup),n+="|f:",n+=t.filters.map((function(i){return(function(o){return o.field.canonicalString()+o.op.toString()+Vp(o.value)})(i)})).join(","),n+="|ob:",n+=t.orderBy.map((function(i){return(function(o){return o.field.canonicalString()+o.dir})(i)})).join(","),$r(t.limit)||(n+="|l:",n+=t.limit),t.startAt&&(n+="|lb:",n+=Pa(t.startAt)),t.endAt&&(n+="|ub:",n+=Pa(t.endAt)),t.h=n}return t.h}function cc(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(var n=0;n<e.orderBy.length;n++)if(!vC(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(var i=0;i<e.filters.length;i++)if(o=e.filters[i],u=t.filters[i],o.op!==u.op||!o.field.isEqual(u.field)||!hn(o.value,u.value))return!1;var o,u;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!tw(e.startAt,t.startAt)&&tw(e.endAt,t.endAt)}function Oa(e){return G.isDocumentKey(e.path)&&e.collectionGroup===null&&e.filters.length===0}var Ce=(function(e){function t(n,i,o){var u=this;return(u=e.call(this)||this).field=n,u.op=i,u.value=o,u}return $(t,e),t.create=function(n,i,o){return n.isKeyField()?i==="in"||i==="not-in"?this.l(n,i,o):new aC(n,i,o):i==="array-contains"?new lC(n,o):i==="in"?new fC(n,o):i==="not-in"?new pC(n,o):i==="array-contains-any"?new dC(n,o):new t(n,i,o)},t.l=function(n,i,o){return i==="in"?new cC(n,o):new hC(n,o)},t.prototype.matches=function(n){var i=n.data.field(this.field);return this.op==="!="?i!==null&&this.m(qi(i,this.value)):i!==null&&jr(this.value)===jr(i)&&this.m(qi(i,this.value))},t.prototype.m=function(n){switch(this.op){case"<":return n<0;case"<=":return n<=0;case"==":return n===0;case"!=":return n!==0;case">":return n>0;case">=":return n>=0;default:return K()}},t.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},t})((function(){})),aC=(function(e){function t(n,i,o){var u=this;return(u=e.call(this,n,i,o)||this).key=G.fromName(o.referenceValue),u}return $(t,e),t.prototype.matches=function(n){var i=G.comparator(n.key,this.key);return this.m(i)},t})(Ce),cC=(function(e){function t(n,i){var o=this;return(o=e.call(this,n,"in",i)||this).keys=k0("in",i),o}return $(t,e),t.prototype.matches=function(n){return this.keys.some((function(i){return i.isEqual(n.key)}))},t})(Ce),hC=(function(e){function t(n,i){var o=this;return(o=e.call(this,n,"not-in",i)||this).keys=k0("not-in",i),o}return $(t,e),t.prototype.matches=function(n){return!this.keys.some((function(i){return i.isEqual(n.key)}))},t})(Ce);function k0(e,t){var n;return(((n=t.arrayValue)===null||n===void 0?void 0:n.values)||[]).map((function(i){return G.fromName(i.referenceValue)}))}var lC=(function(e){function t(n,i){return e.call(this,n,"array-contains",i)||this}return $(t,e),t.prototype.matches=function(n){var i=n.data.field(this.field);return qp(i)&&gs(i.arrayValue,this.value)},t})(Ce),fC=(function(e){function t(n,i){return e.call(this,n,"in",i)||this}return $(t,e),t.prototype.matches=function(n){var i=n.data.field(this.field);return i!==null&&gs(this.value.arrayValue,i)},t}
27)(Ce),pC=(function(e){function t(n,i){return e.call(this,n,"not-in",i)||this}return $(t,e),t.prototype.matches=function(n){if(gs(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var i=n.data.field(this.field);return i!==null&&!gs(this.value.arrayValue,i)},t})(Ce),dC=(function(e){function t(n,i){return e.call(this,n,"array-contains-any",i)||this}return $(t,e),t.prototype.matches=function(n){var i=this,o=n.data.field(this.field);return!(!qp(o)||!o.arrayValue.values)&&o.arrayValue.values.some((function(u){return gs(i.value.arrayValue,u)}))},t})(Ce),ms=function(e,t){this.position=e,this.before=t};function Pa(e){return(e.before?"b":"a")+":"+e.position.map((function(t){return Vp(t)})).join(",")}var xi=function(e,t){t===void 0&&(t="asc"),this.field=e,this.dir=t};function vC(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}function Zy(e,t,n){for(var i=0,o=0;o<e.position.length;o++){var u=t[o],c=e.position[o];if(i=u.field.isKeyField()?G.comparator(G.fromName(c.referenceValue),n.key):qi(c,n.data.field(u.field)),u.dir==="desc"&&(i*=-1),i!==0)break}return e.before?i<=0:i<0}function tw(e,t){if(e===null)return t===null;if(t===null||e.before!==t.before||e.position.length!==t.position.length)return!1;for(var n=0;n<e.position.length;n++)if(!hn(e.position[n],t.position[n]))return!1;return!0}var An=(function(e,t,n,i,o,u,c,l){t===void 0&&(t=null),n===void 0&&(n=[]),i===void 0&&(i=[]),o===void 0&&(o=null),u===void 0&&(u="F"),c===void 0&&(c=null),l===void 0&&(l=null),this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=i,this.limit=o,this.limitType=u,this.startAt=c,this.endAt=l,this.p=null,this.T=null,this.startAt,this.endAt});function N0(e,t,n,i,o,u,c,l){return new An(e,t,n,i,o,u,c,l)}function Us(e){return new An(e)}function pa(e){return!$r(e.limit)&&e.limitType==="F"}function xa(e){return!$r(e.limit)&&e.limitType==="L"}function Bp(e){return e.explicitOrderBy.length>0?e.explicitOrderBy[0].field:null}function Kp(e){for(var t=0,n=e.filters;t<n.length;t++){var i=n[t];if(i.g())return i.field}return null}function Hp(e){return e.collectionGroup!==null}function Bi(e){var t=U(e);if(t.p===null){t.p=[];var n=Kp(t),i=Bp(t);if(n!==null&&i===null)n.isKeyField()||t.p.push(new xi(n)),t.p.push(new xi(Qe.keyField(),"asc"));else{for(var o=!1,u=0,c=t.explicitOrderBy;u<c.length;u++){var l=c[u];t.p.push(l),l.field.isKeyField()&&(o=!0)}if(!o){var f=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";t.p.push(new xi(Qe.keyField(),f))}}}return t.p}function ln(e){var t=U(e);if(!t.T)if(t.limitType==="F")t.T=Jy(t.path,t.collectionGroup,Bi(t),t.filters,t.limit,t.startAt,t.endAt);else{for(var n=[],i=0,o=Bi(t);i<o.length;i++){var u=o[i],c=u.dir==="desc"?"asc":"desc";n.push(new xi(u.field,c))}var l=t.endAt?new ms(t.endAt.position,!t.endAt.before):null,f=t.startAt?new ms(t.startAt.position,!t.startAt.before):null;t.T=Jy(t.path,t.collectionGroup,n,t.filters,t.limit,l,f)}return t.T}function C0(e,t,n){return new An(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function js(e,t){return cc(ln(e),ln(t))&&e.limitType===t.limitType}function R0(e){return Fs(ln(e))+"|lt:"+e.limitType}function Yf(e){return"Query(target="+(function(t){var n=t.path.canonicalString();return t.collectionGroup!==null&&(n+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(n+=", filters: ["+t.filters.map((function(i){return(o=i).field.canonicalString()+" "+o.op+" "+Vp(o.value);var o})).join(", ")+"]"),$r(t.limit)||(n+=", limit: "+t.limit),t.orderBy.length>0&&(n+=", orderBy: ["+t.orderBy.map((function(i){return(function(o){return o.field.canonicalString()+" ("+o.dir+")"})(i)})).join(", ")+"]"),t.startAt&&(n+=", startAt: "+Pa(t.startAt)),t.endAt&&(n+=", endAt: "+Pa(t.endAt)),"Target("+n+")"})(ln(e))+"; limitType="+e.limitType+")"}function Vs(e,t){return t.isFoundDocument()&&(function(n,i){var o=i.key.path;return n.collectionGroup!==null?i.key.hasCollectionId(n.collectionGroup)&&n.path.isPrefixOf(o):G.isDocumentKey(n.path)?n.path.isEqual(o):n.path.isImmediateParentOf(o)})(e,t)&&(function(n,i){for(var o=0,u=n.explicitOrderBy;o<u.length;o++){var c=u[o];if(!c.field.isKeyField()&&i.data.field(c.field)===null)return!1}return!0})(e,t)&&(function(n,i){for(var o=0,u=n.filters;o<u.length;o++)if(!u[o].matches(i))return!1;return!0})(e,t)&&(function(n,i){return!(n.startAt&&!Zy(n.startAt,Bi(n),i))&&(!n.endAt||!Zy(n.endAt,Bi(n),i))})(e,t)}function D0(e){return function(t,n){for(var i=!1,o=0,u=Bi(e);o<u.length;o++){var c=u[o],l=gC(c,t,n);if(l!==0)return l;i=i||c.field.isKeyField()}return 0}}
27function gC(e,t,n){var i=e.field.isKeyField()?G.comparator(t.key,n.key):(function(o,u,c){var l=u.data.field(o),f=c.data.field(o);return l!==null&&f!==null?qi(l,f):K()})(e.field,t,n);switch(e.dir){case"asc":return i;case"desc":return-1*i;default:return K()}}function O0(e,t){if(e.I){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Ra(t)?"-0":t}}function P0(e){return{integerValue:""+e}}function x0(e,t){return S0(t)?P0(t):O0(e,t)}var hc=function(){this._=void 0};function mC(e,t,n){return e instanceof Ki?(function(i,o){var u={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return o&&(u.fields.__previous_value__=o),{mapValue:u}})(n,t):e instanceof Vr?M0(e,t):e instanceof qr?F0(e,t):(function(i,o){var u=L0(i,o),c=ew(u)+ew(i.A);return Qf(u)&&Qf(i.A)?P0(c):O0(i.R,c)})(e,t)}function yC(e,t,n){return e instanceof Vr?M0(e,t):e instanceof qr?F0(e,t):n}function L0(e,t){return e instanceof Hi?Qf(n=t)||(function(i){return!!i&&"doubleValue"in i})(n)?t:{integerValue:0}:null;var n}var Ki=(function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return $(t,e),t})(hc),Vr=(function(e){function t(n){var i=this;return(i=e.call(this)||this).elements=n,i}return $(t,e),t})(hc);function M0(e,t){for(var n=U0(t),i=function(c){n.some((function(l){return hn(l,c)}))||n.push(c)},o=0,u=e.elements;o<u.length;o++)i(u[o]);return{arrayValue:{values:n}}}var qr=(function(e){function t(n){var i=this;return(i=e.call(this)||this).elements=n,i}return $(t,e),t})(hc);function F0(e,t){for(var n=U0(t),i=function(c){n=n.filter((function(l){return!hn(l,c)}))},o=0,u=e.elements;o<u.length;o++)i(u[o]);return{arrayValue:{values:n}}}var Hi=(function(e){function t(n,i){var o=this;return(o=e.call(this)||this).R=n,o.A=i,o}return $(t,e),t})(hc);function ew(e){return Ct(e.integerValue||e.doubleValue)}function U0(e){return qp(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}var qs=function(e,t){this.field=e,this.transform=t},wC=function(e,t){this.version=e,this.transformResults=t},Qt=(function(){function e(t,n){this.updateTime=t,this.exists=n}return e.none=function(){return new e},e.exists=function(t){return new e(void 0,t)},e.updateTime=function(t){return new e(t)},Object.defineProperty(e.prototype,"isNone",{get:function(){return this.updateTime===void 0&&this.exists===void 0},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)},e})();function da(e,t){return e.updateTime!==void 0?t.isFoundDocument()&&t.version.isEqual(e.updateTime):e.exists===void 0||e.exists===t.isFoundDocument()}var lc=function(){};function bC(e,t,n){e instanceof Bs?(function(i,o,u){var c=i.value.clone(),l=iw(i.fieldTransforms,o,u.transformResults);c.setAll(l),o.convertToFoundDocument(u.version,c).setHasCommittedMutations()})(e,t,n):e instanceof Jn?(function(i,o,u){if(da(i.precondition,o)){var c=iw(i.fieldTransforms,o,u.transformResults),l=o.data;l.setAll(j0(i)),l.setAll(c),o.convertToFoundDocument(u.version,l).setHasCommittedMutations()}else o.convertToUnknownDocument(u.version)})(e,t,n):(function(i,o,u){o.convertToNoDocument(u.version).setHasCommittedMutations()})(0,t,n)}function Jf(e,t,n){e instanceof Bs?(function(i,o,u){if(da(i.precondition,o)){var c=i.value.clone(),l=ow(i.fieldTransforms,u,o);c.setAll(l),o.convertToFoundDocument(rw(o),c).setHasLocalMutations()}})(e,t,n):e instanceof Jn?(function(i,o,u){if(da(i.precondition,o)){var c=ow(i.fieldTransforms,u,o),l=o.data;l.setAll(j0(i)),l.setAll(c),o.convertToFoundDocument(rw(o),l).setHasLocalMutations()}})(e,t,n):(function(i,o){da(i.precondition,o)&&o.convertToNoDocument(Z.min())})(e,t)}function IC(e,t){for(var n=null,i=0,o=e.fieldTransforms;i<o.length;i++){var u=o[i],c=t.data.field(u.field),l=L0(u.transform,c||null);l!=null&&(n==null&&(n=ke.empty()),n.set(u.field,l))}return n||null}function nw(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!(function(n,i){return n===void 0&&i===void 0||!(!n||!i)&&Ui(n,i,(function(o,u){return(function(c,l){return c.field.isEqual(l.field)&&(function(f,d){return f instanceof Vr&&d
27instanceof Vr||f instanceof qr&&d instanceof qr?Ui(f.elements,d.elements,hn):f instanceof Hi&&d instanceof Hi?hn(f.A,d.A):f instanceof Ki&&d instanceof Ki})(c.transform,l.transform)})(o,u)}))})(e.fieldTransforms,t.fieldTransforms)&&(e.type===0?e.value.isEqual(t.value):e.type!==1||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}function rw(e){return e.isFoundDocument()?e.version:Z.min()}var Bs=(function(e){function t(n,i,o,u){u===void 0&&(u=[]);var c=this;return(c=e.call(this)||this).key=n,c.value=i,c.precondition=o,c.fieldTransforms=u,c.type=0,c}return $(t,e),t})(lc),Jn=(function(e){function t(n,i,o,u,c){c===void 0&&(c=[]);var l=this;return(l=e.call(this)||this).key=n,l.data=i,l.fieldMask=o,l.precondition=u,l.fieldTransforms=c,l.type=1,l}return $(t,e),t})(lc);function j0(e){var t=new Map;return e.fieldMask.fields.forEach((function(n){if(!n.isEmpty()){var i=e.data.field(n);t.set(n,i)}})),t}function iw(e,t,n){var i=new Map;W(e.length===n.length);for(var o=0;o<n.length;o++){var u=e[o],c=u.transform,l=t.data.field(u.field);i.set(u.field,yC(c,l,n[o]))}return i}function ow(e,t,n){for(var i=new Map,o=0,u=e;o<u.length;o++){var c=u[o],l=c.transform,f=n.data.field(c.field);i.set(c.field,mC(l,f,t))}return i}var Nt,it,Ks=(function(e){function t(n,i){var o=this;return(o=e.call(this)||this).key=n,o.precondition=i,o.type=2,o.fieldTransforms=[],o}return $(t,e),t})(lc),Gp=(function(e){function t(n,i){var o=this;return(o=e.call(this)||this).key=n,o.precondition=i,o.type=3,o.fieldTransforms=[],o}return $(t,e),t})(lc),TC=(function(e){this.count=e});function V0(e){switch(e){case k.OK:return K();case k.CANCELLED:case k.UNKNOWN:case k.DEADLINE_EXCEEDED:case k.RESOURCE_EXHAUSTED:case k.INTERNAL:case k.UNAVAILABLE:case k.UNAUTHENTICATED:return!1;case k.INVALID_ARGUMENT:case k.NOT_FOUND:case k.ALREADY_EXISTS:case k.PERMISSION_DENIED:case k.FAILED_PRECONDITION:case k.ABORTED:case k.OUT_OF_RANGE:case k.UNIMPLEMENTED:case k.DATA_LOSS:return!0;default:return K()}}function q0(e){if(e===void 0)return Rt("GRPC error has no .code"),k.UNKNOWN;switch(e){case Nt.OK:return k.OK;case Nt.CANCELLED:return k.CANCELLED;case Nt.UNKNOWN:return k.UNKNOWN;case Nt.DEADLINE_EXCEEDED:return k.DEADLINE_EXCEEDED;case Nt.RESOURCE_EXHAUSTED:return k.RESOURCE_EXHAUSTED;case Nt.INTERNAL:return k.INTERNAL;case Nt.UNAVAILABLE:return k.UNAVAILABLE;case Nt.UNAUTHENTICATED:return k.UNAUTHENTICATED;case Nt.INVALID_ARGUMENT:return k.INVALID_ARGUMENT;case Nt.NOT_FOUND:return k.NOT_FOUND;case Nt.ALREADY_EXISTS:return k.ALREADY_EXISTS;case Nt.PERMISSION_DENIED:return k.PERMISSION_DENIED;case Nt.FAILED_PRECONDITION:return k.FAILED_PRECONDITION;case Nt.ABORTED:return k.ABORTED;case Nt.OUT_OF_RANGE:return k.OUT_OF_RANGE;case Nt.UNIMPLEMENTED:return k.UNIMPLEMENTED;case Nt.DATA_LOSS:return k.DATA_LOSS;default:return K()}}(it=Nt||(Nt={}))[it.OK=0]="OK",it[it.CANCELLED=1]="CANCELLED",it[it.UNKNOWN=2]="UNKNOWN",it[it.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",it[it.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",it[it.NOT_FOUND=5]="NOT_FOUND",it[it.ALREADY_EXISTS=6]="ALREADY_EXISTS",it[it.PERMISSION_DENIED=7]="PERMISSION_DENIED",it[it.UNAUTHENTICATED=16]="UNAUTHENTICATED",it[it.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",it[it.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",it[it.ABORTED=10]="ABORTED",it[it.OUT_OF_RANGE=11]="OUT_OF_RANGE",it[it.UNIMPLEMENTED=12]="UNIMPLEMENTED",it[it.INTERNAL=13]="INTERNAL",it[it.UNAVAILABLE=14]="UNAVAILABLE",it[it.DATA_LOSS=15]="DATA_LOSS";var Zt=(function(){function e(t,n){this.comparator=t,this.root=n||Bn.EMPTY}return e.prototype.insert=function(t,n){return new e(this.comparator,this.root.insert(t,n,this.comparator).copy(null,null,Bn.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator,this.root.remove(t,this.comparator).copy(null,null,Bn.BLACK,null,null))},e.prototype.get=function(t){for(var n=this.root;!n.isEmpty();){var i=this.comparator(t,n.key);if(i===0)return n.value;i<0?n=n.left:i>0&&(n=n.right)}return null},e.prototype.indexOf=function(t){for(var n=0,i=this.root;!i.isEmpty();){var o=this.comparator(t,i.key);if(o===0)return n+i.left.size;o<0?i=i.left:(n+=i.left.size+1,i=i.right)}return-1},e.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(e.prototype,"size",{get:function(){return this.root.size}
27,enumerable:!1,configurable:!0}),e.prototype.minKey=function(){return this.root.minKey()},e.prototype.maxKey=function(){return this.root.maxKey()},e.prototype.inorderTraversal=function(t){return this.root.inorderTraversal(t)},e.prototype.forEach=function(t){this.inorderTraversal((function(n,i){return t(n,i),!1}))},e.prototype.toString=function(){var t=[];return this.inorderTraversal((function(n,i){return t.push(n+":"+i),!1})),"{"+t.join(", ")+"}"},e.prototype.reverseTraversal=function(t){return this.root.reverseTraversal(t)},e.prototype.getIterator=function(){return new ra(this.root,null,this.comparator,!1)},e.prototype.getIteratorFrom=function(t){return new ra(this.root,t,this.comparator,!1)},e.prototype.getReverseIterator=function(){return new ra(this.root,null,this.comparator,!0)},e.prototype.getReverseIteratorFrom=function(t){return new ra(this.root,t,this.comparator,!0)},e})(),ra=(function(){function e(t,n,i,o){this.isReverse=o,this.nodeStack=[];for(var u=1;!t.isEmpty();)if(u=n?i(t.key,n):1,o&&(u*=-1),u<0)t=this.isReverse?t.left:t.right;else{if(u===0){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}return e.prototype.getNext=function(){var t=this.nodeStack.pop(),n={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return n},e.prototype.hasNext=function(){return this.nodeStack.length>0},e.prototype.peek=function(){if(this.nodeStack.length===0)return null;var t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}},e})(),Bn=(function(){function e(t,n,i,o,u){this.key=t,this.value=n,this.color=i??e.RED,this.left=o??e.EMPTY,this.right=u??e.EMPTY,this.size=this.left.size+1+this.right.size}return e.prototype.copy=function(t,n,i,o,u){return new e(t??this.key,n??this.value,i??this.color,o??this.left,u??this.right)},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)},e.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},e.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},e.prototype.minKey=function(){return this.min().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(t,n,i){var o=this,u=i(t,o.key);return(o=u<0?o.copy(null,null,null,o.left.insert(t,n,i),null):u===0?o.copy(null,n,null,null,null):o.copy(null,null,null,null,o.right.insert(t,n,i))).fixUp()},e.prototype.removeMin=function(){if(this.left.isEmpty())return e.EMPTY;var t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),(t=t.copy(null,null,null,t.left.removeMin(),null)).fixUp()},e.prototype.remove=function(t,n){var i,o=this;if(n(t,o.key)<0)o.left.isEmpty()||o.left.isRed()||o.left.left.isRed()||(o=o.moveRedLeft()),o=o.copy(null,null,null,o.left.remove(t,n),null);else{if(o.left.isRed()&&(o=o.rotateRight()),o.right.isEmpty()||o.right.isRed()||o.right.left.isRed()||(o=o.moveRedRight()),n(t,o.key)===0){if(o.right.isEmpty())return e.EMPTY;i=o.right.min(),o=o.copy(i.key,i.value,null,null,o.right.removeMin())}o=o.copy(null,null,null,null,o.right.remove(t,n))}return o.fixUp()},e.prototype.isRed=function(){return this.color},e.prototype.fixUp=function(){var t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t},e.prototype.moveRedLeft=function(){var t=this.colorFlip();return t.right.left.isRed()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight())).rotateLeft()).colorFlip()),t},e.prototype.moveRedRight=function(){var t=this.colorFlip();return t.left.left.isRed()&&(t=(t=t.rotateRight()).colorFlip()),t},e.prototype.rotateLeft=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip=function(){var t=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,n)},e.prototype.checkMaxDepth=function(){var t=this.check();return Math.pow(2,t)<=this.size+1},e.prototype.check=function(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw K();var t=this.left.check();if(t!==this.right.check())throw K();return t+(this.isRed()?0:1)},e})();
27Bn.EMPTY=null,Bn.RED=!0,Bn.BLACK=!1,Bn.EMPTY=new((function(){function e(){this.size=0}return Object.defineProperty(e.prototype,"key",{get:function(){throw K()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){throw K()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){throw K()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){throw K()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){throw K()},enumerable:!1,configurable:!0}),e.prototype.copy=function(t,n,i,o,u){return this},e.prototype.insert=function(t,n,i){return new Bn(t,n)},e.prototype.remove=function(t,n){return this},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(t){return!1},e.prototype.reverseTraversal=function(t){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.isRed=function(){return!1},e.prototype.checkMaxDepth=function(){return!0},e.prototype.check=function(){return 0},e})());var Mt=(function(){function e(t){this.comparator=t,this.data=new Zt(this.comparator)}return e.prototype.has=function(t){return this.data.get(t)!==null},e.prototype.first=function(){return this.data.minKey()},e.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(e.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),e.prototype.indexOf=function(t){return this.data.indexOf(t)},e.prototype.forEach=function(t){this.data.inorderTraversal((function(n,i){return t(n),!1}))},e.prototype.forEachInRange=function(t,n){for(var i=this.data.getIteratorFrom(t[0]);i.hasNext();){var o=i.getNext();if(this.comparator(o.key,t[1])>=0)return;n(o.key)}},e.prototype.forEachWhile=function(t,n){var i;for(i=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();i.hasNext();)if(!t(i.getNext().key))return},e.prototype.firstAfterOrEqual=function(t){var n=this.data.getIteratorFrom(t);return n.hasNext()?n.getNext().key:null},e.prototype.getIterator=function(){return new sw(this.data.getIterator())},e.prototype.getIteratorFrom=function(t){return new sw(this.data.getIteratorFrom(t))},e.prototype.add=function(t){return this.copy(this.data.remove(t).insert(t,!0))},e.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},e.prototype.isEmpty=function(){return this.data.isEmpty()},e.prototype.unionWith=function(t){var n=this;return n.size<t.size&&(n=t,t=this),t.forEach((function(i){n=n.add(i)})),n},e.prototype.isEqual=function(t){if(!(t instanceof e)||this.size!==t.size)return!1;for(var n=this.data.getIterator(),i=t.data.getIterator();n.hasNext();){var o=n.getNext().key,u=i.getNext().key;if(this.comparator(o,u)!==0)return!1}return!0},e.prototype.toArray=function(){var t=[];return this.forEach((function(n){t.push(n)})),t},e.prototype.toString=function(){var t=[];return this.forEach((function(n){return t.push(n)})),"SortedSet("+t.toString()+")"},e.prototype.copy=function(t){var n=new e(this.comparator);return n.data=t,n},e})(),sw=(function(){function e(t){this.iter=t}return e.prototype.getNext=function(){return this.iter.getNext().key},e.prototype.hasNext=function(){return this.iter.hasNext()},e})(),_C=new Zt(G.comparator);function We(){return _C}var EC=new Zt(G.comparator);function Zf(){return EC}var SC=new Zt(G.comparator);function AC(){return SC}var kC=new Mt(G.comparator);function ft(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=kC,i=0,o=e;i<o.length;i++){var u=o[i];n=n.add(u)}return n}var NC=new Mt(rt);function fc(){return NC}var zp=(function(){function e(t,n,i,o,u){this.snapshotVersion=t,this.targetChanges=n,this.targetMismatches=i,this.documentUpdates=o,this.resolvedLimboDocuments=u}return e.createSynthesizedRemoteEventForCurrentChange=function(t,n){var i=new Map;return i.set(t,$p.createSynthesizedTargetChangeForCurrentChange(t,n)),new e(Z.min(),i,fc(),We(),ft())},e})(),$p=(function(){function e(t,n,i,o,u){this.resumeToken=t,this.current=n,this.addedDocuments=i,this.modifiedDocuments=o,this.removedDocuments=u}return e.createSynthesizedTargetChangeForCurrentChange=function(t,n){return new e(ye.EMPTY_BYTE_STRING,n,ft(),ft(),ft())},e})(),va=function(e,t,n,i){this.v=e,this.removedTargetIds=t,this.key=n,this.P=i},B0=function(e,t){this.targetId=e,this.V=t},K0=function(e,t,n,i){n===void 0&&(n=ye.EMPTY_BYTE_STRING),i===void 0&&(i=null),this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=i},uw=(function(){function e(){this.S=0,this.D=cw(),this.C=ye.EMPTY_BYTE_STRING,this.N=!1,this.k=!0}return Object.defineProperty(e.prototype,"current",{get:function(){return this.N}
27,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resumeToken",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"F",{get:function(){return this.S!==0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$",{get:function(){return this.k},enumerable:!1,configurable:!0}),e.prototype.O=function(t){t.approximateByteSize()>0&&(this.k=!0,this.C=t)},e.prototype.M=function(){var t=ft(),n=ft(),i=ft();return this.D.forEach((function(o,u){switch(u){case 0:t=t.add(o);break;case 2:n=n.add(o);break;case 1:i=i.add(o);break;default:K()}})),new $p(this.C,this.N,t,n,i)},e.prototype.L=function(){this.k=!1,this.D=cw()},e.prototype.B=function(t,n){this.k=!0,this.D=this.D.insert(t,n)},e.prototype.q=function(t){this.k=!0,this.D=this.D.remove(t)},e.prototype.U=function(){this.S+=1},e.prototype.K=function(){this.S-=1},e.prototype.j=function(){this.k=!0,this.N=!0},e})(),CC=(function(){function e(t){this.W=t,this.G=new Map,this.H=We(),this.J=aw(),this.Y=new Mt(rt)}return e.prototype.X=function(t){for(var n=0,i=t.v;n<i.length;n++){var o=i[n];t.P&&t.P.isFoundDocument()?this.Z(o,t.P):this.tt(o,t.key,t.P)}for(var u=0,c=t.removedTargetIds;u<c.length;u++)o=c[u],this.tt(o,t.key,t.P)},e.prototype.et=function(t){var n=this;this.forEachTarget(t,(function(i){var o=n.nt(i);switch(t.state){case 0:n.st(i)&&o.O(t.resumeToken);break;case 1:o.K(),o.F||o.L(),o.O(t.resumeToken);break;case 2:o.K(),o.F||n.removeTarget(i);break;case 3:n.st(i)&&(o.j(),o.O(t.resumeToken));break;case 4:n.st(i)&&(n.it(i),o.O(t.resumeToken));break;default:K()}}))},e.prototype.forEachTarget=function(t,n){var i=this;t.targetIds.length>0?t.targetIds.forEach(n):this.G.forEach((function(o,u){i.st(u)&&n(u)}))},e.prototype.rt=function(t){var n=t.targetId,i=t.V.count,o=this.ot(n);if(o){var u=o.target;if(Oa(u))if(i===0){var c=new G(u.path);this.tt(n,c,Jt.newNoDocument(c,Z.min()))}else W(i===1);else this.ct(n)!==i&&(this.it(n),this.Y=this.Y.add(n))}},e.prototype.ut=function(t){var n=this,i=new Map;this.G.forEach((function(c,l){var f=n.ot(l);if(f){if(c.current&&Oa(f.target)){var d=new G(f.target.path);n.H.get(d)!==null||n.at(l,d)||n.tt(l,d,Jt.newNoDocument(d,t))}c.$&&(i.set(l,c.M()),c.L())}}));var o=ft();this.J.forEach((function(c,l){var f=!0;l.forEachWhile((function(d){var g=n.ot(d);return!g||g.purpose===2||(f=!1,!1)})),f&&(o=o.add(c))}));var u=new zp(t,i,this.Y,this.H,o);return this.H=We(),this.J=aw(),this.Y=new Mt(rt),u},e.prototype.Z=function(t,n){if(this.st(t)){var i=this.at(t,n.key)?2:0;this.nt(t).B(n.key,i),this.H=this.H.insert(n.key,n),this.J=this.J.insert(n.key,this.ht(n.key).add(t))}},e.prototype.tt=function(t,n,i){if(this.st(t)){var o=this.nt(t);this.at(t,n)?o.B(n,1):o.q(n),this.J=this.J.insert(n,this.ht(n).delete(t)),i&&(this.H=this.H.insert(n,i))}},e.prototype.removeTarget=function(t){this.G.delete(t)},e.prototype.ct=function(t){var n=this.nt(t).M();return this.W.getRemoteKeysForTarget(t).size+n.addedDocuments.size-n.removedDocuments.size},e.prototype.U=function(t){this.nt(t).U()},e.prototype.nt=function(t){var n=this.G.get(t);return n||(n=new uw,this.G.set(t,n)),n},e.prototype.ht=function(t){var n=this.J.get(t);return n||(n=new Mt(rt),this.J=this.J.insert(t,n)),n},e.prototype.st=function(t){var n=this.ot(t)!==null;return n||M("WatchChangeAggregator","Detected inactive target",t),n},e.prototype.ot=function(t){var n=this.G.get(t);return n&&n.F?null:this.W.lt(t)},e.prototype.it=function(t){var n=this;this.G.set(t,new uw),this.W.getRemoteKeysForTarget(t).forEach((function(i){n.tt(t,i,null)}))},e.prototype.at=function(t,n){return this.W.getRemoteKeysForTarget(t).has(n)},e})();function aw(){return new Zt(G.comparator)}function cw(){return new Zt(G.comparator)}var RC={asc:"ASCENDING",desc:"DESCENDING"},DC={"<":"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"},OC=function(e,t){this.databaseId=e,this.I=t};function ys(e,t){return e.I?new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+t.nanoseconds).slice(-9)+"Z":{seconds:""+t.seconds,nanos:t.nanoseconds}}function H0(e,t){return e.I?t.toBase64():t.toUint8Array()}function PC(e,t){return ys(e,t.toTimestamp())}function he(e){return W(!!e),Z.fromTimestamp((function(t){var n=Wn(t);return new me(n.seconds,n.nanos)})(e))}function Wp(e,t){return(function(n){return new st(["projects",n.projectId,"databases",n.database])})(e).child("documents").child(t).canonicalString()}function G0(e){var t=st.fromString(e);return W(J0(t)),t}function ws(e,t){return Wp(e.databaseId,t.path)}function In(e,t){var n=G0(t);if(n.get(1)!==e.databaseId.projectId)throw new P(k.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new P(k.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new G($0(n))}function tp(e,t){return Wp(e.databaseId,t)}function z0(e){var t=G0(e);return t.length===4?st.emptyPath():$0(t)}function bs(e){return new st(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function $0(e){return W(e.length>4&&e.get(4)==="documents"),e.popFirst(5)}function hw(e,t,n){return{name:ws(e,t),fields:n.value.mapValue.fields}}function xC(e,t,n){var i=In(e,t.name),o=he(t.updateTime),u=new ke({mapValue:{fields:t.fields}}),c=Jt.newFoundDocument(i,o,u);return n&&c.setHasCommittedMutations(),n?c.setHasCommittedMutations():c}function La(e,t){var n;if(t instanceof Bs)n={update:hw(e,t.key,t.value)};else if(t instanceof Ks)n={delete:ws(e,t.key)};else if(t instanceof Jn)n={update:hw(e,t.key,t.data),updateMask:jC(t.fieldMask)};else{if(!(t instanceof Gp))return K();n={verify:ws(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map((function(i){return(function(o,u){var c=u.transform;
27if(c instanceof Ki)return{fieldPath:u.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(c instanceof Vr)return{fieldPath:u.field.canonicalString(),appendMissingElements:{values:c.elements}};if(c instanceof qr)return{fieldPath:u.field.canonicalString(),removeAllFromArray:{values:c.elements}};if(c instanceof Hi)return{fieldPath:u.field.canonicalString(),increment:c.A};throw K()})(0,i)}))),t.precondition.isNone||(n.currentDocument=(function(i,o){return o.updateTime!==void 0?{updateTime:PC(i,o.updateTime)}:o.exists!==void 0?{exists:o.exists}:K()})(e,t.precondition)),n}function lw(e,t){var n=t.currentDocument?(function(d){return d.updateTime!==void 0?Qt.updateTime(he(d.updateTime)):d.exists!==void 0?Qt.exists(d.exists):Qt.none()})(t.currentDocument):Qt.none(),i=t.updateTransforms?t.updateTransforms.map((function(d){return(function(g,y){var w=null;if("setToServerValue"in y)W(y.setToServerValue==="REQUEST_TIME"),w=new Ki;else if("appendMissingElements"in y){var I=y.appendMissingElements.values||[];w=new Vr(I)}else if("removeAllFromArray"in y){var T=y.removeAllFromArray.values||[];w=new qr(T)}else"increment"in y?w=new Hi(g,y.increment):K();var E=Qe.fromServerFormat(y.fieldPath);return new qs(E,w)})(e,d)})):[];if(t.update){t.update.name;var o=In(e,t.update.name),u=new ke({mapValue:{fields:t.update.fields}});if(t.updateMask){var c=(function(d){var g=d.fieldPaths||[];return new ji(g.map((function(y){return Qe.fromServerFormat(y)})))})(t.updateMask);return new Jn(o,u,c,n,i)}return new Bs(o,u,n,i)}if(t.delete){var l=In(e,t.delete);return new Ks(l,n)}if(t.verify){var f=In(e,t.verify);return new Gp(f,n)}return K()}function W0(e,t){return{documents:[tp(e,t.path)]}}function X0(e,t){var n={structuredQuery:{}},i=t.path;t.collectionGroup!==null?(n.parent=tp(e,i),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=tp(e,i.popLast()),n.structuredQuery.from=[{collectionId:i.lastSegment()}]);var o=(function(l){if(l.length!==0){var f=l.map((function(d){return(function(g){if(g.op==="=="){if(Yy(g.value))return{unaryFilter:{field:Ai(g.field),op:"IS_NAN"}};if(Qy(g.value))return{unaryFilter:{field:Ai(g.field),op:"IS_NULL"}}}else if(g.op==="!="){if(Yy(g.value))return{unaryFilter:{field:Ai(g.field),op:"IS_NOT_NAN"}};if(Qy(g.value))return{unaryFilter:{field:Ai(g.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Ai(g.field),op:MC(g.op),value:g.value}}})(d)}));return f.length===1?f[0]:{compositeFilter:{op:"AND",filters:f}}}})(t.filters);o&&(n.structuredQuery.where=o);var u=(function(l){if(l.length!==0)return l.map((function(f){return(function(d){return{field:Ai(d.field),direction:LC(d.dir)}})(f)}))})(t.orderBy);u&&(n.structuredQuery.orderBy=u);var c=(function(l,f){return l.I||$r(f)?f:{value:f}})(e,t.limit);return c!==null&&(n.structuredQuery.limit=c),t.startAt&&(n.structuredQuery.startAt=fw(t.startAt)),t.endAt&&(n.structuredQuery.endAt=fw(t.endAt)),n}function Q0(e){var t=z0(e.parent),n=e.structuredQuery,i=n.from?n.from.length:0,o=null;if(i>0){W(i===1);var u=n.from[0];u.allDescendants?o=u.collectionId:t=t.child(u.collectionId)}var c=[];n.where&&(c=Y0(n.where));var l=[];n.orderBy&&(l=n.orderBy.map((function(y){return(function(w){return new xi(Pi(w.field),(function(I){switch(I){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(w.direction))})(y)})));var f=null;n.limit&&(f=(function(y){var w;return $r(w=typeof y=="object"?y.value:y)?null:w})(n.limit));var d=null;n.startAt&&(d=pw(n.startAt));var g=null;return n.endAt&&(g=pw(n.endAt)),N0(t,o,l,c,f,"F",d,g)}function Y0(e){return e?e.unaryFilter!==void 0?[UC(e)]:e.fieldFilter!==void 0?[FC(e)]:e.compositeFilter!==void 0?e.compositeFilter.filters.map((function(t){return Y0(t)})).reduce((function(t,n){return t.concat(n)})):K():[]}function fw(e){return{before:e.before,values:e.position}}function pw(e){var t=!!e.before,n=e.values||[];return new ms(n,t)}function LC(e){return RC[e]}function MC(e){return DC[e]}function Ai(e){return{fieldPath:e.canonicalString()}}function Pi(e){return Qe.fromServerFormat(e.fieldPath)}function FC(e){return Ce.create(Pi(e.fieldFilter.field),(function(t){switch(t){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 K()}})(e.fieldFilter.op),e.fieldFilter.value)}function UC(e){switch(e.unaryFilter.op){case"IS_NAN":var t=Pi(e.unaryFilter.field);return Ce.create(t,"==",{doubleValue:NaN});case"IS_NULL":var n=Pi(e.unaryFilter.field);return Ce.create(n,"==",{nullValue:"NULL_VALUE"});
27case"IS_NOT_NAN":var i=Pi(e.unaryFilter.field);return Ce.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var o=Pi(e.unaryFilter.field);return Ce.create(o,"!=",{nullValue:"NULL_VALUE"});default:return K()}}function jC(e){var t=[];return e.fields.forEach((function(n){return t.push(n.canonicalString())})),{fieldPaths:t}}function J0(e){return e.length>=4&&e.get(0)==="projects"&&e.get(2)==="databases"}function Xe(e){for(var t="",n=0;n<e.length;n++)t.length>0&&(t=dw(t)),t=VC(e.get(n),t);return dw(t)}function VC(e,t){for(var n=t,i=e.length,o=0;o<i;o++){var u=e.charAt(o);switch(u){case"\0":n+="��";break;case"�":n+="��";break;default:n+=u}}return n}function dw(e){return e+"��"}function bn(e){var t=e.length;if(W(t>=2),t===2)return W(e.charAt(0)==="�"&&e.charAt(1)==="�"),st.emptyPath();for(var n=t-2,i=[],o="",u=0;u<t;){var c=e.indexOf("�",u);switch((c<0||c>n)&&K(),e.charAt(c+1)){case"�":var l=e.substring(u,c),f=void 0;o.length===0?f=l:(f=o+=l,o=""),i.push(f);break;case"�":o+=e.substring(u,c),o+="\0";break;case"�":o+=e.substring(u,c+1);break;default:K()}u=c+2}return new st(i)}var qC=function(e,t){this.seconds=e,this.nanoseconds=t},Se=function(e,t,n){this.ownerId=e,this.allowTabSynchronization=t,this.leaseTimestampMs=n};Se.store="owner",Se.key="owner";var zn=function(e,t,n){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=n};zn.store="mutationQueues",zn.keyPath="userId";var pt=function(e,t,n,i,o){this.userId=e,this.batchId=t,this.localWriteTimeMs=n,this.baseMutations=i,this.mutations=o};pt.store="mutations",pt.keyPath="batchId",pt.userMutationsIndex="userMutationsIndex",pt.userMutationsKeyPath=["userId","batchId"];var $t=(function(){function e(){}return e.prefixForUser=function(t){return[t]},e.prefixForPath=function(t,n){return[t,Xe(n)]},e.key=function(t,n,i){return[t,Xe(n),i]},e})();$t.store="documentMutations",$t.PLACEHOLDER=new $t;var BC=function(e,t){this.path=e,this.readTime=t},KC=function(e,t){this.path=e,this.version=t},_t=(function(e,t,n,i,o,u){this.unknownDocument=e,this.noDocument=t,this.document=n,this.hasCommittedMutations=i,this.readTime=o,this.parentPath=u});_t.store="remoteDocuments",_t.readTimeIndex="readTimeIndex",_t.readTimeIndexPath="readTime",_t.collectionReadTimeIndex="collectionReadTimeIndex",_t.collectionReadTimeIndexPath=["parentPath","readTime"];var un=(function(e){this.byteSize=e});un.store="remoteDocumentGlobal",un.key="remoteDocumentGlobalKey";var ge=function(e,t,n,i,o,u,c){this.targetId=e,this.canonicalId=t,this.readTime=n,this.resumeToken=i,this.lastListenSequenceNumber=o,this.lastLimboFreeSnapshotVersion=u,this.query=c};ge.store="targets",ge.keyPath="targetId",ge.queryTargetsIndexName="queryTargetsIndex",ge.queryTargetsKeyPath=["canonicalId","targetId"];var Bt=function(e,t,n){this.targetId=e,this.path=t,this.sequenceNumber=n};Bt.store="targetDocuments",Bt.keyPath=["targetId","path"],Bt.documentTargetsIndex="documentTargetsIndex",Bt.documentTargetsKeyPath=["path","targetId"];var Ae=function(e,t,n,i){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=n,this.targetCount=i};Ae.key="targetGlobalKey",Ae.store="targetGlobal";var Or=function(e,t){this.collectionId=e,this.parent=t};Or.store="collectionParents",Or.keyPath=["collectionId","parent"];var Tn=function(e,t,n,i){this.clientId=e,this.updateTimeMs=t,this.networkEnabled=n,this.inForeground=i};Tn.store="clientMetadata",Tn.keyPath="clientId";var Gi=function(e,t,n){this.bundleId=e,this.createTime=t,this.version=n};Gi.store="bundles",Gi.keyPath="bundleId";var zi=function(e,t,n){this.name=e,this.readTime=t,this.bundledQuery=n};zi.store="namedQueries",zi.keyPath="name";var HC=dt(dt([],dt(dt([],dt(dt([],dt(dt([],[zn.store,pt.store,$t.store,_t.store,ge.store,Se.store,Ae.store,Bt.store]),[Tn.store])),[un.store])),[Or.store])),[Gi.store,zi.store]),Z0="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",tI=(function(){function e(){this.onCommittedListeners=[]}return e.prototype.addOnCommittedListener=function(t){this.onCommittedListeners.push(t)},e.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEac
27h((function(t){return t()}))},e})(),we=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},L=(function(){function e(t){var n=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((function(i){n.isDone=!0,n.result=i,n.nextCallback&&n.nextCallback(i)}),(function(i){n.isDone=!0,n.error=i,n.catchCallback&&n.catchCallback(i)}))}return e.prototype.catch=function(t){return this.next(void 0,t)},e.prototype.next=function(t,n){var i=this;return this.callbackAttached&&K(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(t,this.result):new e((function(o,u){i.nextCallback=function(c){i.wrapSuccess(t,c).next(o,u)},i.catchCallback=function(c){i.wrapFailure(n,c).next(o,u)}}))},e.prototype.toPromise=function(){var t=this;return new Promise((function(n,i){t.next(n,i)}))},e.prototype.wrapUserFunction=function(t){try{var n=t();return n instanceof e?n:e.resolve(n)}catch(i){return e.reject(i)}},e.prototype.wrapSuccess=function(t,n){return t?this.wrapUserFunction((function(){return t(n)})):e.resolve(n)},e.prototype.wrapFailure=function(t,n){return t?this.wrapUserFunction((function(){return t(n)})):e.reject(n)},e.resolve=function(t){return new e((function(n,i){n(t)}))},e.reject=function(t){return new e((function(n,i){i(t)}))},e.waitFor=function(t){return new e((function(n,i){var o=0,u=0,c=!1;t.forEach((function(l){++o,l.next((function(){++u,c&&u===o&&n()}),(function(f){return i(f)}))})),c=!0,u===o&&n()}))},e.or=function(t){for(var n=e.resolve(!1),i=function(c){n=n.next((function(l){return l?e.resolve(l):c()}))},o=0,u=t;o<u.length;o++)i(u[o]);return n},e.forEach=function(t,n){var i=this,o=[];return t.forEach((function(u,c){o.push(n.call(i,u,c))})),this.waitFor(o)},e})(),eI=(function(){function e(t,n){var i=this;this.action=t,this.transaction=n,this.aborted=!1,this.ft=new we,this.transaction.oncomplete=function(){i.ft.resolve()},this.transaction.onabort=function(){n.error?i.ft.reject(new ss(t,n.error)):i.ft.resolve()},this.transaction.onerror=function(o){var u=Xp(o.target.error);i.ft.reject(new ss(t,u))}}return e.open=function(t,n,i,o){try{return new e(n,t.transaction(o,i))}catch(u){throw new ss(n,u)}},Object.defineProperty(e.prototype,"dt",{get:function(){return this.ft.promise},enumerable:!1,configurable:!0}),e.prototype.abort=function(t){t&&this.ft.reject(t),this.aborted||(M("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},e.prototype.store=function(t){var n=this.transaction.objectStore(t);return new zC(n)},e})(),$i=(function(){function e(t,n,i){this.name=t,this.version=n,this.wt=i,e._t(Mr())===12.2&&Rt("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.")}return e.delete=function(t){return M("SimpleDb","Removing database:",t),Ar(window.indexedDB.deleteDatabase(t)).toPromise()},e.yt=function(){if(typeof indexedDB>"u")return!1;if(e.gt())return!0;var t=Mr(),n=e._t(t),i=0<n&&n<10,o=e.Et(t),u=0<o&&o<4.5;return!(t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||i||u)},e.gt=function(){var t;return typeof process<"u"&&((t=rC)===null||t===void 0?void 0:t.Tt)==="YES"},e.It=function(t,n){return t.store(n)},e._t=function(t){var n=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),i=n?n[1].split("_").slice(0,2).join("."):"-1";return Number(i)},e.Et=function(t){var n=t.match(/Android ([\d.]+)/i),i=n?n[1].split(".").slice(0,2).join("."):"-1";return Number(i)},e.prototype.At=function(t){return A(this,void 0,void 0,(function(){var n,i=this;return S(this,(function(o){switch(o.label){case 0:return this.db?[3,2]:(M("SimpleDb","Opening database:",this.name),n=this,[4,new Promise((function(u,c){var l=indexedDB.open(i.name,i.version);l.onsuccess=function(f){var d=f.target.result;u(d)},l.onblocked=function(){c(new ss(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},l.onerror=function(f){var d=f.target.error;d.name==="VersionError"?c(new P(k.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.")):c(new ss(t,d))},l.onupgradeneeded=function(f){M("SimpleDb",'Database "'+i.name+'" requires upgrade from version:',f.oldVersion);var d=f.target.result;i.wt.Rt(d,l.transaction,f.oldVersion,i.version).next((function(){M("SimpleDb","Database upgrade to version "+i.version+" complete")}
27))}}))]);case 1:n.db=o.sent(),o.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(u){return i.bt(u)}),this.db)]}}))}))},e.prototype.vt=function(t){this.bt=t,this.db&&(this.db.onversionchange=function(n){return t(n)})},e.prototype.runTransaction=function(t,n,i,o){return A(this,void 0,void 0,(function(){var u,c,l,f,d;return S(this,(function(g){switch(g.label){case 0:u=n==="readonly",c=0,l=function(){var y,w,I,T,E;return S(this,(function(N){switch(N.label){case 0:++c,N.label=1;case 1:return N.trys.push([1,4,,5]),[4,f.At(t)];case 2:return f.db=N.sent(),y=eI.open(f.db,t,u?"readonly":"readwrite",i),w=o(y).catch((function(D){return y.abort(D),L.reject(D)})).toPromise(),I={},w.catch((function(){})),[4,y.dt];case 3:return[2,(I.value=(N.sent(),w),I)];case 4:return T=N.sent(),E=T.name!=="FirebaseError"&&c<3,M("SimpleDb","Transaction failed with error:",T.message,"Retrying:",E),f.close(),E?[3,5]:[2,{value:Promise.reject(T)}];case 5:return[2]}}))},f=this,g.label=1;case 1:return[5,l()];case 2:if(typeof(d=g.sent())=="object")return[2,d.value];g.label=3;case 3:return[3,1];case 4:return[2]}}
27))}))},e.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},e})(),GC=(function(){function e(t){this.Pt=t,this.Vt=!1,this.St=null}return Object.defineProperty(e.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursor",{set:function(t){this.Pt=t},enumerable:!1,configurable:!0}),e.prototype.done=function(){this.Vt=!0},e.prototype.Ct=function(t){this.St=t},e.prototype.delete=function(){return Ar(this.Pt.delete())},e})(),ss=(function(e){function t(n,i){var o=this;return(o=e.call(this,k.UNAVAILABLE,"IndexedDB transaction '"+n+"' failed: "+i)||this).name="IndexedDbTransactionError",o}return $(t,e),t})(P);function Wr(e){return e.name==="IndexedDbTransactionError"}var zC=(function(){function e(t){this.store=t}return e.prototype.put=function(t,n){var i;return n!==void 0?(M("SimpleDb","PUT",this.store.name,t,n),i=this.store.put(n,t)):(M("SimpleDb","PUT",this.store.name,"<auto-key>",t),i=this.store.put(t)),Ar(i)},e.prototype.add=function(t){return M("SimpleDb","ADD",this.store.name,t,t),Ar(this.store.add(t))},e.prototype.get=function(t){var n=this;return Ar(this.store.get(t)).next((function(i){return i===void 0&&(i=null),M("SimpleDb","GET",n.store.name,t,i),i}))},e.prototype.delete=function(t){return M("SimpleDb","DELETE",this.store.name,t),Ar(this.store.delete(t))},e.prototype.count=function(){return M("SimpleDb","COUNT",this.store.name),Ar(this.store.count())},e.prototype.Nt=function(t,n){var i=this.cursor(this.options(t,n)),o=[];return this.xt(i,(function(u,c){o.push(c)})).next((function(){return o}))},e.prototype.kt=function(t,n){M("SimpleDb","DELETE ALL",this.store.name);var i=this.options(t,n);i.Ft=!1;var o=this.cursor(i);return this.xt(o,(function(u,c,l){return l.delete()}))},e.prototype.$t=function(t,n){var i;n?i=t:(i={},n=t);var o=this.cursor(i);return this.xt(o,n)},e.prototype.Ot=function(t){var n=this.cursor({});return new L((function(i,o){n.onerror=function(u){var c=Xp(u.target.error);o(c)},n.onsuccess=function(u){var c=u.target.result;c?t(c.primaryKey,c.value).next((function(l){l?c.continue():i()})):i()}}))},e.prototype.xt=function(t,n){var i=[];return new L((function(o,u){t.onerror=function(c){u(c.target.error)},t.onsuccess=function(c){var l=c.target.result;if(l){var f=new GC(l),d=n(l.primaryKey,l.value,f);if(d instanceof L){var g=d.catch((function(y){return f.done(),L.reject(y)}));i.push(g)}f.isDone?o():f.Dt===null?l.continue():l.continue(f.Dt)}else o()}})).next((function(){return L.waitFor(i)}))},e.prototype.options=function(t,n){var i;return t!==void 0&&(typeof t=="string"?i=t:n=t),{index:i,range:n}},e.prototype.cursor=function(t){var n="next";if(t.reverse&&(n="prev"),t.index){var i=this.store.index(t.index);return t.Ft?i.openKeyCursor(t.range,n):i.openCursor(t.range,n)}return this.store.openCursor(t.range,n)},e})();function Ar(e){return new L((function(t,n){e.onsuccess=function(i){var o=i.target.result;t(o)},e.onerror=function(i){var o=Xp(i.target.error);n(o)}}))}var vw=!1;function Xp(e){var t=$i._t(Mr());if(t>=12.2&&t<13){var n="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(n)>=0){var i=new P("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return vw||(vw=!0,setTimeout((function(){throw i}),0)),i}}return e}var gw=(function(e){function t(n,i){var o=this;return(o=e.call(this)||this).Mt=n,o.currentSequenceNumber=i,o}return $(t,e),t})(tI);function be(e,t){var n=U(e);return $i.It(n.Mt,t)}var Qp=(function(){function e(t,n,i,o){this.batchId=t,this.localWriteTime=n,this.baseMutations=i,this.mutations=o}return e.prototype.applyToRemoteDocument=function(t,n){for(var i=n.mutationResults,o=0;o<this.mutations.length;o++){var u=this.mutations[o];u.key.isEqual(t.key)&&bC(u,t,i[o])}},e.prototype.applyToLocalView=function(t){for(var n=0,i=this.baseMutations;n<i.length;n++)(c=i[n]).key.isEqual(t.key)&&Jf(c,t,this.localWriteTime);for(var o=0,u=this.mutations;o<u.length;o++){var c;(c=u[o]).key.isEqual(t.key)&&Jf(c,t,this.localWriteTime)}},e.prototype.applyToLocalDocumentSet=function(t){var n=this;this.mutations.forEach((function(i){var o=t.get(i.key),u=o;n.applyToLocalView(u),o.isValidDocument()||u.convertToNoDocument(Z.min())}))},e.prototype.keys=function(){return this.mutations.reduce((function(t,n){return t.add(n.key)}),ft())},e.prototype.isEqual=function(t){return this.batchId===t.batchId&&Ui(this.mutations,t.mutations,(function(n,i){return nw(n,i)}))&&Ui(this.baseMutations,t.baseMutations,(function(n,i){return nw(n,i)}))},e})(),$C=(function(){function e(t,n,i,o){this.batch=t,this.commitVersion=n,this.mutationResults=i,this.docVersions=o}return e.from=function(t,n,i){W(t.mutations.length===i.length);for(var o=AC(),u=t.mutations,c=0;c<u.length;c++)o=o.insert(u[c].key,i[c].version);return new e(t,n,i,o)},e})(),pc=(function(){function e(t,n,i,o,u,c,l){u===void 0&&(u=Z.min()),c===void 0&&(c=Z.min()),l===void 0&&(l=ye.EMPTY_BYTE_STRING),this.target=t,this.targetId=n,this.purpose=i,this.sequenceNumber=o,this.snapshotVersion=u,this.lastLimboFreeSnapshotVersion=c,this.resumeToken=l}return e.prototype.withSequenceNumber=function(t){return new e(this.target,this.targetId,this.purpose,t,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken)},e.prototype.withResumeToken=function(t,n){return new e(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,t)},e.prototype.withLastLimboFreeSnapshotVersion=function(t){return new e(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,t,this.resumeToken)},e})(),nI=function(e){this.Lt=e};function ep(e,t){if(t.document)return xC(e.Lt,t.document,!!t.hasCommittedMutations);if(t.noDocument){var n=G.fromSegments(t.noDocument.path),i=Xi(t.noD
27ocument.readTime),o=Jt.newNoDocument(n,i);return t.hasCommittedMutations?o.setHasCommittedMutations():o}if(t.unknownDocument){var u=G.fromSegments(t.unknownDocument.path);return i=Xi(t.unknownDocument.version),Jt.newUnknownDocument(u,i)}return K()}function mw(e,t,n){var i=Yp(n),o=t.key.path.popLast().toArray();if(t.isFoundDocument()){var u=(function(y,w){return{name:ws(y,w.key),fields:w.data.value.mapValue.fields,updateTime:ys(y,w.version.toTimestamp())}})(e.Lt,t),c=t.hasCommittedMutations;return new _t(null,null,u,c,i,o)}if(t.isNoDocument()){var l=t.key.path.toArray(),f=Wi(t.version);return c=t.hasCommittedMutations,new _t(null,new BC(l,f),null,c,i,o)}if(t.isUnknownDocument()){var d=t.key.path.toArray(),g=Wi(t.version);return new _t(new KC(d,g),null,null,!0,i,o)}return K()}function Yp(e){var t=e.toTimestamp();return[t.seconds,t.nanoseconds]}function rI(e){var t=new me(e[0],e[1]);return Z.fromTimestamp(t)}function Wi(e){var t=e.toTimestamp();return new qC(t.seconds,t.nanoseconds)}function Xi(e){var t=new me(e.seconds,e.nanoseconds);return Z.fromTimestamp(t)}function Ri(e,t){for(var n=(t.baseMutations||[]).map((function(f){return lw(e.Lt,f)})),i=0;i<t.mutations.length-1;++i){var o=t.mutations[i];if(i+1<t.mutations.length&&t.mutations[i+1].transform!==void 0){var u=t.mutations[i+1];o.updateTransforms=u.transform.fieldTransforms,t.mutations.splice(i+1,1),++i}}var c=t.mutations.map((function(f){return lw(e.Lt,f)})),l=me.fromMillis(t.localWriteTimeMs);return new Qp(t.batchId,l,n,c)}function es(e){var t,n,i=Xi(e.readTime),o=e.lastLimboFreeSnapshotVersion!==void 0?Xi(e.lastLimboFreeSnapshotVersion):Z.min();return e.query.documents!==void 0?(W((n=e.query).documents.length===1),t=ln(Us(z0(n.documents[0])))):t=(function(u){return ln(Q0(u))})(e.query),new pc(t,e.targetId,0,e.lastListenSequenceNumber,i,o,ye.fromBase64String(e.resumeToken))}function iI(e,t){var n,i=Wi(t.snapshotVersion),o=Wi(t.lastLimboFreeSnapshotVersion);n=Oa(t.target)?W0(e.Lt,t.target):X0(e.Lt,t.target);var u=t.resumeToken.toBase64();return new ge(t.targetId,Fs(t.target),i,u,t.sequenceNumber,o,n)}function oI(e){var t=Q0({parent:e.parent,structuredQuery:e.structuredQuery});return e.limitType==="LAST"?C0(t,t.limit,"L"):t}var WC=(function(){function e(){}return e.prototype.getBundleMetadata=function(t,n){return yw(t).get(n).next((function(i){if(i)return{id:(o=i).bundleId,createTime:Xi(o.createTime),version:o.version};var o}))},e.prototype.saveBundleMetadata=function(t,n){return yw(t).put({bundleId:(i=n).id,createTime:Wi(he(i.createTime)),version:i.version});var i},e.prototype.getNamedQuery=function(t,n){return ww(t).get(n).next((function(i){if(i)return{name:(o=i).name,query:oI(o.bundledQuery),readTime:Xi(o.readTime)};var o}))},e.prototype.saveNamedQuery=function(t,n){return ww(t).put((function(i){return{name:i.name,readTime:Wi(he(i.readTime)),bundledQuery:i.bundledQuery}})(n))},e})();function yw(e){return be(e,Gi.store)}function ww(e){return be(e,zi.store)}var XC=(function(){function e(){this.Bt=new Jp}return e.prototype.addToCollectionParentIndex=function(t,n){return this.Bt.add(n),L.resolve()},e.prototype.getCollectionParents=function(t,n){return L.resolve(this.Bt.getEntries(n))},e})(),Jp=(function(){function e(){this.index={}}return e.prototype.add=function(t){var n=t.lastSegment(),i=t.popLast(),o=this.index[n]||new Mt(st.comparator),u=!o.has(i);return this.index[n]=o.add(i),u},e.prototype.has=function(t){var n=t.lastSegment(),i=t.popLast(),o=this.index[n];return o&&o.has(i)},e.prototype.getEntries=function(t){return(this.index[t]||new Mt(st.comparator)).toArray()},e})(),QC=(function(){function e(){this.qt=new Jp}return e.prototype.addToCollectionParentIndex=function(t,n){var i=this;if(!this.qt.has(n)){var o=n.lastSegment(),u=n.popLast();t.addOnCommittedListener((function(){i.qt.add(n)}));var c={collectionId:o,parent:Xe(u)};return bw(t).put(c)}return L.resolve()},e.prototype.getCollectionParents=function(t,n){var i=[],o=IDBKeyRange.bound([n,""],[I0(n),""],!1,!0);return bw(t).Nt(o).next((function(u){for(var c=0,l=u;c<l.length;c++){var f=l[c];if(f.collectionId!==n)break;i.push(bn(f.parent))}return i}))},e})();function bw(e){return be(e,Or.store)}var Iw={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},sn=(function(){function e(t,n,i){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=i}return e.withCacheSize=function(t){return new e(t,e.DEFAULT_COLLECTION_PE
27RCENTILE,e.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)},e})();function sI(e,t,n){var i=e.store(pt.store),o=e.store($t.store),u=[],c=IDBKeyRange.only(n.batchId),l=0,f=i.$t({range:c},(function(T,E,N){return l++,N.delete()}));u.push(f.next((function(){W(l===1)})));for(var d=[],g=0,y=n.mutations;g<y.length;g++){var w=y[g],I=$t.key(t,w.key.path,n.batchId);u.push(o.delete(I)),d.push(w.key)}return L.waitFor(u).next((function(){return d}))}function Ma(e){if(!e)return 0;var t;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw K();t=e.noDocument}return JSON.stringify(t).length}sn.DEFAULT_COLLECTION_PERCENTILE=10,sn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,sn.DEFAULT=new sn(41943040,sn.DEFAULT_COLLECTION_PERCENTILE,sn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),sn.DISABLED=new sn(-1,0,0);var YC=(function(){function e(t,n,i,o){this.userId=t,this.R=n,this.Ut=i,this.referenceDelegate=o,this.Kt={}}return e.Qt=function(t,n,i,o){return W(t.uid!==""),new e(t.isAuthenticated()?t.uid:"",n,i,o)},e.prototype.checkEmpty=function(t){var n=!0,i=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Un(t).$t({index:pt.userMutationsIndex,range:i},(function(o,u,c){n=!1,c.done()})).next((function(){return n}))},e.prototype.addMutationBatch=function(t,n,i,o){var u=this,c=Di(t),l=Un(t);return l.add({}).next((function(f){W(typeof f=="number");for(var d=new Qp(f,n,i,o),g=(function(D,F,C){var B=C.baseMutations.map((function(Y){return La(D.Lt,Y)})),x=C.mutations.map((function(Y){return La(D.Lt,Y)}));return new pt(F,C.batchId,C.localWriteTime.toMillis(),B,x)})(u.R,u.userId,d),y=[],w=new Mt((function(D,F){return rt(D.canonicalString(),F.canonicalString())})),I=0,T=o;I<T.length;I++){var E=T[I],N=$t.key(u.userId,E.key.path,f);w=w.add(E.key.path.popLast()),y.push(l.put(g)),y.push(c.put(N,$t.PLACEHOLDER))}return w.forEach((function(D){y.push(u.Ut.addToCollectionParentIndex(t,D))})),t.addOnCommittedListener((function(){u.Kt[f]=d.keys()})),L.waitFor(y).next((function(){return d}))}))},e.prototype.lookupMutationBatch=function(t,n){var i=this;return Un(t).get(n).next((function(o){return o?(W(o.userId===i.userId),Ri(i.R,o)):null}))},e.prototype.jt=function(t,n){var i=this;return this.Kt[n]?L.resolve(this.Kt[n]):this.lookupMutationBatch(t,n).next((function(o){if(o){var u=o.keys();return i.Kt[n]=u,u}return null}))},e.prototype.getNextMutationBatchAfterBatchId=function(t,n){var i=this,o=n+1,u=IDBKeyRange.lowerBound([this.userId,o]),c=null;return Un(t).$t({index:pt.userMutationsIndex,range:u},(function(l,f,d){f.userId===i.userId&&(W(f.batchId>=o),c=Ri(i.R,f)),d.done()})).next((function(){return c}))},e.prototype.getHighestUnacknowledgedBatchId=function(t){var n=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),i=-1;return Un(t).$t({index:pt.userMutationsIndex,range:n,reverse:!0},(function(o,u,c){i=u.batchId,c.done()})).next((function(){return i}))},e.prototype.getAllMutationBatches=function(t){var n=this,i=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Un(t).Nt(pt.userMutationsIndex,i).next((function(o){return o.map((function(u){return Ri(n.R,u)}))}))},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,n){var i=this,o=$t.prefixForPath(this.userId,n.path),u=IDBKeyRange.lowerBound(o),c=[];return Di(t).$t({range:u},(function(l,f,d){var g=l[0],y=l[1],w=l[2],I=bn(y);if(g===i.userId&&n.path.isEqual(I))return Un(t).get(w).next((function(T){if(!T)throw K();W(T.userId===i.userId),c.push(Ri(i.R,T))}));d.done()})).next((function(){return c}))},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,n){var i=this,o=new Mt(rt),u=[];return n.forEach((function(c){var l=$t.prefixForPath(i.userId,c.path),f=IDBKeyRange.lowerBound(l),d=Di(t).$t({range:f},(function(g,y,w){var I=g[0],T=g[1],E=g[2],N=bn(T);I===i.userId&&c.path.isEqual(N)?o=o.add(E):w.done()}));u.push(d)})),L.waitFor(u).next((function(){return i.Wt(t,o)}))},e.prototype.getAllMutationBatchesAffectingQuery=function(t,n){var i=this,o=n.path,u=o.length+1,c=$t.prefixForPath(this.userId,o),l=IDBKeyRange.lowerBound(c),f=new Mt(rt);return Di(t).$t({range:l},(function(d,g,y){var w=d[0],I=d[1],T=d[2],E=bn(I);w===i.userId&&o.isPrefixOf(E)?E.length===u&&(f=f.add(T)):y.done()})).next((function(){return i.Wt(t,f)}))},e.prototype.Wt=function(t,n){var i=this,o=[],u=[];
27return n.forEach((function(c){u.push(Un(t).get(c).next((function(l){if(l===null)throw K();W(l.userId===i.userId),o.push(Ri(i.R,l))})))})),L.waitFor(u).next((function(){return o}))},e.prototype.removeMutationBatch=function(t,n){var i=this;return sI(t.Mt,this.userId,n).next((function(o){return t.addOnCommittedListener((function(){i.Gt(n.batchId)})),L.forEach(o,(function(u){return i.referenceDelegate.markPotentiallyOrphaned(t,u)}))}))},e.prototype.Gt=function(t){delete this.Kt[t]},e.prototype.performConsistencyCheck=function(t){var n=this;return this.checkEmpty(t).next((function(i){if(!i)return L.resolve();var o=IDBKeyRange.lowerBound($t.prefixForUser(n.userId)),u=[];return Di(t).$t({range:o},(function(c,l,f){if(c[0]===n.userId){var d=bn(c[1]);u.push(d)}else f.done()})).next((function(){W(u.length===0)}))}))},e.prototype.containsKey=function(t,n){return uI(t,this.userId,n)},e.prototype.zt=function(t){var n=this;return aI(t).get(this.userId).next((function(i){return i||new zn(n.userId,-1,"")}))},e})();function uI(e,t,n){var i=$t.prefixForPath(t,n.path),o=i[1],u=IDBKeyRange.lowerBound(i),c=!1;return Di(e).$t({range:u,Ft:!0},(function(l,f,d){var g=l[0],y=l[1];l[2],g===t&&y===o&&(c=!0),d.done()})).next((function(){return c}))}function Un(e){return be(e,pt.store)}function Di(e){return be(e,$t.store)}function aI(e){return be(e,zn.store)}var Fa=(function(){function e(t){this.Ht=t}return e.prototype.next=function(){return this.Ht+=2,this.Ht},e.Jt=function(){return new e(0)},e.Yt=function(){return new e(-1)},e})(),JC=(function(){function e(t,n){this.referenceDelegate=t,this.R=n}return e.prototype.allocateTargetId=function(t){var n=this;return this.Xt(t).next((function(i){var o=new Fa(i.highestTargetId);return i.highestTargetId=o.next(),n.Zt(t,i).next((function(){return i.highestTargetId}))}))},e.prototype.getLastRemoteSnapshotVersion=function(t){return this.Xt(t).next((function(n){return Z.fromTimestamp(new me(n.lastRemoteSnapshotVersion.seconds,n.lastRemoteSnapshotVersion.nanoseconds))}))},e.prototype.getHighestSequenceNumber=function(t){return this.Xt(t).next((function(n){return n.highestListenSequenceNumber}))},e.prototype.setTargetsMetadata=function(t,n,i){var o=this;return this.Xt(t).next((function(u){return u.highestListenSequenceNumber=n,i&&(u.lastRemoteSnapshotVersion=i.toTimestamp()),n>u.highestListenSequenceNumber&&(u.highestListenSequenceNumber=n),o.Zt(t,u)}))},e.prototype.addTargetData=function(t,n){var i=this;return this.te(t,n).next((function(){return i.Xt(t).next((function(o){return o.targetCount+=1,i.ee(n,o),i.Zt(t,o)}))}))},e.prototype.updateTargetData=function(t,n){return this.te(t,n)},e.prototype.removeTargetData=function(t,n){var i=this;return this.removeMatchingKeysForTargetId(t,n.targetId).next((function(){return ki(t).delete(n.targetId)})).next((function(){return i.Xt(t)})).next((function(o){return W(o.targetCount>0),o.targetCount-=1,i.Zt(t,o)}))},e.prototype.removeTargets=function(t,n,i){var o=this,u=0,c=[];return ki(t).$t((function(l,f){var d=es(f);d.sequenceNumber<=n&&i.get(d.targetId)===null&&(u++,c.push(o.removeTargetData(t,d)))})).next((function(){return L.waitFor(c)})).next((function(){return u}))},e.prototype.forEachTarget=function(t,n){return ki(t).$t((function(i,o){var u=es(o);n(u)}))},e.prototype.Xt=function(t){return Tw(t).get(Ae.key).next((function(n){return W(n!==null),n}))},e.prototype.Zt=function(t,n){return Tw(t).put(Ae.key,n)},e.prototype.te=function(t,n){return ki(t).put(iI(this.R,n))},e.prototype.ee=function(t,n){var i=!1;return t.targetId>n.highestTargetId&&(n.highestTargetId=t.targetId,i=!0),t.sequenceNumber>n.highestListenSequenceNumber&&(n.highestListenSequenceNumber=t.sequenceNumber,i=!0),i},e.prototype.getTargetCount=function(t){return this.Xt(t).next((function(n){return n.targetCount}))},e.prototype.getTargetData=function(t,n){var i=Fs(n),o=IDBKeyRange.bound([i,Number.NEGATIVE_INFINITY],[i,Number.POSITIVE_INFINITY]),u=null;return ki(t).$t({range:o,index:ge.queryTargetsIndexName},(function(c,l,f){var d=es(l);cc(n,d.target)&&(u=d,f.done())})).next((function(){return u}))},e.prototype.addMatchingKeys=function(t,n,i){var o=this,u=[],c=Kn(t);
27return n.forEach((function(l){var f=Xe(l.path);u.push(c.put(new Bt(i,f))),u.push(o.referenceDelegate.addReference(t,i,l))})),L.waitFor(u)},e.prototype.removeMatchingKeys=function(t,n,i){var o=this,u=Kn(t);return L.forEach(n,(function(c){var l=Xe(c.path);return L.waitFor([u.delete([i,l]),o.referenceDelegate.removeReference(t,i,c)])}))},e.prototype.removeMatchingKeysForTargetId=function(t,n){var i=Kn(t),o=IDBKeyRange.bound([n],[n+1],!1,!0);return i.delete(o)},e.prototype.getMatchingKeysForTargetId=function(t,n){var i=IDBKeyRange.bound([n],[n+1],!1,!0),o=Kn(t),u=ft();return o.$t({range:i,Ft:!0},(function(c,l,f){var d=bn(c[1]),g=new G(d);u=u.add(g)})).next((function(){return u}))},e.prototype.containsKey=function(t,n){var i=Xe(n.path),o=IDBKeyRange.bound([i],[I0(i)],!1,!0),u=0;return Kn(t).$t({index:Bt.documentTargetsIndex,Ft:!0,range:o},(function(c,l,f){var d=c[0];c[1],d!==0&&(u++,f.done())})).next((function(){return u>0}))},e.prototype.lt=function(t,n){return ki(t).get(n).next((function(i){return i?es(i):null}))},e})();function ki(e){return be(e,ge.store)}function Tw(e){return be(e,Ae.store)}function Kn(e){return be(e,Bt.store)}function Xr(e){return A(this,void 0,void 0,(function(){return S(this,(function(t){if(e.code!==k.FAILED_PRECONDITION||e.message!==Z0)throw e;return M("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}function _w(e,t){var n=e[0],i=e[1],o=t[0],u=t[1],c=rt(n,o);return c===0?rt(i,u):c}var ZC=(function(){function e(t){this.ne=t,this.buffer=new Mt(_w),this.se=0}return e.prototype.ie=function(){return++this.se},e.prototype.re=function(t){var n=[t,this.ie()];if(this.buffer.size<this.ne)this.buffer=this.buffer.add(n);else{var i=this.buffer.last();_w(n,i)<0&&(this.buffer=this.buffer.delete(i).add(n))}},Object.defineProperty(e.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!1,configurable:!0}),e})(),tR=(function(){function e(t,n){this.garbageCollector=t,this.asyncQueue=n,this.oe=!1,this.ce=null}return e.prototype.start=function(t){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.ue(t)},e.prototype.stop=function(){this.ce&&(this.ce.cancel(),this.ce=null)},Object.defineProperty(e.prototype,"started",{get:function(){return this.ce!==null},enumerable:!1,configurable:!0}),e.prototype.ue=function(t){var n=this,i=this.oe?3e5:6e4;M("LruGarbageCollector","Garbage collection scheduled in "+i+"ms"),this.ce=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",i,(function(){return A(n,void 0,void 0,(function(){var o;return S(this,(function(u){switch(u.label){case 0:this.ce=null,this.oe=!0,u.label=1;case 1:return u.trys.push([1,3,,7]),[4,t.collectGarbage(this.garbageCollector)];case 2:return u.sent(),[3,7];case 3:return Wr(o=u.sent())?(M("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",o),[3,6]):[3,4];case 4:return[4,Xr(o)];case 5:u.sent(),u.label=6;case 6:return[3,7];case 7:return[4,this.ue(t)];case 8:return u.sent(),[2]}}))}))}))},e})(),eR=(function(){function e(t,n){this.ae=t,this.params=n}return e.prototype.calculateTargetCount=function(t,n){return this.ae.he(t).next((function(i){return Math.floor(n/100*i)}))},e.prototype.nthSequenceNumber=function(t,n){var i=this;if(n===0)return L.resolve(Ne.o);var o=new ZC(n);return this.ae.forEachTarget(t,(function(u){return o.re(u.sequenceNumber)})).next((function(){return i.ae.le(t,(function(u){return o.re(u)}))})).next((function(){return o.maxValue}))},e.prototype.removeTargets=function(t,n,i){return this.ae.removeTargets(t,n,i)},e.prototype.removeOrphanedDocuments=function(t,n){return this.ae.removeOrphanedDocuments(t,n)},e.prototype.collect=function(t,n){var i=this;return this.params.cacheSizeCollectionThreshold===-1?(M("LruGarbageCollector","Garbage collection skipped; disabled"),L.resolve(Iw)):this.getCacheSize(t).next((function(o){return o<i.params.cacheSizeCollectionThreshold?(M("LruGarbageCollector","Garbage collection skipped; Cache size "+o+" is lower than threshold "+i.params.cacheSizeCollectionThreshold),Iw):i.fe(t,n)}))},e.prototype.getCacheSize=function(t){return this.ae.getCacheSize(t)}
27,e.prototype.fe=function(t,n){var i,o,u,c,l,f,d,g=this,y=Date.now();return this.calculateTargetCount(t,this.params.percentileToCollect).next((function(w){return w>g.params.maximumSequenceNumbersToCollect?(M("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+g.params.maximumSequenceNumbersToCollect+" from "+w),o=g.params.maximumSequenceNumbersToCollect):o=w,c=Date.now(),g.nthSequenceNumber(t,o)})).next((function(w){return i=w,l=Date.now(),g.removeTargets(t,i,n)})).next((function(w){return u=w,f=Date.now(),g.removeOrphanedDocuments(t,i)})).next((function(w){return d=Date.now(),Wf()<=nt.DEBUG&&M("LruGarbageCollector",`LRU Garbage Collection 28 Counted targets in `+(c-y)+`ms 29 Determined least recently used `+o+" in "+(l-c)+`ms 30 Removed `+u+" targets in "+(f-l)+`ms 31 Removed `+w+" documents in "+(d-f)+`ms 32Total Duration: `+(d-y)+"ms"),L.resolve({didRun:!0,sequenceNumbersCollected:o,targetsRemoved:u,documentsRemoved:w})}))},e})(),nR=(function(){function e(t,n){this.db=t,this.garbageCollector=(function(i,o){return new eR(i,o)})(this,n)}return e.prototype.he=function(t){var n=this.de(t);return this.db.getTargetCache().getTargetCount(t).next((function(i){return n.next((function(o){return i+o}))}))},e.prototype.de=function(t){var n=0;return this.le(t,(function(i){n++})).next((function(){return n}))},e.prototype.forEachTarget=function(t,n){return this.db.getTargetCache().forEachTarget(t,n)},e.prototype.le=function(t,n){return this.we(t,(function(i,o){return n(o)}))},e.prototype.addReference=function(t,n,i){return ia(t,i)},e.prototype.removeReference=function(t,n,i){return ia(t,i)},e.prototype.removeTargets=function(t,n,i){return this.db.getTargetCache().removeTargets(t,n,i)},e.prototype.markPotentiallyOrphaned=function(t,n){return ia(t,n)},e.prototype._e=function(t,n){return(function(i,o){var u=!1;return aI(i).Ot((function(c){return uI(i,c,o).next((function(l){return l&&(u=!0),L.resolve(!l)}))})).next((function(){return u}))})(t,n)},e.prototype.removeOrphanedDocuments=function(t,n){var i=this,o=this.db.getRemoteDocumentCache().newChangeBuffer(),u=[],c=0;return this.we(t,(function(l,f){if(f<=n){var d=i._e(t,l).next((function(g){if(!g)return c++,o.getEntry(t,l).next((function(){return o.removeEntry(l),Kn(t).delete([0,Xe(l.path)])}))}));u.push(d)}})).next((function(){return L.waitFor(u)})).next((function(){return o.apply(t)})).next((function(){return c}))},e.prototype.removeTarget=function(t,n){var i=n.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,i)},e.prototype.updateLimboDocument=function(t,n){return ia(t,n)},e.prototype.we=function(t,n){var i,o=Kn(t),u=Ne.o;return o.$t({index:Bt.documentTargetsIndex},(function(c,l){var f=c[0];c[1];var d=l.path,g=l.sequenceNumber;f===0?(u!==Ne.o&&n(new G(bn(i)),u),u=g,i=d):u=Ne.o})).next((function(){u!==Ne.o&&n(new G(bn(i)),u)}))},e.prototype.getCacheSize=function(t){return this.db.getRemoteDocumentCache().getSize(t)},e})();function ia(e,t){return Kn(e).put((function(n,i){return new Bt(0,Xe(n.path),i)})(t,e.currentSequenceNumber))}var io=(function(){function e(t,n){this.mapKeyFn=t,this.equalsFn=n,this.inner={}}return e.prototype.get=function(t){var n=this.mapKeyFn(t),i=this.inner[n];if(i!==void 0)for(var o=0,u=i;o<u.length;o++){var c=u[o],l=c[0],f=c[1];if(this.equalsFn(l,t))return f}},e.prototype.has=function(t){return this.get(t)!==void 0},e.prototype.set=function(t,n){var i=this.mapKeyFn(t),o=this.inner[i];if(o!==void 0){for(var u=0;u<o.length;u++)if(this.equalsFn(o[u][0],t))return void(o[u]=[t,n]);o.push([t,n])}else this.inner[i]=[[t,n]]},e.prototype.delete=function(t){var n=this.mapKeyFn(t),i=this.inner[n];if(i===void 0)return!1;for(var o=0;o<i.length;o++)if(this.equalsFn(i[o][0],t))return i.length===1?delete this.inner[n]:i.splice(o,1),!0;return!1},e.prototype.forEach=function(t){zr(this.inner,(function(n,i){for(var o=0,u=i;o<u.length;o++){var c=u[o],l=c[0],f=c[1];t(l,f)}}))},e.prototype.isEmpty=function(){return T0(this.inner)},e})(),cI=(function(){function e(){this.changes=new io((function(t){return t.toString()}),(function(t,n){return t.isEqual(n)})),this.changesApplied=!1}return e.prototype.getReadTime=function(t){var n=this.changes.get(t);return n?n.readTime:Z.min()},e.prototype.addEntry=function(t,n){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:n})},e.prototype.removeEntry=function(t,n){n===void 0&&(n=null),this.assertNotApplied(),this.changes.set(t,{document:Jt.newInvalidDocument(t),readTime:n})},e.prototype.getEntry=function(t,n){this.assertNotApplied();var i=this.changes.get(n);return i!==void 0?L.resolve(i.document):this.getFromCache(t,n)},e.prototype.getEntries=function(t,n){return this.getAllFromCache(t,n)},e.prototype.apply=function(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)},e.prototype.assertNotApplied=function(){},e})(),rR=(function(){function e(t,n){this.R=t,this.Ut=n}return e.prototype.addEntry=function(t,n,i){return qn(t).put(oa(n),i)},e.prototype.removeEntry=function(t,n){var i=qn(t),o=oa(n);return i.delete(o)},e.prototype.updateMetadata=function(t,n){var i=this;return this.getMetadata(t).next((function(o){return o.byteSize+=n,i.me(t,o)}))},e.prototype.getEntry=function(t,n){var i=this;return qn(t).get(oa(n)).next((function(o){return i.ye(n,o)}))},e.prototype.ge=function(t,n){var i=this;return qn(t).get(oa(n)).next((function(o){return{document:i.ye(n,o),size:Ma(o)}}))},e.prototype.getEntries=function(t,n){var i=this,o=We();return this.pe(t,n,(function(u,c){var l=i.ye(u,c);o=o.insert(u,l)})).next((function(){return o}
32))},e.prototype.Ee=function(t,n){var i=this,o=We(),u=new Zt(G.comparator);return this.pe(t,n,(function(c,l){var f=i.ye(c,l);o=o.insert(c,f),u=u.insert(c,Ma(l))})).next((function(){return{documents:o,Te:u}}))},e.prototype.pe=function(t,n,i){if(n.isEmpty())return L.resolve();var o=IDBKeyRange.bound(n.first().path.toArray(),n.last().path.toArray()),u=n.getIterator(),c=u.getNext();return qn(t).$t({range:o},(function(l,f,d){for(var g=G.fromSegments(l);c&&G.comparator(c,g)<0;)i(c,null),c=u.getNext();c&&c.isEqual(g)&&(i(c,f),c=u.hasNext()?u.getNext():null),c?d.Ct(c.path.toArray()):d.done()})).next((function(){for(;c;)i(c,null),c=u.hasNext()?u.getNext():null}))},e.prototype.getDocumentsMatchingQuery=function(t,n,i){var o=this,u=We(),c=n.path.length+1,l={};if(i.isEqual(Z.min())){var f=n.path.toArray();l.range=IDBKeyRange.lowerBound(f)}else{var d=n.path.toArray(),g=Yp(i);l.range=IDBKeyRange.lowerBound([d,g],!0),l.index=_t.collectionReadTimeIndex}return qn(t).$t(l,(function(y,w,I){if(y.length===c){var T=ep(o.R,w);n.path.isPrefixOf(T.key.path)?Vs(n,T)&&(u=u.insert(T.key,T)):I.done()}})).next((function(){return u}))},e.prototype.newChangeBuffer=function(t){return new iR(this,!!t&&t.trackRemovals)},e.prototype.getSize=function(t){return this.getMetadata(t).next((function(n){return n.byteSize}))},e.prototype.getMetadata=function(t){return Ew(t).get(un.key).next((function(n){return W(!!n),n}))},e.prototype.me=function(t,n){return Ew(t).put(un.key,n)},e.prototype.ye=function(t,n){if(n){var i=ep(this.R,n);if(!i.isNoDocument()||!i.version.isEqual(Z.min()))return i}return Jt.newInvalidDocument(t)},e})(),iR=(function(e){function t(n,i){var o=this;return(o=e.call(this)||this).Ie=n,o.trackRemovals=i,o.Ae=new io((function(u){return u.toString()}),(function(u,c){return u.isEqual(c)})),o}return $(t,e),t.prototype.applyChanges=function(n){var i=this,o=[],u=0,c=new Mt((function(l,f){return rt(l.canonicalString(),f.canonicalString())}));
32return this.changes.forEach((function(l,f){var d=i.Ae.get(l);if(f.document.isValidDocument()){var g=mw(i.Ie.R,f.document,i.getReadTime(l));c=c.add(l.path.popLast());var y=Ma(g);u+=y-d,o.push(i.Ie.addEntry(n,l,g))}else if(u-=d,i.trackRemovals){var w=mw(i.Ie.R,Jt.newNoDocument(l,Z.min()),i.getReadTime(l));o.push(i.Ie.addEntry(n,l,w))}else o.push(i.Ie.removeEntry(n,l))})),c.forEach((function(l){o.push(i.Ie.Ut.addToCollectionParentIndex(n,l))})),o.push(this.Ie.updateMetadata(n,u)),L.waitFor(o)},t.prototype.getFromCache=function(n,i){var o=this;return this.Ie.ge(n,i).next((function(u){return o.Ae.set(i,u.size),u.document}))},t.prototype.getAllFromCache=function(n,i){var o=this;return this.Ie.Ee(n,i).next((function(u){var c=u.documents;return u.Te.forEach((function(l,f){o.Ae.set(l,f)})),c}))},t})(cI);function Ew(e){return be(e,un.store)}function qn(e){return be(e,_t.store)}function oa(e){return e.path.toArray()}var oR=(function(){function e(t){this.R=t}return e.prototype.Rt=function(t,n,i,o){var u=this;W(i<o&&i>=0&&o<=11);var c=new eI("createOrUpgrade",n);i<1&&o>=1&&((function(f){f.createObjectStore(Se.store)})(t),(function(f){f.createObjectStore(zn.store,{keyPath:zn.keyPath}),f.createObjectStore(pt.store,{keyPath:pt.keyPath,autoIncrement:!0}).createIndex(pt.userMutationsIndex,pt.userMutationsKeyPath,{unique:!0}),f.createObjectStore($t.store)})(t),Sw(t),(function(f){f.createObjectStore(_t.store)})(t));var l=L.resolve();return i<3&&o>=3&&(i!==0&&((function(f){f.deleteObjectStore(Bt.store),f.deleteObjectStore(ge.store),f.deleteObjectStore(Ae.store)})(t),Sw(t)),l=l.next((function(){return(function(f){var d=f.store(Ae.store),g=new Ae(0,0,Z.min().toTimestamp(),0);return d.put(Ae.key,g)})(c)}))),i<4&&o>=4&&(i!==0&&(l=l.next((function(){return(function(f,d){return d.store(pt.store).Nt().next((function(g){f.deleteObjectStore(pt.store),f.createObjectStore(pt.store,{keyPath:pt.keyPath,autoIncrement:!0}).createIndex(pt.userMutationsIndex,pt.userMutationsKeyPath,{unique:!0});var y=d.store(pt.store),w=g.map((function(I){return y.put(I)}));return L.waitFor(w)}))})(t,c)}))),l=l.next((function(){(function(f){f.createObjectStore(Tn.store,{keyPath:Tn.keyPath})})(t)}))),i<5&&o>=5&&(l=l.next((function(){return u.Re(c)}))),i<6&&o>=6&&(l=l.next((function(){return(function(f){f.createObjectStore(un.store)})(t),u.be(c)}))),i<7&&o>=7&&(l=l.next((function(){return u.ve(c)}))),i<8&&o>=8&&(l=l.next((function(){return u.Pe(t,c)}))),i<9&&o>=9&&(l=l.next((function(){(function(f){f.objectStoreNames.contains("remoteDocumentChanges")&&f.deleteObjectStore("remoteDocumentChanges")})(t),(function(f){var d=f.objectStore(_t.store);d.createIndex(_t.readTimeIndex,_t.readTimeIndexPath,{unique:!1}),d.createIndex(_t.collectionReadTimeIndex,_t.collectionReadTimeIndexPath,{unique:!1})})(n)}))),i<10&&o>=10&&(l=l.next((function(){return u.Ve(c)}))),i<11&&o>=11&&(l=l.next((function(){(function(f){f.createObjectStore(Gi.store,{keyPath:Gi.keyPath})})(t),(function(f){f.createObjectStore(zi.store,{keyPath:zi.keyPath})})(t)}))),l},e.prototype.be=function(t){var n=0;return t.store(_t.store).$t((function(i,o){n+=Ma(o)})).next((function(){var i=new un(n);return t.store(un.store).put(un.key,i)}))},e.prototype.Re=function(t){var n=this,i=t.store(zn.store),o=t.store(pt.store);return i.Nt().next((function(u){return L.forEach(u,(function(c){var l=IDBKeyRange.bound([c.userId,-1],[c.userId,c.lastAcknowledgedBatchId]);return o.Nt(pt.userMutationsIndex,l).next((function(f){return L.forEach(f,(function(d){W(d.userId===c.userId);var g=Ri(n.R,d);return sI(t,c.userId,g).next((function(){}))}))}))}))}))},e.prototype.ve=function(t){var n=t.store(Bt.store),i=t.store(_t.store);return t.store(Ae.store).get(Ae.key).next((function(o){var u=[];return i.$t((function(c,l){var f=new st(c),d=(function(g){return[0,Xe(g)]})(f);u.push(n.get(d).next((function(g){return g?L.resolve():(function(y){return n.put(new Bt(0,Xe(y),o.highestListenSequenceNumber))})(f)})))})).next((function(){return L.waitFor(u)}))}))},e.prototype.Pe=function(t,n){t.createObjectStore(Or.store,{keyPath:Or.keyPath});var i=n.store(Or.store),o=new Jp,u=function(c){if(o.add(c)){var l=c.lastSegment(),f=c.popLast();return i.put({collectionId:l,parent:Xe(f)})}};return n.store(_t.store).$t({Ft:!0},(function(c,l){var f=new st(c);return u(f.popLast())})).next((function(){return n.store($t.store).$t({Ft:!0},(function(c,l){c[0];var f=c[1];c[2];var d=bn(f);return u(d.popLast())}))}))},e.prototype.Ve=function(t){var n=this,i=t.store(ge.store);return i.$t((function(o,u){var c=es(u),l=iI(n.R,c);return i.put(l)}))},e})();function Sw(e){e.createObjectStore(Bt.store,{keyPath:Bt.keyPath}).createIndex(Bt.documentTargetsIndex,Bt.documentTargetsKeyPath,{unique:!0}),e.createObjectStore(ge.store,{keyPath:ge.keyPath}).createIndex(ge.queryTargetsIndexName,ge.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(Ae.store)}var _f="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.",sR=(function(){function e(t,n,i,o,u,c,l,f,d,g){if(this.allowTabSynchronization=t,this.persistenceKey=n,this.clientId=i,this.Se=u,this.window=c,this.document=l,this.De=d,this.Ce=g,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ke=null,this.inForeground=!1,this.Fe=null,this.$e=null,this.Oe=Number.NEGATIVE_INFINITY,this.Me=function(y){return Promise.resolve()}
32,!e.yt())throw new P(k.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new nR(this,o),this.Le=n+"main",this.R=new nI(f),this.Be=new $i(this.Le,11,new oR(this.R)),this.qe=new JC(this.referenceDelegate,this.R),this.Ut=new QC,this.Ue=(function(y,w){return new rR(y,w)})(this.R,this.Ut),this.Ke=new WC,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,g===!1&&Rt("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return e.prototype.start=function(){var t=this;return this.je().then((function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new P(k.FAILED_PRECONDITION,_f);return t.We(),t.Ge(),t.ze(),t.runTransaction("getHighestListenSequenceNumber","readonly",(function(n){return t.qe.getHighestSequenceNumber(n)}))})).then((function(n){t.Ne=new Ne(n,t.De)})).then((function(){t.xe=!0})).catch((function(n){return t.Be&&t.Be.close(),Promise.reject(n)}))},e.prototype.He=function(t){var n=this;return this.Me=function(i){return A(n,void 0,void 0,(function(){return S(this,(function(o){return this.started?[2,t(i)]:[2]}))}))},t(this.isPrimary)},e.prototype.setDatabaseDeletedListener=function(t){var n=this;this.Be.vt((function(i){return A(n,void 0,void 0,(function(){return S(this,(function(o){switch(o.label){case 0:return i.newVersion===null?[4,t()]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}}
32))}))}))},e.prototype.setNetworkEnabled=function(t){var n=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.Se.enqueueAndForget((function(){return A(n,void 0,void 0,(function(){return S(this,(function(i){switch(i.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))})))},e.prototype.je=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(n){return sa(n).put(new Tn(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next((function(){if(t.isPrimary)return t.Je(n).next((function(i){i||(t.isPrimary=!1,t.Se.enqueueRetryable((function(){return t.Me(!1)})))}))})).next((function(){return t.Ye(n)})).next((function(i){return t.isPrimary&&!i?t.Xe(n).next((function(){return!1})):!!i&&t.Ze(n).next((function(){return!0}))}))})).catch((function(n){if(Wr(n))return M("IndexedDbPersistence","Failed to extend owner lease: ",n),t.isPrimary;if(!t.allowTabSynchronization)throw n;return M("IndexedDbPersistence","Releasing owner lease after error during lease refresh",n),!1})).then((function(n){t.isPrimary!==n&&t.Se.enqueueRetryable((function(){return t.Me(n)})),t.isPrimary=n}))},e.prototype.Je=function(t){var n=this;return Jo(t).get(Se.key).next((function(i){return L.resolve(n.tn(i))}))},e.prototype.en=function(t){return sa(t).delete(this.clientId)},e.prototype.nn=function(){return A(this,void 0,void 0,(function(){var t,n,i,o,u=this;return S(this,(function(c){switch(c.label){case 0:return!this.isPrimary||this.sn(this.Oe,18e5)?[3,2]:(this.Oe=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(l){var f=be(l,Tn.store);return f.Nt().next((function(d){var g=u.rn(d,18e5),y=d.filter((function(w){return g.indexOf(w)===-1}));return L.forEach(y,(function(w){return f.delete(w.clientId)})).next((function(){return y}))}))})).catch((function(){return[]}))]);case 1:if(t=c.sent(),this.Qe)for(n=0,i=t;n<i.length;n++)o=i[n],this.Qe.removeItem(this.on(o.clientId));c.label=2;case 2:return[2]}}
32))}))},e.prototype.ze=function(){var t=this;this.$e=this.Se.enqueueAfterDelay("client_metadata_refresh",4e3,(function(){return t.je().then((function(){return t.nn()})).then((function(){return t.ze()}))}))},e.prototype.tn=function(t){return!!t&&t.ownerId===this.clientId},e.prototype.Ye=function(t){var n=this;return this.Ce?L.resolve(!0):Jo(t).get(Se.key).next((function(i){if(i!==null&&n.sn(i.leaseTimestampMs,5e3)&&!n.cn(i.ownerId)){if(n.tn(i)&&n.networkEnabled)return!0;if(!n.tn(i)){if(!i.allowTabSynchronization)throw new P(k.FAILED_PRECONDITION,_f);return!1}}return!(!n.networkEnabled||!n.inForeground)||sa(t).Nt().next((function(o){return n.rn(o,5e3).find((function(u){if(n.clientId!==u.clientId){var c=!n.networkEnabled&&u.networkEnabled,l=!n.inForeground&&u.inForeground,f=n.networkEnabled===u.networkEnabled;if(c||l&&f)return!0}return!1}))===void 0}))})).next((function(i){return n.isPrimary!==i&&M("IndexedDbPersistence","Client "+(i?"is":"is not")+" eligible for a primary lease."),i}))},e.prototype.shutdown=function(){return A(this,void 0,void 0,(function(){var t=this;return S(this,(function(n){switch(n.label){case 0:return this.xe=!1,this.un(),this.$e&&(this.$e.cancel(),this.$e=null),this.an(),this.hn(),[4,this.Be.runTransaction("shutdown","readwrite",[Se.store,Tn.store],(function(i){var o=new gw(i,Ne.o);return t.Xe(o).next((function(){return t.en(o)}))}))];case 1:return n.sent(),this.Be.close(),this.ln(),[2]}}))}))},e.prototype.rn=function(t,n){var i=this;return t.filter((function(o){return i.sn(o.updateTimeMs,n)&&!i.cn(o.clientId)}))},e.prototype.fn=function(){var t=this;return this.runTransaction("getActiveClients","readonly",(function(n){return sa(n).Nt().next((function(i){return t.rn(i,18e5).map((function(o){return o.clientId}))}))}))},Object.defineProperty(e.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),e.prototype.getMutationQueue=function(t){return YC.Qt(t,this.R,this.Ut,this.referenceDelegate)},e.prototype.getTargetCache=function(){return this.qe},e.prototype.getRemoteDocumentCache=function(){return this.Ue},e.prototype.getIndexManager=function(){return this.Ut},e.prototype.getBundleCache=function(){return this.Ke},e.prototype.runTransaction=function(t,n,i){var o=this;M("IndexedDbPersistence","Starting transaction:",t);var u,c=n==="readonly"?"readonly":"readwrite";return this.Be.runTransaction(t,c,HC,(function(l){return u=new gw(l,o.Ne?o.Ne.next():Ne.o),n==="readwrite-primary"?o.Je(u).next((function(f){return!!f||o.Ye(u)})).next((function(f){if(!f)throw Rt("Failed to obtain primary lease for action '"+t+"'."),o.isPrimary=!1,o.Se.enqueueRetryable((function(){return o.Me(!1)})),new P(k.FAILED_PRECONDITION,Z0);return i(u)})).next((function(f){return o.Ze(u).next((function(){return f}))})):o.dn(u).next((function(){return i(u)}))})).then((function(l){return u.raiseOnCommittedEvent(),l}))},e.prototype.dn=function(t){var n=this;return Jo(t).get(Se.key).next((function(i){if(i!==null&&n.sn(i.leaseTimestampMs,5e3)&&!n.cn(i.ownerId)&&!n.tn(i)&&!(n.Ce||n.allowTabSynchronization&&i.allowTabSynchronization))throw new P(k.FAILED_PRECONDITION,_f)}))},e.prototype.Ze=function(t){var n=new Se(this.clientId,this.allowTabSynchronization,Date.now());return Jo(t).put(Se.key,n)},e.yt=function(){return $i.yt()},e.prototype.Xe=function(t){var n=this,i=Jo(t);return i.get(Se.key).next((function(o){return n.tn(o)?(M("IndexedDbPersistence","Releasing primary lease."),i.delete(Se.key)):L.resolve()}))},e.prototype.sn=function(t,n){var i=Date.now();return!(t<i-n||t>i&&(Rt("Detected an update time that is in the future: "+t+" > "+i),1))},e.prototype.We=function(){var t=this;this.document!==null&&typeof this.document.addEventListener=="function"&&(this.Fe=function(){t.Se.enqueueAndForget((function(){return t.inForeground=t.document.visibilityState==="visible",t.je()}))},this.document.addEventListener("visibilitychange",this.Fe),this.inForeground=this.document.visibilityState==="visible")},e.prototype.an=function(){this.Fe&&(this.document.removeEventListener("visibilitychange",this.Fe),this.Fe=null)},e.prototype.Ge=function(){var t,n=this;typeof((t=this.window)===null||t===void 0?void 0:t.addEventListener)=="function"&&(this.ke=function(){n.un(),ck()&&navigator.appVersion.match("Version/14")&&n.Se.enterRestrictedMode(!0),n.Se.enqueueAndForget((function(){return n.shutdown()}))},this.window.addEventListener("pagehide",this.ke))},e.prototype.hn=function(){this.ke&&(this.window.removeEventListener("pagehide",this.ke),this.ke=null)},e.prototype.cn=function(t){var n;try{var i=((n=this.Qe)===null||n===void 0?void 0:n.getItem(this.on(t)))!==null;return M("IndexedDbPersistence","Client '"+t+"' "+(i?"is":"is not")+" zombied in LocalStorage"),i}catch(o){return Rt("IndexedDbPersistence","Failed to get zombied client id.",o),!1}},e.prototype.un=function(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(t){Rt("Failed to set zombie client id.",t)}},e.prototype.ln=function(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch{}},e.prototype.on=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},e})();function Jo(e){return be(e,Se.store)}function sa(e){return be(e,Tn.store)}function Zp(e,t){var n=e.projectId;return e.isDefaultDatabase||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}var hI=(function(){function e(t,n,i){this.Ue=t,this._n=n,this.Ut=i}return e.prototype.mn=function(t,n){var i=this;return this._n.getAllMutationBatchesAffectingDocumentKey(t,n).next((function(o){return i.yn(t,n,o)}))},e.prototype.yn=function(t,n,i){return this.Ue.getEntry(t,n).next((function(o){for(var u=0,c=i;u<c.length;u++)c[u].applyToLocalView(o);return o}
32))},e.prototype.gn=function(t,n){t.forEach((function(i,o){for(var u=0,c=n;u<c.length;u++)c[u].applyToLocalView(o)}))},e.prototype.pn=function(t,n){var i=this;return this.Ue.getEntries(t,n).next((function(o){return i.En(t,o).next((function(){return o}))}))},e.prototype.En=function(t,n){var i=this;return this._n.getAllMutationBatchesAffectingDocumentKeys(t,n).next((function(o){return i.gn(n,o)}))},e.prototype.getDocumentsMatchingQuery=function(t,n,i){return(function(o){return G.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0})(n)?this.Tn(t,n.path):Hp(n)?this.In(t,n,i):this.An(t,n,i)},e.prototype.Tn=function(t,n){return this.mn(t,new G(n)).next((function(i){var o=Zf();return i.isFoundDocument()&&(o=o.insert(i.key,i)),o}))},e.prototype.In=function(t,n,i){var o=this,u=n.collectionGroup,c=Zf();return this.Ut.getCollectionParents(t,u).next((function(l){return L.forEach(l,(function(f){var d=(function(g,y){return new An(y,null,g.explicitOrderBy.slice(),g.filters.slice(),g.limit,g.limitType,g.startAt,g.endAt)})(n,f.child(u));return o.An(t,d,i).next((function(g){g.forEach((function(y,w){c=c.insert(y,w)}))}))})).next((function(){return c}))}))},e.prototype.An=function(t,n,i){var o,u,c=this;return this.Ue.getDocumentsMatchingQuery(t,n,i).next((function(l){return o=l,c._n.getAllMutationBatchesAffectingQuery(t,n)})).next((function(l){return u=l,c.Rn(t,u,o).next((function(f){o=f;for(var d=0,g=u;d<g.length;d++)for(var y=g[d],w=0,I=y.mutations;w<I.length;w++){var T=I[w],E=T.key,N=o.get(E);N==null&&(N=Jt.newInvalidDocument(E),o=o.insert(E,N)),Jf(T,N,y.localWriteTime),N.isFoundDocument()||(o=o.remove(E))}}))})).next((function(){return o.forEach((function(l,f){Vs(n,f)||(o=o.remove(l))})),o}))},e.prototype.Rn=function(t,n,i){for(var o=ft(),u=0,c=n;u<c.length;u++)for(var l=0,f=c[u].mutations;l<f.length;l++){var d=f[l];d instanceof Jn&&i.get(d.key)===null&&(o=o.add(d.key))}var g=i;return this.Ue.getEntries(t,o).next((function(y){return y.forEach((function(w,I){I.isFoundDocument()&&(g=g.insert(w,I))})),g}))},e})(),uR=(function(){function e(t,n,i,o){this.targetId=t,this.fromCache=n,this.bn=i,this.vn=o}return e.Pn=function(t,n){for(var i=ft(),o=ft(),u=0,c=n.docChanges;u<c.length;u++){var l=c[u];switch(l.type){case 0:i=i.add(l.doc.key);break;case 1:o=o.add(l.doc.key)}}return new e(t,n.fromCache,i,o)},e})(),lI=(function(){function e(){}return e.prototype.Vn=function(t){this.Sn=t},e.prototype.getDocumentsMatchingQuery=function(t,n,i,o){var u=this;return(function(c){return c.filters.length===0&&c.limit===null&&c.startAt==null&&c.endAt==null&&(c.explicitOrderBy.length===0||c.explicitOrderBy.length===1&&c.explicitOrderBy[0].field.isKeyField())})(n)||i.isEqual(Z.min())?this.Dn(t,n):this.Sn.pn(t,o).next((function(c){var l=u.Cn(n,c);return(pa(n)||xa(n))&&u.Nn(n.limitType,l,o,i)?u.Dn(t,n):(Wf()<=nt.DEBUG&&M("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Yf(n)),u.Sn.getDocumentsMatchingQuery(t,n,i).next((function(f){return l.forEach((function(d){f=f.insert(d.key,d)})),f})))}))},e.prototype.Cn=function(t,n){var i=new Mt(D0(t));return n.forEach((function(o,u){Vs(t,u)&&(i=i.add(u))})),i},e.prototype.Nn=function(t,n,i,o){if(i.size!==n.size)return!0;var u=t==="F"?n.last():n.first();return!!u&&(u.hasPendingWrites||u.version.compareTo(o)>0)},e.prototype.Dn=function(t,n){return Wf()<=nt.DEBUG&&M("QueryEngine","Using full collection scan to execute query:",Yf(n)),this.Sn.getDocumentsMatchingQuery(t,n,Z.min())},e})(),aR=(function(){function e(t,n,i,o){this.persistence=t,this.xn=n,this.R=o,this.kn=new Zt(rt),this.Fn=new io((function(u){return Fs(u)}),cc),this.$n=Z.min(),this._n=t.getMutationQueue(i),this.On=t.getRemoteDocumentCache(),this.qe=t.getTargetCache(),this.Mn=new hI(this.On,this._n,this.persistence.getIndexManager()),this.Ke=t.getBundleCache(),this.xn.Vn(this.Mn)}return e.prototype.collectGarbage=function(t){var n=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(i){return t.collect(i,n.kn)}))},e})();function fI(e,t,n,i){return new aR(e,t,n,i)}function pI(e,t){return A(this,void 0,void 0,(function(){var n,i,o,u;return S(this,(function(c){switch(c.label){case 0:return n=U(e),i=n._n,o=n.Mn,[4,n.persistence.runTransaction("Handle user change","readonly",(function(l){var f;return n._n.getAllMutationBatches(l).next((function(d){return f=d,i=n.persistence.getMutationQueue(t),o=new hI(n.On,i,n.persistence.getIndexManager()),i.getAllMutationBatches(l)})).next((function(d){for(var g=[],y=[],w=ft(),I=0,T=f;I<T.length;I++){var E=T[I];g.push(E.batchId);for(var N=0,D=E.mutations;N<D.length;N++){var F=D[N];w=w.add(F.key)}}for(var C=0,B=d;C<B.length;C++){var x=B[C];y.push(x.batchId);for(var Y=0,_=x.mutations;Y<_.length;Y++){var te=_[Y];w=w.add(te.key)}}return o.pn(l,w).next((function(yt){return{Ln:yt,removedBatchIds:g,addedBatchIds:y}}))}))}))];case 1:return u=c.sent(),[2,(n._n=i,n.Mn=o,n.xn.Vn(n.Mn),u)]}}))}))}function cR(e,t){var n=U(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(i){var o=t.batch.keys(),u=n.On.newChangeBuffer({trackRemovals:!0});return(function(c,l,f,d){var g=f.batch,y=g.keys(),w=L.resolve();
32return y.forEach((function(I){w=w.next((function(){return d.getEntry(l,I)})).next((function(T){var E=f.docVersions.get(I);W(E!==null),T.version.compareTo(E)<0&&(g.applyToRemoteDocument(T,f),T.isValidDocument()&&d.addEntry(T,f.commitVersion))}))})),w.next((function(){return c._n.removeMutationBatch(l,g)}))})(n,i,t,u).next((function(){return u.apply(i)})).next((function(){return n._n.performConsistencyCheck(i)})).next((function(){return n.Mn.pn(i,o)}))}))}function dI(e){var t=U(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",(function(n){return t.qe.getLastRemoteSnapshotVersion(n)}))}function hR(e,t){var n=U(e),i=t.snapshotVersion,o=n.kn;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(u){var c=n.On.newChangeBuffer({trackRemovals:!0});o=n.kn;var l=[];t.targetChanges.forEach((function(g,y){var w=o.get(y);if(w){l.push(n.qe.removeMatchingKeys(u,g.removedDocuments,y).next((function(){return n.qe.addMatchingKeys(u,g.addedDocuments,y)})));var I=g.resumeToken;if(I.approximateByteSize()>0){var T=w.withResumeToken(I,i).withSequenceNumber(u.currentSequenceNumber);o=o.insert(y,T),(function(E,N,D){return W(N.resumeToken.approximateByteSize()>0),E.resumeToken.approximateByteSize()===0||N.snapshotVersion.toMicroseconds()-E.snapshotVersion.toMicroseconds()>=3e8||D.addedDocuments.size+D.modifiedDocuments.size+D.removedDocuments.size>0})(w,T,g)&&l.push(n.qe.updateTargetData(u,T))}}}));var f=We();if(t.documentUpdates.forEach((function(g,y){t.resolvedLimboDocuments.has(g)&&l.push(n.persistence.referenceDelegate.updateLimboDocument(u,g))})),l.push(lR(u,c,t.documentUpdates,i).next((function(g){f=g}))),!i.isEqual(Z.min())){var d=n.qe.getLastRemoteSnapshotVersion(u).next((function(g){return n.qe.setTargetsMetadata(u,u.currentSequenceNumber,i)}));l.push(d)}return L.waitFor(l).next((function(){return c.apply(u)})).next((function(){return n.Mn.En(u,f)})).next((function(){return f}))})).then((function(u){return n.kn=o,u}))}function lR(e,t,n,i,o){var u=ft();return n.forEach((function(c){return u=u.add(c)})),t.getEntries(e,u).next((function(c){var l=We();return n.forEach((function(f,d){var g=c.get(f),y=i;d.isNoDocument()&&d.version.isEqual(Z.min())?(t.removeEntry(f,y),l=l.insert(f,d)):!g.isValidDocument()||d.version.compareTo(g.version)>0||d.version.compareTo(g.version)===0&&g.hasPendingWrites?(t.addEntry(d,y),l=l.insert(f,d)):M("LocalStore","Ignoring outdated watch update for ",f,". Current version:",g.version," Watch version:",d.version)})),l}))}function fR(e,t){var n=U(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(i){return t===void 0&&(t=-1),n._n.getNextMutationBatchAfterBatchId(i,t)}))}function Ua(e,t){var n=U(e);return n.persistence.runTransaction("Allocate target","readwrite",(function(i){var o;return n.qe.getTargetData(i,t).next((function(u){return u?(o=u,L.resolve(o)):n.qe.allocateTargetId(i).next((function(c){return o=new pc(t,c,0,i.currentSequenceNumber),n.qe.addTargetData(i,o).next((function(){return o}))}))}))})).then((function(i){var o=n.kn.get(i.targetId);return(o===null||i.snapshotVersion.compareTo(o.snapshotVersion)>0)&&(n.kn=n.kn.insert(i.targetId,i),n.Fn.set(t,i.targetId)),i}))}function Qi(e,t,n){return A(this,void 0,void 0,(function(){var i,o,u,c;return S(this,(function(l){switch(l.label){case 0:i=U(e),o=i.kn.get(t),u=n?"readwrite":"readwrite-primary",l.label=1;case 1:return l.trys.push([1,4,,5]),n?[3,3]:[4,i.persistence.runTransaction("Release target",u,(function(f){return i.persistence.referenceDelegate.removeTarget(f,o)}))];case 2:l.sent(),l.label=3;case 3:return[3,5];case 4:if(!Wr(c=l.sent()))throw c;return M("LocalStore","Failed to update sequence numbers for target "+t+": "+c),[3,5];case 5:return i.kn=i.kn.remove(t),i.Fn.delete(o.target),[2]}}))}))}function ja(e,t,n){var i=U(e),o=Z.min(),u=ft();return i.persistence.runTransaction("Execute query","readonly",(function(c){return(function(l,f,d){var g=U(l),y=g.Fn.get(d);return y!==void 0?L.resolve(g.kn.get(y)):g.qe.getTargetData(f,d)})(i,c,ln(t)).next((function(l){if(l)return o=l.lastLimboFreeSnapshotVersion,i.qe.getMatchingKeysForTargetId(c,l.targetId).next((function(f){u=f}))})).next((function(){return i.xn.getDocumentsMatchingQuery(c,t,n?o:Z.min(),n?u:ft())})).next((function(l){return{documents:l,Bn:u}}))}))}function vI(e,t){var n=U(e),i=U(n.qe),o=n.kn.get(t);return o?Promise.resolve(o.target):n.persistence.runTransaction("Get target data","readonly",(function(u){return i.lt(u,t).next((function(c){return c?c.target:null}))}))}function gI(e){var t=U(e);return t.persistence.runTransaction("Get new document changes","readonly",(function(n){return(function(i,o,u){var c=U(i),l=We(
32),f=Yp(u),d=qn(o),g=IDBKeyRange.lowerBound(f,!0);return d.$t({index:_t.readTimeIndex,range:g},(function(y,w){var I=ep(c.R,w);l=l.insert(I.key,I),f=w.readTime})).next((function(){return{wn:l,readTime:rI(f)}}))})(t.On,n,t.$n)})).then((function(n){var i=n.wn,o=n.readTime;return t.$n=o,i}))}function pR(e){return A(this,void 0,void 0,(function(){var t;return S(this,(function(n){return[2,(t=U(e)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(i){return(function(o){var u=qn(o),c=Z.min();return u.$t({index:_t.readTimeIndex,reverse:!0},(function(l,f,d){f.readTime&&(c=rI(f.readTime)),d.done()})).next((function(){return c}))})(i)})).then((function(i){t.$n=i}))]}))}))}var dR=(function(){function e(t){this.R=t,this.Qn=new Map,this.jn=new Map}return e.prototype.getBundleMetadata=function(t,n){return L.resolve(this.Qn.get(n))},e.prototype.saveBundleMetadata=function(t,n){var i;return this.Qn.set(n.id,{id:(i=n).id,version:i.version,createTime:he(i.createTime)}),L.resolve()},e.prototype.getNamedQuery=function(t,n){return L.resolve(this.jn.get(n))},e.prototype.saveNamedQuery=function(t,n){return this.jn.set(n.name,(function(i){return{name:i.name,query:oI(i.bundledQuery),readTime:he(i.readTime)}})(n)),L.resolve()},e})(),td=(function(){function e(){this.Wn=new Mt(Ut.Gn),this.zn=new Mt(Ut.Hn)}return e.prototype.isEmpty=function(){return this.Wn.isEmpty()},e.prototype.addReference=function(t,n){var i=new Ut(t,n);this.Wn=this.Wn.add(i),this.zn=this.zn.add(i)},e.prototype.Jn=function(t,n){var i=this;t.forEach((function(o){return i.addReference(o,n)}))},e.prototype.removeReference=function(t,n){this.Yn(new Ut(t,n))},e.prototype.Xn=function(t,n){var i=this;t.forEach((function(o){return i.removeReference(o,n)}))},e.prototype.Zn=function(t){var n=this,i=new G(new st([])),o=new Ut(i,t),u=new Ut(i,t+1),c=[];return this.zn.forEachInRange([o,u],(function(l){n.Yn(l),c.push(l.key)})),c},e.prototype.ts=function(){var t=this;this.Wn.forEach((function(n){return t.Yn(n)}))},e.prototype.Yn=function(t){this.Wn=this.Wn.delete(t),this.zn=this.zn.delete(t)},e.prototype.es=function(t){var n=new G(new st([])),i=new Ut(n,t),o=new Ut(n,t+1),u=ft();return this.zn.forEachInRange([i,o],(function(c){u=u.add(c.key)})),u},e.prototype.containsKey=function(t){var n=new Ut(t,0),i=this.Wn.firstAfterOrEqual(n);return i!==null&&t.isEqual(i.key)},e})(),Ut=(function(){function e(t,n){this.key=t,this.ns=n}return e.Gn=function(t,n){return G.comparator(t.key,n.key)||rt(t.ns,n.ns)},e.Hn=function(t,n){return rt(t.ns,n.ns)||G.comparator(t.key,n.key)},e})(),vR=(function(){function e(t,n){this.Ut=t,this.referenceDelegate=n,this._n=[],this.ss=1,this.rs=new Mt(Ut.Gn)}return e.prototype.checkEmpty=function(t){return L.resolve(this._n.length===0)},e.prototype.addMutationBatch=function(t,n,i,o){var u=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var c=new Qp(u,n,i,o);this._n.push(c);for(var l=0,f=o;l<f.length;l++){var d=f[l];this.rs=this.rs.add(new Ut(d.key,u)),this.Ut.addToCollectionParentIndex(t,d.key.path.popLast())}return L.resolve(c)},e.prototype.lookupMutationBatch=function(t,n){return L.resolve(this.os(n))},e.prototype.getNextMutationBatchAfterBatchId=function(t,n){var i=n+1,o=this.cs(i),u=o<0?0:o;return L.resolve(this._n.length>u?this._n[u]:null)},e.prototype.getHighestUnacknowledgedBatchId=function(){return L.resolve(this._n.length===0?-1:this.ss-1)},e.prototype.getAllMutationBatches=function(t){return L.resolve(this._n.slice())},e.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,n){var i=this,o=new Ut(n,0),u=new Ut(n,Number.POSITIVE_INFINITY),c=[];return this.rs.forEachInRange([o,u],(function(l){var f=i.os(l.ns);c.push(f)})),L.resolve(c)},e.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,n){var i=this,o=new Mt(rt);return n.forEach((function(u){var c=new Ut(u,0),l=new Ut(u,Number.POSITIVE_INFINITY);i.rs.forEachInRange([c,l],(function(f){o=o.add(f.ns)}))})),L.resolve(this.us(o))},e.prototype.getAllMutationBatchesAffectingQuery=function(t,n){var i=n.path,o=i.length+1,u=i;G.isDocumentKey(u)||(u=u.child(""));var c=new Ut(new G(u),0),l=new Mt(rt);
32return this.rs.forEachWhile((function(f){var d=f.key.path;return!!i.isPrefixOf(d)&&(d.length===o&&(l=l.add(f.ns)),!0)}),c),L.resolve(this.us(l))},e.prototype.us=function(t){var n=this,i=[];return t.forEach((function(o){var u=n.os(o);u!==null&&i.push(u)})),i},e.prototype.removeMutationBatch=function(t,n){var i=this;W(this.hs(n.batchId,"removed")===0),this._n.shift();var o=this.rs;return L.forEach(n.mutations,(function(u){var c=new Ut(u.key,n.batchId);return o=o.delete(c),i.referenceDelegate.markPotentiallyOrphaned(t,u.key)})).next((function(){i.rs=o}))},e.prototype.Gt=function(t){},e.prototype.containsKey=function(t,n){var i=new Ut(n,0),o=this.rs.firstAfterOrEqual(i);return L.resolve(n.isEqual(o&&o.key))},e.prototype.performConsistencyCheck=function(t){return this._n.length,L.resolve()},e.prototype.hs=function(t,n){return this.cs(t)},e.prototype.cs=function(t){return this._n.length===0?0:t-this._n[0].batchId},e.prototype.os=function(t){var n=this.cs(t);return n<0||n>=this._n.length?null:this._n[n]},e})(),gR=(function(){function e(t,n){this.Ut=t,this.ls=n,this.docs=new Zt(G.comparator),this.size=0}return e.prototype.addEntry=function(t,n,i){var o=n.key,u=this.docs.get(o),c=u?u.size:0,l=this.ls(n);return this.docs=this.docs.insert(o,{document:n.clone(),size:l,readTime:i}),this.size+=l-c,this.Ut.addToCollectionParentIndex(t,o.path.popLast())},e.prototype.removeEntry=function(t){var n=this.docs.get(t);n&&(this.docs=this.docs.remove(t),this.size-=n.size)},e.prototype.getEntry=function(t,n){var i=this.docs.get(n);return L.resolve(i?i.document.clone():Jt.newInvalidDocument(n))},e.prototype.getEntries=function(t,n){var i=this,o=We();return n.forEach((function(u){var c=i.docs.get(u);o=o.insert(u,c?c.document.clone():Jt.newInvalidDocument(u))})),L.resolve(o)},e.prototype.getDocumentsMatchingQuery=function(t,n,i){for(var o=We(),u=new G(n.path.child("")),c=this.docs.getIteratorFrom(u);c.hasNext();){var l=c.getNext(),f=l.key,d=l.value,g=d.document,y=d.readTime;if(!n.path.isPrefixOf(f.path))break;y.compareTo(i)<=0||Vs(n,g)&&(o=o.insert(g.key,g.clone()))}return L.resolve(o)},e.prototype.fs=function(t,n){return L.forEach(this.docs,(function(i){return n(i)}))},e.prototype.newChangeBuffer=function(t){return new mR(this)},e.prototype.getSize=function(t){return L.resolve(this.size)},e})(),mR=(function(e){function t(n){var i=this;return(i=e.call(this)||this).Ie=n,i}return $(t,e),t.prototype.applyChanges=function(n){var i=this,o=[];
32return this.changes.forEach((function(u,c){c.document.isValidDocument()?o.push(i.Ie.addEntry(n,c.document,i.getReadTime(u))):i.Ie.removeEntry(u)})),L.waitFor(o)},t.prototype.getFromCache=function(n,i){return this.Ie.getEntry(n,i)},t.prototype.getAllFromCache=function(n,i){return this.Ie.getEntries(n,i)},t})(cI),yR=(function(){function e(t){this.persistence=t,this.ds=new io((function(n){return Fs(n)}),cc),this.lastRemoteSnapshotVersion=Z.min(),this.highestTargetId=0,this.ws=0,this._s=new td,this.targetCount=0,this.ys=Fa.Jt()}return e.prototype.forEachTarget=function(t,n){return this.ds.forEach((function(i,o){return n(o)})),L.resolve()},e.prototype.getLastRemoteSnapshotVersion=function(t){return L.resolve(this.lastRemoteSnapshotVersion)},e.prototype.getHighestSequenceNumber=function(t){return L.resolve(this.ws)},e.prototype.allocateTargetId=function(t){return this.highestTargetId=this.ys.next(),L.resolve(this.highestTargetId)},e.prototype.setTargetsMetadata=function(t,n,i){return i&&(this.lastRemoteSnapshotVersion=i),n>this.ws&&(this.ws=n),L.resolve()},e.prototype.te=function(t){this.ds.set(t.target,t);var n=t.targetId;n>this.highestTargetId&&(this.ys=new Fa(n),this.highestTargetId=n),t.sequenceNumber>this.ws&&(this.ws=t.sequenceNumber)},e.prototype.addTargetData=function(t,n){return this.te(n),this.targetCount+=1,L.resolve()},e.prototype.updateTargetData=function(t,n){return this.te(n),L.resolve()},e.prototype.removeTargetData=function(t,n){return this.ds.delete(n.target),this._s.Zn(n.targetId),this.targetCount-=1,L.resolve()},e.prototype.removeTargets=function(t,n,i){var o=this,u=0,c=[];return this.ds.forEach((function(l,f){f.sequenceNumber<=n&&i.get(f.targetId)===null&&(o.ds.delete(l),c.push(o.removeMatchingKeysForTargetId(t,f.targetId)),u++)})),L.waitFor(c).next((function(){return u}))},e.prototype.getTargetCount=function(t){return L.resolve(this.targetCount)},e.prototype.getTargetData=function(t,n){var i=this.ds.get(n)||null;return L.resolve(i)},e.prototype.addMatchingKeys=function(t,n,i){return this._s.Jn(n,i),L.resolve()},e.prototype.removeMatchingKeys=function(t,n,i){this._s.Xn(n,i);var o=this.persistence.referenceDelegate,u=[];return o&&n.forEach((function(c){u.push(o.markPotentiallyOrphaned(t,c))})),L.waitFor(u)},e.prototype.removeMatchingKeysForTargetId=function(t,n){return this._s.Zn(n),L.resolve()},e.prototype.getMatchingKeysForTargetId=function(t,n){var i=this._s.es(n);return L.resolve(i)},e.prototype.containsKey=function(t,n){return L.resolve(this._s.containsKey(n))},e})(),wR=(function(){function e(t,n){var i=this;this.gs={},this.Ne=new Ne(0),this.xe=!1,this.xe=!0,this.referenceDelegate=t(this),this.qe=new yR(this),this.Ut=new XC,this.Ue=(function(o,u){return new gR(o,(function(c){return i.referenceDelegate.ps(c)}))})(this.Ut),this.R=new nI(n),this.Ke=new dR(this.R)}return e.prototype.start=function(){return Promise.resolve()},e.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(e.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),e.prototype.setDatabaseDeletedListener=function(){},e.prototype.setNetworkEnabled=function(){},e.prototype.getIndexManager=function(){return this.Ut},e.prototype.getMutationQueue=function(t){var n=this.gs[t.toKey()];return n||(n=new vR(this.Ut,this.referenceDelegate),this.gs[t.toKey()]=n),n},e.prototype.getTargetCache=function(){return this.qe},e.prototype.getRemoteDocumentCache=function(){return this.Ue},e.prototype.getBundleCache=function(){return this.Ke},e.prototype.runTransaction=function(t,n,i){var o=this;M("MemoryPersistence","Starting transaction:",t);var u=new bR(this.Ne.next());return this.referenceDelegate.Es(),i(u).next((function(c){return o.referenceDelegate.Ts(u).next((function(){return c}))})).toPromise().then((function(c){return u.raiseOnCommittedEvent(),c}))},e.prototype.Is=function(t,n){return L.or(Object.values(this.gs).map((function(i){return function(){return i.containsKey(t,n)}})))},e})(),bR=(function(e){function t(n){var i=this;return(i=e.call(this)||this).currentSequenceNumber=n,i}return $(t,e),t})(tI),IR=(function(){function e(t){this.persistence=t,this.As=new td,this.Rs=null}return e.bs=function(t){return new e(t)},Object.defineProperty(e.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw K()}
32,enumerable:!1,configurable:!0}),e.prototype.addReference=function(t,n,i){return this.As.addReference(i,n),this.vs.delete(i.toString()),L.resolve()},e.prototype.removeReference=function(t,n,i){return this.As.removeReference(i,n),this.vs.add(i.toString()),L.resolve()},e.prototype.markPotentiallyOrphaned=function(t,n){return this.vs.add(n.toString()),L.resolve()},e.prototype.removeTarget=function(t,n){var i=this;this.As.Zn(n.targetId).forEach((function(u){return i.vs.add(u.toString())}));var o=this.persistence.getTargetCache();return o.getMatchingKeysForTargetId(t,n.targetId).next((function(u){u.forEach((function(c){return i.vs.add(c.toString())}))})).next((function(){return o.removeTargetData(t,n)}))},e.prototype.Es=function(){this.Rs=new Set},e.prototype.Ts=function(t){var n=this,i=this.persistence.getRemoteDocumentCache().newChangeBuffer();return L.forEach(this.vs,(function(o){var u=G.fromPath(o);return n.Ps(t,u).next((function(c){c||i.removeEntry(u)}))})).next((function(){return n.Rs=null,i.apply(t)}))},e.prototype.updateLimboDocument=function(t,n){var i=this;return this.Ps(t,n).next((function(o){o?i.vs.delete(n.toString()):i.vs.add(n.toString())}))},e.prototype.ps=function(t){return 0},e.prototype.Ps=function(t,n){var i=this;return L.or([function(){return L.resolve(i.As.containsKey(n))},function(){return i.persistence.getTargetCache().containsKey(t,n)},function(){return i.persistence.Is(t,n)}])},e})(),qt=(function(){function e(t){this.uid=t}return e.prototype.isAuthenticated=function(){return this.uid!=null},e.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},e.prototype.isEqual=function(t){return t.uid===this.uid},e})();function Aw(e,t){return"firestore_clients_"+e+"_"+t}function kw(e,t,n){var i="firestore_mutations_"+e+"_"+n;return t.isAuthenticated()&&(i+="_"+t.uid),i}function Ef(e,t){return"firestore_targets_"+e+"_"+t}qt.UNAUTHENTICATED=new qt(null),qt.GOOGLE_CREDENTIALS=new qt("google-credentials-uid"),qt.FIRST_PARTY=new qt("first-party-uid"),qt.MOCK_USER=new qt("mock-user");var Nw=(function(){function e(t,n,i,o){this.user=t,this.batchId=n,this.state=i,this.error=o}return e.Vs=function(t,n,i){var o,u=JSON.parse(i),c=typeof u=="object"&&["pending","acknowledged","rejected"].indexOf(u.state)!==-1&&(u.error===void 0||typeof u.error=="object");return c&&u.error&&(c=typeof u.error.message=="string"&&typeof u.error.code=="string")&&(o=new P(u.error.code,u.error.message)),c?new e(t,n,u.state,o):(Rt("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+i),null)},e.prototype.Ss=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},e})(),Sf=(function(){function e(t,n,i){this.targetId=t,this.state=n,this.error=i}return e.Vs=function(t,n){var i,o=JSON.parse(n),u=typeof o=="object"&&["not-current","current","rejected"].indexOf(o.state)!==-1&&(o.error===void 0||typeof o.error=="object");return u&&o.error&&(u=typeof o.error.message=="string"&&typeof o.error.code=="string")&&(i=new P(o.error.code,o.error.message)),u?new e(t,o.state,i):(Rt("SharedClientState","Failed to parse target state for ID '"+t+"': "+n),null)},e.prototype.Ss=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},e})(),Cw=(function(){function e(t,n){this.clientId=t,this.activeTargetIds=n}return e.Vs=function(t,n){for(var i=JSON.parse(n),o=typeof i=="object"&&i.activeTargetIds instanceof Array,u=fc(),c=0;o&&c<i.activeTargetIds.length;++c)o=S0(i.activeTargetIds[c]),u=u.add(i.activeTargetIds[c]);return o?new e(t,u):(Rt("SharedClientState","Failed to parse client data for instance '"+t+"': "+n),null)},e})(),TR=(function(){function e(t,n){this.clientId=t,this.onlineState=n}return e.Vs=function(t){var n=JSON.parse(t);return typeof n=="object"&&["Unknown","Online","Offline"].indexOf(n.onlineState)!==-1&&typeof n.clientId=="string"?new e(n.clientId,n.onlineState):(Rt("SharedClientState","Failed to parse online state: "+t),null)},e})(),np=(function(){function e(){this.activeTargetIds=fc()}return e.prototype.Ds=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},e.prototype.Cs=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},e.prototype.Ss=function(){var t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)},e})(),Af=(function(){function e(t,n,i,o,u){this.window=t,this.Se=n,this.persistenceKey=i,this.Ns=o,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.xs=this.ks.bind(this),this.Fs=new Zt(rt),this.started=!1,this.$s=[];var c=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=u,this.Os=Aw(this.persistenceKey,this.Ns),this.Ms=(function(l){return"firestore_sequence_number_"+l})(this.persistenceKey),this.Fs=this.Fs.insert(this.Ns,new np),this.Ls=new RegExp("^firestore_clients_"+c+"_([^_]*)$"),this.Bs=new RegExp("^firestore_mutations_"+c+"_(\\d+)(?:_(.*))?$"),this.qs=new RegExp("^firestore_targets_"+c+"_(\\d+)$"),this.Us=(function(l){return"firestore_online_state_"+l})(this.persistenceKey),this.Ks=(function(l){return"firestore_bundle_loaded_"+l})(this.persistenceKey),this.window.addEventListener("storage",this.xs)}return e.yt=function(t){return!(!t||!t.localStorage)},e.prototype.start=function(){return A(this,void 0,void 0,(function(){var t,n,i,o,u,c,l,f,d,g,y,w=this;return S(this,(function(I){switch(I.label){case 0:return[4,this.syncEngine.fn()];case 1:for(t=I.sent(),n=0,i=t;n<i.length;n++)(o=i[n])!==this.Ns&&(u=this.getItem(Aw(this.persistenceKey,o)))&&(c=Cw.Vs(o,u))&&(this.Fs=this.Fs.insert(c.clientId,c
32));for(this.Qs(),(l=this.storage.getItem(this.Us))&&(f=this.js(l))&&this.Ws(f),d=0,g=this.$s;d<g.length;d++)y=g[d],this.ks(y);return this.$s=[],this.window.addEventListener("pagehide",(function(){return w.shutdown()})),this.started=!0,[2]}}))}))},e.prototype.writeSequenceNumber=function(t){this.setItem(this.Ms,JSON.stringify(t))},e.prototype.getAllActiveQueryTargets=function(){return this.Gs(this.Fs)},e.prototype.isActiveQueryTarget=function(t){var n=!1;return this.Fs.forEach((function(i,o){o.activeTargetIds.has(t)&&(n=!0)})),n},e.prototype.addPendingMutation=function(t){this.zs(t,"pending")},e.prototype.updateMutationState=function(t,n,i){this.zs(t,n,i),this.Hs(t)},e.prototype.addLocalQueryTarget=function(t){var n="not-current";if(this.isActiveQueryTarget(t)){var i=this.storage.getItem(Ef(this.persistenceKey,t));if(i){var o=Sf.Vs(t,i);o&&(n=o.state)}}return this.Js.Ds(t),this.Qs(),n},e.prototype.removeLocalQueryTarget=function(t){this.Js.Cs(t),this.Qs()},e.prototype.isLocalQueryTarget=function(t){return this.Js.activeTargetIds.has(t)},e.prototype.clearQueryState=function(t){this.removeItem(Ef(this.persistenceKey,t))},e.prototype.updateQueryState=function(t,n,i){this.Ys(t,n,i)},e.prototype.handleUserChange=function(t,n,i){var o=this;n.forEach((function(u){o.Hs(u)})),this.currentUser=t,i.forEach((function(u){o.addPendingMutation(u)}))},e.prototype.setOnlineState=function(t){this.Xs(t)},e.prototype.notifyBundleLoaded=function(){this.Zs()},e.prototype.shutdown=function(){this.started&&(this.window.removeEventListener("storage",this.xs),this.removeItem(this.Os),this.started=!1)},e.prototype.getItem=function(t){var n=this.storage.getItem(t);return M("SharedClientState","READ",t,n),n},e.prototype.setItem=function(t,n){M("SharedClientState","SET",t,n),this.storage.setItem(t,n)},e.prototype.removeItem=function(t){M("SharedClientState","REMOVE",t),this.storage.removeItem(t)},e.prototype.ks=function(t){var n=this,i=t;if(i.storageArea===this.storage){if(M("SharedClientState","EVENT",i.key,i.newValue),i.key===this.Os)return void Rt("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Se.enqueueRetryable((function(){return A(n,void 0,void 0,(function(){var o,u,c,l,f,d;return S(this,(function(g){if(this.started){if(i.key!==null){if(this.Ls.test(i.key)){if(i.newValue==null)return o=this.ti(i.key),[2,this.ei(o,null)];if(u=this.ni(i.key,i.newValue))return[2,this.ei(u.clientId,u)]}else if(this.Bs.test(i.key)){if(i.newValue!==null&&(c=this.si(i.key,i.newValue)))return[2,this.ii(c)]}else if(this.qs.test(i.key)){if(i.newValue!==null&&(l=this.ri(i.key,i.newValue)))return[2,this.oi(l)]}else if(i.key===this.Us){if(i.newValue!==null&&(f=this.js(i.newValue)))return[2,this.Ws(f)]}else if(i.key===this.Ms)(d=(function(y){var w=Ne.o;if(y!=null)try{var I=JSON.parse(y);W(typeof I=="number"),w=I}catch(T){Rt("SharedClientState","Failed to read sequence number from WebStorage",T)}return w})(i.newValue))!==Ne.o&&this.sequenceNumberHandler(d);else if(i.key===this.Ks)return[2,this.syncEngine.ci()]}}else this.$s.push(i);return[2]}))}))}))}},Object.defineProperty(e.prototype,"Js",{get:function(){return this.Fs.get(this.Ns)},enumerable:!1,configurable:!0}),e.prototype.Qs=function(){this.setItem(this.Os,this.Js.Ss())},e.prototype.zs=function(t,n,i){var o=new Nw(this.currentUser,t,n,i),u=kw(this.persistenceKey,this.currentUser,t);this.setItem(u,o.Ss())},e.prototype.Hs=function(t){var n=kw(this.persistenceKey,this.currentUser,t);this.removeItem(n)},e.prototype.Xs=function(t){var n={clientId:this.Ns,onlineState:t};this.storage.setItem(this.Us,JSON.stringify(n))},e.prototype.Ys=function(t,n,i){var o=Ef(this.persistenceKey,t),u=new Sf(t,n,i);this.setItem(o,u.Ss())},e.prototype.Zs=function(){this.setItem(this.Ks,"value-not-used")},e.prototype.ti=function(t){var n=this.Ls.exec(t);return n?n[1]:null},e.prototype.ni=function(t,n){var i=this.ti(t);return Cw.Vs(i,n)},e.prototype.si=function(t,n){var i=this.Bs.exec(t),o=Number(i[1]),u=i[2]!==void 0?i[2]:null;return Nw.Vs(new qt(u),o,n)},e.prototype.ri=function(t,n){var i=this.qs.exec(t),o=Number(i[1]);return Sf.Vs(o,n)},e.prototype.js=function(t){return TR.Vs(t)},e.prototype.ii=function(t){return A(this,void 0,void 0,(function(){return S(this,(function(n){return t.user.uid===this.currentUser.uid?[2,this.syncEngine.ui(t.batchId,t.state,t.error)]:(M("SharedCl
32ientState","Ignoring mutation for non-active user "+t.user.uid),[2])}))}))},e.prototype.oi=function(t){return this.syncEngine.ai(t.targetId,t.state,t.error)},e.prototype.ei=function(t,n){var i=this,o=n?this.Fs.insert(t,n):this.Fs.remove(t),u=this.Gs(this.Fs),c=this.Gs(o),l=[],f=[];return c.forEach((function(d){u.has(d)||l.push(d)})),u.forEach((function(d){c.has(d)||f.push(d)})),this.syncEngine.hi(l,f).then((function(){i.Fs=o}))},e.prototype.Ws=function(t){this.Fs.get(t.clientId)&&this.onlineStateHandler(t.onlineState)},e.prototype.Gs=function(t){var n=fc();return t.forEach((function(i,o){n=n.unionWith(o.activeTargetIds)})),n},e})(),mI=(function(){function e(){this.li=new np,this.fi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}return e.prototype.addPendingMutation=function(t){},e.prototype.updateMutationState=function(t,n,i){},e.prototype.addLocalQueryTarget=function(t){return this.li.Ds(t),this.fi[t]||"not-current"},e.prototype.updateQueryState=function(t,n,i){this.fi[t]=n},e.prototype.removeLocalQueryTarget=function(t){this.li.Cs(t)},e.prototype.isLocalQueryTarget=function(t){return this.li.activeTargetIds.has(t)},e.prototype.clearQueryState=function(t){delete this.fi[t]},e.prototype.getAllActiveQueryTargets=function(){return this.li.activeTargetIds},e.prototype.isActiveQueryTarget=function(t){return this.li.activeTargetIds.has(t)},e.prototype.start=function(){return this.li=new np,Promise.resolve()},e.prototype.handleUserChange=function(t,n,i){},e.prototype.setOnlineState=function(t){},e.prototype.shutdown=function(){},e.prototype.writeSequenceNumber=function(t){},e.prototype.notifyBundleLoaded=function(){},e})(),_R=(function(){function e(){}return e.prototype.di=function(t){},e.prototype.shutdown=function(){},e})(),Rw=(function(){function e(){var t=this;this.wi=function(){return t._i()},this.mi=function(){return t.yi()},this.gi=[],this.pi()}return e.prototype.di=function(t){this.gi.push(t)},e.prototype.shutdown=function(){window.removeEventListener("online",this.wi),window.removeEventListener("offline",this.mi)},e.prototype.pi=function(){window.addEventListener("online",this.wi),window.addEventListener("offline",this.mi)},e.prototype._i=function(){M("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,n=this.gi;t<n.length;t++)(0,n[t])(0)},e.prototype.yi=function(){M("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,n=this.gi;t<n.length;t++)(0,n[t])(1)},e.yt=function(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0},e})(),ER={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},SR=(function(){function e(t){this.Ei=t.Ei,this.Ti=t.Ti}return e.prototype.Ii=function(t){this.Ai=t},e.prototype.Ri=function(t){this.bi=t},e.prototype.onMessage=function(t){this.vi=t},e.prototype.close=function(){this.Ti()},e.prototype.send=function(t){this.Ei(t)},e.prototype.Pi=function(){this.Ai()},e.prototype.Vi=function(t){this.bi(t)},e.prototype.Si=function(t){this.vi(t)},e})(),AR=(function(e){function t(n){var i=this;return(i=e.call(this,n)||this).forceLongPolling=n.forceLongPolling,i.autoDetectLongPolling=n.autoDetectLongPolling,i.useFetchStreams=n.useFetchStreams,i}return $(t,e),t.prototype.Fi=function(n,i,o,u){return new Promise((function(c,l){var f=new nC;f.listenOnce(ZN.COMPLETE,(function(){try{switch(f.getLastErrorCode()){case Tf.NO_ERROR:var g=f.getResponseJson();M("Connection","XHR received:",JSON.stringify(g)),c(g);break;case Tf.TIMEOUT:M("Connection",'RPC "'+n+'" timed out'),l(new P(k.DEADLINE_EXCEEDED,"Request time out"));break;case Tf.HTTP_ERROR:var y=f.getStatus();if(M("Connection",'RPC "'+n+'" failed with status:',y,"response text:",f.getResponseText()),y>0){var w=f.getResponseJson().error;if(w&&w.status&&w.message){var I=(function(T){var E=T.toLowerCase().replace(/_/g,"-");return Object.values(k).indexOf(E)>=0?E:k.UNKNOWN})(w.status);l(new P(I,w.message))}else l(new P(k.UNKNOWN,"Server responded with status "+f.getStatus()))}else l(new P(k.UNAVAILABLE,"Connection failed."));break;default:K()}}finally{M("Connection",'RPC "'+n+'" completed.')}}));var d=JSON.stringify(u);f.send(i,"POST",d,o,15)}))},t.prototype.Oi=function(n,i){var o=[this.Di,"/","google.firestore.v1.Firestore","/",n,"/channel"],u=YN(),c=JN(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database}
32,sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(l.xmlHttpFactory=new eC({})),this.ki(l.initMessageHeaders,i),nk()||ok()||sk()||uk()||ak()||ik()||(l.httpHeadersOverwriteParam="$httpHeaders");var f=o.join("");M("Connection","Creating WebChannel: "+f,l);var d=u.createWebChannel(f,l),g=!1,y=!1,w=new SR({Ei:function(T){y?M("Connection","Not sending because WebChannel is closed:",T):(g||(M("Connection","Opening WebChannel transport."),d.open(),g=!0),M("Connection","WebChannel sending:",T),d.send(T))},Ti:function(){return d.close()}}),I=function(T,E,N){T.listen(E,(function(D){try{N(D)}catch(F){setTimeout((function(){throw F}),0)}}))};return I(d,na.EventType.OPEN,(function(){y||M("Connection","WebChannel transport opened.")})),I(d,na.EventType.CLOSE,(function(){y||(y=!0,M("Connection","WebChannel transport closed"),w.Vi())})),I(d,na.EventType.ERROR,(function(T){y||(y=!0,Ca("Connection","WebChannel transport errored:",T),w.Vi(new P(k.UNAVAILABLE,"The operation could not be completed")))})),I(d,na.EventType.MESSAGE,(function(T){var E;if(!y){var N=T.data[0];W(!!N);var D=N,F=D.error||((E=D[0])===null||E===void 0?void 0:E.error);if(F){M("Connection","WebChannel received error:",F);var C=F.status,B=(function(Y){var _=Nt[Y];if(_!==void 0)return q0(_)})(C),x=F.message;B===void 0&&(B=k.INTERNAL,x="Unknown error status: "+C+" with message "+F.message),y=!0,w.Vi(new P(B,x)),d.close()}else M("Connection","WebChannel received:",N),w.Si(N)}})),I(c,tC.STAT_EVENT,(function(T){T.stat===$y.PROXY?M("Connection","Detected buffering proxy"):T.stat===$y.NOPROXY&&M("Connection","Detected no buffering proxy")})),setTimeout((function(){w.Pi()}),0),w},t})((function(){function e(t){this.databaseInfo=t,this.databaseId=t.databaseId;var n=t.ssl?"https":"http";this.Di=n+"://"+t.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return e.prototype.Ni=function(t,n,i,o){var u=this.xi(t,n);M("RestConnection","Sending: ",u,i);var c={};return this.ki(c,o),this.Fi(t,u,c,i).then((function(l){return M("RestConnection","Received: ",l),l}),(function(l){throw Ca("RestConnection",t+" failed with error: ",l,"url: ",u,"request:",i),l}))},e.prototype.$i=function(t,n,i,o){return this.Ni(t,n,i,o)},e.prototype.ki=function(t,n){if(t["X-Goog-Api-Client"]="gl-js/ fire/8.10.1",t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),n)for(var i in n.authHeaders)n.authHeaders.hasOwnProperty(i)&&(t[i]=n.authHeaders[i])},e.prototype.xi=function(t,n){var i=ER[t];return this.Di+"/v1/"+n+":"+i},e})());function yI(){return typeof window<"u"?window:null}function ga(){return typeof document<"u"?document:null}function dc(e){return new OC(e,!0)}var ed=(function(){function e(t,n,i,o,u){i===void 0&&(i=1e3),o===void 0&&(o=1.5),u===void 0&&(u=6e4),this.Se=t,this.timerId=n,this.Mi=i,this.Li=o,this.Bi=u,this.qi=0,this.Ui=null,this.Ki=Date.now(),this.reset()}return e.prototype.reset=function(){this.qi=0},e.prototype.Qi=function(){this.qi=this.Bi},e.prototype.ji=function(t){var n=this;this.cancel();var i=Math.floor(this.qi+this.Wi()),o=Math.max(0,Date.now()-this.Ki),u=Math.max(0,i-o);u>0&&M("ExponentialBackoff","Backing off for "+u+" ms (base delay: "+this.qi+" ms, delay with jitter: "+i+" ms, last attempt: "+o+" ms ago)"),this.Ui=this.Se.enqueueAfterDelay(this.timerId,u,(function(){return n.Ki=Date.now(),t()})),this.qi*=this.Li,this.qi<this.Mi&&(this.qi=this.Mi),this.qi>this.Bi&&(this.qi=this.Bi)},e.prototype.Gi=function(){this.Ui!==null&&(this.Ui.skipDelay(),this.Ui=null)},e.prototype.cancel=function(){this.Ui!==null&&(this.Ui.cancel(),this.Ui=null)},e.prototype.Wi=function(){return(Math.random()-.5)*this.qi},e})(),wI=(function(){function e(t,n,i,o,u,c){this.Se=t,this.zi=i,this.Hi=o,this.Ji=u,this.listener=c,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new ed(t,n)}return e.prototype.tr=function(){return this.state===1||this.state===2||this.state===4},e.prototype.er=function(){return this.state===2},e.prototype.start=function(){this.state!==3?this.auth():this.nr()},e.prototype.stop=function(){return A(this,void 0,void 0,(function(){return S(this,(function(t){switch(t.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
32))}))},e.prototype.sr=function(){this.state=0,this.Zi.reset()},e.prototype.ir=function(){var t=this;this.er()&&this.Xi===null&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,(function(){return t.rr()})))},e.prototype.cr=function(t){this.ur(),this.stream.send(t)},e.prototype.rr=function(){return A(this,void 0,void 0,(function(){return S(this,(function(t){return this.er()?[2,this.close(0)]:[2]}))}))},e.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},e.prototype.close=function(t,n){return A(this,void 0,void 0,(function(){return S(this,(function(i){switch(i.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,t!==3?this.Zi.reset():n&&n.code===k.RESOURCE_EXHAUSTED?(Rt(n.toString()),Rt("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):n&&n.code===k.UNAUTHENTICATED&&this.Ji.invalidateToken(),this.stream!==null&&(this.ar(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.Ri(n)];case 1:return i.sent(),[2]}}))}))},e.prototype.ar=function(){},e.prototype.auth=function(){var t=this;this.state=1;var n=this.hr(this.Yi),i=this.Yi;this.Ji.getToken().then((function(o){t.Yi===i&&t.lr(o)}),(function(o){n((function(){var u=new P(k.UNKNOWN,"Fetching auth token failed: "+o.message);return t.dr(u)}))}))},e.prototype.lr=function(t){var n=this,i=this.hr(this.Yi);this.stream=this.wr(t),this.stream.Ii((function(){i((function(){return n.state=2,n.listener.Ii()}))})),this.stream.Ri((function(o){i((function(){return n.dr(o)}))})),this.stream.onMessage((function(o){i((function(){return n.onMessage(o)}))}))},e.prototype.nr=function(){var t=this;this.state=4,this.Zi.ji((function(){return A(t,void 0,void 0,(function(){return S(this,(function(n){return this.state=0,this.start(),[2]}))}))}))},e.prototype.dr=function(t){return M("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},e.prototype.hr=function(t){var n=this;return function(i){n.Se.enqueueAndForget((function(){return n.Yi===t?i():(M("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},e})(),kR=(function(e){function t(n,i,o,u,c){var l=this;return(l=e.call(this,n,"listen_stream_connection_backoff","listen_stream_idle",i,o,c)||this).R=u,l}return $(t,e),t.prototype.wr=function(n){return this.Hi.Oi("Listen",n)},t.prototype.onMessage=function(n){this.Zi.reset();var i=(function(u,c){var l;if("targetChange"in c){c.targetChange;var f=(function(N){return N==="NO_CHANGE"?0:N==="ADD"?1:N==="REMOVE"?2:N==="CURRENT"?3:N==="RESET"?4:K()})(c.targetChange.targetChangeType||"NO_CHANGE"),d=c.targetChange.targetIds||[],g=(function(N,D){return N.I?(W(D===void 0||typeof D=="str
32ing"),ye.fromBase64String(D||"")):(W(D===void 0||D instanceof Uint8Array),ye.fromUint8Array(D||new Uint8Array))})(u,c.targetChange.resumeToken),y=(w=c.targetChange.cause)&&(function(N){var D=N.code===void 0?k.UNKNOWN:q0(N.code);return new P(D,N.message||"")})(w);l=new K0(f,d,g,y||null)}else if("documentChange"in c){c.documentChange,(f=c.documentChange).document,f.document.name,f.document.updateTime,d=In(u,f.document.name),g=he(f.document.updateTime);var w=new ke({mapValue:{fields:f.document.fields}}),I=(y=Jt.newFoundDocument(d,g,w),f.targetIds||[]),T=f.removedTargetIds||[];l=new va(I,T,y.key,y)}else if("documentDelete"in c)c.documentDelete,(f=c.documentDelete).document,d=In(u,f.document),g=f.readTime?he(f.readTime):Z.min(),w=Jt.newNoDocument(d,g),y=f.removedTargetIds||[],l=new va([],y,w.key,w);else if("documentRemove"in c)c.documentRemove,(f=c.documentRemove).document,d=In(u,f.document),g=f.removedTargetIds||[],l=new va([],g,d,null);else{if(!("filter"in c))return K();c.filter;var E=c.filter;E.targetId,f=E.count||0,d=new TC(f),g=E.targetId,l=new B0(g,d)}return l})(this.R,n),o=(function(u){if(!("targetChange"in u))return Z.min();var c=u.targetChange;return c.targetIds&&c.targetIds.length?Z.min():c.readTime?he(c.readTime):Z.min()})(n);return this.listener._r(i,o)},t.prototype.mr=function(n){var i={};i.database=bs(this.R),i.addTarget=(function(u,c){var l,f=c.target;return(l=Oa(f)?{documents:W0(u,f)}:{query:X0(u,f)}).targetId=c.targetId,c.resumeToken.approximateByteSize()>0?l.resumeToken=H0(u,c.resumeToken):c.snapshotVersion.compareTo(Z.min())>0&&(l.readTime=ys(u,c.snapshotVersion.toTimestamp())),l})(this.R,n);var o=(function(u,c){var l=(function(f,d){switch(d){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return K()}})(0,c.purpose);return l==null?null:{"goog-listen-tags":l}})(this.R,n);o&&(i.labels=o),this.cr(i)},t.prototype.yr=function(n){var i={};i.database=bs(this.R),i.removeTarget=n,this.cr(i)},t})(wI),NR=(function(e){function t(n,i,o,u,c){var l=this;return(l=e.call(this,n,"write_stream_connection_backoff","write_stream_idle",i,o,c)||this).R=u,l.gr=!1,l}return $(t,e),Object.defineProperty(t.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,e.prototype.start.call(this)},t.prototype.ar=function(){this.gr&&this.Er([])},t.prototype.wr=function(n){return this.Hi.Oi("Write",n)},t.prototype.onMessage=function(n){if(W(!!n.streamToken),this.lastStreamToken=n.streamToken,this.gr){this.Zi.reset();var i=(function(u,c){return u&&u.length>0?(W(c!==void 0),u.map((function(l){return(function(f,d){var g=f.updateTime?he(f.updateTime):he(d);return g.isEqual(Z.min())&&(g=he(d)),new wC(g,f.transformResults||[])})(l,c)}))):[]})(n.writeResults,n.commitTime),o=he(n.commitTime);return this.listener.Tr(o,i)}return W(!n.writeResults||n.writeResults.length===0),this.gr=!0,this.listener.Ir()},t.prototype.Ar=function(){var n={};n.database=bs(this.R),this.cr(n)},t.prototype.Er=function(n){var i=this,o={streamToken:this.lastStreamToken,writes:n.map((function(u){return La(i.R,u)}))};this.cr(o)},t})(wI),CR=(function(e){function t(n,i,o){var u=this;return(u=e.call(this)||this).credentials=n,u.Hi=i,u.R=o,u.Rr=!1,u}return $(t,e),t.prototype.br=function(){if(this.Rr)throw new P(k.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.Ni=function(n,i,o){var u=this;return this.br(),this.credentials.getToken().then((function(c){return u.Hi.Ni(n,i,o,c)})).catch((function(c){throw c.name==="FirebaseError"?(c.code===k.UNAUTHENTICATED&&u.credentials.invalidateToken(),c):new P(k.UNKNOWN,c.toString())}))},t.prototype.$i=function(n,i,o){var u=this;return this.br(),this.credentials.getToken().then((function(c){return u.Hi.$i(n,i,o,c)})).catch((function(c){throw c.name==="FirebaseError"?(c.code===k.UNAUTHENTICATED&&u.credentials.invalidateToken(),c):new P(k.UNKNOWN,c.toString())}))},t.prototype.terminate=function(){this.Rr=!0},t})((function(){})),RR=(function(){function e(t,n){this.asyncQueue=t,this.onlineStateHandler=n,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return e.prototype.Sr=function(){var t=this;this.vr===0&&(this.Dr("Unknown"),this.Pr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(function(){return t.Pr=null,t.Cr("Backend didn't respond within 10 seconds."),t.Dr("Offline"),Promise.resolve()})))},e.prototype.Nr=function(t){this.state==="Online"?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.kr(),this.Cr("Connection failed 1 times. Most recent error: "+t.toString()),this.Dr("Offline")))},e.prototype.set=function(t){this.kr(),this.vr=0,t==="Online"&&(this.Vr=!1),this.Dr(t)},e.prototype.Dr=function(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))},e.prototype.Cr=function(t){var n="Could not reach Cloud Firestore backend. "+t+` 33This 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.Vr?(Rt(n),this.Vr=!1):M("OnlineStateTracker",n)},e.prototype.kr=function(){this.Pr!==null&&(this.Pr.cancel(),this.Pr=null)},e})(),DR=function(e,t,n,i,o){var u=this;this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.Fr=[],this.$r=new Map,this.Or=new Set,this.Mr=[],this.Lr=o,this.Lr.di((function(c){n.enqueueAndForget((function(){return A(u,void 0,void 0,(function(){return S(this,(function(l){switch(l.label){case 0:return Zn(this)?(M("RemoteStore","Restarting streams for network reach
33ability change."),[4,(function(f){return A(this,void 0,void 0,(function(){var d;return S(this,(function(g){switch(g.label){case 0:return(d=U(f)).Or.add(4),[4,oo(d)];case 1:return g.sent(),d.Br.set("Unknown"),d.Or.delete(4),[4,Hs(d)];case 2:return g.sent(),[2]}}))}))})(this)]):[3,2];case 1:l.sent(),l.label=2;case 2:return[2]}}))}))}))})),this.Br=new RR(n,i)};function Hs(e){return A(this,void 0,void 0,(function(){var t,n;return S(this,(function(i){switch(i.label){case 0:if(!Zn(e))return[3,4];t=0,n=e.Mr,i.label=1;case 1:return t<n.length?[4,(0,n[t])(!0)]:[3,4];case 2:i.sent(),i.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))}function oo(e){return A(this,void 0,void 0,(function(){var t,n;return S(this,(function(i){switch(i.label){case 0:t=0,n=e.Mr,i.label=1;case 1:return t<n.length?[4,(0,n[t])(!1)]:[3,4];case 2:i.sent(),i.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))}function vc(e,t){var n=U(e);n.$r.has(t.targetId)||(n.$r.set(t.targetId,t),id(n)?rd(n):uo(n).er()&&nd(n,t))}function Is(e,t){var n=U(e),i=uo(n);n.$r.delete(t),i.er()&&bI(n,t),n.$r.size===0&&(i.er()?i.ir():Zn(n)&&n.Br.set("Unknown"))}function nd(e,t){e.qr.U(t.targetId),uo(e).mr(t)}function bI(e,t){e.qr.U(t),uo(e).yr(t)}function rd(e){e.qr=new CC({getRemoteKeysForTarget:function(t){return e.remoteSyncer.getRemoteKeysForTarget(t)},lt:function(t){return e.$r.get(t)||null}}),uo(e).start(),e.Br.Sr()}function id(e){return Zn(e)&&!uo(e).tr()&&e.$r.size>0}function Zn(e){return U(e).Or.size===0}function II(e){e.qr=void 0}function OR(e){return A(this,void 0,void 0,(function(){return S(this,(function(t){return e.$r.forEach((function(n,i){nd(e,n)})),[2]}))}))}function PR(e,t){return A(this,void 0,void 0,(function(){return S(this,(function(n){return II(e),id(e)?(e.Br.Nr(t),rd(e)):e.Br.set("Unknown"),[2]}))}))}function xR(e,t,n){return A(this,void 0,void 0,(function(){var i,o,u;return S(this,(function(c){switch(c.label){case 0:if(e.Br.set("Online"),!(t instanceof K0&&t.state===2&&t.cause))return[3,6];c.label=1;case 1:return c.trys.push([1,3,,5]),[4,(function(l,f){return A(this,void 0,void 0,(function(){var d,g,y,w;return S(this,(function(I){switch(I.label){case 0:d=f.cause,g=0,y=f.targetIds,I.label=1;case 1:return g<y.length?(w=y[g],l.$r.has(w)?[4,l.remoteSyncer.rejectListen(w,d)]:[3,3]):[3,5];case 2:I.sent(),l.$r.delete(w),l.qr.removeTarget(w),I.label=3;case 3:I.label=4;case 4:return g++,[3,1];case 5:return[2]}}
33))}))})(e,t)];case 2:return c.sent(),[3,5];case 3:return i=c.sent(),M("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),i),[4,Va(e,i)];case 4:return c.sent(),[3,5];case 5:return[3,13];case 6:if(t instanceof va?e.qr.X(t):t instanceof B0?e.qr.rt(t):e.qr.et(t),n.isEqual(Z.min()))return[3,13];c.label=7;case 7:return c.trys.push([7,11,,13]),[4,dI(e.localStore)];case 8:return o=c.sent(),n.compareTo(o)>=0?[4,(function(l,f){var d=l.qr.ut(f);return d.targetChanges.forEach((function(g,y){if(g.resumeToken.approximateByteSize()>0){var w=l.$r.get(y);w&&l.$r.set(y,w.withResumeToken(g.resumeToken,f))}})),d.targetMismatches.forEach((function(g){var y=l.$r.get(g);if(y){l.$r.set(g,y.withResumeToken(ye.EMPTY_BYTE_STRING,y.snapshotVersion)),bI(l,g);var w=new pc(y.target,g,1,y.sequenceNumber);nd(l,w)}})),l.remoteSyncer.applyRemoteEvent(d)})(e,n)]:[3,10];case 9:c.sent(),c.label=10;case 10:return[3,13];case 11:return M("RemoteStore","Failed to raise snapshot:",u=c.sent()),[4,Va(e,u)];case 12:return c.sent(),[3,13];case 13:return[2]}}
33))}))}function Va(e,t,n){return A(this,void 0,void 0,(function(){var i=this;return S(this,(function(o){switch(o.label){case 0:if(!Wr(t))throw t;return e.Or.add(1),[4,oo(e)];case 1:return o.sent(),e.Br.set("Offline"),n||(n=function(){return dI(e.localStore)}),e.asyncQueue.enqueueRetryable((function(){return A(i,void 0,void 0,(function(){return S(this,(function(u){switch(u.label){case 0:return M("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return u.sent(),e.Or.delete(1),[4,Hs(e)];case 2:return u.sent(),[2]}}))}))})),[2]}}))}))}function TI(e,t){return t().catch((function(n){return Va(e,n,t)}))}function so(e){return A(this,void 0,void 0,(function(){var t,n,i,o,u;return S(this,(function(c){switch(c.label){case 0:t=U(e),n=Xn(t),i=t.Fr.length>0?t.Fr[t.Fr.length-1].batchId:-1,c.label=1;case 1:if(!(function(l){return Zn(l)&&l.Fr.length<10})(t))return[3,7];c.label=2;case 2:return c.trys.push([2,4,,6]),[4,fR(t.localStore,i)];case 3:return(o=c.sent())===null?(t.Fr.length===0&&n.ir(),[3,7]):(i=o.batchId,(function(l,f){l.Fr.push(f);var d=Xn(l);d.er()&&d.pr&&d.Er(f.mutations)})(t,o),[3,6]);case 4:return u=c.sent(),[4,Va(t,u)];case 5:return c.sent(),[3,6];case 6:return[3,1];case 7:return _I(t)&&EI(t),[2]}}))}))}function _I(e){return Zn(e)&&!Xn(e).tr()&&e.Fr.length>0}function EI(e){Xn(e).start()}function LR(e){return A(this,void 0,void 0,(function(){return S(this,(function(t){return Xn(e).Ar(),[2]}))}))}function MR(e){return A(this,void 0,void 0,(function(){var t,n,i,o;return S(this,(function(u){for(t=Xn(e),n=0,i=e.Fr;n<i.length;n++)o=i[n],t.Er(o.mutations);return[2]}))}))}function FR(e,t,n){return A(this,void 0,void 0,(function(){var i,o;return S(this,(function(u){switch(u.label){case 0:return i=e.Fr.shift(),o=$C.from(i,t,n),[4,TI(e,(function(){return e.remoteSyncer.applySuccessfulWrite(o)}))];case 1:return u.sent(),[4,so(e)];case 2:return u.sent(),[2]}}))}))}function UR(e,t){return A(this,void 0,void 0,(function(){return S(this,(function(n){switch(n.label){case 0:return t&&Xn(e).pr?[4,(function(i,o){return A(this,void 0,void 0,(function(){var u,c;return S(this,(function(l){switch(l.label){case 0:return V0(c=o.code)&&c!==k.ABORTED?(u=i.Fr.shift(),Xn(i).sr(),[4,TI(i,(function(){return i.remoteSyncer.rejectFailedWrite(u.batchId,o)}))]):[3,3];case 1:return l.sent(),[4,so(i)];case 2:l.sent(),l.label=3;case 3:return[2]}}
33))}))})(e,t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return _I(e)&&EI(e),[2]}}))}))}function rp(e,t){return A(this,void 0,void 0,(function(){var n;return S(this,(function(i){switch(i.label){case 0:return n=U(e),t?(n.Or.delete(2),[4,Hs(n)]):[3,2];case 1:return i.sent(),[3,5];case 2:return t?[3,4]:(n.Or.add(2),[4,oo(n)]);case 3:i.sent(),n.Br.set("Unknown"),i.label=4;case 4:i.label=5;case 5:return[2]}}))}))}function uo(e){var t=this;return e.Ur||(e.Ur=(function(n,i,o){var u=U(n);return u.br(),new kR(i,u.Hi,u.credentials,u.R,o)})(e.datastore,e.asyncQueue,{Ii:OR.bind(null,e),Ri:PR.bind(null,e),_r:xR.bind(null,e)}),e.Mr.push((function(n){return A(t,void 0,void 0,(function(){return S(this,(function(i){switch(i.label){case 0:return n?(e.Ur.sr(),id(e)?rd(e):e.Br.set("Unknown"),[3,3]):[3,1];case 1:return[4,e.Ur.stop()];case 2:i.sent(),II(e),i.label=3;case 3:return[2]}}))}))}))),e.Ur}function Xn(e){var t=this;return e.Kr||(e.Kr=(function(n,i,o){var u=U(n);return u.br(),new NR(i,u.Hi,u.credentials,u.R,o)})(e.datastore,e.asyncQueue,{Ii:LR.bind(null,e),Ri:UR.bind(null,e),Ir:MR.bind(null,e),Tr:FR.bind(null,e)}),e.Mr.push((function(n){return A(t,void 0,void 0,(function(){return S(this,(function(i){switch(i.label){case 0:return n?(e.Kr.sr(),[4,so(e)]):[3,2];case 1:return i.sent(),[3,4];case 2:return[4,e.Kr.stop()];case 3:i.sent(),e.Fr.length>0&&(M("RemoteStore","Stopping write stream with "+e.Fr.length+" pending writes"),e.Fr=[]),i.label=4;case 4:return[2]}}
33))}))}))),e.Kr}var jR=(function(){function e(t,n,i,o,u){this.asyncQueue=t,this.timerId=n,this.targetTimeMs=i,this.op=o,this.removalCallback=u,this.deferred=new we,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((function(c){}))}return e.createAndSchedule=function(t,n,i,o,u){var c=new e(t,n,Date.now()+i,o,u);return c.start(i),c},e.prototype.start=function(t){var n=this;this.timerHandle=setTimeout((function(){return n.handleDelayElapsed()}),t)},e.prototype.skipDelay=function(){return this.handleDelayElapsed()},e.prototype.cancel=function(t){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new P(k.CANCELLED,"Operation cancelled"+(t?": "+t:""))))},e.prototype.handleDelayElapsed=function(){var t=this;this.asyncQueue.enqueueAndForget((function(){return t.timerHandle!==null?(t.clearTimeout(),t.op().then((function(n){return t.deferred.resolve(n)}))):Promise.resolve()}))},e.prototype.clearTimeout=function(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},e})();function ao(e,t){if(Rt("AsyncQueue",t+": "+e),Wr(e))return new P(k.UNAVAILABLE,t+": "+e);throw e}var SI=(function(){function e(t){this.comparator=t?function(n,i){return t(n,i)||G.comparator(n.key,i.key)}:function(n,i){return G.comparator(n.key,i.key)},this.keyedMap=Zf(),this.sortedSet=new Zt(this.comparator)}return e.emptySet=function(t){return new e(t.comparator)},e.prototype.has=function(t){return this.keyedMap.get(t)!=null},e.prototype.get=function(t){return this.keyedMap.get(t)},e.prototype.first=function(){return this.sortedSet.minKey()},e.prototype.last=function(){return this.sortedSet.maxKey()},e.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},e.prototype.indexOf=function(t){var n=this.keyedMap.get(t);return n?this.sortedSet.indexOf(n):-1},Object.defineProperty(e.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),e.prototype.forEach=function(t){this.sortedSet.inorderTraversal((function(n,i){return t(n),!1}))},e.prototype.add=function(t){var n=this.delete(t.key);return n.copy(n.keyedMap.insert(t.key,t),n.sortedSet.insert(t,null))},e.prototype.delete=function(t){var n=this.get(t);return n?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(n)):this},e.prototype.isEqual=function(t){if(!(t instanceof e)||this.size!==t.size)return!1;for(var n=this.sortedSet.getIterator(),i=t.sortedSet.getIterator();n.hasNext();){var o=n.getNext().key,u=i.getNext().key;if(!o.isEqual(u))return!1}return!0},e.prototype.toString=function(){var t=[];return this.forEach((function(n){t.push(n.toString())})),t.length===0?"DocumentSet ()":`DocumentSet ( 34 `+t.join(` 35`)+` 36)`},e.prototype.copy=function(t,n){var i=new e;return i.comparator=this.comparator,i.keyedMap=t,i.sortedSet=n,i},e})(),Dw=(function(){function e(){this.Qr=new Zt(G.comparator)}return e.prototype.track=function(t){var n=t.doc.key,i=this.Qr.get(n);i?t.type!==0&&i.type===3?this.Qr=this.Qr.insert(n,t):t.type===3&&i.type!==1?this.Qr=this.Qr.insert(n,{type:i.type,doc:t.doc}):t.type===2&&i.type===2?this.Qr=this.Qr.insert(n,{type:2,doc:t.doc}):t.type===2&&i.type===0?this.Qr=this.Qr.insert(n,{type:0,doc:t.doc}):t.type===1&&i.type===0?this.Qr=this.Qr.remove(n):t.type===1&&i.type===2?this.Qr=this.Qr.insert(n,{type:1,doc:i.doc}):t.type===0&&i.type===1?this.Qr=this.Qr.insert(n,{type:2,doc:t.doc}):K():this.Qr=this.Qr.insert(n,t)},e.prototype.jr=function(){var t=[];return this.Qr.inorderTraversal((function(n,i){t.push(i)})),t},e})(),qa=(function(){function e(t,n,i,o,u,c,l,f){this.query=t,this.docs=n,this.oldDocs=i,this.docChanges=o,this.mutatedKeys=u,this.fromCache=c,this.syncStateChanged=l,this.excludesMetadataChanges=f}return e.fromInitialDocuments=function(t,n,i,o){var u=[];return n.forEach((function(c){u.push({type:0,doc:c})})),new e(t,n,SI.emptySet(n),u,i,o,!0,!1)},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&js(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;var n=this.docChanges,i=t.docChanges;if(n.length!==i.length)return!1;for(var o=0;o<n.length;o++)if(n[o].type!==i[o].type||!n[o].doc.isEqual(i[o].doc))return!1;return!0},e})(),VR=function(){this.Wr=void 0,this.listeners=[]},qR=function(){this.queries=new io((function(e){return R0(e)}),js),this.onlineState="Unknown",this.Gr=new Set};function od(e,t){return A(this,void 0,void 0,(function(){var n,i,o,u,c,l,f;return S(this,(function(d){switch(d.label){case 0:if(n=U(e),i=t.query,o=!1,(u=n.queries.get(i))||(o=!0,u=new VR
36),!o)return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),c=u,[4,n.onListen(i)];case 2:return c.Wr=d.sent(),[3,4];case 3:return l=d.sent(),f=ao(l,"Initialization of query '"+Yf(t.query)+"' failed"),[2,void t.onError(f)];case 4:return n.queries.set(i,u),u.listeners.push(t),t.zr(n.onlineState),u.Wr&&t.Hr(u.Wr)&&ud(n),[2]}}))}))}function sd(e,t){return A(this,void 0,void 0,(function(){var n,i,o,u,c;return S(this,(function(l){return n=U(e),i=t.query,o=!1,(u=n.queries.get(i))&&(c=u.listeners.indexOf(t))>=0&&(u.listeners.splice(c,1),o=u.listeners.length===0),o?[2,(n.queries.delete(i),n.onUnlisten(i))]:[2]}))}))}function BR(e,t){for(var n=U(e),i=!1,o=0,u=t;o<u.length;o++){var c=u[o],l=c.query,f=n.queries.get(l);if(f){for(var d=0,g=f.listeners;d<g.length;d++)g[d].Hr(c)&&(i=!0);f.Wr=c}}i&&ud(n)}function KR(e,t,n){var i=U(e),o=i.queries.get(t);if(o)for(var u=0,c=o.listeners;u<c.length;u++)c[u].onError(n);i.queries.delete(t)}function ud(e){e.Gr.forEach((function(t){t.next()}))}var ad=(function(){function e(t,n,i){this.query=t,this.Jr=n,this.Yr=!1,this.Xr=null,this.onlineState="Unknown",this.options=i||{}}return e.prototype.Hr=function(t){if(!this.options.includeMetadataChanges){for(var n=[],i=0,o=t.docChanges;i<o.length;i++){var u=o[i];u.type!==3&&n.push(u)}t=new qa(t.query,t.docs,t.oldDocs,n,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}var c=!1;return this.Yr?this.Zr(t)&&(this.Jr.next(t),c=!0):this.eo(t,this.onlineState)&&(this.no(t),c=!0),this.Xr=t,c},e.prototype.onError=function(t){this.Jr.error(t)},e.prototype.zr=function(t){this.onlineState=t;var n=!1;return this.Xr&&!this.Yr&&this.eo(this.Xr,t)&&(this.no(this.Xr),n=!0),n},e.prototype.eo=function(t,n){if(!t.fromCache)return!0;var i=n!=="Offline";return!(this.options.so&&i||t.docs.isEmpty()&&n!=="Offline")},e.prototype.Zr=function(t){if(t.docChanges.length>0)return!0;var n=this.Xr&&this.Xr.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0},e.prototype.no=function(t){t=qa.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.Yr=!0,this.Jr.next(t)},e})();var AI=function(e){this.key=e},kI=function(e){this.key=e},NI=(function(){function e(t,n){this.query=t,this.uo=n,this.ao=null,this.current=!1,this.ho=ft(),this.mutatedKeys=ft(),this.lo=D0(t),this.fo=new SI(this.lo)}return Object.defineProperty(e.prototype,"wo",{get:function(){return this.uo},enumerable:!1,configurable:!0}),e.prototype._o=function(t,n){var i=this,o=n?n.mo:new Dw,u=n?n.fo:this.fo,c=n?n.mutatedKeys:this.mutatedKeys,l=u,f=!1,d=pa(this.query)&&u.size===this.query.limit?u.last():null,g=xa(this.query)&&u.size===this.query.limit?u.first():null;if(t.inorderTraversal((function(w,I){var T=u.get(w),E=Vs(i.query,I)?I:null,N=!!T&&i.mutatedKeys.has(T.key),D=!!E&&(E.hasLocalMutations||i.mutatedKeys.has(E.key)&&E.hasCommittedMutations),F=!1;T&&E?T.data.isEqual(E.data)?N!==D&&(o.track({type:3,doc:E}),F=!0):i.yo(T,E)||(o.track({type:2,doc:E}),F=!0,(d&&i.lo(E,d)>0||g&&i.lo(E,g)<0)&&(f=!0)):!T&&E?(o.track({type:0,doc:E}),F=!0):T&&!E&&(o.track({type:1,doc:T}),F=!0,(d||g)&&(f=!0)),F&&(E?(l=l.add(E),c=D?c.add(w):c.delete(w)):(l=l.delete(w),c=c.delete(w)))})),pa(this.query)||xa(this.query))for(;l.size>this.query.limit;){var y=pa(this.query)?l.last():l.first();l=l.delete(y.key),c=c.delete(y.key),o.track({type:1,doc:y})}return{fo:l,mo:o,Nn:f,mutatedKeys:c}},e.prototype.yo=function(t,n){return t.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations},e.prototype.applyChanges=function(t,n,i){var o=this,u=this.fo;this.fo=t.fo,this.mutatedKeys=t.mutatedKeys;var c=t.mo.jr();c.sort((function(g,y){return(function(w,I){var T=function(E){switch(E){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return K()}};return T(w)-T(I)})(g.type,y.type)||o.lo(g.doc,y.doc)})),this.po(i);var l=n?this.Eo():[],f=this.ho.size===0&&this.current?1:0,d=f!==this.ao;return this.ao=f,c.length!==0||d?{snapshot:new qa(this.query,t.fo,u,c,t.mutatedKeys,f===0,d,!1),To:l}:{To:l}},e.prototype.zr=function(t){return this.current&&t==="Offline"?(this.current=!1,this.applyChanges({fo:this.fo,mo:new Dw,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},e.prototype.Io=function(t){return!this.uo.has(t)&&!!this.fo.has(t)&&!this.fo.get(t).hasLocalMutations},e.prototype.po=function(t){var n=this;
36t&&(t.addedDocuments.forEach((function(i){return n.uo=n.uo.add(i)})),t.modifiedDocuments.forEach((function(i){})),t.removedDocuments.forEach((function(i){return n.uo=n.uo.delete(i)})),this.current=t.current)},e.prototype.Eo=function(){var t=this;if(!this.current)return[];var n=this.ho;this.ho=ft(),this.fo.forEach((function(o){t.Io(o.key)&&(t.ho=t.ho.add(o.key))}));var i=[];return n.forEach((function(o){t.ho.has(o)||i.push(new kI(o))})),this.ho.forEach((function(o){n.has(o)||i.push(new AI(o))})),i},e.prototype.Ao=function(t){this.uo=t.Bn,this.ho=ft();var n=this._o(t.documents);return this.applyChanges(n,!0)},e.prototype.Ro=function(){return qa.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,this.ao===0)},e})(),HR=function(e,t,n){this.query=e,this.targetId=t,this.view=n},GR=function(e){this.key=e,this.bo=!1},zR=(function(){function e(t,n,i,o,u,c){this.localStore=t,this.remoteStore=n,this.eventManager=i,this.sharedClientState=o,this.currentUser=u,this.maxConcurrentLimboResolutions=c,this.vo={},this.Po=new i
36o((function(l){return R0(l)}),js),this.Vo=new Map,this.So=new Set,this.Do=new Zt(G.comparator),this.Co=new Map,this.No=new td,this.xo={},this.ko=new Map,this.Fo=Fa.Yt(),this.onlineState="Unknown",this.$o=void 0}return Object.defineProperty(e.prototype,"isPrimaryClient",{get:function(){return this.$o===!0},enumerable:!1,configurable:!0}),e})();function $R(e,t){return A(this,void 0,void 0,(function(){var n,i,o,u,c,l;return S(this,(function(f){switch(f.label){case 0:return n=pd(e),(u=n.Po.get(t))?(i=u.targetId,n.sharedClientState.addLocalQueryTarget(i),o=u.view.Ro(),[3,4]):[3,1];case 1:return[4,Ua(n.localStore,ln(t))];case 2:return c=f.sent(),l=n.sharedClientState.addLocalQueryTarget(c.targetId),i=c.targetId,[4,cd(n,t,i,l==="current")];case 3:o=f.sent(),n.isPrimaryClient&&vc(n.remoteStore,c),f.label=4;case 4:return[2,o]}}))}))}function cd(e,t,n,i){return A(this,void 0,void 0,(function(){var o,u,c,l,f,d;return S(this,(function(g){switch(g.label){case 0:return e.Oo=function(y,w,I){return(function(T,E,N,D){return A(this,void 0,void 0,(function(){var F,C,B;return S(this,(function(x){switch(x.label){case 0:return F=E.view._o(N),F.Nn?[4,ja(T.localStore,E.query,!1).then((function(Y){var _=Y.documents;return E.view._o(_,F)}))]:[3,2];case 1:F=x.sent(),x.label=2;case 2:return C=D&&D.targetChanges.get(E.targetId),B=E.view.applyChanges(F,T.isPrimaryClient,C),[2,(ip(T,E.targetId,B.To),B.snapshot)]}}))}))})(e,y,w,I)},[4,ja(e.localStore,t,!0)];case 1:return o=g.sent(),u=new NI(t,o.Bn),c=u._o(o.documents),l=$p.createSynthesizedTargetChangeForCurrentChange(n,i&&e.onlineState!=="Offline"),f=u.applyChanges(c,e.isPrimaryClient,l),ip(e,n,f.To),d=new HR(t,n,u),[2,(e.Po.set(t,d),e.Vo.has(n)?e.Vo.get(n).push(t):e.Vo.set(n,[t]),f.snapshot)]}}))}))}function WR(e,t){return A(this,void 0,void 0,(function(){var n,i,o;return S(this,(function(u){switch(u.label){case 0:return n=U(e),i=n.Po.get(t),(o=n.Vo.get(i.targetId)).length>1?[2,(n.Vo.set(i.targetId,o.filter((function(c){return!js(c,t)}))),void n.Po.delete(t))]:n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(i.targetId),n.sharedClientState.isActiveQueryTarget(i.targetId)?[3,2]:[4,Qi(n.localStore,i.targetId,!1).then((function(){n.sharedClientState.clearQueryState(i.targetId),Is(n.remoteStore,i.targetId),Yi(n,i.targetId)})).catch(Xr)]):[3,3];case 1:u.sent(),u.label=2;case 2:return[3,5];case 3:return Yi(n,i.targetId),[4,Qi(n.localStore,i.targetId,!0)];case 4:u.sent(),u.label=5;case 5:return[2]}}
36))}))}function XR(e,t,n){return A(this,void 0,void 0,(function(){var i,o,u,c;return S(this,(function(l){switch(l.label){case 0:i=dd(e),l.label=1;case 1:return l.trys.push([1,5,,6]),[4,(function(f,d){var g,y=U(f),w=me.now(),I=d.reduce((function(T,E){return T.add(E.key)}),ft());return y.persistence.runTransaction("Locally write mutations","readwrite",(function(T){return y.Mn.pn(T,I).next((function(E){g=E;for(var N=[],D=0,F=d;D<F.length;D++){var C=F[D],B=IC(C,g.get(C.key));B!=null&&N.push(new Jn(C.key,B,A0(B.value.mapValue),Qt.exists(!0)))}return y._n.addMutationBatch(T,w,N,d)}))})).then((function(T){return T.applyToLocalDocumentSet(g),{batchId:T.batchId,changes:g}}))})(i.localStore,t)];case 2:return o=l.sent(),i.sharedClientState.addPendingMutation(o.batchId),(function(f,d,g){var y=f.xo[f.currentUser.toKey()];y||(y=new Zt(rt)),y=y.insert(d,g),f.xo[f.currentUser.toKey()]=y})(i,o.batchId,n),[4,tr(i,o.changes)];case 3:return l.sent(),[4,so(i.remoteStore)];case 4:return l.sent(),[3,6];case 5:return u=l.sent(),c=ao(u,"Failed to persist write"),n.reject(c),[3,6];case 6:return[2]}}
36))}))}function CI(e,t){return A(this,void 0,void 0,(function(){var n,i;return S(this,(function(o){switch(o.label){case 0:n=U(e),o.label=1;case 1:return o.trys.push([1,4,,6]),[4,hR(n.localStore,t)];case 2:return i=o.sent(),t.targetChanges.forEach((function(u,c){var l=n.Co.get(c);l&&(W(u.addedDocuments.size+u.modifiedDocuments.size+u.removedDocuments.size<=1),u.addedDocuments.size>0?l.bo=!0:u.modifiedDocuments.size>0?W(l.bo):u.removedDocuments.size>0&&(W(l.bo),l.bo=!1))})),[4,tr(n,i,t)];case 3:return o.sent(),[3,6];case 4:return[4,Xr(o.sent())];case 5:return o.sent(),[3,6];case 6:return[2]}}))}))}function Ow(e,t,n){var i=U(e);if(i.isPrimaryClient&&n===0||!i.isPrimaryClient&&n===1){var o=[];i.Po.forEach((function(u,c){var l=c.view.zr(t);l.snapshot&&o.push(l.snapshot)})),(function(u,c){var l=U(u);l.onlineState=c;var f=!1;l.queries.forEach((function(d,g){for(var y=0,w=g.listeners;y<w.length;y++)w[y].zr(c)&&(f=!0)})),f&&ud(l)})(i.eventManager,t),o.length&&i.vo._r(o),i.onlineState=t,i.isPrimaryClient&&i.sharedClientState.setOnlineState(t)}}function QR(e,t,n){return A(this,void 0,void 0,(function(){var i,o,u,c,l,f;return S(this,(function(d){switch(d.label){case 0:return(i=U(e)).sharedClientState.updateQueryState(t,"rejected",n),o=i.Co.get(t),(u=o&&o.key)?(c=(c=new Zt(G.comparator)).insert(u,Jt.newNoDocument(u,Z.min())),l=ft().add(u),f=new zp(Z.min(),new Map,new Mt(rt),c,l),[4,CI(i,f)]):[3,2];case 1:return d.sent(),i.Do=i.Do.remove(u),i.Co.delete(t),fd(i),[3,4];case 2:return[4,Qi(i.localStore,t,!1).then((function(){return Yi(i,t,n)})).catch(Xr)];case 3:d.sent(),d.label=4;case 4:return[2]}}
36))}))}function YR(e,t){return A(this,void 0,void 0,(function(){var n,i,o;return S(this,(function(u){switch(u.label){case 0:n=U(e),i=t.batch.batchId,u.label=1;case 1:return u.trys.push([1,4,,6]),[4,cR(n.localStore,t)];case 2:return o=u.sent(),ld(n,i,null),hd(n,i),n.sharedClientState.updateMutationState(i,"acknowledged"),[4,tr(n,o)];case 3:return u.sent(),[3,6];case 4:return[4,Xr(u.sent())];case 5:return u.sent(),[3,6];case 6:return[2]}}))}))}function JR(e,t,n){return A(this,void 0,void 0,(function(){var i,o;return S(this,(function(u){switch(u.label){case 0:i=U(e),u.label=1;case 1:return u.trys.push([1,4,,6]),[4,(function(c,l){var f=U(c);return f.persistence.runTransaction("Reject batch","readwrite-primary",(function(d){var g;return f._n.lookupMutationBatch(d,l).next((function(y){return W(y!==null),g=y.keys(),f._n.removeMutationBatch(d,y)})).next((function(){return f._n.performConsistencyCheck(d)})).next((function(){return f.Mn.pn(d,g)}))}))})(i.localStore,t)];case 2:return o=u.sent(),ld(i,t,n),hd(i,t),i.sharedClientState.updateMutationState(t,"rejected",n),[4,tr(i,o)];case 3:return u.sent(),[3,6];case 4:return[4,Xr(u.sent())];case 5:return u.sent(),[3,6];case 6:return[2]}}
36))}))}function ZR(e,t){return A(this,void 0,void 0,(function(){var n,i,o,u,c;return S(this,(function(l){switch(l.label){case 0:Zn((n=U(e)).remoteStore)||M("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,(function(f){var d=U(f);return d.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(g){return d._n.getHighestUnacknowledgedBatchId(g)}))})(n.localStore)];case 2:return(i=l.sent())===-1?[2,void t.resolve()]:((o=n.ko.get(i)||[]).push(t),n.ko.set(i,o),[3,4]);case 3:return u=l.sent(),c=ao(u,"Initialization of waitForPendingWrites() operation failed"),t.reject(c),[3,4];case 4:return[2]}}))}))}function hd(e,t){(e.ko.get(t)||[]).forEach((function(n){n.resolve()})),e.ko.delete(t)}function ld(e,t,n){var i=U(e),o=i.xo[i.currentUser.toKey()];if(o){var u=o.get(t);u&&(n?u.reject(n):u.resolve(),o=o.remove(t)),i.xo[i.currentUser.toKey()]=o}}function Yi(e,t,n){n===void 0&&(n=null),e.sharedClientState.removeLocalQueryTarget(t);for(var i=0,o=e.Vo.get(t);i<o.length;i++){var u=o[i];e.Po.delete(u),n&&e.vo.Mo(u,n)}e.Vo.delete(t),e.isPrimaryClient&&e.No.Zn(t).forEach((function(c){e.No.containsKey(c)||RI(e,c)}))}function RI(e,t){e.So.delete(t.path.canonicalString());var n=e.Do.get(t);n!==null&&(Is(e.remoteStore,n),e.Do=e.Do.remove(t),e.Co.delete(n),fd(e))}function ip(e,t,n){for(var i=0,o=n;i<o.length;i++){var u=o[i];u instanceof AI?(e.No.addReference(u.key,t),tD(e,u)):u instanceof kI?(M("SyncEngine","Document no longer in limbo: "+u.key),e.No.removeReference(u.key,t),e.No.containsKey(u.key)||RI(e,u.key)):K()}}function tD(e,t){var n=t.key,i=n.path.canonicalString();e.Do.get(n)||e.So.has(i)||(M("SyncEngine","New document in limbo: "+n),e.So.add(i),fd(e))}function fd(e){for(;e.So.size>0&&e.Do.size<e.maxConcurrentLimboResolutions;){var t=e.So.values().next().value;e.So.delete(t);var n=new G(st.fromString(t)),i=e.Fo.next();e.Co.set(i,new GR(n)),e.Do=e.Do.insert(n,i),vc(e.remoteStore,new pc(ln(Us(n.path)),i,2,Ne.o))}}function tr(e,t,n){return A(this,void 0,void 0,(function(){var i,o,u,c;return S(this,(function(l){switch(l.label){case 0:return i=U(e),o=[],u=[],c=[],i.Po.isEmpty()?[3,3]:(i.Po.forEach((function(f,d){c.push(i.Oo(d,t,n).then((function(g){if(g){i.isPrimaryClient&&i.sharedClientState.updateQueryState(d.targetId,g.fromCache?"not-current":"current"),o.push(g);var y=uR.Pn(d.targetId,g);u.push(y)}})))})),[4,Promise.all(c)]);case 1:return l.sent(),i.vo._r(o),[4,(function(f,d){return A(this,void 0,void 0,(function(){var g,y,w,I,T,E,N,D,F;return S(this,(function(C){switch(C.label){case 0:g=U(f),C.label=1;case 1:return C.trys.push([1,3,,4]),[4,g.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(B){return L.forEach(d,(function(x){return L.forEach(x.bn,(function(Y){return g.persistence.referenceDelegate.addReference(B,x.targetId,Y)})).next((function(){return L.forEach(x.vn,(function(Y){return g.persistence.referenceDelegate.removeReference(B,x.targetId,Y)}))}))}))}))];case 2:return C.sent(),[3,4];case 3:if(!Wr(y=C.sent()))throw y;return M("LocalStore","Failed to update sequence numbers: "+y),[3,4];case 4:for(w=0,I=d;w<I.length;w++)T=I[w],E=T.targetId,T.fromCache||(N=g.kn.get(E),D=N.snapshotVersion,F=N.withLastLimboFreeSnapshotVersion(D),g.kn=g.kn.insert(E,F));return[2]}}))}))})(i.localStore,u)];case 2:l.sent(),l.label=3;case 3:return[2]}}
36))}))}function eD(e,t){return A(this,void 0,void 0,(function(){var n,i;return S(this,(function(o){switch(o.label){case 0:return(n=U(e)).currentUser.isEqual(t)?[3,3]:(M("SyncEngine","User change. New user:",t.toKey()),[4,pI(n.localStore,t)]);case 1:return i=o.sent(),n.currentUser=t,(function(u,c){u.ko.forEach((function(l){l.forEach((function(f){f.reject(new P(k.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),u.ko.clear()})(n),n.sharedClientState.handleUserChange(t,i.removedBatchIds,i.addedBatchIds),[4,tr(n,i.Ln)];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))}function nD(e,t){var n=U(e),i=n.Co.get(t);if(i&&i.bo)return ft().add(i.key);var o=ft(),u=n.Vo.get(t);if(!u)return o;for(var c=0,l=u;c<l.length;c++){var f=l[c],d=n.Po.get(f);o=o.unionWith(d.view.wo)}return o}function rD(e,t){return A(this,void 0,void 0,(function(){var n,i,o;return S(this,(function(u){switch(u.label){case 0:return[4,ja((n=U(e)).localStore,t.query,!0)];case 1:return i=u.sent(),o=t.view.Ao(i),[2,(n.isPrimaryClient&&ip(n,t.targetId,o.To),o)]}}))}))}function iD(e){return A(this,void 0,void 0,(function(){var t;return S(this,(function(n){return[2,gI((t=U(e)).localStore).then((function(i){return tr(t,i)}))]}))}))}function oD(e,t,n,i){return A(this,void 0,void 0,(function(){var o,u;return S(this,(function(c){switch(c.label){case 0:return[4,(function(l,f){var d=U(l),g=U(d._n);return d.persistence.runTransaction("Lookup mutation documents","readonly",(function(y){return g.jt(y,f).next((function(w){return w?d.Mn.pn(y,w):L.resolve(null)}))}))})((o=U(e)).localStore,t)];case 1:return(u=c.sent())===null?[3,6]:n!=="pending"?[3,3]:[4,so(o.remoteStore)];case 2:return c.sent(),[3,4];case 3:n==="acknowledged"||n==="rejected"?(ld(o,t,i||null),hd(o,t),(function(l,f){U(U(l)._n).Gt(f)})(o.localStore,t)):K(),c.label=4;case 4:return[4,tr(o,u)];case 5:return c.sent(),[3,7];case 6:M("SyncEngine","Cannot apply mutation batch with id: "+t),c.label=7;case 7:return[2]}}
36))}))}function sD(e,t){return A(this,void 0,void 0,(function(){var n,i,o,u,c,l,f,d;return S(this,(function(g){switch(g.label){case 0:return pd(n=U(e)),dd(n),t!==!0||n.$o===!0?[3,3]:(i=n.sharedClientState.getAllActiveQueryTargets(),[4,Pw(n,i.toArray())]);case 1:return o=g.sent(),n.$o=!0,[4,rp(n.remoteStore,!0)];case 2:for(g.sent(),u=0,c=o;u<c.length;u++)l=c[u],vc(n.remoteStore,l);return[3,7];case 3:return t!==!1||n.$o===!1?[3,7]:(f=[],d=Promise.resolve(),n.Vo.forEach((function(y,w){n.sharedClientState.isLocalQueryTarget(w)?f.push(w):d=d.then((function(){return Yi(n,w),Qi(n.localStore,w,!0)})),Is(n.remoteStore,w)})),[4,d]);case 4:return g.sent(),[4,Pw(n,f)];case 5:return g.sent(),(function(y){var w=U(y);w.Co.forEach((function(I,T){Is(w.remoteStore,T)})),w.No.ts(),w.Co=new Map,w.Do=new Zt(G.comparator)})(n),n.$o=!1,[4,rp(n.remoteStore,!1)];case 6:g.sent(),g.label=7;case 7:return[2]}}))}))}function Pw(e,t,n){return A(this,void 0,void 0,(function(){var i,o,u,c,l,f,d,g,y,w,I,T,E,N;return S(this,(function(D){switch(D.label){case 0:i=U(e),o=[],u=[],c=0,l=t,D.label=1;case 1:return c<l.length?(f=l[c],d=void 0,(g=i.Vo.get(f))&&g.length!==0?[4,Ua(i.localStore,ln(g[0]))]:[3,7]):[3,13];case 2:d=D.sent(),y=0,w=g,D.label=3;case 3:return y<w.length?(I=w[y],T=i.Po.get(I),[4,rD(i,T)]):[3,6];case 4:(E=D.sent()).snapshot&&u.push(E.snapshot),D.label=5;case 5:return y++,[3,3];case 6:return[3,11];case 7:return[4,vI(i.localStore,f)];case 8:return N=D.sent(),[4,Ua(i.localStore,N)];case 9:return d=D.sent(),[4,cd(i,DI(N),f,!1)];case 10:D.sent(),D.label=11;case 11:o.push(d),D.label=12;case 12:return c++,[3,1];case 13:return[2,(i.vo._r(u),o)]}}))}))}function DI(e){return N0(e.path,e.collectionGroup,e.orderBy,e.filters,e.limit,"F",e.startAt,e.endAt)}function uD(e){var t=U(e);return U(U(t.localStore).persistence).fn()}function aD(e,t,n,i){return A(this,void 0,void 0,(function(){var o,u,c;return S(this,(function(l){switch(l.label){case 0:return(o=U(e)).$o?(M("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!o.Vo.has(t))return[3,8];switch(n){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,gI(o.localStore)];case 3:return u=l.sent(),c=zp.createSynthesizedRemoteEventForCurrentChange(t,n==="current"),[4,tr(o,u,c)];case 4:return l.sent(),[3,8];case 5:return[4,Qi(o.localStore,t,!0)];case 6:return l.sent(),Yi(o,t,i),[3,8];case 7:K(),l.label=8;case 8:return[2]}}
36))}))}function cD(e,t,n){return A(this,void 0,void 0,(function(){var i,o,u,c,l,f,d,g,y,w;return S(this,(function(I){switch(I.label){case 0:if(!(i=pd(e)).$o)return[3,10];o=0,u=t,I.label=1;case 1:return o<u.length?(c=u[o],i.Vo.has(c)?(M("SyncEngine","Adding an already active target "+c),[3,5]):[4,vI(i.localStore,c)]):[3,6];case 2:return l=I.sent(),[4,Ua(i.localStore,l)];case 3:return f=I.sent(),[4,cd(i,DI(l),f.targetId,!1)];case 4:I.sent(),vc(i.remoteStore,f),I.label=5;case 5:return o++,[3,1];case 6:d=function(T){return S(this,(function(E){switch(E.label){case 0:return i.Vo.has(T)?[4,Qi(i.localStore,T,!1).then((function(){Is(i.remoteStore,T),Yi(i,T)})).catch(Xr)]:[3,2];case 1:E.sent(),E.label=2;case 2:return[2]}}))},g=0,y=n,I.label=7;case 7:return g<y.length?(w=y[g],[5,d(w)]):[3,10];case 8:I.sent(),I.label=9;case 9:return g++,[3,7];case 10:return[2]}}))}))}function pd(e){var t=U(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=CI.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=nD.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=QR.bind(null,t),t.vo._r=BR.bind(null,t.eventManager),t.vo.Mo=KR.bind(null,t.eventManager),t}function dd(e){var t=U(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=YR.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=JR.bind(null,t),t}var OI=(function(){function e(){this.synchronizeTabs=!1}return e.prototype.initialize=function(t){return A(this,void 0,void 0,(function(){return S(this,(function(n){switch(n.label){case 0:return this.R=dc(t.databaseInfo.databaseId),this.sharedClientState=this.Bo(t),this.persistence=this.qo(t),[4,this.persistence.start()];case 1:return n.sent(),this.gcScheduler=this.Uo(t),this.localStore=this.Ko(t),[2]}}))}))},e.prototype.Uo=function(t){return null},e.prototype.Ko=function(t){return fI(this.persistence,new lI,t.initialUser,this.R)},e.prototype.qo=function(t){return new wR(IR.bs,this.R)},e.prototype.Bo=function(t){return new mI},e.prototype.terminate=function(){return A(this,void 0,void 0,(function(){return S(this,(function(t){switch(t.label){case 0:return this.gcScheduler&&this.gcScheduler.stop(),[4,this.sharedClientState.shutdown()];case 1:return t.sent(),[4,this.persistence.shutdown()];case 2:return t.sent(),[2]}}))}))},e})(),PI=(function(e){function t(n,i,o){var u=this;return(u=e.call(this)||this).Qo=n,u.cacheSizeBytes=i,u.forceOwnership=o,u.synchronizeTabs=!1,u}return $(t,e),t.prototype.initialize=function(n){return A(this,void 0,void 0,(function(){var i=this;return S(this,(function(o){switch(o.label){case 0:return[4,e.prototype.initialize.call(this,n)];case 1:return o.sent(),[4,pR(this.localStore)];case 2:return o.sent(),[4,this.Qo.initialize(this,n)];case 3:return o.sent(),[4,dd(this.Qo.syncEngine)];case 4:return o.sent(),[4,so(this.Qo.remoteStore)];case 5:return o.sent(),[4,this.persistence.He((function(){return i.gcScheduler&&!i.gcScheduler.started&&i.gcScheduler.start(i.localStore),Promise.resolve()}))];case 6:return o.sent(),[2]}}))}))},t.prototype.Ko=function(n){return fI(this.persistence,new lI,n.initialUser,this.R)},t.prototype.Uo=function(n){var i=this.persistence.referenceDelegate.garbageCollector;return new tR(i,n.asyncQueue)},t.prototype.qo=function(n){var i=Zp(n.databaseInfo.databaseId,n.databaseInfo.persistenceKey),o=this.cacheSizeBytes!==void 0?sn.withCacheSize(this.cacheSizeBytes):sn.DEFAULT;return new sR(this.synchronizeTabs,i,n.clientId,o,n.asyncQueue,yI(),ga(),this.R,this.sharedClientState,!!this.forceOwnership)},t.prototype.Bo=function(n){return new mI},t})(OI),hD=(function(e){function t(n,i){var o=this;return(o=e.call(this,n,i,!1)||this).Qo=n,o.cacheSizeBytes=i,o.synchronizeTabs=!0,o}return $(t,e),t.prototype.initialize=function(n){return A(this,void 0,void 0,(function(){var i,o=this;return S(this,(function(u){switch(u.label){case 0:return[4,e.prototype.initialize.call(this,n)];case 1:return u.sent(),i=this.Qo.syncEngine,this.sharedClientState instanceof Af?(this.sharedClientState.syncEngine={ui:oD.bind(null,i),ai:aD.bind(null,i),hi:cD.bind(null,i),fn:uD.bind(null,i),ci:iD.bind(null,i)},[4,this.sharedClientState.start()]):[3,3];case 2:u.sent(),u.label=3;case 3:return[4,this.persistence.He((function(c){return A(o,void 0,void 0,(function(){return S(this,(function(l){switch(l.label){case 0:return[4,sD(this.Qo.syncEngine,c)];case 1:return l.sent(),this.gcScheduler&&(c&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):c||this.gcScheduler.stop()),[2]}}))}))}))];case 4:return u.sent(),[2]}}))}))},t.prototype.Bo=function(n){var i=yI();
36if(!Af.yt(i))throw new P(k.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var o=Zp(n.databaseInfo.databaseId,n.databaseInfo.persistenceKey);return new Af(i,n.asyncQueue,o,n.clientId,n.initialUser)},t})(PI),op=(function(){function e(){}return e.prototype.initialize=function(t,n){return A(this,void 0,void 0,(function(){var i=this;return S(this,(function(o){switch(o.label){case 0:return this.localStore?[3,2]:(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=function(u){return Ow(i.syncEngine,u,1)},this.remoteStore.remoteSyncer.handleCredentialChange=eD.bind(null,this.syncEngine),[4,rp(this.remoteStore,this.syncEngine.isPrimaryClient)]);case 1:o.sent(),o.label=2;case 2:return[2]}}))}))},e.prototype.createEventManager=function(t){return new qR},e.prototype.createDatastore=function(t){var n,i=dc(t.databaseInfo.databaseId),o=(n=t.databaseInfo,new AR(n));return(function(u,c,l){return new CR(u,c,l)})(t.credentials,o,i)},e.prototype.createRemoteStore=function(t){var n,i,o,u,c,l=this;return n=this.localStore,i=this.datastore,o=t.asyncQueue,u=function(f){return Ow(l.syncEngine,f,0)},c=Rw.yt()?new Rw:new _R,new DR(n,i,o,u,c)},e.prototype.createSyncEngine=function(t,n){return(function(i,o,u,c,l,f,d){var g=new zR(i,o,u,c,l,f);return d&&(g.$o=!0),g})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,n)},e.prototype.terminate=function(){return(function(t){return A(this,void 0,void 0,(function(){var n;return S(this,(function(i){switch(i.label){case 0:return n=U(t),M("RemoteStore","RemoteStore shutting down."),n.Or.add(5),[4,oo(n)];case 1:return i.sent(),n.Lr.shutdown(),n.Br.set("Unknown"),[2]}}))}))})(this.remoteStore)},e})();var gc=(function(){function e(t){this.observer=t,this.muted=!1}return e.prototype.next=function(t){this.observer.next&&this.jo(this.observer.next,t)},e.prototype.error=function(t){this.observer.error?this.jo(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)},e.prototype.Wo=function(){this.muted=!0},e.prototype.jo=function(t,n){var i=this;this.muted||setTimeout((function(){i.muted||t(n)}),0)},e})(),lD=(function(){function e(t){this.datastore=t,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastWriteError=null,this.writtenDocs=new Set}return e.prototype.lookup=function(t){return A(this,void 0,void 0,(function(){var n,i=this;return S(this,(function(o){switch(o.label){case 0:if(this.ensureCommitNotCalled(),this.mutations.length>0)throw new P(k.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,(function(u,c){return A(this,void 0,void 0,(function(){var l,f,d,g,y,w;return S(this,(function(I){switch(I.label){case 0:return l=U(u),f=bs(l.R)+"/documents",d={documents:c.map((function(T){return ws(l.R,T)}))},[4,l.$i("BatchGetDocuments",f,d)];case 1:return g=I.sent(),y=new Map,g.forEach((function(T){var E=(function(N,D){return"found"in D?(function(F,C){W(!!C.found),C.found.name,C.found.updateTime;var B=In(F,C.found.name),x=he(C.found.updateTime),Y=new ke({mapValue:{fields:C.found.fields}});return Jt.newFoundDocument(B,x,Y)})(N,D):"missing"in D?(function(F,C){W(!!C.missing),W(!!C.readTime);var B=In(F,C.missing),x=he(C.readTime);return Jt.newNoDocument(B,x)})(N,D):K()})(l.R,T);y.set(E.key.toString(),E)})),w=[],[2,(c.forEach((function(T){var E=y.get(T.toString());W(!!E),w.push(E)})),w)]}}))}))})(this.datastore,t)];case 1:return[2,((n=o.sent()).forEach((function(u){return i.recordVersion(u)})),n)]}}))}))},e.prototype.set=function(t,n){this.write(n.toMutation(t,this.precondition(t))),this.writtenDocs.add(t.toString())},e.prototype.update=function(t,n){try{this.write(n.toMutation(t,this.preconditionForUpdate(t)))}catch(i){this.lastWriteError=i}this.writtenDocs.add(t.toString())}
36,e.prototype.delete=function(t){this.write(new Ks(t,this.precondition(t))),this.writtenDocs.add(t.toString())},e.prototype.commit=function(){return A(this,void 0,void 0,(function(){var t,n=this;return S(this,(function(i){switch(i.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return t=this.readVersions,this.mutations.forEach((function(o){t.delete(o.key.toString())})),t.forEach((function(o,u){var c=G.fromPath(u);n.mutations.push(new Gp(c,n.precondition(c)))})),[4,(function(o,u){return A(this,void 0,void 0,(function(){var c,l,f;return S(this,(function(d){switch(d.label){case 0:return c=U(o),l=bs(c.R)+"/documents",f={writes:u.map((function(g){return La(c.R,g)}))},[4,c.Ni("Commit",l,f)];case 1:return d.sent(),[2]}}))}))})(this.datastore,this.mutations)];case 1:return i.sent(),this.committed=!0,[2]}}))}))},e.prototype.recordVersion=function(t){var n;if(t.isFoundDocument())n=t.version;else{if(!t.isNoDocument())throw K();n=Z.min()}var i=this.readVersions.get(t.key.toString());if(i){if(!n.isEqual(i))throw new P(k.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(t.key.toString(),n)},e.prototype.precondition=function(t){var n=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&n?Qt.updateTime(n):Qt.none()},e.prototype.preconditionForUpdate=function(t){var n=this.readVersions.get(t.toString());if(!this.writtenDocs.has(t.toString())&&n){if(n.isEqual(Z.min()))throw new P(k.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Qt.updateTime(n)}return Qt.exists(!0)},e.prototype.write=function(t){this.ensureCommitNotCalled(),this.mutations.push(t)},e.prototype.ensureCommitNotCalled=function(){},e})(),fD=(function(){function e(t,n,i,o){this.asyncQueue=t,this.datastore=n,this.updateFunction=i,this.deferred=o,this.ec=5,this.Zi=new ed(this.asyncQueue,"transaction_retry")}return e.prototype.run=function(){this.ec-=1,this.nc()},e.prototype.nc=function(){var t=this;this.Zi.ji((function(){return A(t,void 0,void 0,(function(){var n,i,o=this;return S(this,(function(u){return n=new lD(this.datastore),(i=this.sc(n))&&i.then((function(c){o.asyncQueue.enqueueAndForget((function(){return n.commit().then((function(){o.deferred.resolve(c)})).catch((function(l){o.ic(l)}))}))})).catch((function(c){o.ic(c)})),[2]}))}))}))},e.prototype.sc=function(t){try{var n=this.updateFunction(t);return!$r(n)&&n.catch&&n.then?n:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(i){return this.deferred.reject(i),null}},e.prototype.ic=function(t){var n=this;this.ec>0&&this.rc(t)?(this.ec-=1,this.asyncQueue.enqueueAndForget((function(){return n.nc(),Promise.resolve()}))):this.deferred.reject(t)},e.prototype.rc=function(t){if(t.name==="FirebaseError"){var n=t.code;return n==="aborted"||n==="failed-precondition"||!V0(n)}return!1},e})(),pD=(function(){function e(t,n,i){var o=this;this.credentials=t,this.asyncQueue=n,this.databaseInfo=i,this.user=qt.UNAUTHENTICATED,this.clientId=b0.u(),this.credentialListener=function(){return Promise.resolve()},this.credentials.setChangeListener(n,(function(u){return A(o,void 0,void 0,(function(){return S(this,(function(c){switch(c.label){case 0:return M("FirestoreClient","Received user=",u.uid),[4,this.credentialListener(u)];case 1:return c.sent(),this.user=u,[2]}}))}))}))}return e.prototype.getConfiguration=function(){return A(this,void 0,void 0,(function(){return S(this,(function(t){return[2,{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}]}))}))},e.prototype.setCredentialChangeListener=function(t){this.credentialListener=t},e.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new P(k.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.terminate=function(){var t=this;this.asyncQueue.enterRestrictedMode();var n=new we;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((function(){return A(t,void 0,void 0,(function(){var i,o;return S(this,(function(u){switch(u.label){case 0:return u.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:u.sent(),u.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:u.sent(),u.label=4;case 4:return this.credentials.removeChangeListener(),n.resolve(),[3,6];case 5:return i=u.sent(),o=ao(i,"Failed to shutdown persistence"),n.reject(o),[3,6];case 6:return[2]}}
36))}))})),n.promise},e})();function xI(e,t){return A(this,void 0,void 0,(function(){var n,i,o=this;return S(this,(function(u){switch(u.label){case 0:return e.asyncQueue.verifyOperationInProgress(),M("FirestoreClient","Initializing OfflineComponentProvider"),[4,e.getConfiguration()];case 1:return n=u.sent(),[4,t.initialize(n)];case 2:return u.sent(),i=n.initialUser,e.setCredentialChangeListener((function(c){return A(o,void 0,void 0,(function(){return S(this,(function(l){switch(l.label){case 0:return i.isEqual(c)?[3,2]:[4,pI(t.localStore,c)];case 1:l.sent(),i=c,l.label=2;case 2:return[2]}}))}))})),t.persistence.setDatabaseDeletedListener((function(){return e.terminate()})),e.offlineComponents=t,[2]}}))}))}function LI(e,t){return A(this,void 0,void 0,(function(){var n,i;return S(this,(function(o){switch(o.label){case 0:return e.asyncQueue.verifyOperationInProgress(),[4,vd(e)];case 1:return n=o.sent(),M("FirestoreClient","Initializing OnlineComponentProvider"),[4,e.getConfiguration()];case 2:return i=o.sent(),[4,t.initialize(n,i)];case 3:return o.sent(),e.setCredentialChangeListener((function(u){return(function(c,l){return A(this,void 0,void 0,(function(){var f,d;return S(this,(function(g){switch(g.label){case 0:return(f=U(c)).asyncQueue.verifyOperationInProgress(),M("RemoteStore","RemoteStore received new credentials"),d=Zn(f),f.Or.add(3),[4,oo(f)];case 1:return g.sent(),d&&f.Br.set("Unknown"),[4,f.remoteSyncer.handleCredentialChange(l)];case 2:return g.sent(),f.Or.delete(3),[4,Hs(f)];case 3:return g.sent(),[2]}}))}))})(t.remoteStore,u)})),e.onlineComponents=t,[2]}}))}))}function vd(e){return A(this,void 0,void 0,(function(){return S(this,(function(t){switch(t.label){case 0:return e.offlineComponents?[3,2]:(M("FirestoreClient","Using default OfflineComponentProvider"),[4,xI(e,new OI)]);case 1:t.sent(),t.label=2;case 2:return[2,e.offlineComponents]}}))}))}function mc(e){return A(this,void 0,void 0,(function(){return S(this,(function(t){switch(t.label){case 0:return e.onlineComponents?[3,2]:(M("FirestoreClient","Using default OnlineComponentProvider"),[4,LI(e,new op)]);case 1:t.sent(),t.label=2;case 2:return[2,e.onlineComponents]}}))}))}function xw(e){return vd(e).then((function(t){return t.persistence}))}function MI(e){return vd(e).then((function(t){return t.localStore}))}function Lw(e){return mc(e).then((function(t){return t.remoteStore}))}function FI(e){return mc(e).then((function(t){return t.syncEngine}))}function Ji(e){return A(this,void 0,void 0,(function(){var t,n;return S(this,(function(i){switch(i.label){case 0:return[4,mc(e)];case 1:return t=i.sent(),[2,((n=t.eventManager).onListen=$R.bind(null,t.syncEngine),n.onUnlisten=WR.bind(null,t.syncEngine),n)]}}))}))}function Mw(e,t,n){var i=this;n===void 0&&(n={});var o=new we;return e.asyncQueue.enqueueAndForget((function(){return A(i,void 0,void 0,(function(){var u;return S(this,(function(c){switch(c.label){case 0:return u=function(l,f,d,g,y){var w=new gc({next:function(T){f.enqueueAndForget((function(){return sd(l,I)}));var E=T.docs.has(d);!E&&T.fromCache?y.reject(new P(k.UNAVAILABLE,"Failed to get document because the client is offline.")):E&&T.fromCache&&g&&g.source==="server"?y.reject(new P(k.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.)')):y.resolve(T)},error:function(T){return y.reject(T)}}),I=new ad(Us(d.path),w,{includeMetadataChanges:!0,so:!0});return od(l,I)},[4,Ji(e)];case 1:return[2,u.apply(void 0,[c.sent(),e.asyncQueue,t,n,o])]}}))}))})),o.promise}function Fw(e,t,n){var i=this;n===void 0&&(n={});var o=new we;return e.asyncQueue.enqueueAndForget((function(){return A(i,void 0,void 0,(function(){var u;return S(this,(function(c){switch(c.label){case 0:return u=function(l,f,d,g,y){var w=new gc({next:function(T){f.enqueueAndForget((function(){return sd(l,I)})),T.fromCache&&g.source==="server"?y.reject(new P(k.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.)')):y.resolve(T)},error:function(T){return y.reject(T)}}),I=new ad(d,w,{includeMetadataChanges:!0,so:!0});return od(l,I)},[4,Ji(e)];case 1:return[2,u.apply(void 0,[c.sent(),e.asyncQueue,t,n,o])]}}))}))})),o.promise}var dD=(function(e,t,n,i,o,u,c,l){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=i,this.ssl=o,this.forceLongPolling=u,this.autoDetectLongPolling=c,this.useFetchStreams=l}),Ba=(function(){function e(t,n){this.projectId=t,this.database=n||"(default)"}return Object.defineProperty(e.prototype,"isDefaultDatabase",{get:function(){return this.database==="(default)"}
36,enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.projectId===this.projectId&&t.database===this.database},e})(),Uw=new Map,UI=function(e,t){this.user=t,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+e},jw=(function(){function e(){this.changeListener=null}return e.prototype.getToken=function(){return Promise.resolve(null)},e.prototype.invalidateToken=function(){},e.prototype.setChangeListener=function(t,n){this.changeListener=n,t.enqueueRetryable((function(){return n(qt.UNAUTHENTICATED)}))},e.prototype.removeChangeListener=function(){this.changeListener=null},e})(),vD=(function(){function e(t){this.token=t,this.changeListener=null}return e.prototype.getToken=function(){return Promise.resolve(this.token)},e.prototype.invalidateToken=function(){},e.prototype.setChangeListener=function(t,n){var i=this;this.changeListener=n,t.enqueueRetryable((function(){return n(i.token.user)}))},e.prototype.removeChangeListener=function(){this.changeListener=null},e})(),gD=(function(){function e(t){var n=this;this.currentUser=qt.UNAUTHENTICATED,this.oc=new we,this.cc=0,this.forceRefresh=!1,this.auth=null,this.asyncQueue=null,this.uc=function(){n.cc++,n.currentUser=n.ac(),n.oc.resolve(),n.changeListener&&n.asyncQueue.enqueueRetryable((function(){return n.changeListener(n.currentUser)}))};var i=function(o){M("FirebaseCredentialsProvider","Auth detected"),n.auth=o,n.auth.addAuthTokenListener(n.uc)};t.onInit((function(o){return i(o)})),setTimeout((function(){if(!n.auth){var o=t.getImmediate({optional:!0});o?i(o):(M("FirebaseCredentialsProvider","Auth not yet detected"),n.oc.resolve())}}),0)}return e.prototype.getToken=function(){var t=this,n=this.cc,i=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(i).then((function(o){return t.cc!==n?(M("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):o?(W(typeof o.accessToken=="string"),new UI(o.accessToken,t.currentUser)):null})):Promise.resolve(null)},e.prototype.invalidateToken=function(){this.forceRefresh=!0},e.prototype.setChangeListener=function(t,n){var i=this;this.asyncQueue=t,this.asyncQueue.enqueueRetryable((function(){return A(i,void 0,void 0,(function(){return S(this,(function(o){switch(o.label){case 0:return[4,this.oc.promise];case 1:return o.sent(),[4,n(this.currentUser)];case 2:return o.sent(),this.changeListener=n,[2]}}))}))}))},e.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.uc),this.changeListener=function(){return Promise.resolve()}},e.prototype.ac=function(){var t=this.auth&&this.auth.getUid();return W(t===null||typeof t=="string"),new qt(t)},e})(),mD=(function(){function e(t,n,i){this.hc=t,this.lc=n,this.fc=i,this.type="FirstParty",this.user=qt.FIRST_PARTY}return Object.defineProperty(e.prototype,"authHeaders",{get:function(){var t={"X-Goog-AuthUser":this.lc},n=this.hc.auth.getAuthHeaderValueForFirstParty([]);return n&&(t.Authorization=n),this.fc&&(t["X-Goog-Iam-Authorization-Token"]=this.fc),t},enumerable:!1,configurable:!0}),e})(),yD=(function(){function e(t,n,i){this.hc=t,this.lc=n,this.fc=i}return e.prototype.getToken=function(){return Promise.resolve(new mD(this.hc,this.lc,this.fc))},e.prototype.setChangeListener=function(t,n){t.enqueueRetryable((function(){return n(qt.FIRST_PARTY)}))},e.prototype.removeChangeListener=function(){},e.prototype.invalidateToken=function(){},e})();function gd(e,t,n){if(!n)throw new P(k.INVALID_ARGUMENT,"Function "+e+"() cannot be called with an empty "+t+".")}function md(e,t){if(t===void 0)return{merge:!1};if(t.mergeFields!==void 0&&t.merge!==void 0)throw new P(k.INVALID_ARGUMENT,"Invalid options passed to function "+e+'(): You cannot specify both "merge" and "mergeFields".');return t}function jI(e,t,n,i){if(t===!0&&i===!0)throw new P(k.INVALID_ARGUMENT,e+" and "+n+" cannot be used together.")}function Vw(e){if(!G.isDocumentKey(e))throw new P(k.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e+" has "+e.length+".")}function qw(e){if(G.isDocumentKey(e))throw new P(k.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+e+" has "+e.length+".")}function yc(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e.length>20&&(e=e.substring(0,20)+"..."),JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return""+e;if(typeof e=="object"){if(e instanceof Array)return"an array";var t=(function(n){if(n.constructor){var i=/function\s+([^\s(]+)\s*\(/.exec(n.constructor.toString());if(i&&i.length>1)return i[1]}return null})(e);return t?"a custom "+t+" object":"an object"}return typeof e=="function"?"a function":K()}function ut(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new P(k.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=yc(e);throw new P(k.INVALID_ARGUMENT,"Expected type '"+t.name+"', but it was: "+n)}return e}function Bw(e,t){if(t<=0)throw new P(k.INVALID_ARGUMENT,"Function "+e+"() requires a positive number, but it was: "+t+".")}var Kw=(function(){function e(t){var n;if(t.host===void 0){if(t.ssl!==void 0)throw new P(k.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=(n=t.ssl)===null||n===void 0||n;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,t.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(t.cacheSizeBytes!==-1&&t.cacheSizeBytes<1048576)throw new P(k.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,jI("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}return e.prototype.isEqual=function(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams},e})(),Ts=(function(){function e(t,n){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Kw({}),this._settingsFrozen=!1,t instanceof Ba?(this._databaseId=t,this._credentials=new jw):(this._app=t,this._databaseId=(function(i){if(!Object.prototype.hasOwnProperty.apply(i.options,["projectId"]))throw new P(k.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Ba(i.options.projectId)})(t),this._credentials=new gD(n))}return Object.defineProperty(e.prototype,"app",{get:function(){if(!this._app)throw new P(k.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}
36,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_terminated",{get:function(){return this._terminateTask!==void 0},enumerable:!1,configurable:!0}),e.prototype._setSettings=function(t){if(this._settingsFrozen)throw new P(k.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 Kw(t),t.credentials!==void 0&&(this._credentials=(function(n){if(!n)return new jw;switch(n.type){case"gapi":var i=n.client;return W(!(typeof i!="object"||i===null||!i.auth||!i.auth.getAuthHeaderValueForFirstParty)),new yD(i,n.sessionIndex||"0",n.iamToken||null);case"provider":return n.client;default:throw new P(k.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}})(t.credentials))},e.prototype._getSettings=function(){return this._settings},e.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},e.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},e.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},e.prototype._terminate=function(){return t=this,(n=Uw.get(t))&&(M("ComponentProvider","Removing Datastore"),Uw.delete(t),n.terminate()),Promise.resolve();var t,n},e})(),It=(function(){function e(t,n,i){this.converter=n,this._key=i,this.type="document",this.firestore=t}return Object.defineProperty(e.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new $n(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(t){return new e(this.firestore,t,this._key)},e})(),Re=(function(){function e(t,n,i){this.converter=n,this._query=i,this.type="query",this.firestore=t}return e.prototype.withConverter=function(t){return new e(this.firestore,t,this._query)},e})(),$n=(function(e){function t(n,i,o){var u=this;return(u=e.call(this,n,i,Us(o))||this)._path=o,u.type="collection",u}return $(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var n=this._path.popLast();return n.isEmpty()?null:new It(this.firestore,null,new G(n))},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(n){return new t(this.firestore,n,this._path)},t})(Re);function VI(e,t){for(var n,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];if(e=ht(e),gd("collection","path",t),e instanceof Ts)return qw(n=st.fromString.apply(st,dt([t],i))),new $n(e,null,n);if(!(e instanceof It||e instanceof $n))throw new P(k.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return qw(n=st.fromString.apply(st,dt([e.path],i)).child(st.fromString(t))),new $n(e.firestore,null,n)}function ma(e,t){for(var n,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];if(e=ht(e),arguments.length===1&&(t=b0.u()),gd("doc","path",t),e instanceof Ts)return Vw(n=st.fromString.apply(st,dt([t],i))),new It(e,null,new G(n));if(!(e instanceof It||e instanceof $n))throw new P(k.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return Vw(n=e._path.child(st.fromString.apply(st,dt([t],i)))),new It(e.firestore,e instanceof $n?e.converter:null,new G(n))}function qI(e,t){return e=ht(e),t=ht(t),(e instanceof It||e instanceof $n)&&(t instanceof It||t instanceof $n)&&e.firestore===t.firestore&&e.path===t.path&&e.converter===t.converter}function BI(e,t){return e=ht(e),t=ht(t),e instanceof Re&&t instanceof Re&&e.firestore===t.firestore&&js(e._query,t._query)&&e.converter===t.converter}var wD=(function(){function e(){var t=this;
36this.dc=Promise.resolve(),this.wc=[],this._c=!1,this.mc=[],this.yc=null,this.gc=!1,this.Ec=!1,this.Tc=[],this.Zi=new ed(this,"async_queue_retry"),this.Ic=function(){var i=ga();i&&M("AsyncQueue","Visibility state changed to "+i.visibilityState),t.Zi.Gi()};var n=ga();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this.Ic)}return Object.defineProperty(e.prototype,"isShuttingDown",{get:function(){return this._c},enumerable:!1,configurable:!0}),e.prototype.enqueueAndForget=function(t){this.enqueue(t)},e.prototype.enqueueAndForgetEvenWhileRestricted=function(t){this.Ac(),this.Rc(t)},e.prototype.enterRestrictedMode=function(t){if(!this._c){this._c=!0,this.Ec=t||!1;var n=ga();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.Ic)}},e.prototype.enqueue=function(t){var n=this;if(this.Ac(),this._c)return new Promise((function(){}));var i=new we;return this.Rc((function(){return n._c&&n.Ec?Promise.resolve():(t().then(i.resolve,i.reject),i.promise)})).then((function(){return i.promise}))},e.prototype.enqueueRetryable=function(t){var n=this;this.enqueueAndForget((function(){return n.wc.push(t),n.bc()}))},e.prototype.bc=function(){return A(this,void 0,void 0,(function(){var t,n=this;return S(this,(function(i){switch(i.label){case 0:if(this.wc.length===0)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.wc[0]()];case 2:return i.sent(),this.wc.shift(),this.Zi.reset(),[3,4];case 3:if(!Wr(t=i.sent()))throw t;return M("AsyncQueue","Operation failed with retryable error: "+t),[3,4];case 4:this.wc.length>0&&this.Zi.ji((function(){return n.bc()})),i.label=5;case 5:return[2]}}
36))}))},e.prototype.Rc=function(t){var n=this,i=this.dc.then((function(){return n.gc=!0,t().catch((function(o){throw n.yc=o,n.gc=!1,Rt("INTERNAL UNHANDLED ERROR: ",(function(u){var c=u.message||"";return u.stack&&(c=u.stack.includes(u.message)?u.stack:u.message+` 37`+u.stack),c})(o)),o})).then((function(o){return n.gc=!1,o}))}));return this.dc=i,i},e.prototype.enqueueAfterDelay=function(t,n,i){var o=this;this.Ac(),this.Tc.indexOf(t)>-1&&(n=0);var u=jR.createAndSchedule(this,t,n,i,(function(c){return o.vc(c)}));return this.mc.push(u),u},e.prototype.Ac=function(){this.yc&&K()},e.prototype.verifyOperationInProgress=function(){},e.prototype.Pc=function(){return A(this,void 0,void 0,(function(){var t;return S(this,(function(n){switch(n.label){case 0:return[4,t=this.dc];case 1:n.sent(),n.label=2;case 2:if(t!==this.dc)return[3,0];n.label=3;case 3:return[2]}}))}))},e.prototype.Vc=function(t){for(var n=0,i=this.mc;n<i.length;n++)if(i[n].timerId===t)return!0;return!1},e.prototype.Sc=function(t){var n=this;return this.Pc().then((function(){n.mc.sort((function(c,l){return c.targetTimeMs-l.targetTimeMs}));for(var i=0,o=n.mc;i<o.length;i++){var u=o[i];if(u.skipDelay(),t!=="all"&&u.timerId===t)break}return n.Pc()}))},e.prototype.Dc=function(t){this.Tc.push(t)},e.prototype.vc=function(t){var n=this.mc.indexOf(t);this.mc.splice(n,1)},e})();function Zi(e){return(function(t,n){if(typeof t!="object"||t===null)return!1;for(var i=t,o=0,u=["next","error","complete"];o<u.length;o++){var c=u[o];if(c in i&&typeof i[c]=="function")return!0}return!1})(e)}var bD=-1,Lt=(function(e){function t(n,i){var o=this;return(o=e.call(this,n,i)||this).type="firestore",o._queue=new wD,o._persistenceKey="name"in n?n.name:"[DEFAULT]",o}return $(t,e),t.prototype._terminate=function(){return this._firestoreClient||KI(this),this._firestoreClient.terminate()},t})(Ts);function Wt(e){return e._firestoreClient||KI(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function KI(e){var t,n=e._freezeSettings(),i=(function(o,u,c,l){return new dD(o,u,c,l.host,l.ssl,l.experimentalForceLongPolling,l.experimentalAutoDetectLongPolling,l.useFetchStreams)})(e._databaseId,((t=e._app)===null||t===void 0?void 0:t.options.appId)||"",e._persistenceKey,n);e._firestoreClient=new pD(e._credentials,e._queue,i)}function Hw(e,t,n){var i=this,o=new we;return e.asyncQueue.enqueue((function(){return A(i,void 0,void 0,(function(){var u;return S(this,(function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),[4,xI(e,n)];case 1:return c.sent(),[4,LI(e,t)];case 2:return c.sent(),o.resolve(),[3,4];case 3:if(!(function(l){return l.name==="FirebaseError"?l.code===k.FAILED_PRECONDITION||l.code===k.UNIMPLEMENTED:!(typeof DOMException<"u"&&l instanceof DOMException)||l.code===22||l.code===20||l.code===11})(u=c.sent()))throw u;return console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+u),o.reject(u),[3,4];case 4:return[2]}}
37))}))})).then((function(){return o.promise}))}function Gw(e){if(e._initialized||e._terminated)throw new P(k.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.")}var an=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0;i<t.length;++i)if(t[i].length===0)throw new P(k.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Qe(t)}return e.prototype.isEqual=function(t){return this._internalPath.isEqual(t._internalPath)},e})(),Br=(function(){function e(t){this._byteString=t}return e.fromBase64String=function(t){try{return new e(ye.fromBase64String(t))}catch(n){throw new P(k.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}},e.fromUint8Array=function(t){return new e(ye.fromUint8Array(t))},e.prototype.toBase64=function(){return this._byteString.toBase64()},e.prototype.toUint8Array=function(){return this._byteString.toUint8Array()},e.prototype.toString=function(){return"Bytes(base64: "+this.toBase64()+")"},e.prototype.isEqual=function(t){return this._byteString.isEqual(t._byteString)},e})(),Qr=(function(e){this._methodName=e}),wc=(function(){function e(t,n){if(!isFinite(t)||t<-90||t>90)throw new P(k.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(n)||n<-180||n>180)throw new P(k.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=t,this._long=n}return Object.defineProperty(e.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return this._lat===t._lat&&this._long===t._long},e.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},e.prototype._compareTo=function(t){return rt(this._lat,t._lat)||rt(this._long,t._long)},e})(),ID=/^__.*__$/,TD=(function(){function e(t,n,i){this.data=t,this.fieldMask=n,this.fieldTransforms=i}return e.prototype.toMutation=function(t,n){return this.fieldMask!==null?new Jn(t,this.data,this.fieldMask,n,this.fieldTransforms):new Bs(t,this.data,n,this.fieldTransforms)},e})(),HI=(function(){function e(t,n,i){this.data=t,this.fieldMask=n,this.fieldTransforms=i}return e.prototype.toMutation=function(t,n){return new Jn(t,this.data,this.fieldMask,n,this.fieldTransforms)},e})();function GI(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw K()}}var zI=(function(){function e(t,n,i,o,u,c){this.settings=t,this.databaseId=n,this.R=i,this.ignoreUndefinedProperties=o,u===void 0&&this.Cc(),this.fieldTransforms=u||[],this.fieldMask=c||[]}return Object.defineProperty(e.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Nc",{get:function(){return this.settings.Nc},enumerable:!1,configurable:!0}),e.prototype.xc=function(t){return new e(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},e.prototype.kc=function(t){var n,i=(n=this.path)===null||n===void 0?void 0:n.child(t),o=this.xc({path:i,Fc:!1});return o.$c(t),o},e.prototype.Oc=function(t){var n,i=(n=this.path)===null||n===void 0?void 0:n.child(t),o=this.xc({path:i,Fc:!1});return o.Cc(),o},e.prototype.Mc=function(t){return this.xc({path:void 0,Fc:!0})},e.prototype.Lc=function(t){return Ka(t,this.settings.methodName,this.settings.Bc||!1,this.path,this.settings.qc)},e.prototype.contains=function(t){return this.fieldMask.find((function(n){return t.isPrefixOf(n)}))!==void 0||this.fieldTransforms.find((function(n){return t.isPrefixOf(n.field)}))!==void 0},e.prototype.Cc=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.$c(this.path.get(t))},e.prototype.$c=function(t){if(t.length===0)throw this.Lc("Document fields must not be empty");if(GI(this.Nc)&&ID.test(t))throw this.Lc('Document fields cannot begin and end with "__"')},e})(),_D=(function(){function e(t,n,i){this.databaseId=t,this.ignoreUndefinedProperties=n,this.R=i||dc(t)}return e.prototype.Uc=function(t,n,i,o){return o===void 0&&(o=!1),new zI({Nc:t,methodName:n,qc:i,path:Qe.emptyPath(),Fc:!1,Bc:o},this.databaseId,this.R,this.ignoreUndefinedProperties)},e})();function Yr(e){var t=e._freezeSettings(),n=dc(e._databaseId);return new _D(e._databaseId,!!t.ignoreUndefinedProperties,n)}function bc(e,t,n,i,o,u){u===void 0&&(u={});var c=e.Uc(u.merge||u.mergeFields?2:0,t,n,o);Id("Data must be an object, but it was:",c,i);var l,f,d=XI(i,c);if(u.merge)l=new ji(c.fieldMask),f=c.fieldTransforms;else if(u.mergeFields){for(var g=[],y=0,w=u.mergeFields;y<w.length;y++){var I=sp(t,w[y],n);if(!c.contains(I))throw new P(k.INVALID_ARGUMENT,"Field '"+I+"' is specified in your field mask but missing from your input data.");YI(g,I)||g.push(I)}l=new ji(g),f=c.fieldTransforms.filter((function(T){return l.covers(T.field)}))}else l=null,f=c.fieldTransforms;return new TD(new ke(d),l,f)}var yd=(function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return $(t,e),t.prototype._toFieldTransform=function(n){if(n.Nc!==2)throw n.Nc===1?n.Lc(this._methodName+"() can only appear at the top level of your update data"):n.Lc(this._methodName+"() cannot be used with set() unless you pass {merge:true}");return n.fieldMask.push(n.path),null},t.prototype.isEqual=function(n){return n instanceof t},t})(Qr);function $I(e,t,n){return new zI({Nc:3,qc:t.settings.qc,methodName:e._methodName,Fc:n},t.databaseId,t.R,t.ignoreUndefinedProperties)}var ED=(function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return $(t,e),t.prototype._toFieldTransform=function(n){return new qs(n.path,new Ki)},t.prototype.isEqual=function(n){return n instanceof t},t})(Qr),SD=(function(e){function t(n,i){var o=this;return(o=e.call(this,n)||this).Kc=i,o}return $(t,e),t.prototype._toFieldTransform=function(n){var i=$I(this,n,!0),o=this.Kc.map((function(c){return Jr(c,i)})),u=new Vr(o);return new qs(n.path,u)},t.prototype.isEqual=function(n){return this===n},t})(Qr),AD=(function(e){function t(n,i){var o=this;return(o=e.call(this,n)||this).Kc=i,o}return $(t,e),t.prototype._toFieldTransform=function(n){var i=$I(this,n,!0),o=this.Kc.map((function(c){return Jr(c,i)})),u=new qr(o);return new qs(n.path,u)},t.prototype.isEqual=function(n){return this===n},t})(Qr),kD=(function(e){function t(n,i){var o=this;return(o=e.call(this,n)||this).Qc=i,o}return $(t,e),t.prototype._toFieldTransform=function(n){var i=new Hi(n.R,x0(n.R,this.Qc));return new qs(n.path,i)},t.prototype.isEqual=function(n){return this===n},t})(Qr);function wd(e,t,n,i){var o=e.Uc(1,t,n);Id("Data must be an object, but it was:",o,i);var u=[],c=ke.empty();zr(i,(function(f,d){var g=Td(t,f,n);d=ht(d);var y=o.Oc(g);if(d instanceof yd)u.push(g);else{var w=Jr(d,y);w!=null&&(u.push(g),c.set(g,w))}}));var l=new ji(u);return new HI(c,l,o.fieldTransforms)}function bd(e,t,n,i,o,u){var c=e.Uc(1,t,n),l=[sp(t,i,n)],f=[o];if(u.length%2!=0)throw new P(k.INVALID_ARGUMENT,"Function "+t+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var d=0;d<u.length;
37d+=2)l.push(sp(t,u[d])),f.push(u[d+1]);for(var g=[],y=ke.empty(),w=l.length-1;w>=0;--w)if(!YI(g,l[w])){var I=l[w],T=f[w];T=ht(T);var E=c.Oc(I);if(T instanceof yd)g.push(I);else{var N=Jr(T,E);N!=null&&(g.push(I),y.set(I,N))}}var D=new ji(g);return new HI(y,D,c.fieldTransforms)}function WI(e,t,n,i){return i===void 0&&(i=!1),Jr(n,e.Uc(i?4:3,t))}function Jr(e,t){if(QI(e=ht(e)))return Id("Unsupported field value:",t,e),XI(e,t);if(e instanceof Qr)return(function(n,i){if(!GI(i.Nc))throw i.Lc(n._methodName+"() can only be used with update() and set()");if(!i.path)throw i.Lc(n._methodName+"() is not currently supported inside arrays");var o=n._toFieldTransform(i);o&&i.fieldTransforms.push(o)})(e,t),null;if(e===void 0&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.Fc&&t.Nc!==4)throw t.Lc("Nested arrays are not supported");return(function(n,i){for(var o=[],u=0,c=0,l=n;c<l.length;c++){var f=Jr(l[c],i.Mc(u));f==null&&(f={nullValue:"NULL_VALUE"}),o.push(f),u++}return{arrayValue:{values:o}}})(e,t)}return(function(n,i){if((n=ht(n))===null)return{nullValue:"NULL_VALUE"};if(typeof n=="number")return x0(i.R,n);if(typeof n=="boolean")return{booleanValue:n};if(typeof n=="string")return{stringValue:n};if(n instanceof Date){var o=me.fromDate(n);return{timestampValue:ys(i.R,o)}}if(n instanceof me)return o=new me(n.seconds,1e3*Math.floor(n.nanoseconds/1e3)),{timestampValue:ys(i.R,o)};if(n instanceof wc)return{geoPointValue:{latitude:n.latitude,longitude:n.longitude}};if(n instanceof Br)return{bytesValue:H0(i.R,n._byteString)};if(n instanceof It){o=i.databaseId;var u=n.firestore._databaseId;if(!u.isEqual(o))throw i.Lc("Document reference is for database "+u.projectId+"/"+u.database+" but should be for database "+o.projectId+"/"+o.database);return{referenceValue:Wp(n.firestore._databaseId||i.databaseId,n._key.path)}}throw i.Lc("Unsupported field value: "+yc(n))})(e,t)}function XI(e,t){var n={};return T0(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):zr(e,(function(i,o){var u=Jr(o,t.kc(i));u!=null&&(n[i]=u)})),{mapValue:{fields:n}}}function QI(e){return!(typeof e!="object"||e===null||e instanceof Array||e instanceof Date||e instanceof me||e instanceof wc||e instanceof Br||e instanceof It||e instanceof Qr)}function Id(e,t,n){if(!QI(n)||!(function(o){return typeof o=="object"&&o!==null&&(Object.getPrototypeOf(o)===Object.prototype||Object.getPrototypeOf(o)===null)})(n)){var i=yc(n);throw i==="an object"?t.Lc(e+" a custom object"):t.Lc(e+" "+i)}}
37function sp(e,t,n){if((t=ht(t))instanceof an)return t._internalPath;if(typeof t=="string")return Td(e,t);throw Ka("Field path arguments must be of type string or FieldPath.",e,!1,void 0,n)}var ND=new RegExp("[~\\*/\\[\\]]");function Td(e,t,n){if(t.search(ND)>=0)throw Ka("Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'",e,!1,void 0,n);try{return new(an.bind.apply(an,dt([void 0],t.split("."))))()._internalPath}catch{throw Ka("Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",e,!1,void 0,n)}}function Ka(e,t,n,i,o){var u=i&&!i.isEmpty(),c=o!==void 0,l="Function "+t+"() called with invalid data";n&&(l+=" (via `toFirestore()`)");var f="";return(u||c)&&(f+=" (found",u&&(f+=" in field "+i),c&&(f+=" in document "+o),f+=")"),new P(k.INVALID_ARGUMENT,(l+=". ")+e+f)}function YI(e,t){return e.some((function(n){return n.isEqual(t)}))}var _s=(function(){function e(t,n,i,o,u){this._firestore=t,this._userDataWriter=n,this._key=i,this._document=o,this._converter=u}return Object.defineProperty(e.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new It(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),e.prototype.exists=function(){return this._document!==null},e.prototype.data=function(){if(this._document){if(this._converter){var t=new CD(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}},e.prototype.get=function(t){if(this._document){var n=this._document.data.field(Ha("DocumentSnapshot.get",t));if(n!==null)return this._userDataWriter.convertValue(n)}},e})(),CD=(function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return $(t,e),t.prototype.data=function(){return e.prototype.data.call(this)},t})(_s);function Ha(e,t){return typeof t=="string"?Td(e,t):t instanceof an?t._internalPath:t._delegate._internalPath}var Cr=(function(){function e(t,n){this.hasPendingWrites=t,this.fromCache=n}return e.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},e})(),_n=(function(e){function t(n,i,o,u,c,l){var f=this;return(f=e.call(this,n,i,o,u,l)||this)._firestore=n,f._firestoreImpl=n,f.metadata=c,f}return $(t,e),t.prototype.exists=function(){return e.prototype.exists.call(this)},t.prototype.data=function(n){if(n===void 0&&(n={}),this._document){if(this._converter){var i=new us(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(i,n)}return this._userDataWriter.convertValue(this._document.data.value,n.serverTimestamps)}},t.prototype.get=function(n,i){if(i===void 0&&(i={}),this._document){var o=this._document.data.field(Ha("DocumentSnapshot.get",n));if(o!==null)return this._userDataWriter.convertValue(o,i.serverTimestamps)}},t})(_s),us=(function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return $(t,e),t.prototype.data=function(n){return n===void 0&&(n={}),e.prototype.data.call(this,n)},t})(_n),Hn=(function(){function e(t,n,i,o){this._firestore=t,this._userDataWriter=n,this._snapshot=o,this.metadata=new Cr(o.hasPendingWrites,o.fromCache),this.query=i}return Object.defineProperty(e.prototype,"docs",{get:function(){var t=[];return this.forEach((function(n){return t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this.size===0},enumerable:!1,configurable:!0}),e.prototype.forEach=function(t,n){var i=this;this._snapshot.docs.forEach((function(o){t.call(n,new us(i._firestore,i._userDataWriter,o.key,o,new Cr(i._snapshot.mutatedKeys.has(o.key),i._snapshot.fromCache),i.query.converter))}))},e.prototype.docChanges=function(t){t===void 0&&(t={});var n=!!t.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new P(k.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=(function(i,o){if(i._snapshot.oldDocs.isEmpty()){var u=0;return i._snapshot.docChanges.map((function(l){return{type:"added",doc:new us(i._firestore,i._userDataWriter,l.doc.key,l.doc,new Cr(i._snapshot.mutatedKeys.has(l.doc.key),i._snapshot.fromCache),i.query.converter),oldIndex:-1,newIndex:u++}}))}var c=i._snapshot.oldDocs;return i._snapshot.docChanges.filter((function(l){return o||l.type!==3})).map((function(l){var f=new us(i._firestore,i._userDataWriter,l.doc.key,l.doc,new Cr(i._snapshot.mutatedKeys.has(l.doc.key),i._snapshot.fromCache),i.query.converter),d=-1,g=-1;return l.type!==0&&(d=c.indexOf(l.doc.key),c=c.delete(l.doc.key)),l.type!==1&&(g=(c=c.add(l.doc)).indexOf(l.doc.key)),{type:RD(l.type),doc:f,oldIndex:d,newIndex:g}}))})(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges},e})();function RD(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return K()}}function JI(e,t){return e instanceof _n&&t instanceof _n?e._firestore===t._firestore&&e._key.isEqual(t._key)&&(e._document===null?t._document===null:e._document.isEqual(t._document))&&e._converter===t._converter:e instanceof Hn&&t instanceof Hn&&e._firestore===t._firestore&&BI(e.query,t.query)&&e.metadata.isEqual(t.metadata)&&e._snapshot.isEqual(t._snapshot)}function ZI(e){if(xa(e)&&e.explicitOrderBy.length===0)throw new P(k.UNIMPLEMENT
37ED,"limitToLast() queries require specifying at least one orderBy() clause")}var Gs=function(){};function jn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0,o=t;i<o.length;i++){var u=o[i];e=u._apply(e)}return e}var DD=(function(e){function t(n,i,o){var u=this;return(u=e.call(this)||this).jc=n,u.Wc=i,u.Gc=o,u.type="where",u}return $(t,e),t.prototype._apply=function(n){var i=Yr(n.firestore),o=(function(u,c,l,f,d,g,y){var w;if(d.isKeyField()){if(g==="array-contains"||g==="array-contains-any")throw new P(k.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+g+"' queries on FieldPath.documentId().");if(g==="in"||g==="not-in"){Qw(y,g);for(var I=[],T=0,E=y;T<E.length;T++){var N=E[T];I.push(Xw(f,u,N))}w={arrayValue:{values:I}}}else w=Xw(f,u,y)}else g!=="in"&&g!=="not-in"&&g!=="array-contains-any"||Qw(y,g),w=WI(l,"where",y,g==="in"||g==="not-in");var D=Ce.create(d,g,w);return(function(F,C){if(C.g()){var B=Kp(F);if(B!==null&&!B.isEqual(C.field))throw new P(k.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 '"+B.toString()+"' and '"+C.field.toString()+"'");var x=Bp(F);x!==null&&eT(F,C.field,x)}var Y=(function(_,te){for(var yt=0,Xs=_.filters;yt<Xs.length;yt++){var ti=Xs[yt];if(te.indexOf(ti.op)>=0)return ti.op}return null})(F,(function(_){switch(_){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[]}})(C.op));if(Y!==null)throw Y===C.op?new P(k.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+C.op.toString()+"' filter."):new P(k.INVALID_ARGUMENT,"Invalid query. You cannot use '"+C.op.toString()+"' filters with '"+Y.toString()+"' filters.")})(u,D),D})(n._query,0,i,n.firestore._databaseId,this.jc,this.Wc,this.Gc);return new Re(n.firestore,n.converter,(function(u,c){var l=u.filters.concat([c]);return new An(u.path,u.collectionGroup,u.explicitOrderBy.slice(),l,u.limit,u.limitType,u.startAt,u.endAt)})(n._query,o))},t})(Gs),OD=(function(e){function t(n,i){var o=this;return(o=e.call(this)||this).jc=n,o.zc=i,o.type="orderBy",o}return $(t,e),t.prototype._apply=function(n){var i=(function(o,u,c){if(o.startAt!==null)throw new P(k.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(o.endAt!==null)throw new P(k.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var l=new xi(u,c);return(function(f,d){if(Bp(f)===null){var g=Kp(f);g!==null&&eT(f,g,d.field)}})(o,l),l})(n._query,this.jc,this.zc);return new Re(n.firestore,n.converter,(function(o,u){var c=o.explicitOrderBy.concat([u]);return new An(o.path,o.collectionGroup,c,o.filters.slice(),o.limit,o.limitType,o.startAt,o.endAt)})(n._query,i))},t})(Gs),zw=(function(e){function t(n,i,o){var u=this;return(u=e.call(this)||this).type=n,u.Hc=i,u.Jc=o,u}return $(t,e),t.prototype._apply=function(n){return new Re(n.firestore,n.converter,C0(n._query,this.Hc,this.Jc))},t})(Gs),$w=(function(e){function t(n,i,o){var u=this;return(u=e.call(this)||this).type=n,u.Yc=i,u.Xc=o,u}return $(t,e),t.prototype._apply=function(n){var i=tT(n,this.type,this.Yc,this.Xc);return new Re(n.firestore,n.converter,(function(o,u){return new An(o.path,o.collectionGroup,o.explicitOrderBy.slice(),o.filters.slice(),o.limit,o.limitType,u,o.endAt)})(n._query,i))},t})(Gs),Ww=(function(e){function t(n,i,o){var u=this;return(u=e.call(this)||this).type=n,u.Yc=i,u.Xc=o,u}return $(t,e),t.prototype._apply=function(n){var i=tT(n,this.type,this.Yc,this.Xc);return new Re(n.firestore,n.converter,(function(o,u){return new An(o.path,o.collectionGroup,o.explicitOrderBy.slice(),o.filters.slice(),o.limit,o.limitType,o.startAt,u)})(n._query,i))},t})(Gs);function tT(e,t,n,i){if(n[0]=ht(n[0]),n[0]instanceof _s)return(function(u,c,l,f,d){if(!f)throw new P(k.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+l+"().");for(var g=[],y=0,w=Bi(u);y<w.length;y++){var I=w[y];if(I.field.isKeyField())g.push(Da(c,f.key));else{var T=f.data.field(I.field);if(jp(T))throw new P(k.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+I.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(T===null){var E=I.field.canonicalString();throw new P(k.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+E+"' (used as the orderBy) does not exist.")}g.push(T)}}return new ms(g,d)})(e._query,e.firestore._databaseId,t,n[0]._document,i);var o=Yr(e.firestore);return(function(u,c,l,f,d,g){var y=u.explicitOrderBy;if(d.length>y.length)throw new P(k.INVALID_ARGUMENT,"Too many arguments provided to "+f+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var w=[],I=0;I<d.length;I++){var T=d[I];
37if(y[I].field.isKeyField()){if(typeof T!="string")throw new P(k.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+f+"(), but got a "+typeof T);if(!Hp(u)&&T.indexOf("/")!==-1)throw new P(k.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+f+"() must be a plain document ID, but '"+T+"' contains a slash.");var E=u.path.child(st.fromString(T));if(!G.isDocumentKey(E))throw new P(k.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+f+"() must result in a valid document path, but '"+E+"' is not because it contains an odd number of segments.");var N=new G(E);w.push(Da(c,N))}else{var D=WI(l,f,T);w.push(D)}}return new ms(w,g)})(e._query,e.firestore._databaseId,o,t,n,i)}function Xw(e,t,n){if(typeof(n=ht(n))=="string"){if(n==="")throw new P(k.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!Hp(t)&&n.indexOf("/")!==-1)throw new P(k.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var i=t.path.child(st.fromString(n));if(!G.isDocumentKey(i))throw new P(k.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+i+"' is not because it has an odd number of segments ("+i.length+").");return Da(e,new G(i))}if(n instanceof It)return Da(e,n._key);throw new P(k.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+yc(n)+".")}function Qw(e,t){if(!Array.isArray(e)||e.length===0)throw new P(k.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+t.toString()+"' filters.");if(e.length>10)throw new P(k.INVALID_ARGUMENT,"Invalid Query. '"+t.toString()+"' filters support a maximum of 10 elements in the value array.")}function eT(e,t,n){if(!n.isEqual(t))throw new P(k.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+t.toString()+"' and so you must also use '"+t.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}var _d=(function(){function e(){}return e.prototype.convertValue=function(t,n){switch(n===void 0&&(n="none"),jr(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Ct(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,n);case 5:return t.stringValue;case 6:return this.convertBytes(Vi(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,n);case 10:return this.convertObject(t.mapValue,n);default:throw K()}},e.prototype.convertObject=function(t,n){var i=this,o={};return zr(t.fields,(function(u,c){o[u]=i.convertValue(c,n)})),o},e.prototype.convertGeoPoint=function(t){return new wc(Ct(t.latitude),Ct(t.longitude))},e.prototype.convertArray=function(t,n){var i=this;return(t.values||[]).map((function(o){return i.convertValue(o,n)}))},e.prototype.convertServerTimestamp=function(t,n){switch(n){case"previous":var i=E0(t);return i==null?null:this.convertValue(i,n);case"estimate":return this.convertTimestamp(vs(t));default:return null}},e.prototype.convertTimestamp=function(t){var n=Wn(t);return new me(n.seconds,n.nanos)},e.prototype.convertDocumentKey=function(t,n){var i=st.fromString(t);W(J0(i));var o=new Ba(i.get(1),i.get(3)),u=new G(i.popFirst(5));return o.isEqual(n)||Rt("Document "+u+" contains a document reference within a different database ("+o.projectId+"/"+o.database+") which is not supported. It will be treated as a reference in the current database ("+n.projectId+"/"+n.database+") instead."),u},e})();function Ic(e,t,n){return e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t}var PD=(function(e){function t(n){var i=this;return(i=e.call(this)||this).firestore=n,i}return $(t,e),t.prototype.convertBytes=function(n){return new Br(n)},t.prototype.convertReference=function(n){var i=this.convertDocumentKey(n,this.firestore._databaseId);
37return new It(this.firestore,null,i)},t})(_d),xD=(function(){function e(t,n){this._firestore=t,this._commitHandler=n,this._mutations=[],this._committed=!1,this._dataReader=Yr(t)}return e.prototype.set=function(t,n,i){this._verifyNotCommitted();var o=Gn(t,this._firestore),u=Ic(o.converter,n,i),c=bc(this._dataReader,"WriteBatch.set",o._key,u,o.converter!==null,i);return this._mutations.push(c.toMutation(o._key,Qt.none())),this},e.prototype.update=function(t,n,i){for(var o=[],u=3;u<arguments.length;u++)o[u-3]=arguments[u];this._verifyNotCommitted();var c,l=Gn(t,this._firestore);return c=typeof(n=ht(n))=="string"||n instanceof an?bd(this._dataReader,"WriteBatch.update",l._key,n,i,o):wd(this._dataReader,"WriteBatch.update",l._key,n),this._mutations.push(c.toMutation(l._key,Qt.exists(!0))),this},e.prototype.delete=function(t){this._verifyNotCommitted();var n=Gn(t,this._firestore);return this._mutations=this._mutations.concat(new Ks(n._key,Qt.none())),this},e.prototype.commit=function(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()},e.prototype._verifyNotCommitted=function(){if(this._committed)throw new P(k.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},e})();function Gn(e,t){if((e=ht(e)).firestore!==t)throw new P(k.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}var Pr=(function(e){function t(n){var i=this;return(i=e.call(this)||this).firestore=n,i}return $(t,e),t.prototype.convertBytes=function(n){return new Br(n)},t.prototype.convertReference=function(n){var i=this.convertDocumentKey(n,this.firestore._databaseId);return new It(this.firestore,null,i)},t})(_d);function Yw(e,t,n){e=ut(e,It);var i=ut(e.firestore,Lt),o=Ic(e.converter,t,n);return zs(i,[bc(Yr(i),"setDoc",e._key,o,e.converter!==null,n).toMutation(e._key,Qt.none())])}
37function Jw(e,t,n){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];e=ut(e,It);var u=ut(e.firestore,Lt),c=Yr(u);return zs(u,[(typeof(t=ht(t))=="string"||t instanceof an?bd(c,"updateDoc",e._key,t,n,i):wd(c,"updateDoc",e._key,t)).toMutation(e._key,Qt.exists(!0))])}function nT(e){for(var t,n,i,o=[],u=1;u<arguments.length;u++)o[u-1]=arguments[u];e=ht(e);var c={includeMetadataChanges:!1},l=0;typeof o[l]!="object"||Zi(o[l])||(c=o[l],l++);var f,d,g,y={includeMetadataChanges:c.includeMetadataChanges};if(Zi(o[l])){var w=o[l];o[l]=(t=w.next)===null||t===void 0?void 0:t.bind(w),o[l+1]=(n=w.error)===null||n===void 0?void 0:n.bind(w),o[l+2]=(i=w.complete)===null||i===void 0?void 0:i.bind(w)}if(e instanceof It)d=ut(e.firestore,Lt),g=Us(e._key.path),f={next:function(E){o[l]&&o[l](up(d,e,E))},error:o[l+1],complete:o[l+2]};else{var I=ut(e,Re);d=ut(I.firestore,Lt),g=I._query;var T=new Pr(d);f={next:function(E){o[l]&&o[l](new Hn(d,T,I,E))},error:o[l+1],complete:o[l+2]},ZI(e._query)}return(function(E,N,D,F){var C=this,B=new gc(F),x=new ad(N,B,D);return E.asyncQueue.enqueueAndForget((function(){return A(C,void 0,void 0,(function(){var Y;return S(this,(function(_){switch(_.label){case 0:return Y=od,[4,Ji(E)];case 1:return[2,Y.apply(void 0,[_.sent(),x])]}}))}))})),function(){B.Wo(),E.asyncQueue.enqueueAndForget((function(){return A(C,void 0,void 0,(function(){var Y;return S(this,(function(_){switch(_.label){case 0:return Y=sd,[4,Ji(E)];case 1:return[2,Y.apply(void 0,[_.sent(),x])]}}))}))}))}})(Wt(d),g,y,f)}function zs(e,t){return(function(n,i){var o=this,u=new we;return n.asyncQueue.enqueueAndForget((function(){return A(o,void 0,void 0,(function(){var c;return S(this,(function(l){switch(l.label){case 0:return c=XR,[4,FI(n)];case 1:return[2,c.apply(void 0,[l.sent(),i,u])]}}))}))})),u.promise})(Wt(e),t)}function up(e,t,n){var i=n.docs.get(t._key),o=new Pr(e);return new _n(e,o,t._key,i,new Cr(n.hasPendingWrites,n.fromCache),t.converter)}var LD=(function(e){function t(n,i){var o=this;return(o=e.call(this,n,i)||this)._firestore=n,o}return $(t,e),t.prototype.get=function(n){var i=this,o=Gn(n,this._firestore),u=new Pr(this._firestore);return e.prototype.get.call(this,n).then((function(c){return new _n(i._firestore,u,o._key,c._document,new Cr(!1,!1),o.converter)}))},t})((function(){function e(t,n){this._firestore=t,this._transaction=n,this._dataReader=Yr(t)}return e.prototype.get=function(t){var n=this,i=Gn(t,this._firestore),o=new PD(this._firestore);return this._transaction.lookup([i._key]).then((function(u){if(!u||u.length!==1)return K();var c=u[0];if(c.isFoundDocument())return new _s(n._firestore,o,c.key,c,i.converter);if(c.isNoDocument())return new _s(n._firestore,o,i._key,null,i.converter);throw K()}))},e.prototype.set=function(t,n,i){var o=Gn(t,this._firestore),u=Ic(o.converter,n,i),c=bc(this._dataReader,"Transaction.set",o._key,u,o.converter!==null,i);return this._transaction.set(o._key,c),this},e.prototype.update=function(t,n,i){for(var o=[],u=3;u<arguments.length;u++)o[u-3]=arguments[u];var c,l=Gn(t,this._firestore);return c=typeof(n=ht(n))=="string"||n instanceof an?bd(this._dataReader,"Transaction.update",l._key,n,i,o):wd(this._dataReader,"Transaction.update",l._key,n),this._transaction.update(l._key,c),this},e.prototype.delete=function(t){var n=Gn(t,this._firestore);return this._transaction.delete(n._key),this},e})());function Zw(){if(typeof Uint8Array>"u")throw new P(k.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function tb(){if(typeof atob>"u")throw new P(k.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var rT=(function(){function e(t){this._delegate=t}return e.fromBase64String=function(t){return tb(),new e(Br.fromBase64String(t))},e.fromUint8Array=function(t){return Zw(),new e(Br.fromUint8Array(t))},e.prototype.toBase64=function(){return tb(),this._delegate.toBase64()},e.prototype.toUint8Array=function(){return Zw(),this._delegate.toUint8Array()},e.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},e.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},e})(),MD=(function(){function e(){}return e.prototype.enableIndexedDbPersistence=function(t,n){return(function(i,o){Gw(i=ut(i,Lt));var u=Wt(i),c=i._freezeSettings(),l=new op;return Hw(u,l,new PI(l,c.cacheSizeBytes,o?.forceOwnership))})(t._delegate,{forceOwnership:n})},e.prototype.enableMultiTabIndexedDbPersistence=function(t){return(function(n){Gw(n=ut(n,Lt));var i=Wt(n),o=n._freezeSettings(),u=new op;return Hw(i,u,new hD(u,o.cacheSizeBytes))})(t._delegate)},e.prototype.clearIndexedDbPersistence=function(t){return(function(n){var i=this;if(n._initialized&&!n._terminated)throw new P(k.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");var o=new we;return n._queue.enqueueAndForgetEvenWhileRestricted((function(){return A(i,void 0,void 0,(function(){var u;return S(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,(function(l){return A(this,void 0,void 0,(function(){var f;return S(this,(function(d){switch(d.label){case 0:return $i.yt()?(f=l+"main",[4,$i.delete(f)]):[2,Promise.resolve()];case 1:return d.sent(),[2]}}))}))})(Zp(n._databaseId,n._persistenceKey))];case 1:return c.sent(),o.resolve(),[3,3];case 2:return u=c.sent(),o.reject(u),[3,3];case 3:return[2]}}
37))}))})),o.promise})(t._delegate)},e})(),iT=(function(){function e(t,n,i){var o=this;this._delegate=n,this.Zc=i,this.INTERNAL={delete:function(){return o.terminate()}},t instanceof Ba||(this.tu=t)}return Object.defineProperty(e.prototype,"_databaseId",{get:function(){return this._delegate._databaseId},enumerable:!1,configurable:!0}),e.prototype.settings=function(t){var n=this._delegate._getSettings();t.merge||n.host===t.host||Ca("You are overriding the original host. If you did not intend to override your settings, use {merge: true}."),t.merge&&delete(t=Object.assign(Object.assign({},n),t)).merge,this._delegate._setSettings(t)},e.prototype.useEmulator=function(t,n,i){i===void 0&&(i={}),(function(o,u,c,l){var f;l===void 0&&(l={});var d=(o=ut(o,Ts))._getSettings();if(d.host!=="firestore.googleapis.com"&&d.host!==u&&Ca("Host has been set in both settings() and useEmulator(), emulator host will be used"),o._setSettings(Object.assign(Object.assign({},d),{host:u+":"+c,ssl:!1})),l.mockUserToken){var g,y;if(typeof l.mockUserToken=="string")g=l.mockUserToken,y=qt.MOCK_USER;else{g=vb(l.mockUserToken,(f=o._app)===null||f===void 0?void 0:f.options.projectId);var w=l.mockUserToken.sub||l.mockUserToken.user_id;if(!w)throw new P(k.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");y=new qt(w)}o._credentials=new vD(new UI(g,y))}})(this._delegate,t,n,i)},e.prototype.enableNetwork=function(){return(function(t){var n=this;return t.asyncQueue.enqueue((function(){return A(n,void 0,void 0,(function(){var i,o;return S(this,(function(u){switch(u.label){case 0:return[4,xw(t)];case 1:return i=u.sent(),[4,Lw(t)];case 2:return o=u.sent(),[2,(i.setNetworkEnabled(!0),(function(c){var l=U(c);return l.Or.delete(0),Hs(l)})(o))]}}))}))}))})(Wt(ut(this._delegate,Lt)))},e.prototype.disableNetwork=function(){return(function(t){var n=this;return t.asyncQueue.enqueue((function(){return A(n,void 0,void 0,(function(){var i,o;return S(this,(function(u){switch(u.label){case 0:return[4,xw(t)];case 1:return i=u.sent(),[4,Lw(t)];case 2:return o=u.sent(),[2,(i.setNetworkEnabled(!1),(function(c){return A(this,void 0,void 0,(function(){var l;return S(this,(function(f){switch(f.label){case 0:return(l=U(c)).Or.add(0),[4,oo(l)];case 1:return f.sent(),l.Br.set("Offline"),[2]}}))}))})(o))]}}))}))}))})(Wt(ut(this._delegate,Lt)))},e.prototype.enablePersistence=function(t){var n=!1,i=!1;return t&&jI("synchronizeTabs",n=!!t.synchronizeTabs,"experimentalForceOwningTab",i=!!t.experimentalForceOwningTab),n?this.Zc.enableMultiTabIndexedDbPersistence(this):this.Zc.enableIndexedDbPersistence(this,i)},e.prototype.clearPersistence=function(){return this.Zc.clearIndexedDbPersistence(this)},e.prototype.terminate=function(){return this.tu&&(this.tu._removeServiceInstance("firestore"),this.tu._removeServiceInstance("firestore-exp")),this._delegate._delete()},e.prototype.waitForPendingWrites=function(){return(function(t){var n=this,i=new we;return t.asyncQueue.enqueueAndForget((function(){return A(n,void 0,void 0,(function(){var o;return S(this,(function(u){switch(u.label){case 0:return o=ZR,[4,FI(t)];case 1:return[2,o.apply(void 0,[u.sent(),i])]}}))}))})),i.promise})(Wt(ut(this._delegate,Lt)))},e.prototype.onSnapshotsInSync=function(t){return(function(n,i){return(function(o,u){var c=this,l=new gc(u);return o.asyncQueue.enqueueAndForget((function(){return A(c,void 0,void 0,(function(){var f;return S(this,(function(d){switch(d.label){case 0:return f=function(g,y){U(g).Gr.add(y),y.next()},[4,Ji(o)];case 1:return[2,f.apply(void 0,[d.sent(),l])]}}))}))})),function(){l.Wo(),o.asyncQueue.enqueueAndForget((function(){return A(c,void 0,void 0,(function(){var f;return S(this,(function(d){switch(d.label){case 0:return f=function(g,y){U(g).Gr.delete(y)},[4,Ji(o)];case 1:return[2,f.apply(void 0,[d.sent(),l])]}}))}))}))}})(Wt(n=ut(n,Lt)),Zi(i)?i:{next:i})})(this._delegate,t)},Object.defineProperty(e.prototype,"app",{get:function(){if(!this.tu)throw new P(k.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.tu}
37,enumerable:!1,configurable:!0}),e.prototype.collection=function(t){try{return new Ga(this,VI(this._delegate,t))}catch(n){throw oe(n,"collection()","Firestore.collection()")}},e.prototype.doc=function(t){try{return new xr(this,ma(this._delegate,t))}catch(n){throw oe(n,"doc()","Firestore.doc()")}},e.prototype.collectionGroup=function(t){try{return new Ec(this,(function(n,i){if(n=ut(n,Ts),gd("collectionGroup","collection id",i),i.indexOf("/")>=0)throw new P(k.INVALID_ARGUMENT,"Invalid collection ID '"+i+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new Re(n,null,(function(o){return new An(st.emptyPath(),o)})(i))})(this._delegate,t))}catch(n){throw oe(n,"collectionGroup()","Firestore.collectionGroup()")}},e.prototype.runTransaction=function(t){var n=this;return(function(i,o){return(function(u,c){var l=this,f=new we;return u.asyncQueue.enqueueAndForget((function(){return A(l,void 0,void 0,(function(){var d;return S(this,(function(g){switch(g.label){case 0:return[4,(function(y){return mc(y).then((function(w){return w.datastore}))})(u)];case 1:return d=g.sent(),new fD(u.asyncQueue,d,c,f).run(),[2]}}))}))})),f.promise})(Wt(i),(function(u){return o(new LD(i,u))}))})(this._delegate,(function(i){return t(new oT(n,i))}))},e.prototype.batch=function(){var t=this;return Wt(this._delegate),new sT(new xD(this._delegate,(function(n){return zs(t._delegate,n)})))},e.prototype.loadBundle=function(t){throw new P(k.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},e.prototype.namedQuery=function(t){throw new P(k.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},e})(),Tc=(function(e){function t(n){var i=this;return(i=e.call(this)||this).firestore=n,i}return $(t,e),t.prototype.convertBytes=function(n){return new rT(new Br(n))},t.prototype.convertReference=function(n){var i=this.convertDocumentKey(n,this.firestore._databaseId);return xr.eu(i,this.firestore,null)},t})(_d);function FD(e){var t;t=e,$e.setLogLevel(t)}var oT=(function(){function e(t,n){this._firestore=t,this._delegate=n,this._userDataWriter=new Tc(t)}return e.prototype.get=function(t){var n=this,i=Rr(t);return this._delegate.get(i).then((function(o){return new Es(n._firestore,new _n(n._firestore._delegate,n._userDataWriter,o._key,o._document,o.metadata,i.converter))}))},e.prototype.set=function(t,n,i){var o=Rr(t);return i?(md("Transaction.set",i),this._delegate.set(o,n,i)):this._delegate.set(o,n),this},e.prototype.update=function(t,n,i){for(var o,u=[],c=3;c<arguments.length;c++)u[c-3]=arguments[c];var l=Rr(t);return arguments.length===2?this._delegate.update(l,n):(o=this._delegate).update.apply(o,dt([l,n,i],u)),this},e.prototype.delete=function(t){var n=Rr(t);return this._delegate.delete(n),this},e})(),sT=(function(){function e(t){this._delegate=t}return e.prototype.set=function(t,n,i){var o=Rr(t);return i?(md("WriteBatch.set",i),this._delegate.set(o,n,i)):this._delegate.set(o,n),this},e.prototype.update=function(t,n,i){for(var o,u=[],c=3;c<arguments.length;c++)u[c-3]=arguments[c];var l=Rr(t);return arguments.length===2?this._delegate.update(l,n):(o=this._delegate).update.apply(o,dt([l,n,i],u)),this},e.prototype.delete=function(t){var n=Rr(t);return this._delegate.delete(n),this},e.prototype.commit=function(){return this._delegate.commit()},e})(),_c=(function(){function e(t,n,i){this._firestore=t,this._userDataWriter=n,this._delegate=i}return e.prototype.fromFirestore=function(t,n){var i=new us(this._firestore._delegate,this._userDataWriter,t._key,t._document,t.metadata,null);return this._delegate.fromFirestore(new Ss(this._firestore,i),n??{})},e.prototype.toFirestore=function(t,n){return n?this._delegate.toFirestore(t,n):this._delegate.toFirestore(t)},e.nu=function(t,n){var i=e.su,o=i.get(t);o||(o=new WeakMap,i.set(t,o));var u=o.get(n);return u||(u=new e(t,new Tc(t),n),o.set(n,u)),u},e})();_c.su=new WeakMap;var xr=(function(){function e(t,n){this.firestore=t,this._delegate=n,this._userDataWriter=new Tc(t)}return e.iu=function(t,n,i){if(t.length%2!=0)throw new P(k.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t.canonicalString()+" has "+t.length);return new e(n,new It(n._delegate,i,new G(t)))},e.eu=function(t,n,i){return new e(n,new It(n._delegate,i,t))},Object.defineProperty(e.prototype,"id",{get:function(){return this._delegate.id}
37,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new Ga(this.firestore,this._delegate.parent)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),e.prototype.collection=function(t){try{return new Ga(this.firestore,VI(this._delegate,t))}catch(n){throw oe(n,"collection()","DocumentReference.collection()")}},e.prototype.isEqual=function(t){return(t=ht(t))instanceof It&&qI(this._delegate,t)},e.prototype.set=function(t,n){n=md("DocumentReference.set",n);try{return n?Yw(this._delegate,t,n):Yw(this._delegate,t)}catch(i){throw oe(i,"setDoc()","DocumentReference.set()")}},e.prototype.update=function(t,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];try{return arguments.length===1?Jw(this._delegate,t):Jw.apply(void 0,dt([this._delegate,t,n],i))}catch(u){throw oe(u,"updateDoc()","DocumentReference.update()")}},e.prototype.delete=function(){return zs(ut((t=this._delegate).firestore,Lt),[new Ks(t._key,Qt.none())]);var t},e.prototype.onSnapshot=function(){for(var t=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=uT(n),u=aT(n,(function(c){return new Es(t.firestore,new _n(t.firestore._delegate,t._userDataWriter,c._key,c._document,c.metadata,t._delegate.converter))}));return nT(this._delegate,o,u)},e.prototype.get=function(t){var n=this;return(t?.source==="cache"?(function(i){i=ut(i,It);var o=ut(i.firestore,Lt),u=Wt(o),c=new Pr(o);return(function(l,f){var d=this,g=new we;return l.asyncQueue.enqueueAndForget((function(){return A(d,void 0,void 0,(function(){var y;return S(this,(function(w){switch(w.label){case 0:return y=function(I,T,E){return A(this,void 0,void 0,(function(){var N,D;return S(this,(function(F){switch(F.label){case 0:return F.trys.push([0,2,,3]),[4,(function(C,B){var x=U(C);return x.persistence.runTransaction("read document","readonly",(function(Y){return x.Mn.mn(Y,B)}))})(I,T)];case 1:return(D=F.sent()).isFoundDocument()?E.resolve(D):D.isNoDocument()?E.resolve(null):E.reject(new P(k.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")),[3,3];case 2:return N=F.sent(),D=ao(N,"Failed to get document '"+T+" from cache"),E.reject(D),[3,3];case 3:return[2]}}
37))}))},[4,MI(l)];case 1:return[2,y.apply(void 0,[w.sent(),f,g])]}}))}))})),g.promise})(u,i._key).then((function(l){return new _n(o,c,i._key,l,new Cr(l!==null&&l.hasLocalMutations,!0),i.converter)}))})(this._delegate):t?.source==="server"?(function(i){i=ut(i,It);var o=ut(i.firestore,Lt);return Mw(Wt(o),i._key,{source:"server"}).then((function(u){return up(o,i,u)}))})(this._delegate):(function(i){i=ut(i,It);var o=ut(i.firestore,Lt);return Mw(Wt(o),i._key).then((function(u){return up(o,i,u)}))})(this._delegate)).then((function(i){return new Es(n.firestore,new _n(n.firestore._delegate,n._userDataWriter,i._key,i._document,i.metadata,n._delegate.converter))}))},e.prototype.withConverter=function(t){return new e(this.firestore,t?this._delegate.withConverter(_c.nu(this.firestore,t)):this._delegate.withConverter(null))},e})();function oe(e,t,n){return e.message=e.message.replace(t,n),e}function uT(e){for(var t=0,n=e;t<n.length;t++){var i=n[t];if(typeof i=="object"&&!Zi(i))return i}return{}}function aT(e,t){var n,i,o;return{next:function(u){o.next&&o.next(t(u))},error:(n=(o=Zi(e[0])?e[0]:Zi(e[1])?e[1]:typeof e[0]=="function"?{next:e[0],error:e[1],complete:e[2]}:{next:e[1],error:e[2],complete:e[3]}).error)===null||n===void 0?void 0:n.bind(o),complete:(i=o.complete)===null||i===void 0?void 0:i.bind(o)}}var Es=(function(){function e(t,n){this._firestore=t,this._delegate=n}return Object.defineProperty(e.prototype,"ref",{get:function(){return new xr(this._firestore,this._delegate.ref)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return this._delegate.exists()},enumerable:!1,configurable:!0}),e.prototype.data=function(t){return this._delegate.data(t)},e.prototype.get=function(t,n){return this._delegate.get(t,n)},e.prototype.isEqual=function(t){return JI(this._delegate,t._delegate)},e})(),Ss=(function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return $(t,e),t.prototype.data=function(n){return this._delegate.data(n)},t})(Es),Ec=(function(){function e(t,n){this.firestore=t,this._delegate=n,this._userDataWriter=new Tc(t)}return e.prototype.where=function(t,n,i){try{return new e(this.firestore,jn(this._delegate,(function(o,u,c){var l=u,f=Ha("where",o);return new DD(f,l,c)})(t,n,i)))}catch(o){throw oe(o,/(orderBy|where)\(\)/,"Query.$1()")}},e.prototype.orderBy=function(t,n){try{return new e(this.firestore,jn(this._delegate,(function(i,o){o===void 0&&(o="asc");var u=o,c=Ha("orderBy",i);return new OD(c,u)})(t,n)))}catch(i){throw oe(i,/(orderBy|where)\(\)/,"Query.$1()")}},e.prototype.limit=function(t){try{return new e(this.firestore,jn(this._delegate,(function(n){return Bw("limit",n),new zw("limit",n,"F")})(t)))}catch(n){throw oe(n,"limit()","Query.limit()")}},e.prototype.limitToLast=function(t){try{return new e(this.firestore,jn(this._delegate,(function(n){return Bw("limitToLast",n),new zw("limitToLast",n,"L")})(t)))}catch(n){throw oe(n,"limitToLast()","Query.limitToLast()")}},e.prototype.startAt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,jn(this._delegate,(function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return new $w("startAt",i,!0)}).apply(void 0,t)))}catch(i){throw oe(i,"startAt()","Query.startAt()")}},e.prototype.startAfter=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,jn(this._delegate,(function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return new $w("startAfter",i,!1)}).apply(void 0,t)))}catch(i){throw oe(i,"startAfter()","Query.startAfter()")}},e.prototype.endBefore=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,jn(this._delegate,(function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return new Ww("endBefore",i,!0)}).apply(void 0,t)))}catch(i){throw oe(i,"endBefore()","Query.endBefore()")}},e.prototype.endAt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];
37try{return new e(this.firestore,jn(this._delegate,(function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return new Ww("endAt",i,!1)}).apply(void 0,t)))}catch(i){throw oe(i,"endAt()","Query.endAt()")}},e.prototype.isEqual=function(t){return BI(this._delegate,t._delegate)},e.prototype.get=function(t){var n=this;return(t?.source==="cache"?(function(i){i=ut(i,Re);var o=ut(i.firestore,Lt),u=Wt(o),c=new Pr(o);return(function(l,f){var d=this,g=new we;return l.asyncQueue.enqueueAndForget((function(){return A(d,void 0,void 0,(function(){var y;return S(this,(function(w){switch(w.label){case 0:return y=function(I,T,E){return A(this,void 0,void 0,(function(){var N,D,F,C,B;return S(this,(function(x){switch(x.label){case 0:return x.trys.push([0,2,,3]),[4,ja(I,T,!0)];case 1:return B=x.sent(),N=new NI(T,B.Bn),D=N._o(B.documents),F=N.applyChanges(D,!1),E.resolve(F.snapshot),[3,3];case 2:return C=x.sent(),B=ao(C,"Failed to execute query '"+T+" against cache"),E.reject(B),[3,3];case 3:return[2]}}))}))},[4,MI(l)];case 1:return[2,y.apply(void 0,[w.sent(),f,g])]}}))}))})),g.promise})(u,i._query).then((function(l){return new Hn(o,c,i,l)}))})(this._delegate):t?.source==="server"?(function(i){i=ut(i,Re);var o=ut(i.firestore,Lt),u=Wt(o),c=new Pr(o);return Fw(u,i._query,{source:"server"}).then((function(l){return new Hn(o,c,i,l)}))})(this._delegate):(function(i){i=ut(i,Re);var o=ut(i.firestore,Lt),u=Wt(o),c=new Pr(o);return ZI(i._query),Fw(u,i._query).then((function(l){return new Hn(o,c,i,l)}))})(this._delegate)).then((function(i){return new ap(n.firestore,new Hn(n.firestore._delegate,n._userDataWriter,n._delegate,i._snapshot))}))},e.prototype.onSnapshot=function(){for(var t=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=uT(n),u=aT(n,(function(c){return new ap(t.firestore,new Hn(t.firestore._delegate,t._userDataWriter,t._delegate,c._snapshot))}));return nT(this._delegate,o,u)},e.prototype.withConverter=function(t){return new e(this.firestore,t?this._delegate.withConverter(_c.nu(this.firestore,t)):this._delegate.withConverter(null))},e})(),UD=(function(){function e(t,n){this._firestore=t,this._delegate=n}return Object.defineProperty(e.prototype,"type",{get:function(){return this._delegate.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doc",{get:function(){return new Ss(this._firestore,this._delegate.doc)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"oldIndex",{get:function(){return this._delegate.oldIndex},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"newIndex",{get:function(){return this._delegate.newIndex},enumerable:!1,configurable:!0}),e})(),ap=(function(){function e(t,n){this._firestore=t,this._delegate=n}return Object.defineProperty(e.prototype,"query",{get:function(){return new Ec(this._firestore,this._delegate.query)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._delegate.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this._delegate.empty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"docs",{get:function(){var t=this;return this._delegate.docs.map((function(n){return new Ss(t._firestore,n)}))},enumerable:!1,configurable:!0}),e.prototype.docChanges=function(t){var n=this;return this._delegate.docChanges(t).map((function(i){return new UD(n._firestore,i)}))},e.prototype.forEach=function(t,n){var i=this;this._delegate.forEach((function(o){t.call(n,new Ss(i._firestore,o))}))},e.prototype.isEqual=function(t){return JI(this._delegate,t._delegate)},e})(),Ga=(function(e){function t(n,i){var o=this;return(o=e.call(this,n,i)||this).firestore=n,o._delegate=i,o}return $(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var n=this._delegate.parent;
37return n?new xr(this.firestore,n):null},enumerable:!1,configurable:!0}),t.prototype.doc=function(n){try{return new xr(this.firestore,n===void 0?ma(this._delegate):ma(this._delegate,n))}catch(i){throw oe(i,"doc()","CollectionReference.doc()")}},t.prototype.add=function(n){var i=this;return(function(o,u){var c=ut(o.firestore,Lt),l=ma(o),f=Ic(o.converter,u);return zs(c,[bc(Yr(o.firestore),"addDoc",l._key,f,o.converter!==null,{}).toMutation(l._key,Qt.exists(!1))]).then((function(){return l}))})(this._delegate,n).then((function(o){return new xr(i.firestore,o)}))},t.prototype.isEqual=function(n){return qI(this._delegate,n._delegate)},t.prototype.withConverter=function(n){return new t(this.firestore,n?this._delegate.withConverter(_c.nu(this.firestore,n)):this._delegate.withConverter(null))},t})(Ec);function Rr(e){return ut(e,It)}var jD=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._delegate=new(an.bind.apply(an,dt([void 0],t)))}return e.documentId=function(){return new e(Qe.keyField().canonicalString())},e.prototype.isEqual=function(t){return(t=ht(t))instanceof an&&this._delegate._internalPath.isEqual(t._internalPath)},e})(),VD=(function(){function e(t){this._delegate=t}return e.serverTimestamp=function(){var t=new ED("serverTimestamp");return t._methodName="FieldValue.serverTimestamp",new e(t)},e.delete=function(){var t=new yd("deleteField");return t._methodName="FieldValue.delete",new e(t)},e.arrayUnion=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=(function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return new SD("arrayUnion",o)}).apply(void 0,t);return i._methodName="FieldValue.arrayUnion",new e(i)},e.arrayRemove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=(function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return new AD("arrayRemove",o)}).apply(void 0,t);return i._methodName="FieldValue.arrayRemove",new e(i)},e.increment=function(t){var n=(function(i){return new kD("increment",i)})(t);return n._methodName="FieldValue.increment",new e(n)},e.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},e})(),qD={Firestore:iT,GeoPoint:wc,Timestamp:me,Blob:rT,Transaction:oT,WriteBatch:sT,DocumentReference:xr,DocumentSnapshot:Es,Query:Ec,QueryDocumentSnapshot:Ss,QuerySnapshot:ap,CollectionReference:Ga,FieldPath:jD,FieldValue:VD,setLogLevel:FD,CACHE_SIZE_UNLIMITED:bD};function BD(e){(function(t,n){t.INTERNAL.registerComponent(new Hr("firestore",(function(i){var o=i.getProvider("app").getImmediate();return n(o,i.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},qD)))})(e,(function(t,n){return new iT(t,new Lt(t,n),new MD)})),e.registerVersion("@firebase/firestore","2.4.1")}BD(H);function KD(e){return Array.prototype.slice.call(e)}function cT(e){return new Promise(function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function Ed(e,t,n){var i,o=new Promise(function(u,c){i=e[t].apply(e,n),cT(i).then(u,c)});return o.request=i,o}function HD(e,t,n){var i=Ed(e,t,n);return i.then(function(o){if(o)return new As(o,i.request)})}function co(e,t,n){n.forEach(function(i){Object.defineProperty(e.prototype,i,{get:function(){return this[t][i]},set:function(o){this[t][i]=o}})})}function Sd(e,t,n,i){i.forEach(function(o){o in n.prototype&&(e.prototype[o]=function(){return Ed(this[t],o,arguments)})})}function Sc(e,t,n,i){i.forEach(function(o){o in n.prototype&&(e.prototype[o]=function(){return this[t][o].apply(this[t],arguments)})})}function hT(e,t,n,i){i.forEach(function(o){o in n.prototype&&(e.prototype[o]=function(){return HD(this[t],o,arguments)})})}function Zr(e){this._index=e}co(Zr,"_index",["name","keyPath","multiEntry","unique"]);Sd(Zr,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]);
37hT(Zr,"_index",IDBIndex,["openCursor","openKeyCursor"]);function As(e,t){this._cursor=e,this._request=t}co(As,"_cursor",["direction","key","primaryKey","value"]);Sd(As,"_cursor",IDBCursor,["update","delete"]);["advance","continue","continuePrimaryKey"].forEach(function(e){e in IDBCursor.prototype&&(As.prototype[e]=function(){var t=this,n=arguments;return Promise.resolve().then(function(){return t._cursor[e].apply(t._cursor,n),cT(t._request).then(function(i){if(i)return new As(i,t._request)})})})});function fn(e){this._store=e}fn.prototype.createIndex=function(){return new Zr(this._store.createIndex.apply(this._store,arguments))};fn.prototype.index=function(){return new Zr(this._store.index.apply(this._store,arguments))};co(fn,"_store",["name","keyPath","indexNames","autoIncrement"]);Sd(fn,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]);hT(fn,"_store",IDBObjectStore,["openCursor","openKeyCursor"]);Sc(fn,"_store",IDBObjectStore,["deleteIndex"]);function $s(e){this._tx=e,this.complete=new Promise(function(t,n){e.oncomplete=function(){t()},e.onerror=function(){n(e.error)},e.onabort=function(){n(e.error)}})}$s.prototype.objectStore=function(){return new fn(this._tx.objectStore.apply(this._tx,arguments))};co($s,"_tx",["objectStoreNames","mode"]);Sc($s,"_tx",IDBTransaction,["abort"]);function Ac(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new $s(n)}Ac.prototype.createObjectStore=function(){return new fn(this._db.createObjectStore.apply(this._db,arguments))};co(Ac,"_db",["name","version","objectStoreNames"]);Sc(Ac,"_db",IDBDatabase,["deleteObjectStore","close"]);function kc(e){this._db=e}kc.prototype.transaction=function(){return new $s(this._db.transaction.apply(this._db,arguments))};co(kc,"_db",["name","version","objectStoreNames"]);Sc(kc,"_db",IDBDatabase,["close"]);
37["openCursor","openKeyCursor"].forEach(function(e){[fn,Zr].forEach(function(t){e in t.prototype&&(t.prototype[e.replace("open","iterate")]=function(){var n=KD(arguments),i=n[n.length-1],o=this._store||this._index,u=o[e].apply(o,n.slice(0,-1));u.onsuccess=function(){i(u.result)}})})});[Zr,fn].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(t,n){var i=this,o=[];return new Promise(function(u){i.iterateCursor(t,function(c){if(!c){u(o);return}if(o.push(c.value),n!==void 0&&o.length==n){u(o);return}c.continue()})})})});function GD(e,t,n){var i=Ed(indexedDB,"open",[e,t]),o=i.request;return o&&(o.onupgradeneeded=function(u){n&&n(new Ac(o.result,u.oldVersion,o.transaction))}),i.then(function(u){return new kc(u)})}var zD="@firebase/installations",lT="0.4.32";var fT=1e4,pT="w:"+lT,dT="FIS_v2",$D="https://firebaseinstallations.googleapis.com/v1",WD=3600*1e3,XD="installations",QD="Installations";var Vn,YD=(Vn={},Vn["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',Vn["not-registered"]="Firebase Installation is not registered.",Vn["installation-not-found"]="Firebase Installation not found.",Vn["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',Vn["app-offline"]="Could not process request. Application offline.",Vn["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",Vn),Sn=new Cs(XD,QD,YD);function vT(e){return e instanceof Ns&&e.code.includes("request-failed")}function Ad(e){var t=e.projectId;return $D+"/projects/"+t+"/installations"}function gT(e){return{token:e.token,requestStatus:2,expiresIn:JD(e.expiresIn),creationTime:Date.now()}}function kd(e,t){return A(this,void 0,void 0,function(){var n,i;return S(this,function(o){switch(o.label){case 0:return[4,t.json()];case 1:return n=o.sent(),i=n.error,[2,Sn.create("request-failed",{requestName:e,serverCode:i.code,serverMessage:i.message,serverStatus:i.status})]}})})}function mT(e){var t=e.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function yT(e,t){var n=t.refreshToken,i=mT(e);return i.append("Authorization",ZD(n)),i}function Nd(e){return A(this,void 0,void 0,function(){var t;return S(this,function(n){switch(n.label){case 0:return[4,e()];case 1:return t=n.sent(),t.status>=500&&t.status<600?[2,e()]:[2,t]}})})}function JD(e){return Number(e.replace("s","000"))}function ZD(e){return dT+" "+e}function tO(e,t){var n=t.fid;return A(this,void 0,void 0,function(){var i,o,u,c,l,f,d;return S(this,function(g){switch(g.label){case 0:return i=Ad(e),o=mT(e),u={fid:n,authVersion:dT,appId:e.appId,sdkVersion:pT},c={method:"POST",headers:o,body:JSON.stringify(u)},[4,Nd(function(){return fetch(i,c)})];case 1:return l=g.sent(),l.ok?[4,l.json()]:[3,3];case 2:return f=g.sent(),d={fid:f.fid||n,registrationStatus:2,refreshToken:f.refreshToken,authToken:gT(f.authToken)},[2,d];case 3:return[4,kd("Create Installation",l)];case 4:throw g.sent()}})})}function wT(e){return new Promise(function(t){setTimeout(t,e)})}function eO(e){var t=btoa(String.fromCharCode.apply(String,dt([],Zo(e))));return t.replace(/\+/g,"-").replace(/\//g,"_")}var nO=/^[cdef][\w-]{21}$/,cp="";function rO(){try{var e=new Uint8Array(17),t=self.crypto||self.msCrypto;t.getRandomValues(e),e[0]=112+e[0]%16;var n=iO(e);return nO.test(n)?n:cp}catch{return cp}}function iO(e){var t=eO(e);return t.substr(0,22)}function ho(e){return e.appName+"!"+e.appId}var to=new Map;function bT(e,t){var n=ho(e);IT(n,t),uO(n,t)}function oO(e,t){TT();var n=ho(e),i=to.get(n);i||(i=new Set,to.set(n,i)),i.add(t)}function sO(e,t){var n=ho(e),i=to.get(n);i&&(i.delete(t),i.size===0&&to.delete(n),_T())}function IT(e,t){var n,i,o=to.get(e);if(o)try{for(var u=ns(o),c=u.next();!c.done;c=u.next()){var l=c.value;l(t)}}catch(f){n={error:f}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}function uO(e,t){var n=TT();n&&n.postMessage({key:e,fid:t}),_T()}var Dr=null;function TT(){return!Dr&&"BroadcastChannel"in self&&(Dr=new BroadcastChannel("[Firebase] FID Change"),Dr.onmessage=function(e){IT(e.data.key,e.data.fid)}),Dr}function _T(){to.size===0&&Dr&&(Dr.close(),Dr=null)}var aO="firebase-installations-database",cO=1,Kr="firebase-installations-store",kf=null;function Cd(){return kf||(kf=GD(aO,cO,function(e){e.oldVersion===0&&e.createObjectStore(Kr)})),kf}function za(e,t){return A(this,void 0,void 0,function(){var n,i,o,u,c;return S(this,function(l){switch(l.label){case 0:return n=ho(e),[4,Cd()];case 1:return i=l.sent(),o=i.transaction(Kr,"readwrite"),u=o.objectStore(Kr),[4,u.get(n)];case 2:return c=l.sent(),[4,u.put(t,n)];case 3:return l.sent(),[4,o.complete];case 4:return l.sent(),(!c||c.fid!==t.fid)&&bT(e,t.fid),[2,t]}})})}function Rd(e){return A(this,void 0,void 0,function(){var t,n,i;return S(this,function(o){switch(o.label){case 0:return t=ho(e),[4,Cd()];case 1:return n=o.sent(),i=n.transaction(Kr,"readwrite"),[4,i.objectStore(Kr).delete(t)];case 2:return o.sent(),[4,i.complete];case 3:return o.sent(),[2]}})})}function Ws(e,t){return A(this,void 0,void 0,function(){var n,i,o,u,c,l;return S(this,function(f){switch(f.label){case 0:return n=ho(e),[4,Cd()];case 1:return i=f.sent(),o=i.transaction(Kr,"readwrite"),u=o.objectStore(Kr),[4,u.get(n)];
37case 2:return c=f.sent(),l=t(c),l!==void 0?[3,4]:[4,u.delete(n)];case 3:return f.sent(),[3,6];case 4:return[4,u.put(l,n)];case 5:f.sent(),f.label=6;case 6:return[4,o.complete];case 7:return f.sent(),l&&(!c||c.fid!==l.fid)&&bT(e,l.fid),[2,l]}})})}function Dd(e){return A(this,void 0,void 0,function(){var t,n,i;return S(this,function(o){switch(o.label){case 0:return[4,Ws(e,function(u){var c=hO(u),l=lO(e,c);return t=l.registrationPromise,l.installationEntry})];case 1:return n=o.sent(),n.fid!==cp?[3,3]:(i={},[4,t]);case 2:return[2,(i.installationEntry=o.sent(),i)];case 3:return[2,{installationEntry:n,registrationPromise:t}]}})})}function hO(e){var t=e||{fid:rO(),registrationStatus:0};return ET(t)}function lO(e,t){if(t.registrationStatus===0){if(!navigator.onLine){var n=Promise.reject(Sn.create("app-offline"));return{installationEntry:t,registrationPromise:n}}var i={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},o=fO(e,i);return{installationEntry:i,registrationPromise:o}}else return t.registrationStatus===1?{installationEntry:t,registrationPromise:pO(e)}:{installationEntry:t}}function fO(e,t){return A(this,void 0,void 0,function(){var n,i;return S(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,7]),[4,tO(e,t)];case 1:return n=o.sent(),[2,za(e,n)];case 2:return i=o.sent(),vT(i)&&i.customData.serverCode===409?[4,Rd(e)]:[3,4];case 3:return o.sent(),[3,6];case 4:return[4,za(e,{fid:t.fid,registrationStatus:0})];case 5:o.sent(),o.label=6;case 6:throw i;case 7:return[2]}})})}function pO(e){return A(this,void 0,void 0,function(){var t,n,i,o;return S(this,function(u){switch(u.label){case 0:return[4,eb(e)];case 1:t=u.sent(),u.label=2;case 2:return t.registrationStatus!==1?[3,5]:[4,wT(100)];case 3:return u.sent(),[4,eb(e)];case 4:return t=u.sent(),[3,2];case 5:return t.registrationStatus!==0?[3,7]:[4,Dd(e)];case 6:return n=u.sent(),i=n.installationEntry,o=n.registrationPromise,o?[2,o]:[2,i];case 7:return[2,t]}})})}function eb(e){return Ws(e,function(t){if(!t)throw Sn.create("installation-not-found");return ET(t)})}function ET(e){return dO(e)?{fid:e.fid,registrationStatus:0}:e}function dO(e){return e.registrationStatus===1&&e.registrationTime+fT<Date.now()}function vO(e,t){var n=e.appConfig,i=e.platformLoggerProvider;return A(this,void 0,void 0,function(){var o,u,c,l,f,d,g,y;return S(this,function(w){switch(w.label){case 0:return o=gO(n,t),u=yT(n,t),c=i.getImmediate({optional:!0}),c&&u.append("x-firebase-client",c.getPlatformInfoString()),l={installation:{sdkVersion:pT}},f={method:"POST",headers:u,body:JSON.stringify(l)},[4,Nd(function(){return fetch(o,f)})];case 1:return d=w.sent(),d.ok?[4,d.json()]:[3,3];case 2:return g=w.sent(),y=gT(g),[2,y];case 3:return[4,kd("Generate Auth Token",d)];case 4:throw w.sent()}})})}function gO(e,t){var n=t.fid;return Ad(e)+"/"+n+"/authTokens:generate"}function Od(e,t){return t===void 0&&(t=!1),A(this,void 0,void 0,function(){var n,i,o,u;return S(this,function(c){switch(c.label){case 0:return[4,Ws(e.appConfig,function(l){if(!ST(l))throw Sn.create("not-registered");var f=l.authToken;if(!t&&wO(f))return l;if(f.requestStatus===1)return n=mO(e,t),l;if(!navigator.onLine)throw Sn.create("app-offline");var d=IO(l);return n=yO(e,d),d})];case 1:return i=c.sent(),n?[4,n]:[3,3];case 2:return u=c.sent(),[3,4];case 3:u=i.authToken,c.label=4;case 4:return o=u,[2,o]}})})}function mO(e,t){return A(this,void 0,void 0,function(){var n,i;return S(this,function(o){switch(o.label){case 0:return[4,nb(e.appConfig)];case 1:n=o.sent(),o.label=2;case 2:return n.authToken.requestStatus!==1?[3,5]:[4,wT(100)];case 3:return o.sent(),[4,nb(e.appConfig)];case 4:return n=o.sent(),[3,2];case 5:return i=n.authToken,i.requestStatus===0?[2,Od(e,t)]:[2,i]}})})}function nb(e){return Ws(e,function(t){if(!ST(t))throw Sn.create("not-registered");var n=t.authToken;return TO(n)?Xt(Xt({},t),{authToken:{requestStatus:0}}):t})}function yO(e,t){return A(this,void 0,void 0,function(){var n,o,i,o;return S(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,8]),[4,vO(e,t)];case 1:return n=u.sent(),o=Xt(Xt({},t),{authToken:n}),[4,za(e.appConfig,o)];case 2:return u.sent(),[2,n];case 3:return i=u.sent(),vT(i)&&(i.customData.serverCode===401||i.customData.serverCode===404)?[4,Rd(e.appConfig)]:[3,5];case 4:return u.sent(),[3,7];case 5:return o=Xt(Xt({},t),{authToken:{requestStatus:0}}),[4,za(e.appConfig,o)];case 6:u.sent(),u.label=7;case 7:throw i;case 8:return[2]}})})}function ST(e){return e!==void 0&&e.registrationStatus===2}function wO(e){return e.requestStatus===2&&!bO(e)}function bO(e){var t=Date.now();
37return t<e.creationTime||e.creationTime+e.expiresIn<t+WD}function IO(e){var t={requestStatus:1,requestTime:Date.now()};return Xt(Xt({},e),{authToken:t})}function TO(e){return e.requestStatus===1&&e.requestTime+fT<Date.now()}function _O(e){return A(this,void 0,void 0,function(){var t,n,i;return S(this,function(o){switch(o.label){case 0:return[4,Dd(e.appConfig)];case 1:return t=o.sent(),n=t.installationEntry,i=t.registrationPromise,i?i.catch(console.error):Od(e).catch(console.error),[2,n.fid]}})})}function EO(e,t){return t===void 0&&(t=!1),A(this,void 0,void 0,function(){var n;return S(this,function(i){switch(i.label){case 0:return[4,SO(e.appConfig)];case 1:return i.sent(),[4,Od(e,t)];case 2:return n=i.sent(),[2,n.token]}})})}function SO(e){return A(this,void 0,void 0,function(){var t;return S(this,function(n){switch(n.label){case 0:return[4,Dd(e)];case 1:return t=n.sent().registrationPromise,t?[4,t]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})}function AO(e,t){return A(this,void 0,void 0,function(){var n,i,o,u;return S(this,function(c){switch(c.label){case 0:return n=kO(e,t),i=yT(e,t),o={method:"DELETE",headers:i},[4,Nd(function(){return fetch(n,o)})];case 1:return u=c.sent(),u.ok?[3,3]:[4,kd("Delete Installation",u)];case 2:throw c.sent();case 3:return[2]}})})}function kO(e,t){var n=t.fid;return Ad(e)+"/"+n}function NO(e){return A(this,void 0,void 0,function(){var t,n;return S(this,function(i){switch(i.label){case 0:return t=e.appConfig,[4,Ws(t,function(o){if(!(o&&o.registrationStatus===0))return o})];case 1:if(n=i.sent(),!n)return[3,6];if(n.registrationStatus!==1)return[3,2];throw Sn.create("delete-pending-registration");case 2:if(n.registrationStatus!==2)return[3,6];if(navigator.onLine)return[3,3];throw Sn.create("app-offline");case 3:return[4,AO(t,n)];case 4:return i.sent(),[4,Rd(t)];case 5:i.sent(),i.label=6;case 6:return[2]}})})}function CO(e,t){var n=e.appConfig;return oO(n,t),function(){sO(n,t)}}function RO(e){var t,n;if(!e||!e.options)throw Nf("App Configuration");if(!e.name)throw Nf("App Name");var i=["projectId","apiKey","appId"];try{for(var o=ns(i),u=o.next();!u.done;u=o.next()){var c=u.value;if(!e.options[c])throw Nf(c)}}
37catch(l){t={error:l}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}function Nf(e){return Sn.create("missing-app-config-values",{valueName:e})}function DO(e){var t="installations";e.INTERNAL.registerComponent(new Hr(t,function(n){var i=n.getProvider("app").getImmediate(),o=RO(i),u=n.getProvider("platform-logger"),c={appConfig:o,platformLoggerProvider:u},l={app:i,getId:function(){return _O(c)},getToken:function(f){return EO(c,f)},delete:function(){return NO(c)},onIdChange:function(f){return CO(c,f)}};return l},"PUBLIC")),e.registerVersion(zD,lT)}DO(H);var OO=(function(){function e(t,n,i,o){this.client=t,this.storage=n,this.storageCache=i,this.logger=o}return e.prototype.isCachedDataFresh=function(t,n){if(!n)return this.logger.debug("Config fetch cache check. Cache unpopulated."),!1;var i=Date.now()-n,o=i<=t;return this.logger.debug("Config fetch cache check."+(" Cache age millis: "+i+".")+(" Cache max age millis (minimumFetchIntervalMillis setting): "+t+".")+(" Is cache hit: "+o+".")),o},e.prototype.fetch=function(t){return A(this,void 0,void 0,function(){var n,i,o,u,c;return S(this,function(l){switch(l.label){case 0:return[4,Promise.all([this.storage.getLastSuccessfulFetchTimestampMillis(),this.storage.getLastSuccessfulFetchResponse()])];case 1:return n=l.sent(),i=n[0],o=n[1],o&&this.isCachedDataFresh(t.cacheMaxAgeMillis,i)?[2,o]:(t.eTag=o&&o.eTag,[4,this.client.fetch(t)]);case 2:return u=l.sent(),c=[this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())],u.status===200&&c.push(this.storage.setLastSuccessfulFetchResponse(u)),[4,Promise.all(c)];case 3:return l.sent(),[2,u]}})})},e})();var re,PO=(re={},re["registration-window"]="Undefined window object. This SDK only supports usage in a browser environment.",re["registration-project-id"]="Undefined project identifier. Check Firebase app initialization.",re["registration-api-key"]="Undefined API key. Check Firebase app initialization.",re["registration-app-id"]="Undefined app identifier. Check Firebase app initialization.",re["storage-open"]="Error thrown when opening storage. Original error: {$originalErrorMessage}.",re["storage-get"]="Error thrown when reading from storage. Original error: {$originalErrorMessage}.",re["storage-set"]="Error thrown when writing to storage. Original error: {$originalErrorMessage}.",re["storage-delete"]="Error thrown when deleting from storage. Original error: {$originalErrorMessage}.",re["fetch-client-network"]="Fetch client failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.",re["fetch-timeout"]='The config fetch request timed out. Configure timeout using "fetchTimeoutMillis" SDK setting.',re["fetch-throttle"]='The config fetch request timed out while in an exponential backoff state. Configure timeout using "fetchTimeoutMillis" SDK setting. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',re["fetch-client-parse"]="Fetch client could not parse response. Original error: {$originalErrorMessage}.",re["fetch-status"]="Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.",re),Me=new Cs("remoteconfig","Remote Config",PO);function xO(e,t){return e instanceof Ns&&e.code.indexOf(t)!==-1}function LO(e){return e===void 0&&(e=navigator),e.languages&&e.languages[0]||e.language}var MO=(function(){function e(t,n,i,o,u,c){this.firebaseInstallations=t,this.sdkVersion=n,this.namespace=i,this.projectId=o,this.apiKey=u,this.appId=c}return e.prototype.fetch=function(t){return A(this,void 0,void 0,function(){var n,i,o,u,c,l,f,d,g,y,w,I,T,E,N,D,F,C,B;return S(this,function(x){switch(x.label){case 0:return[4,Promise.all([this.firebaseInstallations.getId(),this.firebaseInstallations.getToken()])];case 1:n=x.sent(),i=n[0],o=n[1],u=window.FIREBASE_REMOTE_CONFIG_URL_BASE||"https://firebaseremoteconfig.googleapis.com",c=u+"/v1/projects/"+this.projectId+"/namespaces/"+this.namespace+":fetch?key="+this.apiKey,l={"Content-Type":"application/json","Content-Encoding":"gzip","If-None-Match":t.eTag||"*"},f={sdk_version:this.sdkVersion,app_instance_id:i,app_instance_id_token:o,app_id:this.appId,language_code:LO()},d={method:"POST",headers:l,body:JSON.stringify(f)},g=fetch(c,d),y=new Promise(function(Y,_){t.signal.addEventListener(function(){var te=new Error("The operation was aborted.");te.name="AbortError",_(te)})}),x.label=2;
37case 2:return x.trys.push([2,5,,6]),[4,Promise.race([g,y])];case 3:return x.sent(),[4,g];case 4:return w=x.sent(),[3,6];case 5:throw I=x.sent(),T="fetch-client-network",I.name==="AbortError"&&(T="fetch-timeout"),Me.create(T,{originalErrorMessage:I.message});case 6:if(E=w.status,N=w.headers.get("ETag")||void 0,w.status!==200)return[3,11];C=void 0,x.label=7;case 7:return x.trys.push([7,9,,10]),[4,w.json()];case 8:return C=x.sent(),[3,10];case 9:throw B=x.sent(),Me.create("fetch-client-parse",{originalErrorMessage:B.message});case 10:D=C.entries,F=C.state,x.label=11;case 11:if(F==="INSTANCE_STATE_UNSPECIFIED"?E=500:F==="NO_CHANGE"?E=304:(F==="NO_TEMPLATE"||F==="EMPTY_CONFIG")&&(D={}),E!==304&&E!==200)throw Me.create("fetch-status",{httpStatus:E});return[2,{status:E,eTag:N,config:D}]}})})},e})();var FO=(function(){function e(){this.listeners=[]}return e.prototype.addEventListener=function(t){this.listeners.push(t)},e.prototype.abort=function(){this.listeners.forEach(function(t){return t()})},e})();var UO=!1,jO="",rb=0,VO=["1","true","t","yes","y","on"],Cf=(function(){function e(t,n){n===void 0&&(n=jO),this._source=t,this._value=n}return e.prototype.asString=function(){return this._value},e.prototype.asBoolean=function(){return this._source==="static"?UO:VO.indexOf(this._value.toLowerCase())>=0},e.prototype.asNumber=function(){if(this._source==="static")return rb;var t=Number(this._value);return isNaN(t)&&(t=rb),t},e.prototype.getSource=function(){return this._source},e})();var qO=60*1e3,BO=720*60*1e3,KO=(function(){function e(t,n,i,o,u){this.app=t,this._client=n,this._storageCache=i,this._storage=o,this._logger=u,this._isInitializationComplete=!1,this.settings={fetchTimeoutMillis:qO,minimumFetchIntervalMillis:BO},this.defaultConfig={}}return e.prototype.setLogLevel=function(t){switch(t){case"debug":this._logger.logLevel=nt.DEBUG;break;case"silent":this._logger.logLevel=nt.SILENT;break;default:this._logger.logLevel=nt.ERROR}},Object.defineProperty(e.prototype,"fetchTimeMillis",{get:function(){return this._storageCache.getLastSuccessfulFetchTimestampMillis()||-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastFetchStatus",{get:function(){return this._storageCache.getLastFetchStatus()||"no-fetch-yet"},enumerable:!1,configurable:!0}),e.prototype.activate=function(){return A(this,void 0,void 0,function(){var t,n,i;return S(this,function(o){switch(o.label){case 0:return[4,Promise.all([this._storage.getLastSuccessfulFetchResponse(),this._storage.getActiveConfigEtag()])];case 1:return t=o.sent(),n=t[0],i=t[1],!n||!n.config||!n.eTag||n.eTag===i?[2,!1]:[4,Promise.all([this._storageCache.setActiveConfig(n.config),this._storage.setActiveConfigEtag(n.eTag)])];case 2:return o.sent(),[2,!0]}})})},e.prototype.ensureInitialized=function(){var t=this;return this._initializePromise||(this._initializePromise=this._storageCache.loadFromStorage().then(function(){t._isInitializationComplete=!0})),this._initializePromise},e.prototype.fetch=function(){return A(this,void 0,void 0,function(){var t,n,i,o=this;return S(this,function(u){switch(u.label){case 0:t=new FO,setTimeout(function(){return A(o,void 0,void 0,function(){return S(this,function(c){return t.abort(),[2]})})},this.settings.fetchTimeoutMillis),u.label=1;case 1:return u.trys.push([1,4,,6]),[4,this._client.fetch({cacheMaxAgeMillis:this.settings.minimumFetchIntervalMillis,signal:t})];case 2:return u.sent(),[4,this._storageCache.setLastFetchStatus("success")];case 3:return u.sent(),[3,6];case 4:return n=u.sent(),i=xO(n,"fetch-throttle")?"throttle":"failure",[4,this._storageCache.setLastFetchStatus(i)];case 5:throw u.sent(),n;case 6:return[2]}})})},e.prototype.fetchAndActivate=function(){return A(this,void 0,void 0,function(){return S(this,function(t){switch(t.label){case 0:return[4,this.fetch()];case 1:return t.sent(),[2,this.activate()]}})})},e.prototype.getAll=function(){var t=this;return HO(this._storageCache.getActiveConfig(),this.defaultConfig).reduce(function(n,i){return n[i]=t.getValue(i),n},{})},e.prototype.getBoolean=function(t){return this.getValue(t).asBoolean()},e.prototype.getNumber=function(t){return this.getValue(t).asNumber()},e.prototype.getString=function(t){return this.getValue(t).asString()},e.prototype.getValue=function(t){this._isInitializationComplete||this._logger.debug('A value was requested for key "'+t+'" before SDK initialization completed. Await on ensureInitialized if the intent was to get a previously activated value.');var n=this._storageCache.getActiveConfig();return n&&n[t]!==void 0?new Cf("remote",n[t]):this.defaultConfig&&this.defaultConfig[t]!==void 0?new Cf("default",String(this.defaultConfig[t])):(this._logger.debug('Returning static value for key "'+t+'". Define a default or remote value if this is unintentional.'),new Cf("static"))},e})();function HO(e,t){return e===void 0&&(e={}),t===void 0&&(t={}),Object.keys(Xt(Xt({},e),t))}function ya(e,t){var n=e.target.error||void 0;return Me.create(t,{originalErrorMessage:n&&n.message})}var Sr="app_namespace_store",GO="firebase_remote_config",zO=1;function $O(){return new Promise(function(e,t){var n=indexedDB.open(GO,zO);n.onerror=function(i){t(ya(i,"storage-open"))},n.onsuccess=function(i){e(i.target.result)},n.onupgradeneeded=function(i){var o=i.target.result;i.oldVersion===0&&o.createObjectStore(Sr,{keyPath:"compositeKey"})}})}var WO=(function(){function e(t,n,i,o){o===void 0&&(o=$O()),this.appId=t,this.appName=n,this.namespace=i,this.openDbPromise=o}return e.prototype.getLastFetchStatus=function(){return this.get("last_fetch_status")},e.prototype.setLastFetchStatus=function(t){return this.set("last_fetch_status",t)},e.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.get("last_successful_fetch_timestamp_millis")},e.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.set("last_successful_fetch_timestamp_millis",t)},e.prototype.getLastSuccessfulFetchResponse=function(){return this.get("last_successful_fetch_response")},e.prototype.setLastSuccessfulFetchResponse=function(t){return this.set("last_successful_fetch_response",t)},e.prototype.getActiveConfig=function(){return this.get("active_config")},e.prototype.setActiveConfig=function(t){return this.set("active_config",t)},e.prototype.getActiveConfigEtag=function(){return this.get("active_config_etag")},e.prototype.setActiveConfigEtag=function(t){return this.set("active_config_etag",t)},e.prototype.getThrottleMetadata=function(){return this.get("throttle_metadata")},e.prototype.setThrottleMetadata=function(t){return this.set("throttle_metadata",t)},e.prototype.deleteThrottleMetadata=function(){return this.delete("throttle_metadata")},e.prototype.get=function(t){return A(this,void 0,void 0,function(){var n,i=this;return S(this,function(o){switch(o.label){case 0:return[4,this.openDbPromise];case 1:return n=o.sent(),[2,new Promise(function(u,c){var l=n.transaction([Sr],"readonly"),f=l.objectStore(Sr),d=i.createCompositeKey(t);try{var g=f.get(d);g.onerror=function(y){c(ya(y,"storage-get"))},g.onsuccess=function(y){var w=y.target.result;u(w?w.value:void 0)}}catch(y){c(Me.create("storage-get",{originalErrorMessage:y&&y.message}))}})]}})})},e.prototype.set=function(t,n){return A(this,void 0,void 0,function(){var i,o=this;return S(this,function(u){switch(u.label){case 0:return[4,this.openDbPromise];case 1:return i=u.sent(),[2,new Promise(function(c,l){var f=i.transaction([Sr],"readwrite"),d=f.objectStore(Sr),g=o.createCompositeKey(t);try{var y=d.put({compositeKey:g,value:n});y.onerror=function(w){l(ya(w,"storage-set"))},y.onsuccess=function(){c()}}catch(w){l(Me.create("storage-set",{originalErrorMessage:w&&w.message}))}})]}})})},e.prototype.delete=function(t){return A(this,void 0,void 0,function(){var n,i=this;return S(this,function(o){switch(o.label){case 0:return[4,this.openDbPromise];case 1:return n=o.sent(),[2,new Promise(function(u,c){var l=n.transaction([Sr],"readwrite"),f=l.objectStore(Sr),d=i.createCompositeKey(t);try{var g=f.delete(d);g.onerror=function(y){c(ya(y,"storage-delete"))},g.onsuccess=function(){u()}}catch(y){c(Me.create("storage-delete",{originalErrorMessage:y&&y.message}))}})]}})})},e.prototype.createCompositeKey=function(t){return[this.appId,this.appName,this.namespace,t].join()},e})();var XO=(function(){function e(t){this.storage=t}return e.prototype.getLastFetchStatus=function(){return this.lastFetchStatus},e.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.lastSuccessfulFetchTimestampMillis},e.prototype.getActiveConfig=function(){return this.activeConfig},e.prototype.loadFromStorage=function(){return A(this,void 0,void 0,function(){var t,n,i,o,u,c;return S(this,function(l){switch(l.label){case 0:return t=this.storage.getLastFetchStatus(),n=this.storage.getLastSuccessfulFetchTimestampMillis(),i=this.storage.getActiveConfig(),[4,t];case 1:return o=l.sent(),o&&(this.lastFetchStatus=o),[4,n];case 2:return u=l.sent(),u&&(this.lastSuccessfulFetchTimestampMillis=u),[4,i];case 3:return c=l.sent(),c&&(this.activeConfig=c),[2]}})})},e.prototype.setLastFetchStatus=function(t){return this.lastFetchStatus=t,this.storage.setLastFetchStatus(t)},e.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.lastSuccessfulFetchTimestampMillis=t,this.storage.setLastSuccessfulFetchTimestampMillis(t)},e.prototype.setActiveConfig=function(t){return this.activeConfig=t,this.storage.setActiveConfig(t)},e})();function QO(e,t){return new Promise(function(n,i){var o=Math.max(t-Date.now(),0),u=setTimeout(n,o);e.addEventListener(function(){clearTimeout(u),i(Me.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}function YO(e){if(!(e instanceof Ns)||!e.customData)return!1;var t=Number(e.customData.httpStatus);return t===429||t===500||t===503||t===504}var JO=(function(){function e(t,n){this.client=t,this.storage=n}return e.prototype.fetch=function(t){return A(this,void 0,void 0,function(){var n;return S(this,function(i){switch(i.label){case 0:return[4,this.storage.getThrottleMetadata()];case 1:return n=i.sent()||{backoffCount:0,throttleEndTimeMillis:Date.now()},[2,this.attemptFetch(t,n)]}})})},e.prototype.attemptFetch=function(t,n){var i=n.throttleEndTimeMillis,o=n.backoffCount;return A(this,void 0,void 0,function(){var u,c,l;return S(this,function(f){switch(f.label){case 0:return[4,QO(t.signal,i)];case 1:f.sent(),f.label=2;case 2:return f.trys.push([2,5,,7]),[4,this.client.fetch(t)];case 3:return u=f.sent(),[4,this.storage.deleteThrottleMetadata()];case 4:return f.sent(),[2,u];case 5:if(c=f.sent(),!YO(c))throw c;return l={throttleEndTimeMillis:Date.now()+bk(o),backoffCount:o+1},[4,this.storage.setThrottleMetadata(l)];case 6:return f.sent(),[2,this.attemptFetch(t,l)];case 7:return[2]}})})},e})(),ib="@firebase/remote-config",ZO="0.1.43";function t1(e){e.INTERNAL.registerComponent(new Hr("remoteConfig",t,"PUBLIC").setMultipleInstances(!0)),e.registerVersion(ib,ZO);function t(n,i){var o=i.instanceIdentifier,u=n.getProvider("app").getImmediate(),c=n.getProvider("installations").getImmediate();if(typeof window>"u")throw Me.create("registration-window");var l=u.options,f=l.projectId,d=l.apiKey,g=l.appId;if(!f)throw Me.create("registration-project-id");if(!d)throw Me.create("registration-api-key");if(!g)throw Me.create("registration-app-id");o=o||"firebase";var y=new WO(g,u.name,o),w=new XO(y),I=new pp(ib);I.logLevel=nt.ERROR;var T=new MO(c,e.SDK_VERSION,o,f,d,g),E=new JO(T,y),N=new OO(E,y,w,I),D=new KO(u,N,w,y,I);return D.ensureInitialized(),D}}t1(H);var AT="firebasestorage.googleapis.com",kT="storageBucket",e1=120*1e3,n1=600*1e3,Ot=(function(e){$(t,e);function t(n,i){var o=e.call(this,Rf(n),"Firebase Storage: "+i+" ("+Rf(n)+")")||this;return o.customData={serverResponse:null},o._baseMessage=o.message,Object.setPrototypeOf(o,t.prototype),o}return t.prototype._codeEquals=function(n){return Rf(n)===this.code},Object.defineProperty(t.prototype,"serverResponse",{get:function(){return this.customData.serverResponse},set:function(n){this.customData.serverResponse=n,this.customData.serverResponse?this.message=this._baseMessage+` 38`+this.customData.serverResponse:this.message=this._baseMessage}
38,enumerable:!1,configurable:!0}),t})(Ns);function Rf(e){return"storage/"+e}function Pd(){var e="An unknown error occurred, please check the error payload for server response.";return new Ot("unknown",e)}function r1(e){return new Ot("object-not-found","Object '"+e+"' does not exist.")}function i1(e){return new Ot("quota-exceeded","Quota for bucket '"+e+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function o1(){var e="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new Ot("unauthenticated",e)}function s1(){return new Ot("unauthorized-app","This app does not have permission to access Firebase Storage on this project.")}function u1(e){return new Ot("unauthorized","User does not have permission to access '"+e+"'.")}function a1(){return new Ot("retry-limit-exceeded","Max retry time for operation exceeded, please try again.")}function NT(){return new Ot("canceled","User canceled the upload/download.")}function c1(e){return new Ot("invalid-url","Invalid URL '"+e+"'.")}function h1(e){return new Ot("invalid-default-bucket","Invalid default bucket '"+e+"'.")}function l1(){return new Ot("no-default-bucket","No default bucket found. Did you set the '"+kT+"' property when initializing the app?")}function CT(){return new Ot("cannot-slice-blob","Cannot slice blob for upload. Please retry the upload.")}function f1(){return new Ot("server-file-wrong-size","Server recorded incorrect upload file size, please retry the upload.")}function p1(){return new Ot("no-download-url","The given file does not have any download URLs.")}function Li(e){return new Ot("invalid-argument",e)}function RT(){return new Ot("app-deleted","The Firebase app was deleted.")}function DT(e){return new Ot("invalid-root-operation","The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function as(e,t){return new Ot("invalid-format","String does not match format '"+e+"': "+t)}function ua(e){throw new Ot("internal-error","Internal error: "+e)}function d1(e){return atob(e)}var Fe={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},Df=(function(){function e(t,n){this.data=t,this.contentType=n||null}return e})();function OT(e,t){switch(e){case Fe.RAW:return new Df(PT(t));case Fe.BASE64:case Fe.BASE64URL:return new Df(xT(e,t));case Fe.DATA_URL:return new Df(g1(t),m1(t))}throw Pd()}function PT(e){for(var t=[],n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<=127)t.push(i);else if(i<=2047)t.push(192|i>>6,128|i&63);else if((i&64512)===55296){var o=n<e.length-1&&(e.charCodeAt(n+1)&64512)===56320;if(!o)t.push(239,191,189);else{var u=i,c=e.charCodeAt(++n);i=65536|(u&1023)<<10|c&1023,t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63)}}else(i&64512)===56320?t.push(239,191,189):t.push(224|i>>12,128|i>>6&63,128|i&63)}return new Uint8Array(t)}function v1(e){var t;try{t=decodeURIComponent(e)}catch{throw as(Fe.DATA_URL,"Malformed data URL.")}return PT(t)}function xT(e,t){switch(e){case Fe.BASE64:{var n=t.indexOf("-")!==-1,i=t.indexOf("_")!==-1;if(n||i){var o=n?"-":"_";throw as(e,"Invalid character '"+o+"' found: is it base64url encoded?")}break}case Fe.BASE64URL:{var u=t.indexOf("+")!==-1,c=t.indexOf("/")!==-1;if(u||c){var o=u?"+":"/";throw as(e,"Invalid character '"+o+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/");break}}var l;try{l=d1(t)}catch{throw as(e,"Invalid character found")}for(var f=new Uint8Array(l.length),d=0;d<l.length;d++)f[d]=l.charCodeAt(d);return f}var LT=(function(){function e(t){this.base64=!1,this.contentType=null;var n=t.match(/^data:([^,]+)?,/);if(n===null)throw as(Fe.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var i=n[1]||null;i!=null&&(this.base64=y1(i,";base64"),this.contentType=this.base64?i.substring(0,i.length-7):i),this.rest=t.substring(t.indexOf(",")+1)}return e})();function g1(e){var t=new LT(e);return t.base64?xT(Fe.BASE64,t.rest):v1(t.rest)}function m1(e){var t=new LT(e);return t.contentType}function y1(e,t){var n=e.length>=t.length;return n?e.substring(e.length-t.length)===t:!1}var w1={STATE_CHANGED:"state_changed"},se={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function Of(e){switch(e){case"running":case"pausing":case"canceling":return se.RUNNING;case"paused":return se.PAUSED;case"success":return se.SUCCESS;case"canceled":return se.CANCELED;case"error":return se.ERROR;default:return se.ERROR}}var Lr;
38(function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"})(Lr||(Lr={}));var b1=(function(){function e(){var t=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=Lr.NO_ERROR,this.sendPromise_=new Promise(function(n){t.xhr_.addEventListener("abort",function(){t.errorCode_=Lr.ABORT,n()}),t.xhr_.addEventListener("error",function(){t.errorCode_=Lr.NETWORK_ERROR,n()}),t.xhr_.addEventListener("load",function(){n()})})}return e.prototype.send=function(t,n,i,o){if(this.sent_)throw ua("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(n,t,!0),o!==void 0)for(var u in o)o.hasOwnProperty(u)&&this.xhr_.setRequestHeader(u,o[u].toString());return i!==void 0?this.xhr_.send(i):this.xhr_.send(),this.sendPromise_},e.prototype.getErrorCode=function(){if(!this.sent_)throw ua("cannot .getErrorCode() before sending");return this.errorCode_},e.prototype.getStatus=function(){if(!this.sent_)throw ua("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}},e.prototype.getResponseText=function(){if(!this.sent_)throw ua("cannot .getResponseText() before sending");return this.xhr_.responseText},e.prototype.abort=function(){this.xhr_.abort()},e.prototype.getResponseHeader=function(t){return this.xhr_.getResponseHeader(t)},e.prototype.addUploadProgressListener=function(t){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",t)},e.prototype.removeUploadProgressListener=function(t){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",t)},e})();function I1(){return new b1}var T1=(function(){function e(){}return e.prototype.createConnection=function(){return I1()},e})();var Ue=(function(){function e(t,n){this.bucket=t,this.path_=n}return Object.defineProperty(e.prototype,"path",{get:function(){return this.path_},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.path.length===0},enumerable:!1,configurable:!0}),e.prototype.fullServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)},e.prototype.bucketOnlyServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o"},e.makeFromBucketSpec=function(t,n){var i;try{i=e.makeFromUrl(t,n)}catch{return new e(t,"")}if(i.path==="")return i;throw h1(t)},e.makeFromUrl=function(t,n){var i=null,o="([A-Za-z0-9.\\-_]+)";function u(yt){yt.path.charAt(yt.path.length-1)==="/"&&(yt.path_=yt.path_.slice(0,-1))}var c="(/(.*))?$",l=new RegExp("^gs://"+o+c,"i"),f={bucket:1,path:3};function d(yt){yt.path_=decodeURIComponent(yt.path)}for(var g="v[A-Za-z0-9_]+",y=n.replace(/[.]/g,"\\."),w="(/([^?#]*).*)?$",I=new RegExp("^https?://"+y+"/"+g+"/b/"+o+"/o"+w,"i"),T={bucket:1,path:3},E=n===AT?"(?:storage.googleapis.com|storage.cloud.google.com)":n,N="([^?#]*)",D=new RegExp("^https?://"+E+"/"+o+"/"+N,"i"),F={bucket:1,path:2},C=[{regex:l,indices:f,postModify:u},{regex:I,indices:T,postModify:d},{regex:D,indices:F,postModify:d}],B=0;B<C.length;B++){var x=C[B],Y=x.regex.exec(t);if(Y){var _=Y[x.indices.bucket],te=Y[x.indices.path];te||(te=""),i=new e(_,te),x.postModify(i);break}}if(i==null)throw c1(t);return i},e})(),_1=(function(){function e(t){this.promise_=Promise.reject(t)}return e.prototype.getPromise=function(){return this.promise_},e.prototype.cancel=function(t){},e})();function E1(e,t,n){var i=1,o=null,u=!1,c=0;function l(){return c===2}var f=!1;function d(){for(var T=[],E=0;E<arguments.length;E++)T[E]=arguments[E];f||(f=!0,t.apply(null,T))}function g(T){o=setTimeout(function(){o=null,e(y,l())},T)}function y(T){for(var E=[],N=1;N<arguments.length;N++)E[N-1]=arguments[N];if(!f){if(T){d.call.apply(d,dt([null,T],E));return}var D=l()||u;if(D){d.call.apply(d,dt([null,T],E));return}i<64&&(i*=2);var F;c===1?(c=2,F=0):F=(i+Math.random())*1e3,g(F)}}var w=!1;function I(T){w||(w=!0,!f&&(o!==null?(T||(c=2),clearTimeout(o),g(0)):T||(c=1)))}return g(0),setTimeout(function(){u=!0,I(!0)},n),I}function S1(e){e(!1)}function A1(e){return e!==void 0}function k1(e){return typeof e=="function"}function N1(e){return typeof e=="object"&&!Array.isArray(e)}function Nc(e){return typeof e=="string"||e instanceof String}function ob(e){return xd()&&e instanceof Blob}function xd(){return typeof Blob<"u"}function hp(e,t,n,i){if(i<t)throw Li("Invalid value for '"+e+"'. Expected "+t+" or greater.");if(i>n)throw Li("Invalid value for '"+e+"'. Expected "+n+" or less.")}function er(e,t){var n=t.match(/^(\w+):\/\/.+/),i=n?.[1],o=t;return i==null&&(o="https://"+t),o+"/v0"+e}function MT(e){var t=encodeURIComponent,n="?";for(var i in e)if(e.hasOwnProperty(i)){var o=t(i)+"="+t(e[i]);n=n+o+"&"}return n=n.slice(0,-1),n}var C1=(function(){function e(t,n,i,o,u,c,l,f,d,g,y){var w=this;this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=t,this.method_=n,this.headers_=i,this.body_=o,this.successCodes_=u.slice(),this.additionalRetryCodes_=c.slice(),this.callback_=l,this.errorCallback_=f,this.progressCallback_=g,this.timeout_=d,this.pool_=y,this.promise_=new Promise(function(I,T){w.resolve_=I,w.reject_=T,w.start_()})}return e.prototype.start_=function(){var t=this;function n(o,u){if(u){o(!1,new aa(!1,null,!0));return}var c=t.pool_.createConnection();t.pendingConnection_=c;function l(f){var d=f.loaded,g=f.lengthComputable?f.total:-1;t.progressCallback_!==null&&t.progressCallback_(d,g)}t.progressCallback_!==null&&c.addUploadProgressListener(l),c.send(t.url_,t.method_,t.body_,t.headers_).then(function(){t.progressCallback_!==null&&c.removeUploadProgressListener(l),t.pendingConnection_=null;var f=c.getErrorCode()===Lr.NO_ERROR,d=c.getStatus();
38if(!f||t.isRetryStatusCode_(d)){var g=c.getErrorCode()===Lr.ABORT;o(!1,new aa(!1,null,g));return}var y=t.successCodes_.indexOf(d)!==-1;o(!0,new aa(y,c))})}function i(o,u){var c=t.resolve_,l=t.reject_,f=u.connection;if(u.wasSuccessCode)try{var d=t.callback_(f,f.getResponseText());A1(d)?c(d):c()}catch(y){l(y)}else if(f!==null){var g=Pd();g.serverResponse=f.getResponseText(),t.errorCallback_?l(t.errorCallback_(f,g)):l(g)}else if(u.canceled){var g=t.appDelete_?RT():NT();l(g)}else{var g=a1();l(g)}}this.canceled_?i(!1,new aa(!1,null,!0)):this.backoffId_=E1(n,i,this.timeout_)},e.prototype.getPromise=function(){return this.promise_},e.prototype.cancel=function(t){this.canceled_=!0,this.appDelete_=t||!1,this.backoffId_!==null&&S1(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()},e.prototype.isRetryStatusCode_=function(t){var n=t>=500&&t<600,i=[408,429],o=i.indexOf(t)!==-1,u=this.additionalRetryCodes_.indexOf(t)!==-1;return n||o||u},e})(),aa=(function(){function e(t,n,i){this.wasSuccessCode=t,this.connection=n,this.canceled=!!i}return e})();function R1(e,t){t!==null&&t.length>0&&(e.Authorization="Firebase "+t)}function D1(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(t??"AppManager")}function O1(e,t){t&&(e["X-Firebase-GMPID"]=t)}function P1(e,t){t!==null&&(e["X-Firebase-AppCheck"]=t)}function x1(e,t,n,i,o,u){var c=MT(e.urlParams),l=e.url+c,f=Object.assign({},e.headers);return O1(f,t),R1(f,n),D1(f,u),P1(f,i),new C1(l,e.method,f,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,o)}function L1(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function M1(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=L1();if(n!==void 0){for(var i=new n,o=0;o<e.length;o++)i.append(e[o]);return i.getBlob()}else{if(xd())return new Blob(e);throw new Ot("unsupported-environment","This browser doesn't seem to support creating Blobs")}}function F1(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.mozSlice?e.mozSlice(t,n):e.slice?e.slice(t,n):null}var Ld=(function(){function e(t,n){var i=0,o="";ob(t)?(this.data_=t,i=t.size,o=t.type):t instanceof ArrayBuffer?(n?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),i=this.data_.length):t instanceof Uint8Array&&(n?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),i=t.length),this.size_=i,this.type_=o}return e.prototype.size=function(){return this.size_},e.prototype.type=function(){return this.type_},e.prototype.slice=function(t,n){if(ob(this.data_)){var i=this.data_,o=F1(i,t,n);return o===null?null:new e(o)}else{var u=new Uint8Array(this.data_.buffer,t,n-t);return new e(u,!0)}},e.getBlob=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(xd()){var i=t.map(function(f){return f instanceof e?f.data_:f});return new e(M1.apply(null,i))}else{var o=t.map(function(f){return Nc(f)?OT(Fe.RAW,f).data:f.data_}),u=0;o.forEach(function(f){u+=f.byteLength});var c=new Uint8Array(u),l=0;return o.forEach(function(f){for(var d=0;d<f.length;d++)c[l++]=f[d]}),new e(c,!0)}},e.prototype.uploadData=function(){return this.data_},e})();function Md(e){var t;try{t=JSON.parse(e)}catch{return null}return N1(t)?t:null}function U1(e){if(e.length===0)return null;var t=e.lastIndexOf("/");if(t===-1)return"";var n=e.slice(0,t);return n}function j1(e,t){var n=t.split("/").filter(function(i){return i.length>0}).join("/");return e.length===0?n:e+"/"+n}function FT(e){var t=e.lastIndexOf("/",e.length-2);return t===-1?e:e.slice(t+1)}function V1(e,t){return t}var ie=(function(){function e(t,n,i,o){this.server=t,this.local=n||t,this.writable=!!i,this.xform=o||V1}return e})(),ca=null;function q1(e){return!Nc(e)||e.length<2?e:FT(e)}function Cc(){if(ca)return ca;var e=[];e.push(new ie("bucket")),e.push(new ie("generation")),e.push(new ie("metageneration")),e.push(new ie("name","fullPath",!0));function t(u,c){return q1(c)}var n=new ie("name");n.xform=t,e.push(n);function i(u,c){return c!==void 0?Number(c):c}var o=new ie("size");return o.xform=i,e.push(o),e.push(new ie("timeCreated")),e.push(new ie("updated")),e.push(new ie("md5Hash",null,!0)),e.push(new ie("cacheControl",null,!0)),e.push(new ie("contentDisposition",null,!0)),e.push(new ie("contentEncoding",null,!0)),e.push(new ie("contentLanguage",null,!0)),e.push(new ie("contentType",null,!0)),e.push(new ie("metadata","customMetadata",!0)),ca=e,ca}function B1(e,t){function n(){var i=e.bucket,o=e.fullPath,u=new Ue(i,o);return t._makeStorageReference(u)}Object.defineProperty(e,"ref",{get:n})}function K1(e,t,n){var i={};i.type="file";for(var o=n.length,u=0;u<o;u++){var c=n[u];i[c.local]=c.xform(i,t[c.server])}return B1(i,e),i}function UT(e,t,n){var i=Md(t);if(i===null)return null;var o=i;return K1(e,o,n)}function H1(e,t,n){var i=Md(t);if(i===null||!Nc(i.downloadTokens))return null;var o=i.downloadTokens;if(o.length===0)return null;var u=encodeURIComponent,c=o.split(","),l=c.map(function(f){var d=e.bucket,g=e.fullPath,y="/b/"+u(d)+"/o/"+u(g),w=er(y,n),I=MT({alt:"media",token:f});return w+I});return l[0]}function Fd(e,t){for(var n={},i=t.length,o=0;o<i;o++){var u=t[o];u.writable&&(n[u.server]=e[u.local])}return JSON.stringify(n)}var sb="prefixes",ub="items";
38function G1(e,t,n){var i={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n[sb])for(var o=0,u=n[sb];o<u.length;o++){var c=u[o],l=c.replace(/\/$/,""),f=e._makeStorageReference(new Ue(t,l));i.prefixes.push(f)}if(n[ub])for(var d=0,g=n[ub];d<g.length;d++){var y=g[d],f=e._makeStorageReference(new Ue(t,y.name));i.items.push(f)}return i}function z1(e,t,n){var i=Md(n);if(i===null)return null;var o=i;return G1(e,t,o)}var kn=(function(){function e(t,n,i,o){this.url=t,this.method=n,this.handler=i,this.timeout=o,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}return e})();function cn(e){if(!e)throw Pd()}function Rc(e,t){function n(i,o){var u=UT(e,o,t);return cn(u!==null),u}return n}function $1(e,t){function n(i,o){var u=z1(e,t,o);return cn(u!==null),u}return n}function W1(e,t){function n(i,o){var u=UT(e,o,t);return cn(u!==null),H1(u,o,e.host)}return n}function lo(e){function t(n,i){var o;return n.getStatus()===401?n.getResponseText().includes("Firebase App Check token is invalid")?o=s1():o=o1():n.getStatus()===402?o=i1(e.bucket):n.getStatus()===403?o=u1(e.path):o=i,o.serverResponse=i.serverResponse,o}return t}function Dc(e){var t=lo(e);function n(i,o){var u=t(i,o);return i.getStatus()===404&&(u=r1(e.path)),u.serverResponse=o.serverResponse,u}return n}function jT(e,t,n){var i=t.fullServerUrl(),o=er(i,e.host),u="GET",c=e.maxOperationRetryTime,l=ne
38w kn(o,u,Rc(e,n),c);return l.errorHandler=Dc(t),l}function X1(e,t,n,i,o){var u={};t.isRoot?u.prefix="":u.prefix=t.path+"/",n.length>0&&(u.delimiter=n),i&&(u.pageToken=i),o&&(u.maxResults=o);var c=t.bucketOnlyServerUrl(),l=er(c,e.host),f="GET",d=e.maxOperationRetryTime,g=new kn(l,f,$1(e,t.bucket),d);return g.urlParams=u,g.errorHandler=lo(t),g}function Q1(e,t,n){var i=t.fullServerUrl(),o=er(i,e.host),u="GET",c=e.maxOperationRetryTime,l=new kn(o,u,W1(e,n),c);return l.errorHandler=Dc(t),l}function Y1(e,t,n,i){var o=t.fullServerUrl(),u=er(o,e.host),c="PATCH",l=Fd(n,i),f={"Content-Type":"application/json; charset=utf-8"},d=e.maxOperationRetryTime,g=new kn(u,c,Rc(e,i),d);return g.headers=f,g.body=l,g.errorHandler=Dc(t),g}function J1(e,t){var n=t.fullServerUrl(),i=er(n,e.host),o="DELETE",u=e.maxOperationRetryTime;function c(f,d){}var l=new kn(i,o,c,u);return l.successCodes=[200,204],l.errorHandler=Dc(t),l}function Z1(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}function VT(e,t,n){var i=Object.assign({},n);return i.fullPath=e.path,i.size=t.size(),i.contentType||(i.contentType=Z1(null,t)),i}function tP(e,t,n,i,o){var u=t.bucketOnlyServerUrl(),c={"X-Goog-Upload-Protocol":"multipart"};function l(){for(var C="",B=0;B<2;B++)C=C+Math.random().toString().slice(2);return C}var f=l();c["Content-Type"]="multipart/related; boundary="+f;var d=VT(t,i,o),g=Fd(d,n),y="--"+f+`\r 39Content-Type: application/json; charset=utf-8\r 40\r 41`+g+`\r 42--`+f+`\r 43Content-Type: `+d.contentType+`\r 44\r 45`,w=`\r 46--`+f+"--",I=Ld.getBlob(y,i,w);if(I===null)throw CT();var T={name:d.fullPath},E=er(u,e.host),N="POST",D=e.maxUploadRetryTime,F=new kn(E,N,Rc(e,n),D);
46return F.urlParams=T,F.headers=c,F.body=I.uploadData(),F.errorHandler=lo(t),F}var $a=(function(){function e(t,n,i,o){this.current=t,this.total=n,this.finalized=!!i,this.metadata=o||null}return e})();function Ud(e,t){var n=null;try{n=e.getResponseHeader("X-Goog-Upload-Status")}catch{cn(!1)}var i=t||["active"];return cn(!!n&&i.indexOf(n)!==-1),n}function eP(e,t,n,i,o){var u=t.bucketOnlyServerUrl(),c=VT(t,i,o),l={name:c.fullPath},f=er(u,e.host),d="POST",g={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":""+i.size(),"X-Goog-Upload-Header-Content-Type":c.contentType,"Content-Type":"application/json; charset=utf-8"},y=Fd(c,n),w=e.maxUploadRetryTime;function I(E){Ud(E);var N;try{N=E.getResponseHeader("X-Goog-Upload-URL")}catch{cn(!1)}return cn(Nc(N)),N}var T=new kn(f,d,I,w);return T.urlParams=l,T.headers=g,T.body=y,T.errorHandler=lo(t),T}function nP(e,t,n,i){var o={"X-Goog-Upload-Command":"query"};function u(d){var g=Ud(d,["active","final"]),y=null;try{y=d.getResponseHeader("X-Goog-Upload-Size-Received")}catch{cn(!1)}y||cn(!1);var w=Number(y);return cn(!isNaN(w)),new $a(w,i.size(),g==="final")}var c="POST",l=e.maxUploadRetryTime,f=new kn(n,c,u,l);return f.headers=o,f.errorHandler=lo(t),f}var ab=256*1024;function rP(e,t,n,i,o,u,c,l){var f=new $a(0,0);if(c?(f.current=c.current,f.total=c.total):(f.current=0,f.total=i.size()),i.size()!==f.total)throw f1();var d=f.total-f.current,g=d;o>0&&(g=Math.min(g,o));var y=f.current,w=y+g,I=g===d?"upload, finalize":"upload",T={"X-Goog-Upload-Command":I,"X-Goog-Upload-Offset":""+f.current},E=i.slice(y,w);if(E===null)throw CT();function N(B,x){var Y=Ud(B,["active","final"]),_=f.current+g,te=i.size(),yt;return Y==="final"?yt=Rc(t,u)(B,x):yt=null,new $a(_,te,Y==="final",yt)}var D="POST",F=t.maxUploadRetryTime,C=new kn(n,D,N,F);return C.headers=T,C.body=E.uploadData(),C.progressCallback=l||null,C.errorHandler=lo(e),C}var iP=(function(){function e(t,n,i){var o=k1(t)||n!=null||i!=null;if(o)this.next=t,this.error=n,this.complete=i;else{var u=t;this.next=u.next,this.error=u.error,this.complete=u.complete}}return e})();function Ni(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];Promise.resolve().then(function(){return e.apply(void 0,t)})}}var qT=(function(){function e(t,n,i){var o=this;i===void 0&&(i=null),this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=t,this._blob=n,this._metadata=i,this._mappings=Cc(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=function(u){o._request=void 0,o._chunkMultiplier=1,u._codeEquals("canceled")?(o._needToFetchStatus=!0,o.completeTransitions_()):(o._error=u,o._transition("error"))},this._metadataErrorHandler=function(u){o._request=void 0,u._codeEquals("canceled")?o.completeTransitions_():(o._error=u,o._transition("error"))},this._promise=new Promise(function(u,c){o._resolve=u,o._reject=c,o._start()}),this._promise.then(null,function(){})}return e.prototype._makeProgressCallback=function(){var t=this,n=this._transferred;return function(i){return t._updateProgress(n+i)}},e.prototype._shouldDoResumable=function(t){return t.size()>256*1024},e.prototype._start=function(){this._state==="running"&&this._request===void 0&&(this._resumable?this._uploadUrl===void 0?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this._continueUpload():this._oneShotUpload())},e.prototype._resolveToken=function(t){var n=this;Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(function(i){var o=i[0],u=i[1];switch(n._state){case"running":t(o,u);break;case"canceling":n._transition("canceled");break;case"pausing":n._transition("paused");break}})},e.prototype._createResumable=function(){var t=this;this._resolveToken(function(n,i){var o=eP(t._ref.storage,t._ref._location,t._mappings,t._blob,t._metadata),u=t._ref.storage._makeRequest
46(o,n,i);t._request=u,u.getPromise().then(function(c){t._request=void 0,t._uploadUrl=c,t._needToFetchStatus=!1,t.completeTransitions_()},t._errorHandler)})},e.prototype._fetchStatus=function(){var t=this,n=this._uploadUrl;this._resolveToken(function(i,o){var u=nP(t._ref.storage,t._ref._location,n,t._blob),c=t._ref.storage._makeRequest(u,i,o);t._request=c,c.getPromise().then(function(l){l=l,t._request=void 0,t._updateProgress(l.current),t._needToFetchStatus=!1,l.finalized&&(t._needToFetchMetadata=!0),t.completeTransitions_()},t._errorHandler)})},e.prototype._continueUpload=function(){var t=this,n=ab*this._chunkMultiplier,i=new $a(this._transferred,this._blob.size()),o=this._uploadUrl;this._resolveToken(function(u,c){var l;try{l=rP(t._ref._location,t._ref.storage,o,t._blob,n,t._mappings,i,t._makeProgressCallback())}catch(d){t._error=d,t._transition("error");return}var f=t._ref.storage._makeRequest(l,u,c);t._request=f,f.getPromise().then(function(d){t._increaseMultiplier(),t._request=void 0,t._updateProgress(d.current),d.finalized?(t._metadata=d.metadata,t._transition("success")):t.completeTransitions_()},t._errorHandler)})},e.prototype._increaseMultiplier=function(){var t=ab*this._chunkMultiplier;t<32*1024*1024&&(this._chunkMultiplier*=2)},e.prototype._fetchMetadata=function(){var t=this;this._resolveToken(function(n,i){var o=jT(t._ref.storage,t._ref._location,t._mappings),u=t._ref.storage._makeRequest(o,n,i);t._request=u,u.getPromise().then(function(c){t._request=void 0,t._metadata=c,t._transition("success")},t._metadataErrorHandler)})},e.prototype._oneShotUpload=function(){var t=this;this._resolveToken(function(n,i){var o=tP(t._ref.storage,t._ref._location,t._mappings,t._blob,t._metadata),u=t._ref.storage._makeRequest(o,n,i);t._request=u,u.getPromise().then(function(c){t._request=void 0,t._metadata=c,t._updateProgress(t._blob.size()),t._transition("success")},t._errorHandler)})},e.prototype._updateProgress=function(t){var n=this._transferred;this._transferred=t,this._transferred!==n&&this._notifyObservers()},e.prototype._transition=function(t){if(this._state!==t)switch(t){case"canceling":this._state=t,this._request!==void 0&&this._request.cancel();break;case"pausing":this._state=t,this._request!==void 0&&this._request.cancel();break;case"running":var n=this._state==="paused";this._state=t,n&&(this._notifyObservers(),this._start());break;case"paused":this._state=t,this._notifyObservers();break;case"canceled":this._error=NT(),this._state=t,this._notifyObservers();break;case"error":this._state=t,this._notifyObservers();break;case"success":this._state=t,this._notifyObservers();break}},e.prototype.completeTransitions_=function(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start();break}},Object.defineProperty(e.prototype,"snapshot",{get:function(){var t=Of(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:t,metadata:this._metadata,task:this,ref:this._ref}},enumerable:!1,configurable:!0}),e.prototype.on=function(t,n,i,o){var u=this,c=new iP(n,i,o);return this._addObserver(c),function(){u._removeObserver(c)}},e.prototype.then=function(t,n){return this._promise.then(t,n)},e.prototype.catch=function(t){return this.then(null,t)},e.prototype._addObserver=function(t){this._observers.push(t),this._notifyObserver(t)},e.prototype._removeObserver=function(t){var n=this._observers.indexOf(t);n!==-1&&this._observers.splice(n,1)},e.prototype._notifyObservers=function(){var t=this;this._finishPromise();var n=this._observers.slice();n.forEach(function(i){t._notifyObserver(i)})},e.prototype._finishPromise=function(){if(this._resolve!==void 0){var t=!0;switch(Of(this._state)){case se.SUCCESS:Ni(this._resolve.bind(null,this.snapshot))();break;case se.CANCELED:case se.ERROR:var n=this._reject;Ni(n.bind(null,this._error))();break;default:t=!1;break}t&&(this._resolve=void 0,this._reject=void 0)}},e.prototype._notifyObserver=function(t){var n=Of(this._state);switch(n){case se.RUNNING:case se.PAUSED:t.next&&Ni(t.next.bind(t,this.snapshot))();break;case se.SUCCESS:t.complete&&Ni(t.complete.bind(t))();break;case se.CANCELED:case se.ERROR:t.error&&Ni(t.error.bind(t,this._error))();break;default:t.error&&Ni(t.error.bind(t,this._error))()}},e.prototype.resume=function(){var t=this._state==="paused"||this._state==="pausing";return t&&this._transition("running"),t},e.prototype.pause=function(){var t=this._state==="running";return t&&this._transition("pausing"),t},e.prototype.cancel=function(){var t=this._state==="running"||this._state==="pausing";return t&&this._transition("canceling"),t},e})();var Oc=(function(){function e(t,n){this._service=t,n instanceof Ue?this._location=n:this._location=Ue.makeFromUrl(n,t.host)}return e.prototype.toString=function(){return"gs://"+this._location.bucket+"/"+this._location.path},e.prototype._newRef=function(t,n){return new e(t,n)},Object.defineProperty(e.prototype,"root",{get:function(){var t=new Ue(this._location.bucket,"");return this._newRef(this._service,t)}
46,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bucket",{get:function(){return this._location.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fullPath",{get:function(){return this._location.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return FT(this._location.path)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storage",{get:function(){return this._service},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=U1(this._location.path);if(t===null)return null;var n=new Ue(this._location.bucket,t);return new e(this._service,n)},enumerable:!1,configurable:!0}),e.prototype._throwIfRoot=function(t){if(this._location.path==="")throw DT(t)},e})();function oP(e,t,n){return e._throwIfRoot("uploadBytesResumable"),new qT(e,new Ld(t),n)}function sP(e){var t={prefixes:[],items:[]};return BT(e,t).then(function(){return t})}function BT(e,t,n){return A(this,void 0,void 0,function(){var i,o,u,c;return S(this,function(l){switch(l.label){case 0:return i={pageToken:n},[4,KT(e,i)];case 1:return o=l.sent(),(u=t.prefixes).push.apply(u,o.prefixes),(c=t.items).push.apply(c,o.items),o.nextPageToken==null?[3,3]:[4,BT(e,t,o.nextPageToken)];case 2:l.sent(),l.label=3;case 3:return[2]}})})}function KT(e,t){return A(this,void 0,void 0,function(){var n,i;return S(this,function(o){switch(o.label){case 0:return t!=null&&typeof t.maxResults=="number"&&hp("options.maxResults",1,1e3,t.maxResults),n=t||{},i=X1(e.storage,e._location,"/",n.pageToken,n.maxResults),[4,e.storage.makeRequestWithTokens(i)];case 1:return[2,o.sent().getPromise()]}})})}function uP(e){return A(this,void 0,void 0,function(){var t;return S(this,function(n){switch(n.label){case 0:return e._throwIfRoot("getMetadata"),t=jT(e.storage,e._location,Cc()),[4,e.storage.makeRequestWithTokens(t)];case 1:return[2,n.sent().getPromise()]}})})}function aP(e,t){return A(this,void 0,void 0,function(){var n;return S(this,function(i){switch(i.label){case 0:return e._throwIfRoot("updateMetadata"),n=Y1(e.storage,e._location,t,Cc()),[4,e.storage.makeRequestWithTokens(n)];case 1:return[2,i.sent().getPromise()]}})})}function cP(e){return A(this,void 0,void 0,function(){var t;return S(this,function(n){switch(n.label){case 0:return e._throwIfRoot("getDownloadURL"),t=Q1(e.storage,e._location,Cc()),[4,e.storage.makeRequestWithTokens(t)];case 1:return[2,n.sent().getPromise().then(function(i){if(i===null)throw p1();return i})]}})})}function hP(e){return A(this,void 0,void 0,function(){var t;return S(this,function(n){switch(n.label){case 0:return e._throwIfRoot("deleteObject"),t=J1(e.storage,e._location),[4,e.storage.makeRequestWithTokens(t)];case 1:return[2,n.sent().getPromise()]}})})}function HT(e,t){var n=j1(e._location.path,t),i=new Ue(e._location.bucket,n);return new Oc(e.storage,i)}function lp(e){return/^[A-Za-z]+:\/\//.test(e)}function lP(e,t){return new Oc(e,t)}function GT(e,t){if(e instanceof Pc){var n=e;if(n._bucket==null)throw l1();var i=new Oc(n,n._bucket);return t!=null?GT(i,t):i}else return t!==void 0?HT(e,t):e}function fP(e,t){if(t&&lp(t)){if(e instanceof Pc)return lP(e,t);throw Li("To use ref(service, url), the first argument must be a Storage instance.")}else return GT(e,t)}function cb(e,t){var n=t?.[kT];return n==null?null:Ue.makeFromBucketSpec(n,e)}function pP(e,t,n,i){i===void 0&&(i={}),e.host="http://"+t+":"+n;var o=i.mockUserToken;o&&(e._overrideAuthToken=typeof o=="string"?o:vb(o,e.app.options.projectId))}var Pc=(function(){function e(t,n,i,o,u,c){this.app=t,this._authProvider=n,this._appCheckProvider=i,this._pool=o,this._url=u,this._firebaseVersion=c,this._bucket=null,this._host=AT,this._appId=null,this._deleted=!1,this._maxOperationRetryTime=e1,this._maxUploadRetryTime=n1,this._requests=new Set,u!=null?this._bucket=Ue.makeFromBucketSpec(u,this._host):this._bucket=cb(this._host,this.app.options)}return Object.defineProperty(e.prototype,"host",{get:function(){return this._host},set:function(t){this._host=t,this._url!=null?this._bucket=Ue.makeFromBucketSpec(this._url,t):this._bucket=cb(t,this.app.options)}
46,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxUploadRetryTime",{get:function(){return this._maxUploadRetryTime},set:function(t){hp("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxOperationRetryTime",{get:function(){return this._maxOperationRetryTime},set:function(t){hp("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t},enumerable:!1,configurable:!0}),e.prototype._getAuthToken=function(){return A(this,void 0,void 0,function(){var t,n;return S(this,function(i){switch(i.label){case 0:return this._overrideAuthToken?[2,this._overrideAuthToken]:(t=this._authProvider.getImmediate({optional:!0}),t?[4,t.getToken()]:[3,2]);case 1:if(n=i.sent(),n!==null)return[2,n.accessToken];i.label=2;case 2:return[2,null]}})})},e.prototype._getAppCheckToken=function(){return A(this,void 0,void 0,function(){var t,n;return S(this,function(i){switch(i.label){case 0:return t=this._appCheckProvider.getImmediate({optional:!0}),t?[4,t.getToken()]:[3,2];case 1:return n=i.sent(),[2,n.token];case 2:return[2,null]}})})},e.prototype._delete=function(){return this._deleted||(this._deleted=!0,this._requests.forEach(function(t){return t.cancel()}),this._requests.clear()),Promise.resolve()},e.prototype._makeStorageReference=function(t){return new Oc(this,t)},e.prototype._makeRequest=function(t,n,i){var o=this;if(this._deleted)return new _1(RT());var u=x1(t,this._appId,n,i,this._pool,this._firebaseVersion);return this._requests.add(u),u.getPromise().then(function(){return o._requests.delete(u)},function(){return o._requests.delete(u)}),u},e.prototype.makeRequestWithTokens=function(t){return A(this,void 0,void 0,function(){var n,i,o;return S(this,function(u){switch(u.label){case 0:return[4,Promise.all([this._getAuthToken(),this._getAppCheckToken()])];case 1:return n=u.sent(),i=n[0],o=n[1],[2,this._makeRequest(t,i,o)]}})})},e})();function dP(e,t,n){return e=ht(e),oP(e,t,n)}function vP(e){return e=ht(e),uP(e)}function gP(e,t){return e=ht(e),aP(e,t)}function mP(e,t){return e=ht(e),KT(e,t)}function yP(e){return e=ht(e),sP(e)}function wP(e){return e=ht(e),cP(e)}function bP(e){return e=ht(e),hP(e)}function hb(e,t){return e=ht(e),fP(e,t)}function IP(e,t){return HT(e,t)}function TP(e,t,n,i){i===void 0&&(i={}),pP(e,t,n,i)}var ha=(function(){function e(t,n,i){this._delegate=t,this.task=n,this.ref=i}
46return Object.defineProperty(e.prototype,"bytesTransferred",{get:function(){return this._delegate.bytesTransferred},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._delegate.state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalBytes",{get:function(){return this._delegate.totalBytes},enumerable:!1,configurable:!0}),e})();var lb=(function(){function e(t,n){this._delegate=t,this._ref=n,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate)}return Object.defineProperty(e.prototype,"snapshot",{get:function(){return new ha(this._delegate.snapshot,this,this._ref)},enumerable:!1,configurable:!0}),e.prototype.then=function(t,n){var i=this;return this._delegate.then(function(o){if(t)return t(new ha(o,i,i._ref))},n)},e.prototype.on=function(t,n,i,o){var u=this,c=void 0;return n&&(typeof n=="function"?c=function(l){return n(new ha(l,u,u._ref))}:c={next:n.next?function(l){return n.next(new ha(l,u,u._ref))}:void 0,complete:n.complete||void 0,error:n.error||void 0}),this._delegate.on(t,c,i||void 0,o||void 0)},e})(),fb=(function(){function e(t,n){this._delegate=t,this._service=n}return Object.defineProperty(e.prototype,"prefixes",{get:function(){var t=this;return this._delegate.prefixes.map(function(n){return new ks(n,t._service)})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){var t=this;return this._delegate.items.map(function(n){return new ks(n,t._service)})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextPageToken",{get:function(){return this._delegate.nextPageToken||null},enumerable:!1,configurable:!0}),e})();var ks=(function(){function e(t,n){this._delegate=t,this.storage=n}return Object.defineProperty(e.prototype,"name",{get:function(){return this._delegate.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bucket",{get:function(){return this._delegate.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fullPath",{get:function(){return this._delegate.fullPath},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this._delegate.toString()},e.prototype.child=function(t){var n=IP(this._delegate,t);return new e(n,this.storage)},Object.defineProperty(e.prototype,"root",{get:function(){return new e(this._delegate.root,this.storage)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._delegate.parent;return t==null?null:new e(t,this.storage)},enumerable:!1,configurable:!0}),e.prototype.put=function(t,n){return this._throwIfRoot("put"),new lb(dP(this._delegate,t,n),this)},e.prototype.putString=function(t,n,i){n===void 0&&(n=Fe.RAW),this._throwIfRoot("putString");var o=OT(n,t),u=Xt({},i);return u.contentType==null&&o.contentType!=null&&(u.contentType=o.contentType),new lb(new qT(this._delegate,new Ld(o.data,!0),u),this)},e.prototype.listAll=function(){var t=this;return yP(this._delegate).then(function(n){return new fb(n,t.storage)})},e.prototype.list=function(t){var n=this;return mP(this._delegate,t||void 0).then(function(i){return new fb(i,n.storage)})},e.prototype.getMetadata=function(){return vP(this._delegate)},e.prototype.updateMetadata=function(t){return gP(this._delegate,t)},e.prototype.getDownloadURL=function(){return wP(this._delegate)},e.prototype.delete=function(){return this._throwIfRoot("delete"),bP(this._delegate)},e.prototype._throwIfRoot=function(t){if(this._delegate._location.path==="")throw DT(t)},e})();var _P=(function(){function e(t,n){this.app=t,this._delegate=n}return Object.defineProperty(e.prototype,"maxOperationRetryTime",{get:function(){return this._delegate.maxOperationRetryTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxUploadRetryTime",{get:function(){return this._delegate.maxUploadRetryTime}
46,enumerable:!1,configurable:!0}),e.prototype.ref=function(t){if(lp(t))throw Li("ref() expected a child path but got a URL, use refFromURL instead.");return new ks(hb(this._delegate,t),this)},e.prototype.refFromURL=function(t){if(!lp(t))throw Li("refFromURL() expected a full URL but got a child path, use ref() instead.");try{Ue.makeFromUrl(t,this._delegate.host)}catch{throw Li("refFromUrl() expected a valid full URL but got an invalid one.")}return new ks(hb(this._delegate,t),this)},e.prototype.setMaxUploadRetryTime=function(t){this._delegate.maxUploadRetryTime=t},e.prototype.setMaxOperationRetryTime=function(t){this._delegate.maxOperationRetryTime=t},e.prototype.useEmulator=function(t,n,i){i===void 0&&(i={}),TP(this._delegate,t,n,i)},e})(),EP="@firebase/storage",SP="0.7.1";var AP="storage";function kP(e,t){var n=t.instanceIdentifier,i=e.getProvider("app").getImmediate(),o=e.getProvider("auth-internal"),u=e.getProvider("app-check-internal"),c=new _P(i,new Pc(i,o,u,new T1,n,H.SDK_VERSION));return c}function NP(e){var t={TaskState:se,TaskEvent:w1,StringFormat:Fe,Storage:Pc,Reference:ks};e.INTERNAL.registerComponent(new Hr(AP,kP,"PUBLIC").setServiceProps(t).setMultipleInstances(!0)),e.registerVersion(EP,SP)}NP(H);const CP=new Set(["journey.cloud"]),pb=typeof window<"u"?window.location.hostname:"",RP={apiKey:"AIzaSyDccn4RSVFEWKLeRM6_rO0I9dXFIAbsTTo",authDomain:CP.has(pb)?pb:"local-tempo-548.firebaseapp.com",databaseURL:"https://local-tempo-548.firebaseio.com",projectId:"local-tempo-548",storageBucket:"local-tempo-548.appspot.com",messagingSenderId:"258745827837",appId:"1:258745827837:web:73e535a826df04f1179994",measurementId:"G-RYJ6TD22GT"};H.apps.length||H.initializeApp(RP);const LP=new H.auth.GoogleAuthProvider,MP=new H.auth.OAuthProvider("apple.com"),DP=H.auth(),FP=H.firestore(),OP=H.storage(),PP=H.app().storage("gs://journey-user-uploads"),xP=H.app().storage("gs://journey-uploads");["production","prerender"].includes("production")||(OP.useEmulator("localhost",9199),PP.useEmulator("localhost",9198),xP.useEmulator("localhost",9199),DP.useEmulator("http://localhost:9099",{disableWarnings:!0}));const Pf=H.remoteConfig();Pf&&(Pf.settings.minimumFetchIntervalMillis=36e5,Pf.defaultConfig={journey_cloud_festive:""});export{MP as AppleProvider,LP as GoogleProvider,DP as auth,H as default,FP as firestore,xP as mediaStorage,Pf as remoteConfig,OP as storage,PP as uploadStorage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.