@tivio/sdk-react 2.1.4 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/README.md +2 -0
  2. package/dist/components/hooks/usePurchaseSubscription.d.ts +2 -7
  3. package/dist/components/hooks/useTransactionPayment.d.ts +2 -7
  4. package/dist/index.js +1 -1
  5. package/dist/services/sentry.d.ts +1 -1
  6. package/dist/types.d.ts +2 -10
  7. package/env +0 -0
  8. package/package.json +5 -7
  9. package/scripts/build_dev.sh +3 -0
  10. package/scripts/build_prod.sh +3 -0
  11. package/scripts/start.sh +3 -0
  12. package/coverage/clover.xml +0 -113
  13. package/coverage/lcov-report/base.css +0 -224
  14. package/coverage/lcov-report/block-navigation.js +0 -79
  15. package/coverage/lcov-report/favicon.png +0 -0
  16. package/coverage/lcov-report/index.html +0 -126
  17. package/coverage/lcov-report/prettify.css +0 -1
  18. package/coverage/lcov-report/prettify.js +0 -2
  19. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  20. package/coverage/lcov-report/sorter.js +0 -170
  21. package/coverage/lcov-report/src/components/TivioProvider.tsx.html +0 -227
  22. package/coverage/lcov-report/src/components/TivioWidget.tsx.html +0 -203
  23. package/coverage/lcov-report/src/components/TivioWidgetError.tsx.html +0 -122
  24. package/coverage/lcov-report/src/components/TivioWidgetLoader.tsx.html +0 -116
  25. package/coverage/lcov-report/src/components/index.html +0 -156
  26. package/coverage/lcov-report/src/conf.ts.html +0 -239
  27. package/coverage/lcov-report/src/index.html +0 -111
  28. package/coverage/lcov-report/src/services/bundleLoader.ts.html +0 -698
  29. package/coverage/lcov-report/src/services/dependencyResolver.ts.html +0 -212
  30. package/coverage/lcov-report/src/services/index.html +0 -141
  31. package/coverage/lcov-report/src/services/logger.ts.html +0 -365
  32. package/coverage/lcov-report/src/services/packageLoader.ts.html +0 -194
  33. package/coverage/lcov-report/src/services/pubSub.ts.html +0 -242
  34. package/coverage/lcov-report/src/services/settings.ts.html +0 -218
  35. package/coverage/lcov-report/src/setupTests.ts.html +0 -158
  36. package/coverage/lcov.info +0 -175
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("mobx"),require("react-dom"),require("styled-components")):"function"==typeof define&&define.amd?define("@tivio/sdk-react",["react","mobx","react-dom","styled-components"],e):"object"==typeof exports?exports["@tivio/sdk-react"]=e(require("react"),require("mobx"),require("react-dom"),require("styled-components")):t["@tivio/sdk-react"]=e(t.react,t.mobx,t["react-dom"],t["styled-components"])}(this,(function(t,e,n,r){return function(){"use strict";var i={2444:function(t,e,n){n.d(e,{wA:function(){return o},H0:function(){return u}});var r=n(5163),i=n(6765),o=function(){function t(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return t.prototype.setInstantiationMode=function(t){return this.instantiationMode=t,this},t.prototype.setMultipleInstances=function(t){return this.multipleInstances=t,this},t.prototype.setServiceProps=function(t){return this.serviceProps=t,this},t.prototype.setInstanceCreatedCallback=function(t){return this.onInstanceCreated=t,this},t}(),a="[DEFAULT]",s=function(){function t(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}return t.prototype.get=function(t){var e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){var n=new i.BH;if(this.instancesDeferred.set(e,n),this.isInitialized(e)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:e});r&&n.resolve(r)}catch(t){}}return this.instancesDeferred.get(e).promise},t.prototype.getImmediate=function(t){var e,n=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),r=null!==(e=null==t?void 0:t.optional)&&void 0!==e&&e;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(t){if(r)return null;throw t}},t.prototype.getComponent=function(){return this.component},t.prototype.setComponent=function(t){var e,n;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(function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService({instanceIdentifier:a})}catch(t){}try{for(var i=(0,r.XA)(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var s=(0,r.CR)(o.value,2),u=s[0],c=s[1],h=this.normalizeInstanceIdentifier(u);try{var l=this.getOrInitializeService({instanceIdentifier:h});c.resolve(l)}catch(t){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}},t.prototype.clearInstance=function(t){void 0===t&&(t=a),this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return(0,r.mG)(this,void 0,void 0,(function(){var t;return(0,r.Jh)(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all((0,r.ev)((0,r.ev)([],(0,r.CR)(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})))),(0,r.CR)(t.filter((function(t){return"_delete"in t})).map((function(t){return t._delete()})))))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.isInitialized=function(t){return void 0===t&&(t=a),this.instances.has(t)},t.prototype.getOptions=function(t){return void 0===t&&(t=a),this.instancesOptions.get(t)||{}},t.prototype.initialize=function(t){var e,n;void 0===t&&(t={});var i=t.options,o=void 0===i?{}:i,a=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(a))throw Error(this.name+"("+a+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var s=this.getOrInitializeService({instanceIdentifier:a,options:o});try{for(var u=(0,r.XA)(this.instancesDeferred.entries()),c=u.next();!c.done;c=u.next()){var h=(0,r.CR)(c.value,2),l=h[0],f=h[1];a===this.normalizeInstanceIdentifier(l)&&f.resolve(s)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return s},t.prototype.onInit=function(t,e){var n,r=this.normalizeInstanceIdentifier(e),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(t),this.onInitCallbacks.set(r,i);var o=this.instances.get(r);return o&&t(o,r),function(){i.delete(t)}},t.prototype.invokeOnInitCallbacks=function(t,e){var n,i,o=this.onInitCallbacks.get(e);if(o)try{for(var a=(0,r.XA)(o),s=a.next();!s.done;s=a.next()){var u=s.value;try{u(t,e)}catch(t){}}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},t.prototype.getOrInitializeService=function(t){var e,n=t.instanceIdentifier,r=t.options,i=void 0===r?{}:r,o=this.instances.get(n);if(!o&&this.component&&(o=this.component.instanceFactory(this.container,{instanceIdentifier:(e=n,e===a?void 0:e),options:i}),this.instances.set(n,o),this.instancesOptions.set(n,i),this.invokeOnInitCallbacks(o,n),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,n,o)}catch(t){}return o||null},t.prototype.normalizeInstanceIdentifier=function(t){return void 0===t&&(t=a),this.component?this.component.multipleInstances?t:a:t},t.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},t}(),u=function(){function t(t){this.name=t,this.providers=new Map}return t.prototype.addComponent=function(t){var e=this.getProvider(t.name);if(e.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);e.setComponent(t)},t.prototype.addOrOverwriteComponent=function(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},t.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var e=new s(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}()},3936:function(t,e,n){function r(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}var i;n.d(e,{in:function(){return o},Yd:function(){return l},Ub:function(){return f},Am:function(){return p}});var o,a=[];!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(o||(o={}));var s={debug:o.DEBUG,verbose:o.VERBOSE,info:o.INFO,warn:o.WARN,error:o.ERROR,silent:o.SILENT},u=o.INFO,c=((i={})[o.DEBUG]="log",i[o.VERBOSE]="log",i[o.INFO]="info",i[o.WARN]="warn",i[o.ERROR]="error",i),h=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(e<t.logLevel)){var o=(new Date).toISOString(),a=c[e];if(!a)throw new Error("Attempted to log a message with an invalid logType (value: "+e+")");console[a].apply(console,r(["["+o+"] "+t.name+":"],n))}},l=function(){function t(t){this.name=t,this._logLevel=u,this._logHandler=h,this._userLogHandler=null,a.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in o))throw new TypeError('Invalid value "'+t+'" assigned to `logLevel`');this._logLevel=t},enumerable:!1,configurable:!0}),t.prototype.setLogLevel=function(t){this._logLevel="string"==typeof t?s[t]:t},Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!1,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.DEBUG],t)),this._logHandler.apply(this,r([this,o.DEBUG],t))},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.VERBOSE],t)),this._logHandler.apply(this,r([this,o.VERBOSE],t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.INFO],t)),this._logHandler.apply(this,r([this,o.INFO],t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.WARN],t)),this._logHandler.apply(this,r([this,o.WARN],t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.ERROR],t)),this._logHandler.apply(this,r([this,o.ERROR],t))},t}();function f(t){a.forEach((function(e){e.setLogLevel(t)}))}function p(t,e){for(var n=function(n){var r=null;e&&e.level&&(r=s[e.level]),n.userLogHandler=null===t?null:function(e,n){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var s=i.map((function(t){if(null==t)return null;if("string"==typeof t)return t;if("number"==typeof t||"boolean"==typeof t)return t.toString();if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch(t){return null}})).filter((function(t){return t})).join(" ");n>=(null!=r?r:e.logLevel)&&t({level:o[n].toLowerCase(),message:s,args:i,type:e.name})}},r=0,i=a;r<i.length;r++)n(i[r])}},6765:function(t,e,n){n.d(e,{BH:function(){return c},LL:function(){return E},r3:function(){return T},Sg:function(){return h},ne:function(){return k},p$:function(){return s},ZB:function(){return u},m9:function(){return x},z$:function(){return l},jU:function(){return d},ru:function(){return v},d:function(){return g},w1:function(){return m},uI:function(){return f},UG:function(){return p},b$:function(){return y},G6:function(){return w},Mn:function(){return b}});var r=n(5163),i=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1<t.length&&56320==(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},o={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:"function"==typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<t.length;i+=3){var o=t[i],a=i+1<t.length,s=a?t[i+1]:0,u=i+2<t.length,c=u?t[i+2]:0,h=o>>2,l=(3&o)<<4|s>>4,f=(15&s)<<2|c>>6,p=63&c;u||(p=64,a||(f=64)),r.push(n[h],n[l],n[f],n[p])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(i(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n<t.length;){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(1023&a))}else{o=t[n++];var s=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],a=i<t.length?n[t.charAt(i)]:0,s=++i<t.length?n[t.charAt(i)]:64,u=++i<t.length?n[t.charAt(i)]:64;if(++i,null==o||null==a||null==s||null==u)throw Error();var c=o<<2|a>>4;if(r.push(c),64!==s){var h=a<<4&240|s>>2;if(r.push(h),64!==u){var l=s<<6&192|u;r.push(l)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},a=function(t){return function(t){var e=i(t);return o.encodeByteArray(e,!0)}(t).replace(/\./g,"")};function s(t){return u(void 0,t)}function u(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&"__proto__"!==n&&(t[n]=u(t[n],e[n]));return t}var c=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"==typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}();function h(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n=e||"demo-project",i=t.iat||0,o=t.sub||t.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var s=(0,r.pi)({iss:"https://securetoken.google.com/"+n,aud:n,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},t);return[a(JSON.stringify({alg:"none",type:"JWT"})),a(JSON.stringify(s)),""].join(".")}function l(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function f(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(l())}function p(){try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(t){return!1}}function d(){return"object"==typeof self&&self.self===self}function v(){var t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}function y(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function g(){return l().indexOf("Electron/")>=0}function m(){var t=l();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function b(){return l().indexOf("MSAppHost/")>=0}function w(){return!p()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}var _=function(t){function e(n,r,i){var o=t.call(this,r)||this;return o.code=n,o.customData=i,o.name="FirebaseError",Object.setPrototypeOf(o,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,E.prototype.create),o}return(0,r.ZT)(e,t),e}(Error),E=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n}return t.prototype.create=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=e[0]||{},i=this.service+"/"+t,o=this.errors[t],a=o?I(o,r):"Error",s=this.serviceName+": "+a+" ("+i+").",u=new _(i,s,r);return u},t}();function I(t,e){return t.replace(S,(function(t,n){var r=e[n];return null!=r?String(r):"<"+n+"?>"}))}var S=/\{\$([^}]+)}/g;function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function k(t,e){var n=new A(t,e);return n.subscribe.bind(n)}!function(){function t(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var t=1;t<this.blockSize;++t)this.pad_[t]=0;this.reset()}t.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},t.prototype.compress_=function(t,e){e||(e=0);var n=this.W_;if("string"==typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(r=16;r<80;r++){var i=n[r-3]^n[r-8]^n[r-14]^n[r-16];n[r]=4294967295&(i<<1|i>>>31)}var o,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],h=this.chain_[3],l=this.chain_[4];for(r=0;r<80;r++)r<40?r<20?(o=h^u&(c^h),a=1518500249):(o=u^c^h,a=1859775393):r<60?(o=u&c|h&(u|c),a=2400959708):(o=u^c^h,a=3395469782),i=(s<<5|s>>>27)+o+l+a+n[r]&4294967295,l=h,h=c,c=4294967295&(u<<30|u>>>2),u=s,s=i;this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+h&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<e;){if(0===o)for(;r<=n;)this.compress_(t,r),r+=this.blockSize;if("string"==typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++r,++o===this.blockSize){this.compress_(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++r,++o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},t.prototype.digest=function(){var t=[],e=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t}}();var A=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=0,r=["next","error","complete"];n<r.length;n++){var i=r[n];if(i in t&&"function"==typeof t[i])return!0}return!1}(t)?t:{next:t,error:e,complete:n}).next&&(r.next=O),void 0===r.error&&(r.error=O),void 0===r.complete&&(r.complete=O);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(t){}})),this.observers.push(r),o},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var n=this;this.task.then((function(){if(void 0!==n.observers&&void 0!==n.observers[t])try{e(n.observers[t])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}}))},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((function(){e.observers=void 0,e.onNoObservers=void 0})))},t}();function O(){}function x(t){return t&&t._delegate?t._delegate:t}},5451:function(t,e,n){n.r(e),n.d(e,{BrowserClient:function(){return qe},Hub:function(){return ht},Integrations:function(){return ln},SDK_NAME:function(){return un},SDK_VERSION:function(){return Ct},Scope:function(){return C},Severity:function(){return u},Status:function(){return c},Transports:function(){return o},addBreadcrumb:function(){return Et},addGlobalEventProcessor:function(){return P},captureEvent:function(){return wt},captureException:function(){return mt},captureMessage:function(){return bt},close:function(){return an},configureScope:function(){return _t},defaultIntegrations:function(){return Ze},eventFromException:function(){return ae},eventFromMessage:function(){return se},flush:function(){return on},forceLoad:function(){return nn},getCurrentHub:function(){return pt},getHubFromCarrier:function(){return vt},init:function(){return $e},injectReportDialog:function(){return Te},lastEventId:function(){return en},makeMain:function(){return ft},onLoad:function(){return rn},setContext:function(){return It},setExtra:function(){return kt},setExtras:function(){return St},setTag:function(){return At},setTags:function(){return Tt},setUser:function(){return Ot},showReportDialog:function(){return tn},startTransaction:function(){return Nt},withScope:function(){return xt},wrap:function(){return sn}});var r={};n.r(r),n.d(r,{FunctionToString:function(){return Ke},InboundFilters:function(){return Ge}});var i={};n.r(i),n.d(i,{Breadcrumbs:function(){return Ve},Dedupe:function(){return Qe},GlobalHandlers:function(){return ze},LinkedErrors:function(){return Je},TryCatch:function(){return We},UserAgent:function(){return Ye}});var o={};n.r(o),n.d(o,{BaseTransport:function(){return ge},FetchTransport:function(){return me},XHRTransport:function(){return be}});var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function s(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var u,c,h=function(){return(h=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function l(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}!function(t){t.Fatal="fatal",t.Error="error",t.Warning="warning",t.Log="log",t.Info="info",t.Debug="debug",t.Critical="critical"}(u||(u={})),function(t){t.fromString=function(e){switch(e){case"debug":return t.Debug;case"info":return t.Info;case"warn":case"warning":return t.Warning;case"error":return t.Error;case"fatal":return t.Fatal;case"critical":return t.Critical;case"log":default:return t.Log}}}(u||(u={})),function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.Invalid="invalid",t.Failed="failed"}(c||(c={})),function(t){t.fromHttpCode=function(e){return e>=200&&e<300?t.Success:429===e?t.RateLimit:e>=400&&e<500?t.Invalid:e>=500?t.Failed:t.Unknown}}(c||(c={}));var d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function v(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(v(arguments[e]));return t}function g(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return k(t,Error)}}function m(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)}function b(t){return"[object DOMError]"===Object.prototype.toString.call(t)}function w(t){return"[object String]"===Object.prototype.toString.call(t)}function _(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function E(t){return"[object Object]"===Object.prototype.toString.call(t)}function I(t){return"undefined"!=typeof Event&&k(t,Event)}function S(t){return"undefined"!=typeof Element&&k(t,Element)}function T(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function k(t,e){try{return t instanceof e}catch(t){return!1}}var A,O=n(7790);!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(A||(A={}));var x=function(){function t(t){var e=this;this._state=A.PENDING,this._handlers=[],this._resolve=function(t){e._setResult(A.RESOLVED,t)},this._reject=function(t){e._setResult(A.REJECTED,t)},this._setResult=function(t,n){e._state===A.PENDING&&(T(n)?n.then(e._resolve,e._reject):(e._state=t,e._value=n,e._executeHandlers()))},this._attachHandler=function(t){e._handlers=e._handlers.concat(t),e._executeHandlers()},this._executeHandlers=function(){if(e._state!==A.PENDING){var t=e._handlers.slice();e._handlers=[],t.forEach((function(t){t.done||(e._state===A.RESOLVED&&t.onfulfilled&&t.onfulfilled(e._value),e._state===A.REJECTED&&t.onrejected&&t.onrejected(e._value),t.done=!0)}))}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}return t.resolve=function(e){return new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.all=function(e){return new t((function(n,r){if(Array.isArray(e))if(0!==e.length){var i=e.length,o=[];e.forEach((function(e,a){t.resolve(e).then((function(t){o[a]=t,0==(i-=1)&&n(o)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},t.prototype.then=function(e,n){var r=this;return new t((function(t,i){r._attachHandler({done:!1,onfulfilled:function(n){if(e)try{return void t(e(n))}catch(t){return void i(t)}else t(n)},onrejected:function(e){if(n)try{return void t(n(e))}catch(t){return void i(t)}else i(e)}})}))},t.prototype.catch=function(t){return this.then((function(t){return t}),t)},t.prototype.finally=function(e){var n=this;return new t((function(t,r){var i,o;return n.then((function(t){o=!1,i=t,e&&e()}),(function(t){o=!0,i=t,e&&e()})).then((function(){o?r(i):t(i)}))}))},t.prototype.toString=function(){return"[object SyncPromise]"},t}(),N=n(3699),C=function(){function t(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return t.clone=function(e){var n=new t;return e&&(n._breadcrumbs=y(e._breadcrumbs),n._tags=d({},e._tags),n._extra=d({},e._extra),n._contexts=d({},e._contexts),n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=y(e._eventProcessors),n._requestSession=e._requestSession),n},t.prototype.addScopeListener=function(t){this._scopeListeners.push(t)},t.prototype.addEventProcessor=function(t){return this._eventProcessors.push(t),this},t.prototype.setUser=function(t){return this._user=t||{},this._session&&this._session.update({user:t}),this._notifyScopeListeners(),this},t.prototype.getUser=function(){return this._user},t.prototype.getRequestSession=function(){return this._requestSession},t.prototype.setRequestSession=function(t){return this._requestSession=t,this},t.prototype.setTags=function(t){return this._tags=d(d({},this._tags),t),this._notifyScopeListeners(),this},t.prototype.setTag=function(t,e){var n;return this._tags=d(d({},this._tags),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setExtras=function(t){return this._extra=d(d({},this._extra),t),this._notifyScopeListeners(),this},t.prototype.setExtra=function(t,e){var n;return this._extra=d(d({},this._extra),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setFingerprint=function(t){return this._fingerprint=t,this._notifyScopeListeners(),this},t.prototype.setLevel=function(t){return this._level=t,this._notifyScopeListeners(),this},t.prototype.setTransactionName=function(t){return this._transactionName=t,this._notifyScopeListeners(),this},t.prototype.setTransaction=function(t){return this.setTransactionName(t)},t.prototype.setContext=function(t,e){var n;return null===e?delete this._contexts[t]:this._contexts=d(d({},this._contexts),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setSpan=function(t){return this._span=t,this._notifyScopeListeners(),this},t.prototype.getSpan=function(){return this._span},t.prototype.getTransaction=function(){var t,e,n,r,i=this.getSpan();return(null===(t=i)||void 0===t?void 0:t.transaction)?null===(e=i)||void 0===e?void 0:e.transaction:(null===(r=null===(n=i)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?i.spanRecorder.spans[0]:void 0},t.prototype.setSession=function(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this},t.prototype.getSession=function(){return this._session},t.prototype.update=function(e){if(!e)return this;if("function"==typeof e){var n=e(this);return n instanceof t?n:this}return e instanceof t?(this._tags=d(d({},this._tags),e._tags),this._extra=d(d({},this._extra),e._extra),this._contexts=d(d({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):E(e)&&(e=e,this._tags=d(d({},this._tags),e.tags),this._extra=d(d({},this._extra),e.extra),this._contexts=d(d({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this},t.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},t.prototype.addBreadcrumb=function(t,e){var n="number"==typeof e?Math.min(e,100):100;if(n<=0)return this;var r=d({timestamp:(0,O.yW)()},t);return this._breadcrumbs=y(this._breadcrumbs,[r]).slice(-n),this._notifyScopeListeners(),this},t.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},t.prototype.applyToEvent=function(t,e){var n;if(this._extra&&Object.keys(this._extra).length&&(t.extra=d(d({},this._extra),t.extra)),this._tags&&Object.keys(this._tags).length&&(t.tags=d(d({},this._tags),t.tags)),this._user&&Object.keys(this._user).length&&(t.user=d(d({},this._user),t.user)),this._contexts&&Object.keys(this._contexts).length&&(t.contexts=d(d({},this._contexts),t.contexts)),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts=d({trace:this._span.getTraceContext()},t.contexts);var r=null===(n=this._span.transaction)||void 0===n?void 0:n.name;r&&(t.tags=d({transaction:r},t.tags))}return this._applyFingerprint(t),t.breadcrumbs=y(t.breadcrumbs||[],this._breadcrumbs),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,this._notifyEventProcessors(y(D(),this._eventProcessors),t,e)},t.prototype._notifyEventProcessors=function(t,e,n,r){var i=this;return void 0===r&&(r=0),new x((function(o,a){var s=t[r];if(null===e||"function"!=typeof s)o(e);else{var u=s(d({},e),n);T(u)?u.then((function(e){return i._notifyEventProcessors(t,e,n,r+1).then(o)})).then(null,a):i._notifyEventProcessors(t,u,n,r+1).then(o).then(null,a)}}))},t.prototype._notifyScopeListeners=function(){var t=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(e){e(t)})),this._notifyingListeners=!1)},t.prototype._applyFingerprint=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},t}();function D(){var t=(0,N.Rf)();return t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.globalEventProcessors=t.__SENTRY__.globalEventProcessors||[],t.__SENTRY__.globalEventProcessors}function P(t){D().push(t)}var R,L,j=function(){return(j=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function M(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function F(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(M(arguments[e]));return t}!function(t){t.Ok="ok",t.Exited="exited",t.Crashed="crashed",t.Abnormal="abnormal"}(R||(R={})),function(t){t.Ok="ok",t.Errored="errored",t.Crashed="crashed"}(L||(L={}));var U=(0,N.Rf)(),V="Sentry Logger ",q=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&(0,N.Cf)((function(){U.console.log(V+"[Log]: "+t.join(" "))}))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&(0,N.Cf)((function(){U.console.warn(V+"[Warn]: "+t.join(" "))}))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&(0,N.Cf)((function(){U.console.error(V+"[Error]: "+t.join(" "))}))},t}();U.__SENTRY__=U.__SENTRY__||{};var B=U.__SENTRY__.logger||(U.__SENTRY__.logger=new q),G=n(7392),K=function(t,e){return(K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},H=function(){return(H=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function W(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function z(t,e){try{for(var n=t,r=[],i=0,o=0,a=" > ".length,s=void 0;n&&i++<5&&!("html"===(s=J(n,e))||i>1&&o+r.length*a+s.length>=80);)r.push(s),o+=s.length,n=n.parentNode;return r.reverse().join(" > ")}catch(t){return"<unknown>"}}function J(t,e){var n,r,i,o,a,s,u,c=t,h=[];if(!c||!c.tagName)return"";h.push(c.tagName.toLowerCase());var l=(null===(n=e)||void 0===n?void 0:n.length)?e.filter((function(t){return c.getAttribute(t)})).map((function(t){return[t,c.getAttribute(t)]})):null;if(null===(r=l)||void 0===r?void 0:r.length)l.forEach((function(t){h.push("["+t[0]+'="'+t[1]+'"]')}));else if(c.id&&h.push("#"+c.id),(i=c.className)&&w(i))for(o=i.split(/\s+/),u=0;u<o.length;u++)h.push("."+o[u]);var f=["type","name","title","alt"];for(u=0;u<f.length;u++)a=f[u],(s=c.getAttribute(a))&&h.push("["+a+'="'+s+'"]');return h.join("")}var Q=function(){function t(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return t.prototype.memoize=function(t){if(this._hasWeakSet)return!!this._inner.has(t)||(this._inner.add(t),!1);for(var e=0;e<this._inner.length;e++)if(this._inner[e]===t)return!0;return this._inner.push(t),!1},t.prototype.unmemoize=function(t){if(this._hasWeakSet)this._inner.delete(t);else for(var e=0;e<this._inner.length;e++)if(this._inner[e]===t){this._inner.splice(e,1);break}},t}(),X="<anonymous>";function Y(t){try{return t&&"function"==typeof t&&t.name||X}catch(t){return X}}function Z(t,e){return void 0===e&&(e=0),"string"!=typeof t||0===e||t.length<=e?t:t.substr(0,e)+"..."}function $(t,e){if(!Array.isArray(t))return"";for(var n=[],r=0;r<t.length;r++){var i=t[r];try{n.push(String(i))}catch(t){n.push("[value cannot be serialized]")}}return n.join(e)}function tt(t,e){return!!w(t)&&(n=e,"[object RegExp]"===Object.prototype.toString.call(n)?e.test(t):"string"==typeof e&&-1!==t.indexOf(e));var n}function et(t,e,n){if(e in t){var r=t[e],i=n(r);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__sentry_original__:{enumerable:!1,value:r}})}catch(t){}t[e]=i}}function nt(t){if(g(t)){var e=t,n={message:e.message,name:e.name,stack:e.stack};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}if(I(t)){var i=t,o={};o.type=i.type;try{o.target=S(i.target)?z(i.target):Object.prototype.toString.call(i.target)}catch(t){o.target="<unknown>"}try{o.currentTarget=S(i.currentTarget)?z(i.currentTarget):Object.prototype.toString.call(i.currentTarget)}catch(t){o.currentTarget="<unknown>"}for(var a in"undefined"!=typeof CustomEvent&&k(t,CustomEvent)&&(o.detail=i.detail),i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a]);return o}return t}function rt(t,e,n){void 0===e&&(e=3),void 0===n&&(n=102400);var r,i=at(t,e);return r=i,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(r))>n?rt(t,e-1,n):i}function it(t,e){return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":void 0!==n.g&&t===n.g?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":E(r=t)&&"nativeEvent"in r&&"preventDefault"in r&&"stopPropagation"in r?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+Y(t)+"]":"symbol"==typeof t?"["+String(t)+"]":"bigint"==typeof t?"[BigInt: "+String(t)+"]":t;var r}function ot(t,e,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new Q),0===n)return function(t){var e=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===e)return"[Object]";if("[object Array]"===e)return"[Array]";var n=it(t);return _(n)?n:e}(e);if(null!=e&&"function"==typeof e.toJSON)return e.toJSON();var i=it(e,t);if(_(i))return i;var o=nt(e),a=Array.isArray(e)?[]:{};if(r.memoize(e))return"[Circular ~]";for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(a[s]=ot(s,o[s],n-1,r));return r.unmemoize(e),a}function at(t,e){try{return JSON.parse(JSON.stringify(t,(function(t,n){return ot(t,n,e)})))}catch(t){return"**non-serializable**"}}function st(t,e){void 0===e&&(e=40);var n=Object.keys(nt(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return Z(n[0],e);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:Z(i,e)}return""}function ut(t){var e,n;if(E(t)){var r=t,i={};try{for(var o=W(Object.keys(r)),a=o.next();!a.done;a=o.next()){var s=a.value;void 0!==r[s]&&(i[s]=ut(r[s]))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}return Array.isArray(t)?t.map(ut):t}var ct=function(){function t(t){this.errors=0,this.sid=(0,N.DM)(),this.duration=0,this.status=R.Ok,this.init=!0,this.ignoreDuration=!1;var e=(0,O.ph)();this.timestamp=e,this.started=e,t&&this.update(t)}return t.prototype.update=function(t){if(void 0===t&&(t={}),t.user&&(!this.ipAddress&&t.user.ip_address&&(this.ipAddress=t.user.ip_address),this.did||t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||(0,O.ph)(),t.ignoreDuration&&(this.ignoreDuration=t.ignoreDuration),t.sid&&(this.sid=32===t.sid.length?t.sid:(0,N.DM)()),void 0!==t.init&&(this.init=t.init),!this.did&&t.did&&(this.did=""+t.did),"number"==typeof t.started&&(this.started=t.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof t.duration)this.duration=t.duration;else{var e=this.timestamp-this.started;this.duration=e>=0?e:0}t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),!this.ipAddress&&t.ipAddress&&(this.ipAddress=t.ipAddress),!this.userAgent&&t.userAgent&&(this.userAgent=t.userAgent),"number"==typeof t.errors&&(this.errors=t.errors),t.status&&(this.status=t.status)},t.prototype.close=function(t){t?this.update({status:t}):this.status===R.Ok?this.update({status:R.Exited}):this.update()},t.prototype.toJSON=function(){return ut({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:ut({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},t}(),ht=function(){function t(t,e,n){void 0===e&&(e=new C),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=e,t&&this.bindClient(t)}return t.prototype.isOlderThan=function(t){return this._version<t},t.prototype.bindClient=function(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()},t.prototype.pushScope=function(){var t=C.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t},t.prototype.popScope=function(){return!(this.getStack().length<=1||!this.getStack().pop())},t.prototype.withScope=function(t){var e=this.pushScope();try{t(e)}finally{this.popScope()}},t.prototype.getClient=function(){return this.getStackTop().client},t.prototype.getScope=function(){return this.getStackTop().scope},t.prototype.getStack=function(){return this._stack},t.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},t.prototype.captureException=function(t,e){var n=this._lastEventId=(0,N.DM)(),r=e;if(!e){var i=void 0;try{throw new Error("Sentry syntheticException")}catch(t){i=t}r={originalException:t,syntheticException:i}}return this._invokeClient("captureException",t,d(d({},r),{event_id:n})),n},t.prototype.captureMessage=function(t,e,n){var r=this._lastEventId=(0,N.DM)(),i=n;if(!n){var o=void 0;try{throw new Error(t)}catch(t){o=t}i={originalException:t,syntheticException:o}}return this._invokeClient("captureMessage",t,e,d(d({},i),{event_id:r})),r},t.prototype.captureEvent=function(t,e){var n=this._lastEventId=(0,N.DM)();return this._invokeClient("captureEvent",t,d(d({},e),{event_id:n})),n},t.prototype.lastEventId=function(){return this._lastEventId},t.prototype.addBreadcrumb=function(t,e){var n=this.getStackTop(),r=n.scope,i=n.client;if(r&&i){var o=i.getOptions&&i.getOptions()||{},a=o.beforeBreadcrumb,s=void 0===a?null:a,u=o.maxBreadcrumbs,c=void 0===u?100:u;if(!(c<=0)){var h=(0,O.yW)(),l=d({timestamp:h},t),f=s?(0,N.Cf)((function(){return s(l,e)})):l;null!==f&&r.addBreadcrumb(f,c)}}},t.prototype.setUser=function(t){var e=this.getScope();e&&e.setUser(t)},t.prototype.setTags=function(t){var e=this.getScope();e&&e.setTags(t)},t.prototype.setExtras=function(t){var e=this.getScope();e&&e.setExtras(t)},t.prototype.setTag=function(t,e){var n=this.getScope();n&&n.setTag(t,e)},t.prototype.setExtra=function(t,e){var n=this.getScope();n&&n.setExtra(t,e)},t.prototype.setContext=function(t,e){var n=this.getScope();n&&n.setContext(t,e)},t.prototype.configureScope=function(t){var e=this.getStackTop(),n=e.scope,r=e.client;n&&r&&t(n)},t.prototype.run=function(t){var e=ft(this);try{t(this)}finally{ft(e)}},t.prototype.getIntegration=function(t){var e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return B.warn("Cannot retrieve integration "+t.id+" from the current Hub"),null}},t.prototype.startSpan=function(t){return this._callExtensionMethod("startSpan",t)},t.prototype.startTransaction=function(t,e){return this._callExtensionMethod("startTransaction",t,e)},t.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},t.prototype.captureSession=function(t){if(void 0===t&&(t=!1),t)return this.endSession();this._sendSessionUpdate()},t.prototype.endSession=function(){var t,e,n,r,i;null===(n=null===(e=null===(t=this.getStackTop())||void 0===t?void 0:t.scope)||void 0===e?void 0:e.getSession())||void 0===n||n.close(),this._sendSessionUpdate(),null===(i=null===(r=this.getStackTop())||void 0===r?void 0:r.scope)||void 0===i||i.setSession()},t.prototype.startSession=function(t){var e=this.getStackTop(),n=e.scope,r=e.client,i=r&&r.getOptions()||{},o=i.release,a=i.environment,s=((0,N.Rf)().navigator||{}).userAgent,u=new ct(d(d(d({release:o,environment:a},n&&{user:n.getUser()}),s&&{userAgent:s}),t));if(n){var c=n.getSession&&n.getSession();c&&c.status===R.Ok&&c.update({status:R.Exited}),this.endSession(),n.setSession(u)}return u},t.prototype._sendSessionUpdate=function(){var t=this.getStackTop(),e=t.scope,n=t.client;if(e){var r=e.getSession&&e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},t.prototype._invokeClient=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this.getStackTop(),o=i.scope,a=i.client;a&&a[t]&&(e=a)[t].apply(e,y(n,[o]))},t.prototype._callExtensionMethod=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=lt(),i=r.__SENTRY__;if(i&&i.extensions&&"function"==typeof i.extensions[t])return i.extensions[t].apply(this,e);B.warn("Extension method "+t+" couldn't be found, doing nothing.")},t}();function lt(){var t=(0,N.Rf)();return t.__SENTRY__=t.__SENTRY__||{extensions:{},hub:void 0},t}function ft(t){var e=lt(),n=vt(e);return yt(e,t),n}function pt(){var t=lt();return dt(t)&&!vt(t).isOlderThan(4)||yt(t,new ht),(0,G.KV)()?function(t){var e,n,r;try{var i=null===(r=null===(n=null===(e=lt().__SENTRY__)||void 0===e?void 0:e.extensions)||void 0===n?void 0:n.domain)||void 0===r?void 0:r.active;if(!i)return vt(t);if(!dt(i)||vt(i).isOlderThan(4)){var o=vt(t).getStackTop();yt(i,new ht(o.client,C.clone(o.scope)))}return vt(i)}catch(e){return vt(t)}}(t):vt(t)}function dt(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function vt(t){return t&&t.__SENTRY__&&t.__SENTRY__.hub||(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=new ht),t.__SENTRY__.hub}function yt(t,e){return!!t&&(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=e,!0)}function gt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=pt();if(r&&r[t])return r[t].apply(r,F(e));throw new Error("No hub defined or "+t+" was not found on the hub, please open a bug report.")}function mt(t,e){var n;try{throw new Error("Sentry syntheticException")}catch(t){n=t}return gt("captureException",t,{captureContext:e,originalException:t,syntheticException:n})}function bt(t,e){var n;try{throw new Error(t)}catch(t){n=t}return gt("captureMessage",t,"string"==typeof e?e:void 0,j({originalException:t,syntheticException:n},"string"!=typeof e?{captureContext:e}:void 0))}function wt(t){return gt("captureEvent",t)}function _t(t){gt("configureScope",t)}function Et(t){gt("addBreadcrumb",t)}function It(t,e){gt("setContext",t,e)}function St(t){gt("setExtras",t)}function Tt(t){gt("setTags",t)}function kt(t,e){gt("setExtra",t,e)}function At(t,e){gt("setTag",t,e)}function Ot(t){gt("setUser",t)}function xt(t){gt("withScope",t)}function Nt(t,e){return gt("startTransaction",j({},t),e)}var Ct="6.11.0",Dt=function(){return(Dt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function Pt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Rt(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Pt(arguments[e]));return t}var Lt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n]);return t}),jt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.message=e,r.name=n.prototype.constructor.name,Lt(r,n.prototype),r}return function(t,e){function n(){this.constructor=t}K(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e}(Error),Mt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,Ft=function(){function t(t){"string"==typeof t?this._fromString(t):this._fromComponents(t),this._validate()}return t.prototype.toString=function(t){void 0===t&&(t=!1);var e=this,n=e.host,r=e.path,i=e.pass,o=e.port,a=e.projectId;return e.protocol+"://"+e.publicKey+(t&&i?":"+i:"")+"@"+n+(o?":"+o:"")+"/"+(r?r+"/":r)+a},t.prototype._fromString=function(t){var e=Mt.exec(t);if(!e)throw new jt("Invalid Dsn");var n=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(e.slice(1),6),r=n[0],i=n[1],o=n[2],a=void 0===o?"":o,s=n[3],u=n[4],c=void 0===u?"":u,h="",l=n[5],f=l.split("/");if(f.length>1&&(h=f.slice(0,-1).join("/"),l=f.pop()),l){var p=l.match(/^\d+/);p&&(l=p[0])}this._fromComponents({host:s,pass:a,path:h,projectId:l,port:c,protocol:r,publicKey:i})},t.prototype._fromComponents=function(t){"user"in t&&!("publicKey"in t)&&(t.publicKey=t.user),this.user=t.publicKey||"",this.protocol=t.protocol,this.publicKey=t.publicKey||"",this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId},t.prototype._validate=function(){var t=this;if(["protocol","publicKey","host","projectId"].forEach((function(e){if(!t[e])throw new jt("Invalid Dsn: "+e+" missing")})),!this.projectId.match(/^\d+$/))throw new jt("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new jt("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new jt("Invalid Dsn: Invalid port "+this.port)},t}(),Ut=[];function Vt(t){return t.reduce((function(t,e){return t.every((function(t){return e.name!==t.name}))&&t.push(e),t}),[])}var qt=function(){function t(t,e){this._integrations={},this._numProcessing=0,this._backend=new t(e),this._options=e,e.dsn&&(this._dsn=new Ft(e.dsn))}return t.prototype.captureException=function(t,e,n){var r=this,i=e&&e.event_id;return this._process(this._getBackend().eventFromException(t,e).then((function(t){return r._captureEvent(t,e,n)})).then((function(t){i=t}))),i},t.prototype.captureMessage=function(t,e,n,r){var i=this,o=n&&n.event_id,a=_(t)?this._getBackend().eventFromMessage(String(t),e,n):this._getBackend().eventFromException(t,n);return this._process(a.then((function(t){return i._captureEvent(t,n,r)})).then((function(t){o=t}))),o},t.prototype.captureEvent=function(t,e,n){var r=e&&e.event_id;return this._process(this._captureEvent(t,e,n).then((function(t){r=t}))),r},t.prototype.captureSession=function(t){this._isEnabled()?"string"!=typeof t.release?B.warn("Discarded session because of missing or non-string release"):(this._sendSession(t),t.update({init:!1})):B.warn("SDK not enabled, will not capture session.")},t.prototype.getDsn=function(){return this._dsn},t.prototype.getOptions=function(){return this._options},t.prototype.flush=function(t){var e=this;return this._isClientDoneProcessing(t).then((function(n){return e._getBackend().getTransport().close(t).then((function(t){return n&&t}))}))},t.prototype.close=function(t){var e=this;return this.flush(t).then((function(t){return e.getOptions().enabled=!1,t}))},t.prototype.setupIntegrations=function(){var t,e;this._isEnabled()&&!this._integrations.initialized&&(this._integrations=(t=this._options,e={},function(t){var e=t.defaultIntegrations&&Rt(t.defaultIntegrations)||[],n=t.integrations,r=Rt(Vt(e));Array.isArray(n)?r=Rt(r.filter((function(t){return n.every((function(e){return e.name!==t.name}))})),Vt(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var i=r.map((function(t){return t.name})),o="Debug";return-1!==i.indexOf(o)&&r.push.apply(r,Rt(r.splice(i.indexOf(o),1))),r}(t).forEach((function(t){e[t.name]=t,function(t){-1===Ut.indexOf(t.name)&&(t.setupOnce(P,pt),Ut.push(t.name),B.log("Integration installed: "+t.name))}(t)})),Object.defineProperty(e,"initialized",{value:!0}),e))},t.prototype.getIntegration=function(t){try{return this._integrations[t.id]||null}catch(e){return B.warn("Cannot retrieve integration "+t.id+" from the current Client"),null}},t.prototype._updateSessionFromEvent=function(t,e){var n,r,i=!1,o=!1,a=e.exception&&e.exception.values;if(a){o=!0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),u=s.next();!u.done;u=s.next()){var c=u.value.mechanism;if(c&&!1===c.handled){i=!0;break}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}var h=t.status===R.Ok;(h&&0===t.errors||h&&i)&&(t.update(Dt(Dt({},i&&{status:R.Crashed}),{errors:t.errors||Number(o||i)})),this.captureSession(t))},t.prototype._sendSession=function(t){this._getBackend().sendSession(t)},t.prototype._isClientDoneProcessing=function(t){var e=this;return new x((function(n){var r=0,i=setInterval((function(){0==e._numProcessing?(clearInterval(i),n(!0)):(r+=1,t&&r>=t&&(clearInterval(i),n(!1)))}),1)}))},t.prototype._getBackend=function(){return this._backend},t.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},t.prototype._prepareEvent=function(t,e,n){var r=this,i=this.getOptions().normalizeDepth,o=void 0===i?3:i,a=Dt(Dt({},t),{event_id:t.event_id||(n&&n.event_id?n.event_id:(0,N.DM)()),timestamp:t.timestamp||(0,O.yW)()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var s=e;n&&n.captureContext&&(s=C.clone(s).update(n.captureContext));var u=x.resolve(a);return s&&(u=s.applyToEvent(a,n)),u.then((function(t){return"number"==typeof o&&o>0?r._normalizeEvent(t,o):t}))},t.prototype._normalizeEvent=function(t,e){if(!t)return null;var n=Dt(Dt(Dt(Dt(Dt({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((function(t){return Dt(Dt({},t),t.data&&{data:at(t.data,e)})}))}),t.user&&{user:at(t.user,e)}),t.contexts&&{contexts:at(t.contexts,e)}),t.extra&&{extra:at(t.extra,e)});t.contexts&&t.contexts.trace&&(n.contexts.trace=t.contexts.trace);var r=this.getOptions()._experiments;return(void 0===r?{}:r).ensureNoCircularStructures?at(n):n},t.prototype._applyClientOptions=function(t){var e=this.getOptions(),n=e.environment,r=e.release,i=e.dist,o=e.maxValueLength,a=void 0===o?250:o;"environment"in t||(t.environment="environment"in e?n:"production"),void 0===t.release&&void 0!==r&&(t.release=r),void 0===t.dist&&void 0!==i&&(t.dist=i),t.message&&(t.message=Z(t.message,a));var s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=Z(s.value,a));var u=t.request;u&&u.url&&(u.url=Z(u.url,a))},t.prototype._applyIntegrationsMetadata=function(t){var e=Object.keys(this._integrations);e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=Rt(t.sdk.integrations||[],e))},t.prototype._sendEvent=function(t){this._getBackend().sendEvent(t)},t.prototype._captureEvent=function(t,e,n){return this._processEvent(t,e,n).then((function(t){return t.event_id}),(function(t){B.error(t)}))},t.prototype._processEvent=function(t,e,n){var r=this,i=this.getOptions(),o=i.beforeSend,a=i.sampleRate;if(!this._isEnabled())return x.reject(new jt("SDK not enabled, will not capture event."));var s="transaction"===t.type;return!s&&"number"==typeof a&&Math.random()>a?x.reject(new jt("Discarding event because it's not included in the random sample (sampling rate = "+a+")")):this._prepareEvent(t,n,e).then((function(t){if(null===t)throw new jt("An event processor returned null, will not send event.");if(e&&e.data&&!0===e.data.__sentry__||s||!o)return t;var n=o(t,e);return r._ensureBeforeSendRv(n)})).then((function(t){if(null===t)throw new jt("`beforeSend` returned `null`, will not send event.");var e=n&&n.getSession&&n.getSession();return!s&&e&&r._updateSessionFromEvent(e,t),r._sendEvent(t),t})).then(null,(function(t){if(t instanceof jt)throw t;throw r.captureException(t,{data:{__sentry__:!0},originalException:t}),new jt("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+t)}))},t.prototype._process=function(t){var e=this;this._numProcessing+=1,t.then((function(t){return e._numProcessing-=1,t}),(function(t){return e._numProcessing-=1,t}))},t.prototype._ensureBeforeSendRv=function(t){var e="`beforeSend` method has to return `null` or a valid event.";if(T(t))return t.then((function(t){if(!E(t)&&null!==t)throw new jt(e);return t}),(function(t){throw new jt("beforeSend rejected with "+t)}));if(!E(t)&&null!==t)throw new jt(e);return t},t}(),Bt=function(){function t(){}return t.prototype.sendEvent=function(t){return x.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:c.Skipped})},t.prototype.close=function(t){return x.resolve(!0)},t}(),Gt=function(){function t(t){this._options=t,this._options.dsn||B.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return t.prototype.eventFromException=function(t,e){throw new jt("Backend has to implement `eventFromException` method")},t.prototype.eventFromMessage=function(t,e,n){throw new jt("Backend has to implement `eventFromMessage` method")},t.prototype.sendEvent=function(t){this._transport.sendEvent(t).then(null,(function(t){B.error("Error while sending event: "+t)}))},t.prototype.sendSession=function(t){this._transport.sendSession?this._transport.sendSession(t).then(null,(function(t){B.error("Error while sending session: "+t)})):B.warn("Dropping session because custom transport doesn't implement sendSession")},t.prototype.getTransport=function(){return this._transport},t.prototype._setupTransport=function(){return new Bt},t}();function Kt(){if(!("fetch"in(0,N.Rf)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function Ht(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Wt(){if(!Kt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}var zt="?",Jt=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Qt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Xt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Yt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Zt=/\((\S*)(?::(\d+))(?::(\d+))\)/,$t=/Minified React error #\d+;/i;function te(t){var e=null,n=0;t&&("number"==typeof t.framesToPop?n=t.framesToPop:$t.test(t.message)&&(n=1));try{if(e=function(t){if(!t||!t.stacktrace)return null;for(var e,n=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,r=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,i=t.stacktrace.split("\n"),o=[],a=0;a<i.length;a+=2){var s=null;(e=n.exec(i[a]))?s={url:e[2],func:e[3],args:[],line:+e[1],column:null}:(e=r.exec(i[a]))&&(s={url:e[6],func:e[3]||e[4],args:e[5]?e[5].split(","):[],line:+e[1],column:+e[2]}),s&&(!s.func&&s.line&&(s.func=zt),o.push(s))}return o.length?{message:ne(t),name:t.name,stack:o}:null}(t))return ee(e,n)}catch(t){}try{if(e=function(t){if(!t||!t.stack)return null;for(var e,n,r,i=[],o=t.stack.split("\n"),a=0;a<o.length;++a){if(n=Jt.exec(o[a])){var s=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(e=Zt.exec(n[2]))&&(n[2]=e[1],n[3]=e[2],n[4]=e[3]);var u=n[2]&&0===n[2].indexOf("address at ")?n[2].substr("address at ".length):n[2],c=n[1]||zt,h=-1!==c.indexOf("safari-extension"),l=-1!==c.indexOf("safari-web-extension");(h||l)&&(c=-1!==c.indexOf("@")?c.split("@")[0]:zt,u=h?"safari-extension:"+u:"safari-web-extension:"+u),r={url:u,func:c,args:s?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=Xt.exec(o[a]))r={url:n[2],func:n[1]||zt,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=Qt.exec(o[a])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(e=Yt.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=e[1],n[4]=e[2],n[5]=""):0!==a||n[5]||void 0===t.columnNumber||(i[0].column=t.columnNumber+1),r={url:n[3],func:n[1]||zt,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=zt),i.push(r)}return i.length?{message:ne(t),name:t.name,stack:i}:null}(t))return ee(e,n)}catch(t){}return{message:ne(t),name:t&&t.name,stack:[],failed:!0}}function ee(t,e){try{return h(h({},t),{stack:t.stack.slice(e)})}catch(e){return t}}function ne(t){var e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}function re(t){var e=oe(t.stack),n={type:t.name,value:t.message};return e&&e.length&&(n.stacktrace={frames:e}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function ie(t){return{exception:{values:[re(t)]}}}function oe(t){if(!t||!t.length)return[];var e=t,n=e[0].func||"",r=e[e.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(e=e.slice(1)),-1!==r.indexOf("sentryWrapped")&&(e=e.slice(0,-1)),e.slice(0,50).map((function(t){return{colno:null===t.column?void 0:t.column,filename:t.url||e[0].url,function:t.func||"?",in_app:!0,lineno:null===t.line?void 0:t.line}})).reverse()}function ae(t,e,n){var r=ue(e,n&&n.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return(0,N.EG)(r,{handled:!0,type:"generic"}),r.level=u.Error,n&&n.event_id&&(r.event_id=n.event_id),x.resolve(r)}function se(t,e,n,r){void 0===n&&(n=u.Info);var i=ce(e,r&&r.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),x.resolve(i)}function ue(t,e,n){var r,i;if(void 0===n&&(n={}),m(t)&&t.error)return ie(te(t=t.error));if(b(t)||(i=t,"[object DOMException]"===Object.prototype.toString.call(i))){var o=t,a=o.name||(b(o)?"DOMError":"DOMException"),s=o.message?a+": "+o.message:a;return r=ce(s,e,n),(0,N.Db)(r,s),"code"in o&&(r.tags=h(h({},r.tags),{"DOMException.code":""+o.code})),r}return g(t)?r=ie(te(t)):E(t)||I(t)?(r=function(t,e,n){var r={exception:{values:[{type:I(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+st(t)}]},extra:{__serialized__:rt(t)}};if(e){var i=oe(te(e).stack);r.stacktrace={frames:i}}return r}(t,e,n.rejection),(0,N.EG)(r,{synthetic:!0}),r):(r=ce(t,e,n),(0,N.Db)(r,""+t,void 0),(0,N.EG)(r,{synthetic:!0}),r)}function ce(t,e,n){void 0===n&&(n={});var r={message:t};if(n.attachStacktrace&&e){var i=oe(te(e).stack);r.stacktrace={frames:i}}return r}function he(t){if(t.metadata&&t.metadata.sdk){var e=t.metadata.sdk;return{name:e.name,version:e.version}}}function le(t,e){return e?(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=Rt(t.sdk.integrations||[],e.integrations||[]),t.sdk.packages=Rt(t.sdk.packages||[],e.packages||[]),t):t}function fe(t,e){var n=he(e),r="aggregates"in t?"sessions":"session";return{body:JSON.stringify(Dt(Dt({sent_at:(new Date).toISOString()},n&&{sdk:n}),e.forceEnvelope()&&{dsn:e.getDsn().toString()}))+"\n"+JSON.stringify({type:r})+"\n"+JSON.stringify(t),type:r,url:e.getEnvelopeEndpointWithUrlEncodedAuth()}}function pe(t,e){var n=he(e),r=t.type||"event",i="transaction"===r||e.forceEnvelope(),o=t.debug_meta||{},a=o.transactionSampling,s=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(o,["transactionSampling"]),u=a||{},c=u.method,h=u.rate;0===Object.keys(s).length?delete t.debug_meta:t.debug_meta=s;var l={body:JSON.stringify(n?le(t,e.metadata.sdk):t),type:r,url:i?e.getEnvelopeEndpointWithUrlEncodedAuth():e.getStoreEndpointWithUrlEncodedAuth()};if(i){var f=JSON.stringify(Dt(Dt({event_id:t.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}),e.forceEnvelope()&&{dsn:e.getDsn().toString()}))+"\n"+JSON.stringify({type:r,sample_rates:[{id:c,rate:h}]})+"\n"+l.body;l.body=f}return l}var de=function(){function t(t,e,n){void 0===e&&(e={}),this.dsn=t,this._dsnObject=new Ft(t),this.metadata=e,this._tunnel=n}return t.prototype.getDsn=function(){return this._dsnObject},t.prototype.forceEnvelope=function(){return!!this._tunnel},t.prototype.getBaseApiEndpoint=function(){var t=this.getDsn(),e=t.protocol?t.protocol+":":"",n=t.port?":"+t.port:"";return e+"//"+t.host+n+(t.path?"/"+t.path:"")+"/api/"},t.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},t.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},t.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this.forceEnvelope()?this._tunnel:this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},t.prototype.getStoreEndpointPath=function(){var t=this.getDsn();return(t.path?"/"+t.path:"")+"/api/"+t.projectId+"/store/"},t.prototype.getRequestHeaders=function(t,e){var n=this.getDsn(),r=["Sentry sentry_version=7"];return r.push("sentry_client="+t+"/"+e),r.push("sentry_key="+n.publicKey),n.pass&&r.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}},t.prototype.getReportDialogEndpoint=function(t){void 0===t&&(t={});var e=this.getDsn(),n=this.getBaseApiEndpoint()+"embed/error-page/",r=[];for(var i in r.push("dsn="+e.toString()),t)if("dsn"!==i)if("user"===i){if(!t.user)continue;t.user.name&&r.push("name="+encodeURIComponent(t.user.name)),t.user.email&&r.push("email="+encodeURIComponent(t.user.email))}else r.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return r.length?n+"?"+r.join("&"):n},t.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},t.prototype._getIngestEndpoint=function(t){return this._tunnel?this._tunnel:""+this.getBaseApiEndpoint()+this.getDsn().projectId+"/"+t+"/"},t.prototype._encodedAuth=function(){var t,e={sentry_key:this.getDsn().publicKey,sentry_version:"7"};return t=e,Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},t}(),ve=function(){function t(t){this._limit=t,this._buffer=[]}return t.prototype.isReady=function(){return void 0===this._limit||this.length()<this._limit},t.prototype.add=function(t){var e=this;if(!this.isReady())return x.reject(new jt("Not adding Promise due to buffer limit reached."));var n=t();return-1===this._buffer.indexOf(n)&&this._buffer.push(n),n.then((function(){return e.remove(n)})).then(null,(function(){return e.remove(n).then(null,(function(){}))})),n},t.prototype.remove=function(t){return this._buffer.splice(this._buffer.indexOf(t),1)[0]},t.prototype.length=function(){return this._buffer.length},t.prototype.drain=function(t){var e=this;return new x((function(n){var r=setTimeout((function(){t&&t>0&&n(!1)}),t);x.all(e._buffer).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},t}(),ye={event:"error",transaction:"transaction",session:"session",attachment:"attachment"},ge=function(){function t(t){this.options=t,this._buffer=new ve(30),this._rateLimits={},this._api=new de(t.dsn,t._metadata,t.tunnel),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return t.prototype.sendEvent=function(t){throw new jt("Transport Class has to implement `sendEvent` method")},t.prototype.close=function(t){return this._buffer.drain(t)},t.prototype._handleResponse=function(t){var e=t.requestType,n=t.response,r=t.headers,i=t.resolve,o=t.reject,a=c.fromHttpCode(n.status);this._handleRateLimit(r)&&B.warn("Too many "+e+" requests, backing off until: "+this._disabledUntil(e)),a!==c.Success?o(n):i({status:a})},t.prototype._disabledUntil=function(t){var e=ye[t];return this._rateLimits[e]||this._rateLimits.all},t.prototype._isRateLimited=function(t){return this._disabledUntil(t)>new Date(Date.now())},t.prototype._handleRateLimit=function(t){var e,n,r,i,o=Date.now(),a=t["x-sentry-rate-limits"],s=t["retry-after"];if(a){try{for(var u=l(a.trim().split(",")),c=u.next();!c.done;c=u.next()){var h=c.value.split(":",2),f=parseInt(h[0],10),p=1e3*(isNaN(f)?60:f);try{for(var d=(r=void 0,l(h[1].split(";"))),v=d.next();!v.done;v=d.next()){var y=v.value;this._rateLimits[y||"all"]=new Date(o+p)}}catch(t){r={error:t}}finally{try{v&&!v.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return!0}return!!s&&(this._rateLimits.all=new Date(o+(0,N.JY)(o,s)),!0)},t}(),me=function(t){function e(e,n){void 0===n&&(n=function(){var t,e,n=(0,N.Rf)();if(Ht(n.fetch))return n.fetch.bind(n);var r=n.document,i=n.fetch;if("function"==typeof(null===(t=r)||void 0===t?void 0:t.createElement))try{var o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o),(null===(e=o.contentWindow)||void 0===e?void 0:e.fetch)&&(i=o.contentWindow.fetch),r.head.removeChild(o)}catch(t){B.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return i.bind(n)}());var r=t.call(this,e)||this;return r._fetch=n,r}return s(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(pe(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(fe(t,this._api),t)},e.prototype._sendRequest=function(t,e){var n=this;if(this._isRateLimited(t.type))return Promise.reject({event:e,type:t.type,reason:"Transport for "+t.type+" requests locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429});var r={body:t.body,method:"POST",referrerPolicy:Wt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new x((function(e,i){n._fetch(t.url,r).then((function(r){var o={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:t.type,response:r,headers:o,resolve:e,reject:i})})).catch(i)}))}))},e}(ge),be=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(pe(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(fe(t,this._api),t)},e.prototype._sendRequest=function(t,e){var n=this;return this._isRateLimited(t.type)?Promise.reject({event:e,type:t.type,reason:"Transport for "+t.type+" requests locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429}):this._buffer.add((function(){return new x((function(e,r){var i=new XMLHttpRequest;for(var o in i.onreadystatechange=function(){if(4===i.readyState){var o={"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")};n._handleResponse({requestType:t.type,response:i,headers:o,resolve:e,reject:r})}},i.open("POST",t.url),n.options.headers)n.options.headers.hasOwnProperty(o)&&i.setRequestHeader(o,n.options.headers[o]);i.send(t.body)}))}))},e}(ge),we=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.eventFromException=function(t,e){return ae(this._options,t,e)},e.prototype.eventFromMessage=function(t,e,n){return void 0===e&&(e=u.Info),se(this._options,t,e,n)},e.prototype._setupTransport=function(){if(!this._options.dsn)return t.prototype._setupTransport.call(this);var e=h(h({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(e):Kt()?new me(e):new be(e)},e}(Gt),_e=0;function Ee(){return _e>0}function Ie(){_e+=1,setTimeout((function(){_e-=1}))}function Se(t,e,n){if(void 0===e&&(e={}),"function"!=typeof t)return t;try{if(t.__sentry__)return t;if(t.__sentry_wrapped__)return t.__sentry_wrapped__}catch(e){return t}var r=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var i=r.map((function(t){return Se(t,e)}));return t.handleEvent?t.handleEvent.apply(this,i):t.apply(this,i)}catch(t){throw Ie(),xt((function(n){n.addEventProcessor((function(t){var n=h({},t);return e.mechanism&&((0,N.Db)(n,void 0,void 0),(0,N.EG)(n,e.mechanism)),n.extra=h(h({},n.extra),{arguments:r}),n})),mt(t)})),t}};try{for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch(t){}t.prototype=t.prototype||{},r.prototype=t.prototype,Object.defineProperty(t,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:t}});try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:function(){return t.name}})}catch(t){}return r}function Te(t){if(void 0===t&&(t={}),t.eventId)if(t.dsn){var e=document.createElement("script");e.async=!0,e.src=new de(t.dsn).getReportDialogEndpoint(t),t.onLoad&&(e.onload=t.onLoad),(document.head||document.body).appendChild(e)}else B.error("Missing dsn option in showReportDialog call");else B.error("Missing eventId option in showReportDialog call")}var ke,Ae,Oe,xe=(0,N.Rf)(),Ne={},Ce={};function De(t){t&&"string"==typeof t.type&&"function"==typeof t.callback&&(Ne[t.type]=Ne[t.type]||[],Ne[t.type].push(t.callback),function(t){if(!Ce[t])switch(Ce[t]=!0,t){case"console":"console"in xe&&["debug","info","warn","error","log","assert"].forEach((function(t){t in xe.console&&et(xe.console,t,(function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Pe("console",{args:n,level:t}),e&&Function.prototype.apply.call(e,xe.console,n)}}))}));break;case"dom":!function(){if("document"in xe){var t=Pe.bind(null,"dom"),e=je(t,!0);xe.document.addEventListener("click",e,!1),xe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((function(e){var n=xe[e]&&xe[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(et(n,"addEventListener",(function(e){return function(n,r,i){if("click"===n||"keypress"==n)try{var o=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=o[n]=o[n]||{refCount:0};if(!a.handler){var s=je(t);a.handler=s,e.call(this,n,s,i)}a.refCount+=1}catch(t){}return e.call(this,n,r,i)}})),et(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{var i=this.__sentry_instrumentation_handlers__||{},o=i[e];o&&(o.refCount-=1,o.refCount<=0&&(t.call(this,e,o.handler,r),o.handler=void 0,delete i[e]),0===Object.keys(i).length&&delete this.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,n,r)}})))}))}}();break;case"xhr":!function(){if("XMLHttpRequest"in xe){var t=[],e=[],n=XMLHttpRequest.prototype;et(n,"open",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=this,a=r[1];o.__sentry_xhr__={method:w(r[0])?r[0].toUpperCase():r[0],url:r[1]},w(a)&&"POST"===o.__sentry_xhr__.method&&a.match(/sentry_key/)&&(o.__sentry_own_request__=!0);var s=function(){if(4===o.readyState){try{o.__sentry_xhr__&&(o.__sentry_xhr__.status_code=o.status)}catch(t){}try{var n=t.indexOf(o);if(-1!==n){t.splice(n);var i=e.splice(n)[0];o.__sentry_xhr__&&void 0!==i[0]&&(o.__sentry_xhr__.body=i[0])}}catch(t){}Pe("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:o})}};return"onreadystatechange"in o&&"function"==typeof o.onreadystatechange?et(o,"onreadystatechange",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return s(),t.apply(o,e)}})):o.addEventListener("readystatechange",s),n.apply(o,r)}})),et(n,"send",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return t.push(this),e.push(r),Pe("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}}))}}();break;case"fetch":(function(){if(!Kt())return!1;var t=(0,N.Rf)();if(Ht(t.fetch))return!0;var e=!1,n=t.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=Ht(r.contentWindow.fetch)),n.head.removeChild(r)}catch(t){B.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e})()&&et(xe,"fetch",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r={args:e,fetchData:{method:Re(e),url:Le(e)},startTimestamp:Date.now()};return Pe("fetch",H({},r)),t.apply(xe,e).then((function(t){return Pe("fetch",H(H({},r),{endTimestamp:Date.now(),response:t})),t}),(function(t){throw Pe("fetch",H(H({},r),{endTimestamp:Date.now(),error:t})),t}))}}));break;case"history":!function(){if(function(){var t=(0,N.Rf)(),e=t.chrome,n=e&&e.app&&e.app.runtime,r="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!n&&r}()){var t=xe.onpopstate;xe.onpopstate=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=xe.location.href,i=ke;if(ke=r,Pe("history",{from:i,to:r}),t)try{return t.apply(this,e)}catch(t){}},et(xe.history,"pushState",e),et(xe.history,"replaceState",e)}function e(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length>2?e[2]:void 0;if(r){var i=ke,o=String(r);ke=o,Pe("history",{from:i,to:o})}return t.apply(this,e)}}}();break;case"error":Fe=xe.onerror,xe.onerror=function(t,e,n,r,i){return Pe("error",{column:r,error:i,line:n,msg:t,url:e}),!!Fe&&Fe.apply(this,arguments)};break;case"unhandledrejection":Ue=xe.onunhandledrejection,xe.onunhandledrejection=function(t){return Pe("unhandledrejection",t),!Ue||Ue.apply(this,arguments)};break;default:B.warn("unknown instrumentation type:",t)}}(t.type))}function Pe(t,e){var n,r;if(t&&Ne[t])try{for(var i=W(Ne[t]||[]),o=i.next();!o.done;o=i.next()){var a=o.value;try{a(e)}catch(e){B.error("Error while triggering instrumentation handler.\nType: "+t+"\nName: "+Y(a)+"\nError: "+e)}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function Re(t){return void 0===t&&(t=[]),"Request"in xe&&k(t[0],Request)&&t[0].method?String(t[0].method).toUpperCase():t[1]&&t[1].method?String(t[1].method).toUpperCase():"GET"}function Le(t){return void 0===t&&(t=[]),"string"==typeof t[0]?t[0]:"Request"in xe&&k(t[0],Request)?t[0].url:String(t[0])}function je(t,e){return void 0===e&&(e=!1),function(n){if(n&&Oe!==n&&!function(t){if("keypress"!==t.type)return!1;try{var e=t.target;if(!e||!e.tagName)return!0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)return!1}catch(t){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===Ae||function(t,e){if(!t)return!0;if(t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch(t){}return!1}(Oe,n))&&(t({event:n,name:r,global:e}),Oe=n),clearTimeout(Ae),Ae=xe.setTimeout((function(){Ae=void 0}),1e3)}}}var Me,Fe=null,Ue=null,Ve=function(){function t(e){this.name=t.id,this._options=h({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}return t.prototype.addSentryBreadcrumb=function(t){this._options.sentry&&pt().addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:(0,N.jH)(t)},{event:t})},t.prototype.setupOnce=function(){var t=this;this._options.console&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._consoleBreadcrumb.apply(t,p(e))},type:"console"}),this._options.dom&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._domBreadcrumb.apply(t,p(e))},type:"dom"}),this._options.xhr&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._xhrBreadcrumb.apply(t,p(e))},type:"xhr"}),this._options.fetch&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._fetchBreadcrumb.apply(t,p(e))},type:"fetch"}),this._options.history&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._historyBreadcrumb.apply(t,p(e))},type:"history"})},t.prototype._consoleBreadcrumb=function(t){var e={category:"console",data:{arguments:t.args,logger:"console"},level:u.fromString(t.level),message:$(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;e.message="Assertion failed: "+($(t.args.slice(1)," ")||"console.assert"),e.data.arguments=t.args.slice(1)}pt().addBreadcrumb(e,{input:t.args,level:t.level})},t.prototype._domBreadcrumb=function(t){var e,n="object"==typeof this._options.dom?this._options.dom.serializeAttribute:void 0;"string"==typeof n&&(n=[n]);try{e=t.event.target?z(t.event.target,n):z(t.event,n)}catch(t){e="<unknown>"}0!==e.length&&pt().addBreadcrumb({category:"ui."+t.name,message:e},{event:t.event,name:t.name,global:t.global})},t.prototype._xhrBreadcrumb=function(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;var e=t.xhr.__sentry_xhr__||{},n=e.method,r=e.url,i=e.status_code,o=e.body;pt().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:i},type:"http"},{xhr:t.xhr,input:o})}},t.prototype._fetchBreadcrumb=function(t){t.endTimestamp&&(t.fetchData.url.match(/sentry_key/)&&"POST"===t.fetchData.method||(t.error?pt().addBreadcrumb({category:"fetch",data:t.fetchData,level:u.Error,type:"http"},{data:t.error,input:t.args}):pt().addBreadcrumb({category:"fetch",data:h(h({},t.fetchData),{status_code:t.response.status}),type:"http"},{input:t.args,response:t.response})))},t.prototype._historyBreadcrumb=function(t){var e=(0,N.Rf)(),n=t.from,r=t.to,i=(0,N.en)(e.location.href),o=(0,N.en)(n),a=(0,N.en)(r);o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),pt().addBreadcrumb({category:"navigation",data:{from:n,to:r}})},t.id="Breadcrumbs",t}(),qe=function(t){function e(e){return void 0===e&&(e={}),e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:Ct}],version:Ct},t.call(this,we,e)||this}return s(e,t),e.prototype.showReportDialog=function(t){void 0===t&&(t={}),(0,N.Rf)().document&&(this._isEnabled()?Te(h(h({},t),{dsn:t.dsn||this.getDsn()})):B.error("Trying to call showReportDialog with Sentry Client disabled"))},e.prototype._prepareEvent=function(e,n,r){return e.platform=e.platform||"javascript",t.prototype._prepareEvent.call(this,e,n,r)},e.prototype._sendEvent=function(e){var n=this.getIntegration(Ve);n&&n.addSentryBreadcrumb(e),t.prototype._sendEvent.call(this,e)},e}(qt),Be=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Ge=function(){function t(e){void 0===e&&(e={}),this._options=e,this.name=t.id}return t.prototype.setupOnce=function(){P((function(e){var n=pt();if(!n)return e;var r=n.getIntegration(t);if(r){var i=n.getClient(),o=i?i.getOptions():{},a="function"==typeof r._mergeOptions?r._mergeOptions(o):{};return"function"!=typeof r._shouldDropEvent?e:r._shouldDropEvent(e,a)?null:e}return e}))},t.prototype._shouldDropEvent=function(t,e){return this._isSentryError(t,e)?(B.warn("Event dropped due to being internal Sentry Error.\nEvent: "+(0,N.jH)(t)),!0):this._isIgnoredError(t,e)?(B.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+(0,N.jH)(t)),!0):this._isDeniedUrl(t,e)?(B.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+(0,N.jH)(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0):!this._isAllowedUrl(t,e)&&(B.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+(0,N.jH)(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0)},t.prototype._isSentryError=function(t,e){if(!e.ignoreInternal)return!1;try{return t&&t.exception&&t.exception.values&&t.exception.values[0]&&"SentryError"===t.exception.values[0].type||!1}catch(t){return!1}},t.prototype._isIgnoredError=function(t,e){return!(!e.ignoreErrors||!e.ignoreErrors.length)&&this._getPossibleEventMessages(t).some((function(t){return e.ignoreErrors.some((function(e){return tt(t,e)}))}))},t.prototype._isDeniedUrl=function(t,e){if(!e.denyUrls||!e.denyUrls.length)return!1;var n=this._getEventFilterUrl(t);return!!n&&e.denyUrls.some((function(t){return tt(n,t)}))},t.prototype._isAllowedUrl=function(t,e){if(!e.allowUrls||!e.allowUrls.length)return!0;var n=this._getEventFilterUrl(t);return!n||e.allowUrls.some((function(t){return tt(n,t)}))},t.prototype._mergeOptions=function(t){return void 0===t&&(t={}),{allowUrls:Rt(this._options.whitelistUrls||[],this._options.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:Rt(this._options.blacklistUrls||[],this._options.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:Rt(this._options.ignoreErrors||[],t.ignoreErrors||[],Be),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},t.prototype._getPossibleEventMessages=function(t){if(t.message)return[t.message];if(t.exception)try{var e=t.exception.values&&t.exception.values[0]||{},n=e.type,r=void 0===n?"":n,i=e.value,o=void 0===i?"":i;return[""+o,r+": "+o]}catch(e){return B.error("Cannot extract message for event "+(0,N.jH)(t)),[]}return[]},t.prototype._getLastValidUrl=function(t){var e;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--){var r=t[n];if("<anonymous>"!==(null===(e=r)||void 0===e?void 0:e.filename))return r.filename||null}return null},t.prototype._getEventFilterUrl=function(t){try{if(t.stacktrace){var e=t.stacktrace.frames;return this._getLastValidUrl(e)}if(t.exception){var n=t.exception.values&&t.exception.values[0].stacktrace&&t.exception.values[0].stacktrace.frames;return this._getLastValidUrl(n)}return null}catch(e){return B.error("Cannot extract url for event "+(0,N.jH)(t)),null}},t.id="InboundFilters",t}(),Ke=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){Me=Function.prototype.toString,Function.prototype.toString=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.__sentry_original__||this;return Me.apply(n,t)}},t.id="FunctionToString",t}(),He=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],We=function(){function t(e){this.name=t.id,this._options=h({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}return t.prototype.setupOnce=function(){var t=(0,N.Rf)();this._options.setTimeout&&et(t,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&et(t,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&et(t,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in t&&et(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget&&(Array.isArray(this._options.eventTarget)?this._options.eventTarget:He).forEach(this._wrapEventTarget.bind(this))},t.prototype._wrapTimeFunction=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0];return e[0]=Se(r,{mechanism:{data:{function:Y(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}},t.prototype._wrapRAF=function(t){return function(e){return t.call(this,Se(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Y(t)},handled:!0,type:"instrument"}}))}},t.prototype._wrapEventTarget=function(t){var e=(0,N.Rf)(),n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(et(n,"addEventListener",(function(e){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Se(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:Y(r),target:t},handled:!0,type:"instrument"}}))}catch(t){}return e.call(this,n,Se(r,{mechanism:{data:{function:"addEventListener",handler:Y(r),target:t},handled:!0,type:"instrument"}}),i)}})),et(n,"removeEventListener",(function(t){return function(e,n,r){var i,o=n;try{var a=null===(i=o)||void 0===i?void 0:i.__sentry_wrapped__;a&&t.call(this,e,a,r)}catch(t){}return t.call(this,e,o,r)}})))},t.prototype._wrapXHR=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this,i=["onload","onerror","onprogress","onreadystatechange"];return i.forEach((function(t){t in r&&"function"==typeof r[t]&&et(r,t,(function(e){var n={mechanism:{data:{function:t,handler:Y(e)},handled:!0,type:"instrument"}};return e.__sentry_original__&&(n.mechanism.data.handler=Y(e.__sentry_original__)),Se(e,n)}))})),t.apply(this,e)}},t.id="TryCatch",t}(),ze=function(){function t(e){this.name=t.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=h({onerror:!0,onunhandledrejection:!0},e)}return t.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(B.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(B.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},t.prototype._installGlobalOnErrorHandler=function(){var e=this;this._onErrorHandlerInstalled||(De({callback:function(n){var r=n.error,i=pt(),o=i.getIntegration(t),a=r&&!0===r.__sentry_own_request__;if(o&&!Ee()&&!a){var s=i.getClient(),u=void 0===r&&w(n.msg)?e._eventFromIncompleteOnError(n.msg,n.url,n.line,n.column):e._enhanceEventWithInitialFrame(ue(r||n.msg,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!1}),n.url,n.line,n.column);(0,N.EG)(u,{handled:!1,type:"onerror"}),i.captureEvent(u,{originalException:r})}},type:"error"}),this._onErrorHandlerInstalled=!0)},t.prototype._installGlobalOnUnhandledRejectionHandler=function(){var e=this;this._onUnhandledRejectionHandlerInstalled||(De({callback:function(n){var r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch(t){}var i=pt(),o=i.getIntegration(t),a=r&&!0===r.__sentry_own_request__;if(!o||Ee()||a)return!0;var s=i.getClient(),c=_(r)?e._eventFromRejectionWithPrimitive(r):ue(r,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!0});c.level=u.Error,(0,N.EG)(c,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(c,{originalException:r})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},t.prototype._eventFromIncompleteOnError=function(t,e,n,r){var i,o=m(t)?t.message:t,a=o.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);a&&(i=a[1],o=a[2]);var s={exception:{values:[{type:i||"Error",value:o}]}};return this._enhanceEventWithInitialFrame(s,e,n,r)},t.prototype._eventFromRejectionWithPrimitive=function(t){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(t)}]}}},t.prototype._enhanceEventWithInitialFrame=function(t,e,n,r){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].stacktrace=t.exception.values[0].stacktrace||{},t.exception.values[0].stacktrace.frames=t.exception.values[0].stacktrace.frames||[];var i=isNaN(parseInt(r,10))?void 0:r,o=isNaN(parseInt(n,10))?void 0:n,a=w(e)&&e.length>0?e:(0,N.l4)();return 0===t.exception.values[0].stacktrace.frames.length&&t.exception.values[0].stacktrace.frames.push({colno:i,filename:a,function:"?",in_app:!0,lineno:o}),t},t.id="GlobalHandlers",t}(),Je=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._key=e.key||"cause",this._limit=e.limit||5}return t.prototype.setupOnce=function(){P((function(e,n){var r=pt().getIntegration(t);if(r){var i=r._handler&&r._handler.bind(r);return"function"==typeof i?i(e,n):e}return e}))},t.prototype._handler=function(t,e){if(!(t.exception&&t.exception.values&&e&&k(e.originalException,Error)))return t;var n=this._walkErrorTree(e.originalException,this._key);return t.exception.values=p(n,t.exception.values),t},t.prototype._walkErrorTree=function(t,e,n){if(void 0===n&&(n=[]),!k(t[e],Error)||n.length+1>=this._limit)return n;var r=re(te(t[e]));return this._walkErrorTree(t[e],e,p([r],n))},t.id="LinkedErrors",t}(),Qe=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(e,n){e((function(e){var r=n().getIntegration(t);if(r){try{if(r._shouldDropEvent(e,r._previousEvent))return null}catch(t){return r._previousEvent=e}return r._previousEvent=e}return e}))},t.prototype._shouldDropEvent=function(t,e){return!(!e||!this._isSameMessageEvent(t,e)&&!this._isSameExceptionEvent(t,e))},t.prototype._isSameMessageEvent=function(t,e){var n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!this._isSameFingerprint(t,e)||!this._isSameStacktrace(t,e))},t.prototype._getFramesFromEvent=function(t){var e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch(t){return}else if(t.stacktrace)return t.stacktrace.frames},t.prototype._isSameStacktrace=function(t,e){var n=this._getFramesFromEvent(t),r=this._getFramesFromEvent(e);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,(r=r).length!==n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i],a=n[i];if(o.filename!==a.filename||o.lineno!==a.lineno||o.colno!==a.colno||o.function!==a.function)return!1}return!0},t.prototype._getExceptionFromEvent=function(t){return t.exception&&t.exception.values&&t.exception.values[0]},t.prototype._isSameExceptionEvent=function(t,e){var n=this._getExceptionFromEvent(e),r=this._getExceptionFromEvent(t);return!!(n&&r&&n.type===r.type&&n.value===r.value&&this._isSameFingerprint(t,e)&&this._isSameStacktrace(t,e))},t.prototype._isSameFingerprint=function(t,e){var n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return!(n.join("")!==r.join(""))}catch(t){return!1}},t.id="Dedupe",t}(),Xe=(0,N.Rf)(),Ye=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){P((function(e){var n,r,i;if(pt().getIntegration(t)){if(!Xe.navigator&&!Xe.location&&!Xe.document)return e;var o=(null===(n=e.request)||void 0===n?void 0:n.url)||(null===(r=Xe.location)||void 0===r?void 0:r.href),a=(Xe.document||{}).referrer,s=(Xe.navigator||{}).userAgent,u=h(h(h({},null===(i=e.request)||void 0===i?void 0:i.headers),a&&{Referer:a}),s&&{"User-Agent":s}),c=h(h({},o&&{url:o}),{headers:u});return h(h({},e),{request:c})}return e}))},t.id="UserAgent",t}(),Ze=[new Ge,new Ke,new We,new Ve,new ze,new Je,new Qe,new Ye];function $e(t){if(void 0===t&&(t={}),void 0===t.defaultIntegrations&&(t.defaultIntegrations=Ze),void 0===t.release){var e=(0,N.Rf)();e.SENTRY_RELEASE&&e.SENTRY_RELEASE.id&&(t.release=e.SENTRY_RELEASE.id)}void 0===t.autoSessionTracking&&(t.autoSessionTracking=!0),function(t,e){var n;!0===e.debug&&B.enable();var r=pt();null===(n=r.getScope())||void 0===n||n.update(e.initialScope);var i=new t(e);r.bindClient(i)}(qe,t),t.autoSessionTracking&&function(){if(void 0!==(0,N.Rf)().document){var t=pt();"function"==typeof t.startSession&&"function"==typeof t.captureSession&&(t.startSession({ignoreDuration:!0}),t.captureSession(),De({callback:function(e){var n=e.from,r=e.to;void 0!==n&&n!==r&&(t.startSession({ignoreDuration:!0}),t.captureSession())},type:"history"}))}else B.warn("Session tracking in non-browser environment with @sentry/browser is not supported.")}()}function tn(t){void 0===t&&(t={});var e=pt(),n=e.getScope();n&&(t.user=h(h({},n.getUser()),t.user)),t.eventId||(t.eventId=e.lastEventId());var r=e.getClient();r&&r.showReportDialog(t)}function en(){return pt().lastEventId()}function nn(){}function rn(t){t()}function on(t){var e=pt().getClient();return e?e.flush(t):(B.warn("Cannot flush events. No client defined."),x.resolve(!1))}function an(t){var e=pt().getClient();return e?e.close(t):(B.warn("Cannot flush events and disable SDK. No client defined."),x.resolve(!1))}function sn(t){return Se(t)()}var un="sentry.javascript.browser",cn={},hn=(0,N.Rf)();hn.Sentry&&hn.Sentry.Integrations&&(cn=hn.Sentry.Integrations);var ln=h(h(h({},cn),r),i)},3699:function(t,e,n){n.d(e,{Rf:function(){return o},DM:function(){return a},en:function(){return s},jH:function(){return u},Cf:function(){return c},Db:function(){return h},EG:function(){return l},l4:function(){return f},JY:function(){return p}});var r=n(7392),i={};function o(){return(0,r.KV)()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(){var t=o(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(t){for(var e=t.toString(16);e.length<4;)e="0"+e;return e};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function s(t){if(!t)return{};var e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};var n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}}function u(t){if(t.message)return t.message;if(t.exception&&t.exception.values&&t.exception.values[0]){var e=t.exception.values[0];return e.type&&e.value?e.type+": "+e.value:e.type||e.value||t.event_id||"<unknown>"}return t.event_id||"<unknown>"}function c(t){var e=o();if(!("console"in e))return t();var n=e.console,r={};["debug","info","warn","error","log","assert"].forEach((function(t){t in e.console&&n[t].__sentry_original__&&(r[t]=n[t],n[t]=n[t].__sentry_original__)}));var i=t();return Object.keys(r).forEach((function(t){n[t]=r[t]})),i}function h(t,e,n){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].value=t.exception.values[0].value||e||"",t.exception.values[0].type=t.exception.values[0].type||n||"Error"}function l(t,e){void 0===e&&(e={});try{t.exception.values[0].mechanism=t.exception.values[0].mechanism||{},Object.keys(e).forEach((function(n){t.exception.values[0].mechanism[n]=e[n]}))}catch(t){}}function f(){try{return document.location.href}catch(t){return""}}function p(t,e){if(!e)return 6e4;var n=parseInt(""+e,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+e);return isNaN(r)?6e4:r-t}},7392:function(t,e,n){function r(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function i(t,e){return t.require(e)}n.d(e,{KV:function(){return r},l$:function(){return i}}),t=n.hmd(t)},7790:function(t,e,n){n.d(e,{yW:function(){return u},ph:function(){return c}});var r=n(3699),i=n(7392);t=n.hmd(t);var o={nowSeconds:function(){return Date.now()/1e3}},a=(0,i.KV)()?function(){try{return(0,i.l$)(t,"perf_hooks").performance}catch(t){return}}():function(){var t=(0,r.Rf)().performance;if(t&&t.now)return{now:function(){return t.now()},timeOrigin:Date.now()-t.now()}}(),s=void 0===a?o:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},u=o.nowSeconds.bind(o),c=s.nowSeconds.bind(s);!function(){var t=(0,r.Rf)().performance;if(t&&t.now){var e=36e5,n=t.now(),i=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+n-i):e,a=o<e,s=t.timing&&t.timing.navigationStart,u="number"==typeof s?Math.abs(s+n-i):e;(a||u<e)&&(o<=u&&t.timeOrigin)}}()},5532:function(t,e,n){n.r(e),n.d(e,{default:function(){return r.Z}});var r=n(2249),i="8.10.0";r.Z.registerVersion("firebase",i,"app"),r.Z.SDK_VERSION=i},284:function(t,e,n){n.r(e);var r=n(2249);(function(){var t,e="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},i=function(t){t=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g,t];for(var e=0;e<t.length;++e){var r=t[e];if(r&&r.Math==Math)return r}return globalThis}(this);function o(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function a(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:o(t)}}!function(t,n){if(n){var r=i;t=t.split(".");for(var o=0;o<t.length-1;o++){var a=t[o];a in r||(r[a]={}),r=r[a]}(n=n(o=r[t=t[t.length-1]]))!=o&&null!=n&&e(r,t,{configurable:!0,writable:!0,value:n})}}("Promise",(function(t){function e(t){this.b=0,this.c=void 0,this.a=[];var e=this.f();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function n(){this.a=null}function r(t){return t instanceof e?t:new e((function(e){e(t)}))}if(t)return t;n.prototype.b=function(t){if(null==this.a){this.a=[];var e=this;this.c((function(){e.g()}))}this.a.push(t)};var o=i.setTimeout;n.prototype.c=function(t){o(t,0)},n.prototype.g=function(){for(;this.a&&this.a.length;){var t=this.a;this.a=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(t){this.f(t)}}}this.a=null},n.prototype.f=function(t){this.c((function(){throw t}))},e.prototype.f=function(){function t(t){return function(r){n||(n=!0,t.call(e,r))}}var e=this,n=!1;return{resolve:t(this.m),reject:t(this.g)}},e.prototype.m=function(t){if(t===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.s(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.v(t):this.h(t)}},e.prototype.v=function(t){var e=void 0;try{e=t.then}catch(t){return void this.g(t)}"function"==typeof e?this.u(e,t):this.h(t)},e.prototype.g=function(t){this.i(2,t)},e.prototype.h=function(t){this.i(1,t)},e.prototype.i=function(t,e){if(0!=this.b)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.b);this.b=t,this.c=e,this.l()},e.prototype.l=function(){if(null!=this.a){for(var t=0;t<this.a.length;++t)s.b(this.a[t]);this.a=null}};var s=new n;return e.prototype.s=function(t){var e=this.f();t.Ra(e.resolve,e.reject)},e.prototype.u=function(t,e){var n=this.f();try{t.call(e,n.resolve,n.reject)}catch(t){n.reject(t)}},e.prototype.then=function(t,n){function r(t,e){return"function"==typeof t?function(e){try{i(t(e))}catch(t){o(t)}}:e}var i,o,a=new e((function(t,e){i=t,o=e}));return this.Ra(r(t,i),r(n,o)),a},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.Ra=function(t,e){function n(){switch(r.b){case 1:t(r.c);break;case 2:e(r.c);break;default:throw Error("Unexpected state: "+r.b)}}var r=this;null==this.a?s.b(n):this.a.push(n)},e.resolve=r,e.reject=function(t){return new e((function(e,n){n(t)}))},e.race=function(t){return new e((function(e,n){for(var i=a(t),o=i.next();!o.done;o=i.next())r(o.value).Ra(e,n)}))},e.all=function(t){var n=a(t),i=n.next();return i.done?r([]):new e((function(t,e){function o(e){return function(n){a[e]=n,0==--s&&t(a)}}var a=[],s=0;do{a.push(void 0),s++,r(i.value).Ra(o(a.length-1),e),i=n.next()}while(!i.done)}))},e}));var s=s||{},u=this||self,c=/^[\w+/_-]+[=]{0,2}$/,h=null;function l(t){return(t=t.querySelector&&t.querySelector("script[nonce]"))&&(t=t.nonce||t.getAttribute("nonce"))&&c.test(t)?t:""}function f(){}function p(t){var e=typeof t;return"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}function d(t){var e=p(t);return"array"==e||"object"==e&&"number"==typeof t.length}function v(t){return"function"==p(t)}function y(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function g(t){return Object.prototype.hasOwnProperty.call(t,m)&&t[m]||(t[m]=++b)}var m="closure_uid_"+(1e9*Math.random()>>>0),b=0;function w(t,e,n){return t.call.apply(t.bind,arguments)}function _(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function E(t,e,n){return(E=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?w:_).apply(null,arguments)}function I(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}var S=Date.now;function T(t,e){function n(){}n.prototype=e.prototype,t.bb=e.prototype,t.prototype=new n,t.prototype.constructor=t}function k(t){return t}function A(t,e,n){this.code=N+t,this.message=e||C[t]||"",this.a=n||null}function O(t){var e=t&&t.code;return e?new A(e.substring(N.length),t.message,t.serverResponse):null}T(A,Error),A.prototype.w=function(){var t={code:this.code,message:this.message};return this.a&&(t.serverResponse=this.a),t},A.prototype.toJSON=function(){return this.w()};var x,N="auth/",C={"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 always 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.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","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."},D={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 P(t){for(var e in D)if(D[e].id===t)return{firebaseEndpoint:(t=D[e]).Ua,secureTokenEndpoint:t.$a,identityPlatformEndpoint:t.Xa};return null}function R(t){if(!t)return!1;try{return!!t.$goog_Thenable}catch(t){return!1}}function L(t){if(Error.captureStackTrace)Error.captureStackTrace(this,L);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function j(t,e){for(var n="",r=(t=t.split("%s")).length-1,i=0;i<r;i++)n+=t[i]+(i<e.length?e[i]:"%s");L.call(this,n+t[r])}function M(t,e){throw new j("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function F(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function U(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function V(){this.b=this.a=null}x=P("__EID__")?"__EID__":void 0,T(L,Error),L.prototype.name="CustomError",T(j,L),j.prototype.name="AssertionError",F.prototype.get=function(){if(0<this.b){this.b--;var t=this.a;this.a=t.next,t.next=null}else t=this.c();return t};var q=new F((function(){return new G}),(function(t){t.reset()}));function B(){var t=we,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function G(){this.next=this.b=this.a=null}V.prototype.add=function(t,e){var n=q.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},G.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},G.prototype.reset=function(){this.next=this.b=this.a=null};var K=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"==typeof t)return"string"!=typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},H=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"==typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)},W=Array.prototype.filter?function(t,e){return Array.prototype.filter.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=[],i=0,o="string"==typeof t?t.split(""):t,a=0;a<n;a++)if(a in o){var s=o[a];e.call(void 0,s,a,t)&&(r[i++]=s)}return r},z=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=Array(n),i="string"==typeof t?t.split(""):t,o=0;o<n;o++)o in i&&(r[o]=e.call(void 0,i[o],o,t));return r},J=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,r="string"==typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t))return!0;return!1};function Q(t,e){return 0<=K(t,e)}function X(t,e){var n;return(n=0<=(e=K(t,e)))&&Array.prototype.splice.call(t,e,1),n}function Y(t,e){!function(t,e){for(var n="string"==typeof t?t.split(""):t,r=t.length-1;0<=r;--r)r in n&&e.call(void 0,n[r],r,t)}(t,(function(n,r){e.call(void 0,n,r,t)&&Array.prototype.splice.call(t,r,1).length}))}function Z(t){return Array.prototype.concat.apply([],arguments)}function $(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}var tt,et=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]},nt=/&/g,rt=/</g,it=/>/g,ot=/"/g,at=/'/g,st=/\x00/g,ut=/[\x00&<>"']/;function ct(t,e){return-1!=t.indexOf(e)}function ht(t,e){return t<e?-1:t>e?1:0}t:{var lt=u.navigator;if(lt){var ft=lt.userAgent;if(ft){tt=ft;break t}}tt=""}function pt(t){return ct(tt,t)}function dt(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function vt(t){for(var e in t)return!1;return!0}function yt(t){var e,n={};for(e in t)n[e]=t[e];return n}var gt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function mt(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<gt.length;o++)n=gt[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function bt(t,e){t:{try{var n=t&&t.ownerDocument,r=n&&(n.defaultView||n.parentWindow);if((r=r||u).Element&&r.Location){var i=r;break t}}catch(t){}i=null}if(i&&void 0!==i[e]&&(!t||!(t instanceof i[e])&&(t instanceof i.Location||t instanceof i.Element))){if(y(t))try{var o=t.constructor.displayName||t.constructor.name||Object.prototype.toString.call(t)}catch(t){o="<object could not be stringified>"}else o=void 0===t?"undefined":null===t?"null":typeof t;M("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function wt(t,e){this.a=t===St&&e||"",this.b=It}function _t(t){return t instanceof wt&&t.constructor===wt&&t.b===It?t.a:(M("expected object of type Const, got '"+t+"'"),"type_error:Const")}wt.prototype.ta=!0,wt.prototype.sa=function(){return this.a},wt.prototype.toString=function(){return"Const{"+this.a+"}"};var Et,It={},St={};function Tt(){if(void 0===Et){var t=null,e=u.trustedTypes;if(e&&e.createPolicy){try{t=e.createPolicy("goog#html",{createHTML:k,createScript:k,createScriptURL:k})}catch(t){u.console&&u.console.error(t.message)}Et=t}else Et=t}return Et}function kt(t,e){this.a=e===Ct?t:""}function At(t){return t instanceof kt&&t.constructor===kt?t.a:(M("expected object of type TrustedResourceUrl, got '"+t+"' of type "+p(t)),"type_error:TrustedResourceUrl")}function Ot(t,e){var n=_t(t);if(!Nt.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return function(t){var e=Tt();return new kt(t=e?e.createScriptURL(t):t,Ct)}(t=n.replace(xt,(function(t,r){if(!Object.prototype.hasOwnProperty.call(e,r))throw Error('Found marker, "'+r+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return(t=e[r])instanceof wt?_t(t):encodeURIComponent(String(t))})))}kt.prototype.ta=!0,kt.prototype.sa=function(){return this.a.toString()},kt.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var xt=/%{(\w+)}/g,Nt=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Ct={};function Dt(t,e){this.a=e===Ut?t:""}function Pt(t){return t instanceof Dt&&t.constructor===Dt?t.a:(M("expected object of type SafeUrl, got '"+t+"' of type "+p(t)),"type_error:SafeUrl")}Dt.prototype.ta=!0,Dt.prototype.sa=function(){return this.a.toString()},Dt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Rt=/^(?: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,Lt=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,jt=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function Mt(t){if(t instanceof Dt)return t;if(t="object"==typeof t&&t.ta?t.sa():String(t),jt.test(t))t=new Dt(t,Ut);else{var e=(t=(t=String(t)).replace(/(%0A|%0D)/g,"")).match(Lt);t=e&&Rt.test(e[1])?new Dt(t,Ut):null}return t}function Ft(t){return t instanceof Dt?t:(t="object"==typeof t&&t.ta?t.sa():String(t),jt.test(t)||(t="about:invalid#zClosurez"),new Dt(t,Ut))}var Ut={},Vt=new Dt("about:invalid#zClosurez",Ut);function qt(t,e,n){this.a=n===Bt?t:""}qt.prototype.ta=!0,qt.prototype.sa=function(){return this.a.toString()},qt.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Bt={};function Gt(t,e,n,r){return t=t instanceof Dt?t:Ft(t),e=e||u,n=n instanceof wt?_t(n):n||"",e.open(Pt(t),n,r,void 0)}function Kt(t,e){for(var n=t.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")}function Ht(t){return ut.test(t)&&(-1!=t.indexOf("&")&&(t=t.replace(nt,"&amp;")),-1!=t.indexOf("<")&&(t=t.replace(rt,"&lt;")),-1!=t.indexOf(">")&&(t=t.replace(it,"&gt;")),-1!=t.indexOf('"')&&(t=t.replace(ot,"&quot;")),-1!=t.indexOf("'")&&(t=t.replace(at,"&#39;")),-1!=t.indexOf("\0")&&(t=t.replace(st,"&#0;"))),t}function Wt(t){return Wt[" "](t),t}Wt[" "]=f;var zt,Jt,Qt=pt("Opera"),Xt=pt("Trident")||pt("MSIE"),Yt=pt("Edge"),Zt=Yt||Xt,$t=pt("Gecko")&&!(ct(tt.toLowerCase(),"webkit")&&!pt("Edge"))&&!(pt("Trident")||pt("MSIE"))&&!pt("Edge"),te=ct(tt.toLowerCase(),"webkit")&&!pt("Edge");function ee(){var t=u.document;return t?t.documentMode:void 0}t:{var ne="",re=(Jt=tt,$t?/rv:([^\);]+)(\)|;)/.exec(Jt):Yt?/Edge\/([\d\.]+)/.exec(Jt):Xt?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Jt):te?/WebKit\/(\S+)/.exec(Jt):Qt?/(?:Version)[ \/]?(\S+)/.exec(Jt):void 0);if(re&&(ne=re?re[1]:""),Xt){var ie=ee();if(null!=ie&&ie>parseFloat(ne)){zt=String(ie);break t}}zt=ne}var oe,ae={};function se(t){return function(t,e){var n=ae;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e()}(t,(function(){for(var e=0,n=et(String(zt)).split("."),r=et(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=ht(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||ht(0==a[2].length,0==s[2].length)||ht(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}u.document&&Xt?oe=ee()||parseInt(zt,10)||void 0:oe=void 0;var ue=oe;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch(Jt){}var ce=!Xt||9<=Number(ue);function he(t){var e=document;return"string"==typeof t?e.getElementById(t):t}function le(t,e){dt(e,(function(e,n){e&&"object"==typeof e&&e.ta&&(e=e.sa()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:de.hasOwnProperty(n)?t.setAttribute(de[n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e}))}var fe,pe,de={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 ve(t,e,n){function r(n){n&&e.appendChild("string"==typeof n?t.createTextNode(n):n)}for(var i=2;i<n.length;i++){var o=n[i];if(!d(o)||y(o)&&0<o.nodeType)r(o);else{t:{if(o&&"number"==typeof o.length){if(y(o)){var a="function"==typeof o.item||"string"==typeof o.item;break t}if(v(o)){a="function"==typeof o.item;break t}}a=!1}H(a?$(o):o,r)}}}function ye(t,e){return e=String(e),"application/xhtml+xml"===t.contentType&&(e=e.toLowerCase()),t.createElement(e)}function ge(t){u.setTimeout((function(){throw t}),0)}function me(t,e){pe||function(){if(u.Promise&&u.Promise.resolve){var t=u.Promise.resolve(void 0);pe=function(){t.then(_e)}}else pe=function(){var t=_e;!v(u.setImmediate)||u.Window&&u.Window.prototype&&!pt("Edge")&&u.Window.prototype.setImmediate==u.setImmediate?(fe||(fe=function(){var t=u.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!pt("Presto")&&(t=function(){var t=ye(document,"IFRAME");t.style.display="none",document.documentElement.appendChild(t);var e=t.contentWindow;(t=e.document).open(),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=E((function(t){"*"!=r&&t.origin!=r||t.data!=n||this.port1.onmessage()}),this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,r)}}}),void 0!==t&&!pt("Trident")&&!pt("MSIE")){var e=new t,n={},r=n;return e.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).Hb;n.Hb=null,t()}},function(t){r.next={Hb:t},r=r.next,e.port2.postMessage(0)}}return function(t){u.setTimeout(t,0)}}()),fe(t)):u.setImmediate(t)}}(),be||(pe(),be=!0),we.add(t,e)}var be=!1,we=new V;function _e(){for(var t;t=B();){try{t.a.call(t.b)}catch(t){ge(t)}U(q,t)}be=!1}function Ee(t,e){if(this.a=Ie,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=f)try{var n=this;t.call(e,(function(t){je(n,Se,t)}),(function(t){if(!(t instanceof Ge))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(t){}je(n,Te,t)}))}catch(t){je(this,Te,t)}}var Ie=0,Se=2,Te=3;function ke(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}ke.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var Ae=new F((function(){return new ke}),(function(t){t.reset()}));function Oe(t,e,n){var r=Ae.get();return r.g=t,r.b=e,r.f=n,r}function xe(t){if(t instanceof Ee)return t;var e=new Ee(f);return je(e,Se,t),e}function Ne(t){return new Ee((function(e,n){n(t)}))}function Ce(t,e,n){Me(t,e,n,null)||me(I(e,t))}function De(t){return new Ee((function(e){var n=t.length,r=[];if(n)for(var i=function(t,i,o){n--,r[t]=i?{Qb:!0,value:o}:{Qb:!1,reason:o},0==n&&e(r)},o=0;o<t.length;o++)Ce(t[o],I(i,o,!0),I(i,o,!1));else e(r)}))}function Pe(t,e){if(t.a==Ie)if(t.c){var n=t.c;if(n.b){for(var r=0,i=null,o=null,a=n.b;a&&(a.c||(r++,a.a==t&&(i=a),!(i&&1<r)));a=a.next)i||(o=a);i&&(n.a==Ie&&1==r?Pe(n,e):(o?((r=o).next==n.f&&(n.f=r),r.next=r.next.next):Ue(n),Ve(n,i,Te,e)))}t.c=null}else je(t,Te,e)}function Re(t,e){t.b||t.a!=Se&&t.a!=Te||Fe(t),t.f?t.f.next=e:t.b=e,t.f=e}function Le(t,e,n,r){var i=Oe(null,null,null);return i.a=new Ee((function(t,o){i.g=e?function(n){try{var i=e.call(r,n);t(i)}catch(t){o(t)}}:t,i.b=n?function(e){try{var i=n.call(r,e);void 0===i&&e instanceof Ge?o(e):t(i)}catch(t){o(t)}}:o})),i.a.c=t,Re(t,i),i.a}function je(t,e,n){t.a==Ie&&(t===n&&(e=Te,n=new TypeError("Promise cannot resolve to itself")),t.a=1,Me(n,t.$c,t.ad,t)||(t.i=n,t.a=e,t.c=null,Fe(t),e!=Te||n instanceof Ge||function(t,e){t.g=!0,me((function(){t.g&&Be.call(null,e)}))}(t,n)))}function Me(t,e,n,r){if(t instanceof Ee)return Re(t,Oe(e||f,n||null,r)),!0;if(R(t))return t.then(e,n,r),!0;if(y(t))try{var i=t.then;if(v(i))return function(t,e,n,r,i){function o(t){a||(a=!0,r.call(i,t))}var a=!1;try{e.call(t,(function(t){a||(a=!0,n.call(i,t))}),o)}catch(t){o(t)}}(t,i,e,n,r),!0}catch(t){return n.call(r,t),!0}return!1}function Fe(t){t.h||(t.h=!0,me(t.gc,t))}function Ue(t){var e=null;return t.b&&(e=t.b,t.b=e.next,e.next=null),t.b||(t.f=null),e}function Ve(t,e,n,r){if(n==Te&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,qe(e,n,r);else try{e.c?e.g.call(e.f):qe(e,n,r)}catch(t){Be.call(null,t)}U(Ae,e)}function qe(t,e,n){e==Se?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}Ee.prototype.then=function(t,e,n){return Le(this,v(t)?t:null,v(e)?e:null,n)},Ee.prototype.$goog_Thenable=!0,(t=Ee.prototype).oa=function(t,e){return(t=Oe(t,t,e)).c=!0,Re(this,t),this},t.o=function(t,e){return Le(this,null,t,e)},t.cancel=function(t){if(this.a==Ie){var e=new Ge(t);me((function(){Pe(this,e)}),this)}},t.$c=function(t){this.a=Ie,je(this,Se,t)},t.ad=function(t){this.a=Ie,je(this,Te,t)},t.gc=function(){for(var t;t=Ue(this);)Ve(this,t,this.a,this.i);this.h=!1};var Be=ge;function Ge(t){L.call(this,t)}function Ke(){0!=He&&(We[g(this)]=this),this.ya=this.ya,this.pa=this.pa}T(Ge,L),Ge.prototype.name="cancel";var He=0,We={};function ze(t){if(!t.ya&&(t.ya=!0,t.Da(),0!=He)){var e=g(t);if(0!=He&&t.pa&&0<t.pa.length)throw Error(t+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete We[e]}}Ke.prototype.ya=!1,Ke.prototype.Da=function(){if(this.pa)for(;this.pa.length;)this.pa.shift()()};var Je=Object.freeze||function(t){return t},Qe=!Xt||9<=Number(ue),Xe=Xt&&!se("9"),Ye=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{u.addEventListener("test",f,e),u.removeEventListener("test",f,e)}catch(t){}return t}();function Ze(t,e){this.type=t,this.b=this.target=e,this.defaultPrevented=!1}function $e(t,e){if(Ze.call(this,t?t.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,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=e,e=t.relatedTarget){if($t){t:{try{Wt(e.nodeName);var i=!0;break t}catch(t){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"==typeof t.pointerType?t.pointerType:tn[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}Ze.prototype.preventDefault=function(){this.defaultPrevented=!0},T($e,Ze);var tn=Je({2:"touch",3:"pen",4:"mouse"});$e.prototype.preventDefault=function(){$e.bb.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,Xe)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(t){}},$e.prototype.g=function(){return this.a};var en="closure_listenable_"+(1e6*Math.random()|0),nn=0;function rn(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.Wa=i,this.key=++nn,this.wa=this.Qa=!1}function on(t){t.wa=!0,t.listener=null,t.proxy=null,t.src=null,t.Wa=null}function an(t){this.src=t,this.a={},this.b=0}function sn(t,e){var n=e.type;n in t.a&&X(t.a[n],e)&&(on(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function un(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.wa&&o.listener==e&&o.capture==!!n&&o.Wa==r)return i}return-1}an.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var a=un(t,e,r,i);return-1<a?(e=t[a],n||(e.Qa=!1)):((e=new rn(e,this.src,o,!!r,i)).Qa=n,t.push(e)),e};var cn="closure_lm_"+(1e6*Math.random()|0),hn={};function ln(t,e,n,r,i){if(r&&r.once)pn(t,e,n,r,i);else if(Array.isArray(e))for(var o=0;o<e.length;o++)ln(t,e[o],n,r,i);else n=En(n),t&&t[en]?Sn(t,e,n,y(r)?!!r.capture:!!r,i):fn(t,e,n,!1,r,i)}function fn(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=y(i)?!!i.capture:!!i,s=wn(t);if(s||(t[cn]=s=new an(t)),!(n=s.add(e,n,r,a,o)).proxy)if(r=function(){var t=bn,e=Qe?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)Ye||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(yn(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}}function pn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)pn(t,e[o],n,r,i);else n=En(n),t&&t[en]?Tn(t,e,n,y(r)?!!r.capture:!!r,i):fn(t,e,n,!0,r,i)}function dn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)dn(t,e[o],n,r,i);else r=y(r)?!!r.capture:!!r,n=En(n),t&&t[en]?(t=t.v,(e=String(e).toString())in t.a&&-1<(n=un(o=t.a[e],n,r,i))&&(on(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--))):t&&(t=wn(t))&&(e=t.a[e.toString()],t=-1,e&&(t=un(e,n,r,i)),(n=-1<t?e[t]:null)&&vn(n))}function vn(t){if("number"!=typeof t&&t&&!t.wa){var e=t.src;if(e&&e[en])sn(e.v,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(yn(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=wn(e))?(sn(n,t),0==n.b&&(n.src=null,e[cn]=null)):on(t)}}}function yn(t){return t in hn?hn[t]:hn[t]="on"+t}function gn(t,e,n,r){var i=!0;if((t=wn(t))&&(e=t.a[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.wa&&(o=mn(o,r),i=i&&!1!==o)}return i}function mn(t,e){var n=t.listener,r=t.Wa||t.src;return t.Qa&&vn(t),n.call(r,e)}function bn(t,e){if(t.wa)return!0;if(!Qe){if(!e)t:{e=["window","event"];for(var n=u,r=0;r<e.length;r++)if(null==(n=n[e[r]])){e=null;break t}e=n}if(e=new $e(r=e,this),n=!0,!(0>r.keyCode||null!=r.returnValue)){t:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break t}catch(t){i=!0}(i||null==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=e.b;i;i=i.parentNode)r.push(i);for(t=t.type,i=r.length-1;0<=i;i--){e.b=r[i];var o=gn(r[i],t,!0,e);n=n&&o}for(i=0;i<r.length;i++)e.b=r[i],o=gn(r[i],t,!1,e),n=n&&o}return n}return mn(t,new $e(e,this))}function wn(t){return(t=t[cn])instanceof an?t:null}var _n="__closure_events_fn_"+(1e9*Math.random()>>>0);function En(t){return v(t)?t:(t[_n]||(t[_n]=function(e){return t.handleEvent(e)}),t[_n])}function In(){Ke.call(this),this.v=new an(this),this.bc=this,this.hb=null}function Sn(t,e,n,r,i){t.v.add(String(e),n,!1,r,i)}function Tn(t,e,n,r,i){t.v.add(String(e),n,!0,r,i)}function kn(t,e,n,r){if(!(e=t.v.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.wa&&a.capture==n){var s=a.listener,u=a.Wa||a.src;a.Qa&&sn(t.v,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}function An(t,e,n){if(v(t))n&&(t=E(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=E(t.handleEvent,t)}return 2147483647<Number(e)?-1:u.setTimeout(t,e||0)}function On(t){var e=null;return new Ee((function(n,r){-1==(e=An((function(){n(void 0)}),t))&&r(Error("Failed to schedule timer."))})).o((function(t){throw u.clearTimeout(e),t}))}function xn(t){if(t.X&&"function"==typeof t.X)return t.X();if("string"==typeof t)return t.split("");if(d(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}function Nn(t){if(t.Y&&"function"==typeof t.Y)return t.Y();if(!t.X||"function"!=typeof t.X){if(d(t)||"string"==typeof t){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}for(var r in e=[],n=0,t)e[n++]=r;return e}}function Cn(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof Cn)for(n=t.Y(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Dn(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];Pn(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)Pn(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function Pn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}T(In,Ke),In.prototype[en]=!0,In.prototype.addEventListener=function(t,e,n,r){ln(this,t,e,n,r)},In.prototype.removeEventListener=function(t,e,n,r){dn(this,t,e,n,r)},In.prototype.dispatchEvent=function(t){var e,n=this.hb;if(n)for(e=[];n;n=n.hb)e.push(n);n=this.bc;var r=t.type||t;if("string"==typeof t)t=new Ze(t,n);else if(t instanceof Ze)t.target=t.target||n;else{var i=t;mt(t=new Ze(r,n),i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var a=t.b=e[o];i=kn(a,r,!0,t)&&i}if(i=kn(a=t.b=n,r,!0,t)&&i,i=kn(a,r,!1,t)&&i,e)for(o=0;o<e.length;o++)i=kn(a=t.b=e[o],r,!1,t)&&i;return i},In.prototype.Da=function(){if(In.bb.Da.call(this),this.v){var t,e=this.v;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)on(n[r]);delete e.a[t],e.b--}}this.hb=null},(t=Cn.prototype).X=function(){Dn(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},t.Y=function(){return Dn(this),this.a.concat()},t.clear=function(){this.b={},this.c=this.a.length=0},t.get=function(t,e){return Pn(this.b,t)?this.b[t]:e},t.set=function(t,e){Pn(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},t.forEach=function(t,e){for(var n=this.Y(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Rn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Ln(t,e){var n;this.a=this.l=this.c="",this.g=null,this.h=this.f="",this.i=!1,t instanceof Ln?(this.i=void 0!==e?e:t.i,jn(this,t.c),this.l=t.l,this.a=t.a,Mn(this,t.g),this.f=t.f,Fn(this,rr(t.b)),this.h=t.h):t&&(n=String(t).match(Rn))?(this.i=!!e,jn(this,n[1]||"",!0),this.l=Gn(n[2]||""),this.a=Gn(n[3]||"",!0),Mn(this,n[4]),this.f=Gn(n[5]||"",!0),Fn(this,n[6]||"",!0),this.h=Gn(n[7]||"")):(this.i=!!e,this.b=new Yn(null,this.i))}function jn(t,e,n){t.c=n?Gn(e,!0):e,t.c&&(t.c=t.c.replace(/:$/,""))}function Mn(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.g=e}else t.g=null}function Fn(t,e,n){e instanceof Yn?(t.b=e,function(t,e){e&&!t.f&&(Zn(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(tr(this,e),nr(this,n,t))}),t)),t.f=e}(t.b,t.i)):(n||(e=Kn(e,Qn)),t.b=new Yn(e,t.i))}function Un(t,e,n){t.b.set(e,n)}function Vn(t,e){return t.b.get(e)}function qn(t){return t instanceof Ln?new Ln(t):new Ln(t,void 0)}function Bn(t,e,n,r){var i=new Ln(null,void 0);return t&&jn(i,t),e&&(i.a=e),n&&Mn(i,n),r&&(i.f=r),i}function Gn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Kn(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,Hn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Hn(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Ln.prototype.toString=function(){var t=[],e=this.c;e&&t.push(Kn(e,Wn,!0),":");var n=this.a;return(n||"file"==e)&&(t.push("//"),(e=this.l)&&t.push(Kn(e,Wn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.g)&&t.push(":",String(n))),(n=this.f)&&(this.a&&"/"!=n.charAt(0)&&t.push("/"),t.push(Kn(n,"/"==n.charAt(0)?Jn:zn,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.h)&&t.push("#",Kn(n,Xn)),t.join("")},Ln.prototype.resolve=function(t){var e=new Ln(this),n=!!t.c;n?jn(e,t.c):n=!!t.l,n?e.l=t.l:n=!!t.a,n?e.a=t.a:n=null!=t.g;var r=t.f;if(n)Mn(e,t.g);else if(n=!!t.f){if("/"!=r.charAt(0))if(this.a&&!this.f)r="/"+r;else{var i=e.f.lastIndexOf("/");-1!=i&&(r=e.f.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(ct(i,"./")||ct(i,"/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],a=0;a<i.length;){var s=i[a++];"."==s?r&&a==i.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),r&&a==i.length&&o.push("")):(o.push(s),r=!0)}r=o.join("/")}else r=i}return n?e.f=r:n=""!==t.b.toString(),n?Fn(e,rr(t.b)):n=!!t.h,n&&(e.h=t.h),e};var Wn=/[#\/\?@]/g,zn=/[#\?:]/g,Jn=/[#\?]/g,Qn=/[#\?@]/g,Xn=/#/g;function Yn(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function Zn(t){t.a||(t.a=new Cn,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function $n(t){var e=Nn(t);if(void 0===e)throw Error("Keys are undefined");var n=new Yn(null,void 0);t=xn(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];Array.isArray(o)?nr(n,i,o):n.add(i,o)}return n}function tr(t,e){Zn(t),e=ir(t,e),Pn(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,Pn((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Dn(t)))}function er(t,e){return Zn(t),e=ir(t,e),Pn(t.a.b,e)}function nr(t,e,n){tr(t,e),0<n.length&&(t.c=null,t.a.set(ir(t,e),$(n)),t.b+=n.length)}function rr(t){var e=new Yn;return e.c=t.c,t.a&&(e.a=new Cn(t.a),e.b=t.b),e}function ir(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function or(t){var e=[];return sr(new ar,t,e),e.join("")}function ar(){}function sr(t,e,n){if(null==e)n.push("null");else{if("object"==typeof e){if(Array.isArray(e)){var r=e;e=r.length,n.push("[");for(var i="",o=0;o<e;o++)n.push(i),sr(t,r[o],n),i=",";return void n.push("]")}if(!(e instanceof String||e instanceof Number||e instanceof Boolean)){for(r in n.push("{"),i="",e)Object.prototype.hasOwnProperty.call(e,r)&&"function"!=typeof(o=e[r])&&(n.push(i),hr(r,n),n.push(":"),sr(t,o,n),i=",");return void n.push("}")}e=e.valueOf()}switch(typeof e){case"string":hr(e,n);break;case"number":n.push(isFinite(e)&&!isNaN(e)?String(e):"null");break;case"boolean":n.push(String(e));break;case"function":n.push("null");break;default:throw Error("Unknown type: "+typeof e)}}}(t=Yn.prototype).add=function(t,e){Zn(this),this.c=null,t=ir(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},t.clear=function(){this.a=this.c=null,this.b=0},t.forEach=function(t,e){Zn(this),this.a.forEach((function(n,r){H(n,(function(n){t.call(e,n,r,this)}),this)}),this)},t.Y=function(){Zn(this);for(var t=this.a.X(),e=this.a.Y(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},t.X=function(t){Zn(this);var e=[];if("string"==typeof t)er(this,t)&&(e=Z(e,this.a.get(ir(this,t))));else{t=this.a.X();for(var n=0;n<t.length;n++)e=Z(e,t[n])}return e},t.set=function(t,e){return Zn(this),this.c=null,er(this,t=ir(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},t.get=function(t,e){return t&&0<(t=this.X(t)).length?String(t[0]):e},t.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.Y(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.X(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.c=t.join("&")};var ur={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},cr=/\uffff/.test("￿")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function hr(t,e){e.push('"',t.replace(cr,(function(t){var e=ur[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),ur[t]=e),e})),'"')}function lr(){var t=Cr();return Xt&&!!ue&&11==ue||/Edge\/\d+/.test(t)}function fr(){return u.window&&u.window.location.href||self&&self.location&&self.location.href||""}function pr(t,e){e=e||u.window;var n="about:blank";t&&(n=Pt(Mt(t)||Vt)),e.location.href=n}function dr(t,e){var n,r=[];for(n in t)n in e?typeof t[n]!=typeof e[n]?r.push(n):"object"==typeof t[n]&&null!=t[n]&&null!=e[n]?0<dr(t[n],e[n]).length&&r.push(n):t[n]!==e[n]&&r.push(n):r.push(n);for(n in e)n in t||r.push(n);return r}function vr(t){return!!((t=(t||Cr()).toLowerCase()).match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function yr(t){t=t||u.window;try{t.close()}catch(t){}}function gr(t,e,n){var r=Math.floor(1e9*Math.random()).toString();e=e||500,n=n||600;var i=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-e)/2;for(a in e={width:e,height:n,top:0<i?i:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=Cr().toLowerCase(),r&&(e.target=r,ct(n,"crios/")&&(e.target="_blank")),Or(Cr())==kr&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof Dt?n:Mt(void 0!==n.href?n.href:String(n))||Vt,n=t.target||n.target,i=[],t)switch(a){case"width":case"height":case"top":case"left":i.push(a+"="+t[a]);break;case"target":case"noopener":case"noreferrer":break;default:i.push(a+"="+(t[a]?1:0))}var a=i.join(",");if((pt("iPhone")&&!pt("iPod")&&!pt("iPad")||pt("iPad")||pt("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(bt(a=ye(document,"A"),"HTMLAnchorElement"),e=e instanceof Dt?e:Ft(e),a.href=Pt(e),a.setAttribute("target",n),t.noreferrer&&a.setAttribute("rel","noreferrer"),(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,r,1),a.dispatchEvent(t),a={}):t.noreferrer?(a=Gt("",r,n,a),t=Pt(e),a&&(Zt&&ct(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),a.opener=null,t='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+Ht(t)+'">',t=new qt(t=(r=Tt())?r.createHTML(t):t,null,Bt),r=a.document)&&(r.write(function(t){return t instanceof qt&&t.constructor===qt?t.a:(M("expected object of type SafeHtml, got '"+t+"' of type "+p(t)),"type_error:SafeHtml")}(t)),r.close())):(a=Gt(e,r,n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(t){}return a}var mr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,br=/^[^@]+@[^@]+$/;function wr(){var t=null;return new Ee((function(e){"complete"==u.document.readyState?e():(t=function(){e()},pn(window,"load",t))})).o((function(e){throw dn(window,"load",t),e}))}function _r(t){return t=t||Cr(),!("file:"!==jr()&&"ionic:"!==jr()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function Er(){var t=u.window;try{return!(!t||t==t.top)}catch(t){return!1}}function Ir(){return void 0!==u.WorkerGlobalScope&&"function"==typeof u.importScripts}function Sr(){return r.Z.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":r.Z.INTERNAL.hasOwnProperty("node")?"Node":Ir()?"Worker":"Browser"}function Tr(){var t=Sr();return"ReactNative"===t||"Node"===t}var kr="Firefox",Ar="Chrome";function Or(t){var e=t.toLowerCase();return ct(e,"opera/")||ct(e,"opr/")||ct(e,"opios/")?"Opera":ct(e,"iemobile")?"IEMobile":ct(e,"msie")||ct(e,"trident/")?"IE":ct(e,"edge/")?"Edge":ct(e,"firefox/")?kr:ct(e,"silk/")?"Silk":ct(e,"blackberry")?"Blackberry":ct(e,"webos")?"Webos":!ct(e,"safari/")||ct(e,"chrome/")||ct(e,"crios/")||ct(e,"android")?!ct(e,"chrome/")&&!ct(e,"crios/")||ct(e,"edge/")?ct(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":Ar:"Safari"}var xr={md:"FirebaseCore-web",od:"FirebaseUI-web"};function Nr(t,e){e=e||[];var n,r=[],i={};for(n in xr)i[xr[n]]=!0;for(n=0;n<e.length;n++)void 0!==i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),(e=r).length||(e=["FirebaseCore-web"]),"Browser"===(r=Sr())?r=Or(i=Cr()):"Worker"===r&&(r=Or(i=Cr())+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function Cr(){return u.navigator&&u.navigator.userAgent||""}function Dr(t,e){t=t.split("."),e=e||u;for(var n=0;n<t.length&&"object"==typeof e&&null!=e;n++)e=e[t[n]];return n!=t.length&&(e=void 0),e}function Pr(){try{var t=u.localStorage,e=qr();if(t)return t.setItem(e,"1"),t.removeItem(e),!lr()||!!u.indexedDB}catch(t){return Ir()&&!!u.indexedDB}return!1}function Rr(){return(Lr()||"chrome-extension:"===jr()||_r())&&!Tr()&&Pr()&&!Ir()}function Lr(){return"http:"===jr()||"https:"===jr()}function jr(){return u.location&&u.location.protocol||null}function Mr(t){return!vr(t=t||Cr())&&Or(t)!=kr}function Fr(t){return void 0===t?null:or(t)}function Ur(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&null!==t[e]&&void 0!==t[e]&&(n[e]=t[e]);return n}function Vr(t){if(null!==t)return JSON.parse(t)}function qr(t){return t||Math.floor(1e9*Math.random()).toString()}function Br(t){return"Safari"!=Or(t=t||Cr())&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function Gr(){var t=u.___jsl;if(t&&t.H)for(var e in t.H)if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=t.H[e].L.concat(),t.CP)for(var n=0;n<t.CP.length;n++)t.CP[n]=null}function Kr(t,e){if(t>e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=Cr(),e=Sr(),this.b=vr(t)||"ReactNative"===e}function Hr(){var t=u.document;return!t||void 0===t.visibilityState||"visible"==t.visibilityState}function Wr(t){try{var e=new Date(parseInt(t,10));if(!isNaN(e.getTime())&&!/[^0-9]/.test(t))return e.toUTCString()}catch(t){}return null}function zr(){return!(!Dr("fireauth.oauthhelper",u)&&!Dr("fireauth.iframe",u))}Kr.prototype.get=function(){var t=u.navigator;return!t||"boolean"!=typeof t.onLine||!Lr()&&"chrome-extension:"!==jr()&&void 0===t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var Jr,Qr={};function Xr(t){Qr[t]||(Qr[t]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t))}try{var Yr={};Object.defineProperty(Yr,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Yr,"abcd",{configurable:!0,enumerable:!0,value:2}),Jr=2==Yr.abcd}catch(Jt){Jr=!1}function Zr(t,e,n){Jr?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function $r(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&Zr(t,n,e[n])}function ti(t){var e={};return $r(e,t),e}function ei(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)Zr(e,n,ei(t[n]));return e}function ni(t){var e=t&&(t[si]?"phone":null);if(!(e&&t&&t[ai]))throw new A("internal-error","Internal assert: invalid MultiFactorInfo object");Zr(this,"uid",t[ai]),Zr(this,"displayName",t[ii]||null);var n=null;t[oi]&&(n=new Date(t[oi]).toUTCString()),Zr(this,"enrollmentTime",n),Zr(this,"factorId",e)}function ri(t){try{var e=new ui(t)}catch(t){e=null}return e}ni.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var ii="displayName",oi="enrolledAt",ai="mfaEnrollmentId",si="phoneInfo";function ui(t){ni.call(this,t),Zr(this,"phoneNumber",t[si])}function ci(t){var e={},n=t[pi],r=t[vi],i=t[yi];if(t=ri(t[di]),!i||i!=li&&i!=fi&&!n||i==fi&&!r||i==hi&&!t)throw Error("Invalid checkActionCode response!");i==fi?(e[mi]=n||null,e[wi]=n||null,e[gi]=r):(e[mi]=r||null,e[wi]=r||null,e[gi]=n||null),e[bi]=t||null,Zr(this,Ei,i),Zr(this,_i,ei(e))}T(ui,ni),ui.prototype.w=function(){var t=ui.bb.w.call(this);return t.phoneNumber=this.phoneNumber,t};var hi="REVERT_SECOND_FACTOR_ADDITION",li="EMAIL_SIGNIN",fi="VERIFY_AND_CHANGE_EMAIL",pi="email",di="mfaInfo",vi="newEmail",yi="requestType",gi="email",mi="fromEmail",bi="multiFactorInfo",wi="previousEmail",_i="data",Ei="operation";function Ii(t){var e=Vn(t=qn(t),Si)||null,n=Vn(t,Ti)||null,r=Vn(t,Oi)||null;if(r=r&&Ni[r]||null,!e||!n||!r)throw new A("argument-error",Si+", "+Ti+"and "+Oi+" are required in a valid action code URL.");$r(this,{apiKey:e,operation:r,code:n,continueUrl:Vn(t,ki)||null,languageCode:Vn(t,Ai)||null,tenantId:Vn(t,xi)||null})}var Si="apiKey",Ti="oobCode",ki="continueUrl",Ai="languageCode",Oi="mode",xi="tenantId",Ni={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:hi,signIn:li,verifyAndChangeEmail:fi,verifyEmail:"VERIFY_EMAIL"};function Ci(t){try{return new Ii(t)}catch(t){return null}}function Di(t){var e=t[Mi];if(void 0===e)throw new A("missing-continue-uri");if("string"!=typeof e||"string"==typeof e&&!e.length)throw new A("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[Pi];if(n&&"object"==typeof n){e=n[Vi];var r=n[Fi];if(n=n[Ui],"string"==typeof e&&e.length){if(this.a=e,void 0!==r&&"boolean"!=typeof r)throw new A("argument-error",Fi+" property must be a boolean when specified.");if(this.g=!!r,void 0!==n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new A("argument-error",Ui+" property must be a non empty string when specified.");this.b=n||null}else{if(void 0!==e)throw new A("argument-error",Vi+" property must be a non empty string when specified.");if(void 0!==r||void 0!==n)throw new A("missing-android-pkg-name")}}else if(void 0!==n)throw new A("argument-error",Pi+" property must be a non null object when specified.");if(this.f=null,(e=t[ji])&&"object"==typeof e){if("string"==typeof(e=e[qi])&&e.length)this.f=e;else if(void 0!==e)throw new A("argument-error",qi+" property must be a non empty string when specified.")}else if(void 0!==e)throw new A("argument-error",ji+" property must be a non null object when specified.");if(void 0!==(e=t[Li])&&"boolean"!=typeof e)throw new A("argument-error",Li+" property must be a boolean when specified.");if(this.c=!!e,void 0!==(t=t[Ri])&&("string"!=typeof t||"string"==typeof t&&!t.length))throw new A("argument-error",Ri+" property must be a non empty string when specified.");this.i=t||null}var Pi="android",Ri="dynamicLinkDomain",Li="handleCodeInApp",ji="iOS",Mi="url",Fi="installApp",Ui="minimumVersion",Vi="packageName",qi="bundleId";function Bi(t){var e={};for(var n in e.continueUrl=t.h,e.canHandleCodeInApp=t.c,(e.androidPackageName=t.a)&&(e.androidMinimumVersion=t.b,e.androidInstallApp=t.g),e.iOSBundleId=t.f,e.dynamicLinkDomain=t.i,e)null===e[n]&&delete e[n];return e}var Gi=null;function Ki(t){var e=Wi(t);if(!(e&&e.sub&&e.iss&&e.aud&&e.exp))throw Error("Invalid JWT");this.h=t,this.a=e.exp,this.i=e.sub,t=Date.now()/1e3,this.g=e.iat||(t>this.a?this.a:t),this.b=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.f=e.firebase&&e.firebase.tenant||null,this.c=!!e.is_anonymous||"anonymous"==this.b}function Hi(t){try{return new Ki(t)}catch(t){return null}}function Wi(t){if(!t)return null;if(3!=(t=t.split(".")).length)return null;for(var e=(4-(t=t[1]).length%4)%4,n=0;n<e;n++)t+=".";try{var r=function(t){var e=[];return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=Gi[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}!function(){if(!Gi){Gi={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++)for(var r=t.concat(e[n].split("")),i=0;i<r.length;i++){var o=r[i];void 0===Gi[o]&&(Gi[o]=i)}}}();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),s=n(64);if(64===s&&-1===i)break;e(i<<2|o>>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}(t,(function(t){e.push(t)})),e}(t);for(t=[],n=e=0;e<r.length;){var i=r[e++];if(128>i)t[n++]=String.fromCharCode(i);else if(191<i&&224>i){var o=r[e++];t[n++]=String.fromCharCode((31&i)<<6|63&o)}else if(239<i&&365>i){o=r[e++];var a=r[e++],s=((7&i)<<18|(63&o)<<12|(63&a)<<6|63&r[e++])-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else o=r[e++],a=r[e++],t[n++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}return JSON.parse(t.join(""))}catch(t){}return null}Ki.prototype.T=function(){return this.f},Ki.prototype.l=function(){return this.c},Ki.prototype.toString=function(){return this.h};var zi="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),Ji=["client_id","response_type","scope","redirect_uri","state"],Qi={nd:{Ja:"locale",va:700,ua:600,fa:"facebook.com",Ya:Ji},pd:{Ja:null,va:500,ua:750,fa:"github.com",Ya:Ji},qd:{Ja:"hl",va:515,ua:680,fa:"google.com",Ya:Ji},wd:{Ja:"lang",va:485,ua:705,fa:"twitter.com",Ya:zi},kd:{Ja:"locale",va:640,ua:600,fa:"apple.com",Ya:[]}};function Xi(t){for(var e in Qi)if(Qi[e].fa==t)return Qi[e];return null}function Yi(t){var e={};e["facebook.com"]=no,e["google.com"]=io,e["github.com"]=ro,e["twitter.com"]=oo;var n=t&&t[$i];try{if(n)return e[n]?new e[n](t):new eo(t);if(void 0!==t[Zi])return new to(t)}catch(t){}return null}var Zi="idToken",$i="providerId";function to(t){var e=t[$i];if(!e&&t[Zi]){var n=Hi(t[Zi]);n&&n.b&&(e=n.b)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,void 0!==t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),Zr(this,"providerId",e),Zr(this,"isNewUser",n)}function eo(t){to.call(this,t),Zr(this,"profile",ei((t=Vr(t.rawUserInfo||"{}"))||{}))}function no(t){if(eo.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function ro(t){if(eo.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Zr(this,"username",this.profile&&this.profile.login||null)}function io(t){if(eo.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function oo(t){if(eo.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Zr(this,"username",t.screenName||null)}function ao(t){var e=qn(t),n=Vn(e,"link"),r=Vn(qn(n),"link");return e=Vn(e,"deep_link_id"),Vn(qn(e),"link")||e||r||n||t}function so(t,e){if(!t&&!e)throw new A("internal-error","Internal assert: no raw session string available");if(t&&e)throw new A("internal-error","Internal assert: unable to determine the session type");this.a=t||null,this.b=e||null,this.type=this.a?uo:co}T(eo,to),T(no,eo),T(ro,eo),T(io,eo),T(oo,eo);var uo="enroll",co="signin";function ho(){}function lo(t,e){return t.then((function(t){if(t[$a]){var n=Hi(t[$a]);if(!n||e!=n.i)throw new A("user-mismatch");return t}throw new A("user-mismatch")})).o((function(t){throw t&&t.code&&t.code==N+"user-not-found"?new A("user-mismatch"):t}))}function fo(t,e){if(!e)throw new A("internal-error","failed to construct a credential");this.a=e,Zr(this,"providerId",t),Zr(this,"signInMethod",t)}function po(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function vo(t){if(t&&t.providerId&&t.signInMethod&&0==t.providerId.indexOf("saml.")&&t.pendingToken)try{return new fo(t.providerId,t.pendingToken)}catch(t){}return null}function yo(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&Zr(this,"idToken",e.idToken),e.accessToken&&Zr(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&Zr(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new A("internal-error","failed to construct a credential");Zr(this,"accessToken",e.oauthToken),Zr(this,"secret",e.oauthTokenSecret)}Zr(this,"providerId",t),Zr(this,"signInMethod",n)}function go(t){var e={};return t.idToken&&(e.id_token=t.idToken),t.accessToken&&(e.access_token=t.accessToken),t.secret&&(e.oauth_token_secret=t.secret),e.providerId=t.providerId,t.nonce&&!t.a&&(e.nonce=t.nonce),e={postBody:$n(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function mo(t){if(t&&t.providerId&&t.signInMethod){var e={idToken:t.oauthIdToken,accessToken:t.oauthTokenSecret?null:t.oauthAccessToken,oauthTokenSecret:t.oauthTokenSecret,oauthToken:t.oauthTokenSecret&&t.oauthAccessToken,nonce:t.nonce,pendingToken:t.pendingToken};try{return new yo(t.providerId,e,t.signInMethod)}catch(t){}}return null}function bo(t,e){this.Qc=e||[],$r(this,{providerId:t,isOAuthProvider:!0}),this.Jb={},this.qb=(Xi(t)||{}).Ja||null,this.pb=null}function wo(t){if("string"!=typeof t||0!=t.indexOf("saml."))throw new A("argument-error",'SAML provider IDs must be prefixed with "saml."');bo.call(this,t,[])}function _o(t){bo.call(this,t,Ji),this.a=[]}function Eo(){_o.call(this,"facebook.com")}function Io(t){if(!t)throw new A("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return y(t)&&(e=t.accessToken),(new Eo).credential({accessToken:e})}function So(){_o.call(this,"github.com")}function To(t){if(!t)throw new A("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return y(t)&&(e=t.accessToken),(new So).credential({accessToken:e})}function ko(){_o.call(this,"google.com"),this.Ca("profile")}function Ao(t,e){var n=t;return y(t)&&(n=t.idToken,e=t.accessToken),(new ko).credential({idToken:n,accessToken:e})}function Oo(){bo.call(this,"twitter.com",zi)}function xo(t,e){var n=t;if(y(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new A("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new yo("twitter.com",n,"twitter.com")}function No(t,e,n){this.a=t,this.f=e,Zr(this,"providerId","password"),Zr(this,"signInMethod",n===Do.EMAIL_LINK_SIGN_IN_METHOD?Do.EMAIL_LINK_SIGN_IN_METHOD:Do.EMAIL_PASSWORD_SIGN_IN_METHOD)}function Co(t){return t&&t.email&&t.password?new No(t.email,t.password,t.signInMethod):null}function Do(){$r(this,{providerId:"password",isOAuthProvider:!1})}function Po(t,e){if(!(e=Ro(e)))throw new A("argument-error","Invalid email link!");return new No(t,e.code,Do.EMAIL_LINK_SIGN_IN_METHOD)}function Ro(t){return(t=Ci(t=ao(t)))&&t.operation===li?t:null}function Lo(t){if(!(t.fb&&t.eb||t.La&&t.ea))throw new A("internal-error");this.a=t,Zr(this,"providerId","phone"),this.fa="phone",Zr(this,"signInMethod","phone")}function jo(t){if(t&&"phone"===t.providerId&&(t.verificationId&&t.verificationCode||t.temporaryProof&&t.phoneNumber)){var e={};return H(["verificationId","verificationCode","temporaryProof","phoneNumber"],(function(n){t[n]&&(e[n]=t[n])})),new Lo(e)}return null}function Mo(t){return t.a.La&&t.a.ea?{temporaryProof:t.a.La,phoneNumber:t.a.ea}:{sessionInfo:t.a.fb,code:t.a.eb}}function Fo(t){try{this.a=t||r.Z.auth()}catch(t){throw new A("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().")}$r(this,{providerId:"phone",isOAuthProvider:!1})}function Uo(t,e){if(!t)throw new A("missing-verification-id");if(!e)throw new A("missing-verification-code");return new Lo({fb:t,eb:e})}function Vo(t){if(t.temporaryProof&&t.phoneNumber)return new Lo({La:t.temporaryProof,ea:t.phoneNumber});var e=t&&t.providerId;if(!e||"password"===e)return null;var n=t&&t.oauthAccessToken,r=t&&t.oauthTokenSecret,i=t&&t.nonce,o=t&&t.oauthIdToken,a=t&&t.pendingToken;try{switch(e){case"google.com":return Ao(o,n);case"facebook.com":return Io(n);case"github.com":return To(n);case"twitter.com":return xo(n,r);default:return n||r||o||a?a?0==e.indexOf("saml.")?new fo(e,a):new yo(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new _o(e).credential({idToken:o,accessToken:n,rawNonce:i}):null}}catch(t){return null}}function qo(t){if(!t.isOAuthProvider)throw new A("invalid-oauth-provider")}function Bo(t,e,n,r,i,o,a){if(this.c=t,this.b=e||null,this.g=n||null,this.f=r||null,this.i=o||null,this.h=a||null,this.a=i||null,!this.g&&!this.a)throw new A("invalid-auth-event");if(this.g&&this.a)throw new A("invalid-auth-event");if(this.g&&!this.f)throw new A("invalid-auth-event")}function Go(t){return(t=t||{}).type?new Bo(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&O(t.error),t.postBody,t.tenantId):null}function Ko(){this.b=null,this.a=[]}so.prototype.Ha=function(){return this.a?xe(this.a):xe(this.b)},so.prototype.w=function(){return this.type==uo?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},ho.prototype.ka=function(){},ho.prototype.b=function(){},ho.prototype.c=function(){},ho.prototype.w=function(){},fo.prototype.ka=function(t){return ws(t,po(this))},fo.prototype.b=function(t,e){var n=po(this);return n.idToken=e,_s(t,n)},fo.prototype.c=function(t,e){return lo(Es(t,po(this)),e)},fo.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},yo.prototype.ka=function(t){return ws(t,go(this))},yo.prototype.b=function(t,e){var n=go(this);return n.idToken=e,_s(t,n)},yo.prototype.c=function(t,e){return lo(Es(t,go(this)),e)},yo.prototype.w=function(){var t={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(t.oauthIdToken=this.idToken),this.accessToken&&(t.oauthAccessToken=this.accessToken),this.secret&&(t.oauthTokenSecret=this.secret),this.nonce&&(t.nonce=this.nonce),this.a&&(t.pendingToken=this.a),t},bo.prototype.Ka=function(t){return this.Jb=yt(t),this},T(wo,bo),T(_o,bo),_o.prototype.Ca=function(t){return Q(this.a,t)||this.a.push(t),this},_o.prototype.Rb=function(){return $(this.a)},_o.prototype.credential=function(t,e){var n;if(!(n=y(t)?{idToken:t.idToken||null,accessToken:t.accessToken||null,nonce:t.rawNonce||null}:{idToken:t||null,accessToken:e||null}).idToken&&!n.accessToken)throw new A("argument-error","credential failed: must provide the ID token and/or the access token.");return new yo(this.providerId,n,this.providerId)},T(Eo,_o),Zr(Eo,"PROVIDER_ID","facebook.com"),Zr(Eo,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),T(So,_o),Zr(So,"PROVIDER_ID","github.com"),Zr(So,"GITHUB_SIGN_IN_METHOD","github.com"),T(ko,_o),Zr(ko,"PROVIDER_ID","google.com"),Zr(ko,"GOOGLE_SIGN_IN_METHOD","google.com"),T(Oo,bo),Zr(Oo,"PROVIDER_ID","twitter.com"),Zr(Oo,"TWITTER_SIGN_IN_METHOD","twitter.com"),No.prototype.ka=function(t){return this.signInMethod==Do.EMAIL_LINK_SIGN_IN_METHOD?ru(t,Ns,{email:this.a,oobCode:this.f}):ru(t,Zs,{email:this.a,password:this.f})},No.prototype.b=function(t,e){return this.signInMethod==Do.EMAIL_LINK_SIGN_IN_METHOD?ru(t,Cs,{idToken:e,email:this.a,oobCode:this.f}):ru(t,Ks,{idToken:e,email:this.a,password:this.f})},No.prototype.c=function(t,e){return lo(this.ka(t),e)},No.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},$r(Do,{PROVIDER_ID:"password"}),$r(Do,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),$r(Do,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Lo.prototype.ka=function(t){return t.gb(Mo(this))},Lo.prototype.b=function(t,e){var n=Mo(this);return n.idToken=e,ru(t,tu,n)},Lo.prototype.c=function(t,e){var n=Mo(this);return n.operation="REAUTH",lo(t=ru(t,eu,n),e)},Lo.prototype.w=function(){var t={providerId:"phone"};return this.a.fb&&(t.verificationId=this.a.fb),this.a.eb&&(t.verificationCode=this.a.eb),this.a.La&&(t.temporaryProof=this.a.La),this.a.ea&&(t.phoneNumber=this.a.ea),t},Fo.prototype.gb=function(t,e){var n=this.a.a;return xe(e.verify()).then((function(r){if("string"!=typeof r)throw new A("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(e.type){case"recaptcha":var i=y(t)?t.session:null,o=y(t)?t.phoneNumber:t;return(i&&i.type==uo?i.Ha().then((function(t){return function(t,e){return ru(t,Ws,e).then((function(t){return t.phoneSessionInfo.sessionInfo}))}(n,{idToken:t,phoneEnrollmentInfo:{phoneNumber:o,recaptchaToken:r}})})):i&&i.type==co?i.Ha().then((function(e){return function(t,e){return ru(t,zs,e).then((function(t){return t.phoneResponseInfo.sessionInfo}))}(n,{mfaPendingCredential:e,mfaEnrollmentId:t.multiFactorHint&&t.multiFactorHint.uid||t.multiFactorUid,phoneSignInInfo:{recaptchaToken:r}})})):function(t,e){return ru(t,Bs,e)}(n,{phoneNumber:o,recaptchaToken:r})).then((function(t){return"function"==typeof e.reset&&e.reset(),t}),(function(t){throw"function"==typeof e.reset&&e.reset(),t}));default:throw new A("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}}))},$r(Fo,{PROVIDER_ID:"phone"}),$r(Fo,{PHONE_SIGN_IN_METHOD:"phone"}),Bo.prototype.getUid=function(){var t=[];return t.push(this.c),this.b&&t.push(this.b),this.f&&t.push(this.f),this.h&&t.push(this.h),t.join("-")},Bo.prototype.T=function(){return this.h},Bo.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()}};var Ho,Wo=null;function zo(t){var e="unauthorized-domain",n=void 0,r=qn(t);t=r.a,"chrome-extension"==(r=r.c)?n=Kt("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.",t):"http"==r||"https"==r?n=Kt("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.",t):e="operation-not-supported-in-this-environment",A.call(this,e,n)}function Jo(t,e,n){A.call(this,t,n),(t=e||{}).Kb&&Zr(this,"email",t.Kb),t.ea&&Zr(this,"phoneNumber",t.ea),t.credential&&Zr(this,"credential",t.credential),t.$b&&Zr(this,"tenantId",t.$b)}function Qo(t){if(t.code){var e=t.code||"";0==e.indexOf(N)&&(e=e.substring(N.length));var n={credential:Vo(t),$b:t.tenantId};if(t.email)n.Kb=t.email;else if(t.phoneNumber)n.ea=t.phoneNumber;else if(!n.credential)return new A(e,t.message||void 0);return new Jo(e,n,t.message)}return null}function Xo(){}function Yo(t){return t.c||(t.c=t.b())}function Zo(){}function $o(t){if(!t.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<e.length;n++){var r=e[n];try{return new ActiveXObject(r),t.f=r}catch(t){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function ta(){}function ea(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseType=this.responseText=this.response="",this.status=-1,this.statusText="",this.a.onload=E(this.qc,this),this.a.onerror=E(this.Tb,this),this.a.onprogress=E(this.rc,this),this.a.ontimeout=E(this.vc,this)}function na(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function ra(t,e,n){this.reset(t,e,n,void 0,void 0)}function ia(t){this.f=t,this.b=this.c=this.a=null}function oa(t,e){this.name=t,this.value=e}T(zo,A),T(Jo,A),Jo.prototype.w=function(){var t={code:this.code,message:this.message};this.email&&(t.email=this.email),this.phoneNumber&&(t.phoneNumber=this.phoneNumber),this.tenantId&&(t.tenantId=this.tenantId);var e=this.credential&&this.credential.w();return e&&mt(t,e),t},Jo.prototype.toJSON=function(){return this.w()},Xo.prototype.c=null,T(Zo,Xo),Zo.prototype.a=function(){var t=$o(this);return t?new ActiveXObject(t):new XMLHttpRequest},Zo.prototype.b=function(){var t={};return $o(this)&&(t[0]=!0,t[1]=!0),t},Ho=new Zo,T(ta,Xo),ta.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new ea;throw Error("Unsupported browser")},ta.prototype.b=function(){return{}},(t=ea.prototype).open=function(t,e,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(t,e)},t.send=function(t){if(t){if("string"!=typeof t)throw Error("Only string data is supported");this.a.send(t)}else this.a.send()},t.abort=function(){this.a.abort()},t.setRequestHeader=function(){},t.getResponseHeader=function(t){return"content-type"==t.toLowerCase()?this.a.contentType:""},t.qc=function(){this.status=200,this.response=this.responseText=this.a.responseText,na(this,4)},t.Tb=function(){this.status=500,this.response=this.responseText="",na(this,4)},t.vc=function(){this.Tb()},t.rc=function(){this.status=200,na(this,1)},t.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},ra.prototype.a=null,ra.prototype.reset=function(t,e,n,r,i){r||S(),delete this.a},oa.prototype.toString=function(){return this.name};var aa=new oa("SEVERE",1e3),sa=new oa("WARNING",900),ua=new oa("CONFIG",700),ca=new oa("FINE",500);function ha(t){return t.c?t.c:t.a?ha(t.a):(M("Root logger has no level set."),null)}ia.prototype.log=function(t,e,n){if(t.value>=ha(this).value)for(v(e)&&(e=e()),t=new ra(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var la={},fa=null;function pa(t){var e;if(fa||(fa=new ia(""),la[""]=fa,fa.c=ua),!(e=la[t])){e=new ia(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=pa(t.substr(0,n))).b||(n.b={}),n.b[r]=e,e.a=n,la[t]=e}return e}function da(t,e){t&&t.log(ca,e,void 0)}function va(t){this.f=t}function ya(t){In.call(this),this.u=t,this.h=void 0,this.readyState=ga,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=pa("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}T(va,Xo),va.prototype.a=function(){return new ya(this.f)},va.prototype.b=function(t){return function(){return t}}({}),T(ya,In);var ga=0;function ma(t){t.c.read().then(t.pc.bind(t)).catch(t.Va.bind(t))}function ba(t){t.readyState=4,t.g=null,t.c=null,t.m=null,wa(t)}function wa(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function _a(t){In.call(this),this.headers=new Cn,this.D=t||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=Ea,this.u=this.S=!1}(t=ya.prototype).open=function(t,e){if(this.readyState!=ga)throw this.abort(),Error("Error reopening a connection");this.s=t,this.f=e,this.readyState=1,wa(this)},t.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.l,method:this.s,credentials:this.h,cache:void 0};t&&(e.body=t),this.u.fetch(new Request(this.f,e)).then(this.uc.bind(this),this.Va.bind(this))},t.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&&4!=this.readyState&&(this.a=!1,ba(this)),this.readyState=ga},t.uc=function(t){this.a&&(this.g=t,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=t.headers,this.readyState=2,wa(this)),this.a&&(this.readyState=3,wa(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.sc.bind(this),this.Va.bind(this)):void 0!==u.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.m=new TextDecoder,ma(this)):t.text().then(this.tc.bind(this),this.Va.bind(this)))))},t.pc=function(t){if(this.a){var e=this.m.decode(t.value?t.value:new Uint8Array(0),{stream:!t.done});e&&(this.response=this.responseText+=e),t.done?ba(this):wa(this),3==this.readyState&&ma(this)}},t.tc=function(t){this.a&&(this.response=this.responseText=t,ba(this))},t.sc=function(t){this.a&&(this.response=t,ba(this))},t.Va=function(t){var e=this.i;e&&e.log(sa,"Failed to fetch url "+this.f,t instanceof Error?t:Error(t)),this.a&&ba(this)},t.setRequestHeader=function(t,e){this.l.append(t,e)},t.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.i)&&t.log(sa,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")},t.getAllResponseHeaders=function(){if(!this.b){var t=this.i;return t&&t.log(sa,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),""}t=[];for(var e=this.b.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(ya.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(t){this.h=t?"include":"same-origin"}}),T(_a,In);var Ea="";_a.prototype.b=pa("goog.net.XhrIo");var Ia=/^https?$/i,Sa=["POST","PUT"];function Ta(t){return"content-type"==t.toLowerCase()}function ka(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,Aa(t),xa(t)}function Aa(t){t.J||(t.J=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function Oa(t){if(t.c&&void 0!==s)if(t.C[1]&&4==Ca(t)&&2==Da(t))da(t.b,Pa(t,"Local request error detected and ignored"));else if(t.i&&4==Ca(t))An(t.Wb,0,t);else if(t.dispatchEvent("readystatechange"),4==Ca(t)){da(t.b,Pa(t,"Request complete")),t.c=!1;try{var e,n=Da(t);t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.l).match(Rn)[1]||null;if(!o&&u.self&&u.self.location){var a=u.self.location.protocol;o=a.substr(0,a.length-1)}i=!Ia.test(o?o.toLowerCase():"")}e=i}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var c=2<Ca(t)?t.a.statusText:""}catch(e){da(t.b,"Can not get status: "+e.message),c=""}t.h=c+" ["+Da(t)+"]",Aa(t)}}finally{xa(t)}}}function xa(t,e){if(t.a){Na(t);var n=t.a,r=t.C[0]?f:null;t.a=null,t.C=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(e){(t=t.b)&&t.log(aa,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}}function Na(t){t.a&&t.u&&(t.a.ontimeout=null),t.s&&(u.clearTimeout(t.s),t.s=null)}function Ca(t){return t.a?t.a.readyState:0}function Da(t){try{return 2<Ca(t)?t.a.status:-1}catch(t){return-1}}function Pa(t,e){return e+" ["+t.P+" "+t.l+" "+Da(t)+"]"}function Ra(t){var e=Ha;this.g=[],this.u=e,this.s=t||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}function La(t,e,n){t.a=!0,t.c=n,t.f=!e,Ua(t)}function ja(t){if(t.a){if(!t.v)throw new Va(t);t.v=!1}}function Ma(t,e,n,r){t.g.push([e,n,r]),t.a&&Ua(t)}function Fa(t){return J(t.g,(function(t){return v(t[1])}))}function Ua(t){if(t.h&&t.a&&Fa(t)){var e=t.h,n=Ga[e];n&&(u.clearTimeout(n.a),delete Ga[e]),t.h=0}t.b&&(t.b.l--,delete t.b),e=t.c;for(var r=n=!1;t.g.length&&!t.i;){var i=t.g.shift(),o=i[0],a=i[1];if(i=i[2],o=t.f?a:o)try{var s=o.call(i||t.s,e);void 0!==s&&(t.f=t.f&&(s==e||s instanceof Error),t.c=e=s),(R(e)||"function"==typeof u.Promise&&e instanceof u.Promise)&&(r=!0,t.i=!0)}catch(r){e=r,t.f=!0,Fa(t)||(n=!0)}}t.c=e,r&&(s=E(t.m,t,!0),r=E(t.m,t,!1),e instanceof Ra?(Ma(e,s,r),e.C=!0):e.then(s,r)),n&&(e=new Ba(e),Ga[e.a]=e,t.h=e.a)}function Va(){L.call(this)}function qa(){L.call(this)}function Ba(t){this.a=u.setTimeout(E(this.c,this),0),this.b=t}(t=_a.prototype).Ma=function(){void 0!==s&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",da(this.b,Pa(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},t.abort=function(){this.a&&this.c&&(da(this.b,Pa(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),xa(this))},t.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),xa(this,!0)),_a.bb.Da.call(this)},t.Wb=function(){this.ya||(this.N||this.i||this.f?Oa(this):this.Jc())},t.Jc=function(){Oa(this)},t.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case Ea:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var t=this.b;return t&&t.log(aa,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(t){return da(this.b,"Can not get response: "+t.message),null}},Ra.prototype.cancel=function(t){if(this.a)this.c instanceof Ra&&this.c.cancel();else{if(this.b){var e=this.b;delete this.b,t?e.cancel(t):(e.l--,0>=e.l&&e.cancel())}this.u?this.u.call(this.s,this):this.v=!0,this.a||(t=new qa(this),ja(this),La(this,!1,t))}},Ra.prototype.m=function(t,e){this.i=!1,La(this,t,e)},Ra.prototype.then=function(t,e,n){var r,i,o=new Ee((function(t,e){r=t,i=e}));return Ma(this,r,(function(t){t instanceof qa?o.cancel():i(t)})),o.then(t,e,n)},Ra.prototype.$goog_Thenable=!0,T(Va,L),Va.prototype.message="Deferred has already fired",Va.prototype.name="AlreadyCalledError",T(qa,L),qa.prototype.message="Deferred was canceled",qa.prototype.name="CanceledError",Ba.prototype.c=function(){throw delete Ga[this.a],this.b};var Ga={};function Ka(t){var e={},n=e.document||document,r=At(t).toString(),i=ye(document,"SCRIPT"),o={Xb:i,Ma:void 0},a=new Ra(o),s=null,c=null!=e.timeout?e.timeout:5e3;return 0<c&&(s=window.setTimeout((function(){Wa(i,!0);var t=new Qa(Ja,"Timeout reached for loading script "+r);ja(a),La(a,!1,t)}),c),o.Ma=s),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Wa(i,e.xd||!1,s),ja(a),La(a,!0,null))},i.onerror=function(){Wa(i,!0,s);var t=new Qa(za,"Error while loading script "+r);ja(a),La(a,!1,t)},mt(o=e.attributes||{},{type:"text/javascript",charset:"UTF-8"}),le(i,o),function(t,e){bt(t,"HTMLScriptElement"),t.src=At(e),(e=t.ownerDocument&&t.ownerDocument.defaultView)&&e!=u?e=l(e.document):(null===h&&(h=l(u.document)),e=h),e&&t.setAttribute("nonce",e)}(i,t),function(t){var e;return(e=(t||document).getElementsByTagName("HEAD"))&&0!=e.length?e[0]:t.documentElement}(n).appendChild(i),a}function Ha(){if(this&&this.Xb){var t=this.Xb;t&&"SCRIPT"==t.tagName&&Wa(t,!0,this.Ma)}}function Wa(t,e,n){null!=n&&u.clearTimeout(n),t.onload=f,t.onerror=f,t.onreadystatechange=f,e&&window.setTimeout((function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),0)}var za=0,Ja=1;function Qa(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),L.call(this,n),this.code=t}function Xa(t){this.f=t}function Ya(t,e,n){if(this.c=t,t=e||{},this.l=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=t.secureTokenTimeout||ts,this.g=yt(t.secureTokenHeaders||es),this.h=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.i=t.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.v=t.firebaseTimeout||ns,this.a=yt(t.firebaseHeaders||rs),n&&(this.a["X-Client-Version"]=n,this.g["X-Client-Version"]=n),n="Node"==Sr(),!(n=u.XMLHttpRequest||n&&r.Z.INTERNAL.node&&r.Z.INTERNAL.node.XMLHttpRequest)&&!Ir())throw new A("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,Ir()?this.f=new va(self):Tr()?this.f=new Xa(n):this.f=new ta,this.b=null}T(Qa,L),T(Xa,Xo),Xa.prototype.a=function(){return new this.f},Xa.prototype.b=function(){return{}};var Za,$a="idToken",ts=new Kr(3e4,6e4),es={"Content-Type":"application/x-www-form-urlencoded"},ns=new Kr(3e4,6e4),rs={"Content-Type":"application/json"};function is(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function os(t,e){e&&(t.l=as("https://securetoken.googleapis.com/v1/token",e),t.h=as("https://www.googleapis.com/identitytoolkit/v3/relyingparty/",e),t.i=as("https://identitytoolkit.googleapis.com/v2/",e))}function as(t,e){return t=qn(t),e=qn(e.url),t.f=t.a+t.f,jn(t,e.c),t.a=e.a,Mn(t,e.g),t.toString()}function ss(t,e){e?(t.a["X-Client-Version"]=e,t.g["X-Client-Version"]=e):(delete t.a["X-Client-Version"],delete t.g["X-Client-Version"])}function us(t,e,n,r,i,o,a){(function(){var t=Cr();return!((t=Or(t)!=Ar?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null)&&30>t||Xt&&ue&&!(9<ue))})()||Ir()?t=E(t.u,t):(Za||(Za=new Ee((function(t,e){!function(t,e){((window.gapi||{}).client||{}).request?t():(u[hs]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))},function(t,e){Ma(t,null,e,void 0)}(Ka(Ot(cs,{onload:hs})),(function(){e(Error("CORS_UNSUPPORTED"))})))}(t,e)}))),t=E(t.s,t)),t(e,n,r,i,o,a)}Ya.prototype.T=function(){return this.b},Ya.prototype.u=function(t,e,n,r,i,o){if(Ir()&&(void 0===u.fetch||void 0===u.Headers||void 0===u.Request))throw new A("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var a=new _a(this.f);if(o){a.g=Math.max(0,o);var s=setTimeout((function(){a.dispatchEvent("timeout")}),o)}Sn(a,"complete",(function(){s&&clearTimeout(s);var t=null;try{t=JSON.parse(function(t){try{return t.a?t.a.responseText:""}catch(e){return da(t.b,"Can not get responseText: "+e.message),""}}(this))||null}catch(e){t=null}e&&e(t)})),Tn(a,"ready",(function(){s&&clearTimeout(s),ze(this)})),Tn(a,"timeout",(function(){s&&clearTimeout(s),ze(this),e&&e(null)})),function(t,e,n,r,i){if(t.a)throw Error("[goog.net.XhrIo] Object is active with another request="+t.l+"; newUri="+e);n=n?n.toUpperCase():"GET",t.l=e,t.h="",t.P=n,t.J=!1,t.c=!0,t.a=t.D?t.D.a():Ho.a(),t.C=t.D?Yo(t.D):Yo(Ho),t.a.onreadystatechange=E(t.Wb,t);try{da(t.b,Pa(t,"Opening Xhr")),t.N=!0,t.a.open(n,String(e),!0),t.N=!1}catch(e){return da(t.b,Pa(t,"Error opening Xhr: "+e.message)),void ka(t,e)}e=r||"";var o=new Cn(t.headers);i&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(d(t)||"string"==typeof t)H(t,e,void 0);else for(var n=Nn(t),r=xn(t),i=r.length,o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}(i,(function(t,e){o.set(e,t)})),i=function(t){t:{for(var e=Ta,n=t.length,r="string"==typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"==typeof t?t.charAt(e):t[e]}(o.Y()),r=u.FormData&&e instanceof u.FormData,!Q(Sa,n)||i||r||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach((function(t,e){this.a.setRequestHeader(e,t)}),t),t.m&&(t.a.responseType=t.m),"withCredentials"in t.a&&t.a.withCredentials!==t.S&&(t.a.withCredentials=t.S);try{Na(t),0<t.g&&(t.u=function(t){return Xt&&se(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(t.a),da(t.b,Pa(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.u)),t.u?(t.a.timeout=t.g,t.a.ontimeout=E(t.Ma,t)):t.s=An(t.Ma,t.g,t)),da(t.b,Pa(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(e){da(t.b,Pa(t,"Send error: "+e.message)),ka(t,e)}}(a,t,n,r,i)};var cs=new wt(St,"https://apis.google.com/js/client.js?onload=%{onload}"),hs="__fcb"+Math.floor(1e6*Math.random()).toString();function ls(t){if("string"!=typeof(t=t.email)||!br.test(t))throw new A("invalid-email")}function fs(t){"email"in t&&ls(t)}function ps(t){if(!t[$a]){if(t.mfaPendingCredential)throw new A("multi-factor-auth-required",null,yt(t));throw new A("internal-error")}}function ds(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new A("internal-error")}else{if(!t.sessionInfo)throw new A("missing-verification-id");if(!t.code)throw new A("missing-verification-code")}}Ya.prototype.s=function(t,e,n,r,i){var o=this;Za.then((function(){window.gapi.client.setApiKey(o.c);var a=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:t,method:n,body:r,headers:i,authType:"none",callback:function(t){window.gapi.auth.setToken(a),e&&e(t)}})})).o((function(t){e&&e({error:{message:t&&t.message||"CORS_UNSUPPORTED"}})}))},Ya.prototype.Ab=function(){return ru(this,Hs,{})},Ya.prototype.Cb=function(t,e){return ru(this,Gs,{idToken:t,email:e})},Ya.prototype.Db=function(t,e){return ru(this,Ks,{idToken:t,password:e})};var vs={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function ys(t){if(!t.phoneVerificationInfo)throw new A("internal-error");if(!t.phoneVerificationInfo.sessionInfo)throw new A("missing-verification-id");if(!t.phoneVerificationInfo.code)throw new A("missing-verification-code")}function gs(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new A("internal-error")}function ms(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&er(t=new Yn(t.postBody),"nonce")&&(e.nonce=t.get("nonce"))),e}function bs(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=Qo(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=Qo(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=Qo(t)):t.errorMessage&&(e=iu(t.errorMessage)),e)throw e;ps(t)}function ws(t,e){return e.returnIdpCredential=!0,ru(t,Js,e)}function _s(t,e){return e.returnIdpCredential=!0,ru(t,Xs,e)}function Es(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,ru(t,Qs,e)}function Is(t){if(!t.oobCode)throw new A("invalid-action-code")}(t=Ya.prototype).Eb=function(t,e){var n={idToken:t},r=[];return dt(vs,(function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)})),r.length&&(n.deleteAttribute=r),ru(this,Gs,n)},t.wb=function(t,e){return mt(t={requestType:"PASSWORD_RESET",email:t},e),ru(this,Fs,t)},t.xb=function(t,e){return mt(t={requestType:"EMAIL_SIGNIN",email:t},e),ru(this,Ls,t)},t.vb=function(t,e){return mt(t={requestType:"VERIFY_EMAIL",idToken:t},e),ru(this,js,t)},t.Fb=function(t,e,n){return mt(t={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:t,newEmail:e},n),ru(this,Ms,t)},t.gb=function(t){return ru(this,$s,t)},t.ob=function(t,e){return ru(this,qs,{oobCode:t,newPassword:e})},t.Sa=function(t){return ru(this,Ts,{oobCode:t})},t.kb=function(t){return ru(this,Ss,{oobCode:t})};var Ss={endpoint:"setAccountInfo",A:Is,Z:"email",B:!0},Ts={endpoint:"resetPassword",A:Is,G:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e&&"VERIFY_AND_CHANGE_EMAIL"!=e)throw new A("internal-error")},B:!0},ks={endpoint:"signupNewUser",A:function(t){if(ls(t),!t.password)throw new A("weak-password")},G:ps,V:!0,B:!0},As={endpoint:"createAuthUri",B:!0},Os={endpoint:"deleteAccount",O:["idToken"]},xs={endpoint:"setAccountInfo",O:["idToken","deleteProvider"],A:function(t){if(!Array.isArray(t.deleteProvider))throw new A("internal-error")}},Ns={endpoint:"emailLinkSignin",O:["email","oobCode"],A:ls,G:ps,V:!0,B:!0},Cs={endpoint:"emailLinkSignin",O:["idToken","email","oobCode"],A:ls,G:ps,V:!0},Ds={endpoint:"accounts/mfaEnrollment:finalize",O:["idToken","phoneVerificationInfo"],A:ys,G:ps,B:!0,Na:!0},Ps={endpoint:"accounts/mfaSignIn:finalize",O:["mfaPendingCredential","phoneVerificationInfo"],A:ys,G:ps,B:!0,Na:!0},Rs={endpoint:"getAccountInfo"},Ls={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new A("internal-error");ls(t)},Z:"email",B:!0},js={endpoint:"getOobConfirmationCode",O:["idToken","requestType"],A:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new A("internal-error")},Z:"email",B:!0},Ms={endpoint:"getOobConfirmationCode",O:["idToken","newEmail","requestType"],A:function(t){if("VERIFY_AND_CHANGE_EMAIL"!=t.requestType)throw new A("internal-error")},Z:"email",B:!0},Fs={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(t){if("PASSWORD_RESET"!=t.requestType)throw new A("internal-error");ls(t)},Z:"email",B:!0},Us={mb:!0,endpoint:"getProjectConfig",Vb:"GET"},Vs={mb:!0,endpoint:"getRecaptchaParam",Vb:"GET",G:function(t){if(!t.recaptchaSiteKey)throw new A("internal-error")}},qs={endpoint:"resetPassword",A:Is,Z:"email",B:!0},Bs={endpoint:"sendVerificationCode",O:["phoneNumber","recaptchaToken"],Z:"sessionInfo",B:!0},Gs={endpoint:"setAccountInfo",O:["idToken"],A:fs,V:!0},Ks={endpoint:"setAccountInfo",O:["idToken"],A:function(t){if(fs(t),!t.password)throw new A("weak-password")},G:ps,V:!0},Hs={endpoint:"signupNewUser",G:ps,V:!0,B:!0},Ws={endpoint:"accounts/mfaEnrollment:start",O:["idToken","phoneEnrollmentInfo"],A:function(t){if(!t.phoneEnrollmentInfo)throw new A("internal-error");if(!t.phoneEnrollmentInfo.phoneNumber)throw new A("missing-phone-number");if(!t.phoneEnrollmentInfo.recaptchaToken)throw new A("missing-app-credential")},G:function(t){if(!t.phoneSessionInfo||!t.phoneSessionInfo.sessionInfo)throw new A("internal-error")},B:!0,Na:!0},zs={endpoint:"accounts/mfaSignIn:start",O:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(t){if(!t.phoneSignInInfo||!t.phoneSignInInfo.recaptchaToken)throw new A("missing-app-credential")},G:function(t){if(!t.phoneResponseInfo||!t.phoneResponseInfo.sessionInfo)throw new A("internal-error")},B:!0,Na:!0},Js={endpoint:"verifyAssertion",A:gs,Za:ms,G:bs,V:!0,B:!0},Qs={endpoint:"verifyAssertion",A:gs,Za:ms,G:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new A("user-not-found");if(t.errorMessage)throw iu(t.errorMessage);ps(t)},V:!0,B:!0},Xs={endpoint:"verifyAssertion",A:function(t){if(gs(t),!t.idToken)throw new A("internal-error")},Za:ms,G:bs,V:!0},Ys={endpoint:"verifyCustomToken",A:function(t){if(!t.token)throw new A("invalid-custom-token")},G:ps,V:!0,B:!0},Zs={endpoint:"verifyPassword",A:function(t){if(ls(t),!t.password)throw new A("wrong-password")},G:ps,V:!0,B:!0},$s={endpoint:"verifyPhoneNumber",A:ds,G:ps,B:!0},tu={endpoint:"verifyPhoneNumber",A:function(t){if(!t.idToken)throw new A("internal-error");ds(t)},G:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",Qo(t);ps(t)}},eu={Ib:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:ds,G:ps,B:!0},nu={endpoint:"accounts/mfaEnrollment:withdraw",O:["idToken","mfaEnrollmentId"],G:function(t){if(!!t[$a]^!!t.refreshToken)throw new A("internal-error")},B:!0,Na:!0};function ru(t,e,n){if(!function(t,e){if(!e||!e.length)return!0;if(!t)return!1;for(var n=0;n<e.length;n++){var r=t[e[n]];if(null==r||""===r)return!1}return!0}(n,e.O))return Ne(new A("internal-error"));var r,i=!!e.Na,o=e.Vb||"POST";return xe(n).then(e.A).then((function(){return e.V&&(n.returnSecureToken=!0),e.B&&t.b&&void 0===n.tenantId&&(n.tenantId=t.b),function(t,e,n,r,i,o,a){var s=qn(e+n);Un(s,"key",t.c),a&&Un(s,"cb",Date.now().toString());var u="GET"==r;if(u)for(var c in i)i.hasOwnProperty(c)&&Un(s,c,i[c]);return new Ee((function(e,n){us(t,s.toString(),(function(t){t?t.error?n(ou(t,o||{})):e(t):n(new A("network-request-failed"))}),r,u?void 0:or(Ur(i)),t.a,t.v.get())}))}(t,i?t.i:t.h,e.endpoint,o,n,e.Ib,e.mb||!1)})).then((function(t){return r=t,e.Za?e.Za(n,r):r})).then(e.G).then((function(){if(!e.Z)return r;if(!(e.Z in r))throw new A("internal-error");return r[e.Z]}))}function iu(t){return ou({error:{errors:[{message:t}],code:400,message:t}})}function ou(t,e){var n=(t.error&&t.error.errors&&t.error.errors[0]||{}).reason||"",r={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=r[n]?new A(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",mt(r={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_NONCE:"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"},e||{}),e=(e=n.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1<e.length?e[1]:void 0,r)if(0===n.indexOf(i))return new A(r[i],e);return!e&&t&&(e=Fr(t)),new A("internal-error",e)}function au(t){this.b=t,this.a=null,this.sb=function(t){return(hu||(hu=new Ee((function(t,e){function n(){Gr(),Dr("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){Gr(),e(Error("Network Error"))},timeout:uu.get()})}if(Dr("gapi.iframes.Iframe"))t();else if(Dr("gapi.load"))n();else{var r="__iframefcb"+Math.floor(1e6*Math.random()).toString();u[r]=function(){Dr("gapi.load")?n():e(Error("Network Error"))},xe(Ka(r=Ot(su,{onload:r}))).o((function(){e(Error("Network Error"))}))}})).o((function(t){throw hu=null,t})))).then((function(){return new Ee((function(e,n){Dr("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:Dr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},(function(r){function i(){clearTimeout(o),e()}t.a=r,t.a.restyle({setHideOnLeave:!1});var o=setTimeout((function(){n(Error("Network Error"))}),cu.get());r.ping(i).then(i,(function(){n(Error("Network Error"))}))}))}))}))}(this)}var su=new wt(St,"https://apis.google.com/js/api.js?onload=%{onload}"),uu=new Kr(3e4,6e4),cu=new Kr(5e3,15e3),hu=null;function lu(t,e,n,r){this.l=t,this.h=e,this.i=n,this.g=r,this.f=null,t=this.g?Bn((t=qn(this.g.url)).c,t.a,t.g,"/emulator/auth/iframe"):Bn("https",this.l,null,"/__/auth/iframe"),this.a=t,Un(this.a,"apiKey",this.h),Un(this.a,"appName",this.i),this.b=null,this.c=[]}function fu(t,e,n,r,i,o){this.u=t,this.s=e,this.c=n,this.m=r,this.v=o,this.i=this.g=this.l=null,this.a=i,this.h=this.f=null}function pu(t){try{return r.Z.app(t).auth().Ga()}catch(t){return[]}}function du(t,e,n,r,i,o){this.s=t,this.g=e,this.b=n,this.f=o,this.c=r||null,this.i=i||null,this.l=this.u=this.C=null,this.h=[],this.m=this.a=null}function vu(t){var e=fr();return function(t){return ru(t,Us,{}).then((function(t){return t.authorizedDomains||[]}))}(t).then((function(t){t:{var n=qn(e),r=n.c;n=n.a;for(var i=0;i<t.length;i++){var o=t[i],a=n,s=r;if(0==o.indexOf("chrome-extension://")?a=qn(o).a==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:mr.test(o)?a=a==o:(o=o.split(".").join("\\."),a=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)),a){t=!0;break t}}t=!1}if(!t)throw new zo(fr())}))}function yu(t){return t.m||(t.m=wr().then((function(){if(!t.u){var e=t.c,n=t.i,r=pu(t.b),i=new lu(t.s,t.g,t.b,t.f);i.f=e,i.b=n,i.c=$(r||[]),t.u=i.toString()}t.v=new au(t.u),function(t){if(!t.v)throw Error("IfcHandler must be initialized!");!function(t,e){t.sb.then((function(){t.a.register("authEvent",e,Dr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}(t.v,(function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=Go(e.authEvent),n=0;n<t.h.length;n++)r=t.h[n](e)||r;return(n={}).status=r?"ACK":"ERROR",xe(n)}return n.status="ERROR",xe(n)}))}(t)}))),t.m}function gu(t){return t.l||(t.C=t.c?Nr(t.c,pu(t.b)):null,t.l=new Ya(t.g,P(t.i),t.C),t.f&&os(t.l,t.f)),t.l}function mu(t,e,n,r,i,o,a,s,u,c,h,l){return(t=new fu(t,e,n,r,i,l)).l=o,t.g=a,t.i=s,t.b=yt(u||null),t.f=c,t.zb(h).toString()}function bu(t){if(this.a=t||r.Z.INTERNAL.reactNative&&r.Z.INTERNAL.reactNative.AsyncStorage,!this.a)throw new A("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function wu(t){this.b=t,this.a={},this.f=E(this.c,this)}lu.prototype.toString=function(){return this.f?Un(this.a,"v",this.f):tr(this.a.b,"v"),this.b?Un(this.a,"eid",this.b):tr(this.a.b,"eid"),this.c.length?Un(this.a,"fw",this.c.join(",")):tr(this.a.b,"fw"),this.a.toString()},fu.prototype.zb=function(t){return this.h=t,this},fu.prototype.toString=function(){if(this.v){var t=qn(this.v.url);t=Bn(t.c,t.a,t.g,"/emulator/auth/handler")}else t=Bn("https",this.u,null,"/__/auth/handler");if(Un(t,"apiKey",this.s),Un(t,"appName",this.c),Un(t,"authType",this.m),this.a.isOAuthProvider){var e=this.a;try{var n=r.Z.app(this.c).auth().la()}catch(t){n=null}for(var i in e.pb=n,Un(t,"providerId",this.a.providerId),e=Ur((n=this.a).Jb))e[i]=e[i].toString();i=n.Qc,e=yt(e);for(var o=0;o<i.length;o++){var a=i[o];a in e&&delete e[a]}n.qb&&n.pb&&!e[n.qb]&&(e[n.qb]=n.pb),vt(e)||Un(t,"customParameters",Fr(e))}if("function"==typeof this.a.Rb&&(n=this.a.Rb()).length&&Un(t,"scopes",n.join(",")),this.l?Un(t,"redirectUrl",this.l):tr(t.b,"redirectUrl"),this.g?Un(t,"eventId",this.g):tr(t.b,"eventId"),this.i?Un(t,"v",this.i):tr(t.b,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!Vn(t,s)&&Un(t,s,this.b[s]);return this.h?Un(t,"tid",this.h):tr(t.b,"tid"),this.f?Un(t,"eid",this.f):tr(t.b,"eid"),(s=pu(this.c)).length&&Un(t,"fw",s.join(",")),t.toString()},(t=du.prototype).Pb=function(t,e,n){var r=new A("popup-closed-by-user"),i=new A("web-storage-unsupported"),o=this,a=!1;return this.ma().then((function(){(function(t){var e={type:"webStorageSupport"};return yu(t).then((function(){return function(t,e){return t.sb.then((function(){return new Ee((function(n){t.a.send(e.type,e,n,Dr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}))}(t.v,e)})).then((function(t){if(t&&t.length&&void 0!==t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()}))})(o).then((function(n){n||(t&&yr(t),e(i),a=!0)}))})).o((function(){})).then((function(){if(!a)return function(t){return new Ee((function(e){return function n(){On(2e3).then((function(){if(t&&!t.closed)return n();e()}))}()}))}(t)})).then((function(){if(!a)return On(n).then((function(){e(r)}))}))},t.Yb=function(){var t=Cr();return!Mr(t)&&!Br(t)},t.Ub=function(){return!1},t.Nb=function(t,e,n,r,i,o,a,s){if(!t)return Ne(new A("popup-blocked"));if(a&&!Mr())return this.ma().o((function(e){yr(t),i(e)})),r(),xe();this.a||(this.a=vu(gu(this)));var u=this;return this.a.then((function(){var e=u.ma().o((function(e){throw yr(t),i(e),e}));return r(),e})).then((function(){qo(n),a||pr(mu(u.s,u.g,u.b,e,n,null,o,u.c,void 0,u.i,s,u.f),t)})).o((function(t){throw"auth/network-request-failed"==t.code&&(u.a=null),t}))},t.Ob=function(t,e,n,r){this.a||(this.a=vu(gu(this)));var i=this;return this.a.then((function(){qo(e),pr(mu(i.s,i.g,i.b,t,e,fr(),n,i.c,void 0,i.i,r,i.f))})).o((function(t){throw"auth/network-request-failed"==t.code&&(i.a=null),t}))},t.ma=function(){var t=this;return yu(this).then((function(){return t.v.sb})).o((function(){throw t.a=null,new A("network-request-failed")}))},t.ac=function(){return!0},t.Ea=function(t){this.h.push(t)},t.Ta=function(t){Y(this.h,(function(e){return e==t}))},(t=bu.prototype).get=function(t){return xe(this.a.getItem(t)).then((function(t){return t&&Vr(t)}))},t.set=function(t,e){return xe(this.a.setItem(t,Fr(e)))},t.U=function(t){return xe(this.a.removeItem(t))},t.ca=function(){},t.ia=function(){};var _u,Eu=[];function Iu(t,e,n){vt(t.a)&&t.b.addEventListener("message",t.f),void 0===t.a[e]&&(t.a[e]=[]),t.a[e].push(n)}function Su(t){this.a=t}function Tu(t){this.c=t,this.b=!1,this.a=[]}function ku(t,e,n,r){var i,o,a,s,u=n||{},c=null;if(t.b)return Ne(Error("connection_unavailable"));var h=r?800:50,l="undefined"!=typeof MessageChannel?new MessageChannel:null;return new Ee((function(n,r){l?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),l.port1.start(),a=setTimeout((function(){r(Error("unsupported_event"))}),h),c={messageChannel:l,onMessage:o=function(t){t.data.eventId===i&&("ack"===t.data.status?(clearTimeout(a),s=setTimeout((function(){r(Error("timeout"))}),3e3)):"done"===t.data.status?(clearTimeout(s),void 0!==t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(a),clearTimeout(s),r(Error("invalid_response"))))}},t.a.push(c),l.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:u},[l.port2])):r(Error("connection_unavailable"))})).then((function(e){return Au(t,c),e})).o((function(e){throw Au(t,c),e}))}function Au(t,e){if(e){var n=e.messageChannel,r=e.onMessage;n&&(n.port1.removeEventListener("message",r),n.port1.close()),Y(t.a,(function(t){return t==e}))}}function Ou(){if(!Du())throw new A("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=u.indexedDB,this.type="indexedDB",this.g=this.v=this.f=this.l=null,this.s=!1,this.h=null;var t=this;Ir()&&self?(this.v=function(){var t=Ir()?self:null;if(H(Eu,(function(n){n.b==t&&(e=n)})),!e){var e=new wu(t);Eu.push(e)}return e}(),Iu(this.v,"keyChanged",(function(e,n){return Mu(t).then((function(e){return 0<e.length&&H(t.a,(function(t){t(e)})),{keyProcessed:Q(e,n.key)}}))})),Iu(this.v,"ping",(function(){return xe(["keyChanged"])}))):function(){var t=u.navigator;return t&&t.serviceWorker?xe().then((function(){return t.serviceWorker.ready})).then((function(t){return t.active||null})).o((function(){return null})):xe(null)}().then((function(e){(t.h=e)&&(t.g=new Tu(new Su(e)),ku(t.g,"ping",null,!0).then((function(e){e[0].fulfilled&&Q(e[0].value,"keyChanged")&&(t.s=!0)})).o((function(){})))}))}function xu(t){return new Ee((function(e,n){var r=t.m.open("firebaseLocalStorageDb",1);r.onerror=function(t){try{t.preventDefault()}catch(t){}n(Error(t.target.error))},r.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(t){n(t)}},r.onsuccess=function(r){(r=r.target.result).objectStoreNames.contains("firebaseLocalStorage")?e(r):function(t){return new Ee((function(e,n){var r=t.m.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}}))}(t).then((function(){return xu(t)})).then((function(t){e(t)})).o((function(t){n(t)}))}}))}function Nu(t){return t.i||(t.i=xu(t)),t.i}function Cu(t,e){var n=0;return new Ee((function r(i,o){Nu(t).then(e).then(i).o((function(e){if(!(3<++n))return Nu(t).then((function(e){return e.close(),t.i=void 0,r(i,o)})).o((function(t){o(t)}));o(e)}))}))}function Du(){try{return!!u.indexedDB}catch(t){return!1}}function Pu(t){return t.objectStore("firebaseLocalStorage")}function Ru(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function Lu(t){return new Ee((function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}}))}function ju(t,e){return t.g&&t.h&&function(){var t=u.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}()===t.h?ku(t.g,"keyChanged",{key:e},t.s).then((function(){})).o((function(){})):xe()}function Mu(t){return Nu(t).then((function(t){var e=Pu(Ru(t,!1));return e.getAll?Lu(e.getAll()):new Ee((function(t,n){var r=[],i=e.openCursor();i.onsuccess=function(e){(e=e.target.result)?(r.push(e.value),e.continue()):t(r)},i.onerror=function(t){n(t.target.error)}}))})).then((function(e){var n={},r=[];if(0==t.b){for(r=0;r<e.length;r++)n[e[r].fbase_key]=e[r].value;r=dr(t.c,n),t.c=n}return r}))}function Fu(t){t.l&&t.l.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function Uu(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=xe().then((function(){if(Du()){var t=qr(),r="__sak"+t;return _u||(_u=new Ou),(n=_u).set(r,t).then((function(){return n.get(r)})).then((function(e){if(e!==t)throw Error("indexedDB not supported!");return n.U(r)})).then((function(){return n})).o((function(){return e.c}))}return e.c})).then((function(t){return e.type=t.type,t.ca((function(t){H(e.a,(function(e){e(t)}))})),t}))}function Vu(){this.a={},this.type="inMemory"}function qu(){if(!function(){var t="Node"==Sr();if(!(t=Bu()||t&&r.Z.INTERNAL.node&&r.Z.INTERNAL.node.localStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(t){return!1}}()){if("Node"==Sr())throw new A("internal-error","The LocalStorage compatibility library was not found.");throw new A("web-storage-unsupported")}this.a=Bu()||r.Z.INTERNAL.node.localStorage,this.type="localStorage"}function Bu(){try{var t=u.localStorage,e=qr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(t){return null}}function Gu(){this.type="nullStorage"}function Ku(){if(!function(){var t="Node"==Sr();if(!(t=Hu()||t&&r.Z.INTERNAL.node&&r.Z.INTERNAL.node.sessionStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(t){return!1}}()){if("Node"==Sr())throw new A("internal-error","The SessionStorage compatibility library was not found.");throw new A("web-storage-unsupported")}this.a=Hu()||r.Z.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Hu(){try{var t=u.sessionStorage,e=qr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(t){return null}}function Wu(){var t={};t.Browser=Qu,t.Node=Xu,t.ReactNative=Yu,t.Worker=Zu,this.a=t[Sr()]}wu.prototype.c=function(t){var e=t.data.eventType,n=t.data.eventId,r=this.a[e];if(r&&0<r.length){t.ports[0].postMessage({status:"ack",eventId:n,eventType:e,response:null});var i=[];H(r,(function(e){i.push(xe().then((function(){return e(t.origin,t.data.data)})))})),De(i).then((function(r){var i=[];H(r,(function(t){i.push({fulfilled:t.Qb,value:t.value,reason:t.reason?t.reason.message:void 0})})),H(i,(function(t){for(var e in t)void 0===t[e]&&delete t[e]})),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})}))}},Su.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},Tu.prototype.close=function(){for(;0<this.a.length;)Au(this,this.a[0]);this.b=!0},(t=Ou.prototype).set=function(t,e){var n=this,r=!1;return Cu(this,(function(e){return Lu((e=Pu(Ru(e,!0))).get(t))})).then((function(i){return Cu(n,(function(o){if(o=Pu(Ru(o,!0)),i)return i.value=e,Lu(o.put(i));n.b++,r=!0;var a={};return a.fbase_key=t,a.value=e,Lu(o.add(a))}))})).then((function(){return n.c[t]=e,ju(n,t)})).oa((function(){r&&n.b--}))},t.get=function(t){return Cu(this,(function(e){return Lu(Pu(Ru(e,!1)).get(t))})).then((function(t){return t&&t.value}))},t.U=function(t){var e=this,n=!1;return Cu(this,(function(r){return n=!0,e.b++,Lu(Pu(Ru(r,!0)).delete(t))})).then((function(){return delete e.c[t],ju(e,t)})).oa((function(){n&&e.b--}))},t.ca=function(t){0==this.a.length&&function(t){Fu(t),function e(){t.f=setTimeout((function(){t.l=Mu(t).then((function(e){0<e.length&&H(t.a,(function(t){t(e)}))})).then((function(){e()})).o((function(t){"STOP_EVENT"!=t.message&&e()}))}),800)}()}(this),this.a.push(t)},t.ia=function(t){Y(this.a,(function(e){return e==t})),0==this.a.length&&Fu(this)},(t=Uu.prototype).get=function(t){return this.b.then((function(e){return e.get(t)}))},t.set=function(t,e){return this.b.then((function(n){return n.set(t,e)}))},t.U=function(t){return this.b.then((function(e){return e.U(t)}))},t.ca=function(t){this.a.push(t)},t.ia=function(t){Y(this.a,(function(e){return e==t}))},(t=Vu.prototype).get=function(t){return xe(this.a[t])},t.set=function(t,e){return this.a[t]=e,xe()},t.U=function(t){return delete this.a[t],xe()},t.ca=function(){},t.ia=function(){},(t=qu.prototype).get=function(t){var e=this;return xe().then((function(){return Vr(e.a.getItem(t))}))},t.set=function(t,e){var n=this;return xe().then((function(){var r=Fr(e);null===r?n.U(t):n.a.setItem(t,r)}))},t.U=function(t){var e=this;return xe().then((function(){e.a.removeItem(t)}))},t.ca=function(t){u.window&&ln(u.window,"storage",t)},t.ia=function(t){u.window&&dn(u.window,"storage",t)},(t=Gu.prototype).get=function(){return xe(null)},t.set=function(){return xe()},t.U=function(){return xe()},t.ca=function(){},t.ia=function(){},(t=Ku.prototype).get=function(t){var e=this;return xe().then((function(){return Vr(e.a.getItem(t))}))},t.set=function(t,e){var n=this;return xe().then((function(){var r=Fr(e);null===r?n.U(t):n.a.setItem(t,r)}))},t.U=function(t){var e=this;return xe().then((function(){e.a.removeItem(t)}))},t.ca=function(){},t.ia=function(){};var zu,Ju,Qu={F:qu,cb:Ku},Xu={F:qu,cb:Ku},Yu={F:bu,cb:Gu},Zu={F:qu,cb:Gu},$u={rd:"local",NONE:"none",td:"session"};function tc(){var t=!(Br(Cr())||!Er()),e=Mr(),n=Pr();this.m=t,this.h=e,this.l=n,this.a={},zu||(zu=new Wu),t=zu;try{this.g=!lr()&&zr()||!u.indexedDB?new t.a.F:new Uu(Ir()?new Vu:new t.a.F)}catch(t){this.g=new Vu,this.h=!0}try{this.i=new t.a.cb}catch(t){this.i=new Vu}this.v=new Vu,this.f=E(this.Zb,this),this.b={}}function ec(){return Ju||(Ju=new tc),Ju}function nc(t,e){switch(e){case"session":return t.i;case"none":return t.v;default:return t.g}}function rc(t,e){return"firebase:"+t.name+(e?":"+e:"")}function ic(t,e,n){return n=rc(e,n),"local"==e.F&&(t.b[n]=null),nc(t,e.F).U(n)}function oc(t){t.c&&(clearInterval(t.c),t.c=null)}function ac(t){this.a=t,this.b=ec()}(t=tc.prototype).get=function(t,e){return nc(this,t.F).get(rc(t,e))},t.set=function(t,e,n){var r=rc(t,n),i=this,o=nc(this,t.F);return o.set(r,e).then((function(){return o.get(r)})).then((function(e){"local"==t.F&&(i.b[r]=e)}))},t.addListener=function(t,e,n){t=rc(t,e),this.l&&(this.b[t]=u.localStorage.getItem(t)),vt(this.a)&&(nc(this,"local").ca(this.f),this.h||(lr()||!zr())&&u.indexedDB||!this.l||function(t){oc(t),t.c=setInterval((function(){for(var e in t.a){var n=u.localStorage.getItem(e),r=t.b[e];n!=r&&(t.b[e]=n,n=new $e({type:"storage",key:e,target:window,oldValue:r,newValue:n,a:!0}),t.Zb(n))}}),1e3)}(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(n)},t.removeListener=function(t,e,n){t=rc(t,e),this.a[t]&&(Y(this.a[t],(function(t){return t==n})),0==this.a[t].length&&delete this.a[t]),vt(this.a)&&(nc(this,"local").ia(this.f),oc(this))},t.Zb=function(t){if(t&&t.g){var e=t.a.key;if(null==e)for(var n in this.a){var r=this.b[n];void 0===r&&(r=null);var i=u.localStorage.getItem(n);i!==r&&(this.b[n]=i,this.nb(n))}else if(0==e.indexOf("firebase:")&&this.a[e]){if(void 0!==t.a.a?nc(this,"local").ia(this.f):oc(this),this.m)if(n=u.localStorage.getItem(e),(r=t.a.newValue)!==n)null!==r?u.localStorage.setItem(e,r):u.localStorage.removeItem(e);else if(this.b[e]===r&&void 0===t.a.a)return;var o=this;n=function(){void 0===t.a.a&&o.b[e]===u.localStorage.getItem(e)||(o.b[e]=u.localStorage.getItem(e),o.nb(e))},Xt&&ue&&10==ue&&u.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(n,10):n()}}else H(t,E(this.nb,this))},t.nb=function(t){this.a[t]&&H(this.a[t],(function(t){t()}))};var sc,uc={name:"authEvent",F:"local"};function cc(){this.a=ec()}function hc(t,e){this.b=lc,this.f=u.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=t,this.h=e,this.l=u.Int32Array?new Int32Array(64):Array(64),void 0===sc&&(sc=u.Int32Array?new Int32Array(mc):mc),this.reset()}T(hc,(function(){this.b=-1}));for(var lc=64,fc=lc-1,pc=[],dc=0;dc<fc;dc++)pc[dc]=0;var vc=Z(128,pc);function yc(t){for(var e=t.f,n=t.l,r=0,i=0;i<e.length;)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],i=4*r;for(e=16;64>e;e++){i=0|n[e-15],r=0|n[e-2];var o=(0|n[e-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|n[e-7])+((r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)|0;n[e]=o+a|0}r=0|t.a[0],i=0|t.a[1];var s=0|t.a[2],u=0|t.a[3],c=0|t.a[4],h=0|t.a[5],l=0|t.a[6];for(o=0|t.a[7],e=0;64>e;e++){var f=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&s^i&s)|0;a=(o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0)+((a=(a=c&h^~c&l)+(0|sc[e])|0)+(0|n[e])|0)|0,o=l,l=h,h=c,c=u+a|0,u=s,s=i,i=r,r=a+f|0}t.a[0]=t.a[0]+r|0,t.a[1]=t.a[1]+i|0,t.a[2]=t.a[2]+s|0,t.a[3]=t.a[3]+u|0,t.a[4]=t.a[4]+c|0,t.a[5]=t.a[5]+h|0,t.a[6]=t.a[6]+l|0,t.a[7]=t.a[7]+o|0}function gc(t,e,n){void 0===n&&(n=e.length);var r=0,i=t.c;if("string"==typeof e)for(;r<n;)t.f[i++]=e.charCodeAt(r++),i==t.b&&(yc(t),i=0);else{if(!d(e))throw Error("message must be string or array");for(;r<n;){var o=e[r++];if(!("number"==typeof o&&0<=o&&255>=o&&o==(0|o)))throw Error("message must be a byte array");t.f[i++]=o,i==t.b&&(yc(t),i=0)}}t.c=i,t.g+=n}hc.prototype.reset=function(){this.g=this.c=0,this.a=u.Int32Array?new Int32Array(this.h):$(this.h)};var mc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function bc(){hc.call(this,8,wc)}T(bc,hc);var wc=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function _c(t,e,n,r,i,o){this.v=t,this.i=e,this.l=n,this.m=r||null,this.u=i||null,this.s=o,this.h=e+":"+n,this.C=new cc,this.g=new ac(this.h),this.f=null,this.b=[],this.a=this.c=null}function Ec(t){return new A("invalid-cordova-configuration",t)}function Ic(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(t){}}function Sc(t){return t.f||(t.f=t.ma().then((function(){return new Ee((function(e){t.Ea((function n(r){return e(r),t.Ta(n),!1})),function(t){function e(e){r=!0,i&&i.cancel(),Tc(t).then((function(r){var i=n;if(r&&e&&e.url){var o=null;-1!=(i=ao(e.url)).indexOf("/__/auth/callback")&&(o=(o="object"==typeof(o=Vr(Vn(o=qn(i),"firebaseError")||null))?O(o):null)?new Bo(r.c,r.b,null,null,o,null,r.T()):new Bo(r.c,r.b,i,r.f,null,null,r.T())),i=o||n}Ic(t,i)}))}var n=new Bo("unknown",null,null,null,new A("no-auth-event")),r=!1,i=On(500).then((function(){return Tc(t).then((function(){r||Ic(t,n)}))})),o=u.handleOpenURL;u.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(Dr("BuildInfo.packageName",u).toLowerCase()+"://")&&e({url:t}),"function"==typeof o)try{o(t)}catch(t){console.error(t)}},Wo||(Wo=new Ko),function(t){var e=Wo;e.a.push(t),e.b||(e.b=function(t){for(var n=0;n<e.a.length;n++)e.a[n](t)},"function"==typeof(t=Dr("universalLinks.subscribe",u))&&t(null,e.b))}(e)}(t)}))}))),t.f}function Tc(t){var e=null;return function(t){return t.b.get(uc,t.a).then((function(t){return Go(t)}))}(t.g).then((function(n){return e=n,ic((n=t.g).b,uc,n.a)})).then((function(){return e}))}function kc(t){this.a=t,this.b=ec()}(t=_c.prototype).ma=function(){return this.Ia?this.Ia:this.Ia=(_r(void 0)?wr().then((function(){return new Ee((function(t,e){var n=u.document,r=setTimeout((function(){e(Error("Cordova framework is not ready."))}),1e3);n.addEventListener("deviceready",(function(){clearTimeout(r),t()}),!1)}))})):Ne(Error("Cordova must run in an Android or iOS file scheme."))).then((function(){if("function"!=typeof Dr("universalLinks.subscribe",u))throw Ec("cordova-universal-links-plugin-fix is not installed");if(void 0===Dr("BuildInfo.packageName",u))throw Ec("cordova-plugin-buildinfo is not installed");if("function"!=typeof Dr("cordova.plugins.browsertab.openUrl",u))throw Ec("cordova-plugin-browsertab is not installed");if("function"!=typeof Dr("cordova.InAppBrowser.open",u))throw Ec("cordova-plugin-inappbrowser is not installed")}),(function(){throw new A("cordova-not-ready")}))},t.Pb=function(t,e){return e(new A("operation-not-supported-in-this-environment")),xe()},t.Nb=function(){return Ne(new A("operation-not-supported-in-this-environment"))},t.ac=function(){return!1},t.Yb=function(){return!0},t.Ub=function(){return!0},t.Ob=function(t,e,n,r){if(this.c)return Ne(new A("redirect-operation-pending"));var i=this,o=u.document,a=null,s=null,c=null,h=null;return this.c=xe().then((function(){return qo(e),Sc(i)})).then((function(){return function(t,e,n,r,i){var o=function(){for(var t=20,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}(),a=new Bo(e,r,null,o,new A("no-auth-event"),null,i),s=Dr("BuildInfo.packageName",u);if("string"!=typeof s)throw new A("invalid-cordova-configuration");var c=Dr("BuildInfo.displayName",u),h={};if(Cr().toLowerCase().match(/iphone|ipad|ipod/))h.ibi=s;else{if(!Cr().toLowerCase().match(/android/))return Ne(new A("operation-not-supported-in-this-environment"));h.apn=s}c&&(h.appDisplayName=c),o=function(t){var e=new bc;gc(e,t),t=[];var n=8*e.g;56>e.c?gc(e,vc,56-e.c):gc(e,vc,e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(yc(e),r=n=0;r<e.i;r++)for(var i=24;0<=i;i-=8)t[n++]=e.a[r]>>i&255;return function(t){return z(t,(function(t){return 1<(t=t.toString(16)).length?t:"0"+t})).join("")}(t)}(o),h.sessionId=o;var l=mu(t.v,t.i,t.l,e,n,null,r,t.m,h,t.u,i,t.s);return t.ma().then((function(){var e=t.h;return t.C.a.set(uc,a.w(),e)})).then((function(){var e=Dr("cordova.plugins.browsertab.isAvailable",u);if("function"!=typeof e)throw new A("invalid-cordova-configuration");var n=null;e((function(e){if(e){if("function"!=typeof(n=Dr("cordova.plugins.browsertab.openUrl",u)))throw new A("invalid-cordova-configuration");n(l)}else{if("function"!=typeof(n=Dr("cordova.InAppBrowser.open",u)))throw new A("invalid-cordova-configuration");e=Cr(),t.a=n(l,e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}}))}))}(i,t,e,n,r)})).then((function(){return new Ee((function(t,e){s=function(){var e=Dr("cordova.plugins.browsertab.close",u);return t(),"function"==typeof e&&e(),i.a&&"function"==typeof i.a.close&&(i.a.close(),i.a=null),!1},i.Ea(s),c=function(){a||(a=On(2e3).then((function(){e(new A("redirect-cancelled-by-user"))})))},h=function(){Hr()&&c()},o.addEventListener("resume",c,!1),Cr().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",h,!1)})).o((function(t){return Tc(i).then((function(){throw t}))}))})).oa((function(){c&&o.removeEventListener("resume",c,!1),h&&o.removeEventListener("visibilitychange",h,!1),a&&a.cancel(),s&&i.Ta(s),i.c=null}))},t.Ea=function(t){this.b.push(t),Sc(this).o((function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new Bo("unknown",null,null,null,new A("no-auth-event")),t(e))}))},t.Ta=function(t){Y(this.b,(function(e){return e==t}))};var Ac={name:"pendingRedirect",F:"session"};function Oc(t){return ic(t.b,Ac,t.a)}function xc(t,e,n,r){this.i={},this.u=0,this.D=t,this.v=e,this.m=n,this.J=r,this.h=[],this.f=!1,this.l=E(this.s,this),this.b=new Kc,this.C=new Qc,this.g=new kc(Bc(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=Nc(this.D,this.v,this.m,x,this.J)}function Nc(t,e,n,i,o){var a=r.Z.SDK_VERSION||null;return _r()?new _c(t,e,n,a,i,o):new du(t,e,n,a,i,o)}function Cc(t){t.f||(t.f=!0,t.a.Ea(t.l));var e=t.a;return t.a.ma().o((function(n){throw t.a==e&&t.reset(),n}))}function Dc(t){t.a.Yb()&&Cc(t).o((function(e){var n=new Bo("unknown",null,null,null,new A("operation-not-supported-in-this-environment"));Fc(e)&&t.s(n)})),t.a.Ub()||Hc(t.b)}function Pc(t,e){Q(t.h,e)||t.h.push(e),t.f||function(t){return t.b.get(Ac,t.a).then((function(t){return"pending"==t}))}(t.g).then((function(e){e?Oc(t.g).then((function(){Cc(t).o((function(e){var n=new Bo("unknown",null,null,null,new A("operation-not-supported-in-this-environment"));Fc(e)&&t.s(n)}))})):Dc(t)})).o((function(){Dc(t)}))}function Rc(t,e){Y(t.h,(function(t){return t==e}))}xc.prototype.reset=function(){this.f=!1,this.a.Ta(this.l),this.a=Nc(this.D,this.v,this.m,null,this.J),this.i={}},xc.prototype.s=function(t){if(!t)throw new A("invalid-auth-event");if(6e5<=Date.now()-this.u&&(this.i={},this.u=0),t&&t.getUid()&&this.i.hasOwnProperty(t.getUid()))return!1;for(var e=!1,n=0;n<this.h.length;n++){var r=this.h[n];if(r.Gb(t.c,t.b)){(e=this.c[t.c])&&(e.h(t,r),t&&(t.f||t.b)&&(this.i[t.getUid()]=!0,this.u=Date.now())),e=!0;break}}return Hc(this.b),e};var Lc=new Kr(2e3,1e4),jc=new Kr(3e4,6e4);function Mc(t,e,n,r,i,o,a){return t.a.Nb(e,n,r,(function(){t.f||(t.f=!0,t.a.Ea(t.l))}),(function(){t.reset()}),i,o,a)}function Fc(t){return!(!t||"auth/cordova-not-ready"!=t.code)}function Uc(t,e,n,r,i){var o;return function(t){return t.b.set(Ac,"pending",t.a)}(t.g).then((function(){return t.a.Ob(e,n,r,i).o((function(e){if(Fc(e))throw new A("operation-not-supported-in-this-environment");return o=e,Oc(t.g).then((function(){throw o}))})).then((function(){return t.a.ac()?new Ee((function(){})):Oc(t.g).then((function(){return t.ra()})).then((function(){})).o((function(){}))}))}))}function Vc(t,e,n,r,i){return t.a.Pb(r,(function(t){e.na(n,null,t,i)}),Lc.get())}xc.prototype.ra=function(){return this.b.ra()};var qc={};function Bc(t,e,n){return t=t+":"+e,n&&(t=t+":"+n.url),t}function Gc(t,e,n,r){var i=Bc(e,n,r);return qc[i]||(qc[i]=new xc(t,e,n,r)),qc[i]}function Kc(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Hc(t){t.g||(t.g=!0,Jc(t,!1,null,null))}function Wc(t){t.g&&!t.i&&Jc(t,!1,null,null)}function zc(t,e){if(t.b=function(){return xe(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function Jc(t,e,n,r){e?r?function(t,e){if(t.b=function(){return Ne(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}(t,r):zc(t,n):zc(t,{user:null}),t.f=[],t.c=[]}function Qc(){}function Xc(){this.jb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.jb},set:function(t){this.jb=t},enumerable:!1})}function Yc(t,e){this.a=e,Zr(this,"verificationId",t)}function Zc(t,e,n,r){return new Fo(t).gb(e,n).then((function(t){return new Yc(t,r)}))}function $c(t){var e=Wi(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new A("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");$r(this,{token:t,expirationTime:Wr(1e3*e.exp),authTime:Wr(1e3*e.auth_time),issuedAtTime:Wr(1e3*e.iat),signInProvider:e.firebase&&e.firebase.sign_in_provider?e.firebase.sign_in_provider:null,signInSecondFactor:e.firebase&&e.firebase.sign_in_second_factor?e.firebase.sign_in_second_factor:null,claims:e})}function th(t,e,n){var r=e&&e[nh];if(!r)throw new A("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=t,this.f=yt(e),this.g=n,this.c=new so(null,r),this.b=[];var i=this;H(e[eh]||[],(function(t){(t=ri(t))&&i.b.push(t)})),Zr(this,"auth",this.a),Zr(this,"session",this.c),Zr(this,"hints",this.b)}Kc.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Kc.prototype.h=function(t,e){if(t){this.reset(),this.g=!0;var n=t.c,r=t.b,i=t.a&&"auth/web-storage-unsupported"==t.a.code,o=t.a&&"auth/operation-not-supported-in-this-environment"==t.a.code;this.i=!(!i&&!o),"unknown"!=n||i||o?t.a?(Jc(this,!0,null,t.a),xe()):e.Fa(n,r)?function(t,e,n){n=n.Fa(e.c,e.b);var r=e.g,i=e.f,o=e.i,a=e.T(),s=!!e.c.match(/Redirect$/);n(r,i,a,o).then((function(e){Jc(t,s,e,null)})).o((function(e){Jc(t,s,null,e)}))}(this,t,e):Ne(new A("invalid-auth-event")):(Jc(this,!1,null,null),xe())}else Ne(new A("invalid-auth-event"))},Kc.prototype.ra=function(){var t=this;return new Ee((function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),function(t){var e=new A("timeout");t.a&&t.a.cancel(),t.a=On(jc.get()).then((function(){t.b||(t.g=!0,Jc(t,!0,null,e))}))}(t))}))},Qc.prototype.h=function(t,e){if(t){var n=t.c,r=t.b;t.a?(e.na(t.c,null,t.a,t.b),xe()):e.Fa(n,r)?function(t,e){var n=t.b,r=t.c;e.Fa(r,n)(t.g,t.f,t.T(),t.i).then((function(t){e.na(r,t,null,n)})).o((function(t){e.na(r,null,t,n)}))}(t,e):Ne(new A("invalid-auth-event"))}else Ne(new A("invalid-auth-event"))},Yc.prototype.confirm=function(t){return t=Uo(this.verificationId,t),this.a(t)};var eh="mfaInfo",nh="mfaPendingCredential";function rh(t,e,n,r){A.call(this,"multi-factor-auth-required",r,e),this.b=new th(t,e,n),Zr(this,"resolver",this.b)}function ih(t,e,n){if(t&&y(t.serverResponse)&&"auth/multi-factor-auth-required"===t.code)try{return new rh(e,t.serverResponse,n,t.message)}catch(t){}return null}function oh(){}function ah(t){Zr(this,"factorId",t.fa),this.a=t}function sh(t){if(ah.call(this,t),this.a.fa!=Fo.PROVIDER_ID)throw new A("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential")}function uh(t,e){for(var n in Ze.call(this,t),e)this[n]=e[n]}function ch(t,e){this.a=t,this.b=[],this.c=E(this.yc,this),ln(this.a,"userReloaded",this.c);var n=[];e&&e.multiFactor&&e.multiFactor.enrolledFactors&&H(e.multiFactor.enrolledFactors,(function(t){var e=null,r={};if(t){t.uid&&(r[ai]=t.uid),t.displayName&&(r[ii]=t.displayName),t.enrollmentTime&&(r[oi]=new Date(t.enrollmentTime).toISOString()),t.phoneNumber&&(r[si]=t.phoneNumber);try{e=new ui(r)}catch(t){}t=e}else t=null;t&&n.push(t)})),hh(this,n)}function hh(t,e){t.b=e,Zr(t,"enrolledFactors",e)}function lh(t,e,n){if(this.h=t,this.i=e,this.g=n,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!")}function fh(t,e){t.stop(),t.b=On(function(t,e){return e?(t.a=t.c,t.g()):(e=t.a,t.a*=2,t.a>t.f&&(t.a=t.f),e)}(t,e)).then((function(){return function(){var t=u.document,e=null;return Hr()||!t?xe():new Ee((function(n){e=function(){Hr()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)})).o((function(n){throw t.removeEventListener("visibilitychange",e,!1),n}))}()})).then((function(){return t.h()})).then((function(){fh(t,!0)})).o((function(e){t.i(e)&&fh(t,!1)}))}function ph(t){this.f=t,this.b=this.a=null,this.c=Date.now()}function dh(t,e){void 0===e&&(e=t.b?(e=t.b).a-e.g:0),t.c=Date.now()+1e3*e}function vh(t,e){t.b=Hi(e[$a]||""),t.a=e.refreshToken,dh(t,void 0!==(e=e.expiresIn)?Number(e):void 0)}function yh(t,e){this.a=t||null,this.b=e||null,$r(this,{lastSignInTime:Wr(e||null),creationTime:Wr(t||null)})}function gh(t,e,n,r,i,o){$r(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function mh(t,e,n){this.N=[],this.l=t.apiKey,this.m=t.appName,this.s=t.authDomain||null;var i=r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION):null;this.a=new Ya(this.l,P(x),i),(this.u=t.emulatorConfig||null)&&os(this.a,this.u),this.h=new ph(this.a),Ah(this,e[$a]),vh(this.h,e),Zr(this,"refreshToken",this.h.a),Nh(this,n||{}),In.call(this),this.P=!1,this.s&&Rr()&&(this.b=Gc(this.s,this.l,this.m,this.u)),this.W=[],this.i=null,this.D=function(t){return new lh((function(){return t.I(!0)}),(function(t){return!(!t||"auth/network-request-failed"!=t.code)}),(function(){var e=t.h.c-Date.now()-3e5;return 0<e?e:0}))}(this),this.ba=E(this.ib,this);var o=this;this.za=null,this.Pa=function(t){o.xa(t.h)},this.qa=null,this.Ba=function(t){bh(o,t.c)},this.$=null,this.aa=[],this.Oa=function(t){Eh(o,t.f)},this.ja=null,this.S=new ch(this,n),Zr(this,"multiFactor",this.S)}function bh(t,e){t.u=e,os(t.a,e),t.b&&(e=t.b,t.b=Gc(t.s,t.l,t.m,t.u),t.P&&(Rc(e,t),Pc(t.b,t)))}function wh(t,e){t.qa&&dn(t.qa,"languageCodeChanged",t.Pa),(t.qa=e)&&ln(e,"languageCodeChanged",t.Pa)}function _h(t,e){t.$&&dn(t.$,"emulatorConfigChanged",t.Ba),(t.$=e)&&ln(e,"emulatorConfigChanged",t.Ba)}function Eh(t,e){t.aa=e,ss(t.a,r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION,t.aa):null)}function Ih(t,e){t.ja&&dn(t.ja,"frameworkChanged",t.Oa),(t.ja=e)&&ln(e,"frameworkChanged",t.Oa)}function Sh(t){try{return r.Z.app(t.m).auth()}catch(e){throw new A("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.m+"'!")}}function Th(t){t.J||t.D.b||(t.D.start(),dn(t,"tokenChanged",t.ba),ln(t,"tokenChanged",t.ba))}function kh(t){dn(t,"tokenChanged",t.ba),t.D.stop()}function Ah(t,e){t.Aa=e,Zr(t,"_lat",e)}function Oh(t){for(var e=[],n=0;n<t.W.length;n++)e.push(t.W[n](t));return De(e).then((function(){return t}))}function xh(t){t.b&&!t.P&&(t.P=!0,Pc(t.b,t))}function Nh(t,e){$r(t,{uid:e.uid,displayName:e.displayName||null,photoURL:e.photoURL||null,email:e.email||null,emailVerified:e.emailVerified||!1,phoneNumber:e.phoneNumber||null,isAnonymous:e.isAnonymous||!1,tenantId:e.tenantId||null,metadata:new yh(e.createdAt,e.lastLoginAt),providerData:[]}),t.a.b=t.tenantId}function Ch(){}function Dh(t){return xe().then((function(){if(t.J)throw new A("app-deleted")}))}function Ph(t){return z(t.providerData,(function(t){return t.providerId}))}function Rh(t,e){e&&(Lh(t,e.providerId),t.providerData.push(e))}function Lh(t,e){Y(t.providerData,(function(t){return t.providerId==e}))}function jh(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&Zr(t,e,n)}function Mh(t,e){t!=e&&($r(t,{uid:e.uid,displayName:e.displayName,photoURL:e.photoURL,email:e.email,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber,isAnonymous:e.isAnonymous,tenantId:e.tenantId,providerData:[]}),e.metadata?Zr(t,"metadata",function(t){return new yh(t.a,t.b)}(e.metadata)):Zr(t,"metadata",new yh),H(e.providerData,(function(e){Rh(t,e)})),function(t,e){t.b=e.b,t.a=e.a,t.c=e.c}(t.h,e.h),Zr(t,"refreshToken",t.h.a),hh(t.S,e.S.b))}function Fh(t){return t.I().then((function(e){var n=t.isAnonymous;return function(t,e){return ru(t.a,Rs,{idToken:e}).then(E(t.Kc,t))}(t,e).then((function(){return n||jh(t,"isAnonymous",!1),e}))}))}function Uh(t,e){e[$a]&&t.Aa!=e[$a]&&(vh(t.h,e),t.dispatchEvent(new uh("tokenChanged")),Ah(t,e[$a]),jh(t,"refreshToken",t.h.a))}function Vh(t,e){return Fh(t).then((function(){if(Q(Ph(t),e))return Oh(t).then((function(){throw new A("provider-already-linked")}))}))}function qh(t,e,n){return ti({user:t,credential:Vo(e),additionalUserInfo:e=Yi(e),operationType:n})}function Bh(t,e){return Uh(t,e),t.reload().then((function(){return t}))}function Gh(t,e,n,i,o){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));if(t.i&&!o)return Ne(t.i);var a=Xi(n.providerId),s=qr(t.uid+":::"),u=null;(!Mr()||Er())&&t.s&&n.isOAuthProvider&&(u=mu(t.s,t.l,t.m,e,n,null,s,r.Z.SDK_VERSION||null,null,null,t.tenantId,t.u));var c=gr(u,a&&a.va,a&&a.ua);return i=i().then((function(){if(Hh(t),!o)return t.I().then((function(){}))})).then((function(){return Mc(t.b,c,e,n,s,!!u,t.tenantId)})).then((function(){return new Ee((function(n,r){t.na(e,null,new A("cancelled-popup-request"),t.g||null),t.f=n,t.C=r,t.g=s,t.c=Vc(t.b,t,e,c,s)}))})).then((function(t){return c&&yr(c),t?ti(t):null})).o((function(t){throw c&&yr(c),t})),Wh(t,i,o)}function Kh(t,e,n,r,i){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));if(t.i&&!i)return Ne(t.i);var o=null,a=qr(t.uid+":::");return r=r().then((function(){if(Hh(t),!i)return t.I().then((function(){}))})).then((function(){return t.ga=a,Oh(t)})).then((function(e){return t.ha&&(e=(e=t.ha).b.set(Qh,t.w(),e.a)),e})).then((function(){return Uc(t.b,e,n,a,t.tenantId)})).o((function(e){if(o=e,t.ha)return Xh(t.ha);throw o})).then((function(){if(o)throw o})),Wh(t,r,i)}function Hh(t){if(!t.b||!t.P){if(t.b&&!t.P)throw new A("internal-error");throw new A("auth-domain-config-required")}}function Wh(t,e,n){var r=function(t,e,n){return t.i&&!n?(e.cancel(),Ne(t.i)):e.o((function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.i||t.dispatchEvent(new uh("userInvalidated")),t.i=e),e}))}(t,e,n);return t.N.push(r),r.oa((function(){X(t.N,r)})),r.o((function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=ih(e.w(),Sh(t),E(t.jc,t))),n||e}))}function zh(t){if(!t.apiKey)return null;var e={apiKey:t.apiKey,authDomain:t.authDomain,appName:t.appName,emulatorConfig:t.emulatorConfig},n={};if(!t.stsTokenManager||!t.stsTokenManager.accessToken)return null;n[$a]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null;var r=t.stsTokenManager.expirationTime;r&&(n.expiresIn=(r-Date.now())/1e3);var i=new mh(e,n,t);return t.providerData&&H(t.providerData,(function(t){t&&Rh(i,ti(t))})),t.redirectEventId&&(i.ga=t.redirectEventId),i}function Jh(t){this.a=t,this.b=ec()}th.prototype.Rc=function(t){var e=this;return t.tb(this.a.a,this.c).then((function(t){var n=yt(e.f);return delete n[eh],delete n[nh],mt(n,t),e.g(n)}))},T(rh,A),oh.prototype.tb=function(t,e,n){return e.type==uo?function(t,e,n,r){return n.Ha().then((function(n){return n={idToken:n},void 0!==r&&(n.displayName=r),mt(n,{phoneVerificationInfo:Mo(t.a)}),ru(e,Ds,n)}))}(this,t,e,n):function(t,e,n){return n.Ha().then((function(n){return mt(n={mfaPendingCredential:n},{phoneVerificationInfo:Mo(t.a)}),ru(e,Ps,n)}))}(this,t,e)},T(ah,oh),T(sh,ah),T(uh,Ze),(t=ch.prototype).yc=function(t){hh(this,function(t){var e=[];return H(t.mfaInfo||[],(function(t){(t=ri(t))&&e.push(t)})),e}(t.hd))},t.Sb=function(){return this.a.I().then((function(t){return new so(t,null)}))},t.fc=function(t,e){var n=this,r=this.a.a;return this.Sb().then((function(n){return t.tb(r,n,e)})).then((function(t){return Uh(n.a,t),n.a.reload()}))},t.bd=function(t){var e=this,n="string"==typeof t?t:t.uid,r=this.a.a;return this.a.I().then((function(t){return ru(r,nu,{idToken:t,mfaEnrollmentId:n})})).then((function(t){var r=W(e.b,(function(t){return t.uid!=n}));return hh(e,r),Uh(e.a,t),e.a.reload().o((function(t){if("auth/user-token-expired"!=t.code)throw t}))}))},t.w=function(){return{multiFactor:{enrolledFactors:z(this.b,(function(t){return t.w()}))}}},lh.prototype.start=function(){this.a=this.c,fh(this,!0)},lh.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},ph.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}},ph.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?Ne(new A("user-token-expired")):t||!this.b||Date.now()>this.c-3e4?this.a?function(t,e){return function(t,e){return new Ee((function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?us(t,t.l+"?key="+encodeURIComponent(t.c),(function(t){t?t.error?r(ou(t)):t.access_token&&t.refresh_token?n(t):r(new A("internal-error")):r(new A("network-request-failed"))}),"POST",$n(e).toString(),t.g,t.m.get()):r(new A("internal-error"))}))}(t.f,e).then((function(e){return t.b=Hi(e.access_token),t.a=e.refresh_token,dh(t,e.expires_in),{accessToken:t.b.toString(),refreshToken:t.a}})).o((function(e){throw"auth/user-token-expired"==e.code&&(t.a=null),e}))}(this,{grant_type:"refresh_token",refresh_token:this.a}):xe(null):xe({accessToken:this.b.toString(),refreshToken:this.a})},yh.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}},T(mh,In),mh.prototype.xa=function(t){this.za=t,is(this.a,t)},mh.prototype.la=function(){return this.za},mh.prototype.Ga=function(){return $(this.aa)},mh.prototype.ib=function(){this.D.b&&(this.D.stop(),this.D.start())},Zr(mh.prototype,"providerId","firebase"),(t=mh.prototype).reload=function(){var t=this;return Wh(this,Dh(this).then((function(){return Fh(t).then((function(){return Oh(t)})).then(Ch)})))},t.oc=function(t){return this.I(t).then((function(t){return new $c(t)}))},t.I=function(t){var e=this;return Wh(this,Dh(this).then((function(){return e.h.getToken(t)})).then((function(t){if(!t)throw new A("internal-error");return t.accessToken!=e.Aa&&(Ah(e,t.accessToken),e.dispatchEvent(new uh("tokenChanged"))),jh(e,"refreshToken",t.refreshToken),t.accessToken})))},t.Kc=function(t){if(!(t=t.users)||!t.length)throw new A("internal-error");Nh(this,{uid:(t=t[0]).localId,displayName:t.displayName,photoURL:t.photoUrl,email:t.email,emailVerified:!!t.emailVerified,phoneNumber:t.phoneNumber,lastLoginAt:t.lastLoginAt,createdAt:t.createdAt,tenantId:t.tenantId});for(var e=function(t){return(t=t.providerUserInfo)&&t.length?z(t,(function(t){return new gh(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)})):[]}(t),n=0;n<e.length;n++)Rh(this,e[n]);jh(this,"isAnonymous",!(this.email&&t.passwordHash||this.providerData&&this.providerData.length)),this.dispatchEvent(new uh("userReloaded",{hd:t}))},t.Lc=function(t){return Xr("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.ub(t)},t.ub=function(t){var e=this,n=null;return Wh(this,t.c(this.a,this.uid).then((function(t){return Uh(e,t),n=qh(e,t,"reauthenticate"),e.i=null,e.reload()})).then((function(){return n})),!0)},t.Cc=function(t){return Xr("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.rb(t)},t.rb=function(t){var e=this,n=null;return Wh(this,Vh(this,t.providerId).then((function(){return e.I()})).then((function(n){return t.b(e.a,n)})).then((function(t){return n=qh(e,t,"link"),Bh(e,t)})).then((function(){return n})))},t.Dc=function(t,e){var n=this;return Wh(this,Vh(this,"phone").then((function(){return Zc(Sh(n),t,e,E(n.rb,n))})))},t.Mc=function(t,e){var n=this;return Wh(this,xe().then((function(){return Zc(Sh(n),t,e,E(n.ub,n))})),!0)},t.Cb=function(t){var e=this;return Wh(this,this.I().then((function(n){return e.a.Cb(n,t)})).then((function(t){return Uh(e,t),e.reload()})))},t.ed=function(t){var e=this;return Wh(this,this.I().then((function(n){return t.b(e.a,n)})).then((function(t){return Uh(e,t),e.reload()})))},t.Db=function(t){var e=this;return Wh(this,this.I().then((function(n){return e.a.Db(n,t)})).then((function(t){return Uh(e,t),e.reload()})))},t.Eb=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return Dh(this);var e=this;return Wh(this,this.I().then((function(n){return e.a.Eb(n,{displayName:t.displayName,photoUrl:t.photoURL})})).then((function(t){return Uh(e,t),jh(e,"displayName",t.displayName||null),jh(e,"photoURL",t.photoUrl||null),H(e.providerData,(function(t){"password"===t.providerId&&(Zr(t,"displayName",e.displayName),Zr(t,"photoURL",e.photoURL))})),Oh(e)})).then(Ch))},t.cd=function(t){var e=this;return Wh(this,Fh(this).then((function(n){return Q(Ph(e),t)?function(t,e,n){return ru(t,xs,{idToken:e,deleteProvider:n})}(e.a,n,[t]).then((function(t){var n={};return H(t.providerUserInfo||[],(function(t){n[t.providerId]=!0})),H(Ph(e),(function(t){n[t]||Lh(e,t)})),n[Fo.PROVIDER_ID]||Zr(e,"phoneNumber",null),Oh(e)})):Oh(e).then((function(){throw new A("no-such-provider")}))})))},t.delete=function(){var t=this;return Wh(this,this.I().then((function(e){return ru(t.a,Os,{idToken:e})})).then((function(){t.dispatchEvent(new uh("userDeleted"))}))).then((function(){for(var e=0;e<t.N.length;e++)t.N[e].cancel("app-deleted");wh(t,null),_h(t,null),Ih(t,null),t.N=[],t.J=!0,kh(t),Zr(t,"refreshToken",null),t.b&&Rc(t.b,t)}))},t.Gb=function(t,e){return!!("linkViaPopup"==t&&(this.g||null)==e&&this.f||"reauthViaPopup"==t&&(this.g||null)==e&&this.f||"linkViaRedirect"==t&&(this.ga||null)==e||"reauthViaRedirect"==t&&(this.ga||null)==e)},t.na=function(t,e,n,r){"linkViaPopup"!=t&&"reauthViaPopup"!=t||r!=(this.g||null)||(n&&this.C?this.C(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},t.Fa=function(t,e){return"linkViaPopup"==t&&e==(this.g||null)?E(this.Lb,this):"reauthViaPopup"==t&&e==(this.g||null)?E(this.Mb,this):"linkViaRedirect"==t&&(this.ga||null)==e?E(this.Lb,this):"reauthViaRedirect"==t&&(this.ga||null)==e?E(this.Mb,this):null},t.Ec=function(t){var e=this;return Gh(this,"linkViaPopup",t,(function(){return Vh(e,t.providerId).then((function(){return Oh(e)}))}),!1)},t.Nc=function(t){return Gh(this,"reauthViaPopup",t,(function(){return xe()}),!0)},t.Fc=function(t){var e=this;return Kh(this,"linkViaRedirect",t,(function(){return Vh(e,t.providerId)}),!1)},t.Oc=function(t){return Kh(this,"reauthViaRedirect",t,(function(){return xe()}),!0)},t.Lb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Wh(this,this.I().then((function(n){return _s(i.a,{requestUri:t,postBody:r,sessionId:e,idToken:n})})).then((function(t){return o=qh(i,t,"link"),Bh(i,t)})).then((function(){return o})))},t.Mb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Wh(this,xe().then((function(){return lo(Es(i.a,{requestUri:t,sessionId:e,postBody:r,tenantId:n}),i.uid)})).then((function(t){return o=qh(i,t,"reauthenticate"),Uh(i,t),i.i=null,i.reload()})).then((function(){return o})),!0)},t.vb=function(t){var e=this,n=null;return Wh(this,this.I().then((function(e){return n=e,void 0===t||vt(t)?{}:Bi(new Di(t))})).then((function(t){return e.a.vb(n,t)})).then((function(t){if(e.email!=t)return e.reload()})).then((function(){})))},t.Fb=function(t,e){var n=this,r=null;return Wh(this,this.I().then((function(t){return r=t,void 0===e||vt(e)?{}:Bi(new Di(e))})).then((function(e){return n.a.Fb(r,t,e)})).then((function(t){if(n.email!=t)return n.reload()})).then((function(){})))},t.jc=function(t){var e=null,n=this;return Wh(this,t=lo(xe(t),n.uid).then((function(t){return e=qh(n,t,"reauthenticate"),Uh(n,t),n.i=null,n.reload()})).then((function(){return e})),!0)},t.toJSON=function(){return this.w()},t.w=function(){var t={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&&mt(t,this.metadata.w()),H(this.providerData,(function(e){t.providerData.push(function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}(e))})),mt(t,this.S.w()),t};var Qh={name:"redirectUser",F:"session"};function Xh(t){return ic(t.b,Qh,t.a)}function Yh(t){this.a=t,this.b=ec(),this.c=null,this.f=function(t){var e=tl("local"),n=tl("session"),r=tl("none");return function(t,e,n){var r=rc(e,n),i=nc(t,e.F);return t.get(e,n).then((function(o){var a=null;try{a=Vr(u.localStorage.getItem(r))}catch(t){}if(a&&!o)return u.localStorage.removeItem(r),t.set(e,a,n);a&&o&&"localStorage"!=i.type&&u.localStorage.removeItem(r)}))}(t.b,e,t.a).then((function(){return t.b.get(n,t.a)})).then((function(i){return i?n:t.b.get(r,t.a).then((function(n){return n?r:t.b.get(e,t.a).then((function(n){return n?e:t.b.get($h,t.a).then((function(t){return t?tl(t):e}))}))}))})).then((function(e){return t.c=e,Zh(t,e.F)})).o((function(){t.c||(t.c=e)}))}(this),this.b.addListener(tl("local"),this.a,E(this.g,this))}function Zh(t,e){var n,r=[];for(n in $u)$u[n]!==e&&r.push(ic(t.b,tl($u[n]),t.a));return r.push(ic(t.b,$h,t.a)),function(t){return new Ee((function(e,n){var r=t.length,i=[];if(r)for(var o=function(t,n){r--,i[t]=n,0==r&&e(i)},a=function(t){n(t)},s=0;s<t.length;s++)Ce(t[s],I(o,s),a);else e(i)}))}(r)}Yh.prototype.g=function(){var t=this,e=tl("local");il(this,(function(){return xe().then((function(){return t.c&&"local"!=t.c.F?t.b.get(e,t.a):null})).then((function(n){if(n)return Zh(t,"local").then((function(){t.c=e}))}))}))};var $h={name:"persistence",F:"session"};function tl(t){return{name:"authUser",F:t}}function el(t,e){return il(t,(function(){return t.b.set(t.c,e.w(),t.a)}))}function nl(t){return il(t,(function(){return ic(t.b,t.c,t.a)}))}function rl(t,e,n){return il(t,(function(){return t.b.get(t.c,t.a).then((function(t){return t&&e&&(t.authDomain=e),t&&n&&(t.emulatorConfig=n),zh(t||{})}))}))}function il(t,e){return t.f=t.f.then(e,e),t.f}function ol(t){if(this.l=!1,Zr(this,"settings",new Xc),Zr(this,"app",t),!pl(this).options||!pl(this).options.apiKey)throw new A("invalid-api-key");t=r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION):null,this.a=new Ya(pl(this).options&&pl(this).options.apiKey,P(x),t),this.P=[],this.s=[],this.N=[],this.Pa=r.Z.INTERNAL.createSubscribe(E(this.zc,this)),this.W=void 0,this.ib=r.Z.INTERNAL.createSubscribe(E(this.Ac,this)),ll(this,null),this.i=new Yh(pl(this).options.apiKey+":"+pl(this).name),this.D=new Jh(pl(this).options.apiKey+":"+pl(this).name),this.$=gl(this,function(t){var e=pl(t).options.authDomain,n=function(t){var e=function(t,e){return t.b.get(Qh,t.a).then((function(t){return t&&e&&(t.authDomain=e),zh(t||{})}))}(t.D,pl(t).options.authDomain).then((function(e){return(t.m=e)&&(e.ha=t.D),Xh(t.D)}));return gl(t,e)}(t).then((function(){return rl(t.i,e,t.R)})).then((function(e){return e?(e.ha=t.D,t.m&&(t.m.ga||null)==(e.ga||null)?e:e.reload().then((function(){return el(t.i,e).then((function(){return e}))})).o((function(n){return"auth/network-request-failed"==n.code?e:nl(t.i)}))):null})).then((function(e){ll(t,e||null)}));return gl(t,n)}(this)),this.h=gl(this,function(t){return t.$.then((function(){return hl(t)})).o((function(){})).then((function(){if(!t.l)return t.ja()})).o((function(){})).then((function(){if(!t.l){t.ba=!0;var e=t.i;e.b.addListener(tl("local"),e.a,t.ja)}}))}(this)),this.ba=!1,this.ja=E(this.Zc,this),this.Ba=E(this.da,this),this.qa=E(this.mc,this),this.za=E(this.wc,this),this.Aa=E(this.xc,this),this.b=null,function(t){var e=pl(t).options.authDomain,n=pl(t).options.apiKey;e&&Rr()&&(t.Oa=t.$.then((function(){if(!t.l){if(t.b=Gc(e,n,pl(t).name,t.R),Pc(t.b,t),dl(t)&&xh(dl(t)),t.m){xh(t.m);var r=t.m;r.xa(t.la()),wh(r,t),Eh(r=t.m,t.J),Ih(r,t),bh(r=t.m,t.R),_h(r,t),t.m=null}return t.b}})))}(this),this.INTERNAL={},this.INTERNAL.delete=E(this.delete,this),this.INTERNAL.logFramework=E(this.Gc,this),this.u=0,In.call(this),function(t){Object.defineProperty(t,"lc",{get:function(){return this.la()},set:function(t){this.xa(t)},enumerable:!1}),t.aa=null,Object.defineProperty(t,"ti",{get:function(){return this.T()},set:function(t){this.zb(t)},enumerable:!1}),t.S=null,Object.defineProperty(t,"emulatorConfig",{get:function(){if(this.R){var t=qn(this.R.url);t=ti({protocol:t.c,host:t.a,port:t.g,options:ti({disableWarnings:this.R.ec})})}else t=null;return t},enumerable:!1})}(this),this.J=[],this.R=null}function al(t){Ze.call(this,"languageCodeChanged"),this.h=t}function sl(t){Ze.call(this,"emulatorConfigChanged"),this.c=t}function ul(t){Ze.call(this,"frameworkChanged"),this.f=t}function cl(t){return t.Oa||Ne(new A("auth-domain-config-required"))}function hl(t){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));var e=cl(t).then((function(){return t.b.ra()})).then((function(t){return t?ti(t):null}));return gl(t,e)}function ll(t,e){dl(t)&&(function(t,e){Y(t.W,(function(t){return t==e}))}(dl(t),t.Ba),dn(dl(t),"tokenChanged",t.qa),dn(dl(t),"userDeleted",t.za),dn(dl(t),"userInvalidated",t.Aa),kh(dl(t))),e&&(e.W.push(t.Ba),ln(e,"tokenChanged",t.qa),ln(e,"userDeleted",t.za),ln(e,"userInvalidated",t.Aa),0<t.u&&Th(e)),Zr(t,"currentUser",e),e&&(e.xa(t.la()),wh(e,t),Eh(e,t.J),Ih(e,t),bh(e,t.R),_h(e,t))}function fl(t,e){var n=null,r=null;return gl(t,e.then((function(e){return n=Vo(e),r=Yi(e),function(t,e){var n={};return n.apiKey=pl(t).options.apiKey,n.authDomain=pl(t).options.authDomain,n.appName=pl(t).name,t.R&&(n.emulatorConfig=t.R),t.$.then((function(){return function(t,e,n,r){var i=new mh(t,e);return n&&(i.ha=n),r&&Eh(i,r),i.reload().then((function(){return i}))}(n,e,t.D,t.Ga())})).then((function(e){return dl(t)&&e.uid==dl(t).uid?(Mh(dl(t),e),t.da(e)):(ll(t,e),xh(e),t.da(e))})).then((function(){yl(t)}))}(t,e)}),(function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=ih(e.w(),t,E(t.kc,t))),n||e})).then((function(){return ti({user:dl(t),credential:n,additionalUserInfo:r,operationType:"signIn"})})))}function pl(t){return t.app}function dl(t){return t.currentUser}function vl(t){return dl(t)&&dl(t)._lat||null}function yl(t){if(t.ba){for(var e=0;e<t.s.length;e++)t.s[e]&&t.s[e](vl(t));if(t.W!==t.getUid()&&t.N.length)for(t.W=t.getUid(),e=0;e<t.N.length;e++)t.N[e]&&t.N[e](vl(t))}}function gl(t,e){return t.P.push(e),e.oa((function(){X(t.P,e)})),e}function ml(){}function bl(){this.a={},this.b=1e12}Yh.prototype.yb=function(t){var e=null,n=this;return function(t){var e=new A("invalid-persistence-type"),n=new A("unsupported-persistence-type");t:{for(r in $u)if($u[r]==t){var r=!0;break t}r=!1}if(!r||"string"!=typeof t)throw e;switch(Sr()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;case"Worker":if("session"===t||!Du()&&"none"!==t)throw n;break;default:if(!Pr()&&"none"!==t)throw n}}(t),il(this,(function(){return t!=n.c.F?n.b.get(n.c,n.a).then((function(r){return e=r,Zh(n,t)})).then((function(){if(n.c=tl(t),e)return n.b.set(n.c,e,n.a)})):xe()}))},T(ol,In),T(al,Ze),T(sl,Ze),T(ul,Ze),(t=ol.prototype).yb=function(t){return gl(this,t=this.i.yb(t))},t.xa=function(t){this.aa===t||this.l||(this.aa=t,is(this.a,this.aa),this.dispatchEvent(new al(this.la())))},t.la=function(){return this.aa},t.fd=function(){var t=u.navigator;this.xa(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},t.gd=function(t,e){if(!this.R){if(!/^https?:\/\//.test(t))throw new A("argument-error","Emulator URL must start with a valid scheme (http:// or https://).");(function(t){"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),u.document&&!t&&wr().then((function(){var t=u.document.createElement("div");t.innerText="Running in emulator mode. Do not use with production credentials.",t.style.position="fixed",t.style.width="100%",t.style.backgroundColor="#ffffff",t.style.border=".1em solid #000000",t.style.color="#b50000",t.style.bottom="0px",t.style.left="0px",t.style.margin="0px",t.style.zIndex=1e4,t.style.textAlign="center",t.classList.add("firebase-emulator-warning"),u.document.body.appendChild(t)}))})(e=!!e&&!!e.disableWarnings),this.R={url:t,ec:e},this.settings.jb=!0,os(this.a,this.R),this.dispatchEvent(new sl(this.R))}},t.Gc=function(t){this.J.push(t),ss(this.a,r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION,this.J):null),this.dispatchEvent(new ul(this.J))},t.Ga=function(){return $(this.J)},t.zb=function(t){this.S===t||this.l||(this.S=t,this.a.b=this.S)},t.T=function(){return this.S},t.toJSON=function(){return{apiKey:pl(this).options.apiKey,authDomain:pl(this).options.authDomain,appName:pl(this).name,currentUser:dl(this)&&dl(this).w()}},t.Gb=function(t,e){switch(t){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==e&&!!this.f;default:return!1}},t.na=function(t,e,n,r){"signInViaPopup"==t&&this.g==r&&(n&&this.C?this.C(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},t.Fa=function(t,e){return"signInViaRedirect"==t||"signInViaPopup"==t&&this.g==e&&this.f?E(this.ic,this):null},t.ic=function(t,e,n,r){var i=this,o={requestUri:t,postBody:r,sessionId:e,tenantId:n};return this.c&&(this.c.cancel(),this.c=null),i.$.then((function(){return fl(i,ws(i.a,o))}))},t.Xc=function(t){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));var e=this,n=Xi(t.providerId),i=qr(),o=null;(!Mr()||Er())&&pl(this).options.authDomain&&t.isOAuthProvider&&(o=mu(pl(this).options.authDomain,pl(this).options.apiKey,pl(this).name,"signInViaPopup",t,null,i,r.Z.SDK_VERSION||null,null,null,this.T(),this.R));var a=gr(o,n&&n.va,n&&n.ua);return gl(this,n=cl(this).then((function(n){return Mc(n,a,"signInViaPopup",t,i,!!o,e.T())})).then((function(){return new Ee((function(t,n){e.na("signInViaPopup",null,new A("cancelled-popup-request"),e.g),e.f=t,e.C=n,e.g=i,e.c=Vc(e.b,e,"signInViaPopup",a,i)}))})).then((function(t){return a&&yr(a),t?ti(t):null})).o((function(t){throw a&&yr(a),t})))},t.Yc=function(t){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));var e=this;return gl(this,cl(this).then((function(){return function(t){return il(t,(function(){return t.b.set($h,t.c.F,t.a)}))}(e.i)})).then((function(){return Uc(e.b,"signInViaRedirect",t,void 0,e.T())})))},t.ra=function(){var t=this;return hl(this).then((function(e){return t.b&&Wc(t.b.b),e})).o((function(e){throw t.b&&Wc(t.b.b),e}))},t.dd=function(t){if(!t)return Ne(new A("null-user"));if(this.S!=t.tenantId)return Ne(new A("tenant-id-mismatch"));var e=this,n={};n.apiKey=pl(this).options.apiKey,n.authDomain=pl(this).options.authDomain,n.appName=pl(this).name;var r=function(t,e,n,r){var i=t.h,o={};return o[$a]=i.b&&i.b.toString(),o.refreshToken=i.a,e=new mh(e||{apiKey:t.l,authDomain:t.s,appName:t.m},o),n&&(e.ha=n),r&&Eh(e,r),Mh(e,t),e}(t,n,e.D,e.Ga());return gl(this,this.h.then((function(){if(pl(e).options.apiKey!=t.l)return r.reload()})).then((function(){return dl(e)&&t.uid==dl(e).uid?(Mh(dl(e),t),e.da(t)):(ll(e,r),xh(r),e.da(r))})).then((function(){yl(e)})))},t.Bb=function(){var t=this;return gl(this,this.h.then((function(){return t.b&&Wc(t.b.b),dl(t)?(ll(t,null),nl(t.i).then((function(){yl(t)}))):xe()})))},t.Zc=function(){var t=this;return rl(this.i,pl(this).options.authDomain).then((function(e){if(!t.l){var n;if(n=dl(t)&&e){n=dl(t).uid;var r=e.uid;n=null!=n&&""!==n&&null!=r&&""!==r&&n==r}if(n)return Mh(dl(t),e),dl(t).I();(dl(t)||e)&&(ll(t,e),e&&(xh(e),e.ha=t.D),t.b&&Pc(t.b,t),yl(t))}}))},t.da=function(t){return el(this.i,t)},t.mc=function(){yl(this),this.da(dl(this))},t.wc=function(){this.Bb()},t.xc=function(){this.Bb()},t.kc=function(t){var e=this;return this.h.then((function(){return fl(e,xe(t))}))},t.zc=function(t){var e=this;this.addAuthTokenListener((function(){t.next(dl(e))}))},t.Ac=function(t){var e=this;!function(t,e){t.N.push(e),gl(t,t.h.then((function(){!t.l&&Q(t.N,e)&&t.W!==t.getUid()&&(t.W=t.getUid(),e(vl(t)))})))}(this,(function(){t.next(dl(e))}))},t.Ic=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){"function"==typeof t?t(dl(r)):"function"==typeof t.next&&t.next(dl(r))})),this.Pa(t,e,n)},t.Hc=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){r.W=r.getUid(),"function"==typeof t?t(dl(r)):"function"==typeof t.next&&t.next(dl(r))})),this.ib(t,e,n)},t.nc=function(t){var e=this;return gl(this,this.h.then((function(){return dl(e)?dl(e).I(t).then((function(t){return{accessToken:t}})):null})))},t.Tc=function(t){var e=this;return this.h.then((function(){return fl(e,ru(e.a,Ys,{token:t}))})).then((function(t){var n=t.user;return jh(n,"isAnonymous",!1),e.da(n),t}))},t.Uc=function(t,e){var n=this;return this.h.then((function(){return fl(n,ru(n.a,Zs,{email:t,password:e}))}))},t.dc=function(t,e){var n=this;return this.h.then((function(){return fl(n,ru(n.a,ks,{email:t,password:e}))}))},t.ab=function(t){var e=this;return this.h.then((function(){return fl(e,t.ka(e.a))}))},t.Sc=function(t){return Xr("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.ab(t)},t.Ab=function(){var t=this;return this.h.then((function(){var e=dl(t);if(e&&e.isAnonymous){var n=ti({providerId:null,isNewUser:!1});return ti({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return fl(t,t.a.Ab()).then((function(e){var n=e.user;return jh(n,"isAnonymous",!0),t.da(n),e}))}))},t.getUid=function(){return dl(this)&&dl(this).uid||null},t.cc=function(t){this.addAuthTokenListener(t),this.u++,0<this.u&&dl(this)&&Th(dl(this))},t.Pc=function(t){var e=this;H(this.s,(function(n){n==t&&e.u--})),0>this.u&&(this.u=0),0==this.u&&dl(this)&&kh(dl(this)),this.removeAuthTokenListener(t)},t.addAuthTokenListener=function(t){var e=this;this.s.push(t),gl(this,this.h.then((function(){e.l||Q(e.s,t)&&t(vl(e))})))},t.removeAuthTokenListener=function(t){Y(this.s,(function(e){return e==t}))},t.delete=function(){this.l=!0;for(var t=0;t<this.P.length;t++)this.P[t].cancel("app-deleted");return this.P=[],this.i&&(t=this.i).b.removeListener(tl("local"),t.a,this.ja),this.b&&(Rc(this.b,this),Wc(this.b.b)),Promise.resolve()},t.hc=function(t){return gl(this,function(t,e){return ru(t,As,{identifier:e,continueUri:Lr()?fr():"http://localhost"}).then((function(t){return t.signinMethods||[]}))}(this.a,t))},t.Bc=function(t){return!!Ro(t)},t.xb=function(t,e){var n=this;return gl(this,xe().then((function(){var t=new Di(e);if(!t.c)throw new A("argument-error",Li+" must be true when sending sign in link to email");return Bi(t)})).then((function(e){return n.a.xb(t,e)})).then((function(){})))},t.jd=function(t){return this.Sa(t).then((function(t){return t.data.email}))},t.ob=function(t,e){return gl(this,this.a.ob(t,e).then((function(){})))},t.Sa=function(t){return gl(this,this.a.Sa(t).then((function(t){return new ci(t)})))},t.kb=function(t){return gl(this,this.a.kb(t).then((function(){})))},t.wb=function(t,e){var n=this;return gl(this,xe().then((function(){return void 0===e||vt(e)?{}:Bi(new Di(e))})).then((function(e){return n.a.wb(t,e)})).then((function(){})))},t.Wc=function(t,e){return gl(this,Zc(this,t,e,E(this.ab,this)))},t.Vc=function(t,e){var n=this;return gl(this,xe().then((function(){var r=e||fr(),i=Po(t,r);if(!(r=Ro(r)))throw new A("argument-error","Invalid email link!");if(r.tenantId!==n.T())throw new A("tenant-id-mismatch");return n.ab(i)})))},ml.prototype.render=function(){},ml.prototype.reset=function(){},ml.prototype.getResponse=function(){},ml.prototype.execute=function(){};var wl=null;function _l(t,e){return(e=El(e))&&t.a[e]||null}function El(t){return(t=void 0===t?1e12:t)?t.toString():null}function Il(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=he(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():ln(this.f,"click",this.i)}function Sl(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function Tl(){}function kl(){}bl.prototype.render=function(t,e){return this.a[this.b.toString()]=new Il(t,e),this.b++},bl.prototype.reset=function(t){var e=_l(this,t);t=El(t),e&&t&&(e.delete(),delete this.a[t])},bl.prototype.getResponse=function(t){return(t=_l(this,t))?t.getResponse():null},bl.prototype.execute=function(t){(t=_l(this,t))&&t.execute()},Il.prototype.getResponse=function(){return Sl(this),this.b},Il.prototype.execute=function(){Sl(this);var t=this;this.a||(this.a=setTimeout((function(){t.b=function(){for(var t=50,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}();var e=t.c.callback,n=t.c["expired-callback"];if(e)try{e(t.b)}catch(t){}t.a=setTimeout((function(){if(t.a=null,t.b=null,n)try{n()}catch(t){}t.h&&t.execute()}),6e4)}),500))},Il.prototype.delete=function(){Sl(this),this.g=!0,clearTimeout(this.a),this.a=null,dn(this.f,"click",this.i)},Zr(Tl,"FACTOR_ID","phone"),kl.prototype.g=function(){return wl||(wl=new bl),xe(wl)},kl.prototype.c=function(){};var Al=null;function Ol(){this.b=u.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var xl=new wt(St,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Nl=new Kr(3e4,6e4);Ol.prototype.g=function(t){var e=this;return new Ee((function(n,r){var i=setTimeout((function(){r(new A("network-request-failed"))}),Nl.get());!u.grecaptcha||t!==e.f&&!e.b?(u[e.a]=function(){if(u.grecaptcha){e.f=t;var o=u.grecaptcha.render;u.grecaptcha.render=function(t,n){return t=o(t,n),e.b++,t},clearTimeout(i),n(u.grecaptcha)}else clearTimeout(i),r(new A("internal-error"));delete u[e.a]},xe(Ka(Ot(xl,{onload:e.a,hl:t||""}))).o((function(){clearTimeout(i),r(new A("internal-error","Unable to load external reCAPTCHA dependencies!"))}))):(clearTimeout(i),n(u.grecaptcha))}))},Ol.prototype.c=function(){this.b--};var Cl=null;function Dl(t,e,n,r,i,o,a){if(Zr(this,"type","recaptcha"),this.c=this.f=null,this.J=!1,this.v=e,this.g=null,a?(Al||(Al=new kl),a=Al):(Cl||(Cl=new Ol),a=Cl),this.m=a,this.a=n||{theme:"light",type:"image"},this.h=[],this.a[Ll])throw new A("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[jl],!u.document)throw new A("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!he(e)||!this.i&&he(e).hasChildNodes())throw new A("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new Ya(t,o||null,i||null),this.u=r||function(){return null};var s=this;this.l=[];var c=this.a[Pl];this.a[Pl]=function(t){if(Ml(s,t),"function"==typeof c)c(t);else if("string"==typeof c){var e=Dr(c,u);"function"==typeof e&&e(t)}};var h=this.a[Rl];this.a[Rl]=function(){if(Ml(s,null),"function"==typeof h)h();else if("string"==typeof h){var t=Dr(h,u);"function"==typeof t&&t()}}}var Pl="callback",Rl="expired-callback",Ll="sitekey",jl="size";function Ml(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(t){}}function Fl(t,e){return t.h.push(e),e.oa((function(){X(t.h,e)})),e}function Ul(t){if(t.J)throw new A("internal-error","RecaptchaVerifier instance has been destroyed.")}function Vl(t,e,n){var i=!1;try{this.b=n||r.Z.app()}catch(t){throw new A("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new A("invalid-api-key");n=this.b.options.apiKey;var o=this,a=null;try{a=this.b.auth().Ga()}catch(t){}try{i=this.b.auth().settings.appVerificationDisabledForTesting}catch(t){}a=r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION,a):null,Dl.call(this,n,t,e,(function(){try{var t=o.b.auth().la()}catch(e){t=null}return t}),a,P(x),i)}function ql(t,e,n,r){t:{n=Array.prototype.slice.call(n);for(var i=0,o=!1,a=0;a<e.length;a++)if(e[a].optional)o=!0;else{if(o)throw new A("internal-error","Argument validator encountered a required argument after an optional argument.");i++}if(o=e.length,n.length<i||o<n.length)r="Expected "+(i==o?1==i?"1 argument":i+" arguments":i+"-"+o+" arguments")+" but got "+n.length+".";else{for(i=0;i<n.length;i++)if(o=e[i].optional&&void 0===n[i],!e[i].M(n[i])&&!o){if(e=e[i],0>i||i>=Bl.length)throw new A("internal-error","Argument validator received an unsupported number of arguments.");n=Bl[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.K+".";break t}r=null}}if(r)throw new A("argument-error",t+" failed: "+r)}(t=Dl.prototype).Ia=function(){var t=this;return this.f?this.f:this.f=Fl(this,xe().then((function(){if(Lr()&&!Ir())return wr();throw new A("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return t.m.g(t.u())})).then((function(e){return t.g=e,ru(t.s,Vs,{})})).then((function(e){t.a[Ll]=e.recaptchaSiteKey})).o((function(e){throw t.f=null,e})))},t.render=function(){Ul(this);var t=this;return Fl(this,this.Ia().then((function(){if(null===t.c){var e=t.v;if(!t.i){var n=he(e);e=function(t,e,n){var r=arguments,i=document,o=String(r[0]),a=r[1];if(!ce&&a&&(a.name||a.type)){if(o=["<",o],a.name&&o.push(' name="',Ht(a.name),'"'),a.type){o.push(' type="',Ht(a.type),'"');var s={};mt(s,a),delete s.type,a=s}o.push(">"),o=o.join("")}return o=ye(i,o),a&&("string"==typeof a?o.className=a:Array.isArray(a)?o.className=a.join(" "):le(o,a)),2<r.length&&ve(i,o,r),o}("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c})))},t.verify=function(){Ul(this);var t=this;return Fl(this,this.render().then((function(e){return new Ee((function(n){var r=t.g.getResponse(e);if(r)n(r);else{var i=function(e){e&&(function(t,e){Y(t.l,(function(t){return t==e}))}(t,i),n(e))};t.l.push(i),t.i&&t.g.execute(t.c)}}))})))},t.reset=function(){Ul(this),null!==this.c&&this.g.reset(this.c)},t.clear=function(){Ul(this),this.J=!0,this.m.c();for(var t=0;t<this.h.length;t++)this.h[t].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){t=he(this.v);for(var e;e=t.firstChild;)t.removeChild(e)}},T(Vl,Dl);var Bl="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Gl(t,e){return{name:t||"",K:"a valid string",optional:!!e,M:function(t){return"string"==typeof t}}}function Kl(t,e){return{name:t||"",K:"a boolean",optional:!!e,M:function(t){return"boolean"==typeof t}}}function Hl(t,e){return{name:t||"",K:"a valid object",optional:!!e,M:y}}function Wl(t,e){return{name:t||"",K:"a function",optional:!!e,M:function(t){return"function"==typeof t}}}function zl(t,e){return{name:t||"",K:"null",optional:!!e,M:function(t){return null===t}}}function Jl(t){return{name:t?t+"Credential":"credential",K:t?"a valid "+t+" credential":"a valid credential",optional:!1,M:function(e){if(!e)return!1;var n=!t||e.providerId===t;return!(!e.ka||!n)}}}function Ql(t,e){return y(t)&&"string"==typeof t.type&&t.type===e&&"function"==typeof t.Ha}function Xl(t){return y(t)&&"string"==typeof t.uid}function Yl(t,e,n,r){return{name:n||"",K:t.K+" or "+e.K,optional:!!r,M:function(n){return t.M(n)||e.M(n)}}}function Zl(t,e){for(var n in e){var r=e[n].name;t[r]=ef(r,t[n],e[n].j)}}function $l(t,e){for(var n in e){var r=e[n].name;r!==n&&Object.defineProperty(t,r,{get:I((function(t){return this[t]}),n),set:I((function(t,e,n,r){ql(t,[n],[r],!0),this[e]=r}),r,n,e[n].lb),enumerable:!0})}}function tf(t,e,n,r){t[e]=ef(e,n,r)}function ef(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return ql(o,n,t),e.apply(this,t)}if(!n)return e;var i,o=function(t){return(t=t.split("."))[t.length-1]}(t);for(i in e)r[i]=e[i];for(i in e.prototype)r.prototype[i]=e.prototype[i];return r}Zl(ol.prototype,{kb:{name:"applyActionCode",j:[Gl("code")]},Sa:{name:"checkActionCode",j:[Gl("code")]},ob:{name:"confirmPasswordReset",j:[Gl("code"),Gl("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[Gl("email"),Gl("password")]},hc:{name:"fetchSignInMethodsForEmail",j:[Gl("email")]},ra:{name:"getRedirectResult",j:[]},Bc:{name:"isSignInWithEmailLink",j:[Gl("emailLink")]},Hc:{name:"onAuthStateChanged",j:[Yl(Hl(),Wl(),"nextOrObserver"),Wl("opt_error",!0),Wl("opt_completed",!0)]},Ic:{name:"onIdTokenChanged",j:[Yl(Hl(),Wl(),"nextOrObserver"),Wl("opt_error",!0),Wl("opt_completed",!0)]},wb:{name:"sendPasswordResetEmail",j:[Gl("email"),Yl(Hl("opt_actionCodeSettings",!0),zl(null,!0),"opt_actionCodeSettings",!0)]},xb:{name:"sendSignInLinkToEmail",j:[Gl("email"),Hl("actionCodeSettings")]},yb:{name:"setPersistence",j:[Gl("persistence")]},Sc:{name:"signInAndRetrieveDataWithCredential",j:[Jl()]},Ab:{name:"signInAnonymously",j:[]},ab:{name:"signInWithCredential",j:[Jl()]},Tc:{name:"signInWithCustomToken",j:[Gl("token")]},Uc:{name:"signInWithEmailAndPassword",j:[Gl("email"),Gl("password")]},Vc:{name:"signInWithEmailLink",j:[Gl("email"),Gl("emailLink",!0)]},Wc:{name:"signInWithPhoneNumber",j:[Gl("phoneNumber"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]},Xc:{name:"signInWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Yc:{name:"signInWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},dd:{name:"updateCurrentUser",j:[Yl({name:"user",K:"an instance of Firebase User",optional:!1,M:function(t){return!!(t&&t instanceof mh)}},zl(),"user")]},Bb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Gl(null,!0)]},fd:{name:"useDeviceLanguage",j:[]},gd:{name:"useEmulator",j:[Gl("url"),Hl("options",!0)]},jd:{name:"verifyPasswordResetCode",j:[Gl("code")]}}),$l(ol.prototype,{lc:{name:"languageCode",lb:Yl(Gl(),zl(),"languageCode")},ti:{name:"tenantId",lb:Yl(Gl(),zl(),"tenantId")}}),ol.Persistence=$u,ol.Persistence.LOCAL="local",ol.Persistence.SESSION="session",ol.Persistence.NONE="none",Zl(mh.prototype,{delete:{name:"delete",j:[]},oc:{name:"getIdTokenResult",j:[Kl("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[Kl("opt_forceRefresh",!0)]},Cc:{name:"linkAndRetrieveDataWithCredential",j:[Jl()]},rb:{name:"linkWithCredential",j:[Jl()]},Dc:{name:"linkWithPhoneNumber",j:[Gl("phoneNumber"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]},Ec:{name:"linkWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Fc:{name:"linkWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Lc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[Jl()]},ub:{name:"reauthenticateWithCredential",j:[Jl()]},Mc:{name:"reauthenticateWithPhoneNumber",j:[Gl("phoneNumber"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]},Nc:{name:"reauthenticateWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Oc:{name:"reauthenticateWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},reload:{name:"reload",j:[]},vb:{name:"sendEmailVerification",j:[Yl(Hl("opt_actionCodeSettings",!0),zl(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Gl(null,!0)]},cd:{name:"unlink",j:[Gl("provider")]},Cb:{name:"updateEmail",j:[Gl("email")]},Db:{name:"updatePassword",j:[Gl("password")]},ed:{name:"updatePhoneNumber",j:[Jl("phone")]},Eb:{name:"updateProfile",j:[Hl("profile")]},Fb:{name:"verifyBeforeUpdateEmail",j:[Gl("email"),Yl(Hl("opt_actionCodeSettings",!0),zl(null,!0),"opt_actionCodeSettings",!0)]}}),Zl(bl.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Zl(ml.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Zl(Ee.prototype,{oa:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),$l(Xc.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",lb:Kl("appVerificationDisabledForTesting")}}),Zl(Yc.prototype,{confirm:{name:"confirm",j:[Gl("verificationCode")]}}),tf(ho,"fromJSON",(function(t){t="string"==typeof t?JSON.parse(t):t;for(var e,n=[mo,Co,jo,vo],r=0;r<n.length;r++)if(e=n[r](t))return e;return null}),[Yl(Gl(),Hl(),"json")]),tf(Do,"credential",(function(t,e){return new No(t,e)}),[Gl("email"),Gl("password")]),Zl(No.prototype,{w:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(Eo.prototype,{Ca:{name:"addScope",j:[Gl("scope")]},Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),tf(Eo,"credential",Io,[Yl(Gl(),Hl(),"token")]),tf(Do,"credentialWithLink",Po,[Gl("email"),Gl("emailLink")]),Zl(So.prototype,{Ca:{name:"addScope",j:[Gl("scope")]},Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),tf(So,"credential",To,[Yl(Gl(),Hl(),"token")]),Zl(ko.prototype,{Ca:{name:"addScope",j:[Gl("scope")]},Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),tf(ko,"credential",Ao,[Yl(Gl(),Yl(Hl(),zl()),"idToken"),Yl(Gl(),zl(),"accessToken",!0)]),Zl(Oo.prototype,{Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),tf(Oo,"credential",xo,[Yl(Gl(),Hl(),"token"),Gl("secret",!0)]),Zl(_o.prototype,{Ca:{name:"addScope",j:[Gl("scope")]},credential:{name:"credential",j:[Yl(Gl(),Yl(Hl(),zl()),"optionsOrIdToken"),Yl(Gl(),zl(),"accessToken",!0)]},Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),Zl(yo.prototype,{w:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(fo.prototype,{w:{name:"toJSON",j:[Gl(null,!0)]}}),tf(Fo,"credential",Uo,[Gl("verificationId"),Gl("verificationCode")]),Zl(Fo.prototype,{gb:{name:"verifyPhoneNumber",j:[Yl(Gl(),{name:"phoneInfoOptions",K:"valid phone info options",optional:!1,M:function(t){return!!t&&(t.session&&t.phoneNumber?Ql(t.session,uo)&&"string"==typeof t.phoneNumber:t.session&&t.multiFactorHint?Ql(t.session,co)&&Xl(t.multiFactorHint):t.session&&t.multiFactorUid?Ql(t.session,co)&&"string"==typeof t.multiFactorUid:!!t.phoneNumber&&"string"==typeof t.phoneNumber)}},"phoneInfoOptions"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]}}),Zl(Lo.prototype,{w:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(A.prototype,{toJSON:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(Jo.prototype,{toJSON:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(zo.prototype,{toJSON:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(rh.prototype,{toJSON:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(th.prototype,{Rc:{name:"resolveSignIn",j:[{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(t){return!!t&&!!t.tb}}]}}),Zl(ch.prototype,{Sb:{name:"getSession",j:[]},fc:{name:"enroll",j:[{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(t){return!!t&&!!t.tb}},Gl("displayName",!0)]},bd:{name:"unenroll",j:[Yl({name:"multiFactorInfo",K:"a valid multiFactorInfo",optional:!1,M:Xl},Gl(),"multiFactorInfoIdentifier")]}}),Zl(Vl.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),tf(Ii,"parseLink",Ci,[Gl("link")]),tf(Tl,"assertion",(function(t){return new sh(t)}),[Jl("phone")]),function(){if(void 0===r.Z||!r.Z.INTERNAL||!r.Z.INTERNAL.registerComponent)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var t={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:li,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:hi,VERIFY_AND_CHANGE_EMAIL:fi,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:ol,AuthCredential:ho,Error:A};tf(t,"EmailAuthProvider",Do,[]),tf(t,"FacebookAuthProvider",Eo,[]),tf(t,"GithubAuthProvider",So,[]),tf(t,"GoogleAuthProvider",ko,[]),tf(t,"TwitterAuthProvider",Oo,[]),tf(t,"OAuthProvider",_o,[Gl("providerId")]),tf(t,"SAMLAuthProvider",wo,[Gl("providerId")]),tf(t,"PhoneAuthProvider",Fo,[{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(t){return!!(t&&t instanceof ol)}}]),tf(t,"RecaptchaVerifier",Vl,[Yl(Gl(),{name:"",K:"an HTML element",optional:!1,M:function(t){return!!(t&&t instanceof Element)}},"recaptchaContainer"),Hl("recaptchaParameters",!0),{name:"app",K:"an instance of Firebase App",optional:!0,M:function(t){return!!(t&&t instanceof r.Z.app.App)}}]),tf(t,"ActionCodeURL",Ii,[]),tf(t,"PhoneMultiFactorGenerator",Tl,[]),r.Z.INTERNAL.registerComponent({name:"auth",instanceFactory:function(t){return new ol(t=t.getProvider("app").getImmediate())},multipleInstances:!1,serviceProps:t,instantiationMode:"LAZY",type:"PUBLIC",onInstanceCreated:function(t){t.getProvider("auth-internal").initialize()}}),r.Z.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(t){return{getUid:E((t=t.getProvider("auth").getImmediate()).getUid,t),getToken:E(t.nc,t),addAuthTokenListener:E(t.cc,t),removeAuthTokenListener:E(t.Pc,t)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"}),r.Z.registerVersion("@firebase/auth","0.16.8"),r.Z.INTERNAL.extendNamespace({User:mh})}()}).apply(void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},2189:function(t,e,n){n.r(e);var r=n(2249),i=n(5163),o=n(6765),a=n(3936),s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var c,h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},l=l||{},f=h||self;function p(){}function d(t){var e=typeof t;return"array"==(e="object"!=e?e:t?Array.isArray(t)?"array":e:"null")||"object"==e&&"number"==typeof t.length}function v(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var y="closure_uid_"+(1e9*Math.random()>>>0),g=0;function m(t,e,n){return t.call.apply(t.bind,arguments)}function b(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function w(t,e,n){return(w=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?m:b).apply(null,arguments)}function _(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}function E(t,e){function n(){}n.prototype=e.prototype,t.Z=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Vb=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.prototype[n].apply(t,i)}}function I(){this.s=this.s,this.o=this.o}var S={};I.prototype.s=!1,I.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0)){var t=function(t){return Object.prototype.hasOwnProperty.call(t,y)&&t[y]||(t[y]=++g)}(this);delete S[t]}},I.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()()};var T=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"==typeof t)return"string"!=typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},k=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"==typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)};function A(t){return Array.prototype.concat.apply([],arguments)}function O(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}function x(t){return/^[\s\xa0]*$/.test(t)}var N,C=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function D(t,e){return-1!=t.indexOf(e)}function P(t,e){return t<e?-1:t>e?1:0}t:{var R=f.navigator;if(R){var L=R.userAgent;if(L){N=L;break t}}N=""}function j(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function M(t){var e={};for(var n in t)e[n]=t[n];return e}var F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function U(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<F.length;o++)n=F[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function V(t){return V[" "](t),t}V[" "]=p;var q,B,G=D(N,"Opera"),K=D(N,"Trident")||D(N,"MSIE"),H=D(N,"Edge"),W=H||K,z=D(N,"Gecko")&&!(D(N.toLowerCase(),"webkit")&&!D(N,"Edge"))&&!(D(N,"Trident")||D(N,"MSIE"))&&!D(N,"Edge"),J=D(N.toLowerCase(),"webkit")&&!D(N,"Edge");function Q(){var t=f.document;return t?t.documentMode:void 0}t:{var X="",Y=(B=N,z?/rv:([^\);]+)(\)|;)/.exec(B):H?/Edge\/([\d\.]+)/.exec(B):K?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(B):J?/WebKit\/(\S+)/.exec(B):G?/(?:Version)[ \/]?(\S+)/.exec(B):void 0);if(Y&&(X=Y?Y[1]:""),K){var Z=Q();if(null!=Z&&Z>parseFloat(X)){q=String(Z);break t}}q=X}var $,tt={};function et(){return t=tt,Object.prototype.hasOwnProperty.call(t,9)?t[9]:t[9]=function(){for(var t=0,e=C(String(q)).split("."),n=C("9").split("."),r=Math.max(e.length,n.length),i=0;0==t&&i<r;i++){var o=e[i]||"",a=n[i]||"";do{if(o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==o[0].length&&0==a[0].length)break;t=P(0==o[1].length?0:parseInt(o[1],10),0==a[1].length?0:parseInt(a[1],10))||P(0==o[2].length,0==a[2].length)||P(o[2],a[2]),o=o[3],a=a[3]}while(0==t)}return 0<=t}();var t}f.document&&K?$=Q()||parseInt(q,10)||void 0:$=void 0;var nt=$,rt=function(){if(!f.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{f.addEventListener("test",p,e),f.removeEventListener("test",p,e)}catch(t){}return t}();function it(t,e){this.type=t,this.g=this.target=e,this.defaultPrevented=!1}function ot(t,e){if(it.call(this,t?t.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,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.g=e,e=t.relatedTarget){if(z){t:{try{V(e.nodeName);var i=!0;break t}catch(t){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"==typeof t.pointerType?t.pointerType:at[t.pointerType]||"",this.state=t.state,this.i=t,t.defaultPrevented&&ot.Z.h.call(this)}}it.prototype.h=function(){this.defaultPrevented=!0},E(ot,it);var at={2:"touch",3:"pen",4:"mouse"};ot.prototype.h=function(){ot.Z.h.call(this);var t=this.i;t.preventDefault?t.preventDefault():t.returnValue=!1};var st="closure_listenable_"+(1e6*Math.random()|0),ut=0;function ct(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.ia=i,this.key=++ut,this.ca=this.fa=!1}function ht(t){t.ca=!0,t.listener=null,t.proxy=null,t.src=null,t.ia=null}function lt(t){this.src=t,this.g={},this.h=0}function ft(t,e){var n=e.type;if(n in t.g){var r,i=t.g[n],o=T(i,e);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(ht(e),0==t.g[n].length&&(delete t.g[n],t.h--))}}function pt(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.ca&&o.listener==e&&o.capture==!!n&&o.ia==r)return i}return-1}lt.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.g[o])||(t=this.g[o]=[],this.h++);var a=pt(t,e,r,i);return-1<a?(e=t[a],n||(e.fa=!1)):((e=new ct(e,this.src,o,!!r,i)).fa=n,t.push(e)),e};var dt="closure_lm_"+(1e6*Math.random()|0),vt={};function yt(t,e,n,r,i){if(r&&r.once)return mt(t,e,n,r,i);if(Array.isArray(e)){for(var o=0;o<e.length;o++)yt(t,e[o],n,r,i);return null}return n=Tt(n),t&&t[st]?t.N(e,n,v(r)?!!r.capture:!!r,i):gt(t,e,n,!1,r,i)}function gt(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=v(i)?!!i.capture:!!i,s=It(t);if(s||(t[dt]=s=new lt(t)),(n=s.add(e,n,r,a,o)).proxy)return n;if(r=function(){var t=Et;return function e(n){return t.call(e.src,e.listener,n)}}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)rt||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(_t(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function mt(t,e,n,r,i){if(Array.isArray(e)){for(var o=0;o<e.length;o++)mt(t,e[o],n,r,i);return null}return n=Tt(n),t&&t[st]?t.O(e,n,v(r)?!!r.capture:!!r,i):gt(t,e,n,!0,r,i)}function bt(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)bt(t,e[o],n,r,i);else r=v(r)?!!r.capture:!!r,n=Tt(n),t&&t[st]?(t=t.i,(e=String(e).toString())in t.g&&-1<(n=pt(o=t.g[e],n,r,i))&&(ht(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.g[e],t.h--))):t&&(t=It(t))&&(e=t.g[e.toString()],t=-1,e&&(t=pt(e,n,r,i)),(n=-1<t?e[t]:null)&&wt(n))}function wt(t){if("number"!=typeof t&&t&&!t.ca){var e=t.src;if(e&&e[st])ft(e.i,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(_t(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=It(e))?(ft(n,t),0==n.h&&(n.src=null,e[dt]=null)):ht(t)}}}function _t(t){return t in vt?vt[t]:vt[t]="on"+t}function Et(t,e){if(t.ca)t=!0;else{e=new ot(e,this);var n=t.listener,r=t.ia||t.src;t.fa&&wt(t),t=n.call(r,e)}return t}function It(t){return(t=t[dt])instanceof lt?t:null}var St="__closure_events_fn_"+(1e9*Math.random()>>>0);function Tt(t){return"function"==typeof t?t:(t[St]||(t[St]=function(e){return t.handleEvent(e)}),t[St])}function kt(){I.call(this),this.i=new lt(this),this.P=this,this.I=null}function At(t,e){var n,r=t.I;if(r)for(n=[];r;r=r.I)n.push(r);if(t=t.P,r=e.type||e,"string"==typeof e)e=new it(e,t);else if(e instanceof it)e.target=e.target||t;else{var i=e;U(e=new it(r,t),i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var a=e.g=n[o];i=Ot(a,r,!0,e)&&i}if(i=Ot(a=e.g=t,r,!0,e)&&i,i=Ot(a,r,!1,e)&&i,n)for(o=0;o<n.length;o++)i=Ot(a=e.g=n[o],r,!1,e)&&i}function Ot(t,e,n,r){if(!(e=t.i.g[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.ca&&a.capture==n){var s=a.listener,u=a.ia||a.src;a.fa&&ft(t.i,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}E(kt,I),kt.prototype[st]=!0,kt.prototype.removeEventListener=function(t,e,n,r){bt(this,t,e,n,r)},kt.prototype.M=function(){if(kt.Z.M.call(this),this.i){var t,e=this.i;for(t in e.g){for(var n=e.g[t],r=0;r<n.length;r++)ht(n[r]);delete e.g[t],e.h--}}this.I=null},kt.prototype.N=function(t,e,n,r){return this.i.add(String(t),e,!1,n,r)},kt.prototype.O=function(t,e,n,r){return this.i.add(String(t),e,!0,n,r)};var xt=f.JSON.stringify;function Nt(){var t=Ft,e=null;return t.g&&(e=t.g,t.g=t.g.next,t.g||(t.h=null),e.next=null),e}var Ct,Dt=function(){function t(){this.h=this.g=null}return t.prototype.add=function(t,e){var n=Pt.get();n.set(t,e),this.h?this.h.next=n:this.g=n,this.h=n},t}(),Pt=new(function(){function t(t,e){this.i=t,this.j=e,this.h=0,this.g=null}return t.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},t}())((function(){return new Rt}),(function(t){return t.reset()})),Rt=function(){function t(){this.next=this.g=this.h=null}return t.prototype.set=function(t,e){this.h=t,this.g=e,this.next=null},t.prototype.reset=function(){this.next=this.g=this.h=null},t}();function Lt(t){f.setTimeout((function(){throw t}),0)}function jt(t,e){Ct||function(){var t=f.Promise.resolve(void 0);Ct=function(){t.then(Ut)}}(),Mt||(Ct(),Mt=!0),Ft.add(t,e)}var Mt=!1,Ft=new Dt;function Ut(){for(var t;t=Nt();){try{t.h.call(t.g)}catch(t){Lt(t)}var e=Pt;e.j(t),100>e.h&&(e.h++,t.next=e.g,e.g=t)}Mt=!1}function Vt(t,e){kt.call(this),this.h=t||1,this.g=e||f,this.j=w(this.kb,this),this.l=Date.now()}function qt(t){t.da=!1,t.S&&(t.g.clearTimeout(t.S),t.S=null)}function Bt(t,e,n){if("function"==typeof t)n&&(t=w(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=w(t.handleEvent,t)}return 2147483647<Number(e)?-1:f.setTimeout(t,e||0)}function Gt(t){t.g=Bt((function(){t.g=null,t.i&&(t.i=!1,Gt(t))}),t.j);var e=t.h;t.h=null,t.m.apply(null,e)}E(Vt,kt),(c=Vt.prototype).da=!1,c.S=null,c.kb=function(){if(this.da){var t=Date.now()-this.l;0<t&&t<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-t):(this.S&&(this.g.clearTimeout(this.S),this.S=null),At(this,"tick"),this.da&&(qt(this),this.start()))}},c.start=function(){this.da=!0,this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now())},c.M=function(){Vt.Z.M.call(this),qt(this),delete this.g};var Kt=function(t){function e(e,n){var r=t.call(this)||this;return r.m=e,r.j=n,r.h=null,r.i=!1,r.g=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.l=function(t){this.h=arguments,this.g?this.i=!0:Gt(this)},e.prototype.M=function(){t.prototype.M.call(this),this.g&&(f.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)},e}(I);function Ht(t){I.call(this),this.h=t,this.g={}}E(Ht,I);var Wt=[];function zt(t,e,n,r){Array.isArray(n)||(n&&(Wt[0]=n.toString()),n=Wt);for(var i=0;i<n.length;i++){var o=yt(e,n[i],r||t.handleEvent,!1,t.h||t);if(!o)break;t.g[o.key]=o}}function Jt(t){j(t.g,(function(t,e){this.g.hasOwnProperty(e)&&wt(t)}),t),t.g={}}function Qt(){this.g=!0}function Xt(t,e,n,r){t.info((function(){return"XMLHTTP TEXT ("+e+"): "+function(t,e){if(!t.g)return e;if(!e)return null;try{var n=JSON.parse(e);if(n)for(t=0;t<n.length;t++)if(Array.isArray(n[t])){var r=n[t];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var a=1;a<i.length;a++)i[a]=""}}}return xt(n)}catch(t){return e}}(t,n)+(r?" "+r:"")}))}Ht.prototype.M=function(){Ht.Z.M.call(this),Jt(this)},Ht.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Qt.prototype.Aa=function(){this.g=!1},Qt.prototype.info=function(){};var Yt={},Zt=null;function $t(){return Zt=Zt||new kt}function te(t){it.call(this,Yt.Ma,t)}function ee(t){var e=$t();At(e,new te(e,t))}function ne(t,e){it.call(this,Yt.STAT_EVENT,t),this.stat=e}function re(t){var e=$t();At(e,new ne(e,t))}function ie(t,e){it.call(this,Yt.Na,t),this.size=e}function oe(t,e){if("function"!=typeof t)throw Error("Fn must not be null and must be a function");return f.setTimeout((function(){t()}),e)}Yt.Ma="serverreachability",E(te,it),Yt.STAT_EVENT="statevent",E(ne,it),Yt.Na="timingevent",E(ie,it);var ae={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9},se={qb:"complete",Mb:"success",Ka:"error",Ja:"abort",Eb:"ready",Fb:"readystatechange",TIMEOUT:"timeout",Ab:"incrementaldata",Db:"progress",tb:"downloadprogress",Ub:"uploadprogress"};function ue(){}function ce(t){return t.h||(t.h=t.i())}function he(){}ue.prototype.h=null;var le,fe={OPEN:"a",pb:"b",Ka:"c",Bb:"d"};function pe(){it.call(this,"d")}function de(){it.call(this,"c")}function ve(){}function ye(t,e,n,r){this.l=t,this.j=e,this.m=n,this.X=r||1,this.V=new Ht(this),this.P=me,t=W?125:void 0,this.W=new Vt(t),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 ge}function ge(){this.i=null,this.g="",this.h=!1}E(pe,it),E(de,it),E(ve,ue),ve.prototype.g=function(){return new XMLHttpRequest},ve.prototype.i=function(){return{}},le=new ve;var me=45e3,be={},we={};function _e(t,e,n){t.K=1,t.v=Ke(Fe(e)),t.s=n,t.U=!0,Ee(t,null)}function Ee(t,e){t.F=Date.now(),ke(t),t.A=Fe(t.v);var n=t.A,r=t.X;Array.isArray(r)||(r=[String(r)]),rn(n.h,"t",r),t.C=0,n=t.l.H,t.h=new ge,t.g=or(t.l,n?e:null,!t.s),0<t.O&&(t.L=new Kt(w(t.Ia,t,t.g),t.O)),zt(t.V,t.g,"readystatechange",t.gb),e=t.H?M(t.H):{},t.s?(t.u||(t.u="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.g.ea(t.A,t.u,t.s,e)):(t.u="GET",t.g.ea(t.A,t.u,null,e)),ee(1),function(t,e,n,r,i,o){t.info((function(){if(t.g)if(o)for(var a="",s=o.split("&"),u=0;u<s.length;u++){var c=s[u].split("=");if(1<c.length){var h=c[0];c=c[1];var l=h.split("_");a=2<=l.length&&"type"==l[1]?a+(h+"=")+c+"&":a+(h+"=redacted&")}}else a=null;else a=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+e+"\n"+n+"\n"+a}))}(t.j,t.u,t.A,t.m,t.X,t.s)}function Ie(t){return!!t.g&&"GET"==t.u&&2!=t.K&&t.l.Ba}function Se(t,e,n){for(var r,i=!0;!t.I&&t.C<n.length;){if((r=Te(t,n))==we){4==e&&(t.o=4,re(14),i=!1),Xt(t.j,t.m,null,"[Incomplete Response]");break}if(r==be){t.o=4,re(15),Xt(t.j,t.m,n,"[Invalid Chunk]"),i=!1;break}Xt(t.j,t.m,r,null),Ce(t,r)}Ie(t)&&r!=we&&r!=be&&(t.h.g="",t.C=0),4!=e||0!=n.length||t.h.h||(t.o=1,re(16),i=!1),t.i=t.i&&i,i?0<n.length&&!t.aa&&(t.aa=!0,(e=t.l).g==t&&e.$&&!e.L&&(e.h.info("Great, no buffering proxy detected. Bytes received: "+n.length),Yn(e),e.L=!0,re(11))):(Xt(t.j,t.m,n,"[Invalid Chunked Response]"),Ne(t),xe(t))}function Te(t,e){var n=t.C,r=e.indexOf("\n",n);return-1==r?we:(n=Number(e.substring(n,r)),isNaN(n)?be:(r+=1)+n>e.length?we:(e=e.substr(r,n),t.C=r+n,e))}function ke(t){t.Y=Date.now()+t.P,Ae(t,t.P)}function Ae(t,e){if(null!=t.B)throw Error("WatchDog timer not null");t.B=oe(w(t.eb,t),e)}function Oe(t){t.B&&(f.clearTimeout(t.B),t.B=null)}function xe(t){0==t.l.G||t.I||tr(t.l,t)}function Ne(t){Oe(t);var e=t.L;e&&"function"==typeof e.na&&e.na(),t.L=null,qt(t.W),Jt(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function Ce(t,e){try{var n=t.l;if(0!=n.G&&(n.g==t||ln(n.i,t)))if(n.I=t.N,!t.J&&ln(n.i,t)&&3==n.G){try{var r=n.Ca.g.parse(e)}catch(o){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){t:if(!n.u){if(n.g){if(!(n.g.F+3e3<t.F))break t;$n(n),Bn(n)}Xn(n),re(18)}}else n.ta=i[1],0<n.ta-n.U&&37500>i[2]&&n.N&&0==n.A&&!n.v&&(n.v=oe(w(n.ab,n),6e3));if(1>=hn(n.i)&&n.ka){try{n.ka()}catch(o){}n.ka=void 0}}else nr(n,11)}else if((t.J||n.g==t)&&$n(n),!x(e))for(i=n.Ca.g.parse(e),e=0;e<i.length;e++){var o=i[e];if(n.U=o[0],o=o[1],2==n.G)if("c"==o[0]){n.J=o[1],n.la=o[2];var a=o[3];null!=a&&(n.ma=a,n.h.info("VER="+n.ma));var s=o[4];null!=s&&(n.za=s,n.h.info("SVER="+n.za));var u=o[5];null!=u&&"number"==typeof u&&0<u&&(r=1.5*u,n.K=r,n.h.info("backChannelRequestTimeoutMs_="+r)),r=n;var c=t.g;if(c){var h=c.g?c.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(h){var l=r.i;!l.g&&(D(h,"spdy")||D(h,"quic")||D(h,"h2"))&&(l.j=l.l,l.g=new Set,l.h&&(fn(l,l.h),l.h=null))}if(r.D){var f=c.g?c.g.getResponseHeader("X-HTTP-Session-Id"):null;f&&(r.sa=f,Ge(r.F,r.D,f))}}n.G=3,n.j&&n.j.xa(),n.$&&(n.O=Date.now()-t.F,n.h.info("Handshake RTT: "+n.O+"ms"));var p=t;if((r=n).oa=ir(r,r.H?r.la:null,r.W),p.J){pn(r.i,p);var d=p,v=r.K;v&&d.setTimeout(v),d.B&&(Oe(d),ke(d)),r.g=p}else Qn(r);0<n.l.length&&Hn(n)}else"stop"!=o[0]&&"close"!=o[0]||nr(n,7);else 3==n.G&&("stop"==o[0]||"close"==o[0]?"stop"==o[0]?nr(n,7):qn(n):"noop"!=o[0]&&n.j&&n.j.wa(o),n.A=0)}ee(4)}catch(o){}}function De(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(d(t)||"string"==typeof t)k(t,e,void 0);else{if(t.T&&"function"==typeof t.T)var n=t.T();else if(t.R&&"function"==typeof t.R)n=void 0;else if(d(t)||"string"==typeof t){n=[];for(var r=t.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,t)n[r++]=i;i=(r=function(t){if(t.R&&"function"==typeof t.R)return t.R();if("string"==typeof t)return t.split("");if(d(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}(t)).length;for(var o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}}function Pe(t,e){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 r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof Pe)for(n=t.T(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Re(t){if(t.i!=t.g.length){for(var e=0,n=0;e<t.g.length;){var r=t.g[e];Le(t.h,r)&&(t.g[n++]=r),e++}t.g.length=n}if(t.i!=t.g.length){var i={};for(n=e=0;e<t.g.length;)Le(i,r=t.g[e])||(t.g[n++]=r,i[r]=1),e++;t.g.length=n}}function Le(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(c=ye.prototype).setTimeout=function(t){this.P=t},c.gb=function(t){t=t.target;var e=this.L;e&&3==jn(t)?e.l():this.Ia(t)},c.Ia=function(t){try{if(t==this.g)t:{var e=jn(this.g),n=this.g.Da(),r=this.g.ba();if(!(3>e)&&(3!=e||W||this.g&&(this.h.h||this.g.ga()||Mn(this.g)))){this.I||4!=e||7==n||ee(8==n||0>=r?3:2),Oe(this);var i=this.g.ba();this.N=i;e:if(Ie(this)){var o=Mn(this.g);t="";var a=o.length,s=4==jn(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){Ne(this),xe(this);var u="";break e}this.h.i=new f.TextDecoder}for(n=0;n<a;n++)this.h.h=!0,t+=this.h.i.decode(o[n],{stream:s&&n==a-1});o.splice(0,a),this.h.g+=t,this.C=0,u=this.h.g}else u=this.g.ga();if(this.i=200==i,function(t,e,n,r,i,o,a){t.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+e+"\n"+n+"\n"+o+" "+a}))}(this.j,this.u,this.A,this.m,this.X,e,i),this.i){if(this.$&&!this.J){e:{if(this.g){var c,h=this.g;if((c=h.g?h.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!x(c)){var l=c;break e}}l=null}if(!(i=l)){this.i=!1,this.o=3,re(12),Ne(this),xe(this);break t}Xt(this.j,this.m,i,"Initial handshake response via X-HTTP-Initial-Response"),this.J=!0,Ce(this,i)}this.U?(Se(this,e,u),W&&this.i&&3==e&&(zt(this.V,this.W,"tick",this.fb),this.W.start())):(Xt(this.j,this.m,u,null),Ce(this,u)),4==e&&Ne(this),this.i&&!this.I&&(4==e?tr(this.l,this):(this.i=!1,ke(this)))}else 400==i&&0<u.indexOf("Unknown SID")?(this.o=3,re(12)):(this.o=0,re(13)),Ne(this),xe(this)}}}catch(e){}},c.fb=function(){if(this.g){var t=jn(this.g),e=this.g.ga();this.C<e.length&&(Oe(this),Se(this,t,e),this.i&&4!=t&&ke(this))}},c.cancel=function(){this.I=!0,Ne(this)},c.eb=function(){this.B=null;var t=Date.now();0<=t-this.Y?(function(t,e){t.info((function(){return"TIMEOUT: "+e}))}(this.j,this.A),2!=this.K&&(ee(3),re(17)),Ne(this),this.o=2,xe(this)):Ae(this,this.Y-t)},(c=Pe.prototype).R=function(){Re(this);for(var t=[],e=0;e<this.g.length;e++)t.push(this.h[this.g[e]]);return t},c.T=function(){return Re(this),this.g.concat()},c.get=function(t,e){return Le(this.h,t)?this.h[t]:e},c.set=function(t,e){Le(this.h,t)||(this.i++,this.g.push(t)),this.h[t]=e},c.forEach=function(t,e){for(var n=this.T(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var je=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Me(t,e){if(this.i=this.s=this.j="",this.m=null,this.o=this.l="",this.g=!1,t instanceof Me){this.g=void 0!==e?e:t.g,Ue(this,t.j),this.s=t.s,Ve(this,t.i),qe(this,t.m),this.l=t.l,e=t.h;var n=new $e;n.i=e.i,e.g&&(n.g=new Pe(e.g),n.h=e.h),Be(this,n),this.o=t.o}else t&&(n=String(t).match(je))?(this.g=!!e,Ue(this,n[1]||"",!0),this.s=He(n[2]||""),Ve(this,n[3]||"",!0),qe(this,n[4]),this.l=He(n[5]||"",!0),Be(this,n[6]||"",!0),this.o=He(n[7]||"")):(this.g=!!e,this.h=new $e(null,this.g))}function Fe(t){return new Me(t)}function Ue(t,e,n){t.j=n?He(e,!0):e,t.j&&(t.j=t.j.replace(/:$/,""))}function Ve(t,e,n){t.i=n?He(e,!0):e}function qe(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.m=e}else t.m=null}function Be(t,e,n){e instanceof $e?(t.h=e,function(t,e){e&&!t.j&&(tn(t),t.i=null,t.g.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(en(this,e),rn(this,n,t))}),t)),t.j=e}(t.h,t.g)):(n||(e=We(e,Ye)),t.h=new $e(e,t.g))}function Ge(t,e,n){t.h.set(e,n)}function Ke(t){return Ge(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function He(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function We(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,ze),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function ze(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Me.prototype.toString=function(){var t=[],e=this.j;e&&t.push(We(e,Je,!0),":");var n=this.i;return(n||"file"==e)&&(t.push("//"),(e=this.s)&&t.push(We(e,Je,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&t.push(":",String(n))),(n=this.l)&&(this.i&&"/"!=n.charAt(0)&&t.push("/"),t.push(We(n,"/"==n.charAt(0)?Xe:Qe,!0))),(n=this.h.toString())&&t.push("?",n),(n=this.o)&&t.push("#",We(n,Ze)),t.join("")};var Je=/[#\/\?@]/g,Qe=/[#\?:]/g,Xe=/[#\?]/g,Ye=/[#\?@]/g,Ze=/#/g;function $e(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function tn(t){t.g||(t.g=new Pe,t.h=0,t.i&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.i,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function en(t,e){tn(t),e=on(t,e),Le(t.g.h,e)&&(t.i=null,t.h-=t.g.get(e).length,Le((t=t.g).h,e)&&(delete t.h[e],t.i--,t.g.length>2*t.i&&Re(t)))}function nn(t,e){return tn(t),e=on(t,e),Le(t.g.h,e)}function rn(t,e,n){en(t,e),0<n.length&&(t.i=null,t.g.set(on(t,e),O(n)),t.h+=n.length)}function on(t,e){return e=String(e),t.j&&(e=e.toLowerCase()),e}(c=$e.prototype).add=function(t,e){tn(this),this.i=null,t=on(this,t);var n=this.g.get(t);return n||this.g.set(t,n=[]),n.push(e),this.h+=1,this},c.forEach=function(t,e){tn(this),this.g.forEach((function(n,r){k(n,(function(n){t.call(e,n,r,this)}),this)}),this)},c.T=function(){tn(this);for(var t=this.g.R(),e=this.g.T(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},c.R=function(t){tn(this);var e=[];if("string"==typeof t)nn(this,t)&&(e=A(e,this.g.get(on(this,t))));else{t=this.g.R();for(var n=0;n<t.length;n++)e=A(e,t[n])}return e},c.set=function(t,e){return tn(this),this.i=null,nn(this,t=on(this,t))&&(this.h-=this.g.get(t).length),this.g.set(t,[e]),this.h+=1,this},c.get=function(t,e){return t&&0<(t=this.R(t)).length?String(t[0]):e},c.toString=function(){if(this.i)return this.i;if(!this.g)return"";for(var t=[],e=this.g.T(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.R(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.i=t.join("&")};var an=function(t,e){this.h=t,this.g=e};function sn(t){this.l=t||un,t=f.PerformanceNavigationTiming?0<(t=f.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):!!(f.g&&f.g.Ea&&f.g.Ea()&&f.g.Ea().Zb),this.j=t?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var un=10;function cn(t){return!!t.h||!!t.g&&t.g.size>=t.j}function hn(t){return t.h?1:t.g?t.g.size:0}function ln(t,e){return t.h?t.h==e:!!t.g&&t.g.has(e)}function fn(t,e){t.g?t.g.add(e):t.h=e}function pn(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function dn(t){var e,n;if(null!=t.h)return t.i.concat(t.h.D);if(null!=t.g&&0!==t.g.size){var r=t.i;try{for(var i=u(t.g.values()),o=i.next();!o.done;o=i.next()){var a=o.value;r=r.concat(a.D)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}return O(t.i)}function vn(){}function yn(){this.g=new vn}function gn(t,e,n){var r=n||"";try{De(t,(function(t,n){var i=t;v(t)&&(i=xt(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(t){throw e.push(r+"type="+encodeURIComponent("_badmap")),t}}function mn(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(t){}}function bn(t){this.l=t.$b||null,this.j=t.ib||!1}function wn(t,e){kt.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=_n,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}sn.prototype.cancel=function(){var t,e;if(this.i=dn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){try{for(var n=u(this.g.values()),r=n.next();!r.done;r=n.next())r.value.cancel()}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.g.clear()}},vn.prototype.stringify=function(t){return f.JSON.stringify(t,void 0)},vn.prototype.parse=function(t){return f.JSON.parse(t,void 0)},E(bn,ue),bn.prototype.g=function(){return new wn(this.l,this.j)},bn.prototype.i=function(t){return function(){return t}}({}),E(wn,kt);var _n=0;function En(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}function In(t){t.readyState=4,t.l=null,t.j=null,t.A=null,Sn(t)}function Sn(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(c=wn.prototype).open=function(t,e){if(this.readyState!=_n)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,Sn(this)},c.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;var e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||f).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))},c.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&&4!=this.readyState&&(this.g=!1,In(this)),this.readyState=_n},c.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Sn(this)),this.g&&(this.readyState=3,Sn(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==f.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;En(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))},c.Sa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?In(this):Sn(this),3==this.readyState&&En(this)}},c.Ua=function(t){this.g&&(this.response=this.responseText=t,In(this))},c.Ta=function(t){this.g&&(this.response=t,In(this))},c.ha=function(){this.g&&In(this)},c.setRequestHeader=function(t,e){this.v.append(t,e)},c.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},c.getAllResponseHeaders=function(){if(!this.h)return"";for(var t=[],e=this.h.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(wn.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var Tn=f.JSON.parse;function kn(t){kt.call(this),this.headers=new Pe,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=An,this.K=this.L=!1}E(kn,kt);var An="",On=/^https?$/i,xn=["POST","PUT"];function Nn(t){return"content-type"==t.toLowerCase()}function Cn(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,Dn(t),Rn(t)}function Dn(t){t.D||(t.D=!0,At(t,"complete"),At(t,"error"))}function Pn(t){if(t.h&&void 0!==l&&(!t.C[1]||4!=jn(t)||2!=t.ba()))if(t.v&&4==jn(t))Bt(t.Fa,0,t);else if(At(t,"readystatechange"),4==jn(t)){t.h=!1;try{var e,n=t.ba();t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.H).match(je)[1]||null;if(!o&&f.self&&f.self.location){var a=f.self.location.protocol;o=a.substr(0,a.length-1)}i=!On.test(o?o.toLowerCase():"")}e=i}if(e)At(t,"complete"),At(t,"success");else{t.m=6;try{var s=2<jn(t)?t.g.statusText:""}catch(t){s=""}t.j=s+" ["+t.ba()+"]",Dn(t)}}finally{Rn(t)}}}function Rn(t,e){if(t.g){Ln(t);var n=t.g,r=t.C[0]?p:null;t.g=null,t.C=null,e||At(t,"ready");try{n.onreadystatechange=r}catch(t){}}}function Ln(t){t.g&&t.K&&(t.g.ontimeout=null),t.A&&(f.clearTimeout(t.A),t.A=null)}function jn(t){return t.g?t.g.readyState:0}function Mn(t){try{if(!t.g)return null;if("response"in t.g)return t.g.response;switch(t.J){case An:case"text":return t.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in t.g)return t.g.mozResponseArrayBuffer}return null}catch(t){return null}}function Fn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=function(t){var e="";return j(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}(n),"string"==typeof t?null!=n&&encodeURIComponent(String(n)):Ge(t,e,n))}function Un(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function Vn(t){this.za=0,this.l=[],this.h=new Qt,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=Un("failFast",!1,t),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=Un("baseRetryDelayMs",5e3,t),this.$a=Un("retryDelaySeedMs",1e4,t),this.Ya=Un("forwardChannelMaxRetries",2,t),this.ra=Un("forwardChannelRequestTimeoutMs",2e4,t),this.qa=t&&t.xmlHttpFactory||void 0,this.Ba=t&&t.Yb||!1,this.K=void 0,this.H=t&&t.supportsCrossDomainXhr||!1,this.J="",this.i=new sn(t&&t.concurrentRequestLimit),this.Ca=new yn,this.ja=t&&t.fastHandshake||!1,this.Ra=t&&t.Wb||!1,t&&t.Aa&&this.h.Aa(),t&&t.forceLongPolling&&(this.X=!1),this.$=!this.ja&&this.X&&t&&t.detectBufferingProxy||!1,this.ka=void 0,this.O=0,this.L=!1,this.B=null,this.Wa=!t||!1!==t.Xb}function qn(t){if(Gn(t),3==t.G){var e=t.V++,n=Fe(t.F);Ge(n,"SID",t.J),Ge(n,"RID",e),Ge(n,"TYPE","terminate"),zn(t,n),(e=new ye(t,t.h,e,void 0)).K=2,e.v=Ke(Fe(n)),n=!1,f.navigator&&f.navigator.sendBeacon&&(n=f.navigator.sendBeacon(e.v.toString(),"")),!n&&f.Image&&((new Image).src=e.v,n=!0),n||(e.g=or(e.l,null),e.g.ea(e.v)),e.F=Date.now(),ke(e)}rr(t)}function Bn(t){t.g&&(Yn(t),t.g.cancel(),t.g=null)}function Gn(t){Bn(t),t.u&&(f.clearTimeout(t.u),t.u=null),$n(t),t.i.cancel(),t.m&&("number"==typeof t.m&&f.clearTimeout(t.m),t.m=null)}function Kn(t,e){t.l.push(new an(t.Za++,e)),3==t.G&&Hn(t)}function Hn(t){cn(t.i)||t.m||(t.m=!0,jt(t.Ha,t),t.C=0)}function Wn(t,e){var n;n=e?e.m:t.V++;var r=Fe(t.F);Ge(r,"SID",t.J),Ge(r,"RID",n),Ge(r,"AID",t.U),zn(t,r),t.o&&t.s&&Fn(r,t.o,t.s),n=new ye(t,t.h,n,t.C+1),null===t.o&&(n.H=t.s),e&&(t.l=e.D.concat(t.l)),e=Jn(t,n,1e3),n.setTimeout(Math.round(.5*t.ra)+Math.round(.5*t.ra*Math.random())),fn(t.i,n),_e(n,r,e)}function zn(t,e){t.j&&De({},(function(t,n){Ge(e,n,t)}))}function Jn(t,e,n){n=Math.min(t.l.length,n);var r=t.j?w(t.j.Oa,t.j,t):null;t:for(var i=t.l,o=-1;;){var a=["count="+n];-1==o?0<n?(o=i[0].h,a.push("ofs="+o)):o=0:a.push("ofs="+o);for(var s=!0,u=0;u<n;u++){var c=i[u].h,h=i[u].g;if(0>(c-=o))o=Math.max(0,i[u].h-100),s=!1;else try{gn(h,a,"req"+c+"_")}catch(t){r&&r(h)}}if(s){r=a.join("&");break t}}return t=t.l.splice(0,n),e.D=t,r}function Qn(t){t.g||t.u||(t.Y=1,jt(t.Ga,t),t.A=0)}function Xn(t){return!(t.g||t.u||3<=t.A||(t.Y++,t.u=oe(w(t.Ga,t),er(t,t.A)),t.A++,0))}function Yn(t){null!=t.B&&(f.clearTimeout(t.B),t.B=null)}function Zn(t){t.g=new ye(t,t.h,"rpc",t.Y),null===t.o&&(t.g.H=t.s),t.g.O=0;var e=Fe(t.oa);Ge(e,"RID","rpc"),Ge(e,"SID",t.J),Ge(e,"CI",t.N?"0":"1"),Ge(e,"AID",t.U),zn(t,e),Ge(e,"TYPE","xmlhttp"),t.o&&t.s&&Fn(e,t.o,t.s),t.K&&t.g.setTimeout(t.K);var n=t.g;t=t.la,n.K=1,n.v=Ke(Fe(e)),n.s=null,n.U=!0,Ee(n,t)}function $n(t){null!=t.v&&(f.clearTimeout(t.v),t.v=null)}function tr(t,e){var n=null;if(t.g==e){$n(t),Yn(t),t.g=null;var r=2}else{if(!ln(t.i,e))return;n=e.D,pn(t.i,e),r=1}if(t.I=e.N,0!=t.G)if(e.i)if(1==r){n=e.s?e.s.length:0,e=Date.now()-e.F;var i=t.C;At(r=$t(),new ie(r,n,e,i)),Hn(t)}else Qn(t);else if(3==(i=e.o)||0==i&&0<t.I||!(1==r&&function(t,e){return!(hn(t.i)>=t.i.j-(t.m?1:0)||(t.m?(t.l=e.D.concat(t.l),0):1==t.G||2==t.G||t.C>=(t.Xa?0:t.Ya)||(t.m=oe(w(t.Ha,t,e),er(t,t.C)),t.C++,0)))}(t,e)||2==r&&Xn(t)))switch(n&&0<n.length&&(e=t.i,e.i=e.i.concat(n)),i){case 1:nr(t,5);break;case 4:nr(t,10);break;case 3:nr(t,6);break;default:nr(t,2)}}function er(t,e){var n=t.Pa+Math.floor(Math.random()*t.$a);return t.j||(n*=2),n*e}function nr(t,e){if(t.h.info("Error code "+e),2==e){var n=null;t.j&&(n=null);var r=w(t.jb,t);n||(n=new Me("//www.google.com/images/cleardot.gif"),f.location&&"http"==f.location.protocol||Ue(n,"https"),Ke(n)),function(t,e){var n=new Qt;if(f.Image){var r=new Image;r.onload=_(mn,n,r,"TestLoadImage: loaded",!0,e),r.onerror=_(mn,n,r,"TestLoadImage: error",!1,e),r.onabort=_(mn,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=_(mn,n,r,"TestLoadImage: timeout",!1,e),f.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}else e(!1)}(n.toString(),r)}else re(2);t.G=0,t.j&&t.j.va(e),rr(t),Gn(t)}function rr(t){t.G=0,t.I=-1,t.j&&(0==dn(t.i).length&&0==t.l.length||(t.i.i.length=0,O(t.l),t.l.length=0),t.j.ua())}function ir(t,e,n){var r=function(t){return t instanceof Me?Fe(t):new Me(t,void 0)}(n);if(""!=r.i)e&&Ve(r,e+"."+r.i),qe(r,r.m);else{var i=f.location;r=function(t,e,n,r){var i=new Me(null,void 0);return t&&Ue(i,t),e&&Ve(i,e),n&&qe(i,n),r&&(i.l=r),i}(i.protocol,e?e+"."+i.hostname:i.hostname,+i.port,n)}return t.aa&&j(t.aa,(function(t,e){Ge(r,e,t)})),e=t.D,n=t.sa,e&&n&&Ge(r,e,n),Ge(r,"VER",t.ma),zn(t,r),r}function or(t,e,n){if(e&&!t.H)throw Error("Can't create secondary domain capable XhrIo object.");return(e=n&&t.Ba&&!t.qa?new kn(new bn({ib:!0})):new kn(t.qa)).L=t.H,e}function ar(){}function sr(){if(K&&!(10<=Number(nt)))throw Error("Environmental error: no available transport.")}function ur(t,e){kt.call(this),this.g=new Vn(e),this.l=t,this.h=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.g.s=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.ya&&(t?t["X-WebChannel-Client-Profile"]=e.ya:t={"X-WebChannel-Client-Profile":e.ya}),this.g.P=t,(t=e&&e.httpHeadersOverwriteParam)&&!x(t)&&(this.g.o=t),this.A=e&&e.supportsCrossDomainXhr||!1,this.v=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!x(e)&&(this.g.D=e,null!==(t=this.h)&&e in t&&e in(t=this.h)&&delete t[e]),this.j=new lr(this)}function cr(t){pe.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.i=t)&&(t=this.i,e=null!==e&&t in e?e[t]:void 0),this.data=e}else this.data=t}function hr(){de.call(this),this.status=1}function lr(t){this.g=t}(c=kn.prototype).ea=function(t,e,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+t);e=e?e.toUpperCase():"GET",this.H=t,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():le.g(),this.C=this.u?ce(this.u):ce(le),this.g.onreadystatechange=w(this.Fa,this);try{this.F=!0,this.g.open(e,String(t),!0),this.F=!1}catch(t){return void Cn(this,t)}t=n||"";var i=new Pe(this.headers);r&&De(r,(function(t,e){i.set(e,t)})),r=function(t){t:{for(var e=Nn,n=t.length,r="string"==typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"==typeof t?t.charAt(e):t[e]}(i.T()),n=f.FormData&&t instanceof f.FormData,!(0<=T(xn,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(t,e){this.g.setRequestHeader(e,t)}),this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ln(this),0<this.B&&((this.K=function(t){return K&&et()&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(this.g))?(this.g.timeout=this.B,this.g.ontimeout=w(this.pa,this)):this.A=Bt(this.pa,this.B,this)),this.v=!0,this.g.send(t),this.v=!1}catch(t){Cn(this,t)}},c.pa=function(){void 0!==l&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,At(this,"timeout"),this.abort(8))},c.abort=function(t){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=t||7,At(this,"complete"),At(this,"abort"),Rn(this))},c.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Rn(this,!0)),kn.Z.M.call(this)},c.Fa=function(){this.s||(this.F||this.v||this.l?Pn(this):this.cb())},c.cb=function(){Pn(this)},c.ba=function(){try{return 2<jn(this)?this.g.status:-1}catch(t){return-1}},c.ga=function(){try{return this.g?this.g.responseText:""}catch(t){return""}},c.Qa=function(t){if(this.g){var e=this.g.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),Tn(e)}},c.Da=function(){return this.m},c.La=function(){return"string"==typeof this.j?this.j:String(this.j)},(c=Vn.prototype).ma=8,c.G=1,c.hb=function(t){try{this.h.info("Origin Trials invoked: "+t)}catch(t){}},c.Ha=function(t){if(this.m)if(this.m=null,1==this.G){if(!t){this.V=Math.floor(1e5*Math.random()),t=this.V++;var e=new ye(this,this.h,t,void 0),n=this.s;if(this.P&&(n?U(n=M(n),this.P):n=this.P),null===this.o&&(e.H=n),this.ja)t:{for(var r=0,i=0;i<this.l.length;i++){var o=this.l[i];if(void 0===(o="__data__"in o.g&&"string"==typeof(o=o.g.__data__)?o.length:void 0))break;if(4096<(r+=o)){r=i;break t}if(4096===r||i===this.l.length-1){r=i+1;break t}}r=1e3}else r=1e3;r=Jn(this,e,r),Ge(i=Fe(this.F),"RID",t),Ge(i,"CVER",22),this.D&&Ge(i,"X-HTTP-Session-Id",this.D),zn(this,i),this.o&&n&&Fn(i,this.o,n),fn(this.i,e),this.Ra&&Ge(i,"TYPE","init"),this.ja?(Ge(i,"$req",r),Ge(i,"SID","null"),e.$=!0,_e(e,i,null)):_e(e,i,r),this.G=2}}else 3==this.G&&(t?Wn(this,t):0==this.l.length||cn(this.i)||Wn(this))},c.Ga=function(){if(this.u=null,Zn(this),this.$&&!(this.L||null==this.g||0>=this.O)){var t=2*this.O;this.h.info("BP detection timer enabled: "+t),this.B=oe(w(this.bb,this),t)}},c.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,re(10),Bn(this),Zn(this))},c.ab=function(){null!=this.v&&(this.v=null,Bn(this),Xn(this),re(19))},c.jb=function(t){t?(this.h.info("Successfully pinged google.com"),re(2)):(this.h.info("Failed to ping google.com"),re(1))},(c=ar.prototype).xa=function(){},c.wa=function(){},c.va=function(){},c.ua=function(){},c.Oa=function(){},sr.prototype.g=function(t,e){return new ur(t,e)},E(ur,kt),ur.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var t=this.g,e=this.l,n=this.h||void 0;t.Wa&&(t.h.info("Origin Trials enabled."),jt(w(t.hb,t,e))),re(0),t.W=e,t.aa=n||{},t.N=t.X,t.F=ir(t,null,t.W),Hn(t)},ur.prototype.close=function(){qn(this.g)},ur.prototype.u=function(t){if("string"==typeof t){var e={};e.__data__=t,Kn(this.g,e)}else this.v?((e={}).__data__=xt(t),Kn(this.g,e)):Kn(this.g,t)},ur.prototype.M=function(){this.g.j=null,delete this.j,qn(this.g),delete this.g,ur.Z.M.call(this)},E(cr,pe),E(hr,de),E(lr,ar),lr.prototype.xa=function(){At(this.g,"a")},lr.prototype.wa=function(t){At(this.g,new cr(t))},lr.prototype.va=function(t){At(this.g,new hr(t))},lr.prototype.ua=function(){At(this.g,"b")},sr.prototype.createWebChannel=sr.prototype.g,ur.prototype.send=ur.prototype.u,ur.prototype.open=ur.prototype.m,ur.prototype.close=ur.prototype.close,ae.NO_ERROR=0,ae.TIMEOUT=8,ae.HTTP_ERROR=6,se.COMPLETE="complete",he.EventType=fe,fe.OPEN="a",fe.CLOSE="b",fe.ERROR="c",fe.MESSAGE="d",kt.prototype.listen=kt.prototype.N,kn.prototype.listenOnce=kn.prototype.O,kn.prototype.getLastError=kn.prototype.La,kn.prototype.getLastErrorCode=kn.prototype.Da,kn.prototype.getStatus=kn.prototype.ba,kn.prototype.getResponseJson=kn.prototype.Qa,kn.prototype.getResponseText=kn.prototype.ga,kn.prototype.send=kn.prototype.ea;var fr=ae,pr=se,dr=Yt,vr=10,yr=11,gr=bn,mr=he,br=kn,wr=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.sequenceNumberHandler=function(t){return n.t(t)},this.i=function(t){return e.writeSequenceNumber(t)})}return t.prototype.t=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.i&&this.i(t),t},t}();wr.o=-1;var _r={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"},Er=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).code=e,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return(0,i.ZT)(e,t),e}(Error),Ir=new a.Yd("@firebase/firestore");function Sr(){return Ir.logLevel}function Tr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Ir.logLevel<=a.in.DEBUG){var r=e.map(Or);Ir.debug.apply(Ir,(0,i.ev)(["Firestore (8.10.0): "+t],r))}}function kr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Ir.logLevel<=a.in.ERROR){var r=e.map(Or);Ir.error.apply(Ir,(0,i.ev)(["Firestore (8.10.0): "+t],r))}}function Ar(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Ir.logLevel<=a.in.WARN){var r=e.map(Or);Ir.warn.apply(Ir,(0,i.ev)(["Firestore (8.10.0): "+t],r))}}function Or(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t}var e}function xr(t){void 0===t&&(t="Unexpected state");var e="FIRESTORE (8.10.0) INTERNAL ASSERTION FAILED: "+t;throw kr(e),new Error(e)}function Nr(t,e){t||xr()}function Cr(t,e){return t}function Dr(t){var e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(var r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}var Pr=function(){function t(){}return t.u=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=Math.floor(256/t.length)*t.length,n="";n.length<20;)for(var r=Dr(40),i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%t.length));return n},t}();function Rr(t,e){return t<e?-1:t>e?1:0}function Lr(t,e,n){return t.length===e.length&&t.every((function(t,r){return n(t,e[r])}))}function jr(t){return t+"\0"}var Mr=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new Er(_r.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new Er(_r.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new Er(_r.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new Er(_r.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}return t.now=function(){return t.fromMillis(Date.now())},t.fromDate=function(e){return t.fromMillis(e.getTime())},t.fromMillis=function(e){var n=Math.floor(e/1e3);return new t(n,Math.floor(1e6*(e-1e3*n)))},t.prototype.toDate=function(){return new Date(this.toMillis())},t.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},t.prototype._compareTo=function(t){return this.seconds===t.seconds?Rr(this.nanoseconds,t.nanoseconds):Rr(this.seconds,t.seconds)},t.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds},t.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},t.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},t.prototype.valueOf=function(){var t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},t}(),Fr=function(){function t(t){this.timestamp=t}return t.fromTimestamp=function(e){return new t(e)},t.min=function(){return new t(new Mr(0,0))},t.prototype.compareTo=function(t){return this.timestamp._compareTo(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.toTimestamp=function(){return this.timestamp},t}();function Ur(t){var e=0;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Vr(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function qr(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var Br=function(){function t(t,e,n){void 0===e?e=0:e>t.length&&xr(),void 0===n?n=t.length-e:n>t.length-e&&xr(),this.segments=t,this.offset=e,this.len=n}return Object.defineProperty(t.prototype,"length",{get:function(){return this.len},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.comparator(this,e)},t.prototype.child=function(e){var n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach((function(t){n.push(t)})):n.push(e),this.construct(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.popFirst=function(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)},t.prototype.popLast=function(){return this.construct(this.segments,this.offset,this.length-1)},t.prototype.firstSegment=function(){return this.segments[this.offset]},t.prototype.lastSegment=function(){return this.get(this.length-1)},t.prototype.get=function(t){return this.segments[this.offset+t]},t.prototype.isEmpty=function(){return 0===this.length},t.prototype.isPrefixOf=function(t){if(t.length<this.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.isImmediateParentOf=function(t){if(this.length+1!==t.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.forEach=function(t){for(var e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])},t.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},t.comparator=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=t.get(r),o=e.get(r);if(i<o)return-1;if(i>o)return 1}return t.length<e.length?-1:t.length>e.length?1:0},t}(),Gr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.construct=function(t,n,r){return new e(t,n,r)},e.prototype.canonicalString=function(){return this.toArray().join("/")},e.prototype.toString=function(){return this.canonicalString()},e.fromString=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=[],i=0,o=t;i<o.length;i++){var a=o[i];if(a.indexOf("//")>=0)throw new Er(_r.INVALID_ARGUMENT,"Invalid segment ("+a+"). Paths must not contain // in them.");r.push.apply(r,a.split("/").filter((function(t){return t.length>0})))}return new e(r)},e.emptyPath=function(){return new e([])},e}(Br),Kr=/^[_a-zA-Z][_a-zA-Z0-9]*$/,Hr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.construct=function(t,n,r){return new e(t,n,r)},e.isValidIdentifier=function(t){return Kr.test(t)},e.prototype.canonicalString=function(){return this.toArray().map((function(t){return t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),e.isValidIdentifier(t)||(t="`"+t+"`"),t})).join(".")},e.prototype.toString=function(){return this.canonicalString()},e.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},e.keyField=function(){return new e(["__name__"])},e.fromServerFormat=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new Er(_r.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},a=!1;i<t.length;){var s=t[i];if("\\"===s){if(i+1===t.length)throw new Er(_r.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new Er(_r.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);r+=u,i+=2}else"`"===s?(a=!a,i++):"."!==s||a?(r+=s,i++):(o(),i++)}if(o(),a)throw new Er(_r.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e.emptyPath=function(){return new e([])},e}(Br),Wr=function(){function t(t){this.fields=t,t.sort(Hr.comparator)}return t.prototype.covers=function(t){for(var e=0,n=this.fields;e<n.length;e++)if(n[e].isPrefixOf(t))return!0;return!1},t.prototype.isEqual=function(t){return Lr(this.fields,t.fields,(function(t,e){return t.isEqual(e)}))},t}(),zr=function(){function t(t){this.binaryString=t}return t.fromBase64String=function(e){return new t(atob(e))},t.fromUint8Array=function(e){return new t(function(t){for(var e="",n=0;n<t.length;++n)e+=String.fromCharCode(t[n]);return e}(e))},t.prototype.toBase64=function(){return t=this.binaryString,btoa(t);var t},t.prototype.toUint8Array=function(){return function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(this.binaryString)},t.prototype.approximateByteSize=function(){return 2*this.binaryString.length},t.prototype.compareTo=function(t){return Rr(this.binaryString,t.binaryString)},t.prototype.isEqual=function(t){return this.binaryString===t.binaryString},t}();zr.EMPTY_BYTE_STRING=new zr("");var Jr=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Qr(t){if(Nr(!!t),"string"==typeof t){var e=0,n=Jr.exec(t);if(Nr(!!n),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),e=Number(r)}var i=new Date(t);return{seconds:Math.floor(i.getTime()/1e3),nanos:e}}return{seconds:Xr(t.seconds),nanos:Xr(t.nanos)}}function Xr(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function Yr(t){return"string"==typeof t?zr.fromBase64String(t):zr.fromUint8Array(t)}function Zr(t){var e,n;return"server_timestamp"===(null===(n=((null===(e=null==t?void 0:t.mapValue)||void 0===e?void 0:e.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function $r(t){var e=t.mapValue.fields.__previous_value__;return Zr(e)?$r(e):e}function ti(t){var e=Qr(t.mapValue.fields.__local_write_time__.timestampValue);return new Mr(e.seconds,e.nanos)}function ei(t){return null==t}function ni(t){return 0===t&&1/t==-1/0}function ri(t){return"number"==typeof t&&Number.isInteger(t)&&!ni(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var ii=function(){function t(t){this.path=t}return t.fromPath=function(e){return new t(Gr.fromString(e))},t.fromName=function(e){return new t(Gr.fromString(e).popFirst(5))},t.prototype.hasCollectionId=function(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t},t.prototype.isEqual=function(t){return null!==t&&0===Gr.comparator(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.comparator=function(t,e){return Gr.comparator(t.path,e.path)},t.isDocumentKey=function(t){return t.length%2==0},t.fromSegments=function(e){return new t(new Gr(e.slice()))},t}();function oi(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Zr(t)?4:10:xr()}function ai(t,e){var n=oi(t);if(n!==oi(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return ti(t).isEqual(ti(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;var n=Qr(t.timestampValue),r=Qr(e.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return Yr(t.bytesValue).isEqual(Yr(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return Xr(t.geoPointValue.latitude)===Xr(e.geoPointValue.latitude)&&Xr(t.geoPointValue.longitude)===Xr(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return Xr(t.integerValue)===Xr(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){var n=Xr(t.doubleValue),r=Xr(e.doubleValue);return n===r?ni(n)===ni(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return Lr(t.arrayValue.values||[],e.arrayValue.values||[],ai);case 10:return function(t,e){var n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(Ur(n)!==Ur(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!ai(n[i],r[i])))return!1;return!0}(t,e);default:return xr()}}function si(t,e){return void 0!==(t.values||[]).find((function(t){return ai(t,e)}))}function ui(t,e){var n=oi(t),r=oi(e);if(n!==r)return Rr(n,r);switch(n){case 0:return 0;case 1:return Rr(t.booleanValue,e.booleanValue);case 2:return function(t,e){var n=Xr(t.integerValue||t.doubleValue),r=Xr(e.integerValue||e.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(t,e);case 3:return ci(t.timestampValue,e.timestampValue);case 4:return ci(ti(t),ti(e));case 5:return Rr(t.stringValue,e.stringValue);case 6:return function(t,e){var n=Yr(t),r=Yr(e);return n.compareTo(r)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){for(var n=t.split("/"),r=e.split("/"),i=0;i<n.length&&i<r.length;i++){var o=Rr(n[i],r[i]);if(0!==o)return o}return Rr(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){var n=Rr(Xr(t.latitude),Xr(e.latitude));return 0!==n?n:Rr(Xr(t.longitude),Xr(e.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(t,e){for(var n=t.values||[],r=e.values||[],i=0;i<n.length&&i<r.length;++i){var o=ui(n[i],r[i]);if(o)return o}return Rr(n.length,r.length)}(t.arrayValue,e.arrayValue);case 10:return function(t,e){var n=t.fields||{},r=Object.keys(n),i=e.fields||{},o=Object.keys(i);r.sort(),o.sort();for(var a=0;a<r.length&&a<o.length;++a){var s=Rr(r[a],o[a]);if(0!==s)return s;var u=ui(n[r[a]],i[o[a]]);if(0!==u)return u}return Rr(r.length,o.length)}(t.mapValue,e.mapValue);default:throw xr()}}function ci(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return Rr(t,e);var n=Qr(t),r=Qr(e),i=Rr(n.seconds,r.seconds);return 0!==i?i:Rr(n.nanos,r.nanos)}function hi(t){return li(t)}function li(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(t){var e=Qr(t);return"time("+e.seconds+","+e.nanos+")"}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?Yr(t.bytesValue).toBase64():"referenceValue"in t?(n=t.referenceValue,ii.fromName(n).toString()):"geoPointValue"in t?"geo("+(e=t.geoPointValue).latitude+","+e.longitude+")":"arrayValue"in t?function(t){for(var e="[",n=!0,r=0,i=t.values||[];r<i.length;r++)n?n=!1:e+=",",e+=li(i[r]);return e+"]"}(t.arrayValue):"mapValue"in t?function(t){for(var e="{",n=!0,r=0,i=Object.keys(t.fields||{}).sort();r<i.length;r++){var o=i[r];n?n=!1:e+=",",e+=o+":"+li(t.fields[o])}return e+"}"}(t.mapValue):xr();var e,n}function fi(t,e){return{referenceValue:"projects/"+t.projectId+"/databases/"+t.database+"/documents/"+e.path.canonicalString()}}function pi(t){return!!t&&"integerValue"in t}function di(t){return!!t&&"arrayValue"in t}function vi(t){return!!t&&"nullValue"in t}function yi(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function gi(t){return!!t&&"mapValue"in t}function mi(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&"object"==typeof t.timestampValue)return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){var e={mapValue:{fields:{}}};return Vr(t.mapValue.fields,(function(t,n){return e.mapValue.fields[t]=mi(n)})),e}if(t.arrayValue){for(var n={arrayValue:{values:[]}},r=0;r<(t.arrayValue.values||[]).length;++r)n.arrayValue.values[r]=mi(t.arrayValue.values[r]);return n}return Object.assign({},t)}var bi=function(){function t(t){this.value=t}return t.empty=function(){return new t({mapValue:{}})},t.prototype.field=function(t){if(t.isEmpty())return this.value;for(var e=this.value,n=0;n<t.length-1;++n)if(!gi(e=(e.mapValue.fields||{})[t.get(n)]))return null;return(e=(e.mapValue.fields||{})[t.lastSegment()])||null},t.prototype.set=function(t,e){this.getFieldsMap(t.popLast())[t.lastSegment()]=mi(e)},t.prototype.setAll=function(t){var e=this,n=Hr.emptyPath(),r={},i=[];t.forEach((function(t,o){if(!n.isImmediateParentOf(o)){var a=e.getFieldsMap(n);e.applyChanges(a,r,i),r={},i=[],n=o.popLast()}t?r[o.lastSegment()]=mi(t):i.push(o.lastSegment())}));var o=this.getFieldsMap(n);this.applyChanges(o,r,i)},t.prototype.delete=function(t){var e=this.field(t.popLast());gi(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]},t.prototype.isEqual=function(t){return ai(this.value,t.value)},t.prototype.getFieldsMap=function(t){var e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(var n=0;n<t.length;++n){var r=e.mapValue.fields[t.get(n)];gi(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},e.mapValue.fields[t.get(n)]=r),e=r}return e.mapValue.fields},t.prototype.applyChanges=function(t,e,n){Vr(e,(function(e,n){return t[e]=n}));for(var r=0,i=n;r<i.length;r++){var o=i[r];delete t[o]}},t.prototype.clone=function(){return new t(mi(this.value))},t}();function wi(t){var e=[];return Vr(t.fields,(function(t,n){var r=new Hr([t]);if(gi(n)){var i=wi(n.mapValue).fields;if(0===i.length)e.push(r);else for(var o=0,a=i;o<a.length;o++){var s=a[o];e.push(r.child(s))}}else e.push(r)})),new Wr(e)}var _i=function(){function t(t,e,n,r,i){this.key=t,this.documentType=e,this.version=n,this.data=r,this.documentState=i}return t.newInvalidDocument=function(e){return new t(e,0,Fr.min(),bi.empty(),0)},t.newFoundDocument=function(e,n,r){return new t(e,1,n,r,0)},t.newNoDocument=function(e,n){return new t(e,2,n,bi.empty(),0)},t.newUnknownDocument=function(e,n){return new t(e,3,n,bi.empty(),2)},t.prototype.convertToFoundDocument=function(t,e){return this.version=t,this.documentType=1,this.data=e,this.documentState=0,this},t.prototype.convertToNoDocument=function(t){return this.version=t,this.documentType=2,this.data=bi.empty(),this.documentState=0,this},t.prototype.convertToUnknownDocument=function(t){return this.version=t,this.documentType=3,this.data=bi.empty(),this.documentState=2,this},t.prototype.setHasCommittedMutations=function(){return this.documentState=2,this},t.prototype.setHasLocalMutations=function(){return this.documentState=1,this},Object.defineProperty(t.prototype,"hasLocalMutations",{get:function(){return 1===this.documentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasCommittedMutations",{get:function(){return 2===this.documentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations},enumerable:!1,configurable:!0}),t.prototype.isValidDocument=function(){return 0!==this.documentType},t.prototype.isFoundDocument=function(){return 1===this.documentType},t.prototype.isNoDocument=function(){return 2===this.documentType},t.prototype.isUnknownDocument=function(){return 3===this.documentType},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)},t.prototype.clone=function(){return new t(this.key,this.documentType,this.version,this.data.clone(),this.documentState)},t.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+JSON.stringify(this.data.value)+", {documentType: "+this.documentType+"}), {documentState: "+this.documentState+"})"},t}(),Ei=function(t,e,n,r,i,o,a){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=a,this.h=null};function Ii(t,e,n,r,i,o,a){return void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),new Ei(t,e,n,r,i,o,a)}function Si(t){var e=Cr(t);if(null===e.h){var n=e.path.canonicalString();null!==e.collectionGroup&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map((function(t){return function(t){return t.field.canonicalString()+t.op.toString()+hi(t.value)}(t)})).join(","),n+="|ob:",n+=e.orderBy.map((function(t){return function(t){return t.field.canonicalString()+t.dir}(t)})).join(","),ei(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=Mi(e.startAt)),e.endAt&&(n+="|ub:",n+=Mi(e.endAt)),e.h=n}return e.h}function Ti(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(var n=0;n<t.orderBy.length;n++)if(!Ui(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(var r=0;r<t.filters.length;r++)if(i=t.filters[r],o=e.filters[r],i.op!==o.op||!i.field.isEqual(o.field)||!ai(i.value,o.value))return!1;var i,o;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!qi(t.startAt,e.startAt)&&qi(t.endAt,e.endAt)}function ki(t){return ii.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}var Ai=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).field=e,i.op=n,i.value=r,i}return(0,i.ZT)(e,t),e.create=function(t,n,r){return t.isKeyField()?"in"===n||"not-in"===n?this.l(t,n,r):new Oi(t,n,r):"array-contains"===n?new Di(t,r):"in"===n?new Pi(t,r):"not-in"===n?new Ri(t,r):"array-contains-any"===n?new Li(t,r):new e(t,n,r)},e.l=function(t,e,n){return"in"===e?new xi(t,n):new Ni(t,n)},e.prototype.matches=function(t){var e=t.data.field(this.field);return"!="===this.op?null!==e&&this.m(ui(e,this.value)):null!==e&&oi(this.value)===oi(e)&&this.m(ui(e,this.value))},e.prototype.m=function(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return 0===t;case"!=":return 0!==t;case">":return t>0;case">=":return t>=0;default:return xr()}},e.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},e}((function(){})),Oi=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,r)||this).key=ii.fromName(r.referenceValue),i}return(0,i.ZT)(e,t),e.prototype.matches=function(t){var e=ii.comparator(t.key,this.key);return this.m(e)},e}(Ai),xi=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"in",n)||this).keys=Ci(0,n),r}return(0,i.ZT)(e,t),e.prototype.matches=function(t){return this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Ai),Ni=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"not-in",n)||this).keys=Ci(0,n),r}return(0,i.ZT)(e,t),e.prototype.matches=function(t){return!this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Ai);function Ci(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(t){return ii.fromName(t.referenceValue)}))}var Di=function(t){function e(e,n){return t.call(this,e,"array-contains",n)||this}return(0,i.ZT)(e,t),e.prototype.matches=function(t){var e=t.data.field(this.field);return di(e)&&si(e.arrayValue,this.value)},e}(Ai),Pi=function(t){function e(e,n){return t.call(this,e,"in",n)||this}return(0,i.ZT)(e,t),e.prototype.matches=function(t){var e=t.data.field(this.field);return null!==e&&si(this.value.arrayValue,e)},e}(Ai),Ri=function(t){function e(e,n){return t.call(this,e,"not-in",n)||this}return(0,i.ZT)(e,t),e.prototype.matches=function(t){if(si(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var e=t.data.field(this.field);return null!==e&&!si(this.value.arrayValue,e)},e}(Ai),Li=function(t){function e(e,n){return t.call(this,e,"array-contains-any",n)||this}return(0,i.ZT)(e,t),e.prototype.matches=function(t){var e=this,n=t.data.field(this.field);return!(!di(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(t){return si(e.value.arrayValue,t)}))},e}(Ai),ji=function(t,e){this.position=t,this.before=e};function Mi(t){return(t.before?"b":"a")+":"+t.position.map((function(t){return hi(t)})).join(",")}var Fi=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};function Ui(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function Vi(t,e,n){for(var r=0,i=0;i<t.position.length;i++){var o=e[i],a=t.position[i];if(r=o.field.isKeyField()?ii.comparator(ii.fromName(a.referenceValue),n.key):ui(a,n.data.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return t.before?r<=0:r<0}function qi(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.before!==e.before||t.position.length!==e.position.length)return!1;for(var n=0;n<t.position.length;n++)if(!ai(t.position[n],e.position[n]))return!1;return!0}var Bi=function(t,e,n,r,i,o,a,s){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o="F"),void 0===a&&(a=null),void 0===s&&(s=null),this.path=t,this.collectionGroup=e,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=o,this.startAt=a,this.endAt=s,this.p=null,this.T=null,this.startAt,this.endAt};function Gi(t,e,n,r,i,o,a,s){return new Bi(t,e,n,r,i,o,a,s)}function Ki(t){return new Bi(t)}function Hi(t){return!ei(t.limit)&&"F"===t.limitType}function Wi(t){return!ei(t.limit)&&"L"===t.limitType}function zi(t){return t.explicitOrderBy.length>0?t.explicitOrderBy[0].field:null}function Ji(t){for(var e=0,n=t.filters;e<n.length;e++){var r=n[e];if(r.g())return r.field}return null}function Qi(t){return null!==t.collectionGroup}function Xi(t){var e=Cr(t);if(null===e.p){e.p=[];var n=Ji(e),r=zi(e);if(null!==n&&null===r)n.isKeyField()||e.p.push(new Fi(n)),e.p.push(new Fi(Hr.keyField(),"asc"));else{for(var i=!1,o=0,a=e.explicitOrderBy;o<a.length;o++){var s=a[o];e.p.push(s),s.field.isKeyField()&&(i=!0)}if(!i){var u=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.p.push(new Fi(Hr.keyField(),u))}}}return e.p}function Yi(t){var e=Cr(t);if(!e.T)if("F"===e.limitType)e.T=Ii(e.path,e.collectionGroup,Xi(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],r=0,i=Xi(e);r<i.length;r++){var o=i[r],a="desc"===o.dir?"asc":"desc";n.push(new Fi(o.field,a))}var s=e.endAt?new ji(e.endAt.position,!e.endAt.before):null,u=e.startAt?new ji(e.startAt.position,!e.startAt.before):null;e.T=Ii(e.path,e.collectionGroup,n,e.filters,e.limit,s,u)}return e.T}function Zi(t,e,n){return new Bi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function $i(t,e){return Ti(Yi(t),Yi(e))&&t.limitType===e.limitType}function to(t){return Si(Yi(t))+"|lt:"+t.limitType}function eo(t){return"Query(target="+function(t){var e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=", filters: ["+t.filters.map((function(t){return(e=t).field.canonicalString()+" "+e.op+" "+hi(e.value);var e})).join(", ")+"]"),ei(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=", orderBy: ["+t.orderBy.map((function(t){return function(t){return t.field.canonicalString()+" ("+t.dir+")"}(t)})).join(", ")+"]"),t.startAt&&(e+=", startAt: "+Mi(t.startAt)),t.endAt&&(e+=", endAt: "+Mi(t.endAt)),"Target("+e+")"}(Yi(t))+"; limitType="+t.limitType+")"}function no(t,e){return e.isFoundDocument()&&function(t,e){var n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):ii.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(var n=0,r=t.explicitOrderBy;n<r.length;n++){var i=r[n];if(!i.field.isKeyField()&&null===e.data.field(i.field))return!1}return!0}(t,e)&&function(t,e){for(var n=0,r=t.filters;n<r.length;n++)if(!r[n].matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!Vi(t.startAt,Xi(t),e)||t.endAt&&Vi(t.endAt,Xi(t),e))}(t,e)}function ro(t){return function(e,n){for(var r=!1,i=0,o=Xi(t);i<o.length;i++){var a=o[i],s=io(a,e,n);if(0!==s)return s;r=r||a.field.isKeyField()}return 0}}function io(t,e,n){var r=t.field.isKeyField()?ii.comparator(e.key,n.key):function(t,e,n){var r=e.data.field(t),i=n.data.field(t);return null!==r&&null!==i?ui(r,i):xr()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return xr()}}function oo(t,e){if(t.I){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ni(e)?"-0":e}}function ao(t){return{integerValue:""+t}}function so(t,e){return ri(e)?ao(e):oo(t,e)}var uo=function(){this._=void 0};function co(t,e,n){return t instanceof fo?function(t,e){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof po?vo(t,e):t instanceof yo?go(t,e):function(t,e){var n=lo(t,e),r=bo(n)+bo(t.A);return pi(n)&&pi(t.A)?ao(r):oo(t.R,r)}(t,e)}function ho(t,e,n){return t instanceof po?vo(t,e):t instanceof yo?go(t,e):n}function lo(t,e){return t instanceof mo?pi(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null;var n}var fo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e}(uo),po=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return(0,i.ZT)(e,t),e}(uo);function vo(t,e){for(var n=wo(e),r=function(t){n.some((function(e){return ai(e,t)}))||n.push(t)},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var yo=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return(0,i.ZT)(e,t),e}(uo);function go(t,e){for(var n=wo(e),r=function(t){n=n.filter((function(e){return!ai(e,t)}))},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var mo=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).R=e,r.A=n,r}return(0,i.ZT)(e,t),e}(uo);function bo(t){return Xr(t.integerValue||t.doubleValue)}function wo(t){return di(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var _o=function(t,e){this.field=t,this.transform=e},Eo=function(t,e){this.version=t,this.transformResults=e},Io=function(){function t(t,e){this.updateTime=t,this.exists=e}return t.none=function(){return new t},t.exists=function(e){return new t(void 0,e)},t.updateTime=function(e){return new t(e)},Object.defineProperty(t.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)},t}();function So(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}var To=function(){};function ko(t,e,n){t instanceof Co?function(t,e,n){var r=t.value.clone(),i=Ro(t.fieldTransforms,e,n.transformResults);r.setAll(i),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):t instanceof Do?function(t,e,n){if(So(t.precondition,e)){var r=Ro(t.fieldTransforms,e,n.transformResults),i=e.data;i.setAll(Po(t)),i.setAll(r),e.convertToFoundDocument(n.version,i).setHasCommittedMutations()}else e.convertToUnknownDocument(n.version)}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function Ao(t,e,n){t instanceof Co?function(t,e,n){if(So(t.precondition,e)){var r=t.value.clone(),i=Lo(t.fieldTransforms,n,e);r.setAll(i),e.convertToFoundDocument(No(e),r).setHasLocalMutations()}}(t,e,n):t instanceof Do?function(t,e,n){if(So(t.precondition,e)){var r=Lo(t.fieldTransforms,n,e),i=e.data;i.setAll(Po(t)),i.setAll(r),e.convertToFoundDocument(No(e),i).setHasLocalMutations()}}(t,e,n):function(t,e){So(t.precondition,e)&&e.convertToNoDocument(Fr.min())}(t,e)}function Oo(t,e){for(var n=null,r=0,i=t.fieldTransforms;r<i.length;r++){var o=i[r],a=e.data.field(o.field),s=lo(o.transform,a||null);null!=s&&(null==n&&(n=bi.empty()),n.set(o.field,s))}return n||null}function xo(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&Lr(t,e,(function(t,e){return function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof po&&e instanceof po||t instanceof yo&&e instanceof yo?Lr(t.elements,e.elements,ai):t instanceof mo&&e instanceof mo?ai(t.A,e.A):t instanceof fo&&e instanceof fo}(t.transform,e.transform)}(t,e)}))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}function No(t){return t.isFoundDocument()?t.version:Fr.min()}var Co=function(t){function e(e,n,r,i){void 0===i&&(i=[]);var o=this;return(o=t.call(this)||this).key=e,o.value=n,o.precondition=r,o.fieldTransforms=i,o.type=0,o}return(0,i.ZT)(e,t),e}(To),Do=function(t){function e(e,n,r,i,o){void 0===o&&(o=[]);var a=this;return(a=t.call(this)||this).key=e,a.data=n,a.fieldMask=r,a.precondition=i,a.fieldTransforms=o,a.type=1,a}return(0,i.ZT)(e,t),e}(To);function Po(t){var e=new Map;return t.fieldMask.fields.forEach((function(n){if(!n.isEmpty()){var r=t.data.field(n);e.set(n,r)}})),e}function Ro(t,e,n){var r=new Map;Nr(t.length===n.length);for(var i=0;i<n.length;i++){var o=t[i],a=o.transform,s=e.data.field(o.field);r.set(o.field,ho(a,s,n[i]))}return r}function Lo(t,e,n){for(var r=new Map,i=0,o=t;i<o.length;i++){var a=o[i],s=a.transform,u=n.data.field(a.field);r.set(a.field,co(s,u,e))}return r}var jo,Mo,Fo=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.precondition=n,r.type=2,r.fieldTransforms=[],r}return(0,i.ZT)(e,t),e}(To),Uo=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.precondition=n,r.type=3,r.fieldTransforms=[],r}return(0,i.ZT)(e,t),e}(To),Vo=function(t){this.count=t};function qo(t){switch(t){case _r.OK:return xr();case _r.CANCELLED:case _r.UNKNOWN:case _r.DEADLINE_EXCEEDED:case _r.RESOURCE_EXHAUSTED:case _r.INTERNAL:case _r.UNAVAILABLE:case _r.UNAUTHENTICATED:return!1;case _r.INVALID_ARGUMENT:case _r.NOT_FOUND:case _r.ALREADY_EXISTS:case _r.PERMISSION_DENIED:case _r.FAILED_PRECONDITION:case _r.ABORTED:case _r.OUT_OF_RANGE:case _r.UNIMPLEMENTED:case _r.DATA_LOSS:return!0;default:return xr()}}function Bo(t){if(void 0===t)return kr("GRPC error has no .code"),_r.UNKNOWN;switch(t){case jo.OK:return _r.OK;case jo.CANCELLED:return _r.CANCELLED;case jo.UNKNOWN:return _r.UNKNOWN;case jo.DEADLINE_EXCEEDED:return _r.DEADLINE_EXCEEDED;case jo.RESOURCE_EXHAUSTED:return _r.RESOURCE_EXHAUSTED;case jo.INTERNAL:return _r.INTERNAL;case jo.UNAVAILABLE:return _r.UNAVAILABLE;case jo.UNAUTHENTICATED:return _r.UNAUTHENTICATED;case jo.INVALID_ARGUMENT:return _r.INVALID_ARGUMENT;case jo.NOT_FOUND:return _r.NOT_FOUND;case jo.ALREADY_EXISTS:return _r.ALREADY_EXISTS;case jo.PERMISSION_DENIED:return _r.PERMISSION_DENIED;case jo.FAILED_PRECONDITION:return _r.FAILED_PRECONDITION;case jo.ABORTED:return _r.ABORTED;case jo.OUT_OF_RANGE:return _r.OUT_OF_RANGE;case jo.UNIMPLEMENTED:return _r.UNIMPLEMENTED;case jo.DATA_LOSS:return _r.DATA_LOSS;default:return xr()}}(Mo=jo||(jo={}))[Mo.OK=0]="OK",Mo[Mo.CANCELLED=1]="CANCELLED",Mo[Mo.UNKNOWN=2]="UNKNOWN",Mo[Mo.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Mo[Mo.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Mo[Mo.NOT_FOUND=5]="NOT_FOUND",Mo[Mo.ALREADY_EXISTS=6]="ALREADY_EXISTS",Mo[Mo.PERMISSION_DENIED=7]="PERMISSION_DENIED",Mo[Mo.UNAUTHENTICATED=16]="UNAUTHENTICATED",Mo[Mo.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Mo[Mo.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Mo[Mo.ABORTED=10]="ABORTED",Mo[Mo.OUT_OF_RANGE=11]="OUT_OF_RANGE",Mo[Mo.UNIMPLEMENTED=12]="UNIMPLEMENTED",Mo[Mo.INTERNAL=13]="INTERNAL",Mo[Mo.UNAVAILABLE=14]="UNAVAILABLE",Mo[Mo.DATA_LOSS=15]="DATA_LOSS";var Go=function(){function t(t,e){this.comparator=t,this.root=e||Ho.EMPTY}return t.prototype.insert=function(e,n){return new t(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,Ho.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Ho.BLACK,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.isEmpty();){var n=this.comparator(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null},t.prototype.indexOf=function(t){for(var e=0,n=this.root;!n.isEmpty();){var r=this.comparator(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1},t.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),t.prototype.minKey=function(){return this.root.minKey()},t.prototype.maxKey=function(){return this.root.maxKey()},t.prototype.inorderTraversal=function(t){return this.root.inorderTraversal(t)},t.prototype.forEach=function(t){this.inorderTraversal((function(e,n){return t(e,n),!1}))},t.prototype.toString=function(){var t=[];return this.inorderTraversal((function(e,n){return t.push(e+":"+n),!1})),"{"+t.join(", ")+"}"},t.prototype.reverseTraversal=function(t){return this.root.reverseTraversal(t)},t.prototype.getIterator=function(){return new Ko(this.root,null,this.comparator,!1)},t.prototype.getIteratorFrom=function(t){return new Ko(this.root,t,this.comparator,!1)},t.prototype.getReverseIterator=function(){return new Ko(this.root,null,this.comparator,!0)},t.prototype.getReverseIteratorFrom=function(t){return new Ko(this.root,t,this.comparator,!0)},t}(),Ko=function(){function t(t,e,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!t.isEmpty();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(0===i){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}return t.prototype.getNext=function(){var t=this.nodeStack.pop(),e={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 e},t.prototype.hasNext=function(){return this.nodeStack.length>0},t.prototype.peek=function(){if(0===this.nodeStack.length)return null;var t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}},t}(),Ho=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:t.EMPTY,this.right=null!=o?o:t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},t.prototype.minKey=function(){return this.min().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp()},t.prototype.removeMin=function(){if(this.left.isEmpty())return t.EMPTY;var e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===n(e,i.key)){if(i.right.isEmpty())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()},t.prototype.isRed=function(){return this.color},t.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},t.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},t.prototype.moveRedRight=function(){var t=this.colorFlip();return t.left.left.isRed()&&(t=(t=t.rotateRight()).colorFlip()),t},t.prototype.rotateLeft=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth=function(){var t=this.check();return Math.pow(2,t)<=this.size+1},t.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw xr();if(this.right.isRed())throw xr();var t=this.left.check();if(t!==this.right.check())throw xr();return t+(this.isRed()?0:1)},t}();Ho.EMPTY=null,Ho.RED=!0,Ho.BLACK=!1,Ho.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw xr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw xr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw xr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw xr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw xr()},enumerable:!1,configurable:!0}),t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new Ho(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.isRed=function(){return!1},t.prototype.checkMaxDepth=function(){return!0},t.prototype.check=function(){return 0},t}());var Wo=function(){function t(t){this.comparator=t,this.data=new Go(this.comparator)}return t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.minKey()},t.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.inorderTraversal((function(e,n){return t(e),!1}))},t.prototype.forEachInRange=function(t,e){for(var n=this.data.getIteratorFrom(t[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,t[1])>=0)return;e(r.key)}},t.prototype.forEachWhile=function(t,e){var n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return},t.prototype.firstAfterOrEqual=function(t){var e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null},t.prototype.getIterator=function(){return new zo(this.data.getIterator())},t.prototype.getIteratorFrom=function(t){return new zo(this.data.getIteratorFrom(t))},t.prototype.add=function(t){return this.copy(this.data.remove(t).insert(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.isEmpty=function(){return this.data.isEmpty()},t.prototype.unionWith=function(t){var e=this;return e.size<t.size&&(e=t,t=this),t.forEach((function(t){e=e.add(t)})),e},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.data.getIterator(),r=e.data.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0},t.prototype.toArray=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},t.prototype.toString=function(){var t=[];return this.forEach((function(e){return t.push(e)})),"SortedSet("+t.toString()+")"},t.prototype.copy=function(e){var n=new t(this.comparator);return n.data=e,n},t}(),zo=function(){function t(t){this.iter=t}return t.prototype.getNext=function(){return this.iter.getNext().key},t.prototype.hasNext=function(){return this.iter.hasNext()},t}(),Jo=new Go(ii.comparator);function Qo(){return Jo}var Xo=new Go(ii.comparator);function Yo(){return Xo}var Zo=new Go(ii.comparator);function $o(){return Zo}var ta=new Wo(ii.comparator);function ea(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=ta,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var na=new Wo(Rr);function ra(){return na}var ia=function(){function t(t,e,n,r,i){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}return t.createSynthesizedRemoteEventForCurrentChange=function(e,n){var r=new Map;return r.set(e,oa.createSynthesizedTargetChangeForCurrentChange(e,n)),new t(Fr.min(),r,ra(),Qo(),ea())},t}(),oa=function(){function t(t,e,n,r,i){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}return t.createSynthesizedTargetChangeForCurrentChange=function(e,n){return new t(zr.EMPTY_BYTE_STRING,n,ea(),ea(),ea())},t}(),aa=function(t,e,n,r){this.v=t,this.removedTargetIds=e,this.key=n,this.P=r},sa=function(t,e){this.targetId=t,this.V=e},ua=function(t,e,n,r){void 0===n&&(n=zr.EMPTY_BYTE_STRING),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r},ca=function(){function t(){this.S=0,this.D=fa(),this.C=zr.EMPTY_BYTE_STRING,this.N=!1,this.k=!0}return Object.defineProperty(t.prototype,"current",{get:function(){return this.N},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"F",{get:function(){return 0!==this.S},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"$",{get:function(){return this.k},enumerable:!1,configurable:!0}),t.prototype.O=function(t){t.approximateByteSize()>0&&(this.k=!0,this.C=t)},t.prototype.M=function(){var t=ea(),e=ea(),n=ea();return this.D.forEach((function(r,i){switch(i){case 0:t=t.add(r);break;case 2:e=e.add(r);break;case 1:n=n.add(r);break;default:xr()}})),new oa(this.C,this.N,t,e,n)},t.prototype.L=function(){this.k=!1,this.D=fa()},t.prototype.B=function(t,e){this.k=!0,this.D=this.D.insert(t,e)},t.prototype.q=function(t){this.k=!0,this.D=this.D.remove(t)},t.prototype.U=function(){this.S+=1},t.prototype.K=function(){this.S-=1},t.prototype.j=function(){this.k=!0,this.N=!0},t}(),ha=function(){function t(t){this.W=t,this.G=new Map,this.H=Qo(),this.J=la(),this.Y=new Wo(Rr)}return t.prototype.X=function(t){for(var e=0,n=t.v;e<n.length;e++){var r=n[e];t.P&&t.P.isFoundDocument()?this.Z(r,t.P):this.tt(r,t.key,t.P)}for(var i=0,o=t.removedTargetIds;i<o.length;i++)r=o[i],this.tt(r,t.key,t.P)},t.prototype.et=function(t){var e=this;this.forEachTarget(t,(function(n){var r=e.nt(n);switch(t.state){case 0:e.st(n)&&r.O(t.resumeToken);break;case 1:r.K(),r.F||r.L(),r.O(t.resumeToken);break;case 2:r.K(),r.F||e.removeTarget(n);break;case 3:e.st(n)&&(r.j(),r.O(t.resumeToken));break;case 4:e.st(n)&&(e.it(n),r.O(t.resumeToken));break;default:xr()}}))},t.prototype.forEachTarget=function(t,e){var n=this;t.targetIds.length>0?t.targetIds.forEach(e):this.G.forEach((function(t,r){n.st(r)&&e(r)}))},t.prototype.rt=function(t){var e=t.targetId,n=t.V.count,r=this.ot(e);if(r){var i=r.target;if(ki(i))if(0===n){var o=new ii(i.path);this.tt(e,o,_i.newNoDocument(o,Fr.min()))}else Nr(1===n);else this.ct(e)!==n&&(this.it(e),this.Y=this.Y.add(e))}},t.prototype.ut=function(t){var e=this,n=new Map;this.G.forEach((function(r,i){var o=e.ot(i);if(o){if(r.current&&ki(o.target)){var a=new ii(o.target.path);null!==e.H.get(a)||e.at(i,a)||e.tt(i,a,_i.newNoDocument(a,t))}r.$&&(n.set(i,r.M()),r.L())}}));var r=ea();this.J.forEach((function(t,n){var i=!0;n.forEachWhile((function(t){var n=e.ot(t);return!n||2===n.purpose||(i=!1,!1)})),i&&(r=r.add(t))}));var i=new ia(t,n,this.Y,this.H,r);return this.H=Qo(),this.J=la(),this.Y=new Wo(Rr),i},t.prototype.Z=function(t,e){if(this.st(t)){var n=this.at(t,e.key)?2:0;this.nt(t).B(e.key,n),this.H=this.H.insert(e.key,e),this.J=this.J.insert(e.key,this.ht(e.key).add(t))}},t.prototype.tt=function(t,e,n){if(this.st(t)){var r=this.nt(t);this.at(t,e)?r.B(e,1):r.q(e),this.J=this.J.insert(e,this.ht(e).delete(t)),n&&(this.H=this.H.insert(e,n))}},t.prototype.removeTarget=function(t){this.G.delete(t)},t.prototype.ct=function(t){var e=this.nt(t).M();return this.W.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size},t.prototype.U=function(t){this.nt(t).U()},t.prototype.nt=function(t){var e=this.G.get(t);return e||(e=new ca,this.G.set(t,e)),e},t.prototype.ht=function(t){var e=this.J.get(t);return e||(e=new Wo(Rr),this.J=this.J.insert(t,e)),e},t.prototype.st=function(t){var e=null!==this.ot(t);return e||Tr("WatchChangeAggregator","Detected inactive target",t),e},t.prototype.ot=function(t){var e=this.G.get(t);return e&&e.F?null:this.W.lt(t)},t.prototype.it=function(t){var e=this;this.G.set(t,new ca),this.W.getRemoteKeysForTarget(t).forEach((function(n){e.tt(t,n,null)}))},t.prototype.at=function(t,e){return this.W.getRemoteKeysForTarget(t).has(e)},t}();function la(){return new Go(ii.comparator)}function fa(){return new Go(ii.comparator)}var pa={asc:"ASCENDING",desc:"DESCENDING"},da={"<":"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"},va=function(t,e){this.databaseId=t,this.I=e};function ya(t,e){return t.I?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function ga(t,e){return t.I?e.toBase64():e.toUint8Array()}function ma(t,e){return ya(t,e.toTimestamp())}function ba(t){return Nr(!!t),Fr.fromTimestamp(function(t){var e=Qr(t);return new Mr(e.seconds,e.nanos)}(t))}function wa(t,e){return function(t){return new Gr(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function _a(t){var e=Gr.fromString(t);return Nr(Ha(e)),e}function Ea(t,e){return wa(t.databaseId,e.path)}function Ia(t,e){var n=_a(e);if(n.get(1)!==t.databaseId.projectId)throw new Er(_r.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new Er(_r.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new ii(Aa(n))}function Sa(t,e){return wa(t.databaseId,e)}function Ta(t){var e=_a(t);return 4===e.length?Gr.emptyPath():Aa(e)}function ka(t){return new Gr(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Aa(t){return Nr(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function Oa(t,e,n){return{name:Ea(t,e),fields:n.value.mapValue.fields}}function xa(t,e,n){var r=Ia(t,e.name),i=ba(e.updateTime),o=new bi({mapValue:{fields:e.fields}}),a=_i.newFoundDocument(r,i,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function Na(t,e){var n;if(e instanceof Co)n={update:Oa(t,e.key,e.value)};else if(e instanceof Fo)n={delete:Ea(t,e.key)};else if(e instanceof Do)n={update:Oa(t,e.key,e.data),updateMask:Ka(e.fieldMask)};else{if(!(e instanceof Uo))return xr();n={verify:Ea(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((function(t){return function(t,e){var n=e.transform;if(n instanceof fo)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof po)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof yo)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof mo)return{fieldPath:e.field.canonicalString(),increment:n.A};throw xr()}(0,t)}))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:ma(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:xr()}(t,e.precondition)),n}function Ca(t,e){var n=e.currentDocument?function(t){return void 0!==t.updateTime?Io.updateTime(ba(t.updateTime)):void 0!==t.exists?Io.exists(t.exists):Io.none()}(e.currentDocument):Io.none(),r=e.updateTransforms?e.updateTransforms.map((function(e){return function(t,e){var n=null;if("setToServerValue"in e)Nr("REQUEST_TIME"===e.setToServerValue),n=new fo;else if("appendMissingElements"in e){var r=e.appendMissingElements.values||[];n=new po(r)}else if("removeAllFromArray"in e){var i=e.removeAllFromArray.values||[];n=new yo(i)}else"increment"in e?n=new mo(t,e.increment):xr();var o=Hr.fromServerFormat(e.fieldPath);return new _o(o,n)}(t,e)})):[];if(e.update){e.update.name;var i=Ia(t,e.update.name),o=new bi({mapValue:{fields:e.update.fields}});if(e.updateMask){var a=function(t){var e=t.fieldPaths||[];return new Wr(e.map((function(t){return Hr.fromServerFormat(t)})))}(e.updateMask);return new Do(i,o,a,n,r)}return new Co(i,o,n,r)}if(e.delete){var s=Ia(t,e.delete);return new Fo(s,n)}if(e.verify){var u=Ia(t,e.verify);return new Uo(u,n)}return xr()}function Da(t,e){return{documents:[Sa(t,e.path)]}}function Pa(t,e){var n={structuredQuery:{}},r=e.path;null!==e.collectionGroup?(n.parent=Sa(t,r),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Sa(t,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);var i=function(t){if(0!==t.length){var e=t.map((function(t){return function(t){if("=="===t.op){if(yi(t.value))return{unaryFilter:{field:Va(t.field),op:"IS_NAN"}};if(vi(t.value))return{unaryFilter:{field:Va(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(yi(t.value))return{unaryFilter:{field:Va(t.field),op:"IS_NOT_NAN"}};if(vi(t.value))return{unaryFilter:{field:Va(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Va(t.field),op:Ua(t.op),value:t.value}}}(t)}));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}}(e.filters);i&&(n.structuredQuery.where=i);var o=function(t){if(0!==t.length)return t.map((function(t){return function(t){return{field:Va(t.field),direction:Fa(t.dir)}}(t)}))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);var a=function(t,e){return t.I||ei(e)?e:{value:e}}(t,e.limit);return null!==a&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=ja(e.startAt)),e.endAt&&(n.structuredQuery.endAt=ja(e.endAt)),n}function Ra(t){var e=Ta(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){Nr(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:e=e.child(o.collectionId)}var a=[];n.where&&(a=La(n.where));var s=[];n.orderBy&&(s=n.orderBy.map((function(t){return function(t){return new Fi(qa(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t)})));var u=null;n.limit&&(u=function(t){var e;return ei(e="object"==typeof t?t.value:t)?null:e}(n.limit));var c=null;n.startAt&&(c=Ma(n.startAt));var h=null;return n.endAt&&(h=Ma(n.endAt)),Gi(e,i,s,a,u,"F",c,h)}function La(t){return t?void 0!==t.unaryFilter?[Ga(t)]:void 0!==t.fieldFilter?[Ba(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return La(t)})).reduce((function(t,e){return t.concat(e)})):xr():[]}function ja(t){return{before:t.before,values:t.position}}function Ma(t){var e=!!t.before,n=t.values||[];return new ji(n,e)}function Fa(t){return pa[t]}function Ua(t){return da[t]}function Va(t){return{fieldPath:t.canonicalString()}}function qa(t){return Hr.fromServerFormat(t.fieldPath)}function Ba(t){return Ai.create(qa(t.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";case"OPERATOR_UNSPECIFIED":default:return xr()}}(t.fieldFilter.op),t.fieldFilter.value)}function Ga(t){switch(t.unaryFilter.op){case"IS_NAN":var e=qa(t.unaryFilter.field);return Ai.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=qa(t.unaryFilter.field);return Ai.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=qa(t.unaryFilter.field);return Ai.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=qa(t.unaryFilter.field);return Ai.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return xr()}}function Ka(t){var e=[];return t.fields.forEach((function(t){return e.push(t.canonicalString())})),{fieldPaths:e}}function Ha(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}function Wa(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=Ja(e)),e=za(t.get(n),e);return Ja(e)}function za(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="";break;case"":n+="";break;default:n+=o}}return n}function Ja(t){return t+""}function Qa(t){var e=t.length;if(Nr(e>=2),2===e)return Nr(""===t.charAt(0)&&""===t.charAt(1)),Gr.emptyPath();for(var n=e-2,r=[],i="",o=0;o<e;){var a=t.indexOf("",o);switch((a<0||a>n)&&xr(),t.charAt(a+1)){case"":var s=t.substring(o,a),u=void 0;0===i.length?u=s:(u=i+=s,i=""),r.push(u);break;case"":i+=t.substring(o,a),i+="\0";break;case"":i+=t.substring(o,a+1);break;default:xr()}o=a+2}return new Gr(r)}var Xa=function(t,e){this.seconds=t,this.nanoseconds=e},Ya=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};Ya.store="owner",Ya.key="owner";var Za=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};Za.store="mutationQueues",Za.keyPath="userId";var $a=function(t,e,n,r,i){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};$a.store="mutations",$a.keyPath="batchId",$a.userMutationsIndex="userMutationsIndex",$a.userMutationsKeyPath=["userId","batchId"];var ts=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,Wa(e)]},t.key=function(t,e,n){return[t,Wa(e),n]},t}();ts.store="documentMutations",ts.PLACEHOLDER=new ts;var es=function(t,e){this.path=t,this.readTime=e},ns=function(t,e){this.path=t,this.version=e},rs=function(t,e,n,r,i,o){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};rs.store="remoteDocuments",rs.readTimeIndex="readTimeIndex",rs.readTimeIndexPath="readTime",rs.collectionReadTimeIndex="collectionReadTimeIndex",rs.collectionReadTimeIndexPath=["parentPath","readTime"];var is=function(t){this.byteSize=t};is.store="remoteDocumentGlobal",is.key="remoteDocumentGlobalKey";var os=function(t,e,n,r,i,o,a){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a};os.store="targets",os.keyPath="targetId",os.queryTargetsIndexName="queryTargetsIndex",os.queryTargetsKeyPath=["canonicalId","targetId"];var as=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};as.store="targetDocuments",as.keyPath=["targetId","path"],as.documentTargetsIndex="documentTargetsIndex",as.documentTargetsKeyPath=["path","targetId"];var ss=function(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r};ss.key="targetGlobalKey",ss.store="targetGlobal";var us=function(t,e){this.collectionId=t,this.parent=e};us.store="collectionParents",us.keyPath=["collectionId","parent"];var cs=function(t,e,n,r){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r};cs.store="clientMetadata",cs.keyPath="clientId";var hs=function(t,e,n){this.bundleId=t,this.createTime=e,this.version=n};hs.store="bundles",hs.keyPath="bundleId";var ls=function(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n};ls.store="namedQueries",ls.keyPath="name";var fs=(0,i.ev)((0,i.ev)([],(0,i.ev)((0,i.ev)([],(0,i.ev)((0,i.ev)([],(0,i.ev)((0,i.ev)([],[Za.store,$a.store,ts.store,rs.store,os.store,Ya.store,ss.store,as.store]),[cs.store])),[is.store])),[us.store])),[hs.store,ls.store]),ps="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",ds=function(){function t(){this.onCommittedListeners=[]}return t.prototype.addOnCommittedListener=function(t){this.onCommittedListeners.push(t)},t.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEach((function(t){return t()}))},t}(),vs=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},ys=function(){function t(t){var e=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((function(t){e.isDone=!0,e.result=t,e.nextCallback&&e.nextCallback(t)}),(function(t){e.isDone=!0,e.error=t,e.catchCallback&&e.catchCallback(t)}))}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.callbackAttached&&xr(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t((function(t,i){r.nextCallback=function(n){r.wrapSuccess(e,n).next(t,i)},r.catchCallback=function(e){r.wrapFailure(n,e).next(t,i)}}))},t.prototype.toPromise=function(){var t=this;return new Promise((function(e,n){t.next(e,n)}))},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction((function(){return e(n)})):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction((function(){return e(n)})):t.reject(n)},t.resolve=function(e){return new t((function(t,n){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.waitFor=function(e){return new t((function(t,n){var r=0,i=0,o=!1;e.forEach((function(e){++r,e.next((function(){++i,o&&i===r&&t()}),(function(t){return n(t)}))})),o=!0,i===r&&t()}))},t.or=function(e){for(var n=t.resolve(!1),r=function(e){n=n.next((function(n){return n?t.resolve(n):e()}))},i=0,o=e;i<o.length;i++)r(o[i]);return n},t.forEach=function(t,e){var n=this,r=[];return t.forEach((function(t,i){r.push(e.call(n,t,i))})),this.waitFor(r)},t}(),gs=function(){function t(t,e){var n=this;this.action=t,this.transaction=e,this.aborted=!1,this.ft=new vs,this.transaction.oncomplete=function(){n.ft.resolve()},this.transaction.onabort=function(){e.error?n.ft.reject(new ws(t,e.error)):n.ft.resolve()},this.transaction.onerror=function(e){var r=Ts(e.target.error);n.ft.reject(new ws(t,r))}}return t.open=function(e,n,r,i){try{return new t(n,e.transaction(i,r))}catch(e){throw new ws(n,e)}},Object.defineProperty(t.prototype,"dt",{get:function(){return this.ft.promise},enumerable:!1,configurable:!0}),t.prototype.abort=function(t){t&&this.ft.reject(t),this.aborted||(Tr("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},t.prototype.store=function(t){var e=this.transaction.objectStore(t);return new Es(e)},t}(),ms=function(){function t(e,n,r){this.name=e,this.version=n,this.wt=r,12.2===t._t((0,o.z$)())&&kr("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 t.delete=function(t){return Tr("SimpleDb","Removing database:",t),Is(window.indexedDB.deleteDatabase(t)).toPromise()},t.yt=function(){if("undefined"==typeof indexedDB)return!1;if(t.gt())return!0;var e=(0,o.z$)(),n=t._t(e),r=0<n&&n<10,i=t.Et(e),a=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||a)},t.gt=function(){var t;return"undefined"!=typeof process&&"YES"===(null===(t=process.env)||void 0===t?void 0:t.Tt)},t.It=function(t,e){return t.store(e)},t._t=function(t){var e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)},t.Et=function(t){var e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.At=function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n=this;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:(Tr("SimpleDb","Opening database:",this.name),e=this,[4,new Promise((function(e,r){var i=indexedDB.open(n.name,n.version);i.onsuccess=function(t){var n=t.target.result;e(n)},i.onblocked=function(){r(new ws(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=function(e){var n=e.target.error;"VersionError"===n.name?r(new Er(_r.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.")):r(new ws(t,n))},i.onupgradeneeded=function(t){Tr("SimpleDb",'Database "'+n.name+'" requires upgrade from version:',t.oldVersion);var e=t.target.result;n.wt.Rt(e,i.transaction,t.oldVersion,n.version).next((function(){Tr("SimpleDb","Database upgrade to version "+n.version+" complete")}))}}))]);case 1:e.db=r.sent(),r.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(t){return n.bt(t)}),this.db)]}}))}))},t.prototype.vt=function(t){this.bt=t,this.db&&(this.db.onversionchange=function(e){return t(e)})},t.prototype.runTransaction=function(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s,u,c;return(0,i.Jh)(this,(function(h){switch(h.label){case 0:o="readonly"===e,a=0,s=function(){var e,s,c,h,l;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:++a,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,u.At(t)];case 2:return u.db=i.sent(),e=gs.open(u.db,t,o?"readonly":"readwrite",n),s=r(e).catch((function(t){return e.abort(t),ys.reject(t)})).toPromise(),c={},s.catch((function(){})),[4,e.dt];case 3:return[2,(c.value=(i.sent(),s),c)];case 4:return h=i.sent(),l="FirebaseError"!==h.name&&a<3,Tr("SimpleDb","Transaction failed with error:",h.message,"Retrying:",l),u.close(),l?[3,5]:[2,{value:Promise.reject(h)}];case 5:return[2]}}))},u=this,h.label=1;case 1:return[5,s()];case 2:if("object"==typeof(c=h.sent()))return[2,c.value];h.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),bs=function(){function t(t){this.Pt=t,this.Vt=!1,this.St=null}return Object.defineProperty(t.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.Pt=t},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.Vt=!0},t.prototype.Ct=function(t){this.St=t},t.prototype.delete=function(){return Is(this.Pt.delete())},t}(),ws=function(t){function e(e,n){var r=this;return(r=t.call(this,_r.UNAVAILABLE,"IndexedDB transaction '"+e+"' failed: "+n)||this).name="IndexedDbTransactionError",r}return(0,i.ZT)(e,t),e}(Er);function _s(t){return"IndexedDbTransactionError"===t.name}var Es=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(Tr("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(Tr("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),Is(n)},t.prototype.add=function(t){return Tr("SimpleDb","ADD",this.store.name,t,t),Is(this.store.add(t))},t.prototype.get=function(t){var e=this;return Is(this.store.get(t)).next((function(n){return void 0===n&&(n=null),Tr("SimpleDb","GET",e.store.name,t,n),n}))},t.prototype.delete=function(t){return Tr("SimpleDb","DELETE",this.store.name,t),Is(this.store.delete(t))},t.prototype.count=function(){return Tr("SimpleDb","COUNT",this.store.name),Is(this.store.count())},t.prototype.Nt=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.xt(n,(function(t,e){r.push(e)})).next((function(){return r}))},t.prototype.kt=function(t,e){Tr("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.Ft=!1;var r=this.cursor(n);return this.xt(r,(function(t,e,n){return n.delete()}))},t.prototype.$t=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.xt(r,e)},t.prototype.Ot=function(t){var e=this.cursor({});return new ys((function(n,r){e.onerror=function(t){var e=Ts(t.target.error);r(e)},e.onsuccess=function(e){var r=e.target.result;r?t(r.primaryKey,r.value).next((function(t){t?r.continue():n()})):n()}}))},t.prototype.xt=function(t,e){var n=[];return new ys((function(r,i){t.onerror=function(t){i(t.target.error)},t.onsuccess=function(t){var i=t.target.result;if(i){var o=new bs(i),a=e(i.primaryKey,i.value,o);if(a instanceof ys){var s=a.catch((function(t){return o.done(),ys.reject(t)}));n.push(s)}o.isDone?r():null===o.Dt?i.continue():i.continue(o.Dt)}else r()}})).next((function(){return ys.waitFor(n)}))},t.prototype.options=function(t,e){var n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}},t.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.Ft?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function Is(t){return new ys((function(e,n){t.onsuccess=function(t){var n=t.target.result;e(n)},t.onerror=function(t){var e=Ts(t.target.error);n(e)}}))}var Ss=!1;function Ts(t){var e=ms._t((0,o.z$)());if(e>=12.2&&e<13){var n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){var r=new Er("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 Ss||(Ss=!0,setTimeout((function(){throw r}),0)),r}}return t}var ks=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Mt=e,r.currentSequenceNumber=n,r}return(0,i.ZT)(e,t),e}(ds);function As(t,e){var n=Cr(t);return ms.It(n.Mt,e)}var Os=function(){function t(t,e,n,r){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=r}return t.prototype.applyToRemoteDocument=function(t,e){for(var n=e.mutationResults,r=0;r<this.mutations.length;r++){var i=this.mutations[r];i.key.isEqual(t.key)&&ko(i,t,n[r])}},t.prototype.applyToLocalView=function(t){for(var e=0,n=this.baseMutations;e<n.length;e++)(o=n[e]).key.isEqual(t.key)&&Ao(o,t,this.localWriteTime);for(var r=0,i=this.mutations;r<i.length;r++){var o;(o=i[r]).key.isEqual(t.key)&&Ao(o,t,this.localWriteTime)}},t.prototype.applyToLocalDocumentSet=function(t){var e=this;this.mutations.forEach((function(n){var r=t.get(n.key),i=r;e.applyToLocalView(i),r.isValidDocument()||i.convertToNoDocument(Fr.min())}))},t.prototype.keys=function(){return this.mutations.reduce((function(t,e){return t.add(e.key)}),ea())},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&Lr(this.mutations,t.mutations,(function(t,e){return xo(t,e)}))&&Lr(this.baseMutations,t.baseMutations,(function(t,e){return xo(t,e)}))},t}(),xs=function(){function t(t,e,n,r){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=r}return t.from=function(e,n,r){Nr(e.mutations.length===r.length);for(var i=$o(),o=e.mutations,a=0;a<o.length;a++)i=i.insert(o[a].key,r[a].version);return new t(e,n,r,i)},t}(),Ns=function(){function t(t,e,n,r,i,o,a){void 0===i&&(i=Fr.min()),void 0===o&&(o=Fr.min()),void 0===a&&(a=zr.EMPTY_BYTE_STRING),this.target=t,this.targetId=e,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a}return t.prototype.withSequenceNumber=function(e){return new t(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken)},t.prototype.withResumeToken=function(e,n){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e)},t.prototype.withLastLimboFreeSnapshotVersion=function(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken)},t}(),Cs=function(t){this.Lt=t};function Ds(t,e){if(e.document)return xa(t.Lt,e.document,!!e.hasCommittedMutations);if(e.noDocument){var n=ii.fromSegments(e.noDocument.path),r=Ms(e.noDocument.readTime),i=_i.newNoDocument(n,r);return e.hasCommittedMutations?i.setHasCommittedMutations():i}if(e.unknownDocument){var o=ii.fromSegments(e.unknownDocument.path);return r=Ms(e.unknownDocument.version),_i.newUnknownDocument(o,r)}return xr()}function Ps(t,e,n){var r=Rs(n),i=e.key.path.popLast().toArray();if(e.isFoundDocument()){var o=function(t,e){return{name:Ea(t,e.key),fields:e.data.value.mapValue.fields,updateTime:ya(t,e.version.toTimestamp())}}(t.Lt,e),a=e.hasCommittedMutations;return new rs(null,null,o,a,r,i)}if(e.isNoDocument()){var s=e.key.path.toArray(),u=js(e.version);return a=e.hasCommittedMutations,new rs(null,new es(s,u),null,a,r,i)}if(e.isUnknownDocument()){var c=e.key.path.toArray(),h=js(e.version);return new rs(new ns(c,h),null,null,!0,r,i)}return xr()}function Rs(t){var e=t.toTimestamp();return[e.seconds,e.nanoseconds]}function Ls(t){var e=new Mr(t[0],t[1]);return Fr.fromTimestamp(e)}function js(t){var e=t.toTimestamp();return new Xa(e.seconds,e.nanoseconds)}function Ms(t){var e=new Mr(t.seconds,t.nanoseconds);return Fr.fromTimestamp(e)}function Fs(t,e){for(var n=(e.baseMutations||[]).map((function(e){return Ca(t.Lt,e)})),r=0;r<e.mutations.length-1;++r){var i=e.mutations[r];if(r+1<e.mutations.length&&void 0!==e.mutations[r+1].transform){var o=e.mutations[r+1];i.updateTransforms=o.transform.fieldTransforms,e.mutations.splice(r+1,1),++r}}var a=e.mutations.map((function(e){return Ca(t.Lt,e)})),s=Mr.fromMillis(e.localWriteTimeMs);return new Os(e.batchId,s,n,a)}function Us(t){var e,n,r=Ms(t.readTime),i=void 0!==t.lastLimboFreeSnapshotVersion?Ms(t.lastLimboFreeSnapshotVersion):Fr.min();return void 0!==t.query.documents?(Nr(1===(n=t.query).documents.length),e=Yi(Ki(Ta(n.documents[0])))):e=function(t){return Yi(Ra(t))}(t.query),new Ns(e,t.targetId,0,t.lastListenSequenceNumber,r,i,zr.fromBase64String(t.resumeToken))}function Vs(t,e){var n,r=js(e.snapshotVersion),i=js(e.lastLimboFreeSnapshotVersion);n=ki(e.target)?Da(t.Lt,e.target):Pa(t.Lt,e.target);var o=e.resumeToken.toBase64();return new os(e.targetId,Si(e.target),r,o,e.sequenceNumber,i,n)}function qs(t){var e=Ra({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?Zi(e,e.limit,"L"):e}var Bs=function(){function t(){}return t.prototype.getBundleMetadata=function(t,e){return Gs(t).get(e).next((function(t){if(t)return{id:(e=t).bundleId,createTime:Ms(e.createTime),version:e.version};var e}))},t.prototype.saveBundleMetadata=function(t,e){return Gs(t).put({bundleId:(n=e).id,createTime:js(ba(n.createTime)),version:n.version});var n},t.prototype.getNamedQuery=function(t,e){return Ks(t).get(e).next((function(t){if(t)return{name:(e=t).name,query:qs(e.bundledQuery),readTime:Ms(e.readTime)};var e}))},t.prototype.saveNamedQuery=function(t,e){return Ks(t).put(function(t){return{name:t.name,readTime:js(ba(t.readTime)),bundledQuery:t.bundledQuery}}(e))},t}();function Gs(t){return As(t,hs.store)}function Ks(t){return As(t,ls.store)}var Hs=function(){function t(){this.Bt=new Ws}return t.prototype.addToCollectionParentIndex=function(t,e){return this.Bt.add(e),ys.resolve()},t.prototype.getCollectionParents=function(t,e){return ys.resolve(this.Bt.getEntries(e))},t}(),Ws=function(){function t(){this.index={}}return t.prototype.add=function(t){var e=t.lastSegment(),n=t.popLast(),r=this.index[e]||new Wo(Gr.comparator),i=!r.has(n);return this.index[e]=r.add(n),i},t.prototype.has=function(t){var e=t.lastSegment(),n=t.popLast(),r=this.index[e];return r&&r.has(n)},t.prototype.getEntries=function(t){return(this.index[t]||new Wo(Gr.comparator)).toArray()},t}(),zs=function(){function t(){this.qt=new Ws}return t.prototype.addToCollectionParentIndex=function(t,e){var n=this;if(!this.qt.has(e)){var r=e.lastSegment(),i=e.popLast();t.addOnCommittedListener((function(){n.qt.add(e)}));var o={collectionId:r,parent:Wa(i)};return Js(t).put(o)}return ys.resolve()},t.prototype.getCollectionParents=function(t,e){var n=[],r=IDBKeyRange.bound([e,""],[jr(e),""],!1,!0);return Js(t).Nt(r).next((function(t){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.collectionId!==e)break;n.push(Qa(o.parent))}return n}))},t}();function Js(t){return As(t,us.store)}var Qs={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},Xs=function(){function t(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}return t.withCacheSize=function(e){return new t(e,t.DEFAULT_COLLECTION_PERCENTILE,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)},t}();function Ys(t,e,n){var r=t.store($a.store),i=t.store(ts.store),o=[],a=IDBKeyRange.only(n.batchId),s=0,u=r.$t({range:a},(function(t,e,n){return s++,n.delete()}));o.push(u.next((function(){Nr(1===s)})));for(var c=[],h=0,l=n.mutations;h<l.length;h++){var f=l[h],p=ts.key(e,f.key.path,n.batchId);o.push(i.delete(p)),c.push(f.key)}return ys.waitFor(o).next((function(){return c}))}function Zs(t){if(!t)return 0;var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw xr();e=t.noDocument}return JSON.stringify(e).length}Xs.DEFAULT_COLLECTION_PERCENTILE=10,Xs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Xs.DEFAULT=new Xs(41943040,Xs.DEFAULT_COLLECTION_PERCENTILE,Xs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Xs.DISABLED=new Xs(-1,0,0);var $s=function(){function t(t,e,n,r){this.userId=t,this.R=e,this.Ut=n,this.referenceDelegate=r,this.Kt={}}return t.Qt=function(e,n,r,i){return Nr(""!==e.uid),new t(e.isAuthenticated()?e.uid:"",n,r,i)},t.prototype.checkEmpty=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return eu(t).$t({index:$a.userMutationsIndex,range:n},(function(t,n,r){e=!1,r.done()})).next((function(){return e}))},t.prototype.addMutationBatch=function(t,e,n,r){var i=this,o=nu(t),a=eu(t);return a.add({}).next((function(s){Nr("number"==typeof s);for(var u=new Os(s,e,n,r),c=function(t,e,n){var r=n.baseMutations.map((function(e){return Na(t.Lt,e)})),i=n.mutations.map((function(e){return Na(t.Lt,e)}));return new $a(e,n.batchId,n.localWriteTime.toMillis(),r,i)}(i.R,i.userId,u),h=[],l=new Wo((function(t,e){return Rr(t.canonicalString(),e.canonicalString())})),f=0,p=r;f<p.length;f++){var d=p[f],v=ts.key(i.userId,d.key.path,s);l=l.add(d.key.path.popLast()),h.push(a.put(c)),h.push(o.put(v,ts.PLACEHOLDER))}return l.forEach((function(e){h.push(i.Ut.addToCollectionParentIndex(t,e))})),t.addOnCommittedListener((function(){i.Kt[s]=u.keys()})),ys.waitFor(h).next((function(){return u}))}))},t.prototype.lookupMutationBatch=function(t,e){var n=this;return eu(t).get(e).next((function(t){return t?(Nr(t.userId===n.userId),Fs(n.R,t)):null}))},t.prototype.jt=function(t,e){var n=this;return this.Kt[e]?ys.resolve(this.Kt[e]):this.lookupMutationBatch(t,e).next((function(t){if(t){var r=t.keys();return n.Kt[e]=r,r}return null}))},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=this,r=e+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return eu(t).$t({index:$a.userMutationsIndex,range:i},(function(t,e,i){e.userId===n.userId&&(Nr(e.batchId>=r),o=Fs(n.R,e)),i.done()})).next((function(){return o}))},t.prototype.getHighestUnacknowledgedBatchId=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return eu(t).$t({index:$a.userMutationsIndex,range:e,reverse:!0},(function(t,e,r){n=e.batchId,r.done()})).next((function(){return n}))},t.prototype.getAllMutationBatches=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return eu(t).Nt($a.userMutationsIndex,n).next((function(t){return t.map((function(t){return Fs(e.R,t)}))}))},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=ts.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return nu(t).$t({range:i},(function(r,i,a){var s=r[0],u=r[1],c=r[2],h=Qa(u);if(s===n.userId&&e.path.isEqual(h))return eu(t).get(c).next((function(t){if(!t)throw xr();Nr(t.userId===n.userId),o.push(Fs(n.R,t))}));a.done()})).next((function(){return o}))},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Wo(Rr),i=[];return e.forEach((function(e){var o=ts.prefixForPath(n.userId,e.path),a=IDBKeyRange.lowerBound(o),s=nu(t).$t({range:a},(function(t,i,o){var a=t[0],s=t[1],u=t[2],c=Qa(s);a===n.userId&&e.path.isEqual(c)?r=r.add(u):o.done()}));i.push(s)})),ys.waitFor(i).next((function(){return n.Wt(t,r)}))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=this,r=e.path,i=r.length+1,o=ts.prefixForPath(this.userId,r),a=IDBKeyRange.lowerBound(o),s=new Wo(Rr);return nu(t).$t({range:a},(function(t,e,o){var a=t[0],u=t[1],c=t[2],h=Qa(u);a===n.userId&&r.isPrefixOf(h)?h.length===i&&(s=s.add(c)):o.done()})).next((function(){return n.Wt(t,s)}))},t.prototype.Wt=function(t,e){var n=this,r=[],i=[];return e.forEach((function(e){i.push(eu(t).get(e).next((function(t){if(null===t)throw xr();Nr(t.userId===n.userId),r.push(Fs(n.R,t))})))})),ys.waitFor(i).next((function(){return r}))},t.prototype.removeMutationBatch=function(t,e){var n=this;return Ys(t.Mt,this.userId,e).next((function(r){return t.addOnCommittedListener((function(){n.Gt(e.batchId)})),ys.forEach(r,(function(e){return n.referenceDelegate.markPotentiallyOrphaned(t,e)}))}))},t.prototype.Gt=function(t){delete this.Kt[t]},t.prototype.performConsistencyCheck=function(t){var e=this;return this.checkEmpty(t).next((function(n){if(!n)return ys.resolve();var r=IDBKeyRange.lowerBound(ts.prefixForUser(e.userId)),i=[];return nu(t).$t({range:r},(function(t,n,r){if(t[0]===e.userId){var o=Qa(t[1]);i.push(o)}else r.done()})).next((function(){Nr(0===i.length)}))}))},t.prototype.containsKey=function(t,e){return tu(t,this.userId,e)},t.prototype.zt=function(t){var e=this;return ru(t).get(this.userId).next((function(t){return t||new Za(e.userId,-1,"")}))},t}();function tu(t,e,n){var r=ts.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),a=!1;return nu(t).$t({range:o,Ft:!0},(function(t,n,r){var o=t[0],s=t[1];t[2],o===e&&s===i&&(a=!0),r.done()})).next((function(){return a}))}function eu(t){return As(t,$a.store)}function nu(t){return As(t,ts.store)}function ru(t){return As(t,Za.store)}var iu=function(){function t(t){this.Ht=t}return t.prototype.next=function(){return this.Ht+=2,this.Ht},t.Jt=function(){return new t(0)},t.Yt=function(){return new t(-1)},t}(),ou=function(){function t(t,e){this.referenceDelegate=t,this.R=e}return t.prototype.allocateTargetId=function(t){var e=this;return this.Xt(t).next((function(n){var r=new iu(n.highestTargetId);return n.highestTargetId=r.next(),e.Zt(t,n).next((function(){return n.highestTargetId}))}))},t.prototype.getLastRemoteSnapshotVersion=function(t){return this.Xt(t).next((function(t){return Fr.fromTimestamp(new Mr(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))}))},t.prototype.getHighestSequenceNumber=function(t){return this.Xt(t).next((function(t){return t.highestListenSequenceNumber}))},t.prototype.setTargetsMetadata=function(t,e,n){var r=this;return this.Xt(t).next((function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.Zt(t,i)}))},t.prototype.addTargetData=function(t,e){var n=this;return this.te(t,e).next((function(){return n.Xt(t).next((function(r){return r.targetCount+=1,n.ee(e,r),n.Zt(t,r)}))}))},t.prototype.updateTargetData=function(t,e){return this.te(t,e)},t.prototype.removeTargetData=function(t,e){var n=this;return this.removeMatchingKeysForTargetId(t,e.targetId).next((function(){return au(t).delete(e.targetId)})).next((function(){return n.Xt(t)})).next((function(e){return Nr(e.targetCount>0),e.targetCount-=1,n.Zt(t,e)}))},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return au(t).$t((function(a,s){var u=Us(s);u.sequenceNumber<=e&&null===n.get(u.targetId)&&(i++,o.push(r.removeTargetData(t,u)))})).next((function(){return ys.waitFor(o)})).next((function(){return i}))},t.prototype.forEachTarget=function(t,e){return au(t).$t((function(t,n){var r=Us(n);e(r)}))},t.prototype.Xt=function(t){return su(t).get(ss.key).next((function(t){return Nr(null!==t),t}))},t.prototype.Zt=function(t,e){return su(t).put(ss.key,e)},t.prototype.te=function(t,e){return au(t).put(Vs(this.R,e))},t.prototype.ee=function(t,e){var n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},t.prototype.getTargetCount=function(t){return this.Xt(t).next((function(t){return t.targetCount}))},t.prototype.getTargetData=function(t,e){var n=Si(e),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return au(t).$t({range:r,index:os.queryTargetsIndexName},(function(t,n,r){var o=Us(n);Ti(e,o.target)&&(i=o,r.done())})).next((function(){return i}))},t.prototype.addMatchingKeys=function(t,e,n){var r=this,i=[],o=uu(t);return e.forEach((function(e){var a=Wa(e.path);i.push(o.put(new as(n,a))),i.push(r.referenceDelegate.addReference(t,n,e))})),ys.waitFor(i)},t.prototype.removeMatchingKeys=function(t,e,n){var r=this,i=uu(t);return ys.forEach(e,(function(e){var o=Wa(e.path);return ys.waitFor([i.delete([n,o]),r.referenceDelegate.removeReference(t,n,e)])}))},t.prototype.removeMatchingKeysForTargetId=function(t,e){var n=uu(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=uu(t),i=ea();return r.$t({range:n,Ft:!0},(function(t,e,n){var r=Qa(t[1]),o=new ii(r);i=i.add(o)})).next((function(){return i}))},t.prototype.containsKey=function(t,e){var n=Wa(e.path),r=IDBKeyRange.bound([n],[jr(n)],!1,!0),i=0;return uu(t).$t({index:as.documentTargetsIndex,Ft:!0,range:r},(function(t,e,n){var r=t[0];t[1],0!==r&&(i++,n.done())})).next((function(){return i>0}))},t.prototype.lt=function(t,e){return au(t).get(e).next((function(t){return t?Us(t):null}))},t}();function au(t){return As(t,os.store)}function su(t){return As(t,ss.store)}function uu(t){return As(t,as.store)}function cu(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){if(t.code!==_r.FAILED_PRECONDITION||t.message!==ps)throw t;return Tr("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}function hu(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Rr(n,i);return 0===a?Rr(r,o):a}var lu=function(){function t(t){this.ne=t,this.buffer=new Wo(hu),this.se=0}return t.prototype.ie=function(){return++this.se},t.prototype.re=function(t){var e=[t,this.ie()];if(this.buffer.size<this.ne)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();hu(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!1,configurable:!0}),t}(),fu=function(){function t(t,e){this.garbageCollector=t,this.asyncQueue=e,this.oe=!1,this.ce=null}return t.prototype.start=function(t){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.ue(t)},t.prototype.stop=function(){this.ce&&(this.ce.cancel(),this.ce=null)},Object.defineProperty(t.prototype,"started",{get:function(){return null!==this.ce},enumerable:!1,configurable:!0}),t.prototype.ue=function(t){var e=this,n=this.oe?3e5:6e4;Tr("LruGarbageCollector","Garbage collection scheduled in "+n+"ms"),this.ce=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",n,(function(){return(0,i.mG)(e,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:this.ce=null,this.oe=!0,n.label=1;case 1:return n.trys.push([1,3,,7]),[4,t.collectGarbage(this.garbageCollector)];case 2:return n.sent(),[3,7];case 3:return _s(e=n.sent())?(Tr("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e),[3,6]):[3,4];case 4:return[4,cu(e)];case 5:n.sent(),n.label=6;case 6:return[3,7];case 7:return[4,this.ue(t)];case 8:return n.sent(),[2]}}))}))}))},t}(),pu=function(){function t(t,e){this.ae=t,this.params=e}return t.prototype.calculateTargetCount=function(t,e){return this.ae.he(t).next((function(t){return Math.floor(e/100*t)}))},t.prototype.nthSequenceNumber=function(t,e){var n=this;if(0===e)return ys.resolve(wr.o);var r=new lu(e);return this.ae.forEachTarget(t,(function(t){return r.re(t.sequenceNumber)})).next((function(){return n.ae.le(t,(function(t){return r.re(t)}))})).next((function(){return r.maxValue}))},t.prototype.removeTargets=function(t,e,n){return this.ae.removeTargets(t,e,n)},t.prototype.removeOrphanedDocuments=function(t,e){return this.ae.removeOrphanedDocuments(t,e)},t.prototype.collect=function(t,e){var n=this;return-1===this.params.cacheSizeCollectionThreshold?(Tr("LruGarbageCollector","Garbage collection skipped; disabled"),ys.resolve(Qs)):this.getCacheSize(t).next((function(r){return r<n.params.cacheSizeCollectionThreshold?(Tr("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.cacheSizeCollectionThreshold),Qs):n.fe(t,e)}))},t.prototype.getCacheSize=function(t){return this.ae.getCacheSize(t)},t.prototype.fe=function(t,e){var n,r,i,o,s,u,c,h=this,l=Date.now();return this.calculateTargetCount(t,this.params.percentileToCollect).next((function(e){return e>h.params.maximumSequenceNumbersToCollect?(Tr("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+h.params.maximumSequenceNumbersToCollect+" from "+e),r=h.params.maximumSequenceNumbersToCollect):r=e,o=Date.now(),h.nthSequenceNumber(t,r)})).next((function(r){return n=r,s=Date.now(),h.removeTargets(t,n,e)})).next((function(e){return i=e,u=Date.now(),h.removeOrphanedDocuments(t,n)})).next((function(t){return c=Date.now(),Sr()<=a.in.DEBUG&&Tr("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(o-l)+"ms\n\tDetermined least recently used "+r+" in "+(s-o)+"ms\n\tRemoved "+i+" targets in "+(u-s)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-l)+"ms"),ys.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:t})}))},t}(),du=function(){function t(t,e){this.db=t,this.garbageCollector=function(t,e){return new pu(t,e)}(this,e)}return t.prototype.he=function(t){var e=this.de(t);return this.db.getTargetCache().getTargetCount(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.de=function(t){var e=0;return this.le(t,(function(t){e++})).next((function(){return e}))},t.prototype.forEachTarget=function(t,e){return this.db.getTargetCache().forEachTarget(t,e)},t.prototype.le=function(t,e){return this.we(t,(function(t,n){return e(n)}))},t.prototype.addReference=function(t,e,n){return vu(t,n)},t.prototype.removeReference=function(t,e,n){return vu(t,n)},t.prototype.removeTargets=function(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)},t.prototype.markPotentiallyOrphaned=function(t,e){return vu(t,e)},t.prototype._e=function(t,e){return function(t,e){var n=!1;return ru(t).Ot((function(r){return tu(t,r,e).next((function(t){return t&&(n=!0),ys.resolve(!t)}))})).next((function(){return n}))}(t,e)},t.prototype.removeOrphanedDocuments=function(t,e){var n=this,r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],o=0;return this.we(t,(function(a,s){if(s<=e){var u=n._e(t,a).next((function(e){if(!e)return o++,r.getEntry(t,a).next((function(){return r.removeEntry(a),uu(t).delete([0,Wa(a.path)])}))}));i.push(u)}})).next((function(){return ys.waitFor(i)})).next((function(){return r.apply(t)})).next((function(){return o}))},t.prototype.removeTarget=function(t,e){var n=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,n)},t.prototype.updateLimboDocument=function(t,e){return vu(t,e)},t.prototype.we=function(t,e){var n,r=uu(t),i=wr.o;return r.$t({index:as.documentTargetsIndex},(function(t,r){var o=t[0];t[1];var a=r.path,s=r.sequenceNumber;0===o?(i!==wr.o&&e(new ii(Qa(n)),i),i=s,n=a):i=wr.o})).next((function(){i!==wr.o&&e(new ii(Qa(n)),i)}))},t.prototype.getCacheSize=function(t){return this.db.getRemoteDocumentCache().getSize(t)},t}();function vu(t,e){return uu(t).put(function(t,e){return new as(0,Wa(t.path),e)}(e,t.currentSequenceNumber))}var yu=function(){function t(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={}}return t.prototype.get=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[0],s=o[1];if(this.equalsFn(a,t))return s}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.mapKeyFn(t),r=this.inner[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(this.equalsFn(r[i][0],t))return void(r[i]=[t,e]);r.push([t,e])}else this.inner[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.equalsFn(n[r][0],t))return 1===n.length?delete this.inner[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){Vr(this.inner,(function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[0],s=o[1];t(a,s)}}))},t.prototype.isEmpty=function(){return qr(this.inner)},t}(),gu=function(){function t(){this.changes=new yu((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),this.changesApplied=!1}return t.prototype.getReadTime=function(t){var e=this.changes.get(t);return e?e.readTime:Fr.min()},t.prototype.addEntry=function(t,e){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:e})},t.prototype.removeEntry=function(t,e){void 0===e&&(e=null),this.assertNotApplied(),this.changes.set(t,{document:_i.newInvalidDocument(t),readTime:e})},t.prototype.getEntry=function(t,e){this.assertNotApplied();var n=this.changes.get(e);return void 0!==n?ys.resolve(n.document):this.getFromCache(t,e)},t.prototype.getEntries=function(t,e){return this.getAllFromCache(t,e)},t.prototype.apply=function(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)},t.prototype.assertNotApplied=function(){},t}(),mu=function(){function t(t,e){this.R=t,this.Ut=e}return t.prototype.addEntry=function(t,e,n){return _u(t).put(Eu(e),n)},t.prototype.removeEntry=function(t,e){var n=_u(t),r=Eu(e);return n.delete(r)},t.prototype.updateMetadata=function(t,e){var n=this;return this.getMetadata(t).next((function(r){return r.byteSize+=e,n.me(t,r)}))},t.prototype.getEntry=function(t,e){var n=this;return _u(t).get(Eu(e)).next((function(t){return n.ye(e,t)}))},t.prototype.ge=function(t,e){var n=this;return _u(t).get(Eu(e)).next((function(t){return{document:n.ye(e,t),size:Zs(t)}}))},t.prototype.getEntries=function(t,e){var n=this,r=Qo();return this.pe(t,e,(function(t,e){var i=n.ye(t,e);r=r.insert(t,i)})).next((function(){return r}))},t.prototype.Ee=function(t,e){var n=this,r=Qo(),i=new Go(ii.comparator);return this.pe(t,e,(function(t,e){var o=n.ye(t,e);r=r.insert(t,o),i=i.insert(t,Zs(e))})).next((function(){return{documents:r,Te:i}}))},t.prototype.pe=function(t,e,n){if(e.isEmpty())return ys.resolve();var r=IDBKeyRange.bound(e.first().path.toArray(),e.last().path.toArray()),i=e.getIterator(),o=i.getNext();return _u(t).$t({range:r},(function(t,e,r){for(var a=ii.fromSegments(t);o&&ii.comparator(o,a)<0;)n(o,null),o=i.getNext();o&&o.isEqual(a)&&(n(o,e),o=i.hasNext()?i.getNext():null),o?r.Ct(o.path.toArray()):r.done()})).next((function(){for(;o;)n(o,null),o=i.hasNext()?i.getNext():null}))},t.prototype.getDocumentsMatchingQuery=function(t,e,n){var r=this,i=Qo(),o=e.path.length+1,a={};if(n.isEqual(Fr.min())){var s=e.path.toArray();a.range=IDBKeyRange.lowerBound(s)}else{var u=e.path.toArray(),c=Rs(n);a.range=IDBKeyRange.lowerBound([u,c],!0),a.index=rs.collectionReadTimeIndex}return _u(t).$t(a,(function(t,n,a){if(t.length===o){var s=Ds(r.R,n);e.path.isPrefixOf(s.key.path)?no(e,s)&&(i=i.insert(s.key,s)):a.done()}})).next((function(){return i}))},t.prototype.newChangeBuffer=function(t){return new bu(this,!!t&&t.trackRemovals)},t.prototype.getSize=function(t){return this.getMetadata(t).next((function(t){return t.byteSize}))},t.prototype.getMetadata=function(t){return wu(t).get(is.key).next((function(t){return Nr(!!t),t}))},t.prototype.me=function(t,e){return wu(t).put(is.key,e)},t.prototype.ye=function(t,e){if(e){var n=Ds(this.R,e);if(!n.isNoDocument()||!n.version.isEqual(Fr.min()))return n}return _i.newInvalidDocument(t)},t}(),bu=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Ie=e,r.trackRemovals=n,r.Ae=new yu((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),r}return(0,i.ZT)(e,t),e.prototype.applyChanges=function(t){var e=this,n=[],r=0,i=new Wo((function(t,e){return Rr(t.canonicalString(),e.canonicalString())}));return this.changes.forEach((function(o,a){var s=e.Ae.get(o);if(a.document.isValidDocument()){var u=Ps(e.Ie.R,a.document,e.getReadTime(o));i=i.add(o.path.popLast());var c=Zs(u);r+=c-s,n.push(e.Ie.addEntry(t,o,u))}else if(r-=s,e.trackRemovals){var h=Ps(e.Ie.R,_i.newNoDocument(o,Fr.min()),e.getReadTime(o));n.push(e.Ie.addEntry(t,o,h))}else n.push(e.Ie.removeEntry(t,o))})),i.forEach((function(r){n.push(e.Ie.Ut.addToCollectionParentIndex(t,r))})),n.push(this.Ie.updateMetadata(t,r)),ys.waitFor(n)},e.prototype.getFromCache=function(t,e){var n=this;return this.Ie.ge(t,e).next((function(t){return n.Ae.set(e,t.size),t.document}))},e.prototype.getAllFromCache=function(t,e){var n=this;return this.Ie.Ee(t,e).next((function(t){var e=t.documents;return t.Te.forEach((function(t,e){n.Ae.set(t,e)})),e}))},e}(gu);function wu(t){return As(t,is.store)}function _u(t){return As(t,rs.store)}function Eu(t){return t.path.toArray()}var Iu=function(){function t(t){this.R=t}return t.prototype.Rt=function(t,e,n,r){var i=this;Nr(n<r&&n>=0&&r<=11);var o=new gs("createOrUpgrade",e);n<1&&r>=1&&(function(t){t.createObjectStore(Ya.store)}(t),function(t){t.createObjectStore(Za.store,{keyPath:Za.keyPath}),t.createObjectStore($a.store,{keyPath:$a.keyPath,autoIncrement:!0}).createIndex($a.userMutationsIndex,$a.userMutationsKeyPath,{unique:!0}),t.createObjectStore(ts.store)}(t),Su(t),function(t){t.createObjectStore(rs.store)}(t));var a=ys.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(as.store),t.deleteObjectStore(os.store),t.deleteObjectStore(ss.store)}(t),Su(t)),a=a.next((function(){return function(t){var e=t.store(ss.store),n=new ss(0,0,Fr.min().toTimestamp(),0);return e.put(ss.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(a=a.next((function(){return function(t,e){return e.store($a.store).Nt().next((function(n){t.deleteObjectStore($a.store),t.createObjectStore($a.store,{keyPath:$a.keyPath,autoIncrement:!0}).createIndex($a.userMutationsIndex,$a.userMutationsKeyPath,{unique:!0});var r=e.store($a.store),i=n.map((function(t){return r.put(t)}));return ys.waitFor(i)}))}(t,o)}))),a=a.next((function(){!function(t){t.createObjectStore(cs.store,{keyPath:cs.keyPath})}(t)}))),n<5&&r>=5&&(a=a.next((function(){return i.Re(o)}))),n<6&&r>=6&&(a=a.next((function(){return function(t){t.createObjectStore(is.store)}(t),i.be(o)}))),n<7&&r>=7&&(a=a.next((function(){return i.ve(o)}))),n<8&&r>=8&&(a=a.next((function(){return i.Pe(t,o)}))),n<9&&r>=9&&(a=a.next((function(){!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){var e=t.objectStore(rs.store);e.createIndex(rs.readTimeIndex,rs.readTimeIndexPath,{unique:!1}),e.createIndex(rs.collectionReadTimeIndex,rs.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&r>=10&&(a=a.next((function(){return i.Ve(o)}))),n<11&&r>=11&&(a=a.next((function(){!function(t){t.createObjectStore(hs.store,{keyPath:hs.keyPath})}(t),function(t){t.createObjectStore(ls.store,{keyPath:ls.keyPath})}(t)}))),a},t.prototype.be=function(t){var e=0;return t.store(rs.store).$t((function(t,n){e+=Zs(n)})).next((function(){var n=new is(e);return t.store(is.store).put(is.key,n)}))},t.prototype.Re=function(t){var e=this,n=t.store(Za.store),r=t.store($a.store);return n.Nt().next((function(n){return ys.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Nt($a.userMutationsIndex,i).next((function(r){return ys.forEach(r,(function(r){Nr(r.userId===n.userId);var i=Fs(e.R,r);return Ys(t,n.userId,i).next((function(){}))}))}))}))}))},t.prototype.ve=function(t){var e=t.store(as.store),n=t.store(rs.store);return t.store(ss.store).get(ss.key).next((function(t){var r=[];return n.$t((function(n,i){var o=new Gr(n),a=function(t){return[0,Wa(t)]}(o);r.push(e.get(a).next((function(n){return n?ys.resolve():function(n){return e.put(new as(0,Wa(n),t.highestListenSequenceNumber))}(o)})))})).next((function(){return ys.waitFor(r)}))}))},t.prototype.Pe=function(t,e){t.createObjectStore(us.store,{keyPath:us.keyPath});var n=e.store(us.store),r=new Ws,i=function(t){if(r.add(t)){var e=t.lastSegment(),i=t.popLast();return n.put({collectionId:e,parent:Wa(i)})}};return e.store(rs.store).$t({Ft:!0},(function(t,e){var n=new Gr(t);return i(n.popLast())})).next((function(){return e.store(ts.store).$t({Ft:!0},(function(t,e){t[0];var n=t[1];t[2];var r=Qa(n);return i(r.popLast())}))}))},t.prototype.Ve=function(t){var e=this,n=t.store(os.store);return n.$t((function(t,r){var i=Us(r),o=Vs(e.R,i);return n.put(o)}))},t}();function Su(t){t.createObjectStore(as.store,{keyPath:as.keyPath}).createIndex(as.documentTargetsIndex,as.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(os.store,{keyPath:os.keyPath}).createIndex(os.queryTargetsIndexName,os.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(ss.store)}var Tu="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.",ku=function(){function t(e,n,r,i,o,a,s,u,c,h){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Se=o,this.window=a,this.document=s,this.De=c,this.Ce=h,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(t){return Promise.resolve()},!t.yt())throw new Er(_r.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new du(this,i),this.Le=n+"main",this.R=new Cs(u),this.Be=new ms(this.Le,11,new Iu(this.R)),this.qe=new ou(this.referenceDelegate,this.R),this.Ut=new zs,this.Ue=function(t,e){return new mu(t,e)}(this.R,this.Ut),this.Ke=new Bs,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,!1===h&&kr("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return t.prototype.start=function(){var t=this;return this.je().then((function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new Er(_r.FAILED_PRECONDITION,Tu);return t.We(),t.Ge(),t.ze(),t.runTransaction("getHighestListenSequenceNumber","readonly",(function(e){return t.qe.getHighestSequenceNumber(e)}))})).then((function(e){t.Ne=new wr(e,t.De)})).then((function(){t.xe=!0})).catch((function(e){return t.Be&&t.Be.close(),Promise.reject(e)}))},t.prototype.He=function(t){var e=this;return this.Me=function(n){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){return this.started?[2,t(n)]:[2]}))}))},t(this.isPrimary)},t.prototype.setDatabaseDeletedListener=function(t){var e=this;this.Be.vt((function(n){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return null===n.newVersion?[4,t()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.setNetworkEnabled=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.Se.enqueueAndForget((function(){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))})))},t.prototype.je=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(e){return Ou(e).put(new cs(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next((function(){if(t.isPrimary)return t.Je(e).next((function(e){e||(t.isPrimary=!1,t.Se.enqueueRetryable((function(){return t.Me(!1)})))}))})).next((function(){return t.Ye(e)})).next((function(n){return t.isPrimary&&!n?t.Xe(e).next((function(){return!1})):!!n&&t.Ze(e).next((function(){return!0}))}))})).catch((function(e){if(_s(e))return Tr("IndexedDbPersistence","Failed to extend owner lease: ",e),t.isPrimary;if(!t.allowTabSynchronization)throw e;return Tr("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((function(e){t.isPrimary!==e&&t.Se.enqueueRetryable((function(){return t.Me(e)})),t.isPrimary=e}))},t.prototype.Je=function(t){var e=this;return Au(t).get(Ya.key).next((function(t){return ys.resolve(e.tn(t))}))},t.prototype.en=function(t){return Ou(t).delete(this.clientId)},t.prototype.nn=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,n,r,o=this;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return!this.isPrimary||this.sn(this.Oe,18e5)?[3,2]:(this.Oe=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(t){var e=As(t,cs.store);return e.Nt().next((function(t){var n=o.rn(t,18e5),r=t.filter((function(t){return-1===n.indexOf(t)}));return ys.forEach(r,(function(t){return e.delete(t.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(t=i.sent(),this.Qe)for(e=0,n=t;e<n.length;e++)r=n[e],this.Qe.removeItem(this.on(r.clientId));i.label=2;case 2:return[2]}}))}))},t.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()}))}))},t.prototype.tn=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.Ye=function(t){var e=this;return this.Ce?ys.resolve(!0):Au(t).get(Ya.key).next((function(n){if(null!==n&&e.sn(n.leaseTimestampMs,5e3)&&!e.cn(n.ownerId)){if(e.tn(n)&&e.networkEnabled)return!0;if(!e.tn(n)){if(!n.allowTabSynchronization)throw new Er(_r.FAILED_PRECONDITION,Tu);return!1}}return!(!e.networkEnabled||!e.inForeground)||Ou(t).Nt().next((function(t){return void 0===e.rn(t,5e3).find((function(t){if(e.clientId!==t.clientId){var n=!e.networkEnabled&&t.networkEnabled,r=!e.inForeground&&t.inForeground,i=e.networkEnabled===t.networkEnabled;if(n||r&&i)return!0}return!1}))}))})).next((function(t){return e.isPrimary!==t&&Tr("IndexedDbPersistence","Client "+(t?"is":"is not")+" eligible for a primary lease."),t}))},t.prototype.shutdown=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t=this;return(0,i.Jh)(this,(function(e){switch(e.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",[Ya.store,cs.store],(function(e){var n=new ks(e,wr.o);return t.Xe(n).next((function(){return t.en(n)}))}))];case 1:return e.sent(),this.Be.close(),this.ln(),[2]}}))}))},t.prototype.rn=function(t,e){var n=this;return t.filter((function(t){return n.sn(t.updateTimeMs,e)&&!n.cn(t.clientId)}))},t.prototype.fn=function(){var t=this;return this.runTransaction("getActiveClients","readonly",(function(e){return Ou(e).Nt().next((function(e){return t.rn(e,18e5).map((function(t){return t.clientId}))}))}))},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.getMutationQueue=function(t){return $s.Qt(t,this.R,this.Ut,this.referenceDelegate)},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getBundleCache=function(){return this.Ke},t.prototype.runTransaction=function(t,e,n){var r=this;Tr("IndexedDbPersistence","Starting transaction:",t);var i,o="readonly"===e?"readonly":"readwrite";return this.Be.runTransaction(t,o,fs,(function(o){return i=new ks(o,r.Ne?r.Ne.next():wr.o),"readwrite-primary"===e?r.Je(i).next((function(t){return!!t||r.Ye(i)})).next((function(e){if(!e)throw kr("Failed to obtain primary lease for action '"+t+"'."),r.isPrimary=!1,r.Se.enqueueRetryable((function(){return r.Me(!1)})),new Er(_r.FAILED_PRECONDITION,ps);return n(i)})).next((function(t){return r.Ze(i).next((function(){return t}))})):r.dn(i).next((function(){return n(i)}))})).then((function(t){return i.raiseOnCommittedEvent(),t}))},t.prototype.dn=function(t){var e=this;return Au(t).get(Ya.key).next((function(t){if(null!==t&&e.sn(t.leaseTimestampMs,5e3)&&!e.cn(t.ownerId)&&!e.tn(t)&&!(e.Ce||e.allowTabSynchronization&&t.allowTabSynchronization))throw new Er(_r.FAILED_PRECONDITION,Tu)}))},t.prototype.Ze=function(t){var e=new Ya(this.clientId,this.allowTabSynchronization,Date.now());return Au(t).put(Ya.key,e)},t.yt=function(){return ms.yt()},t.prototype.Xe=function(t){var e=this,n=Au(t);return n.get(Ya.key).next((function(t){return e.tn(t)?(Tr("IndexedDbPersistence","Releasing primary lease."),n.delete(Ya.key)):ys.resolve()}))},t.prototype.sn=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(kr("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.We=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Fe=function(){t.Se.enqueueAndForget((function(){return t.inForeground="visible"===t.document.visibilityState,t.je()}))},this.document.addEventListener("visibilitychange",this.Fe),this.inForeground="visible"===this.document.visibilityState)},t.prototype.an=function(){this.Fe&&(this.document.removeEventListener("visibilitychange",this.Fe),this.Fe=null)},t.prototype.Ge=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.ke=function(){e.un(),(0,o.G6)()&&navigator.appVersion.match("Version/14")&&e.Se.enterRestrictedMode(!0),e.Se.enqueueAndForget((function(){return e.shutdown()}))},this.window.addEventListener("pagehide",this.ke))},t.prototype.hn=function(){this.ke&&(this.window.removeEventListener("pagehide",this.ke),this.ke=null)},t.prototype.cn=function(t){var e;try{var n=null!==(null===(e=this.Qe)||void 0===e?void 0:e.getItem(this.on(t)));return Tr("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return kr("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},t.prototype.un=function(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(t){kr("Failed to set zombie client id.",t)}},t.prototype.ln=function(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch(t){}},t.prototype.on=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t}();function Au(t){return As(t,Ya.store)}function Ou(t){return As(t,cs.store)}function xu(t,e){var n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var Nu=function(t,e){this.progress=t,this.wn=e},Cu=function(){function t(t,e,n){this.Ue=t,this._n=e,this.Ut=n}return t.prototype.mn=function(t,e){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKey(t,e).next((function(r){return n.yn(t,e,r)}))},t.prototype.yn=function(t,e,n){return this.Ue.getEntry(t,e).next((function(t){for(var e=0,r=n;e<r.length;e++)r[e].applyToLocalView(t);return t}))},t.prototype.gn=function(t,e){t.forEach((function(t,n){for(var r=0,i=e;r<i.length;r++)i[r].applyToLocalView(n)}))},t.prototype.pn=function(t,e){var n=this;return this.Ue.getEntries(t,e).next((function(e){return n.En(t,e).next((function(){return e}))}))},t.prototype.En=function(t,e){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKeys(t,e).next((function(t){return n.gn(e,t)}))},t.prototype.getDocumentsMatchingQuery=function(t,e,n){return function(t){return ii.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Tn(t,e.path):Qi(e)?this.In(t,e,n):this.An(t,e,n)},t.prototype.Tn=function(t,e){return this.mn(t,new ii(e)).next((function(t){var e=Yo();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e}))},t.prototype.In=function(t,e,n){var r=this,i=e.collectionGroup,o=Yo();return this.Ut.getCollectionParents(t,i).next((function(a){return ys.forEach(a,(function(a){var s=function(t,e){return new Bi(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,a.child(i));return r.An(t,s,n).next((function(t){t.forEach((function(t,e){o=o.insert(t,e)}))}))})).next((function(){return o}))}))},t.prototype.An=function(t,e,n){var r,i,o=this;return this.Ue.getDocumentsMatchingQuery(t,e,n).next((function(n){return r=n,o._n.getAllMutationBatchesAffectingQuery(t,e)})).next((function(e){return i=e,o.Rn(t,i,r).next((function(t){r=t;for(var e=0,n=i;e<n.length;e++)for(var o=n[e],a=0,s=o.mutations;a<s.length;a++){var u=s[a],c=u.key,h=r.get(c);null==h&&(h=_i.newInvalidDocument(c),r=r.insert(c,h)),Ao(u,h,o.localWriteTime),h.isFoundDocument()||(r=r.remove(c))}}))})).next((function(){return r.forEach((function(t,n){no(e,n)||(r=r.remove(t))})),r}))},t.prototype.Rn=function(t,e,n){for(var r=ea(),i=0,o=e;i<o.length;i++)for(var a=0,s=o[i].mutations;a<s.length;a++){var u=s[a];u instanceof Do&&null===n.get(u.key)&&(r=r.add(u.key))}var c=n;return this.Ue.getEntries(t,r).next((function(t){return t.forEach((function(t,e){e.isFoundDocument()&&(c=c.insert(t,e))})),c}))},t}(),Du=function(){function t(t,e,n,r){this.targetId=t,this.fromCache=e,this.bn=n,this.vn=r}return t.Pn=function(e,n){for(var r=ea(),i=ea(),o=0,a=n.docChanges;o<a.length;o++){var s=a[o];switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}}return new t(e,n.fromCache,r,i)},t}(),Pu=function(){function t(){}return t.prototype.Vn=function(t){this.Sn=t},t.prototype.getDocumentsMatchingQuery=function(t,e,n,r){var i=this;return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}(e)||n.isEqual(Fr.min())?this.Dn(t,e):this.Sn.pn(t,r).next((function(o){var s=i.Cn(e,o);return(Hi(e)||Wi(e))&&i.Nn(e.limitType,s,r,n)?i.Dn(t,e):(Sr()<=a.in.DEBUG&&Tr("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),eo(e)),i.Sn.getDocumentsMatchingQuery(t,e,n).next((function(t){return s.forEach((function(e){t=t.insert(e.key,e)})),t})))}))},t.prototype.Cn=function(t,e){var n=new Wo(ro(t));return e.forEach((function(e,r){no(t,r)&&(n=n.add(r))})),n},t.prototype.Nn=function(t,e,n,r){if(n.size!==e.size)return!0;var i="F"===t?e.last():e.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)},t.prototype.Dn=function(t,e){return Sr()<=a.in.DEBUG&&Tr("QueryEngine","Using full collection scan to execute query:",eo(e)),this.Sn.getDocumentsMatchingQuery(t,e,Fr.min())},t}(),Ru=function(){function t(t,e,n,r){this.persistence=t,this.xn=e,this.R=r,this.kn=new Go(Rr),this.Fn=new yu((function(t){return Si(t)}),Ti),this.$n=Fr.min(),this._n=t.getMutationQueue(n),this.On=t.getRemoteDocumentCache(),this.qe=t.getTargetCache(),this.Mn=new Cu(this.On,this._n,this.persistence.getIndexManager()),this.Ke=t.getBundleCache(),this.xn.Vn(this.Mn)}return t.prototype.collectGarbage=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return t.collect(n,e.kn)}))},t}();function Lu(t,e,n,r){return new Ru(t,e,n,r)}function ju(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Cr(t),r=n._n,o=n.Mn,[4,n.persistence.runTransaction("Handle user change","readonly",(function(t){var i;return n._n.getAllMutationBatches(t).next((function(a){return i=a,r=n.persistence.getMutationQueue(e),o=new Cu(n.On,r,n.persistence.getIndexManager()),r.getAllMutationBatches(t)})).next((function(e){for(var n=[],r=[],a=ea(),s=0,u=i;s<u.length;s++){var c=u[s];n.push(c.batchId);for(var h=0,l=c.mutations;h<l.length;h++){var f=l[h];a=a.add(f.key)}}for(var p=0,d=e;p<d.length;p++){var v=d[p];r.push(v.batchId);for(var y=0,g=v.mutations;y<g.length;y++){var m=g[y];a=a.add(m.key)}}return o.pn(t,a).next((function(t){return{Ln:t,removedBatchIds:n,addedBatchIds:r}}))}))}))];case 1:return a=i.sent(),[2,(n._n=r,n.Mn=o,n.xn.Vn(n.Mn),a)]}}))}))}function Mu(t,e){var n=Cr(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(t){var r=e.batch.keys(),i=n.On.newChangeBuffer({trackRemovals:!0});return function(t,e,n,r){var i=n.batch,o=i.keys(),a=ys.resolve();return o.forEach((function(t){a=a.next((function(){return r.getEntry(e,t)})).next((function(e){var o=n.docVersions.get(t);Nr(null!==o),e.version.compareTo(o)<0&&(i.applyToRemoteDocument(e,n),e.isValidDocument()&&r.addEntry(e,n.commitVersion))}))})),a.next((function(){return t._n.removeMutationBatch(e,i)}))}(n,t,e,i).next((function(){return i.apply(t)})).next((function(){return n._n.performConsistencyCheck(t)})).next((function(){return n.Mn.pn(t,r)}))}))}function Fu(t){var e=Cr(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(function(t){return e.qe.getLastRemoteSnapshotVersion(t)}))}function Uu(t,e){var n=Cr(t),r=e.snapshotVersion,i=n.kn;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(t){var o=n.On.newChangeBuffer({trackRemovals:!0});i=n.kn;var a=[];e.targetChanges.forEach((function(e,o){var s=i.get(o);if(s){a.push(n.qe.removeMatchingKeys(t,e.removedDocuments,o).next((function(){return n.qe.addMatchingKeys(t,e.addedDocuments,o)})));var u=e.resumeToken;if(u.approximateByteSize()>0){var c=s.withResumeToken(u,r).withSequenceNumber(t.currentSequenceNumber);i=i.insert(o,c),function(t,e,n){return Nr(e.resumeToken.approximateByteSize()>0),0===t.resumeToken.approximateByteSize()||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(s,c,e)&&a.push(n.qe.updateTargetData(t,c))}}}));var s=Qo();if(e.documentUpdates.forEach((function(r,i){e.resolvedLimboDocuments.has(r)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(t,r))})),a.push(Vu(t,o,e.documentUpdates,r,void 0).next((function(t){s=t}))),!r.isEqual(Fr.min())){var u=n.qe.getLastRemoteSnapshotVersion(t).next((function(e){return n.qe.setTargetsMetadata(t,t.currentSequenceNumber,r)}));a.push(u)}return ys.waitFor(a).next((function(){return o.apply(t)})).next((function(){return n.Mn.En(t,s)})).next((function(){return s}))})).then((function(t){return n.kn=i,t}))}function Vu(t,e,n,r,i){var o=ea();return n.forEach((function(t){return o=o.add(t)})),e.getEntries(t,o).next((function(t){var o=Qo();return n.forEach((function(n,a){var s=t.get(n),u=(null==i?void 0:i.get(n))||r;a.isNoDocument()&&a.version.isEqual(Fr.min())?(e.removeEntry(n,u),o=o.insert(n,a)):!s.isValidDocument()||a.version.compareTo(s.version)>0||0===a.version.compareTo(s.version)&&s.hasPendingWrites?(e.addEntry(a,u),o=o.insert(n,a)):Tr("LocalStore","Ignoring outdated watch update for ",n,". Current version:",s.version," Watch version:",a.version)})),o}))}function qu(t,e){var n=Cr(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(t){return void 0===e&&(e=-1),n._n.getNextMutationBatchAfterBatchId(t,e)}))}function Bu(t,e){var n=Cr(t);return n.persistence.runTransaction("Allocate target","readwrite",(function(t){var r;return n.qe.getTargetData(t,e).next((function(i){return i?(r=i,ys.resolve(r)):n.qe.allocateTargetId(t).next((function(i){return r=new Ns(e,i,0,t.currentSequenceNumber),n.qe.addTargetData(t,r).next((function(){return r}))}))}))})).then((function(t){var r=n.kn.get(t.targetId);return(null===r||t.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.kn=n.kn.insert(t.targetId,t),n.Fn.set(e,t.targetId)),t}))}function Gu(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:r=Cr(t),o=r.kn.get(e),a=n?"readwrite":"readwrite-primary",i.label=1;case 1:return i.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",a,(function(t){return r.persistence.referenceDelegate.removeTarget(t,o)}))];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:if(!_s(s=i.sent()))throw s;return Tr("LocalStore","Failed to update sequence numbers for target "+e+": "+s),[3,5];case 5:return r.kn=r.kn.remove(e),r.Fn.delete(o.target),[2]}}))}))}function Ku(t,e,n){var r=Cr(t),i=Fr.min(),o=ea();return r.persistence.runTransaction("Execute query","readonly",(function(t){return function(t,e,n){var r=Cr(t),i=r.Fn.get(n);return void 0!==i?ys.resolve(r.kn.get(i)):r.qe.getTargetData(e,n)}(r,t,Yi(e)).next((function(e){if(e)return i=e.lastLimboFreeSnapshotVersion,r.qe.getMatchingKeysForTargetId(t,e.targetId).next((function(t){o=t}))})).next((function(){return r.xn.getDocumentsMatchingQuery(t,e,n?i:Fr.min(),n?o:ea())})).next((function(t){return{documents:t,Bn:o}}))}))}function Hu(t,e){var n=Cr(t),r=Cr(n.qe),i=n.kn.get(e);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(t){return r.lt(t,e).next((function(t){return t?t.target:null}))}))}function Wu(t){var e=Cr(t);return e.persistence.runTransaction("Get new document changes","readonly",(function(t){return function(t,e,n){var r=Cr(t),i=Qo(),o=Rs(n),a=_u(e),s=IDBKeyRange.lowerBound(o,!0);return a.$t({index:rs.readTimeIndex,range:s},(function(t,e){var n=Ds(r.R,e);i=i.insert(n.key,n),o=e.readTime})).next((function(){return{wn:i,readTime:Ls(o)}}))}(e.On,t,e.$n)})).then((function(t){var n=t.wn,r=t.readTime;return e.$n=r,n}))}function zu(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){return[2,(e=Cr(t)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(t){return function(t){var e=_u(t),n=Fr.min();return e.$t({index:rs.readTimeIndex,reverse:!0},(function(t,e,r){e.readTime&&(n=Ls(e.readTime)),r.done()})).next((function(){return n}))}(t)})).then((function(t){e.$n=t}))]}))}))}function Ju(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s,u,c,h,l,f,p,d;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:for(o=Cr(t),a=ea(),s=Qo(),u=$o(),c=0,h=n;c<h.length;c++)l=h[c],f=e.qn(l.metadata.name),l.document&&(a=a.add(f)),s=s.insert(f,e.Un(l)),u=u.insert(f,e.Kn(l.metadata.readTime));return p=o.On.newChangeBuffer({trackRemovals:!0}),[4,Bu(o,function(t){return Yi(Ki(Gr.fromString("__bundle__/docs/"+t)))}(r))];case 1:return d=i.sent(),[2,o.persistence.runTransaction("Apply bundle documents","readwrite",(function(t){return Vu(t,p,s,Fr.min(),u).next((function(e){return p.apply(t),e})).next((function(e){return o.qe.removeMatchingKeysForTargetId(t,d.targetId).next((function(){return o.qe.addMatchingKeys(t,a,d.targetId)})).next((function(){return o.Mn.En(t,e)})).next((function(){return e}))}))}))]}}))}))}function Qu(t,e,n){return void 0===n&&(n=ea()),(0,i.mG)(this,void 0,void 0,(function(){var r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,Bu(t,Yi(qs(e.bundledQuery)))];case 1:return r=i.sent(),[2,(o=Cr(t)).persistence.runTransaction("Save named query","readwrite",(function(t){var i=ba(e.readTime);if(r.snapshotVersion.compareTo(i)>=0)return o.Ke.saveNamedQuery(t,e);var a=r.withResumeToken(zr.EMPTY_BYTE_STRING,i);return o.kn=o.kn.insert(a.targetId,a),o.qe.updateTargetData(t,a).next((function(){return o.qe.removeMatchingKeysForTargetId(t,r.targetId)})).next((function(){return o.qe.addMatchingKeys(t,n,r.targetId)})).next((function(){return o.Ke.saveNamedQuery(t,e)}))}))]}}))}))}var Xu=function(){function t(t){this.R=t,this.Qn=new Map,this.jn=new Map}return t.prototype.getBundleMetadata=function(t,e){return ys.resolve(this.Qn.get(e))},t.prototype.saveBundleMetadata=function(t,e){var n;return this.Qn.set(e.id,{id:(n=e).id,version:n.version,createTime:ba(n.createTime)}),ys.resolve()},t.prototype.getNamedQuery=function(t,e){return ys.resolve(this.jn.get(e))},t.prototype.saveNamedQuery=function(t,e){return this.jn.set(e.name,function(t){return{name:t.name,query:qs(t.bundledQuery),readTime:ba(t.readTime)}}(e)),ys.resolve()},t}(),Yu=function(){function t(){this.Wn=new Wo(Zu.Gn),this.zn=new Wo(Zu.Hn)}return t.prototype.isEmpty=function(){return this.Wn.isEmpty()},t.prototype.addReference=function(t,e){var n=new Zu(t,e);this.Wn=this.Wn.add(n),this.zn=this.zn.add(n)},t.prototype.Jn=function(t,e){var n=this;t.forEach((function(t){return n.addReference(t,e)}))},t.prototype.removeReference=function(t,e){this.Yn(new Zu(t,e))},t.prototype.Xn=function(t,e){var n=this;t.forEach((function(t){return n.removeReference(t,e)}))},t.prototype.Zn=function(t){var e=this,n=new ii(new Gr([])),r=new Zu(n,t),i=new Zu(n,t+1),o=[];return this.zn.forEachInRange([r,i],(function(t){e.Yn(t),o.push(t.key)})),o},t.prototype.ts=function(){var t=this;this.Wn.forEach((function(e){return t.Yn(e)}))},t.prototype.Yn=function(t){this.Wn=this.Wn.delete(t),this.zn=this.zn.delete(t)},t.prototype.es=function(t){var e=new ii(new Gr([])),n=new Zu(e,t),r=new Zu(e,t+1),i=ea();return this.zn.forEachInRange([n,r],(function(t){i=i.add(t.key)})),i},t.prototype.containsKey=function(t){var e=new Zu(t,0),n=this.Wn.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)},t}(),Zu=function(){function t(t,e){this.key=t,this.ns=e}return t.Gn=function(t,e){return ii.comparator(t.key,e.key)||Rr(t.ns,e.ns)},t.Hn=function(t,e){return Rr(t.ns,e.ns)||ii.comparator(t.key,e.key)},t}(),$u=function(){function t(t,e){this.Ut=t,this.referenceDelegate=e,this._n=[],this.ss=1,this.rs=new Wo(Zu.Gn)}return t.prototype.checkEmpty=function(t){return ys.resolve(0===this._n.length)},t.prototype.addMutationBatch=function(t,e,n,r){var i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var o=new Os(i,e,n,r);this._n.push(o);for(var a=0,s=r;a<s.length;a++){var u=s[a];this.rs=this.rs.add(new Zu(u.key,i)),this.Ut.addToCollectionParentIndex(t,u.key.path.popLast())}return ys.resolve(o)},t.prototype.lookupMutationBatch=function(t,e){return ys.resolve(this.os(e))},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=e+1,r=this.cs(n),i=r<0?0:r;return ys.resolve(this._n.length>i?this._n[i]:null)},t.prototype.getHighestUnacknowledgedBatchId=function(){return ys.resolve(0===this._n.length?-1:this.ss-1)},t.prototype.getAllMutationBatches=function(t){return ys.resolve(this._n.slice())},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=new Zu(e,0),i=new Zu(e,Number.POSITIVE_INFINITY),o=[];return this.rs.forEachInRange([r,i],(function(t){var e=n.os(t.ns);o.push(e)})),ys.resolve(o)},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Wo(Rr);return e.forEach((function(t){var e=new Zu(t,0),i=new Zu(t,Number.POSITIVE_INFINITY);n.rs.forEachInRange([e,i],(function(t){r=r.add(t.ns)}))})),ys.resolve(this.us(r))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=e.path,r=n.length+1,i=n;ii.isDocumentKey(i)||(i=i.child(""));var o=new Zu(new ii(i),0),a=new Wo(Rr);return this.rs.forEachWhile((function(t){var e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===r&&(a=a.add(t.ns)),!0)}),o),ys.resolve(this.us(a))},t.prototype.us=function(t){var e=this,n=[];return t.forEach((function(t){var r=e.os(t);null!==r&&n.push(r)})),n},t.prototype.removeMutationBatch=function(t,e){var n=this;Nr(0===this.hs(e.batchId,"removed")),this._n.shift();var r=this.rs;return ys.forEach(e.mutations,(function(i){var o=new Zu(i.key,e.batchId);return r=r.delete(o),n.referenceDelegate.markPotentiallyOrphaned(t,i.key)})).next((function(){n.rs=r}))},t.prototype.Gt=function(t){},t.prototype.containsKey=function(t,e){var n=new Zu(e,0),r=this.rs.firstAfterOrEqual(n);return ys.resolve(e.isEqual(r&&r.key))},t.prototype.performConsistencyCheck=function(t){return this._n.length,ys.resolve()},t.prototype.hs=function(t,e){return this.cs(t)},t.prototype.cs=function(t){return 0===this._n.length?0:t-this._n[0].batchId},t.prototype.os=function(t){var e=this.cs(t);return e<0||e>=this._n.length?null:this._n[e]},t}(),tc=function(){function t(t,e){this.Ut=t,this.ls=e,this.docs=new Go(ii.comparator),this.size=0}return t.prototype.addEntry=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,a=this.ls(e);return this.docs=this.docs.insert(r,{document:e.clone(),size:a,readTime:n}),this.size+=a-o,this.Ut.addToCollectionParentIndex(t,r.path.popLast())},t.prototype.removeEntry=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},t.prototype.getEntry=function(t,e){var n=this.docs.get(e);return ys.resolve(n?n.document.clone():_i.newInvalidDocument(e))},t.prototype.getEntries=function(t,e){var n=this,r=Qo();return e.forEach((function(t){var e=n.docs.get(t);r=r.insert(t,e?e.document.clone():_i.newInvalidDocument(t))})),ys.resolve(r)},t.prototype.getDocumentsMatchingQuery=function(t,e,n){for(var r=Qo(),i=new ii(e.path.child("")),o=this.docs.getIteratorFrom(i);o.hasNext();){var a=o.getNext(),s=a.key,u=a.value,c=u.document,h=u.readTime;if(!e.path.isPrefixOf(s.path))break;h.compareTo(n)<=0||no(e,c)&&(r=r.insert(c.key,c.clone()))}return ys.resolve(r)},t.prototype.fs=function(t,e){return ys.forEach(this.docs,(function(t){return e(t)}))},t.prototype.newChangeBuffer=function(t){return new ec(this)},t.prototype.getSize=function(t){return ys.resolve(this.size)},t}(),ec=function(t){function e(e){var n=this;return(n=t.call(this)||this).Ie=e,n}return(0,i.ZT)(e,t),e.prototype.applyChanges=function(t){var e=this,n=[];return this.changes.forEach((function(r,i){i.document.isValidDocument()?n.push(e.Ie.addEntry(t,i.document,e.getReadTime(r))):e.Ie.removeEntry(r)})),ys.waitFor(n)},e.prototype.getFromCache=function(t,e){return this.Ie.getEntry(t,e)},e.prototype.getAllFromCache=function(t,e){return this.Ie.getEntries(t,e)},e}(gu),nc=function(){function t(t){this.persistence=t,this.ds=new yu((function(t){return Si(t)}),Ti),this.lastRemoteSnapshotVersion=Fr.min(),this.highestTargetId=0,this.ws=0,this._s=new Yu,this.targetCount=0,this.ys=iu.Jt()}return t.prototype.forEachTarget=function(t,e){return this.ds.forEach((function(t,n){return e(n)})),ys.resolve()},t.prototype.getLastRemoteSnapshotVersion=function(t){return ys.resolve(this.lastRemoteSnapshotVersion)},t.prototype.getHighestSequenceNumber=function(t){return ys.resolve(this.ws)},t.prototype.allocateTargetId=function(t){return this.highestTargetId=this.ys.next(),ys.resolve(this.highestTargetId)},t.prototype.setTargetsMetadata=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.ws&&(this.ws=e),ys.resolve()},t.prototype.te=function(t){this.ds.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.ys=new iu(e),this.highestTargetId=e),t.sequenceNumber>this.ws&&(this.ws=t.sequenceNumber)},t.prototype.addTargetData=function(t,e){return this.te(e),this.targetCount+=1,ys.resolve()},t.prototype.updateTargetData=function(t,e){return this.te(e),ys.resolve()},t.prototype.removeTargetData=function(t,e){return this.ds.delete(e.target),this._s.Zn(e.targetId),this.targetCount-=1,ys.resolve()},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return this.ds.forEach((function(a,s){s.sequenceNumber<=e&&null===n.get(s.targetId)&&(r.ds.delete(a),o.push(r.removeMatchingKeysForTargetId(t,s.targetId)),i++)})),ys.waitFor(o).next((function(){return i}))},t.prototype.getTargetCount=function(t){return ys.resolve(this.targetCount)},t.prototype.getTargetData=function(t,e){var n=this.ds.get(e)||null;return ys.resolve(n)},t.prototype.addMatchingKeys=function(t,e,n){return this._s.Jn(e,n),ys.resolve()},t.prototype.removeMatchingKeys=function(t,e,n){this._s.Xn(e,n);var r=this.persistence.referenceDelegate,i=[];return r&&e.forEach((function(e){i.push(r.markPotentiallyOrphaned(t,e))})),ys.waitFor(i)},t.prototype.removeMatchingKeysForTargetId=function(t,e){return this._s.Zn(e),ys.resolve()},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=this._s.es(e);return ys.resolve(n)},t.prototype.containsKey=function(t,e){return ys.resolve(this._s.containsKey(e))},t}(),rc=function(){function t(t,e){var n=this;this.gs={},this.Ne=new wr(0),this.xe=!1,this.xe=!0,this.referenceDelegate=t(this),this.qe=new nc(this),this.Ut=new Hs,this.Ue=function(t,e){return new tc(t,(function(t){return n.referenceDelegate.ps(t)}))}(this.Ut),this.R=new Cs(e),this.Ke=new Xu(this.R)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.setDatabaseDeletedListener=function(){},t.prototype.setNetworkEnabled=function(){},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getMutationQueue=function(t){var e=this.gs[t.toKey()];return e||(e=new $u(this.Ut,this.referenceDelegate),this.gs[t.toKey()]=e),e},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getBundleCache=function(){return this.Ke},t.prototype.runTransaction=function(t,e,n){var r=this;Tr("MemoryPersistence","Starting transaction:",t);var i=new ic(this.Ne.next());return this.referenceDelegate.Es(),n(i).next((function(t){return r.referenceDelegate.Ts(i).next((function(){return t}))})).toPromise().then((function(t){return i.raiseOnCommittedEvent(),t}))},t.prototype.Is=function(t,e){return ys.or(Object.values(this.gs).map((function(n){return function(){return n.containsKey(t,e)}})))},t}(),ic=function(t){function e(e){var n=this;return(n=t.call(this)||this).currentSequenceNumber=e,n}return(0,i.ZT)(e,t),e}(ds),oc=function(){function t(t){this.persistence=t,this.As=new Yu,this.Rs=null}return t.bs=function(e){return new t(e)},Object.defineProperty(t.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw xr()},enumerable:!1,configurable:!0}),t.prototype.addReference=function(t,e,n){return this.As.addReference(n,e),this.vs.delete(n.toString()),ys.resolve()},t.prototype.removeReference=function(t,e,n){return this.As.removeReference(n,e),this.vs.add(n.toString()),ys.resolve()},t.prototype.markPotentiallyOrphaned=function(t,e){return this.vs.add(e.toString()),ys.resolve()},t.prototype.removeTarget=function(t,e){var n=this;this.As.Zn(e.targetId).forEach((function(t){return n.vs.add(t.toString())}));var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(t,e.targetId).next((function(t){t.forEach((function(t){return n.vs.add(t.toString())}))})).next((function(){return r.removeTargetData(t,e)}))},t.prototype.Es=function(){this.Rs=new Set},t.prototype.Ts=function(t){var e=this,n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ys.forEach(this.vs,(function(r){var i=ii.fromPath(r);return e.Ps(t,i).next((function(t){t||n.removeEntry(i)}))})).next((function(){return e.Rs=null,n.apply(t)}))},t.prototype.updateLimboDocument=function(t,e){var n=this;return this.Ps(t,e).next((function(t){t?n.vs.delete(e.toString()):n.vs.add(e.toString())}))},t.prototype.ps=function(t){return 0},t.prototype.Ps=function(t,e){var n=this;return ys.or([function(){return ys.resolve(n.As.containsKey(e))},function(){return n.persistence.getTargetCache().containsKey(t,e)},function(){return n.persistence.Is(t,e)}])},t}(),ac=function(){function t(t){this.uid=t}return t.prototype.isAuthenticated=function(){return null!=this.uid},t.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t}();function sc(t,e){return"firestore_clients_"+t+"_"+e}function uc(t,e,n){var r="firestore_mutations_"+t+"_"+n;return e.isAuthenticated()&&(r+="_"+e.uid),r}function cc(t,e){return"firestore_targets_"+t+"_"+e}ac.UNAUTHENTICATED=new ac(null),ac.GOOGLE_CREDENTIALS=new ac("google-credentials-uid"),ac.FIRST_PARTY=new ac("first-party-uid"),ac.MOCK_USER=new ac("mock-user");var hc=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r}return t.Vs=function(e,n,r){var i,o=JSON.parse(r),a="object"==typeof o&&-1!==["pending","acknowledged","rejected"].indexOf(o.state)&&(void 0===o.error||"object"==typeof o.error);return a&&o.error&&(a="string"==typeof o.error.message&&"string"==typeof o.error.code)&&(i=new Er(o.error.code,o.error.message)),a?new t(e,n,o.state,i):(kr("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},t.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)},t}(),lc=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n}return t.Vs=function(e,n){var r,i=JSON.parse(n),o="object"==typeof i&&-1!==["not-current","current","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error);return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(r=new Er(i.error.code,i.error.message)),o?new t(e,i.state,r):(kr("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.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)},t}(),fc=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.Vs=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=ra(),a=0;i&&a<r.activeTargetIds.length;++a)i=ri(r.activeTargetIds[a]),o=o.add(r.activeTargetIds[a]);return i?new t(e,o):(kr("SharedClientState","Failed to parse client data for instance '"+e+"': "+n),null)},t}(),pc=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.Vs=function(e){var n=JSON.parse(e);return"object"==typeof n&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new t(n.clientId,n.onlineState):(kr("SharedClientState","Failed to parse online state: "+e),null)},t}(),dc=function(){function t(){this.activeTargetIds=ra()}return t.prototype.Ds=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.Cs=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.Ss=function(){var t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),vc=function(){function t(t,e,n,r,i){this.window=t,this.Se=e,this.persistenceKey=n,this.Ns=r,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.xs=this.ks.bind(this),this.Fs=new Go(Rr),this.started=!1,this.$s=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Os=sc(this.persistenceKey,this.Ns),this.Ms=function(t){return"firestore_sequence_number_"+t}(this.persistenceKey),this.Fs=this.Fs.insert(this.Ns,new dc),this.Ls=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Bs=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.qs=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.Us=function(t){return"firestore_online_state_"+t}(this.persistenceKey),this.Ks=function(t){return"firestore_bundle_loaded_"+t}(this.persistenceKey),this.window.addEventListener("storage",this.xs)}return t.yt=function(t){return!(!t||!t.localStorage)},t.prototype.start=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,n,r,o,a,s,u,c,h,l,f=this;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,this.syncEngine.fn()];case 1:for(t=i.sent(),e=0,n=t;e<n.length;e++)(r=n[e])!==this.Ns&&(o=this.getItem(sc(this.persistenceKey,r)))&&(a=fc.Vs(r,o))&&(this.Fs=this.Fs.insert(a.clientId,a));for(this.Qs(),(s=this.storage.getItem(this.Us))&&(u=this.js(s))&&this.Ws(u),c=0,h=this.$s;c<h.length;c++)l=h[c],this.ks(l);return this.$s=[],this.window.addEventListener("pagehide",(function(){return f.shutdown()})),this.started=!0,[2]}}))}))},t.prototype.writeSequenceNumber=function(t){this.setItem(this.Ms,JSON.stringify(t))},t.prototype.getAllActiveQueryTargets=function(){return this.Gs(this.Fs)},t.prototype.isActiveQueryTarget=function(t){var e=!1;return this.Fs.forEach((function(n,r){r.activeTargetIds.has(t)&&(e=!0)})),e},t.prototype.addPendingMutation=function(t){this.zs(t,"pending")},t.prototype.updateMutationState=function(t,e,n){this.zs(t,e,n),this.Hs(t)},t.prototype.addLocalQueryTarget=function(t){var e="not-current";if(this.isActiveQueryTarget(t)){var n=this.storage.getItem(cc(this.persistenceKey,t));if(n){var r=lc.Vs(t,n);r&&(e=r.state)}}return this.Js.Ds(t),this.Qs(),e},t.prototype.removeLocalQueryTarget=function(t){this.Js.Cs(t),this.Qs()},t.prototype.isLocalQueryTarget=function(t){return this.Js.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){this.removeItem(cc(this.persistenceKey,t))},t.prototype.updateQueryState=function(t,e,n){this.Ys(t,e,n)},t.prototype.handleUserChange=function(t,e,n){var r=this;e.forEach((function(t){r.Hs(t)})),this.currentUser=t,n.forEach((function(t){r.addPendingMutation(t)}))},t.prototype.setOnlineState=function(t){this.Xs(t)},t.prototype.notifyBundleLoaded=function(){this.Zs()},t.prototype.shutdown=function(){this.started&&(this.window.removeEventListener("storage",this.xs),this.removeItem(this.Os),this.started=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return Tr("SharedClientState","READ",t,e),e},t.prototype.setItem=function(t,e){Tr("SharedClientState","SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){Tr("SharedClientState","REMOVE",t),this.storage.removeItem(t)},t.prototype.ks=function(t){var e=this,n=t;if(n.storageArea===this.storage){if(Tr("SharedClientState","EVENT",n.key,n.newValue),n.key===this.Os)return void kr("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Se.enqueueRetryable((function(){return(0,i.mG)(e,void 0,void 0,(function(){var t,e,r,o,a,s;return(0,i.Jh)(this,(function(i){if(this.started){if(null!==n.key)if(this.Ls.test(n.key)){if(null==n.newValue)return t=this.ti(n.key),[2,this.ei(t,null)];if(e=this.ni(n.key,n.newValue))return[2,this.ei(e.clientId,e)]}else if(this.Bs.test(n.key)){if(null!==n.newValue&&(r=this.si(n.key,n.newValue)))return[2,this.ii(r)]}else if(this.qs.test(n.key)){if(null!==n.newValue&&(o=this.ri(n.key,n.newValue)))return[2,this.oi(o)]}else if(n.key===this.Us){if(null!==n.newValue&&(a=this.js(n.newValue)))return[2,this.Ws(a)]}else if(n.key===this.Ms)(s=function(t){var e=wr.o;if(null!=t)try{var n=JSON.parse(t);Nr("number"==typeof n),e=n}catch(t){kr("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(n.newValue))!==wr.o&&this.sequenceNumberHandler(s);else if(n.key===this.Ks)return[2,this.syncEngine.ci()]}else this.$s.push(n);return[2]}))}))}))}},Object.defineProperty(t.prototype,"Js",{get:function(){return this.Fs.get(this.Ns)},enumerable:!1,configurable:!0}),t.prototype.Qs=function(){this.setItem(this.Os,this.Js.Ss())},t.prototype.zs=function(t,e,n){var r=new hc(this.currentUser,t,e,n),i=uc(this.persistenceKey,this.currentUser,t);this.setItem(i,r.Ss())},t.prototype.Hs=function(t){var e=uc(this.persistenceKey,this.currentUser,t);this.removeItem(e)},t.prototype.Xs=function(t){var e={clientId:this.Ns,onlineState:t};this.storage.setItem(this.Us,JSON.stringify(e))},t.prototype.Ys=function(t,e,n){var r=cc(this.persistenceKey,t),i=new lc(t,e,n);this.setItem(r,i.Ss())},t.prototype.Zs=function(){this.setItem(this.Ks,"value-not-used")},t.prototype.ti=function(t){var e=this.Ls.exec(t);return e?e[1]:null},t.prototype.ni=function(t,e){var n=this.ti(t);return fc.Vs(n,e)},t.prototype.si=function(t,e){var n=this.Bs.exec(t),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return hc.Vs(new ac(i),r,e)},t.prototype.ri=function(t,e){var n=this.qs.exec(t),r=Number(n[1]);return lc.Vs(r,e)},t.prototype.js=function(t){return pc.Vs(t)},t.prototype.ii=function(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){return t.user.uid===this.currentUser.uid?[2,this.syncEngine.ui(t.batchId,t.state,t.error)]:(Tr("SharedClientState","Ignoring mutation for non-active user "+t.user.uid),[2])}))}))},t.prototype.oi=function(t){return this.syncEngine.ai(t.targetId,t.state,t.error)},t.prototype.ei=function(t,e){var n=this,r=e?this.Fs.insert(t,e):this.Fs.remove(t),i=this.Gs(this.Fs),o=this.Gs(r),a=[],s=[];return o.forEach((function(t){i.has(t)||a.push(t)})),i.forEach((function(t){o.has(t)||s.push(t)})),this.syncEngine.hi(a,s).then((function(){n.Fs=r}))},t.prototype.Ws=function(t){this.Fs.get(t.clientId)&&this.onlineStateHandler(t.onlineState)},t.prototype.Gs=function(t){var e=ra();return t.forEach((function(t,n){e=e.unionWith(n.activeTargetIds)})),e},t}(),yc=function(){function t(){this.li=new dc,this.fi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}return t.prototype.addPendingMutation=function(t){},t.prototype.updateMutationState=function(t,e,n){},t.prototype.addLocalQueryTarget=function(t){return this.li.Ds(t),this.fi[t]||"not-current"},t.prototype.updateQueryState=function(t,e,n){this.fi[t]=e},t.prototype.removeLocalQueryTarget=function(t){this.li.Cs(t)},t.prototype.isLocalQueryTarget=function(t){return this.li.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){delete this.fi[t]},t.prototype.getAllActiveQueryTargets=function(){return this.li.activeTargetIds},t.prototype.isActiveQueryTarget=function(t){return this.li.activeTargetIds.has(t)},t.prototype.start=function(){return this.li=new dc,Promise.resolve()},t.prototype.handleUserChange=function(t,e,n){},t.prototype.setOnlineState=function(t){},t.prototype.shutdown=function(){},t.prototype.writeSequenceNumber=function(t){},t.prototype.notifyBundleLoaded=function(){},t}(),gc=function(){function t(){}return t.prototype.di=function(t){},t.prototype.shutdown=function(){},t}(),mc=function(){function t(){var t=this;this.wi=function(){return t._i()},this.mi=function(){return t.yi()},this.gi=[],this.pi()}return t.prototype.di=function(t){this.gi.push(t)},t.prototype.shutdown=function(){window.removeEventListener("online",this.wi),window.removeEventListener("offline",this.mi)},t.prototype.pi=function(){window.addEventListener("online",this.wi),window.addEventListener("offline",this.mi)},t.prototype._i=function(){Tr("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,e=this.gi;t<e.length;t++)(0,e[t])(0)},t.prototype.yi=function(){Tr("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,e=this.gi;t<e.length;t++)(0,e[t])(1)},t.yt=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},t}(),bc={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},wc=function(){function t(t){this.Ei=t.Ei,this.Ti=t.Ti}return t.prototype.Ii=function(t){this.Ai=t},t.prototype.Ri=function(t){this.bi=t},t.prototype.onMessage=function(t){this.vi=t},t.prototype.close=function(){this.Ti()},t.prototype.send=function(t){this.Ei(t)},t.prototype.Pi=function(){this.Ai()},t.prototype.Vi=function(t){this.bi(t)},t.prototype.Si=function(t){this.vi(t)},t}(),_c=function(t){function e(e){var n=this;return(n=t.call(this,e)||this).forceLongPolling=e.forceLongPolling,n.autoDetectLongPolling=e.autoDetectLongPolling,n.useFetchStreams=e.useFetchStreams,n}return(0,i.ZT)(e,t),e.prototype.Fi=function(t,e,n,r){return new Promise((function(i,o){var a=new br;a.listenOnce(pr.COMPLETE,(function(){try{switch(a.getLastErrorCode()){case fr.NO_ERROR:var e=a.getResponseJson();Tr("Connection","XHR received:",JSON.stringify(e)),i(e);break;case fr.TIMEOUT:Tr("Connection",'RPC "'+t+'" timed out'),o(new Er(_r.DEADLINE_EXCEEDED,"Request time out"));break;case fr.HTTP_ERROR:var n=a.getStatus();if(Tr("Connection",'RPC "'+t+'" failed with status:',n,"response text:",a.getResponseText()),n>0){var r=a.getResponseJson().error;if(r&&r.status&&r.message){var s=function(t){var e=t.toLowerCase().replace(/_/g,"-");return Object.values(_r).indexOf(e)>=0?e:_r.UNKNOWN}(r.status);o(new Er(s,r.message))}else o(new Er(_r.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new Er(_r.UNAVAILABLE,"Connection failed."));break;default:xr()}}finally{Tr("Connection",'RPC "'+t+'" completed.')}}));var s=JSON.stringify(r);a.send(e,"POST",s,n,15)}))},e.prototype.Oi=function(t,e){var n=[this.Di,"/","google.firestore.v1.Firestore","/",t,"/channel"],r=new sr,i=$t(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(a.xmlHttpFactory=new gr({})),this.ki(a.initMessageHeaders,e),(0,o.uI)()||(0,o.b$)()||(0,o.d)()||(0,o.w1)()||(0,o.Mn)()||(0,o.ru)()||(a.httpHeadersOverwriteParam="$httpHeaders");var s=n.join("");Tr("Connection","Creating WebChannel: "+s,a);var u=r.createWebChannel(s,a),c=!1,h=!1,l=new wc({Ei:function(t){h?Tr("Connection","Not sending because WebChannel is closed:",t):(c||(Tr("Connection","Opening WebChannel transport."),u.open(),c=!0),Tr("Connection","WebChannel sending:",t),u.send(t))},Ti:function(){return u.close()}}),f=function(t,e,n){t.listen(e,(function(t){try{n(t)}catch(t){setTimeout((function(){throw t}),0)}}))};return f(u,mr.EventType.OPEN,(function(){h||Tr("Connection","WebChannel transport opened.")})),f(u,mr.EventType.CLOSE,(function(){h||(h=!0,Tr("Connection","WebChannel transport closed"),l.Vi())})),f(u,mr.EventType.ERROR,(function(t){h||(h=!0,Ar("Connection","WebChannel transport errored:",t),l.Vi(new Er(_r.UNAVAILABLE,"The operation could not be completed")))})),f(u,mr.EventType.MESSAGE,(function(t){var e;if(!h){var n=t.data[0];Nr(!!n);var r=n,i=r.error||(null===(e=r[0])||void 0===e?void 0:e.error);if(i){Tr("Connection","WebChannel received error:",i);var o=i.status,a=function(t){var e=jo[t];if(void 0!==e)return Bo(e)}(o),s=i.message;void 0===a&&(a=_r.INTERNAL,s="Unknown error status: "+o+" with message "+i.message),h=!0,l.Vi(new Er(a,s)),u.close()}else Tr("Connection","WebChannel received:",n),l.Si(n)}})),f(i,dr.STAT_EVENT,(function(t){t.stat===vr?Tr("Connection","Detected buffering proxy"):t.stat===yr&&Tr("Connection","Detected no buffering proxy")})),setTimeout((function(){l.Pi()}),0),l},e}(function(){function t(t){this.databaseInfo=t,this.databaseId=t.databaseId;var e=t.ssl?"https":"http";this.Di=e+"://"+t.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return t.prototype.Ni=function(t,e,n,r){var i=this.xi(t,e);Tr("RestConnection","Sending: ",i,n);var o={};return this.ki(o,r),this.Fi(t,i,o,n).then((function(t){return Tr("RestConnection","Received: ",t),t}),(function(e){throw Ar("RestConnection",t+" failed with error: ",e,"url: ",i,"request:",n),e}))},t.prototype.$i=function(t,e,n,r){return this.Ni(t,e,n,r)},t.prototype.ki=function(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/8.10.0",t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e)for(var n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n])},t.prototype.xi=function(t,e){var n=bc[t];return this.Di+"/v1/"+e+":"+n},t}());function Ec(){return"undefined"!=typeof window?window:null}function Ic(){return"undefined"!=typeof document?document:null}function Sc(t){return new va(t,!0)}var Tc=function(){function t(t,e,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.Se=t,this.timerId=e,this.Mi=n,this.Li=r,this.Bi=i,this.qi=0,this.Ui=null,this.Ki=Date.now(),this.reset()}return t.prototype.reset=function(){this.qi=0},t.prototype.Qi=function(){this.qi=this.Bi},t.prototype.ji=function(t){var e=this;this.cancel();var n=Math.floor(this.qi+this.Wi()),r=Math.max(0,Date.now()-this.Ki),i=Math.max(0,n-r);i>0&&Tr("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.qi+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.Ui=this.Se.enqueueAfterDelay(this.timerId,i,(function(){return e.Ki=Date.now(),t()})),this.qi*=this.Li,this.qi<this.Mi&&(this.qi=this.Mi),this.qi>this.Bi&&(this.qi=this.Bi)},t.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},t.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},t.prototype.Wi=function(){return(Math.random()-.5)*this.qi},t}(),kc=function(){function t(t,e,n,r,i,o){this.Se=t,this.zi=n,this.Hi=r,this.Ji=i,this.listener=o,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new Tc(t,e)}return t.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},t.prototype.er=function(){return 2===this.state},t.prototype.start=function(){3!==this.state?this.auth():this.nr()},t.prototype.stop=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(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]}}))}))},t.prototype.sr=function(){this.state=0,this.Zi.reset()},t.prototype.ir=function(){var t=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,(function(){return t.rr()})))},t.prototype.cr=function(t){this.ur(),this.stream.send(t)},t.prototype.rr=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){return this.er()?[2,this.close(0)]:[2]}))}))},t.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},t.prototype.close=function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==t?this.Zi.reset():e&&e.code===_r.RESOURCE_EXHAUSTED?(kr(e.toString()),kr("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):e&&e.code===_r.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.Ri(e)];case 1:return n.sent(),[2]}}))}))},t.prototype.ar=function(){},t.prototype.auth=function(){var t=this;this.state=1;var e=this.hr(this.Yi),n=this.Yi;this.Ji.getToken().then((function(e){t.Yi===n&&t.lr(e)}),(function(n){e((function(){var e=new Er(_r.UNKNOWN,"Fetching auth token failed: "+n.message);return t.dr(e)}))}))},t.prototype.lr=function(t){var e=this,n=this.hr(this.Yi);this.stream=this.wr(t),this.stream.Ii((function(){n((function(){return e.state=2,e.listener.Ii()}))})),this.stream.Ri((function(t){n((function(){return e.dr(t)}))})),this.stream.onMessage((function(t){n((function(){return e.onMessage(t)}))}))},t.prototype.nr=function(){var t=this;this.state=4,this.Zi.ji((function(){return(0,i.mG)(t,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){return this.state=0,this.start(),[2]}))}))}))},t.prototype.dr=function(t){return Tr("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},t.prototype.hr=function(t){var e=this;return function(n){e.Se.enqueueAndForget((function(){return e.Yi===t?n():(Tr("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},t}(),Ac=function(t){function e(e,n,r,i,o){var a=this;return(a=t.call(this,e,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).R=i,a}return(0,i.ZT)(e,t),e.prototype.wr=function(t){return this.Hi.Oi("Listen",t)},e.prototype.onMessage=function(t){this.Zi.reset();var e=function(t,e){var n;if("targetChange"in e){e.targetChange;var r=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:xr()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=function(t,e){return t.I?(Nr(void 0===e||"string"==typeof e),zr.fromBase64String(e||"")):(Nr(void 0===e||e instanceof Uint8Array),zr.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),a=(s=e.targetChange.cause)&&function(t){var e=void 0===t.code?_r.UNKNOWN:Bo(t.code);return new Er(e,t.message||"")}(s);n=new ua(r,i,o,a||null)}else if("documentChange"in e){e.documentChange,(r=e.documentChange).document,r.document.name,r.document.updateTime,i=Ia(t,r.document.name),o=ba(r.document.updateTime);var s=new bi({mapValue:{fields:r.document.fields}}),u=(a=_i.newFoundDocument(i,o,s),r.targetIds||[]),c=r.removedTargetIds||[];n=new aa(u,c,a.key,a)}else if("documentDelete"in e)e.documentDelete,(r=e.documentDelete).document,i=Ia(t,r.document),o=r.readTime?ba(r.readTime):Fr.min(),s=_i.newNoDocument(i,o),a=r.removedTargetIds||[],n=new aa([],a,s.key,s);else if("documentRemove"in e)e.documentRemove,(r=e.documentRemove).document,i=Ia(t,r.document),o=r.removedTargetIds||[],n=new aa([],o,i,null);else{if(!("filter"in e))return xr();e.filter;var h=e.filter;h.targetId,r=h.count||0,i=new Vo(r),o=h.targetId,n=new sa(o,i)}return n}(this.R,t),n=function(t){if(!("targetChange"in t))return Fr.min();var e=t.targetChange;return e.targetIds&&e.targetIds.length?Fr.min():e.readTime?ba(e.readTime):Fr.min()}(t);return this.listener._r(e,n)},e.prototype.mr=function(t){var e={};e.database=ka(this.R),e.addTarget=function(t,e){var n,r=e.target;return(n=ki(r)?{documents:Da(t,r)}:{query:Pa(t,r)}).targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=ga(t,e.resumeToken):e.snapshotVersion.compareTo(Fr.min())>0&&(n.readTime=ya(t,e.snapshotVersion.toTimestamp())),n}(this.R,t);var n=function(t,e){var n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return xr()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.R,t);n&&(e.labels=n),this.cr(e)},e.prototype.yr=function(t){var e={};e.database=ka(this.R),e.removeTarget=t,this.cr(e)},e}(kc),Oc=function(t){function e(e,n,r,i,o){var a=this;return(a=t.call(this,e,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).R=i,a.gr=!1,a}return(0,i.ZT)(e,t),Object.defineProperty(e.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},e.prototype.ar=function(){this.gr&&this.Er([])},e.prototype.wr=function(t){return this.Hi.Oi("Write",t)},e.prototype.onMessage=function(t){if(Nr(!!t.streamToken),this.lastStreamToken=t.streamToken,this.gr){this.Zi.reset();var e=function(t,e){return t&&t.length>0?(Nr(void 0!==e),t.map((function(t){return function(t,e){var n=t.updateTime?ba(t.updateTime):ba(e);return n.isEqual(Fr.min())&&(n=ba(e)),new Eo(n,t.transformResults||[])}(t,e)}))):[]}(t.writeResults,t.commitTime),n=ba(t.commitTime);return this.listener.Tr(n,e)}return Nr(!t.writeResults||0===t.writeResults.length),this.gr=!0,this.listener.Ir()},e.prototype.Ar=function(){var t={};t.database=ka(this.R),this.cr(t)},e.prototype.Er=function(t){var e=this,n={streamToken:this.lastStreamToken,writes:t.map((function(t){return Na(e.R,t)}))};this.cr(n)},e}(kc),xc=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).credentials=e,i.Hi=n,i.R=r,i.Rr=!1,i}return(0,i.ZT)(e,t),e.prototype.br=function(){if(this.Rr)throw new Er(_r.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.Ni=function(t,e,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.Ni(t,e,n,i)})).catch((function(t){throw"FirebaseError"===t.name?(t.code===_r.UNAUTHENTICATED&&r.credentials.invalidateToken(),t):new Er(_r.UNKNOWN,t.toString())}))},e.prototype.$i=function(t,e,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.$i(t,e,n,i)})).catch((function(t){throw"FirebaseError"===t.name?(t.code===_r.UNAUTHENTICATED&&r.credentials.invalidateToken(),t):new Er(_r.UNKNOWN,t.toString())}))},e.prototype.terminate=function(){this.Rr=!0},e}((function(){})),Nc=function(){function t(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return t.prototype.Sr=function(){var t=this;0===this.vr&&(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()})))},t.prototype.Nr=function(t){"Online"===this.state?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.kr(),this.Cr("Connection failed 1 times. Most recent error: "+t.toString()),this.Dr("Offline")))},t.prototype.set=function(t){this.kr(),this.vr=0,"Online"===t&&(this.Vr=!1),this.Dr(t)},t.prototype.Dr=function(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))},t.prototype.Cr=function(t){var e="Could not reach Cloud Firestore backend. "+t+"\nThis 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?(kr(e),this.Vr=!1):Tr("OnlineStateTracker",e)},t.prototype.kr=function(){null!==this.Pr&&(this.Pr.cancel(),this.Pr=null)},t}(),Cc=function(t,e,n,r,o){var a=this;this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.Fr=[],this.$r=new Map,this.Or=new Set,this.Mr=[],this.Lr=o,this.Lr.di((function(t){n.enqueueAndForget((function(){return(0,i.mG)(a,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return Vc(this)?(Tr("RemoteStore","Restarting streams for network reachability change."),[4,function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return(e=Cr(t)).Or.add(4),[4,Pc(e)];case 1:return n.sent(),e.Br.set("Unknown"),e.Or.delete(4),[4,Dc(e)];case 2:return n.sent(),[2]}}))}))}(this)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))})),this.Br=new Nc(n,r)};function Dc(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:if(!Vc(t))return[3,4];e=0,n=t.Mr,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!0)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function Pc(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:e=0,n=t.Mr,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!1)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function Rc(t,e){var n=Cr(t);n.$r.has(e.targetId)||(n.$r.set(e.targetId,e),Uc(n)?Fc(n):eh(n).er()&&jc(n,e))}function Lc(t,e){var n=Cr(t),r=eh(n);n.$r.delete(e),r.er()&&Mc(n,e),0===n.$r.size&&(r.er()?r.ir():Vc(n)&&n.Br.set("Unknown"))}function jc(t,e){t.qr.U(e.targetId),eh(t).mr(e)}function Mc(t,e){t.qr.U(e),eh(t).yr(e)}function Fc(t){t.qr=new ha({getRemoteKeysForTarget:function(e){return t.remoteSyncer.getRemoteKeysForTarget(e)},lt:function(e){return t.$r.get(e)||null}}),eh(t).start(),t.Br.Sr()}function Uc(t){return Vc(t)&&!eh(t).tr()&&t.$r.size>0}function Vc(t){return 0===Cr(t).Or.size}function qc(t){t.qr=void 0}function Bc(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){return t.$r.forEach((function(e,n){jc(t,e)})),[2]}))}))}function Gc(t,e){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(n){return qc(t),Uc(t)?(t.Br.Nr(e),Fc(t)):t.Br.set("Unknown"),[2]}))}))}function Kc(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a;return(0,i.Jh)(this,(function(s){switch(s.label){case 0:if(t.Br.set("Online"),!(e instanceof ua&&2===e.state&&e.cause))return[3,6];s.label=1;case 1:return s.trys.push([1,3,,5]),[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=e.cause,r=0,o=e.targetIds,i.label=1;case 1:return r<o.length?(a=o[r],t.$r.has(a)?[4,t.remoteSyncer.rejectListen(a,n)]:[3,3]):[3,5];case 2:i.sent(),t.$r.delete(a),t.qr.removeTarget(a),i.label=3;case 3:i.label=4;case 4:return r++,[3,1];case 5:return[2]}}))}))}(t,e)];case 2:return s.sent(),[3,5];case 3:return r=s.sent(),Tr("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),[4,Hc(t,r)];case 4:return s.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof aa?t.qr.X(e):e instanceof sa?t.qr.rt(e):t.qr.et(e),n.isEqual(Fr.min()))return[3,13];s.label=7;case 7:return s.trys.push([7,11,,13]),[4,Fu(t.localStore)];case 8:return o=s.sent(),n.compareTo(o)>=0?[4,function(t,e){var n=t.qr.ut(e);return n.targetChanges.forEach((function(n,r){if(n.resumeToken.approximateByteSize()>0){var i=t.$r.get(r);i&&t.$r.set(r,i.withResumeToken(n.resumeToken,e))}})),n.targetMismatches.forEach((function(e){var n=t.$r.get(e);if(n){t.$r.set(e,n.withResumeToken(zr.EMPTY_BYTE_STRING,n.snapshotVersion)),Mc(t,e);var r=new Ns(n.target,e,1,n.sequenceNumber);jc(t,r)}})),t.remoteSyncer.applyRemoteEvent(n)}(t,n)]:[3,10];case 9:s.sent(),s.label=10;case 10:return[3,13];case 11:return Tr("RemoteStore","Failed to raise snapshot:",a=s.sent()),[4,Hc(t,a)];case 12:return s.sent(),[3,13];case 13:return[2]}}))}))}function Hc(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r=this;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:if(!_s(e))throw e;return t.Or.add(1),[4,Pc(t)];case 1:return o.sent(),t.Br.set("Offline"),n||(n=function(){return Fu(t.localStore)}),t.asyncQueue.enqueueRetryable((function(){return(0,i.mG)(r,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return Tr("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return e.sent(),t.Or.delete(1),[4,Dc(t)];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))}function Wc(t,e){return e().catch((function(n){return Hc(t,n,e)}))}function zc(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n,r,o,a;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:e=Cr(t),n=nh(e),r=e.Fr.length>0?e.Fr[e.Fr.length-1].batchId:-1,i.label=1;case 1:if(!function(t){return Vc(t)&&t.Fr.length<10}(e))return[3,7];i.label=2;case 2:return i.trys.push([2,4,,6]),[4,qu(e.localStore,r)];case 3:return null===(o=i.sent())?(0===e.Fr.length&&n.ir(),[3,7]):(r=o.batchId,function(t,e){t.Fr.push(e);var n=nh(t);n.er()&&n.pr&&n.Er(e.mutations)}(e,o),[3,6]);case 4:return a=i.sent(),[4,Hc(e,a)];case 5:return i.sent(),[3,6];case 6:return[3,1];case 7:return Jc(e)&&Qc(e),[2]}}))}))}function Jc(t){return Vc(t)&&!nh(t).tr()&&t.Fr.length>0}function Qc(t){nh(t).start()}function Xc(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){return nh(t).Ar(),[2]}))}))}function Yc(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n,r,o;return(0,i.Jh)(this,(function(i){for(e=nh(t),n=0,r=t.Fr;n<r.length;n++)o=r[n],e.Er(o.mutations);return[2]}))}))}function Zc(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return r=t.Fr.shift(),o=xs.from(r,e,n),[4,Wc(t,(function(){return t.remoteSyncer.applySuccessfulWrite(o)}))];case 1:return i.sent(),[4,zc(t)];case 2:return i.sent(),[2]}}))}))}function $c(t,e){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e&&nh(t).pr?[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return qo(r=e.code)&&r!==_r.ABORTED?(n=t.Fr.shift(),nh(t).sr(),[4,Wc(t,(function(){return t.remoteSyncer.rejectFailedWrite(n.batchId,e)}))]):[3,3];case 1:return i.sent(),[4,zc(t)];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))}(t,e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return Jc(t)&&Qc(t),[2]}}))}))}function th(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return n=Cr(t),e?(n.Or.delete(2),[4,Dc(n)]):[3,2];case 1:return r.sent(),[3,5];case 2:return e?[3,4]:(n.Or.add(2),[4,Pc(n)]);case 3:r.sent(),n.Br.set("Unknown"),r.label=4;case 4:r.label=5;case 5:return[2]}}))}))}function eh(t){var e=this;return t.Ur||(t.Ur=function(t,e,n){var r=Cr(t);return r.br(),new Ac(e,r.Hi,r.credentials,r.R,n)}(t.datastore,t.asyncQueue,{Ii:Bc.bind(null,t),Ri:Gc.bind(null,t),_r:Kc.bind(null,t)}),t.Mr.push((function(n){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return n?(t.Ur.sr(),Uc(t)?Fc(t):t.Br.set("Unknown"),[3,3]):[3,1];case 1:return[4,t.Ur.stop()];case 2:e.sent(),qc(t),e.label=3;case 3:return[2]}}))}))}))),t.Ur}function nh(t){var e=this;return t.Kr||(t.Kr=function(t,e,n){var r=Cr(t);return r.br(),new Oc(e,r.Hi,r.credentials,r.R,n)}(t.datastore,t.asyncQueue,{Ii:Xc.bind(null,t),Ri:$c.bind(null,t),Ir:Yc.bind(null,t),Tr:Zc.bind(null,t)}),t.Mr.push((function(n){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return n?(t.Kr.sr(),[4,zc(t)]):[3,2];case 1:return e.sent(),[3,4];case 2:return[4,t.Kr.stop()];case 3:e.sent(),t.Fr.length>0&&(Tr("RemoteStore","Stopping write stream with "+t.Fr.length+" pending writes"),t.Fr=[]),e.label=4;case 4:return[2]}}))}))}))),t.Kr}var rh=function(){function t(t,e,n,r,i){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new vs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((function(t){}))}return t.createAndSchedule=function(e,n,r,i,o){var a=new t(e,n,Date.now()+r,i,o);return a.start(r),a},t.prototype.start=function(t){var e=this;this.timerHandle=setTimeout((function(){return e.handleDelayElapsed()}),t)},t.prototype.skipDelay=function(){return this.handleDelayElapsed()},t.prototype.cancel=function(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new Er(_r.CANCELLED,"Operation cancelled"+(t?": "+t:""))))},t.prototype.handleDelayElapsed=function(){var t=this;this.asyncQueue.enqueueAndForget((function(){return null!==t.timerHandle?(t.clearTimeout(),t.op().then((function(e){return t.deferred.resolve(e)}))):Promise.resolve()}))},t.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},t}();function ih(t,e){if(kr("AsyncQueue",e+": "+t),_s(t))return new Er(_r.UNAVAILABLE,e+": "+t);throw t}var oh=function(){function t(t){this.comparator=t?function(e,n){return t(e,n)||ii.comparator(e.key,n.key)}:function(t,e){return ii.comparator(t.key,e.key)},this.keyedMap=Yo(),this.sortedSet=new Go(this.comparator)}return t.emptySet=function(e){return new t(e.comparator)},t.prototype.has=function(t){return null!=this.keyedMap.get(t)},t.prototype.get=function(t){return this.keyedMap.get(t)},t.prototype.first=function(){return this.sortedSet.minKey()},t.prototype.last=function(){return this.sortedSet.maxKey()},t.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},t.prototype.indexOf=function(t){var e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t){this.sortedSet.inorderTraversal((function(e,n){return t(e),!1}))},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach((function(e){t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"},t.prototype.copy=function(e,n){var r=new t;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r},t}(),ah=function(){function t(){this.Qr=new Go(ii.comparator)}return t.prototype.track=function(t){var e=t.doc.key,n=this.Qr.get(e);n?0!==t.type&&3===n.type?this.Qr=this.Qr.insert(e,t):3===t.type&&1!==n.type?this.Qr=this.Qr.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Qr=this.Qr.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Qr=this.Qr.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Qr=this.Qr.remove(e):1===t.type&&2===n.type?this.Qr=this.Qr.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Qr=this.Qr.insert(e,{type:2,doc:t.doc}):xr():this.Qr=this.Qr.insert(e,t)},t.prototype.jr=function(){var t=[];return this.Qr.inorderTraversal((function(e,n){t.push(n)})),t},t}(),sh=function(){function t(t,e,n,r,i,o,a,s){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=s}return t.fromInitialDocuments=function(e,n,r,i){var o=[];return n.forEach((function(t){o.push({type:0,doc:t})})),new t(e,n,oh.emptySet(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&$i(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;var e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(e[r].type!==n[r].type||!e[r].doc.isEqual(n[r].doc))return!1;return!0},t}(),uh=function(){this.Wr=void 0,this.listeners=[]},ch=function(){this.queries=new yu((function(t){return to(t)}),$i),this.onlineState="Unknown",this.Gr=new Set};function hh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u,c;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:if(n=Cr(t),r=e.query,o=!1,(a=n.queries.get(r))||(o=!0,a=new uh),!o)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),s=a,[4,n.onListen(r)];case 2:return s.Wr=i.sent(),[3,4];case 3:return u=i.sent(),c=ih(u,"Initialization of query '"+eo(e.query)+"' failed"),[2,void e.onError(c)];case 4:return n.queries.set(r,a),a.listeners.push(e),e.zr(n.onlineState),a.Wr&&e.Hr(a.Wr)&&dh(n),[2]}}))}))}function lh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s;return(0,i.Jh)(this,(function(i){return n=Cr(t),r=e.query,o=!1,(a=n.queries.get(r))&&(s=a.listeners.indexOf(e))>=0&&(a.listeners.splice(s,1),o=0===a.listeners.length),o?[2,(n.queries.delete(r),n.onUnlisten(r))]:[2]}))}))}function fh(t,e){for(var n=Cr(t),r=!1,i=0,o=e;i<o.length;i++){var a=o[i],s=a.query,u=n.queries.get(s);if(u){for(var c=0,h=u.listeners;c<h.length;c++)h[c].Hr(a)&&(r=!0);u.Wr=a}}r&&dh(n)}function ph(t,e,n){var r=Cr(t),i=r.queries.get(e);if(i)for(var o=0,a=i.listeners;o<a.length;o++)a[o].onError(n);r.queries.delete(e)}function dh(t){t.Gr.forEach((function(t){t.next()}))}var vh=function(){function t(t,e,n){this.query=t,this.Jr=e,this.Yr=!1,this.Xr=null,this.onlineState="Unknown",this.options=n||{}}return t.prototype.Hr=function(t){if(!this.options.includeMetadataChanges){for(var e=[],n=0,r=t.docChanges;n<r.length;n++){var i=r[n];3!==i.type&&e.push(i)}t=new sh(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}var o=!1;return this.Yr?this.Zr(t)&&(this.Jr.next(t),o=!0):this.eo(t,this.onlineState)&&(this.no(t),o=!0),this.Xr=t,o},t.prototype.onError=function(t){this.Jr.error(t)},t.prototype.zr=function(t){this.onlineState=t;var e=!1;return this.Xr&&!this.Yr&&this.eo(this.Xr,t)&&(this.no(this.Xr),e=!0),e},t.prototype.eo=function(t,e){if(!t.fromCache)return!0;var n="Offline"!==e;return!(this.options.so&&n||t.docs.isEmpty()&&"Offline"!==e)},t.prototype.Zr=function(t){if(t.docChanges.length>0)return!0;var e=this.Xr&&this.Xr.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges},t.prototype.no=function(t){t=sh.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.Yr=!0,this.Jr.next(t)},t}(),yh=function(){function t(t,e){this.payload=t,this.byteLength=e}return t.prototype.io=function(){return"metadata"in this.payload},t}(),gh=function(){function t(t){this.R=t}return t.prototype.qn=function(t){return Ia(this.R,t)},t.prototype.Un=function(t){return t.metadata.exists?xa(this.R,t.document,!1):_i.newNoDocument(this.qn(t.metadata.name),this.Kn(t.metadata.readTime))},t.prototype.Kn=function(t){return ba(t)},t}();!function(){function t(t,e,n){this.ro=t,this.localStore=e,this.R=n,this.queries=[],this.documents=[],this.progress=function(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}(t)}t.prototype.oo=function(t){this.progress.bytesLoaded+=t.byteLength;var e=this.progress.documentsLoaded;return t.payload.namedQuery?this.queries.push(t.payload.namedQuery):t.payload.documentMetadata?(this.documents.push({metadata:t.payload.documentMetadata}),t.payload.documentMetadata.exists||++e):t.payload.document&&(this.documents[this.documents.length-1].document=t.payload.document,++e),e!==this.progress.documentsLoaded?(this.progress.documentsLoaded=e,Object.assign({},this.progress)):null},t.prototype.co=function(t){for(var e=new Map,n=new gh(this.R),r=0,i=t;r<i.length;r++){var o=i[r];if(o.metadata.queries)for(var a=n.qn(o.metadata.name),s=0,u=o.metadata.queries;s<u.length;s++){var c=u[s],h=(e.get(c)||ea()).add(a);e.set(c,h)}}return e},t.prototype.complete=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,Ju(this.localStore,new gh(this.R),this.documents,this.ro.id)];case 1:t=i.sent(),e=this.co(this.documents),n=0,r=this.queries,i.label=2;case 2:return n<r.length?(o=r[n],[4,Qu(this.localStore,o,e.get(o.name))]):[3,5];case 3:i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,(this.progress.taskState="Success",new Nu(Object.assign({},this.progress),t))]}}))}))}}();var mh=function(t){this.key=t},bh=function(t){this.key=t},wh=function(){function t(t,e){this.query=t,this.uo=e,this.ao=null,this.current=!1,this.ho=ea(),this.mutatedKeys=ea(),this.lo=ro(t),this.fo=new oh(this.lo)}return Object.defineProperty(t.prototype,"wo",{get:function(){return this.uo},enumerable:!1,configurable:!0}),t.prototype._o=function(t,e){var n=this,r=e?e.mo:new ah,i=e?e.fo:this.fo,o=e?e.mutatedKeys:this.mutatedKeys,a=i,s=!1,u=Hi(this.query)&&i.size===this.query.limit?i.last():null,c=Wi(this.query)&&i.size===this.query.limit?i.first():null;if(t.inorderTraversal((function(t,e){var h=i.get(t),l=no(n.query,e)?e:null,f=!!h&&n.mutatedKeys.has(h.key),p=!!l&&(l.hasLocalMutations||n.mutatedKeys.has(l.key)&&l.hasCommittedMutations),d=!1;h&&l?h.data.isEqual(l.data)?f!==p&&(r.track({type:3,doc:l}),d=!0):n.yo(h,l)||(r.track({type:2,doc:l}),d=!0,(u&&n.lo(l,u)>0||c&&n.lo(l,c)<0)&&(s=!0)):!h&&l?(r.track({type:0,doc:l}),d=!0):h&&!l&&(r.track({type:1,doc:h}),d=!0,(u||c)&&(s=!0)),d&&(l?(a=a.add(l),o=p?o.add(t):o.delete(t)):(a=a.delete(t),o=o.delete(t)))})),Hi(this.query)||Wi(this.query))for(;a.size>this.query.limit;){var h=Hi(this.query)?a.last():a.first();a=a.delete(h.key),o=o.delete(h.key),r.track({type:1,doc:h})}return{fo:a,mo:r,Nn:s,mutatedKeys:o}},t.prototype.yo=function(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations},t.prototype.applyChanges=function(t,e,n){var r=this,i=this.fo;this.fo=t.fo,this.mutatedKeys=t.mutatedKeys;var o=t.mo.jr();o.sort((function(t,e){return function(t,e){var n=function(t){switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return xr()}};return n(t)-n(e)}(t.type,e.type)||r.lo(t.doc,e.doc)})),this.po(n);var a=e?this.Eo():[],s=0===this.ho.size&&this.current?1:0,u=s!==this.ao;return this.ao=s,0!==o.length||u?{snapshot:new sh(this.query,t.fo,i,o,t.mutatedKeys,0===s,u,!1),To:a}:{To:a}},t.prototype.zr=function(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({fo:this.fo,mo:new ah,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},t.prototype.Io=function(t){return!this.uo.has(t)&&!!this.fo.has(t)&&!this.fo.get(t).hasLocalMutations},t.prototype.po=function(t){var e=this;t&&(t.addedDocuments.forEach((function(t){return e.uo=e.uo.add(t)})),t.modifiedDocuments.forEach((function(t){})),t.removedDocuments.forEach((function(t){return e.uo=e.uo.delete(t)})),this.current=t.current)},t.prototype.Eo=function(){var t=this;if(!this.current)return[];var e=this.ho;this.ho=ea(),this.fo.forEach((function(e){t.Io(e.key)&&(t.ho=t.ho.add(e.key))}));var n=[];return e.forEach((function(e){t.ho.has(e)||n.push(new bh(e))})),this.ho.forEach((function(t){e.has(t)||n.push(new mh(t))})),n},t.prototype.Ao=function(t){this.uo=t.Bn,this.ho=ea();var e=this._o(t.documents);return this.applyChanges(e,!0)},t.prototype.Ro=function(){return sh.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},t}(),_h=function(t,e,n){this.query=t,this.targetId=e,this.view=n},Eh=function(t){this.key=t,this.bo=!1},Ih=function(){function t(t,e,n,r,i,o){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.vo={},this.Po=new yu((function(t){return to(t)}),$i),this.Vo=new Map,this.So=new Set,this.Do=new Go(ii.comparator),this.Co=new Map,this.No=new Yu,this.xo={},this.ko=new Map,this.Fo=iu.Yt(),this.onlineState="Unknown",this.$o=void 0}return Object.defineProperty(t.prototype,"isPrimaryClient",{get:function(){return!0===this.$o},enumerable:!1,configurable:!0}),t}();function Sh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=$h(t),(a=n.Po.get(e))?(r=a.targetId,n.sharedClientState.addLocalQueryTarget(r),o=a.view.Ro(),[3,4]):[3,1];case 1:return[4,Bu(n.localStore,Yi(e))];case 2:return s=i.sent(),u=n.sharedClientState.addLocalQueryTarget(s.targetId),r=s.targetId,[4,Th(n,e,r,"current"===u)];case 3:o=i.sent(),n.isPrimaryClient&&Rc(n.remoteStore,s),i.label=4;case 4:return[2,o]}}))}))}function Th(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s,u,c,h;return(0,i.Jh)(this,(function(l){switch(l.label){case 0:return t.Oo=function(e,n,r){return function(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(o=e.view._o(n)).Nn?[4,Ku(t.localStore,e.query,!1).then((function(t){var n=t.documents;return e.view._o(n,o)}))]:[3,2];case 1:o=i.sent(),i.label=2;case 2:return a=r&&r.targetChanges.get(e.targetId),s=e.view.applyChanges(o,t.isPrimaryClient,a),[2,(Fh(t,e.targetId,s.To),s.snapshot)]}}))}))}(t,e,n,r)},[4,Ku(t.localStore,e,!0)];case 1:return o=l.sent(),a=new wh(e,o.Bn),s=a._o(o.documents),u=oa.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==t.onlineState),c=a.applyChanges(s,t.isPrimaryClient,u),Fh(t,n,c.To),h=new _h(e,n,a),[2,(t.Po.set(e,h),t.Vo.has(n)?t.Vo.get(n).push(e):t.Vo.set(n,[e]),c.snapshot)]}}))}))}function kh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Cr(t),r=n.Po.get(e),(o=n.Vo.get(r.targetId)).length>1?[2,(n.Vo.set(r.targetId,o.filter((function(t){return!$i(t,e)}))),void n.Po.delete(e))]:n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)?[3,2]:[4,Gu(n.localStore,r.targetId,!1).then((function(){n.sharedClientState.clearQueryState(r.targetId),Lc(n.remoteStore,r.targetId),jh(n,r.targetId)})).catch(cu)]):[3,3];case 1:i.sent(),i.label=2;case 2:return[3,5];case 3:return jh(n,r.targetId),[4,Gu(n.localStore,r.targetId,!0)];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))}function Ah(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:r=tl(t),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,function(t,e){var n,r=Cr(t),i=Mr.now(),o=e.reduce((function(t,e){return t.add(e.key)}),ea());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(t){return r.Mn.pn(t,o).next((function(o){n=o;for(var a=[],s=0,u=e;s<u.length;s++){var c=u[s],h=Oo(c,n.get(c.key));null!=h&&a.push(new Do(c.key,h,wi(h.value.mapValue),Io.exists(!0)))}return r._n.addMutationBatch(t,i,a,e)}))})).then((function(t){return t.applyToLocalDocumentSet(n),{batchId:t.batchId,changes:n}}))}(r.localStore,e)];case 2:return o=i.sent(),r.sharedClientState.addPendingMutation(o.batchId),function(t,e,n){var r=t.xo[t.currentUser.toKey()];r||(r=new Go(Rr)),r=r.insert(e,n),t.xo[t.currentUser.toKey()]=r}(r,o.batchId,n),[4,qh(r,o.changes)];case 3:return i.sent(),[4,zc(r.remoteStore)];case 4:return i.sent(),[3,6];case 5:return a=i.sent(),s=ih(a,"Failed to persist write"),n.reject(s),[3,6];case 6:return[2]}}))}))}function Oh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=Cr(t),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,Uu(n.localStore,e)];case 2:return r=i.sent(),e.targetChanges.forEach((function(t,e){var r=n.Co.get(e);r&&(Nr(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?r.bo=!0:t.modifiedDocuments.size>0?Nr(r.bo):t.removedDocuments.size>0&&(Nr(r.bo),r.bo=!1))})),[4,qh(n,r,e)];case 3:return i.sent(),[3,6];case 4:return[4,cu(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function xh(t,e,n){var r=Cr(t);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){var i=[];r.Po.forEach((function(t,n){var r=n.view.zr(e);r.snapshot&&i.push(r.snapshot)})),function(t,e){var n=Cr(t);n.onlineState=e;var r=!1;n.queries.forEach((function(t,n){for(var i=0,o=n.listeners;i<o.length;i++)o[i].zr(e)&&(r=!0)})),r&&dh(n)}(r.eventManager,e),i.length&&r.vo._r(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}function Nh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s,u,c;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(r=Cr(t)).sharedClientState.updateQueryState(e,"rejected",n),o=r.Co.get(e),(a=o&&o.key)?(s=(s=new Go(ii.comparator)).insert(a,_i.newNoDocument(a,Fr.min())),u=ea().add(a),c=new ia(Fr.min(),new Map,new Wo(Rr),s,u),[4,Oh(r,c)]):[3,2];case 1:return i.sent(),r.Do=r.Do.remove(a),r.Co.delete(e),Vh(r),[3,4];case 2:return[4,Gu(r.localStore,e,!1).then((function(){return jh(r,e,n)})).catch(cu)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))}function Ch(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=Cr(t),r=e.batch.batchId,i.label=1;case 1:return i.trys.push([1,4,,6]),[4,Mu(n.localStore,e)];case 2:return o=i.sent(),Lh(n,r,null),Rh(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),[4,qh(n,o)];case 3:return i.sent(),[3,6];case 4:return[4,cu(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function Dh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:r=Cr(t),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,function(t,e){var n=Cr(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(t){var r;return n._n.lookupMutationBatch(t,e).next((function(e){return Nr(null!==e),r=e.keys(),n._n.removeMutationBatch(t,e)})).next((function(){return n._n.performConsistencyCheck(t)})).next((function(){return n.Mn.pn(t,r)}))}))}(r.localStore,e)];case 2:return o=i.sent(),Lh(r,e,n),Rh(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),[4,qh(r,o)];case 3:return i.sent(),[3,6];case 4:return[4,cu(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function Ph(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:Vc((n=Cr(t)).remoteStore)||Tr("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,function(t){var e=Cr(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(t){return e._n.getHighestUnacknowledgedBatchId(t)}))}(n.localStore)];case 2:return-1===(r=i.sent())?[2,void e.resolve()]:((o=n.ko.get(r)||[]).push(e),n.ko.set(r,o),[3,4]);case 3:return a=i.sent(),s=ih(a,"Initialization of waitForPendingWrites() operation failed"),e.reject(s),[3,4];case 4:return[2]}}))}))}function Rh(t,e){(t.ko.get(e)||[]).forEach((function(t){t.resolve()})),t.ko.delete(e)}function Lh(t,e,n){var r=Cr(t),i=r.xo[r.currentUser.toKey()];if(i){var o=i.get(e);o&&(n?o.reject(n):o.resolve(),i=i.remove(e)),r.xo[r.currentUser.toKey()]=i}}function jh(t,e,n){void 0===n&&(n=null),t.sharedClientState.removeLocalQueryTarget(e);for(var r=0,i=t.Vo.get(e);r<i.length;r++){var o=i[r];t.Po.delete(o),n&&t.vo.Mo(o,n)}t.Vo.delete(e),t.isPrimaryClient&&t.No.Zn(e).forEach((function(e){t.No.containsKey(e)||Mh(t,e)}))}function Mh(t,e){t.So.delete(e.path.canonicalString());var n=t.Do.get(e);null!==n&&(Lc(t.remoteStore,n),t.Do=t.Do.remove(e),t.Co.delete(n),Vh(t))}function Fh(t,e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];o instanceof mh?(t.No.addReference(o.key,e),Uh(t,o)):o instanceof bh?(Tr("SyncEngine","Document no longer in limbo: "+o.key),t.No.removeReference(o.key,e),t.No.containsKey(o.key)||Mh(t,o.key)):xr()}}function Uh(t,e){var n=e.key,r=n.path.canonicalString();t.Do.get(n)||t.So.has(r)||(Tr("SyncEngine","New document in limbo: "+n),t.So.add(r),Vh(t))}function Vh(t){for(;t.So.size>0&&t.Do.size<t.maxConcurrentLimboResolutions;){var e=t.So.values().next().value;t.So.delete(e);var n=new ii(Gr.fromString(e)),r=t.Fo.next();t.Co.set(r,new Eh(n)),t.Do=t.Do.insert(n,r),Rc(t.remoteStore,new Ns(Yi(Ki(n.path)),r,2,wr.o))}}function qh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s;return(0,i.Jh)(this,(function(u){switch(u.label){case 0:return r=Cr(t),o=[],a=[],s=[],r.Po.isEmpty()?[3,3]:(r.Po.forEach((function(t,i){s.push(r.Oo(i,e,n).then((function(t){if(t){r.isPrimaryClient&&r.sharedClientState.updateQueryState(i.targetId,t.fromCache?"not-current":"current"),o.push(t);var e=Du.Pn(i.targetId,t);a.push(e)}})))})),[4,Promise.all(s)]);case 1:return u.sent(),r.vo._r(o),[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u,c,h,l;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=Cr(t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(t){return ys.forEach(e,(function(e){return ys.forEach(e.bn,(function(r){return n.persistence.referenceDelegate.addReference(t,e.targetId,r)})).next((function(){return ys.forEach(e.vn,(function(r){return n.persistence.referenceDelegate.removeReference(t,e.targetId,r)}))}))}))}))];case 2:return i.sent(),[3,4];case 3:if(!_s(r=i.sent()))throw r;return Tr("LocalStore","Failed to update sequence numbers: "+r),[3,4];case 4:for(o=0,a=e;o<a.length;o++)s=a[o],u=s.targetId,s.fromCache||(c=n.kn.get(u),h=c.snapshotVersion,l=c.withLastLimboFreeSnapshotVersion(h),n.kn=n.kn.insert(u,l));return[2]}}))}))}(r.localStore,a)];case 2:u.sent(),u.label=3;case 3:return[2]}}))}))}function Bh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(n=Cr(t)).currentUser.isEqual(e)?[3,3]:(Tr("SyncEngine","User change. New user:",e.toKey()),[4,ju(n.localStore,e)]);case 1:return r=i.sent(),n.currentUser=e,function(t,e){t.ko.forEach((function(t){t.forEach((function(t){t.reject(new Er(_r.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.ko.clear()}(n),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),[4,qh(n,r.Ln)];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))}function Gh(t,e){var n=Cr(t),r=n.Co.get(e);if(r&&r.bo)return ea().add(r.key);var i=ea(),o=n.Vo.get(e);if(!o)return i;for(var a=0,s=o;a<s.length;a++){var u=s[a],c=n.Po.get(u);i=i.unionWith(c.view.wo)}return i}function Kh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,Ku((n=Cr(t)).localStore,e.query,!0)];case 1:return r=i.sent(),o=e.view.Ao(r),[2,(n.isPrimaryClient&&Fh(n,e.targetId,o.To),o)]}}))}))}function Hh(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){return[2,Wu((e=Cr(t)).localStore).then((function(t){return qh(e,t)}))]}))}))}function Wh(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,function(t,e){var n=Cr(t),r=Cr(n._n);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(t){return r.jt(t,e).next((function(e){return e?n.Mn.pn(t,e):ys.resolve(null)}))}))}((o=Cr(t)).localStore,e)];case 1:return null===(a=i.sent())?[3,6]:"pending"!==n?[3,3]:[4,zc(o.remoteStore)];case 2:return i.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(Lh(o,e,r||null),Rh(o,e),function(t,e){Cr(Cr(t)._n).Gt(e)}(o.localStore,e)):xr(),i.label=4;case 4:return[4,qh(o,a)];case 5:return i.sent(),[3,7];case 6:Tr("SyncEngine","Cannot apply mutation batch with id: "+e),i.label=7;case 7:return[2]}}))}))}function zh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u,c,h;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return $h(n=Cr(t)),tl(n),!0!==e||!0===n.$o?[3,3]:(r=n.sharedClientState.getAllActiveQueryTargets(),[4,Jh(n,r.toArray())]);case 1:return o=i.sent(),n.$o=!0,[4,th(n.remoteStore,!0)];case 2:for(i.sent(),a=0,s=o;a<s.length;a++)u=s[a],Rc(n.remoteStore,u);return[3,7];case 3:return!1!==e||!1===n.$o?[3,7]:(c=[],h=Promise.resolve(),n.Vo.forEach((function(t,e){n.sharedClientState.isLocalQueryTarget(e)?c.push(e):h=h.then((function(){return jh(n,e),Gu(n.localStore,e,!0)})),Lc(n.remoteStore,e)})),[4,h]);case 4:return i.sent(),[4,Jh(n,c)];case 5:return i.sent(),function(t){var e=Cr(t);e.Co.forEach((function(t,n){Lc(e.remoteStore,n)})),e.No.ts(),e.Co=new Map,e.Do=new Go(ii.comparator)}(n),n.$o=!1,[4,th(n.remoteStore,!1)];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))}function Jh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u,c,h,l,f,p,d,v,y;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=Cr(t),r=[],o=[],a=0,s=e,i.label=1;case 1:return a<s.length?(u=s[a],c=void 0,(h=n.Vo.get(u))&&0!==h.length?[4,Bu(n.localStore,Yi(h[0]))]:[3,7]):[3,13];case 2:c=i.sent(),l=0,f=h,i.label=3;case 3:return l<f.length?(p=f[l],d=n.Po.get(p),[4,Kh(n,d)]):[3,6];case 4:(v=i.sent()).snapshot&&o.push(v.snapshot),i.label=5;case 5:return l++,[3,3];case 6:return[3,11];case 7:return[4,Hu(n.localStore,u)];case 8:return y=i.sent(),[4,Bu(n.localStore,y)];case 9:return c=i.sent(),[4,Th(n,Qh(y),u,!1)];case 10:i.sent(),i.label=11;case 11:r.push(c),i.label=12;case 12:return a++,[3,1];case 13:return[2,(n.vo._r(o),r)]}}))}))}function Qh(t){return Gi(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function Xh(t){var e=Cr(t);return Cr(Cr(e.localStore).persistence).fn()}function Yh(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(o=Cr(t)).$o?(Tr("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!o.Vo.has(e))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,Wu(o.localStore)];case 3:return a=i.sent(),s=ia.createSynthesizedRemoteEventForCurrentChange(e,"current"===n),[4,qh(o,a,s)];case 4:return i.sent(),[3,8];case 5:return[4,Gu(o.localStore,e,!0)];case 6:return i.sent(),jh(o,e,r),[3,8];case 7:xr(),i.label=8;case 8:return[2]}}))}))}function Zh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s,u,c,h,l,f,p;return(0,i.Jh)(this,(function(d){switch(d.label){case 0:if(!(r=$h(t)).$o)return[3,10];o=0,a=e,d.label=1;case 1:return o<a.length?(s=a[o],r.Vo.has(s)?(Tr("SyncEngine","Adding an already active target "+s),[3,5]):[4,Hu(r.localStore,s)]):[3,6];case 2:return u=d.sent(),[4,Bu(r.localStore,u)];case 3:return c=d.sent(),[4,Th(r,Qh(u),c.targetId,!1)];case 4:d.sent(),Rc(r.remoteStore,c),d.label=5;case 5:return o++,[3,1];case 6:h=function(t){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return r.Vo.has(t)?[4,Gu(r.localStore,t,!1).then((function(){Lc(r.remoteStore,t),jh(r,t)})).catch(cu)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))},l=0,f=n,d.label=7;case 7:return l<f.length?(p=f[l],[5,h(p)]):[3,10];case 8:d.sent(),d.label=9;case 9:return l++,[3,7];case 10:return[2]}}))}))}function $h(t){var e=Cr(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=Oh.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Gh.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Nh.bind(null,e),e.vo._r=fh.bind(null,e.eventManager),e.vo.Mo=ph.bind(null,e.eventManager),e}function tl(t){var e=Cr(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=Ch.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=Dh.bind(null,e),e}var el=function(){function t(){this.synchronizeTabs=!1}return t.prototype.initialize=function(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return this.R=Sc(t.databaseInfo.databaseId),this.sharedClientState=this.Bo(t),this.persistence=this.qo(t),[4,this.persistence.start()];case 1:return e.sent(),this.gcScheduler=this.Uo(t),this.localStore=this.Ko(t),[2]}}))}))},t.prototype.Uo=function(t){return null},t.prototype.Ko=function(t){return Lu(this.persistence,new Pu,t.initialUser,this.R)},t.prototype.qo=function(t){return new rc(oc.bs,this.R)},t.prototype.Bo=function(t){return new yc},t.prototype.terminate=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(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]}}))}))},t}(),nl=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).Qo=e,i.cacheSizeBytes=n,i.forceOwnership=r,i.synchronizeTabs=!1,i}return(0,i.ZT)(e,t),e.prototype.initialize=function(e){return(0,i.mG)(this,void 0,void 0,(function(){var n=this;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return r.sent(),[4,zu(this.localStore)];case 2:return r.sent(),[4,this.Qo.initialize(this,e)];case 3:return r.sent(),[4,tl(this.Qo.syncEngine)];case 4:return r.sent(),[4,zc(this.Qo.remoteStore)];case 5:return r.sent(),[4,this.persistence.He((function(){return n.gcScheduler&&!n.gcScheduler.started&&n.gcScheduler.start(n.localStore),Promise.resolve()}))];case 6:return r.sent(),[2]}}))}))},e.prototype.Ko=function(t){return Lu(this.persistence,new Pu,t.initialUser,this.R)},e.prototype.Uo=function(t){var e=this.persistence.referenceDelegate.garbageCollector;return new fu(e,t.asyncQueue)},e.prototype.qo=function(t){var e=xu(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?Xs.withCacheSize(this.cacheSizeBytes):Xs.DEFAULT;return new ku(this.synchronizeTabs,e,t.clientId,n,t.asyncQueue,Ec(),Ic(),this.R,this.sharedClientState,!!this.forceOwnership)},e.prototype.Bo=function(t){return new yc},e}(el),rl=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n,!1)||this).Qo=e,r.cacheSizeBytes=n,r.synchronizeTabs=!0,r}return(0,i.ZT)(e,t),e.prototype.initialize=function(e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r=this;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return o.sent(),n=this.Qo.syncEngine,this.sharedClientState instanceof vc?(this.sharedClientState.syncEngine={ui:Wh.bind(null,n),ai:Yh.bind(null,n),hi:Zh.bind(null,n),fn:Xh.bind(null,n),ci:Hh.bind(null,n)},[4,this.sharedClientState.start()]):[3,3];case 2:o.sent(),o.label=3;case 3:return[4,this.persistence.He((function(t){return(0,i.mG)(r,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return[4,zh(this.Qo.syncEngine,t)];case 1:return e.sent(),this.gcScheduler&&(t&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):t||this.gcScheduler.stop()),[2]}}))}))}))];case 4:return o.sent(),[2]}}))}))},e.prototype.Bo=function(t){var e=Ec();if(!vc.yt(e))throw new Er(_r.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=xu(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey);return new vc(e,t.asyncQueue,n,t.clientId,t.initialUser)},e}(nl),il=function(){function t(){}return t.prototype.initialize=function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n=this;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return this.localStore?[3,2]:(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=function(t){return xh(n.syncEngine,t,1)},this.remoteStore.remoteSyncer.handleCredentialChange=Bh.bind(null,this.syncEngine),[4,th(this.remoteStore,this.syncEngine.isPrimaryClient)]);case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.createEventManager=function(t){return new ch},t.prototype.createDatastore=function(t){var e,n=Sc(t.databaseInfo.databaseId),r=(e=t.databaseInfo,new _c(e));return function(t,e,n){return new xc(t,e,n)}(t.credentials,r,n)},t.prototype.createRemoteStore=function(t){var e,n,r,i,o,a=this;return e=this.localStore,n=this.datastore,r=t.asyncQueue,i=function(t){return xh(a.syncEngine,t,0)},o=mc.yt()?new mc:new gc,new Cc(e,n,r,i,o)},t.prototype.createSyncEngine=function(t,e){return function(t,e,n,r,i,o,a){var s=new Ih(t,e,n,r,i,o);return a&&(s.$o=!0),s}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)},t.prototype.terminate=function(){return function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=Cr(t),Tr("RemoteStore","RemoteStore shutting down."),e.Or.add(5),[4,Pc(e)];case 1:return n.sent(),e.Lr.shutdown(),e.Br.set("Unknown"),[2]}}))}))}(this.remoteStore)},t}(),ol=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.observer.next&&this.jo(this.observer.next,t)},t.prototype.error=function(t){this.observer.error?this.jo(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)},t.prototype.Wo=function(){this.muted=!0},t.prototype.jo=function(t,e){var n=this;this.muted||setTimeout((function(){n.muted||t(e)}),0)},t}(),al=(function(){function t(t,e){var n=this;this.Go=t,this.R=e,this.metadata=new vs,this.buffer=new Uint8Array,this.zo=new TextDecoder("utf-8"),this.Ho().then((function(t){t&&t.io()?n.metadata.resolve(t.payload.metadata):n.metadata.reject(new Error("The first element of the bundle is not a metadata, it is\n "+JSON.stringify(null==t?void 0:t.payload)))}),(function(t){return n.metadata.reject(t)}))}t.prototype.close=function(){return this.Go.cancel()},t.prototype.getMetadata=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){return[2,this.metadata.promise]}))}))},t.prototype.Lo=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return[4,this.getMetadata()];case 1:return[2,(t.sent(),this.Ho())]}}))}))},t.prototype.Ho=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,this.Jo()];case 1:return null===(t=i.sent())?[2,null]:(e=this.zo.decode(t),n=Number(e),isNaN(n)&&this.Yo("length string ("+e+") is not valid number"),[4,this.Xo(n)]);case 2:return r=i.sent(),[2,new yh(JSON.parse(r),t.length+n)]}}))}))},t.prototype.Zo=function(){return this.buffer.findIndex((function(t){return t==="{".charCodeAt(0)}))},t.prototype.Jo=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return this.Zo()<0?[4,this.tc()]:[3,3];case 1:if(n.sent())return[3,3];n.label=2;case 2:return[3,0];case 3:return 0===this.buffer.length?[2,null]:((t=this.Zo())<0&&this.Yo("Reached the end of bundle when a length string is expected."),e=this.buffer.slice(0,t),[2,(this.buffer=this.buffer.slice(t),e)])}}))}))},t.prototype.Xo=function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return this.buffer.length<t?[4,this.tc()]:[3,3];case 1:n.sent()&&this.Yo("Reached the end of bundle when more is expected."),n.label=2;case 2:return[3,0];case 3:return e=this.zo.decode(this.buffer.slice(0,t)),[2,(this.buffer=this.buffer.slice(t),e)]}}))}))},t.prototype.Yo=function(t){throw this.Go.cancel(),new Error("Invalid bundle format: "+t)},t.prototype.tc=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return[4,this.Go.read()];case 1:return(t=n.sent()).done||((e=new Uint8Array(this.buffer.length+t.value.length)).set(this.buffer),e.set(t.value,this.buffer.length),this.buffer=e),[2,t.done]}}))}))}}(),function(){function t(t){this.datastore=t,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastWriteError=null,this.writtenDocs=new Set}return t.prototype.lookup=function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n=this;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:if(this.ensureCommitNotCalled(),this.mutations.length>0)throw new Er(_r.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Cr(t),r=ka(n.R)+"/documents",o={documents:e.map((function(t){return Ea(n.R,t)}))},[4,n.$i("BatchGetDocuments",r,o)];case 1:return a=i.sent(),s=new Map,a.forEach((function(t){var e=function(t,e){return"found"in e?function(t,e){Nr(!!e.found),e.found.name,e.found.updateTime;var n=Ia(t,e.found.name),r=ba(e.found.updateTime),i=new bi({mapValue:{fields:e.found.fields}});return _i.newFoundDocument(n,r,i)}(t,e):"missing"in e?function(t,e){Nr(!!e.missing),Nr(!!e.readTime);var n=Ia(t,e.missing),r=ba(e.readTime);return _i.newNoDocument(n,r)}(t,e):xr()}(n.R,t);s.set(e.key.toString(),e)})),u=[],[2,(e.forEach((function(t){var e=s.get(t.toString());Nr(!!e),u.push(e)})),u)]}}))}))}(this.datastore,t)];case 1:return[2,((e=r.sent()).forEach((function(t){return n.recordVersion(t)})),e)]}}))}))},t.prototype.set=function(t,e){this.write(e.toMutation(t,this.precondition(t))),this.writtenDocs.add(t.toString())},t.prototype.update=function(t,e){try{this.write(e.toMutation(t,this.preconditionForUpdate(t)))}catch(t){this.lastWriteError=t}this.writtenDocs.add(t.toString())},t.prototype.delete=function(t){this.write(new Fo(t,this.precondition(t))),this.writtenDocs.add(t.toString())},t.prototype.commit=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e=this;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return t=this.readVersions,this.mutations.forEach((function(e){t.delete(e.key.toString())})),t.forEach((function(t,n){var r=ii.fromPath(n);e.mutations.push(new Uo(r,e.precondition(r)))})),[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Cr(t),r=ka(n.R)+"/documents",o={writes:e.map((function(t){return Na(n.R,t)}))},[4,n.Ni("Commit",r,o)];case 1:return i.sent(),[2]}}))}))}(this.datastore,this.mutations)];case 1:return n.sent(),this.committed=!0,[2]}}))}))},t.prototype.recordVersion=function(t){var e;if(t.isFoundDocument())e=t.version;else{if(!t.isNoDocument())throw xr();e=Fr.min()}var n=this.readVersions.get(t.key.toString());if(n){if(!e.isEqual(n))throw new Er(_r.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(t.key.toString(),e)},t.prototype.precondition=function(t){var e=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&e?Io.updateTime(e):Io.none()},t.prototype.preconditionForUpdate=function(t){var e=this.readVersions.get(t.toString());if(!this.writtenDocs.has(t.toString())&&e){if(e.isEqual(Fr.min()))throw new Er(_r.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Io.updateTime(e)}return Io.exists(!0)},t.prototype.write=function(t){this.ensureCommitNotCalled(),this.mutations.push(t)},t.prototype.ensureCommitNotCalled=function(){},t}()),sl=function(){function t(t,e,n,r){this.asyncQueue=t,this.datastore=e,this.updateFunction=n,this.deferred=r,this.ec=5,this.Zi=new Tc(this.asyncQueue,"transaction_retry")}return t.prototype.run=function(){this.ec-=1,this.nc()},t.prototype.nc=function(){var t=this;this.Zi.ji((function(){return(0,i.mG)(t,void 0,void 0,(function(){var t,e,n=this;return(0,i.Jh)(this,(function(r){return t=new al(this.datastore),(e=this.sc(t))&&e.then((function(e){n.asyncQueue.enqueueAndForget((function(){return t.commit().then((function(){n.deferred.resolve(e)})).catch((function(t){n.ic(t)}))}))})).catch((function(t){n.ic(t)})),[2]}))}))}))},t.prototype.sc=function(t){try{var e=this.updateFunction(t);return!ei(e)&&e.catch&&e.then?e:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}},t.prototype.ic=function(t){var e=this;this.ec>0&&this.rc(t)?(this.ec-=1,this.asyncQueue.enqueueAndForget((function(){return e.nc(),Promise.resolve()}))):this.deferred.reject(t)},t.prototype.rc=function(t){if("FirebaseError"===t.name){var e=t.code;return"aborted"===e||"failed-precondition"===e||!qo(e)}return!1},t}(),ul=function(){function t(t,e,n){var r=this;this.credentials=t,this.asyncQueue=e,this.databaseInfo=n,this.user=ac.UNAUTHENTICATED,this.clientId=Pr.u(),this.credentialListener=function(){return Promise.resolve()},this.credentials.setChangeListener(e,(function(t){return(0,i.mG)(r,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return Tr("FirestoreClient","Received user=",t.uid),[4,this.credentialListener(t)];case 1:return e.sent(),this.user=t,[2]}}))}))}))}return t.prototype.getConfiguration=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){return[2,{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}]}))}))},t.prototype.setCredentialChangeListener=function(t){this.credentialListener=t},t.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new Er(_r.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.terminate=function(){var t=this;this.asyncQueue.enterRestrictedMode();var e=new vs;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((function(){return(0,i.mG)(t,void 0,void 0,(function(){var t,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:r.sent(),r.label=4;case 4:return this.credentials.removeChangeListener(),e.resolve(),[3,6];case 5:return t=r.sent(),n=ih(t,"Failed to shutdown persistence"),e.reject(n),[3,6];case 6:return[2]}}))}))})),e.promise},t}();function cl(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o=this;return(0,i.Jh)(this,(function(a){switch(a.label){case 0:return t.asyncQueue.verifyOperationInProgress(),Tr("FirestoreClient","Initializing OfflineComponentProvider"),[4,t.getConfiguration()];case 1:return n=a.sent(),[4,e.initialize(n)];case 2:return a.sent(),r=n.initialUser,t.setCredentialChangeListener((function(t){return(0,i.mG)(o,void 0,void 0,(function(){return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return r.isEqual(t)?[3,2]:[4,ju(e.localStore,t)];case 1:n.sent(),r=t,n.label=2;case 2:return[2]}}))}))})),e.persistence.setDatabaseDeletedListener((function(){return t.terminate()})),t.offlineComponents=e,[2]}}))}))}function hl(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:return t.asyncQueue.verifyOperationInProgress(),[4,ll(t)];case 1:return n=o.sent(),Tr("FirestoreClient","Initializing OnlineComponentProvider"),[4,t.getConfiguration()];case 2:return r=o.sent(),[4,e.initialize(n,r)];case 3:return o.sent(),t.setCredentialChangeListener((function(t){return function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(n=Cr(t)).asyncQueue.verifyOperationInProgress(),Tr("RemoteStore","RemoteStore received new credentials"),r=Vc(n),n.Or.add(3),[4,Pc(n)];case 1:return i.sent(),r&&n.Br.set("Unknown"),[4,n.remoteSyncer.handleCredentialChange(e)];case 2:return i.sent(),n.Or.delete(3),[4,Dc(n)];case 3:return i.sent(),[2]}}))}))}(e.remoteStore,t)})),t.onlineComponents=e,[2]}}))}))}function ll(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return t.offlineComponents?[3,2]:(Tr("FirestoreClient","Using default OfflineComponentProvider"),[4,cl(t,new el)]);case 1:e.sent(),e.label=2;case 2:return[2,t.offlineComponents]}}))}))}function fl(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return t.onlineComponents?[3,2]:(Tr("FirestoreClient","Using default OnlineComponentProvider"),[4,hl(t,new il)]);case 1:e.sent(),e.label=2;case 2:return[2,t.onlineComponents]}}))}))}function pl(t){return ll(t).then((function(t){return t.persistence}))}function dl(t){return ll(t).then((function(t){return t.localStore}))}function vl(t){return fl(t).then((function(t){return t.remoteStore}))}function yl(t){return fl(t).then((function(t){return t.syncEngine}))}function gl(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return[4,fl(t)];case 1:return e=r.sent(),[2,((n=e.eventManager).onListen=Sh.bind(null,e.syncEngine),n.onUnlisten=kh.bind(null,e.syncEngine),n)]}}))}))}function ml(t,e,n){var r=this;void 0===n&&(n={});var o=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(r,void 0,void 0,(function(){var r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return r=function(t,e,n,r,i){var o=new ol({next:function(o){e.enqueueAndForget((function(){return lh(t,a)}));var s=o.docs.has(n);!s&&o.fromCache?i.reject(new Er(_r.UNAVAILABLE,"Failed to get document because the client is offline.")):s&&o.fromCache&&r&&"server"===r.source?i.reject(new Er(_r.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.)')):i.resolve(o)},error:function(t){return i.reject(t)}}),a=new vh(Ki(n.path),o,{includeMetadataChanges:!0,so:!0});return hh(t,a)},[4,gl(t)];case 1:return[2,r.apply(void 0,[i.sent(),t.asyncQueue,e,n,o])]}}))}))})),o.promise}function bl(t,e,n){var r=this;void 0===n&&(n={});var o=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(r,void 0,void 0,(function(){var r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return r=function(t,e,n,r,i){var o=new ol({next:function(n){e.enqueueAndForget((function(){return lh(t,a)})),n.fromCache&&"server"===r.source?i.reject(new Er(_r.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.)')):i.resolve(n)},error:function(t){return i.reject(t)}}),a=new vh(n,o,{includeMetadataChanges:!0,so:!0});return hh(t,a)},[4,gl(t)];case 1:return[2,r.apply(void 0,[i.sent(),t.asyncQueue,e,n,o])]}}))}))})),o.promise}var wl=function(t,e,n,r,i,o,a,s){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.useFetchStreams=s},_l=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"isDefaultDatabase",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t}(),El=new Map,Il=function(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+t},Sl=function(){function t(){this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t,e){this.changeListener=e,t.enqueueRetryable((function(){return e(ac.UNAUTHENTICATED)}))},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),Tl=function(){function t(t){this.token=t,this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(this.token)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t,e){var n=this;this.changeListener=e,t.enqueueRetryable((function(){return e(n.token.user)}))},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),kl=function(){function t(t){var e=this;this.currentUser=ac.UNAUTHENTICATED,this.oc=new vs,this.cc=0,this.forceRefresh=!1,this.auth=null,this.asyncQueue=null,this.uc=function(){e.cc++,e.currentUser=e.ac(),e.oc.resolve(),e.changeListener&&e.asyncQueue.enqueueRetryable((function(){return e.changeListener(e.currentUser)}))};var n=function(t){Tr("FirebaseCredentialsProvider","Auth detected"),e.auth=t,e.auth.addAuthTokenListener(e.uc)};t.onInit((function(t){return n(t)})),setTimeout((function(){if(!e.auth){var r=t.getImmediate({optional:!0});r?n(r):(Tr("FirebaseCredentialsProvider","Auth not yet detected"),e.oc.resolve())}}),0)}return t.prototype.getToken=function(){var t=this,e=this.cc,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return t.cc!==e?(Tr("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):n?(Nr("string"==typeof n.accessToken),new Il(n.accessToken,t.currentUser)):null})):Promise.resolve(null)},t.prototype.invalidateToken=function(){this.forceRefresh=!0},t.prototype.setChangeListener=function(t,e){var n=this;this.asyncQueue=t,this.asyncQueue.enqueueRetryable((function(){return(0,i.mG)(n,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return[4,this.oc.promise];case 1:return t.sent(),[4,e(this.currentUser)];case 2:return t.sent(),this.changeListener=e,[2]}}))}))}))},t.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.uc),this.changeListener=function(){return Promise.resolve()}},t.prototype.ac=function(){var t=this.auth&&this.auth.getUid();return Nr(null===t||"string"==typeof t),new ac(t)},t}(),Al=function(){function t(t,e,n){this.hc=t,this.lc=e,this.fc=n,this.type="FirstParty",this.user=ac.FIRST_PARTY}return Object.defineProperty(t.prototype,"authHeaders",{get:function(){var t={"X-Goog-AuthUser":this.lc},e=this.hc.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),this.fc&&(t["X-Goog-Iam-Authorization-Token"]=this.fc),t},enumerable:!1,configurable:!0}),t}(),Ol=function(){function t(t,e,n){this.hc=t,this.lc=e,this.fc=n}return t.prototype.getToken=function(){return Promise.resolve(new Al(this.hc,this.lc,this.fc))},t.prototype.setChangeListener=function(t,e){t.enqueueRetryable((function(){return e(ac.FIRST_PARTY)}))},t.prototype.removeChangeListener=function(){},t.prototype.invalidateToken=function(){},t}();function xl(t,e,n){if(!n)throw new Er(_r.INVALID_ARGUMENT,"Function "+t+"() cannot be called with an empty "+e+".")}function Nl(t,e){if(void 0===e)return{merge:!1};if(void 0!==e.mergeFields&&void 0!==e.merge)throw new Er(_r.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function Cl(t,e,n,r){if(!0===e&&!0===r)throw new Er(_r.INVALID_ARGUMENT,t+" and "+n+" cannot be used together.")}function Dl(t){if(!ii.isDocumentKey(t))throw new Er(_r.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t+" has "+t.length+".")}function Pl(t){if(ii.isDocumentKey(t))throw new Er(_r.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t+" has "+t.length+".")}function Rl(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";var e=function(t){if(t.constructor){var e=/function\s+([^\s(]+)\s*\(/.exec(t.constructor.toString());if(e&&e.length>1)return e[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return"function"==typeof t?"a function":xr()}function Ll(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Er(_r.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=Rl(t);throw new Er(_r.INVALID_ARGUMENT,"Expected type '"+e.name+"', but it was: "+n)}return t}function jl(t,e){if(e<=0)throw new Er(_r.INVALID_ARGUMENT,"Function "+t+"() requires a positive number, but it was: "+e+".")}var Ml=function(){function t(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new Er(_r.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=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new Er(_r.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,Cl("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}return t.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},t}(),Fl=function(){function t(t,e){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Ml({}),this._settingsFrozen=!1,t instanceof _l?(this._databaseId=t,this._credentials=new Sl):(this._app=t,this._databaseId=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new Er(_r.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new _l(t.options.projectId)}(t),this._credentials=new kl(e))}return Object.defineProperty(t.prototype,"app",{get:function(){if(!this._app)throw new Er(_r.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_terminated",{get:function(){return void 0!==this._terminateTask},enumerable:!1,configurable:!0}),t.prototype._setSettings=function(t){if(this._settingsFrozen)throw new Er(_r.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 Ml(t),void 0!==t.credentials&&(this._credentials=function(t){if(!t)return new Sl;switch(t.type){case"gapi":var e=t.client;return Nr(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new Ol(e,t.sessionIndex||"0",t.iamToken||null);case"provider":return t.client;default:throw new Er(_r.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))},t.prototype._getSettings=function(){return this._settings},t.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},t.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},t.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},t.prototype._terminate=function(){return(t=El.get(this))&&(Tr("ComponentProvider","Removing Datastore"),El.delete(this),t.terminate()),Promise.resolve();var t},t}(),Ul=function(){function t(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}return Object.defineProperty(t.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new ql(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this._key)},t}(),Vl=function(){function t(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}return t.prototype.withConverter=function(e){return new t(this.firestore,e,this._query)},t}(),ql=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,Ki(r))||this)._path=r,i.type="collection",i}return(0,i.ZT)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._path.popLast();return t.isEmpty()?null:new Ul(this.firestore,null,new ii(t))},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(t){return new e(this.firestore,t,this._path)},e}(Vl);function Bl(t,e){for(var n,r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];if(t=(0,o.m9)(t),xl("collection","path",e),t instanceof Fl)return Pl(n=Gr.fromString.apply(Gr,(0,i.ev)([e],r))),new ql(t,null,n);if(!(t instanceof Ul||t instanceof ql))throw new Er(_r.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return Pl(n=Gr.fromString.apply(Gr,(0,i.ev)([t.path],r)).child(Gr.fromString(e))),new ql(t.firestore,null,n)}function Gl(t,e){for(var n,r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];if(t=(0,o.m9)(t),1===arguments.length&&(e=Pr.u()),xl("doc","path",e),t instanceof Fl)return Dl(n=Gr.fromString.apply(Gr,(0,i.ev)([e],r))),new Ul(t,null,new ii(n));if(!(t instanceof Ul||t instanceof ql))throw new Er(_r.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return Dl(n=t._path.child(Gr.fromString.apply(Gr,(0,i.ev)([e],r)))),new Ul(t.firestore,t instanceof ql?t.converter:null,new ii(n))}function Kl(t,e){return t=(0,o.m9)(t),e=(0,o.m9)(e),(t instanceof Ul||t instanceof ql)&&(e instanceof Ul||e instanceof ql)&&t.firestore===e.firestore&&t.path===e.path&&t.converter===e.converter}function Hl(t,e){return t=(0,o.m9)(t),e=(0,o.m9)(e),t instanceof Vl&&e instanceof Vl&&t.firestore===e.firestore&&$i(t._query,e._query)&&t.converter===e.converter}var Wl=function(){function t(){var t=this;this.dc=Promise.resolve(),this.wc=[],this._c=!1,this.mc=[],this.yc=null,this.gc=!1,this.Ec=!1,this.Tc=[],this.Zi=new Tc(this,"async_queue_retry"),this.Ic=function(){var e=Ic();e&&Tr("AsyncQueue","Visibility state changed to "+e.visibilityState),t.Zi.Gi()};var e=Ic();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Ic)}return Object.defineProperty(t.prototype,"isShuttingDown",{get:function(){return this._c},enumerable:!1,configurable:!0}),t.prototype.enqueueAndForget=function(t){this.enqueue(t)},t.prototype.enqueueAndForgetEvenWhileRestricted=function(t){this.Ac(),this.Rc(t)},t.prototype.enterRestrictedMode=function(t){if(!this._c){this._c=!0,this.Ec=t||!1;var e=Ic();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Ic)}},t.prototype.enqueue=function(t){var e=this;if(this.Ac(),this._c)return new Promise((function(){}));var n=new vs;return this.Rc((function(){return e._c&&e.Ec?Promise.resolve():(t().then(n.resolve,n.reject),n.promise)})).then((function(){return n.promise}))},t.prototype.enqueueRetryable=function(t){var e=this;this.enqueueAndForget((function(){return e.wc.push(t),e.bc()}))},t.prototype.bc=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e=this;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:if(0===this.wc.length)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.wc[0]()];case 2:return n.sent(),this.wc.shift(),this.Zi.reset(),[3,4];case 3:if(!_s(t=n.sent()))throw t;return Tr("AsyncQueue","Operation failed with retryable error: "+t),[3,4];case 4:this.wc.length>0&&this.Zi.ji((function(){return e.bc()})),n.label=5;case 5:return[2]}}))}))},t.prototype.Rc=function(t){var e=this,n=this.dc.then((function(){return e.gc=!0,t().catch((function(t){throw e.yc=t,e.gc=!1,kr("INTERNAL UNHANDLED ERROR: ",function(t){var e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t)),t})).then((function(t){return e.gc=!1,t}))}));return this.dc=n,n},t.prototype.enqueueAfterDelay=function(t,e,n){var r=this;this.Ac(),this.Tc.indexOf(t)>-1&&(e=0);var i=rh.createAndSchedule(this,t,e,n,(function(t){return r.vc(t)}));return this.mc.push(i),i},t.prototype.Ac=function(){this.yc&&xr()},t.prototype.verifyOperationInProgress=function(){},t.prototype.Pc=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t;return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return[4,t=this.dc];case 1:e.sent(),e.label=2;case 2:if(t!==this.dc)return[3,0];e.label=3;case 3:return[2]}}))}))},t.prototype.Vc=function(t){for(var e=0,n=this.mc;e<n.length;e++)if(n[e].timerId===t)return!0;return!1},t.prototype.Sc=function(t){var e=this;return this.Pc().then((function(){e.mc.sort((function(t,e){return t.targetTimeMs-e.targetTimeMs}));for(var n=0,r=e.mc;n<r.length;n++){var i=r[n];if(i.skipDelay(),"all"!==t&&i.timerId===t)break}return e.Pc()}))},t.prototype.Dc=function(t){this.Tc.push(t)},t.prototype.vc=function(t){var e=this.mc.indexOf(t);this.mc.splice(e,1)},t}();function zl(t){return function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=t,r=0,i=["next","error","complete"];r<i.length;r++){var o=i[r];if(o in n&&"function"==typeof n[o])return!0}return!1}(t)}!function(){function t(){this._progressObserver={},this._taskCompletionResolver=new vs,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}t.prototype.onProgress=function(t,e,n){this._progressObserver={next:t,error:e,complete:n}},t.prototype.catch=function(t){return this._taskCompletionResolver.promise.catch(t)},t.prototype.then=function(t,e){return this._taskCompletionResolver.promise.then(t,e)},t.prototype._completeWith=function(t){this._updateProgress(t),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(t)},t.prototype._failWith=function(t){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(t),this._taskCompletionResolver.reject(t)},t.prototype._updateProgress=function(t){this._lastProgress=t,this._progressObserver.next&&this._progressObserver.next(t)}}();var Jl=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).type="firestore",r._queue=new Wl,r._persistenceKey="name"in e?e.name:"[DEFAULT]",r}return(0,i.ZT)(e,t),e.prototype._terminate=function(){return this._firestoreClient||Xl(this),this._firestoreClient.terminate()},e}(Fl);function Ql(t){return t._firestoreClient||Xl(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function Xl(t){var e,n=t._freezeSettings(),r=function(t,e,n,r){return new wl(t,e,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,r.useFetchStreams)}(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new ul(t._credentials,t._queue,r)}function Yl(t,e,n){var r=this,o=new vs;return t.asyncQueue.enqueue((function(){return(0,i.mG)(r,void 0,void 0,(function(){var r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,cl(t,n)];case 1:return i.sent(),[4,hl(t,e)];case 2:return i.sent(),o.resolve(),[3,4];case 3:if(!function(t){return"FirebaseError"===t.name?t.code===_r.FAILED_PRECONDITION||t.code===_r.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code}(r=i.sent()))throw r;return console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+r),o.reject(r),[3,4];case 4:return[2]}}))}))})).then((function(){return o.promise}))}function Zl(t){if(t._initialized||t._terminated)throw new Er(_r.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 $l=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0;n<t.length;++n)if(0===t[n].length)throw new Er(_r.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Hr(t)}return t.prototype.isEqual=function(t){return this._internalPath.isEqual(t._internalPath)},t}(),tf=function(){function t(t){this._byteString=t}return t.fromBase64String=function(e){try{return new t(zr.fromBase64String(e))}catch(e){throw new Er(_r.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}},t.fromUint8Array=function(e){return new t(zr.fromUint8Array(e))},t.prototype.toBase64=function(){return this._byteString.toBase64()},t.prototype.toUint8Array=function(){return this._byteString.toUint8Array()},t.prototype.toString=function(){return"Bytes(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this._byteString.isEqual(t._byteString)},t}(),ef=function(t){this._methodName=t},nf=function(){function t(t,e){if(!isFinite(t)||t<-90||t>90)throw new Er(_r.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new Er(_r.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this._lat===t._lat&&this._long===t._long},t.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},t.prototype._compareTo=function(t){return Rr(this._lat,t._lat)||Rr(this._long,t._long)},t}(),rf=/^__.*__$/,of=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutation=function(t,e){return null!==this.fieldMask?new Do(t,this.data,this.fieldMask,e,this.fieldTransforms):new Co(t,this.data,e,this.fieldTransforms)},t}(),af=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutation=function(t,e){return new Do(t,this.data,this.fieldMask,e,this.fieldTransforms)},t}();function sf(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw xr()}}var uf=function(){function t(t,e,n,r,i,o){this.settings=t,this.databaseId=e,this.R=n,this.ignoreUndefinedProperties=r,void 0===i&&this.Cc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Nc",{get:function(){return this.settings.Nc},enumerable:!1,configurable:!0}),t.prototype.xc=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},t.prototype.kc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.xc({path:n,Fc:!1});return r.$c(t),r},t.prototype.Oc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.xc({path:n,Fc:!1});return r.Cc(),r},t.prototype.Mc=function(t){return this.xc({path:void 0,Fc:!0})},t.prototype.Lc=function(t){return Of(t,this.settings.methodName,this.settings.Bc||!1,this.path,this.settings.qc)},t.prototype.contains=function(t){return void 0!==this.fieldMask.find((function(e){return t.isPrefixOf(e)}))||void 0!==this.fieldTransforms.find((function(e){return t.isPrefixOf(e.field)}))},t.prototype.Cc=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.$c(this.path.get(t))},t.prototype.$c=function(t){if(0===t.length)throw this.Lc("Document fields must not be empty");if(sf(this.Nc)&&rf.test(t))throw this.Lc('Document fields cannot begin and end with "__"')},t}(),cf=function(){function t(t,e,n){this.databaseId=t,this.ignoreUndefinedProperties=e,this.R=n||Sc(t)}return t.prototype.Uc=function(t,e,n,r){return void 0===r&&(r=!1),new uf({Nc:t,methodName:e,qc:n,path:Hr.emptyPath(),Fc:!1,Bc:r},this.databaseId,this.R,this.ignoreUndefinedProperties)},t}();function hf(t){var e=t._freezeSettings(),n=Sc(t._databaseId);return new cf(t._databaseId,!!e.ignoreUndefinedProperties,n)}function lf(t,e,n,r,i,o){void 0===o&&(o={});var a=t.Uc(o.merge||o.mergeFields?2:0,e,n,i);Sf("Data must be an object, but it was:",a,r);var s,u,c=Ef(r,a);if(o.merge)s=new Wr(a.fieldMask),u=a.fieldTransforms;else if(o.mergeFields){for(var h=[],l=0,f=o.mergeFields;l<f.length;l++){var p=Tf(e,f[l],n);if(!a.contains(p))throw new Er(_r.INVALID_ARGUMENT,"Field '"+p+"' is specified in your field mask but missing from your input data.");xf(h,p)||h.push(p)}s=new Wr(h),u=a.fieldTransforms.filter((function(t){return s.covers(t.field)}))}else s=null,u=a.fieldTransforms;return new of(new bi(c),s,u)}var ff=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){if(2!==t.Nc)throw 1===t.Nc?t.Lc(this._methodName+"() can only appear at the top level of your update data"):t.Lc(this._methodName+"() cannot be used with set() unless you pass {merge:true}");return t.fieldMask.push(t.path),null},e.prototype.isEqual=function(t){return t instanceof e},e}(ef);function pf(t,e,n){return new uf({Nc:3,qc:e.settings.qc,methodName:t._methodName,Fc:n},e.databaseId,e.R,e.ignoreUndefinedProperties)}var df=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){return new _o(t.path,new fo)},e.prototype.isEqual=function(t){return t instanceof e},e}(ef),vf=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).Kc=n,r}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){var e=pf(this,t,!0),n=this.Kc.map((function(t){return _f(t,e)})),r=new po(n);return new _o(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(ef),yf=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).Kc=n,r}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){var e=pf(this,t,!0),n=this.Kc.map((function(t){return _f(t,e)})),r=new yo(n);return new _o(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(ef),gf=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).Qc=n,r}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){var e=new mo(t.R,so(t.R,this.Qc));return new _o(t.path,e)},e.prototype.isEqual=function(t){return this===t},e}(ef);function mf(t,e,n,r){var i=t.Uc(1,e,n);Sf("Data must be an object, but it was:",i,r);var a=[],s=bi.empty();Vr(r,(function(t,r){var u=Af(e,t,n);r=(0,o.m9)(r);var c=i.Oc(u);if(r instanceof ff)a.push(u);else{var h=_f(r,c);null!=h&&(a.push(u),s.set(u,h))}}));var u=new Wr(a);return new af(s,u,i.fieldTransforms)}function bf(t,e,n,r,i,a){var s=t.Uc(1,e,n),u=[Tf(e,r,n)],c=[i];if(a.length%2!=0)throw new Er(_r.INVALID_ARGUMENT,"Function "+e+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var h=0;h<a.length;h+=2)u.push(Tf(e,a[h])),c.push(a[h+1]);for(var l=[],f=bi.empty(),p=u.length-1;p>=0;--p)if(!xf(l,u[p])){var d=u[p],v=c[p];v=(0,o.m9)(v);var y=s.Oc(d);if(v instanceof ff)l.push(d);else{var g=_f(v,y);null!=g&&(l.push(d),f.set(d,g))}}var m=new Wr(l);return new af(f,m,s.fieldTransforms)}function wf(t,e,n,r){return void 0===r&&(r=!1),_f(n,t.Uc(r?4:3,e))}function _f(t,e){if(If(t=(0,o.m9)(t)))return Sf("Unsupported field value:",e,t),Ef(t,e);if(t instanceof ef)return function(t,e){if(!sf(e.Nc))throw e.Lc(t._methodName+"() can only be used with update() and set()");if(!e.path)throw e.Lc(t._methodName+"() is not currently supported inside arrays");var n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&4!==e.Nc)throw e.Lc("Nested arrays are not supported");return function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var a=_f(o[i],e.Mc(r));null==a&&(a={nullValue:"NULL_VALUE"}),n.push(a),r++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=(0,o.m9)(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return so(e.R,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){var n=Mr.fromDate(t);return{timestampValue:ya(e.R,n)}}if(t instanceof Mr)return n=new Mr(t.seconds,1e3*Math.floor(t.nanoseconds/1e3)),{timestampValue:ya(e.R,n)};if(t instanceof nf)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof tf)return{bytesValue:ga(e.R,t._byteString)};if(t instanceof Ul){n=e.databaseId;var r=t.firestore._databaseId;if(!r.isEqual(n))throw e.Lc("Document reference is for database "+r.projectId+"/"+r.database+" but should be for database "+n.projectId+"/"+n.database);return{referenceValue:wa(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.Lc("Unsupported field value: "+Rl(t))}(t,e)}function Ef(t,e){var n={};return qr(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Vr(t,(function(t,r){var i=_f(r,e.kc(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}function If(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof Mr||t instanceof nf||t instanceof tf||t instanceof Ul||t instanceof ef)}function Sf(t,e,n){if(!If(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){var r=Rl(n);throw"an object"===r?e.Lc(t+" a custom object"):e.Lc(t+" "+r)}}function Tf(t,e,n){if((e=(0,o.m9)(e))instanceof $l)return e._internalPath;if("string"==typeof e)return Af(t,e);throw Of("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}var kf=new RegExp("[~\\*/\\[\\]]");function Af(t,e,n){if(e.search(kf)>=0)throw Of("Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'",t,!1,void 0,n);try{return(new($l.bind.apply($l,(0,i.ev)([void 0],e.split(".")))))._internalPath}catch(r){throw Of("Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",t,!1,void 0,n)}}function Of(t,e,n,r,i){var o=r&&!r.isEmpty(),a=void 0!==i,s="Function "+e+"() called with invalid data";n&&(s+=" (via `toFirestore()`)");var u="";return(o||a)&&(u+=" (found",o&&(u+=" in field "+r),a&&(u+=" in document "+i),u+=")"),new Er(_r.INVALID_ARGUMENT,(s+=". ")+t+u)}function xf(t,e){return t.some((function(t){return t.isEqual(e)}))}var Nf=function(){function t(t,e,n,r,i){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=r,this._converter=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new Ul(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),t.prototype.exists=function(){return null!==this._document},t.prototype.data=function(){if(this._document){if(this._converter){var t=new Cf(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}},t.prototype.get=function(t){if(this._document){var e=this._document.data.field(Df("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}},t}(),Cf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.data=function(){return t.prototype.data.call(this)},e}(Nf);function Df(t,e){return"string"==typeof e?Af(t,e):e instanceof $l?e._internalPath:e._delegate._internalPath}var Pf=function(){function t(t,e){this.hasPendingWrites=t,this.fromCache=e}return t.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},t}(),Rf=function(t){function e(e,n,r,i,o,a){var s=this;return(s=t.call(this,e,n,r,i,a)||this)._firestore=e,s._firestoreImpl=e,s.metadata=o,s}return(0,i.ZT)(e,t),e.prototype.exists=function(){return t.prototype.exists.call(this)},e.prototype.data=function(t){if(void 0===t&&(t={}),this._document){if(this._converter){var e=new Lf(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}},e.prototype.get=function(t,e){if(void 0===e&&(e={}),this._document){var n=this._document.data.field(Df("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}},e}(Nf),Lf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.data=function(e){return void 0===e&&(e={}),t.prototype.data.call(this,e)},e}(Rf),jf=function(){function t(t,e,n,r){this._firestore=t,this._userDataWriter=e,this._snapshot=r,this.metadata=new Pf(r.hasPendingWrites,r.fromCache),this.query=n}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;this._snapshot.docs.forEach((function(r){t.call(e,new Lf(n._firestore,n._userDataWriter,r.key,r,new Pf(n._snapshot.mutatedKeys.has(r.key),n._snapshot.fromCache),n.query.converter))}))},t.prototype.docChanges=function(t){void 0===t&&(t={});var e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new Er(_r.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){var n=0;return t._snapshot.docChanges.map((function(e){return{type:"added",doc:new Lf(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Pf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter),oldIndex:-1,newIndex:n++}}))}var r=t._snapshot.oldDocs;return t._snapshot.docChanges.filter((function(t){return e||3!==t.type})).map((function(e){var n=new Lf(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Pf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter),i=-1,o=-1;return 0!==e.type&&(i=r.indexOf(e.doc.key),r=r.delete(e.doc.key)),1!==e.type&&(o=(r=r.add(e.doc)).indexOf(e.doc.key)),{type:Mf(e.type),doc:n,oldIndex:i,newIndex:o}}))}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges},t}();function Mf(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return xr()}}function Ff(t,e){return t instanceof Rf&&e instanceof Rf?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(null===t._document?null===e._document:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof jf&&e instanceof jf&&t._firestore===e._firestore&&Hl(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)}function Uf(t){if(Wi(t)&&0===t.explicitOrderBy.length)throw new Er(_r.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var Vf=function(){};function qf(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];t=o._apply(t)}return t}var Bf=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).jc=e,i.Wc=n,i.Gc=r,i.type="where",i}return(0,i.ZT)(e,t),e.prototype._apply=function(t){var e=hf(t.firestore),n=function(t,e,n,r,i,o,a){var s;if(i.isKeyField()){if("array-contains"===o||"array-contains-any"===o)throw new Er(_r.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){Qf(a,o);for(var u=[],c=0,h=a;c<h.length;c++){var l=h[c];u.push(Jf(r,t,l))}s={arrayValue:{values:u}}}else s=Jf(r,t,a)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||Qf(a,o),s=wf(n,"where",a,"in"===o||"not-in"===o);var f=Ai.create(i,o,s);return function(t,e){if(e.g()){var n=Ji(t);if(null!==n&&!n.isEqual(e.field))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+e.field.toString()+"'");var r=zi(t);null!==r&&Xf(0,e.field,r)}var i=function(t,e){for(var n=0,r=t.filters;n<r.length;n++){var i=r[n];if(e.indexOf(i.op)>=0)return i.op}return null}(t,function(t){switch(t){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[]}}(e.op));if(null!==i)throw i===e.op?new Er(_r.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+e.op.toString()+"' filter."):new Er(_r.INVALID_ARGUMENT,"Invalid query. You cannot use '"+e.op.toString()+"' filters with '"+i.toString()+"' filters.")}(t,f),f}(t._query,0,e,t.firestore._databaseId,this.jc,this.Wc,this.Gc);return new Vl(t.firestore,t.converter,function(t,e){var n=t.filters.concat([e]);return new Bi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t._query,n))},e}(Vf),Gf=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).jc=e,r.zc=n,r.type="orderBy",r}return(0,i.ZT)(e,t),e.prototype._apply=function(t){var e=function(t,e,n){if(null!==t.startAt)throw new Er(_r.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new Er(_r.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new Fi(e,n);return function(t,e){if(null===zi(t)){var n=Ji(t);null!==n&&Xf(0,n,e.field)}}(t,r),r}(t._query,this.jc,this.zc);return new Vl(t.firestore,t.converter,function(t,e){var n=t.explicitOrderBy.concat([e]);return new Bi(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t._query,e))},e}(Vf),Kf=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Hc=n,i.Jc=r,i}return(0,i.ZT)(e,t),e.prototype._apply=function(t){return new Vl(t.firestore,t.converter,Zi(t._query,this.Hc,this.Jc))},e}(Vf),Hf=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Yc=n,i.Xc=r,i}return(0,i.ZT)(e,t),e.prototype._apply=function(t){var e=zf(t,this.type,this.Yc,this.Xc);return new Vl(t.firestore,t.converter,function(t,e){return new Bi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t._query,e))},e}(Vf),Wf=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Yc=n,i.Xc=r,i}return(0,i.ZT)(e,t),e.prototype._apply=function(t){var e=zf(t,this.type,this.Yc,this.Xc);return new Vl(t.firestore,t.converter,function(t,e){return new Bi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t._query,e))},e}(Vf);function zf(t,e,n,r){if(n[0]=(0,o.m9)(n[0]),n[0]instanceof Nf)return function(t,e,n,r,i){if(!r)throw new Er(_r.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],a=0,s=Xi(t);a<s.length;a++){var u=s[a];if(u.field.isKeyField())o.push(fi(e,r.key));else{var c=r.data.field(u.field);if(Zr(c))throw new Er(_r.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+u.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===c){var h=u.field.canonicalString();throw new Er(_r.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+h+"' (used as the orderBy) does not exist.")}o.push(c)}}return new ji(o,i)}(t._query,t.firestore._databaseId,e,n[0]._document,r);var i=hf(t.firestore);return function(t,e,n,r,i,o){var a=t.explicitOrderBy;if(i.length>a.length)throw new Er(_r.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var s=[],u=0;u<i.length;u++){var c=i[u];if(a[u].field.isKeyField()){if("string"!=typeof c)throw new Er(_r.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof c);if(!Qi(t)&&-1!==c.indexOf("/"))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+r+"() must be a plain document ID, but '"+c+"' contains a slash.");var h=t.path.child(Gr.fromString(c));if(!ii.isDocumentKey(h))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+r+"() must result in a valid document path, but '"+h+"' is not because it contains an odd number of segments.");var l=new ii(h);s.push(fi(e,l))}else{var f=wf(n,r,c);s.push(f)}}return new ji(s,o)}(t._query,t.firestore._databaseId,i,e,n,r)}function Jf(t,e,n){if("string"==typeof(n=(0,o.m9)(n))){if(""===n)throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!Qi(e)&&-1!==n.indexOf("/"))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var r=e.path.child(Gr.fromString(n));if(!ii.isDocumentKey(r))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return fi(t,new ii(r))}if(n instanceof Ul)return fi(t,n._key);throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+Rl(n)+".")}function Qf(t,e){if(!Array.isArray(t)||0===t.length)throw new Er(_r.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+e.toString()+"' filters.");if(t.length>10)throw new Er(_r.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.")}function Xf(t,e,n){if(!n.isEqual(e))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}var Yf=function(){function t(){}return t.prototype.convertValue=function(t,e){switch(void 0===e&&(e="none"),oi(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Xr(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(Yr(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw xr()}},t.prototype.convertObject=function(t,e){var n=this,r={};return Vr(t.fields,(function(t,i){r[t]=n.convertValue(i,e)})),r},t.prototype.convertGeoPoint=function(t){return new nf(Xr(t.latitude),Xr(t.longitude))},t.prototype.convertArray=function(t,e){var n=this;return(t.values||[]).map((function(t){return n.convertValue(t,e)}))},t.prototype.convertServerTimestamp=function(t,e){switch(e){case"previous":var n=$r(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(ti(t));default:return null}},t.prototype.convertTimestamp=function(t){var e=Qr(t);return new Mr(e.seconds,e.nanos)},t.prototype.convertDocumentKey=function(t,e){var n=Gr.fromString(t);Nr(Ha(n));var r=new _l(n.get(1),n.get(3)),i=new ii(n.popFirst(5));return r.isEqual(e)||kr("Document "+i+" contains a document reference within a different database ("+r.projectId+"/"+r.database+") which is not supported. It will be treated as a reference in the current database ("+e.projectId+"/"+e.database+") instead."),i},t}();function Zf(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var $f=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,i.ZT)(e,t),e.prototype.convertBytes=function(t){return new tf(t)},e.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return new Ul(this.firestore,null,e)},e}(Yf),tp=function(){function t(t,e){this._firestore=t,this._commitHandler=e,this._mutations=[],this._committed=!1,this._dataReader=hf(t)}return t.prototype.set=function(t,e,n){this._verifyNotCommitted();var r=ep(t,this._firestore),i=Zf(r.converter,e,n),o=lf(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(o.toMutation(r._key,Io.none())),this},t.prototype.update=function(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];this._verifyNotCommitted();var a,s=ep(t,this._firestore);return a="string"==typeof(e=(0,o.m9)(e))||e instanceof $l?bf(this._dataReader,"WriteBatch.update",s._key,e,n,r):mf(this._dataReader,"WriteBatch.update",s._key,e),this._mutations.push(a.toMutation(s._key,Io.exists(!0))),this},t.prototype.delete=function(t){this._verifyNotCommitted();var e=ep(t,this._firestore);return this._mutations=this._mutations.concat(new Fo(e._key,Io.none())),this},t.prototype.commit=function(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()},t.prototype._verifyNotCommitted=function(){if(this._committed)throw new Er(_r.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}();function ep(t,e){if((t=(0,o.m9)(t)).firestore!==e)throw new Er(_r.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}var np=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,i.ZT)(e,t),e.prototype.convertBytes=function(t){return new tf(t)},e.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return new Ul(this.firestore,null,e)},e}(Yf);function rp(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];t=Ll(t,Ul);var a=Ll(t.firestore,Jl),s=hf(a);return op(a,[("string"==typeof(e=(0,o.m9)(e))||e instanceof $l?bf(s,"updateDoc",t._key,e,n,r):mf(s,"updateDoc",t._key,e)).toMutation(t._key,Io.exists(!0))])}function ip(t){for(var e,n,r,a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];t=(0,o.m9)(t);var u={includeMetadataChanges:!1},c=0;"object"!=typeof a[c]||zl(a[c])||(u=a[c],c++);var h,l,f,p={includeMetadataChanges:u.includeMetadataChanges};if(zl(a[c])){var d=a[c];a[c]=null===(e=d.next)||void 0===e?void 0:e.bind(d),a[c+1]=null===(n=d.error)||void 0===n?void 0:n.bind(d),a[c+2]=null===(r=d.complete)||void 0===r?void 0:r.bind(d)}if(t instanceof Ul)l=Ll(t.firestore,Jl),f=Ki(t._key.path),h={next:function(e){a[c]&&a[c](ap(l,t,e))},error:a[c+1],complete:a[c+2]};else{var v=Ll(t,Vl);l=Ll(v.firestore,Jl),f=v._query;var y=new np(l);h={next:function(t){a[c]&&a[c](new jf(l,y,v,t))},error:a[c+1],complete:a[c+2]},Uf(t._query)}return function(t,e,n,r){var o=this,a=new ol(r),s=new vh(e,a,n);return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(o,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=hh,[4,gl(t)];case 1:return[2,e.apply(void 0,[n.sent(),s])]}}))}))})),function(){a.Wo(),t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(o,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=lh,[4,gl(t)];case 1:return[2,e.apply(void 0,[n.sent(),s])]}}))}))}))}}(Ql(l),f,p,h)}function op(t,e){return function(t,e){var n=this,r=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Ah,[4,yl(t)];case 1:return[2,n.apply(void 0,[i.sent(),e,r])]}}))}))})),r.promise}(Ql(t),e)}function ap(t,e,n){var r=n.docs.get(e._key),i=new np(t);return new Rf(t,i,e._key,r,new Pf(n.hasPendingWrites,n.fromCache),e.converter)}var sp=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this)._firestore=e,r}return(0,i.ZT)(e,t),e.prototype.get=function(e){var n=this,r=ep(e,this._firestore),i=new np(this._firestore);return t.prototype.get.call(this,e).then((function(t){return new Rf(n._firestore,i,r._key,t._document,new Pf(!1,!1),r.converter)}))},e}(function(){function t(t,e){this._firestore=t,this._transaction=e,this._dataReader=hf(t)}return t.prototype.get=function(t){var e=this,n=ep(t,this._firestore),r=new $f(this._firestore);return this._transaction.lookup([n._key]).then((function(t){if(!t||1!==t.length)return xr();var i=t[0];if(i.isFoundDocument())return new Nf(e._firestore,r,i.key,i,n.converter);if(i.isNoDocument())return new Nf(e._firestore,r,n._key,null,n.converter);throw xr()}))},t.prototype.set=function(t,e,n){var r=ep(t,this._firestore),i=Zf(r.converter,e,n),o=lf(this._dataReader,"Transaction.set",r._key,i,null!==r.converter,n);return this._transaction.set(r._key,o),this},t.prototype.update=function(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];var a,s=ep(t,this._firestore);return a="string"==typeof(e=(0,o.m9)(e))||e instanceof $l?bf(this._dataReader,"Transaction.update",s._key,e,n,r):mf(this._dataReader,"Transaction.update",s._key,e),this._transaction.update(s._key,a),this},t.prototype.delete=function(t){var e=ep(t,this._firestore);return this._transaction.delete(e._key),this},t}());function up(){if("undefined"==typeof Uint8Array)throw new Er(_r.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function cp(){if("undefined"==typeof atob)throw new Er(_r.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var hp=function(){function t(t){this._delegate=t}return t.fromBase64String=function(e){return cp(),new t(tf.fromBase64String(e))},t.fromUint8Array=function(e){return up(),new t(tf.fromUint8Array(e))},t.prototype.toBase64=function(){return cp(),this._delegate.toBase64()},t.prototype.toUint8Array=function(){return up(),this._delegate.toUint8Array()},t.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t}(),lp=function(){function t(){}return t.prototype.enableIndexedDbPersistence=function(t,e){return function(t,e){Zl(t=Ll(t,Jl));var n=Ql(t),r=t._freezeSettings(),i=new il;return Yl(n,i,new nl(i,r.cacheSizeBytes,null==e?void 0:e.forceOwnership))}(t._delegate,{forceOwnership:e})},t.prototype.enableMultiTabIndexedDbPersistence=function(t){return function(t){Zl(t=Ll(t,Jl));var e=Ql(t),n=t._freezeSettings(),r=new il;return Yl(e,r,new rl(r,n.cacheSizeBytes))}(t._delegate)},t.prototype.clearIndexedDbPersistence=function(t){return function(t){var e=this;if(t._initialized&&!t._terminated)throw new Er(_r.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");var n=new vs;return t._queue.enqueueAndForgetEvenWhileRestricted((function(){return(0,i.mG)(e,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return ms.yt()?(e=t+"main",[4,ms.delete(e)]):[2,Promise.resolve()];case 1:return n.sent(),[2]}}))}))}(xu(t._databaseId,t._persistenceKey))];case 1:return r.sent(),n.resolve(),[3,3];case 2:return e=r.sent(),n.reject(e),[3,3];case 3:return[2]}}))}))})),n.promise}(t._delegate)},t}(),fp=function(){function t(t,e,n){var r=this;this._delegate=e,this.Zc=n,this.INTERNAL={delete:function(){return r.terminate()}},t instanceof _l||(this.tu=t)}return Object.defineProperty(t.prototype,"_databaseId",{get:function(){return this._delegate._databaseId},enumerable:!1,configurable:!0}),t.prototype.settings=function(t){var e=this._delegate._getSettings();t.merge||e.host===t.host||Ar("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({},e),t)).merge,this._delegate._setSettings(t)},t.prototype.useEmulator=function(t,e,n){void 0===n&&(n={}),function(t,e,n,r){var i;void 0===r&&(r={});var a=(t=Ll(t,Fl))._getSettings();if("firestore.googleapis.com"!==a.host&&a.host!==e&&Ar("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},a),{host:e+":"+n,ssl:!1})),r.mockUserToken){var s,u;if("string"==typeof r.mockUserToken)s=r.mockUserToken,u=ac.MOCK_USER;else{s=(0,o.Sg)(r.mockUserToken,null===(i=t._app)||void 0===i?void 0:i.options.projectId);var c=r.mockUserToken.sub||r.mockUserToken.user_id;if(!c)throw new Er(_r.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");u=new ac(c)}t._credentials=new Tl(new Il(s,u))}}(this._delegate,t,e,n)},t.prototype.enableNetwork=function(){return function(t){var e=this;return t.asyncQueue.enqueue((function(){return(0,i.mG)(e,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return[4,pl(t)];case 1:return e=r.sent(),[4,vl(t)];case 2:return n=r.sent(),[2,(e.setNetworkEnabled(!0),function(t){var e=Cr(t);return e.Or.delete(0),Dc(e)}(n))]}}))}))}))}(Ql(Ll(this._delegate,Jl)))},t.prototype.disableNetwork=function(){return function(t){var e=this;return t.asyncQueue.enqueue((function(){return(0,i.mG)(e,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return[4,pl(t)];case 1:return e=r.sent(),[4,vl(t)];case 2:return n=r.sent(),[2,(e.setNetworkEnabled(!1),function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return(e=Cr(t)).Or.add(0),[4,Pc(e)];case 1:return n.sent(),e.Br.set("Offline"),[2]}}))}))}(n))]}}))}))}))}(Ql(Ll(this._delegate,Jl)))},t.prototype.enablePersistence=function(t){var e=!1,n=!1;return t&&Cl("synchronizeTabs",e=!!t.synchronizeTabs,"experimentalForceOwningTab",n=!!t.experimentalForceOwningTab),e?this.Zc.enableMultiTabIndexedDbPersistence(this):this.Zc.enableIndexedDbPersistence(this,n)},t.prototype.clearPersistence=function(){return this.Zc.clearIndexedDbPersistence(this)},t.prototype.terminate=function(){return this.tu&&(this.tu._removeServiceInstance("firestore"),this.tu._removeServiceInstance("firestore-exp")),this._delegate._delete()},t.prototype.waitForPendingWrites=function(){return function(t){var e=this,n=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(e,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return e=Ph,[4,yl(t)];case 1:return[2,e.apply(void 0,[r.sent(),n])]}}))}))})),n.promise}(Ql(Ll(this._delegate,Jl)))},t.prototype.onSnapshotsInSync=function(t){return function(t,e){return function(t,e){var n=this,r=new ol(e);return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=function(t,e){Cr(t).Gr.add(e),e.next()},[4,gl(t)];case 1:return[2,e.apply(void 0,[n.sent(),r])]}}))}))})),function(){r.Wo(),t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=function(t,e){Cr(t).Gr.delete(e)},[4,gl(t)];case 1:return[2,e.apply(void 0,[n.sent(),r])]}}))}))}))}}(Ql(t=Ll(t,Jl)),zl(e)?e:{next:e})}(this._delegate,t)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this.tu)throw new Er(_r.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.tu},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){try{return new kp(this,Bl(this._delegate,t))}catch(t){throw mp(t,"collection()","Firestore.collection()")}},t.prototype.doc=function(t){try{return new gp(this,Gl(this._delegate,t))}catch(t){throw mp(t,"doc()","Firestore.doc()")}},t.prototype.collectionGroup=function(t){try{return new Ip(this,function(t,e){if(t=Ll(t,Fl),xl("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new Er(_r.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new Vl(t,null,function(t){return new Bi(Gr.emptyPath(),t)}(e))}(this._delegate,t))}catch(t){throw mp(t,"collectionGroup()","Firestore.collectionGroup()")}},t.prototype.runTransaction=function(t){var e=this;return function(t,e){return function(t,e){var n=this,r=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,function(t){return fl(t).then((function(t){return t.datastore}))}(t)];case 1:return n=i.sent(),new sl(t.asyncQueue,n,e,r).run(),[2]}}))}))})),r.promise}(Ql(t),(function(n){return e(new sp(t,n))}))}(this._delegate,(function(n){return t(new dp(e,n))}))},t.prototype.batch=function(){var t=this;return Ql(this._delegate),new vp(new tp(this._delegate,(function(e){return op(t._delegate,e)})))},t.prototype.loadBundle=function(t){throw new Er(_r.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},t.prototype.namedQuery=function(t){throw new Er(_r.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},t}(),pp=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,i.ZT)(e,t),e.prototype.convertBytes=function(t){return new hp(new tf(t))},e.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return gp.eu(e,this.firestore,null)},e}(Yf),dp=function(){function t(t,e){this._firestore=t,this._delegate=e,this._userDataWriter=new pp(t)}return t.prototype.get=function(t){var e=this,n=Ap(t);return this._delegate.get(n).then((function(t){return new _p(e._firestore,new Rf(e._firestore._delegate,e._userDataWriter,t._key,t._document,t.metadata,n.converter))}))},t.prototype.set=function(t,e,n){var r=Ap(t);return n?(Nl("Transaction.set",n),this._delegate.set(r,e,n)):this._delegate.set(r,e),this},t.prototype.update=function(t,e,n){for(var r,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];var s=Ap(t);return 2===arguments.length?this._delegate.update(s,e):(r=this._delegate).update.apply(r,(0,i.ev)([s,e,n],o)),this},t.prototype.delete=function(t){var e=Ap(t);return this._delegate.delete(e),this},t}(),vp=function(){function t(t){this._delegate=t}return t.prototype.set=function(t,e,n){var r=Ap(t);return n?(Nl("WriteBatch.set",n),this._delegate.set(r,e,n)):this._delegate.set(r,e),this},t.prototype.update=function(t,e,n){for(var r,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];var s=Ap(t);return 2===arguments.length?this._delegate.update(s,e):(r=this._delegate).update.apply(r,(0,i.ev)([s,e,n],o)),this},t.prototype.delete=function(t){var e=Ap(t);return this._delegate.delete(e),this},t.prototype.commit=function(){return this._delegate.commit()},t}(),yp=function(){function t(t,e,n){this._firestore=t,this._userDataWriter=e,this._delegate=n}return t.prototype.fromFirestore=function(t,e){var n=new Lf(this._firestore._delegate,this._userDataWriter,t._key,t._document,t.metadata,null);return this._delegate.fromFirestore(new Ep(this._firestore,n),null!=e?e:{})},t.prototype.toFirestore=function(t,e){return e?this._delegate.toFirestore(t,e):this._delegate.toFirestore(t)},t.nu=function(e,n){var r=t.su,i=r.get(e);i||(i=new WeakMap,r.set(e,i));var o=i.get(n);return o||(o=new t(e,new pp(e),n),i.set(n,o)),o},t}();yp.su=new WeakMap;var gp=function(){function t(t,e){this.firestore=t,this._delegate=e,this._userDataWriter=new pp(t)}return t.iu=function(e,n,r){if(e.length%2!=0)throw new Er(_r.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e.canonicalString()+" has "+e.length);return new t(n,new Ul(n._delegate,r,new ii(e)))},t.eu=function(e,n,r){return new t(n,new Ul(n._delegate,r,e))},Object.defineProperty(t.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new kp(this.firestore,this._delegate.parent)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){try{return new kp(this.firestore,Bl(this._delegate,t))}catch(t){throw mp(t,"collection()","DocumentReference.collection()")}},t.prototype.isEqual=function(t){return(t=(0,o.m9)(t))instanceof Ul&&Kl(this._delegate,t)},t.prototype.set=function(t,e){e=Nl("DocumentReference.set",e);try{return function(t,e,n){t=Ll(t,Ul);var r=Ll(t.firestore,Jl),i=Zf(t.converter,e,n);return op(r,[lf(hf(r),"setDoc",t._key,i,null!==t.converter,n).toMutation(t._key,Io.none())])}(this._delegate,t,e)}catch(t){throw mp(t,"setDoc()","DocumentReference.set()")}},t.prototype.update=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];try{return 1===arguments.length?rp(this._delegate,t):rp.apply(void 0,(0,i.ev)([this._delegate,t,e],n))}catch(t){throw mp(t,"updateDoc()","DocumentReference.update()")}},t.prototype.delete=function(){return op(Ll((t=this._delegate).firestore,Jl),[new Fo(t._key,Io.none())]);var t},t.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=bp(e),i=wp(e,(function(e){return new _p(t.firestore,new Rf(t.firestore._delegate,t._userDataWriter,e._key,e._document,e.metadata,t._delegate.converter))}));return ip(this._delegate,r,i)},t.prototype.get=function(t){var e=this;return("cache"===(null==t?void 0:t.source)?function(t){t=Ll(t,Ul);var e=Ll(t.firestore,Jl),n=Ql(e),r=new np(e);return function(t,e){var n=this,r=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:return n=function(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,function(t,e){var n=Cr(t);return n.persistence.runTransaction("read document","readonly",(function(t){return n.Mn.mn(t,e)}))}(t,e)];case 1:return(o=i.sent()).isFoundDocument()?n.resolve(o):o.isNoDocument()?n.resolve(null):n.reject(new Er(_r.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 r=i.sent(),o=ih(r,"Failed to get document '"+e+" from cache"),n.reject(o),[3,3];case 3:return[2]}}))}))},[4,dl(t)];case 1:return[2,n.apply(void 0,[o.sent(),e,r])]}}))}))})),r.promise}(n,t._key).then((function(n){return new Rf(e,r,t._key,n,new Pf(null!==n&&n.hasLocalMutations,!0),t.converter)}))}(this._delegate):"server"===(null==t?void 0:t.source)?function(t){t=Ll(t,Ul);var e=Ll(t.firestore,Jl);return ml(Ql(e),t._key,{source:"server"}).then((function(n){return ap(e,t,n)}))}(this._delegate):function(t){t=Ll(t,Ul);var e=Ll(t.firestore,Jl);return ml(Ql(e),t._key).then((function(n){return ap(e,t,n)}))}(this._delegate)).then((function(t){return new _p(e.firestore,new Rf(e.firestore._delegate,e._userDataWriter,t._key,t._document,t.metadata,e._delegate.converter))}))},t.prototype.withConverter=function(e){return new t(this.firestore,e?this._delegate.withConverter(yp.nu(this.firestore,e)):this._delegate.withConverter(null))},t}();function mp(t,e,n){return t.message=t.message.replace(e,n),t}function bp(t){for(var e=0,n=t;e<n.length;e++){var r=n[e];if("object"==typeof r&&!zl(r))return r}return{}}function wp(t,e){var n,r,i;return{next:function(t){i.next&&i.next(e(t))},error:null===(n=(i=zl(t[0])?t[0]:zl(t[1])?t[1]:"function"==typeof t[0]?{next:t[0],error:t[1],complete:t[2]}:{next:t[1],error:t[2],complete:t[3]}).error)||void 0===n?void 0:n.bind(i),complete:null===(r=i.complete)||void 0===r?void 0:r.bind(i)}}var _p=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"ref",{get:function(){return new gp(this._firestore,this._delegate.ref)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return this._delegate.exists()},enumerable:!1,configurable:!0}),t.prototype.data=function(t){return this._delegate.data(t)},t.prototype.get=function(t,e){return this._delegate.get(t,e)},t.prototype.isEqual=function(t){return Ff(this._delegate,t._delegate)},t}(),Ep=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.data=function(t){return this._delegate.data(t)},e}(_p),Ip=function(){function t(t,e){this.firestore=t,this._delegate=e,this._userDataWriter=new pp(t)}return t.prototype.where=function(e,n,r){try{return new t(this.firestore,qf(this._delegate,function(t,e,n){var r=e,i=Df("where",t);return new Bf(i,r,n)}(e,n,r)))}catch(e){throw mp(e,/(orderBy|where)\(\)/,"Query.$1()")}},t.prototype.orderBy=function(e,n){try{return new t(this.firestore,qf(this._delegate,function(t,e){void 0===e&&(e="asc");var n=e,r=Df("orderBy",t);return new Gf(r,n)}(e,n)))}catch(e){throw mp(e,/(orderBy|where)\(\)/,"Query.$1()")}},t.prototype.limit=function(e){try{return new t(this.firestore,qf(this._delegate,function(t){return jl("limit",t),new Kf("limit",t,"F")}(e)))}catch(e){throw mp(e,"limit()","Query.limit()")}},t.prototype.limitToLast=function(e){try{return new t(this.firestore,qf(this._delegate,function(t){return jl("limitToLast",t),new Kf("limitToLast",t,"L")}(e)))}catch(e){throw mp(e,"limitToLast()","Query.limitToLast()")}},t.prototype.startAt=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,qf(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Hf("startAt",t,!0)}.apply(void 0,e)))}catch(e){throw mp(e,"startAt()","Query.startAt()")}},t.prototype.startAfter=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,qf(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Hf("startAfter",t,!1)}.apply(void 0,e)))}catch(e){throw mp(e,"startAfter()","Query.startAfter()")}},t.prototype.endBefore=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,qf(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Wf("endBefore",t,!0)}.apply(void 0,e)))}catch(e){throw mp(e,"endBefore()","Query.endBefore()")}},t.prototype.endAt=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,qf(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Wf("endAt",t,!1)}.apply(void 0,e)))}catch(e){throw mp(e,"endAt()","Query.endAt()")}},t.prototype.isEqual=function(t){return Hl(this._delegate,t._delegate)},t.prototype.get=function(t){var e=this;return("cache"===(null==t?void 0:t.source)?function(t){t=Ll(t,Vl);var e=Ll(t.firestore,Jl),n=Ql(e),r=new np(e);return function(t,e){var n=this,r=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:return n=function(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s,u;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Ku(t,e,!0)];case 1:return u=i.sent(),r=new wh(e,u.Bn),o=r._o(u.documents),a=r.applyChanges(o,!1),n.resolve(a.snapshot),[3,3];case 2:return s=i.sent(),u=ih(s,"Failed to execute query '"+e+" against cache"),n.reject(u),[3,3];case 3:return[2]}}))}))},[4,dl(t)];case 1:return[2,n.apply(void 0,[o.sent(),e,r])]}}))}))})),r.promise}(n,t._query).then((function(n){return new jf(e,r,t,n)}))}(this._delegate):"server"===(null==t?void 0:t.source)?function(t){t=Ll(t,Vl);var e=Ll(t.firestore,Jl),n=Ql(e),r=new np(e);return bl(n,t._query,{source:"server"}).then((function(n){return new jf(e,r,t,n)}))}(this._delegate):function(t){t=Ll(t,Vl);var e=Ll(t.firestore,Jl),n=Ql(e),r=new np(e);return Uf(t._query),bl(n,t._query).then((function(n){return new jf(e,r,t,n)}))}(this._delegate)).then((function(t){return new Tp(e.firestore,new jf(e.firestore._delegate,e._userDataWriter,e._delegate,t._snapshot))}))},t.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=bp(e),i=wp(e,(function(e){return new Tp(t.firestore,new jf(t.firestore._delegate,t._userDataWriter,t._delegate,e._snapshot))}));return ip(this._delegate,r,i)},t.prototype.withConverter=function(e){return new t(this.firestore,e?this._delegate.withConverter(yp.nu(this.firestore,e)):this._delegate.withConverter(null))},t}(),Sp=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"type",{get:function(){return this._delegate.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"doc",{get:function(){return new Ep(this._firestore,this._delegate.doc)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"oldIndex",{get:function(){return this._delegate.oldIndex},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"newIndex",{get:function(){return this._delegate.newIndex},enumerable:!1,configurable:!0}),t}(),Tp=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"query",{get:function(){return new Ip(this._firestore,this._delegate.query)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._delegate.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this._delegate.empty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"docs",{get:function(){var t=this;return this._delegate.docs.map((function(e){return new Ep(t._firestore,e)}))},enumerable:!1,configurable:!0}),t.prototype.docChanges=function(t){var e=this;return this._delegate.docChanges(t).map((function(t){return new Sp(e._firestore,t)}))},t.prototype.forEach=function(t,e){var n=this;this._delegate.forEach((function(r){t.call(e,new Ep(n._firestore,r))}))},t.prototype.isEqual=function(t){return Ff(this._delegate,t._delegate)},t}(),kp=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).firestore=e,r._delegate=n,r}return(0,i.ZT)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._delegate.parent;return t?new gp(this.firestore,t):null},enumerable:!1,configurable:!0}),e.prototype.doc=function(t){try{return new gp(this.firestore,void 0===t?Gl(this._delegate):Gl(this._delegate,t))}catch(t){throw mp(t,"doc()","CollectionReference.doc()")}},e.prototype.add=function(t){var e=this;return function(t,e){var n=Ll(t.firestore,Jl),r=Gl(t),i=Zf(t.converter,e);return op(n,[lf(hf(t.firestore),"addDoc",r._key,i,null!==t.converter,{}).toMutation(r._key,Io.exists(!1))]).then((function(){return r}))}(this._delegate,t).then((function(t){return new gp(e.firestore,t)}))},e.prototype.isEqual=function(t){return Kl(this._delegate,t._delegate)},e.prototype.withConverter=function(t){return new e(this.firestore,t?this._delegate.withConverter(yp.nu(this.firestore,t)):this._delegate.withConverter(null))},e}(Ip);function Ap(t){return Ll(t,Ul)}var Op,xp=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._delegate=new($l.bind.apply($l,(0,i.ev)([void 0],t)))}return t.documentId=function(){return new t(Hr.keyField().canonicalString())},t.prototype.isEqual=function(t){return(t=(0,o.m9)(t))instanceof $l&&this._delegate._internalPath.isEqual(t._internalPath)},t}(),Np=function(){function t(t){this._delegate=t}return t.serverTimestamp=function(){var e=new df("serverTimestamp");return e._methodName="FieldValue.serverTimestamp",new t(e)},t.delete=function(){var e=new ff("deleteField");return e._methodName="FieldValue.delete",new t(e)},t.arrayUnion=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new vf("arrayUnion",t)}.apply(void 0,e);return r._methodName="FieldValue.arrayUnion",new t(r)},t.arrayRemove=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new yf("arrayRemove",t)}.apply(void 0,e);return r._methodName="FieldValue.arrayRemove",new t(r)},t.increment=function(e){var n=function(t){return new gf("increment",t)}(e);return n._methodName="FieldValue.increment",new t(n)},t.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},t}(),Cp=n(2444),Dp={Firestore:fp,GeoPoint:nf,Timestamp:Mr,Blob:hp,Transaction:dp,WriteBatch:vp,DocumentReference:gp,DocumentSnapshot:_p,Query:Ip,QueryDocumentSnapshot:Ep,QuerySnapshot:Tp,CollectionReference:kp,FieldPath:xp,FieldValue:Np,setLogLevel:function(t){var e;e=t,Ir.setLogLevel(e)},CACHE_SIZE_UNLIMITED:-1};(function(t,e){t.INTERNAL.registerComponent(new Cp.wA("firestore",(function(t){return function(t,e){return new fp(t,new Jl(t,e),new lp)}(t.getProvider("app").getImmediate(),t.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},Dp)))})(Op=r.Z),Op.registerVersion("@firebase/firestore","2.4.0")},2249:function(t,e,n){var r,i,o=n(5163),a=n(6765),s=n(2444),u=n(3936),c=((r={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r["invalid-log-argument"]="First argument to `onLog` must be null or a function.",r),h=new a.LL("app","Firebase",c),l="@firebase/app",f="[DEFAULT]",p=((i={})[l]="fire-core",i["@firebase/analytics"]="fire-analytics",i["@firebase/app-check"]="fire-app-check",i["@firebase/auth"]="fire-auth",i["@firebase/database"]="fire-rtdb",i["@firebase/functions"]="fire-fn",i["@firebase/installations"]="fire-iid",i["@firebase/messaging"]="fire-fcm",i["@firebase/performance"]="fire-perf",i["@firebase/remote-config"]="fire-rc",i["@firebase/storage"]="fire-gcs",i["@firebase/firestore"]="fire-fst",i["fire-js"]="fire-js",i["firebase-wrapper"]="fire-js-all",i),d=new u.Yd("@firebase/app"),v=function(){function t(t,e,n){var r=this;this.firebase_=n,this.isDeleted_=!1,this.name_=e.name,this.automaticDataCollectionEnabled_=e.automaticDataCollectionEnabled||!1,this.options_=(0,a.p$)(t),this.container=new s.H0(e.name),this._addComponent(new s.wA("app",(function(){return r}),"PUBLIC")),this.firebase_.INTERNAL.components.forEach((function(t){return r._addComponent(t)}))}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise((function(e){t.checkDestroyed_(),e()})).then((function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map((function(t){return t.delete()})))})).then((function(){t.isDeleted_=!0}))},t.prototype._getService=function(t,e){var n;void 0===e&&(e=f),this.checkDestroyed_();var r=this.container.getProvider(t);return r.isInitialized()||"EXPLICIT"!==(null===(n=r.getComponent())||void 0===n?void 0:n.instantiationMode)||r.initialize(),r.getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e=f),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){d.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw h.create("app-deleted",{appName:this.name_})},t}();v.prototype.name&&v.prototype.options||v.prototype.delete||console.log("dc");var y=function t(){var e=function(t){var e={},n=new Map,r={__esModule:!0,initializeApp:function(n,i){void 0===i&&(i={}),"object"==typeof i&&null!==i||(i={name:i});var o=i;void 0===o.name&&(o.name=f);var s=o.name;if("string"!=typeof s||!s)throw h.create("bad-app-name",{appName:String(s)});if((0,a.r3)(e,s))throw h.create("duplicate-app",{appName:s});var u=new t(n,o,r);return e[s]=u,u},app:i,registerVersion:function(t,e,n){var r,i=null!==(r=p[t])&&void 0!==r?r:t;n&&(i+="-"+n);var a=i.match(/\s|\//),u=e.match(/\s|\//);if(a||u){var c=['Unable to register library "'+i+'" with version "'+e+'":'];return a&&c.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),a&&u&&c.push("and"),u&&c.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void d.warn(c.join(" "))}o(new s.wA(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))},setLogLevel:u.Ub,onLog:function(t,e){if(null!==t&&"function"!=typeof t)throw h.create("invalid-log-argument");(0,u.Am)(t,e)},apps:null,SDK_VERSION:"8.10.0",INTERNAL:{registerComponent:o,removeApp:function(t){delete e[t]},components:n,useAsService:function(t,e){return"serverAuth"===e?null:e}}};function i(t){if(t=t||f,!(0,a.r3)(e,t))throw h.create("no-app",{appName:t});return e[t]}function o(o){var s=o.name;if(n.has(s))return d.debug("There were multiple attempts to register component "+s+"."),"PUBLIC"===o.type?r[s]:null;if(n.set(s,o),"PUBLIC"===o.type){var u=function(t){if(void 0===t&&(t=i()),"function"!=typeof t[s])throw h.create("invalid-app-argument",{appName:s});return t[s]()};void 0!==o.serviceProps&&(0,a.ZB)(u,o.serviceProps),r[s]=u,t.prototype[s]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._getService.bind(this,s).apply(this,o.multipleInstances?t:[])}}for(var c=0,l=Object.keys(e);c<l.length;c++){var f=l[c];e[f]._addComponent(o)}return"PUBLIC"===o.type?r[s]:null}return r.default=r,Object.defineProperty(r,"apps",{get:function(){return Object.keys(e).map((function(t){return e[t]}))}}),i.App=t,r}(v);return e.INTERNAL=(0,o.pi)((0,o.pi)({},e.INTERNAL),{createFirebaseNamespace:t,extendNamespace:function(t){(0,a.ZB)(e,t)},createSubscribe:a.ne,ErrorFactory:a.LL,deepExtend:a.ZB}),e}(),g=function(){function t(t){this.container=t}return t.prototype.getPlatformInfoString=function(){return this.container.getProviders().map((function(t){if(function(t){var e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}();if((0,a.jU)()&&void 0!==self.firebase){d.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");var m=self.firebase.SDK_VERSION;m&&m.indexOf("LITE")>=0&&d.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var b=y.initializeApp;y.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,a.UG)()&&d.warn('\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the "main" field in package.json.\n \n If you are using Webpack, you can specify "main" as the first item in\n "resolve.mainFields":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the @rollup/plugin-node-resolve plugin and specify "main"\n as the first item in "mainFields", e.g. [\'main\', \'module\'].\n https://github.com/rollup/@rollup/plugin-node-resolve\n '),b.apply(void 0,t)};var w=y;!function(t,e){t.INTERNAL.registerComponent(new s.wA("platform-logger",(function(t){return new g(t)}),"PRIVATE")),t.registerVersion(l,"0.6.30",void 0),t.registerVersion("fire-js","")}(w),e.Z=w},7823:function(t,e,n){n.r(e),n.d(e,{MobXProviderContext:function(){return ot},Observer:function(){return T},PropTypes:function(){return mt},Provider:function(){return at},disposeOnUnmount:function(){return pt},enableStaticRendering:function(){return m},inject:function(){return ct},isUsingStaticRendering:function(){return b},observer:function(){return rt},observerBatching:function(){return u},useAsObservableSource:function(){return A},useLocalObservable:function(){return k},useLocalStore:function(){return O},useObserver:function(){return x},useStaticRendering:function(){return N}});var r=n(2965),i=n(9297),o=n.n(i);if(!i.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!r.makeObservable)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var a=n(2268);function s(t){t()}function u(t){t||(t=s),(0,r.configure)({reactionScheduler:t})}var c=[];function h(t){return(0,r.getDependencyTree)(t)}var l="undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry;function f(t){return{reaction:t,mounted:!1,changedBeforeMount:!1,cleanAt:Date.now()+p}}var p=1e4,d=l?function(t){var e=new Map,n=1,r=new t((function(t){var n=e.get(t);n&&(n.reaction.dispose(),e.delete(t))}));return{addReactionToTrack:function(t,i,o){var a=n++;return r.register(o,a,t),t.current=f(i),t.current.finalizationRegistryCleanupToken=a,e.set(a,t.current),t.current},recordReactionAsCommitted:function(t){r.unregister(t),t.current&&t.current.finalizationRegistryCleanupToken&&e.delete(t.current.finalizationRegistryCleanupToken)},forceCleanupTimerToRunNowForTests:function(){},resetCleanupScheduleForTests:function(){}}}(l):function(){var t,e=new Set;function n(){void 0===t&&(t=setTimeout(r,1e4))}function r(){t=void 0;var r=Date.now();e.forEach((function(t){var n=t.current;n&&r>=n.cleanAt&&(n.reaction.dispose(),t.current=null,e.delete(t))})),e.size>0&&n()}return{addReactionToTrack:function(t,r,i){var o;return t.current=f(r),o=t,e.add(o),n(),t.current},recordReactionAsCommitted:function(t){e.delete(t)},forceCleanupTimerToRunNowForTests:function(){t&&(clearTimeout(t),r())},resetCleanupScheduleForTests:function(){var n,r;if(e.size>0){try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),o=i.next();!o.done;o=i.next()){var a=o.value,s=a.current;s&&(s.reaction.dispose(),a.current=null)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.clear()}t&&(clearTimeout(t),t=void 0)}}}(),v=d.addReactionToTrack,y=d.recordReactionAsCommitted,g=(d.resetCleanupScheduleForTests,d.forceCleanupTimerToRunNowForTests,!1);function m(t){g=t}function b(){return g}function w(t){return"observer"+t}var _=function(){};function E(t,e){if(void 0===e&&(e="observed"),b())return t();var n,a=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(o().useState(new _),1)[0],s=(n=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,i.useState)(0),2)[1],(0,i.useCallback)((function(){n((function(t){return t+1}))}),c)),u=o().useRef(null);if(!u.current)var l=new r.Reaction(w(e),(function(){f.mounted?s():f.changedBeforeMount=!0})),f=v(u,l,a);var p,d,g=u.current.reaction;if(o().useDebugValue(g,h),o().useEffect((function(){return y(u),u.current?(u.current.mounted=!0,u.current.changedBeforeMount&&(u.current.changedBeforeMount=!1,s())):(u.current={reaction:new r.Reaction(w(e),(function(){s()})),mounted:!0,changedBeforeMount:!1,cleanAt:1/0},s()),function(){u.current.reaction.dispose(),u.current=null}}),[]),g.track((function(){try{p=t()}catch(t){d=t}})),d)throw d;return p}var I=function(){return(I=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var S={$$typeof:!0,render:!0,compare:!0,type:!0};function T(t){var e=t.children,n=t.render,r=e||n;return"function"!=typeof r?null:E(r)}function k(t,e){return(0,i.useState)((function(){return(0,r.observable)(t(),e,{autoBind:!0})}))[0]}T.displayName="Observer";function A(t){var e=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,i.useState)((function(){return(0,r.observable)(t,{},{deep:!1})})),1)[0];return(0,r.runInAction)((function(){Object.assign(e,t)})),e}function O(t,e){var n=e&&A(e);return(0,i.useState)((function(){return(0,r.observable)(t(n),void 0,{autoBind:!0})}))[0]}function x(t,e){return void 0===e&&(e="observed"),E(t,e)}function N(t){m(t)}u(a.unstable_batchedUpdates);var C=0,D={};function P(t){return D[t]||(D[t]=function(t){if("function"==typeof Symbol)return Symbol(t);var e="__$mobx-react "+t+" ("+C+")";return C++,e}(t)),D[t]}function R(t,e){if(L(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.hasOwnProperty.call(e,n[i])||!L(t[n[i]],e[n[i]]))return!1;return!0}function L(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}var j={$$typeof:1,render:1,compare:1,type:1,childContextTypes:1,contextType:1,contextTypes:1,defaultProps:1,getDefaultProps:1,getDerivedStateFromError:1,getDerivedStateFromProps:1,mixins:1,displayName:1,propTypes:1};function M(t,e,n){Object.hasOwnProperty.call(t,e)?t[e]=n:Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0,value:n})}var F=P("patchMixins"),U=P("patchedDefinition");function V(t,e){for(var n=this,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];e.locks++;try{var a;return null!=t&&(a=t.apply(this,i)),a}finally{e.locks--,0===e.locks&&e.methods.forEach((function(t){t.apply(n,i)}))}}function q(t,e){return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];V.call.apply(V,[this,t,e].concat(r))}}function B(t,e,n){var r=function(t,e){var n=t[F]=t[F]||{},r=n[e]=n[e]||{};return r.locks=r.locks||0,r.methods=r.methods||[],r}(t,e);r.methods.indexOf(n)<0&&r.methods.push(n);var i=Object.getOwnPropertyDescriptor(t,e);if(!i||!i[U]){var o=t[e],a=G(t,e,i?i.enumerable:void 0,r,o);Object.defineProperty(t,e,a)}}function G(t,e,n,r,i){var o,a=q(i,r);return(o={})[U]=!0,o.get=function(){return a},o.set=function(i){if(this===t)a=q(i,r);else{var o=G(this,e,n,r,i);Object.defineProperty(this,e,o)}},o.configurable=!0,o.enumerable=n,o}var K=r.$mobx||"$mobx",H=P("isMobXReactObserver"),W=P("isUnmounted"),z=P("skipRender"),J=P("isForcingUpdate");function Q(t){var e=t.prototype;if(t[H]){var n=X(e);console.warn("The provided component class ("+n+") \n has already been declared as an observer component.")}else t[H]=!0;if(e.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(t.__proto__!==i.PureComponent)if(e.shouldComponentUpdate){if(e.shouldComponentUpdate!==Z)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else e.shouldComponentUpdate=Z;$(e,"props"),$(e,"state");var r=e.render;return e.render=function(){return Y.call(this,r)},B(e,"componentWillUnmount",(function(){var t;if(!0!==b()&&(null==(t=this.render[K])||t.dispose(),this[W]=!0,!this.render[K])){var e=X(this);console.warn("The reactive render of an observer class component ("+e+") \n was overriden after MobX attached. This may result in a memory leak if the \n overriden reactive render was not properly disposed.")}})),t}function X(t){return t.displayName||t.name||t.constructor&&(t.constructor.displayName||t.constructor.name)||"<component>"}function Y(t){var e=this;if(!0===b())return t.call(this);M(this,z,!1),M(this,J,!1);var n=X(this),o=t.bind(this),a=!1,s=new r.Reaction(n+".render()",(function(){if(!a&&(a=!0,!0!==e[W])){var t=!0;try{M(e,J,!0),e[z]||i.Component.prototype.forceUpdate.call(e),t=!1}finally{M(e,J,!1),t&&s.dispose()}}}));function u(){a=!1;var t=void 0,e=void 0;if(s.track((function(){try{e=(0,r._allowStateChanges)(!1,o)}catch(e){t=e}})),t)throw t;return e}return s.reactComponent=this,u[K]=s,this.render=u,u.call(this)}function Z(t,e){return b()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==e||!R(this.props,t)}function $(t,e){var n=P("reactProp_"+e+"_valueHolder"),i=P("reactProp_"+e+"_atomHolder");function o(){return this[i]||M(this,i,(0,r.createAtom)("reactive "+e)),this[i]}Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var t=!1;return r._allowStateReadsStart&&r._allowStateReadsEnd&&(t=(0,r._allowStateReadsStart)(!0)),o.call(this).reportObserved(),r._allowStateReadsStart&&r._allowStateReadsEnd&&(0,r._allowStateReadsEnd)(t),this[n]},set:function(t){this[J]||R(this[n],t)?M(this,n,t):(M(this,n,t),M(this,z,!0),o.call(this).reportChanged(),M(this,z,!1))}})}var tt="function"==typeof Symbol&&Symbol.for,et=tt?Symbol.for("react.forward_ref"):"function"==typeof i.forwardRef&&(0,i.forwardRef)((function(t){return null})).$$typeof,nt=tt?Symbol.for("react.memo"):"function"==typeof i.memo&&(0,i.memo)((function(t){return null})).$$typeof;function rt(t){if(!0===t.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),nt&&t.$$typeof===nt)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(et&&t.$$typeof===et){var e=t.render;if("function"!=typeof e)throw new Error("render property of ForwardRef was not a function");return(0,i.forwardRef)((function(){var t=arguments;return(0,i.createElement)(T,null,(function(){return e.apply(void 0,t)}))}))}return"function"!=typeof t||t.prototype&&t.prototype.render||t.isReactClass||Object.prototype.isPrototypeOf.call(i.Component,t)?Q(t):function(t,e){if(b())return t;var n,r,o,a=I({forwardRef:!1},e),s=t.displayName||t.name,u=function(e,n){return E((function(){return t(e,n)}),s)};return u.displayName=s,n=a.forwardRef?(0,i.memo)((0,i.forwardRef)(u)):(0,i.memo)(u),r=t,o=n,Object.keys(r).forEach((function(t){S[t]||Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(r,t))})),n.displayName=s,n}(t)}function it(){return(it=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var ot=o().createContext({});function at(t){var e=t.children,n=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,["children"]),r=o().useContext(ot),i=o().useRef(it({},r,n)).current;return o().createElement(ot.Provider,{value:i},e)}function st(t,e,n,r){var i,a,s,u=o().forwardRef((function(n,r){var i=it({},n),a=o().useContext(ot);return Object.assign(i,t(a||{},i)||{}),r&&(i.ref=r),o().createElement(e,i)}));return r&&(u=rt(u)),u.isMobxInjector=!0,i=e,a=u,s=Object.getOwnPropertyNames(Object.getPrototypeOf(i)),Object.getOwnPropertyNames(i).forEach((function(t){j[t]||-1!==s.indexOf(t)||Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(i,t))})),u.wrappedComponent=e,u.displayName=function(t,e){var n=t.displayName||t.name||t.constructor&&t.constructor.name||"Component";return e?"inject-with-"+e+"("+n+")":"inject("+n+")"}(e,n),u}function ut(t){return function(e,n){return t.forEach((function(t){if(!(t in n)){if(!(t in e))throw new Error("MobX injector: Store '"+t+"' is not available! Make sure it is provided by some Provider");n[t]=e[t]}})),n}}function ct(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if("function"==typeof arguments[0]){var r=arguments[0];return function(t){return st(r,t,r.name,!0)}}return function(t){return st(ut(e),t,e.join("-"),!1)}}at.displayName="MobXProvider";var ht=P("disposeOnUnmountProto"),lt=P("disposeOnUnmountInst");function ft(){var t=this;[].concat(this[ht]||[],this[lt]||[]).forEach((function(e){var n="string"==typeof e?t[e]:e;null!=n&&(Array.isArray(n)?n.map((function(t){return t()})):n())}))}function pt(t,e){if(Array.isArray(e))return e.map((function(e){return pt(t,e)}));var n=Object.getPrototypeOf(t).constructor,r=Object.getPrototypeOf(t.constructor),i=Object.getPrototypeOf(Object.getPrototypeOf(t));if(n!==o().Component&&n!==o().PureComponent&&r!==o().Component&&r!==o().PureComponent&&i!==o().Component&&i!==o().PureComponent)throw new Error("[mobx-react] disposeOnUnmount only supports direct subclasses of React.Component or React.PureComponent.");if("string"!=typeof e&&"function"!=typeof e&&!Array.isArray(e))throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var a="string"==typeof e,s=!!t[ht]||!!t[lt];return(a?t[ht]||(t[ht]=[]):t[lt]||(t[lt]=[])).push(e),s||B(t,"componentWillUnmount",ft),"string"!=typeof e?e:void 0}function dt(t){function e(e,n,i,o,a,s){for(var u=arguments.length,c=new Array(u>6?u-6:0),h=6;h<u;h++)c[h-6]=arguments[h];return(0,r.untracked)((function(){if(o=o||"<<anonymous>>",s=s||i,null==n[i]){if(e){var r=null===n[i]?"null":"undefined";return new Error("The "+a+" `"+s+"` is marked as required in `"+o+"`, but its value is `"+r+"`.")}return null}return t.apply(void 0,[n,i,o,a,s].concat(c))}))}var n=e.bind(null,!1);return n.isRequired=e.bind(null,!0),n}function vt(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,e){return"symbol"===t||"Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol}(e,t)?"symbol":e}function yt(t,e){return dt((function(n,i,o,a,s){return(0,r.untracked)((function(){if(t&&vt(n[i])===e.toLowerCase())return null;var a;switch(e){case"Array":a=r.isObservableArray;break;case"Object":a=r.isObservableObject;break;case"Map":a=r.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+e)}var u=n[i];if(!a(u)){var c=function(t){var e=vt(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}(u),h=t?" or javascript `"+e.toLowerCase()+"`":"";return new Error("Invalid prop `"+s+"` of type `"+c+"` supplied to `"+o+"`, expected `mobx.Observable"+e+"`"+h+".")}return null}))}))}function gt(t,e){return dt((function(n,i,o,a,s){for(var u=arguments.length,c=new Array(u>5?u-5:0),h=5;h<u;h++)c[h-5]=arguments[h];return(0,r.untracked)((function(){if("function"!=typeof e)return new Error("Property `"+s+"` of component `"+o+"` has invalid PropType notation.");var r=yt(t,"Array")(n,i,o,a,s);if(r instanceof Error)return r;for(var u=n[i],h=0;h<u.length;h++)if((r=e.apply(void 0,[u,h,o,a,s+"["+h+"]"].concat(c)))instanceof Error)return r;return null}))}))}var mt={observableArray:yt(!1,"Array"),observableArrayOf:gt.bind(null,!1),observableMap:yt(!1,"Map"),observableObject:yt(!1,"Object"),arrayOrObservableArray:yt(!0,"Array"),arrayOrObservableArrayOf:gt.bind(null,!0),objectOrObservableObject:yt(!0,"Object")};if(!i.Component)throw new Error("mobx-react requires React to be available");if(!r.observable)throw new Error("mobx-react requires mobx to be available")},1903:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ContextProvider=void 0;var i=r(n(9297)),o=n(5925);e.ContextProvider=function(t){return i.default.createElement(o.ChannelsContextProvider,null,i.default.createElement(o.SectionsContextProvider,null,i.default.createElement(o.VideosContextProvider,null,i.default.createElement(o.UserContextProvider,null,i.default.createElement(o.OrganizationSubscriptionsContextProvider,null,i.default.createElement(o.PurchasesWithVideosContextProvider,null,i.default.createElement(o.ScreensContextProvider,null,i.default.createElement(o.RowItemsContextProvider,null,t.children))))))))}},2585:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.withPlayerContext=e.PlayerProvider=e.PlayerContext=void 0;var s=a(n(9297)),u=n(9517);e.PlayerContext=s.default.createContext(void 0),e.PlayerProvider=function(t){var n=t.children,r=t.playerWrapperId,i=c(void 0===r?"default":r),o=h(),a=s.default.createElement(e.PlayerContext.Provider,{value:i},n);return o&&(a=s.default.createElement(o.Provider,{value:{player:i}},a)),a};var c=function(t){var e=(0,s.useState)(null),n=e[0],r=e[1];return(0,s.useEffect)((function(){u.bundlePromise.then((function(e){var n,i=null===(n=e.getters)||void 0===n?void 0:n.getPlayerWrapper({playerWrapperId:t});r(i)})).catch((function(){}))}),[t]),n},h=function(){var t=(0,s.useState)(null),e=t[0],n=t[1];return(0,s.useEffect)((function(){u.bundlePromise.then((function(t){var e,r=null===(e=t.components)||void 0===e?void 0:e.PlayerDataContext;n(r)})).catch((function(){}))}),[]),e};e.withPlayerContext=function(t){return function(n){return function(i){return s.default.createElement(e.PlayerProvider,{playerWrapperId:t},s.default.createElement(n,r({},i)))}}}},6602:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.useTivioReadyData=e.useTivioData=e.TivioProvider=void 0;var a=o(n(9297)),s=n(9958),u=n(8643),c=n(1903),h=n(5256),l=(0,u.createUseRemoteBundle)(),f=a.default.createContext(null);e.TivioProvider=function(t){var e=t.children,n=t.conf,r=(0,s.createInternalConf)(null!=n?n:null),i=l(r);(0,a.useEffect)((function(){(0,h.injectSentryToWindow)()}),[]);var o="ready"===(null==i?void 0:i.state)&&i.components?a.default.createElement(i.components.Provider,{language:r.language,disableUnmounting:r.disableUnmounting},e):e;return a.default.createElement(c.ContextProvider,null,a.default.createElement(f.Provider,{value:i},o))},e.useTivioData=function(){var t=(0,a.useContext)(f);if(null===t)throw new Error("Make sure to wrap your app in <TivioProvider conf={...}><App/></TivioProvider>");return t},e.useTivioReadyData=function(){var t=(0,e.useTivioData)();return"ready"===t.state?t:null}},2411:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.TivioWidget=void 0;var a=o(n(9297)),s=n(6602),u=n(8057);e.TivioWidget=a.default.forwardRef((function(t,e){var n=t.id,r=t.onBlur,i=t.onEnabled;if("string"!=typeof n||!n.length)return a.default.createElement(u.TivioWidgetError,{error:"TivioWidget must have a mandatory property 'id'."});var o=(0,s.useTivioData)(),c=o.state,h=o.error,l=o.components,f=o.conf,p=f.ErrorComponent,d=f.LoaderComponent;switch((0,a.useEffect)((function(){"error"===c&&(null==i||i(!1))}),[c]),c){case"error":return a.default.createElement(p,{error:h});case"loading":return a.default.createElement(d,null);case"ready":return l?a.default.createElement(l.Widget,{id:n,ref:e,onEnabled:i,onBlur:r}):null}}))},8057:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TivioWidgetError=void 0;var i=r(n(9297));e.TivioWidgetError=function(t){var e=t.error;return i.default.createElement("div",{style:{backgroundColor:"#d84f92",color:"#fff",padding:"1rem"}},e)}},6868:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TivioWidgetLoader=void 0;var i=r(n(9297));e.TivioWidgetLoader=function(){return i.default.createElement("div",null,"loading...")}},9448:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.ChannelsContextProvider=e.ChannelsContext=void 0;var s=a(n(9297)),u=(0,s.createContext)({data:{},setData:function(){return null}});e.ChannelsContext=u,e.ChannelsContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useRef)(n);return s.default.createElement(u.Provider,{value:{data:n,setData:function(t,e){var n,a=r(r({},o.current),((n={})[t]=e,n));o.current=a,i(a)}}},t.children)}},7571:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.OrganizationSubscriptionsContext=e.OrganizationSubscriptionsContextProvider=void 0;var a=o(n(9297)),s=(0,a.createContext)({subscriptions:[],setSubscriptions:function(){return null}});e.OrganizationSubscriptionsContext=s,e.OrganizationSubscriptionsContextProvider=function(t){var e=(0,a.useState)([]),n=e[0],r=e[1];return a.default.createElement(s.Provider,{value:{subscriptions:n,setSubscriptions:r}},t.children)}},2860:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.PurchasesWithVideosContextProvider=e.PurchasesWithVideosContext=void 0;var a=o(n(9297)),s=(0,a.createContext)({purchases:[],setPurchases:function(){return null}});e.PurchasesWithVideosContext=s,e.PurchasesWithVideosContextProvider=function(t){var e=(0,a.useState)([]),n=e[0],r=e[1];return a.default.createElement(s.Provider,{value:{purchases:n,setPurchases:r}},t.children)}},988:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.RowItemsContextProvider=e.RowItemsContext=void 0;var s=a(n(9297)),u=(0,s.createContext)(null);e.RowItemsContext=u,e.RowItemsContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useCallback)((function(t,e){i((function(n){var i;return r(r({},n),((i={})[t]=e,i))}))}),[n]);return s.default.createElement(u.Provider,{value:{data:n,setData:o}},t.children)}},853:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.ScreensContextProvider=e.ScreensContext=void 0;var s=a(n(9297)),u=(0,s.createContext)(null);e.ScreensContext=u,e.ScreensContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useCallback)((function(t,e){var o,a=r(r({},n),((o={})[t]=e,o));i(a)}),[n]);return s.default.createElement(u.Provider,{value:{data:n,setData:o}},t.children)}},2141:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.SectionsContextProvider=e.SectionsContext=void 0;var s=a(n(9297)),u=(0,s.createContext)({data:{},setData:function(){return null}});e.SectionsContext=u,e.SectionsContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useRef)(n);return s.default.createElement(u.Provider,{value:{data:n,setData:function(t,e){var n,a=r(r({},o.current),((n={})[t]=e,n));o.current=a,i(a)}}},t.children)}},7661:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.UserContext=e.UserContextProvider=void 0;var a=o(n(9297)),s=(0,a.createContext)({user:null,setUser:function(){return null}});e.UserContext=s,e.UserContextProvider=function(t){var e=(0,a.useState)(null),n=e[0],r=e[1];return a.default.createElement(s.Provider,{value:{user:n,setUser:r}},t.children)}},661:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.VideosContextProvider=e.VideosContext=void 0;var s=a(n(9297)),u=(0,s.createContext)({data:{},setData:function(){return null}});e.VideosContext=u,e.VideosContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useRef)(n);return s.default.createElement(u.Provider,{value:{data:n,setData:function(t,e){var n,a=r(r({},o.current),((n={})[t]=e,n));o.current=a,i(a)}}},t.children)}},5925:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(9448),e),i(n(7571),e),i(n(2860),e),i(n(853),e),i(n(2141),e),i(n(7661),e),i(n(661),e),i(n(988),e)},6766:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ChannelsContext=e.SectionsContext=e.VideosContext=e.useChannelsInWidget=e.useSectionsInChannel=e.useVideosInSection=e.useVideo=e.useSection=e.useIsLoaded=e.useChannel=e.useWidget=void 0;var r=n(9297),i=n(1920),o=n(2782),a=n(5925);Object.defineProperty(e,"ChannelsContext",{enumerable:!0,get:function(){return a.ChannelsContext}}),Object.defineProperty(e,"SectionsContext",{enumerable:!0,get:function(){return a.SectionsContext}}),Object.defineProperty(e,"VideosContext",{enumerable:!0,get:function(){return a.VideosContext}});var s=(0,o.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});e.useWidget=function(t){var e=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(""),o=n[0],a=n[1],s=(0,r.useState)(null),u=s[0],c=s[1],h=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){return e&&e.subscribeToWidget(t,(function(t,e,n){var r,i,o;t&&a(t.message),e&&(null===(r=e.lastVideo)||void 0===r||r.transaction,null===(i=e.lastVideo)||void 0===i||i.subscriptions,null===(o=e.lastVideo)||void 0===o||o.monetizations,c(e)),n&&(h.current=n)})),function(){var t;null===(t=h.current)||void 0===t||t.call(h)}}),[e]),{error:o,widget:u}},e.useChannel=function(t){var e=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(null),o=n[0],a=n[1],u=(0,r.useState)(null),c=u[0],h=u[1];return(0,r.useEffect)((function(){e&&(s.info("subscribe to channel with id "+t),e.subscribeToChannel(t,(function(t,e){t&&(s.error("failed to subscribe to channel: ",t),a(t.message)),e&&(s.error("channel data received"),h(e))})))}),[e]),{error:o,data:c}},e.useSection=function(t){var e=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(null),o=n[0],a=n[1],u=(0,r.useState)(null),c=u[0],h=u[1];return(0,r.useEffect)((function(){e&&(s.info("subscribe to section with id "+t),e.subscribeToSection(t,(function(t,e){t&&(s.error("failed to subscribe to section: ",t),a(t.message)),e&&(s.info("section data received"),h(e))})))}),[e]),{error:o,data:c}},e.useVideo=function(t){var e=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(null),o=n[0],a=n[1],s=(0,r.useState)(null),u=s[0],c=s[1],h=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){if(t)return e?(e.subscribeToVideo(t,(function(t,e,n){t&&a(t.message),e&&(e.transaction,e.subscriptions,e.monetizations,c({id:e.id,cover:e.cover,assets:e.assets,created:e.created,sectionId:e.sectionId,channelId:e.channelId,duration:e.duration,path:e.path,image:e.image,itemType:e.itemType,isPlayable:e.isPlayable,monetization:e.monetization,transaction:e.transaction,transactionId:e.transactionId,subscriptions:e.subscriptions,subscriptionIds:e.subscriptionIds,monetizations:e.monetizations,isPlaylist:e.isPlaylist,name:e.name,description:e.description,price:e.price,uri:e.uri,url:e.url})),h.current=n})),function(){var t;null===(t=h.current)||void 0===t||t.call(h)}):void 0;a("not-found")}),[e,t]),{error:o,data:u}},e.useVideosInSection=function(t,e){void 0===e&&(e=10);var n=(0,i.useTivioData)().subscriptions,o=(0,r.useContext)(a.VideosContext),u=o.data[null!=t?t:""];return(0,r.useEffect)((function(){n&&t&&(u||(s.info("subscribe to videos in section "+t),n.subscribeToVideosInSection(t,(function(e,n,r,i){e&&(s.error("failed to subscribe to videos in section: ",e),o.setData(t,{error:e,data:null,isLoading:i})),n&&(s.info("videos data received"),n.videos.forEach((function(t){return t.monetization})),n.videos.forEach((function(t){return t.subscriptions})),o.setData(t,{data:{items:n.videos,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},error:e,isLoading:i}))}),e)))}),[n,t,n,o]),{error:u?u.error:null,data:u?u.data:null,isLoading:!!u&&u.isLoading}},e.useSectionsInChannel=function(t,e){void 0===e&&(e=10);var n=(0,i.useTivioData)().subscriptions,o=(0,r.useContext)(a.SectionsContext),u=o.data[t];return(0,r.useEffect)((function(){n&&(u||(s.info("subscribe to sections in channel with id "+t),n.subscribeToSectionsInChannel(t,(function(e,n,r,i){e&&(s.error("failed to subscribe to sections in channel: ",e),o.setData(t,{error:e,data:null,isLoading:i})),n&&(s.info("sections data received"),o.setData(t,{error:e,data:{items:n.sections,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:i}))}),e)))}),[n]),{error:u?u.error:null,data:u?u.data:null,isLoading:!!u&&u.isLoading}},e.useChannelsInWidget=function(t,e){void 0===e&&(e=10);var n=(0,i.useTivioData)().subscriptions,o=(0,r.useContext)(a.ChannelsContext),u=o.data[t];return(0,r.useEffect)((function(){n&&(u||(s.info("subscribe to channels in widget with id: "+t),n.subscribeToChannelsInWidget(t,(function(e,n,r,i){e&&(s.error("failed to subscribe to channels in widget: ",e),o.setData(t,{error:e,data:null,isLoading:i})),n&&(s.info("channels data received"),o.setData(t,{error:e,data:{items:n.channels,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:i}))}),e)))}),[n]),{error:u?u.error:null,data:u?u.data:null,isLoading:!!u&&u.isLoading}},e.useIsLoaded=function(){var t=(0,r.useState)(!1),e=t[0],n=t[1],o=(0,i.useTivioData)();return(0,r.useEffect)((function(){o.getters&&o.getters.isTivioLoaded(n)}),[o]),{isTivioLoaded:e}}},8682:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(2883),e),i(n(2596),e),i(n(5469),e),i(n(2639),e),i(n(7802),e),i(n(1350),e),i(n(6766),e),i(n(6862),e),i(n(6311),e),i(n(1197),e),i(n(3419),e),i(n(9814),e)},6862:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.useExportedConfig=e.useAdSegment=e.useStartMarker=e.useSeekState=e.useCurrentMarker=e.useAd=e.useIntro=e.useBetOffer=e.useMarkers=e.usePlayerEvent=void 0;var r=n(9297),i=n(2585),o=n(6602);e.usePlayerEvent=function(t){var e=(0,r.useContext)(i.PlayerContext);if(void 0===e)throw new Error("usePlayerEvent must be inside PlayerContext");var n=(0,r.useState)(null),o=n[0],a=n[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener(t,a),function(){return e.events.removeListener(t,a)}}),[null==e?void 0:e.events]),o},e.useMarkers=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useMarkers must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("markers",o),function(){return t.events.removeListener("markers",o)}}),[null==t?void 0:t.events]),n},e.useBetOffer=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useBetOffer must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("bet-offer",o),function(){return t.events.removeListener("bet-offer",o)}}),[null==t?void 0:t.events]),n},e.useIntro=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useIntro must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("intro",o),function(){return t.events.removeListener("intro",o)}}),[null==t?void 0:t.events]),n},e.useAd=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useAd must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1],a=function(){var t=(0,r.useRef)(0),e=(0,r.useState)(null),n=(e[0],e[1]);return(0,r.useCallback)((function(){t.current++,n(t.current)}),[])}();return(0,r.useEffect)((function(){if(null==t?void 0:t.events){t.events.addListener("ad",o);var e="ad-rerender",n="ad-seconds-to-skippable-changed";return t.events.isSupported(e)&&t.events.addListener(e,a),t.events.isSupported(n)&&t.events.addListener(n,a),function(){t.events.removeListener("ad",o),t.events.isSupported(e)&&t.events.removeListener(e,a),t.events.isSupported(n)&&t.events.addListener(n,a)}}}),[null==t?void 0:t.events]),n},e.useCurrentMarker=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useCurrentMarker must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("current-marker",o),function(){return t.events.removeListener("current-marker",o)}}),[null==t?void 0:t.events]),n},e.useSeekState=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useSeekState must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events){var e=function(){return o(!1)},n=function(){return o(!0)};return t.events.addListener("disable-seek",e),t.events.addListener("enable-seek",n),function(){t.events.removeListener("disable-seek",e),t.events.removeListener("enable-seek",n)}}}),[null==t?void 0:t.events]),n},e.useStartMarker=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useStartMarker must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("start-marker",o),function(){return t.events.removeListener("start-marker",o)}}),[null==t?void 0:t.events]),n},e.useAdSegment=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useAdSegmentMarker must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("ad-segment-changed",o),function(){return t.events.removeListener("ad-segment-changed",o)}}),[null==t?void 0:t.events]),n},e.useExportedConfig=function(){var t,e=(0,o.useTivioData)(),n=(0,r.useState)(null),i=n[0],a=n[1],s=null===(t=null==e?void 0:e.getters)||void 0===t?void 0:t.getExportedConfig;return(0,r.useEffect)((function(){null==s||s().then(a)}),[s]),i}},6201:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.useError=void 0;var r=n(9297);e.useError=function(){var t=(0,r.useState)(null),e=t[0],n=t[1];return{error:e,raiseError:function(t){n(t)},resetError:function(){return n(null)}}}},3419:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFreePurchase=void 0;var o=n(6602);e.useFreePurchase=function(){var t=(0,o.useTivioData)().auth;return{purchase:function(e){return r(void 0,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return t?[4,t.createFreePurchase(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}}}},2639:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.useItemsInRow=void 0;var r=n(9297),i=n(6602),o=n(6201);e.useItemsInRow=function(t,e){void 0===e&&(e={noLimit:!1,limit:3});var n=(0,i.useTivioData)().subscriptions,a=(0,r.useState)(null),s=a[0],u=a[1],c=(0,o.useError)(),h=c.error,l=c.raiseError,f=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(f.current=n.subscribeToItemsInRow(t,(function(t,e){t&&l(t),e&&u({items:e.items,fetchMore:e.fetchMore})}),e)),function(){var t;null===(t=f.current)||void 0===t||t.call(f)}}),[n]),{pagination:s,error:h}}},6311:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.useOrganizationSubscriptions=void 0;var o=n(9297),a=n(7571),s=n(6602),u=n(6766);e.useOrganizationSubscriptions=function(){var t=(0,o.useContext)(a.OrganizationSubscriptionsContext),e=t.setSubscriptions,n=t.subscriptions,c=(0,s.useTivioData)().getters,h=(0,u.useIsLoaded)().isTivioLoaded;return(0,o.useEffect)((function(){r(void 0,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return c&&h&&0===n.length?[4,c.getOrganizationSubscriptions()]:[3,2];case 1:(t=r.sent())&&e(t),r.label=2;case 2:return[2]}}))}))}),[h]),{subscriptions:n}}},1350:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.usePurchaseSubscription=void 0;var o=n(9297),a=n(6602),s=n(2883);e.usePurchaseSubscription=function(t){var e=(0,o.useState)(null),n=e[0],u=e[1],c=(0,o.useState)(""),h=c[0],l=c[1],f=(0,a.useTivioData)().purchaseSubscriptionWithQerko,p=(0,s.useUser)().user,d=(0,o.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var e,n;return i(this,(function(r){switch(r.label){case 0:if(l(""),!f)throw new Error("purchaseVideoWithQerko not in bundle");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,f(t)];case 2:return e=r.sent(),u(e),[3,4];case 3:return(n=r.sent())instanceof Error&&l(n.message),[3,4];case 4:return[2]}}))}))}),[f]),v=(0,o.useMemo)((function(){if(!p)return"NEW";var e=p.purchases.find((function(e){return e.monetizationId===t}));return e?e.status:"NEW"}),[p]);return(0,o.useEffect)((function(){d()}),[d]),{paymentError:h,paymentInfo:n,paymentStatus:v,getPaymentInfo:d}}},1197:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.usePurchasesWithVideos=void 0;var o=n(9297),a=n(2860),s=n(6602),u=n(2883);e.usePurchasesWithVideos=function(){var t=(0,u.useUser)().user,e=(0,s.useTivioData)().auth,n=(0,o.useContext)(a.PurchasesWithVideosContext),c=n.purchases,h=n.setPurchases;return(0,o.useEffect)((function(){r(void 0,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return e?t&&t.purchasedVods.length!==c.length?(n=h,[4,e.getPurchasedVodsWithInitializedVideos()]):[3,2]:[2];case 1:n.apply(void 0,[r.sent()]),r.label=2;case 2:return[2]}}))}))}),[t,e]),{purchases:c}}},9814:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.useRowsInScreen=void 0;var i=n(9297),o=n(6602),a=n(6201);e.useRowsInScreen=function(t,e){void 0===e&&(e={noLimit:!1,limit:3});var n=(0,o.useTivioData)().subscriptions,s=(0,i.useState)(null),u=s[0],c=s[1],h=(0,a.useError)(),l=h.error,f=h.raiseError,p=(0,i.useRef)();return(0,i.useEffect)((function(){return n&&(p.current=n.subscribeToRowsInScreen(t,(function(t,e){t&&f(t),e&&c(r({},e))}),e)),function(){var t;null===(t=p.current)||void 0===t||t.call(p)}}),[n]),{pagination:u,error:l}}},5469:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.useScreen=void 0;var r=n(2965),i=n(9297),o=n(5925),a=n(6602);e.useScreen=function(t,e){var n,s,u,c=(0,a.useTivioData)().subscriptions,h=(0,i.useContext)(o.ScreensContext),l=null==h?void 0:h.data[t],f=(0,i.useRef)(null);return(0,i.useEffect)((function(){return c&&h&&null==f.current&&(f.current=null==c?void 0:c.subscribeToScreen(t,(function(e,n){var i;e&&h.setData(t,{error:e,data:null,isLoading:!1}),n&&h.setData(t,{error:e,data:{id:n.screenId,name:n.name,description:n.description,assets:(0,r.toJS)(n.assets),rows:(null!==(i=n.rows)&&void 0!==i?i:[]).map((function(t){return{id:t.rowId,name:t.name,rowId:t.rowId,description:t.description,assets:(0,r.toJS)(t.assets),itemComponent:t.itemComponent,rowComponent:t.rowComponent}}))},isLoading:!1})}),e)),function(){var t;null===(t=f.current)||void 0===t||t.call(f)}}),[c]),{error:null!==(n=null==l?void 0:l.error)&&void 0!==n?n:null,data:null!==(s=null==l?void 0:l.data)&&void 0!==s?s:null,isLoading:null===(u=null==l?void 0:l.isLoading)||void 0===u||u}}},2596:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.useScreens=void 0;var o=n(9297),a=n(6602);e.useScreens=function(){var t=(0,a.useTivioData)().getters,e=(0,o.useState)([]),n=e[0],s=e[1];return(0,o.useEffect)((function(){t&&r(void 0,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,t.getOrganizationScreens()];case 1:return e=n.sent(),s(e),[2]}}))}))}),[t]),{screens:n}}},7802:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.useTransactionPayment=void 0;var o=n(7823),a=n(9297),s=n(1920),u=n(6602);e.useTransactionPayment=function(t,e){var n=(0,a.useState)(null),c=n[0],h=n[1],l=(0,a.useState)(""),f=l[0],p=l[1],d=(0,u.useTivioData)().purchaseVideoWithQerko,v=(0,s.useUser)().user,y=(0,a.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:if(p(""),!d)throw new Error("purchaseVideoWithQerko not in bundle");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,d(t,e)];case 2:return n=i.sent(),h(n),[3,4];case 3:return r=i.sent(),p(r.message),[3,4];case 4:return[2]}}))}))}),[d]);(0,a.useEffect)((function(){y()}),[]);var g=(0,o.useObserver)((function(){if(c&&v){var n=v.purchases.find((function(n){return n.monetizationId===e&&n.videoId===t}));if(n)return n.status}return"new"}));return{paymentInfo:c,paymentError:f,paymentStatus:g,getPaymentInfo:y}}},2883:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.useUser=void 0;var i=n(9297),o=n(2782),a=n(7661),s=n(6602),u=(0,o.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});e.useUser=function(){var t=(0,i.useContext)(a.UserContext),e=t.user,n=t.setUser,o=(0,s.useTivioData)().subscriptions,c=(0,i.useState)(null),h=c[0],l=c[1];return(0,i.useEffect)((function(){o&&!e&&o.subscribeToUser((function(t,e){t&&(u.error(t),l(t)),e&&n(r({},e))}))}),[o]),{user:e,error:h}}},9958:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.createInternalConf=e.defaultConf=void 0;var i=n(8057),o=n(6868),a=n(2782),s=n(9373),u=n(1675);e.defaultConf={secret:null,resolverUrl:"https://tivio-resolver-production.tiv.io/serveBundle/resolver2.js",disableUnmounting:!1,fetchPackage:s.fetchPackage,pubSub:(0,u.getPubSub)(),LoaderComponent:o.TivioWidgetLoader,ErrorComponent:i.TivioWidgetError},e.createInternalConf=function(t){return r(r(r({},e.defaultConf),null!=t?t:{}),{logger:void 0!==(null==t?void 0:t.logger)?t.logger:(0,a.createLogger)({isConsoleEnabled:!0}),sdkVersion:"2.1.4"})}},9393:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},1920:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.bundlePromise=e.withPlayerContext=e.PlayerProvider=void 0;var o=n(2585);Object.defineProperty(e,"PlayerProvider",{enumerable:!0,get:function(){return o.PlayerProvider}}),Object.defineProperty(e,"withPlayerContext",{enumerable:!0,get:function(){return o.withPlayerContext}});var a=n(9517);Object.defineProperty(e,"bundlePromise",{enumerable:!0,get:function(){return a.bundlePromise}}),i(n(8682),e),i(n(6602),e),i(n(2411),e),i(n(8057),e),i(n(6868),e),i(n(9393),e),i(n(8643),e),i(n(1675),e),i(n(3173),e),(0,n(5256).initSentry)()},8643:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.createUseRemoteBundle=e.createRemotePackageLoader=e.fetchBundle=void 0;var a=n(9297),s=n(2229),u=n(6614),c=function(t){var e=t.resolverUrl;return(0,t.fetchPackage)(e)},h=function(t,e){return i(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return e.bundleUrlOverride?(console.info("@tivio: Fetching bundle directly based on config.bundleUrlOverride",e.bundleUrlOverride),[4,fetch(e.bundleUrlOverride)]):[3,3];case 1:return[4,n.sent().text()];case 2:return[2,n.sent()];case 3:return[2,c(e).then((function(n){var r,i={},o={exports:i};try{new Function("require","module","exports",n)(s.resolveShared,o,i)}catch(t){return Promise.reject("Cannot load Tivio Resolver "+t)}return"function"!=typeof(null===(r=o.exports.tivio)||void 0===r?void 0:r.fetch)?Promise.reject("Invalid Tivio Resolver export"):o.exports.tivio.fetch(t,e.sdkVersion)}))]}}))}))};e.fetchBundle=h;var l=function(){return function(t,e){return i(void 0,void 0,void 0,(function(){return o(this,(function(n){return[2,h(t,e).then((function(t){var e={},n={exports:e};try{new Function("require","module","exports",t)(s.resolveShared,n,e)}catch(t){return Promise.reject("Cannot load module "+t)}return"object"!=typeof n.exports.Tivio?Promise.reject('Tivio package does not export "Tivio" namespace'):"object"!=typeof n.exports.Tivio.components?Promise.reject('Tivio namespace does not export "components" member'):"function"!=typeof n.exports.Tivio.setUser?Promise.reject('Tivio namespace does not export "setUser" member'):"function"!=typeof n.exports.Tivio.init?Promise.reject('Tivio namespace does not export "init" member'):n.exports.Tivio}))]}))}))}};e.createRemotePackageLoader=l,e.createUseRemoteBundle=function(){var t=l(),e=!1;return function(n){var s=(0,u.createSettings)(n),c=(0,a.useState)({auth:null,components:null,conf:n,error:null,getters:null,init:null,purchaseSubscriptionWithQerko:null,purchaseVideoWithQerko:null,setLanguage:null,settings:s,setUser:null,sources:null,hooks:null,state:"loading",subscriptions:null}),h=c[0],l=c[1];return(0,a.useEffect)((function(){null!=n.secret&&!1!==n.enable&&t(n.secret,n).then((function(t){return i(void 0,void 0,void 0,(function(){var r;return o(this,(function(i){switch(i.label){case 0:return e?[3,2]:[4,t.init(n)];case 1:i.sent(),e=!0,i.label=2;case 2:return s.onSetUser(t.setUser),r={auth:t.auth,components:t.components,conf:n,error:null,getters:t.getters,init:t.init,purchaseSubscriptionWithQerko:t.purchaseSubscriptionWithQerko,purchaseVideoWithQerko:t.purchaseVideoWithQerko,setLanguage:t.setLanguage,settings:s,setUser:t.setUser,sources:t.sources,hooks:t.hooks,state:"ready",subscriptions:t.subscriptions},l(r),n.pubSub.publish("on-ready",r),[2]}}))}))})).catch((function(t){var e;null===(e=n.logger)||void 0===e||e.exception(t),l(r(r({},h),{conf:n,error:""+t,settings:s,state:"error"})),n.pubSub.publish("on-error",t)}))}),[]),h}}},9517:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.bundlePromise=void 0;var r=n(1675);e.bundlePromise=new Promise((function(t,e){(0,r.getPubSub)().subscribe("on-ready",(function(e){t(e)})),(0,r.getPubSub)().subscribe("on-error",(function(t){e(t)}))})).catch((function(t){throw console.error("@tivio/sdk-react failed to load. Reason:",t),t})).then((function(t){return console.info("@tivio/sdk-react loaded successfully."),t}))},2229:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveShared=void 0;var s=a(n(5532));n(284),n(2189);var u=o(n(2965)),c=o(n(9297)),h=o(n(2268)),l=o(n(9914)),f={mobx:u,firebase:s.default,react:c,React:c,"react-dom":h,"styled-components":l};e.resolveShared=function(t){if(!(t in f))throw new Error("Could not resolve shared dependency "+t);return f[t]}},2782:function(t,e,n){var r=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;var i=n(5256);e.createLogger=function(t){var e=!1!==t.isSentryEnabled,n=function(n,o){t.isConsoleEnabled&&console[n].apply(console,r(["Tivio SDK "],o,!1)),e&&i.Sentry.captureMessage(""+o,i.Sentry.Severity.fromString(n))};return{error:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n("error",t)},info:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n("info",t)},warn:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n("warn",t)},debug:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n("debug",t)},exception:function(n){t.isConsoleEnabled&&console.error(n),e&&i.Sentry.captureException(n)}}}},9373:function(t,e){var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchPackage=void 0;var i={cache:"no-store"},o=function(t){var e=t.headers.get("content-type");return 200!==t.status?Promise.reject('Incorrect status "'+t.status+'" was obtained while fetching the module.'):e&&(e.includes("application/javascript")||e.includes("text/javascript"))?t.text():Promise.reject('Incorrect content "'+e+'" was obtained while fetching the module.')},a=function(t){return Promise.reject("Network failure: "+t)};e.fetchPackage=function(t){return n(void 0,void 0,void 0,(function(){return r(this,(function(e){return[2,fetch(t,i).then(o).catch(a)]}))}))}},1675:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getPubSub=e.createPubSub=void 0,e.createPubSub=function(){var t=new Map;return{publish:function(e,n){var r;null===(r=t.get(e))||void 0===r||r.forEach((function(t){(0,t.onMessage)(n)}))},subscribe:function(e,n){var r=(new Date).getTime();return t.has(e)||t.set(e,[]),t.get(e).push({id:r,onMessage:n}),function(){var n,i=null!==(n=t.get(e))&&void 0!==n?n:[],o=i.findIndex((function(t){return t.id===r}));-1!==o&&i.splice(o,1)}}}};var n=null;e.getPubSub=function(){return null===n&&(n=(0,e.createPubSub)()),n}},5256:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.injectSentryToWindow=e.initSentry=e.Sentry=void 0;var a=o(n(5451));e.Sentry=a,e.initSentry=function(){e.Sentry.init({dsn:"https://8b9d489695004b0da95481f939b0455d@o507550.ingest.sentry.io/5600271",release:"@tivio/sdk-react@2.1.4",tracesSampleRate:1}),console.info("@tivio: Sentry enabled")},e.injectSentryToWindow=function(){window.sentry=e.Sentry,console.info("@tivio: Sentry added to window")}},6614:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.createSettings=void 0,e.createSettings=function(t){var e=null,n=null;return{onSetUser:function(r){var i;"function"!=typeof r?null===(i=t.logger)||void 0===i||i.exception("Tivio Bundle setUser handler must be a function"):(e=r,null!==n&&r(n.userId,n.userPayload))},setUser:function(t,r){"function"==typeof e?(n=null,e(t,r)):n={userId:t,userPayload:r}}}}},3173:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},5163:function(t,e,n){n.d(e,{ZT:function(){return i},pi:function(){return o},mG:function(){return a},Jh:function(){return s},XA:function(){return u},CR:function(){return c},ev:function(){return h}});var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function h(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create,Object.create},2965:function(t){t.exports=e},9297:function(e){e.exports=t},2268:function(t){t.exports=n},9914:function(t){t.exports=r}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={id:t,loaded:!1,exports:{}};return i[t].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}return a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.hmd=function(t){return(t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a(1920)}()}));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("mobx"),require("react-dom"),require("styled-components")):"function"==typeof define&&define.amd?define("@tivio/sdk-react",["react","mobx","react-dom","styled-components"],e):"object"==typeof exports?exports["@tivio/sdk-react"]=e(require("react"),require("mobx"),require("react-dom"),require("styled-components")):t["@tivio/sdk-react"]=e(t.react,t.mobx,t["react-dom"],t["styled-components"])}(this,(function(t,e,n,r){return function(){"use strict";var i={2444:function(t,e,n){n.d(e,{wA:function(){return o},H0:function(){return u}});var r=n(5163),i=n(6765),o=function(){function t(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return t.prototype.setInstantiationMode=function(t){return this.instantiationMode=t,this},t.prototype.setMultipleInstances=function(t){return this.multipleInstances=t,this},t.prototype.setServiceProps=function(t){return this.serviceProps=t,this},t.prototype.setInstanceCreatedCallback=function(t){return this.onInstanceCreated=t,this},t}(),a="[DEFAULT]",s=function(){function t(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}return t.prototype.get=function(t){var e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){var n=new i.BH;if(this.instancesDeferred.set(e,n),this.isInitialized(e)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:e});r&&n.resolve(r)}catch(t){}}return this.instancesDeferred.get(e).promise},t.prototype.getImmediate=function(t){var e,n=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),r=null!==(e=null==t?void 0:t.optional)&&void 0!==e&&e;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(t){if(r)return null;throw t}},t.prototype.getComponent=function(){return this.component},t.prototype.setComponent=function(t){var e,n;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(function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService({instanceIdentifier:a})}catch(t){}try{for(var i=(0,r.XA)(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var s=(0,r.CR)(o.value,2),u=s[0],c=s[1],h=this.normalizeInstanceIdentifier(u);try{var l=this.getOrInitializeService({instanceIdentifier:h});c.resolve(l)}catch(t){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}},t.prototype.clearInstance=function(t){void 0===t&&(t=a),this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return(0,r.mG)(this,void 0,void 0,(function(){var t;return(0,r.Jh)(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all((0,r.ev)((0,r.ev)([],(0,r.CR)(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})))),(0,r.CR)(t.filter((function(t){return"_delete"in t})).map((function(t){return t._delete()})))))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.isInitialized=function(t){return void 0===t&&(t=a),this.instances.has(t)},t.prototype.getOptions=function(t){return void 0===t&&(t=a),this.instancesOptions.get(t)||{}},t.prototype.initialize=function(t){var e,n;void 0===t&&(t={});var i=t.options,o=void 0===i?{}:i,a=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(a))throw Error(this.name+"("+a+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var s=this.getOrInitializeService({instanceIdentifier:a,options:o});try{for(var u=(0,r.XA)(this.instancesDeferred.entries()),c=u.next();!c.done;c=u.next()){var h=(0,r.CR)(c.value,2),l=h[0],f=h[1];a===this.normalizeInstanceIdentifier(l)&&f.resolve(s)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return s},t.prototype.onInit=function(t,e){var n,r=this.normalizeInstanceIdentifier(e),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(t),this.onInitCallbacks.set(r,i);var o=this.instances.get(r);return o&&t(o,r),function(){i.delete(t)}},t.prototype.invokeOnInitCallbacks=function(t,e){var n,i,o=this.onInitCallbacks.get(e);if(o)try{for(var a=(0,r.XA)(o),s=a.next();!s.done;s=a.next()){var u=s.value;try{u(t,e)}catch(t){}}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},t.prototype.getOrInitializeService=function(t){var e,n=t.instanceIdentifier,r=t.options,i=void 0===r?{}:r,o=this.instances.get(n);if(!o&&this.component&&(o=this.component.instanceFactory(this.container,{instanceIdentifier:(e=n,e===a?void 0:e),options:i}),this.instances.set(n,o),this.instancesOptions.set(n,i),this.invokeOnInitCallbacks(o,n),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,n,o)}catch(t){}return o||null},t.prototype.normalizeInstanceIdentifier=function(t){return void 0===t&&(t=a),this.component?this.component.multipleInstances?t:a:t},t.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},t}(),u=function(){function t(t){this.name=t,this.providers=new Map}return t.prototype.addComponent=function(t){var e=this.getProvider(t.name);if(e.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);e.setComponent(t)},t.prototype.addOrOverwriteComponent=function(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},t.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var e=new s(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}()},3936:function(t,e,n){function r(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}var i;n.d(e,{in:function(){return o},Yd:function(){return l},Ub:function(){return f},Am:function(){return p}});var o,a=[];!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(o||(o={}));var s={debug:o.DEBUG,verbose:o.VERBOSE,info:o.INFO,warn:o.WARN,error:o.ERROR,silent:o.SILENT},u=o.INFO,c=((i={})[o.DEBUG]="log",i[o.VERBOSE]="log",i[o.INFO]="info",i[o.WARN]="warn",i[o.ERROR]="error",i),h=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(e<t.logLevel)){var o=(new Date).toISOString(),a=c[e];if(!a)throw new Error("Attempted to log a message with an invalid logType (value: "+e+")");console[a].apply(console,r(["["+o+"] "+t.name+":"],n))}},l=function(){function t(t){this.name=t,this._logLevel=u,this._logHandler=h,this._userLogHandler=null,a.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in o))throw new TypeError('Invalid value "'+t+'" assigned to `logLevel`');this._logLevel=t},enumerable:!1,configurable:!0}),t.prototype.setLogLevel=function(t){this._logLevel="string"==typeof t?s[t]:t},Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!1,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.DEBUG],t)),this._logHandler.apply(this,r([this,o.DEBUG],t))},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.VERBOSE],t)),this._logHandler.apply(this,r([this,o.VERBOSE],t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.INFO],t)),this._logHandler.apply(this,r([this,o.INFO],t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.WARN],t)),this._logHandler.apply(this,r([this,o.WARN],t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.ERROR],t)),this._logHandler.apply(this,r([this,o.ERROR],t))},t}();function f(t){a.forEach((function(e){e.setLogLevel(t)}))}function p(t,e){for(var n=function(n){var r=null;e&&e.level&&(r=s[e.level]),n.userLogHandler=null===t?null:function(e,n){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var s=i.map((function(t){if(null==t)return null;if("string"==typeof t)return t;if("number"==typeof t||"boolean"==typeof t)return t.toString();if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch(t){return null}})).filter((function(t){return t})).join(" ");n>=(null!=r?r:e.logLevel)&&t({level:o[n].toLowerCase(),message:s,args:i,type:e.name})}},r=0,i=a;r<i.length;r++)n(i[r])}},6765:function(t,e,n){n.d(e,{BH:function(){return c},LL:function(){return E},r3:function(){return T},Sg:function(){return h},ne:function(){return k},p$:function(){return s},ZB:function(){return u},m9:function(){return x},z$:function(){return l},jU:function(){return d},ru:function(){return v},d:function(){return m},w1:function(){return g},uI:function(){return f},UG:function(){return p},b$:function(){return y},G6:function(){return w},Mn:function(){return b}});var r=n(5163),i=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1<t.length&&56320==(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},o={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:"function"==typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<t.length;i+=3){var o=t[i],a=i+1<t.length,s=a?t[i+1]:0,u=i+2<t.length,c=u?t[i+2]:0,h=o>>2,l=(3&o)<<4|s>>4,f=(15&s)<<2|c>>6,p=63&c;u||(p=64,a||(f=64)),r.push(n[h],n[l],n[f],n[p])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(i(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n<t.length;){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(1023&a))}else{o=t[n++];var s=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],a=i<t.length?n[t.charAt(i)]:0,s=++i<t.length?n[t.charAt(i)]:64,u=++i<t.length?n[t.charAt(i)]:64;if(++i,null==o||null==a||null==s||null==u)throw Error();var c=o<<2|a>>4;if(r.push(c),64!==s){var h=a<<4&240|s>>2;if(r.push(h),64!==u){var l=s<<6&192|u;r.push(l)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},a=function(t){return function(t){var e=i(t);return o.encodeByteArray(e,!0)}(t).replace(/\./g,"")};function s(t){return u(void 0,t)}function u(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&"__proto__"!==n&&(t[n]=u(t[n],e[n]));return t}var c=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"==typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}();function h(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n=e||"demo-project",i=t.iat||0,o=t.sub||t.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var s=(0,r.pi)({iss:"https://securetoken.google.com/"+n,aud:n,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},t);return[a(JSON.stringify({alg:"none",type:"JWT"})),a(JSON.stringify(s)),""].join(".")}function l(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function f(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(l())}function p(){try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(t){return!1}}function d(){return"object"==typeof self&&self.self===self}function v(){var t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}function y(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function m(){return l().indexOf("Electron/")>=0}function g(){var t=l();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function b(){return l().indexOf("MSAppHost/")>=0}function w(){return!p()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}var _=function(t){function e(n,r,i){var o=t.call(this,r)||this;return o.code=n,o.customData=i,o.name="FirebaseError",Object.setPrototypeOf(o,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,E.prototype.create),o}return(0,r.ZT)(e,t),e}(Error),E=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n}return t.prototype.create=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=e[0]||{},i=this.service+"/"+t,o=this.errors[t],a=o?S(o,r):"Error",s=this.serviceName+": "+a+" ("+i+").",u=new _(i,s,r);return u},t}();function S(t,e){return t.replace(I,(function(t,n){var r=e[n];return null!=r?String(r):"<"+n+"?>"}))}var I=/\{\$([^}]+)}/g;function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function k(t,e){var n=new A(t,e);return n.subscribe.bind(n)}!function(){function t(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var t=1;t<this.blockSize;++t)this.pad_[t]=0;this.reset()}t.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},t.prototype.compress_=function(t,e){e||(e=0);var n=this.W_;if("string"==typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(r=16;r<80;r++){var i=n[r-3]^n[r-8]^n[r-14]^n[r-16];n[r]=4294967295&(i<<1|i>>>31)}var o,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],h=this.chain_[3],l=this.chain_[4];for(r=0;r<80;r++)r<40?r<20?(o=h^u&(c^h),a=1518500249):(o=u^c^h,a=1859775393):r<60?(o=u&c|h&(u|c),a=2400959708):(o=u^c^h,a=3395469782),i=(s<<5|s>>>27)+o+l+a+n[r]&4294967295,l=h,h=c,c=4294967295&(u<<30|u>>>2),u=s,s=i;this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+h&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<e;){if(0===o)for(;r<=n;)this.compress_(t,r),r+=this.blockSize;if("string"==typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++r,++o===this.blockSize){this.compress_(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++r,++o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},t.prototype.digest=function(){var t=[],e=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t}}();var A=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=0,r=["next","error","complete"];n<r.length;n++){var i=r[n];if(i in t&&"function"==typeof t[i])return!0}return!1}(t)?t:{next:t,error:e,complete:n}).next&&(r.next=O),void 0===r.error&&(r.error=O),void 0===r.complete&&(r.complete=O);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(t){}})),this.observers.push(r),o},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var n=this;this.task.then((function(){if(void 0!==n.observers&&void 0!==n.observers[t])try{e(n.observers[t])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}}))},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((function(){e.observers=void 0,e.onNoObservers=void 0})))},t}();function O(){}function x(t){return t&&t._delegate?t._delegate:t}},5451:function(t,e,n){n.r(e),n.d(e,{BrowserClient:function(){return qe},Hub:function(){return ht},Integrations:function(){return ln},SDK_NAME:function(){return un},SDK_VERSION:function(){return Ct},Scope:function(){return C},Severity:function(){return u},Status:function(){return c},Transports:function(){return o},addBreadcrumb:function(){return Et},addGlobalEventProcessor:function(){return P},captureEvent:function(){return wt},captureException:function(){return gt},captureMessage:function(){return bt},close:function(){return an},configureScope:function(){return _t},defaultIntegrations:function(){return Ze},eventFromException:function(){return ae},eventFromMessage:function(){return se},flush:function(){return on},forceLoad:function(){return nn},getCurrentHub:function(){return pt},getHubFromCarrier:function(){return vt},init:function(){return $e},injectReportDialog:function(){return Te},lastEventId:function(){return en},makeMain:function(){return ft},onLoad:function(){return rn},setContext:function(){return St},setExtra:function(){return kt},setExtras:function(){return It},setTag:function(){return At},setTags:function(){return Tt},setUser:function(){return Ot},showReportDialog:function(){return tn},startTransaction:function(){return Nt},withScope:function(){return xt},wrap:function(){return sn}});var r={};n.r(r),n.d(r,{FunctionToString:function(){return Ke},InboundFilters:function(){return Ge}});var i={};n.r(i),n.d(i,{Breadcrumbs:function(){return Ve},Dedupe:function(){return Qe},GlobalHandlers:function(){return ze},LinkedErrors:function(){return Je},TryCatch:function(){return We},UserAgent:function(){return Ye}});var o={};n.r(o),n.d(o,{BaseTransport:function(){return me},FetchTransport:function(){return ge},XHRTransport:function(){return be}});var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function s(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var u,c,h=function(){return(h=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function l(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}!function(t){t.Fatal="fatal",t.Error="error",t.Warning="warning",t.Log="log",t.Info="info",t.Debug="debug",t.Critical="critical"}(u||(u={})),function(t){t.fromString=function(e){switch(e){case"debug":return t.Debug;case"info":return t.Info;case"warn":case"warning":return t.Warning;case"error":return t.Error;case"fatal":return t.Fatal;case"critical":return t.Critical;case"log":default:return t.Log}}}(u||(u={})),function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.Invalid="invalid",t.Failed="failed"}(c||(c={})),function(t){t.fromHttpCode=function(e){return e>=200&&e<300?t.Success:429===e?t.RateLimit:e>=400&&e<500?t.Invalid:e>=500?t.Failed:t.Unknown}}(c||(c={}));var d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function v(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(v(arguments[e]));return t}function m(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return k(t,Error)}}function g(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)}function b(t){return"[object DOMError]"===Object.prototype.toString.call(t)}function w(t){return"[object String]"===Object.prototype.toString.call(t)}function _(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function E(t){return"[object Object]"===Object.prototype.toString.call(t)}function S(t){return"undefined"!=typeof Event&&k(t,Event)}function I(t){return"undefined"!=typeof Element&&k(t,Element)}function T(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function k(t,e){try{return t instanceof e}catch(t){return!1}}var A,O=n(7790);!function(t){t.PENDING="PENDING",t.RESOLVED="RESOLVED",t.REJECTED="REJECTED"}(A||(A={}));var x=function(){function t(t){var e=this;this._state=A.PENDING,this._handlers=[],this._resolve=function(t){e._setResult(A.RESOLVED,t)},this._reject=function(t){e._setResult(A.REJECTED,t)},this._setResult=function(t,n){e._state===A.PENDING&&(T(n)?n.then(e._resolve,e._reject):(e._state=t,e._value=n,e._executeHandlers()))},this._attachHandler=function(t){e._handlers=e._handlers.concat(t),e._executeHandlers()},this._executeHandlers=function(){if(e._state!==A.PENDING){var t=e._handlers.slice();e._handlers=[],t.forEach((function(t){t.done||(e._state===A.RESOLVED&&t.onfulfilled&&t.onfulfilled(e._value),e._state===A.REJECTED&&t.onrejected&&t.onrejected(e._value),t.done=!0)}))}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}return t.resolve=function(e){return new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.all=function(e){return new t((function(n,r){if(Array.isArray(e))if(0!==e.length){var i=e.length,o=[];e.forEach((function(e,a){t.resolve(e).then((function(t){o[a]=t,0==(i-=1)&&n(o)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},t.prototype.then=function(e,n){var r=this;return new t((function(t,i){r._attachHandler({done:!1,onfulfilled:function(n){if(e)try{return void t(e(n))}catch(t){return void i(t)}else t(n)},onrejected:function(e){if(n)try{return void t(n(e))}catch(t){return void i(t)}else i(e)}})}))},t.prototype.catch=function(t){return this.then((function(t){return t}),t)},t.prototype.finally=function(e){var n=this;return new t((function(t,r){var i,o;return n.then((function(t){o=!1,i=t,e&&e()}),(function(t){o=!0,i=t,e&&e()})).then((function(){o?r(i):t(i)}))}))},t.prototype.toString=function(){return"[object SyncPromise]"},t}(),N=n(3699),C=function(){function t(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return t.clone=function(e){var n=new t;return e&&(n._breadcrumbs=y(e._breadcrumbs),n._tags=d({},e._tags),n._extra=d({},e._extra),n._contexts=d({},e._contexts),n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=y(e._eventProcessors),n._requestSession=e._requestSession),n},t.prototype.addScopeListener=function(t){this._scopeListeners.push(t)},t.prototype.addEventProcessor=function(t){return this._eventProcessors.push(t),this},t.prototype.setUser=function(t){return this._user=t||{},this._session&&this._session.update({user:t}),this._notifyScopeListeners(),this},t.prototype.getUser=function(){return this._user},t.prototype.getRequestSession=function(){return this._requestSession},t.prototype.setRequestSession=function(t){return this._requestSession=t,this},t.prototype.setTags=function(t){return this._tags=d(d({},this._tags),t),this._notifyScopeListeners(),this},t.prototype.setTag=function(t,e){var n;return this._tags=d(d({},this._tags),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setExtras=function(t){return this._extra=d(d({},this._extra),t),this._notifyScopeListeners(),this},t.prototype.setExtra=function(t,e){var n;return this._extra=d(d({},this._extra),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setFingerprint=function(t){return this._fingerprint=t,this._notifyScopeListeners(),this},t.prototype.setLevel=function(t){return this._level=t,this._notifyScopeListeners(),this},t.prototype.setTransactionName=function(t){return this._transactionName=t,this._notifyScopeListeners(),this},t.prototype.setTransaction=function(t){return this.setTransactionName(t)},t.prototype.setContext=function(t,e){var n;return null===e?delete this._contexts[t]:this._contexts=d(d({},this._contexts),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setSpan=function(t){return this._span=t,this._notifyScopeListeners(),this},t.prototype.getSpan=function(){return this._span},t.prototype.getTransaction=function(){var t,e,n,r,i=this.getSpan();return(null===(t=i)||void 0===t?void 0:t.transaction)?null===(e=i)||void 0===e?void 0:e.transaction:(null===(r=null===(n=i)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?i.spanRecorder.spans[0]:void 0},t.prototype.setSession=function(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this},t.prototype.getSession=function(){return this._session},t.prototype.update=function(e){if(!e)return this;if("function"==typeof e){var n=e(this);return n instanceof t?n:this}return e instanceof t?(this._tags=d(d({},this._tags),e._tags),this._extra=d(d({},this._extra),e._extra),this._contexts=d(d({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):E(e)&&(e=e,this._tags=d(d({},this._tags),e.tags),this._extra=d(d({},this._extra),e.extra),this._contexts=d(d({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this},t.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},t.prototype.addBreadcrumb=function(t,e){var n="number"==typeof e?Math.min(e,100):100;if(n<=0)return this;var r=d({timestamp:(0,O.yW)()},t);return this._breadcrumbs=y(this._breadcrumbs,[r]).slice(-n),this._notifyScopeListeners(),this},t.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},t.prototype.applyToEvent=function(t,e){var n;if(this._extra&&Object.keys(this._extra).length&&(t.extra=d(d({},this._extra),t.extra)),this._tags&&Object.keys(this._tags).length&&(t.tags=d(d({},this._tags),t.tags)),this._user&&Object.keys(this._user).length&&(t.user=d(d({},this._user),t.user)),this._contexts&&Object.keys(this._contexts).length&&(t.contexts=d(d({},this._contexts),t.contexts)),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts=d({trace:this._span.getTraceContext()},t.contexts);var r=null===(n=this._span.transaction)||void 0===n?void 0:n.name;r&&(t.tags=d({transaction:r},t.tags))}return this._applyFingerprint(t),t.breadcrumbs=y(t.breadcrumbs||[],this._breadcrumbs),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,this._notifyEventProcessors(y(D(),this._eventProcessors),t,e)},t.prototype._notifyEventProcessors=function(t,e,n,r){var i=this;return void 0===r&&(r=0),new x((function(o,a){var s=t[r];if(null===e||"function"!=typeof s)o(e);else{var u=s(d({},e),n);T(u)?u.then((function(e){return i._notifyEventProcessors(t,e,n,r+1).then(o)})).then(null,a):i._notifyEventProcessors(t,u,n,r+1).then(o).then(null,a)}}))},t.prototype._notifyScopeListeners=function(){var t=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(e){e(t)})),this._notifyingListeners=!1)},t.prototype._applyFingerprint=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},t}();function D(){var t=(0,N.Rf)();return t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.globalEventProcessors=t.__SENTRY__.globalEventProcessors||[],t.__SENTRY__.globalEventProcessors}function P(t){D().push(t)}var R,L,j=function(){return(j=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function M(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function F(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(M(arguments[e]));return t}!function(t){t.Ok="ok",t.Exited="exited",t.Crashed="crashed",t.Abnormal="abnormal"}(R||(R={})),function(t){t.Ok="ok",t.Errored="errored",t.Crashed="crashed"}(L||(L={}));var U=(0,N.Rf)(),V="Sentry Logger ",q=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&(0,N.Cf)((function(){U.console.log(V+"[Log]: "+t.join(" "))}))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&(0,N.Cf)((function(){U.console.warn(V+"[Warn]: "+t.join(" "))}))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&(0,N.Cf)((function(){U.console.error(V+"[Error]: "+t.join(" "))}))},t}();U.__SENTRY__=U.__SENTRY__||{};var B=U.__SENTRY__.logger||(U.__SENTRY__.logger=new q),G=n(7392),K=function(t,e){return(K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},H=function(){return(H=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function W(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function z(t,e){try{for(var n=t,r=[],i=0,o=0,a=" > ".length,s=void 0;n&&i++<5&&!("html"===(s=J(n,e))||i>1&&o+r.length*a+s.length>=80);)r.push(s),o+=s.length,n=n.parentNode;return r.reverse().join(" > ")}catch(t){return"<unknown>"}}function J(t,e){var n,r,i,o,a,s,u,c=t,h=[];if(!c||!c.tagName)return"";h.push(c.tagName.toLowerCase());var l=(null===(n=e)||void 0===n?void 0:n.length)?e.filter((function(t){return c.getAttribute(t)})).map((function(t){return[t,c.getAttribute(t)]})):null;if(null===(r=l)||void 0===r?void 0:r.length)l.forEach((function(t){h.push("["+t[0]+'="'+t[1]+'"]')}));else if(c.id&&h.push("#"+c.id),(i=c.className)&&w(i))for(o=i.split(/\s+/),u=0;u<o.length;u++)h.push("."+o[u]);var f=["type","name","title","alt"];for(u=0;u<f.length;u++)a=f[u],(s=c.getAttribute(a))&&h.push("["+a+'="'+s+'"]');return h.join("")}var Q=function(){function t(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return t.prototype.memoize=function(t){if(this._hasWeakSet)return!!this._inner.has(t)||(this._inner.add(t),!1);for(var e=0;e<this._inner.length;e++)if(this._inner[e]===t)return!0;return this._inner.push(t),!1},t.prototype.unmemoize=function(t){if(this._hasWeakSet)this._inner.delete(t);else for(var e=0;e<this._inner.length;e++)if(this._inner[e]===t){this._inner.splice(e,1);break}},t}(),X="<anonymous>";function Y(t){try{return t&&"function"==typeof t&&t.name||X}catch(t){return X}}function Z(t,e){return void 0===e&&(e=0),"string"!=typeof t||0===e||t.length<=e?t:t.substr(0,e)+"..."}function $(t,e){if(!Array.isArray(t))return"";for(var n=[],r=0;r<t.length;r++){var i=t[r];try{n.push(String(i))}catch(t){n.push("[value cannot be serialized]")}}return n.join(e)}function tt(t,e){return!!w(t)&&(n=e,"[object RegExp]"===Object.prototype.toString.call(n)?e.test(t):"string"==typeof e&&-1!==t.indexOf(e));var n}function et(t,e,n){if(e in t){var r=t[e],i=n(r);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__sentry_original__:{enumerable:!1,value:r}})}catch(t){}t[e]=i}}function nt(t){if(m(t)){var e=t,n={message:e.message,name:e.name,stack:e.stack};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}if(S(t)){var i=t,o={};o.type=i.type;try{o.target=I(i.target)?z(i.target):Object.prototype.toString.call(i.target)}catch(t){o.target="<unknown>"}try{o.currentTarget=I(i.currentTarget)?z(i.currentTarget):Object.prototype.toString.call(i.currentTarget)}catch(t){o.currentTarget="<unknown>"}for(var a in"undefined"!=typeof CustomEvent&&k(t,CustomEvent)&&(o.detail=i.detail),i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a]);return o}return t}function rt(t,e,n){void 0===e&&(e=3),void 0===n&&(n=102400);var r,i=at(t,e);return r=i,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(r))>n?rt(t,e-1,n):i}function it(t,e){return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":void 0!==n.g&&t===n.g?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":E(r=t)&&"nativeEvent"in r&&"preventDefault"in r&&"stopPropagation"in r?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+Y(t)+"]":"symbol"==typeof t?"["+String(t)+"]":"bigint"==typeof t?"[BigInt: "+String(t)+"]":t;var r}function ot(t,e,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new Q),0===n)return function(t){var e=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===e)return"[Object]";if("[object Array]"===e)return"[Array]";var n=it(t);return _(n)?n:e}(e);if(null!=e&&"function"==typeof e.toJSON)return e.toJSON();var i=it(e,t);if(_(i))return i;var o=nt(e),a=Array.isArray(e)?[]:{};if(r.memoize(e))return"[Circular ~]";for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(a[s]=ot(s,o[s],n-1,r));return r.unmemoize(e),a}function at(t,e){try{return JSON.parse(JSON.stringify(t,(function(t,n){return ot(t,n,e)})))}catch(t){return"**non-serializable**"}}function st(t,e){void 0===e&&(e=40);var n=Object.keys(nt(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return Z(n[0],e);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:Z(i,e)}return""}function ut(t){var e,n;if(E(t)){var r=t,i={};try{for(var o=W(Object.keys(r)),a=o.next();!a.done;a=o.next()){var s=a.value;void 0!==r[s]&&(i[s]=ut(r[s]))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}return Array.isArray(t)?t.map(ut):t}var ct=function(){function t(t){this.errors=0,this.sid=(0,N.DM)(),this.duration=0,this.status=R.Ok,this.init=!0,this.ignoreDuration=!1;var e=(0,O.ph)();this.timestamp=e,this.started=e,t&&this.update(t)}return t.prototype.update=function(t){if(void 0===t&&(t={}),t.user&&(!this.ipAddress&&t.user.ip_address&&(this.ipAddress=t.user.ip_address),this.did||t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||(0,O.ph)(),t.ignoreDuration&&(this.ignoreDuration=t.ignoreDuration),t.sid&&(this.sid=32===t.sid.length?t.sid:(0,N.DM)()),void 0!==t.init&&(this.init=t.init),!this.did&&t.did&&(this.did=""+t.did),"number"==typeof t.started&&(this.started=t.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof t.duration)this.duration=t.duration;else{var e=this.timestamp-this.started;this.duration=e>=0?e:0}t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),!this.ipAddress&&t.ipAddress&&(this.ipAddress=t.ipAddress),!this.userAgent&&t.userAgent&&(this.userAgent=t.userAgent),"number"==typeof t.errors&&(this.errors=t.errors),t.status&&(this.status=t.status)},t.prototype.close=function(t){t?this.update({status:t}):this.status===R.Ok?this.update({status:R.Exited}):this.update()},t.prototype.toJSON=function(){return ut({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:ut({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},t}(),ht=function(){function t(t,e,n){void 0===e&&(e=new C),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=e,t&&this.bindClient(t)}return t.prototype.isOlderThan=function(t){return this._version<t},t.prototype.bindClient=function(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()},t.prototype.pushScope=function(){var t=C.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t},t.prototype.popScope=function(){return!(this.getStack().length<=1||!this.getStack().pop())},t.prototype.withScope=function(t){var e=this.pushScope();try{t(e)}finally{this.popScope()}},t.prototype.getClient=function(){return this.getStackTop().client},t.prototype.getScope=function(){return this.getStackTop().scope},t.prototype.getStack=function(){return this._stack},t.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},t.prototype.captureException=function(t,e){var n=this._lastEventId=(0,N.DM)(),r=e;if(!e){var i=void 0;try{throw new Error("Sentry syntheticException")}catch(t){i=t}r={originalException:t,syntheticException:i}}return this._invokeClient("captureException",t,d(d({},r),{event_id:n})),n},t.prototype.captureMessage=function(t,e,n){var r=this._lastEventId=(0,N.DM)(),i=n;if(!n){var o=void 0;try{throw new Error(t)}catch(t){o=t}i={originalException:t,syntheticException:o}}return this._invokeClient("captureMessage",t,e,d(d({},i),{event_id:r})),r},t.prototype.captureEvent=function(t,e){var n=this._lastEventId=(0,N.DM)();return this._invokeClient("captureEvent",t,d(d({},e),{event_id:n})),n},t.prototype.lastEventId=function(){return this._lastEventId},t.prototype.addBreadcrumb=function(t,e){var n=this.getStackTop(),r=n.scope,i=n.client;if(r&&i){var o=i.getOptions&&i.getOptions()||{},a=o.beforeBreadcrumb,s=void 0===a?null:a,u=o.maxBreadcrumbs,c=void 0===u?100:u;if(!(c<=0)){var h=(0,O.yW)(),l=d({timestamp:h},t),f=s?(0,N.Cf)((function(){return s(l,e)})):l;null!==f&&r.addBreadcrumb(f,c)}}},t.prototype.setUser=function(t){var e=this.getScope();e&&e.setUser(t)},t.prototype.setTags=function(t){var e=this.getScope();e&&e.setTags(t)},t.prototype.setExtras=function(t){var e=this.getScope();e&&e.setExtras(t)},t.prototype.setTag=function(t,e){var n=this.getScope();n&&n.setTag(t,e)},t.prototype.setExtra=function(t,e){var n=this.getScope();n&&n.setExtra(t,e)},t.prototype.setContext=function(t,e){var n=this.getScope();n&&n.setContext(t,e)},t.prototype.configureScope=function(t){var e=this.getStackTop(),n=e.scope,r=e.client;n&&r&&t(n)},t.prototype.run=function(t){var e=ft(this);try{t(this)}finally{ft(e)}},t.prototype.getIntegration=function(t){var e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return B.warn("Cannot retrieve integration "+t.id+" from the current Hub"),null}},t.prototype.startSpan=function(t){return this._callExtensionMethod("startSpan",t)},t.prototype.startTransaction=function(t,e){return this._callExtensionMethod("startTransaction",t,e)},t.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},t.prototype.captureSession=function(t){if(void 0===t&&(t=!1),t)return this.endSession();this._sendSessionUpdate()},t.prototype.endSession=function(){var t,e,n,r,i;null===(n=null===(e=null===(t=this.getStackTop())||void 0===t?void 0:t.scope)||void 0===e?void 0:e.getSession())||void 0===n||n.close(),this._sendSessionUpdate(),null===(i=null===(r=this.getStackTop())||void 0===r?void 0:r.scope)||void 0===i||i.setSession()},t.prototype.startSession=function(t){var e=this.getStackTop(),n=e.scope,r=e.client,i=r&&r.getOptions()||{},o=i.release,a=i.environment,s=((0,N.Rf)().navigator||{}).userAgent,u=new ct(d(d(d({release:o,environment:a},n&&{user:n.getUser()}),s&&{userAgent:s}),t));if(n){var c=n.getSession&&n.getSession();c&&c.status===R.Ok&&c.update({status:R.Exited}),this.endSession(),n.setSession(u)}return u},t.prototype._sendSessionUpdate=function(){var t=this.getStackTop(),e=t.scope,n=t.client;if(e){var r=e.getSession&&e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},t.prototype._invokeClient=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this.getStackTop(),o=i.scope,a=i.client;a&&a[t]&&(e=a)[t].apply(e,y(n,[o]))},t.prototype._callExtensionMethod=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=lt(),i=r.__SENTRY__;if(i&&i.extensions&&"function"==typeof i.extensions[t])return i.extensions[t].apply(this,e);B.warn("Extension method "+t+" couldn't be found, doing nothing.")},t}();function lt(){var t=(0,N.Rf)();return t.__SENTRY__=t.__SENTRY__||{extensions:{},hub:void 0},t}function ft(t){var e=lt(),n=vt(e);return yt(e,t),n}function pt(){var t=lt();return dt(t)&&!vt(t).isOlderThan(4)||yt(t,new ht),(0,G.KV)()?function(t){var e,n,r;try{var i=null===(r=null===(n=null===(e=lt().__SENTRY__)||void 0===e?void 0:e.extensions)||void 0===n?void 0:n.domain)||void 0===r?void 0:r.active;if(!i)return vt(t);if(!dt(i)||vt(i).isOlderThan(4)){var o=vt(t).getStackTop();yt(i,new ht(o.client,C.clone(o.scope)))}return vt(i)}catch(e){return vt(t)}}(t):vt(t)}function dt(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function vt(t){return t&&t.__SENTRY__&&t.__SENTRY__.hub||(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=new ht),t.__SENTRY__.hub}function yt(t,e){return!!t&&(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=e,!0)}function mt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=pt();if(r&&r[t])return r[t].apply(r,F(e));throw new Error("No hub defined or "+t+" was not found on the hub, please open a bug report.")}function gt(t,e){var n;try{throw new Error("Sentry syntheticException")}catch(t){n=t}return mt("captureException",t,{captureContext:e,originalException:t,syntheticException:n})}function bt(t,e){var n;try{throw new Error(t)}catch(t){n=t}return mt("captureMessage",t,"string"==typeof e?e:void 0,j({originalException:t,syntheticException:n},"string"!=typeof e?{captureContext:e}:void 0))}function wt(t){return mt("captureEvent",t)}function _t(t){mt("configureScope",t)}function Et(t){mt("addBreadcrumb",t)}function St(t,e){mt("setContext",t,e)}function It(t){mt("setExtras",t)}function Tt(t){mt("setTags",t)}function kt(t,e){mt("setExtra",t,e)}function At(t,e){mt("setTag",t,e)}function Ot(t){mt("setUser",t)}function xt(t){mt("withScope",t)}function Nt(t,e){return mt("startTransaction",j({},t),e)}var Ct="6.11.0",Dt=function(){return(Dt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function Pt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Rt(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Pt(arguments[e]));return t}var Lt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n]);return t}),jt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.message=e,r.name=n.prototype.constructor.name,Lt(r,n.prototype),r}return function(t,e){function n(){this.constructor=t}K(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e}(Error),Mt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,Ft=function(){function t(t){"string"==typeof t?this._fromString(t):this._fromComponents(t),this._validate()}return t.prototype.toString=function(t){void 0===t&&(t=!1);var e=this,n=e.host,r=e.path,i=e.pass,o=e.port,a=e.projectId;return e.protocol+"://"+e.publicKey+(t&&i?":"+i:"")+"@"+n+(o?":"+o:"")+"/"+(r?r+"/":r)+a},t.prototype._fromString=function(t){var e=Mt.exec(t);if(!e)throw new jt("Invalid Dsn");var n=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(e.slice(1),6),r=n[0],i=n[1],o=n[2],a=void 0===o?"":o,s=n[3],u=n[4],c=void 0===u?"":u,h="",l=n[5],f=l.split("/");if(f.length>1&&(h=f.slice(0,-1).join("/"),l=f.pop()),l){var p=l.match(/^\d+/);p&&(l=p[0])}this._fromComponents({host:s,pass:a,path:h,projectId:l,port:c,protocol:r,publicKey:i})},t.prototype._fromComponents=function(t){"user"in t&&!("publicKey"in t)&&(t.publicKey=t.user),this.user=t.publicKey||"",this.protocol=t.protocol,this.publicKey=t.publicKey||"",this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId},t.prototype._validate=function(){var t=this;if(["protocol","publicKey","host","projectId"].forEach((function(e){if(!t[e])throw new jt("Invalid Dsn: "+e+" missing")})),!this.projectId.match(/^\d+$/))throw new jt("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new jt("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new jt("Invalid Dsn: Invalid port "+this.port)},t}(),Ut=[];function Vt(t){return t.reduce((function(t,e){return t.every((function(t){return e.name!==t.name}))&&t.push(e),t}),[])}var qt=function(){function t(t,e){this._integrations={},this._numProcessing=0,this._backend=new t(e),this._options=e,e.dsn&&(this._dsn=new Ft(e.dsn))}return t.prototype.captureException=function(t,e,n){var r=this,i=e&&e.event_id;return this._process(this._getBackend().eventFromException(t,e).then((function(t){return r._captureEvent(t,e,n)})).then((function(t){i=t}))),i},t.prototype.captureMessage=function(t,e,n,r){var i=this,o=n&&n.event_id,a=_(t)?this._getBackend().eventFromMessage(String(t),e,n):this._getBackend().eventFromException(t,n);return this._process(a.then((function(t){return i._captureEvent(t,n,r)})).then((function(t){o=t}))),o},t.prototype.captureEvent=function(t,e,n){var r=e&&e.event_id;return this._process(this._captureEvent(t,e,n).then((function(t){r=t}))),r},t.prototype.captureSession=function(t){this._isEnabled()?"string"!=typeof t.release?B.warn("Discarded session because of missing or non-string release"):(this._sendSession(t),t.update({init:!1})):B.warn("SDK not enabled, will not capture session.")},t.prototype.getDsn=function(){return this._dsn},t.prototype.getOptions=function(){return this._options},t.prototype.flush=function(t){var e=this;return this._isClientDoneProcessing(t).then((function(n){return e._getBackend().getTransport().close(t).then((function(t){return n&&t}))}))},t.prototype.close=function(t){var e=this;return this.flush(t).then((function(t){return e.getOptions().enabled=!1,t}))},t.prototype.setupIntegrations=function(){var t,e;this._isEnabled()&&!this._integrations.initialized&&(this._integrations=(t=this._options,e={},function(t){var e=t.defaultIntegrations&&Rt(t.defaultIntegrations)||[],n=t.integrations,r=Rt(Vt(e));Array.isArray(n)?r=Rt(r.filter((function(t){return n.every((function(e){return e.name!==t.name}))})),Vt(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var i=r.map((function(t){return t.name})),o="Debug";return-1!==i.indexOf(o)&&r.push.apply(r,Rt(r.splice(i.indexOf(o),1))),r}(t).forEach((function(t){e[t.name]=t,function(t){-1===Ut.indexOf(t.name)&&(t.setupOnce(P,pt),Ut.push(t.name),B.log("Integration installed: "+t.name))}(t)})),Object.defineProperty(e,"initialized",{value:!0}),e))},t.prototype.getIntegration=function(t){try{return this._integrations[t.id]||null}catch(e){return B.warn("Cannot retrieve integration "+t.id+" from the current Client"),null}},t.prototype._updateSessionFromEvent=function(t,e){var n,r,i=!1,o=!1,a=e.exception&&e.exception.values;if(a){o=!0;try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),u=s.next();!u.done;u=s.next()){var c=u.value.mechanism;if(c&&!1===c.handled){i=!0;break}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}var h=t.status===R.Ok;(h&&0===t.errors||h&&i)&&(t.update(Dt(Dt({},i&&{status:R.Crashed}),{errors:t.errors||Number(o||i)})),this.captureSession(t))},t.prototype._sendSession=function(t){this._getBackend().sendSession(t)},t.prototype._isClientDoneProcessing=function(t){var e=this;return new x((function(n){var r=0,i=setInterval((function(){0==e._numProcessing?(clearInterval(i),n(!0)):(r+=1,t&&r>=t&&(clearInterval(i),n(!1)))}),1)}))},t.prototype._getBackend=function(){return this._backend},t.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},t.prototype._prepareEvent=function(t,e,n){var r=this,i=this.getOptions().normalizeDepth,o=void 0===i?3:i,a=Dt(Dt({},t),{event_id:t.event_id||(n&&n.event_id?n.event_id:(0,N.DM)()),timestamp:t.timestamp||(0,O.yW)()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var s=e;n&&n.captureContext&&(s=C.clone(s).update(n.captureContext));var u=x.resolve(a);return s&&(u=s.applyToEvent(a,n)),u.then((function(t){return"number"==typeof o&&o>0?r._normalizeEvent(t,o):t}))},t.prototype._normalizeEvent=function(t,e){if(!t)return null;var n=Dt(Dt(Dt(Dt(Dt({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((function(t){return Dt(Dt({},t),t.data&&{data:at(t.data,e)})}))}),t.user&&{user:at(t.user,e)}),t.contexts&&{contexts:at(t.contexts,e)}),t.extra&&{extra:at(t.extra,e)});t.contexts&&t.contexts.trace&&(n.contexts.trace=t.contexts.trace);var r=this.getOptions()._experiments;return(void 0===r?{}:r).ensureNoCircularStructures?at(n):n},t.prototype._applyClientOptions=function(t){var e=this.getOptions(),n=e.environment,r=e.release,i=e.dist,o=e.maxValueLength,a=void 0===o?250:o;"environment"in t||(t.environment="environment"in e?n:"production"),void 0===t.release&&void 0!==r&&(t.release=r),void 0===t.dist&&void 0!==i&&(t.dist=i),t.message&&(t.message=Z(t.message,a));var s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=Z(s.value,a));var u=t.request;u&&u.url&&(u.url=Z(u.url,a))},t.prototype._applyIntegrationsMetadata=function(t){var e=Object.keys(this._integrations);e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=Rt(t.sdk.integrations||[],e))},t.prototype._sendEvent=function(t){this._getBackend().sendEvent(t)},t.prototype._captureEvent=function(t,e,n){return this._processEvent(t,e,n).then((function(t){return t.event_id}),(function(t){B.error(t)}))},t.prototype._processEvent=function(t,e,n){var r=this,i=this.getOptions(),o=i.beforeSend,a=i.sampleRate;if(!this._isEnabled())return x.reject(new jt("SDK not enabled, will not capture event."));var s="transaction"===t.type;return!s&&"number"==typeof a&&Math.random()>a?x.reject(new jt("Discarding event because it's not included in the random sample (sampling rate = "+a+")")):this._prepareEvent(t,n,e).then((function(t){if(null===t)throw new jt("An event processor returned null, will not send event.");if(e&&e.data&&!0===e.data.__sentry__||s||!o)return t;var n=o(t,e);return r._ensureBeforeSendRv(n)})).then((function(t){if(null===t)throw new jt("`beforeSend` returned `null`, will not send event.");var e=n&&n.getSession&&n.getSession();return!s&&e&&r._updateSessionFromEvent(e,t),r._sendEvent(t),t})).then(null,(function(t){if(t instanceof jt)throw t;throw r.captureException(t,{data:{__sentry__:!0},originalException:t}),new jt("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+t)}))},t.prototype._process=function(t){var e=this;this._numProcessing+=1,t.then((function(t){return e._numProcessing-=1,t}),(function(t){return e._numProcessing-=1,t}))},t.prototype._ensureBeforeSendRv=function(t){var e="`beforeSend` method has to return `null` or a valid event.";if(T(t))return t.then((function(t){if(!E(t)&&null!==t)throw new jt(e);return t}),(function(t){throw new jt("beforeSend rejected with "+t)}));if(!E(t)&&null!==t)throw new jt(e);return t},t}(),Bt=function(){function t(){}return t.prototype.sendEvent=function(t){return x.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:c.Skipped})},t.prototype.close=function(t){return x.resolve(!0)},t}(),Gt=function(){function t(t){this._options=t,this._options.dsn||B.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return t.prototype.eventFromException=function(t,e){throw new jt("Backend has to implement `eventFromException` method")},t.prototype.eventFromMessage=function(t,e,n){throw new jt("Backend has to implement `eventFromMessage` method")},t.prototype.sendEvent=function(t){this._transport.sendEvent(t).then(null,(function(t){B.error("Error while sending event: "+t)}))},t.prototype.sendSession=function(t){this._transport.sendSession?this._transport.sendSession(t).then(null,(function(t){B.error("Error while sending session: "+t)})):B.warn("Dropping session because custom transport doesn't implement sendSession")},t.prototype.getTransport=function(){return this._transport},t.prototype._setupTransport=function(){return new Bt},t}();function Kt(){if(!("fetch"in(0,N.Rf)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function Ht(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Wt(){if(!Kt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}var zt="?",Jt=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Qt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Xt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Yt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Zt=/\((\S*)(?::(\d+))(?::(\d+))\)/,$t=/Minified React error #\d+;/i;function te(t){var e=null,n=0;t&&("number"==typeof t.framesToPop?n=t.framesToPop:$t.test(t.message)&&(n=1));try{if(e=function(t){if(!t||!t.stacktrace)return null;for(var e,n=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,r=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,i=t.stacktrace.split("\n"),o=[],a=0;a<i.length;a+=2){var s=null;(e=n.exec(i[a]))?s={url:e[2],func:e[3],args:[],line:+e[1],column:null}:(e=r.exec(i[a]))&&(s={url:e[6],func:e[3]||e[4],args:e[5]?e[5].split(","):[],line:+e[1],column:+e[2]}),s&&(!s.func&&s.line&&(s.func=zt),o.push(s))}return o.length?{message:ne(t),name:t.name,stack:o}:null}(t))return ee(e,n)}catch(t){}try{if(e=function(t){if(!t||!t.stack)return null;for(var e,n,r,i=[],o=t.stack.split("\n"),a=0;a<o.length;++a){if(n=Jt.exec(o[a])){var s=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(e=Zt.exec(n[2]))&&(n[2]=e[1],n[3]=e[2],n[4]=e[3]);var u=n[2]&&0===n[2].indexOf("address at ")?n[2].substr("address at ".length):n[2],c=n[1]||zt,h=-1!==c.indexOf("safari-extension"),l=-1!==c.indexOf("safari-web-extension");(h||l)&&(c=-1!==c.indexOf("@")?c.split("@")[0]:zt,u=h?"safari-extension:"+u:"safari-web-extension:"+u),r={url:u,func:c,args:s?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=Xt.exec(o[a]))r={url:n[2],func:n[1]||zt,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=Qt.exec(o[a])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(e=Yt.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=e[1],n[4]=e[2],n[5]=""):0!==a||n[5]||void 0===t.columnNumber||(i[0].column=t.columnNumber+1),r={url:n[3],func:n[1]||zt,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=zt),i.push(r)}return i.length?{message:ne(t),name:t.name,stack:i}:null}(t))return ee(e,n)}catch(t){}return{message:ne(t),name:t&&t.name,stack:[],failed:!0}}function ee(t,e){try{return h(h({},t),{stack:t.stack.slice(e)})}catch(e){return t}}function ne(t){var e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}function re(t){var e=oe(t.stack),n={type:t.name,value:t.message};return e&&e.length&&(n.stacktrace={frames:e}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function ie(t){return{exception:{values:[re(t)]}}}function oe(t){if(!t||!t.length)return[];var e=t,n=e[0].func||"",r=e[e.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(e=e.slice(1)),-1!==r.indexOf("sentryWrapped")&&(e=e.slice(0,-1)),e.slice(0,50).map((function(t){return{colno:null===t.column?void 0:t.column,filename:t.url||e[0].url,function:t.func||"?",in_app:!0,lineno:null===t.line?void 0:t.line}})).reverse()}function ae(t,e,n){var r=ue(e,n&&n.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return(0,N.EG)(r,{handled:!0,type:"generic"}),r.level=u.Error,n&&n.event_id&&(r.event_id=n.event_id),x.resolve(r)}function se(t,e,n,r){void 0===n&&(n=u.Info);var i=ce(e,r&&r.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),x.resolve(i)}function ue(t,e,n){var r,i;if(void 0===n&&(n={}),g(t)&&t.error)return ie(te(t=t.error));if(b(t)||(i=t,"[object DOMException]"===Object.prototype.toString.call(i))){var o=t,a=o.name||(b(o)?"DOMError":"DOMException"),s=o.message?a+": "+o.message:a;return r=ce(s,e,n),(0,N.Db)(r,s),"code"in o&&(r.tags=h(h({},r.tags),{"DOMException.code":""+o.code})),r}return m(t)?r=ie(te(t)):E(t)||S(t)?(r=function(t,e,n){var r={exception:{values:[{type:S(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+st(t)}]},extra:{__serialized__:rt(t)}};if(e){var i=oe(te(e).stack);r.stacktrace={frames:i}}return r}(t,e,n.rejection),(0,N.EG)(r,{synthetic:!0}),r):(r=ce(t,e,n),(0,N.Db)(r,""+t,void 0),(0,N.EG)(r,{synthetic:!0}),r)}function ce(t,e,n){void 0===n&&(n={});var r={message:t};if(n.attachStacktrace&&e){var i=oe(te(e).stack);r.stacktrace={frames:i}}return r}function he(t){if(t.metadata&&t.metadata.sdk){var e=t.metadata.sdk;return{name:e.name,version:e.version}}}function le(t,e){return e?(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=Rt(t.sdk.integrations||[],e.integrations||[]),t.sdk.packages=Rt(t.sdk.packages||[],e.packages||[]),t):t}function fe(t,e){var n=he(e),r="aggregates"in t?"sessions":"session";return{body:JSON.stringify(Dt(Dt({sent_at:(new Date).toISOString()},n&&{sdk:n}),e.forceEnvelope()&&{dsn:e.getDsn().toString()}))+"\n"+JSON.stringify({type:r})+"\n"+JSON.stringify(t),type:r,url:e.getEnvelopeEndpointWithUrlEncodedAuth()}}function pe(t,e){var n=he(e),r=t.type||"event",i="transaction"===r||e.forceEnvelope(),o=t.debug_meta||{},a=o.transactionSampling,s=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(o,["transactionSampling"]),u=a||{},c=u.method,h=u.rate;0===Object.keys(s).length?delete t.debug_meta:t.debug_meta=s;var l={body:JSON.stringify(n?le(t,e.metadata.sdk):t),type:r,url:i?e.getEnvelopeEndpointWithUrlEncodedAuth():e.getStoreEndpointWithUrlEncodedAuth()};if(i){var f=JSON.stringify(Dt(Dt({event_id:t.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}),e.forceEnvelope()&&{dsn:e.getDsn().toString()}))+"\n"+JSON.stringify({type:r,sample_rates:[{id:c,rate:h}]})+"\n"+l.body;l.body=f}return l}var de=function(){function t(t,e,n){void 0===e&&(e={}),this.dsn=t,this._dsnObject=new Ft(t),this.metadata=e,this._tunnel=n}return t.prototype.getDsn=function(){return this._dsnObject},t.prototype.forceEnvelope=function(){return!!this._tunnel},t.prototype.getBaseApiEndpoint=function(){var t=this.getDsn(),e=t.protocol?t.protocol+":":"",n=t.port?":"+t.port:"";return e+"//"+t.host+n+(t.path?"/"+t.path:"")+"/api/"},t.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},t.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},t.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this.forceEnvelope()?this._tunnel:this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},t.prototype.getStoreEndpointPath=function(){var t=this.getDsn();return(t.path?"/"+t.path:"")+"/api/"+t.projectId+"/store/"},t.prototype.getRequestHeaders=function(t,e){var n=this.getDsn(),r=["Sentry sentry_version=7"];return r.push("sentry_client="+t+"/"+e),r.push("sentry_key="+n.publicKey),n.pass&&r.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}},t.prototype.getReportDialogEndpoint=function(t){void 0===t&&(t={});var e=this.getDsn(),n=this.getBaseApiEndpoint()+"embed/error-page/",r=[];for(var i in r.push("dsn="+e.toString()),t)if("dsn"!==i)if("user"===i){if(!t.user)continue;t.user.name&&r.push("name="+encodeURIComponent(t.user.name)),t.user.email&&r.push("email="+encodeURIComponent(t.user.email))}else r.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return r.length?n+"?"+r.join("&"):n},t.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},t.prototype._getIngestEndpoint=function(t){return this._tunnel?this._tunnel:""+this.getBaseApiEndpoint()+this.getDsn().projectId+"/"+t+"/"},t.prototype._encodedAuth=function(){var t,e={sentry_key:this.getDsn().publicKey,sentry_version:"7"};return t=e,Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},t}(),ve=function(){function t(t){this._limit=t,this._buffer=[]}return t.prototype.isReady=function(){return void 0===this._limit||this.length()<this._limit},t.prototype.add=function(t){var e=this;if(!this.isReady())return x.reject(new jt("Not adding Promise due to buffer limit reached."));var n=t();return-1===this._buffer.indexOf(n)&&this._buffer.push(n),n.then((function(){return e.remove(n)})).then(null,(function(){return e.remove(n).then(null,(function(){}))})),n},t.prototype.remove=function(t){return this._buffer.splice(this._buffer.indexOf(t),1)[0]},t.prototype.length=function(){return this._buffer.length},t.prototype.drain=function(t){var e=this;return new x((function(n){var r=setTimeout((function(){t&&t>0&&n(!1)}),t);x.all(e._buffer).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},t}(),ye={event:"error",transaction:"transaction",session:"session",attachment:"attachment"},me=function(){function t(t){this.options=t,this._buffer=new ve(30),this._rateLimits={},this._api=new de(t.dsn,t._metadata,t.tunnel),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return t.prototype.sendEvent=function(t){throw new jt("Transport Class has to implement `sendEvent` method")},t.prototype.close=function(t){return this._buffer.drain(t)},t.prototype._handleResponse=function(t){var e=t.requestType,n=t.response,r=t.headers,i=t.resolve,o=t.reject,a=c.fromHttpCode(n.status);this._handleRateLimit(r)&&B.warn("Too many "+e+" requests, backing off until: "+this._disabledUntil(e)),a!==c.Success?o(n):i({status:a})},t.prototype._disabledUntil=function(t){var e=ye[t];return this._rateLimits[e]||this._rateLimits.all},t.prototype._isRateLimited=function(t){return this._disabledUntil(t)>new Date(Date.now())},t.prototype._handleRateLimit=function(t){var e,n,r,i,o=Date.now(),a=t["x-sentry-rate-limits"],s=t["retry-after"];if(a){try{for(var u=l(a.trim().split(",")),c=u.next();!c.done;c=u.next()){var h=c.value.split(":",2),f=parseInt(h[0],10),p=1e3*(isNaN(f)?60:f);try{for(var d=(r=void 0,l(h[1].split(";"))),v=d.next();!v.done;v=d.next()){var y=v.value;this._rateLimits[y||"all"]=new Date(o+p)}}catch(t){r={error:t}}finally{try{v&&!v.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return!0}return!!s&&(this._rateLimits.all=new Date(o+(0,N.JY)(o,s)),!0)},t}(),ge=function(t){function e(e,n){void 0===n&&(n=function(){var t,e,n=(0,N.Rf)();if(Ht(n.fetch))return n.fetch.bind(n);var r=n.document,i=n.fetch;if("function"==typeof(null===(t=r)||void 0===t?void 0:t.createElement))try{var o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o),(null===(e=o.contentWindow)||void 0===e?void 0:e.fetch)&&(i=o.contentWindow.fetch),r.head.removeChild(o)}catch(t){B.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return i.bind(n)}());var r=t.call(this,e)||this;return r._fetch=n,r}return s(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(pe(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(fe(t,this._api),t)},e.prototype._sendRequest=function(t,e){var n=this;if(this._isRateLimited(t.type))return Promise.reject({event:e,type:t.type,reason:"Transport for "+t.type+" requests locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429});var r={body:t.body,method:"POST",referrerPolicy:Wt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new x((function(e,i){n._fetch(t.url,r).then((function(r){var o={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:t.type,response:r,headers:o,resolve:e,reject:i})})).catch(i)}))}))},e}(me),be=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(pe(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(fe(t,this._api),t)},e.prototype._sendRequest=function(t,e){var n=this;return this._isRateLimited(t.type)?Promise.reject({event:e,type:t.type,reason:"Transport for "+t.type+" requests locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429}):this._buffer.add((function(){return new x((function(e,r){var i=new XMLHttpRequest;for(var o in i.onreadystatechange=function(){if(4===i.readyState){var o={"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")};n._handleResponse({requestType:t.type,response:i,headers:o,resolve:e,reject:r})}},i.open("POST",t.url),n.options.headers)n.options.headers.hasOwnProperty(o)&&i.setRequestHeader(o,n.options.headers[o]);i.send(t.body)}))}))},e}(me),we=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.eventFromException=function(t,e){return ae(this._options,t,e)},e.prototype.eventFromMessage=function(t,e,n){return void 0===e&&(e=u.Info),se(this._options,t,e,n)},e.prototype._setupTransport=function(){if(!this._options.dsn)return t.prototype._setupTransport.call(this);var e=h(h({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(e):Kt()?new ge(e):new be(e)},e}(Gt),_e=0;function Ee(){return _e>0}function Se(){_e+=1,setTimeout((function(){_e-=1}))}function Ie(t,e,n){if(void 0===e&&(e={}),"function"!=typeof t)return t;try{if(t.__sentry__)return t;if(t.__sentry_wrapped__)return t.__sentry_wrapped__}catch(e){return t}var r=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var i=r.map((function(t){return Ie(t,e)}));return t.handleEvent?t.handleEvent.apply(this,i):t.apply(this,i)}catch(t){throw Se(),xt((function(n){n.addEventProcessor((function(t){var n=h({},t);return e.mechanism&&((0,N.Db)(n,void 0,void 0),(0,N.EG)(n,e.mechanism)),n.extra=h(h({},n.extra),{arguments:r}),n})),gt(t)})),t}};try{for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch(t){}t.prototype=t.prototype||{},r.prototype=t.prototype,Object.defineProperty(t,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:t}});try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:function(){return t.name}})}catch(t){}return r}function Te(t){if(void 0===t&&(t={}),t.eventId)if(t.dsn){var e=document.createElement("script");e.async=!0,e.src=new de(t.dsn).getReportDialogEndpoint(t),t.onLoad&&(e.onload=t.onLoad),(document.head||document.body).appendChild(e)}else B.error("Missing dsn option in showReportDialog call");else B.error("Missing eventId option in showReportDialog call")}var ke,Ae,Oe,xe=(0,N.Rf)(),Ne={},Ce={};function De(t){t&&"string"==typeof t.type&&"function"==typeof t.callback&&(Ne[t.type]=Ne[t.type]||[],Ne[t.type].push(t.callback),function(t){if(!Ce[t])switch(Ce[t]=!0,t){case"console":"console"in xe&&["debug","info","warn","error","log","assert"].forEach((function(t){t in xe.console&&et(xe.console,t,(function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Pe("console",{args:n,level:t}),e&&Function.prototype.apply.call(e,xe.console,n)}}))}));break;case"dom":!function(){if("document"in xe){var t=Pe.bind(null,"dom"),e=je(t,!0);xe.document.addEventListener("click",e,!1),xe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((function(e){var n=xe[e]&&xe[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(et(n,"addEventListener",(function(e){return function(n,r,i){if("click"===n||"keypress"==n)try{var o=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=o[n]=o[n]||{refCount:0};if(!a.handler){var s=je(t);a.handler=s,e.call(this,n,s,i)}a.refCount+=1}catch(t){}return e.call(this,n,r,i)}})),et(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{var i=this.__sentry_instrumentation_handlers__||{},o=i[e];o&&(o.refCount-=1,o.refCount<=0&&(t.call(this,e,o.handler,r),o.handler=void 0,delete i[e]),0===Object.keys(i).length&&delete this.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,n,r)}})))}))}}();break;case"xhr":!function(){if("XMLHttpRequest"in xe){var t=[],e=[],n=XMLHttpRequest.prototype;et(n,"open",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=this,a=r[1];o.__sentry_xhr__={method:w(r[0])?r[0].toUpperCase():r[0],url:r[1]},w(a)&&"POST"===o.__sentry_xhr__.method&&a.match(/sentry_key/)&&(o.__sentry_own_request__=!0);var s=function(){if(4===o.readyState){try{o.__sentry_xhr__&&(o.__sentry_xhr__.status_code=o.status)}catch(t){}try{var n=t.indexOf(o);if(-1!==n){t.splice(n);var i=e.splice(n)[0];o.__sentry_xhr__&&void 0!==i[0]&&(o.__sentry_xhr__.body=i[0])}}catch(t){}Pe("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:o})}};return"onreadystatechange"in o&&"function"==typeof o.onreadystatechange?et(o,"onreadystatechange",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return s(),t.apply(o,e)}})):o.addEventListener("readystatechange",s),n.apply(o,r)}})),et(n,"send",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return t.push(this),e.push(r),Pe("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}}))}}();break;case"fetch":(function(){if(!Kt())return!1;var t=(0,N.Rf)();if(Ht(t.fetch))return!0;var e=!1,n=t.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=Ht(r.contentWindow.fetch)),n.head.removeChild(r)}catch(t){B.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e})()&&et(xe,"fetch",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r={args:e,fetchData:{method:Re(e),url:Le(e)},startTimestamp:Date.now()};return Pe("fetch",H({},r)),t.apply(xe,e).then((function(t){return Pe("fetch",H(H({},r),{endTimestamp:Date.now(),response:t})),t}),(function(t){throw Pe("fetch",H(H({},r),{endTimestamp:Date.now(),error:t})),t}))}}));break;case"history":!function(){if(function(){var t=(0,N.Rf)(),e=t.chrome,n=e&&e.app&&e.app.runtime,r="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!n&&r}()){var t=xe.onpopstate;xe.onpopstate=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=xe.location.href,i=ke;if(ke=r,Pe("history",{from:i,to:r}),t)try{return t.apply(this,e)}catch(t){}},et(xe.history,"pushState",e),et(xe.history,"replaceState",e)}function e(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length>2?e[2]:void 0;if(r){var i=ke,o=String(r);ke=o,Pe("history",{from:i,to:o})}return t.apply(this,e)}}}();break;case"error":Fe=xe.onerror,xe.onerror=function(t,e,n,r,i){return Pe("error",{column:r,error:i,line:n,msg:t,url:e}),!!Fe&&Fe.apply(this,arguments)};break;case"unhandledrejection":Ue=xe.onunhandledrejection,xe.onunhandledrejection=function(t){return Pe("unhandledrejection",t),!Ue||Ue.apply(this,arguments)};break;default:B.warn("unknown instrumentation type:",t)}}(t.type))}function Pe(t,e){var n,r;if(t&&Ne[t])try{for(var i=W(Ne[t]||[]),o=i.next();!o.done;o=i.next()){var a=o.value;try{a(e)}catch(e){B.error("Error while triggering instrumentation handler.\nType: "+t+"\nName: "+Y(a)+"\nError: "+e)}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function Re(t){return void 0===t&&(t=[]),"Request"in xe&&k(t[0],Request)&&t[0].method?String(t[0].method).toUpperCase():t[1]&&t[1].method?String(t[1].method).toUpperCase():"GET"}function Le(t){return void 0===t&&(t=[]),"string"==typeof t[0]?t[0]:"Request"in xe&&k(t[0],Request)?t[0].url:String(t[0])}function je(t,e){return void 0===e&&(e=!1),function(n){if(n&&Oe!==n&&!function(t){if("keypress"!==t.type)return!1;try{var e=t.target;if(!e||!e.tagName)return!0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)return!1}catch(t){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===Ae||function(t,e){if(!t)return!0;if(t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch(t){}return!1}(Oe,n))&&(t({event:n,name:r,global:e}),Oe=n),clearTimeout(Ae),Ae=xe.setTimeout((function(){Ae=void 0}),1e3)}}}var Me,Fe=null,Ue=null,Ve=function(){function t(e){this.name=t.id,this._options=h({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}return t.prototype.addSentryBreadcrumb=function(t){this._options.sentry&&pt().addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:(0,N.jH)(t)},{event:t})},t.prototype.setupOnce=function(){var t=this;this._options.console&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._consoleBreadcrumb.apply(t,p(e))},type:"console"}),this._options.dom&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._domBreadcrumb.apply(t,p(e))},type:"dom"}),this._options.xhr&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._xhrBreadcrumb.apply(t,p(e))},type:"xhr"}),this._options.fetch&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._fetchBreadcrumb.apply(t,p(e))},type:"fetch"}),this._options.history&&De({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._historyBreadcrumb.apply(t,p(e))},type:"history"})},t.prototype._consoleBreadcrumb=function(t){var e={category:"console",data:{arguments:t.args,logger:"console"},level:u.fromString(t.level),message:$(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;e.message="Assertion failed: "+($(t.args.slice(1)," ")||"console.assert"),e.data.arguments=t.args.slice(1)}pt().addBreadcrumb(e,{input:t.args,level:t.level})},t.prototype._domBreadcrumb=function(t){var e,n="object"==typeof this._options.dom?this._options.dom.serializeAttribute:void 0;"string"==typeof n&&(n=[n]);try{e=t.event.target?z(t.event.target,n):z(t.event,n)}catch(t){e="<unknown>"}0!==e.length&&pt().addBreadcrumb({category:"ui."+t.name,message:e},{event:t.event,name:t.name,global:t.global})},t.prototype._xhrBreadcrumb=function(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;var e=t.xhr.__sentry_xhr__||{},n=e.method,r=e.url,i=e.status_code,o=e.body;pt().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:i},type:"http"},{xhr:t.xhr,input:o})}},t.prototype._fetchBreadcrumb=function(t){t.endTimestamp&&(t.fetchData.url.match(/sentry_key/)&&"POST"===t.fetchData.method||(t.error?pt().addBreadcrumb({category:"fetch",data:t.fetchData,level:u.Error,type:"http"},{data:t.error,input:t.args}):pt().addBreadcrumb({category:"fetch",data:h(h({},t.fetchData),{status_code:t.response.status}),type:"http"},{input:t.args,response:t.response})))},t.prototype._historyBreadcrumb=function(t){var e=(0,N.Rf)(),n=t.from,r=t.to,i=(0,N.en)(e.location.href),o=(0,N.en)(n),a=(0,N.en)(r);o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),pt().addBreadcrumb({category:"navigation",data:{from:n,to:r}})},t.id="Breadcrumbs",t}(),qe=function(t){function e(e){return void 0===e&&(e={}),e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:Ct}],version:Ct},t.call(this,we,e)||this}return s(e,t),e.prototype.showReportDialog=function(t){void 0===t&&(t={}),(0,N.Rf)().document&&(this._isEnabled()?Te(h(h({},t),{dsn:t.dsn||this.getDsn()})):B.error("Trying to call showReportDialog with Sentry Client disabled"))},e.prototype._prepareEvent=function(e,n,r){return e.platform=e.platform||"javascript",t.prototype._prepareEvent.call(this,e,n,r)},e.prototype._sendEvent=function(e){var n=this.getIntegration(Ve);n&&n.addSentryBreadcrumb(e),t.prototype._sendEvent.call(this,e)},e}(qt),Be=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Ge=function(){function t(e){void 0===e&&(e={}),this._options=e,this.name=t.id}return t.prototype.setupOnce=function(){P((function(e){var n=pt();if(!n)return e;var r=n.getIntegration(t);if(r){var i=n.getClient(),o=i?i.getOptions():{},a="function"==typeof r._mergeOptions?r._mergeOptions(o):{};return"function"!=typeof r._shouldDropEvent?e:r._shouldDropEvent(e,a)?null:e}return e}))},t.prototype._shouldDropEvent=function(t,e){return this._isSentryError(t,e)?(B.warn("Event dropped due to being internal Sentry Error.\nEvent: "+(0,N.jH)(t)),!0):this._isIgnoredError(t,e)?(B.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+(0,N.jH)(t)),!0):this._isDeniedUrl(t,e)?(B.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+(0,N.jH)(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0):!this._isAllowedUrl(t,e)&&(B.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+(0,N.jH)(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0)},t.prototype._isSentryError=function(t,e){if(!e.ignoreInternal)return!1;try{return t&&t.exception&&t.exception.values&&t.exception.values[0]&&"SentryError"===t.exception.values[0].type||!1}catch(t){return!1}},t.prototype._isIgnoredError=function(t,e){return!(!e.ignoreErrors||!e.ignoreErrors.length)&&this._getPossibleEventMessages(t).some((function(t){return e.ignoreErrors.some((function(e){return tt(t,e)}))}))},t.prototype._isDeniedUrl=function(t,e){if(!e.denyUrls||!e.denyUrls.length)return!1;var n=this._getEventFilterUrl(t);return!!n&&e.denyUrls.some((function(t){return tt(n,t)}))},t.prototype._isAllowedUrl=function(t,e){if(!e.allowUrls||!e.allowUrls.length)return!0;var n=this._getEventFilterUrl(t);return!n||e.allowUrls.some((function(t){return tt(n,t)}))},t.prototype._mergeOptions=function(t){return void 0===t&&(t={}),{allowUrls:Rt(this._options.whitelistUrls||[],this._options.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:Rt(this._options.blacklistUrls||[],this._options.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:Rt(this._options.ignoreErrors||[],t.ignoreErrors||[],Be),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},t.prototype._getPossibleEventMessages=function(t){if(t.message)return[t.message];if(t.exception)try{var e=t.exception.values&&t.exception.values[0]||{},n=e.type,r=void 0===n?"":n,i=e.value,o=void 0===i?"":i;return[""+o,r+": "+o]}catch(e){return B.error("Cannot extract message for event "+(0,N.jH)(t)),[]}return[]},t.prototype._getLastValidUrl=function(t){var e;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--){var r=t[n];if("<anonymous>"!==(null===(e=r)||void 0===e?void 0:e.filename))return r.filename||null}return null},t.prototype._getEventFilterUrl=function(t){try{if(t.stacktrace){var e=t.stacktrace.frames;return this._getLastValidUrl(e)}if(t.exception){var n=t.exception.values&&t.exception.values[0].stacktrace&&t.exception.values[0].stacktrace.frames;return this._getLastValidUrl(n)}return null}catch(e){return B.error("Cannot extract url for event "+(0,N.jH)(t)),null}},t.id="InboundFilters",t}(),Ke=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){Me=Function.prototype.toString,Function.prototype.toString=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.__sentry_original__||this;return Me.apply(n,t)}},t.id="FunctionToString",t}(),He=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],We=function(){function t(e){this.name=t.id,this._options=h({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}return t.prototype.setupOnce=function(){var t=(0,N.Rf)();this._options.setTimeout&&et(t,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&et(t,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&et(t,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in t&&et(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget&&(Array.isArray(this._options.eventTarget)?this._options.eventTarget:He).forEach(this._wrapEventTarget.bind(this))},t.prototype._wrapTimeFunction=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0];return e[0]=Ie(r,{mechanism:{data:{function:Y(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}},t.prototype._wrapRAF=function(t){return function(e){return t.call(this,Ie(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Y(t)},handled:!0,type:"instrument"}}))}},t.prototype._wrapEventTarget=function(t){var e=(0,N.Rf)(),n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(et(n,"addEventListener",(function(e){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Ie(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:Y(r),target:t},handled:!0,type:"instrument"}}))}catch(t){}return e.call(this,n,Ie(r,{mechanism:{data:{function:"addEventListener",handler:Y(r),target:t},handled:!0,type:"instrument"}}),i)}})),et(n,"removeEventListener",(function(t){return function(e,n,r){var i,o=n;try{var a=null===(i=o)||void 0===i?void 0:i.__sentry_wrapped__;a&&t.call(this,e,a,r)}catch(t){}return t.call(this,e,o,r)}})))},t.prototype._wrapXHR=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this,i=["onload","onerror","onprogress","onreadystatechange"];return i.forEach((function(t){t in r&&"function"==typeof r[t]&&et(r,t,(function(e){var n={mechanism:{data:{function:t,handler:Y(e)},handled:!0,type:"instrument"}};return e.__sentry_original__&&(n.mechanism.data.handler=Y(e.__sentry_original__)),Ie(e,n)}))})),t.apply(this,e)}},t.id="TryCatch",t}(),ze=function(){function t(e){this.name=t.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=h({onerror:!0,onunhandledrejection:!0},e)}return t.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(B.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(B.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},t.prototype._installGlobalOnErrorHandler=function(){var e=this;this._onErrorHandlerInstalled||(De({callback:function(n){var r=n.error,i=pt(),o=i.getIntegration(t),a=r&&!0===r.__sentry_own_request__;if(o&&!Ee()&&!a){var s=i.getClient(),u=void 0===r&&w(n.msg)?e._eventFromIncompleteOnError(n.msg,n.url,n.line,n.column):e._enhanceEventWithInitialFrame(ue(r||n.msg,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!1}),n.url,n.line,n.column);(0,N.EG)(u,{handled:!1,type:"onerror"}),i.captureEvent(u,{originalException:r})}},type:"error"}),this._onErrorHandlerInstalled=!0)},t.prototype._installGlobalOnUnhandledRejectionHandler=function(){var e=this;this._onUnhandledRejectionHandlerInstalled||(De({callback:function(n){var r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch(t){}var i=pt(),o=i.getIntegration(t),a=r&&!0===r.__sentry_own_request__;if(!o||Ee()||a)return!0;var s=i.getClient(),c=_(r)?e._eventFromRejectionWithPrimitive(r):ue(r,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!0});c.level=u.Error,(0,N.EG)(c,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(c,{originalException:r})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},t.prototype._eventFromIncompleteOnError=function(t,e,n,r){var i,o=g(t)?t.message:t,a=o.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);a&&(i=a[1],o=a[2]);var s={exception:{values:[{type:i||"Error",value:o}]}};return this._enhanceEventWithInitialFrame(s,e,n,r)},t.prototype._eventFromRejectionWithPrimitive=function(t){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(t)}]}}},t.prototype._enhanceEventWithInitialFrame=function(t,e,n,r){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].stacktrace=t.exception.values[0].stacktrace||{},t.exception.values[0].stacktrace.frames=t.exception.values[0].stacktrace.frames||[];var i=isNaN(parseInt(r,10))?void 0:r,o=isNaN(parseInt(n,10))?void 0:n,a=w(e)&&e.length>0?e:(0,N.l4)();return 0===t.exception.values[0].stacktrace.frames.length&&t.exception.values[0].stacktrace.frames.push({colno:i,filename:a,function:"?",in_app:!0,lineno:o}),t},t.id="GlobalHandlers",t}(),Je=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._key=e.key||"cause",this._limit=e.limit||5}return t.prototype.setupOnce=function(){P((function(e,n){var r=pt().getIntegration(t);if(r){var i=r._handler&&r._handler.bind(r);return"function"==typeof i?i(e,n):e}return e}))},t.prototype._handler=function(t,e){if(!(t.exception&&t.exception.values&&e&&k(e.originalException,Error)))return t;var n=this._walkErrorTree(e.originalException,this._key);return t.exception.values=p(n,t.exception.values),t},t.prototype._walkErrorTree=function(t,e,n){if(void 0===n&&(n=[]),!k(t[e],Error)||n.length+1>=this._limit)return n;var r=re(te(t[e]));return this._walkErrorTree(t[e],e,p([r],n))},t.id="LinkedErrors",t}(),Qe=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(e,n){e((function(e){var r=n().getIntegration(t);if(r){try{if(r._shouldDropEvent(e,r._previousEvent))return null}catch(t){return r._previousEvent=e}return r._previousEvent=e}return e}))},t.prototype._shouldDropEvent=function(t,e){return!(!e||!this._isSameMessageEvent(t,e)&&!this._isSameExceptionEvent(t,e))},t.prototype._isSameMessageEvent=function(t,e){var n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!this._isSameFingerprint(t,e)||!this._isSameStacktrace(t,e))},t.prototype._getFramesFromEvent=function(t){var e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch(t){return}else if(t.stacktrace)return t.stacktrace.frames},t.prototype._isSameStacktrace=function(t,e){var n=this._getFramesFromEvent(t),r=this._getFramesFromEvent(e);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,(r=r).length!==n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i],a=n[i];if(o.filename!==a.filename||o.lineno!==a.lineno||o.colno!==a.colno||o.function!==a.function)return!1}return!0},t.prototype._getExceptionFromEvent=function(t){return t.exception&&t.exception.values&&t.exception.values[0]},t.prototype._isSameExceptionEvent=function(t,e){var n=this._getExceptionFromEvent(e),r=this._getExceptionFromEvent(t);return!!(n&&r&&n.type===r.type&&n.value===r.value&&this._isSameFingerprint(t,e)&&this._isSameStacktrace(t,e))},t.prototype._isSameFingerprint=function(t,e){var n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return!(n.join("")!==r.join(""))}catch(t){return!1}},t.id="Dedupe",t}(),Xe=(0,N.Rf)(),Ye=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){P((function(e){var n,r,i;if(pt().getIntegration(t)){if(!Xe.navigator&&!Xe.location&&!Xe.document)return e;var o=(null===(n=e.request)||void 0===n?void 0:n.url)||(null===(r=Xe.location)||void 0===r?void 0:r.href),a=(Xe.document||{}).referrer,s=(Xe.navigator||{}).userAgent,u=h(h(h({},null===(i=e.request)||void 0===i?void 0:i.headers),a&&{Referer:a}),s&&{"User-Agent":s}),c=h(h({},o&&{url:o}),{headers:u});return h(h({},e),{request:c})}return e}))},t.id="UserAgent",t}(),Ze=[new Ge,new Ke,new We,new Ve,new ze,new Je,new Qe,new Ye];function $e(t){if(void 0===t&&(t={}),void 0===t.defaultIntegrations&&(t.defaultIntegrations=Ze),void 0===t.release){var e=(0,N.Rf)();e.SENTRY_RELEASE&&e.SENTRY_RELEASE.id&&(t.release=e.SENTRY_RELEASE.id)}void 0===t.autoSessionTracking&&(t.autoSessionTracking=!0),function(t,e){var n;!0===e.debug&&B.enable();var r=pt();null===(n=r.getScope())||void 0===n||n.update(e.initialScope);var i=new t(e);r.bindClient(i)}(qe,t),t.autoSessionTracking&&function(){if(void 0!==(0,N.Rf)().document){var t=pt();"function"==typeof t.startSession&&"function"==typeof t.captureSession&&(t.startSession({ignoreDuration:!0}),t.captureSession(),De({callback:function(e){var n=e.from,r=e.to;void 0!==n&&n!==r&&(t.startSession({ignoreDuration:!0}),t.captureSession())},type:"history"}))}else B.warn("Session tracking in non-browser environment with @sentry/browser is not supported.")}()}function tn(t){void 0===t&&(t={});var e=pt(),n=e.getScope();n&&(t.user=h(h({},n.getUser()),t.user)),t.eventId||(t.eventId=e.lastEventId());var r=e.getClient();r&&r.showReportDialog(t)}function en(){return pt().lastEventId()}function nn(){}function rn(t){t()}function on(t){var e=pt().getClient();return e?e.flush(t):(B.warn("Cannot flush events. No client defined."),x.resolve(!1))}function an(t){var e=pt().getClient();return e?e.close(t):(B.warn("Cannot flush events and disable SDK. No client defined."),x.resolve(!1))}function sn(t){return Ie(t)()}var un="sentry.javascript.browser",cn={},hn=(0,N.Rf)();hn.Sentry&&hn.Sentry.Integrations&&(cn=hn.Sentry.Integrations);var ln=h(h(h({},cn),r),i)},3699:function(t,e,n){n.d(e,{Rf:function(){return o},DM:function(){return a},en:function(){return s},jH:function(){return u},Cf:function(){return c},Db:function(){return h},EG:function(){return l},l4:function(){return f},JY:function(){return p}});var r=n(7392),i={};function o(){return(0,r.KV)()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(){var t=o(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(t){for(var e=t.toString(16);e.length<4;)e="0"+e;return e};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function s(t){if(!t)return{};var e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};var n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}}function u(t){if(t.message)return t.message;if(t.exception&&t.exception.values&&t.exception.values[0]){var e=t.exception.values[0];return e.type&&e.value?e.type+": "+e.value:e.type||e.value||t.event_id||"<unknown>"}return t.event_id||"<unknown>"}function c(t){var e=o();if(!("console"in e))return t();var n=e.console,r={};["debug","info","warn","error","log","assert"].forEach((function(t){t in e.console&&n[t].__sentry_original__&&(r[t]=n[t],n[t]=n[t].__sentry_original__)}));var i=t();return Object.keys(r).forEach((function(t){n[t]=r[t]})),i}function h(t,e,n){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].value=t.exception.values[0].value||e||"",t.exception.values[0].type=t.exception.values[0].type||n||"Error"}function l(t,e){void 0===e&&(e={});try{t.exception.values[0].mechanism=t.exception.values[0].mechanism||{},Object.keys(e).forEach((function(n){t.exception.values[0].mechanism[n]=e[n]}))}catch(t){}}function f(){try{return document.location.href}catch(t){return""}}function p(t,e){if(!e)return 6e4;var n=parseInt(""+e,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+e);return isNaN(r)?6e4:r-t}},7392:function(t,e,n){function r(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function i(t,e){return t.require(e)}n.d(e,{KV:function(){return r},l$:function(){return i}}),t=n.hmd(t)},7790:function(t,e,n){n.d(e,{yW:function(){return u},ph:function(){return c}});var r=n(3699),i=n(7392);t=n.hmd(t);var o={nowSeconds:function(){return Date.now()/1e3}},a=(0,i.KV)()?function(){try{return(0,i.l$)(t,"perf_hooks").performance}catch(t){return}}():function(){var t=(0,r.Rf)().performance;if(t&&t.now)return{now:function(){return t.now()},timeOrigin:Date.now()-t.now()}}(),s=void 0===a?o:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},u=o.nowSeconds.bind(o),c=s.nowSeconds.bind(s);!function(){var t=(0,r.Rf)().performance;if(t&&t.now){var e=36e5,n=t.now(),i=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+n-i):e,a=o<e,s=t.timing&&t.timing.navigationStart,u="number"==typeof s?Math.abs(s+n-i):e;(a||u<e)&&(o<=u&&t.timeOrigin)}}()},5532:function(t,e,n){n.r(e),n.d(e,{default:function(){return r.Z}});var r=n(2249),i="8.10.0";r.Z.registerVersion("firebase",i,"app"),r.Z.SDK_VERSION=i},284:function(t,e,n){n.r(e);var r=n(2249);(function(){var t,e="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},i=function(t){t=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g,t];for(var e=0;e<t.length;++e){var r=t[e];if(r&&r.Math==Math)return r}return globalThis}(this);function o(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function a(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:o(t)}}!function(t,n){if(n){var r=i;t=t.split(".");for(var o=0;o<t.length-1;o++){var a=t[o];a in r||(r[a]={}),r=r[a]}(n=n(o=r[t=t[t.length-1]]))!=o&&null!=n&&e(r,t,{configurable:!0,writable:!0,value:n})}}("Promise",(function(t){function e(t){this.b=0,this.c=void 0,this.a=[];var e=this.f();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function n(){this.a=null}function r(t){return t instanceof e?t:new e((function(e){e(t)}))}if(t)return t;n.prototype.b=function(t){if(null==this.a){this.a=[];var e=this;this.c((function(){e.g()}))}this.a.push(t)};var o=i.setTimeout;n.prototype.c=function(t){o(t,0)},n.prototype.g=function(){for(;this.a&&this.a.length;){var t=this.a;this.a=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(t){this.f(t)}}}this.a=null},n.prototype.f=function(t){this.c((function(){throw t}))},e.prototype.f=function(){function t(t){return function(r){n||(n=!0,t.call(e,r))}}var e=this,n=!1;return{resolve:t(this.m),reject:t(this.g)}},e.prototype.m=function(t){if(t===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.s(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.v(t):this.h(t)}},e.prototype.v=function(t){var e=void 0;try{e=t.then}catch(t){return void this.g(t)}"function"==typeof e?this.u(e,t):this.h(t)},e.prototype.g=function(t){this.i(2,t)},e.prototype.h=function(t){this.i(1,t)},e.prototype.i=function(t,e){if(0!=this.b)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.b);this.b=t,this.c=e,this.l()},e.prototype.l=function(){if(null!=this.a){for(var t=0;t<this.a.length;++t)s.b(this.a[t]);this.a=null}};var s=new n;return e.prototype.s=function(t){var e=this.f();t.Ra(e.resolve,e.reject)},e.prototype.u=function(t,e){var n=this.f();try{t.call(e,n.resolve,n.reject)}catch(t){n.reject(t)}},e.prototype.then=function(t,n){function r(t,e){return"function"==typeof t?function(e){try{i(t(e))}catch(t){o(t)}}:e}var i,o,a=new e((function(t,e){i=t,o=e}));return this.Ra(r(t,i),r(n,o)),a},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.Ra=function(t,e){function n(){switch(r.b){case 1:t(r.c);break;case 2:e(r.c);break;default:throw Error("Unexpected state: "+r.b)}}var r=this;null==this.a?s.b(n):this.a.push(n)},e.resolve=r,e.reject=function(t){return new e((function(e,n){n(t)}))},e.race=function(t){return new e((function(e,n){for(var i=a(t),o=i.next();!o.done;o=i.next())r(o.value).Ra(e,n)}))},e.all=function(t){var n=a(t),i=n.next();return i.done?r([]):new e((function(t,e){function o(e){return function(n){a[e]=n,0==--s&&t(a)}}var a=[],s=0;do{a.push(void 0),s++,r(i.value).Ra(o(a.length-1),e),i=n.next()}while(!i.done)}))},e}));var s=s||{},u=this||self,c=/^[\w+/_-]+[=]{0,2}$/,h=null;function l(t){return(t=t.querySelector&&t.querySelector("script[nonce]"))&&(t=t.nonce||t.getAttribute("nonce"))&&c.test(t)?t:""}function f(){}function p(t){var e=typeof t;return"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}function d(t){var e=p(t);return"array"==e||"object"==e&&"number"==typeof t.length}function v(t){return"function"==p(t)}function y(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function m(t){return Object.prototype.hasOwnProperty.call(t,g)&&t[g]||(t[g]=++b)}var g="closure_uid_"+(1e9*Math.random()>>>0),b=0;function w(t,e,n){return t.call.apply(t.bind,arguments)}function _(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function E(t,e,n){return(E=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?w:_).apply(null,arguments)}function S(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}var I=Date.now;function T(t,e){function n(){}n.prototype=e.prototype,t.bb=e.prototype,t.prototype=new n,t.prototype.constructor=t}function k(t){return t}function A(t,e,n){this.code=N+t,this.message=e||C[t]||"",this.a=n||null}function O(t){var e=t&&t.code;return e?new A(e.substring(N.length),t.message,t.serverResponse):null}T(A,Error),A.prototype.w=function(){var t={code:this.code,message:this.message};return this.a&&(t.serverResponse=this.a),t},A.prototype.toJSON=function(){return this.w()};var x,N="auth/",C={"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 always 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.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","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."},D={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 P(t){for(var e in D)if(D[e].id===t)return{firebaseEndpoint:(t=D[e]).Ua,secureTokenEndpoint:t.$a,identityPlatformEndpoint:t.Xa};return null}function R(t){if(!t)return!1;try{return!!t.$goog_Thenable}catch(t){return!1}}function L(t){if(Error.captureStackTrace)Error.captureStackTrace(this,L);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function j(t,e){for(var n="",r=(t=t.split("%s")).length-1,i=0;i<r;i++)n+=t[i]+(i<e.length?e[i]:"%s");L.call(this,n+t[r])}function M(t,e){throw new j("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function F(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function U(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function V(){this.b=this.a=null}x=P("__EID__")?"__EID__":void 0,T(L,Error),L.prototype.name="CustomError",T(j,L),j.prototype.name="AssertionError",F.prototype.get=function(){if(0<this.b){this.b--;var t=this.a;this.a=t.next,t.next=null}else t=this.c();return t};var q=new F((function(){return new G}),(function(t){t.reset()}));function B(){var t=we,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function G(){this.next=this.b=this.a=null}V.prototype.add=function(t,e){var n=q.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},G.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},G.prototype.reset=function(){this.next=this.b=this.a=null};var K=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"==typeof t)return"string"!=typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},H=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"==typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)},W=Array.prototype.filter?function(t,e){return Array.prototype.filter.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=[],i=0,o="string"==typeof t?t.split(""):t,a=0;a<n;a++)if(a in o){var s=o[a];e.call(void 0,s,a,t)&&(r[i++]=s)}return r},z=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=Array(n),i="string"==typeof t?t.split(""):t,o=0;o<n;o++)o in i&&(r[o]=e.call(void 0,i[o],o,t));return r},J=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,r="string"==typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t))return!0;return!1};function Q(t,e){return 0<=K(t,e)}function X(t,e){var n;return(n=0<=(e=K(t,e)))&&Array.prototype.splice.call(t,e,1),n}function Y(t,e){!function(t,e){for(var n="string"==typeof t?t.split(""):t,r=t.length-1;0<=r;--r)r in n&&e.call(void 0,n[r],r,t)}(t,(function(n,r){e.call(void 0,n,r,t)&&Array.prototype.splice.call(t,r,1).length}))}function Z(t){return Array.prototype.concat.apply([],arguments)}function $(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}var tt,et=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]},nt=/&/g,rt=/</g,it=/>/g,ot=/"/g,at=/'/g,st=/\x00/g,ut=/[\x00&<>"']/;function ct(t,e){return-1!=t.indexOf(e)}function ht(t,e){return t<e?-1:t>e?1:0}t:{var lt=u.navigator;if(lt){var ft=lt.userAgent;if(ft){tt=ft;break t}}tt=""}function pt(t){return ct(tt,t)}function dt(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function vt(t){for(var e in t)return!1;return!0}function yt(t){var e,n={};for(e in t)n[e]=t[e];return n}var mt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function gt(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<mt.length;o++)n=mt[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function bt(t,e){t:{try{var n=t&&t.ownerDocument,r=n&&(n.defaultView||n.parentWindow);if((r=r||u).Element&&r.Location){var i=r;break t}}catch(t){}i=null}if(i&&void 0!==i[e]&&(!t||!(t instanceof i[e])&&(t instanceof i.Location||t instanceof i.Element))){if(y(t))try{var o=t.constructor.displayName||t.constructor.name||Object.prototype.toString.call(t)}catch(t){o="<object could not be stringified>"}else o=void 0===t?"undefined":null===t?"null":typeof t;M("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function wt(t,e){this.a=t===It&&e||"",this.b=St}function _t(t){return t instanceof wt&&t.constructor===wt&&t.b===St?t.a:(M("expected object of type Const, got '"+t+"'"),"type_error:Const")}wt.prototype.ta=!0,wt.prototype.sa=function(){return this.a},wt.prototype.toString=function(){return"Const{"+this.a+"}"};var Et,St={},It={};function Tt(){if(void 0===Et){var t=null,e=u.trustedTypes;if(e&&e.createPolicy){try{t=e.createPolicy("goog#html",{createHTML:k,createScript:k,createScriptURL:k})}catch(t){u.console&&u.console.error(t.message)}Et=t}else Et=t}return Et}function kt(t,e){this.a=e===Ct?t:""}function At(t){return t instanceof kt&&t.constructor===kt?t.a:(M("expected object of type TrustedResourceUrl, got '"+t+"' of type "+p(t)),"type_error:TrustedResourceUrl")}function Ot(t,e){var n=_t(t);if(!Nt.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return function(t){var e=Tt();return new kt(t=e?e.createScriptURL(t):t,Ct)}(t=n.replace(xt,(function(t,r){if(!Object.prototype.hasOwnProperty.call(e,r))throw Error('Found marker, "'+r+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return(t=e[r])instanceof wt?_t(t):encodeURIComponent(String(t))})))}kt.prototype.ta=!0,kt.prototype.sa=function(){return this.a.toString()},kt.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var xt=/%{(\w+)}/g,Nt=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Ct={};function Dt(t,e){this.a=e===Ut?t:""}function Pt(t){return t instanceof Dt&&t.constructor===Dt?t.a:(M("expected object of type SafeUrl, got '"+t+"' of type "+p(t)),"type_error:SafeUrl")}Dt.prototype.ta=!0,Dt.prototype.sa=function(){return this.a.toString()},Dt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Rt=/^(?: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,Lt=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,jt=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function Mt(t){if(t instanceof Dt)return t;if(t="object"==typeof t&&t.ta?t.sa():String(t),jt.test(t))t=new Dt(t,Ut);else{var e=(t=(t=String(t)).replace(/(%0A|%0D)/g,"")).match(Lt);t=e&&Rt.test(e[1])?new Dt(t,Ut):null}return t}function Ft(t){return t instanceof Dt?t:(t="object"==typeof t&&t.ta?t.sa():String(t),jt.test(t)||(t="about:invalid#zClosurez"),new Dt(t,Ut))}var Ut={},Vt=new Dt("about:invalid#zClosurez",Ut);function qt(t,e,n){this.a=n===Bt?t:""}qt.prototype.ta=!0,qt.prototype.sa=function(){return this.a.toString()},qt.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Bt={};function Gt(t,e,n,r){return t=t instanceof Dt?t:Ft(t),e=e||u,n=n instanceof wt?_t(n):n||"",e.open(Pt(t),n,r,void 0)}function Kt(t,e){for(var n=t.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")}function Ht(t){return ut.test(t)&&(-1!=t.indexOf("&")&&(t=t.replace(nt,"&amp;")),-1!=t.indexOf("<")&&(t=t.replace(rt,"&lt;")),-1!=t.indexOf(">")&&(t=t.replace(it,"&gt;")),-1!=t.indexOf('"')&&(t=t.replace(ot,"&quot;")),-1!=t.indexOf("'")&&(t=t.replace(at,"&#39;")),-1!=t.indexOf("\0")&&(t=t.replace(st,"&#0;"))),t}function Wt(t){return Wt[" "](t),t}Wt[" "]=f;var zt,Jt,Qt=pt("Opera"),Xt=pt("Trident")||pt("MSIE"),Yt=pt("Edge"),Zt=Yt||Xt,$t=pt("Gecko")&&!(ct(tt.toLowerCase(),"webkit")&&!pt("Edge"))&&!(pt("Trident")||pt("MSIE"))&&!pt("Edge"),te=ct(tt.toLowerCase(),"webkit")&&!pt("Edge");function ee(){var t=u.document;return t?t.documentMode:void 0}t:{var ne="",re=(Jt=tt,$t?/rv:([^\);]+)(\)|;)/.exec(Jt):Yt?/Edge\/([\d\.]+)/.exec(Jt):Xt?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Jt):te?/WebKit\/(\S+)/.exec(Jt):Qt?/(?:Version)[ \/]?(\S+)/.exec(Jt):void 0);if(re&&(ne=re?re[1]:""),Xt){var ie=ee();if(null!=ie&&ie>parseFloat(ne)){zt=String(ie);break t}}zt=ne}var oe,ae={};function se(t){return function(t,e){var n=ae;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e()}(t,(function(){for(var e=0,n=et(String(zt)).split("."),r=et(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=ht(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||ht(0==a[2].length,0==s[2].length)||ht(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}u.document&&Xt?oe=ee()||parseInt(zt,10)||void 0:oe=void 0;var ue=oe;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch(Jt){}var ce=!Xt||9<=Number(ue);function he(t){var e=document;return"string"==typeof t?e.getElementById(t):t}function le(t,e){dt(e,(function(e,n){e&&"object"==typeof e&&e.ta&&(e=e.sa()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:de.hasOwnProperty(n)?t.setAttribute(de[n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e}))}var fe,pe,de={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 ve(t,e,n){function r(n){n&&e.appendChild("string"==typeof n?t.createTextNode(n):n)}for(var i=2;i<n.length;i++){var o=n[i];if(!d(o)||y(o)&&0<o.nodeType)r(o);else{t:{if(o&&"number"==typeof o.length){if(y(o)){var a="function"==typeof o.item||"string"==typeof o.item;break t}if(v(o)){a="function"==typeof o.item;break t}}a=!1}H(a?$(o):o,r)}}}function ye(t,e){return e=String(e),"application/xhtml+xml"===t.contentType&&(e=e.toLowerCase()),t.createElement(e)}function me(t){u.setTimeout((function(){throw t}),0)}function ge(t,e){pe||function(){if(u.Promise&&u.Promise.resolve){var t=u.Promise.resolve(void 0);pe=function(){t.then(_e)}}else pe=function(){var t=_e;!v(u.setImmediate)||u.Window&&u.Window.prototype&&!pt("Edge")&&u.Window.prototype.setImmediate==u.setImmediate?(fe||(fe=function(){var t=u.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!pt("Presto")&&(t=function(){var t=ye(document,"IFRAME");t.style.display="none",document.documentElement.appendChild(t);var e=t.contentWindow;(t=e.document).open(),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=E((function(t){"*"!=r&&t.origin!=r||t.data!=n||this.port1.onmessage()}),this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,r)}}}),void 0!==t&&!pt("Trident")&&!pt("MSIE")){var e=new t,n={},r=n;return e.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).Hb;n.Hb=null,t()}},function(t){r.next={Hb:t},r=r.next,e.port2.postMessage(0)}}return function(t){u.setTimeout(t,0)}}()),fe(t)):u.setImmediate(t)}}(),be||(pe(),be=!0),we.add(t,e)}var be=!1,we=new V;function _e(){for(var t;t=B();){try{t.a.call(t.b)}catch(t){me(t)}U(q,t)}be=!1}function Ee(t,e){if(this.a=Se,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=f)try{var n=this;t.call(e,(function(t){je(n,Ie,t)}),(function(t){if(!(t instanceof Ge))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(t){}je(n,Te,t)}))}catch(t){je(this,Te,t)}}var Se=0,Ie=2,Te=3;function ke(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}ke.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var Ae=new F((function(){return new ke}),(function(t){t.reset()}));function Oe(t,e,n){var r=Ae.get();return r.g=t,r.b=e,r.f=n,r}function xe(t){if(t instanceof Ee)return t;var e=new Ee(f);return je(e,Ie,t),e}function Ne(t){return new Ee((function(e,n){n(t)}))}function Ce(t,e,n){Me(t,e,n,null)||ge(S(e,t))}function De(t){return new Ee((function(e){var n=t.length,r=[];if(n)for(var i=function(t,i,o){n--,r[t]=i?{Qb:!0,value:o}:{Qb:!1,reason:o},0==n&&e(r)},o=0;o<t.length;o++)Ce(t[o],S(i,o,!0),S(i,o,!1));else e(r)}))}function Pe(t,e){if(t.a==Se)if(t.c){var n=t.c;if(n.b){for(var r=0,i=null,o=null,a=n.b;a&&(a.c||(r++,a.a==t&&(i=a),!(i&&1<r)));a=a.next)i||(o=a);i&&(n.a==Se&&1==r?Pe(n,e):(o?((r=o).next==n.f&&(n.f=r),r.next=r.next.next):Ue(n),Ve(n,i,Te,e)))}t.c=null}else je(t,Te,e)}function Re(t,e){t.b||t.a!=Ie&&t.a!=Te||Fe(t),t.f?t.f.next=e:t.b=e,t.f=e}function Le(t,e,n,r){var i=Oe(null,null,null);return i.a=new Ee((function(t,o){i.g=e?function(n){try{var i=e.call(r,n);t(i)}catch(t){o(t)}}:t,i.b=n?function(e){try{var i=n.call(r,e);void 0===i&&e instanceof Ge?o(e):t(i)}catch(t){o(t)}}:o})),i.a.c=t,Re(t,i),i.a}function je(t,e,n){t.a==Se&&(t===n&&(e=Te,n=new TypeError("Promise cannot resolve to itself")),t.a=1,Me(n,t.$c,t.ad,t)||(t.i=n,t.a=e,t.c=null,Fe(t),e!=Te||n instanceof Ge||function(t,e){t.g=!0,ge((function(){t.g&&Be.call(null,e)}))}(t,n)))}function Me(t,e,n,r){if(t instanceof Ee)return Re(t,Oe(e||f,n||null,r)),!0;if(R(t))return t.then(e,n,r),!0;if(y(t))try{var i=t.then;if(v(i))return function(t,e,n,r,i){function o(t){a||(a=!0,r.call(i,t))}var a=!1;try{e.call(t,(function(t){a||(a=!0,n.call(i,t))}),o)}catch(t){o(t)}}(t,i,e,n,r),!0}catch(t){return n.call(r,t),!0}return!1}function Fe(t){t.h||(t.h=!0,ge(t.gc,t))}function Ue(t){var e=null;return t.b&&(e=t.b,t.b=e.next,e.next=null),t.b||(t.f=null),e}function Ve(t,e,n,r){if(n==Te&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,qe(e,n,r);else try{e.c?e.g.call(e.f):qe(e,n,r)}catch(t){Be.call(null,t)}U(Ae,e)}function qe(t,e,n){e==Ie?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}Ee.prototype.then=function(t,e,n){return Le(this,v(t)?t:null,v(e)?e:null,n)},Ee.prototype.$goog_Thenable=!0,(t=Ee.prototype).oa=function(t,e){return(t=Oe(t,t,e)).c=!0,Re(this,t),this},t.o=function(t,e){return Le(this,null,t,e)},t.cancel=function(t){if(this.a==Se){var e=new Ge(t);ge((function(){Pe(this,e)}),this)}},t.$c=function(t){this.a=Se,je(this,Ie,t)},t.ad=function(t){this.a=Se,je(this,Te,t)},t.gc=function(){for(var t;t=Ue(this);)Ve(this,t,this.a,this.i);this.h=!1};var Be=me;function Ge(t){L.call(this,t)}function Ke(){0!=He&&(We[m(this)]=this),this.ya=this.ya,this.pa=this.pa}T(Ge,L),Ge.prototype.name="cancel";var He=0,We={};function ze(t){if(!t.ya&&(t.ya=!0,t.Da(),0!=He)){var e=m(t);if(0!=He&&t.pa&&0<t.pa.length)throw Error(t+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete We[e]}}Ke.prototype.ya=!1,Ke.prototype.Da=function(){if(this.pa)for(;this.pa.length;)this.pa.shift()()};var Je=Object.freeze||function(t){return t},Qe=!Xt||9<=Number(ue),Xe=Xt&&!se("9"),Ye=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{u.addEventListener("test",f,e),u.removeEventListener("test",f,e)}catch(t){}return t}();function Ze(t,e){this.type=t,this.b=this.target=e,this.defaultPrevented=!1}function $e(t,e){if(Ze.call(this,t?t.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,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=e,e=t.relatedTarget){if($t){t:{try{Wt(e.nodeName);var i=!0;break t}catch(t){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"==typeof t.pointerType?t.pointerType:tn[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}Ze.prototype.preventDefault=function(){this.defaultPrevented=!0},T($e,Ze);var tn=Je({2:"touch",3:"pen",4:"mouse"});$e.prototype.preventDefault=function(){$e.bb.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,Xe)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(t){}},$e.prototype.g=function(){return this.a};var en="closure_listenable_"+(1e6*Math.random()|0),nn=0;function rn(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.Wa=i,this.key=++nn,this.wa=this.Qa=!1}function on(t){t.wa=!0,t.listener=null,t.proxy=null,t.src=null,t.Wa=null}function an(t){this.src=t,this.a={},this.b=0}function sn(t,e){var n=e.type;n in t.a&&X(t.a[n],e)&&(on(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function un(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.wa&&o.listener==e&&o.capture==!!n&&o.Wa==r)return i}return-1}an.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var a=un(t,e,r,i);return-1<a?(e=t[a],n||(e.Qa=!1)):((e=new rn(e,this.src,o,!!r,i)).Qa=n,t.push(e)),e};var cn="closure_lm_"+(1e6*Math.random()|0),hn={};function ln(t,e,n,r,i){if(r&&r.once)pn(t,e,n,r,i);else if(Array.isArray(e))for(var o=0;o<e.length;o++)ln(t,e[o],n,r,i);else n=En(n),t&&t[en]?In(t,e,n,y(r)?!!r.capture:!!r,i):fn(t,e,n,!1,r,i)}function fn(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=y(i)?!!i.capture:!!i,s=wn(t);if(s||(t[cn]=s=new an(t)),!(n=s.add(e,n,r,a,o)).proxy)if(r=function(){var t=bn,e=Qe?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)Ye||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(yn(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}}function pn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)pn(t,e[o],n,r,i);else n=En(n),t&&t[en]?Tn(t,e,n,y(r)?!!r.capture:!!r,i):fn(t,e,n,!0,r,i)}function dn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)dn(t,e[o],n,r,i);else r=y(r)?!!r.capture:!!r,n=En(n),t&&t[en]?(t=t.v,(e=String(e).toString())in t.a&&-1<(n=un(o=t.a[e],n,r,i))&&(on(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--))):t&&(t=wn(t))&&(e=t.a[e.toString()],t=-1,e&&(t=un(e,n,r,i)),(n=-1<t?e[t]:null)&&vn(n))}function vn(t){if("number"!=typeof t&&t&&!t.wa){var e=t.src;if(e&&e[en])sn(e.v,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(yn(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=wn(e))?(sn(n,t),0==n.b&&(n.src=null,e[cn]=null)):on(t)}}}function yn(t){return t in hn?hn[t]:hn[t]="on"+t}function mn(t,e,n,r){var i=!0;if((t=wn(t))&&(e=t.a[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.wa&&(o=gn(o,r),i=i&&!1!==o)}return i}function gn(t,e){var n=t.listener,r=t.Wa||t.src;return t.Qa&&vn(t),n.call(r,e)}function bn(t,e){if(t.wa)return!0;if(!Qe){if(!e)t:{e=["window","event"];for(var n=u,r=0;r<e.length;r++)if(null==(n=n[e[r]])){e=null;break t}e=n}if(e=new $e(r=e,this),n=!0,!(0>r.keyCode||null!=r.returnValue)){t:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break t}catch(t){i=!0}(i||null==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=e.b;i;i=i.parentNode)r.push(i);for(t=t.type,i=r.length-1;0<=i;i--){e.b=r[i];var o=mn(r[i],t,!0,e);n=n&&o}for(i=0;i<r.length;i++)e.b=r[i],o=mn(r[i],t,!1,e),n=n&&o}return n}return gn(t,new $e(e,this))}function wn(t){return(t=t[cn])instanceof an?t:null}var _n="__closure_events_fn_"+(1e9*Math.random()>>>0);function En(t){return v(t)?t:(t[_n]||(t[_n]=function(e){return t.handleEvent(e)}),t[_n])}function Sn(){Ke.call(this),this.v=new an(this),this.bc=this,this.hb=null}function In(t,e,n,r,i){t.v.add(String(e),n,!1,r,i)}function Tn(t,e,n,r,i){t.v.add(String(e),n,!0,r,i)}function kn(t,e,n,r){if(!(e=t.v.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.wa&&a.capture==n){var s=a.listener,u=a.Wa||a.src;a.Qa&&sn(t.v,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}function An(t,e,n){if(v(t))n&&(t=E(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=E(t.handleEvent,t)}return 2147483647<Number(e)?-1:u.setTimeout(t,e||0)}function On(t){var e=null;return new Ee((function(n,r){-1==(e=An((function(){n(void 0)}),t))&&r(Error("Failed to schedule timer."))})).o((function(t){throw u.clearTimeout(e),t}))}function xn(t){if(t.X&&"function"==typeof t.X)return t.X();if("string"==typeof t)return t.split("");if(d(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}function Nn(t){if(t.Y&&"function"==typeof t.Y)return t.Y();if(!t.X||"function"!=typeof t.X){if(d(t)||"string"==typeof t){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}for(var r in e=[],n=0,t)e[n++]=r;return e}}function Cn(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof Cn)for(n=t.Y(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Dn(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];Pn(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)Pn(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function Pn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}T(Sn,Ke),Sn.prototype[en]=!0,Sn.prototype.addEventListener=function(t,e,n,r){ln(this,t,e,n,r)},Sn.prototype.removeEventListener=function(t,e,n,r){dn(this,t,e,n,r)},Sn.prototype.dispatchEvent=function(t){var e,n=this.hb;if(n)for(e=[];n;n=n.hb)e.push(n);n=this.bc;var r=t.type||t;if("string"==typeof t)t=new Ze(t,n);else if(t instanceof Ze)t.target=t.target||n;else{var i=t;gt(t=new Ze(r,n),i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var a=t.b=e[o];i=kn(a,r,!0,t)&&i}if(i=kn(a=t.b=n,r,!0,t)&&i,i=kn(a,r,!1,t)&&i,e)for(o=0;o<e.length;o++)i=kn(a=t.b=e[o],r,!1,t)&&i;return i},Sn.prototype.Da=function(){if(Sn.bb.Da.call(this),this.v){var t,e=this.v;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)on(n[r]);delete e.a[t],e.b--}}this.hb=null},(t=Cn.prototype).X=function(){Dn(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},t.Y=function(){return Dn(this),this.a.concat()},t.clear=function(){this.b={},this.c=this.a.length=0},t.get=function(t,e){return Pn(this.b,t)?this.b[t]:e},t.set=function(t,e){Pn(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},t.forEach=function(t,e){for(var n=this.Y(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Rn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Ln(t,e){var n;this.a=this.l=this.c="",this.g=null,this.h=this.f="",this.i=!1,t instanceof Ln?(this.i=void 0!==e?e:t.i,jn(this,t.c),this.l=t.l,this.a=t.a,Mn(this,t.g),this.f=t.f,Fn(this,rr(t.b)),this.h=t.h):t&&(n=String(t).match(Rn))?(this.i=!!e,jn(this,n[1]||"",!0),this.l=Gn(n[2]||""),this.a=Gn(n[3]||"",!0),Mn(this,n[4]),this.f=Gn(n[5]||"",!0),Fn(this,n[6]||"",!0),this.h=Gn(n[7]||"")):(this.i=!!e,this.b=new Yn(null,this.i))}function jn(t,e,n){t.c=n?Gn(e,!0):e,t.c&&(t.c=t.c.replace(/:$/,""))}function Mn(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.g=e}else t.g=null}function Fn(t,e,n){e instanceof Yn?(t.b=e,function(t,e){e&&!t.f&&(Zn(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(tr(this,e),nr(this,n,t))}),t)),t.f=e}(t.b,t.i)):(n||(e=Kn(e,Qn)),t.b=new Yn(e,t.i))}function Un(t,e,n){t.b.set(e,n)}function Vn(t,e){return t.b.get(e)}function qn(t){return t instanceof Ln?new Ln(t):new Ln(t,void 0)}function Bn(t,e,n,r){var i=new Ln(null,void 0);return t&&jn(i,t),e&&(i.a=e),n&&Mn(i,n),r&&(i.f=r),i}function Gn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Kn(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,Hn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Hn(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Ln.prototype.toString=function(){var t=[],e=this.c;e&&t.push(Kn(e,Wn,!0),":");var n=this.a;return(n||"file"==e)&&(t.push("//"),(e=this.l)&&t.push(Kn(e,Wn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.g)&&t.push(":",String(n))),(n=this.f)&&(this.a&&"/"!=n.charAt(0)&&t.push("/"),t.push(Kn(n,"/"==n.charAt(0)?Jn:zn,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.h)&&t.push("#",Kn(n,Xn)),t.join("")},Ln.prototype.resolve=function(t){var e=new Ln(this),n=!!t.c;n?jn(e,t.c):n=!!t.l,n?e.l=t.l:n=!!t.a,n?e.a=t.a:n=null!=t.g;var r=t.f;if(n)Mn(e,t.g);else if(n=!!t.f){if("/"!=r.charAt(0))if(this.a&&!this.f)r="/"+r;else{var i=e.f.lastIndexOf("/");-1!=i&&(r=e.f.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(ct(i,"./")||ct(i,"/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],a=0;a<i.length;){var s=i[a++];"."==s?r&&a==i.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),r&&a==i.length&&o.push("")):(o.push(s),r=!0)}r=o.join("/")}else r=i}return n?e.f=r:n=""!==t.b.toString(),n?Fn(e,rr(t.b)):n=!!t.h,n&&(e.h=t.h),e};var Wn=/[#\/\?@]/g,zn=/[#\?:]/g,Jn=/[#\?]/g,Qn=/[#\?@]/g,Xn=/#/g;function Yn(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function Zn(t){t.a||(t.a=new Cn,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function $n(t){var e=Nn(t);if(void 0===e)throw Error("Keys are undefined");var n=new Yn(null,void 0);t=xn(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];Array.isArray(o)?nr(n,i,o):n.add(i,o)}return n}function tr(t,e){Zn(t),e=ir(t,e),Pn(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,Pn((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Dn(t)))}function er(t,e){return Zn(t),e=ir(t,e),Pn(t.a.b,e)}function nr(t,e,n){tr(t,e),0<n.length&&(t.c=null,t.a.set(ir(t,e),$(n)),t.b+=n.length)}function rr(t){var e=new Yn;return e.c=t.c,t.a&&(e.a=new Cn(t.a),e.b=t.b),e}function ir(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function or(t){var e=[];return sr(new ar,t,e),e.join("")}function ar(){}function sr(t,e,n){if(null==e)n.push("null");else{if("object"==typeof e){if(Array.isArray(e)){var r=e;e=r.length,n.push("[");for(var i="",o=0;o<e;o++)n.push(i),sr(t,r[o],n),i=",";return void n.push("]")}if(!(e instanceof String||e instanceof Number||e instanceof Boolean)){for(r in n.push("{"),i="",e)Object.prototype.hasOwnProperty.call(e,r)&&"function"!=typeof(o=e[r])&&(n.push(i),hr(r,n),n.push(":"),sr(t,o,n),i=",");return void n.push("}")}e=e.valueOf()}switch(typeof e){case"string":hr(e,n);break;case"number":n.push(isFinite(e)&&!isNaN(e)?String(e):"null");break;case"boolean":n.push(String(e));break;case"function":n.push("null");break;default:throw Error("Unknown type: "+typeof e)}}}(t=Yn.prototype).add=function(t,e){Zn(this),this.c=null,t=ir(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},t.clear=function(){this.a=this.c=null,this.b=0},t.forEach=function(t,e){Zn(this),this.a.forEach((function(n,r){H(n,(function(n){t.call(e,n,r,this)}),this)}),this)},t.Y=function(){Zn(this);for(var t=this.a.X(),e=this.a.Y(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},t.X=function(t){Zn(this);var e=[];if("string"==typeof t)er(this,t)&&(e=Z(e,this.a.get(ir(this,t))));else{t=this.a.X();for(var n=0;n<t.length;n++)e=Z(e,t[n])}return e},t.set=function(t,e){return Zn(this),this.c=null,er(this,t=ir(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},t.get=function(t,e){return t&&0<(t=this.X(t)).length?String(t[0]):e},t.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.Y(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.X(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.c=t.join("&")};var ur={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},cr=/\uffff/.test("￿")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function hr(t,e){e.push('"',t.replace(cr,(function(t){var e=ur[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),ur[t]=e),e})),'"')}function lr(){var t=Cr();return Xt&&!!ue&&11==ue||/Edge\/\d+/.test(t)}function fr(){return u.window&&u.window.location.href||self&&self.location&&self.location.href||""}function pr(t,e){e=e||u.window;var n="about:blank";t&&(n=Pt(Mt(t)||Vt)),e.location.href=n}function dr(t,e){var n,r=[];for(n in t)n in e?typeof t[n]!=typeof e[n]?r.push(n):"object"==typeof t[n]&&null!=t[n]&&null!=e[n]?0<dr(t[n],e[n]).length&&r.push(n):t[n]!==e[n]&&r.push(n):r.push(n);for(n in e)n in t||r.push(n);return r}function vr(t){return!!((t=(t||Cr()).toLowerCase()).match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function yr(t){t=t||u.window;try{t.close()}catch(t){}}function mr(t,e,n){var r=Math.floor(1e9*Math.random()).toString();e=e||500,n=n||600;var i=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-e)/2;for(a in e={width:e,height:n,top:0<i?i:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=Cr().toLowerCase(),r&&(e.target=r,ct(n,"crios/")&&(e.target="_blank")),Or(Cr())==kr&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof Dt?n:Mt(void 0!==n.href?n.href:String(n))||Vt,n=t.target||n.target,i=[],t)switch(a){case"width":case"height":case"top":case"left":i.push(a+"="+t[a]);break;case"target":case"noopener":case"noreferrer":break;default:i.push(a+"="+(t[a]?1:0))}var a=i.join(",");if((pt("iPhone")&&!pt("iPod")&&!pt("iPad")||pt("iPad")||pt("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(bt(a=ye(document,"A"),"HTMLAnchorElement"),e=e instanceof Dt?e:Ft(e),a.href=Pt(e),a.setAttribute("target",n),t.noreferrer&&a.setAttribute("rel","noreferrer"),(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,r,1),a.dispatchEvent(t),a={}):t.noreferrer?(a=Gt("",r,n,a),t=Pt(e),a&&(Zt&&ct(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),a.opener=null,t='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+Ht(t)+'">',t=new qt(t=(r=Tt())?r.createHTML(t):t,null,Bt),r=a.document)&&(r.write(function(t){return t instanceof qt&&t.constructor===qt?t.a:(M("expected object of type SafeHtml, got '"+t+"' of type "+p(t)),"type_error:SafeHtml")}(t)),r.close())):(a=Gt(e,r,n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(t){}return a}var gr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,br=/^[^@]+@[^@]+$/;function wr(){var t=null;return new Ee((function(e){"complete"==u.document.readyState?e():(t=function(){e()},pn(window,"load",t))})).o((function(e){throw dn(window,"load",t),e}))}function _r(t){return t=t||Cr(),!("file:"!==jr()&&"ionic:"!==jr()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function Er(){var t=u.window;try{return!(!t||t==t.top)}catch(t){return!1}}function Sr(){return void 0!==u.WorkerGlobalScope&&"function"==typeof u.importScripts}function Ir(){return r.Z.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":r.Z.INTERNAL.hasOwnProperty("node")?"Node":Sr()?"Worker":"Browser"}function Tr(){var t=Ir();return"ReactNative"===t||"Node"===t}var kr="Firefox",Ar="Chrome";function Or(t){var e=t.toLowerCase();return ct(e,"opera/")||ct(e,"opr/")||ct(e,"opios/")?"Opera":ct(e,"iemobile")?"IEMobile":ct(e,"msie")||ct(e,"trident/")?"IE":ct(e,"edge/")?"Edge":ct(e,"firefox/")?kr:ct(e,"silk/")?"Silk":ct(e,"blackberry")?"Blackberry":ct(e,"webos")?"Webos":!ct(e,"safari/")||ct(e,"chrome/")||ct(e,"crios/")||ct(e,"android")?!ct(e,"chrome/")&&!ct(e,"crios/")||ct(e,"edge/")?ct(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":Ar:"Safari"}var xr={md:"FirebaseCore-web",od:"FirebaseUI-web"};function Nr(t,e){e=e||[];var n,r=[],i={};for(n in xr)i[xr[n]]=!0;for(n=0;n<e.length;n++)void 0!==i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),(e=r).length||(e=["FirebaseCore-web"]),"Browser"===(r=Ir())?r=Or(i=Cr()):"Worker"===r&&(r=Or(i=Cr())+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function Cr(){return u.navigator&&u.navigator.userAgent||""}function Dr(t,e){t=t.split("."),e=e||u;for(var n=0;n<t.length&&"object"==typeof e&&null!=e;n++)e=e[t[n]];return n!=t.length&&(e=void 0),e}function Pr(){try{var t=u.localStorage,e=qr();if(t)return t.setItem(e,"1"),t.removeItem(e),!lr()||!!u.indexedDB}catch(t){return Sr()&&!!u.indexedDB}return!1}function Rr(){return(Lr()||"chrome-extension:"===jr()||_r())&&!Tr()&&Pr()&&!Sr()}function Lr(){return"http:"===jr()||"https:"===jr()}function jr(){return u.location&&u.location.protocol||null}function Mr(t){return!vr(t=t||Cr())&&Or(t)!=kr}function Fr(t){return void 0===t?null:or(t)}function Ur(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&null!==t[e]&&void 0!==t[e]&&(n[e]=t[e]);return n}function Vr(t){if(null!==t)return JSON.parse(t)}function qr(t){return t||Math.floor(1e9*Math.random()).toString()}function Br(t){return"Safari"!=Or(t=t||Cr())&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function Gr(){var t=u.___jsl;if(t&&t.H)for(var e in t.H)if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=t.H[e].L.concat(),t.CP)for(var n=0;n<t.CP.length;n++)t.CP[n]=null}function Kr(t,e){if(t>e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=Cr(),e=Ir(),this.b=vr(t)||"ReactNative"===e}function Hr(){var t=u.document;return!t||void 0===t.visibilityState||"visible"==t.visibilityState}function Wr(t){try{var e=new Date(parseInt(t,10));if(!isNaN(e.getTime())&&!/[^0-9]/.test(t))return e.toUTCString()}catch(t){}return null}function zr(){return!(!Dr("fireauth.oauthhelper",u)&&!Dr("fireauth.iframe",u))}Kr.prototype.get=function(){var t=u.navigator;return!t||"boolean"!=typeof t.onLine||!Lr()&&"chrome-extension:"!==jr()&&void 0===t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var Jr,Qr={};function Xr(t){Qr[t]||(Qr[t]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t))}try{var Yr={};Object.defineProperty(Yr,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Yr,"abcd",{configurable:!0,enumerable:!0,value:2}),Jr=2==Yr.abcd}catch(Jt){Jr=!1}function Zr(t,e,n){Jr?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function $r(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&Zr(t,n,e[n])}function ti(t){var e={};return $r(e,t),e}function ei(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)Zr(e,n,ei(t[n]));return e}function ni(t){var e=t&&(t[si]?"phone":null);if(!(e&&t&&t[ai]))throw new A("internal-error","Internal assert: invalid MultiFactorInfo object");Zr(this,"uid",t[ai]),Zr(this,"displayName",t[ii]||null);var n=null;t[oi]&&(n=new Date(t[oi]).toUTCString()),Zr(this,"enrollmentTime",n),Zr(this,"factorId",e)}function ri(t){try{var e=new ui(t)}catch(t){e=null}return e}ni.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var ii="displayName",oi="enrolledAt",ai="mfaEnrollmentId",si="phoneInfo";function ui(t){ni.call(this,t),Zr(this,"phoneNumber",t[si])}function ci(t){var e={},n=t[pi],r=t[vi],i=t[yi];if(t=ri(t[di]),!i||i!=li&&i!=fi&&!n||i==fi&&!r||i==hi&&!t)throw Error("Invalid checkActionCode response!");i==fi?(e[gi]=n||null,e[wi]=n||null,e[mi]=r):(e[gi]=r||null,e[wi]=r||null,e[mi]=n||null),e[bi]=t||null,Zr(this,Ei,i),Zr(this,_i,ei(e))}T(ui,ni),ui.prototype.w=function(){var t=ui.bb.w.call(this);return t.phoneNumber=this.phoneNumber,t};var hi="REVERT_SECOND_FACTOR_ADDITION",li="EMAIL_SIGNIN",fi="VERIFY_AND_CHANGE_EMAIL",pi="email",di="mfaInfo",vi="newEmail",yi="requestType",mi="email",gi="fromEmail",bi="multiFactorInfo",wi="previousEmail",_i="data",Ei="operation";function Si(t){var e=Vn(t=qn(t),Ii)||null,n=Vn(t,Ti)||null,r=Vn(t,Oi)||null;if(r=r&&Ni[r]||null,!e||!n||!r)throw new A("argument-error",Ii+", "+Ti+"and "+Oi+" are required in a valid action code URL.");$r(this,{apiKey:e,operation:r,code:n,continueUrl:Vn(t,ki)||null,languageCode:Vn(t,Ai)||null,tenantId:Vn(t,xi)||null})}var Ii="apiKey",Ti="oobCode",ki="continueUrl",Ai="languageCode",Oi="mode",xi="tenantId",Ni={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:hi,signIn:li,verifyAndChangeEmail:fi,verifyEmail:"VERIFY_EMAIL"};function Ci(t){try{return new Si(t)}catch(t){return null}}function Di(t){var e=t[Mi];if(void 0===e)throw new A("missing-continue-uri");if("string"!=typeof e||"string"==typeof e&&!e.length)throw new A("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[Pi];if(n&&"object"==typeof n){e=n[Vi];var r=n[Fi];if(n=n[Ui],"string"==typeof e&&e.length){if(this.a=e,void 0!==r&&"boolean"!=typeof r)throw new A("argument-error",Fi+" property must be a boolean when specified.");if(this.g=!!r,void 0!==n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new A("argument-error",Ui+" property must be a non empty string when specified.");this.b=n||null}else{if(void 0!==e)throw new A("argument-error",Vi+" property must be a non empty string when specified.");if(void 0!==r||void 0!==n)throw new A("missing-android-pkg-name")}}else if(void 0!==n)throw new A("argument-error",Pi+" property must be a non null object when specified.");if(this.f=null,(e=t[ji])&&"object"==typeof e){if("string"==typeof(e=e[qi])&&e.length)this.f=e;else if(void 0!==e)throw new A("argument-error",qi+" property must be a non empty string when specified.")}else if(void 0!==e)throw new A("argument-error",ji+" property must be a non null object when specified.");if(void 0!==(e=t[Li])&&"boolean"!=typeof e)throw new A("argument-error",Li+" property must be a boolean when specified.");if(this.c=!!e,void 0!==(t=t[Ri])&&("string"!=typeof t||"string"==typeof t&&!t.length))throw new A("argument-error",Ri+" property must be a non empty string when specified.");this.i=t||null}var Pi="android",Ri="dynamicLinkDomain",Li="handleCodeInApp",ji="iOS",Mi="url",Fi="installApp",Ui="minimumVersion",Vi="packageName",qi="bundleId";function Bi(t){var e={};for(var n in e.continueUrl=t.h,e.canHandleCodeInApp=t.c,(e.androidPackageName=t.a)&&(e.androidMinimumVersion=t.b,e.androidInstallApp=t.g),e.iOSBundleId=t.f,e.dynamicLinkDomain=t.i,e)null===e[n]&&delete e[n];return e}var Gi=null;function Ki(t){var e=Wi(t);if(!(e&&e.sub&&e.iss&&e.aud&&e.exp))throw Error("Invalid JWT");this.h=t,this.a=e.exp,this.i=e.sub,t=Date.now()/1e3,this.g=e.iat||(t>this.a?this.a:t),this.b=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.f=e.firebase&&e.firebase.tenant||null,this.c=!!e.is_anonymous||"anonymous"==this.b}function Hi(t){try{return new Ki(t)}catch(t){return null}}function Wi(t){if(!t)return null;if(3!=(t=t.split(".")).length)return null;for(var e=(4-(t=t[1]).length%4)%4,n=0;n<e;n++)t+=".";try{var r=function(t){var e=[];return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=Gi[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}!function(){if(!Gi){Gi={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++)for(var r=t.concat(e[n].split("")),i=0;i<r.length;i++){var o=r[i];void 0===Gi[o]&&(Gi[o]=i)}}}();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),s=n(64);if(64===s&&-1===i)break;e(i<<2|o>>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}(t,(function(t){e.push(t)})),e}(t);for(t=[],n=e=0;e<r.length;){var i=r[e++];if(128>i)t[n++]=String.fromCharCode(i);else if(191<i&&224>i){var o=r[e++];t[n++]=String.fromCharCode((31&i)<<6|63&o)}else if(239<i&&365>i){o=r[e++];var a=r[e++],s=((7&i)<<18|(63&o)<<12|(63&a)<<6|63&r[e++])-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else o=r[e++],a=r[e++],t[n++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}return JSON.parse(t.join(""))}catch(t){}return null}Ki.prototype.T=function(){return this.f},Ki.prototype.l=function(){return this.c},Ki.prototype.toString=function(){return this.h};var zi="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),Ji=["client_id","response_type","scope","redirect_uri","state"],Qi={nd:{Ja:"locale",va:700,ua:600,fa:"facebook.com",Ya:Ji},pd:{Ja:null,va:500,ua:750,fa:"github.com",Ya:Ji},qd:{Ja:"hl",va:515,ua:680,fa:"google.com",Ya:Ji},wd:{Ja:"lang",va:485,ua:705,fa:"twitter.com",Ya:zi},kd:{Ja:"locale",va:640,ua:600,fa:"apple.com",Ya:[]}};function Xi(t){for(var e in Qi)if(Qi[e].fa==t)return Qi[e];return null}function Yi(t){var e={};e["facebook.com"]=no,e["google.com"]=io,e["github.com"]=ro,e["twitter.com"]=oo;var n=t&&t[$i];try{if(n)return e[n]?new e[n](t):new eo(t);if(void 0!==t[Zi])return new to(t)}catch(t){}return null}var Zi="idToken",$i="providerId";function to(t){var e=t[$i];if(!e&&t[Zi]){var n=Hi(t[Zi]);n&&n.b&&(e=n.b)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,void 0!==t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),Zr(this,"providerId",e),Zr(this,"isNewUser",n)}function eo(t){to.call(this,t),Zr(this,"profile",ei((t=Vr(t.rawUserInfo||"{}"))||{}))}function no(t){if(eo.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function ro(t){if(eo.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Zr(this,"username",this.profile&&this.profile.login||null)}function io(t){if(eo.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function oo(t){if(eo.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Zr(this,"username",t.screenName||null)}function ao(t){var e=qn(t),n=Vn(e,"link"),r=Vn(qn(n),"link");return e=Vn(e,"deep_link_id"),Vn(qn(e),"link")||e||r||n||t}function so(t,e){if(!t&&!e)throw new A("internal-error","Internal assert: no raw session string available");if(t&&e)throw new A("internal-error","Internal assert: unable to determine the session type");this.a=t||null,this.b=e||null,this.type=this.a?uo:co}T(eo,to),T(no,eo),T(ro,eo),T(io,eo),T(oo,eo);var uo="enroll",co="signin";function ho(){}function lo(t,e){return t.then((function(t){if(t[$a]){var n=Hi(t[$a]);if(!n||e!=n.i)throw new A("user-mismatch");return t}throw new A("user-mismatch")})).o((function(t){throw t&&t.code&&t.code==N+"user-not-found"?new A("user-mismatch"):t}))}function fo(t,e){if(!e)throw new A("internal-error","failed to construct a credential");this.a=e,Zr(this,"providerId",t),Zr(this,"signInMethod",t)}function po(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function vo(t){if(t&&t.providerId&&t.signInMethod&&0==t.providerId.indexOf("saml.")&&t.pendingToken)try{return new fo(t.providerId,t.pendingToken)}catch(t){}return null}function yo(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&Zr(this,"idToken",e.idToken),e.accessToken&&Zr(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&Zr(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new A("internal-error","failed to construct a credential");Zr(this,"accessToken",e.oauthToken),Zr(this,"secret",e.oauthTokenSecret)}Zr(this,"providerId",t),Zr(this,"signInMethod",n)}function mo(t){var e={};return t.idToken&&(e.id_token=t.idToken),t.accessToken&&(e.access_token=t.accessToken),t.secret&&(e.oauth_token_secret=t.secret),e.providerId=t.providerId,t.nonce&&!t.a&&(e.nonce=t.nonce),e={postBody:$n(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function go(t){if(t&&t.providerId&&t.signInMethod){var e={idToken:t.oauthIdToken,accessToken:t.oauthTokenSecret?null:t.oauthAccessToken,oauthTokenSecret:t.oauthTokenSecret,oauthToken:t.oauthTokenSecret&&t.oauthAccessToken,nonce:t.nonce,pendingToken:t.pendingToken};try{return new yo(t.providerId,e,t.signInMethod)}catch(t){}}return null}function bo(t,e){this.Qc=e||[],$r(this,{providerId:t,isOAuthProvider:!0}),this.Jb={},this.qb=(Xi(t)||{}).Ja||null,this.pb=null}function wo(t){if("string"!=typeof t||0!=t.indexOf("saml."))throw new A("argument-error",'SAML provider IDs must be prefixed with "saml."');bo.call(this,t,[])}function _o(t){bo.call(this,t,Ji),this.a=[]}function Eo(){_o.call(this,"facebook.com")}function So(t){if(!t)throw new A("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return y(t)&&(e=t.accessToken),(new Eo).credential({accessToken:e})}function Io(){_o.call(this,"github.com")}function To(t){if(!t)throw new A("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return y(t)&&(e=t.accessToken),(new Io).credential({accessToken:e})}function ko(){_o.call(this,"google.com"),this.Ca("profile")}function Ao(t,e){var n=t;return y(t)&&(n=t.idToken,e=t.accessToken),(new ko).credential({idToken:n,accessToken:e})}function Oo(){bo.call(this,"twitter.com",zi)}function xo(t,e){var n=t;if(y(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new A("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new yo("twitter.com",n,"twitter.com")}function No(t,e,n){this.a=t,this.f=e,Zr(this,"providerId","password"),Zr(this,"signInMethod",n===Do.EMAIL_LINK_SIGN_IN_METHOD?Do.EMAIL_LINK_SIGN_IN_METHOD:Do.EMAIL_PASSWORD_SIGN_IN_METHOD)}function Co(t){return t&&t.email&&t.password?new No(t.email,t.password,t.signInMethod):null}function Do(){$r(this,{providerId:"password",isOAuthProvider:!1})}function Po(t,e){if(!(e=Ro(e)))throw new A("argument-error","Invalid email link!");return new No(t,e.code,Do.EMAIL_LINK_SIGN_IN_METHOD)}function Ro(t){return(t=Ci(t=ao(t)))&&t.operation===li?t:null}function Lo(t){if(!(t.fb&&t.eb||t.La&&t.ea))throw new A("internal-error");this.a=t,Zr(this,"providerId","phone"),this.fa="phone",Zr(this,"signInMethod","phone")}function jo(t){if(t&&"phone"===t.providerId&&(t.verificationId&&t.verificationCode||t.temporaryProof&&t.phoneNumber)){var e={};return H(["verificationId","verificationCode","temporaryProof","phoneNumber"],(function(n){t[n]&&(e[n]=t[n])})),new Lo(e)}return null}function Mo(t){return t.a.La&&t.a.ea?{temporaryProof:t.a.La,phoneNumber:t.a.ea}:{sessionInfo:t.a.fb,code:t.a.eb}}function Fo(t){try{this.a=t||r.Z.auth()}catch(t){throw new A("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().")}$r(this,{providerId:"phone",isOAuthProvider:!1})}function Uo(t,e){if(!t)throw new A("missing-verification-id");if(!e)throw new A("missing-verification-code");return new Lo({fb:t,eb:e})}function Vo(t){if(t.temporaryProof&&t.phoneNumber)return new Lo({La:t.temporaryProof,ea:t.phoneNumber});var e=t&&t.providerId;if(!e||"password"===e)return null;var n=t&&t.oauthAccessToken,r=t&&t.oauthTokenSecret,i=t&&t.nonce,o=t&&t.oauthIdToken,a=t&&t.pendingToken;try{switch(e){case"google.com":return Ao(o,n);case"facebook.com":return So(n);case"github.com":return To(n);case"twitter.com":return xo(n,r);default:return n||r||o||a?a?0==e.indexOf("saml.")?new fo(e,a):new yo(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new _o(e).credential({idToken:o,accessToken:n,rawNonce:i}):null}}catch(t){return null}}function qo(t){if(!t.isOAuthProvider)throw new A("invalid-oauth-provider")}function Bo(t,e,n,r,i,o,a){if(this.c=t,this.b=e||null,this.g=n||null,this.f=r||null,this.i=o||null,this.h=a||null,this.a=i||null,!this.g&&!this.a)throw new A("invalid-auth-event");if(this.g&&this.a)throw new A("invalid-auth-event");if(this.g&&!this.f)throw new A("invalid-auth-event")}function Go(t){return(t=t||{}).type?new Bo(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&O(t.error),t.postBody,t.tenantId):null}function Ko(){this.b=null,this.a=[]}so.prototype.Ha=function(){return this.a?xe(this.a):xe(this.b)},so.prototype.w=function(){return this.type==uo?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},ho.prototype.ka=function(){},ho.prototype.b=function(){},ho.prototype.c=function(){},ho.prototype.w=function(){},fo.prototype.ka=function(t){return ws(t,po(this))},fo.prototype.b=function(t,e){var n=po(this);return n.idToken=e,_s(t,n)},fo.prototype.c=function(t,e){return lo(Es(t,po(this)),e)},fo.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},yo.prototype.ka=function(t){return ws(t,mo(this))},yo.prototype.b=function(t,e){var n=mo(this);return n.idToken=e,_s(t,n)},yo.prototype.c=function(t,e){return lo(Es(t,mo(this)),e)},yo.prototype.w=function(){var t={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(t.oauthIdToken=this.idToken),this.accessToken&&(t.oauthAccessToken=this.accessToken),this.secret&&(t.oauthTokenSecret=this.secret),this.nonce&&(t.nonce=this.nonce),this.a&&(t.pendingToken=this.a),t},bo.prototype.Ka=function(t){return this.Jb=yt(t),this},T(wo,bo),T(_o,bo),_o.prototype.Ca=function(t){return Q(this.a,t)||this.a.push(t),this},_o.prototype.Rb=function(){return $(this.a)},_o.prototype.credential=function(t,e){var n;if(!(n=y(t)?{idToken:t.idToken||null,accessToken:t.accessToken||null,nonce:t.rawNonce||null}:{idToken:t||null,accessToken:e||null}).idToken&&!n.accessToken)throw new A("argument-error","credential failed: must provide the ID token and/or the access token.");return new yo(this.providerId,n,this.providerId)},T(Eo,_o),Zr(Eo,"PROVIDER_ID","facebook.com"),Zr(Eo,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),T(Io,_o),Zr(Io,"PROVIDER_ID","github.com"),Zr(Io,"GITHUB_SIGN_IN_METHOD","github.com"),T(ko,_o),Zr(ko,"PROVIDER_ID","google.com"),Zr(ko,"GOOGLE_SIGN_IN_METHOD","google.com"),T(Oo,bo),Zr(Oo,"PROVIDER_ID","twitter.com"),Zr(Oo,"TWITTER_SIGN_IN_METHOD","twitter.com"),No.prototype.ka=function(t){return this.signInMethod==Do.EMAIL_LINK_SIGN_IN_METHOD?ru(t,Ns,{email:this.a,oobCode:this.f}):ru(t,Zs,{email:this.a,password:this.f})},No.prototype.b=function(t,e){return this.signInMethod==Do.EMAIL_LINK_SIGN_IN_METHOD?ru(t,Cs,{idToken:e,email:this.a,oobCode:this.f}):ru(t,Ks,{idToken:e,email:this.a,password:this.f})},No.prototype.c=function(t,e){return lo(this.ka(t),e)},No.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},$r(Do,{PROVIDER_ID:"password"}),$r(Do,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),$r(Do,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Lo.prototype.ka=function(t){return t.gb(Mo(this))},Lo.prototype.b=function(t,e){var n=Mo(this);return n.idToken=e,ru(t,tu,n)},Lo.prototype.c=function(t,e){var n=Mo(this);return n.operation="REAUTH",lo(t=ru(t,eu,n),e)},Lo.prototype.w=function(){var t={providerId:"phone"};return this.a.fb&&(t.verificationId=this.a.fb),this.a.eb&&(t.verificationCode=this.a.eb),this.a.La&&(t.temporaryProof=this.a.La),this.a.ea&&(t.phoneNumber=this.a.ea),t},Fo.prototype.gb=function(t,e){var n=this.a.a;return xe(e.verify()).then((function(r){if("string"!=typeof r)throw new A("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(e.type){case"recaptcha":var i=y(t)?t.session:null,o=y(t)?t.phoneNumber:t;return(i&&i.type==uo?i.Ha().then((function(t){return function(t,e){return ru(t,Ws,e).then((function(t){return t.phoneSessionInfo.sessionInfo}))}(n,{idToken:t,phoneEnrollmentInfo:{phoneNumber:o,recaptchaToken:r}})})):i&&i.type==co?i.Ha().then((function(e){return function(t,e){return ru(t,zs,e).then((function(t){return t.phoneResponseInfo.sessionInfo}))}(n,{mfaPendingCredential:e,mfaEnrollmentId:t.multiFactorHint&&t.multiFactorHint.uid||t.multiFactorUid,phoneSignInInfo:{recaptchaToken:r}})})):function(t,e){return ru(t,Bs,e)}(n,{phoneNumber:o,recaptchaToken:r})).then((function(t){return"function"==typeof e.reset&&e.reset(),t}),(function(t){throw"function"==typeof e.reset&&e.reset(),t}));default:throw new A("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}}))},$r(Fo,{PROVIDER_ID:"phone"}),$r(Fo,{PHONE_SIGN_IN_METHOD:"phone"}),Bo.prototype.getUid=function(){var t=[];return t.push(this.c),this.b&&t.push(this.b),this.f&&t.push(this.f),this.h&&t.push(this.h),t.join("-")},Bo.prototype.T=function(){return this.h},Bo.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()}};var Ho,Wo=null;function zo(t){var e="unauthorized-domain",n=void 0,r=qn(t);t=r.a,"chrome-extension"==(r=r.c)?n=Kt("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.",t):"http"==r||"https"==r?n=Kt("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.",t):e="operation-not-supported-in-this-environment",A.call(this,e,n)}function Jo(t,e,n){A.call(this,t,n),(t=e||{}).Kb&&Zr(this,"email",t.Kb),t.ea&&Zr(this,"phoneNumber",t.ea),t.credential&&Zr(this,"credential",t.credential),t.$b&&Zr(this,"tenantId",t.$b)}function Qo(t){if(t.code){var e=t.code||"";0==e.indexOf(N)&&(e=e.substring(N.length));var n={credential:Vo(t),$b:t.tenantId};if(t.email)n.Kb=t.email;else if(t.phoneNumber)n.ea=t.phoneNumber;else if(!n.credential)return new A(e,t.message||void 0);return new Jo(e,n,t.message)}return null}function Xo(){}function Yo(t){return t.c||(t.c=t.b())}function Zo(){}function $o(t){if(!t.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<e.length;n++){var r=e[n];try{return new ActiveXObject(r),t.f=r}catch(t){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function ta(){}function ea(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseType=this.responseText=this.response="",this.status=-1,this.statusText="",this.a.onload=E(this.qc,this),this.a.onerror=E(this.Tb,this),this.a.onprogress=E(this.rc,this),this.a.ontimeout=E(this.vc,this)}function na(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function ra(t,e,n){this.reset(t,e,n,void 0,void 0)}function ia(t){this.f=t,this.b=this.c=this.a=null}function oa(t,e){this.name=t,this.value=e}T(zo,A),T(Jo,A),Jo.prototype.w=function(){var t={code:this.code,message:this.message};this.email&&(t.email=this.email),this.phoneNumber&&(t.phoneNumber=this.phoneNumber),this.tenantId&&(t.tenantId=this.tenantId);var e=this.credential&&this.credential.w();return e&&gt(t,e),t},Jo.prototype.toJSON=function(){return this.w()},Xo.prototype.c=null,T(Zo,Xo),Zo.prototype.a=function(){var t=$o(this);return t?new ActiveXObject(t):new XMLHttpRequest},Zo.prototype.b=function(){var t={};return $o(this)&&(t[0]=!0,t[1]=!0),t},Ho=new Zo,T(ta,Xo),ta.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new ea;throw Error("Unsupported browser")},ta.prototype.b=function(){return{}},(t=ea.prototype).open=function(t,e,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(t,e)},t.send=function(t){if(t){if("string"!=typeof t)throw Error("Only string data is supported");this.a.send(t)}else this.a.send()},t.abort=function(){this.a.abort()},t.setRequestHeader=function(){},t.getResponseHeader=function(t){return"content-type"==t.toLowerCase()?this.a.contentType:""},t.qc=function(){this.status=200,this.response=this.responseText=this.a.responseText,na(this,4)},t.Tb=function(){this.status=500,this.response=this.responseText="",na(this,4)},t.vc=function(){this.Tb()},t.rc=function(){this.status=200,na(this,1)},t.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},ra.prototype.a=null,ra.prototype.reset=function(t,e,n,r,i){r||I(),delete this.a},oa.prototype.toString=function(){return this.name};var aa=new oa("SEVERE",1e3),sa=new oa("WARNING",900),ua=new oa("CONFIG",700),ca=new oa("FINE",500);function ha(t){return t.c?t.c:t.a?ha(t.a):(M("Root logger has no level set."),null)}ia.prototype.log=function(t,e,n){if(t.value>=ha(this).value)for(v(e)&&(e=e()),t=new ra(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var la={},fa=null;function pa(t){var e;if(fa||(fa=new ia(""),la[""]=fa,fa.c=ua),!(e=la[t])){e=new ia(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=pa(t.substr(0,n))).b||(n.b={}),n.b[r]=e,e.a=n,la[t]=e}return e}function da(t,e){t&&t.log(ca,e,void 0)}function va(t){this.f=t}function ya(t){Sn.call(this),this.u=t,this.h=void 0,this.readyState=ma,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=pa("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}T(va,Xo),va.prototype.a=function(){return new ya(this.f)},va.prototype.b=function(t){return function(){return t}}({}),T(ya,Sn);var ma=0;function ga(t){t.c.read().then(t.pc.bind(t)).catch(t.Va.bind(t))}function ba(t){t.readyState=4,t.g=null,t.c=null,t.m=null,wa(t)}function wa(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function _a(t){Sn.call(this),this.headers=new Cn,this.D=t||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=Ea,this.u=this.S=!1}(t=ya.prototype).open=function(t,e){if(this.readyState!=ma)throw this.abort(),Error("Error reopening a connection");this.s=t,this.f=e,this.readyState=1,wa(this)},t.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.l,method:this.s,credentials:this.h,cache:void 0};t&&(e.body=t),this.u.fetch(new Request(this.f,e)).then(this.uc.bind(this),this.Va.bind(this))},t.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&&4!=this.readyState&&(this.a=!1,ba(this)),this.readyState=ma},t.uc=function(t){this.a&&(this.g=t,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=t.headers,this.readyState=2,wa(this)),this.a&&(this.readyState=3,wa(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.sc.bind(this),this.Va.bind(this)):void 0!==u.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.m=new TextDecoder,ga(this)):t.text().then(this.tc.bind(this),this.Va.bind(this)))))},t.pc=function(t){if(this.a){var e=this.m.decode(t.value?t.value:new Uint8Array(0),{stream:!t.done});e&&(this.response=this.responseText+=e),t.done?ba(this):wa(this),3==this.readyState&&ga(this)}},t.tc=function(t){this.a&&(this.response=this.responseText=t,ba(this))},t.sc=function(t){this.a&&(this.response=t,ba(this))},t.Va=function(t){var e=this.i;e&&e.log(sa,"Failed to fetch url "+this.f,t instanceof Error?t:Error(t)),this.a&&ba(this)},t.setRequestHeader=function(t,e){this.l.append(t,e)},t.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.i)&&t.log(sa,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")},t.getAllResponseHeaders=function(){if(!this.b){var t=this.i;return t&&t.log(sa,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),""}t=[];for(var e=this.b.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(ya.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(t){this.h=t?"include":"same-origin"}}),T(_a,Sn);var Ea="";_a.prototype.b=pa("goog.net.XhrIo");var Sa=/^https?$/i,Ia=["POST","PUT"];function Ta(t){return"content-type"==t.toLowerCase()}function ka(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,Aa(t),xa(t)}function Aa(t){t.J||(t.J=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function Oa(t){if(t.c&&void 0!==s)if(t.C[1]&&4==Ca(t)&&2==Da(t))da(t.b,Pa(t,"Local request error detected and ignored"));else if(t.i&&4==Ca(t))An(t.Wb,0,t);else if(t.dispatchEvent("readystatechange"),4==Ca(t)){da(t.b,Pa(t,"Request complete")),t.c=!1;try{var e,n=Da(t);t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.l).match(Rn)[1]||null;if(!o&&u.self&&u.self.location){var a=u.self.location.protocol;o=a.substr(0,a.length-1)}i=!Sa.test(o?o.toLowerCase():"")}e=i}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var c=2<Ca(t)?t.a.statusText:""}catch(e){da(t.b,"Can not get status: "+e.message),c=""}t.h=c+" ["+Da(t)+"]",Aa(t)}}finally{xa(t)}}}function xa(t,e){if(t.a){Na(t);var n=t.a,r=t.C[0]?f:null;t.a=null,t.C=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(e){(t=t.b)&&t.log(aa,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}}function Na(t){t.a&&t.u&&(t.a.ontimeout=null),t.s&&(u.clearTimeout(t.s),t.s=null)}function Ca(t){return t.a?t.a.readyState:0}function Da(t){try{return 2<Ca(t)?t.a.status:-1}catch(t){return-1}}function Pa(t,e){return e+" ["+t.P+" "+t.l+" "+Da(t)+"]"}function Ra(t){var e=Ha;this.g=[],this.u=e,this.s=t||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}function La(t,e,n){t.a=!0,t.c=n,t.f=!e,Ua(t)}function ja(t){if(t.a){if(!t.v)throw new Va(t);t.v=!1}}function Ma(t,e,n,r){t.g.push([e,n,r]),t.a&&Ua(t)}function Fa(t){return J(t.g,(function(t){return v(t[1])}))}function Ua(t){if(t.h&&t.a&&Fa(t)){var e=t.h,n=Ga[e];n&&(u.clearTimeout(n.a),delete Ga[e]),t.h=0}t.b&&(t.b.l--,delete t.b),e=t.c;for(var r=n=!1;t.g.length&&!t.i;){var i=t.g.shift(),o=i[0],a=i[1];if(i=i[2],o=t.f?a:o)try{var s=o.call(i||t.s,e);void 0!==s&&(t.f=t.f&&(s==e||s instanceof Error),t.c=e=s),(R(e)||"function"==typeof u.Promise&&e instanceof u.Promise)&&(r=!0,t.i=!0)}catch(r){e=r,t.f=!0,Fa(t)||(n=!0)}}t.c=e,r&&(s=E(t.m,t,!0),r=E(t.m,t,!1),e instanceof Ra?(Ma(e,s,r),e.C=!0):e.then(s,r)),n&&(e=new Ba(e),Ga[e.a]=e,t.h=e.a)}function Va(){L.call(this)}function qa(){L.call(this)}function Ba(t){this.a=u.setTimeout(E(this.c,this),0),this.b=t}(t=_a.prototype).Ma=function(){void 0!==s&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",da(this.b,Pa(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},t.abort=function(){this.a&&this.c&&(da(this.b,Pa(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),xa(this))},t.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),xa(this,!0)),_a.bb.Da.call(this)},t.Wb=function(){this.ya||(this.N||this.i||this.f?Oa(this):this.Jc())},t.Jc=function(){Oa(this)},t.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case Ea:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var t=this.b;return t&&t.log(aa,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(t){return da(this.b,"Can not get response: "+t.message),null}},Ra.prototype.cancel=function(t){if(this.a)this.c instanceof Ra&&this.c.cancel();else{if(this.b){var e=this.b;delete this.b,t?e.cancel(t):(e.l--,0>=e.l&&e.cancel())}this.u?this.u.call(this.s,this):this.v=!0,this.a||(t=new qa(this),ja(this),La(this,!1,t))}},Ra.prototype.m=function(t,e){this.i=!1,La(this,t,e)},Ra.prototype.then=function(t,e,n){var r,i,o=new Ee((function(t,e){r=t,i=e}));return Ma(this,r,(function(t){t instanceof qa?o.cancel():i(t)})),o.then(t,e,n)},Ra.prototype.$goog_Thenable=!0,T(Va,L),Va.prototype.message="Deferred has already fired",Va.prototype.name="AlreadyCalledError",T(qa,L),qa.prototype.message="Deferred was canceled",qa.prototype.name="CanceledError",Ba.prototype.c=function(){throw delete Ga[this.a],this.b};var Ga={};function Ka(t){var e={},n=e.document||document,r=At(t).toString(),i=ye(document,"SCRIPT"),o={Xb:i,Ma:void 0},a=new Ra(o),s=null,c=null!=e.timeout?e.timeout:5e3;return 0<c&&(s=window.setTimeout((function(){Wa(i,!0);var t=new Qa(Ja,"Timeout reached for loading script "+r);ja(a),La(a,!1,t)}),c),o.Ma=s),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Wa(i,e.xd||!1,s),ja(a),La(a,!0,null))},i.onerror=function(){Wa(i,!0,s);var t=new Qa(za,"Error while loading script "+r);ja(a),La(a,!1,t)},gt(o=e.attributes||{},{type:"text/javascript",charset:"UTF-8"}),le(i,o),function(t,e){bt(t,"HTMLScriptElement"),t.src=At(e),(e=t.ownerDocument&&t.ownerDocument.defaultView)&&e!=u?e=l(e.document):(null===h&&(h=l(u.document)),e=h),e&&t.setAttribute("nonce",e)}(i,t),function(t){var e;return(e=(t||document).getElementsByTagName("HEAD"))&&0!=e.length?e[0]:t.documentElement}(n).appendChild(i),a}function Ha(){if(this&&this.Xb){var t=this.Xb;t&&"SCRIPT"==t.tagName&&Wa(t,!0,this.Ma)}}function Wa(t,e,n){null!=n&&u.clearTimeout(n),t.onload=f,t.onerror=f,t.onreadystatechange=f,e&&window.setTimeout((function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),0)}var za=0,Ja=1;function Qa(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),L.call(this,n),this.code=t}function Xa(t){this.f=t}function Ya(t,e,n){if(this.c=t,t=e||{},this.l=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=t.secureTokenTimeout||ts,this.g=yt(t.secureTokenHeaders||es),this.h=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.i=t.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.v=t.firebaseTimeout||ns,this.a=yt(t.firebaseHeaders||rs),n&&(this.a["X-Client-Version"]=n,this.g["X-Client-Version"]=n),n="Node"==Ir(),!(n=u.XMLHttpRequest||n&&r.Z.INTERNAL.node&&r.Z.INTERNAL.node.XMLHttpRequest)&&!Sr())throw new A("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,Sr()?this.f=new va(self):Tr()?this.f=new Xa(n):this.f=new ta,this.b=null}T(Qa,L),T(Xa,Xo),Xa.prototype.a=function(){return new this.f},Xa.prototype.b=function(){return{}};var Za,$a="idToken",ts=new Kr(3e4,6e4),es={"Content-Type":"application/x-www-form-urlencoded"},ns=new Kr(3e4,6e4),rs={"Content-Type":"application/json"};function is(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function os(t,e){e&&(t.l=as("https://securetoken.googleapis.com/v1/token",e),t.h=as("https://www.googleapis.com/identitytoolkit/v3/relyingparty/",e),t.i=as("https://identitytoolkit.googleapis.com/v2/",e))}function as(t,e){return t=qn(t),e=qn(e.url),t.f=t.a+t.f,jn(t,e.c),t.a=e.a,Mn(t,e.g),t.toString()}function ss(t,e){e?(t.a["X-Client-Version"]=e,t.g["X-Client-Version"]=e):(delete t.a["X-Client-Version"],delete t.g["X-Client-Version"])}function us(t,e,n,r,i,o,a){(function(){var t=Cr();return!((t=Or(t)!=Ar?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null)&&30>t||Xt&&ue&&!(9<ue))})()||Sr()?t=E(t.u,t):(Za||(Za=new Ee((function(t,e){!function(t,e){((window.gapi||{}).client||{}).request?t():(u[hs]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))},function(t,e){Ma(t,null,e,void 0)}(Ka(Ot(cs,{onload:hs})),(function(){e(Error("CORS_UNSUPPORTED"))})))}(t,e)}))),t=E(t.s,t)),t(e,n,r,i,o,a)}Ya.prototype.T=function(){return this.b},Ya.prototype.u=function(t,e,n,r,i,o){if(Sr()&&(void 0===u.fetch||void 0===u.Headers||void 0===u.Request))throw new A("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var a=new _a(this.f);if(o){a.g=Math.max(0,o);var s=setTimeout((function(){a.dispatchEvent("timeout")}),o)}In(a,"complete",(function(){s&&clearTimeout(s);var t=null;try{t=JSON.parse(function(t){try{return t.a?t.a.responseText:""}catch(e){return da(t.b,"Can not get responseText: "+e.message),""}}(this))||null}catch(e){t=null}e&&e(t)})),Tn(a,"ready",(function(){s&&clearTimeout(s),ze(this)})),Tn(a,"timeout",(function(){s&&clearTimeout(s),ze(this),e&&e(null)})),function(t,e,n,r,i){if(t.a)throw Error("[goog.net.XhrIo] Object is active with another request="+t.l+"; newUri="+e);n=n?n.toUpperCase():"GET",t.l=e,t.h="",t.P=n,t.J=!1,t.c=!0,t.a=t.D?t.D.a():Ho.a(),t.C=t.D?Yo(t.D):Yo(Ho),t.a.onreadystatechange=E(t.Wb,t);try{da(t.b,Pa(t,"Opening Xhr")),t.N=!0,t.a.open(n,String(e),!0),t.N=!1}catch(e){return da(t.b,Pa(t,"Error opening Xhr: "+e.message)),void ka(t,e)}e=r||"";var o=new Cn(t.headers);i&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(d(t)||"string"==typeof t)H(t,e,void 0);else for(var n=Nn(t),r=xn(t),i=r.length,o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}(i,(function(t,e){o.set(e,t)})),i=function(t){t:{for(var e=Ta,n=t.length,r="string"==typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"==typeof t?t.charAt(e):t[e]}(o.Y()),r=u.FormData&&e instanceof u.FormData,!Q(Ia,n)||i||r||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach((function(t,e){this.a.setRequestHeader(e,t)}),t),t.m&&(t.a.responseType=t.m),"withCredentials"in t.a&&t.a.withCredentials!==t.S&&(t.a.withCredentials=t.S);try{Na(t),0<t.g&&(t.u=function(t){return Xt&&se(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(t.a),da(t.b,Pa(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.u)),t.u?(t.a.timeout=t.g,t.a.ontimeout=E(t.Ma,t)):t.s=An(t.Ma,t.g,t)),da(t.b,Pa(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(e){da(t.b,Pa(t,"Send error: "+e.message)),ka(t,e)}}(a,t,n,r,i)};var cs=new wt(It,"https://apis.google.com/js/client.js?onload=%{onload}"),hs="__fcb"+Math.floor(1e6*Math.random()).toString();function ls(t){if("string"!=typeof(t=t.email)||!br.test(t))throw new A("invalid-email")}function fs(t){"email"in t&&ls(t)}function ps(t){if(!t[$a]){if(t.mfaPendingCredential)throw new A("multi-factor-auth-required",null,yt(t));throw new A("internal-error")}}function ds(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new A("internal-error")}else{if(!t.sessionInfo)throw new A("missing-verification-id");if(!t.code)throw new A("missing-verification-code")}}Ya.prototype.s=function(t,e,n,r,i){var o=this;Za.then((function(){window.gapi.client.setApiKey(o.c);var a=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:t,method:n,body:r,headers:i,authType:"none",callback:function(t){window.gapi.auth.setToken(a),e&&e(t)}})})).o((function(t){e&&e({error:{message:t&&t.message||"CORS_UNSUPPORTED"}})}))},Ya.prototype.Ab=function(){return ru(this,Hs,{})},Ya.prototype.Cb=function(t,e){return ru(this,Gs,{idToken:t,email:e})},Ya.prototype.Db=function(t,e){return ru(this,Ks,{idToken:t,password:e})};var vs={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function ys(t){if(!t.phoneVerificationInfo)throw new A("internal-error");if(!t.phoneVerificationInfo.sessionInfo)throw new A("missing-verification-id");if(!t.phoneVerificationInfo.code)throw new A("missing-verification-code")}function ms(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new A("internal-error")}function gs(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&er(t=new Yn(t.postBody),"nonce")&&(e.nonce=t.get("nonce"))),e}function bs(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=Qo(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=Qo(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=Qo(t)):t.errorMessage&&(e=iu(t.errorMessage)),e)throw e;ps(t)}function ws(t,e){return e.returnIdpCredential=!0,ru(t,Js,e)}function _s(t,e){return e.returnIdpCredential=!0,ru(t,Xs,e)}function Es(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,ru(t,Qs,e)}function Ss(t){if(!t.oobCode)throw new A("invalid-action-code")}(t=Ya.prototype).Eb=function(t,e){var n={idToken:t},r=[];return dt(vs,(function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)})),r.length&&(n.deleteAttribute=r),ru(this,Gs,n)},t.wb=function(t,e){return gt(t={requestType:"PASSWORD_RESET",email:t},e),ru(this,Fs,t)},t.xb=function(t,e){return gt(t={requestType:"EMAIL_SIGNIN",email:t},e),ru(this,Ls,t)},t.vb=function(t,e){return gt(t={requestType:"VERIFY_EMAIL",idToken:t},e),ru(this,js,t)},t.Fb=function(t,e,n){return gt(t={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:t,newEmail:e},n),ru(this,Ms,t)},t.gb=function(t){return ru(this,$s,t)},t.ob=function(t,e){return ru(this,qs,{oobCode:t,newPassword:e})},t.Sa=function(t){return ru(this,Ts,{oobCode:t})},t.kb=function(t){return ru(this,Is,{oobCode:t})};var Is={endpoint:"setAccountInfo",A:Ss,Z:"email",B:!0},Ts={endpoint:"resetPassword",A:Ss,G:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e&&"VERIFY_AND_CHANGE_EMAIL"!=e)throw new A("internal-error")},B:!0},ks={endpoint:"signupNewUser",A:function(t){if(ls(t),!t.password)throw new A("weak-password")},G:ps,V:!0,B:!0},As={endpoint:"createAuthUri",B:!0},Os={endpoint:"deleteAccount",O:["idToken"]},xs={endpoint:"setAccountInfo",O:["idToken","deleteProvider"],A:function(t){if(!Array.isArray(t.deleteProvider))throw new A("internal-error")}},Ns={endpoint:"emailLinkSignin",O:["email","oobCode"],A:ls,G:ps,V:!0,B:!0},Cs={endpoint:"emailLinkSignin",O:["idToken","email","oobCode"],A:ls,G:ps,V:!0},Ds={endpoint:"accounts/mfaEnrollment:finalize",O:["idToken","phoneVerificationInfo"],A:ys,G:ps,B:!0,Na:!0},Ps={endpoint:"accounts/mfaSignIn:finalize",O:["mfaPendingCredential","phoneVerificationInfo"],A:ys,G:ps,B:!0,Na:!0},Rs={endpoint:"getAccountInfo"},Ls={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new A("internal-error");ls(t)},Z:"email",B:!0},js={endpoint:"getOobConfirmationCode",O:["idToken","requestType"],A:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new A("internal-error")},Z:"email",B:!0},Ms={endpoint:"getOobConfirmationCode",O:["idToken","newEmail","requestType"],A:function(t){if("VERIFY_AND_CHANGE_EMAIL"!=t.requestType)throw new A("internal-error")},Z:"email",B:!0},Fs={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(t){if("PASSWORD_RESET"!=t.requestType)throw new A("internal-error");ls(t)},Z:"email",B:!0},Us={mb:!0,endpoint:"getProjectConfig",Vb:"GET"},Vs={mb:!0,endpoint:"getRecaptchaParam",Vb:"GET",G:function(t){if(!t.recaptchaSiteKey)throw new A("internal-error")}},qs={endpoint:"resetPassword",A:Ss,Z:"email",B:!0},Bs={endpoint:"sendVerificationCode",O:["phoneNumber","recaptchaToken"],Z:"sessionInfo",B:!0},Gs={endpoint:"setAccountInfo",O:["idToken"],A:fs,V:!0},Ks={endpoint:"setAccountInfo",O:["idToken"],A:function(t){if(fs(t),!t.password)throw new A("weak-password")},G:ps,V:!0},Hs={endpoint:"signupNewUser",G:ps,V:!0,B:!0},Ws={endpoint:"accounts/mfaEnrollment:start",O:["idToken","phoneEnrollmentInfo"],A:function(t){if(!t.phoneEnrollmentInfo)throw new A("internal-error");if(!t.phoneEnrollmentInfo.phoneNumber)throw new A("missing-phone-number");if(!t.phoneEnrollmentInfo.recaptchaToken)throw new A("missing-app-credential")},G:function(t){if(!t.phoneSessionInfo||!t.phoneSessionInfo.sessionInfo)throw new A("internal-error")},B:!0,Na:!0},zs={endpoint:"accounts/mfaSignIn:start",O:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(t){if(!t.phoneSignInInfo||!t.phoneSignInInfo.recaptchaToken)throw new A("missing-app-credential")},G:function(t){if(!t.phoneResponseInfo||!t.phoneResponseInfo.sessionInfo)throw new A("internal-error")},B:!0,Na:!0},Js={endpoint:"verifyAssertion",A:ms,Za:gs,G:bs,V:!0,B:!0},Qs={endpoint:"verifyAssertion",A:ms,Za:gs,G:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new A("user-not-found");if(t.errorMessage)throw iu(t.errorMessage);ps(t)},V:!0,B:!0},Xs={endpoint:"verifyAssertion",A:function(t){if(ms(t),!t.idToken)throw new A("internal-error")},Za:gs,G:bs,V:!0},Ys={endpoint:"verifyCustomToken",A:function(t){if(!t.token)throw new A("invalid-custom-token")},G:ps,V:!0,B:!0},Zs={endpoint:"verifyPassword",A:function(t){if(ls(t),!t.password)throw new A("wrong-password")},G:ps,V:!0,B:!0},$s={endpoint:"verifyPhoneNumber",A:ds,G:ps,B:!0},tu={endpoint:"verifyPhoneNumber",A:function(t){if(!t.idToken)throw new A("internal-error");ds(t)},G:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",Qo(t);ps(t)}},eu={Ib:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:ds,G:ps,B:!0},nu={endpoint:"accounts/mfaEnrollment:withdraw",O:["idToken","mfaEnrollmentId"],G:function(t){if(!!t[$a]^!!t.refreshToken)throw new A("internal-error")},B:!0,Na:!0};function ru(t,e,n){if(!function(t,e){if(!e||!e.length)return!0;if(!t)return!1;for(var n=0;n<e.length;n++){var r=t[e[n]];if(null==r||""===r)return!1}return!0}(n,e.O))return Ne(new A("internal-error"));var r,i=!!e.Na,o=e.Vb||"POST";return xe(n).then(e.A).then((function(){return e.V&&(n.returnSecureToken=!0),e.B&&t.b&&void 0===n.tenantId&&(n.tenantId=t.b),function(t,e,n,r,i,o,a){var s=qn(e+n);Un(s,"key",t.c),a&&Un(s,"cb",Date.now().toString());var u="GET"==r;if(u)for(var c in i)i.hasOwnProperty(c)&&Un(s,c,i[c]);return new Ee((function(e,n){us(t,s.toString(),(function(t){t?t.error?n(ou(t,o||{})):e(t):n(new A("network-request-failed"))}),r,u?void 0:or(Ur(i)),t.a,t.v.get())}))}(t,i?t.i:t.h,e.endpoint,o,n,e.Ib,e.mb||!1)})).then((function(t){return r=t,e.Za?e.Za(n,r):r})).then(e.G).then((function(){if(!e.Z)return r;if(!(e.Z in r))throw new A("internal-error");return r[e.Z]}))}function iu(t){return ou({error:{errors:[{message:t}],code:400,message:t}})}function ou(t,e){var n=(t.error&&t.error.errors&&t.error.errors[0]||{}).reason||"",r={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=r[n]?new A(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",gt(r={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_NONCE:"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"},e||{}),e=(e=n.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1<e.length?e[1]:void 0,r)if(0===n.indexOf(i))return new A(r[i],e);return!e&&t&&(e=Fr(t)),new A("internal-error",e)}function au(t){this.b=t,this.a=null,this.sb=function(t){return(hu||(hu=new Ee((function(t,e){function n(){Gr(),Dr("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){Gr(),e(Error("Network Error"))},timeout:uu.get()})}if(Dr("gapi.iframes.Iframe"))t();else if(Dr("gapi.load"))n();else{var r="__iframefcb"+Math.floor(1e6*Math.random()).toString();u[r]=function(){Dr("gapi.load")?n():e(Error("Network Error"))},xe(Ka(r=Ot(su,{onload:r}))).o((function(){e(Error("Network Error"))}))}})).o((function(t){throw hu=null,t})))).then((function(){return new Ee((function(e,n){Dr("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:Dr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},(function(r){function i(){clearTimeout(o),e()}t.a=r,t.a.restyle({setHideOnLeave:!1});var o=setTimeout((function(){n(Error("Network Error"))}),cu.get());r.ping(i).then(i,(function(){n(Error("Network Error"))}))}))}))}))}(this)}var su=new wt(It,"https://apis.google.com/js/api.js?onload=%{onload}"),uu=new Kr(3e4,6e4),cu=new Kr(5e3,15e3),hu=null;function lu(t,e,n,r){this.l=t,this.h=e,this.i=n,this.g=r,this.f=null,t=this.g?Bn((t=qn(this.g.url)).c,t.a,t.g,"/emulator/auth/iframe"):Bn("https",this.l,null,"/__/auth/iframe"),this.a=t,Un(this.a,"apiKey",this.h),Un(this.a,"appName",this.i),this.b=null,this.c=[]}function fu(t,e,n,r,i,o){this.u=t,this.s=e,this.c=n,this.m=r,this.v=o,this.i=this.g=this.l=null,this.a=i,this.h=this.f=null}function pu(t){try{return r.Z.app(t).auth().Ga()}catch(t){return[]}}function du(t,e,n,r,i,o){this.s=t,this.g=e,this.b=n,this.f=o,this.c=r||null,this.i=i||null,this.l=this.u=this.C=null,this.h=[],this.m=this.a=null}function vu(t){var e=fr();return function(t){return ru(t,Us,{}).then((function(t){return t.authorizedDomains||[]}))}(t).then((function(t){t:{var n=qn(e),r=n.c;n=n.a;for(var i=0;i<t.length;i++){var o=t[i],a=n,s=r;if(0==o.indexOf("chrome-extension://")?a=qn(o).a==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:gr.test(o)?a=a==o:(o=o.split(".").join("\\."),a=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)),a){t=!0;break t}}t=!1}if(!t)throw new zo(fr())}))}function yu(t){return t.m||(t.m=wr().then((function(){if(!t.u){var e=t.c,n=t.i,r=pu(t.b),i=new lu(t.s,t.g,t.b,t.f);i.f=e,i.b=n,i.c=$(r||[]),t.u=i.toString()}t.v=new au(t.u),function(t){if(!t.v)throw Error("IfcHandler must be initialized!");!function(t,e){t.sb.then((function(){t.a.register("authEvent",e,Dr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}(t.v,(function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=Go(e.authEvent),n=0;n<t.h.length;n++)r=t.h[n](e)||r;return(n={}).status=r?"ACK":"ERROR",xe(n)}return n.status="ERROR",xe(n)}))}(t)}))),t.m}function mu(t){return t.l||(t.C=t.c?Nr(t.c,pu(t.b)):null,t.l=new Ya(t.g,P(t.i),t.C),t.f&&os(t.l,t.f)),t.l}function gu(t,e,n,r,i,o,a,s,u,c,h,l){return(t=new fu(t,e,n,r,i,l)).l=o,t.g=a,t.i=s,t.b=yt(u||null),t.f=c,t.zb(h).toString()}function bu(t){if(this.a=t||r.Z.INTERNAL.reactNative&&r.Z.INTERNAL.reactNative.AsyncStorage,!this.a)throw new A("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function wu(t){this.b=t,this.a={},this.f=E(this.c,this)}lu.prototype.toString=function(){return this.f?Un(this.a,"v",this.f):tr(this.a.b,"v"),this.b?Un(this.a,"eid",this.b):tr(this.a.b,"eid"),this.c.length?Un(this.a,"fw",this.c.join(",")):tr(this.a.b,"fw"),this.a.toString()},fu.prototype.zb=function(t){return this.h=t,this},fu.prototype.toString=function(){if(this.v){var t=qn(this.v.url);t=Bn(t.c,t.a,t.g,"/emulator/auth/handler")}else t=Bn("https",this.u,null,"/__/auth/handler");if(Un(t,"apiKey",this.s),Un(t,"appName",this.c),Un(t,"authType",this.m),this.a.isOAuthProvider){var e=this.a;try{var n=r.Z.app(this.c).auth().la()}catch(t){n=null}for(var i in e.pb=n,Un(t,"providerId",this.a.providerId),e=Ur((n=this.a).Jb))e[i]=e[i].toString();i=n.Qc,e=yt(e);for(var o=0;o<i.length;o++){var a=i[o];a in e&&delete e[a]}n.qb&&n.pb&&!e[n.qb]&&(e[n.qb]=n.pb),vt(e)||Un(t,"customParameters",Fr(e))}if("function"==typeof this.a.Rb&&(n=this.a.Rb()).length&&Un(t,"scopes",n.join(",")),this.l?Un(t,"redirectUrl",this.l):tr(t.b,"redirectUrl"),this.g?Un(t,"eventId",this.g):tr(t.b,"eventId"),this.i?Un(t,"v",this.i):tr(t.b,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!Vn(t,s)&&Un(t,s,this.b[s]);return this.h?Un(t,"tid",this.h):tr(t.b,"tid"),this.f?Un(t,"eid",this.f):tr(t.b,"eid"),(s=pu(this.c)).length&&Un(t,"fw",s.join(",")),t.toString()},(t=du.prototype).Pb=function(t,e,n){var r=new A("popup-closed-by-user"),i=new A("web-storage-unsupported"),o=this,a=!1;return this.ma().then((function(){(function(t){var e={type:"webStorageSupport"};return yu(t).then((function(){return function(t,e){return t.sb.then((function(){return new Ee((function(n){t.a.send(e.type,e,n,Dr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}))}(t.v,e)})).then((function(t){if(t&&t.length&&void 0!==t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()}))})(o).then((function(n){n||(t&&yr(t),e(i),a=!0)}))})).o((function(){})).then((function(){if(!a)return function(t){return new Ee((function(e){return function n(){On(2e3).then((function(){if(t&&!t.closed)return n();e()}))}()}))}(t)})).then((function(){if(!a)return On(n).then((function(){e(r)}))}))},t.Yb=function(){var t=Cr();return!Mr(t)&&!Br(t)},t.Ub=function(){return!1},t.Nb=function(t,e,n,r,i,o,a,s){if(!t)return Ne(new A("popup-blocked"));if(a&&!Mr())return this.ma().o((function(e){yr(t),i(e)})),r(),xe();this.a||(this.a=vu(mu(this)));var u=this;return this.a.then((function(){var e=u.ma().o((function(e){throw yr(t),i(e),e}));return r(),e})).then((function(){qo(n),a||pr(gu(u.s,u.g,u.b,e,n,null,o,u.c,void 0,u.i,s,u.f),t)})).o((function(t){throw"auth/network-request-failed"==t.code&&(u.a=null),t}))},t.Ob=function(t,e,n,r){this.a||(this.a=vu(mu(this)));var i=this;return this.a.then((function(){qo(e),pr(gu(i.s,i.g,i.b,t,e,fr(),n,i.c,void 0,i.i,r,i.f))})).o((function(t){throw"auth/network-request-failed"==t.code&&(i.a=null),t}))},t.ma=function(){var t=this;return yu(this).then((function(){return t.v.sb})).o((function(){throw t.a=null,new A("network-request-failed")}))},t.ac=function(){return!0},t.Ea=function(t){this.h.push(t)},t.Ta=function(t){Y(this.h,(function(e){return e==t}))},(t=bu.prototype).get=function(t){return xe(this.a.getItem(t)).then((function(t){return t&&Vr(t)}))},t.set=function(t,e){return xe(this.a.setItem(t,Fr(e)))},t.U=function(t){return xe(this.a.removeItem(t))},t.ca=function(){},t.ia=function(){};var _u,Eu=[];function Su(t,e,n){vt(t.a)&&t.b.addEventListener("message",t.f),void 0===t.a[e]&&(t.a[e]=[]),t.a[e].push(n)}function Iu(t){this.a=t}function Tu(t){this.c=t,this.b=!1,this.a=[]}function ku(t,e,n,r){var i,o,a,s,u=n||{},c=null;if(t.b)return Ne(Error("connection_unavailable"));var h=r?800:50,l="undefined"!=typeof MessageChannel?new MessageChannel:null;return new Ee((function(n,r){l?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),l.port1.start(),a=setTimeout((function(){r(Error("unsupported_event"))}),h),c={messageChannel:l,onMessage:o=function(t){t.data.eventId===i&&("ack"===t.data.status?(clearTimeout(a),s=setTimeout((function(){r(Error("timeout"))}),3e3)):"done"===t.data.status?(clearTimeout(s),void 0!==t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(a),clearTimeout(s),r(Error("invalid_response"))))}},t.a.push(c),l.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:u},[l.port2])):r(Error("connection_unavailable"))})).then((function(e){return Au(t,c),e})).o((function(e){throw Au(t,c),e}))}function Au(t,e){if(e){var n=e.messageChannel,r=e.onMessage;n&&(n.port1.removeEventListener("message",r),n.port1.close()),Y(t.a,(function(t){return t==e}))}}function Ou(){if(!Du())throw new A("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=u.indexedDB,this.type="indexedDB",this.g=this.v=this.f=this.l=null,this.s=!1,this.h=null;var t=this;Sr()&&self?(this.v=function(){var t=Sr()?self:null;if(H(Eu,(function(n){n.b==t&&(e=n)})),!e){var e=new wu(t);Eu.push(e)}return e}(),Su(this.v,"keyChanged",(function(e,n){return Mu(t).then((function(e){return 0<e.length&&H(t.a,(function(t){t(e)})),{keyProcessed:Q(e,n.key)}}))})),Su(this.v,"ping",(function(){return xe(["keyChanged"])}))):function(){var t=u.navigator;return t&&t.serviceWorker?xe().then((function(){return t.serviceWorker.ready})).then((function(t){return t.active||null})).o((function(){return null})):xe(null)}().then((function(e){(t.h=e)&&(t.g=new Tu(new Iu(e)),ku(t.g,"ping",null,!0).then((function(e){e[0].fulfilled&&Q(e[0].value,"keyChanged")&&(t.s=!0)})).o((function(){})))}))}function xu(t){return new Ee((function(e,n){var r=t.m.open("firebaseLocalStorageDb",1);r.onerror=function(t){try{t.preventDefault()}catch(t){}n(Error(t.target.error))},r.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(t){n(t)}},r.onsuccess=function(r){(r=r.target.result).objectStoreNames.contains("firebaseLocalStorage")?e(r):function(t){return new Ee((function(e,n){var r=t.m.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}}))}(t).then((function(){return xu(t)})).then((function(t){e(t)})).o((function(t){n(t)}))}}))}function Nu(t){return t.i||(t.i=xu(t)),t.i}function Cu(t,e){var n=0;return new Ee((function r(i,o){Nu(t).then(e).then(i).o((function(e){if(!(3<++n))return Nu(t).then((function(e){return e.close(),t.i=void 0,r(i,o)})).o((function(t){o(t)}));o(e)}))}))}function Du(){try{return!!u.indexedDB}catch(t){return!1}}function Pu(t){return t.objectStore("firebaseLocalStorage")}function Ru(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function Lu(t){return new Ee((function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}}))}function ju(t,e){return t.g&&t.h&&function(){var t=u.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}()===t.h?ku(t.g,"keyChanged",{key:e},t.s).then((function(){})).o((function(){})):xe()}function Mu(t){return Nu(t).then((function(t){var e=Pu(Ru(t,!1));return e.getAll?Lu(e.getAll()):new Ee((function(t,n){var r=[],i=e.openCursor();i.onsuccess=function(e){(e=e.target.result)?(r.push(e.value),e.continue()):t(r)},i.onerror=function(t){n(t.target.error)}}))})).then((function(e){var n={},r=[];if(0==t.b){for(r=0;r<e.length;r++)n[e[r].fbase_key]=e[r].value;r=dr(t.c,n),t.c=n}return r}))}function Fu(t){t.l&&t.l.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function Uu(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=xe().then((function(){if(Du()){var t=qr(),r="__sak"+t;return _u||(_u=new Ou),(n=_u).set(r,t).then((function(){return n.get(r)})).then((function(e){if(e!==t)throw Error("indexedDB not supported!");return n.U(r)})).then((function(){return n})).o((function(){return e.c}))}return e.c})).then((function(t){return e.type=t.type,t.ca((function(t){H(e.a,(function(e){e(t)}))})),t}))}function Vu(){this.a={},this.type="inMemory"}function qu(){if(!function(){var t="Node"==Ir();if(!(t=Bu()||t&&r.Z.INTERNAL.node&&r.Z.INTERNAL.node.localStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(t){return!1}}()){if("Node"==Ir())throw new A("internal-error","The LocalStorage compatibility library was not found.");throw new A("web-storage-unsupported")}this.a=Bu()||r.Z.INTERNAL.node.localStorage,this.type="localStorage"}function Bu(){try{var t=u.localStorage,e=qr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(t){return null}}function Gu(){this.type="nullStorage"}function Ku(){if(!function(){var t="Node"==Ir();if(!(t=Hu()||t&&r.Z.INTERNAL.node&&r.Z.INTERNAL.node.sessionStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(t){return!1}}()){if("Node"==Ir())throw new A("internal-error","The SessionStorage compatibility library was not found.");throw new A("web-storage-unsupported")}this.a=Hu()||r.Z.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Hu(){try{var t=u.sessionStorage,e=qr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(t){return null}}function Wu(){var t={};t.Browser=Qu,t.Node=Xu,t.ReactNative=Yu,t.Worker=Zu,this.a=t[Ir()]}wu.prototype.c=function(t){var e=t.data.eventType,n=t.data.eventId,r=this.a[e];if(r&&0<r.length){t.ports[0].postMessage({status:"ack",eventId:n,eventType:e,response:null});var i=[];H(r,(function(e){i.push(xe().then((function(){return e(t.origin,t.data.data)})))})),De(i).then((function(r){var i=[];H(r,(function(t){i.push({fulfilled:t.Qb,value:t.value,reason:t.reason?t.reason.message:void 0})})),H(i,(function(t){for(var e in t)void 0===t[e]&&delete t[e]})),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})}))}},Iu.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},Tu.prototype.close=function(){for(;0<this.a.length;)Au(this,this.a[0]);this.b=!0},(t=Ou.prototype).set=function(t,e){var n=this,r=!1;return Cu(this,(function(e){return Lu((e=Pu(Ru(e,!0))).get(t))})).then((function(i){return Cu(n,(function(o){if(o=Pu(Ru(o,!0)),i)return i.value=e,Lu(o.put(i));n.b++,r=!0;var a={};return a.fbase_key=t,a.value=e,Lu(o.add(a))}))})).then((function(){return n.c[t]=e,ju(n,t)})).oa((function(){r&&n.b--}))},t.get=function(t){return Cu(this,(function(e){return Lu(Pu(Ru(e,!1)).get(t))})).then((function(t){return t&&t.value}))},t.U=function(t){var e=this,n=!1;return Cu(this,(function(r){return n=!0,e.b++,Lu(Pu(Ru(r,!0)).delete(t))})).then((function(){return delete e.c[t],ju(e,t)})).oa((function(){n&&e.b--}))},t.ca=function(t){0==this.a.length&&function(t){Fu(t),function e(){t.f=setTimeout((function(){t.l=Mu(t).then((function(e){0<e.length&&H(t.a,(function(t){t(e)}))})).then((function(){e()})).o((function(t){"STOP_EVENT"!=t.message&&e()}))}),800)}()}(this),this.a.push(t)},t.ia=function(t){Y(this.a,(function(e){return e==t})),0==this.a.length&&Fu(this)},(t=Uu.prototype).get=function(t){return this.b.then((function(e){return e.get(t)}))},t.set=function(t,e){return this.b.then((function(n){return n.set(t,e)}))},t.U=function(t){return this.b.then((function(e){return e.U(t)}))},t.ca=function(t){this.a.push(t)},t.ia=function(t){Y(this.a,(function(e){return e==t}))},(t=Vu.prototype).get=function(t){return xe(this.a[t])},t.set=function(t,e){return this.a[t]=e,xe()},t.U=function(t){return delete this.a[t],xe()},t.ca=function(){},t.ia=function(){},(t=qu.prototype).get=function(t){var e=this;return xe().then((function(){return Vr(e.a.getItem(t))}))},t.set=function(t,e){var n=this;return xe().then((function(){var r=Fr(e);null===r?n.U(t):n.a.setItem(t,r)}))},t.U=function(t){var e=this;return xe().then((function(){e.a.removeItem(t)}))},t.ca=function(t){u.window&&ln(u.window,"storage",t)},t.ia=function(t){u.window&&dn(u.window,"storage",t)},(t=Gu.prototype).get=function(){return xe(null)},t.set=function(){return xe()},t.U=function(){return xe()},t.ca=function(){},t.ia=function(){},(t=Ku.prototype).get=function(t){var e=this;return xe().then((function(){return Vr(e.a.getItem(t))}))},t.set=function(t,e){var n=this;return xe().then((function(){var r=Fr(e);null===r?n.U(t):n.a.setItem(t,r)}))},t.U=function(t){var e=this;return xe().then((function(){e.a.removeItem(t)}))},t.ca=function(){},t.ia=function(){};var zu,Ju,Qu={F:qu,cb:Ku},Xu={F:qu,cb:Ku},Yu={F:bu,cb:Gu},Zu={F:qu,cb:Gu},$u={rd:"local",NONE:"none",td:"session"};function tc(){var t=!(Br(Cr())||!Er()),e=Mr(),n=Pr();this.m=t,this.h=e,this.l=n,this.a={},zu||(zu=new Wu),t=zu;try{this.g=!lr()&&zr()||!u.indexedDB?new t.a.F:new Uu(Sr()?new Vu:new t.a.F)}catch(t){this.g=new Vu,this.h=!0}try{this.i=new t.a.cb}catch(t){this.i=new Vu}this.v=new Vu,this.f=E(this.Zb,this),this.b={}}function ec(){return Ju||(Ju=new tc),Ju}function nc(t,e){switch(e){case"session":return t.i;case"none":return t.v;default:return t.g}}function rc(t,e){return"firebase:"+t.name+(e?":"+e:"")}function ic(t,e,n){return n=rc(e,n),"local"==e.F&&(t.b[n]=null),nc(t,e.F).U(n)}function oc(t){t.c&&(clearInterval(t.c),t.c=null)}function ac(t){this.a=t,this.b=ec()}(t=tc.prototype).get=function(t,e){return nc(this,t.F).get(rc(t,e))},t.set=function(t,e,n){var r=rc(t,n),i=this,o=nc(this,t.F);return o.set(r,e).then((function(){return o.get(r)})).then((function(e){"local"==t.F&&(i.b[r]=e)}))},t.addListener=function(t,e,n){t=rc(t,e),this.l&&(this.b[t]=u.localStorage.getItem(t)),vt(this.a)&&(nc(this,"local").ca(this.f),this.h||(lr()||!zr())&&u.indexedDB||!this.l||function(t){oc(t),t.c=setInterval((function(){for(var e in t.a){var n=u.localStorage.getItem(e),r=t.b[e];n!=r&&(t.b[e]=n,n=new $e({type:"storage",key:e,target:window,oldValue:r,newValue:n,a:!0}),t.Zb(n))}}),1e3)}(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(n)},t.removeListener=function(t,e,n){t=rc(t,e),this.a[t]&&(Y(this.a[t],(function(t){return t==n})),0==this.a[t].length&&delete this.a[t]),vt(this.a)&&(nc(this,"local").ia(this.f),oc(this))},t.Zb=function(t){if(t&&t.g){var e=t.a.key;if(null==e)for(var n in this.a){var r=this.b[n];void 0===r&&(r=null);var i=u.localStorage.getItem(n);i!==r&&(this.b[n]=i,this.nb(n))}else if(0==e.indexOf("firebase:")&&this.a[e]){if(void 0!==t.a.a?nc(this,"local").ia(this.f):oc(this),this.m)if(n=u.localStorage.getItem(e),(r=t.a.newValue)!==n)null!==r?u.localStorage.setItem(e,r):u.localStorage.removeItem(e);else if(this.b[e]===r&&void 0===t.a.a)return;var o=this;n=function(){void 0===t.a.a&&o.b[e]===u.localStorage.getItem(e)||(o.b[e]=u.localStorage.getItem(e),o.nb(e))},Xt&&ue&&10==ue&&u.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(n,10):n()}}else H(t,E(this.nb,this))},t.nb=function(t){this.a[t]&&H(this.a[t],(function(t){t()}))};var sc,uc={name:"authEvent",F:"local"};function cc(){this.a=ec()}function hc(t,e){this.b=lc,this.f=u.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=t,this.h=e,this.l=u.Int32Array?new Int32Array(64):Array(64),void 0===sc&&(sc=u.Int32Array?new Int32Array(gc):gc),this.reset()}T(hc,(function(){this.b=-1}));for(var lc=64,fc=lc-1,pc=[],dc=0;dc<fc;dc++)pc[dc]=0;var vc=Z(128,pc);function yc(t){for(var e=t.f,n=t.l,r=0,i=0;i<e.length;)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],i=4*r;for(e=16;64>e;e++){i=0|n[e-15],r=0|n[e-2];var o=(0|n[e-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|n[e-7])+((r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)|0;n[e]=o+a|0}r=0|t.a[0],i=0|t.a[1];var s=0|t.a[2],u=0|t.a[3],c=0|t.a[4],h=0|t.a[5],l=0|t.a[6];for(o=0|t.a[7],e=0;64>e;e++){var f=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&s^i&s)|0;a=(o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0)+((a=(a=c&h^~c&l)+(0|sc[e])|0)+(0|n[e])|0)|0,o=l,l=h,h=c,c=u+a|0,u=s,s=i,i=r,r=a+f|0}t.a[0]=t.a[0]+r|0,t.a[1]=t.a[1]+i|0,t.a[2]=t.a[2]+s|0,t.a[3]=t.a[3]+u|0,t.a[4]=t.a[4]+c|0,t.a[5]=t.a[5]+h|0,t.a[6]=t.a[6]+l|0,t.a[7]=t.a[7]+o|0}function mc(t,e,n){void 0===n&&(n=e.length);var r=0,i=t.c;if("string"==typeof e)for(;r<n;)t.f[i++]=e.charCodeAt(r++),i==t.b&&(yc(t),i=0);else{if(!d(e))throw Error("message must be string or array");for(;r<n;){var o=e[r++];if(!("number"==typeof o&&0<=o&&255>=o&&o==(0|o)))throw Error("message must be a byte array");t.f[i++]=o,i==t.b&&(yc(t),i=0)}}t.c=i,t.g+=n}hc.prototype.reset=function(){this.g=this.c=0,this.a=u.Int32Array?new Int32Array(this.h):$(this.h)};var gc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function bc(){hc.call(this,8,wc)}T(bc,hc);var wc=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function _c(t,e,n,r,i,o){this.v=t,this.i=e,this.l=n,this.m=r||null,this.u=i||null,this.s=o,this.h=e+":"+n,this.C=new cc,this.g=new ac(this.h),this.f=null,this.b=[],this.a=this.c=null}function Ec(t){return new A("invalid-cordova-configuration",t)}function Sc(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(t){}}function Ic(t){return t.f||(t.f=t.ma().then((function(){return new Ee((function(e){t.Ea((function n(r){return e(r),t.Ta(n),!1})),function(t){function e(e){r=!0,i&&i.cancel(),Tc(t).then((function(r){var i=n;if(r&&e&&e.url){var o=null;-1!=(i=ao(e.url)).indexOf("/__/auth/callback")&&(o=(o="object"==typeof(o=Vr(Vn(o=qn(i),"firebaseError")||null))?O(o):null)?new Bo(r.c,r.b,null,null,o,null,r.T()):new Bo(r.c,r.b,i,r.f,null,null,r.T())),i=o||n}Sc(t,i)}))}var n=new Bo("unknown",null,null,null,new A("no-auth-event")),r=!1,i=On(500).then((function(){return Tc(t).then((function(){r||Sc(t,n)}))})),o=u.handleOpenURL;u.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(Dr("BuildInfo.packageName",u).toLowerCase()+"://")&&e({url:t}),"function"==typeof o)try{o(t)}catch(t){console.error(t)}},Wo||(Wo=new Ko),function(t){var e=Wo;e.a.push(t),e.b||(e.b=function(t){for(var n=0;n<e.a.length;n++)e.a[n](t)},"function"==typeof(t=Dr("universalLinks.subscribe",u))&&t(null,e.b))}(e)}(t)}))}))),t.f}function Tc(t){var e=null;return function(t){return t.b.get(uc,t.a).then((function(t){return Go(t)}))}(t.g).then((function(n){return e=n,ic((n=t.g).b,uc,n.a)})).then((function(){return e}))}function kc(t){this.a=t,this.b=ec()}(t=_c.prototype).ma=function(){return this.Ia?this.Ia:this.Ia=(_r(void 0)?wr().then((function(){return new Ee((function(t,e){var n=u.document,r=setTimeout((function(){e(Error("Cordova framework is not ready."))}),1e3);n.addEventListener("deviceready",(function(){clearTimeout(r),t()}),!1)}))})):Ne(Error("Cordova must run in an Android or iOS file scheme."))).then((function(){if("function"!=typeof Dr("universalLinks.subscribe",u))throw Ec("cordova-universal-links-plugin-fix is not installed");if(void 0===Dr("BuildInfo.packageName",u))throw Ec("cordova-plugin-buildinfo is not installed");if("function"!=typeof Dr("cordova.plugins.browsertab.openUrl",u))throw Ec("cordova-plugin-browsertab is not installed");if("function"!=typeof Dr("cordova.InAppBrowser.open",u))throw Ec("cordova-plugin-inappbrowser is not installed")}),(function(){throw new A("cordova-not-ready")}))},t.Pb=function(t,e){return e(new A("operation-not-supported-in-this-environment")),xe()},t.Nb=function(){return Ne(new A("operation-not-supported-in-this-environment"))},t.ac=function(){return!1},t.Yb=function(){return!0},t.Ub=function(){return!0},t.Ob=function(t,e,n,r){if(this.c)return Ne(new A("redirect-operation-pending"));var i=this,o=u.document,a=null,s=null,c=null,h=null;return this.c=xe().then((function(){return qo(e),Ic(i)})).then((function(){return function(t,e,n,r,i){var o=function(){for(var t=20,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}(),a=new Bo(e,r,null,o,new A("no-auth-event"),null,i),s=Dr("BuildInfo.packageName",u);if("string"!=typeof s)throw new A("invalid-cordova-configuration");var c=Dr("BuildInfo.displayName",u),h={};if(Cr().toLowerCase().match(/iphone|ipad|ipod/))h.ibi=s;else{if(!Cr().toLowerCase().match(/android/))return Ne(new A("operation-not-supported-in-this-environment"));h.apn=s}c&&(h.appDisplayName=c),o=function(t){var e=new bc;mc(e,t),t=[];var n=8*e.g;56>e.c?mc(e,vc,56-e.c):mc(e,vc,e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(yc(e),r=n=0;r<e.i;r++)for(var i=24;0<=i;i-=8)t[n++]=e.a[r]>>i&255;return function(t){return z(t,(function(t){return 1<(t=t.toString(16)).length?t:"0"+t})).join("")}(t)}(o),h.sessionId=o;var l=gu(t.v,t.i,t.l,e,n,null,r,t.m,h,t.u,i,t.s);return t.ma().then((function(){var e=t.h;return t.C.a.set(uc,a.w(),e)})).then((function(){var e=Dr("cordova.plugins.browsertab.isAvailable",u);if("function"!=typeof e)throw new A("invalid-cordova-configuration");var n=null;e((function(e){if(e){if("function"!=typeof(n=Dr("cordova.plugins.browsertab.openUrl",u)))throw new A("invalid-cordova-configuration");n(l)}else{if("function"!=typeof(n=Dr("cordova.InAppBrowser.open",u)))throw new A("invalid-cordova-configuration");e=Cr(),t.a=n(l,e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}}))}))}(i,t,e,n,r)})).then((function(){return new Ee((function(t,e){s=function(){var e=Dr("cordova.plugins.browsertab.close",u);return t(),"function"==typeof e&&e(),i.a&&"function"==typeof i.a.close&&(i.a.close(),i.a=null),!1},i.Ea(s),c=function(){a||(a=On(2e3).then((function(){e(new A("redirect-cancelled-by-user"))})))},h=function(){Hr()&&c()},o.addEventListener("resume",c,!1),Cr().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",h,!1)})).o((function(t){return Tc(i).then((function(){throw t}))}))})).oa((function(){c&&o.removeEventListener("resume",c,!1),h&&o.removeEventListener("visibilitychange",h,!1),a&&a.cancel(),s&&i.Ta(s),i.c=null}))},t.Ea=function(t){this.b.push(t),Ic(this).o((function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new Bo("unknown",null,null,null,new A("no-auth-event")),t(e))}))},t.Ta=function(t){Y(this.b,(function(e){return e==t}))};var Ac={name:"pendingRedirect",F:"session"};function Oc(t){return ic(t.b,Ac,t.a)}function xc(t,e,n,r){this.i={},this.u=0,this.D=t,this.v=e,this.m=n,this.J=r,this.h=[],this.f=!1,this.l=E(this.s,this),this.b=new Kc,this.C=new Qc,this.g=new kc(Bc(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=Nc(this.D,this.v,this.m,x,this.J)}function Nc(t,e,n,i,o){var a=r.Z.SDK_VERSION||null;return _r()?new _c(t,e,n,a,i,o):new du(t,e,n,a,i,o)}function Cc(t){t.f||(t.f=!0,t.a.Ea(t.l));var e=t.a;return t.a.ma().o((function(n){throw t.a==e&&t.reset(),n}))}function Dc(t){t.a.Yb()&&Cc(t).o((function(e){var n=new Bo("unknown",null,null,null,new A("operation-not-supported-in-this-environment"));Fc(e)&&t.s(n)})),t.a.Ub()||Hc(t.b)}function Pc(t,e){Q(t.h,e)||t.h.push(e),t.f||function(t){return t.b.get(Ac,t.a).then((function(t){return"pending"==t}))}(t.g).then((function(e){e?Oc(t.g).then((function(){Cc(t).o((function(e){var n=new Bo("unknown",null,null,null,new A("operation-not-supported-in-this-environment"));Fc(e)&&t.s(n)}))})):Dc(t)})).o((function(){Dc(t)}))}function Rc(t,e){Y(t.h,(function(t){return t==e}))}xc.prototype.reset=function(){this.f=!1,this.a.Ta(this.l),this.a=Nc(this.D,this.v,this.m,null,this.J),this.i={}},xc.prototype.s=function(t){if(!t)throw new A("invalid-auth-event");if(6e5<=Date.now()-this.u&&(this.i={},this.u=0),t&&t.getUid()&&this.i.hasOwnProperty(t.getUid()))return!1;for(var e=!1,n=0;n<this.h.length;n++){var r=this.h[n];if(r.Gb(t.c,t.b)){(e=this.c[t.c])&&(e.h(t,r),t&&(t.f||t.b)&&(this.i[t.getUid()]=!0,this.u=Date.now())),e=!0;break}}return Hc(this.b),e};var Lc=new Kr(2e3,1e4),jc=new Kr(3e4,6e4);function Mc(t,e,n,r,i,o,a){return t.a.Nb(e,n,r,(function(){t.f||(t.f=!0,t.a.Ea(t.l))}),(function(){t.reset()}),i,o,a)}function Fc(t){return!(!t||"auth/cordova-not-ready"!=t.code)}function Uc(t,e,n,r,i){var o;return function(t){return t.b.set(Ac,"pending",t.a)}(t.g).then((function(){return t.a.Ob(e,n,r,i).o((function(e){if(Fc(e))throw new A("operation-not-supported-in-this-environment");return o=e,Oc(t.g).then((function(){throw o}))})).then((function(){return t.a.ac()?new Ee((function(){})):Oc(t.g).then((function(){return t.ra()})).then((function(){})).o((function(){}))}))}))}function Vc(t,e,n,r,i){return t.a.Pb(r,(function(t){e.na(n,null,t,i)}),Lc.get())}xc.prototype.ra=function(){return this.b.ra()};var qc={};function Bc(t,e,n){return t=t+":"+e,n&&(t=t+":"+n.url),t}function Gc(t,e,n,r){var i=Bc(e,n,r);return qc[i]||(qc[i]=new xc(t,e,n,r)),qc[i]}function Kc(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Hc(t){t.g||(t.g=!0,Jc(t,!1,null,null))}function Wc(t){t.g&&!t.i&&Jc(t,!1,null,null)}function zc(t,e){if(t.b=function(){return xe(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function Jc(t,e,n,r){e?r?function(t,e){if(t.b=function(){return Ne(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}(t,r):zc(t,n):zc(t,{user:null}),t.f=[],t.c=[]}function Qc(){}function Xc(){this.jb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.jb},set:function(t){this.jb=t},enumerable:!1})}function Yc(t,e){this.a=e,Zr(this,"verificationId",t)}function Zc(t,e,n,r){return new Fo(t).gb(e,n).then((function(t){return new Yc(t,r)}))}function $c(t){var e=Wi(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new A("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");$r(this,{token:t,expirationTime:Wr(1e3*e.exp),authTime:Wr(1e3*e.auth_time),issuedAtTime:Wr(1e3*e.iat),signInProvider:e.firebase&&e.firebase.sign_in_provider?e.firebase.sign_in_provider:null,signInSecondFactor:e.firebase&&e.firebase.sign_in_second_factor?e.firebase.sign_in_second_factor:null,claims:e})}function th(t,e,n){var r=e&&e[nh];if(!r)throw new A("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=t,this.f=yt(e),this.g=n,this.c=new so(null,r),this.b=[];var i=this;H(e[eh]||[],(function(t){(t=ri(t))&&i.b.push(t)})),Zr(this,"auth",this.a),Zr(this,"session",this.c),Zr(this,"hints",this.b)}Kc.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Kc.prototype.h=function(t,e){if(t){this.reset(),this.g=!0;var n=t.c,r=t.b,i=t.a&&"auth/web-storage-unsupported"==t.a.code,o=t.a&&"auth/operation-not-supported-in-this-environment"==t.a.code;this.i=!(!i&&!o),"unknown"!=n||i||o?t.a?(Jc(this,!0,null,t.a),xe()):e.Fa(n,r)?function(t,e,n){n=n.Fa(e.c,e.b);var r=e.g,i=e.f,o=e.i,a=e.T(),s=!!e.c.match(/Redirect$/);n(r,i,a,o).then((function(e){Jc(t,s,e,null)})).o((function(e){Jc(t,s,null,e)}))}(this,t,e):Ne(new A("invalid-auth-event")):(Jc(this,!1,null,null),xe())}else Ne(new A("invalid-auth-event"))},Kc.prototype.ra=function(){var t=this;return new Ee((function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),function(t){var e=new A("timeout");t.a&&t.a.cancel(),t.a=On(jc.get()).then((function(){t.b||(t.g=!0,Jc(t,!0,null,e))}))}(t))}))},Qc.prototype.h=function(t,e){if(t){var n=t.c,r=t.b;t.a?(e.na(t.c,null,t.a,t.b),xe()):e.Fa(n,r)?function(t,e){var n=t.b,r=t.c;e.Fa(r,n)(t.g,t.f,t.T(),t.i).then((function(t){e.na(r,t,null,n)})).o((function(t){e.na(r,null,t,n)}))}(t,e):Ne(new A("invalid-auth-event"))}else Ne(new A("invalid-auth-event"))},Yc.prototype.confirm=function(t){return t=Uo(this.verificationId,t),this.a(t)};var eh="mfaInfo",nh="mfaPendingCredential";function rh(t,e,n,r){A.call(this,"multi-factor-auth-required",r,e),this.b=new th(t,e,n),Zr(this,"resolver",this.b)}function ih(t,e,n){if(t&&y(t.serverResponse)&&"auth/multi-factor-auth-required"===t.code)try{return new rh(e,t.serverResponse,n,t.message)}catch(t){}return null}function oh(){}function ah(t){Zr(this,"factorId",t.fa),this.a=t}function sh(t){if(ah.call(this,t),this.a.fa!=Fo.PROVIDER_ID)throw new A("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential")}function uh(t,e){for(var n in Ze.call(this,t),e)this[n]=e[n]}function ch(t,e){this.a=t,this.b=[],this.c=E(this.yc,this),ln(this.a,"userReloaded",this.c);var n=[];e&&e.multiFactor&&e.multiFactor.enrolledFactors&&H(e.multiFactor.enrolledFactors,(function(t){var e=null,r={};if(t){t.uid&&(r[ai]=t.uid),t.displayName&&(r[ii]=t.displayName),t.enrollmentTime&&(r[oi]=new Date(t.enrollmentTime).toISOString()),t.phoneNumber&&(r[si]=t.phoneNumber);try{e=new ui(r)}catch(t){}t=e}else t=null;t&&n.push(t)})),hh(this,n)}function hh(t,e){t.b=e,Zr(t,"enrolledFactors",e)}function lh(t,e,n){if(this.h=t,this.i=e,this.g=n,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!")}function fh(t,e){t.stop(),t.b=On(function(t,e){return e?(t.a=t.c,t.g()):(e=t.a,t.a*=2,t.a>t.f&&(t.a=t.f),e)}(t,e)).then((function(){return function(){var t=u.document,e=null;return Hr()||!t?xe():new Ee((function(n){e=function(){Hr()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)})).o((function(n){throw t.removeEventListener("visibilitychange",e,!1),n}))}()})).then((function(){return t.h()})).then((function(){fh(t,!0)})).o((function(e){t.i(e)&&fh(t,!1)}))}function ph(t){this.f=t,this.b=this.a=null,this.c=Date.now()}function dh(t,e){void 0===e&&(e=t.b?(e=t.b).a-e.g:0),t.c=Date.now()+1e3*e}function vh(t,e){t.b=Hi(e[$a]||""),t.a=e.refreshToken,dh(t,void 0!==(e=e.expiresIn)?Number(e):void 0)}function yh(t,e){this.a=t||null,this.b=e||null,$r(this,{lastSignInTime:Wr(e||null),creationTime:Wr(t||null)})}function mh(t,e,n,r,i,o){$r(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function gh(t,e,n){this.N=[],this.l=t.apiKey,this.m=t.appName,this.s=t.authDomain||null;var i=r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION):null;this.a=new Ya(this.l,P(x),i),(this.u=t.emulatorConfig||null)&&os(this.a,this.u),this.h=new ph(this.a),Ah(this,e[$a]),vh(this.h,e),Zr(this,"refreshToken",this.h.a),Nh(this,n||{}),Sn.call(this),this.P=!1,this.s&&Rr()&&(this.b=Gc(this.s,this.l,this.m,this.u)),this.W=[],this.i=null,this.D=function(t){return new lh((function(){return t.I(!0)}),(function(t){return!(!t||"auth/network-request-failed"!=t.code)}),(function(){var e=t.h.c-Date.now()-3e5;return 0<e?e:0}))}(this),this.ba=E(this.ib,this);var o=this;this.za=null,this.Pa=function(t){o.xa(t.h)},this.qa=null,this.Ba=function(t){bh(o,t.c)},this.$=null,this.aa=[],this.Oa=function(t){Eh(o,t.f)},this.ja=null,this.S=new ch(this,n),Zr(this,"multiFactor",this.S)}function bh(t,e){t.u=e,os(t.a,e),t.b&&(e=t.b,t.b=Gc(t.s,t.l,t.m,t.u),t.P&&(Rc(e,t),Pc(t.b,t)))}function wh(t,e){t.qa&&dn(t.qa,"languageCodeChanged",t.Pa),(t.qa=e)&&ln(e,"languageCodeChanged",t.Pa)}function _h(t,e){t.$&&dn(t.$,"emulatorConfigChanged",t.Ba),(t.$=e)&&ln(e,"emulatorConfigChanged",t.Ba)}function Eh(t,e){t.aa=e,ss(t.a,r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION,t.aa):null)}function Sh(t,e){t.ja&&dn(t.ja,"frameworkChanged",t.Oa),(t.ja=e)&&ln(e,"frameworkChanged",t.Oa)}function Ih(t){try{return r.Z.app(t.m).auth()}catch(e){throw new A("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.m+"'!")}}function Th(t){t.J||t.D.b||(t.D.start(),dn(t,"tokenChanged",t.ba),ln(t,"tokenChanged",t.ba))}function kh(t){dn(t,"tokenChanged",t.ba),t.D.stop()}function Ah(t,e){t.Aa=e,Zr(t,"_lat",e)}function Oh(t){for(var e=[],n=0;n<t.W.length;n++)e.push(t.W[n](t));return De(e).then((function(){return t}))}function xh(t){t.b&&!t.P&&(t.P=!0,Pc(t.b,t))}function Nh(t,e){$r(t,{uid:e.uid,displayName:e.displayName||null,photoURL:e.photoURL||null,email:e.email||null,emailVerified:e.emailVerified||!1,phoneNumber:e.phoneNumber||null,isAnonymous:e.isAnonymous||!1,tenantId:e.tenantId||null,metadata:new yh(e.createdAt,e.lastLoginAt),providerData:[]}),t.a.b=t.tenantId}function Ch(){}function Dh(t){return xe().then((function(){if(t.J)throw new A("app-deleted")}))}function Ph(t){return z(t.providerData,(function(t){return t.providerId}))}function Rh(t,e){e&&(Lh(t,e.providerId),t.providerData.push(e))}function Lh(t,e){Y(t.providerData,(function(t){return t.providerId==e}))}function jh(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&Zr(t,e,n)}function Mh(t,e){t!=e&&($r(t,{uid:e.uid,displayName:e.displayName,photoURL:e.photoURL,email:e.email,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber,isAnonymous:e.isAnonymous,tenantId:e.tenantId,providerData:[]}),e.metadata?Zr(t,"metadata",function(t){return new yh(t.a,t.b)}(e.metadata)):Zr(t,"metadata",new yh),H(e.providerData,(function(e){Rh(t,e)})),function(t,e){t.b=e.b,t.a=e.a,t.c=e.c}(t.h,e.h),Zr(t,"refreshToken",t.h.a),hh(t.S,e.S.b))}function Fh(t){return t.I().then((function(e){var n=t.isAnonymous;return function(t,e){return ru(t.a,Rs,{idToken:e}).then(E(t.Kc,t))}(t,e).then((function(){return n||jh(t,"isAnonymous",!1),e}))}))}function Uh(t,e){e[$a]&&t.Aa!=e[$a]&&(vh(t.h,e),t.dispatchEvent(new uh("tokenChanged")),Ah(t,e[$a]),jh(t,"refreshToken",t.h.a))}function Vh(t,e){return Fh(t).then((function(){if(Q(Ph(t),e))return Oh(t).then((function(){throw new A("provider-already-linked")}))}))}function qh(t,e,n){return ti({user:t,credential:Vo(e),additionalUserInfo:e=Yi(e),operationType:n})}function Bh(t,e){return Uh(t,e),t.reload().then((function(){return t}))}function Gh(t,e,n,i,o){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));if(t.i&&!o)return Ne(t.i);var a=Xi(n.providerId),s=qr(t.uid+":::"),u=null;(!Mr()||Er())&&t.s&&n.isOAuthProvider&&(u=gu(t.s,t.l,t.m,e,n,null,s,r.Z.SDK_VERSION||null,null,null,t.tenantId,t.u));var c=mr(u,a&&a.va,a&&a.ua);return i=i().then((function(){if(Hh(t),!o)return t.I().then((function(){}))})).then((function(){return Mc(t.b,c,e,n,s,!!u,t.tenantId)})).then((function(){return new Ee((function(n,r){t.na(e,null,new A("cancelled-popup-request"),t.g||null),t.f=n,t.C=r,t.g=s,t.c=Vc(t.b,t,e,c,s)}))})).then((function(t){return c&&yr(c),t?ti(t):null})).o((function(t){throw c&&yr(c),t})),Wh(t,i,o)}function Kh(t,e,n,r,i){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));if(t.i&&!i)return Ne(t.i);var o=null,a=qr(t.uid+":::");return r=r().then((function(){if(Hh(t),!i)return t.I().then((function(){}))})).then((function(){return t.ga=a,Oh(t)})).then((function(e){return t.ha&&(e=(e=t.ha).b.set(Qh,t.w(),e.a)),e})).then((function(){return Uc(t.b,e,n,a,t.tenantId)})).o((function(e){if(o=e,t.ha)return Xh(t.ha);throw o})).then((function(){if(o)throw o})),Wh(t,r,i)}function Hh(t){if(!t.b||!t.P){if(t.b&&!t.P)throw new A("internal-error");throw new A("auth-domain-config-required")}}function Wh(t,e,n){var r=function(t,e,n){return t.i&&!n?(e.cancel(),Ne(t.i)):e.o((function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.i||t.dispatchEvent(new uh("userInvalidated")),t.i=e),e}))}(t,e,n);return t.N.push(r),r.oa((function(){X(t.N,r)})),r.o((function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=ih(e.w(),Ih(t),E(t.jc,t))),n||e}))}function zh(t){if(!t.apiKey)return null;var e={apiKey:t.apiKey,authDomain:t.authDomain,appName:t.appName,emulatorConfig:t.emulatorConfig},n={};if(!t.stsTokenManager||!t.stsTokenManager.accessToken)return null;n[$a]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null;var r=t.stsTokenManager.expirationTime;r&&(n.expiresIn=(r-Date.now())/1e3);var i=new gh(e,n,t);return t.providerData&&H(t.providerData,(function(t){t&&Rh(i,ti(t))})),t.redirectEventId&&(i.ga=t.redirectEventId),i}function Jh(t){this.a=t,this.b=ec()}th.prototype.Rc=function(t){var e=this;return t.tb(this.a.a,this.c).then((function(t){var n=yt(e.f);return delete n[eh],delete n[nh],gt(n,t),e.g(n)}))},T(rh,A),oh.prototype.tb=function(t,e,n){return e.type==uo?function(t,e,n,r){return n.Ha().then((function(n){return n={idToken:n},void 0!==r&&(n.displayName=r),gt(n,{phoneVerificationInfo:Mo(t.a)}),ru(e,Ds,n)}))}(this,t,e,n):function(t,e,n){return n.Ha().then((function(n){return gt(n={mfaPendingCredential:n},{phoneVerificationInfo:Mo(t.a)}),ru(e,Ps,n)}))}(this,t,e)},T(ah,oh),T(sh,ah),T(uh,Ze),(t=ch.prototype).yc=function(t){hh(this,function(t){var e=[];return H(t.mfaInfo||[],(function(t){(t=ri(t))&&e.push(t)})),e}(t.hd))},t.Sb=function(){return this.a.I().then((function(t){return new so(t,null)}))},t.fc=function(t,e){var n=this,r=this.a.a;return this.Sb().then((function(n){return t.tb(r,n,e)})).then((function(t){return Uh(n.a,t),n.a.reload()}))},t.bd=function(t){var e=this,n="string"==typeof t?t:t.uid,r=this.a.a;return this.a.I().then((function(t){return ru(r,nu,{idToken:t,mfaEnrollmentId:n})})).then((function(t){var r=W(e.b,(function(t){return t.uid!=n}));return hh(e,r),Uh(e.a,t),e.a.reload().o((function(t){if("auth/user-token-expired"!=t.code)throw t}))}))},t.w=function(){return{multiFactor:{enrolledFactors:z(this.b,(function(t){return t.w()}))}}},lh.prototype.start=function(){this.a=this.c,fh(this,!0)},lh.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},ph.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}},ph.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?Ne(new A("user-token-expired")):t||!this.b||Date.now()>this.c-3e4?this.a?function(t,e){return function(t,e){return new Ee((function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?us(t,t.l+"?key="+encodeURIComponent(t.c),(function(t){t?t.error?r(ou(t)):t.access_token&&t.refresh_token?n(t):r(new A("internal-error")):r(new A("network-request-failed"))}),"POST",$n(e).toString(),t.g,t.m.get()):r(new A("internal-error"))}))}(t.f,e).then((function(e){return t.b=Hi(e.access_token),t.a=e.refresh_token,dh(t,e.expires_in),{accessToken:t.b.toString(),refreshToken:t.a}})).o((function(e){throw"auth/user-token-expired"==e.code&&(t.a=null),e}))}(this,{grant_type:"refresh_token",refresh_token:this.a}):xe(null):xe({accessToken:this.b.toString(),refreshToken:this.a})},yh.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}},T(gh,Sn),gh.prototype.xa=function(t){this.za=t,is(this.a,t)},gh.prototype.la=function(){return this.za},gh.prototype.Ga=function(){return $(this.aa)},gh.prototype.ib=function(){this.D.b&&(this.D.stop(),this.D.start())},Zr(gh.prototype,"providerId","firebase"),(t=gh.prototype).reload=function(){var t=this;return Wh(this,Dh(this).then((function(){return Fh(t).then((function(){return Oh(t)})).then(Ch)})))},t.oc=function(t){return this.I(t).then((function(t){return new $c(t)}))},t.I=function(t){var e=this;return Wh(this,Dh(this).then((function(){return e.h.getToken(t)})).then((function(t){if(!t)throw new A("internal-error");return t.accessToken!=e.Aa&&(Ah(e,t.accessToken),e.dispatchEvent(new uh("tokenChanged"))),jh(e,"refreshToken",t.refreshToken),t.accessToken})))},t.Kc=function(t){if(!(t=t.users)||!t.length)throw new A("internal-error");Nh(this,{uid:(t=t[0]).localId,displayName:t.displayName,photoURL:t.photoUrl,email:t.email,emailVerified:!!t.emailVerified,phoneNumber:t.phoneNumber,lastLoginAt:t.lastLoginAt,createdAt:t.createdAt,tenantId:t.tenantId});for(var e=function(t){return(t=t.providerUserInfo)&&t.length?z(t,(function(t){return new mh(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)})):[]}(t),n=0;n<e.length;n++)Rh(this,e[n]);jh(this,"isAnonymous",!(this.email&&t.passwordHash||this.providerData&&this.providerData.length)),this.dispatchEvent(new uh("userReloaded",{hd:t}))},t.Lc=function(t){return Xr("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.ub(t)},t.ub=function(t){var e=this,n=null;return Wh(this,t.c(this.a,this.uid).then((function(t){return Uh(e,t),n=qh(e,t,"reauthenticate"),e.i=null,e.reload()})).then((function(){return n})),!0)},t.Cc=function(t){return Xr("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.rb(t)},t.rb=function(t){var e=this,n=null;return Wh(this,Vh(this,t.providerId).then((function(){return e.I()})).then((function(n){return t.b(e.a,n)})).then((function(t){return n=qh(e,t,"link"),Bh(e,t)})).then((function(){return n})))},t.Dc=function(t,e){var n=this;return Wh(this,Vh(this,"phone").then((function(){return Zc(Ih(n),t,e,E(n.rb,n))})))},t.Mc=function(t,e){var n=this;return Wh(this,xe().then((function(){return Zc(Ih(n),t,e,E(n.ub,n))})),!0)},t.Cb=function(t){var e=this;return Wh(this,this.I().then((function(n){return e.a.Cb(n,t)})).then((function(t){return Uh(e,t),e.reload()})))},t.ed=function(t){var e=this;return Wh(this,this.I().then((function(n){return t.b(e.a,n)})).then((function(t){return Uh(e,t),e.reload()})))},t.Db=function(t){var e=this;return Wh(this,this.I().then((function(n){return e.a.Db(n,t)})).then((function(t){return Uh(e,t),e.reload()})))},t.Eb=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return Dh(this);var e=this;return Wh(this,this.I().then((function(n){return e.a.Eb(n,{displayName:t.displayName,photoUrl:t.photoURL})})).then((function(t){return Uh(e,t),jh(e,"displayName",t.displayName||null),jh(e,"photoURL",t.photoUrl||null),H(e.providerData,(function(t){"password"===t.providerId&&(Zr(t,"displayName",e.displayName),Zr(t,"photoURL",e.photoURL))})),Oh(e)})).then(Ch))},t.cd=function(t){var e=this;return Wh(this,Fh(this).then((function(n){return Q(Ph(e),t)?function(t,e,n){return ru(t,xs,{idToken:e,deleteProvider:n})}(e.a,n,[t]).then((function(t){var n={};return H(t.providerUserInfo||[],(function(t){n[t.providerId]=!0})),H(Ph(e),(function(t){n[t]||Lh(e,t)})),n[Fo.PROVIDER_ID]||Zr(e,"phoneNumber",null),Oh(e)})):Oh(e).then((function(){throw new A("no-such-provider")}))})))},t.delete=function(){var t=this;return Wh(this,this.I().then((function(e){return ru(t.a,Os,{idToken:e})})).then((function(){t.dispatchEvent(new uh("userDeleted"))}))).then((function(){for(var e=0;e<t.N.length;e++)t.N[e].cancel("app-deleted");wh(t,null),_h(t,null),Sh(t,null),t.N=[],t.J=!0,kh(t),Zr(t,"refreshToken",null),t.b&&Rc(t.b,t)}))},t.Gb=function(t,e){return!!("linkViaPopup"==t&&(this.g||null)==e&&this.f||"reauthViaPopup"==t&&(this.g||null)==e&&this.f||"linkViaRedirect"==t&&(this.ga||null)==e||"reauthViaRedirect"==t&&(this.ga||null)==e)},t.na=function(t,e,n,r){"linkViaPopup"!=t&&"reauthViaPopup"!=t||r!=(this.g||null)||(n&&this.C?this.C(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},t.Fa=function(t,e){return"linkViaPopup"==t&&e==(this.g||null)?E(this.Lb,this):"reauthViaPopup"==t&&e==(this.g||null)?E(this.Mb,this):"linkViaRedirect"==t&&(this.ga||null)==e?E(this.Lb,this):"reauthViaRedirect"==t&&(this.ga||null)==e?E(this.Mb,this):null},t.Ec=function(t){var e=this;return Gh(this,"linkViaPopup",t,(function(){return Vh(e,t.providerId).then((function(){return Oh(e)}))}),!1)},t.Nc=function(t){return Gh(this,"reauthViaPopup",t,(function(){return xe()}),!0)},t.Fc=function(t){var e=this;return Kh(this,"linkViaRedirect",t,(function(){return Vh(e,t.providerId)}),!1)},t.Oc=function(t){return Kh(this,"reauthViaRedirect",t,(function(){return xe()}),!0)},t.Lb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Wh(this,this.I().then((function(n){return _s(i.a,{requestUri:t,postBody:r,sessionId:e,idToken:n})})).then((function(t){return o=qh(i,t,"link"),Bh(i,t)})).then((function(){return o})))},t.Mb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Wh(this,xe().then((function(){return lo(Es(i.a,{requestUri:t,sessionId:e,postBody:r,tenantId:n}),i.uid)})).then((function(t){return o=qh(i,t,"reauthenticate"),Uh(i,t),i.i=null,i.reload()})).then((function(){return o})),!0)},t.vb=function(t){var e=this,n=null;return Wh(this,this.I().then((function(e){return n=e,void 0===t||vt(t)?{}:Bi(new Di(t))})).then((function(t){return e.a.vb(n,t)})).then((function(t){if(e.email!=t)return e.reload()})).then((function(){})))},t.Fb=function(t,e){var n=this,r=null;return Wh(this,this.I().then((function(t){return r=t,void 0===e||vt(e)?{}:Bi(new Di(e))})).then((function(e){return n.a.Fb(r,t,e)})).then((function(t){if(n.email!=t)return n.reload()})).then((function(){})))},t.jc=function(t){var e=null,n=this;return Wh(this,t=lo(xe(t),n.uid).then((function(t){return e=qh(n,t,"reauthenticate"),Uh(n,t),n.i=null,n.reload()})).then((function(){return e})),!0)},t.toJSON=function(){return this.w()},t.w=function(){var t={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&&gt(t,this.metadata.w()),H(this.providerData,(function(e){t.providerData.push(function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}(e))})),gt(t,this.S.w()),t};var Qh={name:"redirectUser",F:"session"};function Xh(t){return ic(t.b,Qh,t.a)}function Yh(t){this.a=t,this.b=ec(),this.c=null,this.f=function(t){var e=tl("local"),n=tl("session"),r=tl("none");return function(t,e,n){var r=rc(e,n),i=nc(t,e.F);return t.get(e,n).then((function(o){var a=null;try{a=Vr(u.localStorage.getItem(r))}catch(t){}if(a&&!o)return u.localStorage.removeItem(r),t.set(e,a,n);a&&o&&"localStorage"!=i.type&&u.localStorage.removeItem(r)}))}(t.b,e,t.a).then((function(){return t.b.get(n,t.a)})).then((function(i){return i?n:t.b.get(r,t.a).then((function(n){return n?r:t.b.get(e,t.a).then((function(n){return n?e:t.b.get($h,t.a).then((function(t){return t?tl(t):e}))}))}))})).then((function(e){return t.c=e,Zh(t,e.F)})).o((function(){t.c||(t.c=e)}))}(this),this.b.addListener(tl("local"),this.a,E(this.g,this))}function Zh(t,e){var n,r=[];for(n in $u)$u[n]!==e&&r.push(ic(t.b,tl($u[n]),t.a));return r.push(ic(t.b,$h,t.a)),function(t){return new Ee((function(e,n){var r=t.length,i=[];if(r)for(var o=function(t,n){r--,i[t]=n,0==r&&e(i)},a=function(t){n(t)},s=0;s<t.length;s++)Ce(t[s],S(o,s),a);else e(i)}))}(r)}Yh.prototype.g=function(){var t=this,e=tl("local");il(this,(function(){return xe().then((function(){return t.c&&"local"!=t.c.F?t.b.get(e,t.a):null})).then((function(n){if(n)return Zh(t,"local").then((function(){t.c=e}))}))}))};var $h={name:"persistence",F:"session"};function tl(t){return{name:"authUser",F:t}}function el(t,e){return il(t,(function(){return t.b.set(t.c,e.w(),t.a)}))}function nl(t){return il(t,(function(){return ic(t.b,t.c,t.a)}))}function rl(t,e,n){return il(t,(function(){return t.b.get(t.c,t.a).then((function(t){return t&&e&&(t.authDomain=e),t&&n&&(t.emulatorConfig=n),zh(t||{})}))}))}function il(t,e){return t.f=t.f.then(e,e),t.f}function ol(t){if(this.l=!1,Zr(this,"settings",new Xc),Zr(this,"app",t),!pl(this).options||!pl(this).options.apiKey)throw new A("invalid-api-key");t=r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION):null,this.a=new Ya(pl(this).options&&pl(this).options.apiKey,P(x),t),this.P=[],this.s=[],this.N=[],this.Pa=r.Z.INTERNAL.createSubscribe(E(this.zc,this)),this.W=void 0,this.ib=r.Z.INTERNAL.createSubscribe(E(this.Ac,this)),ll(this,null),this.i=new Yh(pl(this).options.apiKey+":"+pl(this).name),this.D=new Jh(pl(this).options.apiKey+":"+pl(this).name),this.$=ml(this,function(t){var e=pl(t).options.authDomain,n=function(t){var e=function(t,e){return t.b.get(Qh,t.a).then((function(t){return t&&e&&(t.authDomain=e),zh(t||{})}))}(t.D,pl(t).options.authDomain).then((function(e){return(t.m=e)&&(e.ha=t.D),Xh(t.D)}));return ml(t,e)}(t).then((function(){return rl(t.i,e,t.R)})).then((function(e){return e?(e.ha=t.D,t.m&&(t.m.ga||null)==(e.ga||null)?e:e.reload().then((function(){return el(t.i,e).then((function(){return e}))})).o((function(n){return"auth/network-request-failed"==n.code?e:nl(t.i)}))):null})).then((function(e){ll(t,e||null)}));return ml(t,n)}(this)),this.h=ml(this,function(t){return t.$.then((function(){return hl(t)})).o((function(){})).then((function(){if(!t.l)return t.ja()})).o((function(){})).then((function(){if(!t.l){t.ba=!0;var e=t.i;e.b.addListener(tl("local"),e.a,t.ja)}}))}(this)),this.ba=!1,this.ja=E(this.Zc,this),this.Ba=E(this.da,this),this.qa=E(this.mc,this),this.za=E(this.wc,this),this.Aa=E(this.xc,this),this.b=null,function(t){var e=pl(t).options.authDomain,n=pl(t).options.apiKey;e&&Rr()&&(t.Oa=t.$.then((function(){if(!t.l){if(t.b=Gc(e,n,pl(t).name,t.R),Pc(t.b,t),dl(t)&&xh(dl(t)),t.m){xh(t.m);var r=t.m;r.xa(t.la()),wh(r,t),Eh(r=t.m,t.J),Sh(r,t),bh(r=t.m,t.R),_h(r,t),t.m=null}return t.b}})))}(this),this.INTERNAL={},this.INTERNAL.delete=E(this.delete,this),this.INTERNAL.logFramework=E(this.Gc,this),this.u=0,Sn.call(this),function(t){Object.defineProperty(t,"lc",{get:function(){return this.la()},set:function(t){this.xa(t)},enumerable:!1}),t.aa=null,Object.defineProperty(t,"ti",{get:function(){return this.T()},set:function(t){this.zb(t)},enumerable:!1}),t.S=null,Object.defineProperty(t,"emulatorConfig",{get:function(){if(this.R){var t=qn(this.R.url);t=ti({protocol:t.c,host:t.a,port:t.g,options:ti({disableWarnings:this.R.ec})})}else t=null;return t},enumerable:!1})}(this),this.J=[],this.R=null}function al(t){Ze.call(this,"languageCodeChanged"),this.h=t}function sl(t){Ze.call(this,"emulatorConfigChanged"),this.c=t}function ul(t){Ze.call(this,"frameworkChanged"),this.f=t}function cl(t){return t.Oa||Ne(new A("auth-domain-config-required"))}function hl(t){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));var e=cl(t).then((function(){return t.b.ra()})).then((function(t){return t?ti(t):null}));return ml(t,e)}function ll(t,e){dl(t)&&(function(t,e){Y(t.W,(function(t){return t==e}))}(dl(t),t.Ba),dn(dl(t),"tokenChanged",t.qa),dn(dl(t),"userDeleted",t.za),dn(dl(t),"userInvalidated",t.Aa),kh(dl(t))),e&&(e.W.push(t.Ba),ln(e,"tokenChanged",t.qa),ln(e,"userDeleted",t.za),ln(e,"userInvalidated",t.Aa),0<t.u&&Th(e)),Zr(t,"currentUser",e),e&&(e.xa(t.la()),wh(e,t),Eh(e,t.J),Sh(e,t),bh(e,t.R),_h(e,t))}function fl(t,e){var n=null,r=null;return ml(t,e.then((function(e){return n=Vo(e),r=Yi(e),function(t,e){var n={};return n.apiKey=pl(t).options.apiKey,n.authDomain=pl(t).options.authDomain,n.appName=pl(t).name,t.R&&(n.emulatorConfig=t.R),t.$.then((function(){return function(t,e,n,r){var i=new gh(t,e);return n&&(i.ha=n),r&&Eh(i,r),i.reload().then((function(){return i}))}(n,e,t.D,t.Ga())})).then((function(e){return dl(t)&&e.uid==dl(t).uid?(Mh(dl(t),e),t.da(e)):(ll(t,e),xh(e),t.da(e))})).then((function(){yl(t)}))}(t,e)}),(function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=ih(e.w(),t,E(t.kc,t))),n||e})).then((function(){return ti({user:dl(t),credential:n,additionalUserInfo:r,operationType:"signIn"})})))}function pl(t){return t.app}function dl(t){return t.currentUser}function vl(t){return dl(t)&&dl(t)._lat||null}function yl(t){if(t.ba){for(var e=0;e<t.s.length;e++)t.s[e]&&t.s[e](vl(t));if(t.W!==t.getUid()&&t.N.length)for(t.W=t.getUid(),e=0;e<t.N.length;e++)t.N[e]&&t.N[e](vl(t))}}function ml(t,e){return t.P.push(e),e.oa((function(){X(t.P,e)})),e}function gl(){}function bl(){this.a={},this.b=1e12}Yh.prototype.yb=function(t){var e=null,n=this;return function(t){var e=new A("invalid-persistence-type"),n=new A("unsupported-persistence-type");t:{for(r in $u)if($u[r]==t){var r=!0;break t}r=!1}if(!r||"string"!=typeof t)throw e;switch(Ir()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;case"Worker":if("session"===t||!Du()&&"none"!==t)throw n;break;default:if(!Pr()&&"none"!==t)throw n}}(t),il(this,(function(){return t!=n.c.F?n.b.get(n.c,n.a).then((function(r){return e=r,Zh(n,t)})).then((function(){if(n.c=tl(t),e)return n.b.set(n.c,e,n.a)})):xe()}))},T(ol,Sn),T(al,Ze),T(sl,Ze),T(ul,Ze),(t=ol.prototype).yb=function(t){return ml(this,t=this.i.yb(t))},t.xa=function(t){this.aa===t||this.l||(this.aa=t,is(this.a,this.aa),this.dispatchEvent(new al(this.la())))},t.la=function(){return this.aa},t.fd=function(){var t=u.navigator;this.xa(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},t.gd=function(t,e){if(!this.R){if(!/^https?:\/\//.test(t))throw new A("argument-error","Emulator URL must start with a valid scheme (http:// or https://).");(function(t){"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),u.document&&!t&&wr().then((function(){var t=u.document.createElement("div");t.innerText="Running in emulator mode. Do not use with production credentials.",t.style.position="fixed",t.style.width="100%",t.style.backgroundColor="#ffffff",t.style.border=".1em solid #000000",t.style.color="#b50000",t.style.bottom="0px",t.style.left="0px",t.style.margin="0px",t.style.zIndex=1e4,t.style.textAlign="center",t.classList.add("firebase-emulator-warning"),u.document.body.appendChild(t)}))})(e=!!e&&!!e.disableWarnings),this.R={url:t,ec:e},this.settings.jb=!0,os(this.a,this.R),this.dispatchEvent(new sl(this.R))}},t.Gc=function(t){this.J.push(t),ss(this.a,r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION,this.J):null),this.dispatchEvent(new ul(this.J))},t.Ga=function(){return $(this.J)},t.zb=function(t){this.S===t||this.l||(this.S=t,this.a.b=this.S)},t.T=function(){return this.S},t.toJSON=function(){return{apiKey:pl(this).options.apiKey,authDomain:pl(this).options.authDomain,appName:pl(this).name,currentUser:dl(this)&&dl(this).w()}},t.Gb=function(t,e){switch(t){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==e&&!!this.f;default:return!1}},t.na=function(t,e,n,r){"signInViaPopup"==t&&this.g==r&&(n&&this.C?this.C(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},t.Fa=function(t,e){return"signInViaRedirect"==t||"signInViaPopup"==t&&this.g==e&&this.f?E(this.ic,this):null},t.ic=function(t,e,n,r){var i=this,o={requestUri:t,postBody:r,sessionId:e,tenantId:n};return this.c&&(this.c.cancel(),this.c=null),i.$.then((function(){return fl(i,ws(i.a,o))}))},t.Xc=function(t){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));var e=this,n=Xi(t.providerId),i=qr(),o=null;(!Mr()||Er())&&pl(this).options.authDomain&&t.isOAuthProvider&&(o=gu(pl(this).options.authDomain,pl(this).options.apiKey,pl(this).name,"signInViaPopup",t,null,i,r.Z.SDK_VERSION||null,null,null,this.T(),this.R));var a=mr(o,n&&n.va,n&&n.ua);return ml(this,n=cl(this).then((function(n){return Mc(n,a,"signInViaPopup",t,i,!!o,e.T())})).then((function(){return new Ee((function(t,n){e.na("signInViaPopup",null,new A("cancelled-popup-request"),e.g),e.f=t,e.C=n,e.g=i,e.c=Vc(e.b,e,"signInViaPopup",a,i)}))})).then((function(t){return a&&yr(a),t?ti(t):null})).o((function(t){throw a&&yr(a),t})))},t.Yc=function(t){if(!Rr())return Ne(new A("operation-not-supported-in-this-environment"));var e=this;return ml(this,cl(this).then((function(){return function(t){return il(t,(function(){return t.b.set($h,t.c.F,t.a)}))}(e.i)})).then((function(){return Uc(e.b,"signInViaRedirect",t,void 0,e.T())})))},t.ra=function(){var t=this;return hl(this).then((function(e){return t.b&&Wc(t.b.b),e})).o((function(e){throw t.b&&Wc(t.b.b),e}))},t.dd=function(t){if(!t)return Ne(new A("null-user"));if(this.S!=t.tenantId)return Ne(new A("tenant-id-mismatch"));var e=this,n={};n.apiKey=pl(this).options.apiKey,n.authDomain=pl(this).options.authDomain,n.appName=pl(this).name;var r=function(t,e,n,r){var i=t.h,o={};return o[$a]=i.b&&i.b.toString(),o.refreshToken=i.a,e=new gh(e||{apiKey:t.l,authDomain:t.s,appName:t.m},o),n&&(e.ha=n),r&&Eh(e,r),Mh(e,t),e}(t,n,e.D,e.Ga());return ml(this,this.h.then((function(){if(pl(e).options.apiKey!=t.l)return r.reload()})).then((function(){return dl(e)&&t.uid==dl(e).uid?(Mh(dl(e),t),e.da(t)):(ll(e,r),xh(r),e.da(r))})).then((function(){yl(e)})))},t.Bb=function(){var t=this;return ml(this,this.h.then((function(){return t.b&&Wc(t.b.b),dl(t)?(ll(t,null),nl(t.i).then((function(){yl(t)}))):xe()})))},t.Zc=function(){var t=this;return rl(this.i,pl(this).options.authDomain).then((function(e){if(!t.l){var n;if(n=dl(t)&&e){n=dl(t).uid;var r=e.uid;n=null!=n&&""!==n&&null!=r&&""!==r&&n==r}if(n)return Mh(dl(t),e),dl(t).I();(dl(t)||e)&&(ll(t,e),e&&(xh(e),e.ha=t.D),t.b&&Pc(t.b,t),yl(t))}}))},t.da=function(t){return el(this.i,t)},t.mc=function(){yl(this),this.da(dl(this))},t.wc=function(){this.Bb()},t.xc=function(){this.Bb()},t.kc=function(t){var e=this;return this.h.then((function(){return fl(e,xe(t))}))},t.zc=function(t){var e=this;this.addAuthTokenListener((function(){t.next(dl(e))}))},t.Ac=function(t){var e=this;!function(t,e){t.N.push(e),ml(t,t.h.then((function(){!t.l&&Q(t.N,e)&&t.W!==t.getUid()&&(t.W=t.getUid(),e(vl(t)))})))}(this,(function(){t.next(dl(e))}))},t.Ic=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){"function"==typeof t?t(dl(r)):"function"==typeof t.next&&t.next(dl(r))})),this.Pa(t,e,n)},t.Hc=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){r.W=r.getUid(),"function"==typeof t?t(dl(r)):"function"==typeof t.next&&t.next(dl(r))})),this.ib(t,e,n)},t.nc=function(t){var e=this;return ml(this,this.h.then((function(){return dl(e)?dl(e).I(t).then((function(t){return{accessToken:t}})):null})))},t.Tc=function(t){var e=this;return this.h.then((function(){return fl(e,ru(e.a,Ys,{token:t}))})).then((function(t){var n=t.user;return jh(n,"isAnonymous",!1),e.da(n),t}))},t.Uc=function(t,e){var n=this;return this.h.then((function(){return fl(n,ru(n.a,Zs,{email:t,password:e}))}))},t.dc=function(t,e){var n=this;return this.h.then((function(){return fl(n,ru(n.a,ks,{email:t,password:e}))}))},t.ab=function(t){var e=this;return this.h.then((function(){return fl(e,t.ka(e.a))}))},t.Sc=function(t){return Xr("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.ab(t)},t.Ab=function(){var t=this;return this.h.then((function(){var e=dl(t);if(e&&e.isAnonymous){var n=ti({providerId:null,isNewUser:!1});return ti({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return fl(t,t.a.Ab()).then((function(e){var n=e.user;return jh(n,"isAnonymous",!0),t.da(n),e}))}))},t.getUid=function(){return dl(this)&&dl(this).uid||null},t.cc=function(t){this.addAuthTokenListener(t),this.u++,0<this.u&&dl(this)&&Th(dl(this))},t.Pc=function(t){var e=this;H(this.s,(function(n){n==t&&e.u--})),0>this.u&&(this.u=0),0==this.u&&dl(this)&&kh(dl(this)),this.removeAuthTokenListener(t)},t.addAuthTokenListener=function(t){var e=this;this.s.push(t),ml(this,this.h.then((function(){e.l||Q(e.s,t)&&t(vl(e))})))},t.removeAuthTokenListener=function(t){Y(this.s,(function(e){return e==t}))},t.delete=function(){this.l=!0;for(var t=0;t<this.P.length;t++)this.P[t].cancel("app-deleted");return this.P=[],this.i&&(t=this.i).b.removeListener(tl("local"),t.a,this.ja),this.b&&(Rc(this.b,this),Wc(this.b.b)),Promise.resolve()},t.hc=function(t){return ml(this,function(t,e){return ru(t,As,{identifier:e,continueUri:Lr()?fr():"http://localhost"}).then((function(t){return t.signinMethods||[]}))}(this.a,t))},t.Bc=function(t){return!!Ro(t)},t.xb=function(t,e){var n=this;return ml(this,xe().then((function(){var t=new Di(e);if(!t.c)throw new A("argument-error",Li+" must be true when sending sign in link to email");return Bi(t)})).then((function(e){return n.a.xb(t,e)})).then((function(){})))},t.jd=function(t){return this.Sa(t).then((function(t){return t.data.email}))},t.ob=function(t,e){return ml(this,this.a.ob(t,e).then((function(){})))},t.Sa=function(t){return ml(this,this.a.Sa(t).then((function(t){return new ci(t)})))},t.kb=function(t){return ml(this,this.a.kb(t).then((function(){})))},t.wb=function(t,e){var n=this;return ml(this,xe().then((function(){return void 0===e||vt(e)?{}:Bi(new Di(e))})).then((function(e){return n.a.wb(t,e)})).then((function(){})))},t.Wc=function(t,e){return ml(this,Zc(this,t,e,E(this.ab,this)))},t.Vc=function(t,e){var n=this;return ml(this,xe().then((function(){var r=e||fr(),i=Po(t,r);if(!(r=Ro(r)))throw new A("argument-error","Invalid email link!");if(r.tenantId!==n.T())throw new A("tenant-id-mismatch");return n.ab(i)})))},gl.prototype.render=function(){},gl.prototype.reset=function(){},gl.prototype.getResponse=function(){},gl.prototype.execute=function(){};var wl=null;function _l(t,e){return(e=El(e))&&t.a[e]||null}function El(t){return(t=void 0===t?1e12:t)?t.toString():null}function Sl(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=he(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():ln(this.f,"click",this.i)}function Il(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function Tl(){}function kl(){}bl.prototype.render=function(t,e){return this.a[this.b.toString()]=new Sl(t,e),this.b++},bl.prototype.reset=function(t){var e=_l(this,t);t=El(t),e&&t&&(e.delete(),delete this.a[t])},bl.prototype.getResponse=function(t){return(t=_l(this,t))?t.getResponse():null},bl.prototype.execute=function(t){(t=_l(this,t))&&t.execute()},Sl.prototype.getResponse=function(){return Il(this),this.b},Sl.prototype.execute=function(){Il(this);var t=this;this.a||(this.a=setTimeout((function(){t.b=function(){for(var t=50,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}();var e=t.c.callback,n=t.c["expired-callback"];if(e)try{e(t.b)}catch(t){}t.a=setTimeout((function(){if(t.a=null,t.b=null,n)try{n()}catch(t){}t.h&&t.execute()}),6e4)}),500))},Sl.prototype.delete=function(){Il(this),this.g=!0,clearTimeout(this.a),this.a=null,dn(this.f,"click",this.i)},Zr(Tl,"FACTOR_ID","phone"),kl.prototype.g=function(){return wl||(wl=new bl),xe(wl)},kl.prototype.c=function(){};var Al=null;function Ol(){this.b=u.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var xl=new wt(It,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Nl=new Kr(3e4,6e4);Ol.prototype.g=function(t){var e=this;return new Ee((function(n,r){var i=setTimeout((function(){r(new A("network-request-failed"))}),Nl.get());!u.grecaptcha||t!==e.f&&!e.b?(u[e.a]=function(){if(u.grecaptcha){e.f=t;var o=u.grecaptcha.render;u.grecaptcha.render=function(t,n){return t=o(t,n),e.b++,t},clearTimeout(i),n(u.grecaptcha)}else clearTimeout(i),r(new A("internal-error"));delete u[e.a]},xe(Ka(Ot(xl,{onload:e.a,hl:t||""}))).o((function(){clearTimeout(i),r(new A("internal-error","Unable to load external reCAPTCHA dependencies!"))}))):(clearTimeout(i),n(u.grecaptcha))}))},Ol.prototype.c=function(){this.b--};var Cl=null;function Dl(t,e,n,r,i,o,a){if(Zr(this,"type","recaptcha"),this.c=this.f=null,this.J=!1,this.v=e,this.g=null,a?(Al||(Al=new kl),a=Al):(Cl||(Cl=new Ol),a=Cl),this.m=a,this.a=n||{theme:"light",type:"image"},this.h=[],this.a[Ll])throw new A("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[jl],!u.document)throw new A("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!he(e)||!this.i&&he(e).hasChildNodes())throw new A("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new Ya(t,o||null,i||null),this.u=r||function(){return null};var s=this;this.l=[];var c=this.a[Pl];this.a[Pl]=function(t){if(Ml(s,t),"function"==typeof c)c(t);else if("string"==typeof c){var e=Dr(c,u);"function"==typeof e&&e(t)}};var h=this.a[Rl];this.a[Rl]=function(){if(Ml(s,null),"function"==typeof h)h();else if("string"==typeof h){var t=Dr(h,u);"function"==typeof t&&t()}}}var Pl="callback",Rl="expired-callback",Ll="sitekey",jl="size";function Ml(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(t){}}function Fl(t,e){return t.h.push(e),e.oa((function(){X(t.h,e)})),e}function Ul(t){if(t.J)throw new A("internal-error","RecaptchaVerifier instance has been destroyed.")}function Vl(t,e,n){var i=!1;try{this.b=n||r.Z.app()}catch(t){throw new A("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new A("invalid-api-key");n=this.b.options.apiKey;var o=this,a=null;try{a=this.b.auth().Ga()}catch(t){}try{i=this.b.auth().settings.appVerificationDisabledForTesting}catch(t){}a=r.Z.SDK_VERSION?Nr(r.Z.SDK_VERSION,a):null,Dl.call(this,n,t,e,(function(){try{var t=o.b.auth().la()}catch(e){t=null}return t}),a,P(x),i)}function ql(t,e,n,r){t:{n=Array.prototype.slice.call(n);for(var i=0,o=!1,a=0;a<e.length;a++)if(e[a].optional)o=!0;else{if(o)throw new A("internal-error","Argument validator encountered a required argument after an optional argument.");i++}if(o=e.length,n.length<i||o<n.length)r="Expected "+(i==o?1==i?"1 argument":i+" arguments":i+"-"+o+" arguments")+" but got "+n.length+".";else{for(i=0;i<n.length;i++)if(o=e[i].optional&&void 0===n[i],!e[i].M(n[i])&&!o){if(e=e[i],0>i||i>=Bl.length)throw new A("internal-error","Argument validator received an unsupported number of arguments.");n=Bl[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.K+".";break t}r=null}}if(r)throw new A("argument-error",t+" failed: "+r)}(t=Dl.prototype).Ia=function(){var t=this;return this.f?this.f:this.f=Fl(this,xe().then((function(){if(Lr()&&!Sr())return wr();throw new A("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return t.m.g(t.u())})).then((function(e){return t.g=e,ru(t.s,Vs,{})})).then((function(e){t.a[Ll]=e.recaptchaSiteKey})).o((function(e){throw t.f=null,e})))},t.render=function(){Ul(this);var t=this;return Fl(this,this.Ia().then((function(){if(null===t.c){var e=t.v;if(!t.i){var n=he(e);e=function(t,e,n){var r=arguments,i=document,o=String(r[0]),a=r[1];if(!ce&&a&&(a.name||a.type)){if(o=["<",o],a.name&&o.push(' name="',Ht(a.name),'"'),a.type){o.push(' type="',Ht(a.type),'"');var s={};gt(s,a),delete s.type,a=s}o.push(">"),o=o.join("")}return o=ye(i,o),a&&("string"==typeof a?o.className=a:Array.isArray(a)?o.className=a.join(" "):le(o,a)),2<r.length&&ve(i,o,r),o}("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c})))},t.verify=function(){Ul(this);var t=this;return Fl(this,this.render().then((function(e){return new Ee((function(n){var r=t.g.getResponse(e);if(r)n(r);else{var i=function(e){e&&(function(t,e){Y(t.l,(function(t){return t==e}))}(t,i),n(e))};t.l.push(i),t.i&&t.g.execute(t.c)}}))})))},t.reset=function(){Ul(this),null!==this.c&&this.g.reset(this.c)},t.clear=function(){Ul(this),this.J=!0,this.m.c();for(var t=0;t<this.h.length;t++)this.h[t].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){t=he(this.v);for(var e;e=t.firstChild;)t.removeChild(e)}},T(Vl,Dl);var Bl="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Gl(t,e){return{name:t||"",K:"a valid string",optional:!!e,M:function(t){return"string"==typeof t}}}function Kl(t,e){return{name:t||"",K:"a boolean",optional:!!e,M:function(t){return"boolean"==typeof t}}}function Hl(t,e){return{name:t||"",K:"a valid object",optional:!!e,M:y}}function Wl(t,e){return{name:t||"",K:"a function",optional:!!e,M:function(t){return"function"==typeof t}}}function zl(t,e){return{name:t||"",K:"null",optional:!!e,M:function(t){return null===t}}}function Jl(t){return{name:t?t+"Credential":"credential",K:t?"a valid "+t+" credential":"a valid credential",optional:!1,M:function(e){if(!e)return!1;var n=!t||e.providerId===t;return!(!e.ka||!n)}}}function Ql(t,e){return y(t)&&"string"==typeof t.type&&t.type===e&&"function"==typeof t.Ha}function Xl(t){return y(t)&&"string"==typeof t.uid}function Yl(t,e,n,r){return{name:n||"",K:t.K+" or "+e.K,optional:!!r,M:function(n){return t.M(n)||e.M(n)}}}function Zl(t,e){for(var n in e){var r=e[n].name;t[r]=ef(r,t[n],e[n].j)}}function $l(t,e){for(var n in e){var r=e[n].name;r!==n&&Object.defineProperty(t,r,{get:S((function(t){return this[t]}),n),set:S((function(t,e,n,r){ql(t,[n],[r],!0),this[e]=r}),r,n,e[n].lb),enumerable:!0})}}function tf(t,e,n,r){t[e]=ef(e,n,r)}function ef(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return ql(o,n,t),e.apply(this,t)}if(!n)return e;var i,o=function(t){return(t=t.split("."))[t.length-1]}(t);for(i in e)r[i]=e[i];for(i in e.prototype)r.prototype[i]=e.prototype[i];return r}Zl(ol.prototype,{kb:{name:"applyActionCode",j:[Gl("code")]},Sa:{name:"checkActionCode",j:[Gl("code")]},ob:{name:"confirmPasswordReset",j:[Gl("code"),Gl("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[Gl("email"),Gl("password")]},hc:{name:"fetchSignInMethodsForEmail",j:[Gl("email")]},ra:{name:"getRedirectResult",j:[]},Bc:{name:"isSignInWithEmailLink",j:[Gl("emailLink")]},Hc:{name:"onAuthStateChanged",j:[Yl(Hl(),Wl(),"nextOrObserver"),Wl("opt_error",!0),Wl("opt_completed",!0)]},Ic:{name:"onIdTokenChanged",j:[Yl(Hl(),Wl(),"nextOrObserver"),Wl("opt_error",!0),Wl("opt_completed",!0)]},wb:{name:"sendPasswordResetEmail",j:[Gl("email"),Yl(Hl("opt_actionCodeSettings",!0),zl(null,!0),"opt_actionCodeSettings",!0)]},xb:{name:"sendSignInLinkToEmail",j:[Gl("email"),Hl("actionCodeSettings")]},yb:{name:"setPersistence",j:[Gl("persistence")]},Sc:{name:"signInAndRetrieveDataWithCredential",j:[Jl()]},Ab:{name:"signInAnonymously",j:[]},ab:{name:"signInWithCredential",j:[Jl()]},Tc:{name:"signInWithCustomToken",j:[Gl("token")]},Uc:{name:"signInWithEmailAndPassword",j:[Gl("email"),Gl("password")]},Vc:{name:"signInWithEmailLink",j:[Gl("email"),Gl("emailLink",!0)]},Wc:{name:"signInWithPhoneNumber",j:[Gl("phoneNumber"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]},Xc:{name:"signInWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Yc:{name:"signInWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},dd:{name:"updateCurrentUser",j:[Yl({name:"user",K:"an instance of Firebase User",optional:!1,M:function(t){return!!(t&&t instanceof gh)}},zl(),"user")]},Bb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Gl(null,!0)]},fd:{name:"useDeviceLanguage",j:[]},gd:{name:"useEmulator",j:[Gl("url"),Hl("options",!0)]},jd:{name:"verifyPasswordResetCode",j:[Gl("code")]}}),$l(ol.prototype,{lc:{name:"languageCode",lb:Yl(Gl(),zl(),"languageCode")},ti:{name:"tenantId",lb:Yl(Gl(),zl(),"tenantId")}}),ol.Persistence=$u,ol.Persistence.LOCAL="local",ol.Persistence.SESSION="session",ol.Persistence.NONE="none",Zl(gh.prototype,{delete:{name:"delete",j:[]},oc:{name:"getIdTokenResult",j:[Kl("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[Kl("opt_forceRefresh",!0)]},Cc:{name:"linkAndRetrieveDataWithCredential",j:[Jl()]},rb:{name:"linkWithCredential",j:[Jl()]},Dc:{name:"linkWithPhoneNumber",j:[Gl("phoneNumber"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]},Ec:{name:"linkWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Fc:{name:"linkWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Lc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[Jl()]},ub:{name:"reauthenticateWithCredential",j:[Jl()]},Mc:{name:"reauthenticateWithPhoneNumber",j:[Gl("phoneNumber"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]},Nc:{name:"reauthenticateWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Oc:{name:"reauthenticateWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},reload:{name:"reload",j:[]},vb:{name:"sendEmailVerification",j:[Yl(Hl("opt_actionCodeSettings",!0),zl(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Gl(null,!0)]},cd:{name:"unlink",j:[Gl("provider")]},Cb:{name:"updateEmail",j:[Gl("email")]},Db:{name:"updatePassword",j:[Gl("password")]},ed:{name:"updatePhoneNumber",j:[Jl("phone")]},Eb:{name:"updateProfile",j:[Hl("profile")]},Fb:{name:"verifyBeforeUpdateEmail",j:[Gl("email"),Yl(Hl("opt_actionCodeSettings",!0),zl(null,!0),"opt_actionCodeSettings",!0)]}}),Zl(bl.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Zl(gl.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Zl(Ee.prototype,{oa:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),$l(Xc.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",lb:Kl("appVerificationDisabledForTesting")}}),Zl(Yc.prototype,{confirm:{name:"confirm",j:[Gl("verificationCode")]}}),tf(ho,"fromJSON",(function(t){t="string"==typeof t?JSON.parse(t):t;for(var e,n=[go,Co,jo,vo],r=0;r<n.length;r++)if(e=n[r](t))return e;return null}),[Yl(Gl(),Hl(),"json")]),tf(Do,"credential",(function(t,e){return new No(t,e)}),[Gl("email"),Gl("password")]),Zl(No.prototype,{w:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(Eo.prototype,{Ca:{name:"addScope",j:[Gl("scope")]},Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),tf(Eo,"credential",So,[Yl(Gl(),Hl(),"token")]),tf(Do,"credentialWithLink",Po,[Gl("email"),Gl("emailLink")]),Zl(Io.prototype,{Ca:{name:"addScope",j:[Gl("scope")]},Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),tf(Io,"credential",To,[Yl(Gl(),Hl(),"token")]),Zl(ko.prototype,{Ca:{name:"addScope",j:[Gl("scope")]},Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),tf(ko,"credential",Ao,[Yl(Gl(),Yl(Hl(),zl()),"idToken"),Yl(Gl(),zl(),"accessToken",!0)]),Zl(Oo.prototype,{Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),tf(Oo,"credential",xo,[Yl(Gl(),Hl(),"token"),Gl("secret",!0)]),Zl(_o.prototype,{Ca:{name:"addScope",j:[Gl("scope")]},credential:{name:"credential",j:[Yl(Gl(),Yl(Hl(),zl()),"optionsOrIdToken"),Yl(Gl(),zl(),"accessToken",!0)]},Ka:{name:"setCustomParameters",j:[Hl("customOAuthParameters")]}}),Zl(yo.prototype,{w:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(fo.prototype,{w:{name:"toJSON",j:[Gl(null,!0)]}}),tf(Fo,"credential",Uo,[Gl("verificationId"),Gl("verificationCode")]),Zl(Fo.prototype,{gb:{name:"verifyPhoneNumber",j:[Yl(Gl(),{name:"phoneInfoOptions",K:"valid phone info options",optional:!1,M:function(t){return!!t&&(t.session&&t.phoneNumber?Ql(t.session,uo)&&"string"==typeof t.phoneNumber:t.session&&t.multiFactorHint?Ql(t.session,co)&&Xl(t.multiFactorHint):t.session&&t.multiFactorUid?Ql(t.session,co)&&"string"==typeof t.multiFactorUid:!!t.phoneNumber&&"string"==typeof t.phoneNumber)}},"phoneInfoOptions"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]}}),Zl(Lo.prototype,{w:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(A.prototype,{toJSON:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(Jo.prototype,{toJSON:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(zo.prototype,{toJSON:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(rh.prototype,{toJSON:{name:"toJSON",j:[Gl(null,!0)]}}),Zl(th.prototype,{Rc:{name:"resolveSignIn",j:[{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(t){return!!t&&!!t.tb}}]}}),Zl(ch.prototype,{Sb:{name:"getSession",j:[]},fc:{name:"enroll",j:[{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(t){return!!t&&!!t.tb}},Gl("displayName",!0)]},bd:{name:"unenroll",j:[Yl({name:"multiFactorInfo",K:"a valid multiFactorInfo",optional:!1,M:Xl},Gl(),"multiFactorInfoIdentifier")]}}),Zl(Vl.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),tf(Si,"parseLink",Ci,[Gl("link")]),tf(Tl,"assertion",(function(t){return new sh(t)}),[Jl("phone")]),function(){if(void 0===r.Z||!r.Z.INTERNAL||!r.Z.INTERNAL.registerComponent)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var t={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:li,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:hi,VERIFY_AND_CHANGE_EMAIL:fi,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:ol,AuthCredential:ho,Error:A};tf(t,"EmailAuthProvider",Do,[]),tf(t,"FacebookAuthProvider",Eo,[]),tf(t,"GithubAuthProvider",Io,[]),tf(t,"GoogleAuthProvider",ko,[]),tf(t,"TwitterAuthProvider",Oo,[]),tf(t,"OAuthProvider",_o,[Gl("providerId")]),tf(t,"SAMLAuthProvider",wo,[Gl("providerId")]),tf(t,"PhoneAuthProvider",Fo,[{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(t){return!!(t&&t instanceof ol)}}]),tf(t,"RecaptchaVerifier",Vl,[Yl(Gl(),{name:"",K:"an HTML element",optional:!1,M:function(t){return!!(t&&t instanceof Element)}},"recaptchaContainer"),Hl("recaptchaParameters",!0),{name:"app",K:"an instance of Firebase App",optional:!0,M:function(t){return!!(t&&t instanceof r.Z.app.App)}}]),tf(t,"ActionCodeURL",Si,[]),tf(t,"PhoneMultiFactorGenerator",Tl,[]),r.Z.INTERNAL.registerComponent({name:"auth",instanceFactory:function(t){return new ol(t=t.getProvider("app").getImmediate())},multipleInstances:!1,serviceProps:t,instantiationMode:"LAZY",type:"PUBLIC",onInstanceCreated:function(t){t.getProvider("auth-internal").initialize()}}),r.Z.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(t){return{getUid:E((t=t.getProvider("auth").getImmediate()).getUid,t),getToken:E(t.nc,t),addAuthTokenListener:E(t.cc,t),removeAuthTokenListener:E(t.Pc,t)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"}),r.Z.registerVersion("@firebase/auth","0.16.8"),r.Z.INTERNAL.extendNamespace({User:gh})}()}).apply(void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},2189:function(t,e,n){n.r(e);var r=n(2249),i=n(5163),o=n(6765),a=n(3936),s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var c,h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},l=l||{},f=h||self;function p(){}function d(t){var e=typeof t;return"array"==(e="object"!=e?e:t?Array.isArray(t)?"array":e:"null")||"object"==e&&"number"==typeof t.length}function v(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var y="closure_uid_"+(1e9*Math.random()>>>0),m=0;function g(t,e,n){return t.call.apply(t.bind,arguments)}function b(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function w(t,e,n){return(w=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?g:b).apply(null,arguments)}function _(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}function E(t,e){function n(){}n.prototype=e.prototype,t.Z=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Vb=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.prototype[n].apply(t,i)}}function S(){this.s=this.s,this.o=this.o}var I={};S.prototype.s=!1,S.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0)){var t=function(t){return Object.prototype.hasOwnProperty.call(t,y)&&t[y]||(t[y]=++m)}(this);delete I[t]}},S.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()()};var T=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"==typeof t)return"string"!=typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},k=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"==typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)};function A(t){return Array.prototype.concat.apply([],arguments)}function O(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}function x(t){return/^[\s\xa0]*$/.test(t)}var N,C=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function D(t,e){return-1!=t.indexOf(e)}function P(t,e){return t<e?-1:t>e?1:0}t:{var R=f.navigator;if(R){var L=R.userAgent;if(L){N=L;break t}}N=""}function j(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function M(t){var e={};for(var n in t)e[n]=t[n];return e}var F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function U(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<F.length;o++)n=F[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function V(t){return V[" "](t),t}V[" "]=p;var q,B,G=D(N,"Opera"),K=D(N,"Trident")||D(N,"MSIE"),H=D(N,"Edge"),W=H||K,z=D(N,"Gecko")&&!(D(N.toLowerCase(),"webkit")&&!D(N,"Edge"))&&!(D(N,"Trident")||D(N,"MSIE"))&&!D(N,"Edge"),J=D(N.toLowerCase(),"webkit")&&!D(N,"Edge");function Q(){var t=f.document;return t?t.documentMode:void 0}t:{var X="",Y=(B=N,z?/rv:([^\);]+)(\)|;)/.exec(B):H?/Edge\/([\d\.]+)/.exec(B):K?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(B):J?/WebKit\/(\S+)/.exec(B):G?/(?:Version)[ \/]?(\S+)/.exec(B):void 0);if(Y&&(X=Y?Y[1]:""),K){var Z=Q();if(null!=Z&&Z>parseFloat(X)){q=String(Z);break t}}q=X}var $,tt={};function et(){return t=tt,Object.prototype.hasOwnProperty.call(t,9)?t[9]:t[9]=function(){for(var t=0,e=C(String(q)).split("."),n=C("9").split("."),r=Math.max(e.length,n.length),i=0;0==t&&i<r;i++){var o=e[i]||"",a=n[i]||"";do{if(o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==o[0].length&&0==a[0].length)break;t=P(0==o[1].length?0:parseInt(o[1],10),0==a[1].length?0:parseInt(a[1],10))||P(0==o[2].length,0==a[2].length)||P(o[2],a[2]),o=o[3],a=a[3]}while(0==t)}return 0<=t}();var t}f.document&&K?$=Q()||parseInt(q,10)||void 0:$=void 0;var nt=$,rt=function(){if(!f.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{f.addEventListener("test",p,e),f.removeEventListener("test",p,e)}catch(t){}return t}();function it(t,e){this.type=t,this.g=this.target=e,this.defaultPrevented=!1}function ot(t,e){if(it.call(this,t?t.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,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.g=e,e=t.relatedTarget){if(z){t:{try{V(e.nodeName);var i=!0;break t}catch(t){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"==typeof t.pointerType?t.pointerType:at[t.pointerType]||"",this.state=t.state,this.i=t,t.defaultPrevented&&ot.Z.h.call(this)}}it.prototype.h=function(){this.defaultPrevented=!0},E(ot,it);var at={2:"touch",3:"pen",4:"mouse"};ot.prototype.h=function(){ot.Z.h.call(this);var t=this.i;t.preventDefault?t.preventDefault():t.returnValue=!1};var st="closure_listenable_"+(1e6*Math.random()|0),ut=0;function ct(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.ia=i,this.key=++ut,this.ca=this.fa=!1}function ht(t){t.ca=!0,t.listener=null,t.proxy=null,t.src=null,t.ia=null}function lt(t){this.src=t,this.g={},this.h=0}function ft(t,e){var n=e.type;if(n in t.g){var r,i=t.g[n],o=T(i,e);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(ht(e),0==t.g[n].length&&(delete t.g[n],t.h--))}}function pt(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.ca&&o.listener==e&&o.capture==!!n&&o.ia==r)return i}return-1}lt.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.g[o])||(t=this.g[o]=[],this.h++);var a=pt(t,e,r,i);return-1<a?(e=t[a],n||(e.fa=!1)):((e=new ct(e,this.src,o,!!r,i)).fa=n,t.push(e)),e};var dt="closure_lm_"+(1e6*Math.random()|0),vt={};function yt(t,e,n,r,i){if(r&&r.once)return gt(t,e,n,r,i);if(Array.isArray(e)){for(var o=0;o<e.length;o++)yt(t,e[o],n,r,i);return null}return n=Tt(n),t&&t[st]?t.N(e,n,v(r)?!!r.capture:!!r,i):mt(t,e,n,!1,r,i)}function mt(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=v(i)?!!i.capture:!!i,s=St(t);if(s||(t[dt]=s=new lt(t)),(n=s.add(e,n,r,a,o)).proxy)return n;if(r=function(){var t=Et;return function e(n){return t.call(e.src,e.listener,n)}}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)rt||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(_t(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function gt(t,e,n,r,i){if(Array.isArray(e)){for(var o=0;o<e.length;o++)gt(t,e[o],n,r,i);return null}return n=Tt(n),t&&t[st]?t.O(e,n,v(r)?!!r.capture:!!r,i):mt(t,e,n,!0,r,i)}function bt(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)bt(t,e[o],n,r,i);else r=v(r)?!!r.capture:!!r,n=Tt(n),t&&t[st]?(t=t.i,(e=String(e).toString())in t.g&&-1<(n=pt(o=t.g[e],n,r,i))&&(ht(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.g[e],t.h--))):t&&(t=St(t))&&(e=t.g[e.toString()],t=-1,e&&(t=pt(e,n,r,i)),(n=-1<t?e[t]:null)&&wt(n))}function wt(t){if("number"!=typeof t&&t&&!t.ca){var e=t.src;if(e&&e[st])ft(e.i,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(_t(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=St(e))?(ft(n,t),0==n.h&&(n.src=null,e[dt]=null)):ht(t)}}}function _t(t){return t in vt?vt[t]:vt[t]="on"+t}function Et(t,e){if(t.ca)t=!0;else{e=new ot(e,this);var n=t.listener,r=t.ia||t.src;t.fa&&wt(t),t=n.call(r,e)}return t}function St(t){return(t=t[dt])instanceof lt?t:null}var It="__closure_events_fn_"+(1e9*Math.random()>>>0);function Tt(t){return"function"==typeof t?t:(t[It]||(t[It]=function(e){return t.handleEvent(e)}),t[It])}function kt(){S.call(this),this.i=new lt(this),this.P=this,this.I=null}function At(t,e){var n,r=t.I;if(r)for(n=[];r;r=r.I)n.push(r);if(t=t.P,r=e.type||e,"string"==typeof e)e=new it(e,t);else if(e instanceof it)e.target=e.target||t;else{var i=e;U(e=new it(r,t),i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var a=e.g=n[o];i=Ot(a,r,!0,e)&&i}if(i=Ot(a=e.g=t,r,!0,e)&&i,i=Ot(a,r,!1,e)&&i,n)for(o=0;o<n.length;o++)i=Ot(a=e.g=n[o],r,!1,e)&&i}function Ot(t,e,n,r){if(!(e=t.i.g[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.ca&&a.capture==n){var s=a.listener,u=a.ia||a.src;a.fa&&ft(t.i,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}E(kt,S),kt.prototype[st]=!0,kt.prototype.removeEventListener=function(t,e,n,r){bt(this,t,e,n,r)},kt.prototype.M=function(){if(kt.Z.M.call(this),this.i){var t,e=this.i;for(t in e.g){for(var n=e.g[t],r=0;r<n.length;r++)ht(n[r]);delete e.g[t],e.h--}}this.I=null},kt.prototype.N=function(t,e,n,r){return this.i.add(String(t),e,!1,n,r)},kt.prototype.O=function(t,e,n,r){return this.i.add(String(t),e,!0,n,r)};var xt=f.JSON.stringify;function Nt(){var t=Ft,e=null;return t.g&&(e=t.g,t.g=t.g.next,t.g||(t.h=null),e.next=null),e}var Ct,Dt=function(){function t(){this.h=this.g=null}return t.prototype.add=function(t,e){var n=Pt.get();n.set(t,e),this.h?this.h.next=n:this.g=n,this.h=n},t}(),Pt=new(function(){function t(t,e){this.i=t,this.j=e,this.h=0,this.g=null}return t.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},t}())((function(){return new Rt}),(function(t){return t.reset()})),Rt=function(){function t(){this.next=this.g=this.h=null}return t.prototype.set=function(t,e){this.h=t,this.g=e,this.next=null},t.prototype.reset=function(){this.next=this.g=this.h=null},t}();function Lt(t){f.setTimeout((function(){throw t}),0)}function jt(t,e){Ct||function(){var t=f.Promise.resolve(void 0);Ct=function(){t.then(Ut)}}(),Mt||(Ct(),Mt=!0),Ft.add(t,e)}var Mt=!1,Ft=new Dt;function Ut(){for(var t;t=Nt();){try{t.h.call(t.g)}catch(t){Lt(t)}var e=Pt;e.j(t),100>e.h&&(e.h++,t.next=e.g,e.g=t)}Mt=!1}function Vt(t,e){kt.call(this),this.h=t||1,this.g=e||f,this.j=w(this.kb,this),this.l=Date.now()}function qt(t){t.da=!1,t.S&&(t.g.clearTimeout(t.S),t.S=null)}function Bt(t,e,n){if("function"==typeof t)n&&(t=w(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=w(t.handleEvent,t)}return 2147483647<Number(e)?-1:f.setTimeout(t,e||0)}function Gt(t){t.g=Bt((function(){t.g=null,t.i&&(t.i=!1,Gt(t))}),t.j);var e=t.h;t.h=null,t.m.apply(null,e)}E(Vt,kt),(c=Vt.prototype).da=!1,c.S=null,c.kb=function(){if(this.da){var t=Date.now()-this.l;0<t&&t<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-t):(this.S&&(this.g.clearTimeout(this.S),this.S=null),At(this,"tick"),this.da&&(qt(this),this.start()))}},c.start=function(){this.da=!0,this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now())},c.M=function(){Vt.Z.M.call(this),qt(this),delete this.g};var Kt=function(t){function e(e,n){var r=t.call(this)||this;return r.m=e,r.j=n,r.h=null,r.i=!1,r.g=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.l=function(t){this.h=arguments,this.g?this.i=!0:Gt(this)},e.prototype.M=function(){t.prototype.M.call(this),this.g&&(f.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)},e}(S);function Ht(t){S.call(this),this.h=t,this.g={}}E(Ht,S);var Wt=[];function zt(t,e,n,r){Array.isArray(n)||(n&&(Wt[0]=n.toString()),n=Wt);for(var i=0;i<n.length;i++){var o=yt(e,n[i],r||t.handleEvent,!1,t.h||t);if(!o)break;t.g[o.key]=o}}function Jt(t){j(t.g,(function(t,e){this.g.hasOwnProperty(e)&&wt(t)}),t),t.g={}}function Qt(){this.g=!0}function Xt(t,e,n,r){t.info((function(){return"XMLHTTP TEXT ("+e+"): "+function(t,e){if(!t.g)return e;if(!e)return null;try{var n=JSON.parse(e);if(n)for(t=0;t<n.length;t++)if(Array.isArray(n[t])){var r=n[t];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var a=1;a<i.length;a++)i[a]=""}}}return xt(n)}catch(t){return e}}(t,n)+(r?" "+r:"")}))}Ht.prototype.M=function(){Ht.Z.M.call(this),Jt(this)},Ht.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Qt.prototype.Aa=function(){this.g=!1},Qt.prototype.info=function(){};var Yt={},Zt=null;function $t(){return Zt=Zt||new kt}function te(t){it.call(this,Yt.Ma,t)}function ee(t){var e=$t();At(e,new te(e,t))}function ne(t,e){it.call(this,Yt.STAT_EVENT,t),this.stat=e}function re(t){var e=$t();At(e,new ne(e,t))}function ie(t,e){it.call(this,Yt.Na,t),this.size=e}function oe(t,e){if("function"!=typeof t)throw Error("Fn must not be null and must be a function");return f.setTimeout((function(){t()}),e)}Yt.Ma="serverreachability",E(te,it),Yt.STAT_EVENT="statevent",E(ne,it),Yt.Na="timingevent",E(ie,it);var ae={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9},se={qb:"complete",Mb:"success",Ka:"error",Ja:"abort",Eb:"ready",Fb:"readystatechange",TIMEOUT:"timeout",Ab:"incrementaldata",Db:"progress",tb:"downloadprogress",Ub:"uploadprogress"};function ue(){}function ce(t){return t.h||(t.h=t.i())}function he(){}ue.prototype.h=null;var le,fe={OPEN:"a",pb:"b",Ka:"c",Bb:"d"};function pe(){it.call(this,"d")}function de(){it.call(this,"c")}function ve(){}function ye(t,e,n,r){this.l=t,this.j=e,this.m=n,this.X=r||1,this.V=new Ht(this),this.P=ge,t=W?125:void 0,this.W=new Vt(t),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 me}function me(){this.i=null,this.g="",this.h=!1}E(pe,it),E(de,it),E(ve,ue),ve.prototype.g=function(){return new XMLHttpRequest},ve.prototype.i=function(){return{}},le=new ve;var ge=45e3,be={},we={};function _e(t,e,n){t.K=1,t.v=Ke(Fe(e)),t.s=n,t.U=!0,Ee(t,null)}function Ee(t,e){t.F=Date.now(),ke(t),t.A=Fe(t.v);var n=t.A,r=t.X;Array.isArray(r)||(r=[String(r)]),rn(n.h,"t",r),t.C=0,n=t.l.H,t.h=new me,t.g=or(t.l,n?e:null,!t.s),0<t.O&&(t.L=new Kt(w(t.Ia,t,t.g),t.O)),zt(t.V,t.g,"readystatechange",t.gb),e=t.H?M(t.H):{},t.s?(t.u||(t.u="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.g.ea(t.A,t.u,t.s,e)):(t.u="GET",t.g.ea(t.A,t.u,null,e)),ee(1),function(t,e,n,r,i,o){t.info((function(){if(t.g)if(o)for(var a="",s=o.split("&"),u=0;u<s.length;u++){var c=s[u].split("=");if(1<c.length){var h=c[0];c=c[1];var l=h.split("_");a=2<=l.length&&"type"==l[1]?a+(h+"=")+c+"&":a+(h+"=redacted&")}}else a=null;else a=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+e+"\n"+n+"\n"+a}))}(t.j,t.u,t.A,t.m,t.X,t.s)}function Se(t){return!!t.g&&"GET"==t.u&&2!=t.K&&t.l.Ba}function Ie(t,e,n){for(var r,i=!0;!t.I&&t.C<n.length;){if((r=Te(t,n))==we){4==e&&(t.o=4,re(14),i=!1),Xt(t.j,t.m,null,"[Incomplete Response]");break}if(r==be){t.o=4,re(15),Xt(t.j,t.m,n,"[Invalid Chunk]"),i=!1;break}Xt(t.j,t.m,r,null),Ce(t,r)}Se(t)&&r!=we&&r!=be&&(t.h.g="",t.C=0),4!=e||0!=n.length||t.h.h||(t.o=1,re(16),i=!1),t.i=t.i&&i,i?0<n.length&&!t.aa&&(t.aa=!0,(e=t.l).g==t&&e.$&&!e.L&&(e.h.info("Great, no buffering proxy detected. Bytes received: "+n.length),Yn(e),e.L=!0,re(11))):(Xt(t.j,t.m,n,"[Invalid Chunked Response]"),Ne(t),xe(t))}function Te(t,e){var n=t.C,r=e.indexOf("\n",n);return-1==r?we:(n=Number(e.substring(n,r)),isNaN(n)?be:(r+=1)+n>e.length?we:(e=e.substr(r,n),t.C=r+n,e))}function ke(t){t.Y=Date.now()+t.P,Ae(t,t.P)}function Ae(t,e){if(null!=t.B)throw Error("WatchDog timer not null");t.B=oe(w(t.eb,t),e)}function Oe(t){t.B&&(f.clearTimeout(t.B),t.B=null)}function xe(t){0==t.l.G||t.I||tr(t.l,t)}function Ne(t){Oe(t);var e=t.L;e&&"function"==typeof e.na&&e.na(),t.L=null,qt(t.W),Jt(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function Ce(t,e){try{var n=t.l;if(0!=n.G&&(n.g==t||ln(n.i,t)))if(n.I=t.N,!t.J&&ln(n.i,t)&&3==n.G){try{var r=n.Ca.g.parse(e)}catch(o){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){t:if(!n.u){if(n.g){if(!(n.g.F+3e3<t.F))break t;$n(n),Bn(n)}Xn(n),re(18)}}else n.ta=i[1],0<n.ta-n.U&&37500>i[2]&&n.N&&0==n.A&&!n.v&&(n.v=oe(w(n.ab,n),6e3));if(1>=hn(n.i)&&n.ka){try{n.ka()}catch(o){}n.ka=void 0}}else nr(n,11)}else if((t.J||n.g==t)&&$n(n),!x(e))for(i=n.Ca.g.parse(e),e=0;e<i.length;e++){var o=i[e];if(n.U=o[0],o=o[1],2==n.G)if("c"==o[0]){n.J=o[1],n.la=o[2];var a=o[3];null!=a&&(n.ma=a,n.h.info("VER="+n.ma));var s=o[4];null!=s&&(n.za=s,n.h.info("SVER="+n.za));var u=o[5];null!=u&&"number"==typeof u&&0<u&&(r=1.5*u,n.K=r,n.h.info("backChannelRequestTimeoutMs_="+r)),r=n;var c=t.g;if(c){var h=c.g?c.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(h){var l=r.i;!l.g&&(D(h,"spdy")||D(h,"quic")||D(h,"h2"))&&(l.j=l.l,l.g=new Set,l.h&&(fn(l,l.h),l.h=null))}if(r.D){var f=c.g?c.g.getResponseHeader("X-HTTP-Session-Id"):null;f&&(r.sa=f,Ge(r.F,r.D,f))}}n.G=3,n.j&&n.j.xa(),n.$&&(n.O=Date.now()-t.F,n.h.info("Handshake RTT: "+n.O+"ms"));var p=t;if((r=n).oa=ir(r,r.H?r.la:null,r.W),p.J){pn(r.i,p);var d=p,v=r.K;v&&d.setTimeout(v),d.B&&(Oe(d),ke(d)),r.g=p}else Qn(r);0<n.l.length&&Hn(n)}else"stop"!=o[0]&&"close"!=o[0]||nr(n,7);else 3==n.G&&("stop"==o[0]||"close"==o[0]?"stop"==o[0]?nr(n,7):qn(n):"noop"!=o[0]&&n.j&&n.j.wa(o),n.A=0)}ee(4)}catch(o){}}function De(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(d(t)||"string"==typeof t)k(t,e,void 0);else{if(t.T&&"function"==typeof t.T)var n=t.T();else if(t.R&&"function"==typeof t.R)n=void 0;else if(d(t)||"string"==typeof t){n=[];for(var r=t.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,t)n[r++]=i;i=(r=function(t){if(t.R&&"function"==typeof t.R)return t.R();if("string"==typeof t)return t.split("");if(d(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}(t)).length;for(var o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}}function Pe(t,e){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 r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof Pe)for(n=t.T(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Re(t){if(t.i!=t.g.length){for(var e=0,n=0;e<t.g.length;){var r=t.g[e];Le(t.h,r)&&(t.g[n++]=r),e++}t.g.length=n}if(t.i!=t.g.length){var i={};for(n=e=0;e<t.g.length;)Le(i,r=t.g[e])||(t.g[n++]=r,i[r]=1),e++;t.g.length=n}}function Le(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(c=ye.prototype).setTimeout=function(t){this.P=t},c.gb=function(t){t=t.target;var e=this.L;e&&3==jn(t)?e.l():this.Ia(t)},c.Ia=function(t){try{if(t==this.g)t:{var e=jn(this.g),n=this.g.Da(),r=this.g.ba();if(!(3>e)&&(3!=e||W||this.g&&(this.h.h||this.g.ga()||Mn(this.g)))){this.I||4!=e||7==n||ee(8==n||0>=r?3:2),Oe(this);var i=this.g.ba();this.N=i;e:if(Se(this)){var o=Mn(this.g);t="";var a=o.length,s=4==jn(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){Ne(this),xe(this);var u="";break e}this.h.i=new f.TextDecoder}for(n=0;n<a;n++)this.h.h=!0,t+=this.h.i.decode(o[n],{stream:s&&n==a-1});o.splice(0,a),this.h.g+=t,this.C=0,u=this.h.g}else u=this.g.ga();if(this.i=200==i,function(t,e,n,r,i,o,a){t.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+e+"\n"+n+"\n"+o+" "+a}))}(this.j,this.u,this.A,this.m,this.X,e,i),this.i){if(this.$&&!this.J){e:{if(this.g){var c,h=this.g;if((c=h.g?h.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!x(c)){var l=c;break e}}l=null}if(!(i=l)){this.i=!1,this.o=3,re(12),Ne(this),xe(this);break t}Xt(this.j,this.m,i,"Initial handshake response via X-HTTP-Initial-Response"),this.J=!0,Ce(this,i)}this.U?(Ie(this,e,u),W&&this.i&&3==e&&(zt(this.V,this.W,"tick",this.fb),this.W.start())):(Xt(this.j,this.m,u,null),Ce(this,u)),4==e&&Ne(this),this.i&&!this.I&&(4==e?tr(this.l,this):(this.i=!1,ke(this)))}else 400==i&&0<u.indexOf("Unknown SID")?(this.o=3,re(12)):(this.o=0,re(13)),Ne(this),xe(this)}}}catch(e){}},c.fb=function(){if(this.g){var t=jn(this.g),e=this.g.ga();this.C<e.length&&(Oe(this),Ie(this,t,e),this.i&&4!=t&&ke(this))}},c.cancel=function(){this.I=!0,Ne(this)},c.eb=function(){this.B=null;var t=Date.now();0<=t-this.Y?(function(t,e){t.info((function(){return"TIMEOUT: "+e}))}(this.j,this.A),2!=this.K&&(ee(3),re(17)),Ne(this),this.o=2,xe(this)):Ae(this,this.Y-t)},(c=Pe.prototype).R=function(){Re(this);for(var t=[],e=0;e<this.g.length;e++)t.push(this.h[this.g[e]]);return t},c.T=function(){return Re(this),this.g.concat()},c.get=function(t,e){return Le(this.h,t)?this.h[t]:e},c.set=function(t,e){Le(this.h,t)||(this.i++,this.g.push(t)),this.h[t]=e},c.forEach=function(t,e){for(var n=this.T(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var je=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Me(t,e){if(this.i=this.s=this.j="",this.m=null,this.o=this.l="",this.g=!1,t instanceof Me){this.g=void 0!==e?e:t.g,Ue(this,t.j),this.s=t.s,Ve(this,t.i),qe(this,t.m),this.l=t.l,e=t.h;var n=new $e;n.i=e.i,e.g&&(n.g=new Pe(e.g),n.h=e.h),Be(this,n),this.o=t.o}else t&&(n=String(t).match(je))?(this.g=!!e,Ue(this,n[1]||"",!0),this.s=He(n[2]||""),Ve(this,n[3]||"",!0),qe(this,n[4]),this.l=He(n[5]||"",!0),Be(this,n[6]||"",!0),this.o=He(n[7]||"")):(this.g=!!e,this.h=new $e(null,this.g))}function Fe(t){return new Me(t)}function Ue(t,e,n){t.j=n?He(e,!0):e,t.j&&(t.j=t.j.replace(/:$/,""))}function Ve(t,e,n){t.i=n?He(e,!0):e}function qe(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.m=e}else t.m=null}function Be(t,e,n){e instanceof $e?(t.h=e,function(t,e){e&&!t.j&&(tn(t),t.i=null,t.g.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(en(this,e),rn(this,n,t))}),t)),t.j=e}(t.h,t.g)):(n||(e=We(e,Ye)),t.h=new $e(e,t.g))}function Ge(t,e,n){t.h.set(e,n)}function Ke(t){return Ge(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function He(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function We(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,ze),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function ze(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Me.prototype.toString=function(){var t=[],e=this.j;e&&t.push(We(e,Je,!0),":");var n=this.i;return(n||"file"==e)&&(t.push("//"),(e=this.s)&&t.push(We(e,Je,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&t.push(":",String(n))),(n=this.l)&&(this.i&&"/"!=n.charAt(0)&&t.push("/"),t.push(We(n,"/"==n.charAt(0)?Xe:Qe,!0))),(n=this.h.toString())&&t.push("?",n),(n=this.o)&&t.push("#",We(n,Ze)),t.join("")};var Je=/[#\/\?@]/g,Qe=/[#\?:]/g,Xe=/[#\?]/g,Ye=/[#\?@]/g,Ze=/#/g;function $e(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function tn(t){t.g||(t.g=new Pe,t.h=0,t.i&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.i,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function en(t,e){tn(t),e=on(t,e),Le(t.g.h,e)&&(t.i=null,t.h-=t.g.get(e).length,Le((t=t.g).h,e)&&(delete t.h[e],t.i--,t.g.length>2*t.i&&Re(t)))}function nn(t,e){return tn(t),e=on(t,e),Le(t.g.h,e)}function rn(t,e,n){en(t,e),0<n.length&&(t.i=null,t.g.set(on(t,e),O(n)),t.h+=n.length)}function on(t,e){return e=String(e),t.j&&(e=e.toLowerCase()),e}(c=$e.prototype).add=function(t,e){tn(this),this.i=null,t=on(this,t);var n=this.g.get(t);return n||this.g.set(t,n=[]),n.push(e),this.h+=1,this},c.forEach=function(t,e){tn(this),this.g.forEach((function(n,r){k(n,(function(n){t.call(e,n,r,this)}),this)}),this)},c.T=function(){tn(this);for(var t=this.g.R(),e=this.g.T(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},c.R=function(t){tn(this);var e=[];if("string"==typeof t)nn(this,t)&&(e=A(e,this.g.get(on(this,t))));else{t=this.g.R();for(var n=0;n<t.length;n++)e=A(e,t[n])}return e},c.set=function(t,e){return tn(this),this.i=null,nn(this,t=on(this,t))&&(this.h-=this.g.get(t).length),this.g.set(t,[e]),this.h+=1,this},c.get=function(t,e){return t&&0<(t=this.R(t)).length?String(t[0]):e},c.toString=function(){if(this.i)return this.i;if(!this.g)return"";for(var t=[],e=this.g.T(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.R(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.i=t.join("&")};var an=function(t,e){this.h=t,this.g=e};function sn(t){this.l=t||un,t=f.PerformanceNavigationTiming?0<(t=f.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):!!(f.g&&f.g.Ea&&f.g.Ea()&&f.g.Ea().Zb),this.j=t?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var un=10;function cn(t){return!!t.h||!!t.g&&t.g.size>=t.j}function hn(t){return t.h?1:t.g?t.g.size:0}function ln(t,e){return t.h?t.h==e:!!t.g&&t.g.has(e)}function fn(t,e){t.g?t.g.add(e):t.h=e}function pn(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function dn(t){var e,n;if(null!=t.h)return t.i.concat(t.h.D);if(null!=t.g&&0!==t.g.size){var r=t.i;try{for(var i=u(t.g.values()),o=i.next();!o.done;o=i.next()){var a=o.value;r=r.concat(a.D)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}return O(t.i)}function vn(){}function yn(){this.g=new vn}function mn(t,e,n){var r=n||"";try{De(t,(function(t,n){var i=t;v(t)&&(i=xt(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(t){throw e.push(r+"type="+encodeURIComponent("_badmap")),t}}function gn(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(t){}}function bn(t){this.l=t.$b||null,this.j=t.ib||!1}function wn(t,e){kt.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=_n,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}sn.prototype.cancel=function(){var t,e;if(this.i=dn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){try{for(var n=u(this.g.values()),r=n.next();!r.done;r=n.next())r.value.cancel()}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.g.clear()}},vn.prototype.stringify=function(t){return f.JSON.stringify(t,void 0)},vn.prototype.parse=function(t){return f.JSON.parse(t,void 0)},E(bn,ue),bn.prototype.g=function(){return new wn(this.l,this.j)},bn.prototype.i=function(t){return function(){return t}}({}),E(wn,kt);var _n=0;function En(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}function Sn(t){t.readyState=4,t.l=null,t.j=null,t.A=null,In(t)}function In(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(c=wn.prototype).open=function(t,e){if(this.readyState!=_n)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,In(this)},c.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;var e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||f).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))},c.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&&4!=this.readyState&&(this.g=!1,Sn(this)),this.readyState=_n},c.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,In(this)),this.g&&(this.readyState=3,In(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==f.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;En(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))},c.Sa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?Sn(this):In(this),3==this.readyState&&En(this)}},c.Ua=function(t){this.g&&(this.response=this.responseText=t,Sn(this))},c.Ta=function(t){this.g&&(this.response=t,Sn(this))},c.ha=function(){this.g&&Sn(this)},c.setRequestHeader=function(t,e){this.v.append(t,e)},c.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},c.getAllResponseHeaders=function(){if(!this.h)return"";for(var t=[],e=this.h.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(wn.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var Tn=f.JSON.parse;function kn(t){kt.call(this),this.headers=new Pe,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=An,this.K=this.L=!1}E(kn,kt);var An="",On=/^https?$/i,xn=["POST","PUT"];function Nn(t){return"content-type"==t.toLowerCase()}function Cn(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,Dn(t),Rn(t)}function Dn(t){t.D||(t.D=!0,At(t,"complete"),At(t,"error"))}function Pn(t){if(t.h&&void 0!==l&&(!t.C[1]||4!=jn(t)||2!=t.ba()))if(t.v&&4==jn(t))Bt(t.Fa,0,t);else if(At(t,"readystatechange"),4==jn(t)){t.h=!1;try{var e,n=t.ba();t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.H).match(je)[1]||null;if(!o&&f.self&&f.self.location){var a=f.self.location.protocol;o=a.substr(0,a.length-1)}i=!On.test(o?o.toLowerCase():"")}e=i}if(e)At(t,"complete"),At(t,"success");else{t.m=6;try{var s=2<jn(t)?t.g.statusText:""}catch(t){s=""}t.j=s+" ["+t.ba()+"]",Dn(t)}}finally{Rn(t)}}}function Rn(t,e){if(t.g){Ln(t);var n=t.g,r=t.C[0]?p:null;t.g=null,t.C=null,e||At(t,"ready");try{n.onreadystatechange=r}catch(t){}}}function Ln(t){t.g&&t.K&&(t.g.ontimeout=null),t.A&&(f.clearTimeout(t.A),t.A=null)}function jn(t){return t.g?t.g.readyState:0}function Mn(t){try{if(!t.g)return null;if("response"in t.g)return t.g.response;switch(t.J){case An:case"text":return t.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in t.g)return t.g.mozResponseArrayBuffer}return null}catch(t){return null}}function Fn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=function(t){var e="";return j(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}(n),"string"==typeof t?null!=n&&encodeURIComponent(String(n)):Ge(t,e,n))}function Un(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function Vn(t){this.za=0,this.l=[],this.h=new Qt,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=Un("failFast",!1,t),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=Un("baseRetryDelayMs",5e3,t),this.$a=Un("retryDelaySeedMs",1e4,t),this.Ya=Un("forwardChannelMaxRetries",2,t),this.ra=Un("forwardChannelRequestTimeoutMs",2e4,t),this.qa=t&&t.xmlHttpFactory||void 0,this.Ba=t&&t.Yb||!1,this.K=void 0,this.H=t&&t.supportsCrossDomainXhr||!1,this.J="",this.i=new sn(t&&t.concurrentRequestLimit),this.Ca=new yn,this.ja=t&&t.fastHandshake||!1,this.Ra=t&&t.Wb||!1,t&&t.Aa&&this.h.Aa(),t&&t.forceLongPolling&&(this.X=!1),this.$=!this.ja&&this.X&&t&&t.detectBufferingProxy||!1,this.ka=void 0,this.O=0,this.L=!1,this.B=null,this.Wa=!t||!1!==t.Xb}function qn(t){if(Gn(t),3==t.G){var e=t.V++,n=Fe(t.F);Ge(n,"SID",t.J),Ge(n,"RID",e),Ge(n,"TYPE","terminate"),zn(t,n),(e=new ye(t,t.h,e,void 0)).K=2,e.v=Ke(Fe(n)),n=!1,f.navigator&&f.navigator.sendBeacon&&(n=f.navigator.sendBeacon(e.v.toString(),"")),!n&&f.Image&&((new Image).src=e.v,n=!0),n||(e.g=or(e.l,null),e.g.ea(e.v)),e.F=Date.now(),ke(e)}rr(t)}function Bn(t){t.g&&(Yn(t),t.g.cancel(),t.g=null)}function Gn(t){Bn(t),t.u&&(f.clearTimeout(t.u),t.u=null),$n(t),t.i.cancel(),t.m&&("number"==typeof t.m&&f.clearTimeout(t.m),t.m=null)}function Kn(t,e){t.l.push(new an(t.Za++,e)),3==t.G&&Hn(t)}function Hn(t){cn(t.i)||t.m||(t.m=!0,jt(t.Ha,t),t.C=0)}function Wn(t,e){var n;n=e?e.m:t.V++;var r=Fe(t.F);Ge(r,"SID",t.J),Ge(r,"RID",n),Ge(r,"AID",t.U),zn(t,r),t.o&&t.s&&Fn(r,t.o,t.s),n=new ye(t,t.h,n,t.C+1),null===t.o&&(n.H=t.s),e&&(t.l=e.D.concat(t.l)),e=Jn(t,n,1e3),n.setTimeout(Math.round(.5*t.ra)+Math.round(.5*t.ra*Math.random())),fn(t.i,n),_e(n,r,e)}function zn(t,e){t.j&&De({},(function(t,n){Ge(e,n,t)}))}function Jn(t,e,n){n=Math.min(t.l.length,n);var r=t.j?w(t.j.Oa,t.j,t):null;t:for(var i=t.l,o=-1;;){var a=["count="+n];-1==o?0<n?(o=i[0].h,a.push("ofs="+o)):o=0:a.push("ofs="+o);for(var s=!0,u=0;u<n;u++){var c=i[u].h,h=i[u].g;if(0>(c-=o))o=Math.max(0,i[u].h-100),s=!1;else try{mn(h,a,"req"+c+"_")}catch(t){r&&r(h)}}if(s){r=a.join("&");break t}}return t=t.l.splice(0,n),e.D=t,r}function Qn(t){t.g||t.u||(t.Y=1,jt(t.Ga,t),t.A=0)}function Xn(t){return!(t.g||t.u||3<=t.A||(t.Y++,t.u=oe(w(t.Ga,t),er(t,t.A)),t.A++,0))}function Yn(t){null!=t.B&&(f.clearTimeout(t.B),t.B=null)}function Zn(t){t.g=new ye(t,t.h,"rpc",t.Y),null===t.o&&(t.g.H=t.s),t.g.O=0;var e=Fe(t.oa);Ge(e,"RID","rpc"),Ge(e,"SID",t.J),Ge(e,"CI",t.N?"0":"1"),Ge(e,"AID",t.U),zn(t,e),Ge(e,"TYPE","xmlhttp"),t.o&&t.s&&Fn(e,t.o,t.s),t.K&&t.g.setTimeout(t.K);var n=t.g;t=t.la,n.K=1,n.v=Ke(Fe(e)),n.s=null,n.U=!0,Ee(n,t)}function $n(t){null!=t.v&&(f.clearTimeout(t.v),t.v=null)}function tr(t,e){var n=null;if(t.g==e){$n(t),Yn(t),t.g=null;var r=2}else{if(!ln(t.i,e))return;n=e.D,pn(t.i,e),r=1}if(t.I=e.N,0!=t.G)if(e.i)if(1==r){n=e.s?e.s.length:0,e=Date.now()-e.F;var i=t.C;At(r=$t(),new ie(r,n,e,i)),Hn(t)}else Qn(t);else if(3==(i=e.o)||0==i&&0<t.I||!(1==r&&function(t,e){return!(hn(t.i)>=t.i.j-(t.m?1:0)||(t.m?(t.l=e.D.concat(t.l),0):1==t.G||2==t.G||t.C>=(t.Xa?0:t.Ya)||(t.m=oe(w(t.Ha,t,e),er(t,t.C)),t.C++,0)))}(t,e)||2==r&&Xn(t)))switch(n&&0<n.length&&(e=t.i,e.i=e.i.concat(n)),i){case 1:nr(t,5);break;case 4:nr(t,10);break;case 3:nr(t,6);break;default:nr(t,2)}}function er(t,e){var n=t.Pa+Math.floor(Math.random()*t.$a);return t.j||(n*=2),n*e}function nr(t,e){if(t.h.info("Error code "+e),2==e){var n=null;t.j&&(n=null);var r=w(t.jb,t);n||(n=new Me("//www.google.com/images/cleardot.gif"),f.location&&"http"==f.location.protocol||Ue(n,"https"),Ke(n)),function(t,e){var n=new Qt;if(f.Image){var r=new Image;r.onload=_(gn,n,r,"TestLoadImage: loaded",!0,e),r.onerror=_(gn,n,r,"TestLoadImage: error",!1,e),r.onabort=_(gn,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=_(gn,n,r,"TestLoadImage: timeout",!1,e),f.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}else e(!1)}(n.toString(),r)}else re(2);t.G=0,t.j&&t.j.va(e),rr(t),Gn(t)}function rr(t){t.G=0,t.I=-1,t.j&&(0==dn(t.i).length&&0==t.l.length||(t.i.i.length=0,O(t.l),t.l.length=0),t.j.ua())}function ir(t,e,n){var r=function(t){return t instanceof Me?Fe(t):new Me(t,void 0)}(n);if(""!=r.i)e&&Ve(r,e+"."+r.i),qe(r,r.m);else{var i=f.location;r=function(t,e,n,r){var i=new Me(null,void 0);return t&&Ue(i,t),e&&Ve(i,e),n&&qe(i,n),r&&(i.l=r),i}(i.protocol,e?e+"."+i.hostname:i.hostname,+i.port,n)}return t.aa&&j(t.aa,(function(t,e){Ge(r,e,t)})),e=t.D,n=t.sa,e&&n&&Ge(r,e,n),Ge(r,"VER",t.ma),zn(t,r),r}function or(t,e,n){if(e&&!t.H)throw Error("Can't create secondary domain capable XhrIo object.");return(e=n&&t.Ba&&!t.qa?new kn(new bn({ib:!0})):new kn(t.qa)).L=t.H,e}function ar(){}function sr(){if(K&&!(10<=Number(nt)))throw Error("Environmental error: no available transport.")}function ur(t,e){kt.call(this),this.g=new Vn(e),this.l=t,this.h=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.g.s=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.ya&&(t?t["X-WebChannel-Client-Profile"]=e.ya:t={"X-WebChannel-Client-Profile":e.ya}),this.g.P=t,(t=e&&e.httpHeadersOverwriteParam)&&!x(t)&&(this.g.o=t),this.A=e&&e.supportsCrossDomainXhr||!1,this.v=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!x(e)&&(this.g.D=e,null!==(t=this.h)&&e in t&&e in(t=this.h)&&delete t[e]),this.j=new lr(this)}function cr(t){pe.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.i=t)&&(t=this.i,e=null!==e&&t in e?e[t]:void 0),this.data=e}else this.data=t}function hr(){de.call(this),this.status=1}function lr(t){this.g=t}(c=kn.prototype).ea=function(t,e,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+t);e=e?e.toUpperCase():"GET",this.H=t,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():le.g(),this.C=this.u?ce(this.u):ce(le),this.g.onreadystatechange=w(this.Fa,this);try{this.F=!0,this.g.open(e,String(t),!0),this.F=!1}catch(t){return void Cn(this,t)}t=n||"";var i=new Pe(this.headers);r&&De(r,(function(t,e){i.set(e,t)})),r=function(t){t:{for(var e=Nn,n=t.length,r="string"==typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"==typeof t?t.charAt(e):t[e]}(i.T()),n=f.FormData&&t instanceof f.FormData,!(0<=T(xn,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(t,e){this.g.setRequestHeader(e,t)}),this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Ln(this),0<this.B&&((this.K=function(t){return K&&et()&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(this.g))?(this.g.timeout=this.B,this.g.ontimeout=w(this.pa,this)):this.A=Bt(this.pa,this.B,this)),this.v=!0,this.g.send(t),this.v=!1}catch(t){Cn(this,t)}},c.pa=function(){void 0!==l&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,At(this,"timeout"),this.abort(8))},c.abort=function(t){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=t||7,At(this,"complete"),At(this,"abort"),Rn(this))},c.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Rn(this,!0)),kn.Z.M.call(this)},c.Fa=function(){this.s||(this.F||this.v||this.l?Pn(this):this.cb())},c.cb=function(){Pn(this)},c.ba=function(){try{return 2<jn(this)?this.g.status:-1}catch(t){return-1}},c.ga=function(){try{return this.g?this.g.responseText:""}catch(t){return""}},c.Qa=function(t){if(this.g){var e=this.g.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),Tn(e)}},c.Da=function(){return this.m},c.La=function(){return"string"==typeof this.j?this.j:String(this.j)},(c=Vn.prototype).ma=8,c.G=1,c.hb=function(t){try{this.h.info("Origin Trials invoked: "+t)}catch(t){}},c.Ha=function(t){if(this.m)if(this.m=null,1==this.G){if(!t){this.V=Math.floor(1e5*Math.random()),t=this.V++;var e=new ye(this,this.h,t,void 0),n=this.s;if(this.P&&(n?U(n=M(n),this.P):n=this.P),null===this.o&&(e.H=n),this.ja)t:{for(var r=0,i=0;i<this.l.length;i++){var o=this.l[i];if(void 0===(o="__data__"in o.g&&"string"==typeof(o=o.g.__data__)?o.length:void 0))break;if(4096<(r+=o)){r=i;break t}if(4096===r||i===this.l.length-1){r=i+1;break t}}r=1e3}else r=1e3;r=Jn(this,e,r),Ge(i=Fe(this.F),"RID",t),Ge(i,"CVER",22),this.D&&Ge(i,"X-HTTP-Session-Id",this.D),zn(this,i),this.o&&n&&Fn(i,this.o,n),fn(this.i,e),this.Ra&&Ge(i,"TYPE","init"),this.ja?(Ge(i,"$req",r),Ge(i,"SID","null"),e.$=!0,_e(e,i,null)):_e(e,i,r),this.G=2}}else 3==this.G&&(t?Wn(this,t):0==this.l.length||cn(this.i)||Wn(this))},c.Ga=function(){if(this.u=null,Zn(this),this.$&&!(this.L||null==this.g||0>=this.O)){var t=2*this.O;this.h.info("BP detection timer enabled: "+t),this.B=oe(w(this.bb,this),t)}},c.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,re(10),Bn(this),Zn(this))},c.ab=function(){null!=this.v&&(this.v=null,Bn(this),Xn(this),re(19))},c.jb=function(t){t?(this.h.info("Successfully pinged google.com"),re(2)):(this.h.info("Failed to ping google.com"),re(1))},(c=ar.prototype).xa=function(){},c.wa=function(){},c.va=function(){},c.ua=function(){},c.Oa=function(){},sr.prototype.g=function(t,e){return new ur(t,e)},E(ur,kt),ur.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var t=this.g,e=this.l,n=this.h||void 0;t.Wa&&(t.h.info("Origin Trials enabled."),jt(w(t.hb,t,e))),re(0),t.W=e,t.aa=n||{},t.N=t.X,t.F=ir(t,null,t.W),Hn(t)},ur.prototype.close=function(){qn(this.g)},ur.prototype.u=function(t){if("string"==typeof t){var e={};e.__data__=t,Kn(this.g,e)}else this.v?((e={}).__data__=xt(t),Kn(this.g,e)):Kn(this.g,t)},ur.prototype.M=function(){this.g.j=null,delete this.j,qn(this.g),delete this.g,ur.Z.M.call(this)},E(cr,pe),E(hr,de),E(lr,ar),lr.prototype.xa=function(){At(this.g,"a")},lr.prototype.wa=function(t){At(this.g,new cr(t))},lr.prototype.va=function(t){At(this.g,new hr(t))},lr.prototype.ua=function(){At(this.g,"b")},sr.prototype.createWebChannel=sr.prototype.g,ur.prototype.send=ur.prototype.u,ur.prototype.open=ur.prototype.m,ur.prototype.close=ur.prototype.close,ae.NO_ERROR=0,ae.TIMEOUT=8,ae.HTTP_ERROR=6,se.COMPLETE="complete",he.EventType=fe,fe.OPEN="a",fe.CLOSE="b",fe.ERROR="c",fe.MESSAGE="d",kt.prototype.listen=kt.prototype.N,kn.prototype.listenOnce=kn.prototype.O,kn.prototype.getLastError=kn.prototype.La,kn.prototype.getLastErrorCode=kn.prototype.Da,kn.prototype.getStatus=kn.prototype.ba,kn.prototype.getResponseJson=kn.prototype.Qa,kn.prototype.getResponseText=kn.prototype.ga,kn.prototype.send=kn.prototype.ea;var fr=ae,pr=se,dr=Yt,vr=10,yr=11,mr=bn,gr=he,br=kn,wr=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.sequenceNumberHandler=function(t){return n.t(t)},this.i=function(t){return e.writeSequenceNumber(t)})}return t.prototype.t=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.i&&this.i(t),t},t}();wr.o=-1;var _r={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"},Er=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).code=e,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return(0,i.ZT)(e,t),e}(Error),Sr=new a.Yd("@firebase/firestore");function Ir(){return Sr.logLevel}function Tr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Sr.logLevel<=a.in.DEBUG){var r=e.map(Or);Sr.debug.apply(Sr,(0,i.ev)(["Firestore (8.10.0): "+t],r))}}function kr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Sr.logLevel<=a.in.ERROR){var r=e.map(Or);Sr.error.apply(Sr,(0,i.ev)(["Firestore (8.10.0): "+t],r))}}function Ar(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Sr.logLevel<=a.in.WARN){var r=e.map(Or);Sr.warn.apply(Sr,(0,i.ev)(["Firestore (8.10.0): "+t],r))}}function Or(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t}var e}function xr(t){void 0===t&&(t="Unexpected state");var e="FIRESTORE (8.10.0) INTERNAL ASSERTION FAILED: "+t;throw kr(e),new Error(e)}function Nr(t,e){t||xr()}function Cr(t,e){return t}function Dr(t){var e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(var r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}var Pr=function(){function t(){}return t.u=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=Math.floor(256/t.length)*t.length,n="";n.length<20;)for(var r=Dr(40),i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%t.length));return n},t}();function Rr(t,e){return t<e?-1:t>e?1:0}function Lr(t,e,n){return t.length===e.length&&t.every((function(t,r){return n(t,e[r])}))}function jr(t){return t+"\0"}var Mr=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new Er(_r.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new Er(_r.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new Er(_r.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new Er(_r.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}return t.now=function(){return t.fromMillis(Date.now())},t.fromDate=function(e){return t.fromMillis(e.getTime())},t.fromMillis=function(e){var n=Math.floor(e/1e3);return new t(n,Math.floor(1e6*(e-1e3*n)))},t.prototype.toDate=function(){return new Date(this.toMillis())},t.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},t.prototype._compareTo=function(t){return this.seconds===t.seconds?Rr(this.nanoseconds,t.nanoseconds):Rr(this.seconds,t.seconds)},t.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds},t.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},t.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},t.prototype.valueOf=function(){var t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},t}(),Fr=function(){function t(t){this.timestamp=t}return t.fromTimestamp=function(e){return new t(e)},t.min=function(){return new t(new Mr(0,0))},t.prototype.compareTo=function(t){return this.timestamp._compareTo(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.toTimestamp=function(){return this.timestamp},t}();function Ur(t){var e=0;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Vr(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function qr(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var Br=function(){function t(t,e,n){void 0===e?e=0:e>t.length&&xr(),void 0===n?n=t.length-e:n>t.length-e&&xr(),this.segments=t,this.offset=e,this.len=n}return Object.defineProperty(t.prototype,"length",{get:function(){return this.len},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.comparator(this,e)},t.prototype.child=function(e){var n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach((function(t){n.push(t)})):n.push(e),this.construct(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.popFirst=function(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)},t.prototype.popLast=function(){return this.construct(this.segments,this.offset,this.length-1)},t.prototype.firstSegment=function(){return this.segments[this.offset]},t.prototype.lastSegment=function(){return this.get(this.length-1)},t.prototype.get=function(t){return this.segments[this.offset+t]},t.prototype.isEmpty=function(){return 0===this.length},t.prototype.isPrefixOf=function(t){if(t.length<this.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.isImmediateParentOf=function(t){if(this.length+1!==t.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.forEach=function(t){for(var e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])},t.prototype.toArray=function(){return this.segments.slice(this.offset,this.limit())},t.comparator=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=t.get(r),o=e.get(r);if(i<o)return-1;if(i>o)return 1}return t.length<e.length?-1:t.length>e.length?1:0},t}(),Gr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.construct=function(t,n,r){return new e(t,n,r)},e.prototype.canonicalString=function(){return this.toArray().join("/")},e.prototype.toString=function(){return this.canonicalString()},e.fromString=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=[],i=0,o=t;i<o.length;i++){var a=o[i];if(a.indexOf("//")>=0)throw new Er(_r.INVALID_ARGUMENT,"Invalid segment ("+a+"). Paths must not contain // in them.");r.push.apply(r,a.split("/").filter((function(t){return t.length>0})))}return new e(r)},e.emptyPath=function(){return new e([])},e}(Br),Kr=/^[_a-zA-Z][_a-zA-Z0-9]*$/,Hr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.construct=function(t,n,r){return new e(t,n,r)},e.isValidIdentifier=function(t){return Kr.test(t)},e.prototype.canonicalString=function(){return this.toArray().map((function(t){return t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),e.isValidIdentifier(t)||(t="`"+t+"`"),t})).join(".")},e.prototype.toString=function(){return this.canonicalString()},e.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},e.keyField=function(){return new e(["__name__"])},e.fromServerFormat=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new Er(_r.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},a=!1;i<t.length;){var s=t[i];if("\\"===s){if(i+1===t.length)throw new Er(_r.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new Er(_r.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);r+=u,i+=2}else"`"===s?(a=!a,i++):"."!==s||a?(r+=s,i++):(o(),i++)}if(o(),a)throw new Er(_r.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e.emptyPath=function(){return new e([])},e}(Br),Wr=function(){function t(t){this.fields=t,t.sort(Hr.comparator)}return t.prototype.covers=function(t){for(var e=0,n=this.fields;e<n.length;e++)if(n[e].isPrefixOf(t))return!0;return!1},t.prototype.isEqual=function(t){return Lr(this.fields,t.fields,(function(t,e){return t.isEqual(e)}))},t}(),zr=function(){function t(t){this.binaryString=t}return t.fromBase64String=function(e){return new t(atob(e))},t.fromUint8Array=function(e){return new t(function(t){for(var e="",n=0;n<t.length;++n)e+=String.fromCharCode(t[n]);return e}(e))},t.prototype.toBase64=function(){return t=this.binaryString,btoa(t);var t},t.prototype.toUint8Array=function(){return function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(this.binaryString)},t.prototype.approximateByteSize=function(){return 2*this.binaryString.length},t.prototype.compareTo=function(t){return Rr(this.binaryString,t.binaryString)},t.prototype.isEqual=function(t){return this.binaryString===t.binaryString},t}();zr.EMPTY_BYTE_STRING=new zr("");var Jr=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Qr(t){if(Nr(!!t),"string"==typeof t){var e=0,n=Jr.exec(t);if(Nr(!!n),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),e=Number(r)}var i=new Date(t);return{seconds:Math.floor(i.getTime()/1e3),nanos:e}}return{seconds:Xr(t.seconds),nanos:Xr(t.nanos)}}function Xr(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function Yr(t){return"string"==typeof t?zr.fromBase64String(t):zr.fromUint8Array(t)}function Zr(t){var e,n;return"server_timestamp"===(null===(n=((null===(e=null==t?void 0:t.mapValue)||void 0===e?void 0:e.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function $r(t){var e=t.mapValue.fields.__previous_value__;return Zr(e)?$r(e):e}function ti(t){var e=Qr(t.mapValue.fields.__local_write_time__.timestampValue);return new Mr(e.seconds,e.nanos)}function ei(t){return null==t}function ni(t){return 0===t&&1/t==-1/0}function ri(t){return"number"==typeof t&&Number.isInteger(t)&&!ni(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var ii=function(){function t(t){this.path=t}return t.fromPath=function(e){return new t(Gr.fromString(e))},t.fromName=function(e){return new t(Gr.fromString(e).popFirst(5))},t.prototype.hasCollectionId=function(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t},t.prototype.isEqual=function(t){return null!==t&&0===Gr.comparator(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.comparator=function(t,e){return Gr.comparator(t.path,e.path)},t.isDocumentKey=function(t){return t.length%2==0},t.fromSegments=function(e){return new t(new Gr(e.slice()))},t}();function oi(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Zr(t)?4:10:xr()}function ai(t,e){var n=oi(t);if(n!==oi(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return ti(t).isEqual(ti(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;var n=Qr(t.timestampValue),r=Qr(e.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return Yr(t.bytesValue).isEqual(Yr(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return Xr(t.geoPointValue.latitude)===Xr(e.geoPointValue.latitude)&&Xr(t.geoPointValue.longitude)===Xr(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return Xr(t.integerValue)===Xr(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){var n=Xr(t.doubleValue),r=Xr(e.doubleValue);return n===r?ni(n)===ni(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return Lr(t.arrayValue.values||[],e.arrayValue.values||[],ai);case 10:return function(t,e){var n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(Ur(n)!==Ur(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!ai(n[i],r[i])))return!1;return!0}(t,e);default:return xr()}}function si(t,e){return void 0!==(t.values||[]).find((function(t){return ai(t,e)}))}function ui(t,e){var n=oi(t),r=oi(e);if(n!==r)return Rr(n,r);switch(n){case 0:return 0;case 1:return Rr(t.booleanValue,e.booleanValue);case 2:return function(t,e){var n=Xr(t.integerValue||t.doubleValue),r=Xr(e.integerValue||e.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(t,e);case 3:return ci(t.timestampValue,e.timestampValue);case 4:return ci(ti(t),ti(e));case 5:return Rr(t.stringValue,e.stringValue);case 6:return function(t,e){var n=Yr(t),r=Yr(e);return n.compareTo(r)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){for(var n=t.split("/"),r=e.split("/"),i=0;i<n.length&&i<r.length;i++){var o=Rr(n[i],r[i]);if(0!==o)return o}return Rr(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){var n=Rr(Xr(t.latitude),Xr(e.latitude));return 0!==n?n:Rr(Xr(t.longitude),Xr(e.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(t,e){for(var n=t.values||[],r=e.values||[],i=0;i<n.length&&i<r.length;++i){var o=ui(n[i],r[i]);if(o)return o}return Rr(n.length,r.length)}(t.arrayValue,e.arrayValue);case 10:return function(t,e){var n=t.fields||{},r=Object.keys(n),i=e.fields||{},o=Object.keys(i);r.sort(),o.sort();for(var a=0;a<r.length&&a<o.length;++a){var s=Rr(r[a],o[a]);if(0!==s)return s;var u=ui(n[r[a]],i[o[a]]);if(0!==u)return u}return Rr(r.length,o.length)}(t.mapValue,e.mapValue);default:throw xr()}}function ci(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return Rr(t,e);var n=Qr(t),r=Qr(e),i=Rr(n.seconds,r.seconds);return 0!==i?i:Rr(n.nanos,r.nanos)}function hi(t){return li(t)}function li(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(t){var e=Qr(t);return"time("+e.seconds+","+e.nanos+")"}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?Yr(t.bytesValue).toBase64():"referenceValue"in t?(n=t.referenceValue,ii.fromName(n).toString()):"geoPointValue"in t?"geo("+(e=t.geoPointValue).latitude+","+e.longitude+")":"arrayValue"in t?function(t){for(var e="[",n=!0,r=0,i=t.values||[];r<i.length;r++)n?n=!1:e+=",",e+=li(i[r]);return e+"]"}(t.arrayValue):"mapValue"in t?function(t){for(var e="{",n=!0,r=0,i=Object.keys(t.fields||{}).sort();r<i.length;r++){var o=i[r];n?n=!1:e+=",",e+=o+":"+li(t.fields[o])}return e+"}"}(t.mapValue):xr();var e,n}function fi(t,e){return{referenceValue:"projects/"+t.projectId+"/databases/"+t.database+"/documents/"+e.path.canonicalString()}}function pi(t){return!!t&&"integerValue"in t}function di(t){return!!t&&"arrayValue"in t}function vi(t){return!!t&&"nullValue"in t}function yi(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function mi(t){return!!t&&"mapValue"in t}function gi(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&"object"==typeof t.timestampValue)return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){var e={mapValue:{fields:{}}};return Vr(t.mapValue.fields,(function(t,n){return e.mapValue.fields[t]=gi(n)})),e}if(t.arrayValue){for(var n={arrayValue:{values:[]}},r=0;r<(t.arrayValue.values||[]).length;++r)n.arrayValue.values[r]=gi(t.arrayValue.values[r]);return n}return Object.assign({},t)}var bi=function(){function t(t){this.value=t}return t.empty=function(){return new t({mapValue:{}})},t.prototype.field=function(t){if(t.isEmpty())return this.value;for(var e=this.value,n=0;n<t.length-1;++n)if(!mi(e=(e.mapValue.fields||{})[t.get(n)]))return null;return(e=(e.mapValue.fields||{})[t.lastSegment()])||null},t.prototype.set=function(t,e){this.getFieldsMap(t.popLast())[t.lastSegment()]=gi(e)},t.prototype.setAll=function(t){var e=this,n=Hr.emptyPath(),r={},i=[];t.forEach((function(t,o){if(!n.isImmediateParentOf(o)){var a=e.getFieldsMap(n);e.applyChanges(a,r,i),r={},i=[],n=o.popLast()}t?r[o.lastSegment()]=gi(t):i.push(o.lastSegment())}));var o=this.getFieldsMap(n);this.applyChanges(o,r,i)},t.prototype.delete=function(t){var e=this.field(t.popLast());mi(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]},t.prototype.isEqual=function(t){return ai(this.value,t.value)},t.prototype.getFieldsMap=function(t){var e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(var n=0;n<t.length;++n){var r=e.mapValue.fields[t.get(n)];mi(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},e.mapValue.fields[t.get(n)]=r),e=r}return e.mapValue.fields},t.prototype.applyChanges=function(t,e,n){Vr(e,(function(e,n){return t[e]=n}));for(var r=0,i=n;r<i.length;r++){var o=i[r];delete t[o]}},t.prototype.clone=function(){return new t(gi(this.value))},t}();function wi(t){var e=[];return Vr(t.fields,(function(t,n){var r=new Hr([t]);if(mi(n)){var i=wi(n.mapValue).fields;if(0===i.length)e.push(r);else for(var o=0,a=i;o<a.length;o++){var s=a[o];e.push(r.child(s))}}else e.push(r)})),new Wr(e)}var _i=function(){function t(t,e,n,r,i){this.key=t,this.documentType=e,this.version=n,this.data=r,this.documentState=i}return t.newInvalidDocument=function(e){return new t(e,0,Fr.min(),bi.empty(),0)},t.newFoundDocument=function(e,n,r){return new t(e,1,n,r,0)},t.newNoDocument=function(e,n){return new t(e,2,n,bi.empty(),0)},t.newUnknownDocument=function(e,n){return new t(e,3,n,bi.empty(),2)},t.prototype.convertToFoundDocument=function(t,e){return this.version=t,this.documentType=1,this.data=e,this.documentState=0,this},t.prototype.convertToNoDocument=function(t){return this.version=t,this.documentType=2,this.data=bi.empty(),this.documentState=0,this},t.prototype.convertToUnknownDocument=function(t){return this.version=t,this.documentType=3,this.data=bi.empty(),this.documentState=2,this},t.prototype.setHasCommittedMutations=function(){return this.documentState=2,this},t.prototype.setHasLocalMutations=function(){return this.documentState=1,this},Object.defineProperty(t.prototype,"hasLocalMutations",{get:function(){return 1===this.documentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasCommittedMutations",{get:function(){return 2===this.documentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations},enumerable:!1,configurable:!0}),t.prototype.isValidDocument=function(){return 0!==this.documentType},t.prototype.isFoundDocument=function(){return 1===this.documentType},t.prototype.isNoDocument=function(){return 2===this.documentType},t.prototype.isUnknownDocument=function(){return 3===this.documentType},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)},t.prototype.clone=function(){return new t(this.key,this.documentType,this.version,this.data.clone(),this.documentState)},t.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+JSON.stringify(this.data.value)+", {documentType: "+this.documentType+"}), {documentState: "+this.documentState+"})"},t}(),Ei=function(t,e,n,r,i,o,a){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=a,this.h=null};function Si(t,e,n,r,i,o,a){return void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),new Ei(t,e,n,r,i,o,a)}function Ii(t){var e=Cr(t);if(null===e.h){var n=e.path.canonicalString();null!==e.collectionGroup&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map((function(t){return function(t){return t.field.canonicalString()+t.op.toString()+hi(t.value)}(t)})).join(","),n+="|ob:",n+=e.orderBy.map((function(t){return function(t){return t.field.canonicalString()+t.dir}(t)})).join(","),ei(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=Mi(e.startAt)),e.endAt&&(n+="|ub:",n+=Mi(e.endAt)),e.h=n}return e.h}function Ti(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(var n=0;n<t.orderBy.length;n++)if(!Ui(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(var r=0;r<t.filters.length;r++)if(i=t.filters[r],o=e.filters[r],i.op!==o.op||!i.field.isEqual(o.field)||!ai(i.value,o.value))return!1;var i,o;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!qi(t.startAt,e.startAt)&&qi(t.endAt,e.endAt)}function ki(t){return ii.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}var Ai=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).field=e,i.op=n,i.value=r,i}return(0,i.ZT)(e,t),e.create=function(t,n,r){return t.isKeyField()?"in"===n||"not-in"===n?this.l(t,n,r):new Oi(t,n,r):"array-contains"===n?new Di(t,r):"in"===n?new Pi(t,r):"not-in"===n?new Ri(t,r):"array-contains-any"===n?new Li(t,r):new e(t,n,r)},e.l=function(t,e,n){return"in"===e?new xi(t,n):new Ni(t,n)},e.prototype.matches=function(t){var e=t.data.field(this.field);return"!="===this.op?null!==e&&this.m(ui(e,this.value)):null!==e&&oi(this.value)===oi(e)&&this.m(ui(e,this.value))},e.prototype.m=function(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return 0===t;case"!=":return 0!==t;case">":return t>0;case">=":return t>=0;default:return xr()}},e.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},e}((function(){})),Oi=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,r)||this).key=ii.fromName(r.referenceValue),i}return(0,i.ZT)(e,t),e.prototype.matches=function(t){var e=ii.comparator(t.key,this.key);return this.m(e)},e}(Ai),xi=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"in",n)||this).keys=Ci(0,n),r}return(0,i.ZT)(e,t),e.prototype.matches=function(t){return this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Ai),Ni=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"not-in",n)||this).keys=Ci(0,n),r}return(0,i.ZT)(e,t),e.prototype.matches=function(t){return!this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Ai);function Ci(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(t){return ii.fromName(t.referenceValue)}))}var Di=function(t){function e(e,n){return t.call(this,e,"array-contains",n)||this}return(0,i.ZT)(e,t),e.prototype.matches=function(t){var e=t.data.field(this.field);return di(e)&&si(e.arrayValue,this.value)},e}(Ai),Pi=function(t){function e(e,n){return t.call(this,e,"in",n)||this}return(0,i.ZT)(e,t),e.prototype.matches=function(t){var e=t.data.field(this.field);return null!==e&&si(this.value.arrayValue,e)},e}(Ai),Ri=function(t){function e(e,n){return t.call(this,e,"not-in",n)||this}return(0,i.ZT)(e,t),e.prototype.matches=function(t){if(si(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var e=t.data.field(this.field);return null!==e&&!si(this.value.arrayValue,e)},e}(Ai),Li=function(t){function e(e,n){return t.call(this,e,"array-contains-any",n)||this}return(0,i.ZT)(e,t),e.prototype.matches=function(t){var e=this,n=t.data.field(this.field);return!(!di(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(t){return si(e.value.arrayValue,t)}))},e}(Ai),ji=function(t,e){this.position=t,this.before=e};function Mi(t){return(t.before?"b":"a")+":"+t.position.map((function(t){return hi(t)})).join(",")}var Fi=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};function Ui(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function Vi(t,e,n){for(var r=0,i=0;i<t.position.length;i++){var o=e[i],a=t.position[i];if(r=o.field.isKeyField()?ii.comparator(ii.fromName(a.referenceValue),n.key):ui(a,n.data.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return t.before?r<=0:r<0}function qi(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.before!==e.before||t.position.length!==e.position.length)return!1;for(var n=0;n<t.position.length;n++)if(!ai(t.position[n],e.position[n]))return!1;return!0}var Bi=function(t,e,n,r,i,o,a,s){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o="F"),void 0===a&&(a=null),void 0===s&&(s=null),this.path=t,this.collectionGroup=e,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=o,this.startAt=a,this.endAt=s,this.p=null,this.T=null,this.startAt,this.endAt};function Gi(t,e,n,r,i,o,a,s){return new Bi(t,e,n,r,i,o,a,s)}function Ki(t){return new Bi(t)}function Hi(t){return!ei(t.limit)&&"F"===t.limitType}function Wi(t){return!ei(t.limit)&&"L"===t.limitType}function zi(t){return t.explicitOrderBy.length>0?t.explicitOrderBy[0].field:null}function Ji(t){for(var e=0,n=t.filters;e<n.length;e++){var r=n[e];if(r.g())return r.field}return null}function Qi(t){return null!==t.collectionGroup}function Xi(t){var e=Cr(t);if(null===e.p){e.p=[];var n=Ji(e),r=zi(e);if(null!==n&&null===r)n.isKeyField()||e.p.push(new Fi(n)),e.p.push(new Fi(Hr.keyField(),"asc"));else{for(var i=!1,o=0,a=e.explicitOrderBy;o<a.length;o++){var s=a[o];e.p.push(s),s.field.isKeyField()&&(i=!0)}if(!i){var u=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.p.push(new Fi(Hr.keyField(),u))}}}return e.p}function Yi(t){var e=Cr(t);if(!e.T)if("F"===e.limitType)e.T=Si(e.path,e.collectionGroup,Xi(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],r=0,i=Xi(e);r<i.length;r++){var o=i[r],a="desc"===o.dir?"asc":"desc";n.push(new Fi(o.field,a))}var s=e.endAt?new ji(e.endAt.position,!e.endAt.before):null,u=e.startAt?new ji(e.startAt.position,!e.startAt.before):null;e.T=Si(e.path,e.collectionGroup,n,e.filters,e.limit,s,u)}return e.T}function Zi(t,e,n){return new Bi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function $i(t,e){return Ti(Yi(t),Yi(e))&&t.limitType===e.limitType}function to(t){return Ii(Yi(t))+"|lt:"+t.limitType}function eo(t){return"Query(target="+function(t){var e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=", filters: ["+t.filters.map((function(t){return(e=t).field.canonicalString()+" "+e.op+" "+hi(e.value);var e})).join(", ")+"]"),ei(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=", orderBy: ["+t.orderBy.map((function(t){return function(t){return t.field.canonicalString()+" ("+t.dir+")"}(t)})).join(", ")+"]"),t.startAt&&(e+=", startAt: "+Mi(t.startAt)),t.endAt&&(e+=", endAt: "+Mi(t.endAt)),"Target("+e+")"}(Yi(t))+"; limitType="+t.limitType+")"}function no(t,e){return e.isFoundDocument()&&function(t,e){var n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):ii.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(var n=0,r=t.explicitOrderBy;n<r.length;n++){var i=r[n];if(!i.field.isKeyField()&&null===e.data.field(i.field))return!1}return!0}(t,e)&&function(t,e){for(var n=0,r=t.filters;n<r.length;n++)if(!r[n].matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!Vi(t.startAt,Xi(t),e)||t.endAt&&Vi(t.endAt,Xi(t),e))}(t,e)}function ro(t){return function(e,n){for(var r=!1,i=0,o=Xi(t);i<o.length;i++){var a=o[i],s=io(a,e,n);if(0!==s)return s;r=r||a.field.isKeyField()}return 0}}function io(t,e,n){var r=t.field.isKeyField()?ii.comparator(e.key,n.key):function(t,e,n){var r=e.data.field(t),i=n.data.field(t);return null!==r&&null!==i?ui(r,i):xr()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return xr()}}function oo(t,e){if(t.I){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ni(e)?"-0":e}}function ao(t){return{integerValue:""+t}}function so(t,e){return ri(e)?ao(e):oo(t,e)}var uo=function(){this._=void 0};function co(t,e,n){return t instanceof fo?function(t,e){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof po?vo(t,e):t instanceof yo?mo(t,e):function(t,e){var n=lo(t,e),r=bo(n)+bo(t.A);return pi(n)&&pi(t.A)?ao(r):oo(t.R,r)}(t,e)}function ho(t,e,n){return t instanceof po?vo(t,e):t instanceof yo?mo(t,e):n}function lo(t,e){return t instanceof go?pi(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null;var n}var fo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e}(uo),po=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return(0,i.ZT)(e,t),e}(uo);function vo(t,e){for(var n=wo(e),r=function(t){n.some((function(e){return ai(e,t)}))||n.push(t)},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var yo=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return(0,i.ZT)(e,t),e}(uo);function mo(t,e){for(var n=wo(e),r=function(t){n=n.filter((function(e){return!ai(e,t)}))},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var go=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).R=e,r.A=n,r}return(0,i.ZT)(e,t),e}(uo);function bo(t){return Xr(t.integerValue||t.doubleValue)}function wo(t){return di(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var _o=function(t,e){this.field=t,this.transform=e},Eo=function(t,e){this.version=t,this.transformResults=e},So=function(){function t(t,e){this.updateTime=t,this.exists=e}return t.none=function(){return new t},t.exists=function(e){return new t(void 0,e)},t.updateTime=function(e){return new t(e)},Object.defineProperty(t.prototype,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)},t}();function Io(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}var To=function(){};function ko(t,e,n){t instanceof Co?function(t,e,n){var r=t.value.clone(),i=Ro(t.fieldTransforms,e,n.transformResults);r.setAll(i),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):t instanceof Do?function(t,e,n){if(Io(t.precondition,e)){var r=Ro(t.fieldTransforms,e,n.transformResults),i=e.data;i.setAll(Po(t)),i.setAll(r),e.convertToFoundDocument(n.version,i).setHasCommittedMutations()}else e.convertToUnknownDocument(n.version)}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function Ao(t,e,n){t instanceof Co?function(t,e,n){if(Io(t.precondition,e)){var r=t.value.clone(),i=Lo(t.fieldTransforms,n,e);r.setAll(i),e.convertToFoundDocument(No(e),r).setHasLocalMutations()}}(t,e,n):t instanceof Do?function(t,e,n){if(Io(t.precondition,e)){var r=Lo(t.fieldTransforms,n,e),i=e.data;i.setAll(Po(t)),i.setAll(r),e.convertToFoundDocument(No(e),i).setHasLocalMutations()}}(t,e,n):function(t,e){Io(t.precondition,e)&&e.convertToNoDocument(Fr.min())}(t,e)}function Oo(t,e){for(var n=null,r=0,i=t.fieldTransforms;r<i.length;r++){var o=i[r],a=e.data.field(o.field),s=lo(o.transform,a||null);null!=s&&(null==n&&(n=bi.empty()),n.set(o.field,s))}return n||null}function xo(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&Lr(t,e,(function(t,e){return function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof po&&e instanceof po||t instanceof yo&&e instanceof yo?Lr(t.elements,e.elements,ai):t instanceof go&&e instanceof go?ai(t.A,e.A):t instanceof fo&&e instanceof fo}(t.transform,e.transform)}(t,e)}))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}function No(t){return t.isFoundDocument()?t.version:Fr.min()}var Co=function(t){function e(e,n,r,i){void 0===i&&(i=[]);var o=this;return(o=t.call(this)||this).key=e,o.value=n,o.precondition=r,o.fieldTransforms=i,o.type=0,o}return(0,i.ZT)(e,t),e}(To),Do=function(t){function e(e,n,r,i,o){void 0===o&&(o=[]);var a=this;return(a=t.call(this)||this).key=e,a.data=n,a.fieldMask=r,a.precondition=i,a.fieldTransforms=o,a.type=1,a}return(0,i.ZT)(e,t),e}(To);function Po(t){var e=new Map;return t.fieldMask.fields.forEach((function(n){if(!n.isEmpty()){var r=t.data.field(n);e.set(n,r)}})),e}function Ro(t,e,n){var r=new Map;Nr(t.length===n.length);for(var i=0;i<n.length;i++){var o=t[i],a=o.transform,s=e.data.field(o.field);r.set(o.field,ho(a,s,n[i]))}return r}function Lo(t,e,n){for(var r=new Map,i=0,o=t;i<o.length;i++){var a=o[i],s=a.transform,u=n.data.field(a.field);r.set(a.field,co(s,u,e))}return r}var jo,Mo,Fo=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.precondition=n,r.type=2,r.fieldTransforms=[],r}return(0,i.ZT)(e,t),e}(To),Uo=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.precondition=n,r.type=3,r.fieldTransforms=[],r}return(0,i.ZT)(e,t),e}(To),Vo=function(t){this.count=t};function qo(t){switch(t){case _r.OK:return xr();case _r.CANCELLED:case _r.UNKNOWN:case _r.DEADLINE_EXCEEDED:case _r.RESOURCE_EXHAUSTED:case _r.INTERNAL:case _r.UNAVAILABLE:case _r.UNAUTHENTICATED:return!1;case _r.INVALID_ARGUMENT:case _r.NOT_FOUND:case _r.ALREADY_EXISTS:case _r.PERMISSION_DENIED:case _r.FAILED_PRECONDITION:case _r.ABORTED:case _r.OUT_OF_RANGE:case _r.UNIMPLEMENTED:case _r.DATA_LOSS:return!0;default:return xr()}}function Bo(t){if(void 0===t)return kr("GRPC error has no .code"),_r.UNKNOWN;switch(t){case jo.OK:return _r.OK;case jo.CANCELLED:return _r.CANCELLED;case jo.UNKNOWN:return _r.UNKNOWN;case jo.DEADLINE_EXCEEDED:return _r.DEADLINE_EXCEEDED;case jo.RESOURCE_EXHAUSTED:return _r.RESOURCE_EXHAUSTED;case jo.INTERNAL:return _r.INTERNAL;case jo.UNAVAILABLE:return _r.UNAVAILABLE;case jo.UNAUTHENTICATED:return _r.UNAUTHENTICATED;case jo.INVALID_ARGUMENT:return _r.INVALID_ARGUMENT;case jo.NOT_FOUND:return _r.NOT_FOUND;case jo.ALREADY_EXISTS:return _r.ALREADY_EXISTS;case jo.PERMISSION_DENIED:return _r.PERMISSION_DENIED;case jo.FAILED_PRECONDITION:return _r.FAILED_PRECONDITION;case jo.ABORTED:return _r.ABORTED;case jo.OUT_OF_RANGE:return _r.OUT_OF_RANGE;case jo.UNIMPLEMENTED:return _r.UNIMPLEMENTED;case jo.DATA_LOSS:return _r.DATA_LOSS;default:return xr()}}(Mo=jo||(jo={}))[Mo.OK=0]="OK",Mo[Mo.CANCELLED=1]="CANCELLED",Mo[Mo.UNKNOWN=2]="UNKNOWN",Mo[Mo.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Mo[Mo.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Mo[Mo.NOT_FOUND=5]="NOT_FOUND",Mo[Mo.ALREADY_EXISTS=6]="ALREADY_EXISTS",Mo[Mo.PERMISSION_DENIED=7]="PERMISSION_DENIED",Mo[Mo.UNAUTHENTICATED=16]="UNAUTHENTICATED",Mo[Mo.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Mo[Mo.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Mo[Mo.ABORTED=10]="ABORTED",Mo[Mo.OUT_OF_RANGE=11]="OUT_OF_RANGE",Mo[Mo.UNIMPLEMENTED=12]="UNIMPLEMENTED",Mo[Mo.INTERNAL=13]="INTERNAL",Mo[Mo.UNAVAILABLE=14]="UNAVAILABLE",Mo[Mo.DATA_LOSS=15]="DATA_LOSS";var Go=function(){function t(t,e){this.comparator=t,this.root=e||Ho.EMPTY}return t.prototype.insert=function(e,n){return new t(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,Ho.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Ho.BLACK,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.isEmpty();){var n=this.comparator(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null},t.prototype.indexOf=function(t){for(var e=0,n=this.root;!n.isEmpty();){var r=this.comparator(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1},t.prototype.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),t.prototype.minKey=function(){return this.root.minKey()},t.prototype.maxKey=function(){return this.root.maxKey()},t.prototype.inorderTraversal=function(t){return this.root.inorderTraversal(t)},t.prototype.forEach=function(t){this.inorderTraversal((function(e,n){return t(e,n),!1}))},t.prototype.toString=function(){var t=[];return this.inorderTraversal((function(e,n){return t.push(e+":"+n),!1})),"{"+t.join(", ")+"}"},t.prototype.reverseTraversal=function(t){return this.root.reverseTraversal(t)},t.prototype.getIterator=function(){return new Ko(this.root,null,this.comparator,!1)},t.prototype.getIteratorFrom=function(t){return new Ko(this.root,t,this.comparator,!1)},t.prototype.getReverseIterator=function(){return new Ko(this.root,null,this.comparator,!0)},t.prototype.getReverseIteratorFrom=function(t){return new Ko(this.root,t,this.comparator,!0)},t}(),Ko=function(){function t(t,e,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!t.isEmpty();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(0===i){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}return t.prototype.getNext=function(){var t=this.nodeStack.pop(),e={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 e},t.prototype.hasNext=function(){return this.nodeStack.length>0},t.prototype.peek=function(){if(0===this.nodeStack.length)return null;var t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}},t}(),Ho=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:t.EMPTY,this.right=null!=o?o:t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min=function(){return this.left.isEmpty()?this:this.left.min()},t.prototype.minKey=function(){return this.min().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp()},t.prototype.removeMin=function(){if(this.left.isEmpty())return t.EMPTY;var e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===n(e,i.key)){if(i.right.isEmpty())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()},t.prototype.isRed=function(){return this.color},t.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},t.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},t.prototype.moveRedRight=function(){var t=this.colorFlip();return t.left.left.isRed()&&(t=(t=t.rotateRight()).colorFlip()),t},t.prototype.rotateLeft=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth=function(){var t=this.check();return Math.pow(2,t)<=this.size+1},t.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw xr();if(this.right.isRed())throw xr();var t=this.left.check();if(t!==this.right.check())throw xr();return t+(this.isRed()?0:1)},t}();Ho.EMPTY=null,Ho.RED=!0,Ho.BLACK=!1,Ho.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw xr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw xr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw xr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw xr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw xr()},enumerable:!1,configurable:!0}),t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new Ho(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.isRed=function(){return!1},t.prototype.checkMaxDepth=function(){return!0},t.prototype.check=function(){return 0},t}());var Wo=function(){function t(t){this.comparator=t,this.data=new Go(this.comparator)}return t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.minKey()},t.prototype.last=function(){return this.data.maxKey()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.inorderTraversal((function(e,n){return t(e),!1}))},t.prototype.forEachInRange=function(t,e){for(var n=this.data.getIteratorFrom(t[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,t[1])>=0)return;e(r.key)}},t.prototype.forEachWhile=function(t,e){var n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return},t.prototype.firstAfterOrEqual=function(t){var e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null},t.prototype.getIterator=function(){return new zo(this.data.getIterator())},t.prototype.getIteratorFrom=function(t){return new zo(this.data.getIteratorFrom(t))},t.prototype.add=function(t){return this.copy(this.data.remove(t).insert(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.isEmpty=function(){return this.data.isEmpty()},t.prototype.unionWith=function(t){var e=this;return e.size<t.size&&(e=t,t=this),t.forEach((function(t){e=e.add(t)})),e},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.data.getIterator(),r=e.data.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0},t.prototype.toArray=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},t.prototype.toString=function(){var t=[];return this.forEach((function(e){return t.push(e)})),"SortedSet("+t.toString()+")"},t.prototype.copy=function(e){var n=new t(this.comparator);return n.data=e,n},t}(),zo=function(){function t(t){this.iter=t}return t.prototype.getNext=function(){return this.iter.getNext().key},t.prototype.hasNext=function(){return this.iter.hasNext()},t}(),Jo=new Go(ii.comparator);function Qo(){return Jo}var Xo=new Go(ii.comparator);function Yo(){return Xo}var Zo=new Go(ii.comparator);function $o(){return Zo}var ta=new Wo(ii.comparator);function ea(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=ta,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var na=new Wo(Rr);function ra(){return na}var ia=function(){function t(t,e,n,r,i){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}return t.createSynthesizedRemoteEventForCurrentChange=function(e,n){var r=new Map;return r.set(e,oa.createSynthesizedTargetChangeForCurrentChange(e,n)),new t(Fr.min(),r,ra(),Qo(),ea())},t}(),oa=function(){function t(t,e,n,r,i){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}return t.createSynthesizedTargetChangeForCurrentChange=function(e,n){return new t(zr.EMPTY_BYTE_STRING,n,ea(),ea(),ea())},t}(),aa=function(t,e,n,r){this.v=t,this.removedTargetIds=e,this.key=n,this.P=r},sa=function(t,e){this.targetId=t,this.V=e},ua=function(t,e,n,r){void 0===n&&(n=zr.EMPTY_BYTE_STRING),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r},ca=function(){function t(){this.S=0,this.D=fa(),this.C=zr.EMPTY_BYTE_STRING,this.N=!1,this.k=!0}return Object.defineProperty(t.prototype,"current",{get:function(){return this.N},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"F",{get:function(){return 0!==this.S},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"$",{get:function(){return this.k},enumerable:!1,configurable:!0}),t.prototype.O=function(t){t.approximateByteSize()>0&&(this.k=!0,this.C=t)},t.prototype.M=function(){var t=ea(),e=ea(),n=ea();return this.D.forEach((function(r,i){switch(i){case 0:t=t.add(r);break;case 2:e=e.add(r);break;case 1:n=n.add(r);break;default:xr()}})),new oa(this.C,this.N,t,e,n)},t.prototype.L=function(){this.k=!1,this.D=fa()},t.prototype.B=function(t,e){this.k=!0,this.D=this.D.insert(t,e)},t.prototype.q=function(t){this.k=!0,this.D=this.D.remove(t)},t.prototype.U=function(){this.S+=1},t.prototype.K=function(){this.S-=1},t.prototype.j=function(){this.k=!0,this.N=!0},t}(),ha=function(){function t(t){this.W=t,this.G=new Map,this.H=Qo(),this.J=la(),this.Y=new Wo(Rr)}return t.prototype.X=function(t){for(var e=0,n=t.v;e<n.length;e++){var r=n[e];t.P&&t.P.isFoundDocument()?this.Z(r,t.P):this.tt(r,t.key,t.P)}for(var i=0,o=t.removedTargetIds;i<o.length;i++)r=o[i],this.tt(r,t.key,t.P)},t.prototype.et=function(t){var e=this;this.forEachTarget(t,(function(n){var r=e.nt(n);switch(t.state){case 0:e.st(n)&&r.O(t.resumeToken);break;case 1:r.K(),r.F||r.L(),r.O(t.resumeToken);break;case 2:r.K(),r.F||e.removeTarget(n);break;case 3:e.st(n)&&(r.j(),r.O(t.resumeToken));break;case 4:e.st(n)&&(e.it(n),r.O(t.resumeToken));break;default:xr()}}))},t.prototype.forEachTarget=function(t,e){var n=this;t.targetIds.length>0?t.targetIds.forEach(e):this.G.forEach((function(t,r){n.st(r)&&e(r)}))},t.prototype.rt=function(t){var e=t.targetId,n=t.V.count,r=this.ot(e);if(r){var i=r.target;if(ki(i))if(0===n){var o=new ii(i.path);this.tt(e,o,_i.newNoDocument(o,Fr.min()))}else Nr(1===n);else this.ct(e)!==n&&(this.it(e),this.Y=this.Y.add(e))}},t.prototype.ut=function(t){var e=this,n=new Map;this.G.forEach((function(r,i){var o=e.ot(i);if(o){if(r.current&&ki(o.target)){var a=new ii(o.target.path);null!==e.H.get(a)||e.at(i,a)||e.tt(i,a,_i.newNoDocument(a,t))}r.$&&(n.set(i,r.M()),r.L())}}));var r=ea();this.J.forEach((function(t,n){var i=!0;n.forEachWhile((function(t){var n=e.ot(t);return!n||2===n.purpose||(i=!1,!1)})),i&&(r=r.add(t))}));var i=new ia(t,n,this.Y,this.H,r);return this.H=Qo(),this.J=la(),this.Y=new Wo(Rr),i},t.prototype.Z=function(t,e){if(this.st(t)){var n=this.at(t,e.key)?2:0;this.nt(t).B(e.key,n),this.H=this.H.insert(e.key,e),this.J=this.J.insert(e.key,this.ht(e.key).add(t))}},t.prototype.tt=function(t,e,n){if(this.st(t)){var r=this.nt(t);this.at(t,e)?r.B(e,1):r.q(e),this.J=this.J.insert(e,this.ht(e).delete(t)),n&&(this.H=this.H.insert(e,n))}},t.prototype.removeTarget=function(t){this.G.delete(t)},t.prototype.ct=function(t){var e=this.nt(t).M();return this.W.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size},t.prototype.U=function(t){this.nt(t).U()},t.prototype.nt=function(t){var e=this.G.get(t);return e||(e=new ca,this.G.set(t,e)),e},t.prototype.ht=function(t){var e=this.J.get(t);return e||(e=new Wo(Rr),this.J=this.J.insert(t,e)),e},t.prototype.st=function(t){var e=null!==this.ot(t);return e||Tr("WatchChangeAggregator","Detected inactive target",t),e},t.prototype.ot=function(t){var e=this.G.get(t);return e&&e.F?null:this.W.lt(t)},t.prototype.it=function(t){var e=this;this.G.set(t,new ca),this.W.getRemoteKeysForTarget(t).forEach((function(n){e.tt(t,n,null)}))},t.prototype.at=function(t,e){return this.W.getRemoteKeysForTarget(t).has(e)},t}();function la(){return new Go(ii.comparator)}function fa(){return new Go(ii.comparator)}var pa={asc:"ASCENDING",desc:"DESCENDING"},da={"<":"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"},va=function(t,e){this.databaseId=t,this.I=e};function ya(t,e){return t.I?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function ma(t,e){return t.I?e.toBase64():e.toUint8Array()}function ga(t,e){return ya(t,e.toTimestamp())}function ba(t){return Nr(!!t),Fr.fromTimestamp(function(t){var e=Qr(t);return new Mr(e.seconds,e.nanos)}(t))}function wa(t,e){return function(t){return new Gr(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function _a(t){var e=Gr.fromString(t);return Nr(Ha(e)),e}function Ea(t,e){return wa(t.databaseId,e.path)}function Sa(t,e){var n=_a(e);if(n.get(1)!==t.databaseId.projectId)throw new Er(_r.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new Er(_r.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new ii(Aa(n))}function Ia(t,e){return wa(t.databaseId,e)}function Ta(t){var e=_a(t);return 4===e.length?Gr.emptyPath():Aa(e)}function ka(t){return new Gr(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Aa(t){return Nr(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function Oa(t,e,n){return{name:Ea(t,e),fields:n.value.mapValue.fields}}function xa(t,e,n){var r=Sa(t,e.name),i=ba(e.updateTime),o=new bi({mapValue:{fields:e.fields}}),a=_i.newFoundDocument(r,i,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function Na(t,e){var n;if(e instanceof Co)n={update:Oa(t,e.key,e.value)};else if(e instanceof Fo)n={delete:Ea(t,e.key)};else if(e instanceof Do)n={update:Oa(t,e.key,e.data),updateMask:Ka(e.fieldMask)};else{if(!(e instanceof Uo))return xr();n={verify:Ea(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((function(t){return function(t,e){var n=e.transform;if(n instanceof fo)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof po)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof yo)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof go)return{fieldPath:e.field.canonicalString(),increment:n.A};throw xr()}(0,t)}))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:ga(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:xr()}(t,e.precondition)),n}function Ca(t,e){var n=e.currentDocument?function(t){return void 0!==t.updateTime?So.updateTime(ba(t.updateTime)):void 0!==t.exists?So.exists(t.exists):So.none()}(e.currentDocument):So.none(),r=e.updateTransforms?e.updateTransforms.map((function(e){return function(t,e){var n=null;if("setToServerValue"in e)Nr("REQUEST_TIME"===e.setToServerValue),n=new fo;else if("appendMissingElements"in e){var r=e.appendMissingElements.values||[];n=new po(r)}else if("removeAllFromArray"in e){var i=e.removeAllFromArray.values||[];n=new yo(i)}else"increment"in e?n=new go(t,e.increment):xr();var o=Hr.fromServerFormat(e.fieldPath);return new _o(o,n)}(t,e)})):[];if(e.update){e.update.name;var i=Sa(t,e.update.name),o=new bi({mapValue:{fields:e.update.fields}});if(e.updateMask){var a=function(t){var e=t.fieldPaths||[];return new Wr(e.map((function(t){return Hr.fromServerFormat(t)})))}(e.updateMask);return new Do(i,o,a,n,r)}return new Co(i,o,n,r)}if(e.delete){var s=Sa(t,e.delete);return new Fo(s,n)}if(e.verify){var u=Sa(t,e.verify);return new Uo(u,n)}return xr()}function Da(t,e){return{documents:[Ia(t,e.path)]}}function Pa(t,e){var n={structuredQuery:{}},r=e.path;null!==e.collectionGroup?(n.parent=Ia(t,r),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Ia(t,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);var i=function(t){if(0!==t.length){var e=t.map((function(t){return function(t){if("=="===t.op){if(yi(t.value))return{unaryFilter:{field:Va(t.field),op:"IS_NAN"}};if(vi(t.value))return{unaryFilter:{field:Va(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(yi(t.value))return{unaryFilter:{field:Va(t.field),op:"IS_NOT_NAN"}};if(vi(t.value))return{unaryFilter:{field:Va(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Va(t.field),op:Ua(t.op),value:t.value}}}(t)}));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}}(e.filters);i&&(n.structuredQuery.where=i);var o=function(t){if(0!==t.length)return t.map((function(t){return function(t){return{field:Va(t.field),direction:Fa(t.dir)}}(t)}))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);var a=function(t,e){return t.I||ei(e)?e:{value:e}}(t,e.limit);return null!==a&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=ja(e.startAt)),e.endAt&&(n.structuredQuery.endAt=ja(e.endAt)),n}function Ra(t){var e=Ta(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){Nr(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:e=e.child(o.collectionId)}var a=[];n.where&&(a=La(n.where));var s=[];n.orderBy&&(s=n.orderBy.map((function(t){return function(t){return new Fi(qa(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t)})));var u=null;n.limit&&(u=function(t){var e;return ei(e="object"==typeof t?t.value:t)?null:e}(n.limit));var c=null;n.startAt&&(c=Ma(n.startAt));var h=null;return n.endAt&&(h=Ma(n.endAt)),Gi(e,i,s,a,u,"F",c,h)}function La(t){return t?void 0!==t.unaryFilter?[Ga(t)]:void 0!==t.fieldFilter?[Ba(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return La(t)})).reduce((function(t,e){return t.concat(e)})):xr():[]}function ja(t){return{before:t.before,values:t.position}}function Ma(t){var e=!!t.before,n=t.values||[];return new ji(n,e)}function Fa(t){return pa[t]}function Ua(t){return da[t]}function Va(t){return{fieldPath:t.canonicalString()}}function qa(t){return Hr.fromServerFormat(t.fieldPath)}function Ba(t){return Ai.create(qa(t.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";case"OPERATOR_UNSPECIFIED":default:return xr()}}(t.fieldFilter.op),t.fieldFilter.value)}function Ga(t){switch(t.unaryFilter.op){case"IS_NAN":var e=qa(t.unaryFilter.field);return Ai.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=qa(t.unaryFilter.field);return Ai.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=qa(t.unaryFilter.field);return Ai.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=qa(t.unaryFilter.field);return Ai.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return xr()}}function Ka(t){var e=[];return t.fields.forEach((function(t){return e.push(t.canonicalString())})),{fieldPaths:e}}function Ha(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}function Wa(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=Ja(e)),e=za(t.get(n),e);return Ja(e)}function za(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="";break;case"":n+="";break;default:n+=o}}return n}function Ja(t){return t+""}function Qa(t){var e=t.length;if(Nr(e>=2),2===e)return Nr(""===t.charAt(0)&&""===t.charAt(1)),Gr.emptyPath();for(var n=e-2,r=[],i="",o=0;o<e;){var a=t.indexOf("",o);switch((a<0||a>n)&&xr(),t.charAt(a+1)){case"":var s=t.substring(o,a),u=void 0;0===i.length?u=s:(u=i+=s,i=""),r.push(u);break;case"":i+=t.substring(o,a),i+="\0";break;case"":i+=t.substring(o,a+1);break;default:xr()}o=a+2}return new Gr(r)}var Xa=function(t,e){this.seconds=t,this.nanoseconds=e},Ya=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};Ya.store="owner",Ya.key="owner";var Za=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};Za.store="mutationQueues",Za.keyPath="userId";var $a=function(t,e,n,r,i){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};$a.store="mutations",$a.keyPath="batchId",$a.userMutationsIndex="userMutationsIndex",$a.userMutationsKeyPath=["userId","batchId"];var ts=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,Wa(e)]},t.key=function(t,e,n){return[t,Wa(e),n]},t}();ts.store="documentMutations",ts.PLACEHOLDER=new ts;var es=function(t,e){this.path=t,this.readTime=e},ns=function(t,e){this.path=t,this.version=e},rs=function(t,e,n,r,i,o){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};rs.store="remoteDocuments",rs.readTimeIndex="readTimeIndex",rs.readTimeIndexPath="readTime",rs.collectionReadTimeIndex="collectionReadTimeIndex",rs.collectionReadTimeIndexPath=["parentPath","readTime"];var is=function(t){this.byteSize=t};is.store="remoteDocumentGlobal",is.key="remoteDocumentGlobalKey";var os=function(t,e,n,r,i,o,a){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a};os.store="targets",os.keyPath="targetId",os.queryTargetsIndexName="queryTargetsIndex",os.queryTargetsKeyPath=["canonicalId","targetId"];var as=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};as.store="targetDocuments",as.keyPath=["targetId","path"],as.documentTargetsIndex="documentTargetsIndex",as.documentTargetsKeyPath=["path","targetId"];var ss=function(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r};ss.key="targetGlobalKey",ss.store="targetGlobal";var us=function(t,e){this.collectionId=t,this.parent=e};us.store="collectionParents",us.keyPath=["collectionId","parent"];var cs=function(t,e,n,r){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r};cs.store="clientMetadata",cs.keyPath="clientId";var hs=function(t,e,n){this.bundleId=t,this.createTime=e,this.version=n};hs.store="bundles",hs.keyPath="bundleId";var ls=function(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n};ls.store="namedQueries",ls.keyPath="name";var fs=(0,i.ev)((0,i.ev)([],(0,i.ev)((0,i.ev)([],(0,i.ev)((0,i.ev)([],(0,i.ev)((0,i.ev)([],[Za.store,$a.store,ts.store,rs.store,os.store,Ya.store,ss.store,as.store]),[cs.store])),[is.store])),[us.store])),[hs.store,ls.store]),ps="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",ds=function(){function t(){this.onCommittedListeners=[]}return t.prototype.addOnCommittedListener=function(t){this.onCommittedListeners.push(t)},t.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEach((function(t){return t()}))},t}(),vs=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},ys=function(){function t(t){var e=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((function(t){e.isDone=!0,e.result=t,e.nextCallback&&e.nextCallback(t)}),(function(t){e.isDone=!0,e.error=t,e.catchCallback&&e.catchCallback(t)}))}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.callbackAttached&&xr(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t((function(t,i){r.nextCallback=function(n){r.wrapSuccess(e,n).next(t,i)},r.catchCallback=function(e){r.wrapFailure(n,e).next(t,i)}}))},t.prototype.toPromise=function(){var t=this;return new Promise((function(e,n){t.next(e,n)}))},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction((function(){return e(n)})):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction((function(){return e(n)})):t.reject(n)},t.resolve=function(e){return new t((function(t,n){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.waitFor=function(e){return new t((function(t,n){var r=0,i=0,o=!1;e.forEach((function(e){++r,e.next((function(){++i,o&&i===r&&t()}),(function(t){return n(t)}))})),o=!0,i===r&&t()}))},t.or=function(e){for(var n=t.resolve(!1),r=function(e){n=n.next((function(n){return n?t.resolve(n):e()}))},i=0,o=e;i<o.length;i++)r(o[i]);return n},t.forEach=function(t,e){var n=this,r=[];return t.forEach((function(t,i){r.push(e.call(n,t,i))})),this.waitFor(r)},t}(),ms=function(){function t(t,e){var n=this;this.action=t,this.transaction=e,this.aborted=!1,this.ft=new vs,this.transaction.oncomplete=function(){n.ft.resolve()},this.transaction.onabort=function(){e.error?n.ft.reject(new ws(t,e.error)):n.ft.resolve()},this.transaction.onerror=function(e){var r=Ts(e.target.error);n.ft.reject(new ws(t,r))}}return t.open=function(e,n,r,i){try{return new t(n,e.transaction(i,r))}catch(e){throw new ws(n,e)}},Object.defineProperty(t.prototype,"dt",{get:function(){return this.ft.promise},enumerable:!1,configurable:!0}),t.prototype.abort=function(t){t&&this.ft.reject(t),this.aborted||(Tr("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},t.prototype.store=function(t){var e=this.transaction.objectStore(t);return new Es(e)},t}(),gs=function(){function t(e,n,r){this.name=e,this.version=n,this.wt=r,12.2===t._t((0,o.z$)())&&kr("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 t.delete=function(t){return Tr("SimpleDb","Removing database:",t),Ss(window.indexedDB.deleteDatabase(t)).toPromise()},t.yt=function(){if("undefined"==typeof indexedDB)return!1;if(t.gt())return!0;var e=(0,o.z$)(),n=t._t(e),r=0<n&&n<10,i=t.Et(e),a=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||a)},t.gt=function(){var t;return"undefined"!=typeof process&&"YES"===(null===(t=process.env)||void 0===t?void 0:t.Tt)},t.It=function(t,e){return t.store(e)},t._t=function(t){var e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)},t.Et=function(t){var e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.At=function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n=this;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:(Tr("SimpleDb","Opening database:",this.name),e=this,[4,new Promise((function(e,r){var i=indexedDB.open(n.name,n.version);i.onsuccess=function(t){var n=t.target.result;e(n)},i.onblocked=function(){r(new ws(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=function(e){var n=e.target.error;"VersionError"===n.name?r(new Er(_r.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.")):r(new ws(t,n))},i.onupgradeneeded=function(t){Tr("SimpleDb",'Database "'+n.name+'" requires upgrade from version:',t.oldVersion);var e=t.target.result;n.wt.Rt(e,i.transaction,t.oldVersion,n.version).next((function(){Tr("SimpleDb","Database upgrade to version "+n.version+" complete")}))}}))]);case 1:e.db=r.sent(),r.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(t){return n.bt(t)}),this.db)]}}))}))},t.prototype.vt=function(t){this.bt=t,this.db&&(this.db.onversionchange=function(e){return t(e)})},t.prototype.runTransaction=function(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s,u,c;return(0,i.Jh)(this,(function(h){switch(h.label){case 0:o="readonly"===e,a=0,s=function(){var e,s,c,h,l;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:++a,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,u.At(t)];case 2:return u.db=i.sent(),e=ms.open(u.db,t,o?"readonly":"readwrite",n),s=r(e).catch((function(t){return e.abort(t),ys.reject(t)})).toPromise(),c={},s.catch((function(){})),[4,e.dt];case 3:return[2,(c.value=(i.sent(),s),c)];case 4:return h=i.sent(),l="FirebaseError"!==h.name&&a<3,Tr("SimpleDb","Transaction failed with error:",h.message,"Retrying:",l),u.close(),l?[3,5]:[2,{value:Promise.reject(h)}];case 5:return[2]}}))},u=this,h.label=1;case 1:return[5,s()];case 2:if("object"==typeof(c=h.sent()))return[2,c.value];h.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),bs=function(){function t(t){this.Pt=t,this.Vt=!1,this.St=null}return Object.defineProperty(t.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.Pt=t},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.Vt=!0},t.prototype.Ct=function(t){this.St=t},t.prototype.delete=function(){return Ss(this.Pt.delete())},t}(),ws=function(t){function e(e,n){var r=this;return(r=t.call(this,_r.UNAVAILABLE,"IndexedDB transaction '"+e+"' failed: "+n)||this).name="IndexedDbTransactionError",r}return(0,i.ZT)(e,t),e}(Er);function _s(t){return"IndexedDbTransactionError"===t.name}var Es=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(Tr("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(Tr("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),Ss(n)},t.prototype.add=function(t){return Tr("SimpleDb","ADD",this.store.name,t,t),Ss(this.store.add(t))},t.prototype.get=function(t){var e=this;return Ss(this.store.get(t)).next((function(n){return void 0===n&&(n=null),Tr("SimpleDb","GET",e.store.name,t,n),n}))},t.prototype.delete=function(t){return Tr("SimpleDb","DELETE",this.store.name,t),Ss(this.store.delete(t))},t.prototype.count=function(){return Tr("SimpleDb","COUNT",this.store.name),Ss(this.store.count())},t.prototype.Nt=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.xt(n,(function(t,e){r.push(e)})).next((function(){return r}))},t.prototype.kt=function(t,e){Tr("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.Ft=!1;var r=this.cursor(n);return this.xt(r,(function(t,e,n){return n.delete()}))},t.prototype.$t=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.xt(r,e)},t.prototype.Ot=function(t){var e=this.cursor({});return new ys((function(n,r){e.onerror=function(t){var e=Ts(t.target.error);r(e)},e.onsuccess=function(e){var r=e.target.result;r?t(r.primaryKey,r.value).next((function(t){t?r.continue():n()})):n()}}))},t.prototype.xt=function(t,e){var n=[];return new ys((function(r,i){t.onerror=function(t){i(t.target.error)},t.onsuccess=function(t){var i=t.target.result;if(i){var o=new bs(i),a=e(i.primaryKey,i.value,o);if(a instanceof ys){var s=a.catch((function(t){return o.done(),ys.reject(t)}));n.push(s)}o.isDone?r():null===o.Dt?i.continue():i.continue(o.Dt)}else r()}})).next((function(){return ys.waitFor(n)}))},t.prototype.options=function(t,e){var n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}},t.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.Ft?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function Ss(t){return new ys((function(e,n){t.onsuccess=function(t){var n=t.target.result;e(n)},t.onerror=function(t){var e=Ts(t.target.error);n(e)}}))}var Is=!1;function Ts(t){var e=gs._t((0,o.z$)());if(e>=12.2&&e<13){var n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){var r=new Er("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 Is||(Is=!0,setTimeout((function(){throw r}),0)),r}}return t}var ks=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Mt=e,r.currentSequenceNumber=n,r}return(0,i.ZT)(e,t),e}(ds);function As(t,e){var n=Cr(t);return gs.It(n.Mt,e)}var Os=function(){function t(t,e,n,r){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=r}return t.prototype.applyToRemoteDocument=function(t,e){for(var n=e.mutationResults,r=0;r<this.mutations.length;r++){var i=this.mutations[r];i.key.isEqual(t.key)&&ko(i,t,n[r])}},t.prototype.applyToLocalView=function(t){for(var e=0,n=this.baseMutations;e<n.length;e++)(o=n[e]).key.isEqual(t.key)&&Ao(o,t,this.localWriteTime);for(var r=0,i=this.mutations;r<i.length;r++){var o;(o=i[r]).key.isEqual(t.key)&&Ao(o,t,this.localWriteTime)}},t.prototype.applyToLocalDocumentSet=function(t){var e=this;this.mutations.forEach((function(n){var r=t.get(n.key),i=r;e.applyToLocalView(i),r.isValidDocument()||i.convertToNoDocument(Fr.min())}))},t.prototype.keys=function(){return this.mutations.reduce((function(t,e){return t.add(e.key)}),ea())},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&Lr(this.mutations,t.mutations,(function(t,e){return xo(t,e)}))&&Lr(this.baseMutations,t.baseMutations,(function(t,e){return xo(t,e)}))},t}(),xs=function(){function t(t,e,n,r){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=r}return t.from=function(e,n,r){Nr(e.mutations.length===r.length);for(var i=$o(),o=e.mutations,a=0;a<o.length;a++)i=i.insert(o[a].key,r[a].version);return new t(e,n,r,i)},t}(),Ns=function(){function t(t,e,n,r,i,o,a){void 0===i&&(i=Fr.min()),void 0===o&&(o=Fr.min()),void 0===a&&(a=zr.EMPTY_BYTE_STRING),this.target=t,this.targetId=e,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a}return t.prototype.withSequenceNumber=function(e){return new t(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken)},t.prototype.withResumeToken=function(e,n){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e)},t.prototype.withLastLimboFreeSnapshotVersion=function(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken)},t}(),Cs=function(t){this.Lt=t};function Ds(t,e){if(e.document)return xa(t.Lt,e.document,!!e.hasCommittedMutations);if(e.noDocument){var n=ii.fromSegments(e.noDocument.path),r=Ms(e.noDocument.readTime),i=_i.newNoDocument(n,r);return e.hasCommittedMutations?i.setHasCommittedMutations():i}if(e.unknownDocument){var o=ii.fromSegments(e.unknownDocument.path);return r=Ms(e.unknownDocument.version),_i.newUnknownDocument(o,r)}return xr()}function Ps(t,e,n){var r=Rs(n),i=e.key.path.popLast().toArray();if(e.isFoundDocument()){var o=function(t,e){return{name:Ea(t,e.key),fields:e.data.value.mapValue.fields,updateTime:ya(t,e.version.toTimestamp())}}(t.Lt,e),a=e.hasCommittedMutations;return new rs(null,null,o,a,r,i)}if(e.isNoDocument()){var s=e.key.path.toArray(),u=js(e.version);return a=e.hasCommittedMutations,new rs(null,new es(s,u),null,a,r,i)}if(e.isUnknownDocument()){var c=e.key.path.toArray(),h=js(e.version);return new rs(new ns(c,h),null,null,!0,r,i)}return xr()}function Rs(t){var e=t.toTimestamp();return[e.seconds,e.nanoseconds]}function Ls(t){var e=new Mr(t[0],t[1]);return Fr.fromTimestamp(e)}function js(t){var e=t.toTimestamp();return new Xa(e.seconds,e.nanoseconds)}function Ms(t){var e=new Mr(t.seconds,t.nanoseconds);return Fr.fromTimestamp(e)}function Fs(t,e){for(var n=(e.baseMutations||[]).map((function(e){return Ca(t.Lt,e)})),r=0;r<e.mutations.length-1;++r){var i=e.mutations[r];if(r+1<e.mutations.length&&void 0!==e.mutations[r+1].transform){var o=e.mutations[r+1];i.updateTransforms=o.transform.fieldTransforms,e.mutations.splice(r+1,1),++r}}var a=e.mutations.map((function(e){return Ca(t.Lt,e)})),s=Mr.fromMillis(e.localWriteTimeMs);return new Os(e.batchId,s,n,a)}function Us(t){var e,n,r=Ms(t.readTime),i=void 0!==t.lastLimboFreeSnapshotVersion?Ms(t.lastLimboFreeSnapshotVersion):Fr.min();return void 0!==t.query.documents?(Nr(1===(n=t.query).documents.length),e=Yi(Ki(Ta(n.documents[0])))):e=function(t){return Yi(Ra(t))}(t.query),new Ns(e,t.targetId,0,t.lastListenSequenceNumber,r,i,zr.fromBase64String(t.resumeToken))}function Vs(t,e){var n,r=js(e.snapshotVersion),i=js(e.lastLimboFreeSnapshotVersion);n=ki(e.target)?Da(t.Lt,e.target):Pa(t.Lt,e.target);var o=e.resumeToken.toBase64();return new os(e.targetId,Ii(e.target),r,o,e.sequenceNumber,i,n)}function qs(t){var e=Ra({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?Zi(e,e.limit,"L"):e}var Bs=function(){function t(){}return t.prototype.getBundleMetadata=function(t,e){return Gs(t).get(e).next((function(t){if(t)return{id:(e=t).bundleId,createTime:Ms(e.createTime),version:e.version};var e}))},t.prototype.saveBundleMetadata=function(t,e){return Gs(t).put({bundleId:(n=e).id,createTime:js(ba(n.createTime)),version:n.version});var n},t.prototype.getNamedQuery=function(t,e){return Ks(t).get(e).next((function(t){if(t)return{name:(e=t).name,query:qs(e.bundledQuery),readTime:Ms(e.readTime)};var e}))},t.prototype.saveNamedQuery=function(t,e){return Ks(t).put(function(t){return{name:t.name,readTime:js(ba(t.readTime)),bundledQuery:t.bundledQuery}}(e))},t}();function Gs(t){return As(t,hs.store)}function Ks(t){return As(t,ls.store)}var Hs=function(){function t(){this.Bt=new Ws}return t.prototype.addToCollectionParentIndex=function(t,e){return this.Bt.add(e),ys.resolve()},t.prototype.getCollectionParents=function(t,e){return ys.resolve(this.Bt.getEntries(e))},t}(),Ws=function(){function t(){this.index={}}return t.prototype.add=function(t){var e=t.lastSegment(),n=t.popLast(),r=this.index[e]||new Wo(Gr.comparator),i=!r.has(n);return this.index[e]=r.add(n),i},t.prototype.has=function(t){var e=t.lastSegment(),n=t.popLast(),r=this.index[e];return r&&r.has(n)},t.prototype.getEntries=function(t){return(this.index[t]||new Wo(Gr.comparator)).toArray()},t}(),zs=function(){function t(){this.qt=new Ws}return t.prototype.addToCollectionParentIndex=function(t,e){var n=this;if(!this.qt.has(e)){var r=e.lastSegment(),i=e.popLast();t.addOnCommittedListener((function(){n.qt.add(e)}));var o={collectionId:r,parent:Wa(i)};return Js(t).put(o)}return ys.resolve()},t.prototype.getCollectionParents=function(t,e){var n=[],r=IDBKeyRange.bound([e,""],[jr(e),""],!1,!0);return Js(t).Nt(r).next((function(t){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.collectionId!==e)break;n.push(Qa(o.parent))}return n}))},t}();function Js(t){return As(t,us.store)}var Qs={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},Xs=function(){function t(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}return t.withCacheSize=function(e){return new t(e,t.DEFAULT_COLLECTION_PERCENTILE,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)},t}();function Ys(t,e,n){var r=t.store($a.store),i=t.store(ts.store),o=[],a=IDBKeyRange.only(n.batchId),s=0,u=r.$t({range:a},(function(t,e,n){return s++,n.delete()}));o.push(u.next((function(){Nr(1===s)})));for(var c=[],h=0,l=n.mutations;h<l.length;h++){var f=l[h],p=ts.key(e,f.key.path,n.batchId);o.push(i.delete(p)),c.push(f.key)}return ys.waitFor(o).next((function(){return c}))}function Zs(t){if(!t)return 0;var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw xr();e=t.noDocument}return JSON.stringify(e).length}Xs.DEFAULT_COLLECTION_PERCENTILE=10,Xs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Xs.DEFAULT=new Xs(41943040,Xs.DEFAULT_COLLECTION_PERCENTILE,Xs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Xs.DISABLED=new Xs(-1,0,0);var $s=function(){function t(t,e,n,r){this.userId=t,this.R=e,this.Ut=n,this.referenceDelegate=r,this.Kt={}}return t.Qt=function(e,n,r,i){return Nr(""!==e.uid),new t(e.isAuthenticated()?e.uid:"",n,r,i)},t.prototype.checkEmpty=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return eu(t).$t({index:$a.userMutationsIndex,range:n},(function(t,n,r){e=!1,r.done()})).next((function(){return e}))},t.prototype.addMutationBatch=function(t,e,n,r){var i=this,o=nu(t),a=eu(t);return a.add({}).next((function(s){Nr("number"==typeof s);for(var u=new Os(s,e,n,r),c=function(t,e,n){var r=n.baseMutations.map((function(e){return Na(t.Lt,e)})),i=n.mutations.map((function(e){return Na(t.Lt,e)}));return new $a(e,n.batchId,n.localWriteTime.toMillis(),r,i)}(i.R,i.userId,u),h=[],l=new Wo((function(t,e){return Rr(t.canonicalString(),e.canonicalString())})),f=0,p=r;f<p.length;f++){var d=p[f],v=ts.key(i.userId,d.key.path,s);l=l.add(d.key.path.popLast()),h.push(a.put(c)),h.push(o.put(v,ts.PLACEHOLDER))}return l.forEach((function(e){h.push(i.Ut.addToCollectionParentIndex(t,e))})),t.addOnCommittedListener((function(){i.Kt[s]=u.keys()})),ys.waitFor(h).next((function(){return u}))}))},t.prototype.lookupMutationBatch=function(t,e){var n=this;return eu(t).get(e).next((function(t){return t?(Nr(t.userId===n.userId),Fs(n.R,t)):null}))},t.prototype.jt=function(t,e){var n=this;return this.Kt[e]?ys.resolve(this.Kt[e]):this.lookupMutationBatch(t,e).next((function(t){if(t){var r=t.keys();return n.Kt[e]=r,r}return null}))},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=this,r=e+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return eu(t).$t({index:$a.userMutationsIndex,range:i},(function(t,e,i){e.userId===n.userId&&(Nr(e.batchId>=r),o=Fs(n.R,e)),i.done()})).next((function(){return o}))},t.prototype.getHighestUnacknowledgedBatchId=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return eu(t).$t({index:$a.userMutationsIndex,range:e,reverse:!0},(function(t,e,r){n=e.batchId,r.done()})).next((function(){return n}))},t.prototype.getAllMutationBatches=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return eu(t).Nt($a.userMutationsIndex,n).next((function(t){return t.map((function(t){return Fs(e.R,t)}))}))},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=ts.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return nu(t).$t({range:i},(function(r,i,a){var s=r[0],u=r[1],c=r[2],h=Qa(u);if(s===n.userId&&e.path.isEqual(h))return eu(t).get(c).next((function(t){if(!t)throw xr();Nr(t.userId===n.userId),o.push(Fs(n.R,t))}));a.done()})).next((function(){return o}))},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Wo(Rr),i=[];return e.forEach((function(e){var o=ts.prefixForPath(n.userId,e.path),a=IDBKeyRange.lowerBound(o),s=nu(t).$t({range:a},(function(t,i,o){var a=t[0],s=t[1],u=t[2],c=Qa(s);a===n.userId&&e.path.isEqual(c)?r=r.add(u):o.done()}));i.push(s)})),ys.waitFor(i).next((function(){return n.Wt(t,r)}))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=this,r=e.path,i=r.length+1,o=ts.prefixForPath(this.userId,r),a=IDBKeyRange.lowerBound(o),s=new Wo(Rr);return nu(t).$t({range:a},(function(t,e,o){var a=t[0],u=t[1],c=t[2],h=Qa(u);a===n.userId&&r.isPrefixOf(h)?h.length===i&&(s=s.add(c)):o.done()})).next((function(){return n.Wt(t,s)}))},t.prototype.Wt=function(t,e){var n=this,r=[],i=[];return e.forEach((function(e){i.push(eu(t).get(e).next((function(t){if(null===t)throw xr();Nr(t.userId===n.userId),r.push(Fs(n.R,t))})))})),ys.waitFor(i).next((function(){return r}))},t.prototype.removeMutationBatch=function(t,e){var n=this;return Ys(t.Mt,this.userId,e).next((function(r){return t.addOnCommittedListener((function(){n.Gt(e.batchId)})),ys.forEach(r,(function(e){return n.referenceDelegate.markPotentiallyOrphaned(t,e)}))}))},t.prototype.Gt=function(t){delete this.Kt[t]},t.prototype.performConsistencyCheck=function(t){var e=this;return this.checkEmpty(t).next((function(n){if(!n)return ys.resolve();var r=IDBKeyRange.lowerBound(ts.prefixForUser(e.userId)),i=[];return nu(t).$t({range:r},(function(t,n,r){if(t[0]===e.userId){var o=Qa(t[1]);i.push(o)}else r.done()})).next((function(){Nr(0===i.length)}))}))},t.prototype.containsKey=function(t,e){return tu(t,this.userId,e)},t.prototype.zt=function(t){var e=this;return ru(t).get(this.userId).next((function(t){return t||new Za(e.userId,-1,"")}))},t}();function tu(t,e,n){var r=ts.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),a=!1;return nu(t).$t({range:o,Ft:!0},(function(t,n,r){var o=t[0],s=t[1];t[2],o===e&&s===i&&(a=!0),r.done()})).next((function(){return a}))}function eu(t){return As(t,$a.store)}function nu(t){return As(t,ts.store)}function ru(t){return As(t,Za.store)}var iu=function(){function t(t){this.Ht=t}return t.prototype.next=function(){return this.Ht+=2,this.Ht},t.Jt=function(){return new t(0)},t.Yt=function(){return new t(-1)},t}(),ou=function(){function t(t,e){this.referenceDelegate=t,this.R=e}return t.prototype.allocateTargetId=function(t){var e=this;return this.Xt(t).next((function(n){var r=new iu(n.highestTargetId);return n.highestTargetId=r.next(),e.Zt(t,n).next((function(){return n.highestTargetId}))}))},t.prototype.getLastRemoteSnapshotVersion=function(t){return this.Xt(t).next((function(t){return Fr.fromTimestamp(new Mr(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))}))},t.prototype.getHighestSequenceNumber=function(t){return this.Xt(t).next((function(t){return t.highestListenSequenceNumber}))},t.prototype.setTargetsMetadata=function(t,e,n){var r=this;return this.Xt(t).next((function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.Zt(t,i)}))},t.prototype.addTargetData=function(t,e){var n=this;return this.te(t,e).next((function(){return n.Xt(t).next((function(r){return r.targetCount+=1,n.ee(e,r),n.Zt(t,r)}))}))},t.prototype.updateTargetData=function(t,e){return this.te(t,e)},t.prototype.removeTargetData=function(t,e){var n=this;return this.removeMatchingKeysForTargetId(t,e.targetId).next((function(){return au(t).delete(e.targetId)})).next((function(){return n.Xt(t)})).next((function(e){return Nr(e.targetCount>0),e.targetCount-=1,n.Zt(t,e)}))},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return au(t).$t((function(a,s){var u=Us(s);u.sequenceNumber<=e&&null===n.get(u.targetId)&&(i++,o.push(r.removeTargetData(t,u)))})).next((function(){return ys.waitFor(o)})).next((function(){return i}))},t.prototype.forEachTarget=function(t,e){return au(t).$t((function(t,n){var r=Us(n);e(r)}))},t.prototype.Xt=function(t){return su(t).get(ss.key).next((function(t){return Nr(null!==t),t}))},t.prototype.Zt=function(t,e){return su(t).put(ss.key,e)},t.prototype.te=function(t,e){return au(t).put(Vs(this.R,e))},t.prototype.ee=function(t,e){var n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},t.prototype.getTargetCount=function(t){return this.Xt(t).next((function(t){return t.targetCount}))},t.prototype.getTargetData=function(t,e){var n=Ii(e),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return au(t).$t({range:r,index:os.queryTargetsIndexName},(function(t,n,r){var o=Us(n);Ti(e,o.target)&&(i=o,r.done())})).next((function(){return i}))},t.prototype.addMatchingKeys=function(t,e,n){var r=this,i=[],o=uu(t);return e.forEach((function(e){var a=Wa(e.path);i.push(o.put(new as(n,a))),i.push(r.referenceDelegate.addReference(t,n,e))})),ys.waitFor(i)},t.prototype.removeMatchingKeys=function(t,e,n){var r=this,i=uu(t);return ys.forEach(e,(function(e){var o=Wa(e.path);return ys.waitFor([i.delete([n,o]),r.referenceDelegate.removeReference(t,n,e)])}))},t.prototype.removeMatchingKeysForTargetId=function(t,e){var n=uu(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=uu(t),i=ea();return r.$t({range:n,Ft:!0},(function(t,e,n){var r=Qa(t[1]),o=new ii(r);i=i.add(o)})).next((function(){return i}))},t.prototype.containsKey=function(t,e){var n=Wa(e.path),r=IDBKeyRange.bound([n],[jr(n)],!1,!0),i=0;return uu(t).$t({index:as.documentTargetsIndex,Ft:!0,range:r},(function(t,e,n){var r=t[0];t[1],0!==r&&(i++,n.done())})).next((function(){return i>0}))},t.prototype.lt=function(t,e){return au(t).get(e).next((function(t){return t?Us(t):null}))},t}();function au(t){return As(t,os.store)}function su(t){return As(t,ss.store)}function uu(t){return As(t,as.store)}function cu(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){if(t.code!==_r.FAILED_PRECONDITION||t.message!==ps)throw t;return Tr("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}function hu(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Rr(n,i);return 0===a?Rr(r,o):a}var lu=function(){function t(t){this.ne=t,this.buffer=new Wo(hu),this.se=0}return t.prototype.ie=function(){return++this.se},t.prototype.re=function(t){var e=[t,this.ie()];if(this.buffer.size<this.ne)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();hu(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!1,configurable:!0}),t}(),fu=function(){function t(t,e){this.garbageCollector=t,this.asyncQueue=e,this.oe=!1,this.ce=null}return t.prototype.start=function(t){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.ue(t)},t.prototype.stop=function(){this.ce&&(this.ce.cancel(),this.ce=null)},Object.defineProperty(t.prototype,"started",{get:function(){return null!==this.ce},enumerable:!1,configurable:!0}),t.prototype.ue=function(t){var e=this,n=this.oe?3e5:6e4;Tr("LruGarbageCollector","Garbage collection scheduled in "+n+"ms"),this.ce=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",n,(function(){return(0,i.mG)(e,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:this.ce=null,this.oe=!0,n.label=1;case 1:return n.trys.push([1,3,,7]),[4,t.collectGarbage(this.garbageCollector)];case 2:return n.sent(),[3,7];case 3:return _s(e=n.sent())?(Tr("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e),[3,6]):[3,4];case 4:return[4,cu(e)];case 5:n.sent(),n.label=6;case 6:return[3,7];case 7:return[4,this.ue(t)];case 8:return n.sent(),[2]}}))}))}))},t}(),pu=function(){function t(t,e){this.ae=t,this.params=e}return t.prototype.calculateTargetCount=function(t,e){return this.ae.he(t).next((function(t){return Math.floor(e/100*t)}))},t.prototype.nthSequenceNumber=function(t,e){var n=this;if(0===e)return ys.resolve(wr.o);var r=new lu(e);return this.ae.forEachTarget(t,(function(t){return r.re(t.sequenceNumber)})).next((function(){return n.ae.le(t,(function(t){return r.re(t)}))})).next((function(){return r.maxValue}))},t.prototype.removeTargets=function(t,e,n){return this.ae.removeTargets(t,e,n)},t.prototype.removeOrphanedDocuments=function(t,e){return this.ae.removeOrphanedDocuments(t,e)},t.prototype.collect=function(t,e){var n=this;return-1===this.params.cacheSizeCollectionThreshold?(Tr("LruGarbageCollector","Garbage collection skipped; disabled"),ys.resolve(Qs)):this.getCacheSize(t).next((function(r){return r<n.params.cacheSizeCollectionThreshold?(Tr("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.cacheSizeCollectionThreshold),Qs):n.fe(t,e)}))},t.prototype.getCacheSize=function(t){return this.ae.getCacheSize(t)},t.prototype.fe=function(t,e){var n,r,i,o,s,u,c,h=this,l=Date.now();return this.calculateTargetCount(t,this.params.percentileToCollect).next((function(e){return e>h.params.maximumSequenceNumbersToCollect?(Tr("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+h.params.maximumSequenceNumbersToCollect+" from "+e),r=h.params.maximumSequenceNumbersToCollect):r=e,o=Date.now(),h.nthSequenceNumber(t,r)})).next((function(r){return n=r,s=Date.now(),h.removeTargets(t,n,e)})).next((function(e){return i=e,u=Date.now(),h.removeOrphanedDocuments(t,n)})).next((function(t){return c=Date.now(),Ir()<=a.in.DEBUG&&Tr("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(o-l)+"ms\n\tDetermined least recently used "+r+" in "+(s-o)+"ms\n\tRemoved "+i+" targets in "+(u-s)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-l)+"ms"),ys.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:t})}))},t}(),du=function(){function t(t,e){this.db=t,this.garbageCollector=function(t,e){return new pu(t,e)}(this,e)}return t.prototype.he=function(t){var e=this.de(t);return this.db.getTargetCache().getTargetCount(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.de=function(t){var e=0;return this.le(t,(function(t){e++})).next((function(){return e}))},t.prototype.forEachTarget=function(t,e){return this.db.getTargetCache().forEachTarget(t,e)},t.prototype.le=function(t,e){return this.we(t,(function(t,n){return e(n)}))},t.prototype.addReference=function(t,e,n){return vu(t,n)},t.prototype.removeReference=function(t,e,n){return vu(t,n)},t.prototype.removeTargets=function(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)},t.prototype.markPotentiallyOrphaned=function(t,e){return vu(t,e)},t.prototype._e=function(t,e){return function(t,e){var n=!1;return ru(t).Ot((function(r){return tu(t,r,e).next((function(t){return t&&(n=!0),ys.resolve(!t)}))})).next((function(){return n}))}(t,e)},t.prototype.removeOrphanedDocuments=function(t,e){var n=this,r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],o=0;return this.we(t,(function(a,s){if(s<=e){var u=n._e(t,a).next((function(e){if(!e)return o++,r.getEntry(t,a).next((function(){return r.removeEntry(a),uu(t).delete([0,Wa(a.path)])}))}));i.push(u)}})).next((function(){return ys.waitFor(i)})).next((function(){return r.apply(t)})).next((function(){return o}))},t.prototype.removeTarget=function(t,e){var n=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,n)},t.prototype.updateLimboDocument=function(t,e){return vu(t,e)},t.prototype.we=function(t,e){var n,r=uu(t),i=wr.o;return r.$t({index:as.documentTargetsIndex},(function(t,r){var o=t[0];t[1];var a=r.path,s=r.sequenceNumber;0===o?(i!==wr.o&&e(new ii(Qa(n)),i),i=s,n=a):i=wr.o})).next((function(){i!==wr.o&&e(new ii(Qa(n)),i)}))},t.prototype.getCacheSize=function(t){return this.db.getRemoteDocumentCache().getSize(t)},t}();function vu(t,e){return uu(t).put(function(t,e){return new as(0,Wa(t.path),e)}(e,t.currentSequenceNumber))}var yu=function(){function t(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={}}return t.prototype.get=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[0],s=o[1];if(this.equalsFn(a,t))return s}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.mapKeyFn(t),r=this.inner[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(this.equalsFn(r[i][0],t))return void(r[i]=[t,e]);r.push([t,e])}else this.inner[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.equalsFn(n[r][0],t))return 1===n.length?delete this.inner[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){Vr(this.inner,(function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[0],s=o[1];t(a,s)}}))},t.prototype.isEmpty=function(){return qr(this.inner)},t}(),mu=function(){function t(){this.changes=new yu((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),this.changesApplied=!1}return t.prototype.getReadTime=function(t){var e=this.changes.get(t);return e?e.readTime:Fr.min()},t.prototype.addEntry=function(t,e){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:e})},t.prototype.removeEntry=function(t,e){void 0===e&&(e=null),this.assertNotApplied(),this.changes.set(t,{document:_i.newInvalidDocument(t),readTime:e})},t.prototype.getEntry=function(t,e){this.assertNotApplied();var n=this.changes.get(e);return void 0!==n?ys.resolve(n.document):this.getFromCache(t,e)},t.prototype.getEntries=function(t,e){return this.getAllFromCache(t,e)},t.prototype.apply=function(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)},t.prototype.assertNotApplied=function(){},t}(),gu=function(){function t(t,e){this.R=t,this.Ut=e}return t.prototype.addEntry=function(t,e,n){return _u(t).put(Eu(e),n)},t.prototype.removeEntry=function(t,e){var n=_u(t),r=Eu(e);return n.delete(r)},t.prototype.updateMetadata=function(t,e){var n=this;return this.getMetadata(t).next((function(r){return r.byteSize+=e,n.me(t,r)}))},t.prototype.getEntry=function(t,e){var n=this;return _u(t).get(Eu(e)).next((function(t){return n.ye(e,t)}))},t.prototype.ge=function(t,e){var n=this;return _u(t).get(Eu(e)).next((function(t){return{document:n.ye(e,t),size:Zs(t)}}))},t.prototype.getEntries=function(t,e){var n=this,r=Qo();return this.pe(t,e,(function(t,e){var i=n.ye(t,e);r=r.insert(t,i)})).next((function(){return r}))},t.prototype.Ee=function(t,e){var n=this,r=Qo(),i=new Go(ii.comparator);return this.pe(t,e,(function(t,e){var o=n.ye(t,e);r=r.insert(t,o),i=i.insert(t,Zs(e))})).next((function(){return{documents:r,Te:i}}))},t.prototype.pe=function(t,e,n){if(e.isEmpty())return ys.resolve();var r=IDBKeyRange.bound(e.first().path.toArray(),e.last().path.toArray()),i=e.getIterator(),o=i.getNext();return _u(t).$t({range:r},(function(t,e,r){for(var a=ii.fromSegments(t);o&&ii.comparator(o,a)<0;)n(o,null),o=i.getNext();o&&o.isEqual(a)&&(n(o,e),o=i.hasNext()?i.getNext():null),o?r.Ct(o.path.toArray()):r.done()})).next((function(){for(;o;)n(o,null),o=i.hasNext()?i.getNext():null}))},t.prototype.getDocumentsMatchingQuery=function(t,e,n){var r=this,i=Qo(),o=e.path.length+1,a={};if(n.isEqual(Fr.min())){var s=e.path.toArray();a.range=IDBKeyRange.lowerBound(s)}else{var u=e.path.toArray(),c=Rs(n);a.range=IDBKeyRange.lowerBound([u,c],!0),a.index=rs.collectionReadTimeIndex}return _u(t).$t(a,(function(t,n,a){if(t.length===o){var s=Ds(r.R,n);e.path.isPrefixOf(s.key.path)?no(e,s)&&(i=i.insert(s.key,s)):a.done()}})).next((function(){return i}))},t.prototype.newChangeBuffer=function(t){return new bu(this,!!t&&t.trackRemovals)},t.prototype.getSize=function(t){return this.getMetadata(t).next((function(t){return t.byteSize}))},t.prototype.getMetadata=function(t){return wu(t).get(is.key).next((function(t){return Nr(!!t),t}))},t.prototype.me=function(t,e){return wu(t).put(is.key,e)},t.prototype.ye=function(t,e){if(e){var n=Ds(this.R,e);if(!n.isNoDocument()||!n.version.isEqual(Fr.min()))return n}return _i.newInvalidDocument(t)},t}(),bu=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Ie=e,r.trackRemovals=n,r.Ae=new yu((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),r}return(0,i.ZT)(e,t),e.prototype.applyChanges=function(t){var e=this,n=[],r=0,i=new Wo((function(t,e){return Rr(t.canonicalString(),e.canonicalString())}));return this.changes.forEach((function(o,a){var s=e.Ae.get(o);if(a.document.isValidDocument()){var u=Ps(e.Ie.R,a.document,e.getReadTime(o));i=i.add(o.path.popLast());var c=Zs(u);r+=c-s,n.push(e.Ie.addEntry(t,o,u))}else if(r-=s,e.trackRemovals){var h=Ps(e.Ie.R,_i.newNoDocument(o,Fr.min()),e.getReadTime(o));n.push(e.Ie.addEntry(t,o,h))}else n.push(e.Ie.removeEntry(t,o))})),i.forEach((function(r){n.push(e.Ie.Ut.addToCollectionParentIndex(t,r))})),n.push(this.Ie.updateMetadata(t,r)),ys.waitFor(n)},e.prototype.getFromCache=function(t,e){var n=this;return this.Ie.ge(t,e).next((function(t){return n.Ae.set(e,t.size),t.document}))},e.prototype.getAllFromCache=function(t,e){var n=this;return this.Ie.Ee(t,e).next((function(t){var e=t.documents;return t.Te.forEach((function(t,e){n.Ae.set(t,e)})),e}))},e}(mu);function wu(t){return As(t,is.store)}function _u(t){return As(t,rs.store)}function Eu(t){return t.path.toArray()}var Su=function(){function t(t){this.R=t}return t.prototype.Rt=function(t,e,n,r){var i=this;Nr(n<r&&n>=0&&r<=11);var o=new ms("createOrUpgrade",e);n<1&&r>=1&&(function(t){t.createObjectStore(Ya.store)}(t),function(t){t.createObjectStore(Za.store,{keyPath:Za.keyPath}),t.createObjectStore($a.store,{keyPath:$a.keyPath,autoIncrement:!0}).createIndex($a.userMutationsIndex,$a.userMutationsKeyPath,{unique:!0}),t.createObjectStore(ts.store)}(t),Iu(t),function(t){t.createObjectStore(rs.store)}(t));var a=ys.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(as.store),t.deleteObjectStore(os.store),t.deleteObjectStore(ss.store)}(t),Iu(t)),a=a.next((function(){return function(t){var e=t.store(ss.store),n=new ss(0,0,Fr.min().toTimestamp(),0);return e.put(ss.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(a=a.next((function(){return function(t,e){return e.store($a.store).Nt().next((function(n){t.deleteObjectStore($a.store),t.createObjectStore($a.store,{keyPath:$a.keyPath,autoIncrement:!0}).createIndex($a.userMutationsIndex,$a.userMutationsKeyPath,{unique:!0});var r=e.store($a.store),i=n.map((function(t){return r.put(t)}));return ys.waitFor(i)}))}(t,o)}))),a=a.next((function(){!function(t){t.createObjectStore(cs.store,{keyPath:cs.keyPath})}(t)}))),n<5&&r>=5&&(a=a.next((function(){return i.Re(o)}))),n<6&&r>=6&&(a=a.next((function(){return function(t){t.createObjectStore(is.store)}(t),i.be(o)}))),n<7&&r>=7&&(a=a.next((function(){return i.ve(o)}))),n<8&&r>=8&&(a=a.next((function(){return i.Pe(t,o)}))),n<9&&r>=9&&(a=a.next((function(){!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){var e=t.objectStore(rs.store);e.createIndex(rs.readTimeIndex,rs.readTimeIndexPath,{unique:!1}),e.createIndex(rs.collectionReadTimeIndex,rs.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&r>=10&&(a=a.next((function(){return i.Ve(o)}))),n<11&&r>=11&&(a=a.next((function(){!function(t){t.createObjectStore(hs.store,{keyPath:hs.keyPath})}(t),function(t){t.createObjectStore(ls.store,{keyPath:ls.keyPath})}(t)}))),a},t.prototype.be=function(t){var e=0;return t.store(rs.store).$t((function(t,n){e+=Zs(n)})).next((function(){var n=new is(e);return t.store(is.store).put(is.key,n)}))},t.prototype.Re=function(t){var e=this,n=t.store(Za.store),r=t.store($a.store);return n.Nt().next((function(n){return ys.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Nt($a.userMutationsIndex,i).next((function(r){return ys.forEach(r,(function(r){Nr(r.userId===n.userId);var i=Fs(e.R,r);return Ys(t,n.userId,i).next((function(){}))}))}))}))}))},t.prototype.ve=function(t){var e=t.store(as.store),n=t.store(rs.store);return t.store(ss.store).get(ss.key).next((function(t){var r=[];return n.$t((function(n,i){var o=new Gr(n),a=function(t){return[0,Wa(t)]}(o);r.push(e.get(a).next((function(n){return n?ys.resolve():function(n){return e.put(new as(0,Wa(n),t.highestListenSequenceNumber))}(o)})))})).next((function(){return ys.waitFor(r)}))}))},t.prototype.Pe=function(t,e){t.createObjectStore(us.store,{keyPath:us.keyPath});var n=e.store(us.store),r=new Ws,i=function(t){if(r.add(t)){var e=t.lastSegment(),i=t.popLast();return n.put({collectionId:e,parent:Wa(i)})}};return e.store(rs.store).$t({Ft:!0},(function(t,e){var n=new Gr(t);return i(n.popLast())})).next((function(){return e.store(ts.store).$t({Ft:!0},(function(t,e){t[0];var n=t[1];t[2];var r=Qa(n);return i(r.popLast())}))}))},t.prototype.Ve=function(t){var e=this,n=t.store(os.store);return n.$t((function(t,r){var i=Us(r),o=Vs(e.R,i);return n.put(o)}))},t}();function Iu(t){t.createObjectStore(as.store,{keyPath:as.keyPath}).createIndex(as.documentTargetsIndex,as.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(os.store,{keyPath:os.keyPath}).createIndex(os.queryTargetsIndexName,os.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(ss.store)}var Tu="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.",ku=function(){function t(e,n,r,i,o,a,s,u,c,h){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Se=o,this.window=a,this.document=s,this.De=c,this.Ce=h,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(t){return Promise.resolve()},!t.yt())throw new Er(_r.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new du(this,i),this.Le=n+"main",this.R=new Cs(u),this.Be=new gs(this.Le,11,new Su(this.R)),this.qe=new ou(this.referenceDelegate,this.R),this.Ut=new zs,this.Ue=function(t,e){return new gu(t,e)}(this.R,this.Ut),this.Ke=new Bs,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,!1===h&&kr("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return t.prototype.start=function(){var t=this;return this.je().then((function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new Er(_r.FAILED_PRECONDITION,Tu);return t.We(),t.Ge(),t.ze(),t.runTransaction("getHighestListenSequenceNumber","readonly",(function(e){return t.qe.getHighestSequenceNumber(e)}))})).then((function(e){t.Ne=new wr(e,t.De)})).then((function(){t.xe=!0})).catch((function(e){return t.Be&&t.Be.close(),Promise.reject(e)}))},t.prototype.He=function(t){var e=this;return this.Me=function(n){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){return this.started?[2,t(n)]:[2]}))}))},t(this.isPrimary)},t.prototype.setDatabaseDeletedListener=function(t){var e=this;this.Be.vt((function(n){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return null===n.newVersion?[4,t()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.setNetworkEnabled=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.Se.enqueueAndForget((function(){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))})))},t.prototype.je=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(e){return Ou(e).put(new cs(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next((function(){if(t.isPrimary)return t.Je(e).next((function(e){e||(t.isPrimary=!1,t.Se.enqueueRetryable((function(){return t.Me(!1)})))}))})).next((function(){return t.Ye(e)})).next((function(n){return t.isPrimary&&!n?t.Xe(e).next((function(){return!1})):!!n&&t.Ze(e).next((function(){return!0}))}))})).catch((function(e){if(_s(e))return Tr("IndexedDbPersistence","Failed to extend owner lease: ",e),t.isPrimary;if(!t.allowTabSynchronization)throw e;return Tr("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((function(e){t.isPrimary!==e&&t.Se.enqueueRetryable((function(){return t.Me(e)})),t.isPrimary=e}))},t.prototype.Je=function(t){var e=this;return Au(t).get(Ya.key).next((function(t){return ys.resolve(e.tn(t))}))},t.prototype.en=function(t){return Ou(t).delete(this.clientId)},t.prototype.nn=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,n,r,o=this;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return!this.isPrimary||this.sn(this.Oe,18e5)?[3,2]:(this.Oe=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(t){var e=As(t,cs.store);return e.Nt().next((function(t){var n=o.rn(t,18e5),r=t.filter((function(t){return-1===n.indexOf(t)}));return ys.forEach(r,(function(t){return e.delete(t.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(t=i.sent(),this.Qe)for(e=0,n=t;e<n.length;e++)r=n[e],this.Qe.removeItem(this.on(r.clientId));i.label=2;case 2:return[2]}}))}))},t.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()}))}))},t.prototype.tn=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.Ye=function(t){var e=this;return this.Ce?ys.resolve(!0):Au(t).get(Ya.key).next((function(n){if(null!==n&&e.sn(n.leaseTimestampMs,5e3)&&!e.cn(n.ownerId)){if(e.tn(n)&&e.networkEnabled)return!0;if(!e.tn(n)){if(!n.allowTabSynchronization)throw new Er(_r.FAILED_PRECONDITION,Tu);return!1}}return!(!e.networkEnabled||!e.inForeground)||Ou(t).Nt().next((function(t){return void 0===e.rn(t,5e3).find((function(t){if(e.clientId!==t.clientId){var n=!e.networkEnabled&&t.networkEnabled,r=!e.inForeground&&t.inForeground,i=e.networkEnabled===t.networkEnabled;if(n||r&&i)return!0}return!1}))}))})).next((function(t){return e.isPrimary!==t&&Tr("IndexedDbPersistence","Client "+(t?"is":"is not")+" eligible for a primary lease."),t}))},t.prototype.shutdown=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t=this;return(0,i.Jh)(this,(function(e){switch(e.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",[Ya.store,cs.store],(function(e){var n=new ks(e,wr.o);return t.Xe(n).next((function(){return t.en(n)}))}))];case 1:return e.sent(),this.Be.close(),this.ln(),[2]}}))}))},t.prototype.rn=function(t,e){var n=this;return t.filter((function(t){return n.sn(t.updateTimeMs,e)&&!n.cn(t.clientId)}))},t.prototype.fn=function(){var t=this;return this.runTransaction("getActiveClients","readonly",(function(e){return Ou(e).Nt().next((function(e){return t.rn(e,18e5).map((function(t){return t.clientId}))}))}))},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.getMutationQueue=function(t){return $s.Qt(t,this.R,this.Ut,this.referenceDelegate)},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getBundleCache=function(){return this.Ke},t.prototype.runTransaction=function(t,e,n){var r=this;Tr("IndexedDbPersistence","Starting transaction:",t);var i,o="readonly"===e?"readonly":"readwrite";return this.Be.runTransaction(t,o,fs,(function(o){return i=new ks(o,r.Ne?r.Ne.next():wr.o),"readwrite-primary"===e?r.Je(i).next((function(t){return!!t||r.Ye(i)})).next((function(e){if(!e)throw kr("Failed to obtain primary lease for action '"+t+"'."),r.isPrimary=!1,r.Se.enqueueRetryable((function(){return r.Me(!1)})),new Er(_r.FAILED_PRECONDITION,ps);return n(i)})).next((function(t){return r.Ze(i).next((function(){return t}))})):r.dn(i).next((function(){return n(i)}))})).then((function(t){return i.raiseOnCommittedEvent(),t}))},t.prototype.dn=function(t){var e=this;return Au(t).get(Ya.key).next((function(t){if(null!==t&&e.sn(t.leaseTimestampMs,5e3)&&!e.cn(t.ownerId)&&!e.tn(t)&&!(e.Ce||e.allowTabSynchronization&&t.allowTabSynchronization))throw new Er(_r.FAILED_PRECONDITION,Tu)}))},t.prototype.Ze=function(t){var e=new Ya(this.clientId,this.allowTabSynchronization,Date.now());return Au(t).put(Ya.key,e)},t.yt=function(){return gs.yt()},t.prototype.Xe=function(t){var e=this,n=Au(t);return n.get(Ya.key).next((function(t){return e.tn(t)?(Tr("IndexedDbPersistence","Releasing primary lease."),n.delete(Ya.key)):ys.resolve()}))},t.prototype.sn=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(kr("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.We=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Fe=function(){t.Se.enqueueAndForget((function(){return t.inForeground="visible"===t.document.visibilityState,t.je()}))},this.document.addEventListener("visibilitychange",this.Fe),this.inForeground="visible"===this.document.visibilityState)},t.prototype.an=function(){this.Fe&&(this.document.removeEventListener("visibilitychange",this.Fe),this.Fe=null)},t.prototype.Ge=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.ke=function(){e.un(),(0,o.G6)()&&navigator.appVersion.match("Version/14")&&e.Se.enterRestrictedMode(!0),e.Se.enqueueAndForget((function(){return e.shutdown()}))},this.window.addEventListener("pagehide",this.ke))},t.prototype.hn=function(){this.ke&&(this.window.removeEventListener("pagehide",this.ke),this.ke=null)},t.prototype.cn=function(t){var e;try{var n=null!==(null===(e=this.Qe)||void 0===e?void 0:e.getItem(this.on(t)));return Tr("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return kr("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},t.prototype.un=function(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(t){kr("Failed to set zombie client id.",t)}},t.prototype.ln=function(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch(t){}},t.prototype.on=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t}();function Au(t){return As(t,Ya.store)}function Ou(t){return As(t,cs.store)}function xu(t,e){var n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var Nu=function(t,e){this.progress=t,this.wn=e},Cu=function(){function t(t,e,n){this.Ue=t,this._n=e,this.Ut=n}return t.prototype.mn=function(t,e){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKey(t,e).next((function(r){return n.yn(t,e,r)}))},t.prototype.yn=function(t,e,n){return this.Ue.getEntry(t,e).next((function(t){for(var e=0,r=n;e<r.length;e++)r[e].applyToLocalView(t);return t}))},t.prototype.gn=function(t,e){t.forEach((function(t,n){for(var r=0,i=e;r<i.length;r++)i[r].applyToLocalView(n)}))},t.prototype.pn=function(t,e){var n=this;return this.Ue.getEntries(t,e).next((function(e){return n.En(t,e).next((function(){return e}))}))},t.prototype.En=function(t,e){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKeys(t,e).next((function(t){return n.gn(e,t)}))},t.prototype.getDocumentsMatchingQuery=function(t,e,n){return function(t){return ii.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Tn(t,e.path):Qi(e)?this.In(t,e,n):this.An(t,e,n)},t.prototype.Tn=function(t,e){return this.mn(t,new ii(e)).next((function(t){var e=Yo();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e}))},t.prototype.In=function(t,e,n){var r=this,i=e.collectionGroup,o=Yo();return this.Ut.getCollectionParents(t,i).next((function(a){return ys.forEach(a,(function(a){var s=function(t,e){return new Bi(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,a.child(i));return r.An(t,s,n).next((function(t){t.forEach((function(t,e){o=o.insert(t,e)}))}))})).next((function(){return o}))}))},t.prototype.An=function(t,e,n){var r,i,o=this;return this.Ue.getDocumentsMatchingQuery(t,e,n).next((function(n){return r=n,o._n.getAllMutationBatchesAffectingQuery(t,e)})).next((function(e){return i=e,o.Rn(t,i,r).next((function(t){r=t;for(var e=0,n=i;e<n.length;e++)for(var o=n[e],a=0,s=o.mutations;a<s.length;a++){var u=s[a],c=u.key,h=r.get(c);null==h&&(h=_i.newInvalidDocument(c),r=r.insert(c,h)),Ao(u,h,o.localWriteTime),h.isFoundDocument()||(r=r.remove(c))}}))})).next((function(){return r.forEach((function(t,n){no(e,n)||(r=r.remove(t))})),r}))},t.prototype.Rn=function(t,e,n){for(var r=ea(),i=0,o=e;i<o.length;i++)for(var a=0,s=o[i].mutations;a<s.length;a++){var u=s[a];u instanceof Do&&null===n.get(u.key)&&(r=r.add(u.key))}var c=n;return this.Ue.getEntries(t,r).next((function(t){return t.forEach((function(t,e){e.isFoundDocument()&&(c=c.insert(t,e))})),c}))},t}(),Du=function(){function t(t,e,n,r){this.targetId=t,this.fromCache=e,this.bn=n,this.vn=r}return t.Pn=function(e,n){for(var r=ea(),i=ea(),o=0,a=n.docChanges;o<a.length;o++){var s=a[o];switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}}return new t(e,n.fromCache,r,i)},t}(),Pu=function(){function t(){}return t.prototype.Vn=function(t){this.Sn=t},t.prototype.getDocumentsMatchingQuery=function(t,e,n,r){var i=this;return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}(e)||n.isEqual(Fr.min())?this.Dn(t,e):this.Sn.pn(t,r).next((function(o){var s=i.Cn(e,o);return(Hi(e)||Wi(e))&&i.Nn(e.limitType,s,r,n)?i.Dn(t,e):(Ir()<=a.in.DEBUG&&Tr("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),eo(e)),i.Sn.getDocumentsMatchingQuery(t,e,n).next((function(t){return s.forEach((function(e){t=t.insert(e.key,e)})),t})))}))},t.prototype.Cn=function(t,e){var n=new Wo(ro(t));return e.forEach((function(e,r){no(t,r)&&(n=n.add(r))})),n},t.prototype.Nn=function(t,e,n,r){if(n.size!==e.size)return!0;var i="F"===t?e.last():e.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)},t.prototype.Dn=function(t,e){return Ir()<=a.in.DEBUG&&Tr("QueryEngine","Using full collection scan to execute query:",eo(e)),this.Sn.getDocumentsMatchingQuery(t,e,Fr.min())},t}(),Ru=function(){function t(t,e,n,r){this.persistence=t,this.xn=e,this.R=r,this.kn=new Go(Rr),this.Fn=new yu((function(t){return Ii(t)}),Ti),this.$n=Fr.min(),this._n=t.getMutationQueue(n),this.On=t.getRemoteDocumentCache(),this.qe=t.getTargetCache(),this.Mn=new Cu(this.On,this._n,this.persistence.getIndexManager()),this.Ke=t.getBundleCache(),this.xn.Vn(this.Mn)}return t.prototype.collectGarbage=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return t.collect(n,e.kn)}))},t}();function Lu(t,e,n,r){return new Ru(t,e,n,r)}function ju(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Cr(t),r=n._n,o=n.Mn,[4,n.persistence.runTransaction("Handle user change","readonly",(function(t){var i;return n._n.getAllMutationBatches(t).next((function(a){return i=a,r=n.persistence.getMutationQueue(e),o=new Cu(n.On,r,n.persistence.getIndexManager()),r.getAllMutationBatches(t)})).next((function(e){for(var n=[],r=[],a=ea(),s=0,u=i;s<u.length;s++){var c=u[s];n.push(c.batchId);for(var h=0,l=c.mutations;h<l.length;h++){var f=l[h];a=a.add(f.key)}}for(var p=0,d=e;p<d.length;p++){var v=d[p];r.push(v.batchId);for(var y=0,m=v.mutations;y<m.length;y++){var g=m[y];a=a.add(g.key)}}return o.pn(t,a).next((function(t){return{Ln:t,removedBatchIds:n,addedBatchIds:r}}))}))}))];case 1:return a=i.sent(),[2,(n._n=r,n.Mn=o,n.xn.Vn(n.Mn),a)]}}))}))}function Mu(t,e){var n=Cr(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(t){var r=e.batch.keys(),i=n.On.newChangeBuffer({trackRemovals:!0});return function(t,e,n,r){var i=n.batch,o=i.keys(),a=ys.resolve();return o.forEach((function(t){a=a.next((function(){return r.getEntry(e,t)})).next((function(e){var o=n.docVersions.get(t);Nr(null!==o),e.version.compareTo(o)<0&&(i.applyToRemoteDocument(e,n),e.isValidDocument()&&r.addEntry(e,n.commitVersion))}))})),a.next((function(){return t._n.removeMutationBatch(e,i)}))}(n,t,e,i).next((function(){return i.apply(t)})).next((function(){return n._n.performConsistencyCheck(t)})).next((function(){return n.Mn.pn(t,r)}))}))}function Fu(t){var e=Cr(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(function(t){return e.qe.getLastRemoteSnapshotVersion(t)}))}function Uu(t,e){var n=Cr(t),r=e.snapshotVersion,i=n.kn;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(t){var o=n.On.newChangeBuffer({trackRemovals:!0});i=n.kn;var a=[];e.targetChanges.forEach((function(e,o){var s=i.get(o);if(s){a.push(n.qe.removeMatchingKeys(t,e.removedDocuments,o).next((function(){return n.qe.addMatchingKeys(t,e.addedDocuments,o)})));var u=e.resumeToken;if(u.approximateByteSize()>0){var c=s.withResumeToken(u,r).withSequenceNumber(t.currentSequenceNumber);i=i.insert(o,c),function(t,e,n){return Nr(e.resumeToken.approximateByteSize()>0),0===t.resumeToken.approximateByteSize()||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(s,c,e)&&a.push(n.qe.updateTargetData(t,c))}}}));var s=Qo();if(e.documentUpdates.forEach((function(r,i){e.resolvedLimboDocuments.has(r)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(t,r))})),a.push(Vu(t,o,e.documentUpdates,r,void 0).next((function(t){s=t}))),!r.isEqual(Fr.min())){var u=n.qe.getLastRemoteSnapshotVersion(t).next((function(e){return n.qe.setTargetsMetadata(t,t.currentSequenceNumber,r)}));a.push(u)}return ys.waitFor(a).next((function(){return o.apply(t)})).next((function(){return n.Mn.En(t,s)})).next((function(){return s}))})).then((function(t){return n.kn=i,t}))}function Vu(t,e,n,r,i){var o=ea();return n.forEach((function(t){return o=o.add(t)})),e.getEntries(t,o).next((function(t){var o=Qo();return n.forEach((function(n,a){var s=t.get(n),u=(null==i?void 0:i.get(n))||r;a.isNoDocument()&&a.version.isEqual(Fr.min())?(e.removeEntry(n,u),o=o.insert(n,a)):!s.isValidDocument()||a.version.compareTo(s.version)>0||0===a.version.compareTo(s.version)&&s.hasPendingWrites?(e.addEntry(a,u),o=o.insert(n,a)):Tr("LocalStore","Ignoring outdated watch update for ",n,". Current version:",s.version," Watch version:",a.version)})),o}))}function qu(t,e){var n=Cr(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(t){return void 0===e&&(e=-1),n._n.getNextMutationBatchAfterBatchId(t,e)}))}function Bu(t,e){var n=Cr(t);return n.persistence.runTransaction("Allocate target","readwrite",(function(t){var r;return n.qe.getTargetData(t,e).next((function(i){return i?(r=i,ys.resolve(r)):n.qe.allocateTargetId(t).next((function(i){return r=new Ns(e,i,0,t.currentSequenceNumber),n.qe.addTargetData(t,r).next((function(){return r}))}))}))})).then((function(t){var r=n.kn.get(t.targetId);return(null===r||t.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.kn=n.kn.insert(t.targetId,t),n.Fn.set(e,t.targetId)),t}))}function Gu(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:r=Cr(t),o=r.kn.get(e),a=n?"readwrite":"readwrite-primary",i.label=1;case 1:return i.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",a,(function(t){return r.persistence.referenceDelegate.removeTarget(t,o)}))];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:if(!_s(s=i.sent()))throw s;return Tr("LocalStore","Failed to update sequence numbers for target "+e+": "+s),[3,5];case 5:return r.kn=r.kn.remove(e),r.Fn.delete(o.target),[2]}}))}))}function Ku(t,e,n){var r=Cr(t),i=Fr.min(),o=ea();return r.persistence.runTransaction("Execute query","readonly",(function(t){return function(t,e,n){var r=Cr(t),i=r.Fn.get(n);return void 0!==i?ys.resolve(r.kn.get(i)):r.qe.getTargetData(e,n)}(r,t,Yi(e)).next((function(e){if(e)return i=e.lastLimboFreeSnapshotVersion,r.qe.getMatchingKeysForTargetId(t,e.targetId).next((function(t){o=t}))})).next((function(){return r.xn.getDocumentsMatchingQuery(t,e,n?i:Fr.min(),n?o:ea())})).next((function(t){return{documents:t,Bn:o}}))}))}function Hu(t,e){var n=Cr(t),r=Cr(n.qe),i=n.kn.get(e);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(t){return r.lt(t,e).next((function(t){return t?t.target:null}))}))}function Wu(t){var e=Cr(t);return e.persistence.runTransaction("Get new document changes","readonly",(function(t){return function(t,e,n){var r=Cr(t),i=Qo(),o=Rs(n),a=_u(e),s=IDBKeyRange.lowerBound(o,!0);return a.$t({index:rs.readTimeIndex,range:s},(function(t,e){var n=Ds(r.R,e);i=i.insert(n.key,n),o=e.readTime})).next((function(){return{wn:i,readTime:Ls(o)}}))}(e.On,t,e.$n)})).then((function(t){var n=t.wn,r=t.readTime;return e.$n=r,n}))}function zu(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){return[2,(e=Cr(t)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(t){return function(t){var e=_u(t),n=Fr.min();return e.$t({index:rs.readTimeIndex,reverse:!0},(function(t,e,r){e.readTime&&(n=Ls(e.readTime)),r.done()})).next((function(){return n}))}(t)})).then((function(t){e.$n=t}))]}))}))}function Ju(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s,u,c,h,l,f,p,d;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:for(o=Cr(t),a=ea(),s=Qo(),u=$o(),c=0,h=n;c<h.length;c++)l=h[c],f=e.qn(l.metadata.name),l.document&&(a=a.add(f)),s=s.insert(f,e.Un(l)),u=u.insert(f,e.Kn(l.metadata.readTime));return p=o.On.newChangeBuffer({trackRemovals:!0}),[4,Bu(o,function(t){return Yi(Ki(Gr.fromString("__bundle__/docs/"+t)))}(r))];case 1:return d=i.sent(),[2,o.persistence.runTransaction("Apply bundle documents","readwrite",(function(t){return Vu(t,p,s,Fr.min(),u).next((function(e){return p.apply(t),e})).next((function(e){return o.qe.removeMatchingKeysForTargetId(t,d.targetId).next((function(){return o.qe.addMatchingKeys(t,a,d.targetId)})).next((function(){return o.Mn.En(t,e)})).next((function(){return e}))}))}))]}}))}))}function Qu(t,e,n){return void 0===n&&(n=ea()),(0,i.mG)(this,void 0,void 0,(function(){var r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,Bu(t,Yi(qs(e.bundledQuery)))];case 1:return r=i.sent(),[2,(o=Cr(t)).persistence.runTransaction("Save named query","readwrite",(function(t){var i=ba(e.readTime);if(r.snapshotVersion.compareTo(i)>=0)return o.Ke.saveNamedQuery(t,e);var a=r.withResumeToken(zr.EMPTY_BYTE_STRING,i);return o.kn=o.kn.insert(a.targetId,a),o.qe.updateTargetData(t,a).next((function(){return o.qe.removeMatchingKeysForTargetId(t,r.targetId)})).next((function(){return o.qe.addMatchingKeys(t,n,r.targetId)})).next((function(){return o.Ke.saveNamedQuery(t,e)}))}))]}}))}))}var Xu=function(){function t(t){this.R=t,this.Qn=new Map,this.jn=new Map}return t.prototype.getBundleMetadata=function(t,e){return ys.resolve(this.Qn.get(e))},t.prototype.saveBundleMetadata=function(t,e){var n;return this.Qn.set(e.id,{id:(n=e).id,version:n.version,createTime:ba(n.createTime)}),ys.resolve()},t.prototype.getNamedQuery=function(t,e){return ys.resolve(this.jn.get(e))},t.prototype.saveNamedQuery=function(t,e){return this.jn.set(e.name,function(t){return{name:t.name,query:qs(t.bundledQuery),readTime:ba(t.readTime)}}(e)),ys.resolve()},t}(),Yu=function(){function t(){this.Wn=new Wo(Zu.Gn),this.zn=new Wo(Zu.Hn)}return t.prototype.isEmpty=function(){return this.Wn.isEmpty()},t.prototype.addReference=function(t,e){var n=new Zu(t,e);this.Wn=this.Wn.add(n),this.zn=this.zn.add(n)},t.prototype.Jn=function(t,e){var n=this;t.forEach((function(t){return n.addReference(t,e)}))},t.prototype.removeReference=function(t,e){this.Yn(new Zu(t,e))},t.prototype.Xn=function(t,e){var n=this;t.forEach((function(t){return n.removeReference(t,e)}))},t.prototype.Zn=function(t){var e=this,n=new ii(new Gr([])),r=new Zu(n,t),i=new Zu(n,t+1),o=[];return this.zn.forEachInRange([r,i],(function(t){e.Yn(t),o.push(t.key)})),o},t.prototype.ts=function(){var t=this;this.Wn.forEach((function(e){return t.Yn(e)}))},t.prototype.Yn=function(t){this.Wn=this.Wn.delete(t),this.zn=this.zn.delete(t)},t.prototype.es=function(t){var e=new ii(new Gr([])),n=new Zu(e,t),r=new Zu(e,t+1),i=ea();return this.zn.forEachInRange([n,r],(function(t){i=i.add(t.key)})),i},t.prototype.containsKey=function(t){var e=new Zu(t,0),n=this.Wn.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)},t}(),Zu=function(){function t(t,e){this.key=t,this.ns=e}return t.Gn=function(t,e){return ii.comparator(t.key,e.key)||Rr(t.ns,e.ns)},t.Hn=function(t,e){return Rr(t.ns,e.ns)||ii.comparator(t.key,e.key)},t}(),$u=function(){function t(t,e){this.Ut=t,this.referenceDelegate=e,this._n=[],this.ss=1,this.rs=new Wo(Zu.Gn)}return t.prototype.checkEmpty=function(t){return ys.resolve(0===this._n.length)},t.prototype.addMutationBatch=function(t,e,n,r){var i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var o=new Os(i,e,n,r);this._n.push(o);for(var a=0,s=r;a<s.length;a++){var u=s[a];this.rs=this.rs.add(new Zu(u.key,i)),this.Ut.addToCollectionParentIndex(t,u.key.path.popLast())}return ys.resolve(o)},t.prototype.lookupMutationBatch=function(t,e){return ys.resolve(this.os(e))},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=e+1,r=this.cs(n),i=r<0?0:r;return ys.resolve(this._n.length>i?this._n[i]:null)},t.prototype.getHighestUnacknowledgedBatchId=function(){return ys.resolve(0===this._n.length?-1:this.ss-1)},t.prototype.getAllMutationBatches=function(t){return ys.resolve(this._n.slice())},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=new Zu(e,0),i=new Zu(e,Number.POSITIVE_INFINITY),o=[];return this.rs.forEachInRange([r,i],(function(t){var e=n.os(t.ns);o.push(e)})),ys.resolve(o)},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Wo(Rr);return e.forEach((function(t){var e=new Zu(t,0),i=new Zu(t,Number.POSITIVE_INFINITY);n.rs.forEachInRange([e,i],(function(t){r=r.add(t.ns)}))})),ys.resolve(this.us(r))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=e.path,r=n.length+1,i=n;ii.isDocumentKey(i)||(i=i.child(""));var o=new Zu(new ii(i),0),a=new Wo(Rr);return this.rs.forEachWhile((function(t){var e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===r&&(a=a.add(t.ns)),!0)}),o),ys.resolve(this.us(a))},t.prototype.us=function(t){var e=this,n=[];return t.forEach((function(t){var r=e.os(t);null!==r&&n.push(r)})),n},t.prototype.removeMutationBatch=function(t,e){var n=this;Nr(0===this.hs(e.batchId,"removed")),this._n.shift();var r=this.rs;return ys.forEach(e.mutations,(function(i){var o=new Zu(i.key,e.batchId);return r=r.delete(o),n.referenceDelegate.markPotentiallyOrphaned(t,i.key)})).next((function(){n.rs=r}))},t.prototype.Gt=function(t){},t.prototype.containsKey=function(t,e){var n=new Zu(e,0),r=this.rs.firstAfterOrEqual(n);return ys.resolve(e.isEqual(r&&r.key))},t.prototype.performConsistencyCheck=function(t){return this._n.length,ys.resolve()},t.prototype.hs=function(t,e){return this.cs(t)},t.prototype.cs=function(t){return 0===this._n.length?0:t-this._n[0].batchId},t.prototype.os=function(t){var e=this.cs(t);return e<0||e>=this._n.length?null:this._n[e]},t}(),tc=function(){function t(t,e){this.Ut=t,this.ls=e,this.docs=new Go(ii.comparator),this.size=0}return t.prototype.addEntry=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,a=this.ls(e);return this.docs=this.docs.insert(r,{document:e.clone(),size:a,readTime:n}),this.size+=a-o,this.Ut.addToCollectionParentIndex(t,r.path.popLast())},t.prototype.removeEntry=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},t.prototype.getEntry=function(t,e){var n=this.docs.get(e);return ys.resolve(n?n.document.clone():_i.newInvalidDocument(e))},t.prototype.getEntries=function(t,e){var n=this,r=Qo();return e.forEach((function(t){var e=n.docs.get(t);r=r.insert(t,e?e.document.clone():_i.newInvalidDocument(t))})),ys.resolve(r)},t.prototype.getDocumentsMatchingQuery=function(t,e,n){for(var r=Qo(),i=new ii(e.path.child("")),o=this.docs.getIteratorFrom(i);o.hasNext();){var a=o.getNext(),s=a.key,u=a.value,c=u.document,h=u.readTime;if(!e.path.isPrefixOf(s.path))break;h.compareTo(n)<=0||no(e,c)&&(r=r.insert(c.key,c.clone()))}return ys.resolve(r)},t.prototype.fs=function(t,e){return ys.forEach(this.docs,(function(t){return e(t)}))},t.prototype.newChangeBuffer=function(t){return new ec(this)},t.prototype.getSize=function(t){return ys.resolve(this.size)},t}(),ec=function(t){function e(e){var n=this;return(n=t.call(this)||this).Ie=e,n}return(0,i.ZT)(e,t),e.prototype.applyChanges=function(t){var e=this,n=[];return this.changes.forEach((function(r,i){i.document.isValidDocument()?n.push(e.Ie.addEntry(t,i.document,e.getReadTime(r))):e.Ie.removeEntry(r)})),ys.waitFor(n)},e.prototype.getFromCache=function(t,e){return this.Ie.getEntry(t,e)},e.prototype.getAllFromCache=function(t,e){return this.Ie.getEntries(t,e)},e}(mu),nc=function(){function t(t){this.persistence=t,this.ds=new yu((function(t){return Ii(t)}),Ti),this.lastRemoteSnapshotVersion=Fr.min(),this.highestTargetId=0,this.ws=0,this._s=new Yu,this.targetCount=0,this.ys=iu.Jt()}return t.prototype.forEachTarget=function(t,e){return this.ds.forEach((function(t,n){return e(n)})),ys.resolve()},t.prototype.getLastRemoteSnapshotVersion=function(t){return ys.resolve(this.lastRemoteSnapshotVersion)},t.prototype.getHighestSequenceNumber=function(t){return ys.resolve(this.ws)},t.prototype.allocateTargetId=function(t){return this.highestTargetId=this.ys.next(),ys.resolve(this.highestTargetId)},t.prototype.setTargetsMetadata=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.ws&&(this.ws=e),ys.resolve()},t.prototype.te=function(t){this.ds.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.ys=new iu(e),this.highestTargetId=e),t.sequenceNumber>this.ws&&(this.ws=t.sequenceNumber)},t.prototype.addTargetData=function(t,e){return this.te(e),this.targetCount+=1,ys.resolve()},t.prototype.updateTargetData=function(t,e){return this.te(e),ys.resolve()},t.prototype.removeTargetData=function(t,e){return this.ds.delete(e.target),this._s.Zn(e.targetId),this.targetCount-=1,ys.resolve()},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return this.ds.forEach((function(a,s){s.sequenceNumber<=e&&null===n.get(s.targetId)&&(r.ds.delete(a),o.push(r.removeMatchingKeysForTargetId(t,s.targetId)),i++)})),ys.waitFor(o).next((function(){return i}))},t.prototype.getTargetCount=function(t){return ys.resolve(this.targetCount)},t.prototype.getTargetData=function(t,e){var n=this.ds.get(e)||null;return ys.resolve(n)},t.prototype.addMatchingKeys=function(t,e,n){return this._s.Jn(e,n),ys.resolve()},t.prototype.removeMatchingKeys=function(t,e,n){this._s.Xn(e,n);var r=this.persistence.referenceDelegate,i=[];return r&&e.forEach((function(e){i.push(r.markPotentiallyOrphaned(t,e))})),ys.waitFor(i)},t.prototype.removeMatchingKeysForTargetId=function(t,e){return this._s.Zn(e),ys.resolve()},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=this._s.es(e);return ys.resolve(n)},t.prototype.containsKey=function(t,e){return ys.resolve(this._s.containsKey(e))},t}(),rc=function(){function t(t,e){var n=this;this.gs={},this.Ne=new wr(0),this.xe=!1,this.xe=!0,this.referenceDelegate=t(this),this.qe=new nc(this),this.Ut=new Hs,this.Ue=function(t,e){return new tc(t,(function(t){return n.referenceDelegate.ps(t)}))}(this.Ut),this.R=new Cs(e),this.Ke=new Xu(this.R)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.setDatabaseDeletedListener=function(){},t.prototype.setNetworkEnabled=function(){},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getMutationQueue=function(t){var e=this.gs[t.toKey()];return e||(e=new $u(this.Ut,this.referenceDelegate),this.gs[t.toKey()]=e),e},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getBundleCache=function(){return this.Ke},t.prototype.runTransaction=function(t,e,n){var r=this;Tr("MemoryPersistence","Starting transaction:",t);var i=new ic(this.Ne.next());return this.referenceDelegate.Es(),n(i).next((function(t){return r.referenceDelegate.Ts(i).next((function(){return t}))})).toPromise().then((function(t){return i.raiseOnCommittedEvent(),t}))},t.prototype.Is=function(t,e){return ys.or(Object.values(this.gs).map((function(n){return function(){return n.containsKey(t,e)}})))},t}(),ic=function(t){function e(e){var n=this;return(n=t.call(this)||this).currentSequenceNumber=e,n}return(0,i.ZT)(e,t),e}(ds),oc=function(){function t(t){this.persistence=t,this.As=new Yu,this.Rs=null}return t.bs=function(e){return new t(e)},Object.defineProperty(t.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw xr()},enumerable:!1,configurable:!0}),t.prototype.addReference=function(t,e,n){return this.As.addReference(n,e),this.vs.delete(n.toString()),ys.resolve()},t.prototype.removeReference=function(t,e,n){return this.As.removeReference(n,e),this.vs.add(n.toString()),ys.resolve()},t.prototype.markPotentiallyOrphaned=function(t,e){return this.vs.add(e.toString()),ys.resolve()},t.prototype.removeTarget=function(t,e){var n=this;this.As.Zn(e.targetId).forEach((function(t){return n.vs.add(t.toString())}));var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(t,e.targetId).next((function(t){t.forEach((function(t){return n.vs.add(t.toString())}))})).next((function(){return r.removeTargetData(t,e)}))},t.prototype.Es=function(){this.Rs=new Set},t.prototype.Ts=function(t){var e=this,n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ys.forEach(this.vs,(function(r){var i=ii.fromPath(r);return e.Ps(t,i).next((function(t){t||n.removeEntry(i)}))})).next((function(){return e.Rs=null,n.apply(t)}))},t.prototype.updateLimboDocument=function(t,e){var n=this;return this.Ps(t,e).next((function(t){t?n.vs.delete(e.toString()):n.vs.add(e.toString())}))},t.prototype.ps=function(t){return 0},t.prototype.Ps=function(t,e){var n=this;return ys.or([function(){return ys.resolve(n.As.containsKey(e))},function(){return n.persistence.getTargetCache().containsKey(t,e)},function(){return n.persistence.Is(t,e)}])},t}(),ac=function(){function t(t){this.uid=t}return t.prototype.isAuthenticated=function(){return null!=this.uid},t.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t}();function sc(t,e){return"firestore_clients_"+t+"_"+e}function uc(t,e,n){var r="firestore_mutations_"+t+"_"+n;return e.isAuthenticated()&&(r+="_"+e.uid),r}function cc(t,e){return"firestore_targets_"+t+"_"+e}ac.UNAUTHENTICATED=new ac(null),ac.GOOGLE_CREDENTIALS=new ac("google-credentials-uid"),ac.FIRST_PARTY=new ac("first-party-uid"),ac.MOCK_USER=new ac("mock-user");var hc=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r}return t.Vs=function(e,n,r){var i,o=JSON.parse(r),a="object"==typeof o&&-1!==["pending","acknowledged","rejected"].indexOf(o.state)&&(void 0===o.error||"object"==typeof o.error);return a&&o.error&&(a="string"==typeof o.error.message&&"string"==typeof o.error.code)&&(i=new Er(o.error.code,o.error.message)),a?new t(e,n,o.state,i):(kr("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},t.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)},t}(),lc=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n}return t.Vs=function(e,n){var r,i=JSON.parse(n),o="object"==typeof i&&-1!==["not-current","current","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error);return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(r=new Er(i.error.code,i.error.message)),o?new t(e,i.state,r):(kr("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.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)},t}(),fc=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.Vs=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=ra(),a=0;i&&a<r.activeTargetIds.length;++a)i=ri(r.activeTargetIds[a]),o=o.add(r.activeTargetIds[a]);return i?new t(e,o):(kr("SharedClientState","Failed to parse client data for instance '"+e+"': "+n),null)},t}(),pc=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.Vs=function(e){var n=JSON.parse(e);return"object"==typeof n&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new t(n.clientId,n.onlineState):(kr("SharedClientState","Failed to parse online state: "+e),null)},t}(),dc=function(){function t(){this.activeTargetIds=ra()}return t.prototype.Ds=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.Cs=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.Ss=function(){var t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),vc=function(){function t(t,e,n,r,i){this.window=t,this.Se=e,this.persistenceKey=n,this.Ns=r,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.xs=this.ks.bind(this),this.Fs=new Go(Rr),this.started=!1,this.$s=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Os=sc(this.persistenceKey,this.Ns),this.Ms=function(t){return"firestore_sequence_number_"+t}(this.persistenceKey),this.Fs=this.Fs.insert(this.Ns,new dc),this.Ls=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Bs=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.qs=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.Us=function(t){return"firestore_online_state_"+t}(this.persistenceKey),this.Ks=function(t){return"firestore_bundle_loaded_"+t}(this.persistenceKey),this.window.addEventListener("storage",this.xs)}return t.yt=function(t){return!(!t||!t.localStorage)},t.prototype.start=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,n,r,o,a,s,u,c,h,l,f=this;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,this.syncEngine.fn()];case 1:for(t=i.sent(),e=0,n=t;e<n.length;e++)(r=n[e])!==this.Ns&&(o=this.getItem(sc(this.persistenceKey,r)))&&(a=fc.Vs(r,o))&&(this.Fs=this.Fs.insert(a.clientId,a));for(this.Qs(),(s=this.storage.getItem(this.Us))&&(u=this.js(s))&&this.Ws(u),c=0,h=this.$s;c<h.length;c++)l=h[c],this.ks(l);return this.$s=[],this.window.addEventListener("pagehide",(function(){return f.shutdown()})),this.started=!0,[2]}}))}))},t.prototype.writeSequenceNumber=function(t){this.setItem(this.Ms,JSON.stringify(t))},t.prototype.getAllActiveQueryTargets=function(){return this.Gs(this.Fs)},t.prototype.isActiveQueryTarget=function(t){var e=!1;return this.Fs.forEach((function(n,r){r.activeTargetIds.has(t)&&(e=!0)})),e},t.prototype.addPendingMutation=function(t){this.zs(t,"pending")},t.prototype.updateMutationState=function(t,e,n){this.zs(t,e,n),this.Hs(t)},t.prototype.addLocalQueryTarget=function(t){var e="not-current";if(this.isActiveQueryTarget(t)){var n=this.storage.getItem(cc(this.persistenceKey,t));if(n){var r=lc.Vs(t,n);r&&(e=r.state)}}return this.Js.Ds(t),this.Qs(),e},t.prototype.removeLocalQueryTarget=function(t){this.Js.Cs(t),this.Qs()},t.prototype.isLocalQueryTarget=function(t){return this.Js.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){this.removeItem(cc(this.persistenceKey,t))},t.prototype.updateQueryState=function(t,e,n){this.Ys(t,e,n)},t.prototype.handleUserChange=function(t,e,n){var r=this;e.forEach((function(t){r.Hs(t)})),this.currentUser=t,n.forEach((function(t){r.addPendingMutation(t)}))},t.prototype.setOnlineState=function(t){this.Xs(t)},t.prototype.notifyBundleLoaded=function(){this.Zs()},t.prototype.shutdown=function(){this.started&&(this.window.removeEventListener("storage",this.xs),this.removeItem(this.Os),this.started=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return Tr("SharedClientState","READ",t,e),e},t.prototype.setItem=function(t,e){Tr("SharedClientState","SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){Tr("SharedClientState","REMOVE",t),this.storage.removeItem(t)},t.prototype.ks=function(t){var e=this,n=t;if(n.storageArea===this.storage){if(Tr("SharedClientState","EVENT",n.key,n.newValue),n.key===this.Os)return void kr("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Se.enqueueRetryable((function(){return(0,i.mG)(e,void 0,void 0,(function(){var t,e,r,o,a,s;return(0,i.Jh)(this,(function(i){if(this.started){if(null!==n.key)if(this.Ls.test(n.key)){if(null==n.newValue)return t=this.ti(n.key),[2,this.ei(t,null)];if(e=this.ni(n.key,n.newValue))return[2,this.ei(e.clientId,e)]}else if(this.Bs.test(n.key)){if(null!==n.newValue&&(r=this.si(n.key,n.newValue)))return[2,this.ii(r)]}else if(this.qs.test(n.key)){if(null!==n.newValue&&(o=this.ri(n.key,n.newValue)))return[2,this.oi(o)]}else if(n.key===this.Us){if(null!==n.newValue&&(a=this.js(n.newValue)))return[2,this.Ws(a)]}else if(n.key===this.Ms)(s=function(t){var e=wr.o;if(null!=t)try{var n=JSON.parse(t);Nr("number"==typeof n),e=n}catch(t){kr("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(n.newValue))!==wr.o&&this.sequenceNumberHandler(s);else if(n.key===this.Ks)return[2,this.syncEngine.ci()]}else this.$s.push(n);return[2]}))}))}))}},Object.defineProperty(t.prototype,"Js",{get:function(){return this.Fs.get(this.Ns)},enumerable:!1,configurable:!0}),t.prototype.Qs=function(){this.setItem(this.Os,this.Js.Ss())},t.prototype.zs=function(t,e,n){var r=new hc(this.currentUser,t,e,n),i=uc(this.persistenceKey,this.currentUser,t);this.setItem(i,r.Ss())},t.prototype.Hs=function(t){var e=uc(this.persistenceKey,this.currentUser,t);this.removeItem(e)},t.prototype.Xs=function(t){var e={clientId:this.Ns,onlineState:t};this.storage.setItem(this.Us,JSON.stringify(e))},t.prototype.Ys=function(t,e,n){var r=cc(this.persistenceKey,t),i=new lc(t,e,n);this.setItem(r,i.Ss())},t.prototype.Zs=function(){this.setItem(this.Ks,"value-not-used")},t.prototype.ti=function(t){var e=this.Ls.exec(t);return e?e[1]:null},t.prototype.ni=function(t,e){var n=this.ti(t);return fc.Vs(n,e)},t.prototype.si=function(t,e){var n=this.Bs.exec(t),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return hc.Vs(new ac(i),r,e)},t.prototype.ri=function(t,e){var n=this.qs.exec(t),r=Number(n[1]);return lc.Vs(r,e)},t.prototype.js=function(t){return pc.Vs(t)},t.prototype.ii=function(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){return t.user.uid===this.currentUser.uid?[2,this.syncEngine.ui(t.batchId,t.state,t.error)]:(Tr("SharedClientState","Ignoring mutation for non-active user "+t.user.uid),[2])}))}))},t.prototype.oi=function(t){return this.syncEngine.ai(t.targetId,t.state,t.error)},t.prototype.ei=function(t,e){var n=this,r=e?this.Fs.insert(t,e):this.Fs.remove(t),i=this.Gs(this.Fs),o=this.Gs(r),a=[],s=[];return o.forEach((function(t){i.has(t)||a.push(t)})),i.forEach((function(t){o.has(t)||s.push(t)})),this.syncEngine.hi(a,s).then((function(){n.Fs=r}))},t.prototype.Ws=function(t){this.Fs.get(t.clientId)&&this.onlineStateHandler(t.onlineState)},t.prototype.Gs=function(t){var e=ra();return t.forEach((function(t,n){e=e.unionWith(n.activeTargetIds)})),e},t}(),yc=function(){function t(){this.li=new dc,this.fi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}return t.prototype.addPendingMutation=function(t){},t.prototype.updateMutationState=function(t,e,n){},t.prototype.addLocalQueryTarget=function(t){return this.li.Ds(t),this.fi[t]||"not-current"},t.prototype.updateQueryState=function(t,e,n){this.fi[t]=e},t.prototype.removeLocalQueryTarget=function(t){this.li.Cs(t)},t.prototype.isLocalQueryTarget=function(t){return this.li.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){delete this.fi[t]},t.prototype.getAllActiveQueryTargets=function(){return this.li.activeTargetIds},t.prototype.isActiveQueryTarget=function(t){return this.li.activeTargetIds.has(t)},t.prototype.start=function(){return this.li=new dc,Promise.resolve()},t.prototype.handleUserChange=function(t,e,n){},t.prototype.setOnlineState=function(t){},t.prototype.shutdown=function(){},t.prototype.writeSequenceNumber=function(t){},t.prototype.notifyBundleLoaded=function(){},t}(),mc=function(){function t(){}return t.prototype.di=function(t){},t.prototype.shutdown=function(){},t}(),gc=function(){function t(){var t=this;this.wi=function(){return t._i()},this.mi=function(){return t.yi()},this.gi=[],this.pi()}return t.prototype.di=function(t){this.gi.push(t)},t.prototype.shutdown=function(){window.removeEventListener("online",this.wi),window.removeEventListener("offline",this.mi)},t.prototype.pi=function(){window.addEventListener("online",this.wi),window.addEventListener("offline",this.mi)},t.prototype._i=function(){Tr("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,e=this.gi;t<e.length;t++)(0,e[t])(0)},t.prototype.yi=function(){Tr("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,e=this.gi;t<e.length;t++)(0,e[t])(1)},t.yt=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},t}(),bc={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},wc=function(){function t(t){this.Ei=t.Ei,this.Ti=t.Ti}return t.prototype.Ii=function(t){this.Ai=t},t.prototype.Ri=function(t){this.bi=t},t.prototype.onMessage=function(t){this.vi=t},t.prototype.close=function(){this.Ti()},t.prototype.send=function(t){this.Ei(t)},t.prototype.Pi=function(){this.Ai()},t.prototype.Vi=function(t){this.bi(t)},t.prototype.Si=function(t){this.vi(t)},t}(),_c=function(t){function e(e){var n=this;return(n=t.call(this,e)||this).forceLongPolling=e.forceLongPolling,n.autoDetectLongPolling=e.autoDetectLongPolling,n.useFetchStreams=e.useFetchStreams,n}return(0,i.ZT)(e,t),e.prototype.Fi=function(t,e,n,r){return new Promise((function(i,o){var a=new br;a.listenOnce(pr.COMPLETE,(function(){try{switch(a.getLastErrorCode()){case fr.NO_ERROR:var e=a.getResponseJson();Tr("Connection","XHR received:",JSON.stringify(e)),i(e);break;case fr.TIMEOUT:Tr("Connection",'RPC "'+t+'" timed out'),o(new Er(_r.DEADLINE_EXCEEDED,"Request time out"));break;case fr.HTTP_ERROR:var n=a.getStatus();if(Tr("Connection",'RPC "'+t+'" failed with status:',n,"response text:",a.getResponseText()),n>0){var r=a.getResponseJson().error;if(r&&r.status&&r.message){var s=function(t){var e=t.toLowerCase().replace(/_/g,"-");return Object.values(_r).indexOf(e)>=0?e:_r.UNKNOWN}(r.status);o(new Er(s,r.message))}else o(new Er(_r.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new Er(_r.UNAVAILABLE,"Connection failed."));break;default:xr()}}finally{Tr("Connection",'RPC "'+t+'" completed.')}}));var s=JSON.stringify(r);a.send(e,"POST",s,n,15)}))},e.prototype.Oi=function(t,e){var n=[this.Di,"/","google.firestore.v1.Firestore","/",t,"/channel"],r=new sr,i=$t(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(a.xmlHttpFactory=new mr({})),this.ki(a.initMessageHeaders,e),(0,o.uI)()||(0,o.b$)()||(0,o.d)()||(0,o.w1)()||(0,o.Mn)()||(0,o.ru)()||(a.httpHeadersOverwriteParam="$httpHeaders");var s=n.join("");Tr("Connection","Creating WebChannel: "+s,a);var u=r.createWebChannel(s,a),c=!1,h=!1,l=new wc({Ei:function(t){h?Tr("Connection","Not sending because WebChannel is closed:",t):(c||(Tr("Connection","Opening WebChannel transport."),u.open(),c=!0),Tr("Connection","WebChannel sending:",t),u.send(t))},Ti:function(){return u.close()}}),f=function(t,e,n){t.listen(e,(function(t){try{n(t)}catch(t){setTimeout((function(){throw t}),0)}}))};return f(u,gr.EventType.OPEN,(function(){h||Tr("Connection","WebChannel transport opened.")})),f(u,gr.EventType.CLOSE,(function(){h||(h=!0,Tr("Connection","WebChannel transport closed"),l.Vi())})),f(u,gr.EventType.ERROR,(function(t){h||(h=!0,Ar("Connection","WebChannel transport errored:",t),l.Vi(new Er(_r.UNAVAILABLE,"The operation could not be completed")))})),f(u,gr.EventType.MESSAGE,(function(t){var e;if(!h){var n=t.data[0];Nr(!!n);var r=n,i=r.error||(null===(e=r[0])||void 0===e?void 0:e.error);if(i){Tr("Connection","WebChannel received error:",i);var o=i.status,a=function(t){var e=jo[t];if(void 0!==e)return Bo(e)}(o),s=i.message;void 0===a&&(a=_r.INTERNAL,s="Unknown error status: "+o+" with message "+i.message),h=!0,l.Vi(new Er(a,s)),u.close()}else Tr("Connection","WebChannel received:",n),l.Si(n)}})),f(i,dr.STAT_EVENT,(function(t){t.stat===vr?Tr("Connection","Detected buffering proxy"):t.stat===yr&&Tr("Connection","Detected no buffering proxy")})),setTimeout((function(){l.Pi()}),0),l},e}(function(){function t(t){this.databaseInfo=t,this.databaseId=t.databaseId;var e=t.ssl?"https":"http";this.Di=e+"://"+t.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return t.prototype.Ni=function(t,e,n,r){var i=this.xi(t,e);Tr("RestConnection","Sending: ",i,n);var o={};return this.ki(o,r),this.Fi(t,i,o,n).then((function(t){return Tr("RestConnection","Received: ",t),t}),(function(e){throw Ar("RestConnection",t+" failed with error: ",e,"url: ",i,"request:",n),e}))},t.prototype.$i=function(t,e,n,r){return this.Ni(t,e,n,r)},t.prototype.ki=function(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/8.10.0",t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e)for(var n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n])},t.prototype.xi=function(t,e){var n=bc[t];return this.Di+"/v1/"+e+":"+n},t}());function Ec(){return"undefined"!=typeof window?window:null}function Sc(){return"undefined"!=typeof document?document:null}function Ic(t){return new va(t,!0)}var Tc=function(){function t(t,e,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.Se=t,this.timerId=e,this.Mi=n,this.Li=r,this.Bi=i,this.qi=0,this.Ui=null,this.Ki=Date.now(),this.reset()}return t.prototype.reset=function(){this.qi=0},t.prototype.Qi=function(){this.qi=this.Bi},t.prototype.ji=function(t){var e=this;this.cancel();var n=Math.floor(this.qi+this.Wi()),r=Math.max(0,Date.now()-this.Ki),i=Math.max(0,n-r);i>0&&Tr("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.qi+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.Ui=this.Se.enqueueAfterDelay(this.timerId,i,(function(){return e.Ki=Date.now(),t()})),this.qi*=this.Li,this.qi<this.Mi&&(this.qi=this.Mi),this.qi>this.Bi&&(this.qi=this.Bi)},t.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},t.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},t.prototype.Wi=function(){return(Math.random()-.5)*this.qi},t}(),kc=function(){function t(t,e,n,r,i,o){this.Se=t,this.zi=n,this.Hi=r,this.Ji=i,this.listener=o,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new Tc(t,e)}return t.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},t.prototype.er=function(){return 2===this.state},t.prototype.start=function(){3!==this.state?this.auth():this.nr()},t.prototype.stop=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(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]}}))}))},t.prototype.sr=function(){this.state=0,this.Zi.reset()},t.prototype.ir=function(){var t=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,(function(){return t.rr()})))},t.prototype.cr=function(t){this.ur(),this.stream.send(t)},t.prototype.rr=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){return this.er()?[2,this.close(0)]:[2]}))}))},t.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},t.prototype.close=function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==t?this.Zi.reset():e&&e.code===_r.RESOURCE_EXHAUSTED?(kr(e.toString()),kr("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):e&&e.code===_r.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.Ri(e)];case 1:return n.sent(),[2]}}))}))},t.prototype.ar=function(){},t.prototype.auth=function(){var t=this;this.state=1;var e=this.hr(this.Yi),n=this.Yi;this.Ji.getToken().then((function(e){t.Yi===n&&t.lr(e)}),(function(n){e((function(){var e=new Er(_r.UNKNOWN,"Fetching auth token failed: "+n.message);return t.dr(e)}))}))},t.prototype.lr=function(t){var e=this,n=this.hr(this.Yi);this.stream=this.wr(t),this.stream.Ii((function(){n((function(){return e.state=2,e.listener.Ii()}))})),this.stream.Ri((function(t){n((function(){return e.dr(t)}))})),this.stream.onMessage((function(t){n((function(){return e.onMessage(t)}))}))},t.prototype.nr=function(){var t=this;this.state=4,this.Zi.ji((function(){return(0,i.mG)(t,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){return this.state=0,this.start(),[2]}))}))}))},t.prototype.dr=function(t){return Tr("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},t.prototype.hr=function(t){var e=this;return function(n){e.Se.enqueueAndForget((function(){return e.Yi===t?n():(Tr("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},t}(),Ac=function(t){function e(e,n,r,i,o){var a=this;return(a=t.call(this,e,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).R=i,a}return(0,i.ZT)(e,t),e.prototype.wr=function(t){return this.Hi.Oi("Listen",t)},e.prototype.onMessage=function(t){this.Zi.reset();var e=function(t,e){var n;if("targetChange"in e){e.targetChange;var r=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:xr()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=function(t,e){return t.I?(Nr(void 0===e||"string"==typeof e),zr.fromBase64String(e||"")):(Nr(void 0===e||e instanceof Uint8Array),zr.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),a=(s=e.targetChange.cause)&&function(t){var e=void 0===t.code?_r.UNKNOWN:Bo(t.code);return new Er(e,t.message||"")}(s);n=new ua(r,i,o,a||null)}else if("documentChange"in e){e.documentChange,(r=e.documentChange).document,r.document.name,r.document.updateTime,i=Sa(t,r.document.name),o=ba(r.document.updateTime);var s=new bi({mapValue:{fields:r.document.fields}}),u=(a=_i.newFoundDocument(i,o,s),r.targetIds||[]),c=r.removedTargetIds||[];n=new aa(u,c,a.key,a)}else if("documentDelete"in e)e.documentDelete,(r=e.documentDelete).document,i=Sa(t,r.document),o=r.readTime?ba(r.readTime):Fr.min(),s=_i.newNoDocument(i,o),a=r.removedTargetIds||[],n=new aa([],a,s.key,s);else if("documentRemove"in e)e.documentRemove,(r=e.documentRemove).document,i=Sa(t,r.document),o=r.removedTargetIds||[],n=new aa([],o,i,null);else{if(!("filter"in e))return xr();e.filter;var h=e.filter;h.targetId,r=h.count||0,i=new Vo(r),o=h.targetId,n=new sa(o,i)}return n}(this.R,t),n=function(t){if(!("targetChange"in t))return Fr.min();var e=t.targetChange;return e.targetIds&&e.targetIds.length?Fr.min():e.readTime?ba(e.readTime):Fr.min()}(t);return this.listener._r(e,n)},e.prototype.mr=function(t){var e={};e.database=ka(this.R),e.addTarget=function(t,e){var n,r=e.target;return(n=ki(r)?{documents:Da(t,r)}:{query:Pa(t,r)}).targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=ma(t,e.resumeToken):e.snapshotVersion.compareTo(Fr.min())>0&&(n.readTime=ya(t,e.snapshotVersion.toTimestamp())),n}(this.R,t);var n=function(t,e){var n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return xr()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.R,t);n&&(e.labels=n),this.cr(e)},e.prototype.yr=function(t){var e={};e.database=ka(this.R),e.removeTarget=t,this.cr(e)},e}(kc),Oc=function(t){function e(e,n,r,i,o){var a=this;return(a=t.call(this,e,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).R=i,a.gr=!1,a}return(0,i.ZT)(e,t),Object.defineProperty(e.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},e.prototype.ar=function(){this.gr&&this.Er([])},e.prototype.wr=function(t){return this.Hi.Oi("Write",t)},e.prototype.onMessage=function(t){if(Nr(!!t.streamToken),this.lastStreamToken=t.streamToken,this.gr){this.Zi.reset();var e=function(t,e){return t&&t.length>0?(Nr(void 0!==e),t.map((function(t){return function(t,e){var n=t.updateTime?ba(t.updateTime):ba(e);return n.isEqual(Fr.min())&&(n=ba(e)),new Eo(n,t.transformResults||[])}(t,e)}))):[]}(t.writeResults,t.commitTime),n=ba(t.commitTime);return this.listener.Tr(n,e)}return Nr(!t.writeResults||0===t.writeResults.length),this.gr=!0,this.listener.Ir()},e.prototype.Ar=function(){var t={};t.database=ka(this.R),this.cr(t)},e.prototype.Er=function(t){var e=this,n={streamToken:this.lastStreamToken,writes:t.map((function(t){return Na(e.R,t)}))};this.cr(n)},e}(kc),xc=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).credentials=e,i.Hi=n,i.R=r,i.Rr=!1,i}return(0,i.ZT)(e,t),e.prototype.br=function(){if(this.Rr)throw new Er(_r.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.Ni=function(t,e,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.Ni(t,e,n,i)})).catch((function(t){throw"FirebaseError"===t.name?(t.code===_r.UNAUTHENTICATED&&r.credentials.invalidateToken(),t):new Er(_r.UNKNOWN,t.toString())}))},e.prototype.$i=function(t,e,n){var r=this;return this.br(),this.credentials.getToken().then((function(i){return r.Hi.$i(t,e,n,i)})).catch((function(t){throw"FirebaseError"===t.name?(t.code===_r.UNAUTHENTICATED&&r.credentials.invalidateToken(),t):new Er(_r.UNKNOWN,t.toString())}))},e.prototype.terminate=function(){this.Rr=!0},e}((function(){})),Nc=function(){function t(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return t.prototype.Sr=function(){var t=this;0===this.vr&&(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()})))},t.prototype.Nr=function(t){"Online"===this.state?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.kr(),this.Cr("Connection failed 1 times. Most recent error: "+t.toString()),this.Dr("Offline")))},t.prototype.set=function(t){this.kr(),this.vr=0,"Online"===t&&(this.Vr=!1),this.Dr(t)},t.prototype.Dr=function(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))},t.prototype.Cr=function(t){var e="Could not reach Cloud Firestore backend. "+t+"\nThis 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?(kr(e),this.Vr=!1):Tr("OnlineStateTracker",e)},t.prototype.kr=function(){null!==this.Pr&&(this.Pr.cancel(),this.Pr=null)},t}(),Cc=function(t,e,n,r,o){var a=this;this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.Fr=[],this.$r=new Map,this.Or=new Set,this.Mr=[],this.Lr=o,this.Lr.di((function(t){n.enqueueAndForget((function(){return(0,i.mG)(a,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return Vc(this)?(Tr("RemoteStore","Restarting streams for network reachability change."),[4,function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return(e=Cr(t)).Or.add(4),[4,Pc(e)];case 1:return n.sent(),e.Br.set("Unknown"),e.Or.delete(4),[4,Dc(e)];case 2:return n.sent(),[2]}}))}))}(this)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))})),this.Br=new Nc(n,r)};function Dc(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:if(!Vc(t))return[3,4];e=0,n=t.Mr,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!0)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function Pc(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:e=0,n=t.Mr,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!1)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function Rc(t,e){var n=Cr(t);n.$r.has(e.targetId)||(n.$r.set(e.targetId,e),Uc(n)?Fc(n):eh(n).er()&&jc(n,e))}function Lc(t,e){var n=Cr(t),r=eh(n);n.$r.delete(e),r.er()&&Mc(n,e),0===n.$r.size&&(r.er()?r.ir():Vc(n)&&n.Br.set("Unknown"))}function jc(t,e){t.qr.U(e.targetId),eh(t).mr(e)}function Mc(t,e){t.qr.U(e),eh(t).yr(e)}function Fc(t){t.qr=new ha({getRemoteKeysForTarget:function(e){return t.remoteSyncer.getRemoteKeysForTarget(e)},lt:function(e){return t.$r.get(e)||null}}),eh(t).start(),t.Br.Sr()}function Uc(t){return Vc(t)&&!eh(t).tr()&&t.$r.size>0}function Vc(t){return 0===Cr(t).Or.size}function qc(t){t.qr=void 0}function Bc(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){return t.$r.forEach((function(e,n){jc(t,e)})),[2]}))}))}function Gc(t,e){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(n){return qc(t),Uc(t)?(t.Br.Nr(e),Fc(t)):t.Br.set("Unknown"),[2]}))}))}function Kc(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a;return(0,i.Jh)(this,(function(s){switch(s.label){case 0:if(t.Br.set("Online"),!(e instanceof ua&&2===e.state&&e.cause))return[3,6];s.label=1;case 1:return s.trys.push([1,3,,5]),[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=e.cause,r=0,o=e.targetIds,i.label=1;case 1:return r<o.length?(a=o[r],t.$r.has(a)?[4,t.remoteSyncer.rejectListen(a,n)]:[3,3]):[3,5];case 2:i.sent(),t.$r.delete(a),t.qr.removeTarget(a),i.label=3;case 3:i.label=4;case 4:return r++,[3,1];case 5:return[2]}}))}))}(t,e)];case 2:return s.sent(),[3,5];case 3:return r=s.sent(),Tr("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),[4,Hc(t,r)];case 4:return s.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof aa?t.qr.X(e):e instanceof sa?t.qr.rt(e):t.qr.et(e),n.isEqual(Fr.min()))return[3,13];s.label=7;case 7:return s.trys.push([7,11,,13]),[4,Fu(t.localStore)];case 8:return o=s.sent(),n.compareTo(o)>=0?[4,function(t,e){var n=t.qr.ut(e);return n.targetChanges.forEach((function(n,r){if(n.resumeToken.approximateByteSize()>0){var i=t.$r.get(r);i&&t.$r.set(r,i.withResumeToken(n.resumeToken,e))}})),n.targetMismatches.forEach((function(e){var n=t.$r.get(e);if(n){t.$r.set(e,n.withResumeToken(zr.EMPTY_BYTE_STRING,n.snapshotVersion)),Mc(t,e);var r=new Ns(n.target,e,1,n.sequenceNumber);jc(t,r)}})),t.remoteSyncer.applyRemoteEvent(n)}(t,n)]:[3,10];case 9:s.sent(),s.label=10;case 10:return[3,13];case 11:return Tr("RemoteStore","Failed to raise snapshot:",a=s.sent()),[4,Hc(t,a)];case 12:return s.sent(),[3,13];case 13:return[2]}}))}))}function Hc(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r=this;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:if(!_s(e))throw e;return t.Or.add(1),[4,Pc(t)];case 1:return o.sent(),t.Br.set("Offline"),n||(n=function(){return Fu(t.localStore)}),t.asyncQueue.enqueueRetryable((function(){return(0,i.mG)(r,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return Tr("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return e.sent(),t.Or.delete(1),[4,Dc(t)];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))}function Wc(t,e){return e().catch((function(n){return Hc(t,n,e)}))}function zc(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n,r,o,a;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:e=Cr(t),n=nh(e),r=e.Fr.length>0?e.Fr[e.Fr.length-1].batchId:-1,i.label=1;case 1:if(!function(t){return Vc(t)&&t.Fr.length<10}(e))return[3,7];i.label=2;case 2:return i.trys.push([2,4,,6]),[4,qu(e.localStore,r)];case 3:return null===(o=i.sent())?(0===e.Fr.length&&n.ir(),[3,7]):(r=o.batchId,function(t,e){t.Fr.push(e);var n=nh(t);n.er()&&n.pr&&n.Er(e.mutations)}(e,o),[3,6]);case 4:return a=i.sent(),[4,Hc(e,a)];case 5:return i.sent(),[3,6];case 6:return[3,1];case 7:return Jc(e)&&Qc(e),[2]}}))}))}function Jc(t){return Vc(t)&&!nh(t).tr()&&t.Fr.length>0}function Qc(t){nh(t).start()}function Xc(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){return nh(t).Ar(),[2]}))}))}function Yc(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n,r,o;return(0,i.Jh)(this,(function(i){for(e=nh(t),n=0,r=t.Fr;n<r.length;n++)o=r[n],e.Er(o.mutations);return[2]}))}))}function Zc(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return r=t.Fr.shift(),o=xs.from(r,e,n),[4,Wc(t,(function(){return t.remoteSyncer.applySuccessfulWrite(o)}))];case 1:return i.sent(),[4,zc(t)];case 2:return i.sent(),[2]}}))}))}function $c(t,e){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e&&nh(t).pr?[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return qo(r=e.code)&&r!==_r.ABORTED?(n=t.Fr.shift(),nh(t).sr(),[4,Wc(t,(function(){return t.remoteSyncer.rejectFailedWrite(n.batchId,e)}))]):[3,3];case 1:return i.sent(),[4,zc(t)];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))}(t,e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return Jc(t)&&Qc(t),[2]}}))}))}function th(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return n=Cr(t),e?(n.Or.delete(2),[4,Dc(n)]):[3,2];case 1:return r.sent(),[3,5];case 2:return e?[3,4]:(n.Or.add(2),[4,Pc(n)]);case 3:r.sent(),n.Br.set("Unknown"),r.label=4;case 4:r.label=5;case 5:return[2]}}))}))}function eh(t){var e=this;return t.Ur||(t.Ur=function(t,e,n){var r=Cr(t);return r.br(),new Ac(e,r.Hi,r.credentials,r.R,n)}(t.datastore,t.asyncQueue,{Ii:Bc.bind(null,t),Ri:Gc.bind(null,t),_r:Kc.bind(null,t)}),t.Mr.push((function(n){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return n?(t.Ur.sr(),Uc(t)?Fc(t):t.Br.set("Unknown"),[3,3]):[3,1];case 1:return[4,t.Ur.stop()];case 2:e.sent(),qc(t),e.label=3;case 3:return[2]}}))}))}))),t.Ur}function nh(t){var e=this;return t.Kr||(t.Kr=function(t,e,n){var r=Cr(t);return r.br(),new Oc(e,r.Hi,r.credentials,r.R,n)}(t.datastore,t.asyncQueue,{Ii:Xc.bind(null,t),Ri:$c.bind(null,t),Ir:Yc.bind(null,t),Tr:Zc.bind(null,t)}),t.Mr.push((function(n){return(0,i.mG)(e,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return n?(t.Kr.sr(),[4,zc(t)]):[3,2];case 1:return e.sent(),[3,4];case 2:return[4,t.Kr.stop()];case 3:e.sent(),t.Fr.length>0&&(Tr("RemoteStore","Stopping write stream with "+t.Fr.length+" pending writes"),t.Fr=[]),e.label=4;case 4:return[2]}}))}))}))),t.Kr}var rh=function(){function t(t,e,n,r,i){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new vs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((function(t){}))}return t.createAndSchedule=function(e,n,r,i,o){var a=new t(e,n,Date.now()+r,i,o);return a.start(r),a},t.prototype.start=function(t){var e=this;this.timerHandle=setTimeout((function(){return e.handleDelayElapsed()}),t)},t.prototype.skipDelay=function(){return this.handleDelayElapsed()},t.prototype.cancel=function(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new Er(_r.CANCELLED,"Operation cancelled"+(t?": "+t:""))))},t.prototype.handleDelayElapsed=function(){var t=this;this.asyncQueue.enqueueAndForget((function(){return null!==t.timerHandle?(t.clearTimeout(),t.op().then((function(e){return t.deferred.resolve(e)}))):Promise.resolve()}))},t.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},t}();function ih(t,e){if(kr("AsyncQueue",e+": "+t),_s(t))return new Er(_r.UNAVAILABLE,e+": "+t);throw t}var oh=function(){function t(t){this.comparator=t?function(e,n){return t(e,n)||ii.comparator(e.key,n.key)}:function(t,e){return ii.comparator(t.key,e.key)},this.keyedMap=Yo(),this.sortedSet=new Go(this.comparator)}return t.emptySet=function(e){return new t(e.comparator)},t.prototype.has=function(t){return null!=this.keyedMap.get(t)},t.prototype.get=function(t){return this.keyedMap.get(t)},t.prototype.first=function(){return this.sortedSet.minKey()},t.prototype.last=function(){return this.sortedSet.maxKey()},t.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},t.prototype.indexOf=function(t){var e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t){this.sortedSet.inorderTraversal((function(e,n){return t(e),!1}))},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach((function(e){t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"},t.prototype.copy=function(e,n){var r=new t;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r},t}(),ah=function(){function t(){this.Qr=new Go(ii.comparator)}return t.prototype.track=function(t){var e=t.doc.key,n=this.Qr.get(e);n?0!==t.type&&3===n.type?this.Qr=this.Qr.insert(e,t):3===t.type&&1!==n.type?this.Qr=this.Qr.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Qr=this.Qr.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Qr=this.Qr.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Qr=this.Qr.remove(e):1===t.type&&2===n.type?this.Qr=this.Qr.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Qr=this.Qr.insert(e,{type:2,doc:t.doc}):xr():this.Qr=this.Qr.insert(e,t)},t.prototype.jr=function(){var t=[];return this.Qr.inorderTraversal((function(e,n){t.push(n)})),t},t}(),sh=function(){function t(t,e,n,r,i,o,a,s){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=s}return t.fromInitialDocuments=function(e,n,r,i){var o=[];return n.forEach((function(t){o.push({type:0,doc:t})})),new t(e,n,oh.emptySet(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&$i(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;var e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(e[r].type!==n[r].type||!e[r].doc.isEqual(n[r].doc))return!1;return!0},t}(),uh=function(){this.Wr=void 0,this.listeners=[]},ch=function(){this.queries=new yu((function(t){return to(t)}),$i),this.onlineState="Unknown",this.Gr=new Set};function hh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u,c;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:if(n=Cr(t),r=e.query,o=!1,(a=n.queries.get(r))||(o=!0,a=new uh),!o)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),s=a,[4,n.onListen(r)];case 2:return s.Wr=i.sent(),[3,4];case 3:return u=i.sent(),c=ih(u,"Initialization of query '"+eo(e.query)+"' failed"),[2,void e.onError(c)];case 4:return n.queries.set(r,a),a.listeners.push(e),e.zr(n.onlineState),a.Wr&&e.Hr(a.Wr)&&dh(n),[2]}}))}))}function lh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s;return(0,i.Jh)(this,(function(i){return n=Cr(t),r=e.query,o=!1,(a=n.queries.get(r))&&(s=a.listeners.indexOf(e))>=0&&(a.listeners.splice(s,1),o=0===a.listeners.length),o?[2,(n.queries.delete(r),n.onUnlisten(r))]:[2]}))}))}function fh(t,e){for(var n=Cr(t),r=!1,i=0,o=e;i<o.length;i++){var a=o[i],s=a.query,u=n.queries.get(s);if(u){for(var c=0,h=u.listeners;c<h.length;c++)h[c].Hr(a)&&(r=!0);u.Wr=a}}r&&dh(n)}function ph(t,e,n){var r=Cr(t),i=r.queries.get(e);if(i)for(var o=0,a=i.listeners;o<a.length;o++)a[o].onError(n);r.queries.delete(e)}function dh(t){t.Gr.forEach((function(t){t.next()}))}var vh=function(){function t(t,e,n){this.query=t,this.Jr=e,this.Yr=!1,this.Xr=null,this.onlineState="Unknown",this.options=n||{}}return t.prototype.Hr=function(t){if(!this.options.includeMetadataChanges){for(var e=[],n=0,r=t.docChanges;n<r.length;n++){var i=r[n];3!==i.type&&e.push(i)}t=new sh(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}var o=!1;return this.Yr?this.Zr(t)&&(this.Jr.next(t),o=!0):this.eo(t,this.onlineState)&&(this.no(t),o=!0),this.Xr=t,o},t.prototype.onError=function(t){this.Jr.error(t)},t.prototype.zr=function(t){this.onlineState=t;var e=!1;return this.Xr&&!this.Yr&&this.eo(this.Xr,t)&&(this.no(this.Xr),e=!0),e},t.prototype.eo=function(t,e){if(!t.fromCache)return!0;var n="Offline"!==e;return!(this.options.so&&n||t.docs.isEmpty()&&"Offline"!==e)},t.prototype.Zr=function(t){if(t.docChanges.length>0)return!0;var e=this.Xr&&this.Xr.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges},t.prototype.no=function(t){t=sh.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.Yr=!0,this.Jr.next(t)},t}(),yh=function(){function t(t,e){this.payload=t,this.byteLength=e}return t.prototype.io=function(){return"metadata"in this.payload},t}(),mh=function(){function t(t){this.R=t}return t.prototype.qn=function(t){return Sa(this.R,t)},t.prototype.Un=function(t){return t.metadata.exists?xa(this.R,t.document,!1):_i.newNoDocument(this.qn(t.metadata.name),this.Kn(t.metadata.readTime))},t.prototype.Kn=function(t){return ba(t)},t}();!function(){function t(t,e,n){this.ro=t,this.localStore=e,this.R=n,this.queries=[],this.documents=[],this.progress=function(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}(t)}t.prototype.oo=function(t){this.progress.bytesLoaded+=t.byteLength;var e=this.progress.documentsLoaded;return t.payload.namedQuery?this.queries.push(t.payload.namedQuery):t.payload.documentMetadata?(this.documents.push({metadata:t.payload.documentMetadata}),t.payload.documentMetadata.exists||++e):t.payload.document&&(this.documents[this.documents.length-1].document=t.payload.document,++e),e!==this.progress.documentsLoaded?(this.progress.documentsLoaded=e,Object.assign({},this.progress)):null},t.prototype.co=function(t){for(var e=new Map,n=new mh(this.R),r=0,i=t;r<i.length;r++){var o=i[r];if(o.metadata.queries)for(var a=n.qn(o.metadata.name),s=0,u=o.metadata.queries;s<u.length;s++){var c=u[s],h=(e.get(c)||ea()).add(a);e.set(c,h)}}return e},t.prototype.complete=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,Ju(this.localStore,new mh(this.R),this.documents,this.ro.id)];case 1:t=i.sent(),e=this.co(this.documents),n=0,r=this.queries,i.label=2;case 2:return n<r.length?(o=r[n],[4,Qu(this.localStore,o,e.get(o.name))]):[3,5];case 3:i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,(this.progress.taskState="Success",new Nu(Object.assign({},this.progress),t))]}}))}))}}();var gh=function(t){this.key=t},bh=function(t){this.key=t},wh=function(){function t(t,e){this.query=t,this.uo=e,this.ao=null,this.current=!1,this.ho=ea(),this.mutatedKeys=ea(),this.lo=ro(t),this.fo=new oh(this.lo)}return Object.defineProperty(t.prototype,"wo",{get:function(){return this.uo},enumerable:!1,configurable:!0}),t.prototype._o=function(t,e){var n=this,r=e?e.mo:new ah,i=e?e.fo:this.fo,o=e?e.mutatedKeys:this.mutatedKeys,a=i,s=!1,u=Hi(this.query)&&i.size===this.query.limit?i.last():null,c=Wi(this.query)&&i.size===this.query.limit?i.first():null;if(t.inorderTraversal((function(t,e){var h=i.get(t),l=no(n.query,e)?e:null,f=!!h&&n.mutatedKeys.has(h.key),p=!!l&&(l.hasLocalMutations||n.mutatedKeys.has(l.key)&&l.hasCommittedMutations),d=!1;h&&l?h.data.isEqual(l.data)?f!==p&&(r.track({type:3,doc:l}),d=!0):n.yo(h,l)||(r.track({type:2,doc:l}),d=!0,(u&&n.lo(l,u)>0||c&&n.lo(l,c)<0)&&(s=!0)):!h&&l?(r.track({type:0,doc:l}),d=!0):h&&!l&&(r.track({type:1,doc:h}),d=!0,(u||c)&&(s=!0)),d&&(l?(a=a.add(l),o=p?o.add(t):o.delete(t)):(a=a.delete(t),o=o.delete(t)))})),Hi(this.query)||Wi(this.query))for(;a.size>this.query.limit;){var h=Hi(this.query)?a.last():a.first();a=a.delete(h.key),o=o.delete(h.key),r.track({type:1,doc:h})}return{fo:a,mo:r,Nn:s,mutatedKeys:o}},t.prototype.yo=function(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations},t.prototype.applyChanges=function(t,e,n){var r=this,i=this.fo;this.fo=t.fo,this.mutatedKeys=t.mutatedKeys;var o=t.mo.jr();o.sort((function(t,e){return function(t,e){var n=function(t){switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return xr()}};return n(t)-n(e)}(t.type,e.type)||r.lo(t.doc,e.doc)})),this.po(n);var a=e?this.Eo():[],s=0===this.ho.size&&this.current?1:0,u=s!==this.ao;return this.ao=s,0!==o.length||u?{snapshot:new sh(this.query,t.fo,i,o,t.mutatedKeys,0===s,u,!1),To:a}:{To:a}},t.prototype.zr=function(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({fo:this.fo,mo:new ah,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},t.prototype.Io=function(t){return!this.uo.has(t)&&!!this.fo.has(t)&&!this.fo.get(t).hasLocalMutations},t.prototype.po=function(t){var e=this;t&&(t.addedDocuments.forEach((function(t){return e.uo=e.uo.add(t)})),t.modifiedDocuments.forEach((function(t){})),t.removedDocuments.forEach((function(t){return e.uo=e.uo.delete(t)})),this.current=t.current)},t.prototype.Eo=function(){var t=this;if(!this.current)return[];var e=this.ho;this.ho=ea(),this.fo.forEach((function(e){t.Io(e.key)&&(t.ho=t.ho.add(e.key))}));var n=[];return e.forEach((function(e){t.ho.has(e)||n.push(new bh(e))})),this.ho.forEach((function(t){e.has(t)||n.push(new gh(t))})),n},t.prototype.Ao=function(t){this.uo=t.Bn,this.ho=ea();var e=this._o(t.documents);return this.applyChanges(e,!0)},t.prototype.Ro=function(){return sh.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},t}(),_h=function(t,e,n){this.query=t,this.targetId=e,this.view=n},Eh=function(t){this.key=t,this.bo=!1},Sh=function(){function t(t,e,n,r,i,o){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.vo={},this.Po=new yu((function(t){return to(t)}),$i),this.Vo=new Map,this.So=new Set,this.Do=new Go(ii.comparator),this.Co=new Map,this.No=new Yu,this.xo={},this.ko=new Map,this.Fo=iu.Yt(),this.onlineState="Unknown",this.$o=void 0}return Object.defineProperty(t.prototype,"isPrimaryClient",{get:function(){return!0===this.$o},enumerable:!1,configurable:!0}),t}();function Ih(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=$h(t),(a=n.Po.get(e))?(r=a.targetId,n.sharedClientState.addLocalQueryTarget(r),o=a.view.Ro(),[3,4]):[3,1];case 1:return[4,Bu(n.localStore,Yi(e))];case 2:return s=i.sent(),u=n.sharedClientState.addLocalQueryTarget(s.targetId),r=s.targetId,[4,Th(n,e,r,"current"===u)];case 3:o=i.sent(),n.isPrimaryClient&&Rc(n.remoteStore,s),i.label=4;case 4:return[2,o]}}))}))}function Th(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s,u,c,h;return(0,i.Jh)(this,(function(l){switch(l.label){case 0:return t.Oo=function(e,n,r){return function(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(o=e.view._o(n)).Nn?[4,Ku(t.localStore,e.query,!1).then((function(t){var n=t.documents;return e.view._o(n,o)}))]:[3,2];case 1:o=i.sent(),i.label=2;case 2:return a=r&&r.targetChanges.get(e.targetId),s=e.view.applyChanges(o,t.isPrimaryClient,a),[2,(Fh(t,e.targetId,s.To),s.snapshot)]}}))}))}(t,e,n,r)},[4,Ku(t.localStore,e,!0)];case 1:return o=l.sent(),a=new wh(e,o.Bn),s=a._o(o.documents),u=oa.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==t.onlineState),c=a.applyChanges(s,t.isPrimaryClient,u),Fh(t,n,c.To),h=new _h(e,n,a),[2,(t.Po.set(e,h),t.Vo.has(n)?t.Vo.get(n).push(e):t.Vo.set(n,[e]),c.snapshot)]}}))}))}function kh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Cr(t),r=n.Po.get(e),(o=n.Vo.get(r.targetId)).length>1?[2,(n.Vo.set(r.targetId,o.filter((function(t){return!$i(t,e)}))),void n.Po.delete(e))]:n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)?[3,2]:[4,Gu(n.localStore,r.targetId,!1).then((function(){n.sharedClientState.clearQueryState(r.targetId),Lc(n.remoteStore,r.targetId),jh(n,r.targetId)})).catch(cu)]):[3,3];case 1:i.sent(),i.label=2;case 2:return[3,5];case 3:return jh(n,r.targetId),[4,Gu(n.localStore,r.targetId,!0)];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))}function Ah(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:r=tl(t),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,function(t,e){var n,r=Cr(t),i=Mr.now(),o=e.reduce((function(t,e){return t.add(e.key)}),ea());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(t){return r.Mn.pn(t,o).next((function(o){n=o;for(var a=[],s=0,u=e;s<u.length;s++){var c=u[s],h=Oo(c,n.get(c.key));null!=h&&a.push(new Do(c.key,h,wi(h.value.mapValue),So.exists(!0)))}return r._n.addMutationBatch(t,i,a,e)}))})).then((function(t){return t.applyToLocalDocumentSet(n),{batchId:t.batchId,changes:n}}))}(r.localStore,e)];case 2:return o=i.sent(),r.sharedClientState.addPendingMutation(o.batchId),function(t,e,n){var r=t.xo[t.currentUser.toKey()];r||(r=new Go(Rr)),r=r.insert(e,n),t.xo[t.currentUser.toKey()]=r}(r,o.batchId,n),[4,qh(r,o.changes)];case 3:return i.sent(),[4,zc(r.remoteStore)];case 4:return i.sent(),[3,6];case 5:return a=i.sent(),s=ih(a,"Failed to persist write"),n.reject(s),[3,6];case 6:return[2]}}))}))}function Oh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=Cr(t),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,Uu(n.localStore,e)];case 2:return r=i.sent(),e.targetChanges.forEach((function(t,e){var r=n.Co.get(e);r&&(Nr(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?r.bo=!0:t.modifiedDocuments.size>0?Nr(r.bo):t.removedDocuments.size>0&&(Nr(r.bo),r.bo=!1))})),[4,qh(n,r,e)];case 3:return i.sent(),[3,6];case 4:return[4,cu(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function xh(t,e,n){var r=Cr(t);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){var i=[];r.Po.forEach((function(t,n){var r=n.view.zr(e);r.snapshot&&i.push(r.snapshot)})),function(t,e){var n=Cr(t);n.onlineState=e;var r=!1;n.queries.forEach((function(t,n){for(var i=0,o=n.listeners;i<o.length;i++)o[i].zr(e)&&(r=!0)})),r&&dh(n)}(r.eventManager,e),i.length&&r.vo._r(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}function Nh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s,u,c;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(r=Cr(t)).sharedClientState.updateQueryState(e,"rejected",n),o=r.Co.get(e),(a=o&&o.key)?(s=(s=new Go(ii.comparator)).insert(a,_i.newNoDocument(a,Fr.min())),u=ea().add(a),c=new ia(Fr.min(),new Map,new Wo(Rr),s,u),[4,Oh(r,c)]):[3,2];case 1:return i.sent(),r.Do=r.Do.remove(a),r.Co.delete(e),Vh(r),[3,4];case 2:return[4,Gu(r.localStore,e,!1).then((function(){return jh(r,e,n)})).catch(cu)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))}function Ch(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=Cr(t),r=e.batch.batchId,i.label=1;case 1:return i.trys.push([1,4,,6]),[4,Mu(n.localStore,e)];case 2:return o=i.sent(),Lh(n,r,null),Rh(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),[4,qh(n,o)];case 3:return i.sent(),[3,6];case 4:return[4,cu(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function Dh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:r=Cr(t),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,function(t,e){var n=Cr(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(t){var r;return n._n.lookupMutationBatch(t,e).next((function(e){return Nr(null!==e),r=e.keys(),n._n.removeMutationBatch(t,e)})).next((function(){return n._n.performConsistencyCheck(t)})).next((function(){return n.Mn.pn(t,r)}))}))}(r.localStore,e)];case 2:return o=i.sent(),Lh(r,e,n),Rh(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),[4,qh(r,o)];case 3:return i.sent(),[3,6];case 4:return[4,cu(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function Ph(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:Vc((n=Cr(t)).remoteStore)||Tr("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,function(t){var e=Cr(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(t){return e._n.getHighestUnacknowledgedBatchId(t)}))}(n.localStore)];case 2:return-1===(r=i.sent())?[2,void e.resolve()]:((o=n.ko.get(r)||[]).push(e),n.ko.set(r,o),[3,4]);case 3:return a=i.sent(),s=ih(a,"Initialization of waitForPendingWrites() operation failed"),e.reject(s),[3,4];case 4:return[2]}}))}))}function Rh(t,e){(t.ko.get(e)||[]).forEach((function(t){t.resolve()})),t.ko.delete(e)}function Lh(t,e,n){var r=Cr(t),i=r.xo[r.currentUser.toKey()];if(i){var o=i.get(e);o&&(n?o.reject(n):o.resolve(),i=i.remove(e)),r.xo[r.currentUser.toKey()]=i}}function jh(t,e,n){void 0===n&&(n=null),t.sharedClientState.removeLocalQueryTarget(e);for(var r=0,i=t.Vo.get(e);r<i.length;r++){var o=i[r];t.Po.delete(o),n&&t.vo.Mo(o,n)}t.Vo.delete(e),t.isPrimaryClient&&t.No.Zn(e).forEach((function(e){t.No.containsKey(e)||Mh(t,e)}))}function Mh(t,e){t.So.delete(e.path.canonicalString());var n=t.Do.get(e);null!==n&&(Lc(t.remoteStore,n),t.Do=t.Do.remove(e),t.Co.delete(n),Vh(t))}function Fh(t,e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];o instanceof gh?(t.No.addReference(o.key,e),Uh(t,o)):o instanceof bh?(Tr("SyncEngine","Document no longer in limbo: "+o.key),t.No.removeReference(o.key,e),t.No.containsKey(o.key)||Mh(t,o.key)):xr()}}function Uh(t,e){var n=e.key,r=n.path.canonicalString();t.Do.get(n)||t.So.has(r)||(Tr("SyncEngine","New document in limbo: "+n),t.So.add(r),Vh(t))}function Vh(t){for(;t.So.size>0&&t.Do.size<t.maxConcurrentLimboResolutions;){var e=t.So.values().next().value;t.So.delete(e);var n=new ii(Gr.fromString(e)),r=t.Fo.next();t.Co.set(r,new Eh(n)),t.Do=t.Do.insert(n,r),Rc(t.remoteStore,new Ns(Yi(Ki(n.path)),r,2,wr.o))}}function qh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s;return(0,i.Jh)(this,(function(u){switch(u.label){case 0:return r=Cr(t),o=[],a=[],s=[],r.Po.isEmpty()?[3,3]:(r.Po.forEach((function(t,i){s.push(r.Oo(i,e,n).then((function(t){if(t){r.isPrimaryClient&&r.sharedClientState.updateQueryState(i.targetId,t.fromCache?"not-current":"current"),o.push(t);var e=Du.Pn(i.targetId,t);a.push(e)}})))})),[4,Promise.all(s)]);case 1:return u.sent(),r.vo._r(o),[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u,c,h,l;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=Cr(t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(t){return ys.forEach(e,(function(e){return ys.forEach(e.bn,(function(r){return n.persistence.referenceDelegate.addReference(t,e.targetId,r)})).next((function(){return ys.forEach(e.vn,(function(r){return n.persistence.referenceDelegate.removeReference(t,e.targetId,r)}))}))}))}))];case 2:return i.sent(),[3,4];case 3:if(!_s(r=i.sent()))throw r;return Tr("LocalStore","Failed to update sequence numbers: "+r),[3,4];case 4:for(o=0,a=e;o<a.length;o++)s=a[o],u=s.targetId,s.fromCache||(c=n.kn.get(u),h=c.snapshotVersion,l=c.withLastLimboFreeSnapshotVersion(h),n.kn=n.kn.insert(u,l));return[2]}}))}))}(r.localStore,a)];case 2:u.sent(),u.label=3;case 3:return[2]}}))}))}function Bh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(n=Cr(t)).currentUser.isEqual(e)?[3,3]:(Tr("SyncEngine","User change. New user:",e.toKey()),[4,ju(n.localStore,e)]);case 1:return r=i.sent(),n.currentUser=e,function(t,e){t.ko.forEach((function(t){t.forEach((function(t){t.reject(new Er(_r.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.ko.clear()}(n),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),[4,qh(n,r.Ln)];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))}function Gh(t,e){var n=Cr(t),r=n.Co.get(e);if(r&&r.bo)return ea().add(r.key);var i=ea(),o=n.Vo.get(e);if(!o)return i;for(var a=0,s=o;a<s.length;a++){var u=s[a],c=n.Po.get(u);i=i.unionWith(c.view.wo)}return i}function Kh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,Ku((n=Cr(t)).localStore,e.query,!0)];case 1:return r=i.sent(),o=e.view.Ao(r),[2,(n.isPrimaryClient&&Fh(n,e.targetId,o.To),o)]}}))}))}function Hh(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){return[2,Wu((e=Cr(t)).localStore).then((function(t){return qh(e,t)}))]}))}))}function Wh(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,function(t,e){var n=Cr(t),r=Cr(n._n);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(t){return r.jt(t,e).next((function(e){return e?n.Mn.pn(t,e):ys.resolve(null)}))}))}((o=Cr(t)).localStore,e)];case 1:return null===(a=i.sent())?[3,6]:"pending"!==n?[3,3]:[4,zc(o.remoteStore)];case 2:return i.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(Lh(o,e,r||null),Rh(o,e),function(t,e){Cr(Cr(t)._n).Gt(e)}(o.localStore,e)):xr(),i.label=4;case 4:return[4,qh(o,a)];case 5:return i.sent(),[3,7];case 6:Tr("SyncEngine","Cannot apply mutation batch with id: "+e),i.label=7;case 7:return[2]}}))}))}function zh(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u,c,h;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return $h(n=Cr(t)),tl(n),!0!==e||!0===n.$o?[3,3]:(r=n.sharedClientState.getAllActiveQueryTargets(),[4,Jh(n,r.toArray())]);case 1:return o=i.sent(),n.$o=!0,[4,th(n.remoteStore,!0)];case 2:for(i.sent(),a=0,s=o;a<s.length;a++)u=s[a],Rc(n.remoteStore,u);return[3,7];case 3:return!1!==e||!1===n.$o?[3,7]:(c=[],h=Promise.resolve(),n.Vo.forEach((function(t,e){n.sharedClientState.isLocalQueryTarget(e)?c.push(e):h=h.then((function(){return jh(n,e),Gu(n.localStore,e,!0)})),Lc(n.remoteStore,e)})),[4,h]);case 4:return i.sent(),[4,Jh(n,c)];case 5:return i.sent(),function(t){var e=Cr(t);e.Co.forEach((function(t,n){Lc(e.remoteStore,n)})),e.No.ts(),e.Co=new Map,e.Do=new Go(ii.comparator)}(n),n.$o=!1,[4,th(n.remoteStore,!1)];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))}function Jh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u,c,h,l,f,p,d,v,y;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:n=Cr(t),r=[],o=[],a=0,s=e,i.label=1;case 1:return a<s.length?(u=s[a],c=void 0,(h=n.Vo.get(u))&&0!==h.length?[4,Bu(n.localStore,Yi(h[0]))]:[3,7]):[3,13];case 2:c=i.sent(),l=0,f=h,i.label=3;case 3:return l<f.length?(p=f[l],d=n.Po.get(p),[4,Kh(n,d)]):[3,6];case 4:(v=i.sent()).snapshot&&o.push(v.snapshot),i.label=5;case 5:return l++,[3,3];case 6:return[3,11];case 7:return[4,Hu(n.localStore,u)];case 8:return y=i.sent(),[4,Bu(n.localStore,y)];case 9:return c=i.sent(),[4,Th(n,Qh(y),u,!1)];case 10:i.sent(),i.label=11;case 11:r.push(c),i.label=12;case 12:return a++,[3,1];case 13:return[2,(n.vo._r(o),r)]}}))}))}function Qh(t){return Gi(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function Xh(t){var e=Cr(t);return Cr(Cr(e.localStore).persistence).fn()}function Yh(t,e,n,r){return(0,i.mG)(this,void 0,void 0,(function(){var o,a,s;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(o=Cr(t)).$o?(Tr("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!o.Vo.has(e))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,Wu(o.localStore)];case 3:return a=i.sent(),s=ia.createSynthesizedRemoteEventForCurrentChange(e,"current"===n),[4,qh(o,a,s)];case 4:return i.sent(),[3,8];case 5:return[4,Gu(o.localStore,e,!0)];case 6:return i.sent(),jh(o,e,r),[3,8];case 7:xr(),i.label=8;case 8:return[2]}}))}))}function Zh(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s,u,c,h,l,f,p;return(0,i.Jh)(this,(function(d){switch(d.label){case 0:if(!(r=$h(t)).$o)return[3,10];o=0,a=e,d.label=1;case 1:return o<a.length?(s=a[o],r.Vo.has(s)?(Tr("SyncEngine","Adding an already active target "+s),[3,5]):[4,Hu(r.localStore,s)]):[3,6];case 2:return u=d.sent(),[4,Bu(r.localStore,u)];case 3:return c=d.sent(),[4,Th(r,Qh(u),c.targetId,!1)];case 4:d.sent(),Rc(r.remoteStore,c),d.label=5;case 5:return o++,[3,1];case 6:h=function(t){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return r.Vo.has(t)?[4,Gu(r.localStore,t,!1).then((function(){Lc(r.remoteStore,t),jh(r,t)})).catch(cu)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))},l=0,f=n,d.label=7;case 7:return l<f.length?(p=f[l],[5,h(p)]):[3,10];case 8:d.sent(),d.label=9;case 9:return l++,[3,7];case 10:return[2]}}))}))}function $h(t){var e=Cr(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=Oh.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Gh.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Nh.bind(null,e),e.vo._r=fh.bind(null,e.eventManager),e.vo.Mo=ph.bind(null,e.eventManager),e}function tl(t){var e=Cr(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=Ch.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=Dh.bind(null,e),e}var el=function(){function t(){this.synchronizeTabs=!1}return t.prototype.initialize=function(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return this.R=Ic(t.databaseInfo.databaseId),this.sharedClientState=this.Bo(t),this.persistence=this.qo(t),[4,this.persistence.start()];case 1:return e.sent(),this.gcScheduler=this.Uo(t),this.localStore=this.Ko(t),[2]}}))}))},t.prototype.Uo=function(t){return null},t.prototype.Ko=function(t){return Lu(this.persistence,new Pu,t.initialUser,this.R)},t.prototype.qo=function(t){return new rc(oc.bs,this.R)},t.prototype.Bo=function(t){return new yc},t.prototype.terminate=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(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]}}))}))},t}(),nl=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).Qo=e,i.cacheSizeBytes=n,i.forceOwnership=r,i.synchronizeTabs=!1,i}return(0,i.ZT)(e,t),e.prototype.initialize=function(e){return(0,i.mG)(this,void 0,void 0,(function(){var n=this;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return r.sent(),[4,zu(this.localStore)];case 2:return r.sent(),[4,this.Qo.initialize(this,e)];case 3:return r.sent(),[4,tl(this.Qo.syncEngine)];case 4:return r.sent(),[4,zc(this.Qo.remoteStore)];case 5:return r.sent(),[4,this.persistence.He((function(){return n.gcScheduler&&!n.gcScheduler.started&&n.gcScheduler.start(n.localStore),Promise.resolve()}))];case 6:return r.sent(),[2]}}))}))},e.prototype.Ko=function(t){return Lu(this.persistence,new Pu,t.initialUser,this.R)},e.prototype.Uo=function(t){var e=this.persistence.referenceDelegate.garbageCollector;return new fu(e,t.asyncQueue)},e.prototype.qo=function(t){var e=xu(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?Xs.withCacheSize(this.cacheSizeBytes):Xs.DEFAULT;return new ku(this.synchronizeTabs,e,t.clientId,n,t.asyncQueue,Ec(),Sc(),this.R,this.sharedClientState,!!this.forceOwnership)},e.prototype.Bo=function(t){return new yc},e}(el),rl=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n,!1)||this).Qo=e,r.cacheSizeBytes=n,r.synchronizeTabs=!0,r}return(0,i.ZT)(e,t),e.prototype.initialize=function(e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r=this;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return o.sent(),n=this.Qo.syncEngine,this.sharedClientState instanceof vc?(this.sharedClientState.syncEngine={ui:Wh.bind(null,n),ai:Yh.bind(null,n),hi:Zh.bind(null,n),fn:Xh.bind(null,n),ci:Hh.bind(null,n)},[4,this.sharedClientState.start()]):[3,3];case 2:o.sent(),o.label=3;case 3:return[4,this.persistence.He((function(t){return(0,i.mG)(r,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return[4,zh(this.Qo.syncEngine,t)];case 1:return e.sent(),this.gcScheduler&&(t&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):t||this.gcScheduler.stop()),[2]}}))}))}))];case 4:return o.sent(),[2]}}))}))},e.prototype.Bo=function(t){var e=Ec();if(!vc.yt(e))throw new Er(_r.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=xu(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey);return new vc(e,t.asyncQueue,n,t.clientId,t.initialUser)},e}(nl),il=function(){function t(){}return t.prototype.initialize=function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n=this;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return this.localStore?[3,2]:(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=function(t){return xh(n.syncEngine,t,1)},this.remoteStore.remoteSyncer.handleCredentialChange=Bh.bind(null,this.syncEngine),[4,th(this.remoteStore,this.syncEngine.isPrimaryClient)]);case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.createEventManager=function(t){return new ch},t.prototype.createDatastore=function(t){var e,n=Ic(t.databaseInfo.databaseId),r=(e=t.databaseInfo,new _c(e));return function(t,e,n){return new xc(t,e,n)}(t.credentials,r,n)},t.prototype.createRemoteStore=function(t){var e,n,r,i,o,a=this;return e=this.localStore,n=this.datastore,r=t.asyncQueue,i=function(t){return xh(a.syncEngine,t,0)},o=gc.yt()?new gc:new mc,new Cc(e,n,r,i,o)},t.prototype.createSyncEngine=function(t,e){return function(t,e,n,r,i,o,a){var s=new Sh(t,e,n,r,i,o);return a&&(s.$o=!0),s}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)},t.prototype.terminate=function(){return function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=Cr(t),Tr("RemoteStore","RemoteStore shutting down."),e.Or.add(5),[4,Pc(e)];case 1:return n.sent(),e.Lr.shutdown(),e.Br.set("Unknown"),[2]}}))}))}(this.remoteStore)},t}(),ol=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.observer.next&&this.jo(this.observer.next,t)},t.prototype.error=function(t){this.observer.error?this.jo(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)},t.prototype.Wo=function(){this.muted=!0},t.prototype.jo=function(t,e){var n=this;this.muted||setTimeout((function(){n.muted||t(e)}),0)},t}(),al=(function(){function t(t,e){var n=this;this.Go=t,this.R=e,this.metadata=new vs,this.buffer=new Uint8Array,this.zo=new TextDecoder("utf-8"),this.Ho().then((function(t){t&&t.io()?n.metadata.resolve(t.payload.metadata):n.metadata.reject(new Error("The first element of the bundle is not a metadata, it is\n "+JSON.stringify(null==t?void 0:t.payload)))}),(function(t){return n.metadata.reject(t)}))}t.prototype.close=function(){return this.Go.cancel()},t.prototype.getMetadata=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){return[2,this.metadata.promise]}))}))},t.prototype.Lo=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return[4,this.getMetadata()];case 1:return[2,(t.sent(),this.Ho())]}}))}))},t.prototype.Ho=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e,n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,this.Jo()];case 1:return null===(t=i.sent())?[2,null]:(e=this.zo.decode(t),n=Number(e),isNaN(n)&&this.Yo("length string ("+e+") is not valid number"),[4,this.Xo(n)]);case 2:return r=i.sent(),[2,new yh(JSON.parse(r),t.length+n)]}}))}))},t.prototype.Zo=function(){return this.buffer.findIndex((function(t){return t==="{".charCodeAt(0)}))},t.prototype.Jo=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return this.Zo()<0?[4,this.tc()]:[3,3];case 1:if(n.sent())return[3,3];n.label=2;case 2:return[3,0];case 3:return 0===this.buffer.length?[2,null]:((t=this.Zo())<0&&this.Yo("Reached the end of bundle when a length string is expected."),e=this.buffer.slice(0,t),[2,(this.buffer=this.buffer.slice(t),e)])}}))}))},t.prototype.Xo=function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return this.buffer.length<t?[4,this.tc()]:[3,3];case 1:n.sent()&&this.Yo("Reached the end of bundle when more is expected."),n.label=2;case 2:return[3,0];case 3:return e=this.zo.decode(this.buffer.slice(0,t)),[2,(this.buffer=this.buffer.slice(t),e)]}}))}))},t.prototype.Yo=function(t){throw this.Go.cancel(),new Error("Invalid bundle format: "+t)},t.prototype.tc=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return[4,this.Go.read()];case 1:return(t=n.sent()).done||((e=new Uint8Array(this.buffer.length+t.value.length)).set(this.buffer),e.set(t.value,this.buffer.length),this.buffer=e),[2,t.done]}}))}))}}(),function(){function t(t){this.datastore=t,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastWriteError=null,this.writtenDocs=new Set}return t.prototype.lookup=function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n=this;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:if(this.ensureCommitNotCalled(),this.mutations.length>0)throw new Er(_r.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o,a,s,u;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Cr(t),r=ka(n.R)+"/documents",o={documents:e.map((function(t){return Ea(n.R,t)}))},[4,n.$i("BatchGetDocuments",r,o)];case 1:return a=i.sent(),s=new Map,a.forEach((function(t){var e=function(t,e){return"found"in e?function(t,e){Nr(!!e.found),e.found.name,e.found.updateTime;var n=Sa(t,e.found.name),r=ba(e.found.updateTime),i=new bi({mapValue:{fields:e.found.fields}});return _i.newFoundDocument(n,r,i)}(t,e):"missing"in e?function(t,e){Nr(!!e.missing),Nr(!!e.readTime);var n=Sa(t,e.missing),r=ba(e.readTime);return _i.newNoDocument(n,r)}(t,e):xr()}(n.R,t);s.set(e.key.toString(),e)})),u=[],[2,(e.forEach((function(t){var e=s.get(t.toString());Nr(!!e),u.push(e)})),u)]}}))}))}(this.datastore,t)];case 1:return[2,((e=r.sent()).forEach((function(t){return n.recordVersion(t)})),e)]}}))}))},t.prototype.set=function(t,e){this.write(e.toMutation(t,this.precondition(t))),this.writtenDocs.add(t.toString())},t.prototype.update=function(t,e){try{this.write(e.toMutation(t,this.preconditionForUpdate(t)))}catch(t){this.lastWriteError=t}this.writtenDocs.add(t.toString())},t.prototype.delete=function(t){this.write(new Fo(t,this.precondition(t))),this.writtenDocs.add(t.toString())},t.prototype.commit=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e=this;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return t=this.readVersions,this.mutations.forEach((function(e){t.delete(e.key.toString())})),t.forEach((function(t,n){var r=ii.fromPath(n);e.mutations.push(new Uo(r,e.precondition(r)))})),[4,function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Cr(t),r=ka(n.R)+"/documents",o={writes:e.map((function(t){return Na(n.R,t)}))},[4,n.Ni("Commit",r,o)];case 1:return i.sent(),[2]}}))}))}(this.datastore,this.mutations)];case 1:return n.sent(),this.committed=!0,[2]}}))}))},t.prototype.recordVersion=function(t){var e;if(t.isFoundDocument())e=t.version;else{if(!t.isNoDocument())throw xr();e=Fr.min()}var n=this.readVersions.get(t.key.toString());if(n){if(!e.isEqual(n))throw new Er(_r.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(t.key.toString(),e)},t.prototype.precondition=function(t){var e=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&e?So.updateTime(e):So.none()},t.prototype.preconditionForUpdate=function(t){var e=this.readVersions.get(t.toString());if(!this.writtenDocs.has(t.toString())&&e){if(e.isEqual(Fr.min()))throw new Er(_r.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return So.updateTime(e)}return So.exists(!0)},t.prototype.write=function(t){this.ensureCommitNotCalled(),this.mutations.push(t)},t.prototype.ensureCommitNotCalled=function(){},t}()),sl=function(){function t(t,e,n,r){this.asyncQueue=t,this.datastore=e,this.updateFunction=n,this.deferred=r,this.ec=5,this.Zi=new Tc(this.asyncQueue,"transaction_retry")}return t.prototype.run=function(){this.ec-=1,this.nc()},t.prototype.nc=function(){var t=this;this.Zi.ji((function(){return(0,i.mG)(t,void 0,void 0,(function(){var t,e,n=this;return(0,i.Jh)(this,(function(r){return t=new al(this.datastore),(e=this.sc(t))&&e.then((function(e){n.asyncQueue.enqueueAndForget((function(){return t.commit().then((function(){n.deferred.resolve(e)})).catch((function(t){n.ic(t)}))}))})).catch((function(t){n.ic(t)})),[2]}))}))}))},t.prototype.sc=function(t){try{var e=this.updateFunction(t);return!ei(e)&&e.catch&&e.then?e:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}},t.prototype.ic=function(t){var e=this;this.ec>0&&this.rc(t)?(this.ec-=1,this.asyncQueue.enqueueAndForget((function(){return e.nc(),Promise.resolve()}))):this.deferred.reject(t)},t.prototype.rc=function(t){if("FirebaseError"===t.name){var e=t.code;return"aborted"===e||"failed-precondition"===e||!qo(e)}return!1},t}(),ul=function(){function t(t,e,n){var r=this;this.credentials=t,this.asyncQueue=e,this.databaseInfo=n,this.user=ac.UNAUTHENTICATED,this.clientId=Pr.u(),this.credentialListener=function(){return Promise.resolve()},this.credentials.setChangeListener(e,(function(t){return(0,i.mG)(r,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return Tr("FirestoreClient","Received user=",t.uid),[4,this.credentialListener(t)];case 1:return e.sent(),this.user=t,[2]}}))}))}))}return t.prototype.getConfiguration=function(){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){return[2,{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}]}))}))},t.prototype.setCredentialChangeListener=function(t){this.credentialListener=t},t.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new Er(_r.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.terminate=function(){var t=this;this.asyncQueue.enterRestrictedMode();var e=new vs;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((function(){return(0,i.mG)(t,void 0,void 0,(function(){var t,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:r.sent(),r.label=4;case 4:return this.credentials.removeChangeListener(),e.resolve(),[3,6];case 5:return t=r.sent(),n=ih(t,"Failed to shutdown persistence"),e.reject(n),[3,6];case 6:return[2]}}))}))})),e.promise},t}();function cl(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r,o=this;return(0,i.Jh)(this,(function(a){switch(a.label){case 0:return t.asyncQueue.verifyOperationInProgress(),Tr("FirestoreClient","Initializing OfflineComponentProvider"),[4,t.getConfiguration()];case 1:return n=a.sent(),[4,e.initialize(n)];case 2:return a.sent(),r=n.initialUser,t.setCredentialChangeListener((function(t){return(0,i.mG)(o,void 0,void 0,(function(){return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return r.isEqual(t)?[3,2]:[4,ju(e.localStore,t)];case 1:n.sent(),r=t,n.label=2;case 2:return[2]}}))}))})),e.persistence.setDatabaseDeletedListener((function(){return t.terminate()})),t.offlineComponents=e,[2]}}))}))}function hl(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:return t.asyncQueue.verifyOperationInProgress(),[4,ll(t)];case 1:return n=o.sent(),Tr("FirestoreClient","Initializing OnlineComponentProvider"),[4,t.getConfiguration()];case 2:return r=o.sent(),[4,e.initialize(n,r)];case 3:return o.sent(),t.setCredentialChangeListener((function(t){return function(t,e){return(0,i.mG)(this,void 0,void 0,(function(){var n,r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return(n=Cr(t)).asyncQueue.verifyOperationInProgress(),Tr("RemoteStore","RemoteStore received new credentials"),r=Vc(n),n.Or.add(3),[4,Pc(n)];case 1:return i.sent(),r&&n.Br.set("Unknown"),[4,n.remoteSyncer.handleCredentialChange(e)];case 2:return i.sent(),n.Or.delete(3),[4,Dc(n)];case 3:return i.sent(),[2]}}))}))}(e.remoteStore,t)})),t.onlineComponents=e,[2]}}))}))}function ll(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return t.offlineComponents?[3,2]:(Tr("FirestoreClient","Using default OfflineComponentProvider"),[4,cl(t,new el)]);case 1:e.sent(),e.label=2;case 2:return[2,t.offlineComponents]}}))}))}function fl(t){return(0,i.mG)(this,void 0,void 0,(function(){return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return t.onlineComponents?[3,2]:(Tr("FirestoreClient","Using default OnlineComponentProvider"),[4,hl(t,new il)]);case 1:e.sent(),e.label=2;case 2:return[2,t.onlineComponents]}}))}))}function pl(t){return ll(t).then((function(t){return t.persistence}))}function dl(t){return ll(t).then((function(t){return t.localStore}))}function vl(t){return fl(t).then((function(t){return t.remoteStore}))}function yl(t){return fl(t).then((function(t){return t.syncEngine}))}function ml(t){return(0,i.mG)(this,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return[4,fl(t)];case 1:return e=r.sent(),[2,((n=e.eventManager).onListen=Ih.bind(null,e.syncEngine),n.onUnlisten=kh.bind(null,e.syncEngine),n)]}}))}))}function gl(t,e,n){var r=this;void 0===n&&(n={});var o=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(r,void 0,void 0,(function(){var r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return r=function(t,e,n,r,i){var o=new ol({next:function(o){e.enqueueAndForget((function(){return lh(t,a)}));var s=o.docs.has(n);!s&&o.fromCache?i.reject(new Er(_r.UNAVAILABLE,"Failed to get document because the client is offline.")):s&&o.fromCache&&r&&"server"===r.source?i.reject(new Er(_r.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.)')):i.resolve(o)},error:function(t){return i.reject(t)}}),a=new vh(Ki(n.path),o,{includeMetadataChanges:!0,so:!0});return hh(t,a)},[4,ml(t)];case 1:return[2,r.apply(void 0,[i.sent(),t.asyncQueue,e,n,o])]}}))}))})),o.promise}function bl(t,e,n){var r=this;void 0===n&&(n={});var o=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(r,void 0,void 0,(function(){var r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return r=function(t,e,n,r,i){var o=new ol({next:function(n){e.enqueueAndForget((function(){return lh(t,a)})),n.fromCache&&"server"===r.source?i.reject(new Er(_r.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.)')):i.resolve(n)},error:function(t){return i.reject(t)}}),a=new vh(n,o,{includeMetadataChanges:!0,so:!0});return hh(t,a)},[4,ml(t)];case 1:return[2,r.apply(void 0,[i.sent(),t.asyncQueue,e,n,o])]}}))}))})),o.promise}var wl=function(t,e,n,r,i,o,a,s){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.useFetchStreams=s},_l=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"isDefaultDatabase",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t}(),El=new Map,Sl=function(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+t},Il=function(){function t(){this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t,e){this.changeListener=e,t.enqueueRetryable((function(){return e(ac.UNAUTHENTICATED)}))},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),Tl=function(){function t(t){this.token=t,this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(this.token)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t,e){var n=this;this.changeListener=e,t.enqueueRetryable((function(){return e(n.token.user)}))},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),kl=function(){function t(t){var e=this;this.currentUser=ac.UNAUTHENTICATED,this.oc=new vs,this.cc=0,this.forceRefresh=!1,this.auth=null,this.asyncQueue=null,this.uc=function(){e.cc++,e.currentUser=e.ac(),e.oc.resolve(),e.changeListener&&e.asyncQueue.enqueueRetryable((function(){return e.changeListener(e.currentUser)}))};var n=function(t){Tr("FirebaseCredentialsProvider","Auth detected"),e.auth=t,e.auth.addAuthTokenListener(e.uc)};t.onInit((function(t){return n(t)})),setTimeout((function(){if(!e.auth){var r=t.getImmediate({optional:!0});r?n(r):(Tr("FirebaseCredentialsProvider","Auth not yet detected"),e.oc.resolve())}}),0)}return t.prototype.getToken=function(){var t=this,e=this.cc,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return t.cc!==e?(Tr("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):n?(Nr("string"==typeof n.accessToken),new Sl(n.accessToken,t.currentUser)):null})):Promise.resolve(null)},t.prototype.invalidateToken=function(){this.forceRefresh=!0},t.prototype.setChangeListener=function(t,e){var n=this;this.asyncQueue=t,this.asyncQueue.enqueueRetryable((function(){return(0,i.mG)(n,void 0,void 0,(function(){return(0,i.Jh)(this,(function(t){switch(t.label){case 0:return[4,this.oc.promise];case 1:return t.sent(),[4,e(this.currentUser)];case 2:return t.sent(),this.changeListener=e,[2]}}))}))}))},t.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.uc),this.changeListener=function(){return Promise.resolve()}},t.prototype.ac=function(){var t=this.auth&&this.auth.getUid();return Nr(null===t||"string"==typeof t),new ac(t)},t}(),Al=function(){function t(t,e,n){this.hc=t,this.lc=e,this.fc=n,this.type="FirstParty",this.user=ac.FIRST_PARTY}return Object.defineProperty(t.prototype,"authHeaders",{get:function(){var t={"X-Goog-AuthUser":this.lc},e=this.hc.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),this.fc&&(t["X-Goog-Iam-Authorization-Token"]=this.fc),t},enumerable:!1,configurable:!0}),t}(),Ol=function(){function t(t,e,n){this.hc=t,this.lc=e,this.fc=n}return t.prototype.getToken=function(){return Promise.resolve(new Al(this.hc,this.lc,this.fc))},t.prototype.setChangeListener=function(t,e){t.enqueueRetryable((function(){return e(ac.FIRST_PARTY)}))},t.prototype.removeChangeListener=function(){},t.prototype.invalidateToken=function(){},t}();function xl(t,e,n){if(!n)throw new Er(_r.INVALID_ARGUMENT,"Function "+t+"() cannot be called with an empty "+e+".")}function Nl(t,e){if(void 0===e)return{merge:!1};if(void 0!==e.mergeFields&&void 0!==e.merge)throw new Er(_r.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function Cl(t,e,n,r){if(!0===e&&!0===r)throw new Er(_r.INVALID_ARGUMENT,t+" and "+n+" cannot be used together.")}function Dl(t){if(!ii.isDocumentKey(t))throw new Er(_r.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t+" has "+t.length+".")}function Pl(t){if(ii.isDocumentKey(t))throw new Er(_r.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t+" has "+t.length+".")}function Rl(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";var e=function(t){if(t.constructor){var e=/function\s+([^\s(]+)\s*\(/.exec(t.constructor.toString());if(e&&e.length>1)return e[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return"function"==typeof t?"a function":xr()}function Ll(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Er(_r.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=Rl(t);throw new Er(_r.INVALID_ARGUMENT,"Expected type '"+e.name+"', but it was: "+n)}return t}function jl(t,e){if(e<=0)throw new Er(_r.INVALID_ARGUMENT,"Function "+t+"() requires a positive number, but it was: "+e+".")}var Ml=function(){function t(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new Er(_r.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=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new Er(_r.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,Cl("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}return t.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},t}(),Fl=function(){function t(t,e){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Ml({}),this._settingsFrozen=!1,t instanceof _l?(this._databaseId=t,this._credentials=new Il):(this._app=t,this._databaseId=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new Er(_r.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new _l(t.options.projectId)}(t),this._credentials=new kl(e))}return Object.defineProperty(t.prototype,"app",{get:function(){if(!this._app)throw new Er(_r.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_terminated",{get:function(){return void 0!==this._terminateTask},enumerable:!1,configurable:!0}),t.prototype._setSettings=function(t){if(this._settingsFrozen)throw new Er(_r.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 Ml(t),void 0!==t.credentials&&(this._credentials=function(t){if(!t)return new Il;switch(t.type){case"gapi":var e=t.client;return Nr(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new Ol(e,t.sessionIndex||"0",t.iamToken||null);case"provider":return t.client;default:throw new Er(_r.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))},t.prototype._getSettings=function(){return this._settings},t.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},t.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},t.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},t.prototype._terminate=function(){return(t=El.get(this))&&(Tr("ComponentProvider","Removing Datastore"),El.delete(this),t.terminate()),Promise.resolve();var t},t}(),Ul=function(){function t(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}return Object.defineProperty(t.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new ql(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this._key)},t}(),Vl=function(){function t(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}return t.prototype.withConverter=function(e){return new t(this.firestore,e,this._query)},t}(),ql=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,Ki(r))||this)._path=r,i.type="collection",i}return(0,i.ZT)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._path.popLast();return t.isEmpty()?null:new Ul(this.firestore,null,new ii(t))},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(t){return new e(this.firestore,t,this._path)},e}(Vl);function Bl(t,e){for(var n,r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];if(t=(0,o.m9)(t),xl("collection","path",e),t instanceof Fl)return Pl(n=Gr.fromString.apply(Gr,(0,i.ev)([e],r))),new ql(t,null,n);if(!(t instanceof Ul||t instanceof ql))throw new Er(_r.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return Pl(n=Gr.fromString.apply(Gr,(0,i.ev)([t.path],r)).child(Gr.fromString(e))),new ql(t.firestore,null,n)}function Gl(t,e){for(var n,r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];if(t=(0,o.m9)(t),1===arguments.length&&(e=Pr.u()),xl("doc","path",e),t instanceof Fl)return Dl(n=Gr.fromString.apply(Gr,(0,i.ev)([e],r))),new Ul(t,null,new ii(n));if(!(t instanceof Ul||t instanceof ql))throw new Er(_r.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return Dl(n=t._path.child(Gr.fromString.apply(Gr,(0,i.ev)([e],r)))),new Ul(t.firestore,t instanceof ql?t.converter:null,new ii(n))}function Kl(t,e){return t=(0,o.m9)(t),e=(0,o.m9)(e),(t instanceof Ul||t instanceof ql)&&(e instanceof Ul||e instanceof ql)&&t.firestore===e.firestore&&t.path===e.path&&t.converter===e.converter}function Hl(t,e){return t=(0,o.m9)(t),e=(0,o.m9)(e),t instanceof Vl&&e instanceof Vl&&t.firestore===e.firestore&&$i(t._query,e._query)&&t.converter===e.converter}var Wl=function(){function t(){var t=this;this.dc=Promise.resolve(),this.wc=[],this._c=!1,this.mc=[],this.yc=null,this.gc=!1,this.Ec=!1,this.Tc=[],this.Zi=new Tc(this,"async_queue_retry"),this.Ic=function(){var e=Sc();e&&Tr("AsyncQueue","Visibility state changed to "+e.visibilityState),t.Zi.Gi()};var e=Sc();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Ic)}return Object.defineProperty(t.prototype,"isShuttingDown",{get:function(){return this._c},enumerable:!1,configurable:!0}),t.prototype.enqueueAndForget=function(t){this.enqueue(t)},t.prototype.enqueueAndForgetEvenWhileRestricted=function(t){this.Ac(),this.Rc(t)},t.prototype.enterRestrictedMode=function(t){if(!this._c){this._c=!0,this.Ec=t||!1;var e=Sc();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Ic)}},t.prototype.enqueue=function(t){var e=this;if(this.Ac(),this._c)return new Promise((function(){}));var n=new vs;return this.Rc((function(){return e._c&&e.Ec?Promise.resolve():(t().then(n.resolve,n.reject),n.promise)})).then((function(){return n.promise}))},t.prototype.enqueueRetryable=function(t){var e=this;this.enqueueAndForget((function(){return e.wc.push(t),e.bc()}))},t.prototype.bc=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t,e=this;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:if(0===this.wc.length)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.wc[0]()];case 2:return n.sent(),this.wc.shift(),this.Zi.reset(),[3,4];case 3:if(!_s(t=n.sent()))throw t;return Tr("AsyncQueue","Operation failed with retryable error: "+t),[3,4];case 4:this.wc.length>0&&this.Zi.ji((function(){return e.bc()})),n.label=5;case 5:return[2]}}))}))},t.prototype.Rc=function(t){var e=this,n=this.dc.then((function(){return e.gc=!0,t().catch((function(t){throw e.yc=t,e.gc=!1,kr("INTERNAL UNHANDLED ERROR: ",function(t){var e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t)),t})).then((function(t){return e.gc=!1,t}))}));return this.dc=n,n},t.prototype.enqueueAfterDelay=function(t,e,n){var r=this;this.Ac(),this.Tc.indexOf(t)>-1&&(e=0);var i=rh.createAndSchedule(this,t,e,n,(function(t){return r.vc(t)}));return this.mc.push(i),i},t.prototype.Ac=function(){this.yc&&xr()},t.prototype.verifyOperationInProgress=function(){},t.prototype.Pc=function(){return(0,i.mG)(this,void 0,void 0,(function(){var t;return(0,i.Jh)(this,(function(e){switch(e.label){case 0:return[4,t=this.dc];case 1:e.sent(),e.label=2;case 2:if(t!==this.dc)return[3,0];e.label=3;case 3:return[2]}}))}))},t.prototype.Vc=function(t){for(var e=0,n=this.mc;e<n.length;e++)if(n[e].timerId===t)return!0;return!1},t.prototype.Sc=function(t){var e=this;return this.Pc().then((function(){e.mc.sort((function(t,e){return t.targetTimeMs-e.targetTimeMs}));for(var n=0,r=e.mc;n<r.length;n++){var i=r[n];if(i.skipDelay(),"all"!==t&&i.timerId===t)break}return e.Pc()}))},t.prototype.Dc=function(t){this.Tc.push(t)},t.prototype.vc=function(t){var e=this.mc.indexOf(t);this.mc.splice(e,1)},t}();function zl(t){return function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=t,r=0,i=["next","error","complete"];r<i.length;r++){var o=i[r];if(o in n&&"function"==typeof n[o])return!0}return!1}(t)}!function(){function t(){this._progressObserver={},this._taskCompletionResolver=new vs,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}t.prototype.onProgress=function(t,e,n){this._progressObserver={next:t,error:e,complete:n}},t.prototype.catch=function(t){return this._taskCompletionResolver.promise.catch(t)},t.prototype.then=function(t,e){return this._taskCompletionResolver.promise.then(t,e)},t.prototype._completeWith=function(t){this._updateProgress(t),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(t)},t.prototype._failWith=function(t){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(t),this._taskCompletionResolver.reject(t)},t.prototype._updateProgress=function(t){this._lastProgress=t,this._progressObserver.next&&this._progressObserver.next(t)}}();var Jl=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).type="firestore",r._queue=new Wl,r._persistenceKey="name"in e?e.name:"[DEFAULT]",r}return(0,i.ZT)(e,t),e.prototype._terminate=function(){return this._firestoreClient||Xl(this),this._firestoreClient.terminate()},e}(Fl);function Ql(t){return t._firestoreClient||Xl(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function Xl(t){var e,n=t._freezeSettings(),r=function(t,e,n,r){return new wl(t,e,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,r.useFetchStreams)}(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new ul(t._credentials,t._queue,r)}function Yl(t,e,n){var r=this,o=new vs;return t.asyncQueue.enqueue((function(){return(0,i.mG)(r,void 0,void 0,(function(){var r;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,cl(t,n)];case 1:return i.sent(),[4,hl(t,e)];case 2:return i.sent(),o.resolve(),[3,4];case 3:if(!function(t){return"FirebaseError"===t.name?t.code===_r.FAILED_PRECONDITION||t.code===_r.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code}(r=i.sent()))throw r;return console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+r),o.reject(r),[3,4];case 4:return[2]}}))}))})).then((function(){return o.promise}))}function Zl(t){if(t._initialized||t._terminated)throw new Er(_r.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 $l=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0;n<t.length;++n)if(0===t[n].length)throw new Er(_r.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Hr(t)}return t.prototype.isEqual=function(t){return this._internalPath.isEqual(t._internalPath)},t}(),tf=function(){function t(t){this._byteString=t}return t.fromBase64String=function(e){try{return new t(zr.fromBase64String(e))}catch(e){throw new Er(_r.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}},t.fromUint8Array=function(e){return new t(zr.fromUint8Array(e))},t.prototype.toBase64=function(){return this._byteString.toBase64()},t.prototype.toUint8Array=function(){return this._byteString.toUint8Array()},t.prototype.toString=function(){return"Bytes(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this._byteString.isEqual(t._byteString)},t}(),ef=function(t){this._methodName=t},nf=function(){function t(t,e){if(!isFinite(t)||t<-90||t>90)throw new Er(_r.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new Er(_r.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this._lat===t._lat&&this._long===t._long},t.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},t.prototype._compareTo=function(t){return Rr(this._lat,t._lat)||Rr(this._long,t._long)},t}(),rf=/^__.*__$/,of=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutation=function(t,e){return null!==this.fieldMask?new Do(t,this.data,this.fieldMask,e,this.fieldTransforms):new Co(t,this.data,e,this.fieldTransforms)},t}(),af=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutation=function(t,e){return new Do(t,this.data,this.fieldMask,e,this.fieldTransforms)},t}();function sf(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw xr()}}var uf=function(){function t(t,e,n,r,i,o){this.settings=t,this.databaseId=e,this.R=n,this.ignoreUndefinedProperties=r,void 0===i&&this.Cc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Nc",{get:function(){return this.settings.Nc},enumerable:!1,configurable:!0}),t.prototype.xc=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},t.prototype.kc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.xc({path:n,Fc:!1});return r.$c(t),r},t.prototype.Oc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.xc({path:n,Fc:!1});return r.Cc(),r},t.prototype.Mc=function(t){return this.xc({path:void 0,Fc:!0})},t.prototype.Lc=function(t){return Of(t,this.settings.methodName,this.settings.Bc||!1,this.path,this.settings.qc)},t.prototype.contains=function(t){return void 0!==this.fieldMask.find((function(e){return t.isPrefixOf(e)}))||void 0!==this.fieldTransforms.find((function(e){return t.isPrefixOf(e.field)}))},t.prototype.Cc=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.$c(this.path.get(t))},t.prototype.$c=function(t){if(0===t.length)throw this.Lc("Document fields must not be empty");if(sf(this.Nc)&&rf.test(t))throw this.Lc('Document fields cannot begin and end with "__"')},t}(),cf=function(){function t(t,e,n){this.databaseId=t,this.ignoreUndefinedProperties=e,this.R=n||Ic(t)}return t.prototype.Uc=function(t,e,n,r){return void 0===r&&(r=!1),new uf({Nc:t,methodName:e,qc:n,path:Hr.emptyPath(),Fc:!1,Bc:r},this.databaseId,this.R,this.ignoreUndefinedProperties)},t}();function hf(t){var e=t._freezeSettings(),n=Ic(t._databaseId);return new cf(t._databaseId,!!e.ignoreUndefinedProperties,n)}function lf(t,e,n,r,i,o){void 0===o&&(o={});var a=t.Uc(o.merge||o.mergeFields?2:0,e,n,i);If("Data must be an object, but it was:",a,r);var s,u,c=Ef(r,a);if(o.merge)s=new Wr(a.fieldMask),u=a.fieldTransforms;else if(o.mergeFields){for(var h=[],l=0,f=o.mergeFields;l<f.length;l++){var p=Tf(e,f[l],n);if(!a.contains(p))throw new Er(_r.INVALID_ARGUMENT,"Field '"+p+"' is specified in your field mask but missing from your input data.");xf(h,p)||h.push(p)}s=new Wr(h),u=a.fieldTransforms.filter((function(t){return s.covers(t.field)}))}else s=null,u=a.fieldTransforms;return new of(new bi(c),s,u)}var ff=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){if(2!==t.Nc)throw 1===t.Nc?t.Lc(this._methodName+"() can only appear at the top level of your update data"):t.Lc(this._methodName+"() cannot be used with set() unless you pass {merge:true}");return t.fieldMask.push(t.path),null},e.prototype.isEqual=function(t){return t instanceof e},e}(ef);function pf(t,e,n){return new uf({Nc:3,qc:e.settings.qc,methodName:t._methodName,Fc:n},e.databaseId,e.R,e.ignoreUndefinedProperties)}var df=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){return new _o(t.path,new fo)},e.prototype.isEqual=function(t){return t instanceof e},e}(ef),vf=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).Kc=n,r}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){var e=pf(this,t,!0),n=this.Kc.map((function(t){return _f(t,e)})),r=new po(n);return new _o(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(ef),yf=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).Kc=n,r}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){var e=pf(this,t,!0),n=this.Kc.map((function(t){return _f(t,e)})),r=new yo(n);return new _o(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(ef),mf=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).Qc=n,r}return(0,i.ZT)(e,t),e.prototype._toFieldTransform=function(t){var e=new go(t.R,so(t.R,this.Qc));return new _o(t.path,e)},e.prototype.isEqual=function(t){return this===t},e}(ef);function gf(t,e,n,r){var i=t.Uc(1,e,n);If("Data must be an object, but it was:",i,r);var a=[],s=bi.empty();Vr(r,(function(t,r){var u=Af(e,t,n);r=(0,o.m9)(r);var c=i.Oc(u);if(r instanceof ff)a.push(u);else{var h=_f(r,c);null!=h&&(a.push(u),s.set(u,h))}}));var u=new Wr(a);return new af(s,u,i.fieldTransforms)}function bf(t,e,n,r,i,a){var s=t.Uc(1,e,n),u=[Tf(e,r,n)],c=[i];if(a.length%2!=0)throw new Er(_r.INVALID_ARGUMENT,"Function "+e+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var h=0;h<a.length;h+=2)u.push(Tf(e,a[h])),c.push(a[h+1]);for(var l=[],f=bi.empty(),p=u.length-1;p>=0;--p)if(!xf(l,u[p])){var d=u[p],v=c[p];v=(0,o.m9)(v);var y=s.Oc(d);if(v instanceof ff)l.push(d);else{var m=_f(v,y);null!=m&&(l.push(d),f.set(d,m))}}var g=new Wr(l);return new af(f,g,s.fieldTransforms)}function wf(t,e,n,r){return void 0===r&&(r=!1),_f(n,t.Uc(r?4:3,e))}function _f(t,e){if(Sf(t=(0,o.m9)(t)))return If("Unsupported field value:",e,t),Ef(t,e);if(t instanceof ef)return function(t,e){if(!sf(e.Nc))throw e.Lc(t._methodName+"() can only be used with update() and set()");if(!e.path)throw e.Lc(t._methodName+"() is not currently supported inside arrays");var n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&4!==e.Nc)throw e.Lc("Nested arrays are not supported");return function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var a=_f(o[i],e.Mc(r));null==a&&(a={nullValue:"NULL_VALUE"}),n.push(a),r++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=(0,o.m9)(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return so(e.R,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){var n=Mr.fromDate(t);return{timestampValue:ya(e.R,n)}}if(t instanceof Mr)return n=new Mr(t.seconds,1e3*Math.floor(t.nanoseconds/1e3)),{timestampValue:ya(e.R,n)};if(t instanceof nf)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof tf)return{bytesValue:ma(e.R,t._byteString)};if(t instanceof Ul){n=e.databaseId;var r=t.firestore._databaseId;if(!r.isEqual(n))throw e.Lc("Document reference is for database "+r.projectId+"/"+r.database+" but should be for database "+n.projectId+"/"+n.database);return{referenceValue:wa(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.Lc("Unsupported field value: "+Rl(t))}(t,e)}function Ef(t,e){var n={};return qr(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Vr(t,(function(t,r){var i=_f(r,e.kc(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}function Sf(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof Mr||t instanceof nf||t instanceof tf||t instanceof Ul||t instanceof ef)}function If(t,e,n){if(!Sf(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){var r=Rl(n);throw"an object"===r?e.Lc(t+" a custom object"):e.Lc(t+" "+r)}}function Tf(t,e,n){if((e=(0,o.m9)(e))instanceof $l)return e._internalPath;if("string"==typeof e)return Af(t,e);throw Of("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}var kf=new RegExp("[~\\*/\\[\\]]");function Af(t,e,n){if(e.search(kf)>=0)throw Of("Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'",t,!1,void 0,n);try{return(new($l.bind.apply($l,(0,i.ev)([void 0],e.split(".")))))._internalPath}catch(r){throw Of("Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",t,!1,void 0,n)}}function Of(t,e,n,r,i){var o=r&&!r.isEmpty(),a=void 0!==i,s="Function "+e+"() called with invalid data";n&&(s+=" (via `toFirestore()`)");var u="";return(o||a)&&(u+=" (found",o&&(u+=" in field "+r),a&&(u+=" in document "+i),u+=")"),new Er(_r.INVALID_ARGUMENT,(s+=". ")+t+u)}function xf(t,e){return t.some((function(t){return t.isEqual(e)}))}var Nf=function(){function t(t,e,n,r,i){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=r,this._converter=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new Ul(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),t.prototype.exists=function(){return null!==this._document},t.prototype.data=function(){if(this._document){if(this._converter){var t=new Cf(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}},t.prototype.get=function(t){if(this._document){var e=this._document.data.field(Df("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}},t}(),Cf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.data=function(){return t.prototype.data.call(this)},e}(Nf);function Df(t,e){return"string"==typeof e?Af(t,e):e instanceof $l?e._internalPath:e._delegate._internalPath}var Pf=function(){function t(t,e){this.hasPendingWrites=t,this.fromCache=e}return t.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},t}(),Rf=function(t){function e(e,n,r,i,o,a){var s=this;return(s=t.call(this,e,n,r,i,a)||this)._firestore=e,s._firestoreImpl=e,s.metadata=o,s}return(0,i.ZT)(e,t),e.prototype.exists=function(){return t.prototype.exists.call(this)},e.prototype.data=function(t){if(void 0===t&&(t={}),this._document){if(this._converter){var e=new Lf(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}},e.prototype.get=function(t,e){if(void 0===e&&(e={}),this._document){var n=this._document.data.field(Df("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}},e}(Nf),Lf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.data=function(e){return void 0===e&&(e={}),t.prototype.data.call(this,e)},e}(Rf),jf=function(){function t(t,e,n,r){this._firestore=t,this._userDataWriter=e,this._snapshot=r,this.metadata=new Pf(r.hasPendingWrites,r.fromCache),this.query=n}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._snapshot.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;this._snapshot.docs.forEach((function(r){t.call(e,new Lf(n._firestore,n._userDataWriter,r.key,r,new Pf(n._snapshot.mutatedKeys.has(r.key),n._snapshot.fromCache),n.query.converter))}))},t.prototype.docChanges=function(t){void 0===t&&(t={});var e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new Er(_r.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){var n=0;return t._snapshot.docChanges.map((function(e){return{type:"added",doc:new Lf(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Pf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter),oldIndex:-1,newIndex:n++}}))}var r=t._snapshot.oldDocs;return t._snapshot.docChanges.filter((function(t){return e||3!==t.type})).map((function(e){var n=new Lf(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Pf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter),i=-1,o=-1;return 0!==e.type&&(i=r.indexOf(e.doc.key),r=r.delete(e.doc.key)),1!==e.type&&(o=(r=r.add(e.doc)).indexOf(e.doc.key)),{type:Mf(e.type),doc:n,oldIndex:i,newIndex:o}}))}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges},t}();function Mf(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return xr()}}function Ff(t,e){return t instanceof Rf&&e instanceof Rf?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(null===t._document?null===e._document:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof jf&&e instanceof jf&&t._firestore===e._firestore&&Hl(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)}function Uf(t){if(Wi(t)&&0===t.explicitOrderBy.length)throw new Er(_r.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var Vf=function(){};function qf(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];t=o._apply(t)}return t}var Bf=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).jc=e,i.Wc=n,i.Gc=r,i.type="where",i}return(0,i.ZT)(e,t),e.prototype._apply=function(t){var e=hf(t.firestore),n=function(t,e,n,r,i,o,a){var s;if(i.isKeyField()){if("array-contains"===o||"array-contains-any"===o)throw new Er(_r.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){Qf(a,o);for(var u=[],c=0,h=a;c<h.length;c++){var l=h[c];u.push(Jf(r,t,l))}s={arrayValue:{values:u}}}else s=Jf(r,t,a)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||Qf(a,o),s=wf(n,"where",a,"in"===o||"not-in"===o);var f=Ai.create(i,o,s);return function(t,e){if(e.g()){var n=Ji(t);if(null!==n&&!n.isEqual(e.field))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+e.field.toString()+"'");var r=zi(t);null!==r&&Xf(0,e.field,r)}var i=function(t,e){for(var n=0,r=t.filters;n<r.length;n++){var i=r[n];if(e.indexOf(i.op)>=0)return i.op}return null}(t,function(t){switch(t){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[]}}(e.op));if(null!==i)throw i===e.op?new Er(_r.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+e.op.toString()+"' filter."):new Er(_r.INVALID_ARGUMENT,"Invalid query. You cannot use '"+e.op.toString()+"' filters with '"+i.toString()+"' filters.")}(t,f),f}(t._query,0,e,t.firestore._databaseId,this.jc,this.Wc,this.Gc);return new Vl(t.firestore,t.converter,function(t,e){var n=t.filters.concat([e]);return new Bi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t._query,n))},e}(Vf),Gf=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).jc=e,r.zc=n,r.type="orderBy",r}return(0,i.ZT)(e,t),e.prototype._apply=function(t){var e=function(t,e,n){if(null!==t.startAt)throw new Er(_r.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new Er(_r.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new Fi(e,n);return function(t,e){if(null===zi(t)){var n=Ji(t);null!==n&&Xf(0,n,e.field)}}(t,r),r}(t._query,this.jc,this.zc);return new Vl(t.firestore,t.converter,function(t,e){var n=t.explicitOrderBy.concat([e]);return new Bi(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t._query,e))},e}(Vf),Kf=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Hc=n,i.Jc=r,i}return(0,i.ZT)(e,t),e.prototype._apply=function(t){return new Vl(t.firestore,t.converter,Zi(t._query,this.Hc,this.Jc))},e}(Vf),Hf=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Yc=n,i.Xc=r,i}return(0,i.ZT)(e,t),e.prototype._apply=function(t){var e=zf(t,this.type,this.Yc,this.Xc);return new Vl(t.firestore,t.converter,function(t,e){return new Bi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t._query,e))},e}(Vf),Wf=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Yc=n,i.Xc=r,i}return(0,i.ZT)(e,t),e.prototype._apply=function(t){var e=zf(t,this.type,this.Yc,this.Xc);return new Vl(t.firestore,t.converter,function(t,e){return new Bi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t._query,e))},e}(Vf);function zf(t,e,n,r){if(n[0]=(0,o.m9)(n[0]),n[0]instanceof Nf)return function(t,e,n,r,i){if(!r)throw new Er(_r.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],a=0,s=Xi(t);a<s.length;a++){var u=s[a];if(u.field.isKeyField())o.push(fi(e,r.key));else{var c=r.data.field(u.field);if(Zr(c))throw new Er(_r.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+u.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===c){var h=u.field.canonicalString();throw new Er(_r.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+h+"' (used as the orderBy) does not exist.")}o.push(c)}}return new ji(o,i)}(t._query,t.firestore._databaseId,e,n[0]._document,r);var i=hf(t.firestore);return function(t,e,n,r,i,o){var a=t.explicitOrderBy;if(i.length>a.length)throw new Er(_r.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var s=[],u=0;u<i.length;u++){var c=i[u];if(a[u].field.isKeyField()){if("string"!=typeof c)throw new Er(_r.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof c);if(!Qi(t)&&-1!==c.indexOf("/"))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+r+"() must be a plain document ID, but '"+c+"' contains a slash.");var h=t.path.child(Gr.fromString(c));if(!ii.isDocumentKey(h))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+r+"() must result in a valid document path, but '"+h+"' is not because it contains an odd number of segments.");var l=new ii(h);s.push(fi(e,l))}else{var f=wf(n,r,c);s.push(f)}}return new ji(s,o)}(t._query,t.firestore._databaseId,i,e,n,r)}function Jf(t,e,n){if("string"==typeof(n=(0,o.m9)(n))){if(""===n)throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!Qi(e)&&-1!==n.indexOf("/"))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var r=e.path.child(Gr.fromString(n));if(!ii.isDocumentKey(r))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return fi(t,new ii(r))}if(n instanceof Ul)return fi(t,n._key);throw new Er(_r.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+Rl(n)+".")}function Qf(t,e){if(!Array.isArray(t)||0===t.length)throw new Er(_r.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+e.toString()+"' filters.");if(t.length>10)throw new Er(_r.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.")}function Xf(t,e,n){if(!n.isEqual(e))throw new Er(_r.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}var Yf=function(){function t(){}return t.prototype.convertValue=function(t,e){switch(void 0===e&&(e="none"),oi(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Xr(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(Yr(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw xr()}},t.prototype.convertObject=function(t,e){var n=this,r={};return Vr(t.fields,(function(t,i){r[t]=n.convertValue(i,e)})),r},t.prototype.convertGeoPoint=function(t){return new nf(Xr(t.latitude),Xr(t.longitude))},t.prototype.convertArray=function(t,e){var n=this;return(t.values||[]).map((function(t){return n.convertValue(t,e)}))},t.prototype.convertServerTimestamp=function(t,e){switch(e){case"previous":var n=$r(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(ti(t));default:return null}},t.prototype.convertTimestamp=function(t){var e=Qr(t);return new Mr(e.seconds,e.nanos)},t.prototype.convertDocumentKey=function(t,e){var n=Gr.fromString(t);Nr(Ha(n));var r=new _l(n.get(1),n.get(3)),i=new ii(n.popFirst(5));return r.isEqual(e)||kr("Document "+i+" contains a document reference within a different database ("+r.projectId+"/"+r.database+") which is not supported. It will be treated as a reference in the current database ("+e.projectId+"/"+e.database+") instead."),i},t}();function Zf(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var $f=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,i.ZT)(e,t),e.prototype.convertBytes=function(t){return new tf(t)},e.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return new Ul(this.firestore,null,e)},e}(Yf),tp=function(){function t(t,e){this._firestore=t,this._commitHandler=e,this._mutations=[],this._committed=!1,this._dataReader=hf(t)}return t.prototype.set=function(t,e,n){this._verifyNotCommitted();var r=ep(t,this._firestore),i=Zf(r.converter,e,n),o=lf(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(o.toMutation(r._key,So.none())),this},t.prototype.update=function(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];this._verifyNotCommitted();var a,s=ep(t,this._firestore);return a="string"==typeof(e=(0,o.m9)(e))||e instanceof $l?bf(this._dataReader,"WriteBatch.update",s._key,e,n,r):gf(this._dataReader,"WriteBatch.update",s._key,e),this._mutations.push(a.toMutation(s._key,So.exists(!0))),this},t.prototype.delete=function(t){this._verifyNotCommitted();var e=ep(t,this._firestore);return this._mutations=this._mutations.concat(new Fo(e._key,So.none())),this},t.prototype.commit=function(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()},t.prototype._verifyNotCommitted=function(){if(this._committed)throw new Er(_r.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}();function ep(t,e){if((t=(0,o.m9)(t)).firestore!==e)throw new Er(_r.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}var np=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,i.ZT)(e,t),e.prototype.convertBytes=function(t){return new tf(t)},e.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return new Ul(this.firestore,null,e)},e}(Yf);function rp(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];t=Ll(t,Ul);var a=Ll(t.firestore,Jl),s=hf(a);return op(a,[("string"==typeof(e=(0,o.m9)(e))||e instanceof $l?bf(s,"updateDoc",t._key,e,n,r):gf(s,"updateDoc",t._key,e)).toMutation(t._key,So.exists(!0))])}function ip(t){for(var e,n,r,a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];t=(0,o.m9)(t);var u={includeMetadataChanges:!1},c=0;"object"!=typeof a[c]||zl(a[c])||(u=a[c],c++);var h,l,f,p={includeMetadataChanges:u.includeMetadataChanges};if(zl(a[c])){var d=a[c];a[c]=null===(e=d.next)||void 0===e?void 0:e.bind(d),a[c+1]=null===(n=d.error)||void 0===n?void 0:n.bind(d),a[c+2]=null===(r=d.complete)||void 0===r?void 0:r.bind(d)}if(t instanceof Ul)l=Ll(t.firestore,Jl),f=Ki(t._key.path),h={next:function(e){a[c]&&a[c](ap(l,t,e))},error:a[c+1],complete:a[c+2]};else{var v=Ll(t,Vl);l=Ll(v.firestore,Jl),f=v._query;var y=new np(l);h={next:function(t){a[c]&&a[c](new jf(l,y,v,t))},error:a[c+1],complete:a[c+2]},Uf(t._query)}return function(t,e,n,r){var o=this,a=new ol(r),s=new vh(e,a,n);return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(o,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=hh,[4,ml(t)];case 1:return[2,e.apply(void 0,[n.sent(),s])]}}))}))})),function(){a.Wo(),t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(o,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=lh,[4,ml(t)];case 1:return[2,e.apply(void 0,[n.sent(),s])]}}))}))}))}}(Ql(l),f,p,h)}function op(t,e){return function(t,e){var n=this,r=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return n=Ah,[4,yl(t)];case 1:return[2,n.apply(void 0,[i.sent(),e,r])]}}))}))})),r.promise}(Ql(t),e)}function ap(t,e,n){var r=n.docs.get(e._key),i=new np(t);return new Rf(t,i,e._key,r,new Pf(n.hasPendingWrites,n.fromCache),e.converter)}var sp=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this)._firestore=e,r}return(0,i.ZT)(e,t),e.prototype.get=function(e){var n=this,r=ep(e,this._firestore),i=new np(this._firestore);return t.prototype.get.call(this,e).then((function(t){return new Rf(n._firestore,i,r._key,t._document,new Pf(!1,!1),r.converter)}))},e}(function(){function t(t,e){this._firestore=t,this._transaction=e,this._dataReader=hf(t)}return t.prototype.get=function(t){var e=this,n=ep(t,this._firestore),r=new $f(this._firestore);return this._transaction.lookup([n._key]).then((function(t){if(!t||1!==t.length)return xr();var i=t[0];if(i.isFoundDocument())return new Nf(e._firestore,r,i.key,i,n.converter);if(i.isNoDocument())return new Nf(e._firestore,r,n._key,null,n.converter);throw xr()}))},t.prototype.set=function(t,e,n){var r=ep(t,this._firestore),i=Zf(r.converter,e,n),o=lf(this._dataReader,"Transaction.set",r._key,i,null!==r.converter,n);return this._transaction.set(r._key,o),this},t.prototype.update=function(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];var a,s=ep(t,this._firestore);return a="string"==typeof(e=(0,o.m9)(e))||e instanceof $l?bf(this._dataReader,"Transaction.update",s._key,e,n,r):gf(this._dataReader,"Transaction.update",s._key,e),this._transaction.update(s._key,a),this},t.prototype.delete=function(t){var e=ep(t,this._firestore);return this._transaction.delete(e._key),this},t}());function up(){if("undefined"==typeof Uint8Array)throw new Er(_r.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function cp(){if("undefined"==typeof atob)throw new Er(_r.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var hp=function(){function t(t){this._delegate=t}return t.fromBase64String=function(e){return cp(),new t(tf.fromBase64String(e))},t.fromUint8Array=function(e){return up(),new t(tf.fromUint8Array(e))},t.prototype.toBase64=function(){return cp(),this._delegate.toBase64()},t.prototype.toUint8Array=function(){return up(),this._delegate.toUint8Array()},t.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t}(),lp=function(){function t(){}return t.prototype.enableIndexedDbPersistence=function(t,e){return function(t,e){Zl(t=Ll(t,Jl));var n=Ql(t),r=t._freezeSettings(),i=new il;return Yl(n,i,new nl(i,r.cacheSizeBytes,null==e?void 0:e.forceOwnership))}(t._delegate,{forceOwnership:e})},t.prototype.enableMultiTabIndexedDbPersistence=function(t){return function(t){Zl(t=Ll(t,Jl));var e=Ql(t),n=t._freezeSettings(),r=new il;return Yl(e,r,new rl(r,n.cacheSizeBytes))}(t._delegate)},t.prototype.clearIndexedDbPersistence=function(t){return function(t){var e=this;if(t._initialized&&!t._terminated)throw new Er(_r.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");var n=new vs;return t._queue.enqueueAndForgetEvenWhileRestricted((function(){return(0,i.mG)(e,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return gs.yt()?(e=t+"main",[4,gs.delete(e)]):[2,Promise.resolve()];case 1:return n.sent(),[2]}}))}))}(xu(t._databaseId,t._persistenceKey))];case 1:return r.sent(),n.resolve(),[3,3];case 2:return e=r.sent(),n.reject(e),[3,3];case 3:return[2]}}))}))})),n.promise}(t._delegate)},t}(),fp=function(){function t(t,e,n){var r=this;this._delegate=e,this.Zc=n,this.INTERNAL={delete:function(){return r.terminate()}},t instanceof _l||(this.tu=t)}return Object.defineProperty(t.prototype,"_databaseId",{get:function(){return this._delegate._databaseId},enumerable:!1,configurable:!0}),t.prototype.settings=function(t){var e=this._delegate._getSettings();t.merge||e.host===t.host||Ar("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({},e),t)).merge,this._delegate._setSettings(t)},t.prototype.useEmulator=function(t,e,n){void 0===n&&(n={}),function(t,e,n,r){var i;void 0===r&&(r={});var a=(t=Ll(t,Fl))._getSettings();if("firestore.googleapis.com"!==a.host&&a.host!==e&&Ar("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},a),{host:e+":"+n,ssl:!1})),r.mockUserToken){var s,u;if("string"==typeof r.mockUserToken)s=r.mockUserToken,u=ac.MOCK_USER;else{s=(0,o.Sg)(r.mockUserToken,null===(i=t._app)||void 0===i?void 0:i.options.projectId);var c=r.mockUserToken.sub||r.mockUserToken.user_id;if(!c)throw new Er(_r.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");u=new ac(c)}t._credentials=new Tl(new Sl(s,u))}}(this._delegate,t,e,n)},t.prototype.enableNetwork=function(){return function(t){var e=this;return t.asyncQueue.enqueue((function(){return(0,i.mG)(e,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return[4,pl(t)];case 1:return e=r.sent(),[4,vl(t)];case 2:return n=r.sent(),[2,(e.setNetworkEnabled(!0),function(t){var e=Cr(t);return e.Or.delete(0),Dc(e)}(n))]}}))}))}))}(Ql(Ll(this._delegate,Jl)))},t.prototype.disableNetwork=function(){return function(t){var e=this;return t.asyncQueue.enqueue((function(){return(0,i.mG)(e,void 0,void 0,(function(){var e,n;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return[4,pl(t)];case 1:return e=r.sent(),[4,vl(t)];case 2:return n=r.sent(),[2,(e.setNetworkEnabled(!1),function(t){return(0,i.mG)(this,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return(e=Cr(t)).Or.add(0),[4,Pc(e)];case 1:return n.sent(),e.Br.set("Offline"),[2]}}))}))}(n))]}}))}))}))}(Ql(Ll(this._delegate,Jl)))},t.prototype.enablePersistence=function(t){var e=!1,n=!1;return t&&Cl("synchronizeTabs",e=!!t.synchronizeTabs,"experimentalForceOwningTab",n=!!t.experimentalForceOwningTab),e?this.Zc.enableMultiTabIndexedDbPersistence(this):this.Zc.enableIndexedDbPersistence(this,n)},t.prototype.clearPersistence=function(){return this.Zc.clearIndexedDbPersistence(this)},t.prototype.terminate=function(){return this.tu&&(this.tu._removeServiceInstance("firestore"),this.tu._removeServiceInstance("firestore-exp")),this._delegate._delete()},t.prototype.waitForPendingWrites=function(){return function(t){var e=this,n=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(e,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(r){switch(r.label){case 0:return e=Ph,[4,yl(t)];case 1:return[2,e.apply(void 0,[r.sent(),n])]}}))}))})),n.promise}(Ql(Ll(this._delegate,Jl)))},t.prototype.onSnapshotsInSync=function(t){return function(t,e){return function(t,e){var n=this,r=new ol(e);return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=function(t,e){Cr(t).Gr.add(e),e.next()},[4,ml(t)];case 1:return[2,e.apply(void 0,[n.sent(),r])]}}))}))})),function(){r.Wo(),t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var e;return(0,i.Jh)(this,(function(n){switch(n.label){case 0:return e=function(t,e){Cr(t).Gr.delete(e)},[4,ml(t)];case 1:return[2,e.apply(void 0,[n.sent(),r])]}}))}))}))}}(Ql(t=Ll(t,Jl)),zl(e)?e:{next:e})}(this._delegate,t)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this.tu)throw new Er(_r.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.tu},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){try{return new kp(this,Bl(this._delegate,t))}catch(t){throw gp(t,"collection()","Firestore.collection()")}},t.prototype.doc=function(t){try{return new mp(this,Gl(this._delegate,t))}catch(t){throw gp(t,"doc()","Firestore.doc()")}},t.prototype.collectionGroup=function(t){try{return new Sp(this,function(t,e){if(t=Ll(t,Fl),xl("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new Er(_r.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new Vl(t,null,function(t){return new Bi(Gr.emptyPath(),t)}(e))}(this._delegate,t))}catch(t){throw gp(t,"collectionGroup()","Firestore.collectionGroup()")}},t.prototype.runTransaction=function(t){var e=this;return function(t,e){return function(t,e){var n=this,r=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,function(t){return fl(t).then((function(t){return t.datastore}))}(t)];case 1:return n=i.sent(),new sl(t.asyncQueue,n,e,r).run(),[2]}}))}))})),r.promise}(Ql(t),(function(n){return e(new sp(t,n))}))}(this._delegate,(function(n){return t(new dp(e,n))}))},t.prototype.batch=function(){var t=this;return Ql(this._delegate),new vp(new tp(this._delegate,(function(e){return op(t._delegate,e)})))},t.prototype.loadBundle=function(t){throw new Er(_r.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},t.prototype.namedQuery=function(t){throw new Er(_r.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},t}(),pp=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,i.ZT)(e,t),e.prototype.convertBytes=function(t){return new hp(new tf(t))},e.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return mp.eu(e,this.firestore,null)},e}(Yf),dp=function(){function t(t,e){this._firestore=t,this._delegate=e,this._userDataWriter=new pp(t)}return t.prototype.get=function(t){var e=this,n=Ap(t);return this._delegate.get(n).then((function(t){return new _p(e._firestore,new Rf(e._firestore._delegate,e._userDataWriter,t._key,t._document,t.metadata,n.converter))}))},t.prototype.set=function(t,e,n){var r=Ap(t);return n?(Nl("Transaction.set",n),this._delegate.set(r,e,n)):this._delegate.set(r,e),this},t.prototype.update=function(t,e,n){for(var r,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];var s=Ap(t);return 2===arguments.length?this._delegate.update(s,e):(r=this._delegate).update.apply(r,(0,i.ev)([s,e,n],o)),this},t.prototype.delete=function(t){var e=Ap(t);return this._delegate.delete(e),this},t}(),vp=function(){function t(t){this._delegate=t}return t.prototype.set=function(t,e,n){var r=Ap(t);return n?(Nl("WriteBatch.set",n),this._delegate.set(r,e,n)):this._delegate.set(r,e),this},t.prototype.update=function(t,e,n){for(var r,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];var s=Ap(t);return 2===arguments.length?this._delegate.update(s,e):(r=this._delegate).update.apply(r,(0,i.ev)([s,e,n],o)),this},t.prototype.delete=function(t){var e=Ap(t);return this._delegate.delete(e),this},t.prototype.commit=function(){return this._delegate.commit()},t}(),yp=function(){function t(t,e,n){this._firestore=t,this._userDataWriter=e,this._delegate=n}return t.prototype.fromFirestore=function(t,e){var n=new Lf(this._firestore._delegate,this._userDataWriter,t._key,t._document,t.metadata,null);return this._delegate.fromFirestore(new Ep(this._firestore,n),null!=e?e:{})},t.prototype.toFirestore=function(t,e){return e?this._delegate.toFirestore(t,e):this._delegate.toFirestore(t)},t.nu=function(e,n){var r=t.su,i=r.get(e);i||(i=new WeakMap,r.set(e,i));var o=i.get(n);return o||(o=new t(e,new pp(e),n),i.set(n,o)),o},t}();yp.su=new WeakMap;var mp=function(){function t(t,e){this.firestore=t,this._delegate=e,this._userDataWriter=new pp(t)}return t.iu=function(e,n,r){if(e.length%2!=0)throw new Er(_r.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e.canonicalString()+" has "+e.length);return new t(n,new Ul(n._delegate,r,new ii(e)))},t.eu=function(e,n,r){return new t(n,new Ul(n._delegate,r,e))},Object.defineProperty(t.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new kp(this.firestore,this._delegate.parent)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){try{return new kp(this.firestore,Bl(this._delegate,t))}catch(t){throw gp(t,"collection()","DocumentReference.collection()")}},t.prototype.isEqual=function(t){return(t=(0,o.m9)(t))instanceof Ul&&Kl(this._delegate,t)},t.prototype.set=function(t,e){e=Nl("DocumentReference.set",e);try{return function(t,e,n){t=Ll(t,Ul);var r=Ll(t.firestore,Jl),i=Zf(t.converter,e,n);return op(r,[lf(hf(r),"setDoc",t._key,i,null!==t.converter,n).toMutation(t._key,So.none())])}(this._delegate,t,e)}catch(t){throw gp(t,"setDoc()","DocumentReference.set()")}},t.prototype.update=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];try{return 1===arguments.length?rp(this._delegate,t):rp.apply(void 0,(0,i.ev)([this._delegate,t,e],n))}catch(t){throw gp(t,"updateDoc()","DocumentReference.update()")}},t.prototype.delete=function(){return op(Ll((t=this._delegate).firestore,Jl),[new Fo(t._key,So.none())]);var t},t.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=bp(e),i=wp(e,(function(e){return new _p(t.firestore,new Rf(t.firestore._delegate,t._userDataWriter,e._key,e._document,e.metadata,t._delegate.converter))}));return ip(this._delegate,r,i)},t.prototype.get=function(t){var e=this;return("cache"===(null==t?void 0:t.source)?function(t){t=Ll(t,Ul);var e=Ll(t.firestore,Jl),n=Ql(e),r=new np(e);return function(t,e){var n=this,r=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:return n=function(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,function(t,e){var n=Cr(t);return n.persistence.runTransaction("read document","readonly",(function(t){return n.Mn.mn(t,e)}))}(t,e)];case 1:return(o=i.sent()).isFoundDocument()?n.resolve(o):o.isNoDocument()?n.resolve(null):n.reject(new Er(_r.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 r=i.sent(),o=ih(r,"Failed to get document '"+e+" from cache"),n.reject(o),[3,3];case 3:return[2]}}))}))},[4,dl(t)];case 1:return[2,n.apply(void 0,[o.sent(),e,r])]}}))}))})),r.promise}(n,t._key).then((function(n){return new Rf(e,r,t._key,n,new Pf(null!==n&&n.hasLocalMutations,!0),t.converter)}))}(this._delegate):"server"===(null==t?void 0:t.source)?function(t){t=Ll(t,Ul);var e=Ll(t.firestore,Jl);return gl(Ql(e),t._key,{source:"server"}).then((function(n){return ap(e,t,n)}))}(this._delegate):function(t){t=Ll(t,Ul);var e=Ll(t.firestore,Jl);return gl(Ql(e),t._key).then((function(n){return ap(e,t,n)}))}(this._delegate)).then((function(t){return new _p(e.firestore,new Rf(e.firestore._delegate,e._userDataWriter,t._key,t._document,t.metadata,e._delegate.converter))}))},t.prototype.withConverter=function(e){return new t(this.firestore,e?this._delegate.withConverter(yp.nu(this.firestore,e)):this._delegate.withConverter(null))},t}();function gp(t,e,n){return t.message=t.message.replace(e,n),t}function bp(t){for(var e=0,n=t;e<n.length;e++){var r=n[e];if("object"==typeof r&&!zl(r))return r}return{}}function wp(t,e){var n,r,i;return{next:function(t){i.next&&i.next(e(t))},error:null===(n=(i=zl(t[0])?t[0]:zl(t[1])?t[1]:"function"==typeof t[0]?{next:t[0],error:t[1],complete:t[2]}:{next:t[1],error:t[2],complete:t[3]}).error)||void 0===n?void 0:n.bind(i),complete:null===(r=i.complete)||void 0===r?void 0:r.bind(i)}}var _p=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"ref",{get:function(){return new mp(this._firestore,this._delegate.ref)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return this._delegate.exists()},enumerable:!1,configurable:!0}),t.prototype.data=function(t){return this._delegate.data(t)},t.prototype.get=function(t,e){return this._delegate.get(t,e)},t.prototype.isEqual=function(t){return Ff(this._delegate,t._delegate)},t}(),Ep=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.ZT)(e,t),e.prototype.data=function(t){return this._delegate.data(t)},e}(_p),Sp=function(){function t(t,e){this.firestore=t,this._delegate=e,this._userDataWriter=new pp(t)}return t.prototype.where=function(e,n,r){try{return new t(this.firestore,qf(this._delegate,function(t,e,n){var r=e,i=Df("where",t);return new Bf(i,r,n)}(e,n,r)))}catch(e){throw gp(e,/(orderBy|where)\(\)/,"Query.$1()")}},t.prototype.orderBy=function(e,n){try{return new t(this.firestore,qf(this._delegate,function(t,e){void 0===e&&(e="asc");var n=e,r=Df("orderBy",t);return new Gf(r,n)}(e,n)))}catch(e){throw gp(e,/(orderBy|where)\(\)/,"Query.$1()")}},t.prototype.limit=function(e){try{return new t(this.firestore,qf(this._delegate,function(t){return jl("limit",t),new Kf("limit",t,"F")}(e)))}catch(e){throw gp(e,"limit()","Query.limit()")}},t.prototype.limitToLast=function(e){try{return new t(this.firestore,qf(this._delegate,function(t){return jl("limitToLast",t),new Kf("limitToLast",t,"L")}(e)))}catch(e){throw gp(e,"limitToLast()","Query.limitToLast()")}},t.prototype.startAt=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,qf(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Hf("startAt",t,!0)}.apply(void 0,e)))}catch(e){throw gp(e,"startAt()","Query.startAt()")}},t.prototype.startAfter=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,qf(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Hf("startAfter",t,!1)}.apply(void 0,e)))}catch(e){throw gp(e,"startAfter()","Query.startAfter()")}},t.prototype.endBefore=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,qf(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Wf("endBefore",t,!0)}.apply(void 0,e)))}catch(e){throw gp(e,"endBefore()","Query.endBefore()")}},t.prototype.endAt=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,qf(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Wf("endAt",t,!1)}.apply(void 0,e)))}catch(e){throw gp(e,"endAt()","Query.endAt()")}},t.prototype.isEqual=function(t){return Hl(this._delegate,t._delegate)},t.prototype.get=function(t){var e=this;return("cache"===(null==t?void 0:t.source)?function(t){t=Ll(t,Vl);var e=Ll(t.firestore,Jl),n=Ql(e),r=new np(e);return function(t,e){var n=this,r=new vs;return t.asyncQueue.enqueueAndForget((function(){return(0,i.mG)(n,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(o){switch(o.label){case 0:return n=function(t,e,n){return(0,i.mG)(this,void 0,void 0,(function(){var r,o,a,s,u;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Ku(t,e,!0)];case 1:return u=i.sent(),r=new wh(e,u.Bn),o=r._o(u.documents),a=r.applyChanges(o,!1),n.resolve(a.snapshot),[3,3];case 2:return s=i.sent(),u=ih(s,"Failed to execute query '"+e+" against cache"),n.reject(u),[3,3];case 3:return[2]}}))}))},[4,dl(t)];case 1:return[2,n.apply(void 0,[o.sent(),e,r])]}}))}))})),r.promise}(n,t._query).then((function(n){return new jf(e,r,t,n)}))}(this._delegate):"server"===(null==t?void 0:t.source)?function(t){t=Ll(t,Vl);var e=Ll(t.firestore,Jl),n=Ql(e),r=new np(e);return bl(n,t._query,{source:"server"}).then((function(n){return new jf(e,r,t,n)}))}(this._delegate):function(t){t=Ll(t,Vl);var e=Ll(t.firestore,Jl),n=Ql(e),r=new np(e);return Uf(t._query),bl(n,t._query).then((function(n){return new jf(e,r,t,n)}))}(this._delegate)).then((function(t){return new Tp(e.firestore,new jf(e.firestore._delegate,e._userDataWriter,e._delegate,t._snapshot))}))},t.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=bp(e),i=wp(e,(function(e){return new Tp(t.firestore,new jf(t.firestore._delegate,t._userDataWriter,t._delegate,e._snapshot))}));return ip(this._delegate,r,i)},t.prototype.withConverter=function(e){return new t(this.firestore,e?this._delegate.withConverter(yp.nu(this.firestore,e)):this._delegate.withConverter(null))},t}(),Ip=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"type",{get:function(){return this._delegate.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"doc",{get:function(){return new Ep(this._firestore,this._delegate.doc)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"oldIndex",{get:function(){return this._delegate.oldIndex},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"newIndex",{get:function(){return this._delegate.newIndex},enumerable:!1,configurable:!0}),t}(),Tp=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"query",{get:function(){return new Sp(this._firestore,this._delegate.query)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._delegate.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this._delegate.empty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"docs",{get:function(){var t=this;return this._delegate.docs.map((function(e){return new Ep(t._firestore,e)}))},enumerable:!1,configurable:!0}),t.prototype.docChanges=function(t){var e=this;return this._delegate.docChanges(t).map((function(t){return new Ip(e._firestore,t)}))},t.prototype.forEach=function(t,e){var n=this;this._delegate.forEach((function(r){t.call(e,new Ep(n._firestore,r))}))},t.prototype.isEqual=function(t){return Ff(this._delegate,t._delegate)},t}(),kp=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).firestore=e,r._delegate=n,r}return(0,i.ZT)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this._delegate.parent;return t?new mp(this.firestore,t):null},enumerable:!1,configurable:!0}),e.prototype.doc=function(t){try{return new mp(this.firestore,void 0===t?Gl(this._delegate):Gl(this._delegate,t))}catch(t){throw gp(t,"doc()","CollectionReference.doc()")}},e.prototype.add=function(t){var e=this;return function(t,e){var n=Ll(t.firestore,Jl),r=Gl(t),i=Zf(t.converter,e);return op(n,[lf(hf(t.firestore),"addDoc",r._key,i,null!==t.converter,{}).toMutation(r._key,So.exists(!1))]).then((function(){return r}))}(this._delegate,t).then((function(t){return new mp(e.firestore,t)}))},e.prototype.isEqual=function(t){return Kl(this._delegate,t._delegate)},e.prototype.withConverter=function(t){return new e(this.firestore,t?this._delegate.withConverter(yp.nu(this.firestore,t)):this._delegate.withConverter(null))},e}(Sp);function Ap(t){return Ll(t,Ul)}var Op,xp=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._delegate=new($l.bind.apply($l,(0,i.ev)([void 0],t)))}return t.documentId=function(){return new t(Hr.keyField().canonicalString())},t.prototype.isEqual=function(t){return(t=(0,o.m9)(t))instanceof $l&&this._delegate._internalPath.isEqual(t._internalPath)},t}(),Np=function(){function t(t){this._delegate=t}return t.serverTimestamp=function(){var e=new df("serverTimestamp");return e._methodName="FieldValue.serverTimestamp",new t(e)},t.delete=function(){var e=new ff("deleteField");return e._methodName="FieldValue.delete",new t(e)},t.arrayUnion=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new vf("arrayUnion",t)}.apply(void 0,e);return r._methodName="FieldValue.arrayUnion",new t(r)},t.arrayRemove=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new yf("arrayRemove",t)}.apply(void 0,e);return r._methodName="FieldValue.arrayRemove",new t(r)},t.increment=function(e){var n=function(t){return new mf("increment",t)}(e);return n._methodName="FieldValue.increment",new t(n)},t.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},t}(),Cp=n(2444),Dp={Firestore:fp,GeoPoint:nf,Timestamp:Mr,Blob:hp,Transaction:dp,WriteBatch:vp,DocumentReference:mp,DocumentSnapshot:_p,Query:Sp,QueryDocumentSnapshot:Ep,QuerySnapshot:Tp,CollectionReference:kp,FieldPath:xp,FieldValue:Np,setLogLevel:function(t){var e;e=t,Sr.setLogLevel(e)},CACHE_SIZE_UNLIMITED:-1};(function(t,e){t.INTERNAL.registerComponent(new Cp.wA("firestore",(function(t){return function(t,e){return new fp(t,new Jl(t,e),new lp)}(t.getProvider("app").getImmediate(),t.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},Dp)))})(Op=r.Z),Op.registerVersion("@firebase/firestore","2.4.0")},2249:function(t,e,n){var r,i,o=n(5163),a=n(6765),s=n(2444),u=n(3936),c=((r={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r["invalid-log-argument"]="First argument to `onLog` must be null or a function.",r),h=new a.LL("app","Firebase",c),l="@firebase/app",f="[DEFAULT]",p=((i={})[l]="fire-core",i["@firebase/analytics"]="fire-analytics",i["@firebase/app-check"]="fire-app-check",i["@firebase/auth"]="fire-auth",i["@firebase/database"]="fire-rtdb",i["@firebase/functions"]="fire-fn",i["@firebase/installations"]="fire-iid",i["@firebase/messaging"]="fire-fcm",i["@firebase/performance"]="fire-perf",i["@firebase/remote-config"]="fire-rc",i["@firebase/storage"]="fire-gcs",i["@firebase/firestore"]="fire-fst",i["fire-js"]="fire-js",i["firebase-wrapper"]="fire-js-all",i),d=new u.Yd("@firebase/app"),v=function(){function t(t,e,n){var r=this;this.firebase_=n,this.isDeleted_=!1,this.name_=e.name,this.automaticDataCollectionEnabled_=e.automaticDataCollectionEnabled||!1,this.options_=(0,a.p$)(t),this.container=new s.H0(e.name),this._addComponent(new s.wA("app",(function(){return r}),"PUBLIC")),this.firebase_.INTERNAL.components.forEach((function(t){return r._addComponent(t)}))}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise((function(e){t.checkDestroyed_(),e()})).then((function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map((function(t){return t.delete()})))})).then((function(){t.isDeleted_=!0}))},t.prototype._getService=function(t,e){var n;void 0===e&&(e=f),this.checkDestroyed_();var r=this.container.getProvider(t);return r.isInitialized()||"EXPLICIT"!==(null===(n=r.getComponent())||void 0===n?void 0:n.instantiationMode)||r.initialize(),r.getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e=f),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){d.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw h.create("app-deleted",{appName:this.name_})},t}();v.prototype.name&&v.prototype.options||v.prototype.delete||console.log("dc");var y=function t(){var e=function(t){var e={},n=new Map,r={__esModule:!0,initializeApp:function(n,i){void 0===i&&(i={}),"object"==typeof i&&null!==i||(i={name:i});var o=i;void 0===o.name&&(o.name=f);var s=o.name;if("string"!=typeof s||!s)throw h.create("bad-app-name",{appName:String(s)});if((0,a.r3)(e,s))throw h.create("duplicate-app",{appName:s});var u=new t(n,o,r);return e[s]=u,u},app:i,registerVersion:function(t,e,n){var r,i=null!==(r=p[t])&&void 0!==r?r:t;n&&(i+="-"+n);var a=i.match(/\s|\//),u=e.match(/\s|\//);if(a||u){var c=['Unable to register library "'+i+'" with version "'+e+'":'];return a&&c.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),a&&u&&c.push("and"),u&&c.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void d.warn(c.join(" "))}o(new s.wA(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))},setLogLevel:u.Ub,onLog:function(t,e){if(null!==t&&"function"!=typeof t)throw h.create("invalid-log-argument");(0,u.Am)(t,e)},apps:null,SDK_VERSION:"8.10.0",INTERNAL:{registerComponent:o,removeApp:function(t){delete e[t]},components:n,useAsService:function(t,e){return"serverAuth"===e?null:e}}};function i(t){if(t=t||f,!(0,a.r3)(e,t))throw h.create("no-app",{appName:t});return e[t]}function o(o){var s=o.name;if(n.has(s))return d.debug("There were multiple attempts to register component "+s+"."),"PUBLIC"===o.type?r[s]:null;if(n.set(s,o),"PUBLIC"===o.type){var u=function(t){if(void 0===t&&(t=i()),"function"!=typeof t[s])throw h.create("invalid-app-argument",{appName:s});return t[s]()};void 0!==o.serviceProps&&(0,a.ZB)(u,o.serviceProps),r[s]=u,t.prototype[s]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._getService.bind(this,s).apply(this,o.multipleInstances?t:[])}}for(var c=0,l=Object.keys(e);c<l.length;c++){var f=l[c];e[f]._addComponent(o)}return"PUBLIC"===o.type?r[s]:null}return r.default=r,Object.defineProperty(r,"apps",{get:function(){return Object.keys(e).map((function(t){return e[t]}))}}),i.App=t,r}(v);return e.INTERNAL=(0,o.pi)((0,o.pi)({},e.INTERNAL),{createFirebaseNamespace:t,extendNamespace:function(t){(0,a.ZB)(e,t)},createSubscribe:a.ne,ErrorFactory:a.LL,deepExtend:a.ZB}),e}(),m=function(){function t(t){this.container=t}return t.prototype.getPlatformInfoString=function(){return this.container.getProviders().map((function(t){if(function(t){var e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}();if((0,a.jU)()&&void 0!==self.firebase){d.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");var g=self.firebase.SDK_VERSION;g&&g.indexOf("LITE")>=0&&d.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var b=y.initializeApp;y.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,a.UG)()&&d.warn('\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the "main" field in package.json.\n \n If you are using Webpack, you can specify "main" as the first item in\n "resolve.mainFields":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the @rollup/plugin-node-resolve plugin and specify "main"\n as the first item in "mainFields", e.g. [\'main\', \'module\'].\n https://github.com/rollup/@rollup/plugin-node-resolve\n '),b.apply(void 0,t)};var w=y;!function(t,e){t.INTERNAL.registerComponent(new s.wA("platform-logger",(function(t){return new m(t)}),"PRIVATE")),t.registerVersion(l,"0.6.30",void 0),t.registerVersion("fire-js","")}(w),e.Z=w},7823:function(t,e,n){n.r(e),n.d(e,{MobXProviderContext:function(){return ot},Observer:function(){return T},PropTypes:function(){return gt},Provider:function(){return at},disposeOnUnmount:function(){return pt},enableStaticRendering:function(){return g},inject:function(){return ct},isUsingStaticRendering:function(){return b},observer:function(){return rt},observerBatching:function(){return u},useAsObservableSource:function(){return A},useLocalObservable:function(){return k},useLocalStore:function(){return O},useObserver:function(){return x},useStaticRendering:function(){return N}});var r=n(2965),i=n(9297),o=n.n(i);if(!i.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!r.makeObservable)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var a=n(2268);function s(t){t()}function u(t){t||(t=s),(0,r.configure)({reactionScheduler:t})}var c=[];function h(t){return(0,r.getDependencyTree)(t)}var l="undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry;function f(t){return{reaction:t,mounted:!1,changedBeforeMount:!1,cleanAt:Date.now()+p}}var p=1e4,d=l?function(t){var e=new Map,n=1,r=new t((function(t){var n=e.get(t);n&&(n.reaction.dispose(),e.delete(t))}));return{addReactionToTrack:function(t,i,o){var a=n++;return r.register(o,a,t),t.current=f(i),t.current.finalizationRegistryCleanupToken=a,e.set(a,t.current),t.current},recordReactionAsCommitted:function(t){r.unregister(t),t.current&&t.current.finalizationRegistryCleanupToken&&e.delete(t.current.finalizationRegistryCleanupToken)},forceCleanupTimerToRunNowForTests:function(){},resetCleanupScheduleForTests:function(){}}}(l):function(){var t,e=new Set;function n(){void 0===t&&(t=setTimeout(r,1e4))}function r(){t=void 0;var r=Date.now();e.forEach((function(t){var n=t.current;n&&r>=n.cleanAt&&(n.reaction.dispose(),t.current=null,e.delete(t))})),e.size>0&&n()}return{addReactionToTrack:function(t,r,i){var o;return t.current=f(r),o=t,e.add(o),n(),t.current},recordReactionAsCommitted:function(t){e.delete(t)},forceCleanupTimerToRunNowForTests:function(){t&&(clearTimeout(t),r())},resetCleanupScheduleForTests:function(){var n,r;if(e.size>0){try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),o=i.next();!o.done;o=i.next()){var a=o.value,s=a.current;s&&(s.reaction.dispose(),a.current=null)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.clear()}t&&(clearTimeout(t),t=void 0)}}}(),v=d.addReactionToTrack,y=d.recordReactionAsCommitted,m=(d.resetCleanupScheduleForTests,d.forceCleanupTimerToRunNowForTests,!1);function g(t){m=t}function b(){return m}function w(t){return"observer"+t}var _=function(){};function E(t,e){if(void 0===e&&(e="observed"),b())return t();var n,a=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(o().useState(new _),1)[0],s=(n=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,i.useState)(0),2)[1],(0,i.useCallback)((function(){n((function(t){return t+1}))}),c)),u=o().useRef(null);if(!u.current)var l=new r.Reaction(w(e),(function(){f.mounted?s():f.changedBeforeMount=!0})),f=v(u,l,a);var p,d,m=u.current.reaction;if(o().useDebugValue(m,h),o().useEffect((function(){return y(u),u.current?(u.current.mounted=!0,u.current.changedBeforeMount&&(u.current.changedBeforeMount=!1,s())):(u.current={reaction:new r.Reaction(w(e),(function(){s()})),mounted:!0,changedBeforeMount:!1,cleanAt:1/0},s()),function(){u.current.reaction.dispose(),u.current=null}}),[]),m.track((function(){try{p=t()}catch(t){d=t}})),d)throw d;return p}var S=function(){return(S=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var I={$$typeof:!0,render:!0,compare:!0,type:!0};function T(t){var e=t.children,n=t.render,r=e||n;return"function"!=typeof r?null:E(r)}function k(t,e){return(0,i.useState)((function(){return(0,r.observable)(t(),e,{autoBind:!0})}))[0]}T.displayName="Observer";function A(t){var e=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}((0,i.useState)((function(){return(0,r.observable)(t,{},{deep:!1})})),1)[0];return(0,r.runInAction)((function(){Object.assign(e,t)})),e}function O(t,e){var n=e&&A(e);return(0,i.useState)((function(){return(0,r.observable)(t(n),void 0,{autoBind:!0})}))[0]}function x(t,e){return void 0===e&&(e="observed"),E(t,e)}function N(t){g(t)}u(a.unstable_batchedUpdates);var C=0,D={};function P(t){return D[t]||(D[t]=function(t){if("function"==typeof Symbol)return Symbol(t);var e="__$mobx-react "+t+" ("+C+")";return C++,e}(t)),D[t]}function R(t,e){if(L(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.hasOwnProperty.call(e,n[i])||!L(t[n[i]],e[n[i]]))return!1;return!0}function L(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}var j={$$typeof:1,render:1,compare:1,type:1,childContextTypes:1,contextType:1,contextTypes:1,defaultProps:1,getDefaultProps:1,getDerivedStateFromError:1,getDerivedStateFromProps:1,mixins:1,displayName:1,propTypes:1};function M(t,e,n){Object.hasOwnProperty.call(t,e)?t[e]=n:Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0,value:n})}var F=P("patchMixins"),U=P("patchedDefinition");function V(t,e){for(var n=this,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];e.locks++;try{var a;return null!=t&&(a=t.apply(this,i)),a}finally{e.locks--,0===e.locks&&e.methods.forEach((function(t){t.apply(n,i)}))}}function q(t,e){return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];V.call.apply(V,[this,t,e].concat(r))}}function B(t,e,n){var r=function(t,e){var n=t[F]=t[F]||{},r=n[e]=n[e]||{};return r.locks=r.locks||0,r.methods=r.methods||[],r}(t,e);r.methods.indexOf(n)<0&&r.methods.push(n);var i=Object.getOwnPropertyDescriptor(t,e);if(!i||!i[U]){var o=t[e],a=G(t,e,i?i.enumerable:void 0,r,o);Object.defineProperty(t,e,a)}}function G(t,e,n,r,i){var o,a=q(i,r);return(o={})[U]=!0,o.get=function(){return a},o.set=function(i){if(this===t)a=q(i,r);else{var o=G(this,e,n,r,i);Object.defineProperty(this,e,o)}},o.configurable=!0,o.enumerable=n,o}var K=r.$mobx||"$mobx",H=P("isMobXReactObserver"),W=P("isUnmounted"),z=P("skipRender"),J=P("isForcingUpdate");function Q(t){var e=t.prototype;if(t[H]){var n=X(e);console.warn("The provided component class ("+n+") \n has already been declared as an observer component.")}else t[H]=!0;if(e.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(t.__proto__!==i.PureComponent)if(e.shouldComponentUpdate){if(e.shouldComponentUpdate!==Z)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else e.shouldComponentUpdate=Z;$(e,"props"),$(e,"state");var r=e.render;return e.render=function(){return Y.call(this,r)},B(e,"componentWillUnmount",(function(){var t;if(!0!==b()&&(null==(t=this.render[K])||t.dispose(),this[W]=!0,!this.render[K])){var e=X(this);console.warn("The reactive render of an observer class component ("+e+") \n was overriden after MobX attached. This may result in a memory leak if the \n overriden reactive render was not properly disposed.")}})),t}function X(t){return t.displayName||t.name||t.constructor&&(t.constructor.displayName||t.constructor.name)||"<component>"}function Y(t){var e=this;if(!0===b())return t.call(this);M(this,z,!1),M(this,J,!1);var n=X(this),o=t.bind(this),a=!1,s=new r.Reaction(n+".render()",(function(){if(!a&&(a=!0,!0!==e[W])){var t=!0;try{M(e,J,!0),e[z]||i.Component.prototype.forceUpdate.call(e),t=!1}finally{M(e,J,!1),t&&s.dispose()}}}));function u(){a=!1;var t=void 0,e=void 0;if(s.track((function(){try{e=(0,r._allowStateChanges)(!1,o)}catch(e){t=e}})),t)throw t;return e}return s.reactComponent=this,u[K]=s,this.render=u,u.call(this)}function Z(t,e){return b()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==e||!R(this.props,t)}function $(t,e){var n=P("reactProp_"+e+"_valueHolder"),i=P("reactProp_"+e+"_atomHolder");function o(){return this[i]||M(this,i,(0,r.createAtom)("reactive "+e)),this[i]}Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var t=!1;return r._allowStateReadsStart&&r._allowStateReadsEnd&&(t=(0,r._allowStateReadsStart)(!0)),o.call(this).reportObserved(),r._allowStateReadsStart&&r._allowStateReadsEnd&&(0,r._allowStateReadsEnd)(t),this[n]},set:function(t){this[J]||R(this[n],t)?M(this,n,t):(M(this,n,t),M(this,z,!0),o.call(this).reportChanged(),M(this,z,!1))}})}var tt="function"==typeof Symbol&&Symbol.for,et=tt?Symbol.for("react.forward_ref"):"function"==typeof i.forwardRef&&(0,i.forwardRef)((function(t){return null})).$$typeof,nt=tt?Symbol.for("react.memo"):"function"==typeof i.memo&&(0,i.memo)((function(t){return null})).$$typeof;function rt(t){if(!0===t.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),nt&&t.$$typeof===nt)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(et&&t.$$typeof===et){var e=t.render;if("function"!=typeof e)throw new Error("render property of ForwardRef was not a function");return(0,i.forwardRef)((function(){var t=arguments;return(0,i.createElement)(T,null,(function(){return e.apply(void 0,t)}))}))}return"function"!=typeof t||t.prototype&&t.prototype.render||t.isReactClass||Object.prototype.isPrototypeOf.call(i.Component,t)?Q(t):function(t,e){if(b())return t;var n,r,o,a=S({forwardRef:!1},e),s=t.displayName||t.name,u=function(e,n){return E((function(){return t(e,n)}),s)};return u.displayName=s,n=a.forwardRef?(0,i.memo)((0,i.forwardRef)(u)):(0,i.memo)(u),r=t,o=n,Object.keys(r).forEach((function(t){I[t]||Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(r,t))})),n.displayName=s,n}(t)}function it(){return(it=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var ot=o().createContext({});function at(t){var e=t.children,n=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,["children"]),r=o().useContext(ot),i=o().useRef(it({},r,n)).current;return o().createElement(ot.Provider,{value:i},e)}function st(t,e,n,r){var i,a,s,u=o().forwardRef((function(n,r){var i=it({},n),a=o().useContext(ot);return Object.assign(i,t(a||{},i)||{}),r&&(i.ref=r),o().createElement(e,i)}));return r&&(u=rt(u)),u.isMobxInjector=!0,i=e,a=u,s=Object.getOwnPropertyNames(Object.getPrototypeOf(i)),Object.getOwnPropertyNames(i).forEach((function(t){j[t]||-1!==s.indexOf(t)||Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(i,t))})),u.wrappedComponent=e,u.displayName=function(t,e){var n=t.displayName||t.name||t.constructor&&t.constructor.name||"Component";return e?"inject-with-"+e+"("+n+")":"inject("+n+")"}(e,n),u}function ut(t){return function(e,n){return t.forEach((function(t){if(!(t in n)){if(!(t in e))throw new Error("MobX injector: Store '"+t+"' is not available! Make sure it is provided by some Provider");n[t]=e[t]}})),n}}function ct(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if("function"==typeof arguments[0]){var r=arguments[0];return function(t){return st(r,t,r.name,!0)}}return function(t){return st(ut(e),t,e.join("-"),!1)}}at.displayName="MobXProvider";var ht=P("disposeOnUnmountProto"),lt=P("disposeOnUnmountInst");function ft(){var t=this;[].concat(this[ht]||[],this[lt]||[]).forEach((function(e){var n="string"==typeof e?t[e]:e;null!=n&&(Array.isArray(n)?n.map((function(t){return t()})):n())}))}function pt(t,e){if(Array.isArray(e))return e.map((function(e){return pt(t,e)}));var n=Object.getPrototypeOf(t).constructor,r=Object.getPrototypeOf(t.constructor),i=Object.getPrototypeOf(Object.getPrototypeOf(t));if(n!==o().Component&&n!==o().PureComponent&&r!==o().Component&&r!==o().PureComponent&&i!==o().Component&&i!==o().PureComponent)throw new Error("[mobx-react] disposeOnUnmount only supports direct subclasses of React.Component or React.PureComponent.");if("string"!=typeof e&&"function"!=typeof e&&!Array.isArray(e))throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var a="string"==typeof e,s=!!t[ht]||!!t[lt];return(a?t[ht]||(t[ht]=[]):t[lt]||(t[lt]=[])).push(e),s||B(t,"componentWillUnmount",ft),"string"!=typeof e?e:void 0}function dt(t){function e(e,n,i,o,a,s){for(var u=arguments.length,c=new Array(u>6?u-6:0),h=6;h<u;h++)c[h-6]=arguments[h];return(0,r.untracked)((function(){if(o=o||"<<anonymous>>",s=s||i,null==n[i]){if(e){var r=null===n[i]?"null":"undefined";return new Error("The "+a+" `"+s+"` is marked as required in `"+o+"`, but its value is `"+r+"`.")}return null}return t.apply(void 0,[n,i,o,a,s].concat(c))}))}var n=e.bind(null,!1);return n.isRequired=e.bind(null,!0),n}function vt(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,e){return"symbol"===t||"Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol}(e,t)?"symbol":e}function yt(t,e){return dt((function(n,i,o,a,s){return(0,r.untracked)((function(){if(t&&vt(n[i])===e.toLowerCase())return null;var a;switch(e){case"Array":a=r.isObservableArray;break;case"Object":a=r.isObservableObject;break;case"Map":a=r.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+e)}var u=n[i];if(!a(u)){var c=function(t){var e=vt(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}(u),h=t?" or javascript `"+e.toLowerCase()+"`":"";return new Error("Invalid prop `"+s+"` of type `"+c+"` supplied to `"+o+"`, expected `mobx.Observable"+e+"`"+h+".")}return null}))}))}function mt(t,e){return dt((function(n,i,o,a,s){for(var u=arguments.length,c=new Array(u>5?u-5:0),h=5;h<u;h++)c[h-5]=arguments[h];return(0,r.untracked)((function(){if("function"!=typeof e)return new Error("Property `"+s+"` of component `"+o+"` has invalid PropType notation.");var r=yt(t,"Array")(n,i,o,a,s);if(r instanceof Error)return r;for(var u=n[i],h=0;h<u.length;h++)if((r=e.apply(void 0,[u,h,o,a,s+"["+h+"]"].concat(c)))instanceof Error)return r;return null}))}))}var gt={observableArray:yt(!1,"Array"),observableArrayOf:mt.bind(null,!1),observableMap:yt(!1,"Map"),observableObject:yt(!1,"Object"),arrayOrObservableArray:yt(!0,"Array"),arrayOrObservableArrayOf:mt.bind(null,!0),objectOrObservableObject:yt(!0,"Object")};if(!i.Component)throw new Error("mobx-react requires React to be available");if(!r.observable)throw new Error("mobx-react requires mobx to be available")},1903:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ContextProvider=void 0;var i=r(n(9297)),o=n(5925);e.ContextProvider=function(t){return i.default.createElement(o.ChannelsContextProvider,null,i.default.createElement(o.SectionsContextProvider,null,i.default.createElement(o.VideosContextProvider,null,i.default.createElement(o.UserContextProvider,null,i.default.createElement(o.OrganizationSubscriptionsContextProvider,null,i.default.createElement(o.PurchasesWithVideosContextProvider,null,i.default.createElement(o.ScreensContextProvider,null,i.default.createElement(o.RowItemsContextProvider,null,t.children))))))))}},2585:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.withPlayerContext=e.PlayerProvider=e.PlayerContext=void 0;var s=a(n(9297)),u=n(9517);e.PlayerContext=s.default.createContext(void 0),e.PlayerProvider=function(t){var n=t.children,r=t.playerWrapperId,i=c(void 0===r?"default":r),o=h(),a=s.default.createElement(e.PlayerContext.Provider,{value:i},n);return o&&(a=s.default.createElement(o.Provider,{value:{player:i}},a)),a};var c=function(t){var e=(0,s.useState)(null),n=e[0],r=e[1];return(0,s.useEffect)((function(){u.bundlePromise.then((function(e){var n,i=null===(n=e.getters)||void 0===n?void 0:n.getPlayerWrapper({playerWrapperId:t});r(i)})).catch((function(){}))}),[t]),n},h=function(){var t=(0,s.useState)(null),e=t[0],n=t[1];return(0,s.useEffect)((function(){u.bundlePromise.then((function(t){var e,r=null===(e=t.components)||void 0===e?void 0:e.PlayerDataContext;n(r)})).catch((function(){}))}),[]),e};e.withPlayerContext=function(t){return function(n){return function(i){return s.default.createElement(e.PlayerProvider,{playerWrapperId:t},s.default.createElement(n,r({},i)))}}}},6602:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.useTivioReadyData=e.useTivioData=e.TivioProvider=void 0;var a=o(n(9297)),s=n(9958),u=n(8643),c=n(1903),h=n(5256),l=(0,u.createUseRemoteBundle)(),f=a.default.createContext(null);e.TivioProvider=function(t){var e=t.children,n=t.conf,r=(0,s.createInternalConf)(null!=n?n:null),i=l(r);(0,a.useEffect)((function(){(0,h.injectSentryToWindow)()}),[]);var o="ready"===(null==i?void 0:i.state)&&i.components?a.default.createElement(i.components.Provider,{language:r.language,disableUnmounting:r.disableUnmounting},e):e;return a.default.createElement(c.ContextProvider,null,a.default.createElement(f.Provider,{value:i},o))},e.useTivioData=function(){var t=(0,a.useContext)(f);if(null===t)throw new Error("Make sure to wrap your app in <TivioProvider conf={...}><App/></TivioProvider>");return t},e.useTivioReadyData=function(){var t=(0,e.useTivioData)();return"ready"===t.state?t:null}},2411:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.TivioWidget=void 0;var a=o(n(9297)),s=n(6602),u=n(8057);e.TivioWidget=a.default.forwardRef((function(t,e){var n=t.id,r=t.onBlur,i=t.onEnabled;if("string"!=typeof n||!n.length)return a.default.createElement(u.TivioWidgetError,{error:"TivioWidget must have a mandatory property 'id'."});var o=(0,s.useTivioData)(),c=o.state,h=o.error,l=o.components,f=o.conf,p=f.ErrorComponent,d=f.LoaderComponent;switch((0,a.useEffect)((function(){"error"===c&&(null==i||i(!1))}),[c]),c){case"error":return a.default.createElement(p,{error:h});case"loading":return a.default.createElement(d,null);case"ready":return l?a.default.createElement(l.Widget,{id:n,ref:e,onEnabled:i,onBlur:r}):null}}))},8057:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TivioWidgetError=void 0;var i=r(n(9297));e.TivioWidgetError=function(t){var e=t.error;return i.default.createElement("div",{style:{backgroundColor:"#d84f92",color:"#fff",padding:"1rem"}},e)}},6868:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TivioWidgetLoader=void 0;var i=r(n(9297));e.TivioWidgetLoader=function(){return i.default.createElement("div",null,"loading...")}},9448:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.ChannelsContextProvider=e.ChannelsContext=void 0;var s=a(n(9297)),u=(0,s.createContext)({data:{},setData:function(){return null}});e.ChannelsContext=u,e.ChannelsContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useRef)(n);return s.default.createElement(u.Provider,{value:{data:n,setData:function(t,e){var n,a=r(r({},o.current),((n={})[t]=e,n));o.current=a,i(a)}}},t.children)}},7571:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.OrganizationSubscriptionsContext=e.OrganizationSubscriptionsContextProvider=void 0;var a=o(n(9297)),s=(0,a.createContext)({subscriptions:[],setSubscriptions:function(){return null}});e.OrganizationSubscriptionsContext=s,e.OrganizationSubscriptionsContextProvider=function(t){var e=(0,a.useState)([]),n=e[0],r=e[1];return a.default.createElement(s.Provider,{value:{subscriptions:n,setSubscriptions:r}},t.children)}},2860:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.PurchasesWithVideosContextProvider=e.PurchasesWithVideosContext=void 0;var a=o(n(9297)),s=(0,a.createContext)({purchases:[],setPurchases:function(){return null}});e.PurchasesWithVideosContext=s,e.PurchasesWithVideosContextProvider=function(t){var e=(0,a.useState)([]),n=e[0],r=e[1];return a.default.createElement(s.Provider,{value:{purchases:n,setPurchases:r}},t.children)}},988:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.RowItemsContextProvider=e.RowItemsContext=void 0;var s=a(n(9297)),u=(0,s.createContext)(null);e.RowItemsContext=u,e.RowItemsContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useCallback)((function(t,e){i((function(n){var i;return r(r({},n),((i={})[t]=e,i))}))}),[n]);return s.default.createElement(u.Provider,{value:{data:n,setData:o}},t.children)}},853:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.ScreensContextProvider=e.ScreensContext=void 0;var s=a(n(9297)),u=(0,s.createContext)(null);e.ScreensContext=u,e.ScreensContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useCallback)((function(t,e){var o,a=r(r({},n),((o={})[t]=e,o));i(a)}),[n]);return s.default.createElement(u.Provider,{value:{data:n,setData:o}},t.children)}},2141:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.SectionsContextProvider=e.SectionsContext=void 0;var s=a(n(9297)),u=(0,s.createContext)({data:{},setData:function(){return null}});e.SectionsContext=u,e.SectionsContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useRef)(n);return s.default.createElement(u.Provider,{value:{data:n,setData:function(t,e){var n,a=r(r({},o.current),((n={})[t]=e,n));o.current=a,i(a)}}},t.children)}},7661:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.UserContext=e.UserContextProvider=void 0;var a=o(n(9297)),s=(0,a.createContext)({user:null,setUser:function(){return null}});e.UserContext=s,e.UserContextProvider=function(t){var e=(0,a.useState)(null),n=e[0],r=e[1];return a.default.createElement(s.Provider,{value:{user:n,setUser:r}},t.children)}},661:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.VideosContextProvider=e.VideosContext=void 0;var s=a(n(9297)),u=(0,s.createContext)({data:{},setData:function(){return null}});e.VideosContext=u,e.VideosContextProvider=function(t){var e=(0,s.useState)({}),n=e[0],i=e[1],o=(0,s.useRef)(n);return s.default.createElement(u.Provider,{value:{data:n,setData:function(t,e){var n,a=r(r({},o.current),((n={})[t]=e,n));o.current=a,i(a)}}},t.children)}},5925:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(9448),e),i(n(7571),e),i(n(2860),e),i(n(853),e),i(n(2141),e),i(n(7661),e),i(n(661),e),i(n(988),e)},6766:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ChannelsContext=e.SectionsContext=e.VideosContext=e.useChannelsInWidget=e.useSectionsInChannel=e.useVideosInSection=e.useVideo=e.useSection=e.useIsLoaded=e.useChannel=e.useWidget=void 0;var r=n(9297),i=n(1920),o=n(2782),a=n(5925);Object.defineProperty(e,"ChannelsContext",{enumerable:!0,get:function(){return a.ChannelsContext}}),Object.defineProperty(e,"SectionsContext",{enumerable:!0,get:function(){return a.SectionsContext}}),Object.defineProperty(e,"VideosContext",{enumerable:!0,get:function(){return a.VideosContext}});var s=(0,o.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});e.useWidget=function(t){var e=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(""),o=n[0],a=n[1],s=(0,r.useState)(null),u=s[0],c=s[1],h=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){return e&&e.subscribeToWidget(t,(function(t,e,n){var r,i,o;t&&a(t.message),e&&(null===(r=e.lastVideo)||void 0===r||r.transaction,null===(i=e.lastVideo)||void 0===i||i.subscriptions,null===(o=e.lastVideo)||void 0===o||o.monetizations,c(e)),n&&(h.current=n)})),function(){var t;null===(t=h.current)||void 0===t||t.call(h)}}),[e]),{error:o,widget:u}},e.useChannel=function(t){var e=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(null),o=n[0],a=n[1],u=(0,r.useState)(null),c=u[0],h=u[1];return(0,r.useEffect)((function(){e&&(s.info("subscribe to channel with id "+t),e.subscribeToChannel(t,(function(t,e){t&&(s.error("failed to subscribe to channel: ",t),a(t.message)),e&&(s.error("channel data received"),h(e))})))}),[e]),{error:o,data:c}},e.useSection=function(t){var e=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(null),o=n[0],a=n[1],u=(0,r.useState)(null),c=u[0],h=u[1];return(0,r.useEffect)((function(){e&&(s.info("subscribe to section with id "+t),e.subscribeToSection(t,(function(t,e){t&&(s.error("failed to subscribe to section: ",t),a(t.message)),e&&(s.info("section data received"),h(e))})))}),[e]),{error:o,data:c}},e.useVideo=function(t){var e=(0,i.useTivioData)().subscriptions,n=(0,r.useState)(null),o=n[0],a=n[1],s=(0,r.useState)(null),u=s[0],c=s[1],h=(0,r.useRef)(void 0);return(0,r.useEffect)((function(){if(t)return e?(e.subscribeToVideo(t,(function(t,e,n){t&&a(t.message),e&&(e.transaction,e.subscriptions,e.monetizations,c({id:e.id,cover:e.cover,assets:e.assets,created:e.created,sectionId:e.sectionId,channelId:e.channelId,duration:e.duration,path:e.path,image:e.image,itemType:e.itemType,isPlayable:e.isPlayable,monetization:e.monetization,transaction:e.transaction,transactionId:e.transactionId,subscriptions:e.subscriptions,subscriptionIds:e.subscriptionIds,monetizations:e.monetizations,isPlaylist:e.isPlaylist,name:e.name,description:e.description,price:e.price,uri:e.uri,url:e.url})),h.current=n})),function(){var t;null===(t=h.current)||void 0===t||t.call(h)}):void 0;a("not-found")}),[e,t]),{error:o,data:u}},e.useVideosInSection=function(t,e){void 0===e&&(e=10);var n=(0,i.useTivioData)().subscriptions,o=(0,r.useContext)(a.VideosContext),u=o.data[null!=t?t:""];return(0,r.useEffect)((function(){n&&t&&(u||(s.info("subscribe to videos in section "+t),n.subscribeToVideosInSection(t,(function(e,n,r,i){e&&(s.error("failed to subscribe to videos in section: ",e),o.setData(t,{error:e,data:null,isLoading:i})),n&&(s.info("videos data received"),n.videos.forEach((function(t){return t.monetization})),n.videos.forEach((function(t){return t.subscriptions.map((function(t){return t.price}))})),n.videos.forEach((function(t){var e;return null===(e=t.transaction)||void 0===e?void 0:e.price})),o.setData(t,{data:{items:n.videos,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},error:e,isLoading:i}))}),e)))}),[n,t,o]),{error:u?u.error:null,data:u?u.data:null,isLoading:!!u&&u.isLoading}},e.useSectionsInChannel=function(t,e){void 0===e&&(e=10);var n=(0,i.useTivioData)().subscriptions,o=(0,r.useContext)(a.SectionsContext),u=o.data[t];return(0,r.useEffect)((function(){n&&(u||(s.info("subscribe to sections in channel with id "+t),n.subscribeToSectionsInChannel(t,(function(e,n,r,i){e&&(s.error("failed to subscribe to sections in channel: ",e),o.setData(t,{error:e,data:null,isLoading:i})),n&&(s.info("sections data received"),o.setData(t,{error:e,data:{items:n.sections,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:i}))}),e)))}),[n]),{error:u?u.error:null,data:u?u.data:null,isLoading:!!u&&u.isLoading}},e.useChannelsInWidget=function(t,e){void 0===e&&(e=10);var n=(0,i.useTivioData)().subscriptions,o=(0,r.useContext)(a.ChannelsContext),u=o.data[t];return(0,r.useEffect)((function(){n&&(u||(s.info("subscribe to channels in widget with id: "+t),n.subscribeToChannelsInWidget(t,(function(e,n,r,i){e&&(s.error("failed to subscribe to channels in widget: ",e),o.setData(t,{error:e,data:null,isLoading:i})),n&&(s.info("channels data received"),o.setData(t,{error:e,data:{items:n.channels,hasNextPage:n.hasNextPage,fetchMore:function(){return null==r?void 0:r()}},isLoading:i}))}),e)))}),[n]),{error:u?u.error:null,data:u?u.data:null,isLoading:!!u&&u.isLoading}},e.useIsLoaded=function(){var t=(0,r.useState)(!1),e=t[0],n=t[1],o=(0,i.useTivioData)();return(0,r.useEffect)((function(){o.getters&&o.getters.isTivioLoaded(n)}),[o]),{isTivioLoaded:e}}},8682:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(2883),e),i(n(2596),e),i(n(5469),e),i(n(2639),e),i(n(7802),e),i(n(1350),e),i(n(6766),e),i(n(6862),e),i(n(6311),e),i(n(1197),e),i(n(3419),e),i(n(9814),e)},6862:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.useExportedConfig=e.useAdSegment=e.useStartMarker=e.useSeekState=e.useCurrentMarker=e.useAd=e.useIntro=e.useBetOffer=e.useMarkers=e.usePlayerEvent=void 0;var r=n(9297),i=n(2585),o=n(6602);e.usePlayerEvent=function(t){var e=(0,r.useContext)(i.PlayerContext);if(void 0===e)throw new Error("usePlayerEvent must be inside PlayerContext");var n=(0,r.useState)(null),o=n[0],a=n[1];return(0,r.useEffect)((function(){if(null==e?void 0:e.events)return e.events.addListener(t,a),function(){return e.events.removeListener(t,a)}}),[null==e?void 0:e.events]),o},e.useMarkers=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useMarkers must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("markers",o),function(){return t.events.removeListener("markers",o)}}),[null==t?void 0:t.events]),n},e.useBetOffer=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useBetOffer must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("bet-offer",o),function(){return t.events.removeListener("bet-offer",o)}}),[null==t?void 0:t.events]),n},e.useIntro=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useIntro must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("intro",o),function(){return t.events.removeListener("intro",o)}}),[null==t?void 0:t.events]),n},e.useAd=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useAd must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1],a=function(){var t=(0,r.useRef)(0),e=(0,r.useState)(null),n=(e[0],e[1]);return(0,r.useCallback)((function(){t.current++,n(t.current)}),[])}();return(0,r.useEffect)((function(){if(null==t?void 0:t.events){t.events.addListener("ad",o);var e="ad-rerender",n="ad-seconds-to-skippable-changed";return t.events.isSupported(e)&&t.events.addListener(e,a),t.events.isSupported(n)&&t.events.addListener(n,a),function(){t.events.removeListener("ad",o),t.events.isSupported(e)&&t.events.removeListener(e,a),t.events.isSupported(n)&&t.events.addListener(n,a)}}}),[null==t?void 0:t.events]),n},e.useCurrentMarker=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useCurrentMarker must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("current-marker",o),function(){return t.events.removeListener("current-marker",o)}}),[null==t?void 0:t.events]),n},e.useSeekState=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useSeekState must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events){var e=function(){return o(!1)},n=function(){return o(!0)};return t.events.addListener("disable-seek",e),t.events.addListener("enable-seek",n),function(){t.events.removeListener("disable-seek",e),t.events.removeListener("enable-seek",n)}}}),[null==t?void 0:t.events]),n},e.useStartMarker=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useStartMarker must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("start-marker",o),function(){return t.events.removeListener("start-marker",o)}}),[null==t?void 0:t.events]),n},e.useAdSegment=function(){var t=(0,r.useContext)(i.PlayerContext);if(void 0===t)throw new Error("useAdSegmentMarker must be inside PlayerContext");var e=(0,r.useState)(null),n=e[0],o=e[1];return(0,r.useEffect)((function(){if(null==t?void 0:t.events)return t.events.addListener("ad-segment-changed",o),function(){return t.events.removeListener("ad-segment-changed",o)}}),[null==t?void 0:t.events]),n},e.useExportedConfig=function(){var t,e=(0,o.useTivioData)(),n=(0,r.useState)(null),i=n[0],a=n[1],s=null===(t=null==e?void 0:e.getters)||void 0===t?void 0:t.getExportedConfig;return(0,r.useEffect)((function(){null==s||s().then(a)}),[s]),i}},6201:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.useError=void 0;var r=n(9297);e.useError=function(){var t=(0,r.useState)(null),e=t[0],n=t[1];return{error:e,raiseError:function(t){n(t)},resetError:function(){return n(null)}}}},3419:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFreePurchase=void 0;var o=n(6602);e.useFreePurchase=function(){var t=(0,o.useTivioData)().auth;return{purchase:function(e){return r(void 0,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return t?[4,t.createFreePurchase(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}}}},2639:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.useItemsInRow=void 0;var r=n(9297),i=n(6602),o=n(6201);e.useItemsInRow=function(t,e){void 0===e&&(e={noLimit:!1,limit:3});var n=(0,i.useTivioData)().subscriptions,a=(0,r.useState)(null),s=a[0],u=a[1],c=(0,o.useError)(),h=c.error,l=c.raiseError,f=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(f.current=n.subscribeToItemsInRow(t,(function(t,e){t&&l(t),e&&u({items:e.items,fetchMore:e.fetchMore})}),e)),function(){var t;null===(t=f.current)||void 0===t||t.call(f)}}),[n]),{pagination:s,error:h}}},6311:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.useOrganizationSubscriptions=void 0;var o=n(9297),a=n(7571),s=n(6602),u=n(6766);e.useOrganizationSubscriptions=function(){var t=(0,o.useContext)(a.OrganizationSubscriptionsContext),e=t.setSubscriptions,n=t.subscriptions,c=(0,s.useTivioData)().getters,h=(0,u.useIsLoaded)().isTivioLoaded;return(0,o.useEffect)((function(){r(void 0,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return c&&h&&0===n.length?[4,c.getOrganizationSubscriptions()]:[3,2];case 1:(t=r.sent())&&e(t),r.label=2;case 2:return[2]}}))}))}),[h]),{subscriptions:n}}},1350:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.usePurchaseSubscription=void 0;var o=n(9297),a=n(6602),s=n(2883);e.usePurchaseSubscription=function(t){var e=(0,o.useState)(null),n=e[0],u=e[1],c=(0,o.useState)(""),h=c[0],l=c[1],f=(0,a.useTivioData)().purchaseSubscriptionWithQerko,p=(0,s.useUser)().user,d=(0,o.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var e,n;return i(this,(function(r){switch(r.label){case 0:if(l(""),!f)throw new Error("purchaseVideoWithQerko not in bundle");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,f(t)];case 2:return e=r.sent(),u(e),[3,4];case 3:return(n=r.sent())instanceof Error&&l(n.message),[3,4];case 4:return[2]}}))}))}),[f]),v=(0,o.useMemo)((function(){if(!p)return"NEW";var e=p.purchases.find((function(e){return e.monetizationId===t}));return e?e.status:"NEW"}),[p]);return(0,o.useEffect)((function(){d()}),[d]),{paymentError:h,paymentInfo:n,paymentStatus:v,getPaymentInfo:d}}},1197:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.usePurchasesWithVideos=void 0;var o=n(9297),a=n(2860),s=n(6602),u=n(2883);e.usePurchasesWithVideos=function(){var t=(0,u.useUser)().user,e=(0,s.useTivioData)().auth,n=(0,o.useContext)(a.PurchasesWithVideosContext),c=n.purchases,h=n.setPurchases;return(0,o.useEffect)((function(){r(void 0,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return e?t&&t.purchasedVods.length!==c.length?(n=h,[4,e.getPurchasedVodsWithInitializedVideos()]):[3,2]:[2];case 1:n.apply(void 0,[r.sent()]),r.label=2;case 2:return[2]}}))}))}),[t,e]),{purchases:c}}},9814:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.useRowsInScreen=void 0;var r=n(9297),i=n(6602),o=n(6201);e.useRowsInScreen=function(t,e){void 0===e&&(e={noLimit:!1,limit:3});var n=(0,i.useTivioData)().subscriptions,a=(0,r.useState)(null),s=a[0],u=a[1],c=(0,o.useError)(),h=c.error,l=c.raiseError,f=(0,r.useRef)();return(0,r.useEffect)((function(){return n&&(f.current=n.subscribeToRowsInScreen(t,(function(t,e){t&&l(t),e&&u({fetchMore:e.fetchMore,items:e.items})}),e)),function(){var t;null===(t=f.current)||void 0===t||t.call(f)}}),[n]),{pagination:s,error:h}}},5469:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.useScreen=void 0;var r=n(2965),i=n(9297),o=n(5925),a=n(6602);e.useScreen=function(t,e){var n,s,u,c=(0,a.useTivioData)().subscriptions,h=(0,i.useContext)(o.ScreensContext),l=null==h?void 0:h.data[t],f=(0,i.useRef)(null);return(0,i.useEffect)((function(){return c&&h&&null==f.current&&(f.current=null==c?void 0:c.subscribeToScreen(t,(function(e,n){var i;e&&h.setData(t,{error:e,data:null,isLoading:!1}),n&&h.setData(t,{error:e,data:{id:n.screenId,name:n.name,description:n.description,assets:(0,r.toJS)(n.assets),rows:(null!==(i=n.rows)&&void 0!==i?i:[]).map((function(t){return{id:t.rowId,name:t.name,rowId:t.rowId,description:t.description,assets:(0,r.toJS)(t.assets),itemComponent:t.itemComponent,rowComponent:t.rowComponent}}))},isLoading:!1})}),e)),function(){var t;null===(t=f.current)||void 0===t||t.call(f)}}),[c]),{error:null!==(n=null==l?void 0:l.error)&&void 0!==n?n:null,data:null!==(s=null==l?void 0:l.data)&&void 0!==s?s:null,isLoading:null===(u=null==l?void 0:l.isLoading)||void 0===u||u}}},2596:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.useScreens=void 0;var o=n(9297),a=n(6602);e.useScreens=function(){var t=(0,a.useTivioData)().getters,e=(0,o.useState)([]),n=e[0],s=e[1];return(0,o.useEffect)((function(){t&&r(void 0,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return[4,t.getOrganizationScreens()];case 1:return e=n.sent(),s(e),[2]}}))}))}),[t]),{screens:n}}},7802:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.useTransactionPayment=void 0;var o=n(7823),a=n(9297),s=n(1920),u=n(6602);e.useTransactionPayment=function(t,e){var n=(0,a.useState)(null),c=n[0],h=n[1],l=(0,a.useState)(""),f=l[0],p=l[1],d=(0,u.useTivioData)().purchaseVideoWithQerko,v=(0,s.useUser)().user,y=(0,a.useCallback)((function(){return r(void 0,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:if(p(""),!d)throw new Error("purchaseVideoWithQerko not in bundle");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,d(t,e)];case 2:return n=i.sent(),h(n),[3,4];case 3:return r=i.sent(),p(r.message),[3,4];case 4:return[2]}}))}))}),[d]);(0,a.useEffect)((function(){y()}),[]);var m=(0,o.useObserver)((function(){if(c&&v){var n=v.purchases.find((function(n){return n.monetizationId===e&&n.videoId===t}));if(n)return n.status}return"new"}));return{paymentInfo:c,paymentError:f,paymentStatus:m,getPaymentInfo:y}}},2883:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.useUser=void 0;var i=n(9297),o=n(2782),a=n(7661),s=n(6602),u=(0,o.createLogger)({isConsoleEnabled:!0,isSentryEnabled:!1});e.useUser=function(){var t=(0,i.useContext)(a.UserContext),e=t.user,n=t.setUser,o=(0,s.useTivioData)().subscriptions,c=(0,i.useState)(null),h=c[0],l=c[1];return(0,i.useEffect)((function(){o&&!e&&o.subscribeToUser((function(t,e){t&&(u.error(t),l(t)),e&&n(r({},e))}))}),[o]),{user:e,error:h}}},9958:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.createInternalConf=e.defaultConf=void 0;var i=n(8057),o=n(6868),a=n(2782),s=n(9373),u=n(1675);e.defaultConf={secret:null,resolverUrl:"https://tivio-resolver-production.tiv.io/serveBundle/resolver2.js",disableUnmounting:!1,fetchPackage:s.fetchPackage,pubSub:(0,u.getPubSub)(),LoaderComponent:o.TivioWidgetLoader,ErrorComponent:i.TivioWidgetError},e.createInternalConf=function(t){return r(r(r({},e.defaultConf),null!=t?t:{}),{logger:void 0!==(null==t?void 0:t.logger)?t.logger:(0,a.createLogger)({isConsoleEnabled:!0}),sdkVersion:"2.1.5"})}},9393:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},1920:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.bundlePromise=e.withPlayerContext=e.PlayerProvider=void 0;var o=n(2585);Object.defineProperty(e,"PlayerProvider",{enumerable:!0,get:function(){return o.PlayerProvider}}),Object.defineProperty(e,"withPlayerContext",{enumerable:!0,get:function(){return o.withPlayerContext}});var a=n(9517);Object.defineProperty(e,"bundlePromise",{enumerable:!0,get:function(){return a.bundlePromise}}),i(n(8682),e),i(n(6602),e),i(n(2411),e),i(n(8057),e),i(n(6868),e),i(n(9393),e),i(n(8643),e),i(n(1675),e),i(n(3173),e),(0,n(5256).initSentry)()},8643:function(t,e,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.createUseRemoteBundle=e.createRemotePackageLoader=e.fetchBundle=void 0;var a=n(9297),s=n(2229),u=n(6614),c=function(t){var e=t.resolverUrl;return(0,t.fetchPackage)(e)},h=function(t,e){return i(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return e.bundleUrlOverride?(console.info("@tivio: Fetching bundle directly based on config.bundleUrlOverride",e.bundleUrlOverride),[4,fetch(e.bundleUrlOverride)]):[3,3];case 1:return[4,n.sent().text()];case 2:return[2,n.sent()];case 3:return[2,c(e).then((function(n){var r,i={},o={exports:i};try{new Function("require","module","exports",n)(s.resolveShared,o,i)}catch(t){return Promise.reject("Cannot load Tivio Resolver "+t)}return"function"!=typeof(null===(r=o.exports.tivio)||void 0===r?void 0:r.fetch)?Promise.reject("Invalid Tivio Resolver export"):o.exports.tivio.fetch(t,e.sdkVersion)}))]}}))}))};e.fetchBundle=h;var l=function(){return function(t,e){return i(void 0,void 0,void 0,(function(){return o(this,(function(n){return[2,h(t,e).then((function(t){var e={},n={exports:e};try{new Function("require","module","exports",t)(s.resolveShared,n,e)}catch(t){return Promise.reject("Cannot load module "+t)}return"object"!=typeof n.exports.Tivio?Promise.reject('Tivio package does not export "Tivio" namespace'):"object"!=typeof n.exports.Tivio.components?Promise.reject('Tivio namespace does not export "components" member'):"function"!=typeof n.exports.Tivio.setUser?Promise.reject('Tivio namespace does not export "setUser" member'):"function"!=typeof n.exports.Tivio.init?Promise.reject('Tivio namespace does not export "init" member'):n.exports.Tivio}))]}))}))}};e.createRemotePackageLoader=l,e.createUseRemoteBundle=function(){var t=l(),e=!1;return function(n){var s=(0,u.createSettings)(n),c=(0,a.useState)({auth:null,components:null,conf:n,error:null,getters:null,init:null,purchaseSubscriptionWithQerko:null,purchaseVideoWithQerko:null,setLanguage:null,settings:s,setUser:null,sources:null,hooks:null,state:"loading",subscriptions:null}),h=c[0],l=c[1];return(0,a.useEffect)((function(){null!=n.secret&&!1!==n.enable&&t(n.secret,n).then((function(t){return i(void 0,void 0,void 0,(function(){var r;return o(this,(function(i){switch(i.label){case 0:return e?[3,2]:[4,t.init(n)];case 1:i.sent(),e=!0,i.label=2;case 2:return s.onSetUser(t.setUser),r={auth:t.auth,components:t.components,conf:n,error:null,getters:t.getters,init:t.init,purchaseSubscriptionWithQerko:t.purchaseSubscriptionWithQerko,purchaseVideoWithQerko:t.purchaseVideoWithQerko,setLanguage:t.setLanguage,settings:s,setUser:t.setUser,sources:t.sources,hooks:t.hooks,state:"ready",subscriptions:t.subscriptions},l(r),n.pubSub.publish("on-ready",r),[2]}}))}))})).catch((function(t){var e;null===(e=n.logger)||void 0===e||e.exception(t),l(r(r({},h),{conf:n,error:""+t,settings:s,state:"error"})),n.pubSub.publish("on-error",t)}))}),[]),h}}},9517:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.bundlePromise=void 0;var r=n(1675);e.bundlePromise=new Promise((function(t,e){(0,r.getPubSub)().subscribe("on-ready",(function(e){t(e)})),(0,r.getPubSub)().subscribe("on-error",(function(t){e(t)}))})).catch((function(t){throw console.error("@tivio/sdk-react failed to load. Reason:",t),t})).then((function(t){return console.info("@tivio/sdk-react loaded successfully."),t}))},2229:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveShared=void 0;var s=a(n(5532));n(284),n(2189);var u=o(n(2965)),c=o(n(9297)),h=o(n(2268)),l=o(n(9914)),f={mobx:u,firebase:s.default,react:c,React:c,"react-dom":h,"styled-components":l};e.resolveShared=function(t){if(!(t in f))throw new Error("Could not resolve shared dependency "+t);return f[t]}},2782:function(t,e,n){var r=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;var i=n(5256);e.createLogger=function(t){var e=!1!==t.isSentryEnabled,n=function(n,o){t.isConsoleEnabled&&console[n].apply(console,r(["Tivio SDK "],o,!1)),e&&(null===i.Sentry||void 0===i.Sentry||i.Sentry.captureMessage(""+o,i.Sentry.Severity.fromString(n)))};return{error:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n("error",t)},info:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n("info",t)},warn:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n("warn",t)},debug:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n("debug",t)},exception:function(n){t.isConsoleEnabled&&console.error(n),e&&(null===i.Sentry||void 0===i.Sentry||i.Sentry.captureException(n))}}}},9373:function(t,e){var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchPackage=void 0;var i={cache:"no-store"},o=function(t){var e=t.headers.get("content-type");return 200!==t.status?Promise.reject('Incorrect status "'+t.status+'" was obtained while fetching the module.'):e&&(e.includes("application/javascript")||e.includes("text/javascript"))?t.text():Promise.reject('Incorrect content "'+e+'" was obtained while fetching the module.')},a=function(t){return Promise.reject("Network failure: "+t)};e.fetchPackage=function(t){return n(void 0,void 0,void 0,(function(){return r(this,(function(e){return[2,fetch(t,i).then(o).catch(a)]}))}))}},1675:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getPubSub=e.createPubSub=void 0,e.createPubSub=function(){var t=new Map;return{publish:function(e,n){var r;null===(r=t.get(e))||void 0===r||r.forEach((function(t){(0,t.onMessage)(n)}))},subscribe:function(e,n){var r=(new Date).getTime();return t.has(e)||t.set(e,[]),t.get(e).push({id:r,onMessage:n}),function(){var n,i=null!==(n=t.get(e))&&void 0!==n?n:[],o=i.findIndex((function(t){return t.id===r}));-1!==o&&i.splice(o,1)}}}};var n=null;e.getPubSub=function(){return null===n&&(n=(0,e.createPubSub)()),n}},5256:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.injectSentryToWindow=e.initSentry=e.Sentry=void 0;var a=o(n(5451)),s="true"===process.env.DISABLE_SENTRY;e.Sentry=s?null:a,e.initSentry=function(){e.Sentry?(null===e.Sentry||void 0===e.Sentry||e.Sentry.init({dsn:"https://8b9d489695004b0da95481f939b0455d@o507550.ingest.sentry.io/5600271",release:"@tivio/sdk-react@2.1.5",tracesSampleRate:1}),console.info("@tivio: Sentry enabled")):console.info("@tivio: Sentry disabled")},e.injectSentryToWindow=function(){e.Sentry&&(window.sentry=e.Sentry,console.info("@tivio: Sentry added to window"))}},6614:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.createSettings=void 0,e.createSettings=function(t){var e=null,n=null;return{onSetUser:function(r){var i;"function"!=typeof r?null===(i=t.logger)||void 0===i||i.exception("Tivio Bundle setUser handler must be a function"):(e=r,null!==n&&r(n.userId,n.userPayload))},setUser:function(t,r){"function"==typeof e?(n=null,e(t,r)):n={userId:t,userPayload:r}}}}},3173:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},5163:function(t,e,n){n.d(e,{ZT:function(){return i},pi:function(){return o},mG:function(){return a},Jh:function(){return s},XA:function(){return u},CR:function(){return c},ev:function(){return h}});var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function h(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create,Object.create},2965:function(t){t.exports=e},9297:function(e){e.exports=t},2268:function(t){t.exports=n},9914:function(t){t.exports=r}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={id:t,loaded:!1,exports:{}};return i[t].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}return a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.hmd=function(t){return(t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a(1920)}()}));